@everymatrix/pam-player-profile 1.85.17 → 1.85.19
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/index.cjs.js +1 -1
- package/dist/cjs/{pam-player-profile-3185ce39.js → pam-player-profile-a2d41f68.js} +2 -0
- package/dist/cjs/pam-player-profile_2.cjs.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/{pam-player-profile-2ba91a9a.js → pam-player-profile-b7ec4326.js} +2 -0
- package/dist/esm/pam-player-profile_2.entry.js +1 -1
- package/dist/pam-player-profile/index.esm.js +1 -1
- package/dist/pam-player-profile/pam-player-profile-b7ec4326.js +1 -0
- package/dist/pam-player-profile/pam-player-profile_2.entry.js +1 -1
- package/package.json +1 -1
- package/dist/pam-player-profile/pam-player-profile-2ba91a9a.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -218,6 +218,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
218
218
|
* @param {string} clientStylingUrl The URL of the style content
|
|
219
219
|
*/
|
|
220
220
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
221
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
222
|
+
|
|
221
223
|
const url = new URL(clientStylingUrl);
|
|
222
224
|
|
|
223
225
|
fetch(url.href)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const pamPlayerProfile = require('./pam-player-profile-
|
|
5
|
+
const pamPlayerProfile = require('./pam-player-profile-a2d41f68.js');
|
|
6
6
|
const index = require('./index-4130c9d2.js');
|
|
7
7
|
|
|
8
8
|
const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as PamPlayerProfile } from './pam-player-profile-
|
|
1
|
+
export { P as PamPlayerProfile } from './pam-player-profile-b7ec4326.js';
|
|
2
2
|
import './index-d953d051.js';
|
|
@@ -216,6 +216,8 @@ function setClientStyling(stylingContainer, clientStyling) {
|
|
|
216
216
|
* @param {string} clientStylingUrl The URL of the style content
|
|
217
217
|
*/
|
|
218
218
|
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
219
|
+
if (!stylingContainer || !clientStylingUrl) return;
|
|
220
|
+
|
|
219
221
|
const url = new URL(clientStylingUrl);
|
|
220
222
|
|
|
221
223
|
fetch(url.href)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as pam_player_profile } from './pam-player-profile-
|
|
1
|
+
export { P as pam_player_profile } from './pam-player-profile-b7ec4326.js';
|
|
2
2
|
import { r as registerInstance, h, H as Host } from './index-d953d051.js';
|
|
3
3
|
|
|
4
4
|
const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as PamPlayerProfile}from"./pam-player-profile-
|
|
1
|
+
export{P as PamPlayerProfile}from"./pam-player-profile-b7ec4326.js";import"./index-d953d051.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as r}from"./index-d953d051.js";const t={en:{title:"Profile Info",username:"Username",firstName:"First Name",lastName:"Last Name",securityQuestion:"Security Question",securityAnswer:"Security Answer",playerTitle:"Title",gender:"Gender",dateOfBirth:"Date Of Birth",currency:"Currency",securityQuestionError:"Security question must be at least 1 character long and maximum 120 characters.",securityAnswerError:"Security answer must be at least 1 character long and maximum 120 characters.",saveButton:"Save Changes",successMessage:"Your changes have been saved!",errorMessageUpdate:"An error has occured when attempting to update the profile information",errorMessageFetch:"An error has occured when attempting to fetch the profile information"},"zh-hk":{title:"個人資料",username:"用戶名",firstName:"名字",lastName:"姓氏",securityQuestion:"安全問題",securityAnswer:"安全答案",playerTitle:"稱號",gender:"性別",dateOfBirth:"出生日期",currency:"貨幣",securityQuestionError:"安全問題必須至少1個字符,最多120個字符。",securityAnswerError:"安全答案必須至少1個字符,最多120個字符。",saveButton:"保存更改",successMessage:"您的更改已保存!",errorMessageUpdate:"嘗試更新個人資料信息時發生錯誤",errorMessageFetch:"在嘗試獲取個人資料時發生錯誤"},fr:{title:"Informations de profil",username:"Nom d'utilisateur",firstName:"Prénom",lastName:"Nom de famille",securityQuestion:"Question de sécurité",securityAnswer:"Réponse de sécurité",playerTitle:"Titre",gender:"Genre",dateOfBirth:"Date de naissance",currency:"Devise",securityQuestionError:"La question de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",securityAnswerError:"La réponse de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",saveButton:"Enregistrer les modifications",successMessage:"Vos modifications ont été enregistrées !",errorMessageUpdate:"Une erreur s'est produite lors de la tentative de mise à jour des informations de profil",errorMessageFetch:"Une erreur est survenue lors de la tentative de récupération des informations de profil"},ro:{title:"Informații profil",username:"Nume de utilizator",firstName:"Prenume",lastName:"Nume de familie",securityQuestion:"Întrebare de securitate",securityAnswer:"Răspuns de securitate",playerTitle:"Titlu",gender:"Gen",dateOfBirth:"Data nașterii",currency:"Monedă",securityQuestionError:"Întrebarea de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",securityAnswerError:"Răspunsul de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",saveButton:"Salvează modificările",successMessage:"Modificările dvs. au fost salvate!",errorMessageUpdate:"A apărut o eroare la încercarea de a actualiza informațiile profilului",errorMessageFetch:"A apărut o eroare la încercarea de a obține informațiile profilului"},tr:{title:"Profil Bilgileri",username:"Kullanıcı Adı",firstName:"Ad",lastName:"Soyad",securityQuestion:"Güvenlik Sorusu",securityAnswer:"Güvenlik Cevabı",playerTitle:"Başlık",gender:"Cinsiyet",dateOfBirth:"Doğum Tarihi",currency:"Para Birimi",securityQuestionError:"Güvenlik sorusu en az 1 karakter ve en fazla 120 karakter olmalıdır.",securityAnswerError:"Güvenlik cevabı en az 1 karakter ve en fazla 120 karakter olmalıdır.",saveButton:"Değişiklikleri Kaydet",successMessage:"Değişiklikleriniz kaydedildi!",errorMessageUpdate:"Profil bilgilerini güncellemeye çalışırken bir hata oluştu",errorMessageFetch:"Profil bilgilerini almak için yapılan işlemde bir hata oluştu"},es:{title:"Información del perfil",username:"Nombre de usuario",firstName:"Nombre",lastName:"Apellido",securityQuestion:"Pregunta de seguridad",securityAnswer:"Respuesta de seguridad",playerTitle:"Título",gender:"Género",dateOfBirth:"Fecha de nacimiento",currency:"Moneda",securityQuestionError:"La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",securityAnswerError:"La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",saveButton:"Guardar cambios",successMessage:"¡Tus cambios han sido guardados!",errorMessageUpdate:"Se ha producido un error al intentar actualizar la información del perfil",errorMessageFetch:"Se ha producido un error al intentar obtener la información del perfil"},pt:{title:"Informações do Perfil",username:"Nome de usuário",firstName:"Nome",lastName:"Sobrenome",securityQuestion:"Pergunta de segurança",securityAnswer:"Resposta de segurança",playerTitle:"Título",gender:"Gênero",dateOfBirth:"Data de nascimento",currency:"Moeda",securityQuestionError:"A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",securityAnswerError:"A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",saveButton:"Salvar alterações",successMessage:"Suas alterações foram salvas!",errorMessageUpdate:"Ocorreu um erro ao tentar atualizar as informações do perfil",errorMessageFetch:"Ocorreu um erro ao tentar buscar as informações do perfil"},hr:{title:"Informacije o profilu",username:"Korisničko ime",firstName:"Ime",lastName:"Prezime",securityQuestion:"Sigurnosno pitanje",securityAnswer:"Sigurnosni odgovor",playerTitle:"Naslov",gender:"Spol",dateOfBirth:"Datum rođenja",currency:"Valuta",securityQuestionError:"Sigurnosno pitanje mora imati najmanje 1 znak i najviše 120 znakova.",securityAnswerError:"Sigurnosni odgovor mora imati najmanje 1 znak i najviše 120 znakova.",saveButton:"Spremi promjene",successMessage:"Vaše promjene su spremljene!",errorMessageUpdate:"Došlo je do pogreške prilikom pokušaja ažuriranja informacija o profilu",errorMessageFetch:"Došlo je do greške prilikom pokušaja dobijanja informacija o profilu"},"pt-br":{title:"Informações do Perfil",username:"Nome de usuário",firstName:"Nome",lastName:"Sobrenome",securityQuestion:"Pergunta de segurança",securityAnswer:"Resposta de segurança",playerTitle:"Título",gender:"Gênero",dateOfBirth:"Data de nascimento",currency:"Moeda",securityQuestionError:"A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",securityAnswerError:"A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",saveButton:"Salvar alterações",successMessage:"Suas alterações foram salvas!",errorMessageUpdate:"Ocorreu um erro ao tentar atualizar as informações do perfil",errorMessageFetch:"Ocorreu um erro ao tentar buscar as informações do perfil"},"es-mx":{title:"Información del perfil",username:"Nombre de usuario",firstName:"Nombre",lastName:"Apellido",securityQuestion:"Pregunta de seguridad",securityAnswer:"Respuesta de seguridad",playerTitle:"Título",gender:"Género",dateOfBirth:"Fecha de nacimiento",currency:"Moneda",securityQuestionError:"La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",securityAnswerError:"La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",saveButton:"Guardar cambios",successMessage:"¡Tus cambios han sido guardados!",errorMessageUpdate:"Se ha producido un error al intentar actualizar la información del perfil",errorMessageFetch:"Se ha producido un error al intentar obtener la información del perfil"}},n=(e,r,n)=>{let i=t[t[r]?r:"en"][e];if(void 0!==n)for(const[e,r]of Object.entries(n.values)){const t=new RegExp(`{${e}}`,"g");i=i.replace(t,r)}return i};function i(e,r){if(e){const t=document.createElement("style");t.innerHTML=r,e.appendChild(t)}}function a(e,r){if(!e||!r)return;const t=new URL(r);fetch(t.href).then((e=>e.text())).then((r=>{const t=document.createElement("style");t.innerHTML=r,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var o={exports:{}};o.exports=function(){var e=6e4,r=36e5,t="millisecond",n="second",i="minute",a="hour",o="day",s="week",l="month",u="quarter",c="year",d="date",m="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|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,f={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(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}},y=function(e,r,t){var n=String(e);return!n||n.length>=r?e:""+Array(r+1-n.length).join(t)+e},g={s:y,z:function(e){var r=-e.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),i=t%60;return(r<=0?"+":"-")+y(n,2,"0")+":"+y(i,2,"0")},m:function e(r,t){if(r.date()<t.date())return-e(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),i=r.clone().add(n,l),a=t-i<0,o=r.clone().add(n+(a?-1:1),l);return+(-(n+(t-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:c,w:s,d:o,D:d,h:a,m:i,s:n,ms:t,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},w="en",v={};v[w]=f;var P="$isDayjsObject",b=function(e){return e instanceof M||!(!e||!e[P])},x=function e(r,t,n){var i;if(!r)return w;if("string"==typeof r){var a=r.toLowerCase();v[a]&&(i=a),t&&(v[a]=t,i=a);var o=r.split("-");if(!i&&o.length>1)return e(o[0])}else{var s=r.name;v[s]=r,i=s}return!n&&i&&(w=i),i||!n&&w},S=function(e,r){if(b(e))return e.clone();var t="object"==typeof r?r:{};return t.date=e,t.args=arguments,new M(t)},k=g;k.l=x,k.i=b,k.w=function(e,r){return S(e,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var M=function(){function f(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[P]=!0}var y=f.prototype;return y.parse=function(e){this.$d=function(e){var r=e.date,t=e.utc;if(null===r)return new Date(NaN);if(k.u(r))return new Date;if(r instanceof Date)return new Date(r);if("string"==typeof r&&!/Z$/i.test(r)){var n=r.match(p);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return t?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(r)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return k},y.isValid=function(){return!(this.$d.toString()===m)},y.isSame=function(e,r){var t=S(e);return this.startOf(r)<=t&&t<=this.endOf(r)},y.isAfter=function(e,r){return S(e)<this.startOf(r)},y.isBefore=function(e,r){return this.endOf(r)<S(e)},y.$g=function(e,r,t){return k.u(e)?this[r]:this.set(t,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,r){var t=this,u=!!k.u(r)||r,m=k.p(e),p=function(e,r){var n=k.w(t.$u?Date.UTC(t.$y,r,e):new Date(t.$y,r,e),t);return u?n:n.endOf(o)},h=function(e,r){return k.w(t.toDate()[e].apply(t.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(r)),t)},f=this.$W,y=this.$M,g=this.$D,w="set"+(this.$u?"UTC":"");switch(m){case c:return u?p(1,0):p(31,11);case l:return u?p(1,y):p(0,y+1);case s:var v=this.$locale().weekStart||0,P=(f<v?f+7:f)-v;return p(u?g-P:g+(6-P),y);case o:case d:return h(w+"Hours",0);case a:return h(w+"Minutes",1);case i:return h(w+"Seconds",2);case n:return h(w+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,r){var s,u=k.p(e),m="set"+(this.$u?"UTC":""),p=(s={},s[o]=m+"Date",s[d]=m+"Date",s[l]=m+"Month",s[c]=m+"FullYear",s[a]=m+"Hours",s[i]=m+"Minutes",s[n]=m+"Seconds",s[t]=m+"Milliseconds",s)[u],h=u===o?this.$D+(r-this.$W):r;if(u===l||u===c){var f=this.clone().set(d,1);f.$d[p](h),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},y.set=function(e,r){return this.clone().$set(e,r)},y.get=function(e){return this[k.p(e)]()},y.add=function(t,u){var d,m=this;t=Number(t);var p=k.p(u),h=function(e){var r=S(m);return k.w(r.date(r.date()+Math.round(e*t)),m)};if(p===l)return this.set(l,this.$M+t);if(p===c)return this.set(c,this.$y+t);if(p===o)return h(1);if(p===s)return h(7);var f=(d={},d[i]=e,d[a]=r,d[n]=1e3,d)[p]||1,y=this.$d.getTime()+t*f;return k.w(y,this)},y.subtract=function(e,r){return this.add(-1*e,r)},y.format=function(e){var r=this,t=this.$locale();if(!this.isValid())return t.invalidDate||m;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),a=this.$H,o=this.$m,s=this.$M,l=t.weekdays,u=t.months,c=function(e,t,i,a){return e&&(e[t]||e(r,n))||i[t].slice(0,a)},d=function(e){return k.s(a%12||12,e,"0")},p=t.meridiem||function(e,r,t){var n=e<12?"AM":"PM";return t?n.toLowerCase():n};return n.replace(h,(function(e,n){return n||function(e){switch(e){case"YY":return String(r.$y).slice(-2);case"YYYY":return k.s(r.$y,4,"0");case"M":return s+1;case"MM":return k.s(s+1,2,"0");case"MMM":return c(t.monthsShort,s,u,3);case"MMMM":return c(u,s);case"D":return r.$D;case"DD":return k.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return c(t.weekdaysMin,r.$W,l,2);case"ddd":return c(t.weekdaysShort,r.$W,l,3);case"dddd":return l[r.$W];case"H":return String(a);case"HH":return k.s(a,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(a,o,!0);case"A":return p(a,o,!1);case"m":return String(o);case"mm":return k.s(o,2,"0");case"s":return String(r.$s);case"ss":return k.s(r.$s,2,"0");case"SSS":return k.s(r.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(t,d,m){var p,h=this,f=k.p(d),y=S(t),g=(y.utcOffset()-this.utcOffset())*e,w=this-y,v=function(){return k.m(h,y)};switch(f){case c:p=v()/12;break;case l:p=v();break;case u:p=v()/3;break;case s:p=(w-g)/6048e5;break;case o:p=(w-g)/864e5;break;case a:p=w/r;break;case i:p=w/e;break;case n:p=w/1e3;break;default:p=w}return m?p:k.a(p)},y.daysInMonth=function(){return this.endOf(l).$D},y.$locale=function(){return v[this.$L]},y.locale=function(e,r){if(!e)return this.$L;var t=this.clone(),n=x(e,r,!0);return n&&(t.$L=n),t},y.clone=function(){return k.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},f}(),F=M.prototype;return S.prototype=F,[["$ms",t],["$s",n],["$m",i],["$H",a],["$W",o],["$M",l],["$y",c],["$D",d]].forEach((function(e){F[e[1]]=function(r){return this.$g(r,e[0],e[1])}})),S.extend=function(e,r){return e.$i||(e(r,M,S),e.$i=!0),S},S.locale=x,S.isDayjs=b,S.unix=function(e){return S(1e3*e)},S.en=v[w],S.Ls=v,S.p={},S}();const s=o.exports,l=class{constructor(t){var i;e(this,t),this.fieldsState={},this.sendLoadedMessage=()=>{window.postMessage({type:"PROFILE_LOADED"})},this.sendValidMessage=()=>{window.postMessage({type:"PROFILE_VALIDITY",data:this.isSubmitButtonAvailable})},this.sendSuccessNotification=()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:n("successMessage",this.lang)}},window.location.href)},this.sendErrorNotification=e=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:n(e,this.lang)}},window.location.href)},this.sendData=()=>{delete this.data.contacts,window.postMessage({type:"PROFILE_UPDATE_DATA",data:this.data},window.location.href)},this.messageHandler=e=>{var r;switch(null===(r=e.data)||void 0===r?void 0:r.type){case"PROFILE_DATA":this.data=e.data.data,this.resetState(),this.skeletonLoading=!1;break;case"PROFILE_SEND_DATA":this.sendData()}},this.handleFetchResponse=async e=>{var r;if(e.status>=300){this.isError=!0;let t=await e.json();return this.errorCode=null===(r=t.thirdPartyResponse)||void 0===r?void 0:r.errorCode,this.errorMessage=n(this.errorCode?this.errorCode:"errorMessageFetch",this.lang),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href),Promise.reject(this.errorMessage)}if(this.isError=!1,e.headers.get("content-type")){let r=await e.json();return Promise.resolve(r)}return Promise.resolve()},this.getData=()=>{const e=new URL(`/api/v1/players/${this.userId}/player-identifiable-information/`,this.endpoint),r=new Headers;r.append("X-SessionID",this.session);const t={method:"GET",headers:r};return new Promise(((r,n)=>{fetch(e.href,t).then((e=>this.handleFetchResponse(e))).then((e=>{this.data=e.player,r()})).catch((e=>{console.error(e),n(e)}))}))},this.buildFieldState=(e,r,t)=>Object.assign({isValid:e,initialValue:r,rule:t}),this.initData=()=>{const e={};["externalPlayerId","affiliateMarker","personalInfo","communicationInfo","signupInfo","statusInfo","securityInfo","geographicInfo","playerInfo","contacts"].forEach((r=>e[r]=this.data[r])),this.data=e},this.updateState=(e,r)=>t=>{this.data[e][r]=t.target.value;const n=this.fieldsState.data[r],i=t.target.value,a=n.rule(i);a&&!n.isValid?(n.isValid=!0,this.invalidFields-=1):!a&&n.isValid&&(n.isValid=!1,this.invalidFields+=1),this.fieldsState.hasChanged=i!==n.initialValue;const o=this.isSubmitButtonAvailable;this.updateSubmitButtonStatus(),"true"!==this.isStandAlone&&this.isSubmitButtonAvailable!==o&&this.sendValidMessage()},this.updateData=e=>{e&&e.preventDefault();const r=new URL(`/api/v1/players/${this.userId}/player-identifiable-information/`,this.endpoint),t=new Headers;t.append("X-SessionId",this.session),t.append("Content-Type","application/problem+json; charset=utf-8"),this.data.contacts&&delete this.data.contacts;const n={method:"PUT",headers:t,body:JSON.stringify(this.data)};fetch(r,n).then((e=>this.handleFetchResponse(e))).then((()=>{this.sendSuccessNotification(),this.getData().then((()=>this.resetState()))})).catch((e=>{console.error(e)}))},this.updateSubmitButtonStatus=()=>{this.isSubmitButtonAvailable=0===this.invalidFields&&this.fieldsState.hasChanged},this.editableField=(e,t,i,a)=>{const o=this.fieldsState.data[t],s=this.data[e][t];return o?r("div",{class:"Field "+(o.isValid?"":"Invalid")},r("label",null,n(i,this.lang)),r("input",{type:"text",value:s,onKeyUp:this.updateState(e,t)}),!o.isValid&&r("p",{class:"Error"},n(a,this.lang))):null},this.staticField=(e,t)=>e?r("div",{class:"Field Disabled"},r("label",null,n(t,this.lang)),r("input",{type:"text",value:e,readonly:!0})):null,this.toggleScreen=()=>{window.postMessage({type:"PlayerAccountMenuActive",isMobile:this.isMobile},window.location.href)},this.userId=void 0,this.session=void 0,this.endpoint=void 0,this.lang="en",this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl=void 0,this.dobFormat="DD/MM/YYYY",this.isStandAlone="true",this.limitStylingAppends=!1,this.skeletonLoading=!0,this.isSubmitButtonAvailable=!1,this.invalidFields=0,this.isMobile=!!((i=window.navigator.userAgent).toLowerCase().match(/android/i)||i.toLowerCase().match(/blackberry|bb/i)||i.toLowerCase().match(/iphone|ipad|ipod/i)||i.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.isError=!1,this.errorMessage="",this.errorCode=""}handleStylingChange(e,r){e!==r&&i(this.stylingContainer,this.clientStyling)}handleStylingUrlChange(e,r){e!==r&&a(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.isStandAlone&&await this.getData().then((()=>{this.initData(),this.initEditableFieldsState()})).finally((()=>this.skeletonLoading=!1))}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBuss?function(e,r){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(r,(r=>{t.innerHTML=r,e&&e.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))),"true"!==this.isStandAlone&&(window.addEventListener("message",this.messageHandler,!1),this.sendLoadedMessage())}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),"true"!==this.isStandAlone&&window.removeEventListener("message",this.messageHandler,!1)}initEditableFieldsState(){var e,r;this.fieldsState.data={},this.fieldsState.hasChanged=!1,(null===(e=this.data.playerInfo)||void 0===e?void 0:e.SecurityQuestion)&&(this.fieldsState.data.SecurityQuestion=this.buildFieldState(!0,this.data.playerInfo.SecurityQuestion,(e=>e&&e.length<=120))),(null===(r=this.data.playerInfo)||void 0===r?void 0:r.SecurityAnswer)&&(this.fieldsState.data.SecurityAnswer=this.buildFieldState(!0,this.data.playerInfo.SecurityAnswer,(e=>e&&e.length<=120)))}resetState(){this.initData(),this.initEditableFieldsState(),this.invalidFields=0,this.isSubmitButtonAvailable=!1}render(){return!this.skeletonLoading&&this.isError?r("div",{class:"errorContainer"},r("p",{class:"errorMessage",innerHTML:this.errorMessage})):r("div",{ref:e=>this.stylingContainer=e},this.skeletonLoading?r("form",{class:"PamPlayerProfileWrapper skeleton"},r("div",{class:"ReturnButton"},r("ui-skeleton",{structure:"title",width:"auto",height:"30px"})),r("div",{class:"Section"},r("section",{class:"SectionContent"},[...Array(6).keys()].map((()=>r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"})))),r("div",{class:"CompoundField"},r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"})),r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"}))),r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"auto",height:"20px"})))),r("section",{class:"ButtonsArea"},r("div",{class:"SaveButton"},r("ui-skeleton",{structure:"rectangle",width:"auto",height:"50px"})))):r("form",{class:"PamPlayerProfileWrapper "+(this.isMobile?"Mobile":"")},r("div",{class:"ReturnButton",onClick:this.toggleScreen},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15"},r("g",{transform:"translate(-20 -158)"},r("g",{transform:"translate(20 158)"},r("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)"})))),r("h2",null,n("title",this.lang))),r("h2",{class:"HeaderText"},n("title",this.lang)),r("div",{class:"Section"},r("section",{class:"SectionContent"},this.staticField(this.data.contacts.find((e=>e.contatcType="Username")).contactValue,"username"),this.staticField(s(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"),r("div",{class:"CompoundField"},this.staticField(this.data.personalInfo.title,"playerTitle"),this.staticField(this.data.personalInfo.gender,"gender")),this.staticField(this.data.communicationInfo.currency,"currency"))),"true"===this.isStandAlone&&r("section",{class:"ButtonsArea"},r("button",{class:"SaveButton "+(this.isSubmitButtonAvailable?"":"Disabled"),onClick:this.updateData},n("saveButton")))))}static get watchers(){return{clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}}};l.style=':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.errorContainer {\n font-family: "Roboto";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n}\n.errorContainer .errorMessage {\n color: var(--emw--color-error, var(--emw--color-red, #ed0909));\n font-size: var(--emw-font-size-small, 13px);\n display: block;\n justify-content: center;\n text-align: center;\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}';export{l as P}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{P as pam_player_profile}from"./pam-player-profile-
|
|
1
|
+
export{P as pam_player_profile}from"./pam-player-profile-b7ec4326.js";import{r as e,h as t,H as n}from"./index-d953d051.js";const i=class{constructor(t){e(this,t),this.stylingValue={width:this.handleStylingProps(this.width),height:this.handleStylingProps(this.height),borderRadius:this.handleStylingProps(this.borderRadius),marginBottom:this.handleStylingProps(this.marginBottom),marginTop:this.handleStylingProps(this.marginTop),marginLeft:this.handleStylingProps(this.marginLeft),marginRight:this.handleStylingProps(this.marginRight),size:this.handleStylingProps(this.size)},this.structure=void 0,this.width="unset",this.height="unset",this.borderRadius="unset",this.marginBottom="unset",this.marginTop="unset",this.marginLeft="unset",this.marginRight="unset",this.animation=!0,this.rows=0,this.size="100%"}handleStructureChange(e,t){t!==e&&this.handleStructure(e)}handleStylingProps(e){switch(typeof e){case"number":return 0===e?0:`${e}px`;case"undefined":default:return"unset";case"string":return["auto","unset","none","inherit","initial"].includes(e)||e.endsWith("px")||e.endsWith("%")?e:"unset"}}handleStructure(e){switch(e){case"logo":return this.renderLogo();case"image":return this.renderImage();case"title":return this.renderTitle();case"text":return this.renderText();case"rectangle":return this.renderRectangle();case"circle":return this.renderCircle();default:return null}}renderLogo(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonLogo "+(this.animation?"Skeleton":"")}))}renderImage(){return t("div",{class:"SkeletonImage "+(this.animation?"Skeleton":"")})}renderTitle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonTitle "+(this.animation?"Skeleton":"")}))}renderText(){return t("div",{class:"SkeletonContainer"},Array.from({length:this.rows>0?this.rows:1}).map(((e,n)=>t("div",{key:n,class:"SkeletonText "+(this.animation?"Skeleton":"")}))))}renderRectangle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonRectangle "+(this.animation?"Skeleton":"")}))}renderCircle(){return t("div",{class:"SkeletonContainer"},t("div",{class:"SkeletonCircle "+(this.animation?"Skeleton":"")}))}render(){let e="";switch(this.structure){case"logo":e=`\n :host {\n --emw-skeleton-logo-width: ${this.stylingValue.width};\n --emw-skeleton-logo-height: ${this.stylingValue.height};\n --emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"image":e=`\n :host {\n --emw-skeleton-image-width: ${this.stylingValue.width};\n --emw-skeleton-image-height: ${this.stylingValue.height};\n --emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"title":e=`\n :host {\n --emw-skeleton-title-width: ${this.stylingValue.width};\n --emw-skeleton-title-height: ${this.stylingValue.height};\n --emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"text":e=`\n :host {\n --emw-skeleton-text-width: ${this.stylingValue.width};\n --emw-skeleton-text-height: ${this.stylingValue.height};\n --emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"rectangle":e=`\n :host {\n --emw-skeleton-rectangle-width: ${this.stylingValue.width};\n --emw-skeleton-rectangle-height: ${this.stylingValue.height};\n --emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};\n --emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};\n --emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};\n --emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};\n --emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};\n }\n `;break;case"circle":e=`\n :host {\n --emw-skeleton-circle-size: ${this.stylingValue.size};\n }\n `;break;default:e=""}return t(n,{key:"c2a2650acd416962a2bc4e1a7ee18bc6d8e2def8"},t("style",{key:"9bd7fc1f9e9ed9f17735a7b72fce6f09696f5e19"},e),this.handleStructure(this.structure))}static get watchers(){return{structure:["handleStructureChange"]}}};i.style=":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.SkeletonRectangle{background-color:var(--emw-skeleton-rectangle-background, #c2c2c2);width:var(--emw-skeleton-rectangle-width, 400px);height:var(--emw-skeleton-rectangle-height, 200px);border-radius:var(--emw-skeleton-rectangle-border-radius, 10px)}.SkeletonCircle{background-color:var(--emw-skeleton-circle-background, #c2c2c2);width:var(--emw-skeleton-circle-size, 400px);height:var(--emw-skeleton-circle-size, 400px);border-radius:50%}.SkeletonText{background-color:var(--emw-skeleton-text-background, #c2c2c2);width:var(--emw-skeleton-text-width, 500px);height:var(--emw-skeleton-text-height, 20px);border-radius:var(--emw-skeleton-text-border-radius, 10px);margin-bottom:var(--emw-skeleton-text-margin-bottom, 5px)}.SkeletonText:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.SkeletonTitle{background-color:var(--emw-skeleton-title-background, #c2c2c2);width:var(--emw-skeleton-title-width, 300px);height:var(--emw-skeleton-title-height, 30px);border-radius:var(--emw-skeleton-title-border-radius, 10px);margin-bottom:var(--emw-skeleton-title-margin-bottom, 5px)}.SkeletonImage{background-color:var(--emw-skeleton-image-background, #c2c2c2);width:var(--emw-skeleton-image-width, 100%);height:var(--emw-skeleton-image-height, 100%);border-radius:var(--emw-skeleton-image-border-radius, unset)}.SkeletonLogo{background-color:var(--emw-skeleton-logo-background, #c2c2c2);width:var(--emw-skeleton-logo-width, 120px);height:var(--emw-skeleton-logo-height, 75px);border-radius:var(--emw-skeleton-logo-border-radius, 10px)}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #e0e0e0)}100%{background-color:var(--emw-skeleton-secondary-color, #f0f0f0)}}";export{i as ui_skeleton}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as r}from"./index-d953d051.js";const t={en:{title:"Profile Info",username:"Username",firstName:"First Name",lastName:"Last Name",securityQuestion:"Security Question",securityAnswer:"Security Answer",playerTitle:"Title",gender:"Gender",dateOfBirth:"Date Of Birth",currency:"Currency",securityQuestionError:"Security question must be at least 1 character long and maximum 120 characters.",securityAnswerError:"Security answer must be at least 1 character long and maximum 120 characters.",saveButton:"Save Changes",successMessage:"Your changes have been saved!",errorMessageUpdate:"An error has occured when attempting to update the profile information",errorMessageFetch:"An error has occured when attempting to fetch the profile information"},"zh-hk":{title:"個人資料",username:"用戶名",firstName:"名字",lastName:"姓氏",securityQuestion:"安全問題",securityAnswer:"安全答案",playerTitle:"稱號",gender:"性別",dateOfBirth:"出生日期",currency:"貨幣",securityQuestionError:"安全問題必須至少1個字符,最多120個字符。",securityAnswerError:"安全答案必須至少1個字符,最多120個字符。",saveButton:"保存更改",successMessage:"您的更改已保存!",errorMessageUpdate:"嘗試更新個人資料信息時發生錯誤",errorMessageFetch:"在嘗試獲取個人資料時發生錯誤"},fr:{title:"Informations de profil",username:"Nom d'utilisateur",firstName:"Prénom",lastName:"Nom de famille",securityQuestion:"Question de sécurité",securityAnswer:"Réponse de sécurité",playerTitle:"Titre",gender:"Genre",dateOfBirth:"Date de naissance",currency:"Devise",securityQuestionError:"La question de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",securityAnswerError:"La réponse de sécurité doit comporter au moins 1 caractère et un maximum de 120 caractères.",saveButton:"Enregistrer les modifications",successMessage:"Vos modifications ont été enregistrées !",errorMessageUpdate:"Une erreur s'est produite lors de la tentative de mise à jour des informations de profil",errorMessageFetch:"Une erreur est survenue lors de la tentative de récupération des informations de profil"},ro:{title:"Informații profil",username:"Nume de utilizator",firstName:"Prenume",lastName:"Nume de familie",securityQuestion:"Întrebare de securitate",securityAnswer:"Răspuns de securitate",playerTitle:"Titlu",gender:"Gen",dateOfBirth:"Data nașterii",currency:"Monedă",securityQuestionError:"Întrebarea de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",securityAnswerError:"Răspunsul de securitate trebuie să aibă cel puțin 1 caracter și maximum 120 de caractere.",saveButton:"Salvează modificările",successMessage:"Modificările dvs. au fost salvate!",errorMessageUpdate:"A apărut o eroare la încercarea de a actualiza informațiile profilului",errorMessageFetch:"A apărut o eroare la încercarea de a obține informațiile profilului"},tr:{title:"Profil Bilgileri",username:"Kullanıcı Adı",firstName:"Ad",lastName:"Soyad",securityQuestion:"Güvenlik Sorusu",securityAnswer:"Güvenlik Cevabı",playerTitle:"Başlık",gender:"Cinsiyet",dateOfBirth:"Doğum Tarihi",currency:"Para Birimi",securityQuestionError:"Güvenlik sorusu en az 1 karakter ve en fazla 120 karakter olmalıdır.",securityAnswerError:"Güvenlik cevabı en az 1 karakter ve en fazla 120 karakter olmalıdır.",saveButton:"Değişiklikleri Kaydet",successMessage:"Değişiklikleriniz kaydedildi!",errorMessageUpdate:"Profil bilgilerini güncellemeye çalışırken bir hata oluştu",errorMessageFetch:"Profil bilgilerini almak için yapılan işlemde bir hata oluştu"},es:{title:"Información del perfil",username:"Nombre de usuario",firstName:"Nombre",lastName:"Apellido",securityQuestion:"Pregunta de seguridad",securityAnswer:"Respuesta de seguridad",playerTitle:"Título",gender:"Género",dateOfBirth:"Fecha de nacimiento",currency:"Moneda",securityQuestionError:"La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",securityAnswerError:"La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",saveButton:"Guardar cambios",successMessage:"¡Tus cambios han sido guardados!",errorMessageUpdate:"Se ha producido un error al intentar actualizar la información del perfil",errorMessageFetch:"Se ha producido un error al intentar obtener la información del perfil"},pt:{title:"Informações do Perfil",username:"Nome de usuário",firstName:"Nome",lastName:"Sobrenome",securityQuestion:"Pergunta de segurança",securityAnswer:"Resposta de segurança",playerTitle:"Título",gender:"Gênero",dateOfBirth:"Data de nascimento",currency:"Moeda",securityQuestionError:"A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",securityAnswerError:"A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",saveButton:"Salvar alterações",successMessage:"Suas alterações foram salvas!",errorMessageUpdate:"Ocorreu um erro ao tentar atualizar as informações do perfil",errorMessageFetch:"Ocorreu um erro ao tentar buscar as informações do perfil"},hr:{title:"Informacije o profilu",username:"Korisničko ime",firstName:"Ime",lastName:"Prezime",securityQuestion:"Sigurnosno pitanje",securityAnswer:"Sigurnosni odgovor",playerTitle:"Naslov",gender:"Spol",dateOfBirth:"Datum rođenja",currency:"Valuta",securityQuestionError:"Sigurnosno pitanje mora imati najmanje 1 znak i najviše 120 znakova.",securityAnswerError:"Sigurnosni odgovor mora imati najmanje 1 znak i najviše 120 znakova.",saveButton:"Spremi promjene",successMessage:"Vaše promjene su spremljene!",errorMessageUpdate:"Došlo je do pogreške prilikom pokušaja ažuriranja informacija o profilu",errorMessageFetch:"Došlo je do greške prilikom pokušaja dobijanja informacija o profilu"},"pt-br":{title:"Informações do Perfil",username:"Nome de usuário",firstName:"Nome",lastName:"Sobrenome",securityQuestion:"Pergunta de segurança",securityAnswer:"Resposta de segurança",playerTitle:"Título",gender:"Gênero",dateOfBirth:"Data de nascimento",currency:"Moeda",securityQuestionError:"A pergunta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",securityAnswerError:"A resposta de segurança deve ter pelo menos 1 caractere e no máximo 120 caracteres.",saveButton:"Salvar alterações",successMessage:"Suas alterações foram salvas!",errorMessageUpdate:"Ocorreu um erro ao tentar atualizar as informações do perfil",errorMessageFetch:"Ocorreu um erro ao tentar buscar as informações do perfil"},"es-mx":{title:"Información del perfil",username:"Nombre de usuario",firstName:"Nombre",lastName:"Apellido",securityQuestion:"Pregunta de seguridad",securityAnswer:"Respuesta de seguridad",playerTitle:"Título",gender:"Género",dateOfBirth:"Fecha de nacimiento",currency:"Moneda",securityQuestionError:"La pregunta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",securityAnswerError:"La respuesta de seguridad debe tener al menos 1 carácter y un máximo de 120 caracteres.",saveButton:"Guardar cambios",successMessage:"¡Tus cambios han sido guardados!",errorMessageUpdate:"Se ha producido un error al intentar actualizar la información del perfil",errorMessageFetch:"Se ha producido un error al intentar obtener la información del perfil"}},n=(e,r,n)=>{let i=t[t[r]?r:"en"][e];if(void 0!==n)for(const[e,r]of Object.entries(n.values)){const t=new RegExp(`{${e}}`,"g");i=i.replace(t,r)}return i};function i(e,r){if(e){const t=document.createElement("style");t.innerHTML=r,e.appendChild(t)}}function a(e,r){const t=new URL(r);fetch(t.href).then((e=>e.text())).then((r=>{const t=document.createElement("style");t.innerHTML=r,e&&e.appendChild(t)})).catch((e=>{console.error("There was an error while trying to load client styling from URL",e)}))}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var o={exports:{}};o.exports=function(){var e=6e4,r=36e5,t="millisecond",n="second",i="minute",a="hour",o="day",s="week",l="month",u="quarter",c="year",d="date",m="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|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,f={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(e){var r=["th","st","nd","rd"],t=e%100;return"["+e+(r[(t-20)%10]||r[t]||r[0])+"]"}},y=function(e,r,t){var n=String(e);return!n||n.length>=r?e:""+Array(r+1-n.length).join(t)+e},g={s:y,z:function(e){var r=-e.utcOffset(),t=Math.abs(r),n=Math.floor(t/60),i=t%60;return(r<=0?"+":"-")+y(n,2,"0")+":"+y(i,2,"0")},m:function e(r,t){if(r.date()<t.date())return-e(t,r);var n=12*(t.year()-r.year())+(t.month()-r.month()),i=r.clone().add(n,l),a=t-i<0,o=r.clone().add(n+(a?-1:1),l);return+(-(n+(t-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:c,w:s,d:o,D:d,h:a,m:i,s:n,ms:t,Q:u}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},w="en",v={};v[w]=f;var P="$isDayjsObject",b=function(e){return e instanceof M||!(!e||!e[P])},x=function e(r,t,n){var i;if(!r)return w;if("string"==typeof r){var a=r.toLowerCase();v[a]&&(i=a),t&&(v[a]=t,i=a);var o=r.split("-");if(!i&&o.length>1)return e(o[0])}else{var s=r.name;v[s]=r,i=s}return!n&&i&&(w=i),i||!n&&w},S=function(e,r){if(b(e))return e.clone();var t="object"==typeof r?r:{};return t.date=e,t.args=arguments,new M(t)},k=g;k.l=x,k.i=b,k.w=function(e,r){return S(e,{locale:r.$L,utc:r.$u,x:r.$x,$offset:r.$offset})};var M=function(){function f(e){this.$L=x(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[P]=!0}var y=f.prototype;return y.parse=function(e){this.$d=function(e){var r=e.date,t=e.utc;if(null===r)return new Date(NaN);if(k.u(r))return new Date;if(r instanceof Date)return new Date(r);if("string"==typeof r&&!/Z$/i.test(r)){var n=r.match(p);if(n){var i=n[2]-1||0,a=(n[7]||"0").substring(0,3);return t?new Date(Date.UTC(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],i,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(r)}(e),this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return k},y.isValid=function(){return!(this.$d.toString()===m)},y.isSame=function(e,r){var t=S(e);return this.startOf(r)<=t&&t<=this.endOf(r)},y.isAfter=function(e,r){return S(e)<this.startOf(r)},y.isBefore=function(e,r){return this.endOf(r)<S(e)},y.$g=function(e,r,t){return k.u(e)?this[r]:this.set(t,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,r){var t=this,u=!!k.u(r)||r,m=k.p(e),p=function(e,r){var n=k.w(t.$u?Date.UTC(t.$y,r,e):new Date(t.$y,r,e),t);return u?n:n.endOf(o)},h=function(e,r){return k.w(t.toDate()[e].apply(t.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(r)),t)},f=this.$W,y=this.$M,g=this.$D,w="set"+(this.$u?"UTC":"");switch(m){case c:return u?p(1,0):p(31,11);case l:return u?p(1,y):p(0,y+1);case s:var v=this.$locale().weekStart||0,P=(f<v?f+7:f)-v;return p(u?g-P:g+(6-P),y);case o:case d:return h(w+"Hours",0);case a:return h(w+"Minutes",1);case i:return h(w+"Seconds",2);case n:return h(w+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,r){var s,u=k.p(e),m="set"+(this.$u?"UTC":""),p=(s={},s[o]=m+"Date",s[d]=m+"Date",s[l]=m+"Month",s[c]=m+"FullYear",s[a]=m+"Hours",s[i]=m+"Minutes",s[n]=m+"Seconds",s[t]=m+"Milliseconds",s)[u],h=u===o?this.$D+(r-this.$W):r;if(u===l||u===c){var f=this.clone().set(d,1);f.$d[p](h),f.init(),this.$d=f.set(d,Math.min(this.$D,f.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},y.set=function(e,r){return this.clone().$set(e,r)},y.get=function(e){return this[k.p(e)]()},y.add=function(t,u){var d,m=this;t=Number(t);var p=k.p(u),h=function(e){var r=S(m);return k.w(r.date(r.date()+Math.round(e*t)),m)};if(p===l)return this.set(l,this.$M+t);if(p===c)return this.set(c,this.$y+t);if(p===o)return h(1);if(p===s)return h(7);var f=(d={},d[i]=e,d[a]=r,d[n]=1e3,d)[p]||1,y=this.$d.getTime()+t*f;return k.w(y,this)},y.subtract=function(e,r){return this.add(-1*e,r)},y.format=function(e){var r=this,t=this.$locale();if(!this.isValid())return t.invalidDate||m;var n=e||"YYYY-MM-DDTHH:mm:ssZ",i=k.z(this),a=this.$H,o=this.$m,s=this.$M,l=t.weekdays,u=t.months,c=function(e,t,i,a){return e&&(e[t]||e(r,n))||i[t].slice(0,a)},d=function(e){return k.s(a%12||12,e,"0")},p=t.meridiem||function(e,r,t){var n=e<12?"AM":"PM";return t?n.toLowerCase():n};return n.replace(h,(function(e,n){return n||function(e){switch(e){case"YY":return String(r.$y).slice(-2);case"YYYY":return k.s(r.$y,4,"0");case"M":return s+1;case"MM":return k.s(s+1,2,"0");case"MMM":return c(t.monthsShort,s,u,3);case"MMMM":return c(u,s);case"D":return r.$D;case"DD":return k.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return c(t.weekdaysMin,r.$W,l,2);case"ddd":return c(t.weekdaysShort,r.$W,l,3);case"dddd":return l[r.$W];case"H":return String(a);case"HH":return k.s(a,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return p(a,o,!0);case"A":return p(a,o,!1);case"m":return String(o);case"mm":return k.s(o,2,"0");case"s":return String(r.$s);case"ss":return k.s(r.$s,2,"0");case"SSS":return k.s(r.$ms,3,"0");case"Z":return i}return null}(e)||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(t,d,m){var p,h=this,f=k.p(d),y=S(t),g=(y.utcOffset()-this.utcOffset())*e,w=this-y,v=function(){return k.m(h,y)};switch(f){case c:p=v()/12;break;case l:p=v();break;case u:p=v()/3;break;case s:p=(w-g)/6048e5;break;case o:p=(w-g)/864e5;break;case a:p=w/r;break;case i:p=w/e;break;case n:p=w/1e3;break;default:p=w}return m?p:k.a(p)},y.daysInMonth=function(){return this.endOf(l).$D},y.$locale=function(){return v[this.$L]},y.locale=function(e,r){if(!e)return this.$L;var t=this.clone(),n=x(e,r,!0);return n&&(t.$L=n),t},y.clone=function(){return k.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},f}(),F=M.prototype;return S.prototype=F,[["$ms",t],["$s",n],["$m",i],["$H",a],["$W",o],["$M",l],["$y",c],["$D",d]].forEach((function(e){F[e[1]]=function(r){return this.$g(r,e[0],e[1])}})),S.extend=function(e,r){return e.$i||(e(r,M,S),e.$i=!0),S},S.locale=x,S.isDayjs=b,S.unix=function(e){return S(1e3*e)},S.en=v[w],S.Ls=v,S.p={},S}();const s=o.exports,l=class{constructor(t){var i;e(this,t),this.fieldsState={},this.sendLoadedMessage=()=>{window.postMessage({type:"PROFILE_LOADED"})},this.sendValidMessage=()=>{window.postMessage({type:"PROFILE_VALIDITY",data:this.isSubmitButtonAvailable})},this.sendSuccessNotification=()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:n("successMessage",this.lang)}},window.location.href)},this.sendErrorNotification=e=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:n(e,this.lang)}},window.location.href)},this.sendData=()=>{delete this.data.contacts,window.postMessage({type:"PROFILE_UPDATE_DATA",data:this.data},window.location.href)},this.messageHandler=e=>{var r;switch(null===(r=e.data)||void 0===r?void 0:r.type){case"PROFILE_DATA":this.data=e.data.data,this.resetState(),this.skeletonLoading=!1;break;case"PROFILE_SEND_DATA":this.sendData()}},this.handleFetchResponse=async e=>{var r;if(e.status>=300){this.isError=!0;let t=await e.json();return this.errorCode=null===(r=t.thirdPartyResponse)||void 0===r?void 0:r.errorCode,this.errorMessage=n(this.errorCode?this.errorCode:"errorMessageFetch",this.lang),window.postMessage({type:"WidgetNotification",data:{type:"error",message:this.errorMessage}},window.location.href),Promise.reject(this.errorMessage)}if(this.isError=!1,e.headers.get("content-type")){let r=await e.json();return Promise.resolve(r)}return Promise.resolve()},this.getData=()=>{const e=new URL(`/api/v1/players/${this.userId}/player-identifiable-information/`,this.endpoint),r=new Headers;r.append("X-SessionID",this.session);const t={method:"GET",headers:r};return new Promise(((r,n)=>{fetch(e.href,t).then((e=>this.handleFetchResponse(e))).then((e=>{this.data=e.player,r()})).catch((e=>{console.error(e),n(e)}))}))},this.buildFieldState=(e,r,t)=>Object.assign({isValid:e,initialValue:r,rule:t}),this.initData=()=>{const e={};["externalPlayerId","affiliateMarker","personalInfo","communicationInfo","signupInfo","statusInfo","securityInfo","geographicInfo","playerInfo","contacts"].forEach((r=>e[r]=this.data[r])),this.data=e},this.updateState=(e,r)=>t=>{this.data[e][r]=t.target.value;const n=this.fieldsState.data[r],i=t.target.value,a=n.rule(i);a&&!n.isValid?(n.isValid=!0,this.invalidFields-=1):!a&&n.isValid&&(n.isValid=!1,this.invalidFields+=1),this.fieldsState.hasChanged=i!==n.initialValue;const o=this.isSubmitButtonAvailable;this.updateSubmitButtonStatus(),"true"!==this.isStandAlone&&this.isSubmitButtonAvailable!==o&&this.sendValidMessage()},this.updateData=e=>{e&&e.preventDefault();const r=new URL(`/api/v1/players/${this.userId}/player-identifiable-information/`,this.endpoint),t=new Headers;t.append("X-SessionId",this.session),t.append("Content-Type","application/problem+json; charset=utf-8"),this.data.contacts&&delete this.data.contacts;const n={method:"PUT",headers:t,body:JSON.stringify(this.data)};fetch(r,n).then((e=>this.handleFetchResponse(e))).then((()=>{this.sendSuccessNotification(),this.getData().then((()=>this.resetState()))})).catch((e=>{console.error(e)}))},this.updateSubmitButtonStatus=()=>{this.isSubmitButtonAvailable=0===this.invalidFields&&this.fieldsState.hasChanged},this.editableField=(e,t,i,a)=>{const o=this.fieldsState.data[t],s=this.data[e][t];return o?r("div",{class:"Field "+(o.isValid?"":"Invalid")},r("label",null,n(i,this.lang)),r("input",{type:"text",value:s,onKeyUp:this.updateState(e,t)}),!o.isValid&&r("p",{class:"Error"},n(a,this.lang))):null},this.staticField=(e,t)=>e?r("div",{class:"Field Disabled"},r("label",null,n(t,this.lang)),r("input",{type:"text",value:e,readonly:!0})):null,this.toggleScreen=()=>{window.postMessage({type:"PlayerAccountMenuActive",isMobile:this.isMobile},window.location.href)},this.userId=void 0,this.session=void 0,this.endpoint=void 0,this.lang="en",this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl=void 0,this.dobFormat="DD/MM/YYYY",this.isStandAlone="true",this.limitStylingAppends=!1,this.skeletonLoading=!0,this.isSubmitButtonAvailable=!1,this.invalidFields=0,this.isMobile=!!((i=window.navigator.userAgent).toLowerCase().match(/android/i)||i.toLowerCase().match(/blackberry|bb/i)||i.toLowerCase().match(/iphone|ipad|ipod/i)||i.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),this.isError=!1,this.errorMessage="",this.errorCode=""}handleStylingChange(e,r){e!==r&&i(this.stylingContainer,this.clientStyling)}handleStylingUrlChange(e,r){e!==r&&a(this.stylingContainer,this.clientStylingUrl)}async componentWillLoad(){"true"===this.isStandAlone&&await this.getData().then((()=>{this.initData(),this.initEditableFieldsState()})).finally((()=>this.skeletonLoading=!1))}componentDidLoad(){this.stylingContainer&&(null!=window.emMessageBuss?function(e,r){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(r,(r=>{t.innerHTML=r,e&&e.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&i(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&a(this.stylingContainer,this.clientStylingUrl))),"true"!==this.isStandAlone&&(window.addEventListener("message",this.messageHandler,!1),this.sendLoadedMessage())}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),"true"!==this.isStandAlone&&window.removeEventListener("message",this.messageHandler,!1)}initEditableFieldsState(){var e,r;this.fieldsState.data={},this.fieldsState.hasChanged=!1,(null===(e=this.data.playerInfo)||void 0===e?void 0:e.SecurityQuestion)&&(this.fieldsState.data.SecurityQuestion=this.buildFieldState(!0,this.data.playerInfo.SecurityQuestion,(e=>e&&e.length<=120))),(null===(r=this.data.playerInfo)||void 0===r?void 0:r.SecurityAnswer)&&(this.fieldsState.data.SecurityAnswer=this.buildFieldState(!0,this.data.playerInfo.SecurityAnswer,(e=>e&&e.length<=120)))}resetState(){this.initData(),this.initEditableFieldsState(),this.invalidFields=0,this.isSubmitButtonAvailable=!1}render(){return!this.skeletonLoading&&this.isError?r("div",{class:"errorContainer"},r("p",{class:"errorMessage",innerHTML:this.errorMessage})):r("div",{ref:e=>this.stylingContainer=e},this.skeletonLoading?r("form",{class:"PamPlayerProfileWrapper skeleton"},r("div",{class:"ReturnButton"},r("ui-skeleton",{structure:"title",width:"auto",height:"30px"})),r("div",{class:"Section"},r("section",{class:"SectionContent"},[...Array(6).keys()].map((()=>r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"})))),r("div",{class:"CompoundField"},r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"})),r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"100%",height:"20px"}))),r("div",{class:"Field"},r("ui-skeleton",{structure:"text",width:"auto","margin-bottom":"10px",height:"10px"}),r("ui-skeleton",{structure:"rectangle",width:"auto",height:"20px"})))),r("section",{class:"ButtonsArea"},r("div",{class:"SaveButton"},r("ui-skeleton",{structure:"rectangle",width:"auto",height:"50px"})))):r("form",{class:"PamPlayerProfileWrapper "+(this.isMobile?"Mobile":"")},r("div",{class:"ReturnButton",onClick:this.toggleScreen},r("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15"},r("g",{transform:"translate(-20 -158)"},r("g",{transform:"translate(20 158)"},r("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)"})))),r("h2",null,n("title",this.lang))),r("h2",{class:"HeaderText"},n("title",this.lang)),r("div",{class:"Section"},r("section",{class:"SectionContent"},this.staticField(this.data.contacts.find((e=>e.contatcType="Username")).contactValue,"username"),this.staticField(s(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"),r("div",{class:"CompoundField"},this.staticField(this.data.personalInfo.title,"playerTitle"),this.staticField(this.data.personalInfo.gender,"gender")),this.staticField(this.data.communicationInfo.currency,"currency"))),"true"===this.isStandAlone&&r("section",{class:"ButtonsArea"},r("button",{class:"SaveButton "+(this.isSubmitButtonAvailable?"":"Disabled"),onClick:this.updateData},n("saveButton")))))}static get watchers(){return{clientStyling:["handleStylingChange"],clientStylingUrl:["handleStylingUrlChange"]}}};l.style=':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.errorContainer {\n font-family: "Roboto";\n font-style: normal;\n font-family: sans-serif;\n display: flex;\n flex-direction: column;\n gap: 24px;\n width: 100%;\n height: 100%;\n}\n.errorContainer .errorMessage {\n color: var(--emw--color-error, var(--emw--color-red, #ed0909));\n font-size: var(--emw-font-size-small, 13px);\n display: block;\n justify-content: center;\n text-align: center;\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}';export{l as P}
|