@everymatrix/bonus-powerups-ingame-games 0.0.38 → 0.0.40
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/bonus-powerups-ingame-games/bonus-powerups-ingame-games-971d2e26.js +1 -0
- package/dist/bonus-powerups-ingame-games/bonus-powerups-ingame-games_3.entry.js +1 -1
- package/dist/bonus-powerups-ingame-games/index.esm.js +1 -1
- package/dist/cjs/{bonus-powerups-ingame-games-7de80a10.js → bonus-powerups-ingame-games-3fb982e8.js} +7 -3
- package/dist/cjs/bonus-powerups-ingame-games_3.cjs.entry.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/collection/components/bonus-powerups-ingame-games/bonus-powerups-ingame-games.js +21 -3
- package/dist/esm/{bonus-powerups-ingame-games-b2c0935f.js → bonus-powerups-ingame-games-971d2e26.js} +7 -3
- package/dist/esm/bonus-powerups-ingame-games_3.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/bonus-powerups-ingame-games/.stencil/libs/common/src/types/casino/powerups.d.ts +5 -0
- package/dist/types/components/bonus-powerups-ingame-games/bonus-powerups-ingame-games.d.ts +2 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/dist/bonus-powerups-ingame-games/bonus-powerups-ingame-games-b2c0935f.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as a}from"./index-fd928daa.js";const i="__WIDGET_GLOBAL_STYLE_CACHE__";function n(e,t){if(e){const a=document.createElement("style");a.innerHTML=t,e.appendChild(a)}}function o(e,t){if(!e||!t)return;const a=new URL(t);fetch(a.href).then((e=>e.text())).then((t=>{const a=document.createElement("style");a.innerHTML=t,e&&e.appendChild(a)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function r(e,t,a,n=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!n)return a=function(e,t){const a=document.createElement("style");return window.emMessageBus.subscribe(t,(t=>{e&&(a.innerHTML=t,e.appendChild(a))}))}(e,t),a;window[i]||(window[i]={}),a=function(e,t){return window.emMessageBus.subscribe(t,(a=>{if(!e)return;const n=e.getRootNode(),o=window[i];let r=o[t]&&o[t].sheet;r?o[t].refCount=o[t].refCount+1:(r=new CSSStyleSheet,r.replaceSync(a),o[t]={sheet:r,refCount:1});const s=n.adoptedStyleSheets||[];s.includes(r)||(n.adoptedStyleSheets=[...s,r])}))}(e,t);const o=a.unsubscribe.bind(a);return a.unsubscribe=()=>{if(window[i][t]){const e=window[i][t];e.refCount>1?e.refCount=e.refCount-1:delete window[i][t]}o()},a}const s={expand:"games",fields:"id,powerUpID,powerUpName,displayName,games(id,gameId,slug,name,thumbnail)"},l={en:{playNow:"Play Now",games:"Games",noDataFound:"No data found",loading:"Loading",loadingMore:"Loading More"}},d=(e,t,a)=>{let i=l[void 0!==t&&t in l?t:"en"][e];if(void 0!==a)for(const[e,t]of Object.entries(a.values)){const a=new RegExp(`{${e}}`,"g");i=i.replace(a,t)}return i},c=class{constructor(a){e(this,a),this.showDetailsEvent=t(this,"showPowerupDetails",7),this.backFromPowerupGamesEvent=t(this,"backFromPowerupGames",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl=void 0,this.language="en",this.endpoint=void 0,this.session=void 0,this.powerupId=void 0,this.isLoadingGames=!1,this.powerUpGames={items:[],total:0},this.powerUp=void 0,this.limit=30}initializeGamesObserver(){this.loadMoreGamesObserver&&this.loadMoreGamesObserver.disconnect(),this.loadMoreGamesObserver=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.loadMoreGames().catch(console.error)}))})),this.lastGameElement&&this.loadMoreGamesObserver.observe(this.lastGameElement)}async loadMoreGames(){var e,t,a,i;if(!(this.isLoadingGames||this.powerUpGames.total>0&&this.powerUpGames.items.length>=this.powerUpGames.total)){this.isLoadingGames=!0,this.abortController&&this.abortController.abort(),this.abortController=new AbortController;try{const n=new URL(`${this.endpoint}/v1/elevate/powerups/available?pagination=games(limit=${this.limit},offset=${(null===(t=null===(e=this.powerUpGames)||void 0===e?void 0:e.items)||void 0===t?void 0:t.length)||0})`),o={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET",signal:this.abortController.signal};n.searchParams.append("filter",`id=${this.powerupId}`),Object.entries(s).forEach((([e,t])=>{n.searchParams.append(e,t)})),n.searchParams.append("language",this.language);const r=await fetch(n,o);if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const l=await r.json();this.powerUp=l.data[0];const d=(null===(a=this.powerUp.games)||void 0===a?void 0:a.items)||[];this.powerUpGames={items:[...this.powerUpGames.items,...d],total:(null===(i=this.powerUp.games)||void 0===i?void 0:i.total)||this.powerUpGames.total}}catch(e){"AbortError"!==e.name&&console.error("Failed to load more games:",e)}finally{this.abortController.signal.aborted||(this.isLoadingGames=!1)}}}onBackToDetail(){this.backFromPowerupGamesEvent.emit()}onGameClick(e){window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:e.slug}})}componentDidUpdate(){this.powerUpGames.items.length<this.powerUpGames.total&&this.initializeGamesObserver()}render(){var e,t;return a("div",{key:"1e7ce5bf041634d441eacdf8eb66dd8b2b050c24",class:"IngamePowerUpGamesContainer",ref:e=>this.stylingContainer=e},a("div",{key:"0945e1b3a335c68b723a51cd8a0ad8776ef2566b",class:"TopBar"},a("div",{key:"fe25ac85c3204a91530b3129cc948ef5ddb3567f",class:"ReturnIcon CircleLinearBorder",onClick:()=>this.onBackToDetail(),innerHTML:'<svg width="14" height="14" viewBox="0 0 14 14"\n fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_4119_5439)">\n <path d="M11.1533 12.8332C11.8242 11.9932 12.25 10.9315 12.25 9.759C12.25 6.959 9.7475 4.6665 6.69667 4.6665H1.75"\n stroke="currentColor" stroke-width="0.952264" stroke-miterlimit="10" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M5.25 1.16699L1.75 4.66699L5.25 8.16699" stroke="currentColor" stroke-width="0.952264" stroke-miterlimit="10"\n stroke-linecap="round" stroke-linejoin="round" />\n </g>\n <defs>\n <clipPath id="clip0_4119_5439">\n <rect width="14" height="14" fill="white" />\n </clipPath>\n </defs>\n</svg>\n'}),this.powerUp&&a("div",{key:"282b061c77186eca064917c823cdb8dc4b1b00db",class:"Title TextContent"},a("span",{key:"330bee8694baf45f1fc7d43b31f899e16f352609",class:"Name"},this.powerUp.displayName)," /",a("div",{key:"24abf921e35c4fb074bf04cda8f0985340ce0813",class:"Label"},d("games",this.language)),a("div",{key:"bf26cd444bdcf1ccd032f276e5718d523d4ca4cd",class:"GamesTotal"},"( ",this.powerUpGames.total||""," )"))),a("div",{key:"6a5517ea39f7dd6771ad9ce889cc61250660037a",class:"GamesWrapper Card "},this.isLoadingGames&&0===this.powerUpGames.items.length&&a("div",{key:"1f2df724a9b872aeccc42a3f464506d7402b8fd1",class:"Loading"},a("div",{key:"50d4d313bfd33643f6fc2463e32288e851caf065",class:"smart-loader"},a("div",{key:"b04440dc330e503c755198105f45350fd5a9af6e",class:"smart-item"}),a("div",{key:"b90f8f22ce2b95c0746e06c4976887dd27c08f53",class:"smart-item"}),a("div",{key:"af5d51749f9c4b95c1f4df414da7b16e10f36fe3",class:"smart-item"}))),this.isLoadingGames||this.powerUp?a("div",{class:"CircleInner GamesList"},a("div",{class:"Games FlexRow"},this.powerUpGames.total>0&&this.powerUpGames.items.map(((e,t)=>a("div",{class:"Game",ref:t===this.powerUpGames.items.length-1?e=>this.lastGameElement=e:null},a("ui-image",{src:e.thumbnail,alt:e.name}),a("div",{class:"GameMask",onClick:this.onGameClick.bind(this,e)},a("div",{class:"GameStartBtn"},a("div",{class:"PlayIcon"}),a("span",null,d("playNow",this.language))))))),this.isLoadingGames&&(null===(t=null===(e=this.powerUpGames)||void 0===e?void 0:e.items)||void 0===t?void 0:t.length)>this.limit&&a("p",{class:"LoadingMore"},d("loadingMore",this.language)))):a("div",{class:"NoData"},d("noDataFound",this.language)," ")))}handleClientStylingChange(e,t){e!=t&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,t){e!=t&&o(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,t){e!=t&&r(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.loadMoreGames()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&r(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&o(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.abortController&&this.abortController.abort(),this.loadMoreGamesObserver&&this.loadMoreGamesObserver.disconnect()}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};c.style=':host{display:block;height:100%;--game-amount-line:3}.IngamePowerUpGamesContainer{height:100%;display:flex;padding:var(--emw--ingame-power-container-padding, 8px);justify-content:flex-start;flex-direction:column}.IngamePowerUpGamesContainer .CircleLinearBorder{background:rgba(9, 9, 9, 0.5019607843);position:relative;width:26px;height:26px;border-radius:20px;background:none;overflow:hidden;border:1.5px solid transparent;display:flex;align-items:center;justify-content:center;cursor:pointer}.IngamePowerUpGamesContainer .CircleLinearBorder svg{border-radius:20px;padding:4.5px;background:var(--emw--ingame-color-powerup-bg, rgba(9, 9, 9, 0.8980392157));z-index:1}.IngamePowerUpGamesContainer .CircleLinearBorder::before{content:"";position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;z-index:-1;border-radius:21.5px;background:linear-gradient(0deg, var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.0666666667)), var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.0666666667))), linear-gradient(35.22deg, var(--emw--ingame-color-white10, rgba(255, 255, 255, 0)), var(--emw--ingame-color-white30, rgba(255, 255, 255, 0.5490196078)) 89.19%)}.IngamePowerUpGamesContainer .TopBar,.IngamePowerUpGamesContainer .Loading{padding:15px}.IngamePowerUpGamesContainer .TopBar{display:flex;align-items:center;gap:5px}.IngamePowerUpGamesContainer .TopBar .ReturnIcon{width:26px;height:26px;display:flex;border-radius:20px;padding:0;backdrop-filter:blur(13.7647px);justify-content:center;align-items:center}.IngamePowerUpGamesContainer .TopBar .ReturnIcon svg{color:var(--emw--ingame-color-white60, #f0f0f0)}.IngamePowerUpGamesContainer .TopBar .Title{font-weight:600;font-size:0.9rem;line-height:100%;text-align:center;vertical-align:middle;color:var(--emw--ingame-color-neutural-95, #EDEFF2);display:flex;flex-direction:row}.IngamePowerUpGamesContainer .TopBar .Title .Name{font-size:1.1rem}.IngamePowerUpGamesContainer .TopBar .Title .Label{font-size:1.1rem;font-weight:bold;color:var(--emw--ingame-color-neutural-95, #EDEFF2)}.IngamePowerUpGamesContainer .TopBar .TextContent{font-weight:400;font-size:0.9rem;line-height:1.1rem;vertical-align:middle;color:var(--emw--ingame-color-white70, rgba(255, 255, 255, 0.6980392157))}.IngamePowerUpGamesContainer .GamesWrapper{height:calc(100% - 90px);overflow:hidden;width:100%;margin-bottom:10px;scrollbar-width:thin;scrollbar-color:var(--emw--color-background, hsl(254, 8.53%, 54.93%)) transparent}.IngamePowerUpGamesContainer .Games{overflow:auto;scrollbar-width:thin;scrollbar-color:var(--emw--color-background, hsl(254, 8.53%, 54.93%)) transparent}.IngamePowerUpGamesContainer .GamesList{display:flex;height:100%;justify-content:center;flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--emw--background-gray-color, gray) transparent}.IngamePowerUpGamesContainer .GamesList::-webkit-scrollbar-track{background-color:transparent;border-radius:5px}.IngamePowerUpGamesContainer .GamesList .Games{padding:15px;display:flex;align-items:flex-start;justify-content:flex-start;flex-wrap:wrap;gap:calc(30px / (var(--game-amount-line, 3) - 1))}.IngamePowerUpGamesContainer .GamesList .Games .Game{width:calc((100% - 30px) / var(--game-amount-line, 3));cursor:pointer;position:relative}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .mask-filter{opacity:1}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover img{opacity:0.4;filter:blur(1.5px)}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .GameMask{mix-blend-mode:screen;background-color:var(--emw--color-powup-green, #24B24E);display:flex;justify-content:center;align-items:center;position:absolute;width:100%;opacity:1;left:0;height:100%;top:0;border-radius:8px}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .GameMask .GameStartBtn{opacity:1}.IngamePowerUpGamesContainer .GameMask{display:none;transition:display;transition-duration:0.2s;opacity:0;position:absolute;width:70%;height:100%}.IngamePowerUpGamesContainer .GameMask .GameStartBtn{width:80px;height:22px;border-radius:8px;opacity:1;padding:4px 5px;background:linear-gradient(180deg, var(--emw--color-powup-green, #24B24E) 0%, var(--emw--color-powup-light-green, #18CE51) 100%);border:1px solid var(--emw--ingame-color-white, #FFFFFF);display:flex;align-items:center;justify-content:space-between;cursor:pointer}.IngamePowerUpGamesContainer .GameMask .GameStartBtn .PlayIcon{background-image:url(\'data:image/svg+xml;charset=utf8,<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 1C3.01472 1 1 3.01472 1 5.5C1 7.98528 3.01472 10 5.5 10C7.98528 10 10 7.98528 10 5.5C10 3.01472 7.98528 1 5.5 1ZM0 5.5C0 2.46243 2.46243 0 5.5 0C8.53757 0 11 2.46243 11 5.5C11 8.53757 8.53757 11 5.5 11C2.46243 11 0 8.53757 0 5.5ZM5.12255 3.21652C5.12728 3.21956 5.13199 3.22259 5.13668 3.22561L7.49698 4.74294C7.50129 4.74571 7.50562 4.74849 7.50998 4.75129C7.58551 4.79982 7.66805 4.85285 7.73381 4.90413C7.80355 4.95852 7.91363 5.05446 7.97854 5.20809C8.0574 5.39471 8.0574 5.60529 7.97854 5.79191C7.91363 5.94554 7.80355 6.04148 7.73381 6.09587C7.66805 6.14715 7.58551 6.20018 7.50998 6.24871C7.50562 6.25151 7.50129 6.25429 7.49698 6.25706L5.13668 7.77439C5.13199 7.77741 5.12727 7.78045 5.12255 7.78348C5.03469 7.84 4.9423 7.89941 4.86094 7.94176C4.77909 7.98436 4.63056 8.05332 4.44657 8.04018C4.22957 8.02468 4.02999 7.91572 3.89961 7.74157C3.78907 7.59391 3.76675 7.43167 3.75832 7.33979C3.74995 7.24844 3.74997 7.1386 3.75 7.03414C3.75 7.02852 3.75 7.02292 3.75 7.01733V3.98267C3.75 3.97708 3.75 3.97148 3.75 3.96586C3.74997 3.8614 3.74995 3.75156 3.75832 3.66021C3.76675 3.56833 3.78907 3.40609 3.89961 3.25843C4.02999 3.08428 4.22957 2.97532 4.44657 2.95982C4.63056 2.94668 4.77909 3.01564 4.86094 3.05824C4.94231 3.10059 5.03469 3.16001 5.12255 3.21652ZM4.75 4.16583V6.83417L6.82537 5.5L4.75 4.16583Z" fill="white"/> <path d="M4.75 6.83417V4.16583L6.82537 5.5L4.75 6.83417Z" fill="white"/></svg>\');height:16px;width:16px;background-repeat:no-repeat;background-size:contain}.Games .Container{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;height:calc(100% - 120px);overflow:auto}.Games .Container .Game{width:105px}@keyframes smart-animate1{0%{opacity:0.15;transform:translateX(0px)}35%{opacity:1;transform:translateX(36px)}75%{opacity:1;transform:translateX(0px)}100%{opacity:0.15;transform:translateX(0px)}}@keyframes smart-animate2{0%{opacity:1}35%{opacity:0.15}75%{opacity:0.5}100%{opacity:1}}@keyframes smart-animate3{0%{opacity:0.5;transform:translateX(0px)}35%{opacity:0.15;transform:translateX(-36px)}75%{opacity:0.15;transform:translateX(0px)}100%{opacity:0.5;transform:translateX(0px)}}.smart-loader{margin:50px auto;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100px;gap:10px}.smart-loader .smart-item{width:3px;height:20px;opacity:0.15;animation-delay:200ms;animation-duration:1000ms;animation-timing-function:ease-out;animation-fill-mode:forwards;padding:1px;margin:5px 0;background:var(--emw--ingame-color-powerup-brightgreen, #00FA5A);border-radius:4px;animation-iteration-count:infinite;animation-direction:normal}.smart-loader .smart-item:nth-child(1){animation-name:smart-animate1}.smart-loader .smart-item:nth-child(2){animation-name:smart-animate2;height:36px}.smart-loader .smart-item:nth-child(3){animation-name:smart-animate3}';export{c as B}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{B as bonus_powerups_ingame_games}from"./bonus-powerups-ingame-games-
|
|
1
|
+
export{B as bonus_powerups_ingame_games}from"./bonus-powerups-ingame-games-971d2e26.js";import{r as e,h as t,H as i,g as n}from"./index-fd928daa.js";const s=class{constructor(t){e(this,t),this.src=void 0,this.width=void 0,this.height=void 0,this.alt=void 0,this.styles=void 0,this.detectDistance="200px",this.imgLoaded=!1,this.shouldLoad=!1}handleSrc(){if(!this.shouldLoad)return;const e=new Image;e.onload=()=>{this.image&&(this.image.src=this.src,this.imgLoaded=!0,e.onload=null)},e.src=this.src}componentDidLoad(){"IntersectionObserver"in window?(this.el.__uxComponent=this,window.EMUxObserver||(window.EMUxObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target.__uxComponent;t&&(t.shouldLoad=!0,t.handleSrc()),window.EMUxObserver.unobserve(e.target)}}))}),{rootMargin:this.detectDistance})),window.EMUxObserver.observe(this.el)):(this.shouldLoad=!0,this.handleSrc())}render(){return t(i,{key:"f506ba73852f257ad80bf59ca177d2065a5f365e",class:"HostContainer"},!this.imgLoaded&&t("ui-skeleton",{key:"564ebfab701f827ddc2debccb7615926dbc9e876",class:"UiContainer",structure:"image",width:"100%",height:"100%"}),t("img",{key:"2188ca4494c10587f064acc5459ffc468948f497",ref:e=>this.image=e,src:this.shouldLoad?this.src:void 0,onLoad:()=>this.imgLoaded=!0,style:this.styles,class:"UiContainer "+(this.imgLoaded?"Visible":"Hidden"),alt:this.alt,width:this.width,height:this.height,loading:"lazy"}))}get el(){return n(this)}static get watchers(){return{src:["handleSrc"]}}};s.style=".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit;object-fit:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;border-radius:var(--emw--border-radius-medium, 10px);transition:opacity 0.5s ease-in-out}";const r=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonLogo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"SkeletonImage "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonTitle "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,i)=>t("div",{key:i,class:"SkeletonText "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonRectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonCircle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(i,{key:"c2a2650acd416962a2bc4e1a7ee18bc6d8e2def8"},t("style",{key:"9bd7fc1f9e9ed9f17735a7b72fce6f09696f5e19"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};r.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{s as ui_image,r as ui_skeleton}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{B as BonusPowerupsIngameGames}from"./bonus-powerups-ingame-games-
|
|
1
|
+
export{B as BonusPowerupsIngameGames}from"./bonus-powerups-ingame-games-971d2e26.js";import"./index-fd928daa.js";
|
package/dist/cjs/{bonus-powerups-ingame-games-7de80a10.js → bonus-powerups-ingame-games-3fb982e8.js}
RENAMED
|
@@ -170,6 +170,7 @@ const BonusPowerupsIngameGamesStyle0 = bonusPowerupsIngameGamesCss;
|
|
|
170
170
|
const BonusPowerupsIngameGames = class {
|
|
171
171
|
constructor(hostRef) {
|
|
172
172
|
index.registerInstance(this, hostRef);
|
|
173
|
+
this.showDetailsEvent = index.createEvent(this, "showPowerupDetails", 7);
|
|
173
174
|
this.backFromPowerupGamesEvent = index.createEvent(this, "backFromPowerupGames", 7);
|
|
174
175
|
this.mbSource = undefined;
|
|
175
176
|
this.clientStyling = undefined;
|
|
@@ -247,6 +248,9 @@ const BonusPowerupsIngameGames = class {
|
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
250
|
}
|
|
251
|
+
onBackToDetail() {
|
|
252
|
+
this.backFromPowerupGamesEvent.emit();
|
|
253
|
+
}
|
|
250
254
|
onGameClick(game) {
|
|
251
255
|
window.postMessage({ type: 'EngagementSuiteGameRedirect', data: { Slug: game.slug } });
|
|
252
256
|
}
|
|
@@ -257,9 +261,9 @@ const BonusPowerupsIngameGames = class {
|
|
|
257
261
|
}
|
|
258
262
|
render() {
|
|
259
263
|
var _a, _b;
|
|
260
|
-
return index.h("div", { key: '
|
|
261
|
-
index.h("div", { key: '
|
|
262
|
-
index.h("div", { key: '
|
|
264
|
+
return index.h("div", { key: '1e7ce5bf041634d441eacdf8eb66dd8b2b050c24', class: 'IngamePowerUpGamesContainer', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '0945e1b3a335c68b723a51cd8a0ad8776ef2566b', class: 'TopBar' }, index.h("div", { key: 'fe25ac85c3204a91530b3129cc948ef5ddb3567f', class: 'ReturnIcon CircleLinearBorder', onClick: () => this.onBackToDetail(), innerHTML: ReturnSvg }), this.powerUp &&
|
|
265
|
+
index.h("div", { key: '282b061c77186eca064917c823cdb8dc4b1b00db', class: 'Title TextContent' }, index.h("span", { key: '330bee8694baf45f1fc7d43b31f899e16f352609', class: 'Name' }, this.powerUp.displayName), " /", index.h("div", { key: '24abf921e35c4fb074bf04cda8f0985340ce0813', class: 'Label' }, translate('games', this.language)), index.h("div", { key: 'bf26cd444bdcf1ccd032f276e5718d523d4ca4cd', class: 'GamesTotal' }, "( ", this.powerUpGames.total || '', " )"))), index.h("div", { key: '6a5517ea39f7dd6771ad9ce889cc61250660037a', class: 'GamesWrapper Card ' }, this.isLoadingGames && this.powerUpGames.items.length === 0 &&
|
|
266
|
+
index.h("div", { key: '1f2df724a9b872aeccc42a3f464506d7402b8fd1', class: 'Loading' }, index.h("div", { key: '50d4d313bfd33643f6fc2463e32288e851caf065', class: 'smart-loader' }, index.h("div", { key: 'b04440dc330e503c755198105f45350fd5a9af6e', class: "smart-item" }), index.h("div", { key: 'b90f8f22ce2b95c0746e06c4976887dd27c08f53', class: "smart-item" }), index.h("div", { key: 'af5d51749f9c4b95c1f4df414da7b16e10f36fe3', class: "smart-item" }))), !this.isLoadingGames && !this.powerUp ?
|
|
263
267
|
index.h("div", { class: 'NoData' }, translate('noDataFound', this.language), " ")
|
|
264
268
|
:
|
|
265
269
|
index.h("div", { class: 'CircleInner GamesList' }, index.h("div", { class: 'Games FlexRow' }, this.powerUpGames.total > 0 &&
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const bonusPowerupsIngameGames = require('./bonus-powerups-ingame-games-
|
|
5
|
+
const bonusPowerupsIngameGames = require('./bonus-powerups-ingame-games-3fb982e8.js');
|
|
6
6
|
const index = require('./index-e3184c85.js');
|
|
7
7
|
|
|
8
8
|
const uiImageCss = ".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit;object-fit:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;border-radius:var(--emw--border-radius-medium, 10px);transition:opacity 0.5s ease-in-out}";
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const bonusPowerupsIngameGames = require('./bonus-powerups-ingame-games-
|
|
5
|
+
const bonusPowerupsIngameGames = require('./bonus-powerups-ingame-games-3fb982e8.js');
|
|
6
6
|
require('./index-e3184c85.js');
|
|
7
7
|
|
|
8
8
|
|
package/dist/collection/components/bonus-powerups-ingame-games/bonus-powerups-ingame-games.js
CHANGED
|
@@ -82,6 +82,9 @@ export class BonusPowerupsIngameGames {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
onBackToDetail() {
|
|
86
|
+
this.backFromPowerupGamesEvent.emit();
|
|
87
|
+
}
|
|
85
88
|
onGameClick(game) {
|
|
86
89
|
window.postMessage({ type: 'EngagementSuiteGameRedirect', data: { Slug: game.slug } });
|
|
87
90
|
}
|
|
@@ -92,9 +95,9 @@ export class BonusPowerupsIngameGames {
|
|
|
92
95
|
}
|
|
93
96
|
render() {
|
|
94
97
|
var _a, _b;
|
|
95
|
-
return h("div", { key: '
|
|
96
|
-
h("div", { key: '
|
|
97
|
-
h("div", { key: '
|
|
98
|
+
return h("div", { key: '1e7ce5bf041634d441eacdf8eb66dd8b2b050c24', class: 'IngamePowerUpGamesContainer', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '0945e1b3a335c68b723a51cd8a0ad8776ef2566b', class: 'TopBar' }, h("div", { key: 'fe25ac85c3204a91530b3129cc948ef5ddb3567f', class: 'ReturnIcon CircleLinearBorder', onClick: () => this.onBackToDetail(), innerHTML: ReturnSvg }), this.powerUp &&
|
|
99
|
+
h("div", { key: '282b061c77186eca064917c823cdb8dc4b1b00db', class: 'Title TextContent' }, h("span", { key: '330bee8694baf45f1fc7d43b31f899e16f352609', class: 'Name' }, this.powerUp.displayName), " /", h("div", { key: '24abf921e35c4fb074bf04cda8f0985340ce0813', class: 'Label' }, translate('games', this.language)), h("div", { key: 'bf26cd444bdcf1ccd032f276e5718d523d4ca4cd', class: 'GamesTotal' }, "( ", this.powerUpGames.total || '', " )"))), h("div", { key: '6a5517ea39f7dd6771ad9ce889cc61250660037a', class: 'GamesWrapper Card ' }, this.isLoadingGames && this.powerUpGames.items.length === 0 &&
|
|
100
|
+
h("div", { key: '1f2df724a9b872aeccc42a3f464506d7402b8fd1', class: 'Loading' }, h("div", { key: '50d4d313bfd33643f6fc2463e32288e851caf065', class: 'smart-loader' }, h("div", { key: 'b04440dc330e503c755198105f45350fd5a9af6e', class: "smart-item" }), h("div", { key: 'b90f8f22ce2b95c0746e06c4976887dd27c08f53', class: "smart-item" }), h("div", { key: 'af5d51749f9c4b95c1f4df414da7b16e10f36fe3', class: "smart-item" }))), !this.isLoadingGames && !this.powerUp ?
|
|
98
101
|
h("div", { class: 'NoData' }, translate('noDataFound', this.language), " ")
|
|
99
102
|
:
|
|
100
103
|
h("div", { class: 'CircleInner GamesList' }, h("div", { class: 'Games FlexRow' }, this.powerUpGames.total > 0 &&
|
|
@@ -304,6 +307,21 @@ export class BonusPowerupsIngameGames {
|
|
|
304
307
|
}
|
|
305
308
|
static get events() {
|
|
306
309
|
return [{
|
|
310
|
+
"method": "showDetailsEvent",
|
|
311
|
+
"name": "showPowerupDetails",
|
|
312
|
+
"bubbles": true,
|
|
313
|
+
"cancelable": true,
|
|
314
|
+
"composed": true,
|
|
315
|
+
"docs": {
|
|
316
|
+
"tags": [],
|
|
317
|
+
"text": ""
|
|
318
|
+
},
|
|
319
|
+
"complexType": {
|
|
320
|
+
"original": "any",
|
|
321
|
+
"resolved": "any",
|
|
322
|
+
"references": {}
|
|
323
|
+
}
|
|
324
|
+
}, {
|
|
307
325
|
"method": "backFromPowerupGamesEvent",
|
|
308
326
|
"name": "backFromPowerupGames",
|
|
309
327
|
"bubbles": true,
|
package/dist/esm/{bonus-powerups-ingame-games-b2c0935f.js → bonus-powerups-ingame-games-971d2e26.js}
RENAMED
|
@@ -168,6 +168,7 @@ const BonusPowerupsIngameGamesStyle0 = bonusPowerupsIngameGamesCss;
|
|
|
168
168
|
const BonusPowerupsIngameGames = class {
|
|
169
169
|
constructor(hostRef) {
|
|
170
170
|
registerInstance(this, hostRef);
|
|
171
|
+
this.showDetailsEvent = createEvent(this, "showPowerupDetails", 7);
|
|
171
172
|
this.backFromPowerupGamesEvent = createEvent(this, "backFromPowerupGames", 7);
|
|
172
173
|
this.mbSource = undefined;
|
|
173
174
|
this.clientStyling = undefined;
|
|
@@ -245,6 +246,9 @@ const BonusPowerupsIngameGames = class {
|
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
}
|
|
249
|
+
onBackToDetail() {
|
|
250
|
+
this.backFromPowerupGamesEvent.emit();
|
|
251
|
+
}
|
|
248
252
|
onGameClick(game) {
|
|
249
253
|
window.postMessage({ type: 'EngagementSuiteGameRedirect', data: { Slug: game.slug } });
|
|
250
254
|
}
|
|
@@ -255,9 +259,9 @@ const BonusPowerupsIngameGames = class {
|
|
|
255
259
|
}
|
|
256
260
|
render() {
|
|
257
261
|
var _a, _b;
|
|
258
|
-
return h("div", { key: '
|
|
259
|
-
h("div", { key: '
|
|
260
|
-
h("div", { key: '
|
|
262
|
+
return h("div", { key: '1e7ce5bf041634d441eacdf8eb66dd8b2b050c24', class: 'IngamePowerUpGamesContainer', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '0945e1b3a335c68b723a51cd8a0ad8776ef2566b', class: 'TopBar' }, h("div", { key: 'fe25ac85c3204a91530b3129cc948ef5ddb3567f', class: 'ReturnIcon CircleLinearBorder', onClick: () => this.onBackToDetail(), innerHTML: ReturnSvg }), this.powerUp &&
|
|
263
|
+
h("div", { key: '282b061c77186eca064917c823cdb8dc4b1b00db', class: 'Title TextContent' }, h("span", { key: '330bee8694baf45f1fc7d43b31f899e16f352609', class: 'Name' }, this.powerUp.displayName), " /", h("div", { key: '24abf921e35c4fb074bf04cda8f0985340ce0813', class: 'Label' }, translate('games', this.language)), h("div", { key: 'bf26cd444bdcf1ccd032f276e5718d523d4ca4cd', class: 'GamesTotal' }, "( ", this.powerUpGames.total || '', " )"))), h("div", { key: '6a5517ea39f7dd6771ad9ce889cc61250660037a', class: 'GamesWrapper Card ' }, this.isLoadingGames && this.powerUpGames.items.length === 0 &&
|
|
264
|
+
h("div", { key: '1f2df724a9b872aeccc42a3f464506d7402b8fd1', class: 'Loading' }, h("div", { key: '50d4d313bfd33643f6fc2463e32288e851caf065', class: 'smart-loader' }, h("div", { key: 'b04440dc330e503c755198105f45350fd5a9af6e', class: "smart-item" }), h("div", { key: 'b90f8f22ce2b95c0746e06c4976887dd27c08f53', class: "smart-item" }), h("div", { key: 'af5d51749f9c4b95c1f4df414da7b16e10f36fe3', class: "smart-item" }))), !this.isLoadingGames && !this.powerUp ?
|
|
261
265
|
h("div", { class: 'NoData' }, translate('noDataFound', this.language), " ")
|
|
262
266
|
:
|
|
263
267
|
h("div", { class: 'CircleInner GamesList' }, h("div", { class: 'Games FlexRow' }, this.powerUpGames.total > 0 &&
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { B as bonus_powerups_ingame_games } from './bonus-powerups-ingame-games-
|
|
1
|
+
export { B as bonus_powerups_ingame_games } from './bonus-powerups-ingame-games-971d2e26.js';
|
|
2
2
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-fd928daa.js';
|
|
3
3
|
|
|
4
4
|
const uiImageCss = ".HostContainer{display:block}.UiContainer{height:100%;width:100%;border-radius:inherit;object-fit:inherit}.UiContainer .Image{border-radius:inherit}.Hidden{opacity:0;transition:opacity 0.5s ease-in-out}.Visible{opacity:1;border-radius:var(--emw--border-radius-medium, 10px);transition:opacity 0.5s ease-in-out}";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BonusPowerupsIngameGames } from './bonus-powerups-ingame-games-
|
|
1
|
+
export { B as BonusPowerupsIngameGames } from './bonus-powerups-ingame-games-971d2e26.js';
|
|
2
2
|
import './index-fd928daa.js';
|
|
@@ -19,9 +19,11 @@ export declare class BonusPowerupsIngameGames {
|
|
|
19
19
|
powerUpGames: PowerUpGames;
|
|
20
20
|
powerUp: PowerUp;
|
|
21
21
|
limit: number;
|
|
22
|
+
showDetailsEvent: EventEmitter;
|
|
22
23
|
backFromPowerupGamesEvent: EventEmitter;
|
|
23
24
|
private initializeGamesObserver;
|
|
24
25
|
private loadMoreGames;
|
|
26
|
+
private onBackToDetail;
|
|
25
27
|
private onGameClick;
|
|
26
28
|
componentDidUpdate(): void;
|
|
27
29
|
render(): any;
|
|
@@ -23,6 +23,7 @@ export interface BonusPowerupsIngameGamesCustomEvent<T> extends CustomEvent<T> {
|
|
|
23
23
|
}
|
|
24
24
|
declare global {
|
|
25
25
|
interface HTMLBonusPowerupsIngameGamesElementEventMap {
|
|
26
|
+
"showPowerupDetails": any;
|
|
26
27
|
"backFromPowerupGames": any;
|
|
27
28
|
}
|
|
28
29
|
interface HTMLBonusPowerupsIngameGamesElement extends Components.BonusPowerupsIngameGames, HTMLStencilElement {
|
|
@@ -51,6 +52,7 @@ declare namespace LocalJSX {
|
|
|
51
52
|
"language"?: string;
|
|
52
53
|
"mbSource"?: string;
|
|
53
54
|
"onBackFromPowerupGames"?: (event: BonusPowerupsIngameGamesCustomEvent<any>) => void;
|
|
55
|
+
"onShowPowerupDetails"?: (event: BonusPowerupsIngameGamesCustomEvent<any>) => void;
|
|
54
56
|
"powerupId": string;
|
|
55
57
|
"session": string;
|
|
56
58
|
"translationUrl"?: string;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as a,h as t}from"./index-fd928daa.js";const i="__WIDGET_GLOBAL_STYLE_CACHE__";function n(e,a){if(e){const t=document.createElement("style");t.innerHTML=a,e.appendChild(t)}}function r(e,a){if(!e||!a)return;const t=new URL(a);fetch(t.href).then((e=>e.text())).then((a=>{const t=document.createElement("style");t.innerHTML=a,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}function o(e,a,t,n=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!n)return t=function(e,a){const t=document.createElement("style");return window.emMessageBus.subscribe(a,(a=>{e&&(t.innerHTML=a,e.appendChild(t))}))}(e,a),t;window[i]||(window[i]={}),t=function(e,a){return window.emMessageBus.subscribe(a,(t=>{if(!e)return;const n=e.getRootNode(),r=window[i];let o=r[a]&&r[a].sheet;o?r[a].refCount=r[a].refCount+1:(o=new CSSStyleSheet,o.replaceSync(t),r[a]={sheet:o,refCount:1});const s=n.adoptedStyleSheets||[];s.includes(o)||(n.adoptedStyleSheets=[...s,o])}))}(e,a);const r=t.unsubscribe.bind(t);return t.unsubscribe=()=>{if(window[i][a]){const e=window[i][a];e.refCount>1?e.refCount=e.refCount-1:delete window[i][a]}r()},t}const s={expand:"games",fields:"id,powerUpID,powerUpName,displayName,games(id,gameId,slug,name,thumbnail)"},l={en:{playNow:"Play Now",games:"Games",noDataFound:"No data found",loading:"Loading",loadingMore:"Loading More"}},d=(e,a,t)=>{let i=l[void 0!==a&&a in l?a:"en"][e];if(void 0!==t)for(const[e,a]of Object.entries(t.values)){const t=new RegExp(`{${e}}`,"g");i=i.replace(t,a)}return i},m=class{constructor(t){e(this,t),this.backFromPowerupGamesEvent=a(this,"backFromPowerupGames",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl=void 0,this.language="en",this.endpoint=void 0,this.session=void 0,this.powerupId=void 0,this.isLoadingGames=!1,this.powerUpGames={items:[],total:0},this.powerUp=void 0,this.limit=30}initializeGamesObserver(){this.loadMoreGamesObserver&&this.loadMoreGamesObserver.disconnect(),this.loadMoreGamesObserver=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&this.loadMoreGames().catch(console.error)}))})),this.lastGameElement&&this.loadMoreGamesObserver.observe(this.lastGameElement)}async loadMoreGames(){var e,a,t,i;if(!(this.isLoadingGames||this.powerUpGames.total>0&&this.powerUpGames.items.length>=this.powerUpGames.total)){this.isLoadingGames=!0,this.abortController&&this.abortController.abort(),this.abortController=new AbortController;try{const n=new URL(`${this.endpoint}/v1/elevate/powerups/available?pagination=games(limit=${this.limit},offset=${(null===(a=null===(e=this.powerUpGames)||void 0===e?void 0:e.items)||void 0===a?void 0:a.length)||0})`),r={headers:{"Content-Type":"application/json","x-SessionId":this.session},method:"GET",signal:this.abortController.signal};n.searchParams.append("filter",`id=${this.powerupId}`),Object.entries(s).forEach((([e,a])=>{n.searchParams.append(e,a)})),n.searchParams.append("language",this.language);const o=await fetch(n,r);if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const l=await o.json();this.powerUp=l.data[0];const d=(null===(t=this.powerUp.games)||void 0===t?void 0:t.items)||[];this.powerUpGames={items:[...this.powerUpGames.items,...d],total:(null===(i=this.powerUp.games)||void 0===i?void 0:i.total)||this.powerUpGames.total}}catch(e){"AbortError"!==e.name&&console.error("Failed to load more games:",e)}finally{this.abortController.signal.aborted||(this.isLoadingGames=!1)}}}onGameClick(e){window.postMessage({type:"EngagementSuiteGameRedirect",data:{Slug:e.slug}})}componentDidUpdate(){this.powerUpGames.items.length<this.powerUpGames.total&&this.initializeGamesObserver()}render(){var e,a;return t("div",{key:"0d034307e070a8ba1d88303c3e3093ba567444b2",class:"IngamePowerUpGamesContainer",ref:e=>this.stylingContainer=e},t("div",{key:"7b01f05d91d274da4ae0de3fc63e55927946b095",class:"TopBar"},t("div",{key:"f8664bf99bb12513f281fe67ee24cd0794d9ba66",class:"ReturnIcon CircleLinearBorder",onClick:this.backFromPowerupGamesEvent.emit,innerHTML:'<svg width="14" height="14" viewBox="0 0 14 14"\n fill="none" xmlns="http://www.w3.org/2000/svg">\n <g clip-path="url(#clip0_4119_5439)">\n <path d="M11.1533 12.8332C11.8242 11.9932 12.25 10.9315 12.25 9.759C12.25 6.959 9.7475 4.6665 6.69667 4.6665H1.75"\n stroke="currentColor" stroke-width="0.952264" stroke-miterlimit="10" stroke-linecap="round"\n stroke-linejoin="round" />\n <path d="M5.25 1.16699L1.75 4.66699L5.25 8.16699" stroke="currentColor" stroke-width="0.952264" stroke-miterlimit="10"\n stroke-linecap="round" stroke-linejoin="round" />\n </g>\n <defs>\n <clipPath id="clip0_4119_5439">\n <rect width="14" height="14" fill="white" />\n </clipPath>\n </defs>\n</svg>\n'}),this.powerUp&&t("div",{key:"56083e9dfbc469875b0448f471c455ef8e1fb613",class:"Title TextContent"},t("span",{key:"6cde7a32b98c4f8d240cfda6f715e2d3fd4b0a25",class:"Name"},this.powerUp.displayName)," /",t("div",{key:"a2045a41ad40665fa553b7f1e2a25628344188fc",class:"Label"},d("games",this.language)),t("div",{key:"a2cc2c8a5ebb29b097da802984099860410e0c25",class:"GamesTotal"},"( ",this.powerUpGames.total||""," )"))),t("div",{key:"b335d598aeea740b4e4a2e58a4061bf092abb773",class:"GamesWrapper Card "},this.isLoadingGames&&0===this.powerUpGames.items.length&&t("div",{key:"fced976e5554f7864fcf8755494c0cfd74f19a0f",class:"Loading"},t("div",{key:"8653c05c761078e11d6c060e5f1d519a133f2d8a",class:"smart-loader"},t("div",{key:"4404881893636a48de508d95ab8d6bd09d05acae",class:"smart-item"}),t("div",{key:"8aeafd883609d5840f7603b58300ee9c9350746c",class:"smart-item"}),t("div",{key:"ded309b5a38d7775c27b3b38dd78746caf5aa557",class:"smart-item"}))),this.isLoadingGames||this.powerUp?t("div",{class:"CircleInner GamesList"},t("div",{class:"Games FlexRow"},this.powerUpGames.total>0&&this.powerUpGames.items.map(((e,a)=>t("div",{class:"Game",ref:a===this.powerUpGames.items.length-1?e=>this.lastGameElement=e:null},t("ui-image",{src:e.thumbnail,alt:e.name}),t("div",{class:"GameMask",onClick:this.onGameClick.bind(this,e)},t("div",{class:"GameStartBtn"},t("div",{class:"PlayIcon"}),t("span",null,d("playNow",this.language))))))),this.isLoadingGames&&(null===(a=null===(e=this.powerUpGames)||void 0===e?void 0:e.items)||void 0===a?void 0:a.length)>this.limit&&t("p",{class:"LoadingMore"},d("loadingMore",this.language)))):t("div",{class:"NoData"},d("noDataFound",this.language)," ")))}handleClientStylingChange(e,a){e!=a&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(e,a){e!=a&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(e,a){e!=a&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.loadMoreGames()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&o(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.abortController&&this.abortController.abort(),this.loadMoreGamesObserver&&this.loadMoreGamesObserver.disconnect()}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};m.style=':host{display:block;height:100%;--game-amount-line:3}.IngamePowerUpGamesContainer{height:100%;display:flex;padding:var(--emw--ingame-power-container-padding, 8px);justify-content:flex-start;flex-direction:column}.IngamePowerUpGamesContainer .CircleLinearBorder{background:rgba(9, 9, 9, 0.5019607843);position:relative;width:26px;height:26px;border-radius:20px;background:none;overflow:hidden;border:1.5px solid transparent;display:flex;align-items:center;justify-content:center;cursor:pointer}.IngamePowerUpGamesContainer .CircleLinearBorder svg{border-radius:20px;padding:4.5px;background:var(--emw--ingame-color-powerup-bg, rgba(9, 9, 9, 0.8980392157));z-index:1}.IngamePowerUpGamesContainer .CircleLinearBorder::before{content:"";position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;z-index:-1;border-radius:21.5px;background:linear-gradient(0deg, var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.0666666667)), var(--emw--ingame-color-white10, rgba(255, 255, 255, 0.0666666667))), linear-gradient(35.22deg, var(--emw--ingame-color-white10, rgba(255, 255, 255, 0)), var(--emw--ingame-color-white30, rgba(255, 255, 255, 0.5490196078)) 89.19%)}.IngamePowerUpGamesContainer .TopBar,.IngamePowerUpGamesContainer .Loading{padding:15px}.IngamePowerUpGamesContainer .TopBar{display:flex;align-items:center;gap:5px}.IngamePowerUpGamesContainer .TopBar .ReturnIcon{width:26px;height:26px;display:flex;border-radius:20px;padding:0;backdrop-filter:blur(13.7647px);justify-content:center;align-items:center}.IngamePowerUpGamesContainer .TopBar .ReturnIcon svg{color:var(--emw--ingame-color-white60, #f0f0f0)}.IngamePowerUpGamesContainer .TopBar .Title{font-weight:600;font-size:0.9rem;line-height:100%;text-align:center;vertical-align:middle;color:var(--emw--ingame-color-neutural-95, #EDEFF2);display:flex;flex-direction:row}.IngamePowerUpGamesContainer .TopBar .Title .Name{font-size:1.1rem}.IngamePowerUpGamesContainer .TopBar .Title .Label{font-size:1.1rem;font-weight:bold;color:var(--emw--ingame-color-neutural-95, #EDEFF2)}.IngamePowerUpGamesContainer .TopBar .TextContent{font-weight:400;font-size:0.9rem;line-height:1.1rem;vertical-align:middle;color:var(--emw--ingame-color-white70, rgba(255, 255, 255, 0.6980392157))}.IngamePowerUpGamesContainer .GamesWrapper{height:calc(100% - 90px);overflow:hidden;width:100%;margin-bottom:10px;scrollbar-width:thin;scrollbar-color:var(--emw--color-background, hsl(254, 8.53%, 54.93%)) transparent}.IngamePowerUpGamesContainer .Games{overflow:auto;scrollbar-width:thin;scrollbar-color:var(--emw--color-background, hsl(254, 8.53%, 54.93%)) transparent}.IngamePowerUpGamesContainer .GamesList{display:flex;height:100%;justify-content:center;flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--emw--background-gray-color, gray) transparent}.IngamePowerUpGamesContainer .GamesList::-webkit-scrollbar-track{background-color:transparent;border-radius:5px}.IngamePowerUpGamesContainer .GamesList .Games{padding:15px;display:flex;align-items:flex-start;justify-content:flex-start;flex-wrap:wrap;gap:calc(30px / (var(--game-amount-line, 3) - 1))}.IngamePowerUpGamesContainer .GamesList .Games .Game{width:calc((100% - 30px) / var(--game-amount-line, 3));cursor:pointer;position:relative}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .mask-filter{opacity:1}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover img{opacity:0.4;filter:blur(1.5px)}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .GameMask{mix-blend-mode:screen;background-color:var(--emw--color-powup-green, #24B24E);display:flex;justify-content:center;align-items:center;position:absolute;width:100%;opacity:1;left:0;height:100%;top:0;border-radius:8px}.IngamePowerUpGamesContainer .GamesList .Games .Game:hover .GameMask .GameStartBtn{opacity:1}.IngamePowerUpGamesContainer .GameMask{display:none;transition:display;transition-duration:0.2s;opacity:0;position:absolute;width:70%;height:100%}.IngamePowerUpGamesContainer .GameMask .GameStartBtn{width:80px;height:22px;border-radius:8px;opacity:1;padding:4px 5px;background:linear-gradient(180deg, var(--emw--color-powup-green, #24B24E) 0%, var(--emw--color-powup-light-green, #18CE51) 100%);border:1px solid var(--emw--ingame-color-white, #FFFFFF);display:flex;align-items:center;justify-content:space-between;cursor:pointer}.IngamePowerUpGamesContainer .GameMask .GameStartBtn .PlayIcon{background-image:url(\'data:image/svg+xml;charset=utf8,<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 1C3.01472 1 1 3.01472 1 5.5C1 7.98528 3.01472 10 5.5 10C7.98528 10 10 7.98528 10 5.5C10 3.01472 7.98528 1 5.5 1ZM0 5.5C0 2.46243 2.46243 0 5.5 0C8.53757 0 11 2.46243 11 5.5C11 8.53757 8.53757 11 5.5 11C2.46243 11 0 8.53757 0 5.5ZM5.12255 3.21652C5.12728 3.21956 5.13199 3.22259 5.13668 3.22561L7.49698 4.74294C7.50129 4.74571 7.50562 4.74849 7.50998 4.75129C7.58551 4.79982 7.66805 4.85285 7.73381 4.90413C7.80355 4.95852 7.91363 5.05446 7.97854 5.20809C8.0574 5.39471 8.0574 5.60529 7.97854 5.79191C7.91363 5.94554 7.80355 6.04148 7.73381 6.09587C7.66805 6.14715 7.58551 6.20018 7.50998 6.24871C7.50562 6.25151 7.50129 6.25429 7.49698 6.25706L5.13668 7.77439C5.13199 7.77741 5.12727 7.78045 5.12255 7.78348C5.03469 7.84 4.9423 7.89941 4.86094 7.94176C4.77909 7.98436 4.63056 8.05332 4.44657 8.04018C4.22957 8.02468 4.02999 7.91572 3.89961 7.74157C3.78907 7.59391 3.76675 7.43167 3.75832 7.33979C3.74995 7.24844 3.74997 7.1386 3.75 7.03414C3.75 7.02852 3.75 7.02292 3.75 7.01733V3.98267C3.75 3.97708 3.75 3.97148 3.75 3.96586C3.74997 3.8614 3.74995 3.75156 3.75832 3.66021C3.76675 3.56833 3.78907 3.40609 3.89961 3.25843C4.02999 3.08428 4.22957 2.97532 4.44657 2.95982C4.63056 2.94668 4.77909 3.01564 4.86094 3.05824C4.94231 3.10059 5.03469 3.16001 5.12255 3.21652ZM4.75 4.16583V6.83417L6.82537 5.5L4.75 4.16583Z" fill="white"/> <path d="M4.75 6.83417V4.16583L6.82537 5.5L4.75 6.83417Z" fill="white"/></svg>\');height:16px;width:16px;background-repeat:no-repeat;background-size:contain}.Games .Container{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;height:calc(100% - 120px);overflow:auto}.Games .Container .Game{width:105px}@keyframes smart-animate1{0%{opacity:0.15;transform:translateX(0px)}35%{opacity:1;transform:translateX(36px)}75%{opacity:1;transform:translateX(0px)}100%{opacity:0.15;transform:translateX(0px)}}@keyframes smart-animate2{0%{opacity:1}35%{opacity:0.15}75%{opacity:0.5}100%{opacity:1}}@keyframes smart-animate3{0%{opacity:0.5;transform:translateX(0px)}35%{opacity:0.15;transform:translateX(-36px)}75%{opacity:0.15;transform:translateX(0px)}100%{opacity:0.5;transform:translateX(0px)}}.smart-loader{margin:50px auto;display:flex;flex-direction:row;align-items:center;justify-content:center;width:100px;gap:10px}.smart-loader .smart-item{width:3px;height:20px;opacity:0.15;animation-delay:200ms;animation-duration:1000ms;animation-timing-function:ease-out;animation-fill-mode:forwards;padding:1px;margin:5px 0;background:var(--emw--ingame-color-powerup-brightgreen, #00FA5A);border-radius:4px;animation-iteration-count:infinite;animation-direction:normal}.smart-loader .smart-item:nth-child(1){animation-name:smart-animate1}.smart-loader .smart-item:nth-child(2){animation-name:smart-animate2;height:36px}.smart-loader .smart-item:nth-child(3){animation-name:smart-animate3}';export{m as B}
|