@everymatrix/casino-engagement-suite-luckywheel 0.1.0 → 0.2.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 (33) hide show
  1. package/dist/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.esm.js +1 -1
  2. package/dist/casino-engagement-suite-luckywheel/index.esm.js +1 -1
  3. package/dist/casino-engagement-suite-luckywheel/p-2a6e103b.entry.js +1 -0
  4. package/dist/casino-engagement-suite-luckywheel/p-781c5f2a.js +1 -0
  5. package/dist/casino-engagement-suite-luckywheel/p-eaad80fd.js +2 -0
  6. package/dist/cjs/{casino-engagement-suite-luckywheel-46532b7a.js → casino-engagement-suite-luckywheel-cc8d37c2.js} +30 -19
  7. package/dist/cjs/casino-engagement-suite-luckywheel.cjs.entry.js +2 -2
  8. package/dist/cjs/casino-engagement-suite-luckywheel.cjs.js +2 -2
  9. package/dist/cjs/{index-b8cc2368.js → index-b46604f4.js} +173 -70
  10. package/dist/cjs/index.cjs.js +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/collection/collection-manifest.json +1 -1
  13. package/dist/collection/components/casino-engagement-suite-luckywheel/casino-engagement-suite-luckywheel.js +44 -19
  14. package/dist/esm/{casino-engagement-suite-luckywheel-b370bbfe.js → casino-engagement-suite-luckywheel-cf7e798a.js} +30 -19
  15. package/dist/esm/casino-engagement-suite-luckywheel.entry.js +2 -2
  16. package/dist/esm/casino-engagement-suite-luckywheel.js +3 -3
  17. package/dist/esm/{index-0b3806b2.js → index-8ce51859.js} +173 -70
  18. package/dist/esm/index.js +2 -2
  19. package/dist/esm/loader.js +2 -2
  20. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +2 -0
  21. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +2 -0
  22. package/package.json +1 -1
  23. package/dist/casino-engagement-suite-luckywheel/p-2afd9927.entry.js +0 -1
  24. package/dist/casino-engagement-suite-luckywheel/p-5da7530f.js +0 -1
  25. package/dist/casino-engagement-suite-luckywheel/p-fc393d1b.js +0 -2
  26. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.d.ts +0 -2
  27. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/packages/stencil/casino-engagement-suite-luckywheel/stencil.config.dev.d.ts +0 -2
  28. /package/dist/types/Users/{maria.bumbar/Desktop → 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
  29. /package/dist/types/Users/{maria.bumbar/Desktop → 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
  30. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/index.d.ts +0 -0
  31. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  32. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  33. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/casino-engagement-suite-luckywheel/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, g as getElement } from './index-0b3806b2.js';
1
+ import { r as registerInstance, h, g as getElement } from './index-8ce51859.js';
2
2
 
3
3
  /******************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -556,6 +556,35 @@ const CasinoEngagementSuiteLuckywheelStyle0 = casinoEngagementSuiteLuckywheelCss
556
556
  const CasinoEngagementSuiteLuckywheel = class {
557
557
  constructor(hostRef) {
558
558
  registerInstance(this, hostRef);
559
+ /**
560
+ * Client custom styling via string
561
+ */
562
+ this.clientStyling = '';
563
+ /**
564
+ * Client custom styling via url
565
+ */
566
+ this.clientStylingUrl = '';
567
+ /**
568
+ * Language of the widget
569
+ */
570
+ this.language = 'en';
571
+ /**
572
+ * User's device type
573
+ */
574
+ this.device = 'Mobile';
575
+ /**
576
+ * Wheel size
577
+ */
578
+ this.size = '440';
579
+ /**
580
+ * Content Direction
581
+ */
582
+ this.contentdirection = 'anticlockwise';
583
+ this.limitStylingAppends = false;
584
+ this.isPartitionsCustomableReady = false;
585
+ this.isSpinning = false;
586
+ this.radius = 0.85 * Number(this.size) / 2;
587
+ this.speed = 0;
559
588
  this.setClientStyling = () => {
560
589
  let sheet = document.createElement('style');
561
590
  sheet.innerHTML = this.clientStyling;
@@ -622,24 +651,6 @@ const CasinoEngagementSuiteLuckywheel = class {
622
651
  }
623
652
  this.eventSpin();
624
653
  };
625
- this.clientStyling = '';
626
- this.clientStylingUrl = '';
627
- this.language = 'en';
628
- this.device = 'Mobile';
629
- this.luckywheel = undefined;
630
- this.size = '440';
631
- this.contentdirection = 'anticlockwise';
632
- this.limitStylingAppends = false;
633
- this.isPartitionsCustomableReady = false;
634
- this.isSpinning = false;
635
- this.options = undefined;
636
- this.radius = 0.85 * Number(this.size) / 2;
637
- this.speed = 0;
638
- this.settings = undefined;
639
- this.svg = undefined;
640
- this.spinContainer = undefined;
641
- this.spinable = undefined;
642
- this.spinner = undefined;
643
654
  }
