@orbit-software/sdk 1.87.17 → 1.88.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.
@@ -0,0 +1,8 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "mcp__acp__Edit",
5
+ "mcp__acp__Bash"
6
+ ]
7
+ }
8
+ }
@@ -1,2 +1,2 @@
1
1
  export declare function initGigapubAds(scriptHtml: string): Promise<void>;
2
- export declare function showGigapubAd<T extends boolean>(fallback?: () => Promise<boolean>): Promise<T>;
2
+ export declare function showGigapubAd<T extends boolean>(fallback?: () => Promise<boolean>, placementId?: string): Promise<T>;
@@ -1,3 +1,3 @@
1
1
  export declare function initMonetagAds(monetagHtml: string): Promise<string | null>;
2
- export declare function createMonetagFallbackFunction(monetagShowAdFnName: string | null): () => Promise<boolean>;
3
- export declare function showMonetagAdWithTimeout<T extends boolean>(monetagShowAdFnName: string | null, ymid: string): Promise<T>;
2
+ export declare function createMonetagFallbackFunction(monetagShowAdFnName: string | null, placementId?: string): () => Promise<boolean>;
3
+ export declare function showMonetagAdWithTimeout<T extends boolean>(monetagShowAdFnName: string | null, ymid: string, placementId?: string): Promise<T>;
package/dist/esm/sdk.mjs CHANGED
@@ -38,7 +38,7 @@ function promisify(e) {
38
38
  };
39
39
  }
40
40
  promisify.argumentNames = "__ES6-PROMISIFY--CUSTOM-ARGUMENTS__", promisify.Promise = void 0;
41
- const version = "1.87.17";
41
+ const version = "1.88.0";
42
42
  function getDefaultExportFromCjs$3(e) {
43
43
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
44
44
  }
@@ -20131,7 +20131,7 @@ var Rr, j0, Removable = (j0 = class {
20131
20131
  clearGcTimeout() {
20132
20132
  J(this, Rr) && (timeoutManager.clearTimeout(J(this, Rr)), Pe(this, Rr, void 0));
20133
20133
  }
20134
- }, Rr = new WeakMap(), j0), define_process_env_default$3 = { NODE_ENV: '"production"', version: '"1.87.17"' }, Ir, Ur, Jt, Mr, jt, $r, Or, Zt, or, B0, Query = (B0 = class extends Removable {
20134
+ }, Rr = new WeakMap(), j0), define_process_env_default$3 = { NODE_ENV: '"production"', version: '"1.88.0"' }, Ir, Ur, Jt, Mr, jt, $r, Or, Zt, or, B0, Query = (B0 = class extends Removable {
20135
20135
  constructor(t) {
20136
20136
  super();
20137
20137
  Je(this, Zt);
@@ -37628,7 +37628,7 @@ function delay(e, { signal: t } = {}) {
37628
37628
  t == null || t.addEventListener("abort", o, { once: !0 });
37629
37629
  });
37630
37630
  }
37631
- var define_process_env_default$2 = { NODE_ENV: '"production"', version: '"1.87.17"' }, win;
37631
+ var define_process_env_default$2 = { NODE_ENV: '"production"', version: '"1.88.0"' }, win;
37632
37632
  if (typeof window > "u") {
37633
37633
  var loc = {
37634
37634
  hostname: ""
@@ -52863,7 +52863,7 @@ const balance$4 = "Balance", topUp$4 = "Top Up", ads$4 = "Ads", adsOn$4 = "On",
52863
52863
  topUpModal,
52864
52864
  inventoryModal
52865
52865
  };
52866
- var define_process_env_default$1 = { NODE_ENV: '"production"', version: '"1.87.17"' };
52866
+ var define_process_env_default$1 = { NODE_ENV: '"production"', version: '"1.88.0"' };
52867
52867
  const resources = {
52868
52868
  en: {
52869
52869
  translation: en
@@ -53314,40 +53314,45 @@ async function initGigapubAds(e) {
53314
53314
  }, document.head.appendChild(i), console.log("Gigapub: script appended to head.");
53315
53315
  });
53316
53316
  }
53317
- async function showGigapubAd(e) {
53318
- const t = crypto.randomUUID();
53317
+ async function showGigapubAd(e, t) {
53318
+ const s = crypto.randomUUID();
53319
53319
  return !window.showGiga || typeof window.showGiga != "function" ? e ? (console.log("Gigapub: showGiga not available, using fallback."), mixpanel.track("ad_show_fallback", {
53320
53320
  message: "Gigapub showGiga function not available, using fallback.",
53321
53321
  ...getBaseAnalyticsParams(),
53322
53322
  ad_type: "gigapub",
53323
- transaction_id: t
53323
+ transaction_id: s,
53324
+ placement_id: t
53324
53325
  }), await e()) : (mixpanel.track("ad_show_error", {
53325
53326
  message: "Gigapub showGiga function not available",
53326
53327
  error_type: "function_unavailable",
53327
53328
  ...getBaseAnalyticsParams(),
53328
53329
  ad_type: "gigapub",
53329
- transaction_id: t
53330
- }), !1) : new Promise((s) => {
53330
+ transaction_id: s,
53331
+ placement_id: t
53332
+ }), !1) : new Promise((i) => {
53331
53333
  mixpanel.track("ad_show_started", {
53332
53334
  ...getBaseAnalyticsParams(),
53333
53335
  ad_type: "gigapub",
53334
- transaction_id: t
53335
- }), console.log("Gigapub: showing ad with transaction ID:", t), window.showGiga(null, t).then(() => {
53336
+ transaction_id: s,
53337
+ placement_id: t
53338
+ }), console.log("Gigapub: showing ad with transaction ID:", s), window.showGiga(t ?? null, s).then(() => {
53336
53339
  console.log("Gigapub ad finished successfully."), mixpanel.track("ad_show_success", {
53337
53340
  ...getBaseAnalyticsParams(),
53338
53341
  ad_type: "gigapub",
53339
- transaction_id: t
53340
- }), s(!0);
53341
- }).catch((i) => {
53342
- console.error("Gigapub ad error", i), mixpanel.track("ad_show_error", {
53342
+ transaction_id: s,
53343
+ placement_id: t
53344
+ }), i(!0);
53345
+ }).catch((a) => {
53346
+ console.error("Gigapub ad error", a), mixpanel.track("ad_show_error", {
53343
53347
  message: "Gigapub ad failed or was skipped",
53344
53348
  error_type: "exception",
53345
- error: i == null ? void 0 : i.toString(),
53346
- error_message: (i == null ? void 0 : i.message) || "Unknown error",
53349
+ error: a == null ? void 0 : a.toString(),
53350
+ error_message: (a == null ? void 0 : a.message) || "Unknown error",
53347
53351
  ...getBaseAnalyticsParams(),
53348
53352
  ad_type: "gigapub",
53349
- transaction_id: t
53350
- }), s(!1);
53353
+ transaction_id: s,
53354
+ placement_id: t
53355
+ }), i(!1);
53351
53356
  });
53352
53357
  });
