@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,209 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-fe945b18.js';
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 = class {
45
- constructor(hostRef) {
46
- registerInstance(this, hostRef);
47
- /**
48
- * Client custom styling via inline style
49
- */
50
- this.clientStyling = '';
51
- /**
52
- * Client custom styling via url
53
- */
54
- this.clientStylingUrl = '';
55
- /*
56
- * Operator selected currency
57
- */
58
- this.currency = '';
59
- /*
60
- * Display bonus dropdown
61
- */
62
- this.showBonusSelectionInput = 'true';
63
- /*
64
- * State of deposit - short cashier enabled or not
65
- */
66
- this.isShortCashier = 'false';
67
- this.beforeRedirect = emptyFunction;
68
- this.limitStylingAppends = false;
69
- this.bindedHandler = this.handleMessage.bind(this);
70
- this.userAgent = window.navigator.userAgent;
71
- this.isMobile = isMobile(this.userAgent);
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
- }
91
- get typeParameter() {
92
- if (this.type === 'deposit') {
93
- return 'Deposit';
94
- }
95
- if (this.type === 'withdraw') {
96
- return 'Withdraw';
97
- }
98
- }
99
- watchLoadWidget() {
100
- this.loadWidget();
101
- }
102
- async componentWillLoad() {
103
- await this.loadWidget();
104
- }
105
- toggleScreen(isMobile) {
106
- window.postMessage({ type: 'PlayerAccountMenuActive', isMobile }, window.location.href);
107
- }
108
- componentDidLoad() {
109
- window.addEventListener('message', this.bindedHandler, false);
110
- }
111
- disconnectedCallback() {
112
- window.removeEventListener('message', this.bindedHandler, false);
113
- }
114
- componentDidRender() {
115
- // start custom styling area
116
- if (!this.limitStylingAppends && this.stylingContainer) {
117
- if (this.clientStyling)
118
- this.setClientStyling();
119
- if (this.clientStylingUrl)
120
- this.setClientStylingURL();
121
- this.limitStylingAppends = true;
122
- }
123
- // end custom styling area
124
- }
125
- render() {
126
- 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 &&
127
- 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 })))));
128
- }
129
- async loadWidget() {
130
- const requestObject = {
131
- Channel: this.channel,
132
- Type: this.typeParameter,
133
- SuccessUrl: this.successUrl,
134
- CancelUrl: this.cancelUrl,
135
- FailUrl: this.failUrl,
136
- Language: this.language,
137
- productType: this.productType,
138
- isShortCashier: this.isShortCashier,
139
- currency: this.currency,
140
- showBonusSelectionInput: this.showBonusSelectionInput
141
- };
142
- try {
143
- const url = `${this.endpoint}/v1/player/${this.userId}/payment/GetPaymentSession`;
144
- const response = await fetch(url, {
145
- method: 'POST',
146
- headers: {
147
- 'X-Sessionid': this.session,
148
- 'Content-Type': 'application/json',
149
- },
150
- body: JSON.stringify(requestObject)
151
- });
152
- if (!response.ok) {
153
- const err = await response.text();
154
- throw new Error(err);
155
- }
156
- const data = await response.json();
157
- this.cashierInfoUrl = data.CashierInfo.Url;
158
- }
159
- catch (ex) {
160
- console.error(ex);
161
- }
162
- }
163
- handleMessage(message) {
164
- var _a, _b, _c, _d, _e, _f, _g;
165
- if (message.data["MMFE:setIFrameHeight"] && this.isShortCashier === 'true') {
166
- this.dynamicHeight = message.data["MMFE:setIFrameHeight"].toString() + 'px';
167
- }
168
- if (((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) === 'mm-hcback-to-merchant') {
169
- this.doRedirect(message.data.type, this.homeUrl);
170
- }
171
- if (((_b = message.data) === null || _b === void 0 ? void 0 : _b.redirect) === 'mm-hc-back-tomerchant') {
172
- this.doRedirect(message.data.redirect, this.homeUrl);
173
- }
174
- if (((_c = message.data) === null || _c === void 0 ? void 0 : _c.redirect) === 'mm-hc-sports') {
175
- this.doRedirect((_d = message.data) === null || _d === void 0 ? void 0 : _d.redirect, this.sportsUrl);
176
- }
177
- if (((_e = message.data) === null || _e === void 0 ? void 0 : _e.redirect) === 'mm-hc-casino') {
178
- this.doRedirect(window.location.href, this.casinoUrl);
179
- }
180
- if (((_f = message.data) === null || _f === void 0 ? void 0 : _f.redirect) === 'mm-hc-contact') {
181
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
182
- this.doRedirect(window.location.href, this.contactUrl);
183
- }
184
- if (((_g = message.data) === null || _g === void 0 ? void 0 : _g.redirect) === 'mm-wm-hc-init-deposit') {
185
- window.postMessage({ type: 'CloseShortCashier' }, window.location.href);
186
- this.doRedirect(window.location.href, this.depositUrl);
187
- }
188
- }
189
- doRedirect(reason, url) {
190
- const redirectArgs = { reason, url, cancel: false };
191
- this.beforeRedirect(redirectArgs);
192
- if (redirectArgs.cancel) {
193
- return;
194
- }
195
- if (!redirectArgs.url) {
196
- window.location.href = '/';
197
- return;
198
- }
199
- window.location.href = redirectArgs.url;
200
- }
201
- static get watchers() { return {
202
- "session": ["watchLoadWidget"],
203
- "userId": ["watchLoadWidget"],
204
- "isShortCashier": ["watchLoadWidget"]
205
- }; }
206
- };
207
- UserDepositWithdrawal.style = userDepositWithdrawalCss;
208
-
209
- export { UserDepositWithdrawal as user_deposit_withdrawal };
@@ -1,17 +0,0 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-fe945b18.js';
2
-
3
- /*
4
- Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
5
- */
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);
13
- };
14
-
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":[513,"is-short-cashier"],"homeUrl":[513,"home-url"],"beforeRedirect":[16],"limitStylingAppends":[32],"dynamicHeight":[32]}]]]], options);
17
- });
package/dist/index.cjs.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./cjs/index.cjs.js');
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export * from './esm/index.js';
@@ -1,22 +0,0 @@
1
- import { sass } from '@stencil/sass';
2
- export const config = {
3
- namespace: 'user-deposit-withdrawal',
4
- taskQueue: 'async',
5
- plugins: [sass()],
6
- outputTargets: [
7
- {
8
- type: 'dist',
9
- esmLoaderPath: '../loader',
10
- },
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
- ],
22
- };
@@ -1,2 +0,0 @@
1
- import { Config } from '../../../../../../../../../../../stencil-public-runtime';
2
- export declare const config: Config;
@@ -1,74 +0,0 @@
1
- export interface Request {
2
- Channel: string;
3
- Type: string;
4
- SuccessUrl: string;
5
- CancelUrl: string;
6
- FailUrl: string;
7
- Language: string;
8
- productType: string;
9
- }
10
- export interface CashierInfo {
11
- Url: string;
12
- }
13
- export interface Response {
14
- CashierInfo: CashierInfo;
15
- ResponseCode: string;
16
- RequestId: string;
17
- }
18
- export interface RedirectCallbackArgs {
19
- cancel: boolean;
20
- reason: string;
21
- url: string;
22
- }
23
- export declare class UserDepositWithdrawal {
24
- /**
25
- * Client custom styling via inline style
26
- */
27
- clientStyling: string;
28
- /**
29
- * Client custom styling via url
30
- */
31
- clientStylingUrl: string;
32
- /**
33
- * Endpoint
34
- */
35
- endpoint: string;
36
- type: 'deposit' | 'withdraw';
37
- channel: string;
38
- language: string;
39
- productType: string;
40
- userId: string;
41
- session: string;
42
- successUrl: string;
43
- cancelUrl: string;
44
- failUrl: string;
45
- sportsUrl: string;
46
- casinoUrl: string;
47
- contactUrl: string;
48
- depositUrl: string;
49
- currency: string;
50
- showBonusSelectionInput: string;
51
- isShortCashier: string;
52
- homeUrl: string;
53
- beforeRedirect: (params: RedirectCallbackArgs) => void;
54
- private limitStylingAppends;
55
- private dynamicHeight;
56
- get typeParameter(): "Deposit" | "Withdraw";
57
- private cashierInfoUrl;
58
- private bindedHandler;
59
- private userAgent;
60
- isMobile: boolean;
61
- private stylingContainer;
62
- watchLoadWidget(): void;
63
- componentWillLoad(): Promise<void>;
64
- toggleScreen(isMobile: any): void;
65
- componentDidLoad(): void;
66
- disconnectedCallback(): void;
67
- setClientStyling: () => void;
68
- setClientStylingURL: () => void;
69
- componentDidRender(): void;
70
- render(): any;
71
- private loadWidget;
72
- private handleMessage;
73
- private doRedirect;
74
- }
@@ -1,98 +0,0 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- /**
4
- * This is an autogenerated file created by the Stencil compiler.
5
- * It contains typing information for all components that exist in this project.
6
- */
7
- import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { RedirectCallbackArgs } from "./components/user-deposit-withdrawal/user-deposit-withdrawal";
9
- export namespace Components {
10
- interface UserDepositWithdrawal {
11
- "beforeRedirect": (params: RedirectCallbackArgs) => void;
12
- "cancelUrl": string;
13
- "casinoUrl": string;
14
- "channel": string;
15
- /**
16
- * Client custom styling via inline style
17
- */
18
- "clientStyling": string;
19
- /**
20
- * Client custom styling via url
21
- */
22
- "clientStylingUrl": string;
23
- "contactUrl": string;
24
- "currency": string;
25
- "depositUrl": string;
26
- /**
27
- * Endpoint
28
- */
29
- "endpoint": string;
30
- "failUrl": string;
31
- "homeUrl": string;
32
- "isShortCashier": string;
33
- "language": string;
34
- "productType": string;
35
- "session": string;
36
- "showBonusSelectionInput": string;
37
- "sportsUrl": string;
38
- "successUrl": string;
39
- "type": 'deposit' | 'withdraw';
40
- "userId": string;
41
- }
42
- }
43
- declare global {
44
- interface HTMLUserDepositWithdrawalElement extends Components.UserDepositWithdrawal, HTMLStencilElement {
45
- }
46
- var HTMLUserDepositWithdrawalElement: {
47
- prototype: HTMLUserDepositWithdrawalElement;
48
- new (): HTMLUserDepositWithdrawalElement;
49
- };
50
- interface HTMLElementTagNameMap {
51
- "user-deposit-withdrawal": HTMLUserDepositWithdrawalElement;
52
- }
53
- }
54
- declare namespace LocalJSX {
55
- interface UserDepositWithdrawal {
56
- "beforeRedirect"?: (params: RedirectCallbackArgs) => void;
57
- "cancelUrl"?: string;
58
- "casinoUrl"?: string;
59
- "channel": string;
60
- /**
61
- * Client custom styling via inline style
62
- */
63
- "clientStyling"?: string;
64
- /**
65
- * Client custom styling via url
66
- */
67
- "clientStylingUrl"?: string;
68
- "contactUrl"?: string;
69
- "currency"?: string;
70
- "depositUrl"?: string;
71
- /**
72
- * Endpoint
73
- */
74
- "endpoint": string;
75
- "failUrl"?: string;
76
- "homeUrl"?: string;
77
- "isShortCashier"?: string;
78
- "language"?: string;
79
- "productType"?: string;
80
- "session"?: string;
81
- "showBonusSelectionInput"?: string;
82
- "sportsUrl"?: string;
83
- "successUrl"?: string;
84
- "type": 'deposit' | 'withdraw';
85
- "userId"?: string;
86
- }
87
- interface IntrinsicElements {
88
- "user-deposit-withdrawal": UserDepositWithdrawal;
89
- }
90
- }
91
- export { LocalJSX as JSX };
92
- declare module "@stencil/core" {
93
- export namespace JSX {
94
- interface IntrinsicElements {
95
- "user-deposit-withdrawal": LocalJSX.UserDepositWithdrawal & JSXBase.HTMLAttributes<HTMLUserDepositWithdrawalElement>;
96
- }
97
- }
98
- }
@@ -1 +0,0 @@
1
- export * from './components';