644
655
  handleEvent(e) {
645
656
  const _a = e === null || e === void 0 ? void 0 : e.data, { type } = _a, rest = __rest(_a, ["type"]);
@@ -1,2 +1,2 @@
1
- export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-b370bbfe.js';
2
- import './index-0b3806b2.js';
1
+ export { C as casino_engagement_suite_luckywheel } from './casino-engagement-suite-luckywheel-cf7e798a.js';
2
+ import './index-8ce51859.js';
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-0b3806b2.js';
2
- export { s as setNonce } from './index-0b3806b2.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-8ce51859.js';
2
+ export { s as setNonce } from './index-8ce51859.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.26.0 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;
@@ -1,17 +1,25 @@
1
1
  const NAMESPACE = 'casino-engagement-suite-luckywheel';
2
- const BUILD = /* casino-engagement-suite-luckywheel */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: false };
2
+ const BUILD = /* casino-engagement-suite-luckywheel */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: false, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: false };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
+
13
+ // src/utils/constants.ts
14
+ var SVG_NS = "http://www.w3.org/2000/svg";
15
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
16
+
17
+ // src/client/client-host-ref.ts
12
18
  var hostRefs = /* @__PURE__ */ new WeakMap();
13
19
  var getHostRef = (ref) => hostRefs.get(ref);
14
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
20
+ var registerInstance = (lazyInstance, hostRef) => {
21
+ hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
22
+ };
15
23
  var registerHost = (hostElement, cmpMeta) => {
16
24
  const hostRef = {
17
25
  $flags$: 0,
@@ -24,7 +32,8 @@ var registerHost = (hostElement, cmpMeta) => {
24
32
  hostElement["s-p"] = [];
25
33
  hostElement["s-rc"] = [];
26
34
  }
27
- return hostRefs.set(hostElement, hostRef);
35
+ const ref = hostRefs.set(hostElement, hostRef);
36
+ return ref;
28
37
  };
29
38
  var isMemberInElement = (elm, memberName) => memberName in elm;
30
39
  var consoleError = (e, el) => (0, console.error)(e, el);
@@ -61,16 +70,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
61
70
  /* webpackExclude: /\.system\.entry\.js$/ */
62
71
  /* webpackMode: "lazy" */
63
72
  `./${bundleId}.entry.js${""}`
64
- ).then((importedModule) => {
65
- {
66
- cmpModules.set(bundleId, importedModule);
73
+ ).then(
74
+ (importedModule) => {
75
+ {
76
+ cmpModules.set(bundleId, importedModule);
77
+ }
78
+ return importedModule[exportName];
79
+ },
80
+ (e) => {
81
+ consoleError(e, hostRef.$hostElement$);
67
82
  }
68
- return importedModule[exportName];
69
- }, consoleError);
83
+ );
70
84
  };
71
85
 
72
86
  // src/client/client-style.ts
73
87
  var styles = /* @__PURE__ */ new Map();
88
+ var HYDRATED_STYLE_ID = "sty-id";
74
89
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
75
90
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
76
91
  var XLINK_NS = "http://www.w3.org/1999/xlink";
@@ -145,14 +160,6 @@ var flush = () => {
145
160
  };
146
161
  var nextTick = (cb) => promiseResolve().then(cb);
