@everymatrix/prize-engine-luckywheel 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/PrizeEngineLuckywheel-CDs9jTzq.cjs +1 -0
- package/components/PrizeEngineLuckywheel-CzS-xrLu.js +324 -0
- package/components/PrizeEngineLuckywheel-D6DJiPVS.js +324 -0
- package/components/WheelSVG-Brhzl2qz.js +5759 -0
- package/components/WheelSVG-By6H2eqq.cjs +51 -0
- package/components/WheelSVG-DxZNtzCo.js +5802 -0
- package/es2015/prize-engine-luckywheel.cjs +1 -0
- package/es2015/prize-engine-luckywheel.js +16 -0
- package/esnext/prize-engine-luckywheel.js +14 -0
- package/package.json +25 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./WheelSVG-By6H2eqq.cjs"),y="__WIDGET_GLOBAL_STYLE_CACHE__";function D(t,e){if(t){const n=document.createElement("style");n.innerHTML=e,t.appendChild(n)}}function O(t,e){if(!t||!e)return;const n=new URL(e);fetch(n.href).then(i=>i.text()).then(i=>{const r=document.createElement("style");r.innerHTML=i,t&&t.appendChild(r)}).catch(i=>{console.error("There was an error while trying to load client styling from URL",i)})}function U(t,e,n,i=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!i)return n=q(t,e),n;window[y]||(window[y]={}),n=B(t,e);const c=n.unsubscribe.bind(n),o=()=>{if(window[y][e]){const u=window[y][e];u.refCount>1?u.refCount=u.refCount-1:delete window[y][e]}c()};return n.unsubscribe=o,n}function q(t,e){const n=document.createElement("style");return window.emMessageBus.subscribe(e,i=>{t&&(n.innerHTML=i,t.appendChild(n))})}function B(t,e){return window.emMessageBus.subscribe(e,n=>{if(!t)return;const i=t.getRootNode(),r=window[y];let c=r[e]&&r[e].sheet;c?r[e].refCount=r[e].refCount+1:(c=new CSSStyleSheet,c.replaceSync(n),r[e]={sheet:c,refCount:1});const o=i.adoptedStyleSheets||[];o.includes(c)||(i.adoptedStyleSheets=[...o,c])})}function H(t){s.append_styles(t,"svelte-12d9sfg",'.PrizeLuckywheelContainer.svelte-12d9sfg{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;padding:20px;box-sizing:border-box;font-family:var(--emw--font-family-primary, "Ubuntu", sans-serif)}.PrizeLuckywheelContainer.Mobile.svelte-12d9sfg{padding:10px}.MainSection.svelte-12d9sfg{flex-grow:1;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;position:relative}.WheelWrapper.svelte-12d9sfg{flex-grow:1;display:flex;align-items:center;justify-content:center;min-height:0;width:100%}')}function C(t){let e,n,i,r,c={lang:t[0],contentdirection:t[1],bonus:t[4],size:t[3],radius:t[7]};return i=new s.WheelSVG({props:c}),t[17](i),i.$on("spinning",t[18]),i.$on("spinning-request",t[19]),i.$on("success",t[20]),{c(){e=s.element("div"),n=s.element("div"),s.create_component(i.$$.fragment),s.attr(n,"class","WheelWrapper svelte-12d9sfg"),s.attr(e,"class","MainSection svelte-12d9sfg")},m(o,u){s.insert(o,e,u),s.append(e,n),s.mount_component(i,n,null),r=!0},p(o,u){const a={};u&1&&(a.lang=o[0]),u&2&&(a.contentdirection=o[1]),u&16&&(a.bonus=o[4]),u&8&&(a.size=o[3]),u&128&&(a.radius=o[7]),i.$set(a)},i(o){r||(s.transition_in(i.$$.fragment,o),r=!0)},o(o){s.transition_out(i.$$.fragment,o),r=!1},d(o){o&&s.detach(e),t[17](null),s.destroy_component(i)}}}function x(t){let e,n,i=t[4]&&C(t);return{c(){e=s.element("div"),i&&i.c(),s.attr(e,"class","PrizeLuckywheelContainer svelte-12d9sfg"),s.toggle_class(e,"Mobile",t[8])},m(r,c){s.insert(r,e,c),i&&i.m(e,null),t[21](e),n=!0},p(r,[c]){r[4]?i?(i.p(r,c),c&16&&s.transition_in(i,1)):(i=C(r),i.c(),s.transition_in(i,1),i.m(e,null)):i&&(s.group_outros(),s.transition_out(i,1,1,()=>{i=null}),s.check_outros())},i(r){n||(s.transition_in(i),n=!0)},o(r){s.transition_out(i),n=!1},d(r){r&&s.detach(e),i&&i.d(),t[21](null)}}}let N=null;function V(t,e,n){let i,r,c,{data:o=null}=e,{lang:u="en"}=e,{clientstyling:a=""}=e,{clientstylingurl:w=""}=e,{translationurl:b=""}=e,{mbsource:_=""}=e,{size:z=324}=e,{mobilesize:S=240}=e,{contentdirection:L="anticlockwise"}=e,p=null,f;const M=s.isMobile(window.navigator.userAgent);let d,m=!1;s.setLocaleWhenInit();const E=()=>{fetch(b).then(h=>h.json()).then(h=>{Object.keys(h).forEach(g=>{s.addNewMessages(g,h[g])})})},P=l=>{d&&d.setDrawResult(l)},R=()=>{m||(n(6,m=!0),d&&d.eventSpin())};s.onMount(()=>{const l=h=>{const{type:g,data:A}=h.data;g==="PrizeGameResult"?P(A):g==="PrizeResultClose"?(n(6,m=!1),d&&d.closeMessage()):g==="PrizeGameStartAnimation"&&R()};return window.addEventListener("message",l),()=>{window.removeEventListener("message",l)}});function v(l){s.binding_callbacks[l?"unshift":"push"](()=>{d=l,n(5,d)})}const G=()=>n(6,m=!0),T=()=>window.postMessage({type:"PrizeGameRequestDraw"},"*"),W=()=>window.postMessage({type:"PrizeGameSpinEnd"},"*");function j(l){s.binding_callbacks[l?"unshift":"push"](()=>{f=l,n(2,f)})}return t.$$set=l=>{"data"in l&&n(9,o=l.data),"lang"in l&&n(0,u=l.lang),"clientstyling"in l&&n(10,a=l.clientstyling),"clientstylingurl"in l&&n(11,w=l.clientstylingurl),"translationurl"in l&&n(12,b=l.translationurl),"mbsource"in l&&n(13,_=l.mbsource),"size"in l&&n(14,z=l.size),"mobilesize"in l&&n(15,S=l.mobilesize),"contentdirection"in l&&n(1,L=l.contentdirection)},t.$$.update=()=>{if(t.$$.dirty&512)if(typeof o=="string")try{n(4,p=JSON.parse(o))}catch(l){console.error("[Luckywheel] Parse failed",l)}else n(4,p=o);t.$$.dirty&1&&u&&s.setLocale(u),t.$$.dirty&4096&&b&&E(),t.$$.dirty&1028&&a&&f&&D(f,a),t.$$.dirty&2052&&w&&f&&O(f,w),t.$$.dirty&8196&&_&&f&&U(f,`${_}.Style`,N),t.$$.dirty&49152&&n(16,i=M&&S?S:z),t.$$.dirty&65536&&n(3,r=i/.6875),t.$$.dirty&8&&n(7,c=.62*r/2)},[u,L,f,r,p,d,m,c,M,o,a,w,b,_,z,S,i,v,G,T,W,j]}class k extends s.SvelteComponent{constructor(e){super(),s.init(this,e,V,x,s.safe_not_equal,{data:9,lang:0,clientstyling:10,clientstylingurl:11,translationurl:12,mbsource:13,size:14,mobilesize:15,contentdirection:1},H)}get data(){return this.$$.ctx[9]}set data(e){this.$$set({data:e}),s.flush()}get lang(){return this.$$.ctx[0]}set lang(e){this.$$set({lang:e}),s.flush()}get clientstyling(){return this.$$.ctx[10]}set clientstyling(e){this.$$set({clientstyling:e}),s.flush()}get clientstylingurl(){return this.$$.ctx[11]}set clientstylingurl(e){this.$$set({clientstylingurl:e}),s.flush()}get translationurl(){return this.$$.ctx[12]}set translationurl(e){this.$$set({translationurl:e}),s.flush()}get mbsource(){return this.$$.ctx[13]}set mbsource(e){this.$$set({mbsource:e}),s.flush()}get size(){return this.$$.ctx[14]}set size(e){this.$$set({size:e}),s.flush()}get mobilesize(){return this.$$.ctx[15]}set mobilesize(e){this.$$set({mobilesize:e}),s.flush()}get contentdirection(){return this.$$.ctx[1]}set contentdirection(e){this.$$set({contentdirection:e}),s.flush()}}customElements.define("prize-engine-luckywheel",s.create_custom_element(k,{data:{},lang:{},clientstyling:{},clientstylingurl:{},translationurl:{},mbsource:{},size:{},mobilesize:{},contentdirection:{}},[],[],!0));exports.default=k;
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { S as H, i as N, f as d, s as I, c as V, a as F, d as G, t as M, b as z, e as J, g as T, h as C, j as k, k as K, l as Y, m as Q, o as X, n as Z, W as $, p as ee, q as te, r as ne, u as ie, v as se, w as R, x as le } from "./WheelSVG-DxZNtzCo.js";
|
|
2
|
+
const w = "__WIDGET_GLOBAL_STYLE_CACHE__";
|
|
3
|
+
function re(t, e) {
|
|
4
|
+
if (t) {
|
|
5
|
+
const n = document.createElement("style");
|
|
6
|
+
n.innerHTML = e, t.appendChild(n);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function oe(t, e) {
|
|
10
|
+
if (!t || !e)
|
|
11
|
+
return;
|
|
12
|
+
const n = new URL(e);
|
|
13
|
+
fetch(n.href).then((i) => i.text()).then((i) => {
|
|
14
|
+
const l = document.createElement("style");
|
|
15
|
+
l.innerHTML = i, t && t.appendChild(l);
|
|
16
|
+
}).catch((i) => {
|
|
17
|
+
console.error("There was an error while trying to load client styling from URL", i);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function ce(t, e, n, i = !1) {
|
|
21
|
+
if (!window.emMessageBus)
|
|
22
|
+
return;
|
|
23
|
+
if (!("adoptedStyleSheets" in Document.prototype) || !i)
|
|
24
|
+
return n = ue(t, e), n;
|
|
25
|
+
window[w] || (window[w] = {}), n = ae(t, e);
|
|
26
|
+
const o = n.unsubscribe.bind(n), r = () => {
|
|
27
|
+
if (window[w][e]) {
|
|
28
|
+
const c = window[w][e];
|
|
29
|
+
c.refCount > 1 ? c.refCount = c.refCount - 1 : delete window[w][e];
|
|
30
|
+
}
|
|
31
|
+
o();
|
|
32
|
+
};
|
|
33
|
+
return n.unsubscribe = r, n;
|
|
34
|
+
}
|
|
35
|
+
function ue(t, e) {
|
|
36
|
+
const n = document.createElement("style");
|
|
37
|
+
return window.emMessageBus.subscribe(e, (i) => {
|
|
38
|
+
t && (n.innerHTML = i, t.appendChild(n));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function ae(t, e) {
|
|
42
|
+
return window.emMessageBus.subscribe(e, (n) => {
|
|
43
|
+
if (!t)
|
|
44
|
+
return;
|
|
45
|
+
const i = t.getRootNode(), l = window[w];
|
|
46
|
+
let o = l[e] && l[e].sheet;
|
|
47
|
+
o ? l[e].refCount = l[e].refCount + 1 : (o = new CSSStyleSheet(), o.replaceSync(n), l[e] = {
|
|
48
|
+
sheet: o,
|
|
49
|
+
refCount: 1
|
|
50
|
+
});
|
|
51
|
+
const r = i.adoptedStyleSheets || [];
|
|
52
|
+
r.includes(o) || (i.adoptedStyleSheets = [...r, o]);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function fe(t) {
|
|
56
|
+
F(t, "svelte-12d9sfg", '.PrizeLuckywheelContainer.svelte-12d9sfg{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;padding:20px;box-sizing:border-box;font-family:var(--emw--font-family-primary, "Ubuntu", sans-serif)}.PrizeLuckywheelContainer.Mobile.svelte-12d9sfg{padding:10px}.MainSection.svelte-12d9sfg{flex-grow:1;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;position:relative}.WheelWrapper.svelte-12d9sfg{flex-grow:1;display:flex;align-items:center;justify-content:center;min-height:0;width:100%}');
|
|
57
|
+
}
|
|
58
|
+
function v(t) {
|
|
59
|
+
let e, n, i, l, o = {
|
|
60
|
+
lang: (
|
|
61
|
+
/*lang*/
|
|
62
|
+
t[0]
|
|
63
|
+
),
|
|
64
|
+
contentdirection: (
|
|
65
|
+
/*contentdirection*/
|
|
66
|
+
t[1]
|
|
67
|
+
),
|
|
68
|
+
bonus: (
|
|
69
|
+
/*activeGame*/
|
|
70
|
+
t[4]
|
|
71
|
+
),
|
|
72
|
+
size: (
|
|
73
|
+
/*_internalSize*/
|
|
74
|
+
t[3]
|
|
75
|
+
),
|
|
76
|
+
radius: (
|
|
77
|
+
/*radius*/
|
|
78
|
+
t[7]
|
|
79
|
+
)
|
|
80
|
+
};
|
|
81
|
+
return i = new $({ props: o }), t[17](i), i.$on(
|
|
82
|
+
"spinning",
|
|
83
|
+
/*spinning_handler*/
|
|
84
|
+
t[18]
|
|
85
|
+
), i.$on(
|
|
86
|
+
"spinning-request",
|
|
87
|
+
/*spinning_request_handler*/
|
|
88
|
+
t[19]
|
|
89
|
+
), i.$on(
|
|
90
|
+
"success",
|
|
91
|
+
/*success_handler*/
|
|
92
|
+
t[20]
|
|
93
|
+
), {
|
|
94
|
+
c() {
|
|
95
|
+
e = C("div"), n = C("div"), ie(i.$$.fragment), k(n, "class", "WheelWrapper svelte-12d9sfg"), k(e, "class", "MainSection svelte-12d9sfg");
|
|
96
|
+
},
|
|
97
|
+
m(r, c) {
|
|
98
|
+
T(r, e, c), te(e, n), ne(i, n, null), l = !0;
|
|
99
|
+
},
|
|
100
|
+
p(r, c) {
|
|
101
|
+
const u = {};
|
|
102
|
+
c & /*lang*/
|
|
103
|
+
1 && (u.lang = /*lang*/
|
|
104
|
+
r[0]), c & /*contentdirection*/
|
|
105
|
+
2 && (u.contentdirection = /*contentdirection*/
|
|
106
|
+
r[1]), c & /*activeGame*/
|
|
107
|
+
16 && (u.bonus = /*activeGame*/
|
|
108
|
+
r[4]), c & /*_internalSize*/
|
|
109
|
+
8 && (u.size = /*_internalSize*/
|
|
110
|
+
r[3]), c & /*radius*/
|
|
111
|
+
128 && (u.radius = /*radius*/
|
|
112
|
+
r[7]), i.$set(u);
|
|
113
|
+
},
|
|
114
|
+
i(r) {
|
|
115
|
+
l || (z(i.$$.fragment, r), l = !0);
|
|
116
|
+
},
|
|
117
|
+
o(r) {
|
|
118
|
+
M(i.$$.fragment, r), l = !1;
|
|
119
|
+
},
|
|
120
|
+
d(r) {
|
|
121
|
+
r && G(e), t[17](null), ee(i);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function de(t) {
|
|
126
|
+
let e, n, i = (
|
|
127
|
+
/*activeGame*/
|
|
128
|
+
t[4] && v(t)
|
|
129
|
+
);
|
|
130
|
+
return {
|
|
131
|
+
c() {
|
|
132
|
+
e = C("div"), i && i.c(), k(e, "class", "PrizeLuckywheelContainer svelte-12d9sfg"), K(
|
|
133
|
+
e,
|
|
134
|
+
"Mobile",
|
|
135
|
+
/*mobileView*/
|
|
136
|
+
t[8]
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
m(l, o) {
|
|
140
|
+
T(l, e, o), i && i.m(e, null), t[21](e), n = !0;
|
|
141
|
+
},
|
|
142
|
+
p(l, [o]) {
|
|
143
|
+
/*activeGame*/
|
|
144
|
+
l[4] ? i ? (i.p(l, o), o & /*activeGame*/
|
|
145
|
+
16 && z(i, 1)) : (i = v(l), i.c(), z(i, 1), i.m(e, null)) : i && (le(), M(i, 1, 1, () => {
|
|
146
|
+
i = null;
|
|
147
|
+
}), J());
|
|
148
|
+
},
|
|
149
|
+
i(l) {
|
|
150
|
+
n || (z(i), n = !0);
|
|
151
|
+
},
|
|
152
|
+
o(l) {
|
|
153
|
+
M(i), n = !1;
|
|
154
|
+
},
|
|
155
|
+
d(l) {
|
|
156
|
+
l && G(e), i && i.d(), t[21](null);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
let ge = null;
|
|
161
|
+
function he(t, e, n) {
|
|
162
|
+
let i, l, o, { data: r = null } = e, { lang: c = "en" } = e, { clientstyling: u = "" } = e, { clientstylingurl: y = "" } = e, { translationurl: b = "" } = e, { mbsource: S = "" } = e, { size: p = 324 } = e, { mobilesize: _ = 240 } = e, { contentdirection: E = "anticlockwise" } = e, L = null, a;
|
|
163
|
+
const P = Y(window.navigator.userAgent);
|
|
164
|
+
let f, m = !1;
|
|
165
|
+
Q();
|
|
166
|
+
const W = () => {
|
|
167
|
+
fetch(b).then((g) => g.json()).then((g) => {
|
|
168
|
+
Object.keys(g).forEach((h) => {
|
|
169
|
+
se(h, g[h]);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
}, j = (s) => {
|
|
173
|
+
f && f.setDrawResult(s);
|
|
174
|
+
}, A = () => {
|
|
175
|
+
m || (n(6, m = !0), f && f.eventSpin());
|
|
176
|
+
};
|
|
177
|
+
X(() => {
|
|
178
|
+
const s = (g) => {
|
|
179
|
+
const { type: h, data: B } = g.data;
|
|
180
|
+
h === "PrizeGameResult" ? j(B) : h === "PrizeResultClose" ? (n(6, m = !1), f && f.closeMessage()) : h === "PrizeGameStartAnimation" && A();
|
|
181
|
+
};
|
|
182
|
+
return window.addEventListener("message", s), () => {
|
|
183
|
+
window.removeEventListener("message", s);
|
|
184
|
+
};
|
|
185
|
+
});
|
|
186
|
+
function D(s) {
|
|
187
|
+
R[s ? "unshift" : "push"](() => {
|
|
188
|
+
f = s, n(5, f);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
const U = () => n(6, m = !0), q = () => window.postMessage({ type: "PrizeGameRequestDraw" }, "*"), x = () => window.postMessage({ type: "PrizeGameSpinEnd" }, "*");
|
|
192
|
+
function O(s) {
|
|
193
|
+
R[s ? "unshift" : "push"](() => {
|
|
194
|
+
a = s, n(2, a);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return t.$$set = (s) => {
|
|
198
|
+
"data" in s && n(9, r = s.data), "lang" in s && n(0, c = s.lang), "clientstyling" in s && n(10, u = s.clientstyling), "clientstylingurl" in s && n(11, y = s.clientstylingurl), "translationurl" in s && n(12, b = s.translationurl), "mbsource" in s && n(13, S = s.mbsource), "size" in s && n(14, p = s.size), "mobilesize" in s && n(15, _ = s.mobilesize), "contentdirection" in s && n(1, E = s.contentdirection);
|
|
199
|
+
}, t.$$.update = () => {
|
|
200
|
+
if (t.$$.dirty & /*data*/
|
|
201
|
+
512)
|
|
202
|
+
if (typeof r == "string")
|
|
203
|
+
try {
|
|
204
|
+
n(4, L = JSON.parse(r));
|
|
205
|
+
} catch (s) {
|
|
206
|
+
console.error("[Luckywheel] Parse failed", s);
|
|
207
|
+
}
|
|
208
|
+
else
|
|
209
|
+
n(4, L = r);
|
|
210
|
+
t.$$.dirty & /*lang*/
|
|
211
|
+
1 && c && Z(c), t.$$.dirty & /*translationurl*/
|
|
212
|
+
4096 && b && W(), t.$$.dirty & /*clientstyling, rootContainer*/
|
|
213
|
+
1028 && u && a && re(a, u), t.$$.dirty & /*clientstylingurl, rootContainer*/
|
|
214
|
+
2052 && y && a && oe(a, y), t.$$.dirty & /*mbsource, rootContainer*/
|
|
215
|
+
8196 && S && a && ce(a, `${S}.Style`, ge), t.$$.dirty & /*mobilesize, size*/
|
|
216
|
+
49152 && n(16, i = P && _ ? _ : p), t.$$.dirty & /*_size*/
|
|
217
|
+
65536 && n(3, l = i / 0.6875), t.$$.dirty & /*_internalSize*/
|
|
218
|
+
8 && n(7, o = 0.62 * l / 2);
|
|
219
|
+
}, [
|
|
220
|
+
c,
|
|
221
|
+
E,
|
|
222
|
+
a,
|
|
223
|
+
l,
|
|
224
|
+
L,
|
|
225
|
+
f,
|
|
226
|
+
m,
|
|
227
|
+
o,
|
|
228
|
+
P,
|
|
229
|
+
r,
|
|
230
|
+
u,
|
|
231
|
+
y,
|
|
232
|
+
b,
|
|
233
|
+
S,
|
|
234
|
+
p,
|
|
235
|
+
_,
|
|
236
|
+
i,
|
|
237
|
+
D,
|
|
238
|
+
U,
|
|
239
|
+
q,
|
|
240
|
+
x,
|
|
241
|
+
O
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
class we extends H {
|
|
245
|
+
constructor(e) {
|
|
246
|
+
super(), N(
|
|
247
|
+
this,
|
|
248
|
+
e,
|
|
249
|
+
he,
|
|
250
|
+
de,
|
|
251
|
+
I,
|
|
252
|
+
{
|
|
253
|
+
data: 9,
|
|
254
|
+
lang: 0,
|
|
255
|
+
clientstyling: 10,
|
|
256
|
+
clientstylingurl: 11,
|
|
257
|
+
translationurl: 12,
|
|
258
|
+
mbsource: 13,
|
|
259
|
+
size: 14,
|
|
260
|
+
mobilesize: 15,
|
|
261
|
+
contentdirection: 1
|
|
262
|
+
},
|
|
263
|
+
fe
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
get data() {
|
|
267
|
+
return this.$$.ctx[9];
|
|
268
|
+
}
|
|
269
|
+
set data(e) {
|
|
270
|
+
this.$$set({ data: e }), d();
|
|
271
|
+
}
|
|
272
|
+
get lang() {
|
|
273
|
+
return this.$$.ctx[0];
|
|
274
|
+
}
|
|
275
|
+
set lang(e) {
|
|
276
|
+
this.$$set({ lang: e }), d();
|
|
277
|
+
}
|
|
278
|
+
get clientstyling() {
|
|
279
|
+
return this.$$.ctx[10];
|
|
280
|
+
}
|
|
281
|
+
set clientstyling(e) {
|
|
282
|
+
this.$$set({ clientstyling: e }), d();
|
|
283
|
+
}
|
|
284
|
+
get clientstylingurl() {
|
|
285
|
+
return this.$$.ctx[11];
|
|
286
|
+
}
|
|
287
|
+
set clientstylingurl(e) {
|
|
288
|
+
this.$$set({ clientstylingurl: e }), d();
|
|
289
|
+
}
|
|
290
|
+
get translationurl() {
|
|
291
|
+
return this.$$.ctx[12];
|
|
292
|
+
}
|
|
293
|
+
set translationurl(e) {
|
|
294
|
+
this.$$set({ translationurl: e }), d();
|
|
295
|
+
}
|
|
296
|
+
get mbsource() {
|
|
297
|
+
return this.$$.ctx[13];
|
|
298
|
+
}
|
|
299
|
+
set mbsource(e) {
|
|
300
|
+
this.$$set({ mbsource: e }), d();
|
|
301
|
+
}
|
|
302
|
+
get size() {
|
|
303
|
+
return this.$$.ctx[14];
|
|
304
|
+
}
|
|
305
|
+
set size(e) {
|
|
306
|
+
this.$$set({ size: e }), d();
|
|
307
|
+
}
|
|
308
|
+
get mobilesize() {
|
|
309
|
+
return this.$$.ctx[15];
|
|
310
|
+
}
|
|
311
|
+
set mobilesize(e) {
|
|
312
|
+
this.$$set({ mobilesize: e }), d();
|
|
313
|
+
}
|
|
314
|
+
get contentdirection() {
|
|
315
|
+
return this.$$.ctx[1];
|
|
316
|
+
}
|
|
317
|
+
set contentdirection(e) {
|
|
318
|
+
this.$$set({ contentdirection: e }), d();
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
customElements.define("prize-engine-luckywheel", V(we, { data: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, size: {}, mobilesize: {}, contentdirection: {} }, [], [], !0));
|
|
322
|
+
export {
|
|
323
|
+
we as default
|
|
324
|
+
};
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { c as H, S as N, i as I, f as d, s as V, a as F, d as G, t as M, b as z, e as J, g as T, h as C, j as k, k as K, l as Y, m as Q, o as X, n as Z, W as $, p as ee, q as te, r as ne, u as ie, v as se, w as R, x as le } from "./WheelSVG-Brhzl2qz.js";
|
|
2
|
+
const w = "__WIDGET_GLOBAL_STYLE_CACHE__";
|
|
3
|
+
function re(t, e) {
|
|
4
|
+
if (t) {
|
|
5
|
+
const n = document.createElement("style");
|
|
6
|
+
n.innerHTML = e, t.appendChild(n);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function oe(t, e) {
|
|
10
|
+
if (!t || !e)
|
|
11
|
+
return;
|
|
12
|
+
const n = new URL(e);
|
|
13
|
+
fetch(n.href).then((i) => i.text()).then((i) => {
|
|
14
|
+
const l = document.createElement("style");
|
|
15
|
+
l.innerHTML = i, t && t.appendChild(l);
|
|
16
|
+
}).catch((i) => {
|
|
17
|
+
console.error("There was an error while trying to load client styling from URL", i);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function ce(t, e, n, i = !1) {
|
|
21
|
+
if (!window.emMessageBus)
|
|
22
|
+
return;
|
|
23
|
+
if (!("adoptedStyleSheets" in Document.prototype) || !i)
|
|
24
|
+
return n = ue(t, e), n;
|
|
25
|
+
window[w] || (window[w] = {}), n = ae(t, e);
|
|
26
|
+
const o = n.unsubscribe.bind(n), r = () => {
|
|
27
|
+
if (window[w][e]) {
|
|
28
|
+
const c = window[w][e];
|
|
29
|
+
c.refCount > 1 ? c.refCount = c.refCount - 1 : delete window[w][e];
|
|
30
|
+
}
|
|
31
|
+
o();
|
|
32
|
+
};
|
|
33
|
+
return n.unsubscribe = r, n;
|
|
34
|
+
}
|
|
35
|
+
function ue(t, e) {
|
|
36
|
+
const n = document.createElement("style");
|
|
37
|
+
return window.emMessageBus.subscribe(e, (i) => {
|
|
38
|
+
t && (n.innerHTML = i, t.appendChild(n));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function ae(t, e) {
|
|
42
|
+
return window.emMessageBus.subscribe(e, (n) => {
|
|
43
|
+
if (!t)
|
|
44
|
+
return;
|
|
45
|
+
const i = t.getRootNode(), l = window[w];
|
|
46
|
+
let o = l[e] && l[e].sheet;
|
|
47
|
+
o ? l[e].refCount = l[e].refCount + 1 : (o = new CSSStyleSheet(), o.replaceSync(n), l[e] = {
|
|
48
|
+
sheet: o,
|
|
49
|
+
refCount: 1
|
|
50
|
+
});
|
|
51
|
+
const r = i.adoptedStyleSheets || [];
|
|
52
|
+
r.includes(o) || (i.adoptedStyleSheets = [...r, o]);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function fe(t) {
|
|
56
|
+
F(t, "svelte-12d9sfg", '.PrizeLuckywheelContainer.svelte-12d9sfg{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;padding:20px;box-sizing:border-box;font-family:var(--emw--font-family-primary, "Ubuntu", sans-serif)}.PrizeLuckywheelContainer.Mobile.svelte-12d9sfg{padding:10px}.MainSection.svelte-12d9sfg{flex-grow:1;display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;position:relative}.WheelWrapper.svelte-12d9sfg{flex-grow:1;display:flex;align-items:center;justify-content:center;min-height:0;width:100%}');
|
|
57
|
+
}
|
|
58
|
+
function v(t) {
|
|
59
|
+
let e, n, i, l, o = {
|
|
60
|
+
lang: (
|
|
61
|
+
/*lang*/
|
|
62
|
+
t[0]
|
|
63
|
+
),
|
|
64
|
+
contentdirection: (
|
|
65
|
+
/*contentdirection*/
|
|
66
|
+
t[1]
|
|
67
|
+
),
|
|
68
|
+
bonus: (
|
|
69
|
+
/*activeGame*/
|
|
70
|
+
t[4]
|
|
71
|
+
),
|
|
72
|
+
size: (
|
|
73
|
+
/*_internalSize*/
|
|
74
|
+
t[3]
|
|
75
|
+
),
|
|
76
|
+
radius: (
|
|
77
|
+
/*radius*/
|
|
78
|
+
t[7]
|
|
79
|
+
)
|
|
80
|
+
};
|
|
81
|
+
return i = new $({ props: o }), t[17](i), i.$on(
|
|
82
|
+
"spinning",
|
|
83
|
+
/*spinning_handler*/
|
|
84
|
+
t[18]
|
|
85
|
+
), i.$on(
|
|
86
|
+
"spinning-request",
|
|
87
|
+
/*spinning_request_handler*/
|
|
88
|
+
t[19]
|
|
89
|
+
), i.$on(
|
|
90
|
+
"success",
|
|
91
|
+
/*success_handler*/
|
|
92
|
+
t[20]
|
|
93
|
+
), {
|
|
94
|
+
c() {
|
|
95
|
+
e = C("div"), n = C("div"), ie(i.$$.fragment), k(n, "class", "WheelWrapper svelte-12d9sfg"), k(e, "class", "MainSection svelte-12d9sfg");
|
|
96
|
+
},
|
|
97
|
+
m(r, c) {
|
|
98
|
+
T(r, e, c), te(e, n), ne(i, n, null), l = !0;
|
|
99
|
+
},
|
|
100
|
+
p(r, c) {
|
|
101
|
+
const u = {};
|
|
102
|
+
c & /*lang*/
|
|
103
|
+
1 && (u.lang = /*lang*/
|
|
104
|
+
r[0]), c & /*contentdirection*/
|
|
105
|
+
2 && (u.contentdirection = /*contentdirection*/
|
|
106
|
+
r[1]), c & /*activeGame*/
|
|
107
|
+
16 && (u.bonus = /*activeGame*/
|
|
108
|
+
r[4]), c & /*_internalSize*/
|
|
109
|
+
8 && (u.size = /*_internalSize*/
|
|
110
|
+
r[3]), c & /*radius*/
|
|
111
|
+
128 && (u.radius = /*radius*/
|
|
112
|
+
r[7]), i.$set(u);
|
|
113
|
+
},
|
|
114
|
+
i(r) {
|
|
115
|
+
l || (z(i.$$.fragment, r), l = !0);
|
|
116
|
+
},
|
|
117
|
+
o(r) {
|
|
118
|
+
M(i.$$.fragment, r), l = !1;
|
|
119
|
+
},
|
|
120
|
+
d(r) {
|
|
121
|
+
r && G(e), t[17](null), ee(i);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function de(t) {
|
|
126
|
+
let e, n, i = (
|
|
127
|
+
/*activeGame*/
|
|
128
|
+
t[4] && v(t)
|
|
129
|
+
);
|
|
130
|
+
return {
|
|
131
|
+
c() {
|
|
132
|
+
e = C("div"), i && i.c(), k(e, "class", "PrizeLuckywheelContainer svelte-12d9sfg"), K(
|
|
133
|
+
e,
|
|
134
|
+
"Mobile",
|
|
135
|
+
/*mobileView*/
|
|
136
|
+
t[8]
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
m(l, o) {
|
|
140
|
+
T(l, e, o), i && i.m(e, null), t[21](e), n = !0;
|
|
141
|
+
},
|
|
142
|
+
p(l, [o]) {
|
|
143
|
+
/*activeGame*/
|
|
144
|
+
l[4] ? i ? (i.p(l, o), o & /*activeGame*/
|
|
145
|
+
16 && z(i, 1)) : (i = v(l), i.c(), z(i, 1), i.m(e, null)) : i && (le(), M(i, 1, 1, () => {
|
|
146
|
+
i = null;
|
|
147
|
+
}), J());
|
|
148
|
+
},
|
|
149
|
+
i(l) {
|
|
150
|
+
n || (z(i), n = !0);
|
|
151
|
+
},
|
|
152
|
+
o(l) {
|
|
153
|
+
M(i), n = !1;
|
|
154
|
+
},
|
|
155
|
+
d(l) {
|
|
156
|
+
l && G(e), i && i.d(), t[21](null);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
let ge = null;
|
|
161
|
+
function he(t, e, n) {
|
|
162
|
+
let i, l, o, { data: r = null } = e, { lang: c = "en" } = e, { clientstyling: u = "" } = e, { clientstylingurl: y = "" } = e, { translationurl: b = "" } = e, { mbsource: S = "" } = e, { size: p = 324 } = e, { mobilesize: _ = 240 } = e, { contentdirection: E = "anticlockwise" } = e, L = null, a;
|
|
163
|
+
const P = Y(window.navigator.userAgent);
|
|
164
|
+
let f, m = !1;
|
|
165
|
+
Q();
|
|
166
|
+
const W = () => {
|
|
167
|
+
fetch(b).then((g) => g.json()).then((g) => {
|
|
168
|
+
Object.keys(g).forEach((h) => {
|
|
169
|
+
se(h, g[h]);
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
}, j = (s) => {
|
|
173
|
+
f && f.setDrawResult(s);
|
|
174
|
+
}, A = () => {
|
|
175
|
+
m || (n(6, m = !0), f && f.eventSpin());
|
|
176
|
+
};
|
|
177
|
+
X(() => {
|
|
178
|
+
const s = (g) => {
|
|
179
|
+
const { type: h, data: B } = g.data;
|
|
180
|
+
h === "PrizeGameResult" ? j(B) : h === "PrizeResultClose" ? (n(6, m = !1), f && f.closeMessage()) : h === "PrizeGameStartAnimation" && A();
|
|
181
|
+
};
|
|
182
|
+
return window.addEventListener("message", s), () => {
|
|
183
|
+
window.removeEventListener("message", s);
|
|
184
|
+
};
|
|
185
|
+
});
|
|
186
|
+
function D(s) {
|
|
187
|
+
R[s ? "unshift" : "push"](() => {
|
|
188
|
+
f = s, n(5, f);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
const U = () => n(6, m = !0), q = () => window.postMessage({ type: "PrizeGameRequestDraw" }, "*"), x = () => window.postMessage({ type: "PrizeGameSpinEnd" }, "*");
|
|
192
|
+
function O(s) {
|
|
193
|
+
R[s ? "unshift" : "push"](() => {
|
|
194
|
+
a = s, n(2, a);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return t.$$set = (s) => {
|
|
198
|
+
"data" in s && n(9, r = s.data), "lang" in s && n(0, c = s.lang), "clientstyling" in s && n(10, u = s.clientstyling), "clientstylingurl" in s && n(11, y = s.clientstylingurl), "translationurl" in s && n(12, b = s.translationurl), "mbsource" in s && n(13, S = s.mbsource), "size" in s && n(14, p = s.size), "mobilesize" in s && n(15, _ = s.mobilesize), "contentdirection" in s && n(1, E = s.contentdirection);
|
|
199
|
+
}, t.$$.update = () => {
|
|
200
|
+
if (t.$$.dirty & /*data*/
|
|
201
|
+
512)
|
|
202
|
+
if (typeof r == "string")
|
|
203
|
+
try {
|
|
204
|
+
n(4, L = JSON.parse(r));
|
|
205
|
+
} catch (s) {
|
|
206
|
+
console.error("[Luckywheel] Parse failed", s);
|
|
207
|
+
}
|
|
208
|
+
else
|
|
209
|
+
n(4, L = r);
|
|
210
|
+
t.$$.dirty & /*lang*/
|
|
211
|
+
1 && c && Z(c), t.$$.dirty & /*translationurl*/
|
|
212
|
+
4096 && b && W(), t.$$.dirty & /*clientstyling, rootContainer*/
|
|
213
|
+
1028 && u && a && re(a, u), t.$$.dirty & /*clientstylingurl, rootContainer*/
|
|
214
|
+
2052 && y && a && oe(a, y), t.$$.dirty & /*mbsource, rootContainer*/
|
|
215
|
+
8196 && S && a && ce(a, `${S}.Style`, ge), t.$$.dirty & /*mobilesize, size*/
|
|
216
|
+
49152 && n(16, i = P && _ ? _ : p), t.$$.dirty & /*_size*/
|
|
217
|
+
65536 && n(3, l = i / 0.6875), t.$$.dirty & /*_internalSize*/
|
|
218
|
+
8 && n(7, o = 0.62 * l / 2);
|
|
219
|
+
}, [
|
|
220
|
+
c,
|
|
221
|
+
E,
|
|
222
|
+
a,
|
|
223
|
+
l,
|
|
224
|
+
L,
|
|
225
|
+
f,
|
|
226
|
+
m,
|
|
227
|
+
o,
|
|
228
|
+
P,
|
|
229
|
+
r,
|
|
230
|
+
u,
|
|
231
|
+
y,
|
|
232
|
+
b,
|
|
233
|
+
S,
|
|
234
|
+
p,
|
|
235
|
+
_,
|
|
236
|
+
i,
|
|
237
|
+
D,
|
|
238
|
+
U,
|
|
239
|
+
q,
|
|
240
|
+
x,
|
|
241
|
+
O
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
class we extends N {
|
|
245
|
+
constructor(e) {
|
|
246
|
+
super(), I(
|
|
247
|
+
this,
|
|
248
|
+
e,
|
|
249
|
+
he,
|
|
250
|
+
de,
|
|
251
|
+
V,
|
|
252
|
+
{
|
|
253
|
+
data: 9,
|
|
254
|
+
lang: 0,
|
|
255
|
+
clientstyling: 10,
|
|
256
|
+
clientstylingurl: 11,
|
|
257
|
+
translationurl: 12,
|
|
258
|
+
mbsource: 13,
|
|
259
|
+
size: 14,
|
|
260
|
+
mobilesize: 15,
|
|
261
|
+
contentdirection: 1
|
|
262
|
+
},
|
|
263
|
+
fe
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
get data() {
|
|
267
|
+
return this.$$.ctx[9];
|
|
268
|
+
}
|
|
269
|
+
set data(e) {
|
|
270
|
+
this.$$set({ data: e }), d();
|
|
271
|
+
}
|
|
272
|
+
get lang() {
|
|
273
|
+
return this.$$.ctx[0];
|
|
274
|
+
}
|
|
275
|
+
set lang(e) {
|
|
276
|
+
this.$$set({ lang: e }), d();
|
|
277
|
+
}
|
|
278
|
+
get clientstyling() {
|
|
279
|
+
return this.$$.ctx[10];
|
|
280
|
+
}
|
|
281
|
+
set clientstyling(e) {
|
|
282
|
+
this.$$set({ clientstyling: e }), d();
|
|
283
|
+
}
|
|
284
|
+
get clientstylingurl() {
|
|
285
|
+
return this.$$.ctx[11];
|
|
286
|
+
}
|
|
287
|
+
set clientstylingurl(e) {
|
|
288
|
+
this.$$set({ clientstylingurl: e }), d();
|
|
289
|
+
}
|
|
290
|
+
get translationurl() {
|
|
291
|
+
return this.$$.ctx[12];
|
|
292
|
+
}
|
|
293
|
+
set translationurl(e) {
|
|
294
|
+
this.$$set({ translationurl: e }), d();
|
|
295
|
+
}
|
|
296
|
+
get mbsource() {
|
|
297
|
+
return this.$$.ctx[13];
|
|
298
|
+
}
|
|
299
|
+
set mbsource(e) {
|
|
300
|
+
this.$$set({ mbsource: e }), d();
|
|
301
|
+
}
|
|
302
|
+
get size() {
|
|
303
|
+
return this.$$.ctx[14];
|
|
304
|
+
}
|
|
305
|
+
set size(e) {
|
|
306
|
+
this.$$set({ size: e }), d();
|
|
307
|
+
}
|
|
308
|
+
get mobilesize() {
|
|
309
|
+
return this.$$.ctx[15];
|
|
310
|
+
}
|
|
311
|
+
set mobilesize(e) {
|
|
312
|
+
this.$$set({ mobilesize: e }), d();
|
|
313
|
+
}
|
|
314
|
+
get contentdirection() {
|
|
315
|
+
return this.$$.ctx[1];
|
|
316
|
+
}
|
|
317
|
+
set contentdirection(e) {
|
|
318
|
+
this.$$set({ contentdirection: e }), d();
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
customElements.define("prize-engine-luckywheel", H(we, { data: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, size: {}, mobilesize: {}, contentdirection: {} }, [], [], !0));
|
|
322
|
+
export {
|
|
323
|
+
we as P
|
|
324
|
+
};
|