@everymatrix/pam-forgot-password 1.65.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/checkbox-group-input_14.cjs.entry.js +12780 -0
- package/dist/cjs/index-92e25484.js +1322 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/pam-forgot-password-71bc2709.js +603 -0
- package/dist/cjs/pam-forgot-password.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +36 -0
- package/dist/collection/components/pam-forgot-password/index.js +1 -0
- package/dist/collection/components/pam-forgot-password/pam-forgot-password.css +152 -0
- package/dist/collection/components/pam-forgot-password/pam-forgot-password.js +461 -0
- package/dist/collection/components/pam-forgot-password/pam-forgot-password.stories.js +42 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +210 -0
- package/dist/collection/utils/types.js +1 -0
- package/dist/collection/utils/utils.js +20 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/checkbox-group-input_14.entry.js +12763 -0
- package/dist/esm/index-6f00d158.js +1293 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/pam-forgot-password-0f76562c.js +601 -0
- package/dist/esm/pam-forgot-password.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/pam-forgot-password/index.esm.js +1 -0
- package/dist/pam-forgot-password/p-587a67ef.entry.js +5614 -0
- package/dist/pam-forgot-password/p-e1255160.js +1 -0
- package/dist/pam-forgot-password/p-f10ac9f7.js +1 -0
- package/dist/pam-forgot-password/p-f5cf4939.js +2 -0
- package/dist/pam-forgot-password/pam-forgot-password.esm.js +1 -0
- package/dist/stencil.config.dev.js +17 -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-forgot-password/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/packages/stencil/pam-forgot-password/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/packages/stencil/pam-forgot-password/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/packages/stencil/pam-forgot-password/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/packages/stencil/pam-forgot-password/storybook/preview.d.ts +70 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/tools/plugins/index.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-forgot-password/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/pam-forgot-password/index.d.ts +1 -0
- package/dist/types/components/pam-forgot-password/pam-forgot-password.d.ts +144 -0
- package/dist/types/components/pam-forgot-password/pam-forgot-password.stories.d.ts +5 -0
- package/dist/types/components.d.ts +79 -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 +2 -0
- package/dist/types/utils/types.d.ts +45 -0
- package/dist/types/utils/utils.d.ts +2 -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,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const pamForgotPassword = require('./pam-forgot-password-71bc2709.js');
|
|
6
|
+
require('./index-92e25484.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.PamForgotPassword = pamForgotPassword.PamForgotPassword;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-92e25484.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([["checkbox-group-input_14.cjs",[[1,"pam-forgot-password",{"endpoint":[513],"language":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[1,"mb-source"],"translationUrl":[513,"translation-url"],"contactType":[32],"isBtnSubmitEnabled":[32],"skeletonLoading":[32],"hasError":[32],"isMobile":[32],"captchaData":[32],"errorMessage":[32]},[[0,"sendValidityState","sendValidityStateHandler"],[0,"sendInputValue","sendInputValueHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"]}],[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"]}],[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[520,"client-styling"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"],"emitOnClick":[516,"emit-on-click"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"showFields":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"]}],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32],"selectedValues":[32],"showCheckboxes":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"selectedValues":["setValue"],"emitValue":["emitValueHandler"]}],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"emitOnClick":[516,"emit-on-click"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32],"value":[32]},[[16,"sendOriginalValidityState","originalValidityChangedHandler"],[16,"sendInputValue","valueChangedHandler"],[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"value":["valueChanged"],"emitValue":["emitValueHandler"]}],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"errorMessage":[32],"isValid":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"isValid":[32],"errorMessage":[32],"limitStylingAppends":[32],"showTooltip":[32]},[[4,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"],[16,"validationChange","handleValidationChange"]],{"clientStyling":["handleStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}]]]], options);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
15
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-92e25484.js');
|
|
4
|
+
|
|
5
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
6
|
+
const TRANSLATIONS = {
|
|
7
|
+
en: {
|
|
8
|
+
"title": "Forgot Password",
|
|
9
|
+
"dropdownDisplayName": "Contact",
|
|
10
|
+
"telDisplayName": "Phone Number",
|
|
11
|
+
"telPlaceholder": "0000000000",
|
|
12
|
+
"emailDisplayName": "Email",
|
|
13
|
+
"emailPlaceholder": "Enter your email",
|
|
14
|
+
"usernameDisplayName": "Username",
|
|
15
|
+
"usernamePlaceholder": "Enter your username",
|
|
16
|
+
"firstNameDisplayName": "First Name",
|
|
17
|
+
"firstNamePlaceholder": "Enter your first name",
|
|
18
|
+
"dateOfBirthDisplayName": "Date of Birth",
|
|
19
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
20
|
+
"loading": "Loading ...",
|
|
21
|
+
"submitError": "Something went wrong. Please try again later",
|
|
22
|
+
"configError": "Something went wrong. Please try again later",
|
|
23
|
+
"successMsg": "If your account exists, a reset link is on its way",
|
|
24
|
+
"btnSubmit": "submit",
|
|
25
|
+
"sms": "sms",
|
|
26
|
+
"email": "email"
|
|
27
|
+
},
|
|
28
|
+
ro: {
|
|
29
|
+
"title": "Parolă uitată",
|
|
30
|
+
"dropdownDisplayName": "Contact",
|
|
31
|
+
"telDisplayName": "Număr de telefon",
|
|
32
|
+
"telPlaceholder": "0000000000",
|
|
33
|
+
"emailDisplayName": "Email",
|
|
34
|
+
"emailPlaceholder": "Introduceți emailul dvs.",
|
|
35
|
+
"usernameDisplayName": "Nume de utilizator",
|
|
36
|
+
"usernamePlaceholder": "Introduceți numele dvs. de utilizator",
|
|
37
|
+
"firstNameDisplayName": "Prenume",
|
|
38
|
+
"firstNamePlaceholder": "Introduceți prenumele dvs.",
|
|
39
|
+
"dateOfBirthDisplayName": "Data nașterii",
|
|
40
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
41
|
+
"loading": "Se încarcă ...",
|
|
42
|
+
"submitError": "Ceva nu a mers bine. Vă rugăm să încercați din nou mai târziu",
|
|
43
|
+
"configError": "Ceva nu a mers bine. Vă rugăm să încercați din nou mai târziu",
|
|
44
|
+
"successMsg": "Dacă contul dvs. există, un link de resetare este va fi trimis",
|
|
45
|
+
"btnSubmit": "Trimite",
|
|
46
|
+
"sms": "sms",
|
|
47
|
+
"email": "email"
|
|
48
|
+
},
|
|
49
|
+
fr: {
|
|
50
|
+
"title": "Mot de passe oublié",
|
|
51
|
+
"dropdownDisplayName": "Contact",
|
|
52
|
+
"telDisplayName": "Numéro de téléphone",
|
|
53
|
+
"telPlaceholder": "0000000000",
|
|
54
|
+
"emailDisplayName": "Email",
|
|
55
|
+
"emailPlaceholder": "Entrez votre email",
|
|
56
|
+
"usernameDisplayName": "Nom d'utilisateur",
|
|
57
|
+
"usernamePlaceholder": "Entrez votre nom d'utilisateur",
|
|
58
|
+
"firstNameDisplayName": "Prénom",
|
|
59
|
+
"firstNamePlaceholder": "Entrez votre prénom",
|
|
60
|
+
"dateOfBirthDisplayName": "Date de naissance",
|
|
61
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
62
|
+
"loading": "Chargement ...",
|
|
63
|
+
"submitError": "Un problème est survenu. Veuillez réessayer plus tard",
|
|
64
|
+
"configError": "Un problème est survenu. Veuillez réessayer plus tard",
|
|
65
|
+
"successMsg": "Si votre compte existe, un lien de réinitialisation est en route",
|
|
66
|
+
"btnSubmit": "soumettre",
|
|
67
|
+
"sms": "sms",
|
|
68
|
+
"email": "email"
|
|
69
|
+
},
|
|
70
|
+
hu: {
|
|
71
|
+
"title": "Elfelejtett jelszó",
|
|
72
|
+
"dropdownDisplayName": "Kapcsolat",
|
|
73
|
+
"telDisplayName": "Telefonszám",
|
|
74
|
+
"telPlaceholder": "0000000000",
|
|
75
|
+
"emailDisplayName": "Email",
|
|
76
|
+
"emailPlaceholder": "Adja meg az email címét",
|
|
77
|
+
"usernameDisplayName": "Felhasználónév",
|
|
78
|
+
"usernamePlaceholder": "Adja meg a felhasználónevét",
|
|
79
|
+
"firstNameDisplayName": "Keresztnév",
|
|
80
|
+
"firstNamePlaceholder": "Adja meg a keresztnevét",
|
|
81
|
+
"dateOfBirthDisplayName": "Születési dátum",
|
|
82
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
83
|
+
"loading": "Betöltés ...",
|
|
84
|
+
"submitError": "Valami hiba történt. Kérjük, próbálja meg később",
|
|
85
|
+
"configError": "Valami hiba történt. Kérjük, próbálja meg később",
|
|
86
|
+
"successMsg": "Ha létezik a fiókja, egy visszaállítási link úton van",
|
|
87
|
+
"btnSubmit": "Beküldés",
|
|
88
|
+
"sms": "sms",
|
|
89
|
+
"email": "email"
|
|
90
|
+
},
|
|
91
|
+
tr: {
|
|
92
|
+
"title": "Şifremi Unuttum",
|
|
93
|
+
"dropdownDisplayName": "İletişim",
|
|
94
|
+
"telDisplayName": "Telefon Numarası",
|
|
95
|
+
"telPlaceholder": "0000000000",
|
|
96
|
+
"emailDisplayName": "E-posta",
|
|
97
|
+
"emailPlaceholder": "E-postanızı girin",
|
|
98
|
+
"usernameDisplayName": "Kullanıcı Adı",
|
|
99
|
+
"usernamePlaceholder": "Kullanıcı adınızı girin",
|
|
100
|
+
"firstNameDisplayName": "İsim",
|
|
101
|
+
"firstNamePlaceholder": "İsminizi girin",
|
|
102
|
+
"dateOfBirthDisplayName": "Doğum Tarihi",
|
|
103
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
104
|
+
"loading": "Yükleniyor ...",
|
|
105
|
+
"submitError": "Bir şeyler ters gitti. Lütfen daha sonra tekrar deneyin",
|
|
106
|
+
"configError": "Bir şeyler ters gitti. Lütfen daha sonra tekrar deneyin",
|
|
107
|
+
"successMsg": "Hesabınız varsa, bir sıfırlama bağlantısı yolda",
|
|
108
|
+
"btnSubmit": "Gönder",
|
|
109
|
+
"sms": "sms",
|
|
110
|
+
"email": "e-posta"
|
|
111
|
+
},
|
|
112
|
+
el: {
|
|
113
|
+
"title": "Ξεχάσατε τον κωδικό;",
|
|
114
|
+
"dropdownDisplayName": "Επικοινωνία",
|
|
115
|
+
"telDisplayName": "Αριθμός τηλεφώνου",
|
|
116
|
+
"telPlaceholder": "0000000000",
|
|
117
|
+
"emailDisplayName": "Email",
|
|
118
|
+
"emailPlaceholder": "Εισάγετε το email σας",
|
|
119
|
+
"usernameDisplayName": "Όνομα χρήστη",
|
|
120
|
+
"usernamePlaceholder": "Εισάγετε το όνομα χρήστη σας",
|
|
121
|
+
"firstNameDisplayName": "Όνομα",
|
|
122
|
+
"firstNamePlaceholder": "Εισάγετε το όνομά σας",
|
|
123
|
+
"dateOfBirthDisplayName": "Ημερομηνία γέννησης",
|
|
124
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
125
|
+
"loading": "Φόρτωση ...",
|
|
126
|
+
"submitError": "Κάτι πήγε στραβά. Παρακαλούμε δοκιμάστε ξανά αργότερα",
|
|
127
|
+
"configError": "Κάτι πήγε στραβά. Παρακαλούμε δοκιμάστε ξανά αργότερα",
|
|
128
|
+
"successMsg": "Αν ο λογαριασμός σας υπάρχει, ένας σύνδεσμος επαναφοράς είναι καθ' οδόν",
|
|
129
|
+
"btnSubmit": "υποβάλλουν",
|
|
130
|
+
"sms": "sms",
|
|
131
|
+
"email": "email"
|
|
132
|
+
},
|
|
133
|
+
es: {
|
|
134
|
+
"title": "Olvidé mi contraseña",
|
|
135
|
+
"dropdownDisplayName": "Contacto",
|
|
136
|
+
"telDisplayName": "Número de teléfono",
|
|
137
|
+
"telPlaceholder": "0000000000",
|
|
138
|
+
"emailDisplayName": "Correo electrónico",
|
|
139
|
+
"emailPlaceholder": "Introduce tu correo electrónico",
|
|
140
|
+
"usernameDisplayName": "Nombre de usuario",
|
|
141
|
+
"usernamePlaceholder": "Introduce tu nombre de usuario",
|
|
142
|
+
"firstNameDisplayName": "Nombre",
|
|
143
|
+
"firstNamePlaceholder": "Introduce tu nombre",
|
|
144
|
+
"dateOfBirthDisplayName": "Fecha de nacimiento",
|
|
145
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
146
|
+
"loading": "Cargando ...",
|
|
147
|
+
"submitError": "Algo salió mal. Por favor, inténtalo de nuevo más tarde",
|
|
148
|
+
"configError": "Algo salió mal. Por favor, inténtalo de nuevo más tarde",
|
|
149
|
+
"successMsg": "Si tu cuenta existe, un enlace de restablecimiento está en camino",
|
|
150
|
+
"btnSubmit": "enviar",
|
|
151
|
+
"sms": "sms",
|
|
152
|
+
"email": "email"
|
|
153
|
+
},
|
|
154
|
+
pt: {
|
|
155
|
+
"title": "Esqueci a Senha",
|
|
156
|
+
"dropdownDisplayName": "Contato",
|
|
157
|
+
"telDisplayName": "Número de Telefone",
|
|
158
|
+
"telPlaceholder": "0000000000",
|
|
159
|
+
"emailDisplayName": "Email",
|
|
160
|
+
"emailPlaceholder": "Digite seu email",
|
|
161
|
+
"usernameDisplayName": "Nome de Usuário",
|
|
162
|
+
"usernamePlaceholder": "Digite seu nome de usuário",
|
|
163
|
+
"firstNameDisplayName": "Nome",
|
|
164
|
+
"firstNamePlaceholder": "Digite seu nome",
|
|
165
|
+
"dateOfBirthDisplayName": "Data de Nascimento",
|
|
166
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
167
|
+
"loading": "Carregando ...",
|
|
168
|
+
"submitError": "Algo deu errado. Por favor, tente novamente mais tarde",
|
|
169
|
+
"configError": "Algo deu errado. Por favor, tente novamente mais tarde",
|
|
170
|
+
"successMsg": "Se sua conta existir, um link de redefinição está a caminho",
|
|
171
|
+
"btnSubmit": "enviar",
|
|
172
|
+
"sms": "sms",
|
|
173
|
+
"email": "email"
|
|
174
|
+
},
|
|
175
|
+
hr: {
|
|
176
|
+
"title": "Zaboravljena lozinka",
|
|
177
|
+
"dropdownDisplayName": "Kontakt",
|
|
178
|
+
"telDisplayName": "Broj telefona",
|
|
179
|
+
"telPlaceholder": "0000000000",
|
|
180
|
+
"emailDisplayName": "E-mail",
|
|
181
|
+
"emailPlaceholder": "Unesite svoj e-mail",
|
|
182
|
+
"usernameDisplayName": "Korisničko ime",
|
|
183
|
+
"usernamePlaceholder": "Unesite svoje korisničko ime",
|
|
184
|
+
"firstNameDisplayName": "Ime",
|
|
185
|
+
"firstNamePlaceholder": "Unesite svoje ime",
|
|
186
|
+
"dateOfBirthDisplayName": "Datum rođenja",
|
|
187
|
+
"dateOfBirthPlaceholder": "1911-11-11",
|
|
188
|
+
"loading": "Učitavanje ...",
|
|
189
|
+
"submitError": "Nešto je pošlo po zlu. Molimo pokušajte ponovno kasnije",
|
|
190
|
+
"configError": "Nešto je pošlo po zlu. Molimo pokušajte ponovno kasnije",
|
|
191
|
+
"successMsg": "Ako vaš račun postoji, poveznica za poništavanje lozinke je na putu",
|
|
192
|
+
"btnSubmit": "pošalji",
|
|
193
|
+
"sms": "sms",
|
|
194
|
+
"email": "email"
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
const getTranslations = (url) => {
|
|
198
|
+
return new Promise((resolve) => {
|
|
199
|
+
fetch(url)
|
|
200
|
+
.then((res) => res.json())
|
|
201
|
+
.then((data) => {
|
|
202
|
+
Object.keys(data).forEach((item) => {
|
|
203
|
+
for (let key in data[item]) {
|
|
204
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
resolve(true);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
const translate = (key, customLang) => {
|
|
212
|
+
const lang = customLang;
|
|
213
|
+
return TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
function checkDeviceType() {
|
|
217
|
+
const userAgent = navigator.userAgent.toLowerCase();
|
|
218
|
+
const width = screen.availWidth;
|
|
219
|
+
const height = screen.availHeight;
|
|
220
|
+
if (userAgent.includes('iphone')) {
|
|
221
|
+
return 'mobile';
|
|
222
|
+
}
|
|
223
|
+
if (userAgent.includes('android')) {
|
|
224
|
+
if (height > width && width < 800) {
|
|
225
|
+
return 'mobile';
|
|
226
|
+
}
|
|
227
|
+
if (width > height && height < 800) {
|
|
228
|
+
return 'tablet';
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return 'desktop';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @name setClientStyling
|
|
236
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
237
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
238
|
+
* @param {string} clientStyling The style content
|
|
239
|
+
*/
|
|
240
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
241
|
+
if (stylingContainer) {
|
|
242
|
+
const sheet = document.createElement('style');
|
|
243
|
+
sheet.innerHTML = clientStyling;
|
|
244
|
+
stylingContainer.appendChild(sheet);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @name setClientStylingURL
|
|
250
|
+
* @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
|
|
251
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
252
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
253
|
+
*/
|
|
254
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
255
|
+
const url = new URL(clientStylingUrl);
|
|
256
|
+
|
|
257
|
+
fetch(url.href)
|
|
258
|
+
.then((res) => res.text())
|
|
259
|
+
.then((data) => {
|
|
260
|
+
const cssFile = document.createElement('style');
|
|
261
|
+
cssFile.innerHTML = data;
|
|
262
|
+
if (stylingContainer) {
|
|
263
|
+
stylingContainer.appendChild(cssFile);
|
|
264
|
+
}
|
|
265
|
+
})
|
|
266
|
+
.catch((err) => {
|
|
267
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @name setStreamLibrary
|
|
273
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
274
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
275
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
276
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
277
|
+
*/
|
|
278
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
279
|
+
if (window.emMessageBus) {
|
|
280
|
+
const sheet = document.createElement('style');
|
|
281
|
+
|
|
282
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
283
|
+
sheet.innerHTML = data;
|
|
284
|
+
if (stylingContainer) {
|
|
285
|
+
stylingContainer.appendChild(sheet);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const pamForgotPasswordCss = "::host {\n display: block;\n}\n\n.PlayerForgotPassword {\n font-family: inherit;\n width: 100%;\n height: 100%;\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 container-type: inline-size;\n}\n.PlayerForgotPassword .Error {\n font-size: var(--emw--font-size-x-small, 12px);\n color: var(--emw--color-error, #ed0909);\n}\n.PlayerForgotPassword .Loading {\n font-size: var(--emw--font-size-x-small, 12px);\n color: var(--emw--color-primary, #22B04E);\n}\n.PlayerForgotPassword .Title {\n background-color: transparent;\n font-size: var(--emw--font-size-x-large, 26px);\n color: var(--emw--color-primary, #22B04E);\n font-weight: var(--emw--font-weight-semibold, 500);\n}\n.PlayerForgotPassword .TitleMobile {\n font-size: var(--emw--font-size-x-large, 20px);\n color: var(--emw--color-primary, #22B04E);\n}\n.PlayerForgotPassword svg {\n fill: var(--emw--color-primary, #22B04E);\n}\n.PlayerForgotPassword .ButtonReturn {\n display: none;\n font-family: inherit;\n align-items: center;\n gap: 10px;\n}\n.PlayerForgotPassword .Form {\n display: grid;\n grid-template-columns: repeat(1, 1fr);\n gap: 40px;\n justify-items: stretch;\n align-content: flex-start;\n overflow: auto;\n width: 100%;\n height: 100%;\n}\n.PlayerForgotPassword .Form .FieldsSection {\n display: flex;\n flex-direction: column;\n gap: 30px;\n}\n.PlayerForgotPassword .Form .ContactWrapper {\n display: flex;\n flex-direction: row;\n width: 100%;\n gap: 5px;\n}\n.PlayerForgotPassword .Form .ContactWrapper .Select {\n width: 25%;\n}\n.PlayerForgotPassword .Form .ContactWrapper .Contact {\n width: 100%;\n}\n.PlayerForgotPassword .Form .ContactWrapperMobile {\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: 30px;\n}\n.PlayerForgotPassword .Form .ContactWrapperMobile .Select {\n width: 100%;\n}\n.PlayerForgotPassword .Form .ContactWrapperMobile .Contact {\n width: 100%;\n}\n.PlayerForgotPassword .Form .ButtonsSection {\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n align-items: center;\n position: relative;\n}\n.PlayerForgotPassword .Button {\n font-family: inherit;\n border-radius: var(--emw--button-border-radius, var(--emw--border-radius-large, 50px));\n background: var(--emw--button-background-color, var(--emw--color-primary, #22B04E));\n border: var(--emw--button-border, 1px solid var(--emw--button-border-color, #22B04E));\n color: var(--emw--button-text-color, var(--emw--color-white, #FFFFFF));\n font-size: var(--emw--font-size-large, 20px);\n font-weight: var(--emw--font-weight-normal, 400);\n height: 50px;\n width: 100%;\n text-transform: uppercase;\n cursor: pointer;\n}\n.PlayerForgotPassword .Button:disabled {\n background: var(--emw--color-gray-100, #E6E6E6);\n border: var(--emw--button-border, 1px solid var(--emw--button-border-color, #828282));\n pointer-events: none;\n cursor: not-allowed;\n}\n.PlayerForgotPassword.skeleton .Form .ButtonReturn {\n width: 150px;\n height: 30px;\n margin-top: 15px;\n display: block;\n}\n.PlayerForgotPassword.skeleton .Form .FieldsSection {\n display: block;\n}\n.PlayerForgotPassword.skeleton .Form .FieldsSection .FieldContainer .FieldTitle {\n width: 100px;\n margin-top: 30px;\n margin-bottom: 15px;\n}\n.PlayerForgotPassword.skeleton .Form .ButtonsSection .Button {\n font-family: inherit;\n border-radius: 50px;\n background: transparent;\n border: none;\n overflow: hidden;\n}\n@container (max-width: 425px) {\n .PlayerForgotPassword .Form .ButtonReturn {\n display: inline-flex;\n }\n .PlayerForgotPassword .Form .Title {\n display: none;\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}";
|
|
292
|
+
const PamForgotPasswordStyle0 = pamForgotPasswordCss;
|
|
293
|
+
|
|
294
|
+
const PamForgotPassword = class {
|
|
295
|
+
constructor(hostRef) {
|
|
296
|
+
index.registerInstance(this, hostRef);
|
|
297
|
+
this.isContactValid = false;
|
|
298
|
+
this.validation = { mandatory: true, custom: [] };
|
|
299
|
+
/**
|
|
300
|
+
* Handles the submission of the forgot password request.
|
|
301
|
+
*
|
|
302
|
+
* @param e - The event object from the form submission.
|
|
303
|
+
*/
|
|
304
|
+
this.submitRequest = (e) => {
|
|
305
|
+
e.preventDefault();
|
|
306
|
+
// Construct the request URL
|
|
307
|
+
const url = new URL('/api/v1/players/password-management/password/forgot/request', this.endpoint);
|
|
308
|
+
// Set up request headers
|
|
309
|
+
const headers = new Headers();
|
|
310
|
+
if (this.captchaData.isEnabled && this.captchaData.token) {
|
|
311
|
+
headers.append('X-Captcha-Response', this.captchaData.token);
|
|
312
|
+
}
|
|
313
|
+
headers.append('Content-Type', 'application/json');
|
|
314
|
+
// Create the request body
|
|
315
|
+
const requestBody = JSON.stringify({ contact: this.contact });
|
|
316
|
+
// Define request parameters
|
|
317
|
+
const requestParams = {
|
|
318
|
+
method: 'POST',
|
|
319
|
+
headers: headers,
|
|
320
|
+
body: requestBody,
|
|
321
|
+
};
|
|
322
|
+
// Send the request
|
|
323
|
+
fetch(url.href, requestParams)
|
|
324
|
+
.then((response) => response.json())
|
|
325
|
+
.then((data) => {
|
|
326
|
+
if (!data.errorCode) {
|
|
327
|
+
// Success: Notify the parent window
|
|
328
|
+
window.postMessage({ type: 'ForgotPasswordSuccess' });
|
|
329
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'success', message: translate('successMsg', this.language) } }, window.location.href);
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
// API responded with an error
|
|
333
|
+
this.sendErrorNotification(translate('submitError', this.language));
|
|
334
|
+
}
|
|
335
|
+
})
|
|
336
|
+
.catch(() => {
|
|
337
|
+
// Network or server error
|
|
338
|
+
this.sendErrorNotification(translate('submitError', this.language));
|
|
339
|
+
});
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Toggles the player account menu visibility.
|
|
343
|
+
*
|
|
344
|
+
* Sends a post message to notify that the player account menu has been activated.
|
|
345
|
+
*/
|
|
346
|
+
this.toggleScreen = () => {
|
|
347
|
+
window.postMessage({ type: 'PlayerAccountMenuActive', isMobile: this.isMobile }, window.location.href);
|
|
348
|
+
};
|
|
349
|
+
this.endpoint = undefined;
|
|
350
|
+
this.language = undefined;
|
|
351
|
+
this.clientStyling = undefined;
|
|
352
|
+
this.clientStylingUrl = undefined;
|
|
353
|
+
this.mbSource = undefined;
|
|
354
|
+
this.translationUrl = undefined;
|
|
355
|
+
this.contactType = '';
|
|
356
|
+
this.isBtnSubmitEnabled = false;
|
|
357
|
+
this.skeletonLoading = true;
|
|
358
|
+
this.hasError = false;
|
|
359
|
+
this.isMobile = checkDeviceType() === 'mobile' || checkDeviceType() === 'tablet';
|
|
360
|
+
this.captchaData = {
|
|
361
|
+
isEnabled: true,
|
|
362
|
+
token: '',
|
|
363
|
+
provider: '',
|
|
364
|
+
siteKey: ''
|
|
365
|
+
};
|
|
366
|
+
this.errorMessage = '';
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Checks for input validity and set the flags accordingly.
|
|
370
|
+
*/
|
|
371
|
+
sendValidityStateHandler(e) {
|
|
372
|
+
if (e.detail.name === 'contact') {
|
|
373
|
+
this.isContactValid = e.detail.valid;
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Handles the 'sendInputValue' event to update component state based on the input field name.
|
|
379
|
+
*
|
|
380
|
+
* This function listens for a custom event that carries input values and updates corresponding properties:
|
|
381
|
+
* - Updates `contactType` if the input name is 'dropdown'.
|
|
382
|
+
* - Parses and assigns `contact` if the input name is 'contact' (handles phone numbers separately).
|
|
383
|
+
*
|
|
384
|
+
* Also determines whether the submit button should be enabled based on the validity of the inputs.
|
|
385
|
+
*
|
|
386
|
+
* @param {CustomEvent<InputValueEvent>} e - The custom event containing input details.
|
|
387
|
+
*/
|
|
388
|
+
sendInputValueHandler(e) {
|
|
389
|
+
switch (e.detail.name) {
|
|
390
|
+
case 'dropdown':
|
|
391
|
+
this.contactType = e.detail.value.toLowerCase();
|
|
392
|
+
break;
|
|
393
|
+
case 'contact':
|
|
394
|
+
this.contact = e.detail.value;
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
this.updateSubmitButtonState();
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Updates the state of the submit button based on form validation rules.
|
|
401
|
+
*
|
|
402
|
+
* The button is enabled only if:
|
|
403
|
+
* - The contact (email) input is valid.
|
|
404
|
+
* - CAPTCHA is either disabled or has a valid token.
|
|
405
|
+
*/
|
|
406
|
+
updateSubmitButtonState() {
|
|
407
|
+
this.isBtnSubmitEnabled = this.isContactValid &&
|
|
408
|
+
!!this.contact &&
|
|
409
|
+
(!this.captchaData.isEnabled || !!this.captchaData.token);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Watch for changes in the client styling and apply the new styling
|
|
413
|
+
*
|
|
414
|
+
* @param newValue - new client styling
|
|
415
|
+
* @param oldValue - previous client styling
|
|
416
|
+
*/
|
|
417
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
418
|
+
if (newValue != oldValue) {
|
|
419
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Watch for changes in the client styling URL and fetch the new CSS
|
|
424
|
+
*
|
|
425
|
+
* @param newValue - new client styling URL
|
|
426
|
+
* @param oldValue - previous client styling URL
|
|
427
|
+
*/
|
|
428
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
429
|
+
if (newValue != oldValue) {
|
|
430
|
+
if (this.clientStylingUrl)
|
|
431
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Send error notification as a post message
|
|
436
|
+
*/
|
|
437
|
+
sendErrorNotification(errorMessage) {
|
|
438
|
+
window.postMessage({ type: "HasError", error: errorMessage }, window.location.href);
|
|
439
|
+
window.postMessage({
|
|
440
|
+
type: 'WidgetNotification', data: {
|
|
441
|
+
type: 'error',
|
|
442
|
+
message: errorMessage
|
|
443
|
+
}
|
|
444
|
+
}, window.location.href);
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Get the translations and get the configuration.
|
|
448
|
+
*
|
|
449
|
+
* Called once just after the component is first connected to the DOM.
|
|
450
|
+
*/
|
|
451
|
+
async componentWillLoad() {
|
|
452
|
+
// Get translations
|
|
453
|
+
if (this.translationUrl) {
|
|
454
|
+
await getTranslations(this.translationUrl);
|
|
455
|
+
}
|
|
456
|
+
// Get widget config
|
|
457
|
+
this.getConfig().then(() => {
|
|
458
|
+
this.appendCaptchaScript();
|
|
459
|
+
}).catch((error) => {
|
|
460
|
+
console.error(error);
|
|
461
|
+
this.hasError = true;
|
|
462
|
+
this.errorMessage = translate('configError', this.language);
|
|
463
|
+
this.sendErrorNotification(this.errorMessage);
|
|
464
|
+
}).finally(() => {
|
|
465
|
+
this.skeletonLoading = false;
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Set the styling for the widget once it's loaded.
|
|
470
|
+
*
|
|
471
|
+
* Called once just after the component is fully loaded and the first render() occurs.
|
|
472
|
+
*/
|
|
473
|
+
componentDidLoad() {
|
|
474
|
+
if (this.stylingContainer) {
|
|
475
|
+
if (window.emMessageBus != undefined) {
|
|
476
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
if (this.clientStyling)
|
|
480
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
481
|
+
if (this.clientStylingUrl)
|
|
482
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Fetches the forgot password configuration from the backend API.
|
|
488
|
+
*
|
|
489
|
+
* @returns A Promise that resolves once the configuration is fetched and set.
|
|
490
|
+
*/
|
|
491
|
+
getConfig() {
|
|
492
|
+
const url = new URL('/api/v1/players/password-management/password/forgot/config', this.endpoint);
|
|
493
|
+
return new Promise((resolve, reject) => {
|
|
494
|
+
fetch(url.href)
|
|
495
|
+
.then((res) => {
|
|
496
|
+
if (!res.ok) {
|
|
497
|
+
throw new Error(`HTTP error! Status: ${res.status}`);
|
|
498
|
+
}
|
|
499
|
+
return res.json();
|
|
500
|
+
})
|
|
501
|
+
.then((res) => {
|
|
502
|
+
const { captcha } = res;
|
|
503
|
+
if (captcha && typeof captcha.provider === 'string') {
|
|
504
|
+
captcha.provider = captcha.provider.toLowerCase();
|
|
505
|
+
}
|
|
506
|
+
this.captchaData = Object.assign({}, captcha);
|
|
507
|
+
resolve();
|
|
508
|
+
})
|
|
509
|
+
.catch((error) => {
|
|
510
|
+
console.error('Error fetching login configuration:', error);
|
|
511
|
+
reject(error);
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Dynamically loads the captcha script and renders it when ready.
|
|
517
|
+
*
|
|
518
|
+
* @param src - The URL of the CAPTCHA script to load.
|
|
519
|
+
* @param captcha - The CAPTCHA configuration.
|
|
520
|
+
*/
|
|
521
|
+
appendCaptchaScript() {
|
|
522
|
+
const { isEnabled, provider } = this.captchaData;
|
|
523
|
+
if (!isEnabled) {
|
|
524
|
+
return;
|
|
525
|
+
}
|
|
526
|
+
const script = document.createElement('script');
|
|
527
|
+
if (provider === 'cloudflare') {
|
|
528
|
+
script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
|
|
529
|
+
}
|
|
530
|
+
else if (provider === 'google') {
|
|
531
|
+
script.src = 'https://www.google.com/recaptcha/api.js';
|
|
532
|
+
}
|
|
533
|
+
script.onload = this.handleCaptcha.bind(this);
|
|
534
|
+
document.head.appendChild(script);
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Handles the integration of CAPTCHA based on the login configuration.
|
|
538
|
+
* Dynamically injects the necessary CAPTCHA script if enabled.
|
|
539
|
+
*/
|
|
540
|
+
handleCaptcha() {
|
|
541
|
+
const { isEnabled, provider, siteKey } = this.captchaData;
|
|
542
|
+
if (!isEnabled) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
if (!['cloudflare', 'google'].includes(provider)) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
if (provider === 'cloudflare') {
|
|
549
|
+
window.turnstile.render('#turnstileContainer', {
|
|
550
|
+
sitekey: siteKey,
|
|
551
|
+
theme: 'light',
|
|
552
|
+
callback: this.captchaCallback.bind(this),
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
else if (provider === 'google') {
|
|
556
|
+
window.grecaptcha.ready(() => {
|
|
557
|
+
window.grecaptcha.render('googleContainer', {
|
|
558
|
+
sitekey: siteKey,
|
|
559
|
+
callback: this.captchaCallback.bind(this),
|
|
560
|
+
theme: 'light'
|
|
561
|
+
});
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Common callback function for CAPTCHA response handling.
|
|
567
|
+
* @param token CAPTCHA response token.
|
|
568
|
+
*/
|
|
569
|
+
captchaCallback(token) {
|
|
570
|
+
this.captchaData.token = token;
|
|
571
|
+
this.captchaData = Object.assign({}, this.captchaData); // Needed to tell Stencil something was changed
|
|
572
|
+
this.updateSubmitButtonState();
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Lifecycle method: Clean up event listeners for styling.
|
|
576
|
+
* Called every time the component is disconnected from the DOM
|
|
577
|
+
*/
|
|
578
|
+
disconnectedCallback() {
|
|
579
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* The render function.
|
|
583
|
+
*/
|
|
584
|
+
render() {
|
|
585
|
+
if (this.skeletonLoading) {
|
|
586
|
+
return index.h("div", { class: "PlayerForgotPassword skeleton" }, index.h("form", { class: "Form" }, index.h("div", { class: "ButtonReturn" }, index.h("ui-skeleton", { structure: "text", width: "auto", height: "30px" })), index.h("section", { class: "FieldsSection" }, index.h("div", { class: "FieldContainer" }, index.h("div", { class: "FieldTitle" }, index.h("ui-skeleton", { structure: "title", width: "auto", height: "10px" })), index.h("ui-skeleton", { structure: "rectangle", width: "auto", height: "35px" }))), index.h("section", { class: "ButtonsSection" }, index.h("div", { class: "Button" }, index.h("ui-skeleton", { structure: "rectangle", width: "auto", height: "50px" })))));
|
|
587
|
+
}
|
|
588
|
+
if (this.hasError) {
|
|
589
|
+
return index.h("div", { class: "PlayerForgotPassword", ref: el => this.stylingContainer = el }, index.h("h4", { class: "Error" }, translate('configError', this.language)));
|
|
590
|
+
}
|
|
591
|
+
return index.h("div", { class: "PlayerForgotPassword", ref: el => this.stylingContainer = el }, index.h("form", { action: ".", class: "Form" }, index.h("div", { class: "ButtonReturn", 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", { class: "TitleMobile" }, translate('title', this.language))), index.h("h2", { class: "Title" }, translate('title', this.language)), index.h("section", { class: "FieldsSection" }, index.h("div", { class: `ContactWrapper${this.isMobile ? 'Mobile' : ''}` }, index.h("general-input", { class: "Contact", language: this.language, "client-styling": this.clientStyling, "mb-source": this.mbSource, type: "email", name: "contact", displayName: translate('emailDisplayName'), emitValue: true, validation: this.validation, placeholder: translate('emailPlaceholder') })), this.captchaData.isEnabled && this.captchaData.provider === 'cloudflare' &&
|
|
592
|
+
index.h("slot", { name: "turnstile" }), this.captchaData.isEnabled && this.captchaData.provider === 'google' &&
|
|
593
|
+
index.h("slot", { name: "google" })), index.h("section", { class: "ButtonsWrapper" }, index.h("button", { class: "Button", disabled: !this.isBtnSubmitEnabled, onClick: this.submitRequest }, translate('btnSubmit', this.language)))));
|
|
594
|
+
}
|
|
595
|
+
;
|
|
596
|
+
static get watchers() { return {
|
|
597
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
598
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"]
|
|
599
|
+
}; }
|
|
600
|
+
};
|
|
601
|
+
PamForgotPassword.style = PamForgotPasswordStyle0;
|
|
602
|
+
|
|
603
|
+
exports.PamForgotPassword = PamForgotPassword;
|