147
162
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
148
-
149
- // src/utils/constants.ts
150
- var EMPTY_OBJ = {};
151
- var SVG_NS = "http://www.w3.org/2000/svg";
152
- var HTML_NS = "http://www.w3.org/1999/xhtml";
153
-
154
- // src/utils/helpers.ts
155
- var isDef = (v) => v != null;
156
163
  var isComplexType = (o) => {
157
164
  o = typeof o;
158
165
  return o === "object" || o === "function";
@@ -335,7 +342,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
335
342
  }
336
343
  if (!appliedStyles.has(scopeId2)) {
337
344
  {
338
- styleElm = doc.createElement("style");
345
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
339
346
  styleElm.innerHTML = style;
340
347
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
341
348
  if (nonce != null) {
@@ -345,7 +352,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
345
352
  if (styleContainerNode.nodeName === "HEAD") {
346
353
  const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
347
354
  const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
348
- styleContainerNode.insertBefore(styleElm, referenceNode2);
355
+ styleContainerNode.insertBefore(
356
+ styleElm,
357
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
358
+ );
349
359
  } else if ("host" in styleContainerNode) {
350
360
  if (supportsConstructableStylesheets) {
351
361
  const stylesheet = new CSSStyleSheet();
@@ -363,7 +373,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
363
373
  styleContainerNode.append(styleElm);
364
374
  }
365
375
  }
366
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
376
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
367
377
  styleContainerNode.insertBefore(styleElm, null);
368
378
  }
369
379
  }
@@ -388,23 +398,25 @@ var attachStyles = (hostRef) => {
388
398
  const scopeId2 = addStyle(
389
399
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
390
400
  cmpMeta);
391
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
401
+ if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
392
402
  elm["s-sc"] = scopeId2;
393
403
  elm.classList.add(scopeId2 + "-h");
394
404
  }
395
405
  endAttachStyles();
396
406
  };
397
407
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
398
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
408
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
399
409
  if (oldValue !== newValue) {
400
410
  let isProp = isMemberInElement(elm, memberName);
401
411
  let ln = memberName.toLowerCase();
402
412
  if (memberName === "class") {
403
413
  const classList = elm.classList;
404
414
  const oldClasses = parseClassList(oldValue);
405
- const newClasses = parseClassList(newValue);
406
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
407
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
415
+ let newClasses = parseClassList(newValue);
416
+ {
417
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
418
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
419
+ }
408
420
  } else if (memberName === "style") {
409
421
  {
410
422
  for (const prop in oldValue) {
@@ -463,7 +475,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
463
475
  elm.setAttribute(memberName, n);
464
476
  }
465
477
  }
466
- } else {
478
+ } else if (elm[memberName] !== newValue) {
467
479
  elm[memberName] = newValue;
468
480
  }
469
481
  } catch (e) {
@@ -496,24 +508,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
496
508
  }
497
509
  };
498
510
  var parseClassListRegex = /\s/;
499
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
511
+ var parseClassList = (value) => {
512
+ if (typeof value === "object" && value && "baseVal" in value) {
513
+ value = value.baseVal;
514
+ }
515
+ if (!value || typeof value !== "string") {
516
+ return [];
517
+ }
518
+ return value.split(parseClassListRegex);
519
+ };
500
520
  var CAPTURE_EVENT_SUFFIX = "Capture";
501
521
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
502
522
 
503
523
  // src/runtime/vdom/update-element.ts
504
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
524
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
505
525
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
506
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
507
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
526
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
527
+ const newVnodeAttrs = newVnode.$attrs$ || {};
508
528
  {
509
529
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
510
530
  if (!(memberName in newVnodeAttrs)) {
511
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
531
+ setAccessor(
532
+ elm,
533
+ memberName,
534
+ oldVnodeAttrs[memberName],
535
+ void 0,
536
+ isSvgMode2,
537
+ newVnode.$flags$);
512
538
  }
513
539
  }
514
540
  }
515
541
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
516
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
542
+ setAccessor(
543
+ elm,
544
+ memberName,
545
+ oldVnodeAttrs[memberName],
546
+ newVnodeAttrs[memberName],
547
+ isSvgMode2,
548
+ newVnode.$flags$);
517
549
  }
518
550
  };
519
551
  function sortedAttrNames(attrNames) {
@@ -525,13 +557,10 @@ function sortedAttrNames(attrNames) {
525
557
  attrNames
526
558
  );
527
559
  }
