mario-education 2.4.302-layout → 2.4.303-layout
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/components/layouts/hooks/useHeaderSideBar.d.ts +1 -1
- package/dist/components/layouts/hooks/useLanguages.d.ts +10 -0
- package/dist/containers/ConductSurvey/components/diaglog/hooks/useInterventionDialog.d.ts +1 -1
- package/dist/index.js +279 -384
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +280 -385
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -50048,92 +50048,83 @@ var CustomTabComponent = function CustomTabComponent(_ref) {
|
|
|
50048
50048
|
|
|
50049
50049
|
var style$2 = {"font-large":"_356Xx","table-border":"_3rVdM","Close":"_2Vs6W","Active":"_fISYg","row_name":"_2-4H1","bg-red":"_1G8nL","bg-green":"_ATqes","bg-yellow":"_U2Fov","row-status":"_2mAty","table-class-type":"_2KRfC","box-form-input":"_3bgU2","box-content":"_4h5aW","confirm_btn_title":"_3vU-q","content":"_2eddN","btn-favorite-text":"_3bpqI","description-template-left":"_3BhUP","name-template-left":"_2CA9Q","data-grid-content":"_697ao","select-right":"_1J-bu","content-confirm-model":"_2pqFa","input-title":"_1Dfbh","total-card-title":"_2-hXf","title-filter":"_36snY","form-input-title":"_1FINV","list-favorite":"_3EcML","title":"_2sFa5","title-block":"_18vbq","box-additional-title":"_NUXao","dialog-title":"_1oyCk","title-chart":"_2Yhd1","btn-send-survey":"_1xze5","btn-cancel":"_1bqU6","chip-email-default":"_2xKhD","chip-email-checked":"_ouqj6","title-content":"_2O3Tp","create-btn":"_3Cux8","general-chart-title":"_2Lxtl","action-wrapper":"_rEUU_","action-item":"_2n3hL","survey-detail":"_3vJ-g","header-survey-detail":"_Ri4lG","content-header":"_M7dFA","survey-title":"_2APad","responses-distribution":"_1I0XZ","description":"_1hw5e","list-check-question":"_1Ejsc","select-question":"_2t6cX","question":"_2cNmh","ratings-of-questions":"_3225G","show-result":"_3KDFH","chart-result-for-question":"_N5fxX","parameter":"_1NNB0","percent":"_-Fj2n","chart":"_1Qyn4","legend":"_1tBch","avr":"_2TsdE","legend-item":"_3YpJk","name":"_2W9F-","action":"_Ldh2m","header-conduct":"_1npo6","student-detail":"_1pKV2","student-name":"_1GBNs","survey-name":"_2qlBy","conduct-body":"_1dxHK","response-question":"_3IlYT","title-model":"_1UBEA","total-cards":"_38gNv","card":"_C2FoT","response-body":"_3XFlg","student":"_2fuBW","date":"_QH_aS","answer":"_3Rool","none-answer":"_l65o6","font-small":"_1mTdj","option-select":"_32CPv","icon-add-header":"_2tltH","sup-require":"_3IAjJ","span-title":"_2vOMh","checked-favorite":"_JL458","flag":"_1jRbU","filter-desktop":"_1ByZl","h-75":"_2bC49","filter-mobile":"_39EFp","d-flex":"_3ILHs","flex-between":"_1Dy7M","pointer":"_1G7Oj","ml-10":"_3pvOS","mt-20":"_3QSsx","select-type":"_1zeZ3","all-student-survey":"_2rp1M","box-input-csv":"_HGXSI","icon":"_2jqP8","model-confirm-publish":"_1DLAE","box-email-content":"_3aA8I","input-mail-content":"_3HfSn","list-chip-email":"_2mJew","box-chip-email":"_2fwdD","table-desktop":"_3_y0a","table-container":"_DFKYF","data-grid":"_3EcnW","MuiDataGrid-columnSeparator":"_3P0hc","table-mobile":"_1iMfJ","block-list-survey":"_EuZ8_","box-filter":"_3utMA","block-total":"_qlUFF","list-card-right":"_Epdgt","filter-select":"_20eFs","box-filter-left":"_MtBqD","filter-item":"_1WJAo","box-filter-right":"_2VDGv","search-input-icon":"_1FexU","inputInput":"_2JzR2","external-item":"_2iP6U","action-view":"_6y3DH","time-Date":"_17nC2","time-Hours-Minute":"_1vEXB","table-row":"_1jd05","arrow-icon":"_3Urdb","table-cell":"_qPEQy","btn-function":"_2xh2d","btn-action-text":"_2KfG4","avatar_user":"_2mUU4","innerHtml":"_2fgAa","btn-open":"_fLtnC","date-schedule":"_1amhM","pending":"_38Q73","replied":"_2mi_L","actionneeded":"_3qg29","actionneed":"_3XKeC","noscheduled":"_salNB","scheduled":"_3vFP4","completed":"_FoXPx","notstartyet":"_3bhI6","flex-item":"_36RRe","mr-10":"_2A5LB","session":"_33gcZ","schedule-now":"_2BiiZ","block-filter":"_3qVjM","block-filter-right":"_1C7WS","create-survey-container":"_2_bhv","box-create-survey":"_1h2_-","box-list-favorite":"_2Np-n","check-box-btn":"_2KGDK","stepper":"_AHiUZ","step-label":"_6O2vy","dialog-select-template":"_Vb5G5","icon-btn":"_1aD3k","icon-remove":"_rxvBN","title-btn":"_3BDjW","title-box-model":"_3V3hO","box-content-select":"_1p5SM","title-content-select":"_1wY14","description-content-select":"_3AYvl","box-function":"_1yo2i","cancel_btn":"_2q0h5","confirm_btn":"_1wniK","confirm_btn_icon":"_3rnyp","remove_btn":"_3WkIH","remove_btn_title":"_14_xL","remove_btn_icon":"_3VptO","mid_btn":"_Psdg4","box-function-flex":"_2K1MV","box-collapse":"_2-Sse","box-collapse-top":"_miLBv","box-collapse-right":"_2xNTI","collapse-chip":"_13im8","collapse-left-title":"_aft4S","box-collapse-content-item":"_26SCl","block-review-detail":"_1d4Lf","block-content-review":"_12S3I","block-template-review":"_36gKq","block-template-left":"_lw5Ox","additional-box":"_3_5ab","header-item":"_1Q3h9","header-title":"_1WGNT","space-content":"_36P3O","table-title":"_1FCFx","table-status":"_L_uPM","box-header-select":"_1k-yH","header-select-name":"_32KLh","header-select-icon":"_28PLI","header-select-detail":"_ZI06k","list-question-select":"_2EaBh","new-survey":"_SLI97","box-survey":"_dVgqi","avt-user":"_2oBnh","infor":"_3HNaN","content-text":"_SIfgw","time":"_1Sje8","card-item-mobile":"_UEtvP","card-item-left":"_1IKvD","item-name":"_2vyTL","item-detail":"_1bzAB","item-date":"_vw-CP","item-date-content":"_3tsha","table-status-mobile":"_2yS_O","button-mobile":"_1WcRD","box-detail":"_2Mctt","btn-duplicate":"_3Gz-M","box-input":"_3VFOh","item-answer":"_1zSJi","box-favorite":"_2o2b0","overview-survey":"_2sVJR","chart-view-dashboard":"_1doPS","block-chart-wrapper":"_1lkE3","block-chart-title":"_9mzcE","block-chart-top":"_QLUQO","chart-left":"_2c6UE","chart-right":"_1Pmw_","block-header-chart":"_14hBc","column-chart-percent":"_1Ml_a","chart-background":"_2AO5K","custom-marker":"_21lNI","item-legend":"_3BpNG","mark-custom":"_tnwFd","label-legend-custom":"_2juK0","mark-legend":"_13l-r","label-chart":"_3KJlm","listItem":"_1sU--","item":"_397kU","item-checkbox":"_33URL","check-box":"_X-D1i","pie-chart":"_2-TOd","box-chart-title":"_Gijux","box-chart":"_3G2tI","legend-pie-custom":"_sm5jY","color-box":"_3LqNl","generate-flag":"_24iDw","flag-item":"_V8630","count":"_39_gg","red":"_1Qdq3","yellow":"_1ukSp","green":"_Aj1d4","select-filter-top":"_3vD8W","filter-box":"_2WhAK","accordion":"_QOqG1","expanded-summary":"_oa9O2","expanded-title":"_1gxS6","expanded-detail":"_1Uklu","oveview-style":"_DU0s_","item-container":"_17V8B","note-external":"_1Mvjg","icon-back-page":"_3ckSJ","dot":"_1vzYS","table-wrapper":"_z0mjD","pagination":"_kn_xp","dot-response":"_2Nrxx","dot-not-response":"_6GUzQ","middle":"_2gw2z","table-dropdown":"_13mck","table-header":"_nxpHH","tbody-table":"_34MIA"};
|
|
50050
50050
|
|
|
50051
|
-
|
|
50052
|
-
|
|
50053
|
-
|
|
50054
|
-
|
|
50055
|
-
|
|
50056
|
-
|
|
50057
|
-
|
|
50058
|
-
|
|
50059
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
50051
|
+
function warn() {
|
|
50052
|
+
if (console && console.warn) {
|
|
50053
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50054
|
+
args[_key] = arguments[_key];
|
|
50055
|
+
}
|
|
50056
|
+
if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
|
|
50057
|
+
console.warn(...args);
|
|
50058
|
+
}
|
|
50060
50059
|
}
|
|
50061
|
-
|
|
50062
|
-
|
|
50063
|
-
|
|
50064
|
-
|
|
50065
|
-
|
|
50066
|
-
var toPrimitive_1 = createCommonjsModule(function (module) {
|
|
50067
|
-
var _typeof = _typeof_1$1["default"];
|
|
50068
|
-
function toPrimitive(t, r) {
|
|
50069
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
50070
|
-
var e = t[Symbol.toPrimitive];
|
|
50071
|
-
if (void 0 !== e) {
|
|
50072
|
-
var i = e.call(t, r || "default");
|
|
50073
|
-
if ("object" != _typeof(i)) return i;
|
|
50074
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
50060
|
+
const alreadyWarned = {};
|
|
50061
|
+
function warnOnce() {
|
|
50062
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
50063
|
+
args[_key2] = arguments[_key2];
|
|
50075
50064
|
}
|
|
50076
|
-
|
|
50065
|
+
if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
|
|
50066
|
+
if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
|
|
50067
|
+
warn(...args);
|
|
50077
50068
|
}
|
|
50078
|
-
|
|
50079
|
-
|
|
50080
|
-
|
|
50081
|
-
|
|
50082
|
-
|
|
50083
|
-
|
|
50084
|
-
|
|
50085
|
-
|
|
50086
|
-
|
|
50087
|
-
|
|
50088
|
-
|
|
50069
|
+
const loadedClb = (i18n, cb) => () => {
|
|
50070
|
+
if (i18n.isInitialized) {
|
|
50071
|
+
cb();
|
|
50072
|
+
} else {
|
|
50073
|
+
const initialized = () => {
|
|
50074
|
+
setTimeout(() => {
|
|
50075
|
+
i18n.off('initialized', initialized);
|
|
50076
|
+
}, 0);
|
|
50077
|
+
cb();
|
|
50078
|
+
};
|
|
50079
|
+
i18n.on('initialized', initialized);
|
|
50080
|
+
}
|
|
50081
|
+
};
|
|
50082
|
+
function loadNamespaces(i18n, ns, cb) {
|
|
50083
|
+
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
50089
50084
|
}
|
|
50090
|
-
|
|
50091
|
-
|
|
50092
|
-
|
|
50093
|
-
|
|
50094
|
-
|
|
50095
|
-
|
|
50096
|
-
function _defineProperty(e, r, t) {
|
|
50097
|
-
return (r = toPropertyKey_1(r)) in e ? Object.defineProperty(e, r, {
|
|
50098
|
-
value: t,
|
|
50099
|
-
enumerable: !0,
|
|
50100
|
-
configurable: !0,
|
|
50101
|
-
writable: !0
|
|
50102
|
-
}) : e[r] = t, e;
|
|
50085
|
+
function loadLanguages(i18n, lng, ns, cb) {
|
|
50086
|
+
if (typeof ns === 'string') ns = [ns];
|
|
50087
|
+
ns.forEach(n => {
|
|
50088
|
+
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
50089
|
+
});
|
|
50090
|
+
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
50103
50091
|
}
|
|
50104
|
-
|
|
50105
|
-
}
|
|
50106
|
-
|
|
50107
|
-
|
|
50108
|
-
|
|
50109
|
-
|
|
50110
|
-
|
|
50111
|
-
|
|
50092
|
+
function oldI18nextHasLoadedNamespace(ns, i18n) {
|
|
50093
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
50094
|
+
const lng = i18n.languages[0];
|
|
50095
|
+
const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
50096
|
+
const lastLng = i18n.languages[i18n.languages.length - 1];
|
|
50097
|
+
if (lng.toLowerCase() === 'cimode') return true;
|
|
50098
|
+
const loadNotPending = (l, n) => {
|
|
50099
|
+
const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
|
|
50100
|
+
return loadState === -1 || loadState === 2;
|
|
50101
|
+
};
|
|
50102
|
+
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
|
50103
|
+
if (i18n.hasResourceBundle(lng, ns)) return true;
|
|
50104
|
+
if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
|
|
50105
|
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
50106
|
+
return false;
|
|
50112
50107
|
}
|
|
50113
|
-
|
|
50114
|
-
}
|
|
50115
|
-
|
|
50116
|
-
|
|
50117
|
-
|
|
50118
|
-
var createClass = createCommonjsModule(function (module) {
|
|
50119
|
-
function _defineProperties(e, r) {
|
|
50120
|
-
for (var t = 0; t < r.length; t++) {
|
|
50121
|
-
var o = r[t];
|
|
50122
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey_1(o.key), o);
|
|
50108
|
+
function hasLoadedNamespace(ns, i18n) {
|
|
50109
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
50110
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
50111
|
+
warnOnce('i18n.languages were undefined or empty', i18n.languages);
|
|
50112
|
+
return true;
|
|
50123
50113
|
}
|
|
50114
|
+
const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
|
|
50115
|
+
if (!isNewerI18next) {
|
|
50116
|
+
return oldI18nextHasLoadedNamespace(ns, i18n, options);
|
|
50117
|
+
}
|
|
50118
|
+
return i18n.hasLoadedNamespace(ns, {
|
|
50119
|
+
lng: options.lng,
|
|
50120
|
+
precheck: (i18nInstance, loadNotPending) => {
|
|
50121
|
+
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
|
|
50122
|
+
}
|
|
50123
|
+
});
|
|
50124
50124
|
}
|
|
50125
|
-
function _createClass(e, r, t) {
|
|
50126
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
50127
|
-
writable: !1
|
|
50128
|
-
}), e;
|
|
50129
|
-
}
|
|
50130
|
-
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
50131
|
-
});
|
|
50132
|
-
|
|
50133
|
-
var _createClass$1 = unwrapExports(createClass);
|
|
50134
50125
|
|
|
50135
|
-
|
|
50136
|
-
|
|
50126
|
+
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
50127
|
+
const htmlEntities = {
|
|
50137
50128
|
'&': '&',
|
|
50138
50129
|
'&': '&',
|
|
50139
50130
|
'<': '<',
|
|
@@ -50155,16 +50146,10 @@ var htmlEntities = {
|
|
|
50155
50146
|
'/': '/',
|
|
50156
50147
|
'/': '/'
|
|
50157
50148
|
};
|
|
50149
|
+
const unescapeHtmlEntity = m => htmlEntities[m];
|
|
50150
|
+
const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
50158
50151
|
|
|
50159
|
-
|
|
50160
|
-
return htmlEntities[m];
|
|
50161
|
-
};
|
|
50162
|
-
|
|
50163
|
-
var unescape = function unescape(text) {
|
|
50164
|
-
return text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
50165
|
-
};
|
|
50166
|
-
|
|
50167
|
-
var defaultOptions = {
|
|
50152
|
+
let defaultOptions = {
|
|
50168
50153
|
bindI18n: 'languageChanged',
|
|
50169
50154
|
bindI18nStore: '',
|
|
50170
50155
|
transEmptyNodeValue: '',
|
|
@@ -50172,317 +50157,139 @@ var defaultOptions = {
|
|
|
50172
50157
|
transWrapTextNodes: '',
|
|
50173
50158
|
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
|
|
50174
50159
|
useSuspense: true,
|
|
50175
|
-
unescape
|
|
50160
|
+
unescape
|
|
50176
50161
|
};
|
|
50177
|
-
var i18nInstance;
|
|
50178
|
-
var I18nContext = React.createContext();
|
|
50179
50162
|
function getDefaults() {
|
|
50180
50163
|
return defaultOptions;
|
|
50181
50164
|
}
|
|
50182
|
-
var ReportNamespaces = function () {
|
|
50183
|
-
function ReportNamespaces() {
|
|
50184
|
-
_classCallCheck$1(this, ReportNamespaces);
|
|
50185
50165
|
|
|
50186
|
-
|
|
50187
|
-
}
|
|
50188
|
-
|
|
50189
|
-
_createClass$1(ReportNamespaces, [{
|
|
50190
|
-
key: "addUsedNamespaces",
|
|
50191
|
-
value: function addUsedNamespaces(namespaces) {
|
|
50192
|
-
var _this = this;
|
|
50193
|
-
|
|
50194
|
-
namespaces.forEach(function (ns) {
|
|
50195
|
-
if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;
|
|
50196
|
-
});
|
|
50197
|
-
}
|
|
50198
|
-
}, {
|
|
50199
|
-
key: "getUsedNamespaces",
|
|
50200
|
-
value: function getUsedNamespaces() {
|
|
50201
|
-
return Object.keys(this.usedNamespaces);
|
|
50202
|
-
}
|
|
50203
|
-
}]);
|
|
50204
|
-
|
|
50205
|
-
return ReportNamespaces;
|
|
50206
|
-
}();
|
|
50166
|
+
let i18nInstance;
|
|
50207
50167
|
function getI18n() {
|
|
50208
50168
|
return i18nInstance;
|
|
50209
50169
|
}
|
|
50210
50170
|
|
|
50211
|
-
|
|
50212
|
-
|
|
50213
|
-
|
|
50214
|
-
|
|
50215
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50216
|
-
args[_key] = arguments[_key];
|
|
50217
|
-
}
|
|
50218
|
-
|
|
50219
|
-
if (typeof args[0] === 'string') args[0] = "react-i18next:: ".concat(args[0]);
|
|
50220
|
-
|
|
50221
|
-
(_console = console).warn.apply(_console, args);
|
|
50222
|
-
}
|
|
50223
|
-
}
|
|
50224
|
-
var alreadyWarned = {};
|
|
50225
|
-
function warnOnce() {
|
|
50226
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
50227
|
-
args[_key2] = arguments[_key2];
|
|
50228
|
-
}
|
|
50229
|
-
|
|
50230
|
-
if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
|
|
50231
|
-
if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
|
|
50232
|
-
warn.apply(void 0, args);
|
|
50233
|
-
}
|
|
50234
|
-
function loadNamespaces(i18n, ns, cb) {
|
|
50235
|
-
i18n.loadNamespaces(ns, function () {
|
|
50236
|
-
if (i18n.isInitialized) {
|
|
50237
|
-
cb();
|
|
50238
|
-
} else {
|
|
50239
|
-
var initialized = function initialized() {
|
|
50240
|
-
setTimeout(function () {
|
|
50241
|
-
i18n.off('initialized', initialized);
|
|
50242
|
-
}, 0);
|
|
50243
|
-
cb();
|
|
50244
|
-
};
|
|
50245
|
-
|
|
50246
|
-
i18n.on('initialized', initialized);
|
|
50247
|
-
}
|
|
50248
|
-
});
|
|
50249
|
-
}
|
|
50250
|
-
|
|
50251
|
-
function oldI18nextHasLoadedNamespace(ns, i18n) {
|
|
50252
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
50253
|
-
var lng = i18n.languages[0];
|
|
50254
|
-
var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
50255
|
-
var lastLng = i18n.languages[i18n.languages.length - 1];
|
|
50256
|
-
if (lng.toLowerCase() === 'cimode') return true;
|
|
50257
|
-
|
|
50258
|
-
var loadNotPending = function loadNotPending(l, n) {
|
|
50259
|
-
var loadState = i18n.services.backendConnector.state["".concat(l, "|").concat(n)];
|
|
50260
|
-
return loadState === -1 || loadState === 2;
|
|
50261
|
-
};
|
|
50262
|
-
|
|
50263
|
-
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
|
50264
|
-
if (i18n.hasResourceBundle(lng, ns)) return true;
|
|
50265
|
-
if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
|
|
50266
|
-
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
50267
|
-
return false;
|
|
50268
|
-
}
|
|
50269
|
-
|
|
50270
|
-
function hasLoadedNamespace(ns, i18n) {
|
|
50271
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
50272
|
-
|
|
50273
|
-
if (!i18n.languages || !i18n.languages.length) {
|
|
50274
|
-
warnOnce('i18n.languages were undefined or empty', i18n.languages);
|
|
50275
|
-
return true;
|
|
50276
|
-
}
|
|
50277
|
-
|
|
50278
|
-
var isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
|
|
50279
|
-
|
|
50280
|
-
if (!isNewerI18next) {
|
|
50281
|
-
return oldI18nextHasLoadedNamespace(ns, i18n, options);
|
|
50171
|
+
const I18nContext = React.createContext();
|
|
50172
|
+
class ReportNamespaces {
|
|
50173
|
+
constructor() {
|
|
50174
|
+
this.usedNamespaces = {};
|
|
50282
50175
|
}
|
|
50283
|
-
|
|
50284
|
-
|
|
50285
|
-
|
|
50286
|
-
|
|
50287
|
-
}
|
|
50288
|
-
});
|
|
50289
|
-
}
|
|
50290
|
-
|
|
50291
|
-
var arrayWithHoles = createCommonjsModule(function (module) {
|
|
50292
|
-
function _arrayWithHoles(r) {
|
|
50293
|
-
if (Array.isArray(r)) return r;
|
|
50294
|
-
}
|
|
50295
|
-
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
50296
|
-
});
|
|
50297
|
-
|
|
50298
|
-
unwrapExports(arrayWithHoles);
|
|
50299
|
-
|
|
50300
|
-
var iterableToArrayLimit = createCommonjsModule(function (module) {
|
|
50301
|
-
function _iterableToArrayLimit(r, l) {
|
|
50302
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
50303
|
-
if (null != t) {
|
|
50304
|
-
var e,
|
|
50305
|
-
n,
|
|
50306
|
-
i,
|
|
50307
|
-
u,
|
|
50308
|
-
a = [],
|
|
50309
|
-
f = !0,
|
|
50310
|
-
o = !1;
|
|
50311
|
-
try {
|
|
50312
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
50313
|
-
if (Object(t) !== t) return;
|
|
50314
|
-
f = !1;
|
|
50315
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
50316
|
-
} catch (r) {
|
|
50317
|
-
o = !0, n = r;
|
|
50318
|
-
} finally {
|
|
50319
|
-
try {
|
|
50320
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
50321
|
-
} finally {
|
|
50322
|
-
if (o) throw n;
|
|
50323
|
-
}
|
|
50324
|
-
}
|
|
50325
|
-
return a;
|
|
50176
|
+
addUsedNamespaces(namespaces) {
|
|
50177
|
+
namespaces.forEach(ns => {
|
|
50178
|
+
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
50179
|
+
});
|
|
50326
50180
|
}
|
|
50327
|
-
|
|
50328
|
-
|
|
50329
|
-
});
|
|
50330
|
-
|
|
50331
|
-
unwrapExports(iterableToArrayLimit);
|
|
50332
|
-
|
|
50333
|
-
var arrayLikeToArray = createCommonjsModule(function (module) {
|
|
50334
|
-
function _arrayLikeToArray(r, a) {
|
|
50335
|
-
(null == a || a > r.length) && (a = r.length);
|
|
50336
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
50337
|
-
return n;
|
|
50338
|
-
}
|
|
50339
|
-
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
50340
|
-
});
|
|
50341
|
-
|
|
50342
|
-
unwrapExports(arrayLikeToArray);
|
|
50343
|
-
|
|
50344
|
-
var unsupportedIterableToArray = createCommonjsModule(function (module) {
|
|
50345
|
-
function _unsupportedIterableToArray(r, a) {
|
|
50346
|
-
if (r) {
|
|
50347
|
-
if ("string" == typeof r) return arrayLikeToArray(r, a);
|
|
50348
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
50349
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;
|
|
50181
|
+
getUsedNamespaces() {
|
|
50182
|
+
return Object.keys(this.usedNamespaces);
|
|
50350
50183
|
}
|
|
50351
50184
|
}
|
|
50352
|
-
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
50353
|
-
});
|
|
50354
|
-
|
|
50355
|
-
unwrapExports(unsupportedIterableToArray);
|
|
50356
|
-
|
|
50357
|
-
var nonIterableRest = createCommonjsModule(function (module) {
|
|
50358
|
-
function _nonIterableRest() {
|
|
50359
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
50360
|
-
}
|
|
50361
|
-
module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
50362
|
-
});
|
|
50363
|
-
|
|
50364
|
-
unwrapExports(nonIterableRest);
|
|
50365
|
-
|
|
50366
|
-
var slicedToArray = createCommonjsModule(function (module) {
|
|
50367
|
-
function _slicedToArray(r, e) {
|
|
50368
|
-
return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
|
|
50369
|
-
}
|
|
50370
|
-
module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
50371
|
-
});
|
|
50372
|
-
|
|
50373
|
-
var _slicedToArray = unwrapExports(slicedToArray);
|
|
50374
|
-
|
|
50375
|
-
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
50376
|
-
|
|
50377
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
50378
50185
|
|
|
50379
|
-
|
|
50380
|
-
|
|
50381
|
-
React.useEffect(
|
|
50186
|
+
const usePrevious = (value, ignore) => {
|
|
50187
|
+
const ref = React.useRef();
|
|
50188
|
+
React.useEffect(() => {
|
|
50382
50189
|
ref.current = ignore ? ref.current : value;
|
|
50383
50190
|
}, [value, ignore]);
|
|
50384
50191
|
return ref.current;
|
|
50385
50192
|
};
|
|
50386
|
-
|
|
50193
|
+
function alwaysNewT(i18n, language, namespace, keyPrefix) {
|
|
50194
|
+
return i18n.getFixedT(language, namespace, keyPrefix);
|
|
50195
|
+
}
|
|
50196
|
+
function useMemoizedT(i18n, language, namespace, keyPrefix) {
|
|
50197
|
+
return React.useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
|
|
50198
|
+
}
|
|
50387
50199
|
function useTranslation(ns) {
|
|
50388
|
-
|
|
50389
|
-
|
|
50390
|
-
|
|
50391
|
-
|
|
50392
|
-
|
|
50393
|
-
|
|
50394
|
-
|
|
50395
|
-
|
|
50200
|
+
let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
50201
|
+
const {
|
|
50202
|
+
i18n: i18nFromProps
|
|
50203
|
+
} = props;
|
|
50204
|
+
const {
|
|
50205
|
+
i18n: i18nFromContext,
|
|
50206
|
+
defaultNS: defaultNSFromContext
|
|
50207
|
+
} = React.useContext(I18nContext) || {};
|
|
50208
|
+
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
50396
50209
|
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
50397
|
-
|
|
50398
50210
|
if (!i18n) {
|
|
50399
50211
|
warnOnce('You will need to pass in an i18next instance by using initReactI18next');
|
|
50400
|
-
|
|
50401
|
-
|
|
50212
|
+
const notReadyT = (k, optsOrDefaultValue) => {
|
|
50213
|
+
if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
|
|
50214
|
+
if (optsOrDefaultValue && typeof optsOrDefaultValue === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
|
|
50402
50215
|
return Array.isArray(k) ? k[k.length - 1] : k;
|
|
50403
50216
|
};
|
|
50404
|
-
|
|
50405
|
-
var retNotReady = [notReadyT, {}, false];
|
|
50217
|
+
const retNotReady = [notReadyT, {}, false];
|
|
50406
50218
|
retNotReady.t = notReadyT;
|
|
50407
50219
|
retNotReady.i18n = {};
|
|
50408
50220
|
retNotReady.ready = false;
|
|
50409
50221
|
return retNotReady;
|
|
50410
50222
|
}
|
|
50411
|
-
|
|
50412
50223
|
if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
|
|
50413
|
-
|
|
50414
|
-
|
|
50415
|
-
|
|
50416
|
-
|
|
50417
|
-
|
|
50418
|
-
|
|
50224
|
+
const i18nOptions = {
|
|
50225
|
+
...getDefaults(),
|
|
50226
|
+
...i18n.options.react,
|
|
50227
|
+
...props
|
|
50228
|
+
};
|
|
50229
|
+
const {
|
|
50230
|
+
useSuspense,
|
|
50231
|
+
keyPrefix
|
|
50232
|
+
} = i18nOptions;
|
|
50233
|
+
let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
50419
50234
|
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
50420
50235
|
if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
|
|
50421
|
-
|
|
50422
|
-
|
|
50423
|
-
|
|
50424
|
-
|
|
50425
|
-
|
|
50426
|
-
|
|
50427
|
-
}
|
|
50428
|
-
|
|
50429
|
-
|
|
50430
|
-
|
|
50431
|
-
|
|
50432
|
-
|
|
50433
|
-
|
|
50434
|
-
|
|
50435
|
-
var previousJoinedNS = usePrevious(joinedNS);
|
|
50436
|
-
var isMounted = React.useRef(true);
|
|
50437
|
-
React.useEffect(function () {
|
|
50438
|
-
var bindI18n = i18nOptions.bindI18n,
|
|
50439
|
-
bindI18nStore = i18nOptions.bindI18nStore;
|
|
50236
|
+
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));
|
|
50237
|
+
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
|
|
50238
|
+
const getT = () => memoGetT;
|
|
50239
|
+
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
|
|
50240
|
+
const [t, setT] = React.useState(getT);
|
|
50241
|
+
let joinedNS = namespaces.join();
|
|
50242
|
+
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
50243
|
+
const previousJoinedNS = usePrevious(joinedNS);
|
|
50244
|
+
const isMounted = React.useRef(true);
|
|
50245
|
+
React.useEffect(() => {
|
|
50246
|
+
const {
|
|
50247
|
+
bindI18n,
|
|
50248
|
+
bindI18nStore
|
|
50249
|
+
} = i18nOptions;
|
|
50440
50250
|
isMounted.current = true;
|
|
50441
|
-
|
|
50442
50251
|
if (!ready && !useSuspense) {
|
|
50443
|
-
|
|
50444
|
-
|
|
50445
|
-
|
|
50252
|
+
if (props.lng) {
|
|
50253
|
+
loadLanguages(i18n, props.lng, namespaces, () => {
|
|
50254
|
+
if (isMounted.current) setT(getNewT);
|
|
50255
|
+
});
|
|
50256
|
+
} else {
|
|
50257
|
+
loadNamespaces(i18n, namespaces, () => {
|
|
50258
|
+
if (isMounted.current) setT(getNewT);
|
|
50259
|
+
});
|
|
50260
|
+
}
|
|
50446
50261
|
}
|
|
50447
|
-
|
|
50448
50262
|
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
50449
|
-
setT(
|
|
50263
|
+
setT(getNewT);
|
|
50450
50264
|
}
|
|
50451
|
-
|
|
50452
50265
|
function boundReset() {
|
|
50453
|
-
if (isMounted.current) setT(
|
|
50266
|
+
if (isMounted.current) setT(getNewT);
|
|
50454
50267
|
}
|
|
50455
|
-
|
|
50456
50268
|
if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
|
|
50457
50269
|
if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
|
|
50458
|
-
return
|
|
50270
|
+
return () => {
|
|
50459
50271
|
isMounted.current = false;
|
|
50460
|
-
if (bindI18n && i18n) bindI18n.split(' ').forEach(
|
|
50461
|
-
|
|
50462
|
-
});
|
|
50463
|
-
if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(function (e) {
|
|
50464
|
-
return i18n.store.off(e, boundReset);
|
|
50465
|
-
});
|
|
50272
|
+
if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset));
|
|
50273
|
+
if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
|
|
50466
50274
|
};
|
|
50467
50275
|
}, [i18n, joinedNS]);
|
|
50468
|
-
|
|
50469
|
-
|
|
50470
|
-
if (isMounted.current && !isInitial.current) {
|
|
50276
|
+
React.useEffect(() => {
|
|
50277
|
+
if (isMounted.current && ready) {
|
|
50471
50278
|
setT(getT);
|
|
50472
50279
|
}
|
|
50473
|
-
|
|
50474
|
-
|
|
50475
|
-
}, [i18n, keyPrefix]);
|
|
50476
|
-
var ret = [t, i18n, ready];
|
|
50280
|
+
}, [i18n, keyPrefix, ready]);
|
|
50281
|
+
const ret = [t, i18n, ready];
|
|
50477
50282
|
ret.t = t;
|
|
50478
50283
|
ret.i18n = i18n;
|
|
50479
50284
|
ret.ready = ready;
|
|
50480
50285
|
if (ready) return ret;
|
|
50481
50286
|
if (!ready && !useSuspense) return ret;
|
|
50482
|
-
throw new Promise(
|
|
50483
|
-
|
|
50484
|
-
resolve();
|
|
50485
|
-
}
|
|
50287
|
+
throw new Promise(resolve => {
|
|
50288
|
+
if (props.lng) {
|
|
50289
|
+
loadLanguages(i18n, props.lng, namespaces, () => resolve());
|
|
50290
|
+
} else {
|
|
50291
|
+
loadNamespaces(i18n, namespaces, () => resolve());
|
|
50292
|
+
}
|
|
50486
50293
|
});
|
|
50487
50294
|
}
|
|
50488
50295
|
|
|
@@ -66674,7 +66481,7 @@ module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
|
66674
66481
|
|
|
66675
66482
|
unwrapExports(_extends_1$1);
|
|
66676
66483
|
|
|
66677
|
-
var arrayLikeToArray
|
|
66484
|
+
var arrayLikeToArray = createCommonjsModule(function (module) {
|
|
66678
66485
|
function _arrayLikeToArray(arr, len) {
|
|
66679
66486
|
if (len == null || len > arr.length) len = arr.length;
|
|
66680
66487
|
|
|
@@ -66689,11 +66496,11 @@ module.exports = _arrayLikeToArray;
|
|
|
66689
66496
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
66690
66497
|
});
|
|
66691
66498
|
|
|
66692
|
-
unwrapExports(arrayLikeToArray
|
|
66499
|
+
unwrapExports(arrayLikeToArray);
|
|
66693
66500
|
|
|
66694
66501
|
var arrayWithoutHoles = createCommonjsModule(function (module) {
|
|
66695
66502
|
function _arrayWithoutHoles(arr) {
|
|
66696
|
-
if (Array.isArray(arr)) return arrayLikeToArray
|
|
66503
|
+
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
|
66697
66504
|
}
|
|
66698
66505
|
|
|
66699
66506
|
module.exports = _arrayWithoutHoles;
|
|
@@ -66713,21 +66520,21 @@ module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
|
66713
66520
|
|
|
66714
66521
|
unwrapExports(iterableToArray);
|
|
66715
66522
|
|
|
66716
|
-
var unsupportedIterableToArray
|
|
66523
|
+
var unsupportedIterableToArray = createCommonjsModule(function (module) {
|
|
66717
66524
|
function _unsupportedIterableToArray(o, minLen) {
|
|
66718
66525
|
if (!o) return;
|
|
66719
|
-
if (typeof o === "string") return arrayLikeToArray
|
|
66526
|
+
if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
|
66720
66527
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
66721
66528
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
66722
66529
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
66723
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray
|
|
66530
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
|
|
66724
66531
|
}
|
|
66725
66532
|
|
|
66726
66533
|
module.exports = _unsupportedIterableToArray;
|
|
66727
66534
|
module.exports["default"] = module.exports, module.exports.__esModule = true;
|
|
66728
66535
|
});
|
|
66729
66536
|
|
|
66730
|
-
unwrapExports(unsupportedIterableToArray
|
|
66537
|
+
unwrapExports(unsupportedIterableToArray);
|
|
66731
66538
|
|
|
66732
66539
|
var nonIterableSpread = createCommonjsModule(function (module) {
|
|
66733
66540
|
function _nonIterableSpread() {
|
|
@@ -66742,7 +66549,7 @@ unwrapExports(nonIterableSpread);
|
|
|
66742
66549
|
|
|
66743
66550
|
var toConsumableArray = createCommonjsModule(function (module) {
|
|
66744
66551
|
function _toConsumableArray(arr) {
|
|
66745
|
-
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray
|
|
66552
|
+
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
|
|
66746
66553
|
}
|
|
66747
66554
|
|
|
66748
66555
|
module.exports = _toConsumableArray;
|
|
@@ -69317,6 +69124,109 @@ var handleUserRole = function handleUserRole(userRoles) {
|
|
|
69317
69124
|
return userRoles;
|
|
69318
69125
|
};
|
|
69319
69126
|
|
|
69127
|
+
var apiGetLanguage = function apiGetLanguage() {
|
|
69128
|
+
return marioCore.api.get(marioCore.BASE_URL + "/api/language");
|
|
69129
|
+
};
|
|
69130
|
+
|
|
69131
|
+
var apiUpdateLanguage = function apiUpdateLanguage(lang) {
|
|
69132
|
+
return marioCore.api.put(marioCore.BASE_URL + "/api/language?lang=" + lang);
|
|
69133
|
+
};
|
|
69134
|
+
|
|
69135
|
+
var LANGUAGE_SYSTEM = "LANGUAGE_SYSTEM";
|
|
69136
|
+
|
|
69137
|
+
var useLanguages = function useLanguages() {
|
|
69138
|
+
var dispatch = reactRedux.useDispatch();
|
|
69139
|
+
|
|
69140
|
+
var _useTranslation = marioCore.useTranslation(),
|
|
69141
|
+
i18n = _useTranslation.i18n;
|
|
69142
|
+
|
|
69143
|
+
var language = reactRedux.useSelector(function (state) {
|
|
69144
|
+
return state.common.language;
|
|
69145
|
+
});
|
|
69146
|
+
var defaultLanguage = marioCore.getCookieValue(LANGUAGE_SYSTEM) != '' ? marioCore.getCookieValue(LANGUAGE_SYSTEM) : language;
|
|
69147
|
+
|
|
69148
|
+
var _useState = React.useState([]),
|
|
69149
|
+
languageList = _useState[0],
|
|
69150
|
+
setLanguageList = _useState[1];
|
|
69151
|
+
|
|
69152
|
+
var _useState2 = React.useState(false),
|
|
69153
|
+
dropdownOpen = _useState2[0],
|
|
69154
|
+
setDropdownOpen = _useState2[1];
|
|
69155
|
+
|
|
69156
|
+
var _useState3 = React.useState(defaultLanguage),
|
|
69157
|
+
currentLang = _useState3[0],
|
|
69158
|
+
setCurrentLang = _useState3[1];
|
|
69159
|
+
|
|
69160
|
+
var toggle = function toggle() {
|
|
69161
|
+
return setDropdownOpen(function (prevState) {
|
|
69162
|
+
return !prevState;
|
|
69163
|
+
});
|
|
69164
|
+
};
|
|
69165
|
+
|
|
69166
|
+
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
69167
|
+
try {
|
|
69168
|
+
var _temp3 = function _temp3() {
|
|
69169
|
+
dispatch(marioCore.setLoading(false));
|
|
69170
|
+
};
|
|
69171
|
+
|
|
69172
|
+
dispatch(marioCore.setLoading(true));
|
|
69173
|
+
|
|
69174
|
+
var _temp4 = _catch(function () {
|
|
69175
|
+
return Promise.resolve(apiUpdateLanguage(lang)).then(function () {
|
|
69176
|
+
i18n.changeLanguage(lang);
|
|
69177
|
+
setCurrentLang(lang);
|
|
69178
|
+
dispatch(marioCore.setLanguage(lang));
|
|
69179
|
+
});
|
|
69180
|
+
}, function (err) {
|
|
69181
|
+
var _err$response, _err$response$data;
|
|
69182
|
+
|
|
69183
|
+
dispatch(marioCore.setAlert({
|
|
69184
|
+
type: "danger",
|
|
69185
|
+
message: ((_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : _err$response$data.title) || err.message
|
|
69186
|
+
}));
|
|
69187
|
+
});
|
|
69188
|
+
|
|
69189
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
|
69190
|
+
} catch (e) {
|
|
69191
|
+
return Promise.reject(e);
|
|
69192
|
+
}
|
|
69193
|
+
};
|
|
69194
|
+
|
|
69195
|
+
var getListLanguage = function getListLanguage() {
|
|
69196
|
+
try {
|
|
69197
|
+
var _temp6 = _catch(function () {
|
|
69198
|
+
return Promise.resolve(apiGetLanguage()).then(function (res) {
|
|
69199
|
+
setLanguageList(res.data);
|
|
69200
|
+
});
|
|
69201
|
+
}, function (err) {
|
|
69202
|
+
var _err$response2, _err$response2$data;
|
|
69203
|
+
|
|
69204
|
+
dispatch(marioCore.setAlert({
|
|
69205
|
+
type: "danger",
|
|
69206
|
+
message: ((_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.title) || err.message
|
|
69207
|
+
}));
|
|
69208
|
+
});
|
|
69209
|
+
|
|
69210
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
|
69211
|
+
} catch (e) {
|
|
69212
|
+
return Promise.reject(e);
|
|
69213
|
+
}
|
|
69214
|
+
};
|
|
69215
|
+
|
|
69216
|
+
React.useEffect(function () {
|
|
69217
|
+
changeLanguageApp(defaultLanguage);
|
|
69218
|
+
getListLanguage();
|
|
69219
|
+
}, []);
|
|
69220
|
+
return {
|
|
69221
|
+
languageList: languageList,
|
|
69222
|
+
toggle: toggle,
|
|
69223
|
+
dropdownOpen: dropdownOpen,
|
|
69224
|
+
currentLang: currentLang,
|
|
69225
|
+
changeLanguageApp: changeLanguageApp,
|
|
69226
|
+
setCurrentLang: setCurrentLang
|
|
69227
|
+
};
|
|
69228
|
+
};
|
|
69229
|
+
|
|
69320
69230
|
var useStyles$g = core$1.makeStyles({
|
|
69321
69231
|
dropdown: {
|
|
69322
69232
|
zIndex: "1410 !important",
|
|
@@ -69343,22 +69253,18 @@ var useStyles$g = core$1.makeStyles({
|
|
|
69343
69253
|
});
|
|
69344
69254
|
|
|
69345
69255
|
var LanguageDropdown = function LanguageDropdown() {
|
|
69346
|
-
var defaultLanguage = !!localStorage.getItem("language") ? localStorage.getItem("language") : navigator.language || marioCore.DEFAULT_LANGUAGE_CODE;
|
|
69347
|
-
|
|
69348
|
-
var _useTranslation = marioCore.useTranslation(),
|
|
69349
|
-
i18n = _useTranslation.i18n;
|
|
69350
|
-
|
|
69351
|
-
var dispatch = reactRedux.useDispatch();
|
|
69352
69256
|
var classes = useStyles$g();
|
|
69353
69257
|
|
|
69354
69258
|
var _useState = React.useState(null),
|
|
69355
69259
|
anchorLang = _useState[0],
|
|
69356
69260
|
setAnchorLang = _useState[1];
|
|
69357
69261
|
|
|
69358
|
-
var
|
|
69359
|
-
|
|
69360
|
-
|
|
69262
|
+
var _useLanguages = useLanguages(),
|
|
69263
|
+
languageList = _useLanguages.languageList,
|
|
69264
|
+
currentLang = _useLanguages.currentLang,
|
|
69265
|
+
changeLanguageApp = _useLanguages.changeLanguageApp;
|
|
69361
69266
|
|
|
69267
|
+
console.log("admin language");
|
|
69362
69268
|
var openChooseLanguage = Boolean(anchorLang);
|
|
69363
69269
|
|
|
69364
69270
|
var handleLangClose = function handleLangClose() {
|
|
@@ -69369,27 +69275,16 @@ var LanguageDropdown = function LanguageDropdown() {
|
|
|
69369
69275
|
setAnchorLang(event.currentTarget);
|
|
69370
69276
|
};
|
|
69371
69277
|
|
|
69372
|
-
var changeLanguageApp = function changeLanguageApp(lang) {
|
|
69373
|
-
if (!marioCore.SUPPORTED_LANGUAGES_CODE.includes(lang)) lang = marioCore.DEFAULT_LANGUAGE_CODE;
|
|
69374
|
-
i18n.changeLanguage(lang);
|
|
69375
|
-
localStorage.setItem("language", lang);
|
|
69376
|
-
setCurrentLang(lang);
|
|
69377
|
-
dispatch(marioCore.setLanguage(lang));
|
|
69378
|
-
};
|
|
69379
|
-
|
|
69380
69278
|
var currentLanguage = React.useMemo(function () {
|
|
69381
|
-
var current =
|
|
69279
|
+
var current = languageList.find(function (i) {
|
|
69382
69280
|
return i.code === currentLang;
|
|
69383
69281
|
});
|
|
69384
69282
|
if (!current) return null;
|
|
69385
69283
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("img", {
|
|
69386
69284
|
className: "mr-2 " + classes.icon_lang,
|
|
69387
|
-
src: "" + marioCore.getStaticFileUrl(
|
|
69388
|
-
}), current.
|
|
69389
|
-
}, [currentLang]);
|
|
69390
|
-
React.useEffect(function () {
|
|
69391
|
-
changeLanguageApp(currentLang);
|
|
69392
|
-
}, [currentLang]);
|
|
69285
|
+
src: "" + marioCore.getStaticFileUrl("/images/language-icon.png")
|
|
69286
|
+
}), current.name);
|
|
69287
|
+
}, [currentLang, languageList]);
|
|
69393
69288
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(core$1.IconButton, {
|
|
69394
69289
|
onClick: handleLangMenu,
|
|
69395
69290
|
color: "inherit"
|
|
@@ -69413,18 +69308,18 @@ var LanguageDropdown = function LanguageDropdown() {
|
|
|
69413
69308
|
open: openChooseLanguage,
|
|
69414
69309
|
onClose: handleLangClose,
|
|
69415
69310
|
onClick: handleLangClose
|
|
69416
|
-
},
|
|
69311
|
+
}, !!languageList && languageList.length > 0 && languageList.map(function (lang) {
|
|
69417
69312
|
return React__default.createElement(core$1.MenuItem, {
|
|
69418
|
-
key:
|
|
69313
|
+
key: lang.code,
|
|
69419
69314
|
onClick: function onClick() {
|
|
69420
|
-
return
|
|
69315
|
+
return changeLanguageApp(lang.code);
|
|
69421
69316
|
},
|
|
69422
|
-
selected: currentLang ==
|
|
69317
|
+
selected: currentLang == lang.code,
|
|
69423
69318
|
className: classes.fontMedium
|
|
69424
69319
|
}, React__default.createElement("img", {
|
|
69425
69320
|
className: classes.icon_lang,
|
|
69426
|
-
src: marioCore.getStaticFileUrl(
|
|
69427
|
-
}),
|
|
69321
|
+
src: marioCore.getStaticFileUrl(lang.logo)
|
|
69322
|
+
}), lang.name);
|
|
69428
69323
|
})));
|
|
69429
69324
|
};
|
|
69430
69325
|
|