@getlupa/vue 0.23.1 → 0.24.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/components/search-box/SearchBoxNoResults.vue.d.ts +3 -3
- package/dist/composables/useSorting.d.ts +3 -0
- package/dist/lupaContainerStyle.css +1 -1
- package/dist/lupaSearch.js +368 -171
- package/dist/lupaSearch.mjs +368 -171
- package/dist/style.css +1 -1
- package/dist/types/General.d.ts +2 -1
- package/dist/types/search-box/SearchBoxOptions.d.ts +4 -0
- package/dist/types/search-box/SearchBoxPanel.d.ts +3 -0
- package/dist/types/search-results/SearchResultsOptions.d.ts +1 -0
- package/dist/utils/query.utils.d.ts +1 -1
- package/package.json +2 -2
package/dist/lupaSearch.js
CHANGED
|
@@ -3740,11 +3740,11 @@ var parsePath = (string) => {
|
|
|
3740
3740
|
return result2;
|
|
3741
3741
|
};
|
|
3742
3742
|
init_esm_shims();
|
|
3743
|
-
function simpleTransformation(isApplicable, annotation,
|
|
3743
|
+
function simpleTransformation(isApplicable, annotation, transform2, untransform) {
|
|
3744
3744
|
return {
|
|
3745
3745
|
isApplicable,
|
|
3746
3746
|
annotation,
|
|
3747
|
-
transform,
|
|
3747
|
+
transform: transform2,
|
|
3748
3748
|
untransform
|
|
3749
3749
|
};
|
|
3750
3750
|
}
|
|
@@ -3805,11 +3805,11 @@ var simpleRules = [
|
|
|
3805
3805
|
}, Number),
|
|
3806
3806
|
simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
|
|
3807
3807
|
];
|
|
3808
|
-
function compositeTransformation(isApplicable, annotation,
|
|
3808
|
+
function compositeTransformation(isApplicable, annotation, transform2, untransform) {
|
|
3809
3809
|
return {
|
|
3810
3810
|
isApplicable,
|
|
3811
3811
|
annotation,
|
|
3812
|
-
transform,
|
|
3812
|
+
transform: transform2,
|
|
3813
3813
|
untransform
|
|
3814
3814
|
};
|
|
3815
3815
|
}
|
|
@@ -5722,33 +5722,6 @@ const addCustomParams = (url, customParams) => {
|
|
|
5722
5722
|
const separator = url.includes("?") ? "&" : "?";
|
|
5723
5723
|
return url + separator + e(customParams);
|
|
5724
5724
|
};
|
|
5725
|
-
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
5726
|
-
function adopt(value) {
|
|
5727
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
5728
|
-
resolve(value);
|
|
5729
|
-
});
|
|
5730
|
-
}
|
|
5731
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
5732
|
-
function fulfilled(value) {
|
|
5733
|
-
try {
|
|
5734
|
-
step(generator.next(value));
|
|
5735
|
-
} catch (e2) {
|
|
5736
|
-
reject(e2);
|
|
5737
|
-
}
|
|
5738
|
-
}
|
|
5739
|
-
function rejected(value) {
|
|
5740
|
-
try {
|
|
5741
|
-
step(generator["throw"](value));
|
|
5742
|
-
} catch (e2) {
|
|
5743
|
-
reject(e2);
|
|
5744
|
-
}
|
|
5745
|
-
}
|
|
5746
|
-
function step(result2) {
|
|
5747
|
-
result2.done ? resolve(result2.value) : adopt(result2.value).then(fulfilled, rejected);
|
|
5748
|
-
}
|
|
5749
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
5750
|
-
});
|
|
5751
|
-
};
|
|
5752
5725
|
const defaultConfig = {
|
|
5753
5726
|
method: "POST",
|
|
5754
5727
|
headers: { "Content-Type": "application/json" }
|
|
@@ -5759,7 +5732,7 @@ const customRequestConfig = ({ customHeaders }) => {
|
|
|
5759
5732
|
headers: Object.assign(Object.assign({}, defaultConfig.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
|
|
5760
5733
|
};
|
|
5761
5734
|
};
|
|
5762
|
-
const searchCustom = (query, options) =>
|
|
5735
|
+
const searchCustom = (query, options) => __async(null, null, function* () {
|
|
5763
5736
|
var _a25;
|
|
5764
5737
|
const res = yield fetch(options.customUrl, Object.assign(Object.assign({}, customRequestConfig({ customHeaders: options.customHeaders })), { body: JSON.stringify(Object.assign({ publicQuery: query }, (_a25 = options.customPayload) !== null && _a25 !== void 0 ? _a25 : {})) }));
|
|
5765
5738
|
if (res.status < 400) {
|
|
@@ -5769,9 +5742,9 @@ const searchCustom = (query, options) => __awaiter(void 0, void 0, void 0, funct
|
|
|
5769
5742
|
const errors = yield res.json();
|
|
5770
5743
|
return { success: false, errors };
|
|
5771
5744
|
});
|
|
5772
|
-
const suggestCustom = (query, options) =>
|
|
5773
|
-
var
|
|
5774
|
-
const res = yield fetch(options.customUrl, Object.assign(Object.assign({}, customRequestConfig({ customHeaders: options.customHeaders })), { body: JSON.stringify(Object.assign({ publicQuery: query }, (
|
|
5745
|
+
const suggestCustom = (query, options) => __async(null, null, function* () {
|
|
5746
|
+
var _a25;
|
|
5747
|
+
const res = yield fetch(options.customUrl, Object.assign(Object.assign({}, customRequestConfig({ customHeaders: options.customHeaders })), { body: JSON.stringify(Object.assign({ publicQuery: query }, (_a25 = options.customPayload) !== null && _a25 !== void 0 ? _a25 : {})) }));
|
|
5775
5748
|
if (res.status < 400) {
|
|
5776
5749
|
const items = yield res.json();
|
|
5777
5750
|
return { items, success: true };
|
|
@@ -5779,7 +5752,7 @@ const suggestCustom = (query, options) => __awaiter(void 0, void 0, void 0, func
|
|
|
5779
5752
|
const errors = yield res.json();
|
|
5780
5753
|
return { success: false, errors };
|
|
5781
5754
|
});
|
|
5782
|
-
const search = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5755
|
+
const search = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5783
5756
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`;
|
|
5784
5757
|
const url = addCustomParams(endpoint, customParams);
|
|
5785
5758
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5790,7 +5763,7 @@ const search = (queryKey, query, environment, customBaseUrl, customParams) => __
|
|
|
5790
5763
|
const errors = yield res.json();
|
|
5791
5764
|
return { success: false, errors };
|
|
5792
5765
|
});
|
|
5793
|
-
const facets = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5766
|
+
const facets = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5794
5767
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/facets`;
|
|
5795
5768
|
const url = addCustomParams(endpoint, customParams);
|
|
5796
5769
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5801,7 +5774,7 @@ const facets = (queryKey, query, environment, customBaseUrl, customParams) => __
|
|
|
5801
5774
|
const errors = yield res.json();
|
|
5802
5775
|
return { success: false, errors };
|
|
5803
5776
|
});
|
|
5804
|
-
const refiners = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5777
|
+
const refiners = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5805
5778
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/refiners`;
|
|
5806
5779
|
const url = addCustomParams(endpoint, customParams);
|
|
5807
5780
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5812,7 +5785,7 @@ const refiners = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
|
5812
5785
|
const errors = yield res.json();
|
|
5813
5786
|
return { success: false, errors };
|
|
5814
5787
|
});
|
|
5815
|
-
const relatedQueries = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5788
|
+
const relatedQueries = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5816
5789
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/related`;
|
|
5817
5790
|
const url = addCustomParams(endpoint, customParams);
|
|
5818
5791
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5823,7 +5796,7 @@ const relatedQueries = (queryKey, query, environment, customBaseUrl, customParam
|
|
|
5823
5796
|
const errors = yield res.json();
|
|
5824
5797
|
return { success: false, errors };
|
|
5825
5798
|
});
|
|
5826
|
-
const queryByIds = (queryKey, ids, environment, customBaseUrl, customParams) =>
|
|
5799
|
+
const queryByIds = (queryKey, ids, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5827
5800
|
const idParam = ids.map((id) => `ids=${id}`).join("&");
|
|
5828
5801
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`;
|
|
5829
5802
|
const url = addCustomParams(endpoint, customParams);
|
|
@@ -5835,7 +5808,7 @@ const queryByIds = (queryKey, ids, environment, customBaseUrl, customParams) =>
|
|
|
5835
5808
|
const errors = yield res.json();
|
|
5836
5809
|
return { success: false, errors };
|
|
5837
5810
|
});
|
|
5838
|
-
const recommendForSingleId = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) =>
|
|
5811
|
+
const recommendForSingleId = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5839
5812
|
let endpoint = `${getApiUrl$1(environment, customBaseUrl)}recommendations/document/${recommendForId}?recommendationQueryKey=${queryKey}`;
|
|
5840
5813
|
if (filters) {
|
|
5841
5814
|
endpoint += `&${e({ filters })}`;
|
|
@@ -5849,7 +5822,7 @@ const recommendForSingleId = (queryKey, recommendForId, filters, environment, cu
|
|
|
5849
5822
|
const errors = yield res.json();
|
|
5850
5823
|
return { success: false, errors };
|
|
5851
5824
|
});
|
|
5852
|
-
const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment, customBaseUrl, customParams) =>
|
|
5825
|
+
const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5853
5826
|
const limitedRecommendForIds = recommendForIds.slice(0, 20);
|
|
5854
5827
|
let endpoint = `${getApiUrl$1(environment, customBaseUrl)}recommendations/documentsByMultipleIds?recommendationQueryKey=${queryKey}&itemId[]=${limitedRecommendForIds.join("&itemId[]=")}`;
|
|
5855
5828
|
if (filters) {
|
|
@@ -5864,10 +5837,10 @@ const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment
|
|
|
5864
5837
|
const errors = yield res.json();
|
|
5865
5838
|
return { success: false, errors };
|
|
5866
5839
|
});
|
|
5867
|
-
const recommend = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) =>
|
|
5840
|
+
const recommend = (queryKey, recommendForId, filters, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5868
5841
|
return Array.isArray(recommendForId) ? yield recommendForMultipleIds(queryKey, recommendForId, filters, environment, customBaseUrl, customParams) : yield recommendForSingleId(queryKey, recommendForId, filters, environment, customBaseUrl, customParams);
|
|
5869
5842
|
});
|
|
5870
|
-
const suggest = (queryKey, query, environment, customBaseUrl, customParams) =>
|
|
5843
|
+
const suggest = (queryKey, query, environment, customBaseUrl, customParams) => __async(null, null, function* () {
|
|
5871
5844
|
const endpoint = `${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`;
|
|
5872
5845
|
const url = addCustomParams(endpoint, customParams);
|
|
5873
5846
|
const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
|
|
@@ -5878,18 +5851,18 @@ const suggest = (queryKey, query, environment, customBaseUrl, customParams) => _
|
|
|
5878
5851
|
const errors = yield res.json();
|
|
5879
5852
|
return { success: false, errors };
|
|
5880
5853
|
});
|
|
5881
|
-
const track$1 = (queryKey, event, environment, customBaseUrl) =>
|
|
5854
|
+
const track$1 = (queryKey, event, environment, customBaseUrl) => __async(null, null, function* () {
|
|
5882
5855
|
try {
|
|
5883
5856
|
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
|
|
5884
5857
|
if (res.status < 400) {
|
|
5885
5858
|
return { success: false };
|
|
5886
5859
|
}
|
|
5887
5860
|
return res.json();
|
|
5888
|
-
} catch (
|
|
5861
|
+
} catch (_a25) {
|
|
5889
5862
|
return { success: false };
|
|
5890
5863
|
}
|
|
5891
5864
|
});
|
|
5892
|
-
const loadRedirectionRules = (queryKey, environment, customBaseUrl) =>
|
|
5865
|
+
const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __async(null, null, function* () {
|
|
5893
5866
|
const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
|
|
5894
5867
|
if (res.status < 400) {
|
|
5895
5868
|
return res.json();
|
|
@@ -5897,27 +5870,164 @@ const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __awaiter
|
|
|
5897
5870
|
const errors = yield res.json();
|
|
5898
5871
|
return { success: false, errors };
|
|
5899
5872
|
});
|
|
5873
|
+
const FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
5874
|
+
const isSafeKey = (key) => !FORBIDDEN_KEYS.has(key);
|
|
5875
|
+
const toPath = (key) => key.split(".").filter(Boolean);
|
|
5876
|
+
const isObjectLike = (v) => typeof v === "object" && v !== null;
|
|
5877
|
+
const hasByPath = (obj, path) => {
|
|
5878
|
+
let cur = obj;
|
|
5879
|
+
for (let i = 0; i < path.length; i++) {
|
|
5880
|
+
const k = path[i];
|
|
5881
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5882
|
+
return false;
|
|
5883
|
+
}
|
|
5884
|
+
if (!Object.prototype.hasOwnProperty.call(cur, k)) {
|
|
5885
|
+
return false;
|
|
5886
|
+
}
|
|
5887
|
+
cur = cur[k];
|
|
5888
|
+
}
|
|
5889
|
+
return true;
|
|
5890
|
+
};
|
|
5891
|
+
const getByPath = (obj, path) => {
|
|
5892
|
+
let cur = obj;
|
|
5893
|
+
for (const k of path) {
|
|
5894
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5895
|
+
return void 0;
|
|
5896
|
+
}
|
|
5897
|
+
cur = cur[k];
|
|
5898
|
+
}
|
|
5899
|
+
return cur;
|
|
5900
|
+
};
|
|
5901
|
+
const setByPath = (obj, path, value) => {
|
|
5902
|
+
if (!path.length) {
|
|
5903
|
+
return;
|
|
5904
|
+
}
|
|
5905
|
+
let cur = obj;
|
|
5906
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
5907
|
+
const k = path[i];
|
|
5908
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5909
|
+
return;
|
|
5910
|
+
}
|
|
5911
|
+
const next = cur[k];
|
|
5912
|
+
if (!isObjectLike(next))
|
|
5913
|
+
cur[k] = {};
|
|
5914
|
+
cur = cur[k];
|
|
5915
|
+
}
|
|
5916
|
+
const lastKey = path[path.length - 1];
|
|
5917
|
+
if (!isSafeKey(lastKey) || !isObjectLike(cur)) {
|
|
5918
|
+
return;
|
|
5919
|
+
}
|
|
5920
|
+
cur[lastKey] = value;
|
|
5921
|
+
};
|
|
5922
|
+
const unsetByPath = (obj, path) => {
|
|
5923
|
+
if (!path.length) {
|
|
5924
|
+
return;
|
|
5925
|
+
}
|
|
5926
|
+
let cur = obj;
|
|
5927
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
5928
|
+
const k = path[i];
|
|
5929
|
+
if (!isSafeKey(k) || !isObjectLike(cur)) {
|
|
5930
|
+
return;
|
|
5931
|
+
}
|
|
5932
|
+
if (!Object.prototype.hasOwnProperty.call(cur, k)) {
|
|
5933
|
+
return;
|
|
5934
|
+
}
|
|
5935
|
+
cur = cur[k];
|
|
5936
|
+
}
|
|
5937
|
+
const lastKey = path[path.length - 1];
|
|
5938
|
+
if (!isSafeKey(lastKey) || !isObjectLike(cur)) {
|
|
5939
|
+
return;
|
|
5940
|
+
}
|
|
5941
|
+
delete cur[lastKey];
|
|
5942
|
+
};
|
|
5943
|
+
const transformItems = (items, transformOptions) => {
|
|
5944
|
+
var _a25;
|
|
5945
|
+
const mapping = (_a25 = transformOptions === null || transformOptions === void 0 ? void 0 : transformOptions.transform) === null || _a25 === void 0 ? void 0 : _a25.fieldNames;
|
|
5946
|
+
if (!(items === null || items === void 0 ? void 0 : items.length) || !mapping) {
|
|
5947
|
+
return items;
|
|
5948
|
+
}
|
|
5949
|
+
return items.map((item) => {
|
|
5950
|
+
for (const [originalField, newField] of Object.entries(mapping)) {
|
|
5951
|
+
const fromPath = toPath(originalField);
|
|
5952
|
+
const toPathArr = toPath(newField);
|
|
5953
|
+
if (!fromPath.length || !toPathArr.length) {
|
|
5954
|
+
continue;
|
|
5955
|
+
}
|
|
5956
|
+
if (!hasByPath(item, fromPath)) {
|
|
5957
|
+
continue;
|
|
5958
|
+
}
|
|
5959
|
+
const value = getByPath(item, fromPath);
|
|
5960
|
+
setByPath(item, toPathArr, value);
|
|
5961
|
+
unsetByPath(item, fromPath);
|
|
5962
|
+
}
|
|
5963
|
+
return item;
|
|
5964
|
+
});
|
|
5965
|
+
};
|
|
5966
|
+
const transform = (result2, transformOptions) => {
|
|
5967
|
+
var _a25, _b25, _c, _d, _e, _f, _g;
|
|
5968
|
+
let transformedResult = result2;
|
|
5969
|
+
if (!result2 || !(transformOptions === null || transformOptions === void 0 ? void 0 : transformOptions.transform)) {
|
|
5970
|
+
return result2;
|
|
5971
|
+
}
|
|
5972
|
+
if ((_a25 = result2 === null || result2 === void 0 ? void 0 : result2.items) === null || _a25 === void 0 ? void 0 : _a25.length) {
|
|
5973
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { items: transformItems(transformedResult.items, transformOptions) });
|
|
5974
|
+
}
|
|
5975
|
+
if ((_b25 = result2 === null || result2 === void 0 ? void 0 : result2.similarQueries) === null || _b25 === void 0 ? void 0 : _b25.length) {
|
|
5976
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { similarQueries: (_c = transformedResult.similarQueries) === null || _c === void 0 ? void 0 : _c.map((similarQuery) => Object.assign(Object.assign({}, similarQuery), { items: transformItems(similarQuery.items, transformOptions) })) });
|
|
5977
|
+
}
|
|
5978
|
+
if ((_e = (_d = result2 === null || result2 === void 0 ? void 0 : result2.similarResults) === null || _d === void 0 ? void 0 : _d.items) === null || _e === void 0 ? void 0 : _e.length) {
|
|
5979
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { similarResults: Object.assign(Object.assign({}, transformedResult.similarResults), { items: transformItems(transformedResult.similarResults.items, transformOptions) }) });
|
|
5980
|
+
}
|
|
5981
|
+
if ((_f = result2.relatedQueries) === null || _f === void 0 ? void 0 : _f.length) {
|
|
5982
|
+
transformedResult = Object.assign(Object.assign({}, transformedResult), { relatedQueries: (_g = transformedResult.relatedQueries) === null || _g === void 0 ? void 0 : _g.map((relatedQuery) => Object.assign(Object.assign({}, relatedQuery), { topItems: transformItems(relatedQuery.topItems, transformOptions) })) });
|
|
5983
|
+
}
|
|
5984
|
+
return transformedResult;
|
|
5985
|
+
};
|
|
5986
|
+
const transformSearchQueryResult = (result2, transformOptions) => {
|
|
5987
|
+
if (result2.success === false) {
|
|
5988
|
+
return result2;
|
|
5989
|
+
}
|
|
5990
|
+
return transform(result2, transformOptions);
|
|
5991
|
+
};
|
|
5992
|
+
const transformSearchQueryRefinersResult = (result2, transformOptions) => {
|
|
5993
|
+
if (result2.success === false) {
|
|
5994
|
+
return result2;
|
|
5995
|
+
}
|
|
5996
|
+
return transform(result2, transformOptions);
|
|
5997
|
+
};
|
|
5998
|
+
const transformRelatedQueries = (result2, transformOptions) => {
|
|
5999
|
+
if (result2.success === false) {
|
|
6000
|
+
return result2;
|
|
6001
|
+
}
|
|
6002
|
+
return transform(result2, transformOptions);
|
|
6003
|
+
};
|
|
5900
6004
|
const LupaSearchSdk = {
|
|
5901
|
-
query: (queryKey, publicQuery, options = null) => {
|
|
6005
|
+
query: (queryKey, publicQuery, options = null) => __async(null, null, function* () {
|
|
5902
6006
|
if (options === null || options === void 0 ? void 0 : options.customUrl) {
|
|
5903
|
-
|
|
6007
|
+
const result3 = yield searchCustom(publicQuery, options);
|
|
6008
|
+
return transformSearchQueryResult(result3, options);
|
|
5904
6009
|
}
|
|
5905
|
-
|
|
5906
|
-
|
|
6010
|
+
const result2 = yield search(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6011
|
+
return transformSearchQueryResult(result2, options);
|
|
6012
|
+
}),
|
|
5907
6013
|
queryFacets: (queryKey, publicQuery, options = null) => {
|
|
5908
6014
|
return facets(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
5909
6015
|
},
|
|
5910
|
-
queryRefiners: (queryKey, publicQuery, options = null) => {
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
6016
|
+
queryRefiners: (queryKey, publicQuery, options = null) => __async(null, null, function* () {
|
|
6017
|
+
const result2 = yield refiners(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6018
|
+
return transformSearchQueryRefinersResult(result2, options);
|
|
6019
|
+
}),
|
|
6020
|
+
queryRelated: (queryKey, publicQuery, options = null) => __async(null, null, function* () {
|
|
6021
|
+
const result2 = yield relatedQueries(queryKey, publicQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6022
|
+
return transformRelatedQueries(result2, options);
|
|
6023
|
+
}),
|
|
5916
6024
|
suggestions: (queryKey, suggestionQuery, options = null) => {
|
|
5917
6025
|
if (options === null || options === void 0 ? void 0 : options.customUrl) {
|
|
5918
|
-
|
|
6026
|
+
const result3 = suggestCustom(suggestionQuery, options);
|
|
6027
|
+
return result3;
|
|
5919
6028
|
}
|
|
5920
|
-
|
|
6029
|
+
const result2 = suggest(queryKey, suggestionQuery, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl, options === null || options === void 0 ? void 0 : options.customParams);
|
|
6030
|
+
return result2;
|
|
5921
6031
|
},
|
|
5922
6032
|
track: (queryKey, eventData, options = null) => {
|
|
5923
6033
|
return track$1(queryKey, eventData, (options === null || options === void 0 ? void 0 : options.environment) || "production", options === null || options === void 0 ? void 0 : options.customBaseUrl);
|
|
@@ -6592,9 +6702,9 @@ function requireLodash() {
|
|
|
6592
6702
|
});
|
|
6593
6703
|
return result2;
|
|
6594
6704
|
}
|
|
6595
|
-
function overArg(func,
|
|
6705
|
+
function overArg(func, transform2) {
|
|
6596
6706
|
return function(arg) {
|
|
6597
|
-
return func(
|
|
6707
|
+
return func(transform2(arg));
|
|
6598
6708
|
};
|
|
6599
6709
|
}
|
|
6600
6710
|
function replaceHolders(array, placeholder) {
|
|
@@ -6701,7 +6811,7 @@ function requireLodash() {
|
|
|
6701
6811
|
var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
|
|
6702
6812
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
|
|
6703
6813
|
function lodash2(value) {
|
|
6704
|
-
if (
|
|
6814
|
+
if (isObjectLike2(value) && !isArray3(value) && !(value instanceof LazyWrapper)) {
|
|
6705
6815
|
if (value instanceof LodashWrapper) {
|
|
6706
6816
|
return value;
|
|
6707
6817
|
}
|
|
@@ -7382,19 +7492,19 @@ function requireLodash() {
|
|
|
7382
7492
|
return func == null ? undefined$1 : apply(func, object, args);
|
|
7383
7493
|
}
|
|
7384
7494
|
function baseIsArguments(value) {
|
|
7385
|
-
return
|
|
7495
|
+
return isObjectLike2(value) && baseGetTag(value) == argsTag;
|
|
7386
7496
|
}
|
|
7387
7497
|
function baseIsArrayBuffer(value) {
|
|
7388
|
-
return
|
|
7498
|
+
return isObjectLike2(value) && baseGetTag(value) == arrayBufferTag;
|
|
7389
7499
|
}
|
|
7390
7500
|
function baseIsDate(value) {
|
|
7391
|
-
return
|
|
7501
|
+
return isObjectLike2(value) && baseGetTag(value) == dateTag;
|
|
7392
7502
|
}
|
|
7393
7503
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
7394
7504
|
if (value === other) {
|
|
7395
7505
|
return true;
|
|
7396
7506
|
}
|
|
7397
|
-
if (value == null || other == null || !
|
|
7507
|
+
if (value == null || other == null || !isObjectLike2(value) && !isObjectLike2(other)) {
|
|
7398
7508
|
return value !== value && other !== other;
|
|
7399
7509
|
}
|
|
7400
7510
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
@@ -7430,7 +7540,7 @@ function requireLodash() {
|
|
|
7430
7540
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
7431
7541
|
}
|
|
7432
7542
|
function baseIsMap(value) {
|
|
7433
|
-
return
|
|
7543
|
+
return isObjectLike2(value) && getTag(value) == mapTag;
|
|
7434
7544
|
}
|
|
7435
7545
|
function baseIsMatch(object, source, matchData, customizer) {
|
|
7436
7546
|
var index = matchData.length, length = index, noCustomizer = !customizer;
|
|
@@ -7471,13 +7581,13 @@ function requireLodash() {
|
|
|
7471
7581
|
return pattern.test(toSource(value));
|
|
7472
7582
|
}
|
|
7473
7583
|
function baseIsRegExp(value) {
|
|
7474
|
-
return
|
|
7584
|
+
return isObjectLike2(value) && baseGetTag(value) == regexpTag;
|
|
7475
7585
|
}
|
|
7476
7586
|
function baseIsSet(value) {
|
|
7477
|
-
return
|
|
7587
|
+
return isObjectLike2(value) && getTag(value) == setTag;
|
|
7478
7588
|
}
|
|
7479
7589
|
function baseIsTypedArray(value) {
|
|
7480
|
-
return
|
|
7590
|
+
return isObjectLike2(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
7481
7591
|
}
|
|
7482
7592
|
function baseIteratee(value) {
|
|
7483
7593
|
if (typeof value == "function") {
|
|
@@ -8987,7 +9097,7 @@ function requireLodash() {
|
|
|
8987
9097
|
function objectToString2(value) {
|
|
8988
9098
|
return nativeObjectToString.call(value);
|
|
8989
9099
|
}
|
|
8990
|
-
function overRest(func, start,
|
|
9100
|
+
function overRest(func, start, transform3) {
|
|
8991
9101
|
start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
|
|
8992
9102
|
return function() {
|
|
8993
9103
|
var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
|
|
@@ -8999,7 +9109,7 @@ function requireLodash() {
|
|
|
8999
9109
|
while (++index < start) {
|
|
9000
9110
|
otherArgs[index] = args[index];
|
|
9001
9111
|
}
|
|
9002
|
-
otherArgs[start] =
|
|
9112
|
+
otherArgs[start] = transform3(array);
|
|
9003
9113
|
return apply(func, this, otherArgs);
|
|
9004
9114
|
};
|
|
9005
9115
|
}
|
|
@@ -10021,7 +10131,7 @@ function requireLodash() {
|
|
|
10021
10131
|
var isArguments = baseIsArguments(/* @__PURE__ */ function() {
|
|
10022
10132
|
return arguments;
|
|
10023
10133
|
}()) ? baseIsArguments : function(value) {
|
|
10024
|
-
return
|
|
10134
|
+
return isObjectLike2(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
10025
10135
|
};
|
|
10026
10136
|
var isArray3 = Array2.isArray;
|
|
10027
10137
|
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
|
|
@@ -10029,15 +10139,15 @@ function requireLodash() {
|
|
|
10029
10139
|
return value != null && isLength(value.length) && !isFunction2(value);
|
|
10030
10140
|
}
|
|
10031
10141
|
function isArrayLikeObject(value) {
|
|
10032
|
-
return
|
|
10142
|
+
return isObjectLike2(value) && isArrayLike(value);
|
|
10033
10143
|
}
|
|
10034
10144
|
function isBoolean2(value) {
|
|
10035
|
-
return value === true || value === false ||
|
|
10145
|
+
return value === true || value === false || isObjectLike2(value) && baseGetTag(value) == boolTag;
|
|
10036
10146
|
}
|
|
10037
10147
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
10038
10148
|
var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
10039
10149
|
function isElement(value) {
|
|
10040
|
-
return
|
|
10150
|
+
return isObjectLike2(value) && value.nodeType === 1 && !isPlainObject4(value);
|
|
10041
10151
|
}
|
|
10042
10152
|
function isEmpty(value) {
|
|
10043
10153
|
if (value == null) {
|
|
@@ -10069,7 +10179,7 @@ function requireLodash() {
|
|
|
10069
10179
|
return result3 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result3;
|
|
10070
10180
|
}
|
|
10071
10181
|
function isError2(value) {
|
|
10072
|
-
if (!
|
|
10182
|
+
if (!isObjectLike2(value)) {
|
|
10073
10183
|
return false;
|
|
10074
10184
|
}
|
|
10075
10185
|
var tag = baseGetTag(value);
|
|
@@ -10095,7 +10205,7 @@ function requireLodash() {
|
|
|
10095
10205
|
var type = typeof value;
|
|
10096
10206
|
return value != null && (type == "object" || type == "function");
|
|
10097
10207
|
}
|
|
10098
|
-
function
|
|
10208
|
+
function isObjectLike2(value) {
|
|
10099
10209
|
return value != null && typeof value == "object";
|
|
10100
10210
|
}
|
|
10101
10211
|
var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
|
|
@@ -10122,10 +10232,10 @@ function requireLodash() {
|
|
|
10122
10232
|
return value == null;
|
|
10123
10233
|
}
|
|
10124
10234
|
function isNumber2(value) {
|
|
10125
|
-
return typeof value == "number" ||
|
|
10235
|
+
return typeof value == "number" || isObjectLike2(value) && baseGetTag(value) == numberTag;
|
|
10126
10236
|
}
|
|
10127
10237
|
function isPlainObject4(value) {
|
|
10128
|
-
if (!
|
|
10238
|
+
if (!isObjectLike2(value) || baseGetTag(value) != objectTag) {
|
|
10129
10239
|
return false;
|
|
10130
10240
|
}
|
|
10131
10241
|
var proto = getPrototype(value);
|
|
@@ -10141,20 +10251,20 @@ function requireLodash() {
|
|
|
10141
10251
|
}
|
|
10142
10252
|
var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
10143
10253
|
function isString2(value) {
|
|
10144
|
-
return typeof value == "string" || !isArray3(value) &&
|
|
10254
|
+
return typeof value == "string" || !isArray3(value) && isObjectLike2(value) && baseGetTag(value) == stringTag;
|
|
10145
10255
|
}
|
|
10146
10256
|
function isSymbol2(value) {
|
|
10147
|
-
return typeof value == "symbol" ||
|
|
10257
|
+
return typeof value == "symbol" || isObjectLike2(value) && baseGetTag(value) == symbolTag;
|
|
10148
10258
|
}
|
|
10149
10259
|
var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
10150
10260
|
function isUndefined2(value) {
|
|
10151
10261
|
return value === undefined$1;
|
|
10152
10262
|
}
|
|
10153
10263
|
function isWeakMap(value) {
|
|
10154
|
-
return
|
|
10264
|
+
return isObjectLike2(value) && getTag(value) == weakMapTag;
|
|
10155
10265
|
}
|
|
10156
10266
|
function isWeakSet(value) {
|
|
10157
|
-
return
|
|
10267
|
+
return isObjectLike2(value) && baseGetTag(value) == weakSetTag;
|
|
10158
10268
|
}
|
|
10159
10269
|
var lt = createRelationalOperation(baseLt);
|
|
10160
10270
|
var lte = createRelationalOperation(function(value, other) {
|
|
@@ -10414,7 +10524,7 @@ function requireLodash() {
|
|
|
10414
10524
|
}
|
|
10415
10525
|
var toPairs = createToPairs(keys);
|
|
10416
10526
|
var toPairsIn = createToPairs(keysIn);
|
|
10417
|
-
function
|
|
10527
|
+
function transform2(object, iteratee2, accumulator) {
|
|
10418
10528
|
var isArr = isArray3(object), isArrLike = isArr || isBuffer(object) || isTypedArray2(object);
|
|
10419
10529
|
iteratee2 = getIteratee(iteratee2, 4);
|
|
10420
10530
|
if (accumulator == null) {
|
|
@@ -10917,7 +11027,7 @@ function requireLodash() {
|
|
|
10917
11027
|
}
|
|
10918
11028
|
return result3;
|
|
10919
11029
|
}
|
|
10920
|
-
function
|
|
11030
|
+
function toPath2(value) {
|
|
10921
11031
|
if (isArray3(value)) {
|
|
10922
11032
|
return arrayMap(value, toKey);
|
|
10923
11033
|
}
|
|
@@ -11088,9 +11198,9 @@ function requireLodash() {
|
|
|
11088
11198
|
lodash2.toArray = toArray;
|
|
11089
11199
|
lodash2.toPairs = toPairs;
|
|
11090
11200
|
lodash2.toPairsIn = toPairsIn;
|
|
11091
|
-
lodash2.toPath =
|
|
11201
|
+
lodash2.toPath = toPath2;
|
|
11092
11202
|
lodash2.toPlainObject = toPlainObject;
|
|
11093
|
-
lodash2.transform =
|
|
11203
|
+
lodash2.transform = transform2;
|
|
11094
11204
|
lodash2.unary = unary;
|
|
11095
11205
|
lodash2.union = union;
|
|
11096
11206
|
lodash2.unionBy = unionBy;
|
|
@@ -11189,7 +11299,7 @@ function requireLodash() {
|
|
|
11189
11299
|
lodash2.isNull = isNull2;
|
|
11190
11300
|
lodash2.isNumber = isNumber2;
|
|
11191
11301
|
lodash2.isObject = isObject2;
|
|
11192
|
-
lodash2.isObjectLike =
|
|
11302
|
+
lodash2.isObjectLike = isObjectLike2;
|
|
11193
11303
|
lodash2.isPlainObject = isPlainObject4;
|
|
11194
11304
|
lodash2.isRegExp = isRegExp2;
|
|
11195
11305
|
lodash2.isSafeInteger = isSafeInteger;
|
|
@@ -12884,6 +12994,10 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
12884
12994
|
const page2 = Number(params.value[QUERY_PARAMS_PARSED.PAGE]) || 1;
|
|
12885
12995
|
return page2 <= 0 ? 1 : page2;
|
|
12886
12996
|
});
|
|
12997
|
+
const disableNavigationToSearchResults = vue.computed(() => {
|
|
12998
|
+
var _a25;
|
|
12999
|
+
return ((_a25 = optionsStore.searchBoxOptions) == null ? void 0 : _a25.disableNavigationToSearchResults) || false;
|
|
13000
|
+
});
|
|
12887
13001
|
const limit = vue.computed(() => {
|
|
12888
13002
|
return Number(params.value[QUERY_PARAMS_PARSED.LIMIT]) || optionsStore.defaultSearchResultPageSize || defaultLimit.value;
|
|
12889
13003
|
});
|
|
@@ -12977,6 +13091,9 @@ const useParamsStore = /* @__PURE__ */ defineStore("params", () => {
|
|
|
12977
13091
|
if (redirectionApplied) {
|
|
12978
13092
|
return;
|
|
12979
13093
|
}
|
|
13094
|
+
if (disableNavigationToSearchResults.value) {
|
|
13095
|
+
return;
|
|
13096
|
+
}
|
|
12980
13097
|
const forceFullReload = (_a25 = optionsStore.searchBoxOptions.forceFullReloadOnParams) == null ? void 0 : _a25.some(
|
|
12981
13098
|
(p2) => getQueryParam(p2)
|
|
12982
13099
|
);
|
|
@@ -13541,10 +13658,10 @@ const _hoisted_1$1o = {
|
|
|
13541
13658
|
key: 0,
|
|
13542
13659
|
class: "lupa-dialog-overlay"
|
|
13543
13660
|
};
|
|
13544
|
-
const _hoisted_2$
|
|
13661
|
+
const _hoisted_2$Z = { class: "lupa-dialog-content" };
|
|
13545
13662
|
const _hoisted_3$G = { class: "lupa-listening-text" };
|
|
13546
|
-
const _hoisted_4$
|
|
13547
|
-
const _hoisted_5$
|
|
13663
|
+
const _hoisted_4$v = { class: "lupa-mic-button-wrapper" };
|
|
13664
|
+
const _hoisted_5$l = ["aria-label"];
|
|
13548
13665
|
const _sfc_main$1F = /* @__PURE__ */ vue.defineComponent({
|
|
13549
13666
|
__name: "VoiceSearchDialog",
|
|
13550
13667
|
props: {
|
|
@@ -13655,15 +13772,15 @@ const _sfc_main$1F = /* @__PURE__ */ vue.defineComponent({
|
|
|
13655
13772
|
class: "lupa-dialog-box-close-button",
|
|
13656
13773
|
onClick: _cache[0] || (_cache[0] = () => emit("close"))
|
|
13657
13774
|
}),
|
|
13658
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
13775
|
+
vue.createElementVNode("div", _hoisted_2$Z, [
|
|
13659
13776
|
vue.createElementVNode("p", _hoisted_3$G, vue.toDisplayString(description.value), 1),
|
|
13660
|
-
vue.createElementVNode("div", _hoisted_4$
|
|
13777
|
+
vue.createElementVNode("div", _hoisted_4$v, [
|
|
13661
13778
|
vue.createElementVNode("button", {
|
|
13662
13779
|
class: vue.normalizeClass(["lupa-mic-button", { recording: vue.unref(isRecording) }]),
|
|
13663
13780
|
onClick: handleRecordingButtonClick,
|
|
13664
13781
|
"aria-controls": "voice-search-microphone",
|
|
13665
13782
|
"aria-label": ((_b25 = (_a25 = labels.value) == null ? void 0 : _a25.aria) == null ? void 0 : _b25.microphone) || "Toggle microphone"
|
|
13666
|
-
}, null, 10, _hoisted_5$
|
|
13783
|
+
}, null, 10, _hoisted_5$l),
|
|
13667
13784
|
vue.createVNode(_sfc_main$1G, {
|
|
13668
13785
|
ref_key: "voiceSearchProgressBar",
|
|
13669
13786
|
ref: voiceSearchProgressBar,
|
|
@@ -13680,10 +13797,10 @@ const _sfc_main$1F = /* @__PURE__ */ vue.defineComponent({
|
|
|
13680
13797
|
}
|
|
13681
13798
|
});
|
|
13682
13799
|
const _hoisted_1$1n = { id: "lupa-search-box-input-container" };
|
|
13683
|
-
const _hoisted_2$
|
|
13800
|
+
const _hoisted_2$Y = { class: "lupa-input-clear" };
|
|
13684
13801
|
const _hoisted_3$F = { id: "lupa-search-box-input" };
|
|
13685
|
-
const _hoisted_4$
|
|
13686
|
-
const _hoisted_5$
|
|
13802
|
+
const _hoisted_4$u = ["value"];
|
|
13803
|
+
const _hoisted_5$k = ["aria-label", "placeholder"];
|
|
13687
13804
|
const _hoisted_6$7 = {
|
|
13688
13805
|
key: 0,
|
|
13689
13806
|
class: "lupa-close-label"
|
|
@@ -13823,7 +13940,7 @@ const _sfc_main$1E = /* @__PURE__ */ vue.defineComponent({
|
|
|
13823
13940
|
__expose({ focus });
|
|
13824
13941
|
return (_ctx, _cache) => {
|
|
13825
13942
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1n, [
|
|
13826
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
13943
|
+
vue.createElementVNode("div", _hoisted_2$Y, [
|
|
13827
13944
|
vue.createElementVNode("div", {
|
|
13828
13945
|
class: vue.normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
|
|
13829
13946
|
onClick: clear
|
|
@@ -13835,7 +13952,7 @@ const _sfc_main$1E = /* @__PURE__ */ vue.defineComponent({
|
|
|
13835
13952
|
"aria-hidden": "true",
|
|
13836
13953
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
13837
13954
|
disabled: ""
|
|
13838
|
-
}, null, 8, _hoisted_4$
|
|
13955
|
+
}, null, 8, _hoisted_4$u),
|
|
13839
13956
|
vue.withDirectives(vue.createElementVNode("input", vue.mergeProps({
|
|
13840
13957
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
13841
13958
|
}, inputAttributes.value, {
|
|
@@ -13849,7 +13966,7 @@ const _sfc_main$1E = /* @__PURE__ */ vue.defineComponent({
|
|
|
13849
13966
|
placeholder: labels.value.placeholder,
|
|
13850
13967
|
onInput: handleInput,
|
|
13851
13968
|
onFocus: handleFocus
|
|
13852
|
-
}), null, 16, _hoisted_5$
|
|
13969
|
+
}), null, 16, _hoisted_5$k), [
|
|
13853
13970
|
[vue.vModelText, inputValue.value]
|
|
13854
13971
|
]),
|
|
13855
13972
|
_ctx.options.showSubmitButton ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
@@ -13928,7 +14045,7 @@ const _sfc_main$1D = /* @__PURE__ */ vue.defineComponent({
|
|
|
13928
14045
|
}
|
|
13929
14046
|
});
|
|
13930
14047
|
const _hoisted_1$1m = { class: "lupa-search-box-history-item" };
|
|
13931
|
-
const _hoisted_2$
|
|
14048
|
+
const _hoisted_2$X = { class: "lupa-search-box-history-item-content" };
|
|
13932
14049
|
const _sfc_main$1C = /* @__PURE__ */ vue.defineComponent({
|
|
13933
14050
|
__name: "SearchBoxHistoryItem",
|
|
13934
14051
|
props: {
|
|
@@ -13947,7 +14064,7 @@ const _sfc_main$1C = /* @__PURE__ */ vue.defineComponent({
|
|
|
13947
14064
|
};
|
|
13948
14065
|
return (_ctx, _cache) => {
|
|
13949
14066
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1m, [
|
|
13950
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
14067
|
+
vue.createElementVNode("div", _hoisted_2$X, [
|
|
13951
14068
|
vue.createElementVNode("div", {
|
|
13952
14069
|
class: vue.normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
|
|
13953
14070
|
onClick: click2
|
|
@@ -14034,15 +14151,31 @@ const _sfc_main$1B = /* @__PURE__ */ vue.defineComponent({
|
|
|
14034
14151
|
};
|
|
14035
14152
|
}
|
|
14036
14153
|
});
|
|
14037
|
-
const _hoisted_1$1k =
|
|
14154
|
+
const _hoisted_1$1k = ["innerHTML"];
|
|
14155
|
+
const _hoisted_2$W = {
|
|
14156
|
+
key: 1,
|
|
14157
|
+
class: "lupa-search-box-no-results"
|
|
14158
|
+
};
|
|
14038
14159
|
const _sfc_main$1A = /* @__PURE__ */ vue.defineComponent({
|
|
14039
14160
|
__name: "SearchBoxNoResults",
|
|
14040
14161
|
props: {
|
|
14041
|
-
|
|
14162
|
+
options: {}
|
|
14042
14163
|
},
|
|
14043
14164
|
setup(__props) {
|
|
14165
|
+
const props = __props;
|
|
14166
|
+
const customHtml = vue.computed(() => {
|
|
14167
|
+
return props.options.noResultsCustomHtml;
|
|
14168
|
+
});
|
|
14169
|
+
const labels = vue.computed(() => {
|
|
14170
|
+
return props.options.labels;
|
|
14171
|
+
});
|
|
14044
14172
|
return (_ctx, _cache) => {
|
|
14045
|
-
|
|
14173
|
+
var _a25;
|
|
14174
|
+
return customHtml.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
14175
|
+
key: 0,
|
|
14176
|
+
class: "lupa-search-box-no-results",
|
|
14177
|
+
innerHTML: customHtml.value
|
|
14178
|
+
}, null, 8, _hoisted_1$1k)) : (vue.openBlock(), vue.createElementBlock("p", _hoisted_2$W, vue.toDisplayString((_a25 = labels.value) == null ? void 0 : _a25.noResults), 1));
|
|
14046
14179
|
};
|
|
14047
14180
|
}
|
|
14048
14181
|
});
|
|
@@ -14085,11 +14218,11 @@ const _hoisted_3$E = {
|
|
|
14085
14218
|
class: "lupa-suggestion-facet",
|
|
14086
14219
|
"data-cy": "lupa-suggestion-facet"
|
|
14087
14220
|
};
|
|
14088
|
-
const _hoisted_4$
|
|
14221
|
+
const _hoisted_4$t = {
|
|
14089
14222
|
class: "lupa-suggestion-facet-label",
|
|
14090
14223
|
"data-cy": "lupa-suggestion-facet-label"
|
|
14091
14224
|
};
|
|
14092
|
-
const _hoisted_5$
|
|
14225
|
+
const _hoisted_5$j = {
|
|
14093
14226
|
class: "lupa-suggestion-facet-value",
|
|
14094
14227
|
"data-cy": "lupa-suggestion-facet-value"
|
|
14095
14228
|
};
|
|
@@ -14132,8 +14265,8 @@ const _sfc_main$1z = /* @__PURE__ */ vue.defineComponent({
|
|
|
14132
14265
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
14133
14266
|
}, null, 8, _hoisted_1$1j)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$V, vue.toDisplayString(_ctx.suggestion.display), 1)),
|
|
14134
14267
|
_ctx.suggestion.facet ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$E, [
|
|
14135
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
14136
|
-
vue.createElementVNode("span", _hoisted_5$
|
|
14268
|
+
vue.createElementVNode("span", _hoisted_4$t, vue.toDisplayString(facetLabel.value), 1),
|
|
14269
|
+
vue.createElementVNode("span", _hoisted_5$j, vue.toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
14137
14270
|
])) : vue.createCommentVNode("", true)
|
|
14138
14271
|
]);
|
|
14139
14272
|
};
|
|
@@ -22257,12 +22390,12 @@ and ensure you are accounting for this risk.
|
|
|
22257
22390
|
});
|
|
22258
22391
|
const transformTagsMap = {};
|
|
22259
22392
|
let transformTagsAll;
|
|
22260
|
-
each(options.transformTags, function(
|
|
22393
|
+
each(options.transformTags, function(transform2, tag) {
|
|
22261
22394
|
let transFun;
|
|
22262
|
-
if (typeof
|
|
22263
|
-
transFun =
|
|
22264
|
-
} else if (typeof
|
|
22265
|
-
transFun = sanitizeHtml2.simpleTransform(
|
|
22395
|
+
if (typeof transform2 === "function") {
|
|
22396
|
+
transFun = transform2;
|
|
22397
|
+
} else if (typeof transform2 === "string") {
|
|
22398
|
+
transFun = sanitizeHtml2.simpleTransform(transform2);
|
|
22266
22399
|
}
|
|
22267
22400
|
if (tag === "*") {
|
|
22268
22401
|
transformTagsAll = transFun;
|
|
@@ -23930,8 +24063,8 @@ const _sfc_main$1r = /* @__PURE__ */ vue.defineComponent({
|
|
|
23930
24063
|
const _hoisted_1$1d = ["innerHTML"];
|
|
23931
24064
|
const _hoisted_2$R = { key: 0 };
|
|
23932
24065
|
const _hoisted_3$D = { key: 1 };
|
|
23933
|
-
const _hoisted_4$
|
|
23934
|
-
const _hoisted_5$
|
|
24066
|
+
const _hoisted_4$s = { class: "lupa-search-box-custom-label" };
|
|
24067
|
+
const _hoisted_5$i = { class: "lupa-search-box-custom-text" };
|
|
23935
24068
|
const _sfc_main$1q = /* @__PURE__ */ vue.defineComponent({
|
|
23936
24069
|
__name: "SearchBoxProductCustom",
|
|
23937
24070
|
props: {
|
|
@@ -23963,8 +24096,8 @@ const _sfc_main$1q = /* @__PURE__ */ vue.defineComponent({
|
|
|
23963
24096
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
23964
24097
|
}, vue.toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
23965
24098
|
!label.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$R, vue.toDisplayString(text.value), 1)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$D, [
|
|
23966
|
-
vue.createElementVNode("div", _hoisted_4$
|
|
23967
|
-
vue.createElementVNode("div", _hoisted_5$
|
|
24099
|
+
vue.createElementVNode("div", _hoisted_4$s, vue.toDisplayString(label.value), 1),
|
|
24100
|
+
vue.createElementVNode("div", _hoisted_5$i, vue.toDisplayString(text.value), 1)
|
|
23968
24101
|
]))
|
|
23969
24102
|
], 16));
|
|
23970
24103
|
};
|
|
@@ -24354,8 +24487,8 @@ const useSearchResultStore = /* @__PURE__ */ defineStore("searchResult", () => {
|
|
|
24354
24487
|
const _hoisted_1$1b = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
24355
24488
|
const _hoisted_2$Q = { class: "lupa-search-box-product-addtocart" };
|
|
24356
24489
|
const _hoisted_3$C = ["disabled"];
|
|
24357
|
-
const _hoisted_4$
|
|
24358
|
-
const _hoisted_5$
|
|
24490
|
+
const _hoisted_4$r = ["href"];
|
|
24491
|
+
const _hoisted_5$h = ["disabled"];
|
|
24359
24492
|
const _sfc_main$1o = /* @__PURE__ */ vue.defineComponent({
|
|
24360
24493
|
__name: "SearchBoxProductAddToCart",
|
|
24361
24494
|
props: {
|
|
@@ -24410,7 +24543,7 @@ const _sfc_main$1o = /* @__PURE__ */ vue.defineComponent({
|
|
|
24410
24543
|
"data-cy": "lupa-add-to-cart",
|
|
24411
24544
|
disabled: !inStockValue.value || loading.value
|
|
24412
24545
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
24413
|
-
vue.createElementVNode("a", { href: _ctx.link }, vue.toDisplayString(label.value), 9, _hoisted_4$
|
|
24546
|
+
vue.createElementVNode("a", { href: _ctx.link }, vue.toDisplayString(label.value), 9, _hoisted_4$r)
|
|
24414
24547
|
], 16, _hoisted_3$C)) : (vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
|
|
24415
24548
|
key: 1,
|
|
24416
24549
|
onClick: vue.withModifiers(handleClick, ["stop", "prevent"]),
|
|
@@ -24418,7 +24551,7 @@ const _sfc_main$1o = /* @__PURE__ */ vue.defineComponent({
|
|
|
24418
24551
|
"data-cy": "lupa-add-to-cart",
|
|
24419
24552
|
type: "button",
|
|
24420
24553
|
disabled: !inStockValue.value || loading.value
|
|
24421
|
-
}, _ctx.dynamicAttributes), vue.toDisplayString(label.value), 17, _hoisted_5$
|
|
24554
|
+
}, _ctx.dynamicAttributes), vue.toDisplayString(label.value), 17, _hoisted_5$h))
|
|
24422
24555
|
])
|
|
24423
24556
|
]);
|
|
24424
24557
|
};
|
|
@@ -24530,7 +24663,7 @@ const _sfc_main$1n = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
|
|
|
24530
24663
|
const _hoisted_1$19 = { class: "lupa-badge-title" };
|
|
24531
24664
|
const _hoisted_2$P = ["src"];
|
|
24532
24665
|
const _hoisted_3$B = { key: 1 };
|
|
24533
|
-
const _hoisted_4$
|
|
24666
|
+
const _hoisted_4$q = {
|
|
24534
24667
|
key: 0,
|
|
24535
24668
|
class: "lupa-badge-full-text"
|
|
24536
24669
|
};
|
|
@@ -24574,7 +24707,7 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
24574
24707
|
}, null, 8, _hoisted_2$P)) : vue.createCommentVNode("", true),
|
|
24575
24708
|
hasTitleText.value && showTitle.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$B, vue.toDisplayString(_ctx.badge.titleText), 1)) : vue.createCommentVNode("", true)
|
|
24576
24709
|
]),
|
|
24577
|
-
hasAdditionalText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$
|
|
24710
|
+
hasAdditionalText.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4$q, vue.toDisplayString(_ctx.badge.additionalText), 1)) : vue.createCommentVNode("", true)
|
|
24578
24711
|
], 6);
|
|
24579
24712
|
};
|
|
24580
24713
|
}
|
|
@@ -25107,7 +25240,7 @@ const useTrackingStore = /* @__PURE__ */ defineStore("tracking", () => {
|
|
|
25107
25240
|
};
|
|
25108
25241
|
return { trackSearch, trackResults, trackEvent, trackDelayedEvent };
|
|
25109
25242
|
});
|
|
25110
|
-
const _hoisted_1$12 =
|
|
25243
|
+
const _hoisted_1$12 = ["innerHTML"];
|
|
25111
25244
|
const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
|
|
25112
25245
|
__name: "SearchBoxProducts",
|
|
25113
25246
|
props: {
|
|
@@ -25133,6 +25266,29 @@ const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
|
|
|
25133
25266
|
}
|
|
25134
25267
|
return (_c = (_b25 = highlightedItem.value) == null ? void 0 : _b25.index) != null ? _c : -1;
|
|
25135
25268
|
});
|
|
25269
|
+
const showAll = vue.ref(false);
|
|
25270
|
+
const hasResults = vue.computed(() => {
|
|
25271
|
+
return props.items && props.items.length > 0;
|
|
25272
|
+
});
|
|
25273
|
+
const hasUncollapsedDocumentCountLimit = vue.computed(() => {
|
|
25274
|
+
var _a25;
|
|
25275
|
+
return Boolean((_a25 = props.panelOptions) == null ? void 0 : _a25.uncollapsedDocumentCount);
|
|
25276
|
+
});
|
|
25277
|
+
const showAllItemsToggleButton = vue.computed(() => {
|
|
25278
|
+
var _a25, _b25, _c;
|
|
25279
|
+
if (!hasUncollapsedDocumentCountLimit.value) {
|
|
25280
|
+
return false;
|
|
25281
|
+
}
|
|
25282
|
+
return ((_a25 = props.items) == null ? void 0 : _a25.length) > ((_c = (_b25 = props.panelOptions) == null ? void 0 : _b25.uncollapsedDocumentCount) != null ? _c : 0);
|
|
25283
|
+
});
|
|
25284
|
+
const displayItems = vue.computed(() => {
|
|
25285
|
+
var _a25, _b25;
|
|
25286
|
+
if (showAll.value) {
|
|
25287
|
+
return props.items;
|
|
25288
|
+
}
|
|
25289
|
+
const count = (_b25 = (_a25 = props.panelOptions.uncollapsedDocumentCount) != null ? _a25 : props.panelOptions.limit) != null ? _b25 : props.items.length;
|
|
25290
|
+
return props.items.slice(0, count);
|
|
25291
|
+
});
|
|
25136
25292
|
const handleProductClick = ({
|
|
25137
25293
|
item,
|
|
25138
25294
|
eventType,
|
|
@@ -25180,8 +25336,12 @@ const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
|
|
|
25180
25336
|
}
|
|
25181
25337
|
};
|
|
25182
25338
|
return (_ctx, _cache) => {
|
|
25183
|
-
|
|
25184
|
-
|
|
25339
|
+
var _a25, _b25, _c;
|
|
25340
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
25341
|
+
id: "lupa-search-box-products",
|
|
25342
|
+
class: vue.normalizeClass({ "lupa-search-box-products-expanded": showAll.value })
|
|
25343
|
+
}, [
|
|
25344
|
+
_ctx.$slots.productCard ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(displayItems.value, (item, index) => {
|
|
25185
25345
|
return vue.renderSlot(_ctx.$slots, "productCard", {
|
|
25186
25346
|
key: index,
|
|
25187
25347
|
item,
|
|
@@ -25191,7 +25351,7 @@ const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
|
|
|
25191
25351
|
inputValue: _ctx.inputValue,
|
|
25192
25352
|
itemClicked: handleProductClick
|
|
25193
25353
|
});
|
|
25194
|
-
}), 128)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(
|
|
25354
|
+
}), 128)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(displayItems.value, (item, index) => {
|
|
25195
25355
|
return vue.openBlock(), vue.createBlock(_sfc_main$1f, {
|
|
25196
25356
|
key: index,
|
|
25197
25357
|
item,
|
|
@@ -25202,8 +25362,17 @@ const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
|
|
|
25202
25362
|
onProductClick: handleProductClick
|
|
25203
25363
|
}, null, 8, ["item", "panelOptions", "labels", "highlighted", "inputValue"]);
|
|
25204
25364
|
}), 128)),
|
|
25365
|
+
hasResults.value && ((_a25 = _ctx.panelOptions) == null ? void 0 : _a25.appendCustomHtml) && (showAll.value || !showAllItemsToggleButton.value) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
25366
|
+
key: 2,
|
|
25367
|
+
innerHTML: _ctx.panelOptions.appendCustomHtml
|
|
25368
|
+
}, null, 8, _hoisted_1$12)) : vue.createCommentVNode("", true),
|
|
25369
|
+
showAllItemsToggleButton.value ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
25370
|
+
key: 3,
|
|
25371
|
+
class: "lupa-search-box-expand",
|
|
25372
|
+
onClick: _cache[0] || (_cache[0] = ($event) => showAll.value = !showAll.value)
|
|
25373
|
+
}, vue.toDisplayString(showAll.value ? (_b25 = _ctx.labels) == null ? void 0 : _b25.showLess : (_c = _ctx.labels) == null ? void 0 : _c.showMore), 1)) : vue.createCommentVNode("", true),
|
|
25205
25374
|
vue.renderSlot(_ctx.$slots, "default")
|
|
25206
|
-
]);
|
|
25375
|
+
], 2);
|
|
25207
25376
|
};
|
|
25208
25377
|
}
|
|
25209
25378
|
});
|
|
@@ -25391,6 +25560,7 @@ const _sfc_main$1c = /* @__PURE__ */ vue.defineComponent({
|
|
|
25391
25560
|
searchText: props.inputValue,
|
|
25392
25561
|
limit: props.panel.limit,
|
|
25393
25562
|
filters: extractedInitialFilters.value,
|
|
25563
|
+
selectFields: props.panel.selectFields,
|
|
25394
25564
|
modifiers: {
|
|
25395
25565
|
facets: false,
|
|
25396
25566
|
refiners: false
|
|
@@ -25533,23 +25703,15 @@ const _sfc_main$1b = /* @__PURE__ */ vue.defineComponent({
|
|
|
25533
25703
|
};
|
|
25534
25704
|
}
|
|
25535
25705
|
});
|
|
25536
|
-
const _hoisted_1$10 =
|
|
25537
|
-
|
|
25538
|
-
id: "lupa-search-box-panel"
|
|
25539
|
-
};
|
|
25540
|
-
const _hoisted_2$L = ["data-cy"];
|
|
25541
|
-
const _hoisted_3$z = {
|
|
25706
|
+
const _hoisted_1$10 = ["data-cy"];
|
|
25707
|
+
const _hoisted_2$L = {
|
|
25542
25708
|
key: 0,
|
|
25543
25709
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
25544
25710
|
};
|
|
25545
|
-
const
|
|
25711
|
+
const _hoisted_3$z = {
|
|
25546
25712
|
key: 1,
|
|
25547
25713
|
class: "lupa-panel-title"
|
|
25548
25714
|
};
|
|
25549
|
-
const _hoisted_5$h = {
|
|
25550
|
-
key: 1,
|
|
25551
|
-
id: "lupa-search-box-panel"
|
|
25552
|
-
};
|
|
25553
25715
|
const __default__$2 = {
|
|
25554
25716
|
components: {
|
|
25555
25717
|
SearchBoxSuggestionsWrapper: _sfc_main$1x,
|
|
@@ -25722,7 +25884,11 @@ const _sfc_main$1a = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
|
|
|
25722
25884
|
ref_key: "panelContainer",
|
|
25723
25885
|
ref: panelContainer
|
|
25724
25886
|
}, [
|
|
25725
|
-
displayResults.value ? (vue.openBlock(), vue.createElementBlock("div",
|
|
25887
|
+
displayResults.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
25888
|
+
key: 0,
|
|
25889
|
+
id: "lupa-search-box-panel",
|
|
25890
|
+
class: vue.normalizeClass({ "lupa-search-text-empty": isSearchEmpty.value })
|
|
25891
|
+
}, [
|
|
25726
25892
|
labels.value.closePanel ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
25727
25893
|
key: 0,
|
|
25728
25894
|
class: "lupa-search-box-close-panel",
|
|
@@ -25744,8 +25910,8 @@ const _sfc_main$1a = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
|
|
|
25744
25910
|
style: vue.normalizeStyle(panel.gridArea ? { gridArea: `${panel.gridArea}${index}` } : {}),
|
|
25745
25911
|
"data-cy": "lupa-panel-" + panel.type + "-index"
|
|
25746
25912
|
}, [
|
|
25747
|
-
((_a25 = panel.labels) == null ? void 0 : _a25.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (vue.openBlock(), vue.createElementBlock("div",
|
|
25748
|
-
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (vue.openBlock(), vue.createElementBlock("div",
|
|
25913
|
+
((_a25 = panel.labels) == null ? void 0 : _a25.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$L, vue.toDisplayString((_b25 = panel.labels) == null ? void 0 : _b25.topResultsTitle), 1)) : vue.createCommentVNode("", true),
|
|
25914
|
+
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$z, vue.toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : vue.createCommentVNode("", true),
|
|
25749
25915
|
panel.queryKey && canShowPanel(panel) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(getComponent(panel.type)), {
|
|
25750
25916
|
key: 2,
|
|
25751
25917
|
panel,
|
|
@@ -25767,20 +25933,24 @@ const _sfc_main$1a = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
|
|
|
25767
25933
|
key: "0"
|
|
25768
25934
|
} : void 0
|
|
25769
25935
|
]), 1064, ["panel", "search-box-options", "options", "debounce", "inputValue", "labels"])) : vue.createCommentVNode("", true)
|
|
25770
|
-
], 14,
|
|
25936
|
+
], 14, _hoisted_1$10);
|
|
25771
25937
|
}), 128))
|
|
25772
25938
|
], 4),
|
|
25773
25939
|
!vue.unref(hasAnyResults) && _ctx.options.showNoResultsPanel ? (vue.openBlock(), vue.createBlock(_sfc_main$1A, {
|
|
25774
25940
|
key: 1,
|
|
25775
|
-
|
|
25776
|
-
}, null, 8, ["
|
|
25941
|
+
options: _ctx.options
|
|
25942
|
+
}, null, 8, ["options"])) : vue.createCommentVNode("", true),
|
|
25777
25943
|
displayShowMoreResultsButton.value ? (vue.openBlock(), vue.createBlock(_sfc_main$1D, {
|
|
25778
25944
|
key: 2,
|
|
25779
25945
|
labels: labels.value,
|
|
25780
25946
|
options: _ctx.options,
|
|
25781
25947
|
onGoToResults: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("go-to-results"))
|
|
25782
25948
|
}, null, 8, ["labels", "options"])) : vue.createCommentVNode("", true)
|
|
25783
|
-
])) : displayHistory.value ? (vue.openBlock(), vue.createElementBlock("div",
|
|
25949
|
+
], 2)) : displayHistory.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
25950
|
+
key: 1,
|
|
25951
|
+
id: "lupa-search-box-panel",
|
|
25952
|
+
class: vue.normalizeClass({ "lupa-search-text-empty": isSearchEmpty.value })
|
|
25953
|
+
}, [
|
|
25784
25954
|
vue.createVNode(_sfc_main$1B, {
|
|
25785
25955
|
options: _ctx.options.history,
|
|
25786
25956
|
history: history.value,
|
|
@@ -25788,7 +25958,7 @@ const _sfc_main$1a = /* @__PURE__ */ vue.defineComponent(__spreadProps(__spreadV
|
|
|
25788
25958
|
onRemove: remove,
|
|
25789
25959
|
onRemoveAll: removeAll
|
|
25790
25960
|
}, null, 8, ["options", "history"])
|
|
25791
|
-
])) : vue.createCommentVNode("", true)
|
|
25961
|
+
], 2)) : vue.createCommentVNode("", true)
|
|
25792
25962
|
], 512);
|
|
25793
25963
|
};
|
|
25794
25964
|
}
|
|
@@ -25861,7 +26031,8 @@ const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
|
|
|
25861
26031
|
"hideMoreResultsButtonOnEmptyQuery",
|
|
25862
26032
|
"showNoResultsPanel",
|
|
25863
26033
|
"expandOnSinglePanel",
|
|
25864
|
-
"showMoreResultsButton"
|
|
26034
|
+
"showMoreResultsButton",
|
|
26035
|
+
"noResultsCustomHtml"
|
|
25865
26036
|
])
|
|
25866
26037
|
);
|
|
25867
26038
|
const searchTriggers = vue.computed(() => {
|
|
@@ -25927,22 +26098,31 @@ const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
|
|
|
25927
26098
|
(_b25 = props.options.callbacks) == null ? void 0 : _b25.onClosed();
|
|
25928
26099
|
}
|
|
25929
26100
|
};
|
|
25930
|
-
const
|
|
26101
|
+
const fillInputWithSuggestion = () => {
|
|
25931
26102
|
var _a26, _b25;
|
|
26103
|
+
if ((_b25 = (_a26 = suggestedValue == null ? void 0 : suggestedValue.value) == null ? void 0 : _a26.item) == null ? void 0 : _b25.suggestion) {
|
|
26104
|
+
selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
|
|
26105
|
+
}
|
|
26106
|
+
};
|
|
26107
|
+
const goToResults = () => {
|
|
26108
|
+
handleSearch();
|
|
26109
|
+
resetValues();
|
|
26110
|
+
};
|
|
26111
|
+
const handleKeyDown = (e2) => {
|
|
25932
26112
|
if (!focused.value) {
|
|
25933
26113
|
return;
|
|
25934
26114
|
}
|
|
25935
26115
|
switch (e2.key) {
|
|
25936
26116
|
case "Tab":
|
|
25937
|
-
|
|
25938
|
-
e2.preventDefault();
|
|
25939
|
-
selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
|
|
25940
|
-
}
|
|
26117
|
+
fillInputWithSuggestion();
|
|
25941
26118
|
break;
|
|
25942
26119
|
case "Enter":
|
|
25943
26120
|
e2.preventDefault();
|
|
25944
|
-
|
|
25945
|
-
|
|
26121
|
+
if (props.options.disableNavigationToSearchResults) {
|
|
26122
|
+
fillInputWithSuggestion();
|
|
26123
|
+
} else {
|
|
26124
|
+
goToResults();
|
|
26125
|
+
}
|
|
25946
26126
|
break;
|
|
25947
26127
|
case "Escape":
|
|
25948
26128
|
opened.value = false;
|
|
@@ -26003,7 +26183,11 @@ const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
|
|
|
26003
26183
|
inputValue.value = inputSuggestion.override ? inputSuggestion.item.suggestion : inputValue.value;
|
|
26004
26184
|
}
|
|
26005
26185
|
if (shouldSearch) {
|
|
26006
|
-
|
|
26186
|
+
if (props.options.disableNavigationToSearchResults) {
|
|
26187
|
+
fillInputWithSuggestion();
|
|
26188
|
+
} else {
|
|
26189
|
+
handleSearch();
|
|
26190
|
+
}
|
|
26007
26191
|
}
|
|
26008
26192
|
};
|
|
26009
26193
|
const handleNavigateDocument = ({ link }) => {
|
|
@@ -26169,7 +26353,7 @@ const _sfc_main$19 = /* @__PURE__ */ vue.defineComponent({
|
|
|
26169
26353
|
};
|
|
26170
26354
|
}
|
|
26171
26355
|
});
|
|
26172
|
-
const createPublicQuery = (queryParams, sortOptions, defaultPageSize) => {
|
|
26356
|
+
const createPublicQuery = (queryParams, sortOptions, defaultPageSize, selectFields) => {
|
|
26173
26357
|
var _a25;
|
|
26174
26358
|
const publicQuery = {};
|
|
26175
26359
|
for (const param in queryParams) {
|
|
@@ -26203,6 +26387,9 @@ const createPublicQuery = (queryParams, sortOptions, defaultPageSize) => {
|
|
|
26203
26387
|
}
|
|
26204
26388
|
publicQuery.sort = publicQuery.sort || getDefaultSort(sortOptions);
|
|
26205
26389
|
publicQuery.filters = queryParams.filters;
|
|
26390
|
+
if (selectFields) {
|
|
26391
|
+
publicQuery.selectFields = selectFields;
|
|
26392
|
+
}
|
|
26206
26393
|
return publicQuery;
|
|
26207
26394
|
};
|
|
26208
26395
|
const getDefaultSort = (sortOptions) => {
|
|
@@ -26238,7 +26425,8 @@ const getInitialSearchResults = (options, getQueryParamName, defaultData) => __a
|
|
|
26238
26425
|
const publicQuery = createPublicQuery(
|
|
26239
26426
|
parseParams(getQueryParamName, searchParams),
|
|
26240
26427
|
options.sort,
|
|
26241
|
-
defaultData == null ? void 0 : defaultData.pageSize
|
|
26428
|
+
defaultData == null ? void 0 : defaultData.pageSize,
|
|
26429
|
+
options.selectFields
|
|
26242
26430
|
);
|
|
26243
26431
|
const query = getPublicQuery(publicQuery, (_c = defaultData == null ? void 0 : defaultData.filters) != null ? _c : {}, false);
|
|
26244
26432
|
try {
|
|
@@ -27950,7 +28138,7 @@ const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
|
|
|
27950
28138
|
}
|
|
27951
28139
|
);
|
|
27952
28140
|
const facetMin = vue.computed(() => Math.floor(facetValue.value.min * currencyMultiplier.value));
|
|
27953
|
-
const facetMax = vue.computed(() =>
|
|
28141
|
+
const facetMax = vue.computed(() => Number((facetValue.value.max * currencyMultiplier.value).toFixed(2)));
|
|
27954
28142
|
const currentGte = vue.computed(
|
|
27955
28143
|
() => getAdjustedNumber(currentFilters.value.gte, currencyMultiplier.value)
|
|
27956
28144
|
);
|
|
@@ -29420,7 +29608,7 @@ const _hoisted_3$n = {
|
|
|
29420
29608
|
class: "lupa-select-label",
|
|
29421
29609
|
for: "lupa-page-size-select-dropdown"
|
|
29422
29610
|
};
|
|
29423
|
-
const _hoisted_4$g = ["aria-label"];
|
|
29611
|
+
const _hoisted_4$g = ["value", "aria-label"];
|
|
29424
29612
|
const _hoisted_5$b = ["value"];
|
|
29425
29613
|
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
29426
29614
|
__name: "SearchResultsPageSize",
|
|
@@ -29433,6 +29621,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
|
29433
29621
|
const paramsStore = useParamsStore();
|
|
29434
29622
|
const optionsStore = useOptionsStore();
|
|
29435
29623
|
const { ariaLabels } = storeToRefs(optionsStore);
|
|
29624
|
+
const { limit } = storeToRefs(paramsStore);
|
|
29436
29625
|
const select = vue.ref(null);
|
|
29437
29626
|
const prefixLabel = vue.computed(() => {
|
|
29438
29627
|
var _a25, _b25;
|
|
@@ -29456,6 +29645,7 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
|
29456
29645
|
vue.createElementVNode("div", _hoisted_2$v, [
|
|
29457
29646
|
vue.createElementVNode("label", _hoisted_3$n, vue.toDisplayString(label.value), 1),
|
|
29458
29647
|
vue.createElementVNode("select", {
|
|
29648
|
+
value: vue.unref(limit),
|
|
29459
29649
|
id: "lupa-page-size-select-dropdown",
|
|
29460
29650
|
class: "lupa-select-dropdown",
|
|
29461
29651
|
"aria-label": (_c = (_b25 = (_a25 = vue.unref(ariaLabels)) == null ? void 0 : _a25.pageSizeSelect) != null ? _b25 : label.value) != null ? _c : "Select page size",
|
|
@@ -29514,6 +29704,7 @@ const useSorting = () => {
|
|
|
29514
29704
|
previousKey.value = selectedKey.value;
|
|
29515
29705
|
};
|
|
29516
29706
|
vue.watch(sort, () => setSortValue());
|
|
29707
|
+
vue.watch(sortOptions, () => setSortValue());
|
|
29517
29708
|
const handleSelect = () => {
|
|
29518
29709
|
var _a25, _b25, _c;
|
|
29519
29710
|
const value = (_a25 = sortItems.value.find((x) => x.key === selectedKey.value)) == null ? void 0 : _a25.key;
|
|
@@ -29529,12 +29720,15 @@ const useSorting = () => {
|
|
|
29529
29720
|
previousKey.value = selectedKey.value;
|
|
29530
29721
|
};
|
|
29531
29722
|
return {
|
|
29723
|
+
sort,
|
|
29532
29724
|
sotyByTitleLabel,
|
|
29533
29725
|
sortItems,
|
|
29534
29726
|
selectedKey,
|
|
29727
|
+
previousKey,
|
|
29535
29728
|
ariaLabels,
|
|
29536
29729
|
sortOptions,
|
|
29537
29730
|
sortStyle,
|
|
29731
|
+
defaultSortValue,
|
|
29538
29732
|
handleSelect,
|
|
29539
29733
|
setSortValue
|
|
29540
29734
|
};
|
|
@@ -30534,6 +30728,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
|
30534
30728
|
itemId: id.value,
|
|
30535
30729
|
searchQuery: query.value,
|
|
30536
30730
|
type: item.type,
|
|
30731
|
+
options: props.lupaClickTrackingType === "recommendedItemClick" ? { allowEmptySearchQuery: true } : void 0,
|
|
30537
30732
|
analytics: item.type === "addToCart" ? {
|
|
30538
30733
|
type: "search_add_to_cart",
|
|
30539
30734
|
label: title.value || id.value || link.value
|
|
@@ -31086,7 +31281,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
31086
31281
|
} : {};
|
|
31087
31282
|
});
|
|
31088
31283
|
const searchForRelatedQuery = () => __async(null, null, function* () {
|
|
31089
|
-
var _a25, _b25, _c, _d, _e, _f, _g, _h;
|
|
31284
|
+
var _a25, _b25, _c, _d, _e, _f, _g, _h, _i;
|
|
31090
31285
|
if (!props.query) {
|
|
31091
31286
|
return;
|
|
31092
31287
|
}
|
|
@@ -31095,6 +31290,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
31095
31290
|
limit: 3,
|
|
31096
31291
|
filters: relatedQueryFilters.value,
|
|
31097
31292
|
trackTerm: false,
|
|
31293
|
+
selectFields: (_a25 = searchResultOptions.value) == null ? void 0 : _a25.selectFields,
|
|
31098
31294
|
modifiers: {
|
|
31099
31295
|
facets: false,
|
|
31100
31296
|
refiners: false
|
|
@@ -31105,18 +31301,18 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
|
31105
31301
|
const result2 = yield LupaSearchSdk.query(
|
|
31106
31302
|
queryKey.value,
|
|
31107
31303
|
lupaQuery,
|
|
31108
|
-
(
|
|
31304
|
+
(_b25 = searchResultOptions.value) == null ? void 0 : _b25.options
|
|
31109
31305
|
);
|
|
31110
31306
|
if (result2.success) {
|
|
31111
31307
|
relatedQueryResult.value = result2;
|
|
31112
31308
|
}
|
|
31113
|
-
const firstItem = (
|
|
31114
|
-
itemToDisplay.value = (
|
|
31309
|
+
const firstItem = (_d = (_c = relatedQueryResult.value) == null ? void 0 : _c.items) == null ? void 0 : _d[0];
|
|
31310
|
+
itemToDisplay.value = (_g = (_f = (_e = relatedQueryResult == null ? void 0 : relatedQueryResult.value) == null ? void 0 : _e.items) == null ? void 0 : _f.find(
|
|
31115
31311
|
(i) => !props.existingItemsFromOtherQueries[`${i.id}`]
|
|
31116
|
-
)) != null ?
|
|
31312
|
+
)) != null ? _g : firstItem;
|
|
31117
31313
|
emit("loaded", itemToDisplay.value);
|
|
31118
31314
|
} catch (error) {
|
|
31119
|
-
(
|
|
31315
|
+
(_i = (_h = searchResultOptions.value) == null ? void 0 : _h.options) == null ? void 0 : _i.onError(error);
|
|
31120
31316
|
} finally {
|
|
31121
31317
|
loading.value = false;
|
|
31122
31318
|
}
|
|
@@ -32247,7 +32443,8 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
32247
32443
|
const publicQuery = createPublicQuery(
|
|
32248
32444
|
parseParams(optionStore.getQueryParamName, searchParams),
|
|
32249
32445
|
props.options.sort,
|
|
32250
|
-
defaultSearchResultPageSize.value
|
|
32446
|
+
defaultSearchResultPageSize.value,
|
|
32447
|
+
props.options.selectFields
|
|
32251
32448
|
);
|
|
32252
32449
|
searchResultStore.setLoading(true);
|
|
32253
32450
|
const finalPublicQuery = getPublicQuery(publicQuery, initialFilters.value, props.isProductList);
|
|
@@ -32722,8 +32919,8 @@ function getNumberInRange({ val, max, min }) {
|
|
|
32722
32919
|
return Math.min(Math.max(val, isNaN(min) ? val : min), isNaN(max) ? val : max);
|
|
32723
32920
|
}
|
|
32724
32921
|
function getTransformValues(el) {
|
|
32725
|
-
const { transform } = window.getComputedStyle(el);
|
|
32726
|
-
return
|
|
32922
|
+
const { transform: transform2 } = window.getComputedStyle(el);
|
|
32923
|
+
return transform2.split(/[(,)]/).slice(1, -1).map((v) => parseFloat(v));
|
|
32727
32924
|
}
|
|
32728
32925
|
function getScaleMultipliers(transformElements) {
|
|
32729
32926
|
let widthMultiplier = 1;
|