@livelike/embet 0.0.12 → 0.0.13

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/embet.cjs.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /* emBET SDK Version 0.0.12 */
1
+ /* emBET SDK Version 0.0.13 */
2
2
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.polyfillWrapFlushCallback)return;const e=HTMLElement,t=function(){return Reflect.construct(e,[],this.constructor)};window.HTMLElement=t,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}();
3
3
  /**
4
4
  * @license
@@ -386,7 +386,7 @@ found at http://polymer.github.io/PATENTS.txt
386
386
  * subject to an additional IP rights grant found at
387
387
  * http://polymer.github.io/PATENTS.txt
388
388
  */
389
- const Jo=new WeakMap,Xo=(e=>(...t)=>{const n=e(...t);return so.set(n,!0),n})((e=>t=>{const n=Jo.get(t);if(void 0===e&&t instanceof yo){if(void 0!==n||!Jo.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);Jo.set(t,e)})),Zo={".widget-tagline":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-title":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-description":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],".bet-details":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],".footer-text":["fontSize","lineHeight","height","marginLeft","marginRight","marginTop","marginBottom"],".bet-button":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],".dismiss-button":["lineHeight","top","right","height"],".dismiss-button svg":["height","width"],".option-container livelike-image":["height","width"],".option-container livelike-image img":["paddingLeft"],"livelike-widget-body .option-container":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-footer":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".footer-container":["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"],".footer-sponsor":["lineHeight","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],".footer-sponsor img":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-header div.center":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".live-total-text-options":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-option:not(:last-child)":["marginLeft","marginRight","marginTop","marginBottom"],"livelike-option":["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],"livelike-progress":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".percentage-container":["fontSize","lineHeight","paddingRight"],".percentage-text":["fontSize","lineHeight"],"livelike-timer":["height"]},Qo=U`<style>.embet-widget livelike-widget-header{border-radius:0;height:22.5%}.embet-widget livelike-widget-header .center{width:100%;text-align:center;padding-top:1rem}.embet-widget .widget-tagline{font-size:18px;font-weight:700;padding-bottom:10px;text-transform:uppercase}.embet-widget livelike-title{color:#8c9aad;text-transform:uppercase;font-weight:700;padding:0;display:block;width:100%}.embet-widget livelike-widget-body{border-radius:0;height:47.5%}.embet-widget livelike-widget-footer{border-radius:0;height:30%}.embet-widget .option-container{padding:1rem;height:100%;align-items:stretch;display:flex;flex-direction:column}.embet-widget livelike-option{height:50%;border-width:2px;border-style:solid;border-radius:0;padding:0;box-shadow:5px 5px 10px 1px rgba(0,0,0,.2);align-items:unset;box-sizing:border-box}.embet-widget .option-container[interacted] livelike-option{background:rgba(50,50,50,.7);border:2px solid rgba(190,190,190,.7)}.embet-widget .option-container[interacted] livelike-option[selected]{border:2px solid rgba(0,250,0,.7)}.embet-widget livelike-option:not(:last-of-type){margin-bottom:1rem}.embet-widget livelike-option .option-image-wrap{display:flex;width:100%;position:relative;box-sizing:border-box}.embet-widget livelike-option .percentage-container{position:absolute;display:flex;transform:translate(-50%,-50%);top:50%;left:50%;white-space:nowrap}.embet-widget livelike-description{word-break:unset;align-self:center;padding:0 .5rem}.embet-widget .bet-details{padding:0 .5rem;align-self:center}.embet-widget livelike-image img{padding-left:6px}.embet-widget livelike-percentage{padding:0 5px 0 0}.embet-widget livelike-progress{height:calc(100% + 1px);background:rgba(160,160,160,.7);border-radius:0;box-sizing:border-box}.embet-widget livelike-progress[selected]{background:rgba(0,225,0,.7)}.embet-widget .image-grid[interacted] .bet-details,.embet-widget .image-grid[interacted] img,.embet-widget .image-grid[interacted] livelike-description,.embet-widget .option-container[interacted] .bet-details,.embet-widget .option-container[interacted] livelike-description,[variation=bar] .embet-widget .option-container[interacted] livelike-image,[variation=square] .embet-widget .option-container[interacted] livelike-image{opacity:.2}.embet-widget livelike-timer{height:3px}[variation=inline] .embet-widget .option-container{flex-direction:row}[variation=inline] .embet-widget livelike-image img{padding-left:0}[variation=inline] .embet-widget .bet-details,[variation=inline] .embet-widget livelike-descrption{padding:8px}[variation=inline] .live-total-text-options{display:flex;flex-direction:column;width:100%;padding:0 10px}[variation=square] .embet-widget livelike-option:not(:last-of-type){margin-bottom:0}[variation=square] .image-grid{padding:16px;display:grid;grid-column-gap:8px;grid-row-gap:8px}[variation=square] .embet-widget .square-option-0,[variation=square] .embet-widget .square-option-1,[variation=square] .embet-widget .square-option-2,[variation=square] .embet-widget .square-option-3{height:100%;border:none;box-shadow:0 0 0 1px #c1c2ca;border-radius:6px;flex-grow:1;transition:all .2s ease}[variation=square] .embet-widget .square-option-0:after,[variation=square] .embet-widget .square-option-1:after,[variation=square] .embet-widget .square-option-2:after,[variation=square] .embet-widget .square-option-3:after{content:'';width:100%;height:100%;z-index:4;position:absolute;border-radius:6px;transition:all .2s ease}[variation=square] .live-spread-option-text{display:flex;flex-direction:column;font-size:16px!important;width:100%;justify-content:center}[variation=square] .percentage-container{z-index:5}[variation=square] livelike-description{font-size:16px;text-align:center;flex-grow:0;padding:5px 0 0 0;z-index:1}</style>`;function es(e){if(e){let t="";return Object.keys(e).forEach((n=>{let i=(e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase())(n);"fontColor"===n&&(i="color"),t+=`${i}: ${e[n]};\n`})),t}return""}function ts(e){return U`<style>.dismiss-button{background:0 0;border:none;position:absolute;top:12px;right:16px}.dismiss-button:hover{cursor:pointer}</style><button class="dismiss-button" @click="${()=>((e,t,n)=>{const i=new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return e.dispatchEvent(i),i})(e,"dismiss-clicked")}"><svg height="18px" width="18px" viewBox="0 0 28 28"><polygon points="28,22.398 19.594,14 28,5.602 22.398,0 14,8.402 5.598,0 0,5.602 8.398,14 0,22.398 5.598,28 14,19.598 22.398,28" style="fill:#979797"/></svg></button>`}class ns extends Ci{constructor(){super(...arguments),this.defaultVoteHide=!1,this.hideVoteInResults=!1,this.voteCallback=e=>{e.detail&&e.detail.item&&e.detail.item.id&&!this.voted&&(this.voted=!0)},this.updateThemeStyles=e=>{this.themeStyles=Object.assign(Object.assign({},this.themeStyles),e)},this.themeUpdated=e=>{this.requestUpdate()},this.parseCustomData=e=>{this.sponsors=e.sponsors||this.widgetPayload.sponsors||[],this.place_bet_url=this.customData.place_bet_url||"";const t={"LIVE MONEYLINE":"bar","LIVE SPREAD":"square","LIVE TOTAL":"inline"}[this.customData.type];if(this.widgetVariation=this.customData.widgetVariation||t,this.setAttribute("variation",this.widgetVariation),e.theme&&e.theme.widgets){Vr.applyTheme(e.theme);const t=this.kind||this.widgetPayload.kind;!this.widgetPayload.kind&&(this.widgetPayload.kind=t),this.themeStyles=e.theme.widgets[t.split("-")[1]]}if(e.customCss){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.customCss),this.appendChild(t)}e.customStyles&&(this.customStyles=e.customStyles)},this.getWidth=()=>{const e=this.querySelector("livelike-widget-root").clientWidth;if(e>0){const t=e>=375?"1.5vw":"1.75vw";this.querySelectorAll("livelike-description").forEach((e=>e.style.fontSize=t));this.querySelector("livelike-title").style.fontSize=t;this.querySelectorAll(".bet-details").forEach((e=>e.style.fontSize=t));this.querySelector(".bet-button").style.fontSize=t;if(this.querySelector(".widget-tagline").style.fontSize=t,this.customData&&"LIVE SPREAD"===this.customData.type){const t=e>300?"0":"10px 0",n=e>=300?"60px":"35px";this.querySelectorAll("livelike-image").forEach((e=>e.style.padding=t));this.querySelectorAll("livelike-image > img").forEach((e=>e.style.height=n))}}else setTimeout(this.getWidth,250)}}static get properties(){return{voted:{type:Boolean},customData:{type:Object},sponsors:{type:Array},place_bet_url:{type:String},themeStyles:{type:Object},customStyles:{type:String},options:{type:Array},optionsRenderer:{type:Function},widgetVariation:{type:String}}}connectedCallback(){super.connectedCallback(),this.addEventListener("interacted",this.voteCallback),document.addEventListener("livelike-theme-updated",this.themeUpdated)}disconnectedCallbck(){super.disconnectedCallbck(),window.removeEventListener("resize",this.getWidth),this.removeEventListener("interacted",this.voteCallback),document.addEventListener("livelike-theme-updated",this.themeUpdated)}firstUpdated(){super.firstUpdated(),this.customData&&this.parseCustomData(this.customData),this.widgetPayload.options&&(this.options=this.widgetPayload.options),this.updateComplete.then((()=>{const e=this.querySelector("livelike-widget-root");window.addEventListener("resize",this.getWidth),this.getWidth(),e.updateComplete.then((()=>{const t=e.shadowRoot.querySelector("livelike-widget-bylines");t&&t.remove();const n=e.shadowRoot.querySelector("livelike-widget-reactions");n&&n.remove()}))}))}render(){const e=this.customData&&this.customData.type?U`<div class="widget-tagline">${this.customData.type}</div>`:null;return U`<template>${Qo}<style>${this.customStyles}.embet-widget{height:${this.customData&&this.customData.widgetHeight?this.customData.widgetHeight:"100%"}}</style><livelike-widget-root class="embet-widget"><livelike-widget-header class="widget-header" slot="header"><div class="center">${e}<livelike-title></livelike-title></div>${ts(this)}</livelike-widget-header><livelike-widget-body>${this.widgetVariation&&this.optionsRenderer(this.options,this.customData,this.voted,this.widgetVariation)}</livelike-widget-body>${function(e,t,n,i){let r,o;return t&&(r=es(t.footer),o=es(t.betButton)),U`<style>.embet-widget livelike-widget-footer{display:flex;border-radius:0;padding:10px 16px;${r}}.embet-widget .footer-container{width:50%;display:flex;flex-direction:column;justify-content:center;margin:5px;padding:5px}.embet-widget .footer-text{height:12px;text-align:center;font-size:12px;color:#999;white-space:nowrap;margin-bottom:10px}.embet-widget .footer-sponsor{border:2px solid rgba(255,255,255,.2);max-height:40px;box-sizing:border-box}.embet-widget .footer-sponsor img{object-fit:contain;box-sizing:border-box;width:100%;height:100%;padding:4px 10px}.embet-widget .bet-button{border-radius:3rem;padding:10px;white-space:nowrap;border-width:2px;border-style:solid;${o}}.embet-widget .bet-button:hover{cursor:pointer}.embet-widget .bet-button a{text-decoration:none;font-weight:700;color:inherit}${i}</style><livelike-widget-footer><div class="footer-container"><div class="footer-text">SPONSORED BY</div><div class="footer-sponsor">${n&&n[0]&&n[0].logo_url?U`<img src="${n[0].logo_url}" alt="${n[0].name}">`:null}</div></div><div class="footer-container"><div class="footer-text"></div><button class="bet-button"><a target="_blank" href="${e||""}">PLACE BET</a></button></div></livelike-widget-footer>`}(this.place_bet_url,this.themeStyles,this.sponsors,this.customStyles)}<livelike-timer class="custom-timer"></livelike-timer></livelike-widget-root></template>`}}const is=(e,t)=>{const n=e.reduce(((e,t)=>e+t.vote_count),0);return n>0?Math.round(t.vote_count/n*100):0},rs=(e,t)=>{if(e&&e.betDetails){const n=e.betDetails.find((e=>e.description===t.description));if(n)return U` <div class="bet-details">${n.bet}</div> `}},os=(e,t,n)=>U`
389
+ const Jo=new WeakMap,Xo=(e=>(...t)=>{const n=e(...t);return so.set(n,!0),n})((e=>t=>{const n=Jo.get(t);if(void 0===e&&t instanceof yo){if(void 0!==n||!Jo.has(t)){const e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==n&&t.setValue(e);Jo.set(t,e)})),Zo={".widget-tagline":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-title":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-description":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],".bet-details":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom"],".footer-text":["fontSize","lineHeight","height","marginLeft","marginRight","marginTop","marginBottom"],".bet-button":["fontSize","lineHeight","paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],".dismiss-button":["lineHeight","top","right","height"],".dismiss-button svg":["height","width"],".option-container livelike-image":["height","width"],".option-container livelike-image img":["paddingLeft"],"livelike-widget-body .option-container":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-footer":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".footer-container":["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom"],".footer-sponsor":["lineHeight","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],".footer-sponsor img":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-widget-header div.center":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".live-total-text-options":["paddingLeft","paddingRight","paddingTop","paddingBottom"],"livelike-option:not(:last-child)":["marginLeft","marginRight","marginTop","marginBottom"],"livelike-option":["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],"livelike-progress":["paddingLeft","paddingRight","paddingTop","paddingBottom"],".percentage-container":["fontSize","lineHeight","paddingRight"],".percentage-text":["fontSize","lineHeight"],"livelike-timer":["height"]},Qo=U`<style>.embet-widget livelike-widget-header{border-radius:0;height:22.5%}.embet-widget livelike-widget-header .center{width:100%;text-align:center;padding-top:1rem}.embet-widget .widget-tagline{font-size:18px;font-weight:700;padding-bottom:10px;text-transform:uppercase}.embet-widget livelike-title{text-transform:uppercase;font-weight:700;padding:0;display:block;width:100%}.embet-widget livelike-widget-body{border-radius:0;height:47.5%}.embet-widget livelike-widget-footer{border-radius:0;height:30%}.embet-widget .option-container{padding:1rem;height:100%;align-items:stretch;display:flex;flex-direction:column}.embet-widget livelike-option{height:50%;border-width:2px;border-style:solid;border-radius:0;padding:0;box-shadow:5px 5px 10px 1px rgba(0,0,0,.2);align-items:unset;box-sizing:border-box}.embet-widget .option-container[interacted] livelike-option{background:rgba(50,50,50,.7);border:2px solid rgba(190,190,190,.7)}.embet-widget .option-container[interacted] livelike-option[selected]{border:2px solid rgba(0,250,0,.7)}.embet-widget livelike-option:not(:last-of-type){margin-bottom:1rem}.embet-widget livelike-option .option-image-wrap{display:flex;width:100%;position:relative;box-sizing:border-box}.embet-widget livelike-option .percentage-container{position:absolute;display:flex;transform:translate(-50%,-50%);top:50%;left:50%;white-space:nowrap}.embet-widget livelike-description{word-break:unset;align-self:center;padding:0 .5rem}.embet-widget .bet-details{padding:0 .5rem;align-self:center}.embet-widget livelike-image img{padding-left:6px}.embet-widget livelike-percentage{padding:0 5px 0 0}.embet-widget livelike-progress{height:calc(100% + 1px);background:rgba(160,160,160,.7);border-radius:0;box-sizing:border-box}.embet-widget livelike-progress[selected]{background:rgba(0,225,0,.7)}.embet-widget .image-grid[interacted] .bet-details,.embet-widget .image-grid[interacted] img,.embet-widget .image-grid[interacted] livelike-description,.embet-widget .option-container[interacted] .bet-details,.embet-widget .option-container[interacted] livelike-description,[variation=bar] .embet-widget .option-container[interacted] livelike-image,[variation=square] .embet-widget .option-container[interacted] livelike-image{opacity:.2}.embet-widget livelike-timer{height:3px}[variation=inline] .embet-widget .option-container{flex-direction:row}[variation=inline] .embet-widget livelike-image img{padding-left:0}[variation=inline] .embet-widget .bet-details,[variation=inline] .embet-widget livelike-descrption{padding:8px}[variation=inline] .live-total-text-options{display:flex;flex-direction:column;width:100%;padding:0 10px}[variation=square] .embet-widget livelike-option:not(:last-of-type){margin-bottom:0}[variation=square] .image-grid{padding:16px;display:grid;grid-column-gap:8px;grid-row-gap:8px}[variation=square] .embet-widget .square-option-0,[variation=square] .embet-widget .square-option-1,[variation=square] .embet-widget .square-option-2,[variation=square] .embet-widget .square-option-3{height:100%;border:none;box-shadow:0 0 0 1px #c1c2ca;border-radius:6px;flex-grow:1;transition:all .2s ease}[variation=square] .embet-widget .square-option-0:after,[variation=square] .embet-widget .square-option-1:after,[variation=square] .embet-widget .square-option-2:after,[variation=square] .embet-widget .square-option-3:after{content:'';width:100%;height:100%;z-index:4;position:absolute;border-radius:6px;transition:all .2s ease}[variation=square] .live-spread-option-text{display:flex;flex-direction:column;font-size:16px!important;width:100%;justify-content:center}[variation=square] .percentage-container{z-index:5}[variation=square] livelike-description{font-size:16px;text-align:center;flex-grow:0;padding:5px 0 0 0;z-index:1}</style>`;function es(e){if(e){let t="";return Object.keys(e).forEach((n=>{let i=(e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase())(n);"fontColor"===n&&(i="color"),t+=`${i}: ${e[n]};\n`})),t}return""}function ts(e){return U`<style>.dismiss-button{background:0 0;border:none;position:absolute;top:12px;right:16px}.dismiss-button:hover{cursor:pointer}</style><button class="dismiss-button" @click="${()=>((e,t,n)=>{const i=new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0});return e.dispatchEvent(i),i})(e,"dismiss-clicked")}"><svg height="18px" width="18px" viewBox="0 0 28 28"><polygon points="28,22.398 19.594,14 28,5.602 22.398,0 14,8.402 5.598,0 0,5.602 8.398,14 0,22.398 5.598,28 14,19.598 22.398,28" style="fill:#979797"/></svg></button>`}class ns extends Ci{constructor(){super(...arguments),this.defaultVoteHide=!1,this.hideVoteInResults=!1,this.voteCallback=e=>{e.detail&&e.detail.item&&e.detail.item.id&&!this.voted&&(this.voted=!0)},this.updateThemeStyles=e=>{this.themeStyles=Object.assign(Object.assign({},this.themeStyles),e)},this.themeUpdated=e=>{this.requestUpdate()},this.parseCustomData=e=>{this.sponsors=e.sponsors||this.widgetPayload.sponsors||[],this.place_bet_url=this.customData.place_bet_url||"";const t={"LIVE MONEYLINE":"bar","LIVE SPREAD":"square","LIVE TOTAL":"inline"}[this.customData.type];if(this.widgetVariation=this.customData.widgetVariation||t,this.setAttribute("variation",this.widgetVariation),e.theme&&e.theme.widgets){Vr.applyTheme(e.theme);const t=this.kind||this.widgetPayload.kind;!this.widgetPayload.kind&&(this.widgetPayload.kind=t),this.themeStyles=e.theme.widgets[t.split("-")[1]]}if(e.customCss){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e.customCss),this.appendChild(t)}e.customStyles&&(this.customStyles=e.customStyles)},this.getWidth=()=>{const e=this.querySelector("livelike-widget-root").clientWidth;if(e>0){const t=e>=375?"1.5vw":"1.75vw";this.querySelectorAll("livelike-description").forEach((e=>e.style.fontSize=t));this.querySelector("livelike-title").style.fontSize=t;this.querySelectorAll(".bet-details").forEach((e=>e.style.fontSize=t));this.querySelector(".bet-button").style.fontSize=t;if(this.querySelector(".widget-tagline").style.fontSize=t,this.customData&&"LIVE SPREAD"===this.customData.type){const t=e>300?"0":"10px 0",n=e>=300?"60px":"35px";this.querySelectorAll("livelike-image").forEach((e=>e.style.padding=t));this.querySelectorAll("livelike-image > img").forEach((e=>e.style.height=n))}}else setTimeout(this.getWidth,250)}}static get properties(){return{voted:{type:Boolean},customData:{type:Object},sponsors:{type:Array},place_bet_url:{type:String},themeStyles:{type:Object},customStyles:{type:String},options:{type:Array},optionsRenderer:{type:Function},widgetVariation:{type:String}}}connectedCallback(){super.connectedCallback(),this.addEventListener("interacted",this.voteCallback),document.addEventListener("livelike-theme-updated",this.themeUpdated)}disconnectedCallbck(){super.disconnectedCallbck(),window.removeEventListener("resize",this.getWidth),this.removeEventListener("interacted",this.voteCallback),document.addEventListener("livelike-theme-updated",this.themeUpdated)}firstUpdated(){super.firstUpdated(),this.customData&&this.parseCustomData(this.customData),this.widgetPayload.options&&(this.options=this.widgetPayload.options),this.updateComplete.then((()=>{const e=this.querySelector("livelike-widget-root");window.addEventListener("resize",this.getWidth),this.getWidth(),e.updateComplete.then((()=>{const t=e.shadowRoot.querySelector("livelike-widget-bylines");t&&t.remove();const n=e.shadowRoot.querySelector("livelike-widget-reactions");n&&n.remove()}))}))}render(){const e=this.customData&&this.customData.type?U`<div class="widget-tagline">${this.customData.type}</div>`:null;return U`<template>${Qo}<style>${this.customStyles}.embet-widget{height:${this.customData&&this.customData.widgetHeight?this.customData.widgetHeight:"100%"}}</style><livelike-widget-root class="embet-widget"><livelike-widget-header class="widget-header" slot="header"><div class="center">${e}<livelike-title></livelike-title></div>${ts(this)}</livelike-widget-header><livelike-widget-body>${this.widgetVariation&&this.optionsRenderer(this.options,this.customData,this.voted,this.widgetVariation)}</livelike-widget-body>${function(e,t,n,i){let r,o;return t&&(r=es(t.footer),o=es(t.betButton)),U`<style>.embet-widget livelike-widget-footer{display:flex;border-radius:0;padding:10px 16px;${r}}.embet-widget .footer-container{width:50%;display:flex;flex-direction:column;justify-content:center;margin:5px;padding:5px}.embet-widget .footer-text{height:12px;text-align:center;font-size:12px;color:#999;white-space:nowrap;margin-bottom:10px}.embet-widget .footer-sponsor{border:2px solid rgba(255,255,255,.2);max-height:40px;box-sizing:border-box}.embet-widget .footer-sponsor img{object-fit:contain;box-sizing:border-box;width:100%;height:100%;padding:4px 10px}.embet-widget .bet-button{border-radius:3rem;padding:10px;white-space:nowrap;border-width:2px;border-style:solid;${o}}.embet-widget .bet-button:hover{cursor:pointer}.embet-widget .bet-button a{text-decoration:none;font-weight:700;color:inherit}${i}</style><livelike-widget-footer><div class="footer-container"><div class="footer-text">SPONSORED BY</div><div class="footer-sponsor">${n&&n[0]&&n[0].logo_url?U`<img src="${n[0].logo_url}" alt="${n[0].name}">`:null}</div></div><div class="footer-container"><div class="footer-text"></div><button class="bet-button"><a target="_blank" href="${e||""}">PLACE BET</a></button></div></livelike-widget-footer>`}(this.place_bet_url,this.themeStyles,this.sponsors,this.customStyles)}<livelike-timer class="custom-timer"></livelike-timer></livelike-widget-root></template>`}}const is=(e,t)=>{const n=e.reduce(((e,t)=>e+t.vote_count),0);return n>0?Math.round(t.vote_count/n*100):0},rs=(e,t)=>{if(e&&e.betDetails){const n=e.betDetails.find((e=>e.description===t.description));if(n)return U` <div class="bet-details">${n.bet}</div> `}},os=(e,t,n)=>U`
390
390
  <div class="option-container" ?interacted=${n}>
391
391
  ${e&&e.map(((i,r)=>U`
392
392
  <livelike-option index=${r} .option=${i}>