@goodgamestudios/cxf-webshop 7.1.0-qa.3 → 7.1.0-qa.5

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.
@@ -33,13 +33,13 @@
33
33
  var define_process_default;
34
34
  var init_define_process = __esm({
35
35
  "<define:process>"() {
36
- define_process_default = { env: { BASE_URL: { "12": "https://ef-canvas-test.public.ggs-ep.com", "15": "https://canvas-test.goodgamestudios.com", "16": "https://ef-canvas-test.public.ggs-ep.com", default: "https://canvas-test.goodgamestudios.com" }, CANVAS_AGENT_URL: "https://app.canvas.stillfront.com/agent.js", CANVAS_APP_ID_BY_GAME: { "12": "81199abb-592e-465c-b926-8656628a64c7", "15": { google: "25facd0c-e850-4ebf-b6c4-8c60240e4cf8", stillpay: "bec451f9-8db4-4ca1-8a5a-54494429ff5e" }, "16": "18f5521d-7df2-4bb3-88a3-c162ba072d73" }, CUSTOMIZATION_URL_TEMPLATE: "https://cdn.jsdelivr.net/npm/@lemonstand.org/config-goodgamestudios@{1}/dist/goodgamestudios-{0}.json", CUSTOMIZATION_URL: "https://cdn.jsdelivr.net/npm/@lemonstand.org/config-goodgamestudios@qa/dist/goodgamestudios-{0}.json" } };
36
+ define_process_default = { env: { BASE_URL: { "12": "https://ef-canvas-test.public.ggs-ep.com", "15": "https://canvas-test.goodgamestudios.com", "16": "https://ef-canvas-test.public.ggs-ep.com", default: "https://canvas-test.goodgamestudios.com" }, BASE_URL_BY_GAME_ZONE: {}, CANVAS_AGENT_URL: "https://app.canvas.stillfront.com/agent.js", CANVAS_APP_ID_BY_GAME: { "12": "81199abb-592e-465c-b926-8656628a64c7", "15": { google: "25facd0c-e850-4ebf-b6c4-8c60240e4cf8", stillpay: "bec451f9-8db4-4ca1-8a5a-54494429ff5e" }, "16": "18f5521d-7df2-4bb3-88a3-c162ba072d73" }, CUSTOMIZATION_URL_TEMPLATE: "https://cdn.jsdelivr.net/npm/@lemonstand.org/config-goodgamestudios@{1}/dist/goodgamestudios-{0}.json", CUSTOMIZATION_URL: "https://cdn.jsdelivr.net/npm/@lemonstand.org/config-goodgamestudios@qa/dist/goodgamestudios-{0}.json", CUSTOMIZATION_URL_BY_GAME_ZONE: {} } };
37
37
  }
38
38
  });
39
39
 
40
- // node_modules/debug/node_modules/ms/index.js
40
+ // node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
41
41
  var require_ms = __commonJS({
42
- "node_modules/debug/node_modules/ms/index.js"(exports, module) {
42
+ "node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
43
43
  init_define_process();
44
44
  var s = 1e3;
45
45
  var m = s * 60;
@@ -154,9 +154,9 @@
154
154
  }
155
155
  });
156
156
 
