@everymatrix/user-deposit-withdrawal 1.31.2 → 1.32.4

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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +3 -2
  3. package/dist/cjs/index-0e9931a1.js +0 -1259
  4. package/dist/cjs/index.cjs.js +0 -2
  5. package/dist/cjs/loader.cjs.js +0 -21
  6. package/dist/cjs/user-deposit-withdrawal.cjs.entry.js +0 -213
  7. package/dist/cjs/user-deposit-withdrawal.cjs.js +0 -19
  8. package/dist/collection/collection-manifest.json +0 -12
  9. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.css +0 -35
  10. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.js +0 -560
  11. package/dist/collection/index.js +0 -1
  12. package/dist/collection/utils/locale.utils.js +0 -24
  13. package/dist/collection/utils/utils.js +0 -29
  14. package/dist/components/index.d.ts +0 -26
  15. package/dist/components/index.js +0 -1
  16. package/dist/components/user-deposit-withdrawal.d.ts +0 -11
  17. package/dist/components/user-deposit-withdrawal.js +0 -251
  18. package/dist/esm/index-fe945b18.js +0 -1233
  19. package/dist/esm/index.js +0 -1
  20. package/dist/esm/loader.js +0 -17
  21. package/dist/esm/polyfills/core-js.js +0 -11
  22. package/dist/esm/polyfills/css-shim.js +0 -1
  23. package/dist/esm/polyfills/dom.js +0 -79
  24. package/dist/esm/polyfills/es5-html-element.js +0 -1
  25. package/dist/esm/polyfills/index.js +0 -34
  26. package/dist/esm/polyfills/system.js +0 -6
  27. package/dist/esm/user-deposit-withdrawal.entry.js +0 -209
  28. package/dist/esm/user-deposit-withdrawal.js +0 -17
  29. package/dist/index.cjs.js +0 -1
  30. package/dist/index.js +0 -1
  31. package/dist/stencil.config.js +0 -22
  32. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/user-deposit-withdrawal/.stencil/packages/user-deposit-withdrawal/stencil.config.d.ts +0 -2
  33. package/dist/types/components/user-deposit-withdrawal/user-deposit-withdrawal.d.ts +0 -74
  34. package/dist/types/components.d.ts +0 -98
  35. package/dist/types/index.d.ts +0 -1
  36. package/dist/types/stencil-public-runtime.d.ts +0 -1565
  37. package/dist/types/utils/locale.utils.d.ts +0 -1
  38. package/dist/types/utils/utils.d.ts +0 -8
  39. package/dist/user-deposit-withdrawal/index.esm.js +0 -0
  40. package/dist/user-deposit-withdrawal/p-086a6b5a.js +0 -1
  41. package/dist/user-deposit-withdrawal/p-3eda2d99.entry.js +0 -1
  42. package/dist/user-deposit-withdrawal/user-deposit-withdrawal.esm.js +0 -1
  43. package/loader/cdn.js +0 -3
  44. package/loader/index.cjs.js +0 -3
  45. package/loader/index.d.ts +0 -12
  46. package/loader/index.es2017.js +0 -3
  47. package/loader/index.js +0 -4
  48. package/loader/package.json +0 -10
