@faststore/api 4.9.2 → 4.9.3-dev.1

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/es/index.mjs CHANGED
@@ -1,152 +1,152 @@
1
- import { mergeTypeDefs as sn } from "@graphql-tools/merge";
2
- import { makeExecutableSchema as xn, mergeSchemas as qn } from "@graphql-tools/schema";
3
- import { mapSchema as cn, MapperKind as ln, getDirective as dn } from "@graphql-tools/utils";
4
- import { GraphQLScalarType as jn, print as Wn, parse as Gn, isSchema as Hn } from "graphql";
5
- import { logger as Xn, OTELAPI as V } from "@faststore/diagnostics";
6
- import Yn from "isomorphic-unfetch";
7
- import { parse as Z } from "cookie";
8
- import Ae from "p-limit";
9
- import ue from "dataloader";
10
- import Jn from "sanitize-html";
11
- import De from "fast-deep-equal";
12
- import Kn from "node:crypto";
13
- var Qn = /* @__PURE__ */ ((e) => (e.Personal = "personal", e.Shared = "shared", e))(Qn || {}), Zn = /* @__PURE__ */ ((e) => (e.Accepted = "accepted", e.Denied = "denied", e.Pending = "pending", e))(Zn || {}), et = /* @__PURE__ */ ((e) => (e.Brand = "Brand", e.Category = "Category", e.Cluster = "Cluster", e.Collection = "Collection", e.Department = "Department", e.SubCategory = "SubCategory", e))(et || {}), nt = /* @__PURE__ */ ((e) => (e.Boolean = "BOOLEAN", e.Range = "RANGE", e))(nt || {}), tt = /* @__PURE__ */ ((e) => (e.DiscountDesc = "discount_desc", e.NameAsc = "name_asc", e.NameDesc = "name_desc", e.OrdersDesc = "orders_desc", e.PriceAsc = "price_asc", e.PriceDesc = "price_desc", e.ReleaseDesc = "release_desc", e.ScoreDesc = "score_desc", e))(tt || {}), rt = /* @__PURE__ */ ((e) => (e.Error = "ERROR", e.Info = "INFO", e.Warning = "WARNING", e))(rt || {}), it = /* @__PURE__ */ ((e) => (e.Input = "Input", e.Output = "Output", e))(it || {});
14
- const at = () => function(n = {}) {
1
+ import { mergeTypeDefs as dn } from "@graphql-tools/merge";
2
+ import { makeExecutableSchema as Yn, mergeSchemas as Jn } from "@graphql-tools/schema";
3
+ import { mapSchema as un, MapperKind as pn, getDirective as gn } from "@graphql-tools/utils";
4
+ import { GraphQLScalarType as Kn, print as Qn, parse as Zn, isSchema as et } from "graphql";
5
+ import { logger as nt, OTELAPI as x } from "@faststore/diagnostics";
6
+ import tt from "isomorphic-unfetch";
7
+ import { parse as re } from "cookie";
8
+ import ke from "p-limit";
9
+ import he from "dataloader";
10
+ import rt from "sanitize-html";
11
+ import _e from "fast-deep-equal";
12
+ import it from "node:crypto";
13
+ var at = /* @__PURE__ */ ((e) => (e.Personal = "personal", e.Shared = "shared", e))(at || {}), ot = /* @__PURE__ */ ((e) => (e.Accepted = "accepted", e.Denied = "denied", e.Pending = "pending", e))(ot || {}), st = /* @__PURE__ */ ((e) => (e.Brand = "Brand", e.Category = "Category", e.Cluster = "Cluster", e.Collection = "Collection", e.Department = "Department", e.SubCategory = "SubCategory", e))(st || {}), ct = /* @__PURE__ */ ((e) => (e.Boolean = "BOOLEAN", e.Range = "RANGE", e))(ct || {}), lt = /* @__PURE__ */ ((e) => (e.DiscountDesc = "discount_desc", e.NameAsc = "name_asc", e.NameDesc = "name_desc", e.OrdersDesc = "orders_desc", e.PriceAsc = "price_asc", e.PriceDesc = "price_desc", e.ReleaseDesc = "release_desc", e.ScoreDesc = "score_desc", e))(lt || {}), dt = /* @__PURE__ */ ((e) => (e.Error = "ERROR", e.Info = "INFO", e.Warning = "WARNING", e))(dt || {}), ut = /* @__PURE__ */ ((e) => (e.Input = "Input", e.Output = "Output", e))(ut || {});
14
+ const pt = () => function(n = {}) {
15
15
  const t = process.env.FS_DISCOVERY_APP_KEY ?? "", r = process.env.FS_DISCOVERY_APP_TOKEN ?? "";
16
16
  if (!t || !r)
17
- throw new K("No authentication AppKey and AppToken passed.");
17
+ throw new ne("No authentication AppKey and AppToken passed.");
18
18
  return {
19
19
  ...n,
20
20
  "X-VTEX-API-AppKey": t,
21
21
  "X-VTEX-API-AppToken": r
22
22
  };
23
- }, ot = async (e) => {
23
+ }, gt = async (e) => {
24
24
  const {
25
25
  clients: { commerce: n }
26
26
  } = e;
27
27
  try {
28
28
  if ((await n.vtexid.validate())?.authStatus?.toLowerCase() !== "success")
29
- throw new ie("Authentication required");
29
+ throw new ce("Authentication required");
30
30
  } catch (t) {
31
31
  const r = t.extensions?.status ?? t.status;
32
- throw r === 401 ? new ie("Authentication required") : r === 403 ? new K("You are not allowed to access this resource") : new ie("Authentication required");
32
+ throw r === 401 ? new ce("Authentication required") : r === 403 ? new ne("You are not allowed to access this resource") : new ce("Authentication required");
33
33
  }
34
- }, st = "auth", ct = {
34
+ }, mt = "auth", ht = {
35
35
  typeDefs: "directive @auth on FIELD_DEFINITION",
36
- transformer: (e) => cn(e, {
37
- [ln.OBJECT_FIELD]: (n) => {
38
- if (dn(e, n, st)?.[0]) {
36
+ transformer: (e) => un(e, {
37
+ [pn.OBJECT_FIELD]: (n) => {
38
+ if (gn(e, n, mt)?.[0]) {
39
39
  const r = n.resolve;
40
- n.resolve = async (i, a, o, s) => (await ot(o), r?.(i, a, o, s));
40
+ n.resolve = async (i, a, o, s) => (await gt(o), r?.(i, a, o, s));
41
41
  }
42
42
  return n;
43
43
  }
44
44
  })
45
- }, lt = "cacheControl", ho = (e, n) => {
45
+ }, ft = "cacheControl", Eo = (e, n) => {
46
46
  const {
47
47
  scope: t = "private",
48
48
  sMaxAge: r = 0,
49
49
  staleWhileRevalidate: i = 0
50
50
  } = e;
51
51
  return `${n ? "private" : t}, s-maxage=${r}, stale-while-revalidate=${i}`;
52
- }, Ue = (e, n) => typeof e == "number" && typeof n == "number" ? e > n ? n : e : typeof e == "number" ? e : n, dt = (e, n) => typeof e == "string" && typeof n == "string" ? e === "public" && n === "public" ? "public" : "private" : e || n, ut = {
52
+ }, Te = (e, n) => typeof e == "number" && typeof n == "number" ? e > n ? n : e : typeof e == "number" ? e : n, St = (e, n) => typeof e == "string" && typeof n == "string" ? e === "public" && n === "public" ? "public" : "private" : e || n, yt = {
53
53
  typeDefs: "directive @cacheControl(sMaxAge: Int, staleWhileRevalidate: Int, scope: String) on FIELD_DEFINITION",
54
- transformer: (e) => cn(e, {
55
- [ln.OBJECT_FIELD]: (n) => {
56
- const t = dn(e, n, lt)?.[0];
54
+ transformer: (e) => un(e, {
55
+ [pn.OBJECT_FIELD]: (n) => {
56
+ const t = gn(e, n, ft)?.[0];
57
57
  if (t) {
58
58
  const { sMaxAge: r, staleWhileRevalidate: i, scope: a } = t, o = n.resolve;
59
- n.resolve = (s, c, u, d) => (u.cacheControl = {
60
- sMaxAge: Ue(u.cacheControl?.sMaxAge, r),
61
- staleWhileRevalidate: Ue(
62
- u.cacheControl?.staleWhileRevalidate,
59
+ n.resolve = (s, c, d, g) => (d.cacheControl = {
60
+ sMaxAge: Te(d.cacheControl?.sMaxAge, r),
61
+ staleWhileRevalidate: Te(
62
+ d.cacheControl?.staleWhileRevalidate,
63
63
  i
64
64
  ),
65
- scope: dt(u.cacheControl?.scope, a)
66
- }, o?.(s, c, u, d));
65
+ scope: St(d.cacheControl?.scope, a)
66
+ }, o?.(s, c, d, g));
67
67
  }
68
68
  return n;
69
69
  }
70
70
  })
71
- }, pt = (e) => (n, t) => {
72
- const r = sn([
71
+ }, It = (e) => (n, t) => {
72
+ const r = dn([
73
73
  ...(e ?? []).map(({ typeDefs: i }) => i),
74
74
  t
75
75
  ]);
76
76
  return (e ?? []).reduce(
77
77
  (i, { transformer: a }) => a?.(i) ?? i,
78
- xn({
78
+ Yn({
79
79
  typeDefs: r,
80
80
  resolvers: n
81
81
  })
82
82
  );
83
- }, un = "@faststore/api", pn = "4.9.1", Te = {
84
- name: un,
85
- version: pn
86
- }, gt = Xn("@faststore/api"), mt = (e, n = "Unknown Graphql Resolver") => (t, r, i, a) => {
83
+ }, mn = "@faststore/api", hn = "4.9.3-dev.0", Fe = {
84
+ name: mn,
85
+ version: hn
86
+ }, fn = nt("@faststore/api"), vt = (e, n = "Unknown Graphql Resolver") => (t, r, i, a) => {
87
87
  if (!i?.OTEL_ENABLED)
88
88
  return e(t, r, i, a);
89
- const o = V.trace.getTracer("Graphql").startSpan(n, {
90
- kind: V.SpanKind.INTERNAL,
89
+ const o = x.trace.getTracer("Graphql").startSpan(n, {
90
+ kind: x.SpanKind.INTERNAL,
91
91
  attributes: {
92
92
  timestamp: Date.now(),
93
- "@faststore_version": pn,
94
- "@faststore_package_name": un,
93
+ "@faststore_version": hn,
94
+ "@faststore_package_name": mn,
95
95
  "@faststore_account_name": i.account,
96
96
  "@faststore_environment": process.env.NODE_ENV,
97
97
  "@faststore_resolver_parent_type": a?.parentType?.name,
98
98
  "@faststore_resolver_field_name": a?.fieldName
99
99
  }
100
- }), s = V.trace.setSpan(V.context.active(), o);
100
+ }), s = x.trace.setSpan(x.context.active(), o);
101
101
  try {
102
- const c = V.context.with(
102
+ const c = x.context.with(
103
103
  s,
104
104
  () => e(t, r, i, a)
105
105
  );
106
106
  return c instanceof Promise ? c.then(
107
- (u) => (o.end(), u),
108
- (u) => Re(u, o, n)
107
+ (d) => (o.end(), d),
108
+ (d) => Ne(d, o, n)
109
109
  ) : (o.end(), c);
110
110
  } catch (c) {
111
- return Re(c, o, n);
111
+ return Ne(c, o, n);
112
112
  }
113
113
  };
114
- function Re(e, n, t) {
115
- throw n.setStatus({ code: V.SpanStatusCode.ERROR }), n.recordException(e), n.end(), console.error(`Error at resolver: ${t}:
116
- %o`, e), gt("error", `Error at resolver: %s
114
+ function Ne(e, n, t) {
115
+ throw n.setStatus({ code: x.SpanStatusCode.ERROR }), n.recordException(e), n.end(), console.error(`Error at resolver: ${t}:
116
+ %o`, e), fn("error", `Error at resolver: %s
117
117
  %o`, t, e), e;
118
118
  }
119
- class ee extends Error {
119
+ class X extends Error {
120
120
  constructor(n, t) {
121
121
  super(t), this.extensions = n, this.name = "FastStoreError";
122
122
  }
123
123
  }
124
- class k extends ee {
124
+ class k extends X {
125
125
  constructor(n) {
126
126
  super({ status: 400, type: "BadRequestError" }, n);
127
127
  }
128
128
  }
129
- class ie extends ee {
129
+ class ce extends X {
130
130
  constructor(n) {
131
131
  super({ status: 401, type: "UnauthorizedError" }, n);
132
132
  }
133
133
  }
134
- class K extends ee {
134
+ class ne extends X {
135
135
  constructor(n) {
136
136
  super({ status: 403, type: "ForbiddenError" }, n);
137
137
  }
138
138
  }
139
- class $ extends ee {
139
+ class z extends X {
140
140
  constructor(n) {
141
141
  super({ status: 404, type: "NotFoundError" }, n);
142
142
  }
143
143
  }
144
- const fo = (e) => e?.name === "FastStoreError", So = (e) => e?.extensions?.type === "BadRequestError", yo = (e) => e?.extensions?.type === "UnauthorizedError", ht = (e) => e?.extensions?.type === "ForbiddenError", J = (e) => e?.extensions?.type === "NotFoundError", ft = `${Te.name}@${Te.version}`, y = async (e, n, t) => {
145
- const r = await Yn(e, {
144
+ const ko = (e) => e?.name === "FastStoreError", _o = (e) => e?.extensions?.type === "BadRequestError", Uo = (e) => e?.extensions?.type === "UnauthorizedError", Ot = (e) => e?.extensions?.type === "ForbiddenError", ee = (e) => e?.extensions?.type === "NotFoundError", Ct = `${Fe.name}@${Fe.version}`, y = async (e, n, t) => {
145
+ const r = await tt(e, {
146
146
  ...n,
147
147
  headers: {
148
148
  ...n?.headers ?? {},
149
- "User-Agent": ft
149
+ "User-Agent": Ct
150
150
  }
151
151
  });
152
152
  if (r.ok)
@@ -158,19 +158,19 @@ const fo = (e) => e?.name === "FastStoreError", So = (e) => e?.extensions?.type
158
158
  case 400:
159
159
  throw new k(i);
160
160
  case 401:
161
- throw new ie(i);
161
+ throw new ce(i);
162
162
  case 403:
163
- throw new K(i);
163
+ throw new ne(i);
164
164
  case 404:
165
- throw new $(i);
165
+ throw new z(i);
166
166
  default:
167
- throw new ee(
167
+ throw new X(
168
168
  { status: r.status, type: "UnknownError" },
169
169
  i
170
170
  );
171
171
  }
172
172
  throw new Error(i);
173
- }, St = ({ account: e, environment: n }) => {
173
+ }, bt = ({ account: e, environment: n }) => {
174
174
  const t = `https://${e}.${n}.com.br`;
175
175
  return {
176
176
  getLocalizedProduct: (r, i) => y(`${t}/api/catalog-dataplane/product/${r}`, {
@@ -181,7 +181,7 @@ const fo = (e) => e?.name === "FastStoreError", So = (e) => e?.extensions?.type
181
181
  }
182
182
  })
183
183
  };
184
- }, gn = (e) => {
184
+ }, Sn = (e) => {
185
185
  if (!e)
186
186
  return e;
187
187
  const n = /* @__PURE__ */ new Map(), t = e.split(";"), r = [];
@@ -195,8 +195,8 @@ const fo = (e) => e?.name === "FastStoreError", So = (e) => e?.extensions?.type
195
195
  }
196
196
  }
197
197
  }), r.map((i) => `${i}=${n.get(i)}`).join("; ");
198
- }, yt = /^([^=]+)=([^;]*)/, It = (e, n) => {
199
- const t = n.match(yt);
198
+ }, wt = /^([^=]+)=([^;]*)/, At = (e, n) => {
199
+ const t = n.match(wt);
200
200
  if (t) {
201
201
  const r = t[1], i = t[2];
202
202
  e.storage.cookies.set(r, {
@@ -204,39 +204,39 @@ const fo = (e) => e?.name === "FastStoreError", So = (e) => e?.extensions?.type
204
204
  setCookie: n
205
205
  });
206
206
  }
207
- }, vt = (e, n) => {
207
+ }, Dt = (e, n) => {
208
208
  n.getSetCookie().forEach(
209
- (t) => It(e, t)
209
+ (t) => At(e, t)
210
210
  );
211
- }, Ot = (e) => (n) => vt(e, n), me = (e) => {
211
+ }, Pt = (e) => (n) => Dt(e, n), ye = (e) => {
212
212
  if (!e.headers?.cookie)
213
213
  return null;
214
- const n = gn(e.headers.cookie), t = Array.from(e.storage.cookies.entries());
214
+ const n = Sn(e.headers.cookie), t = Array.from(e.storage.cookies.entries());
215
215
  return t.length === 0 ? n : t.reduce(
216
- (r, [i, { value: a }]) => bt(
216
+ (r, [i, { value: a }]) => Et(
217
217
  r,
218
218
  i,
219
219
  a
220
220
  ),
221
221
  n
222
222
  );
223
- }, mn = (e) => function(t) {
224
- const r = me(e);
223
+ }, yn = (e) => function(t) {
224
+ const r = ye(e);
225
225
  return r ? {
226
226
  ...t,
227
227
  cookie: r
228
228
  } : t;
229
- }, L = (e, n) => {
230
- const t = gn(e);
231
- return Z(t)[`VtexIdclientAutCookie_${n}`] || "";
232
- }, bt = (e, n, t) => {
229
+ }, $ = (e, n) => {
230
+ const t = Sn(e);
231
+ return re(t)[`VtexIdclientAutCookie_${n}`] || "";
232
+ }, Et = (e, n, t) => {
233
233
  const r = new RegExp(`(${n})=([^;]*)`), i = e.match(r);
234
234
  return i ? e.replace(
235
235
  i[0],
236
236
  `${i[1]}=${t}`
237
237
  ) : `${e};${n}=${t}`;
238
238
  };
239
- function x(e) {
239
+ function j(e) {
240
240
  if (!e)
241
241
  return null;
242
242
  try {
@@ -245,12 +245,12 @@ function x(e) {
245
245
  return null;
246
246
  }
247
247
  }
248
- const Ct = "storefront/faststore.recommendation-shelf@v4", H = {
248
+ const kt = "storefront/faststore.recommendation-shelf@v4", K = {
249
249
  method: "POST",
250
250
  headers: {
251
251
  "content-type": "application/json"
252
252
  }
253
- }, wt = (e) => e.split("/").map(encodeURIComponent).join("/"), pe = (e) => e ? { headers: { "Accept-Language": e } } : void 0, At = /^\d{4}-\d{2}-\d{2}$/, Dt = /* @__PURE__ */ new Set([
253
+ }, _t = (e) => e.split("/").map(encodeURIComponent).join("/"), fe = (e) => e ? { headers: { "Accept-Language": e } } : void 0, Ut = /^\d{4}-\d{2}-\d{2}$/, Rt = /* @__PURE__ */ new Set([
254
254
  "Draft",
255
255
  "Requested",
256
256
  "InReview",
@@ -261,7 +261,7 @@ const Ct = "storefront/faststore.recommendation-shelf@v4", H = {
261
261
  "ConvertedToCart",
262
262
  "ConvertedToOrder"
263
263
  ]);
264
- function Pt({
264
+ function Tt({
265
265
  page: e,
266
266
  perPage: n,
267
267
  status: t,
@@ -284,19 +284,19 @@ function Pt({
284
284
  ["expiresAtFrom", a],
285
285
  ["expiresAtTo", o]
286
286
  ])
287
- if (c && !At.test(c))
287
+ if (c && !Ut.test(c))
288
288
  throw new Error(
289
289
  `listUserQuotes: invalid ${s} "${c}" — must be YYYY-MM-DD`
290
290
  );
291
291
  if (t && t.length > 0) {
292
- const s = t.filter((c) => !Dt.has(c));
292
+ const s = t.filter((c) => !Rt.has(c));
293
293
  if (s.length > 0)
294
294
  throw new Error(
295
295
  `listUserQuotes: invalid status values: ${s.join(", ")}`
296
296
  );
297
297
  }
298
298
  }
299
- function Et({
299
+ function Ft({
300
300
  page: e,
301
301
  perPage: n,
302
302
  status: t,
@@ -307,19 +307,19 @@ function Et({
307
307
  label: s
308
308
  }) {
309
309
  const c = new URLSearchParams();
310
- return e && c.append("pageNumber", e.toString()), n && c.append("pageSize", n.toString()), t?.forEach((u) => c.append("status", u)), r && c.append("createdAtFrom", r), i && c.append("createdAtTo", i), a && c.append("expiresAtFrom", a), o && c.append("expiresAtTo", o), s?.trim() && c.append("label", s.trim()), c;
310
+ return e && c.append("pageNumber", e.toString()), n && c.append("pageSize", n.toString()), t?.forEach((d) => c.append("status", d)), r && c.append("createdAtFrom", r), i && c.append("createdAtTo", i), a && c.append("expiresAtFrom", a), o && c.append("expiresAtTo", o), s?.trim() && c.append("label", s.trim()), c;
311
311
  }
312
- const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix: r }, i) => {
313
- const a = `https://${e}.${n}.com.br`, o = Ot(i), s = mn(i), c = at(), u = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", d = r && r.map((l) => l + ".").find((l) => u.includes(l)) || "", g = u.replace(d, ""), f = `${a}/api/recommend-bff/v2`, h = s({
312
+ const Nt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix: r }, i) => {
313
+ const a = `https://${e}.${n}.com.br`, o = Pt(i), s = yn(i), c = pt(), d = new Headers(i.headers).get("x-forwarded-host") ?? i.headers?.host ?? "", g = r && r.map((l) => l + ".").find((l) => d.includes(l)) || "", p = d.replace(g, ""), f = `${a}/api/recommend-bff/v2`, h = s({
314
314
  accept: "application/json",
315
315
  "content-type": "application/json",
316
- "x-vtex-rec-origin": `${e}/${Ct}`
316
+ "x-vtex-rec-origin": `${e}/${kt}`
317
317
  }), v = (l = {}) => {
318
- const p = L(me(i) ?? "", e);
318
+ const u = $(ye(i) ?? "", e);
319
319
  return s({
320
320
  ...l,
321
- "X-FORWARDED-HOST": g,
322
- ...p ? { [`VtexIdclientAutCookie_${e}`]: p } : {}
321
+ "X-FORWARDED-HOST": p,
322
+ ...u ? { [`VtexIdclientAutCookie_${e}`]: u } : {}
323
323
  });
324
324
  };
325
325
  return {
@@ -352,36 +352,36 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
352
352
  // The by-linkid endpoints resolve a slug to a single catalog entity
353
353
  // (or 404 when there is no match). We surface a 404 as `null` so the
354
354
  // loader can cascade category → brand → collection.
355
- category: async (l, p) => {
355
+ category: async (l, u) => {
356
356
  try {
357
357
  return await y(
358
- `${a}/api/catalog_system/pub/category/by-linkid/${wt(l)}`,
359
- pe(p)
358
+ `${a}/api/catalog_system/pub/category/by-linkid/${_t(l)}`,
359
+ fe(u)
360
360
  );
361
361
  } catch (m) {
362
- if (J(m)) return null;
362
+ if (ee(m)) return null;
363
363
  throw m;
364
364
  }
365
365
  },
366
- brand: async (l, p) => {
366
+ brand: async (l, u) => {
367
367
  try {
368
368
  return await y(
369
369
  `${a}/api/catalog_system/pub/brand/by-linkid/${encodeURIComponent(l)}`,
370
- pe(p)
370
+ fe(u)
371
371
  );
372
372
  } catch (m) {
373
- if (J(m)) return null;
373
+ if (ee(m)) return null;
374
374
  throw m;
375
375
  }
376
376
  },
377
- collection: async (l, p) => {
377
+ collection: async (l, u) => {
378
378
  try {
379
379
  return await y(
380
380
  `${a}/api/catalog_system/pub/collection/by-linkid/${encodeURIComponent(l)}`,
381
- pe(p)
381
+ fe(u)
382
382
  );
383
383
  } catch (m) {
384
- if (J(m)) return null;
384
+ if (ee(m)) return null;
385
385
  throw m;
386
386
  }
387
387
  }
@@ -389,7 +389,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
389
389
  products: {
390
390
  crossselling: ({
391
391
  type: l,
392
- productId: p,
392
+ productId: u,
393
393
  groupByProduct: m = !0
394
394
  }) => {
395
395
  const S = new URLSearchParams({
@@ -397,7 +397,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
397
397
  groupByProduct: m.toString()
398
398
  });
399
399
  return y(
400
- `${a}/api/catalog_system/pub/products/crossselling/${l}/${p}?${S}`,
400
+ `${a}/api/catalog_system/pub/products/crossselling/${l}/${u}?${S}`,
401
401
  void 0,
402
402
  { storeCookies: o }
403
403
  );
@@ -405,17 +405,17 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
405
405
  }
406
406
  },
407
407
  checkout: {
408
- simulation: (l, { salesChannel: p } = i.storage.channel) => {
408
+ simulation: (l, { salesChannel: u } = i.storage.channel) => {
409
409
  const m = new URLSearchParams({
410
- sc: p
410
+ sc: u
411
411
  }), S = s({
412
412
  "content-type": "application/json",
413
- "X-FORWARDED-HOST": g
413
+ "X-FORWARDED-HOST": p
414
414
  });
415
415
  return y(
416
416
  `${a}/api/checkout/pub/orderForms/simulation?${m.toString()}`,
417
417
  {
418
- ...H,
418
+ ...K,
419
419
  headers: S,
420
420
  body: JSON.stringify(l)
421
421
  },
@@ -424,30 +424,30 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
424
424
  },
425
425
  shippingData: ({
426
426
  id: l,
427
- index: p,
427
+ index: u,
428
428
  deliveryMode: m,
429
429
  selectedAddresses: S
430
430
  }, O) => {
431
- const w = O ? {
431
+ const b = O ? {
432
432
  startDateUtc: m?.deliveryWindow?.startDate,
433
433
  endDateUtc: m?.deliveryWindow?.endDate
434
434
  } : null, C = {
435
- logisticsInfo: Array.from({ length: p }, (I, A) => ({
436
- itemIndex: A,
435
+ logisticsInfo: Array.from({ length: u }, (I, w) => ({
436
+ itemIndex: w,
437
437
  selectedDeliveryChannel: m?.deliveryChannel || null,
438
438
  selectedSla: m?.deliveryMethod || null,
439
- deliveryWindow: w
439
+ deliveryWindow: b
440
440
  })),
441
441
  selectedAddresses: S,
442
442
  clearAddressIfPostalCodeNotFound: t
443
443
  }, _ = s({
444
444
  "content-type": "application/json",
445
- "X-FORWARDED-HOST": g
445
+ "X-FORWARDED-HOST": p
446
446
  });
447
447
  return y(
448
448
  `${a}/api/checkout/pub/orderForm/${l}/attachments/shippingData`,
449
449
  {
450
- ...H,
450
+ ...K,
451
451
  headers: _,
452
452
  body: JSON.stringify(C)
453
453
  },
@@ -456,17 +456,17 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
456
456
  },
457
457
  marketingData: ({
458
458
  id: l,
459
- marketingData: p
459
+ marketingData: u
460
460
  }) => {
461
461
  const m = s({
462
462
  "content-type": "application/json",
463
- "X-FORWARDED-HOST": g
463
+ "X-FORWARDED-HOST": p
464
464
  });
465
465
  return y(
466
466
  `${a}/api/checkout/pub/orderForm/${l}/attachments/marketingData`,
467
467
  {
468
468
  headers: m,
469
- body: JSON.stringify(p),
469
+ body: JSON.stringify(u),
470
470
  method: "POST"
471
471
  },
472
472
  { storeCookies: o }
@@ -474,17 +474,17 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
474
474
  },
475
475
  clientPreferencesData: ({
476
476
  id: l,
477
- clientPreferencesData: p
477
+ clientPreferencesData: u
478
478
  }) => {
479
479
  const m = s({
480
480
  "content-type": "application/json",
481
- "X-FORWARDED-HOST": g
481
+ "X-FORWARDED-HOST": p
482
482
  });
483
483
  return y(
484
484
  `${a}/api/checkout/pub/orderForm/${l}/attachments/clientPreferencesData`,
485
485
  {
486
486
  headers: m,
487
- body: JSON.stringify(p),
487
+ body: JSON.stringify(u),
488
488
  method: "POST"
489
489
  },
490
490
  { storeCookies: o }
@@ -492,60 +492,60 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
492
492
  },
493
493
  orderForm: ({
494
494
  id: l,
495
- refreshOutdatedData: p = !0,
495
+ refreshOutdatedData: u = !0,
496
496
  channel: m = i.storage.channel,
497
497
  preserveSalesChannel: S = !1
498
498
  }) => {
499
- const { salesChannel: O } = m, w = s({
499
+ const { salesChannel: O } = m, b = s({
500
500
  "content-type": "application/json",
501
- "X-FORWARDED-HOST": g
501
+ "X-FORWARDED-HOST": p
502
502
  }), C = new URLSearchParams();
503
- (!S || !l) && C.set("sc", O), l && C.set("refreshOutdatedData", p.toString());
503
+ (!S || !l) && C.set("sc", O), l && C.set("refreshOutdatedData", u.toString());
504
504
  const _ = l ? `/${l}` : "", I = `${a}/api/checkout/pub/orderForm${_}?${C}`;
505
505
  return y(
506
506
  I,
507
507
  {
508
- ...H,
509
- headers: w,
508
+ ...K,
509
+ headers: b,
510
510
  ...l ? {} : { body: "{}" }
511
511
  },
512
512
  { storeCookies: o }
513
513
  );
514
514
  },
515
515
  clearOrderFormMessages: ({ id: l }) => {
516
- const p = s({
516
+ const u = s({
517
517
  "content-type": "application/json",
518
- "X-FORWARDED-HOST": g
518
+ "X-FORWARDED-HOST": p
519
519
  });
520
520
  return y(
521
521
  `${a}/api/checkout/pub/orderForm/${l}/messages/clear`,
522
522
  {
523
- ...H,
524
- headers: p,
523
+ ...K,
524
+ headers: u,
525
525
  body: "{}"
526
526
  }
527
527
  );
528
528
  },
529
529
  updateOrderFormItems: ({
530
530
  id: l,
531
- orderItems: p,
531
+ orderItems: u,
532
532
  allowOutdatedData: m = "paymentData",
533
533
  salesChannel: S = i.storage.channel.salesChannel,
534
534
  shouldSplitItem: O = !0
535
535
  }) => {
536
- const w = new URLSearchParams({
536
+ const b = new URLSearchParams({
537
537
  allowOutdatedData: m,
538
538
  sc: S
539
539
  }), C = s({
540
540
  "content-type": "application/json",
541
- "X-FORWARDED-HOST": g
541
+ "X-FORWARDED-HOST": p
542
542
  });
543
543
  return y(
544
- `${a}/api/checkout/pub/orderForm/${l}/items?${w}`,
544
+ `${a}/api/checkout/pub/orderForm/${l}/items?${b}`,
545
545
  {
546
546
  headers: C,
547
547
  body: JSON.stringify({
548
- orderItems: p,
548
+ orderItems: u,
549
549
  noSplitItem: !O
550
550
  }),
551
551
  method: "PATCH"
@@ -555,16 +555,16 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
555
555
  },
556
556
  setCustomData: ({
557
557
  id: l,
558
- appId: p,
558
+ appId: u,
559
559
  key: m,
560
560
  value: S
561
561
  }) => {
562
562
  const O = s({
563
563
  "content-type": "application/json",
564
- "X-FORWARDED-HOST": g
564
+ "X-FORWARDED-HOST": p
565
565
  });
566
566
  return y(
567
- `${a}/api/checkout/pub/orderForm/${l}/customData/${p}/${m}`,
567
+ `${a}/api/checkout/pub/orderForm/${l}/customData/${u}/${m}`,
568
568
  {
569
569
  headers: O,
570
570
  body: JSON.stringify({ value: S }),
@@ -574,7 +574,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
574
574
  },
575
575
  region: async ({
576
576
  postalCode: l,
577
- geoCoordinates: p,
577
+ geoCoordinates: u,
578
578
  country: m,
579
579
  salesChannel: S
580
580
  }) => {
@@ -584,14 +584,14 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
584
584
  });
585
585
  l ? O.append("postalCode", l) : O.append(
586
586
  "geoCoordinates",
587
- `${p?.longitude};${p?.latitude}`
587
+ `${u?.longitude};${u?.latitude}`
588
588
  );
589
- const w = `${a}/api/checkout/pub/regions/?${O.toString()}`, C = s({
589
+ const b = `${a}/api/checkout/pub/regions/?${O.toString()}`, C = s({
590
590
  "content-type": "application/json",
591
- "X-FORWARDED-HOST": g
591
+ "X-FORWARDED-HOST": p
592
592
  });
593
593
  return y(
594
- w,
594
+ b,
595
595
  {
596
596
  headers: C
597
597
  },
@@ -600,14 +600,14 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
600
600
  },
601
601
  address: async ({
602
602
  postalCode: l,
603
- country: p
603
+ country: u
604
604
  }) => {
605
605
  const m = s({
606
606
  "content-type": "application/json",
607
- "X-FORWARDED-HOST": g
607
+ "X-FORWARDED-HOST": p
608
608
  });
609
609
  return y(
610
- `${a}/api/checkout/pub/postal-code/${p}/${l}`,
610
+ `${a}/api/checkout/pub/postal-code/${u}/${l}`,
611
611
  {
612
612
  headers: m
613
613
  },
@@ -616,12 +616,12 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
616
616
  },
617
617
  cancelOrder: ({
618
618
  orderId: l,
619
- customerEmail: p,
619
+ customerEmail: u,
620
620
  reason: m
621
621
  }) => {
622
622
  const S = s({
623
623
  "content-type": "application/json",
624
- "X-FORWARDED-HOST": g
624
+ "X-FORWARDED-HOST": p
625
625
  });
626
626
  return y(
627
627
  `${a}/api/checkout/pub/orders/${l}/user-cancel-request`,
@@ -629,7 +629,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
629
629
  method: "POST",
630
630
  headers: S,
631
631
  body: JSON.stringify({
632
- customerEmail: p,
632
+ customerEmail: u,
633
633
  reason: m
634
634
  })
635
635
  },
@@ -643,15 +643,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
643
643
  throw new Error(
644
644
  "Missing required parameter for listing pickup points."
645
645
  );
646
- const p = s({
646
+ const u = s({
647
647
  "content-type": "application/json",
648
- "X-FORWARDED-HOST": g
648
+ "X-FORWARDED-HOST": p
649
649
  });
650
650
  return y(
651
651
  `${a}/api/logistics-shipping/pickuppoints/_search`,
652
652
  {
653
653
  method: "POST",
654
- headers: p,
654
+ headers: u,
655
655
  body: JSON.stringify({ coordinate: l })
656
656
  },
657
657
  { storeCookies: o }
@@ -659,16 +659,16 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
659
659
  }
660
660
  },
661
661
  session: (l) => {
662
- const p = new URLSearchParams(l);
663
- p.set(
662
+ const u = new URLSearchParams(l);
663
+ u.set(
664
664
  "items",
665
665
  "profile.id,profile.email,profile.firstName,profile.lastName,profile.phone,shopper.firstName,shopper.lastName,shopper.organizationManager,shopper.availableContracts,shopper.activeContractId,store.channel,store.countryCode,store.cultureInfo,store.currencyCode,store.currencySymbol,authentication.customerId,authentication.storeUserId,authentication.storeUserEmail,authentication.unitId,authentication.unitName,checkout.regionId,public.postalCode"
666
666
  );
667
667
  const m = s({
668
668
  "content-type": "application/json"
669
- }), S = Z(i?.headers?.cookie ?? "")?.vtex_session;
669
+ }), S = re(i?.headers?.cookie ?? "")?.vtex_session;
670
670
  return y(
671
- `${a}/api/sessions?${p.toString()}`,
671
+ `${a}/api/sessions?${u.toString()}`,
672
672
  {
673
673
  method: S ? "PATCH" : "POST",
674
674
  headers: m,
@@ -684,14 +684,14 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
684
684
  * no app keys involved.
685
685
  */
686
686
  attachedContracts: (l) => {
687
- const p = s({
687
+ const u = s({
688
688
  "content-type": "application/json"
689
689
  });
690
690
  return y(
691
691
  `https://${e}.myvtex.com/_v/store-front/units/${encodeURIComponent(
692
692
  l
693
693
  )}/contracts/attached?details=true`,
694
- { headers: p },
694
+ { headers: u },
695
695
  { storeCookies: o }
696
696
  );
697
697
  }
@@ -699,7 +699,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
699
699
  subscribeToNewsletter: (l) => y(
700
700
  `${a}/api/dataentities/NL/documents/`,
701
701
  {
702
- ...H,
702
+ ...K,
703
703
  body: JSON.stringify({ ...l, isNewsletterOptIn: !0 }),
704
704
  method: "PATCH"
705
705
  },
@@ -707,74 +707,74 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
707
707
  ),
708
708
  profile: {
709
709
  addresses: async (l) => {
710
- const p = s({
710
+ const u = s({
711
711
  "content-type": "application/json",
712
- "X-FORWARDED-HOST": g
712
+ "X-FORWARDED-HOST": p
713
713
  });
714
714
  return y(
715
715
  `${a}/api/profile-system/pvt/profiles/${l}/addresses`,
716
- { headers: p },
716
+ { headers: u },
717
717
  { storeCookies: o }
718
718
  );
719
719
  }
720
720
  },
721
721
  oms: {
722
722
  userOrder: ({ orderId: l }) => {
723
- const p = s({
723
+ const u = s({
724
724
  "content-type": "application/json",
725
- "X-FORWARDED-HOST": g
725
+ "X-FORWARDED-HOST": p
726
726
  });
727
727
  return y(
728
728
  `${a}/api/oms/user/orders/${l}`,
729
729
  {
730
730
  method: "GET",
731
- headers: p
731
+ headers: u
732
732
  },
733
733
  { storeCookies: o }
734
734
  );
735
735
  },
736
736
  listUserOrders: ({
737
737
  page: l,
738
- status: p,
738
+ status: u,
739
739
  dateInitial: m,
740
740
  dateFinal: S,
741
741
  text: O,
742
- clientEmail: w,
742
+ clientEmail: b,
743
743
  perPage: C,
744
744
  pendingMyApproval: _
745
745
  }) => {
746
746
  const I = new URLSearchParams();
747
747
  if (m) {
748
- const D = new Date(m).setHours(
748
+ const E = new Date(m).setHours(
749
749
  0,
750
750
  0,
751
751
  0,
752
752
  0
753
753
  );
754
- m = new Date(D).toISOString();
754
+ m = new Date(E).toISOString();
755
755
  }
756
756
  if (S) {
757
- const D = new Date(S).setHours(
757
+ const E = new Date(S).setHours(
758
758
  23,
759
759
  59,
760
760
  59,
761
761
  999
762
762
  );
763
- S = new Date(D).toISOString();
763
+ S = new Date(E).toISOString();
764
764
  }
765
- O && I.append("text", O), p && p.length > 0 && I.append("status", p.filter(Boolean).join(",")), m && S ? I.append(
765
+ O && I.append("text", O), u && u.length > 0 && I.append("status", u.filter(Boolean).join(",")), m && S ? I.append(
766
766
  "creation_date",
767
767
  `creationDate:[${m} TO ${S}]`
768
- ) : m ? I.append("creation_date", `creationDate:[${m} TO *]`) : S && I.append("creation_date", `creationDate:[* TO ${S}]`), w && I.append("clientEmail", w), l && I.append("page", l.toString()), C && I.append("per_page", C.toString()), _ && I.append("my_pending_approvals", String(!0));
769
- const A = s({
768
+ ) : m ? I.append("creation_date", `creationDate:[${m} TO *]`) : S && I.append("creation_date", `creationDate:[* TO ${S}]`), b && I.append("clientEmail", b), l && I.append("page", l.toString()), C && I.append("per_page", C.toString()), _ && I.append("my_pending_approvals", String(!0));
769
+ const w = s({
770
770
  "content-type": "application/json",
771
- "X-FORWARDED-HOST": g
771
+ "X-FORWARDED-HOST": p
772
772
  });
773
773
  return y(
774
774
  `${a}/api/oms/user/orders?${I.toString()}`,
775
775
  {
776
776
  method: "GET",
777
- headers: A
777
+ headers: w
778
778
  },
779
779
  { storeCookies: o }
780
780
  );
@@ -782,32 +782,32 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
782
782
  getCommercialAuthorizationsByOrderId: ({
783
783
  orderId: l
784
784
  }) => {
785
- const p = s({
785
+ const u = s({
786
786
  "content-type": "application/json",
787
- "X-FORWARDED-HOST": g
787
+ "X-FORWARDED-HOST": p
788
788
  });
789
789
  return y(
790
790
  `${a}/${e}/commercial-authorizations/order/${l}`,
791
791
  {
792
792
  method: "GET",
793
- headers: p
793
+ headers: u
794
794
  },
795
795
  { storeCookies: o }
796
796
  );
797
797
  },
798
798
  processOrderAuthorization: async ({
799
799
  orderAuthorizationId: l,
800
- dimensionId: p,
800
+ dimensionId: u,
801
801
  ruleId: m,
802
802
  approved: S
803
803
  }) => {
804
804
  const O = s({
805
805
  "content-type": "application/json",
806
- "X-FORWARDED-HOST": g
806
+ "X-FORWARDED-HOST": p
807
807
  }), _ = {
808
808
  params: {
809
809
  ruleId: m,
810
- dimensionId: p,
810
+ dimensionId: u,
811
811
  score: S ? 100 : 0
812
812
  }
813
813
  };
@@ -826,7 +826,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
826
826
  listCreditCards: () => {
827
827
  const l = s({
828
828
  "content-type": "application/json",
829
- "X-FORWARDED-HOST": g
829
+ "X-FORWARDED-HOST": p
830
830
  });
831
831
  return y(
832
832
  `${a}/api/saved-cards/credit-card?an=${e}`,
@@ -842,15 +842,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
842
842
  getUnitByUserId: ({
843
843
  userId: l
844
844
  }) => {
845
- const p = s({
845
+ const u = s({
846
846
  "content-type": "application/json",
847
- "X-FORWARDED-HOST": g
847
+ "X-FORWARDED-HOST": p
848
848
  });
849
849
  return y(
850
850
  `${a}/api/units/v1/${l}/unit`,
851
851
  {
852
852
  method: "GET",
853
- headers: p
853
+ headers: u
854
854
  },
855
855
  {}
856
856
  );
@@ -858,15 +858,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
858
858
  getOrgUnitById: ({
859
859
  orgUnitId: l
860
860
  }) => {
861
- const p = s({
861
+ const u = s({
862
862
  "content-type": "application/json",
863
- "X-FORWARDED-HOST": g
863
+ "X-FORWARDED-HOST": p
864
864
  });
865
865
  return y(
866
866
  `${a}/api/units/v1/${l}`,
867
867
  {
868
868
  method: "GET",
869
- headers: p
869
+ headers: u
870
870
  },
871
871
  {}
872
872
  );
@@ -874,15 +874,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
874
874
  getScopesByOrgUnit: ({
875
875
  orgUnitId: l
876
876
  }) => {
877
- const p = s({
877
+ const u = s({
878
878
  "content-type": "application/json",
879
- "X-FORWARDED-HOST": g
879
+ "X-FORWARDED-HOST": p
880
880
  });
881
881
  return y(
882
882
  `${a}/api/units/v1/${l}/scopes`,
883
883
  {
884
884
  method: "GET",
885
- headers: p
885
+ headers: u
886
886
  },
887
887
  {}
888
888
  );
@@ -892,15 +892,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
892
892
  getUserById: ({
893
893
  userId: l
894
894
  }) => {
895
- const p = s({
895
+ const u = s({
896
896
  "content-type": "application/json",
897
- "X-FORWARDED-HOST": g
897
+ "X-FORWARDED-HOST": p
898
898
  });
899
899
  return y(
900
900
  `${a}/api/license-manager/users/${l}`,
901
901
  {
902
902
  method: "GET",
903
- headers: p
903
+ headers: u
904
904
  },
905
905
  {}
906
906
  );
@@ -908,15 +908,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
908
908
  getUserByEmail: ({
909
909
  email: l
910
910
  }) => {
911
- const p = s({
911
+ const u = s({
912
912
  "content-type": "application/json",
913
- "X-FORWARDED-HOST": g
913
+ "X-FORWARDED-HOST": p
914
914
  });
915
915
  return y(
916
916
  `${a}/api/license-manager/pvt/users/${l}`,
917
917
  {
918
918
  method: "GET",
919
- headers: p
919
+ headers: u
920
920
  },
921
921
  {}
922
922
  );
@@ -924,15 +924,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
924
924
  getUserRoles: ({
925
925
  userId: l
926
926
  }) => {
927
- const p = s({
927
+ const u = s({
928
928
  "content-type": "application/json",
929
- "X-FORWARDED-HOST": g
929
+ "X-FORWARDED-HOST": p
930
930
  });
931
931
  return y(
932
932
  `${a}/api/license-manager/storefront/users/${l}/roles`,
933
933
  {
934
934
  method: "GET",
935
- headers: p
935
+ headers: u
936
936
  },
937
937
  {}
938
938
  );
@@ -945,14 +945,14 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
945
945
  */
946
946
  isResourceGranted: ({
947
947
  userId: l,
948
- resourceKey: p
948
+ resourceKey: u
949
949
  }) => {
950
950
  const m = s({
951
951
  "content-type": "application/json",
952
- "X-FORWARDED-HOST": g
952
+ "X-FORWARDED-HOST": p
953
953
  });
954
954
  return y(
955
- `${a}/api/license-manager/storefront/bff/users/${l}/resources/${p}/granted?an=${e}`,
955
+ `${a}/api/license-manager/storefront/bff/users/${l}/resources/${u}/granted?an=${e}`,
956
956
  {
957
957
  method: "GET",
958
958
  headers: m
@@ -967,7 +967,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
967
967
  }) => {
968
968
  if (!l)
969
969
  throw new k("Missing contractId to fetch CL fields.");
970
- const p = v({
970
+ const u = v({
971
971
  Accept: "application/json",
972
972
  "content-type": "application/json"
973
973
  });
@@ -975,7 +975,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
975
975
  `${a}/api/dataentities/CL/documents/${l}?_fields=_all`,
976
976
  {
977
977
  method: "GET",
978
- headers: p
978
+ headers: u
979
979
  },
980
980
  {}
981
981
  );
@@ -985,16 +985,16 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
985
985
  }) => {
986
986
  if (!l)
987
987
  throw new k("Missing userId to fetch shopper name.");
988
- const p = c({
988
+ const u = c({
989
989
  Accept: "application/json",
990
990
  "content-type": "application/json",
991
- "X-FORWARDED-HOST": g
991
+ "X-FORWARDED-HOST": p
992
992
  }), m = l.replace(/-/g, "");
993
993
  return y(
994
994
  `${a}/api/dataentities/shopper/search?_where=(userId=${m} OR userId=${l})&_fields=_all&_schema=v1`,
995
995
  {
996
996
  method: "GET",
997
- headers: p
997
+ headers: u
998
998
  },
999
999
  {}
1000
1000
  );
@@ -1002,13 +1002,13 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1002
1002
  },
1003
1003
  quotes: {
1004
1004
  listUserQuotes: (l) => {
1005
- Pt(l);
1006
- const p = Et(l), m = s({
1005
+ Tt(l);
1006
+ const u = Ft(l), m = s({
1007
1007
  "content-type": "application/json",
1008
- "X-FORWARDED-HOST": g
1008
+ "X-FORWARDED-HOST": p
1009
1009
  });
1010
1010
  return y(
1011
- `${a}/api/quoting/quotes?${p.toString()}`,
1011
+ `${a}/api/quoting/quotes?${u.toString()}`,
1012
1012
  {
1013
1013
  method: "GET",
1014
1014
  headers: m
@@ -1021,13 +1021,13 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1021
1021
  validate: () => {
1022
1022
  const l = s({
1023
1023
  "content-type": "application/json",
1024
- "X-FORWARDED-HOST": g
1025
- }), p = L(me(i) ?? "", e);
1024
+ "X-FORWARDED-HOST": p
1025
+ }), u = $(ye(i) ?? "", e);
1026
1026
  return y(
1027
1027
  `${a}/api/vtexid/credential/validate`,
1028
1028
  {
1029
1029
  headers: l,
1030
- body: JSON.stringify({ token: p }),
1030
+ body: JSON.stringify({ token: u }),
1031
1031
  method: "POST"
1032
1032
  },
1033
1033
  { storeCookies: o }
@@ -1037,24 +1037,24 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1037
1037
  orderEntry: {
1038
1038
  uploadFile: ({
1039
1039
  fileBuffer: l,
1040
- fileName: p,
1040
+ fileName: u,
1041
1041
  mimeType: m
1042
1042
  }) => {
1043
1043
  const S = s({
1044
1044
  "content-type": "application/json",
1045
- "X-FORWARDED-HOST": g
1046
- }), O = `----FastStoreUploadBoundary${Date.now()}`, w = `\r
1047
- `, _ = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(m) ? m : "application/octet-stream", I = p.replaceAll(/[\r\n"]/g, "_"), A = [
1045
+ "X-FORWARDED-HOST": p
1046
+ }), O = `----FastStoreUploadBoundary${Date.now()}`, b = `\r
1047
+ `, _ = /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-.^_+]*$/.test(m) ? m : "application/octet-stream", I = u.replaceAll(/[\r\n"]/g, "_"), w = [
1048
1048
  `--${O}`,
1049
1049
  `Content-Disposition: form-data; name="file"; filename="${I}"`,
1050
1050
  `Content-Type: ${_}`,
1051
1051
  "",
1052
1052
  ""
1053
- ].join(w), D = `${w}--${O}--${w}`, E = Buffer.from(A), P = Buffer.from(D), R = new Uint8Array(
1054
- E.byteLength + l.byteLength + P.byteLength
1053
+ ].join(b), E = `${b}--${O}--${b}`, D = Buffer.from(w), R = Buffer.from(E), P = new Uint8Array(
1054
+ D.byteLength + l.byteLength + R.byteLength
1055
1055
  );
1056
- let b = 0;
1057
- return R.set(E, b), b += E.byteLength, R.set(l, b), b += l.byteLength, R.set(P, b), y(
1056
+ let U = 0;
1057
+ return P.set(D, U), U += D.byteLength, P.set(l, U), U += l.byteLength, P.set(R, U), y(
1058
1058
  `${a}/api/order-entry/upload?an=${e}`,
1059
1059
  {
1060
1060
  method: "POST",
@@ -1062,22 +1062,22 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1062
1062
  ...S,
1063
1063
  "content-type": `multipart/form-data; boundary=${O}`
1064
1064
  },
1065
- body: R.buffer
1065
+ body: P.buffer
1066
1066
  },
1067
1067
  {}
1068
1068
  );
1069
1069
  },
1070
1070
  startOperation: ({
1071
1071
  objectKey: l,
1072
- orderFormId: p,
1072
+ orderFormId: u,
1073
1073
  sessionToken: m
1074
1074
  }) => {
1075
1075
  const S = s({
1076
1076
  "content-type": "application/json",
1077
- "X-FORWARDED-HOST": g
1077
+ "X-FORWARDED-HOST": p
1078
1078
  }), O = JSON.stringify({
1079
1079
  objectKey: l,
1080
- orderFormId: p,
1080
+ orderFormId: u,
1081
1081
  operation: "CreateCart",
1082
1082
  ...m ? { sessionToken: m } : {}
1083
1083
  });
@@ -1094,15 +1094,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1094
1094
  getOperation: ({
1095
1095
  operationId: l
1096
1096
  }) => {
1097
- const p = s({
1097
+ const u = s({
1098
1098
  "content-type": "application/json",
1099
- "X-FORWARDED-HOST": g
1099
+ "X-FORWARDED-HOST": p
1100
1100
  });
1101
1101
  return y(
1102
1102
  `${a}/api/order-entry/operation/${l}?an=${e}`,
1103
1103
  {
1104
1104
  method: "GET",
1105
- headers: p
1105
+ headers: u
1106
1106
  },
1107
1107
  {}
1108
1108
  );
@@ -1110,7 +1110,7 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1110
1110
  createOrderForm: () => {
1111
1111
  const l = s({
1112
1112
  "content-type": "application/json",
1113
- "X-FORWARDED-HOST": g
1113
+ "X-FORWARDED-HOST": p
1114
1114
  });
1115
1115
  return y(
1116
1116
  `${a}/api/checkout/pub/orderForm?sc=${i.storage.channel.salesChannel}`,
@@ -1125,15 +1125,15 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1125
1125
  getOrderFormItems: ({
1126
1126
  orderFormId: l
1127
1127
  }) => {
1128
- const p = s({
1128
+ const u = s({
1129
1129
  "content-type": "application/json",
1130
- "X-FORWARDED-HOST": g
1130
+ "X-FORWARDED-HOST": p
1131
1131
  });
1132
1132
  return y(
1133
1133
  `${a}/api/checkout/pub/orderForm/${l}`,
1134
1134
  {
1135
1135
  method: "GET",
1136
- headers: p
1136
+ headers: u
1137
1137
  },
1138
1138
  {}
1139
1139
  );
@@ -1146,14 +1146,14 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1146
1146
  recommendation: {
1147
1147
  recommendations: ({
1148
1148
  campaignVrn: l,
1149
- userId: p,
1149
+ userId: u,
1150
1150
  products: m = [],
1151
1151
  salesChannel: S,
1152
1152
  locale: O
1153
1153
  }) => {
1154
- const w = new URLSearchParams({ an: e, campaignVrn: l });
1155
- return p && w.append("userId", p), m.length > 0 && w.append("products", m.join(",")), S && w.append("salesChannel", S), O && w.append("locale", O), y(
1156
- `${f}/recommendations?${w.toString()}`,
1154
+ const b = new URLSearchParams({ an: e, campaignVrn: l });
1155
+ return u && b.append("userId", u), m.length > 0 && b.append("products", m.join(",")), S && b.append("salesChannel", S), O && b.append("locale", O), y(
1156
+ `${f}/recommendations?${b.toString()}`,
1157
1157
  { headers: h },
1158
1158
  { storeCookies: o }
1159
1159
  );
@@ -1168,27 +1168,27 @@ const kt = ({ account: e, environment: n, incrementAddress: t, subDomainPrefix:
1168
1168
  }
1169
1169
  }
1170
1170
  };
1171
- }, Q = (e) => e.discoveryConfig?.localization ?? {}, j = (e) => Q(e).enabled === !0, _t = (e) => Object.keys(Q(e).locales ?? {}), Ut = (e) => Q(e).defaultLocale, hn = (e) => j(e) && e.storage.locale || void 0, he = "fuzzy", fe = "operator", Se = "pickupPoint", Fe = "shipping", Ne = "delivery-options", Tt = "in-stock", Rt = "trade-policy", Ft = "region-id", Nt = /* @__PURE__ */ new Set([
1172
- Rt,
1173
- Ft,
1174
- he,
1175
- fe,
1176
- Se
1177
- ]), Lt = /* @__PURE__ */ new Set([
1171
+ }, te = (e) => e.discoveryConfig?.localization ?? {}, G = (e) => te(e).enabled === !0, Lt = (e) => Object.keys(te(e).locales ?? {}), Bt = (e) => te(e).defaultLocale, In = (e) => G(e) && e.storage.locale || void 0, Ie = "fuzzy", ve = "operator", Oe = "pickupPoint", Le = "shipping", Be = "delivery-options", $t = "in-stock", Mt = "trade-policy", zt = "region-id", Vt = /* @__PURE__ */ new Set([
1172
+ Mt,
1173
+ zt,
1174
+ Ie,
1175
+ ve,
1176
+ Oe
1177
+ ]), qt = /* @__PURE__ */ new Set([
1178
1178
  "zip-code",
1179
1179
  "pickupPoint",
1180
1180
  "country",
1181
1181
  "coordinates",
1182
1182
  "deliveryZonesHash",
1183
1183
  "pickupPointsHash"
1184
- ]), Le = (e) => encodeURI(decodeURI(e)), Bt = (e) => encodeURIComponent(
1184
+ ]), $e = (e) => encodeURI(decodeURI(e)), xt = (e) => encodeURIComponent(
1185
1185
  decodeURIComponent(e).normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "")
1186
- ), $t = /^pickup-in-point-(.+)$/;
1187
- function fn(e) {
1186
+ ), jt = /^pickup-in-point-(.+)$/;
1187
+ function vn(e) {
1188
1188
  if (!e)
1189
1189
  return {};
1190
1190
  try {
1191
- const t = Z(e).vtex_segment;
1191
+ const t = re(e).vtex_segment;
1192
1192
  if (!t)
1193
1193
  return {};
1194
1194
  const r = Buffer.from(t, "base64").toString("utf-8");
@@ -1197,18 +1197,18 @@ function fn(e) {
1197
1197
  return {};
1198
1198
  }
1199
1199
  }
1200
- function Mt(e) {
1200
+ function Wt(e) {
1201
1201
  const n = {}, t = [];
1202
1202
  for (const r of e.split(";")) {
1203
1203
  const i = r.indexOf("=");
1204
1204
  if (i < 0) continue;
1205
1205
  const a = r.slice(0, i), o = r.slice(i + 1);
1206
- !a || !o || (Lt.has(a) ? n[a] = o : t.push({ key: a, value: o }));
1206
+ !a || !o || (qt.has(a) ? n[a] = o : t.push({ key: a, value: o }));
1207
1207
  }
1208
1208
  return { shipping: n, extraFacets: t };
1209
1209
  }
1210
- function zt(e) {
1211
- const n = typeof e.facets == "string" ? e.facets : "", { shipping: t, extraFacets: r } = Mt(n);
1210
+ function Gt(e) {
1211
+ const n = typeof e.facets == "string" ? e.facets : "", { shipping: t, extraFacets: r } = Wt(n);
1212
1212
  return {
1213
1213
  segmentParams: {
1214
1214
  sc: e.channel,
@@ -1229,7 +1229,7 @@ function zt(e) {
1229
1229
  extraFacets: r
1230
1230
  };
1231
1231
  }
1232
- function Sn(e, n) {
1232
+ function On(e, n) {
1233
1233
  const t = [
1234
1234
  ["sc", n.sc],
1235
1235
  ["regionId", n.regionId],
@@ -1249,11 +1249,11 @@ function Sn(e, n) {
1249
1249
  for (const [r, i] of t)
1250
1250
  i != null && i !== "" && e.append(r, String(i));
1251
1251
  }
1252
- function yn(e) {
1253
- return $t.exec(e)?.[1];
1252
+ function Cn(e) {
1253
+ return jt.exec(e)?.[1];
1254
1254
  }
1255
- function Vt(e) {
1256
- const n = e.find((r) => r.key === "shipping"), t = n ? yn(n.value) : void 0;
1255
+ function Ht(e) {
1256
+ const n = e.find((r) => r.key === "shipping"), t = n ? Cn(n.value) : void 0;
1257
1257
  if (t !== void 0)
1258
1258
  try {
1259
1259
  return decodeURIComponent(t);
@@ -1261,8 +1261,8 @@ function Vt(e) {
1261
1261
  return t;
1262
1262
  }
1263
1263
  }
1264
- function xt(e, n) {
1265
- const t = Vt(
1264
+ function Xt(e, n) {
1265
+ const t = Ht(
1266
1266
  n
1267
1267
  );
1268
1268
  return t === void 0 ? e : {
@@ -1270,25 +1270,25 @@ function xt(e, n) {
1270
1270
  pickupPoint: t
1271
1271
  };
1272
1272
  }
1273
- function qt(e) {
1274
- return e.map((n) => n.key !== "shipping" || yn(n.value) === void 0 ? n : { ...n, value: "pickup-in-point" });
1273
+ function Yt(e) {
1274
+ return e.map((n) => n.key !== "shipping" || Cn(n.value) === void 0 ? n : { ...n, value: "pickup-in-point" });
1275
1275
  }
1276
- function jt(e, n) {
1276
+ function Jt(e, n) {
1277
1277
  let t = [...e];
1278
1278
  const r = t.some((i) => i.key === "shipping");
1279
1279
  for (const i of n)
1280
1280
  (!r || i.key !== "shipping") && t.push(i);
1281
- return t.some((i) => i.key === "shipping" && i.value === "ignore") && (t = t.filter((i) => i.key !== "shipping")), qt(t);
1281
+ return t.some((i) => i.key === "shipping" && i.value === "ignore") && (t = t.filter((i) => i.key !== "shipping")), Yt(t);
1282
1282
  }
1283
- function Wt(e) {
1283
+ function Kt(e) {
1284
1284
  return e.reduce((n, t) => {
1285
1285
  let { key: r, value: i } = t;
1286
- return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${Le(r)}/${Bt(Le(i)).replaceAll(/ |%20/g, "-")}/`;
1286
+ return r === "priceRange" && (r = "price", i = i.replace(" TO ", ":")), r === "ft" ? n : `${n}${$e(r)}/${xt($e(i)).replaceAll(/ |%20/g, "-")}/`;
1287
1287
  }, "");
1288
1288
  }
1289
- const Gt = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), Ht = (e) => e.key === "operator" && (e.value === "and" || e.value === "or");
1290
- function Xt(e, n) {
1291
- const { segmentParams: t, extraFacets: r } = zt(e ?? {}), i = n?.salesChannel ?? t.sc, a = n?.regionId ?? t.regionId, o = n?.locale ?? t.locale ?? "";
1289
+ const Qt = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), Zt = (e) => e.key === "operator" && (e.value === "and" || e.value === "or");
1290
+ function er(e, n) {
1291
+ const { segmentParams: t, extraFacets: r } = Gt(e ?? {}), i = n?.salesChannel ?? t.sc, a = n?.regionId ?? t.regionId, o = n?.locale ?? t.locale ?? "";
1292
1292
  return {
1293
1293
  segmentParams: {
1294
1294
  ...t,
@@ -1299,61 +1299,61 @@ function Xt(e, n) {
1299
1299
  extraFacets: r
1300
1300
  };
1301
1301
  }
1302
- function Yt(e, n) {
1303
- const t = e.filter(({ key: c }) => !Nt.has(c)), r = e.find(
1304
- ({ key: c, value: u }) => c === Fe && u !== "all-delivery-methods"
1302
+ function nr(e, n) {
1303
+ const t = e.filter(({ key: c }) => !Vt.has(c)), r = e.find(
1304
+ ({ key: c, value: d }) => c === Le && d !== "all-delivery-methods"
1305
1305
  ) ?? null, i = e.find(
1306
- ({ key: c, value: u }) => c === Ne && u !== "all-delivery-options"
1306
+ ({ key: c, value: d }) => c === Be && d !== "all-delivery-options"
1307
1307
  ) ?? null, a = [...t], o = a.some(
1308
- ({ key: c }) => c === Fe
1308
+ ({ key: c }) => c === Le
1309
1309
  ), s = a.some(
1310
- ({ key: c }) => c === Ne
1310
+ ({ key: c }) => c === Be
1311
1311
  );
1312
- return r !== null && !o && a.push(r), i !== null && !s && a.push(i), jt(a, n);
1312
+ return r !== null && !o && a.push(r), i !== null && !s && a.push(i), Jt(a, n);
1313
1313
  }
1314
- function Jt(e, n) {
1315
- const t = e.find(({ key: a }) => a === he) ?? null, r = e.find(({ key: a }) => a === fe) ?? null, i = e.find(({ key: a }) => a === Se) ?? null;
1316
- t && Gt(t) && n.append(he, t.value), r && Ht(r) && n.append(fe, r.value), i && n.append(Se, i.value);
1314
+ function tr(e, n) {
1315
+ const t = e.find(({ key: a }) => a === Ie) ?? null, r = e.find(({ key: a }) => a === ve) ?? null, i = e.find(({ key: a }) => a === Oe) ?? null;
1316
+ t && Qt(t) && n.append(Ie, t.value), r && Zt(r) && n.append(ve, r.value), i && n.append(Oe, i.value);
1317
1317
  }
1318
- function Be(e, n, t, r) {
1318
+ function Me(e, n, t, r) {
1319
1319
  const {
1320
1320
  query: i = "",
1321
1321
  page: a,
1322
1322
  count: o,
1323
1323
  sort: s,
1324
1324
  selectedFacets: c = [],
1325
- showInvisibleItems: u,
1326
- sponsoredCount: d,
1327
- hideUnavailableItems: g,
1325
+ showInvisibleItems: d,
1326
+ sponsoredCount: g,
1327
+ hideUnavailableItems: p,
1328
1328
  allowRedirect: f = !1
1329
1329
  } = e, h = new URLSearchParams();
1330
1330
  if (r.includePagination && a !== void 0 && o !== void 0) {
1331
- const p = a * o, m = o === 0 ? p : p + o - 1;
1332
- h.append("from", p.toString()), h.append("to", m.toString());
1331
+ const u = a * o, m = o === 0 ? u : u + o - 1;
1332
+ h.append("from", u.toString()), h.append("to", m.toString());
1333
1333
  }
1334
1334
  i && h.append("query", i), r.includeSort && s && h.append("sort", s);
1335
- const v = xt(
1335
+ const v = Xt(
1336
1336
  t.segmentParams,
1337
1337
  c
1338
1338
  );
1339
- if (Sn(h, v ?? t.segmentParams), Jt(c, h), u && h.append("show-invisible-items", "true"), n?.hideUnavailableItems !== void 0) {
1340
- const p = c.find(({ key: S }) => S === Tt), m = p ? p.value : g?.toString() ?? n.hideUnavailableItems.toString();
1339
+ if (On(h, v ?? t.segmentParams), tr(c, h), d && h.append("show-invisible-items", "true"), n?.hideUnavailableItems !== void 0) {
1340
+ const u = c.find(({ key: S }) => S === $t), m = u ? u.value : p?.toString() ?? n.hideUnavailableItems.toString();
1341
1341
  h.append("hideUnavailableItems", m);
1342
1342
  }
1343
- n?.simulationBehavior !== void 0 && h.append("simulationBehavior", n.simulationBehavior.toString()), n?.showSponsored !== void 0 && h.append("showSponsored", n.showSponsored.toString()), d !== void 0 && h.append("sponsoredCount", d.toString()), f !== void 0 && h.append("allowRedirect", f.toString());
1344
- const l = Wt(
1345
- Yt(c, t.extraFacets)
1343
+ n?.simulationBehavior !== void 0 && h.append("simulationBehavior", n.simulationBehavior.toString()), n?.showSponsored !== void 0 && h.append("showSponsored", n.showSponsored.toString()), g !== void 0 && h.append("sponsoredCount", g.toString()), f !== void 0 && h.append("allowRedirect", f.toString());
1344
+ const l = Kt(
1345
+ nr(c, t.extraFacets)
1346
1346
  );
1347
1347
  return { params: h, path: l };
1348
1348
  }
1349
- function Kt(e, n) {
1349
+ function rr(e, n) {
1350
1350
  const { field: t, value: r, hideUnavailableItems: i, showInvisibleItems: a } = e, o = new URLSearchParams({
1351
1351
  field: t ?? "",
1352
1352
  value: r ?? ""
1353
1353
  });
1354
- return Sn(o, n), i && o.append("hideUnavailableItems", "true"), a && o.append("show-invisible-items", "true"), o;
1354
+ return On(o, n), i && o.append("hideUnavailableItems", "true"), a && o.append("show-invisible-items", "true"), o;
1355
1355
  }
1356
- function X(e, n) {
1356
+ function Q(e, n) {
1357
1357
  return {
1358
1358
  path: e,
1359
1359
  params: n,
@@ -1363,44 +1363,44 @@ function X(e, n) {
1363
1363
  }
1364
1364
  };
1365
1365
  }
1366
- function Y(e) {
1367
- const { endpoint: n, segment: t, defaults: r, args: i = {} } = e, a = Xt(t, r);
1366
+ function Z(e) {
1367
+ const { endpoint: n, segment: t, defaults: r, args: i = {} } = e, a = er(t, r);
1368
1368
  switch (n) {
1369
1369
  case "product-search":
1370
1370
  case "facets": {
1371
- const { params: o, path: s } = Be(
1371
+ const { params: o, path: s } = Me(
1372
1372
  i,
1373
1373
  r,
1374
1374
  a,
1375
1375
  { includePagination: !0, includeSort: !0 }
1376
1376
  );
1377
- return X(s, o);
1377
+ return Q(s, o);
1378
1378
  }
1379
1379
  case "catalog-count": {
1380
- const { params: o, path: s } = Be(
1380
+ const { params: o, path: s } = Me(
1381
1381
  i,
1382
1382
  r,
1383
1383
  a,
1384
1384
  { includePagination: !1, includeSort: !1 }
1385
1385
  );
1386
- return X(s, o);
1386
+ return Q(s, o);
1387
1387
  }
1388
1388
  case "products": {
1389
- const o = Kt(i, a.segmentParams);
1390
- return X("", o);
1389
+ const o = rr(i, a.segmentParams);
1390
+ return Q("", o);
1391
1391
  }
1392
1392
  case "search-suggestions": {
1393
1393
  const o = new URLSearchParams({
1394
1394
  query: i.query?.toString() ?? "",
1395
1395
  locale: r?.locale ?? a.segmentParams.locale ?? ""
1396
1396
  });
1397
- return X("", o);
1397
+ return Q("", o);
1398
1398
  }
1399
1399
  case "top-searches": {
1400
1400
  const o = new URLSearchParams({
1401
1401
  locale: r?.locale ?? a.segmentParams.locale ?? ""
1402
1402
  });
1403
- return X("", o);
1403
+ return Q("", o);
1404
1404
  }
1405
1405
  default: {
1406
1406
  const o = n;
@@ -1408,16 +1408,16 @@ function Y(e) {
1408
1408
  }
1409
1409
  }
1410
1410
  }
1411
- const Qt = 10;
1412
- function Zt(e) {
1411
+ const ir = 10;
1412
+ function ar(e) {
1413
1413
  const { regionId: n, seller: t } = e.storage.channel;
1414
1414
  return (t ? Buffer.from(`SW#${t}`).toString("base64") : void 0) ?? (n || void 0);
1415
1415
  }
1416
- function er(e) {
1417
- const t = fn(e.headers?.cookie).cultureInfo || "";
1418
- return j(e) ? e.storage.locale || t : t || e.storage.locale || "";
1416
+ function or(e) {
1417
+ const t = vn(e.headers?.cookie).cultureInfo || "";
1418
+ return G(e) ? e.storage.locale || t : t || e.storage.locale || "";
1419
1419
  }
1420
- const nr = ({
1420
+ const sr = ({
1421
1421
  account: e,
1422
1422
  environment: n,
1423
1423
  hideUnavailableItems: t,
@@ -1425,69 +1425,69 @@ const nr = ({
1425
1425
  showSponsored: i,
1426
1426
  subDomainPrefix: a
1427
1427
  }, o) => {
1428
- const s = `https://${e}.${n}.com.br`, c = mn(o), u = fn(o.headers?.cookie), d = () => ({
1428
+ const s = `https://${e}.${n}.com.br`, c = yn(o), d = vn(o.headers?.cookie), g = () => ({
1429
1429
  salesChannel: o.storage.channel.salesChannel,
1430
- regionId: Zt(o),
1431
- locale: er(o),
1430
+ regionId: ar(o),
1431
+ locale: or(o),
1432
1432
  hideUnavailableItems: t,
1433
1433
  simulationBehavior: r,
1434
1434
  showSponsored: i
1435
- }), g = new Headers(o.headers).get("x-forwarded-host") ?? o.headers?.host ?? "", f = a && a.map((I) => I + ".").find((I) => g.includes(I)) || "", h = g.replace(f, ""), v = c({
1435
+ }), p = new Headers(o.headers).get("x-forwarded-host") ?? o.headers?.host ?? "", f = a && a.map((I) => I + ".").find((I) => p.includes(I)) || "", h = p.replace(f, ""), v = c({
1436
1436
  "content-type": "application/json",
1437
1437
  "X-FORWARDED-HOST": h
1438
- }), l = ({ type: I, ...A }) => {
1439
- const D = I === "facets" ? "facets" : "product-search", E = Y({
1440
- endpoint: D,
1441
- segment: u,
1442
- defaults: d(),
1443
- args: A
1438
+ }), l = ({ type: I, ...w }) => {
1439
+ const E = I === "facets" ? "facets" : "product-search", D = Z({
1440
+ endpoint: E,
1441
+ segment: d,
1442
+ defaults: g(),
1443
+ args: w
1444
1444
  });
1445
1445
  return y(
1446
- `${s}/api/intelligent-search/v1/${D}/${E.path}?${E.params.toString()}`,
1446
+ `${s}/api/intelligent-search/v1/${E}/${D.path}?${D.params.toString()}`,
1447
1447
  { headers: v }
1448
1448
  );
1449
- }, p = (I) => l({ ...I, type: "product_search" }), m = ({
1449
+ }, u = (I) => l({ ...I, type: "product_search" }), m = ({
1450
1450
  field: I,
1451
- value: A,
1452
- hideUnavailableItems: D,
1453
- showInvisibleItems: E
1451
+ value: w,
1452
+ hideUnavailableItems: E,
1453
+ showInvisibleItems: D
1454
1454
  }) => {
1455
- const P = Y({
1455
+ const R = Z({
1456
1456
  endpoint: "products",
1457
- segment: u,
1458
- defaults: d(),
1457
+ segment: d,
1458
+ defaults: g(),
1459
1459
  args: {
1460
1460
  field: I,
1461
- value: A,
1462
- hideUnavailableItems: D,
1463
- showInvisibleItems: E
1461
+ value: w,
1462
+ hideUnavailableItems: E,
1463
+ showInvisibleItems: D
1464
1464
  }
1465
1465
  });
1466
1466
  return y(
1467
- `${s}/api/intelligent-search/v1/products?${P.params.toString()}`,
1467
+ `${s}/api/intelligent-search/v1/products?${R.params.toString()}`,
1468
1468
  { headers: v }
1469
1469
  );
1470
1470
  };
1471
1471
  return {
1472
1472
  facets: (I) => l({ ...I, type: "facets" }),
1473
- products: p,
1473
+ products: u,
1474
1474
  fetchProduct: m,
1475
1475
  productsByIdentifier: async ({
1476
1476
  field: I,
1477
- values: A,
1478
- showInvisibleItems: D,
1479
- hideUnavailableItems: E
1477
+ values: w,
1478
+ showInvisibleItems: E,
1479
+ hideUnavailableItems: D
1480
1480
  }) => {
1481
- const P = Ae(Qt);
1481
+ const R = ke(ir);
1482
1482
  return (await Promise.all(
1483
- A.map(
1484
- (b) => P(async () => {
1483
+ w.map(
1484
+ (U) => R(async () => {
1485
1485
  try {
1486
1486
  return await m({
1487
1487
  field: I,
1488
- value: b,
1489
- hideUnavailableItems: E,
1490
- showInvisibleItems: D
1488
+ value: U,
1489
+ hideUnavailableItems: D,
1490
+ showInvisibleItems: E
1491
1491
  });
1492
1492
  } catch {
1493
1493
  return null;
@@ -1495,26 +1495,26 @@ const nr = ({
1495
1495
  })
1496
1496
  )
1497
1497
  )).filter(
1498
- (b) => b !== null
1498
+ (U) => U !== null
1499
1499
  );
1500
1500
  },
1501
1501
  suggestedTerms: (I) => {
1502
- const A = Y({
1502
+ const w = Z({
1503
1503
  endpoint: "search-suggestions",
1504
- segment: u,
1505
- defaults: d(),
1504
+ segment: d,
1505
+ defaults: g(),
1506
1506
  args: { query: I.query }
1507
1507
  });
1508
1508
  return y(
1509
- `${s}/api/intelligent-search/v1/search-suggestions?${A.params.toString()}`,
1509
+ `${s}/api/intelligent-search/v1/search-suggestions?${w.params.toString()}`,
1510
1510
  { headers: v }
1511
1511
  );
1512
1512
  },
1513
1513
  topSearches: () => {
1514
- const I = Y({
1514
+ const I = Z({
1515
1515
  endpoint: "top-searches",
1516
- segment: u,
1517
- defaults: d()
1516
+ segment: d,
1517
+ defaults: g()
1518
1518
  });
1519
1519
  return y(
1520
1520
  `${s}/api/intelligent-search/v1/top-searches?${I.params.toString()}`,
@@ -1522,27 +1522,27 @@ const nr = ({
1522
1522
  );
1523
1523
  },
1524
1524
  productCount: (I) => {
1525
- const A = Y({
1525
+ const w = Z({
1526
1526
  endpoint: "catalog-count",
1527
- segment: u,
1528
- defaults: d(),
1527
+ segment: d,
1528
+ defaults: g(),
1529
1529
  args: I
1530
1530
  });
1531
1531
  return y(
1532
- `${s}/api/intelligent-search/v1/catalog-count/${A.path}?${A.params.toString()}`,
1532
+ `${s}/api/intelligent-search/v1/catalog-count/${w.path}?${w.params.toString()}`,
1533
1533
  { headers: v }
1534
1534
  );
1535
1535
  }
1536
1536
  };
1537
- }, tr = (e, n) => {
1538
- const t = nr(e, n), r = kt(e, n), i = St(e);
1537
+ }, cr = (e, n) => {
1538
+ const t = sr(e, n), r = Nt(e, n), i = bt(e);
1539
1539
  return {
1540
1540
  search: t,
1541
1541
  commerce: r,
1542
1542
  catalog: i
1543
1543
  };
1544
- }, rr = 20, ir = (e) => e.entityType === "category", ye = (e) => e.entityType === "brand", $e = (e) => e.entityType === "collection", ar = (e, n) => {
1545
- const t = Ae(rr), r = async (i) => Promise.all(
1544
+ }, lr = 20, dr = (e) => e.entityType === "category", Ce = (e) => e.entityType === "brand", ze = (e) => e.entityType === "collection", ur = (e, n) => {
1545
+ const t = ke(lr), r = async (i) => Promise.all(
1546
1546
  i.map(
1547
1547
  (a) => t(async () => {
1548
1548
  const o = a.slug.toLowerCase(), s = a.locale, c = await n.commerce.catalog.byLinkId.category(
@@ -1555,72 +1555,72 @@ const nr = ({
1555
1555
  entityType: "category",
1556
1556
  slug: o
1557
1557
  };
1558
- const u = await n.commerce.catalog.byLinkId.brand(
1558
+ const d = await n.commerce.catalog.byLinkId.brand(
1559
1559
  o,
1560
1560
  s
1561
1561
  );
1562
- if (u)
1563
- return { ...u, entityType: "brand" };
1564
- const d = await n.commerce.catalog.byLinkId.collection(
1562
+ if (d)
1563
+ return { ...d, entityType: "brand" };
1564
+ const g = await n.commerce.catalog.byLinkId.collection(
1565
1565
  o,
1566
1566
  s
1567
1567
  );
1568
- if (d)
1569
- return { ...d, entityType: "collection" };
1570
- throw new $(
1568
+ if (g)
1569
+ return { ...g, entityType: "collection" };
1570
+ throw new z(
1571
1571
  `No catalog entity found for slug: ${a.slug}. Cascade exhausted (category → brand → collection).`
1572
1572
  );
1573
1573
  })
1574
1574
  )
1575
1575
  );
1576
- return new ue(r, {
1576
+ return new he(r, {
1577
1577
  // DataLoader is used for caching, not batching
1578
1578
  batch: !1,
1579
1579
  // Dedup by lowercased slug + captured locale so casing variants share an
1580
1580
  // entry while same-slug / different-locale loads stay isolated.
1581
1581
  cacheKeyFn: ({ slug: i, locale: a }) => `${i.toLowerCase()}::${a ?? ""}`
1582
1582
  });
1583
- }, or = (e, n) => {
1583
+ }, pr = (e, n) => {
1584
1584
  const t = async (r) => Promise.all(r.map((i) => n.commerce.catalog.salesChannel(i)));
1585
- return new ue(t);
1586
- }, sr = 1, cr = (e, n) => {
1587
- const t = Ae(sr), r = async (a) => {
1588
- const o = a.reduce((g, { items: f }) => [...g, f], []), s = [...o.flat()], c = await n.commerce.checkout.simulation({
1585
+ return new he(t);
1586
+ }, gr = 1, mr = (e, n) => {
1587
+ const t = ke(gr), r = async (a) => {
1588
+ const o = a.reduce((p, { items: f }) => [...p, f], []), s = [...o.flat()], c = await n.commerce.checkout.simulation({
1589
1589
  country: a[0].country,
1590
1590
  postalCode: a[0].postalCode,
1591
1591
  items: s
1592
- }), u = c.items.reduce(
1593
- (g, f) => {
1592
+ }), d = c.items.reduce(
1593
+ (p, f) => {
1594
1594
  const h = f.requestIndex;
1595
- return typeof h == "number" && h < g.length && (g[h] = f), g;
1595
+ return typeof h == "number" && h < p.length && (p[h] = f), p;
1596
1596
  },
1597
1597
  Array(s.length).fill(null)
1598
- ), d = o.reduce(
1599
- (g, f) => [...g, f.length + g[g.length - 1]],
1598
+ ), g = o.reduce(
1599
+ (p, f) => [...p, f.length + p[p.length - 1]],
1600
1600
  [0]
1601
1601
  );
1602
- return o.map((g, f) => ({
1602
+ return o.map((p, f) => ({
1603
1603
  ...c,
1604
- items: u.slice(d[f], d[f + 1]).filter((h) => !!h)
1604
+ items: d.slice(g[f], g[f + 1]).filter((h) => !!h)
1605
1605
  }));
1606
1606
  }, i = async (a) => t(r, a);
1607
- return new ue(i, {
1607
+ return new he(i, {
1608
1608
  maxBatchSize: 50
1609
1609
  });
1610
- }, lr = (e, n) => Jn(e, n);
1611
- function dr(e) {
1610
+ }, hr = (e, n) => rt(e, n);
1611
+ function fr(e) {
1612
1612
  return {
1613
1613
  ...e,
1614
- description: e.description ? lr(e.description) : e.description
1614
+ description: e.description ? hr(e.description) : e.description
1615
1615
  };
1616
1616
  }
1617
- const F = (e, n) => ({
1617
+ const L = (e, n) => ({
1618
1618
  ...e,
1619
- isVariantOf: dr(n)
1620
- }), ur = ({ flags: e }, n) => {
1619
+ isVariantOf: fr(n)
1620
+ }), Sr = ({ flags: e }, n) => {
1621
1621
  const t = async (r) => {
1622
- const i = r.map((d) => d.split("-")[0]), a = r.some(
1623
- (d) => d.split("-")[1] === "invisibleItems"
1622
+ const i = r.map((g) => g.split("-")[0]), a = r.some(
1623
+ (g) => g.split("-")[1] === "invisibleItems"
1624
1624
  ), s = (await n.search.productsByIdentifier({
1625
1625
  field: "sku",
1626
1626
  values: i,
@@ -1629,44 +1629,44 @@ const F = (e, n) => ({
1629
1629
  hideUnavailableItems: !1
1630
1630
  }
1631
1631
  })).reduce(
1632
- (d, g) => {
1633
- for (const f of g.items)
1634
- d[f.itemId] = F(f, g);
1635
- return d;
1632
+ (g, p) => {
1633
+ for (const f of p.items)
1634
+ g[f.itemId] = L(f, p);
1635
+ return g;
1636
1636
  },
1637
1637
  {}
1638
- ), c = i.map((d) => s[d]), u = i.filter((d) => !s[d]);
1639
- if (u.length > 0)
1640
- throw new $(
1641
- `Search API did not found the following skus: ${u.join(",")}`
1638
+ ), c = i.map((g) => s[g]), d = i.filter((g) => !s[g]);
1639
+ if (d.length > 0)
1640
+ throw new z(
1641
+ `Search API did not found the following skus: ${d.join(",")}`
1642
1642
  );
1643
1643
  return c;
1644
1644
  };
1645
- return new ue(t, {
1645
+ return new he(t, {
1646
1646
  maxBatchSize: 99
1647
1647
  // Max allowed batch size of Search API
1648
1648
  });
1649
- }, pr = (e, n) => {
1650
- const { clients: t } = n, r = ur(e, t), i = cr(e, t), a = ar(e, t), o = or(e, t);
1649
+ }, yr = (e, n) => {
1650
+ const { clients: t } = n, r = Sr(e, t), i = mr(e, t), a = ur(e, t), o = pr(e, t);
1651
1651
  return {
1652
1652
  skuLoader: r,
1653
1653
  simulationLoader: i,
1654
1654
  collectionLoader: a,
1655
1655
  salesChannelLoader: o
1656
1656
  };
1657
- }, B = (e) => e.AvailableQuantity > 0, W = (e) => e.spotPrice ?? 0, gr = (e) => e.Price ?? 0, Me = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", In = (e, n) => B(e) && !B(n) ? -1 : !B(e) && B(n) ? 1 : W(e) - W(n), mr = (e) => e === "available", q = (e, n = 0, t = 1) => {
1657
+ }, M = (e) => e.AvailableQuantity > 0, H = (e) => e.spotPrice ?? 0, Ir = (e) => e.Price ?? 0, Ve = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", bn = (e, n) => M(e) && !M(n) ? -1 : !M(e) && M(n) ? 1 : H(e) - H(n), vr = (e) => e === "available", W = (e, n = 0, t = 1) => {
1658
1658
  const r = n / t;
1659
1659
  return Math.round((e + r) * 100) / 100;
1660
- }, hr = (e, n = { includeTaxes: !1 }) => {
1661
- const t = e.filter(B), r = t[t.length - 1], i = r ? W(r) : 0;
1662
- return n.includeTaxes ? q(i, r?.Tax, r?.product?.unitMultiplier) : i;
1663
- }, ze = (e, n = { includeTaxes: !1 }) => {
1664
- const [t] = e.filter(B), r = t ? W(t) : 0;
1665
- return n.includeTaxes ? q(r, t?.Tax, t?.product?.unitMultiplier) : r;
1666
- }, fr = {
1667
- highPrice: (e) => hr(e),
1668
- lowPrice: (e) => ze(e),
1669
- lowPriceWithTaxes: (e) => ze(e, { includeTaxes: !0 }),
1660
+ }, Or = (e, n = { includeTaxes: !1 }) => {
1661
+ const t = e.filter(M), r = t[t.length - 1], i = r ? H(r) : 0;
1662
+ return n.includeTaxes ? W(i, r?.Tax, r?.product?.unitMultiplier) : i;
1663
+ }, qe = (e, n = { includeTaxes: !1 }) => {
1664
+ const [t] = e.filter(M), r = t ? H(t) : 0;
1665
+ return n.includeTaxes ? W(r, t?.Tax, t?.product?.unitMultiplier) : r;
1666
+ }, Cr = {
1667
+ highPrice: (e) => Or(e),
1668
+ lowPrice: (e) => qe(e),
1669
+ lowPriceWithTaxes: (e) => qe(e, { includeTaxes: !0 }),
1670
1670
  offerCount: (e) => e.length,
1671
1671
  priceCurrency: async (e, n, t) => {
1672
1672
  const {
@@ -1676,20 +1676,20 @@ const F = (e, n) => ({
1676
1676
  return (await r.load(i.salesChannel)).CurrencyCode ?? "";
1677
1677
  },
1678
1678
  offers: (e) => e
1679
- }, Sr = {
1679
+ }, br = {
1680
1680
  ratingValue: () => 5,
1681
1681
  reviewCount: () => 0
1682
- }, Ve = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", yr = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Ir = (e) => {
1682
+ }, xe = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", wr = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Ar = (e) => {
1683
1683
  let n = e.slice(0);
1684
- for (let t = 0; t < Ve.length; t++)
1685
- n = n.replace(new RegExp(Ve.charAt(t), "g"), yr.charAt(t));
1684
+ for (let t = 0; t < xe.length; t++)
1685
+ n = n.replace(new RegExp(xe.charAt(t), "g"), wr.charAt(t));
1686
1686
  return n;
1687
- }, vr = (e) => e.replace(/[·/_,:]/, "-");
1688
- function se(e) {
1687
+ }, Dr = (e) => e.replace(/[·/_,:]/, "-");
1688
+ function ue(e) {
1689
1689
  const t = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}><=_^]/g, "-");
1690
- return vr(Ir(t)).toLowerCase();
1690
+ return Dr(Ar(t)).toLowerCase();
1691
1691
  }
1692
- const ge = (e) => e.toLowerCase(), re = (e, n) => {
1692
+ const Se = (e) => e.toLowerCase(), se = (e, n) => {
1693
1693
  const t = n.split("/").filter(Boolean), {
1694
1694
  loaders: { collectionLoader: r }
1695
1695
  } = e;
@@ -1697,13 +1697,13 @@ const ge = (e) => e.toLowerCase(), re = (e, n) => {
1697
1697
  t.map(
1698
1698
  (i, a) => r.load({
1699
1699
  slug: t.slice(0, a + 1).join("/"),
1700
- locale: hn(e)
1700
+ locale: In(e)
1701
1701
  })
1702
1702
  )
1703
1703
  );
1704
- }, z = (e) => ir(e) ? e.slug : ye(e) ? e.linkId : e.linkId ?? se(e.name), vn = {
1704
+ }, q = (e) => dr(e) ? e.slug : Ce(e) ? e.linkId : e.linkId ?? ue(e.name), wn = {
1705
1705
  id: ({ id: e }) => e.toString(),
1706
- slug: (e) => z(e),
1706
+ slug: (e) => q(e),
1707
1707
  seo: (e) => ({
1708
1708
  title: e.title ?? e.name,
1709
1709
  // pagetype.metaTagDescription and catalog `description` share the same
@@ -1711,26 +1711,26 @@ const ge = (e) => e.toLowerCase(), re = (e, n) => {
1711
1711
  // for forward-compat; fall back to description for by-linkid parity.
1712
1712
  description: e.metaTagDescription ?? e.description
1713
1713
  }),
1714
- type: (e) => ye(e) ? "Brand" : $e(e) ? "Collection" : e.fatherCategoryId === null ? "Department" : "Category",
1714
+ type: (e) => Ce(e) ? "Brand" : ze(e) ? "Collection" : e.fatherCategoryId === null ? "Department" : "Category",
1715
1715
  meta: async (e, n, t) => {
1716
- const r = z(e);
1717
- if (ye(e))
1716
+ const r = q(e);
1717
+ if (Ce(e))
1718
1718
  return { selectedFacets: [{ key: "brand", value: r }] };
1719
- if ($e(e))
1719
+ if (ze(e))
1720
1720
  return { selectedFacets: [{ key: "productclusterids", value: e.id }] };
1721
- const { defaultLocale: i } = Q(t);
1721
+ const { defaultLocale: i } = te(t);
1722
1722
  return {
1723
- selectedFacets: (await re(t, r)).map((o, s) => ({
1723
+ selectedFacets: (await se(t, r)).map((o, s) => ({
1724
1724
  key: `category-${s + 1}`,
1725
1725
  value: i && o.availableLinkIds?.[i] || o.linkId
1726
1726
  }))
1727
1727
  };
1728
1728
  },
1729
1729
  breadcrumbList: async (e, n, t) => {
1730
- const r = await re(t, z(e));
1730
+ const r = await se(t, q(e));
1731
1731
  return {
1732
1732
  itemListElement: r.map((i, a) => ({
1733
- item: `/${z(i)}`,
1733
+ item: `/${q(i)}`,
1734
1734
  name: i.name,
1735
1735
  position: a + 1
1736
1736
  })),
@@ -1738,51 +1738,51 @@ const ge = (e) => e.toLowerCase(), re = (e, n) => {
1738
1738
  };
1739
1739
  },
1740
1740
  otherLocales: async (e, n, t) => {
1741
- const r = Q(t);
1741
+ const r = te(t);
1742
1742
  if (!r.enabled) return null;
1743
1743
  const i = Object.keys(r.locales ?? {});
1744
1744
  if (i.length === 0) return null;
1745
- const a = z(e);
1745
+ const a = q(e);
1746
1746
  if (a.split("/").filter(Boolean).length === 0) return null;
1747
1747
  let o;
1748
1748
  try {
1749
- o = await re(t, a);
1749
+ o = await se(t, a);
1750
1750
  } catch (s) {
1751
1751
  return console.warn("[otherLocales] failed to load collection entities:", s), null;
1752
1752
  }
1753
1753
  return i.map((s) => {
1754
1754
  const c = [];
1755
- for (const u of o) {
1756
- const d = u.availableLinkIds?.[s];
1757
- if (!d) return null;
1758
- c.push(d);
1755
+ for (const d of o) {
1756
+ const g = d.availableLinkIds?.[s];
1757
+ if (!g) return null;
1758
+ c.push(g);
1759
1759
  }
1760
1760
  return c.length > 0 ? {
1761
1761
  locale: s,
1762
- slug: ge(c.join("/"))
1762
+ slug: Se(c.join("/"))
1763
1763
  } : null;
1764
1764
  }).filter((s) => s !== null);
1765
1765
  },
1766
1766
  canonicalSlug: async (e, n, t) => {
1767
- const r = z(e);
1767
+ const r = q(e);
1768
1768
  if (r.split("/").filter(Boolean).length === 0) return null;
1769
1769
  let i;
1770
1770
  try {
1771
- i = await re(t, r);
1771
+ i = await se(t, r);
1772
1772
  } catch (o) {
1773
1773
  return console.warn("[canonicalSlug] failed to load collection entities:", o), null;
1774
1774
  }
1775
1775
  const a = i.map((o) => o.linkId);
1776
- return a.every((o) => !!o) ? ge(a.join("/")) : ge(r);
1776
+ return a.every((o) => !!o) ? Se(a.join("/")) : Se(r);
1777
1777
  }
1778
- }, On = {
1778
+ }, An = {
1779
1779
  buy: "whoboughtalsobought",
1780
1780
  view: "whosawalsosaw",
1781
1781
  similars: "similars",
1782
1782
  viewAndBought: "whosawalsobought",
1783
1783
  accessories: "accessories",
1784
1784
  suggestions: "suggestions"
1785
- }, xe = ({ key: e, value: n }) => {
1785
+ }, je = ({ key: e, value: n }) => {
1786
1786
  switch (e) {
1787
1787
  case "price":
1788
1788
  return { key: e, value: n.replace("-to-", ":") };
@@ -1798,61 +1798,61 @@ const ge = (e) => e.toLowerCase(), re = (e, n) => {
1798
1798
  default:
1799
1799
  return { key: e, value: n };
1800
1800
  }
1801
- }, qe = (e) => {
1801
+ }, We = (e) => {
1802
1802
  const n = e.split(":").map(Number);
1803
1803
  return n.length !== 2 || Number.isNaN(n[0]) || Number.isNaN(n[1]) ? null : n;
1804
- }, Or = (e) => typeof On[e] == "string", br = (e) => {
1804
+ }, Pr = (e) => typeof An[e] == "string", Er = (e) => {
1805
1805
  const n = e?.filter(
1806
- (t) => Or(t.key)
1806
+ (t) => Pr(t.key)
1807
1807
  );
1808
1808
  if (Array.isArray(n) && n.length > 1)
1809
1809
  throw new k(
1810
1810
  `You passed ${n.length} cross selling facets but only one is allowed. Please leave one of the following facet: ${n.map((t) => t.key).join(",")}`
1811
1811
  );
1812
1812
  return n?.[0] ?? null;
1813
- }, Cr = (e) => e?.find((n) => n.key === "slug")?.value ?? null, wr = (e) => e?.find((n) => n.key === "id")?.value ?? null, je = (e) => e?.find((n) => n.key === "locale")?.value ?? null, We = (e) => e?.find((n) => n.key === "channel")?.value ?? null, Ie = (e, n) => {
1813
+ }, kr = (e) => e?.find((n) => n.key === "slug")?.value ?? null, _r = (e) => e?.find((n) => n.key === "id")?.value ?? null, Ge = (e) => e?.find((n) => n.key === "locale")?.value ?? null, He = (e) => e?.find((n) => n.key === "channel")?.value ?? null, be = (e, n) => {
1814
1814
  let t = 0;
1815
1815
  for (let r = 1; r < e.length; r++)
1816
1816
  n(e[t], e[r]) > 0 && (t = r);
1817
1817
  return e[t];
1818
- }, Ar = {
1818
+ }, Ur = {
1819
1819
  __resolveType: ({ type: e, values: n }) => e !== "TEXT" && e !== "DELIVERY" ? "StoreFacetRange" : !n || n.length === 0 ? "StoreFacetBoolean" : n.every((t) => t.range) ? "StoreFacetRange" : "StoreFacetBoolean"
1820
- }, Dr = {
1820
+ }, Rr = {
1821
1821
  key: ({ key: e }) => e,
1822
1822
  label: ({ name: e }) => e,
1823
1823
  values: ({ values: e }) => e.sort((n, t) => n.name.localeCompare(t.name))
1824
- }, Pr = {
1824
+ }, Tr = {
1825
1825
  key: ({ key: e }) => e,
1826
1826
  label: ({ name: e }) => e,
1827
1827
  min: ({ values: e, key: n }, t, { storage: { searchArgs: r } }) => {
1828
- const i = qe(
1828
+ const i = We(
1829
1829
  r?.selectedFacets?.find((s) => s.key === n)?.value ?? ""
1830
- ), o = Ie(e, (s, c) => s.range.from - c.range.from)?.range?.from ?? 0;
1830
+ ), o = be(e, (s, c) => s.range.from - c.range.from)?.range?.from ?? 0;
1831
1831
  return {
1832
1832
  selected: i?.[0] ?? o,
1833
1833
  absolute: o
1834
1834
  };
1835
1835
  },
1836
1836
  max: ({ values: e, key: n }, t, { storage: { searchArgs: r } }) => {
1837
- const i = qe(
1837
+ const i = We(
1838
1838
  r?.selectedFacets?.find((s) => s.key === n)?.value ?? ""
1839
- ), o = Ie(e, (s, c) => c.range.to - s.range.to)?.range?.to ?? 0;
1839
+ ), o = be(e, (s, c) => c.range.to - s.range.to)?.range?.to ?? 0;
1840
1840
  return {
1841
1841
  selected: i?.[1] ?? o,
1842
1842
  absolute: o
1843
1843
  };
1844
1844
  }
1845
- }, Er = {
1845
+ }, Fr = {
1846
1846
  value: ({ value: e }) => e,
1847
1847
  label: ({ name: e }) => e || "unknown",
1848
1848
  selected: ({ selected: e }) => e,
1849
1849
  quantity: ({ quantity: e }) => e
1850
- }, kr = async (e, { data: n }, { clients: { commerce: t } }) => {
1850
+ }, Nr = async (e, { data: n }, { clients: { commerce: t } }) => {
1851
1851
  if (!n?.orderId)
1852
1852
  throw new k("Missing orderId");
1853
1853
  return { data: (await t.checkout.cancelOrder(n))?.data };
1854
1854
  };
1855
- function bn(e) {
1855
+ function Dn(e) {
1856
1856
  if (!e || e.status !== "pending")
1857
1857
  return null;
1858
1858
  for (const n of e.dimensionStatus) {
@@ -1870,18 +1870,18 @@ function bn(e) {
1870
1870
  }
1871
1871
  return null;
1872
1872
  }
1873
- function _r(e) {
1873
+ function Lr(e) {
1874
1874
  if (!e || e.status !== "pending") return !1;
1875
1875
  const n = e.dimensionStatus.filter((t) => t.status === "pending").flatMap((t) => t.ruleCollection).filter((t) => t.status === "pending");
1876
1876
  return n.length === 0 ? !1 : n.every((t) => !t.isUserNextAuthorizer);
1877
1877
  }
1878
- const Ur = async (e, { data: n }, { clients: { commerce: t } }) => {
1879
- const r = await t.oms.processOrderAuthorization(n), i = bn(r);
1878
+ const Br = async (e, { data: n }, { clients: { commerce: t } }) => {
1879
+ const r = await t.oms.processOrderAuthorization(n), i = Dn(r);
1880
1880
  return {
1881
- isPendingForOtherAuthorizer: !i && _r(r),
1881
+ isPendingForOtherAuthorizer: !i && Lr(r),
1882
1882
  ruleForAuthorization: i
1883
1883
  };
1884
- }, Tr = async (e, { data: n }, { clients: { commerce: t } }) => {
1884
+ }, $r = async (e, { data: n }, { clients: { commerce: t } }) => {
1885
1885
  if (!n?.objectKey)
1886
1886
  throw new k("Missing objectKey");
1887
1887
  const r = n.orderFormId || (await t.orderEntry.createOrderForm()).orderFormId;
@@ -1890,13 +1890,13 @@ const Ur = async (e, { data: n }, { clients: { commerce: t } }) => {
1890
1890
  orderFormId: r,
1891
1891
  sessionToken: n.sessionToken ?? void 0
1892
1892
  });
1893
- }, Rr = async (e, n, t) => {
1893
+ }, Mr = async (e, n, t) => {
1894
1894
  if (!(await t.clients.commerce.recommendation.startRecommendationSession())?.recommendationsUserId)
1895
1895
  throw new Error(
1896
1896
  "Failed to start recommendation session: no session data returned"
1897
1897
  );
1898
1898
  return !0;
1899
- }, Fr = async (e, { data: n }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(n))?.Id }), Nr = async (e, { data: n }, { clients: { commerce: t } }) => {
1899
+ }, zr = async (e, { data: n }, { clients: { commerce: t } }) => ({ id: (await t.subscribeToNewsletter(n))?.Id }), Vr = async (e, { data: n }, { clients: { commerce: t } }) => {
1900
1900
  const { fileContent: r, fileName: i, mimeType: a } = n;
1901
1901
  if (!r || !i || !a)
1902
1902
  throw new k(
@@ -1909,14 +1909,14 @@ const Ur = async (e, { data: n }, { clients: { commerce: t } }) => {
1909
1909
  o
1910
1910
  ))
1911
1911
  throw new k("Invalid Base64 fileContent");
1912
- const d = Buffer.from(o, "base64");
1912
+ const g = Buffer.from(o, "base64");
1913
1913
  return await t.orderEntry.uploadFile({
1914
- fileBuffer: d,
1914
+ fileBuffer: g,
1915
1915
  fileName: i,
1916
1916
  mimeType: a
1917
1917
  });
1918
1918
  };
1919
- class ne {
1919
+ class ie {
1920
1920
  static parse(n) {
1921
1921
  try {
1922
1922
  const t = JSON.parse(n);
@@ -1934,18 +1934,53 @@ class ne {
1934
1934
  return JSON.stringify(n);
1935
1935
  }
1936
1936
  }
1937
- function Lr(e, n) {
1938
- return n == null || n === "" || String(n) === String(e.salesChannel ?? "") ? null : ne.stringify({
1937
+ function qr(e, n) {
1938
+ return n == null || n === "" || String(n) === String(e.salesChannel ?? "") ? null : ie.stringify({
1939
1939
  ...e,
1940
1940
  salesChannel: String(n),
1941
1941
  hasOnlyDefaultSalesChannel: !1
1942
1942
  });
1943
1943
  }
1944
- const ce = (e, n) => {
1945
- e.storage.channel = ne.parse(n);
1946
- }, ve = (e, n) => {
1944
+ function xr(e, n, t) {
1945
+ return t != null && String(e.salesChannel ?? "") === t && String(n ?? "") !== t ? !1 : e.items.length > 0 ? !0 : e.salesChannel == null || e.salesChannel === "" ? !1 : String(e.salesChannel) === String(n ?? "");
1946
+ }
1947
+ const Pn = (e) => {
1948
+ try {
1949
+ return JSON.parse(e ?? "") ?? {};
1950
+ } catch {
1951
+ return {};
1952
+ }
1953
+ };
1954
+ function En(e, { localizationEnabled: n = !0 } = {}) {
1955
+ const t = Pn(e).salesChannelSource;
1956
+ return t === "url" ? n ? t : void 0 : t === "orderForm" ? t : void 0;
1957
+ }
1958
+ const kn = (e) => !!e?.localization?.enabled;
1959
+ function _n(e) {
1960
+ const n = Pn(e).rejectedSalesChannel;
1961
+ return (typeof n == "string" || typeof n == "number") && String(n) || void 0;
1962
+ }
1963
+ function jr(e, n, t, r, i, a) {
1964
+ const o = n ?? void 0, s = t ?? e.regionId, c = i ? e.salesChannel || o : o ?? e.salesChannel, d = a != null && a !== String(c ?? "");
1965
+ return ie.stringify({
1966
+ salesChannel: c,
1967
+ regionId: s ?? void 0,
1968
+ seller: r,
1969
+ hasOnlyDefaultSalesChannel: !o,
1970
+ ...i ? { salesChannelSource: i } : {},
1971
+ ...d ? { rejectedSalesChannel: a } : {}
1972
+ });
1973
+ }
1974
+ const Xe = "1";
1975
+ function Wr(e, n, t, r) {
1976
+ const i = String(e.salesChannel ?? "");
1977
+ return n === void 0 && i === Xe && !!t && t !== Xe && !new URLSearchParams(r).has("sc") ? t : i;
1978
+ }
1979
+ const pe = (e, n) => {
1980
+ e.storage.channel = ie.parse(n);
1981
+ }, we = (e, n) => {
1947
1982
  e.storage.locale = n;
1948
- }, Pe = (e) => Kn.createHash("md5").update(e).digest("hex"), M = {
1983
+ }, Ue = (e) => it.createHash("md5").update(e).digest("hex"), V = {
1949
1984
  attachment: "ATTACHMENT",
1950
1985
  specification: "SPECIFICATION",
1951
1986
  attribute: "ATTRIBUTE",
@@ -1956,75 +1991,75 @@ const ce = (e, n) => {
1956
1991
  */
1957
1992
  service: "SERVICE"
1958
1993
  };
1959
- function Cn(e) {
1994
+ function Un(e) {
1960
1995
  return {
1961
1996
  name: e.name,
1962
1997
  value: e.content,
1963
- valueReference: M.attachment
1998
+ valueReference: V.attachment
1964
1999
  };
1965
2000
  }
1966
- function Br(e) {
2001
+ function Gr(e) {
1967
2002
  return {
1968
2003
  propertyID: e.id,
1969
2004
  name: e.name,
1970
2005
  value: e.value,
1971
2006
  valueReference: {
1972
- valueReference: M.attribute,
2007
+ valueReference: V.attribute,
1973
2008
  visible: e.visible
1974
2009
  }
1975
2010
  };
1976
2011
  }
1977
- function wn(e) {
1978
- return Pe(
2012
+ function Rn(e) {
2013
+ return Ue(
1979
2014
  `${e.name}:${JSON.stringify(e.value)}:${e.valueReference}`
1980
2015
  );
1981
2016
  }
1982
- const An = (e, n) => e < n ? -1 : e > n ? 1 : 0, $r = (e, n) => An(e.name, n.name), Mr = (e) => [...e ?? []].sort($r), Ge = (e) => e !== null && typeof e == "object" && !Array.isArray(e), zr = (e) => Ge(e) && typeof e.name == "string" && Ge(e.content), Vr = (e) => ({
2017
+ const Tn = (e, n) => e < n ? -1 : e > n ? 1 : 0, Hr = (e, n) => Tn(e.name, n.name), Xr = (e) => [...e ?? []].sort(Hr), Ye = (e) => e !== null && typeof e == "object" && !Array.isArray(e), Yr = (e) => Ye(e) && typeof e.name == "string" && Ye(e.content), Jr = (e) => ({
1983
2018
  name: e.name,
1984
2019
  content: Object.fromEntries(
1985
- Object.keys(e.content).sort(An).map((n) => [n, e.content[n]])
2020
+ Object.keys(e.content).sort(Tn).map((n) => [n, e.content[n]])
1986
2021
  )
1987
- }), Dn = (e, n) => Pe(
2022
+ }), Fn = (e, n) => Ue(
1988
2023
  `SERVICE:${e}:${JSON.stringify(
1989
- Mr((n ?? []).filter(zr)).map(
1990
- Vr
2024
+ Xr((n ?? []).filter(Yr)).map(
2025
+ Jr
1991
2026
  )
1992
2027
  )}`
1993
- ), xr = "SERVICE:unreadable";
1994
- function Ee(e) {
2028
+ ), Kr = "SERVICE:unreadable";
2029
+ function Re(e) {
1995
2030
  const n = e.attachments ?? [];
1996
2031
  return {
1997
- propertyID: Dn(e.id, n),
2032
+ propertyID: Fn(e.id, n),
1998
2033
  name: e.name,
1999
2034
  value: {
2000
2035
  id: e.id,
2001
2036
  price: e.sellingPrice / 100,
2002
2037
  attachments: n
2003
2038
  },
2004
- valueReference: M.service
2039
+ valueReference: V.service
2005
2040
  };
2006
2041
  }
2007
- const qr = (e) => {
2042
+ const Qr = (e) => {
2008
2043
  try {
2009
2044
  return JSON.parse(e);
2010
2045
  } catch {
2011
2046
  return null;
2012
2047
  }
2013
- }, jr = (e) => {
2014
- const n = typeof e == "string" ? qr(e) : e;
2048
+ }, Zr = (e) => {
2049
+ const n = typeof e == "string" ? Qr(e) : e;
2015
2050
  if (n === null || typeof n != "object")
2016
2051
  return null;
2017
2052
  const { id: t, attachments: r } = n;
2018
2053
  return typeof t != "string" && typeof t != "number" ? null : { id: String(t), attachments: r };
2019
2054
  };
2020
- function Wr(e) {
2021
- const n = jr(e.value);
2022
- return n ? Dn(
2055
+ function ei(e) {
2056
+ const n = Zr(e.value);
2057
+ return n ? Fn(
2023
2058
  n.id,
2024
2059
  Array.isArray(n.attachments) ? n.attachments : []
2025
- ) : xr;
2060
+ ) : Kr;
2026
2061
  }
2027
- const Gr = (e) => {
2062
+ const ni = (e) => {
2028
2063
  const n = e.postalCode, t = e.geoCoordinates, r = {
2029
2064
  addressType: e.addressType || null,
2030
2065
  postalCode: n || null,
@@ -2043,7 +2078,7 @@ const Gr = (e) => {
2043
2078
  r.geoCoordinates = i !== null && a !== null ? [a, i] : [];
2044
2079
  }
2045
2080
  return [r];
2046
- }, Hr = (e, n, t) => {
2081
+ }, ti = (e, n, t) => {
2047
2082
  const r = n.postalCode, i = n.geoCoordinates, a = e?.shippingData?.availableAddresses ?? [], o = e?.shippingData?.selectedAddresses ?? [];
2048
2083
  if (!t && o.length > 0)
2049
2084
  return [o[0]];
@@ -2057,36 +2092,36 @@ const Gr = (e) => {
2057
2092
  return [s];
2058
2093
  }
2059
2094
  return null;
2060
- }, Pn = (e, n) => {
2061
- if (!Xr(n))
2095
+ }, Nn = (e, n) => {
2096
+ if (!ri(n))
2062
2097
  return { updateShipping: !1, addressChanged: !1 };
2063
- if (!Qr(e))
2098
+ if (!si(e))
2064
2099
  return { updateShipping: !1, addressChanged: !1 };
2065
2100
  const [t] = e?.shippingData?.selectedAddresses ?? [];
2066
- if (Yr(t, n.postalCode) || Jr(t, n.geoCoordinates) || Kr(t, n.addressType))
2101
+ if (ii(t, n.postalCode) || ai(t, n.geoCoordinates) || oi(t, n.addressType))
2067
2102
  return { updateShipping: !0, addressChanged: !0 };
2068
2103
  const { logisticsInfo: r } = e.shippingData;
2069
- return Zr(r, n) ? { updateShipping: !0, addressChanged: !1 } : { updateShipping: !1, addressChanged: !1 };
2070
- }, Xr = (e) => !!e.postalCode || e.geoCoordinates?.latitude && e.geoCoordinates?.longitude, Yr = (e, n) => typeof n == "string" && e?.postalCode !== n, Jr = (e, n) => typeof n?.latitude == "number" && typeof n?.longitude == "number" && (e?.geoCoordinates[0] !== n?.longitude || e?.geoCoordinates[1] !== n?.latitude), Kr = (e, n) => typeof n == "string" && e?.addressType !== n, Qr = (e) => e.items.length !== 0, Zr = (e, n) => {
2104
+ return ci(r, n) ? { updateShipping: !0, addressChanged: !1 } : { updateShipping: !1, addressChanged: !1 };
2105
+ }, ri = (e) => !!e.postalCode || e.geoCoordinates?.latitude && e.geoCoordinates?.longitude, ii = (e, n) => typeof n == "string" && e?.postalCode !== n, ai = (e, n) => typeof n?.latitude == "number" && typeof n?.longitude == "number" && (e?.geoCoordinates[0] !== n?.longitude || e?.geoCoordinates[1] !== n?.latitude), oi = (e, n) => typeof n == "string" && e?.addressType !== n, si = (e) => e.items.length !== 0, ci = (e, n) => {
2071
2106
  const t = n?.deliveryMode?.deliveryChannel, r = n?.deliveryMode?.deliveryMethod, { startDate: i, endDate: a } = n?.deliveryMode?.deliveryWindow || {};
2072
2107
  return e.some(
2073
2108
  ({ selectedDeliveryChannel: o, selectedSla: s, slas: c }) => {
2074
- const u = t && o !== t, d = r && s !== r;
2075
- return c?.some((g) => u && g.deliveryChannel === t || d && g.id === r ? !0 : i && a && g.deliveryChannel === t && g.id === r && (!g?.deliveryWindow || g?.deliveryWindow?.startDateUtc !== i || g?.deliveryWindow?.endDateUtc !== a) && g.availableDeliveryWindows?.some(
2109
+ const d = t && o !== t, g = r && s !== r;
2110
+ return c?.some((p) => d && p.deliveryChannel === t || g && p.id === r ? !0 : i && a && p.deliveryChannel === t && p.id === r && (!p?.deliveryWindow || p?.deliveryWindow?.startDateUtc !== i || p?.deliveryWindow?.endDateUtc !== a) && p.availableDeliveryWindows?.some(
2076
2111
  (f) => f?.startDateUtc === i && f?.endDateUtc === a
2077
2112
  ));
2078
2113
  }
2079
2114
  );
2080
- }, En = (e) => e.valueReference === M.attachment, ei = (e) => e.valueReference === M.service, ni = (e) => (e.itemOffered.additionalProperty ?? []).filter(ei).map(Wr).sort((n, t) => n.localeCompare(t)), kn = (e) => {
2081
- const n = ni(e);
2115
+ }, Ln = (e) => e.valueReference === V.attachment, li = (e) => e.valueReference === V.service, di = (e) => (e.itemOffered.additionalProperty ?? []).filter(li).map(ei).sort((n, t) => n.localeCompare(t)), Bn = (e) => {
2116
+ const n = di(e);
2082
2117
  return n.length > 0 ? `services:${n.join("-")}` : void 0;
2083
- }, Oe = (e) => [
2118
+ }, Ae = (e) => [
2084
2119
  e.itemOffered.sku,
2085
2120
  e.seller.identifier,
2086
2121
  e.price < 0.01 ? "Gift" : void 0,
2087
- e.itemOffered.additionalProperty?.filter(En).map(wn).join("-"),
2088
- kn(e)
2089
- ].filter(Boolean).join("::"), le = (e, n) => ({
2122
+ e.itemOffered.additionalProperty?.filter(Ln).map(Rn).join("-"),
2123
+ Bn(e)
2124
+ ].filter(Boolean).join("::"), ge = (e, n) => ({
2090
2125
  listPrice: e.listPrice / 100,
2091
2126
  price: e.sellingPrice / 100,
2092
2127
  quantity: e.quantity,
@@ -2096,49 +2131,49 @@ const Gr = (e) => {
2096
2131
  image: [],
2097
2132
  name: e.name,
2098
2133
  additionalProperty: [
2099
- ...e.attachments.map(Cn),
2100
- ...(e.bundleItems ?? []).map(Ee)
2134
+ ...e.attachments.map(Un),
2135
+ ...(e.bundleItems ?? []).map(Re)
2101
2136
  ]
2102
2137
  },
2103
2138
  index: n
2104
- }), ti = (e) => ({
2139
+ }), ui = (e) => ({
2105
2140
  quantity: e.quantity,
2106
2141
  seller: e.seller.identifier,
2107
2142
  id: e.itemOffered.sku,
2108
2143
  index: e.index,
2109
- attachments: (e.itemOffered.additionalProperty?.filter(En) ?? []).map((n) => ({
2144
+ attachments: (e.itemOffered.additionalProperty?.filter(Ln) ?? []).map((n) => ({
2110
2145
  name: n.name,
2111
2146
  content: n.value
2112
2147
  })),
2113
2148
  ...e.priceToken ? { priceToken: e.priceToken } : {}
2114
- }), He = (e) => e.reduce((n, t) => {
2115
- const r = Oe(t);
2149
+ }), Je = (e) => e.reduce((n, t) => {
2150
+ const r = Ae(t);
2116
2151
  return n.has(r) || n.set(r, []), n.get(r)?.push(t), n;
2117
- }, /* @__PURE__ */ new Map()), ri = (e, n) => {
2118
- const t = ({ priceToken: s, ...c }, u) => ({
2152
+ }, /* @__PURE__ */ new Map()), pi = (e, n) => {
2153
+ const t = ({ priceToken: s, ...c }, d) => ({
2119
2154
  ...c,
2120
2155
  itemOffered: {
2121
2156
  sku: c.itemOffered.sku
2122
2157
  },
2123
- services: kn(c),
2124
- index: u
2125
- }), r = n.items.map(le).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o = De(r, i);
2158
+ services: Bn(c),
2159
+ index: d
2160
+ }), r = n.items.map(ge).map(t), i = e.acceptedOffer.map(t), a = e.orderNumber === n.orderFormId, o = _e(r, i);
2126
2161
  return a && o;
2127
2162
  };
2128
- function _n(e, n) {
2163
+ function $n(e, n) {
2129
2164
  return e?.some(
2130
2165
  (t) => t.parentItemIndex !== null && t.parentItemIndex !== void 0 && e[t.parentItemIndex]?.id === n
2131
2166
  );
2132
2167
  }
2133
- function Un(e, n) {
2168
+ function Mn(e, n) {
2134
2169
  return e?.some(
2135
2170
  (t) => t.id === n && t.parentItemIndex !== null
2136
2171
  );
2137
2172
  }
2138
- const Xe = (e) => {
2173
+ const Ke = (e) => {
2139
2174
  const n = e.items.reduce(
2140
2175
  (t, r, i) => {
2141
- const a = Un(e.items, r.id) || _n(e.items, r.id) ? `${Oe(le(r))}::${i}` : Oe(le(r));
2176
+ const a = Mn(e.items, r.id) || $n(e.items, r.id) ? `${Ae(ge(r))}::${i}` : Ae(ge(r));
2142
2177
  return t[a] || (t[a] = []), t[a].push(r), t;
2143
2178
  },
2144
2179
  {}
@@ -2157,7 +2192,7 @@ const Xe = (e) => {
2157
2192
  };
2158
2193
  })
2159
2194
  };
2160
- }, be = async (e, n, t, r) => ({
2195
+ }, De = async (e, n, t, r) => ({
2161
2196
  order: {
2162
2197
  orderNumber: e.orderFormId,
2163
2198
  acceptedOffer: e.items.map(async (i) => ({
@@ -2171,9 +2206,9 @@ const Xe = (e) => {
2171
2206
  text: i,
2172
2207
  status: a.toUpperCase()
2173
2208
  }))
2174
- }), Tn = ({ items: e }, n) => {
2209
+ }), zn = ({ items: e }, n) => {
2175
2210
  const t = e.map((r) => {
2176
- const i = (r.bundleItems ?? []).map(Ee).map(({ propertyID: a }) => a).sort((a, o) => a.localeCompare(o));
2211
+ const i = (r.bundleItems ?? []).map(Re).map(({ propertyID: a }) => a).sort((a, o) => a.localeCompare(o));
2177
2212
  return {
2178
2213
  id: r.id,
2179
2214
  quantity: r.quantity,
@@ -2183,16 +2218,16 @@ const Xe = (e) => {
2183
2218
  ...i.length > 0 ? { services: i } : {}
2184
2219
  };
2185
2220
  });
2186
- return Pe(
2221
+ return Ue(
2187
2222
  JSON.stringify({ sessionId: n?.id ?? "", items: t })
2188
2223
  );
2189
- }, Ye = async (e, n, t) => {
2224
+ }, Qe = async (e, n, t) => {
2190
2225
  try {
2191
2226
  return await n.checkout.setCustomData({
2192
2227
  id: e.orderFormId,
2193
2228
  appId: "faststore",
2194
2229
  key: "cartEtag",
2195
- value: Tn(e, t)
2230
+ value: zn(e, t)
2196
2231
  });
2197
2232
  } catch (r) {
2198
2233
  throw console.error(
@@ -2202,22 +2237,22 @@ const Xe = (e) => {
2202
2237
  More info at: https://developers.vtex.com/vtex-rest-api/docs/customizable-fields-with-checkout-api`
2203
2238
  ), r;
2204
2239
  }
2205
- }, ii = (e, n) => {
2240
+ }, gi = (e, n) => {
2206
2241
  const r = e.customData?.customApps.find(
2207
2242
  (a) => a.id === "faststore"
2208
2243
  )?.fields?.cartEtag;
2209
- return r == null ? !0 : Tn(e, n) !== r;
2210
- }, ai = async (e, { clients: { commerce: n } }) => n.checkout.clearOrderFormMessages({
2244
+ return r == null ? !0 : zn(e, n) !== r;
2245
+ }, mi = async (e, { clients: { commerce: n } }) => n.checkout.clearOrderFormMessages({
2211
2246
  id: e
2212
- }), Je = async (e, n, { clients: { commerce: t } }) => {
2247
+ }), Ze = async (e, n, { clients: { commerce: t } }) => {
2213
2248
  if (!n)
2214
2249
  return e;
2215
- const { updateShipping: r, addressChanged: i } = Pn(
2250
+ const { updateShipping: r, addressChanged: i } = Nn(
2216
2251
  e,
2217
2252
  n
2218
2253
  );
2219
2254
  if (r) {
2220
- const a = Hr(e, n, i), s = a || Gr(n);
2255
+ const a = ti(e, n, i), s = a || ni(n);
2221
2256
  return !!n.deliveryMode?.deliveryWindow && await t.checkout.shippingData(
2222
2257
  {
2223
2258
  id: e.orderFormId,
@@ -2237,164 +2272,175 @@ const Xe = (e) => {
2237
2272
  );
2238
2273
  }
2239
2274
  return e;
2240
- }, oi = (e, n) => {
2275
+ }, hi = (e, n) => {
2241
2276
  if (!e)
2242
2277
  return "";
2243
- const r = Z(e)[n];
2278
+ const r = re(e)[n];
2244
2279
  return r ? r.split("=")[1] : "";
2245
- }, Ke = (e, n) => {
2246
- const t = Lr(
2280
+ }, fi = async (e, n, t, r) => {
2281
+ const { commerce: i } = e.clients, a = await i.checkout.orderForm({
2282
+ id: n,
2283
+ channel: e.storage.channel,
2284
+ preserveSalesChannel: !!n && !t
2285
+ });
2286
+ return !n || xr(
2287
+ a,
2288
+ e.storage.channel.salesChannel,
2289
+ r
2290
+ ) ? a : i.checkout.orderForm({
2291
+ id: n,
2292
+ channel: e.storage.channel
2293
+ });
2294
+ }, en = (e, n, t) => {
2295
+ if (!t || n.items.length === 0)
2296
+ return null;
2297
+ const r = qr(
2247
2298
  e.storage.channel,
2248
2299
  n.salesChannel
2249
2300
  );
2250
- return t ? (ce(e, t), n.salesChannel ? String(n.salesChannel) : null) : null;
2251
- }, Qe = (e, n, t, r) => r ? be(e, n, t, r) : null, si = async (e, { cart: { order: n }, session: t }, r) => {
2252
- const i = oi(
2301
+ return r ? (pe(e, r), n.salesChannel ? String(n.salesChannel) : null) : null;
2302
+ }, nn = (e, n, t, r) => r ? De(e, n, t, r) : null, Si = async (e, { cart: { order: n }, session: t }, r) => {
2303
+ const i = hi(
2253
2304
  r.headers.cookie,
2254
2305
  "checkout.vtex.com"
2255
2306
  ), {
2256
2307
  clients: { commerce: a },
2257
2308
  loaders: { skuLoader: o }
2258
- } = r, s = t?.channel, c = t?.locale;
2259
- s && ce(r, s), c && ve(r, c);
2260
- const u = i || void 0, d = await a.checkout.orderForm({
2261
- id: u,
2262
- channel: r.storage.channel,
2263
- preserveSalesChannel: !!u
2264
- }), g = d.orderFormId;
2265
- d.messages.length !== 0 && await ai(g, r);
2266
- const f = Z(r?.headers?.cookie ?? "")?.vtex_session, h = x(f), { acceptedOffer: v, shouldSplitItem: l } = n;
2267
- if (ii(d, h)) {
2268
- const b = Ke(
2309
+ } = r, s = t?.channel, c = t?.locale, d = En(s, {
2310
+ localizationEnabled: kn(r.discoveryConfig)
2311
+ }) === "url", g = _n(s);
2312
+ s && pe(r, s), c && we(r, c);
2313
+ const p = await fi(
2314
+ r,
2315
+ i || void 0,
2316
+ d,
2317
+ g
2318
+ ), f = p.orderFormId;
2319
+ p.messages.length !== 0 && await mi(f, r);
2320
+ const h = re(r?.headers?.cookie ?? "")?.vtex_session, v = j(h), { acceptedOffer: l, shouldSplitItem: u } = n;
2321
+ if (gi(p, v)) {
2322
+ const A = en(
2269
2323
  r,
2270
- d
2271
- ), N = await Ye(
2272
- d,
2324
+ p,
2325
+ !d
2326
+ ), N = await Qe(
2327
+ p,
2273
2328
  a,
2274
- h
2275
- ).then(Xe);
2276
- if (g)
2277
- return be(
2329
+ v
2330
+ ).then(Ke);
2331
+ if (f)
2332
+ return De(
2278
2333
  N,
2279
2334
  o,
2280
- l,
2281
- b
2335
+ u,
2336
+ A
2282
2337
  );
2283
2338
  }
2284
- const m = Ke(
2339
+ const S = en(
2285
2340
  r,
2286
- d
2287
- ), S = He(v), O = He(d.items.map(le)), w = Array.from(O.entries()), C = Array.from(S.entries()), { itemsToAdd: _, itemsToUpdate: I } = C.reduce(
2288
- (b, [N, ke]) => {
2289
- const _e = O.get(N);
2290
- if (!_e)
2291
- return ke.forEach((G) => b.itemsToAdd.push(G)), b;
2292
- const [te, ...Mn] = _e;
2293
- if (Un(d.items, te.itemOffered.sku) || _n(d.items, te.itemOffered.sku))
2294
- return b.itemsToUpdate.push(te), b;
2295
- const zn = ke.reduce((G, Vn) => G + Vn.quantity, 0);
2296
- return b.itemsToUpdate.push({
2297
- ...te,
2298
- quantity: zn
2299
- }), Mn.forEach((G) => b.itemsToUpdate.push({ ...G, quantity: 0 })), b;
2341
+ p,
2342
+ !d
2343
+ ), O = Je(l), b = Je(p.items.map(ge)), C = Array.from(b.entries()), _ = Array.from(O.entries()), { itemsToAdd: I, itemsToUpdate: w } = _.reduce(
2344
+ (A, [N, Y]) => {
2345
+ const ae = b.get(N);
2346
+ if (!ae)
2347
+ return Y.forEach((J) => A.itemsToAdd.push(J)), A;
2348
+ const [B, ...oe] = ae;
2349
+ if (Mn(p.items, B.itemOffered.sku) || $n(p.items, B.itemOffered.sku))
2350
+ return A.itemsToUpdate.push(B), A;
2351
+ const Hn = Y.reduce((J, Xn) => J + Xn.quantity, 0);
2352
+ return A.itemsToUpdate.push({
2353
+ ...B,
2354
+ quantity: Hn
2355
+ }), oe.forEach((J) => A.itemsToUpdate.push({ ...J, quantity: 0 })), A;
2300
2356
  },
2301
2357
  {
2302
2358
  itemsToAdd: [],
2303
2359
  itemsToUpdate: []
2304
2360
  }
2305
- ), A = w.filter(([b]) => !S.has(b)).flatMap(([, b]) => b.map((N) => ({ ...N, quantity: 0 }))), D = [..._, ...I, ...A].map(
2306
- ti
2307
- ), { updateShipping: E } = t ? Pn(d, t) : { updateShipping: !1 };
2308
- if (D.length === 0 && !E)
2309
- return Qe(
2310
- d,
2361
+ ), E = C.filter(([A]) => !O.has(A)).flatMap(([, A]) => A.map((N) => ({ ...N, quantity: 0 }))), D = [...I, ...w, ...E].map(
2362
+ ui
2363
+ ), { updateShipping: R } = t ? Nn(p, t) : { updateShipping: !1 };
2364
+ if (D.length === 0 && !R)
2365
+ return nn(
2366
+ p,
2311
2367
  o,
2312
- l,
2313
- m
2368
+ u,
2369
+ S
2314
2370
  );
2315
2371
  let P;
2316
2372
  D.length > 0 ? P = await a.checkout.updateOrderFormItems({
2317
- id: d.orderFormId,
2373
+ id: p.orderFormId,
2318
2374
  orderItems: D,
2319
- shouldSplitItem: l
2375
+ shouldSplitItem: u
2320
2376
  }).then(
2321
- (b) => Je(b, t, r)
2322
- ) : P = await Je(
2323
- d,
2377
+ (A) => Ze(A, t, r)
2378
+ ) : P = await Ze(
2379
+ p,
2324
2380
  t,
2325
2381
  r
2326
- ), P = await Promise.resolve(P).then((b) => {
2382
+ ), P = await Promise.resolve(P).then((A) => {
2327
2383
  if (t?.marketingData) {
2328
2384
  const N = {
2329
- ...b.marketingData,
2385
+ ...A.marketingData,
2330
2386
  ...t.marketingData
2331
2387
  };
2332
2388
  return a.checkout.marketingData({
2333
- id: d.orderFormId,
2389
+ id: p.orderFormId,
2334
2390
  marketingData: N
2335
2391
  });
2336
2392
  }
2337
- return b;
2338
- }).then((b) => c && b.clientPreferencesData?.locale !== c ? a.checkout.clientPreferencesData({
2339
- id: b.orderFormId,
2393
+ return A;
2394
+ }).then((A) => c && A.clientPreferencesData?.locale !== c ? a.checkout.clientPreferencesData({
2395
+ id: A.orderFormId,
2340
2396
  clientPreferencesData: {
2341
- ...b.clientPreferencesData,
2397
+ ...A.clientPreferencesData,
2342
2398
  locale: c
2343
2399
  }
2344
- }) : b).then((b) => Ye(b, a, h)).then(Xe);
2345
- const R = De(
2346
- d.messages,
2400
+ }) : A).then((A) => Qe(A, a, v)).then(Ke);
2401
+ const U = _e(
2402
+ p.messages,
2347
2403
  P.messages
2348
2404
  );
2349
- return ri(n, P) && R ? Qe(
2405
+ return pi(n, P) && U ? nn(
2350
2406
  P,
2351
2407
  o,
2352
- l,
2353
- m
2354
- ) : be(
2408
+ u,
2409
+ S
2410
+ ) : De(
2355
2411
  P,
2356
2412
  o,
2357
- l,
2358
- m
2413
+ u,
2414
+ S
2359
2415
  );
2360
- };
2361
- function ci(e, n, t, r) {
2362
- const i = e.hasOnlyDefaultSalesChannel === !1, a = n ?? void 0, o = t ?? e.regionId;
2363
- return ne.stringify({
2364
- salesChannel: i ? e.salesChannel || a : a ?? e.salesChannel,
2365
- regionId: o ?? void 0,
2366
- seller: r,
2367
- hasOnlyDefaultSalesChannel: i ? !1 : !a
2368
- });
2369
- }
2370
- const li = (e) => {
2416
+ }, yi = (e) => {
2371
2417
  const n = (e?.corporateName ?? "").trim();
2372
2418
  return n || (e?.firstName ?? "").trim();
2373
- }, di = (e) => {
2419
+ }, Ii = (e) => {
2374
2420
  if (!e || typeof e != "object")
2375
2421
  return !1;
2376
2422
  const n = e;
2377
2423
  return typeof n.customerId == "string" && n.customerId.trim() !== "" && typeof n.contractName == "string" && typeof n.isActive == "boolean" && typeof n.isCurrent == "boolean";
2378
- }, ui = (e) => {
2424
+ }, vi = (e) => {
2379
2425
  const n = e?.availableContracts?.value;
2380
- return Array.isArray(n) ? n.filter(di) : [];
2381
- }, pi = (e) => e?.customerId ? !!((e.contractName ?? "").trim() && e.isActive) : !1, Ze = (e) => e?.namespaces?.shopper?.activeContractId?.value?.trim() ?? e?.namespaces?.authentication?.customerId?.value?.trim() ?? e?.namespaces?.profile?.id?.value?.trim() ?? "", gi = (e) => {
2426
+ return Array.isArray(n) ? n.filter(Ii) : [];
2427
+ }, Oi = (e) => e?.customerId ? !!((e.contractName ?? "").trim() && e.isActive) : !1, tn = (e) => e?.namespaces?.shopper?.activeContractId?.value?.trim() ?? e?.namespaces?.authentication?.customerId?.value?.trim() ?? e?.namespaces?.profile?.id?.value?.trim() ?? "", Ci = (e) => {
2382
2428
  if (!Array.isArray(e) || e.length === 0) return "";
2383
2429
  const n = e.find((t) => t?.isDefault === !0) ?? e[0];
2384
2430
  return String(n?.id ?? "").trim();
2385
- }, mi = (e, n = "", t = "") => {
2431
+ }, bi = (e, n = "", t = "") => {
2386
2432
  const r = n.trim(), i = t.trim();
2387
- return e.filter(pi).map((a) => ({
2433
+ return e.filter(Oi).map((a) => ({
2388
2434
  id: a.customerId,
2389
2435
  corporateName: a.contractName.trim(),
2390
2436
  isActive: r ? a.customerId === r : a.isCurrent,
2391
2437
  isDefault: i !== "" && a.customerId === i
2392
2438
  }));
2393
- }, Rn = (e, n) => {
2394
- const t = li(e);
2439
+ }, Vn = (e, n) => {
2440
+ const t = yi(e);
2395
2441
  return t || (n?.firstName?.value ?? "").trim();
2396
2442
  };
2397
- async function hi(e, n, t) {
2443
+ async function wi(e, n, t) {
2398
2444
  try {
2399
2445
  const r = await e.commerce.checkout.address({
2400
2446
  postalCode: t,
@@ -2411,7 +2457,7 @@ async function hi(e, n, t) {
2411
2457
  ), r;
2412
2458
  }
2413
2459
  }
2414
- function fi(e, n, t, r, i, a) {
2460
+ function Ai(e, n, t, r, i, a) {
2415
2461
  const o = new URLSearchParams(e);
2416
2462
  return o.has("facets") && o.delete("facets"), o.set("sc", o.get("sc") ?? n.salesChannel), t && o.set("postalCode", t), r && o.set("country", r), i && o.set(
2417
2463
  "geoCoordinates",
@@ -2419,7 +2465,7 @@ function fi(e, n, t, r, i, a) {
2419
2465
  // long,lat is the format expected
2420
2466
  ), o.set("locale", a), o;
2421
2467
  }
2422
- function Si(e, n) {
2468
+ function Di(e, n) {
2423
2469
  return {
2424
2470
  utmCampaign: e.get("utm_campaign") ?? n?.utmCampaign ?? "",
2425
2471
  utmMedium: e.get("utm_medium") ?? n?.utmMedium ?? "",
@@ -2429,8 +2475,8 @@ function Si(e, n) {
2429
2475
  utmiPart: e.get("utmi_pc") ?? n?.utmiPart ?? ""
2430
2476
  };
2431
2477
  }
2432
- async function yi(e, n, t) {
2433
- const r = x(L(n ?? "", t));
2478
+ async function Pi(e, n, t) {
2479
+ const r = j($(n ?? "", t));
2434
2480
  let i = !1;
2435
2481
  if (r)
2436
2482
  try {
@@ -2444,7 +2490,7 @@ async function yi(e, n, t) {
2444
2490
  unitId: i ? r?.unitId : void 0
2445
2491
  };
2446
2492
  }
2447
- async function Ii(e, n, t, r, i, a) {
2493
+ async function Ei(e, n, t, r, i, a) {
2448
2494
  return !n.seller || !(t || r) ? void 0 : (await e.commerce.checkout.region({
2449
2495
  postalCode: t,
2450
2496
  geoCoordinates: r,
@@ -2452,13 +2498,13 @@ async function Ii(e, n, t, r, i, a) {
2452
2498
  salesChannel: a
2453
2499
  }))?.[0]?.sellers.find((c) => n.seller === c.id)?.id;
2454
2500
  }
2455
- function en(e) {
2501
+ function rn(e) {
2456
2502
  return typeof e?.value == "string" ? e.value : "";
2457
2503
  }
2458
- function vi(e) {
2504
+ function ki(e) {
2459
2505
  if (!e.isRepresentative)
2460
2506
  return null;
2461
- const n = en(e.shopper?.firstName), t = en(e.shopper?.lastName);
2507
+ const n = rn(e.shopper?.firstName), t = rn(e.shopper?.lastName);
2462
2508
  return {
2463
2509
  isRepresentative: !0,
2464
2510
  customerId: e.authentication?.customerId?.value ?? e.customerId ?? "",
@@ -2469,11 +2515,11 @@ function vi(e) {
2469
2515
  userName: `${n} ${t}`.trim(),
2470
2516
  userEmail: e.authentication?.storeUserEmail?.value ?? "",
2471
2517
  savedPostalCode: e.publicData?.postalCode?.value ?? "",
2472
- contractName: Rn(e.contract, e.profile),
2518
+ contractName: Vn(e.contract, e.profile),
2473
2519
  organizationManager: e.shopper?.organizationManager?.value ?? !1
2474
2520
  };
2475
2521
  }
2476
- function Oi(e) {
2522
+ function _i(e) {
2477
2523
  return e?.id ? {
2478
2524
  id: e.id?.value ?? "",
2479
2525
  email: e.email?.value ?? "",
@@ -2481,60 +2527,108 @@ function Oi(e) {
2481
2527
  familyName: e.lastName?.value ?? ""
2482
2528
  } : null;
2483
2529
  }
2484
- const bi = async (e, { session: n, search: t }, { clients: r, headers: i, account: a }) => {
2485
- const o = ne.parse(n.channel ?? ""), s = String(n.postalCode ?? ""), c = n.country ?? "";
2486
- let u = n.city ?? null, d = n.geoCoordinates ?? null;
2487
- if ((!u || !d) && s !== "" && c !== "") {
2488
- const P = await hi(
2489
- r,
2530
+ const Ui = (e) => e instanceof X && (e.extensions.status === 401 || e.extensions.status === 403), Ri = (e) => e instanceof Error && /sales\s*channel/i.test(e.message), Ti = (e, n, t, r) => {
2531
+ if (n !== "orderForm" || t !== r)
2532
+ return !1;
2533
+ if (Ri(e))
2534
+ return !0;
2535
+ const i = `[validateSession] Session Manager rejected adopted sales channel ${t} with an unrecognized error; keeping the adoption.`, a = e instanceof Error ? e.message : e;
2536
+ return console.warn(i, a), fn("warn", "%s %o", i, a), !1;
2537
+ }, Fi = async (e, n, t, r) => {
2538
+ const i = { salesChannelSource: t, rejectedSalesChannel: void 0 };
2539
+ try {
2540
+ return {
2541
+ ...i,
2542
+ sessionData: await e.commerce.session(n.toString())
2543
+ };
2544
+ } catch (a) {
2545
+ if (t === "url" || !Ui(a))
2546
+ return { ...i, sessionData: null };
2547
+ const o = n.get("sc") ?? void 0, s = Ti(
2548
+ a,
2549
+ t,
2550
+ o,
2551
+ r
2552
+ );
2553
+ n.delete("sc");
2554
+ const c = await e.commerce.session(n.toString()).catch(() => null);
2555
+ return !c || !s ? { ...i, sessionData: c } : {
2556
+ sessionData: c,
2557
+ salesChannelSource: void 0,
2558
+ rejectedSalesChannel: o
2559
+ };
2560
+ }
2561
+ }, Ni = async (e, { session: n, search: t }, { clients: r, headers: i, account: a, storage: o, discoveryConfig: s }) => {
2562
+ const c = ie.parse(n.channel ?? ""), d = En(n.channel, {
2563
+ localizationEnabled: kn(s)
2564
+ }), g = {
2565
+ ...c,
2566
+ salesChannel: Wr(
2490
2567
  c,
2491
- s
2568
+ d,
2569
+ o?.channel?.salesChannel ? String(o.channel.salesChannel) : void 0,
2570
+ t
2571
+ )
2572
+ }, p = String(n.postalCode ?? ""), f = n.country ?? "";
2573
+ let h = n.city ?? null, v = n.geoCoordinates ?? null;
2574
+ if ((!h || !v) && p !== "" && f !== "") {
2575
+ const oe = await wi(
2576
+ r,
2577
+ f,
2578
+ p
2492
2579
  );
2493
- u = P.city, d = P.geoCoordinates;
2580
+ h = oe.city, v = oe.geoCoordinates;
2494
2581
  }
2495
- const f = fi(
2582
+ const u = Ai(
2496
2583
  t,
2497
- o,
2498
- s,
2499
- c,
2500
- d,
2584
+ g,
2585
+ p,
2586
+ f,
2587
+ v,
2501
2588
  n.locale
2502
- ), h = Si(f, n.marketingData), { isRepresentative: v, customerId: l, unitId: p } = await yi(
2589
+ ), m = Di(u, n.marketingData), { isRepresentative: S, customerId: O, unitId: b } = await Pi(
2503
2590
  r,
2504
2591
  i?.cookie,
2505
2592
  a
2506
- ), m = await r.commerce.session(f.toString()).catch(() => null), S = m?.namespaces.profile ?? null, O = m?.namespaces.shopper ?? null, w = m?.namespaces.store ?? null, C = m?.namespaces.authentication ?? null, _ = m?.namespaces.checkout ?? null, I = m?.namespaces.public ?? null;
2593
+ ), { sessionData: C, salesChannelSource: _, rejectedSalesChannel: I } = await Fi(
2594
+ r,
2595
+ u,
2596
+ d,
2597
+ String(g.salesChannel ?? "")
2598
+ ), w = C?.namespaces.profile ?? null, E = C?.namespaces.shopper ?? null, D = C?.namespaces.store ?? null, R = C?.namespaces.authentication ?? null, P = C?.namespaces.checkout ?? null, U = C?.namespaces.public ?? null;
2507
2599
  let A = null;
2508
- if (v && S?.id?.value)
2600
+ if (S && w?.id?.value)
2509
2601
  try {
2510
2602
  A = await r.commerce.masterData.getContractById({
2511
- contractId: S.id.value
2603
+ contractId: w.id.value
2512
2604
  });
2513
2605
  } catch {
2514
2606
  console.error(
2515
- `Error while getting contract data for profile ID (${S.id.value}).
2607
+ `Error while getting contract data for profile ID (${w.id.value}).
2516
2608
  `
2517
2609
  );
2518
2610
  }
2519
- const D = await Ii(
2611
+ const N = await Ei(
2520
2612
  r,
2521
- o,
2522
- s,
2523
- d,
2524
- c,
2525
- f.get("sc") ?? o.salesChannel
2526
- ), E = {
2613
+ g,
2614
+ p,
2615
+ v,
2616
+ f,
2617
+ u.get("sc") ?? D?.channel?.value ?? g.salesChannel
2618
+ ), Y = _i(w), ae = (n.person?.id ?? null) === (Y?.id ?? null) ? _n(n.channel) : void 0, B = {
2527
2619
  ...n,
2528
2620
  currency: {
2529
- code: w?.currencyCode?.value ?? n.currency.code,
2530
- symbol: w?.currencySymbol?.value ?? n.currency.symbol
2621
+ code: D?.currencyCode?.value ?? n.currency.code,
2622
+ symbol: D?.currencySymbol?.value ?? n.currency.symbol
2531
2623
  },
2532
- country: w?.countryCode?.value ?? c,
2533
- channel: ci(
2534
- o,
2535
- w?.channel?.value,
2536
- _?.regionId?.value,
2537
- D
2624
+ country: D?.countryCode?.value ?? f,
2625
+ channel: jr(
2626
+ g,
2627
+ D?.channel?.value,
2628
+ P?.regionId?.value,
2629
+ N,
2630
+ _,
2631
+ I ?? ae
2538
2632
  ),
2539
2633
  /**
2540
2634
  * B2B data structure in Session:
@@ -2542,53 +2636,53 @@ const bi = async (e, { session: n, search: t }, { clients: r, headers: i, accoun
2542
2636
  * - Unit data: `authentication` namespace
2543
2637
  * - Contract data: `profile` namespace (those info will be available inside Faststore's Session `person` object)
2544
2638
  */
2545
- b2b: vi({
2546
- isRepresentative: v,
2547
- authentication: C,
2548
- shopper: O,
2549
- publicData: I,
2550
- profile: S,
2639
+ b2b: ki({
2640
+ isRepresentative: S,
2641
+ authentication: R,
2642
+ shopper: E,
2643
+ publicData: U,
2644
+ profile: w,
2551
2645
  contract: A,
2552
- customerId: l,
2553
- unitId: p
2646
+ customerId: O,
2647
+ unitId: b
2554
2648
  }),
2555
- marketingData: h,
2556
- person: Oi(S),
2557
- geoCoordinates: d?.latitude && d?.longitude && d || null,
2558
- city: u
2649
+ marketingData: m,
2650
+ person: Y,
2651
+ geoCoordinates: v?.latitude && v?.longitude && v || null,
2652
+ city: h
2559
2653
  };
2560
- return De(n, E) ? null : E;
2561
- }, Ci = {
2562
- validateCart: si,
2563
- validateSession: bi,
2564
- subscribeToNewsletter: Fr,
2565
- cancelOrder: kr,
2566
- processOrderAuthorization: Ur,
2567
- uploadFileToOrderEntry: Nr,
2568
- startOrderEntryOperation: Tr,
2569
- startRecommendationSession: Rr
2654
+ return _e(n, B) ? null : B;
2655
+ }, Li = {
2656
+ validateCart: Si,
2657
+ validateSession: Ni,
2658
+ subscribeToNewsletter: zr,
2659
+ cancelOrder: Nr,
2660
+ processOrderAuthorization: Br,
2661
+ uploadFileToOrderEntry: Vr,
2662
+ startOrderEntryOperation: $r,
2663
+ startRecommendationSession: Mr
2570
2664
  };
2571
- var Ce;
2665
+ var Pe;
2572
2666
  (function(e) {
2573
2667
  e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
2574
- })(Ce || (Ce = {}));
2575
- const wi = (e) => typeof e == "string" ? Fn(e) : null;
2576
- function Fn(e) {
2668
+ })(Pe || (Pe = {}));
2669
+ const Bi = (e) => typeof e == "string" ? qn(e) : null;
2670
+ function qn(e) {
2577
2671
  try {
2578
2672
  return JSON.parse(e);
2579
2673
  } catch {
2580
2674
  return e;
2581
2675
  }
2582
2676
  }
2583
- const Ai = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string" ? e : null, Di = new jn({
2677
+ const $i = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string" ? e : null, Mi = new Kn({
2584
2678
  name: "ObjectOrString",
2585
2679
  description: "A string or the string representation of an object (a stringified object).",
2586
- parseValue: wi,
2587
- serialize: Ai,
2680
+ parseValue: Bi,
2681
+ serialize: $i,
2588
2682
  parseLiteral(e) {
2589
- return e.kind === Ce.STRING ? Fn(e.value) : null;
2683
+ return e.kind === Pe.STRING ? qn(e.value) : null;
2590
2684
  }
2591
- }), U = (e) => "Price" in e && "seller" in e && "product" in e, T = (e) => "skuName" in e, Pi = {
2685
+ }), T = (e) => "Price" in e && "seller" in e && "product" in e, F = (e) => "skuName" in e, zi = {
2592
2686
  priceCurrency: async (e, n, t) => {
2593
2687
  const {
2594
2688
  loaders: { salesChannelLoader: r },
@@ -2596,36 +2690,36 @@ const Ai = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
2596
2690
  } = t;
2597
2691
  return (await r.load(i.salesChannel)).CurrencyCode ?? "";
2598
2692
  },
2599
- priceValidUntil: (e) => U(e) ? e.PriceValidUntil ?? "" : T(e) ? e.priceValidUntil ?? "" : null,
2693
+ priceValidUntil: (e) => T(e) ? e.PriceValidUntil ?? "" : F(e) ? e.priceValidUntil ?? "" : null,
2600
2694
  itemCondition: () => "https://schema.org/NewCondition",
2601
- availability: async (e) => U(e) ? Me(B(e)) : T(e) ? Me(mr(e.availability)) : null,
2602
- seller: (e, n, t) => U(e) ? {
2695
+ availability: async (e) => T(e) ? Ve(M(e)) : F(e) ? Ve(vr(e.availability)) : null,
2696
+ seller: (e, n, t) => T(e) ? {
2603
2697
  identifier: t.storage.channel?.seller || e.seller.sellerId || ""
2604
- } : T(e) ? {
2698
+ } : F(e) ? {
2605
2699
  identifier: e.seller
2606
2700
  } : null,
2607
- price: (e) => U(e) ? W(e) : T(e) ? e.sellingPrice / 100 : null,
2608
- priceWithTaxes: (e) => U(e) ? q(W(e), e?.Tax, e.product.unitMultiplier) : T(e) ? q(
2701
+ price: (e) => T(e) ? H(e) : F(e) ? e.sellingPrice / 100 : null,
2702
+ priceWithTaxes: (e) => T(e) ? W(H(e), e?.Tax, e.product.unitMultiplier) : F(e) ? W(
2609
2703
  e.sellingPrice / 100,
2610
2704
  e.tax / 100,
2611
2705
  e.unitMultiplier
2612
2706
  ) : null,
2613
- sellingPrice: (e) => U(e) ? gr(e) : T(e) ? e.sellingPrice / 100 : null,
2614
- listPrice: (e) => U(e) ? e.ListPrice ?? 0 : T(e) ? e.listPrice / 100 : null,
2615
- listPriceWithTaxes: (e) => U(e) ? q(
2707
+ sellingPrice: (e) => T(e) ? Ir(e) : F(e) ? e.sellingPrice / 100 : null,
2708
+ listPrice: (e) => T(e) ? e.ListPrice ?? 0 : F(e) ? e.listPrice / 100 : null,
2709
+ listPriceWithTaxes: (e) => T(e) ? W(
2616
2710
  e.ListPrice ?? 0,
2617
2711
  e?.Tax,
2618
2712
  e.product.unitMultiplier
2619
- ) : T(e) ? q(e.listPrice / 100, e.tax / 100, e.unitMultiplier) : null,
2620
- itemOffered: (e) => U(e) ? e.product : T(e) ? {
2713
+ ) : F(e) ? W(e.listPrice / 100, e.tax / 100, e.unitMultiplier) : null,
2714
+ itemOffered: (e) => T(e) ? e.product : F(e) ? {
2621
2715
  ...e.product,
2622
2716
  attachmentsValues: e.attachments,
2623
2717
  servicesValues: e.bundleItems ?? []
2624
2718
  } : null,
2625
- quantity: (e) => U(e) ? e.AvailableQuantity ?? 0 : T(e) ? e.quantity : null,
2626
- isGift: (e) => T(e) ? e.isGift ?? !1 : null,
2627
- priceToken: (e) => U(e) ? e.PriceToken ?? null : null
2628
- }, Ei = ({ linkText: e }) => `/${e}/p`, ki = ({
2719
+ quantity: (e) => T(e) ? e.AvailableQuantity ?? 0 : F(e) ? e.quantity : null,
2720
+ isGift: (e) => F(e) ? e.isGift ?? !1 : null,
2721
+ priceToken: (e) => T(e) ? e.PriceToken ?? null : null
2722
+ }, Vi = ({ linkText: e }) => `/${e}/p`, qi = ({
2629
2723
  offer: e,
2630
2724
  seller: n,
2631
2725
  product: t
@@ -2633,15 +2727,15 @@ const Ai = (e) => typeof e == "object" ? JSON.stringify(e) : typeof e == "string
2633
2727
  ...e,
2634
2728
  product: t,
2635
2729
  seller: n
2636
- }), _i = {
2730
+ }), xi = {
2637
2731
  imageText: "image",
2638
2732
  imageUrl: "https://storecomponents.vtexassets.com/assets/faststore/images/image___117a6d3e229a96ad0e0d0876352566e2.svg",
2639
2733
  imageLabel: "label"
2640
- }, ae = (e, n) => `${e}-${n}`, nn = (e, n) => `/${ae(e, n)}/p`, Ui = (e) => Array.isArray(e) && e.length > 0 ? e : null;
2641
- function we(e) {
2734
+ }, le = (e, n) => `${e}-${n}`, an = (e, n) => `/${le(e, n)}/p`, ji = (e) => Array.isArray(e) && e.length > 0 ? e : null;
2735
+ function Ee(e) {
2642
2736
  return e.replace(/^\/+|\/+$/g, "");
2643
2737
  }
2644
- async function oe(e, n, t) {
2738
+ async function de(e, n, t) {
2645
2739
  const r = `${n}:${t}`;
2646
2740
  e.storage.productTranslationsCache ??= /* @__PURE__ */ new Map();
2647
2741
  const i = e.storage.productTranslationsCache, a = i.get(r);
@@ -2666,18 +2760,18 @@ async function oe(e, n, t) {
2666
2760
  })();
2667
2761
  return i.set(r, o), o;
2668
2762
  }
2669
- const Ti = (e, n) => {
2670
- const t = e.findIndex((r) => we(r).split("/").at(-1) === n);
2763
+ const Wi = (e, n) => {
2764
+ const t = e.findIndex((r) => Ee(r).split("/").at(-1) === n);
2671
2765
  return t < 0 ? 0 : t;
2672
- }, Ri = {
2766
+ }, Gi = {
2673
2767
  productID: ({ itemId: e }) => e,
2674
2768
  name: ({ isVariantOf: e, name: n }) => n ?? e.productName,
2675
- slug: ({ isVariantOf: { linkText: e }, itemId: n }) => ae(e, n),
2769
+ slug: ({ isVariantOf: { linkText: e }, itemId: n }) => le(e, n),
2676
2770
  description: ({ isVariantOf: { description: e } }) => e,
2677
2771
  seo: ({ isVariantOf: e }) => ({
2678
2772
  title: e.productTitle || e.productName,
2679
2773
  description: e.metaTagDescription || e.description,
2680
- canonical: Ei(e)
2774
+ canonical: Vi(e)
2681
2775
  }),
2682
2776
  brand: ({ isVariantOf: { brand: e } }) => ({ name: e }),
2683
2777
  unitMultiplier: ({ unitMultiplier: e }) => e,
@@ -2691,29 +2785,29 @@ const Ti = (e, n) => {
2691
2785
  categoriesIds: s,
2692
2786
  productId: c
2693
2787
  },
2694
- itemId: u
2695
- } = e, d = Ti(s, o), g = r[d], f = we(g).split("/"), h = t.storage.locale;
2696
- if (j(t) && h) {
2697
- const v = await oe(t, c, h);
2788
+ itemId: d
2789
+ } = e, g = Wi(s, o), p = r[g], f = Ee(p).split("/"), h = t.storage.locale;
2790
+ if (G(t) && h) {
2791
+ const v = await de(t, c, h);
2698
2792
  if (v) {
2699
2793
  const l = new Set(
2700
- we(s[d]).split("/").filter(Boolean)
2701
- ), p = v.categories.filter((S) => l.has(S.id.toString())).sort(
2794
+ Ee(s[g]).split("/").filter(Boolean)
2795
+ ), u = v.categories.filter((S) => l.has(S.id.toString())).sort(
2702
2796
  (S, O) => S.fullPath.split("/").length - O.fullPath.split("/").length
2703
2797
  );
2704
- if (p.length === f.length)
2798
+ if (u.length === f.length)
2705
2799
  return {
2706
2800
  itemListElement: [
2707
2801
  // Category items: both name and slug come from Catalog Dataplane, ensuring
2708
2802
  // they are always consistent with each other for the requested locale.
2709
- ...p.map((S, O) => ({
2803
+ ...u.map((S, O) => ({
2710
2804
  name: S.name,
2711
2805
  item: `/${S.fullPathUriName}/`,
2712
2806
  position: O + 1
2713
2807
  })),
2714
2808
  {
2715
2809
  name: i,
2716
- item: nn(v.linkId, u),
2810
+ item: an(v.linkId, d),
2717
2811
  position: f.length + 1
2718
2812
  }
2719
2813
  ],
@@ -2724,16 +2818,16 @@ const Ti = (e, n) => {
2724
2818
  return {
2725
2819
  itemListElement: [
2726
2820
  ...f.map((v, l) => {
2727
- const p = `/${f.slice(0, l + 1).map(se).join("/")}/`;
2821
+ const u = `/${f.slice(0, l + 1).map(ue).join("/")}/`;
2728
2822
  return {
2729
2823
  name: v,
2730
- item: p,
2824
+ item: u,
2731
2825
  position: l + 1
2732
2826
  };
2733
2827
  }),
2734
2828
  {
2735
2829
  name: i,
2736
- item: nn(a, u),
2830
+ item: an(a, d),
2737
2831
  position: f.length + 1
2738
2832
  }
2739
2833
  ],
@@ -2741,11 +2835,11 @@ const Ti = (e, n) => {
2741
2835
  };
2742
2836
  },
2743
2837
  image: ({ images: e }, n) => {
2744
- const t = (Ui(e) ?? [_i]).map(
2745
- ({ imageUrl: s, imageText: c, imageLabel: u }) => ({
2838
+ const t = (ji(e) ?? [xi]).map(
2839
+ ({ imageUrl: s, imageText: c, imageLabel: d }) => ({
2746
2840
  alternateName: c ?? "",
2747
2841
  url: s.replace("vteximg.com.br", "vtexassets.com"),
2748
- keywords: u
2842
+ keywords: d
2749
2843
  })
2750
2844
  );
2751
2845
  if (typeof n != "object")
@@ -2764,12 +2858,12 @@ const Ti = (e, n) => {
2764
2858
  review: () => [],
2765
2859
  aggregateRating: () => ({}),
2766
2860
  offers: (e) => e.sellers.map(
2767
- (n) => ki({
2861
+ (n) => qi({
2768
2862
  offer: n.commertialOffer,
2769
2863
  seller: n,
2770
2864
  product: e
2771
2865
  })
2772
- ).sort(In),
2866
+ ).sort(bn),
2773
2867
  isVariantOf: (e) => e,
2774
2868
  additionalProperty: ({
2775
2869
  // Search uses the name variations for specifications
@@ -2779,14 +2873,14 @@ const Ti = (e, n) => {
2779
2873
  servicesValues: r = []
2780
2874
  }) => {
2781
2875
  const i = e.flatMap(
2782
- ({ name: c, values: u }) => u.map((d) => ({
2876
+ ({ name: c, values: d }) => d.map((g) => ({
2783
2877
  name: c,
2784
- value: d,
2785
- valueReference: M.specification
2878
+ value: g,
2879
+ valueReference: V.specification
2786
2880
  }))
2787
2881
  ), a = n.map(
2788
- Cn
2789
- ), o = t.map(Br), s = r.map(Ee);
2882
+ Un
2883
+ ), o = t.map(Gr), s = r.map(Re);
2790
2884
  return [
2791
2885
  ...i,
2792
2886
  ...a,
@@ -2804,66 +2898,66 @@ const Ti = (e, n) => {
2804
2898
  advertisement: ({ isVariantOf: { advertisement: e } }) => e,
2805
2899
  deliveryPromiseBadges: ({ isVariantOf: { deliveryPromisesBadges: e } }) => e,
2806
2900
  otherLocales: async (e, n, t) => {
2807
- if (!j(t)) return null;
2808
- const r = _t(t);
2901
+ if (!G(t)) return null;
2902
+ const r = Lt(t);
2809
2903
  if (r.length === 0) return null;
2810
- const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = await oe(t, i, o);
2904
+ const i = e.isVariantOf.productId, a = e.itemId, o = t.storage.locale, s = await de(t, i, o);
2811
2905
  if (!s?.availableLinkIds) return null;
2812
2906
  const { availableLinkIds: c } = s;
2813
- return r.map((u) => {
2814
- const d = c[u];
2815
- return d ? { locale: u, slug: ae(d, a) } : null;
2816
- }).filter((u) => u !== null);
2907
+ return r.map((d) => {
2908
+ const g = c[d];
2909
+ return g ? { locale: d, slug: le(g, a) } : null;
2910
+ }).filter((d) => d !== null);
2817
2911
  },
2818
2912
  defaultLocaleSlug: async (e, n, t) => {
2819
- if (!j(t)) return null;
2820
- const r = Ut(t);
2913
+ if (!G(t)) return null;
2914
+ const r = Bt(t);
2821
2915
  if (!r) return null;
2822
- const { productId: i, linkText: a } = e.isVariantOf, o = e.itemId, c = (await oe(
2916
+ const { productId: i, linkText: a } = e.isVariantOf, o = e.itemId, c = (await de(
2823
2917
  t,
2824
2918
  i,
2825
2919
  t.storage.locale
2826
2920
  ))?.availableLinkIds?.[r] ?? a;
2827
- return ae(c, o);
2921
+ return le(c, o);
2828
2922
  }
2829
- }, Fi = /* @__PURE__ */ new Set(["allSpecifications"]), Ni = {
2830
- hasVariant: (e) => e.isVariantOf.items.map((n) => F(n, e.isVariantOf)),
2923
+ }, Hi = /* @__PURE__ */ new Set(["allSpecifications"]), Xi = {
2924
+ hasVariant: (e) => e.isVariantOf.items.map((n) => L(n, e.isVariantOf)),
2831
2925
  productGroupID: ({ isVariantOf: e }) => e.productId,
2832
2926
  productClusters: ({ isVariantOf: e }) => e.productClusters ?? [],
2833
2927
  name: (e) => e.isVariantOf.productName,
2834
2928
  skuVariants: (e) => e,
2835
2929
  additionalProperty: ({ isVariantOf: { specificationGroups: e } }) => e.filter(
2836
- (n) => !Fi.has(n.name)
2930
+ (n) => !Hi.has(n.name)
2837
2931
  ).flatMap(
2838
2932
  ({ specifications: n }) => n.flatMap(
2839
2933
  ({ name: t, values: r }) => r.map((i) => ({
2840
2934
  name: t,
2841
2935
  value: i,
2842
- valueReference: M.specification
2936
+ valueReference: V.specification
2843
2937
  }))
2844
2938
  )
2845
2939
  )
2846
- }, Li = {
2847
- propertyID: (e) => e.propertyID || wn(e),
2940
+ }, Yi = {
2941
+ propertyID: (e) => e.propertyID || Rn(e),
2848
2942
  name: ({ name: e }) => e,
2849
2943
  value: ({ value: e }) => e,
2850
2944
  valueReference: ({ valueReference: e }) => e
2851
- }, de = (e) => {
2945
+ }, me = (e) => {
2852
2946
  const n = e.flatMap(
2853
2947
  (r) => r.sellers.map((i) => ({
2854
2948
  offer: i.commertialOffer,
2855
2949
  sku: r
2856
2950
  }))
2857
- ), t = Ie(
2951
+ ), t = be(
2858
2952
  n,
2859
- ({ offer: r }, { offer: i }) => In(r, i)
2953
+ ({ offer: r }, { offer: i }) => bn(r, i)
2860
2954
  );
2861
2955
  return t ? t.sku : e[0];
2862
- }, Nn = (e) => e !== "" && !Number.isNaN(Number(e)), Bi = /^vrn:recommendations:[^:]+:[^:]+:[^:]+$/, $i = async (e, { campaignVrn: n, userId: t, products: r }, i) => {
2956
+ }, xn = (e) => e !== "" && !Number.isNaN(Number(e)), Ji = /^vrn:recommendations:[^:]+:[^:]+:[^:]+$/, Ki = async (e, { campaignVrn: n, userId: t, products: r }, i) => {
2863
2957
  const {
2864
2958
  clients: { commerce: a }
2865
2959
  } = i, { salesChannel: o } = i.storage.channel, s = n?.trim();
2866
- if (!s || !Bi.test(s))
2960
+ if (!s || !Ji.test(s))
2867
2961
  throw new k(`Invalid campaignVrn: "${n}"`);
2868
2962
  const c = t?.trim();
2869
2963
  if (t != null && !c)
@@ -2872,22 +2966,22 @@ const Ti = (e, n) => {
2872
2966
  throw new k(
2873
2967
  "Invalid products: must be an array of non-empty strings"
2874
2968
  );
2875
- const u = await a.recommendation.recommendations({
2969
+ const d = await a.recommendation.recommendations({
2876
2970
  campaignVrn: s,
2877
2971
  userId: c || void 0,
2878
2972
  products: r ?? [],
2879
2973
  salesChannel: o ?? void 0,
2880
2974
  locale: i.storage.locale
2881
- }), { campaign: d, correlationId: g } = u;
2975
+ }), { campaign: g, correlationId: p } = d;
2882
2976
  return {
2883
- products: (u.products ?? []).map((h) => {
2884
- const v = de(h.items);
2885
- return v ? F(v, h) : null;
2977
+ products: (d.products ?? []).map((h) => {
2978
+ const v = me(h.items);
2979
+ return v ? L(v, h) : null;
2886
2980
  }).filter((h) => !!h),
2887
- correlationId: g,
2888
- campaign: d
2981
+ correlationId: p,
2982
+ campaign: g
2889
2983
  };
2890
- }, tn = {
2984
+ }, on = {
2891
2985
  price_desc: "price:desc",
2892
2986
  price_asc: "price:asc",
2893
2987
  orders_desc: "orders:desc",
@@ -2897,17 +2991,17 @@ const Ti = (e, n) => {
2897
2991
  discount_desc: "discount:desc",
2898
2992
  score_desc: ""
2899
2993
  };
2900
- function Mi(e, n) {
2994
+ function Qi(e, n) {
2901
2995
  let t;
2902
- if (Object.hasOwn(n, e) ? t = n[e] : Object.hasOwn(tn, e) && (t = tn[e]), t === void 0)
2996
+ if (Object.hasOwn(n, e) ? t = n[e] : Object.hasOwn(on, e) && (t = on[e]), t === void 0)
2903
2997
  throw new k(`Unknown sort value: ${e}`);
2904
2998
  return t;
2905
2999
  }
2906
- const zi = async (e, { operationId: n }, { clients: { commerce: t } }) => {
3000
+ const Zi = async (e, { operationId: n }, { clients: { commerce: t } }) => {
2907
3001
  if (!n)
2908
3002
  throw new k("Missing operationId");
2909
3003
  return t.orderEntry.getOperation({ operationId: n });
2910
- }, Vi = async (e, { orderFormId: n }, { clients: { commerce: t } }) => {
3004
+ }, ea = async (e, { orderFormId: n }, { clients: { commerce: t } }) => {
2911
3005
  if (!n)
2912
3006
  throw new k("Missing orderFormId");
2913
3007
  const { items: r } = await t.orderEntry.getOrderFormItems({ orderFormId: n });
@@ -2923,49 +3017,49 @@ const zi = async (e, { operationId: n }, { clients: { commerce: t } }) => {
2923
3017
  unitMultiplier: i.unitMultiplier ?? 1
2924
3018
  }));
2925
3019
  };
2926
- async function xi(e, n, t, r) {
3020
+ async function na(e, n, t, r) {
2927
3021
  const i = n.slice(0, n.lastIndexOf("-"));
2928
- return (await oe(e, t, r))?.linkId === i;
3022
+ return (await de(e, t, r))?.linkId === i;
2929
3023
  }
2930
- const Ln = "Invalid SkuId", Bn = "Slug was set but the fetched sku does not satisfy the slug condition.", qi = "UseAdHocCard", ji = (e) => J(e) || e instanceof Error && (e.message === Ln || e.message.startsWith(Bn));
2931
- async function Wi(e, n, t, r) {
3024
+ const jn = "Invalid SkuId", Wn = "Slug was set but the fetched sku does not satisfy the slug condition.", ta = "UseAdHocCard", ra = (e) => ee(e) || e instanceof Error && (e.message === jn || e.message.startsWith(Wn));
3025
+ async function ia(e, n, t, r) {
2932
3026
  const { linkText: i, productId: a } = n.isVariantOf;
2933
- if (!(!t || !i || t.startsWith(i) || j(e) && r && Nn(t.split("-").pop() ?? "") && await xi(e, t, a, r)))
2934
- throw new Error(`${Bn} slug: ${t}, linkText: ${i}`);
3027
+ if (!(!t || !i || t.startsWith(i) || G(e) && r && xn(t.split("-").pop() ?? "") && await na(e, t, a, r)))
3028
+ throw new Error(`${Wn} slug: ${t}, linkText: ${i}`);
2935
3029
  }
2936
- async function Gi(e, n) {
3030
+ async function aa(e, n) {
2937
3031
  if (n == null)
2938
3032
  throw new k("Missing slug or id");
2939
3033
  const {
2940
3034
  clients: { commerce: t, search: r }
2941
3035
  } = e, i = await t.catalog.portal.pagetype(`${n}/p`);
2942
3036
  if (i.pageType !== "Product" || !i.id)
2943
- throw new $(`No product found for slug ${n}`);
3037
+ throw new z(`No product found for slug ${n}`);
2944
3038
  const a = await r.fetchProduct({
2945
3039
  field: "id",
2946
3040
  value: String(i.id)
2947
3041
  }).catch(() => null);
2948
3042
  if (!a)
2949
- throw new $(`No product found for id ${i.id}`);
2950
- return F(de(a.items), a);
3043
+ throw new z(`No product found for id ${i.id}`);
3044
+ return L(me(a.items), a);
2951
3045
  }
2952
- const Hi = {
3046
+ const oa = {
2953
3047
  product: async (e, { locator: n }, t) => {
2954
- const r = We(n), i = je(n), a = wr(n), o = Cr(n);
2955
- r && ce(t, r), i && ve(t, i);
3048
+ const r = He(n), i = Ge(n), a = _r(n), o = kr(n);
3049
+ r && pe(t, r), i && we(t, i);
2956
3050
  const {
2957
3051
  loaders: { skuLoader: s }
2958
3052
  } = t;
2959
3053
  try {
2960
3054
  const c = a ?? o?.split("-").pop() ?? "";
2961
- if (!Nn(c))
2962
- throw new Error(Ln);
2963
- const u = await s.load(c);
2964
- return await Wi(t, u, o, i), u;
3055
+ if (!xn(c))
3056
+ throw new Error(jn);
3057
+ const d = await s.load(c);
3058
+ return await ia(t, d, o, i), d;
2965
3059
  } catch (c) {
2966
- if (!ji(c))
3060
+ if (!ra(c))
2967
3061
  throw c;
2968
- return Gi(t, o);
3062
+ return aa(t, o);
2969
3063
  }
2970
3064
  },
2971
3065
  collection: (e, { slug: n }, t) => {
@@ -2974,7 +3068,7 @@ const Hi = {
2974
3068
  } = t;
2975
3069
  return r.load({
2976
3070
  slug: n,
2977
- locale: hn(t)
3071
+ locale: In(t)
2978
3072
  });
2979
3073
  },
2980
3074
  search: async (e, {
@@ -2985,21 +3079,21 @@ const Hi = {
2985
3079
  selectedFacets: a,
2986
3080
  sponsoredCount: o
2987
3081
  }, s) => {
2988
- const c = We(a), u = je(a), d = br(a);
2989
- c && ce(s, c), u && ve(s, u);
2990
- const g = t ? Number(t) : 0, f = {
2991
- page: Math.ceil(g / n) || 0,
3082
+ const c = He(a), d = Ge(a), g = Er(a);
3083
+ c && pe(s, c), d && we(s, d);
3084
+ const p = t ? Number(t) : 0, f = {
3085
+ page: Math.ceil(p / n) || 0,
2992
3086
  count: n,
2993
3087
  query: i ?? void 0,
2994
- sort: Mi(r ?? "score_desc", s.storage.customSortMap),
2995
- selectedFacets: a?.flatMap(xe) ?? [],
3088
+ sort: Qi(r ?? "score_desc", s.storage.customSortMap),
3089
+ selectedFacets: a?.flatMap(je) ?? [],
2996
3090
  sponsoredCount: o ?? void 0
2997
3091
  };
2998
- if (d) {
3092
+ if (g) {
2999
3093
  const l = (await s.clients.commerce.catalog.products.crossselling({
3000
- type: On[d.key],
3001
- productId: d.value
3002
- })).map((m) => m.productId).slice(0, n), p = s.clients.search.productsByIdentifier({ field: "id", values: l }).then((m) => ({
3094
+ type: An[g.key],
3095
+ productId: g.value
3096
+ })).map((m) => m.productId).slice(0, n), u = s.clients.search.productsByIdentifier({ field: "id", values: l }).then((m) => ({
3003
3097
  products: m,
3004
3098
  recordsFiltered: m.length,
3005
3099
  pagination: {
@@ -3022,7 +3116,7 @@ const Hi = {
3022
3116
  fuzzy: "0",
3023
3117
  searchId: ""
3024
3118
  }));
3025
- return { searchArgs: f, productSearchPromise: p };
3119
+ return { searchArgs: f, productSearchPromise: u };
3026
3120
  }
3027
3121
  const h = s.clients.search.products(f);
3028
3122
  return { searchArgs: f, productSearchPromise: h };
@@ -3034,7 +3128,7 @@ const Hi = {
3034
3128
  page: Math.ceil(a / n),
3035
3129
  count: n
3036
3130
  }), s = o.products.flatMap(
3037
- (c) => c.items.map((u) => F(u, c))
3131
+ (c) => c.items.map((d) => L(d, c))
3038
3132
  ).filter((c) => c.sellers.length > 0);
3039
3133
  return {
3040
3134
  pageInfo: {
@@ -3045,9 +3139,9 @@ const Hi = {
3045
3139
  totalCount: o.recordsFiltered
3046
3140
  },
3047
3141
  // after + index is bigger than after+first itself because of the array flat() above
3048
- edges: s.map((c, u) => ({
3142
+ edges: s.map((c, d) => ({
3049
3143
  node: c,
3050
- cursor: (a + u).toString()
3144
+ cursor: (a + d).toString()
3051
3145
  }))
3052
3146
  };
3053
3147
  },
@@ -3059,7 +3153,7 @@ const Hi = {
3059
3153
  field: "id",
3060
3154
  values: n
3061
3155
  })).flatMap(
3062
- (a) => a.items.map((o) => F(o, a))
3156
+ (a) => a.items.map((o) => L(o, a))
3063
3157
  ).filter(
3064
3158
  (a) => n.includes(a.itemId) && a.sellers.length > 0
3065
3159
  ) : [];
@@ -3070,12 +3164,12 @@ const Hi = {
3070
3164
  } = r, a = t ? Number(t) : 0, [o, s] = await Promise.all([
3071
3165
  i.catalog.brand.list(),
3072
3166
  i.catalog.category.tree()
3073
- ]), c = [], u = (h, v) => {
3167
+ ]), c = [], d = (h, v) => {
3074
3168
  c.push({
3075
3169
  id: h.id,
3076
3170
  name: h.name,
3077
3171
  fatherCategoryId: v,
3078
- linkId: se(h.name),
3172
+ linkId: ue(h.name),
3079
3173
  title: h.Title,
3080
3174
  description: null,
3081
3175
  metaTagDescription: h.MetaTagDescription,
@@ -3084,20 +3178,20 @@ const Hi = {
3084
3178
  slug: new URL(h.url).pathname.slice(1).toLowerCase()
3085
3179
  });
3086
3180
  for (const l of h.children)
3087
- u(l, h.id);
3181
+ d(l, h.id);
3088
3182
  };
3089
3183
  for (const h of s)
3090
- u(h, null);
3184
+ d(h, null);
3091
3185
  const f = [...o.filter((h) => h.isActive).map((h) => ({
3092
3186
  id: h.id,
3093
3187
  name: h.name,
3094
- linkId: se(h.name),
3188
+ linkId: ue(h.name),
3095
3189
  title: h.title,
3096
3190
  description: null,
3097
3191
  metaTagDescription: h.metaTagDescription,
3098
3192
  availableLinkIds: null,
3099
3193
  entityType: "brand"
3100
- })), ...c].filter((h) => !!vn.slug(h, null, r, null));
3194
+ })), ...c].filter((h) => !!wn.slug(h, null, r, null));
3101
3195
  return {
3102
3196
  pageInfo: {
3103
3197
  hasNextPage: f.length - a > n,
@@ -3132,7 +3226,7 @@ const Hi = {
3132
3226
  page: 1,
3133
3227
  count: 1,
3134
3228
  query: n ?? void 0,
3135
- selectedFacets: t?.flatMap(xe) ?? [],
3229
+ selectedFacets: t?.flatMap(je) ?? [],
3136
3230
  allowRedirect: !0
3137
3231
  });
3138
3232
  return {
@@ -3147,10 +3241,10 @@ const Hi = {
3147
3241
  geoCoordinates: t,
3148
3242
  country: r,
3149
3243
  salesChannel: i
3150
- }))?.[0], { id: u, sellers: d } = c;
3244
+ }))?.[0], { id: d, sellers: g } = c;
3151
3245
  return {
3152
- id: u,
3153
- sellers: d
3246
+ id: d,
3247
+ sellers: g
3154
3248
  };
3155
3249
  },
3156
3250
  profile: async (e, { id: n }, t) => {
@@ -3180,11 +3274,11 @@ const Hi = {
3180
3274
  clients: { commerce: r }
3181
3275
  } = t, i = await r.oms.userOrder({ orderId: n });
3182
3276
  if (!i)
3183
- throw new $(`No order found for id ${n}`);
3277
+ throw new z(`No order found for id ${n}`);
3184
3278
  let a = null;
3185
3279
  try {
3186
3280
  const c = await r.oms.getCommercialAuthorizationsByOrderId({ orderId: n });
3187
- a = bn(c);
3281
+ a = Dn(c);
3188
3282
  } catch {
3189
3283
  }
3190
3284
  const s = (await r.masterData.getShopperById({
@@ -3223,7 +3317,7 @@ const Hi = {
3223
3317
  a = { message: i };
3224
3318
  }
3225
3319
  const o = a?.message || i;
3226
- throw J(r) ? new $(`No order found for id ${n}. ${o}.`) : ht(r) ? new K(
3320
+ throw ee(r) ? new z(`No order found for id ${n}. ${o}.`) : Ot(r) ? new ne(
3227
3321
  `You are forbidden to interact with order with id ${n}. ${o}.`
3228
3322
  ) : r;
3229
3323
  }
@@ -3271,10 +3365,10 @@ const Hi = {
3271
3365
  account: r,
3272
3366
  headers: i,
3273
3367
  clients: { commerce: a }
3274
- } = t, s = x(L(i?.cookie ?? "", r))?.userId ?? "";
3368
+ } = t, s = j($(i?.cookie ?? "", r))?.userId ?? "";
3275
3369
  if (!s)
3276
3370
  return !0;
3277
- const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey: qi }).catch(() => null);
3371
+ const c = await a.licenseManager.isResourceGranted({ userId: s, resourceKey: ta }).catch(() => null);
3278
3372
  return typeof c == "boolean" ? c : !0;
3279
3373
  },
3280
3374
  listUserQuotes: async (e, n, t) => {
@@ -3286,12 +3380,12 @@ const Hi = {
3286
3380
  return await Promise.all(
3287
3381
  a.map(async (c) => {
3288
3382
  try {
3289
- const [u] = await r.masterData.getShopperById({
3383
+ const [d] = await r.masterData.getShopperById({
3290
3384
  userId: c
3291
3385
  });
3292
- if (u) {
3293
- const d = [u.firstName, u.lastName].filter(Boolean).join(" ");
3294
- d && o.set(c, d);
3386
+ if (d) {
3387
+ const g = [d.firstName, d.lastName].filter(Boolean).join(" ");
3388
+ g && o.set(c, g);
3295
3389
  }
3296
3390
  } catch {
3297
3391
  }
@@ -3328,17 +3422,17 @@ const Hi = {
3328
3422
  account: r,
3329
3423
  headers: i,
3330
3424
  clients: { commerce: a }
3331
- } = t, s = x(L(i?.cookie ?? "", r))?.userId ?? "", [c, u, d] = await Promise.all([
3425
+ } = t, s = j($(i?.cookie ?? "", r))?.userId ?? "", [c, d, g] = await Promise.all([
3332
3426
  a.session("").catch(() => null),
3333
3427
  s ? a.masterData.getShopperById({ userId: s }).catch(() => null) : Promise.resolve(null),
3334
3428
  s ? a.licenseManager.getUserRoles({ userId: s }).catch(() => null) : Promise.resolve(null)
3335
- ]), g = u?.[0], f = c?.namespaces.authentication ?? null, h = `${(g?.firstName ?? "").trim()} ${(g?.lastName ?? "").trim()}`.trim();
3429
+ ]), p = d?.[0], f = c?.namespaces.authentication ?? null, h = `${(p?.firstName ?? "").trim()} ${(p?.lastName ?? "").trim()}`.trim();
3336
3430
  return {
3337
3431
  username: f?.storeUserEmail?.value ?? "",
3338
3432
  name: h,
3339
3433
  email: f?.storeUserEmail?.value ?? "",
3340
- phone: g?.phone ?? "",
3341
- role: d?.Roles?.map((v) => v.Name) ?? [],
3434
+ phone: p?.phone ?? "",
3435
+ role: g?.Roles?.map((v) => v.Name) ?? [],
3342
3436
  orgUnit: f?.unitName?.value ?? ""
3343
3437
  };
3344
3438
  },
@@ -3349,29 +3443,29 @@ const Hi = {
3349
3443
  account: r,
3350
3444
  headers: i,
3351
3445
  clients: { commerce: a }
3352
- } = t, o = x(L(i?.cookie ?? "", r));
3446
+ } = t, o = j($(i?.cookie ?? "", r));
3353
3447
  if (!o?.userId)
3354
3448
  return null;
3355
3449
  if (o?.isRepresentative) {
3356
3450
  const c = await a.session("").catch(() => null);
3357
3451
  if (!c)
3358
3452
  return null;
3359
- const u = c.namespaces.profile ?? null, d = c.namespaces.shopper ?? null, g = c.namespaces.authentication ?? null, f = Ze(c) || o?.customerId?.trim() || "";
3453
+ const d = c.namespaces.profile ?? null, g = c.namespaces.shopper ?? null, p = c.namespaces.authentication ?? null, f = tn(c) || o?.customerId?.trim() || "";
3360
3454
  let h = null;
3361
3455
  if (f)
3362
3456
  try {
3363
3457
  h = await a.masterData.getContractById({ contractId: f });
3364
- } catch (p) {
3458
+ } catch (u) {
3365
3459
  console.error(
3366
3460
  `Error while getting contract data for contract ID (${f}).`,
3367
- p
3461
+ u
3368
3462
  );
3369
3463
  }
3370
- const v = `${(d?.firstName?.value ?? "").trim()} ${(d?.lastName?.value ?? "").trim()}`.trim();
3464
+ const v = `${(g?.firstName?.value ?? "").trim()} ${(g?.lastName?.value ?? "").trim()}`.trim();
3371
3465
  return {
3372
- name: Rn(h, u) || v || "",
3373
- email: u?.email?.value || g?.storeUserEmail?.value || "",
3374
- id: u?.id?.value || g?.customerId?.value || o?.customerId?.trim() || ""
3466
+ name: Vn(h, d) || v || "",
3467
+ email: d?.email?.value || p?.storeUserEmail?.value || "",
3468
+ id: d?.id?.value || p?.customerId?.value || o?.customerId?.trim() || ""
3375
3469
  // createdAt: '',
3376
3470
  };
3377
3471
  }
@@ -3394,27 +3488,27 @@ const Hi = {
3394
3488
  account: r,
3395
3489
  headers: i,
3396
3490
  clients: { commerce: a }
3397
- } = t, o = await a.session("").catch(() => null), s = L(i?.cookie ?? "", r);
3491
+ } = t, o = await a.session("").catch(() => null), s = $(i?.cookie ?? "", r);
3398
3492
  let c = null;
3399
3493
  try {
3400
- c = s ? x(s) : null;
3494
+ c = s ? j(s) : null;
3401
3495
  } catch {
3402
3496
  c = null;
3403
3497
  }
3404
- const u = o?.namespaces.authentication?.unitId?.value?.trim() ?? c?.unitId?.trim() ?? "";
3405
- if (!u || u !== n)
3406
- throw new K(
3498
+ const d = o?.namespaces.authentication?.unitId?.value?.trim() ?? c?.unitId?.trim() ?? "";
3499
+ if (!d || d !== n)
3500
+ throw new ne(
3407
3501
  "You are not allowed to list contracts for this organization unit"
3408
3502
  );
3409
- const d = ui(
3503
+ const g = vi(
3410
3504
  o?.namespaces.shopper
3411
- ), g = Ze(o) || c?.customerId?.trim() || "", f = await a.storeFront.attachedContracts(n).catch((v) => (console.warn(
3505
+ ), p = tn(o) || c?.customerId?.trim() || "", f = await a.storeFront.attachedContracts(n).catch((v) => (console.warn(
3412
3506
  "availableContracts: default contract lookup failed",
3413
3507
  v
3414
- ), null)), h = gi(f?.contracts);
3415
- return mi(
3416
- d,
3508
+ ), null)), h = Ci(f?.contracts);
3509
+ return bi(
3417
3510
  g,
3511
+ p,
3418
3512
  h
3419
3513
  );
3420
3514
  },
@@ -3426,10 +3520,10 @@ const Hi = {
3426
3520
  geoCoordinates: n
3427
3521
  });
3428
3522
  },
3429
- orderEntryOperation: zi,
3430
- orderFormItems: Vi,
3431
- recommendations: $i
3432
- }, Xi = {
3523
+ orderEntryOperation: Zi,
3524
+ orderFormItems: ea,
3525
+ recommendations: Ki
3526
+ }, sa = {
3433
3527
  reviewRating: () => ({
3434
3528
  ratingValue: 5,
3435
3529
  bestRating: 5
@@ -3437,35 +3531,35 @@ const Hi = {
3437
3531
  author: () => ({
3438
3532
  name: ""
3439
3533
  })
3440
- }, Yi = (e, n, t) => n ? e.key === "category-1" : t ? e.key === "brand" : !1, Ji = {
3534
+ }, ca = (e, n, t) => n ? e.key === "category-1" : t ? e.key === "brand" : !1, la = {
3441
3535
  suggestions: async (e, n, t) => {
3442
3536
  const {
3443
3537
  clients: { search: r }
3444
3538
  } = t, { searchArgs: i } = e;
3445
3539
  if (!i.query)
3446
3540
  return {
3447
- terms: (await r.topSearches()).searches.map((g) => ({
3448
- value: g.term,
3449
- count: g.count
3541
+ terms: (await r.topSearches()).searches.map((p) => ({
3542
+ value: p.term,
3543
+ count: p.count
3450
3544
  })),
3451
3545
  products: []
3452
3546
  };
3453
3547
  const { productSearchPromise: a } = e, [o, s] = await Promise.all([
3454
3548
  r.suggestedTerms(i),
3455
3549
  a
3456
- ]), c = s.products.map((d) => {
3457
- const g = de(d.items);
3458
- return g && F(g, d);
3459
- }).filter((d) => !!d), { searches: u } = o;
3550
+ ]), c = s.products.map((g) => {
3551
+ const p = me(g.items);
3552
+ return p && L(p, g);
3553
+ }).filter((g) => !!g), { searches: d } = o;
3460
3554
  return {
3461
- terms: u.map((d) => ({ value: d.term, count: d.count })),
3555
+ terms: d.map((g) => ({ value: g.term, count: g.count })),
3462
3556
  products: c
3463
3557
  };
3464
3558
  },
3465
3559
  products: async ({ productSearchPromise: e }) => {
3466
3560
  const n = await e, t = n.products.map((r) => {
3467
- const i = de(r.items);
3468
- return i && F(i, r);
3561
+ const i = me(r.items);
3562
+ return i && L(i, r);
3469
3563
  }).filter((r) => !!r);
3470
3564
  return {
3471
3565
  pageInfo: {
@@ -3488,7 +3582,7 @@ const Hi = {
3488
3582
  t.storage.searchArgs = e;
3489
3583
  const { facets: i = [] } = await r.facets(e), a = !e.query, o = e.selectedFacets?.length ? e.selectedFacets[0].key === "category-1" : !1, s = e.selectedFacets?.length ? e.selectedFacets[0].key === "brand" : !1;
3490
3584
  return i.filter(
3491
- (u) => !a || !Yi(u, o, s)
3585
+ (d) => !a || !ca(d, o, s)
3492
3586
  );
3493
3587
  },
3494
3588
  metadata: async ({ productSearchPromise: e }) => {
@@ -3500,12 +3594,12 @@ const Hi = {
3500
3594
  };
3501
3595
  },
3502
3596
  searchId: async ({ productSearchPromise: e }) => (await e).searchId
3503
- }, Ki = {
3597
+ }, da = {
3504
3598
  title: ({ title: e }) => e ?? "",
3505
3599
  description: ({ description: e }) => e ?? "",
3506
3600
  canonical: ({ canonical: e }) => e ?? "",
3507
3601
  titleTemplate: () => ""
3508
- }, Qi = ["bd", "d", "h", "m"], Zi = (e) => Qi.includes(e), ea = {
3602
+ }, ua = ["bd", "d", "h", "m"], pa = (e) => ua.includes(e), ga = {
3509
3603
  bd: {
3510
3604
  0: "Today",
3511
3605
  1: "In 1 business day",
@@ -3526,29 +3620,29 @@ const Hi = {
3526
3620
  1: "In 1 minute",
3527
3621
  other: "Up to # minutes"
3528
3622
  }
3529
- }, $n = (e) => {
3530
- const [n, t] = [e.split(/\D+/)[0], e.split(/[0-9]+/)[1]], r = n !== "" && !Number.isNaN(Number(n)), i = Zi(t);
3623
+ }, Gn = (e) => {
3624
+ const [n, t] = [e.split(/\D+/)[0], e.split(/[0-9]+/)[1]], r = n !== "" && !Number.isNaN(Number(n)), i = pa(t);
3531
3625
  if (!r || !i)
3532
3626
  return "";
3533
3627
  const a = Number(n) < 2 ? Number(n) : "other";
3534
- return ea[t][a].replace("#", n) ?? "";
3535
- }, na = {
3628
+ return ga[t][a].replace("#", n) ?? "";
3629
+ }, ma = {
3536
3630
  carrier: (e) => e?.friendlyName ?? e?.name ?? "",
3537
3631
  price: (e) => e?.price ? e.price / 100 : e?.price,
3538
- localizedEstimates: (e) => e?.shippingEstimate ? $n(e.shippingEstimate) : ""
3539
- }, rn = "skuvariation";
3540
- function an(e, n) {
3541
- const t = `${rn}${n}`.toLowerCase(), r = e.find(
3632
+ localizedEstimates: (e) => e?.shippingEstimate ? Gn(e.shippingEstimate) : ""
3633
+ }, sn = "skuvariation";
3634
+ function cn(e, n) {
3635
+ const t = `${sn}${n}`.toLowerCase(), r = e.find(
3542
3636
  (a) => a.imageLabel === t
3543
3637
  );
3544
3638
  if (r)
3545
3639
  return r;
3546
3640
  const i = e.find(
3547
- (a) => a.imageLabel === rn
3641
+ (a) => a.imageLabel === sn
3548
3642
  );
3549
3643
  return i || e[0];
3550
3644
  }
3551
- function ta(e, n, t) {
3645
+ function ha(e, n, t) {
3552
3646
  const r = {};
3553
3647
  return e.forEach((i) => {
3554
3648
  const a = i.variations;
@@ -3556,34 +3650,34 @@ function ta(e, n, t) {
3556
3650
  return;
3557
3651
  const o = `${n}-${a.find(
3558
3652
  (c) => c.name === n
3559
- )?.values[0] ?? ""}`, s = a.reduce((c, u) => u.name === n ? c : c + `-${u.name}-${u.values[0]}`, o);
3653
+ )?.values[0] ?? ""}`, s = a.reduce((c, d) => d.name === n ? c : c + `-${d.name}-${d.values[0]}`, o);
3560
3654
  r[s] = `${t}-${i.itemId}`;
3561
3655
  }), r;
3562
3656
  }
3563
- function on(e) {
3657
+ function ln(e) {
3564
3658
  const n = {};
3565
3659
  return e.forEach((t) => {
3566
3660
  n[t.name] = t.values[0];
3567
3661
  }), n;
3568
3662
  }
3569
- function ra(e) {
3663
+ function fa(e) {
3570
3664
  const n = {};
3571
3665
  return e?.forEach((t) => {
3572
3666
  n[t.field.originalName ?? t.field.name] = t.values.map((r) => r.originalName ?? r.name);
3573
3667
  }), n;
3574
3668
  }
3575
- function ia(e, n) {
3669
+ function Sa(e, n) {
3576
3670
  return Number.isNaN(Number(e) - Number(n)) ? e < n ? -1 : e > n ? 1 : 0 : Number(e) - Number(n);
3577
3671
  }
3578
- function aa(e) {
3672
+ function ya(e) {
3579
3673
  const n = e;
3580
3674
  for (const t in e)
3581
3675
  e[t].every(
3582
3676
  (i) => !Number.isNaN(Number(i.value))
3583
- ) && e[t].sort((i, a) => ia(i.value, a.value));
3677
+ ) && e[t].sort((i, a) => Sa(i.value, a.value));
3584
3678
  return n;
3585
3679
  }
3586
- function oa(e, n, t) {
3680
+ function Ia(e, n, t) {
3587
3681
  const r = {}, i = /* @__PURE__ */ new Set();
3588
3682
  return e.forEach((a) => {
3589
3683
  if (a.variations.length === 0)
@@ -3596,86 +3690,86 @@ function oa(e, n, t) {
3596
3690
  if (!o || i.has(c))
3597
3691
  return;
3598
3692
  i.add(c);
3599
- const u = an(
3693
+ const d = cn(
3600
3694
  a.images,
3601
3695
  n
3602
- ), d = {
3603
- src: u.imageUrl,
3604
- alt: u.imageLabel ?? "",
3696
+ ), g = {
3697
+ src: d.imageUrl,
3698
+ alt: d.imageLabel ?? "",
3605
3699
  label: `${n}: ${o.values[0]}`,
3606
3700
  value: o.values[0]
3607
3701
  };
3608
- r[o.name] ? r[o.name].push(d) : r[o.name] = [d];
3702
+ r[o.name] ? r[o.name].push(g) : r[o.name] = [g];
3609
3703
  return;
3610
3704
  }
3611
3705
  a.variations.forEach((c) => {
3612
- const u = `${c.name}-${c.values[0]}`;
3613
- if (i.has(u))
3706
+ const d = `${c.name}-${c.values[0]}`;
3707
+ if (i.has(d))
3614
3708
  return;
3615
- i.add(u);
3616
- const d = an(
3709
+ i.add(d);
3710
+ const g = cn(
3617
3711
  a.images,
3618
3712
  c.name
3619
- ), g = {
3620
- src: d.imageUrl,
3621
- alt: d.imageText ?? "",
3713
+ ), p = {
3714
+ src: g.imageUrl,
3715
+ alt: g.imageText ?? "",
3622
3716
  label: `${c.name}: ${c.values[0]}`,
3623
3717
  value: c.values[0]
3624
3718
  };
3625
- r[c.name] ? r[c.name].push(g) : r[c.name] = [g];
3719
+ r[c.name] ? r[c.name].push(p) : r[c.name] = [p];
3626
3720
  });
3627
- }), aa(r);
3721
+ }), ya(r);
3628
3722
  }
3629
- const sa = {
3630
- activeVariations: (e) => on(e.variations),
3631
- allVariantsByName: (e) => ra(e.isVariantOf.skuSpecifications),
3632
- slugsMap: (e, n) => ta(
3723
+ const va = {
3724
+ activeVariations: (e) => ln(e.variations),
3725
+ allVariantsByName: (e) => fa(e.isVariantOf.skuSpecifications),
3726
+ slugsMap: (e, n) => ha(
3633
3727
  e.isVariantOf.items,
3634
3728
  n.dominantVariantName ?? e.variations[0]?.name,
3635
3729
  e.isVariantOf.linkText
3636
3730
  ),
3637
3731
  availableVariations: (e, n) => {
3638
- const t = n.dominantVariantName ?? e.variations[0]?.name, i = on(e.variations)[t];
3639
- return oa(
3732
+ const t = n.dominantVariantName ?? e.variations[0]?.name, i = ln(e.variations)[t];
3733
+ return Ia(
3640
3734
  e.isVariantOf.items,
3641
3735
  t,
3642
3736
  i
3643
3737
  );
3644
3738
  },
3645
- allVariantProducts: (e) => e.isVariantOf.items.map((n) => F(n, e.isVariantOf))
3646
- }, ca = {
3739
+ allVariantProducts: (e) => e.isVariantOf.items.map((n) => L(n, e.isVariantOf))
3740
+ }, Oa = {
3647
3741
  "pickup-in-point": "Pickup",
3648
3742
  delivery: "Delivery",
3649
3743
  pickup: "Pickup",
3650
3744
  "take-away": "Take away",
3651
3745
  "": ""
3652
- }, la = {
3746
+ }, Ca = {
3653
3747
  deliveryOptionsData: (e) => {
3654
3748
  const { shippingData: n, items: t } = e, r = n?.logisticsInfo || [], i = n?.selectedAddresses || n?.availableAddresses || [n?.address], a = r.reduce(
3655
- (u, d) => {
3656
- const g = d?.selectedSla || "", f = d?.selectedDeliveryChannel || d?.deliveryChannel || "", h = d?.deliveryCompany || "", v = d?.deliveryWindow, l = d?.pickupStoreInfo, p = d?.shippingEstimate || "", m = d?.shippingEstimate ? $n(d?.shippingEstimate) : "", S = d?.shippingEstimateDate || "", O = d?.addressId || "", w = d?.itemIndex ?? 0, C = t?.[w], _ = C?.seller || "", I = `${g}|${f}|${h}|${_}|${p}|${S}|${O}|${v?.startDateUtc}|${v?.endDateUtc}`, A = i?.find(
3657
- (b) => b?.addressId === O
3658
- ), D = `${ca[f] || ""} ${m} ${A?.neighborhood ? `to ${A?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: E, taxPriceTags: P } = da(
3749
+ (d, g) => {
3750
+ const p = g?.selectedSla || "", f = g?.selectedDeliveryChannel || g?.deliveryChannel || "", h = g?.deliveryCompany || "", v = g?.deliveryWindow, l = g?.pickupStoreInfo, u = g?.shippingEstimate || "", m = g?.shippingEstimate ? Gn(g?.shippingEstimate) : "", S = g?.shippingEstimateDate || "", O = g?.addressId || "", b = g?.itemIndex ?? 0, C = t?.[b], _ = C?.seller || "", I = `${p}|${f}|${h}|${_}|${u}|${S}|${O}|${v?.startDateUtc}|${v?.endDateUtc}`, w = i?.find(
3751
+ (U) => U?.addressId === O
3752
+ ), E = `${Oa[f] || ""} ${m} ${w?.neighborhood ? `to ${w?.neighborhood}` : ""}`.trim(), { taxPriceTagsTotal: D, taxPriceTags: R } = ba(
3659
3753
  C?.priceTags ?? []
3660
- ), R = (C?.sellingPrice ?? 0) * (C?.quantity ?? 0) + (C?.tax ?? 0) + (E ?? 0);
3661
- return u[I] || (u[I] = {
3754
+ ), P = (C?.sellingPrice ?? 0) * (C?.quantity ?? 0) + (C?.tax ?? 0) + (D ?? 0);
3755
+ return d[I] || (d[I] = {
3662
3756
  // static fields
3663
- selectedSla: g,
3757
+ selectedSla: p,
3664
3758
  deliveryChannel: f,
3665
3759
  deliveryCompany: h,
3666
3760
  deliveryWindow: v,
3667
- shippingEstimate: p,
3761
+ shippingEstimate: u,
3668
3762
  shippingEstimateDate: S,
3669
3763
  seller: _,
3670
3764
  friendlyShippingEstimate: m,
3671
- friendlyDeliveryOptionName: D,
3672
- address: A,
3765
+ friendlyDeliveryOptionName: E,
3766
+ address: w,
3673
3767
  pickupStoreInfo: l,
3674
3768
  // dynamic fields
3675
3769
  quantityOfDifferentItems: 0,
3676
3770
  total: 0,
3677
3771
  items: []
3678
- }), u[I] && (u[I].items?.push({
3772
+ }), d[I] && (d[I].items?.push({
3679
3773
  id: C?.id || "",
3680
3774
  uniqueId: C?.uniqueId || "",
3681
3775
  name: C?.name || "",
@@ -3683,11 +3777,11 @@ const sa = {
3683
3777
  price: C?.price || 0,
3684
3778
  sellingPrice: C?.sellingPrice || 0,
3685
3779
  imageUrl: C?.imageUrl || "",
3686
- taxPriceTags: P ?? [],
3687
- taxPriceTagsTotal: E ?? 0,
3780
+ taxPriceTags: R ?? [],
3781
+ taxPriceTagsTotal: D ?? 0,
3688
3782
  tax: C?.tax || 0,
3689
- total: R
3690
- }), u[I].quantityOfDifferentItems = (u[I].quantityOfDifferentItems ?? 0) + 1, u[I].total = (u[I].total ?? 0) + R), u;
3783
+ total: P
3784
+ }), d[I].quantityOfDifferentItems = (d[I].quantityOfDifferentItems ?? 0) + 1, d[I].total = (d[I].total ?? 0) + P), d;
3691
3785
  },
3692
3786
  {}
3693
3787
  ), o = Object.values(a), s = n?.contactInformation?.[0], c = {
@@ -3713,7 +3807,7 @@ const sa = {
3713
3807
  ) || [];
3714
3808
  }
3715
3809
  };
3716
- function da(e) {
3810
+ function ba(e) {
3717
3811
  const t = e.filter(
3718
3812
  (i) => i?.name?.includes("TAX")
3719
3813
  ), r = t.reduce(
@@ -3725,28 +3819,28 @@ function da(e) {
3725
3819
  taxPriceTagsTotal: r
3726
3820
  };
3727
3821
  }
3728
- const ua = {
3729
- StoreCollection: vn,
3730
- StoreAggregateOffer: fr,
3731
- StoreProduct: Ri,
3732
- StoreSeo: Ki,
3733
- StoreFacet: Ar,
3734
- StoreFacetBoolean: Dr,
3735
- StoreFacetRange: Pr,
3736
- StoreFacetValueBoolean: Er,
3737
- StoreOffer: Pi,
3738
- StoreAggregateRating: Sr,
3739
- StoreReview: Xi,
3740
- StoreProductGroup: Ni,
3741
- StoreSearchResult: Ji,
3742
- StorePropertyValue: Li,
3743
- SkuVariants: sa,
3744
- ShippingSLA: na,
3745
- UserOrderResult: la,
3746
- ObjectOrString: Di,
3747
- Query: Hi,
3748
- Mutation: Ci
3749
- }, pa = () => ua, ga = `"""
3822
+ const wa = {
3823
+ StoreCollection: wn,
3824
+ StoreAggregateOffer: Cr,
3825
+ StoreProduct: Gi,
3826
+ StoreSeo: da,
3827
+ StoreFacet: Ur,
3828
+ StoreFacetBoolean: Rr,
3829
+ StoreFacetRange: Tr,
3830
+ StoreFacetValueBoolean: Fr,
3831
+ StoreOffer: zi,
3832
+ StoreAggregateRating: br,
3833
+ StoreReview: sa,
3834
+ StoreProductGroup: Xi,
3835
+ StoreSearchResult: la,
3836
+ StorePropertyValue: Yi,
3837
+ SkuVariants: va,
3838
+ ShippingSLA: ma,
3839
+ UserOrderResult: Ca,
3840
+ ObjectOrString: Mi,
3841
+ Query: oa,
3842
+ Mutation: Li
3843
+ }, Aa = () => wa, Da = `"""
3750
3844
  Address information.
3751
3845
  """
3752
3846
  type Address {
@@ -3791,7 +3885,7 @@ type Address {
3791
3885
  """
3792
3886
  geoCoordinates: [Float]
3793
3887
  }
3794
- `, ma = `"""
3888
+ `, Pa = `"""
3795
3889
  Advertisement information about a specific product in a campaign
3796
3890
  """
3797
3891
  type Advertisement {
@@ -3816,7 +3910,7 @@ type Advertisement {
3816
3910
  """
3817
3911
  adResponseId: String!
3818
3912
  }
3819
- `, ha = `"""
3913
+ `, Ea = `"""
3820
3914
  Aggregate offer information, for a given SKU that is available to be fulfilled by multiple sellers.
3821
3915
  """
3822
3916
  type StoreAggregateOffer {
@@ -3845,7 +3939,7 @@ type StoreAggregateOffer {
3845
3939
  """
3846
3940
  offers: [StoreOffer!]!
3847
3941
  }
3848
- `, fa = `"""
3942
+ `, ka = `"""
3849
3943
  Average rating, based on multiple ratings or reviews.
3850
3944
  """
3851
3945
  type StoreAggregateRating {
@@ -3858,7 +3952,7 @@ type StoreAggregateRating {
3858
3952
  """
3859
3953
  reviewCount: Int!
3860
3954
  }
3861
- `, Sa = `"""
3955
+ `, _a = `"""
3862
3956
  information about the author of a product review or rating.
3863
3957
  """
3864
3958
  type StoreAuthor {
@@ -3867,7 +3961,7 @@ type StoreAuthor {
3867
3961
  """
3868
3962
  name: String!
3869
3963
  }
3870
- `, ya = `"""
3964
+ `, Ua = `"""
3871
3965
  Brand of a given product.
3872
3966
  """
3873
3967
  type StoreBrand {
@@ -3876,7 +3970,7 @@ type StoreBrand {
3876
3970
  """
3877
3971
  name: String!
3878
3972
  }
3879
- `, Ia = `"""
3973
+ `, Ra = `"""
3880
3974
  Item of a list.
3881
3975
  """
3882
3976
  type StoreListItem {
@@ -3907,7 +4001,7 @@ type StoreBreadcrumbList {
3907
4001
  """
3908
4002
  numberOfItems: Int!
3909
4003
  }
3910
- `, va = `"""
4004
+ `, Ta = `"""
3911
4005
  Shopping cart message.
3912
4006
  """
3913
4007
  type StoreCartMessage {
@@ -3944,7 +4038,7 @@ input IStoreCart {
3944
4038
  """
3945
4039
  order: IStoreOrder!
3946
4040
  }
3947
- `, Oa = `"""
4041
+ `, Fa = `"""
3948
4042
  Product collection type. Possible values are \`Department\`, \`Category\`, \`Brand\` or \`Collection\`.
3949
4043
 
3950
4044
  \`SubCategory\` and \`Cluster\` are still declared for backward compatibility but are
@@ -4070,7 +4164,7 @@ type StoreCollectionLocale {
4070
4164
  """
4071
4165
  slug: String!
4072
4166
  }
4073
- `, ba = `"""
4167
+ `, Na = `"""
4074
4168
  Delivery Promise badge.
4075
4169
  """
4076
4170
  type DeliveryPromiseBadge {
@@ -4079,7 +4173,7 @@ type DeliveryPromiseBadge {
4079
4173
  """
4080
4174
  typeName: String
4081
4175
  }
4082
- `, Ca = `union StoreFacet = StoreFacetRange | StoreFacetBoolean
4176
+ `, La = `union StoreFacet = StoreFacetRange | StoreFacetBoolean
4083
4177
 
4084
4178
  """
4085
4179
  Search facet range information.
@@ -4156,7 +4250,7 @@ type StoreFacetValueBoolean {
4156
4250
  """
4157
4251
  quantity: Int
4158
4252
  }
4159
- `, wa = `"""
4253
+ `, Ba = `"""
4160
4254
  Image.
4161
4255
  """
4162
4256
  type StoreImage {
@@ -4183,7 +4277,7 @@ input IStoreImage {
4183
4277
  """
4184
4278
  alternateName: String!
4185
4279
  }
4186
- `, Aa = `type Mutation {
4280
+ `, $a = `type Mutation {
4187
4281
  """
4188
4282
  Checks for changes between the cart presented in the UI and the cart stored in the ecommerce platform. If changes are detected, it returns the cart stored on the platform. Otherwise, it returns \`null\`.
4189
4283
  """
@@ -4225,7 +4319,7 @@ input IStoreImage {
4225
4319
  """
4226
4320
  startRecommendationSession: Boolean!
4227
4321
  }
4228
- `, Da = `"""
4322
+ `, Ma = `"""
4229
4323
  Newsletter information.
4230
4324
  """
4231
4325
  type PersonNewsletter {
@@ -4248,8 +4342,8 @@ input IPersonNewsletter {
4248
4342
  """
4249
4343
  email: String!
4250
4344
  }
4251
- `, Pa = `scalar ObjectOrString
4252
- `, Ea = `"""
4345
+ `, za = `scalar ObjectOrString
4346
+ `, Va = `"""
4253
4347
  Offer information.
4254
4348
  """
4255
4349
  type StoreOffer {
@@ -4342,7 +4436,7 @@ input IStoreOffer {
4342
4436
  """
4343
4437
  priceToken: String
4344
4438
  }
4345
- `, ka = `"""
4439
+ `, qa = `"""
4346
4440
  Information of a specific order.
4347
4441
  """
4348
4442
  type StoreOrder {
@@ -4383,7 +4477,7 @@ input IStoreOrder {
4383
4477
  """
4384
4478
  shouldSplitItem: Boolean
4385
4479
  }
4386
- `, _a = `"""
4480
+ `, xa = `"""
4387
4481
  Commercial Authorization response.
4388
4482
  """
4389
4483
  type CommercialAuthorizationResponse {
@@ -4782,7 +4876,7 @@ type ProcessOrderAuthorizationRule {
4782
4876
  """
4783
4877
  rule: CommercialAuthorizationRule!
4784
4878
  }
4785
- `, Ua = `"""
4879
+ `, ja = `"""
4786
4880
  Input for uploading a file to the Order Entry Service.
4787
4881
  The file is transmitted as a Base64-encoded string so it can travel
4788
4882
  through the standard GraphQL JSON pipeline without multipart support.
@@ -4843,7 +4937,7 @@ type StoreOrderFormCartItem {
4843
4937
  seller: String!
4844
4938
  unitMultiplier: Float
4845
4939
  }
4846
- `, Ta = `"""
4940
+ `, Wa = `"""
4847
4941
  Organization.
4848
4942
  """
4849
4943
  type StoreOrganization {
@@ -4884,7 +4978,7 @@ type StoreContract {
4884
4978
  """
4885
4979
  isDefault: Boolean!
4886
4980
  }
4887
- `, Ra = `"""
4981
+ `, Ga = `"""
4888
4982
  Whenever you make a query that allows for pagination, such as \`allProducts\` or \`allCollections\`, you can check \`StorePageInfo\` to learn more about the complete set of items and use it to paginate your queries.
4889
4983
  """
4890
4984
  type StorePageInfo {
@@ -4909,7 +5003,7 @@ type StorePageInfo {
4909
5003
  """
4910
5004
  totalCount: Int!
4911
5005
  }
4912
- `, Fa = `"""
5006
+ `, Ha = `"""
4913
5007
  Input type for setting a new password.
4914
5008
  """
4915
5009
  input ISetPassword {
@@ -4952,7 +5046,7 @@ type SetPasswordResponse {
4952
5046
  """
4953
5047
  message: String
4954
5048
  }
4955
- `, Na = `"""
5049
+ `, Xa = `"""
4956
5050
  Client profile data.
4957
5051
  """
4958
5052
  type StorePerson {
@@ -4995,7 +5089,7 @@ input IStorePerson {
4995
5089
  """
4996
5090
  familyName: String!
4997
5091
  }
4998
- `, La = `type PickupPointAddress {
5092
+ `, Ya = `type PickupPointAddress {
4999
5093
  """
5000
5094
  Address city.
5001
5095
  """
@@ -5074,7 +5168,7 @@ type PickupPoints {
5074
5168
  """
5075
5169
  pickupPointsHash: String
5076
5170
  }
5077
- `, Ba = `"""
5171
+ `, Ja = `"""
5078
5172
  Product information. Products are variants within product groups, equivalent to VTEX [SKUs](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
5079
5173
  """
5080
5174
  type StoreProduct {
@@ -5250,7 +5344,7 @@ input IStoreProduct {
5250
5344
  """
5251
5345
  additionalProperty: [IStorePropertyValue!]
5252
5346
  }
5253
- `, $a = `"""
5347
+ `, Ka = `"""
5254
5348
  Product group information. Product groups are catalog entities that may contain variants. They are equivalent to VTEX [Products](https://help.vtex.com/en/tutorial/what-is-a-product--2zrB2gFCHyQokCKKE8kuAw#), whereas each variant is equivalent to a VTEX [SKU](https://help.vtex.com/en/tutorial/what-is-an-sku--1K75s4RXAQyOuGUYKMM68u#). For example, you may have a **Shirt** product group with associated products such as **Blue shirt size L**, **Green shirt size XL** and so on.
5255
5349
  """
5256
5350
  type StoreProductGroup {
@@ -5295,7 +5389,7 @@ type StoreProductCluster {
5295
5389
  """
5296
5390
  name: String!
5297
5391
  }
5298
- `, Ma = `type Profile {
5392
+ `, Qa = `type Profile {
5299
5393
  """
5300
5394
  Collection of user's address
5301
5395
  """
@@ -5356,7 +5450,7 @@ type ProfileAddress {
5356
5450
  """
5357
5451
  geoCoordinate: [Float]
5358
5452
  }
5359
- `, za = `"""
5453
+ `, Za = `"""
5360
5454
  Properties that can be associated with products and products groups.
5361
5455
  """
5362
5456
  type StorePropertyValue {
@@ -5396,7 +5490,7 @@ input IStorePropertyValue {
5396
5490
  """
5397
5491
  valueReference: ObjectOrString!
5398
5492
  }
5399
- `, Va = `"""
5493
+ `, eo = `"""
5400
5494
  Each product edge contains a \`node\`, with product information, and a \`cursor\`, that can be used as a reference for pagination.
5401
5495
  """
5402
5496
  type StoreProductEdge {
@@ -6045,7 +6139,7 @@ type StoreAccountProfile {
6045
6139
  email: String
6046
6140
  id: String
6047
6141
  }
6048
- `, xa = `"""
6142
+ `, no = `"""
6049
6143
  Summary of a quote returned in list results.
6050
6144
  """
6051
6145
  type UserQuoteSummary {
@@ -6110,7 +6204,7 @@ type UserQuoteListPaging {
6110
6204
  """
6111
6205
  perPage: Int!
6112
6206
  }
6113
- `, qa = `type RecommendationResponse {
6207
+ `, to = `type RecommendationResponse {
6114
6208
  products: [StoreProduct!]!
6115
6209
  correlationId: String!
6116
6210
  campaign: RecommendationCampaign!
@@ -6121,7 +6215,7 @@ type RecommendationCampaign {
6121
6215
  title: String
6122
6216
  type: String!
6123
6217
  }
6124
- `, ja = `"""
6218
+ `, ro = `"""
6125
6219
  Information of a given review rating.
6126
6220
  """
6127
6221
  type StoreReviewRating {
@@ -6148,7 +6242,7 @@ type StoreReview {
6148
6242
  """
6149
6243
  author: StoreAuthor!
6150
6244
  }
6151
- `, Wa = `"""
6245
+ `, io = `"""
6152
6246
  Whether a saved card is personally owned by the buyer or shared by their
6153
6247
  Organization/Contract. Resolved server-side by the Saved-cards service from
6154
6248
  the buyer's \`useAdHocCard\` role — never inferred client-side.
@@ -6212,7 +6306,7 @@ type SavedCardListResult {
6212
6306
  """
6213
6307
  list: [SavedCard!]
6214
6308
  }
6215
- `, Ga = `"""
6309
+ `, ao = `"""
6216
6310
  Search Engine Optimization (SEO) tags data.
6217
6311
  """
6218
6312
  type StoreSeo {
@@ -6233,7 +6327,7 @@ type StoreSeo {
6233
6327
  """
6234
6328
  canonical: String!
6235
6329
  }
6236
- `, Ha = `"""
6330
+ `, oo = `"""
6237
6331
  Currency information.
6238
6332
  """
6239
6333
  type StoreCurrency {
@@ -6508,7 +6602,7 @@ input IStoreSession {
6508
6602
  """
6509
6603
  refreshAfter: String
6510
6604
  }
6511
- `, Xa = `"""
6605
+ `, so = `"""
6512
6606
  Shipping Simulation item input.
6513
6607
  """
6514
6608
  input IShippingItem {
@@ -6839,7 +6933,7 @@ type MessageFields {
6839
6933
  """
6840
6934
  skuName: String
6841
6935
  }
6842
- `, Ya = `type SkuVariants {
6936
+ `, co = `type SkuVariants {
6843
6937
  """
6844
6938
  SKU property values for the current SKU.
6845
6939
  """
@@ -6934,7 +7028,7 @@ Example:
6934
7028
  \`\`\`
6935
7029
  """
6936
7030
  scalar FormattedVariants
6937
- `, Ja = `"""
7031
+ `, lo = `"""
6938
7032
  Status used to indicate a message type. For instance, a shopping cart informative or error message.
6939
7033
  """
6940
7034
  enum StoreStatus {
@@ -6942,7 +7036,7 @@ enum StoreStatus {
6942
7036
  WARNING
6943
7037
  ERROR
6944
7038
  }
6945
- `, Ka = `scalar JSONObject
7039
+ `, uo = `scalar JSONObject
6946
7040
 
6947
7041
  type UserOrder {
6948
7042
  orderId: String
@@ -7766,99 +7860,99 @@ type UserOrderBudgetAllocationLinkedEntity {
7766
7860
  type: String
7767
7861
  id: String
7768
7862
  }
7769
- `, Qa = /* @__PURE__ */ Object.assign({
7770
- "./address.graphql": ga,
7771
- "./advertisement.graphql": ma,
7772
- "./aggregateOffer.graphql": ha,
7773
- "./aggregateRating.graphql": fa,
7774
- "./author.graphql": Sa,
7775
- "./brand.graphql": ya,
7776
- "./breadcrumb.graphql": Ia,
7777
- "./cart.graphql": va,
7778
- "./collection.graphql": Oa,
7779
- "./deliveryPromisesBadge.graphql": ba,
7780
- "./facet.graphql": Ca,
7781
- "./image.graphql": wa,
7782
- "./mutation.graphql": Aa,
7783
- "./newsletter.graphql": Da,
7784
- "./objectOrString.graphql": Pa,
7785
- "./offer.graphql": Ea,
7786
- "./order.graphql": ka,
7787
- "./orderCommercialAuthorizaton.graphql": _a,
7788
- "./orderEntry.graphql": Ua,
7789
- "./organization.graphql": Ta,
7790
- "./pageInfo.graphql": Ra,
7791
- "./password.graphql": Fa,
7792
- "./person.graphql": Na,
7793
- "./pickupPoints.graphql": La,
7794
- "./product.graphql": Ba,
7795
- "./productGroup.graphql": $a,
7796
- "./profile.graphql": Ma,
7797
- "./propertyValue.graphql": za,
7798
- "./query.graphql": Va,
7799
- "./quote.graphql": xa,
7800
- "./recommendation.graphql": qa,
7801
- "./review.graphql": ja,
7802
- "./savedCard.graphql": Wa,
7803
- "./seo.graphql": Ga,
7804
- "./session.graphql": Ha,
7805
- "./shipping.graphql": Xa,
7806
- "./skuVariants.graphql": Ya,
7807
- "./status.graphql": Ja,
7808
- "./userOrder.graphql": Ka
7809
- }), Za = Wn(
7810
- Object.values(Qa).map((e) => Gn(e)).reduce(
7811
- (e, n) => sn([e, n], { sort: !0 })
7863
+ `, po = /* @__PURE__ */ Object.assign({
7864
+ "./address.graphql": Da,
7865
+ "./advertisement.graphql": Pa,
7866
+ "./aggregateOffer.graphql": Ea,
7867
+ "./aggregateRating.graphql": ka,
7868
+ "./author.graphql": _a,
7869
+ "./brand.graphql": Ua,
7870
+ "./breadcrumb.graphql": Ra,
7871
+ "./cart.graphql": Ta,
7872
+ "./collection.graphql": Fa,
7873
+ "./deliveryPromisesBadge.graphql": Na,
7874
+ "./facet.graphql": La,
7875
+ "./image.graphql": Ba,
7876
+ "./mutation.graphql": $a,
7877
+ "./newsletter.graphql": Ma,
7878
+ "./objectOrString.graphql": za,
7879
+ "./offer.graphql": Va,
7880
+ "./order.graphql": qa,
7881
+ "./orderCommercialAuthorizaton.graphql": xa,
7882
+ "./orderEntry.graphql": ja,
7883
+ "./organization.graphql": Wa,
7884
+ "./pageInfo.graphql": Ga,
7885
+ "./password.graphql": Ha,
7886
+ "./person.graphql": Xa,
7887
+ "./pickupPoints.graphql": Ya,
7888
+ "./product.graphql": Ja,
7889
+ "./productGroup.graphql": Ka,
7890
+ "./profile.graphql": Qa,
7891
+ "./propertyValue.graphql": Za,
7892
+ "./query.graphql": eo,
7893
+ "./quote.graphql": no,
7894
+ "./recommendation.graphql": to,
7895
+ "./review.graphql": ro,
7896
+ "./savedCard.graphql": io,
7897
+ "./seo.graphql": ao,
7898
+ "./session.graphql": oo,
7899
+ "./shipping.graphql": so,
7900
+ "./skuVariants.graphql": co,
7901
+ "./status.graphql": lo,
7902
+ "./userOrder.graphql": uo
7903
+ }), go = Qn(
7904
+ Object.values(po).map((e) => Zn(e)).reduce(
7905
+ (e, n) => dn([e, n], { sort: !0 })
7812
7906
  )
7813
- ), eo = Za, Io = async (e) => (n) => (n.storage = {
7814
- channel: ne.parse(e.channel),
7907
+ ), mo = go, Ro = async (e) => (n) => (n.storage = {
7908
+ channel: ie.parse(e.channel),
7815
7909
  flags: e.flags ?? {},
7816
7910
  locale: e.locale,
7817
7911
  customSortMap: e.customSortMap ?? {},
7818
7912
  cookies: /* @__PURE__ */ new Map()
7819
- }, n.account = e.account, n.OTEL_ENABLED = e.OTEL_ENABLED, n.discoveryConfig = e.discoveryConfig, n.clients = tr(e, n), n.loaders = pr(e, n), n);
7820
- function no() {
7821
- const e = pa(), n = {};
7913
+ }, n.account = e.account, n.OTEL_ENABLED = e.OTEL_ENABLED, n.discoveryConfig = e.discoveryConfig, n.clients = cr(e, n), n.loaders = yr(e, n), n);
7914
+ function ho() {
7915
+ const e = Aa(), n = {};
7822
7916
  for (const [t, r] of Object.entries(e))
7823
7917
  n[t] = Object.fromEntries(
7824
- Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, mt(a, `${t}(${i})`)])
7918
+ Object.entries(r).map(([i, a]) => typeof a != "function" ? [i, a] : [i, vt(a, `${t}(${i})`)])
7825
7919
  );
7826
7920
  return n;
7827
7921
  }
7828
- function vo(e) {
7829
- const t = pt([
7830
- ut,
7831
- ct
7832
- ])(no(), eo);
7833
- return e && Hn(e) ? qn({
7922
+ function To(e) {
7923
+ const t = It([
7924
+ yt,
7925
+ ht
7926
+ ])(ho(), mo);
7927
+ return e && et(e) ? Jn({
7834
7928
  schemas: [t, e]
7835
7929
  }) : t;
7836
7930
  }
7837
7931
  export {
7838
- ct as AuthDirective,
7932
+ ht as AuthDirective,
7839
7933
  k as BadRequestError,
7840
- ut as CacheControlDirective,
7841
- Qn as CardOrigin,
7842
- Zn as CommercialAuthorizationStatus,
7843
- ee as FastStoreError,
7844
- K as ForbiddenError,
7845
- Io as GraphqlVtexContextFactory,
7846
- vo as GraphqlVtexSchema,
7847
- $ as NotFoundError,
7848
- et as StoreCollectionType,
7849
- nt as StoreFacetType,
7850
- tt as StoreSort,
7851
- rt as StoreStatus,
7852
- ie as UnauthorizedError,
7853
- it as UserOrderInvoiceType,
7854
- L as getAuthCookie,
7855
- So as isBadRequestError,
7856
- fo as isFastStoreError,
7857
- ht as isForbiddenError,
7858
- J as isNotFoundError,
7859
- yo as isUnauthorizedError,
7860
- ho as stringifyCacheControl,
7861
- eo as typeDefs,
7862
- ot as validateUserAuthentication,
7863
- pt as withDirectives
7934
+ yt as CacheControlDirective,
7935
+ at as CardOrigin,
7936
+ ot as CommercialAuthorizationStatus,
7937
+ X as FastStoreError,
7938
+ ne as ForbiddenError,
7939
+ Ro as GraphqlVtexContextFactory,
7940
+ To as GraphqlVtexSchema,
7941
+ z as NotFoundError,
7942
+ st as StoreCollectionType,
7943
+ ct as StoreFacetType,
7944
+ lt as StoreSort,
7945
+ dt as StoreStatus,
7946
+ ce as UnauthorizedError,
7947
+ ut as UserOrderInvoiceType,
7948
+ $ as getAuthCookie,
7949
+ _o as isBadRequestError,
7950
+ ko as isFastStoreError,
7951
+ Ot as isForbiddenError,
7952
+ ee as isNotFoundError,
7953
+ Uo as isUnauthorizedError,
7954
+ Eo as stringifyCacheControl,
7955
+ mo as typeDefs,
7956
+ gt as validateUserAuthentication,
7957
+ It as withDirectives
7864
7958
  };