528
-
529
- // src/runtime/vdom/vdom-render.ts
530
- var scopeId;
531
560
  var hostTagName;
532
561
  var useNativeShadowDom = false;
533
562
  var isSvgMode = false;
534
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
563
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
535
564
  const newVNode2 = newParentVNode.$children$[childIndex];
536
565
  let i2 = 0;
537
566
  let elm;
@@ -552,11 +581,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
552
581
  {
553
582
  updateElement(null, newVNode2, isSvgMode);
554
583
  }
555
- const rootNode = elm.getRootNode();
556
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
557
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
558
- elm.classList.add(elm["s-si"] = scopeId);
559
- }
560
584
  if (newVNode2.$children$) {
561
585
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
562
586
  childNode = createElm(oldParentVNode, newVNode2, i2);
@@ -693,6 +717,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
693
717
  if (!isInitialRender) {
694
718
  return leftVNode.$key$ === rightVNode.$key$;
695
719
  }
720
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
721
+ leftVNode.$key$ = rightVNode.$key$;
722
+ }
696
723
  return true;
697
724
  }
698
725
  return false;
@@ -739,8 +766,9 @@ var nullifyVNodeRefs = (vNode) => {
739
766
  }
740
767
  };
741
768
  var insertBefore = (parent, newNode, reference) => {
742
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
743
- return inserted;
769
+ {
770
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
771
+ }
744
772
  };
745
773
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
746
774
  const hostElm = hostRef.$hostElement$;
@@ -765,17 +793,21 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
765
793
  rootVnode.$flags$ |= 4 /* isHost */;
766
794
  hostRef.$vnode$ = rootVnode;
767
795
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
768
- {
769
- scopeId = hostElm["s-sc"];
770
- }
771
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
796
+ useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
772
797
  patch(oldVNode, rootVnode, isInitialLoad);
773
798
  };
774
799
 
775
800
  // src/runtime/update-component.ts
776
801
  var attachToAncestor = (hostRef, ancestorComponent) => {
777
802
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
778
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
803
+ const index = ancestorComponent["s-p"].push(
804
+ new Promise(
805
+ (r) => hostRef.$onRenderResolve$ = () => {
806
+ ancestorComponent["s-p"].splice(index - 1, 1);
807
+ r();
808
+ }
809
+ )
810
+ );
779
811
  }
780
812
  };
781
813
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -804,12 +836,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
804
836
  {
805
837
  hostRef.$flags$ |= 256 /* isListenReady */;
806
838
  if (hostRef.$queuedListeners$) {
807
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
839
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
808
840
  hostRef.$queuedListeners$ = void 0;
809
841
  }
810
842
  }
811
843
  {
812
- maybePromise = safeCall(instance, "componentWillLoad");
844
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
813
845
  }
814
846
  }
815
847
  endSchedule();
@@ -878,7 +910,7 @@ var postUpdateComponent = (hostRef) => {
878
910
  const instance = hostRef.$lazyInstance$ ;
879
911
  const ancestorComponent = hostRef.$ancestorComponent$;
880
912
  {
881
- safeCall(instance, "componentDidRender");
913
+ safeCall(instance, "componentDidRender", void 0, elm);
882
914
  }
883
915
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
884
916
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
@@ -907,17 +939,14 @@ var postUpdateComponent = (hostRef) => {
907
939
  }
908
940
  };
909
941
  var appDidLoad = (who) => {
910
- {
911
- addHydratedFlag(doc.documentElement);
912
- }
913
942
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
914
943
  };
