storyly-web 2.15.0 → 2.16.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/ImageCTA.6e00c2b1.js +1 -1
- package/dist/Modern.ba02a4b1.js +3 -3
- package/dist/ProductCatalog.42e572d6.js +1 -1
- package/dist/ProductTag.54584948.js +2 -2
- package/dist/Quiz.80dd96d2.js +1 -1
- package/dist/StoryCart.c7184f81.js +1 -1
- package/dist/VideoSeekBar.8e29e7fa.js +1 -1
- package/dist/index.js +13 -13
- package/dist/storyly-web.css +1 -1
- package/dist/storyly-web.js +13 -13
- package/index.html +70 -11
- package/index.js +1 -1
- package/package.json +6 -2
- package/tests/lighthouse.test.js +26 -0
- package/tests/pagespeed-test.js +66 -0
- package/pagespeed-test.js +0 -67
|
@@ -3,5 +3,5 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
|
|
|
3
3
|
},{"@babel/runtime/helpers/defineProperty":"IxO8","../../lib/util":"PesM"}],"jMEQ":[function(require,module,exports) {
|
|
4
4
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=function(n){var t;return'\n <div class="component-layer">\n <div\n aria-hidden="true"\n role="component"\n tabindex="-1"\n class="image-cta-wrapper"\n style="\n width: '.concat(n.width,";\n height: ").concat(n.height,";\n left: ").concat(n.left,";\n top: ").concat(n.top,";\n ").concat(n.transform?"transform: ".concat(n.transform,";"):"","\n z-index: ").concat(n.zIndex,';\n "\n >\n <img src="').concat(n.image_url,'" style="border-radius: ').concat(null!==(t=n.border_radius)&&void 0!==t?t:0,'px;" alt="Component Image" />\n </div>\n </div>\n')};exports.default=n;
|
|
5
5
|
},{}],"J7D7":[function(require,module,exports) {
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=y(require("@babel/runtime/helpers/classCallCheck")),e=y(require("@babel/runtime/helpers/createClass")),r=y(require("@babel/runtime/helpers/inherits")),i=y(require("@babel/runtime/helpers/possibleConstructorReturn")),a=y(require("@babel/runtime/helpers/getPrototypeOf")),n=y(require("../../components/StoryProduct")),o=require("../../constants/events"),s=require("../../constants/layerTypes"),l=require("../../lib/util"),u=y(require("../base")),c=y(require("./dataConvertor")),d=y(require("./template"));function y(t){return t&&t.__esModule?t:{default:t}}function h(t){var e=_();return function(){var r,n=(0,a.default)(t);if(e){var o=(0,a.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,i.default)(this,r)}}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}var p=function(i){(0,r.default)(u,i);var a=h(u);function u(e){var r,i=e.layer,n=e.story,o=e.group,l=e.storyDom,y=e.instanceId;return(0,t.default)(this,u),(r=a.call(this,{type:s.LayerTemplateTypes.IMAGE_CTA,storyDom:l,instanceId:y})).story_=n,r.group_=o,r.setLayerData((0,c.default)(i,l)),r.generateComponentAndAppendToPage((0,d.default)(r.layerData)).then(function(t){r.dom_=t,r.init_()}),r.attachCallbacksToElement_(),r}return(0,e.default)(u,[{key:"attachCallbacksToElement_",value:function(){this.handleClick_=this.handleClick_.bind(this)}},{key:"init_",value:function(){(0,l.setClickEventListener)(this.dom_,this.handleClick_),(0,l.stopEventBubbling)(this.dom_,"touchstart"),this.layerData.initialProduct&&(this.storyProduct_=new n.default({instanceId:this.instanceId,layer:this.layerData,storyDom:this.storyDom_,group:this.group_,story:this.story_}))}},{key:"handleClick_",value:function(){var t,e=this
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=y(require("@babel/runtime/helpers/classCallCheck")),e=y(require("@babel/runtime/helpers/createClass")),r=y(require("@babel/runtime/helpers/inherits")),i=y(require("@babel/runtime/helpers/possibleConstructorReturn")),a=y(require("@babel/runtime/helpers/getPrototypeOf")),n=y(require("../../components/StoryProduct")),o=require("../../constants/events"),s=require("../../constants/layerTypes"),l=require("../../lib/util"),u=y(require("../base")),c=y(require("./dataConvertor")),d=y(require("./template"));function y(t){return t&&t.__esModule?t:{default:t}}function h(t){var e=_();return function(){var r,n=(0,a.default)(t);if(e){var o=(0,a.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,i.default)(this,r)}}function _(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}var p=function(i){(0,r.default)(u,i);var a=h(u);function u(e){var r,i=e.layer,n=e.story,o=e.group,l=e.storyDom,y=e.instanceId;return(0,t.default)(this,u),(r=a.call(this,{type:s.LayerTemplateTypes.IMAGE_CTA,storyDom:l,instanceId:y})).story_=n,r.group_=o,r.setLayerData((0,c.default)(i,l)),r.generateComponentAndAppendToPage((0,d.default)(r.layerData)).then(function(t){r.dom_=t,r.init_()}),r.attachCallbacksToElement_(),r}return(0,e.default)(u,[{key:"attachCallbacksToElement_",value:function(){this.handleClick_=this.handleClick_.bind(this)}},{key:"init_",value:function(){(0,l.setClickEventListener)(this.dom_,this.handleClick_),(0,l.stopEventBubbling)(this.dom_,"touchstart"),this.layerData.initialProduct&&(this.storyProduct_=new n.default({instanceId:this.instanceId,layer:this.layerData,storyDom:this.storyDom_,group:this.group_,story:this.story_}))}},{key:"handleClick_",value:function(){var t,e=this;if("cta"!==this.layerData.cta_t){var r={event_type:o.LayerEventTypes.ActionClicked,story_group_id:+this.group_.group_id,story_id:+this.story_.story_id,story_group_type:"default",story_interactive_id:null,story_interactive_type:"image_cta",watch_length:null,event_time:Date.now(),uid:this.layerData.uid,click_url:null!==(t=this.layerData.outlink)&&void 0!==t?t:""};if(this.api.sendEvent(r),this.globalInstanceData.events.actionClicked){var i=this.group_.stories.findIndex(function(t){return t.story_id===e.story_.story_id}),a={id:this.story_.story_id,title:this.story_.title,seen:!0,index:i,group_id:this.group_.group_id,media:{actionUrl:this.layerData.outlink}};this.globalInstanceData.events.actionClicked(a)}else{var n=this.layerData.initialProduct;n?this.storyProduct_.onPurchase(n.product_id):this.layerData.outlink&&(0,l.openLink)(this.layerData.outlink)}}}}]),u}(u.default),f=p;exports.default=f;
|
|
7
7
|
},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","../../components/StoryProduct":"GdVG","../../constants/events":"d0lR","../../constants/layerTypes":"aJRz","../../lib/util":"PesM","../base":"skR7","./dataConvertor":"Nt0A","./template":"jMEQ"}]},{},[], null)
|
package/dist/Modern.ba02a4b1.js
CHANGED
|
@@ -5,11 +5,11 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
|
|
|
5
5
|
},{"@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/helpers/toConsumableArray":"Fhqp","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/regenerator":"PMvg","../../../constants/layerTypes":"aJRz","../../../lib/style":"vgU2","../../../lib/util":"PesM","../templates/story":"fRik","../../../components/BottomSheet":"l2Mf","../../../constants/events":"d0lR","../../../constants/directions":"w67G","../../../service":"hs1C","../../../lib/proxy":"qmVm","../../../components/ShareWidget":"YKVc","../../../components/AudioNotification":"uO1E","../../../service/HlsPlayer":"LJ77","../../../layers/CTA":"lS5I","_bundle_loader":"TUK3","../../../components/VideoSeekBar":[["VideoSeekBar.8e29e7fa.js","WHTK"],"WHTK"],"../../../layers/BlankStory":[["BlankStory.87677cd0.js","ODzA"],"ODzA"],"../../../layers/Emoji":[["Emoji.aaf11bbd.js","GGza"],"GGza"],"../../../layers/Poll":[["Poll.b19c685b.js","fJSh"],"fJSh"],"../../../layers/Rating":[["Rating.3787564f.js","raea"],"raea"],"../../../layers/Quiz":[["Quiz.80dd96d2.js","lrR5"],"lrR5"],"../../../layers/Countdown":[["Countdown.6ce06965.js","YoYr"],"YoYr"],"../../../layers/ImageCTA":[["ImageCTA.6e00c2b1.js","J7D7"],"J7D7"],"../../../layers/Media":[["Media.8de69a8d.js","VEUS"],"VEUS"],"../../../layers/Text/index.ts":[["Text.82b687f2.js","rMyZ"],"rMyZ"],"../../../layers/ProductTag":[["ProductTag.54584948.js","cjPL"],"cjPL"],"../../../layers/PromoCode":[["PromoCode.917d4f91.js","N5Sp"],"N5Sp"],"../../../layers/Question":[["Question.e66eba96.js","KeqT"],"KeqT"],"../../../layers/ProductCard":[["ProductCard.89e07296.js","ldNI"],"ldNI"],"../../../layers/ProductCatalog":[["ProductCatalog.42e572d6.js","rFjg"],"rFjg"],"../../../layers/ImageQuiz":[["ImageQuiz.d9fa5596.js","Mxyn"],"Mxyn"]}],"wvHA":[function(require,module,exports) {
|
|
6
6
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=v(require("@babel/runtime/helpers/defineProperty")),e=v(require("@babel/runtime/helpers/asyncToGenerator")),r=v(require("@babel/runtime/helpers/classCallCheck")),s=v(require("@babel/runtime/helpers/createClass")),o=v(require("@babel/runtime/regenerator")),n=v(require("../../../constants/playmode")),i=require("../../../lib/style"),a=require("../../../lib/util"),d=v(require("../../../lib/storage")),u=v(require("../Story")),c=v(require("../templates/storyHeader")),y=v(require("../templates/storyProgress")),l=require("../../../constants/events"),h=v(require("../../../constants/directions")),_=v(require("../../../lib/proxy")),p=require("../../../service");function v(t){return t&&t.__esModule?t:{default:t}}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,s)}return r}function g(e){for(var r=1;r<arguments.length;r++){var s=null!=arguments[r]?arguments[r]:{};r%2?f(Object(s),!0).forEach(function(r){(0,t.default)(e,r,s[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):f(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}var S=function(){function t(e,s,o){(0,r.default)(this,t),this.group_=e,this.key_=s,this.storyInstances_=[],this.progressDoms_=[],this.activeStoryIndex_=0,this.lastSeenStoryIndex_=0,this.loadded_=!1,this.stories_=this.group_.stories,this.instanceId_=o,this.attachCallbacksToElement_(),this.setEventListeners_(),d.default.setInstanceId(this.instanceId_),this.handleConditionalStories()}return(0,s.default)(t,[{key:"attachCallbacksToElement_",value:function(){this.nextStory=this.nextStory.bind(this),this.prevStory=this.prevStory.bind(this),this.hide=this.hide.bind(this),this.storiesObserverCallback_=this.storiesObserverCallback_.bind(this)}},{key:"setEventListeners_",value:function(){var t=this;window.addEventListener("resize",(0,a.debounce)(function(){var e=t.storiesContainer_.childNodes[t.activeStoryIndex_];if(e){var r=e.offsetWidth,s=window.innerWidth/2-r/2;t.activeStoryCenteredPosition_=s,t.renderStories_()}}))}},{key:"render",value:function(){this.groupWrapper_=document.createElement("div"),(0,i.setClass)(this.groupWrapper_,["storyly__story-group","swiper-slide"]),this.groupWrapper_.ariaHidden="true",(0,a.setAttribute)(this.groupWrapper_,"role","presentation"),this.groupWrapper_.dataset.id=this.group_.group_id,this.storiesContainer_=document.createElement("div"),(0,i.setClass)(this.storiesContainer_,["storyly__stories-container"]),this.groupWrapper_.appendChild(this.storiesContainer_);var t=_.default.getNodeByInstanceId(this.instanceId_).getDataFromGlobal().globalInstanceData;return this.globalInstanceData=t,this.storyObserver_=(0,p.intersectionObserverImpl)(this.storiesContainer_,this.storiesObserverCallback_),Promise.resolve(this.groupWrapper_)}},{key:"storiesObserverCallback_",value:function(t){var e=this;t.forEach(function(t){if(t.isIntersecting){var r=t.target;e.storyInstances_.find(function(t){return t.storyDom_===r}).setVideoStoryAsset()}})}},{key:"setStoryInstancesAndListeners_",value:function(){var t=this;this.group_.stories.forEach(function(e,r){var s=new u.default({story:e,key:r,group:t.group_,storiesContainer:t.storiesContainer_,groupWrapper:t.groupWrapper_,progressDoms:t.progressDoms_,instanceId:t.instanceId_});t.storyInstances_[r]=s,t.storyObserver_.observe(s.storyDom_)}),this.setStoriesClickEvents_()}},{key:"setStoriesClickEvents_",value:function(){var t=this,e=function(e,r){var s=e.classList;s.contains("storyly__story-passive")&&(s.contains("storyly__story-next-story")&&(t.nextStory(r),t.handleProgressBarByParameters_(r)),s.contains("storyly__story-prev-story")&&(t.prevStory(r),t.handleProgressBarByParameters_(r)))};this.storiesContainer_.childNodes.forEach(function(t,r){t.removeEventListener("click",function(){return e(t,r)}),t.addEventListener("click",function(){return e(t,r)})})}},{key:"renderStoryGroupHeader_",value:function(){var t,e=(0,a.generateHtmlFromTemplate)((0,c.default)(this.group_,this.instanceId_,this.globalInstanceData));null===(t=this.groupWrapper_.querySelector(".storyly__story-header"))||void 0===t||t.remove(),this.groupWrapper_.prepend(e),(0,a.stopEventBubbling)(e),this.renderProgressLines_()}},{key:"renderProgressLines_",value:function(){var t=document.createElement("div");(0,i.setClass)(t,"storyly__story-group-progress-bar");var e=document.createElement("div");(0,i.setClass)(e,"progress-wrapper"),t.appendChild(e);for(var r=this.group_.stories.length,s=0;s<r;s+=1){var o=(0,a.generateHtmlFromTemplate)((0,y.default)());s<this.activeStoryIndex_&&(0,i.setClass)(o,"seen"),e.appendChild(o),this.progressDoms_.push(o)}this.groupWrapper_.prepend(t)}},{key:"renderProductCart_",value:function(){var t=(0,e.default)(o.default.mark(function t(){var e,r,s,n,i;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=(0,a.getProductLayers)(this.group_),r=this.groupWrapper_.querySelector(".storyly__story-actions"),s=_.default.getNodeByInstanceId(this.instanceId_).getDataFromGlobal(),n=s.isStorylyCartActive,!e.length||!n){t.next=10;break}return t.next=6,require("_bundle_loader")(require.resolve("../../../components/StoryCart"));case 6:return t.next=8,t.sent.default;case 8:i=t.sent,this.storyCart=new i({instanceId:this.instanceId_,parentDom:r});case 10:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"renderStoryNavigations_",value:function(){var t=this,e=(0,a.generateHtmlFromTemplate)('<button class="prev-story-button" data-i18n-key="a11y_prev_story_current_group" tabindex="10"></button>'),r=(0,a.generateHtmlFromTemplate)('<button class="next-story-button" data-i18n-key="a11y_next_story_current_group" tabindex="40"></button>'),s=this.globalInstanceData.direction;e.addEventListener("click",function(e){e.preventDefault(),(0,a.createAndDispatchEvent)(t.groupWrapper_,s===h.default.RTL?"onNextStory":"onPrevStory")}),r.addEventListener("click",function(e){e.preventDefault(),(0,a.createAndDispatchEvent)(t.groupWrapper_,s===h.default.RTL?"onPrevStory":"onNextStory")}),this.groupWrapper_.appendChild(e),this.groupWrapper_.appendChild(r)}},{key:"prevStory",value:function(t){var e=this;if(this.globalInstanceData.shareParams.playMode!==n.default.STORY||this.globalInstanceData.shareParams.group.group_id!==this.group_.group_id){var r=this.storyInstances_[this.activeStoryIndex_];if(0===this.activeStoryIndex_)return(0,a.createAndDispatchEvent)(this.groupWrapper_,"onPrevGroup"),void(0!==this.key_&&r.hide({holdActive:!0,isBack:!0}));r.hide({isBack:!0}),this.storyState_().remove(),this.activeStoryIndex_=null!=t?t:this.activeStoryIndex_-1,this.lastSeenStoryIndex_=this.activeStoryIndex_,this.renderStories_().then(function(){e.storyInstances_[e.activeStoryIndex_].show(),(0,a.createAndDispatchEvent)(e.groupWrapper_,"onStoryImpression")})}else(0,a.createAndDispatchEvent)(this.groupWrapper_,"onCloseGroup")}},{key:"nextStory",value:function(t){var e=this;if(this.globalInstanceData.shareParams.playMode!==n.default.STORY||this.globalInstanceData.shareParams.group.group_id!==this.group_.group_id){var r=this.storyInstances_[this.activeStoryIndex_];if(this.group_.stories.length-1===this.activeStoryIndex_)return this.storyState_().add(),(0,a.createAndDispatchEvent)(this.groupWrapper_,"onNextGroup"),void r.hide({isBack:!0});r.hide(),this.activeStoryIndex_=null!=t?t:this.activeStoryIndex_+1,this.lastSeenStoryIndex_=this.activeStoryIndex_,this.storyState_().add(),this.renderStories_().then(function(){e.storyInstances_[e.activeStoryIndex_].show(),(0,a.createAndDispatchEvent)(e.groupWrapper_,"onStoryImpression"),(0,a.createAndDispatchEvent)(e.groupWrapper_,"onStoryComplete")})}else(0,a.createAndDispatchEvent)(this.groupWrapper_,"onCloseGroup")}},{key:"renderStories_",value:function(){var t=this,e=this.globalInstanceData.direction===h.default.RTL?"right":"left";return this.storiesContainer_.childNodes.forEach(function(r,s){if(s<t.activeStoryIndex_){(0,i.removeClass)(r,"storyly__story-next-story"),(0,i.setClass)(r,["storyly__story-passive","storyly__story-prev-story"]),(0,a.setAttribute)(r,"tabindex","-1"),(0,a.setAttribute)(r,"aria-hidden","true");var o=r.offsetWidth;t.activeStoryIndex_-s==1?(0,i.setStyle)(r,[e,"".concat(t.activeStoryCenteredPosition_-o-54,"px")]):(0,i.setStyle)(r,[e,"".concat(t.activeStoryCenteredPosition_-o-54-(.6*o+20)*(t.activeStoryIndex_-s-1),"px")])}if(s>t.activeStoryIndex_)if((0,i.removeClass)(r,"storyly__story-prev-story"),(0,i.setClass)(r,["storyly__story-passive","storyly__story-next-story"]),(0,a.setAttribute)(r,"tabindex","-1"),(0,a.setAttribute)(r,"aria-hidden","true"),s-t.activeStoryIndex_==1)(0,i.setStyle)(r,[e,"".concat(t.activeStoryCenteredPosition_+t.activeStoryOffsetWidth_+54,"px")]);else{var n=r.offsetWidth;(0,i.setStyle)(r,[e,"".concat(t.activeStoryCenteredPosition_+t.activeStoryOffsetWidth_+54+(s-t.activeStoryIndex_-1)*(.6*n+20),"px")])}s===t.activeStoryIndex_&&((0,i.removeClass)(r,"storyly__story-passive"),(0,i.removeClass)(r,"storyly__story-next-story"),(0,i.removeClass)(r,"storyly__story-prev-story"),(0,a.setAttribute)(r,"aria-hidden","false"),(0,a.setAttribute)(r,"tabindex","20"),(0,i.setStyle)(r,[e,"".concat(t.activeStoryCenteredPosition_,"px")]))}),Promise.resolve()}},{key:"loadState_",value:function(){var t=this.storyState_().get();this.activeStoryIndex_=t}},{key:"storyState_",value:function(){var t=this,e=this.group_.group_id;return{add:function(){var r,s=d.default.getItemFromInstance("Storyly_story-state"),o=t.group_.stories[t.activeStoryIndex_];(null===(r=s[e])||void 0===r?void 0:r.some(function(t){return t.storyId===o.story_id}))||(s[e]?s[e].push({storyIndex:t.activeStoryIndex_,storyId:o.story_id,time:Date.now()}):s[e]=[{storyIndex:t.activeStoryIndex_,storyId:o.story_id,time:Date.now()}],d.default.setItemToInstance("Storyly_story-state",s))},remove:function(r){var s,o=d.default.getItemFromInstance("Storyly_story-state"),n=t.group_.stories[t.activeStoryIndex_].story_id;r&&(n=r);var i=null===(s=o[e])||void 0===s?void 0:s.filter(function(t){return t.storyId!==n});o[e]=null!=i?i:{},d.default.setItemToInstance("Storyly_story-state",o)},get:function(){var r=g({},d.default.getItemFromInstance("Storyly_story-state")||{}),s=0;if(r[e]){var o,n=!0,i=r[e].map(function(t){return t.storyId});return t.group_.stories.forEach(function(t,e){"number"!=typeof o?i.includes(t.story_id)||(o=e,n=!1):n=!1}),n?0:(s=o)>=0?s:(i.forEach(function(e){var r=t.group_.stories.findIndex(function(t){return t.story_id===e});r>=0?s=r:t.storyState_().remove(e)}),s)}return s}}}},{key:"handleProgressBarByParameters_",value:function(t){for(var e=this.progressDoms_.length,r=0;r<e;r+=1)r<t?(0,i.setClass)(this.progressDoms_[r],"seen"):(0,i.removeClass)(this.progressDoms_[r],"seen")}},{key:"sendGroupViewedEvent_",value:function(){var t=g({},this.group_);(0,a.createAndDispatchEvent)(this.groupWrapper_,"onCustomerEvent",{eventName:l.CustomerEventTypes.onStoryGroupViewed,params:t})}},{key:"createStoryAndProgress_",value:function(t,e){var r=new u.default({story:t,key:e,group:this.group_,storiesContainer:this.storiesContainer_,groupWrapper:this.groupWrapper_,progressDoms:this.progressDoms_,instanceId:this.instanceId_,condition:!0});this.storyObserver_.observe(r.storyDom_),this.storyInstances_.splice(e,0,r),this.storyInstances_.forEach(function(t,e){return t.setKey(e)});var s=(0,a.generateHtmlFromTemplate)((0,y.default)()),o=this.groupWrapper_.querySelector(".progress-wrapper");this.activeStoryIndex_>=e&&(this.activeStoryIndex_+=1,(0,i.setClass)(s,"seen")),o.querySelectorAll(".progress")[e]?o.querySelectorAll(".progress")[e].before(s):o.appendChild(s),this.progressDoms_.splice(e,0,s),this.renderStoryNavigations_();var n=window.innerHeight/100*85*9/16,d=window.innerWidth/2-n/2;this.activeStoryCenteredPosition_=d,this.activeStoryOffsetWidth_=n,this.renderStories_(),this.setStoriesClickEvents_()}},{key:"handleConditionalStories",value:function(t){var e=this,r=d.default.setInstanceId(this.instanceId_).getItemFromInstance("Storyly_componentsData"),s=[];return this.stories_.forEach(function(t){t.conditions?t.conditions.every(function(t){return t.some(function(t){var e=r[t.i];return void 0!==e&&e===+t.r.p})})&&s.push(t):s.push(t)}),t&&s.forEach(function(t,r){-1===e.group_.stories.findIndex(function(e){return e.story_id===t.story_id})&&e.createStoryAndProgress_(t,r)}),this.group_.stories=s,Promise.resolve(s)}},{key:"show",value:function(){this.storyCart?this.storyCart.refresh():this.renderProductCart_(),this.sendGroupViewedEvent_(),this.storyInstances_[this.activeStoryIndex_].show(),this.storyState_().add()}},{key:"load",value:function(){if(!this.loadded_){this.group_.nudge||this.loadState_(),this.storyInstances_=[],this.progressDoms_=[],this.renderStoryGroupHeader_(),this.renderStoryNavigations_(),this.setStoryInstancesAndListeners_();var t=window.innerHeight/100*85*9/16,e=window.innerWidth/2-t/2;this.activeStoryCenteredPosition_=e,this.activeStoryOffsetWidth_=t,this.renderStories_(),this.loadded_=!0}}},{key:"loadByParameters",value:function(t){this.storyInstances_.length||this.load(),(0,i.removeClass)(this.storyInstances_[this.activeStoryIndex_].storyDom_,"active"),this.activeStoryIndex_=t,this.loadedByParameters_=!0,this.handleProgressBarByParameters_(t),this.renderStories_()}},{key:"unLoad",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).holdActive,e=void 0!==t&&t,r=this.group_.stories.length-1===this.activeStoryIndex_;this.storyInstances_[this.activeStoryIndex_].hide({holdActive:!r&&!this.loadedByParameters_&&e}),this.loadedByParameters_&&(this.loadState_(),this.loadedByParameters_=!1,this.handleProgressBarByParameters_(this.activeStoryIndex_),this.renderStories_()),r&&(this.activeStoryIndex_=0,this.progressDoms_.forEach(function(t){(0,i.removeClass)(t,"seen")}),this.renderStories_())}},{key:"hide",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).holdActive,e=void 0!==t&&t;this.unLoad({holdActive:e}),this.globalInstanceData.shareParams={}}},{key:"getActiveStory",value:function(){var t,e=this.storyInstances_[this.activeStoryIndex_];return g(g({},null!==(t=this.group_.stories[this.activeStoryIndex_])&&void 0!==t?t:{}),{},{storyIndex:this.activeStoryIndex_,instance:e})}},{key:"getPrevStory",value:function(){var t,e=this.storyInstances_[this.activeStoryIndex_-1];return g(g({},null!==(t=this.group_.stories[this.activeStoryIndex_-1])&&void 0!==t?t:{}),{},{instance:e})}},{key:"setKey",value:function(t){this.key_=t}},{key:"isAllStoriesSeen",value:function(){return this.group_.stories.length-1===this.lastSeenStoryIndex_}},{key:"sendGroupClickedEvent",value:function(t){var e=g({},this.group_);(0,a.createAndDispatchEvent)(this.groupWrapper_,"onCustomerEvent",{eventName:"next"===t?l.CustomerEventTypes.onNextStoryGroup:l.CustomerEventTypes.onPreviousStoryGroup,params:e})}}]),t}(),I=S;exports.default=I;
|
|
7
7
|
},{"@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/regenerator":"PMvg","../../../constants/playmode":"Ooqf","../../../lib/style":"vgU2","../../../lib/util":"PesM","../../../lib/storage":"NA5d","../Story":"UKq4","../templates/storyHeader":"LuBi","../templates/storyProgress":"vAQQ","../../../constants/events":"d0lR","../../../constants/directions":"w67G","../../../lib/proxy":"qmVm","../../../service":"hs1C","_bundle_loader":"TUK3","../../../components/StoryCart":[["StoryCart.c7184f81.js","TJeL"],"TJeL"]}],"u7Oq":[function(require,module,exports) {
|
|
8
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prev";return'\n <div class="story-group-navigation-button '.concat(n,'-story-group">\n <h6 ').concat("prev"===n?'data-i18n-key="previous_stories"':'data-i18n-key="next_stories"',' aria-hidden="true">').concat("prev"===n?"PREVIOUS STORIES":"NEXT STORIES",'</h6>\n <button\n class="story-group-navigation-button-container"\n tabindex="').concat("prev"===n?"5":"45",'"\n ').concat("prev"===n?'data-i18n-key="a11y_prev_group_story"':'data-i18n-key="a11y_next_group_story"','\n >\n <div class="story-group-navigation-button-container-icon">\n <span class="next-story-group-icon"
|
|
8
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prev";return'\n <div class="story-group-navigation-button '.concat(n,'-story-group">\n <h6 ').concat("prev"===n?'data-i18n-key="previous_stories"':'data-i18n-key="next_stories"',' aria-hidden="true">').concat("prev"===n?"PREVIOUS STORIES":"NEXT STORIES",'</h6>\n <button\n class="story-group-navigation-button-container"\n tabindex="').concat("prev"===n?"5":"45",'"\n ').concat("prev"===n?'data-i18n-key="a11y_prev_group_story"':'data-i18n-key="a11y_next_group_story"','\n >\n <div class="story-group-navigation-button-container-icon">\n <span class="next-story-group-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M2.667 8h10.666M9.333 4l4 4-4 4"/></svg>\n </span>\n <span class="prev-story-group-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.333 8H2.667M6.667 4l-4 4 4 4"/></svg>\n </span>\n </div>\n <div class="story-group-navigation-button-container-inner">\n <div class="story-group-cover-image">\n <img src="" alt="story group cover image" aria-hidden="true" />\n </div>\n <div class="story-group-title">\n <span></span>\n </div>\n </div>\n </button>\n </div>\n ')};exports.default=n;
|
|
9
9
|
},{}],"KwS7":[function(require,module,exports) {
|
|
10
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=function(){return'\n <div class="storyly__keyboard-shortcuts" tabindex="-1" aria-hidden="true">\n <h6 data-i18n-key="keyboard_shortcuts">KEYBOARD SHORTCUTS</h6>\n <ul id="storyly__keyboard-shortcuts-menu" class="storyly__keyboard-shortcuts-menu">\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_r_a_next_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.66663 8H13.3333" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M9.33337 4L13.3334 8L9.33337 12" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n </span>\n <span data-i18n-key="shortcut_next_story">Next story</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_l_a_prev_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.3333 8H2.66659" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M6.66675 4L2.66675 8L6.66675 12" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n </span>\n <span data-i18n-key="shortcut_preview_story">Previous story</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="-1" aria-hidden="true">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg width="23" height="6" viewBox="0 0 23 6" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.95703 4.39844C2.67969 4.39844 3.21094 4.22656 3.47656 3.96094C3.73828 3.69531 3.83984 3.41016 3.83984 3.08203C3.83984 2.75781 3.74609 2.49609 3.55469 2.30078C3.36328 2.10547 3.13281 1.97266 2.86328 1.90625C2.58984 1.83984 2.32031 1.78906 2.05078 1.75391C1.78125 1.71875 1.55469 1.66797 1.36328 1.59375C1.17188 1.52344 1.07812 1.41797 1.07812 1.27344C1.07812 1.01172 1.33203 0.878906 1.83984 0.878906C2.33594 0.878906 2.62891 1.03906 2.71875 1.35938H3.71875C3.69922 0.957031 3.52344 0.628906 3.19531 0.375C2.86719 0.125 2.42969 0 1.87891 0C1.30469 0 0.859375 0.117188 0.546875 0.351562C0.234375 0.589844 0.078125 0.886719 0.078125 1.24219C0.078125 1.52344 0.148438 1.75781 0.285156 1.94531C0.421875 2.13672 0.589844 2.26953 0.796875 2.34766C1 2.42578 1.22266 2.49219 1.46094 2.54688C1.69922 2.60547 1.91797 2.64453 2.125 2.66797C2.53125 2.71484 2.83984 2.84766 2.83984 3.08203C2.83984 3.375 2.55859 3.51953 2 3.51953C1.43359 3.52344 1.10156 3.32422 1 2.92188H0C0.0195312 3.32422 0.203125 3.67188 0.550781 3.96094C0.898438 4.25391 1.36719 4.39844 1.95703 4.39844Z" fill="white"/>\n <path d="M5.90903 5.92188V3.92188H5.94809C6.2645 4.23828 6.62388 4.39844 7.02622 4.39844C7.54575 4.39844 7.95981 4.21094 8.27622 3.83594C8.59262 3.46094 8.74887 2.91406 8.74887 2.19922C8.74887 1.48438 8.59262 0.941406 8.27622 0.5625C7.95981 0.1875 7.54575 0 7.02622 0C6.7645 0 6.53013 0.0625 6.32309 0.1875C6.11216 0.3125 5.97544 0.421875 5.90903 0.519531H5.86606L5.78794 0.0820312H4.94809V5.92188H5.90903ZM6.827 3.51953C6.24888 3.51953 5.86606 3.05469 5.86606 2.19922C5.86606 1.34375 6.24888 0.878906 6.827 0.878906C7.10434 0.878906 7.33481 0.992188 7.51841 1.22266C7.69809 1.45312 7.78794 1.77734 7.78794 2.19922C7.78794 2.62109 7.69809 2.94531 7.5145 3.17578C7.33091 3.40625 7.10434 3.51953 6.827 3.51953Z" fill="white"/>\n <path d="M11.2165 3.51953C10.736 3.51953 10.4978 3.35938 10.4978 3.03906C10.4978 2.71875 10.736 2.55859 11.2165 2.55859H12.2556V2.67969C12.2556 2.91016 12.1618 3.10547 11.9704 3.26953C11.779 3.4375 11.5251 3.51953 11.2165 3.51953ZM11.0563 4.39844C11.5915 4.39844 11.9899 4.19922 12.2556 3.80078H12.2946L12.4157 4.32031H13.2165V1.60156C13.2165 1.11328 13.0603 0.726562 12.7517 0.433594C12.4431 0.144531 12.0095 0 11.4548 0C10.9118 0 10.4938 0.125 10.2009 0.378906C9.90791 0.632812 9.73994 0.949219 9.69697 1.32031H10.6579C10.6774 1.20703 10.7595 1.10547 10.8962 1.01562C11.0329 0.925781 11.2087 0.878906 11.4157 0.878906C11.6657 0.878906 11.8688 0.945312 12.0251 1.07812C12.1774 1.21094 12.2556 1.37109 12.2556 1.55859V1.76172H11.2165C10.0876 1.76172 9.53681 2.25 9.53681 3.08203C9.53681 3.89844 10.0759 4.39844 11.0563 4.39844Z" fill="white"/>\n <path d="M16.2466 4.39844C17.2349 4.39844 17.9185 3.83594 18.1646 2.87891H17.2037C17.0474 3.28516 16.6958 3.51953 16.2466 3.51953C15.5865 3.51953 15.1646 3.05469 15.1646 2.19922C15.1646 1.34375 15.5865 0.878906 16.2466 0.878906C16.6958 0.878906 17.0435 1.11328 17.2037 1.51953H18.1646C17.9185 0.5625 17.2349 0 16.2466 0C15.6372 0 15.1451 0.199219 14.7701 0.59375C14.3912 0.992188 14.2037 1.52734 14.2037 2.19922C14.2037 2.87109 14.3912 3.40625 14.7701 3.80078C15.149 4.19922 15.6412 4.39844 16.2466 4.39844Z" fill="white"/>\n <path d="M20.9955 4.39844C21.5385 4.39844 21.9564 4.26172 22.2494 3.99219C22.5385 3.72266 22.7299 3.40625 22.8275 3.03906H21.8666C21.7064 3.35938 21.4018 3.51953 20.9525 3.51953C20.6439 3.51953 20.3978 3.42578 20.2143 3.23828C20.0307 3.05469 19.9174 2.8125 19.8744 2.51953H22.9525L22.9955 2.08203C22.9955 1.44531 22.8119 0.941406 22.4486 0.5625C22.0814 0.1875 21.5971 0 20.9955 0C20.351 0 19.8432 0.191406 19.4721 0.578125C19.101 0.964844 18.9135 1.50781 18.9135 2.19922C18.9135 2.89453 19.101 3.43359 19.4721 3.82031C19.8432 4.20703 20.351 4.39844 20.9955 4.39844ZM19.8744 1.83984C19.9682 1.25 20.3393 0.878906 20.9564 0.878906C21.5736 0.878906 21.9603 1.26172 22.0346 1.83984H19.8744Z" fill="white"/>\n </svg>\n </span>\n <span data-i18n-key="shortcut_space">Play/Pause</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_e_close_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg width="14" height="5" viewBox="0 0 14 5" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M2.03125 4.39844C2.52734 4.39844 2.93359 4.27734 3.25 4.03125C3.56641 3.78906 3.78906 3.47266 3.91797 3.08203H2.91797C2.6875 3.39844 2.39453 3.55859 2.03906 3.55859C1.72266 3.55859 1.47266 3.46094 1.28125 3.26172C1.08984 3.06641 0.980469 2.80469 0.960938 2.48047H3.96094L4 2.08203C4 1.49219 3.82031 1 3.46484 0.597656C3.10938 0.199219 2.62109 0 2 0C1.39062 0 0.90625 0.195312 0.542969 0.582031C0.179688 0.972656 0 1.51172 0 2.19922C0 2.89453 0.183594 3.43359 0.546875 3.82031C0.910156 4.20703 1.40625 4.39844 2.03125 4.39844ZM0.960938 1.76172C1.08984 1.18359 1.45703 0.839844 2 0.839844C2.28906 0.839844 2.52344 0.925781 2.70703 1.09766C2.88672 1.26953 2.99609 1.49219 3.03906 1.76172H0.960938Z" fill="white"/>\n <path d="M6.64031 4.39844C7.21453 4.39844 7.65203 4.28125 7.95281 4.04297C8.25359 3.80469 8.40203 3.5 8.40203 3.12109C8.40203 2.85156 8.34344 2.625 8.22234 2.44141C8.10125 2.25781 7.94891 2.12891 7.76922 2.04688C7.58562 1.96875 7.39031 1.89844 7.17938 1.83594C6.96844 1.77734 6.77313 1.73047 6.59344 1.69922C6.23016 1.64062 5.96063 1.48828 5.96063 1.24219C5.96063 0.972656 6.17547 0.839844 6.60125 0.839844C6.99969 0.84375 7.25359 0.976562 7.35906 1.24219H8.35906C8.19109 0.480469 7.60125 0 6.60125 0C6.09734 0 5.70672 0.117188 5.42547 0.351562C5.14031 0.589844 4.99969 0.886719 4.99969 1.24219C4.99969 1.56641 5.08563 1.82812 5.25359 2.02734C5.42156 2.22656 5.62469 2.36328 5.86688 2.43359C6.10516 2.50781 6.34344 2.56641 6.58172 2.60938C6.82 2.65625 7.02313 2.71875 7.19109 2.79297C7.35906 2.86719 7.44109 2.97656 7.44109 3.12109C7.44109 3.41406 7.17547 3.55859 6.64031 3.55859C6.21453 3.55859 5.92156 3.36719 5.83953 3.08203H4.83953C4.92547 3.48047 5.12078 3.80078 5.42938 4.03906C5.73406 4.27734 6.13641 4.39844 6.64031 4.39844Z" fill="white"/>\n <path d="M11.2806 4.39844C11.7767 4.39844 12.1869 4.26562 12.5111 4.00391C12.8353 3.74219 13.0541 3.40625 13.1595 3H12.2416C12.0345 3.37109 11.7142 3.55859 11.2806 3.55859C10.9564 3.55859 10.6947 3.44141 10.4955 3.20312C10.2963 2.96484 10.1986 2.63281 10.1986 2.19922C10.1986 1.76562 10.2963 1.43359 10.4955 1.19531C10.6947 0.957031 10.9564 0.839844 11.2806 0.839844C11.7142 0.839844 12.0345 1.02734 12.2416 1.39844H13.1595C13.0541 0.996094 12.8353 0.660156 12.5111 0.394531C12.1869 0.132812 11.7767 0 11.2806 0C10.6713 0 10.1869 0.195312 9.82359 0.582031C9.46031 0.972656 9.28063 1.51172 9.28063 2.19922C9.28063 2.88672 9.46422 3.42578 9.8275 3.8125C10.1908 4.20312 10.6752 4.39844 11.2806 4.39844Z" fill="white"/>\n </svg>\n </span>\n <span data-i18n-key="shortcut_esc">Close story</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_s_share_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg width="7" height="9" viewBox="0 0 7 9" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M3.24414 8.10742C4.18945 8.10742 4.91992 7.89258 5.44092 7.46826C5.95654 7.04395 6.21436 6.46924 6.21436 5.74414C6.21436 5.35742 6.13916 5.02441 5.9834 4.74512C5.67725 4.18652 5.16699 3.93408 4.5708 3.73535C3.97461 3.54199 3.35693 3.4292 2.86816 3.27344C2.37402 3.12305 2.03564 2.85449 2.03564 2.44629C2.03564 2.18848 2.1377 1.96826 2.3418 1.78564C2.5459 1.60303 2.86279 1.51172 3.29785 1.51172C4.00146 1.51172 4.42578 1.82324 4.56543 2.44629H6.04785C5.98877 1.7749 5.72021 1.23242 5.24219 0.813477C4.76416 0.399902 4.09814 0.19043 3.24414 0.19043C2.46533 0.19043 1.82617 0.38916 1.31592 0.78125C0.805664 1.17871 0.547852 1.73193 0.547852 2.44629C0.547852 2.85449 0.623047 3.20361 0.778809 3.49902C0.93457 3.79443 1.1333 4.01465 1.38037 4.16504C1.62744 4.31543 1.90137 4.43896 2.19678 4.54102C2.79297 4.73975 3.40527 4.83105 3.89941 4.95996C4.39355 5.09424 4.73193 5.35205 4.73193 5.74414C4.73193 6.3457 4.22705 6.7915 3.24414 6.7915C2.85205 6.7915 2.51904 6.68408 2.25049 6.47461C1.98193 6.26514 1.8208 6.00732 1.76172 5.69043H0.273926C0.327637 6.4585 0.628418 7.05469 1.18164 7.47363C1.72949 7.89795 2.41699 8.10742 3.24414 8.10742Z" fill="white"/>\n </svg>\n </span>\n <span data-i18n-key="shortcut_share">Share story link</span>\n </li>\n </ul>\n </div>\n '};exports.default=t;
|
|
10
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s=function(){return'\n <div class="storyly__keyboard-shortcuts" tabindex="-1" aria-hidden="true">\n <h6 data-i18n-key="keyboard_shortcuts">KEYBOARD SHORTCUTS</h6>\n <ul id="storyly__keyboard-shortcuts-menu" class="storyly__keyboard-shortcuts-menu">\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_r_a_next_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M2.667 8h10.666M9.333 4l4 4-4 4"/></svg>\n </span>\n <span data-i18n-key="shortcut_next_story">Next story</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_l_a_prev_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.333 8H2.667M6.667 4l-4 4 4 4"/></svg>\n </span>\n <span data-i18n-key="shortcut_preview_story">Previous story</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="-1" aria-hidden="true">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="23" height="6" fill="none"><path fill="#fff" d="M1.957 4.398c.723 0 1.254-.171 1.52-.437.261-.266.363-.55.363-.879 0-.324-.094-.586-.285-.781a1.43 1.43 0 0 0-.692-.395 7.597 7.597 0 0 0-.812-.152 2.974 2.974 0 0 1-.688-.16c-.191-.07-.285-.176-.285-.32 0-.262.254-.395.762-.395.496 0 .789.16.879.48h1a1.275 1.275 0 0 0-.524-.984C2.867.125 2.43 0 1.88 0 1.305 0 .859.117.547.352.234.59.078.887.078 1.242c0 .281.07.516.207.703.137.192.305.325.512.403.203.078.426.144.664.199.238.058.457.098.664.121.406.047.715.18.715.414 0 .293-.281.438-.84.438-.566.003-.898-.196-1-.598H0c.02.402.203.75.55 1.039.348.293.817.437 1.407.437ZM5.909 5.922v-2h.04c.316.316.675.476 1.077.476.52 0 .934-.187 1.25-.562.317-.375.473-.922.473-1.637S8.593.941 8.276.563C7.96.188 7.546 0 7.026 0c-.261 0-.496.063-.703.188-.21.124-.348.234-.414.332h-.043L5.788.082h-.84v5.84h.961Zm.918-2.402c-.578 0-.96-.465-.96-1.32 0-.856.382-1.321.96-1.321.277 0 .508.113.691.344.18.23.27.554.27.976 0 .422-.09.746-.274.977a.84.84 0 0 1-.687.344ZM11.216 3.52c-.48 0-.718-.16-.718-.48 0-.321.238-.481.719-.481h1.039v.12c0 .231-.094.426-.286.59-.191.168-.445.25-.754.25Zm-.16.878c.536 0 .934-.199 1.2-.597h.039l.12.52h.802V1.6c0-.488-.157-.874-.465-1.167C12.443.144 12.009 0 11.455 0c-.543 0-.961.125-1.254.379a1.43 1.43 0 0 0-.504.941h.96c.02-.113.102-.215.24-.304a.934.934 0 0 1 .519-.137c.25 0 .453.066.61.2.151.132.23.292.23.48v.203h-1.04c-1.128 0-1.68.488-1.68 1.32 0 .816.54 1.316 1.52 1.316ZM16.247 4.398c.988 0 1.672-.562 1.918-1.52h-.961c-.157.407-.508.642-.957.642-.66 0-1.082-.465-1.082-1.32 0-.856.421-1.321 1.082-1.321.449 0 .797.234.957.64h.96C17.92.564 17.235 0 16.248 0c-.61 0-1.102.2-1.477.594-.379.398-.566.933-.566 1.605 0 .672.187 1.207.566 1.602.379.398.871.597 1.477.597ZM20.995 4.398c.543 0 .961-.136 1.254-.406.29-.27.48-.586.579-.953h-.961c-.16.32-.465.48-.915.48-.308 0-.554-.093-.738-.28a1.243 1.243 0 0 1-.34-.72h3.079l.043-.437c0-.637-.184-1.14-.547-1.52C22.08.188 21.597 0 20.995 0c-.644 0-1.152.191-1.523.578-.371.387-.559.93-.559 1.621 0 .696.188 1.235.56 1.621.37.387.878.578 1.523.578Zm-1.12-2.558c.093-.59.464-.961 1.081-.961.618 0 1.004.383 1.079.96h-2.16Z"/></svg>\n </span>\n <span data-i18n-key="shortcut_space">Play/Pause</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_e_close_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="14" height="5" fill="none"><path fill="#fff" d="M2.031 4.398c.496 0 .903-.12 1.219-.367.316-.242.54-.558.668-.949h-1c-.23.316-.523.477-.879.477-.316 0-.566-.098-.758-.297-.191-.196-.3-.457-.32-.782h3L4 2.082C4 1.492 3.82 1 3.465.598 3.109.199 2.62 0 2 0 1.39 0 .906.195.543.582.18.972 0 1.512 0 2.199c0 .696.184 1.235.547 1.621.363.387.86.578 1.484.578ZM.961 1.762C1.09 1.184 1.457.84 2 .84c.29 0 .523.086.707.258.18.172.29.394.332.664H.961ZM6.64 4.398c.575 0 1.012-.117 1.313-.355.3-.238.449-.543.449-.922 0-.27-.059-.496-.18-.68a1.066 1.066 0 0 0-.453-.394 5.47 5.47 0 0 0-1.176-.348c-.363-.058-.632-.21-.632-.457 0-.27.214-.402.64-.402.399.004.653.137.758.402h1C8.191.48 7.601 0 6.601 0c-.504 0-.894.117-1.176.352a1.113 1.113 0 0 0-.425.89c0 .324.086.586.254.785.168.2.37.336.613.407.238.074.476.132.715.175a2.9 2.9 0 0 1 .61.184c.167.074.25.184.25.328 0 .293-.267.438-.802.438-.425 0-.718-.192-.8-.477h-1c.085.398.28.719.59.957.304.238.706.36 1.21.36ZM11.28 4.398c.497 0 .907-.132 1.231-.394.324-.262.543-.598.649-1.004h-.918c-.208.371-.528.559-.961.559a.972.972 0 0 1-.786-.356c-.199-.238-.296-.57-.296-1.004 0-.433.097-.765.296-1.004.2-.238.461-.355.786-.355.433 0 .753.187.96.558h.918a1.894 1.894 0 0 0-.648-1.003C12.187.133 11.777 0 11.281 0c-.61 0-1.094.195-1.457.582-.364.39-.543.93-.543 1.617 0 .688.183 1.227.546 1.614.364.39.848.585 1.454.585Z"/></svg>\n </span>\n <span data-i18n-key="shortcut_esc">Close story</span>\n </li>\n <li class="storyly__keyboard-shortcuts-menu-item" role="menuitem" tabindex="51" data-i18n-key="a11y_s_share_story">\n <span class="storyly__keyboard-shortcuts-menu-item-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="7" height="9" fill="none"><path fill="#fff" d="M3.244 8.107c.945 0 1.676-.214 2.197-.639.516-.424.773-.999.773-1.724 0-.387-.075-.72-.23-.999-.307-.558-.817-.81-1.413-1.01-.596-.193-1.214-.306-1.703-.462-.494-.15-.832-.419-.832-.827 0-.258.102-.478.306-.66.204-.183.52-.274.956-.274.703 0 1.128.311 1.267.934h1.483c-.06-.671-.328-1.214-.806-1.633C4.764.4 4.098.19 3.244.19c-.779 0-1.418.2-1.928.591-.51.398-.768.95-.768 1.665 0 .408.075.758.23 1.053.157.295.355.516.602.666.247.15.521.274.817.376.596.199 1.208.29 1.702.419.495.134.833.392.833.784 0 .602-.505 1.048-1.488 1.048-.392 0-.725-.108-.994-.317a1.257 1.257 0 0 1-.488-.785H.274c.054.768.354 1.365.908 1.784.547.424 1.235.633 2.062.633Z"/></svg>\n </span>\n <span data-i18n-key="shortcut_share">Share story link</span>\n </li>\n </ul>\n </div>\n '};exports.default=s;
|
|
11
11
|
},{}],"ttcm":[function(require,module,exports) {
|
|
12
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=function(){return'\n\t<div class="storyly__story-modal">\n\t\t<div class="storyly__story-modal-header">\n\t\t\t<div class="storyly__story-modal-header-close-icon">\n\t\t\t\t<svg
|
|
12
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=function(){return'\n\t<div class="storyly__story-modal">\n\t\t<div class="storyly__story-modal-header">\n\t\t\t<div class="storyly__story-modal-header-close-icon">\n\t\t\t\t<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#616161" fill-rule="evenodd" d="M12.59 3.411a.833.833 0 0 1 0 1.179l-8 8A.833.833 0 0 1 3.41 11.41l8-8a.833.833 0 0 1 1.179 0Z" clip-rule="evenodd"/><path fill="#616161" fill-rule="evenodd" d="M3.411 3.411a.833.833 0 0 1 1.179 0l8 8a.834.834 0 0 1-1.179 1.179l-8-8a.833.833 0 0 1 0-1.179Z" clip-rule="evenodd"/></svg>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="storyly__story-modal-body"></div>\n\t\t<div class="storyly__story-modal-footer"></div>\n\t</div>'};exports.default=t;
|
|
13
13
|
},{}],"b3z1":[function(require,module,exports) {
|
|
14
14
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=l(require("@babel/runtime/helpers/asyncToGenerator")),t=l(require("@babel/runtime/helpers/classCallCheck")),a=l(require("@babel/runtime/helpers/createClass")),i=l(require("@babel/runtime/regenerator")),s=require("../../lib/util"),r=l(require("./template"));function l(e){return e&&e.__esModule?e:{default:e}}var n=function(){function l(e){var a=e.groupsOverlay,i=e.getActiveGroup;(0,t.default)(this,l),this.groupsOverlay_=a,this.active_=!1,this.getActiveGroup_=i,this.overlay_=this.groupsOverlay_.querySelector(".storyly__story-group-overlay"),this.attachCallbacksToElement_(),this.storyObserver_(this.storyObserverCallback_)}return(0,a.default)(l,[{key:"attachCallbacksToElement_",value:function(){this.handlePlayStatus_=this.handlePlayStatus_.bind(this),this.toggle=this.toggle.bind(this),this.activate_=this.activate_.bind(this),this.deactivate_=this.deactivate_.bind(this),this.storyObserverCallback_=this.storyObserverCallback_.bind(this),this.storyObserver_=this.storyObserver_.bind(this)}},{key:"init_",value:function(){this.active_||(this.modal_=(0,s.generateHtmlFromTemplate)((0,r.default)()),this.closeIcon_=this.modal_.querySelector(".storyly__story-modal-header-close-icon"),this.closeIcon_.addEventListener("click",this.toggle))}},{key:"activate_",value:function(e,t){var a=this;if(e&&t){this.init_(),this.modal_.children[1].appendChild(e),this.modal_.lastElementChild.appendChild(t),setTimeout(function(){return a.modal_.classList.add("active")},0),this.overlay_.classList.add("active");var i=this.groupsOverlay_.querySelector(".swiper");i.insertBefore(this.modal_,i.firstChild),this.active_=!0}}},{key:"deactivate_",value:function(){this.modal_.classList.remove("active"),this.overlay_.classList.remove("active"),this.groupsOverlay_.querySelector(".swiper").removeChild(this.modal_),this.active_=!1}},{key:"toggle",value:function(e,t,a){var i;a?this.rerender_(e,t):null!==(i=this.modal_)&&void 0!==i&&i.classList.contains("active")?this.deactivate_():this.activate_(e,t),this.handlePlayStatus_()}},{key:"rerender_",value:function(){var t=(0,e.default)(i.default.mark(function e(t,a){var s,r;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:s=this.modal_.children[1].firstElementChild,r=this.modal_.lastElementChild.firstElementChild,s.replaceWith(t),r.replaceWith(a);case 4:case"end":return e.stop()}},e,this)}));return function(e,a){return t.apply(this,arguments)}}()},{key:"handlePlayStatus_",value:function(){var e=this.getActiveGroup_().instance.getActiveStory(),t=this.overlay_.classList.contains("active");t&&!e.instance.getProgressPausedStatus()?e.instance.playAndPauseStory():!t&&e.instance.getProgressPausedStatus()&&e.instance.playAndPauseStory()}},{key:"storyObserver_",value:function(e){new MutationObserver(e).observe(this.groupsOverlay_,{attributes:!0})}},{key:"storyObserverCallback_",value:function(e){var t=this;e.forEach(function(e){var a=e.type,i=e.attributeName,s=e.target;"attributes"===a&&"class"===i&&!s.classList.contains("active")&&t.active_&&t.deactivate_()})}}]),l}(),o=n;exports.default=o;
|
|
15
15
|
},{"@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/regenerator":"PMvg","../../lib/util":"PesM","./template":"ttcm"}],"ajqo":[function(require,module,exports) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"Pi05":[function(require,module,exports) {
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var c=require("../../../lib/util"),r=function(r,e){var n;return'\n <div\n class="product-card"\n data-product-id="'.concat(r.product_id,'"\n ').concat("number"==typeof e?'data-product-index="'.concat(e,'"'):"",'\n tabindex="-1"\n aria-hidden="true"\n >\n ').concat(null!==(n=r.image_urls)&&void 0!==n&&n.length?'<img class="product-card-media" src="'.concat(r.image_urls[0],'" alt="product" />'):"",'\n <div class="product-card-right-container">\n ').concat(r.is_title_visible?'<p class="product-card-right-container-description">'.concat(r.title,"</p>"):"",'\n <div class="product-card-right-container-bottom-section">\n <div class="product-card-price-container">\n ').concat(r.is_price_visible&&!r.sales_price?'<span class="product-card-current-price">'.concat(r.price_currency?(0,c.currencyFormatter)(r.price,r.price_currency):r.price,"</span>"):"","\n ").concat(!r.is_price_visible&&r.sales_price&&r.is_s_price_visible?'<span class="product-card-current-price">'.concat(r.price_currency?(0,c.currencyFormatter)(r.sales_price,r.price_currency):r.sales_price,"</span>"):"","\n ").concat(r.is_s_price_visible&&r.sales_price&&r.is_price_visible?'<span class="product-card-current-price">'.concat(r.price_currency?(0,c.currencyFormatter)(r.sales_price,r.price_currency):r.sales_price,'</span><span class="product-card-old-price">').concat(r.price_currency?(0,c.currencyFormatter)(r.price,r.price_currency):r.price,"</span>"):"","\n </div>\n ").concat(r.c_b_text?'<button\n class="product-card-purchase-button">\n <span>'.concat(r.c_b_text,"</span>\n </button>"):"","\n </div>\n </div>\n </div>\n")};exports.default=r;
|
|
3
3
|
},{"../../../lib/util":"PesM"}],"WudP":[function(require,module,exports) {
|
|
4
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=require("../../../lib/util"),t=function(t,e){return'\n <div class="component-layer product-list-layer">\n <div class="product-list-container">\n <div\n class="product-list"\n role="component"\n data-group=""\n data-story=""\n style="font-family: '.concat((0,n.getFontFamily)({instanceId:e}),';"\n tabindex="-1"\n aria-hidden="true"\n dir="').concat(t.direction,'"\n ></div>\n <div class="product-list-arrow left-arrow" hidden>\n
|
|
4
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=require("../../../lib/util"),t=function(t,e){return'\n <div class="component-layer product-list-layer">\n <div class="product-list-container">\n <div\n class="product-list"\n role="component"\n data-group=""\n data-story=""\n style="font-family: '.concat((0,n.getFontFamily)({instanceId:e}),';"\n tabindex="-1"\n aria-hidden="true"\n dir="').concat(t.direction,'"\n ></div>\n <div class="product-list-arrow left-arrow" hidden>\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" class="no-pointer-events"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M13.333 8H2.666M6.667 12l-4-4 4-4" class="no-pointer-events"/></svg>\n </div>\n <div class="product-list-arrow right-arrow" hidden>\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" class="no-pointer-events"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M2.667 8h10.667M9.333 4l4 4-4 4" class="no-pointer-events"/></svg>\n </div>\n </div>\n </div>\n')};exports.default=t;
|
|
5
5
|
},{"../../../lib/util":"PesM"}],"kvuH":[function(require,module,exports) {
|
|
6
6
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ProductCardTemplate",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(exports,"ProductCatalogTemplate",{enumerable:!0,get:function(){return t.default}});var e=r(require("./productCard")),t=r(require("./productCatalog"));function r(e){return e&&e.__esModule?e:{default:e}}
|
|
7
7
|
},{"./productCard":"Pi05","./productCatalog":"WudP"}],"rFjg":[function(require,module,exports) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"gzP3":[function(require,module,exports) {
|
|
2
2
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("@babel/runtime/helpers/defineProperty")),r=require("../../lib/util");function t(e){return e&&e.__esModule?e:{default:e}}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,a)}return t}function c(r){for(var t=1;t<arguments.length;t++){var c=null!=arguments[t]?arguments[t]:{};t%2?a(Object(c),!0).forEach(function(t){(0,e.default)(r,t,c[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(c)):a(Object(c)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(c,e))})}return r}var o=function(e){var t=c({},e);return Object.keys(e).forEach(function(a){switch(a){case"x":t.sdkLeft=e[a];break;case"y":t.sdkTop=e[a];break;case"left":var c;if(Number.isInteger(e[a])){var o=100*e[a]/360;c="".concat(o<0?0:o,"%")}else c="".concat(parseFloat(e[a]),"%");t.left=c;break;case"top":var n;n=Number.isInteger(e[a])?"".concat(100*e[a]/640,"%"):"".concat(parseFloat(e[a]),"%"),t.top=n;break;case"title":t.title=e[a];break;case"price":t.price=e[a];break;case"old_price":t.old_price=e[a];break;case"primary_color":t.color=e[a].includes("rgba")?e[a]:(0,r.convertHex)(e[a]),t.borderColor=e[a].includes("rgba")?e[a]:(0,r.convertHex)(e[a],.3);break;case"secondary_color":t.background=e[a].includes("rgba")?e[a]:(0,r.convertHex)(e[a]);break;case"icon_type":t.icon_type=e[a];break;case"outlink":t.outlink=e[a];break;case"has_title":t.has_title=e[a];break;case"tooltip_placement":t.tooltip_placement=e[a];break;case"theme":t.mode=e[a];break;case"type":t.type=e[a];break;case"uid":t.uid=e[a];break;case"z_index":t.zIndex=e[a];break;default:return!0}return!0}),t},n=o;exports.default=n;
|
|
3
3
|
},{"@babel/runtime/helpers/defineProperty":"IxO8","../../lib/util":"PesM"}],"m7GC":[function(require,module,exports) {
|
|
4
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=require("../../../lib/util"),o=function(o,c){var l,t,a,r,i,e,
|
|
4
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=require("../../../lib/util"),o=function(o,c){var l,t,a,r,i,d,e,s;return'\n <div class="component-layer">\n <div\n class="product-tag-dot"\n role="component"\n data-group=""\n data-story=""\n style="\n font-family: '.concat((0,n.getFontFamily)({instanceId:c}),";\n left: ").concat(o.left,";\n top: ").concat(o.top,";\n background-color: ").concat(null!==(l=o.background)&&void 0!==l?l:"#FFFFFF",";\n border-color: ").concat(null!==(t=o.color)&&void 0!==t?t:"#000000",';\n ">\n <button\n class="product-tag-tooltip"\n style="\n color: ').concat(null!==(a=o.color)&&void 0!==a?a:"#000000",";\n background-color: ").concat(null!==(r=o.background)&&void 0!==r?r:"#FFFFFF",";\n border-color: ").concat(null!==(i=o.borderColor)&&void 0!==i?i:"rgba(0,0,0,0.3)",';\n ">\n <div class="title-container ').concat(null!=o&&o.price||null!=o&&o.old_price?"":"no-price",'">\n <span class="tag-title">').concat(o.title,'</span>\n <span>\n <svg xmlns="http://www.w3.org/2000/svg" width="8" height="12" fill="none"><path fill="').concat(null!==(d=o.color)&&void 0!==d?d:"#000000",'" d="M1.29.71a.996.996 0 0 0 0 1.41L5.17 6 1.29 9.88a.996.996 0 1 0 1.41 1.41L7.29 6.7a.996.996 0 0 0 0-1.41L2.7.7C2.32.32 1.68.32 1.29.71Z"/></svg>\n </span>\n </div>\n ').concat(((null==o?void 0:o.price)||(null==o?void 0:o.old_price))&&'<div class="price-container" aria-hidden="true">\n '.concat((null==o?void 0:o.price)&&'<span style="background-color: '.concat(null!==(e=o.color)&&void 0!==e?e:"#000000","; color: ").concat(null!==(s=o.background)&&void 0!==s?s:"#FFFFFF",';" class="price"\n >').concat(null==o?void 0:o.price,"</span>"),"\n ").concat((null==o?void 0:o.old_price)&&'<span class="old-price">'.concat(null==o?void 0:o.old_price,"</span>"),"\n </div>"),"\n </button>\n </div>\n </div>\n")};exports.default=o;
|
|
5
5
|
},{"../../../lib/util":"PesM"}],"cjPL":[function(require,module,exports) {
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=p(require("@babel/runtime/helpers/classCallCheck")),e=p(require("@babel/runtime/helpers/createClass")),i=p(require("@babel/runtime/helpers/inherits")),o=p(require("@babel/runtime/helpers/possibleConstructorReturn")),s=p(require("@babel/runtime/helpers/getPrototypeOf")),
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=p(require("@babel/runtime/helpers/classCallCheck")),e=p(require("@babel/runtime/helpers/createClass")),i=p(require("@babel/runtime/helpers/inherits")),o=p(require("@babel/runtime/helpers/possibleConstructorReturn")),s=p(require("@babel/runtime/helpers/getPrototypeOf")),a=require("../../constants/layerTypes"),r=p(require("../base")),n=p(require("./dataConvertor")),l=require("../../lib/util"),c=require("../../lib/style"),h=p(require("./template")),u=require("../../constants/events"),d=require("../../lib/icons"),_=p(require("../../components/StoryProduct"));function p(t){return t&&t.__esModule?t:{default:t}}function y(t){var e=v();return function(){var i,a=(0,s.default)(t);if(e){var r=(0,s.default)(this).constructor;i=Reflect.construct(a,arguments,r)}else i=a.apply(this,arguments);return(0,o.default)(this,i)}}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}var g=function(o){(0,i.default)(r,o);var s=y(r);function r(e){var i,o=e.layer,l=e.group,c=e.storyDom,u=e.story,_=e.instanceId;return(0,t.default)(this,r),(i=s.call(this,{type:a.LayerTemplateTypes.PRODUCT_TAG,storyDom:c,instanceId:_})).story_=u,i.group_=l,i.tooltip_=null,i.isPlacementSet_=!1,i.placement={"top-left":0,"top-middle":1,"top-right":2,"down-right":3,"down-middle":4,"down-left":5},i.setLayerData((0,n.default)(o)),i.shoppingBagIcon_=(0,d.shoppingBagIcon)(i.layerData.color),i.shoppingCartIcon_='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="'.concat(i.layerData.color,'" stroke-linecap="round" stroke-linejoin="round" d="M12.5 12H4.78a.5.5 0 0 1-.491-.41L2.62 2.41A.5.5 0 0 0 2.128 2H1M5 14.5A1.25 1.25 0 1 0 5 12a1.25 1.25 0 0 0 0 2.5ZM12.5 14.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"/><path stroke="').concat(i.layerData.color,'" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h10.9a.5.5 0 0 1 .493.59l-.818 4.5a.5.5 0 0 1-.492.41H4"/></svg>'),i.productTagIcon_='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="'.concat(i.layerData.color,'" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m14.727 9.94-4.78 4.78a1.333 1.333 0 0 1-1.887 0L2.333 9V2.333H9l5.727 5.727c.517.52.517 1.36 0 1.88Z" clip-rule="evenodd"/><circle cx="6" cy="6" r="1"/></svg>'),i.percentIcon_='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="'.concat(i.layerData.color,'" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.3" d="m12.5 3.5-9 9"/><path stroke="').concat(i.layerData.color,'" stroke-miterlimit="10" stroke-width="1.3" d="M4.75 6.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5ZM11.25 13a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5Z"/></svg>'),i.dotIcon_='<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" fill="none"><rect width="8" height="8" fill="'.concat(i.layerData.color,'" rx="4"/></svg>'),i.attachCallbacksToElement_(),i.generateComponentAndAppendToPage((0,h.default)(i.layerData,_)).then(function(t){i.dom_=t,i.init_()}),i}return(0,e.default)(r,[{key:"attachCallbacksToElement_",value:function(){this.dispatchClickEvent_=this.dispatchClickEvent_.bind(this),this.showTooltip_=this.showTooltip_.bind(this),this.clearTimeouts_=this.clearTimeouts_.bind(this),this.handleRedirectURL_=this.handleRedirectURL_.bind(this),this.storyObserverCallback_=this.storyObserverCallback_.bind(this),this.eventListeners_=this.eventListeners_.bind(this)}},{key:"init_",value:function(){this.handleProductTagIcon_(),this.tooltip_=this.selector(this.dom_,".product-tag-tooltip"),this.eventListeners_(),(0,l.stopEventBubbling)(this.dom_,"touchstart"),(0,l.stopEventBubbling)(this.dom_,"touchend"),this.layerData.initialProduct&&(this.storyProduct_=new _.default({instanceId:this.instanceId,layer:this.layerData,storyDom:this.storyDom_,group:this.group_,story:this.story_}))}},{key:"eventListeners_",value:function(){(0,l.setClickEventListener)(this.dom_,this.dispatchClickEvent_),this.storyDom_.addEventListener("onProductTagClearTimeouts",this.clearTimeouts_),this.storyDom_.addEventListener("onProductTagClick",this.showTooltip_),(0,l.setClickEventListener)(this.tooltip_,this.handleRedirectURL_),this.storyObserver_(this.storyObserverCallback_)}},{key:"storyObserverCallback_",value:function(t){var e=this;t.forEach(function(t){"attributes"===t.type&&("show"===t.attributeName&&(t.target.hasAttribute("show")&&(e.isStoryActive_=!0,e.handleAnimation_()),t.target.hasAttribute("show")||(e.isStoryActive_=!1,(0,c.removeClass)(e.dom_,"active"),e.clearTimeouts_())),"paused"!==t.attributeName||e.globalInstanceData.accessibility||(t.target.hasAttribute("paused")&&(e.storyPaused_=!0),t.target.hasAttribute("paused")||(e.storyPaused_=!1,(0,c.removeClass)(e.dom_,"active"))))})}},{key:"dispatchClickEvent_",value:function(t){var e=this;if(t.target===this.dom_){var i=this.dom_.classList.contains("active");if((!this.storyPaused_||this.storyPaused_&&i)&&(0,l.createAndDispatchEvent)(this.dom_,"onPlayPause"),i||(0,l.createAndDispatchEvent)(this.storyDom_,"onProductTagClick"),(0,l.createAndDispatchEvent)(this.storyDom_,"onProductTagClearTimeouts"),!i){var o={event_type:u.LayerEventTypes.ProductTagClicked,story_group_id:+this.group_.group_id,story_id:+this.story_.story_id,story_group_index:null,story_index:null,story_group_type:"default",story_interactive_type:"product_tag",story_interactive_x:this.layerData.x,story_interactive_y:this.layerData.y,duration:null,watch_length:null,event_time:Date.now(),uid:this.layerData.uid};if(this.api.sendEvent(o),this.globalInstanceData.events.productTagExpanded){var s=this.layerData,a=s.outlink,r=s.title,n=s.uid,c=this.group_.stories.findIndex(function(t){return t.story_id===e.story_.story_id}),h={id:this.story_.story_id,productTagId:n,title:r,seen:!0,index:c,media:{actionUrl:a}};this.globalInstanceData.events.productTagExpanded(h)}}}}},{key:"showTooltip_",value:function(){this.isStoryActive_&&this.dom_.classList.toggle("active")}},{key:"clearTimeouts_",value:function(){this.timeout_&&clearTimeout(this.timeout_)}},{key:"handleTooltipPlacement_",value:function(){var t=this;if(!this.isPlacementSet_){var e=this.layerData.tooltip_placement,i=Object.keys(this.placement).find(function(i){return t.placement[i]===e}),o=this.storyDom_.offsetWidth,s="".concat(.55*o,"px");if(this.setStyle(this.tooltip_,"max-width",s),e===this.placement["top-middle"]||e===this.placement["down-middle"]){var a=this.tooltip_.offsetWidth;this.setStyle(this.tooltip_,"margin-left","-".concat(a/2,"px"))}this.tooltip_.classList.add(null!=i?i:"top-middle"),this.isPlacementSet_=!0}}},{key:"handleAnimation_",value:function(){var t=this;new Promise(function(e){t.handleTooltipPlacement_(),t.timeout_=setTimeout(function(){t.showTooltip_(),e()},500)}).then(function(){t.globalInstanceData.accessibility||(t.timeout_=setTimeout(function(){t.showTooltip_()},2e3))})}},{key:"handleProductTagIcon_",value:function(){var t={shopping_bag:this.shoppingBagIcon_,price_tag:this.productTagIcon_,shopping_cart:this.shoppingCartIcon_,percent:this.percentIcon_,dot:this.dotIcon_},e=window.btoa(t[this.layerData.icon_type]);this.setStyle(this.dom_,"background-image","url(data:image/svg+xml;base64,".concat(e,")")),"dot"===this.layerData.icon_type&&this.setStyle(this.dom_,"background-size","auto")}},{key:"handleRedirectURL_",value:function(){var t=this,e=this.layerData,i=e.outlink,o=e.title,s=e.uid,a=e.initialProduct;if(a&&this.storyProduct_.onPurchase(a.product_id),this.globalInstanceData.events.productTagClicked){var r=this.group_.stories.findIndex(function(e){return e.story_id===t.story_.story_id}),n={id:this.story_.story_id,productTagId:s,title:o,seen:!0,index:r,media:{actionUrl:i}};this.globalInstanceData.events.productTagClicked(n)}else i&&!a&&(0,l.openLink)(i)}}]),r}(r.default),m=g;exports.default=m;
|
|
7
7
|
},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","../../constants/layerTypes":"aJRz","../base":"skR7","./dataConvertor":"gzP3","../../lib/util":"PesM","../../lib/style":"vgU2","./template":"m7GC","../../constants/events":"d0lR","../../lib/icons":"irwm","../../components/StoryProduct":"GdVG"}]},{},[], null)
|
package/dist/Quiz.80dd96d2.js
CHANGED
|
@@ -3,5 +3,5 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
|
|
|
3
3
|
},{"@babel/runtime/helpers/defineProperty":"IxO8"}],"KbCg":[function(require,module,exports) {
|
|
4
4
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=require("../../../lib/util"),t=function(t,a){var c=["A","B","C","D"];return'\n <div class="component-layer">\n <div\n aria-hidden="true"\n class="quiz-component"\n style="\n font-family: '.concat((0,n.getFontFamily)({instanceId:a}),";\n left: ").concat(t.left,";\n top: ").concat(t.top,";\n z-index: ").concat(t.zIndex,";\n ").concat(t.transform?"transform: ".concat(t.transform,";"):"",'";\n role="component"\n data-group=""\n data-story=""\n data-mode="').concat(t.mode,'"\n data-scale="').concat(t.compScale,'"\n data-has-title=').concat(!!t.has_title,"\n >\n ").concat(t.has_title?'<div class="question"><span>'.concat(t.q_text,"</span></div>"):"",'\n <div class="answers" data-has-title=').concat(!!t.has_title,">\n ").concat(t.q_o_texts.map(function(n,t){return'<div class="answer">\n <span>'.concat(c[t],"</span>\n <span>").concat(n,"</span>\n </div>")}).join(""),"\n </div>\n </div>\n </div>\n ")};exports.default=t;
|
|
5
5
|
},{"../../../lib/util":"PesM"}],"lrR5":[function(require,module,exports) {
|
|
6
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=_(require("@babel/runtime/helpers/asyncToGenerator")),t=_(require("@babel/runtime/helpers/toConsumableArray")),r=_(require("@babel/runtime/helpers/classCallCheck")),a=_(require("@babel/runtime/helpers/createClass")),s=_(require("@babel/runtime/helpers/inherits")),i=_(require("@babel/runtime/helpers/possibleConstructorReturn")),n=_(require("@babel/runtime/helpers/getPrototypeOf")),l=_(require("@babel/runtime/regenerator")),o=_(require("../base")),u=require("../../constants/layerTypes"),c=_(require("./dataConvertor")),h=require("../../lib/util"),y=_(require("./template")),d=require("../../constants/events");function _(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=f();return function(){var r,a=(0,n.default)(e);if(t){var s=(0,n.default)(this).constructor;r=Reflect.construct(a,arguments,s)}else r=a.apply(this,arguments);return(0,i.default)(this,r)}}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var v=function(i){(0,s.default)(o,i);var n=p(o);function o(e){var t,a=e.layer,s=e.group,i=e.story,l=e.storyDom,h=e.instanceId;return(0,r.default)(this,o),(t=n.call(this,{type:u.LayerTemplateTypes.QUIZ,storyDom:l,instanceId:h})).story_=i,t.group_=s,t.localData=t.getLocalComponentData(),t.sumAnswers=[],t.incorrectIcon='<svg
|
|
6
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=_(require("@babel/runtime/helpers/asyncToGenerator")),t=_(require("@babel/runtime/helpers/toConsumableArray")),r=_(require("@babel/runtime/helpers/classCallCheck")),a=_(require("@babel/runtime/helpers/createClass")),s=_(require("@babel/runtime/helpers/inherits")),i=_(require("@babel/runtime/helpers/possibleConstructorReturn")),n=_(require("@babel/runtime/helpers/getPrototypeOf")),l=_(require("@babel/runtime/regenerator")),o=_(require("../base")),u=require("../../constants/layerTypes"),c=_(require("./dataConvertor")),h=require("../../lib/util"),y=_(require("./template")),d=require("../../constants/events");function _(e){return e&&e.__esModule?e:{default:e}}function p(e){var t=f();return function(){var r,a=(0,n.default)(e);if(t){var s=(0,n.default)(this).constructor;r=Reflect.construct(a,arguments,s)}else r=a.apply(this,arguments);return(0,i.default)(this,r)}}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var v=function(i){(0,s.default)(o,i);var n=p(o);function o(e){var t,a=e.layer,s=e.group,i=e.story,l=e.storyDom,h=e.instanceId;return(0,r.default)(this,o),(t=n.call(this,{type:u.LayerTemplateTypes.QUIZ,storyDom:l,instanceId:h})).story_=i,t.group_=s,t.localData=t.getLocalComponentData(),t.sumAnswers=[],t.incorrectIcon='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none"><path fill="#FF4D50" fill-rule="evenodd" d="M14.194 3.806c.431.43.431 1.13 0 1.56l-8.827 8.828a1.103 1.103 0 0 1-1.56-1.56l8.827-8.828c.43-.43 1.13-.43 1.56 0Z" clip-rule="evenodd"/><path fill="#FF4D50" fill-rule="evenodd" d="M3.806 3.806c.431-.43 1.13-.43 1.56 0l8.828 8.828a1.103 1.103 0 0 1-1.56 1.56L3.806 5.366c-.43-.43-.43-1.13 0-1.56Z" clip-rule="evenodd"/></svg>',t.correctIcon='<svg xmlns="http://www.w3.org/2000/svg" width="15" height="11" fill="none"><path fill="#51C41A" fill-rule="evenodd" d="M14.217.806c.43.43.43 1.13 0 1.56l-8.092 8.092c-.431.431-1.13.431-1.56 0L.885 6.78a1.103 1.103 0 1 1 1.56-1.56l2.899 2.898L12.656.806c.431-.43 1.13-.43 1.56 0Z" clip-rule="evenodd"/></svg>',t.setLayerData((0,c.default)(a)),t.generateComponentAndAppendToPage((0,y.default)(t.layerData,h)).then(function(e){t.dom_=e,t.init_()}),t}return(0,a.default)(o,[{key:"init_",value:function(){var e=this;if("number"==typeof this.localData[this.layerData.uid]||this.layerData.is_result){if(this.key=this.localData[this.layerData.uid],this.layerData.is_result&&this.layerData.q_o_votes.every(function(e){return 0===e})){var t=Math.round(100/this.layerData.q_o_texts.length);this.layerData.q_o_votes=Array(this.layerData.q_o_texts.length).fill(t)}this.makeChoice_()}else this.selectorAll(this.dom_,".answer").forEach(function(t,r){(0,h.stopEventBubbling)(t,"touchstart"),(0,h.stopEventBubbling)(t,"touchend"),t.addEventListener("pointerdown",function(){return e.clickChoice_({key:r})},{once:!0})})}},{key:"handlePercentageTypeAnswerStyles_",value:function(e,t,r){var a,s=this.checkQuizDataDiff_()?0:1,i=null!==(a=this.layerData.q_o_votes)&&void 0!==a?a:[100,100,100,100],n=this.sumArrayValues(null!=i?i:[])+s,l=r===this.key?Number(i[r])+s:Number(i[r]),o=Math.round(l/n*100),u=document.createElement("div");u.classList.add("bg-percent"),e.appendChild(u),this.key===r&&this.setStyle(e,"border-color","#BDBDBD"),this.setStyle(u,"width","".concat(o,"%")),this.setStyle(t,"border","none"),this.sumAnswers.push(o),t.innerHTML="".concat(o,"%")}},{key:"handleCorrectTypeAnswerStyles_",value:function(e,t,r){var a=this.layerData.q_answer===this.key;t.innerHTML=a&&r===this.key||this.layerData.q_answer===r?this.correctIcon:this.incorrectIcon,r===this.key?e.classList.add(a?"correct-choice":"incorrect-choice"):e.classList.add(r===this.layerData.q_answer?"correct-choice":"other-choice","blurred")}},{key:"handleSummedPercentages_",value:function(){var e,r=this.sumArrayValues(null!==(e=this.sumAnswers)&&void 0!==e?e:[]);if(100!==r){var a,s=Math.max.apply(Math,(0,t.default)(null!==(a=this.sumAnswers)&&void 0!==a?a:[])),i=s+(100-r),n=this.sumAnswers.findIndex(function(e){return e===s});this.selectorAll(this.dom_,".answer")[n].firstElementChild.innerHTML="".concat(i,"%")}}},{key:"makeChoice_",value:function(){var e=this;this.localData=this.getLocalComponentData(),this.localData[this.layerData.uid]=this.key,this.setLocalComponentData(this.localData);var t=null===this.layerData.q_answer;this.selectorAll(this.dom_,".answer").forEach(function(r,a){var s=r.firstElementChild;return t?e.handlePercentageTypeAnswerStyles_(r,s,a):(e.handleCorrectTypeAnswerStyles_(r,s,a),!0)}),t&&this.handleSummedPercentages_()}},{key:"checkQuizDataDiff_",value:function(){if(this.layerData.is_result)return!0;var e,t=this.getComponentLocalData(u.LayerTemplateTypes.QUIZ,this.layerData);return!(t.uid!==this.layerData.uid||!t.q_o_votes)&&(null!==(e=this.layerData.q_o_votes)&&void 0!==e?e:[]).some(function(e,r){var a;return(null===(a=t.q_o_votes)||void 0===a?void 0:a[r])!==e})}},{key:"clickChoice_",value:function(){var t=(0,e.default)(l.default.mark(function e(t){var r,a,s;return l.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.key,"number"!=typeof this.localData[this.layerData.uid]){e.next=3;break}return e.abrupt("return");case 3:this.key=r,this.makeChoice_(),a={event_type:d.LayerEventTypes.QuizAnswered,story_group_id:+this.group_.group_id,story_id:+this.story_.story_id,story_group_index:null,story_index:null,story_group_type:"default",story_interactive_type:"quiz",story_interactive_x:this.layerData.x,story_interactive_y:this.layerData.y,duration:null,watch_length:null,event_time:Date.now(),activity:String(this.key),uid:this.layerData.uid},this.setComponentLocalData(u.LayerTemplateTypes.QUIZ,this.layerData),this.api.sendEvent(a),s={group:this.group_,story_id:this.story_.story_id,alt_text:this.story_.alt_text,is_sharable:this.story_.is_sharable,track_id:this.layerData.custom_payload,title:this.layerData.q_text,answers:this.layerData.q_o_texts,answer:this.layerData.q_o_texts[this.key],correct_answer:this.layerData.q_o_texts[this.layerData.q_answer]},(0,h.createAndDispatchEvent)(this.storyDom_,"onConditionalEvent"),(0,h.createAndDispatchEvent)(this.storyDom_,"onCustomerEvent",{eventName:d.CustomerEventTypes.onStoryQuizAnswered,params:s});case 11:case"end":return e.stop()}},e,this)}));return function(e){return t.apply(this,arguments)}}()}]),o}(o.default),m=v;exports.default=m;
|
|
7
7
|
},{"@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/toConsumableArray":"Fhqp","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/regenerator":"PMvg","../base":"skR7","../../constants/layerTypes":"aJRz","./dataConvertor":"WBGL","../../lib/util":"PesM","./template":"KbCg","../../constants/events":"d0lR"}]},{},[], null)
|
|
@@ -5,7 +5,7 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
|
|
|
5
5
|
},{"../../../../lib/icons":"irwm","../../../../lib/util":"PesM"}],"PIHR":[function(require,module,exports) {
|
|
6
6
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("../../../../lib/util"),e=function(e){var r=e.instanceId,o=e.isModernLayout;return'\n<div style="font-family: '.concat((0,t.getFontFamily)({instanceId:r}),";\" class='storyly__story-product-cart-items-container ").concat(o?"modern-layout-product-cart-container":"",'\'>\n <ul class="storyly__story-product-cart-items">\n </ul>\n</div>')};exports.default=e;
|
|
7
7
|
},{"../../../../lib/util":"PesM"}],"TTLt":[function(require,module,exports) {
|
|
8
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("../../../../lib/icons"),r=require("../../../../lib/util"),c=function(t){return'<p class="storyly__story-product-cart-product-variants"> '.concat(t.map(function(t){var c=t.v;return(0,r.isHexColor)(c)?'<span style="background-color: '.concat(c,'" data-type="bg"></span>'):"<span>".concat(c,"</span>")}).join(", "),"\n </p>")},n=function(t){return'\n <div class="storyly__story-product-cart-product-price">\n '.concat(!t.sales_price&&t.price?'<span class="storyly__story-product-cart-product-price-current">'.concat((0,r.currencyFormatter)(t.price,t.price_currency),"</span>"):"","\n ").concat(t.sales_price&&t.price?'\n <span class="storyly__story-product-cart-product-price-sales">'.concat((0,r.currencyFormatter)(t.price,t.price_currency),'</span>\n <span class="storyly__story-product-cart-product-price-current">').concat((0,r.currencyFormatter)(t.sales_price,t.price_currency),"</span>\n "):"","\n </div>\n")},o=function(r){return'\n<li class="storyly__story-product-cart-item">\n <div class="storyly__story-product-cart-product-container" data-product-id="'.concat(r.product_id,'">\n <div class="storyly__story-product-cart-product-image">\n <img src="').concat(r.image_urls[0],'" alt="').concat(r.title,'">\n </div>\n <div class="storyly__story-product-cart-product-info">\n <div class="storyly__story-product-cart-product-variants-container">\n <div class="storyly__story-product-cart-product-title"><h3>').concat(r.title,"</h3></div>\n ").concat(c(r.variant),'\n </div>\n <div class="storyly__story-product-cart-product-counter">\n ').concat(n(r),'\n <div class="counter">\n <button data-product-id="').concat(r.product_id,'" class="counter-button" data-type="minus">\n <svg
|
|
8
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("../../../../lib/icons"),r=require("../../../../lib/util"),c=function(t){return'<p class="storyly__story-product-cart-product-variants"> '.concat(t.map(function(t){var c=t.v;return(0,r.isHexColor)(c)?'<span style="background-color: '.concat(c,'" data-type="bg"></span>'):"<span>".concat(c,"</span>")}).join(", "),"\n </p>")},n=function(t){return'\n <div class="storyly__story-product-cart-product-price">\n '.concat(!t.sales_price&&t.price?'<span class="storyly__story-product-cart-product-price-current">'.concat((0,r.currencyFormatter)(t.price,t.price_currency),"</span>"):"","\n ").concat(t.sales_price&&t.price?'\n <span class="storyly__story-product-cart-product-price-sales">'.concat((0,r.currencyFormatter)(t.price,t.price_currency),'</span>\n <span class="storyly__story-product-cart-product-price-current">').concat((0,r.currencyFormatter)(t.sales_price,t.price_currency),"</span>\n "):"","\n </div>\n")},o=function(r){return'\n<li class="storyly__story-product-cart-item">\n <div class="storyly__story-product-cart-product-container" data-product-id="'.concat(r.product_id,'">\n <div class="storyly__story-product-cart-product-image">\n <img src="').concat(r.image_urls[0],'" alt="').concat(r.title,'">\n </div>\n <div class="storyly__story-product-cart-product-info">\n <div class="storyly__story-product-cart-product-variants-container">\n <div class="storyly__story-product-cart-product-title"><h3>').concat(r.title,"</h3></div>\n ").concat(c(r.variant),'\n </div>\n <div class="storyly__story-product-cart-product-counter">\n ').concat(n(r),'\n <div class="counter">\n <button data-product-id="').concat(r.product_id,'" class="counter-button" data-type="minus">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path stroke="#242450" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.482" d="M3.333 8h9.334"/></svg>\n </button>\n <span class="counter-count">').concat(r.quantity,'</span>\n <button data-product-id="').concat(r.product_id,'" class="counter-button" data-type="plus">\n <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#242450" fill-rule="evenodd" d="M8.741 3.333a.741.741 0 0 0-1.482 0V7.26H3.334a.741.741 0 1 0 0 1.482h3.925v3.926a.741.741 0 1 0 1.482 0V8.74h3.926a.741.741 0 0 0 0-1.482H8.741V3.333Z" clip-rule="evenodd"/></svg>\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class="storyly__story-product-cart-product-delete">\n <div>\n ').concat((0,t.trashIcon)(),"\n </div>\n </div>\n</li>")};exports.default=o;
|
|
9
9
|
},{"../../../../lib/icons":"irwm","../../../../lib/util":"PesM"}],"laCG":[function(require,module,exports) {
|
|
10
10
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("../../../../lib/icons"),r=require("../../../../lib/util"),c=function(c){var o=c.instanceId,n=c.price,a=c.sales_price,e=c.price_currency,s=c.isModernLayout;return"\n<div class='storyly__story-product-cart-items-footer ".concat(s?"modern-layout-product-cart":"","' style=\"font-family: ").concat((0,r.getFontFamily)({instanceId:o}),'">\n <div class="storyly__story-product-cart-items-footer-price">\n <p>Total</p>\n <div class="total-price-container">\n ').concat(!a&&n?'<span class="total_price">'.concat((0,r.currencyFormatter)(n,e),"</span>"):"","\n ").concat(a&&n?'\n <span class="total_price">'.concat((0,r.currencyFormatter)(a,e),'</span>\n <span class="total_sales_price">').concat((0,r.currencyFormatter)(n,e),"</span>\n "):"",'\n </div>\n\n </div>\n <button class="storyly__story-product-cart-items-footer-button"><span>Go to checkout</span> ').concat((0,t.arrowRight)("#FFFFFF"),"</button>\n</div>")};exports.default=c;
|
|
11
11
|
},{"../../../../lib/icons":"irwm","../../../../lib/util":"PesM"}],"yyQY":[function(require,module,exports) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"fjyM":[function(require,module,exports) {
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var s=function(){return'\n <div class="storyly__video-seekbar show">\n <div class="action-icon">\n <div class="play-icon" style="display: none">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="#fff" d="M6.81 20.906c-.394.256-.795.267-1.2.035-.407-.232-.61-.58-.61-1.044V3.953c0-.464.203-.812.61-1.044.405-.232.806-.22 1.2.035l12.532 8.006c.372.232.557.557.557.975 0 .418-.185.743-.557.975L6.81 20.906Z"/></svg>\n </div>\n <div class="pause-icon">\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="#fff" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width=".995" d="M10 3.999H6v16h4v-16ZM18 3.999h-4v16h4v-16Z"/></svg>\n </div>\n </div>\n <div class="seekbar">\n <span class="progress-indicator"></span>\n <span class="filled-progress-bar"></span>\n <div class="interactive-lines"></div>\n </div>\n <div class="video-time">\n <span>00:00</span>\n </div>\n </div>\n'};exports.default=s;
|
|
3
3
|
},{}],"WHTK":[function(require,module,exports) {
|
|
4
4
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("@babel/runtime/helpers/classCallCheck")),e=r(require("@babel/runtime/helpers/createClass")),i=r(require("../../constants/layouts")),s=r(require("../../lib/proxy")),o=require("../../lib/style"),a=require("../../lib/util"),n=r(require("./template/seekbar-template"));function r(t){return t&&t.__esModule?t:{default:t}}var l=function(){function r(e){var i=e.storyDom,o=e.videoDom,a=e.layers,n=e.playPauseStory,l=e.setProgressTime,h=e.instanceId;(0,t.default)(this,r),this.storyDom_=i,this.videoDom_=o,this.pauseButton_=null,this.playButton_=null,this.playPauseStory_=n,this.setProgressTime_=l,this.instanceId_=h,this.layers_=a;var d=s.default.getNodeByInstanceId(this.instanceId_).getDataFromGlobal().globalInstanceData;this.globalInstanceData_=d,this.setStoryEvents_(),this.attachCallbacksToElement_(),this.createSeekbarElements_(),this.storyObserver_(this.handleStoryObserverCallback_)}return(0,e.default)(r,[{key:"attachCallbacksToElement_",value:function(){this.handleVideoTime_=this.handleVideoTime_.bind(this),this.indicatorDragDown_=this.indicatorDragDown_.bind(this),this.indicatorDrag_=this.indicatorDrag_.bind(this),this.closeDragElement_=this.closeDragElement_.bind(this),this.handleClickInteractiveLine_=this.handleClickInteractiveLine_.bind(this),this.handleStoryObserverCallback_=this.handleStoryObserverCallback_.bind(this)}},{key:"createSeekbarElements_",value:function(){var t=this;this.seekBarDom_=(0,a.generateHtmlFromTemplate)((0,n.default)(this.layers_)),this.storyDom_.appendChild(this.seekBarDom_),this.videoDom_.addEventListener("timeupdate",this.handleVideoTime_),this.videoDom_.addEventListener("pause",function(){return t.handlePlayPause_("pause")}),this.videoDom_.addEventListener("play",function(){return t.handlePlayPause_("play")}),this.pauseButton_=this.seekBarDom_.querySelector(".pause-icon"),this.pauseButton_.addEventListener("pointerdown",function(){return t.handlePlayPause_("pause",!0)}),this.playButton_=this.seekBarDom_.querySelector(".play-icon"),this.playButton_.addEventListener("pointerdown",function(){return t.handlePlayPause_("play",!0)}),this.indicator_=this.seekBarDom_.querySelector(".progress-indicator"),this.indicator_.addEventListener("pointerdown",this.indicatorDragDown_),this.interactiveLinesContainer_=this.seekBarDom_.querySelector(".interactive-lines"),this.interactiveLinesContainer_.addEventListener("pointerdown",this.handleClickInteractiveLine_),this.renderLayerLines_(),(this.globalInstanceData_.layout===i.default.CLASSIC||this.globalInstanceData_.storylyEmbed.init)&&this.handleClassicView_(),this.show()}},{key:"handleClassicView_",value:function(){(0,a.stopEventBubbling)(this.storyDom_,"touchstart"),this.globalInstanceData_.storylyEmbed.init&&(0,a.stopEventBubbling)(this.storyDom_,"click");var t=this.storyDom_.getRootNode().host.shadowRoot.querySelector(".accessibility-navigation-buttons");this.globalInstanceData_.accessibility||t||(0,a.createAndDispatchEvent)(this.storyDom_,"onAccessibilityTriggered",{videoSeekbarEnabled:!0})}},{key:"setStoryEvents_",value:function(){var t=this;this.globalInstanceData_.layout===i.default.MODERN||this.globalInstanceData_.storylyEmbed.init?(this.storyDom_.addEventListener("mouseenter",function(){t.storyDom_.hasAttribute("show")&&t.showed_&&(t.storyEventTigger_=!0,t.seekBarDom_.classList.add("hovered"),t.rePositionLayers_(),t.globalInstanceData_.storylyEmbed.init&&t.navigationDom_.classList.add("hovered"))}),this.storyDom_.addEventListener("mouseleave",function(){t.storyDom_.hasAttribute("show")&&t.showed_&&(t.storyEventTigger_=!1,t.seekBarDom_.classList.remove("hovered"),t.rePositionLayers_(!1),t.globalInstanceData_.storylyEmbed.init&&t.navigationDom_.classList.remove("hovered"))})):this.storyDom_.addEventListener("touchstart",function(e){t.storyDom_.hasAttribute("show")&&e.target.parentElement===t.storyDom_&&(t.storyEventTigger_?t.rePositionLayers_(!1):t.rePositionLayers_(),t.storyEventTigger_=!t.storyEventTigger_,t.seekBarDom_.classList.toggle("hovered"),t.navigationDom_.classList.toggle("hovered"))})}},{key:"rePositionLayers_",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.rePositionTimeout_||clearTimeout(this.rePositionTimeout_),this.rePositionTimeout_=setTimeout(function(){var i=t.storyDom_.querySelector(".product-list-container"),s=t.storyDom_.querySelector(".swipe-up");s&&(e&&!t.swipeUpRepositioned_?(s.style.setProperty("bottom","".concat(t.seekBarDom_.offsetHeight,"px")),t.swipeUpRepositioned_=!0):(s.style.removeProperty("bottom"),t.swipeUpRepositioned_=!1)),i&&(e&&!t.productCatalogRepositioned_?(i.style.setProperty("bottom","".concat(t.seekBarDom_.offsetHeight,"px")),t.productCatalogRepositioned_=!0):(i.style.removeProperty("bottom"),t.productCatalogRepositioned_=!1))},50)}},{key:"handleClickInteractiveLine_",value:function(t){var e=this.interactiveLinesContainer_.getBoundingClientRect(),i=100*(t.clientX-e.left-this.indicator_.offsetWidth/2)/this.interactiveLinesContainer_.offsetWidth,s=this.videoDom_.duration*i/100;this.videoDom_.currentTime=s,(0,o.setStyle)(this.indicator_,["left","".concat(i,"%")]),this.setProgressTime_(s)}},{key:"renderLayerLines_",value:function(){var t=this,e=[];this.layers_.forEach(function(t){var i,s=null!==(i=t.start_time)&&void 0!==i?i:0;e.push(s)}),e.sort(function(t,e){return t-e}),0!==e[0]&&e.splice(0,0,0),e[e.length-1]!==this.videoDom_.duration&&e.push(this.videoDom_.duration),e.forEach(function(i,s){var o=e[s+1];if(o){var a=100*(o-i)/t.videoDom_.duration;t.createLineElement_(a,i,o)}})}},{key:"createLineElement_",value:function(t,e,i){var s=document.createElement("span");s.style.width="".concat(t,"%"),s.classList.add("interactive-line"),s.dataset.start_time=e,s.dataset.end_time=i,this.seekBarDom_.querySelector(".interactive-lines").appendChild(s)}},{key:"handleVideoTime_",value:function(){var t=Math.floor((this.videoDom_.duration-this.videoDom_.currentTime)/60),e=Math.floor((this.videoDom_.duration-this.videoDom_.currentTime)%60),i=100*this.videoDom_.currentTime/this.videoDom_.duration;(0,o.setStyle)(this.indicator_,["left","".concat(i,"%")]),this.seekBarDom_.querySelector(".video-time").querySelector("span").innerText="-".concat(String(t).padStart("2","0"),":").concat(String(e).padStart("2","0")),this.fillProgressForLines_()}},{key:"handlePlayPause_",value:function(t,e){"play"===t?((0,o.setStyle)(this.playButton_,["display","none"]),(0,o.setStyle)(this.pauseButton_,["display","flex"])):((0,o.setStyle)(this.playButton_,["display","flex"]),(0,o.setStyle)(this.pauseButton_,["display","none"])),e&&this.playPauseStory_()}},{key:"indicatorDragDown_",value:function(t){var e;t.preventDefault(),this.pos3=null!==(e=t.clientX)&&void 0!==e?e:t.targetTouches[0].clientX,this.storyPaused_=this.storyDom_.hasAttribute("paused"),this.storyPaused_||this.handlePlayPause_("pause",!0),this.indicatorMove_=!0,this.seekBarDom_.addEventListener("pointerup",this.closeDragElement_,{once:!0}),this.seekBarDom_.addEventListener("pointerleave",this.closeDragElement_,{once:!0}),this.seekBarDom_.addEventListener("pointermove",this.indicatorDrag_)}},{key:"indicatorDrag_",value:function(t){var e,i;if(this.indicatorMove_){t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation(),this.pos1=this.pos3-(null!==(e=t.clientX)&&void 0!==e?e:t.targetTouches[0].clientX),this.pos3=null!==(i=t.clientX)&&void 0!==i?i:t.targetTouches[0].clientX;var s=this.indicator_.offsetLeft-this.pos1;if(!(s<=-10||s>=this.interactiveLinesContainer_.offsetWidth)){var a=100*s/this.interactiveLinesContainer_.offsetWidth,n=this.videoDom_.duration*a/100;this.videoDom_.currentTime=n,(0,o.setStyle)(this.indicator_,["left","".concat(a,"%")])}}}},{key:"closeDragElement_",value:function(){this.indicatorMove_&&(this.indicatorMove_=!1,this.setProgressTime_(this.videoDom_.currentTime),this.storyPaused_||this.handlePlayPause_("play",!0))}},{key:"fillProgressForLines_",value:function(){var t=this;this.interactiveLinesContainer_.querySelectorAll(".interactive-line").forEach(function(e){var i=e;if(e.dataset.start_time<t.videoDom_.currentTime){var s=+e.dataset.start_time,o=+e.dataset.end_time,a=Math.ceil(100*(t.videoDom_.currentTime-s)/(o-s));i.style.background="linear-gradient(to right, #fff 0 ".concat(a,"%, rgba(255, 255, 255, 0.6) ").concat(a,"% 100%)")}else i.style.removeProperty("background")})}},{key:"storyObserver_",value:function(t){new MutationObserver(t).observe(this.storyDom_,{attributes:!0})}},{key:"handleStoryObserverCallback_",value:function(t){var e=this;t.forEach(function(t){"attributes"===t.type&&("show"===t.attributeName&&t.target.hasAttribute("show")?setTimeout(function(){e.show()},500):t.target.hasAttribute("show")||e.hide())})}},{key:"show",value:function(){var t=this;if(this.seekBarDom_.classList.add("show"),this.storyEventTigger_||this.rePositionLayers_(),(this.globalInstanceData_.layout===i.default.CLASSIC||this.globalInstanceData_.storylyEmbed.init)&&!this.globalInstanceData_.accessibility){var e=this.storyDom_.getRootNode().host;this.navigationDom_=e.shadowRoot.querySelector(".accessibility-navigation-buttons"),this.globalInstanceData_.storylyEmbed.init&&(this.navigationDom_.style.removeProperty("display"),this.navigationDom_.addEventListener("mouseenter",function(){t.seekBarDom_.classList.add("hovered")})),this.navigationDom_.classList.add("show"),this.navigationDom_.classList.remove("hovered")}setTimeout(function(){t.seekBarDom_.classList.remove("show"),t.storyEventTigger_||(t.navigationDom_&&t.navigationDom_.classList.remove("show"),t.seekBarDom_.classList.remove("hovered"),t.rePositionLayers_(!1)),t.showed_=!0},1200),this.globalInstanceData_.layout===i.default.CLASSIC&&(this.indicator_.style.opacity=1)}},{key:"hide",value:function(){this.rePositionLayers_(!1),this.seekBarDom_.classList.remove("hovered"),this.seekBarDom_.classList.remove("show"),this.navigationDom_&&this.navigationDom_.classList.remove("hovered"),this.storyEventTigger_=!1}}]),r}(),h=l;exports.default=h;
|
|
5
5
|
},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","../../constants/layouts":"kUgL","../../lib/proxy":"qmVm","../../lib/style":"vgU2","../../lib/util":"PesM","./template/seekbar-template":"fjyM"}]},{},[], null)
|