@streamlayer/react 0.14.2 → 0.14.4

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/lib/es/index.js CHANGED
@@ -4348,10 +4348,10 @@ function Iy(e, t) {
4348
4348
  }
4349
4349
  }
4350
4350
  } else if (e[0] !== "+")
4351
- return Rt(e, n, r) || "";
4351
+ return jt(e, n, r) || "";
4352
4352
  return e;
4353
4353
  }
4354
- function Rt(e, t, n) {
4354
+ function jt(e, t, n) {
4355
4355
  if (e) {
4356
4356
  if (e[0] === "+") {
4357
4357
  if (e === "+")
@@ -4390,7 +4390,7 @@ function $y(e, t) {
4390
4390
  var y = at(a, T);
4391
4391
  if (e.indexOf(y) !== 0) {
4392
4392
  var k, b = e && e[0] !== "+";
4393
- return b ? (e = y + e, k = Rt(e, a, T)) : e = y, {
4393
+ return b ? (e = y + e, k = jt(e, a, T)) : e = y, {
4394
4394
  phoneDigits: e,
4395
4395
  value: k,
4396
4396
  country: a
@@ -4399,11 +4399,11 @@ function $y(e, t) {
4399
4399
  }
4400
4400
  d === !1 && a && e && e[0] === "+" && (e = ki(e, a, T)), e && a && m && (e = by(e, a, T)), e && e[0] !== "+" && (!a || d) && (e = "+" + e), !e && n && n[0] === "+" && (d ? a = void 0 : a = r), e === "+" && n && n[0] === "+" && n.length > 1 && (a = void 0);
4401
4401
  var S;
4402
- return e && (e[0] === "+" && (e === "+" || a && at(a, T).indexOf(e) === 0) ? S = void 0 : S = Rt(e, a, T)), S && (a = Kl(S, {
4402
+ return e && (e[0] === "+" && (e === "+" || a && at(a, T).indexOf(e) === 0) ? S = void 0 : S = jt(e, a, T)), S && (a = Kl(S, {
4403
4403
  country: a,
4404
4404
  countries: o,
4405
4405
  metadata: T
4406
- }), d === !1 && a && e && e[0] === "+" && (e = ki(e, a, T), S = Rt(e, a, T))), !a && s && (a = r || i()), {
4406
+ }), d === !1 && a && e && e[0] === "+" && (e = ki(e, a, T), S = jt(e, a, T))), !a && s && (a = r || i()), {
4407
4407
  phoneDigits: e,
4408
4408
  country: a,
4409
4409
  value: S
@@ -4705,7 +4705,7 @@ var Fy = /* @__PURE__ */ function(e) {
4705
4705
  // Convert the phone number to "national" format
4706
4706
  // when the user changes the selected country by hand.
4707
4707
  useNationalFormat: !x
4708
- }), re = Rt(J, $, L);
4708
+ }), re = jt(J, $, L);
4709
4709
  z && r.inputRef.current.focus(), r.setState({
4710
4710
  country: $,
4711
4711
  hasUserSelectedACountry: !0,
@@ -7230,20 +7230,20 @@ function Cg(e) {
7230
7230
  }
7231
7231
  }
7232
7232
  }
7233
- var tt = [], Lt = !1, gt, On = -1;
7233
+ var tt = [], Pt = !1, gt, On = -1;
7234
7234
  function Rg() {
7235
- !Lt || !gt || (Lt = !1, gt.length ? tt = gt.concat(tt) : On = -1, tt.length && ku());
7235
+ !Pt || !gt || (Pt = !1, gt.length ? tt = gt.concat(tt) : On = -1, tt.length && ku());
7236
7236
  }
7237
7237
  function ku() {
7238
- if (!Lt) {
7238
+ if (!Pt) {
7239
7239
  var e = hu(Rg);
7240
- Lt = !0;
7240
+ Pt = !0;
7241
7241
  for (var t = tt.length; t; ) {
7242
7242
  for (gt = tt, tt = []; ++On < t; )
7243
7243
  gt && gt[On].run();
7244
7244
  On = -1, t = tt.length;
7245
7245
  }
7246
- gt = null, Lt = !1, Cg(e);
7246
+ gt = null, Pt = !1, Cg(e);
7247
7247
  }
7248
7248
  }
7249
7249
  pe.nextTick = function(e) {
@@ -7251,7 +7251,7 @@ pe.nextTick = function(e) {
7251
7251
  if (arguments.length > 1)
7252
7252
  for (var n = 1; n < arguments.length; n++)
7253
7253
  t[n - 1] = arguments[n];
7254
- tt.push(new Nu(e, t)), tt.length === 1 && !Lt && hu(ku);
7254
+ tt.push(new Nu(e, t)), tt.length === 1 && !Pt && hu(ku);
7255
7255
  };
7256
7256
  function Nu(e, t) {
7257
7257
  this.fun = e, this.array = t;
@@ -13280,7 +13280,7 @@ const dh = l.makeMessageType(
13280
13280
  { no: 1, name: "default_channel", kind: "message", T: Bn },
13281
13281
  { no: 2, name: "channels", kind: "message", T: Bn, repeated: !0 }
13282
13282
  ]
13283
- ), jt = l.makeMessageType(
13283
+ ), xt = l.makeMessageType(
13284
13284
  "streamlayer.sdkSettings.SdkOverlaySettings",
13285
13285
  () => [
13286
13286
  { no: 4, name: "twitter", kind: "message", T: dh, oneof: "overlay_settings" },
@@ -13293,10 +13293,10 @@ const dh = l.makeMessageType(
13293
13293
  ), Nh = l.makeMessageType(
13294
13294
  "streamlayer.sdkSettings.SdkOverlayMeta",
13295
13295
  () => [
13296
- { no: 1, name: "organization", kind: "message", T: jt },
13297
- { no: 2, name: "global_preset", kind: "message", T: jt },
13298
- { no: 3, name: "preset", kind: "message", T: jt },
13299
- { no: 4, name: "stream", kind: "message", T: jt }
13296
+ { no: 1, name: "organization", kind: "message", T: xt },
13297
+ { no: 2, name: "global_preset", kind: "message", T: xt },
13298
+ { no: 3, name: "preset", kind: "message", T: xt },
13299
+ { no: 4, name: "stream", kind: "message", T: xt }
13300
13300
  ]
13301
13301
  ), ia = l.makeMessageType(
13302
13302
  "streamlayer.sdkSettings.SdkOverlay",
@@ -13316,7 +13316,7 @@ const dh = l.makeMessageType(
13316
13316
  T: 8
13317
13317
  /* ScalarType.BOOL */
13318
13318
  },
13319
- { no: 5, name: "settings", kind: "message", T: jt },
13319
+ { no: 5, name: "settings", kind: "message", T: xt },
13320
13320
  { no: 6, name: "meta", kind: "message", T: Nh },
13321
13321
  {
13322
13322
  no: 7,
@@ -13375,7 +13375,7 @@ l.makeMessageType(
13375
13375
  T: 8
13376
13376
  /* ScalarType.BOOL */
13377
13377
  },
13378
- { no: 5, name: "settings", kind: "message", T: jt },
13378
+ { no: 5, name: "settings", kind: "message", T: xt },
13379
13379
  {
13380
13380
  no: 8,
13381
13381
  name: "sdk_enable",
@@ -14404,7 +14404,7 @@ class rn extends oa {
14404
14404
  }
14405
14405
  }
14406
14406
  const sn = (e) => Ka(e);
14407
- var Pt = /* @__PURE__ */ ((e) => (e.ORGANIZATION = "ORGANIZATION", e.STREAM = "STREAM", e))(Pt || {});
14407
+ var wt = /* @__PURE__ */ ((e) => (e.ORGANIZATION = "ORGANIZATION", e.STREAM = "STREAM", e))(wt || {});
14408
14408
  const Q3 = {
14409
14409
  [ut.BETTING]: "betting",
14410
14410
  [ut.GAMES]: "games",
@@ -20283,7 +20283,7 @@ const VM = l.makeMessageType(
20283
20283
  }, MI = (e, t, n) => {
20284
20284
  e.transport = new U4(t.host), e.sdk.host = e.transport.host, e.transport.setSdkKey(t.sdkKey), n();
20285
20285
  };
20286
- var wt = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.INITIALIZATION = "initialization", e.READY = "ready", e.FAILED = "failed", e.SUSPENDED = "suspended", e))(wt || {});
20286
+ var Ct = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.INITIALIZATION = "initialization", e.READY = "ready", e.FAILED = "failed", e.SUSPENDED = "suspended", e))(Ct || {});
20287
20287
  const II = (e) => {
20288
20288
  const t = new De(_e(), "enabled"), n = new De(_e(
20289
20289
  "disabled"
@@ -20364,44 +20364,7 @@ class bI extends oa {
20364
20364
  }
20365
20365
  }
20366
20366
  const SI = (e, t, n) => {
20367
- e.store = new bI(e.transport), e.stores = e.store.getValues(), e.sdk.sdkStore = e.store.getStore(), e.sdk.organizationStore = () => e.stores.organizationSettings.getStore(), e.storeSubscribe = () => {
20368
- const a = (s, i) => {
20369
- if (i != null && i.overlays) {
20370
- s === Pt.STREAM && e.features.clear();
20371
- for (const o of i.overlays) {
20372
- const d = o.name;
20373
- e.features.has(d) ? e.updateFeature(o, s) : e.initFeature(o, s);
20374
- }
20375
- }
20376
- }, r = {
20377
- /**
20378
- * During the initial SDK initialization, it's imperative to initialize features first,
20379
- * followed by their direct subscriptions to store fields.
20380
- * This section is currently in development, and it's
20381
- * essential to implement checks to determine whether a feature
20382
- * has already been initialized. If it has, events related to
20383
- * that feature should be skipped. Conversely, if a feature is
20384
- * missing in the new settings, it should be deinitialized.
20385
- */
20386
- organizationSettings: (s) => {
20387
- if (s.data)
20388
- try {
20389
- a(Pt.ORGANIZATION, s.data);
20390
- } catch (i) {
20391
- console.log(i);
20392
- }
20393
- },
20394
- streamSettings: (s) => {
20395
- if (s.data)
20396
- try {
20397
- a(Pt.STREAM, s.data);
20398
- } catch (i) {
20399
- console.log(i);
20400
- }
20401
- }
20402
- };
20403
- e.store.subscribe(r);
20404
- }, e.storeUnsubscribe = () => {
20367
+ e.store = new bI(e.transport), e.stores = e.store.getValues(), e.sdk.sdkStore = e.store.getStore(), e.sdk.organizationStore = () => e.stores.organizationSettings.getStore(), e.storeUnsubscribe = () => {
20405
20368
  e.store.unsubscribe();
20406
20369
  }, n();
20407
20370
  };
@@ -20440,41 +20403,17 @@ const vI = async (e, t, n) => {
20440
20403
  }, e.sdk.logout = () => {
20441
20404
  e.auth.logout();
20442
20405
  }, e.sdk.getUserStore = () => e.stores.user.getStore(), e.sdk.isUserAuthorized = () => e.auth.isAuthenticated(), n();
20443
- };
20444
- class AI {
20445
- constructor() {
20446
- A(this, "queue");
20447
- A(this, "add", (t) => {
20448
- this.isNewNotify(t.id) ? this.queue.getStore().set([...this.queue.getValue() || [], t]) : console.log("skip notification:", t);
20449
- });
20450
- A(this, "getQueueStore", () => this.queue.getStore());
20451
- A(this, "isNewNotify", (t) => {
20452
- const n = localStorage.getItem(`opened:${t}`);
20453
- if (!n) {
20454
- const a = this.queue.getStore().get();
20455
- return !(a != null && a.find((r) => r.id === t));
20456
- }
20457
- return !n;
20458
- });
20459
- A(this, "markAsViewed", (t) => {
20460
- localStorage.setItem(`opened:${t}`, t);
20461
- });
20462
- this.queue = new De(_e([]), "notifications");
20463
- }
20464
- }
20465
- const EI = (e, t, n) => {
20466
- e.notifications = new AI(), e.addNotification = e.notifications.add, e.sdk.getNotificationsStore = () => e.notifications.getQueueStore(), n();
20467
- }, OI = (e, t, n) => {
20406
+ }, AI = (e, t, n) => {
20468
20407
  e.sdk = /* @__PURE__ */ Object.create(null), e.sdk.initializeApp = async () => {
20469
- e.storeSubscribe(), e.stores.enabled.setValue("on"), e.stores.status.setValue(wt.INITIALIZATION);
20408
+ e.storeSubscribe(), e.stores.enabled.setValue("on"), e.stores.status.setValue(Ct.INITIALIZATION);
20470
20409
  try {
20471
20410
  const a = await e.stores.organizationSettings.getValue();
20472
- return a ? (e.stores.status.setValue(wt.READY), { enabled: !!a }) : (e.stores.status.setValue(wt.FAILED), { err: "failed" });
20411
+ return a ? (e.stores.status.setValue(Ct.READY), { enabled: !!a }) : (e.stores.status.setValue(Ct.FAILED), { err: "failed" });
20473
20412
  } catch (a) {
20474
- return e.stores.enabled.setValue(), e.stores.status.setValue(wt.FAILED), { err: `${a}` };
20413
+ return e.stores.enabled.setValue(), e.stores.status.setValue(Ct.FAILED), { err: `${a}` };
20475
20414
  }
20476
20415
  }, e.sdk.disableApp = () => {
20477
- e.stores.enabled.setValue(), e.stores.status.setValue(wt.DISABLED), e.storeUnsubscribe();
20416
+ e.stores.enabled.setValue(), e.stores.status.setValue(Ct.DISABLED), e.storeUnsubscribe();
20478
20417
  }, e.sdk.createEventSession = (a) => {
20479
20418
  e.stores.providerStreamId.setValue(""), e.stores.providerStreamId.setValue(a);
20480
20419
  }, n();
@@ -20617,7 +20556,7 @@ const EI = (e, t, n) => {
20617
20556
  kind: F.Unary
20618
20557
  }
20619
20558
  }
20620
- }, DI = l.makeEnum(
20559
+ }, EI = l.makeEnum(
20621
20560
  "streamlayer.interactive.leaderboard.LeaderboardType",
20622
20561
  [
20623
20562
  { no: 0, name: "LEADERBOARD_TYPE_UNSET", localName: "UNSET" },
@@ -20634,7 +20573,7 @@ const EI = (e, t, n) => {
20634
20573
  T: 9
20635
20574
  /* ScalarType.STRING */
20636
20575
  },
20637
- { no: 2, name: "type", kind: "enum", T: l.getEnumType(DI) },
20576
+ { no: 2, name: "type", kind: "enum", T: l.getEnumType(EI) },
20638
20577
  {
20639
20578
  no: 3,
20640
20579
  name: "name",
@@ -20740,13 +20679,13 @@ const EI = (e, t, n) => {
20740
20679
  /* ScalarType.INT32 */
20741
20680
  }
20742
20681
  ]
20743
- ), _I = l.makeMessageType(
20682
+ ), OI = l.makeMessageType(
20744
20683
  "streamlayer.interactive.leaderboard.LeaderboardSummaryItem",
20745
20684
  () => [
20746
20685
  { no: 1, name: "summary", kind: "message", T: os },
20747
- { no: 2, name: "percentage", kind: "message", T: wI }
20686
+ { no: 2, name: "percentage", kind: "message", T: DI }
20748
20687
  ]
20749
- ), wI = l.makeMessageType(
20688
+ ), DI = l.makeMessageType(
20750
20689
  "streamlayer.interactive.leaderboard.LeaderboardSummaryItem.SummaryPercentage",
20751
20690
  () => [
20752
20691
  {
@@ -20765,7 +20704,7 @@ const EI = (e, t, n) => {
20765
20704
  }
20766
20705
  ],
20767
20706
  { localName: "LeaderboardSummaryItem_SummaryPercentage" }
20768
- ), CI = l.makeMessageType(
20707
+ ), _I = l.makeMessageType(
20769
20708
  "streamlayer.interactive.leaderboard.ListRequest",
20770
20709
  () => [
20771
20710
  { no: 1, name: "pagination", kind: "message", T: Jr },
@@ -20785,13 +20724,13 @@ const EI = (e, t, n) => {
20785
20724
  /* ScalarType.STRING */
20786
20725
  }
20787
20726
  ]
20788
- ), RI = l.makeMessageType(
20727
+ ), wI = l.makeMessageType(
20789
20728
  "streamlayer.interactive.leaderboard.ListResponse",
20790
20729
  () => [
20791
- { no: 1, name: "data", kind: "message", T: jI, repeated: !0 },
20792
- { no: 2, name: "meta", kind: "message", T: xI }
20730
+ { no: 1, name: "data", kind: "message", T: CI, repeated: !0 },
20731
+ { no: 2, name: "meta", kind: "message", T: RI }
20793
20732
  ]
20794
- ), jI = l.makeMessageType(
20733
+ ), CI = l.makeMessageType(
20795
20734
  "streamlayer.interactive.leaderboard.ListResponse.ListResponseData",
20796
20735
  () => [
20797
20736
  {
@@ -20811,7 +20750,7 @@ const EI = (e, t, n) => {
20811
20750
  { no: 3, name: "attributes", kind: "message", T: os }
20812
20751
  ],
20813
20752
  { localName: "ListResponse_ListResponseData" }
20814
- ), xI = l.makeMessageType(
20753
+ ), RI = l.makeMessageType(
20815
20754
  "streamlayer.interactive.leaderboard.ListResponse.ListResponseMeta",
20816
20755
  () => [
20817
20756
  {
@@ -20837,7 +20776,7 @@ const EI = (e, t, n) => {
20837
20776
  }
20838
20777
  ],
20839
20778
  { localName: "ListResponse_ListResponseMeta" }
20840
- ), LI = l.makeMessageType(
20779
+ ), jI = l.makeMessageType(
20841
20780
  "streamlayer.interactive.leaderboard.SummaryRequest",
20842
20781
  () => [
20843
20782
  {
@@ -20863,12 +20802,12 @@ const EI = (e, t, n) => {
20863
20802
  },
20864
20803
  { no: 4, name: "users_ids", kind: "scalar", T: 9, repeated: !0 }
20865
20804
  ]
20866
- ), PI = l.makeMessageType(
20805
+ ), xI = l.makeMessageType(
20867
20806
  "streamlayer.interactive.leaderboard.SummaryResponse",
20868
20807
  () => [
20869
- { no: 1, name: "data", kind: "message", T: UI }
20808
+ { no: 1, name: "data", kind: "message", T: LI }
20870
20809
  ]
20871
- ), UI = l.makeMessageType(
20810
+ ), LI = l.makeMessageType(
20872
20811
  "streamlayer.interactive.leaderboard.SummaryResponse.SummaryResponseData",
20873
20812
  () => [
20874
20813
  {
@@ -20885,10 +20824,10 @@ const EI = (e, t, n) => {
20885
20824
  T: 9
20886
20825
  /* ScalarType.STRING */
20887
20826
  },
20888
- { no: 3, name: "attributes", kind: "message", T: _I }
20827
+ { no: 3, name: "attributes", kind: "message", T: OI }
20889
20828
  ],
20890
20829
  { localName: "SummaryResponse_SummaryResponseData" }
20891
- ), FI = l.makeMessageType(
20830
+ ), PI = l.makeMessageType(
20892
20831
  "streamlayer.interactive.leaderboard.EventLeaderboardsRequest",
20893
20832
  () => [
20894
20833
  {
@@ -20906,12 +20845,12 @@ const EI = (e, t, n) => {
20906
20845
  /* ScalarType.STRING */
20907
20846
  }
20908
20847
  ]
20909
- ), zI = l.makeMessageType(
20848
+ ), UI = l.makeMessageType(
20910
20849
  "streamlayer.interactive.leaderboard.EventLeaderboardsResponse",
20911
20850
  () => [
20912
- { no: 2, name: "data", kind: "message", T: BI }
20851
+ { no: 2, name: "data", kind: "message", T: FI }
20913
20852
  ]
20914
- ), BI = l.makeMessageType(
20853
+ ), FI = l.makeMessageType(
20915
20854
  "streamlayer.interactive.leaderboard.EventLeaderboardsResponse.EventLeaderboardsResponseData",
20916
20855
  () => [
20917
20856
  {
@@ -20931,7 +20870,7 @@ const EI = (e, t, n) => {
20931
20870
  { no: 3, name: "attributes", kind: "message", T: ic }
20932
20871
  ],
20933
20872
  { localName: "EventLeaderboardsResponse_EventLeaderboardsResponseData" }
20934
- ), GI = l.makeMessageType(
20873
+ ), zI = l.makeMessageType(
20935
20874
  "streamlayer.interactive.leaderboard.EventLeaderboardRequest",
20936
20875
  () => [
20937
20876
  {
@@ -20951,13 +20890,13 @@ const EI = (e, t, n) => {
20951
20890
  { no: 3, name: "pagination", kind: "message", T: Jr },
20952
20891
  { no: 4, name: "sort", kind: "message", T: CT }
20953
20892
  ]
20954
- ), QI = l.makeMessageType(
20893
+ ), BI = l.makeMessageType(
20955
20894
  "streamlayer.interactive.leaderboard.EventLeaderboardResponse",
20956
20895
  () => [
20957
- { no: 1, name: "data", kind: "message", T: YI, repeated: !0 },
20958
- { no: 2, name: "meta", kind: "message", T: VI }
20896
+ { no: 1, name: "data", kind: "message", T: GI, repeated: !0 },
20897
+ { no: 2, name: "meta", kind: "message", T: QI }
20959
20898
  ]
20960
- ), YI = l.makeMessageType(
20899
+ ), GI = l.makeMessageType(
20961
20900
  "streamlayer.interactive.leaderboard.EventLeaderboardResponse.ListResponseData",
20962
20901
  () => [
20963
20902
  {
@@ -20977,7 +20916,7 @@ const EI = (e, t, n) => {
20977
20916
  { no: 3, name: "attributes", kind: "message", T: os }
20978
20917
  ],
20979
20918
  { localName: "EventLeaderboardResponse_ListResponseData" }
20980
- ), VI = l.makeMessageType(
20919
+ ), QI = l.makeMessageType(
20981
20920
  "streamlayer.interactive.leaderboard.EventLeaderboardResponse.ListResponseMeta",
20982
20921
  () => [
20983
20922
  {
@@ -21003,7 +20942,7 @@ const EI = (e, t, n) => {
21003
20942
  }
21004
20943
  ],
21005
20944
  { localName: "EventLeaderboardResponse_ListResponseMeta" }
21006
- ), WI = {
20945
+ ), YI = {
21007
20946
  typeName: "streamlayer.interactive.leaderboard.Leaderboard",
21008
20947
  methods: {
21009
20948
  /**
@@ -21011,8 +20950,8 @@ const EI = (e, t, n) => {
21011
20950
  */
21012
20951
  list: {
21013
20952
  name: "List",
21014
- I: CI,
21015
- O: RI,
20953
+ I: _I,
20954
+ O: wI,
21016
20955
  kind: F.Unary
21017
20956
  },
21018
20957
  /**
@@ -21020,8 +20959,8 @@ const EI = (e, t, n) => {
21020
20959
  */
21021
20960
  summary: {
21022
20961
  name: "Summary",
21023
- I: LI,
21024
- O: PI,
20962
+ I: jI,
20963
+ O: xI,
21025
20964
  kind: F.Unary
21026
20965
  },
21027
20966
  /**
@@ -21029,8 +20968,8 @@ const EI = (e, t, n) => {
21029
20968
  */
21030
20969
  eventLeaderboards: {
21031
20970
  name: "EventLeaderboards",
21032
- I: FI,
21033
- O: zI,
20971
+ I: PI,
20972
+ O: UI,
21034
20973
  kind: F.Unary
21035
20974
  },
21036
20975
  /**
@@ -21038,13 +20977,13 @@ const EI = (e, t, n) => {
21038
20977
  */
21039
20978
  eventLeaderboard: {
21040
20979
  name: "EventLeaderboard",
21041
- I: GI,
21042
- O: QI,
20980
+ I: zI,
20981
+ O: BI,
21043
20982
  kind: F.Unary
21044
20983
  }
21045
20984
  }
21046
- }, qI = (e, t, n) => {
21047
- const { client: a, queryKey: r } = n.createPromiseClient(WI, {
20985
+ }, VI = (e, t, n) => {
20986
+ const { client: a, queryKey: r } = n.createPromiseClient(YI, {
21048
20987
  method: "summary",
21049
20988
  params: [e, t]
21050
20989
  });
@@ -21057,7 +20996,7 @@ const EI = (e, t, n) => {
21057
20996
  })).data) == null ? void 0 : p.attributes;
21058
20997
  }
21059
20998
  });
21060
- }, HI = (e, t) => {
20999
+ }, WI = (e, t) => {
21061
21000
  const { client: n, queryKey: a } = t.createPromiseClient(it, { method: "syncQuestion", params: [e] });
21062
21001
  return t.nanoquery.createFetcherStore(a, {
21063
21002
  fetcher: async (r, s, i) => {
@@ -21069,7 +21008,7 @@ const EI = (e, t, n) => {
21069
21008
  })).data) == null ? void 0 : d.attributes : void 0;
21070
21009
  }
21071
21010
  });
21072
- }, ZI = (e, t) => {
21011
+ }, qI = (e, t) => {
21073
21012
  const { client: n } = t.createCallbackClient(it), a = zt({ eventId: e.get() || "", feedId: "" });
21074
21013
  return e.subscribe((s = "") => {
21075
21014
  a.set({ eventId: s, feedId: "" });
@@ -21078,10 +21017,10 @@ const EI = (e, t, n) => {
21078
21017
  a,
21079
21018
  { name: "feedSubscription" }
21080
21019
  );
21081
- }, KI = (e, t) => {
21020
+ }, HI = (e, t) => {
21082
21021
  const { client: n } = t.createCallbackClient(it);
21083
21022
  return t.addSubscription(n.questionSubscription, { questionId: e }, { name: "questionSubscription" });
21084
- }, JI = (e, t) => {
21023
+ }, ZI = (e, t) => {
21085
21024
  const { client: n, queryKey: a } = t.createPromiseClient(it, { method: "questionByUser", params: [e] });
21086
21025
  return t.nanoquery.createFetcherStore(a, {
21087
21026
  fetcher: async (r, s, i) => {
@@ -21091,7 +21030,7 @@ const EI = (e, t, n) => {
21091
21030
  })).data) == null ? void 0 : d.attributes) == null ? void 0 : m.question;
21092
21031
  }
21093
21032
  });
21094
- }, XI = (e, t) => {
21033
+ }, KI = (e, t) => {
21095
21034
  const { client: n, queryKey: a } = t.createPromiseClient(it, { method: "pickHistory", params: [e] });
21096
21035
  return t.nanoquery.createFetcherStore(a, {
21097
21036
  fetcher: async (r, s, i) => {
@@ -21101,7 +21040,7 @@ const EI = (e, t, n) => {
21101
21040
  })).data) == null ? void 0 : d.map(({ attributes: m }) => m) : void 0;
21102
21041
  }
21103
21042
  });
21104
- }, eb = (e, t) => {
21043
+ }, JI = (e, t) => {
21105
21044
  const { client: n, queryKey: a } = t.createPromiseClient(it, { method: "insightHistory", params: [e] });
21106
21045
  return t.nanoquery.createFetcherStore(a, {
21107
21046
  fetcher: async (r, s, i) => {
@@ -21111,17 +21050,17 @@ const EI = (e, t, n) => {
21111
21050
  })).data) == null ? void 0 : d.map(({ attributes: m }) => m) : void 0;
21112
21051
  }
21113
21052
  });
21114
- }, tb = (e, t) => {
21053
+ }, XI = (e, t) => {
21115
21054
  const { client: n } = e.createPromiseClient(it, { method: "submitAnswer" });
21116
21055
  return n.submitAnswer({ data: t });
21117
- }, nb = (e, t) => {
21056
+ }, eb = (e, t) => {
21118
21057
  const { client: n } = e.createPromiseClient(it, { method: "submitInplay" });
21119
21058
  return n.submitInplay({ data: { eventId: +t } });
21120
- }, ab = (e, t) => {
21059
+ }, tb = (e, t) => {
21121
21060
  const { client: n } = e.createPromiseClient(it, { method: "skipQuestion" });
21122
21061
  return n.skipQuestion({ data: { id: t } });
21123
21062
  };
21124
- class rb extends qu {
21063
+ class nb extends qu {
21125
21064
  constructor(n, a, r) {
21126
21065
  super(n, a);
21127
21066
  // user statistics (leaderboard panel)
@@ -21185,23 +21124,23 @@ class rb extends qu {
21185
21124
  A(this, "connect", (n) => {
21186
21125
  var a;
21187
21126
  this.userSummary = new Fe(
21188
- qI(this.slStreamId, this.userId, n),
21127
+ VI(this.slStreamId, this.userId, n),
21189
21128
  "gamification:userSummary"
21190
21129
  ), this.questions = new Fe(
21191
- XI(this.slStreamId, n),
21130
+ KI(this.slStreamId, n),
21192
21131
  "gamification:questions"
21193
21132
  ), this.insights = new Fe(
21194
- eb(this.slStreamId, n),
21133
+ JI(this.slStreamId, n),
21195
21134
  "gamification:insights"
21196
21135
  ), this.activeQuestionId = new Fe(
21197
- HI(this.slStreamId, n),
21136
+ WI(this.slStreamId, n),
21198
21137
  "gamification:activeQuestionId"
21199
21138
  ), this.openedQuestion = new Fe(
21200
- JI(this.openedQuestionId, n),
21139
+ ZI(this.openedQuestionId, n),
21201
21140
  "gamification:activeQuestionId"
21202
21141
  ), this.questionSubscription && (this.questionSubscription.disconnect(), this.questionSubscription = void 0), this.openedQuestionId.listen((r) => {
21203
21142
  var s;
21204
- r ? (this.questionSubscription = KI(r, n), this.questionSubscription.addListener(
21143
+ r ? (this.questionSubscription = HI(r, n), this.questionSubscription.addListener(
21205
21144
  "feed-subscription-opened-question",
21206
21145
  (i) => {
21207
21146
  window.requestAnimationFrame(() => {
@@ -21220,7 +21159,7 @@ class rb extends qu {
21220
21159
  id: this.getCurrentSessionIdPrefix({ prefix: `notification-id:${r.data.question.id}` }),
21221
21160
  data: r.data
21222
21161
  }));
21223
- }), this.feedSubscription && (this.feedSubscription.disconnect(), this.feedSubscription = void 0), this.feedSubscription = ZI(this.slStreamId, n), this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
21162
+ }), this.feedSubscription && (this.feedSubscription.disconnect(), this.feedSubscription = void 0), this.feedSubscription = qI(this.slStreamId, n), this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
21224
21163
  window.requestAnimationFrame(() => {
21225
21164
  var i, o;
21226
21165
  const s = (i = this.activeQuestionId) == null ? void 0 : i.getStore();
@@ -21240,15 +21179,15 @@ class rb extends qu {
21240
21179
  // onboarding
21241
21180
  A(this, "submitInplay", async () => {
21242
21181
  const n = this.slStreamId.get();
21243
- n && (await nb(this.transport, n), this.onbordingComplete.set(!0), localStorage.setItem(`sl-onbording:${this.userId.get()}:${n}`, "true"));
21182
+ n && (await eb(this.transport, n), this.onbordingComplete.set(!0), localStorage.setItem(`sl-onbording:${this.userId.get()}:${n}`, "true"));
21244
21183
  });
21245
21184
  A(this, "submitAnswer", async (n, a) => {
21246
21185
  var r;
21247
- await tb(this.transport, { questionId: n, answerId: a }), (r = this.questions) == null || r.invalidate();
21186
+ await XI(this.transport, { questionId: n, answerId: a }), (r = this.questions) == null || r.invalidate();
21248
21187
  });
21249
21188
  A(this, "skipQuestion", async (n) => {
21250
21189
  var a;
21251
- await ab(this.transport, n), (a = this.questions) == null || a.invalidate();
21190
+ await tb(this.transport, n), (a = this.questions) == null || a.invalidate();
21252
21191
  });
21253
21192
  A(this, "openQuestion", (n) => {
21254
21193
  this.openedQuestionId.set(n), this.notifications.markAsViewed(this.getCurrentSessionIdPrefix({ prefix: `notification-id:${n}` }));
@@ -21282,15 +21221,15 @@ class rb extends qu {
21282
21221
  });
21283
21222
  }
21284
21223
  }
21285
- class sb extends qu {
21224
+ class ab extends qu {
21286
21225
  }
21287
- const ib = (e, t, n) => e.type === ut.GAMES ? new rb(e, t, n) : new sb(e, t), ob = (e, t, n) => {
21226
+ const rb = (e, t, n) => e.type === ut.GAMES ? new nb(e, t, n) : new ab(e, t), sb = (e, t, n) => {
21288
21227
  e.features = /* @__PURE__ */ new Map(), e.activeFeature = new De(_e(), "activeFeature"), e.sdk.getFeatures = () => e.features, e.sdk.getActiveFeature = () => e.activeFeature.getStore(), e.sdk.openFeature = (a) => {
21289
21228
  e.activeFeature.setValue(a);
21290
21229
  }, e.sdk.closeFeature = () => {
21291
21230
  e.activeFeature.setValue(void 0);
21292
- }, e.initFeature = (a, r = Pt.ORGANIZATION) => {
21293
- const s = ib(a, r, e);
21231
+ }, e.initFeature = (a, r = wt.ORGANIZATION) => {
21232
+ const s = rb(a, r, e);
21294
21233
  e.features.set(a.name, s);
21295
21234
  }, e.updateFeature = (a, r) => {
21296
21235
  var s;
@@ -21301,10 +21240,71 @@ const ib = (e, t, n) => e.type === ut.GAMES ? new rb(e, t, n) : new sb(e, t), ob
21301
21240
  const a = await e.stores.organizationSettings.getValue();
21302
21241
  e.features.clear();
21303
21242
  for (const r of (a == null ? void 0 : a.overlays) || [])
21304
- e.initFeature(r, Pt.ORGANIZATION);
21243
+ e.initFeature(r, wt.ORGANIZATION);
21305
21244
  }, e.stores.providerStreamId.listen((a) => {
21306
21245
  a || e.reinitializeFeatures();
21307
- }), n();
21246
+ }), e.storeSubscribe = () => {
21247
+ const a = (s, i) => {
21248
+ if (i != null && i.overlays) {
21249
+ s === wt.STREAM && e.features.clear();
21250
+ for (const o of i.overlays) {
21251
+ const d = o.name;
21252
+ e.features.has(d) ? e.updateFeature(o, s) : e.initFeature(o, s);
21253
+ }
21254
+ }
21255
+ }, r = {
21256
+ /**
21257
+ * During the initial SDK initialization, it's imperative to initialize features first,
21258
+ * followed by their direct subscriptions to store fields.
21259
+ * This section is currently in development, and it's
21260
+ * essential to implement checks to determine whether a feature
21261
+ * has already been initialized. If it has, events related to
21262
+ * that feature should be skipped. Conversely, if a feature is
21263
+ * missing in the new settings, it should be deinitialized.
21264
+ */
21265
+ organizationSettings: (s) => {
21266
+ if (s.data)
21267
+ try {
21268
+ a(wt.ORGANIZATION, s.data);
21269
+ } catch (i) {
21270
+ console.log(i);
21271
+ }
21272
+ },
21273
+ streamSettings: (s) => {
21274
+ if (s.data)
21275
+ try {
21276
+ a(wt.STREAM, s.data);
21277
+ } catch (i) {
21278
+ console.log(i);
21279
+ }
21280
+ }
21281
+ };
21282
+ e.store.subscribe(r);
21283
+ }, n();
21284
+ };
21285
+ class ib {
21286
+ constructor() {
21287
+ A(this, "queue");
21288
+ A(this, "add", (t) => {
21289
+ this.isNewNotify(t.id) ? this.queue.getStore().set([...this.queue.getValue() || [], t]) : console.log("skip notification:", t);
21290
+ });
21291
+ A(this, "getQueueStore", () => this.queue.getStore());
21292
+ A(this, "isNewNotify", (t) => {
21293
+ const n = localStorage.getItem(`opened:${t}`);
21294
+ if (!n) {
21295
+ const a = this.queue.getStore().get();
21296
+ return !(a != null && a.find((r) => r.id === t));
21297
+ }
21298
+ return !n;
21299
+ });
21300
+ A(this, "markAsViewed", (t) => {
21301
+ localStorage.setItem(`opened:${t}`, t);
21302
+ });
21303
+ this.queue = new De(_e([]), "notifications");
21304
+ }
21305
+ }
21306
+ const ob = (e, t, n) => {
21307
+ e.notifications = new ib(), e.addNotification = e.notifications.add, e.sdk.getNotificationsStore = () => e.notifications.getQueueStore(), n();
21308
21308
  };
21309
21309
  var ls = { exports: {} }, us = { exports: {} };
21310
21310
  function lb(e) {
@@ -21772,16 +21772,16 @@ var Pa = function() {
21772
21772
  }
21773
21773
  }() : Pa, Dt = Mb(), Rb = bb(), Te = Object.getPrototypeOf || (Rb ? function(e) {
21774
21774
  return e.__proto__;
21775
- } : null), Ct = {}, jb = typeof Uint8Array > "u" || !Te ? K : Te(Uint8Array), Nt = {
21775
+ } : null), Rt = {}, jb = typeof Uint8Array > "u" || !Te ? K : Te(Uint8Array), Nt = {
21776
21776
  "%AggregateError%": typeof AggregateError > "u" ? K : AggregateError,
21777
21777
  "%Array%": Array,
21778
21778
  "%ArrayBuffer%": typeof ArrayBuffer > "u" ? K : ArrayBuffer,
21779
21779
  "%ArrayIteratorPrototype%": Dt && Te ? Te([][Symbol.iterator]()) : K,
21780
21780
  "%AsyncFromSyncIteratorPrototype%": K,
21781
- "%AsyncFunction%": Ct,
21782
- "%AsyncGenerator%": Ct,
21783
- "%AsyncGeneratorFunction%": Ct,
21784
- "%AsyncIteratorPrototype%": Ct,
21781
+ "%AsyncFunction%": Rt,
21782
+ "%AsyncGenerator%": Rt,
21783
+ "%AsyncGeneratorFunction%": Rt,
21784
+ "%AsyncIteratorPrototype%": Rt,
21785
21785
  "%Atomics%": typeof Atomics > "u" ? K : Atomics,
21786
21786
  "%BigInt%": typeof BigInt > "u" ? K : BigInt,
21787
21787
  "%BigInt64Array%": typeof BigInt64Array > "u" ? K : BigInt64Array,
@@ -21801,7 +21801,7 @@ var Pa = function() {
21801
21801
  "%Float64Array%": typeof Float64Array > "u" ? K : Float64Array,
21802
21802
  "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? K : FinalizationRegistry,
21803
21803
  "%Function%": Mc,
21804
- "%GeneratorFunction%": Ct,
21804
+ "%GeneratorFunction%": Rt,
21805
21805
  "%Int8Array%": typeof Int8Array > "u" ? K : Int8Array,
21806
21806
  "%Int16Array%": typeof Int16Array > "u" ? K : Int16Array,
21807
21807
  "%Int32Array%": typeof Int32Array > "u" ? K : Int32Array,
@@ -21930,7 +21930,7 @@ var Lb = function e(t) {
21930
21930
  var a = t, r;
21931
21931
  if (Gn(Qo, a) && (r = Qo[a], a = "%" + r[0] + "%"), Gn(Nt, a)) {
21932
21932
  var s = Nt[a];
21933
- if (s === Ct && (s = Lb(a)), typeof s > "u" && !n)
21933
+ if (s === Rt && (s = Lb(a)), typeof s > "u" && !n)
21934
21934
  throw new Ft("intrinsic " + t + " exists, but is not available. Please file an issue!");
21935
21935
  return {
21936
21936
  alias: r,
@@ -22095,21 +22095,21 @@ var aS = nS ? pa : Oc, rS = Object.prototype.toString, sS = Function.prototype.t
22095
22095
  Fa = a ? Ua(a) : !1;
22096
22096
  }
22097
22097
  return Ua(t) === Fa;
22098
- }, _c = Function.prototype.toString, xt = typeof Reflect == "object" && Reflect !== null && Reflect.apply, Dr, Cn;
22099
- if (typeof xt == "function" && typeof Object.defineProperty == "function")
22098
+ }, _c = Function.prototype.toString, Lt = typeof Reflect == "object" && Reflect !== null && Reflect.apply, Dr, Cn;
22099
+ if (typeof Lt == "function" && typeof Object.defineProperty == "function")
22100
22100
  try {
22101
22101
  Dr = Object.defineProperty({}, "length", {
22102
22102
  get: function() {
22103
22103
  throw Cn;
22104
22104
  }
22105
- }), Cn = {}, xt(function() {
22105
+ }), Cn = {}, Lt(function() {
22106
22106
  throw 42;
22107
22107
  }, null, Dr);
22108
22108
  } catch (e) {
22109
- e !== Cn && (xt = null);
22109
+ e !== Cn && (Lt = null);
22110
22110
  }
22111
22111
  else
22112
- xt = null;
22112
+ Lt = null;
22113
22113
  var uS = /^\s*class\b/, _r = function(t) {
22114
22114
  try {
22115
22115
  var n = _c.call(t);
@@ -22138,13 +22138,13 @@ if (typeof document == "object") {
22138
22138
  return !1;
22139
22139
  });
22140
22140
  }
22141
- var kS = xt ? function(t) {
22141
+ var kS = Lt ? function(t) {
22142
22142
  if (wr(t))
22143
22143
  return !0;
22144
22144
  if (!t || typeof t != "function" && typeof t != "object")
22145
22145
  return !1;
22146
22146
  try {
22147
- xt(t, null, Dr);
22147
+ Lt(t, null, Dr);
22148
22148
  } catch (n) {
22149
22149
  if (n !== Cn)
22150
22150
  return !1;
@@ -23615,7 +23615,7 @@ var f9 = ls.exports;
23615
23615
  const p9 = /* @__PURE__ */ Pr(f9);
23616
23616
  function y9(e, t = !0) {
23617
23617
  const n = t ? "https://grpc-web.streamlayer.io:443" : "https://grpc-web.next.streamlayer.io:443", a = p9(/* @__PURE__ */ Object.create(null), { autostart: !1 });
23618
- return a.use(OI), a.use(MI, { sdkKey: e, host: n }), a.use(SI), a.use(vI), a.use(ob), a.use(EI), a.after(async (r, s, i) => {
23618
+ return a.use(AI), a.use(MI, { sdkKey: e, host: n }), a.use(SI), a.use(vI), a.use(sb), a.use(ob), a.after(async (r, s, i) => {
23619
23619
  if (r)
23620
23620
  throw r;
23621
23621
  await s.sdk.initializeApp(), i();