@everymatrix/user-deposit-withdrawal 1.43.4 → 1.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-faa382a8.js +1265 -0
  3. package/dist/cjs/loader.cjs.js +7 -13
  4. package/dist/cjs/user-deposit-withdrawal.cjs.entry.js +226 -223
  5. package/dist/cjs/user-deposit-withdrawal.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/user-deposit-withdrawal/index.js +1 -0
  8. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.js +581 -578
  9. package/dist/collection/utils/locale.utils.js +38 -38
  10. package/dist/collection/utils/utils.js +17 -17
  11. package/dist/esm/app-globals-0f993ce5.js +3 -0
  12. package/dist/esm/index-04d3e726.js +1238 -0
  13. package/dist/esm/loader.js +7 -13
  14. package/dist/esm/user-deposit-withdrawal.entry.js +226 -223
  15. package/dist/esm/user-deposit-withdrawal.js +14 -11
  16. package/dist/stencil.config.dev.js +17 -0
  17. package/dist/stencil.config.js +14 -19
  18. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.d.ts +2 -0
  19. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.dev.d.ts +2 -0
  20. package/dist/types/components/user-deposit-withdrawal/index.d.ts +1 -0
  21. package/dist/types/components/user-deposit-withdrawal/user-deposit-withdrawal.d.ts +65 -65
  22. package/dist/types/components.d.ts +1 -0
  23. package/dist/types/stencil-public-runtime.d.ts +142 -33
  24. package/dist/user-deposit-withdrawal/p-53a8ad89.js +2 -0
  25. package/dist/user-deposit-withdrawal/p-96b03b5e.entry.js +1 -0
  26. package/dist/user-deposit-withdrawal/p-e1255160.js +1 -0
  27. package/dist/user-deposit-withdrawal/user-deposit-withdrawal.esm.js +1 -1
  28. package/loader/cdn.js +1 -3
  29. package/loader/index.cjs.js +1 -3
  30. package/loader/index.d.ts +13 -1
  31. package/loader/index.es2017.js +1 -3
  32. package/loader/index.js +1 -3
  33. package/loader/package.json +1 -0
  34. package/package.json +8 -1
  35. package/dist/cjs/index-efde0a55.js +0 -1264
  36. package/dist/components/index.d.ts +0 -26
  37. package/dist/components/index.js +0 -1
  38. package/dist/components/user-deposit-withdrawal.d.ts +0 -11
  39. package/dist/components/user-deposit-withdrawal.js +0 -304
  40. package/dist/esm/index-767966f2.js +0 -1238
  41. package/dist/esm/polyfills/core-js.js +0 -11
  42. package/dist/esm/polyfills/css-shim.js +0 -1
  43. package/dist/esm/polyfills/dom.js +0 -79
  44. package/dist/esm/polyfills/es5-html-element.js +0 -1
  45. package/dist/esm/polyfills/index.js +0 -34
  46. package/dist/esm/polyfills/system.js +0 -6
  47. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/user-deposit-withdrawal/.stencil/packages/user-deposit-withdrawal/stencil.config.d.ts +0 -2
  48. package/dist/user-deposit-withdrawal/p-4c4319e6.js +0 -1
  49. package/dist/user-deposit-withdrawal/p-518ce9fb.entry.js +0 -1
@@ -1,17 +1,11 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-767966f2.js';
1
+ import { b as bootstrapLazy } from './index-04d3e726.js';
2
+ export { s as setNonce } from './index-04d3e726.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
2
4
 
3
- /*
4
- Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
5
- */
6
- const patchEsm = () => {
7
- return promiseResolve();
8
- };
9
-
10
- const defineCustomElements = (win, options) => {
11
- if (typeof window === 'undefined') return Promise.resolve();
12
- return patchEsm().then(() => {
13
- return bootstrapLazy([["user-deposit-withdrawal",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]}]]]], options);
14
- });
5
+ const defineCustomElements = async (win, options) => {
6
+ if (typeof window === 'undefined') return undefined;
7
+ await globalScripts();
8
+ return bootstrapLazy([["user-deposit-withdrawal",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]},null,{"session":["watchLoadWidget"],"userId":["watchLoadWidget"],"isShortCashier":["watchLoadWidget"],"currency":["watchLoadWidget"],"showBonusSelectionInput":["watchLoadWidget"]}]]]], options);
15
9
  };
