vviinn-widgets 2.156.0 → 2.156.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{package-50c1474e.js → package-60ac24b4.js} +1 -1
- package/dist/cjs/vviinn-camera_12.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-carousel_9.cjs.entry.js +7 -11
- package/dist/cjs/vviinn-detected-object_7.cjs.entry.js +1 -1
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +4 -10
- package/dist/collection/components/vviinn-product-card/render-helpers.js +2 -0
- package/dist/esm/{package-fe01bd72.js → package-570cd5c7.js} +1 -1
- package/dist/esm/vviinn-camera_12.entry.js +1 -1
- package/dist/esm/vviinn-carousel_9.entry.js +7 -11
- package/dist/esm/vviinn-detected-object_7.entry.js +1 -1
- package/dist/vviinn-widgets/{p-d67159eb.entry.js → p-1bf8ddc9.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-ec2fd268.entry.js → p-a6c42777.entry.js} +1 -1
- package/{www/build/p-138c1eb3.js → dist/vviinn-widgets/p-a811abae.js} +1 -1
- package/dist/vviinn-widgets/p-a8f7667c.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-d67159eb.entry.js → p-1bf8ddc9.entry.js} +1 -1
- package/www/build/{p-ec2fd268.entry.js → p-a6c42777.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-138c1eb3.js → www/build/p-a811abae.js} +1 -1
- package/www/build/p-a8f7667c.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/dist/vviinn-widgets/p-50cec7a2.entry.js +0 -1
- package/www/build/p-50cec7a2.entry.js +0 -1
|
@@ -7,7 +7,7 @@ const search_store = require('./search.store-791ee66d.js');
|
|
|
7
7
|
const customizedSlots = require('./customized-slots-174c1053.js');
|
|
8
8
|
const v4 = require('./v4-1186e321.js');
|
|
9
9
|
const Rectangle = require('./Rectangle-c0460315.js');
|
|
10
|
-
const _package = require('./package-
|
|
10
|
+
const _package = require('./package-60ac24b4.js');
|
|
11
11
|
const index$1 = require('./index-4c7242d9.js');
|
|
12
12
|
const index$2 = require('./index-08c5c086.js');
|
|
13
13
|
const resources = require('./resources-79dac054.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1a40d6c9.js');
|
|
6
6
|
const search_store = require('./search.store-791ee66d.js');
|
|
7
|
-
const _package = require('./package-
|
|
7
|
+
const _package = require('./package-60ac24b4.js');
|
|
8
8
|
const v4 = require('./v4-1186e321.js');
|
|
9
9
|
const index$1 = require('./index-08c5c086.js');
|
|
10
10
|
const customizedSlots = require('./customized-slots-174c1053.js');
|
|
@@ -252,15 +252,13 @@ const VviinnCarousel = class {
|
|
|
252
252
|
updatingAllCardsWatcher() {
|
|
253
253
|
if (!this.updatingAllCards)
|
|
254
254
|
return;
|
|
255
|
-
const step = this.getColumnsNumber();
|
|
256
255
|
this.crossSellingRecommendations.forEach((item) => {
|
|
257
|
-
this.updateCard(item.productId,
|
|
256
|
+
this.updateCard(item.productId, this.columns, this.defaultAnimationInterval);
|
|
258
257
|
});
|
|
259
258
|
}
|
|
260
259
|
crossSellingClickListener({ detail }) {
|
|
261
|
-
const step = this.getColumnsNumber();
|
|
262
260
|
const { animationInterval, productData } = detail;
|
|
263
|
-
this.updateCard(productData.productId,
|
|
261
|
+
this.updateCard(productData.productId, this.columns, animationInterval);
|
|
264
262
|
}
|
|
265
263
|
getItemWidthFromDocument() {
|
|
266
264
|
return parseInt(getComputedStyle(document.body).getPropertyValue(CAROUSEL_IMAGE_WIDTH_CSS_VAR));
|
|
@@ -300,10 +298,6 @@ const VviinnCarousel = class {
|
|
|
300
298
|
handleResize() {
|
|
301
299
|
this.setWidth();
|
|
302
300
|
this.setItemWidth();
|
|
303
|
-
const newColumns = this.getColumnsNumber();
|
|
304
|
-
if (newColumns !== this.columns) {
|
|
305
|
-
this.columns = newColumns;
|
|
306
|
-
}
|
|
307
301
|
}
|
|
308
302
|
calculateMoveStep() {
|
|
309
303
|
const imageGroups = this.getContent().filter((el) => !el.matches("button"));
|
|
@@ -439,11 +433,11 @@ const VviinnCarousel = class {
|
|
|
439
433
|
}
|
|
440
434
|
renderGrid() {
|
|
441
435
|
const recommendations = this.renderRecommendationsElements();
|
|
442
|
-
const grouppedContent = search_store._Array.chunksOf(this.
|
|
436
|
+
const grouppedContent = search_store._Array.chunksOf(this.columns)(recommendations);
|
|
443
437
|
return this.renderRecommendationGroups(grouppedContent);
|
|
444
438
|
}
|
|
445
439
|
renderBullets() {
|
|
446
|
-
const numberOfBullets = Math.ceil(this.recommendations.length / this.
|
|
440
|
+
const numberOfBullets = Math.ceil(this.recommendations.length / this.columns);
|
|
447
441
|
const bulletsArray = Array.from(Array(numberOfBullets).keys());
|
|
448
442
|
return bulletsArray.map((index$1) => (index.h("div", { class: {
|
|
449
443
|
bullet: true,
|
|
@@ -1099,6 +1093,8 @@ const containsFit = (url) => {
|
|
|
1099
1093
|
return search_store._function.pipe(url.match(FIT_EXPR), search_store.Either.fromNullable(url), search_store.Either.map(() => url));
|
|
1100
1094
|
};
|
|
1101
1095
|
const processWidth = (url, size) => {
|
|
1096
|
+
if (!(url === null || url === void 0 ? void 0 : url.length))
|
|
1097
|
+
return "";
|
|
1102
1098
|
return search_store._function.pipe(containsFit(url), search_store.Either.map((url) => url.replace(FIT_EXPR, `fit/${size}/`)), search_store.Either.getOrElse(() => url));
|
|
1103
1099
|
};
|
|
1104
1100
|
const Linked = (props, child) => props.deeplink ? (index.h("a", { class: props.part, part: props.part, href: props.deeplink }, child)) : (child);
|
|
@@ -8,7 +8,7 @@ const Rectangle = require('./Rectangle-c0460315.js');
|
|
|
8
8
|
const index$1 = require('./index-08c5c086.js');
|
|
9
9
|
const WarningIcon = require('./WarningIcon-db443b71.js');
|
|
10
10
|
const customizedSlots = require('./customized-slots-174c1053.js');
|
|
11
|
-
const _package = require('./package-
|
|
11
|
+
const _package = require('./package-60ac24b4.js');
|
|
12
12
|
|
|
13
13
|
const SecondaryActionIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
14
14
|
index.h("path", { d: "M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z", fill: "currentColor" })));
|
|
@@ -120,15 +120,13 @@ export class VviinnCarousel {
|
|
|
120
120
|
updatingAllCardsWatcher() {
|
|
121
121
|
if (!this.updatingAllCards)
|
|
122
122
|
return;
|
|
123
|
-
const step = this.getColumnsNumber();
|
|
124
123
|
this.crossSellingRecommendations.forEach((item) => {
|
|
125
|
-
this.updateCard(item.productId,
|
|
124
|
+
this.updateCard(item.productId, this.columns, this.defaultAnimationInterval);
|
|
126
125
|
});
|
|
127
126
|
}
|
|
128
127
|
crossSellingClickListener({ detail }) {
|
|
129
|
-
const step = this.getColumnsNumber();
|
|
130
128
|
const { animationInterval, productData } = detail;
|
|
131
|
-
this.updateCard(productData.productId,
|
|
129
|
+
this.updateCard(productData.productId, this.columns, animationInterval);
|
|
132
130
|
}
|
|
133
131
|
getItemWidthFromDocument() {
|
|
134
132
|
return parseInt(getComputedStyle(document.body).getPropertyValue(CAROUSEL_IMAGE_WIDTH_CSS_VAR));
|
|
@@ -168,10 +166,6 @@ export class VviinnCarousel {
|
|
|
168
166
|
handleResize() {
|
|
169
167
|
this.setWidth();
|
|
170
168
|
this.setItemWidth();
|
|
171
|
-
const newColumns = this.getColumnsNumber();
|
|
172
|
-
if (newColumns !== this.columns) {
|
|
173
|
-
this.columns = newColumns;
|
|
174
|
-
}
|
|
175
169
|
}
|
|
176
170
|
calculateMoveStep() {
|
|
177
171
|
const imageGroups = this.getContent().filter((el) => !el.matches("button"));
|
|
@@ -307,11 +301,11 @@ export class VviinnCarousel {
|
|
|
307
301
|
}
|
|
308
302
|
renderGrid() {
|
|
309
303
|
const recommendations = this.renderRecommendationsElements();
|
|
310
|
-
const grouppedContent = chunksOf(this.
|
|
304
|
+
const grouppedContent = chunksOf(this.columns)(recommendations);
|
|
311
305
|
return this.renderRecommendationGroups(grouppedContent);
|
|
312
306
|
}
|
|
313
307
|
renderBullets() {
|
|
314
|
-
const numberOfBullets = Math.ceil(this.recommendations.length / this.
|
|
308
|
+
const numberOfBullets = Math.ceil(this.recommendations.length / this.columns);
|
|
315
309
|
const bulletsArray = Array.from(Array(numberOfBullets).keys());
|
|
316
310
|
return bulletsArray.map((index) => (h("div", { class: {
|
|
317
311
|
bullet: true,
|
|
@@ -8,6 +8,8 @@ const containsFit = (url) => {
|
|
|
8
8
|
return pipe(url.match(FIT_EXPR), E.fromNullable(url), E.map(() => url));
|
|
9
9
|
};
|
|
10
10
|
const processWidth = (url, size) => {
|
|
11
|
+
if (!(url === null || url === void 0 ? void 0 : url.length))
|
|
12
|
+
return "";
|
|
11
13
|
return pipe(containsFit(url), E.map((url) => url.replace(FIT_EXPR, `fit/${size}/`)), E.getOrElse(() => url));
|
|
12
14
|
};
|
|
13
15
|
export const Linked = (props, child) => props.deeplink ? (h("a", { class: props.part, part: props.part, href: props.deeplink }, child)) : (child);
|
|
@@ -3,7 +3,7 @@ import { k as toFile, _ as _function, l as makeUploadFileRequest, E as Either, n
|
|
|
3
3
|
import { s as slotChangeListener, p as productCardSlotNames, v as vprIconSlotName, S as SlotSkeleton } from './customized-slots-888922f8.js';
|
|
4
4
|
import { P as PlusIcon, v as v4, g as getCustomLabels } from './v4-d98d87d4.js';
|
|
5
5
|
import { f as fromImage } from './Rectangle-b7796e5e.js';
|
|
6
|
-
import { c as campaignTypeNames, v as version } from './package-
|
|
6
|
+
import { c as campaignTypeNames, v as version } from './package-570cd5c7.js';
|
|
7
7
|
import { b as createWidgetEvent, f as createFilterEvent, c as createAddToBasketEvent, a as createAddToWishlistEvent, d as createResultEventByType, e as createProductEventByType, g as createImageSearchEvent } from './index-3be92ce4.js';
|
|
8
8
|
import { i as instance, a as productCardParts, m as modalParts, f as filtersParts, b as extendedFiltersParts, s as searchBarParts, c as searchWidgetFilterParts, d as searchWidgetButtonParts } from './index-47fc6873.js';
|
|
9
9
|
import { r as resources } from './resources-f4f0473b.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-057b9128.js';
|
|
2
2
|
import { h as has, t as tuple, a as addIfNotEmpty, _ as _function, b as _Array, g as globalState, s as searchState, c as componentsState, O as Option, S as Semigroup, E as Either, p as pipe, d as chainW, m as makeRequest, f as fromEither, e as getApiPath, i as createInitPostRequest, A as Apply, u as updateGlobalState, j as trackEvent, T as TaskEither } from './search.store-e299eb16.js';
|
|
3
|
-
import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-
|
|
3
|
+
import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-570cd5c7.js';
|
|
4
4
|
import { g as getCustomLabels, P as PlusIcon, v as v4, a as getRecommendationsBody } from './v4-d98d87d4.js';
|
|
5
5
|
import { i as instance, e as energyLabelParts, p as priceRangeParts, a as productCardParts } from './index-47fc6873.js';
|
|
6
6
|
import { s as slotChangeListener, S as SlotSkeleton } from './customized-slots-888922f8.js';
|
|
@@ -248,15 +248,13 @@ const VviinnCarousel = class {
|
|
|
248
248
|
updatingAllCardsWatcher() {
|
|
249
249
|
if (!this.updatingAllCards)
|
|
250
250
|
return;
|
|
251
|
-
const step = this.getColumnsNumber();
|
|
252
251
|
this.crossSellingRecommendations.forEach((item) => {
|
|
253
|
-
this.updateCard(item.productId,
|
|
252
|
+
this.updateCard(item.productId, this.columns, this.defaultAnimationInterval);
|
|
254
253
|
});
|
|
255
254
|
}
|
|
256
255
|
crossSellingClickListener({ detail }) {
|
|
257
|
-
const step = this.getColumnsNumber();
|
|
258
256
|
const { animationInterval, productData } = detail;
|
|
259
|
-
this.updateCard(productData.productId,
|
|
257
|
+
this.updateCard(productData.productId, this.columns, animationInterval);
|
|
260
258
|
}
|
|
261
259
|
getItemWidthFromDocument() {
|
|
262
260
|
return parseInt(getComputedStyle(document.body).getPropertyValue(CAROUSEL_IMAGE_WIDTH_CSS_VAR));
|
|
@@ -296,10 +294,6 @@ const VviinnCarousel = class {
|
|
|
296
294
|
handleResize() {
|
|
297
295
|
this.setWidth();
|
|
298
296
|
this.setItemWidth();
|
|
299
|
-
const newColumns = this.getColumnsNumber();
|
|
300
|
-
if (newColumns !== this.columns) {
|
|
301
|
-
this.columns = newColumns;
|
|
302
|
-
}
|
|
303
297
|
}
|
|
304
298
|
calculateMoveStep() {
|
|
305
299
|
const imageGroups = this.getContent().filter((el) => !el.matches("button"));
|
|
@@ -435,11 +429,11 @@ const VviinnCarousel = class {
|
|
|
435
429
|
}
|
|
436
430
|
renderGrid() {
|
|
437
431
|
const recommendations = this.renderRecommendationsElements();
|
|
438
|
-
const grouppedContent = _Array.chunksOf(this.
|
|
432
|
+
const grouppedContent = _Array.chunksOf(this.columns)(recommendations);
|
|
439
433
|
return this.renderRecommendationGroups(grouppedContent);
|
|
440
434
|
}
|
|
441
435
|
renderBullets() {
|
|
442
|
-
const numberOfBullets = Math.ceil(this.recommendations.length / this.
|
|
436
|
+
const numberOfBullets = Math.ceil(this.recommendations.length / this.columns);
|
|
443
437
|
const bulletsArray = Array.from(Array(numberOfBullets).keys());
|
|
444
438
|
return bulletsArray.map((index) => (h("div", { class: {
|
|
445
439
|
bullet: true,
|
|
@@ -1095,6 +1089,8 @@ const containsFit = (url) => {
|
|
|
1095
1089
|
return _function.pipe(url.match(FIT_EXPR), Either.fromNullable(url), Either.map(() => url));
|
|
1096
1090
|
};
|
|
1097
1091
|
const processWidth = (url, size) => {
|
|
1092
|
+
if (!(url === null || url === void 0 ? void 0 : url.length))
|
|
1093
|
+
return "";
|
|
1098
1094
|
return _function.pipe(containsFit(url), Either.map((url) => url.replace(FIT_EXPR, `fit/${size}/`)), Either.getOrElse(() => url));
|
|
1099
1095
|
};
|
|
1100
1096
|
const Linked = (props, child) => props.deeplink ? (h("a", { class: props.part, part: props.part, href: props.deeplink }, child)) : (child);
|
|
@@ -4,7 +4,7 @@ import { s as scaleWithSized, c as center } from './Rectangle-b7796e5e.js';
|
|
|
4
4
|
import { i as instance, m as modalParts } from './index-47fc6873.js';
|
|
5
5
|
import { W as WarningIcon } from './WarningIcon-7896b328.js';
|
|
6
6
|
import { s as slotChangeListener } from './customized-slots-888922f8.js';
|
|
7
|
-
import { c as campaignTypeNames, v as version } from './package-
|
|
7
|
+
import { c as campaignTypeNames, v as version } from './package-570cd5c7.js';
|
|
8
8
|
|
|
9
9
|
const SecondaryActionIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
10
10
|
h("path", { d: "M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z", fill: "currentColor" })));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as t,r as i,c as e,H as o,g as r,F as s}from"./p-cb343b7a.js";import{k as n,_ as a,l as h,E as c,n as l,o as d,q as p,v as f,u,c as v,w as g,x as b,j as m,r as x,a as w,g as y,y as k,z as C,B as M,O as j,s as S,C as z}from"./p-9b711be1.js";import{s as I,p as T,v as O,S as W}from"./p-13210e05.js";import{P as B,v as E,g as P}from"./p-6eb0cbe1.js";import{f as V}from"./p-b499cabf.js";import{c as N,v as _}from"./p-138c1eb3.js";import{b as R,f as H,c as L,a as A,d as D,e as F,g as U}from"./p-e26b9ce2.js";import{i as X,a as $,m as Y,f as Z,b as q,s as Q,c as K,d as G}from"./p-1ad24947.js";import{r as J}from"./p-e062f08a.js";import{R as tt,f as it,g as et,S as ot,D as rt}from"./p-0f1b98bc.js";import{W as st}from"./p-d66d9ba6.js";const nt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),at=()=>t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8.00001 17.3333C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H8.00001Z",fill:"currentColor"})),ht=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 80 80",fill:"none"},t("circle",{cx:"40",cy:"40",r:"36",fill:"white"}),t("circle",{cx:"40",cy:"40",r:"39",fill:"white","fill-opacity":"0.16",stroke:"white","stroke-width":"2"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M48 29.3333H50.6667C53.6133 29.3333 56 31.72 56 34.6667V45.3333H53.3333V34.6667C53.3333 33.2 52.1333 32 50.6667 32H46.5733L45.7867 30.8133L43.9067 28H36.0933L34.2133 30.8133L33.4267 32H29.3333C27.8667 32 26.6667 33.2 26.6667 34.6667V48C26.6667 49.4667 27.8667 50.6667 29.3333 50.6667H36V53.3333H29.3333C26.3867 53.3333 24 50.9467 24 48V34.6667C24 31.72 26.3867 29.3333 29.3333 29.3333H32L34.6667 25.3333H45.3333L48 29.3333ZM40 34.6667C43.68 34.6667 46.6667 37.6533 46.6667 41.3333L46.6533 41.3467C46.6533 42.6933 46.24 43.96 45.5467 45.0133L51.6 51.0667L49.72 52.9467L43.6667 46.8933C42.6133 47.5867 41.36 48 40 48C36.32 48 33.3333 45.0133 33.3333 41.3333C33.3333 37.6533 36.32 34.6667 40 34.6667ZM36 41.3333C36 43.5333 37.8 45.3333 40 45.3333C42.2 45.3333 44 43.5333 44 41.3333C44 39.1333 42.2 37.3333 40 37.3333C37.8 37.3333 36 39.1333 36 41.3333Z",fill:"#161616"})),ct=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),lt=({className:i})=>t("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:i},t("path",{d:"M31 3H15C8.37258 3 3 8.37258 3 15V31",stroke:"white","stroke-width":"6","stroke-linecap":"square"})),dt=class{constructor(t){i(this,t),this.vviinnImageUploadStarted=e(this,"vviinnImageUploadStarted",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.vviinnCameraEnabled=e(this,"vviinnCameraEnabled",7),this.videoTrack=null,this.initializeZoom=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};"zoom"in i&&(this.zoomCapabilities=i.zoom,await this.videoTrack.applyConstraints({advanced:[{zoom:this.zoomCapabilities.min}]}))},this.onZoom=async t=>{var i;if(!this.videoTrack||!this.zoomCapabilities)return;const{max:e,min:o}=this.zoomCapabilities,r=null!==(i=this.videoTrack.getSettings().zoom)&&void 0!==i?i:o,s=Math.round((e-o)/5*10)/10;let n;n="in"===t?r+s:r-s,n="in"===t&&r<1?1:n,n<o&&(n=o),n>e&&(n=e),await this.videoTrack.applyConstraints({advanced:[{zoom:n}]})},this.exampleImageSource=void 0,this.width=0,this.height=0,this.basicEventData=void 0,this.srcObject=void 0,this.cameraButtonClicked=!1,this.useComponentsStore=!1,this.selected=!1,this.videoInitialized=!1,this.zoomCapabilities=null}componentWillLoad(){I(this,this.el)}componentDidLoad(){this.videoElement=this.el.shadowRoot.getElementById("camera-preview")}createPlaceholderImageCanvas(){const t=this.el.shadowRoot.getElementById("captured-image-placeholder"),i=this.videoElement,{videoWidth:e,videoHeight:o}=i,r=document.createElement("canvas");r.width=e,r.height=o,r.getContext("2d").drawImage(i,0,0,r.width,r.height);const s=r.toDataURL("image/jpeg");t.src=s}async selectImage(){if(!this.srcObject)return;let t;this.vviinnImageUploadStarted.emit(this.basicEventData);const i=this.el.shadowRoot.getElementById("photo-frame"),e=this.videoElement,o=i.getBoundingClientRect(),r=e.getBoundingClientRect(),{videoWidth:s,videoHeight:l}=e,d=document.createElement("canvas");this.selected=!0,this.videoElement.pause(),this.createPlaceholderImageCanvas();const p=s/r.width,f=l/r.height,u=Math.min(o.width*p,o.height*f);d.width=u,d.height=u;const v=(o.left-r.left+(o.width-u/p)/2)*p,g=(o.top-r.top+(o.height-u/f)/2)*f;d.getContext("2d").drawImage(e,v,g,u,u,0,0,d.width,d.height);const b=d.toDataURL("image/jpeg");t=await n(b),a.pipe(await h(this.useComponentsStore?"components":"widget")(t),c.match((()=>{this.vviinnNoResult.emit(this.basicEventData)}),(t=>this.vviinnImageUploadFinished.emit({searchId:t.requestId,isTriggeredByVpsWidget:!this.useComponentsStore})))),this.selected=!1,this.videoInitialized=!1,this.vviinnCameraEnabled.emit(!1)}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}handleSrcObjectChange(){this.srcObject?(this.videoElement.srcObject=this.srcObject,this.videoTrack=this.srcObject.getVideoTracks()[0],this.initializeZoom(),this.videoElement.onloadedmetadata=()=>{this.vviinnCameraEnabled.emit(!0),this.videoInitialized=!0}):this.videoInitialized=!1}render(){return t(o,{onKeyUp:t=>this.handleKeyPress(t),class:{"video-expanded":this.cameraButtonClicked}},t("video",{id:"camera-preview",class:{hidden:!this.videoInitialized||this.selected},autoplay:!0,playsinline:!0,muted:!0}),t("img",{src:this.exampleImageSource,width:this.width,height:this.height,tabindex:1,class:{hidden:this.videoInitialized||this.selected}}),t("img",{id:"captured-image-placeholder",class:{hidden:!this.selected}}),t("div",{class:{container:!0,hidden:!this.videoInitialized}},t("div",{class:"photo-frame-container"},t("div",{id:"photo-frame"},t(lt,{className:"photo-frame-corner top-left"}),t(lt,{className:"photo-frame-corner top-right"}),t(lt,{className:"photo-frame-corner bottom-left"}),t(lt,{className:"photo-frame-corner bottom-right"})),t("div",{class:{"zoom-buttons":!0,hidden:!this.zoomCapabilities}},t("button",{onClick:()=>this.onZoom("out")},t(at,null)),t("button",{onClick:()=>this.onZoom("in")},t(B,null)))),t("div",{class:"photo-button-container"},t("button",{class:"photo-button",onClick:()=>this.selectImage()},t(ht,null)))))}get el(){return r(this)}static get watchers(){return{srcObject:["handleSrcObjectChange"]}}};dt.style=":host{display:block;width:100%;height:100%;min-height:0;position:relative;overflow:hidden;flex-grow:1;transition:min-height 1s}:host(.video-expanded){min-height:100%;transition:min-height 0.8s}img{width:100%;height:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}#camera-preview{width:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:relative}#captured-image-placeholder{height:auto}.container{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;flex-direction:column;gap:12px;padding:68px 0 48px;justify-content:space-around;align-content:center;box-sizing:border-box}.photo-frame-container{width:100%;height:100%;display:flex;flex-direction:column;gap:12px}#photo-frame{position:relative;aspect-ratio:1/1;border-radius:16px;box-shadow:0 0 0 100vmax rgba(0, 0, 0, 0.32);width:100%;height:auto;max-width:80%;margin:0 auto}@media (max-width: 960px){.photo-frame-container{width:auto;height:auto}}@media (max-width: 380px){#photo-frame{max-width:70%}}.photo-frame-corner{position:absolute;--delta:-3px}.photo-frame-corner.top-left{top:var(--delta);left:var(--delta)}.photo-frame-corner.top-right{top:var(--delta);right:var(--delta);transform:rotate(90deg)}.photo-frame-corner.bottom-left{bottom:var(--delta);left:var(--delta);transform:rotate(-90deg)}.photo-frame-corner.bottom-right{bottom:var(--delta);right:var(--delta);transform:rotate(180deg)}.photo-button-container{display:flex;width:100%;align-items:center;justify-self:flex-end}.photo-button{cursor:pointer;border:none;position:relative;z-index:1;padding:0;color:#6f6f6f;background-color:transparent;-webkit-tap-highlight-color:transparent;line-height:0;margin:0 auto}.zoom-buttons{display:flex;position:relative;justify-content:center;gap:12px}.zoom-buttons button{color:white;display:flex;width:48px;height:48px;justify-content:center;align-items:center;border-radius:var(--border-radius-100, 8px);background-color:rgba(0, 0, 0, 0.48);border:none;cursor:pointer}.hidden{display:none}";var pt=l((function(t){
|
|
1
|
+
import{h as t,r as i,c as e,H as o,g as r,F as s}from"./p-cb343b7a.js";import{k as n,_ as a,l as h,E as c,n as l,o as d,q as p,v as f,u,c as v,w as g,x as b,j as m,r as x,a as w,g as y,y as k,z as C,B as M,O as j,s as S,C as z}from"./p-9b711be1.js";import{s as I,p as T,v as O,S as W}from"./p-13210e05.js";import{P as B,v as E,g as P}from"./p-6eb0cbe1.js";import{f as V}from"./p-b499cabf.js";import{c as N,v as _}from"./p-a811abae.js";import{b as R,f as H,c as L,a as A,d as D,e as F,g as U}from"./p-e26b9ce2.js";import{i as X,a as $,m as Y,f as Z,b as q,s as Q,c as K,d as G}from"./p-1ad24947.js";import{r as J}from"./p-e062f08a.js";import{R as tt,f as it,g as et,S as ot,D as rt}from"./p-0f1b98bc.js";import{W as st}from"./p-d66d9ba6.js";const nt=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),at=()=>t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8.00001 17.3333C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H8.00001Z",fill:"currentColor"})),ht=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 80 80",fill:"none"},t("circle",{cx:"40",cy:"40",r:"36",fill:"white"}),t("circle",{cx:"40",cy:"40",r:"39",fill:"white","fill-opacity":"0.16",stroke:"white","stroke-width":"2"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M48 29.3333H50.6667C53.6133 29.3333 56 31.72 56 34.6667V45.3333H53.3333V34.6667C53.3333 33.2 52.1333 32 50.6667 32H46.5733L45.7867 30.8133L43.9067 28H36.0933L34.2133 30.8133L33.4267 32H29.3333C27.8667 32 26.6667 33.2 26.6667 34.6667V48C26.6667 49.4667 27.8667 50.6667 29.3333 50.6667H36V53.3333H29.3333C26.3867 53.3333 24 50.9467 24 48V34.6667C24 31.72 26.3867 29.3333 29.3333 29.3333H32L34.6667 25.3333H45.3333L48 29.3333ZM40 34.6667C43.68 34.6667 46.6667 37.6533 46.6667 41.3333L46.6533 41.3467C46.6533 42.6933 46.24 43.96 45.5467 45.0133L51.6 51.0667L49.72 52.9467L43.6667 46.8933C42.6133 47.5867 41.36 48 40 48C36.32 48 33.3333 45.0133 33.3333 41.3333C33.3333 37.6533 36.32 34.6667 40 34.6667ZM36 41.3333C36 43.5333 37.8 45.3333 40 45.3333C42.2 45.3333 44 43.5333 44 41.3333C44 39.1333 42.2 37.3333 40 37.3333C37.8 37.3333 36 39.1333 36 41.3333Z",fill:"#161616"})),ct=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),lt=({className:i})=>t("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:i},t("path",{d:"M31 3H15C8.37258 3 3 8.37258 3 15V31",stroke:"white","stroke-width":"6","stroke-linecap":"square"})),dt=class{constructor(t){i(this,t),this.vviinnImageUploadStarted=e(this,"vviinnImageUploadStarted",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.vviinnCameraEnabled=e(this,"vviinnCameraEnabled",7),this.videoTrack=null,this.initializeZoom=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};"zoom"in i&&(this.zoomCapabilities=i.zoom,await this.videoTrack.applyConstraints({advanced:[{zoom:this.zoomCapabilities.min}]}))},this.onZoom=async t=>{var i;if(!this.videoTrack||!this.zoomCapabilities)return;const{max:e,min:o}=this.zoomCapabilities,r=null!==(i=this.videoTrack.getSettings().zoom)&&void 0!==i?i:o,s=Math.round((e-o)/5*10)/10;let n;n="in"===t?r+s:r-s,n="in"===t&&r<1?1:n,n<o&&(n=o),n>e&&(n=e),await this.videoTrack.applyConstraints({advanced:[{zoom:n}]})},this.exampleImageSource=void 0,this.width=0,this.height=0,this.basicEventData=void 0,this.srcObject=void 0,this.cameraButtonClicked=!1,this.useComponentsStore=!1,this.selected=!1,this.videoInitialized=!1,this.zoomCapabilities=null}componentWillLoad(){I(this,this.el)}componentDidLoad(){this.videoElement=this.el.shadowRoot.getElementById("camera-preview")}createPlaceholderImageCanvas(){const t=this.el.shadowRoot.getElementById("captured-image-placeholder"),i=this.videoElement,{videoWidth:e,videoHeight:o}=i,r=document.createElement("canvas");r.width=e,r.height=o,r.getContext("2d").drawImage(i,0,0,r.width,r.height);const s=r.toDataURL("image/jpeg");t.src=s}async selectImage(){if(!this.srcObject)return;let t;this.vviinnImageUploadStarted.emit(this.basicEventData);const i=this.el.shadowRoot.getElementById("photo-frame"),e=this.videoElement,o=i.getBoundingClientRect(),r=e.getBoundingClientRect(),{videoWidth:s,videoHeight:l}=e,d=document.createElement("canvas");this.selected=!0,this.videoElement.pause(),this.createPlaceholderImageCanvas();const p=s/r.width,f=l/r.height,u=Math.min(o.width*p,o.height*f);d.width=u,d.height=u;const v=(o.left-r.left+(o.width-u/p)/2)*p,g=(o.top-r.top+(o.height-u/f)/2)*f;d.getContext("2d").drawImage(e,v,g,u,u,0,0,d.width,d.height);const b=d.toDataURL("image/jpeg");t=await n(b),a.pipe(await h(this.useComponentsStore?"components":"widget")(t),c.match((()=>{this.vviinnNoResult.emit(this.basicEventData)}),(t=>this.vviinnImageUploadFinished.emit({searchId:t.requestId,isTriggeredByVpsWidget:!this.useComponentsStore})))),this.selected=!1,this.videoInitialized=!1,this.vviinnCameraEnabled.emit(!1)}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}handleSrcObjectChange(){this.srcObject?(this.videoElement.srcObject=this.srcObject,this.videoTrack=this.srcObject.getVideoTracks()[0],this.initializeZoom(),this.videoElement.onloadedmetadata=()=>{this.vviinnCameraEnabled.emit(!0),this.videoInitialized=!0}):this.videoInitialized=!1}render(){return t(o,{onKeyUp:t=>this.handleKeyPress(t),class:{"video-expanded":this.cameraButtonClicked}},t("video",{id:"camera-preview",class:{hidden:!this.videoInitialized||this.selected},autoplay:!0,playsinline:!0,muted:!0}),t("img",{src:this.exampleImageSource,width:this.width,height:this.height,tabindex:1,class:{hidden:this.videoInitialized||this.selected}}),t("img",{id:"captured-image-placeholder",class:{hidden:!this.selected}}),t("div",{class:{container:!0,hidden:!this.videoInitialized}},t("div",{class:"photo-frame-container"},t("div",{id:"photo-frame"},t(lt,{className:"photo-frame-corner top-left"}),t(lt,{className:"photo-frame-corner top-right"}),t(lt,{className:"photo-frame-corner bottom-left"}),t(lt,{className:"photo-frame-corner bottom-right"})),t("div",{class:{"zoom-buttons":!0,hidden:!this.zoomCapabilities}},t("button",{onClick:()=>this.onZoom("out")},t(at,null)),t("button",{onClick:()=>this.onZoom("in")},t(B,null)))),t("div",{class:"photo-button-container"},t("button",{class:"photo-button",onClick:()=>this.selectImage()},t(ht,null)))))}get el(){return r(this)}static get watchers(){return{srcObject:["handleSrcObjectChange"]}}};dt.style=":host{display:block;width:100%;height:100%;min-height:0;position:relative;overflow:hidden;flex-grow:1;transition:min-height 1s}:host(.video-expanded){min-height:100%;transition:min-height 0.8s}img{width:100%;height:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}#camera-preview{width:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:relative}#captured-image-placeholder{height:auto}.container{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;flex-direction:column;gap:12px;padding:68px 0 48px;justify-content:space-around;align-content:center;box-sizing:border-box}.photo-frame-container{width:100%;height:100%;display:flex;flex-direction:column;gap:12px}#photo-frame{position:relative;aspect-ratio:1/1;border-radius:16px;box-shadow:0 0 0 100vmax rgba(0, 0, 0, 0.32);width:100%;height:auto;max-width:80%;margin:0 auto}@media (max-width: 960px){.photo-frame-container{width:auto;height:auto}}@media (max-width: 380px){#photo-frame{max-width:70%}}.photo-frame-corner{position:absolute;--delta:-3px}.photo-frame-corner.top-left{top:var(--delta);left:var(--delta)}.photo-frame-corner.top-right{top:var(--delta);right:var(--delta);transform:rotate(90deg)}.photo-frame-corner.bottom-left{bottom:var(--delta);left:var(--delta);transform:rotate(-90deg)}.photo-frame-corner.bottom-right{bottom:var(--delta);right:var(--delta);transform:rotate(180deg)}.photo-button-container{display:flex;width:100%;align-items:center;justify-self:flex-end}.photo-button{cursor:pointer;border:none;position:relative;z-index:1;padding:0;color:#6f6f6f;background-color:transparent;-webkit-tap-highlight-color:transparent;line-height:0;margin:0 auto}.zoom-buttons{display:flex;position:relative;justify-content:center;gap:12px}.zoom-buttons button{color:white;display:flex;width:48px;height:48px;justify-content:center;align-items:center;border-radius:var(--border-radius-100, 8px);background-color:rgba(0, 0, 0, 0.48);border:none;cursor:pointer}.hidden{display:none}";var pt=l((function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* Cropper.js v1.6.2
|
|
4
4
|
* https://fengyuanchen.github.io/cropperjs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as o,c as e,H as i,g as r}from"./p-cb343b7a.js";import{_ as s,O as n,D as a,s as l,a as c,w as h}from"./p-9b711be1.js";import{s as d,c as p}from"./p-b499cabf.js";import{i as f,m as b}from"./p-1ad24947.js";import{W as g}from"./p-d66d9ba6.js";import{s as u}from"./p-13210e05.js";import{c as x,v}from"./p-138c1eb3.js";const m=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z",fill:"currentColor"})),w=({width:o=24,height:e=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:e,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{d:"M4 16V15H2V16C2 19.31 4.69 22 8 22H9V20H8C5.79 20 4 18.21 4 16Z"}),t("path",{d:"M4 8C4 5.79 5.79 4 8 4H9V2H8C4.69 2 2 4.69 2 8V9H4V8Z"}),t("path",{d:"M20 8C20 5.79 18.21 4 16 4H15V2H16C19.31 2 22 4.69 22 8V9H20V8Z"}),t("path",{d:"M20 16C20 18.21 18.21 20 16 20H15V22H16C19.31 22 22 19.31 22 16V15H20V16Z"}),t("path",{d:"M9 8H7C6.45 8 6 8.45 6 9C6 9.55 6.45 10 7 10H9V11C9 11.55 9.45 12 10 12C10.55 12 11 11.55 11 11V7C11 6.45 10.55 6 10 6C9.45 6 9 6.45 9 7V8Z"}),t("path",{d:"M15 16H17C17.55 16 18 15.55 18 15C18 14.45 17.55 14 17 14H15V13C15 12.45 14.55 12 14 12C13.45 12 13 12.45 13 13V17C13 17.55 13.45 18 14 18C14.55 18 15 17.55 15 17V16Z"}),t("path",{d:"M16 9C16 8.45 15.55 8 15 8H12V10H15C15.55 10 16 9.55 16 9Z"}),t("path",{d:"M6 15C6 15.55 6.45 16 7 16H12V14H7C6.45 14 6 14.45 6 15Z"})),C=({width:o=24,height:e=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:e,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 13C20 13.55 20.45 14 21 14C21.55 14 22 13.55 22 13V5C22 3.35 20.65 2 19 2H11C10.45 2 10 2.45 10 3C10 3.55 10.45 4 11 4H19C19.55 4 20 4.45 20 5V13ZM2 19C2 20.65 3.35 22 5 22H13C13.55 22 14 21.55 14 21C14 20.45 13.55 20 13 20H5C4.45 20 4 19.55 4 19V11C4 10.45 3.55 10 3 10C2.45 10 2 10.45 2 11V19ZM12 16C11.45 16 11 15.55 11 15V13H9C8.45 13 8 12.55 8 12C8 11.45 8.45 11 9 11H11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11H15C15.55 11 16 11.45 16 12C16 12.55 15.55 13 15 13H13V15C13 15.55 12.55 16 12 16Z"})),y=class{constructor(t){o(this,t),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.selectedDetectedObject=void 0,this.basicEventData=void 0,this.imageBounds=void 0,this.showInWidget=void 0,this.position=["0","0"]}getObjectPosition(){return s.pipe(n.fromNullable(this.imageBounds),n.map((t=>{const{left:o,top:e}=s.pipe(this.detectedObject,d(t),p);return[`${o}px`,`${e}px`]})),n.getOrElse((()=>["0","0"])))}selectDetectedObject(){const t=s.pipe(n.fromNullable(this.imageBounds),n.map((t=>d(t)(this.detectedObject))),n.toNullable);this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject,searchArea:t}))}isActive(){return!(!this.detectedObject||!this.selectedDetectedObject)&&a.equals(this.detectedObject,this.selectedDetectedObject)}render(){return t(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};y.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}:host{display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}:host::before,:host::after{content:"";cursor:pointer;position:absolute;height:var(--size);width:var(--size);left:calc(-1 * var(--size) / 2);top:calc(-1 * var(--size) / 2)}:host::before{--size:36px;border-radius:50%;z-index:0;background:rgba(0, 0, 0, 0.16);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:transform 0.07s ease-in-out}:host::after{--size:13px;border-radius:50%;z-index:1;background:white;box-shadow:0px 2px 2px 0px rgba(0, 0, 0, 0.15);transition:transform 0.07s ease-in-out}:host(.active)::before{transform:scale(0.88);background:rgba(0, 0, 0, 0.4)}:host(.active)::after{transform:scale(0.67)}@media (min-width: 768px){:host(:not(.active):hover)::before{transform:scale(1.08);background:rgba(0, 0, 0, 0.32)}}';const k=class{constructor(t){o(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(g,null),t("h4",{slot:"title"},f.t("emptyResultsBlock.title")),"image"===l.searchType&&t("button",{slot:"action",onClick:this.handler},f.t("emptyResultsBlock.button"))))}},z=class{constructor(t){o(this,t),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.active=!1,this.resetState=void 0,this.buttonElementId=void 0,this.widgetVersion=void 0,this.hideBackButton=!1,this.isFirstScreen=void 0,this.slider=!1}componentWillLoad(){u(this,this.el)}resetTopScroll(){const t=this.el.shadowRoot.querySelector(".body");null==t||t.scroll({top:0})}close(){this.active=!1,setTimeout((()=>{this.vviinnWidgetClose.emit(Object.assign({campaignTypeId:"VPS",campaignTypeName:x.VPS,widgetVersion:this.widgetVersion},c("widgetId",this.buttonElementId)))}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return t(i,{exportparts:b,class:{closed:!this.active,"first-screen":this.isFirstScreen},onAnimationEnd:t=>this.handleAnimationEnd(t)},t("div",{class:"head"},!this.hideBackButton&&t("button",{part:"secondary-action",onClick:()=>{this.resetState(),this.resetTopScroll()}},t(m,null)),t("div",{class:"title",part:"results-title"},(o=l.image)?t("img",{width:"28",height:"28",src:o.src,class:"title-image"}):null,t("slot",{name:"vviinn-image-search-modal-title"},f.t("imageSearchModalTitle"))),t("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 13.3892L6.91958 18.4696C6.72248 18.6667 6.49095 18.7653 6.225 18.7653C5.95905 18.7653 5.72753 18.6667 5.53043 18.4696C5.33333 18.2725 5.23478 18.041 5.23478 17.775C5.23478 17.5091 5.33333 17.2776 5.53043 17.0805L10.6109 12L5.53043 6.9196C5.33333 6.7225 5.23478 6.49098 5.23478 6.22503C5.23478 5.95908 5.33333 5.72755 5.53043 5.53045C5.72753 5.33335 5.95905 5.2348 6.225 5.2348C6.49095 5.2348 6.72248 5.33335 6.91958 5.53045L12 10.6109L17.0804 5.53045C17.2775 5.33335 17.5091 5.2348 17.775 5.2348C18.041 5.2348 18.2725 5.33335 18.4696 5.53045C18.6667 5.72755 18.7652 5.95908 18.7652 6.22503C18.7652 6.49098 18.6667 6.7225 18.4696 6.9196L13.3892 12L18.4696 17.0805C18.6667 17.2776 18.7652 17.5091 18.7652 17.775C18.7652 18.041 18.6667 18.2725 18.4696 18.4696C18.2725 18.6667 18.041 18.7653 17.775 18.7653C17.5091 18.7653 17.2775 18.6667 17.0804 18.4696L12 13.3892Z",fill:"currentColor"})))),t("div",{class:"body"},t("slot",null)));var o}get el(){return r(this)}};z.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}:host{background:white;border-radius:var(--modal-border-radius, var(--border-radius-300));box-sizing:border-box;display:grid;grid-template-rows:min-content auto;max-width:960px;overflow:auto;position:relative}.head{height:64px;font-family:var(--font-family, var(--font-family-base));position:absolute;width:100%;box-sizing:border-box;display:flex;align-items:center;z-index:1;padding:16px}.title{display:flex;align-items:center;transform:translateX(-6px);font-weight:var(--font-weight-600);font-size:18px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:6px;color:#8d8d8d}button:hover{color:#000}@media (max-width: 768px){:host{animation-name:fade-in;animation-duration:0.5s;animation-fill-mode:forwards;border-radius:24px 24px 0 0}:host(.closed){animation-name:fade-out;animation-fill-mode:none}.head{z-index:1}:host(:not(.first-screen)) .head{position:sticky;background:#ffffff}.body{overflow-y:auto}:host(:not(.first-screen)) .body{padding-bottom:160px}.title{color:#161616;display:flex;align-items:center;font-weight:500;font-size:16px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;color:#6f6f6f;padding:0}button:hover{color:#000}:host(.first-screen) button,:host(.first-screen) button:hover{color:white}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";const V=class{constructor(t){o(this,t)}render(){return t(i,null,t("slot",null))}};V.style=":host{animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";const H=class{constructor(t){o(this,t)}render(){return t(i,null)}};H.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid currentColor;border-radius:50%;border-top-color:transparent;display:flex;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";const j=class{constructor(t){o(this,t),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnProductLoad=e(this,"vviinnProductLoad",7),this.vviinnProductClick=e(this,"vviinnProductClick",7),this.vviinnProductView=e(this,"vviinnProductView",7),this.vviinnResultLoad=e(this,"vviinnResultLoad",7),this.vviinnResultView=e(this,"vviinnResultView",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnAddToBasket=e(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{var t;this.sidebar&&(null===(t=this.targetAppendSidebarTo)||void 0===t?void 0:t.contains(this.sidebar))&&this.targetAppendSidebarTo.removeChild(this.sidebar)},this.token=void 0,this.locale=void 0,this.currencySign=void 0,this.pricePrefix=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="set"===this.mode?"VCS":"VPR",this.color="",this.imageWidth=300,this.imageRatio=1,this.setItemsAmount=4,this.cssUrl=null,this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.addPriceContainer=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle=void 0,this.modalScrollbar=!1,this.position="bottom",this.addStyle=!0,this.favoriteShow=!1,this.appendSidebarToElement=void 0,this.appendSidebarTo=void 0,this.oneClickDiscoveryMode="standalone",this.apiPath=void 0,this.showInWidget=!1,this.targetAppendSidebarTo=void 0}connectedCallback(){this.iconSideSize="standalone"===this.oneClickDiscoveryMode?24:14;const{onChange:t}=h(this.showInWidget);this.disposeStoreListener=t("loading",(t=>{t&&this.sidebarCloseListener()}))}componentWillLoad(){this.appendSidebarToElement?this.targetAppendSidebarTo=this.appendSidebarToElement:this.appendSidebarTo&&(this.targetAppendSidebarTo=document.getElementById(this.appendSidebarTo))}appendSidebarToElementWatcher(){this.appendSidebarToElement&&(this.targetAppendSidebarTo=this.appendSidebarToElement)}render(){return t(i,{onClick:()=>{this.appendSidebarTo&&!this.targetAppendSidebarTo?setTimeout((()=>{this.handleClick()}),250):this.handleClick()},role:"button",tabindex:"0"},t("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},t("slot",null,t("VCS"===this.campaignType?C:w,{width:this.iconSideSize,height:this.iconSideSize}))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");if(t.token=this.token,t.locale=this.locale,t.currencySign=this.currencySign,t.pricePrefix=this.pricePrefix,t.apiPath=this.apiPath,t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.position=this.position,t.widgetScrollbar=this.modalScrollbar,t.campaigns=this.campaigns,t.campaignType=this.campaignType,t.color=this.color,t.imageWidth=this.imageWidth,t.buttonElementId=this.el.id,t.noResultText=this.noResultText,t.noResultShow=this.noResultShow,t.gridArrowsDynamic=this.gridArrowsDynamic,t.productDetailsNewTab=this.productDetailsNewTab,t.productDetailsRedirect=this.productDetailsRedirect,t.widgetVersion=v,t.showingInButton=!0,t.excluded=this.excluded,t.addToBasketShow=this.addToBasketShow,t.buttonChildren=this.el.children,t.showFilters=this.showFilters,t.cssUrl=this.cssUrl,t.imageRatio=this.imageRatio,t.setItemsAmount=this.setItemsAmount,t.setModeDiscounts=this.setModeDiscounts,t.updateButtonLocation=this.updateButtonLocation,t.addPriceContainer=this.addPriceContainer,t.favoriteShow=this.favoriteShow,t.showInModal="modal"===this.oneClickDiscoveryMode,this.targetAppendSidebarTo?(t.mode="grid",t.useCarousel="append-slider"===this.oneClickDiscoveryMode):(t.mode="right"===this.position?"grid":this.mode,t.useCarousel="bottom"===this.position),this.sidebar=t,document.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),this.targetAppendSidebarTo)return this.sidebar.showInCustomContainer=!0,this.targetAppendSidebarTo.innerHTML="",void this.targetAppendSidebarTo.append(this.sidebar);document.body.append(this.sidebar)}disconnectedCallback(){var t;this.sidebar&&document.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener),null===(t=this.disposeStoreListener)||void 0===t||t.call(this)}get el(){return r(this)}static get watchers(){return{appendSidebarToElement:["appendSidebarToElementWatcher"]}}};j.style=":host{display:block}";const L=class{constructor(t){o(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(g,null),t("h4",{slot:"title"},f.t("wrongAspectRatioBlock.title")),t("button",{slot:"action",onClick:this.handler},f.t("wrongAspectRatioBlock.button"))))}};export{y as vviinn_detected_object,k as vviinn_empty_results,z as vviinn_modal,V as vviinn_overlay,H as vviinn_preloader,j as vviinn_vpr_button,L as vviinn_wrong_aspect_ratio}
|
|
1
|
+
import{h as t,r as o,c as e,H as i,g as r}from"./p-cb343b7a.js";import{_ as s,O as n,D as a,s as l,a as c,w as h}from"./p-9b711be1.js";import{s as d,c as p}from"./p-b499cabf.js";import{i as f,m as b}from"./p-1ad24947.js";import{W as g}from"./p-d66d9ba6.js";import{s as u}from"./p-13210e05.js";import{c as x,v}from"./p-a811abae.js";const m=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z",fill:"currentColor"})),w=({width:o=24,height:e=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:e,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{d:"M4 16V15H2V16C2 19.31 4.69 22 8 22H9V20H8C5.79 20 4 18.21 4 16Z"}),t("path",{d:"M4 8C4 5.79 5.79 4 8 4H9V2H8C4.69 2 2 4.69 2 8V9H4V8Z"}),t("path",{d:"M20 8C20 5.79 18.21 4 16 4H15V2H16C19.31 2 22 4.69 22 8V9H20V8Z"}),t("path",{d:"M20 16C20 18.21 18.21 20 16 20H15V22H16C19.31 22 22 19.31 22 16V15H20V16Z"}),t("path",{d:"M9 8H7C6.45 8 6 8.45 6 9C6 9.55 6.45 10 7 10H9V11C9 11.55 9.45 12 10 12C10.55 12 11 11.55 11 11V7C11 6.45 10.55 6 10 6C9.45 6 9 6.45 9 7V8Z"}),t("path",{d:"M15 16H17C17.55 16 18 15.55 18 15C18 14.45 17.55 14 17 14H15V13C15 12.45 14.55 12 14 12C13.45 12 13 12.45 13 13V17C13 17.55 13.45 18 14 18C14.55 18 15 17.55 15 17V16Z"}),t("path",{d:"M16 9C16 8.45 15.55 8 15 8H12V10H15C15.55 10 16 9.55 16 9Z"}),t("path",{d:"M6 15C6 15.55 6.45 16 7 16H12V14H7C6.45 14 6 14.45 6 15Z"})),C=({width:o=24,height:e=24})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:o,height:e,viewBox:"0 0 24 24",fill:"currentColor"},t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 13C20 13.55 20.45 14 21 14C21.55 14 22 13.55 22 13V5C22 3.35 20.65 2 19 2H11C10.45 2 10 2.45 10 3C10 3.55 10.45 4 11 4H19C19.55 4 20 4.45 20 5V13ZM2 19C2 20.65 3.35 22 5 22H13C13.55 22 14 21.55 14 21C14 20.45 13.55 20 13 20H5C4.45 20 4 19.55 4 19V11C4 10.45 3.55 10 3 10C2.45 10 2 10.45 2 11V19ZM12 16C11.45 16 11 15.55 11 15V13H9C8.45 13 8 12.55 8 12C8 11.45 8.45 11 9 11H11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11H15C15.55 11 16 11.45 16 12C16 12.55 15.55 13 15 13H13V15C13 15.55 12.55 16 12 16Z"})),y=class{constructor(t){o(this,t),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.selectedDetectedObject=void 0,this.basicEventData=void 0,this.imageBounds=void 0,this.showInWidget=void 0,this.position=["0","0"]}getObjectPosition(){return s.pipe(n.fromNullable(this.imageBounds),n.map((t=>{const{left:o,top:e}=s.pipe(this.detectedObject,d(t),p);return[`${o}px`,`${e}px`]})),n.getOrElse((()=>["0","0"])))}selectDetectedObject(){const t=s.pipe(n.fromNullable(this.imageBounds),n.map((t=>d(t)(this.detectedObject))),n.toNullable);this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject,searchArea:t}))}isActive(){return!(!this.detectedObject||!this.selectedDetectedObject)&&a.equals(this.detectedObject,this.selectedDetectedObject)}render(){return t(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};y.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}:host{display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}:host::before,:host::after{content:"";cursor:pointer;position:absolute;height:var(--size);width:var(--size);left:calc(-1 * var(--size) / 2);top:calc(-1 * var(--size) / 2)}:host::before{--size:36px;border-radius:50%;z-index:0;background:rgba(0, 0, 0, 0.16);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:transform 0.07s ease-in-out}:host::after{--size:13px;border-radius:50%;z-index:1;background:white;box-shadow:0px 2px 2px 0px rgba(0, 0, 0, 0.15);transition:transform 0.07s ease-in-out}:host(.active)::before{transform:scale(0.88);background:rgba(0, 0, 0, 0.4)}:host(.active)::after{transform:scale(0.67)}@media (min-width: 768px){:host(:not(.active):hover)::before{transform:scale(1.08);background:rgba(0, 0, 0, 0.32)}}';const k=class{constructor(t){o(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(g,null),t("h4",{slot:"title"},f.t("emptyResultsBlock.title")),"image"===l.searchType&&t("button",{slot:"action",onClick:this.handler},f.t("emptyResultsBlock.button"))))}},z=class{constructor(t){o(this,t),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.active=!1,this.resetState=void 0,this.buttonElementId=void 0,this.widgetVersion=void 0,this.hideBackButton=!1,this.isFirstScreen=void 0,this.slider=!1}componentWillLoad(){u(this,this.el)}resetTopScroll(){const t=this.el.shadowRoot.querySelector(".body");null==t||t.scroll({top:0})}close(){this.active=!1,setTimeout((()=>{this.vviinnWidgetClose.emit(Object.assign({campaignTypeId:"VPS",campaignTypeName:x.VPS,widgetVersion:this.widgetVersion},c("widgetId",this.buttonElementId)))}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return t(i,{exportparts:b,class:{closed:!this.active,"first-screen":this.isFirstScreen},onAnimationEnd:t=>this.handleAnimationEnd(t)},t("div",{class:"head"},!this.hideBackButton&&t("button",{part:"secondary-action",onClick:()=>{this.resetState(),this.resetTopScroll()}},t(m,null)),t("div",{class:"title",part:"results-title"},(o=l.image)?t("img",{width:"28",height:"28",src:o.src,class:"title-image"}):null,t("slot",{name:"vviinn-image-search-modal-title"},f.t("imageSearchModalTitle"))),t("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 13.3892L6.91958 18.4696C6.72248 18.6667 6.49095 18.7653 6.225 18.7653C5.95905 18.7653 5.72753 18.6667 5.53043 18.4696C5.33333 18.2725 5.23478 18.041 5.23478 17.775C5.23478 17.5091 5.33333 17.2776 5.53043 17.0805L10.6109 12L5.53043 6.9196C5.33333 6.7225 5.23478 6.49098 5.23478 6.22503C5.23478 5.95908 5.33333 5.72755 5.53043 5.53045C5.72753 5.33335 5.95905 5.2348 6.225 5.2348C6.49095 5.2348 6.72248 5.33335 6.91958 5.53045L12 10.6109L17.0804 5.53045C17.2775 5.33335 17.5091 5.2348 17.775 5.2348C18.041 5.2348 18.2725 5.33335 18.4696 5.53045C18.6667 5.72755 18.7652 5.95908 18.7652 6.22503C18.7652 6.49098 18.6667 6.7225 18.4696 6.9196L13.3892 12L18.4696 17.0805C18.6667 17.2776 18.7652 17.5091 18.7652 17.775C18.7652 18.041 18.6667 18.2725 18.4696 18.4696C18.2725 18.6667 18.041 18.7653 17.775 18.7653C17.5091 18.7653 17.2775 18.6667 17.0804 18.4696L12 13.3892Z",fill:"currentColor"})))),t("div",{class:"body"},t("slot",null)));var o}get el(){return r(this)}};z.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#525252;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;}:host{background:white;border-radius:var(--modal-border-radius, var(--border-radius-300));box-sizing:border-box;display:grid;grid-template-rows:min-content auto;max-width:960px;overflow:auto;position:relative}.head{height:64px;font-family:var(--font-family, var(--font-family-base));position:absolute;width:100%;box-sizing:border-box;display:flex;align-items:center;z-index:1;padding:16px}.title{display:flex;align-items:center;transform:translateX(-6px);font-weight:var(--font-weight-600);font-size:18px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:6px;color:#8d8d8d}button:hover{color:#000}@media (max-width: 768px){:host{animation-name:fade-in;animation-duration:0.5s;animation-fill-mode:forwards;border-radius:24px 24px 0 0}:host(.closed){animation-name:fade-out;animation-fill-mode:none}.head{z-index:1}:host(:not(.first-screen)) .head{position:sticky;background:#ffffff}.body{overflow-y:auto}:host(:not(.first-screen)) .body{padding-bottom:160px}.title{color:#161616;display:flex;align-items:center;font-weight:500;font-size:16px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;color:#6f6f6f;padding:0}button:hover{color:#000}:host(.first-screen) button,:host(.first-screen) button:hover{color:white}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";const V=class{constructor(t){o(this,t)}render(){return t(i,null,t("slot",null))}};V.style=":host{animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";const H=class{constructor(t){o(this,t)}render(){return t(i,null)}};H.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid currentColor;border-radius:50%;border-top-color:transparent;display:flex;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";const j=class{constructor(t){o(this,t),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnProductLoad=e(this,"vviinnProductLoad",7),this.vviinnProductClick=e(this,"vviinnProductClick",7),this.vviinnProductView=e(this,"vviinnProductView",7),this.vviinnResultLoad=e(this,"vviinnResultLoad",7),this.vviinnResultView=e(this,"vviinnResultView",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnAddToBasket=e(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{var t;this.sidebar&&(null===(t=this.targetAppendSidebarTo)||void 0===t?void 0:t.contains(this.sidebar))&&this.targetAppendSidebarTo.removeChild(this.sidebar)},this.token=void 0,this.locale=void 0,this.currencySign=void 0,this.pricePrefix=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="set"===this.mode?"VCS":"VPR",this.color="",this.imageWidth=300,this.imageRatio=1,this.setItemsAmount=4,this.cssUrl=null,this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.addPriceContainer=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle=void 0,this.modalScrollbar=!1,this.position="bottom",this.addStyle=!0,this.favoriteShow=!1,this.appendSidebarToElement=void 0,this.appendSidebarTo=void 0,this.oneClickDiscoveryMode="standalone",this.apiPath=void 0,this.showInWidget=!1,this.targetAppendSidebarTo=void 0}connectedCallback(){this.iconSideSize="standalone"===this.oneClickDiscoveryMode?24:14;const{onChange:t}=h(this.showInWidget);this.disposeStoreListener=t("loading",(t=>{t&&this.sidebarCloseListener()}))}componentWillLoad(){this.appendSidebarToElement?this.targetAppendSidebarTo=this.appendSidebarToElement:this.appendSidebarTo&&(this.targetAppendSidebarTo=document.getElementById(this.appendSidebarTo))}appendSidebarToElementWatcher(){this.appendSidebarToElement&&(this.targetAppendSidebarTo=this.appendSidebarToElement)}render(){return t(i,{onClick:()=>{this.appendSidebarTo&&!this.targetAppendSidebarTo?setTimeout((()=>{this.handleClick()}),250):this.handleClick()},role:"button",tabindex:"0"},t("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},t("slot",null,t("VCS"===this.campaignType?C:w,{width:this.iconSideSize,height:this.iconSideSize}))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");if(t.token=this.token,t.locale=this.locale,t.currencySign=this.currencySign,t.pricePrefix=this.pricePrefix,t.apiPath=this.apiPath,t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.position=this.position,t.widgetScrollbar=this.modalScrollbar,t.campaigns=this.campaigns,t.campaignType=this.campaignType,t.color=this.color,t.imageWidth=this.imageWidth,t.buttonElementId=this.el.id,t.noResultText=this.noResultText,t.noResultShow=this.noResultShow,t.gridArrowsDynamic=this.gridArrowsDynamic,t.productDetailsNewTab=this.productDetailsNewTab,t.productDetailsRedirect=this.productDetailsRedirect,t.widgetVersion=v,t.showingInButton=!0,t.excluded=this.excluded,t.addToBasketShow=this.addToBasketShow,t.buttonChildren=this.el.children,t.showFilters=this.showFilters,t.cssUrl=this.cssUrl,t.imageRatio=this.imageRatio,t.setItemsAmount=this.setItemsAmount,t.setModeDiscounts=this.setModeDiscounts,t.updateButtonLocation=this.updateButtonLocation,t.addPriceContainer=this.addPriceContainer,t.favoriteShow=this.favoriteShow,t.showInModal="modal"===this.oneClickDiscoveryMode,this.targetAppendSidebarTo?(t.mode="grid",t.useCarousel="append-slider"===this.oneClickDiscoveryMode):(t.mode="right"===this.position?"grid":this.mode,t.useCarousel="bottom"===this.position),this.sidebar=t,document.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),this.targetAppendSidebarTo)return this.sidebar.showInCustomContainer=!0,this.targetAppendSidebarTo.innerHTML="",void this.targetAppendSidebarTo.append(this.sidebar);document.body.append(this.sidebar)}disconnectedCallback(){var t;this.sidebar&&document.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener),null===(t=this.disposeStoreListener)||void 0===t||t.call(this)}get el(){return r(this)}static get watchers(){return{appendSidebarToElement:["appendSidebarToElementWatcher"]}}};j.style=":host{display:block}";const L=class{constructor(t){o(this,t),this.handler=void 0}render(){return t(i,null,t("vviinn-error",null,t(g,null),t("h4",{slot:"title"},f.t("wrongAspectRatioBlock.title")),t("button",{slot:"action",onClick:this.handler},f.t("wrongAspectRatioBlock.button"))))}};export{y as vviinn_detected_object,k as vviinn_empty_results,z as vviinn_modal,V as vviinn_overlay,H as vviinn_preloader,j as vviinn_vpr_button,L as vviinn_wrong_aspect_ratio}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={VPR:"Similar Products",VPS:"Visual Search",VCS:"Cross-Selling",TPS:"Text Product Search"};function a(t,a){return r=>(t=>"VPR"===t._tag)(r)?t():a()}function r(t){return"VPR"===t?{_tag:"VPR"}:{_tag:"VCS"}}const s="2.156.
|
|
1
|
+
const t={VPR:"Similar Products",VPS:"Visual Search",VCS:"Cross-Selling",TPS:"Text Product Search"};function a(t,a){return r=>(t=>"VPR"===t._tag)(r)?t():a()}function r(t){return"VPR"===t?{_tag:"VPR"}:{_tag:"VCS"}}const s="2.156.2";export{a,t as c,r as f,s as v}
|