@ronak27/superwise-chatbot-package 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import He, { memo as ve, useState as S, useRef as Z, useEffect as A, useMemo as xe, useCallback as Y } from "react";
2
- var he = { exports: {} }, K = {};
2
+ var he = { exports: {} }, Q = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.js
@@ -11,10 +11,10 @@ var he = { exports: {} }, K = {};
11
11
  */
12
12
  var Ce;
13
13
  function Re() {
14
- if (Ce) return K;
14
+ if (Ce) return Q;
15
15
  Ce = 1;
16
16
  var r = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
17
- function a(p, o, c) {
17
+ function s(p, o, c) {
18
18
  var i = null;
19
19
  if (c !== void 0 && (i = "" + c), o.key !== void 0 && (i = "" + o.key), "key" in o) {
20
20
  c = {};
@@ -29,9 +29,9 @@ function Re() {
29
29
  props: c
30
30
  };
31
31
  }
32
- return K.Fragment = n, K.jsx = a, K.jsxs = a, K;
32
+ return Q.Fragment = n, Q.jsx = s, Q.jsxs = s, Q;
33
33
  }
34
- var Q = {};
34
+ var ee = {};
35
35
  /**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
@@ -56,9 +56,9 @@ function _e() {
56
56
  return "Profiler";
57
57
  case W:
58
58
  return "StrictMode";
59
- case re:
60
- return "Suspense";
61
59
  case ne:
60
+ return "Suspense";
61
+ case oe:
62
62
  return "SuspenseList";
63
63
  case M:
64
64
  return "Activity";
@@ -69,14 +69,14 @@ function _e() {
69
69
  ), t.$$typeof) {
70
70
  case j:
71
71
  return "Portal";
72
- case ee:
72
+ case te:
73
73
  return t.displayName || "Context";
74
74
  case z:
75
75
  return (t._context.displayName || "Context") + ".Consumer";
76
- case te:
76
+ case re:
77
77
  var l = t.render;
78
78
  return t = t.displayName, t || (t = l.displayName || l.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
79
- case oe:
79
+ case ae:
80
80
  return l = t.displayName || null, l !== null ? l : r(t.type) || "Memo";
81
81
  case R:
82
82
  l = t._payload, t = t._init;
@@ -90,7 +90,7 @@ function _e() {
90
90
  function n(t) {
91
91
  return "" + t;
92
92
  }
93
- function a(t) {
93
+ function s(t) {
94
94
  try {
95
95
  n(t);
96
96
  var l = !1;
@@ -119,7 +119,7 @@ function _e() {
119
119
  }
120
120
  }
121
121
  function o() {
122
- var t = ae.A;
122
+ var t = ie.A;
123
123
  return t === null ? null : t.getOwner();
124
124
  }
125
125
  function c() {
@@ -146,7 +146,7 @@ function _e() {
146
146
  }
147
147
  function d() {
148
148
  var t = r(this.type);
149
- return ie[t] || (ie[t] = !0, console.error(
149
+ return le[t] || (le[t] = !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
  )), t = this.props.ref, t !== void 0 ? t : null;
152
152
  }
@@ -214,7 +214,7 @@ React keys must be passed directly to JSX without using spread:
214
214
  b
215
215
  ), ce[b + C] = !0);
216
216
  }
217
- if (b = null, g !== void 0 && (a(g), b = "" + g), i(l) && (a(l.key), b = "" + l.key), "key" in l) {
217
+ if (b = null, g !== void 0 && (s(g), b = "" + g), i(l) && (s(l.key), b = "" + l.key), "key" in l) {
218
218
  g = {};
219
219
  for (var $ in l)
220
220
  $ !== "key" && (g[$] = l[$]);
@@ -237,7 +237,7 @@ React keys must be passed directly to JSX without using spread:
237
237
  function I(t) {
238
238
  return typeof t == "object" && t !== null && t.$$typeof === h;
239
239
  }
240
- var u = He, h = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), H = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), ee = Symbol.for("react.context"), te = Symbol.for("react.forward_ref"), re = Symbol.for("react.suspense"), ne = Symbol.for("react.suspense_list"), oe = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), M = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), ae = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, B = Array.isArray, P = console.createTask ? console.createTask : function() {
240
+ var u = He, h = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), H = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), te = Symbol.for("react.context"), re = Symbol.for("react.forward_ref"), ne = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), M = Symbol.for("react.activity"), se = Symbol.for("react.client.reference"), ie = u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, B = Array.isArray, P = console.createTask ? console.createTask : function() {
241
241
  return null;
242
242
  };
243
243
  u = {
@@ -245,12 +245,12 @@ React keys must be passed directly to JSX without using spread:
245
245
  return t();
246
246
  }
247
247
  };
248
- var G, ie = {}, O = u.react_stack_bottom_frame.bind(
248
+ var G, le = {}, O = u.react_stack_bottom_frame.bind(
249
249
  u,
250
250
  c
251
251
  )(), D = P(p(c)), ce = {};
252
- Q.Fragment = H, Q.jsx = function(t, l, g) {
253
- var C = 1e4 > ae.recentlyCreatedOwnerStacks++;
252
+ ee.Fragment = H, ee.jsx = function(t, l, g) {
253
+ var C = 1e4 > ie.recentlyCreatedOwnerStacks++;
254
254
  return f(
255
255
  t,
256
256
  l,
@@ -259,8 +259,8 @@ React keys must be passed directly to JSX without using spread:
259
259
  C ? Error("react-stack-top-frame") : O,
260
260
  C ? P(p(t)) : D
261
261
  );
262
- }, Q.jsxs = function(t, l, g) {
263
- var C = 1e4 > ae.recentlyCreatedOwnerStacks++;
262
+ }, ee.jsxs = function(t, l, g) {
263
+ var C = 1e4 > ie.recentlyCreatedOwnerStacks++;
264
264
  return f(
265
265
  t,
266
266
  l,
@@ -270,7 +270,7 @@ React keys must be passed directly to JSX without using spread:
270
270
  C ? P(p(t)) : D
271
271
  );
272
272
  };
273
- }()), Q;
273
+ }()), ee;
274
274
  }
275
275
  process.env.NODE_ENV === "production" ? he.exports = Re() : he.exports = _e();
276
276
  var e = he.exports;
@@ -284,9 +284,9 @@ const Me = [
284
284
  function Pe(r) {
285
285
  if (typeof r != "string" || r.length === 0) return r;
286
286
  let n = r;
287
- for (const a of Me)
287
+ for (const s of Me)
288
288
  for (; ; ) {
289
- const p = n.indexOf(a);
289
+ const p = n.indexOf(s);
290
290
  if (p === -1) break;
291
291
  const o = n.indexOf("{", p);
292
292
  if (o === -1) break;
@@ -306,7 +306,7 @@ function Pe(r) {
306
306
  }
307
307
  return n.includes("Parameters:") && (n = n.split("Parameters:")[0].trim()), n;
308
308
  }
309
- async function Ve(r, n = [], a = [], p = "", o = "", c = null) {
309
+ async function Ve(r, n = [], s = [], p = "", o = "", c = null) {
310
310
  var f, v, I;
311
311
  const w = "https://sage-api-ttyw-stage.superwise.ai/api/v1/" + "chat", d = Array.isArray(n) ? n.map((u) => ({
312
312
  role: u.role,
@@ -314,7 +314,7 @@ async function Ve(r, n = [], a = [], p = "", o = "", c = null) {
314
314
  })) : [], x = {
315
315
  user_input: r,
316
316
  chat_history: d,
317
- mql_df: Array.isArray(a) ? a : [],
317
+ mql_df: Array.isArray(s) ? s : [],
318
318
  agent_id: p,
319
319
  discovery_agent_id: o,
320
320
  utm_source: "Web",
@@ -345,12 +345,12 @@ async function Ve(r, n = [], a = [], p = "", o = "", c = null) {
345
345
  return u.name === "TypeError" && u.message.includes("fetch") ? { reply: "⚠️ Network error. Please check your connection.", mqlDf: [] } : { reply: `⚠️ API request failed: ${u.message}`, mqlDf: [] };
346
346
  }
347
347
  }
348
- async function Ae(r, n = null, a = []) {
348
+ async function Ae(r, n = null, s = []) {
349
349
  const o = "https://sage-api-ttyw-stage.superwise.ai/api/v1/" + "pdf", c = Array.isArray(r) && r.length > 0 ? r[0] : n || {
350
350
  name: "User",
351
351
  email: "user@example.com",
352
352
  summary: "Chat conversation summary"
353
- }, i = Array.isArray(a) ? a.map((d) => ({
353
+ }, i = Array.isArray(s) ? s.map((d) => ({
354
354
  role: d.role,
355
355
  message: d.content != null ? d.content : ""
356
356
  })) : [], w = {
@@ -1032,11 +1032,11 @@ const m = {
1032
1032
  cursor: not-allowed;\r
1033
1033
  }`, Te = "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";
1034
1034
  let $e = 0;
1035
- function Ee({ width: r = 20, height: n = 20, style: a }) {
1035
+ function Ee({ width: r = 20, height: n = 20, style: s }) {
1036
1036
  const p = Z(null);
1037
1037
  p.current || (p.current = `clip0_avatar_${++$e}`);
1038
1038
  const o = p.current;
1039
- return /* @__PURE__ */ e.jsxs("svg", { width: r, height: n, viewBox: "0 0 155 174", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: a, "aria-hidden": !0, children: [
1039
+ return /* @__PURE__ */ e.jsxs("svg", { width: r, height: n, viewBox: "0 0 155 174", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: s, "aria-hidden": !0, children: [
1040
1040
  /* @__PURE__ */ e.jsxs("g", { clipPath: `url(#${o})`, children: [
1041
1041
  /* @__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" }),
1042
1042
  /* @__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" }),
@@ -1045,9 +1045,9 @@ function Ee({ width: r = 20, height: n = 20, style: a }) {
1045
1045
  /* @__PURE__ */ e.jsx("defs", { children: /* @__PURE__ */ e.jsx("clipPath", { id: o, children: /* @__PURE__ */ e.jsx("rect", { width: "154.17", height: "173.268", fill: "white" }) }) })
1046
1046
  ] });
1047
1047
  }
1048
- function Fe({ width: r, height: n = 20, style: a }) {
1048
+ function Fe({ width: r, height: n = 20, style: s }) {
1049
1049
  const p = r ?? 4.6875 * n;
1050
- return /* @__PURE__ */ e.jsxs("svg", { width: p, height: n, viewBox: "0 0 75 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: a, "aria-hidden": !0, children: [
1050
+ return /* @__PURE__ */ e.jsxs("svg", { width: p, height: n, viewBox: "0 0 75 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: s, "aria-hidden": !0, children: [
1051
1051
  /* @__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" }),
1052
1052
  /* @__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" }),
1053
1053
  /* @__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" }),
@@ -1081,20 +1081,20 @@ function me(r) {
1081
1081
  return !r.trim() || /\[text\]|\[\/text\]|\]\[text\]/i.test(r) || /\?|!/.test(r) || r.includes("—") || r.includes("–") || /^\s*(Would|Can|May|Could|Should|I |You |We |Let's|Please|Sure|Yes|No)\b/i.test(r) || /\b(your|you|we|me)\b/i.test(r) || /^\s*[A-Z][^.(]*[.?]\s*$/.test(r) || /^\s*#/.test(r) || /^\s*[-*]\s+[A-Z]/.test(r) && !/\.\w+\s*\(|=/.test(r) || /^\s*\d+\.\s+[A-Z][^.(]*$/.test(r) ? !1 : !!(/^\s*[)\]}]\s*$/.test(r) || /^\s*[\w.]+\s*=/.test(r) || /\.\w+\s*\(|\b(print|range|open|str|int|list|dict)\s*\(/.test(r) || /^\s*(def|class|import|from|return|if|else|elif|for|while|try|except|with|async)\b/.test(r) || /^\s{2,}/.test(r) && /[=(){}\[\],:]/.test(r) || /[,(]\s*$|:\s*$/.test(r) || /["'][^"']*["']\s*[:=]/.test(r) && r.length > 10 || /\b\w+\s*\([^)]*\)\s*$/.test(r) && /[=.]\w+\s*\(|import|from\s+\w+/.test(r));
1082
1082
  }
1083
1083
  function De(r) {
1084
- const n = [], a = r.split(`
1084
+ const n = [], s = r.split(`
1085
1085
  `), p = [];
1086
1086
  let o = 0;
1087
- for (; o < a.length; ) {
1088
- const c = a[o];
1087
+ for (; o < s.length; ) {
1088
+ const c = s[o];
1089
1089
  if (!me(c)) {
1090
1090
  p.push(c), o++;
1091
1091
  continue;
1092
1092
  }
1093
1093
  const i = [];
1094
- for (; o < a.length; ) {
1095
- const w = me(a[o]), d = a[o].trim() === "", x = o + 1 < a.length && me(a[o + 1]);
1094
+ for (; o < s.length; ) {
1095
+ const w = me(s[o]), d = s[o].trim() === "", x = o + 1 < s.length && me(s[o + 1]);
1096
1096
  if (w || d && i.length > 0 && x)
1097
- i.push(a[o]), o++;
1097
+ i.push(s[o]), o++;
1098
1098
  else break;
1099
1099
  }
1100
1100
  if (i.length >= 2) {
@@ -1109,22 +1109,22 @@ function De(r) {
1109
1109
  function Se(r) {
1110
1110
  if (!r) return "";
1111
1111
  let n = String(r);
1112
- const a = [];
1112
+ const s = [];
1113
1113
  n = n.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g, (c, i, w) => {
1114
- const d = a.length, x = ue(w.trim());
1115
- return a.push(`<pre class="sw-ttyw-code-block"><code class="${i ? `language-${i}` : ""}">${x}</code></pre>`), `\0CODE_FENCED_${d}\0`;
1114
+ const d = s.length, x = ue(w.trim());
1115
+ return s.push(`<pre class="sw-ttyw-code-block"><code class="${i ? `language-${i}` : ""}">${x}</code></pre>`), `\0CODE_FENCED_${d}\0`;
1116
1116
  }), n = n.replace(/\[code\]([\s\S]*?)\[\/code\]/gi, (c, i) => {
1117
- const w = a.length, d = ue(i.trim());
1118
- return a.push(`<pre class="sw-ttyw-code-block"><code>${d}</code></pre>`), `\0CODE_FENCED_${w}\0`;
1117
+ const w = s.length, d = ue(i.trim());
1118
+ return s.push(`<pre class="sw-ttyw-code-block"><code>${d}</code></pre>`), `\0CODE_FENCED_${w}\0`;
1119
1119
  });
1120
1120
  const { html: p, codeBlocks: o } = De(n);
1121
- return n = p, n = n.replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\])/gi, '<span class="sw-ttyw-text-block">$1</span>').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>').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(/^\s*\* (.*$)/gim, "<li>$1</li>").replace(/^\s*- (.*$)/gim, "<li>$1</li>").replace(/^\s*\d+\. (.*$)/gim, "<li>$1</li>").replace(/\n/g, "<br>"), n = n.replace(/((?:<li>.*?<\/li>(?:<br>)?)+)/g, "<ul>$1</ul>"), a.forEach((c, i) => {
1121
+ return n = p, n = n.replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\])/gi, '<span class="sw-ttyw-text-block">$1</span>').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>').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(/^\s*\* (.*$)/gim, "<li>$1</li>").replace(/^\s*- (.*$)/gim, "<li>$1</li>").replace(/^\s*\d+\. (.*$)/gim, "<li>$1</li>").replace(/\n/g, "<br>"), n = n.replace(/((?:<li>.*?<\/li>(?:<br>)?)+)/g, "<ul>$1</ul>"), s.forEach((c, i) => {
1122
1122
  n = n.replace(`\0CODE_FENCED_${i}\0`, c);
1123
1123
  }), o.forEach(({ placeholder: c, html: i }) => {
1124
1124
  n = n.replace(c, i);
1125
1125
  }), n;
1126
1126
  }
1127
- const Ue = 30, Ne = 300, Ze = ve(function({ text: n, speed: a = 20, onComplete: p }) {
1127
+ const Ue = 30, Ne = 300, Ze = ve(function({ text: n, speed: s = 20, onComplete: p }) {
1128
1128
  const [o, c] = S(""), [i, w] = S(!1), d = Z(p);
1129
1129
  A(() => {
1130
1130
  d.current = p;
@@ -1135,9 +1135,9 @@ const Ue = 30, Ne = 300, Ze = ve(function({ text: n, speed: a = 20, onComplete:
1135
1135
  let h = 0;
1136
1136
  const j = setInterval(() => {
1137
1137
  h < u ? (c(n.slice(0, h + 1)), h++) : (c(n), w(!0), clearInterval(j), d.current && d.current());
1138
- }, a);
1138
+ }, s);
1139
1139
  return () => clearInterval(j);
1140
- }, [n, a]);
1140
+ }, [n, s]);
1141
1141
  const x = (f) => f.replace(/(https?:\/\/[^\s<]+)/g, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[([^[\]]+)\]/g, "$1").replace(/\[bold\](.*?)\[\/bold\]/g, "<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\*(.*?)\*/g, "<em>$1</em>").replace(/(?:^|\n)-\s+/g, `
1142
1142
  • `).replace(/\n/g, "<br/>").replace(/(\d+\.\s)/g, "<br/>$1").replace(/(\*\s)/g, "<br/>$1");
1143
1143
  return /* @__PURE__ */ e.jsx(
@@ -1153,14 +1153,14 @@ const Ue = 30, Ne = 300, Ze = ve(function({ text: n, speed: a = 20, onComplete:
1153
1153
  }
1154
1154
  }
1155
1155
  );
1156
- }), Be = ve(function({ msg: n, isTyping: a = !1, onTypingComplete: p }) {
1156
+ }), Be = ve(function({ msg: n, isTyping: s = !1, onTypingComplete: p }) {
1157
1157
  const o = n.from === "human" ? "sw-ttyw-message self" : "sw-ttyw-message other";
1158
1158
  return /* @__PURE__ */ e.jsxs("div", { className: o, style: Oe(n.from), children: [
1159
1159
  /* @__PURE__ */ e.jsx("div", { className: "message-avatar", style: m.messageAvatar, children: n.from === "human" ? /* @__PURE__ */ e.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "black", xmlns: "http://www.w3.org/2000/svg", children: [
1160
1160
  /* @__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", fill: "black" }),
1161
1161
  /* @__PURE__ */ e.jsx("circle", { cx: "12", cy: "7", r: "4", fill: "black" })
1162
1162
  ] }) : /* @__PURE__ */ e.jsx(Ee, { width: 20, height: 20 }) }),
1163
- /* @__PURE__ */ e.jsx("div", { className: "message-content sw-ttyw-markdown", style: m.messageContent, children: n.from === "ai" && a ? /* @__PURE__ */ e.jsx(Ze, { text: n.text, speed: 20, onComplete: p }) : n.from === "ai" ? /* @__PURE__ */ e.jsx(
1163
+ /* @__PURE__ */ e.jsx("div", { className: "message-content sw-ttyw-markdown", style: m.messageContent, children: n.from === "ai" && s ? /* @__PURE__ */ e.jsx(Ze, { text: n.text, speed: 20, onComplete: p }) : n.from === "ai" ? /* @__PURE__ */ e.jsx(
1164
1164
  "div",
1165
1165
  {
1166
1166
  style: {
@@ -1187,63 +1187,63 @@ const Ue = 30, Ne = 300, Ze = ve(function({ text: n, speed: a = 20, onComplete:
1187
1187
  ] });
1188
1188
  }), Ye = (r = "") => {
1189
1189
  const n = (/* @__PURE__ */ new Date()).getHours();
1190
- let a = [];
1191
- return n >= 5 && n < 12 ? r ? a = [
1190
+ let s = [];
1191
+ return n >= 5 && n < 12 ? r ? s = [
1192
1192
  `🌅 Good morning ${r}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,
1193
1193
  `☀️ Morning ${r}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,
1194
1194
  `🌞 Good morning ${r}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,
1195
1195
  `👋 Rise and shine ${r}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,
1196
1196
  `👋 Morning ${r}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`
1197
- ] : a = [
1197
+ ] : s = [
1198
1198
  "🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?",
1199
1199
  "☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?",
1200
1200
  "🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?",
1201
1201
  "👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.",
1202
1202
  "👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"
1203
- ] : n >= 12 && n < 17 ? r ? a = [
1203
+ ] : n >= 12 && n < 17 ? r ? s = [
1204
1204
  `🌞 Good afternoon ${r}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,
1205
1205
  `☀️ Afternoon ${r}! I'm an expert on SUPERWISE. How may I help you today?`,
1206
1206
  `👋 Good afternoon ${r}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,
1207
1207
  `🌅 Hey there ${r}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,
1208
1208
  `🌅 Afternoon ${r}! I'm an expert on SUPERWISE. How can I support your exploration today?`
1209
- ] : a = [
1209
+ ] : s = [
1210
1210
  "🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?",
1211
1211
  "☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?",
1212
1212
  "👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?",
1213
1213
  "🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.",
1214
1214
  "🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"
1215
- ] : n >= 17 && n < 21 ? r ? a = [
1215
+ ] : n >= 17 && n < 21 ? r ? s = [
1216
1216
  `🌆 Good evening ${r}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,
1217
1217
  `🌅 Evening ${r}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,
1218
1218
  `👋 Good evening ${r}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,
1219
1219
  `🌇 Hey there ${r}! SUPERWISE expert here. Want to dive into the platform together?`,
1220
1220
  `🌇 Evening ${r}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`
1221
- ] : a = [
1221
+ ] : s = [
1222
1222
  "🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?",
1223
1223
  "🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?",
1224
1224
  "👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?",
1225
1225
  "🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?",
1226
1226
  "🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"
1227
- ] : r ? a = [
1227
+ ] : r ? s = [
1228
1228
  `🌙 Good evening ${r}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,
1229
1229
  `⭐ Evening ${r}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,
1230
1230
  `👋 Good evening ${r}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,
1231
1231
  `🌃 Hey there ${r}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,
1232
1232
  `🌃 Evening ${r}! SUPERWISE expert here. How can I help simplify or explain things for you today?`
1233
- ] : a = [
1233
+ ] : s = [
1234
1234
  "🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.",
1235
1235
  "⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?",
1236
1236
  "👋 Good evening! I'm a SUPERWISE expert. Looking to discover features or understand how something works?",
1237
1237
  "🌃 Hey there! I'm a SUPERWISE expert. Want to explore what the platform offers?",
1238
1238
  "🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"
1239
- ], a[Math.floor(Math.random() * a.length)];
1239
+ ], s[Math.floor(Math.random() * s.length)];
1240
1240
  };
1241
- function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryColor: p = "" }) {
1241
+ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: s = "", primaryColor: p = "" }) {
1242
1242
  const [o, c] = S(() => {
1243
1243
  try {
1244
1244
  if (typeof window < "u" && window.localStorage) {
1245
- const s = window.localStorage.getItem("chatbot-messages");
1246
- return s ? JSON.parse(s) : [];
1245
+ const a = window.localStorage.getItem("chatbot-messages");
1246
+ return a ? JSON.parse(a) : [];
1247
1247
  }
1248
1248
  } catch {
1249
1249
  }
@@ -1251,49 +1251,49 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1251
1251
  }), [i, w] = S(() => {
1252
1252
  try {
1253
1253
  if (typeof window < "u" && window.localStorage) {
1254
- const s = window.localStorage.getItem("chatbot-mql_df");
1255
- return s ? JSON.parse(s) : [];
1254
+ const a = window.localStorage.getItem("chatbot-mql_df");
1255
+ return a ? JSON.parse(a) : [];
1256
1256
  }
1257
1257
  } catch {
1258
1258
  }
1259
1259
  return [];
1260
- }), [d, x] = S(""), [f, v] = S(!1), [I, u] = S(!1), [h, j] = S(!1), [H, W] = S(!1), [T, z] = S(/* @__PURE__ */ new Set()), [ee, te] = S(!1), [re, ne] = S(!1), [oe, R] = S(!1), [M, se] = S(!1), [ae, q] = S(""), [B, P] = S(""), G = 9e4, ie = "https://superwise.ai/contact/", O = Z(null), D = Z(null), t = (() => {
1260
+ }), [d, x] = S(""), [f, v] = S(!1), [I, u] = S(!1), [h, j] = S(!1), [H, W] = S(!1), [T, z] = S(/* @__PURE__ */ new Set()), [te, re] = S(!1), [ne, oe] = S(!1), [ae, R] = S(!1), [M, se] = S(!1), [ie, q] = S(""), [B, P] = S(""), G = 9e4, le = "https://superwise.ai/contact/", O = Z(null), D = Z(null), t = (() => {
1261
1261
  if (p) return p;
1262
1262
  if (typeof document < "u" && typeof window < "u") {
1263
- const s = document.querySelector("[data-chatbot-color]");
1264
- if (s)
1265
- return s.getAttribute("data-chatbot-color") || "#000";
1263
+ const a = document.querySelector("[data-chatbot-color]");
1264
+ if (a)
1265
+ return a.getAttribute("data-chatbot-color") || "#000";
1266
1266
  const E = getComputedStyle(document.documentElement).getPropertyValue("--swttyw-primary-color").trim();
1267
1267
  if (E) return E;
1268
1268
  }
1269
1269
  return "#000";
1270
1270
  })(), l = xe(() => {
1271
1271
  if (!i || i.length === 0) return "";
1272
- const s = i.find((k) => k.name && k.email);
1273
- return s ? `${s.name} (${s.email})` : "";
1272
+ const a = i.find((k) => k.name && k.email);
1273
+ return a ? `${a.name} (${a.email})` : "";
1274
1274
  }, [i]), g = Z(null), C = Z(null), U = Z(o), L = Y(() => {
1275
1275
  O.current && (clearTimeout(O.current), O.current = null);
1276
- }, []), b = Y((s) => {
1277
- L(), O.current = setTimeout(s, G);
1278
- }, [G, L]), _ = xe(() => o.map((s) => ({ role: s.from, content: s.text })), [o]), $ = (s) => {
1279
- P(s), setTimeout(() => {
1276
+ }, []), b = Y((a) => {
1277
+ L(), O.current = setTimeout(a, G);
1278
+ }, [G, L]), _ = xe(() => o.map((a) => ({ role: a.from, content: a.text })), [o]), $ = (a) => {
1279
+ P(a), setTimeout(() => {
1280
1280
  P("");
1281
1281
  }, 4e3);
1282
- }, de = (s) => {
1283
- const k = s.length, E = s.trim();
1282
+ }, de = (a) => {
1283
+ const k = a.length, E = a.trim();
1284
1284
  return q(""), P(""), !E || k === 0 ? ($("Please enter a message before sending."), !1) : new RegExp(/(<([^>]+)>)/gi).test(E) ? ($("Please avoid using HTML tags or scripts in your message."), !1) : E.length < 2 ? ($("Please enter a meaningful question (at least 2 characters)."), !1) : E.length > 1e3 ? ($("Message is too long. Please keep it under 1000 characters."), !1) : (q(""), P(""), !0);
1285
- }, le = Y((s = "auto") => {
1285
+ }, J = Y((a = "auto") => {
1286
1286
  var E;
1287
1287
  const k = C.current;
1288
- k && (k.scrollTop = k.scrollHeight), (E = g.current) == null || E.scrollIntoView({ behavior: s });
1288
+ k && (k.scrollTop = k.scrollHeight), (E = g.current) == null || E.scrollIntoView({ behavior: a });
1289
1289
  }, []);
1290
1290
  A(() => {
1291
- requestAnimationFrame(() => le("auto"));
1292
- }, [o, B, oe, M, le]), A(() => {
1291
+ requestAnimationFrame(() => J("auto"));
1292
+ }, [o, B, ae, M, J]), A(() => {
1293
1293
  if (!f && T.size === 0) return;
1294
- const s = setInterval(() => le("auto"), 120);
1295
- return () => clearInterval(s);
1296
- }, [f, T, le]), A(() => {
1294
+ const a = setInterval(() => J("auto"), 120);
1295
+ return () => clearInterval(a);
1296
+ }, [f, T, J]), A(() => {
1297
1297
  try {
1298
1298
  typeof window < "u" && window.localStorage && window.localStorage.setItem("chatbot-messages", JSON.stringify(o));
1299
1299
  } catch {
@@ -1306,45 +1306,45 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1306
1306
  }, [i]), A(() => {
1307
1307
  U.current = o;
1308
1308
  }, [o]), A(() => {
1309
- if (o.length === 0 && !ee) {
1309
+ if (o.length === 0 && !te) {
1310
1310
  const k = { from: "ai", text: Ye(l) };
1311
- c([k]), te(!0), z(/* @__PURE__ */ new Set([0]));
1311
+ c([k]), re(!0), z(/* @__PURE__ */ new Set([0]));
1312
1312
  }
1313
- }, [o.length, ee, l]), A(() => () => L(), [L]);
1313
+ }, [o.length, te, l]), A(() => () => L(), [L]);
1314
1314
  const we = Y(async () => {
1315
1315
  var ye;
1316
1316
  if (f || M) return;
1317
- const s = d.trim();
1318
- if (!s || !de(d))
1317
+ const a = d.trim();
1318
+ if (!a || !de(d))
1319
1319
  return;
1320
1320
  R(!1), L(), (ye = D.current) == null || ye.abort();
1321
1321
  const k = new AbortController();
1322
1322
  D.current = k;
1323
- const E = k.signal, V = { from: "human", text: s }, F = U.current, Le = [...F, V];
1323
+ const E = k.signal, V = { from: "human", text: a }, F = U.current, Le = [...F, V];
1324
1324
  c(Le), x(""), v(!0);
1325
- let ge = s;
1326
- if (i && i.length > 0 && !re) {
1325
+ let ge = a;
1326
+ if (i && i.length > 0 && !ne) {
1327
1327
  const y = F.filter((N) => N.from === "ai").pop();
1328
- y && y.text && y.text.trim() !== "" && (ge = s + "." + y.text, ne(!0));
1328
+ y && y.text && y.text.trim() !== "" && (ge = a + "." + y.text, oe(!0));
1329
1329
  }
1330
- const Ie = [..._, { role: "human", content: s }];
1330
+ const Ie = [..._, { role: "human", content: a }];
1331
1331
  b(() => {
1332
1332
  var y;
1333
1333
  R(!0), (y = D.current) == null || y.abort(), v(!1);
1334
1334
  });
1335
1335
  try {
1336
- const y = await Ve(ge, Ie, i, n, a, E);
1336
+ const y = await Ve(ge, Ie, i, n, s, E);
1337
1337
  if (L(), typeof y == "string") {
1338
1338
  const N = { from: "ai", text: y };
1339
- c((J) => {
1340
- const X = [...J, N];
1341
- return z((pe) => /* @__PURE__ */ new Set([...pe, X.length - 1])), X;
1339
+ c((X) => {
1340
+ const K = [...X, N];
1341
+ return z((pe) => /* @__PURE__ */ new Set([...pe, K.length - 1])), K;
1342
1342
  }), (y.startsWith("⚠️") || y.startsWith("❌")) && R(!0);
1343
1343
  } else {
1344
1344
  const N = { from: "ai", text: y.reply };
1345
- c((J) => {
1346
- const X = [...J, N];
1347
- return z((pe) => /* @__PURE__ */ new Set([...pe, X.length - 1])), X;
1345
+ c((X) => {
1346
+ const K = [...X, N];
1347
+ return z((pe) => /* @__PURE__ */ new Set([...pe, K.length - 1])), K;
1348
1348
  }), y.mqlDf && Array.isArray(y.mqlDf) && w(y.mqlDf), y.reply && (y.reply.startsWith("⚠️") || y.reply.startsWith("❌")) && R(!0), y.chatHistoryLimitExceeded && se(!0);
1349
1349
  }
1350
1350
  } catch (y) {
@@ -1352,20 +1352,20 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1352
1352
  return;
1353
1353
  R(!0);
1354
1354
  const N = y.message || "Something went wrong. Please try again.";
1355
- c((J) => [...J, { from: "ai", text: `⚠️ ${N}` }]);
1355
+ c((X) => [...X, { from: "ai", text: `⚠️ ${N}` }]);
1356
1356
  } finally {
1357
1357
  v(!1);
1358
1358
  }
1359
- }, [d, n, a, i, re, _, M, L, b]), je = Y(() => {
1360
- var s;
1361
- L(), (s = D.current) == null || s.abort(), R(!1), se(!1), c([]), z(/* @__PURE__ */ new Set()), te(!1), ne(!1);
1359
+ }, [d, n, s, i, ne, _, M, L, b]), je = Y(() => {
1360
+ var a;
1361
+ L(), (a = D.current) == null || a.abort(), R(!1), se(!1), c([]), z(/* @__PURE__ */ new Set()), re(!1), oe(!1);
1362
1362
  try {
1363
1363
  typeof window < "u" && window.localStorage && window.localStorage.removeItem("chatbot-messages");
1364
1364
  } catch {
1365
1365
  }
1366
1366
  u(!1);
1367
1367
  }, [L]), fe = Y(async () => {
1368
- var s, k, E;
1368
+ var a, k, E;
1369
1369
  if (!i || i.length === 0) {
1370
1370
  console.warn("No mql_df data available for PDF download");
1371
1371
  return;
@@ -1373,7 +1373,7 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1373
1373
  try {
1374
1374
  v(!0), console.log("mql_df data for lead extraction:", i);
1375
1375
  const V = {
1376
- name: ((s = i.find((F) => F.name)) == null ? void 0 : s.name) || "Chat User",
1376
+ name: ((a = i.find((F) => F.name)) == null ? void 0 : a.name) || "Chat User",
1377
1377
  email: ((k = i.find((F) => F.email)) == null ? void 0 : k.email) || "user@example.com",
1378
1378
  summary: `Chat conversation with ${o.length} messages. User asked: "${((E = o.find((F) => F.from === "human")) == null ? void 0 : E.text) || "No user messages"}"`
1379
1379
  };
@@ -1419,7 +1419,7 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1419
1419
  /* @__PURE__ */ e.jsx(
1420
1420
  "button",
1421
1421
  {
1422
- onClick: () => W((s) => !s),
1422
+ onClick: () => W((a) => !a),
1423
1423
  style: m.headerButton,
1424
1424
  title: H ? "Shrink chat" : "Expand chat",
1425
1425
  children: H ? /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
@@ -1497,21 +1497,21 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1497
1497
  opacity: 0.8,
1498
1498
  objectFit: "contain"
1499
1499
  },
1500
- onError: (s) => {
1501
- console.log("Logo failed to load, using fallback"), s.target.style.display = "none";
1500
+ onError: (a) => {
1501
+ console.log("Logo failed to load, using fallback"), a.target.style.display = "none";
1502
1502
  }
1503
1503
  }
1504
1504
  ) }),
1505
- o.map((s, k) => /* @__PURE__ */ e.jsx(
1505
+ o.map((a, k) => /* @__PURE__ */ e.jsx(
1506
1506
  Be,
1507
1507
  {
1508
- msg: s,
1508
+ msg: a,
1509
1509
  isTyping: T.has(k),
1510
1510
  onTypingComplete: () => {
1511
1511
  z((E) => {
1512
1512
  const V = new Set(E);
1513
1513
  return V.delete(k), V;
1514
- });
1514
+ }), requestAnimationFrame(() => J("auto"));
1515
1515
  }
1516
1516
  },
1517
1517
  k
@@ -1520,10 +1520,10 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1520
1520
  /* @__PURE__ */ e.jsx("span", { className: "error-icon", children: "⚠️" }),
1521
1521
  /* @__PURE__ */ e.jsx("span", { children: B })
1522
1522
  ] }),
1523
- oe && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-contact-cta", children: /* @__PURE__ */ e.jsxs(
1523
+ ae && /* @__PURE__ */ e.jsx("div", { className: "sw-ttyw-contact-cta", children: /* @__PURE__ */ e.jsxs(
1524
1524
  "a",
1525
1525
  {
1526
- href: ie,
1526
+ href: le,
1527
1527
  target: "_blank",
1528
1528
  rel: "noopener noreferrer",
1529
1529
  className: "sw-ttyw-cta-button",
@@ -1589,13 +1589,13 @@ function Ge({ title: r = "", agentId: n = "", discoveryAgentId: a = "", primaryC
1589
1589
  className: "sw-ttyw-input",
1590
1590
  placeholder: M ? "Chat limit reached." : "Please ask question here",
1591
1591
  value: d,
1592
- onChange: (s) => {
1593
- x(s.target.value), B && P("");
1592
+ onChange: (a) => {
1593
+ x(a.target.value), B && P("");
1594
1594
  },
1595
1595
  maxLength: 1e3,
1596
1596
  disabled: f || M,
1597
1597
  style: m.textarea,
1598
- onKeyDown: (s) => s.key === "Enter" && !s.shiftKey && (s.preventDefault(), we())
1598
+ onKeyDown: (a) => a.key === "Enter" && !a.shiftKey && (a.preventDefault(), we())
1599
1599
  }
1600
1600
  ),
1601
1601
  /* @__PURE__ */ e.jsxs("div", { className: "sw-ttyw-chat-input-content", style: m.inputFooter, children: [
@@ -14,12 +14,12 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ue;function ve(){return ue||(ue=1,process.env.NODE_ENV!=="production"&&function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ne?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case W:return"Profiler";case A:return"StrictMode";case ee:return"Suspense";case te:return"SuspenseList";case M:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case j:return"Portal";case Q:return t.displayName||"Context";case z:return(t._context.displayName||"Context")+".Consumer";case q:var c=t.render;return t=t.displayName,t||(t=c.displayName||c.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case re:return c=t.displayName||null,c!==null?c:r(t.type)||"Memo";case H:c=t._payload,t=t._init;try{return r(t(c))}catch{}}return null}function n(t){return""+t}function a(t){try{n(t);var c=!1}catch{c=!0}if(c){c=console;var y=c.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return y.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),n(t)}}function m(t){if(t===R)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===H)return"<...>";try{var c=r(t);return c?"<"+c+">":"<...>"}catch{return"<...>"}}function o(){var t=oe.A;return t===null?null:t.getOwner()}function d(){return Error("react-stack-top-frame")}function i(t){if($.call(t,"key")){var c=Object.getOwnPropertyDescriptor(t,"key").get;if(c&&c.isReactWarning)return!1}return t.key!==void 0}function w(t,c){function y(){J||(J=!0,console.error("%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)",c))}y.isReactWarning=!0,Object.defineProperty(t,"key",{get:y,configurable:!0})}function p(){var t=r(this.type);return se[t]||(se[t]=!0,console.error("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.")),t=this.props.ref,t!==void 0?t:null}function C(t,c,y,b,N,L){var k=y.ref;return t={$$typeof:u,type:t,key:c,props:y,_owner:b},(k!==void 0?k:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:p}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function g(t,c,y,b,N,L){var k=c.children;if(k!==void 0)if(b)if(B(k)){for(b=0;b<k.length;b++)E(k[b]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else E(k);if($.call(c,"key")){k=r(t);var _=Object.keys(c).filter(function(pe){return pe!=="key"});b=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",de[k+b]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ue;function ve(){return ue||(ue=1,process.env.NODE_ENV!=="production"&&function(){function r(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===oe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case R:return"Fragment";case W:return"Profiler";case A:return"StrictMode";case te:return"Suspense";case re:return"SuspenseList";case M:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case j:return"Portal";case q:return t.displayName||"Context";case z:return(t._context.displayName||"Context")+".Consumer";case ee:var c=t.render;return t=t.displayName,t||(t=c.displayName||c.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ne:return c=t.displayName||null,c!==null?c:r(t.type)||"Memo";case H:c=t._payload,t=t._init;try{return r(t(c))}catch{}}return null}function n(t){return""+t}function a(t){try{n(t);var c=!1}catch{c=!0}if(c){c=console;var y=c.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return y.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),n(t)}}function m(t){if(t===R)return"<>";if(typeof t=="object"&&t!==null&&t.$$typeof===H)return"<...>";try{var c=r(t);return c?"<"+c+">":"<...>"}catch{return"<...>"}}function o(){var t=se.A;return t===null?null:t.getOwner()}function d(){return Error("react-stack-top-frame")}function i(t){if($.call(t,"key")){var c=Object.getOwnPropertyDescriptor(t,"key").get;if(c&&c.isReactWarning)return!1}return t.key!==void 0}function w(t,c){function y(){J||(J=!0,console.error("%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)",c))}y.isReactWarning=!0,Object.defineProperty(t,"key",{get:y,configurable:!0})}function p(){var t=r(this.type);return ae[t]||(ae[t]=!0,console.error("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.")),t=this.props.ref,t!==void 0?t:null}function C(t,c,y,b,N,L){var k=y.ref;return t={$$typeof:u,type:t,key:c,props:y,_owner:b},(k!==void 0?k:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:p}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(t,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:N}),Object.defineProperty(t,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:L}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function g(t,c,y,b,N,L){var k=c.children;if(k!==void 0)if(b)if(B(k)){for(b=0;b<k.length;b++)E(k[b]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else E(k);if($.call(c,"key")){k=r(t);var _=Object.keys(c).filter(function(pe){return pe!=="key"});b=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",de[k+b]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,b,k,_,k),de[k+b]=!0)}if(k=null,y!==void 0&&(a(y),k=""+y),i(c)&&(a(c.key),k=""+c.key),"key"in c){y={};for(var T in c)T!=="key"&&(y[T]=c[T])}else y=c;return k&&w(y,typeof t=="function"?t.displayName||t.name||"Unknown":t),C(t,k,y,o(),N,L)}function E(t){I(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===H&&(t._payload.status==="fulfilled"?I(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function I(t){return typeof t=="object"&&t!==null&&t.$$typeof===u}var f=l,u=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),re=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),oe=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,B=Array.isArray,P=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(t){return t()}};var J,se={},D=f.react_stack_bottom_frame.bind(f,d)(),U=P(m(d)),de={};G.Fragment=R,G.jsx=function(t,c,y){var b=1e4>oe.recentlyCreatedOwnerStacks++;return g(t,c,y,!1,b?Error("react-stack-top-frame"):D,b?P(m(t)):U)},G.jsxs=function(t,c,y){var b=1e4>oe.recentlyCreatedOwnerStacks++;return g(t,c,y,!0,b?Error("react-stack-top-frame"):D,b?P(m(t)):U)}}()),G}process.env.NODE_ENV==="production"?ie.exports=ke():ie.exports=ve();var e=ie.exports;const Ee=["Parameters:","additional_parameter_company_name:","additional_parameter_company_size:","additional_parameter_user_role:","additional_parameter_use_case:"];function Se(r){if(typeof r!="string"||r.length===0)return r;let n=r;for(const a of Ee)for(;;){const m=n.indexOf(a);if(m===-1)break;const o=n.indexOf("{",m);if(o===-1)break;let d=0,i=-1;for(let C=o;C<n.length;C++){const g=n[C];if(g==="{")d++;else if(g==="}"&&(d--,d===0)){i=C;break}}if(i===-1)break;const w=n.slice(0,m).trim(),p=n.slice(i+1).trim();n=w+(p.length>0?" "+p:"")}return n.includes("Parameters:")&&(n=n.split("Parameters:")[0].trim()),n}async function je(r,n=[],a=[],m="",o="",d=null){var g,E,I;const w="https://sage-api-ttyw-stage.superwise.ai/api/v1/"+"chat",p=Array.isArray(n)?n.map(f=>({role:f.role,message:f.content!=null?f.content:""})):[],C={user_input:r,chat_history:p,mql_df:Array.isArray(a)?a:[],agent_id:m,discovery_agent_id:o,utm_source:"Web",utm_medium:"chatbot"};console.log("Sending payload:",C);try{const f=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(C),signal:d??void 0});if(console.log("Response status:",f.status),console.log("Response headers:",f.headers),!f.ok){const W=await f.text();return console.error("API Error Response:",W),{reply:`❌ API Error ${f.status}: ${W}`,mqlDf:[]}}const u=await f.json();console.log("API Response Data:",u);let j="⚠️ No reply from server.",R=[],A=!1;return u.chat_response?j=u.chat_response:u.success&&((g=u.data)!=null&&g.chat_response)?j=u.data.chat_response:u.message&&(j=u.message),u.mql_df?R=u.mql_df:(E=u.data)!=null&&E.mql_df&&(R=u.data.mql_df),(u.chat_history_limit_exceeded===!0||((I=u.data)==null?void 0:I.chat_history_limit_exceeded)===!0)&&(A=!0),j=Se(j),{reply:j,mqlDf:R,chatHistoryLimitExceeded:A}}catch(f){if(console.error("API call failed:",f),f.name==="AbortError")throw f;return f.name==="TypeError"&&f.message.includes("fetch")?{reply:"⚠️ Network error. Please check your connection.",mqlDf:[]}:{reply:`⚠️ API request failed: ${f.message}`,mqlDf:[]}}}async function Le(r,n=null,a=[]){const o="https://sage-api-ttyw-stage.superwise.ai/api/v1/"+"pdf",d=Array.isArray(r)&&r.length>0?r[0]:n||{name:"User",email:"user@example.com",summary:"Chat conversation summary"},i=Array.isArray(a)?a.map(p=>({role:p.role,message:p.content!=null?p.content:""})):[],w={lead_row:d,chat_history:i};console.log("Downloading PDF with payload:",w);try{const p=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf"},body:JSON.stringify(w)});if(console.log("PDF Response status:",p.status),!p.ok){const I=await p.text();throw console.error("PDF API Error Response:",I),new Error(`PDF API Error ${p.status}: ${I}`)}const C=await p.blob(),g=window.URL.createObjectURL(C),E=document.createElement("a");return E.href=g,E.download=`chatbot-report-${new Date().toISOString().split("T")[0]}.pdf`,document.body.appendChild(E),E.click(),document.body.removeChild(E),window.URL.revokeObjectURL(g),!0}catch(p){throw console.error("PDF download failed:",p),p}}const h={container:{position:"fixed",bottom:"0px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",maxWidth:"400px",width:"80vw",maxHeight:"75vh",height:"75vh",display:"flex",flexDirection:"column",borderRadius:"1rem",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerExpanded:{position:"fixed",top:"0px",left:"0px",zIndex:999999,fontFamily:"'Inter', sans-serif",width:"100vw",height:"100vh",display:"flex",flexDirection:"column",borderRadius:"0",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerMinimized:{position:"fixed",bottom:"20px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",width:"auto",minWidth:"250px",maxWidth:"350px",height:"auto",display:"flex",flexDirection:"row",borderRadius:"25px",background:"#000000",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",boxSizing:"border-box",padding:"12px 16px",alignItems:"center",cursor:"pointer"},header:{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px",background:"var(--swttyw-primary-color)",color:"#fff",borderRadius:"10px 10px 0 0",fontFamily:"'Inter', sans-serif",flexShrink:0,boxSizing:"border-box"},name:{fontWeight:500,fontSize:"var(--swttyw-header-font-size)",color:"#fff",flexGrow:1,marginBottom:"0.125rem",wordBreak:"break-all"},headerActions:{display:"flex",alignItems:"center",gap:"8px"},headerButton:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",padding:"4px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",textDecoration:"none",transition:"opacity 0.3s ease"},chatSection:{padding:"1rem",backgroundColor:"var(--swttyw-background-color)",flexGrow:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column",boxShadow:"inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05)",height:"calc(50vh - 200px)"},inputSection:{boxSizing:"border-box",flexBasis:"4rem",flexShrink:0,display:"flex",alignItems:"center",boxShadow:"0 0 1rem rgba(0, 0, 0, 0.1), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.2)",margin:"0.50rem"},textarea:{border:"none",backgroundImage:"none",backgroundColor:"white",padding:"0.5rem 1rem",marginRight:"1rem",borderRadius:"10px",flexGrow:2,fontFamily:"'Inter', sans-serif",fontWeight:400,letterSpacing:"0.025em",resize:"none",fontSize:"16px",outline:"none"},inputFooter:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"5px"},sendButton:{background:"transparent",border:"0px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#000000"},characterCount:{fontSize:"12px",color:"var(--swttyw-primary-color)",textAlign:"center"},modalOverlay:{position:"absolute",background:"#ffffffe8",height:"calc(100% - 85px)",width:"100%",top:"48px",display:"flex",justifyContent:"center",alignItems:"center"},modalBody:{textAlign:"center"},modalActions:{display:"flex",justifyContent:"center"},footer:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--swttyw-primary-color)",borderRadius:"0 0 10px 10px",paddingBottom:"6px",paddingTop:"6px",marginTop:"0px",color:"#f8f9fa",fontSize:"var(--swttyw-footer-font-size)",borderTop:"3px solid var(--swttyw-primary-color)",padding:"15px 0px",fontFamily:"'Inter', sans-serif"},message:{boxSizing:"border-box",padding:"0.5rem 1rem",margin:"1rem",background:"#FFF",borderRadius:"1.125rem 1.125rem 1.125rem 0",minHeight:"2.25rem",width:"fit-content",boxShadow:"0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1)",fontSize:"15px",wordBreak:"break-word",fontFamily:"'Inter', sans-serif",display:"table",alignItems:"flex-start",gap:"8px",position:"relative"},messageSelf:{margin:"1rem 1rem 1rem auto",borderRadius:"1.125rem 1.125rem 0 1.125rem",background:"#000000",color:"white",position:"relative",maxWidth:"80%",fontSize:"var(--swttyw-body-font-size)",flexDirection:"row-reverse"},messageOther:{position:"relative",fontSize:"var(--swttyw-body-font-size)"},messageAvatar:{width:"24px",height:"24px",borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"bold",position:"absolute",top:"5px"},messageContent:{flex:1,marginLeft:"32px",marginRight:"8px"},minimizedContent:{display:"flex",alignItems:"center",gap:"12px",color:"white",flex:1},chatIcon:{width:"20px",height:"20px",flexShrink:0},minimizedTitle:{color:"white",fontSize:"16px",fontWeight:"500",margin:0}},Ie=`@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');\r
22
+ <%s key={someKey} {...props} />`,b,k,_,k),de[k+b]=!0)}if(k=null,y!==void 0&&(a(y),k=""+y),i(c)&&(a(c.key),k=""+c.key),"key"in c){y={};for(var T in c)T!=="key"&&(y[T]=c[T])}else y=c;return k&&w(y,typeof t=="function"?t.displayName||t.name||"Unknown":t),C(t,k,y,o(),N,L)}function E(t){I(t)?t._store&&(t._store.validated=1):typeof t=="object"&&t!==null&&t.$$typeof===H&&(t._payload.status==="fulfilled"?I(t._payload.value)&&t._payload.value._store&&(t._payload.value._store.validated=1):t._store&&(t._store.validated=1))}function I(t){return typeof t=="object"&&t!==null&&t.$$typeof===u}var f=l,u=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),q=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),oe=Symbol.for("react.client.reference"),se=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,B=Array.isArray,P=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(t){return t()}};var J,ae={},D=f.react_stack_bottom_frame.bind(f,d)(),U=P(m(d)),de={};G.Fragment=R,G.jsx=function(t,c,y){var b=1e4>se.recentlyCreatedOwnerStacks++;return g(t,c,y,!1,b?Error("react-stack-top-frame"):D,b?P(m(t)):U)},G.jsxs=function(t,c,y){var b=1e4>se.recentlyCreatedOwnerStacks++;return g(t,c,y,!0,b?Error("react-stack-top-frame"):D,b?P(m(t)):U)}}()),G}process.env.NODE_ENV==="production"?ie.exports=ke():ie.exports=ve();var e=ie.exports;const Ee=["Parameters:","additional_parameter_company_name:","additional_parameter_company_size:","additional_parameter_user_role:","additional_parameter_use_case:"];function Se(r){if(typeof r!="string"||r.length===0)return r;let n=r;for(const a of Ee)for(;;){const m=n.indexOf(a);if(m===-1)break;const o=n.indexOf("{",m);if(o===-1)break;let d=0,i=-1;for(let C=o;C<n.length;C++){const g=n[C];if(g==="{")d++;else if(g==="}"&&(d--,d===0)){i=C;break}}if(i===-1)break;const w=n.slice(0,m).trim(),p=n.slice(i+1).trim();n=w+(p.length>0?" "+p:"")}return n.includes("Parameters:")&&(n=n.split("Parameters:")[0].trim()),n}async function je(r,n=[],a=[],m="",o="",d=null){var g,E,I;const w="https://sage-api-ttyw-stage.superwise.ai/api/v1/"+"chat",p=Array.isArray(n)?n.map(f=>({role:f.role,message:f.content!=null?f.content:""})):[],C={user_input:r,chat_history:p,mql_df:Array.isArray(a)?a:[],agent_id:m,discovery_agent_id:o,utm_source:"Web",utm_medium:"chatbot"};console.log("Sending payload:",C);try{const f=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(C),signal:d??void 0});if(console.log("Response status:",f.status),console.log("Response headers:",f.headers),!f.ok){const W=await f.text();return console.error("API Error Response:",W),{reply:`❌ API Error ${f.status}: ${W}`,mqlDf:[]}}const u=await f.json();console.log("API Response Data:",u);let j="⚠️ No reply from server.",R=[],A=!1;return u.chat_response?j=u.chat_response:u.success&&((g=u.data)!=null&&g.chat_response)?j=u.data.chat_response:u.message&&(j=u.message),u.mql_df?R=u.mql_df:(E=u.data)!=null&&E.mql_df&&(R=u.data.mql_df),(u.chat_history_limit_exceeded===!0||((I=u.data)==null?void 0:I.chat_history_limit_exceeded)===!0)&&(A=!0),j=Se(j),{reply:j,mqlDf:R,chatHistoryLimitExceeded:A}}catch(f){if(console.error("API call failed:",f),f.name==="AbortError")throw f;return f.name==="TypeError"&&f.message.includes("fetch")?{reply:"⚠️ Network error. Please check your connection.",mqlDf:[]}:{reply:`⚠️ API request failed: ${f.message}`,mqlDf:[]}}}async function Le(r,n=null,a=[]){const o="https://sage-api-ttyw-stage.superwise.ai/api/v1/"+"pdf",d=Array.isArray(r)&&r.length>0?r[0]:n||{name:"User",email:"user@example.com",summary:"Chat conversation summary"},i=Array.isArray(a)?a.map(p=>({role:p.role,message:p.content!=null?p.content:""})):[],w={lead_row:d,chat_history:i};console.log("Downloading PDF with payload:",w);try{const p=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/pdf"},body:JSON.stringify(w)});if(console.log("PDF Response status:",p.status),!p.ok){const I=await p.text();throw console.error("PDF API Error Response:",I),new Error(`PDF API Error ${p.status}: ${I}`)}const C=await p.blob(),g=window.URL.createObjectURL(C),E=document.createElement("a");return E.href=g,E.download=`chatbot-report-${new Date().toISOString().split("T")[0]}.pdf`,document.body.appendChild(E),E.click(),document.body.removeChild(E),window.URL.revokeObjectURL(g),!0}catch(p){throw console.error("PDF download failed:",p),p}}const h={container:{position:"fixed",bottom:"0px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",maxWidth:"400px",width:"80vw",maxHeight:"75vh",height:"75vh",display:"flex",flexDirection:"column",borderRadius:"1rem",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerExpanded:{position:"fixed",top:"0px",left:"0px",zIndex:999999,fontFamily:"'Inter', sans-serif",width:"100vw",height:"100vh",display:"flex",flexDirection:"column",borderRadius:"0",background:"white",boxShadow:"0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5)",boxSizing:"border-box"},containerMinimized:{position:"fixed",bottom:"20px",right:"20px",zIndex:999999,fontFamily:"'Inter', sans-serif",width:"auto",minWidth:"250px",maxWidth:"350px",height:"auto",display:"flex",flexDirection:"row",borderRadius:"25px",background:"#000000",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",boxSizing:"border-box",padding:"12px 16px",alignItems:"center",cursor:"pointer"},header:{position:"relative",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px",background:"var(--swttyw-primary-color)",color:"#fff",borderRadius:"10px 10px 0 0",fontFamily:"'Inter', sans-serif",flexShrink:0,boxSizing:"border-box"},name:{fontWeight:500,fontSize:"var(--swttyw-header-font-size)",color:"#fff",flexGrow:1,marginBottom:"0.125rem",wordBreak:"break-all"},headerActions:{display:"flex",alignItems:"center",gap:"8px"},headerButton:{background:"transparent",border:"none",color:"#fff",cursor:"pointer",padding:"4px",borderRadius:"4px",display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px",textDecoration:"none",transition:"opacity 0.3s ease"},chatSection:{padding:"1rem",backgroundColor:"var(--swttyw-background-color)",flexGrow:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column",boxShadow:"inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05)",height:"calc(50vh - 200px)"},inputSection:{boxSizing:"border-box",flexBasis:"4rem",flexShrink:0,display:"flex",alignItems:"center",boxShadow:"0 0 1rem rgba(0, 0, 0, 0.1), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.2)",margin:"0.50rem"},textarea:{border:"none",backgroundImage:"none",backgroundColor:"white",padding:"0.5rem 1rem",marginRight:"1rem",borderRadius:"10px",flexGrow:2,fontFamily:"'Inter', sans-serif",fontWeight:400,letterSpacing:"0.025em",resize:"none",fontSize:"16px",outline:"none"},inputFooter:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"5px"},sendButton:{background:"transparent",border:"0px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#000000"},characterCount:{fontSize:"12px",color:"var(--swttyw-primary-color)",textAlign:"center"},modalOverlay:{position:"absolute",background:"#ffffffe8",height:"calc(100% - 85px)",width:"100%",top:"48px",display:"flex",justifyContent:"center",alignItems:"center"},modalBody:{textAlign:"center"},modalActions:{display:"flex",justifyContent:"center"},footer:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--swttyw-primary-color)",borderRadius:"0 0 10px 10px",paddingBottom:"6px",paddingTop:"6px",marginTop:"0px",color:"#f8f9fa",fontSize:"var(--swttyw-footer-font-size)",borderTop:"3px solid var(--swttyw-primary-color)",padding:"15px 0px",fontFamily:"'Inter', sans-serif"},message:{boxSizing:"border-box",padding:"0.5rem 1rem",margin:"1rem",background:"#FFF",borderRadius:"1.125rem 1.125rem 1.125rem 0",minHeight:"2.25rem",width:"fit-content",boxShadow:"0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1)",fontSize:"15px",wordBreak:"break-word",fontFamily:"'Inter', sans-serif",display:"table",alignItems:"flex-start",gap:"8px",position:"relative"},messageSelf:{margin:"1rem 1rem 1rem auto",borderRadius:"1.125rem 1.125rem 0 1.125rem",background:"#000000",color:"white",position:"relative",maxWidth:"80%",fontSize:"var(--swttyw-body-font-size)",flexDirection:"row-reverse"},messageOther:{position:"relative",fontSize:"var(--swttyw-body-font-size)"},messageAvatar:{width:"24px",height:"24px",borderRadius:"50%",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"bold",position:"absolute",top:"5px"},messageContent:{flex:1,marginLeft:"32px",marginRight:"8px"},minimizedContent:{display:"flex",alignItems:"center",gap:"12px",color:"white",flex:1},chatIcon:{width:"20px",height:"20px",flexShrink:0},minimizedTitle:{color:"white",fontSize:"16px",fontWeight:"500",margin:0}},Ie=`@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');\r
23
23
  \r
24
24
  .sw-ttyw-chatbot {\r
25
25
  --swttyw-primary-color: #000;\r
@@ -428,4 +428,4 @@ React keys must be passed directly to JSX without using spread:
428
428
  `).trim(),C=le(p);n.push({placeholder:`\0CODE_RAW_${w}\0`,html:`<pre class="sw-ttyw-code-block"><code>${C}</code></pre>`}),m.push(`\0CODE_RAW_${w}\0`)}else i.length===1&&m.push(i[0])}return{html:m.join(`
429
429
  `),codeBlocks:n}}function ge(r){if(!r)return"";let n=String(r);const a=[];n=n.replace(/```\s*(\w*)\s*\n?([\s\S]*?)```/g,(d,i,w)=>{const p=a.length,C=le(w.trim());return a.push(`<pre class="sw-ttyw-code-block"><code class="${i?`language-${i}`:""}">${C}</code></pre>`),`\0CODE_FENCED_${p}\0`}),n=n.replace(/\[code\]([\s\S]*?)\[\/code\]/gi,(d,i)=>{const w=a.length,p=le(i.trim());return a.push(`<pre class="sw-ttyw-code-block"><code>${p}</code></pre>`),`\0CODE_FENCED_${w}\0`});const{html:m,codeBlocks:o}=Ve(n);return n=m,n=n.replace(/\[text\]([\s\S]*?)(?:\[\/text\]|\]\[text\])/gi,'<span class="sw-ttyw-text-block">$1</span>').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>').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(/^\s*\* (.*$)/gim,"<li>$1</li>").replace(/^\s*- (.*$)/gim,"<li>$1</li>").replace(/^\s*\d+\. (.*$)/gim,"<li>$1</li>").replace(/\n/g,"<br>"),n=n.replace(/((?:<li>.*?<\/li>(?:<br>)?)+)/g,"<ul>$1</ul>"),a.forEach((d,i)=>{n=n.replace(`\0CODE_FENCED_${i}\0`,d)}),o.forEach(({placeholder:d,html:i})=>{n=n.replace(d,i)}),n}const Ae=30,We=300,Te=l.memo(function({text:n,speed:a=20,onComplete:m}){const[o,d]=l.useState(""),[i,w]=l.useState(!1),p=l.useRef(m);l.useEffect(()=>{p.current=m},[m]),l.useEffect(()=>{if(!n)return;d(""),w(!1);const g=n.trim().split(/\s+/),E=Math.min(Ae,g.length),I=g.slice(0,E).join(" "),f=Math.min(I.length,We,n.length);let u=0;const j=setInterval(()=>{u<f?(d(n.slice(0,u+1)),u++):(d(n),w(!0),clearInterval(j),p.current&&p.current())},a);return()=>clearInterval(j)},[n,a]);const C=g=>g.replace(/(https?:\/\/[^\s<]+)/g,'<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\[([^[\]]+)\]/g,"$1").replace(/\[bold\](.*?)\[\/bold\]/g,"<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/(?:^|\n)-\s+/g,`
430
430
  • `).replace(/\n/g,"<br/>").replace(/(\d+\.\s)/g,"<br/>$1").replace(/(\*\s)/g,"<br/>$1");return e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:i?ge(o):C(o)+'<span class="typing-cursor">|</span>'}})}),Fe=l.memo(function({msg:n,isTyping:a=!1,onTypingComplete:m}){const o=n.from==="human"?"sw-ttyw-message self":"sw-ttyw-message other";return e.jsxs("div",{className:o,style:Pe(n.from),children:[e.jsx("div",{className:"message-avatar",style:h.messageAvatar,children:n.from==="human"?e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",children:[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",fill:"black"}),e.jsx("circle",{cx:"12",cy:"7",r:"4",fill:"black"})]}):e.jsx(fe,{width:20,height:20})}),e.jsx("div",{className:"message-content sw-ttyw-markdown",style:h.messageContent,children:n.from==="ai"&&a?e.jsx(Te,{text:n.text,speed:20,onComplete:m}):n.from==="ai"?e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:ge(n.text)}}):e.jsx("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.5",wordBreak:"break-word"},dangerouslySetInnerHTML:{__html:n.text.replace(/\[([^[\]]+)\]/g,"$1").replace(/\[bold\](.*?)\[\/bold\]/g,"<strong>$1</strong>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/(?:^|\n)-\s+/g,`
431
- • `).replace(/\n/g,"<br/>").replace(/(\d+\.\s)/g,"<br/>$1").replace(/(\*\s)/g,"<br/>$1")}})})]})}),Oe=(r="")=>{const n=new Date().getHours();let a=[];return n>=5&&n<12?r?a=[`🌅 Good morning ${r}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,`☀️ Morning ${r}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,`🌞 Good morning ${r}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,`👋 Rise and shine ${r}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,`👋 Morning ${r}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`]:a=["🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?","☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?","🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?","👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.","👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"]:n>=12&&n<17?r?a=[`🌞 Good afternoon ${r}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,`☀️ Afternoon ${r}! I'm an expert on SUPERWISE. How may I help you today?`,`👋 Good afternoon ${r}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,`🌅 Hey there ${r}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,`🌅 Afternoon ${r}! I'm an expert on SUPERWISE. How can I support your exploration today?`]:a=["🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?","☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?","👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?","🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.","🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"]:n>=17&&n<21?r?a=[`🌆 Good evening ${r}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,`🌅 Evening ${r}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,`👋 Good evening ${r}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,`🌇 Hey there ${r}! SUPERWISE expert here. Want to dive into the platform together?`,`🌇 Evening ${r}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`]:a=["🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?","🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?","👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?","🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?","🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"]:r?a=[`🌙 Good evening ${r}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,`⭐ Evening ${r}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,`👋 Good evening ${r}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,`🌃 Hey there ${r}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,`🌃 Evening ${r}! SUPERWISE expert here. How can I help simplify or explain things for you today?`]:a=["🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.","⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?","👋 Good evening! I'm a SUPERWISE expert. Looking to discover features or understand how something works?","🌃 Hey there! I'm a SUPERWISE expert. Want to explore what the platform offers?","🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"],a[Math.floor(Math.random()*a.length)]};function ze({title:r="",agentId:n="",discoveryAgentId:a="",primaryColor:m=""}){const[o,d]=l.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const s=window.localStorage.getItem("chatbot-messages");return s?JSON.parse(s):[]}}catch{}return[]}),[i,w]=l.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const s=window.localStorage.getItem("chatbot-mql_df");return s?JSON.parse(s):[]}}catch{}return[]}),[p,C]=l.useState(""),[g,E]=l.useState(!1),[I,f]=l.useState(!1),[u,j]=l.useState(!1),[R,A]=l.useState(!1),[W,z]=l.useState(new Set),[Q,q]=l.useState(!1),[ee,te]=l.useState(!1),[re,H]=l.useState(!1),[M,ne]=l.useState(!1),[oe,$]=l.useState(""),[B,P]=l.useState(""),J=9e4,se="https://superwise.ai/contact/",D=l.useRef(null),U=l.useRef(null),t=(()=>{if(m)return m;if(typeof document<"u"&&typeof window<"u"){const s=document.querySelector("[data-chatbot-color]");if(s)return s.getAttribute("data-chatbot-color")||"#000";const S=getComputedStyle(document.documentElement).getPropertyValue("--swttyw-primary-color").trim();if(S)return S}return"#000"})(),c=l.useMemo(()=>{if(!i||i.length===0)return"";const s=i.find(v=>v.name&&v.email);return s?`${s.name} (${s.email})`:""},[i]),y=l.useRef(null),b=l.useRef(null),N=l.useRef(o),L=l.useCallback(()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),k=l.useCallback(s=>{L(),D.current=setTimeout(s,J)},[J,L]),_=l.useMemo(()=>o.map(s=>({role:s.from,content:s.text})),[o]),T=s=>{P(s),setTimeout(()=>{P("")},4e3)},pe=s=>{const v=s.length,S=s.trim();return $(""),P(""),!S||v===0?(T("Please enter a message before sending."),!1):new RegExp(/(<([^>]+)>)/gi).test(S)?(T("Please avoid using HTML tags or scripts in your message."),!1):S.length<2?(T("Please enter a meaningful question (at least 2 characters)."),!1):S.length>1e3?(T("Message is too long. Please keep it under 1000 characters."),!1):($(""),P(""),!0)},ae=l.useCallback((s="auto")=>{var S;const v=b.current;v&&(v.scrollTop=v.scrollHeight),(S=y.current)==null||S.scrollIntoView({behavior:s})},[]);l.useEffect(()=>{requestAnimationFrame(()=>ae("auto"))},[o,B,re,M,ae]),l.useEffect(()=>{if(!g&&W.size===0)return;const s=setInterval(()=>ae("auto"),120);return()=>clearInterval(s)},[g,W,ae]),l.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-messages",JSON.stringify(o))}catch{}},[o]),l.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-mql_df",JSON.stringify(i))}catch{}},[i]),l.useEffect(()=>{N.current=o},[o]),l.useEffect(()=>{if(o.length===0&&!Q){const v={from:"ai",text:Oe(c)};d([v]),q(!0),z(new Set([0]))}},[o.length,Q,c]),l.useEffect(()=>()=>L(),[L]);const ye=l.useCallback(async()=>{var be;if(g||M)return;const s=p.trim();if(!s||!pe(p))return;H(!1),L(),(be=U.current)==null||be.abort();const v=new AbortController;U.current=v;const S=v.signal,V={from:"human",text:s},F=N.current,Ue=[...F,V];d(Ue),C(""),E(!0);let Ce=s;if(i&&i.length>0&&!ee){const x=F.filter(Z=>Z.from==="ai").pop();x&&x.text&&x.text.trim()!==""&&(Ce=s+"."+x.text,te(!0))}const Ne=[..._,{role:"human",content:s}];k(()=>{var x;H(!0),(x=U.current)==null||x.abort(),E(!1)});try{const x=await je(Ce,Ne,i,n,a,S);if(L(),typeof x=="string"){const Z={from:"ai",text:x};d(X=>{const K=[...X,Z];return z(me=>new Set([...me,K.length-1])),K}),(x.startsWith("⚠️")||x.startsWith("❌"))&&H(!0)}else{const Z={from:"ai",text:x.reply};d(X=>{const K=[...X,Z];return z(me=>new Set([...me,K.length-1])),K}),x.mqlDf&&Array.isArray(x.mqlDf)&&w(x.mqlDf),x.reply&&(x.reply.startsWith("⚠️")||x.reply.startsWith("❌"))&&H(!0),x.chatHistoryLimitExceeded&&ne(!0)}}catch(x){if(L(),x.name==="AbortError")return;H(!0);const Z=x.message||"Something went wrong. Please try again.";d(X=>[...X,{from:"ai",text:`⚠️ ${Z}`}])}finally{E(!1)}},[p,n,a,i,ee,_,M,L,k]),De=l.useCallback(()=>{var s;L(),(s=U.current)==null||s.abort(),H(!1),ne(!1),d([]),z(new Set),q(!1),te(!1);try{typeof window<"u"&&window.localStorage&&window.localStorage.removeItem("chatbot-messages")}catch{}f(!1)},[L]),xe=l.useCallback(async()=>{var s,v,S;if(!i||i.length===0){console.warn("No mql_df data available for PDF download");return}try{E(!0),console.log("mql_df data for lead extraction:",i);const V={name:((s=i.find(F=>F.name))==null?void 0:s.name)||"Chat User",email:((v=i.find(F=>F.email))==null?void 0:v.email)||"user@example.com",summary:`Chat conversation with ${o.length} messages. User asked: "${((S=o.find(F=>F.from==="human"))==null?void 0:S.text)||"No user messages"}"`};console.log("Extracted lead row:",V),await Le(i,V,_),console.log("PDF downloaded successfully")}catch(V){console.error("Failed to download PDF:",V)}finally{E(!1)}},[i,o]);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"sw-ttyw-chatbot",style:{...u?h.containerMinimized:R?h.containerExpanded:h.container,"--swttyw-primary-color":t,"--swttyw-avatar-image":"url('')","--swttyw-user-avatar-image":"url('')","--swttyw-background-color":"#F7F7F7","--swttyw-header-font-size":"16px","--swttyw-body-font-size":"15px","--swttyw-footer-font-size":"16px","--swttyw-user-background-image":"url('')"},onClick:u?()=>j(!1):void 0,children:[u?e.jsxs("div",{style:h.minimizedContent,children:[e.jsxs("svg",{style:h.chatIcon,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[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"}),e.jsx("path",{d:"M8 9H16",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M8 13H12",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("div",{style:h.minimizedTitle,children:r})]}):e.jsxs("div",{className:"sw-ttyw-chat-header",style:h.header,children:[e.jsx("div",{className:"sw-ttyw-name",style:h.name,children:r}),e.jsxs("div",{style:h.headerActions,children:[e.jsx("button",{onClick:()=>A(s=>!s),style:h.headerButton,title:R?"Shrink chat":"Expand chat",children:R?e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M9 4V9H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 4V9H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9 20V15H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 20V15H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M4 9V4H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 9V4H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 15V20H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 15V20H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>{u||A(!1),j(!u)},style:h.headerButton,title:u?"Maximize chat":"Minimize chat",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M6 9H18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),i&&i.length>0&&e.jsx("button",{onClick:xe,style:h.headerButton,title:"Download PDF Report",disabled:g,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[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"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>f(!0),style:h.headerButton,title:"Clear chat",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),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"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]}),!u&&e.jsxs("div",{className:"sw-ttyw-chat-section",style:{flexGrow:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"sw-ttyw-messages",style:h.chatSection,ref:b,children:[o.length===0&&!g&&e.jsx("div",{className:"sw-ttyw-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",position:"relative"},children:e.jsx("img",{src:Re,alt:"Superwise Logo",style:{width:"350px",height:"200px",opacity:.8,objectFit:"contain"},onError:s=>{console.log("Logo failed to load, using fallback"),s.target.style.display="none"}})}),o.map((s,v)=>e.jsx(Fe,{msg:s,isTyping:W.has(v),onTypingComplete:()=>{z(S=>{const V=new Set(S);return V.delete(v),V})}},v)),B&&e.jsxs("div",{className:"sw-ttyw-validation-message",children:[e.jsx("span",{className:"error-icon",children:"⚠️"}),e.jsx("span",{children:B})]}),re&&e.jsx("div",{className:"sw-ttyw-contact-cta",children:e.jsxs("a",{href:se,target:"_blank",rel:"noopener noreferrer",className:"sw-ttyw-cta-button",children:[e.jsx("span",{className:"sw-ttyw-cta-icon","aria-hidden":!0,children:"✉"}),"Contact Sales"]})}),M&&e.jsxs("div",{className:"sw-ttyw-limit-exceeded",children:[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."}),e.jsxs("div",{className:"sw-ttyw-limit-action-buttons",children:[e.jsxs("button",{type:"button",className:"sw-ttyw-limit-download-pdf",onClick:xe,disabled:g,children:[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:[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"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Download Chat"]}),e.jsxs("button",{type:"button",className:"sw-ttyw-limit-clear-history",onClick:()=>f(!0),children:[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:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),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"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Clear History"]})]})]}),g&&e.jsxs("div",{className:"sw-ttyw-message other message-loading",style:{...h.message,...h.messageOther},children:[e.jsx("div",{className:"message-avatar",style:h.messageAvatar,children:e.jsx(fe,{width:20,height:20})}),e.jsxs("div",{className:"message-content",style:h.messageContent,children:[e.jsx("div",{className:"typing typing-1"}),e.jsx("div",{className:"typing typing-2"}),e.jsx("div",{className:"typing typing-3"})]})]}),e.jsx("div",{ref:y})]}),e.jsxs("div",{className:"sw-ttyw-chat-input-section",style:h.inputSection,children:[e.jsx("textarea",{className:"sw-ttyw-input",placeholder:M?"Chat limit reached.":"Please ask question here",value:p,onChange:s=>{C(s.target.value),B&&P("")},maxLength:1e3,disabled:g||M,style:h.textarea,onKeyDown:s=>s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),ye())}),e.jsxs("div",{className:"sw-ttyw-chat-input-content",style:h.inputFooter,children:[e.jsxs("small",{id:"sw-ttyw-chat-textbox-status",style:h.characterCount,children:[e.jsx("span",{children:p.length}),"/1000"]}),e.jsx("button",{id:"sw-ttyw-chat-send-message",onClick:ye,"aria-label":"Send message",disabled:g||M,style:h.sendButton,children:e.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:[e.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),e.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})]})})]})]})]}),I&&e.jsxs("div",{className:"swttyw-modal swttyw-modal-clear-history",style:h.modalOverlay,children:[e.jsx("div",{className:"swtty-modal-header"}),e.jsxs("div",{className:"swtty-modal-body",style:h.modalBody,children:[e.jsx("div",{className:"swtty-content",children:"Are you sure you want to delete the chat history?"}),e.jsxs("div",{className:"swtty-action",style:h.modalActions,children:[e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary",id:"swttyw-btn-clear-history-yes",onClick:De,value:"Yes",style:{background:"var(--swttyw-primary-color)",color:"white",border:"none",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}}),e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary-inverse",id:"swttyw-btn-clear-history-no",onClick:()=>f(!1),value:"No",style:{background:"transparent",color:"var(--swttyw-primary-color)",border:"1px solid var(--swttyw-primary-color)",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}})]})]}),e.jsx("div",{className:"swtty-modal-footer"})]}),!u&&e.jsxs("div",{className:"sw-ttyw-chat-footer",style:h.footer,children:["Powered by ",e.jsx("a",{href:"https://superwise.ai/",className:"ml-1",target:"_new",rel:"noopener noreferrer",style:{marginLeft:"0.25rem",lineHeight:0},"aria-label":"SUPERWISE®",children:e.jsx(_e,{height:20})})]})]})})}O.Chatbot=ze,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
431
+ • `).replace(/\n/g,"<br/>").replace(/(\d+\.\s)/g,"<br/>$1").replace(/(\*\s)/g,"<br/>$1")}})})]})}),Oe=(r="")=>{const n=new Date().getHours();let a=[];return n>=5&&n<12?r?a=[`🌅 Good morning ${r}! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?`,`☀️ Morning ${r}! I'm an expert on SUPERWISE. What would you like to discover or optimize today?`,`🌞 Good morning ${r}! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?`,`👋 Rise and shine ${r}! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.`,`👋 Morning ${r}! I'm an expert on SUPERWISE. How can I guide you through the platform today?`]:a=["🌅 Good morning! I'm an expert on SUPERWISE. Ready to explore the platform together and uncover what's possible?","☀️ Morning! I'm an expert on SUPERWISE. What would you like to discover or optimize today?","🌞 Good morning! I'm an expert on SUPERWISE. Curious about a feature or looking to dive deeper into the platform?","👋 Rise and shine! I'm an expert on SUPERWISE. Let's jump into anything you want to explore.","👋 Morning! I'm an expert on SUPERWISE. How can I guide you through the platform today?"]:n>=12&&n<17?r?a=[`🌞 Good afternoon ${r}! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?`,`☀️ Afternoon ${r}! I'm an expert on SUPERWISE. How may I help you today?`,`👋 Good afternoon ${r}! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?`,`🌅 Hey there ${r}! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.`,`🌅 Afternoon ${r}! I'm an expert on SUPERWISE. How can I support your exploration today?`]:a=["🌞 Good afternoon! I'm an expert on SUPERWISE. Ready to explore insights, features, or workflows together?","☀️ Afternoon! I'm an expert on SUPERWISE. How may I help you today?","👋 Good afternoon! I'm an expert on SUPERWISE. Looking to learn, optimize, or explore something specific?","🌅 Hey there! SUPERWISE expert here. Ready to help you unlock the capabilities you're curious about.","🌅 Afternoon! I'm an expert on SUPERWISE. How can I support your exploration today?"]:n>=17&&n<21?r?a=[`🌆 Good evening ${r}! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?`,`🌅 Evening ${r}! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?`,`👋 Good evening ${r}! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?`,`🌇 Hey there ${r}! SUPERWISE expert here. Want to dive into the platform together?`,`🌇 Evening ${r}! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?`]:a=["🌆 Good evening! I'm a SUPERWISE expert. Ready to explore features or clarify anything you're evaluating?","🌅 Evening! I'm your SUPERWISE expert. What can I help you discover or fine-tune tonight?","👋 Good evening! I'm an expert on SUPERWISE. Interested in exploring capabilities or reviewing how something works?","🌇 Hey there! SUPERWISE expert here. Want to dive into the platform together?","🌇 Evening! I'm an expert on SUPERWISE. How can I assist your learning or discovery today?"]:r?a=[`🌙 Good evening ${r}! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.`,`⭐ Evening ${r}! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?`,`👋 Good evening ${r}! I'm a SUPERWISE expert. Looking to discover features or understand how something works?`,`🌃 Hey there ${r}! I'm a SUPERWISE expert. Want to explore what the platform offers?`,`🌃 Evening ${r}! SUPERWISE expert here. How can I help simplify or explain things for you today?`]:a=["🌙 Good evening! I'm a SUPERWISE expert. Ready to guide you through the platform anytime.","⭐ Evening! I'm your SUPERWISE expert. What brings you to Superwise tonight - exploration, questions, or clarity?","👋 Good evening! I'm a SUPERWISE expert. Looking to discover features or understand how something works?","🌃 Hey there! I'm a SUPERWISE expert. Want to explore what the platform offers?","🌃 Evening! SUPERWISE expert here. How can I help simplify or explain things for you today?"],a[Math.floor(Math.random()*a.length)]};function ze({title:r="",agentId:n="",discoveryAgentId:a="",primaryColor:m=""}){const[o,d]=l.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const s=window.localStorage.getItem("chatbot-messages");return s?JSON.parse(s):[]}}catch{}return[]}),[i,w]=l.useState(()=>{try{if(typeof window<"u"&&window.localStorage){const s=window.localStorage.getItem("chatbot-mql_df");return s?JSON.parse(s):[]}}catch{}return[]}),[p,C]=l.useState(""),[g,E]=l.useState(!1),[I,f]=l.useState(!1),[u,j]=l.useState(!1),[R,A]=l.useState(!1),[W,z]=l.useState(new Set),[q,ee]=l.useState(!1),[te,re]=l.useState(!1),[ne,H]=l.useState(!1),[M,oe]=l.useState(!1),[se,$]=l.useState(""),[B,P]=l.useState(""),J=9e4,ae="https://superwise.ai/contact/",D=l.useRef(null),U=l.useRef(null),t=(()=>{if(m)return m;if(typeof document<"u"&&typeof window<"u"){const s=document.querySelector("[data-chatbot-color]");if(s)return s.getAttribute("data-chatbot-color")||"#000";const S=getComputedStyle(document.documentElement).getPropertyValue("--swttyw-primary-color").trim();if(S)return S}return"#000"})(),c=l.useMemo(()=>{if(!i||i.length===0)return"";const s=i.find(v=>v.name&&v.email);return s?`${s.name} (${s.email})`:""},[i]),y=l.useRef(null),b=l.useRef(null),N=l.useRef(o),L=l.useCallback(()=>{D.current&&(clearTimeout(D.current),D.current=null)},[]),k=l.useCallback(s=>{L(),D.current=setTimeout(s,J)},[J,L]),_=l.useMemo(()=>o.map(s=>({role:s.from,content:s.text})),[o]),T=s=>{P(s),setTimeout(()=>{P("")},4e3)},pe=s=>{const v=s.length,S=s.trim();return $(""),P(""),!S||v===0?(T("Please enter a message before sending."),!1):new RegExp(/(<([^>]+)>)/gi).test(S)?(T("Please avoid using HTML tags or scripts in your message."),!1):S.length<2?(T("Please enter a meaningful question (at least 2 characters)."),!1):S.length>1e3?(T("Message is too long. Please keep it under 1000 characters."),!1):($(""),P(""),!0)},X=l.useCallback((s="auto")=>{var S;const v=b.current;v&&(v.scrollTop=v.scrollHeight),(S=y.current)==null||S.scrollIntoView({behavior:s})},[]);l.useEffect(()=>{requestAnimationFrame(()=>X("auto"))},[o,B,ne,M,X]),l.useEffect(()=>{if(!g&&W.size===0)return;const s=setInterval(()=>X("auto"),120);return()=>clearInterval(s)},[g,W,X]),l.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-messages",JSON.stringify(o))}catch{}},[o]),l.useEffect(()=>{try{typeof window<"u"&&window.localStorage&&window.localStorage.setItem("chatbot-mql_df",JSON.stringify(i))}catch{}},[i]),l.useEffect(()=>{N.current=o},[o]),l.useEffect(()=>{if(o.length===0&&!q){const v={from:"ai",text:Oe(c)};d([v]),ee(!0),z(new Set([0]))}},[o.length,q,c]),l.useEffect(()=>()=>L(),[L]);const ye=l.useCallback(async()=>{var be;if(g||M)return;const s=p.trim();if(!s||!pe(p))return;H(!1),L(),(be=U.current)==null||be.abort();const v=new AbortController;U.current=v;const S=v.signal,V={from:"human",text:s},F=N.current,Ue=[...F,V];d(Ue),C(""),E(!0);let Ce=s;if(i&&i.length>0&&!te){const x=F.filter(Z=>Z.from==="ai").pop();x&&x.text&&x.text.trim()!==""&&(Ce=s+"."+x.text,re(!0))}const Ne=[..._,{role:"human",content:s}];k(()=>{var x;H(!0),(x=U.current)==null||x.abort(),E(!1)});try{const x=await je(Ce,Ne,i,n,a,S);if(L(),typeof x=="string"){const Z={from:"ai",text:x};d(K=>{const Q=[...K,Z];return z(me=>new Set([...me,Q.length-1])),Q}),(x.startsWith("⚠️")||x.startsWith("❌"))&&H(!0)}else{const Z={from:"ai",text:x.reply};d(K=>{const Q=[...K,Z];return z(me=>new Set([...me,Q.length-1])),Q}),x.mqlDf&&Array.isArray(x.mqlDf)&&w(x.mqlDf),x.reply&&(x.reply.startsWith("⚠️")||x.reply.startsWith("❌"))&&H(!0),x.chatHistoryLimitExceeded&&oe(!0)}}catch(x){if(L(),x.name==="AbortError")return;H(!0);const Z=x.message||"Something went wrong. Please try again.";d(K=>[...K,{from:"ai",text:`⚠️ ${Z}`}])}finally{E(!1)}},[p,n,a,i,te,_,M,L,k]),De=l.useCallback(()=>{var s;L(),(s=U.current)==null||s.abort(),H(!1),oe(!1),d([]),z(new Set),ee(!1),re(!1);try{typeof window<"u"&&window.localStorage&&window.localStorage.removeItem("chatbot-messages")}catch{}f(!1)},[L]),xe=l.useCallback(async()=>{var s,v,S;if(!i||i.length===0){console.warn("No mql_df data available for PDF download");return}try{E(!0),console.log("mql_df data for lead extraction:",i);const V={name:((s=i.find(F=>F.name))==null?void 0:s.name)||"Chat User",email:((v=i.find(F=>F.email))==null?void 0:v.email)||"user@example.com",summary:`Chat conversation with ${o.length} messages. User asked: "${((S=o.find(F=>F.from==="human"))==null?void 0:S.text)||"No user messages"}"`};console.log("Extracted lead row:",V),await Le(i,V,_),console.log("PDF downloaded successfully")}catch(V){console.error("Failed to download PDF:",V)}finally{E(!1)}},[i,o]);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"sw-ttyw-chatbot",style:{...u?h.containerMinimized:R?h.containerExpanded:h.container,"--swttyw-primary-color":t,"--swttyw-avatar-image":"url('')","--swttyw-user-avatar-image":"url('')","--swttyw-background-color":"#F7F7F7","--swttyw-header-font-size":"16px","--swttyw-body-font-size":"15px","--swttyw-footer-font-size":"16px","--swttyw-user-background-image":"url('')"},onClick:u?()=>j(!1):void 0,children:[u?e.jsxs("div",{style:h.minimizedContent,children:[e.jsxs("svg",{style:h.chatIcon,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[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"}),e.jsx("path",{d:"M8 9H16",stroke:"white",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M8 13H12",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("div",{style:h.minimizedTitle,children:r})]}):e.jsxs("div",{className:"sw-ttyw-chat-header",style:h.header,children:[e.jsx("div",{className:"sw-ttyw-name",style:h.name,children:r}),e.jsxs("div",{style:h.headerActions,children:[e.jsx("button",{onClick:()=>A(s=>!s),style:h.headerButton,title:R?"Shrink chat":"Expand chat",children:R?e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M9 4V9H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 4V9H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9 20V15H4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 20V15H20",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}):e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M4 9V4H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 9V4H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M4 15V20H9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20 15V20H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>{u||A(!1),j(!u)},style:h.headerButton,title:u?"Maximize chat":"Minimize chat",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M6 9H18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),i&&i.length>0&&e.jsx("button",{onClick:xe,style:h.headerButton,title:"Download PDF Report",disabled:g,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[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"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{onClick:()=>f(!0),style:h.headerButton,title:"Clear chat",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),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"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})]}),!u&&e.jsxs("div",{className:"sw-ttyw-chat-section",style:{flexGrow:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"sw-ttyw-messages",style:h.chatSection,ref:b,children:[o.length===0&&!g&&e.jsx("div",{className:"sw-ttyw-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",position:"relative"},children:e.jsx("img",{src:Re,alt:"Superwise Logo",style:{width:"350px",height:"200px",opacity:.8,objectFit:"contain"},onError:s=>{console.log("Logo failed to load, using fallback"),s.target.style.display="none"}})}),o.map((s,v)=>e.jsx(Fe,{msg:s,isTyping:W.has(v),onTypingComplete:()=>{z(S=>{const V=new Set(S);return V.delete(v),V}),requestAnimationFrame(()=>X("auto"))}},v)),B&&e.jsxs("div",{className:"sw-ttyw-validation-message",children:[e.jsx("span",{className:"error-icon",children:"⚠️"}),e.jsx("span",{children:B})]}),ne&&e.jsx("div",{className:"sw-ttyw-contact-cta",children:e.jsxs("a",{href:ae,target:"_blank",rel:"noopener noreferrer",className:"sw-ttyw-cta-button",children:[e.jsx("span",{className:"sw-ttyw-cta-icon","aria-hidden":!0,children:"✉"}),"Contact Sales"]})}),M&&e.jsxs("div",{className:"sw-ttyw-limit-exceeded",children:[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."}),e.jsxs("div",{className:"sw-ttyw-limit-action-buttons",children:[e.jsxs("button",{type:"button",className:"sw-ttyw-limit-download-pdf",onClick:xe,disabled:g,children:[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:[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"}),e.jsx("path",{d:"M7 10L12 15L17 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 15V3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Download Chat"]}),e.jsxs("button",{type:"button",className:"sw-ttyw-limit-clear-history",onClick:()=>f(!0),children:[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:[e.jsx("path",{d:"M3 6H5H21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),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"}),e.jsx("path",{d:"M10 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M14 11V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Clear History"]})]})]}),g&&e.jsxs("div",{className:"sw-ttyw-message other message-loading",style:{...h.message,...h.messageOther},children:[e.jsx("div",{className:"message-avatar",style:h.messageAvatar,children:e.jsx(fe,{width:20,height:20})}),e.jsxs("div",{className:"message-content",style:h.messageContent,children:[e.jsx("div",{className:"typing typing-1"}),e.jsx("div",{className:"typing typing-2"}),e.jsx("div",{className:"typing typing-3"})]})]}),e.jsx("div",{ref:y})]}),e.jsxs("div",{className:"sw-ttyw-chat-input-section",style:h.inputSection,children:[e.jsx("textarea",{className:"sw-ttyw-input",placeholder:M?"Chat limit reached.":"Please ask question here",value:p,onChange:s=>{C(s.target.value),B&&P("")},maxLength:1e3,disabled:g||M,style:h.textarea,onKeyDown:s=>s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),ye())}),e.jsxs("div",{className:"sw-ttyw-chat-input-content",style:h.inputFooter,children:[e.jsxs("small",{id:"sw-ttyw-chat-textbox-status",style:h.characterCount,children:[e.jsx("span",{children:p.length}),"/1000"]}),e.jsx("button",{id:"sw-ttyw-chat-send-message",onClick:ye,"aria-label":"Send message",disabled:g||M,style:h.sendButton,children:e.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:[e.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),e.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})]})})]})]})]}),I&&e.jsxs("div",{className:"swttyw-modal swttyw-modal-clear-history",style:h.modalOverlay,children:[e.jsx("div",{className:"swtty-modal-header"}),e.jsxs("div",{className:"swtty-modal-body",style:h.modalBody,children:[e.jsx("div",{className:"swtty-content",children:"Are you sure you want to delete the chat history?"}),e.jsxs("div",{className:"swtty-action",style:h.modalActions,children:[e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary",id:"swttyw-btn-clear-history-yes",onClick:De,value:"Yes",style:{background:"var(--swttyw-primary-color)",color:"white",border:"none",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}}),e.jsx("input",{type:"button",className:"swttyw-btn swttyw-btn-primary-inverse",id:"swttyw-btn-clear-history-no",onClick:()=>f(!1),value:"No",style:{background:"transparent",color:"var(--swttyw-primary-color)",border:"1px solid var(--swttyw-primary-color)",padding:"10px 20px",cursor:"pointer",borderRadius:"8px",margin:"10px 5px"}})]})]}),e.jsx("div",{className:"swtty-modal-footer"})]}),!u&&e.jsxs("div",{className:"sw-ttyw-chat-footer",style:h.footer,children:["Powered by ",e.jsx("a",{href:"https://superwise.ai/",className:"ml-1",target:"_new",rel:"noopener noreferrer",style:{marginLeft:"0.25rem",lineHeight:0},"aria-label":"SUPERWISE®",children:e.jsx(_e,{height:20})})]})]})})}O.Chatbot=ze,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ronak27/superwise-chatbot-package",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "A reusable React chatbot component package",
5
5
  "author": "Superwise",
6
6
  "license": "MIT",