@soma-vertical-web/multi-lib-sacurai 0.0.1 → 0.0.2

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,5 +1,5 @@
1
1
  import { jsx as b, jsxs as N, Fragment as L } from "react/jsx-runtime";
2
- import { y as E, r as j, S as oe, z as ie, A as ce, a as le, w as ue, v as de, B as me, p as pe, k as fe, q as M, C as ge, D as he, E as ye, e as be, F as Ie } from "./index-D_ZsOrBB.mjs";
2
+ import { y as E, r as j, S as oe, z as ie, A as ce, a as le, w as ue, v as de, B as me, p as pe, k as fe, q as M, C as ge, D as he, E as ye, e as be, F as Ie } from "./index-DbdJ4XHW.mjs";
3
3
  import { Utils as D, helpers as _ } from "@soma-vertical-web/core-components";
4
4
  import * as n from "yup";
5
5
  import Re from "sanitize-html";
@@ -25,17 +25,17 @@ const Ce = async ({
25
25
  var R, p, m, y;
26
26
  return ((p = (R = d.config) == null ? void 0 : R.responsive) == null ? void 0 : p.deviceType) === "desktop" && ((y = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : y.slug) === t;
27
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(
28
+ ), i = o == null ? void 0 : o.config.responsive.gapCustom, c = o == null ? void 0 : o.config.responsive.gapSections, l = e == null ? void 0 : e.find(
29
29
  (d) => {
30
30
  var R, p, m, y;
31
31
  return ((p = (R = d.config) == null ? void 0 : R.responsive) == null ? void 0 : p.deviceType) === "mobile" && ((y = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : y.slug) === t;
32
32
  }
33
- ), g = c == null ? void 0 : c.config.responsive.gapCustom, l = c == null ? void 0 : c.config.responsive.gapSections;
33
+ ), g = l == null ? void 0 : l.config.responsive.gapCustom, u = l == null ? void 0 : l.config.responsive.gapSections;
34
34
  return /* @__PURE__ */ N(L, { children: [
35
35
  /* @__PURE__ */ b(
36
36
  D.Column,
37
37
  {
38
- gap: i && u ? u : r,
38
+ gap: i && c ? c : r,
39
39
  className: _.classNameConcat(
40
40
  j["responsive-desktop-flex"],
41
41
  "utils-column-modifier"
@@ -46,12 +46,12 @@ const Ce = async ({
46
46
  /* @__PURE__ */ b(
47
47
  D.Column,
48
48
  {
49
- gap: g && l ? l : r,
49
+ gap: g && u ? u : r,
50
50
  className: _.classNameConcat(
51
51
  j["responsive-mobile-flex"],
52
52
  "utils-column-modifier"
53
53
  ),
54
- children: /* @__PURE__ */ b(a, { data: (c == null ? void 0 : c.sections) ?? [], identifyWhoIsFirst: s })
54
+ children: /* @__PURE__ */ b(a, { data: (l == null ? void 0 : l.sections) ?? [], identifyWhoIsFirst: s })
55
55
  }
56
56
  )
57
57
  ] });
@@ -94,12 +94,12 @@ const Ce = async ({
94
94
  ICONS: s,
95
95
  SectionZone: o,
96
96
  Footer: i,
97
- FooterSupport: u,
98
- hasFooterStamps: c,
97
+ FooterSupport: c,
98
+ hasFooterStamps: l,
99
99
  ...g
100
100
  }) => {
101
101
  var p, m, y, I, O, T, q, f, S, C, F;
102
- const { data: l } = await E("footer", g), d = Array.isArray(l) && ((p = l[0]) == null ? void 0 : p.type) === "footer" ? l[0] : null, R = {
102
+ const { data: u } = await E("footer", g), d = Array.isArray(u) && ((p = u[0]) == null ? void 0 : p.type) === "footer" ? u[0] : null, R = {
103
103
  ...(m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo,
104
104
  acceptedFlags: Array.isArray(
105
105
  (y = d == null ? void 0 : d.paymentInfo) == null ? void 0 : y.paymentInfo.acceptedFlags
@@ -115,11 +115,11 @@ const Ce = async ({
115
115
  socialInfo: (O = d.socialMedia) == null ? void 0 : O.socialMedia,
116
116
  socialMedias: (q = (T = d.socialMedia) == null ? void 0 : T.socialMedia) == null ? void 0 : q.medias,
117
117
  payments: R,
118
- hasFooterStamps: c,
118
+ hasFooterStamps: l,
119
119
  adornment: {
120
120
  ...(S = (f = d.supportInfo) == null ? void 0 : f.supportInfo) != null && S.content ? {
121
121
  bottom: /* @__PURE__ */ b(
122
- u,
122
+ c,
123
123
  {
124
124
  content: (F = (C = d.supportInfo) == null ? void 0 : C.supportInfo) == null ? void 0 : F.content,
125
125
  CONSTANTS: {
@@ -141,7 +141,7 @@ const Ce = async ({
141
141
  ClientHeaderProvider: e,
142
142
  ...a
143
143
  }) => {
144
- var o, i, u, c, g, l;
144
+ var o, i, c, l, g, u;
145
145
  const { data: r } = await E(
146
146
  "header",
147
147
  a
@@ -152,15 +152,15 @@ const Ce = async ({
152
152
  headerData: {
153
153
  ...((o = s == null ? void 0 : s.layerConfig) == null ? void 0 : o.config) ?? {},
154
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 = (g = s == null ? void 0 : s.navigationLinks) == null ? void 0 : g.navigationLinks) == null ? void 0 : l.items) ?? []
155
+ categories: ((l = (c = s == null ? void 0 : s.categories) == null ? void 0 : c.categories) == null ? void 0 : l.items) ?? [],
156
+ navigationLinks: ((u = (g = s == null ? void 0 : s.navigationLinks) == null ? void 0 : g.navigationLinks) == null ? void 0 : u.items) ?? []
157
157
  },
158
158
  children: t
159
159
  }
160
160
  );
161
161
  }, Te = (t) => {
162
- var i, u;
163
- const e = (u = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : u.items;
162
+ var i, c;
163
+ const e = (c = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : c.items;
164
164
  if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
165
165
  return {
166
166
  iconLabel: "",
@@ -168,17 +168,17 @@ const Ce = async ({
168
168
  content: []
169
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, g) => ({
172
- type: c.type,
173
- id: `${g.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
+ (l, g) => ({
172
+ type: l.type,
173
+ id: `${g.toString()}-${l.title.toLowerCase()}`,
174
+ title: l.title,
175
+ subtitle: l.subtitle,
176
+ description: l.description,
177
+ buttonLabel: l.buttonLabel,
178
+ buttonHref: l.buttonHref,
179
+ buttonMode: l.buttonMode,
180
+ buttonSize: l.buttonSize,
181
+ buttonIcon: l.buttonIcon
182
182
  })
183
183
  );
184
184
  return {
@@ -213,17 +213,17 @@ const Ce = async ({
213
213
  LPCadastro: e,
214
214
  ...a
215
215
  }) => {
216
- var c;
216
+ var l;
217
217
  const { data: r } = await E(
218
218
  "lp_cadastro",
219
219
  a
220
220
  );
221
221
  if (!r || !Array.isArray(r) || r.length === 0)
222
222
  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;
223
+ const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((l = s == null ? void 0 : s.content) == null ? void 0 : l.conteúdo) || {}, c = s == null ? void 0 : s.sections;
224
224
  return /* @__PURE__ */ N(L, { children: [
225
225
  /* @__PURE__ */ b(e, { sections: o, content: i }),
226
- /* @__PURE__ */ b(t, { data: u })
226
+ /* @__PURE__ */ b(t, { data: c })
227
227
  ] });
228
228
  }, Pe = async ({
229
229
  children: t,
@@ -258,28 +258,28 @@ const Ce = async ({
258
258
  PLPContentProvider: o,
259
259
  ...i
260
260
  }) => {
261
- const { data: u } = await E(
261
+ const { data: c } = await E(
262
262
  "categories_page",
263
263
  i
264
264
  );
265
- if (!u || !Array.isArray(u))
265
+ if (!c || !Array.isArray(c))
266
266
  return null;
267
- const c = u.find(
267
+ const l = c.find(
268
268
  (p) => {
269
269
  var m, y, I;
270
270
  return ((m = p.config) == null ? void 0 : m.seo.slug) === a && ((I = (y = p.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
271
271
  }
272
- ), g = u.find(
272
+ ), g = c.find(
273
273
  (p) => {
274
274
  var m, y, I;
275
275
  return ((m = p.config) == null ? void 0 : m.seo.slug) === a && ((I = (y = p.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
276
276
  }
277
- ), l = u.find(
277
+ ), u = c.find(
278
278
  (p) => {
279
279
  var m, y, I;
280
280
  return ((m = p.config) == null ? void 0 : m.seo.slug) === "default" && ((I = (y = p.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
281
281
  }
282
- ), d = u.find(
282
+ ), d = c.find(
283
283
  (p) => {
284
284
  var m, y, I;
285
285
  return ((m = p.config) == null ? void 0 : m.seo.slug) === "default" && ((I = (y = p.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
@@ -299,7 +299,7 @@ const Ce = async ({
299
299
  children: /* @__PURE__ */ b(
300
300
  o,
301
301
  {
302
- data: c ?? l,
302
+ data: l ?? u,
303
303
  device: "desktop",
304
304
  SectionZone: r,
305
305
  COMMON_PAGE_COLUMN_GAP_PDC: s,
@@ -320,7 +320,7 @@ const Ce = async ({
320
320
  ) })
321
321
  ] });
322
322
  }, Ne = async ({ slug: t, ...e }) => {
323
- var i, u, c;
323
+ var i, c, l;
324
324
  const { data: a } = await E(
325
325
  "redirect_to_search",
326
326
  e
@@ -331,7 +331,7 @@ const Ce = async ({
331
331
  query: null,
332
332
  redirect: !1
333
333
  };
334
- const r = ((c = (u = (i = a[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
334
+ const r = ((l = (c = (i = a[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
335
335
  if (!!!r.length)
336
336
  return {
337
337
  slug: t,
@@ -340,8 +340,8 @@ const Ce = async ({
340
340
  };
341
341
  const o = r.find(
342
342
  (g) => {
343
- var l, d;
344
- return ((l = g.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = g.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
343
+ var u, d;
344
+ return ((u = g.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = g.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
345
345
  }
346
346
  );
347
347
  return o ? {
@@ -360,20 +360,20 @@ const Ce = async ({
360
360
  sort: null
361
361
  };
362
362
  }, ke = async ({ slug: t, ...e }) => {
363
- var i, u, c;
363
+ var i, c, l;
364
364
  const { data: a } = await E(
365
365
  "redirect_to_search",
366
366
  e
367
367
  );
368
368
  if (!a || !Array.isArray(a))
369
369
  return null;
370
- const r = ((c = (u = (i = a[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
370
+ const r = ((l = (c = (i = a[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
371
371
  if (!!!r.length)
372
372
  return null;
373
373
  const o = r.find(
374
374
  (g) => {
375
- var l, d;
376
- return ((l = g.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = g.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
375
+ var u, d;
376
+ return ((u = g.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = g.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
377
377
  }
378
378
  );
379
379
  return o ? {
@@ -436,8 +436,8 @@ const Ce = async ({
436
436
  cache: i,
437
437
  ...r ? { body: JSON.stringify(r) } : {}
438
438
  // not body in get
439
- }).then((u) => u.json()).catch((u) => {
440
- console.error("[ERROR FETCH VTEX]", u);
439
+ }).then((c) => c.json()).catch((c) => {
440
+ console.error("[ERROR FETCH VTEX]", c);
441
441
  });
442
442
  }, w = /* @__PURE__ */ new Map();
443
443
  async function He(t, e = {}) {
@@ -521,7 +521,7 @@ async function K({
521
521
  return;
522
522
  }
523
523
  await Me.validate(e);
524
- const { orderFormId: s, sellerCode: o, marketingData: i } = e, u = o ? {
524
+ const { orderFormId: s, sellerCode: o, marketingData: i } = e, c = o ? {
525
525
  utmCampaign: o ? o.toUpperCase() : "",
526
526
  utmiCampaign: o ? `${a.VENDOR_CODE}` : "semcodigo"
527
527
  } : {};
@@ -531,7 +531,7 @@ async function K({
531
531
  method: "POST",
532
532
  body: {
533
533
  ...i,
534
- ...u
534
+ ...c
535
535
  },
536
536
  ...r
537
537
  }
@@ -736,8 +736,8 @@ async function ct({ apiUrl: t, body: e, fetchOptions: a }) {
736
736
  return;
737
737
  }
738
738
  await it.validate(e);
739
- 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}`;
740
- return h(c, {
739
+ const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, c = i ? `/${o}/remove` : "", l = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${c}`;
740
+ return h(l, {
741
741
  method: "POST",
742
742
  body: { id: o },
743
743
  ...a
@@ -1082,9 +1082,9 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1082
1082
  visible: t.visible
1083
1083
  }
1084
1084
  }), B = (t, e, a) => {
1085
- const r = t.flatMap(({ name: i, values: u }) => u ? u.map((c) => ({
1085
+ const r = t.flatMap(({ name: i, values: c }) => c ? c.map((l) => ({
1086
1086
  name: i,
1087
- value: c,
1087
+ value: l,
1088
1088
  valueReference: H.specification
1089
1089
  })) : {
1090
1090
  name: i,
@@ -1152,11 +1152,11 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1152
1152
  additionalProperty: B(o, e, []),
1153
1153
  name: r,
1154
1154
  offers: {
1155
- offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: u }) => ({
1156
- availability: jt(u.AvailableQuantity > 0),
1157
- listPrice: u.ListPrice,
1158
- price: u.Price,
1159
- quantity: u.AvailableQuantity,
1155
+ offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: c }) => ({
1156
+ availability: jt(c.AvailableQuantity > 0),
1157
+ listPrice: c.ListPrice,
1158
+ price: c.Price,
1159
+ quantity: c.AvailableQuantity,
1160
1160
  seller: {
1161
1161
  identifier: i
1162
1162
  }
@@ -1174,11 +1174,11 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1174
1174
  images: s,
1175
1175
  itemId: o,
1176
1176
  name: i,
1177
- sellers: u,
1178
- videos: c,
1177
+ sellers: c,
1178
+ videos: l,
1179
1179
  variations: g
1180
1180
  } = t, {
1181
- brand: l,
1181
+ brand: u,
1182
1182
  categories: d,
1183
1183
  categoriesIds: R,
1184
1184
  description: p,
@@ -1189,7 +1189,7 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1189
1189
  properties: T,
1190
1190
  productId: q,
1191
1191
  productReference: f
1192
- } = r, S = d.slice().reverse(), C = re(u, t.isVariantOf), F = te(C.offers[0].installments);
1192
+ } = r, S = d.slice().reverse(), C = re(c, t.isVariantOf), F = te(C.offers[0].installments);
1193
1193
  return {
1194
1194
  sku: o,
1195
1195
  gtin: ((v = a == null ? void 0 : a[0]) == null ? void 0 : v.Value) ?? f ?? "",
@@ -1197,11 +1197,11 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1197
1197
  description: p,
1198
1198
  releaseDate: r.releaseDate ?? "",
1199
1199
  slug: m,
1200
- video: c[0],
1200
+ video: l[0],
1201
1201
  categories: d,
1202
1202
  categoriesIds: R,
1203
1203
  id: q,
1204
- brand: { name: l, brandName: l },
1204
+ brand: { name: u, brandName: u },
1205
1205
  seo: {
1206
1206
  description: p,
1207
1207
  title: O,
@@ -1249,11 +1249,11 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1249
1249
  images: s,
1250
1250
  itemId: o,
1251
1251
  name: i,
1252
- sellers: u,
1253
- Videos: c,
1252
+ sellers: c,
1253
+ Videos: l,
1254
1254
  variations: g
1255
1255
  } = t, {
1256
- brand: l,
1256
+ brand: u,
1257
1257
  categories: d,
1258
1258
  categoriesIds: R,
1259
1259
  description: p,
@@ -1263,7 +1263,7 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1263
1263
  Coleção: O,
1264
1264
  "ID Coleção": T,
1265
1265
  productId: q
1266
- } = r, f = d.slice().reverse(), S = re(u, t.isVariantOf), C = te(S.offers[0].installments);
1266
+ } = r, f = d.slice().reverse(), S = re(c, t.isVariantOf), C = te(S.offers[0].installments);
1267
1267
  return {
1268
1268
  sku: o,
1269
1269
  gtin: ((F = a[0]) == null ? void 0 : F.Value) ?? "",
@@ -1271,13 +1271,13 @@ const wt = (t, e) => Re(t, e), Nt = (t) => ({
1271
1271
  description: p,
1272
1272
  releaseDate: r.releaseDate ?? "",
1273
1273
  slug: m,
1274
- video: c[0],
1274
+ video: l[0],
1275
1275
  categories: d,
1276
1276
  categoriesIds: R,
1277
1277
  collection: O,
1278
1278
  collectionId: T,
1279
1279
  id: q,
1280
- brand: { name: l, brandName: l },
1280
+ brand: { name: u, brandName: u },
1281
1281
  seo: {
1282
1282
  description: p,
1283
1283
  title: I,
@@ -1339,17 +1339,17 @@ async function zt({ apiUrl: t, body: e, fetchOptions: a }) {
1339
1339
  return;
1340
1340
  }
1341
1341
  await xt.validate(e);
1342
- const r = new URLSearchParams({}), s = e.map(({ key: i, value: u }) => `${i}/${u}`).join("/");
1342
+ const r = new URLSearchParams({}), s = e.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
1343
1343
  ie(e, r);
1344
1344
  const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
1345
1345
  return h(o, {
1346
1346
  cache: "no-store",
1347
1347
  ...a
1348
- }).then((i) => i.map((c) => {
1349
- const g = X(c.items);
1350
- return g && J(g, c);
1351
- }).filter((c) => !!c).map((c) => ({
1352
- node: Vt(c)
1348
+ }).then((i) => i.map((l) => {
1349
+ const g = X(l.items);
1350
+ return g && J(g, l);
1351
+ }).filter((l) => !!l).map((l) => ({
1352
+ node: Vt(l)
1353
1353
  })));
1354
1354
  }
1355
1355
  const ne = ({
@@ -1366,20 +1366,20 @@ const ne = ({
1366
1366
  query: s = "",
1367
1367
  page: o = 1,
1368
1368
  count: i,
1369
- sort: u = "",
1370
- facets: c = [],
1369
+ sort: c = "",
1370
+ facets: l = [],
1371
1371
  type: g,
1372
- hideUnavailableItems: l = !0,
1372
+ hideUnavailableItems: u = !0,
1373
1373
  locale: d = ""
1374
1374
  } = e, R = new URLSearchParams({
1375
1375
  page: o.toString(),
1376
1376
  count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
1377
1377
  query: s,
1378
- sort: u,
1378
+ sort: c,
1379
1379
  locale: d
1380
1380
  });
1381
- l !== void 0 && R.append("hideUnavailableItems", l.toString());
1382
- const p = c.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
1381
+ u !== void 0 && R.append("hideUnavailableItems", u.toString());
1382
+ const p = l.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
1383
1383
  return He(
1384
1384
  `${t}/api/io/_v/api/intelligent-search/${g}/${p}?${R.toString()}`,
1385
1385
  {
@@ -1403,10 +1403,10 @@ async function Qt({ body: t, extraData: e, ...a }) {
1403
1403
  },
1404
1404
  extraData: e,
1405
1405
  ...a
1406
- }), s = (r == null ? void 0 : r.products.map((u) => {
1407
- const c = X(u.items);
1408
- return c && J(c, u);
1409
- }).filter((u) => !!u)) ?? [], {
1406
+ }), s = (r == null ? void 0 : r.products.map((c) => {
1407
+ const l = X(c.items);
1408
+ return l && J(l, c);
1409
+ }).filter((c) => !!c)) ?? [], {
1410
1410
  pagination: o,
1411
1411
  recordsFiltered: i
1412
1412
  } = r;
@@ -1420,9 +1420,9 @@ async function Qt({ body: t, extraData: e, ...a }) {
1420
1420
  count: i,
1421
1421
  total: o.count
1422
1422
  },
1423
- products: s.map((u, c) => ({
1424
- node: Ut(u),
1425
- cursor: c.toString()
1423
+ products: s.map((c, l) => ({
1424
+ node: Ut(c),
1425
+ cursor: l.toString()
1426
1426
  }))
1427
1427
  }
1428
1428
  };
@@ -1525,11 +1525,11 @@ async function ar({
1525
1525
  const r = new URLSearchParams();
1526
1526
  await rr.validate(e);
1527
1527
  const { masterDataEntity: s, searchFields: o, headers: i } = e;
1528
- o && Object.entries(o).forEach(([c, g]) => {
1529
- r.append(c, String(g));
1528
+ o && Object.entries(o).forEach(([l, g]) => {
1529
+ r.append(l, String(g));
1530
1530
  }), "_fields" in o || r == null || r.append("_fields", "_all");
1531
- const u = `${t}/api/dataentities/${s}/search?${r.toString()}`;
1532
- return h(u, {
1531
+ const c = `${t}/api/dataentities/${s}/search?${r.toString()}`;
1532
+ return h(c, {
1533
1533
  headers: {
1534
1534
  "REST-Range": i["REST-Range"] ?? "resources=0-20"
1535
1535
  },
@@ -1574,43 +1574,43 @@ async function ir({ body: t, apiUrl: e, extraData: a, fetchOptions: r }) {
1574
1574
  const { NAME_SPLIT_SYMBOL: o } = a;
1575
1575
  if (!o)
1576
1576
  return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
1577
- const i = s.map((l) => typeof l == "string" || typeof l == "number" ? `productId:${l}` : "").join("&fq="), u = await h(
1577
+ const i = s.map((u) => typeof u == "string" || typeof u == "number" ? `productId:${u}` : "").join("&fq="), c = await h(
1578
1578
  `${e}/api/catalog_system/pub/products/search?fq=${i}`,
1579
1579
  {
1580
1580
  ...r
1581
1581
  }
1582
- ), c = (l) => Object.keys(l).map((d) => ({ id: d, name: l[d] }));
1583
- return u.map((l, d) => {
1582
+ ), l = (u) => Object.keys(u).map((d) => ({ id: d, name: u[d] }));
1583
+ return c.map((u, d) => {
1584
1584
  var q;
1585
- const { installments: R, price: p, listPrice: m, sizes: y, allSizesAvailable: I } = le({ items: l.items, NAME_SPLIT_SYMBOL: o }), O = I ? !0 : y.some((f) => f.available), T = l.items[0].sellers[0].commertialOffer;
1585
+ const { installments: R, price: p, listPrice: m, sizes: y, allSizesAvailable: I } = le({ items: u.items, NAME_SPLIT_SYMBOL: o }), O = I ? !0 : y.some((f) => f.available), T = u.items[0].sellers[0].commertialOffer;
1586
1586
  return {
1587
1587
  node: {
1588
- sku: l.items[0].itemId,
1589
- gtin: l.productReference,
1590
- name: l.productName,
1591
- description: l.description,
1592
- releaseDate: l.releaseDate,
1593
- slug: l.linkText,
1594
- categories: l.categories,
1595
- categoriesIds: l.categoriesIds,
1596
- id: l.items[0].itemId,
1588
+ sku: u.items[0].itemId,
1589
+ gtin: u.productReference,
1590
+ name: u.productName,
1591
+ description: u.description,
1592
+ releaseDate: u.releaseDate,
1593
+ slug: u.linkText,
1594
+ categories: u.categories,
1595
+ categoriesIds: u.categoriesIds,
1596
+ id: u.items[0].itemId,
1597
1597
  brand: {
1598
- name: l.brand,
1599
- brandName: l.brand
1598
+ name: u.brand,
1599
+ brandName: u.brand
1600
1600
  },
1601
1601
  seo: {
1602
- description: l.description,
1603
- title: l.productName,
1604
- canonical: `/${l.linkText}/p`
1602
+ description: u.description,
1603
+ title: u.productName,
1604
+ canonical: `/${u.linkText}/p`
1605
1605
  },
1606
1606
  cluster: {
1607
- generals: c(l.productClusters),
1608
- highlights: c(l.clusterHighlights)
1607
+ generals: l(u.productClusters),
1608
+ highlights: l(u.clusterHighlights)
1609
1609
  },
1610
1610
  availability: {
1611
1611
  status: O
1612
1612
  },
1613
- image: l.items[0].images.map(
1613
+ image: u.items[0].images.map(
1614
1614
  ({
1615
1615
  imageLabel: f,
1616
1616
  imageUrl: S
@@ -1634,19 +1634,19 @@ async function ir({ body: t, apiUrl: e, extraData: a, fetchOptions: r }) {
1634
1634
  lowPrice: p,
1635
1635
  quantity: T.AvailableQuantity,
1636
1636
  seller: {
1637
- identifier: l.items[0].sellers[0].sellerId
1637
+ identifier: u.items[0].sellers[0].sellerId
1638
1638
  }
1639
1639
  }
1640
1640
  ]
1641
1641
  },
1642
- additionalProperty: (q = l == null ? void 0 : l.skuSpecifications) == null ? void 0 : q.map((f) => ({
1643
- name: l == null ? void 0 : l.skuSpecifications[0].field.name,
1642
+ additionalProperty: (q = u == null ? void 0 : u.skuSpecifications) == null ? void 0 : q.map((f) => ({
1643
+ name: u == null ? void 0 : u.skuSpecifications[0].field.name,
1644
1644
  value: f,
1645
1645
  valueReference: "SPECIFICATION"
1646
1646
  })),
1647
1647
  isVariantOf: {
1648
- productGroupID: l.productId,
1649
- hasVariant: l.items.map((f) => {
1648
+ productGroupID: u.productId,
1649
+ hasVariant: u.items.map((f) => {
1650
1650
  var S;
1651
1651
  return {
1652
1652
  additionalProperty: f == null ? void 0 : f.variations.map(() => {
@@ -1690,14 +1690,14 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1690
1690
  convertSearchParams: me,
1691
1691
  filterNonRootFacets: de,
1692
1692
  filterNonCategorySelected: ue
1693
- }, ur = async ({ children: t, productId: e, ClientItems: a, PDP_INFO: r, TEXTURE_IMAGE: s, TOGGLE_STYLE_MODIFIER: o }) => {
1694
- const i = await fe(e, s);
1693
+ }, ur = async ({ children: t, apiUrl: e, productId: a, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
1694
+ const c = await fe({ productId: a, TEXTURE_IMAGE: o, apiUrl: e });
1695
1695
  return /* @__PURE__ */ N("div", { className: M.similars, children: [
1696
1696
  /* @__PURE__ */ N("div", { className: M["similars-info"], children: [
1697
- /* @__PURE__ */ b("span", { className: M["sections-title"], children: r.product.color_title }),
1697
+ /* @__PURE__ */ b("span", { className: M["sections-title"], children: s.product.color_title }),
1698
1698
  t
1699
1699
  ] }),
1700
- /* @__PURE__ */ b(a, { productId: e, similars: i, TOGGLE_STYLE_MODIFIER: o })
1700
+ /* @__PURE__ */ b(r, { productId: a, similars: c, TOGGLE_STYLE_MODIFIER: i })
1701
1701
  ] });
1702
1702
  }, hr = {
1703
1703
  checkout: Et,
package/layout/index.d.ts CHANGED
@@ -297,7 +297,7 @@ export declare const layout: {
297
297
  displayName: string;
298
298
  };
299
299
  Products: {
300
- ({ isMobile, items, BUY_BUTTON_LABELS, ICONS, MAIN_IMAGE, NEWSLETTER_CONFIGS, NOTIFY_INFO, PLP_GRID_SCROLL_BACK, PLP_INFINITE_SCROLL, PLP_PRODUCT_SIMILAR_DELAY, PLP_SHOW_VIDEO_ON_PRODUCT_CARD, PLP_SIZE_ORDER, PRODUCT_CARD_IMAGE_ASPECT_RATIO, PRODUCT_CARD_TEXTS, PRODUCT_CARD_TOP_WISHLIST_TOGGLE, PRODUCT_IMAGE_DIMENSIONS, SECOND_IMAGE, StoreConfig_MainSellerId, TEXTURE_IMAGE, Z_INDEX_WAR, }: import('../types/layout/templates/PLP').ProductsProps): import("react/jsx-runtime").JSX.Element;
300
+ ({ isMobile, items, apiUrl, BUY_BUTTON_LABELS, ICONS, MAIN_IMAGE, NEWSLETTER_CONFIGS, NOTIFY_INFO, PLP_GRID_SCROLL_BACK, PLP_INFINITE_SCROLL, PLP_PRODUCT_SIMILAR_DELAY, PLP_SHOW_VIDEO_ON_PRODUCT_CARD, PLP_SIZE_ORDER, PRODUCT_CARD_IMAGE_ASPECT_RATIO, PRODUCT_CARD_TEXTS, PRODUCT_CARD_TOP_WISHLIST_TOGGLE, PRODUCT_IMAGE_DIMENSIONS, SECOND_IMAGE, StoreConfig_MainSellerId, TEXTURE_IMAGE, Z_INDEX_WAR, }: import('../types/layout/templates/PLP').ProductsProps): import("react/jsx-runtime").JSX.Element;
301
301
  displayName: string;
302
302
  };
303
303
  };
@@ -1,7 +1,7 @@
1
1
  import { ProductsProps } from '../../../../../types/layout/templates/PLP';
2
2
 
3
3
  declare const Products: {
4
- ({ isMobile, items, BUY_BUTTON_LABELS, ICONS, MAIN_IMAGE, NEWSLETTER_CONFIGS, NOTIFY_INFO, PLP_GRID_SCROLL_BACK, PLP_INFINITE_SCROLL, PLP_PRODUCT_SIMILAR_DELAY, PLP_SHOW_VIDEO_ON_PRODUCT_CARD, PLP_SIZE_ORDER, PRODUCT_CARD_IMAGE_ASPECT_RATIO, PRODUCT_CARD_TEXTS, PRODUCT_CARD_TOP_WISHLIST_TOGGLE, PRODUCT_IMAGE_DIMENSIONS, SECOND_IMAGE, StoreConfig_MainSellerId, TEXTURE_IMAGE, Z_INDEX_WAR, }: ProductsProps): import("react/jsx-runtime").JSX.Element;
4
+ ({ isMobile, items, apiUrl, BUY_BUTTON_LABELS, ICONS, MAIN_IMAGE, NEWSLETTER_CONFIGS, NOTIFY_INFO, PLP_GRID_SCROLL_BACK, PLP_INFINITE_SCROLL, PLP_PRODUCT_SIMILAR_DELAY, PLP_SHOW_VIDEO_ON_PRODUCT_CARD, PLP_SIZE_ORDER, PRODUCT_CARD_IMAGE_ASPECT_RATIO, PRODUCT_CARD_TEXTS, PRODUCT_CARD_TOP_WISHLIST_TOGGLE, PRODUCT_IMAGE_DIMENSIONS, SECOND_IMAGE, StoreConfig_MainSellerId, TEXTURE_IMAGE, Z_INDEX_WAR, }: ProductsProps): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  export default Products;
@@ -32,7 +32,7 @@ declare const PDC: {
32
32
  displayName: string;
33
33
  };
34
34
  Products: {
35
- ({ isMobile, items, BUY_BUTTON_LABELS, ICONS, MAIN_IMAGE, NEWSLETTER_CONFIGS, NOTIFY_INFO, PLP_GRID_SCROLL_BACK, PLP_INFINITE_SCROLL, PLP_PRODUCT_SIMILAR_DELAY, PLP_SHOW_VIDEO_ON_PRODUCT_CARD, PLP_SIZE_ORDER, PRODUCT_CARD_IMAGE_ASPECT_RATIO, PRODUCT_CARD_TEXTS, PRODUCT_CARD_TOP_WISHLIST_TOGGLE, PRODUCT_IMAGE_DIMENSIONS, SECOND_IMAGE, StoreConfig_MainSellerId, TEXTURE_IMAGE, Z_INDEX_WAR, }: import('../../../types/layout/templates/PLP').ProductsProps): import("react/jsx-runtime").JSX.Element;
35
+ ({ isMobile, items, apiUrl, BUY_BUTTON_LABELS, ICONS, MAIN_IMAGE, NEWSLETTER_CONFIGS, NOTIFY_INFO, PLP_GRID_SCROLL_BACK, PLP_INFINITE_SCROLL, PLP_PRODUCT_SIMILAR_DELAY, PLP_SHOW_VIDEO_ON_PRODUCT_CARD, PLP_SIZE_ORDER, PRODUCT_CARD_IMAGE_ASPECT_RATIO, PRODUCT_CARD_TEXTS, PRODUCT_CARD_TOP_WISHLIST_TOGGLE, PRODUCT_IMAGE_DIMENSIONS, SECOND_IMAGE, StoreConfig_MainSellerId, TEXTURE_IMAGE, Z_INDEX_WAR, }: import('../../../types/layout/templates/PLP').ProductsProps): import("react/jsx-runtime").JSX.Element;
36
36
  displayName: string;
37
37
  };
38
38
  };
@@ -1,3 +1,3 @@
1
1
  import { PDPSimilarsType } from '../../../../../../../types/layout/templates/PDP';
2
2
 
3
- export declare const PDPSimilars: ({ children, productId, ClientItems, PDP_INFO, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER }: PDPSimilarsType) => Promise<import("react/jsx-runtime").JSX.Element>;
3
+ export declare const PDPSimilars: ({ children, apiUrl, productId, ClientItems, PDP_INFO, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER }: PDPSimilarsType) => Promise<import("react/jsx-runtime").JSX.Element>;
@@ -1,4 +1,4 @@
1
1
  import { BodyProps } from '../../../../types/layout/templates/QuickShop';
2
2
 
3
- declare const Body: ({ callBackProductAdded, BUY_BUTTON_LABELS, ICONS, NEWSLETTER_CONFIGS, NOTIFY_INFO, PDP_INFO, PLP_SIZE_ORDER, PRODUCT_CARD_TEXTS, TEXTURE_IMAGE, TIME_ZONE, TOGGLE_STYLE_MODIFIER, Z_INDEX_WAR }: BodyProps) => import("react/jsx-runtime").JSX.Element;
3
+ declare const Body: ({ callBackProductAdded, apiUrl, BUY_BUTTON_LABELS, ICONS, NEWSLETTER_CONFIGS, NOTIFY_INFO, PDP_INFO, PLP_SIZE_ORDER, PRODUCT_CARD_TEXTS, TEXTURE_IMAGE, TIME_ZONE, TOGGLE_STYLE_MODIFIER, Z_INDEX_WAR }: BodyProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default Body;
@@ -1,7 +1,7 @@
1
1
  import { SimilarsProps } from '../../../../types/layout/templates/QuickShop';
2
2
 
3
3
  declare const Similars: {
4
- ({ TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER }: SimilarsProps): import("react/jsx-runtime").JSX.Element;
4
+ ({ apiUrl, TEXTURE_IMAGE, TOGGLE_STYLE_MODIFIER }: SimilarsProps): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  export default Similars;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soma-vertical-web/multi-lib-sacurai",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {