@magmamath/frontend-config 1.4.0-rc.4 → 1.5.0-rc.0

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.
@@ -88,10 +88,19 @@ declare enum ApiRegion {
88
88
  MAIN = "MAIN",
89
89
  CANADA = "CANADA"
90
90
  }
91
+ declare enum HomeRegion {
92
+ EU_MAIN = "eu-main",
93
+ US_MAIN = "us-main",
94
+ CA_MAIN = "ca-main"
95
+ }
96
+ declare enum RegionURLVariant {
97
+ DEFAULT = "DEFAULT",
98
+ SV_SE = "sv-SE"
99
+ }
91
100
  declare enum QRCodeSize {
92
101
  DEFAULT = "default",
93
102
  MEDIUM = "medium",
94
103
  LARGE = "large"
95
104
  }
96
105
 
97
- export { ApiRegion as A, Environment as E, LoginSource as L, Platform as P, QRCodeSize as Q, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
106
+ export { ApiRegion as A, Environment as E, HomeRegion as H, LoginSource as L, Platform as P, QRCodeSize as Q, RegionURLVariant as R, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
@@ -88,10 +88,19 @@ declare enum ApiRegion {
88
88
  MAIN = "MAIN",
89
89
  CANADA = "CANADA"
90
90
  }
91
+ declare enum HomeRegion {
92
+ EU_MAIN = "eu-main",
93
+ US_MAIN = "us-main",
94
+ CA_MAIN = "ca-main"
95
+ }
96
+ declare enum RegionURLVariant {
97
+ DEFAULT = "DEFAULT",
98
+ SV_SE = "sv-SE"
99
+ }
91
100
  declare enum QRCodeSize {
92
101
  DEFAULT = "default",
93
102
  MEDIUM = "medium",
94
103
  LARGE = "large"
95
104
  }
96
105
 
97
- export { ApiRegion as A, Environment as E, LoginSource as L, Platform as P, QRCodeSize as Q, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
106
+ export { ApiRegion as A, Environment as E, HomeRegion as H, LoginSource as L, Platform as P, QRCodeSize as Q, RegionURLVariant as R, SSO as S, Locale as a, PlatformBuildTarget as b, Source as c };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, Q as QRCodeSize, A as ApiRegion } from './common.constants-4kbCK3_q.mjs';
2
- export { c as Source } from './common.constants-4kbCK3_q.mjs';
1
+ import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, H as HomeRegion, R as RegionURLVariant, Q as QRCodeSize, A as ApiRegion } from './common.constants-D7-P-TVv.mjs';
2
+ export { c as Source } from './common.constants-D7-P-TVv.mjs';
3
3
  import { ComponentType } from 'react';
4
4
  import * as effector from 'effector';
5
5
 
@@ -764,6 +764,20 @@ type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
764
764
 
765
765
  declare function buildTargetToEnvironment(buildTarget: PlatformBuildTarget): Environment;
766
766
 
767
+ type RegionURLOverrides = {
768
+ API_URL: string;
769
+ CDN_HOST: string;
770
+ CDN_HOST_TRANSLATIONS: string;
771
+ SOCKET_URL: string;
772
+ WEBSOCKETS_URL: string;
773
+ };
774
+ type RegionURLsMap = Record<Environment, Record<HomeRegion, Partial<Record<RegionURLVariant, RegionURLOverrides>>>>;
775
+
776
+ declare const REGION_URLS: RegionURLsMap;
777
+ declare const localeToRegionVariant: (locale: Locale) => RegionURLVariant;
778
+ declare const REGION_LOGGLY_SUFFIX: Record<HomeRegion, '' | 'US' | 'CA'>;
779
+ declare const rebuildLogglyTagForHomeRegion: (baseTag: string, homeRegion: HomeRegion) => string;
780
+
767
781
  declare enum KeyboardPreset {
768
782
  DOT_MIXED = "DotMixed",
769
783
  DOT_MIXED_ALT = "DotMixedAlt",
@@ -1014,6 +1028,7 @@ type SetProps<L extends Locale> = {
1014
1028
  locale?: L;
1015
1029
  envsRegion?: L;
1016
1030
  environment?: Environment;
1031
+ homeRegion?: HomeRegion;
1017
1032
  };
1018
1033
  declare class AppConfigManager<P extends Platform, L extends Locale> {
1019
1034
  private readonly _DEV_OVERRIDES_?;
@@ -1021,6 +1036,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
1021
1036
  environment: Environment;
1022
1037
  locale: L;
1023
1038
  envsRegion: L;
1039
+ homeRegion?: HomeRegion;
1024
1040
  private readonly setEnvs;
1025
1041
  private readonly setLocaleConfig;
1026
1042
  readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
@@ -1035,6 +1051,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
1035
1051
  isPolish: boolean;
1036
1052
  }>;
1037
1053
  constructor(opts: ConfigOptions<P>);
1054
+ private readonly applyHomeRegionOverride;
1038
1055
  private readonly syncConfigsStores;
1039
1056
  readonly set: (props: SetProps<L>) => void;
1040
1057
  getEnvs: () => EnvironmentVars<P>;
@@ -1058,4 +1075,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
1058
1075
  };
1059
1076
  }