16
10
 
17
11
  export { defineCustomElements };
@@ -1,48 +1,48 @@
1
- import { r as registerInstance, h, H as Host } from './index-767966f2.js';
1
+ import { r as registerInstance, h, H as Host } from './index-04d3e726.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr'];
5
5
  const TRANSLATIONS = {
6
- en: {
7
- Deposit: 'Deposit',
8
- Withdraw: 'Withdraw',
9
- denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
10
- denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.',
11
- notFoundErrorCode: 'Not found error code',
12
- errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
13
- errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
14
- },
15
- ro: {
16
- Deposit: 'Depozit',
17
- Withdraw: 'Retragere',
18
- denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
19
- denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.',
20
- notFoundErrorCode: 'Not found error code',
21
- errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
22
- errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
23
- },
24
- fr: {
25
- Deposit: 'Deposit',
26
- Withdraw: 'Withdraw',
27
- denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
28
- denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.',
29
- notFoundErrorCode: 'Not found error code',
30
- errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
31
- errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
32
- },
33
- hr: {
34
- Deposit: 'Uplata',
35
- Withdraw: 'Isplata',
36
- denyDeposit: 'Obavještavamo Vas da trenutno nemate mogućnost uplata.',
37
- denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.',
38
- notFoundErrorCode: 'Not found error code',
39
- errorCode21122: 'Poštovani, trenutno nije moguće izvršiti isplatu sa Vašeg računa. Error Code: 21122',
40
- errorCode21123: 'Poštovani, trenutno nije moguće izvršiti uplatu na Vaš račun. Error Code:21123'
41
- }
6
+ en: {
7
+ Deposit: 'Deposit',
8
+ Withdraw: 'Withdraw',
9
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
10
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.',
11
+ notFoundErrorCode: 'Not found error code',
12
+ errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
13
+ errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
14
+ },
15
+ ro: {
16
+ Deposit: 'Depozit',
17
+ Withdraw: 'Retragere',
18
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
19
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.',
20
+ notFoundErrorCode: 'Not found error code',
21
+ errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
22
+ errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
23
+ },
24
+ fr: {
25
+ Deposit: 'Deposit',
26
+ Withdraw: 'Withdraw',
27
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
28
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.',
29
+ notFoundErrorCode: 'Not found error code',
30
+ errorCode21122: 'Dear player! Please be informed that currently you are not allowed to initiate withdrawal transaction from your player account. Error Code: 21122',
31
+ errorCode21123: 'Dear player! Please be informed that currently you are not allowed to make a deposit to your player account. Error Code:21123'
32
+ },
33
+ hr: {
34
+ Deposit: 'Uplata',
35
+ Withdraw: 'Isplata',
36
+ denyDeposit: 'Obavještavamo Vas da trenutno nemate mogućnost uplata.',
37
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.',
38
+ notFoundErrorCode: 'Not found error code',
39
+ errorCode21122: 'Poštovani, trenutno nije moguće izvršiti isplatu sa Vašeg računa. Error Code: 21122',
40
+ errorCode21123: 'Poštovani, trenutno nije moguće izvršiti uplatu na Vaš račun. Error Code:21123'
41
+ }
42
42
  };
43
43
  const translate = (key, customLang) => {
44
- const lang = customLang;
45
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
44
+ const lang = customLang;
45
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
46
46
  };
47
47
 
48
48
  /**
@@ -52,210 +52,213 @@ const translate = (key, customLang) => {
52
52
  * @returns {Boolean} true or false
53
53
  */
