@everymatrix/bonus-elevate-shop-item 1.31.2 → 1.32.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +4 -3
  3. package/dist/bonus-elevate-shop-item/bonus-elevate-shop-item.esm.js +0 -1
  4. package/dist/bonus-elevate-shop-item/index.esm.js +0 -0
  5. package/dist/bonus-elevate-shop-item/p-61b101cd.entry.js +0 -1
  6. package/dist/bonus-elevate-shop-item/p-b5f2af9b.js +0 -1
  7. package/dist/cjs/bonus-elevate-shop-assets-slider_3.cjs.entry.js +0 -439
  8. package/dist/cjs/bonus-elevate-shop-item.cjs.js +0 -19
  9. package/dist/cjs/index-e516a37b.js +0 -1636
  10. package/dist/cjs/index.cjs.js +0 -2
  11. package/dist/cjs/loader.cjs.js +0 -21
  12. package/dist/collection/collection-manifest.json +0 -20
  13. package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-assets-slider.js +0 -225
  14. package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-item.css +0 -193
  15. package/dist/collection/components/bonus-elevate-shop-item/bonus-elevate-shop-item.js +0 -337
  16. package/dist/collection/index.js +0 -1
  17. package/dist/collection/models/bonus-elevate-shop-item.js +0 -1
  18. package/dist/collection/utils/locale.utils.js +0 -63
  19. package/dist/collection/utils/utils.js +0 -39
  20. package/dist/components/bonus-elevate-shop-assets-slider.d.ts +0 -11
  21. package/dist/components/bonus-elevate-shop-assets-slider.js +0 -6
  22. package/dist/components/bonus-elevate-shop-assets-slider2.js +0 -158
  23. package/dist/components/bonus-elevate-shop-item.d.ts +0 -11
  24. package/dist/components/bonus-elevate-shop-item.js +0 -261
  25. package/dist/components/general-styling-wrapper.js +0 -6
  26. package/dist/components/general-styling-wrapper2.js +0 -103
  27. package/dist/components/index.d.ts +0 -26
  28. package/dist/components/index.js +0 -1
  29. package/dist/esm/bonus-elevate-shop-assets-slider_3.entry.js +0 -433
  30. package/dist/esm/bonus-elevate-shop-item.js +0 -17
  31. package/dist/esm/index-46c1a945.js +0 -1608
  32. package/dist/esm/index.js +0 -1
  33. package/dist/esm/loader.js +0 -17
  34. package/dist/esm/polyfills/core-js.js +0 -11
  35. package/dist/esm/polyfills/css-shim.js +0 -1
  36. package/dist/esm/polyfills/dom.js +0 -79
  37. package/dist/esm/polyfills/es5-html-element.js +0 -1
  38. package/dist/esm/polyfills/index.js +0 -34
  39. package/dist/esm/polyfills/system.js +0 -6
  40. package/dist/index.cjs.js +0 -1
  41. package/dist/index.js +0 -1
  42. package/dist/stencil.config.js +0 -24
  43. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/bonus-elevate-shop-item/.stencil/packages/bonus-elevate-shop-item/stencil.config.d.ts +0 -2
  44. package/dist/types/components/bonus-elevate-shop-item/bonus-elevate-shop-assets-slider.d.ts +0 -37
  45. package/dist/types/components/bonus-elevate-shop-item/bonus-elevate-shop-item.d.ts +0 -53
  46. package/dist/types/components.d.ts +0 -151
  47. package/dist/types/index.d.ts +0 -1
  48. package/dist/types/models/bonus-elevate-shop-item.d.ts +0 -16
  49. package/dist/types/stencil-public-runtime.d.ts +0 -1565
  50. package/dist/types/utils/locale.utils.d.ts +0 -2
  51. package/dist/types/utils/utils.d.ts +0 -9
  52. package/loader/cdn.js +0 -3
  53. package/loader/index.cjs.js +0 -3
  54. package/loader/index.d.ts +0 -12
  55. package/loader/index.es2017.js +0 -3
  56. package/loader/index.js +0 -4
  57. package/loader/package.json +0 -10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/bonus-elevate-shop-item",
3
- "version": "1.31.2",
3
+ "version": "1.32.4",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -14,9 +14,10 @@
14
14
  "loader/"
15
15
  ],
16
16
  "dependencies": {
17
- "@everymatrix/general-styling-wrapper": "*"
17
+ "@everymatrix/general-styling-wrapper": "^1.32.4"
18
18
  },
19
19
  "publishConfig": {
20
20
  "access": "public"
21
- }
21
+ },
22
+ "gitHead": "69a4e0bb1b0460c07baef352d283492a6e2dc4b0"
22
23
  }
