@getlupa/client 1.12.10 → 1.13.0
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/lupaSearch.iife.js +1299 -1022
- package/dist/lupaSearch.js +1234 -957
- package/dist/lupaSearch.mjs +1234 -957
- package/dist/lupaSearch.umd.js +1309 -1032
- package/dist/src/index.d.ts +29 -7
- package/dist/src/modules/pluginManager/PluginConfigurationManager.d.ts +12 -0
- package/dist/src/mounting.d.ts +23 -0
- package/dist/src/utils/storage.utils.d.ts +4 -0
- package/dist/src/utils/url.utils.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/lupaSearch.js
CHANGED
|
@@ -1,23 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
2
|
+
var __defProp2 = Object.defineProperty;
|
|
3
|
+
var __defProps2 = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues2 = (a, b) => {
|
|
10
10
|
for (var prop in b || (b = {}))
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
for (var prop of
|
|
15
|
-
if (
|
|
16
|
-
|
|
11
|
+
if (__hasOwnProp2.call(b, prop))
|
|
12
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols2)
|
|
14
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
15
|
+
if (__propIsEnum2.call(b, prop))
|
|
16
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
17
17
|
}
|
|
18
18
|
return a;
|
|
19
19
|
};
|
|
20
|
-
var
|
|
20
|
+
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
21
|
+
var __async2 = (__this, __arguments, generator) => {
|
|
22
|
+
return new Promise((resolve2, reject) => {
|
|
23
|
+
var fulfilled = (value) => {
|
|
24
|
+
try {
|
|
25
|
+
step(generator.next(value));
|
|
26
|
+
} catch (e2) {
|
|
27
|
+
reject(e2);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var rejected = (value) => {
|
|
31
|
+
try {
|
|
32
|
+
step(generator.throw(value));
|
|
33
|
+
} catch (e2) {
|
|
34
|
+
reject(e2);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
38
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
39
|
+
});
|
|
40
|
+
};
|
|
21
41
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
22
42
|
function makeMap(str, expectsLowerCase) {
|
|
23
43
|
const map = /* @__PURE__ */ Object.create(null);
|
|
@@ -6303,7 +6323,7 @@ function ensureRenderer() {
|
|
|
6303
6323
|
}
|
|
6304
6324
|
const createApp = (...args) => {
|
|
6305
6325
|
const app2 = ensureRenderer().createApp(...args);
|
|
6306
|
-
const { mount } = app2;
|
|
6326
|
+
const { mount: mount2 } = app2;
|
|
6307
6327
|
app2.mount = (containerOrSelector) => {
|
|
6308
6328
|
const container = normalizeContainer(containerOrSelector);
|
|
6309
6329
|
if (!container)
|
|
@@ -6313,7 +6333,7 @@ const createApp = (...args) => {
|
|
|
6313
6333
|
component.template = container.innerHTML;
|
|
6314
6334
|
}
|
|
6315
6335
|
container.innerHTML = "";
|
|
6316
|
-
const proxy =
|
|
6336
|
+
const proxy = mount2(container, false, container instanceof SVGElement);
|
|
6317
6337
|
if (container instanceof Element) {
|
|
6318
6338
|
container.removeAttribute("v-cloak");
|
|
6319
6339
|
container.setAttribute("data-v-app", "");
|
|
@@ -6329,25 +6349,25 @@ function normalizeContainer(container) {
|
|
|
6329
6349
|
}
|
|
6330
6350
|
return container;
|
|
6331
6351
|
}
|
|
6332
|
-
var
|
|
6333
|
-
var
|
|
6334
|
-
var
|
|
6335
|
-
var
|
|
6336
|
-
var
|
|
6337
|
-
var
|
|
6338
|
-
var
|
|
6339
|
-
var
|
|
6352
|
+
var __defProp = Object.defineProperty;
|
|
6353
|
+
var __defProps = Object.defineProperties;
|
|
6354
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6355
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6356
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6357
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6358
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6359
|
+
var __spreadValues = (a, b) => {
|
|
6340
6360
|
for (var prop in b || (b = {}))
|
|
6341
|
-
if (
|
|
6342
|
-
|
|
6343
|
-
if (
|
|
6344
|
-
for (var prop of
|
|
6345
|
-
if (
|
|
6346
|
-
|
|
6361
|
+
if (__hasOwnProp.call(b, prop))
|
|
6362
|
+
__defNormalProp(a, prop, b[prop]);
|
|
6363
|
+
if (__getOwnPropSymbols)
|
|
6364
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
6365
|
+
if (__propIsEnum.call(b, prop))
|
|
6366
|
+
__defNormalProp(a, prop, b[prop]);
|
|
6347
6367
|
}
|
|
6348
6368
|
return a;
|
|
6349
6369
|
};
|
|
6350
|
-
var
|
|
6370
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
6351
6371
|
var __async = (__this, __arguments, generator) => {
|
|
6352
6372
|
return new Promise((resolve2, reject) => {
|
|
6353
6373
|
var fulfilled = (value) => {
|
|
@@ -6813,14 +6833,14 @@ var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _argumen
|
|
|
6813
6833
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6814
6834
|
});
|
|
6815
6835
|
};
|
|
6816
|
-
const defaultConfig
|
|
6836
|
+
const defaultConfig = {
|
|
6817
6837
|
method: "POST",
|
|
6818
6838
|
headers: { "Content-Type": "application/json" }
|
|
6819
6839
|
};
|
|
6820
6840
|
const customRequestConfig = ({ customHeaders }) => {
|
|
6821
6841
|
return {
|
|
6822
|
-
method: defaultConfig
|
|
6823
|
-
headers: Object.assign(Object.assign({}, defaultConfig
|
|
6842
|
+
method: defaultConfig.method,
|
|
6843
|
+
headers: Object.assign(Object.assign({}, defaultConfig.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
|
|
6824
6844
|
};
|
|
6825
6845
|
};
|
|
6826
6846
|
const searchCustom = (query, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -6844,7 +6864,7 @@ const suggestCustom = (query, options) => __awaiter(void 0, void 0, void 0, func
|
|
|
6844
6864
|
return { success: false, errors };
|
|
6845
6865
|
});
|
|
6846
6866
|
const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6847
|
-
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig
|
|
6867
|
+
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
6848
6868
|
if (res.status < 400) {
|
|
6849
6869
|
const data = yield res.json();
|
|
6850
6870
|
return Object.assign(Object.assign({}, data), { success: true });
|
|
@@ -6854,7 +6874,7 @@ const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0
|
|
|
6854
6874
|
});
|
|
6855
6875
|
const queryByIds = (queryKey, ids, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6856
6876
|
const idParam = ids.map((id) => `ids=${id}`).join("&");
|
|
6857
|
-
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig
|
|
6877
|
+
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
|
|
6858
6878
|
if (res.status < 400) {
|
|
6859
6879
|
const data = yield res.json();
|
|
6860
6880
|
return Object.assign(Object.assign({}, data), { success: true });
|
|
@@ -6867,7 +6887,7 @@ const recommendForSingleId = (queryKey, recommendForId, filters, environment, cu
|
|
|
6867
6887
|
if (filters) {
|
|
6868
6888
|
url += `&${e({ filters })}`;
|
|
6869
6889
|
}
|
|
6870
|
-
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig
|
|
6890
|
+
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
|
|
6871
6891
|
if (res.status < 400) {
|
|
6872
6892
|
const data = yield res.json();
|
|
6873
6893
|
return Object.assign(Object.assign({}, data), { success: true });
|
|
@@ -6881,7 +6901,7 @@ const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment
|
|
|
6881
6901
|
if (filters) {
|
|
6882
6902
|
url += `&${e({ filters })}`;
|
|
6883
6903
|
}
|
|
6884
|
-
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig
|
|
6904
|
+
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
|
|
6885
6905
|
if (res.status < 400) {
|
|
6886
6906
|
const data = yield res.json();
|
|
6887
6907
|
return Object.assign(Object.assign({}, data), { success: true });
|
|
@@ -6893,7 +6913,7 @@ const recommend = (queryKey, recommendForId, filters, environment, customBaseUrl
|
|
|
6893
6913
|
return Array.isArray(recommendForId) ? yield recommendForMultipleIds(queryKey, recommendForId, filters, environment, customBaseUrl) : yield recommendForSingleId(queryKey, recommendForId, filters, environment, customBaseUrl);
|
|
6894
6914
|
});
|
|
6895
6915
|
const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6896
|
-
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig
|
|
6916
|
+
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
6897
6917
|
if (res.status < 400) {
|
|
6898
6918
|
const items = yield res.json();
|
|
6899
6919
|
return { items, success: true };
|
|
@@ -6903,7 +6923,7 @@ const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void
|
|
|
6903
6923
|
});
|
|
6904
6924
|
const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6905
6925
|
try {
|
|
6906
|
-
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig
|
|
6926
|
+
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
|
|
6907
6927
|
if (res.status < 400) {
|
|
6908
6928
|
return { success: false };
|
|
6909
6929
|
}
|
|
@@ -6913,7 +6933,7 @@ const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void
|
|
|
6913
6933
|
}
|
|
6914
6934
|
});
|
|
6915
6935
|
const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6916
|
-
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig
|
|
6936
|
+
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
|
|
6917
6937
|
if (res.status < 400) {
|
|
6918
6938
|
return res.json();
|
|
6919
6939
|
}
|
|
@@ -7245,13 +7265,13 @@ const sendGa4AnalyticsEvent = (data, options) => {
|
|
|
7245
7265
|
}
|
|
7246
7266
|
const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
|
|
7247
7267
|
const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
|
|
7248
|
-
const params =
|
|
7268
|
+
const params = __spreadValues({
|
|
7249
7269
|
search_text: data.searchQuery,
|
|
7250
7270
|
item_title: title,
|
|
7251
7271
|
item_id: data.itemId,
|
|
7252
7272
|
ecommerce: parseEcommerceData(data, (_c = data.analytics) == null ? void 0 : _c.listLabel)
|
|
7253
7273
|
}, (_e = (_d = data.analytics) == null ? void 0 : _d.additionalParams) != null ? _e : {});
|
|
7254
|
-
window.dataLayer.push(
|
|
7274
|
+
window.dataLayer.push(__spreadValues({
|
|
7255
7275
|
event: (_g = (_f = data.analytics) == null ? void 0 : _f.type) != null ? _g : options.parentEventName
|
|
7256
7276
|
}, params));
|
|
7257
7277
|
};
|
|
@@ -7429,15 +7449,21 @@ const DEFAULT_OPTIONS_RESULTS$1 = {
|
|
|
7429
7449
|
breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
|
|
7430
7450
|
};
|
|
7431
7451
|
const useScreenStore = defineStore("screen", () => {
|
|
7432
|
-
const
|
|
7452
|
+
const measuredScreenWidth = ref(1e3);
|
|
7433
7453
|
const optionsStore = useOptionsStore();
|
|
7454
|
+
const screenWidth = computed(() => {
|
|
7455
|
+
var _a, _b;
|
|
7456
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
7457
|
+
return (_b = (_a = searchResultOptions.value.grid) == null ? void 0 : _a.forcedScreenWidth) != null ? _b : measuredScreenWidth.value;
|
|
7458
|
+
});
|
|
7434
7459
|
const configuredGridSizes = computed(() => {
|
|
7435
7460
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
7461
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
7436
7462
|
return {
|
|
7437
|
-
smMin: (_d = (_c = (_b = (_a =
|
|
7438
|
-
mdMin: (_h = (_g = (_f = (_e =
|
|
7439
|
-
lMin: (_l = (_k = (_j = (_i =
|
|
7440
|
-
xlMin: (_p = (_o = (_n = (_m =
|
|
7463
|
+
smMin: (_d = (_c = (_b = (_a = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a.grid) == null ? void 0 : _b.sizes) == null ? void 0 : _c.sm) != null ? _d : S_MIN_WIDTH,
|
|
7464
|
+
mdMin: (_h = (_g = (_f = (_e = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _e.grid) == null ? void 0 : _f.sizes) == null ? void 0 : _g.md) != null ? _h : MD_MIN_WIDTH,
|
|
7465
|
+
lMin: (_l = (_k = (_j = (_i = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _i.grid) == null ? void 0 : _j.sizes) == null ? void 0 : _k.l) != null ? _l : L_MIN_WIDTH,
|
|
7466
|
+
xlMin: (_p = (_o = (_n = (_m = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _m.grid) == null ? void 0 : _n.sizes) == null ? void 0 : _o.xl) != null ? _p : XL_MIN_WIDTH
|
|
7441
7467
|
};
|
|
7442
7468
|
});
|
|
7443
7469
|
const currentScreenWidth = computed(() => {
|
|
@@ -7459,7 +7485,7 @@ const useScreenStore = defineStore("screen", () => {
|
|
|
7459
7485
|
return (_a = ["xs", "sm"]) == null ? void 0 : _a.includes(currentScreenWidth.value);
|
|
7460
7486
|
});
|
|
7461
7487
|
const setScreenWidth = ({ width }) => {
|
|
7462
|
-
|
|
7488
|
+
measuredScreenWidth.value = width;
|
|
7463
7489
|
};
|
|
7464
7490
|
return { screenWidth, currentScreenWidth, isMobileWidth, setScreenWidth };
|
|
7465
7491
|
});
|
|
@@ -7739,7 +7765,7 @@ const unfoldFilters = (filters, price = {}) => {
|
|
|
7739
7765
|
const getLabeledFilters = (filters, facets) => {
|
|
7740
7766
|
return filters.map((f2) => {
|
|
7741
7767
|
var _a, _b;
|
|
7742
|
-
return
|
|
7768
|
+
return __spreadProps(__spreadValues({}, f2), {
|
|
7743
7769
|
label: (_b = (_a = facets == null ? void 0 : facets.find((ft) => ft.key === f2.key)) == null ? void 0 : _a.label) != null ? _b : capitalize$1(f2.key)
|
|
7744
7770
|
});
|
|
7745
7771
|
});
|
|
@@ -7767,7 +7793,7 @@ const recursiveFilterItem = (item, query = "") => {
|
|
|
7767
7793
|
}
|
|
7768
7794
|
const children = recursiveFilter(item.children, query).filter(Boolean);
|
|
7769
7795
|
const include = children.length > 0 || filterable;
|
|
7770
|
-
return include ?
|
|
7796
|
+
return include ? __spreadProps(__spreadValues({}, item), {
|
|
7771
7797
|
children
|
|
7772
7798
|
}) : void 0;
|
|
7773
7799
|
};
|
|
@@ -7849,7 +7875,7 @@ const parseFacetKeys = (facetKeys, searchParams) => {
|
|
|
7849
7875
|
params.filters = {};
|
|
7850
7876
|
for (const key of facetKeys) {
|
|
7851
7877
|
const parsedKey = key.slice(key.indexOf(FACET_KEY_SEPARATOR) + 1);
|
|
7852
|
-
params.filters =
|
|
7878
|
+
params.filters = __spreadProps(__spreadValues({}, params.filters), {
|
|
7853
7879
|
[parsedKey]: parseFacetKey(key, searchParams)
|
|
7854
7880
|
});
|
|
7855
7881
|
}
|
|
@@ -7862,7 +7888,7 @@ const parseParams = (getQueryParamName, searchParams) => {
|
|
|
7862
7888
|
const paramKeys = Array.from(searchParams.keys());
|
|
7863
7889
|
const facetKeys = paramKeys.filter((k) => isFacetKey(k));
|
|
7864
7890
|
const regularKeys = paramKeys.filter((k) => !isFacetKey(k));
|
|
7865
|
-
const r =
|
|
7891
|
+
const r = __spreadValues(__spreadValues({
|
|
7866
7892
|
[QUERY_PARAMS_PARSED.QUERY]: ""
|
|
7867
7893
|
}, parseRegularKeys(regularKeys, searchParams, getQueryParamName)), parseFacetKeys(facetKeys, searchParams));
|
|
7868
7894
|
return r;
|
|
@@ -7912,7 +7938,7 @@ const encodeParam = (param) => {
|
|
|
7912
7938
|
const encoded = encodeURIComponent(param);
|
|
7913
7939
|
return encoded.replace(/%C4%85/g, "ą").replace(/%C4%8D/g, "č").replace(/%C4%99/g, "ę").replace(/%C4%97/g, "ė").replace(/%C4%AF/g, "į").replace(/%C5%A1/g, "š").replace(/%C5%B3/g, "ų").replace(/%C5%AB/g, "ū").replace(/%C5%BE/g, "ž").replace(/%20/g, " ");
|
|
7914
7940
|
};
|
|
7915
|
-
const getQueryParam = (name) => {
|
|
7941
|
+
const getQueryParam$1 = (name) => {
|
|
7916
7942
|
try {
|
|
7917
7943
|
const urlParams = new URLSearchParams(window.location.search);
|
|
7918
7944
|
return urlParams.get(name);
|
|
@@ -8052,7 +8078,7 @@ const CACHE_KEY = "lupasearch-client-redirections";
|
|
|
8052
8078
|
const useRedirectionStore = defineStore("redirections", () => {
|
|
8053
8079
|
const redirections = ref({ rules: [] });
|
|
8054
8080
|
const redirectionOptions = ref({ enabled: false, queryKey: "" });
|
|
8055
|
-
const
|
|
8081
|
+
const saveToLocalStorage2 = () => {
|
|
8056
8082
|
try {
|
|
8057
8083
|
localStorage.setItem(
|
|
8058
8084
|
CACHE_KEY,
|
|
@@ -8061,7 +8087,7 @@ const useRedirectionStore = defineStore("redirections", () => {
|
|
|
8061
8087
|
} catch (e2) {
|
|
8062
8088
|
}
|
|
8063
8089
|
};
|
|
8064
|
-
const
|
|
8090
|
+
const tryLoadFromLocalStorage2 = (config) => {
|
|
8065
8091
|
var _a;
|
|
8066
8092
|
if (!config.cacheSeconds)
|
|
8067
8093
|
return false;
|
|
@@ -8084,7 +8110,7 @@ const useRedirectionStore = defineStore("redirections", () => {
|
|
|
8084
8110
|
if (!(config == null ? void 0 : config.enabled)) {
|
|
8085
8111
|
return;
|
|
8086
8112
|
}
|
|
8087
|
-
const loaded =
|
|
8113
|
+
const loaded = tryLoadFromLocalStorage2(config);
|
|
8088
8114
|
if (loaded || ((_c = (_b = redirections.value) == null ? void 0 : _b.rules) == null ? void 0 : _c.length) > 0) {
|
|
8089
8115
|
return;
|
|
8090
8116
|
}
|
|
@@ -8094,7 +8120,7 @@ const useRedirectionStore = defineStore("redirections", () => {
|
|
|
8094
8120
|
return;
|
|
8095
8121
|
}
|
|
8096
8122
|
redirections.value = result;
|
|
8097
|
-
|
|
8123
|
+
saveToLocalStorage2();
|
|
8098
8124
|
} catch (e2) {
|
|
8099
8125
|
}
|
|
8100
8126
|
});
|
|
@@ -8220,12 +8246,12 @@ const useParamsStore = defineStore("params", () => {
|
|
|
8220
8246
|
return;
|
|
8221
8247
|
}
|
|
8222
8248
|
const forceFullReload = (_a = optionsStore.searchBoxOptions.forceFullReloadOnParams) == null ? void 0 : _a.some(
|
|
8223
|
-
(p2) => getQueryParam(p2)
|
|
8249
|
+
(p2) => getQueryParam$1(p2)
|
|
8224
8250
|
);
|
|
8225
8251
|
if ((!searchResultsLink.value || linksMatch(searchResultsLink.value, window.location.pathname)) && !forceFullReload) {
|
|
8226
8252
|
const singleFacetParam = facet ? getFacetParam(facet.key, [facet.title]) : void 0;
|
|
8227
8253
|
const facetParam = singleFacetParam ? [
|
|
8228
|
-
|
|
8254
|
+
__spreadProps(__spreadValues({}, singleFacetParam), {
|
|
8229
8255
|
value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
|
|
8230
8256
|
})
|
|
8231
8257
|
] : [];
|
|
@@ -8314,7 +8340,7 @@ const flattenFacet = (key, facets, suggestion, inputValue) => {
|
|
|
8314
8340
|
displayHighlight: getHint(suggestion.suggestion, inputValue != null ? inputValue : ""),
|
|
8315
8341
|
display: suggestion.suggestion,
|
|
8316
8342
|
suggestion,
|
|
8317
|
-
facet:
|
|
8343
|
+
facet: __spreadValues({
|
|
8318
8344
|
key
|
|
8319
8345
|
}, f2)
|
|
8320
8346
|
}));
|
|
@@ -8421,14 +8447,14 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
8421
8447
|
const context = getLupaTrackingContext();
|
|
8422
8448
|
const result = yield LupaSearchSdk.suggestions(
|
|
8423
8449
|
queryKey,
|
|
8424
|
-
|
|
8450
|
+
__spreadValues(__spreadValues({}, publicQuery), context),
|
|
8425
8451
|
options2
|
|
8426
8452
|
);
|
|
8427
8453
|
if (!result.success) {
|
|
8428
8454
|
return { suggestions: void 0 };
|
|
8429
8455
|
}
|
|
8430
8456
|
highlightChange({ action: "clear" });
|
|
8431
|
-
suggestionResults.value =
|
|
8457
|
+
suggestionResults.value = __spreadProps(__spreadValues({}, suggestionResults.value), {
|
|
8432
8458
|
[queryKey]: flattenSuggestions(result.items, (_a = publicQuery.searchText) != null ? _a : "")
|
|
8433
8459
|
});
|
|
8434
8460
|
inputValue.value = publicQuery.searchText;
|
|
@@ -8465,12 +8491,12 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
8465
8491
|
}) {
|
|
8466
8492
|
try {
|
|
8467
8493
|
const context = getLupaTrackingContext();
|
|
8468
|
-
const result = yield LupaSearchSdk.query(queryKey,
|
|
8494
|
+
const result = yield LupaSearchSdk.query(queryKey, __spreadValues(__spreadValues({}, publicQuery), context), options2);
|
|
8469
8495
|
if (!result.success) {
|
|
8470
8496
|
return { queryKey, result: { items: [] } };
|
|
8471
8497
|
}
|
|
8472
8498
|
highlightChange({ action: "clear" });
|
|
8473
|
-
docResults.value =
|
|
8499
|
+
docResults.value = __spreadProps(__spreadValues({}, docResults.value), { [queryKey]: result });
|
|
8474
8500
|
emitSearchResultsCallback();
|
|
8475
8501
|
return { queryKey, result };
|
|
8476
8502
|
} catch (err) {
|
|
@@ -8572,7 +8598,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
|
|
|
8572
8598
|
);
|
|
8573
8599
|
const inputAttributes = computed(() => {
|
|
8574
8600
|
var _a;
|
|
8575
|
-
return
|
|
8601
|
+
return __spreadValues({}, (_a = props.options.inputAttributes) != null ? _a : {});
|
|
8576
8602
|
});
|
|
8577
8603
|
const ariaLabel = computed(() => {
|
|
8578
8604
|
var _a;
|
|
@@ -9060,7 +9086,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
9060
9086
|
if (!requestedIds.length) {
|
|
9061
9087
|
return;
|
|
9062
9088
|
}
|
|
9063
|
-
loadingIds.value = requestedIds.reduce((a, c2) =>
|
|
9089
|
+
loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps(__spreadValues({}, a), { [c2]: true }), {});
|
|
9064
9090
|
loading.value = true;
|
|
9065
9091
|
try {
|
|
9066
9092
|
const dynamicData = dynamicSearchResultData.value || dynamicSearchBoxData.value;
|
|
@@ -9070,10 +9096,10 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
|
|
|
9070
9096
|
const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
|
|
9071
9097
|
const seed = {};
|
|
9072
9098
|
const dynamicDataIdMapValue = dynamicDataResult.reduce(
|
|
9073
|
-
(a, c2) =>
|
|
9099
|
+
(a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
|
|
9074
9100
|
seed
|
|
9075
9101
|
);
|
|
9076
|
-
dynamicDataIdMap.value =
|
|
9102
|
+
dynamicDataIdMap.value = __spreadValues(__spreadValues({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
|
|
9077
9103
|
} finally {
|
|
9078
9104
|
loading.value = false;
|
|
9079
9105
|
loadingIds.value = {};
|
|
@@ -9539,17 +9565,17 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
9539
9565
|
return hasResults.value && ((_a = searchResult.value.offset) != null ? _a : 0) >= totalItems.value;
|
|
9540
9566
|
}
|
|
9541
9567
|
);
|
|
9542
|
-
const setSidebarState = ({ visible }) => {
|
|
9543
|
-
if (
|
|
9568
|
+
const setSidebarState = ({ visible: visible2 }) => {
|
|
9569
|
+
if (visible2) {
|
|
9544
9570
|
disableBodyScroll();
|
|
9545
9571
|
} else {
|
|
9546
9572
|
enableBodyScroll();
|
|
9547
9573
|
}
|
|
9548
|
-
isMobileSidebarVisible.value =
|
|
9574
|
+
isMobileSidebarVisible.value = visible2;
|
|
9549
9575
|
};
|
|
9550
9576
|
const queryFacet = (_0) => __async(void 0, [_0], function* ({ queryKey, facetKey }) {
|
|
9551
9577
|
var _a, _b, _c, _d;
|
|
9552
|
-
const query = { searchText: "", filters:
|
|
9578
|
+
const query = { searchText: "", filters: __spreadValues({}, filters.value) };
|
|
9553
9579
|
const options = (_a = optionsStore.envOptions) != null ? _a : { environment: "production" };
|
|
9554
9580
|
const result = yield LupaSearchSdk.query(queryKey, query, options);
|
|
9555
9581
|
if (!result.success) {
|
|
@@ -9557,8 +9583,8 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
9557
9583
|
}
|
|
9558
9584
|
const facet = (_b = result.facets) == null ? void 0 : _b.find((f2) => f2.key === facetKey);
|
|
9559
9585
|
const facetItems = (_c = facet == null ? void 0 : facet.items) != null ? _c : [];
|
|
9560
|
-
const updatedResult =
|
|
9561
|
-
facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ?
|
|
9586
|
+
const updatedResult = __spreadProps(__spreadValues({}, searchResult.value), {
|
|
9587
|
+
facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps(__spreadValues({}, f2), { items: facetItems }) : f2)
|
|
9562
9588
|
});
|
|
9563
9589
|
searchResult.value = updatedResult;
|
|
9564
9590
|
});
|
|
@@ -9707,7 +9733,7 @@ const __default__$4 = {
|
|
|
9707
9733
|
SearchBoxProductAddToCart: _sfc_main$17
|
|
9708
9734
|
}
|
|
9709
9735
|
};
|
|
9710
|
-
const _sfc_main$16 = /* @__PURE__ */ defineComponent(
|
|
9736
|
+
const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
|
|
9711
9737
|
__name: "SearchBoxProductElement",
|
|
9712
9738
|
props: {
|
|
9713
9739
|
item: {},
|
|
@@ -9749,7 +9775,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
|
|
|
9749
9775
|
return props.item;
|
|
9750
9776
|
}
|
|
9751
9777
|
const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
|
|
9752
|
-
return
|
|
9778
|
+
return __spreadValues(__spreadValues({}, props.item), enhancementData);
|
|
9753
9779
|
});
|
|
9754
9780
|
const isLoadingDynamicData = (id) => {
|
|
9755
9781
|
return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
|
|
@@ -9966,7 +9992,7 @@ const __default__$3 = {
|
|
|
9966
9992
|
ImageBadge: _sfc_main$11
|
|
9967
9993
|
}
|
|
9968
9994
|
};
|
|
9969
|
-
const _sfc_main$10 = /* @__PURE__ */ defineComponent(
|
|
9995
|
+
const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
|
|
9970
9996
|
__name: "SearchResultsBadgeWrapper",
|
|
9971
9997
|
props: {
|
|
9972
9998
|
position: {},
|
|
@@ -9989,7 +10015,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
|
|
|
9989
10015
|
return props.options.product;
|
|
9990
10016
|
}
|
|
9991
10017
|
const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.options.product) == null ? void 0 : _b.id]) != null ? _d : {};
|
|
9992
|
-
return
|
|
10018
|
+
return __spreadValues(__spreadValues({}, props.options.product), enhancementData);
|
|
9993
10019
|
});
|
|
9994
10020
|
const badges = computed(() => {
|
|
9995
10021
|
if (!props.options.elements) {
|
|
@@ -10000,7 +10026,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
|
|
|
10000
10026
|
return !e2.display || e2.display((_a = props.options.product) != null ? _a : {});
|
|
10001
10027
|
}).map((x) => {
|
|
10002
10028
|
var _a;
|
|
10003
|
-
return
|
|
10029
|
+
return __spreadProps(__spreadValues({}, x), {
|
|
10004
10030
|
value: ((_a = enhancedProduct.value) == null ? void 0 : _a[x.key]) || "badge",
|
|
10005
10031
|
product: enhancedProduct.value
|
|
10006
10032
|
});
|
|
@@ -10067,7 +10093,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
|
10067
10093
|
return generateLink((_b = (_a = props.panelOptions.links) == null ? void 0 : _a.details) != null ? _b : "", props.item);
|
|
10068
10094
|
});
|
|
10069
10095
|
const badgeOptions = computed(() => {
|
|
10070
|
-
return
|
|
10096
|
+
return __spreadProps(__spreadValues({}, props.panelOptions.badges), { product: props.item });
|
|
10071
10097
|
});
|
|
10072
10098
|
const imageElements = computed(() => {
|
|
10073
10099
|
var _a, _b;
|
|
@@ -10206,8 +10232,8 @@ const useTrackingStore = defineStore("tracking", () => {
|
|
|
10206
10232
|
const mappedItems = ((_e = trackingOptions.analytics) == null ? void 0 : _e.itemMap) ? items.map(trackingOptions.analytics.itemMap) : items;
|
|
10207
10233
|
track(
|
|
10208
10234
|
queryKey,
|
|
10209
|
-
|
|
10210
|
-
analytics: data.analytics ?
|
|
10235
|
+
__spreadProps(__spreadValues({}, data), {
|
|
10236
|
+
analytics: data.analytics ? __spreadProps(__spreadValues({}, data.analytics), { items: mappedItems }) : void 0,
|
|
10211
10237
|
filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
|
|
10212
10238
|
}),
|
|
10213
10239
|
options
|
|
@@ -10501,7 +10527,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
10501
10527
|
});
|
|
10502
10528
|
const getItemsDebounced = debounce$1(getItems, props.debounce);
|
|
10503
10529
|
const documentPanelOptions = computed(() => {
|
|
10504
|
-
return
|
|
10530
|
+
return __spreadProps(__spreadValues({}, props.panel), {
|
|
10505
10531
|
type: SearchBoxPanelType.DOCUMENT
|
|
10506
10532
|
});
|
|
10507
10533
|
});
|
|
@@ -10549,7 +10575,7 @@ const __default__$2 = {
|
|
|
10549
10575
|
SearchBoxRelatedSourceWrapper: _sfc_main$X
|
|
10550
10576
|
}
|
|
10551
10577
|
};
|
|
10552
|
-
const _sfc_main$W = /* @__PURE__ */ defineComponent(
|
|
10578
|
+
const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
|
|
10553
10579
|
__name: "SearchBoxMainPanel",
|
|
10554
10580
|
props: {
|
|
10555
10581
|
options: {},
|
|
@@ -10861,7 +10887,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10861
10887
|
const elementClass = (_b = (_a2 = e2.target) == null ? void 0 : _a2.className) != null ? _b : "";
|
|
10862
10888
|
const hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
|
|
10863
10889
|
const isOutsideElement = el && !el.contains(e2.target) && !hasLupaClass;
|
|
10864
|
-
if (!isOutsideElement) {
|
|
10890
|
+
if (!isOutsideElement || props.options.keepOpen) {
|
|
10865
10891
|
return;
|
|
10866
10892
|
}
|
|
10867
10893
|
opened.value = false;
|
|
@@ -10880,7 +10906,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10880
10906
|
case "Tab":
|
|
10881
10907
|
if ((_b = (_a2 = suggestedValue == null ? void 0 : suggestedValue.value) == null ? void 0 : _a2.item) == null ? void 0 : _b.suggestion) {
|
|
10882
10908
|
e2.preventDefault();
|
|
10883
|
-
selectSuggestion(
|
|
10909
|
+
selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
|
|
10884
10910
|
}
|
|
10885
10911
|
break;
|
|
10886
10912
|
case "Enter":
|
|
@@ -10929,7 +10955,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
10929
10955
|
};
|
|
10930
10956
|
const selectSuggestion = (inputSuggestion, shouldSearch = false) => {
|
|
10931
10957
|
if (inputSuggestion.item.suggestion) {
|
|
10932
|
-
suggestedValue.value =
|
|
10958
|
+
suggestedValue.value = __spreadProps(__spreadValues({}, inputSuggestion), {
|
|
10933
10959
|
override: true
|
|
10934
10960
|
});
|
|
10935
10961
|
if (inputSuggestion.override) {
|
|
@@ -11027,7 +11053,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
11027
11053
|
opened.value = false;
|
|
11028
11054
|
};
|
|
11029
11055
|
const slotProps = (props2) => {
|
|
11030
|
-
return
|
|
11056
|
+
return __spreadValues({}, props2);
|
|
11031
11057
|
};
|
|
11032
11058
|
return (_ctx, _cache) => {
|
|
11033
11059
|
var _a2;
|
|
@@ -11115,8 +11141,8 @@ const getOffset = (page, limit = 10) => {
|
|
|
11115
11141
|
return (page - 1) * limit;
|
|
11116
11142
|
};
|
|
11117
11143
|
const getPublicQuery = (publicQuery, initialFilters, isProductList) => {
|
|
11118
|
-
return
|
|
11119
|
-
filters:
|
|
11144
|
+
return __spreadProps(__spreadValues({}, publicQuery), {
|
|
11145
|
+
filters: __spreadValues(__spreadValues({}, initialFilters), publicQuery.filters),
|
|
11120
11146
|
searchText: isProductList ? "" : publicQuery.searchText
|
|
11121
11147
|
});
|
|
11122
11148
|
};
|
|
@@ -11667,7 +11693,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
11667
11693
|
return searchResultStore.filterVisibleFilterValues(facet.value.key, (_b = (_a = facet.value) == null ? void 0 : _a.items) != null ? _b : []);
|
|
11668
11694
|
});
|
|
11669
11695
|
const displayValues = computed(() => {
|
|
11670
|
-
return filteredValues.value.slice(0, itemLimit.value).map((v) =>
|
|
11696
|
+
return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps(__spreadValues({}, v), { title: getDisplayValue(v.title) }));
|
|
11671
11697
|
});
|
|
11672
11698
|
const filteredValues = computed(() => {
|
|
11673
11699
|
var _a, _b;
|
|
@@ -12608,7 +12634,7 @@ function h(e2, t) {
|
|
|
12608
12634
|
return e3 === r[t2];
|
|
12609
12635
|
});
|
|
12610
12636
|
}
|
|
12611
|
-
var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props:
|
|
12637
|
+
var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps(__spreadValues({}, { value: { validator: function(e2) {
|
|
12612
12638
|
return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
|
|
12613
12639
|
}, required: false }, modelValue: { validator: function(e2) {
|
|
12614
12640
|
return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
|
|
@@ -12621,15 +12647,15 @@ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide"
|
|
|
12621
12647
|
throw new Error("Slider v-model must not be an empty array");
|
|
12622
12648
|
return { value: l2, initialValue: c3 };
|
|
12623
12649
|
}(a), c2 = function(t, i, n) {
|
|
12624
|
-
const { classes: o, showTooltip: a2, tooltipPosition: s2, orientation: l2 } = toRefs(t), u2 = computed(() =>
|
|
12650
|
+
const { classes: o, showTooltip: a2, tooltipPosition: s2, orientation: l2 } = toRefs(t), u2 = computed(() => __spreadValues({ target: "slider-target", focused: "slider-focused", tooltipFocus: "slider-tooltip-focus", tooltipDrag: "slider-tooltip-drag", ltr: "slider-ltr", rtl: "slider-rtl", horizontal: "slider-horizontal", vertical: "slider-vertical", textDirectionRtl: "slider-txt-dir-rtl", textDirectionLtr: "slider-txt-dir-ltr", base: "slider-base", connects: "slider-connects", connect: "slider-connect", origin: "slider-origin", handle: "slider-handle", handleLower: "slider-handle-lower", handleUpper: "slider-handle-upper", touchArea: "slider-touch-area", tooltip: "slider-tooltip", tooltipTop: "slider-tooltip-top", tooltipBottom: "slider-tooltip-bottom", tooltipLeft: "slider-tooltip-left", tooltipRight: "slider-tooltip-right", tooltipHidden: "slider-tooltip-hidden", active: "slider-active", draggable: "slider-draggable", tap: "slider-state-tap", drag: "slider-state-drag", pips: "slider-pips", pipsHorizontal: "slider-pips-horizontal", pipsVertical: "slider-pips-vertical", marker: "slider-marker", markerHorizontal: "slider-marker-horizontal", markerVertical: "slider-marker-vertical", markerNormal: "slider-marker-normal", markerLarge: "slider-marker-large", markerSub: "slider-marker-sub", value: "slider-value", valueHorizontal: "slider-value-horizontal", valueVertical: "slider-value-vertical", valueNormal: "slider-value-normal", valueLarge: "slider-value-large", valueSub: "slider-value-sub" }, o.value));
|
|
12625
12651
|
return { classList: computed(() => {
|
|
12626
|
-
const e2 =
|
|
12652
|
+
const e2 = __spreadValues({}, u2.value);
|
|
12627
12653
|
return Object.keys(e2).forEach((t2) => {
|
|
12628
12654
|
e2[t2] = Array.isArray(e2[t2]) ? e2[t2].filter((e3) => null !== e3).join(" ") : e2[t2];
|
|
12629
12655
|
}), "always" !== a2.value && (e2.target += ` ${"drag" === a2.value ? e2.tooltipDrag : e2.tooltipFocus}`), "horizontal" === l2.value && (e2.tooltip += "bottom" === s2.value ? ` ${e2.tooltipBottom}` : ` ${e2.tooltipTop}`), "vertical" === l2.value && (e2.tooltip += "right" === s2.value ? ` ${e2.tooltipRight}` : ` ${e2.tooltipLeft}`), e2;
|
|
12630
12656
|
}) };
|
|
12631
12657
|
}(a), p2 = function(t, i, n) {
|
|
12632
|
-
const { format: o, step: a2 } = toRefs(t), s2 = n.value, l2 = n.classList, u2 = computed(() => o && o.value ? "function" == typeof o.value ? { to: o.value } : d(
|
|
12658
|
+
const { format: o, step: a2 } = toRefs(t), s2 = n.value, l2 = n.classList, u2 = computed(() => o && o.value ? "function" == typeof o.value ? { to: o.value } : d(__spreadValues({}, o.value)) : d({ decimals: a2.value >= 0 ? 0 : 2 })), c3 = computed(() => Array.isArray(s2.value) ? s2.value.map((e2) => u2.value) : u2.value);
|
|
12633
12659
|
return { tooltipFormat: u2, tooltipsFormat: c3, tooltipsMerge: (e2, t2, r) => {
|
|
12634
12660
|
var i2 = "rtl" === getComputedStyle(e2).direction, n2 = "rtl" === e2.noUiSlider.options.direction, o2 = "vertical" === e2.noUiSlider.options.orientation, a3 = e2.noUiSlider.getTooltips(), s3 = e2.noUiSlider.getOrigins();
|
|
12635
12661
|
a3.forEach(function(e3, t3) {
|
|
@@ -12722,7 +12748,7 @@ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide"
|
|
|
12722
12748
|
R(V.value);
|
|
12723
12749
|
} };
|
|
12724
12750
|
}(a, s, { value: l.value, initialValue: l.initialValue, tooltipFormat: p2.tooltipFormat, tooltipsFormat: p2.tooltipsFormat, tooltipsMerge: p2.tooltipsMerge, classList: c2.classList });
|
|
12725
|
-
return
|
|
12751
|
+
return __spreadValues(__spreadValues(__spreadValues({}, c2), p2), m2);
|
|
12726
12752
|
} };
|
|
12727
12753
|
m.render = function(e2, t, r, i, n, o) {
|
|
12728
12754
|
return openBlock(), createElementBlock("div", mergeProps(e2.sliderProps, { ref: "slider" }), null, 16);
|
|
@@ -13179,7 +13205,7 @@ const __default__$1 = {
|
|
|
13179
13205
|
HierarchyFacet: _sfc_main$K
|
|
13180
13206
|
}
|
|
13181
13207
|
};
|
|
13182
|
-
const _sfc_main$J = /* @__PURE__ */ defineComponent(
|
|
13208
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
13183
13209
|
__name: "FacetDisplay",
|
|
13184
13210
|
props: {
|
|
13185
13211
|
options: {},
|
|
@@ -13942,6 +13968,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
13942
13968
|
var _a, _b;
|
|
13943
13969
|
return (_b = (_a = props.labels) == null ? void 0 : _a.pageSize) != null ? _b : "";
|
|
13944
13970
|
});
|
|
13971
|
+
const sizes = computed(() => props.options.sizes);
|
|
13945
13972
|
const handleSelect = (e2) => {
|
|
13946
13973
|
const value = e2.target.value;
|
|
13947
13974
|
paramsStore.appendParams({
|
|
@@ -13961,7 +13988,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
13961
13988
|
ref_key: "select",
|
|
13962
13989
|
ref: select
|
|
13963
13990
|
}, [
|
|
13964
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
13991
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(sizes.value, (option) => {
|
|
13965
13992
|
return openBlock(), createElementBlock("option", {
|
|
13966
13993
|
key: option,
|
|
13967
13994
|
value: option
|
|
@@ -14639,7 +14666,7 @@ const __default__ = {
|
|
|
14639
14666
|
SearchResultsProductSingleStarRating: _sfc_main$m
|
|
14640
14667
|
}
|
|
14641
14668
|
};
|
|
14642
|
-
const _sfc_main$l = /* @__PURE__ */ defineComponent(
|
|
14669
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
14643
14670
|
__name: "SearchResultsProductCardElement",
|
|
14644
14671
|
props: {
|
|
14645
14672
|
item: {},
|
|
@@ -14684,7 +14711,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
14684
14711
|
return props.item;
|
|
14685
14712
|
}
|
|
14686
14713
|
const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
|
|
14687
|
-
return
|
|
14714
|
+
return __spreadValues(__spreadValues({}, props.item), enhancementData);
|
|
14688
14715
|
});
|
|
14689
14716
|
const displayElement = computed(() => {
|
|
14690
14717
|
return props.element.display ? props.element.display(enhancedItem.value) : true;
|
|
@@ -14743,7 +14770,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
14743
14770
|
return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
|
|
14744
14771
|
});
|
|
14745
14772
|
const badgesOptions = computed(() => {
|
|
14746
|
-
return
|
|
14773
|
+
return __spreadProps(__spreadValues({}, props.options.badges), { product: props.product });
|
|
14747
14774
|
});
|
|
14748
14775
|
const imageElements = computed(() => {
|
|
14749
14776
|
var _a, _b;
|
|
@@ -15066,7 +15093,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
15066
15093
|
};
|
|
15067
15094
|
const handleQueryChange = () => {
|
|
15068
15095
|
const context = getLupaTrackingContext();
|
|
15069
|
-
const queryBody =
|
|
15096
|
+
const queryBody = __spreadProps(__spreadValues({}, context), {
|
|
15070
15097
|
limit: props.panel.totalCountLimit,
|
|
15071
15098
|
searchText: query.value
|
|
15072
15099
|
});
|
|
@@ -15547,7 +15574,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
15547
15574
|
window.addEventListener("resize", handleResize);
|
|
15548
15575
|
yield redirectionStore.initiate(props.options.redirections, props.options.options);
|
|
15549
15576
|
if (props.initialData) {
|
|
15550
|
-
searchResultStore.add(
|
|
15577
|
+
searchResultStore.add(__spreadValues({}, props.initialData));
|
|
15551
15578
|
}
|
|
15552
15579
|
handleMounted();
|
|
15553
15580
|
(_b = (_a = props.options.callbacks) == null ? void 0 : _a.onMounted) == null ? void 0 : _b.call(_a);
|
|
@@ -15600,7 +15627,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
15600
15627
|
});
|
|
15601
15628
|
const context = getLupaTrackingContext();
|
|
15602
15629
|
const limit = publicQuery.limit || defaultSearchResultPageSize.value;
|
|
15603
|
-
const query2 =
|
|
15630
|
+
const query2 = __spreadProps(__spreadValues(__spreadValues({}, publicQuery), context), { limit });
|
|
15604
15631
|
const redirectionApplied = redirectionStore.redirectOnKeywordIfConfigured(
|
|
15605
15632
|
publicQuery.searchText,
|
|
15606
15633
|
optionStore.searchResultsRoutingBehavior
|
|
@@ -15615,7 +15642,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
15615
15642
|
var _a, _b;
|
|
15616
15643
|
if (res.success) {
|
|
15617
15644
|
handleResults({ queryKey: props.options.queryKey, results: res });
|
|
15618
|
-
searchResultStore.add(
|
|
15645
|
+
searchResultStore.add(__spreadValues({}, res));
|
|
15619
15646
|
} else if ((_b = (_a = props.options) == null ? void 0 : _a.options) == null ? void 0 : _b.onError) {
|
|
15620
15647
|
props.options.options.onError(res);
|
|
15621
15648
|
}
|
|
@@ -15684,7 +15711,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
15684
15711
|
if (typeof window !== "undefined") {
|
|
15685
15712
|
optionStore.setSearchResultOptions({ options: props.options });
|
|
15686
15713
|
if (props.initialData) {
|
|
15687
|
-
searchResultStore.add(
|
|
15714
|
+
searchResultStore.add(__spreadValues({}, props.initialData));
|
|
15688
15715
|
}
|
|
15689
15716
|
handleMounted();
|
|
15690
15717
|
return;
|
|
@@ -15695,7 +15722,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
15695
15722
|
(_b = props.options.ssr) == null ? void 0 : _b.baseUrl
|
|
15696
15723
|
);
|
|
15697
15724
|
optionStore.setSearchResultOptions({ options: props.options });
|
|
15698
|
-
searchResultStore.add(
|
|
15725
|
+
searchResultStore.add(__spreadValues({}, initialData));
|
|
15699
15726
|
paramStore.add(parseParams(optionStore.getQueryParamName, searchParams), props.options.ssr);
|
|
15700
15727
|
paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
|
|
15701
15728
|
handleResults({ queryKey: props.options.queryKey, results: initialData });
|
|
@@ -15833,8 +15860,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
15833
15860
|
const props = __props;
|
|
15834
15861
|
const searchResults2 = ref(null);
|
|
15835
15862
|
const componentOptions = computed(() => {
|
|
15836
|
-
return
|
|
15837
|
-
filters:
|
|
15863
|
+
return __spreadProps(__spreadValues({}, props.options), {
|
|
15864
|
+
filters: __spreadProps(__spreadValues({}, props.options.filters), {
|
|
15838
15865
|
categories: props.options.categories
|
|
15839
15866
|
})
|
|
15840
15867
|
});
|
|
@@ -22361,11 +22388,11 @@ const Env = {
|
|
|
22361
22388
|
production: "https://api.lupasearch.com/v1/",
|
|
22362
22389
|
staging: "https://api.staging.lupasearch.com/v1/"
|
|
22363
22390
|
};
|
|
22364
|
-
const
|
|
22391
|
+
const DEFAULT_REQUEST_CONFIG = {
|
|
22365
22392
|
method: "POST",
|
|
22366
22393
|
headers: { "Content-Type": "application/json" }
|
|
22367
22394
|
};
|
|
22368
|
-
const
|
|
22395
|
+
const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
|
|
22369
22396
|
const getApiUrl = (environment, customBaseUrl) => {
|
|
22370
22397
|
if (customBaseUrl) {
|
|
22371
22398
|
return customBaseUrl;
|
|
@@ -22377,13 +22404,13 @@ const suggestSearchChatPhrases = (options, request, chatSettings) => __async(voi
|
|
|
22377
22404
|
const { environment, customBaseUrl } = options;
|
|
22378
22405
|
const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
|
|
22379
22406
|
try {
|
|
22380
|
-
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`,
|
|
22407
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
|
|
22381
22408
|
body: JSON.stringify(request),
|
|
22382
|
-
headers:
|
|
22409
|
+
headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
|
|
22383
22410
|
}));
|
|
22384
22411
|
if (res.status < 400) {
|
|
22385
22412
|
const data = yield res.json();
|
|
22386
|
-
return
|
|
22413
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
22387
22414
|
}
|
|
22388
22415
|
const errors = yield res.json();
|
|
22389
22416
|
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
|
|
@@ -22400,14 +22427,14 @@ const suggestPhraseAlternatives = (options, request, chatSettings) => __async(vo
|
|
|
22400
22427
|
try {
|
|
22401
22428
|
const res = yield fetch(
|
|
22402
22429
|
`${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives${model}`,
|
|
22403
|
-
|
|
22430
|
+
__spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
|
|
22404
22431
|
body: JSON.stringify(request),
|
|
22405
|
-
headers:
|
|
22432
|
+
headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
|
|
22406
22433
|
})
|
|
22407
22434
|
);
|
|
22408
22435
|
if (res.status < 400) {
|
|
22409
22436
|
const data = yield res.json();
|
|
22410
|
-
return
|
|
22437
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
22411
22438
|
}
|
|
22412
22439
|
const errors = yield res.json();
|
|
22413
22440
|
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
|
|
@@ -22422,13 +22449,13 @@ const suggestBestProductMatches = (options, request, chatSettings) => __async(vo
|
|
|
22422
22449
|
const { environment, customBaseUrl } = options;
|
|
22423
22450
|
const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
|
|
22424
22451
|
try {
|
|
22425
|
-
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`,
|
|
22452
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
|
|
22426
22453
|
body: JSON.stringify(request),
|
|
22427
|
-
headers:
|
|
22454
|
+
headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
|
|
22428
22455
|
}));
|
|
22429
22456
|
if (res.status < 400) {
|
|
22430
22457
|
const data = yield res.json();
|
|
22431
|
-
return
|
|
22458
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
22432
22459
|
}
|
|
22433
22460
|
const errors = yield res.json();
|
|
22434
22461
|
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
|
|
@@ -22462,9 +22489,9 @@ const prepareChatHistory = (chatLog) => {
|
|
|
22462
22489
|
const getTextResponseChunkStream = (options, request, onChunkReceived, chatSettings) => {
|
|
22463
22490
|
var _a;
|
|
22464
22491
|
const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
|
|
22465
|
-
fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`,
|
|
22492
|
+
fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
|
|
22466
22493
|
body: JSON.stringify(request),
|
|
22467
|
-
headers:
|
|
22494
|
+
headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
|
|
22468
22495
|
})).then((response) => {
|
|
22469
22496
|
const reader = response.body.getReader();
|
|
22470
22497
|
return reader.read().then(function processStream({ done, value }) {
|
|
@@ -22856,7 +22883,7 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
|
22856
22883
|
}
|
|
22857
22884
|
const validPhrases = phrases.filter((p2) => (p2 == null ? void 0 : p2.trim().length) > 0);
|
|
22858
22885
|
chatContent.value = chatContent.value.map(
|
|
22859
|
-
(c2) => c2.key === key ?
|
|
22886
|
+
(c2) => c2.key === key ? __spreadProps(__spreadValues({}, c2), {
|
|
22860
22887
|
allPhrases: [...validPhrases],
|
|
22861
22888
|
suggestedPhrases: phrases
|
|
22862
22889
|
}) : c2
|
|
@@ -22893,6 +22920,29 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
|
|
|
22893
22920
|
};
|
|
22894
22921
|
}
|
|
22895
22922
|
});
|
|
22923
|
+
const fetchPluginConfiguration = (options, configurationKey) => __async(void 0, null, function* () {
|
|
22924
|
+
var _a, _b, _c;
|
|
22925
|
+
const { environment, customBaseUrl } = options;
|
|
22926
|
+
try {
|
|
22927
|
+
const res = yield fetch(
|
|
22928
|
+
`${getApiUrl(environment, customBaseUrl)}plugin/configurations/${configurationKey}`,
|
|
22929
|
+
__spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
|
|
22930
|
+
method: "GET",
|
|
22931
|
+
headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
|
|
22932
|
+
})
|
|
22933
|
+
);
|
|
22934
|
+
if (res.status < 400) {
|
|
22935
|
+
const data = yield res.json();
|
|
22936
|
+
return __spreadValues({}, data);
|
|
22937
|
+
}
|
|
22938
|
+
const errors = yield res.json();
|
|
22939
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
|
|
22940
|
+
return null;
|
|
22941
|
+
} catch (e2) {
|
|
22942
|
+
(_c = options == null ? void 0 : options.onError) == null ? void 0 : _c.call(options, e2);
|
|
22943
|
+
return null;
|
|
22944
|
+
}
|
|
22945
|
+
});
|
|
22896
22946
|
let piniaInstance = null;
|
|
22897
22947
|
const initPinia = () => {
|
|
22898
22948
|
if (piniaInstance) {
|
|
@@ -22908,159 +22958,504 @@ const setupTracking = (options) => {
|
|
|
22908
22958
|
initTracking(options);
|
|
22909
22959
|
store.setTrackingOptions({ options });
|
|
22910
22960
|
};
|
|
22911
|
-
|
|
22912
|
-
var
|
|
22913
|
-
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
(
|
|
22923
|
-
|
|
22924
|
-
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
|
|
22929
|
-
|
|
22930
|
-
|
|
22931
|
-
|
|
22932
|
-
|
|
22933
|
-
|
|
22934
|
-
|
|
22935
|
-
|
|
22936
|
-
|
|
22937
|
-
|
|
22938
|
-
|
|
22939
|
-
|
|
22940
|
-
|
|
22941
|
-
|
|
22942
|
-
|
|
22943
|
-
|
|
22944
|
-
|
|
22945
|
-
|
|
22946
|
-
|
|
22947
|
-
|
|
22948
|
-
|
|
22949
|
-
|
|
22950
|
-
|
|
22951
|
-
|
|
22952
|
-
|
|
22953
|
-
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
|
|
22957
|
-
|
|
22958
|
-
|
|
22959
|
-
|
|
22960
|
-
|
|
22961
|
-
|
|
22962
|
-
|
|
22963
|
-
|
|
22964
|
-
|
|
22965
|
-
|
|
22966
|
-
|
|
22967
|
-
|
|
22968
|
-
|
|
22969
|
-
|
|
22970
|
-
|
|
22971
|
-
|
|
22972
|
-
|
|
22973
|
-
|
|
22974
|
-
|
|
22975
|
-
|
|
22976
|
-
|
|
22977
|
-
|
|
22978
|
-
|
|
22979
|
-
|
|
22980
|
-
|
|
22981
|
-
|
|
22982
|
-
|
|
22983
|
-
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
|
-
|
|
22988
|
-
|
|
22989
|
-
|
|
22990
|
-
|
|
22991
|
-
|
|
22992
|
-
|
|
22993
|
-
|
|
22994
|
-
|
|
22995
|
-
|
|
22996
|
-
|
|
22997
|
-
|
|
22998
|
-
|
|
22999
|
-
|
|
23000
|
-
|
|
23001
|
-
|
|
23002
|
-
|
|
23003
|
-
|
|
23004
|
-
|
|
23005
|
-
|
|
23006
|
-
|
|
23007
|
-
|
|
23008
|
-
|
|
23009
|
-
|
|
23010
|
-
|
|
23011
|
-
|
|
23012
|
-
|
|
23013
|
-
|
|
23014
|
-
|
|
23015
|
-
|
|
23016
|
-
|
|
23017
|
-
|
|
23018
|
-
|
|
23019
|
-
|
|
23020
|
-
|
|
23021
|
-
|
|
23022
|
-
|
|
23023
|
-
|
|
23024
|
-
|
|
23025
|
-
|
|
23026
|
-
|
|
23027
|
-
|
|
23028
|
-
|
|
23029
|
-
|
|
23030
|
-
|
|
23031
|
-
|
|
23032
|
-
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23036
|
-
|
|
23037
|
-
|
|
23038
|
-
|
|
23039
|
-
|
|
23040
|
-
|
|
23041
|
-
|
|
23042
|
-
|
|
23043
|
-
|
|
23044
|
-
|
|
23045
|
-
|
|
23046
|
-
|
|
23047
|
-
|
|
23048
|
-
|
|
23049
|
-
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23056
|
-
|
|
23057
|
-
|
|
23058
|
-
|
|
23059
|
-
|
|
23060
|
-
|
|
23061
|
-
|
|
23062
|
-
|
|
23063
|
-
|
|
22961
|
+
const displayDiscountedPriceSection = (doc2, options) => {
|
|
22962
|
+
var _a, _b;
|
|
22963
|
+
const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
|
|
22964
|
+
const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
|
|
22965
|
+
return discountPrice && regularPrice && discountPrice < regularPrice;
|
|
22966
|
+
};
|
|
22967
|
+
const displayRegularPriceSection = (doc2, options) => {
|
|
22968
|
+
var _a, _b;
|
|
22969
|
+
const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
|
|
22970
|
+
const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
|
|
22971
|
+
const anyPrice = discountPrice || regularPrice;
|
|
22972
|
+
return anyPrice && !displayDiscountedPriceSection(doc2, options);
|
|
22973
|
+
};
|
|
22974
|
+
const escapeHtml = (source) => {
|
|
22975
|
+
if (!source) {
|
|
22976
|
+
return source;
|
|
22977
|
+
}
|
|
22978
|
+
return `${source}`.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
22979
|
+
};
|
|
22980
|
+
const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
|
|
22981
|
+
if (!value) {
|
|
22982
|
+
return 0;
|
|
22983
|
+
}
|
|
22984
|
+
try {
|
|
22985
|
+
return +parseFloat(`${value}`).toFixed(maxDecimal);
|
|
22986
|
+
} catch (e2) {
|
|
22987
|
+
return `${value}`;
|
|
22988
|
+
}
|
|
22989
|
+
};
|
|
22990
|
+
const capitalize = (value) => {
|
|
22991
|
+
if (!value) {
|
|
22992
|
+
return "";
|
|
22993
|
+
}
|
|
22994
|
+
return value.charAt(0).toLocaleUpperCase() + value.slice(1);
|
|
22995
|
+
};
|
|
22996
|
+
const getAlphanumeric = (value) => {
|
|
22997
|
+
if (!value) {
|
|
22998
|
+
return "";
|
|
22999
|
+
}
|
|
23000
|
+
return value.replace(/[\W_]/g, " ");
|
|
23001
|
+
};
|
|
23002
|
+
const getAdditionalElements = (fields) => {
|
|
23003
|
+
return fields.map((key) => ({
|
|
23004
|
+
type: "custom",
|
|
23005
|
+
key,
|
|
23006
|
+
label: capitalize(getAlphanumeric(key)),
|
|
23007
|
+
className: "lupa-custom",
|
|
23008
|
+
display: (doc2) => Boolean(doc2[key])
|
|
23009
|
+
}));
|
|
23010
|
+
};
|
|
23011
|
+
const addFieldIfKeyExists = (field, key, config) => {
|
|
23012
|
+
if (key) {
|
|
23013
|
+
return config;
|
|
23014
|
+
}
|
|
23015
|
+
return { key: field, type: "customHtml", display: () => false };
|
|
23016
|
+
};
|
|
23017
|
+
const getSearchBoxComponent = ({
|
|
23018
|
+
searchBoxOptions,
|
|
23019
|
+
labels,
|
|
23020
|
+
panelOptions,
|
|
23021
|
+
redirections,
|
|
23022
|
+
placeholderImage
|
|
23023
|
+
}) => {
|
|
23024
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
23025
|
+
const panels = [
|
|
23026
|
+
...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
|
|
23027
|
+
{
|
|
23028
|
+
type: SearchBoxPanelType.SUGGESTION,
|
|
23029
|
+
queryKey: searchBoxOptions.suggestionQueryKey,
|
|
23030
|
+
highlight: true,
|
|
23031
|
+
limit: 8,
|
|
23032
|
+
labels: {
|
|
23033
|
+
topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
|
|
23034
|
+
}
|
|
23035
|
+
}
|
|
23036
|
+
] : [],
|
|
23037
|
+
...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
|
|
23038
|
+
{
|
|
23039
|
+
type: SearchBoxPanelType.DOCUMENT,
|
|
23040
|
+
queryKey: searchBoxOptions.documentQueryKey,
|
|
23041
|
+
limit: 5,
|
|
23042
|
+
elements: [
|
|
23043
|
+
{
|
|
23044
|
+
type: "image",
|
|
23045
|
+
placeholder: placeholderImage,
|
|
23046
|
+
key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
|
|
23047
|
+
baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
|
|
23048
|
+
},
|
|
23049
|
+
{
|
|
23050
|
+
type: "title",
|
|
23051
|
+
key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
|
|
23052
|
+
maxLines: 2
|
|
23053
|
+
},
|
|
23054
|
+
{
|
|
23055
|
+
type: "regularPrice",
|
|
23056
|
+
key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
|
|
23057
|
+
display: (doc2) => {
|
|
23058
|
+
var _a2, _b2, _c2, _d2;
|
|
23059
|
+
return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
|
|
23060
|
+
}
|
|
23061
|
+
},
|
|
23062
|
+
{
|
|
23063
|
+
type: "price",
|
|
23064
|
+
key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
|
|
23065
|
+
}
|
|
23066
|
+
]
|
|
23067
|
+
}
|
|
23068
|
+
] : []
|
|
23069
|
+
];
|
|
23070
|
+
return {
|
|
23071
|
+
inputSelector: searchBoxOptions.inputSelector,
|
|
23072
|
+
options: {
|
|
23073
|
+
environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
|
|
23074
|
+
customUrl: searchBoxOptions.customUrl,
|
|
23075
|
+
customBaseUrl: searchBoxOptions.customBaseUrl,
|
|
23076
|
+
customPayload: searchBoxOptions.customPayload,
|
|
23077
|
+
customHeaders: searchBoxOptions.customHeaders
|
|
23078
|
+
},
|
|
23079
|
+
showTotalCount: true,
|
|
23080
|
+
expandOnSinglePanel: true,
|
|
23081
|
+
minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
|
|
23082
|
+
debounce: 250,
|
|
23083
|
+
labels: labels == null ? void 0 : labels.searchBox,
|
|
23084
|
+
links: {
|
|
23085
|
+
searchResults: ""
|
|
23086
|
+
},
|
|
23087
|
+
panels,
|
|
23088
|
+
redirections,
|
|
23089
|
+
history: {
|
|
23090
|
+
labels: {
|
|
23091
|
+
clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
|
|
23092
|
+
}
|
|
23093
|
+
}
|
|
23094
|
+
};
|
|
23095
|
+
};
|
|
23096
|
+
const getSearchResultsComponent = ({
|
|
23097
|
+
searchResultOptions,
|
|
23098
|
+
labels,
|
|
23099
|
+
redirections,
|
|
23100
|
+
placeholderImage,
|
|
23101
|
+
configuratorOverrides,
|
|
23102
|
+
callbacks,
|
|
23103
|
+
additionalFields
|
|
23104
|
+
}) => {
|
|
23105
|
+
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;
|
|
23106
|
+
const filters = searchResultOptions.showFacets ? {
|
|
23107
|
+
currentFilters: {
|
|
23108
|
+
visibility: {
|
|
23109
|
+
mobileSidebar: true,
|
|
23110
|
+
mobileToolbar: true
|
|
23111
|
+
},
|
|
23112
|
+
labels: {
|
|
23113
|
+
title: "",
|
|
23114
|
+
clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
|
|
23115
|
+
}
|
|
23116
|
+
},
|
|
23117
|
+
facets: {
|
|
23118
|
+
labels: {
|
|
23119
|
+
title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
|
|
23120
|
+
showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
|
|
23121
|
+
facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
|
|
23122
|
+
facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
|
|
23123
|
+
},
|
|
23124
|
+
filterable: {
|
|
23125
|
+
minValues: 5
|
|
23126
|
+
},
|
|
23127
|
+
hierarchy: {
|
|
23128
|
+
maxInitialLevel: 2,
|
|
23129
|
+
topLevelValueCountLimit: 5,
|
|
23130
|
+
filterable: true
|
|
23131
|
+
},
|
|
23132
|
+
stats: {
|
|
23133
|
+
slider: true,
|
|
23134
|
+
inputs: true,
|
|
23135
|
+
labels: {
|
|
23136
|
+
from: "",
|
|
23137
|
+
to: ""
|
|
23138
|
+
}
|
|
23139
|
+
},
|
|
23140
|
+
facetValueCountLimit: 8,
|
|
23141
|
+
showDocumentCount: true,
|
|
23142
|
+
style: {
|
|
23143
|
+
type: "sidebar"
|
|
23144
|
+
}
|
|
23145
|
+
}
|
|
23146
|
+
} : {};
|
|
23147
|
+
const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
|
|
23148
|
+
xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
|
|
23149
|
+
l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
|
|
23150
|
+
md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
|
|
23151
|
+
sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
|
|
23152
|
+
xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
|
|
23153
|
+
};
|
|
23154
|
+
const badges = {
|
|
23155
|
+
badges: {
|
|
23156
|
+
anchor: "tr",
|
|
23157
|
+
elements: [
|
|
23158
|
+
...searchResultOptions.showRelevance ? [
|
|
23159
|
+
{
|
|
23160
|
+
key: "",
|
|
23161
|
+
type: "customHtml",
|
|
23162
|
+
className: "relevance",
|
|
23163
|
+
html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
|
|
23164
|
+
display: (doc2) => Boolean(doc2._relevance !== void 0)
|
|
23165
|
+
}
|
|
23166
|
+
] : [],
|
|
23167
|
+
...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
|
|
23168
|
+
{
|
|
23169
|
+
key: "",
|
|
23170
|
+
type: "customHtml",
|
|
23171
|
+
className: "boosted-marker",
|
|
23172
|
+
html: () => {
|
|
23173
|
+
var _a2;
|
|
23174
|
+
return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
|
|
23175
|
+
},
|
|
23176
|
+
display: (doc2) => doc2._boosted === true
|
|
23177
|
+
}
|
|
23178
|
+
] : []
|
|
23179
|
+
]
|
|
23180
|
+
}
|
|
23181
|
+
};
|
|
23182
|
+
return __spreadValues2(__spreadProps2(__spreadValues2({
|
|
23183
|
+
options: {
|
|
23184
|
+
environment: (_m = searchResultOptions.environment) != null ? _m : "production",
|
|
23185
|
+
customUrl: searchResultOptions.customUrl,
|
|
23186
|
+
customBaseUrl: searchResultOptions.customBaseUrl,
|
|
23187
|
+
customPayload: searchResultOptions.customPayload,
|
|
23188
|
+
customHeaders: searchResultOptions.customHeaders,
|
|
23189
|
+
onError: searchResultOptions.errorHandler
|
|
23190
|
+
},
|
|
23191
|
+
queryKey: searchResultOptions.queryKey,
|
|
23192
|
+
containerSelector: searchResultOptions.containerSelector,
|
|
23193
|
+
searchTitlePosition: "search-results-top",
|
|
23194
|
+
titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
|
|
23195
|
+
labels: labels == null ? void 0 : labels.searchResults,
|
|
23196
|
+
grid: {
|
|
23197
|
+
columns
|
|
23198
|
+
},
|
|
23199
|
+
pagination: {
|
|
23200
|
+
sizeSelection: {
|
|
23201
|
+
position: {
|
|
23202
|
+
top: true,
|
|
23203
|
+
bottom: false
|
|
23204
|
+
},
|
|
23205
|
+
sizes: [12, 24, 36, 48]
|
|
23206
|
+
},
|
|
23207
|
+
pageSelection: {
|
|
23208
|
+
position: {
|
|
23209
|
+
top: false,
|
|
23210
|
+
bottom: true
|
|
23211
|
+
},
|
|
23212
|
+
displayMobile: 3,
|
|
23213
|
+
display: 5
|
|
23214
|
+
}
|
|
23215
|
+
},
|
|
23216
|
+
filters,
|
|
23217
|
+
toolbar: {
|
|
23218
|
+
layoutSelector: false,
|
|
23219
|
+
itemSummary: true,
|
|
23220
|
+
clearFilters: false
|
|
23221
|
+
},
|
|
23222
|
+
isInStock: () => {
|
|
23223
|
+
return true;
|
|
23224
|
+
}
|
|
23225
|
+
}, badges), {
|
|
23226
|
+
links: {
|
|
23227
|
+
details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
|
|
23228
|
+
},
|
|
23229
|
+
callbacks,
|
|
23230
|
+
routingBehavior: callbacks ? "event" : "direct-link",
|
|
23231
|
+
idKey: "id",
|
|
23232
|
+
elements: [
|
|
23233
|
+
{
|
|
23234
|
+
type: "image",
|
|
23235
|
+
placeholder: placeholderImage,
|
|
23236
|
+
key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
|
|
23237
|
+
baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
|
|
23238
|
+
display: () => {
|
|
23239
|
+
var _a2;
|
|
23240
|
+
return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
|
|
23241
|
+
}
|
|
23242
|
+
},
|
|
23243
|
+
addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
|
|
23244
|
+
type: "custom",
|
|
23245
|
+
className: "lupa-custom-emphasis",
|
|
23246
|
+
key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
|
|
23247
|
+
display: () => true
|
|
23248
|
+
}),
|
|
23249
|
+
{
|
|
23250
|
+
type: "title",
|
|
23251
|
+
key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
|
|
23252
|
+
maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
|
|
23253
|
+
display: (doc2) => {
|
|
23254
|
+
var _a2, _b2;
|
|
23255
|
+
return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
|
|
23256
|
+
}
|
|
23257
|
+
},
|
|
23258
|
+
...getAdditionalElements(additionalFields),
|
|
23259
|
+
addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
|
|
23260
|
+
key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
|
|
23261
|
+
type: "customHtml",
|
|
23262
|
+
className: "lupa-price lupa-price-discounted",
|
|
23263
|
+
display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
|
|
23264
|
+
html: (doc2) => {
|
|
23265
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
23266
|
+
const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
|
|
23267
|
+
const discountPrice = (_d2 = parseFloat(
|
|
23268
|
+
doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
|
|
23269
|
+
)) == null ? void 0 : _d2.toFixed(2);
|
|
23270
|
+
const regularPrice = (_g2 = parseFloat(
|
|
23271
|
+
doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
|
|
23272
|
+
)) == null ? void 0 : _g2.toFixed(2);
|
|
23273
|
+
const discount = `<span class="lupa-discount">${escapeHtml(
|
|
23274
|
+
discountPrice
|
|
23275
|
+
)} ${currency}</span>`;
|
|
23276
|
+
const regular = `<span class="lupa-regular">${escapeHtml(
|
|
23277
|
+
regularPrice
|
|
23278
|
+
)} ${currency}</span>`;
|
|
23279
|
+
return discount + regular;
|
|
23280
|
+
}
|
|
23281
|
+
}),
|
|
23282
|
+
addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
|
|
23283
|
+
key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
|
|
23284
|
+
type: "customHtml",
|
|
23285
|
+
className: "lupa-price lupa-price-single",
|
|
23286
|
+
display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
|
|
23287
|
+
html: (doc2) => {
|
|
23288
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
23289
|
+
const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
|
|
23290
|
+
const price = (_g2 = parseFloat(
|
|
23291
|
+
(_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
|
|
23292
|
+
)) == null ? void 0 : _g2.toFixed(2);
|
|
23293
|
+
return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
|
|
23294
|
+
}
|
|
23295
|
+
})
|
|
23296
|
+
],
|
|
23297
|
+
breadcrumbs: [],
|
|
23298
|
+
sort: [],
|
|
23299
|
+
redirections
|
|
23300
|
+
}), configuratorOverrides);
|
|
23301
|
+
};
|
|
23302
|
+
const SearchContainerConfigurationService = {
|
|
23303
|
+
getSearchBoxComponent,
|
|
23304
|
+
getSearchResultsComponent
|
|
23305
|
+
};
|
|
23306
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
23307
|
+
var lodash = { exports: {} };
|
|
23308
|
+
/**
|
|
23309
|
+
* @license
|
|
23310
|
+
* Lodash <https://lodash.com/>
|
|
23311
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
23312
|
+
* Released under MIT license <https://lodash.com/license>
|
|
23313
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
23314
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
23315
|
+
*/
|
|
23316
|
+
lodash.exports;
|
|
23317
|
+
(function(module2, exports2) {
|
|
23318
|
+
(function() {
|
|
23319
|
+
var undefined$1;
|
|
23320
|
+
var VERSION = "4.17.21";
|
|
23321
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
23322
|
+
var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
|
|
23323
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
23324
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
23325
|
+
var PLACEHOLDER = "__lodash_placeholder__";
|
|
23326
|
+
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
|
|
23327
|
+
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
23328
|
+
var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
|
|
23329
|
+
var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
|
|
23330
|
+
var HOT_COUNT = 800, HOT_SPAN = 16;
|
|
23331
|
+
var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
|
|
23332
|
+
var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
|
|
23333
|
+
var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
|
23334
|
+
var wrapFlags = [
|
|
23335
|
+
["ary", WRAP_ARY_FLAG],
|
|
23336
|
+
["bind", WRAP_BIND_FLAG],
|
|
23337
|
+
["bindKey", WRAP_BIND_KEY_FLAG],
|
|
23338
|
+
["curry", WRAP_CURRY_FLAG],
|
|
23339
|
+
["curryRight", WRAP_CURRY_RIGHT_FLAG],
|
|
23340
|
+
["flip", WRAP_FLIP_FLAG],
|
|
23341
|
+
["partial", WRAP_PARTIAL_FLAG],
|
|
23342
|
+
["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
|
|
23343
|
+
["rearg", WRAP_REARG_FLAG]
|
|
23344
|
+
];
|
|
23345
|
+
var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
|
|
23346
|
+
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
23347
|
+
var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
|
23348
|
+
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
|
23349
|
+
var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
|
|
23350
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
23351
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
|
|
23352
|
+
var reTrimStart = /^\s+/;
|
|
23353
|
+
var reWhitespace = /\s/;
|
|
23354
|
+
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
|
|
23355
|
+
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
23356
|
+
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
|
|
23357
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
23358
|
+
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
|
23359
|
+
var reFlags = /\w*$/;
|
|
23360
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
23361
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
23362
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
23363
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
23364
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
23365
|
+
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
23366
|
+
var reNoMatch = /($^)/;
|
|
23367
|
+
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
|
|
23368
|
+
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
23369
|
+
var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
|
|
23370
|
+
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
23371
|
+
var reApos = RegExp(rsApos, "g");
|
|
23372
|
+
var reComboMark = RegExp(rsCombo, "g");
|
|
23373
|
+
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
23374
|
+
var reUnicodeWord = RegExp([
|
|
23375
|
+
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
23376
|
+
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
|
|
23377
|
+
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
23378
|
+
rsUpper + "+" + rsOptContrUpper,
|
|
23379
|
+
rsOrdUpper,
|
|
23380
|
+
rsOrdLower,
|
|
23381
|
+
rsDigits,
|
|
23382
|
+
rsEmoji
|
|
23383
|
+
].join("|"), "g");
|
|
23384
|
+
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
23385
|
+
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
23386
|
+
var contextProps = [
|
|
23387
|
+
"Array",
|
|
23388
|
+
"Buffer",
|
|
23389
|
+
"DataView",
|
|
23390
|
+
"Date",
|
|
23391
|
+
"Error",
|
|
23392
|
+
"Float32Array",
|
|
23393
|
+
"Float64Array",
|
|
23394
|
+
"Function",
|
|
23395
|
+
"Int8Array",
|
|
23396
|
+
"Int16Array",
|
|
23397
|
+
"Int32Array",
|
|
23398
|
+
"Map",
|
|
23399
|
+
"Math",
|
|
23400
|
+
"Object",
|
|
23401
|
+
"Promise",
|
|
23402
|
+
"RegExp",
|
|
23403
|
+
"Set",
|
|
23404
|
+
"String",
|
|
23405
|
+
"Symbol",
|
|
23406
|
+
"TypeError",
|
|
23407
|
+
"Uint8Array",
|
|
23408
|
+
"Uint8ClampedArray",
|
|
23409
|
+
"Uint16Array",
|
|
23410
|
+
"Uint32Array",
|
|
23411
|
+
"WeakMap",
|
|
23412
|
+
"_",
|
|
23413
|
+
"clearTimeout",
|
|
23414
|
+
"isFinite",
|
|
23415
|
+
"parseInt",
|
|
23416
|
+
"setTimeout"
|
|
23417
|
+
];
|
|
23418
|
+
var templateCounter = -1;
|
|
23419
|
+
var typedArrayTags = {};
|
|
23420
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
23421
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
23422
|
+
var cloneableTags = {};
|
|
23423
|
+
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
23424
|
+
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
23425
|
+
var deburredLetters = {
|
|
23426
|
+
// Latin-1 Supplement block.
|
|
23427
|
+
"À": "A",
|
|
23428
|
+
"Á": "A",
|
|
23429
|
+
"Â": "A",
|
|
23430
|
+
"Ã": "A",
|
|
23431
|
+
"Ä": "A",
|
|
23432
|
+
"Å": "A",
|
|
23433
|
+
"à": "a",
|
|
23434
|
+
"á": "a",
|
|
23435
|
+
"â": "a",
|
|
23436
|
+
"ã": "a",
|
|
23437
|
+
"ä": "a",
|
|
23438
|
+
"å": "a",
|
|
23439
|
+
"Ç": "C",
|
|
23440
|
+
"ç": "c",
|
|
23441
|
+
"Ð": "D",
|
|
23442
|
+
"ð": "d",
|
|
23443
|
+
"È": "E",
|
|
23444
|
+
"É": "E",
|
|
23445
|
+
"Ê": "E",
|
|
23446
|
+
"Ë": "E",
|
|
23447
|
+
"è": "e",
|
|
23448
|
+
"é": "e",
|
|
23449
|
+
"ê": "e",
|
|
23450
|
+
"ë": "e",
|
|
23451
|
+
"Ì": "I",
|
|
23452
|
+
"Í": "I",
|
|
23453
|
+
"Î": "I",
|
|
23454
|
+
"Ï": "I",
|
|
23455
|
+
"ì": "i",
|
|
23456
|
+
"í": "i",
|
|
23457
|
+
"î": "i",
|
|
23458
|
+
"ï": "i",
|
|
23064
23459
|
"Ñ": "N",
|
|
23065
23460
|
"ñ": "n",
|
|
23066
23461
|
"Ò": "O",
|
|
@@ -28386,546 +28781,150 @@ lodash.exports;
|
|
|
28386
28781
|
(freeModule.exports = _)._ = _;
|
|
28387
28782
|
freeExports._ = _;
|
|
28388
28783
|
} else {
|
|
28389
|
-
root._ = _;
|
|
28390
|
-
}
|
|
28391
|
-
}).call(commonjsGlobal);
|
|
28392
|
-
})(lodash, lodash.exports);
|
|
28393
|
-
var lodashExports = lodash.exports;
|
|
28394
|
-
const DEFAULT_SEARCH_BOX_OPTIONS = {
|
|
28395
|
-
inputSelector: "#searchBox",
|
|
28396
|
-
options: {
|
|
28397
|
-
environment: "production"
|
|
28398
|
-
},
|
|
28399
|
-
showTotalCount: false,
|
|
28400
|
-
minInputLength: 1,
|
|
28401
|
-
inputAttributes: {
|
|
28402
|
-
name: "q"
|
|
28403
|
-
},
|
|
28404
|
-
debounce: 0,
|
|
28405
|
-
labels: {
|
|
28406
|
-
placeholder: "Search for products...",
|
|
28407
|
-
noResults: "There are no results found.",
|
|
28408
|
-
moreResults: "Show more results",
|
|
28409
|
-
currency: "€",
|
|
28410
|
-
defaultFacetLabel: "Category:"
|
|
28411
|
-
},
|
|
28412
|
-
links: {
|
|
28413
|
-
searchResults: "/search"
|
|
28414
|
-
},
|
|
28415
|
-
panels: [
|
|
28416
|
-
{
|
|
28417
|
-
type: "suggestion",
|
|
28418
|
-
queryKey: "",
|
|
28419
|
-
highlight: true,
|
|
28420
|
-
limit: 5
|
|
28421
|
-
},
|
|
28422
|
-
{
|
|
28423
|
-
type: "document",
|
|
28424
|
-
queryKey: "",
|
|
28425
|
-
limit: 5,
|
|
28426
|
-
searchBySuggestion: false,
|
|
28427
|
-
links: {
|
|
28428
|
-
details: "{url}"
|
|
28429
|
-
},
|
|
28430
|
-
titleKey: "name",
|
|
28431
|
-
elements: []
|
|
28432
|
-
}
|
|
28433
|
-
],
|
|
28434
|
-
history: {
|
|
28435
|
-
labels: {
|
|
28436
|
-
clear: "Clear History"
|
|
28437
|
-
}
|
|
28438
|
-
}
|
|
28439
|
-
};
|
|
28440
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
28441
|
-
__name: "SearchBoxEntry",
|
|
28442
|
-
props: {
|
|
28443
|
-
searchBoxOptions: {}
|
|
28444
|
-
},
|
|
28445
|
-
setup(__props, { expose: __expose }) {
|
|
28446
|
-
const props = __props;
|
|
28447
|
-
const searchBox2 = ref(null);
|
|
28448
|
-
const fullSearchBoxOptions = computed(() => {
|
|
28449
|
-
const options = lodashExports.cloneDeep(props.searchBoxOptions);
|
|
28450
|
-
return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
|
|
28451
|
-
});
|
|
28452
|
-
const fetch2 = () => {
|
|
28453
|
-
var _a;
|
|
28454
|
-
(_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
|
|
28455
|
-
};
|
|
28456
|
-
__expose({ fetch: fetch2 });
|
|
28457
|
-
return (_ctx, _cache) => {
|
|
28458
|
-
return openBlock(), createBlock(unref(_sfc_main$V), {
|
|
28459
|
-
options: fullSearchBoxOptions.value,
|
|
28460
|
-
ref_key: "searchBox",
|
|
28461
|
-
ref: searchBox2
|
|
28462
|
-
}, null, 8, ["options"]);
|
|
28463
|
-
};
|
|
28464
|
-
}
|
|
28465
|
-
});
|
|
28466
|
-
const DEFAULT_OPTIONS_RESULTS = {
|
|
28784
|
+
root._ = _;
|
|
28785
|
+
}
|
|
28786
|
+
}).call(commonjsGlobal);
|
|
28787
|
+
})(lodash, lodash.exports);
|
|
28788
|
+
var lodashExports = lodash.exports;
|
|
28789
|
+
const DEFAULT_SEARCH_BOX_OPTIONS = {
|
|
28790
|
+
inputSelector: "#searchBox",
|
|
28467
28791
|
options: {
|
|
28468
28792
|
environment: "production"
|
|
28469
28793
|
},
|
|
28470
|
-
|
|
28471
|
-
|
|
28472
|
-
|
|
28794
|
+
showTotalCount: false,
|
|
28795
|
+
minInputLength: 1,
|
|
28796
|
+
inputAttributes: {
|
|
28797
|
+
name: "q"
|
|
28798
|
+
},
|
|
28799
|
+
debounce: 0,
|
|
28473
28800
|
labels: {
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
filteredItemCount: "",
|
|
28801
|
+
placeholder: "Search for products...",
|
|
28802
|
+
noResults: "There are no results found.",
|
|
28803
|
+
moreResults: "Show more results",
|
|
28478
28804
|
currency: "€",
|
|
28479
|
-
|
|
28480
|
-
searchResults: "Search Query: ",
|
|
28481
|
-
emptyResults: "There are no results for the query:",
|
|
28482
|
-
mobileFilterButton: "Filter",
|
|
28483
|
-
htmlTitleTemplate: "Search Query: '{1}'",
|
|
28484
|
-
noResultsSuggestion: "No results found for this query: {1}",
|
|
28485
|
-
didYouMean: "Did you mean to search: {1}",
|
|
28486
|
-
similarQuery: "Search results for phrase {1}",
|
|
28487
|
-
similarQueries: "Similar queries:"
|
|
28488
|
-
},
|
|
28489
|
-
grid: {
|
|
28490
|
-
columns: {
|
|
28491
|
-
xl: 4,
|
|
28492
|
-
l: 3,
|
|
28493
|
-
md: 2,
|
|
28494
|
-
sm: 2,
|
|
28495
|
-
xs: 1
|
|
28496
|
-
}
|
|
28805
|
+
defaultFacetLabel: "Category:"
|
|
28497
28806
|
},
|
|
28498
|
-
|
|
28499
|
-
|
|
28500
|
-
position: {
|
|
28501
|
-
top: false,
|
|
28502
|
-
bottom: true
|
|
28503
|
-
},
|
|
28504
|
-
sizes: [12, 24, 36]
|
|
28505
|
-
},
|
|
28506
|
-
pageSelection: {
|
|
28507
|
-
position: {
|
|
28508
|
-
top: false,
|
|
28509
|
-
bottom: true
|
|
28510
|
-
},
|
|
28511
|
-
display: 5,
|
|
28512
|
-
displayMobile: 3
|
|
28513
|
-
}
|
|
28807
|
+
links: {
|
|
28808
|
+
searchResults: "/search"
|
|
28514
28809
|
},
|
|
28515
|
-
|
|
28516
|
-
|
|
28517
|
-
|
|
28518
|
-
|
|
28519
|
-
|
|
28520
|
-
|
|
28521
|
-
},
|
|
28522
|
-
labels: {
|
|
28523
|
-
title: "Current filters:",
|
|
28524
|
-
clearAll: "Clear all"
|
|
28525
|
-
}
|
|
28810
|
+
panels: [
|
|
28811
|
+
{
|
|
28812
|
+
type: "suggestion",
|
|
28813
|
+
queryKey: "",
|
|
28814
|
+
highlight: true,
|
|
28815
|
+
limit: 5
|
|
28526
28816
|
},
|
|
28527
|
-
|
|
28528
|
-
|
|
28529
|
-
|
|
28530
|
-
|
|
28531
|
-
|
|
28532
|
-
|
|
28533
|
-
|
|
28534
|
-
filterable: {
|
|
28535
|
-
minValues: 5
|
|
28536
|
-
},
|
|
28537
|
-
hierarchy: {
|
|
28538
|
-
maxInitialLevel: 2,
|
|
28539
|
-
topLevelValueCountLimit: 5,
|
|
28540
|
-
filterable: true
|
|
28817
|
+
{
|
|
28818
|
+
type: "document",
|
|
28819
|
+
queryKey: "",
|
|
28820
|
+
limit: 5,
|
|
28821
|
+
searchBySuggestion: false,
|
|
28822
|
+
links: {
|
|
28823
|
+
details: "{url}"
|
|
28541
28824
|
},
|
|
28542
|
-
|
|
28543
|
-
|
|
28544
|
-
|
|
28545
|
-
|
|
28546
|
-
|
|
28547
|
-
|
|
28548
|
-
|
|
28549
|
-
|
|
28550
|
-
layoutSelector: true,
|
|
28551
|
-
itemSummary: true,
|
|
28552
|
-
clearFilters: false
|
|
28553
|
-
},
|
|
28554
|
-
isInStock: () => {
|
|
28555
|
-
return true;
|
|
28556
|
-
},
|
|
28557
|
-
badges: {
|
|
28558
|
-
anchor: "tr",
|
|
28559
|
-
elements: []
|
|
28560
|
-
},
|
|
28561
|
-
links: {
|
|
28562
|
-
details: "/{id}"
|
|
28563
|
-
},
|
|
28564
|
-
elements: [],
|
|
28565
|
-
breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
|
|
28566
|
-
};
|
|
28567
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
28568
|
-
__name: "SearchResultsEntry",
|
|
28569
|
-
props: {
|
|
28570
|
-
searchResultsOptions: {}
|
|
28571
|
-
},
|
|
28572
|
-
setup(__props, { expose: __expose }) {
|
|
28573
|
-
const props = __props;
|
|
28574
|
-
const searchResults2 = ref(null);
|
|
28575
|
-
const fullSearchResultsOptions = computed(() => {
|
|
28576
|
-
const options = lodashExports.cloneDeep(props.searchResultsOptions);
|
|
28577
|
-
return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
|
|
28578
|
-
});
|
|
28579
|
-
const fetch2 = () => {
|
|
28580
|
-
var _a;
|
|
28581
|
-
(_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
|
|
28582
|
-
};
|
|
28583
|
-
__expose({ fetch: fetch2 });
|
|
28584
|
-
return (_ctx, _cache) => {
|
|
28585
|
-
return openBlock(), createBlock(unref(_sfc_main$c), {
|
|
28586
|
-
options: fullSearchResultsOptions.value,
|
|
28587
|
-
ref_key: "searchResults",
|
|
28588
|
-
ref: searchResults2
|
|
28589
|
-
}, null, 8, ["options"]);
|
|
28590
|
-
};
|
|
28591
|
-
}
|
|
28592
|
-
});
|
|
28593
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
28594
|
-
__name: "ProductListEntry",
|
|
28595
|
-
props: {
|
|
28596
|
-
productListOptions: {}
|
|
28597
|
-
},
|
|
28598
|
-
setup(__props, { expose: __expose }) {
|
|
28599
|
-
const props = __props;
|
|
28600
|
-
const productList2 = ref(null);
|
|
28601
|
-
const fullProductListOptions = computed(() => {
|
|
28602
|
-
return lodashExports.cloneDeep(props.productListOptions);
|
|
28603
|
-
});
|
|
28604
|
-
const fetch2 = () => {
|
|
28605
|
-
var _a;
|
|
28606
|
-
(_a = productList2.value) == null ? void 0 : _a.fetch();
|
|
28607
|
-
};
|
|
28608
|
-
__expose({ fetch: fetch2 });
|
|
28609
|
-
return (_ctx, _cache) => {
|
|
28610
|
-
return openBlock(), createBlock(unref(_sfc_main$a), {
|
|
28611
|
-
options: fullProductListOptions.value,
|
|
28612
|
-
ref_key: "productList",
|
|
28613
|
-
ref: productList2
|
|
28614
|
-
}, null, 8, ["options"]);
|
|
28615
|
-
};
|
|
28616
|
-
}
|
|
28617
|
-
});
|
|
28618
|
-
const QUERY_PARAMS = {
|
|
28619
|
-
QUERY: "q",
|
|
28620
|
-
PAGE: "p",
|
|
28621
|
-
LIMIT: "l",
|
|
28622
|
-
SORT: "s"
|
|
28623
|
-
};
|
|
28624
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
28625
|
-
__name: "SearchContainerEntry",
|
|
28626
|
-
props: {
|
|
28627
|
-
searchContainerOptions: {}
|
|
28628
|
-
},
|
|
28629
|
-
setup(__props, { expose: __expose }) {
|
|
28630
|
-
const props = __props;
|
|
28631
|
-
const isOpen = ref(false);
|
|
28632
|
-
const triggerElement = ref(null);
|
|
28633
|
-
const productList2 = ref(null);
|
|
28634
|
-
const containerOptions = computed(() => {
|
|
28635
|
-
return lodashExports.cloneDeep(props.searchContainerOptions);
|
|
28636
|
-
});
|
|
28637
|
-
const focus = () => {
|
|
28638
|
-
const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
|
|
28639
|
-
el == null ? void 0 : el.focus();
|
|
28640
|
-
};
|
|
28641
|
-
const close = () => {
|
|
28642
|
-
isOpen.value = false;
|
|
28643
|
-
};
|
|
28644
|
-
const openSearchContainer = () => {
|
|
28645
|
-
isOpen.value = true;
|
|
28646
|
-
};
|
|
28647
|
-
const checkCloseOnEscape = (e2) => {
|
|
28648
|
-
var _a;
|
|
28649
|
-
if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
|
|
28650
|
-
return;
|
|
28651
|
-
}
|
|
28652
|
-
isOpen.value = false;
|
|
28653
|
-
};
|
|
28654
|
-
const checkExistingQuery = () => {
|
|
28655
|
-
const url = new URL(window.location.href);
|
|
28656
|
-
const param = url.searchParams.get(QUERY_PARAMS.QUERY);
|
|
28657
|
-
if (!param) {
|
|
28658
|
-
return;
|
|
28659
|
-
}
|
|
28660
|
-
isOpen.value = true;
|
|
28661
|
-
};
|
|
28662
|
-
const mountOpenListeners = () => {
|
|
28663
|
-
var _a, _b;
|
|
28664
|
-
triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
|
|
28665
|
-
(_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
|
|
28666
|
-
window.addEventListener("keydown", checkCloseOnEscape);
|
|
28667
|
-
};
|
|
28668
|
-
onMounted(() => {
|
|
28669
|
-
var _a, _b;
|
|
28670
|
-
mountOpenListeners();
|
|
28671
|
-
checkExistingQuery();
|
|
28672
|
-
isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
|
|
28673
|
-
});
|
|
28674
|
-
onBeforeUnmount(() => {
|
|
28675
|
-
var _a;
|
|
28676
|
-
(_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
|
|
28677
|
-
window.removeEventListener("keydown", checkCloseOnEscape);
|
|
28678
|
-
});
|
|
28679
|
-
const fetch2 = () => {
|
|
28680
|
-
var _a;
|
|
28681
|
-
(_a = productList2.value) == null ? void 0 : _a.fetch();
|
|
28682
|
-
};
|
|
28683
|
-
const reloadOptions = () => {
|
|
28684
|
-
var _a;
|
|
28685
|
-
(_a = productList2.value) == null ? void 0 : _a.reloadOptions();
|
|
28686
|
-
};
|
|
28687
|
-
__expose({ fetch: fetch2, reloadOptions });
|
|
28688
|
-
return (_ctx, _cache) => {
|
|
28689
|
-
return openBlock(), createElementBlock("div", null, [
|
|
28690
|
-
containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
|
|
28691
|
-
key: 0,
|
|
28692
|
-
options: containerOptions.value,
|
|
28693
|
-
ref_key: "productList",
|
|
28694
|
-
ref: productList2,
|
|
28695
|
-
"onHook:mounted": focus,
|
|
28696
|
-
onClose: close
|
|
28697
|
-
}, null, 8, ["options"])) : createCommentVNode("", true)
|
|
28698
|
-
]);
|
|
28699
|
-
};
|
|
28825
|
+
titleKey: "name",
|
|
28826
|
+
elements: []
|
|
28827
|
+
}
|
|
28828
|
+
],
|
|
28829
|
+
history: {
|
|
28830
|
+
labels: {
|
|
28831
|
+
clear: "Clear History"
|
|
28832
|
+
}
|
|
28700
28833
|
}
|
|
28701
|
-
}
|
|
28702
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28703
|
-
__name: "
|
|
28834
|
+
};
|
|
28835
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
28836
|
+
__name: "SearchBoxEntry",
|
|
28704
28837
|
props: {
|
|
28705
|
-
|
|
28838
|
+
searchBoxOptions: {}
|
|
28706
28839
|
},
|
|
28707
28840
|
setup(__props, { expose: __expose }) {
|
|
28708
|
-
const
|
|
28841
|
+
const props = __props;
|
|
28842
|
+
const searchBox2 = ref(null);
|
|
28843
|
+
const fullSearchBoxOptions = computed(() => {
|
|
28844
|
+
const options = lodashExports.cloneDeep(props.searchBoxOptions);
|
|
28845
|
+
return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
|
|
28846
|
+
});
|
|
28709
28847
|
const fetch2 = () => {
|
|
28710
|
-
|
|
28848
|
+
var _a;
|
|
28849
|
+
(_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
|
|
28711
28850
|
};
|
|
28712
28851
|
__expose({ fetch: fetch2 });
|
|
28713
28852
|
return (_ctx, _cache) => {
|
|
28714
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
28715
|
-
options:
|
|
28716
|
-
ref_key: "
|
|
28717
|
-
ref:
|
|
28853
|
+
return openBlock(), createBlock(unref(_sfc_main$V), {
|
|
28854
|
+
options: fullSearchBoxOptions.value,
|
|
28855
|
+
ref_key: "searchBox",
|
|
28856
|
+
ref: searchBox2
|
|
28718
28857
|
}, null, 8, ["options"]);
|
|
28719
28858
|
};
|
|
28720
28859
|
}
|
|
28721
28860
|
});
|
|
28722
|
-
const
|
|
28723
|
-
|
|
28724
|
-
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
|
|
28730
|
-
|
|
28731
|
-
|
|
28732
|
-
|
|
28733
|
-
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28737
|
-
|
|
28738
|
-
|
|
28739
|
-
|
|
28740
|
-
|
|
28741
|
-
|
|
28742
|
-
|
|
28743
|
-
|
|
28744
|
-
|
|
28745
|
-
|
|
28746
|
-
|
|
28747
|
-
|
|
28748
|
-
|
|
28749
|
-
|
|
28750
|
-
|
|
28751
|
-
|
|
28752
|
-
|
|
28753
|
-
|
|
28754
|
-
|
|
28755
|
-
|
|
28756
|
-
|
|
28757
|
-
|
|
28758
|
-
|
|
28759
|
-
|
|
28760
|
-
|
|
28761
|
-
if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
|
|
28762
|
-
const style = document.createElement("style");
|
|
28763
|
-
style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
|
|
28764
|
-
shadow.appendChild(style);
|
|
28765
|
-
}
|
|
28766
|
-
};
|
|
28767
|
-
const displayDiscountedPriceSection = (doc2, options) => {
|
|
28768
|
-
var _a, _b;
|
|
28769
|
-
const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
|
|
28770
|
-
const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
|
|
28771
|
-
return discountPrice && regularPrice && discountPrice < regularPrice;
|
|
28772
|
-
};
|
|
28773
|
-
const displayRegularPriceSection = (doc2, options) => {
|
|
28774
|
-
var _a, _b;
|
|
28775
|
-
const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
|
|
28776
|
-
const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
|
|
28777
|
-
const anyPrice = discountPrice || regularPrice;
|
|
28778
|
-
return anyPrice && !displayDiscountedPriceSection(doc2, options);
|
|
28779
|
-
};
|
|
28780
|
-
const escapeHtml = (source) => {
|
|
28781
|
-
if (!source) {
|
|
28782
|
-
return source;
|
|
28783
|
-
}
|
|
28784
|
-
return `${source}`.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
28785
|
-
};
|
|
28786
|
-
const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
|
|
28787
|
-
if (!value) {
|
|
28788
|
-
return 0;
|
|
28789
|
-
}
|
|
28790
|
-
try {
|
|
28791
|
-
return +parseFloat(`${value}`).toFixed(maxDecimal);
|
|
28792
|
-
} catch (e2) {
|
|
28793
|
-
return `${value}`;
|
|
28794
|
-
}
|
|
28795
|
-
};
|
|
28796
|
-
const capitalize = (value) => {
|
|
28797
|
-
if (!value) {
|
|
28798
|
-
return "";
|
|
28799
|
-
}
|
|
28800
|
-
return value.charAt(0).toLocaleUpperCase() + value.slice(1);
|
|
28801
|
-
};
|
|
28802
|
-
const getAlphanumeric = (value) => {
|
|
28803
|
-
if (!value) {
|
|
28804
|
-
return "";
|
|
28805
|
-
}
|
|
28806
|
-
return value.replace(/[\W_]/g, " ");
|
|
28807
|
-
};
|
|
28808
|
-
const getAdditionalElements = (fields) => {
|
|
28809
|
-
return fields.map((key) => ({
|
|
28810
|
-
type: "custom",
|
|
28811
|
-
key,
|
|
28812
|
-
label: capitalize(getAlphanumeric(key)),
|
|
28813
|
-
className: "lupa-custom",
|
|
28814
|
-
display: (doc2) => Boolean(doc2[key])
|
|
28815
|
-
}));
|
|
28816
|
-
};
|
|
28817
|
-
const addFieldIfKeyExists = (field, key, config) => {
|
|
28818
|
-
if (key) {
|
|
28819
|
-
return config;
|
|
28820
|
-
}
|
|
28821
|
-
return { key: field, type: "customHtml", display: () => false };
|
|
28822
|
-
};
|
|
28823
|
-
const getSearchBoxComponent = ({
|
|
28824
|
-
searchBoxOptions,
|
|
28825
|
-
labels,
|
|
28826
|
-
panelOptions,
|
|
28827
|
-
redirections,
|
|
28828
|
-
placeholderImage
|
|
28829
|
-
}) => {
|
|
28830
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
28831
|
-
const panels = [
|
|
28832
|
-
...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
|
|
28833
|
-
{
|
|
28834
|
-
type: SearchBoxPanelType.SUGGESTION,
|
|
28835
|
-
queryKey: searchBoxOptions.suggestionQueryKey,
|
|
28836
|
-
highlight: true,
|
|
28837
|
-
limit: 8,
|
|
28838
|
-
labels: {
|
|
28839
|
-
topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
|
|
28840
|
-
}
|
|
28841
|
-
}
|
|
28842
|
-
] : [],
|
|
28843
|
-
...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
|
|
28844
|
-
{
|
|
28845
|
-
type: SearchBoxPanelType.DOCUMENT,
|
|
28846
|
-
queryKey: searchBoxOptions.documentQueryKey,
|
|
28847
|
-
limit: 5,
|
|
28848
|
-
elements: [
|
|
28849
|
-
{
|
|
28850
|
-
type: "image",
|
|
28851
|
-
placeholder: placeholderImage,
|
|
28852
|
-
key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
|
|
28853
|
-
baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
|
|
28854
|
-
},
|
|
28855
|
-
{
|
|
28856
|
-
type: "title",
|
|
28857
|
-
key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
|
|
28858
|
-
maxLines: 2
|
|
28859
|
-
},
|
|
28860
|
-
{
|
|
28861
|
-
type: "regularPrice",
|
|
28862
|
-
key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
|
|
28863
|
-
display: (doc2) => {
|
|
28864
|
-
var _a2, _b2, _c2, _d2;
|
|
28865
|
-
return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
|
|
28866
|
-
}
|
|
28867
|
-
},
|
|
28868
|
-
{
|
|
28869
|
-
type: "price",
|
|
28870
|
-
key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
|
|
28871
|
-
}
|
|
28872
|
-
]
|
|
28873
|
-
}
|
|
28874
|
-
] : []
|
|
28875
|
-
];
|
|
28876
|
-
return {
|
|
28877
|
-
inputSelector: searchBoxOptions.inputSelector,
|
|
28878
|
-
options: {
|
|
28879
|
-
environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
|
|
28880
|
-
customUrl: searchBoxOptions.customUrl,
|
|
28881
|
-
customBaseUrl: searchBoxOptions.customBaseUrl,
|
|
28882
|
-
customPayload: searchBoxOptions.customPayload,
|
|
28883
|
-
customHeaders: searchBoxOptions.customHeaders
|
|
28884
|
-
},
|
|
28885
|
-
showTotalCount: true,
|
|
28886
|
-
expandOnSinglePanel: true,
|
|
28887
|
-
minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
|
|
28888
|
-
debounce: 250,
|
|
28889
|
-
labels: labels == null ? void 0 : labels.searchBox,
|
|
28890
|
-
links: {
|
|
28891
|
-
searchResults: ""
|
|
28861
|
+
const DEFAULT_OPTIONS_RESULTS = {
|
|
28862
|
+
options: {
|
|
28863
|
+
environment: "production"
|
|
28864
|
+
},
|
|
28865
|
+
queryKey: "",
|
|
28866
|
+
containerSelector: "#searchResultsContainer",
|
|
28867
|
+
searchTitlePosition: "page-top",
|
|
28868
|
+
labels: {
|
|
28869
|
+
pageSize: "Page size:",
|
|
28870
|
+
sortBy: "Sort by:",
|
|
28871
|
+
itemCount: "Items {1} of {2}",
|
|
28872
|
+
filteredItemCount: "",
|
|
28873
|
+
currency: "€",
|
|
28874
|
+
showMore: "Show more",
|
|
28875
|
+
searchResults: "Search Query: ",
|
|
28876
|
+
emptyResults: "There are no results for the query:",
|
|
28877
|
+
mobileFilterButton: "Filter",
|
|
28878
|
+
htmlTitleTemplate: "Search Query: '{1}'",
|
|
28879
|
+
noResultsSuggestion: "No results found for this query: {1}",
|
|
28880
|
+
didYouMean: "Did you mean to search: {1}",
|
|
28881
|
+
similarQuery: "Search results for phrase {1}",
|
|
28882
|
+
similarQueries: "Similar queries:"
|
|
28883
|
+
},
|
|
28884
|
+
grid: {
|
|
28885
|
+
columns: {
|
|
28886
|
+
xl: 4,
|
|
28887
|
+
l: 3,
|
|
28888
|
+
md: 2,
|
|
28889
|
+
sm: 2,
|
|
28890
|
+
xs: 1
|
|
28891
|
+
}
|
|
28892
|
+
},
|
|
28893
|
+
pagination: {
|
|
28894
|
+
sizeSelection: {
|
|
28895
|
+
position: {
|
|
28896
|
+
top: false,
|
|
28897
|
+
bottom: true
|
|
28898
|
+
},
|
|
28899
|
+
sizes: [12, 24, 36]
|
|
28892
28900
|
},
|
|
28893
|
-
|
|
28894
|
-
|
|
28895
|
-
|
|
28896
|
-
|
|
28897
|
-
|
|
28898
|
-
|
|
28901
|
+
pageSelection: {
|
|
28902
|
+
position: {
|
|
28903
|
+
top: false,
|
|
28904
|
+
bottom: true
|
|
28905
|
+
},
|
|
28906
|
+
display: 5,
|
|
28907
|
+
displayMobile: 3
|
|
28899
28908
|
}
|
|
28900
|
-
}
|
|
28901
|
-
|
|
28902
|
-
|
|
28903
|
-
searchResultOptions,
|
|
28904
|
-
labels,
|
|
28905
|
-
redirections,
|
|
28906
|
-
placeholderImage,
|
|
28907
|
-
configuratorOverrides,
|
|
28908
|
-
callbacks,
|
|
28909
|
-
additionalFields
|
|
28910
|
-
}) => {
|
|
28911
|
-
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;
|
|
28912
|
-
const filters = searchResultOptions.showFacets ? {
|
|
28909
|
+
},
|
|
28910
|
+
sort: [],
|
|
28911
|
+
filters: {
|
|
28913
28912
|
currentFilters: {
|
|
28914
28913
|
visibility: {
|
|
28915
28914
|
mobileSidebar: true,
|
|
28916
28915
|
mobileToolbar: true
|
|
28917
28916
|
},
|
|
28918
28917
|
labels: {
|
|
28919
|
-
title: "",
|
|
28920
|
-
clearAll:
|
|
28918
|
+
title: "Current filters:",
|
|
28919
|
+
clearAll: "Clear all"
|
|
28921
28920
|
}
|
|
28922
28921
|
},
|
|
28923
28922
|
facets: {
|
|
28924
28923
|
labels: {
|
|
28925
|
-
title:
|
|
28926
|
-
showAll:
|
|
28927
|
-
facetFilter:
|
|
28928
|
-
facetClear:
|
|
28924
|
+
title: "Filters:",
|
|
28925
|
+
showAll: "Show more",
|
|
28926
|
+
facetFilter: "Filter...",
|
|
28927
|
+
facetClear: "Clear"
|
|
28929
28928
|
},
|
|
28930
28929
|
filterable: {
|
|
28931
28930
|
minValues: 5
|
|
@@ -28935,179 +28934,230 @@ const getSearchResultsComponent = ({
|
|
|
28935
28934
|
topLevelValueCountLimit: 5,
|
|
28936
28935
|
filterable: true
|
|
28937
28936
|
},
|
|
28938
|
-
|
|
28939
|
-
slider: true,
|
|
28940
|
-
inputs: true,
|
|
28941
|
-
labels: {
|
|
28942
|
-
from: "",
|
|
28943
|
-
to: ""
|
|
28944
|
-
}
|
|
28945
|
-
},
|
|
28946
|
-
facetValueCountLimit: 8,
|
|
28937
|
+
facetValueCountLimit: 20,
|
|
28947
28938
|
showDocumentCount: true,
|
|
28948
28939
|
style: {
|
|
28949
28940
|
type: "sidebar"
|
|
28950
28941
|
}
|
|
28951
28942
|
}
|
|
28952
|
-
}
|
|
28953
|
-
|
|
28954
|
-
|
|
28955
|
-
|
|
28956
|
-
|
|
28957
|
-
|
|
28958
|
-
|
|
28959
|
-
|
|
28960
|
-
|
|
28961
|
-
|
|
28962
|
-
|
|
28963
|
-
|
|
28964
|
-
|
|
28965
|
-
|
|
28966
|
-
|
|
28967
|
-
|
|
28968
|
-
|
|
28969
|
-
|
|
28970
|
-
|
|
28971
|
-
|
|
28972
|
-
|
|
28973
|
-
|
|
28974
|
-
|
|
28975
|
-
|
|
28976
|
-
|
|
28977
|
-
|
|
28978
|
-
|
|
28979
|
-
|
|
28980
|
-
|
|
28981
|
-
|
|
28982
|
-
|
|
28983
|
-
|
|
28984
|
-
|
|
28985
|
-
|
|
28986
|
-
}
|
|
28987
|
-
|
|
28988
|
-
|
|
28989
|
-
|
|
28990
|
-
|
|
28991
|
-
|
|
28992
|
-
|
|
28993
|
-
|
|
28994
|
-
|
|
28995
|
-
|
|
28996
|
-
|
|
28997
|
-
|
|
28998
|
-
|
|
28999
|
-
|
|
29000
|
-
|
|
29001
|
-
|
|
29002
|
-
|
|
29003
|
-
|
|
29004
|
-
|
|
29005
|
-
|
|
29006
|
-
|
|
29007
|
-
|
|
29008
|
-
|
|
29009
|
-
|
|
29010
|
-
|
|
29011
|
-
|
|
29012
|
-
|
|
29013
|
-
|
|
29014
|
-
|
|
29015
|
-
|
|
29016
|
-
|
|
29017
|
-
|
|
29018
|
-
|
|
29019
|
-
|
|
29020
|
-
|
|
29021
|
-
|
|
29022
|
-
|
|
29023
|
-
|
|
29024
|
-
|
|
29025
|
-
|
|
29026
|
-
|
|
29027
|
-
},
|
|
29028
|
-
isInStock: () => {
|
|
29029
|
-
return true;
|
|
29030
|
-
}
|
|
29031
|
-
}, badges), {
|
|
29032
|
-
links: {
|
|
29033
|
-
details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
|
|
29034
|
-
},
|
|
29035
|
-
callbacks,
|
|
29036
|
-
routingBehavior: callbacks ? "event" : "direct-link",
|
|
29037
|
-
idKey: "id",
|
|
29038
|
-
elements: [
|
|
29039
|
-
{
|
|
29040
|
-
type: "image",
|
|
29041
|
-
placeholder: placeholderImage,
|
|
29042
|
-
key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
|
|
29043
|
-
baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
|
|
29044
|
-
display: () => {
|
|
29045
|
-
var _a2;
|
|
29046
|
-
return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
|
|
29047
|
-
}
|
|
29048
|
-
},
|
|
29049
|
-
addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
|
|
29050
|
-
type: "custom",
|
|
29051
|
-
className: "lupa-custom-emphasis",
|
|
29052
|
-
key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
|
|
29053
|
-
display: () => true
|
|
29054
|
-
}),
|
|
29055
|
-
{
|
|
29056
|
-
type: "title",
|
|
29057
|
-
key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
|
|
29058
|
-
maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
|
|
29059
|
-
display: (doc2) => {
|
|
29060
|
-
var _a2, _b2;
|
|
29061
|
-
return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
|
|
29062
|
-
}
|
|
29063
|
-
},
|
|
29064
|
-
...getAdditionalElements(additionalFields),
|
|
29065
|
-
addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
|
|
29066
|
-
key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
|
|
29067
|
-
type: "customHtml",
|
|
29068
|
-
className: "lupa-price lupa-price-discounted",
|
|
29069
|
-
display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
|
|
29070
|
-
html: (doc2) => {
|
|
29071
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
29072
|
-
const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
|
|
29073
|
-
const discountPrice = (_d2 = parseFloat(
|
|
29074
|
-
doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
|
|
29075
|
-
)) == null ? void 0 : _d2.toFixed(2);
|
|
29076
|
-
const regularPrice = (_g2 = parseFloat(
|
|
29077
|
-
doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
|
|
29078
|
-
)) == null ? void 0 : _g2.toFixed(2);
|
|
29079
|
-
const discount = `<span class="lupa-discount">${escapeHtml(
|
|
29080
|
-
discountPrice
|
|
29081
|
-
)} ${currency}</span>`;
|
|
29082
|
-
const regular = `<span class="lupa-regular">${escapeHtml(
|
|
29083
|
-
regularPrice
|
|
29084
|
-
)} ${currency}</span>`;
|
|
29085
|
-
return discount + regular;
|
|
29086
|
-
}
|
|
29087
|
-
}),
|
|
29088
|
-
addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
|
|
29089
|
-
key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
|
|
29090
|
-
type: "customHtml",
|
|
29091
|
-
className: "lupa-price lupa-price-single",
|
|
29092
|
-
display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
|
|
29093
|
-
html: (doc2) => {
|
|
29094
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
29095
|
-
const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
|
|
29096
|
-
const price = (_g2 = parseFloat(
|
|
29097
|
-
(_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
|
|
29098
|
-
)) == null ? void 0 : _g2.toFixed(2);
|
|
29099
|
-
return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
|
|
29100
|
-
}
|
|
29101
|
-
})
|
|
29102
|
-
],
|
|
29103
|
-
breadcrumbs: [],
|
|
29104
|
-
sort: [],
|
|
29105
|
-
redirections
|
|
29106
|
-
}), configuratorOverrides);
|
|
28943
|
+
},
|
|
28944
|
+
toolbar: {
|
|
28945
|
+
layoutSelector: true,
|
|
28946
|
+
itemSummary: true,
|
|
28947
|
+
clearFilters: false
|
|
28948
|
+
},
|
|
28949
|
+
isInStock: () => {
|
|
28950
|
+
return true;
|
|
28951
|
+
},
|
|
28952
|
+
badges: {
|
|
28953
|
+
anchor: "tr",
|
|
28954
|
+
elements: []
|
|
28955
|
+
},
|
|
28956
|
+
links: {
|
|
28957
|
+
details: "/{id}"
|
|
28958
|
+
},
|
|
28959
|
+
elements: [],
|
|
28960
|
+
breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
|
|
28961
|
+
};
|
|
28962
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
28963
|
+
__name: "SearchResultsEntry",
|
|
28964
|
+
props: {
|
|
28965
|
+
searchResultsOptions: {}
|
|
28966
|
+
},
|
|
28967
|
+
setup(__props, { expose: __expose }) {
|
|
28968
|
+
const props = __props;
|
|
28969
|
+
const searchResults2 = ref(null);
|
|
28970
|
+
const fullSearchResultsOptions = computed(() => {
|
|
28971
|
+
const options = lodashExports.cloneDeep(props.searchResultsOptions);
|
|
28972
|
+
return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
|
|
28973
|
+
});
|
|
28974
|
+
const fetch2 = () => {
|
|
28975
|
+
var _a;
|
|
28976
|
+
(_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
|
|
28977
|
+
};
|
|
28978
|
+
__expose({ fetch: fetch2 });
|
|
28979
|
+
return (_ctx, _cache) => {
|
|
28980
|
+
return openBlock(), createBlock(unref(_sfc_main$c), {
|
|
28981
|
+
options: fullSearchResultsOptions.value,
|
|
28982
|
+
ref_key: "searchResults",
|
|
28983
|
+
ref: searchResults2
|
|
28984
|
+
}, null, 8, ["options"]);
|
|
28985
|
+
};
|
|
28986
|
+
}
|
|
28987
|
+
});
|
|
28988
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
28989
|
+
__name: "ProductListEntry",
|
|
28990
|
+
props: {
|
|
28991
|
+
productListOptions: {}
|
|
28992
|
+
},
|
|
28993
|
+
setup(__props, { expose: __expose }) {
|
|
28994
|
+
const props = __props;
|
|
28995
|
+
const productList2 = ref(null);
|
|
28996
|
+
const fullProductListOptions = computed(() => {
|
|
28997
|
+
return lodashExports.cloneDeep(props.productListOptions);
|
|
28998
|
+
});
|
|
28999
|
+
const fetch2 = () => {
|
|
29000
|
+
var _a;
|
|
29001
|
+
(_a = productList2.value) == null ? void 0 : _a.fetch();
|
|
29002
|
+
};
|
|
29003
|
+
__expose({ fetch: fetch2 });
|
|
29004
|
+
return (_ctx, _cache) => {
|
|
29005
|
+
return openBlock(), createBlock(unref(_sfc_main$a), {
|
|
29006
|
+
options: fullProductListOptions.value,
|
|
29007
|
+
ref_key: "productList",
|
|
29008
|
+
ref: productList2
|
|
29009
|
+
}, null, 8, ["options"]);
|
|
29010
|
+
};
|
|
29011
|
+
}
|
|
29012
|
+
});
|
|
29013
|
+
const QUERY_PARAMS = {
|
|
29014
|
+
QUERY: "q",
|
|
29015
|
+
PAGE: "p",
|
|
29016
|
+
LIMIT: "l",
|
|
29017
|
+
SORT: "s"
|
|
29107
29018
|
};
|
|
29108
|
-
const
|
|
29109
|
-
|
|
29110
|
-
|
|
29019
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
29020
|
+
__name: "SearchContainerEntry",
|
|
29021
|
+
props: {
|
|
29022
|
+
searchContainerOptions: {}
|
|
29023
|
+
},
|
|
29024
|
+
setup(__props, { expose: __expose }) {
|
|
29025
|
+
const props = __props;
|
|
29026
|
+
const isOpen = ref(false);
|
|
29027
|
+
const triggerElement = ref(null);
|
|
29028
|
+
const productList2 = ref(null);
|
|
29029
|
+
const containerOptions = computed(() => {
|
|
29030
|
+
return lodashExports.cloneDeep(props.searchContainerOptions);
|
|
29031
|
+
});
|
|
29032
|
+
const focus = () => {
|
|
29033
|
+
const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
|
|
29034
|
+
el == null ? void 0 : el.focus();
|
|
29035
|
+
};
|
|
29036
|
+
const close = () => {
|
|
29037
|
+
isOpen.value = false;
|
|
29038
|
+
};
|
|
29039
|
+
const openSearchContainer = () => {
|
|
29040
|
+
isOpen.value = true;
|
|
29041
|
+
};
|
|
29042
|
+
const checkCloseOnEscape = (e2) => {
|
|
29043
|
+
var _a;
|
|
29044
|
+
if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
|
|
29045
|
+
return;
|
|
29046
|
+
}
|
|
29047
|
+
isOpen.value = false;
|
|
29048
|
+
};
|
|
29049
|
+
const checkExistingQuery = () => {
|
|
29050
|
+
const url = new URL(window.location.href);
|
|
29051
|
+
const param = url.searchParams.get(QUERY_PARAMS.QUERY);
|
|
29052
|
+
if (!param) {
|
|
29053
|
+
return;
|
|
29054
|
+
}
|
|
29055
|
+
isOpen.value = true;
|
|
29056
|
+
};
|
|
29057
|
+
const mountOpenListeners = () => {
|
|
29058
|
+
var _a, _b;
|
|
29059
|
+
triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
|
|
29060
|
+
(_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
|
|
29061
|
+
window.addEventListener("keydown", checkCloseOnEscape);
|
|
29062
|
+
};
|
|
29063
|
+
onMounted(() => {
|
|
29064
|
+
var _a, _b;
|
|
29065
|
+
mountOpenListeners();
|
|
29066
|
+
checkExistingQuery();
|
|
29067
|
+
isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
|
|
29068
|
+
});
|
|
29069
|
+
onBeforeUnmount(() => {
|
|
29070
|
+
var _a;
|
|
29071
|
+
(_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
|
|
29072
|
+
window.removeEventListener("keydown", checkCloseOnEscape);
|
|
29073
|
+
});
|
|
29074
|
+
const fetch2 = () => {
|
|
29075
|
+
var _a;
|
|
29076
|
+
(_a = productList2.value) == null ? void 0 : _a.fetch();
|
|
29077
|
+
};
|
|
29078
|
+
const reloadOptions = () => {
|
|
29079
|
+
var _a;
|
|
29080
|
+
(_a = productList2.value) == null ? void 0 : _a.reloadOptions();
|
|
29081
|
+
};
|
|
29082
|
+
__expose({ fetch: fetch2, reloadOptions });
|
|
29083
|
+
return (_ctx, _cache) => {
|
|
29084
|
+
return openBlock(), createElementBlock("div", null, [
|
|
29085
|
+
containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
|
|
29086
|
+
key: 0,
|
|
29087
|
+
options: containerOptions.value,
|
|
29088
|
+
ref_key: "productList",
|
|
29089
|
+
ref: productList2,
|
|
29090
|
+
"onHook:mounted": focus,
|
|
29091
|
+
onClose: close
|
|
29092
|
+
}, null, 8, ["options"])) : createCommentVNode("", true)
|
|
29093
|
+
]);
|
|
29094
|
+
};
|
|
29095
|
+
}
|
|
29096
|
+
});
|
|
29097
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
29098
|
+
__name: "RecommendationsEntry",
|
|
29099
|
+
props: {
|
|
29100
|
+
recommendationOptions: {}
|
|
29101
|
+
},
|
|
29102
|
+
setup(__props, { expose: __expose }) {
|
|
29103
|
+
const productRecommendations = ref(null);
|
|
29104
|
+
const fetch2 = () => {
|
|
29105
|
+
productRecommendations == null ? void 0 : productRecommendations.fetch();
|
|
29106
|
+
};
|
|
29107
|
+
__expose({ fetch: fetch2 });
|
|
29108
|
+
return (_ctx, _cache) => {
|
|
29109
|
+
return openBlock(), createBlock(unref(_sfc_main$8), {
|
|
29110
|
+
options: _ctx.recommendationOptions,
|
|
29111
|
+
ref_key: "productRecommendations",
|
|
29112
|
+
ref: productRecommendations
|
|
29113
|
+
}, null, 8, ["options"]);
|
|
29114
|
+
};
|
|
29115
|
+
}
|
|
29116
|
+
});
|
|
29117
|
+
const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
|
|
29118
|
+
const createShadowDom = (shadowId, managerId) => {
|
|
29119
|
+
let host = document.getElementById(shadowId);
|
|
29120
|
+
if (host) {
|
|
29121
|
+
host.remove();
|
|
29122
|
+
}
|
|
29123
|
+
host = document.createElement("div");
|
|
29124
|
+
const manager = document.createElement("div");
|
|
29125
|
+
host.setAttribute("id", shadowId);
|
|
29126
|
+
manager == null ? void 0 : manager.setAttribute("id", managerId);
|
|
29127
|
+
return { host, manager };
|
|
29128
|
+
};
|
|
29129
|
+
const attatchShadowDom = ({
|
|
29130
|
+
host,
|
|
29131
|
+
manager,
|
|
29132
|
+
styleUrl,
|
|
29133
|
+
options
|
|
29134
|
+
}) => {
|
|
29135
|
+
var _a;
|
|
29136
|
+
if (host.shadowRoot) {
|
|
29137
|
+
return;
|
|
29138
|
+
}
|
|
29139
|
+
const link = document.createElement("link");
|
|
29140
|
+
link.type = "text/css";
|
|
29141
|
+
link.rel = "stylesheet";
|
|
29142
|
+
link.href = styleUrl;
|
|
29143
|
+
const fontLink = document.createElement("link");
|
|
29144
|
+
fontLink.type = "text/css";
|
|
29145
|
+
fontLink.rel = "stylesheet";
|
|
29146
|
+
fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
|
|
29147
|
+
document.head.appendChild(fontLink);
|
|
29148
|
+
const materialIconLink = document.createElement("link");
|
|
29149
|
+
materialIconLink.type = "text/css";
|
|
29150
|
+
materialIconLink.rel = "stylesheet";
|
|
29151
|
+
materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
|
|
29152
|
+
document.head.appendChild(materialIconLink);
|
|
29153
|
+
const shadow = host.attachShadow({ mode: "open" });
|
|
29154
|
+
shadow.appendChild(manager);
|
|
29155
|
+
shadow.appendChild(link);
|
|
29156
|
+
if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
|
|
29157
|
+
const style = document.createElement("style");
|
|
29158
|
+
style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
|
|
29159
|
+
shadow.appendChild(style);
|
|
29160
|
+
}
|
|
29111
29161
|
};
|
|
29112
29162
|
const getMountElement = (element, mountingBehavior = "replace", mountToParent) => {
|
|
29113
29163
|
const parent = element == null ? void 0 : element.parentElement;
|
|
@@ -29138,7 +29188,7 @@ const createVue = (selector, mountingBehavior = "replace", rootComponent, option
|
|
|
29138
29188
|
return;
|
|
29139
29189
|
}
|
|
29140
29190
|
let mountedComponent = null;
|
|
29141
|
-
const props = reactive(
|
|
29191
|
+
const props = reactive(__spreadValues2({}, options));
|
|
29142
29192
|
const app2 = createApp({
|
|
29143
29193
|
render: () => mountedComponent = h$1(rootComponent, props)
|
|
29144
29194
|
});
|
|
@@ -29157,9 +29207,6 @@ const app = {
|
|
|
29157
29207
|
recommendations: {},
|
|
29158
29208
|
chat: {}
|
|
29159
29209
|
};
|
|
29160
|
-
const tracking = (options) => {
|
|
29161
|
-
setupTracking(options);
|
|
29162
|
-
};
|
|
29163
29210
|
const applySearchBox = (options, mountOptions) => {
|
|
29164
29211
|
const existingInstance = app.box[options.inputSelector];
|
|
29165
29212
|
if (existingInstance) {
|
|
@@ -29188,7 +29235,7 @@ const searchBox = (options, mountOptions) => {
|
|
|
29188
29235
|
var _a;
|
|
29189
29236
|
const inputs = (_a = options.inputSelector) == null ? void 0 : _a.split(",");
|
|
29190
29237
|
for (const input of inputs) {
|
|
29191
|
-
applySearchBox(
|
|
29238
|
+
applySearchBox(__spreadProps2(__spreadValues2({}, options), { inputSelector: input.trim() }), mountOptions);
|
|
29192
29239
|
}
|
|
29193
29240
|
};
|
|
29194
29241
|
const searchResults = (options, mountOptions) => {
|
|
@@ -29424,7 +29471,237 @@ const clearChat = (selector) => {
|
|
|
29424
29471
|
} catch (e2) {
|
|
29425
29472
|
}
|
|
29426
29473
|
};
|
|
29474
|
+
const saveToLocalStorage = (key, value) => {
|
|
29475
|
+
try {
|
|
29476
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
29477
|
+
} catch (e2) {
|
|
29478
|
+
}
|
|
29479
|
+
};
|
|
29480
|
+
const tryLoadFromLocalStorage = (key) => {
|
|
29481
|
+
try {
|
|
29482
|
+
const item = localStorage.getItem(key);
|
|
29483
|
+
return item ? JSON.parse(item) : null;
|
|
29484
|
+
} catch (e2) {
|
|
29485
|
+
return null;
|
|
29486
|
+
}
|
|
29487
|
+
};
|
|
29488
|
+
const saveToSessionStorage = (key, value) => {
|
|
29489
|
+
try {
|
|
29490
|
+
sessionStorage.setItem(key, JSON.stringify(value));
|
|
29491
|
+
} catch (e2) {
|
|
29492
|
+
}
|
|
29493
|
+
};
|
|
29494
|
+
const tryLoadFromSessionStorage = (key) => {
|
|
29495
|
+
try {
|
|
29496
|
+
const item = sessionStorage.getItem(key);
|
|
29497
|
+
return item ? JSON.parse(item) : null;
|
|
29498
|
+
} catch (e2) {
|
|
29499
|
+
return null;
|
|
29500
|
+
}
|
|
29501
|
+
};
|
|
29502
|
+
const getQueryParam = (name) => {
|
|
29503
|
+
try {
|
|
29504
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
29505
|
+
return urlParams.get(name);
|
|
29506
|
+
} catch (e2) {
|
|
29507
|
+
return null;
|
|
29508
|
+
}
|
|
29509
|
+
};
|
|
29510
|
+
const PREVIEW_PARAMETER = "lupaSearchPreview";
|
|
29511
|
+
let styleElement = null;
|
|
29512
|
+
const waitForElementToBeVisible = (element, retries = 0, maxRetries = 10, interval = 10) => __async2(exports, null, function* () {
|
|
29513
|
+
if (retries > maxRetries) {
|
|
29514
|
+
return false;
|
|
29515
|
+
}
|
|
29516
|
+
if (typeof element === "string") {
|
|
29517
|
+
element = document.querySelector(element);
|
|
29518
|
+
}
|
|
29519
|
+
if (element) {
|
|
29520
|
+
return true;
|
|
29521
|
+
} else {
|
|
29522
|
+
setTimeout(() => {
|
|
29523
|
+
waitForElementToBeVisible(element, retries + 1, maxRetries, interval + 10);
|
|
29524
|
+
}, interval);
|
|
29525
|
+
}
|
|
29526
|
+
});
|
|
29527
|
+
const loadAndSaveConfigurationFromServer = (configurationKey, options) => __async2(exports, null, function* () {
|
|
29528
|
+
const configuration2 = yield fetchPluginConfiguration(
|
|
29529
|
+
options,
|
|
29530
|
+
configurationKey
|
|
29531
|
+
);
|
|
29532
|
+
if (!configuration2) {
|
|
29533
|
+
console.error(`Failed to fetch LupaSearch plugin configuration for key ${configurationKey}`);
|
|
29534
|
+
return null;
|
|
29535
|
+
}
|
|
29536
|
+
saveToLocalStorage(configurationKey, configuration2);
|
|
29537
|
+
return configuration2;
|
|
29538
|
+
});
|
|
29539
|
+
const checkIsPreviewMode = () => {
|
|
29540
|
+
const isPreviewModeSaved = tryLoadFromSessionStorage(PREVIEW_PARAMETER);
|
|
29541
|
+
if (isPreviewModeSaved) {
|
|
29542
|
+
return isPreviewModeSaved;
|
|
29543
|
+
}
|
|
29544
|
+
const isPreviewMode = getQueryParam(PREVIEW_PARAMETER) === "true";
|
|
29545
|
+
if (isPreviewMode) {
|
|
29546
|
+
saveToSessionStorage(PREVIEW_PARAMETER, isPreviewMode);
|
|
29547
|
+
} else {
|
|
29548
|
+
saveToSessionStorage(PREVIEW_PARAMETER, false);
|
|
29549
|
+
}
|
|
29550
|
+
return isPreviewMode;
|
|
29551
|
+
};
|
|
29552
|
+
const loadConfigurations = (configurationKey, isPreviewMode, options) => __async2(exports, null, function* () {
|
|
29553
|
+
if (isPreviewMode) {
|
|
29554
|
+
return loadAndSaveConfigurationFromServer(configurationKey, options);
|
|
29555
|
+
}
|
|
29556
|
+
const existingConfiguration = tryLoadFromLocalStorage(configurationKey);
|
|
29557
|
+
if (existingConfiguration) {
|
|
29558
|
+
setTimeout(() => __async2(exports, null, function* () {
|
|
29559
|
+
var _a;
|
|
29560
|
+
const newestConfiguration = yield loadAndSaveConfigurationFromServer(
|
|
29561
|
+
configurationKey,
|
|
29562
|
+
options
|
|
29563
|
+
);
|
|
29564
|
+
if (existingConfiguration.updatedAt === newestConfiguration.updatedAt) {
|
|
29565
|
+
return;
|
|
29566
|
+
}
|
|
29567
|
+
const isPreviewMode2 = checkIsPreviewMode();
|
|
29568
|
+
const configuration2 = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
|
|
29569
|
+
yield mount(configuration2, false);
|
|
29570
|
+
}), 5e3);
|
|
29571
|
+
return existingConfiguration;
|
|
29572
|
+
}
|
|
29573
|
+
return loadAndSaveConfigurationFromServer(configurationKey, options);
|
|
29574
|
+
});
|
|
29575
|
+
const applyStyles = (configuration2) => __async2(exports, null, function* () {
|
|
29576
|
+
var _a;
|
|
29577
|
+
const visible2 = yield waitForElementToBeVisible(document.head);
|
|
29578
|
+
if (!visible2) {
|
|
29579
|
+
console.error("Failed to apply custom LupaSearch styles, head element not found");
|
|
29580
|
+
return;
|
|
29581
|
+
}
|
|
29582
|
+
const baseStyleLink = configuration2.baseStyleLink;
|
|
29583
|
+
if (styleElement) {
|
|
29584
|
+
styleElement.remove();
|
|
29585
|
+
}
|
|
29586
|
+
styleElement = document.createElement("style");
|
|
29587
|
+
if (baseStyleLink) {
|
|
29588
|
+
styleElement.innerHTML = `
|
|
29589
|
+
@import url('${baseStyleLink}');
|
|
29590
|
+
@import url('https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css')
|
|
29591
|
+
${(_a = configuration2.customStyles) != null ? _a : ""}`;
|
|
29592
|
+
}
|
|
29593
|
+
document.head.appendChild(styleElement);
|
|
29594
|
+
});
|
|
29595
|
+
const mountSearchBox = (configuration, fetch = true) => __async2(exports, null, function* () {
|
|
29596
|
+
if (!configuration.searchBox) {
|
|
29597
|
+
return;
|
|
29598
|
+
}
|
|
29599
|
+
const resolvedConfiguration = eval(`(${configuration.searchBox})`);
|
|
29600
|
+
const visible = yield waitForElementToBeVisible(resolvedConfiguration.inputSelector);
|
|
29601
|
+
if (!visible) {
|
|
29602
|
+
console.error(
|
|
29603
|
+
`Failed to mount LupaSearch search box, input element ${resolvedConfiguration.inputSelector} not found`
|
|
29604
|
+
);
|
|
29605
|
+
return;
|
|
29606
|
+
}
|
|
29607
|
+
searchBox(resolvedConfiguration, { fetch });
|
|
29608
|
+
});
|
|
29609
|
+
const mountSearchResults = (configuration, fetch = true) => __async2(exports, null, function* () {
|
|
29610
|
+
if (!configuration.searchResults) {
|
|
29611
|
+
return;
|
|
29612
|
+
}
|
|
29613
|
+
const resolvedConfiguration = eval(`(${configuration.searchResults})`);
|
|
29614
|
+
const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
|
|
29615
|
+
if (!visible) {
|
|
29616
|
+
console.error(
|
|
29617
|
+
`Failed to mount LupaSearch search results, element ${resolvedConfiguration.containerSelector} not found`
|
|
29618
|
+
);
|
|
29619
|
+
return;
|
|
29620
|
+
}
|
|
29621
|
+
searchResults(resolvedConfiguration, { fetch });
|
|
29622
|
+
});
|
|
29623
|
+
const mountProductList = (configuration, fetch = true) => __async2(exports, null, function* () {
|
|
29624
|
+
if (!configuration.productList) {
|
|
29625
|
+
return;
|
|
29626
|
+
}
|
|
29627
|
+
const resolvedSearchResultsConfiguration = eval(
|
|
29628
|
+
`(${configuration.searchResults})`
|
|
29629
|
+
);
|
|
29630
|
+
const resolvedConfiguration = eval(`(${configuration.productList})`);
|
|
29631
|
+
const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
|
|
29632
|
+
if (!visible) {
|
|
29633
|
+
console.error(
|
|
29634
|
+
`Failed to mount LupaSearch product list, element ${resolvedConfiguration.containerSelector} not found`
|
|
29635
|
+
);
|
|
29636
|
+
return;
|
|
29637
|
+
}
|
|
29638
|
+
productList(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
|
|
29639
|
+
});
|
|
29640
|
+
const mountRecommendations = (configuration, fetch = true) => __async2(exports, null, function* () {
|
|
29641
|
+
if (!configuration.recommendations) {
|
|
29642
|
+
return;
|
|
29643
|
+
}
|
|
29644
|
+
const resolvedSearchResultsConfiguration = eval(
|
|
29645
|
+
`(${configuration.searchResults})`
|
|
29646
|
+
);
|
|
29647
|
+
const resolvedConfiguration = eval(
|
|
29648
|
+
`(${configuration.recommendations})`
|
|
29649
|
+
);
|
|
29650
|
+
const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
|
|
29651
|
+
if (!visible) {
|
|
29652
|
+
console.error(
|
|
29653
|
+
`Failed to mount LupaSearch recommendations, element ${resolvedConfiguration.containerSelector} not found`
|
|
29654
|
+
);
|
|
29655
|
+
return;
|
|
29656
|
+
}
|
|
29657
|
+
recommendations(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
|
|
29658
|
+
});
|
|
29659
|
+
const mountChat = (configuration, fetch = true) => __async2(exports, null, function* () {
|
|
29660
|
+
if (!configuration.genAiChat) {
|
|
29661
|
+
return;
|
|
29662
|
+
}
|
|
29663
|
+
const resolvedSearchResultsConfiguration = eval(
|
|
29664
|
+
`(${configuration.searchResults})`
|
|
29665
|
+
);
|
|
29666
|
+
const resolvedConfiguration = eval(`(${configuration.genAiChat})`);
|
|
29667
|
+
const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
|
|
29668
|
+
if (!visible) {
|
|
29669
|
+
console.error(
|
|
29670
|
+
`Failed to mount LupaSearch chat, element ${resolvedConfiguration.containerSelector} not found`
|
|
29671
|
+
);
|
|
29672
|
+
return;
|
|
29673
|
+
}
|
|
29674
|
+
chat(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
|
|
29675
|
+
});
|
|
29676
|
+
const mount = (configuration2, fetch2 = true) => __async2(exports, null, function* () {
|
|
29677
|
+
yield applyStyles(configuration2);
|
|
29678
|
+
const mountPromises = [
|
|
29679
|
+
mountSearchBox(configuration2, fetch2),
|
|
29680
|
+
mountSearchResults(configuration2, fetch2),
|
|
29681
|
+
mountProductList(configuration2, fetch2),
|
|
29682
|
+
mountRecommendations(configuration2, fetch2),
|
|
29683
|
+
mountChat(configuration2, fetch2)
|
|
29684
|
+
];
|
|
29685
|
+
yield Promise.all(mountPromises);
|
|
29686
|
+
});
|
|
29687
|
+
const init$1 = (configurationKey, options) => __async2(exports, null, function* () {
|
|
29688
|
+
var _a;
|
|
29689
|
+
const isPreviewMode = checkIsPreviewMode();
|
|
29690
|
+
const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
|
|
29691
|
+
const configuration2 = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
|
|
29692
|
+
yield mount(configuration2);
|
|
29693
|
+
});
|
|
29694
|
+
const PluginConfigurationManager = {
|
|
29695
|
+
init: init$1
|
|
29696
|
+
};
|
|
29697
|
+
const tracking = (options) => {
|
|
29698
|
+
setupTracking(options);
|
|
29699
|
+
};
|
|
29700
|
+
const init = (configurationKey, options) => {
|
|
29701
|
+
return PluginConfigurationManager.init(configurationKey, options);
|
|
29702
|
+
};
|
|
29427
29703
|
const lupaSearch = {
|
|
29704
|
+
init,
|
|
29428
29705
|
searchBox,
|
|
29429
29706
|
searchResults,
|
|
29430
29707
|
tracking,
|