@everymatrix/casino-engagement-suite-luckywheel 1.83.10 → 1.83.12

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.
@@ -0,0 +1 @@
1
+ import{r as t,h as i,g as e}from"./index-48c42d04.js";var s,r,n,a,o,h,c,l,d,u;!function(t){t.ActiveTickets="ActiveTickets",t.ImplicitTickets="ImplicitTickets",t.RemainingTimes="RemainingTimes"}(s||(s={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(r||(r={})),function(t){t.fulfilled="fulfilled",t.drawn="drawn"}(n||(n={})),function(t){t.noPrize="noprize",t.luckywheel="luckywheel",t.bonus="bonus"}(a||(a={})),function(t){t.Arrow="Arrow",t.Partition="Partition"}(o||(o={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(h||(h={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(c||(c={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(l||(l={})),function(t){t.launch="launch",t.loop="loop",t.halt="halt"}(d||(d={})),function(t){t.quad="quad",t.cubic="cubic",t.quart="quart",t.quint="quint",t.expo="expo",t.sine="sine",t.circ="circ"}(u||(u={}));const g=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},b=t=>new Promise((i=>{let e=document.createElementNS("http://www.w3.org/2000/svg","image");e.onload=()=>i(e),e.onerror=()=>i(e),e.href.baseVal=t})),p=t=>({x:t,y:t}),f=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),m={in:{quad:t=>Math.pow(t,2),cubic:t=>Math.pow(t,3),quart:t=>Math.pow(t,4),quint:t=>Math.pow(t,5),sine:t=>1-Math.cos(t*Math.PI/2),expo:t=>0===t?0:Math.pow(2,10*t-10),circ:t=>1-Math.sqrt(1-Math.pow(t,2))},out:{quad:t=>1-Math.pow(1-t,2),cubic:t=>1-Math.pow(1-t,3),quart:t=>1-Math.pow(1-t,4),quint:t=>1-Math.pow(1-t,5),sine:t=>Math.sin(t*Math.PI/2),expo:t=>1===t?1:1-Math.pow(2,-10*t),circ:t=>Math.sqrt(1-Math.pow(t-1,2))}},v={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},y={in:{quad:t=>2*t,cubic:t=>3*t**2,quart:t=>4*t**3,quint:t=>5*t**4,sine:t=>Math.PI/2*Math.sin(Math.PI/2*t),expo:t=>10*Math.LN2*2**(10*t-10),circ:t=>-.5*(1-t**2)**-.5},out:{cubic:t=>3*t**2-6*t+3}},x=[{launchTurns:5,launchSpeed:.2,loopSpeed:15,haltTurns:2,haltSpeed:.16},{launchTurns:2,launchSpeed:.5,loopSpeed:20,haltTurns:2,haltSpeed:.22},{launchTurns:6,launchSpeed:1.38,loopSpeed:45,haltTurns:6,haltSpeed:.5}],w=t=>Object.keys(t).map((i=>t[i]));var k;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(k||(k={}));class P{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:r}){this.arrowmode=h.DownFromTop,this.convertDegToArc=t=>t*Math.PI/180,this.convertArcToDeg=t=>180*t/Math.PI%360,this.getArcDelta=t=>2*Math.PI/t,this.findDeg=(t,i)=>t*this.convertArcToDeg(this.getArcDelta(i)),this.angleTransform=t=>{switch(t){case h.DownFromTop:case h.UpFromCenter:return-Math.PI/2;case h.DownFromCenter:case h.UpFromBottom:return Math.PI/2}},this.contentdirection=r,this.center=t/2,this.ratio=t/375,this.options=e,this.length=e.length,this.themeIndex=s,this.radius=i}get sizeImage(){const t=t=>48*this.ratio*5/t;if(this.length<=3)return t(4);switch(this.length){case 8:case 7:return 24*this.ratio;case 6:return 36*this.ratio;case 5:return 48*this.ratio;case 4:return 56*this.ratio;default:return t(this.length)}}getSizeImageByPartition(t){return this.options[t].Name?this.sizeImage/2:this.sizeImage}getSvgImageProps(t,i=1.25){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Name?this.radius-e/2-3*this.ratio:(this.radius-e/2)/Number(i)-3*this.ratio,Object.assign(Object.assign({},this.getPropsForPartitionInfo(t,this.getOffsetImage(e),s,l.outward)),{width:170===this.center?24:32,height:170===this.center?24:32})}getSvgTextProps(t,i){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Image?this.radius-e-6*this.ratio:this.radius-6*this.ratio,Object.assign({},this.getPropsForPartitionInfo(t,this.offsetText,s,void 0,i))}getSvgTextPropsAdjustedByImage(t,i){let e,s;this.options.length<=8?(e="Mobile"!==i?68:55,s=60):this.options.length<=12?(e=55,s="Mobile"!==i?60:40):this.options.length<=16&&(e="Mobile"!==i?53:47,s=60);const r=this.getSvgTextProps(t,{width:e,height:s});return Object.assign({},r)}get offsetText(){return{center:0,position:{x:0,y:0},transform:{x:0,y:0}}}getOffsetImage(t){return{center:0,position:{x:-1*t/2,y:-1*t/2},transform:{x:0,y:0}}}get direction(){return k.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+360*(void 0!==i?i:l[this.contentdirection])}getPartitionPositions(t,i,e){const s=this.angleTransform(this.arrowmode)+this.direction*t*2*Math.PI/this.length,r=((t,i,e)=>{const s=p(e);return{x:s.x+t*Math.cos(i),y:s.y+t*Math.sin(i)}})(i||this.radius-9*this.ratio,s,this.center+e.center);return{transformOrigin:f(r,e.transform),point:f(r,e.position)}}getPropsForPartitionInfo(t,i,e,s,r){const{point:n,transformOrigin:a}=this.getPartitionPositions(t,e,i),o=this.options.length>=12,h=this.options.length>=8&&this.options.length<12,c=this.options.some((t=>t.Image)),l=!this.options[t].Name,d=0===s?l?o?-4:h?0:4:o?170===this.center?-8:-11:h?170===this.center?-6:-8:170===this.center?-4:-6:-(null==r?void 0:r.width)/2||-30,u=0===s?l?170===this.center?46:46.5:170===this.center?75:81.5:c?this.options[t].Image?o?0:-10:o?10:5:o?10:h?20:30;return Object.assign(Object.assign({},n),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg) translate(${d}px, ${u}px)`,"transform-origin":`${g=a,Object.keys(g).map((t=>`${g[t]}px`)).join(" ")}`,height:`${null==r?void 0:r.height}px`,width:`${null==r?void 0:r.width}px`}});var g}getPartitionDraw(t){const i=p(this.center),e=p(this.radius),{point:s,pointNext:r}=((t,i,e,s)=>{const r=t=>((t,i,e,s)=>{const r=Math.PI/180*(360/i*(t-.5)-90),n=p(s),a=p(e);return{x:n.x+a.x*Math.cos(r),y:n.y+a.y*Math.sin(r)}})(t,i,e,s);return{point:r(t),pointNext:r(t+1)}})(t,this.length,this.radius,this.center);return{d:["M",...w(i),"L",...w(s),"A",...w(e),"0 0 1",...w(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(this.length-t,this.length)}getSpinnerProps(){const t=p(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class M{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=u.cubic,this.param=x[2],this.halt=(t,i=(()=>{}))=>{this.shouldHalt=()=>{this.step=d.halt,this.cb=()=>{i(),this.setDeg(t,0)},this.degTarget=t+360*this.param.haltTurns,this.continueRepeat()}},this.continueRepeat=()=>setTimeout((()=>this.ticker()),30),this.ticker=()=>{const t=this.param.loopSpeed,i=t=>33*v[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animate(e,this.deg,t,m.in[this.easingType],y.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animate(t,0,this.degTarget,m.out[this.easingType],y.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,v[this.easingType]),this.continueRepeat()};({[d.launch]:()=>{this.cb=()=>{this.step=d.loop,this.setDeg(t,v[this.easingType]),this.continueRepeat()},e()},[d.loop]:()=>{this.shouldHalt&&0===this.deg?this.shouldHalt():r()},[d.halt]:()=>{this.deg===360-t?s():r()}})[this.step]()},this.setDeg=(t,i)=>{this.deg=t,this.tick(t,i)},this.animateF=(t,i,e,s,r)=>{let n=null;const a=()=>{let o=(new Date).getTime();n||(n=o);const h=o-n,c=e*s(h/t)+i,l=Math.abs(r(h/t));this.setDeg(c,l),h<t?setTimeout((()=>a()),30):this.cb()};a()},this.animate=(t,i,e,s,r)=>{let n=null;window.cancelAnimationFrame(n);let a=null;const o=h=>{a||(a=h);const c=h-a,l=e*s(c/t)+i,d=Math.abs(r(c/t));this.setDeg(l,d),c<t?n=window.requestAnimationFrame(o):this.cb()};n=window.requestAnimationFrame(o)},this.tick=t.tick}launch(){this.shouldHalt=void 0,this.step=d.launch,this.ticker()}}const j=class{constructor(i){t(this,i),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.host.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderImage=(t,i)=>{const e=this.options[i].Image;g(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{this.spinable=!!(this.luckywheel.Current&&Number(this.luckywheel.Current.RemainingTimes)>0)},this.eventSpin=()=>{this.updateSpinable(),this.spinable&&!this.isSpinning&&(this.isSpinning=!0,this.spinContainer=this.svg.querySelector("g.PartitionsContainer"),this.spinner.launch(),window.postMessage({type:"SpinLuckyWheel",data:{lotteryProgramID:this.luckywheel.Program.Id}}))},this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.luckywheel=void 0,this.size="440",this.contentdirection="anticlockwise",this.limitStylingAppends=!1,this.isPartitionsCustomableReady=!1,this.isSpinning=!1,this.options=void 0,this.radius=.85*Number(this.size)/2,this.speed=0,this.settings=void 0,this.svg=void 0,this.spinContainer=void 0,this.spinable=void 0,this.spinner=void 0}handleEvent(t){const{type:i,data:e}=null==t?void 0:t.data;if("SpinLuckyWheelRes"===i&&this.isSpinning){const t=+e.Result.WheelOfFortunePartitionIndex||0;e.State===n.fulfilled?this.handleSpinResult(e,t):this.handleSpinError(t)}}handleSpinError(t){const i=this.settings.getDeg(t);this.spinner.halt(i,(()=>{this.isSpinning=!1,this.updateSpinable(),window.postMessage({type:"ShowLuckywheelRewardModal",data:{HasError:!0,NoSpinLeft:0===Number(this.luckywheel.Current.RemainingTimes)}})}))}handleSpinResult(t,i){if(this.luckywheel.Program.Id===t.LotteryProgramID){const e=this.settings.getDeg(i);this.spinner.halt(e,(()=>{var e;this.isSpinning=!1,this.updateSpinable();const s=this.luckywheel.Program.WheelOfFortune.Partitions[i],r=null===(e=t.Result.Outcomes)||void 0===e?void 0:e.some((t=>{var i;return(null===(i=t.Action)||void 0===i?void 0:i.Type)===a.noPrize})),n=(null==s?void 0:s.PrizeImage[this.language])||(null==s?void 0:s.PrizeImage["*"]);window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeText:(null==s?void 0:s.PrizeText[this.language])||(null==s?void 0:s.PrizeText["*"]),PrizeMessage:(null==s?void 0:s.Name[this.language])||(null==s?void 0:s.Name["*"]),NoPrize:r,HasError:!1,NoSpinLeft:0===Number(this.luckywheel.Current.RemainingTimes),Assets:n}})}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await(async(t,i)=>{let e=((t,i)=>t.map((t=>{const e={};return Object.keys(t).map((s=>{"object"==typeof t[s]&&t[s]&&(e["Image1"===s?"Image":s]=t[s][i]||t[s]["*"])})),e})))(t.Program.WheelOfFortune.Partitions,i);return e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?e.map((t=>{if(t.Image){const i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.href.baseVal=t.Image,Object.assign(Object.assign({},t),{Image:i})}return t})):await Promise.all(e.map((async t=>Object.assign(Object.assign({},t),await(async t=>t?{Image:await b(t)}:{})(t.Image))))),e})(this.luckywheel,c.en),this.settings=new P({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new M({tick:(t,i)=>{g(this.spinContainer,{style:[`transform: rotate(${t}deg)`,`height: ${this.size}px`,`width: ${this.size}px`].join(";")}),this.speed=.5*i}})}defineGeneralVariables(){return{"--length":`${this.options.length}`,"--radius":`${this.radius}`,"--ratio":""+Number(this.size)/480,"--size":`${this.size}`}}setSvgSize(t){if(!t||!this.size)return;const i=this.size.toString();t.getAttribute("width")!==i&&t.setAttribute("width",i),t.getAttribute("height")!==i&&t.setAttribute("height",i)}render(){const t={height:`${this.size}px`,width:`${this.size}px`};return i("div",{key:"e466a34c9a4526c2379aa601462c65cb65f5a445",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"04b74322b3651a364a92777984b008fe845c16f0",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",{key:"f18c832a86c1474e510cae219eae78b44667b07e",ref:this.setSvgSize.bind(this),class:"Bottom Customable"},i("div",{key:"b0adaa4e02d6394293ed3e4cc4a2331b46cc9fd1",style:t})),i("g",Object.assign({key:"9c08d5fa3cb3bde27b641f71fa2bbc0612b0b93f",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"cbdc31800e068702b0dc50ced9139c25e8e30785",class:"PartitionsBackgrounds"},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),"clip-path":`url(#clip${s})`,class:"PartitionBackground Customable",style:Object.assign({"--index":s.toString()},t)},i("div",{style:t}))))),i("g",{key:"af8c9da33f138918e81b80ae691c9a58bbd9232b",class:"PartitionsBackgroundStrokes"},this.options.map(((t,e)=>i("path",Object.assign({class:"PartitionBackgroundStroke"},this.settings.getPartitionDraw(e),{width:this.size,height:this.size}))))),i("g",{key:"6ccca1f63545eae71d024ee5da59d0149607e3d1",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.Image&&i("g",Object.assign({class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)},this.settings.getSvgImageProps(e))),t.Name&&i("foreignObject",Object.assign({class:"PartitionText",ref:t=>{if(t){const i=this.options.length>6?"55":"75";t.setAttribute("width",i),t.setAttribute("height",i)}}},this.settings.getSvgTextPropsAdjustedByImage(e,this.device)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:`PartitionTextEntity${"clockwise"===this.settings.contentdirection?"":" Anticlockwise"} ${this.device}`,innerHTML:t.Name})))])))),i("g",{key:"a367d23565a8cb54f6435cb120f377d934ebeca1",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable1:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition1 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("g",{key:"dbccc30fa53f944b63454d83cab4cae7ab787cb0",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable2:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition2 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("foreignObject",{key:"6ad80cb9533ec295bad090831532250cd35afd7e",ref:this.setSvgSize.bind(this),class:"Middle Customable",style:t},i("div",{key:"ba0afa07f997acf338118c1e07e4ad5446db65c1",style:t})),i("foreignObject",{key:"766381cdd2cc4b9c5243a0a78306e8329a208693",ref:this.setSvgSize.bind(this),class:"Top Customable",style:t},i("div",{key:"83df3eb57328d3eda101f90515ef6993253513e9",style:t})),i("g",{key:"d2c1b67fddb67ccc613c31b06a9daa6921eba5f2",class:{spinning:this.isSpinning,Center:!0}},i("foreignObject",{key:"a3353eb0e5d764c867f8193a5d8f7c96b18add80",ref:t=>{t&&(t.setAttribute("width","100"),t.setAttribute("height","100"))},style:{transform:`translate(${Number(this.size)/2-50}px, ${Number(this.size)/2-50}px)`}},i("div",{key:"38948f9a684ef29dc3ff0c4f8d98972cc2b32e25",style:{width:"100px",height:"100px",cursor:"pointer"},onClick:this.eventSpin}))),i("g",{key:"6f0a40abf872f17825ecd63a25970a0a89417728"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};j.style=':host{font-family:Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.LotteryProgramWof{background:var(--emw--color-contrast, #07072A);display:flex;align-items:center;flex-direction:column;padding:20px 0}main{max-width:600px;width:100%;display:flex;justify-content:space-around;min-height:200px}svg{transition:opacity 0.3s}.WheelContainer{text-align:center}.FortuneContainer{width:100%;display:flex;align-items:center;flex-direction:column}.Center{cursor:pointer;transition:filter;transition-duration:1s}.Center.disabled{filter:grayscale(80%)}.Center .CenterCircle{fill:#3CE4BB;stroke:rgb(150, 54, 88);stroke-width:2px;cursor:pointer;transition:fill;transition-duration:1s}.Center .CenterText{fill:#FFFFFF}.PointerPartition{opacity:0.3;fill:lightgoldenrodyellow;stroke:red;stroke-width:6px;stroke-dasharray:12}.Current{color:#FFFFFF}.PartitionText{color:#FFFFFF;font-style:normal;font-weight:700;text-anchor:end;text-shadow:0px 3px #000;dominant-baseline:central;word-wrap:break-word}.PartitionsShadow{background-blend-mode:multiply;mix-blend-mode:multiply}.PartitionTextEntityContainer{height:100%;display:flex;align-items:center}.PartitionTextEntity{width:100%}.PartitionTextEntity.Anticlockwise{text-align:end}foreignObject.Bottom div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-bg.svg");background-size:calc(var(--radius) * 2px + var(--ratio) * 20px);background-position:center}foreignObject.Middle div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-spin.svg"), url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-pointer.svg");background-position:center, center 5px}foreignObject.Top{mix-blend-mode:multiply}foreignObject.Top div{background-image:var(--img-theme-shadow);background-position:center;background-size:calc(var(--radius) * 2px)}foreignObject.Partition1 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc(var(--index) * 360deg / var(--length)))}foreignObject.Partition2 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc((var(--index) + 0.5) * 360deg / var(--length)))}foreignObject.PointerArea{mix-blend-mode:screen}foreignObject.PointerArea div{background-image:var(--img-theme-pointer-area);background-position:center -3px;background-size:51%}foreignObject.Partition1 div,foreignObject.Partition2 div{transform-origin:center}.PartitionsCustomable1 div,.PartitionsCustomable2 div{visibility:hidden}.PartitionsCustomable1 div.active,.PartitionsCustomable2 div.active{visibility:visible}foreignObject.Customable{overflow:visible}foreignObject.Customable div{background-repeat:no-repeat}.PartitionBackground div{background-size:calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);background-position:center}.PartitionBackground:nth-child(2n) div{background:var(--emw--color-primary, #3F2E75)}.PartitionBackground:nth-child(2n+1) div{background:var(--emw--color-secondary, #9482CE)}.PartitionBackground div{transform-origin:center}.PartitionBackgroundStroke{fill:transparent;stroke:var(--emw--color-background-secondary, #251D3E);stroke-width:3px;stroke-dasharray:none}.PointerPartitionFrame{stroke:#FFDD64;fill:transparent;stroke-dasharray:var(--radius) calc(6.2831853072 / var(--length) * var(--radius));stroke-width:0px}.PointerPartitionFrame.active{stroke-width:3px}.WheelContainer.Mobile foreignObject.Middle div{background-size:95px, 38px}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity{text-align:center;text-transform:uppercase;text-shadow:none;font-size:var(--emw--font-size-small, 10px);font-weight:700}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity.Mobile{font-size:var(--emw--font-size-x-small, 8px)}';export{j as C}
@@ -1 +1 @@
1
- export{C as casino_engagement_suite_luckywheel}from"./casino-engagement-suite-luckywheel-3158a900.js";import"./index-48c42d04.js";
1
+ export{C as casino_engagement_suite_luckywheel}from"./casino-engagement-suite-luckywheel-cee1ecdc.js";import"./index-48c42d04.js";
@@ -1 +1 @@
1
- export{C as CasinoEngagementSuiteLuckywheel}from"./casino-engagement-suite-luckywheel-3158a900.js";import"./index-48c42d04.js";
1
+ export{C as CasinoEngagementSuiteLuckywheel}from"./casino-engagement-suite-luckywheel-cee1ecdc.js";import"./index-48c42d04.js";
@@ -122,19 +122,6 @@ const pointPlus = (point1, point2) => ({
122
122
  x: point1.x + point2.x,
123
123
  y: point1.y + point2.y
124
124
  });
125
- const optionCompliment = {
126
- Image: '',
127
- Name: 'Thank you',
128
- PrizeText: '',
129
- PrizeImage: ''
130
- };
131
- const getSumProbability = (partitions) => {
132
- let probabilityAll = 0;
133
- partitions.map(partition => {
134
- probabilityAll += Number(partition.probability);
135
- });
136
- return probabilityAll;
137
- };
138
125
  const getOptionsFromPartitions = (partitions, lang) => {
139
126
  const options = partitions.map(_partition => {
140
127
  const option = {};
@@ -147,9 +134,6 @@ const getOptionsFromPartitions = (partitions, lang) => {
147
134
  });
148
135
  return option;
149
136
  });
150
- if (getSumProbability(partitions) < 1) {
151
- options.push(optionCompliment);
152
- }
153
137
  return options;
154
138
  };
155
139
  const preloadImage = async (src) => {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-d39416df.js');
5
+ const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-ef324256.js');
6
6
  require('./index-6096cc4b.js');
7
7
 
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-d39416df.js');
5
+ const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-ef324256.js');
6
6
  require('./index-6096cc4b.js');
7
7
 
8
8
 
@@ -67,19 +67,6 @@ export const pointPlus = (point1, point2) => ({
67
67
  x: point1.x + point2.x,
68
68
  y: point1.y + point2.y
69
69
  });
70
- const optionCompliment = {
71
- Image: '',
72
- Name: 'Thank you',
73
- PrizeText: '',
74
- PrizeImage: ''
75
- };
76
- const getSumProbability = (partitions) => {
77
- let probabilityAll = 0;
78
- partitions.map(partition => {
79
- probabilityAll += Number(partition.probability);
80
- });
81
- return probabilityAll;
82
- };
83
70
  const getOptionsFromPartitions = (partitions, lang) => {
84
71
  const options = partitions.map(_partition => {
85
72
  const option = {};
@@ -92,9 +79,6 @@ const getOptionsFromPartitions = (partitions, lang) => {
92
79
  });
93
80
  return option;
94
81
  });
95
- if (getSumProbability(partitions) < 1) {
96
- options.push(optionCompliment);
97
- }
98
82
  return options;
99
83
  };
100
84
  const preloadImage = async (src) => {
@@ -120,19 +120,6 @@ const pointPlus = (point1, point2) => ({
120
120
  x: point1.x + point2.x,
121
121
  y: point1.y + point2.y
122
122
  });
123
- const optionCompliment = {
124
- Image: '',
125
- Name: 'Thank you',
126
- PrizeText: '',
127
- PrizeImage: ''
128
- };
129
- const getSumProbability = (partitions) => {
130
- let probabilityAll = 0;
131
- partitions.map(partition => {
132
- probabilityAll += Number(partition.probability);
133
- });
134
- return probabilityAll;
135
- };
136
123
  const getOptionsFromPartitions = (partitions, lang) => {
137
124
  const options = partitions.map(_partition => {
138
125
  const option = {};
@@ -145,9 +132,6 @@ const getOptionsFromPartitions = (partitions, lang) => {
145
132
  });
146
133
  return option;
147
134
  });
148
- if (getSumProbability(partitions) < 1) {
149
- options.push(optionCompliment);
150
- }
151
135
  return options;
152
136
  };
153
137
  const preloadImage = async (src) => {
@@ -1,2 +1,2 @@
1
- export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-3158a900.js';
1
+ export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-cee1ecdc.js';
2
2
  import './index-48c42d04.js';
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-3158a900.js';
1
+ export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-cee1ecdc.js';
2
2
  import './index-48c42d04.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-luckywheel",
3
- "version": "1.83.10",
3
+ "version": "1.83.12",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",
@@ -1 +0,0 @@
1
- import{r as t,h as i,g as e}from"./index-48c42d04.js";var s,r,n,a,o,h,c,l,d,u;!function(t){t.ActiveTickets="ActiveTickets",t.ImplicitTickets="ImplicitTickets",t.RemainingTimes="RemainingTimes"}(s||(s={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(r||(r={})),function(t){t.fulfilled="fulfilled",t.drawn="drawn"}(n||(n={})),function(t){t.noPrize="noprize",t.luckywheel="luckywheel",t.bonus="bonus"}(a||(a={})),function(t){t.Arrow="Arrow",t.Partition="Partition"}(o||(o={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(h||(h={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(c||(c={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(l||(l={})),function(t){t.launch="launch",t.loop="loop",t.halt="halt"}(d||(d={})),function(t){t.quad="quad",t.cubic="cubic",t.quart="quart",t.quint="quint",t.expo="expo",t.sine="sine",t.circ="circ"}(u||(u={}));const g=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},b=t=>new Promise((i=>{let e=document.createElementNS("http://www.w3.org/2000/svg","image");e.onload=()=>i(e),e.onerror=()=>i(e),e.href.baseVal=t})),p=t=>({x:t,y:t}),f=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),m={Image:"",Name:"Thank you",PrizeText:"",PrizeImage:""},v=async(t,i)=>{let e=((t,i)=>{const e=t.map((t=>{const e={};return Object.keys(t).map((s=>{"object"==typeof t[s]&&t[s]&&(e["Image1"===s?"Image":s]=t[s][i]||t[s]["*"])})),e}));return(t=>{let i=0;return t.map((t=>{i+=Number(t.probability)})),i})(t)<1&&e.push(m),e})(t.Program.WheelOfFortune.Partitions,i);return e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?e.map((t=>{if(t.Image){const i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.href.baseVal=t.Image,Object.assign(Object.assign({},t),{Image:i})}return t})):await Promise.all(e.map((async t=>Object.assign(Object.assign({},t),await(async t=>t?{Image:await b(t)}:{})(t.Image))))),e},y={in:{quad:t=>Math.pow(t,2),cubic:t=>Math.pow(t,3),quart:t=>Math.pow(t,4),quint:t=>Math.pow(t,5),sine:t=>1-Math.cos(t*Math.PI/2),expo:t=>0===t?0:Math.pow(2,10*t-10),circ:t=>1-Math.sqrt(1-Math.pow(t,2))},out:{quad:t=>1-Math.pow(1-t,2),cubic:t=>1-Math.pow(1-t,3),quart:t=>1-Math.pow(1-t,4),quint:t=>1-Math.pow(1-t,5),sine:t=>Math.sin(t*Math.PI/2),expo:t=>1===t?1:1-Math.pow(2,-10*t),circ:t=>Math.sqrt(1-Math.pow(t-1,2))}},x={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},w={in:{quad:t=>2*t,cubic:t=>3*t**2,quart:t=>4*t**3,quint:t=>5*t**4,sine:t=>Math.PI/2*Math.sin(Math.PI/2*t),expo:t=>10*Math.LN2*2**(10*t-10),circ:t=>-.5*(1-t**2)**-.5},out:{cubic:t=>3*t**2-6*t+3}},k=[{launchTurns:5,launchSpeed:.2,loopSpeed:15,haltTurns:2,haltSpeed:.16},{launchTurns:2,launchSpeed:.5,loopSpeed:20,haltTurns:2,haltSpeed:.22},{launchTurns:6,launchSpeed:1.38,loopSpeed:45,haltTurns:6,haltSpeed:.5}],P=t=>Object.keys(t).map((i=>t[i]));var M;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(M||(M={}));class j{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:r}){this.arrowmode=h.DownFromTop,this.convertDegToArc=t=>t*Math.PI/180,this.convertArcToDeg=t=>180*t/Math.PI%360,this.getArcDelta=t=>2*Math.PI/t,this.findDeg=(t,i)=>t*this.convertArcToDeg(this.getArcDelta(i)),this.angleTransform=t=>{switch(t){case h.DownFromTop:case h.UpFromCenter:return-Math.PI/2;case h.DownFromCenter:case h.UpFromBottom:return Math.PI/2}},this.contentdirection=r,this.center=t/2,this.ratio=t/375,this.options=e,this.length=e.length,this.themeIndex=s,this.radius=i}get sizeImage(){const t=t=>48*this.ratio*5/t;if(this.length<=3)return t(4);switch(this.length){case 8:case 7:return 24*this.ratio;case 6:return 36*this.ratio;case 5:return 48*this.ratio;case 4:return 56*this.ratio;default:return t(this.length)}}getSizeImageByPartition(t){return this.options[t].Name?this.sizeImage/2:this.sizeImage}getSvgImageProps(t,i=1.25){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Name?this.radius-e/2-3*this.ratio:(this.radius-e/2)/Number(i)-3*this.ratio,Object.assign(Object.assign({},this.getPropsForPartitionInfo(t,this.getOffsetImage(e),s,l.outward)),{width:170===this.center?24:32,height:170===this.center?24:32})}getSvgTextProps(t,i){const e=this.getSizeImageByPartition(t);let s;return s=this.options[t].Image?this.radius-e-6*this.ratio:this.radius-6*this.ratio,Object.assign({},this.getPropsForPartitionInfo(t,this.offsetText,s,void 0,i))}getSvgTextPropsAdjustedByImage(t,i){let e,s;this.options.length<=8?(e="Mobile"!==i?68:55,s=60):this.options.length<=12?(e=55,s="Mobile"!==i?60:40):this.options.length<=16&&(e="Mobile"!==i?53:47,s=60);const r=this.getSvgTextProps(t,{width:e,height:s});return Object.assign({},r)}get offsetText(){return{center:0,position:{x:0,y:0},transform:{x:0,y:0}}}getOffsetImage(t){return{center:0,position:{x:-1*t/2,y:-1*t/2},transform:{x:0,y:0}}}get direction(){return M.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+360*(void 0!==i?i:l[this.contentdirection])}getPartitionPositions(t,i,e){const s=this.angleTransform(this.arrowmode)+this.direction*t*2*Math.PI/this.length,r=((t,i,e)=>{const s=p(e);return{x:s.x+t*Math.cos(i),y:s.y+t*Math.sin(i)}})(i||this.radius-9*this.ratio,s,this.center+e.center);return{transformOrigin:f(r,e.transform),point:f(r,e.position)}}getPropsForPartitionInfo(t,i,e,s,r){const{point:n,transformOrigin:a}=this.getPartitionPositions(t,e,i),o=this.options.length>=12,h=this.options.length>=8&&this.options.length<12,c=this.options.some((t=>t.Image)),l=!this.options[t].Name,d=0===s?l?o?-4:h?0:4:o?170===this.center?-8:-11:h?170===this.center?-6:-8:170===this.center?-4:-6:-(null==r?void 0:r.width)/2||-30,u=0===s?l?170===this.center?46:46.5:170===this.center?75:81.5:c?this.options[t].Image?o?0:-10:o?10:5:o?10:h?20:30;return Object.assign(Object.assign({},n),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg) translate(${d}px, ${u}px)`,"transform-origin":`${g=a,Object.keys(g).map((t=>`${g[t]}px`)).join(" ")}`,height:`${null==r?void 0:r.height}px`,width:`${null==r?void 0:r.width}px`}});var g}getPartitionDraw(t){const i=p(this.center),e=p(this.radius),{point:s,pointNext:r}=((t,i,e,s)=>{const r=t=>((t,i,e,s)=>{const r=Math.PI/180*(360/i*(t-.5)-90),n=p(s),a=p(e);return{x:n.x+a.x*Math.cos(r),y:n.y+a.y*Math.sin(r)}})(t,i,e,s);return{point:r(t),pointNext:r(t+1)}})(t,this.length,this.radius,this.center);return{d:["M",...P(i),"L",...P(s),"A",...P(e),"0 0 1",...P(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(this.length-t,this.length)}getSpinnerProps(){const t=p(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class O{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=u.cubic,this.param=k[2],this.halt=(t,i=(()=>{}))=>{this.shouldHalt=()=>{this.step=d.halt,this.cb=()=>{i(),this.setDeg(t,0)},this.degTarget=t+360*this.param.haltTurns,this.continueRepeat()}},this.continueRepeat=()=>setTimeout((()=>this.ticker()),30),this.ticker=()=>{const t=this.param.loopSpeed,i=t=>33*x[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animate(e,this.deg,t,y.in[this.easingType],w.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animate(t,0,this.degTarget,y.out[this.easingType],w.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,x[this.easingType]),this.continueRepeat()};({[d.launch]:()=>{this.cb=()=>{this.step=d.loop,this.setDeg(t,x[this.easingType]),this.continueRepeat()},e()},[d.loop]:()=>{this.shouldHalt&&0===this.deg?this.shouldHalt():r()},[d.halt]:()=>{this.deg===360-t?s():r()}})[this.step]()},this.setDeg=(t,i)=>{this.deg=t,this.tick(t,i)},this.animateF=(t,i,e,s,r)=>{let n=null;const a=()=>{let o=(new Date).getTime();n||(n=o);const h=o-n,c=e*s(h/t)+i,l=Math.abs(r(h/t));this.setDeg(c,l),h<t?setTimeout((()=>a()),30):this.cb()};a()},this.animate=(t,i,e,s,r)=>{let n=null;window.cancelAnimationFrame(n);let a=null;const o=h=>{a||(a=h);const c=h-a,l=e*s(c/t)+i,d=Math.abs(r(c/t));this.setDeg(l,d),c<t?n=window.requestAnimationFrame(o):this.cb()};n=window.requestAnimationFrame(o)},this.tick=t.tick}launch(){this.shouldHalt=void 0,this.step=d.launch,this.ticker()}}const C=class{constructor(i){t(this,i),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.host.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderImage=(t,i)=>{const e=this.options[i].Image;g(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{this.spinable=!!(this.luckywheel.Current&&Number(this.luckywheel.Current.RemainingTimes)>0)},this.eventSpin=()=>{this.updateSpinable(),this.spinable&&!this.isSpinning&&(this.isSpinning=!0,this.spinContainer=this.svg.querySelector("g.PartitionsContainer"),this.spinner.launch(),window.postMessage({type:"SpinLuckyWheel",data:{lotteryProgramID:this.luckywheel.Program.Id}}))},this.clientStyling="",this.clientStylingUrl="",this.language="en",this.device="Mobile",this.luckywheel=void 0,this.size="440",this.contentdirection="anticlockwise",this.limitStylingAppends=!1,this.isPartitionsCustomableReady=!1,this.isSpinning=!1,this.options=void 0,this.radius=.85*Number(this.size)/2,this.speed=0,this.settings=void 0,this.svg=void 0,this.spinContainer=void 0,this.spinable=void 0,this.spinner=void 0}handleEvent(t){const{type:i,data:e}=null==t?void 0:t.data;if("SpinLuckyWheelRes"===i&&this.isSpinning){const t=+e.Result.WheelOfFortunePartitionIndex||0;e.State===n.fulfilled?this.handleSpinResult(e,t):this.handleSpinError(t)}}handleSpinError(t){const i=this.settings.getDeg(t);this.spinner.halt(i,(()=>{this.isSpinning=!1,this.updateSpinable(),window.postMessage({type:"ShowLuckywheelRewardModal",data:{HasError:!0,NoSpinLeft:0===Number(this.luckywheel.Current.RemainingTimes)}})}))}handleSpinResult(t,i){if(this.luckywheel.Program.Id===t.LotteryProgramID){const e=this.settings.getDeg(i);this.spinner.halt(e,(()=>{var e;this.isSpinning=!1,this.updateSpinable();const s=this.luckywheel.Program.WheelOfFortune.Partitions[i],r=null===(e=t.Result.Outcomes)||void 0===e?void 0:e.some((t=>{var i;return(null===(i=t.Action)||void 0===i?void 0:i.Type)===a.noPrize})),n=(null==s?void 0:s.PrizeImage[this.language])||(null==s?void 0:s.PrizeImage["*"]);window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeText:(null==s?void 0:s.PrizeText[this.language])||(null==s?void 0:s.PrizeText["*"]),PrizeMessage:(null==s?void 0:s.Name[this.language])||(null==s?void 0:s.Name["*"]),NoPrize:r,HasError:!1,NoSpinLeft:0===Number(this.luckywheel.Current.RemainingTimes),Assets:n}})}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await v(this.luckywheel,c.en),this.settings=new j({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new O({tick:(t,i)=>{g(this.spinContainer,{style:[`transform: rotate(${t}deg)`,`height: ${this.size}px`,`width: ${this.size}px`].join(";")}),this.speed=.5*i}})}defineGeneralVariables(){return{"--length":`${this.options.length}`,"--radius":`${this.radius}`,"--ratio":""+Number(this.size)/480,"--size":`${this.size}`}}setSvgSize(t){if(!t||!this.size)return;const i=this.size.toString();t.getAttribute("width")!==i&&t.setAttribute("width",i),t.getAttribute("height")!==i&&t.setAttribute("height",i)}render(){const t={height:`${this.size}px`,width:`${this.size}px`};return i("div",{key:"e466a34c9a4526c2379aa601462c65cb65f5a445",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"04b74322b3651a364a92777984b008fe845c16f0",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",{key:"f18c832a86c1474e510cae219eae78b44667b07e",ref:this.setSvgSize.bind(this),class:"Bottom Customable"},i("div",{key:"b0adaa4e02d6394293ed3e4cc4a2331b46cc9fd1",style:t})),i("g",Object.assign({key:"9c08d5fa3cb3bde27b641f71fa2bbc0612b0b93f",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"cbdc31800e068702b0dc50ced9139c25e8e30785",class:"PartitionsBackgrounds"},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),"clip-path":`url(#clip${s})`,class:"PartitionBackground Customable",style:Object.assign({"--index":s.toString()},t)},i("div",{style:t}))))),i("g",{key:"af8c9da33f138918e81b80ae691c9a58bbd9232b",class:"PartitionsBackgroundStrokes"},this.options.map(((t,e)=>i("path",Object.assign({class:"PartitionBackgroundStroke"},this.settings.getPartitionDraw(e),{width:this.size,height:this.size}))))),i("g",{key:"6ccca1f63545eae71d024ee5da59d0149607e3d1",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.Image&&i("g",Object.assign({class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)},this.settings.getSvgImageProps(e))),t.Name&&i("foreignObject",Object.assign({class:"PartitionText",ref:t=>{if(t){const i=this.options.length>6?"55":"75";t.setAttribute("width",i),t.setAttribute("height",i)}}},this.settings.getSvgTextPropsAdjustedByImage(e,this.device)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:`PartitionTextEntity${"clockwise"===this.settings.contentdirection?"":" Anticlockwise"} ${this.device}`,innerHTML:t.Name})))])))),i("g",{key:"a367d23565a8cb54f6435cb120f377d934ebeca1",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable1:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition1 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("g",{key:"dbccc30fa53f944b63454d83cab4cae7ab787cb0",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable2:!0}},this.options.map(((e,s)=>i("foreignObject",{ref:this.setSvgSize.bind(this),class:"Partition2 Customable",style:{"--index":s.toString()}},i("div",{style:t}))))),i("foreignObject",{key:"6ad80cb9533ec295bad090831532250cd35afd7e",ref:this.setSvgSize.bind(this),class:"Middle Customable",style:t},i("div",{key:"ba0afa07f997acf338118c1e07e4ad5446db65c1",style:t})),i("foreignObject",{key:"766381cdd2cc4b9c5243a0a78306e8329a208693",ref:this.setSvgSize.bind(this),class:"Top Customable",style:t},i("div",{key:"83df3eb57328d3eda101f90515ef6993253513e9",style:t})),i("g",{key:"d2c1b67fddb67ccc613c31b06a9daa6921eba5f2",class:{spinning:this.isSpinning,Center:!0}},i("foreignObject",{key:"a3353eb0e5d764c867f8193a5d8f7c96b18add80",ref:t=>{t&&(t.setAttribute("width","100"),t.setAttribute("height","100"))},style:{transform:`translate(${Number(this.size)/2-50}px, ${Number(this.size)/2-50}px)`}},i("div",{key:"38948f9a684ef29dc3ff0c4f8d98972cc2b32e25",style:{width:"100px",height:"100px",cursor:"pointer"},onClick:this.eventSpin}))),i("g",{key:"6f0a40abf872f17825ecd63a25970a0a89417728"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};C.style=':host{font-family:Montserrat, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}.LotteryProgramWof{background:var(--emw--color-contrast, #07072A);display:flex;align-items:center;flex-direction:column;padding:20px 0}main{max-width:600px;width:100%;display:flex;justify-content:space-around;min-height:200px}svg{transition:opacity 0.3s}.WheelContainer{text-align:center}.FortuneContainer{width:100%;display:flex;align-items:center;flex-direction:column}.Center{cursor:pointer;transition:filter;transition-duration:1s}.Center.disabled{filter:grayscale(80%)}.Center .CenterCircle{fill:#3CE4BB;stroke:rgb(150, 54, 88);stroke-width:2px;cursor:pointer;transition:fill;transition-duration:1s}.Center .CenterText{fill:#FFFFFF}.PointerPartition{opacity:0.3;fill:lightgoldenrodyellow;stroke:red;stroke-width:6px;stroke-dasharray:12}.Current{color:#FFFFFF}.PartitionText{color:#FFFFFF;font-style:normal;font-weight:700;text-anchor:end;text-shadow:0px 3px #000;dominant-baseline:central;word-wrap:break-word}.PartitionsShadow{background-blend-mode:multiply;mix-blend-mode:multiply}.PartitionTextEntityContainer{height:100%;display:flex;align-items:center}.PartitionTextEntity{width:100%}.PartitionTextEntity.Anticlockwise{text-align:end}foreignObject.Bottom div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-bg.svg");background-size:calc(var(--radius) * 2px + var(--ratio) * 20px);background-position:center}foreignObject.Middle div{background-image:url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-spin.svg"), url("https://static.everymatrix.com/gic/img/engagement-suite/bar/luckywheel/luckywheel-pointer.svg");background-position:center, center 5px}foreignObject.Top{mix-blend-mode:multiply}foreignObject.Top div{background-image:var(--img-theme-shadow);background-position:center;background-size:calc(var(--radius) * 2px)}foreignObject.Partition1 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc(var(--index) * 360deg / var(--length)))}foreignObject.Partition2 div{background-image:var(--img-theme-partition-light);background-position:center calc((var(--size) / 2 - var(--radius)) * 1px - var(--ratio) * 22px);transform:rotate(calc((var(--index) + 0.5) * 360deg / var(--length)))}foreignObject.PointerArea{mix-blend-mode:screen}foreignObject.PointerArea div{background-image:var(--img-theme-pointer-area);background-position:center -3px;background-size:51%}foreignObject.Partition1 div,foreignObject.Partition2 div{transform-origin:center}.PartitionsCustomable1 div,.PartitionsCustomable2 div{visibility:hidden}.PartitionsCustomable1 div.active,.PartitionsCustomable2 div.active{visibility:visible}foreignObject.Customable{overflow:visible}foreignObject.Customable div{background-repeat:no-repeat}.PartitionBackground div{background-size:calc(var(--radius) * 2 / var(--size) * 100%) calc(var(--radius) * 2 / var(--size) * 100%);background-position:center}.PartitionBackground:nth-child(2n) div{background:var(--emw--color-primary, #3F2E75)}.PartitionBackground:nth-child(2n+1) div{background:var(--emw--color-secondary, #9482CE)}.PartitionBackground div{transform-origin:center}.PartitionBackgroundStroke{fill:transparent;stroke:var(--emw--color-background-secondary, #251D3E);stroke-width:3px;stroke-dasharray:none}.PointerPartitionFrame{stroke:#FFDD64;fill:transparent;stroke-dasharray:var(--radius) calc(6.2831853072 / var(--length) * var(--radius));stroke-width:0px}.PointerPartitionFrame.active{stroke-width:3px}.WheelContainer.Mobile foreignObject.Middle div{background-size:95px, 38px}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity{text-align:center;text-transform:uppercase;text-shadow:none;font-size:var(--emw--font-size-small, 10px);font-weight:700}.PartitionText .PartitionTextEntityContainer .PartitionTextEntity.Mobile{font-size:var(--emw--font-size-x-small, 8px)}';export{C}