vviinn-widgets 2.74.2 → 2.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/cjs/{index-d3fb3be1.js → index-85c223b1.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{package-8b9fd099.js → package-46b840db.js} +1 -1
  4. package/dist/cjs/search-filters_18.cjs.entry.js +19 -19
  5. package/dist/cjs/{search.store-155814d5.js → search.store-a688362f.js} +13 -4
  6. package/dist/cjs/vviinn-carousel_8.cjs.entry.js +7 -7
  7. package/dist/cjs/vviinn-preloader.cjs.entry.js +1 -1
  8. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
  9. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  10. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +4 -4
  11. package/dist/cjs/vviinn-widgets.cjs.js +1 -1
  12. package/dist/collection/components/vviinn-filters/stories/vviinn-extended-filters.stories.js +4 -7
  13. package/dist/collection/components/vviinn-filters/stories/vviinn-filters.stories.js +4 -7
  14. package/dist/collection/components/vviinn-filters/vviinn-extended-filters.js +17 -20
  15. package/dist/collection/components/vviinn-filters/vviinn-filters.css +1 -0
  16. package/dist/collection/components/vviinn-filters/vviinn-filters.js +17 -20
  17. package/dist/collection/components/vviinn-results/stories/ResultsTemplate.js +24 -0
  18. package/dist/collection/components/vviinn-results/stories/generalArgs.js +13 -0
  19. package/dist/collection/components/vviinn-results/stories/vviinn-results.stories.js +25 -0
  20. package/dist/collection/components/vviinn-results/vviinn-results.js +79 -73
  21. package/dist/collection/components/vviinn-text-search/stories/vviinn-text-search.stories.js +40 -0
  22. package/dist/collection/components/vviinn-text-search/vviinn-text-search.js +34 -31
  23. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +1 -1
  24. package/dist/collection/store/search.store.js +8 -4
  25. package/dist/collection/utils/string/encodeToBase64UTF8.js +5 -0
  26. package/dist/collection/utils/string/index.js +1 -0
  27. package/dist/esm/{index-d7915af0.js → index-80d9da2f.js} +1 -1
  28. package/dist/esm/loader.js +1 -1
  29. package/dist/esm/{package-25f24f03.js → package-a9dace8c.js} +1 -1
  30. package/dist/esm/search-filters_18.entry.js +19 -19
  31. package/dist/esm/{search.store-1a984942.js → search.store-9acff206.js} +13 -4
  32. package/dist/esm/vviinn-carousel_8.entry.js +7 -7
  33. package/dist/esm/vviinn-preloader.entry.js +1 -1
  34. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  35. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  36. package/dist/esm/vviinn-vps-widget.entry.js +4 -4
  37. package/dist/esm/vviinn-widgets.js +1 -1
  38. package/dist/types/components/vviinn-filters/stories/vviinn-extended-filters.stories.d.ts +1 -6
  39. package/dist/types/components/vviinn-filters/stories/vviinn-filters.stories.d.ts +1 -6
  40. package/dist/types/components/vviinn-filters/vviinn-extended-filters.d.ts +2 -2
  41. package/dist/types/components/vviinn-filters/vviinn-filters.d.ts +2 -2
  42. package/dist/types/components/vviinn-results/stories/ResultsTemplate.d.ts +1 -0
  43. package/dist/types/components/vviinn-results/stories/generalArgs.d.ts +13 -0
  44. package/dist/types/components/vviinn-results/stories/vviinn-results.stories.d.ts +7 -0
  45. package/dist/types/components/vviinn-results/vviinn-results.d.ts +12 -11
  46. package/dist/types/components/vviinn-text-search/stories/vviinn-text-search.stories.d.ts +7 -0
  47. package/dist/types/components/vviinn-text-search/vviinn-text-search.d.ts +6 -9
  48. package/dist/types/components.d.ts +28 -29
  49. package/dist/types/utils/string/encodeToBase64UTF8.d.ts +1 -0
  50. package/dist/types/utils/string/index.d.ts +1 -0
  51. package/dist/vviinn-widgets/{p-bb33a69a.entry.js → p-17d6fab0.entry.js} +1 -1
  52. package/dist/vviinn-widgets/{p-bba565ea.entry.js → p-400dac78.entry.js} +1 -1
  53. package/dist/vviinn-widgets/{p-95ce6cd2.entry.js → p-7bd909df.entry.js} +1 -1
  54. package/dist/vviinn-widgets/p-a08bc9bb.js +1 -0
  55. package/dist/vviinn-widgets/{p-c8aa8a84.entry.js → p-c724c8bd.entry.js} +1 -1
  56. package/{www/build/p-cd05d443.js → dist/vviinn-widgets/p-ddf609ee.js} +1 -1
  57. package/dist/vviinn-widgets/{p-34cec6de.js → p-dee78ef6.js} +1 -1
  58. package/dist/vviinn-widgets/{p-a9a19b3a.entry.js → p-f05a5179.entry.js} +2 -2
  59. package/dist/vviinn-widgets/{p-2a2115ff.entry.js → p-f45afcaa.entry.js} +1 -1
  60. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  61. package/package.json +1 -1
  62. package/www/build/{p-bb33a69a.entry.js → p-17d6fab0.entry.js} +1 -1
  63. package/www/build/{p-bba565ea.entry.js → p-400dac78.entry.js} +1 -1
  64. package/www/build/{p-95ce6cd2.entry.js → p-7bd909df.entry.js} +1 -1
  65. package/www/build/p-a08bc9bb.js +1 -0
  66. package/www/build/{p-c8aa8a84.entry.js → p-c724c8bd.entry.js} +1 -1
  67. package/{dist/vviinn-widgets/p-cd05d443.js → www/build/p-ddf609ee.js} +1 -1
  68. package/www/build/{p-34cec6de.js → p-dee78ef6.js} +1 -1
  69. package/www/build/{p-a9a19b3a.entry.js → p-f05a5179.entry.js} +2 -2
  70. package/www/build/{p-2a2115ff.entry.js → p-f45afcaa.entry.js} +1 -1
  71. package/www/build/vviinn-widgets.esm.js +1 -1
  72. package/dist/vviinn-widgets/p-6ea24620.js +0 -1
  73. package/www/build/p-6ea24620.js +0 -1
@@ -2,11 +2,6 @@ declare const _default: {
2
2
  title: string;
3
3
  component: string;
4
4
  decorators: ((story: any) => string)[];
5
- parameters: {
6
- controls: {
7
- expanded: boolean;
8
- };
9
- };
10
5
  argTypes: {
11
6
  filters: {
12
7
  control: boolean;
@@ -14,4 +9,4 @@ declare const _default: {
14
9
  };
15
10
  };
16
11
  export default _default;
17
- export declare const Default: any;
12
+ export declare const Extended: any;
@@ -2,11 +2,6 @@ declare const _default: {
2
2
  title: string;
3
3
  component: string;
4
4
  decorators: ((story: any) => string)[];
5
- parameters: {
6
- controls: {
7
- expanded: boolean;
8
- };
9
- };
10
5
  argTypes: {
11
6
  filters: {
12
7
  control: boolean;
@@ -14,4 +9,4 @@ declare const _default: {
14
9
  };
15
10
  };
16
11
  export default _default;
17
- export declare const Default: any;
12
+ export declare const Main: any;
@@ -22,10 +22,10 @@ export declare class VviinnExtendedFilters {
22
22
  selectedMoreOptions: string[];
23
23
  /** The filter's state changes */
24
24
  vviinnFiltersChanged: EventEmitter<ChangedFiltersEventData>;
25
+ /** The filters received */
26
+ vviinnFilters: EventEmitter<DynamicFiltersEventData>;
25
27
  /** @internal */
26
28
  globalSlotsChanged: EventEmitter<any>;
27
- /** @internal */
28
- vviinnFilters: EventEmitter<DynamicFiltersEventData>;
29
29
  private replaceSlotsContent;
30
30
  componentDidRender(): void;
31
31
  componentWillLoad(): Promise<void>;
@@ -14,10 +14,10 @@ export declare class VviinnFilters {
14
14
  requestFilters: RequestDynamicFilters;
15
15
  /** The filter's state changes */
16
16
  vviinnFiltersChanged: EventEmitter<ChangedFiltersEventData>;
17
+ /** The filters received */
18
+ vviinnFilters: EventEmitter<DynamicFiltersEventData>;
17
19
  /** @internal */
18
20
  globalSlotsChanged: EventEmitter<any>;
19
- /** @internal */
20
- vviinnFilters: EventEmitter<DynamicFiltersEventData>;
21
21
  private handleMainFilterSelection;
22
22
  private emitRequestFiltersMore;
23
23
  timer: NodeJS.Timeout;
@@ -0,0 +1 @@
1
+ export declare const ResultsTemplate: (args: any) => string;
@@ -0,0 +1,13 @@
1
+ export declare const generalArgs: {
2
+ token: string;
3
+ apiPath: string;
4
+ resultsCount: number;
5
+ imageResolutionWidth: number;
6
+ currencySign: string;
7
+ locale: string;
8
+ productDetailsRedirect: boolean;
9
+ productDetailsNewTab: boolean;
10
+ showInWidget: boolean;
11
+ uiSessionId: string;
12
+ searchId: string;
13
+ };
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: string;
4
+ };
5
+ export default _default;
6
+ export declare const StaticFilters: any;
7
+ export declare const TextSearch: any;
@@ -30,19 +30,24 @@ export declare class VviinnResults {
30
30
  vviinnResultLoad: EventEmitter<BasicEventData>;
31
31
  /** The search result appears in the viewport */
32
32
  vviinnResultView: EventEmitter<BasicEventData>;
33
+ /** The filter's state changes */
34
+ /** @internal */
35
+ vviinnFiltersChanged: EventEmitter<ChangedFiltersEventData>;
33
36
  /** The 'searchId' is received for performing a Visual Search */
37
+ /** @internal */
34
38
  vviinnSearchIdReceived: EventEmitter<SearchIdEventData>;
35
39
  /** The 'query' is received for performing a Text Search */
40
+ /** @internal */
36
41
  vviinnTextSearchStarted: EventEmitter<TextSearchEventData>;
37
42
  /** Dynamic filters are received from the API. */
38
- vviinnFilters: EventEmitter<DynamicFiltersEventData>;
39
43
  /** @internal */
40
- /** The filter's state changes */
41
- vviinnFiltersChanged: EventEmitter<ChangedFiltersEventData>;
44
+ vviinnFilters: EventEmitter<DynamicFiltersEventData>;
42
45
  /** Vviinn customer’s token (required) */
43
46
  token: string;
44
47
  /** Search ID for results request */
45
48
  searchId?: string;
49
+ /** uiSessionId from vps-widget */
50
+ uiSessionId?: string;
46
51
  /** Resolution width of an image in the product card */
47
52
  imageResolutionWidth?: number;
48
53
  /** The currency sign is displayed after the price */
@@ -56,17 +61,15 @@ export declare class VviinnResults {
56
61
  /** Query for performing text search */
57
62
  textSearchQuery?: string;
58
63
  /** Column for performing Product Listing Page request */
59
- filterColumn: string;
64
+ filterColumn?: string;
60
65
  /** Value for performing Product Listing Page request */
61
- filterValue: string;
66
+ filterValue?: string;
62
67
  /** Number of results displayed for text search and product listing page (less or equal to the value, set in the campaign) */
63
68
  resultsCount?: number;
64
69
  /** True when we use vviinn-results inside the widget */
70
+ showInWidget?: boolean;
65
71
  /** @internal */
66
- showingInWidget?: boolean;
67
- /** uiSessionId from vps-widget */
68
- /** @internal */
69
- uiSessionId?: string;
72
+ apiPath?: string;
70
73
  /** Element Id, passed from vps-button */
71
74
  /** @internal */
72
75
  buttonElementId?: string;
@@ -74,8 +77,6 @@ export declare class VviinnResults {
74
77
  /** @internal */
75
78
  widgetElementId?: string;
76
79
  /** @internal */
77
- apiPath?: string;
78
- /** @internal */
79
80
  showAspectRatioError?: boolean;
80
81
  /** @internal */
81
82
  trackingDeactivated?: boolean;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: string;
4
+ decorators: ((story: any) => string)[];
5
+ };
6
+ export default _default;
7
+ export declare const TextSearch: any;
@@ -8,28 +8,25 @@ import { TextSearchMode } from "../../widget/types";
8
8
  */
9
9
  export declare class VviinnTextSearch {
10
10
  el: HTMLElement;
11
- /** A text search was initiated (used by the vviinn-results component) */
11
+ /** A text search was initiated (used by vviinn-results component) */
12
12
  vviinnTextSearchStarted: EventEmitter<TextSearchEventData>;
13
+ /** An image search ID was received (used by vviinn-results component) */
14
+ vviinnSearchIdReceived: EventEmitter<SearchIdEventData>;
15
+ /** A text search response was received (used internally by vviinn-vps-widget) */
13
16
  /** @internal */
14
- /** A text search API response was received (used internally by vviinn-vps-widget) */
15
17
  vviinnTextSearchFinished: EventEmitter<TextSearchEventData>;
16
- /** @internal */
17
- vviinnSearchIdReceived: EventEmitter<SearchIdEventData>;
18
18
  /** Vviinn customer’s token (required) */
19
19
  token: string;
20
20
  /** The locale for currency formatting and text localization */
21
21
  locale: Locale;
22
22
  /** Default text search or text search with an image upload button */
23
23
  mode: TextSearchMode;
24
- /** @internal */
25
- /** API path passed from widget */
26
- apiPath?: string;
27
- /** @internal */
28
24
  /** True, when used inside the widget */
29
25
  showInWidget?: boolean;
30
- /** @internal */
31
26
  /** Query for the text search passed from widget */
32
27
  searchQuery?: string;
28
+ /** @internal */
29
+ apiPath?: string;
33
30
  componentWillLoad(): Promise<void>;
34
31
  imageUploadFinished({ detail }: SearchIdEvent): void;
35
32
  handleInputChange(event: Event): void;
@@ -237,11 +237,11 @@ export namespace Components {
237
237
  /**
238
238
  * Column for performing Product Listing Page request
239
239
  */
240
- "filterColumn": string;
240
+ "filterColumn"?: string;
241
241
  /**
242
242
  * Value for performing Product Listing Page request
243
243
  */
244
- "filterValue": string;
244
+ "filterValue"?: string;
245
245
  /**
246
246
  * Resolution width of an image in the product card
247
247
  */
@@ -268,7 +268,10 @@ export namespace Components {
268
268
  */
269
269
  "searchId"?: string;
270
270
  "showAspectRatioError"?: boolean;
271
- "showingInWidget"?: boolean;
271
+ /**
272
+ * True when we use vviinn-results inside the widget
273
+ */
274
+ "showInWidget"?: boolean;
272
275
  /**
273
276
  * Query for performing text search
274
277
  */
@@ -278,6 +281,9 @@ export namespace Components {
278
281
  */
279
282
  "token": string;
280
283
  "trackingDeactivated"?: boolean;
284
+ /**
285
+ * uiSessionId from vps-widget
286
+ */
281
287
  "uiSessionId"?: string;
282
288
  "widgetElementId"?: string;
283
289
  }
@@ -298,9 +304,6 @@ export namespace Components {
298
304
  interface VviinnTeaser {
299
305
  }
300
306
  interface VviinnTextSearch {
301
- /**
302
- * API path passed from widget
303
- */
304
307
  "apiPath"?: string;
305
308
  /**
306
309
  * The locale for currency formatting and text localization
@@ -1029,6 +1032,10 @@ declare namespace LocalJSX {
1029
1032
  * The locale for currency formatting and text localization
1030
1033
  */
1031
1034
  "locale"?: Locale;
1035
+ /**
1036
+ * The filters received
1037
+ */
1038
+ "onVviinnFilters"?: (event: VviinnExtendedFiltersCustomEvent<DynamicFiltersEventData>) => void;
1032
1039
  /**
1033
1040
  * The filter's state changes
1034
1041
  */
@@ -1036,6 +1043,10 @@ declare namespace LocalJSX {
1036
1043
  }
1037
1044
  interface VviinnFilters {
1038
1045
  "filters"?: DynamicFilters;
1046
+ /**
1047
+ * The filters received
1048
+ */
1049
+ "onVviinnFilters"?: (event: VviinnFiltersCustomEvent<DynamicFiltersEventData>) => void;
1039
1050
  /**
1040
1051
  * The filter's state changes
1041
1052
  */
@@ -1190,14 +1201,6 @@ declare namespace LocalJSX {
1190
1201
  * The locale for currency formatting and text localization
1191
1202
  */
1192
1203
  "locale"?: Locale1;
1193
- /**
1194
- * Dynamic filters are received from the API.
1195
- */
1196
- "onVviinnFilters"?: (event: VviinnResultsCustomEvent<DynamicFiltersEventData>) => void;
1197
- /**
1198
- * The filter's state changes
1199
- */
1200
- "onVviinnFiltersChanged"?: (event: VviinnResultsCustomEvent<ChangedFiltersEventData>) => void;
1201
1204
  /**
1202
1205
  * Click on the product’s link
1203
1206
  */
@@ -1218,14 +1221,6 @@ declare namespace LocalJSX {
1218
1221
  * The search result appears in the viewport
1219
1222
  */
1220
1223
  "onVviinnResultView"?: (event: VviinnResultsCustomEvent<BasicEventData1>) => void;
1221
- /**
1222
- * The 'searchId' is received for performing a Visual Search
1223
- */
1224
- "onVviinnSearchIdReceived"?: (event: VviinnResultsCustomEvent<SearchIdEventData>) => void;
1225
- /**
1226
- * The 'query' is received for performing a Text Search
1227
- */
1228
- "onVviinnTextSearchStarted"?: (event: VviinnResultsCustomEvent<TextSearchEventData>) => void;
1229
1224
  /**
1230
1225
  * Toggle for opening product link in new tab or not
1231
1226
  */
@@ -1242,6 +1237,10 @@ declare namespace LocalJSX {
1242
1237
  * Search ID for results request
1243
1238
  */
1244
1239
  "searchId"?: string;
1240
+ /**
1241
+ * True when we use vviinn-results inside the widget
1242
+ */
1243
+ "showInWidget"?: boolean;
1245
1244
  /**
1246
1245
  * Query for performing text search
1247
1246
  */
@@ -1250,6 +1249,10 @@ declare namespace LocalJSX {
1250
1249
  * Vviinn customer’s token (required)
1251
1250
  */
1252
1251
  "token"?: string;
1252
+ /**
1253
+ * uiSessionId from vps-widget
1254
+ */
1255
+ "uiSessionId"?: string;
1253
1256
  }
1254
1257
  interface VviinnServerError {
1255
1258
  "handler"?: VoidFunction;
@@ -1268,10 +1271,6 @@ declare namespace LocalJSX {
1268
1271
  interface VviinnTeaser {
1269
1272
  }
1270
1273
  interface VviinnTextSearch {
1271
- /**
1272
- * API path passed from widget
1273
- */
1274
- "apiPath"?: string;
1275
1274
  /**
1276
1275
  * The locale for currency formatting and text localization
1277
1276
  */
@@ -1281,11 +1280,11 @@ declare namespace LocalJSX {
1281
1280
  */
1282
1281
  "mode"?: TextSearchMode;
1283
1282
  /**
1284
- * A text search API response was received (used internally by vviinn-vps-widget)
1283
+ * An image search ID was received (used by vviinn-results component)
1285
1284
  */
1286
- "onVviinnTextSearchFinished"?: (event: VviinnTextSearchCustomEvent<TextSearchEventData>) => void;
1285
+ "onVviinnSearchIdReceived"?: (event: VviinnTextSearchCustomEvent<SearchIdEventData>) => void;
1287
1286
  /**
1288
- * A text search was initiated (used by the vviinn-results component)
1287
+ * A text search was initiated (used by vviinn-results component)
1289
1288
  */
1290
1289
  "onVviinnTextSearchStarted"?: (event: VviinnTextSearchCustomEvent<TextSearchEventData>) => void;
1291
1290
  /**
@@ -0,0 +1 @@
1
+ export declare const encodeToBase64UTF8: (str: string) => string;
@@ -0,0 +1 @@
1
+ export { encodeToBase64UTF8 } from "./encodeToBase64UTF8";
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,H as h,g as n}from"./p-1c863deb.js";import{v as o}from"./p-6ea24620.js";import{V as e}from"./p-256fddfd.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnResultLoad=t(this,"vviinnResultLoad",7),this.vviinnResultView=t(this,"vviinnResultView",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnAddToBasket=t(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.imageWidth=300,this.imageRatio=1,this.cssUrl=null,this.currencySign="€",this.pricePrefix="",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle="set"===this.mode?"":"Visually similar products",this.modalScrollbar=!1,this.position="bottom",this.sourceImage=null,this.addStyle=!0,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.pricePrefix=this.pricePrefix,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailsNewTab=this.productDetailsNewTab,i.productDetailsRedirect=this.productDetailsRedirect,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,i.showFilters=this.showFilters,i.cssUrl=this.cssUrl,i.imageRatio=this.imageRatio,i.setModeDiscounts=this.setModeDiscounts,i.updateButtonLocation=this.updateButtonLocation,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
1
+ import{r as i,c as t,h as s,H as h,g as n}from"./p-1c863deb.js";import{v as o}from"./p-a08bc9bb.js";import{V as e}from"./p-256fddfd.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnResultLoad=t(this,"vviinnResultLoad",7),this.vviinnResultView=t(this,"vviinnResultView",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnAddToBasket=t(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.imageWidth=300,this.imageRatio=1,this.cssUrl=null,this.currencySign="€",this.pricePrefix="",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle="set"===this.mode?"":"Visually similar products",this.modalScrollbar=!1,this.position="bottom",this.sourceImage=null,this.addStyle=!0,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.pricePrefix=this.pricePrefix,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailsNewTab=this.productDetailsNewTab,i.productDetailsRedirect=this.productDetailsRedirect,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,i.showFilters=this.showFilters,i.cssUrl=this.cssUrl,i.imageRatio=this.imageRatio,i.setModeDiscounts=this.setModeDiscounts,i.updateButtonLocation=this.updateButtonLocation,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
@@ -1 +1 @@
1
- import{r,h as e,H as o}from"./p-1c863deb.js";import{s as t}from"./p-34cec6de.js";const a=class{constructor(e){r(this,e)}isActive(){return t.loading||t.objectDetectionInProgress}render(){return e(o,{class:{active:this.isActive()}})}};a.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:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";export{a as vviinn_preloader}
1
+ import{r,h as e,H as o}from"./p-1c863deb.js";import{s as t}from"./p-dee78ef6.js";const a=class{constructor(e){r(this,e)}isActive(){return t.loading||t.objectDetectionInProgress}render(){return e(o,{class:{active:this.isActive()}})}};a.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:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";export{a as vviinn_preloader}
@@ -1 +1 @@
1
- import{r as t,c as i,h as s,H as h,g as e}from"./p-1c863deb.js";import{v as n}from"./p-6ea24620.js";import{C as o}from"./p-171fa6da.js";import{c as a,S as d}from"./p-55c453ab.js";import{D as l}from"./p-cc013cd2.js";const r=class{constructor(s){t(this,s),this.vviinnWidgetLoad=i(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=i(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=i(this,"vviinnWidgetClose",7),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnProductLoad=i(this,"vviinnProductLoad",7),this.vviinnProductClick=i(this,"vviinnProductClick",7),this.vviinnProductView=i(this,"vviinnProductView",7),this.vviinnResultLoad=i(this,"vviinnResultLoad",7),this.vviinnResultView=i(this,"vviinnResultView",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageCrop=i(this,"vviinnImageCrop",7),this.vviinnSelectObject=i(this,"vviinnSelectObject",7),this.vviinnSelectFilter=i(this,"vviinnSelectFilter",7),this.globalSlotsChanged=i(this,"globalSlotsChanged",7),this.getBasicEventData=()=>({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:a.VPS,widgetId:this.el.id,widgetVersion:n}),this.token=void 0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.addStyle=!1,this.mode="modal",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=l,this.textSearchShow=!1,this.apiPath=void 0,this.buttonPressed=!1}handleModalClosed(){this.buttonPressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}handleClick(){this.buttonPressed=!0}resetButton(){this.buttonPressed=!1}render(){return s(h,{tabindex:"0",role:"button"},s("vviinn-button",{onClick:()=>{this.handleClick()},addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(o,null))),d("vps"),s("vviinn-vps-widget",{mode:this.mode,"currency-sign":this.currencySign,token:this.token,locale:this.locale,apiPath:this.apiPath,campaignId:this.campaignId,showingInButton:!0,buttonPressed:this.buttonPressed,resetVpsButton:this.resetButton.bind(this),buttonElementId:this.el.id,active:this.buttonPressed&&("modal"===this.mode||"camera"===this.mode),excluded:this.excluded,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,imageResolutionWidth:this.imageResolutionWidth,exampleImageSource:this.exampleImageSource,textSearchShow:this.textSearchShow}))}get el(){return e(this)}};r.style=":host{display:block}";export{r as vviinn_vps_button}
1
+ import{r as t,c as i,h as s,H as h,g as e}from"./p-1c863deb.js";import{v as n}from"./p-a08bc9bb.js";import{C as o}from"./p-171fa6da.js";import{c as a,S as d}from"./p-55c453ab.js";import{D as l}from"./p-cc013cd2.js";const r=class{constructor(s){t(this,s),this.vviinnWidgetLoad=i(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=i(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=i(this,"vviinnWidgetClose",7),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnProductLoad=i(this,"vviinnProductLoad",7),this.vviinnProductClick=i(this,"vviinnProductClick",7),this.vviinnProductView=i(this,"vviinnProductView",7),this.vviinnResultLoad=i(this,"vviinnResultLoad",7),this.vviinnResultView=i(this,"vviinnResultView",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageCrop=i(this,"vviinnImageCrop",7),this.vviinnSelectObject=i(this,"vviinnSelectObject",7),this.vviinnSelectFilter=i(this,"vviinnSelectFilter",7),this.globalSlotsChanged=i(this,"globalSlotsChanged",7),this.getBasicEventData=()=>({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:a.VPS,widgetId:this.el.id,widgetVersion:n}),this.token=void 0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.addStyle=!1,this.mode="modal",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=l,this.textSearchShow=!1,this.apiPath=void 0,this.buttonPressed=!1}handleModalClosed(){this.buttonPressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}handleClick(){this.buttonPressed=!0}resetButton(){this.buttonPressed=!1}render(){return s(h,{tabindex:"0",role:"button"},s("vviinn-button",{onClick:()=>{this.handleClick()},addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(o,null))),d("vps"),s("vviinn-vps-widget",{mode:this.mode,"currency-sign":this.currencySign,token:this.token,locale:this.locale,apiPath:this.apiPath,campaignId:this.campaignId,showingInButton:!0,buttonPressed:this.buttonPressed,resetVpsButton:this.resetButton.bind(this),buttonElementId:this.el.id,active:this.buttonPressed&&("modal"===this.mode||"camera"===this.mode),excluded:this.excluded,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,imageResolutionWidth:this.imageResolutionWidth,exampleImageSource:this.exampleImageSource,textSearchShow:this.textSearchShow}))}get el(){return e(this)}};r.style=":host{display:block}";export{r as vviinn_vps_button}
@@ -0,0 +1 @@
1
+ const o="2.76.0";export{o as v}
@@ -1 +1 @@
1
- import{h as t,r as i,c as e,F as s,H as r,g as o}from"./p-1c863deb.js";import{s as a,j as n,d as c,k as l,O as h}from"./p-34cec6de.js";import{i as d,r as p,k as u,l as f,v as g,c as v,m as b}from"./p-cd05d443.js";import{v as m}from"./p-6ea24620.js";import{c as x,s as y,S as w}from"./p-55c453ab.js";import{D as k}from"./p-cc013cd2.js";const C=()=>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"})),S=()=>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"})),j={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var _=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)i.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(e[s[r]]=t[s[r]])}return e};const I=class{constructor(s){i(this,s),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnTextSearchFilterSelected=e(this,"vviinnTextSearchFilterSelected",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.imageSource=null,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};if("focusMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("exposureMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:j});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:x.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.widgetElementId,widgetVersion:m}},this.LinkText=({href:i,children:e})=>t("a",{href:i||""},e),this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=k,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.searchQuery=""}initResultEvents(){a.resultLoaded=!1,a.resultViewed=!1}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}async componentWillLoad(){await d.init({lng:this.locale,fallbackLng:"en",resources:p}),y(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}textSearchFinishedHandler({detail:t}){this.searchQuery=t.query,this.slidePosition=1}resultLoadHandler(){a.resultLoaded=!0}resultViewHandler(){a.resultViewed=!0}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=u(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=u(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilter({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId"]),s=f(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}trackTextSearchFilterSelected({detail:t}){n(this.searchQuery,this.token,t)}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),c.apiPath=this.apiPath,c.currencySign=this.currencySign,c.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=l(this.excluded)),a.token=this.token,a.campaignId=this.campaignId,a.excluded=this.excluded,this.uiSessionId=g(),this.trackingApi=v(this.apiPath,this.token),this.widgetElementId=this.el.id}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),r=b(s);this.trackingApi.trackEvent(r).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId","widgetType"]),e=u(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=a.loading&&"image"===a.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing,e=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},t("vviinn-preloader",{class:{hidden:!i}}),t("span",{class:{"action-button-content":!0,hidden:i}},t("slot",{name:"vviinn-camera-icon"},t(C,null)),t("span",{class:{hidden:!this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-stop"},d.t("cameraButtonTextStop"))),t("span",{class:{hidden:this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-start"},d.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:a.loading&&"image"===a.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(S,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,d.t("imageUploadButtonText")))))];return this.isDesktop?e.reverse():e}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,a.resetCategoryLink=void 0,a.activeIonLink=void 0,a.image=h.none,a.imageUrl=h.none,a.imageBounds=h.none,a.searchArea=h.none,a.results=[],a.filters=[],a.textSearchFilters=[],a.detectedObjects=[],a.rectangleSearchForm=void 0,a.loading=!1,a.serverError=!1,a.searchType=void 0,this.searchQuery="",this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||a.serverError}resetScroll(t,i="auto"){const e=this.el.shadowRoot.getElementById(t);null==e||e.scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i,e;return t(r,{exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button, text-search-input, close-button, secondary-action, close-button"},!this.showingInButton&&w("vps"),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.widgetElementId,widgetVersion:m,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!a.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!a.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t(s,null,t("vviinn-teaser",null),t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}))),t("vviinn-privacy-badge",{privacyBadgeText:d.t("privacyBadgeText",{interpolation:{escapeValue:!1}}),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===a.searchType&&t("div",{class:"source-wrapper image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},a.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&"text"===a.searchType&&t("div",{class:"source-wrapper text-search-wrapper"},t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},a.textSearchFilters.map((i=>t("search-filters",{textSearchFiltersGroup:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&t("vviinn-results",{token:this.token,uiSessionId:this.uiSessionId,apiPath:this.apiPath,widgetElementId:null!==(e=this.buttonElementId)&&void 0!==e?e:this.widgetElementId,showingInWidget:!0,buttonElementId:this.buttonElementId,imageResolutionWidth:this.imageResolutionWidth,"currency-sign":this.currencySign,locale:this.locale,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,showAspectRatioError:this.showAspectRatioError,trackingDeactivated:this.trackingDeactivated,resetState:this.resetState.bind(this),textSearchQuery:this.searchQuery})))))}get el(){return o(this)}static get watchers(){return{active:["activeWatcher"]}}};I.style=':host{--color-primary-system:#0f62fe;--color-primary-hover-system:#014cda;--color-icons-system:#2f8edf;--product-card-width-system:130px;--spacer:8px;--surface-color-surface-01:#f4f4f4;--text-color-text-primary:#161616;--font-family:Inter, system-ui, sans-serif;--font-size-body:14px;--font-weight-regular:400;--line-height-body:20px;--letter-spacing-default:0px;--background-color-background:#fff;--border-color-border-01:#f4f4f4;--gray-100:#161616;--gray-10:#f4f4f4;--gray-70:#525252;--radius-radius-md:8px;--button-color-button-primary:#000;--text-color-text-inverse:#fff;--text-color-text-secondary:#525252;--button-color-button-disabled:#e0e0e0;--text-color-text-disabled:rgba(22, 22, 22, 0.25);--surface-color-surface-accent:#e0e0e0;--border-color-border-02:#c6c6c6;--surface-color-surface-active:#161616;--surface-color-surface-inactive:#e0e0e0;--stroke-color-stroke-01:#f4f4f4;--chip-color-badge-primary:#161616;--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:"JetBrains Mono", monospace;--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;--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;--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;}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:40px 62px}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:12px}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));color:white}.action-button:first-child:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}.action-button:active{border-color:black}.action-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:max-content auto;grid-gap:8px}.action-button .hidden{display:none}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.source-wrapper{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.results-page .source-wrapper.text-search-wrapper{padding:24px 24px 0 24px}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}search-filters span{display:none}search-filters::part(filter){background:#f4f4f4;border-radius:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--color-primary-system));color:white}.results-page:not(.active){display:none}vviinn-preloader{--preloader-size:24px;display:flex}@media (max-width: 1080px){#start-page_block{padding:24px 36px}}@media (max-width: 768px){.start-page{display:flex;flex-direction:column;height:100%}vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:visible}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.source-wrapper{grid-template-rows:min-content auto;width:100%;padding:0}.source-wrapper.image-wrapper .filters-wrapper{padding-left:24px;min-width:100%}.image{margin-bottom:8px}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px 20px}}@media (max-width: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}';export{I as vviinn_vps_widget}
1
+ import{h as t,r as i,c as e,F as s,H as r,g as o}from"./p-1c863deb.js";import{s as a,j as n,d as c,k as l,O as h}from"./p-dee78ef6.js";import{i as d,r as p,k as f,l as u,v as g,c as v,m as b}from"./p-ddf609ee.js";import{v as m}from"./p-a08bc9bb.js";import{c as x,s as y,S as w}from"./p-55c453ab.js";import{D as k}from"./p-cc013cd2.js";const C=()=>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"})),S=()=>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"})),j={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var _=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)i.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(e[s[r]]=t[s[r]])}return e};const I=class{constructor(s){i(this,s),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnTextSearchFilterSelected=e(this,"vviinnTextSearchFilterSelected",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.imageSource=null,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};if("focusMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("exposureMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:j});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:x.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.widgetElementId,widgetVersion:m}},this.LinkText=({href:i,children:e})=>t("a",{href:i||""},e),this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=k,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.searchQuery=""}initResultEvents(){a.resultLoaded=!1,a.resultViewed=!1}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}async componentWillLoad(){await d.init({lng:this.locale,fallbackLng:"en",resources:p}),y(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}textSearchFinishedHandler({detail:t}){this.searchQuery=t.query,this.slidePosition=1}resultLoadHandler(){a.resultLoaded=!0}resultViewHandler(){a.resultViewed=!0}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=f(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=f(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilter({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId"]),s=u(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}trackTextSearchFilterSelected({detail:t}){n(this.searchQuery,this.token,t)}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),c.apiPath=this.apiPath,c.currencySign=this.currencySign,c.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=l(this.excluded)),a.token=this.token,a.campaignId=this.campaignId,a.excluded=this.excluded,this.uiSessionId=g(),this.trackingApi=v(this.apiPath,this.token),this.widgetElementId=this.el.id}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),r=b(s);this.trackingApi.trackEvent(r).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId","widgetType"]),e=f(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=a.loading&&"image"===a.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing,e=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},t("vviinn-preloader",{class:{hidden:!i}}),t("span",{class:{"action-button-content":!0,hidden:i}},t("slot",{name:"vviinn-camera-icon"},t(C,null)),t("span",{class:{hidden:!this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-stop"},d.t("cameraButtonTextStop"))),t("span",{class:{hidden:this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-start"},d.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:a.loading&&"image"===a.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(S,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,d.t("imageUploadButtonText")))))];return this.isDesktop?e.reverse():e}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,a.resetCategoryLink=void 0,a.activeIonLink=void 0,a.image=h.none,a.imageUrl=h.none,a.imageBounds=h.none,a.searchArea=h.none,a.results=[],a.filters=[],a.textSearchFilters=[],a.detectedObjects=[],a.rectangleSearchForm=void 0,a.loading=!1,a.serverError=!1,a.searchType=void 0,this.searchQuery="",this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||a.serverError}resetScroll(t,i="auto"){const e=this.el.shadowRoot.getElementById(t);null==e||e.scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i,e;return t(r,{exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button, text-search-input, close-button, secondary-action, close-button"},!this.showingInButton&&w("vps"),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.widgetElementId,widgetVersion:m,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!a.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!a.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t(s,null,t("vviinn-teaser",null),t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}))),t("vviinn-privacy-badge",{privacyBadgeText:d.t("privacyBadgeText",{interpolation:{escapeValue:!1}}),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===a.searchType&&t("div",{class:"source-wrapper image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},a.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&"text"===a.searchType&&t("div",{class:"source-wrapper text-search-wrapper"},t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},a.textSearchFilters.map((i=>t("search-filters",{textSearchFiltersGroup:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&t("vviinn-results",{token:this.token,uiSessionId:this.uiSessionId,apiPath:this.apiPath,widgetElementId:null!==(e=this.buttonElementId)&&void 0!==e?e:this.widgetElementId,showInWidget:!0,buttonElementId:this.buttonElementId,imageResolutionWidth:this.imageResolutionWidth,"currency-sign":this.currencySign,locale:this.locale,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,showAspectRatioError:this.showAspectRatioError,trackingDeactivated:this.trackingDeactivated,resetState:this.resetState.bind(this),textSearchQuery:this.searchQuery})))))}get el(){return o(this)}static get watchers(){return{active:["activeWatcher"]}}};I.style=':host{--color-primary-system:#0f62fe;--color-primary-hover-system:#014cda;--color-icons-system:#2f8edf;--product-card-width-system:130px;--spacer:8px;--surface-color-surface-01:#f4f4f4;--text-color-text-primary:#161616;--font-family:Inter, system-ui, sans-serif;--font-size-body:14px;--font-weight-regular:400;--line-height-body:20px;--letter-spacing-default:0px;--background-color-background:#fff;--border-color-border-01:#f4f4f4;--gray-100:#161616;--gray-10:#f4f4f4;--gray-70:#525252;--radius-radius-md:8px;--button-color-button-primary:#000;--text-color-text-inverse:#fff;--text-color-text-secondary:#525252;--button-color-button-disabled:#e0e0e0;--text-color-text-disabled:rgba(22, 22, 22, 0.25);--surface-color-surface-accent:#e0e0e0;--border-color-border-02:#c6c6c6;--surface-color-surface-active:#161616;--surface-color-surface-inactive:#e0e0e0;--stroke-color-stroke-01:#f4f4f4;--chip-color-badge-primary:#161616;--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:"JetBrains Mono", monospace;--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;--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;--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;}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:40px 62px}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:12px}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));color:white}.action-button:first-child:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}.action-button:active{border-color:black}.action-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:max-content auto;grid-gap:8px}.action-button .hidden{display:none}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.source-wrapper{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.results-page .source-wrapper.text-search-wrapper{padding:24px 24px 0 24px}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}search-filters span{display:none}search-filters::part(filter){background:#f4f4f4;border-radius:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--color-primary-system));color:white}.results-page:not(.active){display:none}vviinn-preloader{--preloader-size:24px;display:flex}@media (max-width: 1080px){#start-page_block{padding:24px 36px}}@media (max-width: 768px){.start-page{display:flex;flex-direction:column;height:100%}vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:visible}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.source-wrapper{grid-template-rows:min-content auto;width:100%;padding:0}.source-wrapper.image-wrapper .filters-wrapper{padding-left:24px;min-width:100%}.image{margin-bottom:8px}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px 20px}}@media (max-width: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}';export{I as vviinn_vps_widget}