1060
1077
 
1061
- export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment };
1078
+ export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, HomeRegion, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, REGION_LOGGLY_SUFFIX, REGION_URLS, type RegionURLOverrides, RegionURLVariant, type RegionURLsMap, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment, localeToRegionVariant, rebuildLogglyTagForHomeRegion };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, Q as QRCodeSize, A as ApiRegion } from './common.constants-4kbCK3_q.js';
2
- export { c as Source } from './common.constants-4kbCK3_q.js';
1
+ import { S as SSO, L as LoginSource, a as Locale, E as Environment, P as Platform, b as PlatformBuildTarget, H as HomeRegion, R as RegionURLVariant, Q as QRCodeSize, A as ApiRegion } from './common.constants-D7-P-TVv.js';
2
+ export { c as Source } from './common.constants-D7-P-TVv.js';
3
3
  import { ComponentType } from 'react';
4
4
  import * as effector from 'effector';
5
5
 
@@ -764,6 +764,20 @@ type EnvironmentVars<P extends Platform> = EnvPreset[P][Locale][Environment];
764
764
 
765
765
  declare function buildTargetToEnvironment(buildTarget: PlatformBuildTarget): Environment;
766
766
 
767
+ type RegionURLOverrides = {
768
+ API_URL: string;
769
+ CDN_HOST: string;
770
+ CDN_HOST_TRANSLATIONS: string;
771
+ SOCKET_URL: string;
772
+ WEBSOCKETS_URL: string;
773
+ };
774
+ type RegionURLsMap = Record<Environment, Record<HomeRegion, Partial<Record<RegionURLVariant, RegionURLOverrides>>>>;
775
+
776
+ declare const REGION_URLS: RegionURLsMap;
777
+ declare const localeToRegionVariant: (locale: Locale) => RegionURLVariant;
778
+ declare const REGION_LOGGLY_SUFFIX: Record<HomeRegion, '' | 'US' | 'CA'>;
779
+ declare const rebuildLogglyTagForHomeRegion: (baseTag: string, homeRegion: HomeRegion) => string;
780
+
767
781
  declare enum KeyboardPreset {
768
782
  DOT_MIXED = "DotMixed",
769
783
  DOT_MIXED_ALT = "DotMixedAlt",
@@ -1014,6 +1028,7 @@ type SetProps<L extends Locale> = {
1014
1028
  locale?: L;
1015
1029
  envsRegion?: L;
1016
1030
  environment?: Environment;
1031
+ homeRegion?: HomeRegion;
1017
1032
  };
1018
1033
  declare class AppConfigManager<P extends Platform, L extends Locale> {
1019
1034
  private readonly _DEV_OVERRIDES_?;
@@ -1021,6 +1036,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
1021
1036
  environment: Environment;
1022
1037
  locale: L;
1023
1038
  envsRegion: L;
1039
+ homeRegion?: HomeRegion;
1024
1040
  private readonly setEnvs;
1025
1041
  private readonly setLocaleConfig;
1026
1042
  readonly $envs: effector.StoreWritable<EnvironmentVars<P>>;
@@ -1035,6 +1051,7 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
1035
1051
  isPolish: boolean;
1036
1052
  }>;
1037
1053
  constructor(opts: ConfigOptions<P>);
1054
+ private readonly applyHomeRegionOverride;
1038
1055
  private readonly syncConfigsStores;
1039
1056
  readonly set: (props: SetProps<L>) => void;
1040
1057
  getEnvs: () => EnvironmentVars<P>;
@@ -1058,4 +1075,4 @@ declare class AppConfigManager<P extends Platform, L extends Locale> {
1058
1075
  };
1059
1076
  }