@@ -1,251 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
-
3
- const DEFAULT_LANGUAGE = 'en';
4
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr'];
5
- const TRANSLATIONS = {
6
- en: {
7
- Deposit: 'Deposit',
8
- Withdraw: 'Withdraw',
9
- },
10
- ro: {
11
- Deposit: 'Depozit',
12
- Withdraw: 'Retragere',
13
- },
14
- fr: {
15
- Deposit: 'Deposit',
16
- Withdraw: 'Withdraw',
17
- },
18
- hr: {
19
- Deposit: 'Letét',
20
- Withdraw: 'Visszavonás'
21
- }
22
- };
23
- const translate = (key, customLang) => {
24
- const lang = customLang;
25
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
26
- };
27
-
28
- /**
29
- * @name isMobile
30
- * @description A method that returns if the browser used to access the app is from a mobile device or not
31
- * @param {String} userAgent window.navigator.userAgent
32
- * @returns {Boolean} true or false
33
- */
34
- const isMobile = (userAgent) => {
35
- return !!(userAgent.toLowerCase().match(/android/i) ||
36
- userAgent.toLowerCase().match(/blackberry|bb/i) ||
37
- userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
38
- userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
39
- };
40
-
41
- const userDepositWithdrawalCss = ":host {\n font: inherit;\n display: block;\n height: 100%;\n overflow: hidden;\n}\n\n.MenuReturnButton {\n font: inherit;\n color: var(--emfe-w-color-gray-300, #58586B);\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n}\n.MenuReturnButton svg {\n fill: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n.MenuReturnButton h2.CategoryTitleMobile {\n font-size: 16px;\n color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\n}\n\n.DepositWithdrawalWrapper {\n width: 100%;\n padding: 0;\n margin: 0;\n height: 100vh;\n}\n\n@container (max-width: 475px) {\n .DepositWithdrawalWrapper {\n height: 100vh;\n }\n}";
42
-
43
- const emptyFunction = () => { };
44
- const UserDepositWithdrawal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
45
- constructor() {
46
- super();
47
- this.__registerHost();
48
- this.__attachShadow();
49
- /**
50
- * Client custom styling via inline style
51
- */
52
- this.clientStyling = '';
53
- /**
54
- * Client custom styling via url
55
- */
56
- this.clientStylingUrl = '';
57
- /*
58
- * Operator selected currency
59
- */
60
- this.currency = '';
61
- /*
62
- * Display bonus dropdown
63
- */
64
- this.showBonusSelectionInput = 'true';
65
- /*
66
- * State of deposit - short cashier enabled or not
67
- */
68
- this.isShortCashier = 'false';
69
- this.beforeRedirect = emptyFunction;
70
- this.limitStylingAppends = false;
71
- this.bindedHandler = this.handleMessage.bind(this);
72
- this.userAgent = window.navigator.userAgent;
73
- this.isMobile = isMobile(this.userAgent);
74
- this.setClientStyling = () => {
75
- let sheet = document.createElement('style');
76
- sheet.innerHTML = this.clientStyling;
77
- this.stylingContainer.prepend(sheet);
78
- };
79
- this.setClientStylingURL = () => {
80
- let url = new URL(this.clientStylingUrl);
81
- let cssFile = document.createElement('style');
82
- fetch(url.href)
83
- .then((res) => res.text())
84
- .then((data) => {
85
- cssFile.innerHTML = data;
86
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
87
- })
88
- .catch((err) => {
89
- console.log('error ', err);
90
- });
91
- };
92
- }
93
- get typeParameter() {
94
- if (this.type === 'deposit') {
95
- return 'Deposit';
96
- }
97
- if (this.type === 'withdraw') {
98
- return 'Withdraw';
99
- }
100
- }
101
- watchLoadWidget() {
102
- this.loadWidget();
103
- }
104
- async componentWillLoad() {
105
- await this.loadWidget();
106
- }
107
- toggleScreen(isMobile) {
108
- window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
109
- }
110
- componentDidLoad() {
111
- window.addEventListener('message', this.bindedHandler, false);
112
- }
113
- disconnectedCallback() {
114
- window.removeEventListener('message', this.bindedHandler, false);
115
- }
116
- componentDidRender() {
117
- // start custom styling area
118
- if (!this.limitStylingAppends && this.stylingContainer) {
119
- if (this.clientStyling)
120
- this.setClientStyling();
121
- if (this.clientStylingUrl)
122
- this.setClientStylingURL();
123
- this.limitStylingAppends = true;
124
- }
125
- // end custom styling area
126
- }
127
- render() {
128
- return (h(Host, null, h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "DepositWithdrawalWrapper", style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, h("div", null, (this.isMobile && !this.isShortCashier &&
129
- h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, h("defs", null), h("g", { transform: "translate(-20 -158)" }, h("g", { transform: "translate(20 158)" }, h("path", { class: "aaa", d: "M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z", transform: "translate(15 15) rotate(180)" })))), h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language))))), h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl })))));
130
- }
131
- async loadWidget() {
132
- const requestObject = {
133
- Channel: this.channel,
134
- Type: this.typeParameter,
135
- SuccessUrl: this.successUrl,
136
- CancelUrl: this.cancelUrl,
137
- FailUrl: this.failUrl,
138
- Language: this.language,
139
- productType: this.productType,
140
- isShortCashier: this.isShortCashier,
141
- currency: this.currency,
142
- showBonusSelectionInput: this.showBonusSelectionInput
143
- };
144
- try {
145
- const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
146
- const response = await fetch(url, {
147
- method: 'POST',
148
- headers: {
149
- 'X-Sessionid': this.session,
150
- 'Content-Type': 'application/json',
151
- },
152
- body: JSON.stringify(requestObject)
153
- });
154
- if (!response.ok) {
155
- const err = await response.text();
156
- throw new Error(err);
157
- }
158
- const data = await response.json();
159
- this.cashierInfoUrl = data.CashierInfo.Url;
160
- }
161
- catch (ex) {
162
- console.error(ex);
163
- }
164
- }
165
- handleMessage(message) {
166
- var _a, _b, _c, _d, _e, _f, _g;
167
- if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier === 'true') {
168
- this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
169
- }
170
- if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
171
- this.doRedirect(message.data.type, this.homeUrl);
172
- }
173
- if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
174
- this.doRedirect(message.data.redirect, this.homeUrl);
175
- }
176
- if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
177
- this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
178
- }
179
- if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
180
- this.doRedirect(window.location.href, this.casinoUrl);
181
- }
182
- if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
183
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
184
- this.doRedirect(window.location.href, this.contactUrl);
185
- }
186
- if (((_g = message.data) === null || _g === void 0 ? void 0 : _g.redirect) === 'mm-wm-hc-init-deposit') {
187
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
188
- this.doRedirect(window.location.href, this.depositUrl);
189
- }
190
- }
191
- doRedirect(reason, url) {
192
- const redirectArgs = { reason, url, cancel: false };
193
- this.beforeRedirect(redirectArgs);
194
- if (redirectArgs.cancel) {
195
- return;
196
- }
197
- if (!redirectArgs.url) {
198
- window.location.href = '/';
199
- return;
200
- }
201
- window.location.href = redirectArgs.url;
202
- }
203
- static get watchers() { return {
204
- "session": ["watchLoadWidget"],
205
- "userId": ["watchLoadWidget"],
206
- "isShortCashier": ["watchLoadWidget"]
207
- }; }
208
- static get style() { return userDepositWithdrawalCss; }
209
- }, [1, "user-deposit-withdrawal", {
210
- "clientStyling": [513, "client-styling"],
211
- "clientStylingUrl": [513, "client-styling-url"],
212
- "endpoint": [513],
213
- "type": [513],
214
- "channel": [513],
215
- "language": [513],
216
- "productType": [513, "product-type"],
217
- "userId": [513, "user-id"],
218
- "session": [513],
219
- "successUrl": [513, "success-url"],
220
- "cancelUrl": [513, "cancel-url"],
221
- "failUrl": [513, "fail-url"],
222
- "sportsUrl": [513, "sports-url"],
223
- "casinoUrl": [513, "casino-url"],
224
- "contactUrl": [513, "contact-url"],
225
- "depositUrl": [513, "deposit-url"],
226
- "currency": [513],
227
- "showBonusSelectionInput": [513, "show-bonus-selection-input"],
228
- "isShortCashier": [513, "is-short-cashier"],
229
- "homeUrl": [513, "home-url"],
230
- "beforeRedirect": [16],
231
- "limitStylingAppends": [32],
232
- "dynamicHeight": [32]
233
- }]);
234
- function defineCustomElement$1() {
235
- if (typeof customElements === "undefined") {
236
- return;
237
- }
238
- const components = ["user-deposit-withdrawal"];
239
- components.forEach(tagName => { switch (tagName) {
240
- case "user-deposit-withdrawal":
241
- if (!customElements.get(tagName)) {
242
- customElements.define(tagName, UserDepositWithdrawal$1);
243
- }
244
- break;
245
- } });
246
- }
247
-
248
- const UserDepositWithdrawal = UserDepositWithdrawal$1;
249
- const defineCustomElement = defineCustomElement$1;
250
-
251
- export { UserDepositWithdrawal, defineCustomElement };