@crystaldesign/diva-core 25.10.0-beta.18 → 25.10.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/{ModalsWrapper-7e45690b.js → ModalsWrapper-6c5c347e.js} +2 -1
- package/build/esm/{index-f11c4f4b.js → index-2124445c.js} +2 -1
- package/build/esm/{index-24b8ddcb.js → index-7027cf0e.js} +332 -330
- package/build/esm/index.js +2 -1
- package/build/types/core/src/handler/AuthorizationHandler/index.d.ts +6 -2
- package/build/types/core/src/handler/AuthorizationHandler/index.d.ts.map +1 -1
- package/build/types/core/src/store/AuthorizationStore.d.ts.map +1 -1
- package/build/types/core/src/store/BrowserStateStore.d.ts +2 -13
- package/build/types/core/src/store/BrowserStateStore.d.ts.map +1 -1
- package/build/types/core/src/store/ConfigurationStore.d.ts +1 -8
- package/build/types/core/src/store/ConfigurationStore.d.ts.map +1 -1
- package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/core/src/store/RootStore.d.ts +21 -6
- package/build/types/core/src/store/RootStore.d.ts.map +1 -1
- package/build/types/core/src/types.d.ts +14 -10
- package/build/types/core/src/types.d.ts.map +1 -1
- package/build/types/core/src/utils/i18n.d.ts +2 -4
- package/build/types/core/src/utils/i18n.d.ts.map +1 -1
- package/build/umd/diva-core.umd.min.js +6 -6
- package/build/umd/report.html +1 -1
- package/package.json +11 -10
|
@@ -19,6 +19,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
19
19
|
import MobileDetect from 'mobile-detect';
|
|
20
20
|
import platform from 'platform';
|
|
21
21
|
import i18n from 'i18next';
|
|
22
|
+
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
22
23
|
import HttpApi from 'i18next-http-backend';
|
|
23
24
|
import * as CoreStyles from '@mui/material/styles';
|
|
24
25
|
import { StyledEngineProvider, ThemeProvider, createTheme } from '@mui/material/styles';
|
|
@@ -46,7 +47,7 @@ import { actions } from '@storybook/addon-actions';
|
|
|
46
47
|
import * as Styles from '@mui/styles';
|
|
47
48
|
|
|
48
49
|
(function() {
|
|
49
|
-
const env = {"STAGE":"production","VERSION":"25.10.0-beta.
|
|
50
|
+
const env = {"STAGE":"production","VERSION":"25.10.0-beta.19"};
|
|
50
51
|
try {
|
|
51
52
|
if (process) {
|
|
52
53
|
process.env = Object.assign({}, process.env);
|
|
@@ -1595,75 +1596,71 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1595
1596
|
}]);
|
|
1596
1597
|
}();
|
|
1597
1598
|
|
|
1598
|
-
var instance = i18n.createInstance();
|
|
1599
|
-
function init(
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
}
|
|
1633
|
-
};
|
|
1634
|
-
instance.use(HttpApi).init(initOptions, function (error) {
|
|
1635
|
-
if (error) {
|
|
1636
|
-
reject(error);
|
|
1637
|
-
} else {
|
|
1638
|
-
resolve(lang);
|
|
1639
|
-
}
|
|
1640
|
-
});
|
|
1641
|
-
}));
|
|
1642
|
-
case 2:
|
|
1643
|
-
case "end":
|
|
1644
|
-
return _context.stop();
|
|
1599
|
+
var instance = i18n.createInstance().use(HttpApi).use(LanguageDetector);
|
|
1600
|
+
function init(_ref) {
|
|
1601
|
+
var apiConfig = _ref.apiConfig;
|
|
1602
|
+
if (instance.isInitialized) {
|
|
1603
|
+
return Promise.resolve();
|
|
1604
|
+
} else if (instance.isInitializing) {
|
|
1605
|
+
return new Promise(function (resolve, reject) {
|
|
1606
|
+
instance.on('loaded', function () {
|
|
1607
|
+
resolve();
|
|
1608
|
+
});
|
|
1609
|
+
instance.on('failedLoading', function (error) {
|
|
1610
|
+
reject(error);
|
|
1611
|
+
});
|
|
1612
|
+
});
|
|
1613
|
+
}
|
|
1614
|
+
return new Promise(function (resolve, reject) {
|
|
1615
|
+
var loadPath = "".concat(apiConfig.adminService, "/locales?lng={{lng}}&ns={{ns}}");
|
|
1616
|
+
var initOptions = {
|
|
1617
|
+
debug: false,
|
|
1618
|
+
defaultNS: 'default',
|
|
1619
|
+
fallbackNS: 'default',
|
|
1620
|
+
ns: ['default'],
|
|
1621
|
+
fallbackLng: false,
|
|
1622
|
+
supportedLngs: ['de', 'en', 'it', 'fr'],
|
|
1623
|
+
interpolation: {
|
|
1624
|
+
escapeValue: false // not needed for react as it escapes by default
|
|
1625
|
+
},
|
|
1626
|
+
detection: {
|
|
1627
|
+
order: ['querystring', 'localStorage', 'navigator'],
|
|
1628
|
+
lookupQuerystring: 'lang'
|
|
1629
|
+
},
|
|
1630
|
+
backend: {
|
|
1631
|
+
loadPath: loadPath,
|
|
1632
|
+
crossDomain: true
|
|
1645
1633
|
}
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1634
|
+
};
|
|
1635
|
+
instance.init(initOptions, function (error) {
|
|
1636
|
+
if (error) {
|
|
1637
|
+
reject(error);
|
|
1638
|
+
}
|
|
1639
|
+
resolve();
|
|
1640
|
+
});
|
|
1641
|
+
});
|
|
1649
1642
|
}
|
|
1650
|
-
function changeNamespace(
|
|
1643
|
+
function changeNamespace(_x) {
|
|
1651
1644
|
return _changeNamespace.apply(this, arguments);
|
|
1652
1645
|
}
|
|
1653
1646
|
function _changeNamespace() {
|
|
1654
|
-
_changeNamespace = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1655
|
-
return _regeneratorRuntime.wrap(function
|
|
1656
|
-
while (1) switch (
|
|
1647
|
+
_changeNamespace = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(namespace) {
|
|
1648
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1649
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1657
1650
|
case 0:
|
|
1658
|
-
instance.
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1651
|
+
if (instance.hasLoadedNamespace(namespace)) {
|
|
1652
|
+
_context.next = 3;
|
|
1653
|
+
break;
|
|
1654
|
+
}
|
|
1655
|
+
_context.next = 3;
|
|
1656
|
+
return instance.loadNamespaces([namespace]);
|
|
1657
|
+
case 3:
|
|
1658
|
+
instance.setDefaultNamespace(namespace);
|
|
1662
1659
|
case 4:
|
|
1663
1660
|
case "end":
|
|
1664
|
-
return
|
|
1661
|
+
return _context.stop();
|
|
1665
1662
|
}
|
|
1666
|
-
},
|
|
1663
|
+
}, _callee);
|
|
1667
1664
|
}));
|
|
1668
1665
|
return _changeNamespace.apply(this, arguments);
|
|
1669
1666
|
}
|
|
@@ -2015,14 +2012,14 @@ var ContentWrapper = observer(function (_ref2) {
|
|
|
2015
2012
|
overflow: 'hidden'
|
|
2016
2013
|
},
|
|
2017
2014
|
className: (isPortrait ? ' portrait' : '') + (isMobile ? ' mobile' : '') + (isMobile && !isPortrait ? ' landscape' : '') + (context.dataStore.isMobile ? ' actual-mobile' : ''),
|
|
2018
|
-
children: /*#__PURE__*/jsx(
|
|
2019
|
-
|
|
2020
|
-
children: /*#__PURE__*/jsx(
|
|
2021
|
-
|
|
2022
|
-
children: /*#__PURE__*/jsx(
|
|
2023
|
-
|
|
2024
|
-
children: /*#__PURE__*/jsx(
|
|
2025
|
-
|
|
2015
|
+
children: /*#__PURE__*/jsx(Suspense, {
|
|
2016
|
+
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
2017
|
+
children: /*#__PURE__*/jsx(I18nextProvider, {
|
|
2018
|
+
i18n: instance,
|
|
2019
|
+
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
2020
|
+
root: context,
|
|
2021
|
+
children: /*#__PURE__*/jsx(ThemeProvider, {
|
|
2022
|
+
theme: context.contentStore.materialUiTheme,
|
|
2026
2023
|
children: children
|
|
2027
2024
|
})
|
|
2028
2025
|
})
|
|
@@ -2287,7 +2284,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2287
2284
|
Object.entries(parameters || {}).forEach(function (param) {
|
|
2288
2285
|
return param[1] ? params.append(param[0], param[1]) : false;
|
|
2289
2286
|
});
|
|
2290
|
-
params.append('lang',
|
|
2287
|
+
params.append('lang', instance.language);
|
|
2291
2288
|
params.append('organizationId', this.root.dataStore.organizationId);
|
|
2292
2289
|
return url.href;
|
|
2293
2290
|
}
|
|
@@ -2387,7 +2384,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2387
2384
|
callback: function callback(accept) {
|
|
2388
2385
|
if (accept) {
|
|
2389
2386
|
var _config5;
|
|
2390
|
-
var url = "".concat(window.location.origin).concat((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.route, "?lang=").concat(
|
|
2387
|
+
var url = "".concat(window.location.origin).concat((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.route, "?lang=").concat(instance.language, "&organizationId=").concat(parent._id);
|
|
2391
2388
|
_this2.openInNewTab({
|
|
2392
2389
|
url: url,
|
|
2393
2390
|
openInNewTab: true
|
|
@@ -3235,7 +3232,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3235
3232
|
case 6:
|
|
3236
3233
|
if (showDialog !== false) _this9.root.loadingAndErrorStore.toggleLoading('sendingEmail');
|
|
3237
3234
|
_context5.prev = 7;
|
|
3238
|
-
content.language = (_content$language$toU = (_content$language = content.language) === null || _content$language === void 0 ? void 0 : _content$language.toUpperCase()) !== null && _content$language$toU !== void 0 ? _content$language$toU :
|
|
3235
|
+
content.language = (_content$language$toU = (_content$language = content.language) === null || _content$language === void 0 ? void 0 : _content$language.toUpperCase()) !== null && _content$language$toU !== void 0 ? _content$language$toU : instance.language.toUpperCase();
|
|
3239
3236
|
_context5.next = 11;
|
|
3240
3237
|
return _this9.root.apiHandler.sendEmail({
|
|
3241
3238
|
content: content,
|
|
@@ -3514,7 +3511,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3514
3511
|
key: "materialUiTheme",
|
|
3515
3512
|
get: function get() {
|
|
3516
3513
|
var theme = this.root.configurationStore.theme;
|
|
3517
|
-
return createTheme(theme, this.getLang(
|
|
3514
|
+
return createTheme(theme, this.getLang(instance.language));
|
|
3518
3515
|
}
|
|
3519
3516
|
|
|
3520
3517
|
/**
|
|
@@ -3649,9 +3646,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3649
3646
|
Object.entries(parameters || {}).forEach(function (param) {
|
|
3650
3647
|
return param[1] ? params.append(param[0], param[1]) : false;
|
|
3651
3648
|
});
|
|
3652
|
-
|
|
3653
|
-
params.append('lang', this.root.language);
|
|
3654
|
-
}
|
|
3649
|
+
params.append('lang', instance.language);
|
|
3655
3650
|
if ((_this$root$dataStore$8 = this.root.dataStore.organization) !== null && _this$root$dataStore$8 !== void 0 && _this$root$dataStore$8._id) {
|
|
3656
3651
|
params.append('organizationId', this.root.dataStore.organization._id);
|
|
3657
3652
|
}
|
|
@@ -3932,7 +3927,6 @@ var _default = /*#__PURE__*/function () {
|
|
|
3932
3927
|
var LOG$7 = getLogger('Framework', 'BrowserStateStore');
|
|
3933
3928
|
var BANNER_STATE_LOCALSTORAGE_KEY = 'diva-banner-state';
|
|
3934
3929
|
var NTOKEN_LOCALSTORAGE_KEY = 'diva-ntoken';
|
|
3935
|
-
var LANGUAGE_LOCALSTORAGE_KEY = 'diva-language';
|
|
3936
3930
|
var ORGANIZATION_LOCALSTORAGE_KEY = 'diva-organization';
|
|
3937
3931
|
var LOGIN_METHOD_LOCALSTORAGE_KEY = 'diva-login-method';
|
|
3938
3932
|
var BrowserStateStore = /*#__PURE__*/function () {
|
|
@@ -3967,7 +3961,7 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3967
3961
|
value: (function () {
|
|
3968
3962
|
var _loadUrlState = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
3969
3963
|
var _route, _searchParams$get;
|
|
3970
|
-
var searchParams, currentUrl, state, route;
|
|
3964
|
+
var searchParams, currentUrl, state, route, authdataString, _state$authdata;
|
|
3971
3965
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
3972
3966
|
while (1) switch (_context.prev = _context.next) {
|
|
3973
3967
|
case 0:
|
|
@@ -3988,17 +3982,14 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3988
3982
|
};
|
|
3989
3983
|
state.organization = (_searchParams$get = searchParams.get('organizationId')) !== null && _searchParams$get !== void 0 ? _searchParams$get : undefined;
|
|
3990
3984
|
searchParams["delete"]('organizationId');
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
state.
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
currentUrl.searchParams["delete"]('channelId');
|
|
3985
|
+
authdataString = searchParams.get('authdata') || undefined;
|
|
3986
|
+
if (authdataString) {
|
|
3987
|
+
state.authdata = JSON.parse(atob(authdataString));
|
|
3988
|
+
if ((_state$authdata = state.authdata) !== null && _state$authdata !== void 0 && _state$authdata.organizationId) {
|
|
3989
|
+
state.organization = state.authdata.organizationId;
|
|
3990
|
+
}
|
|
3998
3991
|
}
|
|
3999
|
-
state.language = searchParams.get('lang') || undefined;
|
|
4000
3992
|
searchParams["delete"]('lang');
|
|
4001
|
-
state.authdata = searchParams.get('authdata') || undefined;
|
|
4002
3993
|
searchParams["delete"]('authdata');
|
|
4003
3994
|
searchParams.forEach(function (value, key) {
|
|
4004
3995
|
state.component.parameters[key] = value;
|
|
@@ -4007,7 +3998,7 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
4007
3998
|
currentUrl.searchParams["delete"]('authdata');
|
|
4008
3999
|
history.replaceState(null, '', currentUrl.href);
|
|
4009
4000
|
return _context.abrupt("return", state);
|
|
4010
|
-
case
|
|
4001
|
+
case 18:
|
|
4011
4002
|
case "end":
|
|
4012
4003
|
return _context.stop();
|
|
4013
4004
|
}
|
|
@@ -4178,30 +4169,6 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
4178
4169
|
}
|
|
4179
4170
|
}
|
|
4180
4171
|
|
|
4181
|
-
/**
|
|
4182
|
-
* Get the currently stored language
|
|
4183
|
-
*/
|
|
4184
|
-
}, {
|
|
4185
|
-
key: "getStoredLanguage",
|
|
4186
|
-
value: function getStoredLanguage() {
|
|
4187
|
-
return localStorage.getItem(LANGUAGE_LOCALSTORAGE_KEY) || undefined;
|
|
4188
|
-
}
|
|
4189
|
-
|
|
4190
|
-
/**
|
|
4191
|
-
* Updates or removes language in storage
|
|
4192
|
-
*
|
|
4193
|
-
* @param language the new language or undefined to remove it
|
|
4194
|
-
*/
|
|
4195
|
-
}, {
|
|
4196
|
-
key: "setStoredLanguage",
|
|
4197
|
-
value: function setStoredLanguage(language) {
|
|
4198
|
-
if (language) {
|
|
4199
|
-
localStorage.setItem(LANGUAGE_LOCALSTORAGE_KEY, language);
|
|
4200
|
-
} else {
|
|
4201
|
-
localStorage.removeItem(LANGUAGE_LOCALSTORAGE_KEY);
|
|
4202
|
-
}
|
|
4203
|
-
}
|
|
4204
|
-
|
|
4205
4172
|
/**
|
|
4206
4173
|
* Applies the current state represented by the url to the application
|
|
4207
4174
|
*/
|
|
@@ -4218,16 +4185,13 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
4218
4185
|
return this.loadUrlState();
|
|
4219
4186
|
case 3:
|
|
4220
4187
|
state = _context2.sent;
|
|
4221
|
-
if (state.language) {
|
|
4222
|
-
this.root.changeLanguage(state.language);
|
|
4223
|
-
}
|
|
4224
4188
|
if (state.organization) {
|
|
4225
4189
|
this.root.dataStore.updateOrganization(state.organization);
|
|
4226
4190
|
}
|
|
4227
4191
|
if (state.component) {
|
|
4228
4192
|
this.root.contentStore.openComponent(state.component);
|
|
4229
4193
|
}
|
|
4230
|
-
case
|
|
4194
|
+
case 6:
|
|
4231
4195
|
case "end":
|
|
4232
4196
|
return _context2.stop();
|
|
4233
4197
|
}
|
|
@@ -4246,7 +4210,7 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
4246
4210
|
key: "enableUrlSyncronization",
|
|
4247
4211
|
value: function enableUrlSyncronization() {
|
|
4248
4212
|
var _this2 = this;
|
|
4249
|
-
|
|
4213
|
+
var updateFunction = function updateFunction() {
|
|
4250
4214
|
var _this2$root$authoriza;
|
|
4251
4215
|
if (!_this2.isUrlSyncEnabled) {
|
|
4252
4216
|
return;
|
|
@@ -4263,19 +4227,23 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
4263
4227
|
}
|
|
4264
4228
|
var componentState = _this2.root.contentStore.getState(componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.type);
|
|
4265
4229
|
url = new URL("".concat(location.origin).concat((_componentState$path = componentState.path) !== null && _componentState$path !== void 0 ? _componentState$path : componentConfig.route));
|
|
4266
|
-
url.searchParams.
|
|
4267
|
-
url.searchParams.
|
|
4230
|
+
url.searchParams.set('lang', instance.language);
|
|
4231
|
+
url.searchParams.set('organizationId', _this2.root.dataStore.organizationId);
|
|
4268
4232
|
Object.entries(componentState.parameters || {}).forEach(function (_ref) {
|
|
4269
4233
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
4270
4234
|
key = _ref2[0],
|
|
4271
4235
|
value = _ref2[1];
|
|
4272
|
-
return url.searchParams.
|
|
4236
|
+
return url.searchParams.set(key, value);
|
|
4273
4237
|
});
|
|
4274
4238
|
}
|
|
4275
4239
|
if (_this2._url != url.href) {
|
|
4276
4240
|
_this2.setUrl(url.href);
|
|
4277
4241
|
history.pushState(null, '', url.href);
|
|
4278
4242
|
}
|
|
4243
|
+
};
|
|
4244
|
+
instance.on('languageChanged', updateFunction);
|
|
4245
|
+
autorun(function () {
|
|
4246
|
+
return updateFunction();
|
|
4279
4247
|
}, {
|
|
4280
4248
|
name: 'onUrlChange'
|
|
4281
4249
|
});
|
|
@@ -4810,7 +4778,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4810
4778
|
var parameters = (_componentConfig = componentConfig) !== null && _componentConfig !== void 0 && _componentConfig.type ? (_this$root$contentSto = this.root.contentStore.getState((_componentConfig2 = componentConfig) === null || _componentConfig2 === void 0 ? void 0 : _componentConfig2.type)) === null || _this$root$contentSto === void 0 ? void 0 : _this$root$contentSto.parameters : undefined;
|
|
4811
4779
|
if (!parameters && (_componentConfig3 = componentConfig) !== null && _componentConfig3 !== void 0 && _componentConfig3.parameters) parameters = componentConfig.parameters;
|
|
4812
4780
|
var redirectUrl = new URL("".concat(location.origin).concat((_componentConfig4 = componentConfig) !== null && _componentConfig4 !== void 0 && _componentConfig4.route ? componentConfig.route : ''));
|
|
4813
|
-
redirectUrl.searchParams.append('lang',
|
|
4781
|
+
redirectUrl.searchParams.append('lang', instance.language);
|
|
4814
4782
|
redirectUrl.searchParams.append('organizationId', currentOrganization !== null && currentOrganization !== void 0 ? currentOrganization : this.root.dataStore.organizationId);
|
|
4815
4783
|
if (provider) redirectUrl.searchParams.append('provider', provider);
|
|
4816
4784
|
Object.entries(parameters || {}).forEach(function (_ref) {
|
|
@@ -8382,7 +8350,6 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8382
8350
|
_defineProperty(this, "_onEvent", void 0);
|
|
8383
8351
|
_defineProperty(this, "events", []);
|
|
8384
8352
|
_defineProperty(this, "_initializing", true);
|
|
8385
|
-
_defineProperty(this, "_language", 'de');
|
|
8386
8353
|
_defineProperty(this, "_loginMode", (_ref2 = localStorage.getItem(LOGINMODE_LOCALSTORAGE_KEY)) !== null && _ref2 !== void 0 ? _ref2 : 'offline');
|
|
8387
8354
|
_defineProperty(this, "_apiHandler", void 0);
|
|
8388
8355
|
_defineProperty(this, "_productHandler", void 0);
|
|
@@ -8397,9 +8364,7 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8397
8364
|
_defineProperty(this, "_initalComponent", void 0);
|
|
8398
8365
|
makeObservable(this, {
|
|
8399
8366
|
_initializing: observable,
|
|
8400
|
-
_language: observable,
|
|
8401
8367
|
_loginMode: observable,
|
|
8402
|
-
language: computed,
|
|
8403
8368
|
changeLanguage: action,
|
|
8404
8369
|
changeLoginMode: action,
|
|
8405
8370
|
initializing: computed
|
|
@@ -8424,18 +8389,19 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8424
8389
|
this._supportHandler = new SupportHandler(this);
|
|
8425
8390
|
this._authorizationHandler = new AuthorizationHandler(this);
|
|
8426
8391
|
this._clientArticleHandler = new ClientArticleHandler(this);
|
|
8427
|
-
|
|
8428
|
-
//every time the organizationId changes call initCache,
|
|
8429
|
-
//no idea what it does
|
|
8430
8392
|
DivaUtils.loginMode = this._loginMode;
|
|
8431
8393
|
reaction(function () {
|
|
8432
|
-
var _this$configurationSt;
|
|
8394
|
+
var _this$configurationSt, _this$configurationSt2;
|
|
8433
8395
|
return {
|
|
8434
|
-
namespace: (_this$configurationSt = _this.configurationStore.locales) === null || _this$configurationSt === void 0 ? void 0 : _this$configurationSt.namespace
|
|
8396
|
+
namespace: (_this$configurationSt = _this.configurationStore.locales) === null || _this$configurationSt === void 0 ? void 0 : _this$configurationSt.namespace,
|
|
8397
|
+
languages: (_this$configurationSt2 = _this.configurationStore.locales) === null || _this$configurationSt2 === void 0 ? void 0 : _this$configurationSt2.available
|
|
8435
8398
|
};
|
|
8436
8399
|
}, function (value, prev) {
|
|
8437
|
-
if (!instance.isInitialized || value.namespace == prev.namespace) return;
|
|
8400
|
+
if (!instance.isInitialized || value.namespace == prev.namespace && value.languages == prev.languages) return;
|
|
8438
8401
|
if (value.namespace) changeNamespace(value.namespace);else changeNamespace('default');
|
|
8402
|
+
if (value.languages && !value.languages.includes(instance.language)) {
|
|
8403
|
+
instance.changeLanguage(value.languages[0]);
|
|
8404
|
+
}
|
|
8439
8405
|
});
|
|
8440
8406
|
autorun(function () {
|
|
8441
8407
|
DivaUtils.initPriceFormat(_this.configurationStore.priceFormat);
|
|
@@ -8468,10 +8434,8 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8468
8434
|
}));
|
|
8469
8435
|
} else {
|
|
8470
8436
|
runInAction(function () {
|
|
8471
|
-
_this2.
|
|
8472
|
-
|
|
8473
|
-
if (['de', 'en', 'fr', 'it'].includes(_this2._language) && _this2.authorizationStore.loginState !== 'anon') {
|
|
8474
|
-
_this2._authorizationHandler.updateUserLanguage(_this2._language);
|
|
8437
|
+
if (['de', 'en', 'fr', 'it'].includes(lang) && _this2.authorizationStore.loginState !== 'anon') {
|
|
8438
|
+
_this2._authorizationHandler.updateUserLanguage(lang);
|
|
8475
8439
|
}
|
|
8476
8440
|
});
|
|
8477
8441
|
}
|
|
@@ -8479,15 +8443,6 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8479
8443
|
});
|
|
8480
8444
|
}
|
|
8481
8445
|
|
|
8482
|
-
/**
|
|
8483
|
-
* The current language of the application
|
|
8484
|
-
*/
|
|
8485
|
-
}, {
|
|
8486
|
-
key: "language",
|
|
8487
|
-
get: function get() {
|
|
8488
|
-
return this._language;
|
|
8489
|
-
}
|
|
8490
|
-
|
|
8491
8446
|
/**
|
|
8492
8447
|
* Changes the current userMode
|
|
8493
8448
|
* @param mode the new mode
|
|
@@ -8528,8 +8483,8 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8528
8483
|
}, {
|
|
8529
8484
|
key: "languages",
|
|
8530
8485
|
get: function get() {
|
|
8531
|
-
var _this$
|
|
8532
|
-
return (_this$
|
|
8486
|
+
var _this$configurationSt3, _this$configurationSt4;
|
|
8487
|
+
return (_this$configurationSt3 = (_this$configurationSt4 = this.configurationStore.locales) === null || _this$configurationSt4 === void 0 ? void 0 : _this$configurationSt4.available) !== null && _this$configurationSt3 !== void 0 ? _this$configurationSt3 : ['de'];
|
|
8533
8488
|
}
|
|
8534
8489
|
|
|
8535
8490
|
/**
|
|
@@ -8718,7 +8673,7 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8718
8673
|
value: (function () {
|
|
8719
8674
|
var _initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(telemetry, identifier, organizationId, domain, language, component, analyticsProps) {
|
|
8720
8675
|
var _this4 = this;
|
|
8721
|
-
var _this$_initalComponen, _this$_initalComponen2, _configuration$pwa, _this$contentStore$cu, urlState,
|
|
8676
|
+
var _this$_initalComponen, _this$_initalComponen2, _configuration$pwa, _this$contentStore$cu, urlState, storedOrganization, initialOrganization, localizationPromise, configuration, header, manifest, verifyEmailToken, authObject, _authObject$code, _urlState$component, _authObject$code2, _authObject$code3, _authObject$code4, _authObject$additiona, _authObject$additiona2, _this$configurationSt5, email, _this$contentStore$cu2;
|
|
8722
8677
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
8723
8678
|
while (1) switch (_context.prev = _context.next) {
|
|
8724
8679
|
case 0:
|
|
@@ -8746,17 +8701,19 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8746
8701
|
return this.browserStateStore.loadUrlState();
|
|
8747
8702
|
case 7:
|
|
8748
8703
|
urlState = _context.sent;
|
|
8749
|
-
storedLanguage = this.browserStateStore.getStoredLanguage();
|
|
8750
8704
|
storedOrganization = this.browserStateStore.getStoredOrganization(); //the inital state is derived in the fallowing order: component params > url > browserstore > configuration
|
|
8751
8705
|
initialOrganization = organizationId || urlState.organization || storedOrganization;
|
|
8752
|
-
|
|
8706
|
+
if (initialOrganization) {
|
|
8707
|
+
this.initializeAuthorization(initialOrganization);
|
|
8708
|
+
}
|
|
8753
8709
|
LOG$4.startTransaction({
|
|
8754
8710
|
event: 'onLoadConfig',
|
|
8755
8711
|
message: 'loading Config',
|
|
8756
8712
|
eventId: 'LOAD_CONFIG'
|
|
8757
8713
|
});
|
|
8758
|
-
|
|
8759
|
-
|
|
8714
|
+
localizationPromise = init({
|
|
8715
|
+
apiConfig: this.configurationStore.apiConfig
|
|
8716
|
+
}); //load core configuration based on initaly available information
|
|
8760
8717
|
_context.next = 15;
|
|
8761
8718
|
return this.configurationStore.fetchConfiguration({
|
|
8762
8719
|
identifier: identifier,
|
|
@@ -8778,53 +8735,7 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8778
8735
|
message: 'load server data',
|
|
8779
8736
|
eventId: 'LOAD_SERVER_DATA'
|
|
8780
8737
|
});
|
|
8781
|
-
|
|
8782
|
-
//async load locales data
|
|
8783
|
-
initLocalesResult = init(_objectSpread$7(_objectSpread$7({}, this.configurationStore.locales), {}, {
|
|
8784
|
-
defaultLng: initialLanguage,
|
|
8785
|
-
apiConfig: this.configurationStore.apiConfig
|
|
8786
|
-
}));
|
|
8787
|
-
telemetrySettings = this.configurationStore.telemetrySettings;
|
|
8788
|
-
enableApm = telemetry && (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) != false;
|
|
8789
|
-
disableDivaAnalyticsLocalStorage = localStorage.getItem('disableDivaAnalytics');
|
|
8790
|
-
disableDivaAnalytics = disableDivaAnalyticsLocalStorage !== undefined && disableDivaAnalyticsLocalStorage !== null && disableDivaAnalyticsLocalStorage === 'true';
|
|
8791
|
-
enableBusinessMetrics = telemetrySettings && (telemetrySettings.businessEvents == undefined || (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.businessEvents)) && telemetry && !disableDivaAnalytics;
|
|
8792
|
-
if (telemetry && telemetrySettings !== null && telemetrySettings !== void 0 && telemetrySettings.cookieBotCbid) {
|
|
8793
|
-
initCookieBot(telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.cookieBotCbid, function (consent) {
|
|
8794
|
-
if (consent.statistics) {
|
|
8795
|
-
var _configuration$enviro;
|
|
8796
|
-
init$1(enableApm, (_configuration$enviro = configuration.environment) !== null && _configuration$enviro !== void 0 ? _configuration$enviro : 'PROD', configuration.applicationName, typeof (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) == 'string' ? telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm : undefined);
|
|
8797
|
-
}
|
|
8798
|
-
if (consent.necessary && enableBusinessMetrics) {
|
|
8799
|
-
var _configuration$enviro2;
|
|
8800
|
-
var myUserAgentInfo = getUserAgentInfo();
|
|
8801
|
-
DivaUtils.businessMetrics.init("production" != 'development', // true, - to local test on PETERPC
|
|
8802
|
-
(_configuration$enviro2 = configuration.environment) !== null && _configuration$enviro2 !== void 0 ? _configuration$enviro2 : 'PROD', window.DIVA_VERSION, _this4.apiConfig.analyticsService, _this4.jwt, telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.personalData, myUserAgentInfo.family, myUserAgentInfo.os, myUserAgentInfo.deviceName, myUserAgentInfo.browser, myUserAgentInfo.screenWidth, myUserAgentInfo.screenHeight, myUserAgentInfo.osVersion, configuration.applicationEnvironment, initialLanguage, analyticsProps);
|
|
8803
|
-
}
|
|
8804
|
-
}, function (reason) {
|
|
8805
|
-
var _configuration$enviro3;
|
|
8806
|
-
LOG$4.error(new DivaError('Cookiebot initialization failed', {
|
|
8807
|
-
code: 'CORE_0009',
|
|
8808
|
-
custom: {
|
|
8809
|
-
reason: reason
|
|
8810
|
-
}
|
|
8811
|
-
}));
|
|
8812
|
-
init$1(enableApm, (_configuration$enviro3 = configuration.environment) !== null && _configuration$enviro3 !== void 0 ? _configuration$enviro3 : 'PROD', configuration.applicationName, typeof (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) == 'string' ? telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm : undefined);
|
|
8813
|
-
if (enableBusinessMetrics) {
|
|
8814
|
-
var _configuration$enviro4;
|
|
8815
|
-
var myUserAgentInfo = getUserAgentInfo();
|
|
8816
|
-
DivaUtils.businessMetrics.init("production" != 'development', (_configuration$enviro4 = configuration.environment) !== null && _configuration$enviro4 !== void 0 ? _configuration$enviro4 : 'PROD', window.DIVA_VERSION, _this4.apiConfig.analyticsService, _this4.jwt, telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.personalData, myUserAgentInfo.family, myUserAgentInfo.os, myUserAgentInfo.deviceName, myUserAgentInfo.browser, myUserAgentInfo.screenWidth, myUserAgentInfo.screenHeight, myUserAgentInfo.osVersion, configuration.applicationEnvironment, initialLanguage, analyticsProps);
|
|
8817
|
-
}
|
|
8818
|
-
});
|
|
8819
|
-
} else {
|
|
8820
|
-
init$1(enableApm, (_configuration$enviro5 = configuration.environment) !== null && _configuration$enviro5 !== void 0 ? _configuration$enviro5 : 'PROD', configuration.applicationName, typeof (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) == 'string' ? telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm : undefined);
|
|
8821
|
-
if (enableBusinessMetrics) {
|
|
8822
|
-
myUserAgentInfo = getUserAgentInfo();
|
|
8823
|
-
DivaUtils.businessMetrics.init("production" != 'development', // true, - to local test on PETERPC
|
|
8824
|
-
(_configuration$enviro6 = configuration.environment) !== null && _configuration$enviro6 !== void 0 ? _configuration$enviro6 : 'PROD', window.DIVA_VERSION, this.apiConfig.analyticsService, this.jwt, telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.personalData, myUserAgentInfo.family, myUserAgentInfo.os, myUserAgentInfo.deviceName, myUserAgentInfo.browser, myUserAgentInfo.screenWidth, myUserAgentInfo.screenHeight, myUserAgentInfo.osVersion, configuration.applicationEnvironment, initialLanguage, analyticsProps);
|
|
8825
|
-
}
|
|
8826
|
-
}
|
|
8827
|
-
apmIsInitalized();
|
|
8738
|
+
this.initializeTelemetry(telemetry, configuration.environment, configuration.applicationEnvironment, configuration.applicationName, analyticsProps);
|
|
8828
8739
|
if (configuration.cssCustomFile) {
|
|
8829
8740
|
header = document.getElementsByTagName('HEAD')[0];
|
|
8830
8741
|
if (header) DivaUtils.loadCSS(configuration.cssCustomFile, header, undefined);
|
|
@@ -8844,26 +8755,19 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8844
8755
|
}
|
|
8845
8756
|
});
|
|
8846
8757
|
});
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
key: 'InitialWarningBanner',
|
|
8861
|
-
type: 'WARNING',
|
|
8862
|
-
title: this.t('modals.warning', 'Warnung'),
|
|
8863
|
-
text: warningText,
|
|
8864
|
-
useLocalStorage: true
|
|
8865
|
-
});
|
|
8866
|
-
}
|
|
8758
|
+
localizationPromise.then(function () {
|
|
8759
|
+
var warningText = _this4.t('init.deploymentwarntext', '');
|
|
8760
|
+
if (warningText.trim() !== '' && _this4.doShowInitWarnBanner) {
|
|
8761
|
+
var _this4$contentStore;
|
|
8762
|
+
(_this4$contentStore = _this4.contentStore) === null || _this4$contentStore === void 0 || _this4$contentStore.openBanner({
|
|
8763
|
+
key: 'InitialWarningBanner',
|
|
8764
|
+
type: 'WARNING',
|
|
8765
|
+
title: _this4.t('modals.warning', 'Warnung'),
|
|
8766
|
+
text: warningText,
|
|
8767
|
+
useLocalStorage: true
|
|
8768
|
+
});
|
|
8769
|
+
}
|
|
8770
|
+
});
|
|
8867
8771
|
LOG$4.successTransaction('LOAD_SERVER_DATA');
|
|
8868
8772
|
LOG$4.startTransaction({
|
|
8869
8773
|
event: 'onLoadUserData',
|
|
@@ -8872,148 +8776,110 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8872
8776
|
});
|
|
8873
8777
|
|
|
8874
8778
|
//load userdata
|
|
8875
|
-
_context.prev =
|
|
8779
|
+
_context.prev = 28;
|
|
8876
8780
|
if (!urlState.authdata) {
|
|
8877
|
-
_context.next =
|
|
8781
|
+
_context.next = 53;
|
|
8878
8782
|
break;
|
|
8879
8783
|
}
|
|
8880
|
-
authObject =
|
|
8784
|
+
authObject = urlState.authdata;
|
|
8881
8785
|
_context.t0 = authObject === null || authObject === void 0 ? void 0 : authObject.path;
|
|
8882
|
-
_context.next = _context.t0 === 'openIdCallback' ?
|
|
8786
|
+
_context.next = _context.t0 === 'openIdCallback' ? 34 : _context.t0 === 'resetPassword' ? 36 : _context.t0 === 'confirmEmail' ? 38 : _context.t0 === 'acceptInvitation' ? 40 : 50;
|
|
8883
8787
|
break;
|
|
8884
|
-
case
|
|
8788
|
+
case 34:
|
|
8885
8789
|
if (authObject.error) {
|
|
8886
|
-
LOG$4.errorTransaction('LOAD_USER_DATA', 'CORE_0006', authObject.error);
|
|
8790
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', (_authObject$code = authObject.code) !== null && _authObject$code !== void 0 ? _authObject$code : 'CORE_0006', authObject.error);
|
|
8887
8791
|
this.authorizationStore.showLogin(false, true);
|
|
8888
8792
|
} else {
|
|
8889
|
-
initialOrganization = authObject.organizationId;
|
|
8890
8793
|
if (urlState !== null && urlState !== void 0 && (_urlState$component = urlState.component) !== null && _urlState$component !== void 0 && (_urlState$component = _urlState$component.parameters) !== null && _urlState$component !== void 0 && _urlState$component.provider) {
|
|
8891
8794
|
this.browserStateStore.setStoredLoginMethod(urlState.component.parameters.provider);
|
|
8892
8795
|
}
|
|
8893
8796
|
this.browserStateStore.setStoredNToken(authObject.token, authObject.expiresBy);
|
|
8894
8797
|
}
|
|
8895
|
-
return _context.abrupt("break",
|
|
8896
|
-
case
|
|
8798
|
+
return _context.abrupt("break", 51);
|
|
8799
|
+
case 36:
|
|
8897
8800
|
if (authObject.error) {
|
|
8898
|
-
LOG$4.errorTransaction('LOAD_USER_DATA', authObject.code, authObject.error);
|
|
8801
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', (_authObject$code2 = authObject.code) !== null && _authObject$code2 !== void 0 ? _authObject$code2 : 'CORE_0006', authObject.error);
|
|
8899
8802
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8900
8803
|
} else {
|
|
8901
8804
|
this.authorizationStore.showChangePassword(authObject.token);
|
|
8902
8805
|
}
|
|
8903
|
-
return _context.abrupt("break",
|
|
8904
|
-
case
|
|
8806
|
+
return _context.abrupt("break", 51);
|
|
8807
|
+
case 38:
|
|
8905
8808
|
if (authObject.error) {
|
|
8906
|
-
LOG$4.errorTransaction('LOAD_USER_DATA', authObject.code, authObject.error);
|
|
8809
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', (_authObject$code3 = authObject.code) !== null && _authObject$code3 !== void 0 ? _authObject$code3 : 'CORE_0006', authObject.error);
|
|
8907
8810
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8908
8811
|
} else {
|
|
8909
8812
|
verifyEmailToken = authObject.token;
|
|
8910
8813
|
}
|
|
8911
|
-
return _context.abrupt("break",
|
|
8912
|
-
case
|
|
8814
|
+
return _context.abrupt("break", 51);
|
|
8815
|
+
case 40:
|
|
8913
8816
|
if (!authObject.error) {
|
|
8914
|
-
_context.next =
|
|
8817
|
+
_context.next = 45;
|
|
8915
8818
|
break;
|
|
8916
8819
|
}
|
|
8917
|
-
LOG$4.errorTransaction('LOAD_INVITATION', authObject.code, authObject.error);
|
|
8820
|
+
LOG$4.errorTransaction('LOAD_INVITATION', (_authObject$code4 = authObject.code) !== null && _authObject$code4 !== void 0 ? _authObject$code4 : 'CORE_0006', authObject.error);
|
|
8918
8821
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8919
|
-
_context.next =
|
|
8822
|
+
_context.next = 49;
|
|
8920
8823
|
break;
|
|
8921
|
-
case
|
|
8824
|
+
case 45:
|
|
8922
8825
|
if (!this.browserStateStore.getStoredNToken()) {
|
|
8923
|
-
_context.next =
|
|
8826
|
+
_context.next = 48;
|
|
8924
8827
|
break;
|
|
8925
8828
|
}
|
|
8926
|
-
_context.next =
|
|
8829
|
+
_context.next = 48;
|
|
8927
8830
|
return this.authorizationStore.logout(undefined, undefined, undefined, true);
|
|
8928
|
-
case
|
|
8929
|
-
this.authorizationStore.showWelcomeScreen(authObject.additionalParams.isNewUser, authObject.token, authObject.additionalParams.invitationOrgId);
|
|
8930
|
-
case
|
|
8931
|
-
return _context.abrupt("break",
|
|
8932
|
-
case
|
|
8933
|
-
return _context.abrupt("break",
|
|
8934
|
-
case
|
|
8935
|
-
_context.next =
|
|
8831
|
+
case 48:
|
|
8832
|
+
this.authorizationStore.showWelcomeScreen((_authObject$additiona = authObject.additionalParams) === null || _authObject$additiona === void 0 ? void 0 : _authObject$additiona.isNewUser, authObject.token, (_authObject$additiona2 = authObject.additionalParams) === null || _authObject$additiona2 === void 0 ? void 0 : _authObject$additiona2.invitationOrgId);
|
|
8833
|
+
case 49:
|
|
8834
|
+
return _context.abrupt("break", 51);
|
|
8835
|
+
case 50:
|
|
8836
|
+
return _context.abrupt("break", 51);
|
|
8837
|
+
case 51:
|
|
8838
|
+
_context.next = 53;
|
|
8936
8839
|
break;
|
|
8937
|
-
case
|
|
8840
|
+
case 53:
|
|
8938
8841
|
LOG$4.successTransaction('LOAD_USER_DATA');
|
|
8842
|
+
if (initialOrganization) {
|
|
8843
|
+
_context.next = 57;
|
|
8844
|
+
break;
|
|
8845
|
+
}
|
|
8846
|
+
_context.next = 57;
|
|
8847
|
+
return this.initializeAuthorization((_this$configurationSt5 = this.configurationStore.organizations) === null || _this$configurationSt5 === void 0 ? void 0 : _this$configurationSt5[0]);
|
|
8848
|
+
case 57:
|
|
8939
8849
|
if (!(!this.browserStateStore.getStoredNToken() && this.configurationStore.hasAuthentication)) {
|
|
8940
|
-
_context.next =
|
|
8850
|
+
_context.next = 61;
|
|
8941
8851
|
break;
|
|
8942
8852
|
}
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
return flowResult(this.authorizationStore.autorize((_initialOrganization = initialOrganization) !== null && _initialOrganization !== void 0 ? _initialOrganization : configuration.organizations[0]));
|
|
8946
|
-
case 70:
|
|
8947
|
-
_context.next = 77;
|
|
8948
|
-
break;
|
|
8949
|
-
case 72:
|
|
8950
|
-
_context.prev = 72;
|
|
8951
|
-
_context.t1 = _context["catch"](67);
|
|
8952
|
-
this.loadingAndErrorStore.setError(_context.t1);
|
|
8953
|
-
LOG$4.errorTransaction('INITIALIZE_CORE', _context.t1.code, 'Organization Error');
|
|
8954
|
-
return _context.abrupt("return");
|
|
8955
|
-
case 77:
|
|
8956
|
-
//now Login Page opens. The overwritten initComponent params get saved in restrictedComponent. this will later be evaluated in getRedirectUrl
|
|
8853
|
+
//if user is not logged in, show login form and exit initialization
|
|
8854
|
+
//The overwritten initComponent params get saved in restrictedComponent. this will later be evaluated in getRedirectUrl
|
|
8957
8855
|
this.contentStore.restrictedComponent = this._initalComponent;
|
|
8958
8856
|
this.authorizationStore.showLogin(urlState.debugLogin, false, initialOrganization);
|
|
8959
8857
|
return _context.abrupt("return");
|
|
8960
|
-
case
|
|
8961
|
-
//user is either logged in or no authentication is required
|
|
8962
|
-
if (!initialOrganization && !this.configurationStore.hasAuthentication) {
|
|
8963
|
-
//if no authentication, fallback to first organization in config
|
|
8964
|
-
initialOrganization = configuration.organizations[0];
|
|
8965
|
-
}
|
|
8966
|
-
_context.prev = 81;
|
|
8967
|
-
_context.next = 84;
|
|
8968
|
-
return flowResult(this.authorizationStore.autorize(initialOrganization, this.browserStateStore.getStoredNToken()));
|
|
8969
|
-
case 84:
|
|
8970
|
-
initialOrganization = _context.sent;
|
|
8971
|
-
_context.next = 92;
|
|
8972
|
-
break;
|
|
8973
|
-
case 87:
|
|
8974
|
-
_context.prev = 87;
|
|
8975
|
-
_context.t2 = _context["catch"](81);
|
|
8976
|
-
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0002', 'Error initializing Organization');
|
|
8977
|
-
this.loadingAndErrorStore.setError(_context.t2, 'CORE_0002', true);
|
|
8978
|
-
return _context.abrupt("return");
|
|
8979
|
-
case 92:
|
|
8980
|
-
_context.prev = 92;
|
|
8981
|
-
_context.next = 95;
|
|
8982
|
-
return flowResult(this.dataStore.updateOrganizationInternal(initialOrganization));
|
|
8983
|
-
case 95:
|
|
8984
|
-
_context.next = 102;
|
|
8985
|
-
break;
|
|
8986
|
-
case 97:
|
|
8987
|
-
_context.prev = 97;
|
|
8988
|
-
_context.t3 = _context["catch"](92);
|
|
8989
|
-
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0002', 'Error updating Organization');
|
|
8990
|
-
this.loadingAndErrorStore.setError(_context.t3);
|
|
8991
|
-
return _context.abrupt("return");
|
|
8992
|
-
case 102:
|
|
8858
|
+
case 61:
|
|
8993
8859
|
if (!verifyEmailToken) {
|
|
8994
|
-
_context.next =
|
|
8860
|
+
_context.next = 67;
|
|
8995
8861
|
break;
|
|
8996
8862
|
}
|
|
8997
|
-
_context.next =
|
|
8863
|
+
_context.next = 64;
|
|
8998
8864
|
return this.apiHandler.verifyEmail({
|
|
8999
8865
|
token: verifyEmailToken
|
|
9000
8866
|
});
|
|
9001
|
-
case
|
|
8867
|
+
case 64:
|
|
9002
8868
|
email = _context.sent;
|
|
9003
|
-
_context.next =
|
|
8869
|
+
_context.next = 67;
|
|
9004
8870
|
return flowResult(this.authorizationStore.login(email, undefined, true, initialOrganization));
|
|
9005
|
-
case
|
|
9006
|
-
_context.next =
|
|
8871
|
+
case 67:
|
|
8872
|
+
_context.next = 72;
|
|
9007
8873
|
break;
|
|
9008
|
-
case
|
|
9009
|
-
_context.prev =
|
|
9010
|
-
_context.
|
|
9011
|
-
if (_context.
|
|
8874
|
+
case 69:
|
|
8875
|
+
_context.prev = 69;
|
|
8876
|
+
_context.t1 = _context["catch"](28);
|
|
8877
|
+
if (_context.t1 instanceof DivaError && _context.t1.name == 'AUTH_0006') {
|
|
9012
8878
|
LOG$4.errorTransaction('INITIALIZE_CORE', 'AUTH_0006', 'Existing verification token not valid.');
|
|
9013
8879
|
} else {
|
|
9014
8880
|
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0006', 'An error occured during initialization.');
|
|
9015
8881
|
}
|
|
9016
|
-
case
|
|
8882
|
+
case 72:
|
|
9017
8883
|
this.initalizeView();
|
|
9018
8884
|
if (this.jwt) {
|
|
9019
8885
|
DivaUtils.businessMetrics.jwtSetter = this.jwt;
|
|
@@ -9024,41 +8890,182 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
9024
8890
|
identifier: identifier,
|
|
9025
8891
|
organizationId: this.dataStore.organizationId,
|
|
9026
8892
|
domain: domain,
|
|
9027
|
-
language:
|
|
8893
|
+
language: instance.language,
|
|
9028
8894
|
component: (_this$contentStore$cu = this.contentStore.currentComponent) === null || _this$contentStore$cu === void 0 ? void 0 : _this$contentStore$cu.type
|
|
9029
8895
|
});
|
|
9030
|
-
_context.next =
|
|
8896
|
+
_context.next = 82;
|
|
9031
8897
|
break;
|
|
9032
|
-
case
|
|
9033
|
-
_context.prev =
|
|
9034
|
-
_context.
|
|
8898
|
+
case 77:
|
|
8899
|
+
_context.prev = 77;
|
|
8900
|
+
_context.t2 = _context["catch"](1);
|
|
9035
8901
|
this.loadingAndErrorStore.toggleLoading('initalize', false);
|
|
9036
|
-
this.loadingAndErrorStore.setError(_context.
|
|
9037
|
-
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0000', _context.
|
|
8902
|
+
this.loadingAndErrorStore.setError(_context.t2);
|
|
8903
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0000', _context.t2.message, {
|
|
9038
8904
|
identifier: identifier,
|
|
9039
8905
|
organizationId: this.dataStore.organizationId,
|
|
9040
8906
|
domain: domain,
|
|
9041
|
-
language:
|
|
8907
|
+
language: instance.language,
|
|
9042
8908
|
component: (_this$contentStore$cu2 = this.contentStore.currentComponent) === null || _this$contentStore$cu2 === void 0 ? void 0 : _this$contentStore$cu2.type
|
|
9043
8909
|
});
|
|
9044
|
-
case
|
|
9045
|
-
_context.prev =
|
|
8910
|
+
case 82:
|
|
8911
|
+
_context.prev = 82;
|
|
9046
8912
|
this.loadingAndErrorStore.toggleLoading('initalize');
|
|
9047
8913
|
runInAction(function () {
|
|
9048
8914
|
_this4._initializing = false;
|
|
9049
8915
|
});
|
|
9050
|
-
return _context.finish(
|
|
9051
|
-
case
|
|
8916
|
+
return _context.finish(82);
|
|
8917
|
+
case 86:
|
|
9052
8918
|
case "end":
|
|
9053
8919
|
return _context.stop();
|
|
9054
8920
|
}
|
|
9055
|
-
}, _callee, this, [[1,
|
|
8921
|
+
}, _callee, this, [[1, 77, 82, 86], [28, 69]]);
|
|
9056
8922
|
}));
|
|
9057
8923
|
function initialize(_x, _x2, _x3, _x4, _x5, _x6, _x7) {
|
|
9058
8924
|
return _initialize.apply(this, arguments);
|
|
9059
8925
|
}
|
|
9060
8926
|
return initialize;
|
|
8927
|
+
}()
|
|
8928
|
+
/**
|
|
8929
|
+
* initalize cookiebot, telemetry and business metrics
|
|
8930
|
+
*
|
|
8931
|
+
* @param telemetry if telemetry is enabled
|
|
8932
|
+
* @param environment defines if we are running in development or production
|
|
8933
|
+
* @param applicationEnvironment defines if we are running in seller or web
|
|
8934
|
+
* @param applicationName the name of the application
|
|
8935
|
+
* @param analyticsProps the analytics props
|
|
8936
|
+
*/
|
|
8937
|
+
)
|
|
8938
|
+
}, {
|
|
8939
|
+
key: "initializeTelemetry",
|
|
8940
|
+
value: (function () {
|
|
8941
|
+
var _initializeTelemetry = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(telemetry) {
|
|
8942
|
+
var _this5 = this;
|
|
8943
|
+
var environment,
|
|
8944
|
+
applicationEnvironment,
|
|
8945
|
+
applicationName,
|
|
8946
|
+
analyticsProps,
|
|
8947
|
+
telemetrySettings,
|
|
8948
|
+
enableApm,
|
|
8949
|
+
_args2 = arguments;
|
|
8950
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
8951
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
8952
|
+
case 0:
|
|
8953
|
+
environment = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 'PROD';
|
|
8954
|
+
applicationEnvironment = _args2.length > 2 ? _args2[2] : undefined;
|
|
8955
|
+
applicationName = _args2.length > 3 ? _args2[3] : undefined;
|
|
8956
|
+
analyticsProps = _args2.length > 4 ? _args2[4] : undefined;
|
|
8957
|
+
telemetrySettings = this.configurationStore.telemetrySettings;
|
|
8958
|
+
enableApm = telemetry && (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) != false;
|
|
8959
|
+
if (telemetry && telemetrySettings !== null && telemetrySettings !== void 0 && telemetrySettings.cookieBotCbid) {
|
|
8960
|
+
initCookieBot(telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.cookieBotCbid, function (consent) {
|
|
8961
|
+
if (consent.statistics) {
|
|
8962
|
+
init$1(enableApm, environment, applicationName, typeof (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) == 'string' ? telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm : undefined);
|
|
8963
|
+
}
|
|
8964
|
+
if (consent.necessary) {
|
|
8965
|
+
_this5.initializeBusinessMetrics(telemetry, environment, applicationEnvironment, telemetrySettings, analyticsProps);
|
|
8966
|
+
}
|
|
8967
|
+
}, function (reason) {
|
|
8968
|
+
LOG$4.error(new DivaError('Cookiebot initialization failed', {
|
|
8969
|
+
code: 'CORE_0009',
|
|
8970
|
+
custom: {
|
|
8971
|
+
reason: reason
|
|
8972
|
+
}
|
|
8973
|
+
}));
|
|
8974
|
+
init$1(enableApm, environment, applicationName, typeof (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) == 'string' ? telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm : undefined);
|
|
8975
|
+
_this5.initializeBusinessMetrics(telemetry, environment, applicationEnvironment, telemetrySettings, analyticsProps);
|
|
8976
|
+
});
|
|
8977
|
+
} else {
|
|
8978
|
+
init$1(enableApm, environment, applicationName, typeof (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm) == 'string' ? telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.apm : undefined);
|
|
8979
|
+
this.initializeBusinessMetrics(telemetry, environment, applicationEnvironment, telemetrySettings, analyticsProps);
|
|
8980
|
+
}
|
|
8981
|
+
apmIsInitalized();
|
|
8982
|
+
case 8:
|
|
8983
|
+
case "end":
|
|
8984
|
+
return _context2.stop();
|
|
8985
|
+
}
|
|
8986
|
+
}, _callee2, this);
|
|
8987
|
+
}));
|
|
8988
|
+
function initializeTelemetry(_x8) {
|
|
8989
|
+
return _initializeTelemetry.apply(this, arguments);
|
|
8990
|
+
}
|
|
8991
|
+
return initializeTelemetry;
|
|
8992
|
+
}()
|
|
8993
|
+
/**
|
|
8994
|
+
* initalize business metrics
|
|
8995
|
+
*
|
|
8996
|
+
* @param telementryActive if telemetry is enabled
|
|
8997
|
+
* @param environment defines if we are running in development or production
|
|
8998
|
+
* @param applicationEnvironment defines if we are running in seller or web
|
|
8999
|
+
* @param telemetryActive the telemetry settings
|
|
9000
|
+
* @param analyticsProps the analytics props
|
|
9001
|
+
*/
|
|
9002
|
+
)
|
|
9003
|
+
}, {
|
|
9004
|
+
key: "initializeBusinessMetrics",
|
|
9005
|
+
value: (function () {
|
|
9006
|
+
var _initializeBusinessMetrics = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(telemetryActive, environment, applicationEnvironment, telemetrySettings, analyticsProps) {
|
|
9007
|
+
var disableDivaAnalyticsLocalStorage, disableDivaAnalytics, enableBusinessMetrics, myUserAgentInfo;
|
|
9008
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
9009
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
9010
|
+
case 0:
|
|
9011
|
+
disableDivaAnalyticsLocalStorage = localStorage.getItem('disableDivaAnalytics');
|
|
9012
|
+
disableDivaAnalytics = disableDivaAnalyticsLocalStorage !== undefined && disableDivaAnalyticsLocalStorage !== null && disableDivaAnalyticsLocalStorage === 'true';
|
|
9013
|
+
enableBusinessMetrics = telemetrySettings && (telemetrySettings.businessEvents == undefined || (telemetrySettings === null || telemetrySettings === void 0 ? void 0 : telemetrySettings.businessEvents)) && telemetryActive && !disableDivaAnalytics;
|
|
9014
|
+
if (enableBusinessMetrics) {
|
|
9015
|
+
_context3.next = 5;
|
|
9016
|
+
break;
|
|
9017
|
+
}
|
|
9018
|
+
return _context3.abrupt("return");
|
|
9019
|
+
case 5:
|
|
9020
|
+
myUserAgentInfo = getUserAgentInfo();
|
|
9021
|
+
DivaUtils.businessMetrics.init("production" != 'development', environment, window.DIVA_VERSION, this.apiConfig.analyticsService, this.jwt, telemetrySettings.personalData, myUserAgentInfo.family, myUserAgentInfo.os, myUserAgentInfo.deviceName, myUserAgentInfo.browser, myUserAgentInfo.screenWidth, myUserAgentInfo.screenHeight, myUserAgentInfo.osVersion, applicationEnvironment, instance.language, analyticsProps);
|
|
9022
|
+
case 7:
|
|
9023
|
+
case "end":
|
|
9024
|
+
return _context3.stop();
|
|
9025
|
+
}
|
|
9026
|
+
}, _callee3, this);
|
|
9027
|
+
}));
|
|
9028
|
+
function initializeBusinessMetrics(_x9, _x10, _x11, _x12, _x13) {
|
|
9029
|
+
return _initializeBusinessMetrics.apply(this, arguments);
|
|
9030
|
+
}
|
|
9031
|
+
return initializeBusinessMetrics;
|
|
9061
9032
|
}())
|
|
9033
|
+
}, {
|
|
9034
|
+
key: "initializeAuthorization",
|
|
9035
|
+
value: function () {
|
|
9036
|
+
var _initializeAuthorization = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(initialOrganization) {
|
|
9037
|
+
var organizationId;
|
|
9038
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
9039
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
9040
|
+
case 0:
|
|
9041
|
+
_context4.prev = 0;
|
|
9042
|
+
_context4.next = 3;
|
|
9043
|
+
return flowResult(this.authorizationStore.autorize(initialOrganization, this.browserStateStore.getStoredNToken()));
|
|
9044
|
+
case 3:
|
|
9045
|
+
organizationId = _context4.sent;
|
|
9046
|
+
_context4.next = 6;
|
|
9047
|
+
return flowResult(this.dataStore.updateOrganizationInternal(organizationId));
|
|
9048
|
+
case 6:
|
|
9049
|
+
_context4.next = 14;
|
|
9050
|
+
break;
|
|
9051
|
+
case 8:
|
|
9052
|
+
_context4.prev = 8;
|
|
9053
|
+
_context4.t0 = _context4["catch"](0);
|
|
9054
|
+
this.loadingAndErrorStore.setError(_context4.t0);
|
|
9055
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0002', 'Error initializing Organization');
|
|
9056
|
+
this.loadingAndErrorStore.setError(_context4.t0, 'CORE_0002', true);
|
|
9057
|
+
return _context4.abrupt("return");
|
|
9058
|
+
case 14:
|
|
9059
|
+
case "end":
|
|
9060
|
+
return _context4.stop();
|
|
9061
|
+
}
|
|
9062
|
+
}, _callee4, this, [[0, 8]]);
|
|
9063
|
+
}));
|
|
9064
|
+
function initializeAuthorization(_x14) {
|
|
9065
|
+
return _initializeAuthorization.apply(this, arguments);
|
|
9066
|
+
}
|
|
9067
|
+
return initializeAuthorization;
|
|
9068
|
+
}()
|
|
9062
9069
|
}, {
|
|
9063
9070
|
key: "initalizeView",
|
|
9064
9071
|
value: function initalizeView() {
|
|
@@ -9629,7 +9636,7 @@ var SideMenu$1 = observer(SideMenu);
|
|
|
9629
9636
|
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9630
9637
|
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9631
9638
|
var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
|
|
9632
|
-
return import('./ModalsWrapper-
|
|
9639
|
+
return import('./ModalsWrapper-6c5c347e.js');
|
|
9633
9640
|
});
|
|
9634
9641
|
function Fullscreen(_ref) {
|
|
9635
9642
|
var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
|
|
@@ -10087,10 +10094,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
10087
10094
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10088
10095
|
var LOG$2 = getLogger('Framework', 'Root');
|
|
10089
10096
|
var LazyAuth = /*#__PURE__*/React.lazy(function () {
|
|
10090
|
-
return import('./index-
|
|
10097
|
+
return import('./index-2124445c.js');
|
|
10091
10098
|
});
|
|
10092
10099
|
var LazyModals = /*#__PURE__*/React.lazy(function () {
|
|
10093
|
-
return import('./ModalsWrapper-
|
|
10100
|
+
return import('./ModalsWrapper-6c5c347e.js');
|
|
10094
10101
|
});
|
|
10095
10102
|
function ContentComponent() {
|
|
10096
10103
|
var context = useDivaCoreContext();
|
|
@@ -10492,21 +10499,16 @@ var MockedRootStore = /*#__PURE__*/function () {
|
|
|
10492
10499
|
key: "initialize",
|
|
10493
10500
|
value: function () {
|
|
10494
10501
|
var _initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
10495
|
-
var _this$data$language;
|
|
10496
10502
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
10497
10503
|
while (1) switch (_context.prev = _context.next) {
|
|
10498
10504
|
case 0:
|
|
10499
10505
|
if (this.data.priceFormat) DivaUtils.initPriceFormat(this.data.priceFormat);
|
|
10500
10506
|
updateCssThemeVariables(this.container, this.theme);
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
apiConfig: this.apiConfig,
|
|
10504
|
-
defaultLng: (_this$data$language = this.data.language) !== null && _this$data$language !== void 0 ? _this$data$language : this.language
|
|
10507
|
+
init(_objectSpread(_objectSpread({}, this.data.locales), {}, {
|
|
10508
|
+
apiConfig: this.apiConfig
|
|
10505
10509
|
}));
|
|
10506
|
-
case 4:
|
|
10507
|
-
this._language = _context.sent;
|
|
10508
10510
|
this.initalized();
|
|
10509
|
-
case
|
|
10511
|
+
case 4:
|
|
10510
10512
|
case "end":
|
|
10511
10513
|
return _context.stop();
|
|
10512
10514
|
}
|