tanya-chatbot 0.0.8 → 0.0.10
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/tanya-chatbot.cjs.js +11 -10
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +1854 -956
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +2 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,15 +1,73 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { jsx as l, jsxs as p, Fragment as dt } from "react/jsx-runtime";
|
|
2
|
+
import { createHttpLink as Zn, ApolloClient as Xn, InMemoryCache as er, ApolloProvider as tr } from "@apollo/client";
|
|
3
|
+
import { Provider as nr, useDispatch as mn, useSelector as Ge } from "react-redux";
|
|
4
|
+
import { createSlice as gn, configureStore as rr } from "@reduxjs/toolkit";
|
|
5
|
+
import { forwardRef as yn, useState as M, useEffect as ge, createElement as pt, useRef as Oe } from "react";
|
|
6
|
+
import * as bn from "@radix-ui/react-popover";
|
|
4
7
|
import "clsx";
|
|
5
8
|
import "tailwind-merge";
|
|
6
|
-
import
|
|
9
|
+
import q from "axios";
|
|
7
10
|
import "crypto-js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import { Icon as Lt } from "@iconify/react";
|
|
12
|
+
import { toast as Z } from "react-toastify";
|
|
13
|
+
const or = {
|
|
14
|
+
store: {
|
|
15
|
+
storeCode: "",
|
|
16
|
+
storeName: "",
|
|
17
|
+
storeDescription: "",
|
|
18
|
+
activeCatalogId: 0,
|
|
19
|
+
isDefault: !1,
|
|
20
|
+
logoDarkBg: "",
|
|
21
|
+
logoLightBg: "",
|
|
22
|
+
logoTransparent: "",
|
|
23
|
+
catalogs: [],
|
|
24
|
+
themeColor: "",
|
|
25
|
+
themeContrastColor: "",
|
|
26
|
+
tanyaThemeColor: "",
|
|
27
|
+
tanyaThemeColorLight: "",
|
|
28
|
+
favicon: "",
|
|
29
|
+
websiteTitle: "",
|
|
30
|
+
flowId: "",
|
|
31
|
+
aliasId: "",
|
|
32
|
+
searchConfigs: {
|
|
33
|
+
endpoint: "",
|
|
34
|
+
accessKey: "",
|
|
35
|
+
secretKey: ""
|
|
36
|
+
},
|
|
37
|
+
homePageCategories: [],
|
|
38
|
+
carouselImages: {
|
|
39
|
+
web: [],
|
|
40
|
+
mobile: []
|
|
41
|
+
},
|
|
42
|
+
otherImages: {
|
|
43
|
+
web: [],
|
|
44
|
+
mobile: []
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, wn = gn({
|
|
48
|
+
name: "store",
|
|
49
|
+
initialState: or,
|
|
50
|
+
reducers: {
|
|
51
|
+
setStore: (e, t) => {
|
|
52
|
+
e.store = t.payload;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}), { setStore: ds } = wn.actions, sr = wn.reducer, ir = {
|
|
56
|
+
product: null
|
|
57
|
+
}, xn = gn({
|
|
58
|
+
name: "product",
|
|
59
|
+
initialState: ir,
|
|
60
|
+
reducers: {
|
|
61
|
+
setProduct: (e, t) => {
|
|
62
|
+
e.product = t.payload;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}), { setProduct: ht } = xn.actions, ar = xn.reducer, cr = rr({
|
|
66
|
+
reducer: {
|
|
67
|
+
store: sr,
|
|
68
|
+
product: ar
|
|
69
|
+
}
|
|
70
|
+
}), lr = ({ children: e }) => /* @__PURE__ */ l(nr, { store: cr, children: e }), Ne = (e) => {
|
|
13
71
|
const t = new CustomEvent("reactCartUpdated", {
|
|
14
72
|
detail: {
|
|
15
73
|
cartUpdated: !0,
|
|
@@ -19,31 +77,31 @@ const ve = (e) => {
|
|
|
19
77
|
});
|
|
20
78
|
window.dispatchEvent(t);
|
|
21
79
|
};
|
|
22
|
-
function
|
|
80
|
+
function ur({
|
|
23
81
|
...e
|
|
24
82
|
}) {
|
|
25
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ l(bn.Root, { "data-slot": "popover", ...e });
|
|
26
84
|
}
|
|
27
|
-
function
|
|
85
|
+
function fr({
|
|
28
86
|
...e
|
|
29
87
|
}) {
|
|
30
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ l(bn.Trigger, { "data-slot": "popover-trigger", ...e });
|
|
31
89
|
}
|
|
32
|
-
const
|
|
90
|
+
const ye = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), vn = async () => {
|
|
33
91
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
34
92
|
try {
|
|
35
|
-
const t = await
|
|
36
|
-
`${e}api/auth/token-bm-grant?baseUrl=${
|
|
93
|
+
const t = await q.post(
|
|
94
|
+
`${e}api/auth/token-bm-grant?baseUrl=${ce()}&siteId=${ne()}`
|
|
37
95
|
);
|
|
38
96
|
return t.status === 200 && t.data.access_token ? t.data.access_token : (console.error("Failed to fetch token:", t.data), null);
|
|
39
97
|
} catch (t) {
|
|
40
|
-
return
|
|
98
|
+
return q.isAxiosError(t) ? console.error("Error fetching token:", t.response || t.message) : console.error("Unexpected error:", t), null;
|
|
41
99
|
}
|
|
42
|
-
},
|
|
100
|
+
}, Sn = async (e) => {
|
|
43
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
44
102
|
try {
|
|
45
|
-
const n = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, r = await
|
|
46
|
-
`${t}api/auth/token-existing-guest-customer?dwsid=${n}&baseUrl=${
|
|
103
|
+
const n = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, r = await q.post(
|
|
104
|
+
`${t}api/auth/token-existing-guest-customer?dwsid=${n}&baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
|
|
47
105
|
{},
|
|
48
106
|
{
|
|
49
107
|
headers: {
|
|
@@ -54,38 +112,38 @@ const pe = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
54
112
|
);
|
|
55
113
|
return r.status === 200 && r.data ? r.data : null;
|
|
56
114
|
} catch (n) {
|
|
57
|
-
return
|
|
115
|
+
return q.isAxiosError(n) ? console.error("Error creating basket:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
58
116
|
}
|
|
59
117
|
};
|
|
60
|
-
async function
|
|
118
|
+
async function Xe() {
|
|
61
119
|
const e = localStorage.getItem("expires_in"), t = localStorage.getItem("access_token"), n = JSON.parse(
|
|
62
120
|
sessionStorage.getItem("customerData") || "{}"
|
|
63
121
|
).isGuest;
|
|
64
122
|
if (e && t && (/* @__PURE__ */ new Date()).getTime() < parseInt(e) && n === JSON.parse(localStorage.getItem("isGuest") || "false"))
|
|
65
123
|
return console.log("access token found in local storage"), { access_token: t, expires_in: e };
|
|
66
|
-
const { serverUrl: r } =
|
|
124
|
+
const { serverUrl: r } = ye(), o = JSON.parse(
|
|
67
125
|
sessionStorage.getItem("customerData") || "{}"
|
|
68
126
|
).dwsid, s = JSON.parse(
|
|
69
127
|
sessionStorage.getItem("customerData") || "{}"
|
|
70
128
|
).usrRef;
|
|
71
129
|
try {
|
|
72
|
-
const i = n ? "unregister-auth" : "register-auth",
|
|
73
|
-
`${r}sc-api/${i}?dwsid=${o}&email=${s}&pubCfg=${
|
|
130
|
+
const i = n ? "unregister-auth" : "register-auth", c = await q.get(
|
|
131
|
+
`${r}sc-api/${i}?dwsid=${o}&email=${s}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}&siteId=${ne()}`
|
|
74
132
|
);
|
|
75
|
-
return localStorage.setItem("access_token",
|
|
133
|
+
return localStorage.setItem("access_token", c.data.access_token), localStorage.setItem(
|
|
76
134
|
"expires_in",
|
|
77
|
-
String((/* @__PURE__ */ new Date()).getTime() +
|
|
78
|
-
), localStorage.setItem("isGuest", n.toString()), console.log(
|
|
135
|
+
String((/* @__PURE__ */ new Date()).getTime() + c.data.expires_in * 1e3)
|
|
136
|
+
), localStorage.setItem("isGuest", n.toString()), console.log(c.data), c.data;
|
|
79
137
|
} catch (i) {
|
|
80
138
|
console.log(i);
|
|
81
139
|
}
|
|
82
140
|
}
|
|
83
|
-
const
|
|
84
|
-
const { serverUrl: n, basePath: r } =
|
|
141
|
+
const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getItem("SiteId"), le = () => sessionStorage.getItem("pubCfg"), ue = () => sessionStorage.getItem("envRef"), fe = () => sessionStorage.getItem("orgRef"), Dt = async (e, t) => {
|
|
142
|
+
const { serverUrl: n, basePath: r } = ye();
|
|
85
143
|
try {
|
|
86
|
-
const o =
|
|
87
|
-
return (await
|
|
88
|
-
`${n}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${
|
|
144
|
+
const o = ce();
|
|
145
|
+
return (await q.get(
|
|
146
|
+
`${n}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
|
|
89
147
|
{
|
|
90
148
|
headers: {
|
|
91
149
|
"Content-Type": "application/json",
|
|
@@ -96,13 +154,13 @@ const se = () => sessionStorage.getItem("Host"), ee = () => sessionStorage.getIt
|
|
|
96
154
|
} catch (o) {
|
|
97
155
|
throw console.error("Error fetching search results:", o), o;
|
|
98
156
|
}
|
|
99
|
-
},
|
|
157
|
+
}, kn = async (e) => {
|
|
100
158
|
if (!e) throw new Error("Product ID is required");
|
|
101
|
-
const { serverUrl: t, basePath: n } =
|
|
159
|
+
const { serverUrl: t, basePath: n } = ye(), r = ce();
|
|
102
160
|
console.log("calling access");
|
|
103
|
-
const { access_token: o } = await
|
|
104
|
-
return console.log(o), (await
|
|
105
|
-
`${t}${n}/product-sfcc/${e}?baseUrl=${r}&siteId=${
|
|
161
|
+
const { access_token: o } = await Xe();
|
|
162
|
+
return console.log(o), (await q.get(
|
|
163
|
+
`${t}${n}/product-sfcc/${e}?baseUrl=${r}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
|
|
106
164
|
{
|
|
107
165
|
headers: {
|
|
108
166
|
"Content-Type": "application/json",
|
|
@@ -110,13 +168,13 @@ const se = () => sessionStorage.getItem("Host"), ee = () => sessionStorage.getIt
|
|
|
110
168
|
}
|
|
111
169
|
}
|
|
112
170
|
)).data;
|
|
113
|
-
},
|
|
171
|
+
}, dr = async (e) => {
|
|
114
172
|
if (!e) throw new Error("customerId is required");
|
|
115
|
-
const t = await
|
|
173
|
+
const t = await vn(), { customer_token: n } = await Sn(
|
|
116
174
|
t
|
|
117
|
-
), { serverUrl: r, basePath: o } =
|
|
118
|
-
return (await
|
|
119
|
-
`${r}${o}/get-interest?baseUrl=${
|
|
175
|
+
), { serverUrl: r, basePath: o } = ye(), i = (await Xe()).access_token;
|
|
176
|
+
return (await q.get(
|
|
177
|
+
`${r}${o}/get-interest?baseUrl=${ce()}&customerId=${e}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
|
|
120
178
|
{
|
|
121
179
|
headers: {
|
|
122
180
|
"Content-Type": "application/json",
|
|
@@ -124,10 +182,10 @@ const se = () => sessionStorage.getItem("Host"), ee = () => sessionStorage.getIt
|
|
|
124
182
|
}
|
|
125
183
|
}
|
|
126
184
|
)).data;
|
|
127
|
-
},
|
|
185
|
+
}, Mt = (e) => String(typeof e == "string" ? e : e["en-US"] || e), Ut = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), pr = (e, t) => e.toLocaleString("en-US", {
|
|
128
186
|
style: "currency",
|
|
129
187
|
currency: t || "USD"
|
|
130
|
-
}),
|
|
188
|
+
}), qt = (e) => {
|
|
131
189
|
var t, n, r;
|
|
132
190
|
return "variants" in e ? {
|
|
133
191
|
centAmount: (t = e.variants[0]) == null ? void 0 : t.prices.EUR.max,
|
|
@@ -136,100 +194,100 @@ const se = () => sessionStorage.getItem("Host"), ee = () => sessionStorage.getIt
|
|
|
136
194
|
centAmount: (n = e.masterVariant) == null ? void 0 : n.prices[0].value.centAmount,
|
|
137
195
|
currencyCode: (r = e.masterVariant) == null ? void 0 : r.prices[0].value.currencyCode
|
|
138
196
|
};
|
|
139
|
-
},
|
|
197
|
+
}, hr = (e) => e.charAt(0).toUpperCase() + e.slice(1), Bt = (e, t) => e.length < t ? e : e.slice(0, t) + "...", st = (e) => e.split("\\n").map((t, n) => {
|
|
140
198
|
const r = t.match(/^(\d+)\.\s(.+)/);
|
|
141
199
|
return r ? `<p key=${n} class="mb-2"><strong>${r[1]}.</strong> ${r[2]}</p>` : t.trim() ? `<p key=${n} class="mb-2">${t}</p>` : "<br/>";
|
|
142
200
|
}).join("");
|
|
143
|
-
function
|
|
201
|
+
function mr(e, t) {
|
|
144
202
|
const n = e.icons, r = e.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
|
|
145
203
|
function s(i) {
|
|
146
204
|
if (n[i]) return o[i] = [];
|
|
147
205
|
if (!(i in o)) {
|
|
148
206
|
o[i] = null;
|
|
149
|
-
const
|
|
150
|
-
a && (o[i] = [
|
|
207
|
+
const c = r[i] && r[i].parent, a = c && s(c);
|
|
208
|
+
a && (o[i] = [c].concat(a));
|
|
151
209
|
}
|
|
152
210
|
return o[i];
|
|
153
211
|
}
|
|
154
212
|
return Object.keys(n).concat(Object.keys(r)).forEach(s), o;
|
|
155
213
|
}
|
|
156
|
-
const
|
|
214
|
+
const In = Object.freeze({
|
|
157
215
|
left: 0,
|
|
158
216
|
top: 0,
|
|
159
217
|
width: 16,
|
|
160
218
|
height: 16
|
|
161
|
-
}),
|
|
219
|
+
}), We = Object.freeze({
|
|
162
220
|
rotate: 0,
|
|
163
221
|
vFlip: !1,
|
|
164
222
|
hFlip: !1
|
|
165
|
-
}),
|
|
166
|
-
...
|
|
167
|
-
...
|
|
168
|
-
}),
|
|
169
|
-
...
|
|
223
|
+
}), kt = Object.freeze({
|
|
224
|
+
...In,
|
|
225
|
+
...We
|
|
226
|
+
}), mt = Object.freeze({
|
|
227
|
+
...kt,
|
|
170
228
|
body: "",
|
|
171
229
|
hidden: !1
|
|
172
230
|
});
|
|
173
|
-
function
|
|
231
|
+
function gr(e, t) {
|
|
174
232
|
const n = {};
|
|
175
233
|
!e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
|
|
176
234
|
const r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
177
235
|
return r && (n.rotate = r), n;
|
|
178
236
|
}
|
|
179
|
-
function
|
|
180
|
-
const n =
|
|
181
|
-
for (const r in
|
|
237
|
+
function Ht(e, t) {
|
|
238
|
+
const n = gr(e, t);
|
|
239
|
+
for (const r in mt) r in We ? r in e && !(r in n) && (n[r] = We[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
|
|
182
240
|
return n;
|
|
183
241
|
}
|
|
184
|
-
function
|
|
242
|
+
function yr(e, t, n) {
|
|
185
243
|
const r = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
186
244
|
let s = {};
|
|
187
|
-
function i(
|
|
188
|
-
s =
|
|
245
|
+
function i(c) {
|
|
246
|
+
s = Ht(r[c] || o[c], s);
|
|
189
247
|
}
|
|
190
|
-
return i(t), n.forEach(i),
|
|
248
|
+
return i(t), n.forEach(i), Ht(e, s);
|
|
191
249
|
}
|
|
192
|
-
function
|
|
250
|
+
function Cn(e, t) {
|
|
193
251
|
const n = [];
|
|
194
252
|
if (typeof e != "object" || typeof e.icons != "object") return n;
|
|
195
253
|
e.not_found instanceof Array && e.not_found.forEach((o) => {
|
|
196
254
|
t(o, null), n.push(o);
|
|
197
255
|
});
|
|
198
|
-
const r =
|
|
256
|
+
const r = mr(e);
|
|
199
257
|
for (const o in r) {
|
|
200
258
|
const s = r[o];
|
|
201
|
-
s && (t(o,
|
|
259
|
+
s && (t(o, yr(e, o, s)), n.push(o));
|
|
202
260
|
}
|
|
203
261
|
return n;
|
|
204
262
|
}
|
|
205
|
-
const
|
|
263
|
+
const br = {
|
|
206
264
|
provider: "",
|
|
207
265
|
aliases: {},
|
|
208
266
|
not_found: {},
|
|
209
|
-
...
|
|
267
|
+
...In
|
|
210
268
|
};
|
|
211
|
-
function
|
|
269
|
+
function it(e, t) {
|
|
212
270
|
for (const n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
|
|
213
271
|
return !0;
|
|
214
272
|
}
|
|
215
|
-
function
|
|
273
|
+
function _n(e) {
|
|
216
274
|
if (typeof e != "object" || e === null) return null;
|
|
217
275
|
const t = e;
|
|
218
|
-
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !
|
|
276
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !it(e, br)) return null;
|
|
219
277
|
const n = t.icons;
|
|
220
278
|
for (const o in n) {
|
|
221
279
|
const s = n[o];
|
|
222
|
-
if (!o || typeof s.body != "string" || !
|
|
280
|
+
if (!o || typeof s.body != "string" || !it(s, mt)) return null;
|
|
223
281
|
}
|
|
224
282
|
const r = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
225
283
|
for (const o in r) {
|
|
226
284
|
const s = r[o], i = s.parent;
|
|
227
|
-
if (!o || typeof i != "string" || !n[i] && !r[i] || !
|
|
285
|
+
if (!o || typeof i != "string" || !n[i] && !r[i] || !it(s, mt)) return null;
|
|
228
286
|
}
|
|
229
287
|
return t;
|
|
230
288
|
}
|
|
231
|
-
const
|
|
232
|
-
function
|
|
289
|
+
const Rt = /* @__PURE__ */ Object.create(null);
|
|
290
|
+
function wr(e, t) {
|
|
233
291
|
return {
|
|
234
292
|
provider: e,
|
|
235
293
|
prefix: t,
|
|
@@ -237,16 +295,16 @@ function un(e, t) {
|
|
|
237
295
|
missing: /* @__PURE__ */ new Set()
|
|
238
296
|
};
|
|
239
297
|
}
|
|
240
|
-
function
|
|
241
|
-
const n =
|
|
242
|
-
return n[t] || (n[t] =
|
|
298
|
+
function Te(e, t) {
|
|
299
|
+
const n = Rt[e] || (Rt[e] = /* @__PURE__ */ Object.create(null));
|
|
300
|
+
return n[t] || (n[t] = wr(e, t));
|
|
243
301
|
}
|
|
244
|
-
function
|
|
245
|
-
return
|
|
302
|
+
function Nn(e, t) {
|
|
303
|
+
return _n(t) ? Cn(t, (n, r) => {
|
|
246
304
|
r ? e.icons[n] = r : e.missing.add(n);
|
|
247
305
|
}) : [];
|
|
248
306
|
}
|
|
249
|
-
function
|
|
307
|
+
function xr(e, t, n) {
|
|
250
308
|
try {
|
|
251
309
|
if (typeof n.body == "string")
|
|
252
310
|
return e.icons[t] = { ...n }, !0;
|
|
@@ -254,7 +312,7 @@ function fn(e, t, n) {
|
|
|
254
312
|
}
|
|
255
313
|
return !1;
|
|
256
314
|
}
|
|
257
|
-
const
|
|
315
|
+
const Fn = /^[a-z0-9]+(-[a-z0-9]+)*$/, et = (e, t, n, r = "") => {
|
|
258
316
|
const o = e.split(":");
|
|
259
317
|
if (e.slice(0, 1) === "@") {
|
|
260
318
|
if (o.length < 2 || o.length > 3) return null;
|
|
@@ -262,90 +320,90 @@ const Ut = /^[a-z0-9]+(-[a-z0-9]+)*$/, Be = (e, t, n, r = "") => {
|
|
|
262
320
|
}
|
|
263
321
|
if (o.length > 3 || !o.length) return null;
|
|
264
322
|
if (o.length > 1) {
|
|
265
|
-
const
|
|
323
|
+
const c = o.pop(), a = o.pop(), u = {
|
|
266
324
|
provider: o.length > 0 ? o[0] : r,
|
|
267
325
|
prefix: a,
|
|
268
|
-
name:
|
|
326
|
+
name: c
|
|
269
327
|
};
|
|
270
|
-
return t && !
|
|
328
|
+
return t && !Ve(u) ? null : u;
|
|
271
329
|
}
|
|
272
330
|
const s = o[0], i = s.split("-");
|
|
273
331
|
if (i.length > 1) {
|
|
274
|
-
const
|
|
332
|
+
const c = {
|
|
275
333
|
provider: r,
|
|
276
334
|
prefix: i.shift(),
|
|
277
335
|
name: i.join("-")
|
|
278
336
|
};
|
|
279
|
-
return t && !
|
|
337
|
+
return t && !Ve(c) ? null : c;
|
|
280
338
|
}
|
|
281
339
|
if (n && r === "") {
|
|
282
|
-
const
|
|
340
|
+
const c = {
|
|
283
341
|
provider: r,
|
|
284
342
|
prefix: "",
|
|
285
343
|
name: s
|
|
286
344
|
};
|
|
287
|
-
return t && !
|
|
345
|
+
return t && !Ve(c, n) ? null : c;
|
|
288
346
|
}
|
|
289
347
|
return null;
|
|
290
|
-
},
|
|
291
|
-
let
|
|
292
|
-
function
|
|
293
|
-
return typeof e == "boolean" && (
|
|
348
|
+
}, Ve = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
349
|
+
let Ue = !1;
|
|
350
|
+
function Tn(e) {
|
|
351
|
+
return typeof e == "boolean" && (Ue = e), Ue;
|
|
294
352
|
}
|
|
295
|
-
function
|
|
296
|
-
const t = typeof e == "string" ?
|
|
353
|
+
function zt(e) {
|
|
354
|
+
const t = typeof e == "string" ? et(e, !0, Ue) : e;
|
|
297
355
|
if (t) {
|
|
298
|
-
const n =
|
|
356
|
+
const n = Te(t.provider, t.prefix), r = t.name;
|
|
299
357
|
return n.icons[r] || (n.missing.has(r) ? null : void 0);
|
|
300
358
|
}
|
|
301
359
|
}
|
|
302
|
-
function
|
|
303
|
-
const n =
|
|
360
|
+
function vr(e, t) {
|
|
361
|
+
const n = et(e, !0, Ue);
|
|
304
362
|
if (!n) return !1;
|
|
305
|
-
const r =
|
|
306
|
-
return t ?
|
|
363
|
+
const r = Te(n.provider, n.prefix);
|
|
364
|
+
return t ? xr(r, n.name, t) : (r.missing.add(n.name), !0);
|
|
307
365
|
}
|
|
308
|
-
function
|
|
366
|
+
function Sr(e, t) {
|
|
309
367
|
if (typeof e != "object") return !1;
|
|
310
|
-
if (typeof t != "string" && (t = e.provider || ""),
|
|
368
|
+
if (typeof t != "string" && (t = e.provider || ""), Ue && !t && !e.prefix) {
|
|
311
369
|
let o = !1;
|
|
312
|
-
return
|
|
313
|
-
|
|
370
|
+
return _n(e) && (e.prefix = "", Cn(e, (s, i) => {
|
|
371
|
+
vr(s, i) && (o = !0);
|
|
314
372
|
})), o;
|
|
315
373
|
}
|
|
316
374
|
const n = e.prefix;
|
|
317
|
-
if (!
|
|
375
|
+
if (!Ve({
|
|
318
376
|
prefix: n,
|
|
319
377
|
name: "a"
|
|
320
378
|
})) return !1;
|
|
321
|
-
const r =
|
|
322
|
-
return !!
|
|
379
|
+
const r = Te(t, n);
|
|
380
|
+
return !!Nn(r, e);
|
|
323
381
|
}
|
|
324
|
-
const
|
|
382
|
+
const En = Object.freeze({
|
|
325
383
|
width: null,
|
|
326
384
|
height: null
|
|
327
|
-
}),
|
|
328
|
-
...
|
|
329
|
-
...
|
|
330
|
-
}),
|
|
331
|
-
function
|
|
385
|
+
}), Pn = Object.freeze({
|
|
386
|
+
...En,
|
|
387
|
+
...We
|
|
388
|
+
}), kr = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Ir = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
389
|
+
function Vt(e, t, n) {
|
|
332
390
|
if (t === 1) return e;
|
|
333
391
|
if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
|
|
334
392
|
if (typeof e != "string") return e;
|
|
335
|
-
const r = e.split(
|
|
393
|
+
const r = e.split(kr);
|
|
336
394
|
if (r === null || !r.length) return e;
|
|
337
395
|
const o = [];
|
|
338
|
-
let s = r.shift(), i =
|
|
396
|
+
let s = r.shift(), i = Ir.test(s);
|
|
339
397
|
for (; ; ) {
|
|
340
398
|
if (i) {
|
|
341
|
-
const
|
|
342
|
-
isNaN(
|
|
399
|
+
const c = parseFloat(s);
|
|
400
|
+
isNaN(c) ? o.push(s) : o.push(Math.ceil(c * t * n) / n);
|
|
343
401
|
} else o.push(s);
|
|
344
402
|
if (s = r.shift(), s === void 0) return o.join("");
|
|
345
403
|
i = !i;
|
|
346
404
|
}
|
|
347
405
|
}
|
|
348
|
-
function
|
|
406
|
+
function Cr(e, t = "defs") {
|
|
349
407
|
let n = "";
|
|
350
408
|
const r = e.indexOf("<" + t);
|
|
351
409
|
for (; r >= 0; ) {
|
|
@@ -360,20 +418,20 @@ function yn(e, t = "defs") {
|
|
|
360
418
|
content: e
|
|
361
419
|
};
|
|
362
420
|
}
|
|
363
|
-
function
|
|
421
|
+
function _r(e, t) {
|
|
364
422
|
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
365
423
|
}
|
|
366
|
-
function
|
|
367
|
-
const r =
|
|
368
|
-
return
|
|
424
|
+
function Nr(e, t, n) {
|
|
425
|
+
const r = Cr(e);
|
|
426
|
+
return _r(r.defs, t + r.content + n);
|
|
369
427
|
}
|
|
370
|
-
const
|
|
371
|
-
function
|
|
428
|
+
const Fr = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
429
|
+
function Tr(e, t) {
|
|
372
430
|
const n = {
|
|
373
|
-
...
|
|
431
|
+
...kt,
|
|
374
432
|
...e
|
|
375
433
|
}, r = {
|
|
376
|
-
...
|
|
434
|
+
...Pn,
|
|
377
435
|
...t
|
|
378
436
|
}, o = {
|
|
379
437
|
left: n.left,
|
|
@@ -382,64 +440,64 @@ function vn(e, t) {
|
|
|
382
440
|
height: n.height
|
|
383
441
|
};
|
|
384
442
|
let s = n.body;
|
|
385
|
-
[n, r].forEach((
|
|
386
|
-
const
|
|
387
|
-
let
|
|
388
|
-
v ?
|
|
389
|
-
let
|
|
390
|
-
switch (
|
|
443
|
+
[n, r].forEach((_) => {
|
|
444
|
+
const y = [], v = _.hFlip, B = _.vFlip;
|
|
445
|
+
let P = _.rotate;
|
|
446
|
+
v ? B ? P += 2 : (y.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), y.push("scale(-1 1)"), o.top = o.left = 0) : B && (y.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), y.push("scale(1 -1)"), o.top = o.left = 0);
|
|
447
|
+
let j;
|
|
448
|
+
switch (P < 0 && (P -= Math.floor(P / 4) * 4), P = P % 4, P) {
|
|
391
449
|
case 1:
|
|
392
|
-
|
|
450
|
+
j = o.height / 2 + o.top, y.unshift("rotate(90 " + j.toString() + " " + j.toString() + ")");
|
|
393
451
|
break;
|
|
394
452
|
case 2:
|
|
395
|
-
|
|
453
|
+
y.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
396
454
|
break;
|
|
397
455
|
case 3:
|
|
398
|
-
|
|
456
|
+
j = o.width / 2 + o.left, y.unshift("rotate(-90 " + j.toString() + " " + j.toString() + ")");
|
|
399
457
|
break;
|
|
400
458
|
}
|
|
401
|
-
|
|
459
|
+
P % 2 === 1 && (o.left !== o.top && (j = o.left, o.left = o.top, o.top = j), o.width !== o.height && (j = o.width, o.width = o.height, o.height = j)), y.length && (s = Nr(s, '<g transform="' + y.join(" ") + '">', "</g>"));
|
|
402
460
|
});
|
|
403
|
-
const i = r.width,
|
|
404
|
-
let
|
|
405
|
-
i === null ? (
|
|
406
|
-
const
|
|
407
|
-
|
|
461
|
+
const i = r.width, c = r.height, a = o.width, u = o.height;
|
|
462
|
+
let d, h;
|
|
463
|
+
i === null ? (h = c === null ? "1em" : c === "auto" ? u : c, d = Vt(h, a / u)) : (d = i === "auto" ? a : i, h = c === null ? Vt(d, u / a) : c === "auto" ? u : c);
|
|
464
|
+
const m = {}, g = (_, y) => {
|
|
465
|
+
Fr(y) || (m[_] = y.toString());
|
|
408
466
|
};
|
|
409
|
-
|
|
410
|
-
const
|
|
467
|
+
g("width", d), g("height", h);
|
|
468
|
+
const S = [
|
|
411
469
|
o.left,
|
|
412
470
|
o.top,
|
|
413
471
|
a,
|
|
414
472
|
u
|
|
415
473
|
];
|
|
416
|
-
return
|
|
417
|
-
attributes:
|
|
418
|
-
viewBox:
|
|
474
|
+
return m.viewBox = S.join(" "), {
|
|
475
|
+
attributes: m,
|
|
476
|
+
viewBox: S,
|
|
419
477
|
body: s
|
|
420
478
|
};
|
|
421
479
|
}
|
|
422
|
-
const
|
|
423
|
-
let
|
|
424
|
-
function
|
|
480
|
+
const Er = /\sid="(\S+)"/g, Pr = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
481
|
+
let Or = 0;
|
|
482
|
+
function $r(e, t = Pr) {
|
|
425
483
|
const n = [];
|
|
426
484
|
let r;
|
|
427
|
-
for (; r =
|
|
485
|
+
for (; r = Er.exec(e); ) n.push(r[1]);
|
|
428
486
|
if (!n.length) return e;
|
|
429
487
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
430
488
|
return n.forEach((s) => {
|
|
431
|
-
const i = typeof t == "function" ? t(s) : t + (
|
|
432
|
-
e = e.replace(new RegExp('([#;"])(' +
|
|
489
|
+
const i = typeof t == "function" ? t(s) : t + (Or++).toString(), c = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
490
|
+
e = e.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
433
491
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
434
492
|
}
|
|
435
|
-
const
|
|
436
|
-
function
|
|
437
|
-
|
|
493
|
+
const gt = /* @__PURE__ */ Object.create(null);
|
|
494
|
+
function jr(e, t) {
|
|
495
|
+
gt[e] = t;
|
|
438
496
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
497
|
+
function yt(e) {
|
|
498
|
+
return gt[e] || gt[""];
|
|
441
499
|
}
|
|
442
|
-
function
|
|
500
|
+
function It(e) {
|
|
443
501
|
let t;
|
|
444
502
|
if (typeof e.resources == "string") t = [e.resources];
|
|
445
503
|
else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
|
|
@@ -454,26 +512,26 @@ function nt(e) {
|
|
|
454
512
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
455
513
|
};
|
|
456
514
|
}
|
|
457
|
-
const
|
|
458
|
-
for (;
|
|
459
|
-
|
|
460
|
-
function
|
|
461
|
-
const n =
|
|
462
|
-
return n === null ? !1 : (
|
|
515
|
+
const Ct = /* @__PURE__ */ Object.create(null), $e = ["https://api.simplesvg.com", "https://api.unisvg.com"], Je = [];
|
|
516
|
+
for (; $e.length > 0; ) $e.length === 1 || Math.random() > 0.5 ? Je.push($e.shift()) : Je.push($e.pop());
|
|
517
|
+
Ct[""] = It({ resources: ["https://api.iconify.design"].concat(Je) });
|
|
518
|
+
function Ar(e, t) {
|
|
519
|
+
const n = It(t);
|
|
520
|
+
return n === null ? !1 : (Ct[e] = n, !0);
|
|
463
521
|
}
|
|
464
|
-
function
|
|
465
|
-
return
|
|
522
|
+
function _t(e) {
|
|
523
|
+
return Ct[e];
|
|
466
524
|
}
|
|
467
|
-
const
|
|
525
|
+
const Lr = () => {
|
|
468
526
|
let e;
|
|
469
527
|
try {
|
|
470
528
|
if (e = fetch, typeof e == "function") return e;
|
|
471
529
|
} catch {
|
|
472
530
|
}
|
|
473
531
|
};
|
|
474
|
-
let
|
|
475
|
-
function
|
|
476
|
-
const n =
|
|
532
|
+
let Jt = Lr();
|
|
533
|
+
function Dr(e, t) {
|
|
534
|
+
const n = _t(e);
|
|
477
535
|
if (!n) return 0;
|
|
478
536
|
let r;
|
|
479
537
|
if (!n.maxURL) r = 0;
|
|
@@ -487,42 +545,42 @@ function _n(e, t) {
|
|
|
487
545
|
}
|
|
488
546
|
return r;
|
|
489
547
|
}
|
|
490
|
-
function
|
|
548
|
+
function Mr(e) {
|
|
491
549
|
return e === 404;
|
|
492
550
|
}
|
|
493
|
-
const
|
|
494
|
-
const r = [], o =
|
|
551
|
+
const Ur = (e, t, n) => {
|
|
552
|
+
const r = [], o = Dr(e, t), s = "icons";
|
|
495
553
|
let i = {
|
|
496
554
|
type: s,
|
|
497
555
|
provider: e,
|
|
498
556
|
prefix: t,
|
|
499
557
|
icons: []
|
|
500
|
-
},
|
|
558
|
+
}, c = 0;
|
|
501
559
|
return n.forEach((a, u) => {
|
|
502
|
-
|
|
560
|
+
c += a.length + 1, c >= o && u > 0 && (r.push(i), i = {
|
|
503
561
|
type: s,
|
|
504
562
|
provider: e,
|
|
505
563
|
prefix: t,
|
|
506
564
|
icons: []
|
|
507
|
-
},
|
|
565
|
+
}, c = a.length), i.icons.push(a);
|
|
508
566
|
}), r.push(i), r;
|
|
509
567
|
};
|
|
510
|
-
function
|
|
568
|
+
function qr(e) {
|
|
511
569
|
if (typeof e == "string") {
|
|
512
|
-
const t =
|
|
570
|
+
const t = _t(e);
|
|
513
571
|
if (t) return t.path;
|
|
514
572
|
}
|
|
515
573
|
return "/";
|
|
516
574
|
}
|
|
517
|
-
const
|
|
518
|
-
if (!
|
|
575
|
+
const Br = (e, t, n) => {
|
|
576
|
+
if (!Jt) {
|
|
519
577
|
n("abort", 424);
|
|
520
578
|
return;
|
|
521
579
|
}
|
|
522
|
-
let r =
|
|
580
|
+
let r = qr(t.provider);
|
|
523
581
|
switch (t.type) {
|
|
524
582
|
case "icons": {
|
|
525
|
-
const s = t.prefix,
|
|
583
|
+
const s = t.prefix, c = t.icons.join(","), a = new URLSearchParams({ icons: c });
|
|
526
584
|
r += s + ".json?" + a.toString();
|
|
527
585
|
break;
|
|
528
586
|
}
|
|
@@ -536,11 +594,11 @@ const An = (e, t, n) => {
|
|
|
536
594
|
return;
|
|
537
595
|
}
|
|
538
596
|
let o = 503;
|
|
539
|
-
|
|
597
|
+
Jt(e + r).then((s) => {
|
|
540
598
|
const i = s.status;
|
|
541
599
|
if (i !== 200) {
|
|
542
600
|
setTimeout(() => {
|
|
543
|
-
n(
|
|
601
|
+
n(Mr(i) ? "abort" : "next", i);
|
|
544
602
|
});
|
|
545
603
|
return;
|
|
546
604
|
}
|
|
@@ -558,17 +616,17 @@ const An = (e, t, n) => {
|
|
|
558
616
|
}).catch(() => {
|
|
559
617
|
n("next", o);
|
|
560
618
|
});
|
|
561
|
-
},
|
|
562
|
-
prepare:
|
|
563
|
-
send:
|
|
619
|
+
}, Hr = {
|
|
620
|
+
prepare: Ur,
|
|
621
|
+
send: Br
|
|
564
622
|
};
|
|
565
|
-
function
|
|
623
|
+
function On(e, t) {
|
|
566
624
|
e.forEach((n) => {
|
|
567
625
|
const r = n.loaderCallbacks;
|
|
568
626
|
r && (n.loaderCallbacks = r.filter((o) => o.id !== t));
|
|
569
627
|
});
|
|
570
628
|
}
|
|
571
|
-
function
|
|
629
|
+
function Rr(e) {
|
|
572
630
|
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
573
631
|
e.pendingCallbacksFlag = !1;
|
|
574
632
|
const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
@@ -576,7 +634,7 @@ function jn(e) {
|
|
|
576
634
|
let n = !1;
|
|
577
635
|
const r = e.provider, o = e.prefix;
|
|
578
636
|
t.forEach((s) => {
|
|
579
|
-
const i = s.icons,
|
|
637
|
+
const i = s.icons, c = i.pending.length;
|
|
580
638
|
i.pending = i.pending.filter((a) => {
|
|
581
639
|
if (a.prefix !== o) return !0;
|
|
582
640
|
const u = a.name;
|
|
@@ -593,13 +651,13 @@ function jn(e) {
|
|
|
593
651
|
else
|
|
594
652
|
return n = !0, !0;
|
|
595
653
|
return !1;
|
|
596
|
-
}), i.pending.length !==
|
|
654
|
+
}), i.pending.length !== c && (n || On([e], s.id), s.callback(i.loaded.slice(0), i.missing.slice(0), i.pending.slice(0), s.abort));
|
|
597
655
|
});
|
|
598
656
|
}));
|
|
599
657
|
}
|
|
600
|
-
let
|
|
601
|
-
function
|
|
602
|
-
const r =
|
|
658
|
+
let zr = 0;
|
|
659
|
+
function Vr(e, t, n) {
|
|
660
|
+
const r = zr++, o = On.bind(null, n, r);
|
|
603
661
|
if (!t.pending.length) return o;
|
|
604
662
|
const s = {
|
|
605
663
|
id: r,
|
|
@@ -611,7 +669,7 @@ function Dn(e, t, n) {
|
|
|
611
669
|
(i.loaderCallbacks || (i.loaderCallbacks = [])).push(s);
|
|
612
670
|
}), o;
|
|
613
671
|
}
|
|
614
|
-
function
|
|
672
|
+
function Jr(e) {
|
|
615
673
|
const t = {
|
|
616
674
|
loaded: [],
|
|
617
675
|
missing: [],
|
|
@@ -626,25 +684,25 @@ function Un(e) {
|
|
|
626
684
|
return e.forEach((o) => {
|
|
627
685
|
if (r.name === o.name && r.prefix === o.prefix && r.provider === o.provider) return;
|
|
628
686
|
r = o;
|
|
629
|
-
const s = o.provider, i = o.prefix,
|
|
630
|
-
let
|
|
631
|
-
|
|
632
|
-
const
|
|
687
|
+
const s = o.provider, i = o.prefix, c = o.name, a = n[s] || (n[s] = /* @__PURE__ */ Object.create(null)), u = a[i] || (a[i] = Te(s, i));
|
|
688
|
+
let d;
|
|
689
|
+
c in u.icons ? d = t.loaded : i === "" || u.missing.has(c) ? d = t.missing : d = t.pending;
|
|
690
|
+
const h = {
|
|
633
691
|
provider: s,
|
|
634
692
|
prefix: i,
|
|
635
|
-
name:
|
|
693
|
+
name: c
|
|
636
694
|
};
|
|
637
|
-
|
|
695
|
+
d.push(h);
|
|
638
696
|
}), t;
|
|
639
697
|
}
|
|
640
|
-
function
|
|
698
|
+
function Kr(e, t = !0, n = !1) {
|
|
641
699
|
const r = [];
|
|
642
700
|
return e.forEach((o) => {
|
|
643
|
-
const s = typeof o == "string" ?
|
|
701
|
+
const s = typeof o == "string" ? et(o, t, n) : o;
|
|
644
702
|
s && r.push(s);
|
|
645
703
|
}), r;
|
|
646
704
|
}
|
|
647
|
-
const
|
|
705
|
+
const Gr = {
|
|
648
706
|
resources: [],
|
|
649
707
|
index: 0,
|
|
650
708
|
timeout: 2e3,
|
|
@@ -652,183 +710,183 @@ const Bn = {
|
|
|
652
710
|
random: !1,
|
|
653
711
|
dataAfterTimeout: !1
|
|
654
712
|
};
|
|
655
|
-
function
|
|
713
|
+
function Wr(e, t, n, r) {
|
|
656
714
|
const o = e.resources.length, s = e.random ? Math.floor(Math.random() * o) : e.index;
|
|
657
715
|
let i;
|
|
658
716
|
if (e.random) {
|
|
659
|
-
let
|
|
660
|
-
for (i = [];
|
|
661
|
-
const
|
|
662
|
-
i.push(
|
|
717
|
+
let k = e.resources.slice(0);
|
|
718
|
+
for (i = []; k.length > 1; ) {
|
|
719
|
+
const L = Math.floor(Math.random() * k.length);
|
|
720
|
+
i.push(k[L]), k = k.slice(0, L).concat(k.slice(L + 1));
|
|
663
721
|
}
|
|
664
|
-
i = i.concat(
|
|
722
|
+
i = i.concat(k);
|
|
665
723
|
} else i = e.resources.slice(s).concat(e.resources.slice(0, s));
|
|
666
|
-
const
|
|
667
|
-
let a = "pending", u = 0,
|
|
668
|
-
typeof r == "function" &&
|
|
669
|
-
function
|
|
670
|
-
|
|
724
|
+
const c = Date.now();
|
|
725
|
+
let a = "pending", u = 0, d, h = null, m = [], g = [];
|
|
726
|
+
typeof r == "function" && g.push(r);
|
|
727
|
+
function S() {
|
|
728
|
+
h && (clearTimeout(h), h = null);
|
|
671
729
|
}
|
|
672
|
-
function
|
|
673
|
-
a === "pending" && (a = "aborted"),
|
|
674
|
-
|
|
675
|
-
}),
|
|
730
|
+
function _() {
|
|
731
|
+
a === "pending" && (a = "aborted"), S(), m.forEach((k) => {
|
|
732
|
+
k.status === "pending" && (k.status = "aborted");
|
|
733
|
+
}), m = [];
|
|
676
734
|
}
|
|
677
|
-
function
|
|
678
|
-
|
|
735
|
+
function y(k, L) {
|
|
736
|
+
L && (g = []), typeof k == "function" && g.push(k);
|
|
679
737
|
}
|
|
680
738
|
function v() {
|
|
681
739
|
return {
|
|
682
|
-
startTime:
|
|
740
|
+
startTime: c,
|
|
683
741
|
payload: t,
|
|
684
742
|
status: a,
|
|
685
743
|
queriesSent: u,
|
|
686
|
-
queriesPending:
|
|
687
|
-
subscribe:
|
|
688
|
-
abort:
|
|
744
|
+
queriesPending: m.length,
|
|
745
|
+
subscribe: y,
|
|
746
|
+
abort: _
|
|
689
747
|
};
|
|
690
748
|
}
|
|
691
|
-
function
|
|
692
|
-
a = "failed",
|
|
693
|
-
|
|
749
|
+
function B() {
|
|
750
|
+
a = "failed", g.forEach((k) => {
|
|
751
|
+
k(void 0, d);
|
|
694
752
|
});
|
|
695
753
|
}
|
|
696
|
-
function
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
}),
|
|
754
|
+
function P() {
|
|
755
|
+
m.forEach((k) => {
|
|
756
|
+
k.status === "pending" && (k.status = "aborted");
|
|
757
|
+
}), m = [];
|
|
700
758
|
}
|
|
701
|
-
function
|
|
702
|
-
const
|
|
703
|
-
switch (
|
|
759
|
+
function j(k, L, z) {
|
|
760
|
+
const V = L !== "success";
|
|
761
|
+
switch (m = m.filter((O) => O !== k), a) {
|
|
704
762
|
case "pending":
|
|
705
763
|
break;
|
|
706
764
|
case "failed":
|
|
707
|
-
if (
|
|
765
|
+
if (V || !e.dataAfterTimeout) return;
|
|
708
766
|
break;
|
|
709
767
|
default:
|
|
710
768
|
return;
|
|
711
769
|
}
|
|
712
|
-
if (
|
|
713
|
-
|
|
770
|
+
if (L === "abort") {
|
|
771
|
+
d = z, B();
|
|
714
772
|
return;
|
|
715
773
|
}
|
|
716
|
-
if (
|
|
717
|
-
|
|
774
|
+
if (V) {
|
|
775
|
+
d = z, m.length || (i.length ? X() : B());
|
|
718
776
|
return;
|
|
719
777
|
}
|
|
720
|
-
if (
|
|
721
|
-
const
|
|
722
|
-
|
|
778
|
+
if (S(), P(), !e.random) {
|
|
779
|
+
const O = e.resources.indexOf(k.resource);
|
|
780
|
+
O !== -1 && O !== e.index && (e.index = O);
|
|
723
781
|
}
|
|
724
|
-
a = "completed",
|
|
725
|
-
|
|
782
|
+
a = "completed", g.forEach((O) => {
|
|
783
|
+
O(z);
|
|
726
784
|
});
|
|
727
785
|
}
|
|
728
|
-
function
|
|
786
|
+
function X() {
|
|
729
787
|
if (a !== "pending") return;
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
733
|
-
if (
|
|
734
|
-
|
|
735
|
-
|
|
788
|
+
S();
|
|
789
|
+
const k = i.shift();
|
|
790
|
+
if (k === void 0) {
|
|
791
|
+
if (m.length) {
|
|
792
|
+
h = setTimeout(() => {
|
|
793
|
+
S(), a === "pending" && (P(), B());
|
|
736
794
|
}, e.timeout);
|
|
737
795
|
return;
|
|
738
796
|
}
|
|
739
|
-
|
|
797
|
+
B();
|
|
740
798
|
return;
|
|
741
799
|
}
|
|
742
|
-
const
|
|
800
|
+
const L = {
|
|
743
801
|
status: "pending",
|
|
744
|
-
resource:
|
|
745
|
-
callback: (
|
|
746
|
-
L
|
|
802
|
+
resource: k,
|
|
803
|
+
callback: (z, V) => {
|
|
804
|
+
j(L, z, V);
|
|
747
805
|
}
|
|
748
806
|
};
|
|
749
|
-
|
|
807
|
+
m.push(L), u++, h = setTimeout(X, e.rotate), n(k, t, L.callback);
|
|
750
808
|
}
|
|
751
|
-
return setTimeout(
|
|
809
|
+
return setTimeout(X), v;
|
|
752
810
|
}
|
|
753
|
-
function
|
|
811
|
+
function $n(e) {
|
|
754
812
|
const t = {
|
|
755
|
-
...
|
|
813
|
+
...Gr,
|
|
756
814
|
...e
|
|
757
815
|
};
|
|
758
816
|
let n = [];
|
|
759
817
|
function r() {
|
|
760
|
-
n = n.filter((
|
|
818
|
+
n = n.filter((c) => c().status === "pending");
|
|
761
819
|
}
|
|
762
|
-
function o(
|
|
763
|
-
const
|
|
764
|
-
r(), u && u(
|
|
820
|
+
function o(c, a, u) {
|
|
821
|
+
const d = Wr(t, c, a, (h, m) => {
|
|
822
|
+
r(), u && u(h, m);
|
|
765
823
|
});
|
|
766
|
-
return n.push(
|
|
824
|
+
return n.push(d), d;
|
|
767
825
|
}
|
|
768
|
-
function s(
|
|
769
|
-
return n.find((a) =>
|
|
826
|
+
function s(c) {
|
|
827
|
+
return n.find((a) => c(a)) || null;
|
|
770
828
|
}
|
|
771
829
|
return {
|
|
772
830
|
query: o,
|
|
773
831
|
find: s,
|
|
774
|
-
setIndex: (
|
|
775
|
-
t.index =
|
|
832
|
+
setIndex: (c) => {
|
|
833
|
+
t.index = c;
|
|
776
834
|
},
|
|
777
835
|
getIndex: () => t.index,
|
|
778
836
|
cleanup: r
|
|
779
837
|
};
|
|
780
838
|
}
|
|
781
|
-
function
|
|
839
|
+
function Kt() {
|
|
782
840
|
}
|
|
783
|
-
const
|
|
784
|
-
function
|
|
785
|
-
if (!
|
|
786
|
-
const t =
|
|
841
|
+
const at = /* @__PURE__ */ Object.create(null);
|
|
842
|
+
function Qr(e) {
|
|
843
|
+
if (!at[e]) {
|
|
844
|
+
const t = _t(e);
|
|
787
845
|
if (!t) return;
|
|
788
|
-
const n =
|
|
846
|
+
const n = $n(t), r = {
|
|
789
847
|
config: t,
|
|
790
848
|
redundancy: n
|
|
791
849
|
};
|
|
792
|
-
|
|
850
|
+
at[e] = r;
|
|
793
851
|
}
|
|
794
|
-
return
|
|
852
|
+
return at[e];
|
|
795
853
|
}
|
|
796
|
-
function
|
|
854
|
+
function Yr(e, t, n) {
|
|
797
855
|
let r, o;
|
|
798
856
|
if (typeof e == "string") {
|
|
799
|
-
const s =
|
|
857
|
+
const s = yt(e);
|
|
800
858
|
if (!s)
|
|
801
|
-
return n(void 0, 424),
|
|
859
|
+
return n(void 0, 424), Kt;
|
|
802
860
|
o = s.send;
|
|
803
|
-
const i =
|
|
861
|
+
const i = Qr(e);
|
|
804
862
|
i && (r = i.redundancy);
|
|
805
863
|
} else {
|
|
806
|
-
const s =
|
|
864
|
+
const s = It(e);
|
|
807
865
|
if (s) {
|
|
808
|
-
r =
|
|
809
|
-
const i = e.resources ? e.resources[0] : "",
|
|
810
|
-
|
|
866
|
+
r = $n(s);
|
|
867
|
+
const i = e.resources ? e.resources[0] : "", c = yt(i);
|
|
868
|
+
c && (o = c.send);
|
|
811
869
|
}
|
|
812
870
|
}
|
|
813
|
-
return !r || !o ? (n(void 0, 424),
|
|
871
|
+
return !r || !o ? (n(void 0, 424), Kt) : r.query(t, o, n)().abort;
|
|
814
872
|
}
|
|
815
|
-
function
|
|
873
|
+
function Gt() {
|
|
816
874
|
}
|
|
817
|
-
function
|
|
875
|
+
function Zr(e) {
|
|
818
876
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
819
|
-
e.iconsLoaderFlag = !1,
|
|
877
|
+
e.iconsLoaderFlag = !1, Rr(e);
|
|
820
878
|
}));
|
|
821
879
|
}
|
|
822
|
-
function
|
|
880
|
+
function Xr(e) {
|
|
823
881
|
const t = [], n = [];
|
|
824
882
|
return e.forEach((r) => {
|
|
825
|
-
(r.match(
|
|
883
|
+
(r.match(Fn) ? t : n).push(r);
|
|
826
884
|
}), {
|
|
827
885
|
valid: t,
|
|
828
886
|
invalid: n
|
|
829
887
|
};
|
|
830
888
|
}
|
|
831
|
-
function
|
|
889
|
+
function je(e, t, n) {
|
|
832
890
|
function r() {
|
|
833
891
|
const o = e.pendingIcons;
|
|
834
892
|
t.forEach((s) => {
|
|
@@ -836,98 +894,98 @@ function Ne(e, t, n) {
|
|
|
836
894
|
});
|
|
837
895
|
}
|
|
838
896
|
if (n && typeof n == "object") try {
|
|
839
|
-
if (!
|
|
897
|
+
if (!Nn(e, n).length) {
|
|
840
898
|
r();
|
|
841
899
|
return;
|
|
842
900
|
}
|
|
843
901
|
} catch (o) {
|
|
844
902
|
console.error(o);
|
|
845
903
|
}
|
|
846
|
-
r(),
|
|
904
|
+
r(), Zr(e);
|
|
847
905
|
}
|
|
848
|
-
function
|
|
906
|
+
function Wt(e, t) {
|
|
849
907
|
e instanceof Promise ? e.then((n) => {
|
|
850
908
|
t(n);
|
|
851
909
|
}).catch(() => {
|
|
852
910
|
t(null);
|
|
853
911
|
}) : t(e);
|
|
854
912
|
}
|
|
855
|
-
function
|
|
913
|
+
function eo(e, t) {
|
|
856
914
|
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
857
915
|
e.iconsQueueFlag = !1;
|
|
858
916
|
const { provider: n, prefix: r } = e, o = e.iconsToLoad;
|
|
859
917
|
if (delete e.iconsToLoad, !o || !o.length) return;
|
|
860
918
|
const s = e.loadIcon;
|
|
861
919
|
if (e.loadIcons && (o.length > 1 || !s)) {
|
|
862
|
-
|
|
863
|
-
|
|
920
|
+
Wt(e.loadIcons(o, r, n), (d) => {
|
|
921
|
+
je(e, o, d);
|
|
864
922
|
});
|
|
865
923
|
return;
|
|
866
924
|
}
|
|
867
925
|
if (s) {
|
|
868
|
-
o.forEach((
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
const
|
|
926
|
+
o.forEach((d) => {
|
|
927
|
+
const h = s(d, r, n);
|
|
928
|
+
Wt(h, (m) => {
|
|
929
|
+
const g = m ? {
|
|
872
930
|
prefix: r,
|
|
873
|
-
icons: { [
|
|
931
|
+
icons: { [d]: m }
|
|
874
932
|
} : null;
|
|
875
|
-
|
|
933
|
+
je(e, [d], g);
|
|
876
934
|
});
|
|
877
935
|
});
|
|
878
936
|
return;
|
|
879
937
|
}
|
|
880
|
-
const { valid: i, invalid:
|
|
881
|
-
if (
|
|
882
|
-
const a = r.match(
|
|
938
|
+
const { valid: i, invalid: c } = Xr(o);
|
|
939
|
+
if (c.length && je(e, c, null), !i.length) return;
|
|
940
|
+
const a = r.match(Fn) ? yt(n) : null;
|
|
883
941
|
if (!a) {
|
|
884
|
-
|
|
942
|
+
je(e, i, null);
|
|
885
943
|
return;
|
|
886
944
|
}
|
|
887
|
-
a.prepare(n, r, i).forEach((
|
|
888
|
-
|
|
889
|
-
|
|
945
|
+
a.prepare(n, r, i).forEach((d) => {
|
|
946
|
+
Yr(n, d, (h) => {
|
|
947
|
+
je(e, d.icons, h);
|
|
890
948
|
});
|
|
891
949
|
});
|
|
892
950
|
}));
|
|
893
951
|
}
|
|
894
|
-
const
|
|
895
|
-
const n =
|
|
952
|
+
const to = (e, t) => {
|
|
953
|
+
const n = Kr(e, !0, Tn()), r = Jr(n);
|
|
896
954
|
if (!r.pending.length) {
|
|
897
955
|
let a = !0;
|
|
898
956
|
return t && setTimeout(() => {
|
|
899
|
-
a && t(r.loaded, r.missing, r.pending,
|
|
957
|
+
a && t(r.loaded, r.missing, r.pending, Gt);
|
|
900
958
|
}), () => {
|
|
901
959
|
a = !1;
|
|
902
960
|
};
|
|
903
961
|
}
|
|
904
962
|
const o = /* @__PURE__ */ Object.create(null), s = [];
|
|
905
|
-
let i,
|
|
963
|
+
let i, c;
|
|
906
964
|
return r.pending.forEach((a) => {
|
|
907
|
-
const { provider: u, prefix:
|
|
908
|
-
if (
|
|
909
|
-
i = u,
|
|
910
|
-
const
|
|
911
|
-
|
|
965
|
+
const { provider: u, prefix: d } = a;
|
|
966
|
+
if (d === c && u === i) return;
|
|
967
|
+
i = u, c = d, s.push(Te(u, d));
|
|
968
|
+
const h = o[u] || (o[u] = /* @__PURE__ */ Object.create(null));
|
|
969
|
+
h[d] || (h[d] = []);
|
|
912
970
|
}), r.pending.forEach((a) => {
|
|
913
|
-
const { provider: u, prefix:
|
|
914
|
-
|
|
971
|
+
const { provider: u, prefix: d, name: h } = a, m = Te(u, d), g = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
|
|
972
|
+
g.has(h) || (g.add(h), o[u][d].push(h));
|
|
915
973
|
}), s.forEach((a) => {
|
|
916
974
|
const u = o[a.provider][a.prefix];
|
|
917
|
-
u.length &&
|
|
918
|
-
}), t ?
|
|
975
|
+
u.length && eo(a, u);
|
|
976
|
+
}), t ? Vr(t, r, s) : Gt;
|
|
919
977
|
};
|
|
920
|
-
function
|
|
978
|
+
function no(e, t) {
|
|
921
979
|
const n = { ...e };
|
|
922
980
|
for (const r in t) {
|
|
923
981
|
const o = t[r], s = typeof o;
|
|
924
|
-
r in
|
|
982
|
+
r in En ? (o === null || o && (s === "string" || s === "number")) && (n[r] = o) : s === typeof n[r] && (n[r] = r === "rotate" ? o % 4 : o);
|
|
925
983
|
}
|
|
926
984
|
return n;
|
|
927
985
|
}
|
|
928
|
-
const
|
|
929
|
-
function
|
|
930
|
-
t.split(
|
|
986
|
+
const ro = /[\s,]+/;
|
|
987
|
+
function oo(e, t) {
|
|
988
|
+
t.split(ro).forEach((n) => {
|
|
931
989
|
switch (n.trim()) {
|
|
932
990
|
case "horizontal":
|
|
933
991
|
e.hFlip = !0;
|
|
@@ -938,7 +996,7 @@ function Qn(e, t) {
|
|
|
938
996
|
}
|
|
939
997
|
});
|
|
940
998
|
}
|
|
941
|
-
function
|
|
999
|
+
function so(e, t = 0) {
|
|
942
1000
|
const n = e.replace(/^-?[0-9.]*/, "");
|
|
943
1001
|
function r(o) {
|
|
944
1002
|
for (; o < 0; ) o += 4;
|
|
@@ -963,86 +1021,86 @@ function Yn(e, t = 0) {
|
|
|
963
1021
|
}
|
|
964
1022
|
return t;
|
|
965
1023
|
}
|
|
966
|
-
function
|
|
1024
|
+
function io(e, t) {
|
|
967
1025
|
let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
968
1026
|
for (const r in t) n += " " + r + '="' + t[r] + '"';
|
|
969
1027
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
|
|
970
1028
|
}
|
|
971
|
-
function
|
|
1029
|
+
function ao(e) {
|
|
972
1030
|
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
973
1031
|
}
|
|
974
|
-
function
|
|
975
|
-
return "data:image/svg+xml," +
|
|
1032
|
+
function co(e) {
|
|
1033
|
+
return "data:image/svg+xml," + ao(e);
|
|
976
1034
|
}
|
|
977
|
-
function
|
|
978
|
-
return 'url("' +
|
|
1035
|
+
function lo(e) {
|
|
1036
|
+
return 'url("' + co(e) + '")';
|
|
979
1037
|
}
|
|
980
|
-
let
|
|
981
|
-
function
|
|
1038
|
+
let Me;
|
|
1039
|
+
function uo() {
|
|
982
1040
|
try {
|
|
983
|
-
|
|
1041
|
+
Me = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
|
|
984
1042
|
} catch {
|
|
985
|
-
|
|
1043
|
+
Me = null;
|
|
986
1044
|
}
|
|
987
1045
|
}
|
|
988
|
-
function
|
|
989
|
-
return
|
|
1046
|
+
function fo(e) {
|
|
1047
|
+
return Me === void 0 && uo(), Me ? Me.createHTML(e) : e;
|
|
990
1048
|
}
|
|
991
|
-
const
|
|
992
|
-
...
|
|
1049
|
+
const jn = {
|
|
1050
|
+
...Pn,
|
|
993
1051
|
inline: !1
|
|
994
|
-
},
|
|
1052
|
+
}, po = {
|
|
995
1053
|
xmlns: "http://www.w3.org/2000/svg",
|
|
996
1054
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
997
1055
|
"aria-hidden": !0,
|
|
998
1056
|
role: "img"
|
|
999
|
-
},
|
|
1057
|
+
}, ho = {
|
|
1000
1058
|
display: "inline-block"
|
|
1001
|
-
},
|
|
1059
|
+
}, bt = {
|
|
1002
1060
|
backgroundColor: "currentColor"
|
|
1003
|
-
},
|
|
1061
|
+
}, An = {
|
|
1004
1062
|
backgroundColor: "transparent"
|
|
1005
|
-
},
|
|
1063
|
+
}, Qt = {
|
|
1006
1064
|
Image: "var(--svg)",
|
|
1007
1065
|
Repeat: "no-repeat",
|
|
1008
1066
|
Size: "100% 100%"
|
|
1009
|
-
},
|
|
1010
|
-
WebkitMask:
|
|
1011
|
-
mask:
|
|
1012
|
-
background:
|
|
1067
|
+
}, Yt = {
|
|
1068
|
+
WebkitMask: bt,
|
|
1069
|
+
mask: bt,
|
|
1070
|
+
background: An
|
|
1013
1071
|
};
|
|
1014
|
-
for (const e in
|
|
1015
|
-
const t =
|
|
1016
|
-
for (const n in
|
|
1017
|
-
t[e + n] =
|
|
1072
|
+
for (const e in Yt) {
|
|
1073
|
+
const t = Yt[e];
|
|
1074
|
+
for (const n in Qt)
|
|
1075
|
+
t[e + n] = Qt[n];
|
|
1018
1076
|
}
|
|
1019
|
-
const
|
|
1020
|
-
...
|
|
1077
|
+
const mo = {
|
|
1078
|
+
...jn,
|
|
1021
1079
|
inline: !0
|
|
1022
1080
|
};
|
|
1023
|
-
function
|
|
1081
|
+
function Zt(e) {
|
|
1024
1082
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1025
1083
|
}
|
|
1026
|
-
const
|
|
1027
|
-
const r = t.inline ?
|
|
1028
|
-
...s === "svg" ?
|
|
1084
|
+
const go = (e, t, n) => {
|
|
1085
|
+
const r = t.inline ? mo : jn, o = no(r, t), s = t.mode || "svg", i = {}, c = t.style || {}, a = {
|
|
1086
|
+
...s === "svg" ? po : {}
|
|
1029
1087
|
};
|
|
1030
1088
|
if (n) {
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
const v = ["iconify"],
|
|
1089
|
+
const y = et(n, !1, !0);
|
|
1090
|
+
if (y) {
|
|
1091
|
+
const v = ["iconify"], B = [
|
|
1034
1092
|
"provider",
|
|
1035
1093
|
"prefix"
|
|
1036
1094
|
];
|
|
1037
|
-
for (const
|
|
1038
|
-
|
|
1095
|
+
for (const P of B)
|
|
1096
|
+
y[P] && v.push("iconify--" + y[P]);
|
|
1039
1097
|
a.className = v.join(" ");
|
|
1040
1098
|
}
|
|
1041
1099
|
}
|
|
1042
|
-
for (let
|
|
1043
|
-
const v = t[
|
|
1100
|
+
for (let y in t) {
|
|
1101
|
+
const v = t[y];
|
|
1044
1102
|
if (v !== void 0)
|
|
1045
|
-
switch (
|
|
1103
|
+
switch (y) {
|
|
1046
1104
|
// Properties to ignore
|
|
1047
1105
|
case "icon":
|
|
1048
1106
|
case "style":
|
|
@@ -1058,17 +1116,17 @@ const ao = (e, t, n) => {
|
|
|
1058
1116
|
break;
|
|
1059
1117
|
// Merge class names
|
|
1060
1118
|
case "className":
|
|
1061
|
-
a[
|
|
1119
|
+
a[y] = (a[y] ? a[y] + " " : "") + v;
|
|
1062
1120
|
break;
|
|
1063
1121
|
// Boolean attributes
|
|
1064
1122
|
case "inline":
|
|
1065
1123
|
case "hFlip":
|
|
1066
1124
|
case "vFlip":
|
|
1067
|
-
o[
|
|
1125
|
+
o[y] = v === !0 || v === "true" || v === 1;
|
|
1068
1126
|
break;
|
|
1069
1127
|
// Flip as string: 'horizontal,vertical'
|
|
1070
1128
|
case "flip":
|
|
1071
|
-
typeof v == "string" &&
|
|
1129
|
+
typeof v == "string" && oo(o, v);
|
|
1072
1130
|
break;
|
|
1073
1131
|
// Color: copy to style
|
|
1074
1132
|
case "color":
|
|
@@ -1076,7 +1134,7 @@ const ao = (e, t, n) => {
|
|
|
1076
1134
|
break;
|
|
1077
1135
|
// Rotation as string
|
|
1078
1136
|
case "rotate":
|
|
1079
|
-
typeof v == "string" ? o[
|
|
1137
|
+
typeof v == "string" ? o[y] = so(v) : typeof v == "number" && (o[y] = v);
|
|
1080
1138
|
break;
|
|
1081
1139
|
// Remove aria-hidden
|
|
1082
1140
|
case "ariaHidden":
|
|
@@ -1085,37 +1143,37 @@ const ao = (e, t, n) => {
|
|
|
1085
1143
|
break;
|
|
1086
1144
|
// Copy missing property if it does not exist in customisations
|
|
1087
1145
|
default:
|
|
1088
|
-
r[
|
|
1146
|
+
r[y] === void 0 && (a[y] = v);
|
|
1089
1147
|
}
|
|
1090
1148
|
}
|
|
1091
|
-
const u =
|
|
1149
|
+
const u = Tr(e, o), d = u.attributes;
|
|
1092
1150
|
if (o.inline && (i.verticalAlign = "-0.125em"), s === "svg") {
|
|
1093
1151
|
a.style = {
|
|
1094
1152
|
...i,
|
|
1095
|
-
...
|
|
1096
|
-
}, Object.assign(a,
|
|
1097
|
-
let
|
|
1153
|
+
...c
|
|
1154
|
+
}, Object.assign(a, d);
|
|
1155
|
+
let y = 0, v = t.id;
|
|
1098
1156
|
return typeof v == "string" && (v = v.replace(/-/g, "_")), a.dangerouslySetInnerHTML = {
|
|
1099
|
-
__html:
|
|
1100
|
-
},
|
|
1157
|
+
__html: fo($r(u.body, v ? () => v + "ID" + y++ : "iconifyReact"))
|
|
1158
|
+
}, pt("svg", a);
|
|
1101
1159
|
}
|
|
1102
|
-
const { body:
|
|
1103
|
-
...
|
|
1104
|
-
width:
|
|
1105
|
-
height:
|
|
1160
|
+
const { body: h, width: m, height: g } = e, S = s === "mask" || (s === "bg" ? !1 : h.indexOf("currentColor") !== -1), _ = io(h, {
|
|
1161
|
+
...d,
|
|
1162
|
+
width: m + "",
|
|
1163
|
+
height: g + ""
|
|
1106
1164
|
});
|
|
1107
1165
|
return a.style = {
|
|
1108
1166
|
...i,
|
|
1109
|
-
"--svg":
|
|
1110
|
-
width:
|
|
1111
|
-
height:
|
|
1112
|
-
...
|
|
1113
|
-
...
|
|
1114
|
-
...
|
|
1115
|
-
},
|
|
1167
|
+
"--svg": lo(_),
|
|
1168
|
+
width: Zt(d.width),
|
|
1169
|
+
height: Zt(d.height),
|
|
1170
|
+
...ho,
|
|
1171
|
+
...S ? bt : An,
|
|
1172
|
+
...c
|
|
1173
|
+
}, pt("span", a);
|
|
1116
1174
|
};
|
|
1117
|
-
|
|
1118
|
-
|
|
1175
|
+
Tn(!0);
|
|
1176
|
+
jr("", Hr);
|
|
1119
1177
|
if (typeof document < "u" && typeof window < "u") {
|
|
1120
1178
|
const e = window;
|
|
1121
1179
|
if (e.IconifyPreload !== void 0) {
|
|
@@ -1125,7 +1183,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1125
1183
|
// Check if item is an object and not null/array
|
|
1126
1184
|
(typeof r != "object" || r === null || r instanceof Array || // Check for 'icons' and 'prefix'
|
|
1127
1185
|
typeof r.icons != "object" || typeof r.prefix != "string" || // Add icon set
|
|
1128
|
-
!
|
|
1186
|
+
!Sr(r)) && console.error(n);
|
|
1129
1187
|
} catch {
|
|
1130
1188
|
console.error(n);
|
|
1131
1189
|
}
|
|
@@ -1140,106 +1198,94 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
1140
1198
|
const o = t[n];
|
|
1141
1199
|
if (typeof o != "object" || !o || o.resources === void 0)
|
|
1142
1200
|
continue;
|
|
1143
|
-
|
|
1201
|
+
Ar(n, o) || console.error(r);
|
|
1144
1202
|
} catch {
|
|
1145
1203
|
console.error(r);
|
|
1146
1204
|
}
|
|
1147
1205
|
}
|
|
1148
1206
|
}
|
|
1149
1207
|
}
|
|
1150
|
-
function
|
|
1151
|
-
const [t, n] =
|
|
1152
|
-
function s(
|
|
1153
|
-
if (
|
|
1154
|
-
const
|
|
1155
|
-
if (typeof
|
|
1208
|
+
function Ln(e) {
|
|
1209
|
+
const [t, n] = M(!!e.ssr), [r, o] = M({});
|
|
1210
|
+
function s(g) {
|
|
1211
|
+
if (g) {
|
|
1212
|
+
const S = e.icon;
|
|
1213
|
+
if (typeof S == "object")
|
|
1156
1214
|
return {
|
|
1157
1215
|
name: "",
|
|
1158
|
-
data:
|
|
1216
|
+
data: S
|
|
1159
1217
|
};
|
|
1160
|
-
const
|
|
1161
|
-
if (
|
|
1218
|
+
const _ = zt(S);
|
|
1219
|
+
if (_)
|
|
1162
1220
|
return {
|
|
1163
|
-
name:
|
|
1164
|
-
data:
|
|
1221
|
+
name: S,
|
|
1222
|
+
data: _
|
|
1165
1223
|
};
|
|
1166
1224
|
}
|
|
1167
1225
|
return {
|
|
1168
1226
|
name: ""
|
|
1169
1227
|
};
|
|
1170
1228
|
}
|
|
1171
|
-
const [i,
|
|
1229
|
+
const [i, c] = M(s(!!e.ssr));
|
|
1172
1230
|
function a() {
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1231
|
+
const g = r.callback;
|
|
1232
|
+
g && (g(), o({}));
|
|
1175
1233
|
}
|
|
1176
|
-
function u(
|
|
1177
|
-
if (JSON.stringify(i) !== JSON.stringify(
|
|
1178
|
-
return a(),
|
|
1234
|
+
function u(g) {
|
|
1235
|
+
if (JSON.stringify(i) !== JSON.stringify(g))
|
|
1236
|
+
return a(), c(g), !0;
|
|
1179
1237
|
}
|
|
1180
|
-
function
|
|
1181
|
-
var
|
|
1182
|
-
const
|
|
1183
|
-
if (typeof
|
|
1238
|
+
function d() {
|
|
1239
|
+
var g;
|
|
1240
|
+
const S = e.icon;
|
|
1241
|
+
if (typeof S == "object") {
|
|
1184
1242
|
u({
|
|
1185
1243
|
name: "",
|
|
1186
|
-
data:
|
|
1244
|
+
data: S
|
|
1187
1245
|
});
|
|
1188
1246
|
return;
|
|
1189
1247
|
}
|
|
1190
|
-
const
|
|
1248
|
+
const _ = zt(S);
|
|
1191
1249
|
if (u({
|
|
1192
|
-
name:
|
|
1193
|
-
data:
|
|
1250
|
+
name: S,
|
|
1251
|
+
data: _
|
|
1194
1252
|
}))
|
|
1195
|
-
if (
|
|
1196
|
-
const
|
|
1253
|
+
if (_ === void 0) {
|
|
1254
|
+
const y = to([S], d);
|
|
1197
1255
|
o({
|
|
1198
|
-
callback:
|
|
1256
|
+
callback: y
|
|
1199
1257
|
});
|
|
1200
|
-
} else
|
|
1258
|
+
} else _ && ((g = e.onLoad) === null || g === void 0 || g.call(e, S));
|
|
1201
1259
|
}
|
|
1202
|
-
|
|
1203
|
-
t &&
|
|
1260
|
+
ge(() => (n(!0), a), []), ge(() => {
|
|
1261
|
+
t && d();
|
|
1204
1262
|
}, [e.icon, t]);
|
|
1205
|
-
const { name:
|
|
1206
|
-
return
|
|
1207
|
-
...
|
|
1208
|
-
...
|
|
1209
|
-
}, e,
|
|
1263
|
+
const { name: h, data: m } = i;
|
|
1264
|
+
return m ? go({
|
|
1265
|
+
...kt,
|
|
1266
|
+
...m
|
|
1267
|
+
}, e, h) : e.children ? e.children : e.fallback ? e.fallback : pt("span", {});
|
|
1210
1268
|
}
|
|
1211
|
-
const
|
|
1269
|
+
const Xt = yn((e, t) => Ln({
|
|
1212
1270
|
...e,
|
|
1213
1271
|
_ref: t
|
|
1214
1272
|
}));
|
|
1215
|
-
|
|
1273
|
+
yn((e, t) => Ln({
|
|
1216
1274
|
inline: !0,
|
|
1217
1275
|
...e,
|
|
1218
1276
|
_ref: t
|
|
1219
1277
|
}));
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
name: "product",
|
|
1224
|
-
initialState: co,
|
|
1225
|
-
reducers: {
|
|
1226
|
-
setProduct: (e, t) => {
|
|
1227
|
-
e.product = t.payload;
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
}), { setProduct: et } = Kt.actions;
|
|
1231
|
-
Kt.reducer;
|
|
1232
|
-
function lo() {
|
|
1233
|
-
const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, n] = D(e);
|
|
1234
|
-
return fe(() => {
|
|
1278
|
+
function yo() {
|
|
1279
|
+
const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, n] = M(e);
|
|
1280
|
+
return ge(() => {
|
|
1235
1281
|
const r = () => n(e());
|
|
1236
1282
|
return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
1237
1283
|
}, []), t;
|
|
1238
1284
|
}
|
|
1239
|
-
const
|
|
1285
|
+
const bo = ({
|
|
1240
1286
|
product: e
|
|
1241
1287
|
}) => {
|
|
1242
|
-
const t =
|
|
1288
|
+
const t = mn(), n = yo(), [r, o] = M(0), s = () => {
|
|
1243
1289
|
o(
|
|
1244
1290
|
(a) => a + n >= e.length ? 0 : a + n
|
|
1245
1291
|
);
|
|
@@ -1247,49 +1293,49 @@ const uo = ({
|
|
|
1247
1293
|
o(
|
|
1248
1294
|
(a) => a - n < 0 ? e.length - (e.length % n || n) : a - n
|
|
1249
1295
|
);
|
|
1250
|
-
},
|
|
1251
|
-
const u = await
|
|
1252
|
-
t(
|
|
1296
|
+
}, c = async (a) => {
|
|
1297
|
+
const u = await kn(a);
|
|
1298
|
+
t(ht(u));
|
|
1253
1299
|
};
|
|
1254
|
-
return /* @__PURE__ */
|
|
1255
|
-
(e == null ? void 0 : e.length) > n && /* @__PURE__ */
|
|
1300
|
+
return /* @__PURE__ */ l("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ p("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
1301
|
+
(e == null ? void 0 : e.length) > n && /* @__PURE__ */ l(
|
|
1256
1302
|
"button",
|
|
1257
1303
|
{
|
|
1258
1304
|
onClick: i,
|
|
1259
1305
|
className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
1260
|
-
children: /* @__PURE__ */
|
|
1306
|
+
children: /* @__PURE__ */ l(Xt, { icon: "mdi:chevron-left", width: "25" })
|
|
1261
1307
|
}
|
|
1262
1308
|
),
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
var u,
|
|
1265
|
-
return /* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ l("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: e.slice(r, r + n).map((a) => {
|
|
1310
|
+
var u, d, h, m;
|
|
1311
|
+
return /* @__PURE__ */ p(
|
|
1266
1312
|
"div",
|
|
1267
1313
|
{
|
|
1268
1314
|
className: "flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",
|
|
1269
1315
|
onClick: () => {
|
|
1270
|
-
|
|
1316
|
+
c(a.product_id ?? a.productId);
|
|
1271
1317
|
},
|
|
1272
1318
|
children: [
|
|
1273
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ l("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ l(
|
|
1274
1320
|
"img",
|
|
1275
1321
|
{
|
|
1276
|
-
src: ((u =
|
|
1322
|
+
src: ((u = Ut(a)[0]) == null ? void 0 : u.link) || Ut(a)[0] || // fallback if it's a string
|
|
1277
1323
|
"https://via.placeholder.com/120",
|
|
1278
1324
|
alt: a != null && a.productName ? a.productName : "Product",
|
|
1279
1325
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
1280
1326
|
}
|
|
1281
1327
|
) }),
|
|
1282
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ p(
|
|
1283
1329
|
"div",
|
|
1284
1330
|
{
|
|
1285
1331
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
1286
1332
|
children: [
|
|
1287
|
-
/* @__PURE__ */
|
|
1288
|
-
/* @__PURE__ */
|
|
1289
|
-
|
|
1333
|
+
/* @__PURE__ */ p("div", { className: "relative inline-block group", children: [
|
|
1334
|
+
/* @__PURE__ */ l("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : Bt(
|
|
1335
|
+
Mt((d = a == null ? void 0 : a.name) == null ? void 0 : d["en-US"]),
|
|
1290
1336
|
60
|
|
1291
1337
|
) || "Product" }),
|
|
1292
|
-
/* @__PURE__ */
|
|
1338
|
+
/* @__PURE__ */ l(
|
|
1293
1339
|
"div",
|
|
1294
1340
|
{
|
|
1295
1341
|
className: "absolute left-0 top-full mt-1 w-max max-w-[200px] p-2 bg-white shadow-lg text-black text-xs rounded opacity-0 transition-opacity duration-300 group-hover:opacity-100 z-50 pointer-events-auto",
|
|
@@ -1300,19 +1346,19 @@ const uo = ({
|
|
|
1300
1346
|
marginBottom: "5px",
|
|
1301
1347
|
zIndex: 50
|
|
1302
1348
|
},
|
|
1303
|
-
children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name :
|
|
1304
|
-
|
|
1349
|
+
children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : Bt(
|
|
1350
|
+
Mt((h = a == null ? void 0 : a.name) == null ? void 0 : h["en-US"]),
|
|
1305
1351
|
60
|
|
1306
1352
|
) || "Product"
|
|
1307
1353
|
}
|
|
1308
1354
|
)
|
|
1309
1355
|
] }),
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
a != null && a.price ? Number(a == null ? void 0 : a.price) :
|
|
1313
|
-
(
|
|
1356
|
+
/* @__PURE__ */ p("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
1357
|
+
/* @__PURE__ */ l("p", { children: pr(
|
|
1358
|
+
a != null && a.price ? Number(a == null ? void 0 : a.price) : qt(a).centAmount || 0,
|
|
1359
|
+
(m = qt(a)) == null ? void 0 : m.currencyCode
|
|
1314
1360
|
) }),
|
|
1315
|
-
/* @__PURE__ */
|
|
1361
|
+
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
1316
1362
|
"$",
|
|
1317
1363
|
Number(a == null ? void 0 : a.price).toFixed(2) ?? 5
|
|
1318
1364
|
] })
|
|
@@ -1325,16 +1371,16 @@ const uo = ({
|
|
|
1325
1371
|
a.productId
|
|
1326
1372
|
);
|
|
1327
1373
|
}) }),
|
|
1328
|
-
(e == null ? void 0 : e.length) > n && /* @__PURE__ */
|
|
1374
|
+
(e == null ? void 0 : e.length) > n && /* @__PURE__ */ l(
|
|
1329
1375
|
"button",
|
|
1330
1376
|
{
|
|
1331
1377
|
onClick: s,
|
|
1332
1378
|
className: "absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
1333
|
-
children: /* @__PURE__ */
|
|
1379
|
+
children: /* @__PURE__ */ l(Xt, { icon: "mdi:chevron-right", width: "25" })
|
|
1334
1380
|
}
|
|
1335
1381
|
)
|
|
1336
1382
|
] }) });
|
|
1337
|
-
},
|
|
1383
|
+
}, wo = ({ chat: e, storeDetails: t }) => /* @__PURE__ */ l("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: e.map((n, r) => /* @__PURE__ */ p(
|
|
1338
1384
|
"div",
|
|
1339
1385
|
{
|
|
1340
1386
|
className: "mb-4 p-3 rounded-xl",
|
|
@@ -1343,15 +1389,15 @@ const uo = ({
|
|
|
1343
1389
|
// backgroundColor: storeDetails.tanyaThemeColorLight
|
|
1344
1390
|
},
|
|
1345
1391
|
children: [
|
|
1346
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ l(
|
|
1347
1393
|
"div",
|
|
1348
1394
|
{
|
|
1349
1395
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
1350
|
-
children:
|
|
1396
|
+
children: hr(n.keyword) || "No keyword"
|
|
1351
1397
|
}
|
|
1352
1398
|
),
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
|
|
1399
|
+
/* @__PURE__ */ l(
|
|
1400
|
+
bo,
|
|
1355
1401
|
{
|
|
1356
1402
|
product: n.items,
|
|
1357
1403
|
storeDetails: t
|
|
@@ -1360,13 +1406,13 @@ const uo = ({
|
|
|
1360
1406
|
]
|
|
1361
1407
|
},
|
|
1362
1408
|
r
|
|
1363
|
-
)) }),
|
|
1364
|
-
const { serverUrl: n, basePath: r } =
|
|
1409
|
+
)) }), Dn = async (e, t) => {
|
|
1410
|
+
const { serverUrl: n, basePath: r } = ye(), o = `${n}`;
|
|
1365
1411
|
console.log(`customer_token
|
|
1366
1412
|
`, e);
|
|
1367
1413
|
try {
|
|
1368
|
-
return (await
|
|
1369
|
-
`${o}${r}/basket/create?baseUrl=${
|
|
1414
|
+
return (await q.post(
|
|
1415
|
+
`${o}${r}/basket/create?baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
|
|
1370
1416
|
t,
|
|
1371
1417
|
{
|
|
1372
1418
|
headers: {
|
|
@@ -1376,13 +1422,13 @@ const uo = ({
|
|
|
1376
1422
|
}
|
|
1377
1423
|
)).data;
|
|
1378
1424
|
} catch (s) {
|
|
1379
|
-
return
|
|
1425
|
+
return q.isAxiosError(s) ? console.error("Error creating basket:", s.response || s.message) : console.error("Unexpected error:", s), null;
|
|
1380
1426
|
}
|
|
1381
|
-
},
|
|
1382
|
-
const { serverUrl: r, basePath: o } =
|
|
1427
|
+
}, Qe = async (e, t, n) => {
|
|
1428
|
+
const { serverUrl: r, basePath: o } = ye(), s = `${r}`;
|
|
1383
1429
|
try {
|
|
1384
|
-
const i = await
|
|
1385
|
-
`${s}${o}/basket/add-product/${e}?baseUrl=${
|
|
1430
|
+
const i = await q.post(
|
|
1431
|
+
`${s}${o}/basket/add-product/${e}?baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
|
|
1386
1432
|
t,
|
|
1387
1433
|
{
|
|
1388
1434
|
headers: {
|
|
@@ -1393,20 +1439,20 @@ const uo = ({
|
|
|
1393
1439
|
);
|
|
1394
1440
|
return i.status === 200 && i.data ? i.data : null;
|
|
1395
1441
|
} catch (i) {
|
|
1396
|
-
return
|
|
1442
|
+
return q.isAxiosError(i) ? console.error(
|
|
1397
1443
|
"Error adding products to basket:",
|
|
1398
1444
|
i.response || i.message
|
|
1399
1445
|
) : console.error("Unexpected error:", i), null;
|
|
1400
1446
|
}
|
|
1401
|
-
},
|
|
1447
|
+
}, Mn = async ({
|
|
1402
1448
|
basketId: e,
|
|
1403
1449
|
customer_token: t
|
|
1404
1450
|
}) => {
|
|
1405
1451
|
var s;
|
|
1406
|
-
const { serverUrl: n, basePath: r } =
|
|
1452
|
+
const { serverUrl: n, basePath: r } = ye(), o = `${n}`;
|
|
1407
1453
|
try {
|
|
1408
|
-
const i = await
|
|
1409
|
-
`${o}${r}/basket/${e}?baseUrl=${
|
|
1454
|
+
const i = await q.get(
|
|
1455
|
+
`${o}${r}/basket/${e}?baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
|
|
1410
1456
|
{
|
|
1411
1457
|
headers: {
|
|
1412
1458
|
"Content-Type": "application/json",
|
|
@@ -1416,151 +1462,151 @@ const uo = ({
|
|
|
1416
1462
|
);
|
|
1417
1463
|
return { status: i.status, data: i.data };
|
|
1418
1464
|
} catch (i) {
|
|
1419
|
-
return
|
|
1465
|
+
return q.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
|
|
1420
1466
|
}
|
|
1421
|
-
},
|
|
1422
|
-
const
|
|
1467
|
+
}, en = "sfcc_basket_id", tn = "sfcc_customer_token", qe = "sfcc_token_expiry", xo = 300 * 1e3, Ae = "1.0.0";
|
|
1468
|
+
const Fe = (e) => {
|
|
1423
1469
|
try {
|
|
1424
|
-
e ? localStorage.setItem(
|
|
1470
|
+
e ? localStorage.setItem(en, e) : localStorage.removeItem(en);
|
|
1425
1471
|
} catch (t) {
|
|
1426
1472
|
console.error("Error saving basket ID to storage:", t);
|
|
1427
1473
|
}
|
|
1428
|
-
},
|
|
1474
|
+
}, Ye = (e) => {
|
|
1429
1475
|
try {
|
|
1430
1476
|
if (e) {
|
|
1431
|
-
localStorage.setItem(
|
|
1432
|
-
const t = Date.now() +
|
|
1433
|
-
localStorage.setItem(
|
|
1477
|
+
localStorage.setItem(tn, e);
|
|
1478
|
+
const t = Date.now() + xo;
|
|
1479
|
+
localStorage.setItem(qe, t.toString());
|
|
1434
1480
|
} else
|
|
1435
|
-
localStorage.removeItem(
|
|
1481
|
+
localStorage.removeItem(tn);
|
|
1436
1482
|
} catch (t) {
|
|
1437
1483
|
console.error("Error storing token:", t);
|
|
1438
1484
|
}
|
|
1439
|
-
},
|
|
1440
|
-
var
|
|
1441
|
-
const e =
|
|
1442
|
-
if (
|
|
1485
|
+
}, nn = 300, vo = () => {
|
|
1486
|
+
var c, a, u, d, h, m;
|
|
1487
|
+
const e = mn(), t = Ge((g) => g.product.product), n = Ge((g) => g.store.store), [r, o] = M(!!t);
|
|
1488
|
+
if (ge(() => {
|
|
1443
1489
|
o(!!t);
|
|
1444
1490
|
}, [t]), !t) return null;
|
|
1445
1491
|
const s = async () => {
|
|
1446
|
-
var
|
|
1492
|
+
var g, S, _, y, v, B, P, j, X, k, L, z, V, O, be, E;
|
|
1447
1493
|
console.log(t, "the prod");
|
|
1448
1494
|
try {
|
|
1449
|
-
if (!((
|
|
1450
|
-
|
|
1495
|
+
if (!((S = (g = t == null ? void 0 : t.variants) == null ? void 0 : g[0]) != null && S.product_id) && !(t.type.item || t.type.bundle) && !((y = (_ = t == null ? void 0 : t.variants) == null ? void 0 : _[0]) != null && y.productId)) {
|
|
1496
|
+
Z.error("Variants not available", {
|
|
1451
1497
|
position: "bottom-right",
|
|
1452
1498
|
autoClose: 1e3
|
|
1453
1499
|
}), console.error("No product variant found");
|
|
1454
1500
|
return;
|
|
1455
1501
|
}
|
|
1456
|
-
const
|
|
1502
|
+
const $ = [
|
|
1457
1503
|
{
|
|
1458
|
-
product_id: ((v = t.variants) == null ? void 0 : v[0].product_id) || ((
|
|
1504
|
+
product_id: ((v = t.variants) == null ? void 0 : v[0].product_id) || ((B = t.variants) == null ? void 0 : B[0].productId) || (t == null ? void 0 : t.id),
|
|
1459
1505
|
quantity: 1
|
|
1460
1506
|
}
|
|
1461
1507
|
];
|
|
1462
|
-
console.log(
|
|
1463
|
-
const
|
|
1508
|
+
console.log($, "the product data");
|
|
1509
|
+
const Pe = JSON.parse(
|
|
1464
1510
|
sessionStorage.getItem("customerData") || "{}"
|
|
1465
|
-
),
|
|
1466
|
-
if (!
|
|
1467
|
-
let
|
|
1511
|
+
), de = Pe == null ? void 0 : Pe.basketId, tt = !1, re = localStorage.getItem(qe), pe = Date.now();
|
|
1512
|
+
if (!tt || !re || pe >= parseInt(re)) {
|
|
1513
|
+
let J = "";
|
|
1468
1514
|
{
|
|
1469
|
-
const
|
|
1470
|
-
console.log("token from auth data"),
|
|
1515
|
+
const we = await Xe();
|
|
1516
|
+
console.log("token from auth data"), J = "Bearer " + we.access_token;
|
|
1471
1517
|
}
|
|
1472
|
-
if (!
|
|
1518
|
+
if (!J) {
|
|
1473
1519
|
console.error("Failed to get customer_token");
|
|
1474
1520
|
return;
|
|
1475
1521
|
}
|
|
1476
|
-
const
|
|
1477
|
-
if (
|
|
1478
|
-
const
|
|
1479
|
-
basketId:
|
|
1480
|
-
customer_token:
|
|
1522
|
+
const nt = pe + 300 * 1e3;
|
|
1523
|
+
if (Ye(J), localStorage.setItem(qe, nt.toString()), de) {
|
|
1524
|
+
const we = await Mn({
|
|
1525
|
+
basketId: de,
|
|
1526
|
+
customer_token: J
|
|
1481
1527
|
});
|
|
1482
|
-
if (console.log(
|
|
1483
|
-
const
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1528
|
+
if (console.log(de, "basket id from customer"), we.status === 200 && we) {
|
|
1529
|
+
const oe = await Qe(
|
|
1530
|
+
de,
|
|
1531
|
+
$,
|
|
1532
|
+
J
|
|
1487
1533
|
);
|
|
1488
|
-
(((
|
|
1534
|
+
(((P = oe == null ? void 0 : oe.product_items) == null ? void 0 : P.length) > 0 || ((j = oe == null ? void 0 : oe.productItems) == null ? void 0 : j.length) > 0) && (Z.success("Added to cart", {
|
|
1489
1535
|
position: "bottom-right",
|
|
1490
1536
|
autoClose: 3e3,
|
|
1491
1537
|
hideProgressBar: !1,
|
|
1492
1538
|
closeOnClick: !0,
|
|
1493
1539
|
pauseOnHover: !0,
|
|
1494
1540
|
draggable: !0
|
|
1495
|
-
}),
|
|
1541
|
+
}), Ne(de));
|
|
1496
1542
|
return;
|
|
1497
1543
|
}
|
|
1498
1544
|
}
|
|
1499
|
-
const
|
|
1545
|
+
const rt = {
|
|
1500
1546
|
productItems: [
|
|
1501
1547
|
{
|
|
1502
|
-
productId: ((
|
|
1548
|
+
productId: ((X = t.variants) == null ? void 0 : X[0].product_id) || ((k = t.variants) == null ? void 0 : k[0].productId) || (t == null ? void 0 : t.id),
|
|
1503
1549
|
quantity: 1
|
|
1504
1550
|
}
|
|
1505
1551
|
]
|
|
1506
1552
|
};
|
|
1507
1553
|
console.log("before create basket");
|
|
1508
|
-
const
|
|
1554
|
+
const w = await Dn(J, rt);
|
|
1509
1555
|
if (console.log(
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1556
|
+
w,
|
|
1557
|
+
w == null ? void 0 : w.basket_id,
|
|
1558
|
+
w == null ? void 0 : w.basketId,
|
|
1513
1559
|
"the basket response"
|
|
1514
|
-
), !(
|
|
1560
|
+
), !(w != null && w.basket_id) && !(w != null && w.basketId)) {
|
|
1515
1561
|
console.error("Failed to create basket");
|
|
1516
1562
|
return;
|
|
1517
1563
|
}
|
|
1518
1564
|
console.log(
|
|
1519
1565
|
"setting stored id",
|
|
1520
|
-
(
|
|
1521
|
-
),
|
|
1522
|
-
(
|
|
1566
|
+
(w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId)
|
|
1567
|
+
), Fe(
|
|
1568
|
+
(w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId)
|
|
1523
1569
|
), console.log("adding product to basket");
|
|
1524
|
-
const
|
|
1525
|
-
(
|
|
1526
|
-
|
|
1527
|
-
|
|
1570
|
+
const K = await Qe(
|
|
1571
|
+
(w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId),
|
|
1572
|
+
$,
|
|
1573
|
+
J
|
|
1528
1574
|
);
|
|
1529
|
-
console.log("object added to basket"), (((
|
|
1575
|
+
console.log("object added to basket"), (((L = K == null ? void 0 : K.product_items) == null ? void 0 : L.length) > 0 || ((z = K == null ? void 0 : K.productItems) == null ? void 0 : z.length) > 0) && Z.success("Added to cart", {
|
|
1530
1576
|
position: "bottom-right",
|
|
1531
1577
|
autoClose: 3e3,
|
|
1532
1578
|
hideProgressBar: !1,
|
|
1533
1579
|
closeOnClick: !0,
|
|
1534
1580
|
pauseOnHover: !0,
|
|
1535
1581
|
draggable: !0
|
|
1536
|
-
}),
|
|
1582
|
+
}), Ne(w.basket_id || (w == null ? void 0 : w.basketId));
|
|
1537
1583
|
}
|
|
1538
|
-
} catch (
|
|
1539
|
-
console.error("Error adding to cart:",
|
|
1584
|
+
} catch ($) {
|
|
1585
|
+
console.error("Error adding to cart:", $), Z.error("Failed to add product to cart", {
|
|
1540
1586
|
position: "bottom-right",
|
|
1541
1587
|
autoClose: 3e3
|
|
1542
|
-
}), ((
|
|
1543
|
-
((
|
|
1588
|
+
}), ((V = $ == null ? void 0 : $.response) == null ? void 0 : V.status) === 404 || // Basket not found
|
|
1589
|
+
((O = $ == null ? void 0 : $.response) == null ? void 0 : O.status) === 401 ? (((be = $ == null ? void 0 : $.response) == null ? void 0 : be.status) === 404 && Fe(null), ((E = $ == null ? void 0 : $.response) == null ? void 0 : E.status) === 401 && (Fe(null), Ye(null))) : (console.error("Failed to add product to basket:", $.message), Z.error("Failed to add product to cart", {
|
|
1544
1590
|
position: "bottom-right",
|
|
1545
1591
|
autoClose: 3e3
|
|
1546
1592
|
}));
|
|
1547
1593
|
} finally {
|
|
1548
|
-
|
|
1594
|
+
Ne();
|
|
1549
1595
|
}
|
|
1550
1596
|
}, i = () => {
|
|
1551
1597
|
t && (window.location.href = t.c_pdpUrl);
|
|
1552
1598
|
};
|
|
1553
|
-
return console.log(t, "the prod"), /* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1599
|
+
return console.log(t, "the prod"), /* @__PURE__ */ p(dt, { children: [
|
|
1600
|
+
/* @__PURE__ */ l(
|
|
1555
1601
|
"div",
|
|
1556
1602
|
{
|
|
1557
1603
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1558
1604
|
onClick: () => {
|
|
1559
|
-
o(!1), setTimeout(() => e(
|
|
1605
|
+
o(!1), setTimeout(() => e(ht(null)), nn);
|
|
1560
1606
|
}
|
|
1561
1607
|
}
|
|
1562
1608
|
),
|
|
1563
|
-
/* @__PURE__ */
|
|
1609
|
+
/* @__PURE__ */ p(
|
|
1564
1610
|
"div",
|
|
1565
1611
|
{
|
|
1566
1612
|
className: `
|
|
@@ -1569,65 +1615,65 @@ const ke = (e) => {
|
|
|
1569
1615
|
${r ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
|
|
1570
1616
|
`,
|
|
1571
1617
|
style: { willChange: "transform, opacity" },
|
|
1572
|
-
onClick: (
|
|
1618
|
+
onClick: (g) => g.stopPropagation(),
|
|
1573
1619
|
children: [
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
|
|
1620
|
+
/* @__PURE__ */ p("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
1621
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#000000] font-bold font-nunitoSans", children: t.name }) }),
|
|
1622
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
1623
|
+
Lt,
|
|
1578
1624
|
{
|
|
1579
1625
|
icon: "mdi:close",
|
|
1580
1626
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
1581
1627
|
onClick: () => {
|
|
1582
1628
|
o(!1), setTimeout(
|
|
1583
|
-
() => e(
|
|
1584
|
-
|
|
1629
|
+
() => e(ht(null)),
|
|
1630
|
+
nn
|
|
1585
1631
|
);
|
|
1586
1632
|
}
|
|
1587
1633
|
}
|
|
1588
1634
|
) })
|
|
1589
1635
|
] }),
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ p("div", { className: "flex flex-row gap-2 items-center flex-wrap", children: [
|
|
1637
|
+
/* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ l(
|
|
1592
1638
|
"img",
|
|
1593
1639
|
{
|
|
1594
|
-
src: (
|
|
1640
|
+
src: (d = (u = (a = (c = t.imageGroups) == null ? void 0 : c[0]) == null ? void 0 : a.images) == null ? void 0 : u[0]) == null ? void 0 : d.link,
|
|
1595
1641
|
alt: t.name,
|
|
1596
1642
|
className: "rounded-[10px]"
|
|
1597
1643
|
}
|
|
1598
1644
|
) }),
|
|
1599
|
-
/* @__PURE__ */
|
|
1600
|
-
(
|
|
1645
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children: t.imageGroups.slice(1, 2).map(
|
|
1646
|
+
(g) => g.images.slice(1, 2).map((S) => /* @__PURE__ */ l(
|
|
1601
1647
|
"img",
|
|
1602
1648
|
{
|
|
1603
|
-
src:
|
|
1649
|
+
src: S.link,
|
|
1604
1650
|
alt: t.name,
|
|
1605
1651
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
1606
1652
|
},
|
|
1607
|
-
|
|
1653
|
+
S.link
|
|
1608
1654
|
))
|
|
1609
1655
|
) })
|
|
1610
1656
|
] }),
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1657
|
+
/* @__PURE__ */ p("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
1658
|
+
/* @__PURE__ */ p("div", { className: "flex flex-row items-center gap-2", children: [
|
|
1659
|
+
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
|
|
1614
1660
|
" ",
|
|
1615
1661
|
"$",
|
|
1616
1662
|
t.price.toFixed(2)
|
|
1617
1663
|
] }),
|
|
1618
1664
|
" ",
|
|
1619
|
-
/* @__PURE__ */
|
|
1665
|
+
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
|
|
1620
1666
|
" ",
|
|
1621
1667
|
"$",
|
|
1622
1668
|
(t.price + 5).toFixed(2)
|
|
1623
1669
|
] })
|
|
1624
1670
|
] }),
|
|
1625
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: t.discount }) })
|
|
1626
1672
|
] }),
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */
|
|
1630
|
-
/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ l("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
|
|
1674
|
+
/* @__PURE__ */ p("div", { className: "w-full text-left", children: [
|
|
1675
|
+
/* @__PURE__ */ l("div", { className: "text-[#323135] font-bold font-nunitoSans mt-3 text-[14px]", children: "Product Details" }),
|
|
1676
|
+
/* @__PURE__ */ l(
|
|
1631
1677
|
"div",
|
|
1632
1678
|
{
|
|
1633
1679
|
className: "text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",
|
|
@@ -1635,43 +1681,43 @@ const ke = (e) => {
|
|
|
1635
1681
|
}
|
|
1636
1682
|
)
|
|
1637
1683
|
] }),
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
((
|
|
1684
|
+
/* @__PURE__ */ p("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
1685
|
+
/* @__PURE__ */ l("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
1686
|
+
/* @__PURE__ */ p("div", { className: "text-[#323135] font-bold", children: [
|
|
1687
|
+
((h = t == null ? void 0 : t.rating) == null ? void 0 : h.rate) || 0,
|
|
1642
1688
|
" /",
|
|
1643
1689
|
" ",
|
|
1644
|
-
/* @__PURE__ */
|
|
1690
|
+
/* @__PURE__ */ l("span", { className: "text-[#68656E]", children: "5" })
|
|
1645
1691
|
] }),
|
|
1646
|
-
/* @__PURE__ */
|
|
1647
|
-
/* @__PURE__ */
|
|
1648
|
-
((
|
|
1692
|
+
/* @__PURE__ */ l("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
1693
|
+
/* @__PURE__ */ p("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
1694
|
+
((m = t == null ? void 0 : t.rating) == null ? void 0 : m.count) || 0,
|
|
1649
1695
|
" ratings"
|
|
1650
1696
|
] })
|
|
1651
1697
|
] }) }),
|
|
1652
|
-
/* @__PURE__ */
|
|
1653
|
-
var
|
|
1654
|
-
return /* @__PURE__ */
|
|
1655
|
-
|
|
1698
|
+
/* @__PURE__ */ l("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((g, S) => {
|
|
1699
|
+
var _;
|
|
1700
|
+
return /* @__PURE__ */ l(
|
|
1701
|
+
Lt,
|
|
1656
1702
|
{
|
|
1657
1703
|
icon: "mdi:star",
|
|
1658
1704
|
width: "20",
|
|
1659
1705
|
height: "20",
|
|
1660
1706
|
className: `text-yellow-500
|
|
1661
|
-
${((
|
|
1707
|
+
${((_ = t == null ? void 0 : t.rating) == null ? void 0 : _.rate) > S ? "text-yellow-500" : "text-gray-300"}
|
|
1662
1708
|
`
|
|
1663
1709
|
},
|
|
1664
|
-
|
|
1710
|
+
S
|
|
1665
1711
|
);
|
|
1666
1712
|
}) })
|
|
1667
1713
|
] }),
|
|
1668
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ p(
|
|
1669
1715
|
"div",
|
|
1670
1716
|
{
|
|
1671
1717
|
className: "flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",
|
|
1672
1718
|
style: { marginTop: "150px" },
|
|
1673
1719
|
children: [
|
|
1674
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ l(
|
|
1675
1721
|
"button",
|
|
1676
1722
|
{
|
|
1677
1723
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",
|
|
@@ -1680,7 +1726,7 @@ const ke = (e) => {
|
|
|
1680
1726
|
children: "Add to Cart"
|
|
1681
1727
|
}
|
|
1682
1728
|
),
|
|
1683
|
-
/* @__PURE__ */
|
|
1729
|
+
/* @__PURE__ */ l(
|
|
1684
1730
|
"button",
|
|
1685
1731
|
{
|
|
1686
1732
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
@@ -1696,7 +1742,7 @@ const ke = (e) => {
|
|
|
1696
1742
|
}
|
|
1697
1743
|
)
|
|
1698
1744
|
] });
|
|
1699
|
-
},
|
|
1745
|
+
}, So = () => {
|
|
1700
1746
|
const e = [
|
|
1701
1747
|
"Myself",
|
|
1702
1748
|
"My Child",
|
|
@@ -1711,143 +1757,143 @@ const ke = (e) => {
|
|
|
1711
1757
|
"Niece/Nephew": "his/her niece/nephew",
|
|
1712
1758
|
"My Friends": "his/her friends",
|
|
1713
1759
|
Others: "others"
|
|
1714
|
-
}, n =
|
|
1760
|
+
}, n = Oe(null), r = Oe(null), o = Oe(null), s = Oe(null), [i, c] = M(null), [a, u] = M(
|
|
1715
1761
|
!1
|
|
1716
|
-
), [
|
|
1717
|
-
id:
|
|
1718
|
-
title:
|
|
1719
|
-
image:
|
|
1720
|
-
price:
|
|
1721
|
-
}), [
|
|
1722
|
-
|
|
1723
|
-
},
|
|
1724
|
-
|
|
1762
|
+
), [d, h] = M(!1), [m, g] = M(!1), [S, _] = M(!1), [y, v] = M(!1), [B, P] = M(!1), [j, X] = M(""), [k, L] = M(""), z = (f) => ({
|
|
1763
|
+
id: f.id,
|
|
1764
|
+
title: f.name,
|
|
1765
|
+
image: f.image ?? "",
|
|
1766
|
+
price: f.price ?? 0
|
|
1767
|
+
}), [V, O] = M([]), be = Oe(null), E = Ge((f) => f.store.store), $ = Ge((f) => f.product.product), Pe = () => {
|
|
1768
|
+
g(!0), setTimeout(() => h(!0), 10);
|
|
1769
|
+
}, de = () => {
|
|
1770
|
+
h(!1), setTimeout(() => g(!1), 300);
|
|
1725
1771
|
};
|
|
1726
|
-
|
|
1727
|
-
a ?
|
|
1772
|
+
ge(() => {
|
|
1773
|
+
a ? Pe() : de();
|
|
1728
1774
|
}, [a]);
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1775
|
+
const tt = (f) => {
|
|
1776
|
+
L(t[f]);
|
|
1731
1777
|
};
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
}, [
|
|
1735
|
-
let
|
|
1736
|
-
const
|
|
1737
|
-
if (
|
|
1738
|
-
return
|
|
1778
|
+
ge(() => {
|
|
1779
|
+
be.current && (be.current.scrollTop += 150);
|
|
1780
|
+
}, [V]);
|
|
1781
|
+
let re = null, pe = null;
|
|
1782
|
+
const J = async () => {
|
|
1783
|
+
if (re && pe && Date.now() < pe)
|
|
1784
|
+
return re;
|
|
1739
1785
|
try {
|
|
1740
|
-
const
|
|
1786
|
+
const f = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", T = new URLSearchParams({
|
|
1741
1787
|
grant_type: "client_credentials",
|
|
1742
1788
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
1743
1789
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
1744
1790
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
1745
|
-
}), C = await fetch(
|
|
1791
|
+
}), C = await fetch(f, {
|
|
1746
1792
|
method: "POST",
|
|
1747
1793
|
headers: {
|
|
1748
1794
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
1749
1795
|
},
|
|
1750
|
-
body:
|
|
1796
|
+
body: T
|
|
1751
1797
|
});
|
|
1752
1798
|
if (!C.ok)
|
|
1753
1799
|
throw new Error(
|
|
1754
1800
|
`Token request failed! status: ${C.status}`
|
|
1755
1801
|
);
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1758
|
-
const
|
|
1759
|
-
return
|
|
1760
|
-
} catch (
|
|
1761
|
-
return console.error("Error obtaining JWT token:",
|
|
1802
|
+
const F = await C.json();
|
|
1803
|
+
re = F.access_token;
|
|
1804
|
+
const x = F.expires_in || 3600;
|
|
1805
|
+
return pe = Date.now() + (x - 60) * 1e3, re;
|
|
1806
|
+
} catch (f) {
|
|
1807
|
+
return console.error("Error obtaining JWT token:", f), re = null, pe = null, null;
|
|
1762
1808
|
}
|
|
1763
|
-
},
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1809
|
+
}, nt = async () => {
|
|
1810
|
+
const f = await Xe();
|
|
1811
|
+
f != null && c(f);
|
|
1766
1812
|
};
|
|
1767
|
-
|
|
1768
|
-
|
|
1813
|
+
ge(() => {
|
|
1814
|
+
nt(), console.log("scapi environment v1");
|
|
1769
1815
|
}, []);
|
|
1770
|
-
const
|
|
1771
|
-
const
|
|
1816
|
+
const rt = async () => {
|
|
1817
|
+
const f = JSON.parse(
|
|
1772
1818
|
sessionStorage.getItem("customerData") || "{}"
|
|
1773
1819
|
).customerId;
|
|
1774
|
-
return (await
|
|
1775
|
-
},
|
|
1776
|
-
console.log("in secondary flow",
|
|
1777
|
-
const C = await
|
|
1778
|
-
if (console.log(C, "interests of customer",
|
|
1820
|
+
return (await dr(f || "")).c_interests;
|
|
1821
|
+
}, w = async (f, T) => {
|
|
1822
|
+
console.log("in secondary flow", Ae);
|
|
1823
|
+
const C = await rt();
|
|
1824
|
+
if (console.log(C, "interests of customer", Ae), !!C)
|
|
1779
1825
|
try {
|
|
1780
|
-
|
|
1781
|
-
(
|
|
1782
|
-
(
|
|
1826
|
+
O(
|
|
1827
|
+
(Q) => Q.map(
|
|
1828
|
+
(ee, te) => te === Q.length - 1 ? { ...ee, secondaryLoading: !0 } : ee
|
|
1783
1829
|
)
|
|
1784
1830
|
);
|
|
1785
|
-
const
|
|
1786
|
-
if (!
|
|
1787
|
-
const
|
|
1788
|
-
registered: String(
|
|
1789
|
-
userId: String(
|
|
1790
|
-
}).toString()}`,
|
|
1831
|
+
const F = await J();
|
|
1832
|
+
if (!F) throw new Error("Failed to fetch token");
|
|
1833
|
+
const x = localStorage.getItem("customerNumber"), I = localStorage.getItem("isLoggedIn"), xe = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1834
|
+
registered: String(I || !1),
|
|
1835
|
+
userId: String(x || (/* @__PURE__ */ new Date()).getTime())
|
|
1836
|
+
}).toString()}`, ve = JSON.stringify({
|
|
1791
1837
|
flowId: "Q166PR519W",
|
|
1792
1838
|
flowAliasId: "HKFUVLWVH2",
|
|
1793
1839
|
input: {
|
|
1794
1840
|
loyaltyPoints: "",
|
|
1795
|
-
productName:
|
|
1796
|
-
productPoints: String(
|
|
1841
|
+
productName: f,
|
|
1842
|
+
productPoints: String(T || 0),
|
|
1797
1843
|
interests: C
|
|
1798
1844
|
}
|
|
1799
|
-
}),
|
|
1845
|
+
}), G = await fetch(xe, {
|
|
1800
1846
|
signal: AbortSignal.timeout(3e4),
|
|
1801
1847
|
method: "POST",
|
|
1802
1848
|
headers: {
|
|
1803
1849
|
"Content-Type": "application/json",
|
|
1804
|
-
Authorization: `Bearer ${
|
|
1850
|
+
Authorization: `Bearer ${F}`
|
|
1805
1851
|
},
|
|
1806
|
-
body:
|
|
1852
|
+
body: ve
|
|
1807
1853
|
});
|
|
1808
|
-
if (!
|
|
1809
|
-
const
|
|
1810
|
-
let
|
|
1854
|
+
if (!G.body) throw new Error("Readable stream not supported");
|
|
1855
|
+
const Se = G.body.getReader(), ke = new TextDecoder();
|
|
1856
|
+
let W = "";
|
|
1811
1857
|
for (; ; ) {
|
|
1812
|
-
const { done:
|
|
1813
|
-
if (
|
|
1814
|
-
|
|
1815
|
-
const
|
|
1858
|
+
const { done: Q, value: ee } = await Se.read();
|
|
1859
|
+
if (Q) break;
|
|
1860
|
+
W += ke.decode(ee, { stream: !0 });
|
|
1861
|
+
const te = W.split(`
|
|
1816
1862
|
`);
|
|
1817
|
-
|
|
1818
|
-
for (const
|
|
1819
|
-
if (
|
|
1820
|
-
const
|
|
1863
|
+
W = te.pop() || "";
|
|
1864
|
+
for (const se of te)
|
|
1865
|
+
if (se.startsWith("data:")) {
|
|
1866
|
+
const b = se.slice(5).trim();
|
|
1821
1867
|
try {
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
(
|
|
1825
|
-
(
|
|
1826
|
-
...
|
|
1827
|
-
secondaryResponse:
|
|
1868
|
+
const Y = JSON.parse(b);
|
|
1869
|
+
Y.index === 0 && O(
|
|
1870
|
+
(A) => A.map(
|
|
1871
|
+
(H, ie) => ie === A.length - 1 ? {
|
|
1872
|
+
...H,
|
|
1873
|
+
secondaryResponse: Y.data,
|
|
1828
1874
|
secondaryLoading: !1
|
|
1829
|
-
} :
|
|
1875
|
+
} : H
|
|
1830
1876
|
)
|
|
1831
1877
|
);
|
|
1832
|
-
} catch (
|
|
1833
|
-
|
|
1834
|
-
(
|
|
1835
|
-
(
|
|
1878
|
+
} catch (Y) {
|
|
1879
|
+
O(
|
|
1880
|
+
(A) => A.map(
|
|
1881
|
+
(H, ie) => ie === A.length - 1 ? { ...H, secondaryLoading: !1 } : H
|
|
1836
1882
|
)
|
|
1837
|
-
), console.error("Secondary flow JSON parse error:",
|
|
1883
|
+
), console.error("Secondary flow JSON parse error:", Y);
|
|
1838
1884
|
}
|
|
1839
1885
|
}
|
|
1840
1886
|
}
|
|
1841
|
-
} catch (
|
|
1842
|
-
console.error("Secondary flow error:",
|
|
1887
|
+
} catch (F) {
|
|
1888
|
+
console.error("Secondary flow error:", F);
|
|
1843
1889
|
}
|
|
1844
|
-
},
|
|
1845
|
-
const
|
|
1846
|
-
if (
|
|
1847
|
-
v(!0),
|
|
1890
|
+
}, K = async (f) => {
|
|
1891
|
+
const T = f || j.trim();
|
|
1892
|
+
if (T) {
|
|
1893
|
+
v(!0), X(""), n.current = null, r.current = null, o.current = null, s.current = null, O((C) => [
|
|
1848
1894
|
...C,
|
|
1849
1895
|
{
|
|
1850
|
-
query:
|
|
1896
|
+
query: T,
|
|
1851
1897
|
response: "Thinking for what suits you best...",
|
|
1852
1898
|
potentialQuestions: "",
|
|
1853
1899
|
products: [],
|
|
@@ -1855,120 +1901,120 @@ const ke = (e) => {
|
|
|
1855
1901
|
}
|
|
1856
1902
|
]);
|
|
1857
1903
|
try {
|
|
1858
|
-
const C =
|
|
1859
|
-
if (!
|
|
1904
|
+
const C = k, F = localStorage.getItem("customerNumber"), x = localStorage.getItem("isLoggedIn"), I = await J();
|
|
1905
|
+
if (!I)
|
|
1860
1906
|
throw new Error("Failed to obtain access token");
|
|
1861
|
-
const
|
|
1862
|
-
registered: String(
|
|
1863
|
-
userId: String(
|
|
1864
|
-
}).toString()}`,
|
|
1907
|
+
const xe = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1908
|
+
registered: String(x || !1),
|
|
1909
|
+
userId: String(F || (/* @__PURE__ */ new Date()).getTime())
|
|
1910
|
+
}).toString()}`, ve = JSON.stringify({
|
|
1865
1911
|
flowId: "MMHQKYI1NE",
|
|
1866
1912
|
flowAliasId: "SZF9ZK1ATE",
|
|
1867
1913
|
input: {
|
|
1868
|
-
userPrompt:
|
|
1914
|
+
userPrompt: T,
|
|
1869
1915
|
whom: C
|
|
1870
1916
|
}
|
|
1871
|
-
}),
|
|
1917
|
+
}), G = await fetch(xe, {
|
|
1872
1918
|
signal: AbortSignal.timeout(3e4),
|
|
1873
1919
|
method: "POST",
|
|
1874
1920
|
headers: {
|
|
1875
1921
|
"Content-Type": "application/json",
|
|
1876
|
-
Authorization: `Bearer ${
|
|
1922
|
+
Authorization: `Bearer ${I}`
|
|
1877
1923
|
},
|
|
1878
|
-
body:
|
|
1924
|
+
body: ve
|
|
1879
1925
|
});
|
|
1880
|
-
if (!
|
|
1881
|
-
throw new Error(`HTTP error! status: ${
|
|
1882
|
-
if (!
|
|
1883
|
-
const
|
|
1884
|
-
let
|
|
1926
|
+
if (!G.ok)
|
|
1927
|
+
throw new Error(`HTTP error! status: ${G.status}`);
|
|
1928
|
+
if (!G.body) throw new Error("Readable stream not supported");
|
|
1929
|
+
const Se = G.body.getReader(), ke = new TextDecoder();
|
|
1930
|
+
let W = "", Q = "";
|
|
1885
1931
|
for (; ; ) {
|
|
1886
|
-
|
|
1887
|
-
const { done:
|
|
1888
|
-
if (
|
|
1889
|
-
|
|
1890
|
-
const
|
|
1932
|
+
P(!0);
|
|
1933
|
+
const { done: ee, value: te } = await Se.read();
|
|
1934
|
+
if (ee) break;
|
|
1935
|
+
W += ke.decode(te, { stream: !0 });
|
|
1936
|
+
const se = W.split(`
|
|
1891
1937
|
`);
|
|
1892
|
-
|
|
1893
|
-
for (const
|
|
1894
|
-
if (
|
|
1895
|
-
const
|
|
1938
|
+
W = se.pop() || "";
|
|
1939
|
+
for (const b of se)
|
|
1940
|
+
if (b.startsWith("data:")) {
|
|
1941
|
+
const Y = b.slice(5).trim();
|
|
1896
1942
|
try {
|
|
1897
|
-
const
|
|
1898
|
-
|
|
1899
|
-
(
|
|
1900
|
-
(
|
|
1901
|
-
...
|
|
1902
|
-
[
|
|
1903
|
-
} :
|
|
1943
|
+
const A = JSON.parse(Y);
|
|
1944
|
+
A.index == 1 && (Q = A.data), O(
|
|
1945
|
+
(H) => H.map(
|
|
1946
|
+
(ie, Be) => Be === H.length - 1 ? {
|
|
1947
|
+
...ie,
|
|
1948
|
+
[A.index == 0 ? "response" : A.index == 1 ? "keywords" : A.index == 2 ? "potentialQuestions" : "end"]: A.data
|
|
1949
|
+
} : ie
|
|
1904
1950
|
)
|
|
1905
1951
|
);
|
|
1906
|
-
} catch (
|
|
1907
|
-
console.error("Error parsing JSON:",
|
|
1952
|
+
} catch (A) {
|
|
1953
|
+
console.error("Error parsing JSON:", A);
|
|
1908
1954
|
}
|
|
1909
1955
|
}
|
|
1910
1956
|
}
|
|
1911
|
-
|
|
1957
|
+
oe(we(Q));
|
|
1912
1958
|
} catch (C) {
|
|
1913
1959
|
console.error("Error sending message to Tanya:", C);
|
|
1914
1960
|
} finally {
|
|
1915
1961
|
v(!1);
|
|
1916
1962
|
}
|
|
1917
1963
|
}
|
|
1918
|
-
},
|
|
1919
|
-
const
|
|
1964
|
+
}, we = (f) => {
|
|
1965
|
+
const T = f.match(
|
|
1920
1966
|
/top five relevant product or category names are: (.*)/i
|
|
1921
|
-
),
|
|
1922
|
-
return [...new Set(
|
|
1923
|
-
},
|
|
1924
|
-
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof
|
|
1925
|
-
console.log(
|
|
1926
|
-
const
|
|
1927
|
-
for (const C of
|
|
1928
|
-
const
|
|
1967
|
+
), x = (T ? T[1] : f).split(", ").map((R) => R.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
1968
|
+
return [...new Set(x)].filter(Boolean).join(",");
|
|
1969
|
+
}, oe = async (f) => {
|
|
1970
|
+
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof f == "string") {
|
|
1971
|
+
console.log(f, "keywords");
|
|
1972
|
+
const T = f.split(",");
|
|
1973
|
+
for (const C of T) {
|
|
1974
|
+
const F = await Dt(
|
|
1929
1975
|
C,
|
|
1930
1976
|
i == null ? void 0 : i.access_token
|
|
1931
1977
|
);
|
|
1932
|
-
if (
|
|
1933
|
-
(
|
|
1934
|
-
(
|
|
1935
|
-
...
|
|
1978
|
+
if (P(!1), (F == null ? void 0 : F.length) > 0 && (O(
|
|
1979
|
+
(x) => x.map(
|
|
1980
|
+
(I, R) => R === x.length - 1 ? {
|
|
1981
|
+
...I,
|
|
1936
1982
|
products: [
|
|
1937
|
-
...
|
|
1938
|
-
{ keyword: C, items:
|
|
1983
|
+
...I.products || [],
|
|
1984
|
+
{ keyword: C, items: F, loading: !1 }
|
|
1939
1985
|
]
|
|
1940
|
-
} :
|
|
1986
|
+
} : I
|
|
1941
1987
|
)
|
|
1942
1988
|
), !n.current || r.current == null)) {
|
|
1943
|
-
const
|
|
1944
|
-
n.current = String((
|
|
1945
|
-
const
|
|
1946
|
-
s.current = typeof
|
|
1989
|
+
const x = F[0];
|
|
1990
|
+
n.current = String((x == null ? void 0 : x.product_name) ?? ""), o.current = x.image.link, r.current = x.product_id;
|
|
1991
|
+
const I = typeof (x == null ? void 0 : x.price) == "number" ? x.price : void 0;
|
|
1992
|
+
s.current = typeof I == "number" && Number.isFinite(I) ? I : null;
|
|
1947
1993
|
}
|
|
1948
1994
|
}
|
|
1949
1995
|
} else
|
|
1950
|
-
for (const
|
|
1951
|
-
const C = await
|
|
1952
|
-
|
|
1996
|
+
for (const T of f) {
|
|
1997
|
+
const C = await Dt(
|
|
1998
|
+
T,
|
|
1953
1999
|
i == null ? void 0 : i.access_token
|
|
1954
2000
|
);
|
|
1955
|
-
|
|
1956
|
-
(
|
|
1957
|
-
(
|
|
1958
|
-
...
|
|
2001
|
+
P(!1), (C == null ? void 0 : C.length) > 0 && O(
|
|
2002
|
+
(F) => F.map(
|
|
2003
|
+
(x, I) => I === F.length - 1 ? {
|
|
2004
|
+
...x,
|
|
1959
2005
|
products: [
|
|
1960
|
-
...
|
|
1961
|
-
{ keyword:
|
|
2006
|
+
...x.products || [],
|
|
2007
|
+
{ keyword: T, items: C, loading: !1 }
|
|
1962
2008
|
]
|
|
1963
|
-
} :
|
|
2009
|
+
} : x
|
|
1964
2010
|
)
|
|
1965
2011
|
);
|
|
1966
2012
|
}
|
|
1967
2013
|
if (n.current) {
|
|
1968
|
-
|
|
2014
|
+
O(
|
|
1969
2015
|
(C) => C.map(
|
|
1970
|
-
(
|
|
1971
|
-
...
|
|
2016
|
+
(F, x) => x === C.length - 1 ? {
|
|
2017
|
+
...F,
|
|
1972
2018
|
productSnapshot: {
|
|
1973
2019
|
id: r.current,
|
|
1974
2020
|
name: n.current,
|
|
@@ -1977,127 +2023,127 @@ const ke = (e) => {
|
|
|
1977
2023
|
points: 0,
|
|
1978
2024
|
quantity: 1
|
|
1979
2025
|
}
|
|
1980
|
-
} :
|
|
2026
|
+
} : F
|
|
1981
2027
|
)
|
|
1982
2028
|
);
|
|
1983
|
-
const
|
|
2029
|
+
const T = JSON.parse(
|
|
1984
2030
|
sessionStorage.getItem("customerData") || "{}"
|
|
1985
2031
|
);
|
|
1986
|
-
(
|
|
2032
|
+
(T == null ? void 0 : T.isGuest) == !1 ? (console.log("running secondary flow", Ae), w(n.current, 0)) : console.log("not running secondary flow", Ae);
|
|
1987
2033
|
}
|
|
1988
|
-
|
|
1989
|
-
},
|
|
1990
|
-
var C,
|
|
1991
|
-
|
|
2034
|
+
P(!1);
|
|
2035
|
+
}, Gn = async (f, T) => {
|
|
2036
|
+
var C, F, x, I, R, xe, ve, G, Se, ke, W, Q, ee, te, se;
|
|
2037
|
+
_(!0);
|
|
1992
2038
|
try {
|
|
1993
|
-
const
|
|
1994
|
-
if (!((
|
|
1995
|
-
|
|
2039
|
+
const b = await kn(f.id);
|
|
2040
|
+
if (!((F = (C = b == null ? void 0 : b.variants) == null ? void 0 : C[0]) != null && F.product_id || (I = (x = b == null ? void 0 : b.variants) == null ? void 0 : x[0]) != null && I.productId) && !(b.type.item || b.type.bundle)) {
|
|
2041
|
+
_(!1), Z.error("Variants not found", {
|
|
1996
2042
|
position: "bottom-right",
|
|
1997
2043
|
autoClose: 1e3
|
|
1998
2044
|
}), console.error("No product variant found");
|
|
1999
2045
|
return;
|
|
2000
2046
|
}
|
|
2001
|
-
const
|
|
2047
|
+
const Y = [
|
|
2002
2048
|
{
|
|
2003
|
-
product_id: ((
|
|
2004
|
-
quantity:
|
|
2049
|
+
product_id: ((R = b.variants) == null ? void 0 : R[0].product_id) || ((xe = b.variants) == null ? void 0 : xe[0].productId) || (b == null ? void 0 : b.id),
|
|
2050
|
+
quantity: T
|
|
2005
2051
|
}
|
|
2006
2052
|
];
|
|
2007
|
-
console.log(
|
|
2008
|
-
const
|
|
2053
|
+
console.log(Y, "product data", "app version", Ae);
|
|
2054
|
+
const A = JSON.parse(
|
|
2009
2055
|
sessionStorage.getItem("customerData") || "{}"
|
|
2010
|
-
),
|
|
2011
|
-
if (!
|
|
2012
|
-
const
|
|
2013
|
-
let { customer_token:
|
|
2014
|
-
|
|
2056
|
+
), H = A == null ? void 0 : A.basketId, ie = !1, Be = localStorage.getItem(qe), jt = Date.now();
|
|
2057
|
+
if (!ie || !Be || jt >= parseInt(Be)) {
|
|
2058
|
+
const Wn = await vn();
|
|
2059
|
+
let { customer_token: he } = await Sn(
|
|
2060
|
+
Wn
|
|
2015
2061
|
);
|
|
2016
|
-
if (
|
|
2062
|
+
if (he = "Bearer " + i.access_token, !he) {
|
|
2017
2063
|
console.error("Failed to get customer_token");
|
|
2018
2064
|
return;
|
|
2019
2065
|
}
|
|
2020
|
-
const
|
|
2021
|
-
if (
|
|
2022
|
-
const
|
|
2023
|
-
basketId:
|
|
2024
|
-
customer_token:
|
|
2066
|
+
const Qn = jt + 300 * 1e3;
|
|
2067
|
+
if (Ye(he), localStorage.setItem(qe, Qn.toString()), H) {
|
|
2068
|
+
const At = await Mn({
|
|
2069
|
+
basketId: H,
|
|
2070
|
+
customer_token: he
|
|
2025
2071
|
});
|
|
2026
|
-
if (
|
|
2027
|
-
const
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2072
|
+
if (At.status === 200 && At) {
|
|
2073
|
+
const ot = await Qe(
|
|
2074
|
+
H,
|
|
2075
|
+
Y,
|
|
2076
|
+
he
|
|
2031
2077
|
);
|
|
2032
|
-
((
|
|
2078
|
+
((ve = ot == null ? void 0 : ot.product_items) == null ? void 0 : ve.length) > 0 && (Z.success("Added to cart", {
|
|
2033
2079
|
position: "bottom-right",
|
|
2034
2080
|
autoClose: 3e3,
|
|
2035
2081
|
hideProgressBar: !1,
|
|
2036
2082
|
closeOnClick: !0,
|
|
2037
2083
|
pauseOnHover: !0,
|
|
2038
2084
|
draggable: !0
|
|
2039
|
-
}),
|
|
2085
|
+
}), Ne(H), _(!1));
|
|
2040
2086
|
return;
|
|
2041
2087
|
}
|
|
2042
2088
|
}
|
|
2043
|
-
const
|
|
2089
|
+
const Yn = {
|
|
2044
2090
|
productItems: [
|
|
2045
2091
|
{
|
|
2046
|
-
productId: ((
|
|
2092
|
+
productId: ((G = b.variants) == null ? void 0 : G[0].product_id) || ((Se = b.variants) == null ? void 0 : Se[0].productId) || (b == null ? void 0 : b.id),
|
|
2047
2093
|
quantity: 1
|
|
2048
2094
|
}
|
|
2049
2095
|
]
|
|
2050
|
-
}, N = await
|
|
2096
|
+
}, N = await Dn(he, Yn);
|
|
2051
2097
|
if (console.log(
|
|
2052
2098
|
N,
|
|
2053
2099
|
N == null ? void 0 : N.basket_id,
|
|
2054
2100
|
N == null ? void 0 : N.basketId,
|
|
2055
2101
|
"the basket response"
|
|
2056
2102
|
), !(N != null && N.basket_id || !(N != null && N.basketId))) {
|
|
2057
|
-
|
|
2103
|
+
_(!1), console.error("Failed to create basket");
|
|
2058
2104
|
return;
|
|
2059
2105
|
}
|
|
2060
|
-
|
|
2106
|
+
Fe(
|
|
2061
2107
|
(N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId)
|
|
2062
2108
|
);
|
|
2063
|
-
const
|
|
2109
|
+
const Ie = await Qe(
|
|
2064
2110
|
(N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId),
|
|
2065
|
-
|
|
2066
|
-
|
|
2111
|
+
Y,
|
|
2112
|
+
he
|
|
2067
2113
|
);
|
|
2068
|
-
(((
|
|
2114
|
+
(((ke = Ie == null ? void 0 : Ie.product_items) == null ? void 0 : ke.length) > 0 || ((W = Ie == null ? void 0 : Ie.productItems) == null ? void 0 : W.length) > 0) && Z.success("Added to cart", {
|
|
2069
2115
|
position: "bottom-right",
|
|
2070
2116
|
autoClose: 3e3,
|
|
2071
2117
|
hideProgressBar: !1,
|
|
2072
2118
|
closeOnClick: !0,
|
|
2073
2119
|
pauseOnHover: !0,
|
|
2074
2120
|
draggable: !0
|
|
2075
|
-
}),
|
|
2121
|
+
}), Ne(N.basket_id || (N == null ? void 0 : N.basketId));
|
|
2076
2122
|
}
|
|
2077
|
-
} catch (
|
|
2078
|
-
|
|
2123
|
+
} catch (b) {
|
|
2124
|
+
_(!1), console.error("Error adding to cart:", b), Z.error("Failed to add product to cart", {
|
|
2079
2125
|
position: "bottom-right",
|
|
2080
2126
|
autoClose: 3e3
|
|
2081
|
-
}), ((
|
|
2082
|
-
((
|
|
2127
|
+
}), ((Q = b == null ? void 0 : b.response) == null ? void 0 : Q.status) === 404 || // Basket not found
|
|
2128
|
+
((ee = b == null ? void 0 : b.response) == null ? void 0 : ee.status) === 401 ? (((te = b == null ? void 0 : b.response) == null ? void 0 : te.status) === 404 && Fe(null), ((se = b == null ? void 0 : b.response) == null ? void 0 : se.status) === 401 && (Fe(null), Ye(null))) : (console.error("Failed to add product to basket:", b.message), Z.error("Failed to add product to cart", {
|
|
2083
2129
|
position: "bottom-right",
|
|
2084
2130
|
autoClose: 3e3
|
|
2085
2131
|
}));
|
|
2086
2132
|
} finally {
|
|
2087
|
-
|
|
2133
|
+
Ne();
|
|
2088
2134
|
}
|
|
2089
|
-
|
|
2135
|
+
_(!1);
|
|
2090
2136
|
};
|
|
2091
|
-
return /* @__PURE__ */
|
|
2092
|
-
/* @__PURE__ */
|
|
2093
|
-
|
|
2137
|
+
return /* @__PURE__ */ l("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(ur, { open: a, onOpenChange: u, children: [
|
|
2138
|
+
/* @__PURE__ */ l(
|
|
2139
|
+
fr,
|
|
2094
2140
|
{
|
|
2095
2141
|
onClick: () => u(!0),
|
|
2096
2142
|
style: {
|
|
2097
2143
|
// background: storeDetails.tanyaThemeColor,
|
|
2098
2144
|
},
|
|
2099
2145
|
className: "flex items-center rounded-lg cursor-pointer hover:opacity-90 transition-opacity",
|
|
2100
|
-
children: /* @__PURE__ */
|
|
2146
|
+
children: /* @__PURE__ */ l("div", { className: "flex flex-col p-[5px]", children: /* @__PURE__ */ p(
|
|
2101
2147
|
"svg",
|
|
2102
2148
|
{
|
|
2103
2149
|
width: "40",
|
|
@@ -2106,22 +2152,22 @@ const ke = (e) => {
|
|
|
2106
2152
|
fill: "none",
|
|
2107
2153
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2108
2154
|
children: [
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ p("g", { clipPath: "url(#clip0_958_585)", children: [
|
|
2156
|
+
/* @__PURE__ */ l(
|
|
2111
2157
|
"path",
|
|
2112
2158
|
{
|
|
2113
2159
|
d: "M30.0002 5C31.7683 5 33.464 5.70238 34.7142 6.95262C35.9644 8.20286 36.6668 9.89856 36.6668 11.6667V25C36.6668 26.7681 35.9644 28.4638 34.7142 29.714C33.464 30.9643 31.7683 31.6667 30.0002 31.6667H25.6902L21.1785 36.1783C20.8915 36.4653 20.5097 36.6377 20.1046 36.6631C19.6996 36.6886 19.2992 36.5654 18.9785 36.3167L18.8218 36.1783L14.3085 31.6667H10.0002C8.28976 31.6667 6.64478 31.0093 5.40548 29.8305C4.16617 28.6516 3.42735 27.0416 3.34183 25.3333L3.3335 25V11.6667C3.3335 9.89856 4.03588 8.20286 5.28612 6.95262C6.53636 5.70238 8.23205 5 10.0002 5H30.0002Z",
|
|
2114
2160
|
fill: "url(#paint0_linear_958_585)"
|
|
2115
2161
|
}
|
|
2116
2162
|
),
|
|
2117
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ l(
|
|
2118
2164
|
"path",
|
|
2119
2165
|
{
|
|
2120
2166
|
d: "M28.3335 15.6511V11.6667C28.3335 11.6667 22.2774 12.6042 20.1148 15.4167C17.9521 18.2292 18.6644 26.6667 18.6644 26.6667H22.5321C22.5321 26.6667 22.0614 18.9323 23.4989 17.2917C24.9364 15.6511 28.3335 15.6511 28.3335 15.6511Z",
|
|
2121
2167
|
fill: "white"
|
|
2122
2168
|
}
|
|
2123
2169
|
),
|
|
2124
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ l(
|
|
2125
2171
|
"path",
|
|
2126
2172
|
{
|
|
2127
2173
|
d: "M13.3335 11.6667H19.6184V15.4167H13.3335V11.6667Z",
|
|
@@ -2129,8 +2175,8 @@ const ke = (e) => {
|
|
|
2129
2175
|
}
|
|
2130
2176
|
)
|
|
2131
2177
|
] }),
|
|
2132
|
-
/* @__PURE__ */
|
|
2133
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ p("defs", { children: [
|
|
2179
|
+
/* @__PURE__ */ p(
|
|
2134
2180
|
"linearGradient",
|
|
2135
2181
|
{
|
|
2136
2182
|
id: "paint0_linear_958_585",
|
|
@@ -2140,27 +2186,27 @@ const ke = (e) => {
|
|
|
2140
2186
|
y2: "30",
|
|
2141
2187
|
gradientUnits: "userSpaceOnUse",
|
|
2142
2188
|
children: [
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2189
|
+
/* @__PURE__ */ l("stop", { stopColor: "#452697" }),
|
|
2190
|
+
/* @__PURE__ */ l("stop", { offset: "1", stopColor: "#7C5BFF" })
|
|
2145
2191
|
]
|
|
2146
2192
|
}
|
|
2147
2193
|
),
|
|
2148
|
-
/* @__PURE__ */
|
|
2194
|
+
/* @__PURE__ */ l("clipPath", { id: "clip0_958_585", children: /* @__PURE__ */ l("rect", { width: "40", height: "40", fill: "white" }) })
|
|
2149
2195
|
] })
|
|
2150
2196
|
]
|
|
2151
2197
|
}
|
|
2152
2198
|
) })
|
|
2153
2199
|
}
|
|
2154
2200
|
),
|
|
2155
|
-
|
|
2156
|
-
/* @__PURE__ */
|
|
2201
|
+
m && /* @__PURE__ */ p(dt, { children: [
|
|
2202
|
+
/* @__PURE__ */ l(
|
|
2157
2203
|
"div",
|
|
2158
2204
|
{
|
|
2159
2205
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
2160
2206
|
onClick: () => u(!1)
|
|
2161
2207
|
}
|
|
2162
2208
|
),
|
|
2163
|
-
/* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ p(
|
|
2164
2210
|
"div",
|
|
2165
2211
|
{
|
|
2166
2212
|
className: `
|
|
@@ -2168,31 +2214,31 @@ const ke = (e) => {
|
|
|
2168
2214
|
top-0 right-0
|
|
2169
2215
|
transition-transform duration-300 ease-in-out
|
|
2170
2216
|
lg:transform
|
|
2171
|
-
${
|
|
2217
|
+
${d ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
2172
2218
|
// For mobile: animate from bottom
|
|
2173
|
-
${
|
|
2219
|
+
${d ? "translate-y-0" : "translate-y-full"}
|
|
2174
2220
|
lg:translate-y-0
|
|
2175
2221
|
`,
|
|
2176
2222
|
style: {
|
|
2177
2223
|
background: "linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"
|
|
2178
2224
|
},
|
|
2179
2225
|
children: [
|
|
2180
|
-
/* @__PURE__ */
|
|
2226
|
+
/* @__PURE__ */ p(
|
|
2181
2227
|
"div",
|
|
2182
2228
|
{
|
|
2183
2229
|
className: "flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",
|
|
2184
2230
|
children: [
|
|
2185
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ l(
|
|
2186
2232
|
"div",
|
|
2187
2233
|
{
|
|
2188
2234
|
style: {
|
|
2189
2235
|
display: "flex",
|
|
2190
|
-
color:
|
|
2236
|
+
color: E.tanyaThemeContrastColor,
|
|
2191
2237
|
alignItems: "center",
|
|
2192
2238
|
gap: "0.5rem"
|
|
2193
2239
|
},
|
|
2194
|
-
children: /* @__PURE__ */
|
|
2195
|
-
/* @__PURE__ */
|
|
2240
|
+
children: /* @__PURE__ */ p("div", { className: "flex flex-col gap-1", children: [
|
|
2241
|
+
/* @__PURE__ */ p(
|
|
2196
2242
|
"div",
|
|
2197
2243
|
{
|
|
2198
2244
|
className: "flex gap-2 w-28 h-12 text-center items-center p-2 border rounded-l-[20px] rounded-tr-[20px]",
|
|
@@ -2200,7 +2246,7 @@ const ke = (e) => {
|
|
|
2200
2246
|
background: "linear-gradient(265.62deg, #6851C6 5.24%, #8668FF 98.49%)"
|
|
2201
2247
|
},
|
|
2202
2248
|
children: [
|
|
2203
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ p(
|
|
2204
2250
|
"svg",
|
|
2205
2251
|
{
|
|
2206
2252
|
width: "20",
|
|
@@ -2209,22 +2255,22 @@ const ke = (e) => {
|
|
|
2209
2255
|
fill: "none",
|
|
2210
2256
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2211
2257
|
children: [
|
|
2212
|
-
/* @__PURE__ */
|
|
2258
|
+
/* @__PURE__ */ l(
|
|
2213
2259
|
"path",
|
|
2214
2260
|
{
|
|
2215
2261
|
d: "M15 4.48438V0.5C15 0.5 8.94395 1.4375 6.78127 4.25C4.61859 7.0625 5.33095 15.5 5.33095 15.5H9.19857C9.19857 15.5 8.72793 7.76562 10.1654 6.125C11.6029 4.48438 15 4.48438 15 4.48438Z",
|
|
2216
2262
|
fill: "white"
|
|
2217
2263
|
}
|
|
2218
2264
|
),
|
|
2219
|
-
/* @__PURE__ */
|
|
2265
|
+
/* @__PURE__ */ l("path", { d: "M0 0.5H6.28488V4.25H0V0.5Z", fill: "white" })
|
|
2220
2266
|
]
|
|
2221
2267
|
}
|
|
2222
2268
|
),
|
|
2223
|
-
/* @__PURE__ */
|
|
2269
|
+
/* @__PURE__ */ l("p", { className: "text-[#FFFFFF] font-nunitoSans font-semibold", children: "TANYA" })
|
|
2224
2270
|
]
|
|
2225
2271
|
}
|
|
2226
2272
|
),
|
|
2227
|
-
/* @__PURE__ */
|
|
2273
|
+
/* @__PURE__ */ p(
|
|
2228
2274
|
"p",
|
|
2229
2275
|
{
|
|
2230
2276
|
className: "text-[#5B5B5B] font-nunitoSans font-semibold",
|
|
@@ -2239,7 +2285,7 @@ const ke = (e) => {
|
|
|
2239
2285
|
] })
|
|
2240
2286
|
}
|
|
2241
2287
|
),
|
|
2242
|
-
/* @__PURE__ */
|
|
2288
|
+
/* @__PURE__ */ l(
|
|
2243
2289
|
"div",
|
|
2244
2290
|
{
|
|
2245
2291
|
style: {
|
|
@@ -2248,7 +2294,7 @@ const ke = (e) => {
|
|
|
2248
2294
|
gap: "1.25rem",
|
|
2249
2295
|
margin: "0.75rem"
|
|
2250
2296
|
},
|
|
2251
|
-
children: /* @__PURE__ */
|
|
2297
|
+
children: /* @__PURE__ */ l("button", { onClick: () => u(!1), children: /* @__PURE__ */ p(
|
|
2252
2298
|
"svg",
|
|
2253
2299
|
{
|
|
2254
2300
|
width: "24",
|
|
@@ -2257,8 +2303,8 @@ const ke = (e) => {
|
|
|
2257
2303
|
fill: "none",
|
|
2258
2304
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2259
2305
|
children: [
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2306
|
+
/* @__PURE__ */ p("g", { clipPath: "url(#clip0_501_6036)", children: [
|
|
2307
|
+
/* @__PURE__ */ l(
|
|
2262
2308
|
"path",
|
|
2263
2309
|
{
|
|
2264
2310
|
d: "M18 6.5L6 18.5",
|
|
@@ -2268,7 +2314,7 @@ const ke = (e) => {
|
|
|
2268
2314
|
strokeLinejoin: "round"
|
|
2269
2315
|
}
|
|
2270
2316
|
),
|
|
2271
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ l(
|
|
2272
2318
|
"path",
|
|
2273
2319
|
{
|
|
2274
2320
|
d: "M6 6.5L18 18.5",
|
|
@@ -2279,7 +2325,7 @@ const ke = (e) => {
|
|
|
2279
2325
|
}
|
|
2280
2326
|
)
|
|
2281
2327
|
] }),
|
|
2282
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ l("defs", { children: /* @__PURE__ */ l("clipPath", { id: "clip0_501_6036", children: /* @__PURE__ */ l(
|
|
2283
2329
|
"rect",
|
|
2284
2330
|
{
|
|
2285
2331
|
width: "24",
|
|
@@ -2296,92 +2342,92 @@ const ke = (e) => {
|
|
|
2296
2342
|
]
|
|
2297
2343
|
}
|
|
2298
2344
|
),
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2345
|
+
/* @__PURE__ */ p("div", { className: "flex h-full md:flex-row lg:flex-row", children: [
|
|
2346
|
+
/* @__PURE__ */ p(
|
|
2301
2347
|
"div",
|
|
2302
2348
|
{
|
|
2303
|
-
className: `flex flex-col h-full ${
|
|
2349
|
+
className: `flex flex-col h-full ${$ ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
2304
2350
|
children: [
|
|
2305
|
-
/* @__PURE__ */
|
|
2351
|
+
/* @__PURE__ */ p(
|
|
2306
2352
|
"div",
|
|
2307
2353
|
{
|
|
2308
|
-
ref:
|
|
2354
|
+
ref: be,
|
|
2309
2355
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
2310
2356
|
children: [
|
|
2311
|
-
(
|
|
2357
|
+
(E == null ? void 0 : E.whomRequired) && /* @__PURE__ */ p(
|
|
2312
2358
|
"div",
|
|
2313
2359
|
{
|
|
2314
2360
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
2315
2361
|
children: [
|
|
2316
|
-
/* @__PURE__ */
|
|
2317
|
-
/* @__PURE__ */
|
|
2362
|
+
/* @__PURE__ */ l("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ l("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
2363
|
+
/* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2 mt-2", children: e.map((f) => /* @__PURE__ */ l(
|
|
2318
2364
|
"button",
|
|
2319
2365
|
{
|
|
2320
|
-
onClick: () =>
|
|
2366
|
+
onClick: () => tt(f),
|
|
2321
2367
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
2322
2368
|
style: {
|
|
2323
|
-
backgroundColor:
|
|
2324
|
-
borderColor:
|
|
2369
|
+
backgroundColor: k === t[f] ? "#FFFFFF" : "#F3F3F3",
|
|
2370
|
+
borderColor: k === t[f] ? "#BBB3DD" : ""
|
|
2325
2371
|
},
|
|
2326
|
-
children:
|
|
2372
|
+
children: f
|
|
2327
2373
|
},
|
|
2328
|
-
|
|
2374
|
+
f
|
|
2329
2375
|
)) })
|
|
2330
2376
|
]
|
|
2331
2377
|
}
|
|
2332
2378
|
),
|
|
2333
|
-
|
|
2334
|
-
var C,
|
|
2335
|
-
return /* @__PURE__ */
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
|
|
2379
|
+
V.map((f, T) => {
|
|
2380
|
+
var C, F;
|
|
2381
|
+
return /* @__PURE__ */ p("div", { children: [
|
|
2382
|
+
/* @__PURE__ */ l("div", { className: "flex justify-end", children: /* @__PURE__ */ l("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: f.query }) }),
|
|
2383
|
+
f.response && f.response.includes("Thinking") ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
2338
2384
|
"div",
|
|
2339
2385
|
{
|
|
2340
2386
|
className: "font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
2341
2387
|
dangerouslySetInnerHTML: {
|
|
2342
|
-
__html:
|
|
2388
|
+
__html: st(f.response)
|
|
2343
2389
|
}
|
|
2344
2390
|
}
|
|
2345
|
-
) }) : /* @__PURE__ */
|
|
2391
|
+
) }) : /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
2346
2392
|
"div",
|
|
2347
2393
|
{
|
|
2348
2394
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
2349
2395
|
dangerouslySetInnerHTML: {
|
|
2350
|
-
__html:
|
|
2396
|
+
__html: st(f.response)
|
|
2351
2397
|
}
|
|
2352
2398
|
}
|
|
2353
2399
|
) }),
|
|
2354
|
-
|
|
2355
|
-
(
|
|
2356
|
-
|
|
2400
|
+
B && !f.response.includes("Thinking") && ((C = f.products) == null ? void 0 : C.length) == 0 && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
|
|
2401
|
+
(f == null ? void 0 : f.products) && ((F = f == null ? void 0 : f.products) == null ? void 0 : F.length) > 0 && /* @__PURE__ */ l(
|
|
2402
|
+
wo,
|
|
2357
2403
|
{
|
|
2358
|
-
chat:
|
|
2359
|
-
storeDetails:
|
|
2404
|
+
chat: f.products,
|
|
2405
|
+
storeDetails: E
|
|
2360
2406
|
}
|
|
2361
2407
|
),
|
|
2362
|
-
|
|
2363
|
-
/* @__PURE__ */
|
|
2408
|
+
f.potentialQuestions.length > 0 && /* @__PURE__ */ p("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
2409
|
+
/* @__PURE__ */ l(
|
|
2364
2410
|
"p",
|
|
2365
2411
|
{
|
|
2366
2412
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
2367
|
-
style: { color:
|
|
2413
|
+
style: { color: E.themeDarkColor },
|
|
2368
2414
|
children: "Why not explore these inquiries..."
|
|
2369
2415
|
}
|
|
2370
2416
|
),
|
|
2371
|
-
|
|
2417
|
+
f.potentialQuestions.split(",").map((x, I) => /* @__PURE__ */ l(
|
|
2372
2418
|
"button",
|
|
2373
2419
|
{
|
|
2374
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
2375
|
-
onClick: () =>
|
|
2420
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${E.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
2421
|
+
onClick: () => K(x),
|
|
2376
2422
|
style: {
|
|
2377
|
-
backgroundColor:
|
|
2423
|
+
backgroundColor: E.tanyaThemeColorLight
|
|
2378
2424
|
},
|
|
2379
|
-
children:
|
|
2425
|
+
children: x
|
|
2380
2426
|
},
|
|
2381
|
-
|
|
2427
|
+
I
|
|
2382
2428
|
))
|
|
2383
2429
|
] }),
|
|
2384
|
-
|
|
2430
|
+
f.secondaryLoading && /* @__PURE__ */ l("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ p(
|
|
2385
2431
|
"div",
|
|
2386
2432
|
{
|
|
2387
2433
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -2389,56 +2435,56 @@ const ke = (e) => {
|
|
|
2389
2435
|
margin: "0.75rem"
|
|
2390
2436
|
},
|
|
2391
2437
|
children: [
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
/* @__PURE__ */
|
|
2438
|
+
/* @__PURE__ */ p("div", { className: "flex gap-1", children: [
|
|
2439
|
+
/* @__PURE__ */ l("div", { className: "tanya-sparkle tanya-sparkle-1", children: "✨" }),
|
|
2440
|
+
/* @__PURE__ */ l("div", { className: "tanya-sparkle tanya-sparkle-2", children: "✨" }),
|
|
2441
|
+
/* @__PURE__ */ l("div", { className: "tanya-sparkle tanya-sparkle-3", children: "✨" })
|
|
2396
2442
|
] }),
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
/* @__PURE__ */
|
|
2443
|
+
/* @__PURE__ */ l("div", { className: "tanya-shimmer" }),
|
|
2444
|
+
/* @__PURE__ */ l(
|
|
2399
2445
|
"p",
|
|
2400
2446
|
{
|
|
2401
2447
|
className: "font-semibold tanya-pulse",
|
|
2402
|
-
style: { color:
|
|
2448
|
+
style: { color: E.themeDarkColor },
|
|
2403
2449
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
2404
2450
|
}
|
|
2405
2451
|
),
|
|
2406
|
-
/* @__PURE__ */
|
|
2452
|
+
/* @__PURE__ */ l(
|
|
2407
2453
|
"p",
|
|
2408
2454
|
{
|
|
2409
2455
|
className: "tanya-dots mt-1",
|
|
2410
|
-
style: { color:
|
|
2456
|
+
style: { color: E.themeDarkColor },
|
|
2411
2457
|
children: "• • •"
|
|
2412
2458
|
}
|
|
2413
2459
|
)
|
|
2414
2460
|
]
|
|
2415
2461
|
}
|
|
2416
2462
|
) }),
|
|
2417
|
-
|
|
2418
|
-
/* @__PURE__ */
|
|
2463
|
+
f.secondaryResponse && /* @__PURE__ */ l(dt, { children: /* @__PURE__ */ p("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
2464
|
+
/* @__PURE__ */ l(
|
|
2419
2465
|
"div",
|
|
2420
2466
|
{
|
|
2421
2467
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
2422
2468
|
style: {
|
|
2423
|
-
backgroundColor:
|
|
2469
|
+
backgroundColor: E.tanyaThemeColorLight
|
|
2424
2470
|
},
|
|
2425
2471
|
dangerouslySetInnerHTML: {
|
|
2426
|
-
__html:
|
|
2427
|
-
|
|
2472
|
+
__html: st(
|
|
2473
|
+
f.secondaryResponse
|
|
2428
2474
|
)
|
|
2429
2475
|
}
|
|
2430
2476
|
}
|
|
2431
2477
|
),
|
|
2432
|
-
|
|
2433
|
-
/* @__PURE__ */
|
|
2478
|
+
f.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
2479
|
+
/* @__PURE__ */ l("div", { className: "mt-4 w-full", children: /* @__PURE__ */ p(
|
|
2434
2480
|
"div",
|
|
2435
2481
|
{
|
|
2436
2482
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
2437
2483
|
style: {
|
|
2438
|
-
backgroundColor:
|
|
2484
|
+
backgroundColor: E.tanyaThemeColorLight
|
|
2439
2485
|
},
|
|
2440
2486
|
children: [
|
|
2441
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ l(
|
|
2442
2488
|
"div",
|
|
2443
2489
|
{
|
|
2444
2490
|
className: "flex-shrink-0 rounded-xl overflow-hidden border",
|
|
@@ -2447,105 +2493,105 @@ const ke = (e) => {
|
|
|
2447
2493
|
height: 112,
|
|
2448
2494
|
borderColor: "#eee"
|
|
2449
2495
|
},
|
|
2450
|
-
children:
|
|
2496
|
+
children: f.productSnapshot.image ? /* @__PURE__ */ l(
|
|
2451
2497
|
"img",
|
|
2452
2498
|
{
|
|
2453
|
-
src:
|
|
2454
|
-
alt:
|
|
2499
|
+
src: f.productSnapshot.image,
|
|
2500
|
+
alt: f.productSnapshot.name,
|
|
2455
2501
|
className: "w-full h-full object-cover"
|
|
2456
2502
|
}
|
|
2457
|
-
) : /* @__PURE__ */
|
|
2503
|
+
) : /* @__PURE__ */ l("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
2458
2504
|
}
|
|
2459
2505
|
),
|
|
2460
|
-
/* @__PURE__ */
|
|
2461
|
-
/* @__PURE__ */
|
|
2462
|
-
/* @__PURE__ */
|
|
2463
|
-
/* @__PURE__ */
|
|
2506
|
+
/* @__PURE__ */ p("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
2507
|
+
/* @__PURE__ */ p("div", { children: [
|
|
2508
|
+
/* @__PURE__ */ l("p", { className: "font-semibold text-[15px] leading-snug", children: f.productSnapshot.name }),
|
|
2509
|
+
/* @__PURE__ */ l("p", { className: "mt-1 text-[14px] font-medium", children: f.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
2464
2510
|
style: "currency",
|
|
2465
|
-
currency: (
|
|
2511
|
+
currency: (E == null ? void 0 : E.currency) || "USD"
|
|
2466
2512
|
}).format(
|
|
2467
|
-
|
|
2513
|
+
f.productSnapshot.price
|
|
2468
2514
|
) : "" }),
|
|
2469
|
-
|
|
2515
|
+
f.productSnapshot.points > 0 && /* @__PURE__ */ p("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
2470
2516
|
"You will earn",
|
|
2471
2517
|
" ",
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
|
|
2518
|
+
/* @__PURE__ */ p("strong", { children: [
|
|
2519
|
+
f.productSnapshot.points,
|
|
2474
2520
|
" ",
|
|
2475
2521
|
"points"
|
|
2476
2522
|
] })
|
|
2477
2523
|
] })
|
|
2478
2524
|
] }),
|
|
2479
|
-
/* @__PURE__ */
|
|
2480
|
-
/* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
2525
|
+
/* @__PURE__ */ p("div", { className: "mt-3 flex items-center gap-3", children: [
|
|
2526
|
+
/* @__PURE__ */ p("div", { className: "flex items-center border rounded-full overflow-hidden", children: [
|
|
2527
|
+
/* @__PURE__ */ l(
|
|
2482
2528
|
"button",
|
|
2483
2529
|
{
|
|
2484
2530
|
className: "px-3 py-1 text-sm",
|
|
2485
|
-
onClick: () =>
|
|
2486
|
-
(
|
|
2487
|
-
(
|
|
2488
|
-
...
|
|
2531
|
+
onClick: () => O(
|
|
2532
|
+
(x) => x.map(
|
|
2533
|
+
(I, R) => R === T && I.productSnapshot ? {
|
|
2534
|
+
...I,
|
|
2489
2535
|
productSnapshot: {
|
|
2490
|
-
...
|
|
2536
|
+
...I.productSnapshot,
|
|
2491
2537
|
quantity: Math.max(
|
|
2492
2538
|
1,
|
|
2493
|
-
|
|
2539
|
+
I.productSnapshot.quantity - 1
|
|
2494
2540
|
)
|
|
2495
2541
|
}
|
|
2496
|
-
} :
|
|
2542
|
+
} : I
|
|
2497
2543
|
)
|
|
2498
2544
|
),
|
|
2499
2545
|
style: {
|
|
2500
2546
|
background: "transparent",
|
|
2501
|
-
color:
|
|
2547
|
+
color: E.themeDarkColor
|
|
2502
2548
|
},
|
|
2503
2549
|
children: "−"
|
|
2504
2550
|
}
|
|
2505
2551
|
),
|
|
2506
|
-
/* @__PURE__ */
|
|
2507
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ l("div", { className: "px-3 py-1 text-sm select-none", children: f.productSnapshot.quantity }),
|
|
2553
|
+
/* @__PURE__ */ l(
|
|
2508
2554
|
"button",
|
|
2509
2555
|
{
|
|
2510
2556
|
className: "px-3 py-1 text-sm",
|
|
2511
|
-
onClick: () =>
|
|
2512
|
-
(
|
|
2513
|
-
(
|
|
2514
|
-
...
|
|
2557
|
+
onClick: () => O(
|
|
2558
|
+
(x) => x.map(
|
|
2559
|
+
(I, R) => R === T && I.productSnapshot ? {
|
|
2560
|
+
...I,
|
|
2515
2561
|
productSnapshot: {
|
|
2516
|
-
...
|
|
2517
|
-
quantity:
|
|
2562
|
+
...I.productSnapshot,
|
|
2563
|
+
quantity: I.productSnapshot.quantity + 1
|
|
2518
2564
|
}
|
|
2519
|
-
} :
|
|
2565
|
+
} : I
|
|
2520
2566
|
)
|
|
2521
2567
|
),
|
|
2522
2568
|
style: {
|
|
2523
2569
|
background: "transparent",
|
|
2524
|
-
color:
|
|
2570
|
+
color: E.themeDarkColor
|
|
2525
2571
|
},
|
|
2526
2572
|
children: "+"
|
|
2527
2573
|
}
|
|
2528
2574
|
)
|
|
2529
2575
|
] }),
|
|
2530
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ l(
|
|
2531
2577
|
"button",
|
|
2532
2578
|
{
|
|
2533
2579
|
onClick: () => {
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2580
|
+
Gn(
|
|
2581
|
+
z(
|
|
2582
|
+
f.productSnapshot
|
|
2537
2583
|
),
|
|
2538
|
-
|
|
2584
|
+
f.productSnapshot.quantity
|
|
2539
2585
|
);
|
|
2540
2586
|
},
|
|
2541
|
-
disabled:
|
|
2587
|
+
disabled: S,
|
|
2542
2588
|
className: "px-4 py-2 rounded-full font-medium",
|
|
2543
2589
|
style: {
|
|
2544
|
-
background:
|
|
2545
|
-
color: (
|
|
2546
|
-
opacity:
|
|
2590
|
+
background: E.tanyaThemeColor,
|
|
2591
|
+
color: (E == null ? void 0 : E.tanyaThemeContrastColor) || "#fff",
|
|
2592
|
+
opacity: S ? 0.8 : 1
|
|
2547
2593
|
},
|
|
2548
|
-
children:
|
|
2594
|
+
children: S ? "Adding..." : "Add to cart"
|
|
2549
2595
|
}
|
|
2550
2596
|
)
|
|
2551
2597
|
] })
|
|
@@ -2554,50 +2600,50 @@ const ke = (e) => {
|
|
|
2554
2600
|
}
|
|
2555
2601
|
) })
|
|
2556
2602
|
] }) }),
|
|
2557
|
-
/* @__PURE__ */
|
|
2558
|
-
] },
|
|
2603
|
+
/* @__PURE__ */ l("div", { className: "mb-20" })
|
|
2604
|
+
] }, T);
|
|
2559
2605
|
})
|
|
2560
2606
|
]
|
|
2561
2607
|
}
|
|
2562
2608
|
),
|
|
2563
|
-
/* @__PURE__ */
|
|
2609
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col gap-2 sticky bottom-0 left-0 right-0 bg-[#E3DEEF] z-50 px-4 py-2", children: /* @__PURE__ */ l(
|
|
2564
2610
|
"div",
|
|
2565
2611
|
{
|
|
2566
2612
|
className: "p-[1px] rounded-xl",
|
|
2567
2613
|
style: {
|
|
2568
2614
|
background: "linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"
|
|
2569
2615
|
},
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2571
|
-
/* @__PURE__ */
|
|
2616
|
+
children: /* @__PURE__ */ p("div", { className: "flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1", children: [
|
|
2617
|
+
/* @__PURE__ */ l(
|
|
2572
2618
|
"input",
|
|
2573
2619
|
{
|
|
2574
2620
|
className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
|
|
2575
2621
|
placeholder: "How can I help you...",
|
|
2576
|
-
value:
|
|
2622
|
+
value: j,
|
|
2577
2623
|
autoFocus: !0,
|
|
2578
|
-
onChange: (
|
|
2579
|
-
onKeyDown: (
|
|
2580
|
-
|
|
2624
|
+
onChange: (f) => X(f.target.value),
|
|
2625
|
+
onKeyDown: (f) => {
|
|
2626
|
+
f.key === "Enter" && !y && K();
|
|
2581
2627
|
}
|
|
2582
2628
|
}
|
|
2583
2629
|
),
|
|
2584
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ l(
|
|
2585
2631
|
"button",
|
|
2586
2632
|
{
|
|
2587
2633
|
type: "submit",
|
|
2588
|
-
disabled:
|
|
2634
|
+
disabled: y,
|
|
2589
2635
|
className: "p-3",
|
|
2590
|
-
onClick: () =>
|
|
2591
|
-
children:
|
|
2636
|
+
onClick: () => K(),
|
|
2637
|
+
children: y ? /* @__PURE__ */ l(
|
|
2592
2638
|
"div",
|
|
2593
2639
|
{
|
|
2594
2640
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
2595
2641
|
style: {
|
|
2596
2642
|
borderBottom: "2px solid",
|
|
2597
|
-
color:
|
|
2643
|
+
color: E.tanyaThemeColor
|
|
2598
2644
|
}
|
|
2599
2645
|
}
|
|
2600
|
-
) : /* @__PURE__ */
|
|
2646
|
+
) : /* @__PURE__ */ l(
|
|
2601
2647
|
"svg",
|
|
2602
2648
|
{
|
|
2603
2649
|
width: "20",
|
|
@@ -2605,7 +2651,7 @@ const ke = (e) => {
|
|
|
2605
2651
|
viewBox: "0 0 20 20",
|
|
2606
2652
|
fill: "none",
|
|
2607
2653
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2608
|
-
children: /* @__PURE__ */
|
|
2654
|
+
children: /* @__PURE__ */ l(
|
|
2609
2655
|
"path",
|
|
2610
2656
|
{
|
|
2611
2657
|
d: "M16.6357 13.6701L18.3521 8.5208C19.8516 4.02242 20.6013 1.77322 19.414 0.585948C18.2268 -0.601312 15.9776 0.148418 11.4792 1.64788L6.32987 3.36432C2.69923 4.57453 0.883923 5.17964 0.368062 6.06698C-0.122688 6.91112 -0.122688 7.95369 0.368062 8.7978C0.883923 9.6852 2.69923 10.2903 6.32987 11.5005C6.77981 11.6505 7.28601 11.5434 7.62294 11.2096L13.1286 5.75495C13.4383 5.44808 13.9382 5.45041 14.245 5.76015C14.5519 6.06989 14.5496 6.56975 14.2398 6.87662L8.8231 12.2432C8.4518 12.6111 8.3342 13.1742 8.4995 13.6701C9.7097 17.3007 10.3148 19.1161 11.2022 19.6319C12.0463 20.1227 13.0889 20.1227 13.933 19.6319C14.8204 19.1161 15.4255 17.3008 16.6357 13.6701Z",
|
|
@@ -2622,7 +2668,7 @@ const ke = (e) => {
|
|
|
2622
2668
|
]
|
|
2623
2669
|
}
|
|
2624
2670
|
),
|
|
2625
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ l(vo, {})
|
|
2626
2672
|
] })
|
|
2627
2673
|
]
|
|
2628
2674
|
}
|
|
@@ -2630,7 +2676,859 @@ const ke = (e) => {
|
|
|
2630
2676
|
] })
|
|
2631
2677
|
] }) });
|
|
2632
2678
|
};
|
|
2679
|
+
var wt = function(e, t) {
|
|
2680
|
+
return wt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
2681
|
+
n.__proto__ = r;
|
|
2682
|
+
} || function(n, r) {
|
|
2683
|
+
for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
|
|
2684
|
+
}, wt(e, t);
|
|
2685
|
+
};
|
|
2686
|
+
function ko(e, t) {
|
|
2687
|
+
if (typeof t != "function" && t !== null)
|
|
2688
|
+
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
2689
|
+
wt(e, t);
|
|
2690
|
+
function n() {
|
|
2691
|
+
this.constructor = e;
|
|
2692
|
+
}
|
|
2693
|
+
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
2694
|
+
}
|
|
2695
|
+
var ae = function() {
|
|
2696
|
+
return ae = Object.assign || function(t) {
|
|
2697
|
+
for (var n, r = 1, o = arguments.length; r < o; r++) {
|
|
2698
|
+
n = arguments[r];
|
|
2699
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
2700
|
+
}
|
|
2701
|
+
return t;
|
|
2702
|
+
}, ae.apply(this, arguments);
|
|
2703
|
+
};
|
|
2704
|
+
function Io(e, t) {
|
|
2705
|
+
var n = {};
|
|
2706
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
2707
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
2708
|
+
for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
|
|
2709
|
+
t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
|
|
2710
|
+
return n;
|
|
2711
|
+
}
|
|
2712
|
+
var ct = "Invariant Violation", rn = Object.setPrototypeOf, Co = rn === void 0 ? function(e, t) {
|
|
2713
|
+
return e.__proto__ = t, e;
|
|
2714
|
+
} : rn, Un = (
|
|
2715
|
+
/** @class */
|
|
2716
|
+
(function(e) {
|
|
2717
|
+
ko(t, e);
|
|
2718
|
+
function t(n) {
|
|
2719
|
+
n === void 0 && (n = ct);
|
|
2720
|
+
var r = e.call(this, typeof n == "number" ? ct + ": " + n + " (see https://github.com/apollographql/invariant-packages)" : n) || this;
|
|
2721
|
+
return r.framesToPop = 1, r.name = ct, Co(r, t.prototype), r;
|
|
2722
|
+
}
|
|
2723
|
+
return t;
|
|
2724
|
+
})(Error)
|
|
2725
|
+
);
|
|
2726
|
+
function me(e, t) {
|
|
2727
|
+
if (!e)
|
|
2728
|
+
throw new Un(t);
|
|
2729
|
+
}
|
|
2730
|
+
var qn = ["debug", "log", "warn", "error", "silent"], _o = qn.indexOf("log");
|
|
2731
|
+
function He(e) {
|
|
2732
|
+
return function() {
|
|
2733
|
+
if (qn.indexOf(e) >= _o) {
|
|
2734
|
+
var t = console[e] || console.log;
|
|
2735
|
+
return t.apply(console, arguments);
|
|
2736
|
+
}
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2739
|
+
(function(e) {
|
|
2740
|
+
e.debug = He("debug"), e.log = He("log"), e.warn = He("warn"), e.error = He("error");
|
|
2741
|
+
})(me || (me = {}));
|
|
2742
|
+
var Bn = "3.14.0";
|
|
2743
|
+
function Ce(e) {
|
|
2744
|
+
try {
|
|
2745
|
+
return e();
|
|
2746
|
+
} catch {
|
|
2747
|
+
}
|
|
2748
|
+
}
|
|
2749
|
+
const xt = Ce(function() {
|
|
2750
|
+
return globalThis;
|
|
2751
|
+
}) || Ce(function() {
|
|
2752
|
+
return window;
|
|
2753
|
+
}) || Ce(function() {
|
|
2754
|
+
return self;
|
|
2755
|
+
}) || Ce(function() {
|
|
2756
|
+
return global;
|
|
2757
|
+
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
2758
|
+
// long as at least one of globalThis, window, self, or global is defined, so
|
|
2759
|
+
// we are under no obligation to make it easy for static analysis tools to
|
|
2760
|
+
// detect syntactic usage of the Function constructor. If you think you can
|
|
2761
|
+
// improve your static analysis to detect this obfuscation, think again. This
|
|
2762
|
+
// is an arms race you cannot win, at least not in JavaScript.
|
|
2763
|
+
Ce(function() {
|
|
2764
|
+
return Ce.constructor("return this")();
|
|
2765
|
+
});
|
|
2766
|
+
var on = /* @__PURE__ */ new Map();
|
|
2767
|
+
function No(e) {
|
|
2768
|
+
var t = on.get(e) || 1;
|
|
2769
|
+
return on.set(e, t + 1), "".concat(e, ":").concat(t, ":").concat(Math.random().toString(36).slice(2));
|
|
2770
|
+
}
|
|
2771
|
+
function Fo(e, t) {
|
|
2772
|
+
var n = No("stringifyForDisplay");
|
|
2773
|
+
return JSON.stringify(e, function(r, o) {
|
|
2774
|
+
return o === void 0 ? n : o;
|
|
2775
|
+
}, t).split(JSON.stringify(n)).join("<undefined>");
|
|
2776
|
+
}
|
|
2777
|
+
function Re(e) {
|
|
2778
|
+
return function(t) {
|
|
2779
|
+
for (var n = [], r = 1; r < arguments.length; r++)
|
|
2780
|
+
n[r - 1] = arguments[r];
|
|
2781
|
+
if (typeof t == "number") {
|
|
2782
|
+
var o = t;
|
|
2783
|
+
t = Nt(o), t || (t = Ft(o, n), n = []);
|
|
2784
|
+
}
|
|
2785
|
+
e.apply(void 0, [t].concat(n));
|
|
2786
|
+
};
|
|
2787
|
+
}
|
|
2788
|
+
var lt = Object.assign(function(t, n) {
|
|
2789
|
+
for (var r = [], o = 2; o < arguments.length; o++)
|
|
2790
|
+
r[o - 2] = arguments[o];
|
|
2791
|
+
t || me(t, Nt(n, r) || Ft(n, r));
|
|
2792
|
+
}, {
|
|
2793
|
+
debug: Re(me.debug),
|
|
2794
|
+
log: Re(me.log),
|
|
2795
|
+
warn: Re(me.warn),
|
|
2796
|
+
error: Re(me.error)
|
|
2797
|
+
});
|
|
2798
|
+
function Hn(e) {
|
|
2799
|
+
for (var t = [], n = 1; n < arguments.length; n++)
|
|
2800
|
+
t[n - 1] = arguments[n];
|
|
2801
|
+
return new Un(Nt(e, t) || Ft(e, t));
|
|
2802
|
+
}
|
|
2803
|
+
var sn = Symbol.for("ApolloErrorMessageHandler_" + Bn);
|
|
2804
|
+
function Rn(e) {
|
|
2805
|
+
if (typeof e == "string")
|
|
2806
|
+
return e;
|
|
2807
|
+
try {
|
|
2808
|
+
return Fo(e, 2).slice(0, 1e3);
|
|
2809
|
+
} catch {
|
|
2810
|
+
return "<non-serializable>";
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
function Nt(e, t) {
|
|
2814
|
+
if (t === void 0 && (t = []), !!e)
|
|
2815
|
+
return xt[sn] && xt[sn](e, t.map(Rn));
|
|
2816
|
+
}
|
|
2817
|
+
function Ft(e, t) {
|
|
2818
|
+
if (t === void 0 && (t = []), !!e)
|
|
2819
|
+
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
2820
|
+
version: Bn,
|
|
2821
|
+
message: e,
|
|
2822
|
+
args: t.map(Rn)
|
|
2823
|
+
})));
|
|
2824
|
+
}
|
|
2825
|
+
function To(e) {
|
|
2826
|
+
return e.definitions.filter(function(t) {
|
|
2827
|
+
return t.kind === "OperationDefinition" && !!t.name;
|
|
2828
|
+
}).map(function(t) {
|
|
2829
|
+
return t.name.value;
|
|
2830
|
+
})[0] || null;
|
|
2831
|
+
}
|
|
2832
|
+
let D = null;
|
|
2833
|
+
const an = {};
|
|
2834
|
+
let Eo = 1;
|
|
2835
|
+
const Po = () => class {
|
|
2836
|
+
constructor() {
|
|
2837
|
+
this.id = [
|
|
2838
|
+
"slot",
|
|
2839
|
+
Eo++,
|
|
2840
|
+
Date.now(),
|
|
2841
|
+
Math.random().toString(36).slice(2)
|
|
2842
|
+
].join(":");
|
|
2843
|
+
}
|
|
2844
|
+
hasValue() {
|
|
2845
|
+
for (let t = D; t; t = t.parent)
|
|
2846
|
+
if (this.id in t.slots) {
|
|
2847
|
+
const n = t.slots[this.id];
|
|
2848
|
+
if (n === an)
|
|
2849
|
+
break;
|
|
2850
|
+
return t !== D && (D.slots[this.id] = n), !0;
|
|
2851
|
+
}
|
|
2852
|
+
return D && (D.slots[this.id] = an), !1;
|
|
2853
|
+
}
|
|
2854
|
+
getValue() {
|
|
2855
|
+
if (this.hasValue())
|
|
2856
|
+
return D.slots[this.id];
|
|
2857
|
+
}
|
|
2858
|
+
withValue(t, n, r, o) {
|
|
2859
|
+
const s = {
|
|
2860
|
+
__proto__: null,
|
|
2861
|
+
[this.id]: t
|
|
2862
|
+
}, i = D;
|
|
2863
|
+
D = { parent: i, slots: s };
|
|
2864
|
+
try {
|
|
2865
|
+
return n.apply(o, r);
|
|
2866
|
+
} finally {
|
|
2867
|
+
D = i;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
// Capture the current context and wrap a callback function so that it
|
|
2871
|
+
// reestablishes the captured context when called.
|
|
2872
|
+
static bind(t) {
|
|
2873
|
+
const n = D;
|
|
2874
|
+
return function() {
|
|
2875
|
+
const r = D;
|
|
2876
|
+
try {
|
|
2877
|
+
return D = n, t.apply(this, arguments);
|
|
2878
|
+
} finally {
|
|
2879
|
+
D = r;
|
|
2880
|
+
}
|
|
2881
|
+
};
|
|
2882
|
+
}
|
|
2883
|
+
// Immediately run a callback function without any captured context.
|
|
2884
|
+
static noContext(t, n, r) {
|
|
2885
|
+
if (D) {
|
|
2886
|
+
const o = D;
|
|
2887
|
+
try {
|
|
2888
|
+
return D = null, t.apply(r, n);
|
|
2889
|
+
} finally {
|
|
2890
|
+
D = o;
|
|
2891
|
+
}
|
|
2892
|
+
} else
|
|
2893
|
+
return t.apply(r, n);
|
|
2894
|
+
}
|
|
2895
|
+
};
|
|
2896
|
+
function cn(e) {
|
|
2897
|
+
try {
|
|
2898
|
+
return e();
|
|
2899
|
+
} catch {
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
const ut = "@wry/context:Slot", Oo = (
|
|
2903
|
+
// Prefer globalThis when available.
|
|
2904
|
+
// https://github.com/benjamn/wryware/issues/347
|
|
2905
|
+
cn(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
2906
|
+
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
2907
|
+
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
2908
|
+
cn(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
2909
|
+
// back to using the Array constructor as a namespace, but that was flagged in
|
|
2910
|
+
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
2911
|
+
/* @__PURE__ */ Object.create(null)
|
|
2912
|
+
), ln = Oo, Tt = ln[ut] || // Earlier versions of this package stored the globalKey property on the Array
|
|
2913
|
+
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
2914
|
+
Array[ut] || (function(e) {
|
|
2915
|
+
try {
|
|
2916
|
+
Object.defineProperty(ln, ut, {
|
|
2917
|
+
value: e,
|
|
2918
|
+
enumerable: !1,
|
|
2919
|
+
writable: !1,
|
|
2920
|
+
// When it was possible for globalHost to be the Array constructor (a
|
|
2921
|
+
// legacy Slot dedup strategy), it was important for the property to be
|
|
2922
|
+
// configurable:true so it could be deleted. That does not seem to be as
|
|
2923
|
+
// important when globalHost is the global object, but I don't want to
|
|
2924
|
+
// cause similar problems again, and configurable:true seems safest.
|
|
2925
|
+
// https://github.com/endojs/endo/issues/576#issuecomment-1178274008
|
|
2926
|
+
configurable: !0
|
|
2927
|
+
});
|
|
2928
|
+
} finally {
|
|
2929
|
+
return e;
|
|
2930
|
+
}
|
|
2931
|
+
})(Po()), { bind: hs, noContext: ms } = Tt;
|
|
2932
|
+
new Tt();
|
|
2933
|
+
function $o(e, t) {
|
|
2934
|
+
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2935
|
+
if (n) return (n = n.call(e)).next.bind(n);
|
|
2936
|
+
if (Array.isArray(e) || (n = jo(e)) || t) {
|
|
2937
|
+
n && (e = n);
|
|
2938
|
+
var r = 0;
|
|
2939
|
+
return function() {
|
|
2940
|
+
return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
|
|
2941
|
+
};
|
|
2942
|
+
}
|
|
2943
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2944
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2945
|
+
}
|
|
2946
|
+
function jo(e, t) {
|
|
2947
|
+
if (e) {
|
|
2948
|
+
if (typeof e == "string") return un(e, t);
|
|
2949
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
2950
|
+
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
2951
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return un(e, t);
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
function un(e, t) {
|
|
2955
|
+
(t == null || t > e.length) && (t = e.length);
|
|
2956
|
+
for (var n = 0, r = new Array(t); n < t; n++)
|
|
2957
|
+
r[n] = e[n];
|
|
2958
|
+
return r;
|
|
2959
|
+
}
|
|
2960
|
+
function fn(e, t) {
|
|
2961
|
+
for (var n = 0; n < t.length; n++) {
|
|
2962
|
+
var r = t[n];
|
|
2963
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
function Et(e, t, n) {
|
|
2967
|
+
return t && fn(e.prototype, t), n && fn(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
2968
|
+
}
|
|
2969
|
+
var Pt = function() {
|
|
2970
|
+
return typeof Symbol == "function";
|
|
2971
|
+
}, Ot = function(e) {
|
|
2972
|
+
return Pt() && !!Symbol[e];
|
|
2973
|
+
}, $t = function(e) {
|
|
2974
|
+
return Ot(e) ? Symbol[e] : "@@" + e;
|
|
2975
|
+
};
|
|
2976
|
+
Pt() && !Ot("observable") && (Symbol.observable = Symbol("observable"));
|
|
2977
|
+
var Ao = $t("iterator"), vt = $t("observable"), zn = $t("species");
|
|
2978
|
+
function Ze(e, t) {
|
|
2979
|
+
var n = e[t];
|
|
2980
|
+
if (n != null) {
|
|
2981
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2982
|
+
return n;
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
function Le(e) {
|
|
2986
|
+
var t = e.constructor;
|
|
2987
|
+
return t !== void 0 && (t = t[zn], t === null && (t = void 0)), t !== void 0 ? t : U;
|
|
2988
|
+
}
|
|
2989
|
+
function Lo(e) {
|
|
2990
|
+
return e instanceof U;
|
|
2991
|
+
}
|
|
2992
|
+
function Ee(e) {
|
|
2993
|
+
Ee.log ? Ee.log(e) : setTimeout(function() {
|
|
2994
|
+
throw e;
|
|
2995
|
+
});
|
|
2996
|
+
}
|
|
2997
|
+
function Ke(e) {
|
|
2998
|
+
Promise.resolve().then(function() {
|
|
2999
|
+
try {
|
|
3000
|
+
e();
|
|
3001
|
+
} catch (t) {
|
|
3002
|
+
Ee(t);
|
|
3003
|
+
}
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
function Vn(e) {
|
|
3007
|
+
var t = e._cleanup;
|
|
3008
|
+
if (t !== void 0 && (e._cleanup = void 0, !!t))
|
|
3009
|
+
try {
|
|
3010
|
+
if (typeof t == "function")
|
|
3011
|
+
t();
|
|
3012
|
+
else {
|
|
3013
|
+
var n = Ze(t, "unsubscribe");
|
|
3014
|
+
n && n.call(t);
|
|
3015
|
+
}
|
|
3016
|
+
} catch (r) {
|
|
3017
|
+
Ee(r);
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
function St(e) {
|
|
3021
|
+
e._observer = void 0, e._queue = void 0, e._state = "closed";
|
|
3022
|
+
}
|
|
3023
|
+
function Do(e) {
|
|
3024
|
+
var t = e._queue;
|
|
3025
|
+
if (t) {
|
|
3026
|
+
e._queue = void 0, e._state = "ready";
|
|
3027
|
+
for (var n = 0; n < t.length && (Jn(e, t[n].type, t[n].value), e._state !== "closed"); ++n)
|
|
3028
|
+
;
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
function Jn(e, t, n) {
|
|
3032
|
+
e._state = "running";
|
|
3033
|
+
var r = e._observer;
|
|
3034
|
+
try {
|
|
3035
|
+
var o = Ze(r, t);
|
|
3036
|
+
switch (t) {
|
|
3037
|
+
case "next":
|
|
3038
|
+
o && o.call(r, n);
|
|
3039
|
+
break;
|
|
3040
|
+
case "error":
|
|
3041
|
+
if (St(e), o) o.call(r, n);
|
|
3042
|
+
else throw n;
|
|
3043
|
+
break;
|
|
3044
|
+
case "complete":
|
|
3045
|
+
St(e), o && o.call(r);
|
|
3046
|
+
break;
|
|
3047
|
+
}
|
|
3048
|
+
} catch (s) {
|
|
3049
|
+
Ee(s);
|
|
3050
|
+
}
|
|
3051
|
+
e._state === "closed" ? Vn(e) : e._state === "running" && (e._state = "ready");
|
|
3052
|
+
}
|
|
3053
|
+
function ft(e, t, n) {
|
|
3054
|
+
if (e._state !== "closed") {
|
|
3055
|
+
if (e._state === "buffering") {
|
|
3056
|
+
e._queue.push({
|
|
3057
|
+
type: t,
|
|
3058
|
+
value: n
|
|
3059
|
+
});
|
|
3060
|
+
return;
|
|
3061
|
+
}
|
|
3062
|
+
if (e._state !== "ready") {
|
|
3063
|
+
e._state = "buffering", e._queue = [{
|
|
3064
|
+
type: t,
|
|
3065
|
+
value: n
|
|
3066
|
+
}], Ke(function() {
|
|
3067
|
+
return Do(e);
|
|
3068
|
+
});
|
|
3069
|
+
return;
|
|
3070
|
+
}
|
|
3071
|
+
Jn(e, t, n);
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
var Mo = /* @__PURE__ */ (function() {
|
|
3075
|
+
function e(n, r) {
|
|
3076
|
+
this._cleanup = void 0, this._observer = n, this._queue = void 0, this._state = "initializing";
|
|
3077
|
+
var o = new Uo(this);
|
|
3078
|
+
try {
|
|
3079
|
+
this._cleanup = r.call(void 0, o);
|
|
3080
|
+
} catch (s) {
|
|
3081
|
+
o.error(s);
|
|
3082
|
+
}
|
|
3083
|
+
this._state === "initializing" && (this._state = "ready");
|
|
3084
|
+
}
|
|
3085
|
+
var t = e.prototype;
|
|
3086
|
+
return t.unsubscribe = function() {
|
|
3087
|
+
this._state !== "closed" && (St(this), Vn(this));
|
|
3088
|
+
}, Et(e, [{
|
|
3089
|
+
key: "closed",
|
|
3090
|
+
get: function() {
|
|
3091
|
+
return this._state === "closed";
|
|
3092
|
+
}
|
|
3093
|
+
}]), e;
|
|
3094
|
+
})(), Uo = /* @__PURE__ */ (function() {
|
|
3095
|
+
function e(n) {
|
|
3096
|
+
this._subscription = n;
|
|
3097
|
+
}
|
|
3098
|
+
var t = e.prototype;
|
|
3099
|
+
return t.next = function(r) {
|
|
3100
|
+
ft(this._subscription, "next", r);
|
|
3101
|
+
}, t.error = function(r) {
|
|
3102
|
+
ft(this._subscription, "error", r);
|
|
3103
|
+
}, t.complete = function() {
|
|
3104
|
+
ft(this._subscription, "complete");
|
|
3105
|
+
}, Et(e, [{
|
|
3106
|
+
key: "closed",
|
|
3107
|
+
get: function() {
|
|
3108
|
+
return this._subscription._state === "closed";
|
|
3109
|
+
}
|
|
3110
|
+
}]), e;
|
|
3111
|
+
})(), U = /* @__PURE__ */ (function() {
|
|
3112
|
+
function e(n) {
|
|
3113
|
+
if (!(this instanceof e)) throw new TypeError("Observable cannot be called as a function");
|
|
3114
|
+
if (typeof n != "function") throw new TypeError("Observable initializer must be a function");
|
|
3115
|
+
this._subscriber = n;
|
|
3116
|
+
}
|
|
3117
|
+
var t = e.prototype;
|
|
3118
|
+
return t.subscribe = function(r) {
|
|
3119
|
+
return (typeof r != "object" || r === null) && (r = {
|
|
3120
|
+
next: r,
|
|
3121
|
+
error: arguments[1],
|
|
3122
|
+
complete: arguments[2]
|
|
3123
|
+
}), new Mo(r, this._subscriber);
|
|
3124
|
+
}, t.forEach = function(r) {
|
|
3125
|
+
var o = this;
|
|
3126
|
+
return new Promise(function(s, i) {
|
|
3127
|
+
if (typeof r != "function") {
|
|
3128
|
+
i(new TypeError(r + " is not a function"));
|
|
3129
|
+
return;
|
|
3130
|
+
}
|
|
3131
|
+
function c() {
|
|
3132
|
+
a.unsubscribe(), s();
|
|
3133
|
+
}
|
|
3134
|
+
var a = o.subscribe({
|
|
3135
|
+
next: function(u) {
|
|
3136
|
+
try {
|
|
3137
|
+
r(u, c);
|
|
3138
|
+
} catch (d) {
|
|
3139
|
+
i(d), a.unsubscribe();
|
|
3140
|
+
}
|
|
3141
|
+
},
|
|
3142
|
+
error: i,
|
|
3143
|
+
complete: s
|
|
3144
|
+
});
|
|
3145
|
+
});
|
|
3146
|
+
}, t.map = function(r) {
|
|
3147
|
+
var o = this;
|
|
3148
|
+
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
3149
|
+
var s = Le(this);
|
|
3150
|
+
return new s(function(i) {
|
|
3151
|
+
return o.subscribe({
|
|
3152
|
+
next: function(c) {
|
|
3153
|
+
try {
|
|
3154
|
+
c = r(c);
|
|
3155
|
+
} catch (a) {
|
|
3156
|
+
return i.error(a);
|
|
3157
|
+
}
|
|
3158
|
+
i.next(c);
|
|
3159
|
+
},
|
|
3160
|
+
error: function(c) {
|
|
3161
|
+
i.error(c);
|
|
3162
|
+
},
|
|
3163
|
+
complete: function() {
|
|
3164
|
+
i.complete();
|
|
3165
|
+
}
|
|
3166
|
+
});
|
|
3167
|
+
});
|
|
3168
|
+
}, t.filter = function(r) {
|
|
3169
|
+
var o = this;
|
|
3170
|
+
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
3171
|
+
var s = Le(this);
|
|
3172
|
+
return new s(function(i) {
|
|
3173
|
+
return o.subscribe({
|
|
3174
|
+
next: function(c) {
|
|
3175
|
+
try {
|
|
3176
|
+
if (!r(c)) return;
|
|
3177
|
+
} catch (a) {
|
|
3178
|
+
return i.error(a);
|
|
3179
|
+
}
|
|
3180
|
+
i.next(c);
|
|
3181
|
+
},
|
|
3182
|
+
error: function(c) {
|
|
3183
|
+
i.error(c);
|
|
3184
|
+
},
|
|
3185
|
+
complete: function() {
|
|
3186
|
+
i.complete();
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
3189
|
+
});
|
|
3190
|
+
}, t.reduce = function(r) {
|
|
3191
|
+
var o = this;
|
|
3192
|
+
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
3193
|
+
var s = Le(this), i = arguments.length > 1, c = !1, a = arguments[1], u = a;
|
|
3194
|
+
return new s(function(d) {
|
|
3195
|
+
return o.subscribe({
|
|
3196
|
+
next: function(h) {
|
|
3197
|
+
var m = !c;
|
|
3198
|
+
if (c = !0, !m || i)
|
|
3199
|
+
try {
|
|
3200
|
+
u = r(u, h);
|
|
3201
|
+
} catch (g) {
|
|
3202
|
+
return d.error(g);
|
|
3203
|
+
}
|
|
3204
|
+
else
|
|
3205
|
+
u = h;
|
|
3206
|
+
},
|
|
3207
|
+
error: function(h) {
|
|
3208
|
+
d.error(h);
|
|
3209
|
+
},
|
|
3210
|
+
complete: function() {
|
|
3211
|
+
if (!c && !i) return d.error(new TypeError("Cannot reduce an empty sequence"));
|
|
3212
|
+
d.next(u), d.complete();
|
|
3213
|
+
}
|
|
3214
|
+
});
|
|
3215
|
+
});
|
|
3216
|
+
}, t.concat = function() {
|
|
3217
|
+
for (var r = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
|
|
3218
|
+
s[i] = arguments[i];
|
|
3219
|
+
var c = Le(this);
|
|
3220
|
+
return new c(function(a) {
|
|
3221
|
+
var u, d = 0;
|
|
3222
|
+
function h(m) {
|
|
3223
|
+
u = m.subscribe({
|
|
3224
|
+
next: function(g) {
|
|
3225
|
+
a.next(g);
|
|
3226
|
+
},
|
|
3227
|
+
error: function(g) {
|
|
3228
|
+
a.error(g);
|
|
3229
|
+
},
|
|
3230
|
+
complete: function() {
|
|
3231
|
+
d === s.length ? (u = void 0, a.complete()) : h(c.from(s[d++]));
|
|
3232
|
+
}
|
|
3233
|
+
});
|
|
3234
|
+
}
|
|
3235
|
+
return h(r), function() {
|
|
3236
|
+
u && (u.unsubscribe(), u = void 0);
|
|
3237
|
+
};
|
|
3238
|
+
});
|
|
3239
|
+
}, t.flatMap = function(r) {
|
|
3240
|
+
var o = this;
|
|
3241
|
+
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
3242
|
+
var s = Le(this);
|
|
3243
|
+
return new s(function(i) {
|
|
3244
|
+
var c = [], a = o.subscribe({
|
|
3245
|
+
next: function(d) {
|
|
3246
|
+
if (r)
|
|
3247
|
+
try {
|
|
3248
|
+
d = r(d);
|
|
3249
|
+
} catch (m) {
|
|
3250
|
+
return i.error(m);
|
|
3251
|
+
}
|
|
3252
|
+
var h = s.from(d).subscribe({
|
|
3253
|
+
next: function(m) {
|
|
3254
|
+
i.next(m);
|
|
3255
|
+
},
|
|
3256
|
+
error: function(m) {
|
|
3257
|
+
i.error(m);
|
|
3258
|
+
},
|
|
3259
|
+
complete: function() {
|
|
3260
|
+
var m = c.indexOf(h);
|
|
3261
|
+
m >= 0 && c.splice(m, 1), u();
|
|
3262
|
+
}
|
|
3263
|
+
});
|
|
3264
|
+
c.push(h);
|
|
3265
|
+
},
|
|
3266
|
+
error: function(d) {
|
|
3267
|
+
i.error(d);
|
|
3268
|
+
},
|
|
3269
|
+
complete: function() {
|
|
3270
|
+
u();
|
|
3271
|
+
}
|
|
3272
|
+
});
|
|
3273
|
+
function u() {
|
|
3274
|
+
a.closed && c.length === 0 && i.complete();
|
|
3275
|
+
}
|
|
3276
|
+
return function() {
|
|
3277
|
+
c.forEach(function(d) {
|
|
3278
|
+
return d.unsubscribe();
|
|
3279
|
+
}), a.unsubscribe();
|
|
3280
|
+
};
|
|
3281
|
+
});
|
|
3282
|
+
}, t[vt] = function() {
|
|
3283
|
+
return this;
|
|
3284
|
+
}, e.from = function(r) {
|
|
3285
|
+
var o = typeof this == "function" ? this : e;
|
|
3286
|
+
if (r == null) throw new TypeError(r + " is not an object");
|
|
3287
|
+
var s = Ze(r, vt);
|
|
3288
|
+
if (s) {
|
|
3289
|
+
var i = s.call(r);
|
|
3290
|
+
if (Object(i) !== i) throw new TypeError(i + " is not an object");
|
|
3291
|
+
return Lo(i) && i.constructor === o ? i : new o(function(c) {
|
|
3292
|
+
return i.subscribe(c);
|
|
3293
|
+
});
|
|
3294
|
+
}
|
|
3295
|
+
if (Ot("iterator") && (s = Ze(r, Ao), s))
|
|
3296
|
+
return new o(function(c) {
|
|
3297
|
+
Ke(function() {
|
|
3298
|
+
if (!c.closed) {
|
|
3299
|
+
for (var a = $o(s.call(r)), u; !(u = a()).done; ) {
|
|
3300
|
+
var d = u.value;
|
|
3301
|
+
if (c.next(d), c.closed) return;
|
|
3302
|
+
}
|
|
3303
|
+
c.complete();
|
|
3304
|
+
}
|
|
3305
|
+
});
|
|
3306
|
+
});
|
|
3307
|
+
if (Array.isArray(r))
|
|
3308
|
+
return new o(function(c) {
|
|
3309
|
+
Ke(function() {
|
|
3310
|
+
if (!c.closed) {
|
|
3311
|
+
for (var a = 0; a < r.length; ++a)
|
|
3312
|
+
if (c.next(r[a]), c.closed) return;
|
|
3313
|
+
c.complete();
|
|
3314
|
+
}
|
|
3315
|
+
});
|
|
3316
|
+
});
|
|
3317
|
+
throw new TypeError(r + " is not observable");
|
|
3318
|
+
}, e.of = function() {
|
|
3319
|
+
for (var r = arguments.length, o = new Array(r), s = 0; s < r; s++)
|
|
3320
|
+
o[s] = arguments[s];
|
|
3321
|
+
var i = typeof this == "function" ? this : e;
|
|
3322
|
+
return new i(function(c) {
|
|
3323
|
+
Ke(function() {
|
|
3324
|
+
if (!c.closed) {
|
|
3325
|
+
for (var a = 0; a < o.length; ++a)
|
|
3326
|
+
if (c.next(o[a]), c.closed) return;
|
|
3327
|
+
c.complete();
|
|
3328
|
+
}
|
|
3329
|
+
});
|
|
3330
|
+
});
|
|
3331
|
+
}, Et(e, null, [{
|
|
3332
|
+
key: zn,
|
|
3333
|
+
get: function() {
|
|
3334
|
+
return this;
|
|
3335
|
+
}
|
|
3336
|
+
}]), e;
|
|
3337
|
+
})();
|
|
3338
|
+
Pt() && Object.defineProperty(U, Symbol("extensions"), {
|
|
3339
|
+
value: {
|
|
3340
|
+
symbol: vt,
|
|
3341
|
+
hostReportError: Ee
|
|
3342
|
+
},
|
|
3343
|
+
configurable: !0
|
|
3344
|
+
});
|
|
3345
|
+
function qo(e) {
|
|
3346
|
+
var t, n = e.Symbol;
|
|
3347
|
+
if (typeof n == "function")
|
|
3348
|
+
if (n.observable)
|
|
3349
|
+
t = n.observable;
|
|
3350
|
+
else {
|
|
3351
|
+
typeof n.for == "function" ? t = n.for("https://github.com/benlesh/symbol-observable") : t = n("https://github.com/benlesh/symbol-observable");
|
|
3352
|
+
try {
|
|
3353
|
+
n.observable = t;
|
|
3354
|
+
} catch {
|
|
3355
|
+
}
|
|
3356
|
+
}
|
|
3357
|
+
else
|
|
3358
|
+
t = "@@observable";
|
|
3359
|
+
return t;
|
|
3360
|
+
}
|
|
3361
|
+
var _e;
|
|
3362
|
+
typeof self < "u" ? _e = self : typeof window < "u" ? _e = window : typeof global < "u" ? _e = global : typeof module < "u" ? _e = module : _e = Function("return this")();
|
|
3363
|
+
qo(_e);
|
|
3364
|
+
var dn = U.prototype, pn = "@@observable";
|
|
3365
|
+
dn[pn] || (dn[pn] = function() {
|
|
3366
|
+
return this;
|
|
3367
|
+
});
|
|
3368
|
+
function Bo(e) {
|
|
3369
|
+
for (var t = [
|
|
3370
|
+
"query",
|
|
3371
|
+
"operationName",
|
|
3372
|
+
"variables",
|
|
3373
|
+
"extensions",
|
|
3374
|
+
"context"
|
|
3375
|
+
], n = 0, r = Object.keys(e); n < r.length; n++) {
|
|
3376
|
+
var o = r[n];
|
|
3377
|
+
if (t.indexOf(o) < 0)
|
|
3378
|
+
throw Hn(58, o);
|
|
3379
|
+
}
|
|
3380
|
+
return e;
|
|
3381
|
+
}
|
|
3382
|
+
function Ho(e, t) {
|
|
3383
|
+
var n = ae({}, e), r = function(s) {
|
|
3384
|
+
typeof s == "function" ? n = ae(ae({}, n), s(n)) : n = ae(ae({}, n), s);
|
|
3385
|
+
}, o = function() {
|
|
3386
|
+
return ae({}, n);
|
|
3387
|
+
};
|
|
3388
|
+
return Object.defineProperty(t, "setContext", {
|
|
3389
|
+
enumerable: !1,
|
|
3390
|
+
value: r
|
|
3391
|
+
}), Object.defineProperty(t, "getContext", {
|
|
3392
|
+
enumerable: !1,
|
|
3393
|
+
value: o
|
|
3394
|
+
}), t;
|
|
3395
|
+
}
|
|
3396
|
+
function Ro(e) {
|
|
3397
|
+
var t = {
|
|
3398
|
+
variables: e.variables || {},
|
|
3399
|
+
extensions: e.extensions || {},
|
|
3400
|
+
operationName: e.operationName,
|
|
3401
|
+
query: e.query
|
|
3402
|
+
};
|
|
3403
|
+
return t.operationName || (t.operationName = typeof t.query != "string" ? To(t.query) || void 0 : ""), t;
|
|
3404
|
+
}
|
|
3405
|
+
var zo = Symbol.for("apollo.deprecations"), Vo = xt, Jo = new Tt();
|
|
3406
|
+
function Ko(e) {
|
|
3407
|
+
return Vo[zo] || (Jo.getValue() || []).includes(e);
|
|
3408
|
+
}
|
|
3409
|
+
function Go(e, t) {
|
|
3410
|
+
Ko(e) || t();
|
|
3411
|
+
}
|
|
3412
|
+
function hn(e, t) {
|
|
3413
|
+
return t ? t(e) : U.of();
|
|
3414
|
+
}
|
|
3415
|
+
function De(e) {
|
|
3416
|
+
return typeof e == "function" ? new Kn(e) : e;
|
|
3417
|
+
}
|
|
3418
|
+
function ze(e) {
|
|
3419
|
+
return e.request.length <= 1;
|
|
3420
|
+
}
|
|
3421
|
+
var Kn = (
|
|
3422
|
+
/** @class */
|
|
3423
|
+
(function() {
|
|
3424
|
+
function e(t) {
|
|
3425
|
+
t && (this.request = t);
|
|
3426
|
+
}
|
|
3427
|
+
return e.empty = function() {
|
|
3428
|
+
return new e(function() {
|
|
3429
|
+
return U.of();
|
|
3430
|
+
});
|
|
3431
|
+
}, e.from = function(t) {
|
|
3432
|
+
return t.length === 0 ? e.empty() : t.map(De).reduce(function(n, r) {
|
|
3433
|
+
return n.concat(r);
|
|
3434
|
+
});
|
|
3435
|
+
}, e.split = function(t, n, r) {
|
|
3436
|
+
var o = De(n), s = De(r || new e(hn)), i;
|
|
3437
|
+
return ze(o) && ze(s) ? i = new e(function(c) {
|
|
3438
|
+
return t(c) ? o.request(c) || U.of() : s.request(c) || U.of();
|
|
3439
|
+
}) : i = new e(function(c, a) {
|
|
3440
|
+
return t(c) ? o.request(c, a) || U.of() : s.request(c, a) || U.of();
|
|
3441
|
+
}), Object.assign(i, { left: o, right: s });
|
|
3442
|
+
}, e.execute = function(t, n) {
|
|
3443
|
+
return t.request(Ho(n.context, Ro(Bo(n)))) || U.of();
|
|
3444
|
+
}, e.concat = function(t, n) {
|
|
3445
|
+
var r = De(t);
|
|
3446
|
+
if (ze(r))
|
|
3447
|
+
return globalThis.__DEV__ !== !1 && lt.warn(47, r), r;
|
|
3448
|
+
var o = De(n), s;
|
|
3449
|
+
return ze(o) ? s = new e(function(i) {
|
|
3450
|
+
return r.request(i, function(c) {
|
|
3451
|
+
return o.request(c) || U.of();
|
|
3452
|
+
}) || U.of();
|
|
3453
|
+
}) : s = new e(function(i, c) {
|
|
3454
|
+
return r.request(i, function(a) {
|
|
3455
|
+
return o.request(a, c) || U.of();
|
|
3456
|
+
}) || U.of();
|
|
3457
|
+
}), Object.assign(s, { left: r, right: o });
|
|
3458
|
+
}, e.prototype.split = function(t, n, r) {
|
|
3459
|
+
return this.concat(e.split(t, n, r || new e(hn)));
|
|
3460
|
+
}, e.prototype.concat = function(t) {
|
|
3461
|
+
return e.concat(this, t);
|
|
3462
|
+
}, e.prototype.request = function(t, n) {
|
|
3463
|
+
throw Hn(48);
|
|
3464
|
+
}, e.prototype.onError = function(t, n) {
|
|
3465
|
+
if (globalThis.__DEV__ !== !1 && Go("onError", function() {
|
|
3466
|
+
globalThis.__DEV__ !== !1 && lt.warn(49);
|
|
3467
|
+
}), n && n.error)
|
|
3468
|
+
return n.error(t), !1;
|
|
3469
|
+
throw t;
|
|
3470
|
+
}, e.prototype.setOnError = function(t) {
|
|
3471
|
+
return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && lt.warn(50), this.onError = t, this;
|
|
3472
|
+
}, e;
|
|
3473
|
+
})()
|
|
3474
|
+
);
|
|
3475
|
+
function Wo(e) {
|
|
3476
|
+
return new Kn(function(t, n) {
|
|
3477
|
+
var r = Io(t, []);
|
|
3478
|
+
return new U(function(o) {
|
|
3479
|
+
var s, i = !1;
|
|
3480
|
+
return Promise.resolve(r).then(function(c) {
|
|
3481
|
+
return e(c, t.getContext());
|
|
3482
|
+
}).then(t.setContext).then(function() {
|
|
3483
|
+
i || (s = n(t).subscribe({
|
|
3484
|
+
next: o.next.bind(o),
|
|
3485
|
+
error: o.error.bind(o),
|
|
3486
|
+
complete: o.complete.bind(o)
|
|
3487
|
+
}));
|
|
3488
|
+
}).catch(o.error.bind(o)), function() {
|
|
3489
|
+
i = !0, s && s.unsubscribe();
|
|
3490
|
+
};
|
|
3491
|
+
});
|
|
3492
|
+
});
|
|
3493
|
+
}
|
|
3494
|
+
const Qo = async () => {
|
|
3495
|
+
const e = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", r = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
3496
|
+
try {
|
|
3497
|
+
const o = await q.post(
|
|
3498
|
+
e,
|
|
3499
|
+
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
3500
|
+
// Only grant_type in body
|
|
3501
|
+
{
|
|
3502
|
+
headers: {
|
|
3503
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
3504
|
+
Authorization: r
|
|
3505
|
+
}
|
|
3506
|
+
}
|
|
3507
|
+
);
|
|
3508
|
+
return o.status === 200 && o.data.access_token ? o.data.access_token : (console.error("Failed to fetch token:", o.data), null);
|
|
3509
|
+
} catch (o) {
|
|
3510
|
+
return q.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
|
|
3511
|
+
}
|
|
3512
|
+
}, Yo = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", Zo = Zn({
|
|
3513
|
+
uri: `${Yo}`
|
|
3514
|
+
}), Xo = Wo(async (e, { headers: t }) => {
|
|
3515
|
+
const n = await Qo();
|
|
3516
|
+
return {
|
|
3517
|
+
headers: {
|
|
3518
|
+
...t,
|
|
3519
|
+
authorization: `Bearer ${n}`
|
|
3520
|
+
}
|
|
3521
|
+
};
|
|
3522
|
+
}), es = new Xn({
|
|
3523
|
+
link: Xo.concat(Zo),
|
|
3524
|
+
cache: new er(),
|
|
3525
|
+
defaultOptions: {
|
|
3526
|
+
watchQuery: {
|
|
3527
|
+
fetchPolicy: "cache-and-network"
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
}), gs = () => /* @__PURE__ */ l(tr, { client: es, children: /* @__PURE__ */ l(lr, { children: /* @__PURE__ */ l(So, {}) }) });
|
|
2633
3531
|
export {
|
|
2634
|
-
|
|
3532
|
+
gs as TanyaChatbot
|
|
2635
3533
|
};
|
|
2636
3534
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|