@everymatrix/casino-engagement-suite-modal-container 1.37.2 → 1.37.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.
@@ -1 +1 @@
1
- import{p as n,b as e}from"./p-2bf8a399.js";(()=>{const e=import.meta.url,l={};return""!==e&&(l.resourcesUrl=new URL(".",e).href),n(l)})().then((n=>e([["p-65ea6e41",[[1,"casino-engagement-suite-modal-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],device:[1],limitStylingAppends:[32],openModals:[32],rewardMessage:[32],hasError:[32],confirmationData:[32],winAmount:[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]],n)));
1
+ import{p as n,b as i}from"./p-b944b831.js";(()=>{const i=import.meta.url,e={};return""!==i&&(e.resourcesUrl=new URL(".",i).href),n(e)})().then((n=>i([["p-3cfb21d1",[[1,"casino-engagement-suite-modal-container",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],language:[1],isJoiningToChallenge:[1028,"is-joining-to-challenge"],device:[1],limitStylingAppends:[32],openModals:[32],rewardMessage:[32],hasError:[32],confirmationData:[32],winAmount:[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{clientStyling:[513,"client-styling"],clientStylingUrl:[513,"client-styling-url"],isOpen:[4,"is-open"],isLoading:[1028,"is-loading"],header:[1],contentIcon:[1,"content-icon"],modalType:[1,"modal-type"],device:[1],showAnimation:[4,"show-animation"],limitStylingAppends:[32]}]]]],n)));
@@ -0,0 +1 @@
1
+ import{r as t,c as o,h as e,g as i}from"./p-b944b831.js";const n=class{constructor(e){t(this,e),this.closeModal=o(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.device="Mobile",this.showAnimation=!1,this.limitStylingAppends=!1,this.handleCloseClick=()=>{this.isLoading||this.closeModal.emit(this.modalType)},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),o=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{o.innerHTML=t,setTimeout((()=>{this.host.prepend(o)}),1)})).catch((t=>{console.log("Error ",t)}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){return e("div",{class:`ModalOverlay ${this.isOpen&&"Open"} ${this.device} ${this.showAnimation&&"ShowAnimation"}`},e("div",{class:"ModalWinAnimation"}),e("div",{class:"ModalContent GradientBorder"},e("div",{class:"IconCloseContainer"},e("button",{class:"IconCloseButton",onClick:this.handleCloseClick},e("img",{src:"https://static.everymatrix.com/gic/img/engagement-suite/close.svg",alt:"Сlose modal"}))),this.contentIcon?e("div",{class:"ModalIcon",style:{background:`url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`}}):null,e("div",{class:"ModalHeader"},e("h1",null,this.header)),e("div",{class:"ModalBody"},e("slot",{name:"body"})),e("div",{class:"ModalFooter"},e("slot",{name:"footer"}))))}get host(){return i(this)}};n.style=':host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:"Montserrat", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:"";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:"Inter", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}';const a=["en"],s={en:{joinHeader:"Choose another challenge?",desc:"Any progress on the current challenge will be kept and you can rejoin the challenge at any time.",joinQuestion:"Would you still like to join another challenge?",joinConfirm:"Yes, join another challenge",joinReject:"No, stay at the current challenge",unJoinHeader:"Quit Challenge?",unJoinQuestion:"Would you still like to quit the challenge?",unJoinConfirm:"Yes, I want to quit challenge",unJoinReject:"No, stay at challenge",join:"Unjoin",unJoin:"Unjoin",continue:"Continue",okContinue:"Ok, continue",won:"You won",supportInfo:"However, some rewards cannot be issued. Please, contact support.",noReward:"Reward cannot be issued",contactSupport:"Please contact support",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward",jackpotWin:"Total Jackpot Win!"}},r=(t,o)=>{const e=o;return s[void 0!==e&&a.includes(e)?e:"en"][t]},l=class{constructor(e){t(this,e),this.closeModal=o(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.limitStylingAppends=!1,this.openModals=[],this.rewardMessage="",this.hasError=!1,this.confirmationData=null,this.winAmount={amount:0,currency:""},this.handleCloseClick=t=>{const o=t.currentTarget.getAttribute("data-type");this.closeModal.emit(o)},this.handleChallengeAttendance=()=>{window.postMessage({type:"ChallengeJoinRequest",data:this.confirmationData})},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),o=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{o.innerHTML=t,setTimeout((()=>{this.host.prepend(o)}),1)})).catch((t=>{console.log("Error ",t)}))},this.isModalOpen=t=>Boolean(this.openModals.find((o=>o===t)))}openModalHandler(t){const{modalType:o,rewardMessage:e,hasError:i,confirmationData:n,winAmount:a}=t.detail;a&&(this.winAmount=this.isModalOpen("JACKPOT_REWARD_MODAL")?{amount:this.winAmount.amount+a.amount,currency:a.currency}:a),this.openModals=[...this.openModals,o],this.rewardMessage=e,this.hasError=i,n&&(this.confirmationData=n)}closeModalHandler(t){this.openModals=this.openModals.filter((o=>o!==t.detail))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const{ProgressToActivate:t}=this.confirmationData||{};return e("div",{class:`ModalContainer ${this.device}`},e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg",modalType:"REWARD_MODAL","show-animation":!0,device:this.device},e("div",{slot:"body"},e("p",null,r("won",this.language)," ",e("span",{class:"ModalReward"},this.rewardMessage)),this.hasError&&e("p",{class:"SupportInfo"},r("supportInfo",this.language))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"REWARD_MODAL"},r("continue",this.language)))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("JACKPOT_REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg","show-animation":!0,modalType:"JACKPOT_REWARD_MODAL",device:this.device},e("div",{slot:"body"},e("div",{class:"JackpotWinText"},r("jackpotWin",this.language)),e("div",{class:"JackpotWinAmount"},(o=this.winAmount.amount,`${this.winAmount.currency} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(o)}`))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"JACKPOT_REWARD_MODAL"},r("continue",this.language)))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("TARGET_MODAL"),header:r(t?"joinHeader":"unJoinHeader",this.language),modalType:"TARGET_MODAL",device:this.device,isLoading:this.isJoiningToChallenge},e("div",{slot:"body"},e("p",{class:"LeftAlign"},r("desc",this.language)),e("p",{class:"LeftAlign"},r(t?"joinQuestion":"unJoinQuestion",this.language))),e("div",{slot:"footer",class:"ManyActions"},e("button",{class:"ModalFooterButton "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleChallengeAttendance},r(t?"joinConfirm":"unJoinConfirm",this.language)),e("button",{class:"ModalFooterButtonOutlined "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleCloseClick,"data-type":"TARGET_MODAL"},e("div",{class:"GradientText"},r(t?"joinReject":"unJoinReject",this.language))))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("SUPPORT_MODAL"),header:r("noReward",this.language),contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/alert.svg",modalType:"SUPPORT_MODAL",device:this.device},e("div",{slot:"body"},e("span",null,r("contactSupport",this.language))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"SUPPORT_MODAL"},r("okContinue",this.language)))));var o}get host(){return i(this)}};l.style=':host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:"Montserrat", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}';export{n as casino_engagement_suite_modal,l as casino_engagement_suite_modal_container}
@@ -0,0 +1 @@
1
+ let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={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)},i=e=>Promise.resolve(e),c=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),r=(e,t,n)=>{n&&n.map((([n,l,s])=>{const i=a(e,n),c=u(t,s),r=f(n);o.ael(i,l,c,r),(t.o=t.o||[]).push((()=>o.rel(i,l,c,r)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},a=(e,t)=>16&t?s.body:e,f=e=>0!=(2&e),d=new WeakMap,h=e=>"sc-"+e.h,$={},m=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!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&&o?i[i.length-1].$+=l:i.push(s?p(null,l):l),o=s)};if(c(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const r=p(e,null);return r.m=t,i.length>0&&(r.p=i),r},p=(e,t)=>({t:0,g:e,$:t,S:null,p:null,m:null}),b={},w=(e,t,n,s,i,c)=>{if(n!==s){let r=I(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("style"===t){for(const t in n)s&&null!=s[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in s)n&&s[t]===n[t]||(t.includes("-")?e.style.setProperty(t,s[t]):e.style[t]=s[t])}else if(r||"o"!==t[0]||"n"!==t[1]){const l=m(s);if((r||l&&null!==s)&&!i)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?r=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&c||i)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},g=/\s/,S=e=>e?e.split(g):[],j=(e,t,n,l)=>{const s=11===t.S.nodeType&&t.S.host?t.S.host:t.S,o=e&&e.m||$,i=t.m||$;for(l in o)l in i||w(s,l,o[l],void 0,n,t.t);for(l in i)w(s,l,o[l],i[l],n,t.t)},v=(t,n,l)=>{let o,i,c=n.p[l],r=0;if(null!==c.$)o=c.S=s.createTextNode(c.$);else if(o=c.S=s.createElement(c.g),j(null,c,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),c.p)for(r=0;r<c.p.length;++r)i=v(t,c,r),i&&o.appendChild(i);return o},M=(e,n,l,s,o,i)=>{let c,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);o<=i;++o)s[o]&&(c=v(null,l,o),c&&(s[o].S=c,r.insertBefore(c,n)))},k=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.S.remove()},C=(e,t)=>e.g===t.g,O=(e,t)=>{const n=t.S=e.S,l=e.p,s=t.p,o=t.$;null===o?("slot"===t.g||j(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,i=0,c=t.length-1,r=t[0],u=t[c],a=l.length-1,f=l[0],d=l[a];for(;o<=c&&i<=a;)null==r?r=t[++o]:null==u?u=t[--c]:null==f?f=l[++i]:null==d?d=l[--a]:C(r,f)?(O(r,f),r=t[++o],f=l[++i]):C(u,d)?(O(u,d),u=t[--c],d=l[--a]):C(r,d)?(O(r,d),e.insertBefore(r.S,u.S.nextSibling),r=t[++o],d=l[--a]):C(u,f)?(O(u,f),e.insertBefore(u.S,r.S),u=t[--c],f=l[++i]):(s=v(t&&t[i],n,i),f=l[++i],s&&r.S.parentNode.insertBefore(s,r.S));o>c?M(e,null==l[a+1]?null:l[a+1].S,n,l,i,a):i>a&&k(t,o,c)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),M(n,null,t,s,0,s.length-1)):null!==l&&k(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=e=>z(e).j,x=(e,t,n)=>{const l=P(e);return{emit:e=>E(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},E=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},N=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},R=(e,t)=>{if(e.t|=16,!(4&e.t))return N(e,e.M),se((()=>T(e,t)));e.t|=512},T=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>q(n,e,t))),e.u=null)),D(void 0,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.k,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=X.get(n);if(e=11===e.nodeType?e:s,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=s.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);L(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>U(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},L=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.k,i=n.C||p(null,null),c=(e=>e&&e.g===b)(l)?l:y(null,null,l);t=s.tagName,o.O&&(c.m=c.m||{},o.O.map((([e,t])=>c.m[t]=s[e]))),c.g=null,c.t|=4,n.C=c,c.S=i.S=s.shadowRoot||s,e=s["s-sc"],O(i,c)})(n,l)}catch(e){J(e,n.j)}return null},U=e=>{const t=e.j,n=e.M;q(e.i,"componentDidRender"),64&e.t||(e.t|=64,F(t),e.P(t),n||W()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>R(e,!1))),e.t&=-517},W=()=>{F(s.documentElement),le((()=>E(l,"appload",{detail:{namespace:"casino-engagement-suite-modal-container"}})))},q=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},D=(e,t)=>e&&e.then?e.then(t):t(),F=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.N){const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>z(this).R.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=z(e),o=s.R.get(t),i=s.t,c=s.i;n=((e,t)=>null==e||m(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.N[t][0]),8&i&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.R.set(t,n),c&&2==(18&i)&&R(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.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 s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},V=(e,t={})=>{const n=[],i=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let m,y=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],N:t[2],T:t[3]};l.N=t[2],l.T=t[3],l.O=[];const s=l.h,a=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){m&&(clearTimeout(m),m=null),y?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=z(e),n=t.k,l=()=>{};if(1&t.t)r(e,t,n.T);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){N(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=h(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);c&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,i=()=>R(t,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=z(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return z(this).A}};l.L=e[0],i.includes(s)||u.get(s)||(n.push(s),u.define(s,H(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),y=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>m=setTimeout(W,30)))},_=new WeakMap,z=e=>_.get(e),B=(e,t)=>_.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,k:t,R:new Map};return n.A=new Promise((e=>n.P=e)),e["s-p"]=[],e["s-rc"]=[],r(e,n,t.T),_.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>i().then(e),se=ee(Z,!0);export{V as b,x as c,P as g,y as h,i as p,B as r}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-78d28144.js');
3
+ const index = require('./index-2394967b.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["casino-engagement-suite-modal-container.cjs",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
18
+ return index.bootstrapLazy([["casino-engagement-suite-modal_2.cjs",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
19
19
  });
@@ -2,8 +2,69 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-78d28144.js');
6
- require('@everymatrix/casino-engagement-suite-modal');
5
+ const index = require('./index-2394967b.js');
6
+
7
+ const casinoEngagementSuiteModalCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
8
+
9
+ const CasinoEngagementSuiteModal = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.closeModal = index.createEvent(this, "closeModal", 7);
13
+ /**
14
+ * Client custom styling via string
15
+ */
16
+ this.clientStyling = '';
17
+ /**
18
+ * Client custom styling via url
19
+ */
20
+ this.clientStylingUrl = '';
21
+ this.device = 'Mobile';
22
+ /**
23
+ * Show win animation
24
+ */
25
+ this.showAnimation = false;
26
+ this.limitStylingAppends = false;
27
+ this.handleCloseClick = () => {
28
+ if (this.isLoading)
29
+ return;
30
+ this.closeModal.emit(this.modalType);
31
+ };
32
+ this.setClientStyling = () => {
33
+ let sheet = document.createElement('style');
34
+ sheet.innerHTML = this.clientStyling;
35
+ this.host.prepend(sheet);
36
+ };
37
+ this.setClientStylingURL = () => {
38
+ let url = new URL(this.clientStylingUrl);
39
+ let cssFile = document.createElement('style');
40
+ fetch(url.href)
41
+ .then((res) => res.text())
42
+ .then((data) => {
43
+ cssFile.innerHTML = data;
44
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
45
+ })
46
+ .catch((err) => {
47
+ console.log('Error ', err);
48
+ });
49
+ };
50
+ }
51
+ componentDidRender() {
52
+ if (!this.limitStylingAppends && this.host) {
53
+ if (this.clientStyling)
54
+ this.setClientStyling();
55
+ if (this.clientStylingUrl)
56
+ this.setClientStylingURL();
57
+ this.limitStylingAppends = true;
58
+ }
59
+ }
60
+ render() {
61
+ return (index.h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device} ${this.showAnimation && 'ShowAnimation'}` }, index.h("div", { class: "ModalWinAnimation" }), index.h("div", { class: "ModalContent GradientBorder" }, index.h("div", { class: 'IconCloseContainer' }, index.h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, index.h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "\u0421lose modal" }))), this.contentIcon ? (index.h("div", { class: "ModalIcon", style: {
62
+ background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
63
+ } })) : null, index.h("div", { class: "ModalHeader" }, index.h("h1", null, this.header)), index.h("div", { class: "ModalBody" }, index.h("slot", { name: "body" })), index.h("div", { class: "ModalFooter" }, index.h("slot", { name: "footer" })))));
64
+ }
65
+ get host() { return index.getElement(this); }
66
+ };
67
+ CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
7
68
 
8
69
  const DEFAULT_LANGUAGE = 'en';
9
70
  const SUPPORTED_LANGUAGES = ['en'];
@@ -146,4 +207,5 @@ const CasinoEngagementSuiteModalContainer = class {
146
207
  };
147
208
  CasinoEngagementSuiteModalContainer.style = casinoEngagementSuiteModalContainerCss;
148
209
 
210
+ exports.casino_engagement_suite_modal = CasinoEngagementSuiteModal;
149
211
  exports.casino_engagement_suite_modal_container = CasinoEngagementSuiteModalContainer;
@@ -268,6 +268,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
268
268
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
269
269
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
270
270
  }
271
+ else if (memberName === 'style') {
272
+ // update style attribute, css properties and values
273
+ {
274
+ for (const prop in oldValue) {
275
+ if (!newValue || newValue[prop] == null) {
276
+ if (prop.includes('-')) {
277
+ elm.style.removeProperty(prop);
278
+ }
279
+ else {
280
+ elm.style[prop] = '';
281
+ }
282
+ }
283
+ }
284
+ }
285
+ for (const prop in newValue) {
286
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
287
+ if (prop.includes('-')) {
288
+ elm.style.setProperty(prop, newValue[prop]);
289
+ }
290
+ else {
291
+ elm.style[prop] = newValue[prop];
292
+ }
293
+ }
294
+ }
295
+ }
271
296
  else if ((!isProp ) &&
272
297
  memberName[0] === 'o' &&
273
298
  memberName[1] === 'n') {
@@ -507,11 +532,14 @@ const patch = (oldVNode, newVNode) => {
507
532
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
508
533
  const oldChildren = oldVNode.$children$;
509
534
  const newChildren = newVNode.$children$;
535
+ const tag = newVNode.$tag$;
510
536
  const text = newVNode.$text$;
511
537
  if (text === null) {
512
538
  // element node
513
539
  {
514
- {
540
+ if (tag === 'slot')
541
+ ;
542
+ else {
515
543
  // either this is the first render of an element OR it's an update
516
544
  // AND we already know it's possible it could have changed
517
545
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-78d28144.js');
5
+ const index = require('./index-2394967b.js');
6
6
 
7
7
  /*
8
8
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -14,7 +14,7 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["casino-engagement-suite-modal-container.cjs",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
17
+ return index.bootstrapLazy([["casino-engagement-suite-modal_2.cjs",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
18
18
  });
19
19
  };
20
20
 
@@ -7,6 +7,13 @@
7
7
  "version": "2.15.2",
8
8
  "typescriptVersion": "4.5.4"
9
9
  },
10
- "collections": [],
10
+ "collections": [
11
+ {
12
+ "name": "@everymatrix/casino-engagement-suite-modal",
13
+ "tags": [
14
+ "casino-engagement-suite-modal"
15
+ ]
16
+ }
17
+ ],
11
18
  "bundles": []
12
19
  }
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import '@everymatrix/casino-engagement-suite-modal';
2
+ import { d as defineCustomElement$2 } from './casino-engagement-suite-modal2.js';
3
3
 
4
4
  const DEFAULT_LANGUAGE = 'en';
5
5
  const SUPPORTED_LANGUAGES = ['en'];
@@ -159,13 +159,18 @@ function defineCustomElement$1() {
159
159
  if (typeof customElements === "undefined") {
160
160
  return;
161
161
  }
162
- const components = ["casino-engagement-suite-modal-container"];
162
+ const components = ["casino-engagement-suite-modal-container", "casino-engagement-suite-modal"];
163
163
  components.forEach(tagName => { switch (tagName) {
164
164
  case "casino-engagement-suite-modal-container":
165
165
  if (!customElements.get(tagName)) {
166
166
  customElements.define(tagName, CasinoEngagementSuiteModalContainer$1);
167
167
  }
168
168
  break;
169
+ case "casino-engagement-suite-modal":
170
+ if (!customElements.get(tagName)) {
171
+ defineCustomElement$2();
172
+ }
173
+ break;
169
174
  } });
170
175
  }
171
176
 
@@ -0,0 +1,6 @@
1
+ import { C as CasinoEngagementSuiteModal$1, d as defineCustomElement$1 } from './casino-engagement-suite-modal2.js';
2
+
3
+ const CasinoEngagementSuiteModal = CasinoEngagementSuiteModal$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { CasinoEngagementSuiteModal, defineCustomElement };
@@ -0,0 +1,91 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+
3
+ const casinoEngagementSuiteModalCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
4
+
5
+ const CasinoEngagementSuiteModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ this.closeModal = createEvent(this, "closeModal", 7);
11
+ /**
12
+ * Client custom styling via string
13
+ */
14
+ this.clientStyling = '';
15
+ /**
16
+ * Client custom styling via url
17
+ */
18
+ this.clientStylingUrl = '';
19
+ this.device = 'Mobile';
20
+ /**
21
+ * Show win animation
22
+ */
23
+ this.showAnimation = false;
24
+ this.limitStylingAppends = false;
25
+ this.handleCloseClick = () => {
26
+ if (this.isLoading)
27
+ return;
28
+ this.closeModal.emit(this.modalType);
29
+ };
30
+ this.setClientStyling = () => {
31
+ let sheet = document.createElement('style');
32
+ sheet.innerHTML = this.clientStyling;
33
+ this.host.prepend(sheet);
34
+ };
35
+ this.setClientStylingURL = () => {
36
+ let url = new URL(this.clientStylingUrl);
37
+ let cssFile = document.createElement('style');
38
+ fetch(url.href)
39
+ .then((res) => res.text())
40
+ .then((data) => {
41
+ cssFile.innerHTML = data;
42
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
43
+ })
44
+ .catch((err) => {
45
+ console.log('Error ', err);
46
+ });
47
+ };
48
+ }
49
+ componentDidRender() {
50
+ if (!this.limitStylingAppends && this.host) {
51
+ if (this.clientStyling)
52
+ this.setClientStyling();
53
+ if (this.clientStylingUrl)
54
+ this.setClientStylingURL();
55
+ this.limitStylingAppends = true;
56
+ }
57
+ }
58
+ render() {
59
+ return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device} ${this.showAnimation && 'ShowAnimation'}` }, h("div", { class: "ModalWinAnimation" }), h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
60
+ background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
61
+ } })) : null, h("div", { class: "ModalHeader" }, h("h1", null, this.header)), h("div", { class: "ModalBody" }, h("slot", { name: "body" })), h("div", { class: "ModalFooter" }, h("slot", { name: "footer" })))));
62
+ }
63
+ get host() { return this; }
64
+ static get style() { return casinoEngagementSuiteModalCss; }
65
+ }, [1, "casino-engagement-suite-modal", {
66
+ "clientStyling": [513, "client-styling"],
67
+ "clientStylingUrl": [513, "client-styling-url"],
68
+ "isOpen": [4, "is-open"],
69
+ "isLoading": [1028, "is-loading"],
70
+ "header": [1],
71
+ "contentIcon": [1, "content-icon"],
72
+ "modalType": [1, "modal-type"],
73
+ "device": [1],
74
+ "showAnimation": [4, "show-animation"],
75
+ "limitStylingAppends": [32]
76
+ }]);
77
+ function defineCustomElement() {
78
+ if (typeof customElements === "undefined") {
79
+ return;
80
+ }
81
+ const components = ["casino-engagement-suite-modal"];
82
+ components.forEach(tagName => { switch (tagName) {
83
+ case "casino-engagement-suite-modal":
84
+ if (!customElements.get(tagName)) {
85
+ customElements.define(tagName, CasinoEngagementSuiteModal);
86
+ }
87
+ break;
88
+ } });
89
+ }
90
+
91
+ export { CasinoEngagementSuiteModal as C, defineCustomElement as d };
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-4840d146.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-89c6c4a4.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["casino-engagement-suite-modal-container",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
16
+ return bootstrapLazy([["casino-engagement-suite-modal_2",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
17
17
  });
@@ -1,5 +1,66 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-4840d146.js';
2
- import '@everymatrix/casino-engagement-suite-modal';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement } from './index-89c6c4a4.js';
2
+
3
+ const casinoEngagementSuiteModalCss = ":host{display:block;font-family:inherit}*{box-sizing:border-box;margin:0;padding:0}button{border:none;background:none;cursor:pointer}button:focus{outline:none}.ModalOverlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);justify-content:center;align-items:center}.ModalOverlay.Open{display:flex}.IconCloseContainer{width:100%;display:flex;justify-content:end}.ModalContent{display:flex;flex-direction:column;align-items:center;font-family:\"Montserrat\", sans-serif;position:relative;color:var(--emw--color-typography, #FFFFFF);background-color:var(--emw--color-background, #1E1638);padding:12px;border-radius:8px;width:450px;max-width:100%;text-align:center}.GradientBorder::before{content:\"\";position:absolute;top:-1px;left:-1px;right:-1px;bottom:-1px;border-radius:9px;background:linear-gradient(143.2deg, #FF9401 -0.41%, #FFD32D 45.61%, #FF9401 82.77%);z-index:-1}.ModalHeader h1{font-weight:var(--emw--font-weight-semibold, 600);font-size:20px;margin-top:12px;padding:0 16px}.ModalIcon{width:44px;height:44px;border-radius:50%;background-size:cover;margin-top:12px}.ModalBody{margin-top:20px;font-size:16px;font-family:\"Inter\", sans-serif;font-weight:var(--emw--font-weight-normal, 400);color:var(--emw--color-gray-100, #BBB9C3);padding:0 16px}.ModalFooter{margin-top:40px;margin-bottom:28px;padding:0 16px;width:100%}@keyframes rotate{100%{transform:rotate(1turn)}}.ModalOverlay .ModalWinAnimation{display:none}.ModalOverlay.ShowAnimation .ModalWinAnimation{display:block;position:absolute;width:100%;height:100%;inset:0;background:center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/light.svg) no-repeat, center/550px url(https://static.everymatrix.com/gic/img/engagement-suite/win.svg) no-repeat;animation:6s rotate linear infinite}.ModalOverlay.Mobile .ModalBody{font-size:14px}.ModalOverlay.Mobile .ModalContent{width:318px}.ModalOverlay.Mobile .ModalHeader h1{font-size:20px}.ModalOverlay.Mobile.ShowAnimation .ModalWinAnimation{background-size:400px}";
4
+
5
+ const CasinoEngagementSuiteModal = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.closeModal = createEvent(this, "closeModal", 7);
9
+ /**
10
+ * Client custom styling via string
11
+ */
12
+ this.clientStyling = '';
13
+ /**
14
+ * Client custom styling via url
15
+ */
16
+ this.clientStylingUrl = '';
17
+ this.device = 'Mobile';
18
+ /**
19
+ * Show win animation
20
+ */
21
+ this.showAnimation = false;
22
+ this.limitStylingAppends = false;
23
+ this.handleCloseClick = () => {
24
+ if (this.isLoading)
25
+ return;
26
+ this.closeModal.emit(this.modalType);
27
+ };
28
+ this.setClientStyling = () => {
29
+ let sheet = document.createElement('style');
30
+ sheet.innerHTML = this.clientStyling;
31
+ this.host.prepend(sheet);
32
+ };
33
+ this.setClientStylingURL = () => {
34
+ let url = new URL(this.clientStylingUrl);
35
+ let cssFile = document.createElement('style');
36
+ fetch(url.href)
37
+ .then((res) => res.text())
38
+ .then((data) => {
39
+ cssFile.innerHTML = data;
40
+ setTimeout(() => { this.host.prepend(cssFile); }, 1);
41
+ })
42
+ .catch((err) => {
43
+ console.log('Error ', err);
44
+ });
45
+ };
46
+ }
47
+ componentDidRender() {
48
+ if (!this.limitStylingAppends && this.host) {
49
+ if (this.clientStyling)
50
+ this.setClientStyling();
51
+ if (this.clientStylingUrl)
52
+ this.setClientStylingURL();
53
+ this.limitStylingAppends = true;
54
+ }
55
+ }
56
+ render() {
57
+ return (h("div", { class: `ModalOverlay ${this.isOpen && 'Open'} ${this.device} ${this.showAnimation && 'ShowAnimation'}` }, h("div", { class: "ModalWinAnimation" }), h("div", { class: "ModalContent GradientBorder" }, h("div", { class: 'IconCloseContainer' }, h("button", { class: "IconCloseButton", onClick: this.handleCloseClick }, h("img", { src: "https://static.everymatrix.com/gic/img/engagement-suite/close.svg", alt: "\u0421lose modal" }))), this.contentIcon ? (h("div", { class: "ModalIcon", style: {
58
+ background: `url(${this.contentIcon}) no-repeat center, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%)`
59
+ } })) : null, h("div", { class: "ModalHeader" }, h("h1", null, this.header)), h("div", { class: "ModalBody" }, h("slot", { name: "body" })), h("div", { class: "ModalFooter" }, h("slot", { name: "footer" })))));
60
+ }
61
+ get host() { return getElement(this); }
62
+ };
63
+ CasinoEngagementSuiteModal.style = casinoEngagementSuiteModalCss;
3
64
 