915
- var safeCall = (instance, method, arg) => {
944
+ var safeCall = (instance, method, arg, elm) => {
916
945
  if (instance && instance[method]) {
917
946
  try {
918
947
  return instance[method](arg);
919
948
  } catch (e) {
920
- consoleError(e);
949
+ consoleError(e, elm);
921
950
  }
922
951
  }
923
952
  return void 0;
@@ -960,15 +989,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
960
989
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
961
990
  members.map(([memberName, [memberFlags]]) => {
962
991
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
992
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
993
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
994
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
995
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
996
+ Object.defineProperty(prototype, memberName, {
997
+ get() {
998
+ {
999
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
1000
+ return getValue(this, memberName);
1001
+ }
1002
+ const ref = getHostRef(this);
1003
+ const instance = ref ? ref.$lazyInstance$ : prototype;
1004
+ if (!instance) return;
1005
+ return instance[memberName];
1006
+ }
1007
+ },
1008
+ configurable: true,
1009
+ enumerable: true
1010
+ });
1011
+ }
963
1012
  Object.defineProperty(prototype, memberName, {
964
- get() {
965
- return getValue(this, memberName);
966
- },
967
1013
  set(newValue) {
968
- setValue(this, memberName, newValue, cmpMeta);
969
- },
970
- configurable: true,
971
- enumerable: true
1014
+ const ref = getHostRef(this);
1015
+ if (origSetter) {
1016
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1017
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1018
+ newValue = ref.$instanceValues$.get(memberName);
1019
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1020
+ ref.$instanceValues$.set(memberName, currentValue);
1021
+ }
1022
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
1023
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1024
+ setValue(this, memberName, newValue, cmpMeta);
1025
+ return;
1026
+ }
1027
+ {
1028
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1029
+ setValue(this, memberName, newValue, cmpMeta);
1030
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1031
+ ref.$onReadyPromise$.then(() => {
1032
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1033
+ ref.$lazyInstance$[memberName] = newValue;
1034
+ }
1035
+ });
1036
+ }
1037
+ return;
1038
+ }
1039
+ const setterSetVal = () => {
1040
+ const currentValue = ref.$lazyInstance$[memberName];
1041
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
1042
+ ref.$instanceValues$.set(memberName, currentValue);
1043
+ }
1044
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
1045
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1046
+ };
1047
+ if (ref.$lazyInstance$) {
1048
+ setterSetVal();
1049
+ } else {
1050
+ ref.$onReadyPromise$.then(() => setterSetVal());
1051
+ }
1052
+ }
1053
+ }
972
1054
  });
973
1055
  }
974
1056
  });
@@ -978,7 +1060,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
978
1060
  plt.jmp(() => {
979
1061
  var _a2;
980
1062
  const propName = attrNameToPropName.get(attrName);
981
- if (this.hasOwnProperty(propName)) {
1063
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
982
1064
  newValue = this[propName];
983
1065
  delete this[propName];
984
1066
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -998,7 +1080,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
998
1080
  }
999
1081
  return;
1000
1082
  }
1001
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1083
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1084
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1085
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1086
+ this[propName] = newValue;
1087
+ }
1002
1088
  });
1003
1089
  };
1004
1090
  Cstr.observedAttributes = Array.from(
@@ -1027,7 +1113,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1027
1113
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1028
1114
  const bundleId = cmpMeta.$lazyBundleId$;
1029
1115
  if (bundleId) {
1030
- const CstrImport = loadModule(cmpMeta);
1116
+ const CstrImport = loadModule(cmpMeta, hostRef);
1031
1117
  if (CstrImport && "then" in CstrImport) {
1032
1118
  const endLoad = uniqueTime();
1033
1119
  Cstr = await CstrImport;
@@ -1049,7 +1135,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1049
1135
  try {
1050
1136
  new Cstr(hostRef);
1051
1137
  } catch (e) {
1052
- consoleError(e);
1138
+ consoleError(e, elm);
1053
1139
  }
1054
1140
  {
1055
1141
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
@@ -1081,7 +1167,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1081
1167
  schedule();
1082
1168
  }
1083
1169
  };
1084
- var fireConnectedCallback = (instance) => {
1170
+ var fireConnectedCallback = (instance, elm) => {
1085
1171
  };
1086
1172
 
1087
1173
  // src/runtime/connected-callback.ts
@@ -1122,7 +1208,7 @@ var connectedCallback = (elm) => {
1122
1208
  endConnected();
1123
1209
  }
1124
1210
  };
1125
- var disconnectInstance = (instance) => {
1211
+ var disconnectInstance = (instance, elm) => {
1126
1212
  };
1127
1213
  var disconnectedCallback = async (elm) => {
1128
1214
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1137,6 +1223,12 @@ var disconnectedCallback = async (elm) => {
1137
1223
  hostRef.$onReadyPromise$.then(() => disconnectInstance());
1138
1224
  }
1139
1225
  }
1226
+ if (rootAppliedStyles.has(elm)) {
1227
+ rootAppliedStyles.delete(elm);
1228
+ }
1229
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1230
+ rootAppliedStyles.delete(elm.shadowRoot);
1231
+ }
1140
1232
  };
1141
1233
 
1142
1234
  // src/runtime/bootstrap-lazy.ts
@@ -1217,6 +1309,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1217
1309
  }