@@ -1 +0,0 @@
1
- import{p as e,b as s}from"./p-b5f2af9b.js";(()=>{const s=import.meta.url,t={};return""!==s&&(t.resourcesUrl=new URL(".",s).href),e(t)})().then((e=>s([["p-61b101cd",[[1,"bonus-elevate-shop-item",{endpoint:[513],language:[513],itemId:[1537,"item-id"],elevateGift:[1040],session:[513],clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],translationUrl:[513,"translation-url"],showSliderDots:[516,"show-slider-dots"],showSliderArrows:[516,"show-slider-arrows"],isGiftNotFound:[32],redeemErrorMsg:[32],isRedeeming:[32]}],[0,"bonus-elevate-shop-assets-slider",{showSliderDots:[516,"show-slider-dots"],showSliderArrows:[516,"show-slider-arrows"],itemsPerPage:[514,"items-per-page"],sliderItems:[16],activeIndex:[32]}],[4,"general-styling-wrapper",{clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],translationUrl:[1,"translation-url"],targetTranslations:[16]}]]]],e)));
File without changes
@@ -1 +0,0 @@
1
- import{r as e,h as t,g as i,F as s,H as a}from"./p-b5f2af9b.js";const r=class{constructor(t){e(this,t),this.showSliderDots=!1,this.showSliderArrows=!0,this.itemsPerPage=1,this.sliderItems=[],this.activeIndex=0,this.xDown=null,this.yDown=null,this.orientationChangeHandler=()=>{setTimeout((()=>{this.recalculateItemsPerPage()}),10)},this.resizeHandler=()=>{this.recalculateItemsPerPage()}}setActive(e){var t;const i=null===(t=this.sliderItems)||void 0===t?void 0:t.length;this.activeIndex=e>=0?e>=i-1?i-1:e:0}move(e){this.setActive(this.activeIndex+e)}goTo(e){let t=this.activeIndex-e;if(t>0)for(let e=0;e<t;e++)this.move(-1);else for(let e=0;e>t;e--)this.move(1)}handleTouchStart(e){const t=this.getTouches(e)[0];this.xDown=t.clientX,this.yDown=t.clientY}getTouches(e){return e.touches||e.originalEvent.touches}handleTouchMove(e){if(!this.xDown||!this.yDown)return;let t=this.xDown-e.touches[0].clientX,i=this.yDown-e.touches[0].clientY;Math.abs(t)>Math.abs(i)&&this.move(t>0?1:-1),this.xDown=null,this.yDown=null}recalculateItemsPerPage(){this.sliderItemsElement&&(this.itemElementWidth=this.sliderItemsElement.clientWidth,this.sliderItemsElementWidth=(this.sliderItems.length-1)*this.itemElementWidth)}renderDots(){var e;const i=[];for(let s=0;s<(null===(e=this.sliderItems)||void 0===e?void 0:e.length)/this.itemsPerPage;s++)i.push(t("li",{class:s==this.activeIndex?"active":"default",onClick:()=>{this.goTo(s),this.setActive(s)}}));return i}componentDidRender(){this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.recalculateItemsPerPage()}componentDidUpdate(){this.recalculateItemsPerPage()}connectedCallback(){window.screen.orientation.addEventListener("change",this.orientationChangeHandler)}disconnectedCallback(){this.el.removeEventListener("touchstart",this.handleTouchStart),this.el.removeEventListener("touchmove",this.handleTouchMove),window.screen.orientation.removeEventListener("change",this.orientationChangeHandler),window.removeEventListener("resize",this.resizeHandler)}render(){var e;const i={transform:`translate(${this.sliderItemsElementWidth/((null===(e=this.sliderItems)||void 0===e?void 0:e.length)-1)*this.activeIndex*-1}px, 0px)`},s={width:this.itemElementWidth/this.itemsPerPage+"px"};return t("div",{class:"SliderWrapper"},t("div",{class:"MainContent "},this.showSliderArrows&&t("div",{class:`SliderNavButton LeftArrow ${0===this.activeIndex?"DisabledArrow ":""} ${1===this.sliderItems.length?"HiddenArrow ":""}`,onClick:()=>this.move(-1)},t("svg",{fill:"none",stroke:"var(--emfe-w-color-secondary, #FD2839)",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"}))),t("div",{class:"ItemsWrapper",ref:e=>this.sliderItemsElement=e},t("div",{class:"Items AssetsItems",style:i},this.sliderItems.map((e=>t("img",{class:`img${this.itemsPerPage}`,alt:"Gift Thumbnails",style:s,src:e}))))),this.showSliderArrows&&t("div",{class:`SliderNavButton RightArrow ${1===this.sliderItems.length?"HiddenArrow ":""}\n ${this.activeIndex===this.sliderItems.length-1||this.itemsPerPage==this.sliderItems.length?"DisabledArrow":""}`,onClick:()=>this.move(1)},t("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})))),this.showSliderDots&&this.sliderItems.length>1&&t("div",{class:"DotsWrapper"},t("ul",{class:"Dots"},this.renderDots())))}get el(){return i(this)}},o=["ro","en","fr","ar","hu"],n={en:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},ro:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},fr:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},ar:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"},hu:{points:"Points",noGiftPresentation:"No description",redeem:"Redeem",noDataFound:"No data found",error4003:"Invalid Session",redeemFailed:"Failed to redeem"}},l=(e,t)=>{const i=t;return n[void 0!==i&&o.includes(i)?i:"en"][e]},d=class{constructor(t){e(this,t),this.language="en",this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.showSliderDots=!1,this.showSliderArrows=!0,this.isGiftNotFound=!1,this.redeemErrorMsg="",this.isRedeeming=!1,this.deviceType=(()=>{const e=(()=>{let e=window.navigator.userAgent;return e.toLowerCase().match(/android/i)?"Android":e.toLowerCase().match(/iphone/i)?"iPhone":e.toLowerCase().match(/ipad|ipod/i)?"iPad":"PC"})();if(e)return"PC"===e?"dk":"iPad"===e||"iPhone"===e?"ios":"mtWeb"})()}onBackClicked(){window.postMessage({type:"OnGiftDetailsBackButtonClicked"},window.location.href)}redeemGift(){if("false"===this.elevateGift.available.toLowerCase())return;let e=new URL(`${this.endpoint}/v1/elevate/redeem`),t={method:"PUT",headers:{"x-SessionId":this.session,"Content-Type":"application/json-patch+json"},body:JSON.stringify({giftId:this.elevateGift.id})};this.redeemErrorMsg="",this.isRedeeming=!0,fetch(e.toString(),t).then((e=>e.json())).then((e=>{if(e.success)window.postMessage({type:"BEEGiftClaimed",itemId:this.elevateGift.id},window.location.href);else{let t=l(`error${e.errorCode}`,this.language);this.redeemErrorMsg=t||l("redeemFailed",this.language),console.error("RedeemFailed",e),window.postMessage({type:"BEEGiftClaimFailed",itemId:this.elevateGift.id,res:e},window.location.href)}})).catch((e=>{window.postMessage({type:"BEEGiftClaimFailed",itemId:this.elevateGift.id,err:e},window.location.href)})).finally((()=>{this.isRedeeming=!1}))}async loadElevateGift(){let e=new URL(`${this.endpoint}/v1/elevate/shop?language=${this.language}&filter=id=${this.itemId}`),t={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET"};await new Promise((i=>{fetch(e.href,t).then((e=>e.json())).then((e=>{let t=e.data;t&&1==t.length?(this.elevateGift=t[0],this.isGiftNotFound=!1):this.isGiftNotFound=!0,i(!0)}))}))}async componentWillLoad(){var e;this.translationUrl.length>2&&await(e=this.translationUrl,new Promise((t=>{fetch(e).then((e=>e.json())).then((e=>{Object.keys(e).forEach((t=>{for(let i in e[t])n[t][i]=e[t][i]})),t(!0)}))}))),this.elevateGift?this.isGiftNotFound=!1:await this.loadElevateGift()}render(){return t(a,null,t("general-styling-wrapper",{clientStylingUrl:this.clientStylingUrl,clientStyling:this.clientStyling}),t("div",{class:"ElevateDetails"},this.isGiftNotFound&&t(s,null,t("div",{class:"Row ThumbnailRow"},t("div",{class:"BackButton",onClick:()=>{this.onBackClicked()}},"<")),t("div",{class:"Thumnails GiftNotFound"},l("noDataFound",this.language),".")),this.elevateGift&&t(s,null,t("div",{class:"ThumbnailRow"},t("div",{class:"Row"},t("div",{class:"BackButton",onClick:()=>{this.onBackClicked()}},"<"),t("bonus-elevate-shop-assets-slider",{class:"Thumbnails",itemsPerPage:1,sliderItems:this.elevateGift.presentation.assets,showSliderDots:this.showSliderDots})),t("div",{class:"Col Details"},t("h3",{class:"GiftName"},this.elevateGift.presentation.displayName||this.elevateGift.displayName),t("div",{class:"GiftPoints"},t("span",{class:"Points"},this.elevateGift.points," "),t("span",{class:" PointsLabel"},l("points",this.language))))),t("div",{class:"ShopItemDetail Details"},t("div",{class:"GiftPresentation"},t("p",null,this.elevateGift.presentation.description?this.elevateGift.presentation.description:l("noGiftPresentation",this.language))),t("div",{class:`RedeemButton ${"false"===this.elevateGift.available||this.isRedeeming?"Disabled":""}\n ${"dk"==this.deviceType?"DkButton":""}`,onClick:this.redeemGift.bind(this)},l("redeem",this.language)),t("span",{class:"RedeemError Error"}," ",this.redeemErrorMsg," ")))))}};d.style=":host{display:block}.ElevateDetails{display:flex;flex-direction:row;flex-wrap:wrap;padding:10px;width:calc(100% - 20px);}.ElevateDetails .Error{color:var(--emfe-w-color-error, #FD2839)}.ElevateDetails .Row{flex-direction:row;display:flex}.ElevateDetails .Col{flex-direction:column;display:flex}.ElevateDetails .Details{padding:20px}.ElevateDetails .ThumbnailRow{display:flex;flex-direction:column;justify-content:space-between;min-width:268px;max-width:398px}.ElevateDetails .ThumbnailRow .BackButton{width:20px;height:20px;padding:5px;background:white;box-shadow:0px 4px 40px 0px rgba(138, 149, 158, 0.2);margin:10px 0 10px;cursor:pointer;animation-timing-function:ease-out;animation-duration:300ms;transition-property:all;border:1px solid #e4e6e8;border-radius:5px;text-align:center}.ElevateDetails .ThumbnailRow .BackButton:hover{background:#e3dede}.ElevateDetails .ThumbnailRow .Thumbnails{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .ShopItemDetail{flex-grow:1;min-width:300px}.ElevateDetails .GiftPoints .Points{font-size:21px}.ElevateDetails .GiftPoints .PointsLabel{font-size:12px;color:var(--emfe-w-color-gray-300, #4e5a37);font-weight:400;line-height:29px;letter-spacing:0.04em;text-align:left}.ElevateDetails .RedeemButton:hover{font-weight:800;border:2px solid var(--emfe-w-color-gray-300, #e5e7d5)}.ElevateDetails .RedeemButton.Disabled:hover{font-weight:normal;border:2px solid transparent}.ElevateDetails .RedeemButton{margin-top:50px;color:#f1f1f1;font-size:20px;padding:16px 25px 16px 25px;border-radius:18px;text-align:center;cursor:pointer;background:linear-gradient(0deg, #26CC37, #26CC37), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);border:2px solid;border-image-source:linear-gradient(283.85deg, rgba(190, 40, 40, 0.5) 0%, rgba(56, 64, 179, 0) 33.47%);box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25)}.ElevateDetails .RedeemButton.DkButton{width:80px;padding:8px;font-size:16px;border-radius:5px}.ElevateDetails .RedeemButton.Disabled{background:linear-gradient(0deg, #b8c4b9, #9eb0a0), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%)}.ElevateDetails .SliderWrapper{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .SliderWrapper .MainContent{display:flex;flex-direction:row;justify-content:space-around}.ElevateDetails .SliderWrapper .MainContent .LeftArrow,.ElevateDetails .SliderWrapper .MainContent .RightArrow{width:20px}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper{overflow:hidden;display:inline-flex;width:calc(100% - 40px);flex-direction:column}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper .Items{display:inline-flex;transition:transform 0.4s ease-in-out;transform:translateX(0px);margin:auto}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img2{width:50%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img3{width:30%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img,.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img1{max-width:100%;background:#efefef;border:1px solid #efefef;border-radius:18px;border:1px;margin:10px 0 10px}.ElevateDetails .SliderWrapper .DotsWrapper{width:100%;margin:0 auto;height:30px}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots{display:flex;justify-content:center;padding:0}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li{height:10px;width:10px;background:#ccc;border-radius:50%;margin-left:3px;margin-right:3px;list-style:none;cursor:pointer}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li:hover{background:#bbb}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.active{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.default{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background-color:#FFF}.ElevateDetails .SliderNavButton{border:0px;width:25px;display:flex;align-items:center;justify-content:center;cursor:pointer}.ElevateDetails .SliderNavButton.HiddenArrow{visibility:hidden}.ElevateDetails .SliderNavButton svg{width:20px;stroke:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .DisabledArrow svg{opacity:0.2;stroke:var(--emfe-w-color-secondary, #FD2839);pointer-events:none}";const h=class{constructor(t){e(this,t),this.clientStyling="",this.clientStylingUrl="",this.translationUrl="",this.stylingAppends=!1,this.setClientStyling=()=>{let e=document.createElement("style");e.innerHTML=this.clientStyling,this.el.prepend(e)},this.setClientStylingURL=()=>{let e=new URL(this.clientStylingUrl),t=document.createElement("style");fetch(e.href).then((e=>e.text())).then((e=>{t.innerHTML=e,setTimeout((()=>{this.el.prepend(t)}),1)})).catch((e=>{console.log("error ",e)}))}}componentDidRender(){this.stylingAppends||(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.stylingAppends=!0)}async componentWillLoad(){const e=[];if(this.translationUrl){const s=(t=this.translationUrl,i=this.targetTranslations,new Promise((e=>{fetch(t).then((e=>e.json())).then((t=>{Object.keys(t).forEach((e=>{i[e]=i[e]?i[e]:{};for(let s in t[e])i[e][s]=t[e][s]})),e(!0)}))})));e.push(s)}var t,i;return await Promise.all(e)}render(){return t("div",{class:"StyleShell"},t("slot",{name:"mainContent"}))}get el(){return i(this)}};h.style=":host{display:block}";export{r as bonus_elevate_shop_assets_slider,d as bonus_elevate_shop_item,h as general_styling_wrapper}
@@ -1 +0,0 @@
1
- let e,t,n,l=!1,o=!1,s=!1,r=!1,i=!1;const c="undefined"!=typeof window?window:{},f=c.document||{head:{}},a={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},u=e=>Promise.resolve(e),$=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),d=new WeakMap,h=e=>"sc-"+e.o,p={},m=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,o=null,s=!1,r=!1,i=[];const c=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!m(l))&&(l+=""),s&&r?i[i.length-1].i+=l:i.push(s?b(null,l):l),r=s)};if(c(n),t){t.name&&(o=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,i,g);const f=b(e,null);return f.u=t,i.length>0&&(f.$=i),f.h=o,f},b=(e,t)=>({t:0,p:e,i:t,m:null,$:null,u:null,h:null}),w={},g={forEach:(e,t)=>e.map(v).forEach(t),map:(e,t)=>e.map(v).map(t).map(j)},v=e=>({vattrs:e.u,vchildren:e.$,vkey:e.g,vname:e.h,vtag:e.p,vtext:e.i}),j=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),y(e.vtag,t,...e.vchildren||[])}const t=b(e.vtag,e.vtext);return t.u=e.vattrs,t.$=e.vchildren,t.g=e.vkey,t.h=e.vname,t},S=(e,t,n,l,o,s)=>{if(n!==l){let r=se(e,t),i=t.toLowerCase();if("class"===t){const t=e.classList,o=O(n),s=O(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("ref"===t)l&&l(e);else if(r||"o"!==t[0]||"n"!==t[1]){const i=m(l);if((r||i&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{let o=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&s||o)&&!i&&e.setAttribute(t,l=!0===l?"":l)}else t="-"===t[2]?t.slice(3):se(c,i)?i.slice(2):i[2]+t.slice(3),n&&a.rel(e,t,n,!1),l&&a.ael(e,t,l,!1)}},k=/\s/,O=e=>e?e.split(k):[],C=(e,t,n,l)=>{const o=11===t.m.nodeType&&t.m.host?t.m.host:t.m,s=e&&e.u||p,r=t.u||p;for(l in s)l in r||S(o,l,s[l],void 0,n,t.t);for(l in r)S(o,l,s[l],r[l],n,t.t)},M=(o,i,c,a)=>{let u,$,d,h=i.$[c],p=0;if(l||(s=!0,"slot"===h.p&&(e&&a.classList.add(e+"-s"),h.t|=h.$?2:1)),null!==h.i)u=h.m=f.createTextNode(h.i);else if(1&h.t)u=h.m=f.createTextNode("");else{if(r||(r="svg"===h.p),u=h.m=f.createElementNS(r?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&h.t?"slot-fb":h.p),r&&"foreignObject"===h.p&&(r=!1),C(null,h,r),null!=e&&u["s-si"]!==e&&u.classList.add(u["s-si"]=e),h.$)for(p=0;p<h.$.length;++p)$=M(o,h,p,u),$&&u.appendChild($);"svg"===h.p?r=!1:"foreignObject"===u.tagName&&(r=!0)}return u["s-hn"]=n,3&h.t&&(u["s-sr"]=!0,u["s-cr"]=t,u["s-sn"]=h.h||"",d=o&&o.$&&o.$[c],d&&d.p===h.p&&o.m&&R(o.m,!1)),u},R=(e,t)=>{a.t|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(P(o).insertBefore(o,N(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&R(o,t)}a.t&=-2},x=(e,t,l,o,s,r)=>{let i,c=e["s-cr"]&&e["s-cr"].parentNode||e;for(c.shadowRoot&&c.tagName===n&&(c=c.shadowRoot);s<=r;++s)o[s]&&(i=M(null,l,s,e),i&&(o[s].m=i,c.insertBefore(i,N(t))))},T=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.m,D(l),o=!0,s["s-ol"]?s["s-ol"].remove():R(s,!0),s.remove())},E=(e,t)=>e.p===t.p&&("slot"!==e.p||e.h===t.h),N=e=>e&&e["s-ol"]||e,P=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,F=(e,t)=>{const n=t.m=e.m,l=e.$,o=t.$,s=t.p,i=t.i;let c;null===i?(r="svg"===s||"foreignObject"!==s&&r,"slot"===s||C(e,t,r),null!==l&&null!==o?((e,t,n,l)=>{let o,s=0,r=0,i=t.length-1,c=t[0],f=t[i],a=l.length-1,u=l[0],$=l[a];for(;s<=i&&r<=a;)null==c?c=t[++s]:null==f?f=t[--i]:null==u?u=l[++r]:null==$?$=l[--a]:E(c,u)?(F(c,u),c=t[++s],u=l[++r]):E(f,$)?(F(f,$),f=t[--i],$=l[--a]):E(c,$)?("slot"!==c.p&&"slot"!==$.p||R(c.m.parentNode,!1),F(c,$),e.insertBefore(c.m,f.m.nextSibling),c=t[++s],$=l[--a]):E(f,u)?("slot"!==c.p&&"slot"!==$.p||R(f.m.parentNode,!1),F(f,u),e.insertBefore(f.m,c.m),f=t[--i],u=l[++r]):(o=M(t&&t[r],n,r,e),u=l[++r],o&&P(c.m).insertBefore(o,N(c.m)));s>i?x(e,null==l[a+1]?null:l[a+1].m,n,l,r,a):r>a&&T(t,s,i)})(n,l,t,o):null!==o?(null!==e.i&&(n.textContent=""),x(n,null,t,o,0,o.length-1)):null!==l&&T(l,0,l.length-1),r&&"svg"===s&&(r=!1)):(c=n["s-cr"])?c.parentNode.textContent=i:e.i!==i&&(n.data=i)},L=e=>{let t,n,l,o,s,r,i=e.childNodes;for(n=0,l=i.length;n<l;n++)if(t=i[n],1===t.nodeType){if(t["s-sr"])for(s=t["s-sn"],t.hidden=!1,o=0;o<l;o++)if(r=i[o].nodeType,i[o]["s-hn"]!==t["s-hn"]||""!==s){if(1===r&&s===i[o].getAttribute("slot")){t.hidden=!0;break}}else if(1===r||3===r&&""!==i[o].textContent.trim()){t.hidden=!0;break}L(t)}},U=[],W=e=>{let t,n,l,s,r,i,c=0,f=e.childNodes,a=f.length;for(;c<a;c++){if(t=f[c],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],i=l.length-1;i>=0;i--)n=l[i],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(A(n,s)?(r=U.find((e=>e.v===n)),o=!0,n["s-sn"]=n["s-sn"]||s,r?r.j=t:U.push({j:t,v:n}),n["s-sr"]&&U.map((e=>{A(e.v,n["s-sn"])&&(r=U.find((e=>e.v===n)),r&&!e.j&&(e.j=r.j))}))):U.some((e=>e.v===n))||U.push({v:n}));1===t.nodeType&&W(t)}},A=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,D=e=>{e.u&&e.u.ref&&e.u.ref(null),e.$&&e.$.map(D)},H=e=>ne(e).S,q=(e,t)=>{t&&!e.k&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.k=t)))},V=(e,t)=>{if(e.t|=16,!(4&e.t))return q(e,e.O),me((()=>_(e,t)));e.t|=512},_=(e,t)=>{const n=e.C;let l;return t&&(l=J(n,"componentWillLoad")),K(l,(()=>z(e,n,t)))},z=async(e,t,n)=>{const l=e.S,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.S,l=t.t,o=((e,t)=>{let n=h(t),l=fe.get(n);if(e=11===e.nodeType?e:f,l)if("string"==typeof l){let t,o=d.get(e=e.head||e);o||d.set(e,o=new Set),o.has(n)||(t=f.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);B(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>G(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},B=(r,i)=>{try{i=i.render(),r.t&=-17,r.t|=2,((r,i)=>{const c=r.S,u=r.M,$=r.R||b(null,null),d=(e=>e&&e.p===w)(i)?i:y(null,null,i);if(n=c.tagName,u.T&&(d.u=d.u||{},u.T.map((([e,t])=>d.u[t]=c[e]))),d.p=null,d.t|=4,r.R=d,d.m=$.m=c.shadowRoot||c,e=c["s-sc"],t=c["s-cr"],l=0!=(1&u.t),o=!1,F($,d),a.t|=1,s){let e,t,n,l,o,s;W(d.m);let r=0;for(;r<U.length;r++)e=U[r],t=e.v,t["s-ol"]||(n=f.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(r=0;r<U.length;r++)if(e=U[r],t=e.v,e.j){for(l=e.j.parentNode,o=e.j.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&L(d.m),a.t&=-2,U.length=0})(r,i)}catch(e){re(e,r.S)}return null},G=e=>{const t=e.S,n=e.C,l=e.O;J(n,"componentDidRender"),64&e.t?J(n,"componentDidUpdate"):(e.t|=64,Q(t),e.N(t),l||I()),e.k&&(e.k(),e.k=void 0),512&e.t&&pe((()=>V(e,!1))),e.t&=-517},I=()=>{Q(f.documentElement),pe((()=>(e=>{const t=a.ce("appload",{detail:{namespace:"bonus-elevate-shop-item"}});return e.dispatchEvent(t),t})(c)))},J=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){re(e)}},K=(e,t)=>e&&e.then?e.then(t):t(),Q=e=>e.classList.add("hydrated"),X=(e,t,n)=>{if(t.P){const l=Object.entries(t.P),o=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(o,e,{get(){return((e,t)=>ne(this).F.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=ne(e),s=o.F.get(t),r=o.t,i=o.C;n=((e,t)=>null==e||m(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.P[t][0]),8&r&&void 0!==s||n===s||Number.isNaN(s)&&Number.isNaN(n)||(o.F.set(t,n),i&&2==(18&r)&&V(o,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){a.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.T.push([e,o]),o}))}}return e},Y=e=>{J(e,"connectedCallback")},Z=(e,t={})=>{const n=[],l=t.exclude||[],o=c.customElements,s=f.head,r=s.querySelector("meta[charset]"),i=f.createElement("style"),u=[];let d,p=!0;Object.assign(a,t),a.l=new URL(t.resourcesUrl||"./",f.baseURI).href,e.map((e=>{e[1].map((t=>{const s={t:t[0],o:t[1],P:t[2],L:t[3]};s.P=t[2],s.T=[];const r=s.o,i=class extends HTMLElement{constructor(e){super(e),oe(e=this,s),1&s.t&&e.attachShadow({mode:"open"})}connectedCallback(){d&&(clearTimeout(d),d=null),p?u.push(this):a.jmp((()=>(e=>{if(0==(1&a.t)){const t=ne(e),n=t.M,l=()=>{};if(1&t.t)Y(t.C);else{t.t|=1,12&n.t&&(e=>{const t=e["s-cr"]=f.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){q(t,t.O=n);break}}n.P&&Object.entries(n.P).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=ce(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(X(o,n,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){re(e)}t.t&=-9,e(),Y(t.C)}if(o.style){let e=o.style;const t=h(n);if(!fe.has(t)){const l=()=>{};((e,t,n)=>{let l=fe.get(e);$&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,fe.set(e,l)})(t,e,!!(1&n.t)),l()}}}const s=t.O,r=()=>V(t,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){a.jmp((()=>(()=>{0==(1&a.t)&&J(ne(this).C,"disconnectedCallback")})()))}componentOnReady(){return ne(this).U}};s.W=e[0],l.includes(r)||o.get(r)||(n.push(r),o.define(r,X(i,s,1)))}))})),i.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",i.setAttribute("data-styles",""),s.insertBefore(i,r?r.nextSibling:s.firstChild),p=!1,u.length?u.map((e=>e.connectedCallback())):a.jmp((()=>d=setTimeout(I,30)))},ee=(e,t)=>t,te=new WeakMap,ne=e=>te.get(e),le=(e,t)=>te.set(t.C=e,t),oe=(e,t)=>{const n={t:0,S:e,M:t,F:new Map};return n.U=new Promise((e=>n.N=e)),e["s-p"]=[],e["s-rc"]=[],te.set(e,n)},se=(e,t)=>t in e,re=(e,t)=>(0,console.error)(e,t),ie=new Map,ce=e=>{const t=e.o.replace(/-/g,"_"),n=e.W,l=ie.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(ie.set(n,e),e[t])),re)},fe=new Map,ae=[],ue=[],$e=(e,t)=>n=>{e.push(n),i||(i=!0,t&&4&a.t?pe(he):a.raf(he))},de=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){re(e)}e.length=0},he=()=>{de(ae),de(ue),(i=ae.length>0)&&a.raf(he)},pe=e=>u().then(e),me=$e(ue,!0);export{ee as F,w as H,Z as b,H as g,y as h,u as p,le as r}
@@ -1,439 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-e516a37b.js');
6
-
7
- const BonusElevateShopAssetsSlider = class {
8
- constructor(hostRef) {
9
- index.registerInstance(this, hostRef);
10
- /**
11
- * Show slider dots
12
- */
13
- this.showSliderDots = false;
14
- /**
15
- * Show slider navigate arrows
16
- */
17
- this.showSliderArrows = true;
18
- this.itemsPerPage = 1;
19
- this.sliderItems = [];
20
- /**
21
- * Slider variables
22
- */
23
- this.activeIndex = 0;
24
- this.xDown = null;
25
- this.yDown = null;
26
- this.orientationChangeHandler = () => {
27
- setTimeout(() => {
28
- this.recalculateItemsPerPage();
29
- }, 10);
30
- };
31
- this.resizeHandler = () => {
32
- this.recalculateItemsPerPage();
33
- };
34
- }
35
- setActive(index) {
36
- var _a;
37
- const maxLength = (_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length;
38
- if (index >= 0) {
39
- if (index >= maxLength - 1) {
40
- this.activeIndex = maxLength - 1;
41
- }
42
- else {
43
- this.activeIndex = index;
44
- }
45
- }
46
- else {
47
- this.activeIndex = 0;
48
- }
49
- }
50
- move(direction) {
51
- this.setActive(this.activeIndex + direction);
52
- }
53
- goTo(index) {
54
- let diff = this.activeIndex - index;
55
- if (diff > 0) {
56
- for (let i = 0; i < diff; i++) {
57
- this.move(-1);
58
- }
59
- }
60
- else {
61
- for (let i = 0; i > diff; i--) {
62
- this.move(1);
63
- }
64
- }
65
- }
66
- handleTouchStart(evt) {
67
- const firstTouch = this.getTouches(evt)[0];
68
- this.xDown = firstTouch.clientX;
69
- this.yDown = firstTouch.clientY;
70
- }
71
- getTouches(evt) {
72
- return evt.touches || evt.originalEvent.touches;
73
- }
74
- handleTouchMove(evt) {
75
- if (!this.xDown || !this.yDown)
76
- return;
77
- let xUp = evt.touches[0].clientX;
78
- let yUp = evt.touches[0].clientY;
79
- let xDiff = this.xDown - xUp;
80
- let yDiff = this.yDown - yUp;
81
- if (Math.abs(xDiff) > Math.abs(yDiff)) {
82
- if (xDiff > 0) {
83
- this.move(1);
84
- }
85
- else {
86
- this.move(-1);
87
- }
88
- }
89
- this.xDown = null;
90
- this.yDown = null;
91
- }
92
- ;
93
- recalculateItemsPerPage() {
94
- if (!this.sliderItemsElement)
95
- return;
96
- this.itemElementWidth = this.sliderItemsElement.clientWidth;
97
- this.sliderItemsElementWidth = (this.sliderItems.length - 1) * this.itemElementWidth;
98
- }
99
- ;
100
- renderDots() {
101
- var _a;
102
- const dots = [];
103
- for (let index$1 = 0; index$1 < ((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) / this.itemsPerPage; index$1++) {
104
- dots.push(index.h("li", { class: index$1 == this.activeIndex ? 'active' : 'default', onClick: () => { this.goTo(index$1); this.setActive(index$1); } }));
105
- }
106
- return dots;
107
- }
108
- componentDidRender() {
109
- this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
110
- this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
111
- this.recalculateItemsPerPage();
112
- }
113
- componentDidUpdate() {
114
- this.recalculateItemsPerPage();
115
- }
116
- connectedCallback() {
117
- window.screen.orientation.addEventListener('change', this.orientationChangeHandler);
118
- }
119
- disconnectedCallback() {
120
- this.el.removeEventListener('touchstart', this.handleTouchStart);
121
- this.el.removeEventListener('touchmove', this.handleTouchMove);
122
- window.screen.orientation.removeEventListener('change', this.orientationChangeHandler);
123
- window.removeEventListener('resize', this.resizeHandler);
124
- }
125
- render() {
126
- var _a;
127
- const styles = {
128
- transform: `translate(${(this.sliderItemsElementWidth / (((_a = this.sliderItems) === null || _a === void 0 ? void 0 : _a.length) - 1) * this.activeIndex) * -1}px, 0px)`
129
- };
130
- const itemStyle = {
131
- width: `${this.itemElementWidth / this.itemsPerPage}px`
132
- };
133
- return index.h("div", { class: "SliderWrapper" }, index.h("div", { class: 'MainContent ' }, this.showSliderArrows &&
134
- index.h("div", { class: `SliderNavButton LeftArrow ${this.activeIndex === 0 ? 'DisabledArrow ' : ''} ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}`, onClick: () => this.move(-1) }, index.h("svg", { fill: "none", stroke: "var(--emfe-w-color-secondary, #FD2839)", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M15 19l-7-7 7-7" }))), index.h("div", { class: 'ItemsWrapper', ref: (el) => this.sliderItemsElement = el }, index.h("div", { class: 'Items AssetsItems', style: styles }, this.sliderItems.map((assetUrl) => index.h("img", { class: `img${this.itemsPerPage}`, alt: 'Gift Thumbnails', style: itemStyle, src: assetUrl })))), this.showSliderArrows &&
135
- index.h("div", { class: `SliderNavButton RightArrow ${this.sliderItems.length === 1 ? 'HiddenArrow ' : ''}
136
- ${(this.activeIndex === (this.sliderItems.length - 1) || this.itemsPerPage == this.sliderItems.length) ? 'DisabledArrow' : ''}`, onClick: () => this.move(1) }, index.h("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 5l7 7-7 7" })))), this.showSliderDots && this.sliderItems.length > 1 &&
137
- index.h("div", { class: "DotsWrapper" }, index.h("ul", { class: "Dots" }, this.renderDots())));
138
- }
139
- get el() { return index.getElement(this); }
140
- };
141
-
142
- const DEFAULT_LANGUAGE = 'en';
143
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hu'];
144
- const TRANSLATIONS = {
145
- en: {
146
- points: 'Points',
147
- noGiftPresentation: 'No description',
148
- redeem: 'Redeem',
149
- noDataFound: 'No data found',
150
- error4003: 'Invalid Session',
151
- redeemFailed: 'Failed to redeem'
152
- },
153
- ro: {
154
- points: 'Points',
155
- noGiftPresentation: 'No description',
156
- redeem: 'Redeem',
157
- noDataFound: 'No data found',
158
- error4003: 'Invalid Session',
159
- redeemFailed: 'Failed to redeem'
160
- },
161
- fr: {
162
- points: 'Points',
163
- noGiftPresentation: 'No description',
164
- redeem: 'Redeem',
165
- noDataFound: 'No data found',
166
- error4003: 'Invalid Session',
167
- redeemFailed: 'Failed to redeem',
168
- },
169
- ar: {
170
- points: 'Points',
171
- noGiftPresentation: 'No description',
172
- redeem: 'Redeem',
173
- noDataFound: 'No data found',
174
- error4003: 'Invalid Session',
175
- redeemFailed: 'Failed to redeem',
176
- },
177
- hu: {
178
- points: 'Points',
179
- noGiftPresentation: 'No description',
180
- redeem: 'Redeem',
181
- noDataFound: 'No data found',
182
- error4003: 'Invalid Session',
183
- redeemFailed: 'Failed to redeem',
184
- }
185
- };
186
- const translate = (key, customLang) => {
187
- const lang = customLang;
188
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
189
- };
190
- const getTranslations = (url) => {
191
- // fetch url, get the data, replace the TRANSLATIONS content
192
- return new Promise((resolve) => {
193
- fetch(url)
194
- .then((res) => res.json())
195
- .then((data) => {
196
- Object.keys(data).forEach((item) => {
197
- for (let key in data[item]) {
198
- TRANSLATIONS[item][key] = data[item][key];
199
- }
200
- });
201
- resolve(true);
202
- });
203
- });
204
- };
205
-
206
- /**
207
- * @name isMobile
208
- * @description A method that returns if the browser used to access the app is from a mobile device or not
209
- * @param {String} userAgent window.navigator.userAgent
210
- * @returns {Boolean} true or false
211
- */
212
- const getDevice = () => {
213
- let userAgent = window.navigator.userAgent;
214
- if (userAgent.toLowerCase().match(/android/i)) {
215
- return 'Android';
216
- }
217
- if (userAgent.toLowerCase().match(/iphone/i)) {
218
- return 'iPhone';
219
- }
220
- if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
221
- return 'iPad';
222
- }
223
- return 'PC';
224
- };
225
- const getDevicePlatform = () => {
226
- const device = getDevice();
227
- if (device) {
228
- if (device === 'PC') {
229
- return 'dk';
230
- }
231
- else if (device === 'iPad' || device === 'iPhone') {
232
- return 'ios';
233
- }
234
- else {
235
- return 'mtWeb';
236
- }
237
- }
238
- };
239
-
240
- const bonusElevateShopItemCss = ":host{display:block}.ElevateDetails{display:flex;flex-direction:row;flex-wrap:wrap;padding:10px;width:calc(100% - 20px);}.ElevateDetails .Error{color:var(--emfe-w-color-error, #FD2839)}.ElevateDetails .Row{flex-direction:row;display:flex}.ElevateDetails .Col{flex-direction:column;display:flex}.ElevateDetails .Details{padding:20px}.ElevateDetails .ThumbnailRow{display:flex;flex-direction:column;justify-content:space-between;min-width:268px;max-width:398px}.ElevateDetails .ThumbnailRow .BackButton{width:20px;height:20px;padding:5px;background:white;box-shadow:0px 4px 40px 0px rgba(138, 149, 158, 0.2);margin:10px 0 10px;cursor:pointer;animation-timing-function:ease-out;animation-duration:300ms;transition-property:all;border:1px solid #e4e6e8;border-radius:5px;text-align:center}.ElevateDetails .ThumbnailRow .BackButton:hover{background:#e3dede}.ElevateDetails .ThumbnailRow .Thumbnails{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .ShopItemDetail{flex-grow:1;min-width:300px}.ElevateDetails .GiftPoints .Points{font-size:21px}.ElevateDetails .GiftPoints .PointsLabel{font-size:12px;color:var(--emfe-w-color-gray-300, #4e5a37);font-weight:400;line-height:29px;letter-spacing:0.04em;text-align:left}.ElevateDetails .RedeemButton:hover{font-weight:800;border:2px solid var(--emfe-w-color-gray-300, #e5e7d5)}.ElevateDetails .RedeemButton.Disabled:hover{font-weight:normal;border:2px solid transparent}.ElevateDetails .RedeemButton{margin-top:50px;color:#f1f1f1;font-size:20px;padding:16px 25px 16px 25px;border-radius:18px;text-align:center;cursor:pointer;background:linear-gradient(0deg, #26CC37, #26CC37), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);border:2px solid;border-image-source:linear-gradient(283.85deg, rgba(190, 40, 40, 0.5) 0%, rgba(56, 64, 179, 0) 33.47%);box-shadow:0px 4px 4px 0px rgba(0, 0, 0, 0.25)}.ElevateDetails .RedeemButton.DkButton{width:80px;padding:8px;font-size:16px;border-radius:5px}.ElevateDetails .RedeemButton.Disabled{background:linear-gradient(0deg, #b8c4b9, #9eb0a0), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%)}.ElevateDetails .SliderWrapper{display:flex;flex-direction:column;position:relative;width:calc(100% - 40px)}.ElevateDetails .SliderWrapper .MainContent{display:flex;flex-direction:row;justify-content:space-around}.ElevateDetails .SliderWrapper .MainContent .LeftArrow,.ElevateDetails .SliderWrapper .MainContent .RightArrow{width:20px}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper{overflow:hidden;display:inline-flex;width:calc(100% - 40px);flex-direction:column}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper .Items{display:inline-flex;transition:transform 0.4s ease-in-out;transform:translateX(0px);margin:auto}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img2{width:50%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img3{width:30%}.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img,.ElevateDetails .SliderWrapper .MainContent .ItemsWrapper img.img1{max-width:100%;background:#efefef;border:1px solid #efefef;border-radius:18px;border:1px;margin:10px 0 10px}.ElevateDetails .SliderWrapper .DotsWrapper{width:100%;margin:0 auto;height:30px}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots{display:flex;justify-content:center;padding:0}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li{height:10px;width:10px;background:#ccc;border-radius:50%;margin-left:3px;margin-right:3px;list-style:none;cursor:pointer}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li:hover{background:#bbb}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.active{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .SliderWrapper .DotsWrapper ul.Dots li.default{border:solid 1px var(--emfe-w-color-secondary, #FD2839);background-color:#FFF}.ElevateDetails .SliderNavButton{border:0px;width:25px;display:flex;align-items:center;justify-content:center;cursor:pointer}.ElevateDetails .SliderNavButton.HiddenArrow{visibility:hidden}.ElevateDetails .SliderNavButton svg{width:20px;stroke:var(--emfe-w-color-secondary, #FD2839)}.ElevateDetails .DisabledArrow svg{opacity:0.2;stroke:var(--emfe-w-color-secondary, #FD2839);pointer-events:none}";
241
-
242
- const BonusElevateShopItem = class {
243
- constructor(hostRef) {
244
- index.registerInstance(this, hostRef);
245
- /**
246
- * Currently selected language.
247
- */
248
- this.language = 'en';
249
- /**
250
- * Client custom styling via inline styles
251
- */
252
- this.clientStyling = '';
253
- /**
254
- * Client custom styling via url
255
- */
256
- this.clientStylingUrl = '';
257
- /**
258
- * Translation via url
259
- */
260
- this.translationUrl = '';
261
- /**
262
- * Show slider dots
263
- */
264
- this.showSliderDots = false;
265
- /**
266
- * Show slider navigate arrows
267
- */
268
- this.showSliderArrows = true;
269
- this.isGiftNotFound = false;
270
- this.redeemErrorMsg = '';
271
- this.isRedeeming = false;
272
- this.deviceType = getDevicePlatform();
273
- }
274
- onBackClicked() {
275
- window.postMessage({ type: 'OnGiftDetailsBackButtonClicked' }, window.location.href);
276
- }
277
- redeemGift() {
278
- if (this.elevateGift.available.toLowerCase() === 'false') {
279
- return;
280
- }
281
- let url = new URL(`${this.endpoint}/v1/elevate/redeem`);
282
- let claimGiftOptions = {
283
- method: 'PUT',
284
- headers: {
285
- 'x-SessionId': this.session,
286
- 'Content-Type': 'application/json-patch+json',
287
- },
288
- body: JSON.stringify({ giftId: this.elevateGift.id }),
289
- };
290
- this.redeemErrorMsg = '';
291
- this.isRedeeming = true;
292
- fetch(url.toString(), claimGiftOptions)
293
- .then((res) => res.json())
294
- .then((res) => {
295
- if (res.success) {
296
- window.postMessage({ type: 'BEEGiftClaimed', itemId: this.elevateGift.id }, window.location.href);
297
- }
298
- else {
299
- let translatedError = translate(`error${res.errorCode}`, this.language);
300
- this.redeemErrorMsg = translatedError ? translatedError : translate('redeemFailed', this.language);
301
- console.error('RedeemFailed', res);
302
- window.postMessage({ type: 'BEEGiftClaimFailed', itemId: this.elevateGift.id, res }, window.location.href);
303
- }
304
- })
305
- .catch((err) => {
306
- window.postMessage({ type: 'BEEGiftClaimFailed', itemId: this.elevateGift.id, err }, window.location.href);
307
- }).finally(() => {
308
- this.isRedeeming = false;
309
- });
310
- }
311
- async loadElevateGift() {
312
- let url = new URL(`${this.endpoint}/v1/elevate/shop?language=${this.language}&filter=id=${this.itemId}`);
313
- let options = {
314
- headers: {
315
- 'Content-Type': 'application/json',
316
- 'x-SessionId': this.session,
317
- },
318
- method: 'GET',
319
- };
320
- await new Promise((resolve) => {
321
- fetch(url.href, options)
322
- .then((res) => res.json())
323
- .then((data) => {
324
- let filteredGifts = data.data;
325
- if (filteredGifts && filteredGifts.length == 1) {
326
- this.elevateGift = filteredGifts[0];
327
- this.isGiftNotFound = false;
328
- }
329
- else {
330
- this.isGiftNotFound = true;
331
- }
332
- resolve(true);
333
- });
334
- });
335
- }
336
- async componentWillLoad() {
337
- if (this.translationUrl.length > 2) {
338
- await getTranslations(this.translationUrl);
339
- }
340
- if (this.elevateGift) {
341
- this.isGiftNotFound = false;
342
- }
343
- else {
344
- await this.loadElevateGift();
345
- }
346
- }
347
- render() {
348
- return (index.h(index.Host, null, index.h("general-styling-wrapper", { clientStylingUrl: this.clientStylingUrl, clientStyling: this.clientStyling }), index.h("div", { class: 'ElevateDetails' }, this.isGiftNotFound && (index.h(index.Fragment, null, index.h("div", { class: "Row ThumbnailRow" }, index.h("div", { class: "BackButton", onClick: () => {
349
- this.onBackClicked();
350
- } }, '<')), index.h("div", { class: "Thumnails GiftNotFound" }, translate('noDataFound', this.language), "."))), this.elevateGift && index.h(index.Fragment, null, index.h("div", { class: "ThumbnailRow" }, index.h("div", { class: 'Row' }, index.h("div", { class: "BackButton", onClick: () => { this.onBackClicked(); } }, '<'), index.h("bonus-elevate-shop-assets-slider", { class: 'Thumbnails', itemsPerPage: 1, sliderItems: this.elevateGift.presentation.assets, showSliderDots: this.showSliderDots })), index.h("div", { class: 'Col Details' }, index.h("h3", { class: "GiftName" }, this.elevateGift.presentation.displayName || this.elevateGift.displayName), index.h("div", { class: "GiftPoints" }, index.h("span", { class: "Points" }, this.elevateGift.points, " "), index.h("span", { class: " PointsLabel" }, translate('points', this.language))))), index.h("div", { class: 'ShopItemDetail Details' }, index.h("div", { class: "GiftPresentation" }, index.h("p", null, this.elevateGift.presentation.description ? this.elevateGift.presentation.description : translate('noGiftPresentation', this.language))), index.h("div", { class: `RedeemButton ${this.elevateGift.available === 'false' || this.isRedeeming ? 'Disabled' : ''}
351
- ${this.deviceType == 'dk' ? 'DkButton' : ''}`, onClick: this.redeemGift.bind(this) }, translate('redeem', this.language)), index.h("span", { class: 'RedeemError Error' }, " ", this.redeemErrorMsg, " "))))));
352
- }
353
- };
354
- BonusElevateShopItem.style = bonusElevateShopItemCss;
355
-
356
- const mergeTranslations = (url, target) => {
357
- return new Promise((resolve) => {
358
- fetch(url)
359
- .then((res) => res.json())
360
- .then((data) => {
361
- Object.keys(data).forEach((item) => {
362
- target[item] = target[item] ? target[item] : {};
363
- for (let key in data[item]) {
364
- target[item][key] = data[item][key];
365
- }
366
- });
367
- resolve(true);
368
- });
369
- });
370
- };
371
-
372
- const generalStylingWrapperCss = ":host{display:block}";
373
-
374
- const GeneralStylingWrapper = class {
375
- constructor(hostRef) {
376
- index.registerInstance(this, hostRef);
377
- /**
378
- * Client custom styling via inline styles
379
- */
380
- this.clientStyling = '';
381
- /**
382
- * Client custom styling via url
383
- */
384
- this.clientStylingUrl = '';
385
- /**
386
- * Translation via url
387
- */
388
- this.translationUrl = '';
389
- this.stylingAppends = false;
390
- this.setClientStyling = () => {
391
- let sheet = document.createElement('style');
392
- sheet.innerHTML = this.clientStyling;
393
- this.el.prepend(sheet);
394
- };
395
- this.setClientStylingURL = () => {
396
- let url = new URL(this.clientStylingUrl);
397
- let cssFile = document.createElement('style');
398
- fetch(url.href)
399
- .then((res) => res.text())
400
- .then((data) => {
401
- cssFile.innerHTML = data;
402
- setTimeout(() => {
403
- this.el.prepend(cssFile);
404
- }, 1);
405
- })
406
- .catch((err) => {
407
- console.log('error ', err);
408
- });
409
- };
410
- }
411
- componentDidRender() {
412
- // start custom styling area
413
- if (!this.stylingAppends) {
414
- if (this.clientStyling)
415
- this.setClientStyling();
416
- if (this.clientStylingUrl)
417
- this.setClientStylingURL();
418
- this.stylingAppends = true;
419
- }
420
- // end custom styling area
421
- }
422
- async componentWillLoad() {
423
- const promises = [];
424
- if (this.translationUrl) {
425
- const translationPromise = mergeTranslations(this.translationUrl, this.targetTranslations);
426
- promises.push(translationPromise);
427
- }
428
- return await Promise.all(promises);
429
- }
430
- render() {
431
- return (index.h("div", { class: "StyleShell" }, index.h("slot", { name: "mainContent" })));
432
- }
433
- get el() { return index.getElement(this); }
434
- };
435
- GeneralStylingWrapper.style = generalStylingWrapperCss;
436
-
437
- exports.bonus_elevate_shop_assets_slider = BonusElevateShopAssetsSlider;
438
- exports.bonus_elevate_shop_item = BonusElevateShopItem;
439
- exports.general_styling_wrapper = GeneralStylingWrapper;
@@ -1,19 +0,0 @@
1
- 'use strict';
2
-
3
- const index = require('./index-e516a37b.js');
4
-
5
- /*
6
- Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
7
- */
8
- const patchBrowser = () => {
9
- const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('bonus-elevate-shop-item.cjs.js', document.baseURI).href));
10
- const opts = {};
11
- if (importMeta !== '') {
12
- opts.resourcesUrl = new URL('.', importMeta).href;
13
- }
14
- return index.promiseResolve(opts);
15
- };
16
-
17
- patchBrowser().then(options => {
18
- return index.bootstrapLazy([["bonus-elevate-shop-assets-slider_3.cjs",[[1,"bonus-elevate-shop-item",{"endpoint":[513],"language":[513],"itemId":[1537,"item-id"],"elevateGift":[1040],"session":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"showSliderDots":[516,"show-slider-dots"],"showSliderArrows":[516,"show-slider-arrows"],"isGiftNotFound":[32],"redeemErrorMsg":[32],"isRedeeming":[32]}],[0,"bonus-elevate-shop-assets-slider",{"showSliderDots":[516,"show-slider-dots"],"showSliderArrows":[516,"show-slider-arrows"],"itemsPerPage":[514,"items-per-page"],"sliderItems":[16],"activeIndex":[32]}],[4,"general-styling-wrapper",{"clientStyling":[1,"client-styling"],"clientStylingUrl":[1,"client-styling-url"],"translationUrl":[1,"translation-url"],"targetTranslations":[16]}]]]], options);
19
- });