@everymatrix/general-logout 0.0.365 → 0.0.367

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.
@@ -1,10 +1,10 @@
1
-
2
- export const logOutIcon = `<svg version="1.1" fill="#fff" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
- viewBox="0 0 384.971 384.971" style="enable-background:new 0 0 384.971 384.971;" xml:space="preserve">
4
- <path style="color: #fff" d="M180.455,360.91H24.061V24.061h156.394c6.641,0,12.03-5.39,12.03-12.03s-5.39-12.03-12.03-12.03H12.03
5
- C5.39,0.001,0,5.39,0,12.031V372.94c0,6.641,5.39,12.03,12.03,12.03h168.424c6.641,0,12.03-5.39,12.03-12.03
6
- C192.485,366.299,187.095,360.91,180.455,360.91z"/>
7
- <path style="color: #fff" d="M381.481,184.088l-83.009-84.2c-4.704-4.752-12.319-4.74-17.011,0c-4.704,4.74-4.704,12.439,0,17.179l62.558,63.46H96.279
8
- c-6.641,0-12.03,5.438-12.03,12.151c0,6.713,5.39,12.151,12.03,12.151h247.74l-62.558,63.46c-4.704,4.752-4.704,12.439,0,17.179
9
- c4.704,4.752,12.319,4.752,17.011,0l82.997-84.2C386.113,196.588,386.161,188.756,381.481,184.088z"/>
1
+
2
+ export const logOutIcon = `<svg version="1.1" fill="#fff" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
3
+ viewBox="0 0 384.971 384.971" style="enable-background:new 0 0 384.971 384.971;" xml:space="preserve">
4
+ <path style="color: #fff" d="M180.455,360.91H24.061V24.061h156.394c6.641,0,12.03-5.39,12.03-12.03s-5.39-12.03-12.03-12.03H12.03
5
+ C5.39,0.001,0,5.39,0,12.031V372.94c0,6.641,5.39,12.03,12.03,12.03h168.424c6.641,0,12.03-5.39,12.03-12.03
6
+ C192.485,366.299,187.095,360.91,180.455,360.91z"/>
7
+ <path style="color: #fff" d="M381.481,184.088l-83.009-84.2c-4.704-4.752-12.319-4.74-17.011,0c-4.704,4.74-4.704,12.439,0,17.179l62.558,63.46H96.279
8
+ c-6.641,0-12.03,5.438-12.03,12.151c0,6.713,5.39,12.151,12.03,12.151h247.74l-62.558,63.46c-4.704,4.752-4.704,12.439,0,17.179
9
+ c4.704,4.752,12.319,4.752,17.011,0l82.997-84.2C386.113,196.588,386.161,188.756,381.481,184.088z"/>
10
10
  </svg>`;
package/index.html CHANGED
@@ -1,37 +1,37 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset='utf-8'>
5
- <meta name='viewport' content='width=device-width,initial-scale=1'>
6
-
7
- <title>
8
- general-logout
9
- </title>
10
- <link rel="stylesheet" href="public/reset.css">
11
- <script src='dist/general-logout.js'></script>
12
- </head>
13
-
14
- <body>
15
- <style>
16
- html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
17
- .header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
18
- .header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
19
- .header__name { color: #fff; }
20
- .header__name span { margin-right: 10px; font-weight: bold; }
21
- .webcomponent { padding: 10px 20px; }
22
- </style>
23
- <header class="header">
24
- <div class="header__logo">
25
- <svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
26
- </div>
27
- <h1 class="header__name">
28
- <span>WEBCOMPONENT:</span> general-logout
29
- </h1>
30
- </header>
31
-
32
- <div class="webcomponent">
33
- <general-logout lang="en"></general-logout>
34
- </div>
35
-
36
- </body>
37
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset='utf-8'>
5
+ <meta name='viewport' content='width=device-width,initial-scale=1'>
6
+
7
+ <title>
8
+ general-logout
9
+ </title>
10
+ <link rel="stylesheet" href="public/reset.css">
11
+ <script src='dist/general-logout.js'></script>
12
+ </head>
13
+
14
+ <body>
15
+ <style>
16
+ html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
17
+ .header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
18
+ .header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
19
+ .header__name { color: #fff; }
20
+ .header__name span { margin-right: 10px; font-weight: bold; }
21
+ .webcomponent { padding: 10px 20px; }
22
+ </style>
23
+ <header class="header">
24
+ <div class="header__logo">
25
+ <svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
26
+ </div>
27
+ <h1 class="header__name">
28
+ <span>WEBCOMPONENT:</span> general-logout
29
+ </h1>
30
+ </header>
31
+
32
+ <div class="webcomponent">
33
+ <general-logout lang="en"></general-logout>
34
+ </div>
35
+
36
+ </body>
37
+ </html>
package/index.js CHANGED
@@ -1 +1 @@
1
- import './dist/general-logout.js';
1
+ import './dist/general-logout.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/general-logout",
3
- "version": "0.0.365",
3
+ "version": "0.0.367",
4
4
  "main": "dist/general-logout.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "f4dabfce4df55a591981f327a670cc250a2ed257"
39
+ "gitHead": "2862d37a634bee597aaac02d75aead918718617d"
40
40
  }
package/public/reset.css CHANGED
@@ -1,48 +1,48 @@
1
- /* http://meyerweb.com/eric/tools/css/reset/
2
- v2.0 | 20110126
3
- License: none (public domain)
4
- */
5
-
6
- html, body, div, span, applet, object, iframe,
7
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
- a, abbr, acronym, address, big, cite, code,
9
- del, dfn, em, img, ins, kbd, q, s, samp,
10
- small, strike, strong, sub, sup, tt, var,
11
- b, u, i, center,
12
- dl, dt, dd, ol, ul, li,
13
- fieldset, form, label, legend,
14
- table, caption, tbody, tfoot, thead, tr, th, td,
15
- article, aside, canvas, details, embed,
16
- figure, figcaption, footer, header, hgroup,
17
- menu, nav, output, ruby, section, summary,
18
- time, mark, audio, video {
19
- margin: 0;
20
- padding: 0;
21
- border: 0;
22
- font-size: 100%;
23
- font: inherit;
24
- vertical-align: baseline;
25
- }
26
- /* HTML5 display-role reset for older browsers */
27
- article, aside, details, figcaption, figure,
28
- footer, header, hgroup, menu, nav, section {
29
- display: block;
30
- }
31
- body {
32
- line-height: 1;
33
- }
34
- ol, ul {
35
- list-style: none;
36
- }
37
- blockquote, q {
38
- quotes: none;
39
- }
40
- blockquote:before, blockquote:after,
41
- q:before, q:after {
42
- content: '';
43
- content: none;
44
- }
45
- table {
46
- border-collapse: collapse;
47
- border-spacing: 0;
1
+ /* http://meyerweb.com/eric/tools/css/reset/
2
+ v2.0 | 20110126
3
+ License: none (public domain)
4
+ */
5
+
6
+ html, body, div, span, applet, object, iframe,
7
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
+ a, abbr, acronym, address, big, cite, code,
9
+ del, dfn, em, img, ins, kbd, q, s, samp,
10
+ small, strike, strong, sub, sup, tt, var,
11
+ b, u, i, center,
12
+ dl, dt, dd, ol, ul, li,
13
+ fieldset, form, label, legend,
14
+ table, caption, tbody, tfoot, thead, tr, th, td,
15
+ article, aside, canvas, details, embed,
16
+ figure, figcaption, footer, header, hgroup,
17
+ menu, nav, output, ruby, section, summary,
18
+ time, mark, audio, video {
19
+ margin: 0;
20
+ padding: 0;
21
+ border: 0;
22
+ font-size: 100%;
23
+ font: inherit;
24
+ vertical-align: baseline;
25
+ }
26
+ /* HTML5 display-role reset for older browsers */
27
+ article, aside, details, figcaption, figure,
28
+ footer, header, hgroup, menu, nav, section {
29
+ display: block;
30
+ }
31
+ body {
32
+ line-height: 1;
33
+ }
34
+ ol, ul {
35
+ list-style: none;
36
+ }
37
+ blockquote, q {
38
+ quotes: none;
39
+ }
40
+ blockquote:before, blockquote:after,
41
+ q:before, q:after {
42
+ content: '';
43
+ content: none;
44
+ }
45
+ table {
46
+ border-collapse: collapse;
47
+ border-spacing: 0;
48
48
  }
package/rollup.config.js CHANGED
@@ -1,67 +1,67 @@
1
- import svelte from 'rollup-plugin-svelte';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import resolve from '@rollup/plugin-node-resolve';
4
- import serve from 'rollup-plugin-dev-server';
5
- import livereload from 'rollup-plugin-livereload';
6
- import { terser } from 'rollup-plugin-terser';
7
- import sveltePreprocess from 'svelte-preprocess';
8
- import typescript from '@rollup/plugin-typescript';
9
- import uglify from 'rollup-plugin-uglify';
10
- import image from '@rollup/plugin-image';
11
-
12
- const production = process.env.NODE_ENV == 'production';
13
- const dev = process.env.NODE_ENV == 'development';
14
-
15
- export default {
16
- input: 'src/index.ts',
17
- output: {
18
- sourcemap: true,
19
- format: 'umd',
20
- name: 'app',
21
- file: 'dist/general-logout.js',
22
- },
23
- plugins: [
24
- svelte({
25
- preprocess: sveltePreprocess(),
26
- compilerOptions: {
27
- // @TODO check generate and hydratable
28
- // generate: 'ssr',
29
- // hydratable: true,
30
- // enable run-time checks when not in production
31
- customElement: true,
32
- dev: !production
33
- }
34
- }),
35
- image(),
36
- commonjs(),
37
- resolve({
38
- browser: true,
39
- dedupe: ['svelte']
40
- }),
41
- dev && serve({
42
- open: true,
43
- verbose: true,
44
- allowCrossOrigin: true,
45
- historyApiFallback: false,
46
- host: 'localhost',
47
- port: 5050,
48
- }),
49
- dev && livereload({ watch: ['', 'dist'] }),
50
- typescript({
51
- sourceMap: !production,
52
- inlineSources: !production,
53
- }),
54
- // If we're building for production (npm run build
55
- // instead of npm run dev), minify
56
- production &&
57
- terser({
58
- output: {
59
- comments: "all"
60
- },
61
- }),
62
- production && uglify.uglify()
63
- ],
64
- watch: {
65
- clearScreen: false
66
- }
67
- };
1
+ import svelte from 'rollup-plugin-svelte';
2
+ import commonjs from '@rollup/plugin-commonjs';
3
+ import resolve from '@rollup/plugin-node-resolve';
4
+ import serve from 'rollup-plugin-dev-server';
5
+ import livereload from 'rollup-plugin-livereload';
6
+ import { terser } from 'rollup-plugin-terser';
7
+ import sveltePreprocess from 'svelte-preprocess';
8
+ import typescript from '@rollup/plugin-typescript';
9
+ import uglify from 'rollup-plugin-uglify';
10
+ import image from '@rollup/plugin-image';
11
+
12
+ const production = process.env.NODE_ENV == 'production';
13
+ const dev = process.env.NODE_ENV == 'development';
14
+
15
+ export default {
16
+ input: 'src/index.ts',
17
+ output: {
18
+ sourcemap: true,
19
+ format: 'umd',
20
+ name: 'app',
21
+ file: 'dist/general-logout.js',
22
+ },
23
+ plugins: [
24
+ svelte({
25
+ preprocess: sveltePreprocess(),
26
+ compilerOptions: {
27
+ // @TODO check generate and hydratable
28
+ // generate: 'ssr',
29
+ // hydratable: true,
30
+ // enable run-time checks when not in production
31
+ customElement: true,
32
+ dev: !production
33
+ }
34
+ }),
35
+ image(),
36
+ commonjs(),
37
+ resolve({
38
+ browser: true,
39
+ dedupe: ['svelte']
40
+ }),
41
+ dev && serve({
42
+ open: true,
43
+ verbose: true,
44
+ allowCrossOrigin: true,
45
+ historyApiFallback: false,
46
+ host: 'localhost',
47
+ port: 5050,
48
+ }),
49
+ dev && livereload({ watch: ['', 'dist'] }),
50
+ typescript({
51
+ sourceMap: !production,
52
+ inlineSources: !production,
53
+ }),
54
+ // If we're building for production (npm run build
55
+ // instead of npm run dev), minify
56
+ production &&
57
+ terser({
58
+ output: {
59
+ comments: "all"
60
+ },
61
+ }),
62
+ production && uglify.uglify()
63
+ ],
64
+ watch: {
65
+ clearScreen: false
66
+ }
67
+ };
@@ -1,134 +1,134 @@
1
- <svelte:options tag={null} />
2
-
3
- <script lang="ts">
4
- import { getDevice } from 'rvhelper';
5
- import { logOutIcon } from './../icons/iconService';
6
- import { _, addNewMessages, setLocale, setupI18n } from './i18n';
7
- import { GeneralLogoutTranslations } from './translations';
8
-
9
- export let endpoint:string = '';
10
- export let session:string = '';
11
- export let buttonlocation:string = '';
12
- export let lang:string = '';
13
-
14
- let error = '';
15
- let hasErrors:Boolean = false;
16
-
17
- let userAgent:String = window.navigator.userAgent;
18
- let isMobile = (getDevice(userAgent) === 'PC') ? false : true;
19
- const mediaQuery = window.matchMedia('(min-width: 768px)');
20
-
21
- // setupI18n({ withLocale: 'en', translations: {}});
22
-
23
- Object.keys(GeneralLogoutTranslations).forEach((item:any) => {
24
- addNewMessages(item, GeneralLogoutTranslations[item]);
25
- });
26
-
27
- const logout = () => {
28
- let reqHeaders = new Headers();
29
-
30
- reqHeaders.append('Content-type', 'application/json');
31
- reqHeaders.append('X-SessionID', session);
32
-
33
- let options = {
34
- method: 'DELETE',
35
- headers: reqHeaders
36
- };
37
-
38
- fetch(`${endpoint}/player/session/player`, options)
39
- .then((res:any) => {
40
- window.postMessage({ type: 'LogoutSuccessfull' });
41
- });
42
- }
43
-
44
- const checkAttrs = () => {
45
- if (!endpoint) {
46
- error = "GENERAL-LOGOUT - Endpoint is missing! Please provide a valid endpointURL.";
47
- hasErrors = true;
48
-
49
- console.error(error);
50
- }
51
-
52
- if (!session) {
53
- error = "GENERAL-LOGOUT - Session is missing! Please provide a valid session.";
54
- hasErrors = true;
55
-
56
- console.error(error);
57
- }
58
-
59
- return hasErrors;
60
- }
61
-
62
- const initialLoad = () => {
63
- setLocale(lang);
64
- }
65
-
66
- $: endpoint && session && buttonlocation && checkAttrs();
67
- $: lang && initialLoad();
68
- </script>
69
-
70
- {#if buttonlocation === 'PlayerAccountMenu'}
71
- <p class="PlayerAccountMenuItemBox {isMobile ? 'PlayerAccountMenuItemBoxMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerAccountMenuItemBoxTablet' : ''}" part="PlayerAccountMenuItemBox {isMobile ? 'PlayerAccountMenuItemBoxMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerAccountMenuItemBoxTablet' : ''}" on:click={() => logout()}>
72
- <span style="width: {!isMobile ? '20px' : (mediaQuery.matches ? '50px' : '24px')}">
73
- <svg id="bbfaf345-72af-4296-bf4b-2fd41fc03d5d" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 150"><defs><style>.a88316b4-2478-4a69-b2eb-d32a5fb419dd{fill:var(--emfe-w-color-white, #FFFFFF);}</style></defs><path class="a88316b4-2478-4a69-b2eb-d32a5fb419dd" d="M147.16,67.69,115.42,36a9.6,9.6,0,1,0-13.58,13.58l15.32,15.31H49.58a9.63,9.63,0,1,0,0,19.26h67.58L101.84,99.42a9.64,9.64,0,0,0,6.79,16.43,9.41,9.41,0,0,0,6.79-2.85l31.74-31.73a9.53,9.53,0,0,0,0-13.58Z"/><path class="a88316b4-2478-4a69-b2eb-d32a5fb419dd" d="M45.16,122.16H19.26V26.79H45.32a9.63,9.63,0,1,0,0-19.26H9.63A9.56,9.56,0,0,0,0,17.16V131.63a9.57,9.57,0,0,0,9.63,9.64H45.32A9.57,9.57,0,0,0,55,131.63a9.78,9.78,0,0,0-9.79-9.47Z"/></svg>
74
- </span>
75
- {#if !isMobile}
76
- <span class="PlayerLogoutText" part="PlayerLogoutText">{$_('logout.logoutButton')}</span>
77
- {/if}
78
- </p>
79
- {:else}
80
- <div class="GeneralLogout" part="GeneralLogout">
81
- <button on:click={() => logout()}><span>{$_('logout.logoutButton')}</span></button>
82
- </div>
83
- {/if}
84
-
85
- <style lang="scss">
86
-
87
- :host {
88
- font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
89
- }
90
-
91
- *,
92
- *::before,
93
- *::after {
94
- margin: 0;
95
- padding: 0;
96
- list-style: none;
97
- text-decoration: none;
98
- outline: none;
99
- box-sizing: border-box;
100
- }
101
-
102
- .PlayerAccountMenuItemBox {
103
- padding: 20px;
104
- font-size: 16px;
105
- display: inline-flex;
106
- width: 100%;
107
- box-sizing: border-box;
108
- align-items: center;
109
- cursor: pointer;
110
- .PlayerLogoutText {
111
- margin-left: 20px;
112
- }
113
- &:not(:last-child) {
114
- border-bottom: 1px solid var(--emfe-w-color-white, #FFFFFF);
115
- }
116
- svg {
117
- fill: var(--emfe-w-color-white, #FFFFFF);
118
- }
119
- }
120
- .PlayerAccountMenuItemBoxMobile {
121
- &.PlayerAccountMenuItemBox {
122
- height: auto;
123
- justify-content: center;
124
- position: relative;
125
- /*top: 20px;*/
126
- display: flex;
127
- width: unset;
128
- padding: 0;
129
- svg {
130
- fill: var(--emfe-w-color-white, #FFFFFF);
131
- }
132
- }
133
- }
134
- </style>
1
+ <svelte:options tag={null} />
2
+
3
+ <script lang="ts">
4
+ import { getDevice } from 'rvhelper';
5
+ import { logOutIcon } from './../icons/iconService';
6
+ import { _, addNewMessages, setLocale, setupI18n } from './i18n';
7
+ import { GeneralLogoutTranslations } from './translations';
8
+
9
+ export let endpoint:string = '';
10
+ export let session:string = '';
11
+ export let buttonlocation:string = '';
12
+ export let lang:string = '';
13
+
14
+ let error = '';
15
+ let hasErrors:Boolean = false;
16
+
17
+ let userAgent:String = window.navigator.userAgent;
18
+ let isMobile = (getDevice(userAgent) === 'PC') ? false : true;
19
+ const mediaQuery = window.matchMedia('(min-width: 768px)');
20
+
21
+ // setupI18n({ withLocale: 'en', translations: {}});
22
+
23
+ Object.keys(GeneralLogoutTranslations).forEach((item:any) => {
24
+ addNewMessages(item, GeneralLogoutTranslations[item]);
25
+ });
26
+
27
+ const logout = () => {
28
+ let reqHeaders = new Headers();
29
+
30
+ reqHeaders.append('Content-type', 'application/json');
31
+ reqHeaders.append('X-SessionID', session);
32
+
33
+ let options = {
34
+ method: 'DELETE',
35
+ headers: reqHeaders
36
+ };
37
+
38
+ fetch(`${endpoint}/player/session/player`, options)
39
+ .then((res:any) => {
40
+ window.postMessage({ type: 'LogoutSuccessfull' });
41
+ });
42
+ }
43
+
44
+ const checkAttrs = () => {
45
+ if (!endpoint) {
46
+ error = "GENERAL-LOGOUT - Endpoint is missing! Please provide a valid endpointURL.";
47
+ hasErrors = true;
48
+
49
+ console.error(error);
50
+ }
51
+
52
+ if (!session) {
53
+ error = "GENERAL-LOGOUT - Session is missing! Please provide a valid session.";
54
+ hasErrors = true;
55
+
56
+ console.error(error);
57
+ }
58
+
59
+ return hasErrors;
60
+ }
61
+
62
+ const initialLoad = () => {
63
+ setLocale(lang);
64
+ }
65
+
66
+ $: endpoint && session && buttonlocation && checkAttrs();
67
+ $: lang && initialLoad();
68
+ </script>
69
+
70
+ {#if buttonlocation === 'PlayerAccountMenu'}
71
+ <p class="PlayerAccountMenuItemBox {isMobile ? 'PlayerAccountMenuItemBoxMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerAccountMenuItemBoxTablet' : ''}" part="PlayerAccountMenuItemBox {isMobile ? 'PlayerAccountMenuItemBoxMobile' : ''} {mediaQuery.matches && isMobile ? 'PlayerAccountMenuItemBoxTablet' : ''}" on:click={() => logout()}>
72
+ <span style="width: {!isMobile ? '20px' : (mediaQuery.matches ? '50px' : '24px')}">
73
+ <svg id="bbfaf345-72af-4296-bf4b-2fd41fc03d5d" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 150"><defs><style>.a88316b4-2478-4a69-b2eb-d32a5fb419dd{fill:var(--emfe-w-color-white, #FFFFFF);}</style></defs><path class="a88316b4-2478-4a69-b2eb-d32a5fb419dd" d="M147.16,67.69,115.42,36a9.6,9.6,0,1,0-13.58,13.58l15.32,15.31H49.58a9.63,9.63,0,1,0,0,19.26h67.58L101.84,99.42a9.64,9.64,0,0,0,6.79,16.43,9.41,9.41,0,0,0,6.79-2.85l31.74-31.73a9.53,9.53,0,0,0,0-13.58Z"/><path class="a88316b4-2478-4a69-b2eb-d32a5fb419dd" d="M45.16,122.16H19.26V26.79H45.32a9.63,9.63,0,1,0,0-19.26H9.63A9.56,9.56,0,0,0,0,17.16V131.63a9.57,9.57,0,0,0,9.63,9.64H45.32A9.57,9.57,0,0,0,55,131.63a9.78,9.78,0,0,0-9.79-9.47Z"/></svg>
74
+ </span>
75
+ {#if !isMobile}
76
+ <span class="PlayerLogoutText" part="PlayerLogoutText">{$_('logout.logoutButton')}</span>
77
+ {/if}
78
+ </p>
79
+ {:else}
80
+ <div class="GeneralLogout" part="GeneralLogout">
81
+ <button on:click={() => logout()}><span>{$_('logout.logoutButton')}</span></button>
82
+ </div>
83
+ {/if}
84
+
85
+ <style lang="scss">
86
+
87
+ :host {
88
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
89
+ }
90
+
91
+ *,
92
+ *::before,
93
+ *::after {
94
+ margin: 0;
95
+ padding: 0;
96
+ list-style: none;
97
+ text-decoration: none;
98
+ outline: none;
99
+ box-sizing: border-box;
100
+ }
101
+
102
+ .PlayerAccountMenuItemBox {
103
+ padding: 20px;
104
+ font-size: 16px;
105
+ display: inline-flex;
106
+ width: 100%;
107
+ box-sizing: border-box;
108
+ align-items: center;
109
+ cursor: pointer;
110
+ .PlayerLogoutText {
111
+ margin-left: 20px;
112
+ }
113
+ &:not(:last-child) {
114
+ border-bottom: 1px solid var(--emfe-w-color-white, #FFFFFF);
115
+ }
116
+ svg {
117
+ fill: var(--emfe-w-color-white, #FFFFFF);
118
+ }
119
+ }
120
+ .PlayerAccountMenuItemBoxMobile {
121
+ &.PlayerAccountMenuItemBox {
122
+ height: auto;
123
+ justify-content: center;
124
+ position: relative;
125
+ /*top: 20px;*/
126
+ display: flex;
127
+ width: unset;
128
+ padding: 0;
129
+ svg {
130
+ fill: var(--emfe-w-color-white, #FFFFFF);
131
+ }
132
+ }
133
+ }
134
+ </style>