@everymatrix/lottery-hakuna-ticket-buy 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-f1909c9b.js +1359 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/lottery-button_7.cjs.entry.js +1285 -0
- package/dist/cjs/lottery-hakuna-ticket-buy-fe6a420c.js +545 -0
- package/dist/cjs/lottery-hakuna-ticket-buy.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +49 -0
- package/dist/collection/components/lottery-hakuna-ticket-buy/index.js +1 -0
- package/dist/collection/components/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy.css +197 -0
- package/dist/collection/components/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy.js +690 -0
- package/dist/collection/components/model/index.js +5 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +124 -0
- package/dist/collection/utils/utils.js +47 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-1f778cb5.js +1331 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/lottery-button_7.entry.js +1276 -0
- package/dist/esm/lottery-hakuna-ticket-buy-a9f8e014.js +540 -0
- package/dist/esm/lottery-hakuna-ticket-buy.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-hakuna-ticket-buy/app-globals-0f993ce5.js +1 -0
- package/dist/lottery-hakuna-ticket-buy/index-1f778cb5.js +2 -0
- package/dist/lottery-hakuna-ticket-buy/index.esm.js +1 -0
- package/dist/lottery-hakuna-ticket-buy/lottery-button_7.entry.js +1 -0
- package/dist/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy-a9f8e014.js +1 -0
- package/dist/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy.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-hakuna-ticket-buy/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/packages/stencil/lottery-hakuna-ticket-buy/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/packages/stencil/lottery-hakuna-ticket-buy/stencil.config.dev.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/packages/stencil/lottery-hakuna-ticket-buy/storybook/main.d.ts +3 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/packages/stencil/lottery-hakuna-ticket-buy/storybook/preview.d.ts +70 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/tools/plugins/index.d.ts +4 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/tools/plugins/lazy-load-chunk-plugin.d.ts +12 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/builds/emfe-widgets/widgets-monorepo/packages/stencil/lottery-hakuna-ticket-buy/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/lottery-hakuna-ticket-buy/index.d.ts +1 -0
- package/dist/types/components/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy.d.ts +121 -0
- package/dist/types/components/model/index.d.ts +103 -0
- package/dist/types/components.d.ts +147 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +3 -0
- package/dist/types/utils/utils.d.ts +13 -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 @@
|
|
|
1
|
+
export * from './components/lottery-hakuna-ticket-buy';
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
3
|
+
const TRANSLATIONS = {
|
|
4
|
+
en: {
|
|
5
|
+
addTicket: 'ADD TICKET',
|
|
6
|
+
emptyDraw: 'Sorry. The Game is not available now.',
|
|
7
|
+
payNow: 'PAY NOW',
|
|
8
|
+
error: 'Error',
|
|
9
|
+
deleteTicketTitle: 'Are You Sure?',
|
|
10
|
+
deleteTicketMessage: 'Are you sure you want to delete this ticket? This process cannot be undone.',
|
|
11
|
+
cancel: 'CANCEL',
|
|
12
|
+
delete: 'DELETE',
|
|
13
|
+
confirmPaymentTitle: 'Confirm Your Payment',
|
|
14
|
+
back: 'BACK',
|
|
15
|
+
confirm: 'CONFIRM',
|
|
16
|
+
viewTicket: 'VIEW TICKET',
|
|
17
|
+
home: 'HOME',
|
|
18
|
+
ticketSubmittedSuccess: 'Payment Successful',
|
|
19
|
+
ticketSubmittedSuccessMessage: 'Thank you for your payment. Payment has been proceeded successfully.',
|
|
20
|
+
ticketSubmittedError: 'Error Processing Payment',
|
|
21
|
+
ticketSubmittedErrorMessage: 'Please check your wallet, account details and connection and try again. If you need help, please contact us.',
|
|
22
|
+
fetchingGameConfig: 'Fetching game config...',
|
|
23
|
+
ticket: 'Ticket',
|
|
24
|
+
price: 'Price',
|
|
25
|
+
tickets: 'Ticket(s)',
|
|
26
|
+
total: 'Total'
|
|
27
|
+
},
|
|
28
|
+
ro: {
|
|
29
|
+
error: 'Eroare',
|
|
30
|
+
backButton: 'Inapoi',
|
|
31
|
+
lobbyButton: 'Lobby',
|
|
32
|
+
nextDraw: 'Urmatoarea extragere:',
|
|
33
|
+
buy: 'Cumpara bilet',
|
|
34
|
+
viewLatest: 'Ultimile extrageri',
|
|
35
|
+
submitSuccess: 'Submit successfully!',
|
|
36
|
+
orderSummaryTitle: 'Rezumat comanda',
|
|
37
|
+
orderSummaryTickets: 'Bilet',
|
|
38
|
+
orderSummaryTotal: 'Total',
|
|
39
|
+
orderSummarySubmit: 'Trimite',
|
|
40
|
+
modalLogin: 'Please login to submit a ticket',
|
|
41
|
+
loading: 'Se incarca, va rugam asteptati ...'
|
|
42
|
+
},
|
|
43
|
+
fr: {
|
|
44
|
+
error: 'Error',
|
|
45
|
+
backButton: 'Back',
|
|
46
|
+
lobbyButton: 'Lobby',
|
|
47
|
+
nextDraw: 'Next draw in: ',
|
|
48
|
+
buy: 'Buy tickets',
|
|
49
|
+
viewLatest: 'View latest results',
|
|
50
|
+
submitSuccess: 'Submit successfully!',
|
|
51
|
+
orderSummaryTitle: 'Order Summary',
|
|
52
|
+
orderSummaryTickets: 'Ticket',
|
|
53
|
+
orderSummaryTotal: 'Total',
|
|
54
|
+
orderSummarySubmit: 'Submit',
|
|
55
|
+
modalLogin: 'Please login to submit a ticket',
|
|
56
|
+
loading: 'Loading, please wait ...'
|
|
57
|
+
},
|
|
58
|
+
ar: {
|
|
59
|
+
error: 'خطأ',
|
|
60
|
+
backButton: 'خلف',
|
|
61
|
+
lobbyButton: 'ردهة',
|
|
62
|
+
nextDraw: 'السحب التالي:',
|
|
63
|
+
buy: 'اشتري تذاكر',
|
|
64
|
+
viewLatest: 'عرض أحدث النتائج',
|
|
65
|
+
submitSuccess: 'Submit successfully!',
|
|
66
|
+
orderSummaryTitle: 'ملخص الطلب',
|
|
67
|
+
orderSummaryTickets: 'تذكرة',
|
|
68
|
+
orderSummaryTotal: 'المجموع',
|
|
69
|
+
orderSummarySubmit: 'يُقدِّم',
|
|
70
|
+
modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة',
|
|
71
|
+
loading: 'Loading, please wait ...'
|
|
72
|
+
},
|
|
73
|
+
hr: {
|
|
74
|
+
error: 'Greška',
|
|
75
|
+
backButton: 'Nazad',
|
|
76
|
+
lobbyButton: 'Lobby',
|
|
77
|
+
nextDraw: 'Sljedeće izvlačenje za: ',
|
|
78
|
+
buy: 'Uplati listić',
|
|
79
|
+
viewLatest: 'Pogledajte najnovije rezultate',
|
|
80
|
+
submitSuccess: 'Submit successfully!',
|
|
81
|
+
orderSummaryTitle: 'Sažetak narudžbe',
|
|
82
|
+
orderSummaryTickets: 'Listić',
|
|
83
|
+
orderSummaryTotal: 'Ukupno',
|
|
84
|
+
orderSummarySubmit: 'Podnijeti',
|
|
85
|
+
modalLogin: 'Molimo prijavite se da uplatite listić',
|
|
86
|
+
loading: 'Učitavanje, molimo pričekajte ...'
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export const translate = (key, customLang) => {
|
|
90
|
+
const lang = customLang;
|
|
91
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
92
|
+
};
|
|
93
|
+
export const getTranslations = (url) => {
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
95
|
+
fetch(url)
|
|
96
|
+
.then((res) => res.json())
|
|
97
|
+
.then((data) => {
|
|
98
|
+
Object.keys(data).forEach((item) => {
|
|
99
|
+
for (let key in data[item]) {
|
|
100
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
resolve(TRANSLATIONS);
|
|
104
|
+
})
|
|
105
|
+
.catch((err) => {
|
|
106
|
+
reject(err);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
export const resolveTranslationUrl = async (translationUrl) => {
|
|
111
|
+
if (translationUrl) {
|
|
112
|
+
try {
|
|
113
|
+
const response = await fetch(translationUrl);
|
|
114
|
+
if (!response.ok) {
|
|
115
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
116
|
+
}
|
|
117
|
+
const translations = await response.json();
|
|
118
|
+
getTranslations(translations);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
console.error('Failed to fetch or parse translations from URL:', error);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name isMobile
|
|
3
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
4
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
5
|
+
* @returns {Boolean} true or false
|
|
6
|
+
*/
|
|
7
|
+
export const isMobile = (userAgent) => {
|
|
8
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
9
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
10
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
11
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
12
|
+
};
|
|
13
|
+
export const generateUUID = () => {
|
|
14
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
15
|
+
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
16
|
+
return v.toString(16);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export function fetchRequest(url, method = 'GET', body = null, headers = {}) {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
const uuid = generateUUID();
|
|
22
|
+
const options = {
|
|
23
|
+
method,
|
|
24
|
+
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Idempotency-Key': uuid }, headers),
|
|
25
|
+
body: null
|
|
26
|
+
};
|
|
27
|
+
if (body) {
|
|
28
|
+
options.body = JSON.stringify(body);
|
|
29
|
+
}
|
|
30
|
+
fetch(url, options)
|
|
31
|
+
.then((response) => {
|
|
32
|
+
if (!response.ok) {
|
|
33
|
+
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
34
|
+
}
|
|
35
|
+
return response.json();
|
|
36
|
+
})
|
|
37
|
+
.then((data) => resolve(data))
|
|
38
|
+
.catch((error) => reject(error));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export const showNotification = ({ message, theme = 'success' }) => {
|
|
42
|
+
window.postMessage({
|
|
43
|
+
type: 'ShowNotificationToast',
|
|
44
|
+
message,
|
|
45
|
+
theme
|
|
46
|
+
});
|
|
47
|
+
};
|