@soma-vertical-web/multi-lib 1.0.20 → 1.0.21

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/index2.mjs CHANGED
@@ -1,1642 +1,1643 @@
1
- import { jsx as b, jsxs as G, Fragment as B } from "react/jsx-runtime";
2
- import { x as S, r as k, S as se, y as oe, z as ie, a as ce, v as le, t as ue, A as de, p as me, B as pe, C as fe, D as ge, e as he, E as ye } from "./index-CpUjW-m9.mjs";
3
- import { Utils as j, helpers as D } from "@soma-vertical-web/core-components";
4
- import * as n from "yup";
5
- import be from "sanitize-html";
6
- const Ie = async ({
7
- children: t,
8
- ClientCartProvider: e,
9
- ...a
1
+ import { jsx as N, jsxs as K, Fragment as me } from "react/jsx-runtime";
2
+ import { F as $, y as se, S as Pt, G as St, H as Ct, a as xt, j as kt, m as Et, r as At, q as Tt, k as Ve, n as Ot, o as qt, l as Nt, D as jt, C as Ft, I as $t, p as Lt, A as Re, J as Dt, K as Ut, L as Ht, e as Mt } from "./index-BhiCzrut.mjs";
3
+ import { Utils as le, helpers as ce } from "@soma-vertical-web/core-components";
4
+ import * as c from "yup";
5
+ import Bt from "sanitize-html";
6
+ import { decodeJwt as zt } from "jose";
7
+ const Gt = async ({
8
+ children: e,
9
+ ClientCartProvider: t,
10
+ ...r
10
11
  }) => {
11
- const { data: r } = await S(
12
+ const { data: n } = await $(
12
13
  "mini_cart",
13
- a
14
+ r
14
15
  );
15
- return /* @__PURE__ */ b(e, { ...r ? Array.isArray(r) ? { data: r[0] } : { data: r } : {}, children: t });
16
- }, Re = ({
17
- slug: t,
18
- data: e,
19
- SectionZone: a,
20
- COMMON_PAGE_COLUMN_GAP: r,
21
- identifyWhoIsFirst: s
16
+ return /* @__PURE__ */ N(t, { ...n ? Array.isArray(n) ? { data: n[0] } : { data: n } : {}, children: e });
17
+ }, Vt = ({
18
+ slug: e,
19
+ data: t,
20
+ SectionZone: r,
21
+ COMMON_PAGE_COLUMN_GAP: n,
22
+ identifyWhoIsFirst: i
22
23
  }) => {
23
- const o = e == null ? void 0 : e.find(
24
- (d) => {
25
- var R, f, p, y;
26
- return ((f = (R = d.config) == null ? void 0 : R.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
27
- }
28
- ), i = o == null ? void 0 : o.config.responsive.gapCustom, u = o == null ? void 0 : o.config.responsive.gapSections, c = e == null ? void 0 : e.find(
29
- (d) => {
30
- var R, f, p, y;
31
- return ((f = (R = d.config) == null ? void 0 : R.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
32
- }
33
- ), m = c == null ? void 0 : c.config.responsive.gapCustom, l = c == null ? void 0 : c.config.responsive.gapSections;
34
- return /* @__PURE__ */ G(B, { children: [
35
- /* @__PURE__ */ b(
36
- j.Column,
24
+ const a = t == null ? void 0 : t.find(
25
+ (u) => {
26
+ var w, v, y, _;
27
+ return ((v = (w = u.config) == null ? void 0 : w.responsive) == null ? void 0 : v.deviceType) === "desktop" && ((_ = (y = u.config) == null ? void 0 : y.seo) == null ? void 0 : _.slug) === e;
28
+ }
29
+ ), s = a == null ? void 0 : a.config.responsive.gapCustom, o = a == null ? void 0 : a.config.responsive.gapSections, d = t == null ? void 0 : t.find(
30
+ (u) => {
31
+ var w, v, y, _;
32
+ return ((v = (w = u.config) == null ? void 0 : w.responsive) == null ? void 0 : v.deviceType) === "mobile" && ((_ = (y = u.config) == null ? void 0 : y.seo) == null ? void 0 : _.slug) === e;
33
+ }
34
+ ), g = d == null ? void 0 : d.config.responsive.gapCustom, l = d == null ? void 0 : d.config.responsive.gapSections;
35
+ return /* @__PURE__ */ K(me, { children: [
36
+ /* @__PURE__ */ N(
37
+ le.Column,
37
38
  {
38
- gap: i && u ? u : r,
39
- className: D.classNameConcat(
40
- k["responsive-desktop-flex"],
39
+ gap: s && o ? o : n,
40
+ className: ce.classNameConcat(
41
+ se["responsive-desktop-flex"],
41
42
  "utils-column-modifier"
42
43
  ),
43
- children: /* @__PURE__ */ b(a, { data: (o == null ? void 0 : o.sections) ?? [], identifyWhoIsFirst: s })
44
+ children: /* @__PURE__ */ N(r, { data: (a == null ? void 0 : a.sections) ?? [], identifyWhoIsFirst: i })
44
45
  }
45
46
  ),
46
- /* @__PURE__ */ b(
47
- j.Column,
47
+ /* @__PURE__ */ N(
48
+ le.Column,
48
49
  {
49
- gap: m && l ? l : r,
50
- className: D.classNameConcat(
51
- k["responsive-mobile-flex"],
50
+ gap: g && l ? l : n,
51
+ className: ce.classNameConcat(
52
+ se["responsive-mobile-flex"],
52
53
  "utils-column-modifier"
53
54
  ),
54
- children: /* @__PURE__ */ b(a, { data: (c == null ? void 0 : c.sections) ?? [], identifyWhoIsFirst: s })
55
+ children: /* @__PURE__ */ N(r, { data: (d == null ? void 0 : d.sections) ?? [], identifyWhoIsFirst: i })
55
56
  }
56
57
  )
57
58
  ] });
58
- }, Ce = async ({
59
- slug: t,
60
- SectionZone: e,
61
- COMMON_PAGE_COLUMN_GAP: a,
62
- identifyWhoIsFirst: r = !1,
63
- ...s
59
+ }, Wt = async ({
60
+ slug: e,
61
+ SectionZone: t,
62
+ COMMON_PAGE_COLUMN_GAP: r,
63
+ identifyWhoIsFirst: n = !1,
64
+ ...i
64
65
  }) => {
65
- const { data: o } = await S(
66
+ const { data: a } = await $(
66
67
  "common_page",
67
- s
68
+ i
68
69
  );
69
- return !o || !Array.isArray(o) || o.length === 0 ? null : /* @__PURE__ */ b(
70
- Re,
70
+ return !a || !Array.isArray(a) || a.length === 0 ? null : /* @__PURE__ */ N(
71
+ Vt,
71
72
  {
72
- data: o,
73
- slug: t,
74
- SectionZone: e,
75
- COMMON_PAGE_COLUMN_GAP: a,
76
- identifyWhoIsFirst: r
73
+ data: a,
74
+ slug: e,
75
+ SectionZone: t,
76
+ COMMON_PAGE_COLUMN_GAP: r,
77
+ identifyWhoIsFirst: n
77
78
  }
78
79
  );
79
- }, ve = async ({
80
- children: t,
81
- ClientFlagsAndTagsProvider: e,
82
- ...a
80
+ }, Qt = async ({
81
+ children: e,
82
+ ClientFlagsAndTagsProvider: t,
83
+ ...r
83
84
  }) => {
84
- const { data: r } = await S(
85
+ const { data: n } = await $(
85
86
  "flags_and_tags",
86
- a
87
+ r
87
88
  );
88
- return !r || !Array.isArray(r) ? null : /* @__PURE__ */ b(e, { data: r[0], children: t });
89
- }, Se = async ({
90
- className: t,
91
- PAYMENT_FLAGS_DICTIONARY: e,
92
- PAYMENT_FLAGS: a,
93
- LEGAL_INFORMATION_TEXT: r,
94
- ICONS: s,
95
- SectionZone: o,
96
- Footer: i,
97
- FooterSupport: u,
98
- hasFooterStamps: c,
99
- ...m
89
+ return !n || !Array.isArray(n) ? null : /* @__PURE__ */ N(t, { data: n[0], children: e });
90
+ }, Xt = async ({
91
+ className: e,
92
+ PAYMENT_FLAGS_DICTIONARY: t,
93
+ PAYMENT_FLAGS: r,
94
+ LEGAL_INFORMATION_TEXT: n,
95
+ ICONS: i,
96
+ SectionZone: a,
97
+ Footer: s,
98
+ FooterSupport: o,
99
+ hasFooterStamps: d,
100
+ ...g
100
101
  }) => {
101
- var f, p, y, I, T, q, O, g, E, C, F;
102
- const { data: l } = await S("footer", m), d = Array.isArray(l) && ((f = l[0]) == null ? void 0 : f.type) === "footer" ? l[0] : null, R = {
103
- ...(p = d == null ? void 0 : d.paymentInfo) == null ? void 0 : p.paymentInfo,
102
+ var v, y, _, p, b, m, h, f, E, q, I;
103
+ const { data: l } = await $("footer", g), u = Array.isArray(l) && ((v = l[0]) == null ? void 0 : v.type) === "footer" ? l[0] : null, w = {
104
+ ...(y = u == null ? void 0 : u.paymentInfo) == null ? void 0 : y.paymentInfo,
104
105
  acceptedFlags: Array.isArray(
105
- (y = d == null ? void 0 : d.paymentInfo) == null ? void 0 : y.paymentInfo.acceptedFlags
106
- ) ? (I = d == null ? void 0 : d.paymentInfo) == null ? void 0 : I.paymentInfo.acceptedFlags.filter((v) => !!e[v]).map(
107
- (v) => e[v]
106
+ (_ = u == null ? void 0 : u.paymentInfo) == null ? void 0 : _.paymentInfo.acceptedFlags
107
+ ) ? (p = u == null ? void 0 : u.paymentInfo) == null ? void 0 : p.paymentInfo.acceptedFlags.filter((R) => !!t[R]).map(
108
+ (R) => t[R]
108
109
  ) : []
109
110
  };
110
- return d ? /* @__PURE__ */ b(
111
- i,
111
+ return u ? /* @__PURE__ */ N(
112
+ s,
112
113
  {
113
- className: t,
114
- data: { ...d },
115
- socialInfo: (T = d.socialMedia) == null ? void 0 : T.socialMedia,
116
- socialMedias: (O = (q = d.socialMedia) == null ? void 0 : q.socialMedia) == null ? void 0 : O.medias,
117
- payments: R,
118
- hasFooterStamps: c,
114
+ className: e,
115
+ data: { ...u },
116
+ socialInfo: (b = u.socialMedia) == null ? void 0 : b.socialMedia,
117
+ socialMedias: (h = (m = u.socialMedia) == null ? void 0 : m.socialMedia) == null ? void 0 : h.medias,
118
+ payments: w,
119
+ hasFooterStamps: d,
119
120
  adornment: {
120
- ...(E = (g = d.supportInfo) == null ? void 0 : g.supportInfo) != null && E.content ? {
121
- bottom: /* @__PURE__ */ b(
122
- u,
121
+ ...(E = (f = u.supportInfo) == null ? void 0 : f.supportInfo) != null && E.content ? {
122
+ bottom: /* @__PURE__ */ N(
123
+ o,
123
124
  {
124
- content: (F = (C = d.supportInfo) == null ? void 0 : C.supportInfo) == null ? void 0 : F.content,
125
+ content: (I = (q = u.supportInfo) == null ? void 0 : q.supportInfo) == null ? void 0 : I.content,
125
126
  CONSTANTS: {
126
- ICONS: s,
127
- PAYMENT_FLAGS: a,
128
- PAYMENT_FLAGS_DICTIONARY: e
127
+ ICONS: i,
128
+ PAYMENT_FLAGS: r,
129
+ PAYMENT_FLAGS_DICTIONARY: t
129
130
  }
130
131
  }
131
132
  )
132
133
  } : {},
133
- ...d.sections.length ? { top: /* @__PURE__ */ b(o, { data: d.sections }) } : {}
134
+ ...u.sections.length ? { top: /* @__PURE__ */ N(a, { data: u.sections }) } : {}
134
135
  },
135
- LEGAL_INFORMATION_TEXT: r,
136
- ICONS: s
136
+ LEGAL_INFORMATION_TEXT: n,
137
+ ICONS: i
137
138
  }
138
139
  ) : null;
139
- }, Ee = async ({
140
- children: t,
141
- ClientHeaderProvider: e,
142
- ...a
140
+ }, Kt = async ({
141
+ children: e,
142
+ ClientHeaderProvider: t,
143
+ ...r
143
144
  }) => {
144
- var o, i, u, c, m, l;
145
- const { data: r } = await S(
145
+ var a, s, o, d, g, l;
146
+ const { data: n } = await $(
146
147
  "header",
147
- a
148
- ), s = Array.isArray(r) ? r[0] : void 0;
149
- return /* @__PURE__ */ b(
150
- e,
148
+ r
149
+ ), i = Array.isArray(n) ? n[0] : void 0;
150
+ return /* @__PURE__ */ N(
151
+ t,
151
152
  {
152
153
  headerData: {
153
- ...((o = s == null ? void 0 : s.layerConfig) == null ? void 0 : o.config) ?? {},
154
- subMenus: ((i = s == null ? void 0 : s.sections) == null ? void 0 : i.map((d) => d.data)) ?? [],
155
- categories: ((c = (u = s == null ? void 0 : s.categories) == null ? void 0 : u.categories) == null ? void 0 : c.items) ?? [],
156
- navigationLinks: ((l = (m = s == null ? void 0 : s.navigationLinks) == null ? void 0 : m.navigationLinks) == null ? void 0 : l.items) ?? []
154
+ ...((a = i == null ? void 0 : i.layerConfig) == null ? void 0 : a.config) ?? {},
155
+ subMenus: ((s = i == null ? void 0 : i.sections) == null ? void 0 : s.map((u) => u.data)) ?? [],
156
+ categories: ((d = (o = i == null ? void 0 : i.categories) == null ? void 0 : o.categories) == null ? void 0 : d.items) ?? [],
157
+ navigationLinks: ((l = (g = i == null ? void 0 : i.navigationLinks) == null ? void 0 : g.navigationLinks) == null ? void 0 : l.items) ?? []
157
158
  },
158
- children: t
159
+ children: e
159
160
  }
160
161
  );
161
- }, Fe = (t) => {
162
- var i, u;
163
- const e = (u = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : u.items;
164
- if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
162
+ }, Jt = (e) => {
163
+ var s, o;
164
+ const t = (o = (s = e[0]) == null ? void 0 : s.items) == null ? void 0 : o.items;
165
+ if ((t == null ? void 0 : t.items.length) === 0 || e.length === 0)
165
166
  return {
166
167
  iconLabel: "",
167
168
  label: "",
168
169
  content: []
169
170
  };
170
- const a = e == null ? void 0 : e.iconLabel, r = e == null ? void 0 : e.label, s = e == null ? void 0 : e.helpButtonSize, o = e.items.map(
171
- (c, m) => ({
172
- type: c.type,
173
- id: `${m.toString()}-${c.title.toLowerCase()}`,
174
- title: c.title,
175
- subtitle: c.subtitle,
176
- description: c.description,
177
- buttonLabel: c.buttonLabel,
178
- buttonHref: c.buttonHref,
179
- buttonMode: c.buttonMode,
180
- buttonSize: c.buttonSize,
181
- buttonIcon: c.buttonIcon
171
+ const r = t == null ? void 0 : t.iconLabel, n = t == null ? void 0 : t.label, i = t == null ? void 0 : t.helpButtonSize, a = t.items.map(
172
+ (d, g) => ({
173
+ type: d.type,
174
+ id: `${g.toString()}-${d.title.toLowerCase()}`,
175
+ title: d.title,
176
+ subtitle: d.subtitle,
177
+ description: d.description,
178
+ buttonLabel: d.buttonLabel,
179
+ buttonHref: d.buttonHref,
180
+ buttonMode: d.buttonMode,
181
+ buttonSize: d.buttonSize,
182
+ buttonIcon: d.buttonIcon
182
183
  })
183
184
  );
184
185
  return {
185
- iconLabel: a,
186
- label: r,
187
- helpButtonSize: s,
188
- content: o
186
+ iconLabel: r,
187
+ label: n,
188
+ helpButtonSize: i,
189
+ content: a
189
190
  };
190
- }, Te = async ({
191
- HelpButton: t,
192
- ICONS: e,
193
- className: a,
194
- ...r
191
+ }, Zt = async ({
192
+ HelpButton: e,
193
+ ICONS: t,
194
+ className: r,
195
+ ...n
195
196
  }) => {
196
- const { data: s } = await S(
197
+ const { data: i } = await $(
197
198
  "helpbutton",
198
- r
199
+ n
199
200
  );
200
- if (!s || !Array.isArray(s) || s.length === 0)
201
+ if (!i || !Array.isArray(i) || i.length === 0)
201
202
  return null;
202
- const o = Fe(s);
203
- return /* @__PURE__ */ b(
204
- t,
203
+ const a = Jt(i);
204
+ return /* @__PURE__ */ N(
205
+ e,
205
206
  {
206
- data: o,
207
- ICONS: e,
208
- className: a
207
+ data: a,
208
+ ICONS: t,
209
+ className: r
209
210
  }
210
211
  );
211
- }, qe = async ({
212
- SectionZone: t,
213
- LPCadastro: e,
214
- ...a
212
+ }, Yt = async ({
213
+ SectionZone: e,
214
+ LPCadastro: t,
215
+ ...r
215
216
  }) => {
216
- var c;
217
- const { data: r } = await S(
217
+ var d;
218
+ const { data: n } = await $(
218
219
  "lp_cadastro",
219
- a
220
+ r
220
221
  );
221
- if (!r || !Array.isArray(r) || r.length === 0)
222
+ if (!n || !Array.isArray(n) || n.length === 0)
222
223
  return null;
223
- const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((c = s == null ? void 0 : s.content) == null ? void 0 : c.conteúdo) || {}, u = s == null ? void 0 : s.sections;
224
- return /* @__PURE__ */ G(B, { children: [
225
- /* @__PURE__ */ b(e, { sections: o, content: i }),
226
- /* @__PURE__ */ b(t, { data: u })
224
+ const [i] = n, a = (i == null ? void 0 : i.sections) || [], s = ((d = i == null ? void 0 : i.content) == null ? void 0 : d.conteúdo) || {}, o = i == null ? void 0 : i.sections;
225
+ return /* @__PURE__ */ K(me, { children: [
226
+ /* @__PURE__ */ N(t, { sections: a, content: s }),
227
+ /* @__PURE__ */ N(e, { data: o })
227
228
  ] });
228
- }, Oe = async ({
229
- LPLOJAS_TEMPLATE_RETURN_BUTTON: t,
230
- ICONS: e,
231
- entity: a,
232
- showVendor: r,
233
- LPStoresClientWrapper: s,
234
- ...o
229
+ }, er = async ({
230
+ LPLOJAS_TEMPLATE_RETURN_BUTTON: e,
231
+ ICONS: t,
232
+ entity: r,
233
+ showVendor: n,
234
+ LPStoresClientWrapper: i,
235
+ ...a
235
236
  }) => {
236
- var m;
237
- const { data: i } = await S("lp_lojas", o), c = (m = (Array.isArray(i) ? i : [])[0]) == null ? void 0 : m.config.config;
238
- return /* @__PURE__ */ b(
239
- s,
237
+ var g;
238
+ const { data: s } = await $("lp_lojas", a), d = (g = (Array.isArray(s) ? s : [])[0]) == null ? void 0 : g.config.config;
239
+ return /* @__PURE__ */ N(
240
+ i,
240
241
  {
241
- entity: a,
242
- content: c,
243
- data: i,
244
- showVendor: r,
245
- ICONS: e,
246
- LPLOJAS_TEMPLATE_RETURN_BUTTON: t
242
+ entity: r,
243
+ content: d,
244
+ data: s,
245
+ showVendor: n,
246
+ ICONS: t,
247
+ LPLOJAS_TEMPLATE_RETURN_BUTTON: e
247
248
  }
248
249
  );
249
- }, $e = async ({
250
- children: t,
251
- productId: e,
252
- COMMON_PAGE_COLUMN_GAP: a,
253
- SectionZone: r,
254
- PDPContentProvider: s,
255
- ...o
250
+ }, tr = async ({
251
+ children: e,
252
+ productId: t,
253
+ COMMON_PAGE_COLUMN_GAP: r,
254
+ SectionZone: n,
255
+ PDPContentProvider: i,
256
+ ...a
256
257
  }) => {
257
- const { data: i } = await S(
258
+ const { data: s } = await $(
258
259
  "product_page",
259
- o
260
+ a
260
261
  );
261
- return !i || !Array.isArray(i) || i.length === 0 ? null : /* @__PURE__ */ b(
262
- s,
262
+ return !s || !Array.isArray(s) || s.length === 0 ? null : /* @__PURE__ */ N(
263
+ i,
263
264
  {
264
- data: i[0],
265
- productId: e,
266
- COMMON_PAGE_COLUMN_GAP: a,
267
- SectionZone: r,
268
- children: t
265
+ data: s[0],
266
+ productId: t,
267
+ COMMON_PAGE_COLUMN_GAP: r,
268
+ SectionZone: n,
269
+ children: e
269
270
  }
270
271
  );
271
- }, Pe = {
272
+ }, rr = {
272
273
  "column-modifier": "_column-modifier_1tqap_1"
273
- }, Ae = async ({
274
- className: t,
275
- children: e,
276
- slug: a,
277
- SectionZone: r,
278
- COMMON_PAGE_COLUMN_GAP_PDC: s,
279
- PLPContentProvider: o,
280
- ...i
274
+ }, nr = async ({
275
+ className: e,
276
+ children: t,
277
+ slug: r,
278
+ SectionZone: n,
279
+ COMMON_PAGE_COLUMN_GAP_PDC: i,
280
+ PLPContentProvider: a,
281
+ ...s
281
282
  }) => {
282
- const { data: u } = await S(
283
+ const { data: o } = await $(
283
284
  "categories_page",
284
- i
285
+ s
285
286
  );
286
- if (!u || !Array.isArray(u))
287
+ if (!o || !Array.isArray(o))
287
288
  return null;
288
- const c = u.find(
289
- (f) => {
290
- var p, y, I;
291
- return ((p = f.config) == null ? void 0 : p.seo.slug) === a && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
292
- }
293
- ), m = u.find(
294
- (f) => {
295
- var p, y, I;
296
- return ((p = f.config) == null ? void 0 : p.seo.slug) === a && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
297
- }
298
- ), l = u.find(
299
- (f) => {
300
- var p, y, I;
301
- return ((p = f.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
302
- }
303
- ), d = u.find(
304
- (f) => {
305
- var p, y, I;
306
- return ((p = f.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
307
- }
308
- ), R = Array.isArray(t) ? t : [t];
309
- return /* @__PURE__ */ G(B, { children: [
310
- /* @__PURE__ */ b(
311
- j.Column,
289
+ const d = o.find(
290
+ (v) => {
291
+ var y, _, p;
292
+ return ((y = v.config) == null ? void 0 : y.seo.slug) === r && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "desktop";
293
+ }
294
+ ), g = o.find(
295
+ (v) => {
296
+ var y, _, p;
297
+ return ((y = v.config) == null ? void 0 : y.seo.slug) === r && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "mobile";
298
+ }
299
+ ), l = o.find(
300
+ (v) => {
301
+ var y, _, p;
302
+ return ((y = v.config) == null ? void 0 : y.seo.slug) === "default" && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "desktop";
303
+ }
304
+ ), u = o.find(
305
+ (v) => {
306
+ var y, _, p;
307
+ return ((y = v.config) == null ? void 0 : y.seo.slug) === "default" && ((p = (_ = v.config) == null ? void 0 : _.responsive) == null ? void 0 : p.deviceType) === "mobile";
308
+ }
309
+ ), w = Array.isArray(e) ? e : [e];
310
+ return /* @__PURE__ */ K(me, { children: [
311
+ /* @__PURE__ */ N(
312
+ le.Column,
312
313
  {
313
- className: D.classNameConcat(
314
- k["responsive-desktop-flex"],
315
- [Pe["column-modifier"], ...R]
314
+ className: ce.classNameConcat(
315
+ se["responsive-desktop-flex"],
316
+ [rr["column-modifier"], ...w]
316
317
  ),
317
318
  style: {
318
319
  minHeight: "100vh"
319
320
  },
320
- children: /* @__PURE__ */ b(
321
- o,
321
+ children: /* @__PURE__ */ N(
322
+ a,
322
323
  {
323
- data: c ?? l,
324
+ data: d ?? l,
324
325
  device: "desktop",
325
- SectionZone: r,
326
- COMMON_PAGE_COLUMN_GAP_PDC: s,
327
- children: e
326
+ SectionZone: n,
327
+ COMMON_PAGE_COLUMN_GAP_PDC: i,
328
+ children: t
328
329
  }
329
330
  )
330
331
  }
331
332
  ),
332
- /* @__PURE__ */ b(j.Column, { className: D.classNameConcat(k["responsive-mobile-flex"], t), children: /* @__PURE__ */ b(
333
- o,
333
+ /* @__PURE__ */ N(le.Column, { className: ce.classNameConcat(se["responsive-mobile-flex"], e), children: /* @__PURE__ */ N(
334
+ a,
334
335
  {
335
- data: m ?? d,
336
+ data: g ?? u,
336
337
  device: "mobile",
337
- SectionZone: r,
338
- COMMON_PAGE_COLUMN_GAP_PDC: s,
339
- children: e
338
+ SectionZone: n,
339
+ COMMON_PAGE_COLUMN_GAP_PDC: i,
340
+ children: t
340
341
  }
341
342
  ) })
342
343
  ] });
343
- }, we = async ({ slug: t, ...e }) => {
344
- var i, u, c;
345
- const { data: a } = await S(
344
+ }, ir = async ({ slug: e, ...t }) => {
345
+ var s, o, d;
346
+ const { data: r } = await $(
346
347
  "redirect_to_search",
347
- e
348
+ t
348
349
  );
349
- if (!a || !Array.isArray(a))
350
+ if (!r || !Array.isArray(r))
350
351
  return {
351
- slug: t,
352
+ slug: e,
352
353
  query: null,
353
354
  redirect: !1
354
355
  };
355
- const r = ((c = (u = (i = a[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
356
- if (!!!r.length)
356
+ const n = ((d = (o = (s = r[0]) == null ? void 0 : s.redirectToSearch) == null ? void 0 : o.redirectToSearch) == null ? void 0 : d.paths) ?? [];
357
+ if (!!!n.length)
357
358
  return {
358
- slug: t,
359
+ slug: e,
359
360
  query: null,
360
361
  redirect: !1
361
362
  };
362
- const o = r.find(
363
- (m) => {
364
- var l, d;
365
- return ((l = m.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = m.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
363
+ const a = n.find(
364
+ (g) => {
365
+ var l, u;
366
+ return ((l = g.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((u = g.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
366
367
  }
367
368
  );
368
- return o ? {
369
- slug: t,
370
- query: o == null ? void 0 : o.searchQuery,
369
+ return a ? {
370
+ slug: e,
371
+ query: a == null ? void 0 : a.searchQuery,
371
372
  redirect: !0,
372
- collectionId: o == null ? void 0 : o.collectionId,
373
- filters: o == null ? void 0 : o.filters,
374
- sort: o == null ? void 0 : o.sort
373
+ collectionId: a == null ? void 0 : a.collectionId,
374
+ filters: a == null ? void 0 : a.filters,
375
+ sort: a == null ? void 0 : a.sort
375
376
  } : {
376
- slug: t,
377
+ slug: e,
377
378
  query: null,
378
379
  redirect: !1,
379
380
  collectionId: null,
380
381
  filters: null,
381
382
  sort: null
382
383
  };
383
- }, Ne = async ({ slug: t, ...e }) => {
384
- var i, u, c;
385
- const { data: a } = await S(
384
+ }, or = async ({ slug: e, ...t }) => {
385
+ var s, o, d;
386
+ const { data: r } = await $(
386
387
  "redirect_to_search",
387
- e
388
+ t
388
389
  );
389
- if (!a || !Array.isArray(a))
390
+ if (!r || !Array.isArray(r))
390
391
  return null;
391
- const r = ((c = (u = (i = a[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
392
- if (!!!r.length)
392
+ const n = ((d = (o = (s = r[0]) == null ? void 0 : s.redirectToSearch) == null ? void 0 : o.redirectToSearch) == null ? void 0 : d.paths) ?? [];
393
+ if (!!!n.length)
393
394
  return null;
394
- const o = r.find(
395
- (m) => {
396
- var l, d;
397
- return ((l = m.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = m.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
395
+ const a = n.find(
396
+ (g) => {
397
+ var l, u;
398
+ return ((l = g.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === e.replace(/\//g, "-").toLowerCase() || ((u = g.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === `/${e}`.replace(/\//g, "-").toLowerCase();
398
399
  }
399
400
  );
400
- return o ? {
401
- slug: t,
402
- title: o.pageTitle,
403
- description: o.pageDescription
401
+ return a ? {
402
+ slug: e,
403
+ title: a.pageTitle,
404
+ description: a.pageDescription
404
405
  } : null;
405
- }, ke = async ({
406
- children: t,
407
- SectionZone: e,
408
- className: a,
409
- ...r
406
+ }, ar = async ({
407
+ children: e,
408
+ SectionZone: t,
409
+ className: r,
410
+ ...n
410
411
  }) => {
411
- const { data: s } = await S(
412
+ const { data: i } = await $(
412
413
  "search_page",
413
- r
414
+ n
414
415
  );
415
- return Array.isArray(s) && s.length > 0 ? /* @__PURE__ */ b(
416
- se,
416
+ return Array.isArray(i) && i.length > 0 ? /* @__PURE__ */ N(
417
+ Pt,
417
418
  {
418
- data: s,
419
- SectionZone: e,
420
- className: a,
421
- children: t
422
- }
423
- ) : /* @__PURE__ */ b(B, { children: "children" });
424
- }, je = async ({
425
- ClientTipbarContent: t,
426
- ...e
419
+ data: i,
420
+ SectionZone: t,
421
+ className: r,
422
+ children: e
423
+ }
424
+ ) : /* @__PURE__ */ N(me, { children: "children" });
425
+ }, sr = async ({
426
+ ClientTipbarContent: e,
427
+ ...t
427
428
  }) => {
428
- const { data: a } = await S(
429
+ const { data: r } = await $(
429
430
  "tipbar",
430
- e
431
+ t
431
432
  );
432
- return /* @__PURE__ */ b(t, { data: a });
433
- }, De = {
434
- CommonPageContent: Ce,
435
- CartContent: Ie,
436
- FlagsAndTagsContent: ve,
437
- HeaderContent: Ee,
438
- TipbarContent: je,
439
- FooterContent: Se,
440
- PLPContent: Ae,
441
- PDPContent: $e,
442
- getRedirectData: we,
443
- getPLPSynteticMetaData: Ne,
444
- SearchPageContent: ke,
445
- HelpButtonContent: Te,
446
- LPCadastroContent: qe,
447
- LPLojasContent: Oe
448
- }, gr = { Components: De }, h = async (t, e = {}) => {
449
- const { method: a = "GET", body: r, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
450
- return fetch(t, {
451
- method: a,
433
+ return /* @__PURE__ */ N(e, { data: r });
434
+ }, lr = {
435
+ CommonPageContent: Wt,
436
+ CartContent: Gt,
437
+ FlagsAndTagsContent: Qt,
438
+ HeaderContent: Kt,
439
+ TipbarContent: sr,
440
+ FooterContent: Xt,
441
+ PLPContent: nr,
442
+ PDPContent: tr,
443
+ getRedirectData: ir,
444
+ getPLPSynteticMetaData: or,
445
+ SearchPageContent: ar,
446
+ HelpButtonContent: Zt,
447
+ LPCadastroContent: Yt,
448
+ LPLojasContent: er
449
+ }, vi = { Components: lr }, T = async (e, t = {}) => {
450
+ const { method: r = "GET", body: n, headers: i = {}, priority: a = "auto", cache: s = "default" } = t;
451
+ return fetch(e, {
452
+ method: r,
452
453
  headers: {
453
- ...s,
454
+ ...i,
454
455
  Accept: "application/json",
455
456
  "Content-Type": "application/json"
456
457
  },
457
- priority: o,
458
- cache: i,
459
- ...r ? { body: JSON.stringify(r) } : {}
458
+ priority: a,
459
+ cache: s,
460
+ ...n ? { body: JSON.stringify(n) } : {}
460
461
  // not body in get
461
- }).then((u) => u.json()).catch((u) => {
462
- console.error("[ERROR FETCH VTEX]", u);
462
+ }).then((o) => o.json()).catch((o) => {
463
+ console.error("[ERROR FETCH VTEX]", o);
463
464
  });
464
- }, w = /* @__PURE__ */ new Map();
465
- async function _e(t, e = {}) {
466
- var a;
465
+ }, X = /* @__PURE__ */ new Map();
466
+ async function cr(e, t = {}) {
467
+ var r;
467
468
  try {
468
- const { abort: r = !1 } = e, s = new AbortController();
469
- r && (w.has(t) && ((a = w.get(t)) == null || a.abort(), w.delete(t)), w.set(t, s));
470
- const o = h(t, {
471
- ...e,
472
- ...r ? { signal: s.signal } : {}
469
+ const { abort: n = !1 } = t, i = new AbortController();
470
+ n && (X.has(e) && ((r = X.get(e)) == null || r.abort(), X.delete(e)), X.set(e, i));
471
+ const a = T(e, {
472
+ ...t,
473
+ ...n ? { signal: i.signal } : {}
473
474
  });
474
- return r && w.delete(t), o;
475
- } catch (r) {
476
- if (r.name === "AbortError") {
477
- console.log(`[REQUEST CANCELLED]: ${t}`);
475
+ return n && X.delete(e), a;
476
+ } catch (n) {
477
+ if (n.name === "AbortError") {
478
+ console.log(`[REQUEST CANCELLED]: ${e}`);
478
479
  return;
479
480
  }
480
- throw console.error(`[ERROR API]: ${r.message}`), r;
481
+ throw console.error(`[ERROR API]: ${n.message}`), n;
481
482
  }
482
483
  }
483
- const He = n.object({
484
- country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
485
- postalCode: n.string().nullable()
484
+ const ur = c.object({
485
+ country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
486
+ postalCode: c.string().nullable()
486
487
  });
487
- async function Be({ apiUrl: t, body: e, fetchOptions: a }) {
488
- if (!e) {
488
+ async function dr({ apiUrl: e, body: t, fetchOptions: r }) {
489
+ if (!t) {
489
490
  console.error("[ERROR FETCHING] Body is required");
490
491
  return;
491
492
  }
492
- await He.validate(e);
493
- const { country: r, postalCode: s } = e;
494
- return await h(
495
- `${t}/api/checkout/pub/postal-code/${r}/${s}`,
493
+ await ur.validate(t);
494
+ const { country: n, postalCode: i } = t;
495
+ return await T(
496
+ `${e}/api/checkout/pub/postal-code/${n}/${i}`,
496
497
  {
497
498
  method: "POST",
498
- body: e,
499
- ...a
499
+ body: t,
500
+ ...r
500
501
  }
501
502
  );
502
503
  }
503
- const Le = n.object({
504
- orderFormId: n.string().nullable(),
505
- sellerCode: n.string().nullable(),
506
- sellerName: n.string().nullable()
504
+ const pr = c.object({
505
+ orderFormId: c.string().nullable(),
506
+ sellerCode: c.string().nullable(),
507
+ sellerName: c.string().nullable()
507
508
  });
508
- async function z({
509
- apiUrl: t,
510
- body: e,
511
- fetchOptions: a
509
+ async function We({
510
+ apiUrl: e,
511
+ body: t,
512
+ fetchOptions: r
512
513
  }) {
513
- if (!e) {
514
+ if (!t) {
514
515
  console.error("[ERROR FETCHING] Body is required");
515
516
  return;
516
517
  }
517
- await Le.validate(e);
518
- const { orderFormId: r, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
519
- return h(
520
- `${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
518
+ await pr.validate(t);
519
+ const { orderFormId: n, sellerCode: i, sellerName: a } = t, s = i ? `${i.trim()} - ${a}` : null;
520
+ return T(
521
+ `${e}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,
521
522
  {
522
523
  method: "POST",
523
524
  body: {
524
- value: i
525
+ value: s
525
526
  },
526
- ...a
527
+ ...r
527
528
  }
528
529
  );
529
530
  }
530
- const Ge = n.object({
531
- orderFormId: n.string().nullable(),
532
- sellerCode: n.string().nullable(),
533
- marketingData: n.object()
531
+ const mr = c.object({
532
+ orderFormId: c.string().nullable(),
533
+ sellerCode: c.string().nullable(),
534
+ marketingData: c.object()
534
535
  });
535
- async function Q({
536
- apiUrl: t,
537
- body: e,
538
- extraData: a = {},
539
- fetchOptions: r
536
+ async function Qe({
537
+ apiUrl: e,
538
+ body: t,
539
+ extraData: r = {},
540
+ fetchOptions: n
540
541
  }) {
541
- if (!e) {
542
+ if (!t) {
542
543
  console.error("[ERROR FETCHING] Body is required");
543
544
  return;
544
545
  }
545
- await Ge.validate(e);
546
- const { orderFormId: s, sellerCode: o, marketingData: i } = e, u = o ? {
547
- utmCampaign: o ? o.toUpperCase() : "",
548
- utmiCampaign: o ? `${a.VENDOR_CODE}` : "semcodigo"
546
+ await mr.validate(t);
547
+ const { orderFormId: i, sellerCode: a, marketingData: s } = t, o = a ? {
548
+ utmCampaign: a ? a.toUpperCase() : "",
549
+ utmiCampaign: a ? `${r.VENDOR_CODE}` : "semcodigo"
549
550
  } : {};
550
- return h(
551
- `${t}/api/checkout/pub/orderForm/${s}/attachments/marketingData`,
551
+ return T(
552
+ `${e}/api/checkout/pub/orderForm/${i}/attachments/marketingData`,
552
553
  {
553
554
  method: "POST",
554
555
  body: {
555
- ...i,
556
- ...u
556
+ ...s,
557
+ ...o
557
558
  },
558
- ...r
559
+ ...n
559
560
  }
560
561
  );
561
562
  }
562
- const Me = n.object({
563
- orderFormId: n.string().nullable(),
564
- sellerCode: n.string().nullable(),
565
- sellerName: n.string().nullable()
563
+ const hr = c.object({
564
+ orderFormId: c.string().nullable(),
565
+ sellerCode: c.string().nullable(),
566
+ sellerName: c.string().nullable()
566
567
  });
567
- async function Ue({ apiUrl: t, body: e, fetchOptions: a, extraData: r }) {
568
- if (!e) {
568
+ async function fr({ apiUrl: e, body: t, fetchOptions: r, extraData: n }) {
569
+ if (!t) {
569
570
  console.error("[ERROR FETCHING] Body is required");
570
571
  return;
571
572
  }
572
- await Me.validate(e);
573
- const s = await z({ apiUrl: t, body: e, fetchOptions: a });
574
- return Q({
575
- apiUrl: t,
573
+ await hr.validate(t);
574
+ const i = await We({ apiUrl: e, body: t, fetchOptions: r });
575
+ return Qe({
576
+ apiUrl: e,
576
577
  body: {
577
- ...e,
578
- marketingData: s == null ? void 0 : s.marketingData
578
+ ...t,
579
+ marketingData: i == null ? void 0 : i.marketingData
579
580
  },
580
- extraData: r,
581
- fetchOptions: a
581
+ extraData: n,
582
+ fetchOptions: r
582
583
  });
583
584
  }
584
- const Ve = n.object({
585
- orderFormId: n.string().nullable(),
586
- coupon: n.string().nullable()
585
+ const gr = c.object({
586
+ orderFormId: c.string().nullable(),
587
+ coupon: c.string().nullable()
587
588
  });
588
- async function xe({
589
- apiUrl: t,
590
- body: e,
591
- fetchOptions: a
589
+ async function br({
590
+ apiUrl: e,
591
+ body: t,
592
+ fetchOptions: r
592
593
  }) {
593
- if (!e) {
594
+ if (!t) {
594
595
  console.error("[ERROR FETCHING] Body is required");
595
596
  return;
596
597
  }
597
- await Ve.validate(e);
598
- const { coupon: r = "", orderFormId: s } = e;
599
- return h(
600
- `${t}/api/checkout/pub/orderForm/${s}/coupons`,
598
+ await gr.validate(t);
599
+ const { coupon: n = "", orderFormId: i } = t;
600
+ return T(
601
+ `${e}/api/checkout/pub/orderForm/${i}/coupons`,
601
602
  {
602
603
  method: "POST",
603
- body: { text: r },
604
- ...a
604
+ body: { text: n },
605
+ ...r
605
606
  }
606
607
  );
607
608
  }
608
- const ze = n.object({
609
- appId: n.string().required("App ID is required"),
610
- orderFormId: n.string().nullable(),
611
- key: n.array().of(n.string())
609
+ const wr = c.object({
610
+ appId: c.string().required("App ID is required"),
611
+ orderFormId: c.string().nullable(),
612
+ key: c.array().of(c.string())
612
613
  });
613
- async function Qe({
614
- apiUrl: t,
615
- body: e,
616
- fetchOptions: a
614
+ async function vr({
615
+ apiUrl: e,
616
+ body: t,
617
+ fetchOptions: r
617
618
  }) {
618
- if (!e) {
619
+ if (!t) {
619
620
  console.error("[ERROR FETCHING] Body is required");
620
621
  return;
621
622
  }
622
- await ze.validate(e);
623
- const { appId: r = "faststore", orderFormId: s, key: o } = e;
624
- return h(
625
- `${t}/api/checkout/pub/orderForm/${s}/customData/${r}/${o}`,
623
+ await wr.validate(t);
624
+ const { appId: n = "faststore", orderFormId: i, key: a } = t;
625
+ return T(
626
+ `${e}/api/checkout/pub/orderForm/${i}/customData/${n}/${a}`,
626
627
  {
627
628
  method: "PUT",
628
- ...a
629
+ ...r
629
630
  }
630
631
  );
631
632
  }
632
- const Ke = n.object().shape({
633
- name: n.string().required("Attachment name is required"),
634
- content: n.object().nullable()
633
+ const yr = c.object().shape({
634
+ name: c.string().required("Attachment name is required"),
635
+ content: c.object().nullable()
635
636
  });
636
- var V;
637
- const Je = n.object().shape({
638
- attachments: (V = n.array().of(Ke)) == null ? void 0 : V.nullable(),
639
- id: n.string().required("ID of SKU is required"),
640
- index: n.number().integer().nullable(),
641
- quantity: n.number().integer().nullable(),
642
- seller: n.string().required("Seller is required"),
643
- price: n.number().integer()
644
- }), We = n.object({
645
- orderFormId: n.string().required("OrderFormId is required"),
646
- orderItems: n.array().of(Je)
637
+ var ze;
638
+ const _r = c.object().shape({
639
+ attachments: (ze = c.array().of(yr)) == null ? void 0 : ze.nullable(),
640
+ id: c.string().required("ID of SKU is required"),
641
+ index: c.number().integer().nullable(),
642
+ quantity: c.number().integer().nullable(),
643
+ seller: c.string().required("Seller is required"),
644
+ price: c.number().integer()
645
+ }), Rr = c.object({
646
+ orderFormId: c.string().required("OrderFormId is required"),
647
+ orderItems: c.array().of(_r)
647
648
  });
648
- async function Xe({
649
- apiUrl: t,
650
- body: e,
651
- fetchOptions: a
649
+ async function Ir({
650
+ apiUrl: e,
651
+ body: t,
652
+ fetchOptions: r
652
653
  }) {
653
- if (!e) {
654
+ if (!t) {
654
655
  console.error("[ERROR FETCHING] Body is required");
655
656
  return;
656
657
  }
657
- await We.validate(e);
658
- const { orderFormId: r, orderItems: s } = e;
659
- return h(
660
- `${t}/api/checkout/pub/orderForm/${r}/items`,
658
+ await Rr.validate(t);
659
+ const { orderFormId: n, orderItems: i } = t;
660
+ return T(
661
+ `${e}/api/checkout/pub/orderForm/${n}/items`,
661
662
  {
662
663
  method: "POST",
663
- body: { orderItems: s },
664
- ...a
664
+ body: { orderItems: i },
665
+ ...r
665
666
  }
666
667
  );
667
668
  }
668
- const Ye = n.object({
669
- orderFormId: n.string().nullable()
669
+ const Pr = c.object({
670
+ orderFormId: c.string().nullable()
670
671
  });
671
- async function Ze({
672
- apiUrl: t,
673
- body: e,
674
- fetchOptions: a
672
+ async function Sr({
673
+ apiUrl: e,
674
+ body: t,
675
+ fetchOptions: r
675
676
  }) {
676
- if (!e) {
677
+ if (!t) {
677
678
  console.error("[ERROR FETCHING] Body is required");
678
679
  return;
679
680
  }
680
- await Ye.validate(e);
681
- const { orderFormId: r } = e;
682
- return h(
683
- `${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,
681
+ await Pr.validate(t);
682
+ const { orderFormId: n } = t;
683
+ return T(
684
+ `${e}/api/checkout/pub/orderForm/${n}/items/removeAll`,
684
685
  {
685
686
  method: "POST",
686
- ...a
687
+ ...r
687
688
  }
688
689
  );
689
690
  }
690
- const et = n.object().shape({
691
- name: n.string().required("Attachment name is required"),
692
- content: n.object().nullable()
691
+ const Cr = c.object().shape({
692
+ name: c.string().required("Attachment name is required"),
693
+ content: c.object().nullable()
693
694
  });
694
- var x;
695
- const tt = n.object().shape({
696
- attachments: (x = n.array().of(et)) == null ? void 0 : x.nullable(),
697
- id: n.string().required("ID of SKU is required"),
698
- index: n.number().integer().nullable(),
699
- quantity: n.number().integer().nullable(),
700
- seller: n.string().required("Seller is required"),
701
- price: n.number().integer()
702
- }), rt = n.object({
703
- orderFormId: n.string().nullable(),
704
- orderItems: n.array().of(tt)
695
+ var Ge;
696
+ const xr = c.object().shape({
697
+ attachments: (Ge = c.array().of(Cr)) == null ? void 0 : Ge.nullable(),
698
+ id: c.string().required("ID of SKU is required"),
699
+ index: c.number().integer().nullable(),
700
+ quantity: c.number().integer().nullable(),
701
+ seller: c.string().required("Seller is required"),
702
+ price: c.number().integer()
703
+ }), kr = c.object({
704
+ orderFormId: c.string().nullable(),
705
+ orderItems: c.array().of(xr)
705
706
  });
706
- async function at({
707
- apiUrl: t,
708
- body: e,
709
- fetchOptions: a
707
+ async function Er({
708
+ apiUrl: e,
709
+ body: t,
710
+ fetchOptions: r
710
711
  }) {
711
- if (!e) {
712
+ if (!t) {
712
713
  console.error("[ERROR FETCHING] Body is required");
713
714
  return;
714
715
  }
715
- await rt.validate(e);
716
- const { orderFormId: r, orderItems: s } = e;
717
- return h(
718
- `${t}/api/checkout/pub/orderForm/${r}/items/update`,
716
+ await kr.validate(t);
717
+ const { orderFormId: n, orderItems: i } = t;
718
+ return T(
719
+ `${e}/api/checkout/pub/orderForm/${n}/items/update`,
719
720
  {
720
721
  method: "POST",
721
- body: { orderItems: s },
722
- ...a
722
+ body: { orderItems: i },
723
+ ...r
723
724
  }
724
725
  );
725
726
  }
726
- const nt = n.object({
727
- orderFormId: n.string().nullable()
727
+ const Ar = c.object({
728
+ orderFormId: c.string().nullable()
728
729
  });
729
- async function st({
730
- apiUrl: t,
731
- body: e,
732
- fetchOptions: a
730
+ async function Tr({
731
+ apiUrl: e,
732
+ body: t,
733
+ fetchOptions: r
733
734
  }) {
734
- if (!e) {
735
+ if (!t) {
735
736
  console.error("[ERROR FETCHING] Body is required");
736
737
  return;
737
738
  }
738
- await nt.validate(e);
739
- const { orderFormId: r } = e;
740
- return h(
741
- `${t}/api/checkout/pub/orderForm/${r}/messages/clear`,
739
+ await Ar.validate(t);
740
+ const { orderFormId: n } = t;
741
+ return T(
742
+ `${e}/api/checkout/pub/orderForm/${n}/messages/clear`,
742
743
  {
743
744
  method: "POST",
744
- ...a
745
+ ...r
745
746
  }
746
747
  );
747
748
  }
748
- const ot = n.object({
749
- id: n.string().nullable(),
749
+ const Or = c.object({
750
+ id: c.string().nullable(),
750
751
  // id offering
751
- itemIndex: n.number().nullable(),
752
- orderFormId: n.string().nullable(),
753
- remove: n.boolean().nullable()
752
+ itemIndex: c.number().nullable(),
753
+ orderFormId: c.string().nullable(),
754
+ remove: c.boolean().nullable()
754
755
  });
755
- async function it({ apiUrl: t, body: e, fetchOptions: a }) {
756
- if (!e) {
756
+ async function qr({ apiUrl: e, body: t, fetchOptions: r }) {
757
+ if (!t) {
757
758
  console.error("[ERROR FETCHING] Body is required");
758
759
  return;
759
760
  }
760
- await ot.validate(e);
761
- const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, u = i ? `/${o}/remove` : "", c = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${u}`;
762
- return h(c, {
761
+ await Or.validate(t);
762
+ const { itemIndex: n, orderFormId: i, id: a, remove: s } = t, o = s ? `/${a}/remove` : "", d = `${e}/api/checkout/pub/orderForm/${i}/items/${n}/offerings${o}`;
763
+ return T(d, {
763
764
  method: "POST",
764
- body: { id: o },
765
- ...a
765
+ body: { id: a },
766
+ ...r
766
767
  });
767
768
  }
768
- const ct = n.object({
769
- orderFormId: n.string().nullable()
769
+ const Nr = c.object({
770
+ orderFormId: c.string().nullable()
770
771
  });
771
- async function lt({
772
- apiUrl: t,
773
- body: e,
774
- fetchOptions: a,
775
- extraData: r
772
+ async function jr({
773
+ apiUrl: e,
774
+ body: t,
775
+ fetchOptions: r,
776
+ extraData: n
776
777
  }) {
777
- var i;
778
- if (!e) {
778
+ var s;
779
+ if (!t) {
779
780
  console.error("[ERROR FETCHING] Body is required");
780
781
  return;
781
782
  }
782
- await ct.validate(e);
783
- const s = new URLSearchParams({
783
+ await Nr.validate(t);
784
+ const i = new URLSearchParams({
784
785
  refreshOutdatedData: "true"
785
- }), o = e.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== e.orderFormId ? `${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(s)}` : `${t}/api/checkout/pub/orderForm`;
786
- return h(o, { method: "GET", ...a });
786
+ }), a = t.orderFormId && ((s = n.orderFormPurchaseId) == null ? void 0 : s.value) !== t.orderFormId ? `${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(i)}` : `${e}/api/checkout/pub/orderForm`;
787
+ return T(a, { method: "GET", ...r });
787
788
  }
788
- const ut = n.object({
789
- orderFormId: n.string().nullable(),
790
- email: n.string().email().required(),
791
- firstName: n.string().required(),
792
- lastName: n.string().required(),
793
- documentType: n.string().required(),
794
- document: n.string().required(),
795
- phone: n.string().matches(/^\+\d{1,3}\d{10,11}$/)
789
+ const Fr = c.object({
790
+ orderFormId: c.string().nullable(),
791
+ email: c.string().email().required(),
792
+ firstName: c.string().required(),
793
+ lastName: c.string().required(),
794
+ documentType: c.string().required(),
795
+ document: c.string().required(),
796
+ phone: c.string().matches(/^\+\d{1,3}\d{10,11}$/)
796
797
  });
797
- async function dt({
798
- apiUrl: t,
799
- body: e,
800
- fetchOptions: a
798
+ async function $r({
799
+ apiUrl: e,
800
+ body: t,
801
+ fetchOptions: r
801
802
  }) {
802
- if (!e) {
803
+ if (!t) {
803
804
  console.error("[ERROR FETCHING] Body is required");
804
805
  return;
805
806
  }
806
- await ut.validate(e);
807
- const { orderFormId: r, ...s } = e;
808
- return h(
809
- `${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
807
+ await Fr.validate(t);
808
+ const { orderFormId: n, ...i } = t;
809
+ return T(
810
+ `${e}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,
810
811
  {
811
812
  method: "POST",
812
- body: { ...s },
813
- ...a
813
+ body: { ...i },
814
+ ...r
814
815
  }
815
816
  );
816
817
  }
817
- const mt = n.object({
818
- sellerCode: n.string().nullable()
818
+ const Lr = c.object({
819
+ sellerCode: c.string().nullable()
819
820
  });
820
- async function pt({
821
- apiUrl: t,
822
- body: e,
823
- extraData: a,
824
- fetchOptions: r
821
+ async function Dr({
822
+ apiUrl: e,
823
+ body: t,
824
+ extraData: r,
825
+ fetchOptions: n
825
826
  }) {
826
- if (!e) {
827
+ if (!t) {
827
828
  console.error("[ERROR FETCHING] Body is required");
828
829
  return;
829
830
  }
830
- await mt.validate(e);
831
- const { sellerCode: s = "" } = e;
832
- return h(
833
- `${t}/api/dataentities/${a.ENTITIES}/search?_fields=${a.FIELDS}&${a.FILTER}=${s}`,
831
+ await Lr.validate(t);
832
+ const { sellerCode: i = "" } = t;
833
+ return T(
834
+ `${e}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${i}`,
834
835
  {
835
836
  method: "GET",
836
837
  headers: {
837
838
  Accept: "application/vnd.vtex.ds.v10+json"
838
839
  },
839
- ...r
840
+ ...n
840
841
  }
841
842
  );
842
843
  }
843
- const ft = n.object().shape({
844
- country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
845
- orderFormId: n.string().nullable(),
846
- postalCode: n.string().nullable()
844
+ const Ur = c.object().shape({
845
+ country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
846
+ orderFormId: c.string().nullable(),
847
+ postalCode: c.string().nullable()
847
848
  });
848
- async function gt({
849
- apiUrl: t,
850
- body: e,
851
- fetchOptions: a
849
+ async function Hr({
850
+ apiUrl: e,
851
+ body: t,
852
+ fetchOptions: r
852
853
  }) {
853
- if (!e) {
854
+ if (!t) {
854
855
  console.error("[ERROR FETCHING] Body is required");
855
856
  return;
856
857
  }
857
- await ft.validate(e);
858
- const { country: r, orderFormId: s, postalCode: o } = e, i = o ? {
858
+ await Ur.validate(t);
859
+ const { country: n, orderFormId: i, postalCode: a } = t, s = a ? {
859
860
  address: {
860
861
  addressType: "residential",
861
- postalCode: o,
862
- country: r
862
+ postalCode: a,
863
+ country: n
863
864
  }
864
865
  } : {
865
866
  logisticsInfo: [],
866
867
  clearAddressIfPostalCodeNotFound: !0
867
868
  };
868
- return h(
869
- `${t}/api/checkout/pub/orderForm/${s}/attachments/shippingData`,
869
+ return T(
870
+ `${e}/api/checkout/pub/orderForm/${i}/attachments/shippingData`,
870
871
  {
871
872
  method: "POST",
872
- body: i,
873
- ...a
873
+ body: s,
874
+ ...r
874
875
  }
875
876
  );
876
877
  }
877
- const ht = n.object().shape({
878
- orderFormId: n.string().nullable(),
879
- options: n.array().of(
880
- n.object().shape({
881
- itemIndex: n.number(),
882
- selectedDeliveryChannel: n.string(),
883
- selectedSla: n.string()
878
+ const Mr = c.object().shape({
879
+ orderFormId: c.string().nullable(),
880
+ options: c.array().of(
881
+ c.object().shape({
882
+ itemIndex: c.number(),
883
+ selectedDeliveryChannel: c.string(),
884
+ selectedSla: c.string()
884
885
  })
885
886
  ),
886
- selectedAddresses: n.array().of(
887
- n.object().shape({
888
- addressId: n.string().required(),
889
- addressType: n.string().required(),
890
- city: n.string().nullable(),
891
- complement: n.string().nullable(),
892
- country: n.string().required().length(3),
893
- geoCoordinates: n.array().of(n.number()).required().min(0),
894
- isDisposable: n.boolean().required(),
895
- neighborhood: n.string().nullable(),
896
- number: n.string().nullable(),
897
- postalCode: n.string().required(),
898
- receiverName: n.string().nullable(),
899
- reference: n.string().nullable(),
900
- state: n.string().nullable(),
901
- street: n.string().nullable()
887
+ selectedAddresses: c.array().of(
888
+ c.object().shape({
889
+ addressId: c.string().required(),
890
+ addressType: c.string().required(),
891
+ city: c.string().nullable(),
892
+ complement: c.string().nullable(),
893
+ country: c.string().required().length(3),
894
+ geoCoordinates: c.array().of(c.number()).required().min(0),
895
+ isDisposable: c.boolean().required(),
896
+ neighborhood: c.string().nullable(),
897
+ number: c.string().nullable(),
898
+ postalCode: c.string().required(),
899
+ receiverName: c.string().nullable(),
900
+ reference: c.string().nullable(),
901
+ state: c.string().nullable(),
902
+ street: c.string().nullable()
902
903
  })
903
904
  )
904
905
  });
905
- async function yt({ apiUrl: t, body: e, fetchOptions: a }) {
906
- if (!e) {
906
+ async function Br({ apiUrl: e, body: t, fetchOptions: r }) {
907
+ if (!t) {
907
908
  console.error("[ERROR FETCHING] Body is required");
908
909
  return;
909
910
  }
910
- await ht.validate(e);
911
- const { orderFormId: r, options: s, selectedAddresses: o } = e;
912
- return h(
913
- `${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
911
+ await Mr.validate(t);
912
+ const { orderFormId: n, options: i, selectedAddresses: a } = t;
913
+ return T(
914
+ `${e}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,
914
915
  {
915
916
  method: "POST",
916
917
  body: {
917
- selectedAddresses: o,
918
+ selectedAddresses: a,
918
919
  clearAddressIfPostalCodeNotFound: !1,
919
- logisticsInfo: s
920
+ logisticsInfo: i
920
921
  },
921
- ...a
922
+ ...r
922
923
  }
923
924
  );
924
925
  }
925
- const bt = n.object({
926
- country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
927
- postalCode: n.string().nullable(),
928
- geoCoordinates: n.object().shape({
929
- longitude: n.number().required(),
930
- latitude: n.number().required()
926
+ const zr = c.object({
927
+ country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
928
+ postalCode: c.string().nullable(),
929
+ geoCoordinates: c.object().shape({
930
+ longitude: c.number().required(),
931
+ latitude: c.number().required()
931
932
  })
932
933
  });
933
- async function It({ apiUrl: t, body: e, fetchOptions: a }) {
934
- if (!e) {
934
+ async function Gr({ apiUrl: e, body: t, fetchOptions: r }) {
935
+ if (!t) {
935
936
  console.error("[ERROR FETCHING] Body is required");
936
937
  return;
937
938
  }
938
- await bt.validate(e);
939
- const { country: r = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(r) });
940
- return o ? i.append("postalCode", o) : i.append(
939
+ await zr.validate(t);
940
+ const { country: n = "", geoCoordinates: i, postalCode: a = "" } = t, s = new URLSearchParams({ country: String(n) });
941
+ return a ? s.append("postalCode", a) : s.append(
941
942
  "geoCoordinates",
942
- `${s == null ? void 0 : s.longitude};${s == null ? void 0 : s.latitude}`
943
- ), await h(
944
- `${t}/api/checkout/pub/regions/?${i.toString()}`,
943
+ `${i == null ? void 0 : i.longitude};${i == null ? void 0 : i.latitude}`
944
+ ), await T(
945
+ `${e}/api/checkout/pub/regions/?${s.toString()}`,
945
946
  {
946
947
  method: "GET",
947
- ...a
948
+ ...r
948
949
  }
949
950
  );
950
951
  }
951
- const Rt = n.object({
952
- id: n.string().required("ID of SKU is required"),
953
- quantity: n.number().integer().required("Quantity of item is required"),
954
- seller: n.string()
955
- }), Ct = n.object({
956
- items: n.array().of(Rt),
957
- country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
958
- postalCode: n.string().nullable(),
959
- geoCoordinates: n.array().nullable().of(n.number()).length(2)
952
+ const Vr = c.object({
953
+ id: c.string().required("ID of SKU is required"),
954
+ quantity: c.number().integer().required("Quantity of item is required"),
955
+ seller: c.string()
956
+ }), Wr = c.object({
957
+ items: c.array().of(Vr),
958
+ country: c.string().length(3, "Country code must be 3 characters long").required("Country is required"),
959
+ postalCode: c.string().nullable(),
960
+ geoCoordinates: c.array().nullable().of(c.number()).length(2)
960
961
  });
961
- async function vt({ apiUrl: t, body: e, fetchOptions: a }) {
962
- if (!e) {
962
+ async function Qr({ apiUrl: e, body: t, fetchOptions: r }) {
963
+ if (!t) {
963
964
  console.error("[ERROR FETCHING] Body is required");
964
965
  return;
965
966
  }
966
- return await Ct.validate(e), h(
967
- `${t}/api/checkout/pub/orderForms/simulation`,
967
+ return await Wr.validate(t), T(
968
+ `${e}/api/checkout/pub/orderForms/simulation`,
968
969
  {
969
970
  method: "POST",
970
- body: e,
971
- ...a
971
+ body: t,
972
+ ...r
972
973
  }
973
974
  );
974
975
  }
975
- const St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
976
+ const Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
976
977
  __proto__: null,
977
- getMasterDataSellerCode: pt,
978
- getOrderForm: lt,
979
- postOrderFormAddCoupon: xe,
980
- postOrderFormAttachClientProfileData: dt,
981
- postOrderFormAttachOrderFormData: Ue,
982
- postOrderFormAttachShippingData: gt,
983
- postOrderFormAttachmentsMarketingData: Q,
984
- postOrderFormAttachmentsOpenTextField: z,
985
- postOrderFormClearMessages: st,
986
- postOrderFormFreightSimulation: vt,
987
- postOrderFormItems: Xe,
988
- postOrderFormRegion: It,
989
- postOrderFormRemoveAllItems: Ze,
990
- postOrderFormUpdateItems: at,
991
- postOrderFormUpdateShippingData: yt,
992
- postOrderformAddress: Be,
993
- putOrderFormCustomData: Qe,
994
- updateOrderFormOffering: it
995
- }, Symbol.toStringTag, { value: "Module" })), Et = n.object({
996
- skuId: n.string()
978
+ getMasterDataSellerCode: Dr,
979
+ getOrderForm: jr,
980
+ postOrderFormAddCoupon: br,
981
+ postOrderFormAttachClientProfileData: $r,
982
+ postOrderFormAttachOrderFormData: fr,
983
+ postOrderFormAttachShippingData: Hr,
984
+ postOrderFormAttachmentsMarketingData: Qe,
985
+ postOrderFormAttachmentsOpenTextField: We,
986
+ postOrderFormClearMessages: Tr,
987
+ postOrderFormFreightSimulation: Qr,
988
+ postOrderFormItems: Ir,
989
+ postOrderFormRegion: Gr,
990
+ postOrderFormRemoveAllItems: Sr,
991
+ postOrderFormUpdateItems: Er,
992
+ postOrderFormUpdateShippingData: Br,
993
+ postOrderformAddress: dr,
994
+ putOrderFormCustomData: vr,
995
+ updateOrderFormOffering: qr
996
+ }, Symbol.toStringTag, { value: "Module" })), Kr = c.object({
997
+ skuId: c.string()
997
998
  });
998
- async function Ft({ apiUrl: t, body: e, fetchOptions: a }) {
999
- if (!e) {
999
+ async function Jr({ apiUrl: e, body: t, fetchOptions: r }) {
1000
+ if (!t) {
1000
1001
  console.error("[ERROR FETCHING] Body is required");
1001
1002
  return;
1002
1003
  }
1003
- await Et.validate(e);
1004
- const { skuId: r } = e;
1005
- return h(
1006
- `${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
1004
+ await Kr.validate(t);
1005
+ const { skuId: n } = t;
1006
+ return T(
1007
+ `${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,
1007
1008
  {
1008
- ...a
1009
+ ...r
1009
1010
  }
1010
1011
  );
1011
1012
  }
1012
- const Tt = n.object({
1013
- ids: n.array().of(n.string().required("ID are required")).required("IDs are required")
1013
+ const Zr = c.object({
1014
+ ids: c.array().of(c.string().required("ID are required")).required("IDs are required")
1014
1015
  });
1015
- async function qt({ apiUrl: t, body: e, fetchOptions: a }) {
1016
- if (!e) {
1016
+ async function Yr({ apiUrl: e, body: t, fetchOptions: r }) {
1017
+ if (!t) {
1017
1018
  console.error("[ERROR FETCHING] Body is required");
1018
1019
  return;
1019
1020
  }
1020
- await Tt.validate(e);
1021
- const { ids: r } = e;
1022
- return h(
1023
- `${t}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
1021
+ await Zr.validate(t);
1022
+ const { ids: n } = t;
1023
+ return T(
1024
+ `${e}/api/catalog_system/pub/products/search?fq=${n.map((i) => `productId:${i}`).join("&fq=")}`,
1024
1025
  {
1025
- ...a
1026
+ ...r
1026
1027
  }
1027
1028
  );
1028
1029
  }
1029
- const Ot = n.object({
1030
- productId: n.number().required("Product ID is required")
1030
+ const en = c.object({
1031
+ productId: c.number().required("Product ID is required")
1031
1032
  });
1032
- async function $t({ apiUrl: t, body: e, fetchOptions: a }) {
1033
- if (!e) {
1033
+ async function tn({ apiUrl: e, body: t, fetchOptions: r }) {
1034
+ if (!t) {
1034
1035
  console.error("[ERROR FETCHING] Body is required");
1035
1036
  return;
1036
1037
  }
1037
- await Ot.validate(e);
1038
- const { productId: r } = e;
1039
- return h(
1040
- `${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
1038
+ await en.validate(t);
1039
+ const { productId: n } = t;
1040
+ return T(
1041
+ `${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,
1041
1042
  {
1042
- ...a
1043
+ ...r
1043
1044
  }
1044
1045
  );
1045
1046
  }
1046
- const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1047
+ const rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1047
1048
  __proto__: null,
1048
- getCatalogKitProducts: Ft,
1049
- getCatalogProducts: qt,
1050
- getCatalogSimilars: $t
1051
- }, Symbol.toStringTag, { value: "Module" })), At = n.object({
1052
- query: n.string()
1049
+ getCatalogKitProducts: Jr,
1050
+ getCatalogProducts: Yr,
1051
+ getCatalogSimilars: tn
1052
+ }, Symbol.toStringTag, { value: "Module" })), nn = c.object({
1053
+ query: c.string()
1053
1054
  });
1054
- async function wt({
1055
- apiUrl: t,
1056
- body: e,
1057
- fetchOptions: a
1055
+ async function on({
1056
+ apiUrl: e,
1057
+ body: t,
1058
+ fetchOptions: r
1058
1059
  }) {
1059
- if (!e) {
1060
+ if (!t) {
1060
1061
  console.error("[ERROR FETCHING] Body is required");
1061
1062
  return;
1062
1063
  }
1063
- await At.validate(e);
1064
- const { query: r = "" } = e, s = new URLSearchParams({ query: r });
1065
- return h(
1066
- `${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
1064
+ await nn.validate(t);
1065
+ const { query: n = "" } = t, i = new URLSearchParams({ query: n });
1066
+ return T(
1067
+ `${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${i.toString()}`,
1067
1068
  {
1068
- ...a
1069
+ ...r
1069
1070
  }
1070
1071
  );
1071
1072
  }
1072
- const Nt = (t, e) => be(t, e), kt = (t) => ({
1073
- ...t,
1074
- description: t.description ? Nt(t.description) : t.description
1075
- }), jt = ({
1076
- offer: t,
1077
- seller: e,
1078
- product: a
1073
+ const an = (e, t) => Bt(e, t), sn = (e) => ({
1074
+ ...e,
1075
+ description: e.description ? an(e.description) : e.description
1076
+ }), ln = ({
1077
+ offer: e,
1078
+ seller: t,
1079
+ product: r
1079
1080
  }) => ({
1080
- ...t,
1081
- product: a,
1082
- seller: e
1083
- }), K = (t, e) => ({
1084
- ...t,
1085
- isVariantOf: kt(e)
1086
- }), Dt = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", N = (t) => t.AvailableQuantity > 0, M = (t) => t.spotPrice ?? 0, _t = (t) => t.Price ?? 0, J = (t, e) => N(t) && !N(e) ? -1 : !N(t) && N(e) ? 1 : M(t) - M(e), Ht = (t, e) => {
1087
- let a = 0;
1088
- for (let r = 1; r < t.length; r++)
1089
- e(t[a], t[r]) > 0 && (a = r);
1090
- return t[a];
1091
- }, W = (t) => {
1092
- const e = t.flatMap(
1093
- (r) => r.sellers.map((s) => ({
1094
- offer: s.commertialOffer,
1095
- sku: r
1081
+ ...e,
1082
+ product: r,
1083
+ seller: t
1084
+ }), Xe = (e, t) => ({
1085
+ ...e,
1086
+ isVariantOf: sn(t)
1087
+ }), cn = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", ae = (e) => e.AvailableQuantity > 0, Ue = (e) => e.spotPrice ?? 0, un = (e) => e.Price ?? 0, Ke = (e, t) => ae(e) && !ae(t) ? -1 : !ae(e) && ae(t) ? 1 : Ue(e) - Ue(t), dn = (e, t) => {
1088
+ let r = 0;
1089
+ for (let n = 1; n < e.length; n++)
1090
+ t(e[r], e[n]) > 0 && (r = n);
1091
+ return e[r];
1092
+ }, Je = (e) => {
1093
+ const t = e.flatMap(
1094
+ (n) => n.sellers.map((i) => ({
1095
+ offer: i.commertialOffer,
1096
+ sku: n
1096
1097
  }))
1097
- ), a = Ht(
1098
- e,
1099
- ({ offer: r }, { offer: s }) => J(r, s)
1098
+ ), r = dn(
1099
+ t,
1100
+ ({ offer: n }, { offer: i }) => Ke(n, i)
1100
1101
  );
1101
- return a ? a.sku : t[0];
1102
- }, X = (t) => t.map(
1103
- ({ imageUrl: e, imageText: a, imageLabel: r }) => ({
1104
- alternateName: a ?? "",
1105
- url: e.replace("vteximg.com.br", "vtexassets.com"),
1106
- keywords: r
1102
+ return r ? r.sku : e[0];
1103
+ }, Ze = (e) => e.map(
1104
+ ({ imageUrl: t, imageText: r, imageLabel: n }) => ({
1105
+ alternateName: r ?? "",
1106
+ url: t.replace("vteximg.com.br", "vtexassets.com"),
1107
+ keywords: n
1107
1108
  })
1108
- ), _ = {
1109
+ ), ue = {
1109
1110
  attachment: "ATTACHMENT",
1110
1111
  specification: "SPECIFICATION",
1111
1112
  attribute: "ATTRIBUTE"
1112
- }, Bt = (t) => ({
1113
- name: t.name,
1114
- value: t.content,
1115
- valueReference: _.attachment
1116
- }), Lt = (t) => ({
1117
- propertyID: t.id,
1118
- name: t.name,
1119
- value: t.value,
1113
+ }, pn = (e) => ({
1114
+ name: e.name,
1115
+ value: e.content,
1116
+ valueReference: ue.attachment
1117
+ }), mn = (e) => ({
1118
+ propertyID: e.id,
1119
+ name: e.name,
1120
+ value: e.value,
1120
1121
  valueReference: {
1121
- valueReference: _.attribute,
1122
- visible: t.visible
1123
- }
1124
- }), H = (t, e, a) => {
1125
- const r = t.flatMap(({ name: i, values: u }) => u ? u.map((c) => ({
1126
- name: i,
1127
- value: c,
1128
- valueReference: _.specification
1122
+ valueReference: ue.attribute,
1123
+ visible: e.visible
1124
+ }
1125
+ }), de = (e, t, r) => {
1126
+ const n = e.flatMap(({ name: s, values: o }) => o ? o.map((d) => ({
1127
+ name: s,
1128
+ value: d,
1129
+ valueReference: ue.specification
1129
1130
  })) : {
1130
- name: i,
1131
+ name: s,
1131
1132
  value: "",
1132
- valueReference: _.specification
1133
- }), s = Array.isArray(a) ? a.map(Bt) : [], o = e ? e.map(Lt) : [];
1133
+ valueReference: ue.specification
1134
+ }), i = Array.isArray(r) ? r.map(pn) : [], a = t ? t.map(mn) : [];
1134
1135
  return [
1135
- ...r,
1136
- ...s,
1137
- ...o
1136
+ ...n,
1137
+ ...i,
1138
+ ...a
1138
1139
  ];
1139
- }, U = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Gt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Mt = (t) => {
1140
- let e = t.slice(0);
1141
- for (let a = 0; a < U.length; a++)
1142
- e = e.replace(
1143
- new RegExp(U.charAt(a), "g"),
1144
- Gt.charAt(a)
1140
+ }, He = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", hn = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", fn = (e) => {
1141
+ let t = e.slice(0);
1142
+ for (let r = 0; r < He.length; r++)
1143
+ t = t.replace(
1144
+ new RegExp(He.charAt(r), "g"),
1145
+ hn.charAt(r)
1145
1146
  );
1146
- return e;
1147
- }, Ut = (t) => t.replace(/[·/_,:]/, "-"), Y = (t) => {
1148
- const a = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1149
- return Ut(Mt(a)).toLowerCase();
1150
- }, Z = (t) => `/${t}/p`, ee = (t) => {
1151
- const e = Math.max(
1152
- ...t.map((r) => r.NumberOfInstallments)
1153
- ), a = t.find(
1154
- (r) => r.NumberOfInstallments === e
1147
+ return t;
1148
+ }, gn = (e) => e.replace(/[·/_,:]/, "-"), Ye = (e) => {
1149
+ const r = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1150
+ return gn(fn(r)).toLowerCase();
1151
+ }, et = (e) => `/${e}/p`, tt = (e) => {
1152
+ const t = Math.max(
1153
+ ...e.map((n) => n.NumberOfInstallments)
1154
+ ), r = e.find(
1155
+ (n) => n.NumberOfInstallments === t
1155
1156
  );
1156
1157
  return {
1157
- count: (a == null ? void 0 : a.NumberOfInstallments) ?? 0,
1158
- value: (a == null ? void 0 : a.Value) ?? 0
1158
+ count: (r == null ? void 0 : r.NumberOfInstallments) ?? 0,
1159
+ value: (r == null ? void 0 : r.Value) ?? 0
1159
1160
  };
1160
- }, te = (t, e) => {
1161
- const a = {
1161
+ }, rt = (e, t) => {
1162
+ const r = {
1162
1163
  price: 0,
1163
1164
  listPrice: 0,
1164
1165
  sellerDefault: !1
1165
- }, s = t.map(
1166
- (o) => jt({
1167
- offer: o.commertialOffer,
1168
- seller: o,
1169
- product: e
1166
+ }, i = e.map(
1167
+ (a) => ln({
1168
+ offer: a.commertialOffer,
1169
+ seller: a,
1170
+ product: t
1170
1171
  })
1171
- ).sort(J).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (a.price = o.Price, a.listPrice = o.ListPrice, a.sellerDefault = !0), {
1172
- availability: o.AvailableQuantity > 0,
1173
- listPrice: o.ListPrice,
1174
- price: _t(o),
1175
- priceValidUntil: o.PriceValidUntil,
1172
+ ).sort(Ke).map((a) => (a.seller.sellerId === "1" && a.AvailableQuantity > 0 && (r.price = a.Price, r.listPrice = a.ListPrice, r.sellerDefault = !0), {
1173
+ availability: a.AvailableQuantity > 0,
1174
+ listPrice: a.ListPrice,
1175
+ price: un(a),
1176
+ priceValidUntil: a.PriceValidUntil,
1176
1177
  priceCurrency: "BRL",
1177
- installments: o.Installments,
1178
- lowPrice: o.spotPrice,
1179
- quantity: o.AvailableQuantity,
1178
+ installments: a.Installments,
1179
+ lowPrice: a.spotPrice,
1180
+ quantity: a.AvailableQuantity,
1180
1181
  seller: {
1181
- identifier: o.seller.sellerId
1182
+ identifier: a.seller.sellerId
1182
1183
  }
1183
1184
  }));
1184
1185
  return {
1185
- lowPrice: a.sellerDefault ? a.price : s[0].price,
1186
- highPrice: a.sellerDefault ? a.listPrice : s[0].listPrice,
1187
- offers: s
1186
+ lowPrice: r.sellerDefault ? r.price : i[0].price,
1187
+ highPrice: r.sellerDefault ? r.listPrice : i[0].listPrice,
1188
+ offers: i
1188
1189
  };
1189
- }, re = (t) => {
1190
- const { attributes: e, itemId: a, name: r, sellers: s, variations: o } = t;
1190
+ }, nt = (e) => {
1191
+ const { attributes: t, itemId: r, name: n, sellers: i, variations: a } = e;
1191
1192
  return {
1192
- additionalProperty: H(o, e, []),
1193
- name: r,
1193
+ additionalProperty: de(a, t, []),
1194
+ name: n,
1194
1195
  offers: {
1195
- offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: u }) => ({
1196
- availability: Dt(u.AvailableQuantity > 0),
1197
- listPrice: u.ListPrice,
1198
- price: u.Price,
1199
- quantity: u.AvailableQuantity,
1196
+ offers: i == null ? void 0 : i.map(({ sellerId: s, commertialOffer: o }) => ({
1197
+ availability: cn(o.AvailableQuantity > 0),
1198
+ listPrice: o.ListPrice,
1199
+ price: o.Price,
1200
+ quantity: o.AvailableQuantity,
1200
1201
  seller: {
1201
- identifier: i
1202
+ identifier: s
1202
1203
  }
1203
1204
  }))
1204
1205
  },
1205
- sku: a
1206
+ sku: r
1206
1207
  // slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
1207
1208
  };
1208
- }, Vt = (t) => {
1209
- var v;
1209
+ }, bn = (e) => {
1210
+ var R;
1210
1211
  const {
1211
- attributes: e,
1212
- referenceId: a,
1213
- isVariantOf: r,
1214
- images: s,
1215
- itemId: o,
1216
- name: i,
1217
- sellers: u,
1218
- videos: c,
1219
- variations: m
1220
- } = t, {
1212
+ attributes: t,
1213
+ referenceId: r,
1214
+ isVariantOf: n,
1215
+ images: i,
1216
+ itemId: a,
1217
+ name: s,
1218
+ sellers: o,
1219
+ videos: d,
1220
+ variations: g
1221
+ } = e, {
1221
1222
  brand: l,
1222
- categories: d,
1223
- categoriesIds: R,
1224
- description: f,
1225
- linkText: p,
1226
- productClusters: y,
1227
- clusterHighlights: I,
1228
- productName: T,
1229
- properties: q,
1230
- productId: O,
1231
- productReference: g
1232
- } = r, E = d.slice().reverse(), C = te(u, t.isVariantOf), F = ee(C.offers[0].installments);
1223
+ categories: u,
1224
+ categoriesIds: w,
1225
+ description: v,
1226
+ linkText: y,
1227
+ productClusters: _,
1228
+ clusterHighlights: p,
1229
+ productName: b,
1230
+ properties: m,
1231
+ productId: h,
1232
+ productReference: f
1233
+ } = n, E = u.slice().reverse(), q = rt(o, e.isVariantOf), I = tt(q.offers[0].installments);
1233
1234
  return {
1234
- sku: o,
1235
- gtin: ((v = a == null ? void 0 : a[0]) == null ? void 0 : v.Value) ?? g ?? "",
1236
- name: T ?? i,
1237
- description: f,
1238
- releaseDate: r.releaseDate ?? "",
1239
- slug: p,
1240
- video: c[0],
1241
- categories: d,
1242
- categoriesIds: R,
1243
- id: O,
1235
+ sku: a,
1236
+ gtin: ((R = r == null ? void 0 : r[0]) == null ? void 0 : R.Value) ?? f ?? "",
1237
+ name: b ?? s,
1238
+ description: v,
1239
+ releaseDate: n.releaseDate ?? "",
1240
+ slug: y,
1241
+ video: d[0],
1242
+ categories: u,
1243
+ categoriesIds: w,
1244
+ id: h,
1244
1245
  brand: { name: l, brandName: l },
1245
1246
  seo: {
1246
- description: f,
1247
- title: T,
1248
- canonical: Z(p)
1247
+ description: v,
1248
+ title: b,
1249
+ canonical: et(y)
1249
1250
  },
1250
1251
  cluster: {
1251
- generals: y,
1252
- highlights: I
1252
+ generals: _,
1253
+ highlights: p
1253
1254
  },
1254
- properties: q,
1255
- availability: { status: C.offers[0].availability },
1255
+ properties: m,
1256
+ availability: { status: q.offers[0].availability },
1256
1257
  breadcrumbList: {
1257
1258
  itemListElement: [
1258
- ...E.map((P, A) => {
1259
- const $ = P.split("/"), L = $[$.length - 2], ne = $.map(Y).join("/");
1259
+ ...E.map((x, j) => {
1260
+ const F = x.split("/"), D = F[F.length - 2], U = F.map(Ye).join("/");
1260
1261
  return {
1261
- name: L,
1262
- item: ne,
1263
- position: A + 1
1262
+ name: D,
1263
+ item: U,
1264
+ position: j + 1
1264
1265
  };
1265
1266
  }),
1266
1267
  {
1267
- name: r.productName,
1268
- item: p,
1269
- position: d.length + 1
1268
+ name: n.productName,
1269
+ item: y,
1270
+ position: u.length + 1
1270
1271
  }
1271
1272
  ],
1272
- numberOfItems: d.length
1273
+ numberOfItems: u.length
1273
1274
  },
1274
- image: X(s),
1275
- offers: C,
1276
- additionalProperty: H(m, e, []),
1275
+ image: Ze(i),
1276
+ offers: q,
1277
+ additionalProperty: de(g, t, []),
1277
1278
  isVariantOf: {
1278
- productGroupID: r.productId,
1279
- hasVariant: r.items.map((P) => re(P))
1279
+ productGroupID: n.productId,
1280
+ hasVariant: n.items.map((x) => nt(x))
1280
1281
  },
1281
- installments: F
1282
+ installments: I
1282
1283
  };
1283
- }, xt = (t) => {
1284
- var F;
1284
+ }, wn = (e) => {
1285
+ var I;
1285
1286
  const {
1286
- attributes: e,
1287
- referenceId: a,
1288
- isVariantOf: r,
1289
- images: s,
1290
- itemId: o,
1291
- name: i,
1292
- sellers: u,
1293
- Videos: c,
1294
- variations: m
1295
- } = t, {
1287
+ attributes: t,
1288
+ referenceId: r,
1289
+ isVariantOf: n,
1290
+ images: i,
1291
+ itemId: a,
1292
+ name: s,
1293
+ sellers: o,
1294
+ Videos: d,
1295
+ variations: g
1296
+ } = e, {
1296
1297
  brand: l,
1297
- categories: d,
1298
- categoriesIds: R,
1299
- description: f,
1300
- linkText: p,
1301
- productClusters: y,
1302
- productName: I,
1303
- Coleção: T,
1304
- "ID Coleção": q,
1305
- productId: O
1306
- } = r, g = d.slice().reverse(), E = te(u, t.isVariantOf), C = ee(E.offers[0].installments);
1298
+ categories: u,
1299
+ categoriesIds: w,
1300
+ description: v,
1301
+ linkText: y,
1302
+ productClusters: _,
1303
+ productName: p,
1304
+ Coleção: b,
1305
+ "ID Coleção": m,
1306
+ productId: h
1307
+ } = n, f = u.slice().reverse(), E = rt(o, e.isVariantOf), q = tt(E.offers[0].installments);
1307
1308
  return {
1308
- sku: o,
1309
- gtin: ((F = a[0]) == null ? void 0 : F.Value) ?? "",
1310
- name: I ?? i,
1311
- description: f,
1312
- releaseDate: r.releaseDate ?? "",
1313
- slug: p,
1314
- video: c[0],
1315
- categories: d,
1316
- categoriesIds: R,
1317
- collection: T,
1318
- collectionId: q,
1319
- id: O,
1309
+ sku: a,
1310
+ gtin: ((I = r[0]) == null ? void 0 : I.Value) ?? "",
1311
+ name: p ?? s,
1312
+ description: v,
1313
+ releaseDate: n.releaseDate ?? "",
1314
+ slug: y,
1315
+ video: d[0],
1316
+ categories: u,
1317
+ categoriesIds: w,
1318
+ collection: b,
1319
+ collectionId: m,
1320
+ id: h,
1320
1321
  brand: { name: l, brandName: l },
1321
1322
  seo: {
1322
- description: f,
1323
- title: I,
1324
- canonical: Z(p)
1323
+ description: v,
1324
+ title: p,
1325
+ canonical: et(y)
1325
1326
  },
1326
1327
  cluster: {
1327
- generals: y,
1328
+ generals: _,
1328
1329
  highlights: []
1329
1330
  // TODO: add highlights
1330
1331
  },
1331
1332
  availability: { status: E.offers[0].availability },
1332
1333
  breadcrumbList: {
1333
1334
  itemListElement: [
1334
- ...g.map((v, P) => {
1335
- const A = v.split("/"), $ = A[A.length - 2], L = A.map(Y).join("/");
1335
+ ...f.map((R, x) => {
1336
+ const j = R.split("/"), F = j[j.length - 2], D = j.map(Ye).join("/");
1336
1337
  return {
1337
- name: $,
1338
- item: L,
1339
- position: P + 1
1338
+ name: F,
1339
+ item: D,
1340
+ position: x + 1
1340
1341
  };
1341
1342
  }),
1342
1343
  {
1343
- name: r.productName,
1344
- item: p,
1345
- position: d.length + 1
1344
+ name: n.productName,
1345
+ item: y,
1346
+ position: u.length + 1
1346
1347
  }
1347
1348
  ],
1348
- numberOfItems: d.length
1349
+ numberOfItems: u.length
1349
1350
  },
1350
- image: X(s),
1351
+ image: Ze(i),
1351
1352
  offers: E,
1352
- additionalProperty: H(m, e, []),
1353
+ additionalProperty: de(g, t, []),
1353
1354
  isVariantOf: {
1354
- productGroupID: r.productId,
1355
- hasVariant: r.items.map((v) => {
1356
- const { variations: P } = v, A = P.map(($) => ({
1357
- name: $,
1358
- values: v[$]
1355
+ productGroupID: n.productId,
1356
+ hasVariant: n.items.map((R) => {
1357
+ const { variations: x } = R, j = x.map((F) => ({
1358
+ name: F,
1359
+ values: R[F]
1359
1360
  }));
1360
1361
  return {
1361
- ...re(v),
1362
- additionalProperty: H(
1363
- A,
1364
- e,
1362
+ ...nt(R),
1363
+ additionalProperty: de(
1364
+ j,
1365
+ t,
1365
1366
  []
1366
1367
  )
1367
1368
  };
1368
1369
  })
1369
1370
  },
1370
- installments: C
1371
+ installments: q
1371
1372
  };
1372
- }, zt = n.array().of(n.object({
1373
- key: n.string().required(),
1374
- value: n.string().required()
1373
+ }, vn = c.array().of(c.object({
1374
+ key: c.string().required(),
1375
+ value: c.string().required()
1375
1376
  })).required("Facets are required");
1376
- async function Qt({ apiUrl: t, body: e, fetchOptions: a }) {
1377
- if (!e) {
1377
+ async function yn({ apiUrl: e, body: t, fetchOptions: r }) {
1378
+ if (!t) {
1378
1379
  console.error("[ERROR FETCHING] Body is required");
1379
1380
  return;
1380
1381
  }
1381
- await zt.validate(e);
1382
- const r = new URLSearchParams({}), s = e.map(({ key: i, value: u }) => `${i}/${u}`).join("/");
1383
- oe(e, r);
1384
- const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
1385
- return h(o, {
1382
+ await vn.validate(t);
1383
+ const n = new URLSearchParams({}), i = t.map(({ key: s, value: o }) => `${s}/${o}`).join("/");
1384
+ St(t, n);
1385
+ const a = `${e}/api/catalog_system/pub/products/crossselling/${i}`;
1386
+ return T(a, {
1386
1387
  cache: "no-store",
1387
- ...a
1388
- }).then((i) => i.map((c) => {
1389
- const m = W(c.items);
1390
- return m && K(m, c);
1391
- }).filter((c) => !!c).map((c) => ({
1392
- node: xt(c)
1388
+ ...r
1389
+ }).then((s) => s.map((d) => {
1390
+ const g = Je(d.items);
1391
+ return g && Xe(g, d);
1392
+ }).filter((d) => !!d).map((d) => ({
1393
+ node: wn(d)
1393
1394
  })));
1394
1395
  }
1395
- const ae = ({
1396
- apiUrl: t,
1397
- body: e,
1398
- fetchOptions: a,
1399
- extraData: r
1396
+ const it = ({
1397
+ apiUrl: e,
1398
+ body: t,
1399
+ fetchOptions: r,
1400
+ extraData: n
1400
1401
  }) => {
1401
- if (!e) {
1402
+ if (!t) {
1402
1403
  console.error("[ERROR FETCHING] Body is required");
1403
1404
  return;
1404
1405
  }
1405
1406
  const {
1406
- query: s = "",
1407
- page: o = 1,
1408
- count: i,
1409
- sort: u = "",
1410
- facets: c = [],
1411
- type: m,
1407
+ query: i = "",
1408
+ page: a = 1,
1409
+ count: s,
1410
+ sort: o = "",
1411
+ facets: d = [],
1412
+ type: g,
1412
1413
  hideUnavailableItems: l = !0,
1413
- locale: d = ""
1414
- } = e, R = new URLSearchParams({
1415
- page: o.toString(),
1416
- count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
1417
- query: s,
1418
- sort: u,
1419
- locale: d
1414
+ locale: u = ""
1415
+ } = t, w = new URLSearchParams({
1416
+ page: a.toString(),
1417
+ count: (s == null ? void 0 : s.toString()) ?? (n == null ? void 0 : n.ITEMS_PER_PAGE) ?? 24,
1418
+ query: i,
1419
+ sort: o,
1420
+ locale: u
1420
1421
  });
1421
- l !== void 0 && R.append("hideUnavailableItems", l.toString());
1422
- const f = c.map((p) => `${p.key}/${p.value}`).join("/") ?? "";
1423
- return _e(
1424
- `${t}/api/io/_v/api/intelligent-search/${m}/${f}?${R.toString()}`,
1422
+ l !== void 0 && w.append("hideUnavailableItems", l.toString());
1423
+ const v = d.map((y) => `${y.key}/${y.value}`).join("/") ?? "";
1424
+ return cr(
1425
+ `${e}/api/io/_v/api/intelligent-search/${g}/${v}?${w.toString()}`,
1425
1426
  {
1426
1427
  headers: {
1427
1428
  Accept: "application/json",
1428
1429
  "content-type": "application/json"
1429
1430
  },
1430
- ...a
1431
+ ...r
1431
1432
  }
1432
1433
  );
1433
1434
  };
1434
- async function Kt({ body: t, extraData: e, ...a }) {
1435
- if (!t) {
1435
+ async function _n({ body: e, extraData: t, ...r }) {
1436
+ if (!e) {
1436
1437
  console.error("[ERROR FETCHING] Body is required");
1437
1438
  return;
1438
1439
  }
1439
- const r = await ae({
1440
+ const n = await it({
1440
1441
  body: {
1441
- ...t,
1442
+ ...e,
1442
1443
  type: "product_search"
1443
1444
  },
1444
- extraData: e,
1445
- ...a
1446
- }), s = (r == null ? void 0 : r.products.map((u) => {
1447
- const c = W(u.items);
1448
- return c && K(c, u);
1449
- }).filter((u) => !!u)) ?? [], {
1450
- pagination: o,
1451
- recordsFiltered: i
1452
- } = r;
1445
+ extraData: t,
1446
+ ...r
1447
+ }), i = (n == null ? void 0 : n.products.map((o) => {
1448
+ const d = Je(o.items);
1449
+ return d && Xe(d, o);
1450
+ }).filter((o) => !!o)) ?? [], {
1451
+ pagination: a,
1452
+ recordsFiltered: s
1453
+ } = n;
1453
1454
  return {
1454
1455
  data: {
1455
1456
  pagination: {
1456
- nextPage: o.after.length > 0,
1457
- previousPage: o.before.length > 0,
1457
+ nextPage: a.after.length > 0,
1458
+ previousPage: a.before.length > 0,
1458
1459
  startCursor: "0",
1459
- endCursor: i.toString(),
1460
- count: i,
1461
- total: o.count
1460
+ endCursor: s.toString(),
1461
+ count: s,
1462
+ total: a.count
1462
1463
  },
1463
- products: s.map((u, c) => ({
1464
- node: Vt(u),
1465
- cursor: c.toString()
1464
+ products: i.map((o, d) => ({
1465
+ node: bn(o),
1466
+ cursor: d.toString()
1466
1467
  }))
1467
1468
  }
1468
1469
  };
1469
1470
  }
1470
- async function Jt({ body: t, extraData: e, ...a }) {
1471
- if (!t) {
1471
+ async function Rn({ body: e, extraData: t, ...r }) {
1472
+ if (!e) {
1472
1473
  console.error("[ERROR FETCHING] Body is required");
1473
1474
  return;
1474
1475
  }
1475
- const r = await ae({
1476
+ const n = await it({
1476
1477
  body: {
1477
- ...t,
1478
+ ...e,
1478
1479
  type: "facets"
1479
1480
  },
1480
- extraData: e,
1481
- ...a
1481
+ extraData: t,
1482
+ ...r
1482
1483
  });
1483
- return !r || !r.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1484
+ return !n || !n.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1484
1485
  data: {
1485
- ...r,
1486
- facets: ie(r, t == null ? void 0 : t.selectedFacets, (t == null ? void 0 : t.query) ?? "")
1486
+ ...n,
1487
+ facets: Ct(n, e == null ? void 0 : e.selectedFacets, (e == null ? void 0 : e.query) ?? "")
1487
1488
  }
1488
1489
  };
1489
1490
  }
1490
- const Wt = n.object({
1491
- query: n.string().optional(),
1492
- locale: n.string().optional()
1491
+ const In = c.object({
1492
+ query: c.string().optional(),
1493
+ locale: c.string().optional()
1493
1494
  });
1494
- async function Xt({ apiUrl: t, body: e, fetchOptions: a }) {
1495
- if (!e) {
1495
+ async function Pn({ apiUrl: e, body: t, fetchOptions: r }) {
1496
+ if (!t) {
1496
1497
  console.error("[ERROR FETCHING] Body is required");
1497
1498
  return;
1498
1499
  }
1499
- await Wt.validate(e);
1500
- const { query: r = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: r, locale: s });
1501
- return h(
1502
- `${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,
1500
+ await In.validate(t);
1501
+ const { query: n = "", locale: i = "default_locale" } = t, a = new URLSearchParams({ query: n, locale: i });
1502
+ return T(
1503
+ `${e}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,
1503
1504
  {
1504
- ...a
1505
+ ...r
1505
1506
  }
1506
1507
  );
1507
1508
  }
1508
- async function Yt({ apiUrl: t }) {
1509
- return h(`${t}/api/io/_v/api/intelligent-search/top_searches`);
1509
+ async function Sn({ apiUrl: e }) {
1510
+ return T(`${e}/api/io/_v/api/intelligent-search/top_searches`);
1510
1511
  }
1511
- const Zt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1512
+ const Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1512
1513
  __proto__: null,
1513
- getSearchAutoCompleteSuggestions: wt,
1514
- getSearchCrossellingProducts: Qt,
1515
- getSearchFacets: Jt,
1516
- getSearchProducts: Kt,
1517
- getSearchSuggestedTerms: Xt,
1518
- getSearchTopSearchs: Yt
1519
- }, Symbol.toStringTag, { value: "Module" })), er = n.object({
1520
- masterDataEntity: n.string().nonNullable(),
1521
- payload: n.object().shape({}).nullable()
1514
+ getSearchAutoCompleteSuggestions: on,
1515
+ getSearchCrossellingProducts: yn,
1516
+ getSearchFacets: Rn,
1517
+ getSearchProducts: _n,
1518
+ getSearchSuggestedTerms: Pn,
1519
+ getSearchTopSearchs: Sn
1520
+ }, Symbol.toStringTag, { value: "Module" })), xn = c.object({
1521
+ masterDataEntity: c.string().nonNullable(),
1522
+ payload: c.object().shape({}).nullable()
1522
1523
  });
1523
- async function tr({
1524
- apiUrl: t,
1525
- body: e,
1526
- fetchOptions: a
1524
+ async function kn({
1525
+ apiUrl: e,
1526
+ body: t,
1527
+ fetchOptions: r
1527
1528
  }) {
1528
- if (!e) {
1529
+ if (!t) {
1529
1530
  console.error("[ERROR FETCHING] Body is required");
1530
1531
  return;
1531
1532
  }
1532
- await er.validate(e);
1533
- const { masterDataEntity: r, payload: s } = e, o = `${t}/api/dataentities/${r}/documents`;
1534
- return h(o, {
1533
+ await xn.validate(t);
1534
+ const { masterDataEntity: n, payload: i } = t, a = `${e}/api/dataentities/${n}/documents`;
1535
+ return T(a, {
1535
1536
  method: "POST",
1536
1537
  body: {
1537
- payload: s
1538
+ payload: i
1538
1539
  },
1539
- ...a
1540
+ ...r
1540
1541
  });
1541
1542
  }
1542
- const rr = n.object().shape({
1543
- _where: n.string().optional(),
1544
- _fields: n.string().optional(),
1545
- _sort: n.string().optional(),
1546
- _from: n.number().integer().min(0).optional(),
1547
- _to: n.number().integer().min(0).optional(),
1548
- _keyword: n.string().optional()
1549
- }), ar = n.object({
1550
- masterDataEntity: n.string().required(),
1551
- searchFields: rr,
1552
- headers: n.object().shape({
1553
- "REST-Range": n.string().notRequired()
1543
+ const En = c.object().shape({
1544
+ _where: c.string().optional(),
1545
+ _fields: c.string().optional(),
1546
+ _sort: c.string().optional(),
1547
+ _from: c.number().integer().min(0).optional(),
1548
+ _to: c.number().integer().min(0).optional(),
1549
+ _keyword: c.string().optional()
1550
+ }), An = c.object({
1551
+ masterDataEntity: c.string().required(),
1552
+ searchFields: En,
1553
+ headers: c.object().shape({
1554
+ "REST-Range": c.string().notRequired()
1554
1555
  })
1555
1556
  });
1556
- async function nr({
1557
- apiUrl: t,
1558
- body: e,
1559
- fetchOptions: a
1557
+ async function Tn({
1558
+ apiUrl: e,
1559
+ body: t,
1560
+ fetchOptions: r
1560
1561
  }) {
1561
- if (!e) {
1562
+ if (!t) {
1562
1563
  console.error("[ERROR FETCHING] Body is required");
1563
1564
  return;
1564
1565
  }
1565
- const r = new URLSearchParams();
1566
- await ar.validate(e);
1567
- const { masterDataEntity: s, searchFields: o, headers: i } = e;
1568
- o && Object.entries(o).forEach(([m, l]) => {
1569
- r.append(m, String(l));
1570
- }), "_fields" in o || r == null || r.append("_fields", "_all");
1571
- let u = [], c = null;
1566
+ const n = new URLSearchParams();
1567
+ await An.validate(t);
1568
+ const { masterDataEntity: i, searchFields: a, headers: s } = t;
1569
+ a && Object.entries(a).forEach(([g, l]) => {
1570
+ n.append(g, String(l));
1571
+ }), "_fields" in a || n == null || n.append("_fields", "_all");
1572
+ let o = [], d = null;
1572
1573
  do {
1573
- c && r.set("_scroll", c);
1574
- const m = await fetch(
1575
- `${t}/api/dataentities/${s}/search?${r.toString()}`,
1574
+ d && n.set("_scroll", d);
1575
+ const g = await fetch(
1576
+ `${e}/api/dataentities/${i}/search?${n.toString()}`,
1576
1577
  {
1577
1578
  method: "GET",
1578
1579
  headers: {
1579
- "REST-Range": (i == null ? void 0 : i["REST-Range"]) ?? "resources=0-100",
1580
- ...a == null ? void 0 : a.headers
1580
+ "REST-Range": (s == null ? void 0 : s["REST-Range"]) ?? "resources=0-100",
1581
+ ...r == null ? void 0 : r.headers
1581
1582
  },
1582
1583
  cache: "no-store"
1583
1584
  }
1584
1585
  );
1585
- if (!m.ok)
1586
+ if (!g.ok)
1586
1587
  throw new Error(
1587
- `[MasterData] ${m.status} - ${m.statusText}`
1588
+ `[MasterData] ${g.status} - ${g.statusText}`
1588
1589
  );
1589
- const l = await m.json();
1590
- u.push(...l), c = m.headers.get("x-vtex-md-scroll");
1591
- } while (c);
1592
- return u;
1590
+ const l = await g.json();
1591
+ o.push(...l), d = g.headers.get("x-vtex-md-scroll");
1592
+ } while (d);
1593
+ return o;
1593
1594
  }
1594
- const sr = n.object({
1595
- dataEntityName: n.string().required(),
1596
- id: n.string().required(),
1597
- fieldsToBeUpdated: n.object().shape({})
1595
+ const On = c.object({
1596
+ dataEntityName: c.string().required(),
1597
+ id: c.string().required(),
1598
+ fieldsToBeUpdated: c.object().shape({})
1598
1599
  });
1599
- async function or({
1600
- apiUrl: t,
1601
- body: e,
1602
- fetchOptions: a
1600
+ async function qn({
1601
+ apiUrl: e,
1602
+ body: t,
1603
+ fetchOptions: r
1603
1604
  }) {
1604
- if (!e) {
1605
+ if (!t) {
1605
1606
  console.error("[ERROR FETCHING] Body is required");
1606
1607
  return;
1607
1608
  }
1608
- await sr.validate(e);
1609
- const { dataEntityName: r, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${r}/documents/${s}`;
1610
- return h(i, {
1609
+ await On.validate(t);
1610
+ const { dataEntityName: n, id: i, fieldsToBeUpdated: a } = t, s = `${e}/api/dataentities/${n}/documents/${i}`;
1611
+ return T(s, {
1611
1612
  body: {
1612
- fieldsToBeUpdated: o
1613
+ fieldsToBeUpdated: a
1613
1614
  },
1614
1615
  method: "PATCH",
1615
- ...a
1616
+ ...r
1616
1617
  });
1617
1618
  }
1618
- const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1619
+ const Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1619
1620
  __proto__: null,
1620
- getSearchMasterdata: nr,
1621
- patchUpdateMasterdata: or,
1622
- postMasterdata: tr
1621
+ getSearchMasterdata: Tn,
1622
+ patchUpdateMasterdata: qn,
1623
+ postMasterdata: kn
1623
1624
  }, Symbol.toStringTag, { value: "Module" }));
1624
- async function cr({ body: t, apiUrl: e, extraData: a, fetchOptions: r }) {
1625
- const { productIds: s } = t;
1626
- if (!s)
1625
+ async function jn({ body: e, apiUrl: t, extraData: r, fetchOptions: n }) {
1626
+ const { productIds: i } = e;
1627
+ if (!i)
1627
1628
  return console.error("[ERROR FETCHING] productIds is required"), [];
1628
- const { NAME_SPLIT_SYMBOL: o } = a;
1629
- if (!o)
1629
+ const { NAME_SPLIT_SYMBOL: a } = r;
1630
+ if (!a)
1630
1631
  return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
1631
- const i = s.map((l) => typeof l == "string" || typeof l == "number" ? `productId:${l}` : "").join("&fq="), u = await h(
1632
- `${e}/api/catalog_system/pub/products/search?fq=${i}`,
1632
+ const s = i.map((l) => typeof l == "string" || typeof l == "number" ? `productId:${l}` : "").join("&fq="), o = await T(
1633
+ `${t}/api/catalog_system/pub/products/search?fq=${s}`,
1633
1634
  {
1634
- ...r
1635
+ ...n
1635
1636
  }
1636
- ), c = (l) => Object.keys(l).map((d) => ({ id: d, name: l[d] }));
1637
- return u.map((l, d) => {
1638
- var O;
1639
- const { installments: R, price: f, listPrice: p, sizes: y, allSizesAvailable: I } = ce({ items: l.items, NAME_SPLIT_SYMBOL: o }), T = I ? !0 : y.some((g) => g.available), q = l.items[0].sellers[0].commertialOffer;
1637
+ ), d = (l) => Object.keys(l).map((u) => ({ id: u, name: l[u] }));
1638
+ return o.map((l, u) => {
1639
+ var h;
1640
+ const { installments: w, price: v, listPrice: y, sizes: _, allSizesAvailable: p } = xt({ items: l.items, NAME_SPLIT_SYMBOL: a }), b = p ? !0 : _.some((f) => f.available), m = l.items[0].sellers[0].commertialOffer;
1640
1641
  return {
1641
1642
  node: {
1642
1643
  sku: l.items[0].itemId,
@@ -1658,117 +1659,1318 @@ async function cr({ body: t, apiUrl: e, extraData: a, fetchOptions: r }) {
1658
1659
  canonical: `/${l.linkText}/p`
1659
1660
  },
1660
1661
  cluster: {
1661
- generals: c(l.productClusters),
1662
- highlights: c(l.clusterHighlights)
1662
+ generals: d(l.productClusters),
1663
+ highlights: d(l.clusterHighlights)
1663
1664
  },
1664
1665
  availability: {
1665
- status: T
1666
+ status: b
1666
1667
  },
1667
1668
  image: l.items[0].images.map(
1668
1669
  ({
1669
- imageLabel: g,
1670
+ imageLabel: f,
1670
1671
  imageUrl: E
1671
1672
  }) => ({
1672
- alternateName: g,
1673
+ alternateName: f,
1673
1674
  url: E,
1674
- keywords: g
1675
+ keywords: f
1675
1676
  })
1676
1677
  ),
1677
1678
  offers: {
1678
- lowPrice: f,
1679
- highPrice: p,
1679
+ lowPrice: v,
1680
+ highPrice: y,
1680
1681
  offers: [
1681
1682
  {
1682
- availability: T,
1683
- listPrice: p,
1684
- price: f,
1685
- priceValidUntil: q.PriceValidUntil,
1683
+ availability: b,
1684
+ listPrice: y,
1685
+ price: v,
1686
+ priceValidUntil: m.PriceValidUntil,
1686
1687
  priceCurrency: "BRL",
1687
- installments: q.Installments,
1688
- lowPrice: f,
1689
- quantity: q.AvailableQuantity,
1688
+ installments: m.Installments,
1689
+ lowPrice: v,
1690
+ quantity: m.AvailableQuantity,
1690
1691
  seller: {
1691
1692
  identifier: l.items[0].sellers[0].sellerId
1692
1693
  }
1693
1694
  }
1694
1695
  ]
1695
1696
  },
1696
- additionalProperty: (O = l == null ? void 0 : l.skuSpecifications) == null ? void 0 : O.map((g) => ({
1697
+ additionalProperty: (h = l == null ? void 0 : l.skuSpecifications) == null ? void 0 : h.map((f) => ({
1697
1698
  name: l == null ? void 0 : l.skuSpecifications[0].field.name,
1698
- value: g,
1699
+ value: f,
1699
1700
  valueReference: "SPECIFICATION"
1700
1701
  })),
1701
1702
  isVariantOf: {
1702
1703
  productGroupID: l.productId,
1703
- hasVariant: l.items.map((g) => {
1704
+ hasVariant: l.items.map((f) => {
1704
1705
  var E;
1705
1706
  return {
1706
- additionalProperty: g == null ? void 0 : g.variations.map(() => {
1707
- var C, F, v;
1707
+ additionalProperty: f == null ? void 0 : f.variations.map(() => {
1708
+ var q, I, R;
1708
1709
  return {
1709
- name: (C = g == null ? void 0 : g.variations) == null ? void 0 : C[0],
1710
- value: (v = g == null ? void 0 : g[(F = g == null ? void 0 : g.variations) == null ? void 0 : F[0]]) == null ? void 0 : v[0],
1710
+ name: (q = f == null ? void 0 : f.variations) == null ? void 0 : q[0],
1711
+ value: (R = f == null ? void 0 : f[(I = f == null ? void 0 : f.variations) == null ? void 0 : I[0]]) == null ? void 0 : R[0],
1711
1712
  valueReference: "SPECIFICATION"
1712
1713
  };
1713
1714
  }),
1714
- name: g.name,
1715
+ name: f.name,
1715
1716
  offers: {
1716
- offers: (E = g.sellers) == null ? void 0 : E.map(
1717
- ({ commertialOffer: C, sellerId: F }) => ({
1717
+ offers: (E = f.sellers) == null ? void 0 : E.map(
1718
+ ({ commertialOffer: q, sellerId: I }) => ({
1718
1719
  availability: "https://schema.org/InStock",
1719
- listPrice: C.ListPrice,
1720
- price: C.Price,
1721
- quantity: C.AvailableQuantity,
1720
+ listPrice: q.ListPrice,
1721
+ price: q.Price,
1722
+ quantity: q.AvailableQuantity,
1722
1723
  seller: {
1723
- identifier: F
1724
+ identifier: I
1724
1725
  }
1725
1726
  })
1726
1727
  )
1727
1728
  },
1728
- sku: g.itemId,
1729
- slug: `-${g.itemId}`
1729
+ sku: f.itemId,
1730
+ slug: `-${f.itemId}`
1730
1731
  };
1731
1732
  })
1732
1733
  },
1733
- installments: R
1734
+ installments: w
1734
1735
  },
1735
- cursor: d.toString()
1736
+ cursor: u.toString()
1737
+ };
1738
+ });
1739
+ }
1740
+ const Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1741
+ __proto__: null,
1742
+ getWishlistProducts: jn
1743
+ }, Symbol.toStringTag, { value: "Module" }));
1744
+ var Ie = { exports: {} }, ot = {}, Se = {}, at = {}, st = {};
1745
+ (function(e) {
1746
+ Object.defineProperty(e, "__esModule", {
1747
+ value: !0
1748
+ }), Object.defineProperty(e, "addPathSuffix", {
1749
+ enumerable: !0,
1750
+ get: function() {
1751
+ return r;
1752
+ }
1753
+ });
1754
+ const t = kt;
1755
+ function r(n, i) {
1756
+ if (!n.startsWith("/") || !i)
1757
+ return n;
1758
+ const { pathname: a, query: s, hash: o } = (0, t.parsePath)(n);
1759
+ return "" + a + i + s + o;
1760
+ }
1761
+ })(st);
1762
+ (function(e) {
1763
+ Object.defineProperty(e, "__esModule", {
1764
+ value: !0
1765
+ }), Object.defineProperty(e, "formatNextPathnameInfo", {
1766
+ enumerable: !0,
1767
+ get: function() {
1768
+ return a;
1769
+ }
1770
+ });
1771
+ const t = At, r = Tt, n = st, i = Et;
1772
+ function a(s) {
1773
+ let o = (0, i.addLocale)(s.pathname, s.locale, s.buildId ? void 0 : s.defaultLocale, s.ignorePrefix);
1774
+ return (s.buildId || !s.trailingSlash) && (o = (0, t.removeTrailingSlash)(o)), s.buildId && (o = (0, n.addPathSuffix)((0, r.addPathPrefix)(o, "/_next/data/" + s.buildId), s.pathname === "/" ? "index.json" : ".json")), o = (0, r.addPathPrefix)(o, s.basePath), !s.buildId && s.trailingSlash ? o.endsWith("/") ? o : (0, n.addPathSuffix)(o, "/") : (0, t.removeTrailingSlash)(o);
1775
+ }
1776
+ })(at);
1777
+ var lt = {};
1778
+ (function(e) {
1779
+ Object.defineProperty(e, "__esModule", {
1780
+ value: !0
1781
+ }), Object.defineProperty(e, "getHostname", {
1782
+ enumerable: !0,
1783
+ get: function() {
1784
+ return t;
1785
+ }
1786
+ });
1787
+ function t(r, n) {
1788
+ let i;
1789
+ if (n != null && n.host && !Array.isArray(n.host))
1790
+ i = n.host.toString().split(":", 1)[0];
1791
+ else if (r.hostname)
1792
+ i = r.hostname;
1793
+ else return;
1794
+ return i.toLowerCase();
1795
+ }
1796
+ })(lt);
1797
+ var ct = {}, ut = {};
1798
+ (function(e) {
1799
+ Object.defineProperty(e, "__esModule", {
1800
+ value: !0
1801
+ }), Object.defineProperty(e, "removePathPrefix", {
1802
+ enumerable: !0,
1803
+ get: function() {
1804
+ return r;
1805
+ }
1806
+ });
1807
+ const t = Ve;
1808
+ function r(n, i) {
1809
+ if (!(0, t.pathHasPrefix)(n, i))
1810
+ return n;
1811
+ const a = n.slice(i.length);
1812
+ return a.startsWith("/") ? a : "/" + a;
1813
+ }
1814
+ })(ut);
1815
+ (function(e) {
1816
+ Object.defineProperty(e, "__esModule", {
1817
+ value: !0
1818
+ }), Object.defineProperty(e, "getNextPathnameInfo", {
1819
+ enumerable: !0,
1820
+ get: function() {
1821
+ return i;
1822
+ }
1823
+ });
1824
+ const t = Ot, r = ut, n = Ve;
1825
+ function i(a, s) {
1826
+ var o;
1827
+ const { basePath: d, i18n: g, trailingSlash: l } = (o = s.nextConfig) != null ? o : {}, u = {
1828
+ pathname: a,
1829
+ trailingSlash: a !== "/" ? a.endsWith("/") : l
1736
1830
  };
1831
+ d && (0, n.pathHasPrefix)(u.pathname, d) && (u.pathname = (0, r.removePathPrefix)(u.pathname, d), u.basePath = d);
1832
+ let w = u.pathname;
1833
+ if (u.pathname.startsWith("/_next/data/") && u.pathname.endsWith(".json")) {
1834
+ const y = u.pathname.replace(/^\/_next\/data\//, "").replace(/\.json$/, "").split("/"), _ = y[0];
1835
+ u.buildId = _, w = y[1] !== "index" ? "/" + y.slice(1).join("/") : "/", s.parseData === !0 && (u.pathname = w);
1836
+ }
1837
+ if (g) {
1838
+ let y = s.i18nProvider ? s.i18nProvider.analyze(u.pathname) : (0, t.normalizeLocalePath)(u.pathname, g.locales);
1839
+ u.locale = y.detectedLocale;
1840
+ var v;
1841
+ u.pathname = (v = y.pathname) != null ? v : u.pathname, !y.detectedLocale && u.buildId && (y = s.i18nProvider ? s.i18nProvider.analyze(w) : (0, t.normalizeLocalePath)(w, g.locales), y.detectedLocale && (u.locale = y.detectedLocale));
1842
+ }
1843
+ return u;
1844
+ }
1845
+ })(ct);
1846
+ (function(e) {
1847
+ Object.defineProperty(e, "__esModule", {
1848
+ value: !0
1849
+ }), Object.defineProperty(e, "NextURL", {
1850
+ enumerable: !0,
1851
+ get: function() {
1852
+ return d;
1853
+ }
1737
1854
  });
1855
+ const t = qt, r = at, n = lt, i = ct, a = /(?!^https?:\/\/)(127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|\[::1\]|localhost)/;
1856
+ function s(g, l) {
1857
+ return new URL(String(g).replace(a, "localhost"), l && String(l).replace(a, "localhost"));
1858
+ }
1859
+ const o = Symbol("NextURLInternal");
1860
+ class d {
1861
+ constructor(l, u, w) {
1862
+ let v, y;
1863
+ typeof u == "object" && "pathname" in u || typeof u == "string" ? (v = u, y = w || {}) : y = w || u || {}, this[o] = {
1864
+ url: s(l, v ?? y.base),
1865
+ options: y,
1866
+ basePath: ""
1867
+ }, this.analyze();
1868
+ }
1869
+ analyze() {
1870
+ var l, u, w, v, y;
1871
+ const _ = (0, i.getNextPathnameInfo)(this[o].url.pathname, {
1872
+ nextConfig: this[o].options.nextConfig,
1873
+ parseData: !process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE,
1874
+ i18nProvider: this[o].options.i18nProvider
1875
+ }), p = (0, n.getHostname)(this[o].url, this[o].options.headers);
1876
+ this[o].domainLocale = this[o].options.i18nProvider ? this[o].options.i18nProvider.detectDomainLocale(p) : (0, t.detectDomainLocale)((u = this[o].options.nextConfig) == null || (l = u.i18n) == null ? void 0 : l.domains, p);
1877
+ const b = ((w = this[o].domainLocale) == null ? void 0 : w.defaultLocale) || ((y = this[o].options.nextConfig) == null || (v = y.i18n) == null ? void 0 : v.defaultLocale);
1878
+ this[o].url.pathname = _.pathname, this[o].defaultLocale = b, this[o].basePath = _.basePath ?? "", this[o].buildId = _.buildId, this[o].locale = _.locale ?? b, this[o].trailingSlash = _.trailingSlash;
1879
+ }
1880
+ formatPathname() {
1881
+ return (0, r.formatNextPathnameInfo)({
1882
+ basePath: this[o].basePath,
1883
+ buildId: this[o].buildId,
1884
+ defaultLocale: this[o].options.forceLocale ? void 0 : this[o].defaultLocale,
1885
+ locale: this[o].locale,
1886
+ pathname: this[o].url.pathname,
1887
+ trailingSlash: this[o].trailingSlash
1888
+ });
1889
+ }
1890
+ formatSearch() {
1891
+ return this[o].url.search;
1892
+ }
1893
+ get buildId() {
1894
+ return this[o].buildId;
1895
+ }
1896
+ set buildId(l) {
1897
+ this[o].buildId = l;
1898
+ }
1899
+ get locale() {
1900
+ return this[o].locale ?? "";
1901
+ }
1902
+ set locale(l) {
1903
+ var u, w;
1904
+ if (!this[o].locale || !(!((w = this[o].options.nextConfig) == null || (u = w.i18n) == null) && u.locales.includes(l)))
1905
+ throw new TypeError(`The NextURL configuration includes no locale "${l}"`);
1906
+ this[o].locale = l;
1907
+ }
1908
+ get defaultLocale() {
1909
+ return this[o].defaultLocale;
1910
+ }
1911
+ get domainLocale() {
1912
+ return this[o].domainLocale;
1913
+ }
1914
+ get searchParams() {
1915
+ return this[o].url.searchParams;
1916
+ }
1917
+ get host() {
1918
+ return this[o].url.host;
1919
+ }
1920
+ set host(l) {
1921
+ this[o].url.host = l;
1922
+ }
1923
+ get hostname() {
1924
+ return this[o].url.hostname;
1925
+ }
1926
+ set hostname(l) {
1927
+ this[o].url.hostname = l;
1928
+ }
1929
+ get port() {
1930
+ return this[o].url.port;
1931
+ }
1932
+ set port(l) {
1933
+ this[o].url.port = l;
1934
+ }
1935
+ get protocol() {
1936
+ return this[o].url.protocol;
1937
+ }
1938
+ set protocol(l) {
1939
+ this[o].url.protocol = l;
1940
+ }
1941
+ get href() {
1942
+ const l = this.formatPathname(), u = this.formatSearch();
1943
+ return `${this.protocol}//${this.host}${l}${u}${this.hash}`;
1944
+ }
1945
+ set href(l) {
1946
+ this[o].url = s(l), this.analyze();
1947
+ }
1948
+ get origin() {
1949
+ return this[o].url.origin;
1950
+ }
1951
+ get pathname() {
1952
+ return this[o].url.pathname;
1953
+ }
1954
+ set pathname(l) {
1955
+ this[o].url.pathname = l;
1956
+ }
1957
+ get hash() {
1958
+ return this[o].url.hash;
1959
+ }
1960
+ set hash(l) {
1961
+ this[o].url.hash = l;
1962
+ }
1963
+ get search() {
1964
+ return this[o].url.search;
1965
+ }
1966
+ set search(l) {
1967
+ this[o].url.search = l;
1968
+ }
1969
+ get password() {
1970
+ return this[o].url.password;
1971
+ }
1972
+ set password(l) {
1973
+ this[o].url.password = l;
1974
+ }
1975
+ get username() {
1976
+ return this[o].url.username;
1977
+ }
1978
+ set username(l) {
1979
+ this[o].url.username = l;
1980
+ }
1981
+ get basePath() {
1982
+ return this[o].basePath;
1983
+ }
1984
+ set basePath(l) {
1985
+ this[o].basePath = l.startsWith("/") ? l : `/${l}`;
1986
+ }
1987
+ toString() {
1988
+ return this.href;
1989
+ }
1990
+ toJSON() {
1991
+ return this.href;
1992
+ }
1993
+ [Symbol.for("edge-runtime.inspect.custom")]() {
1994
+ return {
1995
+ href: this.href,
1996
+ origin: this.origin,
1997
+ protocol: this.protocol,
1998
+ username: this.username,
1999
+ password: this.password,
2000
+ host: this.host,
2001
+ hostname: this.hostname,
2002
+ port: this.port,
2003
+ pathname: this.pathname,
2004
+ search: this.search,
2005
+ searchParams: this.searchParams,
2006
+ hash: this.hash
2007
+ };
2008
+ }
2009
+ clone() {
2010
+ return new d(String(this), this[o].options);
2011
+ }
2012
+ }
2013
+ })(Se);
2014
+ var Ce = {};
2015
+ (function(e) {
2016
+ Object.defineProperty(e, "__esModule", {
2017
+ value: !0
2018
+ });
2019
+ function t(d, g) {
2020
+ for (var l in g) Object.defineProperty(d, l, {
2021
+ enumerable: !0,
2022
+ get: g[l]
2023
+ });
2024
+ }
2025
+ t(e, {
2026
+ fromNodeOutgoingHttpHeaders: function() {
2027
+ return n;
2028
+ },
2029
+ normalizeNextQueryParam: function() {
2030
+ return o;
2031
+ },
2032
+ splitCookiesString: function() {
2033
+ return i;
2034
+ },
2035
+ toNodeOutgoingHttpHeaders: function() {
2036
+ return a;
2037
+ },
2038
+ validateURL: function() {
2039
+ return s;
2040
+ }
2041
+ });
2042
+ const r = Nt;
2043
+ function n(d) {
2044
+ const g = new Headers();
2045
+ for (let [l, u] of Object.entries(d)) {
2046
+ const w = Array.isArray(u) ? u : [
2047
+ u
2048
+ ];
2049
+ for (let v of w)
2050
+ typeof v > "u" || (typeof v == "number" && (v = v.toString()), g.append(l, v));
2051
+ }
2052
+ return g;
2053
+ }
2054
+ function i(d) {
2055
+ var g = [], l = 0, u, w, v, y, _;
2056
+ function p() {
2057
+ for (; l < d.length && /\s/.test(d.charAt(l)); )
2058
+ l += 1;
2059
+ return l < d.length;
2060
+ }
2061
+ function b() {
2062
+ return w = d.charAt(l), w !== "=" && w !== ";" && w !== ",";
2063
+ }
2064
+ for (; l < d.length; ) {
2065
+ for (u = l, _ = !1; p(); )
2066
+ if (w = d.charAt(l), w === ",") {
2067
+ for (v = l, l += 1, p(), y = l; l < d.length && b(); )
2068
+ l += 1;
2069
+ l < d.length && d.charAt(l) === "=" ? (_ = !0, l = y, g.push(d.substring(u, v)), u = l) : l = v + 1;
2070
+ } else
2071
+ l += 1;
2072
+ (!_ || l >= d.length) && g.push(d.substring(u, d.length));
2073
+ }
2074
+ return g;
2075
+ }
2076
+ function a(d) {
2077
+ const g = {}, l = [];
2078
+ if (d)
2079
+ for (const [u, w] of d.entries())
2080
+ u.toLowerCase() === "set-cookie" ? (l.push(...i(w)), g[u] = l.length === 1 ? l[0] : l) : g[u] = w;
2081
+ return g;
2082
+ }
2083
+ function s(d) {
2084
+ try {
2085
+ return String(new URL(String(d)));
2086
+ } catch (g) {
2087
+ throw new Error(`URL is malformed "${String(d)}". Please use only absolute URLs - https://nextjs.org/docs/messages/middleware-relative-urls`, {
2088
+ cause: g
2089
+ });
2090
+ }
2091
+ }
2092
+ function o(d, g) {
2093
+ const l = [
2094
+ r.NEXT_QUERY_PARAM_PREFIX,
2095
+ r.NEXT_INTERCEPTION_MARKER_PREFIX
2096
+ ];
2097
+ for (const u of l)
2098
+ if (d !== u && d.startsWith(u)) {
2099
+ const w = d.substring(u.length);
2100
+ g(w);
2101
+ }
2102
+ }
2103
+ })(Ce);
2104
+ var dt = {};
2105
+ (function(e) {
2106
+ Object.defineProperty(e, "__esModule", {
2107
+ value: !0
2108
+ });
2109
+ function t(a, s) {
2110
+ for (var o in s) Object.defineProperty(a, o, {
2111
+ enumerable: !0,
2112
+ get: s[o]
2113
+ });
2114
+ }
2115
+ t(e, {
2116
+ PageSignatureError: function() {
2117
+ return r;
2118
+ },
2119
+ RemovedPageError: function() {
2120
+ return n;
2121
+ },
2122
+ RemovedUAError: function() {
2123
+ return i;
2124
+ }
2125
+ });
2126
+ class r extends Error {
2127
+ constructor({ page: s }) {
2128
+ super(`The middleware "${s}" accepts an async API directly with the form:
2129
+
2130
+ export function middleware(request, event) {
2131
+ return NextResponse.redirect('/new-location')
2132
+ }
2133
+
2134
+ Read more: https://nextjs.org/docs/messages/middleware-new-signature
2135
+ `);
2136
+ }
2137
+ }
2138
+ class n extends Error {
2139
+ constructor() {
2140
+ super("The request.page has been deprecated in favour of `URLPattern`.\n Read more: https://nextjs.org/docs/messages/middleware-request-page\n ");
2141
+ }
2142
+ }
2143
+ class i extends Error {
2144
+ constructor() {
2145
+ super("The request.ua has been removed in favour of `userAgent` function.\n Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent\n ");
2146
+ }
2147
+ }
2148
+ })(dt);
2149
+ var pe = {}, xe = Object.defineProperty, $n = Object.getOwnPropertyDescriptor, Ln = Object.getOwnPropertyNames, Dn = Object.prototype.hasOwnProperty, Un = (e, t) => {
2150
+ for (var r in t)
2151
+ xe(e, r, { get: t[r], enumerable: !0 });
2152
+ }, Hn = (e, t, r, n) => {
2153
+ if (t && typeof t == "object" || typeof t == "function")
2154
+ for (let i of Ln(t))
2155
+ !Dn.call(e, i) && i !== r && xe(e, i, { get: () => t[i], enumerable: !(n = $n(t, i)) || n.enumerable });
2156
+ return e;
2157
+ }, Mn = (e) => Hn(xe({}, "__esModule", { value: !0 }), e), pt = {};
2158
+ Un(pt, {
2159
+ RequestCookies: () => Kn,
2160
+ ResponseCookies: () => Jn,
2161
+ parseCookie: () => ke,
2162
+ parseSetCookie: () => mt,
2163
+ stringifyCookie: () => J
2164
+ });
2165
+ var Bn = Mn(pt);
2166
+ function J(e) {
2167
+ var t;
2168
+ const r = [
2169
+ "path" in e && e.path && `Path=${e.path}`,
2170
+ "expires" in e && (e.expires || e.expires === 0) && `Expires=${(typeof e.expires == "number" ? new Date(e.expires) : e.expires).toUTCString()}`,
2171
+ "maxAge" in e && typeof e.maxAge == "number" && `Max-Age=${e.maxAge}`,
2172
+ "domain" in e && e.domain && `Domain=${e.domain}`,
2173
+ "secure" in e && e.secure && "Secure",
2174
+ "httpOnly" in e && e.httpOnly && "HttpOnly",
2175
+ "sameSite" in e && e.sameSite && `SameSite=${e.sameSite}`,
2176
+ "partitioned" in e && e.partitioned && "Partitioned",
2177
+ "priority" in e && e.priority && `Priority=${e.priority}`
2178
+ ].filter(Boolean), n = `${e.name}=${encodeURIComponent((t = e.value) != null ? t : "")}`;
2179
+ return r.length === 0 ? n : `${n}; ${r.join("; ")}`;
2180
+ }
2181
+ function ke(e) {
2182
+ const t = /* @__PURE__ */ new Map();
2183
+ for (const r of e.split(/; */)) {
2184
+ if (!r)
2185
+ continue;
2186
+ const n = r.indexOf("=");
2187
+ if (n === -1) {
2188
+ t.set(r, "true");
2189
+ continue;
2190
+ }
2191
+ const [i, a] = [r.slice(0, n), r.slice(n + 1)];
2192
+ try {
2193
+ t.set(i, decodeURIComponent(a ?? "true"));
2194
+ } catch {
2195
+ }
2196
+ }
2197
+ return t;
2198
+ }
2199
+ function mt(e) {
2200
+ if (!e)
2201
+ return;
2202
+ const [[t, r], ...n] = ke(e), {
2203
+ domain: i,
2204
+ expires: a,
2205
+ httponly: s,
2206
+ maxage: o,
2207
+ path: d,
2208
+ samesite: g,
2209
+ secure: l,
2210
+ partitioned: u,
2211
+ priority: w
2212
+ } = Object.fromEntries(
2213
+ n.map(([y, _]) => [y.toLowerCase(), _])
2214
+ ), v = {
2215
+ name: t,
2216
+ value: decodeURIComponent(r),
2217
+ domain: i,
2218
+ ...a && { expires: new Date(a) },
2219
+ ...s && { httpOnly: !0 },
2220
+ ...typeof o == "string" && { maxAge: Number(o) },
2221
+ path: d,
2222
+ ...g && { sameSite: Vn(g) },
2223
+ ...l && { secure: !0 },
2224
+ ...w && { priority: Qn(w) },
2225
+ ...u && { partitioned: !0 }
2226
+ };
2227
+ return zn(v);
2228
+ }
2229
+ function zn(e) {
2230
+ const t = {};
2231
+ for (const r in e)
2232
+ e[r] && (t[r] = e[r]);
2233
+ return t;
2234
+ }
2235
+ var Gn = ["strict", "lax", "none"];
2236
+ function Vn(e) {
2237
+ return e = e.toLowerCase(), Gn.includes(e) ? e : void 0;
2238
+ }
2239
+ var Wn = ["low", "medium", "high"];
2240
+ function Qn(e) {
2241
+ return e = e.toLowerCase(), Wn.includes(e) ? e : void 0;
1738
2242
  }
1739
- const lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2243
+ function Xn(e) {
2244
+ if (!e)
2245
+ return [];
2246
+ var t = [], r = 0, n, i, a, s, o;
2247
+ function d() {
2248
+ for (; r < e.length && /\s/.test(e.charAt(r)); )
2249
+ r += 1;
2250
+ return r < e.length;
2251
+ }
2252
+ function g() {
2253
+ return i = e.charAt(r), i !== "=" && i !== ";" && i !== ",";
2254
+ }
2255
+ for (; r < e.length; ) {
2256
+ for (n = r, o = !1; d(); )
2257
+ if (i = e.charAt(r), i === ",") {
2258
+ for (a = r, r += 1, d(), s = r; r < e.length && g(); )
2259
+ r += 1;
2260
+ r < e.length && e.charAt(r) === "=" ? (o = !0, r = s, t.push(e.substring(n, a)), n = r) : r = a + 1;
2261
+ } else
2262
+ r += 1;
2263
+ (!o || r >= e.length) && t.push(e.substring(n, e.length));
2264
+ }
2265
+ return t;
2266
+ }
2267
+ var Kn = class {
2268
+ constructor(e) {
2269
+ this._parsed = /* @__PURE__ */ new Map(), this._headers = e;
2270
+ const t = e.get("cookie");
2271
+ if (t) {
2272
+ const r = ke(t);
2273
+ for (const [n, i] of r)
2274
+ this._parsed.set(n, { name: n, value: i });
2275
+ }
2276
+ }
2277
+ [Symbol.iterator]() {
2278
+ return this._parsed[Symbol.iterator]();
2279
+ }
2280
+ /**
2281
+ * The amount of cookies received from the client
2282
+ */
2283
+ get size() {
2284
+ return this._parsed.size;
2285
+ }
2286
+ get(...e) {
2287
+ const t = typeof e[0] == "string" ? e[0] : e[0].name;
2288
+ return this._parsed.get(t);
2289
+ }
2290
+ getAll(...e) {
2291
+ var t;
2292
+ const r = Array.from(this._parsed);
2293
+ if (!e.length)
2294
+ return r.map(([i, a]) => a);
2295
+ const n = typeof e[0] == "string" ? e[0] : (t = e[0]) == null ? void 0 : t.name;
2296
+ return r.filter(([i]) => i === n).map(([i, a]) => a);
2297
+ }
2298
+ has(e) {
2299
+ return this._parsed.has(e);
2300
+ }
2301
+ set(...e) {
2302
+ const [t, r] = e.length === 1 ? [e[0].name, e[0].value] : e, n = this._parsed;
2303
+ return n.set(t, { name: t, value: r }), this._headers.set(
2304
+ "cookie",
2305
+ Array.from(n).map(([i, a]) => J(a)).join("; ")
2306
+ ), this;
2307
+ }
2308
+ /**
2309
+ * Delete the cookies matching the passed name or names in the request.
2310
+ */
2311
+ delete(e) {
2312
+ const t = this._parsed, r = Array.isArray(e) ? e.map((n) => t.delete(n)) : t.delete(e);
2313
+ return this._headers.set(
2314
+ "cookie",
2315
+ Array.from(t).map(([n, i]) => J(i)).join("; ")
2316
+ ), r;
2317
+ }
2318
+ /**
2319
+ * Delete all the cookies in the cookies in the request.
2320
+ */
2321
+ clear() {
2322
+ return this.delete(Array.from(this._parsed.keys())), this;
2323
+ }
2324
+ /**
2325
+ * Format the cookies in the request as a string for logging
2326
+ */
2327
+ [Symbol.for("edge-runtime.inspect.custom")]() {
2328
+ return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
2329
+ }
2330
+ toString() {
2331
+ return [...this._parsed.values()].map((e) => `${e.name}=${encodeURIComponent(e.value)}`).join("; ");
2332
+ }
2333
+ }, Jn = class {
2334
+ constructor(e) {
2335
+ this._parsed = /* @__PURE__ */ new Map();
2336
+ var t, r, n;
2337
+ this._headers = e;
2338
+ const i = (n = (r = (t = e.getSetCookie) == null ? void 0 : t.call(e)) != null ? r : e.get("set-cookie")) != null ? n : [], a = Array.isArray(i) ? i : Xn(i);
2339
+ for (const s of a) {
2340
+ const o = mt(s);
2341
+ o && this._parsed.set(o.name, o);
2342
+ }
2343
+ }
2344
+ /**
2345
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
2346
+ */
2347
+ get(...e) {
2348
+ const t = typeof e[0] == "string" ? e[0] : e[0].name;
2349
+ return this._parsed.get(t);
2350
+ }
2351
+ /**
2352
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
2353
+ */
2354
+ getAll(...e) {
2355
+ var t;
2356
+ const r = Array.from(this._parsed.values());
2357
+ if (!e.length)
2358
+ return r;
2359
+ const n = typeof e[0] == "string" ? e[0] : (t = e[0]) == null ? void 0 : t.name;
2360
+ return r.filter((i) => i.name === n);
2361
+ }
2362
+ has(e) {
2363
+ return this._parsed.has(e);
2364
+ }
2365
+ /**
2366
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
2367
+ */
2368
+ set(...e) {
2369
+ const [t, r, n] = e.length === 1 ? [e[0].name, e[0].value, e[0]] : e, i = this._parsed;
2370
+ return i.set(t, Yn({ name: t, value: r, ...n })), Zn(i, this._headers), this;
2371
+ }
2372
+ /**
2373
+ * {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
2374
+ */
2375
+ delete(...e) {
2376
+ const [t, r, n] = typeof e[0] == "string" ? [e[0]] : [e[0].name, e[0].path, e[0].domain];
2377
+ return this.set({ name: t, path: r, domain: n, value: "", expires: /* @__PURE__ */ new Date(0) });
2378
+ }
2379
+ [Symbol.for("edge-runtime.inspect.custom")]() {
2380
+ return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
2381
+ }
2382
+ toString() {
2383
+ return [...this._parsed.values()].map(J).join("; ");
2384
+ }
2385
+ };
2386
+ function Zn(e, t) {
2387
+ t.delete("set-cookie");
2388
+ for (const [, r] of e) {
2389
+ const n = J(r);
2390
+ t.append("set-cookie", n);
2391
+ }
2392
+ }
2393
+ function Yn(e = { name: "", value: "" }) {
2394
+ return typeof e.expires == "number" && (e.expires = new Date(e.expires)), e.maxAge && (e.expires = new Date(Date.now() + e.maxAge * 1e3)), (e.path === null || e.path === void 0) && (e.path = "/"), e;
2395
+ }
2396
+ (function(e) {
2397
+ Object.defineProperty(e, "__esModule", {
2398
+ value: !0
2399
+ });
2400
+ function t(n, i) {
2401
+ for (var a in i) Object.defineProperty(n, a, {
2402
+ enumerable: !0,
2403
+ get: i[a]
2404
+ });
2405
+ }
2406
+ t(e, {
2407
+ RequestCookies: function() {
2408
+ return r.RequestCookies;
2409
+ },
2410
+ ResponseCookies: function() {
2411
+ return r.ResponseCookies;
2412
+ },
2413
+ stringifyCookie: function() {
2414
+ return r.stringifyCookie;
2415
+ }
2416
+ });
2417
+ const r = Bn;
2418
+ })(pe);
2419
+ (function(e) {
2420
+ Object.defineProperty(e, "__esModule", {
2421
+ value: !0
2422
+ });
2423
+ function t(d, g) {
2424
+ for (var l in g) Object.defineProperty(d, l, {
2425
+ enumerable: !0,
2426
+ get: g[l]
2427
+ });
2428
+ }
2429
+ t(e, {
2430
+ INTERNALS: function() {
2431
+ return s;
2432
+ },
2433
+ NextRequest: function() {
2434
+ return o;
2435
+ }
2436
+ });
2437
+ const r = Se, n = Ce, i = dt, a = pe, s = Symbol("internal request");
2438
+ class o extends Request {
2439
+ constructor(g, l = {}) {
2440
+ const u = typeof g != "string" && "url" in g ? g.url : String(g);
2441
+ (0, n.validateURL)(u), g instanceof Request ? super(g, l) : super(u, l);
2442
+ const w = new r.NextURL(u, {
2443
+ headers: (0, n.toNodeOutgoingHttpHeaders)(this.headers),
2444
+ nextConfig: l.nextConfig
2445
+ });
2446
+ this[s] = {
2447
+ cookies: new a.RequestCookies(this.headers),
2448
+ geo: l.geo || {},
2449
+ ip: l.ip,
2450
+ nextUrl: w,
2451
+ url: process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE ? u : w.toString()
2452
+ };
2453
+ }
2454
+ [Symbol.for("edge-runtime.inspect.custom")]() {
2455
+ return {
2456
+ cookies: this.cookies,
2457
+ geo: this.geo,
2458
+ ip: this.ip,
2459
+ nextUrl: this.nextUrl,
2460
+ url: this.url,
2461
+ // rest of props come from Request
2462
+ bodyUsed: this.bodyUsed,
2463
+ cache: this.cache,
2464
+ credentials: this.credentials,
2465
+ destination: this.destination,
2466
+ headers: Object.fromEntries(this.headers),
2467
+ integrity: this.integrity,
2468
+ keepalive: this.keepalive,
2469
+ method: this.method,
2470
+ mode: this.mode,
2471
+ redirect: this.redirect,
2472
+ referrer: this.referrer,
2473
+ referrerPolicy: this.referrerPolicy,
2474
+ signal: this.signal
2475
+ };
2476
+ }
2477
+ get cookies() {
2478
+ return this[s].cookies;
2479
+ }
2480
+ get geo() {
2481
+ return this[s].geo;
2482
+ }
2483
+ get ip() {
2484
+ return this[s].ip;
2485
+ }
2486
+ get nextUrl() {
2487
+ return this[s].nextUrl;
2488
+ }
2489
+ /**
2490
+ * @deprecated
2491
+ * `page` has been deprecated in favour of `URLPattern`.
2492
+ * Read more: https://nextjs.org/docs/messages/middleware-request-page
2493
+ */
2494
+ get page() {
2495
+ throw new i.RemovedPageError();
2496
+ }
2497
+ /**
2498
+ * @deprecated
2499
+ * `ua` has been removed in favour of \`userAgent\` function.
2500
+ * Read more: https://nextjs.org/docs/messages/middleware-parse-user-agent
2501
+ */
2502
+ get ua() {
2503
+ throw new i.RemovedUAError();
2504
+ }
2505
+ get url() {
2506
+ return this[s].url;
2507
+ }
2508
+ }
2509
+ })(ot);
2510
+ var ht = {}, ft = {};
2511
+ (function(e) {
2512
+ Object.defineProperty(e, "__esModule", {
2513
+ value: !0
2514
+ }), Object.defineProperty(e, "ReflectAdapter", {
2515
+ enumerable: !0,
2516
+ get: function() {
2517
+ return t;
2518
+ }
2519
+ });
2520
+ class t {
2521
+ static get(n, i, a) {
2522
+ const s = Reflect.get(n, i, a);
2523
+ return typeof s == "function" ? s.bind(n) : s;
2524
+ }
2525
+ static set(n, i, a, s) {
2526
+ return Reflect.set(n, i, a, s);
2527
+ }
2528
+ static has(n, i) {
2529
+ return Reflect.has(n, i);
2530
+ }
2531
+ static deleteProperty(n, i) {
2532
+ return Reflect.deleteProperty(n, i);
2533
+ }
2534
+ }
2535
+ })(ft);
2536
+ (function(e) {
2537
+ Object.defineProperty(e, "__esModule", {
2538
+ value: !0
2539
+ }), Object.defineProperty(e, "NextResponse", {
2540
+ enumerable: !0,
2541
+ get: function() {
2542
+ return g;
2543
+ }
2544
+ });
2545
+ const t = pe, r = Se, n = Ce, i = ft, a = pe, s = Symbol("internal response"), o = /* @__PURE__ */ new Set([
2546
+ 301,
2547
+ 302,
2548
+ 303,
2549
+ 307,
2550
+ 308
2551
+ ]);
2552
+ function d(l, u) {
2553
+ var w;
2554
+ if (!(l == null || (w = l.request) == null) && w.headers) {
2555
+ if (!(l.request.headers instanceof Headers))
2556
+ throw new Error("request.headers must be an instance of Headers");
2557
+ const v = [];
2558
+ for (const [y, _] of l.request.headers)
2559
+ u.set("x-middleware-request-" + y, _), v.push(y);
2560
+ u.set("x-middleware-override-headers", v.join(","));
2561
+ }
2562
+ }
2563
+ class g extends Response {
2564
+ constructor(u, w = {}) {
2565
+ super(u, w);
2566
+ const v = this.headers, y = new a.ResponseCookies(v), _ = new Proxy(y, {
2567
+ get(p, b, m) {
2568
+ switch (b) {
2569
+ case "delete":
2570
+ case "set":
2571
+ return (...h) => {
2572
+ const f = Reflect.apply(p[b], p, h), E = new Headers(v);
2573
+ return f instanceof a.ResponseCookies && v.set("x-middleware-set-cookie", f.getAll().map((q) => (0, t.stringifyCookie)(q)).join(",")), d(w, E), f;
2574
+ };
2575
+ default:
2576
+ return i.ReflectAdapter.get(p, b, m);
2577
+ }
2578
+ }
2579
+ });
2580
+ this[s] = {
2581
+ cookies: _,
2582
+ url: w.url ? new r.NextURL(w.url, {
2583
+ headers: (0, n.toNodeOutgoingHttpHeaders)(v),
2584
+ nextConfig: w.nextConfig
2585
+ }) : void 0
2586
+ };
2587
+ }
2588
+ [Symbol.for("edge-runtime.inspect.custom")]() {
2589
+ return {
2590
+ cookies: this.cookies,
2591
+ url: this.url,
2592
+ // rest of props come from Response
2593
+ body: this.body,
2594
+ bodyUsed: this.bodyUsed,
2595
+ headers: Object.fromEntries(this.headers),
2596
+ ok: this.ok,
2597
+ redirected: this.redirected,
2598
+ status: this.status,
2599
+ statusText: this.statusText,
2600
+ type: this.type
2601
+ };
2602
+ }
2603
+ get cookies() {
2604
+ return this[s].cookies;
2605
+ }
2606
+ static json(u, w) {
2607
+ const v = Response.json(u, w);
2608
+ return new g(v.body, v);
2609
+ }
2610
+ static redirect(u, w) {
2611
+ const v = typeof w == "number" ? w : (w == null ? void 0 : w.status) ?? 307;
2612
+ if (!o.has(v))
2613
+ throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
2614
+ const y = typeof w == "object" ? w : {}, _ = new Headers(y == null ? void 0 : y.headers);
2615
+ return _.set("Location", (0, n.validateURL)(u)), new g(null, {
2616
+ ...y,
2617
+ headers: _,
2618
+ status: v
2619
+ });
2620
+ }
2621
+ static rewrite(u, w) {
2622
+ const v = new Headers(w == null ? void 0 : w.headers);
2623
+ return v.set("x-middleware-rewrite", (0, n.validateURL)(u)), d(w, v), new g(null, {
2624
+ ...w,
2625
+ headers: v
2626
+ });
2627
+ }
2628
+ static next(u) {
2629
+ const w = new Headers(u == null ? void 0 : u.headers);
2630
+ return w.set("x-middleware-next", "1"), d(u, w), new g(null, {
2631
+ ...u,
2632
+ headers: w
2633
+ });
2634
+ }
2635
+ }
2636
+ })(ht);
2637
+ var gt = {};
2638
+ (function(e) {
2639
+ Object.defineProperty(e, "__esModule", {
2640
+ value: !0
2641
+ }), Object.defineProperty(e, "ImageResponse", {
2642
+ enumerable: !0,
2643
+ get: function() {
2644
+ return t;
2645
+ }
2646
+ });
2647
+ function t() {
2648
+ throw new Error('ImageResponse moved from "next/server" to "next/og" since Next.js 14, please import from "next/og" instead');
2649
+ }
2650
+ })(gt);
2651
+ var Pe = {}, bt = { exports: {} };
2652
+ (() => {
2653
+ var e = { 226: function(i, a) {
2654
+ (function(s, o) {
2655
+ var d = "1.0.35", g = "", l = "?", u = "function", w = "undefined", v = "object", y = "string", _ = "major", p = "model", b = "name", m = "type", h = "vendor", f = "version", E = "architecture", q = "console", I = "mobile", R = "tablet", x = "smarttv", j = "wearable", F = "embedded", D = 350, U = "Amazon", B = "Apple", Z = "ASUS", Ee = "BlackBerry", G = "Browser", Y = "Chrome", yt = "Edge", ee = "Firefox", te = "Google", Ae = "Huawei", he = "LG", fe = "Microsoft", Te = "Motorola", re = "Opera", ge = "Samsung", Oe = "Sharp", ne = "Sony", be = "Xiaomi", we = "Zebra", qe = "Facebook", Ne = "Chromium OS", je = "Mac OS", _t = function(C, A) {
2656
+ var S = {};
2657
+ for (var O in C)
2658
+ A[O] && A[O].length % 2 === 0 ? S[O] = A[O].concat(C[O]) : S[O] = C[O];
2659
+ return S;
2660
+ }, ie = function(C) {
2661
+ for (var A = {}, S = 0; S < C.length; S++)
2662
+ A[C[S].toUpperCase()] = C[S];
2663
+ return A;
2664
+ }, Fe = function(C, A) {
2665
+ return typeof C === y ? W(A).indexOf(W(C)) !== -1 : !1;
2666
+ }, W = function(C) {
2667
+ return C.toLowerCase();
2668
+ }, Rt = function(C) {
2669
+ return typeof C === y ? C.replace(/[^\d\.]/g, g).split(".")[0] : o;
2670
+ }, ve = function(C, A) {
2671
+ if (typeof C === y)
2672
+ return C = C.replace(/^\s\s*/, g), typeof A === w ? C : C.substring(0, D);
2673
+ }, Q = function(C, A) {
2674
+ for (var S = 0, O, z, H, k, P, M; S < A.length && !P; ) {
2675
+ var _e = A[S], De = A[S + 1];
2676
+ for (O = z = 0; O < _e.length && !P && _e[O]; )
2677
+ if (P = _e[O++].exec(C), P)
2678
+ for (H = 0; H < De.length; H++)
2679
+ M = P[++z], k = De[H], typeof k === v && k.length > 0 ? k.length === 2 ? typeof k[1] == u ? this[k[0]] = k[1].call(this, M) : this[k[0]] = k[1] : k.length === 3 ? typeof k[1] === u && !(k[1].exec && k[1].test) ? this[k[0]] = M ? k[1].call(this, M, k[2]) : o : this[k[0]] = M ? M.replace(k[1], k[2]) : o : k.length === 4 && (this[k[0]] = M ? k[3].call(this, M.replace(k[1], k[2])) : o) : this[k] = M || o;
2680
+ S += 2;
2681
+ }
2682
+ }, ye = function(C, A) {
2683
+ for (var S in A)
2684
+ if (typeof A[S] === v && A[S].length > 0) {
2685
+ for (var O = 0; O < A[S].length; O++)
2686
+ if (Fe(A[S][O], C))
2687
+ return S === l ? o : S;
2688
+ } else if (Fe(A[S], C))
2689
+ return S === l ? o : S;
2690
+ return C;
2691
+ }, It = { "1.0": "/8", 1.2: "/1", 1.3: "/3", "2.0": "/412", "2.0.2": "/416", "2.0.3": "/417", "2.0.4": "/419", "?": "/" }, $e = { ME: "4.90", "NT 3.11": "NT3.51", "NT 4.0": "NT4.0", 2e3: "NT 5.0", XP: ["NT 5.1", "NT 5.2"], Vista: "NT 6.0", 7: "NT 6.1", 8: "NT 6.2", 8.1: "NT 6.3", 10: ["NT 6.4", "NT 10.0"], RT: "ARM" }, Le = { browser: [[/\b(?:crmo|crios)\/([\w\.]+)/i], [f, [b, "Chrome"]], [/edg(?:e|ios|a)?\/([\w\.]+)/i], [f, [b, "Edge"]], [/(opera mini)\/([-\w\.]+)/i, /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i, /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i], [b, f], [/opios[\/ ]+([\w\.]+)/i], [f, [b, re + " Mini"]], [/\bopr\/([\w\.]+)/i], [f, [b, re]], [/(kindle)\/([\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i, /(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i, /(ba?idubrowser)[\/ ]?([\w\.]+)/i, /(?:ms|\()(ie) ([\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i, /(heytap|ovi)browser\/([\d\.]+)/i, /(weibo)__([\d\.]+)/i], [b, f], [/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i], [f, [b, "UC" + G]], [/microm.+\bqbcore\/([\w\.]+)/i, /\bqbcore\/([\w\.]+).+microm/i], [f, [b, "WeChat(Win) Desktop"]], [/micromessenger\/([\w\.]+)/i], [f, [b, "WeChat"]], [/konqueror\/([\w\.]+)/i], [f, [b, "Konqueror"]], [/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i], [f, [b, "IE"]], [/ya(?:search)?browser\/([\w\.]+)/i], [f, [b, "Yandex"]], [/(avast|avg)\/([\w\.]+)/i], [[b, /(.+)/, "$1 Secure " + G], f], [/\bfocus\/([\w\.]+)/i], [f, [b, ee + " Focus"]], [/\bopt\/([\w\.]+)/i], [f, [b, re + " Touch"]], [/coc_coc\w+\/([\w\.]+)/i], [f, [b, "Coc Coc"]], [/dolfin\/([\w\.]+)/i], [f, [b, "Dolphin"]], [/coast\/([\w\.]+)/i], [f, [b, re + " Coast"]], [/miuibrowser\/([\w\.]+)/i], [f, [b, "MIUI " + G]], [/fxios\/([-\w\.]+)/i], [f, [b, ee]], [/\bqihu|(qi?ho?o?|360)browser/i], [[b, "360 " + G]], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i], [[b, /(.+)/, "$1 " + G], f], [/(comodo_dragon)\/([\w\.]+)/i], [[b, /_/g, " "], f], [/(electron)\/([\w\.]+) safari/i, /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, /m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i], [b, f], [/(metasr)[\/ ]?([\w\.]+)/i, /(lbbrowser)/i, /\[(linkedin)app\]/i], [b], [/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i], [[b, qe], f], [/(kakao(?:talk|story))[\/ ]([\w\.]+)/i, /(naver)\(.*?(\d+\.[\w\.]+).*\)/i, /safari (line)\/([\w\.]+)/i, /\b(line)\/([\w\.]+)\/iab/i, /(chromium|instagram)[\/ ]([-\w\.]+)/i], [b, f], [/\bgsa\/([\w\.]+) .*safari\//i], [f, [b, "GSA"]], [/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i], [f, [b, "TikTok"]], [/headlesschrome(?:\/([\w\.]+)| )/i], [f, [b, Y + " Headless"]], [/ wv\).+(chrome)\/([\w\.]+)/i], [[b, Y + " WebView"], f], [/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i], [f, [b, "Android " + G]], [/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i], [b, f], [/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i], [f, [b, "Mobile Safari"]], [/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i], [f, b], [/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i], [b, [f, ye, It]], [/(webkit|khtml)\/([\w\.]+)/i], [b, f], [/(navigator|netscape\d?)\/([-\w\.]+)/i], [[b, "Netscape"], f], [/mobile vr; rv:([\w\.]+)\).+firefox/i], [f, [b, ee + " Reality"]], [/ekiohf.+(flow)\/([\w\.]+)/i, /(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i, /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i, /(firefox)\/([\w\.]+)/i, /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i, /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i, /(links) \(([\w\.]+)/i, /panasonic;(viera)/i], [b, f], [/(cobalt)\/([\w\.]+)/i], [b, [f, /master.|lts./, ""]]], cpu: [[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i], [[E, "amd64"]], [/(ia32(?=;))/i], [[E, W]], [/((?:i[346]|x)86)[;\)]/i], [[E, "ia32"]], [/\b(aarch64|arm(v?8e?l?|_?64))\b/i], [[E, "arm64"]], [/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i], [[E, "armhf"]], [/windows (ce|mobile); ppc;/i], [[E, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i], [[E, /ower/, g, W]], [/(sun4\w)[;\)]/i], [[E, "sparc"]], [/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i], [[E, W]]], device: [[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i], [p, [h, ge], [m, R]], [/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i, /samsung[- ]([-\w]+)/i, /sec-(sgh\w+)/i], [p, [h, ge], [m, I]], [/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i], [p, [h, B], [m, I]], [/\((ipad);[-\w\),; ]+apple/i, /applecoremedia\/[\w\.]+ \((ipad)/i, /\b(ipad)\d\d?,\d\d?[;\]].+ios/i], [p, [h, B], [m, R]], [/(macintosh);/i], [p, [h, B]], [/\b(sh-?[altvz]?\d\d[a-ekm]?)/i], [p, [h, Oe], [m, I]], [/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i], [p, [h, Ae], [m, R]], [/(?:huawei|honor)([-\w ]+)[;\)]/i, /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i], [p, [h, Ae], [m, I]], [/\b(poco[\w ]+)(?: bui|\))/i, /\b; (\w+) build\/hm\1/i, /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i, /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i, /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i], [[p, /_/g, " "], [h, be], [m, I]], [/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i], [[p, /_/g, " "], [h, be], [m, R]], [/; (\w+) bui.+ oppo/i, /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i], [p, [h, "OPPO"], [m, I]], [/vivo (\w+)(?: bui|\))/i, /\b(v[12]\d{3}\w?[at])(?: bui|;)/i], [p, [h, "Vivo"], [m, I]], [/\b(rmx[12]\d{3})(?: bui|;|\))/i], [p, [h, "Realme"], [m, I]], [/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i, /\bmot(?:orola)?[- ](\w*)/i, /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i], [p, [h, Te], [m, I]], [/\b(mz60\d|xoom[2 ]{0,2}) build\//i], [p, [h, Te], [m, R]], [/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i], [p, [h, he], [m, R]], [/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i, /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i, /\blg-?([\d\w]+) bui/i], [p, [h, he], [m, I]], [/(ideatab[-\w ]+)/i, /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i], [p, [h, "Lenovo"], [m, R]], [/(?:maemo|nokia).*(n900|lumia \d+)/i, /nokia[-_ ]?([-\w\.]*)/i], [[p, /_/g, " "], [h, "Nokia"], [m, I]], [/(pixel c)\b/i], [p, [h, te], [m, R]], [/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i], [p, [h, te], [m, I]], [/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i], [p, [h, ne], [m, I]], [/sony tablet [ps]/i, /\b(?:sony)?sgp\w+(?: bui|\))/i], [[p, "Xperia Tablet"], [h, ne], [m, R]], [/ (kb2005|in20[12]5|be20[12][59])\b/i, /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i], [p, [h, "OnePlus"], [m, I]], [/(alexa)webm/i, /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, /(kf[a-z]+)( bui|\)).+silk\//i], [p, [h, U], [m, R]], [/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i], [[p, /(.+)/g, "Fire Phone $1"], [h, U], [m, I]], [/(playbook);[-\w\),; ]+(rim)/i], [p, h, [m, R]], [/\b((?:bb[a-f]|st[hv])100-\d)/i, /\(bb10; (\w+)/i], [p, [h, Ee], [m, I]], [/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i], [p, [h, Z], [m, R]], [/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i], [p, [h, Z], [m, I]], [/(nexus 9)/i], [p, [h, "HTC"], [m, R]], [/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i, /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i, /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i], [h, [p, /_/g, " "], [m, I]], [/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i], [p, [h, "Acer"], [m, R]], [/droid.+; (m[1-5] note) bui/i, /\bmz-([-\w]{2,})/i], [p, [h, "Meizu"], [m, I]], [/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(hp) ([\w ]+\w)/i, /(asus)-?(\w+)/i, /(microsoft); (lumia[\w ]+)/i, /(lenovo)[-_ ]?([-\w]+)/i, /(jolla)/i, /(oppo) ?([\w ]+) bui/i], [h, p, [m, I]], [/(kobo)\s(ereader|touch)/i, /(archos) (gamepad2?)/i, /(hp).+(touchpad(?!.+tablet)|tablet)/i, /(kindle)\/([\w\.]+)/i, /(nook)[\w ]+build\/(\w+)/i, /(dell) (strea[kpr\d ]*[\dko])/i, /(le[- ]+pan)[- ]+(\w{1,9}) bui/i, /(trinity)[- ]*(t\d{3}) bui/i, /(gigaset)[- ]+(q\w{1,9}) bui/i, /(vodafone) ([\w ]+)(?:\)| bui)/i], [h, p, [m, R]], [/(surface duo)/i], [p, [h, fe], [m, R]], [/droid [\d\.]+; (fp\du?)(?: b|\))/i], [p, [h, "Fairphone"], [m, I]], [/(u304aa)/i], [p, [h, "AT&T"], [m, I]], [/\bsie-(\w*)/i], [p, [h, "Siemens"], [m, I]], [/\b(rct\w+) b/i], [p, [h, "RCA"], [m, R]], [/\b(venue[\d ]{2,7}) b/i], [p, [h, "Dell"], [m, R]], [/\b(q(?:mv|ta)\w+) b/i], [p, [h, "Verizon"], [m, R]], [/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i], [p, [h, "Barnes & Noble"], [m, R]], [/\b(tm\d{3}\w+) b/i], [p, [h, "NuVision"], [m, R]], [/\b(k88) b/i], [p, [h, "ZTE"], [m, R]], [/\b(nx\d{3}j) b/i], [p, [h, "ZTE"], [m, I]], [/\b(gen\d{3}) b.+49h/i], [p, [h, "Swiss"], [m, I]], [/\b(zur\d{3}) b/i], [p, [h, "Swiss"], [m, R]], [/\b((zeki)?tb.*\b) b/i], [p, [h, "Zeki"], [m, R]], [/\b([yr]\d{2}) b/i, /\b(dragon[- ]+touch |dt)(\w{5}) b/i], [[h, "Dragon Touch"], p, [m, R]], [/\b(ns-?\w{0,9}) b/i], [p, [h, "Insignia"], [m, R]], [/\b((nxa|next)-?\w{0,9}) b/i], [p, [h, "NextBook"], [m, R]], [/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i], [[h, "Voice"], p, [m, I]], [/\b(lvtel\-)?(v1[12]) b/i], [[h, "LvTel"], p, [m, I]], [/\b(ph-1) /i], [p, [h, "Essential"], [m, I]], [/\b(v(100md|700na|7011|917g).*\b) b/i], [p, [h, "Envizen"], [m, R]], [/\b(trio[-\w\. ]+) b/i], [p, [h, "MachSpeed"], [m, R]], [/\btu_(1491) b/i], [p, [h, "Rotor"], [m, R]], [/(shield[\w ]+) b/i], [p, [h, "Nvidia"], [m, R]], [/(sprint) (\w+)/i], [h, p, [m, I]], [/(kin\.[onetw]{3})/i], [[p, /\./g, " "], [h, fe], [m, I]], [/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i], [p, [h, we], [m, R]], [/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i], [p, [h, we], [m, I]], [/smart-tv.+(samsung)/i], [h, [m, x]], [/hbbtv.+maple;(\d+)/i], [[p, /^/, "SmartTV"], [h, ge], [m, x]], [/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i], [[h, he], [m, x]], [/(apple) ?tv/i], [h, [p, B + " TV"], [m, x]], [/crkey/i], [[p, Y + "cast"], [h, te], [m, x]], [/droid.+aft(\w)( bui|\))/i], [p, [h, U], [m, x]], [/\(dtv[\);].+(aquos)/i, /(aquos-tv[\w ]+)\)/i], [p, [h, Oe], [m, x]], [/(bravia[\w ]+)( bui|\))/i], [p, [h, ne], [m, x]], [/(mitv-\w{5}) bui/i], [p, [h, be], [m, x]], [/Hbbtv.*(technisat) (.*);/i], [h, p, [m, x]], [/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i], [[h, ve], [p, ve], [m, x]], [/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i], [[m, x]], [/(ouya)/i, /(nintendo) ([wids3utch]+)/i], [h, p, [m, q]], [/droid.+; (shield) bui/i], [p, [h, "Nvidia"], [m, q]], [/(playstation [345portablevi]+)/i], [p, [h, ne], [m, q]], [/\b(xbox(?: one)?(?!; xbox))[\); ]/i], [p, [h, fe], [m, q]], [/((pebble))app/i], [h, p, [m, j]], [/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i], [p, [h, B], [m, j]], [/droid.+; (glass) \d/i], [p, [h, te], [m, j]], [/droid.+; (wt63?0{2,3})\)/i], [p, [h, we], [m, j]], [/(quest( 2| pro)?)/i], [p, [h, qe], [m, j]], [/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i], [h, [m, F]], [/(aeobc)\b/i], [p, [h, U], [m, F]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i], [p, [m, I]], [/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i], [p, [m, R]], [/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i], [[m, R]], [/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i], [[m, I]], [/(android[-\w\. ]{0,9});.+buil/i], [p, [h, "Generic"]]], engine: [[/windows.+ edge\/([\w\.]+)/i], [f, [b, yt + "HTML"]], [/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i], [f, [b, "Blink"]], [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, /ekioh(flow)\/([\w\.]+)/i, /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, /(icab)[\/ ]([23]\.[\d\.]+)/i, /\b(libweb)/i], [b, f], [/rv\:([\w\.]{1,9})\b.+(gecko)/i], [f, b]], os: [[/microsoft (windows) (vista|xp)/i], [b, f], [/(windows) nt 6\.2; (arm)/i, /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i, /(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i], [b, [f, ye, $e]], [/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i], [[b, "Windows"], [f, ye, $e]], [/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, /ios;fbsv\/([\d\.]+)/i, /cfnetwork\/.+darwin/i], [[f, /_/g, "."], [b, "iOS"]], [/(mac os x) ?([\w\. ]*)/i, /(macintosh|mac_powerpc\b)(?!.+haiku)/i], [[b, je], [f, /_/g, "."]], [/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i], [f, b], [/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i, /(blackberry)\w*\/([\w\.]*)/i, /(tizen|kaios)[\/ ]([\w\.]+)/i, /\((series40);/i], [b, f], [/\(bb(10);/i], [f, [b, Ee]], [/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i], [f, [b, "Symbian"]], [/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i], [f, [b, ee + " OS"]], [/web0s;.+rt(tv)/i, /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i], [f, [b, "webOS"]], [/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i], [f, [b, "watchOS"]], [/crkey\/([\d\.]+)/i], [f, [b, Y + "cast"]], [/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i], [[b, Ne], f], [/panasonic;(viera)/i, /(netrange)mmh/i, /(nettv)\/(\d+\.[\w\.]+)/i, /(nintendo|playstation) ([wids345portablevuch]+)/i, /(xbox); +xbox ([^\);]+)/i, /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i, /(mint)[\/\(\) ]?(\w*)/i, /(mageia|vectorlinux)[; ]/i, /([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i, /(hurd|linux) ?([\w\.]*)/i, /(gnu) ?([\w\.]*)/i, /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i, /(haiku) (\w+)/i], [b, f], [/(sunos) ?([\w\.\d]*)/i], [[b, "Solaris"], f], [/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, /(aix) ((\d)(?=\.|\)| )[\w\.])*/i, /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, /(unix) ?([\w\.]*)/i], [b, f]] }, L = function(C, A) {
2692
+ if (typeof C === v && (A = C, C = o), !(this instanceof L))
2693
+ return new L(C, A).getResult();
2694
+ var S = typeof s !== w && s.navigator ? s.navigator : o, O = C || (S && S.userAgent ? S.userAgent : g), z = S && S.userAgentData ? S.userAgentData : o, H = A ? _t(Le, A) : Le, k = S && S.userAgent == O;
2695
+ return this.getBrowser = function() {
2696
+ var P = {};
2697
+ return P[b] = o, P[f] = o, Q.call(P, O, H.browser), P[_] = Rt(P[f]), k && S && S.brave && typeof S.brave.isBrave == u && (P[b] = "Brave"), P;
2698
+ }, this.getCPU = function() {
2699
+ var P = {};
2700
+ return P[E] = o, Q.call(P, O, H.cpu), P;
2701
+ }, this.getDevice = function() {
2702
+ var P = {};
2703
+ return P[h] = o, P[p] = o, P[m] = o, Q.call(P, O, H.device), k && !P[m] && z && z.mobile && (P[m] = I), k && P[p] == "Macintosh" && S && typeof S.standalone !== w && S.maxTouchPoints && S.maxTouchPoints > 2 && (P[p] = "iPad", P[m] = R), P;
2704
+ }, this.getEngine = function() {
2705
+ var P = {};
2706
+ return P[b] = o, P[f] = o, Q.call(P, O, H.engine), P;
2707
+ }, this.getOS = function() {
2708
+ var P = {};
2709
+ return P[b] = o, P[f] = o, Q.call(P, O, H.os), k && !P[b] && z && z.platform != "Unknown" && (P[b] = z.platform.replace(/chrome os/i, Ne).replace(/macos/i, je)), P;
2710
+ }, this.getResult = function() {
2711
+ return { ua: this.getUA(), browser: this.getBrowser(), engine: this.getEngine(), os: this.getOS(), device: this.getDevice(), cpu: this.getCPU() };
2712
+ }, this.getUA = function() {
2713
+ return O;
2714
+ }, this.setUA = function(P) {
2715
+ return O = typeof P === y && P.length > D ? ve(P, D) : P, this;
2716
+ }, this.setUA(O), this;
2717
+ };
2718
+ L.VERSION = d, L.BROWSER = ie([b, f, _]), L.CPU = ie([E]), L.DEVICE = ie([p, h, m, q, I, x, R, j, F]), L.ENGINE = L.OS = ie([b, f]), typeof a !== w ? (i.exports && (a = i.exports = L), a.UAParser = L) : typeof s !== w && (s.UAParser = L);
2719
+ var V = typeof s !== w && (s.jQuery || s.Zepto);
2720
+ if (V && !V.ua) {
2721
+ var oe = new L();
2722
+ V.ua = oe.getResult(), V.ua.get = function() {
2723
+ return oe.getUA();
2724
+ }, V.ua.set = function(C) {
2725
+ oe.setUA(C);
2726
+ var A = oe.getResult();
2727
+ for (var S in A)
2728
+ V.ua[S] = A[S];
2729
+ };
2730
+ }
2731
+ })(typeof window == "object" ? window : this);
2732
+ } }, t = {};
2733
+ function r(i) {
2734
+ var a = t[i];
2735
+ if (a !== void 0)
2736
+ return a.exports;
2737
+ var s = t[i] = { exports: {} }, o = !0;
2738
+ try {
2739
+ e[i].call(s.exports, s, s.exports, r), o = !1;
2740
+ } finally {
2741
+ o && delete t[i];
2742
+ }
2743
+ return s.exports;
2744
+ }
2745
+ typeof r < "u" && (r.ab = __dirname + "/");
2746
+ var n = r(226);
2747
+ bt.exports = n;
2748
+ })();
2749
+ var ei = bt.exports;
2750
+ (function(e) {
2751
+ Object.defineProperty(e, "__esModule", {
2752
+ value: !0
2753
+ });
2754
+ function t(o, d) {
2755
+ for (var g in d) Object.defineProperty(o, g, {
2756
+ enumerable: !0,
2757
+ get: d[g]
2758
+ });
2759
+ }
2760
+ t(e, {
2761
+ isBot: function() {
2762
+ return i;
2763
+ },
2764
+ userAgent: function() {
2765
+ return s;
2766
+ },
2767
+ userAgentFromString: function() {
2768
+ return a;
2769
+ }
2770
+ });
2771
+ const r = /* @__PURE__ */ n(ei);
2772
+ function n(o) {
2773
+ return o && o.__esModule ? o : {
2774
+ default: o
2775
+ };
2776
+ }
2777
+ function i(o) {
2778
+ return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(o);
2779
+ }
2780
+ function a(o) {
2781
+ return {
2782
+ ...(0, r.default)(o),
2783
+ isBot: o === void 0 ? !1 : i(o)
2784
+ };
2785
+ }
2786
+ function s({ headers: o }) {
2787
+ return a(o.get("user-agent") || void 0);
2788
+ }
2789
+ })(Pe);
2790
+ var wt = {};
2791
+ (function(e) {
2792
+ Object.defineProperty(e, "__esModule", {
2793
+ value: !0
2794
+ }), Object.defineProperty(e, "URLPattern", {
2795
+ enumerable: !0,
2796
+ get: function() {
2797
+ return t;
2798
+ }
2799
+ });
2800
+ const t = (
2801
+ // @ts-expect-error: URLPattern is not available in Node.js
2802
+ typeof URLPattern > "u" ? void 0 : URLPattern
2803
+ );
2804
+ })(wt);
2805
+ (function(e, t) {
2806
+ const r = {
2807
+ NextRequest: ot.NextRequest,
2808
+ NextResponse: ht.NextResponse,
2809
+ ImageResponse: gt.ImageResponse,
2810
+ userAgentFromString: Pe.userAgentFromString,
2811
+ userAgent: Pe.userAgent,
2812
+ URLPattern: wt.URLPattern
2813
+ };
2814
+ e.exports = r, t.NextRequest = r.NextRequest, t.NextResponse = r.NextResponse, t.ImageResponse = r.ImageResponse, t.userAgentFromString = r.userAgentFromString, t.userAgent = r.userAgent, t.URLPattern = r.URLPattern;
2815
+ })(Ie, Ie.exports);
2816
+ var Me = Ie.exports;
2817
+ async function ti({ apiUrl: e, extraData: t, fetchOptions: r }) {
2818
+ var I, R;
2819
+ const n = `${e}/api/dataentities`, i = `${e}/api/io/v1/extrato/get-total`, {
2820
+ MASTER_DATA_ENTITY: a,
2821
+ MASTER_DATA_FIELDS: s,
2822
+ AUTH_TOKEN_COOKIE: o,
2823
+ requestHeaders: d,
2824
+ cookies: g
2825
+ } = t, { address: l, client: u } = a, { address: w, client: v } = s, y = ((I = g == null ? void 0 : g.find((x) => (x == null ? void 0 : x.name) === o)) == null ? void 0 : I.value) || "";
2826
+ if (!y)
2827
+ return Me.NextResponse.json(
2828
+ { error: "Token not found. Unauthorized" },
2829
+ { status: 200 }
2830
+ );
2831
+ const { sub: _, userId: p } = zt(y), b = Object.fromEntries(
2832
+ Object.entries(d).map(([x, j]) => [x, String(j || "")])
2833
+ ), m = async (x, j, F = !1) => {
2834
+ try {
2835
+ const U = await fetch(`${F ? i : n}${x}`, {
2836
+ headers: {
2837
+ ...j,
2838
+ ...r == null ? void 0 : r.headers
2839
+ }
2840
+ }).then((Z) => Z.json()), B = Array.isArray(U) ? U[0] : U;
2841
+ return Array.isArray(B) ? B[0] : B;
2842
+ } catch (D) {
2843
+ return console.error(`Erro no fetch: ${x}`, D), null;
2844
+ }
2845
+ }, h = await m(
2846
+ `/${u}/search?email=${_}&_fields=${v.join(",")}`,
2847
+ b
2848
+ );
2849
+ if (!(h != null && h.id))
2850
+ return Me.NextResponse.json({ sub: _ }, { status: 200 });
2851
+ const f = (R = h.document) == null ? void 0 : R.replace(/\D/g, ""), E = await m(
2852
+ `/${l}/search?userId=${h.id}&_fields=${w.join(
2853
+ ","
2854
+ )}&_sort=lastInteractionIn DESC`,
2855
+ { ...b, "REST-Range": "resources=0-1000" }
2856
+ ), q = f ? await m(
2857
+ `/${f}?user_code=${h.userId},${_}&per_page=1&page=1`,
2858
+ b,
2859
+ !0
2860
+ ) : null;
2861
+ return { ...h, ...E, userCredits: q, sub: _, userId: p };
2862
+ }
2863
+ const ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1740
2864
  __proto__: null,
1741
- getWishlistProducts: cr
1742
- }, Symbol.toStringTag, { value: "Module" })), ur = {
1743
- parseSearchState: me,
1744
- convertSearchParams: de,
1745
- filterNonRootFacets: ue,
1746
- filterNonCategorySelected: le
1747
- }, hr = {
1748
- checkout: St,
1749
- catalog: Pt,
1750
- cms: pe,
1751
- search: Zt,
1752
- masterdata: ir,
2865
+ getUserData: ti
2866
+ }, Symbol.toStringTag, { value: "Module" })), ni = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), Be = (e, t = " ") => !e || typeof e == "string" && e.length === 0 ? e : (Array.isArray(e) ? e : e.split("-")).map(ni).join(t), ii = ({ canonical: e, seo: t, slug: r }) => {
2867
+ const n = Array.isArray(r) ? r.join(", ") : r;
2868
+ return {
2869
+ id: 0,
2870
+ Title: `${Array.isArray(r) ? r.map((a) => Be(a)).join(",") : Be(r)} - ${t.title}`,
2871
+ MetaTagDescription: t.description,
2872
+ name: n,
2873
+ hasChildren: !1,
2874
+ url: e,
2875
+ children: []
2876
+ };
2877
+ }, oi = ({ canonical: e, category: t, previousImages: r, seo: n }) => ({
2878
+ category: String(t == null ? void 0 : t.id),
2879
+ title: (t == null ? void 0 : t.Title) ?? n.title,
2880
+ description: (t == null ? void 0 : t.MetaTagDescription) ?? n.description,
2881
+ alternates: { canonical: e },
2882
+ openGraph: {
2883
+ type: "website",
2884
+ title: (t == null ? void 0 : t.Title) ?? n.title,
2885
+ description: (t == null ? void 0 : t.MetaTagDescription) ?? n.description,
2886
+ images: Array.isArray(r) ? [...r] : []
2887
+ }
2888
+ }), ai = ({ items: e, parent: t, apiUrl: r, find: n }) => {
2889
+ const i = e.find(
2890
+ (s) => s.url.replace(r, "") === decodeURIComponent(t.toLowerCase())
2891
+ );
2892
+ return (i == null ? void 0 : i.children.find(
2893
+ (s) => s.name.toLowerCase() === decodeURIComponent(String(n))
2894
+ )) ?? i;
2895
+ }, si = (e) => {
2896
+ e instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${e.message}`), console.error(e.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", e);
2897
+ }, li = /* @__PURE__ */ new Set([
2898
+ "brand",
2899
+ "category",
2900
+ "department",
2901
+ "subcategory",
2902
+ "collection",
2903
+ "cluster"
2904
+ ]), ci = (e) => typeof (e == null ? void 0 : e.pageType) == "string" && li.has(e == null ? void 0 : e.pageType.toLowerCase()), ui = (e) => ({
2905
+ collection: e.Coleção,
2906
+ categoryId: e.categoryId,
2907
+ current_collection: e["Coleção Atual"],
2908
+ items: e.items
2909
+ }), vt = (e, t) => e.reduce((r, n) => {
2910
+ if (n.items.filter(
2911
+ (s) => s.sellers.find((o) => o.commertialOffer.IsAvailable)
2912
+ ).length === 0 || (r == null ? void 0 : r.find((s) => (s == null ? void 0 : s.productId) === (n == null ? void 0 : n.productId))) !== void 0)
2913
+ return r;
2914
+ const a = n.items[0].images.find(
2915
+ (s) => t.includes(s.imageLabel)
2916
+ );
2917
+ return r.push({
2918
+ slug: `/${n.linkText}/p`,
2919
+ productId: n == null ? void 0 : n.productId,
2920
+ textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
2921
+ textureAlt: (a == null ? void 0 : a.imageText) ?? ""
2922
+ }), r;
2923
+ }, []), di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2924
+ __proto__: null,
2925
+ createEmptySeoCategory: ii,
2926
+ createSeoCategory: oi,
2927
+ findCategory: ai,
2928
+ formattedSimilars: vt,
2929
+ isCollectionPageType: ci,
2930
+ notFindCategoryError: si,
2931
+ responseAdapter: ui
2932
+ }, Symbol.toStringTag, { value: "Module" })), pi = {
2933
+ parseSearchState: Lt,
2934
+ convertSearchParams: $t,
2935
+ filterNonRootFacets: Ft,
2936
+ filterNonCategorySelected: jt
2937
+ }, mi = async ({ children: e, apiUrl: t, productId: r, ClientItems: n, PDP_INFO: i, TEXTURE_IMAGE: a, TOGGLE_STYLE_MODIFIER: s }) => {
2938
+ const o = await fetch(
2939
+ `${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`
2940
+ ).then((g) => g.json()), d = vt(o, a);
2941
+ return /* @__PURE__ */ K("div", { className: Re.similars, children: [
2942
+ /* @__PURE__ */ K("div", { className: Re["similars-info"], children: [
2943
+ /* @__PURE__ */ N("span", { className: Re["sections-title"], children: i.product.color_title }),
2944
+ e
2945
+ ] }),
2946
+ /* @__PURE__ */ N(n, { productId: r, similars: d, TOGGLE_STYLE_MODIFIER: s })
2947
+ ] });
2948
+ }, yi = {
2949
+ checkout: Xr,
2950
+ catalog: rn,
2951
+ cms: Dt,
2952
+ search: Cn,
2953
+ masterdata: Nn,
2954
+ user: ri,
1753
2955
  wishlist: {
1754
- ...lr
2956
+ ...Fn
1755
2957
  }
1756
- }, yr = {
1757
- catalog: ye,
1758
- search: ur,
1759
- product: he,
2958
+ }, _i = {
2959
+ catalog: di,
2960
+ search: pi,
2961
+ product: Mt,
1760
2962
  cms: {
1761
- ...ge,
1762
- ...fe
2963
+ ...Ht,
2964
+ ...Ut
1763
2965
  }
1764
- }, br = {
2966
+ }, Ri = {
1765
2967
  template: {
1766
- pdp: {}
2968
+ pdp: { PDPSimilars: mi }
1767
2969
  }
1768
2970
  };
1769
2971
  export {
1770
- hr as serverAPIs,
1771
- gr as serverCMS,
1772
- br as serverComponents,
1773
- yr as serverHelpers
2972
+ yi as serverAPIs,
2973
+ vi as serverCMS,
2974
+ Ri as serverComponents,
2975
+ _i as serverHelpers
1774
2976
  };