1218
1310
  disconnectedCallback() {
1219
1311
  plt.jmp(() => disconnectedCallback(this));
1312
+ plt.raf(() => {
1313
+ var _a3;
1314
+ const hostRef = getHostRef(this);
1315
+ const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
1316
+ if (i2 > -1) {
1317
+ deferredConnectedCallbacks.splice(i2, 1);
1318
+ }
1319
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1320
+ delete hostRef.$vnode$.$elm$;
1321
+ }
1322
+ });
1220
1323
  }
1221
1324
  componentOnReady() {
1222
1325
  return getHostRef(this).$onReadyPromise$;
@@ -1280,7 +1383,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1280
1383
  }
1281
1384
  }
1282
1385
  } catch (e) {
1283
- consoleError(e);
1386
+ consoleError(e, hostRef.$hostElement$);
1284
1387
  }
1285
1388
  };
1286
1389
  var getHostListenerTarget = (elm, flags) => {
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-b370bbfe.js';
2
- import './index-0b3806b2.js';
1
+ export { C as CasinoEngagementSuiteLuckywheel } from './casino-engagement-suite-luckywheel-cf7e798a.js';
2
+ import './index-8ce51859.js';
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-0b3806b2.js';
2
- export { s as setNonce } from './index-0b3806b2.js';
1
+ import { b as bootstrapLazy } from './index-8ce51859.js';
2
+ export { s as setNonce } from './index-8ce51859.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-engagement-suite-luckywheel",
3
- "version": "0.1.0",
3
+ "version": "0.2.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
- export{C as casino_engagement_suite_luckywheel}from"./p-5da7530f.js";import"./p-fc393d1b.js";
@@ -1 +0,0 @@
1
- import{r as t,h as i,g as e}from"./p-fc393d1b.js";var s,r,n,a,o,h;"function"==typeof SuppressedError&&SuppressedError,function(t){t.Arrow="Arrow",t.Partition="Partition"}(s||(s={})),function(t){t.DownFromTop="DownFromTop",t.UpFromCenter="UpFromCenter",t.DownFromCenter="DownFromCenter",t.UpFromBottom="UpFromBottom"}(r||(r={})),function(t){t.en="en",t.fr="fr",t.de="de",t.tr="tr"}(n||(n={})),function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise",t[t.outward=0]="outward"}(a||(a={})),function(t){t.launch="launch",t.loop="loop",t.halt="halt"}(o||(o={})),function(t){t.quad="quad",t.cubic="cubic",t.quart="quart",t.quint="quint",t.expo="expo",t.sine="sine",t.circ="circ"}(h||(h={}));const c=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),d=(t,i)=>{Object.keys(i).map((e=>{t.setAttribute(e.split(/(?=[A-Z])/).map((t=>t.toLocaleLowerCase())).join("-"),i[e])}))},l=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})),u=t=>({x:t,y:t}),g=(t,i)=>({x:t.x+i.x,y:t.y+i.y}),b={image:"",name:"Thank you",prizeText:"",prizeImage:""},f=async(t,i)=>{const{partitions:e}=t.program.wheelOfFortune;let s=((t,i)=>{const e=t.map((t=>{const e={};return Object.keys(t).map((s=>{"object"==typeof t[s]&&t[s].hasOwnProperty("*")&&(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(b),e})(e,i);return s=c()?s.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(s.map((async t=>Object.assign(Object.assign({},t),await(async t=>t?{image:await l(t)}:{})(t.image))))),s},p={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))}},m={quad:2,cubic:3,quart:4,quint:5,sine:Math.PI/2,expo:Math.LN2,circ:1/0},y={in:{quad:t=>2*t,cubic:t=>3*t**2,quart:t=>4*t**3,quint:t=>5*t**4,sine:t=>Math.PI/2*Math.sin(Math.PI/2*t),expo:t=>10*Math.LN2*2**(10*t-10),circ:t=>-.5*(1-t**2)**-.5},out:{cubic:t=>3*t**2-6*t+3}},v=[{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}],x=t=>Object.keys(t).map((i=>t[i]));var w;!function(t){t[t.clockwise=1]="clockwise",t[t.anticlockwise=-1]="anticlockwise"}(w||(w={}));class k{constructor({size:t,radius:i,options:e,themeIndex:s,contentdirection:n}){this.arrowmode=r.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 r.DownFromTop:case r.UpFromCenter:return-Math.PI/2;case r.DownFromCenter:case r.UpFromBottom:return Math.PI/2}},this.contentdirection=n||"anticlockwise",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,a.outward)),{width:e,height:e})}getSvgTextProps(t){const i=this.getSizeImageByPartition(t);let e;return e=this.options[t].image?this.radius-i-6*this.ratio:this.radius-6*this.ratio,Object.assign({},this.getPropsForPartitionInfo(t,this.offsetText,e))}getSvgTextPropsAdjustedByImage(t){const i=this.getSvgTextProps(t),e=this.options[t].image?80:100,s={width:e,height:e};return Object.assign(Object.assign(Object.assign({},i),s),{x:"clockwise"===this.contentdirection?i.x:i.x-s.width,y:i.y-s.height/2})}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 w.clockwise}getAngleSelf(t,i){return 360*t/this.length*this.direction+90*(void 0!==i?i:a[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=u(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:g(r,e.transform),point:g(r,e.position)}}getPropsForPartitionInfo(t,i,e,s){const{point:r,transformOrigin:n}=this.getPartitionPositions(t,e,i);return Object.assign(Object.assign({},r),{style:{"font-size":13*this.ratio+"px",transform:`rotate(${this.getAngleSelf(t,s)}deg)`,"transform-origin":`${a=n,Object.keys(a).map((t=>`${a[t]}px`)).join(" ")}`}});var a}getPartitionDraw(t){const i=u(this.center),e=u(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=u(s),a=u(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",...x(i),"L",...x(s),"A",...x(e),"0 0 1",...x(r),"Z"].join(" ")}}getDeg(t){return this.findDeg(length-(t||this.length-1),length)}getSpinnerProps(){const t=u(this.center);return{"transform-origin":`${t.x} ${t.y}`}}}class P{constructor(t){this.deg=0,this.degTarget=void 0,this.step=void 0,this.easingType=h.cubic,this.param=v[2],this.halt=(t,i=(()=>{}))=>{this.shouldHalt=()=>{this.step=o.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*m[this.easingType]*t/this.param.loopSpeed,e=()=>{const t=360*this.param.launchTurns-this.deg,e=i(t);this.animateF(e,this.deg,t,p.in[this.easingType],y.in[this.easingType])},s=()=>{const t=i(this.degTarget);this.animateF(t,0,this.degTarget,p.out[this.easingType],y.out[this.easingType])},r=()=>{this.setDeg((this.deg+t)%360,m[this.easingType]),this.continueRepeat()};({[o.launch]:()=>{this.cb=()=>{this.step=o.loop,this.setDeg(t,m[this.easingType]),this.continueRepeat()},e()},[o.loop]:()=>{this.shouldHalt&&0===this.deg?this.shouldHalt():r()},[o.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=o.launch,this.ticker()}}const j=class{constructor(i){t(this,i),this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.host.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),i=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{i.innerHTML=t,setTimeout((()=>{this.host.prepend(i)}),1)})).catch((t=>{console.log("Error ",t)}))},this.renderImage=(t,i)=>{const e=this.options[i].image;d(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",lotteryProgramID:this.luckywheel.program.id}),setTimeout((()=>{window.postMessage({type:"SpinLuckyWheelRes",data:{item:{result:{wheelOfFortunePartitionIndex:1}},success:!1}})}),2500))},this.handleSpinClick=()=>{c()||this.eventSpin()},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 i=null==t?void 0:t.data,{type:e}=i,s=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)i.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(e[s[r]]=t[s[r]])}return e}(i,["type"]);"SpinLuckyWheelRes"===e&&this.spinner.halt(this.settings.getDeg(s.data.item.result.wheelOfFortunePartitionIndex),(()=>{this.isSpinning=!1,this.updateSpinable();const t=this.luckywheel.program.wheelOfFortune.partitions[s.data.item.result.wheelOfFortunePartitionIndex].prizeText;window.postMessage({type:"ShowLuckywheelRewardModal",data:{PrizeMessage:t.en||t["*"],HasError:s.data.success}})}))}componentDidRender(){!this.limitStylingAppends&&this.host&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}async componentWillLoad(){this.options=await f(this.luckywheel,n.en),this.settings=new k({size:this.size,radius:this.radius,options:this.options,themeIndex:1,contentdirection:this.contentdirection}),this.spinner=new P({tick:(t,i)=>{d(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}`}}render(){const t={height:this.size,width:this.size},e={height:`${this.size}px`,width:`${this.size}px`};return i("div",{key:"8d964d9a81690d2a22240cb1355abb3c7cf6f665",class:`WheelContainer ${this.device}`,style:this.defineGeneralVariables()},i("svg",{key:"92f44f4659874e1fedaffa32813c57d1c9c04440",width:this.size,height:this.size,ref:t=>{this.svg=t}},i("foreignObject",Object.assign({key:"f042214f1516c688035f650a92ff1437c5d06a36"},t,{class:"Bottom Customable"}),i("div",{key:"6c80c40dfdb80159d75af8f70a75604257039c53",style:e})),i("g",Object.assign({key:"46c01589f440c19727c8364d5e1bdb3a90082cac",class:"PartitionsContainer"},this.settings.getSpinnerProps()),i("g",{key:"fd0e9a65b7ba25db742ff12bb26e389b8d72e4c7",class:"PartitionsBackgrounds"},this.options.map(((t,s)=>i("foreignObject",{"clip-path":`url(#clip${s})`,class:"PartitionBackground Customable",style:{"--index":s.toString()},width:this.size,height:this.size},i("div",{style:e}))))),i("g",{key:"8c116aa611b92b87b98f23aa344025953a27e90d",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:"8907e6529e660e6452328aaa684995719b528ec6",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"},this.settings.getSvgTextPropsAdjustedByImage(e)),i("div",{class:"PartitionTextEntityContainer"},i("p",{class:"PartitionTextEntity"+("clockwise"===this.settings.contentdirection?"":" Anticlockwise"),innerHTML:t.name})))])))),i("g",{key:"62cf4e41e77374dd8f8c1af0833a4143e5d45403",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable1:!0}},this.options.map(((s,r)=>i("foreignObject",Object.assign({class:"Partition1 Customable",style:{"--index":r.toString()}},t),i("div",{style:e}))))),i("g",{key:"6b0538da5d4f52e4b543205fb64dedda084f81b2",class:{active:this.isPartitionsCustomableReady,PartitionsCustomable2:!0}},this.options.map(((s,r)=>i("foreignObject",Object.assign({class:"Partition2 Customable",style:{"--index":r.toString()}},t),i("div",{style:e}))))),i("foreignObject",Object.assign({key:"907db579094a7a192999510ade3150fdadbb94b6",class:"Middle Customable"},t),i("div",{key:"fa66cb96da2f285015fb8afeea5db05313ed832c",style:e})),i("foreignObject",Object.assign({key:"688c0d33ad480ea331847286335a88fd74dbbb26",class:"Top Customable"},t),i("div",{key:"292f6ea3549322a605fc8c3c61a93addcba00890",style:e})),i("g",{key:"22368be98007a7fa820cee96c666c363f85cd32a",class:{spinning:this.isSpinning,Center:!0},onClick:this.handleSpinClick},i("foreignObject",{key:"efffd7edb9ed21d5bd93896a4bead8931d91ff1f",x:Number(this.size)/2-50,y:Number(this.size)/2-50,width:100,height:100})),i("g",{key:"7d8b741cc21d6d07f5736336f147cef2bfdf90ca"},this.options.map(((t,e)=>i("clipPath",{id:`clip${e}`},i("path",Object.assign({},this.settings.getPartitionDraw(e)))))))))}get host(){return e(this)}};j.style=':host{font-family: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{j as C}