@azzas/azzas-tracker-web 2.0.3-preview.2 → 2.0.3-preview.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mod.cjs +21 -237
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.d.cts +0 -276
- package/dist/mod.d.ts +0 -276
- package/dist/mod.global.js +21 -237
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +21 -237
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +24 -309
- package/package.json +1 -1
package/dist/mod.cjs
CHANGED
|
@@ -1102,8 +1102,8 @@ function getPaymentType(context, eventName) {
|
|
|
1102
1102
|
|
|
1103
1103
|
// src/params/userInfo.ts
|
|
1104
1104
|
var PROD_DOMAINS = {
|
|
1105
|
-
"
|
|
1106
|
-
"store": "https://
|
|
1105
|
+
"animale": {
|
|
1106
|
+
"store": "https://www.animale.com.br",
|
|
1107
1107
|
"checkout": "https://secure.animale.com.br"
|
|
1108
1108
|
},
|
|
1109
1109
|
"lojafarm": {
|
|
@@ -1516,10 +1516,10 @@ var getItemCategory3 = (item) => {
|
|
|
1516
1516
|
};
|
|
1517
1517
|
var getItemCategory22 = (item) => {
|
|
1518
1518
|
var _a, _b, _c, _d;
|
|
1519
|
-
const
|
|
1519
|
+
const AVOID_CATEGORIES = /^(outlet|bazar|sale)$/i;
|
|
1520
1520
|
const categories = (_b = (_a = item.category) == null ? void 0 : _a.split(">")) != null ? _b : [];
|
|
1521
1521
|
const last = (_c = categories[categories.length - 1]) != null ? _c : "";
|
|
1522
|
-
const validHierarchy = last.split("/").filter((c) => c && !
|
|
1522
|
+
const validHierarchy = last.split("/").filter((c) => c && !AVOID_CATEGORIES.test(c));
|
|
1523
1523
|
const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
|
|
1524
1524
|
return capitalize(deepest);
|
|
1525
1525
|
};
|
|
@@ -1627,9 +1627,9 @@ var getItemCategory5 = (item) => {
|
|
|
1627
1627
|
};
|
|
1628
1628
|
var getItemCategory23 = (item) => {
|
|
1629
1629
|
var _a, _b, _c, _d;
|
|
1630
|
-
const
|
|
1630
|
+
const AVOID_CATEGORIES = /^(outlet|bazar|sale|coleção|promoção)$/i;
|
|
1631
1631
|
const categories = (_c = (_b = (_a = item == null ? void 0 : item.similarItems) == null ? void 0 : _a[0]) == null ? void 0 : _b.categories) != null ? _c : [];
|
|
1632
|
-
const validHierarchy = categories.filter((c) => c && !
|
|
1632
|
+
const validHierarchy = categories.filter((c) => c && !AVOID_CATEGORIES.test(c));
|
|
1633
1633
|
const deepest = (_d = validHierarchy[validHierarchy.length - 1]) != null ? _d : "";
|
|
1634
1634
|
return capitalize(deepest);
|
|
1635
1635
|
};
|
|
@@ -1715,222 +1715,8 @@ var reservaAdapter = {
|
|
|
1715
1715
|
}
|
|
1716
1716
|
};
|
|
1717
1717
|
|
|
1718
|
-
// src/params/adapters/animale/utils.ts
|
|
1719
|
-
var SALE_CATEGORIES = /outlet|bazar|sale/i;
|
|
1720
|
-
var AVOID_CATEGORIES = /^(outlet|bazar|sale|cole(ç|c)(ã|a)o)$/i;
|
|
1721
|
-
var getLevels = (path) => path.split("/").filter(Boolean);
|
|
1722
|
-
var isProductCrumb = (path) => /\/p\/?$/.test(path != null ? path : "");
|
|
1723
|
-
var getCategoryPaths = (item) => {
|
|
1724
|
-
var _a, _b, _c;
|
|
1725
|
-
if (item && "categories" in item && ((_a = item.categories) == null ? void 0 : _a.length)) return item.categories;
|
|
1726
|
-
const names = [...(_c = (_b = item == null ? void 0 : item.breadcrumbList) == null ? void 0 : _b.itemListElement) != null ? _c : []].sort((a, b) => {
|
|
1727
|
-
var _a2, _b2;
|
|
1728
|
-
return ((_a2 = a == null ? void 0 : a.position) != null ? _a2 : 0) - ((_b2 = b == null ? void 0 : b.position) != null ? _b2 : 0);
|
|
1729
|
-
}).filter((crumb) => (crumb == null ? void 0 : crumb.name) && !isProductCrumb(crumb == null ? void 0 : crumb.item)).map((crumb) => crumb.name.trim());
|
|
1730
|
-
return names.length ? [`/${names.join("/")}/`] : [];
|
|
1731
|
-
};
|
|
1732
|
-
var getItemCategory6 = (item) => {
|
|
1733
|
-
var _a;
|
|
1734
|
-
const categories = getCategoryPaths(item);
|
|
1735
|
-
if (!categories.length) return "Cole\xE7\xE3o";
|
|
1736
|
-
const match = (_a = categories.join(" ").match(SALE_CATEGORIES)) == null ? void 0 : _a[0].toLowerCase();
|
|
1737
|
-
return match != null ? match : "Cole\xE7\xE3o";
|
|
1738
|
-
};
|
|
1739
|
-
var getItemCategory24 = (item) => {
|
|
1740
|
-
const categories = getCategoryPaths(item);
|
|
1741
|
-
for (const path of [...categories].reverse()) {
|
|
1742
|
-
const deepest = getLevels(path).reverse().find((level) => !AVOID_CATEGORIES.test(level.trim()));
|
|
1743
|
-
if (deepest) return capitalize(deepest.trim());
|
|
1744
|
-
}
|
|
1745
|
-
return "";
|
|
1746
|
-
};
|
|
1747
|
-
var isInStock = (availability) => /InStock/i.test(availability != null ? availability : "");
|
|
1748
|
-
|
|
1749
|
-
// src/params/adapters/animale/zones/PDC.ts
|
|
1750
|
-
var AnimalePdcZone = {
|
|
1751
|
-
items: (context) => {
|
|
1752
|
-
if (context == null ? void 0 : context.items) return context.items;
|
|
1753
|
-
if (context == null ? void 0 : context.products) {
|
|
1754
|
-
return context.products.map((item) => {
|
|
1755
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
|
|
1756
|
-
const listPrice = (_b = (_a = item == null ? void 0 : item.offers) == null ? void 0 : _a.offers) == null ? void 0 : _b[0].listPrice;
|
|
1757
|
-
const price = (_d = (_c = item.offers) == null ? void 0 : _c.offers) == null ? void 0 : _d[0].price;
|
|
1758
|
-
const sellerId = (_h = (_g = (_f = (_e = item == null ? void 0 : item.isVariantOf) == null ? void 0 : _e.hasVariant) == null ? void 0 : _f.find((v) => v.offers.offers.find((o) => o.availability))) == null ? void 0 : _g.offers.offers[0]) == null ? void 0 : _h.seller.identifier;
|
|
1759
|
-
return {
|
|
1760
|
-
quantity: 1,
|
|
1761
|
-
index: (_i = item == null ? void 0 : item.index) != null ? _i : 0,
|
|
1762
|
-
item_brand: (_j = item.brand.name.toLowerCase()) != null ? _j : null,
|
|
1763
|
-
item_name: (_l = (_k = item == null ? void 0 : item.isVariantOf) == null ? void 0 : _k.name) != null ? _l : null,
|
|
1764
|
-
price: price != null ? price : null,
|
|
1765
|
-
item_shipping_tier: null,
|
|
1766
|
-
discount: Number(listPrice) - Number(price),
|
|
1767
|
-
item_variant: (_o = (_n = (_m = item.isVariantOf) == null ? void 0 : _m.hasVariant) == null ? void 0 : _n[0].name.split(" - ")[0]) != null ? _o : null,
|
|
1768
|
-
item_variant2: (_r = (_q = ((_p = item.additionalProperty) != null ? _p : []).find((p) => p.name === "Tamanho")) == null ? void 0 : _q.value) != null ? _r : null,
|
|
1769
|
-
item_ref: (_s = item == null ? void 0 : item.gtin) != null ? _s : null,
|
|
1770
|
-
item_category: getItemCategory6(item),
|
|
1771
|
-
item_category2: (_t = getItemCategory24(item)) != null ? _t : null,
|
|
1772
|
-
item_id: (_v = (_u = item == null ? void 0 : item.isVariantOf) == null ? void 0 : _u.productGroupID) != null ? _v : null,
|
|
1773
|
-
item_sku: (_w = item == null ? void 0 : item.sku) != null ? _w : null,
|
|
1774
|
-
item_url: (_x = item == null ? void 0 : item.slug) != null ? _x : null,
|
|
1775
|
-
// sem link/url no retorno do IS na multi-lib produtos PDC
|
|
1776
|
-
image_url: (_z = resizeVtexImage2((_y = item == null ? void 0 : item.image) == null ? void 0 : _y[0].url)) != null ? _z : null,
|
|
1777
|
-
seller_id: sellerId != null ? sellerId : null,
|
|
1778
|
-
item_list_name: (_A = item.item_list_name) != null ? _A : null
|
|
1779
|
-
};
|
|
1780
|
-
});
|
|
1781
|
-
}
|
|
1782
|
-
return null;
|
|
1783
|
-
},
|
|
1784
|
-
value: (context) => {
|
|
1785
|
-
if (context == null ? void 0 : context.value) return context.value;
|
|
1786
|
-
if (context == null ? void 0 : context.products) {
|
|
1787
|
-
return context.products.map((item) => item.offers.lowPrice).filter((price) => price !== void 0).reduce((sum, price) => sum + price, 0);
|
|
1788
|
-
}
|
|
1789
|
-
return null;
|
|
1790
|
-
},
|
|
1791
|
-
line_items: (context) => {
|
|
1792
|
-
if (context == null ? void 0 : context.line_items) return context.line_items;
|
|
1793
|
-
if (context == null ? void 0 : context.products) {
|
|
1794
|
-
return context.products.map((item) => item.id).filter((id) => Boolean(id)).join();
|
|
1795
|
-
}
|
|
1796
|
-
return null;
|
|
1797
|
-
},
|
|
1798
|
-
brand: (context, config2) => {
|
|
1799
|
-
if (config2 == null ? void 0 : config2.brand) return config2.brand;
|
|
1800
|
-
if (context == null ? void 0 : context.brand) return context.brand;
|
|
1801
|
-
if (context == null ? void 0 : context.products) {
|
|
1802
|
-
return context.products.map((p) => p.brand.name).join().trim();
|
|
1803
|
-
}
|
|
1804
|
-
return null;
|
|
1805
|
-
}
|
|
1806
|
-
};
|
|
1807
|
-
|
|
1808
|
-
// src/params/adapters/animale/zones/PDP.ts
|
|
1809
|
-
var AnimalePdpZone = {
|
|
1810
|
-
items: (context) => {
|
|
1811
|
-
if (context == null ? void 0 : context.items) return context.items;
|
|
1812
|
-
if (context == null ? void 0 : context.products) {
|
|
1813
|
-
return context.products.map((item) => {
|
|
1814
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
|
1815
|
-
const listPrice = (_b = (_a = item == null ? void 0 : item.offers) == null ? void 0 : _a.offers) == null ? void 0 : _b[0].listPrice;
|
|
1816
|
-
const price = (_d = (_c = item.offers) == null ? void 0 : _c.offers) == null ? void 0 : _d[0].price;
|
|
1817
|
-
const availableOffer = (_g = (_f = (_e = item == null ? void 0 : item.isVariantOf) == null ? void 0 : _e.hasVariant) == null ? void 0 : _f.flatMap((v) => {
|
|
1818
|
-
var _a2, _b2;
|
|
1819
|
-
return (_b2 = (_a2 = v == null ? void 0 : v.offers) == null ? void 0 : _a2.offers) != null ? _b2 : [];
|
|
1820
|
-
})) == null ? void 0 : _g.find((o) => isInStock(o == null ? void 0 : o.availability));
|
|
1821
|
-
const sellerId = (_m = (_h = availableOffer == null ? void 0 : availableOffer.seller) == null ? void 0 : _h.identifier) != null ? _m : (_l = (_k = (_j = (_i = item == null ? void 0 : item.offers) == null ? void 0 : _i.offers) == null ? void 0 : _j[0]) == null ? void 0 : _k.seller) == null ? void 0 : _l.identifier;
|
|
1822
|
-
return {
|
|
1823
|
-
quantity: 1,
|
|
1824
|
-
index: (_n = item == null ? void 0 : item.index) != null ? _n : 0,
|
|
1825
|
-
item_brand: (_o = item.brand.name.toLowerCase()) != null ? _o : null,
|
|
1826
|
-
item_name: (_q = (_p = item == null ? void 0 : item.isVariantOf) == null ? void 0 : _p.name) != null ? _q : null,
|
|
1827
|
-
price: price != null ? price : null,
|
|
1828
|
-
item_shipping_tier: null,
|
|
1829
|
-
discount: Number(listPrice) - Number(price),
|
|
1830
|
-
item_variant: (_t = (_s = (_r = item.isVariantOf) == null ? void 0 : _r.hasVariant) == null ? void 0 : _s[0].name.split(" - ")[0]) != null ? _t : null,
|
|
1831
|
-
item_variant2: (_w = (_v = ((_u = item.additionalProperty) != null ? _u : []).find((p) => p.name === "Tamanho")) == null ? void 0 : _v.value) != null ? _w : null,
|
|
1832
|
-
item_ref: (_x = item == null ? void 0 : item.gtin) != null ? _x : null,
|
|
1833
|
-
item_category: getItemCategory6(item),
|
|
1834
|
-
item_category2: (_y = getItemCategory24(item)) != null ? _y : null,
|
|
1835
|
-
item_id: (_A = (_z = item == null ? void 0 : item.isVariantOf) == null ? void 0 : _z.productGroupID) != null ? _A : null,
|
|
1836
|
-
item_sku: (_B = item == null ? void 0 : item.sku) != null ? _B : null,
|
|
1837
|
-
item_url: (_C = item == null ? void 0 : item.slug) != null ? _C : null,
|
|
1838
|
-
// sem link/url no retorno do IS na multi-lib produtos PDC
|
|
1839
|
-
image_url: (_E = resizeVtexImage2((_D = item == null ? void 0 : item.image) == null ? void 0 : _D[0].url)) != null ? _E : null,
|
|
1840
|
-
seller_id: sellerId != null ? sellerId : null,
|
|
1841
|
-
item_list_name: (_F = item.item_list_name) != null ? _F : null
|
|
1842
|
-
};
|
|
1843
|
-
});
|
|
1844
|
-
}
|
|
1845
|
-
return null;
|
|
1846
|
-
},
|
|
1847
|
-
value: (context) => {
|
|
1848
|
-
if (context == null ? void 0 : context.value) return context.value;
|
|
1849
|
-
if (context == null ? void 0 : context.products) {
|
|
1850
|
-
return context.products.map((item) => item.offers.lowPrice).filter((price) => price !== void 0).reduce((sum, price) => sum + price, 0);
|
|
1851
|
-
}
|
|
1852
|
-
return null;
|
|
1853
|
-
},
|
|
1854
|
-
line_items: (context) => {
|
|
1855
|
-
if (context == null ? void 0 : context.line_items) return context.line_items;
|
|
1856
|
-
if (context == null ? void 0 : context.products) {
|
|
1857
|
-
return context.products.map((item) => item.id).filter((id) => Boolean(id)).join();
|
|
1858
|
-
}
|
|
1859
|
-
return null;
|
|
1860
|
-
},
|
|
1861
|
-
brand: (context, config2) => {
|
|
1862
|
-
if (config2 == null ? void 0 : config2.brand) return config2.brand;
|
|
1863
|
-
if (context == null ? void 0 : context.brand) return context.brand;
|
|
1864
|
-
if (context == null ? void 0 : context.products) {
|
|
1865
|
-
return context.products.map((p) => p.brand.name).join().trim();
|
|
1866
|
-
}
|
|
1867
|
-
return null;
|
|
1868
|
-
}
|
|
1869
|
-
};
|
|
1870
|
-
|
|
1871
|
-
// src/params/adapters/animale/index.ts
|
|
1872
|
-
var animaleAdapter = {
|
|
1873
|
-
...metaAdapter,
|
|
1874
|
-
// global adapters
|
|
1875
|
-
brand: (context, config2) => {
|
|
1876
|
-
if (context.zone === "PDP") {
|
|
1877
|
-
return AnimalePdpZone.brand(context, config2);
|
|
1878
|
-
}
|
|
1879
|
-
if (context.zone === "PDC") {
|
|
1880
|
-
return AnimalePdcZone.brand(context, config2);
|
|
1881
|
-
}
|
|
1882
|
-
return null;
|
|
1883
|
-
},
|
|
1884
|
-
line_items: (context) => {
|
|
1885
|
-
if (context.zone === "PDP") {
|
|
1886
|
-
return AnimalePdpZone.line_items(context);
|
|
1887
|
-
}
|
|
1888
|
-
if (context.zone === "PDC") {
|
|
1889
|
-
return AnimalePdcZone.line_items(context);
|
|
1890
|
-
}
|
|
1891
|
-
return null;
|
|
1892
|
-
},
|
|
1893
|
-
value: (context) => {
|
|
1894
|
-
if (context.zone === "PDP") {
|
|
1895
|
-
return AnimalePdpZone.value(context);
|
|
1896
|
-
}
|
|
1897
|
-
if (context.zone === "PDC") {
|
|
1898
|
-
return AnimalePdcZone.value(context);
|
|
1899
|
-
}
|
|
1900
|
-
return null;
|
|
1901
|
-
},
|
|
1902
|
-
items: (context) => {
|
|
1903
|
-
if (context.zone === "PDP") {
|
|
1904
|
-
return AnimalePdpZone.items(context);
|
|
1905
|
-
}
|
|
1906
|
-
if (context.zone === "PDC") {
|
|
1907
|
-
return AnimalePdcZone.items(context);
|
|
1908
|
-
}
|
|
1909
|
-
},
|
|
1910
|
-
// param used only in one Zone, the PDP; no need condition
|
|
1911
|
-
available_grid: (context) => {
|
|
1912
|
-
if (context == null ? void 0 : context.available_grid) return context.available_grid;
|
|
1913
|
-
if (context == null ? void 0 : context.products) {
|
|
1914
|
-
const sizes = context.products.flatMap(
|
|
1915
|
-
(p) => {
|
|
1916
|
-
var _a, _b;
|
|
1917
|
-
return ((_b = (_a = p == null ? void 0 : p.isVariantOf) == null ? void 0 : _a.hasVariant) != null ? _b : []).flatMap((variant) => {
|
|
1918
|
-
var _a2, _b2, _c, _d;
|
|
1919
|
-
const available = (_b2 = (_a2 = variant == null ? void 0 : variant.offers) == null ? void 0 : _a2.offers) == null ? void 0 : _b2.some((o) => isInStock(o == null ? void 0 : o.availability));
|
|
1920
|
-
const size = (_d = (_c = variant == null ? void 0 : variant.additionalProperty) == null ? void 0 : _c.find((prop) => (prop == null ? void 0 : prop.name) === "Tamanho")) == null ? void 0 : _d.value;
|
|
1921
|
-
return available && size ? [size] : [];
|
|
1922
|
-
});
|
|
1923
|
-
}
|
|
1924
|
-
);
|
|
1925
|
-
const result = sortSizes(sizes).join(",");
|
|
1926
|
-
return result || null;
|
|
1927
|
-
}
|
|
1928
|
-
return null;
|
|
1929
|
-
}
|
|
1930
|
-
};
|
|
1931
|
-
|
|
1932
1718
|
// src/params/adapters/headless/utils.ts
|
|
1933
|
-
var
|
|
1719
|
+
var getItemCategory6 = (item) => {
|
|
1934
1720
|
const keywords = ["outlet", "bazar", "sale"];
|
|
1935
1721
|
const regex = new RegExp(keywords.join("|"), "i");
|
|
1936
1722
|
const value = item == null ? void 0 : item.categories;
|
|
@@ -1943,7 +1729,7 @@ var getItemCategory7 = (item) => {
|
|
|
1943
1729
|
}
|
|
1944
1730
|
return "Cole\xE7\xE3o";
|
|
1945
1731
|
};
|
|
1946
|
-
var
|
|
1732
|
+
var getItemCategory24 = (item) => {
|
|
1947
1733
|
var _a, _b, _c;
|
|
1948
1734
|
const avoidList = /outlet|bazar|sale/i;
|
|
1949
1735
|
const lastCategory = (_b = (_a = item.categories) == null ? void 0 : _a[item.categories.length - 1]) != null ? _b : "";
|
|
@@ -1973,8 +1759,8 @@ var HeadlessPdpZone = {
|
|
|
1973
1759
|
item_variant2: (_k = (_j = (_i = item.items[0]) == null ? void 0 : _i.name) == null ? void 0 : _j.split(" - ")[1]) != null ? _k : null,
|
|
1974
1760
|
item_ref: (_l = item.productReference) != null ? _l : null,
|
|
1975
1761
|
// sem ref no retorno do IS na multi-lib produtos PDC
|
|
1976
|
-
item_category:
|
|
1977
|
-
item_category2: (_m =
|
|
1762
|
+
item_category: getItemCategory6(item),
|
|
1763
|
+
item_category2: (_m = getItemCategory24(item)) != null ? _m : null,
|
|
1978
1764
|
item_id: (_n = item == null ? void 0 : item.productId) != null ? _n : null,
|
|
1979
1765
|
item_sku: (_p = (_o = item.items) == null ? void 0 : _o[0].itemId) != null ? _p : null,
|
|
1980
1766
|
item_url: (_q = item.link) != null ? _q : null,
|
|
@@ -2035,8 +1821,8 @@ var HeadlessPdcZone = {
|
|
|
2035
1821
|
item_variant2: (_i = (_h = ((_g = item.additionalProperty) != null ? _g : []).find((p) => p.name === "Tamanho")) == null ? void 0 : _h.value) != null ? _i : null,
|
|
2036
1822
|
item_ref: null,
|
|
2037
1823
|
// sem ref no retorno do IS na multi-lib produtos PDC
|
|
2038
|
-
item_category:
|
|
2039
|
-
item_category2: (_j =
|
|
1824
|
+
item_category: getItemCategory6(item),
|
|
1825
|
+
item_category2: (_j = getItemCategory24(item)) != null ? _j : null,
|
|
2040
1826
|
item_id: (_k = item.isVariantOf.productGroupID) != null ? _k : null,
|
|
2041
1827
|
item_sku: (_l = item.sku) != null ? _l : null,
|
|
2042
1828
|
item_url: null,
|
|
@@ -2182,7 +1968,7 @@ var getOrderFormItems = (orderForm) => {
|
|
|
2182
1968
|
return { ...i, quantity: 1 };
|
|
2183
1969
|
}) : orderForm.items;
|
|
2184
1970
|
};
|
|
2185
|
-
var
|
|
1971
|
+
var getItemCategory7 = (item) => {
|
|
2186
1972
|
var _a;
|
|
2187
1973
|
const categories = item == null ? void 0 : item.productCategories;
|
|
2188
1974
|
if (!categories) return "Cole\xE7\xE3o";
|
|
@@ -2190,11 +1976,11 @@ var getItemCategory8 = (item) => {
|
|
|
2190
1976
|
const match = (_a = text.match(/outlet|bazar|sale/i)) == null ? void 0 : _a[0].toLowerCase();
|
|
2191
1977
|
return match != null ? match : "Cole\xE7\xE3o";
|
|
2192
1978
|
};
|
|
2193
|
-
var
|
|
1979
|
+
var getItemCategory25 = (item) => {
|
|
2194
1980
|
var _a, _b;
|
|
2195
|
-
const
|
|
1981
|
+
const AVOID_CATEGORIES = /outlet|bazar|sale|coleção|promoção/i;
|
|
2196
1982
|
const categories = Object.values((_a = item == null ? void 0 : item.productCategories) != null ? _a : {});
|
|
2197
|
-
const validHierarchy = categories.map((c) => c.trim()).filter((c) => c && !
|
|
1983
|
+
const validHierarchy = categories.map((c) => c.trim()).filter((c) => c && !AVOID_CATEGORIES.test(c));
|
|
2198
1984
|
const deepest = (_b = validHierarchy[validHierarchy.length - 1]) != null ? _b : "";
|
|
2199
1985
|
return capitalize(deepest);
|
|
2200
1986
|
};
|
|
@@ -2245,8 +2031,8 @@ var orderFormAdapter = {
|
|
|
2245
2031
|
item_variant2: (_m = size == null ? void 0 : size.toUpperCase()) != null ? _m : null,
|
|
2246
2032
|
item_shipping_tier: getItemShippingTier2(context.orderForm, item),
|
|
2247
2033
|
item_ref: (item == null ? void 0 : item.productRefId) || (item == null ? void 0 : item.refId.replace(/_\d+$/, "")) || null,
|
|
2248
|
-
item_category: (_n =
|
|
2249
|
-
item_category2: (_o =
|
|
2034
|
+
item_category: (_n = getItemCategory7(item)) != null ? _n : null,
|
|
2035
|
+
item_category2: (_o = getItemCategory25(item)) != null ? _o : null,
|
|
2250
2036
|
item_id: (_p = item == null ? void 0 : item.productId) != null ? _p : null,
|
|
2251
2037
|
item_sku: (_q = item == null ? void 0 : item.id) != null ? _q : null,
|
|
2252
2038
|
item_url: (_r = item.detailUrl) != null ? _r : null,
|
|
@@ -2388,8 +2174,7 @@ var orderFormAdapter = {
|
|
|
2388
2174
|
return couponMessages.map((msg) => msg.text).join(" | ");
|
|
2389
2175
|
},
|
|
2390
2176
|
coupon: (context) => {
|
|
2391
|
-
|
|
2392
|
-
return context.appliedCoupon || ((_b = (_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.marketingData) == null ? void 0 : _b.coupon) || null;
|
|
2177
|
+
return context.appliedCoupon || null;
|
|
2393
2178
|
},
|
|
2394
2179
|
seller_cod_name: (context) => {
|
|
2395
2180
|
return context.appliedSellerCodName || null;
|
|
@@ -2491,8 +2276,7 @@ var adapters = {
|
|
|
2491
2276
|
HEADLESS: headlessAdapter,
|
|
2492
2277
|
PICKUP: pickupAdapter,
|
|
2493
2278
|
ORDERFORM: orderFormAdapter,
|
|
2494
|
-
META: metaAdapter
|
|
2495
|
-
ANIMALE: animaleAdapter
|
|
2279
|
+
META: metaAdapter
|
|
2496
2280
|
};
|
|
2497
2281
|
async function getParameters(context, eventName, config2) {
|
|
2498
2282
|
var _a;
|
|
@@ -2536,7 +2320,7 @@ async function trackWebEvent(event, context) {
|
|
|
2536
2320
|
}
|
|
2537
2321
|
if (isDebugMode()) {
|
|
2538
2322
|
console.log(
|
|
2539
|
-
`%c [DT v2
|
|
2323
|
+
`%c [DT v2] %c ${event} `,
|
|
2540
2324
|
"background: #6366f1; color: #fff; font-weight: bold; padding: 2px 6px; border-radius: 4px 0 0 4px;",
|
|
2541
2325
|
"background: #1e1e2e; color: #a5b4fc; font-weight: bold; padding: 2px 6px; border-radius: 0 4px 4px 0;",
|
|
2542
2326
|
{ context, parameters }
|