@aizu-chat/react 0.1.3 → 0.1.4
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/index.d.mts +0 -146
- package/dist/index.d.ts +0 -146
- package/dist/index.js +162 -309
- package/dist/index.mjs +162 -309
- package/package.json +1 -1
- package/dist/chunk-33CPD3DF.mjs +0 -59
- package/dist/chunk-KLPKNMIP.mjs +0 -15
- package/dist/chunk-NBQP747C.mjs +0 -130
- package/dist/chunk-XEQE67X7.mjs +0 -1858
- package/dist/components.d.mts +0 -69
- package/dist/components.d.ts +0 -69
- package/dist/components.js +0 -1922
- package/dist/components.mjs +0 -17
- package/dist/hooks.d.mts +0 -6
- package/dist/hooks.d.ts +0 -6
- package/dist/hooks.js +0 -40
- package/dist/hooks.mjs +0 -8
- package/dist/sdk.d.mts +0 -55
- package/dist/sdk.d.ts +0 -55
- package/dist/sdk.js +0 -200
- package/dist/sdk.mjs +0 -12
package/dist/index.mjs
CHANGED
|
@@ -83,63 +83,11 @@ function cn(...args) {
|
|
|
83
83
|
return twMerge(clsx(args));
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// src/assets/icons/ai/index.tsx
|
|
87
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
88
|
-
var IconAI = (_a) => {
|
|
89
|
-
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
90
|
-
return /* @__PURE__ */ jsxs(
|
|
91
|
-
"svg",
|
|
92
|
-
__spreadProps(__spreadValues({
|
|
93
|
-
width: "64",
|
|
94
|
-
height: "64",
|
|
95
|
-
viewBox: "0 0 64 64",
|
|
96
|
-
fill: "none",
|
|
97
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
98
|
-
className: cn("w-8 h-8", className)
|
|
99
|
-
}, props), {
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ jsx("title", { children: "Icon AI" }),
|
|
102
|
-
/* @__PURE__ */ jsx("g", { filter: "url(#filter0_ii_48_32)", children: /* @__PURE__ */ jsx("circle", { cx: "32.0001", cy: "32", r: "32", fill: "url(#paint0_linear_48_32)" }) }),
|
|
103
|
-
/* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M34.2288 17.7789C33.9922 16.7384 33.0671 16 32 16C30.9329 16 30.0078 16.7384 29.7712 17.7789L28.5065 23.3405C27.9216 25.9129 25.9129 27.9216 23.3405 28.5065L17.7789 29.7712C16.7384 30.0078 16 30.9329 16 32C16 33.0671 16.7384 33.9922 17.7789 34.2288L23.3405 35.4935C25.9129 36.0784 27.9216 38.0871 28.5065 40.6595L29.7712 46.2211C30.0078 47.2616 30.9329 48 32 48C33.0671 48 33.9922 47.2616 34.2288 46.2211L35.4935 40.6595C36.0784 38.0871 38.0871 36.0784 40.6595 35.4935L46.2211 34.2288C47.2616 33.9922 48 33.0671 48 32C48 30.9329 47.2616 30.0078 46.2211 29.7712L40.6595 28.5065C38.0871 27.9216 36.0784 25.9129 35.4935 23.3405L34.2288 17.7789Z", fill: "url(#paint1_linear_48_32)" }),
|
|
104
|
-
/* @__PURE__ */ jsxs("defs", { children: [
|
|
105
|
-
/* @__PURE__ */ jsxs("filter", { id: "filter0_ii_48_32", x: "0.00012207", y: "0", width: "63.9999", height: "64", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB", children: [
|
|
106
|
-
/* @__PURE__ */ jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
107
|
-
/* @__PURE__ */ jsx("feBlend", { mode: "normal", in: "SourceGraphic", in2: "BackgroundImageFix", result: "shape" }),
|
|
108
|
-
/* @__PURE__ */ jsx("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
109
|
-
/* @__PURE__ */ jsx("feMorphology", { radius: "4", operator: "erode", in: "SourceAlpha", result: "effect1_innerShadow_48_32" }),
|
|
110
|
-
/* @__PURE__ */ jsx("feOffset", {}),
|
|
111
|
-
/* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "4" }),
|
|
112
|
-
/* @__PURE__ */ jsx("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
113
|
-
/* @__PURE__ */ jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.2 0" }),
|
|
114
|
-
/* @__PURE__ */ jsx("feBlend", { mode: "normal", in2: "shape", result: "effect1_innerShadow_48_32" }),
|
|
115
|
-
/* @__PURE__ */ jsx("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }),
|
|
116
|
-
/* @__PURE__ */ jsx("feOffset", {}),
|
|
117
|
-
/* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "1" }),
|
|
118
|
-
/* @__PURE__ */ jsx("feComposite", { in2: "hardAlpha", operator: "arithmetic", k2: "-1", k3: "1" }),
|
|
119
|
-
/* @__PURE__ */ jsx("feColorMatrix", { type: "matrix", values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0" }),
|
|
120
|
-
/* @__PURE__ */ jsx("feBlend", { mode: "normal", in2: "effect1_innerShadow_48_32", result: "effect2_innerShadow_48_32" })
|
|
121
|
-
] }),
|
|
122
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "paint0_linear_48_32", x1: "32.0001", y1: "-5.96047e-08", x2: "32.0001", y2: "64", gradientUnits: "userSpaceOnUse", children: [
|
|
123
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "#3D3D3D" }),
|
|
124
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.496312" }),
|
|
125
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.723156", stopColor: "#803500" }),
|
|
126
|
-
/* @__PURE__ */ jsx("stop", { offset: "0.95", stopColor: "#FF6A00" })
|
|
127
|
-
] }),
|
|
128
|
-
/* @__PURE__ */ jsxs("linearGradient", { id: "paint1_linear_48_32", x1: "32", y1: "16", x2: "32", y2: "48", gradientUnits: "userSpaceOnUse", children: [
|
|
129
|
-
/* @__PURE__ */ jsx("stop", { stopColor: "white" }),
|
|
130
|
-
/* @__PURE__ */ jsx("stop", { offset: "1", stopColor: "#EBEBEB" })
|
|
131
|
-
] })
|
|
132
|
-
] })
|
|
133
|
-
]
|
|
134
|
-
})
|
|
135
|
-
);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
86
|
// src/assets/icons/arrow-narrow-up/index.tsx
|
|
139
|
-
import { jsx
|
|
87
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
140
88
|
var IconArrowNarrowUp = (_a) => {
|
|
141
89
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
142
|
-
return /* @__PURE__ */
|
|
90
|
+
return /* @__PURE__ */ jsxs(
|
|
143
91
|
"svg",
|
|
144
92
|
__spreadProps(__spreadValues({
|
|
145
93
|
width: "20",
|
|
@@ -150,8 +98,8 @@ var IconArrowNarrowUp = (_a) => {
|
|
|
150
98
|
className
|
|
151
99
|
}, props), {
|
|
152
100
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ jsx("title", { children: "Arrow Narrow up" }),
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
155
103
|
"path",
|
|
156
104
|
{
|
|
157
105
|
d: "M10 16.6666V3.33331M10 3.33331L5 8.33331M10 3.33331L15 8.33331",
|
|
@@ -167,10 +115,10 @@ var IconArrowNarrowUp = (_a) => {
|
|
|
167
115
|
};
|
|
168
116
|
|
|
169
117
|
// src/assets/icons/chevron-left/index.tsx
|
|
170
|
-
import { jsx as
|
|
118
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
171
119
|
var IconChevronLeft = (_a) => {
|
|
172
120
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
173
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ jsxs2(
|
|
174
122
|
"svg",
|
|
175
123
|
__spreadProps(__spreadValues({
|
|
176
124
|
width: "20",
|
|
@@ -181,8 +129,8 @@ var IconChevronLeft = (_a) => {
|
|
|
181
129
|
className
|
|
182
130
|
}, props), {
|
|
183
131
|
children: [
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ jsx2("title", { children: "Chevron Left" }),
|
|
133
|
+
/* @__PURE__ */ jsx2(
|
|
186
134
|
"path",
|
|
187
135
|
{
|
|
188
136
|
d: "M12.5 15L7.5 10L12.5 5",
|
|
@@ -198,10 +146,10 @@ var IconChevronLeft = (_a) => {
|
|
|
198
146
|
};
|
|
199
147
|
|
|
200
148
|
// src/assets/icons/expand/index.tsx
|
|
201
|
-
import { jsx as
|
|
149
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
202
150
|
var IconExpand = (_a) => {
|
|
203
151
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
204
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ jsxs3(
|
|
205
153
|
"svg",
|
|
206
154
|
__spreadProps(__spreadValues({
|
|
207
155
|
width: "20",
|
|
@@ -212,8 +160,8 @@ var IconExpand = (_a) => {
|
|
|
212
160
|
className: cn("text-[#3D3D3D]", className)
|
|
213
161
|
}, props), {
|
|
214
162
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ jsx3("title", { children: "Icon Expand" }),
|
|
164
|
+
/* @__PURE__ */ jsx3(
|
|
217
165
|
"path",
|
|
218
166
|
{
|
|
219
167
|
d: "M11.6667 8.33333L17.5 2.5M17.5 2.5H12.5M17.5 2.5V7.5M8.33333 11.6667L2.5 17.5M2.5 17.5H7.5M2.5 17.5L2.5 12.5",
|
|
@@ -229,10 +177,10 @@ var IconExpand = (_a) => {
|
|
|
229
177
|
};
|
|
230
178
|
|
|
231
179
|
// src/assets/icons/image-plus/index.tsx
|
|
232
|
-
import { jsx as
|
|
180
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
233
181
|
var IconImagePlus = (_a) => {
|
|
234
182
|
var _b = _a, { className = "text-[#FFF8EC]" } = _b, props = __objRest(_b, ["className"]);
|
|
235
|
-
return /* @__PURE__ */
|
|
183
|
+
return /* @__PURE__ */ jsxs4(
|
|
236
184
|
"svg",
|
|
237
185
|
__spreadProps(__spreadValues({
|
|
238
186
|
width: "20",
|
|
@@ -243,8 +191,8 @@ var IconImagePlus = (_a) => {
|
|
|
243
191
|
className
|
|
244
192
|
}, props), {
|
|
245
193
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ jsx4("title", { children: "Icon Image Plus" }),
|
|
195
|
+
/* @__PURE__ */ jsx4(
|
|
248
196
|
"path",
|
|
249
197
|
{
|
|
250
198
|
d: "M10.4167 2.50002H6.5C5.09987 2.50002 4.3998 2.50002 3.86502 2.7725C3.39462 3.01219 3.01217 3.39464 2.77248 3.86504C2.5 4.39982 2.5 5.09989 2.5 6.50002V13.5C2.5 14.9002 2.5 15.6002 2.77248 16.135C3.01217 16.6054 3.39462 16.9879 3.86502 17.2275C4.3998 17.5 5.09987 17.5 6.5 17.5H14.1667C14.9416 17.5 15.3291 17.5 15.647 17.4148C16.5098 17.1837 17.1836 16.5098 17.4148 15.6471C17.5 15.3292 17.5 14.9417 17.5 14.1667M15.8333 6.66669V1.66669M13.3333 4.16669H18.3333M8.75 7.08335C8.75 8.00383 8.00381 8.75002 7.08333 8.75002C6.16286 8.75002 5.41667 8.00383 5.41667 7.08335C5.41667 6.16288 6.16286 5.41669 7.08333 5.41669C8.00381 5.41669 8.75 6.16288 8.75 7.08335ZM12.4917 9.93181L5.44262 16.3401C5.04614 16.7005 4.84789 16.8807 4.83036 17.0368C4.81516 17.1722 4.86704 17.3064 4.96932 17.3963C5.08732 17.5 5.35523 17.5 5.89107 17.5H13.7133C14.9126 17.5 15.5123 17.5 15.9833 17.2985C16.5745 17.0456 17.0456 16.5746 17.2985 15.9833C17.5 15.5123 17.5 14.9126 17.5 13.7133C17.5 13.3098 17.5 13.108 17.4559 12.9201C17.4004 12.684 17.2941 12.4628 17.1444 12.272C17.0252 12.1202 16.8677 11.9941 16.5526 11.7421L14.2215 9.87724C13.9062 9.62494 13.7485 9.4988 13.5748 9.45428C13.4218 9.41504 13.2607 9.42012 13.1104 9.46893C12.94 9.5243 12.7905 9.66014 12.4917 9.93181Z",
|
|
@@ -260,10 +208,10 @@ var IconImagePlus = (_a) => {
|
|
|
260
208
|
};
|
|
261
209
|
|
|
262
210
|
// src/assets/icons/minimize/index.tsx
|
|
263
|
-
import { jsx as
|
|
211
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
264
212
|
var IconMinimize = (_a) => {
|
|
265
213
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
266
|
-
return /* @__PURE__ */
|
|
214
|
+
return /* @__PURE__ */ jsxs5(
|
|
267
215
|
"svg",
|
|
268
216
|
__spreadProps(__spreadValues({
|
|
269
217
|
width: "20",
|
|
@@ -274,8 +222,8 @@ var IconMinimize = (_a) => {
|
|
|
274
222
|
className: cn("text-[#3D3D3D]", className)
|
|
275
223
|
}, props), {
|
|
276
224
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ jsx5("title", { children: "Icon Minimize" }),
|
|
226
|
+
/* @__PURE__ */ jsx5(
|
|
279
227
|
"path",
|
|
280
228
|
{
|
|
281
229
|
d: "M3.33333 11.6667H8.33333M8.33333 11.6667V16.6667M8.33333 11.6667L2.5 17.5M16.6667 8.33333H11.6667M11.6667 8.33333V3.33333M11.6667 8.33333L17.5 2.5",
|
|
@@ -291,10 +239,10 @@ var IconMinimize = (_a) => {
|
|
|
291
239
|
};
|
|
292
240
|
|
|
293
241
|
// src/assets/icons/x-close/index.tsx
|
|
294
|
-
import { jsx as
|
|
242
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
295
243
|
var IconXClose = (_a) => {
|
|
296
244
|
var _b = _a, { className = "" } = _b, props = __objRest(_b, ["className"]);
|
|
297
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ jsxs6(
|
|
298
246
|
"svg",
|
|
299
247
|
__spreadProps(__spreadValues({
|
|
300
248
|
width: "20",
|
|
@@ -305,8 +253,8 @@ var IconXClose = (_a) => {
|
|
|
305
253
|
className: cn("text-[#3D3D3D]", className)
|
|
306
254
|
}, props), {
|
|
307
255
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ jsx6("title", { children: "Icon XClose" }),
|
|
257
|
+
/* @__PURE__ */ jsx6(
|
|
310
258
|
"path",
|
|
311
259
|
{
|
|
312
260
|
d: "M15 5L5 15M5 5L15 15",
|
|
@@ -517,7 +465,7 @@ Detail
|
|
|
517
465
|
];
|
|
518
466
|
|
|
519
467
|
// src/constant/default.ts
|
|
520
|
-
var defaultQuickMenuMessage = "\u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E35\u0E04\u0E23\u0E31\u0E1A
|
|
468
|
+
var defaultQuickMenuMessage = "\u0E2A\u0E27\u0E31\u0E2A\u0E14\u0E35\u0E04\u0E48\u0E30 \u0E22\u0E34\u0E19\u0E14\u0E35\u0E15\u0E49\u0E2D\u0E19\u0E23\u0E31\u0E1A\u0E2A\u0E39\u0E48 ZIMCRAFT \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E43\u0E2B\u0E49\u0E04\u0E38\u0E13\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E1E\u0E31\u0E01\u0E1C\u0E48\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E14\u0E35\u0E17\u0E35\u0E48\u0E2A\u0E38\u0E14 \u0E43\u0E2B\u0E49 AI \u0E0A\u0E48\u0E27\u0E22\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2B\u0E21\u0E2D\u0E19\u0E17\u0E35\u0E48\u0E40\u0E2B\u0E21\u0E32\u0E30\u0E01\u0E31\u0E1A\u0E2A\u0E23\u0E35\u0E23\u0E30\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13\u0E44\u0E2B\u0E21\u0E04\u0E23\u0E31\u0E1A? \u0E43\u0E0A\u0E49\u0E40\u0E27\u0E25\u0E32\u0E41\u0E04\u0E48 1 \u0E19\u0E32\u0E17\u0E35";
|
|
521
469
|
var defaultBanner = "https://utech-dev.zimpligital.com/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fcoupon-banner-th.edad52fd.webp&w=640&q=75";
|
|
522
470
|
var defaultQuickMenus = [
|
|
523
471
|
{ id: "1", title: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32 \u{1F6CD}\uFE0F", value: "\u0E2A\u0E31\u0E48\u0E07\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32", mockResponse: "QUICK_MENU_SHOP" /* QUICK_MENU_SHOP */ },
|
|
@@ -858,7 +806,7 @@ var useAizuChat = (client) => {
|
|
|
858
806
|
};
|
|
859
807
|
|
|
860
808
|
// src/contexts/aizu-client-context.tsx
|
|
861
|
-
import { jsx as
|
|
809
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
862
810
|
var AizuClientContext = createContext(
|
|
863
811
|
void 0
|
|
864
812
|
);
|
|
@@ -891,7 +839,7 @@ var AizuClientProvider = ({
|
|
|
891
839
|
cancelRequest
|
|
892
840
|
]
|
|
893
841
|
);
|
|
894
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ jsx7(AizuClientContext.Provider, { value, children });
|
|
895
843
|
};
|
|
896
844
|
var useAizuClient = () => {
|
|
897
845
|
const context = useContext(AizuClientContext);
|
|
@@ -943,7 +891,7 @@ var useOpenChat = () => {
|
|
|
943
891
|
|
|
944
892
|
// src/contexts/chat-context.tsx
|
|
945
893
|
import { createContext as createContext2, useCallback as useCallback4, useContext as useContext2, useMemo as useMemo2, useState as useState3 } from "react";
|
|
946
|
-
import { jsx as
|
|
894
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
947
895
|
var ChatContext = createContext2(void 0);
|
|
948
896
|
var ChatProvider = ({ children }) => {
|
|
949
897
|
const [messages, setMessages] = useState3([]);
|
|
@@ -985,7 +933,7 @@ var ChatProvider = ({ children }) => {
|
|
|
985
933
|
}),
|
|
986
934
|
[messages, userMessages, latestMessage, isLoading, chatControls, addUserMessage, addBotMessage, clearMessages]
|
|
987
935
|
);
|
|
988
|
-
return /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ jsx8(ChatContext.Provider, { value, children });
|
|
989
937
|
};
|
|
990
938
|
var useChatContext = () => {
|
|
991
939
|
const context = useContext2(ChatContext);
|
|
@@ -997,26 +945,6 @@ var useChatContext = () => {
|
|
|
997
945
|
|
|
998
946
|
// src/sdk/client.ts
|
|
999
947
|
var AizuClient = class {
|
|
1000
|
-
/**
|
|
1001
|
-
* Creates a new AizuClient instance
|
|
1002
|
-
*
|
|
1003
|
-
* @param config - Configuration options for the client
|
|
1004
|
-
* @param config.hostUrl - The base URL of the Aizu API (e.g., 'https://api.aizu.chat')
|
|
1005
|
-
* @param config.apiKey - Your API key for authentication
|
|
1006
|
-
* @param config.timeout - Request timeout in milliseconds (default: 30000)
|
|
1007
|
-
*
|
|
1008
|
-
* @throws {Error} If hostUrl is not a non-empty string
|
|
1009
|
-
* @throws {Error} If apiKey is not a non-empty string
|
|
1010
|
-
*
|
|
1011
|
-
* @example
|
|
1012
|
-
* ```typescript
|
|
1013
|
-
* const client = new AizuClient({
|
|
1014
|
-
* hostUrl: 'https://api.aizu.chat',
|
|
1015
|
-
* apiKey: 'sk_test_123456',
|
|
1016
|
-
* timeout: 60000 // 60 seconds
|
|
1017
|
-
* });
|
|
1018
|
-
* ```
|
|
1019
|
-
*/
|
|
1020
948
|
constructor(config) {
|
|
1021
949
|
const { hostUrl, apiKey, timeout } = config;
|
|
1022
950
|
if (typeof hostUrl !== "string" || hostUrl.trim().length === 0) {
|
|
@@ -1033,26 +961,6 @@ var AizuClient = class {
|
|
|
1033
961
|
this.apiKey = apiKey;
|
|
1034
962
|
this.timeout = timeout != null ? timeout : 3e4;
|
|
1035
963
|
}
|
|
1036
|
-
/**
|
|
1037
|
-
* Internal method for making HTTP requests to the API
|
|
1038
|
-
*
|
|
1039
|
-
* Handles timeout management, abort signal combination, and error handling.
|
|
1040
|
-
* Supports both user-initiated cancellation and automatic timeout.
|
|
1041
|
-
*
|
|
1042
|
-
* @template T - The expected response type
|
|
1043
|
-
* @template TBody - The request body type
|
|
1044
|
-
*
|
|
1045
|
-
* @param path - API endpoint path (e.g., '/chat/query')
|
|
1046
|
-
* @param options - Request options including body and signal
|
|
1047
|
-
*
|
|
1048
|
-
* @returns Promise resolving to the API response
|
|
1049
|
-
*
|
|
1050
|
-
* @throws {Error} "Request cancelled by user" - If the request is cancelled via AbortSignal
|
|
1051
|
-
* @throws {Error} "Request timeout: The server took too long to respond" - If the request exceeds the timeout
|
|
1052
|
-
* @throws {Error} "API Error: {status} {statusText}" - If the API returns an error status
|
|
1053
|
-
*
|
|
1054
|
-
* @private
|
|
1055
|
-
*/
|
|
1056
964
|
request(_0) {
|
|
1057
965
|
return __async(this, arguments, function* (path, options = {}) {
|
|
1058
966
|
const url = `${this.hostUrl}${path}`;
|
|
@@ -1123,64 +1031,6 @@ var AizuClient = class {
|
|
|
1123
1031
|
}
|
|
1124
1032
|
});
|
|
1125
1033
|
}
|
|
1126
|
-
/**
|
|
1127
|
-
* Sends a chat query to the Aizu API
|
|
1128
|
-
*
|
|
1129
|
-
* @param params - Chat request parameters
|
|
1130
|
-
* @param params.query - The user's message/question (required, non-empty)
|
|
1131
|
-
* @param params.conversationId - Optional conversation ID to continue an existing conversation
|
|
1132
|
-
* @param options - Additional options
|
|
1133
|
-
* @param options.signal - Optional AbortSignal to cancel the request
|
|
1134
|
-
*
|
|
1135
|
-
* @returns Promise resolving to the chat response from the API
|
|
1136
|
-
*
|
|
1137
|
-
* @throws {Error} "Query is required" - If query is empty or whitespace only
|
|
1138
|
-
* @throws {Error} "Request cancelled by user" - If the request is cancelled
|
|
1139
|
-
* @throws {Error} "Request timeout: The server took too long to respond" - If the request times out
|
|
1140
|
-
* @throws {Error} "API Error: {status} {statusText}" - If the API returns an error
|
|
1141
|
-
*
|
|
1142
|
-
* @example
|
|
1143
|
-
* ```typescript
|
|
1144
|
-
* // Simple query
|
|
1145
|
-
* const response = await client.chat({
|
|
1146
|
-
* query: 'What is the weather today?'
|
|
1147
|
-
* });
|
|
1148
|
-
* console.log(response.answer);
|
|
1149
|
-
* ```
|
|
1150
|
-
*
|
|
1151
|
-
* @example
|
|
1152
|
-
* ```typescript
|
|
1153
|
-
* // Continue conversation
|
|
1154
|
-
* const response1 = await client.chat({
|
|
1155
|
-
* query: 'What is the weather today?'
|
|
1156
|
-
* });
|
|
1157
|
-
*
|
|
1158
|
-
* const response2 = await client.chat({
|
|
1159
|
-
* query: 'And tomorrow?',
|
|
1160
|
-
* conversationId: response1.conversationId
|
|
1161
|
-
* });
|
|
1162
|
-
* ```
|
|
1163
|
-
*
|
|
1164
|
-
* @example
|
|
1165
|
-
* ```typescript
|
|
1166
|
-
* // With cancellation support
|
|
1167
|
-
* const controller = new AbortController();
|
|
1168
|
-
*
|
|
1169
|
-
* const promise = client.chat(
|
|
1170
|
-
* { query: 'Long running query...' },
|
|
1171
|
-
* { signal: controller.signal }
|
|
1172
|
-
* );
|
|
1173
|
-
*
|
|
1174
|
-
* // Cancel after 5 seconds
|
|
1175
|
-
* setTimeout(() => controller.abort(), 5000);
|
|
1176
|
-
*
|
|
1177
|
-
* try {
|
|
1178
|
-
* const response = await promise;
|
|
1179
|
-
* } catch (error) {
|
|
1180
|
-
* console.error('Request was cancelled:', error);
|
|
1181
|
-
* }
|
|
1182
|
-
* ```
|
|
1183
|
-
*/
|
|
1184
1034
|
chat(params, options) {
|
|
1185
1035
|
return __async(this, null, function* () {
|
|
1186
1036
|
if (!params.query.trim()) {
|
|
@@ -1393,10 +1243,10 @@ var useKeyboard = ({ userMessages, isLoading, onSend }) => {
|
|
|
1393
1243
|
};
|
|
1394
1244
|
|
|
1395
1245
|
// src/components/input-bar/index.tsx
|
|
1396
|
-
import { jsx as
|
|
1246
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1397
1247
|
var ButtonSelectImage = (_a) => {
|
|
1398
1248
|
var _b = _a, { onClick, className } = _b, props = __objRest(_b, ["onClick", "className"]);
|
|
1399
|
-
return /* @__PURE__ */
|
|
1249
|
+
return /* @__PURE__ */ jsx9(
|
|
1400
1250
|
"button",
|
|
1401
1251
|
__spreadProps(__spreadValues({
|
|
1402
1252
|
type: "button",
|
|
@@ -1407,13 +1257,13 @@ var ButtonSelectImage = (_a) => {
|
|
|
1407
1257
|
),
|
|
1408
1258
|
"aria-label": "Upload image"
|
|
1409
1259
|
}, props), {
|
|
1410
|
-
children: /* @__PURE__ */
|
|
1260
|
+
children: /* @__PURE__ */ jsx9(IconImagePlus, {})
|
|
1411
1261
|
})
|
|
1412
1262
|
);
|
|
1413
1263
|
};
|
|
1414
1264
|
var InputTextArea = (_a) => {
|
|
1415
1265
|
var _b = _a, { onMagicClick, placeholder, className } = _b, props = __objRest(_b, ["onMagicClick", "placeholder", "className"]);
|
|
1416
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ jsx9("div", { className: "flex-1 relative", children: /* @__PURE__ */ jsx9(
|
|
1417
1267
|
"textarea",
|
|
1418
1268
|
__spreadValues({
|
|
1419
1269
|
placeholder,
|
|
@@ -1424,7 +1274,7 @@ var InputTextArea = (_a) => {
|
|
|
1424
1274
|
};
|
|
1425
1275
|
var ButtonConfirm = (_a) => {
|
|
1426
1276
|
var _b = _a, { className, disabled } = _b, props = __objRest(_b, ["className", "disabled"]);
|
|
1427
|
-
return /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ jsx9(
|
|
1428
1278
|
"button",
|
|
1429
1279
|
__spreadProps(__spreadValues({
|
|
1430
1280
|
type: "submit",
|
|
@@ -1439,7 +1289,7 @@ var ButtonConfirm = (_a) => {
|
|
|
1439
1289
|
"aria-label": "Send message",
|
|
1440
1290
|
disabled
|
|
1441
1291
|
}, props), {
|
|
1442
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ jsx9(IconArrowNarrowUp, { className: "text-black" })
|
|
1443
1293
|
})
|
|
1444
1294
|
);
|
|
1445
1295
|
};
|
|
@@ -1450,7 +1300,7 @@ var ButtonCancel = () => {
|
|
|
1450
1300
|
cancelRequest();
|
|
1451
1301
|
setIsLoading(false);
|
|
1452
1302
|
};
|
|
1453
|
-
return /* @__PURE__ */
|
|
1303
|
+
return /* @__PURE__ */ jsx9(
|
|
1454
1304
|
"button",
|
|
1455
1305
|
{
|
|
1456
1306
|
type: "button",
|
|
@@ -1461,7 +1311,7 @@ var ButtonCancel = () => {
|
|
|
1461
1311
|
"flex items-center justify-center",
|
|
1462
1312
|
"cursor-pointer"
|
|
1463
1313
|
),
|
|
1464
|
-
children: /* @__PURE__ */
|
|
1314
|
+
children: /* @__PURE__ */ jsx9("div", { className: "bg-black w-4 h-4" })
|
|
1465
1315
|
}
|
|
1466
1316
|
);
|
|
1467
1317
|
};
|
|
@@ -1484,15 +1334,15 @@ var InputBar = (_a) => {
|
|
|
1484
1334
|
"className"
|
|
1485
1335
|
]);
|
|
1486
1336
|
const { value, textareaRef, handleChange, handleSubmit, handleKeyDown } = useKeyboard({ userMessages, isLoading, onSend });
|
|
1487
|
-
return /* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1337
|
+
return /* @__PURE__ */ jsx9("section", __spreadProps(__spreadValues({ className: cn("bg-white p-4", className) }, props), { children: /* @__PURE__ */ jsxs7("form", { onSubmit: handleSubmit, className: "flex items-end gap-3", children: [
|
|
1338
|
+
/* @__PURE__ */ jsxs7(
|
|
1489
1339
|
"label",
|
|
1490
1340
|
{
|
|
1491
1341
|
htmlFor: "chat-input-text",
|
|
1492
1342
|
className: "flex items-end rounded-3xl bg-gray-100 flex-1 p-2 focus-within:ring-2 focus-within:ring-orange-300",
|
|
1493
1343
|
children: [
|
|
1494
|
-
/* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1344
|
+
/* @__PURE__ */ jsx9(ButtonSelectImage, { onClick: onImageClick, className: "mr-3" }),
|
|
1345
|
+
/* @__PURE__ */ jsx9(
|
|
1496
1346
|
InputTextArea,
|
|
1497
1347
|
{
|
|
1498
1348
|
ref: textareaRef,
|
|
@@ -1507,7 +1357,7 @@ var InputBar = (_a) => {
|
|
|
1507
1357
|
]
|
|
1508
1358
|
}
|
|
1509
1359
|
),
|
|
1510
|
-
isLoading ? /* @__PURE__ */
|
|
1360
|
+
isLoading ? /* @__PURE__ */ jsx9(ButtonCancel, {}) : /* @__PURE__ */ jsx9(ButtonConfirm, { disabled: isLoading })
|
|
1511
1361
|
] }) }));
|
|
1512
1362
|
};
|
|
1513
1363
|
InputBar.ButtonSelectImage = ButtonSelectImage;
|
|
@@ -1515,24 +1365,24 @@ InputBar.InputTextArea = InputTextArea;
|
|
|
1515
1365
|
InputBar.ButtonConfirm = ButtonConfirm;
|
|
1516
1366
|
|
|
1517
1367
|
// src/components/loading.tsx
|
|
1518
|
-
import { jsx as
|
|
1368
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1519
1369
|
var Loading = ({ message }) => {
|
|
1520
|
-
return /* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */
|
|
1523
|
-
/* @__PURE__ */
|
|
1524
|
-
/* @__PURE__ */
|
|
1370
|
+
return /* @__PURE__ */ jsxs8("section", { className: cn("flex flex-col justify-center items-center border border-orange-400 shadow shadow-orange-400 h-10 max-w-69.5 rounded-3xl", { "h-16": !!message }), children: [
|
|
1371
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex justify-center items-center gap-x-1 ", children: [
|
|
1372
|
+
/* @__PURE__ */ jsx10("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-300" }),
|
|
1373
|
+
/* @__PURE__ */ jsx10("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-600" }),
|
|
1374
|
+
/* @__PURE__ */ jsx10("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-900" })
|
|
1525
1375
|
] }),
|
|
1526
|
-
message && /* @__PURE__ */
|
|
1376
|
+
message && /* @__PURE__ */ jsx10("p", { className: "text-center text-[12px] text-gray-500 mt-1", children: message })
|
|
1527
1377
|
] });
|
|
1528
1378
|
};
|
|
1529
1379
|
|
|
1530
1380
|
// src/components/button.tsx
|
|
1531
1381
|
import { forwardRef, memo } from "react";
|
|
1532
|
-
import { jsx as
|
|
1382
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1533
1383
|
var ButtonInner = (props, ref) => {
|
|
1534
1384
|
const _a = props, { children, className, onClick } = _a, rest = __objRest(_a, ["children", "className", "onClick"]);
|
|
1535
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ jsx11(
|
|
1536
1386
|
"button",
|
|
1537
1387
|
__spreadProps(__spreadValues({
|
|
1538
1388
|
ref,
|
|
@@ -1554,33 +1404,33 @@ var Button = memo(forwardRef(ButtonInner));
|
|
|
1554
1404
|
Button.displayName = "Button";
|
|
1555
1405
|
|
|
1556
1406
|
// src/components/container.tsx
|
|
1557
|
-
import { jsx as
|
|
1407
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1558
1408
|
var Container = (_a) => {
|
|
1559
1409
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1560
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ jsx12("div", { className: cn("p-3 rounded-3xl border border-orange-300", className), children });
|
|
1561
1411
|
};
|
|
1562
1412
|
|
|
1563
1413
|
// src/components/product-preview-card/index.tsx
|
|
1564
|
-
import { jsx as
|
|
1414
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1565
1415
|
var ProductPreviewCard = ({ product, className }) => {
|
|
1566
|
-
return /* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("bg-white overflow-hidden rounded-2xl h-full p-3 lg:hover:shadow", className), children: [
|
|
1417
|
+
/* @__PURE__ */ jsx13(ProductThumbnail, __spreadValues({}, product)),
|
|
1418
|
+
/* @__PURE__ */ jsx13(ProductSuggest, __spreadValues({}, product)),
|
|
1419
|
+
/* @__PURE__ */ jsx13(ProductTitle, __spreadValues({}, product)),
|
|
1420
|
+
/* @__PURE__ */ jsx13(ProductDescription, __spreadValues({}, product)),
|
|
1421
|
+
/* @__PURE__ */ jsx13(ProductPrice, __spreadValues({}, product)),
|
|
1422
|
+
/* @__PURE__ */ jsx13(ProductBadges, {}),
|
|
1423
|
+
/* @__PURE__ */ jsx13(ProductMenus, __spreadValues({}, product))
|
|
1574
1424
|
] });
|
|
1575
1425
|
};
|
|
1576
1426
|
var ProductThumbnail = (product) => {
|
|
1577
1427
|
if (!product.thumbnail) {
|
|
1578
|
-
return /* @__PURE__ */
|
|
1428
|
+
return /* @__PURE__ */ jsx13("div", { className: "border aspect-square flex justify-center items-center", children: "No Image" });
|
|
1579
1429
|
}
|
|
1580
|
-
return /* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ jsx13("div", { className: "w-full aspect-square flex justify-center items-center", children: /* @__PURE__ */ jsx13("img", { src: product.thumbnail, alt: product.title, className: "w-full" }) });
|
|
1581
1431
|
};
|
|
1582
1432
|
var ProductSuggest = (product) => {
|
|
1583
|
-
return /* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ jsxs9(
|
|
1584
1434
|
"div",
|
|
1585
1435
|
{
|
|
1586
1436
|
className: "text-[10px] text-[#FF6B00] font-bold bg-[#FFF0D3] max-w-max rounded-sm px-2\n py-px mb-2",
|
|
@@ -1592,7 +1442,7 @@ var ProductSuggest = (product) => {
|
|
|
1592
1442
|
);
|
|
1593
1443
|
};
|
|
1594
1444
|
var ProductTitle = (product) => {
|
|
1595
|
-
return /* @__PURE__ */
|
|
1445
|
+
return /* @__PURE__ */ jsx13(
|
|
1596
1446
|
"div",
|
|
1597
1447
|
{
|
|
1598
1448
|
className: "font-semibold line-clamp-2 mb-2 min-h-12",
|
|
@@ -1601,7 +1451,7 @@ var ProductTitle = (product) => {
|
|
|
1601
1451
|
);
|
|
1602
1452
|
};
|
|
1603
1453
|
var ProductDescription = (product) => {
|
|
1604
|
-
return /* @__PURE__ */
|
|
1454
|
+
return /* @__PURE__ */ jsx13(
|
|
1605
1455
|
"div",
|
|
1606
1456
|
{
|
|
1607
1457
|
className: "text-sm text-[#525252] line-clamp-2 mb-3",
|
|
@@ -1610,7 +1460,7 @@ var ProductDescription = (product) => {
|
|
|
1610
1460
|
);
|
|
1611
1461
|
};
|
|
1612
1462
|
var ProductPrice = (product) => {
|
|
1613
|
-
return /* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ jsxs9(
|
|
1614
1464
|
"div",
|
|
1615
1465
|
{
|
|
1616
1466
|
className: "text-lg text-red-500 font-semibold mb-3",
|
|
@@ -1627,7 +1477,7 @@ var ProductBadges = () => {
|
|
|
1627
1477
|
{ id: "badge2", text: "\u0E2A\u0E48\u0E07\u0E1F\u0E23\u0E35" },
|
|
1628
1478
|
{ id: "badge3", text: "Cashback 500" }
|
|
1629
1479
|
];
|
|
1630
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ jsx13("ul", { className: "flex flex-wrap gap-1 mb-6", children: badges == null ? void 0 : badges.map((badge) => /* @__PURE__ */ jsx13("li", { className: "text-[10px] text-[#656565] font-bold bg-gray-200 px-2 py-px rounded-sm", children: badge.text }, badge.id)) });
|
|
1631
1481
|
};
|
|
1632
1482
|
var ProductMenus = (product) => {
|
|
1633
1483
|
const menus = [
|
|
@@ -1635,37 +1485,40 @@ var ProductMenus = (product) => {
|
|
|
1635
1485
|
{ id: "product-menu2", text: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E43\u0E19\u0E23\u0E16\u0E40\u0E02\u0E47\u0E19 \u{1F6D2} " },
|
|
1636
1486
|
{ id: "product-menu3", text: "\u0E2A\u0E2D\u0E1A\u0E16\u0E32\u0E21\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21 \u{1F4AC}" }
|
|
1637
1487
|
];
|
|
1638
|
-
return /* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ jsx13("ul", { className: "flex flex-col gap-y-3", children: menus == null ? void 0 : menus.map((menu) => {
|
|
1639
1489
|
if (menu.text.includes("\u0E09\u0E31\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32")) {
|
|
1640
|
-
return /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13("a", { href: `/products/${product.handle}`, target: "_blank", rel: "noreferrer", className: "border border-orange-300 rounded-3xl px-3 py-2 text-orange-500 text-sm text-center block", children: menu.text }) }, menu.id);
|
|
1641
1491
|
}
|
|
1642
|
-
return /* @__PURE__ */
|
|
1492
|
+
return /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13(Button, { className: cn("text-nowrap w-full", { "bg-orange-500 text-white/80": menu.text.includes("\u0E09\u0E31\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32") }), children: menu.text }) }, menu.id);
|
|
1643
1493
|
}) });
|
|
1644
1494
|
};
|
|
1645
1495
|
|
|
1496
|
+
// src/assets/images/zImple-solotion-logo.svg
|
|
1497
|
+
var zImple_solotion_logo_default = 'data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?>%0A<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="0 0 143 143">%0A <!-- Generator: Adobe Illustrator 30.1.0, SVG Export Plug-In . SVG Version: 2.1.1 Build 136) -->%0A <defs>%0A <style>%0A .st0 {%0A fill: %23ef001d;%0A }%0A%0A .st1 {%0A fill: url(%23linear-gradient1);%0A }%0A%0A .st2 {%0A fill: url(%23linear-gradient);%0A }%0A </style>%0A <linearGradient id="linear-gradient" x1="-142.5" y1="180.1" x2="-96.4" y2="180.1" gradientTransform="translate(253.5 -51.1) rotate(30)" gradientUnits="userSpaceOnUse">%0A <stop offset="0" stop-color="%23f0562f"/>%0A <stop offset="0" stop-color="%23ef542e"/>%0A <stop offset=".5" stop-color="%23ef2625"/>%0A <stop offset=".8" stop-color="%23ef0a1f"/>%0A <stop offset="1" stop-color="%23ef001d"/>%0A </linearGradient>%0A <linearGradient id="linear-gradient1" x1="-56.8" y1="214.2" x2="-113.8" y2="214.2" xlink:href="%23linear-gradient"/>%0A </defs>%0A <path class="st0" d="M112.2,91.2c0-2.4-1.3-4.5-3.3-5.7l-14.8-8.5-13.2,7.6,11.5,6.6-20.9,12.1-20.9-12.1,58.3-33.7c2-1.2,3.3-3.4,3.3-5.7,0-2.4-1.3-4.5-3.3-5.7l-34.1-19.7c-2-1.2-4.6-1.2-6.6,0l-34.1,19.7c-2,1.2-3.3,3.4-3.3,5.7s1.3,4.5,3.3,5.7l14.8,8.5,13.2-7.6h0s-11.5-6.6-11.5-6.6l20.9-12.1,20.9,12.1-58.3,33.7c-2,1.2-3.3,3.4-3.3,5.7,0,2.4,1.3,4.5,3.3,5.7l34.1,19.7c2,1.2,4.6,1.2,6.6,0l34.1-19.7c2-1.2,3.3-3.4,3.3-5.7Z"/>%0A <path class="st2" d="M108.9,46.1l-34.1-19.7c-2-1.2-4.6-1.2-6.6,0l-34.1,19.7c-2,1.2-3.3,3.4-3.3,5.7s1.3,4.5,3.3,5.7l14.8,8.5,13.2-7.6h0s-11.5-6.6-11.5-6.6l20.9-12.1,20.9,12.1"/>%0A <path class="st1" d="M34.1,96.9l34.1,19.7c2,1.2,4.6,1.2,6.6,0l34.1-19.7c2-1.2,3.3-3.4,3.3-5.7s-1.3-4.5-3.3-5.7l-14.8-8.5-13.2,7.6h0s11.5,6.6,11.5,6.6l-20.9,12.1-20.9-12.1"/>%0A</svg>';
|
|
1498
|
+
|
|
1646
1499
|
// src/components/message/index.tsx
|
|
1647
|
-
import { jsx as
|
|
1500
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1648
1501
|
var MessageBubble = ({ message, handleClick, focus }) => {
|
|
1649
1502
|
if (message.type === "USER_TEXT" /* USER_TEXT */) {
|
|
1650
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ jsx14(MessageText, { message: message.text, role: "user" /* USER */ });
|
|
1651
1504
|
}
|
|
1652
1505
|
if (message.type === "BOT_TEXT" /* BOT_TEXT */) {
|
|
1653
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ jsx14(BotMessageWrapper, { children: /* @__PURE__ */ jsx14(MessageText, { message: message.text, role: "bot" /* BOT */, focus }) });
|
|
1654
1507
|
}
|
|
1655
1508
|
if (message.type === "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */ || message.type === "BOT_QUICK_MENUS" /* BOT_QUICK_MENUS */ || message.type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ || message.type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */) {
|
|
1656
|
-
return /* @__PURE__ */
|
|
1509
|
+
return /* @__PURE__ */ jsx14(BotMessageWrapper, { children: /* @__PURE__ */ jsx14(
|
|
1657
1510
|
MessageWithMenus,
|
|
1658
1511
|
{
|
|
1659
1512
|
type: message.type,
|
|
1660
1513
|
message: message.text || "",
|
|
1661
|
-
menus:
|
|
1514
|
+
menus: [],
|
|
1662
1515
|
handleClick,
|
|
1663
1516
|
focus
|
|
1664
1517
|
}
|
|
1665
1518
|
) });
|
|
1666
1519
|
}
|
|
1667
1520
|
if (message.type === "BOT_TEXT_WITH_PRODUCTS" /* BOT_TEXT_WITH_PRODUCTS */) {
|
|
1668
|
-
return /* @__PURE__ */
|
|
1521
|
+
return /* @__PURE__ */ jsx14(BotMessageWrapper, { className: "w-full", children: /* @__PURE__ */ jsx14(
|
|
1669
1522
|
MessageWithProducts,
|
|
1670
1523
|
{
|
|
1671
1524
|
type: message.type,
|
|
@@ -1676,10 +1529,10 @@ var MessageBubble = ({ message, handleClick, focus }) => {
|
|
|
1676
1529
|
}
|
|
1677
1530
|
) });
|
|
1678
1531
|
}
|
|
1679
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ jsx14(BotMessageWrapper, { children: /* @__PURE__ */ jsx14(MessageText, { message: message.text, role: "bot" /* BOT */, focus }) });
|
|
1680
1533
|
};
|
|
1681
1534
|
var MessageText = ({ role, message, focus, className }) => {
|
|
1682
|
-
return /* @__PURE__ */
|
|
1535
|
+
return /* @__PURE__ */ jsx14(
|
|
1683
1536
|
Container,
|
|
1684
1537
|
{
|
|
1685
1538
|
className: cn(
|
|
@@ -1696,7 +1549,7 @@ var MessageText = ({ role, message, focus, className }) => {
|
|
|
1696
1549
|
);
|
|
1697
1550
|
};
|
|
1698
1551
|
var MessageWithMenus = ({ type, message, menus, className, handleClick, focus }) => {
|
|
1699
|
-
return /* @__PURE__ */
|
|
1552
|
+
return /* @__PURE__ */ jsxs10(
|
|
1700
1553
|
Container,
|
|
1701
1554
|
{
|
|
1702
1555
|
className: cn(
|
|
@@ -1708,10 +1561,10 @@ var MessageWithMenus = ({ type, message, menus, className, handleClick, focus })
|
|
|
1708
1561
|
className
|
|
1709
1562
|
),
|
|
1710
1563
|
children: [
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1564
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm mb-4", children: message }),
|
|
1565
|
+
/* @__PURE__ */ jsx14("ul", { className: cn("flex flex-wrap gap-x-1 gap-y-3", { "flex-col": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ }), children: menus == null ? void 0 : menus.map((menu) => {
|
|
1713
1566
|
if (menu == null ? void 0 : menu.phoneNumber) {
|
|
1714
|
-
return /* @__PURE__ */
|
|
1567
|
+
return /* @__PURE__ */ jsx14("li", { className: "w-full ", children: /* @__PURE__ */ jsx14(
|
|
1715
1568
|
"a",
|
|
1716
1569
|
{
|
|
1717
1570
|
href: `tel:+${menu == null ? void 0 : menu.phoneNumber}`,
|
|
@@ -1721,9 +1574,9 @@ var MessageWithMenus = ({ type, message, menus, className, handleClick, focus })
|
|
|
1721
1574
|
) }, menu.id);
|
|
1722
1575
|
}
|
|
1723
1576
|
if (menu == null ? void 0 : menu.url) {
|
|
1724
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ jsx14("li", { className: "w-full min-w-max", children: /* @__PURE__ */ jsx14("a", { href: menu.url, target: "_blank", rel: "noreferrer", className: "border border-orange-300 rounded-3xl px-4 py-2 text-orange-500 text-sm text-center block", children: menu.title }) }, menu.id);
|
|
1725
1578
|
}
|
|
1726
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ jsx14("li", { className: cn("min-w-max ", { "min-w-full": type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */ }), children: /* @__PURE__ */ jsx14(
|
|
1727
1580
|
Button,
|
|
1728
1581
|
{
|
|
1729
1582
|
className: cn({ "w-full": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ || type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */ }),
|
|
@@ -1740,13 +1593,13 @@ var MessageWithMenus = ({ type, message, menus, className, handleClick, focus })
|
|
|
1740
1593
|
};
|
|
1741
1594
|
var MessageWithProducts = ({ message, className, products, focus, handleClick }) => {
|
|
1742
1595
|
const { chatControls } = useChatContext();
|
|
1743
|
-
return /* @__PURE__ */
|
|
1744
|
-
message && /* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ jsxs10("div", { className: cn("w-full", className), children: [
|
|
1597
|
+
message && /* @__PURE__ */ jsx14(MessageText, { message, role: "bot" /* BOT */, className: "mb-4", focus }),
|
|
1598
|
+
/* @__PURE__ */ jsx14("div", { className: "pl-4", children: /* @__PURE__ */ jsx14(
|
|
1746
1599
|
"ul",
|
|
1747
1600
|
{
|
|
1748
1601
|
className: "flex gap-3 lg:gap-x-2 overflow-x-auto scrollbar-hide -mx-4 snap-x snap-mandatory",
|
|
1749
|
-
children: products == null ? void 0 : products.map((product) => /* @__PURE__ */
|
|
1602
|
+
children: products == null ? void 0 : products.map((product) => /* @__PURE__ */ jsx14(
|
|
1750
1603
|
"li",
|
|
1751
1604
|
{
|
|
1752
1605
|
className: cn(
|
|
@@ -1761,7 +1614,7 @@ var MessageWithProducts = ({ message, className, products, focus, handleClick })
|
|
|
1761
1614
|
"lg:w-[calc(100%/4.6)] lg:max-w-[calc(100%/4.6)]": chatControls.isExpanded
|
|
1762
1615
|
}
|
|
1763
1616
|
),
|
|
1764
|
-
children: /* @__PURE__ */
|
|
1617
|
+
children: /* @__PURE__ */ jsx14(ProductPreviewCard, { product })
|
|
1765
1618
|
},
|
|
1766
1619
|
product.product_id
|
|
1767
1620
|
))
|
|
@@ -1769,19 +1622,19 @@ var MessageWithProducts = ({ message, className, products, focus, handleClick })
|
|
|
1769
1622
|
) })
|
|
1770
1623
|
] });
|
|
1771
1624
|
};
|
|
1772
|
-
var BotMessageWrapper = ({ children, className }) => /* @__PURE__ */
|
|
1773
|
-
/* @__PURE__ */
|
|
1625
|
+
var BotMessageWrapper = ({ children, className }) => /* @__PURE__ */ jsxs10("div", { className: cn("flex flex-col items-start w-full", className), children: [
|
|
1626
|
+
/* @__PURE__ */ jsx14("img", { className: "w-8 h-8 mb-2", src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" }),
|
|
1774
1627
|
children
|
|
1775
1628
|
] });
|
|
1776
1629
|
|
|
1777
1630
|
// src/components/quick-menus.tsx
|
|
1778
|
-
import { jsx as
|
|
1631
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1779
1632
|
var QuickMenus = ({ bannerSrc, message = "welcome message", menus, handleClick }) => {
|
|
1780
|
-
return /* @__PURE__ */
|
|
1781
|
-
bannerSrc ? /* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1633
|
+
return /* @__PURE__ */ jsxs11("section", { className: "w-75.5 bg-white shadow rounded-3xl overflow-hidden", children: [
|
|
1634
|
+
bannerSrc ? /* @__PURE__ */ jsx15("img", { src: bannerSrc, alt: "banner" }) : /* @__PURE__ */ jsx15("div", { className: "w-75.5 h-29.5 border-b border-gray-200" }),
|
|
1635
|
+
/* @__PURE__ */ jsxs11("div", { className: "p-3 flex flex-col gap-y-3", children: [
|
|
1636
|
+
/* @__PURE__ */ jsx15("p", { className: "text-sm ", children: message }),
|
|
1637
|
+
/* @__PURE__ */ jsx15("ul", { className: "flex gap-3 flex-wrap", children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ jsx15("li", { children: /* @__PURE__ */ jsx15(Button, { onClick: () => {
|
|
1785
1638
|
handleClick(menu);
|
|
1786
1639
|
}, children: menu.title }) }, menu.id)) })
|
|
1787
1640
|
] })
|
|
@@ -1789,19 +1642,19 @@ var QuickMenus = ({ bannerSrc, message = "welcome message", menus, handleClick }
|
|
|
1789
1642
|
};
|
|
1790
1643
|
|
|
1791
1644
|
// src/components/quick-menus-chip.tsx
|
|
1792
|
-
import { jsx as
|
|
1645
|
+
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1793
1646
|
var QuickMenuChips = ({ menus, handleClick, className }) => {
|
|
1794
1647
|
const { chatControls } = useChatContext();
|
|
1795
|
-
return /* @__PURE__ */
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
|
|
1649
|
+
/* @__PURE__ */ jsx16("div", { className: "absolute lg:hidden right-0 top-0 bottom-0 w-8 bg-linear-to-l from-white to-transparent pointer-events-none z-10" }),
|
|
1650
|
+
/* @__PURE__ */ jsx16("ul", { className: cn(
|
|
1798
1651
|
"flex gap-3 overflow-x-scroll scrollbar-hide pr-10",
|
|
1799
1652
|
{
|
|
1800
1653
|
"lg:flex-wrap lg:max-h-28": !chatControls.isExpanded,
|
|
1801
1654
|
"h-14": chatControls.isExpanded
|
|
1802
1655
|
},
|
|
1803
1656
|
className
|
|
1804
|
-
), children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */
|
|
1657
|
+
), children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ jsx16("li", { children: /* @__PURE__ */ jsx16(
|
|
1805
1658
|
Button,
|
|
1806
1659
|
{
|
|
1807
1660
|
onClick: () => {
|
|
@@ -1816,21 +1669,21 @@ var QuickMenuChips = ({ menus, handleClick, className }) => {
|
|
|
1816
1669
|
var quick_menus_chip_default = QuickMenuChips;
|
|
1817
1670
|
|
|
1818
1671
|
// src/components/aizu-chat.tsx
|
|
1819
|
-
import { Fragment, jsx as
|
|
1672
|
+
import { Fragment, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1820
1673
|
var LOADING_TIMEOUT = 15e3;
|
|
1821
1674
|
var AizuChat = ({ aizuClient }) => {
|
|
1822
|
-
return /* @__PURE__ */
|
|
1823
|
-
/* @__PURE__ */
|
|
1824
|
-
/* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ jsx17(AizuClientProvider, { client: aizuClient, children: /* @__PURE__ */ jsx17(ChatProvider, { children: /* @__PURE__ */ jsxs13("div", { children: [
|
|
1676
|
+
/* @__PURE__ */ jsx17(FloatingButton, {}),
|
|
1677
|
+
/* @__PURE__ */ jsxs13(ChatWindow, { children: [
|
|
1678
|
+
/* @__PURE__ */ jsx17(ChatHeader, {}),
|
|
1679
|
+
/* @__PURE__ */ jsx17(ChatBody, {}),
|
|
1680
|
+
/* @__PURE__ */ jsx17(ChatFooter, {})
|
|
1828
1681
|
] })
|
|
1829
1682
|
] }) }) });
|
|
1830
1683
|
};
|
|
1831
1684
|
var FloatingButton = () => {
|
|
1832
1685
|
const { chatControls } = useChatContext();
|
|
1833
|
-
return /* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ jsx17(
|
|
1834
1687
|
"button",
|
|
1835
1688
|
{
|
|
1836
1689
|
type: "button",
|
|
@@ -1842,14 +1695,14 @@ var FloatingButton = () => {
|
|
|
1842
1695
|
}
|
|
1843
1696
|
),
|
|
1844
1697
|
"aria-label": "Toggle chat",
|
|
1845
|
-
children: /* @__PURE__ */
|
|
1698
|
+
children: /* @__PURE__ */ jsx17("img", { src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" })
|
|
1846
1699
|
}
|
|
1847
1700
|
);
|
|
1848
1701
|
};
|
|
1849
1702
|
var ChatWindow = ({ children }) => {
|
|
1850
1703
|
const { chatControls } = useChatContext();
|
|
1851
|
-
return /* @__PURE__ */
|
|
1852
|
-
chatControls.isExpanded && /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ jsxs13(Fragment, { children: [
|
|
1705
|
+
chatControls.isExpanded && /* @__PURE__ */ jsx17(
|
|
1853
1706
|
"div",
|
|
1854
1707
|
{
|
|
1855
1708
|
className: "fixed inset-0 bg-black/50 z-9998 transition-opacity duration-300",
|
|
@@ -1858,7 +1711,7 @@ var ChatWindow = ({ children }) => {
|
|
|
1858
1711
|
"aria-hidden": "true"
|
|
1859
1712
|
}
|
|
1860
1713
|
),
|
|
1861
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ jsx17(
|
|
1862
1715
|
"div",
|
|
1863
1716
|
{
|
|
1864
1717
|
className: cn(
|
|
@@ -1882,42 +1735,42 @@ var ChatWindow = ({ children }) => {
|
|
|
1882
1735
|
};
|
|
1883
1736
|
var ChatHeader = () => {
|
|
1884
1737
|
const { chatControls } = useChatContext();
|
|
1885
|
-
return /* @__PURE__ */
|
|
1886
|
-
/* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ jsxs13("section", { className: "flex justify-between items-center bg-white py-3 px-4", children: [
|
|
1739
|
+
/* @__PURE__ */ jsxs13(
|
|
1887
1740
|
"button",
|
|
1888
1741
|
{
|
|
1889
1742
|
type: "button",
|
|
1890
1743
|
onClick: chatControls.closeChat,
|
|
1891
1744
|
className: "text-sm text-left cursor-pointer flex flex-1 lg:invisible",
|
|
1892
1745
|
children: [
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ jsx17(IconChevronLeft, {}),
|
|
1747
|
+
/* @__PURE__ */ jsx17("span", { children: "\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A" })
|
|
1895
1748
|
]
|
|
1896
1749
|
}
|
|
1897
1750
|
),
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-col items-center flex-1 ", children: [
|
|
1752
|
+
/* @__PURE__ */ jsx17("span", { className: "text-nowrap", children: "ZIMCRAFT STORE" }),
|
|
1753
|
+
/* @__PURE__ */ jsx17("span", { className: "text-[10px] text-[#7C7C7C]", children: "Powered by Zimpligital" })
|
|
1901
1754
|
] }),
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex-1 flex items-center justify-end gap-2 invisible lg:visible", children: [
|
|
1756
|
+
/* @__PURE__ */ jsx17(
|
|
1904
1757
|
"button",
|
|
1905
1758
|
{
|
|
1906
1759
|
type: "button",
|
|
1907
1760
|
"aria-label": "Expand chat",
|
|
1908
1761
|
onClick: chatControls.toggleExpand,
|
|
1909
1762
|
className: "text-sm p-2.5 cursor-pointer",
|
|
1910
|
-
children: chatControls.isExpanded ? /* @__PURE__ */
|
|
1763
|
+
children: chatControls.isExpanded ? /* @__PURE__ */ jsx17(IconMinimize, { className: "hover:text-orange-500" }) : /* @__PURE__ */ jsx17(IconExpand, { className: "hover:text-orange-500" })
|
|
1911
1764
|
}
|
|
1912
1765
|
),
|
|
1913
|
-
/* @__PURE__ */
|
|
1766
|
+
/* @__PURE__ */ jsx17(
|
|
1914
1767
|
"button",
|
|
1915
1768
|
{
|
|
1916
1769
|
type: "button",
|
|
1917
1770
|
"aria-label": "Close chat",
|
|
1918
1771
|
onClick: chatControls.closeChat,
|
|
1919
1772
|
className: "text-sm p-2.5 cursor-pointer",
|
|
1920
|
-
children: /* @__PURE__ */
|
|
1773
|
+
children: /* @__PURE__ */ jsx17(IconXClose, { className: "hover:text-orange-500" })
|
|
1921
1774
|
}
|
|
1922
1775
|
)
|
|
1923
1776
|
] })
|
|
@@ -1956,10 +1809,10 @@ var ChatBody = () => {
|
|
|
1956
1809
|
if (timer) clearTimeout(timer);
|
|
1957
1810
|
};
|
|
1958
1811
|
}, [isLoading]);
|
|
1959
|
-
return /* @__PURE__ */
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
/* @__PURE__ */
|
|
1962
|
-
/* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ jsx17("section", { className: "flex-1 overflow-y-auto relative scrollbar-hide", children: /* @__PURE__ */ jsxs13("section", { className: " p-4 flex flex-col gap-y-3 overflow-y-auto min-h-full", children: [
|
|
1813
|
+
/* @__PURE__ */ jsxs13("div", { children: [
|
|
1814
|
+
/* @__PURE__ */ jsx17("img", { className: "w-8 h-8 mb-2", src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" }),
|
|
1815
|
+
/* @__PURE__ */ jsx17(
|
|
1963
1816
|
QuickMenus,
|
|
1964
1817
|
{
|
|
1965
1818
|
bannerSrc: defaultBanner,
|
|
@@ -1970,14 +1823,14 @@ var ChatBody = () => {
|
|
|
1970
1823
|
)
|
|
1971
1824
|
] }),
|
|
1972
1825
|
messagesDisplay == null ? void 0 : messagesDisplay.map((message, index) => {
|
|
1973
|
-
return /* @__PURE__ */
|
|
1826
|
+
return /* @__PURE__ */ jsx17("div", { className: "w-full flex flex-col items-start", children: /* @__PURE__ */ jsx17(MessageBubble, { message, handleClick: handleClickMenu, focus: messagesDisplay.length - 1 === index }) }, message.id);
|
|
1974
1827
|
}),
|
|
1975
|
-
isLoading && /* @__PURE__ */
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
/* @__PURE__ */
|
|
1828
|
+
isLoading && /* @__PURE__ */ jsxs13("div", { children: [
|
|
1829
|
+
/* @__PURE__ */ jsx17("img", { className: "w-8 h-8 mb-2", src: zImple_solotion_logo_default, alt: "Zimple Solution Logo" }),
|
|
1830
|
+
/* @__PURE__ */ jsx17(Loading, { message: loadingMessage })
|
|
1978
1831
|
] }),
|
|
1979
|
-
/* @__PURE__ */
|
|
1980
|
-
displayWelcomeMessage && /* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsx17("div", { ref: messagesEndRef }),
|
|
1833
|
+
displayWelcomeMessage && /* @__PURE__ */ jsx17("div", { className: "mt-auto text-center text-sm text-gray-500", children: "\u0E04\u0E38\u0E13\u0E01\u0E33\u0E25\u0E31\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E2A\u0E19\u0E17\u0E19\u0E32\u0E01\u0E31\u0E1A ZIMCRAFT AI" })
|
|
1981
1834
|
] }) });
|
|
1982
1835
|
};
|
|
1983
1836
|
var ChatFooter = () => {
|
|
@@ -1991,11 +1844,11 @@ var ChatFooter = () => {
|
|
|
1991
1844
|
isLoading,
|
|
1992
1845
|
setIsLoading
|
|
1993
1846
|
});
|
|
1994
|
-
return /* @__PURE__ */
|
|
1847
|
+
return /* @__PURE__ */ jsxs13("section", { className: cn(
|
|
1995
1848
|
"bg-white min:h-42.5 lg:h-auto",
|
|
1996
1849
|
{ "lg:h-auto": chatControls.isExpanded }
|
|
1997
1850
|
), children: [
|
|
1998
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ jsx17(
|
|
1999
1852
|
quick_menus_chip_default,
|
|
2000
1853
|
{
|
|
2001
1854
|
handleClick: handleClickMenu,
|
|
@@ -2003,7 +1856,7 @@ var ChatFooter = () => {
|
|
|
2003
1856
|
className: "pl-4 pt-4 pb-2"
|
|
2004
1857
|
}
|
|
2005
1858
|
),
|
|
2006
|
-
/* @__PURE__ */
|
|
1859
|
+
/* @__PURE__ */ jsx17(
|
|
2007
1860
|
InputBar,
|
|
2008
1861
|
{
|
|
2009
1862
|
placeholder: "\u0E16\u0E32\u0E21\u0E04\u0E33\u0E16\u0E32\u0E21\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22...",
|
|
@@ -2019,9 +1872,9 @@ var ChatFooter = () => {
|
|
|
2019
1872
|
|
|
2020
1873
|
// src/components/test-component.tsx
|
|
2021
1874
|
import { useState as useState6 } from "react";
|
|
2022
|
-
import { jsx as
|
|
1875
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2023
1876
|
var TestComponent = ({ client }) => {
|
|
2024
|
-
return /* @__PURE__ */
|
|
1877
|
+
return /* @__PURE__ */ jsx18(AizuClientProvider, { client, children: /* @__PURE__ */ jsx18(TestComponentContent, {}) });
|
|
2025
1878
|
};
|
|
2026
1879
|
var TestComponentContent = () => {
|
|
2027
1880
|
const {
|
|
@@ -2064,10 +1917,10 @@ var TestComponentContent = () => {
|
|
|
2064
1917
|
setResponse("\u26A0\uFE0F Request cancelled by user");
|
|
2065
1918
|
console.log("\u{1F6D1} Request cancelled");
|
|
2066
1919
|
};
|
|
2067
|
-
return /* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ jsxs14("div", { className: "border-2 border-blue-500 p-4 rounded space-y-4", children: [
|
|
1921
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between items-center", children: [
|
|
1922
|
+
/* @__PURE__ */ jsx18("h2", { className: "font-bold text-xl", children: "Test API Call" }),
|
|
1923
|
+
/* @__PURE__ */ jsx18(
|
|
2071
1924
|
"button",
|
|
2072
1925
|
{
|
|
2073
1926
|
type: "button",
|
|
@@ -2078,18 +1931,18 @@ var TestComponentContent = () => {
|
|
|
2078
1931
|
}
|
|
2079
1932
|
)
|
|
2080
1933
|
] }),
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ jsxs14("div", { className: "text-sm space-y-1", children: [
|
|
1935
|
+
/* @__PURE__ */ jsxs14("p", { className: threadId ? "text-green-600" : "text-gray-400", children: [
|
|
2083
1936
|
"\u{1F517} Thread ID: ",
|
|
2084
1937
|
threadId || "(waiting for first message)"
|
|
2085
1938
|
] }),
|
|
2086
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ jsxs14("p", { className: resourceId ? "text-green-600" : "text-gray-400", children: [
|
|
2087
1940
|
"\u{1F4E6} Resource ID: ",
|
|
2088
1941
|
resourceId || "(waiting for first message)"
|
|
2089
1942
|
] })
|
|
2090
1943
|
] }),
|
|
2091
|
-
/* @__PURE__ */
|
|
2092
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex gap-2", children: [
|
|
1945
|
+
/* @__PURE__ */ jsx18(
|
|
2093
1946
|
"input",
|
|
2094
1947
|
{
|
|
2095
1948
|
type: "text",
|
|
@@ -2101,7 +1954,7 @@ var TestComponentContent = () => {
|
|
|
2101
1954
|
disabled: loading
|
|
2102
1955
|
}
|
|
2103
1956
|
),
|
|
2104
|
-
loading ? /* @__PURE__ */
|
|
1957
|
+
loading ? /* @__PURE__ */ jsx18(
|
|
2105
1958
|
"button",
|
|
2106
1959
|
{
|
|
2107
1960
|
type: "button",
|
|
@@ -2109,7 +1962,7 @@ var TestComponentContent = () => {
|
|
|
2109
1962
|
className: "bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600 min-w-[100px]",
|
|
2110
1963
|
children: "\u23F9 Cancel"
|
|
2111
1964
|
}
|
|
2112
|
-
) : /* @__PURE__ */
|
|
1965
|
+
) : /* @__PURE__ */ jsx18(
|
|
2113
1966
|
"button",
|
|
2114
1967
|
{
|
|
2115
1968
|
type: "button",
|
|
@@ -2120,13 +1973,13 @@ var TestComponentContent = () => {
|
|
|
2120
1973
|
}
|
|
2121
1974
|
)
|
|
2122
1975
|
] }),
|
|
2123
|
-
response && /* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
1976
|
+
response && /* @__PURE__ */ jsxs14("div", { className: "p-3 bg-gray-100 rounded", children: [
|
|
1977
|
+
/* @__PURE__ */ jsx18("strong", { className: "text-gray-700", children: "Response:" }),
|
|
1978
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-1 whitespace-pre-wrap text-gray-900", children: response })
|
|
2126
1979
|
] }),
|
|
2127
|
-
!threadId && /* @__PURE__ */
|
|
1980
|
+
!threadId && /* @__PURE__ */ jsxs14("div", { className: "text-xs text-gray-500 border-t pt-2 mt-2", children: [
|
|
2128
1981
|
"\u{1F4A1} ",
|
|
2129
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ jsx18("strong", { children: "Tip:" }),
|
|
2130
1983
|
" Send your first message to start a conversation. The thread ID will be saved and persist across page refreshes."
|
|
2131
1984
|
] })
|
|
2132
1985
|
] });
|