vviinn-widgets 2.48.3 → 2.48.4

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 (58) hide show
  1. package/dist/cjs/{customized-slots-1b59bd38.js → customized-slots-67b24737.js} +0 -1
  2. package/dist/cjs/{index-279a6a0f.js → index-bfb8c050.js} +1 -1
  3. package/dist/cjs/{package-1762509d.js → package-ba749091.js} +1 -1
  4. package/dist/cjs/search-filters_17.cjs.entry.js +2 -2
  5. package/dist/cjs/{search.store-0b319593.js → search.store-d44009d4.js} +4 -24
  6. package/dist/cjs/vviinn-carousel_4.cjs.entry.js +4 -4
  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 +2 -2
  10. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +5 -9
  11. package/dist/collection/components/customized-slots.js +0 -1
  12. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +0 -7
  13. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +1 -14
  14. package/dist/collection/searchSession/searchSession.js +2 -2
  15. package/dist/collection/store/search.store.js +2 -5
  16. package/dist/esm/{customized-slots-3bea41d2.js → customized-slots-e56251a2.js} +0 -1
  17. package/dist/esm/{index-9c15b8f1.js → index-3bef9180.js} +1 -1
  18. package/dist/esm/{package-47553c09.js → package-b3c56ad4.js} +1 -1
  19. package/dist/esm/search-filters_17.entry.js +2 -2
  20. package/dist/esm/{search.store-5eebcfbe.js → search.store-df028218.js} +5 -24
  21. package/dist/esm/vviinn-carousel_4.entry.js +4 -4
  22. package/dist/esm/vviinn-preloader.entry.js +1 -1
  23. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  24. package/dist/esm/vviinn-vps-button.entry.js +2 -2
  25. package/dist/esm/vviinn-vps-widget.entry.js +5 -9
  26. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +0 -7
  27. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +0 -7
  28. package/dist/types/searchSession/searchSession.d.ts +1 -2
  29. package/dist/types/store/search.store.d.ts +1 -1
  30. package/dist/vviinn-widgets/{p-7195889c.entry.js → p-0ece8ea1.entry.js} +1 -1
  31. package/{www/build/p-368e9b0b.entry.js → dist/vviinn-widgets/p-3b78a9b7.entry.js} +1 -1
  32. package/dist/vviinn-widgets/p-3e1665c8.js +1 -0
  33. package/dist/vviinn-widgets/p-49417192.js +1 -0
  34. package/dist/vviinn-widgets/p-81bb3f10.entry.js +1 -0
  35. package/dist/vviinn-widgets/{p-ec7b07a0.entry.js → p-95fdd81d.entry.js} +1 -1
  36. package/dist/vviinn-widgets/{p-09de9d7d.entry.js → p-a0800504.entry.js} +1 -1
  37. package/dist/vviinn-widgets/{p-e5fac7ef.entry.js → p-ce69a00b.entry.js} +1 -1
  38. package/{www/build/p-41ab810c.js → dist/vviinn-widgets/p-e2fe7163.js} +1 -1
  39. package/dist/vviinn-widgets/{p-04cdf7c5.js → p-f4ef2f87.js} +1 -1
  40. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  41. package/package.json +1 -1
  42. package/www/build/{p-7195889c.entry.js → p-0ece8ea1.entry.js} +1 -1
  43. package/{dist/vviinn-widgets/p-368e9b0b.entry.js → www/build/p-3b78a9b7.entry.js} +1 -1
  44. package/www/build/p-3e1665c8.js +1 -0
  45. package/www/build/p-49417192.js +1 -0
  46. package/www/build/p-81bb3f10.entry.js +1 -0
  47. package/www/build/{p-ec7b07a0.entry.js → p-95fdd81d.entry.js} +1 -1
  48. package/www/build/{p-09de9d7d.entry.js → p-a0800504.entry.js} +1 -1
  49. package/www/build/{p-e5fac7ef.entry.js → p-ce69a00b.entry.js} +1 -1
  50. package/{dist/vviinn-widgets/p-41ab810c.js → www/build/p-e2fe7163.js} +1 -1
  51. package/www/build/{p-04cdf7c5.js → p-f4ef2f87.js} +1 -1
  52. package/www/build/vviinn-widgets.esm.js +1 -1
  53. package/dist/vviinn-widgets/p-8699147a.entry.js +0 -1
  54. package/dist/vviinn-widgets/p-af67c2ee.js +0 -1
  55. package/dist/vviinn-widgets/p-ed482314.js +0 -1
  56. package/www/build/p-8699147a.entry.js +0 -1
  57. package/www/build/p-af67c2ee.js +0 -1
  58. package/www/build/p-ed482314.js +0 -1
