vviinn-widgets 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-047a582c.js → app-globals-8db3bcbe.js} +1 -1
- package/dist/cjs/cropper-handler_27.cjs.entry.js +5 -5
- package/dist/cjs/{customized-slots-cb722e68.js → customized-slots-06ca4007.js} +1 -1
- package/dist/cjs/{index-bd771524.js → index-3c3ab815.js} +1 -1
- package/dist/cjs/{index-d07466b9.js → index-df6896e2.js} +1 -1
- package/dist/cjs/{index-fcafbfe5.js → index-f66cd8d1.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/vviinn-carousel_2.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-widgets.cjs.js +2 -2
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +1 -1
- package/dist/esm/{app-globals-68b1d848.js → app-globals-865bc7a7.js} +1 -1
- package/dist/esm/cropper-handler_27.entry.js +5 -5
- package/dist/esm/{customized-slots-95a05ceb.js → customized-slots-96902edf.js} +1 -1
- package/dist/esm/{index-33fe5a25.js → index-2fdd499d.js} +1 -1
- package/dist/esm/{index-f9df412f.js → index-443468c7.js} +1 -1
- package/dist/esm/{index-75a1f589.js → index-51f71d18.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/vviinn-carousel_2.entry.js +3 -3
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -2
- package/dist/esm/vviinn-vpr-button.entry.js +2 -2
- package/dist/esm/vviinn-vps-button.entry.js +3 -3
- package/dist/esm/vviinn-widgets.js +2 -2
- package/dist/vviinn-widgets/{p-f6e59cb2.js → p-166970f3.js} +1 -1
- package/dist/vviinn-widgets/{p-5aca8be2.entry.js → p-2dd35f19.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-4e55513e.js → p-3469b71a.js} +1 -1
- package/dist/vviinn-widgets/{p-5358970c.entry.js → p-40bea5b5.entry.js} +1 -1
- package/{www/build/p-66015ad7.js → dist/vviinn-widgets/p-465d043d.js} +1 -1
- package/dist/vviinn-widgets/{p-9de1b0e7.js → p-59bd2a99.js} +1 -1
- package/dist/vviinn-widgets/p-74ed36af.entry.js +1 -0
- package/dist/vviinn-widgets/{p-c1cd51ef.entry.js → p-9def6b8b.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-8080679b.entry.js → p-a6e0710f.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-b254eee7.js → p-cd995515.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-f6e59cb2.js → p-166970f3.js} +1 -1
- package/www/build/{p-5aca8be2.entry.js → p-2dd35f19.entry.js} +1 -1
- package/www/build/{p-4e55513e.js → p-3469b71a.js} +1 -1
- package/www/build/{p-5358970c.entry.js → p-40bea5b5.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-66015ad7.js → www/build/p-465d043d.js} +1 -1
- package/www/build/{p-9de1b0e7.js → p-59bd2a99.js} +1 -1
- package/www/build/p-61933b75.js +1 -0
- package/www/build/p-74ed36af.entry.js +1 -0
- package/www/build/{p-c1cd51ef.entry.js → p-9def6b8b.entry.js} +1 -1
- package/www/build/p-a67898be.css +1 -0
- package/www/build/{p-8080679b.entry.js → p-a6e0710f.entry.js} +1 -1
- package/www/build/{p-b254eee7.js → p-cd995515.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/vviinn-widgets/p-e32c30d4.entry.js +0 -1
- package/www/build/p-e0153ae2.css +0 -6
- package/www/build/p-e32c30d4.entry.js +0 -1
- package/www/build/p-f6566a1f.js +0 -125
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,b as i}from"./p-4e55513e.js";import{g as a}from"./p-66015ad7.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),e(a)})().then((e=>(a(),i([["p-5aca8be2",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],slidePosition:[32],width:[32],wrongImageFormat:[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}],[1,"cropper-handler",{handler:[16],disabled:[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],index:[2],imageLoaded:[32]}]]],["p-e32c30d4",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-c1cd51ef",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],campaigns:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}]]],["p-5358970c",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],campaigns:[1],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-8080679b",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"],campaigns:[1]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as i,h as e,H as s,g as r}from"./p-3469b71a.js";import{c as n}from"./p-166970f3.js";import{S as a}from"./p-cd995515.js";let o=class{constructor(e){t(this,e),this.globalSlotsChanged=i(this,"globalSlotsChanged",7),this.currencySign="€",this.locale="de-DE",this.pressed=!1}handleModalClosed(){this.pressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}handleKeyDown(t){"Enter"!==t.code&&"Space"!==t.code||(this.pressed=!0)}handleClick(){this.pressed=!0}render(){return e(s,{tabindex:"0",role:"button",pressed:this.pressed,onClick:()=>this.handleClick(),onKeyDown:t=>this.handleKeyDown(t)},e("slot",null,e(n,null)),e(a,null),e("vviinn-vps-widget",{active:this.pressed,"currency-sign":"€",token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card, example-images",campaignId:this.campaignId}))}get el(){return r(this)}};o.style=":host{cursor:pointer}";export{o as vviinn_vps_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as e,c as r}from"./p-4e55513e.js";import{D as n,_ as o,p as a,F as h,G as c,H as l,I as d,J as u,K as p,L as v,M as m,P as g,u as f,Q as b,R as w,z as y,A as x,T as C,U as _,V as R,E as S,i as k}from"./p-9de1b0e7.js";import{e as E}from"./p-f6e59cb2.js";let P=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),s=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${s}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const s=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return s.length>0?s[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t,s){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode,index:s})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map(((t,i)=>this.renderRecommendation(t,i)))}renderGrid(){const t=this.renderRecommendationsElements(),i=n.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(s,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev(),part:"carousel-button"},i(E,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext(),part:"carousel-button"},i(E,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return e(this)}};P.style=":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)}}";const I=o.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),A=p(v),j=(t,i={})=>a(A(d(),u),l,h(c(t,i))),D=t=>i=>s=>{const e=o.pipe(i,m(encodeURIComponent),g((()=>`product/${t}/similar-products`),(i=>`product/${t}/similar-products?campaigns=${i}`)));return j(e,s)},O=t=>i=>s=>{const e=o.pipe(i,m(encodeURIComponent),g((()=>`product/${t}/cross-selling-products`),(i=>`product/${t}/cross-selling-products?campaigns=${i}`)));return j(e,s)};function $(t){return"function"==typeof t}function T(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const z=T((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function N(t,i){if(t){const s=t.indexOf(i);0<=s&&t.splice(s,1)}}class V{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:s}=this;if($(s))try{s()}catch(i){t=i instanceof z?i.errors:[i]}const{_finalizers:e}=this;if(e){this._finalizers=null;for(const i of e)try{U(i)}catch(i){t=null!=t?t:[],i instanceof z?t=[...t,...i.errors]:t.push(i)}}if(t)throw new z(t)}}add(t){var i;if(t&&t!==this)if(this.closed)U(t);else{if(t instanceof V){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&N(i,t)}remove(t){const{_finalizers:i}=this;i&&N(i,t),t instanceof V&&t._removeParent(this)}}V.EMPTY=(()=>{const t=new V;return t.closed=!0,t})();const W=V.EMPTY;function F(t){return t instanceof V||t&&"closed"in t&&$(t.remove)&&$(t.add)&&$(t.unsubscribe)}function U(t){$(t)?t():t.unsubscribe()}const B={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},G={setTimeout(t,i,...s){const{delegate:e}=G;return(null==e?void 0:e.setTimeout)?e.setTimeout(t,i,...s):setTimeout(t,i,...s)},clearTimeout(t){const{delegate:i}=G;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function L(){}const M=H("C",void 0,void 0);function H(t,i,s){return{kind:t,value:i,error:s}}function q(t){t()}class J extends V{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,F(t)&&t.add(this)):this.destination=it}static create(t,i,s){return new Y(t,i,s)}next(t){this.isStopped?tt(function(t){return H("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?tt(H("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?tt(M,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const K=Function.prototype.bind;function Q(t,i){return K.call(t,i)}class X{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){Z(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){Z(t)}else Z(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){Z(t)}}}class Y extends J{constructor(t,i,s){let e;if(super(),$(t)||!t)e={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=s?s:void 0};else{let i;this&&B.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),e={next:t.next&&Q(t.next,i),error:t.error&&Q(t.error,i),complete:t.complete&&Q(t.complete,i)}):e=t}this.destination=new X(e)}}function Z(t){var i;i=t,G.setTimeout((()=>{const{onUnhandledError:t}=B;if(!t)throw i;t(i)}))}function tt(t,i){const{onStoppedNotification:s}=B;s&&G.setTimeout((()=>s(t,i)))}const it={closed:!0,next:L,error:function(t){throw t},complete:L},st="function"==typeof Symbol&&Symbol.observable||"@@observable";function et(t){return t}class rt{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new rt;return i.source=this,i.operator=t,i}subscribe(t,i,s){const e=(r=t)&&r instanceof J||function(t){return t&&$(t.next)&&$(t.error)&&$(t.complete)}(r)&&F(r)?t:new Y(t,i,s);var r;return q((()=>{const{operator:t,source:i}=this;e.add(t?t.call(e,i):i?this._subscribe(e):this._trySubscribe(e))})),e}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=nt(i))(((i,s)=>{const e=new Y({next:i=>{try{t(i)}catch(t){s(t),e.unsubscribe()}},error:s,complete:i});this.subscribe(e)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[st](){return this}pipe(...t){return(0===(i=t).length?et:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=nt(t))(((t,i)=>{let s;this.subscribe((t=>s=t),(t=>i(t)),(()=>t(s)))}))}}function nt(t){var i;return null!==(i=null!=t?t:B.Promise)&&void 0!==i?i:Promise}rt.create=t=>new rt(t);const ot=T((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class at extends rt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new ht(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new ot}next(t){q((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){q((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){q((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:s,observers:e}=this;return i||s?W:(this.currentObservers=null,e.push(t),new V((()=>{this.currentObservers=null,N(e,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:s,isStopped:e}=this;i?t.error(s):e&&t.complete()}asObservable(){const t=new rt;return t.source=this,t}}at.create=(t,i)=>new ht(t,i);class ht extends at{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,s;null===(s=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===s||s.call(i,t)}error(t){var i,s;null===(s=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===s||s.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,s;return null!==(s=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==s?s:W}}let ct=class{constructor(i){t(this,i),this.recommendationsLoaded=r(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.campaigns="",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new at}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleCampaignsChange(){this.getRecommendations()}handleApiPathChange(t){f.apiPath=t,this.getRecommendations()}handleImageLoading({detail:t}){this.productImageLoadedSubject.next(t)}trackRecommendationView({detail:t}){const i=b(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(i)}trackRecommendationClick({detail:t}){const i=w(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(i).finally((()=>{const i=this.recommendations.find((i=>i.productId===t.product));i&&i.deeplink&&(window.location.href=i.deeplink)}))}connectedCallback(){f.apiPath=this.apiPath,f.currencySign=this.currencySign,f.locale=this.locale,this.uiSessionId=y(),this.trackingApi=x(this.apiPath,this.token);const t=C({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}disconnectedCallback(){const t=C({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}async componentWillLoad(){f.pricePrefix=this.pricePrefix,f.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=I(this.token),s=o.pipe(_.of((t=>{return o.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>D,s=()=>O,t=>(t=>"VPR"===t._tag)(t)?i():s()));var i,s})(t)),_.ap(_.of(this.productId)),_.ap(_.of(R(this.campaigns))),_.ap(_.of(i)),_.flatten),e=await s();o.pipe(e,S.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,k.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(s,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,f.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t,s){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard(),index:s})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map(((t,i)=>this.renderRecommendation(t,i))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return e(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],campaigns:["handleCampaignsChange"],apiPath:["handleApiPathChange"]}}};ct.style=":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}";export{P as vviinn_carousel,ct as vviinn_vpr_widget}
|
|
1
|
+
import{r as t,h as i,H as s,g as e,c as r}from"./p-3469b71a.js";import{D as n,_ as o,p as a,F as h,G as c,H as l,I as d,J as u,K as p,L as v,M as m,P as g,u as f,Q as b,R as w,z as y,A as x,T as C,U as _,V as R,E as S,i as k}from"./p-59bd2a99.js";import{e as E}from"./p-166970f3.js";let P=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),s=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${s}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const s=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return s.length>0?s[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t,s){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode,index:s})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map(((t,i)=>this.renderRecommendation(t,i)))}renderGrid(){const t=this.renderRecommendationsElements(),i=n.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(s,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev(),part:"carousel-button"},i(E,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext(),part:"carousel-button"},i(E,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return e(this)}};P.style=":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)}}";const I=o.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),A=p(v),j=(t,i={})=>a(A(d(),u),l,h(c(t,i))),D=t=>i=>s=>{const e=o.pipe(i,m(encodeURIComponent),g((()=>`product/${t}/similar-products`),(i=>`product/${t}/similar-products?campaigns=${i}`)));return j(e,s)},O=t=>i=>s=>{const e=o.pipe(i,m(encodeURIComponent),g((()=>`product/${t}/cross-selling-products`),(i=>`product/${t}/cross-selling-products?campaigns=${i}`)));return j(e,s)};function $(t){return"function"==typeof t}function T(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const z=T((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function N(t,i){if(t){const s=t.indexOf(i);0<=s&&t.splice(s,1)}}class V{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:s}=this;if($(s))try{s()}catch(i){t=i instanceof z?i.errors:[i]}const{_finalizers:e}=this;if(e){this._finalizers=null;for(const i of e)try{U(i)}catch(i){t=null!=t?t:[],i instanceof z?t=[...t,...i.errors]:t.push(i)}}if(t)throw new z(t)}}add(t){var i;if(t&&t!==this)if(this.closed)U(t);else{if(t instanceof V){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&N(i,t)}remove(t){const{_finalizers:i}=this;i&&N(i,t),t instanceof V&&t._removeParent(this)}}V.EMPTY=(()=>{const t=new V;return t.closed=!0,t})();const W=V.EMPTY;function F(t){return t instanceof V||t&&"closed"in t&&$(t.remove)&&$(t.add)&&$(t.unsubscribe)}function U(t){$(t)?t():t.unsubscribe()}const B={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},G={setTimeout(t,i,...s){const{delegate:e}=G;return(null==e?void 0:e.setTimeout)?e.setTimeout(t,i,...s):setTimeout(t,i,...s)},clearTimeout(t){const{delegate:i}=G;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function L(){}const M=H("C",void 0,void 0);function H(t,i,s){return{kind:t,value:i,error:s}}function q(t){t()}class J extends V{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,F(t)&&t.add(this)):this.destination=it}static create(t,i,s){return new Y(t,i,s)}next(t){this.isStopped?tt(function(t){return H("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?tt(H("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?tt(M,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const K=Function.prototype.bind;function Q(t,i){return K.call(t,i)}class X{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){Z(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){Z(t)}else Z(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){Z(t)}}}class Y extends J{constructor(t,i,s){let e;if(super(),$(t)||!t)e={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=s?s:void 0};else{let i;this&&B.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),e={next:t.next&&Q(t.next,i),error:t.error&&Q(t.error,i),complete:t.complete&&Q(t.complete,i)}):e=t}this.destination=new X(e)}}function Z(t){var i;i=t,G.setTimeout((()=>{const{onUnhandledError:t}=B;if(!t)throw i;t(i)}))}function tt(t,i){const{onStoppedNotification:s}=B;s&&G.setTimeout((()=>s(t,i)))}const it={closed:!0,next:L,error:function(t){throw t},complete:L},st="function"==typeof Symbol&&Symbol.observable||"@@observable";function et(t){return t}class rt{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new rt;return i.source=this,i.operator=t,i}subscribe(t,i,s){const e=(r=t)&&r instanceof J||function(t){return t&&$(t.next)&&$(t.error)&&$(t.complete)}(r)&&F(r)?t:new Y(t,i,s);var r;return q((()=>{const{operator:t,source:i}=this;e.add(t?t.call(e,i):i?this._subscribe(e):this._trySubscribe(e))})),e}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=nt(i))(((i,s)=>{const e=new Y({next:i=>{try{t(i)}catch(t){s(t),e.unsubscribe()}},error:s,complete:i});this.subscribe(e)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[st](){return this}pipe(...t){return(0===(i=t).length?et:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=nt(t))(((t,i)=>{let s;this.subscribe((t=>s=t),(t=>i(t)),(()=>t(s)))}))}}function nt(t){var i;return null!==(i=null!=t?t:B.Promise)&&void 0!==i?i:Promise}rt.create=t=>new rt(t);const ot=T((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class at extends rt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new ht(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new ot}next(t){q((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){q((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){q((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:s,observers:e}=this;return i||s?W:(this.currentObservers=null,e.push(t),new V((()=>{this.currentObservers=null,N(e,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:s,isStopped:e}=this;i?t.error(s):e&&t.complete()}asObservable(){const t=new rt;return t.source=this,t}}at.create=(t,i)=>new ht(t,i);class ht extends at{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,s;null===(s=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===s||s.call(i,t)}error(t){var i,s;null===(s=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===s||s.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,s;return null!==(s=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==s?s:W}}let ct=class{constructor(i){t(this,i),this.recommendationsLoaded=r(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.campaigns="",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new at}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleCampaignsChange(){this.getRecommendations()}handleApiPathChange(t){f.apiPath=t,this.getRecommendations()}handleImageLoading({detail:t}){this.productImageLoadedSubject.next(t)}trackRecommendationView({detail:t}){const i=b(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(i)}trackRecommendationClick({detail:t}){const i=w(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(i).finally((()=>{const i=this.recommendations.find((i=>i.productId===t.product));i&&i.deeplink&&(window.location.href=i.deeplink)}))}connectedCallback(){f.apiPath=this.apiPath,f.currencySign=this.currencySign,f.locale=this.locale,this.uiSessionId=y(),this.trackingApi=x(this.apiPath,this.token);const t=C({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}disconnectedCallback(){const t=C({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}async componentWillLoad(){f.pricePrefix=this.pricePrefix,f.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=I(this.token),s=o.pipe(_.of((t=>{return o.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>D,s=()=>O,t=>(t=>"VPR"===t._tag)(t)?i():s()));var i,s})(t)),_.ap(_.of(this.productId)),_.ap(_.of(R(this.campaigns))),_.ap(_.of(i)),_.flatten),e=await s();o.pipe(e,S.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,k.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(s,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,f.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t,s){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard(),index:s})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map(((t,i)=>this.renderRecommendation(t,i))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return e(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],campaigns:["handleCampaignsChange"],apiPath:["handleApiPathChange"]}}};ct.style=":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}";export{P as vviinn_carousel,ct as vviinn_vpr_widget}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as o,H as s}from"./p-
|
|
1
|
+
import{r as t,h as o,H as s}from"./p-3469b71a.js";import{V as i}from"./p-166970f3.js";let n=class{constructor(o){t(this,o),this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1,this.campaigns="",this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)}}render(){return o(s,null,o("button",{class:"open-button",part:"button",onClick:()=>this.handleClick()},o("slot",null,o(i,null))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.token=this.token,t.position=this.position,t.sourceImage=this.sourceImage,t.widgetScrollbar=this.modalScrollbar,t.campaigns=this.campaigns,this.sidebar=t,t.addEventListener("modalClosed",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&(this.sidebar.removeEventListener("modalCLosed",this.sidebarCloseListener),document.body.removeChild(this.sidebar))}};n.style=":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";export{n as vviinn_vpr_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as n}from"./p-
|
|
1
|
+
import{h as n}from"./p-3469b71a.js";const i=["vviinn-onboarding-title","vviinn-onboarding-card-1-icon","vviinn-onboarding-card-1-text","vviinn-onboarding-card-2-icon","vviinn-onboarding-card-2-text","vviinn-onboarding-card-3-icon","vviinn-onboarding-card-3-text","vviinn-example-images-title","vviinn-example-images-1","vviinn-example-images-2","vviinn-example-images-3","vviinn-example-images-4","vviinn-teaser-text","vviinn-image-upload-button-text","vviinn-privacy-badge-text"],a=i=>n("slot",{name:i}),e=()=>i.map(a),v=(n,i)=>{i.innerHTML=n.outerHTML},o=(n,i)=>{n.connectedCallback=function(){document.addEventListener("globalSlotsChanged",(({detail:n})=>{var a;(n=>Array.from(n.shadowRoot.querySelectorAll("slot")))(i).reduce((a=n,(n,i)=>{const e=a.find((v=i,n=>v.getAttribute("name")===n.getAttribute("slot")));var v;return e&&n.set(i,e),n}),new Map).forEach(v)}),!0)},n.connectedCallback.call(n)};export{e as S,o as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as i}from"./p-
|
|
1
|
+
import{p as e,b as i}from"./p-3469b71a.js";import{g as a}from"./p-465d043d.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),e(a)})().then((e=>(a(),i([["p-2dd35f19",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],slidePosition:[32],width:[32],wrongImageFormat:[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}],[1,"cropper-handler",{handler:[16],disabled:[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],index:[2],imageLoaded:[32]}]]],["p-74ed36af",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-9def6b8b",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],campaigns:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}]]],["p-40bea5b5",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],campaigns:[1],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-a6e0710f",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"],campaigns:[1]}]]]],e))));
|
package/www/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="preconnect" href="https://cdn.vviinn.com"> <link rel="preconnect" href="https://d1rgjmn2wmqeif.cloudfront.net"> <link rel="modulepreload" href="/build/p-
|
|
1
|
+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="preconnect" href="https://cdn.vviinn.com"> <link rel="preconnect" href="https://d1rgjmn2wmqeif.cloudfront.net"> <link rel="modulepreload" href="/build/p-61933b75.js"><script type="module" src="/build/p-61933b75.js" data-stencil data-resources-url="/build/" data-stencil-namespace="vviinn-widgets"></script> <script nomodule="" src="/build/vviinn-widgets.js" data-stencil></script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""> <link href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&display=swap" rel="stylesheet"> </head> <body> <vviinn-vps-widget active="true" token="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOjEwNSwianRpIjoiMWJkY2I3ZWQtZTI4OS00ODBjLWI5NDItMjhhNGMwNzRmODgxIiwic2NvcGVzIjpbInZwciIsInZwcyIsInZwYyJdfQ.yZhH8r594NydsXsQjS5e1d_OfvnCoGHUj94OVq6kL61ywGsjsY97bOXlTYP9Q9uRCQX_3LRxnS6J7PULV99ndKfwnayNp0PnKnZ02KPMQ8Mb-8reqZBsvsrgrqb-9xvT3itJluFOnXI9FAlQ5s3XNzdt3OQ85eisOXTDNf60Bjc" product-id="FEX1005" block-title="" mode="grid" show-scroll="false" css-url="https://storage.googleapis.com/aiaas-merchant-assets/production/105/css/1169b48d-6f9f-4304-b452-c223a9bacaac.css" campaign-id="23"></vviinn-vps-widget> </body></html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s,g as r}from"./p-4e55513e.js";import{c as n}from"./p-f6e59cb2.js";import{S as a}from"./p-b254eee7.js";let o=class{constructor(i){e(this,i),this.globalSlotsChanged=t(this,"globalSlotsChanged",7),this.currencySign="€",this.locale="de-DE",this.pressed=!1}handleModalClosed(){this.pressed=!1}componentDidLoad(){const e=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(e))}handleKeyDown(e){"Enter"!==e.code&&"Space"!==e.code||(this.pressed=!0)}handleClick(){this.pressed=!0}render(){return i(s,{tabindex:"0",role:"button",pressed:this.pressed,onClick:()=>this.handleClick(),onKeyDown:e=>this.handleKeyDown(e)},i("slot",null,i(n,null)),i(a,null),i("vviinn-vps-widget",{active:this.pressed,"currency-sign":"€",token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card, example-images",campaignId:this.campaignId}))}get el(){return r(this)}};o.style=":host{cursor:pointer}";export{o as vviinn_vps_button}
|
package/www/build/p-e0153ae2.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s,g as r}from"./p-4e55513e.js";import{c as n}from"./p-f6e59cb2.js";import{S as a}from"./p-b254eee7.js";let o=class{constructor(i){e(this,i),this.globalSlotsChanged=t(this,"globalSlotsChanged",7),this.currencySign="€",this.locale="de-DE",this.pressed=!1}handleModalClosed(){this.pressed=!1}componentDidLoad(){const e=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(e))}handleKeyDown(e){"Enter"!==e.code&&"Space"!==e.code||(this.pressed=!0)}handleClick(){this.pressed=!0}render(){return i(s,{tabindex:"0",role:"button",pressed:this.pressed,onClick:()=>this.handleClick(),onKeyDown:e=>this.handleKeyDown(e)},i("slot",null,i(n,null)),i(a,null),i("vviinn-vps-widget",{active:this.pressed,"currency-sign":"€",token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card, example-images",campaignId:this.campaignId}))}get el(){return r(this)}};o.style=":host{cursor:pointer}";export{o as vviinn_vps_button}
|
package/www/build/p-f6566a1f.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-007af453.js';
|
|
2
|
-
import { g as globalScripts } from './app-globals-61fc820b.js';
|
|
3
|
-
|
|
4
|
-
/*
|
|
5
|
-
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
6
|
-
*/
|
|
7
|
-
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
|
|
8
|
-
const patchBrowser = () => {
|
|
9
|
-
// NOTE!! This fn cannot use async/await!
|
|
10
|
-
if (BUILD.isDev && !BUILD.isTesting) {
|
|
11
|
-
consoleDevInfo('Running in development mode.');
|
|
12
|
-
}
|
|
13
|
-
if (BUILD.cssVarShim) {
|
|
14
|
-
// shim css vars
|
|
15
|
-
plt.$cssShim$ = win.__cssshim;
|
|
16
|
-
}
|
|
17
|
-
if (BUILD.cloneNodeFix) {
|
|
18
|
-
// opted-in to polyfill cloneNode() for slot polyfilled components
|
|
19
|
-
patchCloneNodeFix(H.prototype);
|
|
20
|
-
}
|
|
21
|
-
if (BUILD.profile && !performance.mark) {
|
|
22
|
-
// not all browsers support performance.mark/measure (Safari 10)
|
|
23
|
-
performance.mark = performance.measure = () => {
|
|
24
|
-
/*noop*/
|
|
25
|
-
};
|
|
26
|
-
performance.getEntriesByName = () => [];
|
|
27
|
-
}
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim
|
|
30
|
-
? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
|
|
31
|
-
s.getAttribute('data-stencil-namespace') === NAMESPACE)
|
|
32
|
-
: null;
|
|
33
|
-
const importMeta = import.meta.url;
|
|
34
|
-
const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};
|
|
35
|
-
if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
|
|
36
|
-
// Safari < v11 support: This IF is true if it's Safari below v11.
|
|
37
|
-
// This fn cannot use async/await since Safari didn't support it until v11,
|
|
38
|
-
// however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
|
|
39
|
-
// so both the ESM file and nomodule file would get downloaded. Only Safari
|
|
40
|
-
// has 'onbeforeload' in the script, and "history.scrollRestoration" was added
|
|
41
|
-
// to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
|
|
42
|
-
// IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
|
|
43
|
-
return {
|
|
44
|
-
then() {
|
|
45
|
-
/* promise noop */
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
if (!BUILD.safari10 && importMeta !== '') {
|
|
50
|
-
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
51
|
-
}
|
|
52
|
-
else if (BUILD.dynamicImportShim || BUILD.safari10) {
|
|
53
|
-
opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;
|
|
54
|
-
if (BUILD.dynamicImportShim) {
|
|
55
|
-
patchDynamicImport(opts.resourcesUrl, scriptElm);
|
|
56
|
-
}
|
|
57
|
-
if (BUILD.dynamicImportShim && !win.customElements) {
|
|
58
|
-
// module support, but no custom elements support (Old Edge)
|
|
59
|
-
// @ts-ignore
|
|
60
|
-
return import(/* webpackChunkName: "polyfills-dom" */ './dom-db0073f0.js').then(() => opts);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return promiseResolve(opts);
|
|
64
|
-
};
|
|
65
|
-
const patchDynamicImport = (base, orgScriptElm) => {
|
|
66
|
-
const importFunctionName = getDynamicImportFunction(NAMESPACE);
|
|
67
|
-
try {
|
|
68
|
-
// test if this browser supports dynamic imports
|
|
69
|
-
// There is a caching issue in V8, that breaks using import() in Function
|
|
70
|
-
// By generating a random string, we can workaround it
|
|
71
|
-
// Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
|
|
72
|
-
win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
// this shim is specifically for browsers that do support "esm" imports
|
|
76
|
-
// however, they do NOT support "dynamic" imports
|
|
77
|
-
// basically this code is for old Edge, v18 and below
|
|
78
|
-
const moduleMap = new Map();
|
|
79
|
-
win[importFunctionName] = (src) => {
|
|
80
|
-
const url = new URL(src, base).href;
|
|
81
|
-
let mod = moduleMap.get(url);
|
|
82
|
-
if (!mod) {
|
|
83
|
-
const script = doc.createElement('script');
|
|
84
|
-
script.type = 'module';
|
|
85
|
-
script.crossOrigin = orgScriptElm.crossOrigin;
|
|
86
|
-
script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
|
|
87
|
-
type: 'application/javascript',
|
|
88
|
-
}));
|
|
89
|
-
mod = new Promise((resolve) => {
|
|
90
|
-
script.onload = () => {
|
|
91
|
-
resolve(win[importFunctionName].m);
|
|
92
|
-
script.remove();
|
|
93
|
-
};
|
|
94
|
-
});
|
|
95
|
-
moduleMap.set(url, mod);
|
|
96
|
-
doc.head.appendChild(script);
|
|
97
|
-
}
|
|
98
|
-
return mod;
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
const patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
103
|
-
const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
|
|
104
|
-
HTMLElementPrototype.cloneNode = function (deep) {
|
|
105
|
-
if (this.nodeName === 'TEMPLATE') {
|
|
106
|
-
return nativeCloneNodeFn.call(this, deep);
|
|
107
|
-
}
|
|
108
|
-
const clonedNode = nativeCloneNodeFn.call(this, false);
|
|
109
|
-
const srcChildNodes = this.childNodes;
|
|
110
|
-
if (deep) {
|
|
111
|
-
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
112
|
-
// Node.ATTRIBUTE_NODE === 2, and checking because IE11
|
|
113
|
-
if (srcChildNodes[i].nodeType !== 2) {
|
|
114
|
-
clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return clonedNode;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
patchBrowser().then(options => {
|
|
123
|
-
globalScripts();
|
|
124
|
-
return bootstrapLazy([["vviinn-vps-widget",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]]]],["vviinn-vps-button",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-recommendations-sidebar",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"campaigns":[1],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-vpr-button",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"],"campaigns":[1]}]]],["vviinn-image-view",[[1,"vviinn-image-view"]]],["vviinn-onboarding",[[1,"vviinn-onboarding"]]],["vviinn-example-images",[[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]]]],["vviinn-overlayed-modal",[[1,"vviinn-overlayed-modal",{"active":[4]}]]],["vviinn-vpr-widget",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]]]],["vviinn-empty-results",[[1,"vviinn-empty-results"]]],["vviinn-image-selector",[[1,"vviinn-image-selector"]]],["vviinn-server-error",[[1,"vviinn-server-error"]]],["vviinn-wrong-format",[[1,"vviinn-wrong-format"]]],["search-filters",[[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}]]],["vviinn-privacy-badge",[[1,"vviinn-privacy-badge"]]],["vviinn-teaser",[[1,"vviinn-teaser"]]],["image-cropper",[[1,"image-cropper",{"disabled":[4],"handleMove":[32]}]]],["vviinn-carousel",[[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}]]],["vviinn-example-image",[[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}]]],["highlight-box",[[1,"highlight-box"]]],["vviinn-detected-object",[[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}]]],["vviinn-modal",[[1,"vviinn-modal",{"active":[1540],"slider":[32]}]]],["vviinn-onboarding-card-1",[[1,"vviinn-onboarding-card-1"]]],["vviinn-onboarding-card-2",[[1,"vviinn-onboarding-card-2"]]],["vviinn-onboarding-card-3",[[1,"vviinn-onboarding-card-3"]]],["vviinn-overlay",[[1,"vviinn-overlay"]]],["vviinn-slide",[[1,"vviinn-slide"]]],["vviinn-slider",[[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}]]],["cropper-handler",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-product-card",[[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]]], options);
|
|
125
|
-
});
|