1060
1077
 
1061
- export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment };
1078
+ export { AT_CALENDAR_CONFIG, ApiRegion, AppConfigManager, type AuthWebBaseVars, type AuthWebVars, type AuthWebVarsPreset, CH_CALENDAR_CONFIG, type CalendarConfig, CalendarLocale, type CommonGrades, DE_CALENDAR_CONFIG, DK_CALENDAR_CONFIG, DateFormat, DateLocale, type DistrictCommon, type DistrictDashboardVars, type DistrictLocaleConfig, type DistrictWebVarsPreset, DrawboardCoinVariant, EN_CALENDAR_CONFIG, ES_CALENDAR_CONFIG, type EnvPreset, Environment, type EnvironmentVars, FI_CALENDAR_CONFIG, FR_CALENDAR_CONFIG, Grade, type GradeData, type HighSchoolGrades, HomeRegion, IS_CALENDAR_CONFIG, IT_CALENDAR_CONFIG, type KeyboardConfig, KeyboardCurrencyVariant, KeyboardPreset, KeyboardTimeVariant, LANGUAGES_CONFIG, LANGUAGES_LIST, Language, type LanguageConfig, Locale, type LocaleLanguageData, LoginSource, MOST_USED_LANGUAGES, MatrixMode, type MobileBaseVars, type MobileCommon, type MobileLocaleConfig, type MobileVars, type MobileVarsPreset, MomentDateLocale, MultiplicationSymbol, NL_BE_CALENDAR_CONFIG, NL_CALENDAR_CONFIG, NO_CALENDAR_CONFIG, NumberDecimalSeparator, NumberGroupingSeparator, PL_CALENDAR_CONFIG, PRIORITY_LANGUAGES, PT_CALENDAR_CONFIG, type ParentWebLocaleConfig, type ParentWebVars, type ParentWebVarsPreset, Platform, PlatformBuildTarget, type PrimaryGrades, type ProblemCreatorConfig, ProblemCreatorDescriptionVariant, type ProblemCreatorKeyboardConfig, ProblemCreatorKeyboardPreset, ProblemCreatorMathEntryVariant, QRCodeSize, REGION_LOGGLY_SUFFIX, REGION_URLS, type RegionURLOverrides, RegionURLVariant, type RegionURLsMap, SE_CALENDAR_CONFIG, SSO, type SSOByLocale, type SSOConfig, type SSOVariant, type SSO_AT, type SSO_CH, type SSO_DE, type SSO_DK, type SSO_ES, type SSO_FI, type SSO_FR, type SSO_IE, type SSO_IS, type SSO_IT, type SSO_NL, type SSO_NL_BE, type SSO_NO, type SSO_PL, type SSO_PT, type SSO_SE, type SSO_SV_FI, type SSO_UK, type SSO_US, SV_FI_CALENDAR_CONFIG, type StudentsLocaleConfig, type StudentsWebCommon, type StudentsWebVars, type StudentsWebVarsPreset, TTSOverrideSymbol, type TeachersLocaleConfig, type TeachersWebCommon, type TeachersWebVars, type TeachersWebVarsPreset, TreeLevel, buildTargetToEnvironment, localeToRegionVariant, rebuildLogglyTagForHomeRegion };
package/dist/index.js CHANGED
@@ -91,15 +91,15 @@ var MomentDateLocale = {
91
91
  };
