@everymatrix/casino-engagement-suite-luckywheel 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel-58f82f53.js +1 -0
  2. package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.entry.js +1 -1
  3. package/dist/casino-engagement-suite-luckywheel/index.esm.js +1 -1
  4. package/dist/cjs/{casino-engagement-suite-luckywheel-4bf8c89e.js → casino-engagement-suite-luckywheel-7ce4e5e1.js} +15 -14
  5. package/dist/cjs/casino-engagement-suite-luckywheel.cjs.entry.js +1 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/collection/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.js +15 -14
  8. package/dist/esm/{casino-engagement-suite-luckywheel-9ebd9cfc.js → casino-engagement-suite-luckywheel-58f82f53.js} +15 -14
  9. package/dist/esm/casino-engagement-suite-luckywheel.entry.js +1 -1
  10. package/dist/esm/index.js +1 -1
  11. package/dist/types/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.d.ts +2 -2
  12. package/package.json +1 -1
  13. package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel-9ebd9cfc.js +0 -1
  14. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/libs/common/src/storybook/storybook-utils.d.ts +0 -0
  15. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +0 -0
  16. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +0 -0
  17. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/main.d.ts +0 -0
  18. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/storybook/preview.d.ts +0 -0
  19. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/index.d.ts +0 -0
  20. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  21. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  22. /package/dist/types/Users/{maria.bumbar/Desktop/Widgets & Template → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -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,d,l;!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.Arrow="Arrow",t.Partition="Partition"}(a||(a={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(o||(o={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(h||(h={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(c||(c={})),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"}(l||(l={}));const u=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},g=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})),b=t=>({x:t,y:t}),f=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),p={Image:"",Name:"Thank you",PrizeText:"",PrizeImage:""},m=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(p),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 g(t)}:{})(t.Image))))),e},v={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))}},y={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},x={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}},w=[{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}],k=t=>Object.keys(t).map((i=>t[i]));var P;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(P||(P={}));class M{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:r}){this.arrowmode=o.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 o.DownFromTop:case o.UpFromCenter:return-Math.PI/2;case o.DownFromCenter:case o.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,c.outward)),{width:e,height:e})}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){const i=this.getSvgTextProps(t,this.options[t].Image?80:100);return Object.assign({},i)}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 P.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+90*(void 0!==i?i:c[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=b(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);return Object.assign(Object.assign({},n),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg) translate(${"clockwise"===this.contentdirection?n.x:n.x-100}px, ${n.y-50}px)`,"transform-origin":`${o=a,Object.keys(o).map((t=>`${o[t]}px`)).join(" ")}`,height:`${r}px`,width:`${r}px`}});var o}getPartitionDraw(t){const i=b(this.center),e=b(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=b(s),a=b(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",...k(i),"L",...k(s),"A",...k(e),"0 0 1",...k(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(this.length-t,this.length)}getSpinnerProps(){const t=b(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class j{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=l.cubic,this.param=w[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*y[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animateF(e,this.deg,t,v.in[this.easingType],x.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animateF(t,0,this.degTarget,v.out[this.easingType],x.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,y[this.easingType]),this.continueRepeat()};({[d.launch]:()=>{this.cb=()=>{this.step=d.loop,this.setDeg(t,y[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,d=Math.abs(r(h/t));this.setDeg(c,d),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,d=e*s(c/t)+i,l=Math.abs(r(c/t));this.setDeg(d,l),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 O=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;u(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{if(this.luckywheel.Current){if(Number(this.luckywheel.Current.RemainingTimes)>0)return void(this.spinable=!0);window.postMessage({type:"ShowNoSpinLeftModal"})}this.spinable=!1},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}})}))}handleSpinResult(t,i){if(this.luckywheel.Program.Id===t.LotteryProgramID){const t=this.settings.getDeg(i);this.spinner.halt(t,(()=>{this.isSpinning=!1,this.updateSpinable();const t=this.luckywheel.Program.WheelOfFortune.Partitions[i];window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeText:(null==t?void 0:t.PrizeText[this.language])||(null==t?void 0:t.PrizeText["*"]),PrizeMessage:(null==t?void 0:t.Name[this.language])||(null==t?void 0:t.Name["*"]),HasError:!1}})}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await m(this.luckywheel,h.en),this.settings=new M({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new j({tick:(t,i)=>{u(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:"8f07f4b736611f24d8fdab3c648b682dd03010c8",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"5a904e1a93aee08657391d09fa40dbfc83504892",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",{key:"2f579e8195244078a65e4db7a6255af4e4fe517e",ref:this.setSvgSize.bind(this),class:"Bottom Customable"},i("div",{key:"d6ee2eae87c4b80ab9335a459fe597037d5321d1",style:t})),i("g",Object.assign({key:"661e946d154c399facffc6963bbb10544ef1b55e",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"591e8de5dd55dbd016669f7d144664b9c921d4df",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:"ac2a4973a712841b81c4ff0609f5f3f5c8b17bf0",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:"afb0c09ec8e53ed97289c5bf186417c2078c4014",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.Image&&i("g",{class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)}),t.Name&&i("foreignObject",Object.assign({class:"PartitionText",ref:t=>{if(t){const i=this.options[e].Image?"80":"100";t.setAttribute("width",i),t.setAttribute("height",i)}}},this.settings.getSvgTextPropsAdjustedByImage(e)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:"PartitionTextEntity"+("clockwise"===this.settings.contentdirection?"":" Anticlockwise"),innerHTML:t.Name})))])))),i("g",{key:"318d1aaaa95e1bf6ccaeab566b15b0384a78871c",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:"fcce9008d0bb2b6adb0429039a7c2f6b9b865b92",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:"ae85245cfd7f223ebc271ea3d1ca0021b35815c8",ref:this.setSvgSize.bind(this),class:"Middle Customable",style:t},i("div",{key:"08547a5324d4d4236f40efe0f70fb922418402ea",style:t})),i("foreignObject",{key:"8289900237296697f5b92e9400beda29a2ff14e7",ref:this.setSvgSize.bind(this),class:"Top Customable",style:t},i("div",{key:"a00da737a2ee5b7739538d9bed50b98b641e10eb",style:t})),i("g",{key:"30d8a96cac39340601e3aa82c864b7e394b57095",class:{spinning:this.isSpinning,Center:!0}},i("foreignObject",{key:"79de765f22964219e6ecf472220649e7b8836a78",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:"de71247c015aefb6295318c78c37b17174fd1ac0",style:{width:"100px",height:"100px",cursor:"pointer"},onClick:this.eventSpin}))),i("g",{key:"3b81cbd53658e73f94729e950c445a93a68bf754"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};O.style=':host{font-family: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}.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, 14px);font-weight:900}';export{O as C}
@@ -1 +1 @@
1
- export{C as casino_engagement_suite_luckywheel}from"./casino-engagement-suite-luckywheel-9ebd9cfc.js";import"./index-48c42d04.js";
1
+ export{C as casino_engagement_suite_luckywheel}from"./casino-engagement-suite-luckywheel-58f82f53.js";import"./index-48c42d04.js";
@@ -1 +1 @@
1
- export{C as CasinoEngagementSuiteLuckywheel}from"./casino-engagement-suite-luckywheel-9ebd9cfc.js";import"./index-48c42d04.js";
1
+ export{C as CasinoEngagementSuiteLuckywheel}from"./casino-engagement-suite-luckywheel-58f82f53.js";import"./index-48c42d04.js";
@@ -627,18 +627,20 @@ const CasinoEngagementSuiteLuckywheel = class {
627
627
  case 'SpinLuckyWheelRes':
628
628
  if (this.isSpinning) {
629
629
  const success = data.State === ELuckyWheelResultState.fulfilled;
630
+ const index = +data.Result.WheelOfFortunePartitionIndex || 0;
630
631
  if (!success) {
631
- this.handleSpinError();
632
+ this.handleSpinError(index);
632
633
  }
633
634
  else {
634
- this.handleSpinResult(data);
635
+ this.handleSpinResult(data, index);
635
636
  }
636
637
  }
637
638
  break;
638
639
  }
639
640
  }
640
- handleSpinError() {
641
- this.spinner.halt(0, () => {
641
+ handleSpinError(index) {
642
+ const partitionDegree = this.settings.getDeg(index);
643
+ this.spinner.halt(partitionDegree, () => {
642
644
  this.isSpinning = false;
643
645
  this.updateSpinable();
644
646
  window.postMessage({
@@ -649,9 +651,8 @@ const CasinoEngagementSuiteLuckywheel = class {
649
651
  });
650
652
  });
651
653
  }
652
- handleSpinResult(data) {
654
+ handleSpinResult(data, index) {
653
655
  if (this.luckywheel.Program.Id === data.LotteryProgramID) {
654
- const index = +data.Result.WheelOfFortunePartitionIndex;
655
656
  const partitionDegree = this.settings.getDeg(index);
656
657
  this.spinner.halt(partitionDegree, () => {
657
658
  this.isSpinning = false;
@@ -718,13 +719,13 @@ const CasinoEngagementSuiteLuckywheel = class {
718
719
  }
719
720
  render() {
720
721
  const foreignObjectAgentProps = { height: `${this.size}px`, width: `${this.size}px` };
721
- return (index.h("div", { key: '367a5a450ac76ff204a19dae3accd876489db2f7', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, index.h("svg", { key: '495bb4100735d774acba268f74782e6229c96dc9', width: this.size, height: this.size, ref: (el) => {
722
+ return (index.h("div", { key: '8f07f4b736611f24d8fdab3c648b682dd03010c8', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, index.h("svg", { key: '5a904e1a93aee08657391d09fa40dbfc83504892', width: this.size, height: this.size, ref: (el) => {
722
723
  this.svg = el;
723
- } }, index.h("foreignObject", { key: 'f3d621838e38e7dd137d3f503e981779e4d34902', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, index.h("div", { key: '0a121c4e34233d90c4d0ec779b7de72e2bbf7624', style: foreignObjectAgentProps })), index.h("g", Object.assign({ key: '59e52ed1e01bda791fca89e4a899fe145350e1b4', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), index.h("g", { key: 'a4dd6e82848700b94dd4f339b728bd21fafd13d0', class: "PartitionsBackgrounds" }, this.options.map((_el, index$1) => {
724
+ } }, index.h("foreignObject", { key: '2f579e8195244078a65e4db7a6255af4e4fe517e', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, index.h("div", { key: 'd6ee2eae87c4b80ab9335a459fe597037d5321d1', style: foreignObjectAgentProps })), index.h("g", Object.assign({ key: '661e946d154c399facffc6963bbb10544ef1b55e', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), index.h("g", { key: '591e8de5dd55dbd016669f7d144664b9c921d4df', class: "PartitionsBackgrounds" }, this.options.map((_el, index$1) => {
724
725
  return (index.h("foreignObject", { ref: this.setSvgSize.bind(this), "clip-path": `url(#clip${index$1})`, class: "PartitionBackground Customable", style: Object.assign({ '--index': index$1.toString() }, foreignObjectAgentProps) }, index.h("div", { style: foreignObjectAgentProps })));
725
- })), index.h("g", { key: '6ffd6236635e09d242c608184871ee80be9ff645', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index$1) => {
726
+ })), index.h("g", { key: 'ac2a4973a712841b81c4ff0609f5f3f5c8b17bf0', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index$1) => {
726
727
  return (index.h("path", Object.assign({ class: "PartitionBackgroundStroke" }, this.settings.getPartitionDraw(index$1), { width: this.size, height: this.size })));
727
- })), index.h("g", { key: '7d293dfa6dfb6e1b3d72c7125f836e79f2603ff1', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index$1) => {
728
+ })), index.h("g", { key: 'afb0c09ec8e53ed97289c5bf186417c2078c4014', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index$1) => {
728
729
  return [
729
730
  el.Image && (index.h("g", { class: `PartitionImage PartitionImage${index$1}`, ref: (el) => this.renderImage(el, index$1) })),
730
731
  el.Name && (index.h("foreignObject", Object.assign({ class: "PartitionText", ref: (el) => {
@@ -735,18 +736,18 @@ const CasinoEngagementSuiteLuckywheel = class {
735
736
  }
736
737
  } }, this.settings.getSvgTextPropsAdjustedByImage(index$1)), index.h("div", { class: "PartitionTextEntityContainer" }, index.h("p", { class: `PartitionTextEntity${this.settings.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`, innerHTML: el.Name }))))
737
738
  ];
738
- }))), index.h("g", { key: 'fa191eda9c4cdb6f4606d0d6ee4c7806352254ce', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index$1) => {
739
+ }))), index.h("g", { key: '318d1aaaa95e1bf6ccaeab566b15b0384a78871c', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index$1) => {
739
740
  return (index.h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition1 Customable", style: { '--index': index$1.toString() } }, index.h("div", { style: foreignObjectAgentProps })));
740
- })), index.h("g", { key: 'eac9ca68af2ba9d48f14de4db2413f76e46ae01d', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index$1) => {
741
+ })), index.h("g", { key: 'fcce9008d0bb2b6adb0429039a7c2f6b9b865b92', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index$1) => {
741
742
  return (index.h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition2 Customable", style: { '--index': index$1.toString() } }, index.h("div", { style: foreignObjectAgentProps })));
742
- })), index.h("foreignObject", { key: '93b00f644cf16b0aa9ca0bc3abd2d94b417fd1d8', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, index.h("div", { key: 'e52f4afc5296dcaeec3f13d30f90488081d53ff9', style: foreignObjectAgentProps })), index.h("foreignObject", { key: '962ba8b608688bdc2a12fc1c4026562de6cefbd7', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, index.h("div", { key: '04c020535414106aa927839af04328cc7ac142c4', style: foreignObjectAgentProps })), index.h("g", { key: '31d7c14471d43ba1e6cbd20a8fc6d052a3a79f97', class: { spinning: this.isSpinning, Center: true } }, index.h("foreignObject", { key: 'df5c6082e8574d040e0b1d4a92e897977a2f4742', ref: (el) => {
743
+ })), index.h("foreignObject", { key: 'ae85245cfd7f223ebc271ea3d1ca0021b35815c8', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, index.h("div", { key: '08547a5324d4d4236f40efe0f70fb922418402ea', style: foreignObjectAgentProps })), index.h("foreignObject", { key: '8289900237296697f5b92e9400beda29a2ff14e7', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, index.h("div", { key: 'a00da737a2ee5b7739538d9bed50b98b641e10eb', style: foreignObjectAgentProps })), index.h("g", { key: '30d8a96cac39340601e3aa82c864b7e394b57095', class: { spinning: this.isSpinning, Center: true } }, index.h("foreignObject", { key: '79de765f22964219e6ecf472220649e7b8836a78', ref: (el) => {
743
744
  if (el) {
744
745
  el.setAttribute('width', '100');
745
746
  el.setAttribute('height', '100');
746
747
  }
747
748
  }, style: {
748
749
  transform: `translate(${Number(this.size) / 2 - 100 / 2}px, ${Number(this.size) / 2 - 100 / 2}px)`
749
- } }, index.h("div", { key: '033be93fc85fc556fb9f617b7353b16879dff5e8', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), index.h("g", { key: 'f95b7a08640ab6317b3ede93aa673f4fce1c41ee' }, this.options.map((_el, index$1) => {
750
+ } }, index.h("div", { key: 'de71247c015aefb6295318c78c37b17174fd1ac0', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), index.h("g", { key: '3b81cbd53658e73f94729e950c445a93a68bf754' }, this.options.map((_el, index$1) => {
750
751
  return (index.h("clipPath", { id: `clip${index$1}` }, index.h("path", Object.assign({}, this.settings.getPartitionDraw(index$1)))));
751
752
  })))));
752
753
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-4bf8c89e.js');
5
+ const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-7ce4e5e1.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-4bf8c89e.js');
5
+ const casinoEngagementSuiteLuckywheel = require('./casino-engagement-suite-luckywheel-7ce4e5e1.js');
6
6
  require('./index-6096cc4b.js');
7
7
 
8
8
 
@@ -84,18 +84,20 @@ export class CasinoEngagementSuiteLuckywheel {
84
84
  case 'SpinLuckyWheelRes':
85
85
  if (this.isSpinning) {
86
86
  const success = data.State === ELuckyWheelResultState.fulfilled;
87
+ const index = +data.Result.WheelOfFortunePartitionIndex || 0;
87
88
  if (!success) {
88
- this.handleSpinError();
89
+ this.handleSpinError(index);
89
90
  }
90
91
  else {
91
- this.handleSpinResult(data);
92
+ this.handleSpinResult(data, index);
92
93
  }
93
94
  }
94
95
  break;
95
96
  }
96
97
  }
97
- handleSpinError() {
98
- this.spinner.halt(0, () => {
98
+ handleSpinError(index) {
99
+ const partitionDegree = this.settings.getDeg(index);
100
+ this.spinner.halt(partitionDegree, () => {
99
101
  this.isSpinning = false;
100
102
  this.updateSpinable();
101
103
  window.postMessage({
@@ -106,9 +108,8 @@ export class CasinoEngagementSuiteLuckywheel {
106
108
  });
107
109
  });
108
110
  }
109
- handleSpinResult(data) {
111
+ handleSpinResult(data, index) {
110
112
  if (this.luckywheel.Program.Id === data.LotteryProgramID) {
111
- const index = +data.Result.WheelOfFortunePartitionIndex;
112
113
  const partitionDegree = this.settings.getDeg(index);
113
114
  this.spinner.halt(partitionDegree, () => {
114
115
  this.isSpinning = false;
@@ -175,13 +176,13 @@ export class CasinoEngagementSuiteLuckywheel {
175
176
  }
176
177
  render() {
177
178
  const foreignObjectAgentProps = { height: `${this.size}px`, width: `${this.size}px` };
178
- return (h("div", { key: '367a5a450ac76ff204a19dae3accd876489db2f7', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, h("svg", { key: '495bb4100735d774acba268f74782e6229c96dc9', width: this.size, height: this.size, ref: (el) => {
179
+ return (h("div", { key: '8f07f4b736611f24d8fdab3c648b682dd03010c8', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, h("svg", { key: '5a904e1a93aee08657391d09fa40dbfc83504892', width: this.size, height: this.size, ref: (el) => {
179
180
  this.svg = el;
180
- } }, h("foreignObject", { key: 'f3d621838e38e7dd137d3f503e981779e4d34902', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, h("div", { key: '0a121c4e34233d90c4d0ec779b7de72e2bbf7624', style: foreignObjectAgentProps })), h("g", Object.assign({ key: '59e52ed1e01bda791fca89e4a899fe145350e1b4', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), h("g", { key: 'a4dd6e82848700b94dd4f339b728bd21fafd13d0', class: "PartitionsBackgrounds" }, this.options.map((_el, index) => {
181
+ } }, h("foreignObject", { key: '2f579e8195244078a65e4db7a6255af4e4fe517e', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, h("div", { key: 'd6ee2eae87c4b80ab9335a459fe597037d5321d1', style: foreignObjectAgentProps })), h("g", Object.assign({ key: '661e946d154c399facffc6963bbb10544ef1b55e', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), h("g", { key: '591e8de5dd55dbd016669f7d144664b9c921d4df', class: "PartitionsBackgrounds" }, this.options.map((_el, index) => {
181
182
  return (h("foreignObject", { ref: this.setSvgSize.bind(this), "clip-path": `url(#clip${index})`, class: "PartitionBackground Customable", style: Object.assign({ '--index': index.toString() }, foreignObjectAgentProps) }, h("div", { style: foreignObjectAgentProps })));
182
- })), h("g", { key: '6ffd6236635e09d242c608184871ee80be9ff645', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index) => {
183
+ })), h("g", { key: 'ac2a4973a712841b81c4ff0609f5f3f5c8b17bf0', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index) => {
183
184
  return (h("path", Object.assign({ class: "PartitionBackgroundStroke" }, this.settings.getPartitionDraw(index), { width: this.size, height: this.size })));
184
- })), h("g", { key: '7d293dfa6dfb6e1b3d72c7125f836e79f2603ff1', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index) => {
185
+ })), h("g", { key: 'afb0c09ec8e53ed97289c5bf186417c2078c4014', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index) => {
185
186
  return [
186
187
  el.Image && (h("g", { class: `PartitionImage PartitionImage${index}`, ref: (el) => this.renderImage(el, index) })),
187
188
  el.Name && (h("foreignObject", Object.assign({ class: "PartitionText", ref: (el) => {
@@ -192,18 +193,18 @@ export class CasinoEngagementSuiteLuckywheel {
192
193
  }
193
194
  } }, this.settings.getSvgTextPropsAdjustedByImage(index)), h("div", { class: "PartitionTextEntityContainer" }, h("p", { class: `PartitionTextEntity${this.settings.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`, innerHTML: el.Name }))))
194
195
  ];
195
- }))), h("g", { key: 'fa191eda9c4cdb6f4606d0d6ee4c7806352254ce', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index) => {
196
+ }))), h("g", { key: '318d1aaaa95e1bf6ccaeab566b15b0384a78871c', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index) => {
196
197
  return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition1 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
197
- })), h("g", { key: 'eac9ca68af2ba9d48f14de4db2413f76e46ae01d', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index) => {
198
+ })), h("g", { key: 'fcce9008d0bb2b6adb0429039a7c2f6b9b865b92', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index) => {
198
199
  return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition2 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
199
- })), h("foreignObject", { key: '93b00f644cf16b0aa9ca0bc3abd2d94b417fd1d8', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, h("div", { key: 'e52f4afc5296dcaeec3f13d30f90488081d53ff9', style: foreignObjectAgentProps })), h("foreignObject", { key: '962ba8b608688bdc2a12fc1c4026562de6cefbd7', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, h("div", { key: '04c020535414106aa927839af04328cc7ac142c4', style: foreignObjectAgentProps })), h("g", { key: '31d7c14471d43ba1e6cbd20a8fc6d052a3a79f97', class: { spinning: this.isSpinning, Center: true } }, h("foreignObject", { key: 'df5c6082e8574d040e0b1d4a92e897977a2f4742', ref: (el) => {
200
+ })), h("foreignObject", { key: 'ae85245cfd7f223ebc271ea3d1ca0021b35815c8', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, h("div", { key: '08547a5324d4d4236f40efe0f70fb922418402ea', style: foreignObjectAgentProps })), h("foreignObject", { key: '8289900237296697f5b92e9400beda29a2ff14e7', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, h("div", { key: 'a00da737a2ee5b7739538d9bed50b98b641e10eb', style: foreignObjectAgentProps })), h("g", { key: '30d8a96cac39340601e3aa82c864b7e394b57095', class: { spinning: this.isSpinning, Center: true } }, h("foreignObject", { key: '79de765f22964219e6ecf472220649e7b8836a78', ref: (el) => {
200
201
  if (el) {
201
202
  el.setAttribute('width', '100');
202
203
  el.setAttribute('height', '100');
203
204
  }
204
205
  }, style: {
205
206
  transform: `translate(${Number(this.size) / 2 - 100 / 2}px, ${Number(this.size) / 2 - 100 / 2}px)`
206
- } }, h("div", { key: '033be93fc85fc556fb9f617b7353b16879dff5e8', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), h("g", { key: 'f95b7a08640ab6317b3ede93aa673f4fce1c41ee' }, this.options.map((_el, index) => {
207
+ } }, h("div", { key: 'de71247c015aefb6295318c78c37b17174fd1ac0', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), h("g", { key: '3b81cbd53658e73f94729e950c445a93a68bf754' }, this.options.map((_el, index) => {
207
208
  return (h("clipPath", { id: `clip${index}` }, h("path", Object.assign({}, this.settings.getPartitionDraw(index)))));
208
209
  })))));
209
210
  }
@@ -625,18 +625,20 @@ const CasinoEngagementSuiteLuckywheel = class {
625
625
  case 'SpinLuckyWheelRes':
626
626
  if (this.isSpinning) {
627
627
  const success = data.State === ELuckyWheelResultState.fulfilled;
628
+ const index = +data.Result.WheelOfFortunePartitionIndex || 0;
628
629
  if (!success) {
629
- this.handleSpinError();
630
+ this.handleSpinError(index);
630
631
  }
631
632
  else {
632
- this.handleSpinResult(data);
633
+ this.handleSpinResult(data, index);
633
634
  }
634
635
  }
635
636
  break;
636
637
  }
637
638
  }
638
- handleSpinError() {
639
- this.spinner.halt(0, () => {
639
+ handleSpinError(index) {
640
+ const partitionDegree = this.settings.getDeg(index);
641
+ this.spinner.halt(partitionDegree, () => {
640
642
  this.isSpinning = false;
641
643
  this.updateSpinable();
642
644
  window.postMessage({
@@ -647,9 +649,8 @@ const CasinoEngagementSuiteLuckywheel = class {
647
649
  });
648
650
  });
649
651
  }
650
- handleSpinResult(data) {
652
+ handleSpinResult(data, index) {
651
653
  if (this.luckywheel.Program.Id === data.LotteryProgramID) {
652
- const index = +data.Result.WheelOfFortunePartitionIndex;
653
654
  const partitionDegree = this.settings.getDeg(index);
654
655
  this.spinner.halt(partitionDegree, () => {
655
656
  this.isSpinning = false;
@@ -716,13 +717,13 @@ const CasinoEngagementSuiteLuckywheel = class {
716
717
  }
717
718
  render() {
718
719
  const foreignObjectAgentProps = { height: `${this.size}px`, width: `${this.size}px` };
719
- return (h("div", { key: '367a5a450ac76ff204a19dae3accd876489db2f7', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, h("svg", { key: '495bb4100735d774acba268f74782e6229c96dc9', width: this.size, height: this.size, ref: (el) => {
720
+ return (h("div", { key: '8f07f4b736611f24d8fdab3c648b682dd03010c8', class: `WheelContainer ${this.device}`, style: this.defineGeneralVariables() }, h("svg", { key: '5a904e1a93aee08657391d09fa40dbfc83504892', width: this.size, height: this.size, ref: (el) => {
720
721
  this.svg = el;
721
- } }, h("foreignObject", { key: 'f3d621838e38e7dd137d3f503e981779e4d34902', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, h("div", { key: '0a121c4e34233d90c4d0ec779b7de72e2bbf7624', style: foreignObjectAgentProps })), h("g", Object.assign({ key: '59e52ed1e01bda791fca89e4a899fe145350e1b4', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), h("g", { key: 'a4dd6e82848700b94dd4f339b728bd21fafd13d0', class: "PartitionsBackgrounds" }, this.options.map((_el, index) => {
722
+ } }, h("foreignObject", { key: '2f579e8195244078a65e4db7a6255af4e4fe517e', ref: this.setSvgSize.bind(this), class: "Bottom Customable" }, h("div", { key: 'd6ee2eae87c4b80ab9335a459fe597037d5321d1', style: foreignObjectAgentProps })), h("g", Object.assign({ key: '661e946d154c399facffc6963bbb10544ef1b55e', class: "PartitionsContainer" }, this.settings.getSpinnerProps()), h("g", { key: '591e8de5dd55dbd016669f7d144664b9c921d4df', class: "PartitionsBackgrounds" }, this.options.map((_el, index) => {
722
723
  return (h("foreignObject", { ref: this.setSvgSize.bind(this), "clip-path": `url(#clip${index})`, class: "PartitionBackground Customable", style: Object.assign({ '--index': index.toString() }, foreignObjectAgentProps) }, h("div", { style: foreignObjectAgentProps })));
723
- })), h("g", { key: '6ffd6236635e09d242c608184871ee80be9ff645', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index) => {
724
+ })), h("g", { key: 'ac2a4973a712841b81c4ff0609f5f3f5c8b17bf0', class: "PartitionsBackgroundStrokes" }, this.options.map((_el, index) => {
724
725
  return (h("path", Object.assign({ class: "PartitionBackgroundStroke" }, this.settings.getPartitionDraw(index), { width: this.size, height: this.size })));
725
- })), h("g", { key: '7d293dfa6dfb6e1b3d72c7125f836e79f2603ff1', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index) => {
726
+ })), h("g", { key: 'afb0c09ec8e53ed97289c5bf186417c2078c4014', class: "Partitions", style: { filter: this.speed > 0.3 ? `blur(${this.speed}px)` : '' } }, this.options.map((el, index) => {
726
727
  return [
727
728
  el.Image && (h("g", { class: `PartitionImage PartitionImage${index}`, ref: (el) => this.renderImage(el, index) })),
728
729
  el.Name && (h("foreignObject", Object.assign({ class: "PartitionText", ref: (el) => {
@@ -733,18 +734,18 @@ const CasinoEngagementSuiteLuckywheel = class {
733
734
  }
734
735
  } }, this.settings.getSvgTextPropsAdjustedByImage(index)), h("div", { class: "PartitionTextEntityContainer" }, h("p", { class: `PartitionTextEntity${this.settings.contentdirection === 'clockwise' ? '' : ' Anticlockwise'}`, innerHTML: el.Name }))))
735
736
  ];
736
- }))), h("g", { key: 'fa191eda9c4cdb6f4606d0d6ee4c7806352254ce', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index) => {
737
+ }))), h("g", { key: '318d1aaaa95e1bf6ccaeab566b15b0384a78871c', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable1: true } }, this.options.map((_el, index) => {
737
738
  return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition1 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
738
- })), h("g", { key: 'eac9ca68af2ba9d48f14de4db2413f76e46ae01d', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index) => {
739
+ })), h("g", { key: 'fcce9008d0bb2b6adb0429039a7c2f6b9b865b92', class: { active: this.isPartitionsCustomableReady, PartitionsCustomable2: true } }, this.options.map((_el, index) => {
739
740
  return (h("foreignObject", { ref: this.setSvgSize.bind(this), class: "Partition2 Customable", style: { '--index': index.toString() } }, h("div", { style: foreignObjectAgentProps })));
740
- })), h("foreignObject", { key: '93b00f644cf16b0aa9ca0bc3abd2d94b417fd1d8', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, h("div", { key: 'e52f4afc5296dcaeec3f13d30f90488081d53ff9', style: foreignObjectAgentProps })), h("foreignObject", { key: '962ba8b608688bdc2a12fc1c4026562de6cefbd7', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, h("div", { key: '04c020535414106aa927839af04328cc7ac142c4', style: foreignObjectAgentProps })), h("g", { key: '31d7c14471d43ba1e6cbd20a8fc6d052a3a79f97', class: { spinning: this.isSpinning, Center: true } }, h("foreignObject", { key: 'df5c6082e8574d040e0b1d4a92e897977a2f4742', ref: (el) => {
741
+ })), h("foreignObject", { key: 'ae85245cfd7f223ebc271ea3d1ca0021b35815c8', ref: this.setSvgSize.bind(this), class: "Middle Customable", style: foreignObjectAgentProps }, h("div", { key: '08547a5324d4d4236f40efe0f70fb922418402ea', style: foreignObjectAgentProps })), h("foreignObject", { key: '8289900237296697f5b92e9400beda29a2ff14e7', ref: this.setSvgSize.bind(this), class: "Top Customable", style: foreignObjectAgentProps }, h("div", { key: 'a00da737a2ee5b7739538d9bed50b98b641e10eb', style: foreignObjectAgentProps })), h("g", { key: '30d8a96cac39340601e3aa82c864b7e394b57095', class: { spinning: this.isSpinning, Center: true } }, h("foreignObject", { key: '79de765f22964219e6ecf472220649e7b8836a78', ref: (el) => {
741
742
  if (el) {
742
743
  el.setAttribute('width', '100');
743
744
  el.setAttribute('height', '100');
744
745
  }
745
746
  }, style: {
746
747
  transform: `translate(${Number(this.size) / 2 - 100 / 2}px, ${Number(this.size) / 2 - 100 / 2}px)`
747
- } }, h("div", { key: '033be93fc85fc556fb9f617b7353b16879dff5e8', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), h("g", { key: 'f95b7a08640ab6317b3ede93aa673f4fce1c41ee' }, this.options.map((_el, index) => {
748
+ } }, h("div", { key: 'de71247c015aefb6295318c78c37b17174fd1ac0', style: { width: '100px', height: '100px', cursor: 'pointer' }, onClick: this.eventSpin }))), h("g", { key: '3b81cbd53658e73f94729e950c445a93a68bf754' }, this.options.map((_el, index) => {
748
749
  return (h("clipPath", { id: `clip${index}` }, h("path", Object.assign({}, this.settings.getPartitionDraw(index)))));
749
750
  })))));
750
751
  }
@@ -1,2 +1,2 @@
1
- export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-9ebd9cfc.js';
1
+ export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-58f82f53.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-9ebd9cfc.js';
1
+ export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-58f82f53.js';
2
2
  import './index-48c42d04.js';
@@ -41,8 +41,8 @@ export declare class CasinoEngagementSuiteLuckywheel {
41
41
  spinable: boolean;
42
42
  private spinner;
43
43
  handleEvent(e: any): void;
44
- handleSpinError(): void;
45
- handleSpinResult(data: ISpinLuckyWheelEventResult): void;
44
+ handleSpinError(index: number): void;
45
+ handleSpinResult(data: ISpinLuckyWheelEventResult, index: number): void;
46
46
  componentDidRender(): void;
47
47
  componentWillLoad(): Promise<void>;
48
48
  setClientStyling: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-luckywheel",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
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,d,l;!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.Arrow="Arrow",t.Partition="Partition"}(a||(a={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(o||(o={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(h||(h={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(c||(c={})),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"}(l||(l={}));const u=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},g=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})),f=t=>({x:t,y:t}),b=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),p={Image:"",Name:"Thank you",PrizeText:"",PrizeImage:""},m=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(p),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 g(t)}:{})(t.Image))))),e},v={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))}},y={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},x={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}},w=[{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}],k=t=>Object.keys(t).map((i=>t[i]));var P;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(P||(P={}));class M{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:r}){this.arrowmode=o.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 o.DownFromTop:case o.UpFromCenter:return-Math.PI/2;case o.DownFromCenter:case o.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,c.outward)),{width:e,height:e})}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){const i=this.getSvgTextProps(t,this.options[t].Image?80:100);return Object.assign({},i)}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 P.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+90*(void 0!==i?i:c[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=f(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:b(r,e.transform),point:b(r,e.position)}}getPropsForPartitionInfo(t,i,e,s,r){const{point:n,transformOrigin:a}=this.getPartitionPositions(t,e,i);return Object.assign(Object.assign({},n),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg) translate(${"clockwise"===this.contentdirection?n.x:n.x-100}px, ${n.y-50}px)`,"transform-origin":`${o=a,Object.keys(o).map((t=>`${o[t]}px`)).join(" ")}`,height:`${r}px`,width:`${r}px`}});var o}getPartitionDraw(t){const i=f(this.center),e=f(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=f(s),a=f(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",...k(i),"L",...k(s),"A",...k(e),"0 0 1",...k(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(this.length-t,this.length)}getSpinnerProps(){const t=f(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class j{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=l.cubic,this.param=w[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*y[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animateF(e,this.deg,t,v.in[this.easingType],x.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animateF(t,0,this.degTarget,v.out[this.easingType],x.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,y[this.easingType]),this.continueRepeat()};({[d.launch]:()=>{this.cb=()=>{this.step=d.loop,this.setDeg(t,y[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,d=Math.abs(r(h/t));this.setDeg(c,d),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,d=e*s(c/t)+i,l=Math.abs(r(c/t));this.setDeg(d,l),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 O=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;u(e,this.settings.getSvgImageProps(i)),t.innerHTML=null,t.appendChild(e)},this.updateSpinable=()=>{if(this.luckywheel.Current){if(Number(this.luckywheel.Current.RemainingTimes)>0)return void(this.spinable=!0);window.postMessage({type:"ShowNoSpinLeftModal"})}this.spinable=!1},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;"SpinLuckyWheelRes"===i&&this.isSpinning&&(e.State===n.fulfilled?this.handleSpinResult(e):this.handleSpinError())}handleSpinError(){this.spinner.halt(0,(()=>{this.isSpinning=!1,this.updateSpinable(),window.postMessage({type:"ShowLuckywheelRewardModal",data:{HasError:!0}})}))}handleSpinResult(t){if(this.luckywheel.Program.Id===t.LotteryProgramID){const i=+t.Result.WheelOfFortunePartitionIndex,e=this.settings.getDeg(i);this.spinner.halt(e,(()=>{this.isSpinning=!1,this.updateSpinable();const t=this.luckywheel.Program.WheelOfFortune.Partitions[i];window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeText:(null==t?void 0:t.PrizeText[this.language])||(null==t?void 0:t.PrizeText["*"]),PrizeMessage:(null==t?void 0:t.Name[this.language])||(null==t?void 0:t.Name["*"]),HasError:!1}})}))}}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await m(this.luckywheel,h.en),this.settings=new M({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new j({tick:(t,i)=>{u(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:"367a5a450ac76ff204a19dae3accd876489db2f7",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"495bb4100735d774acba268f74782e6229c96dc9",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",{key:"f3d621838e38e7dd137d3f503e981779e4d34902",ref:this.setSvgSize.bind(this),class:"Bottom Customable"},i("div",{key:"0a121c4e34233d90c4d0ec779b7de72e2bbf7624",style:t})),i("g",Object.assign({key:"59e52ed1e01bda791fca89e4a899fe145350e1b4",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"a4dd6e82848700b94dd4f339b728bd21fafd13d0",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:"6ffd6236635e09d242c608184871ee80be9ff645",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:"7d293dfa6dfb6e1b3d72c7125f836e79f2603ff1",class:"Partitions",style:{filter:this.speed>.3?`blur(${this.speed}px)`:""}},this.options.map(((t,e)=>[t.Image&&i("g",{class:`PartitionImage PartitionImage${e}`,ref:t=>this.renderImage(t,e)}),t.Name&&i("foreignObject",Object.assign({class:"PartitionText",ref:t=>{if(t){const i=this.options[e].Image?"80":"100";t.setAttribute("width",i),t.setAttribute("height",i)}}},this.settings.getSvgTextPropsAdjustedByImage(e)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:"PartitionTextEntity"+("clockwise"===this.settings.contentdirection?"":" Anticlockwise"),innerHTML:t.Name})))])))),i("g",{key:"fa191eda9c4cdb6f4606d0d6ee4c7806352254ce",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:"eac9ca68af2ba9d48f14de4db2413f76e46ae01d",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:"93b00f644cf16b0aa9ca0bc3abd2d94b417fd1d8",ref:this.setSvgSize.bind(this),class:"Middle Customable",style:t},i("div",{key:"e52f4afc5296dcaeec3f13d30f90488081d53ff9",style:t})),i("foreignObject",{key:"962ba8b608688bdc2a12fc1c4026562de6cefbd7",ref:this.setSvgSize.bind(this),class:"Top Customable",style:t},i("div",{key:"04c020535414106aa927839af04328cc7ac142c4",style:t})),i("g",{key:"31d7c14471d43ba1e6cbd20a8fc6d052a3a79f97",class:{spinning:this.isSpinning,Center:!0}},i("foreignObject",{key:"df5c6082e8574d040e0b1d4a92e897977a2f4742",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:"033be93fc85fc556fb9f617b7353b16879dff5e8",style:{width:"100px",height:"100px",cursor:"pointer"},onClick:this.eventSpin}))),i("g",{key:"f95b7a08640ab6317b3ede93aa673f4fce1c41ee"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};O.style=':host{font-family: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}.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, 14px);font-weight:900}';export{O as C}