4
65
  const DEFAULT_LANGUAGE = 'en';
5
66
  const SUPPORTED_LANGUAGES = ['en'];
@@ -142,4 +203,4 @@ const CasinoEngagementSuiteModalContainer = class {
142
203
  };
143
204
  CasinoEngagementSuiteModalContainer.style = casinoEngagementSuiteModalContainerCss;
144
205
 
145
- export { CasinoEngagementSuiteModalContainer as casino_engagement_suite_modal_container };
206
+ export { CasinoEngagementSuiteModal as casino_engagement_suite_modal, CasinoEngagementSuiteModalContainer as casino_engagement_suite_modal_container };
@@ -246,6 +246,31 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
246
246
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
247
247
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
248
248
  }
249
+ else if (memberName === 'style') {
250
+ // update style attribute, css properties and values
251
+ {
252
+ for (const prop in oldValue) {
253
+ if (!newValue || newValue[prop] == null) {
254
+ if (prop.includes('-')) {
255
+ elm.style.removeProperty(prop);
256
+ }
257
+ else {
258
+ elm.style[prop] = '';
259
+ }
260
+ }
261
+ }
262
+ }
263
+ for (const prop in newValue) {
264
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
265
+ if (prop.includes('-')) {
266
+ elm.style.setProperty(prop, newValue[prop]);
267
+ }
268
+ else {
269
+ elm.style[prop] = newValue[prop];
270
+ }
271
+ }
272
+ }
273
+ }
249
274
  else if ((!isProp ) &&
250
275
  memberName[0] === 'o' &&
251
276
  memberName[1] === 'n') {
@@ -485,11 +510,14 @@ const patch = (oldVNode, newVNode) => {
485
510
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
486
511
  const oldChildren = oldVNode.$children$;
487
512
  const newChildren = newVNode.$children$;
513
+ const tag = newVNode.$tag$;
488
514
  const text = newVNode.$text$;
489
515
  if (text === null) {
490
516
  // element node
491
517
  {
492
- {
518
+ if (tag === 'slot')
519
+ ;
520
+ else {
493
521
  // either this is the first render of an element OR it's an update
494
522
  // AND we already know it's possible it could have changed
495
523
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -1,4 +1,4 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-4840d146.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-89c6c4a4.js';
2
2
 
3
3
  /*
4
4
  Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["casino-engagement-suite-modal-container",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]]]]], options);
13
+ return bootstrapLazy([["casino-engagement-suite-modal_2",[[1,"casino-engagement-suite-modal-container",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[1],"isJoiningToChallenge":[1028,"is-joining-to-challenge"],"device":[1],"limitStylingAppends":[32],"openModals":[32],"rewardMessage":[32],"hasError":[32],"confirmationData":[32],"winAmount":[32]},[[16,"openModal","openModalHandler"],[16,"closeModal","closeModalHandler"]]],[1,"casino-engagement-suite-modal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"isOpen":[4,"is-open"],"isLoading":[1028,"is-loading"],"header":[1],"contentIcon":[1,"content-icon"],"modalType":[1,"modal-type"],"device":[1],"showAnimation":[4,"show-animation"],"limitStylingAppends":[32]}]]]], options);
14
14
  });
15
15
  };
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-modal-container",
3
- "version": "1.37.2",
3
+ "version": "1.37.4",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={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)},c=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),r=(e,t,n)=>{n&&n.map((([n,l,s])=>{const c=a(e,n),i=u(t,s),r=f(n);o.ael(c,l,i,r),(t.o=t.o||[]).push((()=>o.rel(c,l,i,r)))}))},u=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){J(e)}},a=(e,t)=>16&t?s.body:e,f=e=>0!=(2&e),d=new WeakMap,h=e=>"sc-"+e.h,$={},m=e=>"object"==(e=typeof e)||"function"===e,y=(e,t,...n)=>{let l=null,s=!1,o=!1,c=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!m(l))&&(l+=""),s&&o?c[c.length-1].$+=l:c.push(s?p(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const r=p(e,null);return r.m=t,c.length>0&&(r.p=c),r},p=(e,t)=>({t:0,g:e,$:t,S:null,p:null,m:null}),b={},w=(e,t,n,s,c,i)=>{if(n!==s){let r=I(e,t),u=t.toLowerCase();if("class"===t){const t=e.classList,l=S(n),o=S(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(r||"o"!==t[0]||"n"!==t[1]){const l=m(s);if((r||l&&null!==s)&&!c)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?r=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!r||4&i||c)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):I(l,u)?u.slice(2):u[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},g=/\s/,S=e=>e?e.split(g):[],j=(e,t,n,l)=>{const s=11===t.S.nodeType&&t.S.host?t.S.host:t.S,o=e&&e.m||$,c=t.m||$;for(l in o)l in c||w(s,l,o[l],void 0,n,t.t);for(l in c)w(s,l,o[l],c[l],n,t.t)},v=(t,n,l)=>{let o,c,i=n.p[l],r=0;if(null!==i.$)o=i.S=s.createTextNode(i.$);else if(o=i.S=s.createElement(i.g),j(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.p)for(r=0;r<i.p.length;++r)c=v(t,i,r),c&&o.appendChild(c);return o},M=(e,n,l,s,o,c)=>{let i,r=e;for(r.shadowRoot&&r.tagName===t&&(r=r.shadowRoot);o<=c;++o)s[o]&&(i=v(null,l,o),i&&(s[o].S=i,r.insertBefore(i,n)))},k=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.S.remove()},C=(e,t)=>e.g===t.g,O=(e,t)=>{const n=t.S=e.S,l=e.p,s=t.p,o=t.$;null===o?(j(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,c=0,i=t.length-1,r=t[0],u=t[i],a=l.length-1,f=l[0],d=l[a];for(;o<=i&&c<=a;)null==r?r=t[++o]:null==u?u=t[--i]:null==f?f=l[++c]:null==d?d=l[--a]:C(r,f)?(O(r,f),r=t[++o],f=l[++c]):C(u,d)?(O(u,d),u=t[--i],d=l[--a]):C(r,d)?(O(r,d),e.insertBefore(r.S,u.S.nextSibling),r=t[++o],d=l[--a]):C(u,f)?(O(u,f),e.insertBefore(u.S,r.S),u=t[--i],f=l[++c]):(s=v(t&&t[c],n,c),f=l[++c],s&&r.S.parentNode.insertBefore(s,r.S));o>i?M(e,null==l[a+1]?null:l[a+1].S,n,l,c,a):c>a&&k(t,o,i)})(n,l,t,s):null!==s?(null!==e.$&&(n.textContent=""),M(n,null,t,s,0,s.length-1)):null!==l&&k(l,0,l.length-1)):e.$!==o&&(n.data=o)},P=e=>z(e).j,x=(e,t,n)=>{const l=P(e);return{emit:e=>E(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},E=(e,t,n)=>{const l=o.ce(t,n);return e.dispatchEvent(l),l},N=(e,t)=>{t&&!e.v&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.v=t)))},R=(e,t)=>{if(e.t|=16,!(4&e.t))return N(e,e.M),se((()=>T(e,t)));e.t|=512},T=(e,t)=>{const n=e.i;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>q(n,e,t))),e.u=null)),D(void 0,(()=>A(e,n,t)))},A=async(e,t,n)=>{const l=e.j,o=l["s-rc"];n&&(e=>{const t=e.k,n=e.j,l=t.t,o=((e,t)=>{let n=h(t),l=X.get(n);if(e=11===e.nodeType?e:s,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=s.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);L(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>U(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},L=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.j,o=n.k,c=n.C||p(null,null),i=(e=>e&&e.g===b)(l)?l:y(null,null,l);t=s.tagName,o.O&&(i.m=i.m||{},o.O.map((([e,t])=>i.m[t]=s[e]))),i.g=null,i.t|=4,n.C=i,i.S=c.S=s.shadowRoot||s,e=s["s-sc"],O(c,i)})(n,l)}catch(e){J(e,n.j)}return null},U=e=>{const t=e.j,n=e.M;q(e.i,"componentDidRender"),64&e.t||(e.t|=64,F(t),e.P(t),n||W()),e.v&&(e.v(),e.v=void 0),512&e.t&&le((()=>R(e,!1))),e.t&=-517},W=()=>{F(s.documentElement),le((()=>E(l,"appload",{detail:{namespace:"casino-engagement-suite-modal-container"}})))},q=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){J(e)}},D=(e,t)=>e&&e.then?e.then(t):t(),F=e=>e.classList.add("hydrated"),H=(e,t,n)=>{if(t.N){const l=Object.entries(t.N),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>z(this).R.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=z(e),o=s.R.get(t),c=s.t,i=s.i;n=((e,t)=>null==e||m(e)?e:4&t?"false"!==e&&(""===e||!!e):1&t?e+"":e)(n,l.N[t][0]),8&c&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.R.set(t,n),i&&2==(18&c)&&R(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const n=new Map;s.attributeChangedCallback=function(e,t,l){o.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.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 s=l[1]||e;return n.set(s,e),512&l[0]&&t.O.push([e,s]),s}))}}return e},V=(e,t={})=>{const n=[],c=t.exclude||[],u=l.customElements,a=s.head,f=a.querySelector("meta[charset]"),d=s.createElement("style"),$=[];let m,y=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],h:t[1],N:t[2],T:t[3]};l.N=t[2],l.T=t[3],l.O=[];const s=l.h,a=class extends HTMLElement{constructor(e){super(e),G(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){m&&(clearTimeout(m),m=null),y?$.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=z(e),n=t.k,l=()=>{};if(1&t.t)r(e,t,n.T);else{t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){N(t,t.M=n);break}}n.N&&Object.entries(n.N).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=Q(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(H(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){J(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=h(n);if(!X.has(t)){const l=()=>{};((e,t,n)=>{let l=X.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,X.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.M,c=()=>R(t,!0);o&&o["s-rc"]?o["s-rc"].push(c):c()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{if(0==(1&o.t)){const e=z(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return z(this).A}};l.L=e[0],c.includes(s)||u.get(s)||(n.push(s),u.define(s,H(a,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),a.insertBefore(d,f?f.nextSibling:a.firstChild),y=!1,$.length?$.map((e=>e.connectedCallback())):o.jmp((()=>m=setTimeout(W,30)))},_=new WeakMap,z=e=>_.get(e),B=(e,t)=>_.set(t.i=e,t),G=(e,t)=>{const n={t:0,j:e,k:t,R:new Map};return n.A=new Promise((e=>n.P=e)),e["s-p"]=[],e["s-rc"]=[],r(e,n,t.T),_.set(e,n)},I=(e,t)=>t in e,J=(e,t)=>(0,console.error)(e,t),K=new Map,Q=e=>{const t=e.h.replace(/-/g,"_"),n=e.L,l=K.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(K.set(n,e),e[t])),J)},X=new Map,Y=[],Z=[],ee=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?le(ne):o.raf(ne))},te=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){J(e)}e.length=0},ne=()=>{te(Y),te(Z),(n=Y.length>0)&&o.raf(ne)},le=e=>c().then(e),se=ee(Z,!0);export{V as b,x as c,P as g,y as h,c as p,B as r}
@@ -1 +0,0 @@
1
- import{r as t,c as o,h as e,g as n}from"./p-2bf8a399.js";import"@everymatrix/casino-engagement-suite-modal";const i=["en"],a={en:{joinHeader:"Choose another challenge?",desc:"Any progress on the current challenge will be kept and you can rejoin the challenge at any time.",joinQuestion:"Would you still like to join another challenge?",joinConfirm:"Yes, join another challenge",joinReject:"No, stay at the current challenge",unJoinHeader:"Quit Challenge?",unJoinQuestion:"Would you still like to quit the challenge?",unJoinConfirm:"Yes, I want to quit challenge",unJoinReject:"No, stay at challenge",join:"Unjoin",unJoin:"Unjoin",continue:"Continue",okContinue:"Ok, continue",won:"You won",supportInfo:"However, some rewards cannot be issued. Please, contact support.",noReward:"Reward cannot be issued",contactSupport:"Please contact support",noChallenges:"No Challenges yet",tryOtherGames:"Try winning Challenges as rewards or launching other booster games",tooltip:"Competition where your real money bets contribute towards the level progress to achieve the level reward",jackpotWin:"Total Jackpot Win!"}},s=(t,o)=>{const e=o;return a[void 0!==e&&i.includes(e)?e:"en"][t]},r=class{constructor(e){t(this,e),this.closeModal=o(this,"closeModal",7),this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.limitStylingAppends=!1,this.openModals=[],this.rewardMessage="",this.hasError=!1,this.confirmationData=null,this.winAmount={amount:0,currency:""},this.handleCloseClick=t=>{const o=t.currentTarget.getAttribute("data-type");this.closeModal.emit(o)},this.handleChallengeAttendance=()=>{window.postMessage({type:"ChallengeJoinRequest",data:this.confirmationData})},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),o=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{o.innerHTML=t,setTimeout((()=>{this.host.prepend(o)}),1)})).catch((t=>{console.log("Error ",t)}))},this.isModalOpen=t=>Boolean(this.openModals.find((o=>o===t)))}openModalHandler(t){const{modalType:o,rewardMessage:e,hasError:n,confirmationData:i,winAmount:a}=t.detail;a&&(this.winAmount=this.isModalOpen("JACKPOT_REWARD_MODAL")?{amount:this.winAmount.amount+a.amount,currency:a.currency}:a),this.openModals=[...this.openModals,o],this.rewardMessage=e,this.hasError=n,i&&(this.confirmationData=i)}closeModalHandler(t){this.openModals=this.openModals.filter((o=>o!==t.detail))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const{ProgressToActivate:t}=this.confirmationData||{};return e("div",{class:`ModalContainer ${this.device}`},e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg",modalType:"REWARD_MODAL","show-animation":!0,device:this.device},e("div",{slot:"body"},e("p",null,s("won",this.language)," ",e("span",{class:"ModalReward"},this.rewardMessage)),this.hasError&&e("p",{class:"SupportInfo"},s("supportInfo",this.language))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"REWARD_MODAL"},s("continue",this.language)))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("JACKPOT_REWARD_MODAL"),header:"Congratulations!",contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/cup-reward.svg","show-animation":!0,modalType:"JACKPOT_REWARD_MODAL",device:this.device},e("div",{slot:"body"},e("div",{class:"JackpotWinText"},s("jackpotWin",this.language)),e("div",{class:"JackpotWinAmount"},(o=this.winAmount.amount,`${this.winAmount.currency} ${new Intl.NumberFormat("en",{minimumFractionDigits:2,maximumFractionDigits:2}).format(o)}`))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"JACKPOT_REWARD_MODAL"},s("continue",this.language)))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("TARGET_MODAL"),header:s(t?"joinHeader":"unJoinHeader",this.language),modalType:"TARGET_MODAL",device:this.device,isLoading:this.isJoiningToChallenge},e("div",{slot:"body"},e("p",{class:"LeftAlign"},s("desc",this.language)),e("p",{class:"LeftAlign"},s(t?"joinQuestion":"unJoinQuestion",this.language))),e("div",{slot:"footer",class:"ManyActions"},e("button",{class:"ModalFooterButton "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleChallengeAttendance},s(t?"joinConfirm":"unJoinConfirm",this.language)),e("button",{class:"ModalFooterButtonOutlined "+(this.isJoiningToChallenge?"Disabled":""),onClick:this.handleCloseClick,"data-type":"TARGET_MODAL"},e("div",{class:"GradientText"},s(t?"joinReject":"unJoinReject",this.language))))),e("casino-engagement-suite-modal",{isOpen:this.isModalOpen("SUPPORT_MODAL"),header:s("noReward",this.language),contentIcon:"https://static.everymatrix.com/gic/img/engagement-suite/alert.svg",modalType:"SUPPORT_MODAL",device:this.device},e("div",{slot:"body"},e("span",null,s("contactSupport",this.language))),e("div",{slot:"footer"},e("button",{class:"ModalFooterButton",onClick:this.handleCloseClick,"data-type":"SUPPORT_MODAL"},s("okContinue",this.language)))));var o}get host(){return n(this)}};r.style=':host{display:block;font-family:inherit}.ModalFooterButton,.ModalFooterButtonOutlined{transition:all 0.5s ease-out;background:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:var(--emw--color-typography, #1E1638);border-radius:99px;min-width:140px;height:36px;font-size:14px;font-weight:var(--emw--font-weight-bold, 700);position:relative;font-family:"Montserrat", sans-serif;padding:0 16px;box-sizing:border-box;margin:auto;border:none;cursor:pointer}.ModalFooterButtonOutlined{background:linear-gradient(var(--emw--color-background, #1E1638) 0 0) padding-box, linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%) border-box;border:2px solid transparent}.GradientText{background-image:linear-gradient(98.25deg, #FF9400 22.48%, #FEF746 131.02%, #FFE24A 131.9%);color:transparent;background-clip:text}.ManyActions{display:flex;width:100%;flex-direction:column;align-items:stretch}.ManyActions .ModalFooterButton,.ManyActions .ModalFooterButtonOutlined{width:280px}.ManyActions button:first-child{margin-bottom:16px}.Disabled{opacity:0.5;pointer-events:none;cursor:auto}.ModalReward{font-weight:var(--emw--font-weight-semibold, 600);color:var(--emw--color-typography, #FFFFFF)}.JackpotWinText{margin:0;font-weight:var(--emw--font-weight-bold, 600);font-size:16px;line-height:20px;color:var(--emw--color-typography, #FFF)}.JackpotWinAmount{margin-top:8px;box-shadow:-0.41px 0.41px 0px 0px #00000026, -0.41px 0.41px 2px 0px #00000080;background:linear-gradient(180deg, #FFB801 15.86%, #FEF746 31.36%, #FBFFE0 36.86%, #FFFA60 47.86%, #FF9400 87.36%);-webkit-text-fill-color:transparent;-webkit-background-clip:text;font-weight:900;font-size:16px;line-height:16px}.SupportInfo{margin-top:20px}.ModalContainer.Mobile .ModalFooterButton{min-width:140px;height:32px}.ModalContainer.Mobile .ManyActions .ModalFooterButton,.ModalContainer.Mobile .ManyActions .ModalFooterButtonOutlined{width:100%;height:32px}.ModalContainer.Mobile .ManyActions button:first-child{margin-bottom:8px}.ModalContainer.Mobile .JackpotWinText{font-size:14px;line-height:16px}.ModalContainer.Mobile .JackpotWinAmount{font-size:14px;line-height:14px}.LeftAlign{text-align:left;line-height:1.2}';export{r as casino_engagement_suite_modal_container}