92
92
 
93
93
  // src/shared/constants/common.constants.ts
94
- var Platform = /* @__PURE__ */ ((Platform3) => {
95
- Platform3["STUDENTS_WEB"] = "STUDENTS";
96
- Platform3["TEACHERS_WEB"] = "TEACHERS";
97
- Platform3["DISTRICT_DASHBOARD"] = "DISTRICT";
98
- Platform3["AUTH_WEB"] = "AUTH_WEB";
99
- Platform3["WEB_ADMIN"] = "WEB_ADMIN";
100
- Platform3["MOBILE"] = "MOBILE";
101
- Platform3["PARENT_WEB"] = "PARENT_WEB";
102
- return Platform3;
94
+ var Platform = /* @__PURE__ */ ((Platform2) => {
95
+ Platform2["STUDENTS_WEB"] = "STUDENTS";
96
+ Platform2["TEACHERS_WEB"] = "TEACHERS";
97
+ Platform2["DISTRICT_DASHBOARD"] = "DISTRICT";
98
+ Platform2["AUTH_WEB"] = "AUTH_WEB";
99
+ Platform2["WEB_ADMIN"] = "WEB_ADMIN";
100
+ Platform2["MOBILE"] = "MOBILE";
101
+ Platform2["PARENT_WEB"] = "PARENT_WEB";
102
+ return Platform2;
103
103
  })(Platform || {});
104
104
  var Environment = /* @__PURE__ */ ((Environment3) => {
105
105
  Environment3["MARS"] = "MARS";
@@ -189,6 +189,17 @@ var ApiRegion = /* @__PURE__ */ ((ApiRegion2) => {
189
189
  ApiRegion2["CANADA"] = "CANADA";
190
190
  return ApiRegion2;
191
191
  })(ApiRegion || {});
192
+ var HomeRegion = /* @__PURE__ */ ((HomeRegion3) => {
193
+ HomeRegion3["EU_MAIN"] = "eu-main";
194
+ HomeRegion3["US_MAIN"] = "us-main";
195
+ HomeRegion3["CA_MAIN"] = "ca-main";
196
+ return HomeRegion3;
197
+ })(HomeRegion || {});
198
+ var RegionURLVariant = /* @__PURE__ */ ((RegionURLVariant2) => {
199
+ RegionURLVariant2["DEFAULT"] = "DEFAULT";
200
+ RegionURLVariant2["SV_SE"] = "sv-SE";
201
+ return RegionURLVariant2;
202
+ })(RegionURLVariant || {});
192
203
  var QRCodeSize = /* @__PURE__ */ ((QRCodeSize2) => {
193
204
  QRCodeSize2["DEFAULT"] = "default";
194
205
  QRCodeSize2["MEDIUM"] = "medium";
@@ -1299,6 +1310,100 @@ function buildTargetToEnvironment(buildTarget) {
1299
1310
  return env;
1300
1311
  }
1301
1312
 
1313
+ // src/configs/env/region.urls.ts
1314
+ var PROD = {
1315
+ ["eu-main" /* EU_MAIN */]: {
1316
+ ["DEFAULT" /* DEFAULT */]: {
1317
+ API_URL: "https://api.magmamath.com/v2",
1318
+ CDN_HOST: "https://cdn.magmamath.com",
1319
+ CDN_HOST_TRANSLATIONS: "https://cdn.magmamath.com/translations",
1320
+ SOCKET_URL: "https://sockets.magmamath.com",
1321
+ WEBSOCKETS_URL: "https://websockets.magmamath.com"
1322
+ },
1323
+ ["sv-SE" /* SV_SE */]: {
1324
+ API_URL: "https://api.matteappen.se/v2",
1325
+ CDN_HOST: "https://cdn.matteappen.se",
1326
+ CDN_HOST_TRANSLATIONS: "https://cdn.matteappen.se/translations",
1327
+ SOCKET_URL: "https://sockets.matteappen.se",
1328
+ WEBSOCKETS_URL: "https://websockets.matteappen.se"
1329
+ }
1330
+ },
1331
+ ["us-main" /* US_MAIN */]: {
1332
+ ["DEFAULT" /* DEFAULT */]: {
1333
+ API_URL: "https://api.us.magmamath.com/v2",
1334
+ CDN_HOST: "https://cdn.us.magmamath.com",
1335
+ CDN_HOST_TRANSLATIONS: "https://cdn.us.magmamath.com/translations",
1336
+ SOCKET_URL: "https://sockets.us.magmamath.com",
1337
+ WEBSOCKETS_URL: "https://websockets.us.magmamath.com"
1338
+ }
1339
+ },
1340
+ ["ca-main" /* CA_MAIN */]: {
1341
+ ["DEFAULT" /* DEFAULT */]: {
1342
+ API_URL: "https://api.ca.magmamath.com/v2",
1343
+ CDN_HOST: "https://cdn.ca.magmamath.com",
1344
+ CDN_HOST_TRANSLATIONS: "https://cdn.ca.magmamath.com/translations",
1345
+ SOCKET_URL: "https://sockets.ca.magmamath.com",
1346
+ WEBSOCKETS_URL: "https://websockets.ca.magmamath.com"
1347
+ }
1348
+ }
1349
+ };
1350
+ var MARS = {
1351
+ ["eu-main" /* EU_MAIN */]: {
1352
+ ["DEFAULT" /* DEFAULT */]: {
1353
+ API_URL: "https://api.mars.magmamath.com/v2",
1354
+ CDN_HOST: "https://cdn.mars.magmamath.com",
1355
+ CDN_HOST_TRANSLATIONS: "https://cdn.mars.magmamath.com/translations",
1356
+ SOCKET_URL: "https://sockets.mars.magmamath.com",
1357
+ WEBSOCKETS_URL: "https://websockets.mars.magmamath.com"
1358
+ },
1359
+ ["sv-SE" /* SV_SE */]: {
1360
+ API_URL: "https://api.mars.matteappen.se/v2",
1361
+ CDN_HOST: "https://cdn.mars.matteappen.se",
1362
+ CDN_HOST_TRANSLATIONS: "https://cdn.mars.matteappen.se/translations",
1363
+ SOCKET_URL: "https://sockets.mars.matteappen.se",
1364
+ WEBSOCKETS_URL: "https://websockets.mars.matteappen.se"
1365
+ }
1366
+ },
1367
+ ["us-main" /* US_MAIN */]: {
1368
+ ["DEFAULT" /* DEFAULT */]: {
1369
+ API_URL: "https://api.us.mars.magmamath.com/v2",
1370
+ CDN_HOST: "https://cdn.us.mars.magmamath.com",
1371
+ CDN_HOST_TRANSLATIONS: "https://cdn.us.mars.magmamath.com/translations",
1372
+ SOCKET_URL: "https://sockets.us.mars.magmamath.com",
1373
+ WEBSOCKETS_URL: "https://websockets.us.mars.magmamath.com"
1374
+ }
1375
+ },
1376
+ ["ca-main" /* CA_MAIN */]: {
1377
+ ["DEFAULT" /* DEFAULT */]: {
1378
+ API_URL: "https://api-ca.mars.magmamath.com/v2",
1379
+ CDN_HOST: "https://cdn.ca.magmamath.com",
1380
+ CDN_HOST_TRANSLATIONS: "https://cdn.ca.magmamath.com/translations",
1381
+ SOCKET_URL: "https://sockets.ca.magmamath.com",
1382
+ WEBSOCKETS_URL: "https://websockets.mars.matteappen.se"
1383
+ }
1384
+ }
1385
+ };
1386
+ var REGION_URLS = {
1387
+ ["PROD" /* PROD */]: PROD,
1388
+ ["MARS" /* MARS */]: MARS,
1389
+ ["VENUS" /* VENUS */]: PROD
1390
+ };
1391
+ var localeToRegionVariant = (locale) => {
1392
+ if (locale === "sv-SE" /* SE */) return "sv-SE" /* SV_SE */;
1393
+ return "DEFAULT" /* DEFAULT */;
1394
+ };
1395
+ var REGION_LOGGLY_SUFFIX = {
1396
+ ["eu-main" /* EU_MAIN */]: "",
1397
+ ["us-main" /* US_MAIN */]: "US",
1398
+ ["ca-main" /* CA_MAIN */]: "CA"
1399
+ };
1400
+ var rebuildLogglyTagForHomeRegion = (baseTag, homeRegion) => {
1401
+ const suffix = REGION_LOGGLY_SUFFIX[homeRegion];
1402
+ if (!suffix) return baseTag;
1403
+ const prefix = baseTag.split(",")[0];
1404
+ return `${prefix},${prefix}_${suffix}`;
1405
+ };
1406
+
1302
1407
  // src/shared/constants/keyboard.constants.ts
1303
1408
  var KeyboardPreset = /* @__PURE__ */ ((KeyboardPreset2) => {
1304
1409
  KeyboardPreset2["DOT_MIXED"] = "DotMixed";
@@ -9165,7 +9270,7 @@ var LOCALE_TEACHERS_IT = {
9165
9270
  },
9166
9271
  urls: {
9167
9272
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
9168
- helpCenter: "https://intercom.help/hilfecenter/de/",
9273
+ helpCenter: "https://intercom.help/magma-math-us/",
9169
9274
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
9170
9275
  onboarding: "https://www.magmamath.com/"
9171
9276
  },
@@ -9330,7 +9435,7 @@ var LOCALE_TEACHERS_FR = {
9330
9435
  },
9331
9436
  urls: {
9332
9437
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
9333
- helpCenter: "https://intercom.help/hilfecenter/de/",
9438
+ helpCenter: "https://intercom.help/magma-math-us/",
9334
9439
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
9335
9440
  onboarding: "https://www.magmamath.com/"
9336
9441
  },
@@ -9495,7 +9600,7 @@ var LOCALE_TEACHERS_DK = {
9495
9600
  },
9496
9601
  urls: {
9497
9602
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
9498
- helpCenter: "https://intercom.help/magma-math-dk/da/",
9603
+ helpCenter: "https://intercom.help/magma-math-us/",
9499
9604
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
9500
9605
  onboarding: "https://www.magmamath.com/"
9501
9606
  },
@@ -9662,7 +9767,7 @@ var LOCALE_TEACHERS_NO = {
9662
9767
  },
9663
9768
  urls: {
9664
9769
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
9665
- helpCenter: "https://intercom.help/magma-math-no/no/",
9770
+ helpCenter: "https://intercom.help/magma-math-us/",
9666
9771
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
9667
9772
  onboarding: "https://www.magmamath.com/"
9668
9773
  },
@@ -9831,7 +9936,7 @@ var LOCALE_TEACHERS_NL = {
9831
9936
  },
9832
9937
  urls: {
9833
9938
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
9834
- helpCenter: "https://intercom.help/magma-math-us/en/",
9939
+ helpCenter: "https://intercom.help/magma-math-us/",
9835
9940
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
9836
9941
  onboarding: "https://www.magmamath.com/"
9837
9942
  },
@@ -9998,7 +10103,7 @@ var LOCALE_TEACHERS_FI = {
9998
10103
  },
9999
10104
  urls: {
10000
10105
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
10001
- helpCenter: "https://intercom.help/magma-math-us/en/",
10106
+ helpCenter: "https://intercom.help/magma-math-us/",
10002
10107
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
10003
10108
  onboarding: "https://www.magmamath.com/"
10004
10109
  },
@@ -10165,7 +10270,7 @@ var LOCALE_TEACHERS_NL_BE = {
10165
10270
  },
10166
10271
  urls: {
10167
10272
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
10168
- helpCenter: "https://intercom.help/magma-math-us/en/",
10273
+ helpCenter: "https://intercom.help/magma-math-us/",
10169
10274
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
10170
10275
  onboarding: "https://www.magmamath.com/"
10171
10276
  },
@@ -10326,12 +10431,11 @@ var LOCALE_STUDENTS_IE = {
10326
10431
  var LOCALE_TEACHERS_IE = {
10327
10432
  ...LOCALE_COMMON_IE,
10328
10433
  emails: {
10329
- // TODO: confirm IE-specific support email; using GB value as fallback
10330
10434
  studentsList: "hello@magmamaths.co.uk"
10331
10435
  },
10332
10436
  urls: {
10333
10437
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
10334
- helpCenter: "https://intercom.help/magma-maths/",
10438
+ helpCenter: "https://intercom.help/magma-math-us/",
10335
10439
  about: "https://intercom.help/magma-help/en/articles/11401497-live-activity",
10336
10440
  onboarding: "https://www.magmamath.com/"
10337
10441
  },
@@ -10496,7 +10600,7 @@ var LOCALE_TEACHERS_IS = {
10496
10600
  },
10497
10601
  urls: {
10498
10602
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
10499
- helpCenter: "https://intercom.help/magma-math-us/en/",
10603
+ helpCenter: "https://intercom.help/magma-math-us/",
10500
10604
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
10501
10605
  onboarding: "https://www.magmamath.com/"
10502
10606
  },
@@ -10665,7 +10769,7 @@ var LOCALE_TEACHERS_SV_FI = {
10665
10769
  },
10666
10770
  urls: {
10667
10771
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
10668
- helpCenter: "https://intercom.help/magma-math-us/en/",
10772
+ helpCenter: "https://intercom.help/magma-math-us/",
10669
10773
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
10670
10774
  onboarding: "https://www.magmamath.com/"
10671
10775
  },
@@ -11163,7 +11267,7 @@ var LOCALE_TEACHERS_ES = {
11163
11267
  },
11164
11268
  urls: {
11165
11269
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
11166
- helpCenter: "https://intercom.help/hilfecenter/de/",
11270
+ helpCenter: "https://intercom.help/magma-math-us/",
11167
11271
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
11168
11272
  onboarding: "https://www.magmamath.com/"
11169
11273
  },
@@ -11342,7 +11446,7 @@ var LOCALE_TEACHERS_PT = {
11342
11446
  },
11343
11447
  urls: {
11344
11448
  specialBook: "https://intercom.help/magma-math-us/en/articles/10643615-teacher-guide-using-bridges-to-mathematics-material-in-magma-math",
11345
- helpCenter: "https://intercom.help/hilfecenter/de/",
11449
+ helpCenter: "https://intercom.help/magma-math-us/",
11346
11450
  about: "https://intercom.help/magma-math-us/en/articles/10706168-live-activity-overview",
11347
11451
  onboarding: "https://www.magmamath.com/"
11348
11452
  },
@@ -11629,6 +11733,7 @@ var AppConfigManager = class {
11629
11733
  environment;
11630
11734
  locale = "en-SE" /* US */;
11631
11735
  envsRegion = "en-SE" /* US */;
11736
+ homeRegion;
11632
11737
  setEnvs = effector.createEvent();
11633
11738
  setLocaleConfig = effector.createEvent();
11634
11739
  $envs = effector.restore(this.setEnvs, {});
@@ -11648,22 +11753,36 @@ var AppConfigManager = class {
11648
11753
  this._DEV_OVERRIDES_ = opts._DEV_OVERRIDES_;
11649
11754
  this.syncConfigsStores();
11650
11755
  }
11756
+ applyHomeRegionOverride = (envs) => {
11757
+ if (!this.homeRegion) return envs;
11758
+ if (this.platform === "AUTH_WEB" /* AUTH_WEB */) return envs;
11759
+ const perRegion = REGION_URLS[this.environment]?.[this.homeRegion];
11760
+ if (!perRegion) return envs;
11761
+ const variant = localeToRegionVariant(this.locale);
11762
+ const override = perRegion[variant] ?? perRegion["DEFAULT" /* DEFAULT */];
11763
+ if (!override) return envs;
11764
+ const baseLogglyTag = envs.LOGGLY_TAG;
11765
+ const logglyOverride = baseLogglyTag ? { LOGGLY_TAG: rebuildLogglyTagForHomeRegion(baseLogglyTag, this.homeRegion) } : {};
11766
+ return { ...envs, ...override, ...logglyOverride };
11767
+ };
11651
11768
  syncConfigsStores = () => {
11652
- const envs = ENV_PRESET[this.platform][this.envsRegion][this.environment];
11769
+ const baseEnvs = ENV_PRESET[this.platform][this.envsRegion][this.environment];
11770
+ const withHomeRegion = this.applyHomeRegionOverride(baseEnvs);
11653
11771
  const _DEV_OVERRIDES_ = this._DEV_OVERRIDES_?.[this.envsRegion];
11654
11772
  if (_DEV_OVERRIDES_) {
11655
11773
  consoleLogOverridesMessage();
11656
- this.setEnvs({ ...envs, ..._DEV_OVERRIDES_ });
11774
+ this.setEnvs({ ...withHomeRegion, ..._DEV_OVERRIDES_ });
11657
11775
  this.setLocaleConfig(LOCALE_PRESET[this.platform][this.locale]);
11658
11776
  return;
11659
11777
  }
11660
- this.setEnvs(envs);
11778
+ this.setEnvs(withHomeRegion);
11661
11779
  this.setLocaleConfig(LOCALE_PRESET[this.platform][this.locale]);
11662
11780
  };
11663
11781
  set = (props) => {
11664
11782
  this.locale = props.locale ?? this.locale;
11665
11783
  this.environment = props.environment ?? this.environment;
11666
11784
  this.envsRegion = props.envsRegion ?? this.envsRegion;
11785
+ this.homeRegion = props.homeRegion ?? this.homeRegion;
11667
11786
  this.syncConfigsStores();
11668
11787
  };
11669
11788
  getEnvs = () => {
@@ -11714,6 +11833,7 @@ exports.Environment = Environment;
11714
11833
  exports.FI_CALENDAR_CONFIG = FI_CALENDAR_CONFIG;
11715
11834
  exports.FR_CALENDAR_CONFIG = FR_CALENDAR_CONFIG;
11716
11835
  exports.Grade = Grade;
11836
+ exports.HomeRegion = HomeRegion;
11717
11837
  exports.IS_CALENDAR_CONFIG = IS_CALENDAR_CONFIG;
11718
11838
  exports.IT_CALENDAR_CONFIG = IT_CALENDAR_CONFIG;
11719
11839
  exports.KeyboardCurrencyVariant = KeyboardCurrencyVariant;
@@ -11742,6 +11862,9 @@ exports.ProblemCreatorDescriptionVariant = ProblemCreatorDescriptionVariant;
11742
11862
  exports.ProblemCreatorKeyboardPreset = ProblemCreatorKeyboardPreset;
11743
11863
  exports.ProblemCreatorMathEntryVariant = ProblemCreatorMathEntryVariant;
11744
11864
  exports.QRCodeSize = QRCodeSize;
11865
+ exports.REGION_LOGGLY_SUFFIX = REGION_LOGGLY_SUFFIX;
11866
+ exports.REGION_URLS = REGION_URLS;
11867
+ exports.RegionURLVariant = RegionURLVariant;
11745
11868
  exports.SE_CALENDAR_CONFIG = SE_CALENDAR_CONFIG;
11746
11869
  exports.SSO = SSO;
11747
11870
  exports.SV_FI_CALENDAR_CONFIG = SV_FI_CALENDAR_CONFIG;
@@ -11749,5 +11872,7 @@ exports.Source = Source;
11749
11872
  exports.TTSOverrideSymbol = TTSOverrideSymbol;
11750
11873
  exports.TreeLevel = TreeLevel;
11751
11874
  exports.buildTargetToEnvironment = buildTargetToEnvironment;
11875
+ exports.localeToRegionVariant = localeToRegionVariant;
11876
+ exports.rebuildLogglyTagForHomeRegion = rebuildLogglyTagForHomeRegion;
11752
11877
  //# sourceMappingURL=index.js.map
11753
11878
  //# sourceMappingURL=index.js.map