@instockng/storefront-ui 1.0.118 → 1.0.119

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.
Files changed (113) hide show
  1. package/dist/components/AssistantDrawer.d.ts.map +1 -1
  2. package/dist/index117.mjs +2 -2
  3. package/dist/index118.mjs +2 -2
  4. package/dist/index153.mjs +1 -1
  5. package/dist/index155.mjs +1 -1
  6. package/dist/index156.mjs +2 -2
  7. package/dist/index160.mjs +2 -2
  8. package/dist/index169.mjs +1 -1
  9. package/dist/index170.mjs +1 -1
  10. package/dist/index172.mjs +1 -1
  11. package/dist/index173.mjs +1 -1
  12. package/dist/index175.mjs +3 -3
  13. package/dist/index176.mjs +1 -1
  14. package/dist/index178.mjs +2 -2
  15. package/dist/index179.mjs +1 -1
  16. package/dist/index184.mjs +2 -2
  17. package/dist/index186.mjs +1 -1
  18. package/dist/index188.mjs +2 -2
  19. package/dist/index189.mjs +5 -5
  20. package/dist/index192.mjs +1 -1
  21. package/dist/index195.mjs +1 -1
  22. package/dist/index198.mjs +1 -1
  23. package/dist/index199.mjs +1 -1
  24. package/dist/index203.mjs +1 -1
  25. package/dist/index205.mjs +1 -1
  26. package/dist/index22.mjs +122 -133
  27. package/dist/index224.mjs +12 -30
  28. package/dist/index225.mjs +7 -11
  29. package/dist/index226.mjs +30 -3
  30. package/dist/index227.mjs +10 -3
  31. package/dist/index228.mjs +4 -13
  32. package/dist/index229.mjs +4 -7
  33. package/dist/index232.mjs +2 -2
  34. package/dist/index233.mjs +2 -2
  35. package/dist/index236.mjs +2 -2
  36. package/dist/index237.mjs +2 -2
  37. package/dist/index239.mjs +2 -2
  38. package/dist/index240.mjs +2 -2
  39. package/dist/index242.mjs +2 -2
  40. package/dist/index243.mjs +2 -2
  41. package/dist/index244.mjs +37 -2
  42. package/dist/index245.mjs +2 -108
  43. package/dist/index246.mjs +244 -2
  44. package/dist/index248.mjs +28 -32
  45. package/dist/index249.mjs +65 -2
  46. package/dist/index250.mjs +24 -243
  47. package/dist/index251.mjs +2 -2
  48. package/dist/index252.mjs +2 -33
  49. package/dist/index253.mjs +99 -56
  50. package/dist/index254.mjs +2 -25
  51. package/dist/index255.mjs +2 -2
  52. package/dist/index256.mjs +2 -2
  53. package/dist/index257.mjs +2 -2
  54. package/dist/index259.mjs +2 -2
  55. package/dist/index264.mjs +2 -2
  56. package/dist/index267.mjs +2 -2
  57. package/dist/index268.mjs +2 -2
  58. package/dist/index269.mjs +2 -18
  59. package/dist/index270.mjs +2 -47
  60. package/dist/index271.mjs +91 -2
  61. package/dist/index272.mjs +2 -2
  62. package/dist/index273.mjs +18 -2
  63. package/dist/index274.mjs +47 -2
  64. package/dist/index275.mjs +2 -91
  65. package/dist/index276.mjs +1 -2
  66. package/dist/index277.mjs +3 -2
  67. package/dist/index278.mjs +2 -2
  68. package/dist/index279.mjs +2 -17
  69. package/dist/index280.mjs +15 -11
  70. package/dist/index281.mjs +13 -6
  71. package/dist/index282.mjs +6 -30
  72. package/dist/index283.mjs +30 -2
  73. package/dist/index43.mjs +1 -1
  74. package/dist/index44.mjs +1 -1
  75. package/dist/index45.mjs +1 -1
  76. package/dist/index46.mjs +1 -1
  77. package/dist/index47.mjs +1 -1
  78. package/dist/index48.mjs +2 -2
  79. package/dist/index50.mjs +1 -1
  80. package/dist/index58.mjs +1 -1
  81. package/dist/index64.mjs +2 -2
  82. package/dist/index65.mjs +1 -1
  83. package/dist/index66.mjs +1 -1
  84. package/dist/index67.mjs +1 -1
  85. package/dist/index68.mjs +1 -1
  86. package/dist/index69.mjs +1 -1
  87. package/dist/index70.mjs +1 -1
  88. package/dist/index71.mjs +1 -1
  89. package/dist/index72.mjs +1 -1
  90. package/dist/index73.mjs +1 -1
  91. package/dist/index74.mjs +1 -1
  92. package/dist/index75.mjs +1 -1
  93. package/dist/index76.mjs +1 -1
  94. package/dist/index77.mjs +1 -1
  95. package/dist/index78.mjs +1 -1
  96. package/dist/index79.mjs +4 -23
  97. package/dist/index80.mjs +23 -2
  98. package/dist/index81.mjs +21 -20
  99. package/dist/index82.mjs +7 -7
  100. package/dist/index83.mjs +2 -5
  101. package/dist/index86.mjs +1 -1
  102. package/dist/index87.mjs +37 -2
  103. package/dist/index88.mjs +42 -5
  104. package/dist/index89.mjs +2 -1134
  105. package/dist/index90.mjs +5 -19
  106. package/dist/index91.mjs +1119 -40
  107. package/dist/index92.mjs +14 -27
  108. package/dist/index93.mjs +55 -2
  109. package/dist/index94.mjs +33 -37
  110. package/dist/index95.mjs +2 -43
  111. package/dist/styles.css +1 -1
  112. package/package.json +1 -1
  113. package/src/components/AssistantDrawer.tsx +0 -21
