@everymatrix/pam-metadata 1.71.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-42065499.js +1184 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/pam-metadata-f2657afb.js +227 -0
- package/dist/cjs/pam-metadata.cjs.js +25 -0
- package/dist/cjs/pam-metadata_2.cjs.entry.js +183 -0
- package/dist/collection/collection-manifest.json +19 -0
- package/dist/collection/components/pam-metadata/index.js +1 -0
- package/dist/collection/components/pam-metadata/pam-metadata.css +28 -0
- package/dist/collection/components/pam-metadata/pam-metadata.js +272 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +71 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-c1c08349.js +1157 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/pam-metadata-072ea225.js +225 -0
- package/dist/esm/pam-metadata.js +20 -0
- package/dist/esm/pam-metadata_2.entry.js +178 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/pam-metadata/app-globals-0f993ce5.js +1 -0
- package/dist/pam-metadata/index-c1c08349.js +2 -0
- package/dist/pam-metadata/index.esm.js +1 -0
- package/dist/pam-metadata/pam-metadata-072ea225.js +1 -0
- package/dist/pam-metadata/pam-metadata.esm.js +1 -0
- package/dist/pam-metadata/pam-metadata_2.entry.js +1 -0
- package/dist/stencil.config.dev.js +19 -0
- package/dist/stencil.config.js +19 -0
- package/dist/storybook/main.js +43 -0
- package/dist/storybook/preview.js +9 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/packages/stencil/pam-metadata/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/packages/stencil/pam-metadata/stencil.config.dev.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/packages/stencil/pam-metadata/storybook/main.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/packages/stencil/pam-metadata/storybook/preview.d.ts +70 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/tools/plugins/index.d.ts +3 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/pam-metadata/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
- package/dist/types/components/pam-metadata/index.d.ts +1 -0
- package/dist/types/components/pam-metadata/pam-metadata.d.ts +26 -0
- package/dist/types/components.d.ts +55 -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 +4 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-42065499.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
const defineCustomElements = async (win, options) => {
|
|
9
|
+
if (typeof window === 'undefined') return undefined;
|
|
10
|
+
await appGlobals.globalScripts();
|
|
11
|
+
return index.bootstrapLazy([["pam-metadata_2.cjs",[[1,"pam-metadata",{"language":[513],"endpoint":[513],"session":[513],"userId":[513,"user-id"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isLoading":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.setNonce = index.setNonce;
|
|
15
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-42065499.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @name setClientStyling
|
|
7
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
8
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
9
|
+
* @param {string} clientStyling The style content
|
|
10
|
+
*/
|
|
11
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
12
|
+
if (stylingContainer) {
|
|
13
|
+
const sheet = document.createElement('style');
|
|
14
|
+
sheet.innerHTML = clientStyling;
|
|
15
|
+
stylingContainer.appendChild(sheet);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @name setClientStylingURL
|
|
21
|
+
* @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
|
|
22
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
23
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
24
|
+
*/
|
|
25
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
26
|
+
const url = new URL(clientStylingUrl);
|
|
27
|
+
|
|
28
|
+
fetch(url.href)
|
|
29
|
+
.then((res) => res.text())
|
|
30
|
+
.then((data) => {
|
|
31
|
+
const cssFile = document.createElement('style');
|
|
32
|
+
cssFile.innerHTML = data;
|
|
33
|
+
if (stylingContainer) {
|
|
34
|
+
stylingContainer.appendChild(cssFile);
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
.catch((err) => {
|
|
38
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @name setStreamLibrary
|
|
44
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
45
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
46
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
47
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
48
|
+
*/
|
|
49
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
50
|
+
if (window.emMessageBus) {
|
|
51
|
+
const sheet = document.createElement('style');
|
|
52
|
+
|
|
53
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
54
|
+
sheet.innerHTML = data;
|
|
55
|
+
if (stylingContainer) {
|
|
56
|
+
stylingContainer.appendChild(sheet);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
63
|
+
const TRANSLATIONS = {
|
|
64
|
+
"en": {
|
|
65
|
+
title: "Player Info",
|
|
66
|
+
lastLoginText: "Last login date: {lastLoginTimestamp}.",
|
|
67
|
+
errorFetchMessage: "There was an error when fetching last login date"
|
|
68
|
+
},
|
|
69
|
+
"tr": {
|
|
70
|
+
title: "Oyuncu Bilgisi",
|
|
71
|
+
lastLoginText: "Son giriş tarihi: {lastLoginTimestamp}.",
|
|
72
|
+
errorFetchMessage: "Son giriş tarihi alınırken bir hata oluştu"
|
|
73
|
+
},
|
|
74
|
+
"ro": {
|
|
75
|
+
title: "Informații jucător",
|
|
76
|
+
lastLoginText: "Data ultimei autentificări: {lastLoginTimestamp}.",
|
|
77
|
+
errorFetchMessage: "A apărut o eroare la preluarea datei ultimei autentificări"
|
|
78
|
+
},
|
|
79
|
+
"hr": {
|
|
80
|
+
title: "Informacije o igraču",
|
|
81
|
+
lastLoginText: "Datum zadnje prijave: {lastLoginTimestamp}.",
|
|
82
|
+
errorFetchMessage: "Došlo je do pogreške prilikom dohvaćanja datuma zadnje prijave"
|
|
83
|
+
},
|
|
84
|
+
"pt-br": {
|
|
85
|
+
title: "Informações do Jogador",
|
|
86
|
+
lastLoginText: "Data do último login: {lastLoginTimestamp}.",
|
|
87
|
+
errorFetchMessage: "Ocorreu um erro ao buscar a data do último login"
|
|
88
|
+
},
|
|
89
|
+
"es-mx": {
|
|
90
|
+
title: "Información del Jugador",
|
|
91
|
+
lastLoginText: "Fecha del último inicio de sesión: {lastLoginTimestamp}.",
|
|
92
|
+
errorFetchMessage: "Hubo un error al obtener la fecha del último inicio de sesión"
|
|
93
|
+
},
|
|
94
|
+
"es": {
|
|
95
|
+
title: "Información del Jugador",
|
|
96
|
+
lastLoginText: "Fecha del último inicio de sesión: {lastLoginTimestamp}.",
|
|
97
|
+
errorFetchMessage: "Hubo un error al obtener la fecha del último inicio de sesión"
|
|
98
|
+
},
|
|
99
|
+
"pt": {
|
|
100
|
+
title: "Informações do Jogador",
|
|
101
|
+
lastLoginText: "Data do último login: {lastLoginTimestamp}.",
|
|
102
|
+
errorFetchMessage: "Ocorreu um erro ao buscar a data do último login"
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const getTranslations = (url) => {
|
|
106
|
+
return new Promise((resolve) => {
|
|
107
|
+
fetch(url)
|
|
108
|
+
.then((res) => res.json())
|
|
109
|
+
.then((data) => {
|
|
110
|
+
Object.keys(data).forEach((lang) => {
|
|
111
|
+
if (!TRANSLATIONS[lang]) {
|
|
112
|
+
TRANSLATIONS[lang] = {};
|
|
113
|
+
}
|
|
114
|
+
for (let key in data[lang]) {
|
|
115
|
+
TRANSLATIONS[lang][key] = data[lang][key];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
resolve(true);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
const translate = (key, customLang, values) => {
|
|
123
|
+
const lang = customLang;
|
|
124
|
+
let translation = TRANSLATIONS[((lang !== undefined) && (lang in TRANSLATIONS)) ? lang : DEFAULT_LANGUAGE][key];
|
|
125
|
+
if (values !== undefined) {
|
|
126
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
127
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
128
|
+
translation = translation.replace(regex, value);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return translation;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
135
|
+
|
|
136
|
+
var dayjs_min = {exports: {}};
|
|
137
|
+
|
|
138
|
+
(function (module, exports) {
|
|
139
|
+
!function(t,e){module.exports=e();}(commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return b.s(e.$y,4,"0");case"M":return a+1;case"MM":return b.s(a+1,2,"0");case"MMM":return h(n.monthsShort,a,c,3);case"MMMM":return h(c,a);case"D":return e.$D;case"DD":return b.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return h(n.weekdaysMin,e.$W,o,2);case"ddd":return h(n.weekdaysShort,e.$W,o,3);case"dddd":return o[e.$W];case"H":return String(s);case"HH":return b.s(s,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return $(s,u,!0);case"A":return $(s,u,!1);case"m":return String(u);case"mm":return b.s(u,2,"0");case"s":return String(e.$s);case"ss":return b.s(e.$s,2,"0");case"SSS":return b.s(e.$ms,3,"0");case"Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
140
|
+
}(dayjs_min));
|
|
141
|
+
|
|
142
|
+
const dayjs = dayjs_min.exports;
|
|
143
|
+
|
|
144
|
+
const pamMetadataCss = ":host{display:block}.PamMetadata .LoadingSkeleton{width:100%;display:flex;flex-direction:column;gap:10px}.PamMetadata .LoadingSkeleton .Title{width:100px}.PamMetadata .LoadingSkeleton .Text{width:200px}.PamMetadata .TextContainer{display:flex;flex-direction:column;color:var(--emw--color-typography, #000000);font-size:var(--emw--font-size-small, 12px)}.PamMetadata .TextContainer h4{color:var(--emw--color-primary, #22B04E);font-size:var(--emw--font-size-medium, 18px);margin-top:5px;margin-bottom:5px}";
|
|
145
|
+
const PamMetadataStyle0 = pamMetadataCss;
|
|
146
|
+
|
|
147
|
+
const PamMetadata = class {
|
|
148
|
+
constructor(hostRef) {
|
|
149
|
+
index.registerInstance(this, hostRef);
|
|
150
|
+
this.data = null;
|
|
151
|
+
this.getData = () => {
|
|
152
|
+
const url = new URL(`api/v1/players/${this.userId}/player-identifiable-information/`, this.endpoint);
|
|
153
|
+
const headers = new Headers({ 'X-SessionID': this.session });
|
|
154
|
+
const options = { method: 'GET', headers };
|
|
155
|
+
return fetch(url.href, options).then(res => {
|
|
156
|
+
if (res.ok) {
|
|
157
|
+
return res.json().then(res => res);
|
|
158
|
+
}
|
|
159
|
+
throw new Error;
|
|
160
|
+
}).catch(() => {
|
|
161
|
+
window.postMessage({ type: 'WidgetNotification', data: { type: 'error', message: translate('errorFetchMessage', this.language) } }, window.location.href);
|
|
162
|
+
return null;
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
this.formatDate = (date) => {
|
|
166
|
+
return dayjs(date).format(this.dateFormat);
|
|
167
|
+
};
|
|
168
|
+
this.loadingSkeleton = (index.h("div", { class: "LoadingSkeleton" }, index.h("div", { class: "Title" }, index.h("ui-skeleton", { structure: "title", width: "100%", height: "18px" })), index.h("div", { class: "Text" }, index.h("ui-skeleton", { structure: "text", width: "100%", height: "14px" }))));
|
|
169
|
+
this.language = 'en';
|
|
170
|
+
this.endpoint = '';
|
|
171
|
+
this.session = '';
|
|
172
|
+
this.userId = '';
|
|
173
|
+
this.dateFormat = 'DD/MM/YYYY HH:mm';
|
|
174
|
+
this.mbSource = '';
|
|
175
|
+
this.clientStyling = '';
|
|
176
|
+
this.clientStylingUrl = '';
|
|
177
|
+
this.translationUrl = '';
|
|
178
|
+
this.isLoading = true;
|
|
179
|
+
}
|
|
180
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
181
|
+
if (newValue != oldValue) {
|
|
182
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
handleClientStylingUrlChange(newValue, oldValue) {
|
|
186
|
+
if (newValue != oldValue) {
|
|
187
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
handleMbSourceChange(newValue, oldValue) {
|
|
191
|
+
if (newValue != oldValue) {
|
|
192
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
componentWillLoad() {
|
|
196
|
+
this.getData().then(res => res && (this.data = res.player, this.isLoading = false));
|
|
197
|
+
if (this.translationUrl) {
|
|
198
|
+
return getTranslations(this.translationUrl);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
componentDidLoad() {
|
|
202
|
+
if (this.stylingContainer) {
|
|
203
|
+
if (this.mbSource)
|
|
204
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
205
|
+
if (this.clientStyling)
|
|
206
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
207
|
+
if (this.clientStylingUrl)
|
|
208
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
disconnectedCallback() {
|
|
212
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
213
|
+
}
|
|
214
|
+
render() {
|
|
215
|
+
return (index.h("div", { key: '36a2665c4e000c17c8bc847b009f64a91d1b1ce4', ref: (el) => (this.stylingContainer = el), class: "PamMetadata" }, this.isLoading
|
|
216
|
+
? this.loadingSkeleton
|
|
217
|
+
: index.h("div", { class: "TextContainer" }, index.h("h4", null, translate('title')), index.h("div", { innerHTML: translate('lastLoginText', this.language, { values: { lastLoginTimestamp: this.formatDate(this.data.statusInfo.lastLogin) } }) }))));
|
|
218
|
+
}
|
|
219
|
+
static get watchers() { return {
|
|
220
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
221
|
+
"clientStylingUrl": ["handleClientStylingUrlChange"],
|
|
222
|
+
"mbSource": ["handleMbSourceChange"]
|
|
223
|
+
}; }
|
|
224
|
+
};
|
|
225
|
+
PamMetadata.style = PamMetadataStyle0;
|
|
226
|
+
|
|
227
|
+
exports.PamMetadata = PamMetadata;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-42065499.js');
|
|
6
|
+
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
10
|
+
*/
|
|
11
|
+
var patchBrowser = () => {
|
|
12
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('pam-metadata.cjs.js', document.baseURI).href));
|
|
13
|
+
const opts = {};
|
|
14
|
+
if (importMeta !== "") {
|
|
15
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
16
|
+
}
|
|
17
|
+
return index.promiseResolve(opts);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
patchBrowser().then(async (options) => {
|
|
21
|
+
await appGlobals.globalScripts();
|
|
22
|
+
return index.bootstrapLazy([["pam-metadata_2.cjs",[[1,"pam-metadata",{"language":[513],"endpoint":[513],"session":[513],"userId":[513,"user-id"],"dateFormat":[513,"date-format"],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"isLoading":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const pamMetadata = require('./pam-metadata-f2657afb.js');
|
|
6
|
+
const index = require('./index-42065499.js');
|
|
7
|
+
|
|
8
|
+
const uiSkeletonCss = ":host{display:block}.Skeleton{animation:skeleton-loading 1s linear infinite alternate}.Rectangle{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)}.Circle{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%}.Text{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)}.Text:last-child{width:calc(var(--emw-skeleton-text-width, 400px) - 100px)}.Title{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)}.Image{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)}.Logo{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)}}";
|
|
9
|
+
const UiSkeletonStyle0 = uiSkeletonCss;
|
|
10
|
+
|
|
11
|
+
const UiSkeleton = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.stylingValue = {
|
|
15
|
+
width: this.handleStylingProps(this.width),
|
|
16
|
+
height: this.handleStylingProps(this.height),
|
|
17
|
+
borderRadius: this.handleStylingProps(this.borderRadius),
|
|
18
|
+
marginBottom: this.handleStylingProps(this.marginBottom),
|
|
19
|
+
marginTop: this.handleStylingProps(this.marginTop),
|
|
20
|
+
marginLeft: this.handleStylingProps(this.marginLeft),
|
|
21
|
+
marginRight: this.handleStylingProps(this.marginRight),
|
|
22
|
+
size: this.handleStylingProps(this.size)
|
|
23
|
+
};
|
|
24
|
+
this.structure = undefined;
|
|
25
|
+
this.width = 'unset';
|
|
26
|
+
this.height = 'unset';
|
|
27
|
+
this.borderRadius = 'unset';
|
|
28
|
+
this.marginBottom = 'unset';
|
|
29
|
+
this.marginTop = 'unset';
|
|
30
|
+
this.marginLeft = 'unset';
|
|
31
|
+
this.marginRight = 'unset';
|
|
32
|
+
this.animation = true;
|
|
33
|
+
this.rows = 0;
|
|
34
|
+
this.size = '100%';
|
|
35
|
+
}
|
|
36
|
+
handleStructureChange(newValue, oldValue) {
|
|
37
|
+
if (oldValue !== newValue) {
|
|
38
|
+
this.handleStructure(newValue);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handleStylingProps(value) {
|
|
42
|
+
switch (typeof value) {
|
|
43
|
+
case 'number':
|
|
44
|
+
return value === 0 ? 0 : `${value}px`;
|
|
45
|
+
case 'undefined':
|
|
46
|
+
return 'unset';
|
|
47
|
+
case 'string':
|
|
48
|
+
if (['auto', 'unset', 'none', 'inherit', 'initial'].includes(value) ||
|
|
49
|
+
value.endsWith('px') ||
|
|
50
|
+
value.endsWith('%')) {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return 'unset';
|
|
55
|
+
}
|
|
56
|
+
default:
|
|
57
|
+
return 'unset';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
handleStructure(structure) {
|
|
61
|
+
switch (structure) {
|
|
62
|
+
case 'logo':
|
|
63
|
+
return this.renderLogo();
|
|
64
|
+
case 'image':
|
|
65
|
+
return this.renderImage();
|
|
66
|
+
case 'title':
|
|
67
|
+
return this.renderTitle();
|
|
68
|
+
case 'text':
|
|
69
|
+
return this.renderText();
|
|
70
|
+
case 'rectangle':
|
|
71
|
+
return this.renderRectangle();
|
|
72
|
+
case 'circle':
|
|
73
|
+
return this.renderCircle();
|
|
74
|
+
default:
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
renderLogo() {
|
|
79
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Logo ' + (this.animation ? 'Skeleton' : '') })));
|
|
80
|
+
}
|
|
81
|
+
renderImage() {
|
|
82
|
+
return index.h("div", { class: 'Image ' + (this.animation ? 'Skeleton' : '') });
|
|
83
|
+
}
|
|
84
|
+
renderTitle() {
|
|
85
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Title ' + (this.animation ? 'Skeleton' : '') })));
|
|
86
|
+
}
|
|
87
|
+
renderText() {
|
|
88
|
+
return (index.h("div", { class: "SkeletonContainer" }, Array.from({ length: this.rows > 0 ? this.rows : 1 }).map((_, index$1) => (index.h("div", { key: index$1, class: 'Text ' + (this.animation ? 'Skeleton' : '') })))));
|
|
89
|
+
}
|
|
90
|
+
renderRectangle() {
|
|
91
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Rectangle ' + (this.animation ? 'Skeleton' : '') })));
|
|
92
|
+
}
|
|
93
|
+
renderCircle() {
|
|
94
|
+
return (index.h("div", { class: "SkeletonContainer" }, index.h("div", { class: 'Circle ' + (this.animation ? 'Skeleton' : '') })));
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
let styleBlock = '';
|
|
98
|
+
switch (this.structure) {
|
|
99
|
+
case 'logo':
|
|
100
|
+
styleBlock = `
|
|
101
|
+
:host {
|
|
102
|
+
--emw-skeleton-logo-width: ${this.stylingValue.width};
|
|
103
|
+
--emw-skeleton-logo-height: ${this.stylingValue.height};
|
|
104
|
+
--emw-skeleton-logo-border-radius: ${this.stylingValue.borderRadius};
|
|
105
|
+
--emw-skeleton-logo-margin-bottom: ${this.stylingValue.marginBottom};
|
|
106
|
+
--emw-skeleton-logo-margin-top: ${this.stylingValue.marginTop};
|
|
107
|
+
--emw-skeleton-logo-margin-left: ${this.stylingValue.marginLeft};
|
|
108
|
+
--emw-skeleton-logo-margin-right: ${this.stylingValue.marginRight};
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
break;
|
|
112
|
+
case 'image':
|
|
113
|
+
styleBlock = `
|
|
114
|
+
:host {
|
|
115
|
+
--emw-skeleton-image-width: ${this.stylingValue.width};
|
|
116
|
+
--emw-skeleton-image-height: ${this.stylingValue.height};
|
|
117
|
+
--emw-skeleton-image-border-radius: ${this.stylingValue.borderRadius};
|
|
118
|
+
--emw-skeleton-image-margin-bottom: ${this.stylingValue.marginBottom};
|
|
119
|
+
--emw-skeleton-image-margin-top: ${this.stylingValue.marginTop};
|
|
120
|
+
--emw-skeleton-image-margin-left: ${this.stylingValue.marginLeft};
|
|
121
|
+
--emw-skeleton-image-margin-right: ${this.stylingValue.marginRight};
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
break;
|
|
125
|
+
case 'title':
|
|
126
|
+
styleBlock = `
|
|
127
|
+
:host {
|
|
128
|
+
--emw-skeleton-title-width: ${this.stylingValue.width};
|
|
129
|
+
--emw-skeleton-title-height: ${this.stylingValue.height};
|
|
130
|
+
--emw-skeleton-title-border-radius: ${this.stylingValue.borderRadius};
|
|
131
|
+
--emw-skeleton-title-margin-bottom: ${this.stylingValue.marginBottom};
|
|
132
|
+
--emw-skeleton-title-margin-top: ${this.stylingValue.marginTop};
|
|
133
|
+
--emw-skeleton-title-margin-left: ${this.stylingValue.marginLeft};
|
|
134
|
+
--emw-skeleton-title-margin-right: ${this.stylingValue.marginRight};
|
|
135
|
+
}
|
|
136
|
+
`;
|
|
137
|
+
break;
|
|
138
|
+
case 'text':
|
|
139
|
+
styleBlock = `
|
|
140
|
+
:host {
|
|
141
|
+
--emw-skeleton-text-width: ${this.stylingValue.width};
|
|
142
|
+
--emw-skeleton-text-height: ${this.stylingValue.height};
|
|
143
|
+
--emw-skeleton-text-border-radius: ${this.stylingValue.borderRadius};
|
|
144
|
+
--emw-skeleton-text-margin-bottom: ${this.stylingValue.marginBottom};
|
|
145
|
+
--emw-skeleton-text-margin-top: ${this.stylingValue.marginTop};
|
|
146
|
+
--emw-skeleton-text-margin-left: ${this.stylingValue.marginLeft};
|
|
147
|
+
--emw-skeleton-text-margin-right: ${this.stylingValue.marginRight};
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
break;
|
|
151
|
+
case 'rectangle':
|
|
152
|
+
styleBlock = `
|
|
153
|
+
:host {
|
|
154
|
+
--emw-skeleton-rectangle-width: ${this.stylingValue.width};
|
|
155
|
+
--emw-skeleton-rectangle-height: ${this.stylingValue.height};
|
|
156
|
+
--emw-skeleton-rectangle-border-radius: ${this.stylingValue.borderRadius};
|
|
157
|
+
--emw-skeleton-rectangle-margin-bottom: ${this.stylingValue.marginBottom};
|
|
158
|
+
--emw-skeleton-rectangle-margin-top: ${this.stylingValue.marginTop};
|
|
159
|
+
--emw-skeleton-rectangle-margin-left: ${this.stylingValue.marginLeft};
|
|
160
|
+
--emw-skeleton-rectangle-margin-right: ${this.stylingValue.marginRight};
|
|
161
|
+
}
|
|
162
|
+
`;
|
|
163
|
+
break;
|
|
164
|
+
case 'circle':
|
|
165
|
+
styleBlock = `
|
|
166
|
+
:host {
|
|
167
|
+
--emw-skeleton-circle-size: ${this.stylingValue.size};
|
|
168
|
+
}
|
|
169
|
+
`;
|
|
170
|
+
break;
|
|
171
|
+
default:
|
|
172
|
+
styleBlock = '';
|
|
173
|
+
}
|
|
174
|
+
return (index.h(index.Host, { key: 'e6b885bfd985ce7663d990756fe9101e25eb97f0' }, index.h("style", { key: '06ae24c7bb74f4dacfc12ae58085333f9dc89da5' }, styleBlock), this.handleStructure(this.structure)));
|
|
175
|
+
}
|
|
176
|
+
static get watchers() { return {
|
|
177
|
+
"structure": ["handleStructureChange"]
|
|
178
|
+
}; }
|
|
179
|
+
};
|
|
180
|
+
UiSkeleton.style = UiSkeletonStyle0;
|
|
181
|
+
|
|
182
|
+
exports.pam_metadata = pamMetadata.PamMetadata;
|
|
183
|
+
exports.ui_skeleton = UiSkeleton;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entries": [
|
|
3
|
+
"components/pam-metadata/pam-metadata.js"
|
|
4
|
+
],
|
|
5
|
+
"compiler": {
|
|
6
|
+
"name": "@stencil/core",
|
|
7
|
+
"version": "4.19.2",
|
|
8
|
+
"typescriptVersion": "5.4.5"
|
|
9
|
+
},
|
|
10
|
+
"collections": [
|
|
11
|
+
{
|
|
12
|
+
"name": "@everymatrix/ui-skeleton",
|
|
13
|
+
"tags": [
|
|
14
|
+
"ui-skeleton"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"bundles": []
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PamMetadata } from './pam-metadata';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.PamMetadata .LoadingSkeleton {
|
|
6
|
+
width: 100%;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 10px;
|
|
10
|
+
}
|
|
11
|
+
.PamMetadata .LoadingSkeleton .Title {
|
|
12
|
+
width: 100px;
|
|
13
|
+
}
|
|
14
|
+
.PamMetadata .LoadingSkeleton .Text {
|
|
15
|
+
width: 200px;
|
|
16
|
+
}
|
|
17
|
+
.PamMetadata .TextContainer {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
color: var(--emw--color-typography, #000000);
|
|
21
|
+
font-size: var(--emw--font-size-small, 12px);
|
|
22
|
+
}
|
|
23
|
+
.PamMetadata .TextContainer h4 {
|
|
24
|
+
color: var(--emw--color-primary, #22B04E);
|
|
25
|
+
font-size: var(--emw--font-size-medium, 18px);
|
|
26
|
+
margin-top: 5px;
|
|
27
|
+
margin-bottom: 5px;
|
|
28
|
+
}
|