@everymatrix/user-deposit-withdrawal 1.0.69

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 (44) 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/index.cjs.js +2 -0
  4. package/dist/cjs/loader.cjs.js +15 -0
  5. package/dist/cjs/user-deposit-withdrawal.cjs.entry.js +256 -0
  6. package/dist/cjs/user-deposit-withdrawal.cjs.js +25 -0
  7. package/dist/collection/collection-manifest.json +12 -0
  8. package/dist/collection/components/user-deposit-withdrawal/index.js +1 -0
  9. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.css +35 -0
  10. package/dist/collection/components/user-deposit-withdrawal/user-deposit-withdrawal.js +601 -0
  11. package/dist/collection/index.js +1 -0
  12. package/dist/collection/utils/locale.utils.js +32 -0
  13. package/dist/collection/utils/utils.js +29 -0
  14. package/dist/esm/app-globals-0f993ce5.js +3 -0
  15. package/dist/esm/index-04d3e726.js +1238 -0
  16. package/dist/esm/index.js +1 -0
  17. package/dist/esm/loader.js +11 -0
  18. package/dist/esm/user-deposit-withdrawal.entry.js +252 -0
  19. package/dist/esm/user-deposit-withdrawal.js +20 -0
  20. package/dist/index.cjs.js +1 -0
  21. package/dist/index.js +1 -0
  22. package/dist/stencil.config.dev.js +17 -0
  23. package/dist/stencil.config.js +17 -0
  24. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.d.ts +2 -0
  25. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/user-deposit-withdrawal/.stencil/packages/stencil/user-deposit-withdrawal/stencil.config.dev.d.ts +2 -0
  26. package/dist/types/components/user-deposit-withdrawal/index.d.ts +1 -0
  27. package/dist/types/components/user-deposit-withdrawal/user-deposit-withdrawal.d.ts +75 -0
  28. package/dist/types/components.d.ts +99 -0
  29. package/dist/types/index.d.ts +1 -0
  30. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  31. package/dist/types/utils/locale.utils.d.ts +1 -0
  32. package/dist/types/utils/utils.d.ts +8 -0
  33. package/dist/user-deposit-withdrawal/index.esm.js +0 -0
  34. package/dist/user-deposit-withdrawal/p-53a8ad89.js +2 -0
  35. package/dist/user-deposit-withdrawal/p-83b68346.entry.js +1 -0
  36. package/dist/user-deposit-withdrawal/p-e1255160.js +1 -0
  37. package/dist/user-deposit-withdrawal/user-deposit-withdrawal.esm.js +1 -0
  38. package/loader/cdn.js +1 -0
  39. package/loader/index.cjs.js +1 -0
  40. package/loader/index.d.ts +24 -0
  41. package/loader/index.es2017.js +1 -0
  42. package/loader/index.js +2 -0
  43. package/loader/package.json +11 -0
  44. package/package.json +26 -0
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-faa382a8.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ const defineCustomElements = async (win, options) => {
9
+ if (typeof window === 'undefined') return undefined;
10
+ await appGlobals.globalScripts();
11
+ return index.bootstrapLazy([["user-deposit-withdrawal.cjs",[[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);
12
+ };
13
+
14
+ exports.setNonce = index.setNonce;
15
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,256 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-faa382a8.js');
6
+
7
+ const DEFAULT_LANGUAGE = 'en';
8
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'hr'];
9
+ const TRANSLATIONS = {
10
+ en: {
11
+ Deposit: 'Deposit',
12
+ Withdraw: 'Withdraw',
13
+ denyDeposit: 'Please be informed that currently you are not allowed to initiate depost transactions.',
14
+ denyWithdrawal: 'Please be informed that currently you are not allowed to initiate withdrawal transactions.'
15
+ },
16
+ ro: {
17
+ Deposit: 'Depozit',
18
+ Withdraw: 'Retragere',
19
+ denyDeposit: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de depunere.',
20
+ denyWithdrawal: 'Vă informăm că în prezent nu aveți permisiunea de a iniția tranzacții de retragere.'
21
+ },
22
+ fr: {
23
+ Deposit: 'Deposit',
24
+ Withdraw: 'Withdraw',
25
+ denyDeposit: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de dépôt.',
26
+ denyWithdrawal: 'Veuillez être informé que vous n\'êtes actuellement pas autorisé à initier des transactions de retrait.'
27
+ },
28
+ hr: {
29
+ Deposit: 'Letét',
30
+ Withdraw: 'Visszavonás',
31
+ denyDeposit: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija pologa.',
32
+ denyWithdrawal: 'Obavještavamo vas da trenutno niste ovlašteni za pokretanje transakcija isplate.'
33
+ }
34
+ };
35
+ const translate = (key, customLang) => {
36
+ const lang = customLang;
37
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
38
+ };
39
+
40
+ /**
41
+ * @name isMobile
42
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
43
+ * @param {String} userAgent window.navigator.userAgent
44
+ * @returns {Boolean} true or false
45
+ */
46
+ const isMobile = (userAgent) => {
47
+ return !!(userAgent.toLowerCase().match(/android/i) ||
48
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
49
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
50
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
51
+ };
52
+
53
+ 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}";
54
+ const UserDepositWithdrawalStyle0 = userDepositWithdrawalCss;
55
+
56
+ const emptyFunction = () => { };
57
+ const UserDepositWithdrawal = class {
58
+ constructor(hostRef) {
59
+ index.registerInstance(this, hostRef);
60
+ this.bindedHandler = this.handleMessage.bind(this);
61
+ this.userAgent = window.navigator.userAgent;
62
+ this.isMobile = isMobile(this.userAgent);
63
+ this.errorCodes = ["21123", "21122"];
64
+ this.setClientStyling = () => {
65
+ let sheet = document.createElement('style');
66
+ sheet.innerHTML = this.clientStyling;
67
+ this.stylingContainer.prepend(sheet);
68
+ };
69
+ this.setClientStylingURL = () => {
70
+ let url = new URL(this.clientStylingUrl);
71
+ let cssFile = document.createElement('style');
72
+ fetch(url.href)
73
+ .then((res) => res.text())
74
+ .then((data) => {
75
+ cssFile.innerHTML = data;
76
+ setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
77
+ })
78
+ .catch((err) => {
79
+ console.log('error ', err);
80
+ });
81
+ };
82
+ this.clientStyling = '';
83
+ this.clientStylingUrl = '';
84
+ this.endpoint = undefined;
85
+ this.type = undefined;
86
+ this.channel = undefined;
87
+ this.language = undefined;
88
+ this.productType = undefined;
89
+ this.userId = undefined;
90
+ this.session = undefined;
91
+ this.successUrl = undefined;
92
+ this.cancelUrl = undefined;
93
+ this.failUrl = undefined;
94
+ this.sportsUrl = undefined;
95
+ this.casinoUrl = undefined;
96
+ this.contactUrl = undefined;
97
+ this.depositUrl = undefined;
98
+ this.currency = '';
99
+ this.showBonusSelectionInput = 'true';
100
+ this.isShortCashier = false;
101
+ this.homeUrl = undefined;
102
+ this.beforeRedirect = emptyFunction;
103
+ this.limitStylingAppends = false;
104
+ this.dynamicHeight = undefined;
105
+ this.cashierInfoUrl = undefined;
106
+ }
107
+ get typeParameter() {
108
+ if (this.type === 'deposit') {
109
+ return 'Deposit';
110
+ }
111
+ if (this.type === 'withdraw') {
112
+ return 'Withdraw';
113
+ }
114
+ }
115
+ watchLoadWidget() {
116
+ this.loadWidget();
117
+ }
118
+ async componentWillLoad() {
119
+ await this.loadWidget();
120
+ }
121
+ toggleScreen(isMobile) {
122
+ window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
123
+ }
124
+ componentDidLoad() {
125
+ window.addEventListener('message', this.bindedHandler, false);
126
+ }
127
+ disconnectedCallback() {
128
+ window.removeEventListener('message', this.bindedHandler, false);
129
+ }
130
+ componentDidRender() {
131
+ // start custom styling area
132
+ if (!this.limitStylingAppends && this.stylingContainer) {
133
+ if (this.clientStyling)
134
+ this.setClientStyling();
135
+ if (this.clientStylingUrl)
136
+ this.setClientStylingURL();
137
+ this.limitStylingAppends = true;
138
+ }
139
+ // end custom styling area
140
+ }
141
+ render() {
142
+ return (index.h(index.Host, { key: 'ccdd9243da65080f4ac854a4bc6ed4006f0c9f5e' }, index.h("div", { key: 'e39b500a56740d0f7e23f92e2f73ea386a3bbb5c', ref: el => this.stylingContainer = el }, (!(this.isMobile && !this.isShortCashier) && (index.h("h2", { key: '3e2e8bf8a07a4249674f4dae7df7a76da6435fa3', class: "CategoryTitle" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))), index.h("div", { key: '886bedf58fac20d2f620d4600b6588089d0e502c', class: `DepositWithdrawalWrapper ${this.isShortCashier ? 'ShortCashier' : ''}`, style: { height: this.dynamicHeight, marginTop: this.isShortCashier ? '30px' : '0' } }, index.h("div", { key: 'fa038bb3d599cbd894ba6a14ead4c03bbfa425fd' }, (this.isMobile && !this.isShortCashier ?
143
+ index.h("div", { class: "MenuReturnButton", onClick: () => this.toggleScreen(this.isMobile) }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, index.h("defs", null), index.h("g", { transform: "translate(-20 -158)" }, index.h("g", { transform: "translate(20 158)" }, index.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)" })))), index.h("h2", { class: "CategoryTitleMobile" }, translate(this.typeParameter === 'Withdraw' ? 'Withdraw' : 'Deposit', this.language)))
144
+ : null)), this.cashierInfoUrl ? index.h("iframe", { width: "100%", height: "100%", src: this.cashierInfoUrl }) : index.h("h3", { class: "ErrorMessage" }, this.type === 'deposit' ? translate('denyDeposit', this.language) : translate('denyWithdrawal', this.language))))));
145
+ }
146
+ async loadWidget() {
147
+ const requestObject = {
148
+ Channel: this.channel,
149
+ Type: this.typeParameter,
150
+ SuccessUrl: this.successUrl,
151
+ CancelUrl: this.cancelUrl,
152
+ FailUrl: this.failUrl,
153
+ Language: this.language,
154
+ productType: this.productType,
155
+ isShortCashier: this.isShortCashier,
156
+ currency: this.currency,
157
+ showBonusSelectionInput: this.showBonusSelectionInput
158
+ };
159
+ try {
160
+ const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
161
+ const response = await fetch(url, {
162
+ method: 'POST',
163
+ headers: {
164
+ 'X-Sessionid': this.session,
165
+ 'Content-Type': 'application/json',
166
+ },
167
+ body: JSON.stringify(requestObject)
168
+ });
169
+ if (!response.ok) {
170
+ const err = await response.text();
171
+ throw new Error(err);
172
+ }
173
+ const data = await response.json();
174
+ if (data.CashierInfo) {
175
+ this.cashierInfoUrl = data.CashierInfo.Url;
176
+ }
177
+ else {
178
+ let apiMessage;
179
+ if (data.ResponseMessage) {
180
+ let foundErrorCode = this.errorCodes.find(code => data.ResponseMessage.includes(code)) || null;
181
+ if (foundErrorCode) {
182
+ apiMessage = translate(`errorCode${foundErrorCode}`, this.language);
183
+ }
184
+ else {
185
+ apiMessage = translate('notFoundErrorCode', this.language);
186
+ }
187
+ }
188
+ else {
189
+ apiMessage = this.type === 'deposit'
190
+ ? translate('denyDeposit', this.language)
191
+ : translate('denyWithdrawal', this.language);
192
+ }
193
+ const messageOBj = { type: 'error', message: apiMessage };
194
+ window.postMessage({ type: 'DenyDepositOrWithdrawal', data: messageOBj }, window.location.href);
195
+ }
196
+ }
197
+ catch (ex) {
198
+ console.error(ex);
199
+ }
200
+ }
201
+ handleMessage(message) {
202
+ var _a, _b, _c, _d, _e, _f, _g, _h;
203
+ if (message.data['MMFE:openFullCashier'] === 'true') {
204
+ window.postMessage({ type: 'GoToDeposit' }, window.location.href);
205
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
206
+ }
207
+ if (message.data["MMFE:setQuickDepositHeight"] && this.isShortCashier) {
208
+ this.dynamicHeight = message.data["MMFE:setQuickDepositHeight"].toString() + 'px';
209
+ }
210
+ if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier) {
211
+ this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
212
+ }
213
+ if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
214
+ this.doRedirect(message.data.type, this.homeUrl);
215
+ }
216
+ if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
217
+ this.doRedirect(message.data.redirect, this.homeUrl);
218
+ }
219
+ if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
220
+ this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
221
+ }
222
+ if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
223
+ this.doRedirect(window.location.href, this.casinoUrl);
224
+ }
225
+ if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
226
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
227
+ this.doRedirect(window.location.href, this.contactUrl);
228
+ }
229
+ 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') {
230
+ window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
231
+ this.doRedirect(window.location.href, this.depositUrl);
232
+ }
233
+ }
234
+ doRedirect(reason, url) {
235
+ const redirectArgs = { reason, url, cancel: false };
236
+ this.beforeRedirect(redirectArgs);
237
+ if (redirectArgs.cancel) {
238
+ return;
239
+ }
240
+ if (!redirectArgs.url) {
241
+ window.location.href = '/';
242
+ return;
243
+ }
244
+ window.location.href = redirectArgs.url;
245
+ }
246
+ static get watchers() { return {
247
+ "session": ["watchLoadWidget"],
248
+ "userId": ["watchLoadWidget"],
249
+ "isShortCashier": ["watchLoadWidget"],
250
+ "currency": ["watchLoadWidget"],
251
+ "showBonusSelectionInput": ["watchLoadWidget"]
252
+ }; }
253
+ };
254
+ UserDepositWithdrawal.style = UserDepositWithdrawalStyle0;
255
+
256
+ exports.user_deposit_withdrawal = UserDepositWithdrawal;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-faa382a8.js');
6
+ const appGlobals = require('./app-globals-3a1e7e63.js');
7
+
8
+ /*
9
+ Stencil Client Patch Browser v4.20.0 | MIT Licensed | https://stenciljs.com
10
+ */
11
+ var patchBrowser = () => {
12
+ const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('user-deposit-withdrawal.cjs.js', document.baseURI).href));
13
+ const opts = {};
14
+ if (importMeta !== "") {
15
+ opts.resourcesUrl = new URL(".", importMeta).href;
16
+ }
17
+ return index.promiseResolve(opts);
18
+ };
19
+
20
+ patchBrowser().then(async (options) => {
21
+ await appGlobals.globalScripts();
22
+ return index.bootstrapLazy([["user-deposit-withdrawal.cjs",[[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);
23
+ });
24
+
25
+ exports.setNonce = index.setNonce;
@@ -0,0 +1,12 @@
1
+ {
2
+ "entries": [
3
+ "components/user-deposit-withdrawal/user-deposit-withdrawal.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "4.20.0",
8
+ "typescriptVersion": "5.5.3"
9
+ },
10
+ "collections": [],
11
+ "bundles": []
12
+ }
@@ -0,0 +1 @@
1
+ export { UserDepositWithdrawal } from './user-deposit-withdrawal';
@@ -0,0 +1,35 @@
1
+ :host {
2
+ font: inherit;
3
+ display: block;
4
+ height: 100%;
5
+ overflow: hidden;
6
+ }
7
+
8
+ .MenuReturnButton {
9
+ font: inherit;
10
+ color: var(--emfe-w-color-gray-300, #58586B);
11
+ display: inline-flex;
12
+ align-items: center;
13
+ column-gap: 10px;
14
+ margin-bottom: 10px;
15
+ }
16
+ .MenuReturnButton svg {
17
+ fill: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
18
+ }
19
+ .MenuReturnButton h2.CategoryTitleMobile {
20
+ font-size: 16px;
21
+ color: var(--emfe-w-pam-color-primary, var(--emfe-w-color-primary, #D0046C));
22
+ }
23
+
24
+ .DepositWithdrawalWrapper {
25
+ width: 100%;
26
+ padding: 0;
27
+ margin: 0;
28
+ height: 100vh;
29
+ }
30
+
31
+ @container (max-width: 475px) {
32
+ .DepositWithdrawalWrapper {
33
+ height: 100vh;
34
+ }
35
+ }