package/dist/index22.mjs CHANGED
@@ -1,179 +1,169 @@
1
1
  'use client';
2
2
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
3
- import { useState as d, useRef as y, useCallback as V, useEffect as x } from "react";
4
- import { createPortal as ee } from "react-dom";
5
- import { Sparkles as te, X as re, MessageCircle as se, Loader2 as ne, Send as ae } from "lucide-react";
6
- import { cn as k, formatCurrency as oe, WHATSAPP_HELP_LINK as le } from "./index30.mjs";
7
- import { useHideBodyOverflow as ie } from "./index53.mjs";
8
- function ce(a) {
3
+ import { useState as g, useRef as x, useCallback as O, useEffect as S } from "react";
4
+ import { createPortal as Z } from "react-dom";
5
+ import { Sparkles as Q, X as ee, MessageCircle as te, Loader2 as re, Send as se } from "lucide-react";
6
+ import { cn as k, formatCurrency as ne, WHATSAPP_HELP_LINK as ae } from "./index30.mjs";
7
+ import { useHideBodyOverflow as oe } from "./index53.mjs";
8
+ function le(a) {
9
9
  return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/\n/g, "<br />");
10
10
  }
11
- function de(a) {
11
+ function ie(a) {
12
12
  return a.replace(/\s*PRO\w*UCTS?:[\w\-,]*\s*/gi, "").replace(/\s*CONTACT_SUPPORT\s*/gi, "").replace(/\s*SUGGESTIONS:[^\n]*\s*/g, "");
13
13
  }
14
- function be({
14
+ function he({
15
15
  isOpen: a,
16
- onClose: w,
17
- apiUrl: P,
18
- brandSlug: R,
19
- productSlug: j,
20
- initialQuestion: v,
21
- assistantName: I = "AI Assistant",
22
- className: B,
23
- disablePortal: X = !1
16
+ onClose: y,
17
+ apiUrl: R,
18
+ brandSlug: j,
19
+ productSlug: I,
20
+ initialQuestion: w,
21
+ assistantName: L = "AI Assistant",
22
+ className: z,
23
+ disablePortal: B = !1
24
24
  }) {
25
- const [u, m] = d([]), [N, E] = d(""), [f, H] = d(!1), [$, h] = d(null), [_, M] = d(!1), [O, W] = d(!1), [U, z] = d(0), D = y(null), J = y(null), A = y(!1), q = y([]);
26
- q.current = u, ie(a);
27
- const F = V((e, n) => {
25
+ const [d, u] = g([]), [N, A] = g(""), [m, _] = g(!1), [$, h] = g(null), [M, W] = g(!1), [K, H] = g(!1), U = x(null), D = x(null), E = x(!1), J = x([]);
26
+ J.current = d, oe(a);
27
+ const q = O((e, l) => {
28
28
  if (e === "token")
29
- m((r) => {
30
- const l = [...r], s = l[l.length - 1];
31
- if ((s == null ? void 0 : s.role) === "assistant") {
32
- const o = s.content + n, i = de(o);
33
- l[l.length - 1] = { ...s, content: i };
29
+ u((s) => {
30
+ const o = [...s], r = o[o.length - 1];
31
+ if ((r == null ? void 0 : r.role) === "assistant") {
32
+ const n = r.content + l, i = ie(n);
33
+ o[o.length - 1] = { ...r, content: i };
34
34
  }
35
- return l;
35
+ return o;
36
36
  });
37
37
  else if (e === "done")
38
38
  try {
39
- const r = JSON.parse(n);
40
- m((l) => {
41
- var i, g;
42
- const s = [...l], o = s[s.length - 1];
43
- return (o == null ? void 0 : o.role) === "assistant" && (s[s.length - 1] = {
44
- ...o,
45
- content: r.answer || o.content,
46
- products: ((i = r.products) == null ? void 0 : i.length) > 0 ? r.products : void 0,
47
- whatsapp: r.whatsapp || !1,
48
- suggestions: ((g = r.suggestions) == null ? void 0 : g.length) > 0 ? r.suggestions : void 0
49
- }), s;
39
+ const s = JSON.parse(l);
40
+ u((o) => {
41
+ var i, f;
42
+ const r = [...o], n = r[r.length - 1];
43
+ return (n == null ? void 0 : n.role) === "assistant" && (r[r.length - 1] = {
44
+ ...n,
45
+ content: s.answer || n.content,
46
+ products: ((i = s.products) == null ? void 0 : i.length) > 0 ? s.products : void 0,
47
+ whatsapp: s.whatsapp || !1,
48
+ suggestions: ((f = s.suggestions) == null ? void 0 : f.length) > 0 ? s.suggestions : void 0
49
+ }), r;
50
50
  });
51
51
  } catch {
52
52
  }
53
53
  else if (e === "error")
54
54
  try {
55
- const r = JSON.parse(n);
56
- h(r.message || "An error occurred");
55
+ const s = JSON.parse(l);
56
+ h(s.message || "An error occurred");
57
57
  } catch {
58
58
  h("An error occurred");
59
59
  }
60
- }, []), S = y(null), T = V(
60
+ }, []), v = x(null), T = O(
61
61
  async (e) => {
62
- var l;
62
+ var o;
63
63
  if (!e.trim()) return;
64
64
  h(null);
65
- const n = { role: "user", content: e }, r = q.current.slice(-20).map((s) => ({
66
- role: s.role,
67
- content: s.content
65
+ const l = { role: "user", content: e }, s = J.current.slice(-20).map((r) => ({
66
+ role: r.role,
67
+ content: r.content
68
68
  }));
69
- m((s) => [...s, n]), E(""), H(!0), m((s) => [...s, { role: "assistant", content: "" }]);
69
+ u((r) => [...r, l]), A(""), _(!0), u((r) => [...r, { role: "assistant", content: "" }]);
70
70
  try {
71
- const s = await fetch(`${P}/v1/assistant/ask`, {
71
+ const r = await fetch(`${R}/v1/assistant/ask`, {
72
72
  method: "POST",
73
73
  headers: { "Content-Type": "application/json" },
74
74
  body: JSON.stringify({
75
75
  question: e,
76
- brandSlug: R,
77
- productSlug: j,
78
- history: r
76
+ brandSlug: j,
77
+ productSlug: I,
78
+ history: s
79
79
  })
80
80
  });
81
- if (!s.ok) {
82
- const p = await s.json().catch(() => ({}));
81
+ if (!r.ok) {
82
+ const p = await r.json().catch(() => ({}));
83
83
  throw new Error(
84
- ((l = p == null ? void 0 : p.error) == null ? void 0 : l.message) || `Request failed (${s.status})`
84
+ ((o = p == null ? void 0 : p.error) == null ? void 0 : o.message) || `Request failed (${r.status})`
85
85
  );
86
86
  }
87
- if (!s.body) throw new Error("No response body");
88
- const o = s.body.getReader(), i = new TextDecoder();
89
- let g = "", C = "";
87
+ if (!r.body) throw new Error("No response body");
88
+ const n = r.body.getReader(), i = new TextDecoder();
89
+ let f = "", C = "";
90
90
  for (; ; ) {
91
- const { done: p, value: Z } = await o.read();
91
+ const { done: p, value: X } = await n.read();
92
92
  if (p) break;
93
- g += i.decode(Z, { stream: !0 });
94
- const K = g.split(`
93
+ f += i.decode(X, { stream: !0 });
94
+ const G = f.split(`
95
95
  `);
96
- g = K.pop() || "";
97
- for (const b of K)
96
+ f = G.pop() || "";
97
+ for (const b of G)
98
98
  if (b.trim() !== "") {
99
99
  if (b.trimStart().startsWith("event:"))
100
100
  C = b.trimStart().slice(6).trim();
101
101
  else if (b.trimStart().startsWith("data:") && C) {
102
- const L = b.trimStart().slice(5), Q = L.startsWith(" ") ? L.slice(1) : L;
103
- F(C, Q);
102
+ const P = b.trimStart().slice(5), Y = P.startsWith(" ") ? P.slice(1) : P;
103
+ q(C, Y);
104
104
  }
105
105
  }
106
106
  }
107
- } catch (s) {
108
- h(s.message || "Something went wrong"), m((o) => {
109
- const i = o[o.length - 1];
110
- return (i == null ? void 0 : i.role) === "assistant" && !i.content ? o.slice(0, -1) : o;
107
+ } catch (r) {
108
+ h(r.message || "Something went wrong"), u((n) => {
109
+ const i = n[n.length - 1];
110
+ return (i == null ? void 0 : i.role) === "assistant" && !i.content ? n.slice(0, -1) : n;
111
111
  });
112
112
  } finally {
113
- H(!1);
113
+ _(!1);
114
114
  }
115
115
  },
116
- [P, R, j, F]
116
+ [R, j, I, q]
117
117
  );
118
- S.current = T, x(() => {
118
+ v.current = T, S(() => {
119
119
  if (a)
120
- W(!0), requestAnimationFrame(() => {
120
+ H(!0), requestAnimationFrame(() => {
121
121
  requestAnimationFrame(() => {
122
- M(!0);
122
+ W(!0);
123
123
  });
124
124
  });
125
125
  else {
126
- M(!1);
126
+ W(!1);
127
127
  const e = setTimeout(() => {
128
- W(!1), m([]), E(""), h(null), A.current = !1;
128
+ H(!1), u([]), A(""), h(null), E.current = !1;
129
129
  }, 300);
130
130
  return () => clearTimeout(e);
131
131
  }
132
- }, [a]), x(() => {
133
- a && v && !A.current && (A.current = !0, v.trim() ? setTimeout(() => {
132
+ }, [a]), S(() => {
133
+ a && w && !E.current && (E.current = !0, w.trim() ? setTimeout(() => {
134
134
  var e;
135
- return (e = S.current) == null ? void 0 : e.call(S, v);
135
+ return (e = v.current) == null ? void 0 : e.call(v, w);
136
136
  }, 100) : setTimeout(() => {
137
137
  var e;
138
- return (e = J.current) == null ? void 0 : e.focus();
138
+ return (e = D.current) == null ? void 0 : e.focus();
139
139
  }, 350));
140
- }, [a, v]), x(() => {
140
+ }, [a, w]), S(() => {
141
141
  var e;
142
- (e = D.current) == null || e.scrollIntoView({ behavior: "smooth" });
143
- }, [u]), x(() => {
144
- const e = (n) => {
145
- n.key === "Escape" && a && w();
142
+ (e = U.current) == null || e.scrollIntoView({ behavior: "smooth" });
143
+ }, [d]), S(() => {
144
+ const e = (l) => {
145
+ l.key === "Escape" && a && y();
146
146
  };
147
147
  if (a)
148
148
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
149
- }, [a, w]), x(() => {
150
- const e = typeof window < "u" ? window.visualViewport : null;
151
- if (!e || !a) return;
152
- const n = () => {
153
- const r = window.innerHeight - e.height;
154
- z(r > 50 ? r : 0);
155
- };
156
- return e.addEventListener("resize", n), e.addEventListener("scroll", n), () => {
157
- e.removeEventListener("resize", n), e.removeEventListener("scroll", n), z(0);
158
- };
159
- }, [a]);
160
- const Y = (e) => {
149
+ }, [a, y]);
150
+ const V = (e) => {
161
151
  e.preventDefault(), N.trim() && T(N.trim());
162
152
  };
163
- if (!O) return null;
164
- const G = /* @__PURE__ */ c(
153
+ if (!K) return null;
154
+ const F = /* @__PURE__ */ c(
165
155
  "div",
166
156
  {
167
157
  className: k(
168
158
  "fixed inset-0 z-50 transition-opacity duration-300",
169
- _ ? "opacity-100" : "opacity-0"
159
+ M ? "opacity-100" : "opacity-0"
170
160
  ),
171
161
  children: [
172
162
  /* @__PURE__ */ t(
173
163
  "div",
174
164
  {
175
165
  className: "absolute inset-0 bg-black/40 backdrop-blur-sm",
176
- onClick: w
166
+ onClick: y
177
167
  }
178
168
  ),
179
169
  /* @__PURE__ */ c(
@@ -186,94 +176,93 @@ function be({
186
176
  // Desktop: left side drawer
187
177
  "sm:inset-y-0 sm:left-0 sm:right-auto sm:w-[420px] sm:max-w-full sm:rounded-t-none sm:rounded-r-2xl",
188
178
  // Animation
189
- _ ? "translate-y-0 sm:translate-x-0" : "translate-y-full sm:translate-y-0 sm:-translate-x-full",
190
- B
179
+ M ? "translate-y-0 sm:translate-x-0" : "translate-y-full sm:translate-y-0 sm:-translate-x-full",
180
+ z
191
181
  ),
192
- style: U > 0 ? { bottom: `${U}px` } : void 0,
193
182
  children: [
194
183
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-gray-200 px-4 py-3 flex-shrink-0", children: [
195
184
  /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
196
- /* @__PURE__ */ t(te, { className: "h-5 w-5 text-orange-500" }),
197
- /* @__PURE__ */ t("span", { className: "font-semibold text-gray-900", children: I }),
185
+ /* @__PURE__ */ t(Q, { className: "h-5 w-5 text-orange-500" }),
186
+ /* @__PURE__ */ t("span", { className: "font-semibold text-gray-900", children: L }),
198
187
  /* @__PURE__ */ t("span", { className: "text-xs text-gray-400 bg-gray-100 rounded px-1.5 py-0.5", children: "beta" })
199
188
  ] }),
200
189
  /* @__PURE__ */ t(
201
190
  "button",
202
191
  {
203
192
  type: "button",
204
- onClick: w,
193
+ onClick: y,
205
194
  className: "p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",
206
195
  "aria-label": "Close",
207
- children: /* @__PURE__ */ t(re, { className: "h-5 w-5" })
196
+ children: /* @__PURE__ */ t(ee, { className: "h-5 w-5" })
208
197
  }
209
198
  )
210
199
  ] }),
211
200
  /* @__PURE__ */ c("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 min-h-0", children: [
212
- u.length === 0 && !f && /* @__PURE__ */ t("div", { className: "text-center text-gray-400 text-sm py-8", children: "Ask me anything about our products!" }),
213
- u.map((e, n) => /* @__PURE__ */ t("div", { children: e.role === "user" ? /* @__PURE__ */ t("div", { className: "flex justify-end", children: /* @__PURE__ */ t("div", { className: "bg-gray-800 text-white rounded-2xl rounded-br-sm px-4 py-2 max-w-[80%] text-sm", children: e.content }) }) : /* @__PURE__ */ c("div", { className: "space-y-3", children: [
201
+ d.length === 0 && !m && /* @__PURE__ */ t("div", { className: "text-center text-gray-400 text-sm py-8", children: "Ask me anything about our products!" }),
202
+ d.map((e, l) => /* @__PURE__ */ t("div", { children: e.role === "user" ? /* @__PURE__ */ t("div", { className: "flex justify-end", children: /* @__PURE__ */ t("div", { className: "bg-gray-800 text-white rounded-2xl rounded-br-sm px-4 py-2 max-w-[80%] text-sm", children: e.content }) }) : /* @__PURE__ */ c("div", { className: "space-y-3", children: [
214
203
  /* @__PURE__ */ c("div", { className: "text-sm text-gray-800 leading-relaxed", children: [
215
- /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: ce(e.content) } }),
216
- f && n === u.length - 1 && /* @__PURE__ */ t("span", { className: "inline-block w-1.5 h-4 bg-gray-400 animate-pulse ml-0.5 align-text-bottom" })
204
+ /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: le(e.content) } }),
205
+ m && l === d.length - 1 && /* @__PURE__ */ t("span", { className: "inline-block w-1.5 h-4 bg-gray-400 animate-pulse ml-0.5 align-text-bottom" })
217
206
  ] }),
218
- e.products && e.products.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.products.map((r) => /* @__PURE__ */ c(
207
+ e.products && e.products.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.products.map((s) => /* @__PURE__ */ c(
219
208
  "a",
220
209
  {
221
- href: `/product/${r.slug}`,
210
+ href: `/product/${s.slug}`,
222
211
  className: "flex items-center gap-3 w-full rounded-xl border border-gray-200 p-2 hover:bg-gray-50 transition-colors text-left no-underline",
223
212
  children: [
224
- r.thumbnailUrl ? /* @__PURE__ */ t(
213
+ s.thumbnailUrl ? /* @__PURE__ */ t(
225
214
  "img",
226
215
  {
227
- src: r.thumbnailUrl,
228
- alt: r.name,
216
+ src: s.thumbnailUrl,
217
+ alt: s.name,
229
218
  className: "h-16 w-16 rounded-lg object-cover flex-shrink-0"
230
219
  }
231
220
  ) : /* @__PURE__ */ t("div", { className: "h-16 w-16 rounded-lg bg-gray-100 flex-shrink-0" }),
232
221
  /* @__PURE__ */ c("div", { className: "min-w-0", children: [
233
- /* @__PURE__ */ t("p", { className: "text-sm font-medium text-gray-900 line-clamp-2", children: r.name }),
234
- /* @__PURE__ */ t("p", { className: "text-sm font-semibold text-blue-600", children: oe(r.price) })
222
+ /* @__PURE__ */ t("p", { className: "text-sm font-medium text-gray-900 line-clamp-2", children: s.name }),
223
+ /* @__PURE__ */ t("p", { className: "text-sm font-semibold text-blue-600", children: ne(s.price) })
235
224
  ] })
236
225
  ]
237
226
  },
238
- r.slug
227
+ s.slug
239
228
  )) }),
240
229
  e.whatsapp && /* @__PURE__ */ c(
241
230
  "a",
242
231
  {
243
- href: le,
232
+ href: ae,
244
233
  target: "_blank",
245
234
  rel: "noopener noreferrer",
246
235
  className: "inline-flex items-center gap-2 rounded-full bg-green-500 px-4 py-2 text-sm font-medium text-white hover:bg-green-600 transition-colors no-underline",
247
236
  children: [
248
- /* @__PURE__ */ t(se, { className: "h-4 w-4" }),
237
+ /* @__PURE__ */ t(te, { className: "h-4 w-4" }),
249
238
  "Chat on WhatsApp"
250
239
  ]
251
240
  }
252
241
  ),
253
- e.suggestions && e.suggestions.length > 0 && !f && n === u.length - 1 && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.suggestions.map((r, l) => /* @__PURE__ */ t(
242
+ e.suggestions && e.suggestions.length > 0 && !m && l === d.length - 1 && /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: e.suggestions.map((s, o) => /* @__PURE__ */ t(
254
243
  "button",
255
244
  {
256
245
  type: "button",
257
- onClick: () => T(r),
246
+ onClick: () => T(s),
258
247
  className: "rounded-full border border-gray-200 bg-gray-50 px-3 py-1.5 text-xs text-gray-700 hover:bg-gray-100 hover:border-gray-300 transition-colors text-left",
259
- children: r
248
+ children: s
260
249
  },
261
- l
250
+ o
262
251
  )) })
263
- ] }) }, n)),
252
+ ] }) }, l)),
264
253
  $ && /* @__PURE__ */ t("div", { className: "rounded-lg bg-red-50 border border-red-200 p-3 text-sm text-red-700", children: $ }),
265
- /* @__PURE__ */ t("div", { ref: D })
254
+ /* @__PURE__ */ t("div", { ref: U })
266
255
  ] }),
267
- /* @__PURE__ */ t("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ c("form", { onSubmit: Y, className: "flex items-center gap-2", children: [
256
+ /* @__PURE__ */ t("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ c("form", { onSubmit: V, className: "flex items-center gap-2", children: [
268
257
  /* @__PURE__ */ t(
269
258
  "input",
270
259
  {
271
- ref: J,
260
+ ref: D,
272
261
  type: "text",
273
262
  value: N,
274
- onChange: (e) => E(e.target.value),
275
- placeholder: `Ask ${I} a question`,
276
- disabled: f,
263
+ onChange: (e) => A(e.target.value),
264
+ placeholder: `Ask ${L} a question`,
265
+ disabled: m,
277
266
  className: k(
278
267
  "flex-1 rounded-full border border-gray-300 px-4 py-2.5 text-base",
279
268
  "focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-400/30",
@@ -285,14 +274,14 @@ function be({
285
274
  "button",
286
275
  {
287
276
  type: "submit",
288
- disabled: !N.trim() || f,
277
+ disabled: !N.trim() || m,
289
278
  className: k(
290
279
  "flex h-10 w-10 items-center justify-center rounded-full",
291
280
  "bg-gray-800 text-white",
292
281
  "hover:bg-gray-700 transition-colors",
293
282
  "disabled:opacity-40 disabled:cursor-not-allowed"
294
283
  ),
295
- children: f ? /* @__PURE__ */ t(ne, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ t(ae, { className: "h-4 w-4" })
284
+ children: m ? /* @__PURE__ */ t(re, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ t(se, { className: "h-4 w-4" })
296
285
  }
297
286
  )
298
287
  ] }) })
@@ -302,8 +291,8 @@ function be({
302
291
  ]
303
292
  }
304
293
  );
305
- return X ? G : ee(G, document.body);
294
+ return B ? F : Z(F, document.body);
306
295
  }
307
296
  export {
308
- be as AssistantDrawer
297
+ he as AssistantDrawer
309
298
  };
package/dist/index224.mjs CHANGED
@@ -1,34 +1,16 @@
1
1
  'use client';
2
- import p from "./index106.mjs";
3
- function i(n) {
4
- const t = {
5
- "!": "%21",
6
- "'": "%27",
7
- "(": "%28",
8
- ")": "%29",
9
- "~": "%7E",
10
- "%20": "+",
11
- "%00": "\0"
12
- };
13
- return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g, function(r) {
14
- return t[r];
15
- });
16
- }
17
- function a(n, t) {
18
- this._pairs = [], n && p(n, this, t);
19
- }
20
- const c = a.prototype;
21
- c.append = function(t, o) {
22
- this._pairs.push([t, o]);
23
- };
24
- c.toString = function(t) {
25
- const o = t ? function(r) {
26
- return t.call(this, r, i);
27
- } : i;
28
- return this._pairs.map(function(e) {
29
- return o(e[0]) + "=" + o(e[1]);
30
- }, "").join("&");
2
+ import o from "./index277.mjs";
3
+ import r from "./index278.mjs";
4
+ import t from "./index279.mjs";
5
+ const l = {
6
+ isBrowser: !0,
7
+ classes: {
8
+ URLSearchParams: o,
9
+ FormData: r,
10
+ Blob: t
11
+ },
12
+ protocols: ["http", "https", "file", "blob", "url", "data"]
31
13
  };
32
14
  export {
33
- a as default
15
+ l as default
34
16
  };
package/dist/index225.mjs CHANGED
@@ -1,14 +1,10 @@
1
1
  'use client';
2
- import i from "./index96.mjs";
3
- import m from "./index100.mjs";
4
- import s from "./index110.mjs";
5
- function h(f, t) {
6
- const o = this || m, r = t || o, n = s.from(r.headers);
7
- let a = r.data;
8
- return i.forEach(f, function(e) {
9
- a = e.call(o, a, n.normalize(), t ? t.status : void 0);
10
- }), n.normalize(), a;
11
- }
2
+ const e = typeof window < "u" && typeof document < "u", o = typeof navigator == "object" && navigator || void 0, n = e && (!o || ["ReactNative", "NativeScript", "NS"].indexOf(o.product) < 0), t = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
3
+ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", r = e && window.location.href || "http://localhost";
12
4
  export {
13
- h as default
5
+ e as hasBrowserEnv,
6
+ n as hasStandardBrowserEnv,
7
+ t as hasStandardBrowserWebWorkerEnv,
8
+ o as navigator,
9
+ r as origin
14
10
  };
package/dist/index226.mjs CHANGED
@@ -1,7 +1,34 @@
1
1
  'use client';
2
- function e(t) {
3
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
2
+ import p from "./index106.mjs";
3
+ function i(n) {
4
+ const t = {
5
+ "!": "%21",
6
+ "'": "%27",
7
+ "(": "%28",
8
+ ")": "%29",
9
+ "~": "%7E",
10
+ "%20": "+",
11
+ "%00": "\0"
12
+ };
13
+ return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g, function(r) {
14
+ return t[r];
15
+ });
4
16
  }
17
+ function a(n, t) {
18
+ this._pairs = [], n && p(n, this, t);
19
+ }
20
+ const c = a.prototype;
21
+ c.append = function(t, o) {
22
+ this._pairs.push([t, o]);
23
+ };
24
+ c.toString = function(t) {
25
+ const o = t ? function(r) {
26
+ return t.call(this, r, i);
27
+ } : i;
28
+ return this._pairs.map(function(e) {
29
+ return o(e[0]) + "=" + o(e[1]);
30
+ }, "").join("&");
31
+ };
5
32
  export {
6
- e as default
33
+ a as default
7
34
  };
package/dist/index227.mjs CHANGED
@@ -1,7 +1,14 @@
1
1
  'use client';
2
- function n(e, c) {
3
- return c ? e.replace(/\/?\/$/, "") + "/" + c.replace(/^\/+/, "") : e;
2
+ import i from "./index96.mjs";
3
+ import m from "./index100.mjs";
4
+ import s from "./index110.mjs";
5
+ function h(f, t) {
6
+ const o = this || m, r = t || o, n = s.from(r.headers);
7
+ let a = r.data;
8
+ return i.forEach(f, function(e) {
9
+ a = e.call(o, a, n.normalize(), t ? t.status : void 0);
10
+ }), n.normalize(), a;
4
11
  }
5
12
  export {
6
- n as default
13
+ h as default
7
14
  };
package/dist/index228.mjs CHANGED
@@ -1,16 +1,7 @@
1
1
  'use client';
2
- import o from "./index276.mjs";
3
- import r from "./index277.mjs";
4
- import t from "./index278.mjs";
5
- const l = {
6
- isBrowser: !0,
7
- classes: {
8
- URLSearchParams: o,
9
- FormData: r,
10
- Blob: t
11
- },
12
- protocols: ["http", "https", "file", "blob", "url", "data"]
13
- };
2
+ function e(t) {
3
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
4
+ }
14
5
  export {
15
- l as default
6
+ e as default
16
7
  };
package/dist/index229.mjs CHANGED
@@ -1,10 +1,7 @@
1
1
  'use client';
2
- const e = typeof window < "u" && typeof document < "u", o = typeof navigator == "object" && navigator || void 0, n = e && (!o || ["ReactNative", "NativeScript", "NS"].indexOf(o.product) < 0), t = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
3
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", r = e && window.location.href || "http://localhost";
2
+ function n(e, c) {
3
+ return c ? e.replace(/\/?\/$/, "") + "/" + c.replace(/^\/+/, "") : e;
4
+ }
4
5
  export {
5
- e as hasBrowserEnv,
6
- n as hasStandardBrowserEnv,
7
- t as hasStandardBrowserWebWorkerEnv,
8
- o as navigator,
9
- r as origin
6
+ n as default
10
7
  };
package/dist/index232.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import i from "./index279.mjs";
3
- import m from "./index280.mjs";
2
+ import i from "./index280.mjs";
3
+ import m from "./index281.mjs";
4
4
  import f from "./index96.mjs";
5
5
  const h = (t, o, a = 3) => {
6
6
  let r = 0;
package/dist/index233.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import n from "./index160.mjs";
3
3
  import m from "./index96.mjs";
4
- import c from "./index281.mjs";
5
- import h from "./index282.mjs";
4
+ import c from "./index282.mjs";
5
+ import h from "./index283.mjs";
6
6
  import w from "./index156.mjs";
7
7
  import b from "./index99.mjs";
8
8
  import C from "./index110.mjs";
package/dist/index236.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- var e = {};
2
+ var t = {};
3
3
  export {
4
- e as __exports
4
+ t as __exports
5
5
  };
package/dist/index237.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- var r = { exports: {} };
2
+ var e = { exports: {} };
3
3
  export {
4
- r as __module
4
+ e as __module
5
5
  };
package/dist/index239.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- var t = {};
2
+ var e = {};
3
3
  export {
4
- t as __exports
4
+ e as __exports
5
5
  };