@klauswuestefeld/jux-web 2024.2.5 → 2024.2.6-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/api-client.d.ts +4 -4
- package/dist/jux/jux-event.d.ts +10 -0
- package/dist/jux-web.js +410 -496
- package/dist/main.d.ts +1 -1
- package/dist/main.esm.js +413 -500
- package/dist/main.js +413 -499
- package/package.json +1 -1
- package/dist/jux/query.d.ts +0 -1
package/dist/jux-web.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
var juxWeb = (function (exports) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const getBrowserLanguage = () => {
|
|
5
|
+
const result = (navigator.languages && navigator.languages.length)
|
|
6
6
|
? navigator.languages[0]
|
|
7
7
|
: navigator.userLanguage || navigator.language || navigator.browserLanguage || 'en';
|
|
8
8
|
return result.substring(0, 2);
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const OVERRIDE_KEY = 'jux.language.override';
|
|
11
|
+
let translations = {};
|
|
12
|
+
const chosenLanguage = localStorage.getItem(OVERRIDE_KEY) || getBrowserLanguage();
|
|
13
|
+
const reloadWithLanguageOverride = (lang) => {
|
|
14
14
|
localStorage.setItem(OVERRIDE_KEY, lang);
|
|
15
15
|
location.reload();
|
|
16
16
|
};
|
|
17
17
|
// @ts-ignore
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (defaultLanguage === void 0) { defaultLanguage = 'en'; }
|
|
18
|
+
const getTranslation = (k) => translations[k] || k;
|
|
19
|
+
const initLanguage = (translations_, defaultLanguage = 'en') => {
|
|
21
20
|
translations = translations_[chosenLanguage] || translations_[defaultLanguage];
|
|
22
21
|
document.title = getTranslation('title');
|
|
23
22
|
document.documentElement.lang = translations_[chosenLanguage] ? chosenLanguage : defaultLanguage;
|
|
24
23
|
};
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
const THRESHOLD_WIDTH = 640;
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
const icons = {
|
|
29
28
|
email: '<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 64.000000 48.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,48.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M44 468 c-38 -18 -44 -51 -44 -228 0 -180 6 -210 47 -229 33 -15 513 -15 546 0 41 19 47 49 47 229 0 180 -6 210 -47 229 -31 14 -519 14 -549 -1z m516 -33 c0 -7 -232 -205 -240 -205 -8 0 -240 198 -240 205 0 3 108 5 240 5 132 0 240 -2 240 -5z m-406 -118 l59 -53 -87 -97 -86 -97 0 170 0 171 28 -20 c15 -11 54 -44 86 -74z m446 -77 l0 -170 -85 95 c-47 53 -85 98 -85 99 0 5 162 146 167 146 1 0 3 -77 3 -170z m-319 -31 l39 -31 40 32 39 31 33 -37 c18 -21 57 -65 87 -99 l53 -60 -126 -3 c-69 -1 -183 -1 -252 0 l-126 3 84 97 c46 53 85 97 87 97 2 1 21 -13 42 -30z"/> </g> </svg>',
|
|
30
29
|
google: '<svg viewBox="0 0 24 24" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg"><g transform="matrix(1, 0, 0, 1, 27.009001, -39.238998)"><path fill="#4285F4" d="M -3.264 51.509 C -3.264 50.719 -3.334 49.969 -3.454 49.239 L -14.754 49.239 L -14.754 53.749 L -8.284 53.749 C -8.574 55.229 -9.424 56.479 -10.684 57.329 L -10.684 60.329 L -6.824 60.329 C -4.564 58.239 -3.264 55.159 -3.264 51.509 Z"/><path fill="#34A853" d="M -14.754 63.239 C -11.514 63.239 -8.804 62.159 -6.824 60.329 L -10.684 57.329 C -11.764 58.049 -13.134 58.489 -14.754 58.489 C -17.884 58.489 -20.534 56.379 -21.484 53.529 L -25.464 53.529 L -25.464 56.619 C -23.494 60.539 -19.444 63.239 -14.754 63.239 Z"/><path fill="#FBBC05" d="M -21.484 53.529 C -21.734 52.809 -21.864 52.039 -21.864 51.239 C -21.864 50.439 -21.724 49.669 -21.484 48.949 L -21.484 45.859 L -25.464 45.859 C -26.284 47.479 -26.754 49.299 -26.754 51.239 C -26.754 53.179 -26.284 54.999 -25.464 56.619 L -21.484 53.529 Z"/><path fill="#EA4335" d="M -14.754 43.989 C -12.984 43.989 -11.404 44.599 -10.154 45.789 L -6.734 42.369 C -8.804 40.429 -11.514 39.239 -14.754 39.239 C -19.444 39.239 -23.494 41.939 -25.464 45.859 L -21.484 48.949 C -20.534 46.099 -17.884 43.989 -14.754 43.989 Z"/></g></svg>',
|
|
31
30
|
linkedin: '<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="100%" height="100%" viewBox="1.786 1.783 76.226652 76.248" version="1.1" id="svg72" sodipodi:docname="linkedin.svg" inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> <metadata id="metadata78"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> <defs id="defs76" /> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1916" inkscape:window-height="1036" id="namedview74" showgrid="false" inkscape:zoom="0.79365665" inkscape:cx="428.70379" inkscape:cy="325.16058" inkscape:window-x="0" inkscape:window-y="20" inkscape:window-maximized="0" inkscape:current-layer="svg72" inkscape:pagecheckerboard="false" /> <path d="m 2.10821,7.2952417 c 0,-3.015 2.508,-5.462 5.6,-5.462 h 64.568 c 3.093,0 5.6,2.447 5.6,5.462 V 72.620242 c 0,3.016 -2.507,5.461 -5.6,5.461 h -64.568 c -3.092,0 -5.6,-2.445 -5.6,-5.46 V 7.2942417 Z" id="path64" inkscape:connector-curvature="0" style="fill:#0b78b7;fill-opacity:1" /> <path d="m 25.07621,65.660242 v -34.43 h -11.444 v 34.43 h 11.445 z m -5.72,-39.13 c 3.99,0 6.474,-2.644 6.474,-5.948 -0.075,-3.379 -2.484,-5.949 -6.398,-5.949 -3.917,0 -6.475,2.57 -6.475,5.949 0,3.304 2.483,5.948 6.324,5.948 h 0.074 z m 12.054,39.13 h 11.443 v -19.225 c 0,-1.028 0.075,-2.058 0.377,-2.792 0.827,-2.057 2.71,-4.186 5.872,-4.186 4.14,0 5.797,3.157 5.797,7.786 v 18.417 h 11.443 v -19.741 c 0,-10.575 -5.645,-15.496 -13.174,-15.496 -6.173,0 -8.884,3.45 -10.39,5.8 h 0.076 v -4.992 h -11.443 c 0.149,3.23 -0.001,34.43 -0.001,34.43 z" id="path70" inkscape:connector-curvature="0" style="fill:#ffffff" /> </svg>',
|
|
32
31
|
microsoft: '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 21 21"><title>MS-SymbolLockup</title><rect x="1" y="1" width="9" height="9" fill="#f25022"/><rect x="1" y="11" width="9" height="9" fill="#00a4ef"/><rect x="11" y="1" width="9" height="9" fill="#7fba00"/><rect x="11" y="11" width="9" height="9" fill="#ffb900"/></svg>',
|
|
33
32
|
};
|
|
34
|
-
|
|
33
|
+
const applyComponentStyle = (component) => {
|
|
35
34
|
component.style.alignItems = 'center';
|
|
36
35
|
component.style.background = '#fff';
|
|
37
36
|
component.style.border = 'thin solid #888';
|
|
@@ -48,7 +47,7 @@ var juxWeb = (function (exports) {
|
|
|
48
47
|
component.style.width = '276px';
|
|
49
48
|
component.style.boxSizing = 'content-box';
|
|
50
49
|
};
|
|
51
|
-
|
|
50
|
+
const applyLabelStyle = (label) => {
|
|
52
51
|
label.style.display = 'inline-block';
|
|
53
52
|
label.style.fontSize = '14px';
|
|
54
53
|
label.style.fontWeight = '500';
|
|
@@ -56,13 +55,13 @@ var juxWeb = (function (exports) {
|
|
|
56
55
|
label.style.marginRight = '34px';
|
|
57
56
|
label.style.paddingLeft = '20px';
|
|
58
57
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
const loginButton = (type, fn) => {
|
|
59
|
+
const loweredCasedType = type.toLowerCase();
|
|
60
|
+
const result = document.createElement('login-button');
|
|
62
61
|
applyComponentStyle(result);
|
|
63
62
|
result.tabIndex = 0;
|
|
64
|
-
result.setAttribute('data-cy',
|
|
65
|
-
|
|
63
|
+
result.setAttribute('data-cy', `${loweredCasedType}-button`);
|
|
64
|
+
const icon = document.createElement('login-icon');
|
|
66
65
|
icon.style.gridColumnStart = '2';
|
|
67
66
|
icon.style.width = '28px';
|
|
68
67
|
icon.style.height = '28px';
|
|
@@ -72,16 +71,16 @@ var juxWeb = (function (exports) {
|
|
|
72
71
|
icon.className = 'ico';
|
|
73
72
|
// @ts-ignore
|
|
74
73
|
icon.innerHTML = icons[loweredCasedType];
|
|
75
|
-
|
|
76
|
-
label.textContent = window.innerWidth <= THRESHOLD_WIDTH ? type : getTranslation(
|
|
74
|
+
const label = document.createElement('login-label');
|
|
75
|
+
label.textContent = window.innerWidth <= THRESHOLD_WIDTH ? type : getTranslation(`${loweredCasedType}-label`);
|
|
77
76
|
applyLabelStyle(label);
|
|
78
77
|
result.append(icon, label);
|
|
79
78
|
result.addEventListener('click', fn);
|
|
80
|
-
result.addEventListener('mouseenter',
|
|
79
|
+
result.addEventListener('mouseenter', () => {
|
|
81
80
|
result.style.cursor = 'pointer';
|
|
82
81
|
result.style.boxShadow = '0 0 6px #808080';
|
|
83
82
|
});
|
|
84
|
-
result.addEventListener('mouseleave',
|
|
83
|
+
result.addEventListener('mouseleave', () => {
|
|
85
84
|
result.style.cursor = 'auto';
|
|
86
85
|
result.style.boxShadow = '1px 1px 1px grey';
|
|
87
86
|
});
|
|
@@ -102,22 +101,6 @@ var juxWeb = (function (exports) {
|
|
|
102
101
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
103
102
|
PERFORMANCE OF THIS SOFTWARE.
|
|
104
103
|
***************************************************************************** */
|
|
105
|
-
/* global Reflect, Promise */
|
|
106
|
-
|
|
107
|
-
var extendStatics$2 = function(d, b) {
|
|
108
|
-
extendStatics$2 = Object.setPrototypeOf ||
|
|
109
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
110
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
111
|
-
return extendStatics$2(d, b);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
function __extends$2(d, b) {
|
|
115
|
-
if (typeof b !== "function" && b !== null)
|
|
116
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
117
|
-
extendStatics$2(d, b);
|
|
118
|
-
function __() { this.constructor = d; }
|
|
119
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
120
|
-
}
|
|
121
104
|
|
|
122
105
|
function __awaiter$2(thisArg, _arguments, P, generator) {
|
|
123
106
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -127,54 +110,25 @@ var juxWeb = (function (exports) {
|
|
|
127
110
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
128
111
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
129
112
|
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function __generator$2(thisArg, body) {
|
|
133
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
134
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
135
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
136
|
-
function step(op) {
|
|
137
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
138
|
-
while (_) try {
|
|
139
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
140
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
141
|
-
switch (op[0]) {
|
|
142
|
-
case 0: case 1: t = op; break;
|
|
143
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
144
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
145
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
146
|
-
default:
|
|
147
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
148
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
149
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
150
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
151
|
-
if (t[2]) _.ops.pop();
|
|
152
|
-
_.trys.pop(); continue;
|
|
153
|
-
}
|
|
154
|
-
op = body.call(thisArg, _);
|
|
155
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
156
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
157
|
-
}
|
|
158
113
|
}
|
|
159
114
|
|
|
160
|
-
|
|
161
|
-
if (additionalParam === void 0) { additionalParam = ''; }
|
|
115
|
+
const extractTokenFromWindowLocation = (tokenParam, additionalParam = '') => {
|
|
162
116
|
if (!tokenParam)
|
|
163
117
|
return;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
118
|
+
let token = '';
|
|
119
|
+
const tokenParameterName = `${tokenParam}=`;
|
|
120
|
+
const search = window.location.search;
|
|
121
|
+
const tokenParameterIndex = search.indexOf(tokenParameterName);
|
|
168
122
|
if (tokenParameterIndex !== -1) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
123
|
+
const tokenParameterNameLength = tokenParameterName.length;
|
|
124
|
+
const leadingAmpersandIndex = search.indexOf('&', tokenParameterIndex);
|
|
125
|
+
let searchWithoutToken = search;
|
|
172
126
|
token = search.substring(tokenParameterIndex + tokenParameterNameLength);
|
|
173
127
|
if (leadingAmpersandIndex !== -1) {
|
|
174
128
|
token = search.substring(tokenParameterIndex + tokenParameterNameLength, leadingAmpersandIndex);
|
|
175
129
|
searchWithoutToken = searchWithoutToken.slice(0, leadingAmpersandIndex) + searchWithoutToken.slice(leadingAmpersandIndex + 1);
|
|
176
130
|
}
|
|
177
|
-
searchWithoutToken = searchWithoutToken.replace(
|
|
131
|
+
searchWithoutToken = searchWithoutToken.replace(`${tokenParam}=` + token, '')
|
|
178
132
|
.replace(additionalParam, '')
|
|
179
133
|
.replace('\&cypress=true', '');
|
|
180
134
|
if (searchWithoutToken === '?') {
|
|
@@ -185,31 +139,40 @@ var juxWeb = (function (exports) {
|
|
|
185
139
|
return token;
|
|
186
140
|
};
|
|
187
141
|
|
|
188
|
-
|
|
142
|
+
const setBackendUrl = (backendUrl) => localStorage.setItem('backend-url', backendUrl);
|
|
189
143
|
//@ts-ignore
|
|
190
|
-
|
|
144
|
+
const getBackendUrl = () => process.env.BACKEND_URL || localStorage.getItem('backend-url');
|
|
191
145
|
//@ts-ignore
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
var getMicrosoftAuthUrl = function () { return getBackendUrl() + 'auth-microsoft?access-token='; };
|
|
197
|
-
var getMagicAuthUrl = function () {
|
|
146
|
+
const getSecondaryBackendUrl = () => process.env.STAGING_BACKEND_URL || getBackendUrl();
|
|
147
|
+
const getApiUrl = () => getBackendUrl() + 'api/';
|
|
148
|
+
let getBackendUrlToTry = () => getBackendUrl();
|
|
149
|
+
const getMagicAuthUrl = () => {
|
|
198
150
|
var _a;
|
|
199
151
|
// @ts-ignore
|
|
200
|
-
|
|
152
|
+
const endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkAuthEndpoint) || 'auth-magic';
|
|
201
153
|
return getBackendUrl() + endpoint + '?token=';
|
|
202
154
|
};
|
|
203
|
-
|
|
155
|
+
const getMagicAuthReqUrl = () => {
|
|
204
156
|
var _a;
|
|
205
157
|
// @ts-ignore
|
|
206
|
-
|
|
158
|
+
const endpoint = ((_a = window === null || window === void 0 ? void 0 : window.store) === null || _a === void 0 ? void 0 : _a.magicLinkRequestEndpoint) || 'magic-link-request';
|
|
207
159
|
return getBackendUrl() + endpoint + '?email=';
|
|
208
160
|
};
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
161
|
+
const handleJuxEvents = (ev) => {
|
|
162
|
+
const { method, endpoint, onResult, params, onError } = ev;
|
|
163
|
+
const onJsonResponse = (res) => onResult ? onResult(res) : null;
|
|
164
|
+
const onHelpMessage = (err) => onError ? onError(err) : null;
|
|
165
|
+
if (method === 'GET') {
|
|
166
|
+
backendGet(endpoint, params, onJsonResponse, onHelpMessage);
|
|
167
|
+
}
|
|
168
|
+
if (method === 'POST') {
|
|
169
|
+
backendPost(endpoint, params, onJsonResponse, onHelpMessage);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
let timeout;
|
|
173
|
+
const maxRetries = 20;
|
|
174
|
+
let retries = 0;
|
|
175
|
+
const applySpinnerStyle = (spinner) => {
|
|
213
176
|
spinner.style.position = 'fixed';
|
|
214
177
|
spinner.style.top = '50%';
|
|
215
178
|
spinner.style.zIndex = '2147483647';
|
|
@@ -218,22 +181,22 @@ var juxWeb = (function (exports) {
|
|
|
218
181
|
spinner.style.height = '80px';
|
|
219
182
|
spinner.style.width = '80px';
|
|
220
183
|
};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
184
|
+
const renderOverlay = () => {
|
|
185
|
+
const overlay = document.createElement('reconnect-overlay');
|
|
186
|
+
const spinner = document.createElement('loading-spinner');
|
|
224
187
|
spinner.className = 'reconnect-spinner';
|
|
225
188
|
applySpinnerStyle(spinner);
|
|
226
189
|
document.body.append(overlay, spinner);
|
|
227
190
|
};
|
|
228
|
-
|
|
191
|
+
const removeOverlay = () => {
|
|
229
192
|
var _a, _b;
|
|
230
193
|
(_a = document.querySelector('reconnect-overlay')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
231
194
|
(_b = document.querySelector('.reconnect-spinner')) === null || _b === void 0 ? void 0 : _b.remove();
|
|
232
195
|
};
|
|
233
|
-
|
|
196
|
+
const backendHelpMessage = (req) => {
|
|
234
197
|
return req.response && req.response.error || req.response || req;
|
|
235
198
|
};
|
|
236
|
-
|
|
199
|
+
const backendRequest = (requestType, url, postContent, onJsonResponse, onHelpMessage) => {
|
|
237
200
|
if (url.includes(getBackendUrl())) {
|
|
238
201
|
url = url.replace(getBackendUrl(), getBackendUrlToTry());
|
|
239
202
|
}
|
|
@@ -241,16 +204,16 @@ var juxWeb = (function (exports) {
|
|
|
241
204
|
url = url.replace(getSecondaryBackendUrl(), getBackendUrlToTry());
|
|
242
205
|
}
|
|
243
206
|
clearInterval(timeout);
|
|
244
|
-
|
|
207
|
+
const req = new XMLHttpRequest();
|
|
245
208
|
req.open(requestType, url, true);
|
|
246
209
|
// @ts-ignore
|
|
247
|
-
|
|
210
|
+
const backendToken = window.store.backendToken;
|
|
248
211
|
if (backendToken) {
|
|
249
212
|
req.setRequestHeader('auth', backendToken);
|
|
250
213
|
}
|
|
251
214
|
req.setRequestHeader('Content-Type', 'application/json');
|
|
252
215
|
req.responseType = 'json';
|
|
253
|
-
req.onerror = req.ontimeout =
|
|
216
|
+
req.onerror = req.ontimeout = () => {
|
|
254
217
|
if (req.status === 401) {
|
|
255
218
|
localStorage.removeItem('token');
|
|
256
219
|
alert(getTranslation('session-expired-msg'));
|
|
@@ -267,12 +230,12 @@ var juxWeb = (function (exports) {
|
|
|
267
230
|
if (!document.querySelector('reconnect-overlay')) {
|
|
268
231
|
renderOverlay();
|
|
269
232
|
}
|
|
270
|
-
|
|
233
|
+
const backupBackendUrl = getBackendUrlToTry() === getBackendUrl()
|
|
271
234
|
? getSecondaryBackendUrl()
|
|
272
235
|
: getBackendUrl();
|
|
273
|
-
url = url.replace(getBackendUrlToTry(),
|
|
274
|
-
getBackendUrlToTry =
|
|
275
|
-
timeout = setTimeout(
|
|
236
|
+
url = url.replace(getBackendUrlToTry(), backupBackendUrl);
|
|
237
|
+
getBackendUrlToTry = () => backupBackendUrl;
|
|
238
|
+
timeout = setTimeout(() => {
|
|
276
239
|
backendRequest(requestType, url, postContent, onJsonResponse, onHelpMessage);
|
|
277
240
|
}, 2000);
|
|
278
241
|
}
|
|
@@ -280,7 +243,7 @@ var juxWeb = (function (exports) {
|
|
|
280
243
|
onHelpMessage(backendHelpMessage(req));
|
|
281
244
|
}
|
|
282
245
|
};
|
|
283
|
-
req.onload =
|
|
246
|
+
req.onload = () => {
|
|
284
247
|
retries = 0;
|
|
285
248
|
removeOverlay();
|
|
286
249
|
if (req.status === 200 || req.status === 202) {
|
|
@@ -296,57 +259,48 @@ var juxWeb = (function (exports) {
|
|
|
296
259
|
req.timeout = 25000;
|
|
297
260
|
req.send(postContent);
|
|
298
261
|
};
|
|
299
|
-
|
|
262
|
+
const backendPost = (endpoint, postContent, onJsonResponse, onHelpMessage) => {
|
|
300
263
|
backendRequest('POST', getApiUrl() + endpoint, postContent, onJsonResponse, onHelpMessage);
|
|
301
264
|
};
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
if (endpoint.includes(getGoogleAuthUrl()) || endpoint.includes(getMicrosoftAuthUrl())) {
|
|
305
|
-
api = endpoint;
|
|
306
|
-
}
|
|
307
|
-
backendRequest('GET', api, undefined, onJsonResponse, onHelpMessage);
|
|
265
|
+
const backendGet = (endpoint, params, onJsonResponse, onHelpMessage) => {
|
|
266
|
+
backendRequest('GET', getApiUrl() + endpoint, params, onJsonResponse, onHelpMessage);
|
|
308
267
|
};
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}); };
|
|
312
|
-
var requestMagicLink = function (data, onJsonResponse) {
|
|
313
|
-
backendRequest('GET', getMagicAuthReqUrl() + encodeURIComponent(data.email) + '&destination=' + extractTokenFromWindowLocation('destination') + '&token=' + data.token, undefined, onJsonResponse, function () { });
|
|
268
|
+
const requestMagicLink = (data, onJsonResponse) => {
|
|
269
|
+
backendRequest('GET', getMagicAuthReqUrl() + encodeURIComponent(data.email) + '&destination=' + extractTokenFromWindowLocation('destination') + '&token=' + data.token, null, onJsonResponse, () => { });
|
|
314
270
|
};
|
|
315
|
-
|
|
316
|
-
backendRequest('GET', getMagicAuthUrl() + magicToken,
|
|
271
|
+
const openMagicLink = (magicToken, onJsonResponse, onHelpMessage) => {
|
|
272
|
+
backendRequest('GET', getMagicAuthUrl() + magicToken, null, onJsonResponse, onHelpMessage);
|
|
317
273
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
case 2:
|
|
336
|
-
recordsJson = _a.sent();
|
|
337
|
-
answer = recordsJson.Answer;
|
|
338
|
-
if (!answer) {
|
|
339
|
-
return [2 /*return*/, null];
|
|
340
|
-
}
|
|
341
|
-
return [2 /*return*/, Array.from(answer).map(function (a) { return a.data; })];
|
|
342
|
-
case 3:
|
|
343
|
-
error_1 = _a.sent();
|
|
344
|
-
console.error('Fetch failed: ', error_1);
|
|
345
|
-
return [2 /*return*/, null];
|
|
346
|
-
case 4: return [2 /*return*/];
|
|
274
|
+
const googleLogin = (token, onLogin, onLoginError) => {
|
|
275
|
+
const url = getBackendUrl() + 'auth-google?google-id-token=' + token;
|
|
276
|
+
backendRequest('GET', url, null, onLogin, onLoginError);
|
|
277
|
+
};
|
|
278
|
+
const microsoftLogin = (token, onLogin, onLoginError) => {
|
|
279
|
+
const url = getBackendUrl() + 'auth-microsoft?access-token=' + token;
|
|
280
|
+
backendRequest('GET', url, null, onLogin, onLoginError);
|
|
281
|
+
};
|
|
282
|
+
const getMXData = (domainName) => __awaiter$2(void 0, void 0, void 0, function* () {
|
|
283
|
+
try {
|
|
284
|
+
const records = yield fetch(`https://dns.google.com/resolve?name=${domainName}&type=MX`, {
|
|
285
|
+
method: 'GET',
|
|
286
|
+
mode: 'cors'
|
|
287
|
+
});
|
|
288
|
+
if (!records.ok) {
|
|
289
|
+
console.log('response was not ok');
|
|
290
|
+
return null;
|
|
347
291
|
}
|
|
348
|
-
|
|
349
|
-
|
|
292
|
+
const recordsJson = yield records.json();
|
|
293
|
+
const answer = recordsJson.Answer;
|
|
294
|
+
if (!answer) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
return Array.from(answer).map((a) => a.data);
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
console.error('Fetch failed: ', error);
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
});
|
|
350
304
|
|
|
351
305
|
/*! @azure/msal-browser v2.21.0 2022-01-04 */
|
|
352
306
|
/*! *****************************************************************************
|
|
@@ -13667,13 +13621,13 @@ var juxWeb = (function (exports) {
|
|
|
13667
13621
|
return PublicClientApplication;
|
|
13668
13622
|
}(ClientApplication));
|
|
13669
13623
|
|
|
13670
|
-
|
|
13671
|
-
|
|
13624
|
+
let cleared = false;
|
|
13625
|
+
const clearCookieValidation = () => {
|
|
13672
13626
|
var _a;
|
|
13673
13627
|
(_a = document.querySelector('#cookie-test-iframe')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
13674
13628
|
cleared = true;
|
|
13675
13629
|
};
|
|
13676
|
-
|
|
13630
|
+
const checkCookiesEnable = (ev, onEnabled, onDisabled) => {
|
|
13677
13631
|
if (ev.data === 'MM:3PCunsupported') {
|
|
13678
13632
|
clearCookieValidation();
|
|
13679
13633
|
if (onDisabled) {
|
|
@@ -13685,18 +13639,18 @@ var juxWeb = (function (exports) {
|
|
|
13685
13639
|
onEnabled();
|
|
13686
13640
|
}
|
|
13687
13641
|
};
|
|
13688
|
-
|
|
13689
|
-
|
|
13642
|
+
const cookieTest = () => {
|
|
13643
|
+
const frame = document.createElement('iframe');
|
|
13690
13644
|
frame.id = 'cookie-test-iframe';
|
|
13691
13645
|
frame.src = 'https://mindmup.github.io/3rdpartycookiecheck/start.html';
|
|
13692
13646
|
frame.style.display = 'none';
|
|
13693
13647
|
document.body.appendChild(frame);
|
|
13694
13648
|
};
|
|
13695
|
-
|
|
13649
|
+
const validateThirdPartyCookies = (onEnabled, onDisabled) => {
|
|
13696
13650
|
cleared = false;
|
|
13697
|
-
|
|
13651
|
+
const listener = (ev) => checkCookiesEnable(ev, onEnabled, onDisabled);
|
|
13698
13652
|
window.addEventListener('message', listener);
|
|
13699
|
-
|
|
13653
|
+
const timer = setInterval(() => {
|
|
13700
13654
|
if (cleared) {
|
|
13701
13655
|
window.removeEventListener('message', listener);
|
|
13702
13656
|
clearInterval(timer);
|
|
@@ -13705,26 +13659,26 @@ var juxWeb = (function (exports) {
|
|
|
13705
13659
|
cookieTest();
|
|
13706
13660
|
};
|
|
13707
13661
|
|
|
13708
|
-
|
|
13662
|
+
const enableSignInLayout = () => {
|
|
13709
13663
|
document.documentElement.style.cursor = 'progress';
|
|
13710
13664
|
document.body.style.opacity = '0.5';
|
|
13711
13665
|
document.body.style.pointerEvents = 'none';
|
|
13712
13666
|
};
|
|
13713
|
-
|
|
13667
|
+
const disableSignInLayout = () => {
|
|
13714
13668
|
document.documentElement.style.cursor = 'default';
|
|
13715
13669
|
document.body.style.opacity = '1';
|
|
13716
13670
|
document.body.style.pointerEvents = 'auto';
|
|
13717
13671
|
};
|
|
13718
13672
|
|
|
13719
13673
|
// TODO: find a better way to import external scripts
|
|
13720
|
-
|
|
13674
|
+
const script$1 = document.createElement('script');
|
|
13721
13675
|
script$1.type = 'text/javascript';
|
|
13722
13676
|
script$1.src = 'https://apis.google.com/js/api.js';
|
|
13723
13677
|
document.head.appendChild(script$1);
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13678
|
+
let authStatus;
|
|
13679
|
+
let authError;
|
|
13680
|
+
const highLevelUser = (gUser) => {
|
|
13681
|
+
const profile = gUser.getBasicProfile();
|
|
13728
13682
|
return {
|
|
13729
13683
|
name: profile.getName(),
|
|
13730
13684
|
email: profile.getEmail(),
|
|
@@ -13732,62 +13686,50 @@ var juxWeb = (function (exports) {
|
|
|
13732
13686
|
googletoken: gUser.getAuthResponse().id_token
|
|
13733
13687
|
};
|
|
13734
13688
|
};
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
|
|
13756
|
-
|
|
13757
|
-
|
|
13758
|
-
|
|
13759
|
-
|
|
13760
|
-
|
|
13761
|
-
// checkMixpanel(() => mixpanel.track('Login Error', { 'Login Type': 'Google', 'Error': error })); TODO
|
|
13762
|
-
return [2 /*return*/];
|
|
13763
|
-
case 4: return [3 /*break*/, 6];
|
|
13764
|
-
case 5:
|
|
13765
|
-
setBackendToken('');
|
|
13766
|
-
_a.label = 6;
|
|
13767
|
-
case 6: return [2 /*return*/];
|
|
13768
|
-
}
|
|
13769
|
-
});
|
|
13770
|
-
}); };
|
|
13771
|
-
var onGoogleUserChanged = function (gUser, onUserLogin) {
|
|
13689
|
+
const onUserChanged = (googleUser, onUserLogin) => {
|
|
13690
|
+
document.documentElement.classList.remove('progress');
|
|
13691
|
+
document.body.classList.remove('disabled');
|
|
13692
|
+
if (googleUser) {
|
|
13693
|
+
// mixpanelIdentify(googleUser); TODO
|
|
13694
|
+
const onSuccess = (res) => {
|
|
13695
|
+
const { token } = res;
|
|
13696
|
+
// @ts-ignore
|
|
13697
|
+
window.store.currentUser = res;
|
|
13698
|
+
onTokenAcquired(token, onUserLogin);
|
|
13699
|
+
};
|
|
13700
|
+
const onError = (err) => {
|
|
13701
|
+
console.error(err);
|
|
13702
|
+
// logError(error); TODO
|
|
13703
|
+
// checkMixpanel(() => mixpanel.track('Login Error', { 'Login Type': 'Google', 'Error': error })); TODO
|
|
13704
|
+
};
|
|
13705
|
+
googleLogin(googleUser.googletoken, onSuccess, onError);
|
|
13706
|
+
// checkMixpanel(() => mixpanel.track('Login', { 'Login Type': 'Google' })); TODO
|
|
13707
|
+
}
|
|
13708
|
+
else {
|
|
13709
|
+
setBackendToken('');
|
|
13710
|
+
// checkMixpanel(() => mixpanel.reset()); TODO
|
|
13711
|
+
// displayPage(Page.LOGIN); TODO
|
|
13712
|
+
}
|
|
13713
|
+
};
|
|
13714
|
+
const onGoogleUserChanged = (gUser, onUserLogin) => {
|
|
13772
13715
|
onUserChanged(gUser.isSignedIn() ? highLevelUser(gUser) : null, onUserLogin);
|
|
13773
13716
|
};
|
|
13774
|
-
|
|
13717
|
+
const initGapiClient = (callbackFn, onUserLogin) => {
|
|
13775
13718
|
// @ts-ignore
|
|
13776
|
-
|
|
13777
|
-
gapi.auth2.init({ client_id: clientId, prompt: 'select_account' }).then(
|
|
13719
|
+
const clientId = process.env.GOOGLE_CLIENT_ID;
|
|
13720
|
+
gapi.auth2.init({ client_id: clientId, prompt: 'select_account' }).then(() => {
|
|
13778
13721
|
authStatus = 'LOADED';
|
|
13779
|
-
|
|
13722
|
+
const currentUser = getAuth().currentUser;
|
|
13780
13723
|
currentUser.listen(onGoogleUserChanged);
|
|
13781
13724
|
callbackFn ? callbackFn(clientId) : onGoogleUserChanged(currentUser.get(), onUserLogin);
|
|
13782
13725
|
}, onAuthError);
|
|
13783
13726
|
};
|
|
13784
|
-
|
|
13727
|
+
const onAuthError = (error) => {
|
|
13785
13728
|
authError = error;
|
|
13786
13729
|
console.error(error);
|
|
13787
13730
|
// logError(error, authError); // TODO
|
|
13788
13731
|
};
|
|
13789
|
-
|
|
13790
|
-
if (callbackFn === void 0) { callbackFn = null; }
|
|
13732
|
+
const initGapi = (callbackFn = null, onUserLogin) => {
|
|
13791
13733
|
if (!window.location.protocol.startsWith('http')) {
|
|
13792
13734
|
onAuthError('To use Google Auth you must access this page using http(s), not ' + window.location.protocol);
|
|
13793
13735
|
return;
|
|
@@ -13798,27 +13740,27 @@ var juxWeb = (function (exports) {
|
|
|
13798
13740
|
}
|
|
13799
13741
|
authStatus = 'LOADING';
|
|
13800
13742
|
gapi.load('auth2', {
|
|
13801
|
-
callback:
|
|
13743
|
+
callback: () => initGapiClient(callbackFn, onUserLogin),
|
|
13802
13744
|
onerror: onAuthError,
|
|
13803
13745
|
ontimeout: onAuthError,
|
|
13804
13746
|
timeout: 5000
|
|
13805
13747
|
});
|
|
13806
13748
|
};
|
|
13807
|
-
|
|
13749
|
+
const authAlert = (error) => {
|
|
13808
13750
|
alert('Google authentication is not working at this moment.\n\nPlease try again later or use a magic sign-in link.\n\nError: ' + JSON.stringify(error));
|
|
13809
13751
|
location.reload();
|
|
13810
13752
|
};
|
|
13811
|
-
|
|
13753
|
+
const onSignInError = (error) => {
|
|
13812
13754
|
disableSignInLayout();
|
|
13813
13755
|
console.error(error);
|
|
13814
13756
|
// logError(error); TODO
|
|
13815
13757
|
if (error && error.error === 'popup_closed_by_user') {
|
|
13816
|
-
onUserChanged(null,
|
|
13758
|
+
onUserChanged(null, () => { });
|
|
13817
13759
|
return;
|
|
13818
13760
|
}
|
|
13819
13761
|
authAlert(error);
|
|
13820
13762
|
};
|
|
13821
|
-
|
|
13763
|
+
const getAuth = () => {
|
|
13822
13764
|
if (typeof gapi === 'undefined') {
|
|
13823
13765
|
console.error('gapi is undefined');
|
|
13824
13766
|
// logError('gapi is undefined'); TODO
|
|
@@ -13826,8 +13768,8 @@ var juxWeb = (function (exports) {
|
|
|
13826
13768
|
}
|
|
13827
13769
|
return gapi.auth2 && gapi.auth2.getAuthInstance();
|
|
13828
13770
|
};
|
|
13829
|
-
|
|
13830
|
-
|
|
13771
|
+
const googleSignIn = () => getAuth().signIn().catch(onSignInError);
|
|
13772
|
+
const authSignIn = (onUserLogin) => {
|
|
13831
13773
|
if (authError) {
|
|
13832
13774
|
authAlert(authError);
|
|
13833
13775
|
return;
|
|
@@ -13841,7 +13783,7 @@ var juxWeb = (function (exports) {
|
|
|
13841
13783
|
}
|
|
13842
13784
|
catch (err) {
|
|
13843
13785
|
try {
|
|
13844
|
-
initGapi(
|
|
13786
|
+
initGapi(() => googleSignIn(), onUserLogin);
|
|
13845
13787
|
}
|
|
13846
13788
|
catch (error) {
|
|
13847
13789
|
onSignInError(error);
|
|
@@ -13851,13 +13793,13 @@ var juxWeb = (function (exports) {
|
|
|
13851
13793
|
};
|
|
13852
13794
|
|
|
13853
13795
|
// TODO: find a better way to import external scripts
|
|
13854
|
-
|
|
13796
|
+
const script = document.createElement('script');
|
|
13855
13797
|
script.type = 'text/javascript';
|
|
13856
13798
|
script.src = 'https://www.google.com/recaptcha/api.js';
|
|
13857
13799
|
document.head.appendChild(script);
|
|
13858
|
-
|
|
13859
|
-
|
|
13860
|
-
window.submitCaptcha =
|
|
13800
|
+
const googleCaptcha = () => {
|
|
13801
|
+
const result = document.createElement('google-captcha');
|
|
13802
|
+
window.submitCaptcha = (token) => result.setAttribute('token', token);
|
|
13861
13803
|
result.className = 'g-recaptcha';
|
|
13862
13804
|
// @ts-ignore
|
|
13863
13805
|
result.setAttribute('data-sitekey', process.env.GOOGLE_CAPTCHA_KEY);
|
|
@@ -13866,14 +13808,14 @@ var juxWeb = (function (exports) {
|
|
|
13866
13808
|
return result;
|
|
13867
13809
|
};
|
|
13868
13810
|
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13811
|
+
const juxWhite = '#FFF';
|
|
13812
|
+
const juxDarkGrey = '#282828';
|
|
13813
|
+
const juxDimmedDarkGrey = '#28282822';
|
|
13814
|
+
const juxDimmedBlack = '#00000088';
|
|
13815
|
+
const juxLightGreen = '#20B03D';
|
|
13816
|
+
const juxMediumGreen = '#0D631E';
|
|
13875
13817
|
|
|
13876
|
-
|
|
13818
|
+
const onKeyDown = (ev, el, persitent, onClose) => {
|
|
13877
13819
|
if (ev.key === 'Escape') {
|
|
13878
13820
|
if (persitent) {
|
|
13879
13821
|
return;
|
|
@@ -13887,34 +13829,34 @@ var juxWeb = (function (exports) {
|
|
|
13887
13829
|
el.dispatchEvent(new CustomEvent('ok'));
|
|
13888
13830
|
}
|
|
13889
13831
|
};
|
|
13890
|
-
|
|
13832
|
+
const close = (el, onClose) => {
|
|
13891
13833
|
el.remove();
|
|
13892
13834
|
if (onClose) {
|
|
13893
13835
|
onClose();
|
|
13894
13836
|
}
|
|
13895
13837
|
};
|
|
13896
|
-
|
|
13897
|
-
|
|
13898
|
-
cancelButton === null || cancelButton === void 0 ? void 0 : cancelButton.addEventListener('click',
|
|
13838
|
+
const attachEventHandlers = (el, persitent, onClose) => {
|
|
13839
|
+
const cancelButton = el.querySelector('.cancel');
|
|
13840
|
+
cancelButton === null || cancelButton === void 0 ? void 0 : cancelButton.addEventListener('click', (_e) => {
|
|
13899
13841
|
el.dispatchEvent(new CustomEvent('cancel'));
|
|
13900
13842
|
if (el.hasAttribute('dont-remove')) {
|
|
13901
13843
|
return;
|
|
13902
13844
|
}
|
|
13903
13845
|
close(el, onClose);
|
|
13904
13846
|
});
|
|
13905
|
-
|
|
13847
|
+
const closeButton = el.querySelector('.close');
|
|
13906
13848
|
if (closeButton) {
|
|
13907
|
-
closeButton.addEventListener('click',
|
|
13849
|
+
closeButton.addEventListener('click', (_e) => {
|
|
13908
13850
|
close(el, onClose);
|
|
13909
13851
|
});
|
|
13910
13852
|
}
|
|
13911
|
-
|
|
13912
|
-
okButton === null || okButton === void 0 ? void 0 : okButton.addEventListener('click',
|
|
13853
|
+
const okButton = el.querySelector('.ok');
|
|
13854
|
+
okButton === null || okButton === void 0 ? void 0 : okButton.addEventListener('click', (_e) => {
|
|
13913
13855
|
el.dispatchEvent(new CustomEvent('ok'));
|
|
13914
13856
|
});
|
|
13915
|
-
el.removeEventListener('keydown',
|
|
13916
|
-
el.addEventListener('keydown',
|
|
13917
|
-
el === null || el === void 0 ? void 0 : el.addEventListener('click',
|
|
13857
|
+
el.removeEventListener('keydown', (ev) => onKeyDown(ev, el, persitent, () => onClose));
|
|
13858
|
+
el.addEventListener('keydown', (ev) => onKeyDown(ev, el, persitent, () => onClose));
|
|
13859
|
+
el === null || el === void 0 ? void 0 : el.addEventListener('click', (e) => {
|
|
13918
13860
|
if (e.target === el) {
|
|
13919
13861
|
if (persitent) {
|
|
13920
13862
|
return;
|
|
@@ -13936,11 +13878,11 @@ var juxWeb = (function (exports) {
|
|
|
13936
13878
|
// onClose?: any,
|
|
13937
13879
|
// titleStyle?: string,
|
|
13938
13880
|
// }
|
|
13939
|
-
|
|
13881
|
+
const applyWrapperStyle = (wrapper) => {
|
|
13940
13882
|
wrapper.style.alignItems = 'center';
|
|
13941
13883
|
wrapper.style.backgroundColor = juxWhite;
|
|
13942
13884
|
wrapper.style.borderRadius = '.3125rem';
|
|
13943
|
-
wrapper.style.boxShadow =
|
|
13885
|
+
wrapper.style.boxShadow = `0 0 1.33rem ${juxDimmedBlack}`;
|
|
13944
13886
|
wrapper.style.boxSizing = 'content-box';
|
|
13945
13887
|
wrapper.style.display = 'flex';
|
|
13946
13888
|
wrapper.style.flexDirection = 'column';
|
|
@@ -13952,7 +13894,7 @@ var juxWeb = (function (exports) {
|
|
|
13952
13894
|
wrapper.style.padding = '1.33rem';
|
|
13953
13895
|
wrapper.style.position = 'relative';
|
|
13954
13896
|
};
|
|
13955
|
-
|
|
13897
|
+
const applyModalStyle = (modal) => {
|
|
13956
13898
|
modal.style.alignItems = 'center';
|
|
13957
13899
|
modal.style.backgroundColor = juxDimmedBlack;
|
|
13958
13900
|
modal.style.display = 'flex';
|
|
@@ -13965,7 +13907,7 @@ var juxWeb = (function (exports) {
|
|
|
13965
13907
|
modal.style.width = '100%';
|
|
13966
13908
|
modal.style.zIndex = '9999';
|
|
13967
13909
|
};
|
|
13968
|
-
|
|
13910
|
+
const applyHeaderStyle = (header) => {
|
|
13969
13911
|
header.style.alignItems = 'center';
|
|
13970
13912
|
header.style.color = juxMediumGreen;
|
|
13971
13913
|
header.style.flexDirection = 'row';
|
|
@@ -13977,7 +13919,7 @@ var juxWeb = (function (exports) {
|
|
|
13977
13919
|
header.style.position = 'relative';
|
|
13978
13920
|
header.style.width = '100%';
|
|
13979
13921
|
};
|
|
13980
|
-
|
|
13922
|
+
const applyJuxModalContentStyle = (el) => {
|
|
13981
13923
|
el.style.display = 'flex';
|
|
13982
13924
|
el.style.position = 'relative';
|
|
13983
13925
|
el.style.width = '100%';
|
|
@@ -13985,37 +13927,32 @@ var juxWeb = (function (exports) {
|
|
|
13985
13927
|
el.style.marginTop = '1.33rem';
|
|
13986
13928
|
el.style.rowGap = '8px';
|
|
13987
13929
|
};
|
|
13988
|
-
|
|
13989
|
-
|
|
13990
|
-
if (content === void 0) { content = ''; }
|
|
13991
|
-
if (persistent === void 0) { persistent = false; }
|
|
13992
|
-
if (okTxt === void 0) { okTxt = getTranslation('alert-ok-btn-txt'); }
|
|
13993
|
-
if (cancelTxt === void 0) { cancelTxt = getTranslation('alert-cancel-btn-txt'); }
|
|
13994
|
-
var result = document.createElement('jux-modal');
|
|
13930
|
+
const juxModal = (title, btns = ['ok', 'cancel'], content = '', persistent = false, _busy = false, body, okTxt = getTranslation('alert-ok-btn-txt'), cancelTxt = getTranslation('alert-cancel-btn-txt'), onClose, titleStyle) => {
|
|
13931
|
+
const result = document.createElement('jux-modal');
|
|
13995
13932
|
applyModalStyle(result);
|
|
13996
|
-
|
|
13933
|
+
const wrapper = document.createElement('modal-wrapper');
|
|
13997
13934
|
applyWrapperStyle(wrapper);
|
|
13998
13935
|
// START close
|
|
13999
|
-
|
|
13936
|
+
const closeBtn = document.createElement('button');
|
|
14000
13937
|
if (!persistent) {
|
|
14001
13938
|
closeBtn.className = 'close';
|
|
14002
13939
|
closeBtn.setAttribute('aria-label', getTranslation('close'));
|
|
14003
13940
|
}
|
|
14004
13941
|
// END close
|
|
14005
13942
|
// START header
|
|
14006
|
-
|
|
13943
|
+
const header = document.createElement('modal-header');
|
|
14007
13944
|
applyHeaderStyle(header);
|
|
14008
13945
|
if (title) {
|
|
14009
13946
|
if (titleStyle) {
|
|
14010
13947
|
header.classList.add(titleStyle);
|
|
14011
13948
|
}
|
|
14012
|
-
|
|
13949
|
+
const h3 = document.createElement('h3');
|
|
14013
13950
|
h3.textContent = title;
|
|
14014
13951
|
header.appendChild(h3);
|
|
14015
13952
|
}
|
|
14016
13953
|
// END header
|
|
14017
13954
|
// START content
|
|
14018
|
-
|
|
13955
|
+
const modalContent = document.createElement('jux-modal-content');
|
|
14019
13956
|
applyJuxModalContentStyle(modalContent);
|
|
14020
13957
|
if (content) {
|
|
14021
13958
|
modalContent.innerHTML = content;
|
|
@@ -14025,22 +13962,22 @@ var juxWeb = (function (exports) {
|
|
|
14025
13962
|
}
|
|
14026
13963
|
// END content
|
|
14027
13964
|
// START footer
|
|
14028
|
-
|
|
13965
|
+
const footer = document.createElement('modal-footer');
|
|
14029
13966
|
if (btns.includes('cancel')) {
|
|
14030
|
-
|
|
13967
|
+
const cancelBtn = document.createElement('button');
|
|
14031
13968
|
cancelBtn.classList.add('secondary-button', 'modal-button', 'action', 'cancel-btn', 'cancel');
|
|
14032
|
-
|
|
13969
|
+
const cancelText = document.createElement('button-text');
|
|
14033
13970
|
cancelText.textContent = cancelTxt;
|
|
14034
|
-
|
|
13971
|
+
const cancelSpinner = document.createElement('loading-spinner');
|
|
14035
13972
|
cancelBtn.append(cancelText, cancelSpinner);
|
|
14036
13973
|
footer.appendChild(cancelBtn);
|
|
14037
13974
|
}
|
|
14038
13975
|
if (btns.includes('ok')) {
|
|
14039
|
-
|
|
13976
|
+
const okBtn = document.createElement('button');
|
|
14040
13977
|
okBtn.classList.add('primary-button', 'modal-button', 'action', 'ok');
|
|
14041
|
-
|
|
13978
|
+
const okText = document.createElement('button-text');
|
|
14042
13979
|
okText.textContent = okTxt;
|
|
14043
|
-
|
|
13980
|
+
const okSpinner = document.createElement('loading-spinner');
|
|
14044
13981
|
okBtn.append(okText, okSpinner);
|
|
14045
13982
|
footer.appendChild(okBtn);
|
|
14046
13983
|
}
|
|
@@ -14064,15 +14001,13 @@ var juxWeb = (function (exports) {
|
|
|
14064
14001
|
return result;
|
|
14065
14002
|
};
|
|
14066
14003
|
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
|
|
14071
|
-
var elId = 'contact-' + elName;
|
|
14072
|
-
var label = document.createElement('label');
|
|
14004
|
+
const contactField = (tag = 'input', elType, elName, required = true, value) => {
|
|
14005
|
+
const result = document.createElement('contact-field');
|
|
14006
|
+
const elId = 'contact-' + elName;
|
|
14007
|
+
const label = document.createElement('label');
|
|
14073
14008
|
label.textContent = getTranslation(elId + '-label');
|
|
14074
14009
|
label.htmlFor = elId;
|
|
14075
|
-
|
|
14010
|
+
const el = document.createElement(tag);
|
|
14076
14011
|
el.id = elId;
|
|
14077
14012
|
el.setAttribute('name', elName);
|
|
14078
14013
|
el.setAttribute('placeholder', getTranslation(elId + '-placeholder'));
|
|
@@ -14089,72 +14024,75 @@ var juxWeb = (function (exports) {
|
|
|
14089
14024
|
return result;
|
|
14090
14025
|
};
|
|
14091
14026
|
|
|
14092
|
-
|
|
14093
|
-
|
|
14027
|
+
const getNestedElValue = (el, nestedTag) => {
|
|
14028
|
+
const nestedEl = el.querySelector(nestedTag);
|
|
14094
14029
|
return nestedEl.value;
|
|
14095
14030
|
};
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
subject:
|
|
14099
|
-
body:
|
|
14100
|
-
|
|
14101
|
-
|
|
14102
|
-
|
|
14031
|
+
const sendInquiry = (name, email, msg, whatsapp, subject, token) => {
|
|
14032
|
+
const inquiryPayload = {
|
|
14033
|
+
subject: `[${subject.charAt(0).toUpperCase()}${subject.slice(1)}] ${getNestedElValue(name, 'input')}`,
|
|
14034
|
+
body: `<strong>Name</strong>: ${getNestedElValue(name, 'input')}<br><br>
|
|
14035
|
+
<strong>E-mail</strong>: ${getNestedElValue(email, 'input')}<br><br>
|
|
14036
|
+
<strong>Whatsapp</strong>: ${getNestedElValue(whatsapp, 'input')}<br><br>
|
|
14037
|
+
<strong>Message</strong>: ${getNestedElValue(msg, 'textarea')}`,
|
|
14038
|
+
token,
|
|
14039
|
+
};
|
|
14040
|
+
backendPost('contact-us', JSON.stringify(inquiryPayload), (_res) => {
|
|
14103
14041
|
var _a;
|
|
14104
14042
|
// success(getTranslation('form-success'), Length.long);
|
|
14105
14043
|
(_a = document.querySelector('#contact-us-modal')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
14106
|
-
},
|
|
14044
|
+
}, () => { } // TODO: change it to be an error handling fn provided by the client
|
|
14107
14045
|
);
|
|
14108
14046
|
// checkMixpanel(() => mixpanel.track('Sent Contact Inquiry', {}));
|
|
14109
14047
|
};
|
|
14110
|
-
|
|
14048
|
+
const contactUsModal = (subject) => {
|
|
14111
14049
|
var _a, _b, _c, _d, _e;
|
|
14112
|
-
|
|
14050
|
+
const result = document.createElement('contact-us-modal');
|
|
14113
14051
|
// @ts-ignore
|
|
14114
|
-
|
|
14052
|
+
const currentName = window.store.currentUser ? window.store.currentUser.name : '';
|
|
14115
14053
|
// @ts-ignore
|
|
14116
|
-
|
|
14117
|
-
|
|
14118
|
-
|
|
14054
|
+
const currentEmail = window.store.currentUser ? window.store.currentUser.email : (_a = document.querySelector('#magic-link-email')) === null || _a === void 0 ? void 0 : _a.textContent;
|
|
14055
|
+
const modalBody = document.createElement('modal-body');
|
|
14056
|
+
const form = document.createElement('form');
|
|
14119
14057
|
form.id = 'contact-form';
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
14058
|
+
const nameField = contactField('input', 'text', 'name', true, currentName);
|
|
14059
|
+
const emailField = contactField('input', 'email', 'email', true, currentEmail);
|
|
14060
|
+
const messageField = contactField('textarea', 'text', 'message', true);
|
|
14061
|
+
const whatsappField = contactField('input', 'tel', 'whatsapp', false);
|
|
14062
|
+
const btn = document.createElement('button');
|
|
14125
14063
|
btn.textContent = getTranslation('contact-submit');
|
|
14126
14064
|
btn.className = 'primary-button';
|
|
14127
14065
|
form.append(nameField, emailField, whatsappField, messageField, btn);
|
|
14128
14066
|
modalBody.appendChild(form);
|
|
14129
|
-
|
|
14067
|
+
const modal = juxModal(getTranslation('contact-page'), [], '', false, false, modalBody, '', '', () => result.remove());
|
|
14130
14068
|
modal.id = 'contact-us-modal';
|
|
14131
14069
|
document.body.appendChild(modal);
|
|
14132
14070
|
(_b = modal.querySelector('modal-wrapper')) === null || _b === void 0 ? void 0 : _b.setAttribute('style', 'max-width: 680px; width: 100%; overflow-y: auto;');
|
|
14133
|
-
|
|
14071
|
+
const captcha = googleCaptcha();
|
|
14134
14072
|
if (subject !== 'email-not-sent') {
|
|
14135
14073
|
// @ts-ignore
|
|
14136
|
-
|
|
14137
|
-
backendGet(
|
|
14138
|
-
|
|
14074
|
+
const admin = ((_d = (_c = window.store) === null || _c === void 0 ? void 0 : _c.selectedTeam) === null || _d === void 0 ? void 0 : _d.admin) || window.store.currentUser.email;
|
|
14075
|
+
backendGet(`credits-balance-for?admin=${admin}`, null, (res) => {
|
|
14076
|
+
const balance = res;
|
|
14139
14077
|
if (balance <= 0) {
|
|
14140
14078
|
form.insertBefore(captcha, btn);
|
|
14141
14079
|
}
|
|
14142
|
-
},
|
|
14080
|
+
}, () => { } // TODO: change it to be an error handling fn provided by the client
|
|
14143
14081
|
);
|
|
14144
14082
|
}
|
|
14145
14083
|
else {
|
|
14146
14084
|
form.insertBefore(captcha, btn);
|
|
14147
14085
|
}
|
|
14148
14086
|
(_e = nameField.querySelector('input')) === null || _e === void 0 ? void 0 : _e.select();
|
|
14149
|
-
form.addEventListener('submit',
|
|
14087
|
+
form.addEventListener('submit', (event) => {
|
|
14150
14088
|
event.preventDefault();
|
|
14151
14089
|
sendInquiry(nameField, emailField, messageField, whatsappField, subject, captcha.getAttribute('token'));
|
|
14152
14090
|
});
|
|
14153
14091
|
return result;
|
|
14154
14092
|
};
|
|
14155
14093
|
|
|
14156
|
-
|
|
14157
|
-
page.style.backgroundImage =
|
|
14094
|
+
const applyPageStyles$1 = (page, backgroundImg) => {
|
|
14095
|
+
page.style.backgroundImage = `url(${backgroundImg})`;
|
|
14158
14096
|
page.style.display = 'block';
|
|
14159
14097
|
page.style.width = '100%';
|
|
14160
14098
|
page.style.height = '100%';
|
|
@@ -14162,7 +14100,7 @@ var juxWeb = (function (exports) {
|
|
|
14162
14100
|
page.style.backgroundSize = 'cover';
|
|
14163
14101
|
page.style.display = 'block';
|
|
14164
14102
|
};
|
|
14165
|
-
|
|
14103
|
+
const applyContainerStyles$1 = (container) => {
|
|
14166
14104
|
container.style.backgroundColor = '#ffffffdd';
|
|
14167
14105
|
container.style.borderRadius = '16px';
|
|
14168
14106
|
container.style.inset = '50% 50% 50% 0';
|
|
@@ -14178,7 +14116,7 @@ var juxWeb = (function (exports) {
|
|
|
14178
14116
|
container.style.margin = '0 auto';
|
|
14179
14117
|
container.style.paddingTop = '0';
|
|
14180
14118
|
};
|
|
14181
|
-
|
|
14119
|
+
const applyBtnStyles = (btn) => {
|
|
14182
14120
|
btn.style.cursor = 'pointer';
|
|
14183
14121
|
btn.style.textDecoration = 'underline';
|
|
14184
14122
|
btn.style.border = 'none';
|
|
@@ -14191,31 +14129,31 @@ var juxWeb = (function (exports) {
|
|
|
14191
14129
|
btn.style.whiteSpace = 'normal';
|
|
14192
14130
|
btn.style.font = 'inherit';
|
|
14193
14131
|
};
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14132
|
+
const magicLinkRequestedPage = (backgroundImg, onReturn) => {
|
|
14133
|
+
const result = document.createElement('magic-link-requested-page');
|
|
14134
|
+
const section = document.createElement('section');
|
|
14197
14135
|
applyContainerStyles$1(section);
|
|
14198
|
-
|
|
14136
|
+
const magicLinkSent = document.createElement('p');
|
|
14199
14137
|
magicLinkSent.id = 'magic-link-sent';
|
|
14200
14138
|
magicLinkSent.textContent = getTranslation(magicLinkSent.id);
|
|
14201
14139
|
magicLinkSent.style.marginBottom = '10px';
|
|
14202
|
-
|
|
14140
|
+
const magicLinkEmail = document.createElement('p');
|
|
14203
14141
|
magicLinkEmail.id = 'magic-link-email';
|
|
14204
14142
|
magicLinkEmail.style.fontWeight = '700';
|
|
14205
14143
|
magicLinkEmail.style.marginBottom = '10px';
|
|
14206
|
-
|
|
14144
|
+
const magicLinkHowTo = document.createElement('p');
|
|
14207
14145
|
magicLinkHowTo.id = 'magic-link-how-to';
|
|
14208
14146
|
magicLinkHowTo.innerHTML = getTranslation(magicLinkHowTo.id);
|
|
14209
14147
|
magicLinkHowTo.style.padding = '0 30px';
|
|
14210
14148
|
magicLinkHowTo.style.textAlign = 'center';
|
|
14211
|
-
|
|
14149
|
+
const btn = document.createElement('button');
|
|
14212
14150
|
btn.id = 'email-not-received-btn';
|
|
14213
|
-
btn.addEventListener('click',
|
|
14151
|
+
btn.addEventListener('click', () => document.body.appendChild(contactUsModal('email-not-sent')));
|
|
14214
14152
|
btn.textContent = getTranslation('magic-link-let-us-know');
|
|
14215
14153
|
applyBtnStyles(btn);
|
|
14216
|
-
|
|
14154
|
+
const returnLink = document.createElement('a');
|
|
14217
14155
|
returnLink.textContent = getTranslation('return-link');
|
|
14218
|
-
returnLink.onclick =
|
|
14156
|
+
returnLink.onclick = () => {
|
|
14219
14157
|
result.remove();
|
|
14220
14158
|
onReturn();
|
|
14221
14159
|
};
|
|
@@ -14229,37 +14167,37 @@ var juxWeb = (function (exports) {
|
|
|
14229
14167
|
return result;
|
|
14230
14168
|
};
|
|
14231
14169
|
|
|
14232
|
-
|
|
14170
|
+
const setBackendToken = (token) => {
|
|
14233
14171
|
// @ts-ignore
|
|
14234
14172
|
window.store.backendToken = token;
|
|
14235
14173
|
if (token) {
|
|
14236
14174
|
localStorage.setItem('token', token);
|
|
14237
14175
|
}
|
|
14238
14176
|
};
|
|
14239
|
-
|
|
14177
|
+
const getBackendToken = () => {
|
|
14240
14178
|
var _a;
|
|
14241
|
-
|
|
14179
|
+
const token = (_a = localStorage.getItem('token')) !== null && _a !== void 0 ? _a : '';
|
|
14242
14180
|
// @ts-ignore
|
|
14243
14181
|
window.store.backendToken = token;
|
|
14244
14182
|
return token;
|
|
14245
14183
|
};
|
|
14246
|
-
|
|
14184
|
+
const onTokenAcquired = (token, onUserLogin) => {
|
|
14247
14185
|
setBackendToken(token);
|
|
14248
14186
|
// setSuperToken();
|
|
14249
14187
|
onUserLogin();
|
|
14250
14188
|
};
|
|
14251
|
-
|
|
14189
|
+
const clearSession = () => {
|
|
14252
14190
|
// onUserChanged(null);
|
|
14253
14191
|
localStorage.clear();
|
|
14254
14192
|
// @ts-ignore
|
|
14255
14193
|
window.store = {};
|
|
14256
14194
|
};
|
|
14257
|
-
|
|
14195
|
+
const onAuthenticationFailure = (msg) => {
|
|
14258
14196
|
localStorage.removeItem('token');
|
|
14259
14197
|
// displayPage(Page.LOGIN);
|
|
14260
14198
|
alert(getTranslation(msg));
|
|
14261
14199
|
};
|
|
14262
|
-
|
|
14200
|
+
const onAuthentication = (onUserLogin, user, type) => {
|
|
14263
14201
|
if ((user.token && getBackendToken()) && getBackendToken() !== user.token) {
|
|
14264
14202
|
clearSession();
|
|
14265
14203
|
}
|
|
@@ -14272,11 +14210,15 @@ var juxWeb = (function (exports) {
|
|
|
14272
14210
|
// mixpanelIdentify(user);
|
|
14273
14211
|
// checkMixpanel(() => mixpanel.track('Login', { 'Login Type': type }));
|
|
14274
14212
|
};
|
|
14275
|
-
|
|
14276
|
-
Array.from(clientApp.children).forEach(
|
|
14213
|
+
const displayPage = (clientApp, page) => {
|
|
14214
|
+
Array.from(clientApp.children).forEach(el => el.remove());
|
|
14277
14215
|
clientApp.appendChild(page);
|
|
14278
14216
|
};
|
|
14279
|
-
|
|
14217
|
+
const setJuxEventHandler = () => {
|
|
14218
|
+
document.removeEventListener('jux-event', handleJuxEvents);
|
|
14219
|
+
document.addEventListener('jux-event', handleJuxEvents);
|
|
14220
|
+
};
|
|
14221
|
+
const initSession = (clientApp, supportedLoginTypes, onUserLogin, backgroundImage, fetchUserBackendUrl, magicLinkRequestEndpoint, magicLinkAuthEndpoint) => {
|
|
14280
14222
|
// if (startNewDemo()) {
|
|
14281
14223
|
// initDemo(setBackendToken, onAuthentication);
|
|
14282
14224
|
// return;
|
|
@@ -14292,25 +14234,27 @@ var juxWeb = (function (exports) {
|
|
|
14292
14234
|
window.store.magicLinkRequestEndpoint = magicLinkRequestEndpoint;
|
|
14293
14235
|
// @ts-ignore
|
|
14294
14236
|
window.store.magicLinkAuthEndpoint = magicLinkAuthEndpoint;
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14237
|
+
// TODO: use jux-events to call commands and queries
|
|
14238
|
+
setJuxEventHandler();
|
|
14239
|
+
const signInToken = extractTokenFromWindowLocation('sign-in') || extractTokenFromWindowLocation('magic-link');
|
|
14240
|
+
if (signInToken) {
|
|
14241
|
+
const onOpenMagicLink = () => {
|
|
14242
|
+
openMagicLink(signInToken, (res) => onAuthentication(onUserLogin, res, 'Magic Link'), () => onAuthenticationFailure('unable-magic-login'));
|
|
14299
14243
|
};
|
|
14300
|
-
|
|
14244
|
+
const host = extractTokenFromWindowLocation('host');
|
|
14301
14245
|
if (host) {
|
|
14302
14246
|
// @ts-ignore
|
|
14303
|
-
window.store.fetchUserBackendUrl({ host
|
|
14247
|
+
window.store.fetchUserBackendUrl({ host }, (backendUrl) => {
|
|
14304
14248
|
setBackendUrl(backendUrl);
|
|
14305
|
-
|
|
14249
|
+
onOpenMagicLink();
|
|
14306
14250
|
});
|
|
14307
14251
|
return;
|
|
14308
14252
|
}
|
|
14309
|
-
|
|
14253
|
+
onOpenMagicLink();
|
|
14310
14254
|
return;
|
|
14311
14255
|
}
|
|
14312
14256
|
if (getBackendToken()) {
|
|
14313
|
-
backendGet('profile',
|
|
14257
|
+
backendGet('profile', null, (res) => onAuthentication(onUserLogin, res, 'Token Authentication'), (_err) => onAuthenticationFailure('login-failed'));
|
|
14314
14258
|
return;
|
|
14315
14259
|
}
|
|
14316
14260
|
displayPage(clientApp, loginPage(clientApp, backgroundImage, onUserLogin, supportedLoginTypes));
|
|
@@ -14326,73 +14270,62 @@ var juxWeb = (function (exports) {
|
|
|
14326
14270
|
// validateThirdPartyCookies(initGapi, () => displayPage(Page.LOGIN));
|
|
14327
14271
|
// checkMixpanel(() => mixpanel.track('View Login Page'));
|
|
14328
14272
|
};
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
|
|
14337
|
-
|
|
14338
|
-
|
|
14339
|
-
|
|
14340
|
-
|
|
14341
|
-
|
|
14342
|
-
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
|
|
14346
|
-
|
|
14347
|
-
|
|
14348
|
-
|
|
14349
|
-
|
|
14350
|
-
|
|
14351
|
-
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
case 4:
|
|
14358
|
-
err_1 = _a.sent();
|
|
14359
|
-
reportError(err_1);
|
|
14360
|
-
disableSignInLayout();
|
|
14361
|
-
return [3 /*break*/, 5];
|
|
14362
|
-
case 5: return [2 /*return*/];
|
|
14363
|
-
}
|
|
14364
|
-
});
|
|
14365
|
-
}); };
|
|
14366
|
-
var onCookieError = function () {
|
|
14273
|
+
const onMicrosoftSignIn = (onUserLogin) => __awaiter$2(void 0, void 0, void 0, function* () {
|
|
14274
|
+
const msalConfig = { auth: { clientId: process.env.MICROSOFT_CLIENT_ID } };
|
|
14275
|
+
const msalInstance = new PublicClientApplication(msalConfig);
|
|
14276
|
+
const loginRequest = { scopes: ['user.read'] };
|
|
14277
|
+
enableSignInLayout();
|
|
14278
|
+
try {
|
|
14279
|
+
const loginResponse = yield msalInstance.loginPopup(loginRequest);
|
|
14280
|
+
const { accessToken } = loginResponse;
|
|
14281
|
+
const onSuccess = (res) => {
|
|
14282
|
+
const { token } = res;
|
|
14283
|
+
// @ts-ignore
|
|
14284
|
+
window.store.currentUser = res;
|
|
14285
|
+
onTokenAcquired(token, onUserLogin);
|
|
14286
|
+
disableSignInLayout();
|
|
14287
|
+
};
|
|
14288
|
+
const onError = (err) => {
|
|
14289
|
+
console.error(err);
|
|
14290
|
+
reportError(err);
|
|
14291
|
+
disableSignInLayout();
|
|
14292
|
+
};
|
|
14293
|
+
microsoftLogin(accessToken, onSuccess, onError);
|
|
14294
|
+
}
|
|
14295
|
+
catch (err) {
|
|
14296
|
+
reportError(err);
|
|
14297
|
+
disableSignInLayout();
|
|
14298
|
+
}
|
|
14299
|
+
});
|
|
14300
|
+
const onCookieError = () => {
|
|
14367
14301
|
disableSignInLayout();
|
|
14368
14302
|
// warning('cookie-error'); TODO
|
|
14369
14303
|
return;
|
|
14370
14304
|
};
|
|
14371
|
-
|
|
14372
|
-
validateThirdPartyCookies(
|
|
14305
|
+
const onGoogleSignIn = (onUserLogin) => {
|
|
14306
|
+
validateThirdPartyCookies(() => {
|
|
14373
14307
|
enableSignInLayout();
|
|
14374
14308
|
authSignIn(onUserLogin);
|
|
14375
14309
|
}, onCookieError);
|
|
14376
14310
|
};
|
|
14377
|
-
|
|
14378
|
-
if (email === void 0) { email = ''; }
|
|
14311
|
+
const handleMagicLinkRequest = (token, onReturn, backgroundImage, currentPage, clientBody, email = '') => {
|
|
14379
14312
|
if (!email) {
|
|
14380
|
-
|
|
14313
|
+
const mailMagic = document.querySelector('#mail-magic');
|
|
14381
14314
|
email = mailMagic.value;
|
|
14382
14315
|
}
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
requestMagicLink(payload,
|
|
14316
|
+
const payload = { email, token };
|
|
14317
|
+
const onRequestMagicLink = () => {
|
|
14318
|
+
requestMagicLink(payload, (_res) => {
|
|
14386
14319
|
currentPage.remove();
|
|
14387
14320
|
clientBody.appendChild(magicLinkRequestedPage(backgroundImage, onReturn));
|
|
14388
|
-
|
|
14321
|
+
const magicLinkEmail = document.querySelector('#magic-link-email');
|
|
14389
14322
|
magicLinkEmail.textContent = email;
|
|
14390
14323
|
});
|
|
14391
14324
|
};
|
|
14392
14325
|
// @ts-ignore
|
|
14393
14326
|
if (window.store.fetchUserBackendUrl) {
|
|
14394
14327
|
// @ts-ignore
|
|
14395
|
-
window.store.fetchUserBackendUrl({ email
|
|
14328
|
+
window.store.fetchUserBackendUrl({ email }, (backendUrl) => {
|
|
14396
14329
|
setBackendUrl(backendUrl);
|
|
14397
14330
|
onRequestMagicLink();
|
|
14398
14331
|
});
|
|
@@ -14401,118 +14334,101 @@ var juxWeb = (function (exports) {
|
|
|
14401
14334
|
onRequestMagicLink();
|
|
14402
14335
|
};
|
|
14403
14336
|
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14407
|
-
email.textContent = "
|
|
14408
|
-
|
|
14337
|
+
const socialLoginModal = (userEmail, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal) => {
|
|
14338
|
+
const result = document.createElement('social-login-modal');
|
|
14339
|
+
const email = document.createElement('p');
|
|
14340
|
+
email.textContent = `"${userEmail}"`;
|
|
14341
|
+
const msg = document.createElement('social-login-msg');
|
|
14409
14342
|
msg.textContent = getTranslation('social-login-recommendation') + mailExchanger + '.' + getTranslation('social-login-advantage');
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
loginButton('Microsoft',
|
|
14413
|
-
loginButton('Google',
|
|
14414
|
-
|
|
14343
|
+
const body = document.createElement('social-login-body');
|
|
14344
|
+
const socialLoginBtn = mailExchanger === 'Microsoft' ?
|
|
14345
|
+
loginButton('Microsoft', () => onMicrosoftSignIn(onUserLogin)) :
|
|
14346
|
+
loginButton('Google', () => onGoogleSignIn(onUserLogin));
|
|
14347
|
+
const proceedMagicLinkRequest = document.createElement('a');
|
|
14415
14348
|
proceedMagicLinkRequest.textContent = getTranslation('proceed-magic-link-request');
|
|
14416
|
-
proceedMagicLinkRequest.addEventListener('click',
|
|
14349
|
+
proceedMagicLinkRequest.addEventListener('click', () => {
|
|
14417
14350
|
handleMagicLinkRequest(token, onReturn, backgroundImage, currentPage, clientBody, userEmail);
|
|
14418
14351
|
closeMagicLinkModal();
|
|
14419
14352
|
result.remove();
|
|
14420
14353
|
});
|
|
14421
14354
|
body.append(email, msg, socialLoginBtn, proceedMagicLinkRequest);
|
|
14422
|
-
|
|
14355
|
+
const modal = juxModal(getTranslation(`using-${mailExchanger.toLowerCase()}-email`), [], '', false, false, body, '', '', () => result.remove());
|
|
14423
14356
|
modal.setAttribute('data-cy', 'social-login-modal');
|
|
14424
14357
|
result.appendChild(modal);
|
|
14425
|
-
|
|
14358
|
+
const wrapper = modal.querySelector('modal-wrapper');
|
|
14426
14359
|
wrapper.style.maxWidth = '360px';
|
|
14427
14360
|
wrapper.style.width = '100%';
|
|
14428
14361
|
return result;
|
|
14429
14362
|
};
|
|
14430
14363
|
|
|
14431
|
-
|
|
14432
|
-
|
|
14364
|
+
const isValidEmail = (email) => {
|
|
14365
|
+
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
14433
14366
|
return re.test(email);
|
|
14434
14367
|
};
|
|
14435
14368
|
|
|
14436
|
-
|
|
14369
|
+
const recommendSocialLogin = (userEmail, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal) => {
|
|
14437
14370
|
var _a;
|
|
14438
14371
|
(_a = document.querySelector('magic-link-modal')) === null || _a === void 0 ? void 0 : _a.remove();
|
|
14439
14372
|
document.body.appendChild(socialLoginModal(userEmail, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal));
|
|
14440
14373
|
};
|
|
14441
|
-
|
|
14442
|
-
return data.some(
|
|
14374
|
+
const hasProvider = (data, provider) => {
|
|
14375
|
+
return data.some((entry) => entry.includes(provider));
|
|
14443
14376
|
};
|
|
14444
|
-
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
|
|
14450
|
-
|
|
14451
|
-
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
console.error('invalid-captcha-response');
|
|
14472
|
-
// logError('invalid-captcha-response');
|
|
14473
|
-
return [2 /*return*/];
|
|
14474
|
-
}
|
|
14475
|
-
if (!isValidEmail(email)) return [3 /*break*/, 2];
|
|
14476
|
-
domain = email.split('@')[1] || '';
|
|
14477
|
-
return [4 /*yield*/, getMailExchanger(domain)];
|
|
14478
|
-
case 1:
|
|
14479
|
-
mailExchanger = _a.sent();
|
|
14480
|
-
supportedMailExchanger = mailExchanger !== null;
|
|
14481
|
-
if (supportedMailExchanger && loginTypes.includes(mailExchanger)) {
|
|
14482
|
-
recommendSocialLogin(email, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal);
|
|
14483
|
-
return [2 /*return*/];
|
|
14484
|
-
}
|
|
14485
|
-
_a.label = 2;
|
|
14486
|
-
case 2:
|
|
14487
|
-
handleMagicLinkRequest(token, onReturn, backgroundImage, currentPage, clientBody);
|
|
14488
|
-
closeMagicLinkModal();
|
|
14489
|
-
return [2 /*return*/];
|
|
14377
|
+
const getMailExchanger = (domainName) => __awaiter$2(void 0, void 0, void 0, function* () {
|
|
14378
|
+
const data = yield getMXData(domainName);
|
|
14379
|
+
if (!data) {
|
|
14380
|
+
return null;
|
|
14381
|
+
}
|
|
14382
|
+
if (hasProvider(data, 'outlook.com')) {
|
|
14383
|
+
return 'Microsoft';
|
|
14384
|
+
}
|
|
14385
|
+
if (hasProvider(data, 'google.com')) {
|
|
14386
|
+
return 'Google';
|
|
14387
|
+
}
|
|
14388
|
+
return null;
|
|
14389
|
+
});
|
|
14390
|
+
const onMagicLinkRequest = (token, input, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal, loginTypes) => __awaiter$2(void 0, void 0, void 0, function* () {
|
|
14391
|
+
const email = input.value;
|
|
14392
|
+
if (!email.includes('-test@') && !token) {
|
|
14393
|
+
console.error('invalid-captcha-response');
|
|
14394
|
+
// logError('invalid-captcha-response');
|
|
14395
|
+
return;
|
|
14396
|
+
}
|
|
14397
|
+
if (isValidEmail(email)) {
|
|
14398
|
+
const domain = email.split('@')[1] || '';
|
|
14399
|
+
const mailExchanger = yield getMailExchanger(domain);
|
|
14400
|
+
const supportedMailExchanger = mailExchanger !== null;
|
|
14401
|
+
if (supportedMailExchanger && loginTypes.includes(mailExchanger)) {
|
|
14402
|
+
recommendSocialLogin(email, mailExchanger, token, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal);
|
|
14403
|
+
return;
|
|
14490
14404
|
}
|
|
14491
|
-
}
|
|
14492
|
-
|
|
14493
|
-
|
|
14405
|
+
}
|
|
14406
|
+
handleMagicLinkRequest(token, onReturn, backgroundImage, currentPage, clientBody);
|
|
14407
|
+
closeMagicLinkModal();
|
|
14408
|
+
});
|
|
14409
|
+
const applyMagicEmailFieldStyle = (el) => {
|
|
14494
14410
|
el.style.display = 'flex';
|
|
14495
14411
|
el.style.flexFlow = 'column';
|
|
14496
14412
|
el.style.marginTop = '8px';
|
|
14497
14413
|
el.style.rowGap = '8px';
|
|
14498
14414
|
el.style.width = '100%';
|
|
14499
14415
|
};
|
|
14500
|
-
|
|
14501
|
-
input.style.border =
|
|
14416
|
+
const applyInputStyle = (input) => {
|
|
14417
|
+
input.style.border = `1px solid ${juxDarkGrey}`;
|
|
14502
14418
|
input.style.maxWidth = '390px';
|
|
14503
14419
|
input.style.padding = '10px';
|
|
14504
14420
|
input.style.width = '100%';
|
|
14505
14421
|
input.style.backgroundColor = juxWhite;
|
|
14506
14422
|
input.style.borderRadius = '8px';
|
|
14507
|
-
input.style.boxShadow =
|
|
14423
|
+
input.style.boxShadow = `inset 0 2px 3px ${juxDimmedDarkGrey}`;
|
|
14508
14424
|
input.style.height = '40px';
|
|
14509
14425
|
input.style.whiteSpace = 'pre-line';
|
|
14510
14426
|
input.style.boxSizing = 'border-box';
|
|
14511
14427
|
};
|
|
14512
|
-
|
|
14428
|
+
const applyBtnStyle = (btn) => {
|
|
14513
14429
|
btn.style.alignSelf = 'flex-end';
|
|
14514
14430
|
btn.style.backgroundColor = juxLightGreen;
|
|
14515
|
-
btn.style.border =
|
|
14431
|
+
btn.style.border = `2px solid ${juxLightGreen}`;
|
|
14516
14432
|
btn.style.borderRadius = '8px';
|
|
14517
14433
|
btn.style.color = juxWhite;
|
|
14518
14434
|
btn.style.cursor = 'pointer';
|
|
@@ -14524,48 +14440,48 @@ var juxWeb = (function (exports) {
|
|
|
14524
14440
|
btn.style.padding = '10px 16px';
|
|
14525
14441
|
btn.style.position = 'relative';
|
|
14526
14442
|
};
|
|
14527
|
-
|
|
14528
|
-
|
|
14443
|
+
const magicEmailField = (onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal, loginTypes) => {
|
|
14444
|
+
const result = document.createElement('magic-email-field');
|
|
14529
14445
|
applyMagicEmailFieldStyle(result);
|
|
14530
|
-
|
|
14531
|
-
|
|
14446
|
+
const captcha = googleCaptcha();
|
|
14447
|
+
const input = document.createElement('input');
|
|
14532
14448
|
input.id = 'mail-magic';
|
|
14533
14449
|
input.type = 'text';
|
|
14534
14450
|
input.className = 'textfield';
|
|
14535
14451
|
input.placeholder = 'e-mail';
|
|
14536
14452
|
applyInputStyle(input);
|
|
14537
|
-
input.addEventListener('keydown',
|
|
14453
|
+
input.addEventListener('keydown', (ev) => {
|
|
14538
14454
|
if (ev.key === 'Enter') {
|
|
14539
14455
|
onMagicLinkRequest(captcha.getAttribute('token'), input, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal, loginTypes);
|
|
14540
14456
|
}
|
|
14541
14457
|
});
|
|
14542
|
-
|
|
14458
|
+
const btn = document.createElement('button');
|
|
14543
14459
|
applyBtnStyle(btn);
|
|
14544
14460
|
btn.id = 'send-magic';
|
|
14545
14461
|
btn.className = 'primary-button';
|
|
14546
|
-
btn.addEventListener('click',
|
|
14462
|
+
btn.addEventListener('click', (_ev) => onMagicLinkRequest(captcha.getAttribute('token'), input, onUserLogin, onReturn, backgroundImage, currentPage, clientBody, closeMagicLinkModal, loginTypes));
|
|
14547
14463
|
btn.textContent = getTranslation('send-magic');
|
|
14548
14464
|
result.append(input, captcha, btn);
|
|
14549
14465
|
return result;
|
|
14550
14466
|
};
|
|
14551
14467
|
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14468
|
+
const magicLinkModal = (onUserLogin, onReturn, backgroundImage, currentPage, clientBody, loginTypes) => {
|
|
14469
|
+
const result = document.createElement('magic-link-modal');
|
|
14470
|
+
const subtitle = document.createElement('magic-link-request-subtitle');
|
|
14555
14471
|
subtitle.style.fontSize = '14px';
|
|
14556
14472
|
subtitle.textContent = getTranslation('magic-link-request-subtitle');
|
|
14557
|
-
|
|
14558
|
-
body.append(subtitle, magicEmailField(onUserLogin, onReturn, backgroundImage, currentPage, clientBody,
|
|
14559
|
-
|
|
14473
|
+
const body = document.createElement('magic-link-request-body');
|
|
14474
|
+
body.append(subtitle, magicEmailField(onUserLogin, onReturn, backgroundImage, currentPage, clientBody, () => result.remove(), loginTypes));
|
|
14475
|
+
const modal = juxModal(getTranslation('magic-link-request-title'), [], '', false, false, body, '', '', () => result.remove());
|
|
14560
14476
|
modal.setAttribute('data-cy', 'magic-link-modal');
|
|
14561
14477
|
result.appendChild(modal);
|
|
14562
|
-
|
|
14478
|
+
const wrapper = modal.querySelector('modal-wrapper');
|
|
14563
14479
|
wrapper.style.maxWidth = '360px';
|
|
14564
14480
|
wrapper.style.width = '100%';
|
|
14565
14481
|
return result;
|
|
14566
14482
|
};
|
|
14567
14483
|
|
|
14568
|
-
|
|
14484
|
+
const applyContainerStyles = (container) => {
|
|
14569
14485
|
container.style.backgroundColor = '#ffffffdd';
|
|
14570
14486
|
container.style.borderRadius = '16px';
|
|
14571
14487
|
container.style.inset = '50% 50% 50% 0';
|
|
@@ -14581,69 +14497,67 @@ var juxWeb = (function (exports) {
|
|
|
14581
14497
|
container.style.margin = '0 auto';
|
|
14582
14498
|
container.style.paddingTop = '0';
|
|
14583
14499
|
};
|
|
14584
|
-
|
|
14500
|
+
const applyPageStyles = (page) => {
|
|
14585
14501
|
page.style.backgroundPosition = '50%';
|
|
14586
14502
|
page.style.backgroundSize = 'cover';
|
|
14587
14503
|
page.style.display = 'block';
|
|
14588
14504
|
page.style.height = '100%';
|
|
14589
14505
|
};
|
|
14590
|
-
|
|
14591
|
-
|
|
14506
|
+
const onEmailLoginRequest = (clientApp, loginPage, onUserLogin, backgroundImage, loginTypes) => {
|
|
14507
|
+
const onReturn = () => clientApp.appendChild(loginPage);
|
|
14592
14508
|
loginPage.appendChild(magicLinkModal(onUserLogin, onReturn, backgroundImage, loginPage, clientApp, loginTypes));
|
|
14593
14509
|
};
|
|
14594
|
-
|
|
14510
|
+
const appendLoginTypes = (loginPage, section, clientApp, onUserLogin, loginTypes, backgroundImg) => {
|
|
14595
14511
|
if (loginTypes.includes('Google')) {
|
|
14596
|
-
section.appendChild(loginButton('Google',
|
|
14512
|
+
section.appendChild(loginButton('Google', () => onGoogleSignIn(onUserLogin)));
|
|
14597
14513
|
}
|
|
14598
14514
|
if (loginTypes.includes('Microsoft')) {
|
|
14599
|
-
section.appendChild(loginButton('Microsoft',
|
|
14515
|
+
section.appendChild(loginButton('Microsoft', () => onMicrosoftSignIn(onUserLogin)));
|
|
14600
14516
|
}
|
|
14601
14517
|
if (loginTypes.includes('Linkedin')) {
|
|
14602
|
-
section.appendChild(loginButton('LinkedIn',
|
|
14518
|
+
section.appendChild(loginButton('LinkedIn', () => console.log('login with Linkedin')));
|
|
14603
14519
|
}
|
|
14604
14520
|
if (loginTypes.includes('Email')) {
|
|
14605
|
-
section.appendChild(loginButton('Email',
|
|
14521
|
+
section.appendChild(loginButton('Email', () => onEmailLoginRequest(clientApp, loginPage, onUserLogin, backgroundImg, loginTypes)));
|
|
14606
14522
|
}
|
|
14607
14523
|
};
|
|
14608
|
-
|
|
14609
|
-
|
|
14524
|
+
const loginPage = (clientApp, backgroundImg, onUserLogin, loginTypes) => {
|
|
14525
|
+
const result = document.createElement('login-page');
|
|
14610
14526
|
applyPageStyles(result);
|
|
14611
|
-
|
|
14527
|
+
const section = document.createElement('section');
|
|
14612
14528
|
applyContainerStyles(section);
|
|
14613
|
-
|
|
14529
|
+
const salutation = document.createElement('sign-in-salutation');
|
|
14614
14530
|
salutation.textContent = getTranslation('sign-in-salutation');
|
|
14615
|
-
|
|
14531
|
+
const explanation = document.createElement('sign-in-explanation');
|
|
14616
14532
|
explanation.textContent = getTranslation('sign-in-explanation');
|
|
14617
|
-
|
|
14533
|
+
const msg = document.createElement('sign-in-msg');
|
|
14618
14534
|
msg.textContent = getTranslation('sign-in-msg-general');
|
|
14619
|
-
result.style.backgroundImage =
|
|
14535
|
+
result.style.backgroundImage = `url(${backgroundImg})`;
|
|
14620
14536
|
section.append(salutation, explanation, msg);
|
|
14621
14537
|
appendLoginTypes(result, section, clientApp, onUserLogin, loginTypes, backgroundImg);
|
|
14622
14538
|
result.appendChild(section);
|
|
14623
14539
|
return result;
|
|
14624
14540
|
};
|
|
14625
14541
|
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
|
|
14542
|
+
class JuxEvent extends Event {
|
|
14543
|
+
constructor(method, endpoint, onResult, params, onError) {
|
|
14544
|
+
super('jux-event', { bubbles: true, cancelable: true, composed: true });
|
|
14545
|
+
this.method = method;
|
|
14546
|
+
this.endpoint = endpoint;
|
|
14629
14547
|
this.onResult = onResult;
|
|
14548
|
+
this.params = params;
|
|
14630
14549
|
this.onError = onError;
|
|
14631
14550
|
}
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
|
|
14637
|
-
|
|
14638
|
-
return _super.call(this, endpoint, payload) || this;
|
|
14639
|
-
}
|
|
14640
|
-
return Query;
|
|
14641
|
-
}(CustomEvent));
|
|
14642
|
-
var query = function (element, endpoint, onResult, params, onError) {
|
|
14643
|
-
element.dispatchEvent(new Query(endpoint, onResult, params, onError));
|
|
14551
|
+
}
|
|
14552
|
+
const query = (element, endpoint, onResult, params, onError) => {
|
|
14553
|
+
element.dispatchEvent(new JuxEvent('GET', endpoint, onResult, params, onError));
|
|
14554
|
+
};
|
|
14555
|
+
const command = (element, endpoint, onResult, params, onError) => {
|
|
14556
|
+
element.dispatchEvent(new JuxEvent('POST', endpoint, onResult, params, onError));
|
|
14644
14557
|
};
|
|
14645
14558
|
|
|
14646
14559
|
exports.chosenLanguage = chosenLanguage;
|
|
14560
|
+
exports.command = command;
|
|
14647
14561
|
exports.getTranslation = getTranslation;
|
|
14648
14562
|
exports.handleMagicLinkRequest = handleMagicLinkRequest;
|
|
14649
14563
|
exports.initLanguage = initLanguage;
|