@inappstory/react-sdk 1.8.0-rc.12 → 1.8.0-rc.14
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/dist/index.esm.mjs +589 -50
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/package.json +2 -2
- package/plugins/banners/index.esm.mjs +1 -1
package/dist/index.esm.mjs
CHANGED
|
@@ -2406,11 +2406,39 @@ function queryCache(originalMethod, context) {
|
|
|
2406
2406
|
};
|
|
2407
2407
|
}
|
|
2408
2408
|
|
|
2409
|
+
;// CONCATENATED MODULE: ../core/src/helpers/decorators/safeCustomElement.ts
|
|
2410
|
+
/**
|
|
2411
|
+
* HMR-safe version of @customElement
|
|
2412
|
+
* Prevents an error when re-registering a component.
|
|
2413
|
+
*/
|
|
2414
|
+
function safeCustomElement(tagName) {
|
|
2415
|
+
return function (classDef, context) {
|
|
2416
|
+
const defineIfNeeded = (ctor) => {
|
|
2417
|
+
if (!customElements.get(tagName)) {
|
|
2418
|
+
customElements.define(tagName, ctor);
|
|
2419
|
+
}
|
|
2420
|
+
else {
|
|
2421
|
+
console.warn(`[IAS] Element "${tagName}" is already registered. Skipping re-definition`);
|
|
2422
|
+
}
|
|
2423
|
+
};
|
|
2424
|
+
// New decorator specification: context is available and has addInitializer
|
|
2425
|
+
if (context && typeof context.addInitializer === "function") {
|
|
2426
|
+
context.addInitializer(() => defineIfNeeded(classDef));
|
|
2427
|
+
}
|
|
2428
|
+
else {
|
|
2429
|
+
// Legacy-style decorators: just call define right away
|
|
2430
|
+
defineIfNeeded(classDef);
|
|
2431
|
+
}
|
|
2432
|
+
return classDef;
|
|
2433
|
+
};
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2409
2436
|
;// CONCATENATED MODULE: ../core/src/helpers/decorators/index.ts
|
|
2410
2437
|
|
|
2411
2438
|
|
|
2412
2439
|
|
|
2413
2440
|
|
|
2441
|
+
|
|
2414
2442
|
;// CONCATENATED MODULE: ../core/src/helpers/encodeSvg.ts
|
|
2415
2443
|
const symbols = /[\r\n%#()<>?[\\\]^`{|}]/g;
|
|
2416
2444
|
function encodeSVG(data, externalQuotesValue = "double") {
|
|
@@ -3607,13 +3635,21 @@ let IamApi = (() => {
|
|
|
3607
3635
|
;// CONCATENATED MODULE: ../core/src/domain/inAppMessaging/models/appearanceOptions/iamCommonAppearanceOptions.ts
|
|
3608
3636
|
class IamAppearanceCommonOptions {
|
|
3609
3637
|
constructor(optionsDto) {
|
|
3638
|
+
var _a;
|
|
3610
3639
|
Object.defineProperty(this, "background", {
|
|
3611
3640
|
enumerable: true,
|
|
3612
3641
|
configurable: true,
|
|
3613
3642
|
writable: true,
|
|
3614
3643
|
value: void 0
|
|
3615
3644
|
});
|
|
3645
|
+
Object.defineProperty(this, "cardAppearance", {
|
|
3646
|
+
enumerable: true,
|
|
3647
|
+
configurable: true,
|
|
3648
|
+
writable: true,
|
|
3649
|
+
value: {}
|
|
3650
|
+
});
|
|
3616
3651
|
this.background = this.mapBackgroundDtoToModel(optionsDto.background);
|
|
3652
|
+
this.cardAppearance = (_a = optionsDto.card_appearance) !== null && _a !== void 0 ? _a : {};
|
|
3617
3653
|
}
|
|
3618
3654
|
mapBackgroundDtoToModel(backgroundDto) {
|
|
3619
3655
|
if (!backgroundDto || backgroundDto.alpha === 0)
|
|
@@ -10145,7 +10181,8 @@ let StoryViewModel = (() => {
|
|
|
10145
10181
|
viewport: window,
|
|
10146
10182
|
userResizeHandler: undefined,
|
|
10147
10183
|
VODPlayer: this.storyManager.globalProperties.$videoOnDemand,
|
|
10148
|
-
overlappingActionBarHeight: this.actionPanel.height
|
|
10184
|
+
overlappingActionBarHeight: this.actionPanel.height,
|
|
10185
|
+
useSdkCacheForMultislideMode: false
|
|
10149
10186
|
});
|
|
10150
10187
|
slideApi.setSdkClientVariables(this.storyManager.config.options);
|
|
10151
10188
|
return slideApi;
|
|
@@ -10707,7 +10744,7 @@ class GameClientConfig {
|
|
|
10707
10744
|
value: void 0
|
|
10708
10745
|
});
|
|
10709
10746
|
const storyManagerConfig = this.storyManager.config;
|
|
10710
|
-
const sdkVersion = "1.8.0-rc.
|
|
10747
|
+
const sdkVersion = "1.8.0-rc.14";
|
|
10711
10748
|
const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
|
|
10712
10749
|
const session = this.storyManager.rootStore.sessionStore.session;
|
|
10713
10750
|
this.sessionId = session.id;
|
|
@@ -12176,6 +12213,9 @@ class StorySlideApiHandlers {
|
|
|
12176
12213
|
value: new NarrativeDataCache()
|
|
12177
12214
|
});
|
|
12178
12215
|
}
|
|
12216
|
+
onEvent(name, event) { }
|
|
12217
|
+
onCardLoadingStateChange(state) { }
|
|
12218
|
+
;
|
|
12179
12219
|
clearNarrativeSessionDataCache() {
|
|
12180
12220
|
this.sessionNarrativeDataCache.clear();
|
|
12181
12221
|
}
|
|
@@ -17367,7 +17407,16 @@ let IamMessageSlideViewModel = (() => {
|
|
|
17367
17407
|
const { canClickNext } = this.slideApi.slideClickHandler(event.target, direction);
|
|
17368
17408
|
this._disabledNextClick = !canClickNext;
|
|
17369
17409
|
}
|
|
17370
|
-
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
|
+
}
|
|
17371
17420
|
getNavigationDirection(event, currentTarget) {
|
|
17372
17421
|
const xPercent = this.getClickPosition(event, currentTarget);
|
|
17373
17422
|
const k = this.slideApi.layoutDirection === "ltr" ? 1 : -1;
|
|
@@ -17423,6 +17472,7 @@ let IamMessageSlideViewModel = (() => {
|
|
|
17423
17472
|
|
|
17424
17473
|
|
|
17425
17474
|
|
|
17475
|
+
|
|
17426
17476
|
;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessage/actions/openGameAction.ts
|
|
17427
17477
|
|
|
17428
17478
|
class openGameAction_OpenGameAction {
|
|
@@ -17441,13 +17491,11 @@ class openGameAction_OpenGameAction {
|
|
|
17441
17491
|
});
|
|
17442
17492
|
}
|
|
17443
17493
|
async handle(payload) {
|
|
17444
|
-
var _a;
|
|
17445
17494
|
try {
|
|
17446
17495
|
await this.storyManager.openGame(payload.gameInstanceId);
|
|
17447
|
-
|
|
17496
|
+
this.iamMessage.pauseAndLock();
|
|
17448
17497
|
this.storyManager.gameReader.once(GameReaderEvent.Close, () => {
|
|
17449
|
-
|
|
17450
|
-
(_a = this.iamMessage.activeSlide) === null || _a === void 0 ? void 0 : _a.resumeAndUnlock();
|
|
17498
|
+
this.iamMessage.resumeAndUnlock();
|
|
17451
17499
|
});
|
|
17452
17500
|
}
|
|
17453
17501
|
catch (error) {
|
|
@@ -17751,7 +17799,12 @@ let IamReaderViewModel = (() => {
|
|
|
17751
17799
|
});
|
|
17752
17800
|
}
|
|
17753
17801
|
createIamMessageViewModel(message) {
|
|
17754
|
-
|
|
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
|
+
}
|
|
17755
17808
|
}
|
|
17756
17809
|
checkMessageNotOpened() {
|
|
17757
17810
|
if (this.activeMessage)
|
|
@@ -17852,13 +17905,11 @@ class showStoryAction_ShowStoryAction {
|
|
|
17852
17905
|
});
|
|
17853
17906
|
}
|
|
17854
17907
|
async handle(payload) {
|
|
17855
|
-
var _a;
|
|
17856
17908
|
try {
|
|
17857
17909
|
await this.storyManager.showStory(payload.storyId);
|
|
17858
|
-
|
|
17910
|
+
this.message.pauseAndLock();
|
|
17859
17911
|
this.storyManager.storyReader.once(StoryReaderEvent.Close, () => {
|
|
17860
|
-
|
|
17861
|
-
(_a = this.message.activeSlide) === null || _a === void 0 ? void 0 : _a.resumeAndUnlock();
|
|
17912
|
+
this.message.resumeAndUnlock();
|
|
17862
17913
|
});
|
|
17863
17914
|
}
|
|
17864
17915
|
catch (error) {
|
|
@@ -17898,6 +17949,7 @@ class narrativeDataCache_NarrativeDataCache {
|
|
|
17898
17949
|
|
|
17899
17950
|
|
|
17900
17951
|
|
|
17952
|
+
|
|
17901
17953
|
class IamSlideApiHandlers {
|
|
17902
17954
|
constructor(storyManager, iamReader, iamMessage, iamStatisticsService) {
|
|
17903
17955
|
Object.defineProperty(this, "storyManager", {
|
|
@@ -17937,6 +17989,29 @@ class IamSlideApiHandlers {
|
|
|
17937
17989
|
value: new narrativeDataCache_NarrativeDataCache()
|
|
17938
17990
|
});
|
|
17939
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
|
+
}
|
|
17940
18015
|
clearActiveNarrativeDataCache() {
|
|
17941
18016
|
this.activeMessageNarrativeDataCache.clear();
|
|
17942
18017
|
}
|
|
@@ -18046,8 +18121,7 @@ class IamSlideApiHandlers {
|
|
|
18046
18121
|
share(id, config) { }
|
|
18047
18122
|
shareSlideScreenshot(shareId, hideElementsSelector, shareText) { }
|
|
18048
18123
|
showLayer(index) {
|
|
18049
|
-
|
|
18050
|
-
(_a = this.iamMessage.activeSlide) === null || _a === void 0 ? void 0 : _a.showLayerByIndex(index);
|
|
18124
|
+
this.iamMessage.showLayerByIndex(index);
|
|
18051
18125
|
}
|
|
18052
18126
|
showCardSlide(slideIndex) { }
|
|
18053
18127
|
cardShowNext() { }
|
|
@@ -18083,11 +18157,48 @@ class IamSlideApiHandlers {
|
|
|
18083
18157
|
this.iamMessage.hideErrorScreen();
|
|
18084
18158
|
}
|
|
18085
18159
|
showToast(text) {
|
|
18086
|
-
|
|
18087
|
-
(_a = this.iamMessage.activeSlide) === null || _a === void 0 ? void 0 : _a.showToast({ content: text });
|
|
18160
|
+
this.iamMessage.showToast({ content: text });
|
|
18088
18161
|
}
|
|
18089
18162
|
}
|
|
18090
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;
|
|
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() { }
|
|
18200
|
+
}
|
|
18201
|
+
|
|
18091
18202
|
;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessage/iamMessageViewModel.ts
|
|
18092
18203
|
var iamMessageViewModel_runInitializers = (undefined && undefined.__runInitializers) || function (thisArg, initializers, value) {
|
|
18093
18204
|
var useValue = arguments.length > 2;
|
|
@@ -18141,9 +18252,10 @@ var iamMessageViewModel_classPrivateFieldSet = (undefined && undefined.__classPr
|
|
|
18141
18252
|
|
|
18142
18253
|
|
|
18143
18254
|
|
|
18255
|
+
|
|
18144
18256
|
let IamMessageViewModel = (() => {
|
|
18145
18257
|
var _a, _IamMessageViewModel__isOnceOpened_accessor_storage, _IamMessageViewModel__$root_accessor_storage, _IamMessageViewModel__needShowErrorScreen_accessor_storage, _IamMessageViewModel__needShowLoaderScreen_accessor_storage;
|
|
18146
|
-
let _classSuper =
|
|
18258
|
+
let _classSuper = events.EventEmitter;
|
|
18147
18259
|
let _instanceExtraInitializers = [];
|
|
18148
18260
|
let __isOnceOpened_decorators;
|
|
18149
18261
|
let __isOnceOpened_initializers = [];
|
|
@@ -18246,7 +18358,8 @@ let IamMessageViewModel = (() => {
|
|
|
18246
18358
|
return 0;
|
|
18247
18359
|
}
|
|
18248
18360
|
get activeSlide() {
|
|
18249
|
-
|
|
18361
|
+
var _b;
|
|
18362
|
+
return (_b = this._slides[this.activeSlideIndex]) !== null && _b !== void 0 ? _b : new NullIamMessageSlideViewModel();
|
|
18250
18363
|
}
|
|
18251
18364
|
get slides() {
|
|
18252
18365
|
return this._slides;
|
|
@@ -18260,11 +18373,6 @@ let IamMessageViewModel = (() => {
|
|
|
18260
18373
|
get iterationId() {
|
|
18261
18374
|
return this.iamMessage.iterationId;
|
|
18262
18375
|
}
|
|
18263
|
-
/**
|
|
18264
|
-
1 - Bottom sheet
|
|
18265
|
-
2 - Modal
|
|
18266
|
-
3 - Fullscreen
|
|
18267
|
-
*/
|
|
18268
18376
|
get type() {
|
|
18269
18377
|
return this.iamMessage.type;
|
|
18270
18378
|
}
|
|
@@ -18291,17 +18399,17 @@ let IamMessageViewModel = (() => {
|
|
|
18291
18399
|
return this.storyManager.rootStore.iamStore.updateMessageUserData(this.id, data);
|
|
18292
18400
|
}
|
|
18293
18401
|
async init() {
|
|
18294
|
-
|
|
18295
|
-
await ((_b = this.activeSlide) === null || _b === void 0 ? void 0 : _b.init());
|
|
18402
|
+
await this.activeSlide.init();
|
|
18296
18403
|
}
|
|
18297
18404
|
async start() {
|
|
18298
|
-
|
|
18299
|
-
await ((_b = this.activeSlide) === null || _b === void 0 ? void 0 : _b.start());
|
|
18405
|
+
await this.activeSlide.start();
|
|
18300
18406
|
}
|
|
18301
18407
|
async stop() {
|
|
18302
|
-
var _b;
|
|
18303
18408
|
this.slideApiHandlers.clearActiveNarrativeDataCache();
|
|
18304
|
-
await
|
|
18409
|
+
await this.activeSlide.stop();
|
|
18410
|
+
}
|
|
18411
|
+
onClick(event, currentTarget) {
|
|
18412
|
+
this.activeSlide.onClick(event, currentTarget);
|
|
18305
18413
|
}
|
|
18306
18414
|
toPublicDto() {
|
|
18307
18415
|
return this.iamMessage.toPublicDto();
|
|
@@ -18318,9 +18426,25 @@ let IamMessageViewModel = (() => {
|
|
|
18318
18426
|
hideErrorScreen() {
|
|
18319
18427
|
this._needShowErrorScreen = false;
|
|
18320
18428
|
}
|
|
18321
|
-
destroy() {
|
|
18429
|
+
async destroy() {
|
|
18322
18430
|
var _b;
|
|
18323
|
-
(_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();
|
|
18324
18448
|
}
|
|
18325
18449
|
createSlidesViewModels() {
|
|
18326
18450
|
if (this._slides.length > 0)
|
|
@@ -18333,7 +18457,8 @@ let IamMessageViewModel = (() => {
|
|
|
18333
18457
|
nonce: getNonce(),
|
|
18334
18458
|
viewport: window,
|
|
18335
18459
|
userResizeHandler: undefined,
|
|
18336
|
-
VODPlayer: this.storyManager.globalProperties.$videoOnDemand
|
|
18460
|
+
VODPlayer: this.storyManager.globalProperties.$videoOnDemand,
|
|
18461
|
+
useSdkCacheForMultislideMode: false
|
|
18337
18462
|
});
|
|
18338
18463
|
this._slides = this.iamMessage.slides.map(slide => new IamMessageSlideViewModel(this, slide, slideApi));
|
|
18339
18464
|
this.slideApi = slideApi;
|
|
@@ -18374,11 +18499,420 @@ let IamMessageViewModel = (() => {
|
|
|
18374
18499
|
})();
|
|
18375
18500
|
|
|
18376
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
|
+
|
|
18377
18909
|
;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/iamMessage/index.ts
|
|
18378
18910
|
|
|
18379
18911
|
|
|
18380
18912
|
|
|
18381
18913
|
|
|
18914
|
+
|
|
18915
|
+
|
|
18382
18916
|
;// CONCATENATED MODULE: ../core/src/readers/inAppMessaging/index.ts
|
|
18383
18917
|
|
|
18384
18918
|
|
|
@@ -20980,7 +21514,7 @@ class UgcEditorStore {
|
|
|
20980
21514
|
const session = await this.storyManager.rootStore.sessionStore.open();
|
|
20981
21515
|
const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
|
|
20982
21516
|
const storyManagerConfig = this.storyManager.config;
|
|
20983
|
-
const sdkVersion = "1.8.0-rc.
|
|
21517
|
+
const sdkVersion = "1.8.0-rc.14";
|
|
20984
21518
|
this._config = {
|
|
20985
21519
|
sessionId: session.id,
|
|
20986
21520
|
apiKey: storyManagerConfig.apiKey,
|
|
@@ -21411,7 +21945,7 @@ class StoryManager extends TypedEventEmitter {
|
|
|
21411
21945
|
return this._userAgent;
|
|
21412
21946
|
}
|
|
21413
21947
|
get sdkVersionName() {
|
|
21414
|
-
const sdkVersionName = "1.8.0-rc.
|
|
21948
|
+
const sdkVersionName = "1.8.0-rc.14";
|
|
21415
21949
|
return sdkVersionName || "0.0.0";
|
|
21416
21950
|
}
|
|
21417
21951
|
get sdkVersionCode() {
|
|
@@ -26854,7 +27388,7 @@ var decorators_js_x = (y) => {
|
|
|
26854
27388
|
var x = {}; __webpack_require__.d(x, y); return x
|
|
26855
27389
|
}
|
|
26856
27390
|
var decorators_js_y = (x) => (() => (x))
|
|
26857
|
-
const decorators_js_namespaceObject = decorators_js_x({ ["
|
|
27391
|
+
const decorators_js_namespaceObject = decorators_js_x({ ["property"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.property), ["query"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.query), ["state"]: () => (__WEBPACK_EXTERNAL_MODULE_lit_decorators_js_226d44c5__.state) });
|
|
26858
27392
|
;// CONCATENATED MODULE: ./src/InAppMessaging/controllers/viewportController.ts
|
|
26859
27393
|
class ViewportController {
|
|
26860
27394
|
constructor(host) {
|
|
@@ -27064,7 +27598,7 @@ var BottomSheet_classPrivateFieldSet = (undefined && undefined.__classPrivateFie
|
|
|
27064
27598
|
|
|
27065
27599
|
let BottomSheet = (() => {
|
|
27066
27600
|
var _BottomSheet_open_accessor_storage, _BottomSheet_disableClose_accessor_storage, _BottomSheet_geometry_accessor_storage, _BottomSheet_appearanceOptions_accessor_storage, _BottomSheet_touchController_accessor_storage, _BottomSheet_desktopMode_accessor_storage, _BottomSheet_isVisible_accessor_storage, _BottomSheet_isClosed_accessor_storage, _BottomSheet_backdropRef_accessor_storage, _BottomSheet_bottomSheetBoxRef_accessor_storage, _BottomSheet_bottomSheetRef_accessor_storage;
|
|
27067
|
-
let _classDecorators = [(
|
|
27601
|
+
let _classDecorators = [safeCustomElement("iam-bottom-sheet")];
|
|
27068
27602
|
let _classDescriptor;
|
|
27069
27603
|
let _classExtraInitializers = [];
|
|
27070
27604
|
let _classThis;
|
|
@@ -27343,9 +27877,10 @@ var ModalCloseButton_classPrivateFieldSet = (undefined && undefined.__classPriva
|
|
|
27343
27877
|
|
|
27344
27878
|
|
|
27345
27879
|
|
|
27880
|
+
|
|
27346
27881
|
let Modal = (() => {
|
|
27347
27882
|
var _Modal_closeBtnPosition_accessor_storage, _Modal_dir_accessor_storage;
|
|
27348
|
-
let _classDecorators = [(
|
|
27883
|
+
let _classDecorators = [safeCustomElement("iam-modal-close-btn")];
|
|
27349
27884
|
let _classDescriptor;
|
|
27350
27885
|
let _classExtraInitializers = [];
|
|
27351
27886
|
let _classThis;
|
|
@@ -27463,9 +27998,10 @@ var Modal_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet)
|
|
|
27463
27998
|
|
|
27464
27999
|
const ANIMATION_DURATION = 350;
|
|
27465
28000
|
|
|
28001
|
+
|
|
27466
28002
|
let Modal_Modal = (() => {
|
|
27467
28003
|
var _Modal_open_accessor_storage, _Modal_disableClose_accessor_storage, _Modal_fullscreen_accessor_storage, _Modal_geometry_accessor_storage, _Modal_appearanceOptions_accessor_storage, _Modal_dir_accessor_storage, _Modal_isVisible_accessor_storage, _Modal_isClosed_accessor_storage, _Modal_backdropRef_accessor_storage;
|
|
27468
|
-
let _classDecorators = [(
|
|
28004
|
+
let _classDecorators = [safeCustomElement("iam-modal")];
|
|
27469
28005
|
let _classDescriptor;
|
|
27470
28006
|
let _classExtraInitializers = [];
|
|
27471
28007
|
let _classThis;
|
|
@@ -27715,9 +28251,10 @@ var FullscreenModal_classPrivateFieldSet = (undefined && undefined.__classPrivat
|
|
|
27715
28251
|
|
|
27716
28252
|
|
|
27717
28253
|
|
|
28254
|
+
|
|
27718
28255
|
let FullscreenModal = (() => {
|
|
27719
28256
|
var _FullscreenModal_open_accessor_storage, _FullscreenModal_geometry_accessor_storage, _FullscreenModal_appearanceOptions_accessor_storage;
|
|
27720
|
-
let _classDecorators = [(
|
|
28257
|
+
let _classDecorators = [safeCustomElement("iam-fullscreen-modal")];
|
|
27721
28258
|
let _classDescriptor;
|
|
27722
28259
|
let _classExtraInitializers = [];
|
|
27723
28260
|
let _classThis;
|
|
@@ -27834,9 +28371,10 @@ var MessageViewFactory_classPrivateFieldSet = (undefined && undefined.__classPri
|
|
|
27834
28371
|
|
|
27835
28372
|
|
|
27836
28373
|
|
|
28374
|
+
|
|
27837
28375
|
let MessageViewFactory = (() => {
|
|
27838
28376
|
var _MessageViewFactory_appearanceOptions_accessor_storage, _MessageViewFactory_type_accessor_storage, _MessageViewFactory_open_accessor_storage, _MessageViewFactory_disableClose_accessor_storage, _MessageViewFactory_geometry_accessor_storage, _MessageViewFactory_touchController_accessor_storage, _MessageViewFactory_desktopMode_accessor_storage, _MessageViewFactory_dir_accessor_storage;
|
|
27839
|
-
let _classDecorators = [(
|
|
28377
|
+
let _classDecorators = [safeCustomElement("message-view-factory")];
|
|
27840
28378
|
let _classDescriptor;
|
|
27841
28379
|
let _classExtraInitializers = [];
|
|
27842
28380
|
let _classThis;
|
|
@@ -27957,9 +28495,9 @@ let MessageViewFactory = (() => {
|
|
|
27957
28495
|
})();
|
|
27958
28496
|
|
|
27959
28497
|
|
|
27960
|
-
;// CONCATENATED MODULE: ./src/InAppMessaging/components/MessageSlide/
|
|
28498
|
+
;// CONCATENATED MODULE: ./src/InAppMessaging/components/MessageSlide/MessageSlide.styles.ts
|
|
27961
28499
|
|
|
27962
|
-
const messageSlideStyles = (0,external_lit_namespaceObject.css) `.slides-container{height:100%;width:100%;position:absolute;top:0;left:0;bottom:0;right:0}`;
|
|
28500
|
+
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}`;
|
|
27963
28501
|
|
|
27964
28502
|
;// CONCATENATED MODULE: ./src/InAppMessaging/components/MessageSlide/MessageSlide.ts
|
|
27965
28503
|
var MessageSlide_esDecorate = (undefined && undefined.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
@@ -28017,7 +28555,7 @@ var MessageSlide_classPrivateFieldSet = (undefined && undefined.__classPrivateFi
|
|
|
28017
28555
|
|
|
28018
28556
|
let MessageSlide = (() => {
|
|
28019
28557
|
var _MessageSlide_message_accessor_storage, _MessageSlide_styleContext_accessor_storage, _MessageSlide_geometry_accessor_storage, _MessageSlide_slidesContainer_accessor_storage;
|
|
28020
|
-
let _classDecorators = [(
|
|
28558
|
+
let _classDecorators = [safeCustomElement("message-slide")];
|
|
28021
28559
|
let _classDescriptor;
|
|
28022
28560
|
let _classExtraInitializers = [];
|
|
28023
28561
|
let _classThis;
|
|
@@ -28065,12 +28603,11 @@ let MessageSlide = (() => {
|
|
|
28065
28603
|
this.message.stop();
|
|
28066
28604
|
}
|
|
28067
28605
|
handleSlideClick(event) {
|
|
28068
|
-
var _a;
|
|
28069
28606
|
if (!event.currentTarget)
|
|
28070
28607
|
return;
|
|
28071
28608
|
event.preventDefault();
|
|
28072
28609
|
event.stopPropagation();
|
|
28073
|
-
|
|
28610
|
+
this.message.onClick(event, event.currentTarget);
|
|
28074
28611
|
}
|
|
28075
28612
|
async initAndStartSlide() {
|
|
28076
28613
|
const slidesContainer = this.slidesContainer;
|
|
@@ -28173,9 +28710,10 @@ var RefreshIcon_classPrivateFieldSet = (undefined && undefined.__classPrivateFie
|
|
|
28173
28710
|
};
|
|
28174
28711
|
|
|
28175
28712
|
|
|
28713
|
+
|
|
28176
28714
|
let RefreshIcon_RefreshIcon = (() => {
|
|
28177
28715
|
var _RefreshIcon_className_accessor_storage;
|
|
28178
|
-
let _classDecorators = [(
|
|
28716
|
+
let _classDecorators = [safeCustomElement("iam-refresh-icon")];
|
|
28179
28717
|
let _classDescriptor;
|
|
28180
28718
|
let _classExtraInitializers = [];
|
|
28181
28719
|
let _classThis;
|
|
@@ -28275,9 +28813,10 @@ var Loader_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet
|
|
|
28275
28813
|
|
|
28276
28814
|
|
|
28277
28815
|
|
|
28816
|
+
|
|
28278
28817
|
let Loader_Loader = (() => {
|
|
28279
28818
|
var _Loader_background_accessor_storage, _Loader_color_accessor_storage, _Loader_needShowErrorScreen_accessor_storage, _Loader_needShowLoaderScreen_accessor_storage;
|
|
28280
|
-
let _classDecorators = [(
|
|
28819
|
+
let _classDecorators = [safeCustomElement("iam-loader")];
|
|
28281
28820
|
let _classDescriptor;
|
|
28282
28821
|
let _classExtraInitializers = [];
|
|
28283
28822
|
let _classThis;
|
|
@@ -28426,7 +28965,7 @@ var InAppMessagingReader_classPrivateFieldSet = (undefined && undefined.__classP
|
|
|
28426
28965
|
|
|
28427
28966
|
let InAppMessagingReader = (() => {
|
|
28428
28967
|
var _InAppMessagingReader_options_accessor_storage, _InAppMessagingReader_desktopMode_accessor_storage, _InAppMessagingReader_dir_accessor_storage, _InAppMessagingReader_viewModel_accessor_storage, _InAppMessagingReader_open_accessor_storage;
|
|
28429
|
-
let _classDecorators = [(
|
|
28968
|
+
let _classDecorators = [safeCustomElement("iam-reader"), mobxObserver];
|
|
28430
28969
|
let _classDescriptor;
|
|
28431
28970
|
let _classExtraInitializers = [];
|
|
28432
28971
|
let _classThis;
|
|
@@ -28525,9 +29064,9 @@ let InAppMessagingReader = (() => {
|
|
|
28525
29064
|
});
|
|
28526
29065
|
}
|
|
28527
29066
|
async handleReloadMessage() {
|
|
28528
|
-
var _a, _b
|
|
29067
|
+
var _a, _b;
|
|
28529
29068
|
try {
|
|
28530
|
-
await ((
|
|
29069
|
+
await ((_b = (_a = this.viewModel) === null || _a === void 0 ? void 0 : _a.activeMessage) === null || _b === void 0 ? void 0 : _b.restart());
|
|
28531
29070
|
}
|
|
28532
29071
|
catch (error) {
|
|
28533
29072
|
console.error(error);
|