@everymatrix/pam-player-profile 0.8.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.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-4130c9d2.js +1227 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/pam-player-profile-dc13914a.js +509 -0
- package/dist/cjs/pam-player-profile.cjs.js +25 -0
- package/dist/cjs/pam-player-profile_2.cjs.entry.js +175 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/pam-player-profile/index.js +1 -0
- package/dist/collection/components/pam-player-profile/pam-player-profile.css +263 -0
- package/dist/collection/components/pam-player-profile/pam-player-profile.js +432 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +209 -0
- package/dist/collection/utils/utils.js +12 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-d953d051.js +1200 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/pam-player-profile-e280c440.js +507 -0
- package/dist/esm/pam-player-profile.js +20 -0
- package/dist/esm/pam-player-profile_2.entry.js +170 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/pam-player-profile/index.esm.js +1 -0
- package/dist/pam-player-profile/p-047a7a7b.js +2 -0
- package/dist/pam-player-profile/p-41838095.js +1 -0
- package/dist/pam-player-profile/p-b2438d4d.entry.js +1 -0
- package/dist/pam-player-profile/p-e1255160.js +1 -0
- package/dist/pam-player-profile/pam-player-profile.esm.js +1 -0
- package/dist/stencil.config.dev.js +16 -0
- package/dist/stencil.config.js +18 -0
- package/dist/storybook/main.js +47 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/packages/stencil/pam-player-profile/storybook/preview.d.ts +70 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/index.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-player-profile/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/pam-player-profile/index.d.ts +1 -0
- package/dist/types/components/pam-player-profile/pam-player-profile.d.ts +45 -0
- package/dist/types/components.d.ts +57 -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 +23 -0
- package/dist/types/utils/utils.d.ts +7 -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 +26 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4130c9d2.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([["pam-player-profile_2.cjs",[[1,"pam-player-profile",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dobFormat":[513,"dob-format"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"skeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
15
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-4130c9d2.js');
|
|
4
|
+
|
|
5
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
6
|
+
const TRANSLATIONS = {
|
|
7
|
+
"en": {
|
|
8
|
+
"title": "Profile Info",
|
|
9
|
+
"username": "Username",
|
|
10
|
+
"firstName": "First Name",
|
|
11
|
+
"lastName": "Last Name",
|
|
12
|
+
"securityQuestion": "Security Question",
|
|
13
|
+
"securityAnswer": "Security Answer",
|
|
14
|
+
"playerTitle": "Title",
|
|
15
|
+
"gender": "Gender",
|
|
16
|
+
"dateOfBirth": "Date Of Birth",
|
|
17
|
+
"currency": "Currency",
|
|
18
|
+
"securityQuestionError": "Security question must be at least 1 character long and maximum 120 characters.",
|
|
19
|
+
"securityAnswerError": "Security answer must be at least 1 character long and maximum 120 characters.",
|
|
20
|
+
"saveButton": "Save Changes",
|
|
21
|
+
"successMessage": "Your changes have been saved!",
|
|
22
|
+
"errorMessageUpdate": "An error has occured when attempting to update the profile information",
|
|
23
|
+
"errorMessageFetch": "An error has occured when attempting to fetch the profile information"
|
|
24
|
+
},
|
|
25
|
+
"zh-hk": {
|
|
26
|
+
"title": "個人資料",
|
|
27
|
+
"username": "用戶名",
|
|
28
|
+
"firstName": "名字",
|
|
29
|
+
"lastName": "姓氏",
|
|
30
|
+
"securityQuestion": "安全問題",
|
|
31
|
+
"securityAnswer": "安全答案",
|
|
32
|
+
"playerTitle": "稱號",
|
|
33
|
+
"gender": "性別",
|
|
34
|
+
"dateOfBirth": "出生日期",
|
|
35
|
+
"currency": "貨幣",
|
|
36
|
+
"securityQuestionError": "安全問題必須至少1個字符,最多120個字符。",
|
|
37
|
+
"securityAnswerError": "安全答案必須至少1個字符,最多120個字符。",
|
|
38
|
+
"saveButton": "保存更改",
|
|
39
|
+
"successMessage": "您的更改已保存!",
|
|
40
|
+
"errorMessageUpdate": "嘗試更新個人資料信息時發生錯誤",
|
|
41
|
+
"errorMessageFetch": "在嘗試獲取個人資料時發生錯誤"
|
|
42
|
+
},
|
|
43
|
+
"fr": {
|
|
44
|
+
"title": "Informations de profil",
|
|
45
|
+
"username": "Nom d'utilisateur",
|
|
46
|
+
"firstName": "Prénom",
|
|
47
|
+
"lastName": "Nom de famille",
|
|
48
|
+
"securityQuestion": "Question de sécurité",
|
|
49
|
+
"securityAnswer": "Réponse de sécurité",
|
|
50
|
+
"playerTitle": "Titre",
|
|
51
|
+
"gender": "Genre",
|
|
52
|
+
"dateOfBirth": "Date de naissance",
|
|
53
|
+
"currency": "Devise",
|
|
54
|
+
"securityQuestionError": "La question de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",
|
|
55
|
+
"securityAnswerError": "La réponse de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",
|
|
56
|
+
"saveButton": "Enregistrer les modifications",
|
|
57
|
+
"successMessage": "Vos modifications ont été enregistrées !",
|
|
58
|
+
"errorMessageUpdate": "Une erreur s'est produite lors de la tentative de mise à jour des informations de profil",
|
|
59
|
+
"errorMessageFetch": "Une erreur est survenue lors de la tentative de récupération des informations de profil"
|
|
60
|
+
},
|
|
61
|
+
"ro": {
|
|
62
|
+
"title": "Informații profil",
|
|
63
|
+
"username": "Nume de utilizator",
|
|
64
|
+
"firstName": "Prenume",
|
|
65
|
+
"lastName": "Nume de familie",
|
|
66
|
+
"securityQuestion": "Întrebare de securitate",
|
|
67
|
+
"securityAnswer": "Răspuns de securitate",
|
|
68
|
+
"playerTitle": "Titlu",
|
|
69
|
+
"gender": "Gen",
|
|
70
|
+
"dateOfBirth": "Data nașterii",
|
|
71
|
+
"currency": "Monedă",
|
|
72
|
+
"securityQuestionError": "Întrebarea de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",
|
|
73
|
+
"securityAnswerError": "Răspunsul de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",
|
|
74
|
+
"saveButton": "Salvează modificările",
|
|
75
|
+
"successMessage": "Modificările dvs. au fost salvate!",
|
|
76
|
+
"errorMessageUpdate": "A apărut o eroare la încercarea de a actualiza informațiile profilului",
|
|
77
|
+
"errorMessageFetch": "A apărut o eroare la încercarea de a obține informațiile profilului"
|
|
78
|
+
},
|
|
79
|
+
"tr": {
|
|
80
|
+
"title": "Profil Bilgileri",
|
|
81
|
+
"username": "Kullanıcı Adı",
|
|
82
|
+
"firstName": "Ad",
|
|
83
|
+
"lastName": "Soyad",
|
|
84
|
+
"securityQuestion": "Güvenlik Sorusu",
|
|
85
|
+
"securityAnswer": "Güvenlik Cevabı",
|
|
86
|
+
"playerTitle": "Başlık",
|
|
87
|
+
"gender": "Cinsiyet",
|
|
88
|
+
"dateOfBirth": "Doğum Tarihi",
|
|
89
|
+
"currency": "Para Birimi",
|
|
90
|
+
"securityQuestionError": "Güvenlik sorusu en az 1 karakter ve en fazla 120 karakter olmalıdır.",
|
|
91
|
+
"securityAnswerError": "Güvenlik cevabı en az 1 karakter ve en fazla 120 karakter olmalıdır.",
|
|
92
|
+
"saveButton": "Değişiklikleri Kaydet",
|
|
93
|
+
"successMessage": "Değişiklikleriniz kaydedildi!",
|
|
94
|
+
"errorMessageUpdate": "Profil bilgilerini güncellemeye çalışırken bir hata oluştu",
|
|
95
|
+
"errorMessageFetch": "Profil bilgilerini almak için yapılan işlemde bir hata oluştu"
|
|
96
|
+
},
|
|
97
|
+
"es": {
|
|
98
|
+
"title": "Información del perfil",
|
|
99
|
+
"username": "Nombre de usuario",
|
|
100
|
+
"firstName": "Nombre",
|
|
101
|
+
"lastName": "Apellido",
|
|
102
|
+
"securityQuestion": "Pregunta de seguridad",
|
|
103
|
+
"securityAnswer": "Respuesta de seguridad",
|
|
104
|
+
"playerTitle": "Título",
|
|
105
|
+
"gender": "Género",
|
|
106
|
+
"dateOfBirth": "Fecha de nacimiento",
|
|
107
|
+
"currency": "Moneda",
|
|
108
|
+
"securityQuestionError": "La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
|
|
109
|
+
"securityAnswerError": "La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
|
|
110
|
+
"saveButton": "Guardar cambios",
|
|
111
|
+
"successMessage": "¡Tus cambios han sido guardados!",
|
|
112
|
+
"errorMessageUpdate": "Se ha producido un error al intentar actualizar la información del perfil",
|
|
113
|
+
"errorMessageFetch": "Se ha producido un error al intentar obtener la información del perfil"
|
|
114
|
+
},
|
|
115
|
+
"pt": {
|
|
116
|
+
"title": "Informações do Perfil",
|
|
117
|
+
"username": "Nome de usuário",
|
|
118
|
+
"firstName": "Nome",
|
|
119
|
+
"lastName": "Sobrenome",
|
|
120
|
+
"securityQuestion": "Pergunta de segurança",
|
|
121
|
+
"securityAnswer": "Resposta de segurança",
|
|
122
|
+
"playerTitle": "Título",
|
|
123
|
+
"gender": "Gênero",
|
|
124
|
+
"dateOfBirth": "Data de nascimento",
|
|
125
|
+
"currency": "Moeda",
|
|
126
|
+
"securityQuestionError": "A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
|
|
127
|
+
"securityAnswerError": "A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
|
|
128
|
+
"saveButton": "Salvar alterações",
|
|
129
|
+
"successMessage": "Suas alterações foram salvas!",
|
|
130
|
+
"errorMessageUpdate": "Ocorreu um erro ao tentar atualizar as informações do perfil",
|
|
131
|
+
"errorMessageFetch": "Ocorreu um erro ao tentar buscar as informações do perfil"
|
|
132
|
+
},
|
|
133
|
+
"hr": {
|
|
134
|
+
"title": "Informacije o profilu",
|
|
135
|
+
"username": "Korisničko ime",
|
|
136
|
+
"firstName": "Ime",
|
|
137
|
+
"lastName": "Prezime",
|
|
138
|
+
"securityQuestion": "Sigurnosno pitanje",
|
|
139
|
+
"securityAnswer": "Sigurnosni odgovor",
|
|
140
|
+
"playerTitle": "Naslov",
|
|
141
|
+
"gender": "Spol",
|
|
142
|
+
"dateOfBirth": "Datum rođenja",
|
|
143
|
+
"currency": "Valuta",
|
|
144
|
+
"securityQuestionError": "Sigurnosno pitanje mora imati najmanje 1 znak i najviše 120 znakova.",
|
|
145
|
+
"securityAnswerError": "Sigurnosni odgovor mora imati najmanje 1 znak i najviše 120 znakova.",
|
|
146
|
+
"saveButton": "Spremi promjene",
|
|
147
|
+
"successMessage": "Vaše promjene su spremljene!",
|
|
148
|
+
"errorMessageUpdate": "Došlo je do pogreške prilikom pokušaja ažuriranja informacija o profilu",
|
|
149
|
+
"errorMessageFetch": "Došlo je do greške prilikom pokušaja dobijanja informacija o profilu"
|
|
150
|
+
},
|
|
151
|
+
"pt-br": {
|
|
152
|
+
"title": "Informações do Perfil",
|
|
153
|
+
"username": "Nome de usuário",
|
|
154
|
+
"firstName": "Nome",
|
|
155
|
+
"lastName": "Sobrenome",
|
|
156
|
+
"securityQuestion": "Pergunta de segurança",
|
|
157
|
+
"securityAnswer": "Resposta de segurança",
|
|
158
|
+
"playerTitle": "Título",
|
|
159
|
+
"gender": "Gênero",
|
|
160
|
+
"dateOfBirth": "Data de nascimento",
|
|
161
|
+
"currency": "Moeda",
|
|
162
|
+
"securityQuestionError": "A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
|
|
163
|
+
"securityAnswerError": "A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",
|
|
164
|
+
"saveButton": "Salvar alterações",
|
|
165
|
+
"successMessage": "Suas alterações foram salvas!",
|
|
166
|
+
"errorMessageUpdate": "Ocorreu um erro ao tentar atualizar as informações do perfil",
|
|
167
|
+
"errorMessageFetch": "Ocorreu um erro ao tentar buscar as informações do perfil"
|
|
168
|
+
},
|
|
169
|
+
"es-mx": {
|
|
170
|
+
"title": "Información del perfil",
|
|
171
|
+
"username": "Nombre de usuario",
|
|
172
|
+
"firstName": "Nombre",
|
|
173
|
+
"lastName": "Apellido",
|
|
174
|
+
"securityQuestion": "Pregunta de seguridad",
|
|
175
|
+
"securityAnswer": "Respuesta de seguridad",
|
|
176
|
+
"playerTitle": "Título",
|
|
177
|
+
"gender": "Género",
|
|
178
|
+
"dateOfBirth": "Fecha de nacimiento",
|
|
179
|
+
"currency": "Moneda",
|
|
180
|
+
"securityQuestionError": "La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
|
|
181
|
+
"securityAnswerError": "La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",
|
|
182
|
+
"saveButton": "Guardar cambios",
|
|
183
|
+
"successMessage": "¡Tus cambios han sido guardados!",
|
|
184
|
+
"errorMessageUpdate": "Se ha producido un error al intentar actualizar la información del perfil",
|
|
185
|
+
"errorMessageFetch": "Se ha producido un error al intentar obtener la información del perfil"
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
const translate = (key, customLang, values) => {
|
|
189
|
+
let lang = TRANSLATIONS[customLang] ? customLang : DEFAULT_LANGUAGE;
|
|
190
|
+
let translation = TRANSLATIONS[lang][key];
|
|
191
|
+
if (values !== undefined) {
|
|
192
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
193
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
194
|
+
translation = translation.replace(regex, value);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return translation;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @name setClientStyling
|
|
202
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
203
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
204
|
+
* @param {string} clientStyling The style content
|
|
205
|
+
*/
|
|
206
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
207
|
+
if (stylingContainer) {
|
|
208
|
+
const sheet = document.createElement('style');
|
|
209
|
+
sheet.innerHTML = clientStyling;
|
|
210
|
+
stylingContainer.appendChild(sheet);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @name setClientStylingURL
|
|
216
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
217
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
218
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
219
|
+
*/
|
|
220
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
221
|
+
const url = new URL(clientStylingUrl);
|
|
222
|
+
|
|
223
|
+
fetch(url.href)
|
|
224
|
+
.then((res) => res.text())
|
|
225
|
+
.then((data) => {
|
|
226
|
+
const cssFile = document.createElement('style');
|
|
227
|
+
cssFile.innerHTML = data;
|
|
228
|
+
if (stylingContainer) {
|
|
229
|
+
stylingContainer.appendChild(cssFile);
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
.catch((err) => {
|
|
233
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @name setStreamLibrary
|
|
239
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
240
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
241
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
242
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
243
|
+
*/
|
|
244
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
245
|
+
if (window.emMessageBus) {
|
|
246
|
+
const sheet = document.createElement('style');
|
|
247
|
+
|
|
248
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
249
|
+
sheet.innerHTML = data;
|
|
250
|
+
if (stylingContainer) {
|
|
251
|
+
stylingContainer.appendChild(sheet);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* @name isMobile
|
|
259
|
+
* @description A method that returns if the browser used to access the app is from a mobile device or not
|
|
260
|
+
* @param {String} userAgent window.navigator.userAgent
|
|
261
|
+
* @returns {Boolean} true or false
|
|
262
|
+
*/
|
|
263
|
+
const isMobile = (userAgent) => {
|
|
264
|
+
return !!(userAgent.toLowerCase().match(/android/i) ||
|
|
265
|
+
userAgent.toLowerCase().match(/blackberry|bb/i) ||
|
|
266
|
+
userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
|
|
267
|
+
userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
271
|
+
|
|
272
|
+
var dayjs_min = {exports: {}};
|
|
273
|
+
|
|
274
|
+
(function (module, exports) {
|
|
275
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
276
|
+
}(dayjs_min));
|
|
277
|
+
|
|
278
|
+
const dayjs = dayjs_min.exports;
|
|
279
|
+
|
|
280
|
+
const pamPlayerProfileCss = ":host {\n display: block;\n}\n\nbutton {\n font-family: var(--emw--button-typography);\n}\n\ninput, select, option {\n font-family: inherit;\n}\n\n.PamPlayerProfileWrapper {\n color: var(--emw--pam-typography, var(--emw-color-contrast, #07072A));\n background: var(--emw-color-pale, var(--emw--color-gray-50, #F1F1F1));\n padding: 50px;\n height: 100%;\n border-radius: var(--emw--border-radius-large, 10px);\n container-type: inline-size;\n opacity: 1;\n animation-name: fadeIn;\n animation-iteration-count: 1;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n.PamPlayerProfileWrapper .ReturnButton {\n display: none;\n}\n.PamPlayerProfileWrapper .HeaderText {\n font-size: var(--emw--font-size-x-large, 24px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n}\n.PamPlayerProfileWrapper .Section {\n background: var(--emw-color-pale, var(--emw--color-gray-100, #E6E6E6));\n border-radius: var(--emw--border-radius-large, 10px);\n padding: 10px;\n margin-bottom: 10px;\n}\n.PamPlayerProfileWrapper .Section .SectionTitle {\n font-size: var(--emw--font-size-large, 20px);\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n text-transform: capitalize;\n font-weight: var(--emw--font-weight-semibold, 500);\n padding: 0;\n border: 0;\n margin-top: 10px;\n margin-bottom: 10px;\n background: transparent;\n cursor: pointer;\n}\n.PamPlayerProfileWrapper .Section .SectionContent {\n display: grid;\n column-gap: 50px;\n row-gap: 25px;\n grid-template-rows: auto;\n grid-template-columns: 1fr 1fr;\n padding-bottom: 30px;\n margin-top: 10px;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field {\n width: 100%;\n display: flex;\n flex-direction: column;\n /* Chrome, Safari, Edge, Opera */\n /* Firefox */\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field label {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-semibold, 500);\n margin-bottom: 5px;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input {\n font-size: var(--emw--size-small, 14px);\n font-weight: var(--emw--font-weight-light, 300);\n color: var(--emw--pam-contrast, var(--emw-color-contrast, #07072A));\n padding: 10px;\n line-height: 16px;\n background: var(--emw-color-white, #FFFFFF);\n outline: none;\n transition-duration: var(--emw--transition-medium, 250ms);\n border: 1px solid var(--emw--color-gray-100, #353535);\n border-radius: var(--emw--border-radius-medium, 10px);\n width: 100%;\n box-sizing: border-box;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input:focus, .PamPlayerProfileWrapper .Section .SectionContent .Field input :focus-within, .PamPlayerProfileWrapper .Section .SectionContent .Field input :focus-visible, .PamPlayerProfileWrapper .Section .SectionContent .Field input :visited {\n border: 1px solid var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n box-shadow: 0 0 0 1pt var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input::-webkit-outer-spin-button,\n.PamPlayerProfileWrapper .Section .SectionContent .Field input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field input[type=number] {\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field.Invalid input {\n border: 1px solid var(--emw-color-error, var(--emw-color-red, #FD2839));\n background: var(--emw-color-pale, #FBECF4);\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field .Error {\n color: var(--emw-color-error, var(--emw-color-red, #FD2839));\n font-size: var(--emw--font-size-x-small, 12px);\n line-height: 10px;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .Field.Disabled input {\n opacity: 0.5;\n}\n.PamPlayerProfileWrapper .Section .SectionContent .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n}\n.PamPlayerProfileWrapper .ButtonsArea {\n grid-column-gap: 10px;\n grid-template-rows: auto;\n grid-template-columns: 1fr;\n margin-top: 20px;\n width: 50%;\n}\n.PamPlayerProfileWrapper .ButtonsArea .SaveButton {\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n cursor: pointer;\n background-image: linear-gradient(to bottom, color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, black 20%), var(--emw--color-primary, #22B04E), color-mix(in srgb, var(--emw--color-primary, #22B04E) 80%, white 30%));\n border: 2px solid var(--emw--button-border-color, #0E5924);\n color: var(--emw--button-text-color, #FFFFFF);\n border-radius: var(--emw--button-border-radius, 10px);\n font-size: var(--emw--size-standard, 16px);\n text-transform: uppercase;\n transition-duration: var(--emw--transition-medium, 250ms);\n max-width: 400px;\n min-width: 200px;\n padding: 13px 0;\n width: 100%;\n}\n.PamPlayerProfileWrapper .ButtonsArea .SaveButton:active {\n background: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n}\n.PamPlayerProfileWrapper .ButtonsArea .SaveButton.Disabled {\n opacity: 0.3;\n cursor: not-allowed;\n}\n.PamPlayerProfileWrapper.skeleton .ReturnButton {\n display: block;\n width: 200px;\n margin-top: 15px;\n margin-bottom: 20px;\n}\n.PamPlayerProfileWrapper.skeleton .Section .SectionContent {\n grid-template-columns: 50% 50%;\n overflow: hidden;\n}\n.PamPlayerProfileWrapper.skeleton .Section .SectionContent .Field {\n height: 55px;\n overflow: hidden;\n}\n.PamPlayerProfileWrapper.skeleton .ButtonsArea .SaveButton {\n width: 500px;\n border-radius: 30px;\n overflow: hidden;\n display: block;\n background-image: none;\n border: none;\n}\n@container (max-width: 425px) {\n .PamPlayerProfileWrapper {\n padding: 20px 15px;\n background: var(--emw-color-gray-50, #F9F8F8);\n max-width: unset;\n border-radius: var(--emw--border-radius-small, 5px);\n }\n .PamPlayerProfileWrapper .HeaderText {\n display: none;\n }\n .PamPlayerProfileWrapper .ReturnButton {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n display: inline-flex;\n align-items: center;\n column-gap: 10px;\n margin-bottom: 10px;\n }\n .PamPlayerProfileWrapper .ReturnButton svg {\n fill: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n }\n .PamPlayerProfileWrapper h2 {\n color: var(--emw--pam-color-primary, var(--emw--color-primary, #22B04E));\n font-size: var(--emw--font-size-large, 20px);\n font-weight: var(--emw--font-weight-semibold, 500);\n }\n .PamPlayerProfileWrapper .Section .SectionContent {\n row-gap: 15px;\n grid-template-columns: 1fr;\n }\n .PamPlayerProfileWrapper .Section .SectionTitle {\n margin-top: 5px;\n margin-bottom: 5px;\n font-size: var(--emw--font-size-medium, 16px);\n }\n .PamPlayerProfileWrapper .Section .Field label {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(-emw--font-weight-normal, 400);\n }\n .PamPlayerProfileWrapper .Section .Field input {\n color: var(--emw-color-gray-300, #58586B);\n font-size: var(--emw--size-x-small, 12px);\n font-weight: var(--emw--font-weight-light, 300);\n }\n .PamPlayerProfileWrapper .Section .CompoundField {\n width: 100%;\n display: flex;\n gap: 10px;\n flex-direction: row;\n }\n .PamPlayerProfileWrapper .ButtonsArea {\n grid-column-gap: 10px;\n width: 100%;\n grid-template-columns: 1fr 1fr;\n }\n .PamPlayerProfileWrapper .ButtonsArea .SaveButton {\n font-size: var(--emw--size-x-small, 12px);\n height: 40px;\n color: var(--emw-button-typography, var(--emw-color-white, #FFFFFF));\n }\n .PamPlayerProfileWrapper .ButtonsArea .SaveButton.Disabled {\n color: var(--emw-color-gray-300, #58586B);\n }\n .PamPlayerProfileWrapper.skeleton .Section .SectionContent {\n display: block;\n }\n .PamPlayerProfileWrapper.skeleton .Section .SectionContent .Field {\n margin-bottom: 15px;\n }\n .PamPlayerProfileWrapper.skeleton .ButtonsArea .SaveButton {\n width: 100%;\n height: 100%;\n border-radius: 20px;\n }\n}\n\n@keyframes fadeIn {\n 0% {\n opacity: 0.01;\n }\n 1% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n}";
|
|
281
|
+
const PamPlayerProfileStyle0 = pamPlayerProfileCss;
|
|
282
|
+
|
|
283
|
+
const PamPlayerProfile = class {
|
|
284
|
+
constructor(hostRef) {
|
|
285
|
+
index.registerInstance(this, hostRef);
|
|
286
|
+
this.fieldsState = {};
|
|
287
|
+
this.sendLoadedMessage = () => {
|
|
288
|
+
window.postMessage({ type: 'PROFILE_LOADED' });
|
|
289
|
+
};
|
|
290
|
+
this.sendValidMessage = () => {
|
|
291
|
+
window.postMessage({ type: 'PROFILE_VALIDITY', data: this.isSubmitButtonAvailable });
|
|
292
|
+
};
|
|
293
|
+
this.sendSuccessNotification = () => {
|
|
294
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMessage', this.lang) } }, window.location.href);
|
|
295
|
+
};
|
|
296
|
+
this.sendErrorNotification = (errorKey) => {
|
|
297
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: translate(errorKey, this.lang) } }, window.location.href);
|
|
298
|
+
};
|
|
299
|
+
this.sendData = () => {
|
|
300
|
+
delete this.data.contacts;
|
|
301
|
+
window.postMessage({ type: 'PROFILE_UPDATE_DATA', data: this.data }, window.location.href);
|
|
302
|
+
};
|
|
303
|
+
this.messageHandler = (message) => {
|
|
304
|
+
var _a;
|
|
305
|
+
switch ((_a = message.data) === null || _a === void 0 ? void 0 : _a.type) {
|
|
306
|
+
case 'PROFILE_DATA':
|
|
307
|
+
this.data = message.data.data;
|
|
308
|
+
this.resetState();
|
|
309
|
+
this.skeletonLoading = false;
|
|
310
|
+
break;
|
|
311
|
+
case 'PROFILE_SEND_DATA':
|
|
312
|
+
this.sendData();
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
this.getData = () => {
|
|
317
|
+
const url = new URL(`api/v1/players/${this.userId}/player-identifiable-information`, this.endpoint);
|
|
318
|
+
const headers = new Headers();
|
|
319
|
+
headers.append('X-SessionID', this.session);
|
|
320
|
+
const options = {
|
|
321
|
+
method: 'GET',
|
|
322
|
+
headers: headers
|
|
323
|
+
};
|
|
324
|
+
return new Promise((resolve) => {
|
|
325
|
+
fetch(url.href, options)
|
|
326
|
+
.then(res => {
|
|
327
|
+
if (res.ok) {
|
|
328
|
+
return res.json();
|
|
329
|
+
}
|
|
330
|
+
this.sendErrorNotification('errorMessageFetch');
|
|
331
|
+
})
|
|
332
|
+
.then(res => {
|
|
333
|
+
this.data = res.player;
|
|
334
|
+
resolve();
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
};
|
|
338
|
+
this.buildFieldState = (isValid, initialValue, rule) => Object.assign({ 'isValid': isValid, 'initialValue': initialValue, 'rule': rule });
|
|
339
|
+
this.initData = () => {
|
|
340
|
+
const data = {};
|
|
341
|
+
['externalPlayerId',
|
|
342
|
+
'affiliateMarker',
|
|
343
|
+
'personalInfo',
|
|
344
|
+
'communicationInfo',
|
|
345
|
+
'signupInfo',
|
|
346
|
+
'statusInfo',
|
|
347
|
+
'securityInfo',
|
|
348
|
+
'geographicInfo',
|
|
349
|
+
'playerInfo',
|
|
350
|
+
'contacts' // we need this because username is only sent in contacts section atm :(
|
|
351
|
+
].forEach(key => data[key] = this.data[key]);
|
|
352
|
+
this.data = data;
|
|
353
|
+
};
|
|
354
|
+
this.updateState = (sectionKey, fieldKey) => (e) => {
|
|
355
|
+
this.data[sectionKey][fieldKey] = e.target.value;
|
|
356
|
+
const fieldState = this.fieldsState['data'][fieldKey];
|
|
357
|
+
const value = e.target.value;
|
|
358
|
+
const passedRuleCheck = fieldState.rule(value);
|
|
359
|
+
if (passedRuleCheck && !fieldState.isValid) {
|
|
360
|
+
fieldState.isValid = true;
|
|
361
|
+
this.invalidFields -= 1;
|
|
362
|
+
}
|
|
363
|
+
else if (!passedRuleCheck && fieldState.isValid) {
|
|
364
|
+
fieldState.isValid = false;
|
|
365
|
+
this.invalidFields += 1;
|
|
366
|
+
}
|
|
367
|
+
this.fieldsState['hasChanged'] = value !== fieldState.initialValue;
|
|
368
|
+
const previous = this.isSubmitButtonAvailable;
|
|
369
|
+
this.updateSubmitButtonStatus();
|
|
370
|
+
if (this.isStandAlone !== 'true' && this.isSubmitButtonAvailable !== previous) {
|
|
371
|
+
this.sendValidMessage();
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
this.updateData = (e) => {
|
|
375
|
+
if (e)
|
|
376
|
+
e.preventDefault();
|
|
377
|
+
const url = new URL(`/api/v1/players/${this.userId}/player-identifiable-information`, this.endpoint);
|
|
378
|
+
const headers = new Headers();
|
|
379
|
+
headers.append('X-SessionId', this.session);
|
|
380
|
+
headers.append('Content-Type', 'application/problem+json; charset=utf-8');
|
|
381
|
+
if (this.data.contacts)
|
|
382
|
+
delete this.data.contacts;
|
|
383
|
+
const reqParams = {
|
|
384
|
+
method: 'PUT',
|
|
385
|
+
headers,
|
|
386
|
+
body: JSON.stringify(this.data)
|
|
387
|
+
};
|
|
388
|
+
fetch(url, reqParams)
|
|
389
|
+
.then(res => {
|
|
390
|
+
if (!res.ok) {
|
|
391
|
+
return this.sendErrorNotification('errorMessageUpdate');
|
|
392
|
+
}
|
|
393
|
+
this.sendSuccessNotification();
|
|
394
|
+
this.getData().then(() => this.resetState());
|
|
395
|
+
});
|
|
396
|
+
};
|
|
397
|
+
this.updateSubmitButtonStatus = () => {
|
|
398
|
+
this.isSubmitButtonAvailable = this.invalidFields === 0 && this.fieldsState.hasChanged;
|
|
399
|
+
};
|
|
400
|
+
this.editableField = (sectionKey, fieldKey, labelTranslationKey, errorTranslationKey) => {
|
|
401
|
+
const fieldState = this.fieldsState['data'][fieldKey];
|
|
402
|
+
const value = this.data[sectionKey][fieldKey];
|
|
403
|
+
if (fieldState) {
|
|
404
|
+
return (index.h("div", { class: `Field ${fieldState.isValid ? '' : 'Invalid'}` }, index.h("label", null, translate(labelTranslationKey, this.lang)), index.h("input", { type: "text", value: value, onKeyUp: this.updateState(sectionKey, fieldKey) }), !fieldState.isValid &&
|
|
405
|
+
index.h("p", { class: "Error" }, translate(errorTranslationKey, this.lang))));
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
this.staticField = (value, labelTranslationKey) => {
|
|
412
|
+
if (value) {
|
|
413
|
+
return (index.h("div", { class: "Field Disabled" }, index.h("label", null, translate(labelTranslationKey, this.lang)), index.h("input", { type: "text", value: value, readonly: true })));
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
return null;
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
this.toggleScreen = () => {
|
|
420
|
+
window.postMessage({ type: 'PlayerAccountMenuActive', isMobile: this.isMobile }, window.location.href);
|
|
421
|
+
};
|
|
422
|
+
this.userId = undefined;
|
|
423
|
+
this.session = undefined;
|
|
424
|
+
this.endpoint = undefined;
|
|
425
|
+
this.lang = 'en';
|
|
426
|
+
this.mbSource = undefined;
|
|
427
|
+
this.clientStyling = undefined;
|
|
428
|
+
this.clientStylingUrl = undefined;
|
|
429
|
+
this.translationUrl = undefined;
|
|
430
|
+
this.dobFormat = 'DD/MM/YYYY';
|
|
431
|
+
this.isStandAlone = 'true';
|
|
432
|
+
this.limitStylingAppends = false;
|
|
433
|
+
this.skeletonLoading = true;
|
|
434
|
+
this.isSubmitButtonAvailable = false;
|
|
435
|
+
this.invalidFields = 0;
|
|
436
|
+
this.isMobile = isMobile(window.navigator.userAgent);
|
|
437
|
+
}
|
|
438
|
+
handleStylingChange(newValue, oldValue) {
|
|
439
|
+
if (newValue !== oldValue)
|
|
440
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
441
|
+
}
|
|
442
|
+
handleStylingUrlChange(newValue, oldValue) {
|
|
443
|
+
if (newValue !== oldValue)
|
|
444
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
445
|
+
}
|
|
446
|
+
async componentWillLoad() {
|
|
447
|
+
if (this.isStandAlone !== 'true') {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
await this.getData()
|
|
451
|
+
.then(() => {
|
|
452
|
+
this.initData();
|
|
453
|
+
this.initEditableFieldsState();
|
|
454
|
+
})
|
|
455
|
+
.finally(() => this.skeletonLoading = false);
|
|
456
|
+
}
|
|
457
|
+
componentDidLoad() {
|
|
458
|
+
if (this.stylingContainer) {
|
|
459
|
+
if (window.emMessageBuss != undefined) {
|
|
460
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
if (this.clientStyling)
|
|
464
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
465
|
+
if (this.clientStylingUrl)
|
|
466
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (this.isStandAlone !== 'true') {
|
|
470
|
+
window.addEventListener('message', this.messageHandler, false);
|
|
471
|
+
this.sendLoadedMessage();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
disconnectedCallback() {
|
|
475
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
476
|
+
if (this.isStandAlone !== 'true')
|
|
477
|
+
window.removeEventListener('message', this.messageHandler, false);
|
|
478
|
+
}
|
|
479
|
+
initEditableFieldsState() {
|
|
480
|
+
var _a, _b;
|
|
481
|
+
this.fieldsState['data'] = {};
|
|
482
|
+
this.fieldsState['hasChanged'] = false;
|
|
483
|
+
if ((_a = this.data.playerInfo) === null || _a === void 0 ? void 0 : _a.SecurityQuestion) {
|
|
484
|
+
this.fieldsState['data']['SecurityQuestion'] = this.buildFieldState(true, this.data.playerInfo.SecurityQuestion, (val) => val && val.length <= 120);
|
|
485
|
+
}
|
|
486
|
+
if ((_b = this.data.playerInfo) === null || _b === void 0 ? void 0 : _b.SecurityAnswer) {
|
|
487
|
+
this.fieldsState['data']['SecurityAnswer'] = this.buildFieldState(true, this.data.playerInfo.SecurityAnswer, (val) => val && val.length <= 120);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
resetState() {
|
|
491
|
+
this.initData();
|
|
492
|
+
this.initEditableFieldsState();
|
|
493
|
+
this.invalidFields = 0;
|
|
494
|
+
this.isSubmitButtonAvailable = false;
|
|
495
|
+
}
|
|
496
|
+
render() {
|
|
497
|
+
return (index.h("div", { key: '0bfa140cc83e29e99e4af534700e5b009a88e9ac', ref: el => this.stylingContainer = el }, this.skeletonLoading
|
|
498
|
+
? index.h("form", { class: "PamPlayerProfileWrapper skeleton" }, index.h("div", { class: "ReturnButton" }, index.h("ui-skeleton", { structure: "title", width: "auto", height: "30px" })), index.h("div", { class: "Section" }, index.h("section", { class: "SectionContent" }, [...Array(6).keys()].map(() => index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), index.h("div", { class: "CompoundField" }, index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" })), index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "100%", height: "20px" }))), index.h("div", { class: "Field" }, index.h("ui-skeleton", { structure: "text", width: "auto", "margin-bottom": "10px", height: "10px" }), index.h("ui-skeleton", { structure: "rectangle", width: "auto", height: "20px" })))), index.h("section", { class: "ButtonsArea" }, index.h("div", { class: "SaveButton" }, index.h("ui-skeleton", { structure: "rectangle", width: "auto", height: "50px" }))))
|
|
499
|
+
: index.h("form", { class: `PamPlayerProfileWrapper ${this.isMobile ? 'Mobile' : ''}` }, index.h("div", { class: "ReturnButton", onClick: this.toggleScreen }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15" }, 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", null, translate('title', this.lang))), index.h("h2", { class: "HeaderText" }, translate('title', this.lang)), index.h("div", { class: "Section" }, index.h("section", { class: "SectionContent" }, this.staticField(this.data.contacts.find(c => c.contatcType = 'Username').contactValue, 'username'), this.staticField(dayjs(this.data.personalInfo.birthDate).format(this.dobFormat), 'dateOfBirth'), this.staticField(this.data.personalInfo.firstName, 'firstName'), this.staticField(this.data.personalInfo.lastName, 'lastName'), this.editableField('playerInfo', 'SecurityQuestion', 'securityQuestion', 'securityQuestionError'), this.editableField('playerInfo', 'SecurityAnswer', 'securityAnswer', 'securityAnswerError'), index.h("div", { class: "CompoundField" }, this.staticField(this.data.personalInfo.title, 'playerTitle'), this.staticField(this.data.personalInfo.gender, 'gender')), this.staticField(this.data.communicationInfo.currency, 'currency'))), this.isStandAlone === 'true' &&
|
|
500
|
+
index.h("section", { class: "ButtonsArea" }, index.h("button", { class: `SaveButton ${this.isSubmitButtonAvailable ? '' : 'Disabled'}`, onClick: this.updateData }, translate('saveButton'))))));
|
|
501
|
+
}
|
|
502
|
+
static get watchers() { return {
|
|
503
|
+
"clientStyling": ["handleStylingChange"],
|
|
504
|
+
"clientStylingUrl": ["handleStylingUrlChange"]
|
|
505
|
+
}; }
|
|
506
|
+
};
|
|
507
|
+
PamPlayerProfile.style = PamPlayerProfileStyle0;
|
|
508
|
+
|
|
509
|
+
exports.PamPlayerProfile = PamPlayerProfile;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-4130c9d2.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Stencil Client Patch Browser v4.19.2 | 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('pam-player-profile.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([["pam-player-profile_2.cjs",[[1,"pam-player-profile",{"userId":[513,"user-id"],"session":[513],"endpoint":[513],"lang":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"dobFormat":[513,"dob-format"],"isStandAlone":[513,"is-stand-alone"],"limitStylingAppends":[32],"skeletonLoading":[32],"isSubmitButtonAvailable":[32],"invalidFields":[32],"isMobile":[32]},null,{"clientStyling":["handleStylingChange"],"clientStylingUrl":["handleStylingUrlChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[2,"border-radius"],"marginBottom":[2,"margin-bottom"],"marginTop":[2,"margin-top"],"marginLeft":[2,"margin-left"],"marginRight":[2,"margin-right"],"animation":[4],"rows":[2],"size":[1],"color":[1],"primaryColor":[1,"primary-color"],"secondaryColor":[1,"secondary-color"]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|