54
54
  const isMobile = (userAgent) => {
55
- return !!(userAgent.toLowerCase().match(/android/i) ||
56
- userAgent.toLowerCase().match(/blackberry|bb/i) ||
57
- userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
58
- userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
55
+ return !!(userAgent.toLowerCase().match(/android/i) ||
56
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
57
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
58
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
59
59
  };
60
60
 
61
61
  const userDepositWithdrawalCss = ":host {\n font: inherit;\n display: block;\n height: 100%;\n overflow: hidden;\n}\n\n.CategoryTitle {\n font-size: var(--emw--font-size-x-large, 26px);\n color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));\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.ErrorMessage {\n color: var(--emfe-w-pam-color-typography, var(--emfe-w-color-typography, #FFFFFF));\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}\n.ShortCashier.DepositWithdrawalWrapper {\n height: 500px;\n}\n.ShortCashier.CategoryTitle.CategoryTitle {\n margin-right: 20px;\n padding-top: 20px;\n color: ar(--emfe-w-color-black, #000000);\n}\n.ShortCashier .ErrorMessage {\n margin: auto;\n width: 90%;\n margin-top: 70px;\n text-align: center;\n color: var(--emfe-w-color-black, #000000);\n}";
62
+ const UserDepositWithdrawalStyle0 = userDepositWithdrawalCss;
62
63
 
63
64
  const emptyFunction = () => { };
64
65
  const UserDepositWithdrawal = class {
65
- constructor(hostRef) {
66
- registerInstance(this, hostRef);
67
- /**
68
- * Client custom styling via inline style
69
- */
70
- this.clientStyling = '';
71
- /**
72
- * Client custom styling via url
73
- */
74
- this.clientStylingUrl = '';
75
- /*
76
- * Operator selected currency
77
- */
78
- this.currency = '';
79
- /*
80
- * Display bonus dropdown
81
- */
82
- this.showBonusSelectionInput = 'true';
83
- /*
84
- * State of deposit - short cashier enabled or not
85
- */
86
- this.isShortCashier = false;
87
- this.beforeRedirect = emptyFunction;
88
- this.limitStylingAppends = false;
89
- this.bindedHandler = this.handleMessage.bind(this);
90
- this.userAgent = window.navigator.userAgent;
91
- this.isMobile = isMobile(this.userAgent);
92
- this.errorCodes = ["21123", "21122"];
93
- this.setClientStyling = () => {
94
- let sheet = document.createElement('style');
95
- sheet.innerHTML = this.clientStyling;
96
- this.stylingContainer.prepend(sheet);
97
- };
98
- this.setClientStylingURL = () => {
99
- let url = new URL(this.clientStylingUrl);
100
- let cssFile = document.createElement('style');
101
- fetch(url.href)
102
- .then((res) => res.text())
103
- .then((data) => {
104
- cssFile.innerHTML = data;
105
- setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
106
- })
107
- .catch((err) => {
108
- console.log('error ', err);
109
- });
110
- };
111
- }
112
- get typeParameter() {
113
- if (this.type === 'deposit') {
114
- return 'Deposit';
115
- }
116
- if (this.type === 'withdraw') {
117
- return 'Withdraw';
118
- }
119
- }
120
- watchLoadWidget() {
121
- this.loadWidget();
122
- }
123
- async componentWillLoad() {
124
- await this.loadWidget();
125
- }
126
- toggleScreen(isMobile) {
127
- window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
128
- }
129
- componentDidLoad() {
130
- window.addEventListener('message', this.bindedHandler, false);
131
- }
132
- disconnectedCallback() {
133
- window.removeEventListener('message', this.bindedHandler, false);
134
- }
135
- componentDidRender() {
136
- // start custom styling area
137
- if (!this.limitStylingAppends && this.stylingContainer) {
138
- if (this.clientStyling)
139
- this.setClientStyling();
140
- if (this.clientStylingUrl)
141
- this.setClientStylingURL();
142
- this.limitStylingAppends = true;
66
+ constructor(hostRef) {
67
+ registerInstance(this, hostRef);
68
+ this.bindedHandler = this.handleMessage.bind(this);
69
+ this.userAgent = window.navigator.userAgent;
70
+ this.isMobile = isMobile(this.userAgent);
71
+ this.errorCodes = ["21123", "21122"];
72
+ this.setClientStyling = () => {
73
+ let sheet = document.createElement('style');
74
+ sheet.innerHTML = this.clientStyling;
75
+ this.stylingContainer.prepend(sheet);
76
+ };
77
+ this.setClientStylingURL = () => {
78
+ let url = new URL(this.clientStylingUrl);
79
+ let cssFile = document.createElement('style');
80
+ fetch(url.href)
81
+ .then((res) => res.text())
82
+ .then((data) => {
83
+ cssFile.innerHTML = data;
84
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
85
+ })
86
+ .catch((err) => {
87
+ console.log('error ', err);
88
+ });
89
+ };
90
+ this.clientStyling = '';
91
+ this.clientStylingUrl = '';
92
+ this.endpoint = undefined;
93
+ this.type = undefined;
94
+ this.channel = undefined;
95
+ this.language = undefined;
96
+ this.productType = undefined;
97
+ this.userId = undefined;
98
+ this.session = undefined;
99
+ this.successUrl = undefined;
100
+ this.cancelUrl = undefined;
101
+ this.failUrl = undefined;
102
+ this.sportsUrl = undefined;
103
+ this.casinoUrl = undefined;
104
+ this.contactUrl = undefined;
105
+ this.depositUrl = undefined;
106
+ this.currency = '';
107
+ this.showBonusSelectionInput = 'true';
108
+ this.isShortCashier = false;
109
+ this.homeUrl = undefined;
110
+ this.beforeRedirect = emptyFunction;
111
+ this.limitStylingAppends = false;
112
+ this.dynamicHeight = undefined;
113
+ this.cashierInfoUrl = undefined;
143
114
  }
144
- // end custom styling area
145
- }
146
- render() {
147
- return (h(Host, null, h("div", { ref: el => this.stylingContainer = el }, (!(this.isMobile && !this.isShortCashier) && (h("h2", { class: "CategoryTitle" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))), h("div", { class: `DepositWithdrawalWrapper ${this.isShortCashier ? 'ShortCashier' : ''}`, style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, h("div", null, (this.isMobile && !this.isShortCashier ?
148
- 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)))
149
- : null)), this.cashierInfoUrl ? h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : h("h3", { class: "ErrorMessage" }, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
150
- }
151
- async loadWidget() {
152
- const requestObject = {
153
- Channel: this.channel,
154
- Type: this.typeParameter,
155
- SuccessUrl: this.successUrl,
156
- CancelUrl: this.cancelUrl,
157
- FailUrl: this.failUrl,
158
- Language: this.language,
159
- productType: this.productType,
160
- isShortCashier: this.isShortCashier,
161
- currency: this.currency,
162
- showBonusSelectionInput: this.showBonusSelectionInput
163
- };
164
- try {
165
- const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
166
- const response = await fetch(url, {
167
- method: 'POST',
168
- headers: {
169
- 'X-Sessionid': this.session,
170
- 'Content-Type': 'application/json',
171
- },
172
- body: JSON.stringify(requestObject)
173
- });
174
- if (!response.ok) {
175
- const err = await response.text();
176
- throw new Error(err);
177
- }
178
- const data = await response.json();
179
- if (data.CashierInfo) {
180
- this.cashierInfoUrl = data.CashierInfo.Url;
181
- }
182
- else {
183
- let apiMessage;
184
- if (data.ResponseMessage) {
185
- let foundErrorCode = this.errorCodes.find(code => data.ResponseMessage.includes(code)) || null;
186
- if (foundErrorCode) {
187
- apiMessage = translate(`errorCode${foundErrorCode}`, this.language);
188
- }
189
- else {
190
- apiMessage = translate('notFoundErrorCode', this.language);
191
- }
115
+ get typeParameter() {
116
+ if (this.type === 'deposit') {
117
+ return 'Deposit';
192
118
  }
193
- else {
194
- apiMessage = this.type === 'deposit'
195
- ? translate('denyDeposit', this.language)
196
- : translate('denyWithdrawal', this.language);
119
+ if (this.type === 'withdraw') {
120
+ return 'Withdraw';
197
121
  }
198
- const messageOBj = { type: 'error', message: apiMessage };
199
- window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
200
- }
201
- }
202
- catch (ex) {
203
- console.error(ex);
204
- }
205
- }
206
- handleMessage(message) {
207
- var _a, _b, _c, _d, _e, _f, _g, _h;
208
- if (message.data['MMFE:openFullCashier'] === 'true') {
209
- window.postMessage({ type: 'GoToDeposit' }, window.location.href);
210
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
211
122
  }
212
- if (message.data["MMFE:setQuickDepositHeight"] && this.isShortCashier) {
213
- this.dynamicHeight = message.data["MMFE:setQuickDepositHeight"].toString() + 'px';
123
+ watchLoadWidget() {
124
+ this.loadWidget();
214
125
  }
215
- if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier) {
216
- this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
126
+ async componentWillLoad() {
127
+ await this.loadWidget();
217
128
  }
218
- if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
219
- this.doRedirect(message.data.type, this.homeUrl);
129
+ toggleScreen(isMobile) {
130
+ window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
220
131
  }
221
- if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
222
- this.doRedirect(message.data.redirect, this.homeUrl);
132
+ componentDidLoad() {
133
+ window.addEventListener('message', this.bindedHandler, false);
223
134
  }
224
- if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
225
- this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
135
+ disconnectedCallback() {
136
+ window.removeEventListener('message', this.bindedHandler, false);
226
137
  }
227
- if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
228
- this.doRedirect(window.location.href, this.casinoUrl);
138
+ componentDidRender() {
139
+ // start custom styling area
140
+ if (!this.limitStylingAppends && this.stylingContainer) {
141
+ if (this.clientStyling)
142
+ this.setClientStyling();
143
+ if (this.clientStylingUrl)
144
+ this.setClientStylingURL();
145
+ this.limitStylingAppends = true;
146
+ }
147
+ // end custom styling area
229
148
  }
230
- if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
231
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
232
- this.doRedirect(window.location.href, this.contactUrl);
149
+ render() {
150
+ return (h(Host, { key: 'ccdd9243da65080f4ac854a4bc6ed4006f0c9f5e' }, h("div", { key: 'e39b500a56740d0f7e23f92e2f73ea386a3bbb5c', ref: el => this.stylingContainer = el }, (!(this.isMobile && !this.isShortCashier) && (h("h2", { key: '3e2e8bf8a07a4249674f4dae7df7a76da6435fa3', class: "CategoryTitle" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))), h("div", { key: '886bedf58fac20d2f620d4600b6588089d0e502c', class: `DepositWithdrawalWrapper ${this.isShortCashier ? 'ShortCashier' : ''}`, style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, h("div", { key: 'fa038bb3d599cbd894ba6a14ead4c03bbfa425fd' }, (this.isMobile && !this.isShortCashier ?
151
+ 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)))
152
+ : null)), this.cashierInfoUrl ? h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : h("h3", { class: "ErrorMessage" }, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
233
153
  }
234
- if (((_g = message.data) === null || _g === void 0 ? void 0 : _g.redirect) === 'mm-wm-hc-init-deposit' || ((_h = message.data) === null || _h === void 0 ? void 0 : _h.redirect) === 'mm-wm-hc-init-deposit-quick') {
235
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
236
- this.doRedirect(window.location.href, this.depositUrl);
154
+ async loadWidget() {
155
+ const requestObject = {
156
+ Channel: this.channel,
157
+ Type: this.typeParameter,
158
+ SuccessUrl: this.successUrl,
159
+ CancelUrl: this.cancelUrl,
160
+ FailUrl: this.failUrl,
161
+ Language: this.language,
162
+ productType: this.productType,
163
+ isShortCashier: this.isShortCashier,
164
+ currency: this.currency,
165
+ showBonusSelectionInput: this.showBonusSelectionInput
166
+ };
167
+ try {
168
+ const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
169
+ const response = await fetch(url, {
170
+ method: 'POST',
171
+ headers: {
172
+ 'X-Sessionid': this.session,
173
+ 'Content-Type': 'application/json',
174
+ },
175
+ body: JSON.stringify(requestObject)
176
+ });
177
+ if (!response.ok) {
178
+ const err = await response.text();
179
+ throw new Error(err);
180
+ }
181
+ const data = await response.json();
182
+ if (data.CashierInfo) {
183
+ this.cashierInfoUrl = data.CashierInfo.Url;
184
+ }
185
+ else {
186
+ let apiMessage;
187
+ if (data.ResponseMessage) {
188
+ let foundErrorCode = this.errorCodes.find(code => data.ResponseMessage.includes(code)) || null;
189
+ if (foundErrorCode) {
190
+ apiMessage = translate(`errorCode${foundErrorCode}`, this.language);
191
+ }
192
+ else {
193
+ apiMessage = translate('notFoundErrorCode', this.language);
194
+ }
195
+ }
196
+ else {
197
+ apiMessage = this.type === 'deposit'
198
+ ? translate('denyDeposit', this.language)
199
+ : translate('denyWithdrawal', this.language);
200
+ }
201
+ const messageOBj = { type: 'error', message: apiMessage };
202
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
203
+ }
204
+ }
205
+ catch (ex) {
206
+ console.error(ex);
207
+ }
237
208
  }
238
- }
239
- doRedirect(reason, url) {
240
- const redirectArgs = { reason, url, cancel: false };
241
- this.beforeRedirect(redirectArgs);
242
- if (redirectArgs.cancel) {
243
- return;
209
+ handleMessage(message) {
210
+ var _a, _b, _c, _d, _e, _f, _g, _h;
211
+ if (message.data['MMFE:openFullCashier'] === 'true') {
212
+ window.postMessage({ type: 'GoToDeposit' }, window.location.href);
213
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
214
+ }
215
+ if (message.data["MMFE:setQuickDepositHeight"] && this.isShortCashier) {
216
+ this.dynamicHeight = message.data["MMFE:setQuickDepositHeight"].toString() + 'px';
217
+ }
218
+ if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier) {
219
+ this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
220
+ }
221
+ if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
222
+ this.doRedirect(message.data.type, this.homeUrl);
223
+ }
224
+ if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
225
+ this.doRedirect(message.data.redirect, this.homeUrl);
226
+ }
227
+ if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
228
+ this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
229
+ }
230
+ if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
231
+ this.doRedirect(window.location.href, this.casinoUrl);
232
+ }
233
+ if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
234
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
235
+ this.doRedirect(window.location.href, this.contactUrl);
236
+ }
237
+ if (((_g = message.data) === null || _g === void 0 ? void 0 : _g.redirect) === 'mm-wm-hc-init-deposit' || ((_h = message.data) === null || _h === void 0 ? void 0 : _h.redirect) === 'mm-wm-hc-init-deposit-quick') {
238
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
239
+ this.doRedirect(window.location.href, this.depositUrl);
240
+ }
244
241
  }
245
- if (!redirectArgs.url) {
246
- window.location.href = '/';
247
- return;
242
+ doRedirect(reason, url) {
243
+ const redirectArgs = { reason, url, cancel: false };
244
+ this.beforeRedirect(redirectArgs);
245
+ if (redirectArgs.cancel) {
246
+ return;
247
+ }
248
+ if (!redirectArgs.url) {
249
+ window.location.href = '/';
250
+ return;
251
+ }
252
+ window.location.href = redirectArgs.url;
248
253
  }
249
- window.location.href = redirectArgs.url;
250
- }
251
- static get watchers() { return {
252
- "session": ["watchLoadWidget"],
253
- "userId": ["watchLoadWidget"],
254
- "isShortCashier": ["watchLoadWidget"],
255
- "currency": ["watchLoadWidget"],
256
- "showBonusSelectionInput": ["watchLoadWidget"]
257
- }; }
254
+ static get watchers() { return {
255
+ "session": ["watchLoadWidget"],
256
+ "userId": ["watchLoadWidget"],
257
+ "isShortCashier": ["watchLoadWidget"],
258
+ "currency": ["watchLoadWidget"],
259
+ "showBonusSelectionInput": ["watchLoadWidget"]
260
+ }; }
258
261
  };
259
- UserDepositWithdrawal.style = userDepositWithdrawalCss;
262
+ UserDepositWithdrawal.style = UserDepositWithdrawalStyle0;
260
263
 
261
264
  export { UserDepositWithdrawal as user_deposit_withdrawal };
@@ -1,17 +1,20 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-767966f2.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-04d3e726.js';
2
+ export { s as setNonce } from './index-04d3e726.js';
3
+ import { g as globalScripts } from './app-globals-0f993ce5.js';
2
4
 
3
5
  /*
4
- Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
5
7
  */
6
- const patchBrowser = () => {
7
- const importMeta = import.meta.url;
8
- const opts = {};
9
- if (importMeta !== '') {
10
- opts.resourcesUrl = new URL('.', importMeta).href;
11
- }
12
- return promiseResolve(opts);
8
+ var patchBrowser = () => {
9
+ const importMeta = import.meta.url;
10
+ const opts = {};
11
+ if (importMeta !== "") {
12
+ opts.resourcesUrl = new URL(".", importMeta).href;
13
+ }
14
+ return promiseResolve(opts);
13
15
  };
14
16
 
15
- patchBrowser().then(options => {
16
- return bootstrapLazy([["user-deposit-withdrawal",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]}]]]], options);
17
+ patchBrowser().then(async (options) => {
18
+ await globalScripts();
19
+ return bootstrapLazy([["user-deposit-withdrawal",[[1,"user-deposit-withdrawal",{"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endpoint":[513],"type":[513],"channel":[513],"language":[513],"productType":[513,"product-type"],"userId":[513,"user-id"],"session":[513],"successUrl":[513,"success-url"],"cancelUrl":[513,"cancel-url"],"failUrl":[513,"fail-url"],"sportsUrl":[513,"sports-url"],"casinoUrl":[513,"casino-url"],"contactUrl":[513,"contact-url"],"depositUrl":[513,"deposit-url"],"currency":[513],"showBonusSelectionInput":[513,"show-bonus-selection-input"],"isShortCashier":[516,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32],"cashierInfoUrl":[32]},null,{"session":["watchLoadWidget"],"userId":["watchLoadWidget"],"isShortCashier":["watchLoadWidget"],"currency":["watchLoadWidget"],"showBonusSelectionInput":["watchLoadWidget"]}]]]], options);
17
20
  });
@@ -0,0 +1,17 @@
1
+ import { sass } from "@stencil/sass";
2
+ export const config = {
3
+ namespace: 'user-deposit-withdrawal',
4
+ taskQueue: 'async',
5
+ sourceMap: true,
6
+ minifyJs: false,
7
+ extras: {
8
+ experimentalImportInjection: true
9
+ },
10
+ plugins: [sass()],
11
+ outputTargets: [
12
+ {
13
+ type: 'www',
14
+ serviceWorker: null // disable service workers
15
+ }
16
+ ]
17
+ };
@@ -1,22 +1,17 @@
1
- import { sass } from '@stencil/sass';
1
+ import { sass } from "@stencil/sass";
2
2
  export const config = {
3
- namespace: 'user-deposit-withdrawal',
4
- taskQueue: 'async',
5
- plugins: [sass()],
6
- outputTargets: [
7
- {
8
- type: 'dist',
9
- esmLoaderPath: '../loader',
3
+ namespace: 'user-deposit-withdrawal',
4
+ taskQueue: 'async',
5
+ sourceMap: false,
6
+ minifyJs: true,
7
+ extras: {
8
+ experimentalImportInjection: true
10
9
  },
11
- {
12
- type: 'dist-custom-elements',
13
- },
14
- {
15
- type: 'docs-readme',
16
- },
17
- {
18
- type: 'www',
19
- serviceWorker: null, // disable service workers
20
- },
21
- ],
10
+ plugins: [sass()],
11
+ outputTargets: [
12
+ {
13
+ type: 'dist',
14
+ esmLoaderPath: '../loader'
15
+ }
16
+ ]
22
17
  };
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1,2 @@
1
+ import { Config } from '../../../../../../../../../../../../stencil-public-runtime';
2
+ export declare const config: Config;
@@ -0,0 +1 @@
1
+ export { UserDepositWithdrawal } from './user-deposit-withdrawal';