@instockng/storefront-ui 1.0.111 → 1.0.112
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 +28 -8
- package/dist/index101.mjs +8 -74
- package/dist/index102.mjs +74 -3
- package/dist/index103.mjs +4 -2
- package/dist/index104.mjs +2 -83
- package/dist/index105.mjs +81 -52
- package/dist/index106.mjs +53 -5
- package/dist/index107.mjs +5 -4
- package/dist/index108.mjs +4 -178
- package/dist/index109.mjs +174 -48
- package/dist/index110.mjs +51 -67
- package/dist/index111.mjs +69 -37
- package/dist/index112.mjs +34 -40
- package/dist/index113.mjs +43 -2
- package/dist/index153.mjs +2 -2
- package/dist/index154.mjs +1 -1
- package/dist/index155.mjs +6 -6
- package/dist/index156.mjs +2 -2
- package/dist/index157.mjs +2 -2
- package/dist/index159.mjs +2 -2
- package/dist/index160.mjs +2 -2
- package/dist/index161.mjs +1 -1
- package/dist/index163.mjs +8 -8
- package/dist/index164.mjs +8 -8
- package/dist/index169.mjs +1 -1
- package/dist/index170.mjs +1 -1
- package/dist/index171.mjs +1 -1
- package/dist/index172.mjs +1 -1
- package/dist/index173.mjs +1 -1
- package/dist/index175.mjs +1 -1
- 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/index188.mjs +2 -2
- package/dist/index189.mjs +5 -5
- package/dist/index192.mjs +1 -1
- package/dist/index195.mjs +1 -1
- package/dist/index198.mjs +1 -1
- package/dist/index199.mjs +1 -1
- package/dist/index203.mjs +1 -1
- package/dist/index205.mjs +1 -1
- package/dist/index209.mjs +1 -1
- package/dist/index211.mjs +1 -1
- package/dist/index22.mjs +73 -69
- package/dist/index220.mjs +2 -2
- package/dist/index222.mjs +1 -1
- package/dist/index223.mjs +1 -1
- package/dist/index224.mjs +2 -31
- package/dist/index225.mjs +2 -11
- package/dist/index226.mjs +2 -4
- package/dist/index227.mjs +2 -4
- package/dist/index228.mjs +2 -13
- package/dist/index229.mjs +2 -7
- package/dist/index230.mjs +107 -11
- package/dist/index231.mjs +2 -5
- package/dist/index232.mjs +2 -33
- package/dist/index233.mjs +2 -31
- package/dist/index234.mjs +2 -28
- package/dist/index235.mjs +34 -58
- package/dist/index236.mjs +2 -2
- package/dist/index237.mjs +244 -2
- package/dist/index238.mjs +2 -2
- package/dist/index239.mjs +33 -2
- package/dist/index240.mjs +65 -2
- package/dist/index241.mjs +25 -2
- package/dist/index242.mjs +2 -2
- package/dist/index243.mjs +2 -2
- package/dist/index244.mjs +2 -108
- package/dist/index245.mjs +2 -2
- package/dist/index246.mjs +2 -2
- package/dist/index247.mjs +2 -37
- package/dist/index248.mjs +2 -2
- package/dist/index249.mjs +2 -2
- package/dist/index250.mjs +2 -2
- package/dist/index251.mjs +2 -244
- package/dist/index253.mjs +30 -32
- package/dist/index254.mjs +10 -64
- package/dist/index255.mjs +3 -24
- package/dist/index256.mjs +4 -2
- package/dist/index257.mjs +2 -2
- package/dist/index258.mjs +4 -2
- package/dist/index259.mjs +13 -2
- package/dist/index260.mjs +7 -2
- package/dist/index261.mjs +12 -2
- package/dist/index262.mjs +5 -2
- package/dist/index263.mjs +33 -2
- package/dist/index264.mjs +31 -4
- package/dist/index265.mjs +28 -2
- package/dist/index266.mjs +61 -2
- package/dist/index267.mjs +2 -2
- package/dist/index268.mjs +2 -18
- package/dist/index269.mjs +13 -42
- package/dist/index270.mjs +47 -2
- package/dist/index276.mjs +1 -2
- package/dist/index277.mjs +3 -2
- package/dist/index278.mjs +2 -2
- package/dist/index279.mjs +2 -2
- package/dist/index283.mjs +1 -1
- 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/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/index82.mjs +22 -4
- package/dist/index83.mjs +73 -21
- package/dist/index84.mjs +14 -74
- package/dist/index85.mjs +62 -14
- package/dist/index86.mjs +4 -62
- package/dist/index94.mjs +2 -235
- package/dist/index95.mjs +233 -4
- package/dist/index96.mjs +5 -133
- package/dist/index97.mjs +129 -63
- package/dist/index98.mjs +67 -86
- package/dist/index99.mjs +85 -27
- package/package.json +1 -1
- package/src/components/AssistantDrawer.tsx +3 -1
package/dist/index22.mjs
CHANGED
|
@@ -1,39 +1,43 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as m, useRef as b, useCallback as
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useState as m, useRef as b, useCallback as B, useEffect as v } from "react";
|
|
4
|
+
import { createPortal as Z } from "react-dom";
|
|
5
5
|
import { Sparkles as Q, X as ee, MessageCircle as te, Loader2 as re, Send as se } from "lucide-react";
|
|
6
6
|
import { cn as k, formatCurrency as ne, WHATSAPP_HELP_LINK as ae } from "./index30.mjs";
|
|
7
7
|
import { useHideBodyOverflow as oe } from "./index53.mjs";
|
|
8
8
|
function fe({
|
|
9
9
|
isOpen: c,
|
|
10
10
|
onClose: x,
|
|
11
|
-
apiUrl:
|
|
11
|
+
apiUrl: P,
|
|
12
12
|
brandSlug: R,
|
|
13
|
-
productSlug:
|
|
13
|
+
productSlug: j,
|
|
14
14
|
initialQuestion: y,
|
|
15
|
-
assistantName:
|
|
16
|
-
className:
|
|
17
|
-
disablePortal:
|
|
15
|
+
assistantName: I = "AI Assistant",
|
|
16
|
+
className: K,
|
|
17
|
+
disablePortal: O = !1
|
|
18
18
|
}) {
|
|
19
|
-
const [u, d] = m([]), [w, S] = m(""), [f, L] = m(!1), [W, h] = m(null), [$, D] = m(!1), [
|
|
20
|
-
|
|
21
|
-
const
|
|
19
|
+
const [u, d] = m([]), [w, S] = m(""), [f, L] = m(!1), [W, h] = m(null), [$, D] = m(!1), [V, _] = m(!1), H = b(null), J = b(null), A = b(!1), M = b([]);
|
|
20
|
+
M.current = u, oe(c);
|
|
21
|
+
const U = B((e, l) => {
|
|
22
22
|
if (e === "token")
|
|
23
23
|
d((s) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const i = [...s], t = i[i.length - 1];
|
|
25
|
+
if ((t == null ? void 0 : t.role) === "assistant") {
|
|
26
|
+
const a = (t.content + l).replace(/\n?PRODUCTS:.*$/m, "").replace(/\n?CONTACT_SUPPORT\s*/gi, "");
|
|
27
|
+
i[i.length - 1] = { ...t, content: a };
|
|
28
|
+
}
|
|
29
|
+
return i;
|
|
26
30
|
});
|
|
27
31
|
else if (e === "done")
|
|
28
32
|
try {
|
|
29
|
-
const s = JSON.parse(
|
|
30
|
-
d((
|
|
31
|
-
var
|
|
32
|
-
const t = [...
|
|
33
|
+
const s = JSON.parse(l);
|
|
34
|
+
d((i) => {
|
|
35
|
+
var a;
|
|
36
|
+
const t = [...i], n = t[t.length - 1];
|
|
33
37
|
return (n == null ? void 0 : n.role) === "assistant" && (t[t.length - 1] = {
|
|
34
38
|
...n,
|
|
35
39
|
content: s.answer || n.content,
|
|
36
|
-
products: ((
|
|
40
|
+
products: ((a = s.products) == null ? void 0 : a.length) > 0 ? s.products : void 0,
|
|
37
41
|
whatsapp: s.whatsapp || !1
|
|
38
42
|
}), t;
|
|
39
43
|
});
|
|
@@ -41,75 +45,75 @@ function fe({
|
|
|
41
45
|
}
|
|
42
46
|
else if (e === "error")
|
|
43
47
|
try {
|
|
44
|
-
const s = JSON.parse(
|
|
48
|
+
const s = JSON.parse(l);
|
|
45
49
|
h(s.message || "An error occurred");
|
|
46
50
|
} catch {
|
|
47
51
|
h("An error occurred");
|
|
48
52
|
}
|
|
49
|
-
}, []), N = b(null),
|
|
53
|
+
}, []), N = b(null), q = B(
|
|
50
54
|
async (e) => {
|
|
51
|
-
var
|
|
55
|
+
var i;
|
|
52
56
|
if (!e.trim()) return;
|
|
53
57
|
h(null);
|
|
54
|
-
const
|
|
58
|
+
const l = { role: "user", content: e }, s = M.current.slice(-20).map((t) => ({
|
|
55
59
|
role: t.role,
|
|
56
60
|
content: t.content
|
|
57
61
|
}));
|
|
58
|
-
d((t) => [...t,
|
|
62
|
+
d((t) => [...t, l]), S(""), L(!0), d((t) => [...t, { role: "assistant", content: "" }]);
|
|
59
63
|
try {
|
|
60
|
-
const t = await fetch(`${
|
|
64
|
+
const t = await fetch(`${P}/v1/assistant/ask`, {
|
|
61
65
|
method: "POST",
|
|
62
66
|
headers: { "Content-Type": "application/json" },
|
|
63
67
|
body: JSON.stringify({
|
|
64
68
|
question: e,
|
|
65
69
|
brandSlug: R,
|
|
66
|
-
productSlug:
|
|
70
|
+
productSlug: j,
|
|
67
71
|
history: s
|
|
68
72
|
})
|
|
69
73
|
});
|
|
70
74
|
if (!t.ok) {
|
|
71
75
|
const p = await t.json().catch(() => ({}));
|
|
72
76
|
throw new Error(
|
|
73
|
-
((
|
|
77
|
+
((i = p == null ? void 0 : p.error) == null ? void 0 : i.message) || `Request failed (${t.status})`
|
|
74
78
|
);
|
|
75
79
|
}
|
|
76
80
|
if (!t.body) throw new Error("No response body");
|
|
77
|
-
const n = t.body.getReader(),
|
|
78
|
-
let E = "",
|
|
81
|
+
const n = t.body.getReader(), a = new TextDecoder();
|
|
82
|
+
let E = "", T = "";
|
|
79
83
|
for (; ; ) {
|
|
80
|
-
const { done: p, value:
|
|
84
|
+
const { done: p, value: G } = await n.read();
|
|
81
85
|
if (p) break;
|
|
82
|
-
E +=
|
|
83
|
-
const
|
|
86
|
+
E += a.decode(G, { stream: !0 });
|
|
87
|
+
const z = E.split(`
|
|
84
88
|
`);
|
|
85
|
-
E =
|
|
86
|
-
for (const g of
|
|
89
|
+
E = z.pop() || "";
|
|
90
|
+
for (const g of z) {
|
|
87
91
|
if (g.trim() === "") {
|
|
88
|
-
|
|
92
|
+
T = "";
|
|
89
93
|
continue;
|
|
90
94
|
}
|
|
91
95
|
if (g.trimStart().startsWith("event:"))
|
|
92
|
-
|
|
96
|
+
T = g.trimStart().slice(6).trim();
|
|
93
97
|
else if (g.trimStart().startsWith("data:")) {
|
|
94
|
-
const
|
|
95
|
-
|
|
98
|
+
const C = g.trimStart().slice(5), Y = C.startsWith(" ") ? C.slice(1) : C;
|
|
99
|
+
U(T || "token", Y);
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
} catch (t) {
|
|
100
104
|
h(t.message || "Something went wrong"), d((n) => {
|
|
101
|
-
const
|
|
102
|
-
return (
|
|
105
|
+
const a = n[n.length - 1];
|
|
106
|
+
return (a == null ? void 0 : a.role) === "assistant" && !a.content ? n.slice(0, -1) : n;
|
|
103
107
|
});
|
|
104
108
|
} finally {
|
|
105
109
|
L(!1);
|
|
106
110
|
}
|
|
107
111
|
},
|
|
108
|
-
[
|
|
112
|
+
[P, R, j, U]
|
|
109
113
|
);
|
|
110
|
-
N.current =
|
|
114
|
+
N.current = q, v(() => {
|
|
111
115
|
if (c)
|
|
112
|
-
|
|
116
|
+
_(!0), requestAnimationFrame(() => {
|
|
113
117
|
requestAnimationFrame(() => {
|
|
114
118
|
D(!0);
|
|
115
119
|
});
|
|
@@ -117,7 +121,7 @@ function fe({
|
|
|
117
121
|
else {
|
|
118
122
|
D(!1);
|
|
119
123
|
const e = setTimeout(() => {
|
|
120
|
-
|
|
124
|
+
_(!1), d([]), S(""), h(null), A.current = !1;
|
|
121
125
|
}, 300);
|
|
122
126
|
return () => clearTimeout(e);
|
|
123
127
|
}
|
|
@@ -127,23 +131,23 @@ function fe({
|
|
|
127
131
|
return (e = N.current) == null ? void 0 : e.call(N, y);
|
|
128
132
|
}, 100) : setTimeout(() => {
|
|
129
133
|
var e;
|
|
130
|
-
return (e =
|
|
134
|
+
return (e = J.current) == null ? void 0 : e.focus();
|
|
131
135
|
}, 350));
|
|
132
136
|
}, [c, y]), v(() => {
|
|
133
137
|
var e;
|
|
134
|
-
(e =
|
|
138
|
+
(e = H.current) == null || e.scrollIntoView({ behavior: "smooth" });
|
|
135
139
|
}, [u]), v(() => {
|
|
136
|
-
const e = (
|
|
137
|
-
|
|
140
|
+
const e = (l) => {
|
|
141
|
+
l.key === "Escape" && c && x();
|
|
138
142
|
};
|
|
139
143
|
if (c)
|
|
140
144
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
141
145
|
}, [c, x]);
|
|
142
|
-
const
|
|
143
|
-
e.preventDefault(), w.trim() &&
|
|
146
|
+
const X = (e) => {
|
|
147
|
+
e.preventDefault(), w.trim() && q(w.trim());
|
|
144
148
|
};
|
|
145
|
-
if (!
|
|
146
|
-
const
|
|
149
|
+
if (!V) return null;
|
|
150
|
+
const F = /* @__PURE__ */ o(
|
|
147
151
|
"div",
|
|
148
152
|
{
|
|
149
153
|
className: k(
|
|
@@ -158,7 +162,7 @@ function fe({
|
|
|
158
162
|
onClick: x
|
|
159
163
|
}
|
|
160
164
|
),
|
|
161
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ o(
|
|
162
166
|
"div",
|
|
163
167
|
{
|
|
164
168
|
className: k(
|
|
@@ -169,13 +173,13 @@ function fe({
|
|
|
169
173
|
"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",
|
|
170
174
|
// Animation
|
|
171
175
|
$ ? "translate-y-0 sm:translate-x-0" : "translate-y-full sm:translate-y-0 sm:-translate-x-full",
|
|
172
|
-
|
|
176
|
+
K
|
|
173
177
|
),
|
|
174
178
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-gray-200 px-4 py-3 flex-shrink-0", children: [
|
|
180
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
177
181
|
/* @__PURE__ */ r(Q, { className: "h-5 w-5 text-orange-500" }),
|
|
178
|
-
/* @__PURE__ */ r("span", { className: "font-semibold text-gray-900", children:
|
|
182
|
+
/* @__PURE__ */ r("span", { className: "font-semibold text-gray-900", children: I }),
|
|
179
183
|
/* @__PURE__ */ r("span", { className: "text-xs text-gray-400 bg-gray-100 rounded px-1.5 py-0.5", children: "beta" })
|
|
180
184
|
] }),
|
|
181
185
|
/* @__PURE__ */ r(
|
|
@@ -189,14 +193,14 @@ function fe({
|
|
|
189
193
|
}
|
|
190
194
|
)
|
|
191
195
|
] }),
|
|
192
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto p-4 space-y-4 min-h-0", children: [
|
|
193
197
|
u.length === 0 && !f && /* @__PURE__ */ r("div", { className: "text-center text-gray-400 text-sm py-8", children: "Ask me anything about our products!" }),
|
|
194
|
-
u.map((e,
|
|
195
|
-
/* @__PURE__ */
|
|
198
|
+
u.map((e, l) => /* @__PURE__ */ r("div", { children: e.role === "user" ? /* @__PURE__ */ r("div", { className: "flex justify-end", children: /* @__PURE__ */ r("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__ */ o("div", { className: "space-y-3", children: [
|
|
199
|
+
/* @__PURE__ */ o("div", { className: "text-sm text-gray-800 leading-relaxed whitespace-pre-wrap", children: [
|
|
196
200
|
e.content,
|
|
197
|
-
f &&
|
|
201
|
+
f && l === u.length - 1 && /* @__PURE__ */ r("span", { className: "inline-block w-1.5 h-4 bg-gray-400 animate-pulse ml-0.5 align-text-bottom" })
|
|
198
202
|
] }),
|
|
199
|
-
e.products && e.products.length > 0 && /* @__PURE__ */ r("div", { className: "space-y-2", children: e.products.map((s) => /* @__PURE__ */
|
|
203
|
+
e.products && e.products.length > 0 && /* @__PURE__ */ r("div", { className: "space-y-2", children: e.products.map((s) => /* @__PURE__ */ o(
|
|
200
204
|
"a",
|
|
201
205
|
{
|
|
202
206
|
href: `/product/${s.slug}`,
|
|
@@ -210,7 +214,7 @@ function fe({
|
|
|
210
214
|
className: "h-16 w-16 rounded-lg object-cover flex-shrink-0"
|
|
211
215
|
}
|
|
212
216
|
) : /* @__PURE__ */ r("div", { className: "h-16 w-16 rounded-lg bg-gray-100 flex-shrink-0" }),
|
|
213
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ o("div", { className: "min-w-0", children: [
|
|
214
218
|
/* @__PURE__ */ r("p", { className: "text-sm font-medium text-gray-900 line-clamp-2", children: s.name }),
|
|
215
219
|
/* @__PURE__ */ r("p", { className: "text-sm font-semibold text-blue-600", children: ne(s.price) })
|
|
216
220
|
] })
|
|
@@ -218,7 +222,7 @@ function fe({
|
|
|
218
222
|
},
|
|
219
223
|
s.slug
|
|
220
224
|
)) }),
|
|
221
|
-
e.whatsapp && /* @__PURE__ */
|
|
225
|
+
e.whatsapp && /* @__PURE__ */ o(
|
|
222
226
|
"a",
|
|
223
227
|
{
|
|
224
228
|
href: ae,
|
|
@@ -231,19 +235,19 @@ function fe({
|
|
|
231
235
|
]
|
|
232
236
|
}
|
|
233
237
|
)
|
|
234
|
-
] }) },
|
|
238
|
+
] }) }, l)),
|
|
235
239
|
W && /* @__PURE__ */ r("div", { className: "rounded-lg bg-red-50 border border-red-200 p-3 text-sm text-red-700", children: W }),
|
|
236
|
-
/* @__PURE__ */ r("div", { ref:
|
|
240
|
+
/* @__PURE__ */ r("div", { ref: H })
|
|
237
241
|
] }),
|
|
238
|
-
/* @__PURE__ */ r("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ r("div", { className: "border-t border-gray-200 p-3 flex-shrink-0", children: /* @__PURE__ */ o("form", { onSubmit: X, className: "flex items-center gap-2", children: [
|
|
239
243
|
/* @__PURE__ */ r(
|
|
240
244
|
"input",
|
|
241
245
|
{
|
|
242
|
-
ref:
|
|
246
|
+
ref: J,
|
|
243
247
|
type: "text",
|
|
244
248
|
value: w,
|
|
245
249
|
onChange: (e) => S(e.target.value),
|
|
246
|
-
placeholder: `Ask ${
|
|
250
|
+
placeholder: `Ask ${I} a question`,
|
|
247
251
|
disabled: f,
|
|
248
252
|
className: k(
|
|
249
253
|
"flex-1 rounded-full border border-gray-300 px-4 py-2.5 text-sm",
|
|
@@ -273,7 +277,7 @@ function fe({
|
|
|
273
277
|
]
|
|
274
278
|
}
|
|
275
279
|
);
|
|
276
|
-
return
|
|
280
|
+
return O ? F : Z(F, document.body);
|
|
277
281
|
}
|
|
278
282
|
export {
|
|
279
283
|
fe as AssistantDrawer
|
package/dist/index220.mjs
CHANGED
package/dist/index222.mjs
CHANGED
package/dist/index223.mjs
CHANGED
package/dist/index224.mjs
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
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("&");
|
|
31
|
-
};
|
|
2
|
+
var t = {};
|
|
32
3
|
export {
|
|
33
|
-
|
|
4
|
+
t as __exports
|
|
34
5
|
};
|
package/dist/index225.mjs
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import m from "./index98.mjs";
|
|
4
|
-
import s from "./index108.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
|
+
var e = { exports: {} };
|
|
12
3
|
export {
|
|
13
|
-
|
|
4
|
+
e as __module
|
|
14
5
|
};
|
package/dist/index226.mjs
CHANGED
package/dist/index227.mjs
CHANGED
package/dist/index228.mjs
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
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
|
+
var e = {};
|
|
14
3
|
export {
|
|
15
|
-
|
|
4
|
+
e as __exports
|
|
16
5
|
};
|
package/dist/index229.mjs
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", r = e && window.location.href || "http://localhost";
|
|
2
|
+
var r = {};
|
|
4
3
|
export {
|
|
5
|
-
|
|
6
|
-
n as hasStandardBrowserEnv,
|
|
7
|
-
t as hasStandardBrowserWebWorkerEnv,
|
|
8
|
-
o as navigator,
|
|
9
|
-
r as origin
|
|
4
|
+
r as __exports
|
|
10
5
|
};
|
package/dist/index230.mjs
CHANGED
|
@@ -1,15 +1,111 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
import { __exports as m } from "./index267.mjs";
|
|
3
|
+
var p;
|
|
4
|
+
function S() {
|
|
5
|
+
return p ? m : (p = 1, function(d) {
|
|
6
|
+
Object.defineProperty(d, "__esModule", {
|
|
7
|
+
value: !0
|
|
8
|
+
});
|
|
9
|
+
function g(o, e) {
|
|
10
|
+
for (var r in e) Object.defineProperty(o, r, {
|
|
11
|
+
enumerable: !0,
|
|
12
|
+
get: e[r]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
g(d, {
|
|
16
|
+
getSortedRouteObjects: function() {
|
|
17
|
+
return w;
|
|
18
|
+
},
|
|
19
|
+
getSortedRoutes: function() {
|
|
20
|
+
return f;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
class h {
|
|
24
|
+
insert(e) {
|
|
25
|
+
this._insert(e.split("/").filter(Boolean), [], !1);
|
|
26
|
+
}
|
|
27
|
+
smoosh() {
|
|
28
|
+
return this._smoosh();
|
|
29
|
+
}
|
|
30
|
+
_smoosh(e) {
|
|
31
|
+
e === void 0 && (e = "/");
|
|
32
|
+
const r = [
|
|
33
|
+
...this.children.keys()
|
|
34
|
+
].sort();
|
|
35
|
+
this.slugName !== null && r.splice(r.indexOf("[]"), 1), this.restSlugName !== null && r.splice(r.indexOf("[...]"), 1), this.optionalRestSlugName !== null && r.splice(r.indexOf("[[...]]"), 1);
|
|
36
|
+
const n = r.map((s) => this.children.get(s)._smoosh("" + e + s + "/")).reduce((s, t) => [
|
|
37
|
+
...s,
|
|
38
|
+
...t
|
|
39
|
+
], []);
|
|
40
|
+
if (this.slugName !== null && n.push(...this.children.get("[]")._smoosh(e + "[" + this.slugName + "]/")), !this.placeholder) {
|
|
41
|
+
const s = e === "/" ? "/" : e.slice(0, -1);
|
|
42
|
+
if (this.optionalRestSlugName != null)
|
|
43
|
+
throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("' + s + '" and "' + s + "[[..." + this.optionalRestSlugName + ']]").');
|
|
44
|
+
n.unshift(s);
|
|
45
|
+
}
|
|
46
|
+
return this.restSlugName !== null && n.push(...this.children.get("[...]")._smoosh(e + "[..." + this.restSlugName + "]/")), this.optionalRestSlugName !== null && n.push(...this.children.get("[[...]]")._smoosh(e + "[[..." + this.optionalRestSlugName + "]]/")), n;
|
|
47
|
+
}
|
|
48
|
+
_insert(e, r, n) {
|
|
49
|
+
if (e.length === 0) {
|
|
50
|
+
this.placeholder = !1;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (n)
|
|
54
|
+
throw new Error("Catch-all must be the last part of the URL.");
|
|
55
|
+
let s = e[0];
|
|
56
|
+
if (s.startsWith("[") && s.endsWith("]")) {
|
|
57
|
+
let l = function(u, a) {
|
|
58
|
+
if (u !== null && u !== a)
|
|
59
|
+
throw new Error("You cannot use different slug names for the same dynamic path ('" + u + "' !== '" + a + "').");
|
|
60
|
+
r.forEach((c) => {
|
|
61
|
+
if (c === a)
|
|
62
|
+
throw new Error('You cannot have the same slug name "' + a + '" repeat within a single dynamic path');
|
|
63
|
+
if (c.replace(/\W/g, "") === s.replace(/\W/g, ""))
|
|
64
|
+
throw new Error('You cannot have the slug names "' + c + '" and "' + a + '" differ only by non-word symbols within a single dynamic path');
|
|
65
|
+
}), r.push(a);
|
|
66
|
+
}, t = s.slice(1, -1), i = !1;
|
|
67
|
+
if (t.startsWith("[") && t.endsWith("]") && (t = t.slice(1, -1), i = !0), t.startsWith("…"))
|
|
68
|
+
throw new Error("Detected a three-dot character ('…') at ('" + t + "'). Did you mean ('...')?");
|
|
69
|
+
if (t.startsWith("...") && (t = t.substring(3), n = !0), t.startsWith("[") || t.endsWith("]"))
|
|
70
|
+
throw new Error("Segment names may not start or end with extra brackets ('" + t + "').");
|
|
71
|
+
if (t.startsWith("."))
|
|
72
|
+
throw new Error("Segment names may not start with erroneous periods ('" + t + "').");
|
|
73
|
+
if (n)
|
|
74
|
+
if (i) {
|
|
75
|
+
if (this.restSlugName != null)
|
|
76
|
+
throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...' + this.restSlugName + ']" and "' + e[0] + '" ).');
|
|
77
|
+
l(this.optionalRestSlugName, t), this.optionalRestSlugName = t, s = "[[...]]";
|
|
78
|
+
} else {
|
|
79
|
+
if (this.optionalRestSlugName != null)
|
|
80
|
+
throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...' + this.optionalRestSlugName + ']]" and "' + e[0] + '").');
|
|
81
|
+
l(this.restSlugName, t), this.restSlugName = t, s = "[...]";
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
if (i)
|
|
85
|
+
throw new Error('Optional route parameters are not yet supported ("' + e[0] + '").');
|
|
86
|
+
l(this.slugName, t), this.slugName = t, s = "[]";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
this.children.has(s) || this.children.set(s, new h()), this.children.get(s)._insert(e.slice(1), r, n);
|
|
90
|
+
}
|
|
91
|
+
constructor() {
|
|
92
|
+
this.placeholder = !0, this.children = /* @__PURE__ */ new Map(), this.slugName = null, this.restSlugName = null, this.optionalRestSlugName = null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function f(o) {
|
|
96
|
+
const e = new h();
|
|
97
|
+
return o.forEach((r) => e.insert(r)), e.smoosh();
|
|
98
|
+
}
|
|
99
|
+
function w(o, e) {
|
|
100
|
+
const r = {}, n = [];
|
|
101
|
+
for (let t = 0; t < o.length; t++) {
|
|
102
|
+
const i = e(o[t]);
|
|
103
|
+
r[i] = t, n[t] = i;
|
|
104
|
+
}
|
|
105
|
+
return f(n).map((t) => o[r[t]]);
|
|
106
|
+
}
|
|
107
|
+
}(m), m);
|
|
12
108
|
}
|
|
13
109
|
export {
|
|
14
|
-
|
|
110
|
+
S as __require
|
|
15
111
|
};
|
package/dist/index231.mjs
CHANGED
package/dist/index232.mjs
CHANGED
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import m from "./index281.mjs";
|
|
4
|
-
import f from "./index94.mjs";
|
|
5
|
-
const h = (t, o, a = 3) => {
|
|
6
|
-
let r = 0;
|
|
7
|
-
const c = i(50, 250);
|
|
8
|
-
return m((s) => {
|
|
9
|
-
const n = s.loaded, e = s.lengthComputable ? s.total : void 0, l = n - r, d = c(l), p = n <= e;
|
|
10
|
-
r = n;
|
|
11
|
-
const u = {
|
|
12
|
-
loaded: n,
|
|
13
|
-
total: e,
|
|
14
|
-
progress: e ? n / e : void 0,
|
|
15
|
-
bytes: l,
|
|
16
|
-
rate: d || void 0,
|
|
17
|
-
estimated: d && e && p ? (e - n) / d : void 0,
|
|
18
|
-
event: s,
|
|
19
|
-
lengthComputable: e != null,
|
|
20
|
-
[o ? "download" : "upload"]: !0
|
|
21
|
-
};
|
|
22
|
-
t(u);
|
|
23
|
-
}, a);
|
|
24
|
-
}, v = (t, o) => {
|
|
25
|
-
const a = t != null;
|
|
26
|
-
return [(r) => o[0]({
|
|
27
|
-
lengthComputable: a,
|
|
28
|
-
total: t,
|
|
29
|
-
loaded: r
|
|
30
|
-
}), o[1]];
|
|
31
|
-
}, C = (t) => (...o) => f.asap(() => t(...o));
|
|
2
|
+
var e = {};
|
|
32
3
|
export {
|
|
33
|
-
|
|
34
|
-
v as progressEventDecorator,
|
|
35
|
-
h as progressEventReducer
|
|
4
|
+
e as __exports
|
|
36
5
|
};
|
package/dist/index233.mjs
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
import m from "./index94.mjs";
|
|
4
|
-
import c from "./index282.mjs";
|
|
5
|
-
import h from "./index283.mjs";
|
|
6
|
-
import w from "./index156.mjs";
|
|
7
|
-
import b from "./index97.mjs";
|
|
8
|
-
import C from "./index108.mjs";
|
|
9
|
-
import g from "./index153.mjs";
|
|
10
|
-
const E = (a) => {
|
|
11
|
-
const e = b({}, a);
|
|
12
|
-
let { data: i, withXSRFToken: r, xsrfHeaderName: f, xsrfCookieName: d, headers: o, auth: s } = e;
|
|
13
|
-
if (e.headers = o = C.from(o), e.url = g(w(e.baseURL, e.url, e.allowAbsoluteUrls), a.params, a.paramsSerializer), s && o.set(
|
|
14
|
-
"Authorization",
|
|
15
|
-
"Basic " + btoa((s.username || "") + ":" + (s.password ? unescape(encodeURIComponent(s.password)) : ""))
|
|
16
|
-
), m.isFormData(i)) {
|
|
17
|
-
if (n.hasStandardBrowserEnv || n.hasStandardBrowserWebWorkerEnv)
|
|
18
|
-
o.setContentType(void 0);
|
|
19
|
-
else if (m.isFunction(i.getHeaders)) {
|
|
20
|
-
const t = i.getHeaders(), u = ["content-type", "content-length"];
|
|
21
|
-
Object.entries(t).forEach(([l, p]) => {
|
|
22
|
-
u.includes(l.toLowerCase()) && o.set(l, p);
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (n.hasStandardBrowserEnv && (r && m.isFunction(r) && (r = r(e)), r || r !== !1 && c(e.url))) {
|
|
27
|
-
const t = f && d && h.read(d);
|
|
28
|
-
t && o.set(f, t);
|
|
29
|
-
}
|
|
30
|
-
return e;
|
|
31
|
-
};
|
|
2
|
+
var r = { exports: {} };
|
|
32
3
|
export {
|
|
33
|
-
|
|
4
|
+
r as __module
|
|
34
5
|
};
|