vviinn-widgets 2.7.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Handler.js +270 -0
- package/dist/components/NonEmptyArray.js +5699 -0
- package/dist/components/cropper-handler.js +6 -0
- package/dist/components/cropper-handler2.js +39 -0
- package/dist/{cjs/customized-slots-06ca4007.js → components/customized-slots.js} +3 -6
- package/dist/components/highlight-box.js +6 -0
- package/dist/components/highlight-box2.js +52 -0
- package/dist/components/image-cropper.js +6 -0
- package/dist/components/image-cropper2.js +138 -0
- package/dist/components/imageSearch.store.js +10686 -0
- package/dist/components/index.js +1 -0
- package/dist/{esm/index-443468c7.js → components/index2.js} +2 -2
- package/dist/components/index3.js +130 -0
- package/dist/components/recommendations-sidebar.js +101 -0
- package/dist/components/resizer.worker.js +11 -0
- package/dist/components/search-filters.js +6 -0
- package/dist/components/search-filters2.js +89 -0
- package/dist/components/tracking.worker.js +11 -0
- package/dist/components/vviinn-carousel.js +6 -0
- package/dist/components/vviinn-carousel2.js +235 -0
- package/dist/components/vviinn-detected-object.js +6 -0
- package/dist/components/vviinn-detected-object2.js +67 -0
- package/dist/components/vviinn-empty-results.js +6 -0
- package/dist/components/vviinn-empty-results2.js +35 -0
- package/dist/components/vviinn-error.js +6 -0
- package/dist/components/vviinn-error2.js +28 -0
- package/dist/components/vviinn-example-image.js +6 -0
- package/dist/components/vviinn-example-image2.js +57 -0
- package/dist/components/vviinn-example-images.js +6 -0
- package/dist/components/vviinn-example-images2.js +53 -0
- package/dist/components/vviinn-image-selector.js +6 -0
- package/dist/components/vviinn-image-selector2.js +135 -0
- package/dist/components/vviinn-image-view.js +6 -0
- package/dist/components/vviinn-image-view2.js +95 -0
- package/dist/components/vviinn-modal.js +6 -0
- package/dist/components/vviinn-modal2.js +46 -0
- package/dist/components/vviinn-onboarding-card-1.js +6 -0
- package/dist/components/vviinn-onboarding-card-12.js +34 -0
- package/dist/components/vviinn-onboarding-card-2.js +6 -0
- package/dist/components/vviinn-onboarding-card-22.js +34 -0
- package/dist/components/vviinn-onboarding-card-3.js +6 -0
- package/dist/components/vviinn-onboarding-card-32.js +34 -0
- package/dist/components/vviinn-onboarding.js +6 -0
- package/dist/components/vviinn-onboarding2.js +63 -0
- package/dist/components/vviinn-overlay.js +6 -0
- package/dist/components/vviinn-overlay2.js +28 -0
- package/dist/components/vviinn-overlayed-modal.js +6 -0
- package/dist/components/vviinn-overlayed-modal2.js +45 -0
- package/dist/components/vviinn-preloader.js +6 -0
- package/dist/components/vviinn-preloader2.js +34 -0
- package/dist/components/vviinn-privacy-badge.js +6 -0
- package/dist/components/vviinn-privacy-badge2.js +33 -0
- package/dist/components/vviinn-product-card.js +6 -0
- package/dist/components/vviinn-product-card2.js +216 -0
- package/dist/components/vviinn-recommendations-sidebar.js +6 -0
- package/dist/components/vviinn-server-error.js +6 -0
- package/dist/components/vviinn-server-error2.js +35 -0
- package/dist/components/vviinn-slide.js +6 -0
- package/dist/components/vviinn-slide2.js +28 -0
- package/dist/components/vviinn-slider.js +6 -0
- package/dist/components/vviinn-slider2.js +159 -0
- package/dist/components/vviinn-teaser.js +6 -0
- package/dist/components/vviinn-teaser2.js +33 -0
- package/dist/components/vviinn-vpr-button.js +93 -0
- package/dist/components/vviinn-vpr-vidget.js +3360 -0
- package/dist/components/vviinn-vpr-widget.js +6 -0
- package/dist/components/vviinn-vps-button.js +224 -0
- package/dist/components/vviinn-vps-widget.js +6 -0
- package/dist/components/vviinn-vps-widget2.js +350 -0
- package/dist/components/vviinn-wrong-format.js +6 -0
- package/dist/components/vviinn-wrong-format2.js +35 -0
- package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +1 -0
- package/dist/types/components/vviinn-vpr-button/stories/lol.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +1 -1
- package/dist/vviinn-widgets/Array-bdfc75db.js +4870 -0
- package/dist/vviinn-widgets/Handler-edcb46f4.js +1422 -0
- package/dist/vviinn-widgets/NonEmptyArray-947ab7b3.js +4411 -0
- package/dist/{esm/app-globals-865bc7a7.js → vviinn-widgets/app-globals-c0aa8ec3.js} +922 -10
- package/dist/vviinn-widgets/cropper-handler.entry.js +23 -0
- package/dist/vviinn-widgets/css-shim-f0027935.js +4 -0
- package/dist/{esm/customized-slots-96902edf.js → vviinn-widgets/customized-slots-5c1c623a.js} +1 -1
- package/dist/vviinn-widgets/dom-db0073f0.js +73 -0
- package/dist/vviinn-widgets/highlight-box.entry.js +41 -0
- package/dist/{collection/components/image-search/image-view/image-cropper/image-cropper.js → vviinn-widgets/image-cropper.entry.js} +33 -70
- package/dist/{cjs/index-df6896e2.js → vviinn-widgets/imageSearch.store-0eed9a5c.js} +11598 -15320
- package/dist/{esm/index-2fdd499d.js → vviinn-widgets/imageSearch.store-b28bddb0.js} +11971 -15281
- package/dist/{collection/components/vviinn-icons/index.js → vviinn-widgets/index-44058ea2.js} +14 -11
- package/dist/vviinn-widgets/index-6c6de682.js +3857 -0
- package/dist/vviinn-widgets/index-de3e14da.js +3010 -0
- package/dist/vviinn-widgets/index.esm.js +1 -0
- package/dist/vviinn-widgets/number-171db649.js +1499 -0
- package/dist/vviinn-widgets/search-filters.entry.js +76 -0
- package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +389 -0
- package/dist/{collection/components/vviinn-carousel/vviinn-carousel.js → vviinn-widgets/vviinn-carousel.entry.js} +18 -113
- package/dist/vviinn-widgets/vviinn-detected-object.entry.js +54 -0
- package/dist/vviinn-widgets/vviinn-empty-results.entry.js +16 -0
- package/dist/vviinn-widgets/vviinn-error.entry.js +15 -0
- package/dist/vviinn-widgets/vviinn-example-image.entry.js +38 -0
- package/dist/vviinn-widgets/vviinn-example-images.entry.js +28 -0
- package/dist/vviinn-widgets/vviinn-image-selector.entry.js +31 -0
- package/dist/vviinn-widgets/vviinn-image-view.entry.js +55 -0
- package/dist/vviinn-widgets/vviinn-modal.entry.js +30 -0
- package/dist/vviinn-widgets/vviinn-onboarding-card-1.entry.js +21 -0
- package/dist/vviinn-widgets/vviinn-onboarding-card-2.entry.js +21 -0
- package/dist/vviinn-widgets/vviinn-onboarding-card-3.entry.js +21 -0
- package/dist/vviinn-widgets/vviinn-onboarding.entry.js +20 -0
- package/dist/vviinn-widgets/vviinn-overlay.entry.js +15 -0
- package/dist/vviinn-widgets/vviinn-overlayed-modal.entry.js +18 -0
- package/dist/vviinn-widgets/vviinn-preloader.entry.js +25 -0
- package/dist/vviinn-widgets/vviinn-privacy-badge.entry.js +20 -0
- package/dist/vviinn-widgets/vviinn-product-card.entry.js +188 -0
- package/dist/{esm → vviinn-widgets}/vviinn-recommendations-sidebar.entry.js +2 -2
- package/dist/vviinn-widgets/vviinn-server-error.entry.js +16 -0
- package/dist/vviinn-widgets/vviinn-slide.entry.js +15 -0
- package/dist/vviinn-widgets/vviinn-slider.entry.js +120 -0
- package/dist/vviinn-widgets/vviinn-teaser.entry.js +20 -0
- package/dist/{esm → vviinn-widgets}/vviinn-vpr-button.entry.js +2 -2
- package/dist/vviinn-widgets/vviinn-vpr-widget.entry.js +4588 -0
- package/dist/{esm → vviinn-widgets}/vviinn-vps-button.entry.js +3 -3
- package/dist/vviinn-widgets/vviinn-vps-widget.entry.js +170 -0
- package/dist/vviinn-widgets/vviinn-widgets.css +6 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +125 -1
- package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +16 -0
- package/package.json +8 -2
- package/www/build/p-06c76b5e.js +1 -0
- package/www/build/p-07e16d04.js +15 -0
- package/{dist/vviinn-widgets/p-a6e0710f.entry.js → www/build/p-44bc50de.entry.js} +1 -1
- package/www/build/p-510922c6.js +1 -0
- package/www/build/p-57ce8de3.css +1 -0
- package/www/build/p-591cb193.entry.js +1 -0
- package/www/build/p-6b9d242e.js +1 -0
- package/www/build/p-880bccf1.js +1 -0
- package/www/build/p-b0ada114.entry.js +1 -0
- package/www/build/p-b7be7c70.entry.js +1 -0
- package/{dist/vviinn-widgets/p-166970f3.js → www/build/p-ea8dea5c.js} +1 -1
- package/www/build/vviinn-widgets.css +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +32261 -1
- package/www/sw.js +66 -0
- package/dist/cjs/app-globals-8db3bcbe.js +0 -6912
- package/dist/cjs/cropper-handler_27.cjs.entry.js +0 -1135
- package/dist/cjs/index-3c3ab815.js +0 -1354
- package/dist/cjs/index-f66cd8d1.js +0 -39
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/loader.cjs.js +0 -23
- package/dist/cjs/vviinn-carousel_2.cjs.entry.js +0 -1001
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +0 -65
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +0 -49
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +0 -43
- package/dist/cjs/vviinn-widgets.cjs.js +0 -21
- package/dist/collection/Image/error.js +0 -14
- package/dist/collection/Image/form.js +0 -5
- package/dist/collection/Image/fromFile.js +0 -18
- package/dist/collection/Image/imageToB64.js +0 -9
- package/dist/collection/Image/index.js +0 -0
- package/dist/collection/Image/renderPromise.js +0 -6
- package/dist/collection/Image/resizeImage.js +0 -28
- package/dist/collection/Image/sizing.js +0 -39
- package/dist/collection/Image/toFile.js +0 -17
- package/dist/collection/analytics/GAnalytics.js +0 -32
- package/dist/collection/analytics/GeneralAnalytics.js +0 -9
- package/dist/collection/analytics/GtagAnalytics.js +0 -35
- package/dist/collection/analytics/ProductAnalytics.js +0 -1
- package/dist/collection/campaign/Campaign.js +0 -8
- package/dist/collection/campaign/CampaignService.js +0 -5
- package/dist/collection/campaign/VCSCampaign.js +0 -1
- package/dist/collection/campaign/VCSCampaignResponse.js +0 -1
- package/dist/collection/campaign/VCSCampaignService.js +0 -7
- package/dist/collection/campaign/VPRCampaignResponse.js +0 -1
- package/dist/collection/campaign/VPRCampaignService.js +0 -7
- package/dist/collection/collection-manifest.json +0 -43
- package/dist/collection/components/customized-slots.js +0 -47
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +0 -71
- package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +0 -25
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +0 -49
- package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +0 -64
- package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.css +0 -33
- package/dist/collection/components/image-search/search-filters/search-filters.css +0 -120
- package/dist/collection/components/image-search/search-filters/search-filters.js +0 -125
- package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +0 -142
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +0 -7
- package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +0 -36
- package/dist/collection/components/vviinn-error/vviinn-error.css +0 -38
- package/dist/collection/components/vviinn-error/vviinn-error.js +0 -18
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +0 -3
- package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +0 -34
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.css +0 -3
- package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +0 -34
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.css +0 -34
- package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +0 -129
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.css +0 -19
- package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +0 -80
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +0 -25
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +0 -64
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +0 -47
- package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +0 -100
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +0 -31
- package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +0 -61
- package/dist/collection/components/vviinn-modal/vviinn-modal.css +0 -105
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +0 -98
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/onboarding-card.css +0 -41
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +0 -26
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +0 -26
- package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +0 -26
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.css +0 -58
- package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +0 -28
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +0 -33
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +0 -15
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.css +0 -29
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +0 -71
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +0 -37
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +0 -20
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +0 -19
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +0 -27
- package/dist/collection/components/vviinn-product-card/render-helpers.js +0 -32
- package/dist/collection/components/vviinn-product-card/stories/args.js +0 -73
- package/dist/collection/components/vviinn-product-card/stories/decorators.js +0 -51
- package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +0 -105
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +0 -95
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +0 -462
- package/dist/collection/components/vviinn-slider/arrow.js +0 -11
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.css +0 -4
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +0 -15
- package/dist/collection/components/vviinn-slider/vviinn-slider.css +0 -109
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +0 -181
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.css +0 -14
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +0 -29
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +0 -238
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +0 -220
- package/dist/collection/components/vviinn-vpr-button/stories/args.js +0 -213
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +0 -91
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +0 -35
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +0 -179
- package/dist/collection/components/vviinn-vpr-widget/stories/args.js +0 -197
- package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +0 -29
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +0 -211
- package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +0 -11
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +0 -510
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +0 -79
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +0 -35
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +0 -3
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +0 -195
- package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +0 -37
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +0 -350
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +0 -375
- package/dist/collection/cropper/Cropper.js +0 -1
- package/dist/collection/cropper/Handler.js +0 -61
- package/dist/collection/dom/index.js +0 -3
- package/dist/collection/error.js +0 -14
- package/dist/collection/file/index.js +0 -4
- package/dist/collection/geometry/Clip.js +0 -14
- package/dist/collection/geometry/Point.js +0 -32
- package/dist/collection/geometry/Rectangle.js +0 -95
- package/dist/collection/geometry/RectangleAlt.js +0 -1
- package/dist/collection/geometry/Sized.js +0 -8
- package/dist/collection/global.js +0 -19
- package/dist/collection/index.js +0 -1
- package/dist/collection/interfaces/generated.js +0 -5
- package/dist/collection/interfaces/recommendation.js +0 -1
- package/dist/collection/network/apiClient.js +0 -9
- package/dist/collection/network/ion/File.js +0 -14
- package/dist/collection/network/ion/Form.js +0 -64
- package/dist/collection/network/ion/Link.js +0 -8
- package/dist/collection/network/ion/ValueObject.js +0 -23
- package/dist/collection/network/request.js +0 -19
- package/dist/collection/network/utils.js +0 -37
- package/dist/collection/openApi/index.js +0 -27
- package/dist/collection/recommendation/events.js +0 -1
- package/dist/collection/recommendation/recommendation.js +0 -1
- package/dist/collection/searchSession/searchSession.js +0 -31
- package/dist/collection/sentry.js +0 -14
- package/dist/collection/slider/GridMode.js +0 -1
- package/dist/collection/store/file-processing.js +0 -13
- package/dist/collection/store/imageSearch.store.js +0 -133
- package/dist/collection/store/store.js +0 -3
- package/dist/collection/store/tracking.store.js +0 -3
- package/dist/collection/stories/Button.js +0 -21
- package/dist/collection/stories/Button.stories.js +0 -42
- package/dist/collection/stories/Header.js +0 -45
- package/dist/collection/stories/Header.stories.js +0 -15
- package/dist/collection/stories/Page.js +0 -61
- package/dist/collection/stories/Page.stories.js +0 -19
- package/dist/collection/stories/assets/code-brackets.svg +0 -1
- package/dist/collection/stories/assets/colors.svg +0 -1
- package/dist/collection/stories/assets/comments.svg +0 -1
- package/dist/collection/stories/assets/direction.svg +0 -1
- package/dist/collection/stories/assets/flow.svg +0 -1
- package/dist/collection/stories/assets/plugin.svg +0 -1
- package/dist/collection/stories/assets/repo.svg +0 -1
- package/dist/collection/stories/assets/stackalt.svg +0 -1
- package/dist/collection/stories/image-selector.stories.js +0 -6
- package/dist/collection/stories/image-view.stories.js +0 -6
- package/dist/collection/stories/modal.stories.js +0 -12
- package/dist/collection/stories/onboarding.stories.js +0 -11
- package/dist/collection/stories/overlay.stories.js +0 -5
- package/dist/collection/stories/overlayedModal.stories.js +0 -8
- package/dist/collection/stories/privacy-badge.stories.js +0 -11
- package/dist/collection/stories/slider.stories.js +0 -17
- package/dist/collection/stories/teaser.stories.js +0 -5
- package/dist/collection/stories/vps-widget.stories.js +0 -47
- package/dist/collection/stories/vviinn-product.stories.js +0 -19
- package/dist/collection/tracking/event.js +0 -3
- package/dist/collection/tracking/filter.js +0 -5
- package/dist/collection/tracking/index.js +0 -13
- package/dist/collection/tracking/models.js +0 -6
- package/dist/collection/tracking/product.js +0 -18
- package/dist/collection/tracking/search.js +0 -5
- package/dist/collection/tracking/widget.js +0 -10
- package/dist/collection/utils/collections/collectionsUtils.js +0 -5
- package/dist/collection/utils/either.js +0 -3
- package/dist/collection/utils/enum/enumUtils.js +0 -3
- package/dist/collection/utils/event/Events.js +0 -1
- package/dist/collection/utils/number/index.js +0 -4
- package/dist/collection/utils/option/option.js +0 -4
- package/dist/collection/utils/semigroup/semigroupDiff.js +0 -6
- package/dist/collection/utils/token/tokenUtils.js +0 -9
- package/dist/esm/cropper-handler_27.entry.js +0 -1105
- package/dist/esm/index-51f71d18.js +0 -1323
- package/dist/esm/index.js +0 -1
- package/dist/esm/loader.js +0 -19
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/vviinn-carousel_2.entry.js +0 -996
- package/dist/esm/vviinn-widgets.js +0 -19
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -3
- package/dist/loader/index.cjs.js +0 -3
- package/dist/loader/index.d.ts +0 -12
- package/dist/loader/index.es2017.js +0 -3
- package/dist/loader/index.js +0 -4
- package/dist/loader/package.json +0 -10
- package/dist/vviinn-widgets/p-2dd35f19.entry.js +0 -1
- package/dist/vviinn-widgets/p-3469b71a.js +0 -1
- package/dist/vviinn-widgets/p-40bea5b5.entry.js +0 -1
- package/dist/vviinn-widgets/p-465d043d.js +0 -15
- package/dist/vviinn-widgets/p-59bd2a99.js +0 -1
- package/dist/vviinn-widgets/p-74ed36af.entry.js +0 -1
- package/dist/vviinn-widgets/p-9def6b8b.entry.js +0 -1
- package/dist/vviinn-widgets/p-cd995515.js +0 -1
- package/www/build/p-166970f3.js +0 -1
- package/www/build/p-2dd35f19.entry.js +0 -1
- package/www/build/p-3469b71a.js +0 -1
- package/www/build/p-40bea5b5.entry.js +0 -1
- package/www/build/p-465d043d.js +0 -15
- package/www/build/p-59bd2a99.js +0 -1
- package/www/build/p-61933b75.js +0 -1
- package/www/build/p-74ed36af.entry.js +0 -1
- package/www/build/p-9def6b8b.entry.js +0 -1
- package/www/build/p-a67898be.css +0 -1
- package/www/build/p-a6e0710f.entry.js +0 -1
- package/www/build/p-cd995515.js +0 -1
- package/www/favicon.ico +0 -0
|
@@ -1,1001 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-3c3ab815.js');
|
|
6
|
-
const index$1 = require('./index-df6896e2.js');
|
|
7
|
-
const index$2 = require('./index-f66cd8d1.js');
|
|
8
|
-
|
|
9
|
-
const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
|
|
10
|
-
|
|
11
|
-
const COLUMNS_NUMBER_CSS_VAR = "--vviinn-carousel-columns-internal";
|
|
12
|
-
const CAROUSEL_WIDTH_CSS_VAR = "--vviinn-carousel-content-width";
|
|
13
|
-
const CAROUSEL_IMAGE_WIDTH_CSS_VAR = "--vviinn-carousel-image-width";
|
|
14
|
-
const CONTENT_GROUP_CSS_CLASS = "items-group";
|
|
15
|
-
let VviinnCarousel = class {
|
|
16
|
-
constructor(hostRef) {
|
|
17
|
-
index.registerInstance(this, hostRef);
|
|
18
|
-
this.moveDirection = "right";
|
|
19
|
-
this.contentGroups = [];
|
|
20
|
-
this.activeContentGroup = 0;
|
|
21
|
-
this.mode = "continuity";
|
|
22
|
-
this.imageWidth = 140;
|
|
23
|
-
this.showScroll = true;
|
|
24
|
-
this.recommendations = [];
|
|
25
|
-
this.columns = 0;
|
|
26
|
-
this.resizeObserver = new ResizeObserver(() => this.handleResize());
|
|
27
|
-
this.mutationObserver = new MutationObserver(() => this.cloneSlottedContent());
|
|
28
|
-
}
|
|
29
|
-
connectedCallback() {
|
|
30
|
-
this.setItemWidth();
|
|
31
|
-
}
|
|
32
|
-
disconnectedCallback() {
|
|
33
|
-
this.resizeObserver.disconnect();
|
|
34
|
-
}
|
|
35
|
-
componentDidLoad() {
|
|
36
|
-
this.setWidth();
|
|
37
|
-
this.processScrollbarWidth();
|
|
38
|
-
this.columns = this.getColumnsNumber();
|
|
39
|
-
const slot = this.el.querySelector(".content");
|
|
40
|
-
this.mutationObserver.observe(slot, { subtree: true, childList: true });
|
|
41
|
-
this.resizeObserver.observe(this.getHostParent());
|
|
42
|
-
}
|
|
43
|
-
getItemWidthFromDocument() {
|
|
44
|
-
return parseInt(getComputedStyle(document.body).getPropertyValue(CAROUSEL_IMAGE_WIDTH_CSS_VAR));
|
|
45
|
-
}
|
|
46
|
-
setItemWidth() {
|
|
47
|
-
const widthInDocument = this.getItemWidthFromDocument();
|
|
48
|
-
const itemWidth = isNaN(widthInDocument)
|
|
49
|
-
? this.imageWidth
|
|
50
|
-
: widthInDocument;
|
|
51
|
-
this.el.style.setProperty(CAROUSEL_IMAGE_WIDTH_CSS_VAR, `${itemWidth}px`);
|
|
52
|
-
}
|
|
53
|
-
getContentClassMap() {
|
|
54
|
-
return {
|
|
55
|
-
content: true,
|
|
56
|
-
[this.moveDirection]: true,
|
|
57
|
-
[this.mode]: true,
|
|
58
|
-
"show-scrollbar": this.showScroll,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
handleResize() {
|
|
62
|
-
this.setWidth();
|
|
63
|
-
this.processScrollbarWidth();
|
|
64
|
-
this.setItemWidth();
|
|
65
|
-
const newColumns = this.getColumnsNumber();
|
|
66
|
-
if (newColumns !== this.columns) {
|
|
67
|
-
this.columns = newColumns;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
calculateMoveStep() {
|
|
71
|
-
const contentWidths = this.getContent().map((el) => el.getBoundingClientRect().width);
|
|
72
|
-
const sum = contentWidths.reduce((acc, val) => acc + val, 0);
|
|
73
|
-
return sum / contentWidths.length;
|
|
74
|
-
}
|
|
75
|
-
getHostParent() {
|
|
76
|
-
const parent = this.el.parentNode;
|
|
77
|
-
return parent.host.parentElement;
|
|
78
|
-
}
|
|
79
|
-
setWidth() {
|
|
80
|
-
const parent = this.getHostParent();
|
|
81
|
-
if (!parent)
|
|
82
|
-
return;
|
|
83
|
-
const parentStyles = getComputedStyle(parent);
|
|
84
|
-
const parentWidth = parent.getBoundingClientRect().width;
|
|
85
|
-
const width = parentWidth -
|
|
86
|
-
(parseInt(parentStyles["padding-right"]) +
|
|
87
|
-
parseInt(parentStyles["padding-left"]));
|
|
88
|
-
this.el.style.setProperty(CAROUSEL_WIDTH_CSS_VAR, `${width}px`);
|
|
89
|
-
}
|
|
90
|
-
getParent() {
|
|
91
|
-
const parentNode = this.el.parentNode;
|
|
92
|
-
const host = parentNode.host;
|
|
93
|
-
return host.parentElement;
|
|
94
|
-
}
|
|
95
|
-
cloneSlottedContent() {
|
|
96
|
-
this.setWidth();
|
|
97
|
-
}
|
|
98
|
-
getActiveGroupIndex() {
|
|
99
|
-
var _a, _b;
|
|
100
|
-
const contentNodeLeft = (_b = (_a = this.getContentNode()) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.left;
|
|
101
|
-
if (!contentNodeLeft)
|
|
102
|
-
return 0;
|
|
103
|
-
const groups = this.getContentGroups();
|
|
104
|
-
const groupsPositions = groups.map((g) => g.getBoundingClientRect().left);
|
|
105
|
-
const indexedPositions = groupsPositions
|
|
106
|
-
.map((value, index) => [value, index])
|
|
107
|
-
.filter((x) => x[0] >= 0);
|
|
108
|
-
return indexedPositions.length > 0 ? indexedPositions[0][1] : 0;
|
|
109
|
-
}
|
|
110
|
-
getContentNode() {
|
|
111
|
-
return this.el.querySelector(".content");
|
|
112
|
-
}
|
|
113
|
-
getContent() {
|
|
114
|
-
const children = this.getContentNode().children;
|
|
115
|
-
return Array.from(children).map((c) => c);
|
|
116
|
-
}
|
|
117
|
-
getColumnsNumber() {
|
|
118
|
-
const styleSheet = getComputedStyle(this.el);
|
|
119
|
-
const columnsInCss = styleSheet.getPropertyValue(COLUMNS_NUMBER_CSS_VAR);
|
|
120
|
-
return parseInt(columnsInCss);
|
|
121
|
-
}
|
|
122
|
-
getContentGroups() {
|
|
123
|
-
return Array.from(this.el.querySelectorAll(`.${CONTENT_GROUP_CSS_CLASS}`));
|
|
124
|
-
}
|
|
125
|
-
showNext() {
|
|
126
|
-
this.moveDirection = "right";
|
|
127
|
-
const contentContainer = this.getContentNode();
|
|
128
|
-
requestAnimationFrame(() => {
|
|
129
|
-
contentContainer.scrollTo({
|
|
130
|
-
top: 0,
|
|
131
|
-
left: contentContainer.scrollLeft + this.calculateMoveStep(),
|
|
132
|
-
behavior: "smooth",
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
showPrev() {
|
|
137
|
-
this.moveDirection = "left";
|
|
138
|
-
const contentContainer = this.getContentNode();
|
|
139
|
-
requestAnimationFrame(() => {
|
|
140
|
-
contentContainer.scrollTo({
|
|
141
|
-
top: 0,
|
|
142
|
-
left: contentContainer.scrollLeft - this.calculateMoveStep(),
|
|
143
|
-
behavior: "smooth",
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
scroll(index) {
|
|
148
|
-
const contentContainer = this.getContentNode();
|
|
149
|
-
requestAnimationFrame(() => {
|
|
150
|
-
contentContainer.scrollTo({
|
|
151
|
-
top: 0,
|
|
152
|
-
left: this.calculateMoveStep() * index,
|
|
153
|
-
behavior: "smooth",
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
processScrollbarWidth() {
|
|
158
|
-
const target = this.getContentNode();
|
|
159
|
-
const scrollRatio = (target.scrollLeft + target.clientWidth) / target.scrollWidth;
|
|
160
|
-
const scrolledWidth = target.clientWidth * scrollRatio;
|
|
161
|
-
this.el.style.setProperty("--vviinn-progressbar-width", `${scrolledWidth}px`);
|
|
162
|
-
this.activeContentGroup = this.getActiveGroupIndex();
|
|
163
|
-
}
|
|
164
|
-
showBullets() {
|
|
165
|
-
return this.mode === "grid" && this.showScroll;
|
|
166
|
-
}
|
|
167
|
-
showScrollbar() {
|
|
168
|
-
return this.mode === "continuity" && this.showScroll;
|
|
169
|
-
}
|
|
170
|
-
getClassMap() {
|
|
171
|
-
return {
|
|
172
|
-
[this.mode]: true,
|
|
173
|
-
"show-scrollbar": this.showScrollbar(),
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
renderRecommendation(recommendation, rank) {
|
|
177
|
-
return (index.h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.mode === "continuity", index: rank }));
|
|
178
|
-
}
|
|
179
|
-
renderRecommendationGroup(elements) {
|
|
180
|
-
return index.h("div", { class: CONTENT_GROUP_CSS_CLASS }, elements);
|
|
181
|
-
}
|
|
182
|
-
renderRecommendationGroups(elements) {
|
|
183
|
-
return elements.map((el) => this.renderRecommendationGroup(el));
|
|
184
|
-
}
|
|
185
|
-
renderRecommendations() {
|
|
186
|
-
return this.mode === "grid"
|
|
187
|
-
? this.renderGrid()
|
|
188
|
-
: this.renderRecommendationsElements();
|
|
189
|
-
}
|
|
190
|
-
renderRecommendationsElements() {
|
|
191
|
-
return this.recommendations.map((r, i) => this.renderRecommendation(r, i));
|
|
192
|
-
}
|
|
193
|
-
renderGrid() {
|
|
194
|
-
const recommendations = this.renderRecommendationsElements();
|
|
195
|
-
const grouppedContent = index$1._Array.chunksOf(this.getColumnsNumber())(recommendations);
|
|
196
|
-
return this.renderRecommendationGroups(grouppedContent);
|
|
197
|
-
}
|
|
198
|
-
renderBullets() {
|
|
199
|
-
const numberOfBullets = Math.ceil(this.recommendations.length / this.getColumnsNumber());
|
|
200
|
-
const bulletsArray = Array.from(Array(numberOfBullets).keys());
|
|
201
|
-
return bulletsArray.map((index$1) => (index.h("div", { class: {
|
|
202
|
-
bullet: true,
|
|
203
|
-
active: this.activeContentGroup === index$1,
|
|
204
|
-
}, onClick: () => this.scroll(index$1) })));
|
|
205
|
-
}
|
|
206
|
-
render() {
|
|
207
|
-
return (index.h(index.Host, { class: this.getClassMap() }, index.h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, index.h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button" }, index.h(index$2.ChevronIcon, null)), index.h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), index.h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button" }, index.h(index$2.ChevronIcon, null))), this.showBullets() ? (index.h("div", { class: "bullets" }, this.renderBullets())) : ("")));
|
|
208
|
-
}
|
|
209
|
-
get el() { return index.getElement(this); }
|
|
210
|
-
};
|
|
211
|
-
VviinnCarousel.style = vviinnCarouselCss;
|
|
212
|
-
|
|
213
|
-
const createBearerString = (x) => `Bearer ${x}`;
|
|
214
|
-
const createAuthedHeader = (x) => new Headers({
|
|
215
|
-
Authorization: x,
|
|
216
|
-
});
|
|
217
|
-
const createFetchAuthOptions = (x) => {
|
|
218
|
-
return {
|
|
219
|
-
headers: x,
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
|
-
const createBearAuthedHeader = index$1._function.flow(createBearerString, createAuthedHeader, createFetchAuthOptions);
|
|
223
|
-
|
|
224
|
-
const isVPR = (c) => c._tag === "VPR";
|
|
225
|
-
function fold(onVPR, onVCS) {
|
|
226
|
-
return (c) => (isVPR(c) ? onVPR() : onVCS());
|
|
227
|
-
}
|
|
228
|
-
function fromString(s) {
|
|
229
|
-
return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
const sequenceToEither = index$1.sequenceT(index$1.Apply);
|
|
233
|
-
const apiGet = (path, data = {}) => index$1.pipe(sequenceToEither(index$1.getApiPath(), index$1.createInitGetRequest), index$1.fromEither, index$1.chainW(index$1.makeRequest(path, data)));
|
|
234
|
-
|
|
235
|
-
const getVPRRecommendations = (productId) => (campaigns) => (options) => {
|
|
236
|
-
const url = index$1._function.pipe(campaigns, index$1.map(encodeURIComponent), index$1.match$1(() => `product/${productId}/similar-products`, (encodedCampaignsIds) => `product/${productId}/similar-products?campaigns=${encodedCampaignsIds}`));
|
|
237
|
-
return apiGet(url, options);
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
const getVCSRecommendations = (productId) => (campaigns) => (options) => {
|
|
241
|
-
const url = index$1._function.pipe(campaigns, index$1.map(encodeURIComponent), index$1.match$1(() => `product/${productId}/cross-selling-products`, (encodedCampaignsIds) => `product/${productId}/cross-selling-products?campaigns=${encodedCampaignsIds}`));
|
|
242
|
-
return apiGet(url, options);
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
const getRecommendationsService = (campaignType) => index$1._function.pipe(fromString(campaignType), fold(() => getVPRRecommendations, () => getVCSRecommendations));
|
|
246
|
-
|
|
247
|
-
function isFunction(value) {
|
|
248
|
-
return typeof value === 'function';
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function createErrorClass(createImpl) {
|
|
252
|
-
const _super = (instance) => {
|
|
253
|
-
Error.call(instance);
|
|
254
|
-
instance.stack = new Error().stack;
|
|
255
|
-
};
|
|
256
|
-
const ctorFunc = createImpl(_super);
|
|
257
|
-
ctorFunc.prototype = Object.create(Error.prototype);
|
|
258
|
-
ctorFunc.prototype.constructor = ctorFunc;
|
|
259
|
-
return ctorFunc;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
const UnsubscriptionError = createErrorClass((_super) => function UnsubscriptionErrorImpl(errors) {
|
|
263
|
-
_super(this);
|
|
264
|
-
this.message = errors
|
|
265
|
-
? `${errors.length} errors occurred during unsubscription:
|
|
266
|
-
${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}`
|
|
267
|
-
: '';
|
|
268
|
-
this.name = 'UnsubscriptionError';
|
|
269
|
-
this.errors = errors;
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
function arrRemove(arr, item) {
|
|
273
|
-
if (arr) {
|
|
274
|
-
const index = arr.indexOf(item);
|
|
275
|
-
0 <= index && arr.splice(index, 1);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
class Subscription {
|
|
280
|
-
constructor(initialTeardown) {
|
|
281
|
-
this.initialTeardown = initialTeardown;
|
|
282
|
-
this.closed = false;
|
|
283
|
-
this._parentage = null;
|
|
284
|
-
this._finalizers = null;
|
|
285
|
-
}
|
|
286
|
-
unsubscribe() {
|
|
287
|
-
let errors;
|
|
288
|
-
if (!this.closed) {
|
|
289
|
-
this.closed = true;
|
|
290
|
-
const { _parentage } = this;
|
|
291
|
-
if (_parentage) {
|
|
292
|
-
this._parentage = null;
|
|
293
|
-
if (Array.isArray(_parentage)) {
|
|
294
|
-
for (const parent of _parentage) {
|
|
295
|
-
parent.remove(this);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
_parentage.remove(this);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
const { initialTeardown: initialFinalizer } = this;
|
|
303
|
-
if (isFunction(initialFinalizer)) {
|
|
304
|
-
try {
|
|
305
|
-
initialFinalizer();
|
|
306
|
-
}
|
|
307
|
-
catch (e) {
|
|
308
|
-
errors = e instanceof UnsubscriptionError ? e.errors : [e];
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
const { _finalizers } = this;
|
|
312
|
-
if (_finalizers) {
|
|
313
|
-
this._finalizers = null;
|
|
314
|
-
for (const finalizer of _finalizers) {
|
|
315
|
-
try {
|
|
316
|
-
execFinalizer(finalizer);
|
|
317
|
-
}
|
|
318
|
-
catch (err) {
|
|
319
|
-
errors = errors !== null && errors !== void 0 ? errors : [];
|
|
320
|
-
if (err instanceof UnsubscriptionError) {
|
|
321
|
-
errors = [...errors, ...err.errors];
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
errors.push(err);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
if (errors) {
|
|
330
|
-
throw new UnsubscriptionError(errors);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
add(teardown) {
|
|
335
|
-
var _a;
|
|
336
|
-
if (teardown && teardown !== this) {
|
|
337
|
-
if (this.closed) {
|
|
338
|
-
execFinalizer(teardown);
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
if (teardown instanceof Subscription) {
|
|
342
|
-
if (teardown.closed || teardown._hasParent(this)) {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
teardown._addParent(this);
|
|
346
|
-
}
|
|
347
|
-
(this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
_hasParent(parent) {
|
|
352
|
-
const { _parentage } = this;
|
|
353
|
-
return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
|
|
354
|
-
}
|
|
355
|
-
_addParent(parent) {
|
|
356
|
-
const { _parentage } = this;
|
|
357
|
-
this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
|
|
358
|
-
}
|
|
359
|
-
_removeParent(parent) {
|
|
360
|
-
const { _parentage } = this;
|
|
361
|
-
if (_parentage === parent) {
|
|
362
|
-
this._parentage = null;
|
|
363
|
-
}
|
|
364
|
-
else if (Array.isArray(_parentage)) {
|
|
365
|
-
arrRemove(_parentage, parent);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
remove(teardown) {
|
|
369
|
-
const { _finalizers } = this;
|
|
370
|
-
_finalizers && arrRemove(_finalizers, teardown);
|
|
371
|
-
if (teardown instanceof Subscription) {
|
|
372
|
-
teardown._removeParent(this);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
Subscription.EMPTY = (() => {
|
|
377
|
-
const empty = new Subscription();
|
|
378
|
-
empty.closed = true;
|
|
379
|
-
return empty;
|
|
380
|
-
})();
|
|
381
|
-
const EMPTY_SUBSCRIPTION = Subscription.EMPTY;
|
|
382
|
-
function isSubscription(value) {
|
|
383
|
-
return (value instanceof Subscription ||
|
|
384
|
-
(value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));
|
|
385
|
-
}
|
|
386
|
-
function execFinalizer(finalizer) {
|
|
387
|
-
if (isFunction(finalizer)) {
|
|
388
|
-
finalizer();
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
finalizer.unsubscribe();
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
const config = {
|
|
396
|
-
onUnhandledError: null,
|
|
397
|
-
onStoppedNotification: null,
|
|
398
|
-
Promise: undefined,
|
|
399
|
-
useDeprecatedSynchronousErrorHandling: false,
|
|
400
|
-
useDeprecatedNextContext: false,
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
const timeoutProvider = {
|
|
404
|
-
setTimeout(handler, timeout, ...args) {
|
|
405
|
-
const { delegate } = timeoutProvider;
|
|
406
|
-
if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {
|
|
407
|
-
return delegate.setTimeout(handler, timeout, ...args);
|
|
408
|
-
}
|
|
409
|
-
return setTimeout(handler, timeout, ...args);
|
|
410
|
-
},
|
|
411
|
-
clearTimeout(handle) {
|
|
412
|
-
const { delegate } = timeoutProvider;
|
|
413
|
-
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
|
|
414
|
-
},
|
|
415
|
-
delegate: undefined,
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
function reportUnhandledError(err) {
|
|
419
|
-
timeoutProvider.setTimeout(() => {
|
|
420
|
-
const { onUnhandledError } = config;
|
|
421
|
-
if (onUnhandledError) {
|
|
422
|
-
onUnhandledError(err);
|
|
423
|
-
}
|
|
424
|
-
else {
|
|
425
|
-
throw err;
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
function noop() { }
|
|
431
|
-
|
|
432
|
-
const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))();
|
|
433
|
-
function errorNotification(error) {
|
|
434
|
-
return createNotification('E', undefined, error);
|
|
435
|
-
}
|
|
436
|
-
function nextNotification(value) {
|
|
437
|
-
return createNotification('N', value, undefined);
|
|
438
|
-
}
|
|
439
|
-
function createNotification(kind, value, error) {
|
|
440
|
-
return {
|
|
441
|
-
kind,
|
|
442
|
-
value,
|
|
443
|
-
error,
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
function errorContext(cb) {
|
|
448
|
-
{
|
|
449
|
-
cb();
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
class Subscriber extends Subscription {
|
|
454
|
-
constructor(destination) {
|
|
455
|
-
super();
|
|
456
|
-
this.isStopped = false;
|
|
457
|
-
if (destination) {
|
|
458
|
-
this.destination = destination;
|
|
459
|
-
if (isSubscription(destination)) {
|
|
460
|
-
destination.add(this);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
else {
|
|
464
|
-
this.destination = EMPTY_OBSERVER;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
static create(next, error, complete) {
|
|
468
|
-
return new SafeSubscriber(next, error, complete);
|
|
469
|
-
}
|
|
470
|
-
next(value) {
|
|
471
|
-
if (this.isStopped) {
|
|
472
|
-
handleStoppedNotification(nextNotification(value), this);
|
|
473
|
-
}
|
|
474
|
-
else {
|
|
475
|
-
this._next(value);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
error(err) {
|
|
479
|
-
if (this.isStopped) {
|
|
480
|
-
handleStoppedNotification(errorNotification(err), this);
|
|
481
|
-
}
|
|
482
|
-
else {
|
|
483
|
-
this.isStopped = true;
|
|
484
|
-
this._error(err);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
complete() {
|
|
488
|
-
if (this.isStopped) {
|
|
489
|
-
handleStoppedNotification(COMPLETE_NOTIFICATION, this);
|
|
490
|
-
}
|
|
491
|
-
else {
|
|
492
|
-
this.isStopped = true;
|
|
493
|
-
this._complete();
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
unsubscribe() {
|
|
497
|
-
if (!this.closed) {
|
|
498
|
-
this.isStopped = true;
|
|
499
|
-
super.unsubscribe();
|
|
500
|
-
this.destination = null;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
_next(value) {
|
|
504
|
-
this.destination.next(value);
|
|
505
|
-
}
|
|
506
|
-
_error(err) {
|
|
507
|
-
try {
|
|
508
|
-
this.destination.error(err);
|
|
509
|
-
}
|
|
510
|
-
finally {
|
|
511
|
-
this.unsubscribe();
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
_complete() {
|
|
515
|
-
try {
|
|
516
|
-
this.destination.complete();
|
|
517
|
-
}
|
|
518
|
-
finally {
|
|
519
|
-
this.unsubscribe();
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
const _bind = Function.prototype.bind;
|
|
524
|
-
function bind(fn, thisArg) {
|
|
525
|
-
return _bind.call(fn, thisArg);
|
|
526
|
-
}
|
|
527
|
-
class ConsumerObserver {
|
|
528
|
-
constructor(partialObserver) {
|
|
529
|
-
this.partialObserver = partialObserver;
|
|
530
|
-
}
|
|
531
|
-
next(value) {
|
|
532
|
-
const { partialObserver } = this;
|
|
533
|
-
if (partialObserver.next) {
|
|
534
|
-
try {
|
|
535
|
-
partialObserver.next(value);
|
|
536
|
-
}
|
|
537
|
-
catch (error) {
|
|
538
|
-
handleUnhandledError(error);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
error(err) {
|
|
543
|
-
const { partialObserver } = this;
|
|
544
|
-
if (partialObserver.error) {
|
|
545
|
-
try {
|
|
546
|
-
partialObserver.error(err);
|
|
547
|
-
}
|
|
548
|
-
catch (error) {
|
|
549
|
-
handleUnhandledError(error);
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
else {
|
|
553
|
-
handleUnhandledError(err);
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
complete() {
|
|
557
|
-
const { partialObserver } = this;
|
|
558
|
-
if (partialObserver.complete) {
|
|
559
|
-
try {
|
|
560
|
-
partialObserver.complete();
|
|
561
|
-
}
|
|
562
|
-
catch (error) {
|
|
563
|
-
handleUnhandledError(error);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
class SafeSubscriber extends Subscriber {
|
|
569
|
-
constructor(observerOrNext, error, complete) {
|
|
570
|
-
super();
|
|
571
|
-
let partialObserver;
|
|
572
|
-
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
573
|
-
partialObserver = {
|
|
574
|
-
next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined,
|
|
575
|
-
error: error !== null && error !== void 0 ? error : undefined,
|
|
576
|
-
complete: complete !== null && complete !== void 0 ? complete : undefined,
|
|
577
|
-
};
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
let context;
|
|
581
|
-
if (this && config.useDeprecatedNextContext) {
|
|
582
|
-
context = Object.create(observerOrNext);
|
|
583
|
-
context.unsubscribe = () => this.unsubscribe();
|
|
584
|
-
partialObserver = {
|
|
585
|
-
next: observerOrNext.next && bind(observerOrNext.next, context),
|
|
586
|
-
error: observerOrNext.error && bind(observerOrNext.error, context),
|
|
587
|
-
complete: observerOrNext.complete && bind(observerOrNext.complete, context),
|
|
588
|
-
};
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
partialObserver = observerOrNext;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
this.destination = new ConsumerObserver(partialObserver);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
function handleUnhandledError(error) {
|
|
598
|
-
{
|
|
599
|
-
reportUnhandledError(error);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
function defaultErrorHandler(err) {
|
|
603
|
-
throw err;
|
|
604
|
-
}
|
|
605
|
-
function handleStoppedNotification(notification, subscriber) {
|
|
606
|
-
const { onStoppedNotification } = config;
|
|
607
|
-
onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));
|
|
608
|
-
}
|
|
609
|
-
const EMPTY_OBSERVER = {
|
|
610
|
-
closed: true,
|
|
611
|
-
next: noop,
|
|
612
|
-
error: defaultErrorHandler,
|
|
613
|
-
complete: noop,
|
|
614
|
-
};
|
|
615
|
-
|
|
616
|
-
const observable = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();
|
|
617
|
-
|
|
618
|
-
function identity(x) {
|
|
619
|
-
return x;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
function pipeFromArray(fns) {
|
|
623
|
-
if (fns.length === 0) {
|
|
624
|
-
return identity;
|
|
625
|
-
}
|
|
626
|
-
if (fns.length === 1) {
|
|
627
|
-
return fns[0];
|
|
628
|
-
}
|
|
629
|
-
return function piped(input) {
|
|
630
|
-
return fns.reduce((prev, fn) => fn(prev), input);
|
|
631
|
-
};
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
class Observable {
|
|
635
|
-
constructor(subscribe) {
|
|
636
|
-
if (subscribe) {
|
|
637
|
-
this._subscribe = subscribe;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
lift(operator) {
|
|
641
|
-
const observable = new Observable();
|
|
642
|
-
observable.source = this;
|
|
643
|
-
observable.operator = operator;
|
|
644
|
-
return observable;
|
|
645
|
-
}
|
|
646
|
-
subscribe(observerOrNext, error, complete) {
|
|
647
|
-
const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
|
|
648
|
-
errorContext(() => {
|
|
649
|
-
const { operator, source } = this;
|
|
650
|
-
subscriber.add(operator
|
|
651
|
-
?
|
|
652
|
-
operator.call(subscriber, source)
|
|
653
|
-
: source
|
|
654
|
-
?
|
|
655
|
-
this._subscribe(subscriber)
|
|
656
|
-
:
|
|
657
|
-
this._trySubscribe(subscriber));
|
|
658
|
-
});
|
|
659
|
-
return subscriber;
|
|
660
|
-
}
|
|
661
|
-
_trySubscribe(sink) {
|
|
662
|
-
try {
|
|
663
|
-
return this._subscribe(sink);
|
|
664
|
-
}
|
|
665
|
-
catch (err) {
|
|
666
|
-
sink.error(err);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
forEach(next, promiseCtor) {
|
|
670
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
671
|
-
return new promiseCtor((resolve, reject) => {
|
|
672
|
-
const subscriber = new SafeSubscriber({
|
|
673
|
-
next: (value) => {
|
|
674
|
-
try {
|
|
675
|
-
next(value);
|
|
676
|
-
}
|
|
677
|
-
catch (err) {
|
|
678
|
-
reject(err);
|
|
679
|
-
subscriber.unsubscribe();
|
|
680
|
-
}
|
|
681
|
-
},
|
|
682
|
-
error: reject,
|
|
683
|
-
complete: resolve,
|
|
684
|
-
});
|
|
685
|
-
this.subscribe(subscriber);
|
|
686
|
-
});
|
|
687
|
-
}
|
|
688
|
-
_subscribe(subscriber) {
|
|
689
|
-
var _a;
|
|
690
|
-
return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
|
|
691
|
-
}
|
|
692
|
-
[observable]() {
|
|
693
|
-
return this;
|
|
694
|
-
}
|
|
695
|
-
pipe(...operations) {
|
|
696
|
-
return pipeFromArray(operations)(this);
|
|
697
|
-
}
|
|
698
|
-
toPromise(promiseCtor) {
|
|
699
|
-
promiseCtor = getPromiseCtor(promiseCtor);
|
|
700
|
-
return new promiseCtor((resolve, reject) => {
|
|
701
|
-
let value;
|
|
702
|
-
this.subscribe((x) => (value = x), (err) => reject(err), () => resolve(value));
|
|
703
|
-
});
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
Observable.create = (subscribe) => {
|
|
707
|
-
return new Observable(subscribe);
|
|
708
|
-
};
|
|
709
|
-
function getPromiseCtor(promiseCtor) {
|
|
710
|
-
var _a;
|
|
711
|
-
return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
|
|
712
|
-
}
|
|
713
|
-
function isObserver(value) {
|
|
714
|
-
return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);
|
|
715
|
-
}
|
|
716
|
-
function isSubscriber(value) {
|
|
717
|
-
return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
const ObjectUnsubscribedError = createErrorClass((_super) => function ObjectUnsubscribedErrorImpl() {
|
|
721
|
-
_super(this);
|
|
722
|
-
this.name = 'ObjectUnsubscribedError';
|
|
723
|
-
this.message = 'object unsubscribed';
|
|
724
|
-
});
|
|
725
|
-
|
|
726
|
-
class Subject extends Observable {
|
|
727
|
-
constructor() {
|
|
728
|
-
super();
|
|
729
|
-
this.closed = false;
|
|
730
|
-
this.currentObservers = null;
|
|
731
|
-
this.observers = [];
|
|
732
|
-
this.isStopped = false;
|
|
733
|
-
this.hasError = false;
|
|
734
|
-
this.thrownError = null;
|
|
735
|
-
}
|
|
736
|
-
lift(operator) {
|
|
737
|
-
const subject = new AnonymousSubject(this, this);
|
|
738
|
-
subject.operator = operator;
|
|
739
|
-
return subject;
|
|
740
|
-
}
|
|
741
|
-
_throwIfClosed() {
|
|
742
|
-
if (this.closed) {
|
|
743
|
-
throw new ObjectUnsubscribedError();
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
next(value) {
|
|
747
|
-
errorContext(() => {
|
|
748
|
-
this._throwIfClosed();
|
|
749
|
-
if (!this.isStopped) {
|
|
750
|
-
if (!this.currentObservers) {
|
|
751
|
-
this.currentObservers = Array.from(this.observers);
|
|
752
|
-
}
|
|
753
|
-
for (const observer of this.currentObservers) {
|
|
754
|
-
observer.next(value);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
error(err) {
|
|
760
|
-
errorContext(() => {
|
|
761
|
-
this._throwIfClosed();
|
|
762
|
-
if (!this.isStopped) {
|
|
763
|
-
this.hasError = this.isStopped = true;
|
|
764
|
-
this.thrownError = err;
|
|
765
|
-
const { observers } = this;
|
|
766
|
-
while (observers.length) {
|
|
767
|
-
observers.shift().error(err);
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
});
|
|
771
|
-
}
|
|
772
|
-
complete() {
|
|
773
|
-
errorContext(() => {
|
|
774
|
-
this._throwIfClosed();
|
|
775
|
-
if (!this.isStopped) {
|
|
776
|
-
this.isStopped = true;
|
|
777
|
-
const { observers } = this;
|
|
778
|
-
while (observers.length) {
|
|
779
|
-
observers.shift().complete();
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
unsubscribe() {
|
|
785
|
-
this.isStopped = this.closed = true;
|
|
786
|
-
this.observers = this.currentObservers = null;
|
|
787
|
-
}
|
|
788
|
-
get observed() {
|
|
789
|
-
var _a;
|
|
790
|
-
return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
791
|
-
}
|
|
792
|
-
_trySubscribe(subscriber) {
|
|
793
|
-
this._throwIfClosed();
|
|
794
|
-
return super._trySubscribe(subscriber);
|
|
795
|
-
}
|
|
796
|
-
_subscribe(subscriber) {
|
|
797
|
-
this._throwIfClosed();
|
|
798
|
-
this._checkFinalizedStatuses(subscriber);
|
|
799
|
-
return this._innerSubscribe(subscriber);
|
|
800
|
-
}
|
|
801
|
-
_innerSubscribe(subscriber) {
|
|
802
|
-
const { hasError, isStopped, observers } = this;
|
|
803
|
-
if (hasError || isStopped) {
|
|
804
|
-
return EMPTY_SUBSCRIPTION;
|
|
805
|
-
}
|
|
806
|
-
this.currentObservers = null;
|
|
807
|
-
observers.push(subscriber);
|
|
808
|
-
return new Subscription(() => {
|
|
809
|
-
this.currentObservers = null;
|
|
810
|
-
arrRemove(observers, subscriber);
|
|
811
|
-
});
|
|
812
|
-
}
|
|
813
|
-
_checkFinalizedStatuses(subscriber) {
|
|
814
|
-
const { hasError, thrownError, isStopped } = this;
|
|
815
|
-
if (hasError) {
|
|
816
|
-
subscriber.error(thrownError);
|
|
817
|
-
}
|
|
818
|
-
else if (isStopped) {
|
|
819
|
-
subscriber.complete();
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
asObservable() {
|
|
823
|
-
const observable = new Observable();
|
|
824
|
-
observable.source = this;
|
|
825
|
-
return observable;
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
Subject.create = (destination, source) => {
|
|
829
|
-
return new AnonymousSubject(destination, source);
|
|
830
|
-
};
|
|
831
|
-
class AnonymousSubject extends Subject {
|
|
832
|
-
constructor(destination, source) {
|
|
833
|
-
super();
|
|
834
|
-
this.destination = destination;
|
|
835
|
-
this.source = source;
|
|
836
|
-
}
|
|
837
|
-
next(value) {
|
|
838
|
-
var _a, _b;
|
|
839
|
-
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
840
|
-
}
|
|
841
|
-
error(err) {
|
|
842
|
-
var _a, _b;
|
|
843
|
-
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
|
|
844
|
-
}
|
|
845
|
-
complete() {
|
|
846
|
-
var _a, _b;
|
|
847
|
-
(_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
848
|
-
}
|
|
849
|
-
_subscribe(subscriber) {
|
|
850
|
-
var _a, _b;
|
|
851
|
-
return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
const vviinnVprWidgetCss = ":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #DDDDDD;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";
|
|
856
|
-
|
|
857
|
-
let VviinnVprWidget = class {
|
|
858
|
-
constructor(hostRef) {
|
|
859
|
-
index.registerInstance(this, hostRef);
|
|
860
|
-
this.recommendationsLoaded = index.createEvent(this, "recommendationsLoaded", 7);
|
|
861
|
-
/** Title for recommendations widget */
|
|
862
|
-
this.blockTitle = "Recommended products";
|
|
863
|
-
/** Ratio of each recommended product image */
|
|
864
|
-
this.imageRatio = 1;
|
|
865
|
-
/** Width of each recommended product image */
|
|
866
|
-
this.imageWidth = 300;
|
|
867
|
-
/** Currency sign will shown after price */
|
|
868
|
-
this.currencySign = "€";
|
|
869
|
-
/** Use slider or grid view */
|
|
870
|
-
this.mode = "continuity";
|
|
871
|
-
/** Campaign type */
|
|
872
|
-
this.campaignType = "VPR";
|
|
873
|
-
/** Locale for currency formatting */
|
|
874
|
-
this.locale = "de-DE";
|
|
875
|
-
/** comma-separated list of campaign-ids */
|
|
876
|
-
this.campaigns = "";
|
|
877
|
-
/** @internal */
|
|
878
|
-
this.apiPath = "https://api.vviinn.com";
|
|
879
|
-
/** @internal */
|
|
880
|
-
this.useCarousel = true;
|
|
881
|
-
this.showScroll = true;
|
|
882
|
-
this.cssUrl = null;
|
|
883
|
-
this.recommendations = [];
|
|
884
|
-
this.loaded = false;
|
|
885
|
-
this.productImageLoadedSubject = new Subject();
|
|
886
|
-
}
|
|
887
|
-
handleProductIdChange() {
|
|
888
|
-
this.getRecommendations();
|
|
889
|
-
}
|
|
890
|
-
handleCampaignTypeChange() {
|
|
891
|
-
this.getRecommendations();
|
|
892
|
-
}
|
|
893
|
-
handleCampaignsChange() {
|
|
894
|
-
this.getRecommendations();
|
|
895
|
-
}
|
|
896
|
-
handleApiPathChange(newPath) {
|
|
897
|
-
index$1.state.apiPath = newPath;
|
|
898
|
-
this.getRecommendations();
|
|
899
|
-
}
|
|
900
|
-
handleImageLoading({ detail }) {
|
|
901
|
-
this.productImageLoadedSubject.next(detail);
|
|
902
|
-
}
|
|
903
|
-
trackRecommendationView({ detail }) {
|
|
904
|
-
const recommendationViewEvent = index$1.createProductViewVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
905
|
-
this.trackingApi.trackEvent(recommendationViewEvent);
|
|
906
|
-
}
|
|
907
|
-
trackRecommendationClick({ detail }) {
|
|
908
|
-
const recommendationClickEvent = index$1.createProductClickVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
909
|
-
this.trackingApi.trackEvent(recommendationClickEvent).finally(() => {
|
|
910
|
-
const product = this.recommendations.find((r) => r.productId === detail.product);
|
|
911
|
-
if (!product || !product.deeplink)
|
|
912
|
-
return;
|
|
913
|
-
window.location.href = product.deeplink;
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
connectedCallback() {
|
|
917
|
-
index$1.state.apiPath = this.apiPath;
|
|
918
|
-
index$1.state.currencySign = this.currencySign;
|
|
919
|
-
index$1.state.locale = this.locale;
|
|
920
|
-
this.uiSessionId = index$1.v4();
|
|
921
|
-
this.trackingApi = index$1.createTrackingApi(this.apiPath, this.token);
|
|
922
|
-
const widgetOpenEvent = index$1.createWidgetVprEvent({
|
|
923
|
-
action: "open",
|
|
924
|
-
session_id: this.uiSessionId,
|
|
925
|
-
});
|
|
926
|
-
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
927
|
-
}
|
|
928
|
-
disconnectedCallback() {
|
|
929
|
-
const widgetCloseEvent = index$1.createWidgetVprEvent({
|
|
930
|
-
action: "close",
|
|
931
|
-
session_id: this.uiSessionId,
|
|
932
|
-
});
|
|
933
|
-
this.trackingApi.trackEvent(widgetCloseEvent);
|
|
934
|
-
}
|
|
935
|
-
async componentWillLoad() {
|
|
936
|
-
index$1.state.pricePrefix = this.pricePrefix;
|
|
937
|
-
index$1.state.currencySign = this.currencySign;
|
|
938
|
-
this.getRecommendations();
|
|
939
|
-
}
|
|
940
|
-
async getRecommendations() {
|
|
941
|
-
if (this.productId === undefined || this.token === undefined)
|
|
942
|
-
return;
|
|
943
|
-
const campaignType = this.campaignType.length > 0 ? this.campaignType : "VPR";
|
|
944
|
-
const headers = createBearAuthedHeader(this.token);
|
|
945
|
-
const request = index$1._function.pipe(index$1.TaskEither.of(getRecommendationsService(campaignType)), index$1.TaskEither.ap(index$1.TaskEither.of(this.productId)), index$1.TaskEither.ap(index$1.TaskEither.of(index$1.checkEmpryString(this.campaigns))), index$1.TaskEither.ap(index$1.TaskEither.of(headers)), index$1.TaskEither.flatten);
|
|
946
|
-
const runRequest = await request();
|
|
947
|
-
index$1._function.pipe(runRequest, index$1.Either.fold((error) => this.handleError(error), (data) => this.handleRecommendationsSucces(data)));
|
|
948
|
-
}
|
|
949
|
-
handleError(error) {
|
|
950
|
-
console.log("ERROR:", error);
|
|
951
|
-
}
|
|
952
|
-
handleRecommendationsSucces(data) {
|
|
953
|
-
var _a;
|
|
954
|
-
this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
|
|
955
|
-
index$1.imageSearchState.results = this.recommendations;
|
|
956
|
-
this.loaded = true;
|
|
957
|
-
this.productIds = this.recommendations.map((r) => r.productId);
|
|
958
|
-
this.productImageLoadedSubject.subscribe((id) => {
|
|
959
|
-
this.productIds = this.productIds.filter((x) => x !== id);
|
|
960
|
-
if (this.productIds.length === 0) {
|
|
961
|
-
this.recommendationsLoaded.emit();
|
|
962
|
-
}
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
isExternalCSS() {
|
|
966
|
-
return this.cssUrl && this.cssUrl.length > 0;
|
|
967
|
-
}
|
|
968
|
-
renderExternalCSS() {
|
|
969
|
-
return this.isExternalCSS() ? (index.h("link", { href: this.cssUrl, rel: "stylesheet" })) : ("");
|
|
970
|
-
}
|
|
971
|
-
render() {
|
|
972
|
-
return (index.h(index.Host, { class: {
|
|
973
|
-
loaded: this.loaded,
|
|
974
|
-
empty: this.recommendations.length == 0,
|
|
975
|
-
[this.mode]: true,
|
|
976
|
-
}, "aria-hidden": this.loaded ? "false" : "true" }, this.renderExternalCSS(), index.h("style", null, index$1.state.fallbackStyles), index.h("h2", { part: "recommendations-title" }, this.blockTitle), this.useCarousel ? this.renderCarousel() : this.renderResults()));
|
|
977
|
-
}
|
|
978
|
-
renderRecommendation(recommendation, index$1) {
|
|
979
|
-
return (index.h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard(), index: index$1 }));
|
|
980
|
-
}
|
|
981
|
-
useDimmedBackgroundInCard() {
|
|
982
|
-
return this.mode === "continuity" || !this.useCarousel;
|
|
983
|
-
}
|
|
984
|
-
renderResults() {
|
|
985
|
-
return (index.h("div", { class: "recommendations-grid", part: "recommendations-grid" }, this.recommendations.map((r, i) => this.renderRecommendation(r, i))));
|
|
986
|
-
}
|
|
987
|
-
renderCarousel() {
|
|
988
|
-
return (index.h("vviinn-carousel", { mode: this.mode, imageWidth: this.imageWidth, showScroll: this.showScroll, recommendations: this.recommendations }));
|
|
989
|
-
}
|
|
990
|
-
get el() { return index.getElement(this); }
|
|
991
|
-
static get watchers() { return {
|
|
992
|
-
"productId": ["handleProductIdChange"],
|
|
993
|
-
"campaignType": ["handleCampaignTypeChange"],
|
|
994
|
-
"campaigns": ["handleCampaignsChange"],
|
|
995
|
-
"apiPath": ["handleApiPathChange"]
|
|
996
|
-
}; }
|
|
997
|
-
};
|
|
998
|
-
VviinnVprWidget.style = vviinnVprWidgetCss;
|
|
999
|
-
|
|
1000
|
-
exports.vviinn_carousel = VviinnCarousel;
|
|
1001
|
-
exports.vviinn_vpr_widget = VviinnVprWidget;
|