@everymatrix/lottery-oddsbom-ticket-bet 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/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-b8e9c8e4.js +1327 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-oddsbom-bullet_9.cjs.entry.js +1064 -0
- package/dist/cjs/lottery-oddsbom-ticket-bet-402dc005.js +10038 -0
- package/dist/cjs/lottery-oddsbom-ticket-bet.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +36 -0
- package/dist/collection/components/lottery-oddsbom-oddschart/lottery-oddsbom-oddschart.css +221 -0
- package/dist/collection/components/lottery-oddsbom-oddschart/lottery-oddsbom-oddschart.js +609 -0
- package/dist/collection/components/lottery-oddsbom-oddschart-input/lottery-oddsbom-oddschart-input.css +40 -0
- package/dist/collection/components/lottery-oddsbom-oddschart-input/lottery-oddsbom-oddschart-input.js +213 -0
- package/dist/collection/components/lottery-oddsbom-ticket-bet/index.js +1 -0
- package/dist/collection/components/lottery-oddsbom-ticket-bet/lottery-oddsbom-ticket-bet.css +193 -0
- package/dist/collection/components/lottery-oddsbom-ticket-bet/lottery-oddsbom-ticket-bet.js +782 -0
- package/dist/collection/components/lottery-oddsbom-ticket-board/lottery-oddsbom-ticket-board.css +82 -0
- package/dist/collection/components/lottery-oddsbom-ticket-board/lottery-oddsbom-ticket-board.js +350 -0
- package/dist/collection/components/lottery-oddsbom-ticket-button/lottery-oddsbom-ticket-button.css +168 -0
- package/dist/collection/components/lottery-oddsbom-ticket-button/lottery-oddsbom-ticket-button.js +299 -0
- package/dist/collection/components/lottery-oddsbom-ticket-selection/lottery-oddsbom-ticket-selection.css +104 -0
- package/dist/collection/components/lottery-oddsbom-ticket-selection/lottery-oddsbom-ticket-selection.js +233 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/model/index.type.js +1 -0
- package/dist/collection/utils/api.js +10 -0
- package/dist/collection/utils/locale.utils.js +73 -0
- package/dist/collection/utils/utils.js +200 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-9dee9d86.js +1299 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-oddsbom-bullet_9.entry.js +1053 -0
- package/dist/esm/lottery-oddsbom-ticket-bet-e46dbb50.js +10026 -0
- package/dist/esm/lottery-oddsbom-ticket-bet.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-oddsbom-ticket-bet/app-globals-0f993ce5.js +1 -0
- package/dist/lottery-oddsbom-ticket-bet/index-9dee9d86.js +2 -0
- package/dist/lottery-oddsbom-ticket-bet/index.esm.js +1 -0
- package/dist/lottery-oddsbom-ticket-bet/lottery-oddsbom-bullet_9.entry.js +1 -0
- package/dist/lottery-oddsbom-ticket-bet/lottery-oddsbom-ticket-bet-e46dbb50.js +6657 -0
- package/dist/lottery-oddsbom-ticket-bet/lottery-oddsbom-ticket-bet.esm.js +1 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/packages/stencil/lottery-oddsbom-ticket-bet/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/packages/stencil/lottery-oddsbom-ticket-bet/stencil.config.dev.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/packages/stencil/lottery-oddsbom-ticket-bet/storybook/main.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/packages/stencil/lottery-oddsbom-ticket-bet/storybook/preview.d.ts +70 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/tools/plugins/index.d.ts +4 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-oddsbom-ticket-bet/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/lottery-oddsbom-oddschart/lottery-oddsbom-oddschart.d.ts +51 -0
- package/dist/types/components/lottery-oddsbom-oddschart-input/lottery-oddsbom-oddschart-input.d.ts +21 -0
- package/dist/types/components/lottery-oddsbom-ticket-bet/index.d.ts +1 -0
- package/dist/types/components/lottery-oddsbom-ticket-bet/lottery-oddsbom-ticket-bet.d.ts +95 -0
- package/dist/types/components/lottery-oddsbom-ticket-board/lottery-oddsbom-ticket-board.d.ts +51 -0
- package/dist/types/components/lottery-oddsbom-ticket-button/lottery-oddsbom-ticket-button.d.ts +40 -0
- package/dist/types/components/lottery-oddsbom-ticket-selection/lottery-oddsbom-ticket-selection.d.ts +25 -0
- package/dist/types/components.d.ts +298 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model/index.type.d.ts +198 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/api.d.ts +6 -0
- package/dist/types/utils/locale.utils.d.ts +3 -0
- package/dist/types/utils/utils.d.ts +17 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +27 -0
|
@@ -0,0 +1,1064 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b8e9c8e4.js');
|
|
6
|
+
const lotteryOddsbomTicketBet = require('./lottery-oddsbom-ticket-bet-402dc005.js');
|
|
7
|
+
|
|
8
|
+
// This icon file is generated automatically.
|
|
9
|
+
var ArrowUpOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M868 545.5L536.1 163a31.96 31.96 0 00-48.3 0L156 545.5a7.97 7.97 0 006 13.2h81c4.6 0 9-2 12.1-5.5L474 300.9V864c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V300.9l218.9 252.3c3 3.5 7.4 5.5 12.1 5.5h81c6.8 0 10.5-8 6-13.2z" } }] }, "name": "arrow-up", "theme": "outlined" };
|
|
10
|
+
const ArrowUpOutlined$1 = ArrowUpOutlined;
|
|
11
|
+
|
|
12
|
+
// This icon file is generated automatically.
|
|
13
|
+
var DeleteFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z" } }] }, "name": "delete", "theme": "filled" };
|
|
14
|
+
const DeleteFilled$1 = DeleteFilled;
|
|
15
|
+
|
|
16
|
+
// This icon file is generated automatically.
|
|
17
|
+
var DownOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, "name": "down", "theme": "outlined" };
|
|
18
|
+
const DownOutlined$1 = DownOutlined;
|
|
19
|
+
|
|
20
|
+
// This icon file is generated automatically.
|
|
21
|
+
var InfoCircleFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "info-circle", "theme": "filled" };
|
|
22
|
+
const InfoCircleFilled$1 = InfoCircleFilled;
|
|
23
|
+
|
|
24
|
+
// This icon file is generated automatically.
|
|
25
|
+
var LeftOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z" } }] }, "name": "left", "theme": "outlined" };
|
|
26
|
+
const LeftOutlined$1 = LeftOutlined;
|
|
27
|
+
|
|
28
|
+
// This icon file is generated automatically.
|
|
29
|
+
var RightOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, "name": "right", "theme": "outlined" };
|
|
30
|
+
const RightOutlined$1 = RightOutlined;
|
|
31
|
+
|
|
32
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
33
|
+
__assign = Object.assign || function(t) {
|
|
34
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
35
|
+
s = arguments[i];
|
|
36
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
37
|
+
t[p] = s[p];
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
};
|
|
41
|
+
return __assign.apply(this, arguments);
|
|
42
|
+
};
|
|
43
|
+
var defaultColors = {
|
|
44
|
+
primaryColor: '#333',
|
|
45
|
+
secondaryColor: '#E6E6E6'
|
|
46
|
+
};
|
|
47
|
+
function renderIconDefinitionToSVGElement(icond, options) {
|
|
48
|
+
if (options === void 0) { options = {}; }
|
|
49
|
+
if (typeof icond.icon === 'function') {
|
|
50
|
+
// two-tone
|
|
51
|
+
var placeholders = options.placeholders || defaultColors;
|
|
52
|
+
return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
|
|
53
|
+
}
|
|
54
|
+
// fill, outline
|
|
55
|
+
return renderAbstractNodeToSVGElement(icond.icon, options);
|
|
56
|
+
}
|
|
57
|
+
function renderAbstractNodeToSVGElement(node, options) {
|
|
58
|
+
var targetAttrs = node.tag === 'svg'
|
|
59
|
+
? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
|
|
60
|
+
var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
|
|
61
|
+
var key = nextKey;
|
|
62
|
+
var value = targetAttrs[key];
|
|
63
|
+
var token = "".concat(key, "=\"").concat(value, "\"");
|
|
64
|
+
acc.push(token);
|
|
65
|
+
return acc;
|
|
66
|
+
}, []);
|
|
67
|
+
var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
|
|
68
|
+
var children = (node.children || [])
|
|
69
|
+
.map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
|
|
70
|
+
.join('');
|
|
71
|
+
if (children && children.length) {
|
|
72
|
+
return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
|
|
73
|
+
}
|
|
74
|
+
return "<".concat(node.tag).concat(attrsToken, " />");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const lotteryOddsbomBulletCss = ".OddsbomBullet .OddsbomBulletBtn__normal{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--emw--color-background, #fff);border:2px solid var(--emw--color-primary, #0d196e);border-radius:var(--emw--border-radius-medium, 8px);color:var(--emw--color-typography, #000);font-weight:bold;cursor:pointer;transition:transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease, background-color 0.3s;user-select:none;position:relative}.OddsbomBullet .OddsbomBulletBtn__normal:hover{transform:scale(1.15) rotate(-5deg);box-shadow:var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15)) 7px 6px 6px}.OddsbomBullet .OddsbomBulletBtn__normal .OddsbomBullet--deleteIcon{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover{background-color:var(--emw--color-background, #fff)}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--text{display:none}.OddsbomBullet .OddsbomBulletBtn__normal.isDeleteByIcon:hover .OddsbomBullet--deleteIcon{display:inline;fill:var(--emw--color-typography, #000)}.OddsbomBullet .OddsbomBulletBtn__normal.isCallDialogBtn:hover{transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__selected{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff);transform:scale(1.05);box-shadow:0 5px 10px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15))}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled{background-color:var(--emw--color-gray-50, #f5f5f5);border-color:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-gray-150, #6f6f6f);cursor:not-allowed;transform:none;box-shadow:none}.OddsbomBullet .OddsbomBulletBtn__normal.OddsbomBulletBtn__disabled:hover{transform:none;box-shadow:none}";
|
|
78
|
+
const LotteryOddsbomBulletStyle0 = lotteryOddsbomBulletCss;
|
|
79
|
+
|
|
80
|
+
const DeleteFilledIcon = renderIconDefinitionToSVGElement(DeleteFilled$1, {
|
|
81
|
+
extraSVGAttrs: { width: '18px', height: '18px', fill: '' }
|
|
82
|
+
});
|
|
83
|
+
const LotteryOddsbomBullet = class {
|
|
84
|
+
constructor(hostRef) {
|
|
85
|
+
index.registerInstance(this, hostRef);
|
|
86
|
+
this.oddsbomBulletToggleEvent = index.createEvent(this, "oddsbomBulletToggle", 7);
|
|
87
|
+
this.oddsbomBulletDeleteEvent = index.createEvent(this, "oddsbomBulletDelete", 7);
|
|
88
|
+
this.oddsbomBulletAddedByMoreBtnDeleteEvent = index.createEvent(this, "oddsbomBulletAddedByMoreBtnDelete", 7);
|
|
89
|
+
this.oddsbomBulletCallDialogEvent = index.createEvent(this, "oddsbomBulletCallDialog", 7);
|
|
90
|
+
this.isSelected = undefined;
|
|
91
|
+
this.disabled = undefined;
|
|
92
|
+
this.text = undefined;
|
|
93
|
+
this.idx = undefined;
|
|
94
|
+
this.isReading = undefined;
|
|
95
|
+
this.isDeleteByIcon = undefined;
|
|
96
|
+
this.isCallDialogBtn = undefined;
|
|
97
|
+
this.isAddedByMoreBtn = undefined;
|
|
98
|
+
this.mbSource = undefined;
|
|
99
|
+
this.clientStyling = undefined;
|
|
100
|
+
this.clientStylingUrl = undefined;
|
|
101
|
+
}
|
|
102
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
103
|
+
if (newValue != oldValue) {
|
|
104
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
108
|
+
if (newValue != oldValue) {
|
|
109
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
113
|
+
if (newValue != oldValue) {
|
|
114
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
componentDidLoad() {
|
|
118
|
+
if (this.stylingContainer) {
|
|
119
|
+
if (this.mbSource)
|
|
120
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
121
|
+
if (this.clientStyling)
|
|
122
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
123
|
+
if (this.clientStylingUrl)
|
|
124
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
disconnectedCallback() {
|
|
128
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
129
|
+
}
|
|
130
|
+
handleClick() {
|
|
131
|
+
if (this.isCallDialogBtn) {
|
|
132
|
+
this.oddsbomBulletCallDialogEvent.emit();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (this.isDeleteByIcon) {
|
|
136
|
+
if (this.isAddedByMoreBtn) {
|
|
137
|
+
this.oddsbomBulletAddedByMoreBtnDeleteEvent.emit(this.text);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.oddsbomBulletDeleteEvent.emit(this.idx);
|
|
141
|
+
}
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (!this.disabled) {
|
|
145
|
+
this.oddsbomBulletToggleEvent.emit(this.idx);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
return (index.h("div", { key: 'e21cf46108e35dcbf7d65e8c6a5f12f5d5ae49cb', class: "OddsbomBullet", ref: (el) => (this.stylingContainer = el) }, index.h("button", { key: '4edf5cd481d8283bd71f6806b6f93949e1308095', class: {
|
|
150
|
+
OddsbomBulletBtn__normal: true,
|
|
151
|
+
OddsbomBulletBtn__selected: this.isSelected,
|
|
152
|
+
OddsbomBulletBtn__disabled: this.disabled,
|
|
153
|
+
isDeleteByIcon: this.isDeleteByIcon,
|
|
154
|
+
isCallDialogBtn: this.isCallDialogBtn || this.isReading
|
|
155
|
+
}, onClick: this.handleClick.bind(this), disabled: this.disabled }, index.h("span", { key: 'fa1aed0293dc004808e6992c069d6992317b0788', class: "OddsbomBullet--deleteIcon", innerHTML: DeleteFilledIcon }), index.h("span", { key: '53ed96f2c2b833d21488049f987b6131718d563e', class: "OddsbomBullet--text" }, this.text))));
|
|
156
|
+
}
|
|
157
|
+
static get watchers() { return {
|
|
158
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
159
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
160
|
+
"mbSource": ["handleMbSourceChange"]
|
|
161
|
+
}; }
|
|
162
|
+
};
|
|
163
|
+
LotteryOddsbomBullet.style = LotteryOddsbomBulletStyle0;
|
|
164
|
+
|
|
165
|
+
const lotteryOddsbomBulletGroupCss = ".oddsbomBulletGroup{width:100%}.oddsbomBulletGroup .oddsbomBulletGroup-list{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.oddsbomBulletGroup .selection-bullet-list{justify-content:flex-end}";
|
|
166
|
+
const LotteryOddsbomBulletGroupStyle0 = lotteryOddsbomBulletGroupCss;
|
|
167
|
+
|
|
168
|
+
const LotteryOddsbomBulletGroup = class {
|
|
169
|
+
constructor(hostRef) {
|
|
170
|
+
index.registerInstance(this, hostRef);
|
|
171
|
+
this.addSelectionEvent = index.createEvent(this, "addSelection", 7);
|
|
172
|
+
this.deleteSelectionEvent = index.createEvent(this, "deleteSelection", 7);
|
|
173
|
+
this.deleteSelectionOriginEvent = index.createEvent(this, "deleteSelectionOrigin", 7);
|
|
174
|
+
this.oddsbomBulletGroupToggleEvent = index.createEvent(this, "oddsbomBulletGroupToggle", 7);
|
|
175
|
+
this.oddsbomBulletGroupAddedByMoreBtnDelEvent = index.createEvent(this, "oddsbomBulletGroupAddedByMoreBtnDel", 7);
|
|
176
|
+
this.oddsbomBulletCallDialogFromGroupEvent = index.createEvent(this, "oddsbomBulletCallDialogFromGroup", 7);
|
|
177
|
+
this.selectionIdx = undefined;
|
|
178
|
+
this.matchIdx = undefined;
|
|
179
|
+
this.bulletConfigs = [];
|
|
180
|
+
this.bulletConfigsDeleteOrigin = [];
|
|
181
|
+
this.addSelectionConfig = undefined;
|
|
182
|
+
this.isDeleteByIcon = undefined;
|
|
183
|
+
this.mbSource = undefined;
|
|
184
|
+
this.clientStyling = undefined;
|
|
185
|
+
this.clientStylingUrl = undefined;
|
|
186
|
+
this.bulletListClass = undefined;
|
|
187
|
+
this.innerBulletConfigs = undefined;
|
|
188
|
+
this.innerBulletConfigsDeleteOrigin = undefined;
|
|
189
|
+
}
|
|
190
|
+
handleBulletConfigsChange(newValue) {
|
|
191
|
+
this.innerBulletConfigs = newValue.map((c) => (Object.assign({}, c)));
|
|
192
|
+
}
|
|
193
|
+
handleBulletConfigsDeleteOriginChange(newValue) {
|
|
194
|
+
this.innerBulletConfigsDeleteOrigin = newValue.map((c) => (Object.assign({}, c)));
|
|
195
|
+
}
|
|
196
|
+
componentWillLoad() {
|
|
197
|
+
this.handleBulletConfigsChange(this.bulletConfigs);
|
|
198
|
+
}
|
|
199
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
200
|
+
if (newValue != oldValue) {
|
|
201
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
205
|
+
if (newValue != oldValue) {
|
|
206
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
210
|
+
if (newValue != oldValue) {
|
|
211
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
oddsbomBulletToggleHandler(event) {
|
|
215
|
+
const idx = event.detail;
|
|
216
|
+
const { matchIdx, selectionIdx } = this;
|
|
217
|
+
const newBulletConfigs = [...this.innerBulletConfigs];
|
|
218
|
+
const bulletToUpdate = Object.assign({}, newBulletConfigs[idx]);
|
|
219
|
+
bulletToUpdate.isSelected = !bulletToUpdate.isSelected;
|
|
220
|
+
newBulletConfigs[idx] = bulletToUpdate;
|
|
221
|
+
this.innerBulletConfigs = newBulletConfigs;
|
|
222
|
+
this.oddsbomBulletGroupToggleEvent.emit({
|
|
223
|
+
bulletSelctionArr: this.innerBulletConfigs,
|
|
224
|
+
matchIdx: matchIdx,
|
|
225
|
+
selectionIdx: selectionIdx
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
oddsbomBulletDeleteHandler(event) {
|
|
229
|
+
const idx = event.detail;
|
|
230
|
+
const { matchIdx, selectionIdx } = this;
|
|
231
|
+
const newBulletConfigs = [...this.innerBulletConfigsDeleteOrigin];
|
|
232
|
+
const bulletToUpdate = Object.assign({}, newBulletConfigs[idx]);
|
|
233
|
+
bulletToUpdate.isSelected = !bulletToUpdate.isSelected;
|
|
234
|
+
newBulletConfigs[idx] = bulletToUpdate;
|
|
235
|
+
this.innerBulletConfigsDeleteOrigin = newBulletConfigs;
|
|
236
|
+
this.oddsbomBulletGroupToggleEvent.emit({
|
|
237
|
+
bulletSelctionArr: this.innerBulletConfigsDeleteOrigin,
|
|
238
|
+
matchIdx: matchIdx,
|
|
239
|
+
selectionIdx: selectionIdx
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
oddsbomBulletAddedByMoreBtnDeleteHandler(event) {
|
|
243
|
+
const text = event.detail;
|
|
244
|
+
const { matchIdx, selectionIdx } = this;
|
|
245
|
+
this.oddsbomBulletGroupAddedByMoreBtnDelEvent.emit({
|
|
246
|
+
delText: text,
|
|
247
|
+
matchIdx: matchIdx,
|
|
248
|
+
selectionIdx: selectionIdx
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
componentDidLoad() {
|
|
252
|
+
if (this.stylingContainer) {
|
|
253
|
+
if (this.mbSource)
|
|
254
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
255
|
+
if (this.clientStyling)
|
|
256
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
257
|
+
if (this.clientStylingUrl)
|
|
258
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
disconnectedCallback() {
|
|
262
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
263
|
+
}
|
|
264
|
+
handleOddsbomBulletCallDialog() {
|
|
265
|
+
const { matchIdx, selectionIdx } = this;
|
|
266
|
+
this.oddsbomBulletCallDialogFromGroupEvent.emit({ matchIdx, selectionIdx });
|
|
267
|
+
}
|
|
268
|
+
render() {
|
|
269
|
+
return (index.h("div", { key: '38102a447cf8fafc8f7a7e5a122c7ccbc2ce8b4a', class: "oddsbomBulletGroup", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '59ca1df498575356eb3438b45e9431b1bc7ee2dd', class: `oddsbomBulletGroup-list ${this.bulletListClass || ''}` }, this.innerBulletConfigs.map((item) => {
|
|
270
|
+
return item.isAddMoreBtn ? (index.h("lottery-oddsbom-bullet", { text: `${this.addSelectionConfig.maxOverScore}+`, disabled: item.isDisabled, isCallDialogBtn: true, onOddsbomBulletCallDialog: this.handleOddsbomBulletCallDialog.bind(this) })) : (index.h("lottery-oddsbom-bullet", { text: item.text, idx: item.idx, isSelected: item.isSelected, disabled: item.isDisabled, isDeleteByIcon: this.isDeleteByIcon, isAddedByMoreBtn: item.isAddedByMoreBtn }));
|
|
271
|
+
}))));
|
|
272
|
+
}
|
|
273
|
+
static get watchers() { return {
|
|
274
|
+
"bulletConfigs": ["handleBulletConfigsChange"],
|
|
275
|
+
"bulletConfigsDeleteOrigin": ["handleBulletConfigsDeleteOriginChange"],
|
|
276
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
277
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
278
|
+
"mbSource": ["handleMbSourceChange"]
|
|
279
|
+
}; }
|
|
280
|
+
};
|
|
281
|
+
LotteryOddsbomBulletGroup.style = LotteryOddsbomBulletGroupStyle0;
|
|
282
|
+
|
|
283
|
+
const lotteryOddsbomOddschartCss = ".oddsbom-oddschart {\n container-type: inline-size;\n}\n.oddsbom-oddschart-container {\n position: relative;\n}\n.oddsbom-oddschart-match {\n display: flex;\n align-items: flex-end;\n margin-bottom: 4px;\n}\n.oddsbom-oddschart-match-item {\n display: flex;\n flex-direction: column;\n align-items: center;\n flex-basis: 160px;\n}\n.oddsbom-oddschart-match-item-name {\n margin-bottom: 8px;\n display: flex;\n flex-direction: column;\n align-items: center;\n}\n.oddsbom-oddschart-match-item-name--home, .oddsbom-oddschart-match-item-name--away, .oddsbom-oddschart-match-item-name--delimiter {\n font-size: 13px;\n height: 16px;\n line-height: 16px;\n overflow: hidden;\n color: var(--emw--color-typography, #000);\n}\n.oddsbom-oddschart-match-item-input {\n display: flex;\n justify-content: space-between;\n}\n.oddsbom-oddschart-match-search {\n flex-basis: 130px;\n text-align: center;\n}\n.oddsbom-oddschart-match-filter {\n display: flex;\n justify-content: flex-end;\n padding: 2px;\n position: relative;\n padding-top: 4px;\n border-top: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n.oddsbom-oddschart-input {\n display: flex;\n margin-top: 4px;\n}\n.oddsbom-oddschart-input-empty {\n padding: 12px;\n border: 1px solid var(--emw--color-primary-variant, #1367e7);\n background-color: var(--emw--color-tertiary, #e3f2fd);\n width: 50%;\n min-width: 240px;\n max-width: 360px;\n margin: 4px auto;\n border-radius: 6px;\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n}\n.oddsbom-oddschart-input-empty-operation {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-top: 4px;\n}\n.oddsbom-oddschart-input-wrap {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-bottom: 4px;\n}\n.oddsbom-oddschart-input-item {\n display: flex;\n align-items: center;\n flex-basis: 160px;\n justify-content: center;\n gap: 5px;\n}\n.oddsbom-oddschart-input-odds {\n flex-basis: 130px;\n display: flex;\n align-items: center;\n font-size: 14px;\n text-indent: 16px;\n}\n.oddsbom-oddschart-input-operation {\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 20px;\n}\n.oddsbom-oddschart-selection--group {\n display: flex;\n margin-bottom: 8px;\n}\n.oddsbom-oddschart-selection--group-wrap {\n display: flex;\n border-radius: 4px;\n}\n.oddsbom-oddschart-selection--group-wrap:hover {\n background: var(--emw--color-gray-50, #f5f5f5);\n cursor: pointer;\n}\n.oddsbom-oddschart-selection-item {\n display: flex;\n flex-basis: 160px;\n justify-content: center;\n gap: 10px;\n}\n.oddsbom-oddschart-selection-odds {\n display: flex;\n gap: 12px;\n align-items: center;\n flex-basis: 130px;\n position: relative;\n text-indent: 16px;\n}\n.oddsbom-oddschart-selection-odds--text {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n}\n.oddsbom-oddschart-selection-odds--fillIn {\n position: absolute;\n right: 0;\n}\n@container (max-width: 430px) {\n .oddsbom-oddschart .oddsbom-oddschart-selection-odds {\n text-indent: unset;\n }\n .oddsbom-oddschart .oddsbom-oddschart-selection-odds--fillIn {\n right: -22px;\n }\n .oddsbom-oddschart .oddsbom-oddschart-selection-item {\n gap: 4px;\n }\n}\n.oddsbom-oddschart .arrow {\n transition: transform 0.3s ease;\n font-size: 16px;\n display: inline-flex;\n cursor: pointer;\n fill: var(--emw--color-typography, #000);\n display: flex;\n justify-content: center;\n flex-basis: 130px;\n}\n.oddsbom-oddschart .arrow.ascend {\n transform: rotate(180deg);\n}\n\n.empty-wrap {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.empty-wrap-text {\n color: var(--emw--color-typography, #000);\n}\n\n.oddsbom-oddschart-pagination {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n margin-top: 10px;\n padding-right: 16px;\n}\n.oddsbom-oddschart-pagination-wrap {\n display: flex;\n align-items: center;\n gap: 12px;\n height: 18px;\n}\n.oddsbom-oddschart-pagination-prev, .oddsbom-oddschart-pagination-next {\n cursor: pointer;\n}\n.oddsbom-oddschart-pagination-prev.disabled, .oddsbom-oddschart-pagination-next.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.oddsbom-oddschart-pagination-icon {\n display: flex;\n height: 18px;\n align-items: center;\n fill: var(--emw--color-typography, #000);\n}\n.oddsbom-oddschart-pagination-page {\n font-size: 14px;\n color: var(--emw--color-typography, #000);\n}\n\n.progress-bar {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 2px;\n background-color: var(--emw--color-gray-100, #e6e6e6);\n overflow: hidden;\n}\n.progress-bar::after {\n content: \"\";\n display: block;\n width: 20%;\n height: 100%;\n background-color: var(--emw--color-primary, #0d196e);\n animation: progress 1.5s linear infinite;\n}\n\n@keyframes progress {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(500%);\n }\n}";
|
|
284
|
+
const LotteryOddsbomOddschartStyle0 = lotteryOddsbomOddschartCss;
|
|
285
|
+
|
|
286
|
+
const upIcon = renderIconDefinitionToSVGElement(ArrowUpOutlined$1, {
|
|
287
|
+
extraSVGAttrs: { width: '16px', height: '16px', fill: '' }
|
|
288
|
+
});
|
|
289
|
+
const infoIcon = renderIconDefinitionToSVGElement(InfoCircleFilled$1, {
|
|
290
|
+
extraSVGAttrs: { width: '18px', height: '18px', fill: '#0d196e' }
|
|
291
|
+
});
|
|
292
|
+
const infoIcon1 = renderIconDefinitionToSVGElement(InfoCircleFilled$1, {
|
|
293
|
+
extraSVGAttrs: { width: '16px', height: '16px', fill: '#1367e7' }
|
|
294
|
+
});
|
|
295
|
+
const leftArrowIcon = renderIconDefinitionToSVGElement(LeftOutlined$1, {
|
|
296
|
+
extraSVGAttrs: { width: '16px', height: '16px', fill: '' }
|
|
297
|
+
});
|
|
298
|
+
const rightArrowIcon = renderIconDefinitionToSVGElement(RightOutlined$1, {
|
|
299
|
+
extraSVGAttrs: { width: '16px', height: '16px', fill: '' }
|
|
300
|
+
});
|
|
301
|
+
const LotteryOddsbomOddschart = class {
|
|
302
|
+
constructor(hostRef) {
|
|
303
|
+
index.registerInstance(this, hostRef);
|
|
304
|
+
this.oddsQueryLineChangeEvent = index.createEvent(this, "oddsQueryLineChange", 7);
|
|
305
|
+
this.oddschartFillInEvent = index.createEvent(this, "oddschartFillIn", 7);
|
|
306
|
+
this.oddsQueryChangeEvent = index.createEvent(this, "oddsQueryChange", 7);
|
|
307
|
+
this.handleSearch = async () => {
|
|
308
|
+
const inputs = this.matchItemsContainer.querySelectorAll('lottery-oddsbom-oddschart-input');
|
|
309
|
+
const values = await Promise.all(Array.from(inputs).map((input) => input.getValue()));
|
|
310
|
+
if (values.length != 2 * this.matchInfo.length) {
|
|
311
|
+
lotteryOddsbomTicketBet.showNotification({
|
|
312
|
+
theme: 'warning',
|
|
313
|
+
message: lotteryOddsbomTicketBet.translate('pleaseFillIn', this.language)
|
|
314
|
+
});
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
const newMatchSelection = [...this.matchSelection];
|
|
318
|
+
const lineSelection = [];
|
|
319
|
+
for (let i = 0; i < values.length; i += 2) {
|
|
320
|
+
const val1 = values[i];
|
|
321
|
+
const val2 = values[i + 1];
|
|
322
|
+
const index = i / 2;
|
|
323
|
+
if (val1 && val2) {
|
|
324
|
+
lineSelection.push([[`${val1}:${val2}`]]);
|
|
325
|
+
newMatchSelection[index] = [val1, val2];
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
this.matchSelection = [...newMatchSelection];
|
|
329
|
+
if (lineSelection.length > 0) {
|
|
330
|
+
const lineSelectionBase64 = await lotteryOddsbomTicketBet.stringToBase64(JSON.stringify(lineSelection));
|
|
331
|
+
this.oddsQueryLineChangeEvent.emit({
|
|
332
|
+
lineSelectionBase64: lineSelectionBase64,
|
|
333
|
+
offset: 0
|
|
334
|
+
});
|
|
335
|
+
this.hasFillInSelection = true;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
this.handleGroupClick = (index) => {
|
|
339
|
+
this.selectedGroupIndex = index;
|
|
340
|
+
};
|
|
341
|
+
this.toggleFilterIcon = () => {
|
|
342
|
+
this.isAscend = !this.isAscend;
|
|
343
|
+
this.selectedGroupIndex = -1;
|
|
344
|
+
this.oddsQueryChangeEvent.emit({
|
|
345
|
+
ascending: this.isAscend,
|
|
346
|
+
offset: 0,
|
|
347
|
+
lineSelectionBase64: ''
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
this.handlePrevPage = () => {
|
|
351
|
+
if (this.curPage >= 1) {
|
|
352
|
+
this.selectedGroupIndex = -1;
|
|
353
|
+
this.oddsQueryChangeEvent.emit({
|
|
354
|
+
offset: this.offset - this.limit,
|
|
355
|
+
lineSelectionBase64: ''
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
this.handleNextPage = () => {
|
|
360
|
+
if (this.curPage < this.totalPage - 1) {
|
|
361
|
+
this.selectedGroupIndex = -1;
|
|
362
|
+
this.oddsQueryChangeEvent.emit({
|
|
363
|
+
offset: this.offset + this.limit,
|
|
364
|
+
lineSelectionBase64: ''
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
this.matchInfo = undefined;
|
|
369
|
+
this.oddsInfo = undefined;
|
|
370
|
+
this.total = undefined;
|
|
371
|
+
this.curPage = undefined;
|
|
372
|
+
this.limit = undefined;
|
|
373
|
+
this.offset = undefined;
|
|
374
|
+
this.filterdOdds = undefined;
|
|
375
|
+
this.isSearching = undefined;
|
|
376
|
+
this.mbSource = undefined;
|
|
377
|
+
this.clientStyling = undefined;
|
|
378
|
+
this.clientStylingUrl = undefined;
|
|
379
|
+
this.isLoading = false;
|
|
380
|
+
this.language = 'en';
|
|
381
|
+
this.translationUrl = '';
|
|
382
|
+
this.isAscend = true;
|
|
383
|
+
this.selectedGroupIndex = -1;
|
|
384
|
+
this.matchSelection = [];
|
|
385
|
+
this.hasFillInSelection = false;
|
|
386
|
+
}
|
|
387
|
+
async initOddsChart() {
|
|
388
|
+
this.oddsQueryChangeEvent.emit({
|
|
389
|
+
offset: 0,
|
|
390
|
+
ascending: true,
|
|
391
|
+
lineSelectionBase64: ''
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
async closeOddsChart() {
|
|
395
|
+
this.hasFillInSelection = false;
|
|
396
|
+
this.selectedGroupIndex = -1;
|
|
397
|
+
this.matchSelection = [];
|
|
398
|
+
this.isAscend = true;
|
|
399
|
+
if (this.matchItemsContainer) {
|
|
400
|
+
const inputs = this.matchItemsContainer.querySelectorAll('lottery-oddsbom-oddschart-input');
|
|
401
|
+
inputs.forEach((input) => {
|
|
402
|
+
input.clearValue();
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
407
|
+
if (newValue != oldValue) {
|
|
408
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
412
|
+
if (newValue != oldValue) {
|
|
413
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
417
|
+
if (newValue != oldValue) {
|
|
418
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
handleMatchInfoChange(newValue) {
|
|
422
|
+
this.matchSelection = newValue.map(() => [-1, -1]);
|
|
423
|
+
}
|
|
424
|
+
componentWillLoad() {
|
|
425
|
+
if (this.translationUrl) {
|
|
426
|
+
lotteryOddsbomTicketBet.resolveTranslationUrl(this.translationUrl);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
componentDidLoad() {
|
|
430
|
+
if (this.stylingContainer) {
|
|
431
|
+
if (this.mbSource)
|
|
432
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
433
|
+
if (this.clientStyling)
|
|
434
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
435
|
+
if (this.clientStylingUrl)
|
|
436
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
disconnectedCallback() {
|
|
440
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
441
|
+
}
|
|
442
|
+
get totalPage() {
|
|
443
|
+
return Math.ceil(this.total / this.limit);
|
|
444
|
+
}
|
|
445
|
+
generateBulletGroup(line, odds, groupIndex) {
|
|
446
|
+
let lineArr;
|
|
447
|
+
try {
|
|
448
|
+
lineArr = JSON.parse(line);
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
console.error('Failed to parse line JSON:', error);
|
|
452
|
+
return index.h("div", { class: "error-message" }, "Invalid data format");
|
|
453
|
+
}
|
|
454
|
+
let group = lineArr.map((arr) => arr[0]).map((arr1) => arr1[0]);
|
|
455
|
+
const isSelected = this.selectedGroupIndex === groupIndex;
|
|
456
|
+
return (index.h("div", { class: "oddsbom-oddschart-selection--group", onClick: this.handleGroupClick.bind(this, groupIndex) }, index.h("div", { class: "oddsbom-oddschart-selection--group-wrap", style: { flexBasis: `${160 * group.length}px` } }, group.map((item, index$1) => {
|
|
457
|
+
const selection = item.split(':');
|
|
458
|
+
return (index.h("div", { class: "oddsbom-oddschart-selection-item", key: index$1 }, index.h("div", { class: "oddsbom-oddschart-selection-item--1" }, index.h("lottery-oddsbom-bullet", { text: selection[0], "is-reading": true, "is-selected": isSelected })), index.h("div", { class: "oddsbom-oddschart-selection-item--2" }, index.h("lottery-oddsbom-bullet", { text: selection[1], "is-reading": true, "is-selected": isSelected }))));
|
|
459
|
+
})), index.h("div", { class: "oddsbom-oddschart-selection-odds" }, index.h("div", { class: "oddsbom-oddschart-selection-odds--text" }, lotteryOddsbomTicketBet.formatNumber(odds)), isSelected && (index.h("div", { class: "oddsbom-oddschart-selection-odds--fillIn" }, index.h("lottery-oddsbom-ticket-button", { text: lotteryOddsbomTicketBet.translate('fillIn', this.language), size: "small", variant: "outline", onClick: this.handleFillIn.bind(this, group), language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl }))))));
|
|
460
|
+
}
|
|
461
|
+
handleFillIn(nums) {
|
|
462
|
+
this.oddschartFillInEvent.emit({ fillInNums: nums });
|
|
463
|
+
}
|
|
464
|
+
clearMatchSelection() {
|
|
465
|
+
this.hasFillInSelection = false;
|
|
466
|
+
if (this.matchItemsContainer) {
|
|
467
|
+
const inputs = this.matchItemsContainer.querySelectorAll('lottery-oddsbom-oddschart-input');
|
|
468
|
+
inputs.forEach((input) => {
|
|
469
|
+
input.clearValue();
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
fillInMatchSelection() {
|
|
474
|
+
const nums = [];
|
|
475
|
+
this.matchSelection.forEach((selection) => {
|
|
476
|
+
nums.push(`${selection[0]}:${selection[1]}`);
|
|
477
|
+
});
|
|
478
|
+
this.handleFillIn(nums);
|
|
479
|
+
}
|
|
480
|
+
render() {
|
|
481
|
+
var _a, _b;
|
|
482
|
+
return (index.h("div", { key: 'b160d1870184937cdd013a233a4841545d8f769a', class: "oddsbom-oddschart", ref: (el) => (this.stylingContainer = el) }, !((_a = this.matchInfo) === null || _a === void 0 ? void 0 : _a.length) || !((_b = this.oddsInfo) === null || _b === void 0 ? void 0 : _b.length) ? (index.h("div", { class: "empty-wrap" }, index.h("span", { innerHTML: infoIcon, style: { marginRight: '6px', height: '18px' } }), index.h("span", { class: "empty-wrap-text", style: { fontSize: '18px' } }, lotteryOddsbomTicketBet.translate('noBets', this.language)))) : (this.matchInfo && (index.h("div", { class: "oddsbom-oddschart-container" }, index.h("div", { class: "oddsbom-oddschart-wrap" }, index.h("div", { class: "oddsbom-oddschart-match", ref: (el) => (this.matchItemsContainer = el) }, this.matchInfo.map((match, idx) => {
|
|
483
|
+
return (index.h("div", { class: "oddsbom-oddschart-match-item", key: idx }, index.h("div", { class: "oddsbom-oddschart-match-item-name" }, index.h("div", { class: "oddsbom-oddschart-match-item-name--home" }, `${idx + 1}. ${match.eventName.split('vs')[0]}`), index.h("div", { class: "oddsbom-oddschart-match-item-name--delimiter" }, "vs"), index.h("div", { class: "oddsbom-oddschart-match-item-name--away" }, `${match.eventName.split('vs')[1]}`)), index.h("div", { class: "oddsbom-oddschart-match-item-input" }, index.h("lottery-oddsbom-oddschart-input", null), index.h("lottery-oddsbom-oddschart-input", null))));
|
|
484
|
+
}), index.h("div", { class: "oddsbom-oddschart-match-search" }, index.h("lottery-oddsbom-ticket-button", { text: lotteryOddsbomTicketBet.translate('search', this.language), variant: "outline", onClick: this.handleSearch }))), this.hasFillInSelection &&
|
|
485
|
+
!this.isSearching &&
|
|
486
|
+
(this.filterdOdds ? (index.h("div", { class: "oddsbom-oddschart-input-wrap" }, index.h("div", { class: "oddsbom-oddschart-input" }, this.matchSelection.map((arr) => {
|
|
487
|
+
return (index.h("div", { class: "oddsbom-oddschart-input-item" }, index.h("lottery-oddsbom-bullet", { text: arr[0], "is-reading": true, "is-selected": true }), index.h("lottery-oddsbom-bullet", { text: arr[1], "is-reading": true, "is-selected": true })));
|
|
488
|
+
}), index.h("div", { class: "oddsbom-oddschart-input-odds" }, lotteryOddsbomTicketBet.formatNumber(this.filterdOdds))), index.h("div", { class: "oddsbom-oddschart-input-operation" }, index.h("lottery-oddsbom-ticket-button", { text: lotteryOddsbomTicketBet.translate('clear', this.language), variant: "outline", size: "small", onClick: this.clearMatchSelection.bind(this) }), index.h("lottery-oddsbom-ticket-button", { text: lotteryOddsbomTicketBet.translate('fillIn', this.language), variant: "outline", size: "small", onClick: this.fillInMatchSelection.bind(this) })))) : (index.h("div", { class: "oddsbom-oddschart-input-empty" }, index.h("div", null, index.h("span", { innerHTML: infoIcon1, style: { marginRight: '6px', height: '16px' } }), index.h("span", { style: { fontSize: '14px' } }, lotteryOddsbomTicketBet.translate('noBets', this.language))), index.h("div", { class: "oddsbom-oddschart-input-empty-operation" }, index.h("lottery-oddsbom-ticket-button", { text: lotteryOddsbomTicketBet.translate('clear', this.language), variant: "text", size: "small", onClick: this.clearMatchSelection.bind(this) }), index.h("lottery-oddsbom-ticket-button", { text: lotteryOddsbomTicketBet.translate('fillIn', this.language), variant: "text", size: "small", onClick: this.fillInMatchSelection.bind(this) }))))), index.h("div", { class: "oddsbom-oddschart-match-filter" }, (this.isLoading || this.isSearching) && index.h("div", { class: "progress-bar" }), index.h("span", { onClick: this.toggleFilterIcon, class: `arrow ${this.isAscend ? 'ascend' : ''}`, innerHTML: upIcon })), index.h("div", { class: "oddsbom-oddschart-selection" }, this.oddsInfo.map((oddsItem, idx) => {
|
|
489
|
+
return this.generateBulletGroup(oddsItem.lineSelection, oddsItem.odds, idx);
|
|
490
|
+
})), index.h("div", { class: "oddsbom-oddschart-pagination" }, index.h("div", { class: "oddsbom-oddschart-pagination-wrap" }, index.h("div", { class: `oddsbom-oddschart-pagination-prev ${this.curPage < 1 ? 'disabled' : ''}`, onClick: this.handlePrevPage }, index.h("div", { class: "oddsbom-oddschart-pagination-icon", innerHTML: leftArrowIcon })), index.h("div", { class: "oddsbom-oddschart-pagination-page" }, `${this.curPage + 1} / ${this.totalPage}`), index.h("div", { class: `oddsbom-oddschart-pagination-next ${this.curPage >= this.totalPage - 1 ? 'disabled' : ''}`, onClick: this.handleNextPage }, index.h("div", { class: "oddsbom-oddschart-pagination-icon", innerHTML: rightArrowIcon }))))))))));
|
|
491
|
+
}
|
|
492
|
+
static get watchers() { return {
|
|
493
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
494
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
495
|
+
"mbSource": ["handleMbSourceChange"],
|
|
496
|
+
"matchInfo": ["handleMatchInfoChange"]
|
|
497
|
+
}; }
|
|
498
|
+
};
|
|
499
|
+
LotteryOddsbomOddschart.style = LotteryOddsbomOddschartStyle0;
|
|
500
|
+
|
|
501
|
+
const lotteryOddsbomOddschartInputCss = ".oddscharts-input{display:inline-flex;padding:2px}.oddscharts-input input{width:32px;height:32px;text-align:center;font-size:14px;font-weight:bold;line-height:32px;border:2px solid var(--emw--color-gray-100, #e6e6e6);border-radius:4px;padding:0;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);text-transform:uppercase}.oddscharts-input input:focus{outline:none;border-color:var(--emw--color-primary, #0d196e);box-shadow:0 0 0 2px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));border-width:2px}.oddscharts-input input:disabled{background-color:var(--emw--color-gray-50, #f5f5f5);border-color:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-gray-150, #6f6f6f);cursor:not-allowed}.oddscharts-input input.error{border-color:var(--emw--color-error, #ff3d00)}.oddscharts-input input.error:focus{box-shadow:0 0 0 2px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15))}";
|
|
502
|
+
const LotteryOddsbomOddschartInputStyle0 = lotteryOddsbomOddschartInputCss;
|
|
503
|
+
|
|
504
|
+
const LotteryOddsbomOddschartInput = class {
|
|
505
|
+
constructor(hostRef) {
|
|
506
|
+
index.registerInstance(this, hostRef);
|
|
507
|
+
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
508
|
+
this.handleInputChange = (e) => {
|
|
509
|
+
const input = e.target;
|
|
510
|
+
const value = input.value.trim();
|
|
511
|
+
this.valueChange.emit(value);
|
|
512
|
+
};
|
|
513
|
+
this.handleKeyDown = (e) => {
|
|
514
|
+
if (e.key === 'Enter') {
|
|
515
|
+
this.inputElement.blur();
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
this.mbSource = undefined;
|
|
519
|
+
this.clientStyling = undefined;
|
|
520
|
+
this.clientStylingUrl = undefined;
|
|
521
|
+
this.value = '';
|
|
522
|
+
}
|
|
523
|
+
async getValue() {
|
|
524
|
+
return this.inputElement.value;
|
|
525
|
+
}
|
|
526
|
+
async clearValue() {
|
|
527
|
+
if (this.inputElement) {
|
|
528
|
+
this.inputElement.value = '';
|
|
529
|
+
}
|
|
530
|
+
this.value = '';
|
|
531
|
+
}
|
|
532
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
533
|
+
if (newValue != oldValue) {
|
|
534
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
538
|
+
if (newValue != oldValue) {
|
|
539
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
543
|
+
if (newValue != oldValue) {
|
|
544
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
componentDidLoad() {
|
|
548
|
+
if (this.stylingContainer) {
|
|
549
|
+
if (this.mbSource)
|
|
550
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
551
|
+
if (this.clientStyling)
|
|
552
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
553
|
+
if (this.clientStylingUrl)
|
|
554
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
disconnectedCallback() {
|
|
558
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
559
|
+
}
|
|
560
|
+
render() {
|
|
561
|
+
return (index.h("div", { key: 'eb973f7978b7452788f72a43da5424abbe845361', class: "oddscharts-input", ref: (el) => (this.stylingContainer = el) }, index.h("input", { key: 'f24fba10175b944af328b71f8e257d8ad1386af2', ref: (el) => (this.inputElement = el), type: "text", inputMode: "numeric", value: this.value, onInput: this.handleInputChange, onKeyDown: this.handleKeyDown, autocomplete: "one-time-code" })));
|
|
562
|
+
}
|
|
563
|
+
static get watchers() { return {
|
|
564
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
565
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
566
|
+
"mbSource": ["handleMbSourceChange"]
|
|
567
|
+
}; }
|
|
568
|
+
};
|
|
569
|
+
LotteryOddsbomOddschartInput.style = LotteryOddsbomOddschartInputStyle0;
|
|
570
|
+
|
|
571
|
+
const lotteryOddsbomTicketBoardCss = ".oddsbomTicketBoard {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: 4px;\n container-type: inline-size;\n min-height: 220px;\n}\n.oddsbomTicketBoard-noData {\n display: flex;\n justify-content: center;\n height: 200px;\n align-items: center;\n}\n.oddsbomTicketBoard-btn {\n display: flex;\n justify-content: flex-end;\n margin: 16px;\n margin-bottom: unset;\n}\n.oddsbomTicketBoard-item {\n display: flex;\n gap: 16px;\n flex-direction: column;\n padding: 24px;\n}\n.oddsbomTicketBoard-item:not(:last-child) {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n.oddsbomTicketBoard-item-header {\n font-weight: bold;\n color: var(--emw--color-typography, #000);\n}\n.oddsbomTicketBoard-item-match {\n display: flex;\n align-items: center;\n}\n.oddsbomTicketBoard-item-match--left {\n width: 130px;\n color: var(--emw--color-typography, #000);\n}\n.oddsbomTicketBoard-item-match--right {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 12px;\n justify-content: space-evenly;\n}\n@container (max-width: 320px) {\n .oddsbomTicketBoard-item-match--left {\n width: 100px;\n max-width: 100px;\n }\n}\n\n.dialog-input {\n width: 100%;\n padding: 8px;\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n border-radius: 4px;\n box-sizing: border-box;\n margin-top: 10px;\n}\n\n.dialog-input.invalid,\n.dialog-input.invalid:focus {\n border-color: var(--emw--color-error, #ff3d00);\n outline-color: var(--emw--color-error, #ff3d00);\n}\n\n.error-message {\n color: var(--emw--color-error, #ff3d00);\n font-size: 12px;\n margin-top: 4px;\n}\n\n.addSelectionDialog-title {\n color: var(--emw--color-typography, #000);\n}\n.addSelectionDialog-footer {\n display: flex;\n justify-content: flex-end;\n gap: 18px;\n}";
|
|
572
|
+
const LotteryOddsbomTicketBoardStyle0 = lotteryOddsbomTicketBoardCss;
|
|
573
|
+
|
|
574
|
+
const LotteryOddsbomTicketBoard = class {
|
|
575
|
+
constructor(hostRef) {
|
|
576
|
+
index.registerInstance(this, hostRef);
|
|
577
|
+
this.oddsbomBoardClearEvent = index.createEvent(this, "oddsbomBoardClear", 7);
|
|
578
|
+
this.oddsbomAddMoreToMatchEvent = index.createEvent(this, "oddsbomAddMoreToMatch", 7);
|
|
579
|
+
this.ticketBoardInfo = undefined;
|
|
580
|
+
this.mbSource = undefined;
|
|
581
|
+
this.clientStyling = undefined;
|
|
582
|
+
this.clientStylingUrl = undefined;
|
|
583
|
+
this.language = 'en';
|
|
584
|
+
this.translationUrl = '';
|
|
585
|
+
this.addSelectionConfig = undefined;
|
|
586
|
+
this.bulletsConfig = undefined;
|
|
587
|
+
this.isInputInvalid = false;
|
|
588
|
+
this.errorMessage = '';
|
|
589
|
+
this.dialogConfig = {
|
|
590
|
+
width: '400px',
|
|
591
|
+
visible: false,
|
|
592
|
+
onConfirm: () => this.handleFillInAddMore(),
|
|
593
|
+
onCancel: () => this.handleCloseAddMoreDialog()
|
|
594
|
+
};
|
|
595
|
+
this.curAddMoreInfo = { matchIdx: 0, selectionIdx: 0, value: '' };
|
|
596
|
+
}
|
|
597
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
598
|
+
if (newValue != oldValue) {
|
|
599
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
603
|
+
if (newValue != oldValue) {
|
|
604
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
608
|
+
if (newValue != oldValue) {
|
|
609
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
componentWillLoad() {
|
|
613
|
+
if (this.translationUrl) {
|
|
614
|
+
lotteryOddsbomTicketBet.getTranslations(JSON.parse(this.translationUrl));
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
handleOddsbomBulletGroupToggle(event) {
|
|
618
|
+
const { bulletConfigArr } = event.detail;
|
|
619
|
+
this.bulletsConfig = bulletConfigArr;
|
|
620
|
+
}
|
|
621
|
+
handleOddsbomBulletCallDialogFromGroup(event) {
|
|
622
|
+
const { matchIdx, selectionIdx } = event.detail;
|
|
623
|
+
this.curAddMoreInfo = Object.assign(Object.assign({}, this.curAddMoreInfo), { matchIdx, selectionIdx });
|
|
624
|
+
this.dialogConfig = Object.assign(Object.assign({}, this.dialogConfig), { visible: true });
|
|
625
|
+
}
|
|
626
|
+
handleFillInAddMore() {
|
|
627
|
+
if (this.isInputInvalid) {
|
|
628
|
+
this.handleCloseAddMoreDialog();
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
const { matchIdx, selectionIdx, value } = this.curAddMoreInfo;
|
|
632
|
+
this.oddsbomAddMoreToMatchEvent.emit({ matchIdx, selectionIdx, value });
|
|
633
|
+
this.dialogConfig = Object.assign(Object.assign({}, this.dialogConfig), { visible: false });
|
|
634
|
+
this.curAddMoreInfo = Object.assign(Object.assign({}, this.curAddMoreInfo), { value: '' });
|
|
635
|
+
}
|
|
636
|
+
handleCloseAddMoreDialog() {
|
|
637
|
+
this.dialogConfig = Object.assign(Object.assign({}, this.dialogConfig), { visible: false });
|
|
638
|
+
this.curAddMoreInfo = Object.assign(Object.assign({}, this.curAddMoreInfo), { value: '' });
|
|
639
|
+
this.isInputInvalid = false;
|
|
640
|
+
this.errorMessage = '';
|
|
641
|
+
}
|
|
642
|
+
handleClearAllSelection() {
|
|
643
|
+
this.oddsbomBoardClearEvent.emit();
|
|
644
|
+
lotteryOddsbomTicketBet.showNotification({ message: lotteryOddsbomTicketBet.translate('selectionCleared', this.language) });
|
|
645
|
+
}
|
|
646
|
+
validateInput(value) {
|
|
647
|
+
const numValue = Number(value);
|
|
648
|
+
if (isNaN(numValue)) {
|
|
649
|
+
this.isInputInvalid = true;
|
|
650
|
+
this.errorMessage = lotteryOddsbomTicketBet.translate('enterValidNumber', this.language);
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
if (numValue < lotteryOddsbomTicketBet.MAX_DISPLAY_OPTION_NUM || numValue > this.addSelectionConfig.maxScore) {
|
|
654
|
+
this.isInputInvalid = true;
|
|
655
|
+
this.errorMessage = lotteryOddsbomTicketBet.translate('enterNumberBetween', this.language, {
|
|
656
|
+
min: lotteryOddsbomTicketBet.MAX_DISPLAY_OPTION_NUM,
|
|
657
|
+
max: this.addSelectionConfig.maxScore
|
|
658
|
+
});
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
const { matchIdx, selectionIdx } = this.curAddMoreInfo;
|
|
662
|
+
const selections = this.ticketBoardInfo[matchIdx].addSelections[selectionIdx];
|
|
663
|
+
if (selections.some((s) => Number(s) === Number(value))) {
|
|
664
|
+
this.isInputInvalid = true;
|
|
665
|
+
this.errorMessage = lotteryOddsbomTicketBet.translate('numberAlreadySelected', this.language);
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
this.isInputInvalid = false;
|
|
669
|
+
this.errorMessage = '';
|
|
670
|
+
}
|
|
671
|
+
handleInputChange(e) {
|
|
672
|
+
const inputElement = e.target;
|
|
673
|
+
const value = inputElement.value;
|
|
674
|
+
this.curAddMoreInfo = Object.assign(Object.assign({}, this.curAddMoreInfo), { value: value });
|
|
675
|
+
this.validateInput(value);
|
|
676
|
+
}
|
|
677
|
+
componentDidLoad() {
|
|
678
|
+
if (this.stylingContainer) {
|
|
679
|
+
if (this.mbSource)
|
|
680
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
681
|
+
if (this.clientStyling)
|
|
682
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
683
|
+
if (this.clientStylingUrl)
|
|
684
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
disconnectedCallback() {
|
|
688
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
689
|
+
}
|
|
690
|
+
render() {
|
|
691
|
+
return (index.h("div", { key: '7cacb40559ce42eed5c03326d830461c9dbd2708', class: "oddsbomTicketBoard", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: 'b1c7f38a621320949049f26745232d2a34d644e8', class: "oddsbomTicketBoard-btn" }, index.h("lottery-oddsbom-ticket-button", { key: 'ff6c51b5a115cf46e4fc6df5b725a8233a55fa0f', onClick: this.handleClearAllSelection.bind(this), text: lotteryOddsbomTicketBet.translate('clearAll', this.language), variant: "outline" })), this.ticketBoardInfo.length ? (index.h("div", { class: "oddsbomTicketBoard-list" }, this.ticketBoardInfo.map((item, idx) => {
|
|
692
|
+
return (index.h("div", { class: "oddsbomTicketBoard-item" }, index.h("div", { class: "oddsbomTicketBoard-item-header" }, `${idx + 1}. ${item.matchName}`), index.h("div", { class: "oddsbomTicketBoard-item-match" }, index.h("div", { class: "oddsbomTicketBoard-item-match--left" }, item.matchName.split('vs')[0]), index.h("div", { class: "oddsbomTicketBoard-item-match--right" }, index.h("lottery-oddsbom-bullet-group", { bulletConfigs: item.selections[0], selectionIdx: 0, matchIdx: idx, addSelectionConfig: this.addSelectionConfig }))), index.h("div", { class: "oddsbomTicketBoard-item-match" }, index.h("div", { class: "oddsbomTicketBoard-item-match--left" }, item.matchName.split('vs')[1]), index.h("div", { class: "oddsbomTicketBoard-item-match--right" }, index.h("lottery-oddsbom-bullet-group", { bulletConfigs: item.selections[1], selectionIdx: 1, matchIdx: idx, addSelectionConfig: this.addSelectionConfig })))));
|
|
693
|
+
}))) : (index.h("div", { class: "oddsbomTicketBoard-noData" }, lotteryOddsbomTicketBet.translate('noTicketBoard', this.language))), index.h("lottery-tipping-dialog", { key: 'dbaf34154fcf9a16d3210f03345d80c4a5354125', visible: this.dialogConfig.visible, width: this.dialogConfig.width, onCancel: this.handleCloseAddMoreDialog.bind(this) }, index.h("div", { key: '93370ed84ff6e3483214307e45cb46f767712343', class: "addSelectionDialog" }, index.h("div", { key: 'ec774960c7f0bc25dc2d2e55d7b185d520dbbe27', class: "addSelectionDialog-title" }, lotteryOddsbomTicketBet.translate('enterScoreUpTo', this.language, {
|
|
694
|
+
maxScore: this.addSelectionConfig.maxScore
|
|
695
|
+
})), index.h("input", { key: 'd21da9e15f671a9790b343674af722394c5599ce', type: "text", class: {
|
|
696
|
+
'dialog-input': true,
|
|
697
|
+
invalid: this.isInputInvalid
|
|
698
|
+
}, value: this.curAddMoreInfo.value, onInput: this.handleInputChange.bind(this) }), index.h("div", { key: 'ebe2c70cd8a5ba10bdfdc99178356677cd076621', class: "error-message" }, this.errorMessage)), index.h("div", { key: '31ff21b79c853c9f46fc8e8ba0f33b39bf2cda4f', slot: "footer", class: "addSelectionDialog-footer" }, index.h("lottery-oddsbom-ticket-button", { key: '34a4edbfae9233b0ee47ffd929901ad7fe991ffe', onClick: this.dialogConfig.onCancel, text: lotteryOddsbomTicketBet.translate('cancel', this.language), variant: "outline" }), index.h("lottery-oddsbom-ticket-button", { key: 'd0ff9fb20917bd30d88b2aaa87cb863069a88328', onClick: this.dialogConfig.onConfirm, text: lotteryOddsbomTicketBet.translate('confirm', this.language), variant: "primary", disabled: !this.curAddMoreInfo.value })))));
|
|
699
|
+
}
|
|
700
|
+
static get watchers() { return {
|
|
701
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
702
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
703
|
+
"mbSource": ["handleMbSourceChange"]
|
|
704
|
+
}; }
|
|
705
|
+
};
|
|
706
|
+
LotteryOddsbomTicketBoard.style = LotteryOddsbomTicketBoardStyle0;
|
|
707
|
+
|
|
708
|
+
const lotteryOddsbomTicketButtonCss = ":host{display:inline-block;font-family:\"PingFang SC\", \"Microsoft YaHei\", \"Helvetica Neue\", Helvetica, Arial, sans-serif}.btn{position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;font-weight:500;cursor:pointer;outline:none;overflow:hidden;transition:background-color 0.2s, border-color 0.2s, color 0.2s;user-select:none;-webkit-tap-highlight-color:transparent}.btn .content{position:relative}.btn:disabled{cursor:not-allowed;opacity:0.5}.btn .loading-container{display:flex;align-items:center}.btn--loading{position:relative}.btn .spinner{display:inline-block;width:1em;height:1em;border:2px solid rgba(255, 255, 255, 0.3);border-radius:50%;border-top-color:white;animation:spin 1s ease-in-out infinite;margin-left:0.5em;vertical-align:middle}.btn--small .spinner{width:0.8em;height:0.8em}.btn--large .spinner{width:1.2em;height:1.2em}@keyframes spin{to{transform:rotate(360deg)}}.btn--primary{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff)}.btn--primary:hover:not(:disabled){background-color:var(--emw--color-primary-variant, #1367e7)}.btn--primary:active:not(:disabled){background-color:#08104a}.btn--outline .spinner,.btn--dashed .spinner,.btn--text .spinner{border-top-color:currentColor;border-color:rgba(0, 0, 0, 0.2)}.btn--outline{background-color:var(--emw--color-background, #fff);border-color:#dcdcdc;color:var(--emw--color-typography, #000)}.btn--outline:hover:not(:disabled){background-color:var(--emw--color-background-tertiary, #ccc);border-color:#a6a6a6}.btn--outline:active:not(:disabled){background-color:#e6e6e6}.btn--dashed{background-color:transparent;border-style:dashed;border-color:#dcdcdc;color:#333}.btn--dashed:hover:not(:disabled){border-color:#a6a6a6;color:#0052d9}.btn--text{background-color:transparent;color:#0052d9;border-color:transparent}.btn--text:hover:not(:disabled){background-color:#f2f2f2}.btn--text:active:not(:disabled){background-color:#e6e6e6}.btn--small{height:28px;font-size:12px;padding:0 12px}.btn--medium{height:34px;font-size:14px;padding:0 18px}.btn--large{height:40px;font-size:16px;padding:0 24px}.ripple-container{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;border-radius:inherit}.ripple{position:absolute;border-radius:50%;background-color:rgba(255, 255, 255, 0.3);transform:scale(0);animation:ripple-animation 600ms linear}.btn--outline .ripple,.btn--dashed .ripple,.btn--text .ripple{background-color:rgba(0, 0, 0, 0.1)}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}";
|
|
709
|
+
const LotteryOddsbomTicketButtonStyle0 = lotteryOddsbomTicketButtonCss;
|
|
710
|
+
|
|
711
|
+
const LotteryOddsbomTicketButton = class {
|
|
712
|
+
constructor(hostRef) {
|
|
713
|
+
index.registerInstance(this, hostRef);
|
|
714
|
+
this.handleClick = (event) => {
|
|
715
|
+
if (this.disabled) {
|
|
716
|
+
return;
|
|
717
|
+
}
|
|
718
|
+
// Get the button element from the shadow root
|
|
719
|
+
const button = this.host.shadowRoot.querySelector('.btn');
|
|
720
|
+
if (!button)
|
|
721
|
+
return;
|
|
722
|
+
const rect = button.getBoundingClientRect();
|
|
723
|
+
const size = Math.max(rect.width, rect.height);
|
|
724
|
+
const top = event.clientY - rect.top - size / 2;
|
|
725
|
+
const left = event.clientX - rect.left - size / 2;
|
|
726
|
+
// Add the new ripple to the state, triggering a re-render
|
|
727
|
+
const newRipple = { top, left, size };
|
|
728
|
+
this.ripples = [...this.ripples, newRipple];
|
|
729
|
+
// Set a timeout to clean up the ripple from the state after the animation ends
|
|
730
|
+
// This prevents the DOM from filling up with old ripple elements
|
|
731
|
+
setTimeout(() => {
|
|
732
|
+
this.ripples = this.ripples.filter((r) => r !== newRipple);
|
|
733
|
+
}, 600); // This duration should match the CSS animation duration
|
|
734
|
+
};
|
|
735
|
+
this.variant = 'primary';
|
|
736
|
+
this.size = 'medium';
|
|
737
|
+
this.disabled = false;
|
|
738
|
+
this.loading = false;
|
|
739
|
+
this.text = undefined;
|
|
740
|
+
this.mbSource = undefined;
|
|
741
|
+
this.language = 'en';
|
|
742
|
+
this.clientStyling = undefined;
|
|
743
|
+
this.clientStylingUrl = undefined;
|
|
744
|
+
this.translationUrl = '';
|
|
745
|
+
this.ripples = [];
|
|
746
|
+
}
|
|
747
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
748
|
+
if (newValue != oldValue) {
|
|
749
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
753
|
+
if (newValue != oldValue) {
|
|
754
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
758
|
+
if (newValue != oldValue) {
|
|
759
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
disconnectedCallback() {
|
|
763
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
764
|
+
}
|
|
765
|
+
componentWillLoad() {
|
|
766
|
+
if (this.translationUrl) {
|
|
767
|
+
lotteryOddsbomTicketBet.resolveTranslationUrl(this.translationUrl);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
render() {
|
|
771
|
+
const { variant, disabled, size } = this;
|
|
772
|
+
const isDisabled = disabled || this.loading;
|
|
773
|
+
return (index.h("button", { key: 'c0c87c36c7c3f48286729c9133eded8338f137be', class: {
|
|
774
|
+
btn: true,
|
|
775
|
+
[`btn--${variant}`]: true,
|
|
776
|
+
[`btn--${size}`]: true,
|
|
777
|
+
'btn--loading': this.loading
|
|
778
|
+
}, disabled: isDisabled, onClick: this.handleClick }, this.loading ? (index.h("div", { class: "loading-container" }, index.h("span", { class: "content" }, this.text || lotteryOddsbomTicketBet.translate('loading', this.language)), index.h("span", { class: "spinner" }))) : (index.h("span", { class: "content" }, this.text)), index.h("div", { key: '8276ad215063ef4217b11f65fb189d6fcccd1f24', class: "ripple-container" }, this.ripples.map((ripple, index$1) => (index.h("span", { key: index$1, class: "ripple", style: {
|
|
779
|
+
top: `${ripple.top}px`,
|
|
780
|
+
left: `${ripple.left}px`,
|
|
781
|
+
width: `${ripple.size}px`,
|
|
782
|
+
height: `${ripple.size}px`
|
|
783
|
+
} }))))));
|
|
784
|
+
}
|
|
785
|
+
get host() { return index.getElement(this); }
|
|
786
|
+
static get watchers() { return {
|
|
787
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
788
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
789
|
+
"mbSource": ["handleMbSourceChange"]
|
|
790
|
+
}; }
|
|
791
|
+
};
|
|
792
|
+
LotteryOddsbomTicketButton.style = LotteryOddsbomTicketButtonStyle0;
|
|
793
|
+
|
|
794
|
+
const lotteryOddsbomTicketSelectionCss = ".oddsbomSelection {\n container-type: inline-size;\n}\n.oddsbomSelection-panel--header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n height: 40px;\n padding: 0 4px;\n color: var(--emw--color-typography, #000);\n}\n.oddsbomSelection-panel--header:hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n border-radius: 4px;\n}\n.oddsbomSelection-panel--header-title {\n font-size: 16px;\n font-weight: 600;\n user-select: none;\n}\n.oddsbomSelection-panel--header-icon {\n transition: transform 0.2s;\n}\n.oddsbomSelection-panel--header-icon.expanded {\n transform: rotate(180deg);\n}\n.oddsbomSelection-panel--content {\n overflow: hidden;\n max-height: 0;\n transition: max-height 0.3s ease, padding 0.3s ease;\n padding: 0 12px;\n font-size: 14px;\n user-select: none;\n}\n.oddsbomSelection-panel--content.open {\n max-height: 19000px;\n padding: 10px 12px;\n background-color: var(--emw--color-background, #fff);\n}\n.oddsbomSelection-panel--content.closed {\n max-height: 0;\n padding-top: 0;\n padding-bottom: 0;\n}\n.oddsbomSelection-panel--content-thead {\n display: flex;\n justify-content: space-between;\n padding: 0 24px;\n margin-bottom: 12px;\n color: var(--emw--color-typography, #000);\n}\n.oddsbomSelection-panel--content-tbody {\n padding: 0 18px;\n}\n.oddsbomSelection-item {\n display: flex;\n justify-content: space-between;\n position: relative;\n padding: 8px;\n}\n.oddsbomSelection-item:not(:last-child) {\n border-bottom: 1px dashed var(--emw--color-gray-100, #e6e6e6);\n}\n.oddsbomSelection-item-number {\n position: absolute;\n left: -18px;\n top: 48%;\n color: var(--emw--color-typography, #000);\n}\n.oddsbomSelection-item-selection {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.oddsbomSelection-item-team {\n display: flex;\n justify-content: space-between;\n align-items: center;\n min-height: 32px;\n color: var();\n}\n.oddsbomSelection-item-team-name {\n max-width: 140px;\n width: 140px;\n color: var(--emw--color-typography, #000);\n}\n.oddsbomSelection-item-team-selection {\n display: flex;\n gap: 6px;\n flex: 1;\n justify-content: flex-end;\n}\n@container (max-width: 430px) {\n .oddsbomSelection-item-team-name {\n max-width: 80px;\n width: 80px;\n }\n}\n\n.oddsbomSelection-panel--header-icon {\n fill: var(--emw--color-typography, #000);\n}";
|
|
795
|
+
const LotteryOddsbomTicketSelectionStyle0 = lotteryOddsbomTicketSelectionCss;
|
|
796
|
+
|
|
797
|
+
const downIcon = renderIconDefinitionToSVGElement(DownOutlined$1, {
|
|
798
|
+
extraSVGAttrs: { width: '16px', height: '16px', fill: '' }
|
|
799
|
+
});
|
|
800
|
+
const LotteryOddsbomTicketSelection = class {
|
|
801
|
+
constructor(hostRef) {
|
|
802
|
+
index.registerInstance(this, hostRef);
|
|
803
|
+
this.togglePanel = () => {
|
|
804
|
+
this.expanded = !this.expanded;
|
|
805
|
+
};
|
|
806
|
+
this.mbSource = undefined;
|
|
807
|
+
this.clientStyling = undefined;
|
|
808
|
+
this.clientStylingUrl = undefined;
|
|
809
|
+
this.ticketBoardInfo = undefined;
|
|
810
|
+
this.language = 'en';
|
|
811
|
+
this.expanded = false;
|
|
812
|
+
this._ticketBoardInfo = [];
|
|
813
|
+
}
|
|
814
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
815
|
+
if (newValue != oldValue) {
|
|
816
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
820
|
+
if (newValue != oldValue) {
|
|
821
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
825
|
+
if (newValue != oldValue) {
|
|
826
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
componentWillLoad() {
|
|
830
|
+
this._ticketBoardInfo = JSON.parse(JSON.stringify(this.ticketBoardInfo));
|
|
831
|
+
}
|
|
832
|
+
componentDidLoad() {
|
|
833
|
+
if (this.stylingContainer) {
|
|
834
|
+
if (this.mbSource)
|
|
835
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
836
|
+
if (this.clientStyling)
|
|
837
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
838
|
+
if (this.clientStylingUrl)
|
|
839
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
disconnectedCallback() {
|
|
843
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
844
|
+
}
|
|
845
|
+
handleTicketBoradInfoChange(newValue) {
|
|
846
|
+
this._ticketBoardInfo = JSON.parse(JSON.stringify(newValue));
|
|
847
|
+
}
|
|
848
|
+
generateMatchItemSelection(name1, name2, matchIdx, selection1, selection2, selectionOrigin1, selectionOrigin2) {
|
|
849
|
+
return (index.h("div", { class: "oddsbomSelection-item" }, index.h("div", { class: "oddsbomSelection-item-number" }, matchIdx + 1), index.h("div", { class: "oddsbomSelection-item-selection" }, index.h("div", { class: "oddsbomSelection-item-team" }, index.h("div", { class: "oddsbomSelection-item-team-name" }, name1), index.h("div", { class: "oddsbomSelection-item-team-selection" }, index.h("lottery-oddsbom-bullet-group", { bulletConfigs: selection1, selectionIdx: 0, matchIdx: matchIdx, bulletConfigsDeleteOrigin: selectionOrigin1, isDeleteByIcon: true, bulletListClass: "selection-bullet-list" }))), index.h("div", { class: "oddsbomSelection-item-team" }, index.h("div", { class: "oddsbomSelection-item-team-name" }, name2), index.h("div", { class: "oddsbomSelection-item-team-selection" }, index.h("lottery-oddsbom-bullet-group", { bulletConfigs: selection2, selectionIdx: 1, matchIdx: matchIdx, bulletConfigsDeleteOrigin: selectionOrigin2, isDeleteByIcon: true, bulletListClass: "selection-bullet-list" }))))));
|
|
850
|
+
}
|
|
851
|
+
generateSelectionList() {
|
|
852
|
+
if (!this._ticketBoardInfo)
|
|
853
|
+
return null;
|
|
854
|
+
return this._ticketBoardInfo.map((item, matchIdx) => {
|
|
855
|
+
var _a, _b, _c, _d;
|
|
856
|
+
const { matchName, selections } = item;
|
|
857
|
+
const matchName1 = matchName.split('vs')[0];
|
|
858
|
+
const matchName2 = matchName.split('vs')[1];
|
|
859
|
+
const selection1 = selections[0].filter((bulletConfig) => bulletConfig.isSelected);
|
|
860
|
+
const selection2 = selections[1].filter((bulletConfig) => bulletConfig.isSelected);
|
|
861
|
+
// added by add more btn
|
|
862
|
+
const addSelection1 = (_b = (_a = item.addSelections) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : [];
|
|
863
|
+
const addSelection2 = (_d = (_c = item.addSelections) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : [];
|
|
864
|
+
if (addSelection1.length > 0) {
|
|
865
|
+
addSelection1.forEach((selection) => {
|
|
866
|
+
selection1.push({
|
|
867
|
+
text: selection,
|
|
868
|
+
idx: -1,
|
|
869
|
+
isSelected: true,
|
|
870
|
+
isDisabled: false,
|
|
871
|
+
isAddedByMoreBtn: true
|
|
872
|
+
});
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
if (addSelection2.length > 0) {
|
|
876
|
+
addSelection2.forEach((selection) => {
|
|
877
|
+
selection2.push({
|
|
878
|
+
text: selection,
|
|
879
|
+
idx: -1,
|
|
880
|
+
isSelected: true,
|
|
881
|
+
isDisabled: false,
|
|
882
|
+
isAddedByMoreBtn: true
|
|
883
|
+
});
|
|
884
|
+
});
|
|
885
|
+
}
|
|
886
|
+
return this.generateMatchItemSelection(matchName1, matchName2, matchIdx, selection1, selection2, selections[0], selections[1]);
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
render() {
|
|
890
|
+
return (index.h("div", { key: '8e359b773654d6a1632f69837009ccc29d547561', class: "oddsbomSelection", ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '93c2575de9e70759118f4d4702f356322c2bcb88', class: "oddsbomSelection-panel" }, index.h("div", { key: '2df0bf1be465b9baa00f44052c623071f78d799d', class: "oddsbomSelection-panel--header", onClick: this.togglePanel }, index.h("div", { key: 'c32a79afcab02f683ffb8abc26395e098b080939', class: "oddsbomSelection-panel--header-title" }, lotteryOddsbomTicketBet.translate('myChoices', this.language)), index.h("div", { key: 'de2b875b0fc538212d15cb7dde2c95b10d49665a', class: `oddsbomSelection-panel--header-icon ${this.expanded ? 'expanded' : ''}`, innerHTML: downIcon })), index.h("div", { key: '4a51e00f8ab67d9ab6c1cfd25d47f93c79d7a4bf', class: `oddsbomSelection-panel--content ${this.expanded ? 'open' : 'closed'}` }, index.h("div", { key: '9f9575c3bb176769cee836c9cf027fc76580b367', class: "oddsbomSelection-panel--content-thead" }, index.h("div", { key: '3dd762c94c915afc9f14b38fdaec73a42b56004e', class: "oddsbomSelection-panel--content-thead-item" }, lotteryOddsbomTicketBet.translate('teams', this.language)), index.h("div", { key: '2ea960a6db72e11a7e9157871f70769174f722f0', class: "oddsbomSelection-panel--content-thead-item" }, lotteryOddsbomTicketBet.translate('scores', this.language))), index.h("div", { key: '847ef04f0a9e289c796a856c3d16bebc83d2d188', class: "oddsbomSelection-panel--content-tbody" }, this.generateSelectionList())))));
|
|
891
|
+
}
|
|
892
|
+
static get watchers() { return {
|
|
893
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
894
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
895
|
+
"mbSource": ["handleMbSourceChange"],
|
|
896
|
+
"ticketBoardInfo": ["handleTicketBoradInfoChange"]
|
|
897
|
+
}; }
|
|
898
|
+
};
|
|
899
|
+
LotteryOddsbomTicketSelection.style = LotteryOddsbomTicketSelectionStyle0;
|
|
900
|
+
|
|
901
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
902
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
903
|
+
const TRANSLATIONS = {
|
|
904
|
+
en: {
|
|
905
|
+
cancel: 'Cancel',
|
|
906
|
+
confirm: 'Confirm'
|
|
907
|
+
},
|
|
908
|
+
ro: {
|
|
909
|
+
cancel: 'Anulează',
|
|
910
|
+
confirm: 'Confirmă'
|
|
911
|
+
},
|
|
912
|
+
fr: {
|
|
913
|
+
cancel: 'Annuler',
|
|
914
|
+
confirm: 'Confirmer'
|
|
915
|
+
},
|
|
916
|
+
ar: {
|
|
917
|
+
cancel: 'إلغاء',
|
|
918
|
+
confirm: 'تأكيد'
|
|
919
|
+
},
|
|
920
|
+
hr: {
|
|
921
|
+
cancel: 'Odustani',
|
|
922
|
+
confirm: 'Potvrdi'
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
const translate = (key, customLang) => {
|
|
926
|
+
const lang = customLang;
|
|
927
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
928
|
+
};
|
|
929
|
+
const getTranslations = (data) => {
|
|
930
|
+
Object.keys(data).forEach((item) => {
|
|
931
|
+
for (let key in data[item]) {
|
|
932
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
};
|
|
936
|
+
const resolveTranslationUrl = async (translationUrl) => {
|
|
937
|
+
if (translationUrl) {
|
|
938
|
+
try {
|
|
939
|
+
const response = await fetch(translationUrl);
|
|
940
|
+
if (!response.ok) {
|
|
941
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
942
|
+
}
|
|
943
|
+
const translations = await response.json();
|
|
944
|
+
getTranslations(translations);
|
|
945
|
+
}
|
|
946
|
+
catch (error) {
|
|
947
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
|
|
952
|
+
const lotteryTippingDialogCss = ".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background-color:rgba(0, 0, 0, 0.5);opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-dialog-background, #fff);border-radius:12px;box-shadow:0 4px 32px rgba(0, 0, 0, 0.15);opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-dialog-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));color:var(--emw--color-gray-300, #333);background:var(--emw--color-gray-400, #fff)}.dialog-footer .cancel-btn:hover{border-color:var(--emw--color-gray-100, #e6e6e6)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-gray-400, #fff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}";
|
|
953
|
+
const LotteryTippingDialogStyle0 = lotteryTippingDialogCss;
|
|
954
|
+
|
|
955
|
+
const LotteryTippingDialog = class {
|
|
956
|
+
constructor(hostRef) {
|
|
957
|
+
index.registerInstance(this, hostRef);
|
|
958
|
+
this.open = index.createEvent(this, "open", 7);
|
|
959
|
+
this.close = index.createEvent(this, "close", 7);
|
|
960
|
+
this.confirm = index.createEvent(this, "confirm", 7);
|
|
961
|
+
this.cancel = index.createEvent(this, "cancel", 7);
|
|
962
|
+
this.wasVisible = false;
|
|
963
|
+
this.mbSource = undefined;
|
|
964
|
+
this.clientStyling = '';
|
|
965
|
+
this.clientStylingUrl = '';
|
|
966
|
+
this.visible = undefined;
|
|
967
|
+
this.dialogTitle = '';
|
|
968
|
+
this.width = '520px';
|
|
969
|
+
this.closable = true;
|
|
970
|
+
this.mask = true;
|
|
971
|
+
this.maskClosable = true;
|
|
972
|
+
this.animationDuration = 300;
|
|
973
|
+
this.fullscreen = false;
|
|
974
|
+
this.showFooter = true;
|
|
975
|
+
this.showCancelBtn = true;
|
|
976
|
+
this.language = 'en';
|
|
977
|
+
this.translationUrl = undefined;
|
|
978
|
+
}
|
|
979
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
980
|
+
if (newValue != oldValue) {
|
|
981
|
+
lotteryOddsbomTicketBet.setClientStyling(this.stylingContainer, this.clientStyling);
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
985
|
+
if (newValue != oldValue) {
|
|
986
|
+
lotteryOddsbomTicketBet.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
990
|
+
if (newValue != oldValue) {
|
|
991
|
+
lotteryOddsbomTicketBet.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
componentWillLoad() {
|
|
995
|
+
if (this.translationUrl) {
|
|
996
|
+
resolveTranslationUrl(this.translationUrl);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
componentWillUpdate() {
|
|
1000
|
+
if (this.visible && !this.wasVisible) {
|
|
1001
|
+
this.disableBodyScroll();
|
|
1002
|
+
}
|
|
1003
|
+
else if (!this.visible && this.wasVisible) {
|
|
1004
|
+
this.enableBodyScroll();
|
|
1005
|
+
}
|
|
1006
|
+
this.wasVisible = this.visible;
|
|
1007
|
+
}
|
|
1008
|
+
disconnectedCallback() {
|
|
1009
|
+
this.enableBodyScroll();
|
|
1010
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
1011
|
+
}
|
|
1012
|
+
disableBodyScroll() {
|
|
1013
|
+
document.body.style.overflow = 'hidden';
|
|
1014
|
+
}
|
|
1015
|
+
enableBodyScroll() {
|
|
1016
|
+
document.body.style.overflow = '';
|
|
1017
|
+
}
|
|
1018
|
+
handleClose() {
|
|
1019
|
+
this.cancel.emit();
|
|
1020
|
+
}
|
|
1021
|
+
handleMaskClick(e) {
|
|
1022
|
+
if (this.maskClosable && e.target === this.el.querySelector('.mask')) {
|
|
1023
|
+
this.cancel.emit();
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
handleConfirm() {
|
|
1027
|
+
this.confirm.emit();
|
|
1028
|
+
}
|
|
1029
|
+
render() {
|
|
1030
|
+
const dialogStyle = {
|
|
1031
|
+
width: typeof this.width === 'number' ? `${this.width}px` : this.width,
|
|
1032
|
+
'--duration': `${this.animationDuration}ms`
|
|
1033
|
+
};
|
|
1034
|
+
const dialogWrapperClass = ['dialog-wrapper', this.visible ? 'dialog-wrapper-visible' : ''];
|
|
1035
|
+
const maskClass = ['mask', this.visible ? 'mask-enter' : 'mask-leave'];
|
|
1036
|
+
const dialogClass = [
|
|
1037
|
+
'dialog',
|
|
1038
|
+
this.visible ? 'dialog-enter' : 'dialog-leave',
|
|
1039
|
+
this.fullscreen ? 'fullscreen' : ''
|
|
1040
|
+
].join(' ');
|
|
1041
|
+
const contentStyle = {
|
|
1042
|
+
maxHeight: 'calc(100vh - 62px)',
|
|
1043
|
+
overflowY: 'auto'
|
|
1044
|
+
};
|
|
1045
|
+
return (index.h("div", { key: '716c6488b86fc5a74bcd8c8c8a4eee1b85f75cb7', class: dialogWrapperClass.join(' '), ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '161d976b5a15f62c63b56555e161b5b29c0a7771', class: maskClass.join(' '), onClick: this.handleMaskClick.bind(this) }), index.h("div", { key: 'ebd2c356c169765b06c85997dc9906b74358b450', class: dialogClass, style: dialogStyle, role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-title" }, index.h("div", { key: '2a8616c336447b33d3c4b3f22deee3871abd93c9', class: "dialog-header" }, index.h("h2", { key: 'fc4f4f87826620754f8cce73874726cdebcc280e', id: "dialog-title", class: "dialog-title" }, this.dialogTitle), this.closable && (index.h("button", { key: '1626434c0700df7dc094cbf0c96840476ab65da5', class: "close-btn", onClick: this.handleClose.bind(this) }, "x"))), index.h("div", { key: '44d28c0e477e3e16069749f7700ee70b6a486d07', class: "dialog-content", style: contentStyle }, index.h("slot", { key: '745e1329fc3647247245f7aa96d10a06b6b18329' })), this.showFooter && (index.h("div", { key: 'cc3b19ba0ab16fd485f2c4e81a5793a25cecb98f', class: "dialog-footer" }, index.h("slot", { key: '906adc00a3735e096159002b972804cfe147f42e', name: "footer" }, this.showCancelBtn && (index.h("button", { key: '1fc68b04c7c39ca9b7dfb228836eb38c4368c355', class: "cancel-btn", onClick: this.handleClose.bind(this) }, translate('cancel', this.language))), index.h("button", { key: '1d054ca93148286249d4989c783a67e1afe33667', class: "confirm-btn", onClick: this.handleConfirm.bind(this) }, translate('confirm', this.language))))))));
|
|
1046
|
+
}
|
|
1047
|
+
get el() { return index.getElement(this); }
|
|
1048
|
+
static get watchers() { return {
|
|
1049
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
1050
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
1051
|
+
"mbSource": ["handleMbSourceChange"]
|
|
1052
|
+
}; }
|
|
1053
|
+
};
|
|
1054
|
+
LotteryTippingDialog.style = LotteryTippingDialogStyle0;
|
|
1055
|
+
|
|
1056
|
+
exports.lottery_oddsbom_ticket_bet = lotteryOddsbomTicketBet.LotteryOddsbomTicketBet;
|
|
1057
|
+
exports.lottery_oddsbom_bullet = LotteryOddsbomBullet;
|
|
1058
|
+
exports.lottery_oddsbom_bullet_group = LotteryOddsbomBulletGroup;
|
|
1059
|
+
exports.lottery_oddsbom_oddschart = LotteryOddsbomOddschart;
|
|
1060
|
+
exports.lottery_oddsbom_oddschart_input = LotteryOddsbomOddschartInput;
|
|
1061
|
+
exports.lottery_oddsbom_ticket_board = LotteryOddsbomTicketBoard;
|
|
1062
|
+
exports.lottery_oddsbom_ticket_button = LotteryOddsbomTicketButton;
|
|
1063
|
+
exports.lottery_oddsbom_ticket_selection = LotteryOddsbomTicketSelection;
|
|
1064
|
+
exports.lottery_tipping_dialog = LotteryTippingDialog;
|