@getlupa/client 1.18.2 → 1.18.5
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 +629 -163
- package/dist/lupaSearch.js +629 -163
- package/dist/lupaSearch.mjs +629 -163
- package/dist/lupaSearch.umd.js +629 -163
- package/dist/src/modules/pluginManager/PluginConfigurationMerger.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/lupaSearch.mjs
CHANGED
|
@@ -12617,6 +12617,11 @@ const getRandomString = (length) => {
|
|
|
12617
12617
|
}
|
|
12618
12618
|
return result2;
|
|
12619
12619
|
};
|
|
12620
|
+
const getSocketClientId = () => {
|
|
12621
|
+
const timestamp = Date.now().toString(36);
|
|
12622
|
+
const randomString = getRandomString(8);
|
|
12623
|
+
return `${timestamp}-${randomString}`;
|
|
12624
|
+
};
|
|
12620
12625
|
const toFixedIfNecessary = (value, precision = 2) => {
|
|
12621
12626
|
return (+parseFloat(value).toFixed(precision)).toString();
|
|
12622
12627
|
};
|
|
@@ -12731,6 +12736,10 @@ const DEFAULT_SEARCH_BOX_OPTIONS$1 = {
|
|
|
12731
12736
|
links: {
|
|
12732
12737
|
searchResults: "/search"
|
|
12733
12738
|
},
|
|
12739
|
+
voiceSearch: {
|
|
12740
|
+
enabled: false,
|
|
12741
|
+
queryKey: ""
|
|
12742
|
+
},
|
|
12734
12743
|
panels: [
|
|
12735
12744
|
{
|
|
12736
12745
|
type: "suggestion",
|
|
@@ -14312,10 +14321,354 @@ const useSearchBoxStore = defineStore("searchBox", () => {
|
|
|
14312
14321
|
resetHighlightIndex
|
|
14313
14322
|
};
|
|
14314
14323
|
});
|
|
14324
|
+
const Env = {
|
|
14325
|
+
production: "https://api.lupasearch.com/v1/",
|
|
14326
|
+
staging: "https://api.staging.lupasearch.com/v1/"
|
|
14327
|
+
};
|
|
14328
|
+
const VoiceServiceEnv = {
|
|
14329
|
+
production: "ws://voice.lupasearch.com:3001",
|
|
14330
|
+
staging: "ws://voice.lupasearch.dev:3001"
|
|
14331
|
+
};
|
|
14332
|
+
const DEFAULT_REQUEST_CONFIG = {
|
|
14333
|
+
method: "POST",
|
|
14334
|
+
headers: { "Content-Type": "application/json" }
|
|
14335
|
+
};
|
|
14336
|
+
const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
|
|
14337
|
+
const getVoiceServiceApiUrl = (environment, customVoiceServiceUrl) => {
|
|
14338
|
+
if (customVoiceServiceUrl) {
|
|
14339
|
+
return customVoiceServiceUrl;
|
|
14340
|
+
}
|
|
14341
|
+
return VoiceServiceEnv[environment] || VoiceServiceEnv["production"];
|
|
14342
|
+
};
|
|
14343
|
+
const getApiUrl = (environment, customBaseUrl) => {
|
|
14344
|
+
if (customBaseUrl) {
|
|
14345
|
+
return customBaseUrl;
|
|
14346
|
+
}
|
|
14347
|
+
return Env[environment] || Env["production"];
|
|
14348
|
+
};
|
|
14349
|
+
const _sfc_main$1z = /* @__PURE__ */ defineComponent({
|
|
14350
|
+
__name: "VoiceSearchProgressCircle",
|
|
14351
|
+
props: {
|
|
14352
|
+
isRecording: { type: Boolean },
|
|
14353
|
+
timesliceLimit: {},
|
|
14354
|
+
timeSliceLength: {}
|
|
14355
|
+
},
|
|
14356
|
+
setup(__props, { expose: __expose }) {
|
|
14357
|
+
const props = __props;
|
|
14358
|
+
const progressBar = ref(null);
|
|
14359
|
+
const getProgressBarColor = (progressBarStyle) => {
|
|
14360
|
+
if (!progressBarStyle.backgroundImage.startsWith("conic-gradient")) {
|
|
14361
|
+
return progressBarStyle.backgroundColor;
|
|
14362
|
+
}
|
|
14363
|
+
const colorStops = progressBarStyle.backgroundImage.replace(/conic-gradient\(|\)$/g, "").split(")");
|
|
14364
|
+
if (colorStops.length > 1) {
|
|
14365
|
+
return `${colorStops[0]})`;
|
|
14366
|
+
} else {
|
|
14367
|
+
return progressBarStyle.backgroundColor;
|
|
14368
|
+
}
|
|
14369
|
+
};
|
|
14370
|
+
const startProgressBar = () => {
|
|
14371
|
+
if (!progressBar.value || !props.isRecording) {
|
|
14372
|
+
return;
|
|
14373
|
+
}
|
|
14374
|
+
const duration = props.timesliceLimit * props.timeSliceLength;
|
|
14375
|
+
const progressBarStyle = window.getComputedStyle(progressBar.value);
|
|
14376
|
+
const progressBarColor = getProgressBarColor(progressBarStyle);
|
|
14377
|
+
progressBar.value.style.background = `conic-gradient(${progressBarColor} 0%, transparent 0%)`;
|
|
14378
|
+
let startTime = null;
|
|
14379
|
+
function updateProgress(timestamp) {
|
|
14380
|
+
if (!progressBar.value || !props.isRecording) {
|
|
14381
|
+
return;
|
|
14382
|
+
}
|
|
14383
|
+
if (!startTime)
|
|
14384
|
+
startTime = timestamp;
|
|
14385
|
+
const elapsed = timestamp - startTime;
|
|
14386
|
+
const progress = Math.min(elapsed / duration, 1) * 100;
|
|
14387
|
+
progressBar.value.style.background = `conic-gradient(${progressBarColor} ${progress}%, transparent ${progress}%)`;
|
|
14388
|
+
if (elapsed < duration) {
|
|
14389
|
+
requestAnimationFrame(updateProgress);
|
|
14390
|
+
}
|
|
14391
|
+
}
|
|
14392
|
+
requestAnimationFrame(updateProgress);
|
|
14393
|
+
};
|
|
14394
|
+
const stopProgressBar = () => {
|
|
14395
|
+
if (!progressBar.value) {
|
|
14396
|
+
return;
|
|
14397
|
+
}
|
|
14398
|
+
progressBar.value.style.background = "";
|
|
14399
|
+
};
|
|
14400
|
+
__expose({
|
|
14401
|
+
startProgressBar,
|
|
14402
|
+
stopProgressBar
|
|
14403
|
+
});
|
|
14404
|
+
return (_ctx, _cache) => {
|
|
14405
|
+
return openBlock(), createElementBlock("div", {
|
|
14406
|
+
ref_key: "progressBar",
|
|
14407
|
+
ref: progressBar,
|
|
14408
|
+
class: "lupa-progress-circle"
|
|
14409
|
+
}, null, 512);
|
|
14410
|
+
};
|
|
14411
|
+
}
|
|
14412
|
+
});
|
|
14413
|
+
const buildSocketMessageFrameHeader = (event, payloadLength) => {
|
|
14414
|
+
const headerObj = { event, length: payloadLength };
|
|
14415
|
+
const headerJson = JSON.stringify(headerObj);
|
|
14416
|
+
const headerBytes = new TextEncoder().encode(headerJson);
|
|
14417
|
+
const headerLength = new Uint32Array([headerBytes.length]);
|
|
14418
|
+
const headerLengthBytes = new Uint8Array(headerLength.buffer);
|
|
14419
|
+
const result2 = new Uint8Array(4 + headerBytes.length);
|
|
14420
|
+
result2.set(headerLengthBytes, 0);
|
|
14421
|
+
result2.set(headerBytes, 4);
|
|
14422
|
+
return result2;
|
|
14423
|
+
};
|
|
14424
|
+
function useVoiceRecorder(options) {
|
|
14425
|
+
const socket = ref(null);
|
|
14426
|
+
const mediaStream = ref(null);
|
|
14427
|
+
const mediaRecorder = ref(null);
|
|
14428
|
+
const isRecording = ref(false);
|
|
14429
|
+
const errorRef = ref(null);
|
|
14430
|
+
const transcription = ref("");
|
|
14431
|
+
const timeSliceLength = computed(() => {
|
|
14432
|
+
var _a;
|
|
14433
|
+
return (_a = options.timesliceLength) != null ? _a : 1e3;
|
|
14434
|
+
});
|
|
14435
|
+
onBeforeUnmount(() => {
|
|
14436
|
+
closeSocket();
|
|
14437
|
+
stopRecording();
|
|
14438
|
+
});
|
|
14439
|
+
const initSocket = (url, onMessage) => {
|
|
14440
|
+
socket.value = new WebSocket(url);
|
|
14441
|
+
socket.value.onopen = () => __async2(this, null, function* () {
|
|
14442
|
+
var _a;
|
|
14443
|
+
if (((_a = mediaRecorder.value) == null ? void 0 : _a.state) !== "recording") {
|
|
14444
|
+
yield startRecording();
|
|
14445
|
+
}
|
|
14446
|
+
});
|
|
14447
|
+
socket.value.onmessage = (event) => {
|
|
14448
|
+
const msg = JSON.parse(event.data);
|
|
14449
|
+
if (msg.event === "transcription") {
|
|
14450
|
+
transcription.value = msg.transcription;
|
|
14451
|
+
onMessage == null ? void 0 : onMessage(msg.transcription);
|
|
14452
|
+
stopSocketConnection();
|
|
14453
|
+
} else if (msg.event === "error") {
|
|
14454
|
+
errorRef.value = "Server error during transcription";
|
|
14455
|
+
stopRecording();
|
|
14456
|
+
}
|
|
14457
|
+
};
|
|
14458
|
+
socket.value.onclose = () => {
|
|
14459
|
+
stopRecording();
|
|
14460
|
+
};
|
|
14461
|
+
socket.value.onerror = () => {
|
|
14462
|
+
stopRecording();
|
|
14463
|
+
errorRef.value = "Service connection error";
|
|
14464
|
+
};
|
|
14465
|
+
};
|
|
14466
|
+
const onMediaRecorderDataAvailable = (event) => __async2(this, null, function* () {
|
|
14467
|
+
var _a, _b;
|
|
14468
|
+
if (((_a = mediaRecorder.value) == null ? void 0 : _a.state) !== "recording")
|
|
14469
|
+
return;
|
|
14470
|
+
const audioBuffer = yield event.data.arrayBuffer();
|
|
14471
|
+
const header = buildSocketMessageFrameHeader("audio-chunk", audioBuffer.byteLength);
|
|
14472
|
+
const buffer = new Uint8Array(header.length + audioBuffer.byteLength);
|
|
14473
|
+
buffer.set(header, 0);
|
|
14474
|
+
buffer.set(new Uint8Array(audioBuffer), header.length);
|
|
14475
|
+
(_b = socket.value) == null ? void 0 : _b.send(buffer);
|
|
14476
|
+
});
|
|
14477
|
+
const startRecording = () => __async2(this, null, function* () {
|
|
14478
|
+
mediaStream.value = yield navigator.mediaDevices.getUserMedia({
|
|
14479
|
+
video: false,
|
|
14480
|
+
audio: {
|
|
14481
|
+
channelCount: 1,
|
|
14482
|
+
echoCancellation: true,
|
|
14483
|
+
sampleRate: 16e3
|
|
14484
|
+
}
|
|
14485
|
+
});
|
|
14486
|
+
mediaRecorder.value = new MediaRecorder(mediaStream.value, {
|
|
14487
|
+
mimeType: "audio/webm; codecs=opus"
|
|
14488
|
+
});
|
|
14489
|
+
mediaRecorder.value.ondataavailable = onMediaRecorderDataAvailable;
|
|
14490
|
+
mediaRecorder.value.start(timeSliceLength.value);
|
|
14491
|
+
isRecording.value = true;
|
|
14492
|
+
});
|
|
14493
|
+
const stopRecording = () => {
|
|
14494
|
+
var _a, _b;
|
|
14495
|
+
(_a = mediaRecorder.value) == null ? void 0 : _a.stop();
|
|
14496
|
+
(_b = mediaStream.value) == null ? void 0 : _b.getTracks().forEach((track2) => {
|
|
14497
|
+
track2.stop();
|
|
14498
|
+
});
|
|
14499
|
+
isRecording.value = false;
|
|
14500
|
+
};
|
|
14501
|
+
const stopSocketConnection = () => {
|
|
14502
|
+
if (socket.value && socket.value.readyState === WebSocket.OPEN) {
|
|
14503
|
+
const endHeader = buildSocketMessageFrameHeader("audio-chunk-end", 0);
|
|
14504
|
+
socket.value.send(endHeader);
|
|
14505
|
+
setTimeout(() => {
|
|
14506
|
+
closeSocket();
|
|
14507
|
+
}, 1e3);
|
|
14508
|
+
}
|
|
14509
|
+
};
|
|
14510
|
+
const closeSocket = () => {
|
|
14511
|
+
var _a;
|
|
14512
|
+
(_a = socket.value) == null ? void 0 : _a.close();
|
|
14513
|
+
socket.value = null;
|
|
14514
|
+
};
|
|
14515
|
+
const reset = () => {
|
|
14516
|
+
stopRecording();
|
|
14517
|
+
closeSocket();
|
|
14518
|
+
transcription.value = "";
|
|
14519
|
+
errorRef.value = null;
|
|
14520
|
+
isRecording.value = false;
|
|
14521
|
+
};
|
|
14522
|
+
return {
|
|
14523
|
+
isRecording,
|
|
14524
|
+
transcription,
|
|
14525
|
+
errorRef,
|
|
14526
|
+
initSocket,
|
|
14527
|
+
startRecording,
|
|
14528
|
+
stopRecording,
|
|
14529
|
+
stopSocketConnection,
|
|
14530
|
+
reset,
|
|
14531
|
+
closeSocket
|
|
14532
|
+
};
|
|
14533
|
+
}
|
|
14534
|
+
const _hoisted_1$1l = {
|
|
14535
|
+
key: 0,
|
|
14536
|
+
class: "lupa-dialog-overlay"
|
|
14537
|
+
};
|
|
14538
|
+
const _hoisted_2$W = { class: "lupa-dialog-content" };
|
|
14539
|
+
const _hoisted_3$F = { class: "lupa-listening-text" };
|
|
14540
|
+
const _hoisted_4$v = { class: "lupa-mic-button-wrapper" };
|
|
14541
|
+
const _sfc_main$1y = /* @__PURE__ */ defineComponent({
|
|
14542
|
+
__name: "VoiceSearchDialog",
|
|
14543
|
+
props: {
|
|
14544
|
+
isOpen: { type: Boolean },
|
|
14545
|
+
options: {}
|
|
14546
|
+
},
|
|
14547
|
+
emits: [
|
|
14548
|
+
"close",
|
|
14549
|
+
"transcript-update",
|
|
14550
|
+
"stop-recognize"
|
|
14551
|
+
],
|
|
14552
|
+
setup(__props, { expose: __expose, emit: emit2 }) {
|
|
14553
|
+
const props = __props;
|
|
14554
|
+
const optionsStore = useOptionsStore();
|
|
14555
|
+
const {
|
|
14556
|
+
isRecording,
|
|
14557
|
+
transcription,
|
|
14558
|
+
errorRef,
|
|
14559
|
+
initSocket,
|
|
14560
|
+
stopSocketConnection,
|
|
14561
|
+
reset
|
|
14562
|
+
} = useVoiceRecorder(props.options);
|
|
14563
|
+
const clientId = ref(null);
|
|
14564
|
+
const voiceSearchProgressBar = ref(null);
|
|
14565
|
+
const timesliceLimit = computed(() => {
|
|
14566
|
+
var _a;
|
|
14567
|
+
return (_a = props.options.timesliceLimit) != null ? _a : 4;
|
|
14568
|
+
});
|
|
14569
|
+
const timeSliceLength = computed(() => {
|
|
14570
|
+
var _a;
|
|
14571
|
+
return (_a = props.options.timesliceLength) != null ? _a : 1e3;
|
|
14572
|
+
});
|
|
14573
|
+
const stopDelay = computed(() => {
|
|
14574
|
+
var _a;
|
|
14575
|
+
return (_a = props.options.stopDelay) != null ? _a : 700;
|
|
14576
|
+
});
|
|
14577
|
+
const labels = computed(() => {
|
|
14578
|
+
var _a;
|
|
14579
|
+
return (_a = props.options.labels) != null ? _a : {};
|
|
14580
|
+
});
|
|
14581
|
+
const description = computed(() => {
|
|
14582
|
+
var _a, _b, _c;
|
|
14583
|
+
if (errorRef.value) {
|
|
14584
|
+
return (_a = labels.value.serviceError) != null ? _a : errorRef.value;
|
|
14585
|
+
}
|
|
14586
|
+
if (!isRecording.value) {
|
|
14587
|
+
return (_b = labels.value.microphoneOff) != null ? _b : "Microphone is off. Try again.";
|
|
14588
|
+
}
|
|
14589
|
+
return (_c = labels.value.listening) != null ? _c : "Listening...";
|
|
14590
|
+
});
|
|
14591
|
+
watch(transcription, (newValue) => {
|
|
14592
|
+
emit2("transcript-update", newValue);
|
|
14593
|
+
});
|
|
14594
|
+
const handleRecordingButtonClick = () => {
|
|
14595
|
+
var _a, _b;
|
|
14596
|
+
if (isRecording.value) {
|
|
14597
|
+
setTimeout(() => {
|
|
14598
|
+
stopSocketConnection();
|
|
14599
|
+
handleOnStopEvent();
|
|
14600
|
+
}, stopDelay.value);
|
|
14601
|
+
return;
|
|
14602
|
+
}
|
|
14603
|
+
const voiceServiceUrl = getVoiceServiceApiUrl(
|
|
14604
|
+
optionsStore.envOptions.environment,
|
|
14605
|
+
props.options.customVoiceServiceUrl
|
|
14606
|
+
);
|
|
14607
|
+
const socketUrl = `${voiceServiceUrl}?clientId=${clientId.value}&queryKey=${props.options.queryKey}&languageCode=${(_a = props.options.language) != null ? _a : "en-US"}&connectionType=write-first`;
|
|
14608
|
+
initSocket(socketUrl);
|
|
14609
|
+
(_b = voiceSearchProgressBar.value) == null ? void 0 : _b.startProgressBar();
|
|
14610
|
+
setTimeout(() => {
|
|
14611
|
+
stopSocketConnection();
|
|
14612
|
+
handleOnStopEvent();
|
|
14613
|
+
}, timesliceLimit.value * timeSliceLength.value);
|
|
14614
|
+
};
|
|
14615
|
+
const handleOnStopEvent = () => {
|
|
14616
|
+
var _a;
|
|
14617
|
+
setTimeout(() => {
|
|
14618
|
+
if (errorRef.value)
|
|
14619
|
+
return;
|
|
14620
|
+
emit2("stop-recognize", transcription.value);
|
|
14621
|
+
}, 1500);
|
|
14622
|
+
(_a = voiceSearchProgressBar.value) == null ? void 0 : _a.stopProgressBar();
|
|
14623
|
+
};
|
|
14624
|
+
onMounted(() => {
|
|
14625
|
+
clientId.value = getSocketClientId();
|
|
14626
|
+
});
|
|
14627
|
+
onBeforeUnmount(() => {
|
|
14628
|
+
clientId.value = null;
|
|
14629
|
+
});
|
|
14630
|
+
const dialogReset = () => {
|
|
14631
|
+
var _a;
|
|
14632
|
+
reset();
|
|
14633
|
+
(_a = voiceSearchProgressBar.value) == null ? void 0 : _a.stopProgressBar();
|
|
14634
|
+
};
|
|
14635
|
+
__expose({
|
|
14636
|
+
handleRecordingButtonClick,
|
|
14637
|
+
reset: dialogReset
|
|
14638
|
+
});
|
|
14639
|
+
return (_ctx, _cache) => {
|
|
14640
|
+
return openBlock(), createElementBlock("div", null, [
|
|
14641
|
+
props.isOpen ? (openBlock(), createElementBlock("div", _hoisted_1$1l, [
|
|
14642
|
+
createBaseVNode("button", {
|
|
14643
|
+
class: "lupa-dialog-box-close-button",
|
|
14644
|
+
onClick: _cache[0] || (_cache[0] = () => emit2("close"))
|
|
14645
|
+
}),
|
|
14646
|
+
createBaseVNode("div", _hoisted_2$W, [
|
|
14647
|
+
createBaseVNode("p", _hoisted_3$F, toDisplayString(description.value), 1),
|
|
14648
|
+
createBaseVNode("div", _hoisted_4$v, [
|
|
14649
|
+
createBaseVNode("button", {
|
|
14650
|
+
class: normalizeClass(["lupa-mic-button", { recording: unref(isRecording) }]),
|
|
14651
|
+
onClick: handleRecordingButtonClick
|
|
14652
|
+
}, null, 2),
|
|
14653
|
+
createVNode(_sfc_main$1z, {
|
|
14654
|
+
ref_key: "voiceSearchProgressBar",
|
|
14655
|
+
ref: voiceSearchProgressBar,
|
|
14656
|
+
class: "lupa-progress-circle",
|
|
14657
|
+
isRecording: unref(isRecording),
|
|
14658
|
+
timesliceLimit: timesliceLimit.value,
|
|
14659
|
+
timeSliceLength: timeSliceLength.value
|
|
14660
|
+
}, null, 8, ["isRecording", "timesliceLimit", "timeSliceLength"])
|
|
14661
|
+
])
|
|
14662
|
+
])
|
|
14663
|
+
])) : createCommentVNode("", true)
|
|
14664
|
+
]);
|
|
14665
|
+
};
|
|
14666
|
+
}
|
|
14667
|
+
});
|
|
14315
14668
|
const _hoisted_1$1k = { id: "lupa-search-box-input-container" };
|
|
14316
14669
|
const _hoisted_2$V = { class: "lupa-input-clear" };
|
|
14317
14670
|
const _hoisted_3$E = { id: "lupa-search-box-input" };
|
|
14318
|
-
const _hoisted_4$
|
|
14671
|
+
const _hoisted_4$u = ["value"];
|
|
14319
14672
|
const _hoisted_5$l = ["aria-label", "placeholder"];
|
|
14320
14673
|
const _hoisted_6$9 = /* @__PURE__ */ createBaseVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
14321
14674
|
const _hoisted_7$7 = [
|
|
@@ -14325,6 +14678,7 @@ const _hoisted_8$3 = {
|
|
|
14325
14678
|
key: 0,
|
|
14326
14679
|
class: "lupa-close-label"
|
|
14327
14680
|
};
|
|
14681
|
+
const _hoisted_9$3 = { key: 1 };
|
|
14328
14682
|
const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
14329
14683
|
__name: "SearchBoxInput",
|
|
14330
14684
|
props: {
|
|
@@ -14340,6 +14694,8 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
|
14340
14694
|
const searchBoxStore = useSearchBoxStore();
|
|
14341
14695
|
const { query } = storeToRefs(paramStore);
|
|
14342
14696
|
const mainInput = ref(null);
|
|
14697
|
+
const voiceDialogOverlay = ref(null);
|
|
14698
|
+
const isVoiceDialogOpen = ref(false);
|
|
14343
14699
|
const emitInputOnFocus = computed(() => {
|
|
14344
14700
|
var _a;
|
|
14345
14701
|
return (_a = props.emitInputOnFocus) != null ? _a : true;
|
|
@@ -14350,6 +14706,10 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
|
14350
14706
|
return (_a = props.suggestedValue) != null ? _a : { value: "", override: false, item: { suggestion: "" } };
|
|
14351
14707
|
}
|
|
14352
14708
|
);
|
|
14709
|
+
const isVoiceSearchEnabled = computed(() => {
|
|
14710
|
+
var _a, _b;
|
|
14711
|
+
return (_b = (_a = props.options.voiceSearch) == null ? void 0 : _a.enabled) != null ? _b : false;
|
|
14712
|
+
});
|
|
14353
14713
|
const labels = computed(() => props.options.labels);
|
|
14354
14714
|
const input2 = ref("");
|
|
14355
14715
|
const inputValue = computed({
|
|
@@ -14373,6 +14733,12 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
|
14373
14733
|
var _a;
|
|
14374
14734
|
return (_a = labels.value.searchInputAriaLabel) != null ? _a : "Search input";
|
|
14375
14735
|
});
|
|
14736
|
+
onMounted(() => {
|
|
14737
|
+
document.addEventListener("click", handleClickOutsideVoiceDialogOverlay);
|
|
14738
|
+
});
|
|
14739
|
+
onBeforeUnmount(() => {
|
|
14740
|
+
document.removeEventListener("click", handleClickOutsideVoiceDialogOverlay);
|
|
14741
|
+
});
|
|
14376
14742
|
watch(suggestedValue, () => {
|
|
14377
14743
|
if (suggestedValue.value.override) {
|
|
14378
14744
|
input2.value = suggestedValue.value.item.suggestion;
|
|
@@ -14407,6 +14773,37 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
|
14407
14773
|
}
|
|
14408
14774
|
(_a = mainInput == null ? void 0 : mainInput.value) == null ? void 0 : _a.focus();
|
|
14409
14775
|
};
|
|
14776
|
+
const openVoiceSearchDialog = () => {
|
|
14777
|
+
var _a;
|
|
14778
|
+
isVoiceDialogOpen.value = true;
|
|
14779
|
+
(_a = voiceDialogOverlay.value) == null ? void 0 : _a.handleRecordingButtonClick();
|
|
14780
|
+
};
|
|
14781
|
+
const closeDialog = () => {
|
|
14782
|
+
var _a;
|
|
14783
|
+
isVoiceDialogOpen.value = false;
|
|
14784
|
+
(_a = voiceDialogOverlay.value) == null ? void 0 : _a.reset();
|
|
14785
|
+
};
|
|
14786
|
+
const handleVoiceSearchOutput = (transcription) => {
|
|
14787
|
+
inputValue.value = transcription;
|
|
14788
|
+
handleSubmit();
|
|
14789
|
+
};
|
|
14790
|
+
const stopRecognition = (trascription) => {
|
|
14791
|
+
setTimeout(() => {
|
|
14792
|
+
isVoiceDialogOpen.value = false;
|
|
14793
|
+
handleVoiceSearchOutput(trascription);
|
|
14794
|
+
}, 500);
|
|
14795
|
+
};
|
|
14796
|
+
const handleClickOutsideVoiceDialogOverlay = (event) => {
|
|
14797
|
+
if (event.target.classList.contains("lupa-voice-search-button")) {
|
|
14798
|
+
return;
|
|
14799
|
+
}
|
|
14800
|
+
if (voiceDialogOverlay.value && voiceDialogOverlay.value.$el.contains(event.target)) {
|
|
14801
|
+
return;
|
|
14802
|
+
}
|
|
14803
|
+
if (isVoiceDialogOpen.value) {
|
|
14804
|
+
closeDialog();
|
|
14805
|
+
}
|
|
14806
|
+
};
|
|
14410
14807
|
__expose({ focus });
|
|
14411
14808
|
return (_ctx, _cache) => {
|
|
14412
14809
|
return openBlock(), createElementBlock("div", _hoisted_1$1k, [
|
|
@@ -14422,7 +14819,7 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
|
14422
14819
|
"aria-hidden": "true",
|
|
14423
14820
|
value: showHint.value ? suggestedValue.value.item.suggestion : "",
|
|
14424
14821
|
disabled: ""
|
|
14425
|
-
}, null, 8, _hoisted_4$
|
|
14822
|
+
}, null, 8, _hoisted_4$u),
|
|
14426
14823
|
withDirectives(createBaseVNode("input", mergeProps({
|
|
14427
14824
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event)
|
|
14428
14825
|
}, inputAttributes.value, {
|
|
@@ -14450,7 +14847,23 @@ const _sfc_main$1x = /* @__PURE__ */ defineComponent({
|
|
|
14450
14847
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
14451
14848
|
}, [
|
|
14452
14849
|
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
14453
|
-
])) : createCommentVNode("", true)
|
|
14850
|
+
])) : createCommentVNode("", true),
|
|
14851
|
+
isVoiceSearchEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
14852
|
+
createBaseVNode("button", {
|
|
14853
|
+
onClick: openVoiceSearchDialog,
|
|
14854
|
+
class: "lupa-voice-search-button"
|
|
14855
|
+
})
|
|
14856
|
+
])) : createCommentVNode("", true),
|
|
14857
|
+
isVoiceSearchEnabled.value ? (openBlock(), createBlock(_sfc_main$1y, {
|
|
14858
|
+
key: 2,
|
|
14859
|
+
ref_key: "voiceDialogOverlay",
|
|
14860
|
+
ref: voiceDialogOverlay,
|
|
14861
|
+
isOpen: isVoiceDialogOpen.value,
|
|
14862
|
+
options: props.options.voiceSearch,
|
|
14863
|
+
onClose: closeDialog,
|
|
14864
|
+
onTranscriptUpdate: handleVoiceSearchOutput,
|
|
14865
|
+
onStopRecognize: stopRecognition
|
|
14866
|
+
}, null, 8, ["isOpen", "options"])) : createCommentVNode("", true)
|
|
14454
14867
|
]);
|
|
14455
14868
|
};
|
|
14456
14869
|
}
|
|
@@ -14648,7 +15061,7 @@ const _hoisted_3$D = {
|
|
|
14648
15061
|
class: "lupa-suggestion-facet",
|
|
14649
15062
|
"data-cy": "lupa-suggestion-facet"
|
|
14650
15063
|
};
|
|
14651
|
-
const _hoisted_4$
|
|
15064
|
+
const _hoisted_4$t = {
|
|
14652
15065
|
class: "lupa-suggestion-facet-label",
|
|
14653
15066
|
"data-cy": "lupa-suggestion-facet-label"
|
|
14654
15067
|
};
|
|
@@ -14694,7 +15107,7 @@ const _sfc_main$1s = /* @__PURE__ */ defineComponent({
|
|
|
14694
15107
|
innerHTML: _ctx.suggestion.displayHighlight
|
|
14695
15108
|
}, null, 8, _hoisted_1$1g)) : (openBlock(), createElementBlock("div", _hoisted_2$T, toDisplayString(_ctx.suggestion.display), 1)),
|
|
14696
15109
|
_ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$D, [
|
|
14697
|
-
createBaseVNode("span", _hoisted_4$
|
|
15110
|
+
createBaseVNode("span", _hoisted_4$t, toDisplayString(facetLabel.value), 1),
|
|
14698
15111
|
createBaseVNode("span", _hoisted_5$k, toDisplayString(_ctx.suggestion.facet.title), 1)
|
|
14699
15112
|
])) : createCommentVNode("", true)
|
|
14700
15113
|
]);
|
|
@@ -24188,7 +24601,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
24188
24601
|
const _hoisted_1$1a = ["innerHTML"];
|
|
24189
24602
|
const _hoisted_2$P = { key: 0 };
|
|
24190
24603
|
const _hoisted_3$C = { key: 1 };
|
|
24191
|
-
const _hoisted_4$
|
|
24604
|
+
const _hoisted_4$s = { class: "lupa-search-box-custom-label" };
|
|
24192
24605
|
const _hoisted_5$j = { class: "lupa-search-box-custom-text" };
|
|
24193
24606
|
const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
24194
24607
|
__name: "SearchBoxProductCustom",
|
|
@@ -24221,7 +24634,7 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
|
|
|
24221
24634
|
class: [className.value, "lupa-search-box-product-custom"]
|
|
24222
24635
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
24223
24636
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$C, [
|
|
24224
|
-
createBaseVNode("div", _hoisted_4$
|
|
24637
|
+
createBaseVNode("div", _hoisted_4$s, toDisplayString(label.value), 1),
|
|
24225
24638
|
createBaseVNode("div", _hoisted_5$j, toDisplayString(text.value), 1)
|
|
24226
24639
|
]))
|
|
24227
24640
|
], 16));
|
|
@@ -24571,7 +24984,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
|
|
|
24571
24984
|
const _hoisted_1$18 = { class: "lupa-search-box-add-to-cart-wrapper" };
|
|
24572
24985
|
const _hoisted_2$O = { class: "lupa-search-box-product-addtocart" };
|
|
24573
24986
|
const _hoisted_3$B = ["disabled"];
|
|
24574
|
-
const _hoisted_4$
|
|
24987
|
+
const _hoisted_4$r = ["href"];
|
|
24575
24988
|
const _hoisted_5$i = ["onClick", "disabled"];
|
|
24576
24989
|
const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
24577
24990
|
__name: "SearchBoxProductAddToCart",
|
|
@@ -24619,7 +25032,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
|
|
|
24619
25032
|
"data-cy": "lupa-add-to-cart",
|
|
24620
25033
|
disabled: !inStockValue.value || loading.value
|
|
24621
25034
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
24622
|
-
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$
|
|
25035
|
+
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$r)
|
|
24623
25036
|
], 16, _hoisted_3$B)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
24624
25037
|
key: 1,
|
|
24625
25038
|
onClick: withModifiers(handleClick, ["stop", "prevent"]),
|
|
@@ -24739,7 +25152,7 @@ const _sfc_main$1g = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
|
|
|
24739
25152
|
const _hoisted_1$16 = { class: "lupa-badge-title" };
|
|
24740
25153
|
const _hoisted_2$N = ["src"];
|
|
24741
25154
|
const _hoisted_3$A = { key: 1 };
|
|
24742
|
-
const _hoisted_4$
|
|
25155
|
+
const _hoisted_4$q = {
|
|
24743
25156
|
key: 0,
|
|
24744
25157
|
class: "lupa-badge-full-text"
|
|
24745
25158
|
};
|
|
@@ -24783,7 +25196,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
|
|
|
24783
25196
|
}, null, 8, _hoisted_2$N)) : createCommentVNode("", true),
|
|
24784
25197
|
hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$A, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
|
|
24785
25198
|
]),
|
|
24786
|
-
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
25199
|
+
hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$q, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
|
|
24787
25200
|
], 6);
|
|
24788
25201
|
};
|
|
24789
25202
|
}
|
|
@@ -25698,7 +26111,7 @@ const _hoisted_3$y = {
|
|
|
25698
26111
|
key: 0,
|
|
25699
26112
|
class: "lupa-panel-title lupa-panel-title-top-results"
|
|
25700
26113
|
};
|
|
25701
|
-
const _hoisted_4$
|
|
26114
|
+
const _hoisted_4$p = {
|
|
25702
26115
|
key: 1,
|
|
25703
26116
|
class: "lupa-panel-title"
|
|
25704
26117
|
};
|
|
@@ -25891,7 +26304,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
|
|
|
25891
26304
|
"data-cy": "lupa-panel-" + panel.type + "-index"
|
|
25892
26305
|
}, [
|
|
25893
26306
|
((_a = panel.labels) == null ? void 0 : _a.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$y, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
|
|
25894
|
-
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
26307
|
+
((_c = panel.labels) == null ? void 0 : _c.title) && showPanelTitle(panel) ? (openBlock(), createElementBlock("div", _hoisted_4$p, toDisplayString((_d = panel.labels) == null ? void 0 : _d.title), 1)) : createCommentVNode("", true),
|
|
25895
26308
|
panel.queryKey && canShowPanel(panel) ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
|
|
25896
26309
|
key: 2,
|
|
25897
26310
|
panel,
|
|
@@ -25989,7 +26402,8 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
|
|
|
25989
26402
|
"labels",
|
|
25990
26403
|
"links",
|
|
25991
26404
|
"inputAttributes",
|
|
25992
|
-
"showSubmitButton"
|
|
26405
|
+
"showSubmitButton",
|
|
26406
|
+
"voiceSearch"
|
|
25993
26407
|
])
|
|
25994
26408
|
);
|
|
25995
26409
|
const panelOptions = computed(
|
|
@@ -26389,7 +26803,7 @@ const _hoisted_3$x = {
|
|
|
26389
26803
|
key: 1,
|
|
26390
26804
|
"data-cy": "did-you-mean-label"
|
|
26391
26805
|
};
|
|
26392
|
-
const _hoisted_4$
|
|
26806
|
+
const _hoisted_4$o = { key: 1 };
|
|
26393
26807
|
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
26394
26808
|
__name: "SearchResultsDidYouMean",
|
|
26395
26809
|
props: {
|
|
@@ -26440,7 +26854,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
|
|
|
26440
26854
|
class: "lupa-did-you-mean lupa-highlighted-search-text",
|
|
26441
26855
|
"data-cy": "did-you-mean-value",
|
|
26442
26856
|
onClick: _cache[0] || (_cache[0] = ($event) => goToResults({ searchText: didYouMeanValue.value }))
|
|
26443
|
-
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$
|
|
26857
|
+
}, toDisplayString(didYouMeanValue.value) + " ", 1)) : (openBlock(), createElementBlock("span", _hoisted_4$o, toDisplayString(label) + " ", 1))
|
|
26444
26858
|
]);
|
|
26445
26859
|
}), 128))
|
|
26446
26860
|
])) : createCommentVNode("", true)
|
|
@@ -26490,7 +26904,7 @@ const _hoisted_3$w = {
|
|
|
26490
26904
|
key: 1,
|
|
26491
26905
|
class: "lupa-results-total-count"
|
|
26492
26906
|
};
|
|
26493
|
-
const _hoisted_4$
|
|
26907
|
+
const _hoisted_4$n = { class: "lupa-results-total-count-number" };
|
|
26494
26908
|
const _hoisted_5$g = ["innerHTML"];
|
|
26495
26909
|
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
26496
26910
|
__name: "SearchResultsTitle",
|
|
@@ -26540,7 +26954,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
|
|
|
26540
26954
|
queryText.value && !searchResultsTitleTemplate.value ? (openBlock(), createElementBlock("span", _hoisted_2$G, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
|
|
26541
26955
|
showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$w, [
|
|
26542
26956
|
createTextVNode("(" + toDisplayString(searchResultsCountLabel.value), 1),
|
|
26543
|
-
createBaseVNode("span", _hoisted_4$
|
|
26957
|
+
createBaseVNode("span", _hoisted_4$n, toDisplayString(unref(totalItems)), 1),
|
|
26544
26958
|
createTextVNode(")")
|
|
26545
26959
|
])) : createCommentVNode("", true)
|
|
26546
26960
|
])) : createCommentVNode("", true),
|
|
@@ -26573,22 +26987,42 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
|
|
|
26573
26987
|
emits: ["remove"],
|
|
26574
26988
|
setup(__props, { emit: emit2 }) {
|
|
26575
26989
|
const props = __props;
|
|
26576
|
-
const facetKeyClass = computed(() => {
|
|
26577
|
-
|
|
26990
|
+
const facetKeyClass = computed(() => `lupa-facet-active-filter-${props.filter.key}`);
|
|
26991
|
+
const { searchResultOptions } = storeToRefs(useOptionsStore());
|
|
26992
|
+
const units = computed(() => {
|
|
26993
|
+
var _a, _b, _c, _d, _e;
|
|
26994
|
+
return (_e = (_d = (_c = (_b = (_a = searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
|
|
26578
26995
|
});
|
|
26579
|
-
|
|
26996
|
+
function handleClick() {
|
|
26580
26997
|
emit2("remove", { filter: props.filter });
|
|
26581
|
-
}
|
|
26998
|
+
}
|
|
26999
|
+
function formatFilterValue(filter2) {
|
|
27000
|
+
const unit = units.value[filter2.key] || "";
|
|
27001
|
+
let min, max;
|
|
27002
|
+
if (Array.isArray(filter2.value)) {
|
|
27003
|
+
[min, max] = filter2.value.map(String);
|
|
27004
|
+
} else if (typeof filter2.value === "string" && filter2.value.includes("-")) {
|
|
27005
|
+
const parts = filter2.value.split("-").map((s) => s.trim());
|
|
27006
|
+
if (parts.length === 2)
|
|
27007
|
+
[min, max] = parts;
|
|
27008
|
+
}
|
|
27009
|
+
if (min != null && max != null) {
|
|
27010
|
+
return `${min} ${unit} – ${max} ${unit}`;
|
|
27011
|
+
}
|
|
27012
|
+
return `${filter2.value} ${unit}`.trim();
|
|
27013
|
+
}
|
|
26582
27014
|
return (_ctx, _cache) => {
|
|
26583
27015
|
return openBlock(), createElementBlock("div", {
|
|
26584
|
-
class: normalizeClass(["lupa-search-result-filter-value",
|
|
27016
|
+
class: normalizeClass(["lupa-search-result-filter-value", [facetKeyClass.value]]),
|
|
27017
|
+
"data-cy": "lupa-current-filter-item"
|
|
26585
27018
|
}, [
|
|
26586
27019
|
createBaseVNode("div", {
|
|
26587
27020
|
class: "lupa-current-filter-action",
|
|
26588
|
-
onClick: handleClick
|
|
26589
|
-
|
|
27021
|
+
onClick: handleClick,
|
|
27022
|
+
"aria-label": "Remove filter"
|
|
27023
|
+
}, " ⨉ "),
|
|
26590
27024
|
createBaseVNode("div", _hoisted_1$U, toDisplayString(_ctx.filter.label) + ": ", 1),
|
|
26591
|
-
createBaseVNode("div", _hoisted_2$F, toDisplayString(
|
|
27025
|
+
createBaseVNode("div", _hoisted_2$F, toDisplayString(formatFilterValue(props.filter)), 1)
|
|
26592
27026
|
], 2);
|
|
26593
27027
|
};
|
|
26594
27028
|
}
|
|
@@ -26602,7 +27036,7 @@ const _hoisted_3$v = {
|
|
|
26602
27036
|
key: 0,
|
|
26603
27037
|
class: "filter-values"
|
|
26604
27038
|
};
|
|
26605
|
-
const _hoisted_4$
|
|
27039
|
+
const _hoisted_4$m = { class: "lupa-current-filter-list" };
|
|
26606
27040
|
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
26607
27041
|
__name: "CurrentFilters",
|
|
26608
27042
|
props: {
|
|
@@ -26610,6 +27044,14 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
26610
27044
|
expandable: { type: Boolean }
|
|
26611
27045
|
},
|
|
26612
27046
|
setup(__props) {
|
|
27047
|
+
const optionsStore = useOptionsStore();
|
|
27048
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
27049
|
+
const units = computed(
|
|
27050
|
+
() => {
|
|
27051
|
+
var _a, _b, _c, _d, _e;
|
|
27052
|
+
return (_e = (_d = (_c = (_b = (_a = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a.filters) == null ? void 0 : _b.facets) == null ? void 0 : _c.stats) == null ? void 0 : _d.units) != null ? _e : {};
|
|
27053
|
+
}
|
|
27054
|
+
);
|
|
26613
27055
|
const isOpen = ref(false);
|
|
26614
27056
|
const paramsStore = useParamsStore();
|
|
26615
27057
|
const optionStore = useOptionsStore();
|
|
@@ -26686,13 +27128,14 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
|
|
|
26686
27128
|
}, null, 2)) : createCommentVNode("", true)
|
|
26687
27129
|
]),
|
|
26688
27130
|
!_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
|
|
26689
|
-
createBaseVNode("div", _hoisted_4$
|
|
27131
|
+
createBaseVNode("div", _hoisted_4$m, [
|
|
26690
27132
|
(openBlock(true), createElementBlock(Fragment, null, renderList(currentDisplayFilters.value, (filter2) => {
|
|
26691
27133
|
return openBlock(), createBlock(_sfc_main$_, {
|
|
26692
27134
|
key: filter2.key + "_" + filter2.value,
|
|
26693
27135
|
filter: filter2,
|
|
27136
|
+
units: units.value,
|
|
26694
27137
|
onRemove: handleRemove
|
|
26695
|
-
}, null, 8, ["filter"]);
|
|
27138
|
+
}, null, 8, ["filter", "units"]);
|
|
26696
27139
|
}), 128))
|
|
26697
27140
|
]),
|
|
26698
27141
|
createBaseVNode("div", {
|
|
@@ -26754,7 +27197,7 @@ const _hoisted_1$R = {
|
|
|
26754
27197
|
};
|
|
26755
27198
|
const _hoisted_2$D = { class: "lupa-category-back" };
|
|
26756
27199
|
const _hoisted_3$u = ["href"];
|
|
26757
|
-
const _hoisted_4$
|
|
27200
|
+
const _hoisted_4$l = ["href"];
|
|
26758
27201
|
const _hoisted_5$f = { class: "lupa-child-category-list" };
|
|
26759
27202
|
const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
26760
27203
|
__name: "CategoryFilter",
|
|
@@ -26861,7 +27304,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
|
26861
27304
|
href: parentUrlLink.value,
|
|
26862
27305
|
class: normalizeClass({ "lupa-title-category": !hasBackButton.value }),
|
|
26863
27306
|
onClick: handleNavigationParent
|
|
26864
|
-
}, toDisplayString(parentTitle.value), 11, _hoisted_4$
|
|
27307
|
+
}, toDisplayString(parentTitle.value), 11, _hoisted_4$l)
|
|
26865
27308
|
], 2),
|
|
26866
27309
|
createBaseVNode("div", _hoisted_5$f, [
|
|
26867
27310
|
(openBlock(true), createElementBlock(Fragment, null, renderList(categoryChildren.value, (child) => {
|
|
@@ -26882,7 +27325,7 @@ const _hoisted_1$Q = {
|
|
|
26882
27325
|
};
|
|
26883
27326
|
const _hoisted_2$C = ["placeholder"];
|
|
26884
27327
|
const _hoisted_3$t = { class: "lupa-terms-list" };
|
|
26885
|
-
const _hoisted_4$
|
|
27328
|
+
const _hoisted_4$k = ["onClick"];
|
|
26886
27329
|
const _hoisted_5$e = { class: "lupa-term-checkbox-wrapper" };
|
|
26887
27330
|
const _hoisted_6$8 = { class: "lupa-term-label" };
|
|
26888
27331
|
const _hoisted_7$6 = {
|
|
@@ -27009,7 +27452,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
|
27009
27452
|
createBaseVNode("span", _hoisted_6$8, toDisplayString(getItemLabel(item)), 1),
|
|
27010
27453
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_7$6, "(" + toDisplayString(item.count) + ")", 1)) : createCommentVNode("", true)
|
|
27011
27454
|
], 2)
|
|
27012
|
-
], 10, _hoisted_4$
|
|
27455
|
+
], 10, _hoisted_4$k);
|
|
27013
27456
|
}), 128))
|
|
27014
27457
|
]),
|
|
27015
27458
|
displayShowMore.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -28009,22 +28452,24 @@ const _hoisted_3$s = {
|
|
|
28009
28452
|
key: 1,
|
|
28010
28453
|
class: "lupa-stats-facet-summary-input"
|
|
28011
28454
|
};
|
|
28012
|
-
const _hoisted_4$
|
|
28455
|
+
const _hoisted_4$j = {
|
|
28013
28456
|
key: 0,
|
|
28014
28457
|
class: "lupa-stats-range-label"
|
|
28015
28458
|
};
|
|
28016
28459
|
const _hoisted_5$d = { class: "lupa-stats-from" };
|
|
28017
28460
|
const _hoisted_6$7 = ["max", "min", "pattern", "aria-label"];
|
|
28018
28461
|
const _hoisted_7$5 = { key: 0 };
|
|
28019
|
-
const _hoisted_8$1 =
|
|
28020
|
-
const _hoisted_9$1 = {
|
|
28462
|
+
const _hoisted_8$1 = { key: 1 };
|
|
28463
|
+
const _hoisted_9$1 = /* @__PURE__ */ createBaseVNode("div", { class: "lupa-stats-separator" }, null, -1);
|
|
28464
|
+
const _hoisted_10 = {
|
|
28021
28465
|
key: 0,
|
|
28022
28466
|
class: "lupa-stats-range-label"
|
|
28023
28467
|
};
|
|
28024
|
-
const
|
|
28025
|
-
const
|
|
28026
|
-
const
|
|
28027
|
-
const
|
|
28468
|
+
const _hoisted_11 = { class: "lupa-stats-to" };
|
|
28469
|
+
const _hoisted_12 = ["max", "min", "pattern", "aria-label"];
|
|
28470
|
+
const _hoisted_13 = { key: 0 };
|
|
28471
|
+
const _hoisted_14 = { key: 1 };
|
|
28472
|
+
const _hoisted_15 = {
|
|
28028
28473
|
key: 2,
|
|
28029
28474
|
class: "lupa-stats-slider-wrapper"
|
|
28030
28475
|
};
|
|
@@ -28091,7 +28536,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
28091
28536
|
if (!value || value > facetMax.value) {
|
|
28092
28537
|
return;
|
|
28093
28538
|
}
|
|
28094
|
-
innerSliderRange.value = [
|
|
28539
|
+
innerSliderRange.value = [sliderRange.value[1], value];
|
|
28095
28540
|
handleInputChange();
|
|
28096
28541
|
}
|
|
28097
28542
|
});
|
|
@@ -28147,7 +28592,18 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
28147
28592
|
});
|
|
28148
28593
|
const statsSummary = computed(() => {
|
|
28149
28594
|
const [min, max] = sliderRange.value;
|
|
28150
|
-
|
|
28595
|
+
if (isPrice.value) {
|
|
28596
|
+
return formatPriceSummary(
|
|
28597
|
+
[min, max],
|
|
28598
|
+
currency.value,
|
|
28599
|
+
separator.value,
|
|
28600
|
+
currencyTemplate.value
|
|
28601
|
+
);
|
|
28602
|
+
}
|
|
28603
|
+
if (unit.value) {
|
|
28604
|
+
return `${min} ${unit.value} - ${max} ${unit.value}`;
|
|
28605
|
+
}
|
|
28606
|
+
return formatRange({ gte: min, lte: max });
|
|
28151
28607
|
});
|
|
28152
28608
|
const separator = computed(() => {
|
|
28153
28609
|
var _a, _b, _c;
|
|
@@ -28208,11 +28664,17 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
28208
28664
|
const handleDragging = (value) => {
|
|
28209
28665
|
innerSliderRange.value = value;
|
|
28210
28666
|
};
|
|
28667
|
+
const unit = computed(
|
|
28668
|
+
() => {
|
|
28669
|
+
var _a, _b, _c, _d, _e;
|
|
28670
|
+
return (_e = (_d = (_a = props.options.stats) == null ? void 0 : _a.units) == null ? void 0 : _d[(_c = (_b = props.facet) == null ? void 0 : _b.key) != null ? _c : ""]) != null ? _e : "";
|
|
28671
|
+
}
|
|
28672
|
+
);
|
|
28211
28673
|
return (_ctx, _cache) => {
|
|
28212
28674
|
return openBlock(), createElementBlock("div", _hoisted_1$P, [
|
|
28213
28675
|
!isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$B, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$s, [
|
|
28214
28676
|
createBaseVNode("div", null, [
|
|
28215
|
-
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
28677
|
+
rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$j, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
|
|
28216
28678
|
createBaseVNode("div", _hoisted_5$d, [
|
|
28217
28679
|
withDirectives(createBaseVNode("input", {
|
|
28218
28680
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
|
|
@@ -28230,13 +28692,14 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
28230
28692
|
{ lazy: true }
|
|
28231
28693
|
]
|
|
28232
28694
|
]),
|
|
28233
|
-
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true)
|
|
28695
|
+
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_7$5, toDisplayString(currency.value), 1)) : createCommentVNode("", true),
|
|
28696
|
+
unit.value ? (openBlock(), createElementBlock("span", _hoisted_8$1, toDisplayString(unit.value), 1)) : createCommentVNode("", true)
|
|
28234
28697
|
])
|
|
28235
28698
|
]),
|
|
28236
|
-
|
|
28699
|
+
_hoisted_9$1,
|
|
28237
28700
|
createBaseVNode("div", null, [
|
|
28238
|
-
rangeLabelTo.value ? (openBlock(), createElementBlock("div",
|
|
28239
|
-
createBaseVNode("div",
|
|
28701
|
+
rangeLabelTo.value ? (openBlock(), createElementBlock("div", _hoisted_10, toDisplayString(rangeLabelTo.value), 1)) : createCommentVNode("", true),
|
|
28702
|
+
createBaseVNode("div", _hoisted_11, [
|
|
28240
28703
|
withDirectives(createBaseVNode("input", {
|
|
28241
28704
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
|
|
28242
28705
|
type: "text",
|
|
@@ -28245,7 +28708,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
28245
28708
|
min: facetMin.value,
|
|
28246
28709
|
pattern: sliderInputFormat.value,
|
|
28247
28710
|
"aria-label": ariaLabelTo.value
|
|
28248
|
-
}, null, 8,
|
|
28711
|
+
}, null, 8, _hoisted_12), [
|
|
28249
28712
|
[
|
|
28250
28713
|
vModelText,
|
|
28251
28714
|
toValue.value,
|
|
@@ -28253,11 +28716,12 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
28253
28716
|
{ lazy: true }
|
|
28254
28717
|
]
|
|
28255
28718
|
]),
|
|
28256
|
-
isPrice.value ? (openBlock(), createElementBlock("span",
|
|
28719
|
+
isPrice.value ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(currency.value), 1)) : createCommentVNode("", true),
|
|
28720
|
+
unit.value ? (openBlock(), createElementBlock("span", _hoisted_14, toDisplayString(unit.value), 1)) : createCommentVNode("", true)
|
|
28257
28721
|
])
|
|
28258
28722
|
])
|
|
28259
28723
|
])),
|
|
28260
|
-
isSliderVisible.value ? (openBlock(), createElementBlock("div",
|
|
28724
|
+
isSliderVisible.value ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
28261
28725
|
createVNode(unref(m), {
|
|
28262
28726
|
class: "slider",
|
|
28263
28727
|
tooltips: false,
|
|
@@ -28282,7 +28746,7 @@ const _hoisted_3$r = {
|
|
|
28282
28746
|
key: 0,
|
|
28283
28747
|
class: "lupa-term-count"
|
|
28284
28748
|
};
|
|
28285
|
-
const _hoisted_4$
|
|
28749
|
+
const _hoisted_4$i = {
|
|
28286
28750
|
key: 0,
|
|
28287
28751
|
class: "lupa-facet-level"
|
|
28288
28752
|
};
|
|
@@ -28351,7 +28815,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
28351
28815
|
_ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_3$r, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
|
|
28352
28816
|
], 2)
|
|
28353
28817
|
]),
|
|
28354
|
-
showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
28818
|
+
showChildren.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, [
|
|
28355
28819
|
(openBlock(true), createElementBlock(Fragment, null, renderList(treeItem.value.children, (itemChild) => {
|
|
28356
28820
|
return openBlock(), createBlock(_component_HierarchyFacetLevel, {
|
|
28357
28821
|
key: itemChild.title,
|
|
@@ -28884,7 +29348,7 @@ const _hoisted_1$H = {
|
|
|
28884
29348
|
};
|
|
28885
29349
|
const _hoisted_2$w = ["onClick"];
|
|
28886
29350
|
const _hoisted_3$p = { class: "lupa-mobile-sidebar-content" };
|
|
28887
|
-
const _hoisted_4$
|
|
29351
|
+
const _hoisted_4$h = { class: "lupa-sidebar-top" };
|
|
28888
29352
|
const _hoisted_5$c = { class: "lupa-sidebar-title" };
|
|
28889
29353
|
const _hoisted_6$6 = {
|
|
28890
29354
|
key: 0,
|
|
@@ -28928,7 +29392,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
28928
29392
|
onClick: withModifiers(handleMobileToggle, ["stop"])
|
|
28929
29393
|
}, null, 8, _hoisted_2$w),
|
|
28930
29394
|
createBaseVNode("div", _hoisted_3$p, [
|
|
28931
|
-
createBaseVNode("div", _hoisted_4$
|
|
29395
|
+
createBaseVNode("div", _hoisted_4$h, [
|
|
28932
29396
|
createBaseVNode("div", _hoisted_5$c, [
|
|
28933
29397
|
createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
|
|
28934
29398
|
isFilterCountVisible.value ? (openBlock(), createElementBlock("span", _hoisted_6$6, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
|
|
@@ -28956,7 +29420,7 @@ const _hoisted_3$o = {
|
|
|
28956
29420
|
key: 1,
|
|
28957
29421
|
class: "lupa-search-results-breadcrumb-text"
|
|
28958
29422
|
};
|
|
28959
|
-
const _hoisted_4$
|
|
29423
|
+
const _hoisted_4$g = { key: 2 };
|
|
28960
29424
|
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
28961
29425
|
__name: "SearchResultsBreadcrumbs",
|
|
28962
29426
|
props: {
|
|
@@ -28998,7 +29462,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
28998
29462
|
return handleNavigation(e2, (_a2 = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a2 : "");
|
|
28999
29463
|
}
|
|
29000
29464
|
}, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$v)) : (openBlock(), createElementBlock("span", _hoisted_3$o, toDisplayString(getLabel(breadcrumb.label)), 1)),
|
|
29001
|
-
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
29465
|
+
index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$g, toDisplayString((_a = breadcrumb.separator) != null ? _a : "/"), 1)) : createCommentVNode("", true)
|
|
29002
29466
|
]);
|
|
29003
29467
|
}), 128))
|
|
29004
29468
|
]);
|
|
@@ -29160,7 +29624,7 @@ const _hoisted_2$u = {
|
|
|
29160
29624
|
class: "lupa-page-number-separator"
|
|
29161
29625
|
};
|
|
29162
29626
|
const _hoisted_3$n = ["onClick"];
|
|
29163
|
-
const _hoisted_4$
|
|
29627
|
+
const _hoisted_4$f = {
|
|
29164
29628
|
key: 0,
|
|
29165
29629
|
class: "lupa-page-number-separator"
|
|
29166
29630
|
};
|
|
@@ -29266,7 +29730,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
29266
29730
|
}, toDisplayString(page), 11, _hoisted_3$n);
|
|
29267
29731
|
}), 128)),
|
|
29268
29732
|
showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
29269
|
-
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
29733
|
+
showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$f, "...")) : createCommentVNode("", true),
|
|
29270
29734
|
createBaseVNode("div", {
|
|
29271
29735
|
class: "lupa-page-number lupa-page-number-last",
|
|
29272
29736
|
onClick: _cache[2] || (_cache[2] = () => {
|
|
@@ -29291,7 +29755,7 @@ const _hoisted_1$B = {
|
|
|
29291
29755
|
};
|
|
29292
29756
|
const _hoisted_2$t = { id: "lupa-select" };
|
|
29293
29757
|
const _hoisted_3$m = { class: "lupa-select-label" };
|
|
29294
|
-
const _hoisted_4$
|
|
29758
|
+
const _hoisted_4$e = ["aria-label"];
|
|
29295
29759
|
const _hoisted_5$b = ["value"];
|
|
29296
29760
|
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
29297
29761
|
__name: "SearchResultsPageSize",
|
|
@@ -29338,7 +29802,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
29338
29802
|
value: option
|
|
29339
29803
|
}, toDisplayString(prefixLabel.value) + toDisplayString(option), 9, _hoisted_5$b);
|
|
29340
29804
|
}), 128))
|
|
29341
|
-
], 40, _hoisted_4$
|
|
29805
|
+
], 40, _hoisted_4$e)
|
|
29342
29806
|
])
|
|
29343
29807
|
]);
|
|
29344
29808
|
};
|
|
@@ -29350,7 +29814,7 @@ const _hoisted_1$A = {
|
|
|
29350
29814
|
};
|
|
29351
29815
|
const _hoisted_2$s = { id: "lupa-select" };
|
|
29352
29816
|
const _hoisted_3$l = { class: "lupa-select-label" };
|
|
29353
|
-
const _hoisted_4$
|
|
29817
|
+
const _hoisted_4$d = ["aria-label"];
|
|
29354
29818
|
const _hoisted_5$a = ["value"];
|
|
29355
29819
|
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
29356
29820
|
__name: "SearchResultsSort",
|
|
@@ -29418,7 +29882,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
|
29418
29882
|
value: option.key
|
|
29419
29883
|
}, toDisplayString(option.label), 9, _hoisted_5$a);
|
|
29420
29884
|
}), 128))
|
|
29421
|
-
], 40, _hoisted_4$
|
|
29885
|
+
], 40, _hoisted_4$d), [
|
|
29422
29886
|
[vModelSelect, selectedKey.value]
|
|
29423
29887
|
])
|
|
29424
29888
|
])
|
|
@@ -29432,7 +29896,7 @@ const _hoisted_2$r = {
|
|
|
29432
29896
|
class: "lupa-toolbar-right-title"
|
|
29433
29897
|
};
|
|
29434
29898
|
const _hoisted_3$k = { key: 2 };
|
|
29435
|
-
const _hoisted_4$
|
|
29899
|
+
const _hoisted_4$c = { key: 4 };
|
|
29436
29900
|
const _hoisted_5$9 = { key: 6 };
|
|
29437
29901
|
const _hoisted_6$5 = { class: "lupa-toolbar-right" };
|
|
29438
29902
|
const _hoisted_7$3 = {
|
|
@@ -29560,7 +30024,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
29560
30024
|
label: searchSummaryLabel.value,
|
|
29561
30025
|
clearable: unref(hasAnyFilter) && showFilterClear.value,
|
|
29562
30026
|
onClear: handleClearAll
|
|
29563
|
-
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$
|
|
30027
|
+
}, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_4$c)),
|
|
29564
30028
|
displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$H, {
|
|
29565
30029
|
key: 5,
|
|
29566
30030
|
options: paginationOptions.value.pageSelect,
|
|
@@ -29613,7 +30077,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
29613
30077
|
const _hoisted_1$y = ["title", "innerHTML"];
|
|
29614
30078
|
const _hoisted_2$q = ["title"];
|
|
29615
30079
|
const _hoisted_3$j = ["href", "innerHTML"];
|
|
29616
|
-
const _hoisted_4$
|
|
30080
|
+
const _hoisted_4$b = ["title"];
|
|
29617
30081
|
const _hoisted_5$8 = {
|
|
29618
30082
|
key: 0,
|
|
29619
30083
|
class: "lupa-search-results-product-title-text"
|
|
@@ -29681,7 +30145,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
29681
30145
|
class: "lupa-search-results-product-title-text lupa-title-link",
|
|
29682
30146
|
onClick: handleNavigation
|
|
29683
30147
|
}, toDisplayString(title.value), 9, _hoisted_6$4)) : createCommentVNode("", true)
|
|
29684
|
-
], 12, _hoisted_4$
|
|
30148
|
+
], 12, _hoisted_4$b));
|
|
29685
30149
|
};
|
|
29686
30150
|
}
|
|
29687
30151
|
});
|
|
@@ -29724,7 +30188,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
29724
30188
|
const _hoisted_1$w = { id: "lupa-search-results-rating" };
|
|
29725
30189
|
const _hoisted_2$p = { class: "lupa-ratings" };
|
|
29726
30190
|
const _hoisted_3$i = { class: "lupa-ratings-base" };
|
|
29727
|
-
const _hoisted_4$
|
|
30191
|
+
const _hoisted_4$a = ["innerHTML"];
|
|
29728
30192
|
const _hoisted_5$7 = { class: "lupa-rating-wrapper" };
|
|
29729
30193
|
const _hoisted_6$3 = ["innerHTML"];
|
|
29730
30194
|
const _hoisted_7$2 = ["href"];
|
|
@@ -29774,7 +30238,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
29774
30238
|
key: index,
|
|
29775
30239
|
innerHTML: star,
|
|
29776
30240
|
class: "lupa-rating lupa-rating-not-highlighted"
|
|
29777
|
-
}, null, 8, _hoisted_4$
|
|
30241
|
+
}, null, 8, _hoisted_4$a);
|
|
29778
30242
|
}), 128))
|
|
29779
30243
|
]),
|
|
29780
30244
|
createBaseVNode("div", _hoisted_5$7, [
|
|
@@ -29861,7 +30325,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
29861
30325
|
const _hoisted_1$u = { class: "lupa-search-results-add-to-cart-wrapper" };
|
|
29862
30326
|
const _hoisted_2$o = { class: "lupa-search-results-product-addtocart" };
|
|
29863
30327
|
const _hoisted_3$h = ["disabled"];
|
|
29864
|
-
const _hoisted_4$
|
|
30328
|
+
const _hoisted_4$9 = ["href"];
|
|
29865
30329
|
const _hoisted_5$6 = ["id", "disabled", "onClick"];
|
|
29866
30330
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
29867
30331
|
__name: "SearchResultsProductAddToCart",
|
|
@@ -29880,6 +30344,8 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
29880
30344
|
return (_a = props.inStock) != null ? _a : true;
|
|
29881
30345
|
});
|
|
29882
30346
|
const searchResultStore = useSearchResultStore();
|
|
30347
|
+
const optionsStore = useOptionsStore();
|
|
30348
|
+
const { searchResultOptions } = storeToRefs(optionsStore);
|
|
29883
30349
|
const { addToCartAmount } = storeToRefs(searchResultStore);
|
|
29884
30350
|
const loading = ref(false);
|
|
29885
30351
|
const label = computed(() => {
|
|
@@ -29890,7 +30356,16 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
29890
30356
|
const id2 = (_a = props.item.id) != null ? _a : "";
|
|
29891
30357
|
return `lupa-add-to-cart-${id2}`;
|
|
29892
30358
|
});
|
|
29893
|
-
const
|
|
30359
|
+
const productCardIsClickable = computed(() => {
|
|
30360
|
+
return searchResultOptions.value.isLink;
|
|
30361
|
+
});
|
|
30362
|
+
const hasLink = computed(() => {
|
|
30363
|
+
return Boolean(props.link && props.options.link);
|
|
30364
|
+
});
|
|
30365
|
+
const handleClick = (e2) => __async2(this, null, function* () {
|
|
30366
|
+
if (productCardIsClickable.value && !hasLink.value) {
|
|
30367
|
+
e2.preventDefault();
|
|
30368
|
+
}
|
|
29894
30369
|
loading.value = true;
|
|
29895
30370
|
if (props.options.emitEvent) {
|
|
29896
30371
|
const event = new CustomEvent(props.options.emitEvent, { detail: { item: props.item } });
|
|
@@ -29902,9 +30377,6 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
29902
30377
|
emit2("productEvent", { type: "addToCart" });
|
|
29903
30378
|
loading.value = false;
|
|
29904
30379
|
});
|
|
29905
|
-
const hasLink = computed(() => {
|
|
29906
|
-
return Boolean(props.link && props.options.link);
|
|
29907
|
-
});
|
|
29908
30380
|
return (_ctx, _cache) => {
|
|
29909
30381
|
return openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
29910
30382
|
createBaseVNode("div", _hoisted_2$o, [
|
|
@@ -29914,7 +30386,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
29914
30386
|
"data-cy": "lupa-add-to-cart",
|
|
29915
30387
|
disabled: !inStockValue.value || loading.value
|
|
29916
30388
|
}, _ctx.dynamicAttributes, { onClick: handleClick }), [
|
|
29917
|
-
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$
|
|
30389
|
+
createBaseVNode("a", { href: _ctx.link }, toDisplayString(label.value), 9, _hoisted_4$9)
|
|
29918
30390
|
], 16, _hoisted_3$h)) : (openBlock(), createElementBlock("button", mergeProps({
|
|
29919
30391
|
key: 1,
|
|
29920
30392
|
id: id.value,
|
|
@@ -29932,7 +30404,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
29932
30404
|
const _hoisted_1$t = ["innerHTML"];
|
|
29933
30405
|
const _hoisted_2$n = { key: 0 };
|
|
29934
30406
|
const _hoisted_3$g = { key: 1 };
|
|
29935
|
-
const _hoisted_4$
|
|
30407
|
+
const _hoisted_4$8 = { class: "lupa-search-box-custom-label" };
|
|
29936
30408
|
const _hoisted_5$5 = { class: "lupa-search-box-custom-text" };
|
|
29937
30409
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
29938
30410
|
__name: "SearchResultsProductCustom",
|
|
@@ -29977,7 +30449,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
29977
30449
|
class: className.value
|
|
29978
30450
|
}, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
|
|
29979
30451
|
!label.value ? (openBlock(), createElementBlock("div", _hoisted_2$n, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$g, [
|
|
29980
|
-
createBaseVNode("div", _hoisted_4$
|
|
30452
|
+
createBaseVNode("div", _hoisted_4$8, toDisplayString(label.value), 1),
|
|
29981
30453
|
createBaseVNode("div", _hoisted_5$5, toDisplayString(text.value), 1)
|
|
29982
30454
|
]))
|
|
29983
30455
|
], 16));
|
|
@@ -30023,7 +30495,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
30023
30495
|
const _hoisted_1$r = { id: "lupa-search-results-rating" };
|
|
30024
30496
|
const _hoisted_2$m = ["innerHTML"];
|
|
30025
30497
|
const _hoisted_3$f = { class: "lupa-ratings" };
|
|
30026
|
-
const _hoisted_4$
|
|
30498
|
+
const _hoisted_4$7 = ["href"];
|
|
30027
30499
|
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
30028
30500
|
__name: "SearchResultsProductSingleStarRating",
|
|
30029
30501
|
props: {
|
|
@@ -30061,7 +30533,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
30061
30533
|
createBaseVNode("a", {
|
|
30062
30534
|
href: ratingLink.value,
|
|
30063
30535
|
class: "lupa-total-ratings"
|
|
30064
|
-
}, toDisplayString(totalRatings.value), 9, _hoisted_4$
|
|
30536
|
+
}, toDisplayString(totalRatings.value), 9, _hoisted_4$7)
|
|
30065
30537
|
]);
|
|
30066
30538
|
};
|
|
30067
30539
|
}
|
|
@@ -30162,13 +30634,12 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
|
|
|
30162
30634
|
};
|
|
30163
30635
|
}
|
|
30164
30636
|
}));
|
|
30165
|
-
const _hoisted_1$q = ["
|
|
30166
|
-
const _hoisted_2$l =
|
|
30167
|
-
const _hoisted_3$e = {
|
|
30637
|
+
const _hoisted_1$q = ["href"];
|
|
30638
|
+
const _hoisted_2$l = {
|
|
30168
30639
|
key: 0,
|
|
30169
30640
|
class: "lupa-out-of-stock"
|
|
30170
30641
|
};
|
|
30171
|
-
const
|
|
30642
|
+
const _hoisted_3$e = { class: "lupa-search-result-product-details-section" };
|
|
30172
30643
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
30173
30644
|
__name: "SearchResultsProductCard",
|
|
30174
30645
|
props: {
|
|
@@ -30197,6 +30668,9 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
30197
30668
|
const listLayoutClass = computed(() => {
|
|
30198
30669
|
return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
|
|
30199
30670
|
});
|
|
30671
|
+
const useLinkWrapper = computed(() => {
|
|
30672
|
+
return props.options.isLink;
|
|
30673
|
+
});
|
|
30200
30674
|
const badgesOptions = computed(() => {
|
|
30201
30675
|
return __spreadProps2(__spreadValues2({}, props.options.badges), { product: props.product });
|
|
30202
30676
|
});
|
|
@@ -30325,78 +30799,84 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
30325
30799
|
checkIfIsInStock();
|
|
30326
30800
|
}
|
|
30327
30801
|
return (_ctx, _cache) => {
|
|
30328
|
-
|
|
30329
|
-
|
|
30802
|
+
return openBlock(), createBlock(resolveDynamicComponent(useLinkWrapper.value ? "a" : "div"), mergeProps({
|
|
30803
|
+
href: useLinkWrapper.value ? link.value : null,
|
|
30330
30804
|
id: "lupa-search-result-product-card",
|
|
30331
30805
|
"data-cy": "lupa-search-result-product-card",
|
|
30332
30806
|
class: ["lupa-search-result-product-card", !isInStock.value ? "lupa-out-of-stock" : ""]
|
|
30333
30807
|
}, customDocumentHtmlAttributes.value, {
|
|
30334
30808
|
onClick: handleClick,
|
|
30335
30809
|
onMouseup: withModifiers(handleClick, ["middle", "exact"])
|
|
30336
|
-
}),
|
|
30337
|
-
|
|
30338
|
-
|
|
30339
|
-
|
|
30340
|
-
|
|
30341
|
-
|
|
30342
|
-
|
|
30343
|
-
href: link.value,
|
|
30344
|
-
onClick: handleNavigation
|
|
30345
|
-
}, [
|
|
30346
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
|
|
30347
|
-
return openBlock(), createBlock(_sfc_main$t, {
|
|
30348
|
-
class: "lupa-search-results-product-element",
|
|
30349
|
-
item: _ctx.product,
|
|
30350
|
-
element,
|
|
30351
|
-
key: element.key,
|
|
30352
|
-
labels: labels.value,
|
|
30353
|
-
inStock: isInStock.value,
|
|
30354
|
-
link: link.value,
|
|
30355
|
-
onProductEvent: handleProductEvent
|
|
30356
|
-
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30357
|
-
}), 128)),
|
|
30358
|
-
createVNode(_sfc_main$19, {
|
|
30359
|
-
options: badgesOptions.value,
|
|
30360
|
-
position: "image",
|
|
30361
|
-
class: "lupa-image-badges"
|
|
30362
|
-
}, null, 8, ["options"]),
|
|
30363
|
-
((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_3$e, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
|
|
30364
|
-
], 8, _hoisted_2$l),
|
|
30365
|
-
createBaseVNode("div", _hoisted_4$7, [
|
|
30366
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
30367
|
-
return openBlock(), createBlock(_sfc_main$t, {
|
|
30368
|
-
class: "lupa-search-results-product-element",
|
|
30369
|
-
item: _ctx.product,
|
|
30370
|
-
element,
|
|
30371
|
-
key: element.key,
|
|
30372
|
-
labels: labels.value,
|
|
30373
|
-
inStock: isInStock.value,
|
|
30374
|
-
link: link.value,
|
|
30375
|
-
onProductEvent: handleProductEvent
|
|
30376
|
-
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30377
|
-
}), 128))
|
|
30378
|
-
]),
|
|
30379
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(elementGroups.value, (group) => {
|
|
30380
|
-
return openBlock(), createElementBlock("div", {
|
|
30381
|
-
key: group,
|
|
30382
|
-
class: normalizeClass("lupa-element-group-" + group)
|
|
30810
|
+
}), {
|
|
30811
|
+
default: withCtx(() => {
|
|
30812
|
+
var _a;
|
|
30813
|
+
return [
|
|
30814
|
+
createVNode(_sfc_main$19, { options: badgesOptions.value }, null, 8, ["options"]),
|
|
30815
|
+
createBaseVNode("div", {
|
|
30816
|
+
class: normalizeClass(["lupa-search-result-product-contents", listLayoutClass.value])
|
|
30383
30817
|
}, [
|
|
30384
|
-
(
|
|
30385
|
-
|
|
30386
|
-
|
|
30387
|
-
|
|
30388
|
-
|
|
30389
|
-
|
|
30390
|
-
|
|
30391
|
-
|
|
30392
|
-
|
|
30393
|
-
|
|
30394
|
-
|
|
30818
|
+
createBaseVNode("a", {
|
|
30819
|
+
class: "lupa-search-result-product-image-section",
|
|
30820
|
+
href: link.value,
|
|
30821
|
+
onClick: handleNavigation
|
|
30822
|
+
}, [
|
|
30823
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(imageElements.value, (element) => {
|
|
30824
|
+
return openBlock(), createBlock(_sfc_main$t, {
|
|
30825
|
+
class: "lupa-search-results-product-element",
|
|
30826
|
+
item: _ctx.product,
|
|
30827
|
+
element,
|
|
30828
|
+
key: element.key,
|
|
30829
|
+
labels: labels.value,
|
|
30830
|
+
inStock: isInStock.value,
|
|
30831
|
+
link: link.value,
|
|
30832
|
+
onProductEvent: handleProductEvent
|
|
30833
|
+
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30834
|
+
}), 128)),
|
|
30835
|
+
createVNode(_sfc_main$19, {
|
|
30836
|
+
options: badgesOptions.value,
|
|
30837
|
+
position: "image",
|
|
30838
|
+
class: "lupa-image-badges"
|
|
30839
|
+
}, null, 8, ["options"]),
|
|
30840
|
+
((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_2$l, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
|
|
30841
|
+
], 8, _hoisted_1$q),
|
|
30842
|
+
createBaseVNode("div", _hoisted_3$e, [
|
|
30843
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
|
|
30844
|
+
return openBlock(), createBlock(_sfc_main$t, {
|
|
30845
|
+
class: "lupa-search-results-product-element",
|
|
30846
|
+
item: _ctx.product,
|
|
30847
|
+
element,
|
|
30848
|
+
key: element.key,
|
|
30849
|
+
labels: labels.value,
|
|
30850
|
+
inStock: isInStock.value,
|
|
30851
|
+
link: link.value,
|
|
30852
|
+
onProductEvent: handleProductEvent
|
|
30853
|
+
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30854
|
+
}), 128))
|
|
30855
|
+
]),
|
|
30856
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(elementGroups.value, (group) => {
|
|
30857
|
+
return openBlock(), createElementBlock("div", {
|
|
30858
|
+
key: group,
|
|
30859
|
+
class: normalizeClass("lupa-element-group-" + group)
|
|
30860
|
+
}, [
|
|
30861
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getGroupElements(group), (element) => {
|
|
30862
|
+
return openBlock(), createBlock(_sfc_main$t, {
|
|
30863
|
+
class: "lupa-search-results-product-element",
|
|
30864
|
+
item: _ctx.product,
|
|
30865
|
+
element,
|
|
30866
|
+
key: element.key,
|
|
30867
|
+
labels: labels.value,
|
|
30868
|
+
inStock: isInStock.value,
|
|
30869
|
+
link: link.value,
|
|
30870
|
+
onProductEvent: handleProductEvent
|
|
30871
|
+
}, null, 8, ["item", "element", "labels", "inStock", "link"]);
|
|
30872
|
+
}), 128))
|
|
30873
|
+
], 2);
|
|
30395
30874
|
}), 128))
|
|
30396
|
-
], 2)
|
|
30397
|
-
|
|
30398
|
-
|
|
30399
|
-
|
|
30875
|
+
], 2)
|
|
30876
|
+
];
|
|
30877
|
+
}),
|
|
30878
|
+
_: 1
|
|
30879
|
+
}, 16, ["href", "class", "onMouseup"]);
|
|
30400
30880
|
};
|
|
30401
30881
|
}
|
|
30402
30882
|
});
|
|
@@ -31329,6 +31809,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
31329
31809
|
"queryKey",
|
|
31330
31810
|
"idKey",
|
|
31331
31811
|
"titleKey",
|
|
31812
|
+
"isLink",
|
|
31332
31813
|
"routingBehavior",
|
|
31333
31814
|
"customDocumentHtmlAttributes"
|
|
31334
31815
|
]);
|
|
@@ -33143,21 +33624,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
33143
33624
|
};
|
|
33144
33625
|
}
|
|
33145
33626
|
});
|
|
33146
|
-
const Env = {
|
|
33147
|
-
production: "https://api.lupasearch.com/v1/",
|
|
33148
|
-
staging: "https://api.staging.lupasearch.com/v1/"
|
|
33149
|
-
};
|
|
33150
|
-
const DEFAULT_REQUEST_CONFIG = {
|
|
33151
|
-
method: "POST",
|
|
33152
|
-
headers: { "Content-Type": "application/json" }
|
|
33153
|
-
};
|
|
33154
|
-
const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
|
|
33155
|
-
const getApiUrl = (environment, customBaseUrl) => {
|
|
33156
|
-
if (customBaseUrl) {
|
|
33157
|
-
return customBaseUrl;
|
|
33158
|
-
}
|
|
33159
|
-
return Env[environment] || Env["production"];
|
|
33160
|
-
};
|
|
33161
33627
|
const suggestSearchChatPhrases = (options, request, chatSettings) => __async2(void 0, null, function* () {
|
|
33162
33628
|
var _a, _b, _c;
|
|
33163
33629
|
const { environment, customBaseUrl } = options;
|
|
@@ -33664,7 +34130,7 @@ const _hoisted_4 = {
|
|
|
33664
34130
|
key: 0,
|
|
33665
34131
|
class: "lupasearch-chat-content"
|
|
33666
34132
|
};
|
|
33667
|
-
const _sfc_main$
|
|
34133
|
+
const _sfc_main$1A = /* @__PURE__ */ defineComponent({
|
|
33668
34134
|
__name: "ChatContainer",
|
|
33669
34135
|
props: {
|
|
33670
34136
|
options: {}
|
|
@@ -40318,7 +40784,7 @@ const chat = (options, mountOptions) => {
|
|
|
40318
40784
|
const instance = createVue(
|
|
40319
40785
|
options.displayOptions.containerSelector,
|
|
40320
40786
|
mountOptions == null ? void 0 : mountOptions.mountingBehavior,
|
|
40321
|
-
_sfc_main$
|
|
40787
|
+
_sfc_main$1A,
|
|
40322
40788
|
{
|
|
40323
40789
|
options
|
|
40324
40790
|
}
|