@instockng/storefront-ui 1.0.117 → 1.0.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AssistantDrawer.d.ts.map +1 -1
- package/dist/index100.mjs +86 -4
- package/dist/index101.mjs +26 -176
- package/dist/index102.mjs +8 -52
- package/dist/index103.mjs +75 -69
- package/dist/index104.mjs +4 -37
- package/dist/index105.mjs +2 -43
- package/dist/index106.mjs +83 -2
- package/dist/index107.mjs +52 -4
- package/dist/index108.mjs +5 -1133
- package/dist/index109.mjs +4 -19
- package/dist/index110.mjs +171 -47
- package/dist/index111.mjs +52 -32
- package/dist/index112.mjs +69 -2
- package/dist/index117.mjs +2 -2
- package/dist/index118.mjs +2 -2
- package/dist/index153.mjs +1 -1
- package/dist/index154.mjs +1 -1
- package/dist/index155.mjs +5 -5
- package/dist/index157.mjs +2 -2
- package/dist/index159.mjs +2 -2
- package/dist/index161.mjs +1 -1
- package/dist/index163.mjs +4 -4
- package/dist/index164.mjs +3 -3
- package/dist/index169.mjs +1 -1
- package/dist/index170.mjs +1 -1
- package/dist/index172.mjs +1 -1
- package/dist/index173.mjs +1 -1
- package/dist/index175.mjs +3 -3
- package/dist/index176.mjs +1 -1
- package/dist/index178.mjs +2 -2
- package/dist/index179.mjs +1 -1
- package/dist/index184.mjs +2 -2
- package/dist/index186.mjs +1 -1
- package/dist/index192.mjs +1 -1
- package/dist/index195.mjs +1 -1
- package/dist/index203.mjs +1 -1
- package/dist/index205.mjs +1 -1
- package/dist/index22.mjs +133 -122
- package/dist/index220.mjs +2 -2
- package/dist/index222.mjs +1 -1
- package/dist/index223.mjs +1 -1
- package/dist/index224.mjs +1 -1
- package/dist/index225.mjs +3 -3
- package/dist/index228.mjs +3 -3
- package/dist/index230.mjs +1 -1
- package/dist/index232.mjs +3 -3
- package/dist/index233.mjs +5 -5
- package/dist/index234.mjs +3 -3
- package/dist/index236.mjs +2 -2
- package/dist/index237.mjs +2 -2
- package/dist/index239.mjs +2 -2
- package/dist/index240.mjs +2 -2
- package/dist/index242.mjs +2 -37
- package/dist/index244.mjs +2 -108
- package/dist/index245.mjs +108 -2
- package/dist/index246.mjs +2 -2
- package/dist/index247.mjs +2 -2
- package/dist/index248.mjs +37 -2
- package/dist/index250.mjs +1 -1
- package/dist/index252.mjs +1 -1
- package/dist/index253.mjs +1 -1
- package/dist/index254.mjs +2 -2
- package/dist/index263.mjs +2 -2
- package/dist/index264.mjs +4 -2
- package/dist/index265.mjs +2 -2
- package/dist/index266.mjs +2 -4
- package/dist/index267.mjs +2 -3
- package/dist/index268.mjs +2 -2
- package/dist/index269.mjs +18 -2
- package/dist/index270.mjs +46 -16
- package/dist/index271.mjs +2 -13
- package/dist/index272.mjs +2 -6
- package/dist/index273.mjs +2 -30
- package/dist/index274.mjs +2 -2
- package/dist/index275.mjs +89 -16
- package/dist/index276.mjs +3 -47
- package/dist/index277.mjs +2 -2
- package/dist/index278.mjs +2 -2
- package/dist/index279.mjs +17 -2
- package/dist/index280.mjs +13 -2
- package/dist/index281.mjs +6 -2
- package/dist/index282.mjs +30 -91
- package/dist/index43.mjs +1 -1
- package/dist/index44.mjs +1 -1
- package/dist/index45.mjs +1 -1
- package/dist/index46.mjs +1 -1
- package/dist/index47.mjs +1 -1
- package/dist/index48.mjs +2 -2
- package/dist/index50.mjs +2 -2
- package/dist/index54.mjs +3 -3
- package/dist/index58.mjs +1 -1
- package/dist/index63.mjs +17 -17
- package/dist/index64.mjs +2 -2
- package/dist/index65.mjs +1 -1
- package/dist/index66.mjs +1 -1
- package/dist/index67.mjs +1 -1
- package/dist/index68.mjs +1 -1
- package/dist/index69.mjs +1 -1
- package/dist/index70.mjs +1 -1
- package/dist/index71.mjs +1 -1
- package/dist/index72.mjs +1 -1
- package/dist/index73.mjs +1 -1
- package/dist/index74.mjs +1 -1
- package/dist/index75.mjs +1 -1
- package/dist/index76.mjs +1 -1
- package/dist/index77.mjs +1 -1
- package/dist/index78.mjs +1 -1
- package/dist/index79.mjs +23 -4
- package/dist/index80.mjs +2 -23
- package/dist/index81.mjs +21 -73
- package/dist/index82.mjs +153 -15
- package/dist/index83.mjs +4 -62
- package/dist/index84.mjs +71 -20
- package/dist/index85.mjs +15 -153
- package/dist/index86.mjs +63 -2
- package/dist/index87.mjs +2 -235
- package/dist/index88.mjs +5 -5
- package/dist/index89.mjs +1125 -125
- package/dist/index90.mjs +19 -67
- package/dist/index91.mjs +50 -82
- package/dist/index92.mjs +32 -28
- package/dist/index93.mjs +2 -9
- package/dist/index94.mjs +33 -71
- package/dist/index95.mjs +42 -3
- package/dist/index96.mjs +235 -2
- package/dist/index97.mjs +5 -82
- package/dist/index98.mjs +130 -50
- package/dist/index99.mjs +66 -4
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/src/components/AssistantDrawer.tsx +21 -0
package/dist/index203.mjs
CHANGED
package/dist/index205.mjs
CHANGED
package/dist/index22.mjs
CHANGED
|
@@ -1,169 +1,179 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { Sparkles as
|
|
6
|
-
import { cn as k, formatCurrency as
|
|
7
|
-
import { useHideBodyOverflow as
|
|
8
|
-
function
|
|
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) {
|
|
9
9
|
return a.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/\n/g, "<br />");
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function de(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
|
|
14
|
+
function be({
|
|
15
15
|
isOpen: a,
|
|
16
|
-
onClose:
|
|
17
|
-
apiUrl:
|
|
18
|
-
brandSlug:
|
|
19
|
-
productSlug:
|
|
20
|
-
initialQuestion:
|
|
21
|
-
assistantName:
|
|
22
|
-
className:
|
|
23
|
-
disablePortal:
|
|
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
|
|
24
24
|
}) {
|
|
25
|
-
const [
|
|
26
|
-
|
|
27
|
-
const
|
|
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) => {
|
|
28
28
|
if (e === "token")
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
if ((
|
|
32
|
-
const
|
|
33
|
-
|
|
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 };
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return l;
|
|
36
36
|
});
|
|
37
37
|
else if (e === "done")
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
var i,
|
|
42
|
-
const
|
|
43
|
-
return (
|
|
44
|
-
...
|
|
45
|
-
content:
|
|
46
|
-
products: ((i =
|
|
47
|
-
whatsapp:
|
|
48
|
-
suggestions: ((
|
|
49
|
-
}),
|
|
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;
|
|
50
50
|
});
|
|
51
51
|
} catch {
|
|
52
52
|
}
|
|
53
53
|
else if (e === "error")
|
|
54
54
|
try {
|
|
55
|
-
const
|
|
56
|
-
h(
|
|
55
|
+
const r = JSON.parse(n);
|
|
56
|
+
h(r.message || "An error occurred");
|
|
57
57
|
} catch {
|
|
58
58
|
h("An error occurred");
|
|
59
59
|
}
|
|
60
|
-
}, []),
|
|
60
|
+
}, []), S = y(null), T = V(
|
|
61
61
|
async (e) => {
|
|
62
|
-
var
|
|
62
|
+
var l;
|
|
63
63
|
if (!e.trim()) return;
|
|
64
64
|
h(null);
|
|
65
|
-
const
|
|
66
|
-
role:
|
|
67
|
-
content:
|
|
65
|
+
const n = { role: "user", content: e }, r = q.current.slice(-20).map((s) => ({
|
|
66
|
+
role: s.role,
|
|
67
|
+
content: s.content
|
|
68
68
|
}));
|
|
69
|
-
|
|
69
|
+
m((s) => [...s, n]), E(""), H(!0), m((s) => [...s, { role: "assistant", content: "" }]);
|
|
70
70
|
try {
|
|
71
|
-
const
|
|
71
|
+
const s = await fetch(`${P}/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:
|
|
77
|
-
productSlug:
|
|
78
|
-
history:
|
|
76
|
+
brandSlug: R,
|
|
77
|
+
productSlug: j,
|
|
78
|
+
history: r
|
|
79
79
|
})
|
|
80
80
|
});
|
|
81
|
-
if (!
|
|
82
|
-
const p = await
|
|
81
|
+
if (!s.ok) {
|
|
82
|
+
const p = await s.json().catch(() => ({}));
|
|
83
83
|
throw new Error(
|
|
84
|
-
((
|
|
84
|
+
((l = p == null ? void 0 : p.error) == null ? void 0 : l.message) || `Request failed (${s.status})`
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
|
-
if (!
|
|
88
|
-
const
|
|
89
|
-
let
|
|
87
|
+
if (!s.body) throw new Error("No response body");
|
|
88
|
+
const o = s.body.getReader(), i = new TextDecoder();
|
|
89
|
+
let g = "", C = "";
|
|
90
90
|
for (; ; ) {
|
|
91
|
-
const { done: p, value:
|
|
91
|
+
const { done: p, value: Z } = await o.read();
|
|
92
92
|
if (p) break;
|
|
93
|
-
|
|
94
|
-
const
|
|
93
|
+
g += i.decode(Z, { stream: !0 });
|
|
94
|
+
const K = g.split(`
|
|
95
95
|
`);
|
|
96
|
-
|
|
97
|
-
for (const b of
|
|
96
|
+
g = K.pop() || "";
|
|
97
|
+
for (const b of K)
|
|
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
|
|
103
|
-
|
|
102
|
+
const L = b.trimStart().slice(5), Q = L.startsWith(" ") ? L.slice(1) : L;
|
|
103
|
+
F(C, Q);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
} catch (
|
|
108
|
-
h(
|
|
109
|
-
const i =
|
|
110
|
-
return (i == null ? void 0 : i.role) === "assistant" && !i.content ?
|
|
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;
|
|
111
111
|
});
|
|
112
112
|
} finally {
|
|
113
|
-
|
|
113
|
+
H(!1);
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
[R, j,
|
|
116
|
+
[P, R, j, F]
|
|
117
117
|
);
|
|
118
|
-
|
|
118
|
+
S.current = T, x(() => {
|
|
119
119
|
if (a)
|
|
120
|
-
|
|
120
|
+
W(!0), requestAnimationFrame(() => {
|
|
121
121
|
requestAnimationFrame(() => {
|
|
122
|
-
|
|
122
|
+
M(!0);
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
else {
|
|
126
|
-
|
|
126
|
+
M(!1);
|
|
127
127
|
const e = setTimeout(() => {
|
|
128
|
-
|
|
128
|
+
W(!1), m([]), E(""), h(null), A.current = !1;
|
|
129
129
|
}, 300);
|
|
130
130
|
return () => clearTimeout(e);
|
|
131
131
|
}
|
|
132
|
-
}, [a]),
|
|
133
|
-
a &&
|
|
132
|
+
}, [a]), x(() => {
|
|
133
|
+
a && v && !A.current && (A.current = !0, v.trim() ? setTimeout(() => {
|
|
134
134
|
var e;
|
|
135
|
-
return (e =
|
|
135
|
+
return (e = S.current) == null ? void 0 : e.call(S, v);
|
|
136
136
|
}, 100) : setTimeout(() => {
|
|
137
137
|
var e;
|
|
138
|
-
return (e =
|
|
138
|
+
return (e = J.current) == null ? void 0 : e.focus();
|
|
139
139
|
}, 350));
|
|
140
|
-
}, [a,
|
|
140
|
+
}, [a, v]), x(() => {
|
|
141
141
|
var e;
|
|
142
|
-
(e =
|
|
143
|
-
}, [
|
|
144
|
-
const e = (
|
|
145
|
-
|
|
142
|
+
(e = D.current) == null || e.scrollIntoView({ behavior: "smooth" });
|
|
143
|
+
}, [u]), x(() => {
|
|
144
|
+
const e = (n) => {
|
|
145
|
+
n.key === "Escape" && a && w();
|
|
146
146
|
};
|
|
147
147
|
if (a)
|
|
148
148
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
149
|
-
}, [a,
|
|
150
|
-
|
|
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) => {
|
|
151
161
|
e.preventDefault(), N.trim() && T(N.trim());
|
|
152
162
|
};
|
|
153
|
-
if (!
|
|
154
|
-
const
|
|
163
|
+
if (!O) return null;
|
|
164
|
+
const G = /* @__PURE__ */ c(
|
|
155
165
|
"div",
|
|
156
166
|
{
|
|
157
167
|
className: k(
|
|
158
168
|
"fixed inset-0 z-50 transition-opacity duration-300",
|
|
159
|
-
|
|
169
|
+
_ ? "opacity-100" : "opacity-0"
|
|
160
170
|
),
|
|
161
171
|
children: [
|
|
162
172
|
/* @__PURE__ */ t(
|
|
163
173
|
"div",
|
|
164
174
|
{
|
|
165
175
|
className: "absolute inset-0 bg-black/40 backdrop-blur-sm",
|
|
166
|
-
onClick:
|
|
176
|
+
onClick: w
|
|
167
177
|
}
|
|
168
178
|
),
|
|
169
179
|
/* @__PURE__ */ c(
|
|
@@ -176,93 +186,94 @@ function he({
|
|
|
176
186
|
// Desktop: left side drawer
|
|
177
187
|
"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",
|
|
178
188
|
// Animation
|
|
179
|
-
|
|
180
|
-
|
|
189
|
+
_ ? "translate-y-0 sm:translate-x-0" : "translate-y-full sm:translate-y-0 sm:-translate-x-full",
|
|
190
|
+
B
|
|
181
191
|
),
|
|
192
|
+
style: U > 0 ? { bottom: `${U}px` } : void 0,
|
|
182
193
|
children: [
|
|
183
194
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-gray-200 px-4 py-3 flex-shrink-0", children: [
|
|
184
195
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
|
|
185
|
-
/* @__PURE__ */ t(
|
|
186
|
-
/* @__PURE__ */ t("span", { className: "font-semibold text-gray-900", 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 }),
|
|
187
198
|
/* @__PURE__ */ t("span", { className: "text-xs text-gray-400 bg-gray-100 rounded px-1.5 py-0.5", children: "beta" })
|
|
188
199
|
] }),
|
|
189
200
|
/* @__PURE__ */ t(
|
|
190
201
|
"button",
|
|
191
202
|
{
|
|
192
203
|
type: "button",
|
|
193
|
-
onClick:
|
|
204
|
+
onClick: w,
|
|
194
205
|
className: "p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",
|
|
195
206
|
"aria-label": "Close",
|
|
196
|
-
children: /* @__PURE__ */ t(
|
|
207
|
+
children: /* @__PURE__ */ t(re, { className: "h-5 w-5" })
|
|
197
208
|
}
|
|
198
209
|
)
|
|
199
210
|
] }),
|
|
200
211
|
/* @__PURE__ */ c("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 min-h-0", children: [
|
|
201
|
-
|
|
202
|
-
|
|
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: [
|
|
203
214
|
/* @__PURE__ */ c("div", { className: "text-sm text-gray-800 leading-relaxed", children: [
|
|
204
|
-
/* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html:
|
|
205
|
-
|
|
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" })
|
|
206
217
|
] }),
|
|
207
|
-
e.products && e.products.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.products.map((
|
|
218
|
+
e.products && e.products.length > 0 && /* @__PURE__ */ t("div", { className: "space-y-2", children: e.products.map((r) => /* @__PURE__ */ c(
|
|
208
219
|
"a",
|
|
209
220
|
{
|
|
210
|
-
href: `/product/${
|
|
221
|
+
href: `/product/${r.slug}`,
|
|
211
222
|
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",
|
|
212
223
|
children: [
|
|
213
|
-
|
|
224
|
+
r.thumbnailUrl ? /* @__PURE__ */ t(
|
|
214
225
|
"img",
|
|
215
226
|
{
|
|
216
|
-
src:
|
|
217
|
-
alt:
|
|
227
|
+
src: r.thumbnailUrl,
|
|
228
|
+
alt: r.name,
|
|
218
229
|
className: "h-16 w-16 rounded-lg object-cover flex-shrink-0"
|
|
219
230
|
}
|
|
220
231
|
) : /* @__PURE__ */ t("div", { className: "h-16 w-16 rounded-lg bg-gray-100 flex-shrink-0" }),
|
|
221
232
|
/* @__PURE__ */ c("div", { className: "min-w-0", children: [
|
|
222
|
-
/* @__PURE__ */ t("p", { className: "text-sm font-medium text-gray-900 line-clamp-2", children:
|
|
223
|
-
/* @__PURE__ */ t("p", { className: "text-sm font-semibold text-blue-600", 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) })
|
|
224
235
|
] })
|
|
225
236
|
]
|
|
226
237
|
},
|
|
227
|
-
|
|
238
|
+
r.slug
|
|
228
239
|
)) }),
|
|
229
240
|
e.whatsapp && /* @__PURE__ */ c(
|
|
230
241
|
"a",
|
|
231
242
|
{
|
|
232
|
-
href:
|
|
243
|
+
href: le,
|
|
233
244
|
target: "_blank",
|
|
234
245
|
rel: "noopener noreferrer",
|
|
235
246
|
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",
|
|
236
247
|
children: [
|
|
237
|
-
/* @__PURE__ */ t(
|
|
248
|
+
/* @__PURE__ */ t(se, { className: "h-4 w-4" }),
|
|
238
249
|
"Chat on WhatsApp"
|
|
239
250
|
]
|
|
240
251
|
}
|
|
241
252
|
),
|
|
242
|
-
e.suggestions && e.suggestions.length > 0 && !
|
|
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(
|
|
243
254
|
"button",
|
|
244
255
|
{
|
|
245
256
|
type: "button",
|
|
246
|
-
onClick: () => T(
|
|
257
|
+
onClick: () => T(r),
|
|
247
258
|
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",
|
|
248
|
-
children:
|
|
259
|
+
children: r
|
|
249
260
|
},
|
|
250
|
-
|
|
261
|
+
l
|
|
251
262
|
)) })
|
|
252
|
-
] }) },
|
|
263
|
+
] }) }, n)),
|
|
253
264
|
$ && /* @__PURE__ */ t("div", { className: "rounded-lg bg-red-50 border border-red-200 p-3 text-sm text-red-700", children: $ }),
|
|
254
|
-
/* @__PURE__ */ t("div", { ref:
|
|
265
|
+
/* @__PURE__ */ t("div", { ref: D })
|
|
255
266
|
] }),
|
|
256
|
-
/* @__PURE__ */ t("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ c("form", { onSubmit:
|
|
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: [
|
|
257
268
|
/* @__PURE__ */ t(
|
|
258
269
|
"input",
|
|
259
270
|
{
|
|
260
|
-
ref:
|
|
271
|
+
ref: J,
|
|
261
272
|
type: "text",
|
|
262
273
|
value: N,
|
|
263
|
-
onChange: (e) =>
|
|
264
|
-
placeholder: `Ask ${
|
|
265
|
-
disabled:
|
|
274
|
+
onChange: (e) => E(e.target.value),
|
|
275
|
+
placeholder: `Ask ${I} a question`,
|
|
276
|
+
disabled: f,
|
|
266
277
|
className: k(
|
|
267
278
|
"flex-1 rounded-full border border-gray-300 px-4 py-2.5 text-base",
|
|
268
279
|
"focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-400/30",
|
|
@@ -274,14 +285,14 @@ function he({
|
|
|
274
285
|
"button",
|
|
275
286
|
{
|
|
276
287
|
type: "submit",
|
|
277
|
-
disabled: !N.trim() ||
|
|
288
|
+
disabled: !N.trim() || f,
|
|
278
289
|
className: k(
|
|
279
290
|
"flex h-10 w-10 items-center justify-center rounded-full",
|
|
280
291
|
"bg-gray-800 text-white",
|
|
281
292
|
"hover:bg-gray-700 transition-colors",
|
|
282
293
|
"disabled:opacity-40 disabled:cursor-not-allowed"
|
|
283
294
|
),
|
|
284
|
-
children:
|
|
295
|
+
children: f ? /* @__PURE__ */ t(ne, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ t(ae, { className: "h-4 w-4" })
|
|
285
296
|
}
|
|
286
297
|
)
|
|
287
298
|
] }) })
|
|
@@ -291,8 +302,8 @@ function he({
|
|
|
291
302
|
]
|
|
292
303
|
}
|
|
293
304
|
);
|
|
294
|
-
return
|
|
305
|
+
return X ? G : ee(G, document.body);
|
|
295
306
|
}
|
|
296
307
|
export {
|
|
297
|
-
|
|
308
|
+
be as AssistantDrawer
|
|
298
309
|
};
|
package/dist/index220.mjs
CHANGED
package/dist/index222.mjs
CHANGED
package/dist/index223.mjs
CHANGED
package/dist/index224.mjs
CHANGED
package/dist/index225.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import i from "./
|
|
3
|
-
import m from "./
|
|
4
|
-
import s from "./
|
|
2
|
+
import i from "./index96.mjs";
|
|
3
|
+
import m from "./index100.mjs";
|
|
4
|
+
import s from "./index110.mjs";
|
|
5
5
|
function h(f, t) {
|
|
6
6
|
const o = this || m, r = t || o, n = s.from(r.headers);
|
|
7
7
|
let a = r.data;
|
package/dist/index228.mjs
CHANGED
package/dist/index230.mjs
CHANGED
package/dist/index232.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import i from "./
|
|
3
|
-
import m from "./
|
|
4
|
-
import f from "./
|
|
2
|
+
import i from "./index279.mjs";
|
|
3
|
+
import m from "./index280.mjs";
|
|
4
|
+
import f from "./index96.mjs";
|
|
5
5
|
const h = (t, o, a = 3) => {
|
|
6
6
|
let r = 0;
|
|
7
7
|
const c = i(50, 250);
|
package/dist/index233.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import n from "./index160.mjs";
|
|
3
|
-
import m from "./
|
|
4
|
-
import c from "./
|
|
5
|
-
import h from "./
|
|
3
|
+
import m from "./index96.mjs";
|
|
4
|
+
import c from "./index281.mjs";
|
|
5
|
+
import h from "./index282.mjs";
|
|
6
6
|
import w from "./index156.mjs";
|
|
7
|
-
import b from "./
|
|
8
|
-
import C from "./
|
|
7
|
+
import b from "./index99.mjs";
|
|
8
|
+
import C from "./index110.mjs";
|
|
9
9
|
import g from "./index153.mjs";
|
|
10
10
|
const E = (a) => {
|
|
11
11
|
const e = b({}, a);
|
package/dist/index234.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import a from "./
|
|
3
|
-
import s from "./
|
|
4
|
-
import m from "./
|
|
2
|
+
import a from "./index102.mjs";
|
|
3
|
+
import s from "./index107.mjs";
|
|
4
|
+
import m from "./index96.mjs";
|
|
5
5
|
const h = (e, t) => {
|
|
6
6
|
const { length: l } = e = e ? e.filter(Boolean) : [];
|
|
7
7
|
if (t || l) {
|
package/dist/index236.mjs
CHANGED
package/dist/index237.mjs
CHANGED
package/dist/index239.mjs
CHANGED
package/dist/index240.mjs
CHANGED
package/dist/index242.mjs
CHANGED
|
@@ -1,40 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import { __require as l } from "./index275.mjs";
|
|
4
|
-
import { __require as d } from "./index276.mjs";
|
|
5
|
-
var t;
|
|
6
|
-
function R() {
|
|
7
|
-
return t ? n : (t = 1, function(i) {
|
|
8
|
-
Object.defineProperty(i, "__esModule", {
|
|
9
|
-
value: !0
|
|
10
|
-
});
|
|
11
|
-
function o(u, e) {
|
|
12
|
-
for (var r in e) Object.defineProperty(u, r, {
|
|
13
|
-
enumerable: !0,
|
|
14
|
-
get: e[r]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
o(i, {
|
|
18
|
-
normalizeAppPath: function() {
|
|
19
|
-
return a;
|
|
20
|
-
},
|
|
21
|
-
normalizeRscURL: function() {
|
|
22
|
-
return p;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const s = l(), f = d();
|
|
26
|
-
function a(u) {
|
|
27
|
-
return (0, s.ensureLeadingSlash)(u.split("/").reduce((e, r, c, _) => !r || (0, f.isGroupSegment)(r) || r[0] === "@" || (r === "page" || r === "route") && c === _.length - 1 ? e : e + "/" + r, ""));
|
|
28
|
-
}
|
|
29
|
-
function p(u) {
|
|
30
|
-
return u.replace(
|
|
31
|
-
/\.rsc($|\?)/,
|
|
32
|
-
// $1 ensures `?` is preserved
|
|
33
|
-
"$1"
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
}(n), n);
|
|
37
|
-
}
|
|
2
|
+
var e = {};
|
|
38
3
|
export {
|
|
39
|
-
|
|
4
|
+
e as __exports
|
|
40
5
|
};
|