@inappstory/react-sdk 1.8.0-rc.13 → 1.8.0-rc.15

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.
@@ -3635,13 +3635,21 @@ let IamApi = (() => {
3635
3635
  ;// CONCATENATED MODULE: ../core/src/domain/inAppMessaging/models/appearanceOptions/iamCommonAppearanceOptions.ts
3636
3636
  class IamAppearanceCommonOptions {
3637
3637
  constructor(optionsDto) {
3638
+ var _a;
3638
3639
  Object.defineProperty(this, "background", {
3639
3640
  enumerable: true,
3640
3641
  configurable: true,
3641
3642
  writable: true,
3642
3643
  value: void 0
3643
3644
  });
3645
+ Object.defineProperty(this, "cardAppearance", {
3646
+ enumerable: true,
3647
+ configurable: true,
3648
+ writable: true,
3649
+ value: {}
3650
+ });
3644
3651
  this.background = this.mapBackgroundDtoToModel(optionsDto.background);
3652
+ this.cardAppearance = (_a = optionsDto.card_appearance) !== null && _a !== void 0 ? _a : {};
3645
3653
  }
3646
3654
  mapBackgroundDtoToModel(backgroundDto) {
3647
3655
  if (!backgroundDto || backgroundDto.alpha === 0)
@@ -10173,7 +10181,8 @@ let StoryViewModel = (() => {
10173
10181
  viewport: window,
10174
10182
  userResizeHandler: undefined,
10175
10183
  VODPlayer: this.storyManager.globalProperties.$videoOnDemand,
10176
- overlappingActionBarHeight: this.actionPanel.height
10184
+ overlappingActionBarHeight: this.actionPanel.height,
10185
+ useSdkCacheForMultislideMode: false
10177
10186
  });
10178
10187
  slideApi.setSdkClientVariables(this.storyManager.config.options);
10179
10188
  return slideApi;
@@ -10735,7 +10744,7 @@ class GameClientConfig {
10735
10744
  value: void 0
10736
10745
  });
10737
10746
  const storyManagerConfig = this.storyManager.config;
10738
- const sdkVersion = "1.8.0-rc.13";
10747
+ const sdkVersion = "1.8.0-rc.15";
10739
10748
  const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
10740
10749
  const session = this.storyManager.rootStore.sessionStore.session;
10741
10750
  this.sessionId = session.id;
@@ -12204,6 +12213,9 @@ class StorySlideApiHandlers {
12204
12213
  value: new NarrativeDataCache()
12205
12214
  });
12206
12215
  }
12216
+ onEvent(name, event) { }
12217
+ onCardLoadingStateChange(state) { }
12218
+ ;
12207
12219
  clearNarrativeSessionDataCache() {
12208
12220
  this.sessionNarrativeDataCache.clear();
12209
12221
  }
@@ -17395,7 +17407,16 @@ let IamMessageSlideViewModel = (() => {
17395
17407
  const { canClickNext } = this.slideApi.slideClickHandler(event.target, direction);
17396
17408
  this._disabledNextClick = !canClickNext;
17397
17409
  }
17398
- destroy() { }
17410
+ async destroy() {
17411
+ try {
17412
+ this.message.touchController.off(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
17413
+ document.removeEventListener("visibilitychange", this.handleDocumentVisibilityChange);
17414
+ await this.slideApi.destroy();
17415
+ }
17416
+ catch (error) {
17417
+ console.error(error);
17418
+ }
17419
+ }
17399
17420
  getNavigationDirection(event, currentTarget) {
17400
17421
  const xPercent = this.getClickPosition(event, currentTarget);
17401
17422
  const k = this.slideApi.layoutDirection === "ltr" ? 1 : -1;
@@ -17451,6 +17472,7 @@ let IamMessageSlideViewModel = (() => {
17451
17472
 
17452
17473
 
17453
17474
 
17475
+
17454
17476
  ;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessage/actions/openGameAction.ts
17455
17477
 
17456
17478
  class openGameAction_OpenGameAction {
@@ -17469,13 +17491,11 @@ class openGameAction_OpenGameAction {
17469
17491
  });
17470
17492
  }
17471
17493
  async handle(payload) {
17472
- var _a;
17473
17494
  try {
17474
17495
  await this.storyManager.openGame(payload.gameInstanceId);
17475
- (_a = this.iamMessage.activeSlide) === null || _a === void 0 ? void 0 : _a.pauseAndLock();
17496
+ this.iamMessage.pauseAndLock();
17476
17497
  this.storyManager.gameReader.once(GameReaderEvent.Close, () => {
17477
- var _a;
17478
- (_a = this.iamMessage.activeSlide) === null || _a === void 0 ? void 0 : _a.resumeAndUnlock();
17498
+ this.iamMessage.resumeAndUnlock();
17479
17499
  });
17480
17500
  }
17481
17501
  catch (error) {
@@ -17779,7 +17799,12 @@ let IamReaderViewModel = (() => {
17779
17799
  });
17780
17800
  }
17781
17801
  createIamMessageViewModel(message) {
17782
- return new IamMessageViewModel(this, this.storyManager, message, this.iamStatisticsService);
17802
+ if (message.slides.length > 1) {
17803
+ return new IamMultiSlideMessageViewModel(this, this.storyManager, message, this.iamStatisticsService);
17804
+ }
17805
+ else {
17806
+ return new IamMessageViewModel(this, this.storyManager, message, this.iamStatisticsService);
17807
+ }
17783
17808
  }
17784
17809
  checkMessageNotOpened() {
17785
17810
  if (this.activeMessage)
@@ -17880,13 +17905,11 @@ class showStoryAction_ShowStoryAction {
17880
17905
  });
17881
17906
  }
17882
17907
  async handle(payload) {
17883
- var _a;
17884
17908
  try {
17885
17909
  await this.storyManager.showStory(payload.storyId);
17886
- (_a = this.message.activeSlide) === null || _a === void 0 ? void 0 : _a.pauseAndLock();
17910
+ this.message.pauseAndLock();
17887
17911
  this.storyManager.storyReader.once(StoryReaderEvent.Close, () => {
17888
- var _a;
17889
- (_a = this.message.activeSlide) === null || _a === void 0 ? void 0 : _a.resumeAndUnlock();
17912
+ this.message.resumeAndUnlock();
17890
17913
  });
17891
17914
  }
17892
17915
  catch (error) {
@@ -17926,6 +17949,7 @@ class narrativeDataCache_NarrativeDataCache {
17926
17949
 
17927
17950
 
17928
17951
 
17952
+
17929
17953
  class IamSlideApiHandlers {
17930
17954
  constructor(storyManager, iamReader, iamMessage, iamStatisticsService) {
17931
17955
  Object.defineProperty(this, "storyManager", {
@@ -17965,6 +17989,29 @@ class IamSlideApiHandlers {
17965
17989
  value: new narrativeDataCache_NarrativeDataCache()
17966
17990
  });
17967
17991
  }
17992
+ onEvent(name, event) {
17993
+ switch (name) {
17994
+ case "showSlide":
17995
+ if (this.iamMessage instanceof IamMultiSlideMessageViewModel) {
17996
+ this.iamMessage.onShowSlide(event.index);
17997
+ }
17998
+ break;
17999
+ }
18000
+ }
18001
+ onCardLoadingStateChange(state) {
18002
+ switch (state) {
18003
+ case 0 /* CARD_LOADING_STATE.LOADING */:
18004
+ this.iamMessage.showLoaderScreen();
18005
+ break;
18006
+ case 1 /* CARD_LOADING_STATE.LOADED */:
18007
+ this.iamMessage.hideErrorScreen();
18008
+ this.iamMessage.hideLoaderScreen();
18009
+ break;
18010
+ case 2 /* CARD_LOADING_STATE.LOADING_ERROR */:
18011
+ this.iamMessage.showErrorScreen();
18012
+ break;
18013
+ }
18014
+ }
17968
18015
  clearActiveNarrativeDataCache() {
17969
18016
  this.activeMessageNarrativeDataCache.clear();
17970
18017
  }
@@ -18074,8 +18121,7 @@ class IamSlideApiHandlers {
18074
18121
  share(id, config) { }
18075
18122
  shareSlideScreenshot(shareId, hideElementsSelector, shareText) { }
18076
18123
  showLayer(index) {
18077
- var _a;
18078
- (_a = this.iamMessage.activeSlide) === null || _a === void 0 ? void 0 : _a.showLayerByIndex(index);
18124
+ this.iamMessage.showLayerByIndex(index);
18079
18125
  }
18080
18126
  showCardSlide(slideIndex) { }
18081
18127
  cardShowNext() { }
@@ -18111,9 +18157,46 @@ class IamSlideApiHandlers {
18111
18157
  this.iamMessage.hideErrorScreen();
18112
18158
  }
18113
18159
  showToast(text) {
18114
- var _a;
18115
- (_a = this.iamMessage.activeSlide) === null || _a === void 0 ? void 0 : _a.showToast({ content: text });
18160
+ this.iamMessage.showToast({ content: text });
18161
+ }
18162
+ }
18163
+
18164
+ ;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessageSlide/nullIamMessageSlideViewModel.ts
18165
+ class NullIamMessageSlideViewModel {
18166
+ get isLoading() {
18167
+ return true;
18168
+ }
18169
+ get html() {
18170
+ return "";
18171
+ }
18172
+ get navigationDisabled() {
18173
+ return false;
18116
18174
  }
18175
+ async reload() {
18176
+ return {
18177
+ currentTime: Date.now()
18178
+ };
18179
+ }
18180
+ mute() { }
18181
+ unmute() { }
18182
+ notifyTimerEnd() { }
18183
+ pauseAndLock() { }
18184
+ resumeAndUnlock() { }
18185
+ async showLayerByIndex(index) { }
18186
+ setUserData(id, text) { }
18187
+ setShareComplete(id, isSuccess) { }
18188
+ notifySwipeUp(target) { }
18189
+ showToast(options) { }
18190
+ async init() { }
18191
+ async start() { }
18192
+ async restart() { }
18193
+ async resumeByApp() { }
18194
+ async pauseByApp() { }
18195
+ async resumeByUser() { }
18196
+ async pauseByUser() { }
18197
+ async stop() { }
18198
+ onClick(event, currentTarget) { }
18199
+ async destroy() { }
18117
18200
  }
18118
18201
 
18119
18202
  ;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessage/iamMessageViewModel.ts
@@ -18169,9 +18252,10 @@ var iamMessageViewModel_classPrivateFieldSet = (undefined && undefined.__classPr
18169
18252
 
18170
18253
 
18171
18254
 
18255
+
18172
18256
  let IamMessageViewModel = (() => {
18173
18257
  var _a, _IamMessageViewModel__isOnceOpened_accessor_storage, _IamMessageViewModel__$root_accessor_storage, _IamMessageViewModel__needShowErrorScreen_accessor_storage, _IamMessageViewModel__needShowLoaderScreen_accessor_storage;
18174
- let _classSuper = ViewModel;
18258
+ let _classSuper = events.EventEmitter;
18175
18259
  let _instanceExtraInitializers = [];
18176
18260
  let __isOnceOpened_decorators;
18177
18261
  let __isOnceOpened_initializers = [];
@@ -18274,7 +18358,8 @@ let IamMessageViewModel = (() => {
18274
18358
  return 0;
18275
18359
  }
18276
18360
  get activeSlide() {
18277
- return this._slides[this.activeSlideIndex];
18361
+ var _b;
18362
+ return (_b = this._slides[this.activeSlideIndex]) !== null && _b !== void 0 ? _b : new NullIamMessageSlideViewModel();
18278
18363
  }
18279
18364
  get slides() {
18280
18365
  return this._slides;
@@ -18288,11 +18373,6 @@ let IamMessageViewModel = (() => {
18288
18373
  get iterationId() {
18289
18374
  return this.iamMessage.iterationId;
18290
18375
  }
18291
- /**
18292
- 1 - Bottom sheet
18293
- 2 - Modal
18294
- 3 - Fullscreen
18295
- */
18296
18376
  get type() {
18297
18377
  return this.iamMessage.type;
18298
18378
  }
@@ -18319,17 +18399,17 @@ let IamMessageViewModel = (() => {
18319
18399
  return this.storyManager.rootStore.iamStore.updateMessageUserData(this.id, data);
18320
18400
  }
18321
18401
  async init() {
18322
- var _b;
18323
- await ((_b = this.activeSlide) === null || _b === void 0 ? void 0 : _b.init());
18402
+ await this.activeSlide.init();
18324
18403
  }
18325
18404
  async start() {
18326
- var _b;
18327
- await ((_b = this.activeSlide) === null || _b === void 0 ? void 0 : _b.start());
18405
+ await this.activeSlide.start();
18328
18406
  }
18329
18407
  async stop() {
18330
- var _b;
18331
18408
  this.slideApiHandlers.clearActiveNarrativeDataCache();
18332
- await ((_b = this.activeSlide) === null || _b === void 0 ? void 0 : _b.stop());
18409
+ await this.activeSlide.stop();
18410
+ }
18411
+ onClick(event, currentTarget) {
18412
+ this.activeSlide.onClick(event, currentTarget);
18333
18413
  }
18334
18414
  toPublicDto() {
18335
18415
  return this.iamMessage.toPublicDto();
@@ -18346,9 +18426,25 @@ let IamMessageViewModel = (() => {
18346
18426
  hideErrorScreen() {
18347
18427
  this._needShowErrorScreen = false;
18348
18428
  }
18349
- destroy() {
18429
+ async destroy() {
18350
18430
  var _b;
18351
- (_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.destroy();
18431
+ return (_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.destroy();
18432
+ }
18433
+ resumeAndUnlock() {
18434
+ this.activeSlide.resumeAndUnlock();
18435
+ }
18436
+ pauseAndLock() {
18437
+ this.activeSlide.resumeAndUnlock();
18438
+ }
18439
+ showLayerByIndex(index) {
18440
+ this.activeSlide.showLayerByIndex(index);
18441
+ }
18442
+ showToast(options) {
18443
+ this.activeSlide.showToast(options);
18444
+ }
18445
+ restart() {
18446
+ var _b;
18447
+ return (_b = this.activeSlide) === null || _b === void 0 ? void 0 : _b.restart();
18352
18448
  }
18353
18449
  createSlidesViewModels() {
18354
18450
  if (this._slides.length > 0)
@@ -18361,7 +18457,8 @@ let IamMessageViewModel = (() => {
18361
18457
  nonce: getNonce(),
18362
18458
  viewport: window,
18363
18459
  userResizeHandler: undefined,
18364
- VODPlayer: this.storyManager.globalProperties.$videoOnDemand
18460
+ VODPlayer: this.storyManager.globalProperties.$videoOnDemand,
18461
+ useSdkCacheForMultislideMode: false
18365
18462
  });
18366
18463
  this._slides = this.iamMessage.slides.map(slide => new IamMessageSlideViewModel(this, slide, slideApi));
18367
18464
  this.slideApi = slideApi;
@@ -18402,11 +18499,420 @@ let IamMessageViewModel = (() => {
18402
18499
  })();
18403
18500
 
18404
18501
 
18502
+ ;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessage/iamMultiSlideMessageViewModel.ts
18503
+ var iamMultiSlideMessageViewModel_runInitializers = (undefined && undefined.__runInitializers) || function (thisArg, initializers, value) {
18504
+ var useValue = arguments.length > 2;
18505
+ for (var i = 0; i < initializers.length; i++) {
18506
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
18507
+ }
18508
+ return useValue ? value : void 0;
18509
+ };
18510
+ var iamMultiSlideMessageViewModel_esDecorate = (undefined && undefined.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
18511
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
18512
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
18513
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
18514
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
18515
+ var _, done = false;
18516
+ for (var i = decorators.length - 1; i >= 0; i--) {
18517
+ var context = {};
18518
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
18519
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18520
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
18521
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
18522
+ if (kind === "accessor") {
18523
+ if (result === void 0) continue;
18524
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
18525
+ if (_ = accept(result.get)) descriptor.get = _;
18526
+ if (_ = accept(result.set)) descriptor.set = _;
18527
+ if (_ = accept(result.init)) initializers.unshift(_);
18528
+ }
18529
+ else if (_ = accept(result)) {
18530
+ if (kind === "field") initializers.unshift(_);
18531
+ else descriptor[key] = _;
18532
+ }
18533
+ }
18534
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
18535
+ done = true;
18536
+ };
18537
+ var iamMultiSlideMessageViewModel_classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
18538
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18539
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
18540
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
18541
+ };
18542
+ var iamMultiSlideMessageViewModel_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
18543
+ if (kind === "m") throw new TypeError("Private method is not writable");
18544
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
18545
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
18546
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
18547
+ };
18548
+
18549
+
18550
+
18551
+
18552
+
18553
+
18554
+
18555
+ const iamMultiSlideMessageViewModel_SWIPE_UP_THRESHOLD = 10;
18556
+ const iamMultiSlideMessageViewModel_SLIDE_CLICK_THRESHOLD = 0.3;
18557
+ let IamMultiSlideMessageViewModel = (() => {
18558
+ var _a, _IamMultiSlideMessageViewModel__isOnceOpened_accessor_storage, _IamMultiSlideMessageViewModel__$root_accessor_storage, _IamMultiSlideMessageViewModel__needShowErrorScreen_accessor_storage, _IamMultiSlideMessageViewModel__needShowLoaderScreen_accessor_storage, _IamMultiSlideMessageViewModel__disabledNextClick_accessor_storage;
18559
+ let _classSuper = events.EventEmitter;
18560
+ let _instanceExtraInitializers = [];
18561
+ let __isOnceOpened_decorators;
18562
+ let __isOnceOpened_initializers = [];
18563
+ let __isOnceOpened_extraInitializers = [];
18564
+ let __$root_decorators;
18565
+ let __$root_initializers = [];
18566
+ let __$root_extraInitializers = [];
18567
+ let __needShowErrorScreen_decorators;
18568
+ let __needShowErrorScreen_initializers = [];
18569
+ let __needShowErrorScreen_extraInitializers = [];
18570
+ let __needShowLoaderScreen_decorators;
18571
+ let __needShowLoaderScreen_initializers = [];
18572
+ let __needShowLoaderScreen_extraInitializers = [];
18573
+ let __disabledNextClick_decorators;
18574
+ let __disabledNextClick_initializers = [];
18575
+ let __disabledNextClick_extraInitializers = [];
18576
+ let _showErrorScreen_decorators;
18577
+ let _showLoaderScreen_decorators;
18578
+ let _hideLoaderScreen_decorators;
18579
+ let _hideErrorScreen_decorators;
18580
+ return _a = class IamMultiSlideMessageViewModel extends _classSuper {
18581
+ get _isOnceOpened() { return iamMultiSlideMessageViewModel_classPrivateFieldGet(this, _IamMultiSlideMessageViewModel__isOnceOpened_accessor_storage, "f"); }
18582
+ set _isOnceOpened(value) { iamMultiSlideMessageViewModel_classPrivateFieldSet(this, _IamMultiSlideMessageViewModel__isOnceOpened_accessor_storage, value, "f"); }
18583
+ get _$root() { return iamMultiSlideMessageViewModel_classPrivateFieldGet(this, _IamMultiSlideMessageViewModel__$root_accessor_storage, "f"); }
18584
+ set _$root(value) { iamMultiSlideMessageViewModel_classPrivateFieldSet(this, _IamMultiSlideMessageViewModel__$root_accessor_storage, value, "f"); }
18585
+ get _needShowErrorScreen() { return iamMultiSlideMessageViewModel_classPrivateFieldGet(this, _IamMultiSlideMessageViewModel__needShowErrorScreen_accessor_storage, "f"); }
18586
+ set _needShowErrorScreen(value) { iamMultiSlideMessageViewModel_classPrivateFieldSet(this, _IamMultiSlideMessageViewModel__needShowErrorScreen_accessor_storage, value, "f"); }
18587
+ get _needShowLoaderScreen() { return iamMultiSlideMessageViewModel_classPrivateFieldGet(this, _IamMultiSlideMessageViewModel__needShowLoaderScreen_accessor_storage, "f"); }
18588
+ set _needShowLoaderScreen(value) { iamMultiSlideMessageViewModel_classPrivateFieldSet(this, _IamMultiSlideMessageViewModel__needShowLoaderScreen_accessor_storage, value, "f"); }
18589
+ get _disabledNextClick() { return iamMultiSlideMessageViewModel_classPrivateFieldGet(this, _IamMultiSlideMessageViewModel__disabledNextClick_accessor_storage, "f"); }
18590
+ set _disabledNextClick(value) { iamMultiSlideMessageViewModel_classPrivateFieldSet(this, _IamMultiSlideMessageViewModel__disabledNextClick_accessor_storage, value, "f"); }
18591
+ constructor(iamReader, storyManager, iamMessage, iamStatisticsService) {
18592
+ super();
18593
+ Object.defineProperty(this, "iamReader", {
18594
+ enumerable: true,
18595
+ configurable: true,
18596
+ writable: true,
18597
+ value: (iamMultiSlideMessageViewModel_runInitializers(this, _instanceExtraInitializers), iamReader)
18598
+ });
18599
+ Object.defineProperty(this, "storyManager", {
18600
+ enumerable: true,
18601
+ configurable: true,
18602
+ writable: true,
18603
+ value: storyManager
18604
+ });
18605
+ Object.defineProperty(this, "iamMessage", {
18606
+ enumerable: true,
18607
+ configurable: true,
18608
+ writable: true,
18609
+ value: iamMessage
18610
+ });
18611
+ Object.defineProperty(this, "iamStatisticsService", {
18612
+ enumerable: true,
18613
+ configurable: true,
18614
+ writable: true,
18615
+ value: iamStatisticsService
18616
+ });
18617
+ Object.defineProperty(this, "toast", {
18618
+ enumerable: true,
18619
+ configurable: true,
18620
+ writable: true,
18621
+ value: null
18622
+ });
18623
+ Object.defineProperty(this, "slideApiHandlers", {
18624
+ enumerable: true,
18625
+ configurable: true,
18626
+ writable: true,
18627
+ value: void 0
18628
+ });
18629
+ _IamMultiSlideMessageViewModel__isOnceOpened_accessor_storage.set(this, iamMultiSlideMessageViewModel_runInitializers(this, __isOnceOpened_initializers, false));
18630
+ _IamMultiSlideMessageViewModel__$root_accessor_storage.set(this, (iamMultiSlideMessageViewModel_runInitializers(this, __isOnceOpened_extraInitializers), iamMultiSlideMessageViewModel_runInitializers(this, __$root_initializers, null)));
18631
+ _IamMultiSlideMessageViewModel__needShowErrorScreen_accessor_storage.set(this, (iamMultiSlideMessageViewModel_runInitializers(this, __$root_extraInitializers), iamMultiSlideMessageViewModel_runInitializers(this, __needShowErrorScreen_initializers, false)));
18632
+ _IamMultiSlideMessageViewModel__needShowLoaderScreen_accessor_storage.set(this, (iamMultiSlideMessageViewModel_runInitializers(this, __needShowErrorScreen_extraInitializers), iamMultiSlideMessageViewModel_runInitializers(this, __needShowLoaderScreen_initializers, false)));
18633
+ _IamMultiSlideMessageViewModel__disabledNextClick_accessor_storage.set(this, (iamMultiSlideMessageViewModel_runInitializers(this, __needShowLoaderScreen_extraInitializers), iamMultiSlideMessageViewModel_runInitializers(this, __disabledNextClick_initializers, false)));
18634
+ Object.defineProperty(this, "_activeSlideIndex", {
18635
+ enumerable: true,
18636
+ configurable: true,
18637
+ writable: true,
18638
+ value: (iamMultiSlideMessageViewModel_runInitializers(this, __disabledNextClick_extraInitializers), 0)
18639
+ });
18640
+ Object.defineProperty(this, "locked", {
18641
+ enumerable: true,
18642
+ configurable: true,
18643
+ writable: true,
18644
+ value: false
18645
+ });
18646
+ Object.defineProperty(this, "touchController", {
18647
+ enumerable: true,
18648
+ configurable: true,
18649
+ writable: true,
18650
+ value: void 0
18651
+ });
18652
+ Object.defineProperty(this, "slideApi", {
18653
+ enumerable: true,
18654
+ configurable: true,
18655
+ writable: true,
18656
+ value: void 0
18657
+ });
18658
+ Object.defineProperty(this, "attachRoot", {
18659
+ enumerable: true,
18660
+ configurable: true,
18661
+ writable: true,
18662
+ value: (el) => {
18663
+ this._$root = el;
18664
+ this.slideApi = this.createSlideApi();
18665
+ }
18666
+ });
18667
+ Object.defineProperty(this, "handleTouchEnd", {
18668
+ enumerable: true,
18669
+ configurable: true,
18670
+ writable: true,
18671
+ value: ({ dy }) => {
18672
+ if (!this.touchController)
18673
+ return;
18674
+ if (dy < iamMultiSlideMessageViewModel_SWIPE_UP_THRESHOLD && this.touchController.verticalSwipeGesture)
18675
+ this.slideApi.slideSwipeUpHandler();
18676
+ }
18677
+ });
18678
+ this.touchController = iamReader.touchController;
18679
+ this.slideApiHandlers = new IamSlideApiHandlers(this.storyManager, this.iamReader, this, this.iamStatisticsService);
18680
+ this.handleDocumentVisibilityChange = this.handleDocumentVisibilityChange.bind(this);
18681
+ }
18682
+ get id() {
18683
+ return this.iamMessage.id;
18684
+ }
18685
+ get $root() {
18686
+ return this._$root;
18687
+ }
18688
+ get activeSlideIndex() {
18689
+ return this._activeSlideIndex;
18690
+ }
18691
+ get slides() {
18692
+ return [];
18693
+ }
18694
+ get context() {
18695
+ return this.iamMessage.context;
18696
+ }
18697
+ get appearanceOptions() {
18698
+ return this.iamMessage.appearanceOptions;
18699
+ }
18700
+ get iterationId() {
18701
+ return this.iamMessage.iterationId;
18702
+ }
18703
+ get type() {
18704
+ return this.iamMessage.type;
18705
+ }
18706
+ get needShowErrorScreen() {
18707
+ return this._needShowErrorScreen;
18708
+ }
18709
+ get needShowLoaderScreen() {
18710
+ return this._needShowLoaderScreen;
18711
+ }
18712
+ get timeSinceLastShow() {
18713
+ return this.iamMessage.timeSinceLastShow;
18714
+ }
18715
+ get disableClose() {
18716
+ return this.iamMessage.disableClose;
18717
+ }
18718
+ open() {
18719
+ this._isOnceOpened = true;
18720
+ const iterationId = this.iamMessage.trackOpen();
18721
+ return {
18722
+ iterationId
18723
+ };
18724
+ }
18725
+ async updateUserData(data) {
18726
+ return this.storyManager.rootStore.iamStore.updateMessageUserData(this.id, data);
18727
+ }
18728
+ async init() {
18729
+ await this.slideApi.showSlides(this.iamMessage.slides.map(slide => slide.html), this.appearanceOptions.cardAppearance);
18730
+ }
18731
+ async start() {
18732
+ document.addEventListener("visibilitychange", this.handleDocumentVisibilityChange);
18733
+ this.touchController.on(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
18734
+ }
18735
+ async stop() {
18736
+ document.removeEventListener("visibilitychange", this.handleDocumentVisibilityChange);
18737
+ this.touchController.off(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
18738
+ }
18739
+ onClick(event, currentTarget) {
18740
+ if (!event.target || !this.slideApi)
18741
+ return;
18742
+ event.preventDefault();
18743
+ event.stopPropagation();
18744
+ const direction = this.getNavigationDirection(event, currentTarget);
18745
+ const { canClickNext } = this.slideApi.slideClickHandler(event.target, direction);
18746
+ this._disabledNextClick = !canClickNext;
18747
+ }
18748
+ toPublicDto() {
18749
+ return this.iamMessage.toPublicDto();
18750
+ }
18751
+ showErrorScreen() {
18752
+ this._needShowErrorScreen = true;
18753
+ }
18754
+ showLoaderScreen() {
18755
+ this._needShowLoaderScreen = true;
18756
+ }
18757
+ hideLoaderScreen() {
18758
+ this._needShowLoaderScreen = false;
18759
+ }
18760
+ hideErrorScreen() {
18761
+ this._needShowErrorScreen = false;
18762
+ }
18763
+ async destroy() {
18764
+ var _b;
18765
+ document.removeEventListener("visibilitychange", this.handleDocumentVisibilityChange);
18766
+ this.touchController.off(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
18767
+ return (_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.destroy();
18768
+ }
18769
+ async resumeAndUnlock() {
18770
+ var _b;
18771
+ try {
18772
+ this.locked = false;
18773
+ await ((_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.slideAppResume());
18774
+ }
18775
+ catch (error) {
18776
+ this.handleSlideError(error);
18777
+ }
18778
+ }
18779
+ async pauseAndLock() {
18780
+ var _b;
18781
+ try {
18782
+ this.locked = true;
18783
+ await ((_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.slideAppPause());
18784
+ }
18785
+ catch (error) {
18786
+ this.handleSlideError(error);
18787
+ }
18788
+ }
18789
+ showLayerByIndex(index) {
18790
+ var _b;
18791
+ (_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.showLayer(index);
18792
+ }
18793
+ showToast(options) {
18794
+ this.toast = new Toast(Object.assign(Object.assign({}, options), { mountPoint: this.$root }));
18795
+ this.toast.show(options.content);
18796
+ }
18797
+ onShowSlide(index) {
18798
+ this._activeSlideIndex = index;
18799
+ }
18800
+ async restart() {
18801
+ await this.init();
18802
+ }
18803
+ createSlideApi() {
18804
+ const isFullscreen = this.type === IamMessageType.Fullscreen;
18805
+ return new slide_api_namespaceObject.SlideApi(this.slideApiHandlers, {
18806
+ root: this._$root,
18807
+ slideRatio: this.getContentRatio(),
18808
+ isFullscreen,
18809
+ nonce: getNonce(),
18810
+ viewport: window,
18811
+ userResizeHandler: undefined,
18812
+ VODPlayer: this.storyManager.globalProperties.$videoOnDemand,
18813
+ useSdkCacheForMultislideMode: false
18814
+ });
18815
+ }
18816
+ getContentRatio() {
18817
+ if (this.appearanceOptions instanceof IamBottomSheetAppearanceOptions ||
18818
+ this.appearanceOptions instanceof IamModalAppearanceOptions)
18819
+ return this.appearanceOptions.contentRatio;
18820
+ return 9 / 16;
18821
+ }
18822
+ handleSlideError(error) {
18823
+ console.error(error);
18824
+ this.showErrorScreen();
18825
+ this.touchController.off(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
18826
+ }
18827
+ getNavigationDirection(event, currentTarget) {
18828
+ const xPercent = this.getClickPosition(event, currentTarget);
18829
+ const k = this.slideApi.layoutDirection === "ltr" ? 1 : -1;
18830
+ const direction = xPercent >= iamMultiSlideMessageViewModel_SLIDE_CLICK_THRESHOLD ? k : -k;
18831
+ return direction > 0 ? "forward" : "backward";
18832
+ }
18833
+ getClickPosition(event, currentTarget) {
18834
+ const rect = currentTarget.getBoundingClientRect();
18835
+ const width = rect.width;
18836
+ if (width <= 0)
18837
+ return 0;
18838
+ let x;
18839
+ if (event instanceof MouseEvent) {
18840
+ x = event.pageX - rect.left;
18841
+ }
18842
+ else if (event.touches && event.touches.length > 0) {
18843
+ x = event.touches[0].pageX - rect.left;
18844
+ }
18845
+ else {
18846
+ return 0;
18847
+ }
18848
+ return Math.max(0, Math.min(1, x / width));
18849
+ }
18850
+ handleDocumentVisibilityChange() {
18851
+ if (this.locked)
18852
+ return;
18853
+ if (document.visibilityState === "hidden")
18854
+ this.pauseByApp();
18855
+ if (document.visibilityState === "visible")
18856
+ this.resumeByApp();
18857
+ }
18858
+ async resumeByApp() {
18859
+ var _b;
18860
+ try {
18861
+ await ((_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.slideAppResume());
18862
+ }
18863
+ catch (error) {
18864
+ this.handleSlideError(error);
18865
+ }
18866
+ }
18867
+ async pauseByApp() {
18868
+ var _b;
18869
+ try {
18870
+ await ((_b = this.slideApi) === null || _b === void 0 ? void 0 : _b.slideAppPause());
18871
+ }
18872
+ catch (error) {
18873
+ this.handleSlideError(error);
18874
+ }
18875
+ }
18876
+ },
18877
+ _IamMultiSlideMessageViewModel__isOnceOpened_accessor_storage = new WeakMap(),
18878
+ _IamMultiSlideMessageViewModel__$root_accessor_storage = new WeakMap(),
18879
+ _IamMultiSlideMessageViewModel__needShowErrorScreen_accessor_storage = new WeakMap(),
18880
+ _IamMultiSlideMessageViewModel__needShowLoaderScreen_accessor_storage = new WeakMap(),
18881
+ _IamMultiSlideMessageViewModel__disabledNextClick_accessor_storage = new WeakMap(),
18882
+ (() => {
18883
+ var _b;
18884
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
18885
+ __isOnceOpened_decorators = [external_mobx_namespaceObject.observable];
18886
+ __$root_decorators = [external_mobx_namespaceObject.observable];
18887
+ __needShowErrorScreen_decorators = [external_mobx_namespaceObject.observable];
18888
+ __needShowLoaderScreen_decorators = [external_mobx_namespaceObject.observable];
18889
+ __disabledNextClick_decorators = [external_mobx_namespaceObject.observable];
18890
+ _showErrorScreen_decorators = [external_mobx_namespaceObject.action];
18891
+ _showLoaderScreen_decorators = [external_mobx_namespaceObject.action];
18892
+ _hideLoaderScreen_decorators = [external_mobx_namespaceObject.action];
18893
+ _hideErrorScreen_decorators = [external_mobx_namespaceObject.action];
18894
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, __isOnceOpened_decorators, { kind: "accessor", name: "_isOnceOpened", static: false, private: false, access: { has: obj => "_isOnceOpened" in obj, get: obj => obj._isOnceOpened, set: (obj, value) => { obj._isOnceOpened = value; } }, metadata: _metadata }, __isOnceOpened_initializers, __isOnceOpened_extraInitializers);
18895
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, __$root_decorators, { kind: "accessor", name: "_$root", static: false, private: false, access: { has: obj => "_$root" in obj, get: obj => obj._$root, set: (obj, value) => { obj._$root = value; } }, metadata: _metadata }, __$root_initializers, __$root_extraInitializers);
18896
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, __needShowErrorScreen_decorators, { kind: "accessor", name: "_needShowErrorScreen", static: false, private: false, access: { has: obj => "_needShowErrorScreen" in obj, get: obj => obj._needShowErrorScreen, set: (obj, value) => { obj._needShowErrorScreen = value; } }, metadata: _metadata }, __needShowErrorScreen_initializers, __needShowErrorScreen_extraInitializers);
18897
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, __needShowLoaderScreen_decorators, { kind: "accessor", name: "_needShowLoaderScreen", static: false, private: false, access: { has: obj => "_needShowLoaderScreen" in obj, get: obj => obj._needShowLoaderScreen, set: (obj, value) => { obj._needShowLoaderScreen = value; } }, metadata: _metadata }, __needShowLoaderScreen_initializers, __needShowLoaderScreen_extraInitializers);
18898
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, __disabledNextClick_decorators, { kind: "accessor", name: "_disabledNextClick", static: false, private: false, access: { has: obj => "_disabledNextClick" in obj, get: obj => obj._disabledNextClick, set: (obj, value) => { obj._disabledNextClick = value; } }, metadata: _metadata }, __disabledNextClick_initializers, __disabledNextClick_extraInitializers);
18899
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, _showErrorScreen_decorators, { kind: "method", name: "showErrorScreen", static: false, private: false, access: { has: obj => "showErrorScreen" in obj, get: obj => obj.showErrorScreen }, metadata: _metadata }, null, _instanceExtraInitializers);
18900
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, _showLoaderScreen_decorators, { kind: "method", name: "showLoaderScreen", static: false, private: false, access: { has: obj => "showLoaderScreen" in obj, get: obj => obj.showLoaderScreen }, metadata: _metadata }, null, _instanceExtraInitializers);
18901
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, _hideLoaderScreen_decorators, { kind: "method", name: "hideLoaderScreen", static: false, private: false, access: { has: obj => "hideLoaderScreen" in obj, get: obj => obj.hideLoaderScreen }, metadata: _metadata }, null, _instanceExtraInitializers);
18902
+ iamMultiSlideMessageViewModel_esDecorate(_a, null, _hideErrorScreen_decorators, { kind: "method", name: "hideErrorScreen", static: false, private: false, access: { has: obj => "hideErrorScreen" in obj, get: obj => obj.hideErrorScreen }, metadata: _metadata }, null, _instanceExtraInitializers);
18903
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
18904
+ })(),
18905
+ _a;
18906
+ })();
18907
+
18908
+
18405
18909
  ;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessage/index.ts
18406
18910
 
18407
18911
 
18408
18912
 
18409
18913
 
18914
+
18915
+
18410
18916
  ;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/index.ts
18411
18917
 
18412
18918
 
@@ -21008,7 +21514,7 @@ class UgcEditorStore {
21008
21514
  const session = await this.storyManager.rootStore.sessionStore.open();
21009
21515
  const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
21010
21516
  const storyManagerConfig = this.storyManager.config;
21011
- const sdkVersion = "1.8.0-rc.13";
21517
+ const sdkVersion = "1.8.0-rc.15";
21012
21518
  this._config = {
21013
21519
  sessionId: session.id,
21014
21520
  apiKey: storyManagerConfig.apiKey,
@@ -21439,7 +21945,7 @@ class StoryManager extends TypedEventEmitter {
21439
21945
  return this._userAgent;
21440
21946
  }
21441
21947
  get sdkVersionName() {
21442
- const sdkVersionName = "1.8.0-rc.13";
21948
+ const sdkVersionName = "1.8.0-rc.15";
21443
21949
  return sdkVersionName || "0.0.0";
21444
21950
  }
21445
21951
  get sdkVersionCode() {
@@ -23821,10 +24327,7 @@ const Loader = (0,external_mobx_react_lite_namespaceObject.observer)((props) =>
23821
24327
  const isLoading = props.needShowLoaderScreen;
23822
24328
  if (!isLoading && !needShowReloadBtn)
23823
24329
  return null;
23824
- return ((0,jsx_runtime_namespaceObject.jsx)("div", { className: (0,external_classnames_namespaceObject["default"])(Loader_loader_module["loader"]), style: {
23825
- "--loader-background": props.background,
23826
- "--loaderBackgroundColor": props.color
23827
- }, onClick: e => {
24330
+ return ((0,jsx_runtime_namespaceObject.jsx)("div", { className: (0,external_classnames_namespaceObject["default"])(Loader_loader_module["loader"]), style: Object.assign({ "--loader-background": props.background, "--loaderBackgroundColor": props.color }, props.style), onClick: e => {
23828
24331
  e.preventDefault();
23829
24332
  }, children: needShowReloadBtn ? ((0,jsx_runtime_namespaceObject.jsx)(RefreshIcon, { className: Loader_loader_module["loader__refresh-btn"], onClick: e => {
23830
24333
  e.stopPropagation();
@@ -27989,9 +28492,9 @@ let MessageViewFactory = (() => {
27989
28492
  })();
27990
28493
 
27991
28494
 
27992
- ;// CONCATENATED MODULE: ./src/InAppMessaging/components/MessageSlide/MessageSide.styles.ts
28495
+ ;// CONCATENATED MODULE: ./src/InAppMessaging/components/MessageSlide/MessageSlide.styles.ts
27993
28496
 
27994
- const messageSlideStyles = (0,external_lit_namespaceObject.css) `.slides-container{height:100%;width:100%;position:absolute;top:0;left:0;bottom:0;right:0}`;
28497
+ const messageSlideStyles = (0,external_lit_namespaceObject.css) `.slides-container{height:100%;width:100%;position:absolute;top:0;left:0;bottom:0;right:0}.slides-container .cards-slider{overflow:hidden}`;
27995
28498
 
27996
28499
  ;// CONCATENATED MODULE: ./src/InAppMessaging/components/MessageSlide/MessageSlide.ts
27997
28500
  var MessageSlide_esDecorate = (undefined && undefined.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
@@ -28097,12 +28600,11 @@ let MessageSlide = (() => {
28097
28600
  this.message.stop();
28098
28601
  }
28099
28602
  handleSlideClick(event) {
28100
- var _a;
28101
28603
  if (!event.currentTarget)
28102
28604
  return;
28103
28605
  event.preventDefault();
28104
28606
  event.stopPropagation();
28105
- (_a = this.message.activeSlide) === null || _a === void 0 ? void 0 : _a.onClick(event, event.currentTarget);
28607
+ this.message.onClick(event, event.currentTarget);
28106
28608
  }
28107
28609
  async initAndStartSlide() {
28108
28610
  const slidesContainer = this.slidesContainer;
@@ -28559,9 +29061,9 @@ let InAppMessagingReader = (() => {
28559
29061
  });
28560
29062
  }
28561
29063
  async handleReloadMessage() {
28562
- var _a, _b, _c;
29064
+ var _a, _b;
28563
29065
  try {
28564
- await ((_c = (_b = (_a = this.viewModel) === null || _a === void 0 ? void 0 : _a.activeMessage) === null || _b === void 0 ? void 0 : _b.activeSlide) === null || _c === void 0 ? void 0 : _c.restart());
29066
+ await ((_b = (_a = this.viewModel) === null || _a === void 0 ? void 0 : _a.activeMessage) === null || _b === void 0 ? void 0 : _b.restart());
28565
29067
  }
28566
29068
  catch (error) {
28567
29069
  console.error(error);