@@ -16,7 +16,6 @@ function fromString(s) {
16
16
  }
17
17
 
18
18
  const defaultSlotsNames = [
19
- "vviinn-onboarding-title",
20
19
  "vviinn-teaser-text",
21
20
  "vviinn-image-upload-button-text",
22
21
  "vviinn-image-upload-icon",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const search_store = require('./search.store-0b319593.js');
3
+ const search_store = require('./search.store-d44009d4.js');
4
4
 
5
5
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
6
6
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "2.48.3";
3
+ const version = "2.48.4";
4
4
 
5
5
  exports.version = version;
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-0b319593.js');
6
+ const search_store = require('./search.store-d44009d4.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
8
  const PlusIcon = require('./PlusIcon-5e585127.js');
9
- const customizedSlots = require('./customized-slots-1b59bd38.js');
9
+ const customizedSlots = require('./customized-slots-67b24737.js');
10
10
 
11
11
  const ArrowIcon = () => (index.h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
12
12
  index.h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
@@ -16403,22 +16403,6 @@ var Monoid = {
16403
16403
  concat: Semigroup.concat,
16404
16404
  empty: empty
16405
16405
  };
16406
- // -------------------------------------------------------------------------------------
16407
- // utils
16408
- // -------------------------------------------------------------------------------------
16409
- /**
16410
- * Test whether a `string` is empty.
16411
- *
16412
- * @example
16413
- * import * as S from 'fp-ts/string'
16414
- * import { pipe } from 'fp-ts/function'
16415
- *
16416
- * assert.deepStrictEqual(pipe('', S.isEmpty), true)
16417
- * assert.deepStrictEqual(pipe('a', S.isEmpty), false)
16418
- *
16419
- * @since 2.10.0
16420
- */
16421
- var isEmpty$1 = function (s) { return s.length === 0; };
16422
16406
 
16423
16407
  const basicErrorFromResponse = (error) => {
16424
16408
  return {
@@ -16504,9 +16488,9 @@ const detectedObjectEq = {
16504
16488
  x.rectangle.height === y.rectangle.height &&
16505
16489
  x.rectangle.width === y.rectangle.width,
16506
16490
  };
16507
- const imageSearchSessionClient = (initialData, campaignId = none, excludedFilters) => {
16491
+ const imageSearchSessionClient = (initialData, campaignId, excludedFilters) => {
16508
16492
  const searchUrl = "search/session";
16509
- const requestUrl = _function.pipe(campaignId, fold(() => {
16493
+ const requestUrl = _function.pipe(fromNullable(campaignId), fold(() => {
16510
16494
  const params = [];
16511
16495
  if (excludedFilters)
16512
16496
  params.push(excludedFilters);
@@ -17264,7 +17248,7 @@ const makeAuthorizedRequest = (token) => pipe(token, processBearerToken, map$4((
17264
17248
  };
17265
17249
  }));
17266
17250
  const { state, onChange } = createStore({
17267
- campaignId: Option.none,
17251
+ campaignId: "",
17268
17252
  excluded: "",
17269
17253
  results: [],
17270
17254
  filters: [],
@@ -17346,10 +17330,7 @@ const uploadFile = (file) => {
17346
17330
  const uploadText = (query) => {
17347
17331
  state.searchType = "text";
17348
17332
  state.loading = true;
17349
- const body = JSON.stringify({
17350
- query,
17351
- campaign: Option.getOrElse(() => "")(state.campaignId),
17352
- });
17333
+ const body = JSON.stringify(Object.assign({ query }, (state.campaignId.length ? { campaign: state.campaignId } : {})));
17353
17334
  const tokenWithBody = sequenceToEither(processBearerToken(state.token), right(body));
17354
17335
  return pipe(tokenWithBody, map$4(([headers, body]) => {
17355
17336
  headers.set("Content-Type", "application/json");
@@ -17428,7 +17409,6 @@ exports.fromEither = fromEither;
17428
17409
  exports.fromImage = fromImage;
17429
17410
  exports.getApiPath = getApiPath;
17430
17411
  exports.has = has;
17431
- exports.isEmpty = isEmpty$1;
17432
17412
  exports.makeRectangularSearchRequest = makeRectangularSearchRequest;
17433
17413
  exports.makeRequest = makeRequest;
17434
17414
  exports.map = map$3;
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-0b319593.js');
6
+ const search_store = require('./search.store-d44009d4.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
8
  const PlusIcon = require('./PlusIcon-5e585127.js');
9
- const customizedSlots = require('./customized-slots-1b59bd38.js');
10
- const _package = require('./package-1762509d.js');
11
- const index$1 = require('./index-279a6a0f.js');
9
+ const customizedSlots = require('./customized-slots-67b24737.js');
10
+ const _package = require('./package-ba749091.js');
11
+ const index$1 = require('./index-bfb8c050.js');
12
12
 
13
13
  const BasketIcon = () => (index.h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
14
  index.h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-0b319593.js');
6
+ const search_store = require('./search.store-d44009d4.js');
7
7
 
8
8
  const vviinnPreloaderCss = ":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)}}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const _package = require('./package-1762509d.js');
6
+ const _package = require('./package-ba749091.js');
7
7
  const VisualSearchIcon = require('./VisualSearchIcon-1180d079.js');
8
8
 
9
9
  const vviinnVprButtonCss = ":host{display:block}";
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const _package = require('./package-1762509d.js');
7
- const customizedSlots = require('./customized-slots-1b59bd38.js');
6
+ const _package = require('./package-ba749091.js');
7
+ const customizedSlots = require('./customized-slots-67b24737.js');
8
8
  const constants = require('./constants-7684cbfc.js');
9
9
 
10
10
  const CameraIcon = () => (index.h("svg", { width: "22", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const search_store = require('./search.store-0b319593.js');
6
+ const search_store = require('./search.store-d44009d4.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
- const _package = require('./package-1762509d.js');
9
- const customizedSlots = require('./customized-slots-1b59bd38.js');
10
- const index$1 = require('./index-279a6a0f.js');
8
+ const _package = require('./package-ba749091.js');
9
+ const customizedSlots = require('./customized-slots-67b24737.js');
10
+ const index$1 = require('./index-bfb8c050.js');
11
11
  const constants = require('./constants-7684cbfc.js');
12
12
 
13
13
  const CameraActionIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
@@ -98,9 +98,6 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
98
98
  }
99
99
  return t;
100
100
  };
101
- const filterInt = (value) => /^[-+]?(\d+|Infinity)$/.test(value) ? Number(value) : NaN;
102
- const notEmptyString = (s) => !search_store.isEmpty(s);
103
- const notNan = (n) => !isNaN(n);
104
101
  const checkDeviceType = () => {
105
102
  const ua = navigator.userAgent;
106
103
  if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(ua)) {
@@ -395,12 +392,11 @@ const VviinnVpsWidget = class {
395
392
  search_store.state.locale = this.locale;
396
393
  this.cameraAvailable =
397
394
  !!navigator.mediaDevices && !!navigator.mediaDevices.getUserMedia;
398
- const campaignId = search_store._function.pipe(this.campaignId, search_store.Option.fromNullable, search_store.Option.chain(search_store.Option.fromPredicate(notEmptyString)), search_store.Option.map(filterInt), search_store.Option.chain(search_store.Option.fromPredicate(notNan)), search_store.Option.map((s) => `${s}`));
399
395
  if (this.excluded) {
400
396
  this.excluded = search_store.parseExcluded(this.excluded);
401
397
  }
402
398
  search_store.searchState.token = this.token;
403
- search_store.searchState.campaignId = campaignId;
399
+ search_store.searchState.campaignId = this.campaignId;
404
400
  search_store.searchState.excluded = this.excluded;
405
401
  this.uiSessionId = index$1.v4();
406
402
  this.trackingApi = index$1.createTrackingApi(this.apiPath, this.token);
@@ -1,6 +1,5 @@
1
1
  import { h } from "@stencil/core";
2
2
  const defaultSlotsNames = [
3
- "vviinn-onboarding-title",
4
3
  "vviinn-teaser-text",
5
4
  "vviinn-image-upload-button-text",
6
5
  "vviinn-image-upload-icon",
@@ -5,13 +5,6 @@ import { SlotSkeleton } from "../customized-slots";
5
5
  import { campaignTypeNames } from "../../campaign/Campaign";
6
6
  import { DEFAULT_EXAMPLE_IMAGE } from "../../assets/constants";
7
7
  /**
8
- * @slot vviinn-onboarding-title - Title of onboarding section.
9
- * @slot onboarding-card-1-icon - Icon (or other graphics) on the first onboarding slide.
10
- * @slot onboarding-card-1-text - Text content of first onboarding slide.
11
- * @slot onboarding-card-2-icon - Icon (or other graphics) on the second onboarding slide.
12
- * @slot onboarding-card-2-text - Text content of second onboarding slide.
13
- * @slot onboarding-card-3-icon - Icon (or other graphics) on the third onboarding slide.
14
- * @slot onboarding-card-3-text - Text content of third onboarding slide.
15
8
  * @slot vviinn-teaser-text - Text on widget's main screen.
16
9
  * @slot vviinn-image-upload-button-text - Title of Upload Button.
17
10
  * @slot vviinn-show-files-button-text - Title of Show Files Button.
@@ -12,8 +12,6 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  import { Host, h, } from "@stencil/core";
14
14
  import * as O from "fp-ts/lib/Option";
15
- import { pipe } from "fp-ts/lib/function";
16
- import { isEmpty } from "fp-ts/string";
17
15
  import { v4 as uuidv4 } from "uuid";
18
16
  import i18next from "i18next";
19
17
  import { version } from "../../../package.json";
@@ -29,9 +27,6 @@ import { resources } from "../../locale/resources-vps";
29
27
  import { CameraActionIcon, UploadActionIcon } from "../vviinn-icons";
30
28
  import { DEFAULT_EXAMPLE_IMAGE } from "../../assets/constants";
31
29
  import { videoStreamSettings } from "../../video/settings";
32
- const filterInt = (value) => /^[-+]?(\d+|Infinity)$/.test(value) ? Number(value) : NaN;
33
- const notEmptyString = (s) => !isEmpty(s);
34
- const notNan = (n) => !isNaN(n);
35
30
  const checkDeviceType = () => {
36
31
  const ua = navigator.userAgent;
37
32
  if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(ua)) {
@@ -66,13 +61,6 @@ const checkDeviceType = () => {
66
61
  * @part title - Title inside Product Card.
67
62
  * @part text-search-input - Text search input.
68
63
 
69
- * @slot vviinn-onboarding-title - Title of onboarding section.
70
- * @slot onboarding-card-1-icon - Icon (or other graphics) on the first onboarding slide.
71
- * @slot onboarding-card-1-text - Text content of first onboarding slide.
72
- * @slot onboarding-card-2-icon - Icon (or other graphics) on the second onboarding slide.
73
- * @slot onboarding-card-2-text - Text content of second onboarding slide.
74
- * @slot onboarding-card-3-icon - Icon (or other graphics) on the third onboarding slide.
75
- * @slot onboarding-card-3-text - Text content of third onboarding slide.
76
64
  * @slot vviinn-teaser-text - Text on widget's main screen.
77
65
  * @slot vviinn-image-upload-button-text - Title of Upload Button.
78
66
  * @slot vviinn-image-upload-icon - Icon of Upload Button.
@@ -354,12 +342,11 @@ export class VviinnVpsWidget {
354
342
  state.locale = this.locale;
355
343
  this.cameraAvailable =
356
344
  !!navigator.mediaDevices && !!navigator.mediaDevices.getUserMedia;
357
- const campaignId = pipe(this.campaignId, O.fromNullable, O.chain(O.fromPredicate(notEmptyString)), O.map(filterInt), O.chain(O.fromPredicate(notNan)), O.map((s) => `${s}`));
358
345
  if (this.excluded) {
359
346
  this.excluded = parseExcluded(this.excluded);
360
347
  }
361
348
  searchState.token = this.token;
362
- searchState.campaignId = campaignId;
349
+ searchState.campaignId = this.campaignId;
363
350
  searchState.excluded = this.excluded;
364
351
  this.uiSessionId = uuidv4();
365
352
  this.trackingApi = createTrackingApi(this.apiPath, this.token);
@@ -16,9 +16,9 @@ export const detectedObjectEq = {
16
16
  x.rectangle.height === y.rectangle.height &&
17
17
  x.rectangle.width === y.rectangle.width,
18
18
  };
19
- export const imageSearchSessionClient = (initialData, campaignId = O.none, excludedFilters) => {
19
+ export const imageSearchSessionClient = (initialData, campaignId, excludedFilters) => {
20
20
  const searchUrl = "search/session";
21
- const requestUrl = pipe(campaignId, O.fold(() => {
21
+ const requestUrl = pipe(O.fromNullable(campaignId), O.fold(() => {
22
22
  const params = [];
23
23
  if (excludedFilters)
24
24
  params.push(excludedFilters);
@@ -23,7 +23,7 @@ const makeAuthorizedRequest = (token) => pipe(token, processBearerToken, E.map((
23
23
  };
24
24
  }));
25
25
  const { state, onChange } = createStore({
26
- campaignId: O.none,
26
+ campaignId: "",
27
27
  excluded: "",
28
28
  results: [],
29
29
  filters: [],
@@ -105,10 +105,7 @@ export const uploadFile = (file) => {
105
105
  const uploadText = (query) => {
106
106
  state.searchType = "text";
107
107
  state.loading = true;
108
- const body = JSON.stringify({
109
- query,
110
- campaign: O.getOrElse(() => "")(state.campaignId),
111
- });
108
+ const body = JSON.stringify(Object.assign({ query }, (state.campaignId.length ? { campaign: state.campaignId } : {})));
112
109
  const tokenWithBody = sequenceToEither(processBearerToken(state.token), E.right(body));
113
110
  return pipe(tokenWithBody, E.map(([headers, body]) => {
114
111
  headers.set("Content-Type", "application/json");
@@ -14,7 +14,6 @@ function fromString(s) {
14
14
  }
15
15
 
16
16
  const defaultSlotsNames = [
17
- "vviinn-onboarding-title",
18
17
  "vviinn-teaser-text",
19
18
  "vviinn-image-upload-button-text",
20
19
  "vviinn-image-upload-icon",
@@ -1,4 +1,4 @@
1
- import { n as commonjsGlobal, o as createCommonjsModule } from './search.store-5eebcfbe.js';
1
+ import { n as commonjsGlobal, o as createCommonjsModule } from './search.store-df028218.js';
2
2
 
3
3
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
4
4
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -1,3 +1,3 @@
1
- const version = "2.48.3";
1
+ const version = "2.48.4";
2
2
 
3
3
  export { version as v };
@@ -1,8 +1,8 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { s as searchState, a as _function, O as Option, r as fromAlt, u as foldValueObject, v as scaleWithSized, w as center, x as makeRectangularSearchRequest, y as detectedObjectEq, z as toFile, B as processSelectedFile, E as Either, C as match, o as createCommonjsModule, n as commonjsGlobal, D as sequenceToOption, F as fromImage, G as dimensionsFromImage, H as scaleByLargestSide, N as NonEmptyArray, I as processSelectedText } from './search.store-5eebcfbe.js';
2
+ import { s as searchState, a as _function, O as Option, q as fromAlt, r as foldValueObject, u as scaleWithSized, v as center, w as makeRectangularSearchRequest, x as detectedObjectEq, y as toFile, z as processSelectedFile, E as Either, B as match, o as createCommonjsModule, n as commonjsGlobal, C as sequenceToOption, D as fromImage, F as dimensionsFromImage, G as scaleByLargestSide, N as NonEmptyArray, H as processSelectedText } from './search.store-df028218.js';
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
4
  import { P as PlusIcon } from './PlusIcon-af795e23.js';
5
- import { s as slotChangeListener, c as campaignTypeNames } from './customized-slots-3bea41d2.js';
5
+ import { s as slotChangeListener, c as campaignTypeNames } from './customized-slots-e56251a2.js';
6
6
 
7
7
  const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
8
8
  h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
@@ -16401,22 +16401,6 @@ var Monoid = {
16401
16401
  concat: Semigroup.concat,
16402
16402
  empty: empty
16403
16403
  };
16404
- // -------------------------------------------------------------------------------------
16405
- // utils
16406
- // -------------------------------------------------------------------------------------
16407
- /**
16408
- * Test whether a `string` is empty.
16409
- *
16410
- * @example
16411
- * import * as S from 'fp-ts/string'
16412
- * import { pipe } from 'fp-ts/function'
16413
- *
16414
- * assert.deepStrictEqual(pipe('', S.isEmpty), true)
16415
- * assert.deepStrictEqual(pipe('a', S.isEmpty), false)
16416
- *
16417
- * @since 2.10.0
16418
- */
16419
- var isEmpty$1 = function (s) { return s.length === 0; };
16420
16404
 
16421
16405
  const basicErrorFromResponse = (error) => {
16422
16406
  return {
@@ -16502,9 +16486,9 @@ const detectedObjectEq = {
16502
16486
  x.rectangle.height === y.rectangle.height &&
16503
16487
  x.rectangle.width === y.rectangle.width,
16504
16488
  };
16505
- const imageSearchSessionClient = (initialData, campaignId = none, excludedFilters) => {
16489
+ const imageSearchSessionClient = (initialData, campaignId, excludedFilters) => {
16506
16490
  const searchUrl = "search/session";
16507
- const requestUrl = _function.pipe(campaignId, fold(() => {
16491
+ const requestUrl = _function.pipe(fromNullable(campaignId), fold(() => {
16508
16492
  const params = [];
16509
16493
  if (excludedFilters)
16510
16494
  params.push(excludedFilters);
@@ -17262,7 +17246,7 @@ const makeAuthorizedRequest = (token) => pipe(token, processBearerToken, map$4((
17262
17246
  };
17263
17247
  }));
17264
17248
  const { state, onChange } = createStore({
17265
- campaignId: Option.none,
17249
+ campaignId: "",
17266
17250
  excluded: "",
17267
17251
  results: [],
17268
17252
  filters: [],
@@ -17344,10 +17328,7 @@ const uploadFile = (file) => {
17344
17328
  const uploadText = (query) => {
17345
17329
  state.searchType = "text";
17346
17330
  state.loading = true;
17347
- const body = JSON.stringify({
17348
- query,
17349
- campaign: Option.getOrElse(() => "")(state.campaignId),
17350
- });
17331
+ const body = JSON.stringify(Object.assign({ query }, (state.campaignId.length ? { campaign: state.campaignId } : {})));
17351
17332
  const tokenWithBody = sequenceToEither(processBearerToken(state.token), right(body));
17352
17333
  return pipe(tokenWithBody, map$4(([headers, body]) => {
17353
17334
  headers.set("Content-Type", "application/json");
@@ -17403,4 +17384,4 @@ const processSelectedFile = async (file) => {
17403
17384
  return session;
17404
17385
  };
17405
17386
 
17406
- export { Apply as A, processSelectedFile as B, match$1 as C, sequenceToOption as D, Either as E, fromImage as F, dimensionsFromImage as G, scaleByLargestSide as H, processSelectedText as I, NonEmptyArray as N, Option as O, Semigroup$1 as S, TaskEither as T, _Array as _, _function as a, state$1 as b, chainW as c, createInitGetRequest as d, map$3 as e, fromEither as f, getApiPath as g, has as h, match as i, arrayToQueryString as j, parseExcluded as k, checkEmpryString as l, makeRequest as m, commonjsGlobal as n, createCommonjsModule as o, pipe as p, isEmpty$1 as q, fromAlt as r, searchState as s, tuple as t, foldValueObject as u, scaleWithSized as v, center as w, makeRectangularSearchRequest as x, detectedObjectEq as y, toFile as z };
17387
+ export { Apply as A, match$1 as B, sequenceToOption as C, fromImage as D, Either as E, dimensionsFromImage as F, scaleByLargestSide as G, processSelectedText as H, NonEmptyArray as N, Option as O, Semigroup$1 as S, TaskEither as T, _Array as _, _function as a, state$1 as b, chainW as c, createInitGetRequest as d, map$3 as e, fromEither as f, getApiPath as g, has as h, match as i, arrayToQueryString as j, parseExcluded as k, checkEmpryString as l, makeRequest as m, commonjsGlobal as n, createCommonjsModule as o, pipe as p, fromAlt as q, foldValueObject as r, searchState as s, tuple as t, scaleWithSized as u, center as v, makeRectangularSearchRequest as w, detectedObjectEq as x, toFile as y, processSelectedFile as z };
@@ -1,10 +1,10 @@
1
1
  import { h, r as registerInstance, H as Host, g as getElement, c as createEvent, F as Fragment } from './index-1f3eaf12.js';
2
- import { _ as _Array, O as Option, S as Semigroup, a as _function, h as has, t as tuple, E as Either, s as searchState, b as state, p as pipe, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, d as createInitGetRequest, A as Apply, e as map, i as match, j as arrayToQueryString, k as parseExcluded, T as TaskEither, l as checkEmpryString } from './search.store-5eebcfbe.js';
2
+ import { _ as _Array, O as Option, S as Semigroup, a as _function, h as has, t as tuple, E as Either, s as searchState, b as state, p as pipe, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, d as createInitGetRequest, A as Apply, e as map, i as match, j as arrayToQueryString, k as parseExcluded, T as TaskEither, l as checkEmpryString } from './search.store-df028218.js';
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
4
  import { P as PlusIcon } from './PlusIcon-af795e23.js';
5
- import { s as slotChangeListener, c as campaignTypeNames, f as fromString, a as fold, S as SlotSkeleton } from './customized-slots-3bea41d2.js';
6
- import { v as version } from './package-47553c09.js';
7
- import { v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, i as createProductVprEventByType } from './index-9c15b8f1.js';
5
+ import { s as slotChangeListener, c as campaignTypeNames, f as fromString, a as fold, S as SlotSkeleton } from './customized-slots-e56251a2.js';
6
+ import { v as version } from './package-b3c56ad4.js';
7
+ import { v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, i as createProductVprEventByType } from './index-3bef9180.js';
8
8
 
9
9
  const BasketIcon = () => (h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
10
10
  h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-1f3eaf12.js';
2
- import { s as searchState } from './search.store-5eebcfbe.js';
2
+ import { s as searchState } from './search.store-df028218.js';
3
3
 
4
4
  const vviinnPreloaderCss = ":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)}}";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { v as version } from './package-47553c09.js';
2
+ import { v as version } from './package-b3c56ad4.js';
3
3
  import { V as VisualSearchIcon } from './VisualSearchIcon-13f7da6a.js';
4
4
 
5
5
  const vviinnVprButtonCss = ":host{display:block}";
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { v as version } from './package-47553c09.js';
3
- import { c as campaignTypeNames, S as SlotSkeleton } from './customized-slots-3bea41d2.js';
2
+ import { v as version } from './package-b3c56ad4.js';
3
+ import { c as campaignTypeNames, S as SlotSkeleton } from './customized-slots-e56251a2.js';
4
4
  import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
5
5
 
6
6
  const CameraIcon = () => (h("svg", { width: "22", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -1,9 +1,9 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-1f3eaf12.js';
2
- import { s as searchState, b as state, a as _function, O as Option, k as parseExcluded, q as isEmpty } from './search.store-5eebcfbe.js';
2
+ import { s as searchState, b as state, k as parseExcluded, O as Option } from './search.store-df028218.js';
3
3
  import { i as instance } from './i18next-387f2b0a.js';
4
- import { v as version } from './package-47553c09.js';
5
- import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton } from './customized-slots-3bea41d2.js';
6
- import { j as createSearchEvent, k as createFilterEvent, v as v4, c as createTrackingApi, l as createWidgetVpsEvent, m as createProductVpsEventByType, n as createResultVpsEventByType } from './index-9c15b8f1.js';
4
+ import { v as version } from './package-b3c56ad4.js';
5
+ import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton } from './customized-slots-e56251a2.js';
6
+ import { j as createSearchEvent, k as createFilterEvent, v as v4, c as createTrackingApi, l as createWidgetVpsEvent, m as createProductVpsEventByType, n as createResultVpsEventByType } from './index-3bef9180.js';
7
7
  import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
8
8
 
9
9
  const CameraActionIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
@@ -94,9 +94,6 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
94
94
  }
95
95
  return t;
96
96
  };
97
- const filterInt = (value) => /^[-+]?(\d+|Infinity)$/.test(value) ? Number(value) : NaN;
98
- const notEmptyString = (s) => !isEmpty(s);
99
- const notNan = (n) => !isNaN(n);
100
97
  const checkDeviceType = () => {
101
98
  const ua = navigator.userAgent;
102
99
  if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(ua)) {
@@ -391,12 +388,11 @@ const VviinnVpsWidget = class {
391
388
  state.locale = this.locale;
392
389
  this.cameraAvailable =
393
390
  !!navigator.mediaDevices && !!navigator.mediaDevices.getUserMedia;
394
- const campaignId = _function.pipe(this.campaignId, Option.fromNullable, Option.chain(Option.fromPredicate(notEmptyString)), Option.map(filterInt), Option.chain(Option.fromPredicate(notNan)), Option.map((s) => `${s}`));
395
391
  if (this.excluded) {
396
392
  this.excluded = parseExcluded(this.excluded);
397
393
  }
398
394
  searchState.token = this.token;
399
- searchState.campaignId = campaignId;
395
+ searchState.campaignId = this.campaignId;
400
396
  searchState.excluded = this.excluded;
401
397
  this.uiSessionId = v4();
402
398
  this.trackingApi = createTrackingApi(this.apiPath, this.token);
@@ -2,13 +2,6 @@ import { EventEmitter } from "../../stencil-public-runtime";
2
2
  import { BasicEventData, ProductCardEventData, SelectFilterEventData, SelectObjectEventData } from "../../recommendation/events";
3
3
  import { Locale } from "../../locale";
4
4
  /**
5
- * @slot vviinn-onboarding-title - Title of onboarding section.
6
- * @slot onboarding-card-1-icon - Icon (or other graphics) on the first onboarding slide.
7
- * @slot onboarding-card-1-text - Text content of first onboarding slide.
8
- * @slot onboarding-card-2-icon - Icon (or other graphics) on the second onboarding slide.
9
- * @slot onboarding-card-2-text - Text content of second onboarding slide.
10
- * @slot onboarding-card-3-icon - Icon (or other graphics) on the third onboarding slide.
11
- * @slot onboarding-card-3-text - Text content of third onboarding slide.
12
5
  * @slot vviinn-teaser-text - Text on widget's main screen.
13
6
  * @slot vviinn-image-upload-button-text - Title of Upload Button.
14
7
  * @slot vviinn-show-files-button-text - Title of Show Files Button.
@@ -28,13 +28,6 @@ type UploadSource = "uploadPhoto" | "startCamera";
28
28
  * @part title - Title inside Product Card.
29
29
  * @part text-search-input - Text search input.
30
30
 
31
- * @slot vviinn-onboarding-title - Title of onboarding section.
32
- * @slot onboarding-card-1-icon - Icon (or other graphics) on the first onboarding slide.
33
- * @slot onboarding-card-1-text - Text content of first onboarding slide.
34
- * @slot onboarding-card-2-icon - Icon (or other graphics) on the second onboarding slide.
35
- * @slot onboarding-card-2-text - Text content of second onboarding slide.
36
- * @slot onboarding-card-3-icon - Icon (or other graphics) on the third onboarding slide.
37
- * @slot onboarding-card-3-text - Text content of third onboarding slide.
38
31
  * @slot vviinn-teaser-text - Text on widget's main screen.
39
32
  * @slot vviinn-image-upload-button-text - Title of Upload Button.
40
33
  * @slot vviinn-image-upload-icon - Icon of Upload Button.
@@ -3,7 +3,6 @@ import { Link } from "../network/ion/Link";
3
3
  import { Form } from "../network/ion/Form";
4
4
  import { Recommendation } from "../recommendation/recommendation";
5
5
  import * as TE from "fp-ts/TaskEither";
6
- import * as O from "fp-ts/Option";
7
6
  import { RectangleAlt } from "../geometry/RectangleAlt";
8
7
  import { Eq } from "fp-ts/lib/Eq";
9
8
  import { BasicError } from "../error";
@@ -50,6 +49,6 @@ type ContainsHiresImageUpload = {
50
49
  };
51
50
  export type SearchSession = ValueObject<Recommendation[]> & HasFilters & Partial<ContainsDetectedObjects> & ContainsRectangleSearch & ContainsHiresImageUpload;
52
51
  export type ObjectsDetectedEvent = CustomEvent<ValueObject<DetectedObject>[]>;
53
- export declare const imageSearchSessionClient: (initialData: RequestInit, campaignId: O.Option<string>, excludedFilters: string) => TE.TaskEither<BasicError<Response | string>, SearchSession>;
52
+ export declare const imageSearchSessionClient: (initialData: RequestInit, campaignId: string, excludedFilters: string) => TE.TaskEither<BasicError<Response | string>, SearchSession>;
54
53
  export declare const textSearchSessionClient: (initialData: RequestInit) => TE.TaskEither<BasicError<Response | string>, TextSearchSession>;
55
54
  export {};
@@ -11,7 +11,7 @@ import { Handler } from "../cropper/Handler";
11
11
  import { BasicError } from "../error";
12
12
  type SearchStore = {
13
13
  token?: string;
14
- campaignId: O.Option<string>;
14
+ campaignId?: string;
15
15
  excluded?: string;
16
16
  results: Recommendation[];
17
17
  filters: SearchSessionFilter[];