157
- // node_modules/debug/src/common.js
157
+ // node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
158
158
  var require_common = __commonJS({
159
- "node_modules/debug/src/common.js"(exports, module) {
159
+ "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
160
160
  init_define_process();
161
161
  function setup(env) {
162
162
  createDebug.debug = createDebug;
@@ -332,9 +332,9 @@
332
332
  }
333
333
  });
334
334
 
335
- // node_modules/debug/src/browser.js
335
+ // node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
336
336
  var require_browser = __commonJS({
337
- "node_modules/debug/src/browser.js"(exports, module) {
337
+ "node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
338
338
  init_define_process();
339
339
  exports.formatArgs = formatArgs;
340
340
  exports.save = save;
@@ -503,9 +503,9 @@
503
503
  }
504
504
  });
505
505
 
506
- // node_modules/@goodgamestudios/cxf-ready/dist/index.js
506
+ // node_modules/.pnpm/@goodgamestudios+cxf-ready@1.0.7/node_modules/@goodgamestudios/cxf-ready/dist/index.js
507
507
  var require_dist = __commonJS({
508
- "node_modules/@goodgamestudios/cxf-ready/dist/index.js"(exports, module) {
508
+ "node_modules/.pnpm/@goodgamestudios+cxf-ready@1.0.7/node_modules/@goodgamestudios/cxf-ready/dist/index.js"(exports, module) {
509
509
  "use strict";
510
510
  init_define_process();
511
511
  var cxf = window && window.CXF;
@@ -528,9 +528,9 @@
528
528
  }
529
529
  });
530
530
 
531
- // node_modules/@goodgamestudios/game-alias/dist/index.js
531
+ // node_modules/.pnpm/@goodgamestudios+game-alias@0.2.11/node_modules/@goodgamestudios/game-alias/dist/index.js
532
532
  var require_dist2 = __commonJS({
533
- "node_modules/@goodgamestudios/game-alias/dist/index.js"(exports, module) {
533
+ "node_modules/.pnpm/@goodgamestudios+game-alias@0.2.11/node_modules/@goodgamestudios/game-alias/dist/index.js"(exports, module) {
534
534
  init_define_process();
535
535
  (function() {
536
536
  var b = {};
@@ -582,9 +582,9 @@
582
582
  }
583
583
  });
584
584
 
585
- // node_modules/@goodgamestudios/cxf-events/dist/typings.js
585
+ // node_modules/.pnpm/@goodgamestudios+cxf-events@1.24.0/node_modules/@goodgamestudios/cxf-events/dist/typings.js
586
586
  var require_typings = __commonJS({
587
- "node_modules/@goodgamestudios/cxf-events/dist/typings.js"(exports) {
587
+ "node_modules/.pnpm/@goodgamestudios+cxf-events@1.24.0/node_modules/@goodgamestudios/cxf-events/dist/typings.js"(exports) {
588
588
  "use strict";
589
589
  init_define_process();
590
590
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -690,14 +690,14 @@
690
690
  );
691
691
 
692
692
  // src/utils/error-handling.ts
693
- var tryCatch = (fn) => (...args) => {
693
+ var tryCatch = (fn) => ((...args) => {
694
694
  try {
695
695
  return fn(...args);
696
696
  } catch (error) {
697
697
  logError(error);
698
698
  throwCxfError(error);
699
699
  }
700
- };
700
+ });
701
701
  var throwCxfError = (e) => {
702
702
  const config = globalState.getConfig();
703
703
  const cxf = globalState.getCxf();
@@ -807,7 +807,7 @@
807
807
  // src/utils/session.ts
808
808
  init_define_process();
809
809
 
810
- // node_modules/@lukeed/uuid/dist/index.mjs
810
+ // node_modules/.pnpm/@lukeed+uuid@2.0.1/node_modules/@lukeed/uuid/dist/index.mjs
811
811
  init_define_process();
812
812
  var IDX = 256;
813
813
  var HEX = [];
@@ -909,7 +909,9 @@
909
909
  CANVAS_APP_ID_BY_GAME: define_process_default.env.CANVAS_APP_ID_BY_GAME,
910
910
  CUSTOMIZATION_URL: define_process_default.env.CUSTOMIZATION_URL,
911
911
  CUSTOMIZATION_URL_TEMPLATE: define_process_default.env.CUSTOMIZATION_URL_TEMPLATE,
912
+ CUSTOMIZATION_URL_BY_GAME_ZONE: define_process_default.env.CUSTOMIZATION_URL_BY_GAME_ZONE,
912
913
  BASE_URL: parseBaseUrl(define_process_default.env.BASE_URL),
914
+ BASE_URL_BY_GAME_ZONE: define_process_default.env.BASE_URL_BY_GAME_ZONE,
913
915
  CXF_DIALOG_OPEN: "cxf.dialog.open",
914
916
  CXF_DIALOG_CLOSE: "cxf.dialog.close",
915
917
  CXF_TRACK_MSG: "cxf.tracking.message",
@@ -937,11 +939,47 @@
937
939
  ...GAME_SPECIFIC_CONFIG[gameId]
938
940
  };
939
941
  };
940
- var getBaseUrlForGame = (gameId) => {
942
+ var getBaseUrlForGame = (gameId, zoneId) => {
943
+ const gameZoneUrl = getBaseUrlForGameZone(gameId, zoneId);
944
+ if (gameZoneUrl) {
945
+ return gameZoneUrl;
946
+ }
941
947
  const baseUrl = COMMON_CONFIG.BASE_URL;
942
948
  const gameIdKey = String(gameId);
943
949
  return baseUrl[gameIdKey] || baseUrl.default || "";
944
950
  };
951
+ var getCustomizationUrlForGameZone = (gameId, zoneId) => {
952
+ if (!zoneId) {
953
+ return void 0;
954
+ }
955
+ const customizationUrlByGameZone = COMMON_CONFIG.CUSTOMIZATION_URL_BY_GAME_ZONE;
956
+ const gameZoneKey = `${gameId}-${zoneId}`;
957
+ if (typeof customizationUrlByGameZone === "string") {
958
+ try {
959
+ const parsed = JSON.parse(customizationUrlByGameZone);
960
+ return parsed[gameZoneKey];
961
+ } catch {
962
+ return void 0;
963
+ }
964
+ }
965
+ return customizationUrlByGameZone?.[gameZoneKey];
966
+ };
967
+ var getBaseUrlForGameZone = (gameId, zoneId) => {
968
+ if (!zoneId) {
969
+ return void 0;
970
+ }
971
+ const baseUrlByGameZone = COMMON_CONFIG.BASE_URL_BY_GAME_ZONE;
972
+ const gameZoneKey = `${gameId}-${zoneId}`;
973
+ if (typeof baseUrlByGameZone === "string") {
974
+ try {
975
+ const parsed = JSON.parse(baseUrlByGameZone);
976
+ return parsed[gameZoneKey];
977
+ } catch {
978
+ return void 0;
979
+ }
980
+ }
981
+ return baseUrlByGameZone?.[gameZoneKey];
982
+ };
945
983
 
946
984
  // src/utils/validation.ts
947
985
  init_define_process();
@@ -984,7 +1022,7 @@
984
1022
  if (store.adStatus?.areBannersAvailable) {
985
1023
  queryParameters.ads = true;
986
1024
  }
987
- const baseUrl = getBaseUrlForGame(store.gameId);
1025
+ const baseUrl = getBaseUrlForGame(store.gameId, store.zoneId);
988
1026
  return `${baseUrl}/?${formatQueryString(queryParameters)}${page ? `#${page}` : ""}${route ? `--${route}--${Date.now()}` : ""}`;
989
1027
  };
990
1028
  var createCustomizationUrl = () => {
@@ -994,6 +1032,10 @@
994
1032
  const configBase = (0, import_game_alias.acronym)(store.gameId);
995
1033
  const configVariance = store.customizationSuffix ? `-${store.customizationSuffix}` : "";
996
1034
  const configBranch = `${configBase}${configVariance}`;
1035
+ const gameZoneSpecificUrl = getCustomizationUrlForGameZone(store.gameId, store.zoneId);
1036
+ if (gameZoneSpecificUrl) {
1037
+ return gameZoneSpecificUrl.replace("{0}", configBranch);
1038
+ }
997
1039
  if (cxf.env === "test") {
998
1040
  const configVersion = new URLSearchParams(window.location.search).get("configGGS");
999
1041
  if (configVersion !== null) {