53353
53358
  }
@@ -53392,49 +53397,54 @@ async function initMonetagAds(e) {
53392
53397
  return console.error("Monetag: failed to initialize.", t), null;
53393
53398
  }
53394
53399
  }
53395
- function createMonetagFallbackFunction(e) {
53400
+ function createMonetagFallbackFunction(e, t) {
53396
53401
  return async () => {
53397
- const t = window.game_id ? String(window.game_id) : "0";
53398
- return await showMonetagAdWithTimeout(e, t);
53402
+ const s = window.game_id ? String(window.game_id) : "0";
53403
+ return await showMonetagAdWithTimeout(e, s, t);
53399
53404
  };
53400
53405
  }
53401
- async function showMonetagAdWithTimeout(e, t) {
53406
+ async function showMonetagAdWithTimeout(e, t, s) {
53402
53407
  return console.log("showMonetagAdWithTimeout", e), e ? typeof window[e] != "function" ? (mixpanel.track("ad_show_error", {
53403
53408
  message: "Monetag ad function not found on window object",
53404
53409
  error_type: "function_unavailable",
53405
53410
  function_name: e,
53406
53411
  ...getBaseAnalyticsParams(),
53407
- ad_type: "monetag"
53408
- }), !1) : new Promise((i) => {
53409
- const a = document.createElement("iframe");
53410
- a.style.display = "none", document.body.appendChild(a);
53411
- const o = () => {
53412
- document.body.contains(a) && document.body.removeChild(a), window.removeEventListener("message", c), clearTimeout(l);
53413
- }, l = setTimeout(() => {
53414
- o(), mixpanel.track("ad_show_error", {
53412
+ ad_type: "monetag",
53413
+ placement_id: s
53414
+ }), !1) : new Promise((a) => {
53415
+ const o = document.createElement("iframe");
53416
+ o.style.display = "none", document.body.appendChild(o);
53417
+ const l = () => {
53418
+ document.body.contains(o) && document.body.removeChild(o), window.removeEventListener("message", u), clearTimeout(c);
53419
+ }, c = setTimeout(() => {
53420
+ l(), mixpanel.track("ad_show_error", {
53415
53421
  message: "Monetag ad request timed out after 5 seconds",
53416
53422
  error_type: "timeout",
53417
53423
  timeout_duration: 5e3,
53418
53424
  ...getBaseAnalyticsParams(),
53419
- ad_type: "monetag"
53420
- }), i(!1);
53421
- }, 5e3), c = (f) => {
53422
- f.source === a.contentWindow && (f.data.type === "monetag_ad_success" ? (o(), console.log("Monetag ad watched"), mixpanel.track("ad_show_success", {
53425
+ ad_type: "monetag",
53426
+ placement_id: s
53427
+ }), a(!1);
53428
+ }, 5e3), u = (d) => {
53429
+ d.source === o.contentWindow && (d.data.type === "monetag_ad_success" ? (l(), console.log("Monetag ad watched"), mixpanel.track("ad_show_success", {
53423
53430
  ...getBaseAnalyticsParams(),
53424
- ad_type: "monetag"
53425
- }), i(!0)) : f.data.type === "monetag_ad_error" ? (o(), console.log("Monetag ad failed or was skipped", f.data.error), mixpanel.track("ad_show_error", {
53431
+ ad_type: "monetag",
53432
+ placement_id: s
53433
+ }), a(!0)) : d.data.type === "monetag_ad_error" ? (l(), console.log("Monetag ad failed or was skipped", d.data.error), mixpanel.track("ad_show_error", {
53426
53434
  message: "Monetag ad failed or was skipped",
53427
53435
  error_type: "ad_failed",
53428
- error: f.data.error,
53436
+ error: d.data.error,
53429
53437
  ...getBaseAnalyticsParams(),
53430
- ad_type: "monetag"
53431
- }), i(!1)) : f.data.type === "monetag_ad_started" && (clearTimeout(l), mixpanel.track("ad_show_started", {
53438
+ ad_type: "monetag",
53439
+ placement_id: s
53440
+ }), a(!1)) : d.data.type === "monetag_ad_started" && (clearTimeout(c), mixpanel.track("ad_show_started", {
53432
53441
  ...getBaseAnalyticsParams(),
53433
- ad_type: "monetag"
53442
+ ad_type: "monetag",
53443
+ placement_id: s
53434
53444
  }), console.log("Monetag ad started, timeout cleared")));
53435
53445
  };
53436
- window.addEventListener("message", c);
53437
- const u = `
53446
+ window.addEventListener("message", u);
53447
+ const f = `
53438
53448
  <script>
53439
53449
  function safePostMessage(msg) {
53440
53450
  if (window.parent && typeof window.parent.postMessage === 'function') {
@@ -53444,19 +53454,19 @@ async function showMonetagAdWithTimeout(e, t) {
53444
53454
  try {
53445
53455
  // Отправляем сообщение что реклама начала показываться
53446
53456
  safePostMessage({ type: 'monetag_ad_started' });
53447
-
53457
+
53448
53458
  setTimeout(() => {
53449
53459
  // Проверяем наличие третьего элемента и его структуры в родительском окне
53450
53460
  if (!window.parent?.document?.documentElement?.children?.[2]) {
53451
- safePostMessage({
53452
- type: 'monetag_ad_error',
53453
- error: 'Third element does not have the expected structure with 3 children in parent window'
53461
+ safePostMessage({
53462
+ type: 'monetag_ad_error',
53463
+ error: 'Third element does not have the expected structure with 3 children in parent window'
53454
53464
  });
53455
53465
  return;
53456
53466
  }
53457
53467
  }, 5000);
53458
-
53459
- window.parent['${e}']({ ymid: '${t}', requestVar: 'orbit' })
53468
+
53469
+ window.parent['${e}']({ ymid: '${t}', requestVar: '${s ? `orbit-${s}` : "orbit"}' })
53460
53470
  .then(() => {
53461
53471
  safePostMessage({ type: 'monetag_ad_success' });
53462
53472
  })
@@ -53468,12 +53478,13 @@ async function showMonetagAdWithTimeout(e, t) {
53468
53478
  }
53469
53479
  <\/script>
53470
53480
  `;
53471
- a.contentWindow ? (a.contentWindow.document.open(), a.contentWindow.document.write(u), a.contentWindow.document.close()) : (o(), i(!1));
53481
+ o.contentWindow ? (o.contentWindow.document.open(), o.contentWindow.document.write(f), o.contentWindow.document.close()) : (l(), a(!1));
53472
53482
  }) : (mixpanel.track("ad_show_error", {
53473
53483
  message: "Monetag ad function name not found",
53474
53484
  error_type: "function_name_missing",
53475
53485
  ...getBaseAnalyticsParams(),
53476
- ad_type: "monetag"
53486
+ ad_type: "monetag",
53487
+ placement_id: s
53477
53488
  }), !1);
53478
53489
  }
53479
53490
  async function checkAdStatus(e) {
@@ -53707,7 +53718,7 @@ function throttleLeading(e, t) {
53707
53718
  return a - s >= t ? (s = a, e.apply(this, i)) : (console.log(`Function is throttled. Next call available in ${t - (a - s)}ms`), Promise.resolve(!1));
53708
53719
  };
53709
53720
  }
53710
- var define_process_env_default = { NODE_ENV: '"production"', version: '"1.87.17"' };
53721
+ var define_process_env_default = { NODE_ENV: '"production"', version: '"1.88.0"' };
53711
53722
  ensureViewportMetaTag();
53712
53723
  initSentry();
53713
53724
  const CloudStorageGetItem = promisify(WebApp.CloudStorage.getItem), CloudStorageSetItem = promisify(WebApp.CloudStorage.setItem), CloudStorageRemoveItem = promisify(WebApp.CloudStorage.removeItem), BASE_URL = "https://app.portalapp.games/sdk", G_MEASUREMENT_ID = "G-4RMXVE2K75", BANNER_HEIGHT = 60, bannerManager = new BannerManager({
@@ -54017,7 +54028,8 @@ const CryptoSteamSDK = {
54017
54028
  return console.log("The profile has ads disabled"), (c = CryptoSteamSDK.onAdEnd) == null || c.call(CryptoSteamSDK, !1), !1;
54018
54029
  if (adType && mixpanel.track("ad_show_requested", {
54019
54030
  ...getBaseAnalyticsParams(),
54020
- ad_type: adType
54031
+ ad_type: adType,
54032
+ placement_id: e.placementId
54021
54033
  }), adType === "tma")
54022
54034
  try {
54023
54035
  return await showAd(e), countRequestAd = ++countRequestAd, (u = CryptoSteamSDK.onAdEnd) == null || u.call(CryptoSteamSDK, !0), !0;
@@ -54027,7 +54039,11 @@ const CryptoSteamSDK = {
54027
54039
  if (adType === "monetag") {
54028
54040
  const T = `${(await CryptoSteamSDK.getProfile()).game_id}`;
54029
54041
  countRequestAd = ++countRequestAd;
54030
- const I = await showMonetagAdWithTimeout(monetagShowAdFnName, T);
54042
+ const I = await showMonetagAdWithTimeout(
54043
+ monetagShowAdFnName,
54044
+ T,
54045
+ e.placementId
54046
+ );
54031
54047
  return (d = CryptoSteamSDK.onAdEnd) == null || d.call(CryptoSteamSDK, I), I;
54032
54048
  }
54033
54049
  if (adType === "adsgram") {
@@ -54037,14 +54053,18 @@ const CryptoSteamSDK = {
54037
54053
  }
54038
54054
  if (adType === "gigapub") {
54039
54055
  countRequestAd = ++countRequestAd;
54040
- const C = createMonetagFallbackFunction(monetagShowAdFnName), T = await showGigapubAd(C);
54056
+ const C = createMonetagFallbackFunction(
54057
+ monetagShowAdFnName,
54058
+ e.placementId
54059
+ ), T = await showGigapubAd(C, e.placementId);
54041
54060
  return (m = CryptoSteamSDK.onAdEnd) == null || m.call(CryptoSteamSDK, T), T;
54042
54061
  }
54043
54062
  return console.log("Ad network not initialized or not supported"), mixpanel.track("ad_show_error", {
54044
54063
  ...getBaseAnalyticsParams(),
54045
54064
  message: "Ad network not initialized or not supported",
54046
54065
  ad_type: adType,
54047
- error_type: "unsupported_network"
54066
+ error_type: "unsupported_network",
54067
+ placement_id: e.placementId
54048
54068
  }), (y = CryptoSteamSDK.onAdEnd) == null || y.call(CryptoSteamSDK, !1), !1;
54049
54069
  } catch (b) {
54050
54070
  return console.error("Error in requestAd:", b), mixpanel.track("ad_show_error", {
@@ -54052,7 +54072,8 @@ const CryptoSteamSDK = {
54052
54072
  message: b instanceof Error ? b.message : "Unknown error in requestAd",
54053
54073
  error_type: "sdk_exception",
54054
54074
  ad_type: adType,
54055
- error: b instanceof Error ? b.toString() : String(b)
54075
+ error: b instanceof Error ? b.toString() : String(b),
54076
+ placement_id: e.placementId
54056
54077
  }), (g = CryptoSteamSDK.onAdEnd) == null || g.call(CryptoSteamSDK, !1), !1;
54057
54078
  }
54058
54079
  },
@@ -54065,7 +54086,8 @@ const CryptoSteamSDK = {
54065
54086
  return console.log("ads-1: first_launch"), (s = CryptoSteamSDK.onAdEnd) == null || s.call(CryptoSteamSDK, !1), !1;
54066
54087
  if (mixpanel.track("ad_show_requested", {
54067
54088
  ...getBaseAnalyticsParams(),
54068
- ad_type: adType
54089
+ ad_type: adType,
54090
+ placement_id: e.placementId
54069
54091
  }), adType === "tma")
54070
54092
  try {
54071
54093
  const p = await showAd(e);
@@ -54076,7 +54098,11 @@ const CryptoSteamSDK = {
54076
54098
  return console.error("Error showing reward ad", p), (a = CryptoSteamSDK.onAdEnd) == null || a.call(CryptoSteamSDK, !1), !1;
54077
54099
  }
54078
54100
  if (adType === "monetag") {
54079
- const m = `${(await CryptoSteamSDK.getProfile()).game_id}`, y = await showMonetagAdWithTimeout(monetagShowAdFnName, m);
54101
+ const m = `${(await CryptoSteamSDK.getProfile()).game_id}`, y = await showMonetagAdWithTimeout(
54102
+ monetagShowAdFnName,
54103
+ m,
54104
+ e.placementId
54105
+ );
54080
54106
  return (o = CryptoSteamSDK.onAdEnd) == null || o.call(CryptoSteamSDK, y), y;
54081
54107
  }
54082
54108
  if (adType === "adsgram") {
@@ -54084,14 +54110,18 @@ const CryptoSteamSDK = {
54084
54110
  return (l = CryptoSteamSDK.onAdEnd) == null || l.call(CryptoSteamSDK, p), p;
54085
54111
  }
54086
54112
  if (adType === "gigapub") {
54087
- const p = createMonetagFallbackFunction(monetagShowAdFnName), m = await showGigapubAd(p);
54088
- return await delay(1500), (c = CryptoSteamSDK.onAdEnd) == null || c.call(CryptoSteamSDK, m), m;
54113
+ const p = createMonetagFallbackFunction(
54114
+ monetagShowAdFnName,
54115
+ e.placementId
54116
+ ), m = await showGigapubAd(p, e.placementId);
54117
+ return await delay(2e3), (c = CryptoSteamSDK.onAdEnd) == null || c.call(CryptoSteamSDK, m), m;
54089
54118
  }
54090
54119
  return console.log("Ad network not initialized or not supported"), mixpanel.track("ad_show_error", {
54091
54120
  ...getBaseAnalyticsParams(),
54092
54121
  message: "Ad network not initialized or not supported",
54093
54122
  ad_type: adType,
54094
- error_type: "unsupported_network"
54123
+ error_type: "unsupported_network",
54124
+ placement_id: e.placementId
54095
54125
  }), (u = CryptoSteamSDK.onAdEnd) == null || u.call(CryptoSteamSDK, !1), !1;
54096
54126
  } catch (d) {
54097
54127
  return console.error("Error in requestRewardAd:", d), mixpanel.track("ad_show_error", {
@@ -54099,7 +54129,8 @@ const CryptoSteamSDK = {
54099
54129
  message: d instanceof Error ? d.message : "Unknown error in requestRewardAd",
54100
54130
  error_type: "sdk_exception",
54101
54131
  ad_type: adType,
54102
- error: d instanceof Error ? d.toString() : String(d)
54132
+ error: d instanceof Error ? d.toString() : String(d),
54133
+ placement_id: e.placementId
54103
54134
  }), (f = CryptoSteamSDK.onAdEnd) == null || f.call(CryptoSteamSDK, !1), !1;
54104
54135
  }
54105
54136
  },