@inappstory/react-sdk 1.7.8 → 1.7.10
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 +945 -361
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +4 -3
- package/dist/types/storyManager.d.ts +36 -1
- package/package.json +1 -1
package/dist/index.esm.mjs
CHANGED
|
@@ -3483,7 +3483,7 @@ var __esDecorate = (undefined && undefined.__esDecorate) || function (ctor, desc
|
|
|
3483
3483
|
|
|
3484
3484
|
|
|
3485
3485
|
|
|
3486
|
-
const messageFields = "campaign_name,id,events,appearance,slides_html,type,frequency_limit,display_to,display_from,need_placeholders,has_limit";
|
|
3486
|
+
const messageFields = "campaign_name,id,events,appearance,slides_html,type,frequency_limit,display_to,display_from,disable_close,need_placeholders,has_limit";
|
|
3487
3487
|
const messageFieldsWithPrefix = messageFields
|
|
3488
3488
|
.split(",")
|
|
3489
3489
|
.map(field => `messages.${field}`)
|
|
@@ -4565,7 +4565,7 @@ class StoriesApi {
|
|
|
4565
4565
|
const config = {
|
|
4566
4566
|
url: `${feedSlug === UGCFeedSlug ? "ugc/" : ""}story/${id}`,
|
|
4567
4567
|
method: "GET",
|
|
4568
|
-
params: { expand: expandFields.join(",") }
|
|
4568
|
+
params: { expand: expandFields.join(",") /* , src_list: "true" */ }
|
|
4569
4569
|
};
|
|
4570
4570
|
config.params.once = Number(Boolean(once));
|
|
4571
4571
|
if (!allFields) {
|
|
@@ -5114,6 +5114,7 @@ let StorySlide = (() => {
|
|
|
5114
5114
|
return this._html;
|
|
5115
5115
|
}
|
|
5116
5116
|
constructor(storySlideDto) {
|
|
5117
|
+
var _b, _c;
|
|
5117
5118
|
_StorySlide__html_accessor_storage.set(this, (storySlide_runInitializers(this, _instanceExtraInitializers), storySlide_runInitializers(this, __html_initializers, "")));
|
|
5118
5119
|
Object.defineProperty(this, "index", {
|
|
5119
5120
|
enumerable: true,
|
|
@@ -5145,6 +5146,18 @@ let StorySlide = (() => {
|
|
|
5145
5146
|
writable: true,
|
|
5146
5147
|
value: void 0
|
|
5147
5148
|
});
|
|
5149
|
+
Object.defineProperty(this, "resources", {
|
|
5150
|
+
enumerable: true,
|
|
5151
|
+
configurable: true,
|
|
5152
|
+
writable: true,
|
|
5153
|
+
value: []
|
|
5154
|
+
});
|
|
5155
|
+
Object.defineProperty(this, "_resourcesByBlob", {
|
|
5156
|
+
enumerable: true,
|
|
5157
|
+
configurable: true,
|
|
5158
|
+
writable: true,
|
|
5159
|
+
value: {}
|
|
5160
|
+
});
|
|
5148
5161
|
this.index = storySlideDto.index;
|
|
5149
5162
|
this.timeline = {
|
|
5150
5163
|
foreground: storySlideDto.timeline.foreground,
|
|
@@ -5153,6 +5166,17 @@ let StorySlide = (() => {
|
|
|
5153
5166
|
this.duration = storySlideDto.duration;
|
|
5154
5167
|
this.screenshotShare = storySlideDto.screenshot_share;
|
|
5155
5168
|
this.eventPayload = storySlideDto.event_payload;
|
|
5169
|
+
// TODO: don't map in the slide model.
|
|
5170
|
+
// The model should not know anything about the DTO
|
|
5171
|
+
this.resources =
|
|
5172
|
+
(_c = (_b = storySlideDto.resources) === null || _b === void 0 ? void 0 : _b.map(resource => ({
|
|
5173
|
+
type: resource.type,
|
|
5174
|
+
key: resource.key,
|
|
5175
|
+
url: resource.url,
|
|
5176
|
+
rangeStart: resource.range_start,
|
|
5177
|
+
rangeEnd: resource.range_end,
|
|
5178
|
+
contentType: resource.content_type
|
|
5179
|
+
}))) !== null && _c !== void 0 ? _c : [];
|
|
5156
5180
|
this._html = this.replaceSlideNonce(storySlideDto.html);
|
|
5157
5181
|
}
|
|
5158
5182
|
static createEmpty() {
|
|
@@ -5167,16 +5191,39 @@ let StorySlide = (() => {
|
|
|
5167
5191
|
html: ""
|
|
5168
5192
|
});
|
|
5169
5193
|
}
|
|
5170
|
-
replaceSlideNonce(slideHtml) {
|
|
5171
|
-
var _b;
|
|
5172
|
-
return replaceAll(slideHtml, `{{nonce}}`, (_b = getNonce()) !== null && _b !== void 0 ? _b : "");
|
|
5173
|
-
}
|
|
5174
5194
|
updatePlaceholders(placeholders) {
|
|
5175
5195
|
let slideHtml = this._html;
|
|
5176
5196
|
for (const placeholder of placeholders)
|
|
5177
5197
|
slideHtml = replaceAll(slideHtml, `%${placeholder.key}%`, placeholder.value);
|
|
5178
5198
|
this._html = slideHtml;
|
|
5179
5199
|
}
|
|
5200
|
+
applyBlobUrls(resourceUrls, resourcesByBlob) {
|
|
5201
|
+
var _b;
|
|
5202
|
+
let updatedHtml = this._html;
|
|
5203
|
+
for (const resourceUrl of resourceUrls) {
|
|
5204
|
+
const blobUrl = (_b = resourcesByBlob[resourceUrl]) === null || _b === void 0 ? void 0 : _b.blobUrl;
|
|
5205
|
+
if (!blobUrl)
|
|
5206
|
+
continue;
|
|
5207
|
+
updatedHtml = replaceAll(updatedHtml, resourceUrl, blobUrl);
|
|
5208
|
+
this._resourcesByBlob[resourceUrl] = blobUrl;
|
|
5209
|
+
}
|
|
5210
|
+
this._html = updatedHtml;
|
|
5211
|
+
}
|
|
5212
|
+
restoreOriginalResourceUrls() {
|
|
5213
|
+
let restoredHtml = this._html;
|
|
5214
|
+
for (const [resourceUrl, blobUrl] of Object.entries(this._resourcesByBlob)) {
|
|
5215
|
+
restoredHtml = replaceAll(restoredHtml, blobUrl, resourceUrl);
|
|
5216
|
+
}
|
|
5217
|
+
this._html = restoredHtml;
|
|
5218
|
+
}
|
|
5219
|
+
parseResources() {
|
|
5220
|
+
const resources = Array.from(this._html.matchAll(/src="([^"]+)"/gi), t => t[1]).filter(src => !src.startsWith("blob:"));
|
|
5221
|
+
return Array.from(new Set(resources));
|
|
5222
|
+
}
|
|
5223
|
+
replaceSlideNonce(slideHtml) {
|
|
5224
|
+
var _b;
|
|
5225
|
+
return replaceAll(slideHtml, `{{nonce}}`, (_b = getNonce()) !== null && _b !== void 0 ? _b : "");
|
|
5226
|
+
}
|
|
5180
5227
|
},
|
|
5181
5228
|
_StorySlide__html_accessor_storage = new WeakMap(),
|
|
5182
5229
|
(() => {
|
|
@@ -7777,7 +7824,7 @@ var external_async_mutex_x = (y) => {
|
|
|
7777
7824
|
var x = {}; __webpack_require__.d(x, y); return x
|
|
7778
7825
|
}
|
|
7779
7826
|
var external_async_mutex_y = (x) => (() => (x))
|
|
7780
|
-
const external_async_mutex_namespaceObject = external_async_mutex_x({ ["Mutex"]: () => (__WEBPACK_EXTERNAL_MODULE_async_mutex_052338b1__.Mutex) });
|
|
7827
|
+
const external_async_mutex_namespaceObject = external_async_mutex_x({ ["Mutex"]: () => (__WEBPACK_EXTERNAL_MODULE_async_mutex_052338b1__.Mutex), ["Semaphore"]: () => (__WEBPACK_EXTERNAL_MODULE_async_mutex_052338b1__.Semaphore) });
|
|
7781
7828
|
;// CONCATENATED MODULE: ../core/src/readers/storyReader/storySlideViewModel/storySlideViewModel.ts
|
|
7782
7829
|
var storySlideViewModel_runInitializers = (undefined && undefined.__runInitializers) || function (thisArg, initializers, value) {
|
|
7783
7830
|
var useValue = arguments.length > 2;
|
|
@@ -7842,7 +7889,7 @@ let StorySlideViewModel = (() => {
|
|
|
7842
7889
|
return _a = class StorySlideViewModel {
|
|
7843
7890
|
get _disabledNextClick() { return storySlideViewModel_classPrivateFieldGet(this, _StorySlideViewModel__disabledNextClick_accessor_storage, "f"); }
|
|
7844
7891
|
set _disabledNextClick(value) { storySlideViewModel_classPrivateFieldSet(this, _StorySlideViewModel__disabledNextClick_accessor_storage, value, "f"); }
|
|
7845
|
-
constructor(_story, _index, slideApi, slide) {
|
|
7892
|
+
constructor(_story, _index, slideApi, slide, cacheManager) {
|
|
7846
7893
|
Object.defineProperty(this, "_story", {
|
|
7847
7894
|
enumerable: true,
|
|
7848
7895
|
configurable: true,
|
|
@@ -7867,6 +7914,12 @@ let StorySlideViewModel = (() => {
|
|
|
7867
7914
|
writable: true,
|
|
7868
7915
|
value: slide
|
|
7869
7916
|
});
|
|
7917
|
+
Object.defineProperty(this, "cacheManager", {
|
|
7918
|
+
enumerable: true,
|
|
7919
|
+
configurable: true,
|
|
7920
|
+
writable: true,
|
|
7921
|
+
value: cacheManager
|
|
7922
|
+
});
|
|
7870
7923
|
_StorySlideViewModel__disabledNextClick_accessor_storage.set(this, storySlideViewModel_runInitializers(this, __disabledNextClick_initializers, false));
|
|
7871
7924
|
Object.defineProperty(this, "mutex", {
|
|
7872
7925
|
enumerable: true,
|
|
@@ -7886,6 +7939,18 @@ let StorySlideViewModel = (() => {
|
|
|
7886
7939
|
writable: true,
|
|
7887
7940
|
value: false
|
|
7888
7941
|
});
|
|
7942
|
+
Object.defineProperty(this, "preloaded", {
|
|
7943
|
+
enumerable: true,
|
|
7944
|
+
configurable: true,
|
|
7945
|
+
writable: true,
|
|
7946
|
+
value: false
|
|
7947
|
+
});
|
|
7948
|
+
Object.defineProperty(this, "isPreloading", {
|
|
7949
|
+
enumerable: true,
|
|
7950
|
+
configurable: true,
|
|
7951
|
+
writable: true,
|
|
7952
|
+
value: false
|
|
7953
|
+
});
|
|
7889
7954
|
Object.defineProperty(this, "handleTouchEnd", {
|
|
7890
7955
|
enumerable: true,
|
|
7891
7956
|
configurable: true,
|
|
@@ -8097,6 +8162,23 @@ let StorySlideViewModel = (() => {
|
|
|
8097
8162
|
const { canClickNext } = this.slideApi.slideClickHandler(null, "backward");
|
|
8098
8163
|
return canClickNext;
|
|
8099
8164
|
}
|
|
8165
|
+
async preload(priority) {
|
|
8166
|
+
if (!this.cacheManager || this.preloaded || this.isPreloading)
|
|
8167
|
+
return;
|
|
8168
|
+
this.isPreloading = true;
|
|
8169
|
+
const resourceUrls = this.slide.parseResources();
|
|
8170
|
+
const cacheEntries = await this.cacheManager.preload(resourceUrls.map(resourceUrl => ({
|
|
8171
|
+
url: resourceUrl,
|
|
8172
|
+
priority
|
|
8173
|
+
})));
|
|
8174
|
+
const resourcesByUrl = {};
|
|
8175
|
+
for (const cacheEntry of cacheEntries)
|
|
8176
|
+
resourcesByUrl[cacheEntry.url] = cacheEntry;
|
|
8177
|
+
if (!this.cacheManager.isDestroyed)
|
|
8178
|
+
this.slide.applyBlobUrls(resourceUrls, resourcesByUrl);
|
|
8179
|
+
this.preloaded = true;
|
|
8180
|
+
this.isPreloading = false;
|
|
8181
|
+
}
|
|
8100
8182
|
onClick({ event, currentTarget, preventNavigation = false }) {
|
|
8101
8183
|
if (!event.target)
|
|
8102
8184
|
return;
|
|
@@ -8117,6 +8199,8 @@ let StorySlideViewModel = (() => {
|
|
|
8117
8199
|
this.isStarted = false;
|
|
8118
8200
|
this.isInited = false;
|
|
8119
8201
|
this.story.touchController.off(TouchControllerEvent.TouchEnd, this.handleTouchEnd);
|
|
8202
|
+
if (this.cacheManager)
|
|
8203
|
+
this.slide.restoreOriginalResourceUrls();
|
|
8120
8204
|
await this.slideApi.destroy();
|
|
8121
8205
|
}
|
|
8122
8206
|
catch (error) {
|
|
@@ -9475,8 +9559,9 @@ var StoryEvent;
|
|
|
9475
9559
|
(function (StoryEvent) {
|
|
9476
9560
|
StoryEvent["ShowToast"] = "showToast";
|
|
9477
9561
|
})(StoryEvent || (StoryEvent = {}));
|
|
9562
|
+
const ACTIVE_SLIDE_PRELOAD_PRIORITY = 1000;
|
|
9478
9563
|
let StoryViewModel = (() => {
|
|
9479
|
-
var _a, _StoryViewModel__activeSlideIndex_accessor_storage, _StoryViewModel__slides_accessor_storage, _StoryViewModel__needShowErrorScreen_accessor_storage, _StoryViewModel__needShowLoaderScreen_accessor_storage, _StoryViewModel__$root_accessor_storage;
|
|
9564
|
+
var _a, _StoryViewModel__activeSlideIndex_accessor_storage, _StoryViewModel__slides_accessor_storage, _StoryViewModel__needShowErrorScreen_accessor_storage, _StoryViewModel__needShowLoaderScreen_accessor_storage, _StoryViewModel__$root_accessor_storage, _StoryViewModel_isInited_accessor_storage;
|
|
9480
9565
|
var _b;
|
|
9481
9566
|
let _classSuper = ViewModel;
|
|
9482
9567
|
let _instanceExtraInitializers = [];
|
|
@@ -9495,6 +9580,9 @@ let StoryViewModel = (() => {
|
|
|
9495
9580
|
let __$root_decorators;
|
|
9496
9581
|
let __$root_initializers = [];
|
|
9497
9582
|
let __$root_extraInitializers = [];
|
|
9583
|
+
let _isInited_decorators;
|
|
9584
|
+
let _isInited_initializers = [];
|
|
9585
|
+
let _isInited_extraInitializers = [];
|
|
9498
9586
|
let _get_needShowErrorScreen_decorators;
|
|
9499
9587
|
let _get_needShowLoaderScreen_decorators;
|
|
9500
9588
|
let _get_activeSlide_decorators;
|
|
@@ -9522,7 +9610,9 @@ let StoryViewModel = (() => {
|
|
|
9522
9610
|
set _needShowLoaderScreen(value) { storyViewModel_classPrivateFieldSet(this, _StoryViewModel__needShowLoaderScreen_accessor_storage, value, "f"); }
|
|
9523
9611
|
get _$root() { return storyViewModel_classPrivateFieldGet(this, _StoryViewModel__$root_accessor_storage, "f"); }
|
|
9524
9612
|
set _$root(value) { storyViewModel_classPrivateFieldSet(this, _StoryViewModel__$root_accessor_storage, value, "f"); }
|
|
9525
|
-
|
|
9613
|
+
get isInited() { return storyViewModel_classPrivateFieldGet(this, _StoryViewModel_isInited_accessor_storage, "f"); }
|
|
9614
|
+
set isInited(value) { storyViewModel_classPrivateFieldSet(this, _StoryViewModel_isInited_accessor_storage, value, "f"); }
|
|
9615
|
+
constructor(storyManager, storyReader, story, storySlideApiHandlersFactory, storyReaderStatisticV1Service, storyReaderStatisticV2Service, cacheManager) {
|
|
9526
9616
|
super();
|
|
9527
9617
|
Object.defineProperty(this, "storyManager", {
|
|
9528
9618
|
enumerable: true,
|
|
@@ -9560,22 +9650,23 @@ let StoryViewModel = (() => {
|
|
|
9560
9650
|
writable: true,
|
|
9561
9651
|
value: storyReaderStatisticV2Service
|
|
9562
9652
|
});
|
|
9653
|
+
Object.defineProperty(this, "cacheManager", {
|
|
9654
|
+
enumerable: true,
|
|
9655
|
+
configurable: true,
|
|
9656
|
+
writable: true,
|
|
9657
|
+
value: cacheManager
|
|
9658
|
+
});
|
|
9563
9659
|
_StoryViewModel__activeSlideIndex_accessor_storage.set(this, storyViewModel_runInitializers(this, __activeSlideIndex_initializers, 0));
|
|
9564
9660
|
_StoryViewModel__slides_accessor_storage.set(this, (storyViewModel_runInitializers(this, __activeSlideIndex_extraInitializers), storyViewModel_runInitializers(this, __slides_initializers, [])));
|
|
9565
9661
|
_StoryViewModel__needShowErrorScreen_accessor_storage.set(this, (storyViewModel_runInitializers(this, __slides_extraInitializers), storyViewModel_runInitializers(this, __needShowErrorScreen_initializers, false)));
|
|
9566
9662
|
_StoryViewModel__needShowLoaderScreen_accessor_storage.set(this, (storyViewModel_runInitializers(this, __needShowErrorScreen_extraInitializers), storyViewModel_runInitializers(this, __needShowLoaderScreen_initializers, false)));
|
|
9567
9663
|
_StoryViewModel__$root_accessor_storage.set(this, (storyViewModel_runInitializers(this, __needShowLoaderScreen_extraInitializers), storyViewModel_runInitializers(this, __$root_initializers, null)));
|
|
9568
|
-
|
|
9569
|
-
enumerable: true,
|
|
9570
|
-
configurable: true,
|
|
9571
|
-
writable: true,
|
|
9572
|
-
value: (storyViewModel_runInitializers(this, __$root_extraInitializers), false)
|
|
9573
|
-
});
|
|
9664
|
+
_StoryViewModel_isInited_accessor_storage.set(this, (storyViewModel_runInitializers(this, __$root_extraInitializers), storyViewModel_runInitializers(this, _isInited_initializers, false)));
|
|
9574
9665
|
Object.defineProperty(this, "isStarted", {
|
|
9575
9666
|
enumerable: true,
|
|
9576
9667
|
configurable: true,
|
|
9577
9668
|
writable: true,
|
|
9578
|
-
value: false
|
|
9669
|
+
value: (storyViewModel_runInitializers(this, _isInited_extraInitializers), false)
|
|
9579
9670
|
});
|
|
9580
9671
|
Object.defineProperty(this, "_activeSlideStartTime", {
|
|
9581
9672
|
enumerable: true,
|
|
@@ -9651,12 +9742,6 @@ let StoryViewModel = (() => {
|
|
|
9651
9742
|
writable: true,
|
|
9652
9743
|
value: void 0
|
|
9653
9744
|
});
|
|
9654
|
-
Object.defineProperty(this, "initOnce", {
|
|
9655
|
-
enumerable: true,
|
|
9656
|
-
configurable: true,
|
|
9657
|
-
writable: true,
|
|
9658
|
-
value: false
|
|
9659
|
-
});
|
|
9660
9745
|
Object.defineProperty(this, "toast", {
|
|
9661
9746
|
enumerable: true,
|
|
9662
9747
|
configurable: true,
|
|
@@ -9733,7 +9818,7 @@ let StoryViewModel = (() => {
|
|
|
9733
9818
|
return this.storyReader.displayStrategy;
|
|
9734
9819
|
}
|
|
9735
9820
|
get canBeShown() {
|
|
9736
|
-
return this.story.canBeShown && this.slides.length > 0;
|
|
9821
|
+
return this.story.canBeShown && this.slides.length > 0 && Boolean(this._$root);
|
|
9737
9822
|
}
|
|
9738
9823
|
get context() {
|
|
9739
9824
|
return this.story.context;
|
|
@@ -9790,6 +9875,9 @@ let StoryViewModel = (() => {
|
|
|
9790
9875
|
get dir() {
|
|
9791
9876
|
return this.storyReader.dir;
|
|
9792
9877
|
}
|
|
9878
|
+
get isSlideRendered() {
|
|
9879
|
+
return this.isInited;
|
|
9880
|
+
}
|
|
9793
9881
|
get isNextDisabled() {
|
|
9794
9882
|
return ((this.storyReader.reachEnd && this.reachEnd) ||
|
|
9795
9883
|
this.activeSlide.disabledNextClick ||
|
|
@@ -9921,15 +10009,24 @@ let StoryViewModel = (() => {
|
|
|
9921
10009
|
this.isInited = isInited;
|
|
9922
10010
|
this.isStarted = isStarted;
|
|
9923
10011
|
}
|
|
10012
|
+
async preloadSlides(start, end, priority) {
|
|
10013
|
+
if (!this.story.canBeShown)
|
|
10014
|
+
this.showLoaderScreen();
|
|
10015
|
+
await (0,external_mobx_namespaceObject.when)(() => this.story.canBeShown);
|
|
10016
|
+
end = end !== null && end !== void 0 ? end : this._slides.length;
|
|
10017
|
+
priority = priority !== null && priority !== void 0 ? priority : 0;
|
|
10018
|
+
await Promise.all(this._slides.slice(start, end).map((slide, index) => slide.preload(end - index + priority)));
|
|
10019
|
+
}
|
|
10020
|
+
async preloadActiveSlide(priority) {
|
|
10021
|
+
this.preloadSlides(this._activeSlideIndex, this._activeSlideIndex + 1, priority);
|
|
10022
|
+
}
|
|
9924
10023
|
async init() {
|
|
9925
10024
|
await this.mutex.runExclusive(async () => {
|
|
9926
10025
|
if (this.isInited)
|
|
9927
10026
|
return;
|
|
9928
|
-
if (!this.
|
|
10027
|
+
if (!this.story.canBeShown)
|
|
9929
10028
|
this.showLoaderScreen();
|
|
9930
|
-
|
|
9931
|
-
}
|
|
9932
|
-
await (0,external_mobx_namespaceObject.when)(() => this.canBeShown && Boolean(this._$root));
|
|
10029
|
+
await (0,external_mobx_namespaceObject.when)(() => this.canBeShown);
|
|
9933
10030
|
await this.activeSlide.init();
|
|
9934
10031
|
this.isInited = true;
|
|
9935
10032
|
});
|
|
@@ -10043,7 +10140,7 @@ let StoryViewModel = (() => {
|
|
|
10043
10140
|
return slideApi;
|
|
10044
10141
|
}
|
|
10045
10142
|
async createSlidesViewModels(slides, slideApi) {
|
|
10046
|
-
this._slides = slides.map((slide, index) => new StorySlideViewModel(this, index, slideApi, slide));
|
|
10143
|
+
this._slides = slides.map((slide, index) => new StorySlideViewModel(this, index, slideApi, slide, this.cacheManager));
|
|
10047
10144
|
}
|
|
10048
10145
|
handleSpaceKeydown(e) {
|
|
10049
10146
|
if (e.code !== "Space")
|
|
@@ -10062,6 +10159,7 @@ let StoryViewModel = (() => {
|
|
|
10062
10159
|
this.mute();
|
|
10063
10160
|
}
|
|
10064
10161
|
async onSlideChange(index) {
|
|
10162
|
+
var _b;
|
|
10065
10163
|
try {
|
|
10066
10164
|
if (!this.isInited || !this.isStarted)
|
|
10067
10165
|
return;
|
|
@@ -10070,6 +10168,8 @@ let StoryViewModel = (() => {
|
|
|
10070
10168
|
this._activeSlideIndex = index;
|
|
10071
10169
|
this.hideErrorScreen();
|
|
10072
10170
|
this.resumeAll();
|
|
10171
|
+
if (!((_b = this.storyManager.config.cache) === null || _b === void 0 ? void 0 : _b.prefetch))
|
|
10172
|
+
await this.preloadActiveSlide(ACTIVE_SLIDE_PRELOAD_PRIORITY);
|
|
10073
10173
|
await activeSlide.init();
|
|
10074
10174
|
await (lastSlide === null || lastSlide === void 0 ? void 0 : lastSlide.stop({ prepareForRestart: 2 /* ON_SLIDE_STOP_PREPARE_FOR_RESTART.NOT_PREPARE */ }));
|
|
10075
10175
|
await activeSlide.start();
|
|
@@ -10097,6 +10197,7 @@ let StoryViewModel = (() => {
|
|
|
10097
10197
|
_StoryViewModel__needShowErrorScreen_accessor_storage = new WeakMap(),
|
|
10098
10198
|
_StoryViewModel__needShowLoaderScreen_accessor_storage = new WeakMap(),
|
|
10099
10199
|
_StoryViewModel__$root_accessor_storage = new WeakMap(),
|
|
10200
|
+
_StoryViewModel_isInited_accessor_storage = new WeakMap(),
|
|
10100
10201
|
(() => {
|
|
10101
10202
|
var _b;
|
|
10102
10203
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_b = _classSuper[Symbol.metadata]) !== null && _b !== void 0 ? _b : null) : void 0;
|
|
@@ -10105,6 +10206,7 @@ let StoryViewModel = (() => {
|
|
|
10105
10206
|
__needShowErrorScreen_decorators = [external_mobx_namespaceObject.observable];
|
|
10106
10207
|
__needShowLoaderScreen_decorators = [external_mobx_namespaceObject.observable];
|
|
10107
10208
|
__$root_decorators = [external_mobx_namespaceObject.observable];
|
|
10209
|
+
_isInited_decorators = [external_mobx_namespaceObject.observable];
|
|
10108
10210
|
_get_needShowErrorScreen_decorators = [external_mobx_namespaceObject.computed];
|
|
10109
10211
|
_get_needShowLoaderScreen_decorators = [external_mobx_namespaceObject.computed];
|
|
10110
10212
|
_get_activeSlide_decorators = [external_mobx_namespaceObject.computed];
|
|
@@ -10126,6 +10228,7 @@ let StoryViewModel = (() => {
|
|
|
10126
10228
|
storyViewModel_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);
|
|
10127
10229
|
storyViewModel_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);
|
|
10128
10230
|
storyViewModel_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);
|
|
10231
|
+
storyViewModel_esDecorate(_a, null, _isInited_decorators, { kind: "accessor", name: "isInited", static: false, private: false, access: { has: obj => "isInited" in obj, get: obj => obj.isInited, set: (obj, value) => { obj.isInited = value; } }, metadata: _metadata }, _isInited_initializers, _isInited_extraInitializers);
|
|
10129
10232
|
storyViewModel_esDecorate(_a, null, _get_needShowErrorScreen_decorators, { kind: "getter", name: "needShowErrorScreen", static: false, private: false, access: { has: obj => "needShowErrorScreen" in obj, get: obj => obj.needShowErrorScreen }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
10130
10233
|
storyViewModel_esDecorate(_a, null, _get_needShowLoaderScreen_decorators, { kind: "getter", name: "needShowLoaderScreen", static: false, private: false, access: { has: obj => "needShowLoaderScreen" in obj, get: obj => obj.needShowLoaderScreen }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
10131
10234
|
storyViewModel_esDecorate(_a, null, _get_activeSlide_decorators, { kind: "getter", name: "activeSlide", static: false, private: false, access: { has: obj => "activeSlide" in obj, get: obj => obj.activeSlide }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -10589,7 +10692,7 @@ class GameClientConfig {
|
|
|
10589
10692
|
value: void 0
|
|
10590
10693
|
});
|
|
10591
10694
|
const storyManagerConfig = this.storyManager.config;
|
|
10592
|
-
const sdkVersion = "1.7.
|
|
10695
|
+
const sdkVersion = "1.7.10";
|
|
10593
10696
|
const placeholders = this.storyManager.rootStore.placeholderStore.placeholders;
|
|
10594
10697
|
const session = this.storyManager.rootStore.sessionStore.session;
|
|
10595
10698
|
this.sessionId = session.id;
|
|
@@ -12805,6 +12908,8 @@ var storyReaderNavigationController_classPrivateFieldSet = (undefined && undefin
|
|
|
12805
12908
|
|
|
12806
12909
|
|
|
12807
12910
|
const STORY_INIT_RANGE = 1;
|
|
12911
|
+
const ACTIVE_STORY_PRELOAD_PRIORITY = 1000;
|
|
12912
|
+
const NON_ACTIVE_STORY_PRELOAD_PRIORITY = 0;
|
|
12808
12913
|
let StoryReaderNavigationController = (() => {
|
|
12809
12914
|
var _a, _StoryReaderNavigationController__activeStory_accessor_storage, _StoryReaderNavigationController__currentIndex_accessor_storage, _StoryReaderNavigationController__targetTransitionIndex_accessor_storage;
|
|
12810
12915
|
let _instanceExtraInitializers = [];
|
|
@@ -12942,7 +13047,6 @@ let StoryReaderNavigationController = (() => {
|
|
|
12942
13047
|
this.currentStoryDisplayStrategy.handleNextStoryByIndex(index);
|
|
12943
13048
|
this.initStoriesWithinRange(index);
|
|
12944
13049
|
await this.animatedNavigationController.transitionByIndex(index, this.currentIndex);
|
|
12945
|
-
//await Promise.all([p1, p2]);
|
|
12946
13050
|
await this.handleTransitionEnd(index, action);
|
|
12947
13051
|
}
|
|
12948
13052
|
handleStoryReaderReachEnd(action) {
|
|
@@ -12986,6 +13090,7 @@ let StoryReaderNavigationController = (() => {
|
|
|
12986
13090
|
async runNextStory(prevStory, story) {
|
|
12987
13091
|
try {
|
|
12988
13092
|
await (prevStory === null || prevStory === void 0 ? void 0 : prevStory.stop());
|
|
13093
|
+
await this.preloadActiveStory(story);
|
|
12989
13094
|
await story.init();
|
|
12990
13095
|
await story.start();
|
|
12991
13096
|
}
|
|
@@ -12994,11 +13099,16 @@ let StoryReaderNavigationController = (() => {
|
|
|
12994
13099
|
}
|
|
12995
13100
|
}
|
|
12996
13101
|
async initStoriesWithinRange(currentIndex) {
|
|
12997
|
-
|
|
13102
|
+
const stories = this.storyReader.stories;
|
|
12998
13103
|
const start = Math.max(currentIndex - STORY_INIT_RANGE, 0);
|
|
12999
13104
|
const end = Math.min(currentIndex + STORY_INIT_RANGE, stories.length - 1);
|
|
13000
|
-
|
|
13001
|
-
|
|
13105
|
+
const storiesToInit = [];
|
|
13106
|
+
for (let i = start; i <= end; i++) {
|
|
13107
|
+
if (i !== currentIndex)
|
|
13108
|
+
storiesToInit.push(stories[i]);
|
|
13109
|
+
}
|
|
13110
|
+
await this.preloadSiblingStories(storiesToInit);
|
|
13111
|
+
return Promise.allSettled(storiesToInit.map(story => story.init()));
|
|
13002
13112
|
}
|
|
13003
13113
|
handleActiveStoryError(story) {
|
|
13004
13114
|
if (!(story === null || story === void 0 ? void 0 : story.error))
|
|
@@ -13014,6 +13124,28 @@ let StoryReaderNavigationController = (() => {
|
|
|
13014
13124
|
limitIndex(index) {
|
|
13015
13125
|
return Math.max(0, Math.min(this.storyReader.stories.length - 1, index));
|
|
13016
13126
|
}
|
|
13127
|
+
async preloadActiveStory(story) {
|
|
13128
|
+
const cacheConfig = this.storyManager.config.cache;
|
|
13129
|
+
if (!cacheConfig)
|
|
13130
|
+
return;
|
|
13131
|
+
if (cacheConfig.prefetch) {
|
|
13132
|
+
await story.preloadSlides(0, story.slidesCount, ACTIVE_STORY_PRELOAD_PRIORITY);
|
|
13133
|
+
}
|
|
13134
|
+
else {
|
|
13135
|
+
await story.preloadActiveSlide(ACTIVE_STORY_PRELOAD_PRIORITY);
|
|
13136
|
+
}
|
|
13137
|
+
}
|
|
13138
|
+
async preloadSiblingStories(stories) {
|
|
13139
|
+
const cacheConfig = this.storyManager.config.cache;
|
|
13140
|
+
if (!cacheConfig)
|
|
13141
|
+
return;
|
|
13142
|
+
if (cacheConfig.prefetch) {
|
|
13143
|
+
await Promise.all(stories.map(story => story.preloadSlides(0, 2, NON_ACTIVE_STORY_PRELOAD_PRIORITY)));
|
|
13144
|
+
}
|
|
13145
|
+
else {
|
|
13146
|
+
await Promise.all(stories.map(story => story.preloadActiveSlide(NON_ACTIVE_STORY_PRELOAD_PRIORITY)));
|
|
13147
|
+
}
|
|
13148
|
+
}
|
|
13017
13149
|
},
|
|
13018
13150
|
_StoryReaderNavigationController__activeStory_accessor_storage = new WeakMap(),
|
|
13019
13151
|
_StoryReaderNavigationController__currentIndex_accessor_storage = new WeakMap(),
|
|
@@ -13051,129 +13183,81 @@ let StoryReaderNavigationController = (() => {
|
|
|
13051
13183
|
|
|
13052
13184
|
|
|
13053
13185
|
;// CONCATENATED MODULE: ../core/src/readers/storyReader/storyReaderViewModel/storyDisplayStrategies/showOnboardingStoriesStrategy.ts
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13186
|
+
|
|
13187
|
+
class ShowOnboardingStoriesStrategy {
|
|
13188
|
+
constructor(showMultipleStoriesStrategy, storyManager) {
|
|
13189
|
+
Object.defineProperty(this, "showMultipleStoriesStrategy", {
|
|
13190
|
+
enumerable: true,
|
|
13191
|
+
configurable: true,
|
|
13192
|
+
writable: true,
|
|
13193
|
+
value: showMultipleStoriesStrategy
|
|
13194
|
+
});
|
|
13195
|
+
Object.defineProperty(this, "storyManager", {
|
|
13196
|
+
enumerable: true,
|
|
13197
|
+
configurable: true,
|
|
13198
|
+
writable: true,
|
|
13199
|
+
value: storyManager
|
|
13200
|
+
});
|
|
13201
|
+
Object.defineProperty(this, "_feed", {
|
|
13202
|
+
enumerable: true,
|
|
13203
|
+
configurable: true,
|
|
13204
|
+
writable: true,
|
|
13205
|
+
value: null
|
|
13206
|
+
});
|
|
13058
13207
|
}
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
var showOnboardingStoriesStrategy_esDecorate = (undefined && undefined.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
13062
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
13063
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
13064
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
13065
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13066
|
-
var _, done = false;
|
|
13067
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
13068
|
-
var context = {};
|
|
13069
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
13070
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
13071
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13072
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13073
|
-
if (kind === "accessor") {
|
|
13074
|
-
if (result === void 0) continue;
|
|
13075
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
13076
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
13077
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
13078
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
13079
|
-
}
|
|
13080
|
-
else if (_ = accept(result)) {
|
|
13081
|
-
if (kind === "field") initializers.unshift(_);
|
|
13082
|
-
else descriptor[key] = _;
|
|
13083
|
-
}
|
|
13208
|
+
get feed() {
|
|
13209
|
+
return this._feed;
|
|
13084
13210
|
}
|
|
13085
|
-
|
|
13086
|
-
|
|
13087
|
-
|
|
13088
|
-
|
|
13089
|
-
|
|
13090
|
-
|
|
13091
|
-
|
|
13092
|
-
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
|
|
13096
|
-
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
|
|
13100
|
-
|
|
13101
|
-
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
13112
|
-
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
const storyFeedStore = this.storyManager.rootStore.onboardingFeedStore;
|
|
13121
|
-
const onboardingFeed = await storyFeedStore.fetchOnboardingFeed({
|
|
13122
|
-
feedSlug: payload.feedSlug,
|
|
13123
|
-
tags: (_b = payload.customTags) !== null && _b !== void 0 ? _b : [],
|
|
13124
|
-
limit: (_c = payload.limit) !== null && _c !== void 0 ? _c : undefined
|
|
13125
|
-
});
|
|
13126
|
-
this._feed = onboardingFeed;
|
|
13127
|
-
const feedLoadEvent = this.getFeedLoadEvent(onboardingFeed.slug, onboardingFeed.stories);
|
|
13128
|
-
this.emitFeedLoad(feedLoadEvent);
|
|
13129
|
-
if (!onboardingFeed.stories.length)
|
|
13130
|
-
return feedLoadEvent;
|
|
13131
|
-
await this.showMultipleStoriesStrategy.show({
|
|
13132
|
-
windowReferer: STORY_READER_WINDOW_REFERER.default,
|
|
13133
|
-
storyFeed: onboardingFeed,
|
|
13134
|
-
storyId: onboardingFeed.stories[0].id
|
|
13135
|
-
});
|
|
13136
|
-
return feedLoadEvent;
|
|
13137
|
-
}
|
|
13138
|
-
async handleNextStoryByIndex(nextStoryIndex) {
|
|
13139
|
-
this.showMultipleStoriesStrategy.handleNextStoryByIndex(nextStoryIndex);
|
|
13140
|
-
}
|
|
13141
|
-
emitFeedLoad(event) {
|
|
13142
|
-
this.storyManager.emit("feedLoad", event);
|
|
13143
|
-
}
|
|
13144
|
-
getFeedLoadEvent(feed, onboardingStories) {
|
|
13145
|
-
const stories = onboardingStories.map(story => {
|
|
13146
|
-
const additionalPayload = {
|
|
13147
|
-
title: null,
|
|
13148
|
-
slidesCount: null
|
|
13149
|
-
};
|
|
13150
|
-
if (story) {
|
|
13151
|
-
additionalPayload.title = story.statTitle;
|
|
13152
|
-
additionalPayload.slidesCount = story.slidesCount;
|
|
13153
|
-
}
|
|
13154
|
-
return Object.assign({ id: story.id }, additionalPayload);
|
|
13155
|
-
});
|
|
13156
|
-
const eventData = {
|
|
13157
|
-
stories,
|
|
13158
|
-
feed: null,
|
|
13159
|
-
filter: null
|
|
13160
|
-
};
|
|
13161
|
-
eventData.feed = feed;
|
|
13162
|
-
return eventData;
|
|
13163
|
-
}
|
|
13164
|
-
async reload(payload) {
|
|
13165
|
-
this.showMultipleStoriesStrategy.reload(payload);
|
|
13211
|
+
async show(payload) {
|
|
13212
|
+
var _a, _b;
|
|
13213
|
+
const storyFeedStore = this.storyManager.rootStore.onboardingFeedStore;
|
|
13214
|
+
const onboardingFeed = await storyFeedStore.fetchOnboardingFeed({
|
|
13215
|
+
feedSlug: payload.feedSlug,
|
|
13216
|
+
tags: (_a = payload.customTags) !== null && _a !== void 0 ? _a : [],
|
|
13217
|
+
limit: (_b = payload.limit) !== null && _b !== void 0 ? _b : undefined
|
|
13218
|
+
});
|
|
13219
|
+
this._feed = onboardingFeed;
|
|
13220
|
+
const feedLoadEvent = this.getFeedLoadEvent(onboardingFeed.slug, onboardingFeed.stories);
|
|
13221
|
+
this.emitFeedLoad(feedLoadEvent);
|
|
13222
|
+
if (!onboardingFeed.stories.length)
|
|
13223
|
+
return feedLoadEvent;
|
|
13224
|
+
await this.showMultipleStoriesStrategy.show({
|
|
13225
|
+
windowReferer: STORY_READER_WINDOW_REFERER.default,
|
|
13226
|
+
storyFeed: onboardingFeed,
|
|
13227
|
+
storyId: onboardingFeed.stories[0].id
|
|
13228
|
+
});
|
|
13229
|
+
return feedLoadEvent;
|
|
13230
|
+
}
|
|
13231
|
+
async handleNextStoryByIndex(nextStoryIndex) {
|
|
13232
|
+
this.showMultipleStoriesStrategy.handleNextStoryByIndex(nextStoryIndex);
|
|
13233
|
+
}
|
|
13234
|
+
emitFeedLoad(event) {
|
|
13235
|
+
this.storyManager.emit("feedLoad", event);
|
|
13236
|
+
}
|
|
13237
|
+
getFeedLoadEvent(feed, onboardingStories) {
|
|
13238
|
+
const stories = onboardingStories.map(story => {
|
|
13239
|
+
const additionalPayload = {
|
|
13240
|
+
title: null,
|
|
13241
|
+
slidesCount: null
|
|
13242
|
+
};
|
|
13243
|
+
if (story) {
|
|
13244
|
+
additionalPayload.title = story.statTitle;
|
|
13245
|
+
additionalPayload.slidesCount = story.slidesCount;
|
|
13166
13246
|
}
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
}
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13247
|
+
return Object.assign({ id: story.id }, additionalPayload);
|
|
13248
|
+
});
|
|
13249
|
+
const eventData = {
|
|
13250
|
+
stories,
|
|
13251
|
+
feed: null,
|
|
13252
|
+
filter: null
|
|
13253
|
+
};
|
|
13254
|
+
eventData.feed = feed;
|
|
13255
|
+
return eventData;
|
|
13256
|
+
}
|
|
13257
|
+
async reload(payload) {
|
|
13258
|
+
this.showMultipleStoriesStrategy.reload(payload);
|
|
13259
|
+
}
|
|
13260
|
+
}
|
|
13177
13261
|
|
|
13178
13262
|
;// CONCATENATED MODULE: ../core/src/readers/storyReader/storyReaderViewModel/storyDisplayStrategies/showMultipleStoriesStrategy.ts
|
|
13179
13263
|
const NUMBER_OF_LAZY_LOADED_STORIES = 2;
|
|
@@ -13284,191 +13368,95 @@ class ShowStoryFromSharePageStrategy {
|
|
|
13284
13368
|
}
|
|
13285
13369
|
|
|
13286
13370
|
;// CONCATENATED MODULE: ../core/src/readers/storyReader/storyReaderViewModel/storyDisplayStrategies/showStoryOnceStrategy.ts
|
|
13287
|
-
var showStoryOnceStrategy_runInitializers = (undefined && undefined.__runInitializers) || function (thisArg, initializers, value) {
|
|
13288
|
-
var useValue = arguments.length > 2;
|
|
13289
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
13290
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
13291
|
-
}
|
|
13292
|
-
return useValue ? value : void 0;
|
|
13293
|
-
};
|
|
13294
|
-
var showStoryOnceStrategy_esDecorate = (undefined && undefined.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
13295
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
13296
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
13297
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
13298
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13299
|
-
var _, done = false;
|
|
13300
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
13301
|
-
var context = {};
|
|
13302
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
13303
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
13304
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13305
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13306
|
-
if (kind === "accessor") {
|
|
13307
|
-
if (result === void 0) continue;
|
|
13308
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
13309
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
13310
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
13311
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
13312
|
-
}
|
|
13313
|
-
else if (_ = accept(result)) {
|
|
13314
|
-
if (kind === "field") initializers.unshift(_);
|
|
13315
|
-
else descriptor[key] = _;
|
|
13316
|
-
}
|
|
13317
|
-
}
|
|
13318
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
13319
|
-
done = true;
|
|
13320
|
-
};
|
|
13321
|
-
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
let ShowStoryOnceStrategy = (() => {
|
|
13325
|
-
var _a;
|
|
13326
|
-
let _instanceExtraInitializers = [];
|
|
13327
|
-
let _show_decorators;
|
|
13328
|
-
return _a = class ShowStoryOnceStrategy {
|
|
13329
|
-
constructor(storyManager, storyReaderViewModel) {
|
|
13330
|
-
Object.defineProperty(this, "storyManager", {
|
|
13331
|
-
enumerable: true,
|
|
13332
|
-
configurable: true,
|
|
13333
|
-
writable: true,
|
|
13334
|
-
value: (showStoryOnceStrategy_runInitializers(this, _instanceExtraInitializers), storyManager)
|
|
13335
|
-
});
|
|
13336
|
-
Object.defineProperty(this, "storyReaderViewModel", {
|
|
13337
|
-
enumerable: true,
|
|
13338
|
-
configurable: true,
|
|
13339
|
-
writable: true,
|
|
13340
|
-
value: storyReaderViewModel
|
|
13341
|
-
});
|
|
13342
|
-
}
|
|
13343
|
-
get feed() {
|
|
13344
|
-
return null;
|
|
13345
|
-
}
|
|
13346
|
-
async show(payload) {
|
|
13347
|
-
try {
|
|
13348
|
-
const storyStore = this.storyManager.rootStore.storyStore;
|
|
13349
|
-
const story = await storyStore.fetchStoryById({
|
|
13350
|
-
storyId: payload.storyId,
|
|
13351
|
-
feedSlug: "",
|
|
13352
|
-
once: true
|
|
13353
|
-
});
|
|
13354
|
-
if (story.error)
|
|
13355
|
-
throw story.error;
|
|
13356
|
-
if (story.isOpened)
|
|
13357
|
-
throw new IasStoryAlreadyShownError(payload.storyId.toString());
|
|
13358
|
-
this.openStoryReader(story);
|
|
13359
|
-
}
|
|
13360
|
-
catch (error) {
|
|
13361
|
-
this.storyReaderViewModel.close();
|
|
13362
|
-
throw error;
|
|
13363
|
-
}
|
|
13364
|
-
}
|
|
13365
|
-
openStoryReader(story) {
|
|
13366
|
-
this.storyReaderViewModel.open({
|
|
13367
|
-
windowReferer: STORY_READER_WINDOW_REFERER.default,
|
|
13368
|
-
id: story.id,
|
|
13369
|
-
stories: [story]
|
|
13370
|
-
});
|
|
13371
|
-
}
|
|
13372
|
-
async handleNextStoryByIndex(storyIndex) { }
|
|
13373
|
-
async reload(payload) { }
|
|
13374
|
-
},
|
|
13375
|
-
(() => {
|
|
13376
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
13377
|
-
_show_decorators = [noConcurrent];
|
|
13378
|
-
showStoryOnceStrategy_esDecorate(_a, null, _show_decorators, { kind: "method", name: "show", static: false, private: false, access: { has: obj => "show" in obj, get: obj => obj.show }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
13379
|
-
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
13380
|
-
})(),
|
|
13381
|
-
_a;
|
|
13382
|
-
})();
|
|
13383
13371
|
|
|
13384
13372
|
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13373
|
+
class ShowStoryOnceStrategy {
|
|
13374
|
+
constructor(storyManager, storyReaderViewModel) {
|
|
13375
|
+
Object.defineProperty(this, "storyManager", {
|
|
13376
|
+
enumerable: true,
|
|
13377
|
+
configurable: true,
|
|
13378
|
+
writable: true,
|
|
13379
|
+
value: storyManager
|
|
13380
|
+
});
|
|
13381
|
+
Object.defineProperty(this, "storyReaderViewModel", {
|
|
13382
|
+
enumerable: true,
|
|
13383
|
+
configurable: true,
|
|
13384
|
+
writable: true,
|
|
13385
|
+
value: storyReaderViewModel
|
|
13386
|
+
});
|
|
13390
13387
|
}
|
|
13391
|
-
|
|
13392
|
-
|
|
13393
|
-
|
|
13394
|
-
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
13400
|
-
|
|
13401
|
-
|
|
13402
|
-
|
|
13403
|
-
|
|
13404
|
-
|
|
13405
|
-
|
|
13406
|
-
|
|
13407
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
13408
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
13409
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
13410
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
13388
|
+
get feed() {
|
|
13389
|
+
return null;
|
|
13390
|
+
}
|
|
13391
|
+
async show(payload) {
|
|
13392
|
+
try {
|
|
13393
|
+
const storyStore = this.storyManager.rootStore.storyStore;
|
|
13394
|
+
const story = await storyStore.fetchStoryById({
|
|
13395
|
+
storyId: payload.storyId,
|
|
13396
|
+
feedSlug: "",
|
|
13397
|
+
once: true
|
|
13398
|
+
});
|
|
13399
|
+
if (story.error)
|
|
13400
|
+
throw story.error;
|
|
13401
|
+
if (story.isOpened)
|
|
13402
|
+
throw new IasStoryAlreadyShownError(payload.storyId.toString());
|
|
13403
|
+
this.openStoryReader(story);
|
|
13411
13404
|
}
|
|
13412
|
-
|
|
13413
|
-
|
|
13414
|
-
|
|
13405
|
+
catch (error) {
|
|
13406
|
+
this.storyReaderViewModel.close();
|
|
13407
|
+
throw error;
|
|
13415
13408
|
}
|
|
13416
13409
|
}
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13410
|
+
openStoryReader(story) {
|
|
13411
|
+
this.storyReaderViewModel.open({
|
|
13412
|
+
windowReferer: STORY_READER_WINDOW_REFERER.default,
|
|
13413
|
+
id: story.id,
|
|
13414
|
+
stories: [story]
|
|
13415
|
+
});
|
|
13416
|
+
}
|
|
13417
|
+
async handleNextStoryByIndex(storyIndex) { }
|
|
13418
|
+
async reload(payload) { }
|
|
13419
|
+
}
|
|
13421
13420
|
|
|
13422
|
-
|
|
13423
|
-
var _a;
|
|
13424
|
-
let _instanceExtraInitializers = [];
|
|
13425
|
-
let _show_decorators;
|
|
13426
|
-
return _a = class ShowStoryStrategy {
|
|
13427
|
-
constructor(storyManager, storyReaderViewModel) {
|
|
13428
|
-
Object.defineProperty(this, "storyManager", {
|
|
13429
|
-
enumerable: true,
|
|
13430
|
-
configurable: true,
|
|
13431
|
-
writable: true,
|
|
13432
|
-
value: (showStoryStrategy_runInitializers(this, _instanceExtraInitializers), storyManager)
|
|
13433
|
-
});
|
|
13434
|
-
Object.defineProperty(this, "storyReaderViewModel", {
|
|
13435
|
-
enumerable: true,
|
|
13436
|
-
configurable: true,
|
|
13437
|
-
writable: true,
|
|
13438
|
-
value: storyReaderViewModel
|
|
13439
|
-
});
|
|
13440
|
-
}
|
|
13441
|
-
get feed() {
|
|
13442
|
-
return null;
|
|
13443
|
-
}
|
|
13444
|
-
async show(payload) {
|
|
13445
|
-
const storyStore = this.storyManager.rootStore.storyStore;
|
|
13446
|
-
const story = await storyStore.fetchStoryById({
|
|
13447
|
-
storyId: payload.storyId,
|
|
13448
|
-
feedSlug: "",
|
|
13449
|
-
fetchShareUrl: payload.fetchShareUrl
|
|
13450
|
-
});
|
|
13451
|
-
this.openStoryReader(story, payload);
|
|
13452
|
-
}
|
|
13453
|
-
openStoryReader(story, payload) {
|
|
13454
|
-
this.storyReaderViewModel.open({
|
|
13455
|
-
windowReferer: STORY_READER_WINDOW_REFERER.default,
|
|
13456
|
-
id: story.id,
|
|
13457
|
-
stories: [story]
|
|
13458
|
-
});
|
|
13459
|
-
}
|
|
13460
|
-
async handleNextStoryByIndex(storyIndex) { }
|
|
13461
|
-
async reload(payload) { }
|
|
13462
|
-
},
|
|
13463
|
-
(() => {
|
|
13464
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
13465
|
-
_show_decorators = [noConcurrent];
|
|
13466
|
-
showStoryStrategy_esDecorate(_a, null, _show_decorators, { kind: "method", name: "show", static: false, private: false, access: { has: obj => "show" in obj, get: obj => obj.show }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
13467
|
-
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
13468
|
-
})(),
|
|
13469
|
-
_a;
|
|
13470
|
-
})();
|
|
13421
|
+
;// CONCATENATED MODULE: ../core/src/readers/storyReader/storyReaderViewModel/storyDisplayStrategies/showStoryStrategy.ts
|
|
13471
13422
|
|
|
13423
|
+
class ShowStoryStrategy {
|
|
13424
|
+
constructor(storyManager, storyReaderViewModel) {
|
|
13425
|
+
Object.defineProperty(this, "storyManager", {
|
|
13426
|
+
enumerable: true,
|
|
13427
|
+
configurable: true,
|
|
13428
|
+
writable: true,
|
|
13429
|
+
value: storyManager
|
|
13430
|
+
});
|
|
13431
|
+
Object.defineProperty(this, "storyReaderViewModel", {
|
|
13432
|
+
enumerable: true,
|
|
13433
|
+
configurable: true,
|
|
13434
|
+
writable: true,
|
|
13435
|
+
value: storyReaderViewModel
|
|
13436
|
+
});
|
|
13437
|
+
}
|
|
13438
|
+
get feed() {
|
|
13439
|
+
return null;
|
|
13440
|
+
}
|
|
13441
|
+
async show(payload) {
|
|
13442
|
+
const storyStore = this.storyManager.rootStore.storyStore;
|
|
13443
|
+
const story = await storyStore.fetchStoryById({
|
|
13444
|
+
storyId: payload.storyId,
|
|
13445
|
+
feedSlug: "",
|
|
13446
|
+
fetchShareUrl: payload.fetchShareUrl
|
|
13447
|
+
});
|
|
13448
|
+
this.openStoryReader(story, payload);
|
|
13449
|
+
}
|
|
13450
|
+
openStoryReader(story, payload) {
|
|
13451
|
+
this.storyReaderViewModel.open({
|
|
13452
|
+
windowReferer: STORY_READER_WINDOW_REFERER.default,
|
|
13453
|
+
id: story.id,
|
|
13454
|
+
stories: [story]
|
|
13455
|
+
});
|
|
13456
|
+
}
|
|
13457
|
+
async handleNextStoryByIndex(storyIndex) { }
|
|
13458
|
+
async reload(payload) { }
|
|
13459
|
+
}
|
|
13472
13460
|
|
|
13473
13461
|
;// CONCATENATED MODULE: ../core/src/readers/storyReader/storyReaderViewModel/storyDisplayStrategies/storyDisplayStrategyFactory.ts
|
|
13474
13462
|
|
|
@@ -13623,6 +13611,509 @@ class StoryReaderStatisticsController {
|
|
|
13623
13611
|
}
|
|
13624
13612
|
}
|
|
13625
13613
|
|
|
13614
|
+
;// CONCATENATED MODULE: ../core/src/cache/models/cacheEntry.ts
|
|
13615
|
+
class CacheEntry {
|
|
13616
|
+
constructor(url, blob, lastAccessed = Date.now()) {
|
|
13617
|
+
Object.defineProperty(this, "url", {
|
|
13618
|
+
enumerable: true,
|
|
13619
|
+
configurable: true,
|
|
13620
|
+
writable: true,
|
|
13621
|
+
value: url
|
|
13622
|
+
});
|
|
13623
|
+
Object.defineProperty(this, "blob", {
|
|
13624
|
+
enumerable: true,
|
|
13625
|
+
configurable: true,
|
|
13626
|
+
writable: true,
|
|
13627
|
+
value: blob
|
|
13628
|
+
});
|
|
13629
|
+
Object.defineProperty(this, "lastAccessed", {
|
|
13630
|
+
enumerable: true,
|
|
13631
|
+
configurable: true,
|
|
13632
|
+
writable: true,
|
|
13633
|
+
value: lastAccessed
|
|
13634
|
+
});
|
|
13635
|
+
Object.defineProperty(this, "blobUrl", {
|
|
13636
|
+
enumerable: true,
|
|
13637
|
+
configurable: true,
|
|
13638
|
+
writable: true,
|
|
13639
|
+
value: void 0
|
|
13640
|
+
});
|
|
13641
|
+
}
|
|
13642
|
+
updateLastAccessed() {
|
|
13643
|
+
this.lastAccessed = Date.now();
|
|
13644
|
+
}
|
|
13645
|
+
getOrCreateBlobUrl() {
|
|
13646
|
+
if (!this.blobUrl) {
|
|
13647
|
+
this.blobUrl = URL.createObjectURL(this.blob);
|
|
13648
|
+
}
|
|
13649
|
+
return this.blobUrl;
|
|
13650
|
+
}
|
|
13651
|
+
unlinkBlob() {
|
|
13652
|
+
if (this.blobUrl)
|
|
13653
|
+
URL.revokeObjectURL(this.blobUrl);
|
|
13654
|
+
}
|
|
13655
|
+
destroy() {
|
|
13656
|
+
this.unlinkBlob();
|
|
13657
|
+
}
|
|
13658
|
+
}
|
|
13659
|
+
|
|
13660
|
+
;// CONCATENATED MODULE: ../core/src/cache/cacheRepository.ts
|
|
13661
|
+
|
|
13662
|
+
class CacheRepository {
|
|
13663
|
+
constructor(driver) {
|
|
13664
|
+
Object.defineProperty(this, "driver", {
|
|
13665
|
+
enumerable: true,
|
|
13666
|
+
configurable: true,
|
|
13667
|
+
writable: true,
|
|
13668
|
+
value: driver
|
|
13669
|
+
});
|
|
13670
|
+
Object.defineProperty(this, "entries", {
|
|
13671
|
+
enumerable: true,
|
|
13672
|
+
configurable: true,
|
|
13673
|
+
writable: true,
|
|
13674
|
+
value: new Map()
|
|
13675
|
+
});
|
|
13676
|
+
}
|
|
13677
|
+
async get(url) {
|
|
13678
|
+
let entry = this.entries.get(url);
|
|
13679
|
+
if (!entry) {
|
|
13680
|
+
const record = await this.driver.get(url);
|
|
13681
|
+
if (!record)
|
|
13682
|
+
return;
|
|
13683
|
+
entry = new CacheEntry(record.url, record.blob, record.lastAccessed);
|
|
13684
|
+
this.entries.set(url, entry);
|
|
13685
|
+
}
|
|
13686
|
+
return entry;
|
|
13687
|
+
}
|
|
13688
|
+
async loadAllEntries() {
|
|
13689
|
+
const records = await this.driver.getAll();
|
|
13690
|
+
const entities = [];
|
|
13691
|
+
for (const record of records) {
|
|
13692
|
+
const entry = new CacheEntry(record.url, record.blob, record.lastAccessed);
|
|
13693
|
+
this.entries.set(record.url, entry);
|
|
13694
|
+
entities.push(entry);
|
|
13695
|
+
}
|
|
13696
|
+
return entities;
|
|
13697
|
+
}
|
|
13698
|
+
async save(entry) {
|
|
13699
|
+
this.entries.set(entry.url, entry);
|
|
13700
|
+
await this.driver.set({
|
|
13701
|
+
url: entry.url,
|
|
13702
|
+
blob: entry.blob,
|
|
13703
|
+
lastAccessed: entry.lastAccessed
|
|
13704
|
+
});
|
|
13705
|
+
}
|
|
13706
|
+
async updateAccessTime(entry) {
|
|
13707
|
+
this.entries.set(entry.url, entry);
|
|
13708
|
+
await this.driver.updateAccessTime(entry.url, entry.lastAccessed);
|
|
13709
|
+
}
|
|
13710
|
+
async delete(url) {
|
|
13711
|
+
this.entries.delete(url);
|
|
13712
|
+
await this.driver.delete(url);
|
|
13713
|
+
}
|
|
13714
|
+
async getAll() {
|
|
13715
|
+
return Array.from(this.entries.values());
|
|
13716
|
+
}
|
|
13717
|
+
async clear() {
|
|
13718
|
+
for (const entry of this.entries.values())
|
|
13719
|
+
entry.destroy();
|
|
13720
|
+
this.entries.clear();
|
|
13721
|
+
//await this.driver.clear();
|
|
13722
|
+
}
|
|
13723
|
+
}
|
|
13724
|
+
|
|
13725
|
+
;// CONCATENATED MODULE: ../core/src/cache/drivers/indexedDBDriver.ts
|
|
13726
|
+
class IndexedDBCacheDriver {
|
|
13727
|
+
constructor(dbName, storeName) {
|
|
13728
|
+
Object.defineProperty(this, "dbName", {
|
|
13729
|
+
enumerable: true,
|
|
13730
|
+
configurable: true,
|
|
13731
|
+
writable: true,
|
|
13732
|
+
value: void 0
|
|
13733
|
+
});
|
|
13734
|
+
Object.defineProperty(this, "storeName", {
|
|
13735
|
+
enumerable: true,
|
|
13736
|
+
configurable: true,
|
|
13737
|
+
writable: true,
|
|
13738
|
+
value: void 0
|
|
13739
|
+
});
|
|
13740
|
+
this.dbName = dbName;
|
|
13741
|
+
this.storeName = storeName;
|
|
13742
|
+
}
|
|
13743
|
+
async getDB() {
|
|
13744
|
+
return new Promise((resolve, reject) => {
|
|
13745
|
+
const request = indexedDB.open(this.dbName, 1);
|
|
13746
|
+
request.onupgradeneeded = () => {
|
|
13747
|
+
const db = request.result;
|
|
13748
|
+
if (!db.objectStoreNames.contains(this.storeName)) {
|
|
13749
|
+
const store = db.createObjectStore(this.storeName, { keyPath: "url" });
|
|
13750
|
+
store.createIndex("lastAccessed", "lastAccessed");
|
|
13751
|
+
}
|
|
13752
|
+
};
|
|
13753
|
+
request.onsuccess = () => resolve(request.result);
|
|
13754
|
+
request.onerror = () => reject(request.error);
|
|
13755
|
+
});
|
|
13756
|
+
}
|
|
13757
|
+
async get(url) {
|
|
13758
|
+
const db = await this.getDB();
|
|
13759
|
+
return new Promise((resolve, reject) => {
|
|
13760
|
+
const tx = db.transaction(this.storeName, "readonly");
|
|
13761
|
+
const store = tx.objectStore(this.storeName);
|
|
13762
|
+
const request = store.get(url);
|
|
13763
|
+
request.onsuccess = () => {
|
|
13764
|
+
const result = request.result;
|
|
13765
|
+
resolve(result ? { url, lastAccessed: result.lastAccessed, blob: result.blob } : undefined);
|
|
13766
|
+
};
|
|
13767
|
+
request.onerror = () => reject(request.error);
|
|
13768
|
+
});
|
|
13769
|
+
}
|
|
13770
|
+
async set(record) {
|
|
13771
|
+
const db = await this.getDB();
|
|
13772
|
+
return new Promise((resolve, reject) => {
|
|
13773
|
+
const tx = db.transaction(this.storeName, "readwrite");
|
|
13774
|
+
tx.objectStore(this.storeName).put(record);
|
|
13775
|
+
tx.oncomplete = () => resolve();
|
|
13776
|
+
tx.onerror = () => reject(tx.error);
|
|
13777
|
+
});
|
|
13778
|
+
}
|
|
13779
|
+
async updateAccessTime(url, lastAccessed) {
|
|
13780
|
+
const db = await this.getDB();
|
|
13781
|
+
const tx = db.transaction(this.storeName, "readwrite");
|
|
13782
|
+
const store = tx.objectStore(this.storeName);
|
|
13783
|
+
const existing = await new Promise((resolve, reject) => {
|
|
13784
|
+
const req = store.get(url);
|
|
13785
|
+
req.onsuccess = () => resolve(req.result);
|
|
13786
|
+
req.onerror = () => reject(req.error);
|
|
13787
|
+
});
|
|
13788
|
+
if (existing) {
|
|
13789
|
+
existing.lastAccessed = lastAccessed;
|
|
13790
|
+
store.put(existing);
|
|
13791
|
+
}
|
|
13792
|
+
return new Promise((resolve, reject) => {
|
|
13793
|
+
tx.oncomplete = () => resolve();
|
|
13794
|
+
tx.onerror = () => reject(tx.error);
|
|
13795
|
+
});
|
|
13796
|
+
}
|
|
13797
|
+
async delete(url) {
|
|
13798
|
+
const db = await this.getDB();
|
|
13799
|
+
return new Promise((resolve, reject) => {
|
|
13800
|
+
const tx = db.transaction(this.storeName, "readwrite");
|
|
13801
|
+
tx.objectStore(this.storeName).delete(url);
|
|
13802
|
+
tx.oncomplete = () => resolve();
|
|
13803
|
+
tx.onerror = () => reject(tx.error);
|
|
13804
|
+
});
|
|
13805
|
+
}
|
|
13806
|
+
async getAll() {
|
|
13807
|
+
const db = await this.getDB();
|
|
13808
|
+
return new Promise((resolve, reject) => {
|
|
13809
|
+
const tx = db.transaction(this.storeName, "readonly");
|
|
13810
|
+
const store = tx.objectStore(this.storeName);
|
|
13811
|
+
const request = store.getAll();
|
|
13812
|
+
request.onsuccess = () => resolve(request.result);
|
|
13813
|
+
request.onerror = () => reject(request.error);
|
|
13814
|
+
});
|
|
13815
|
+
}
|
|
13816
|
+
async clear() {
|
|
13817
|
+
const db = await this.getDB();
|
|
13818
|
+
return new Promise((resolve, reject) => {
|
|
13819
|
+
const tx = db.transaction(this.storeName, "readwrite");
|
|
13820
|
+
tx.objectStore(this.storeName).clear();
|
|
13821
|
+
tx.oncomplete = () => resolve();
|
|
13822
|
+
tx.onerror = () => reject(tx.error);
|
|
13823
|
+
});
|
|
13824
|
+
}
|
|
13825
|
+
}
|
|
13826
|
+
|
|
13827
|
+
;// CONCATENATED MODULE: ../core/src/cache/drivers/memoryCacheDriver.ts
|
|
13828
|
+
class MemoryCacheDriver {
|
|
13829
|
+
constructor() {
|
|
13830
|
+
Object.defineProperty(this, "store", {
|
|
13831
|
+
enumerable: true,
|
|
13832
|
+
configurable: true,
|
|
13833
|
+
writable: true,
|
|
13834
|
+
value: new Map()
|
|
13835
|
+
});
|
|
13836
|
+
}
|
|
13837
|
+
async get(url) {
|
|
13838
|
+
return this.store.get(url);
|
|
13839
|
+
}
|
|
13840
|
+
async set(record) {
|
|
13841
|
+
this.store.set(record.url, record);
|
|
13842
|
+
}
|
|
13843
|
+
async delete(url) {
|
|
13844
|
+
this.store.delete(url);
|
|
13845
|
+
}
|
|
13846
|
+
async getAll() {
|
|
13847
|
+
return Array.from(this.store.values());
|
|
13848
|
+
}
|
|
13849
|
+
async clear() {
|
|
13850
|
+
this.store.clear();
|
|
13851
|
+
}
|
|
13852
|
+
async updateAccessTime(url, lastAccessed) {
|
|
13853
|
+
const record = await this.get(url);
|
|
13854
|
+
if (!record)
|
|
13855
|
+
return;
|
|
13856
|
+
record.lastAccessed = lastAccessed;
|
|
13857
|
+
this.set(record);
|
|
13858
|
+
}
|
|
13859
|
+
}
|
|
13860
|
+
|
|
13861
|
+
;// CONCATENATED MODULE: ../core/src/cache/lruCache.ts
|
|
13862
|
+
|
|
13863
|
+
|
|
13864
|
+
class LRUCache {
|
|
13865
|
+
constructor(repository, loader, options) {
|
|
13866
|
+
var _a, _b;
|
|
13867
|
+
Object.defineProperty(this, "repository", {
|
|
13868
|
+
enumerable: true,
|
|
13869
|
+
configurable: true,
|
|
13870
|
+
writable: true,
|
|
13871
|
+
value: repository
|
|
13872
|
+
});
|
|
13873
|
+
Object.defineProperty(this, "loader", {
|
|
13874
|
+
enumerable: true,
|
|
13875
|
+
configurable: true,
|
|
13876
|
+
writable: true,
|
|
13877
|
+
value: loader
|
|
13878
|
+
});
|
|
13879
|
+
Object.defineProperty(this, "urlLocks", {
|
|
13880
|
+
enumerable: true,
|
|
13881
|
+
configurable: true,
|
|
13882
|
+
writable: true,
|
|
13883
|
+
value: new Map()
|
|
13884
|
+
});
|
|
13885
|
+
Object.defineProperty(this, "options", {
|
|
13886
|
+
enumerable: true,
|
|
13887
|
+
configurable: true,
|
|
13888
|
+
writable: true,
|
|
13889
|
+
value: void 0
|
|
13890
|
+
});
|
|
13891
|
+
this.options = {
|
|
13892
|
+
maxSize: (_a = options === null || options === void 0 ? void 0 : options.maxSize) !== null && _a !== void 0 ? _a : 20,
|
|
13893
|
+
debug: Boolean(options === null || options === void 0 ? void 0 : options.debug),
|
|
13894
|
+
ttl: (_b = options === null || options === void 0 ? void 0 : options.ttl) !== null && _b !== void 0 ? _b : 3600
|
|
13895
|
+
};
|
|
13896
|
+
}
|
|
13897
|
+
async init() {
|
|
13898
|
+
await this.repository.loadAllEntries();
|
|
13899
|
+
await this.tryEvict();
|
|
13900
|
+
}
|
|
13901
|
+
async getAll() {
|
|
13902
|
+
return this.repository.getAll();
|
|
13903
|
+
}
|
|
13904
|
+
async get(url, priority) {
|
|
13905
|
+
const mutex = this.getMutexForUrl(url);
|
|
13906
|
+
const release = await mutex.acquire();
|
|
13907
|
+
try {
|
|
13908
|
+
let entry = await this.repository.get(url);
|
|
13909
|
+
if (!entry)
|
|
13910
|
+
entry = await this.add(url, priority);
|
|
13911
|
+
entry.updateLastAccessed();
|
|
13912
|
+
entry.getOrCreateBlobUrl();
|
|
13913
|
+
if (this.options.debug)
|
|
13914
|
+
console.log("[IAS]: Get from cache", entry);
|
|
13915
|
+
await this.repository.updateAccessTime(entry);
|
|
13916
|
+
return entry;
|
|
13917
|
+
}
|
|
13918
|
+
finally {
|
|
13919
|
+
release();
|
|
13920
|
+
}
|
|
13921
|
+
}
|
|
13922
|
+
async tryEvict() {
|
|
13923
|
+
const expiredEntries = await this.evictExpired();
|
|
13924
|
+
const oldestEntries = await this.evictOldest();
|
|
13925
|
+
return [...expiredEntries, ...oldestEntries];
|
|
13926
|
+
}
|
|
13927
|
+
async evictOldest() {
|
|
13928
|
+
const entries = await this.repository.getAll();
|
|
13929
|
+
if (entries.length <= this.options.maxSize)
|
|
13930
|
+
return [];
|
|
13931
|
+
const evictedEntries = [];
|
|
13932
|
+
const sorted = entries.sort((a, b) => a.lastAccessed - b.lastAccessed);
|
|
13933
|
+
while (sorted.length > this.options.maxSize) {
|
|
13934
|
+
const entry = sorted.shift();
|
|
13935
|
+
if (!entry)
|
|
13936
|
+
continue;
|
|
13937
|
+
if (this.options.debug)
|
|
13938
|
+
console.log("[IAS]: Remove oldest entry from cache", entry);
|
|
13939
|
+
await this.removeEntry(entry);
|
|
13940
|
+
evictedEntries.push(entry);
|
|
13941
|
+
}
|
|
13942
|
+
return evictedEntries;
|
|
13943
|
+
}
|
|
13944
|
+
async wait() {
|
|
13945
|
+
await Promise.all(Array.from(this.urlLocks.values()).map(urlLock => urlLock.waitForUnlock()));
|
|
13946
|
+
}
|
|
13947
|
+
async evictExpired() {
|
|
13948
|
+
if (this.options.ttl === 0)
|
|
13949
|
+
return [];
|
|
13950
|
+
const entries = await this.repository.getAll();
|
|
13951
|
+
const now = Date.now();
|
|
13952
|
+
const evictedEntries = [];
|
|
13953
|
+
for (const entry of entries) {
|
|
13954
|
+
if (entry.lastAccessed + this.options.ttl * 1000 < now) {
|
|
13955
|
+
if (this.options.debug)
|
|
13956
|
+
console.log("[IAS]: Remove expired entry from cache", entry);
|
|
13957
|
+
await this.removeEntry(entry);
|
|
13958
|
+
evictedEntries.push(entry);
|
|
13959
|
+
}
|
|
13960
|
+
}
|
|
13961
|
+
return evictedEntries;
|
|
13962
|
+
}
|
|
13963
|
+
async add(url, priority) {
|
|
13964
|
+
const blob = await this.loader.enqueue(url, priority);
|
|
13965
|
+
const entry = new CacheEntry(url, blob);
|
|
13966
|
+
await this.repository.save(entry);
|
|
13967
|
+
await this.tryEvict();
|
|
13968
|
+
if (this.options.debug)
|
|
13969
|
+
console.log("[IAS]: Add to cache", entry);
|
|
13970
|
+
return entry;
|
|
13971
|
+
}
|
|
13972
|
+
getMutexForUrl(url) {
|
|
13973
|
+
let mutex = this.urlLocks.get(url);
|
|
13974
|
+
if (!mutex) {
|
|
13975
|
+
mutex = new external_async_mutex_namespaceObject.Mutex();
|
|
13976
|
+
this.urlLocks.set(url, mutex);
|
|
13977
|
+
}
|
|
13978
|
+
return mutex;
|
|
13979
|
+
}
|
|
13980
|
+
cleanupLock(url) {
|
|
13981
|
+
this.urlLocks.delete(url);
|
|
13982
|
+
}
|
|
13983
|
+
async removeEntry(entry) {
|
|
13984
|
+
entry.destroy();
|
|
13985
|
+
this.cleanupLock(entry.url);
|
|
13986
|
+
await this.repository.delete(entry.url);
|
|
13987
|
+
}
|
|
13988
|
+
}
|
|
13989
|
+
|
|
13990
|
+
;// CONCATENATED MODULE: ../core/src/cache/resourceLoader.ts
|
|
13991
|
+
|
|
13992
|
+
class ResourceLoader {
|
|
13993
|
+
constructor(concurrency) {
|
|
13994
|
+
Object.defineProperty(this, "concurrency", {
|
|
13995
|
+
enumerable: true,
|
|
13996
|
+
configurable: true,
|
|
13997
|
+
writable: true,
|
|
13998
|
+
value: concurrency
|
|
13999
|
+
});
|
|
14000
|
+
Object.defineProperty(this, "semaphore", {
|
|
14001
|
+
enumerable: true,
|
|
14002
|
+
configurable: true,
|
|
14003
|
+
writable: true,
|
|
14004
|
+
value: void 0
|
|
14005
|
+
});
|
|
14006
|
+
this.semaphore = new external_async_mutex_namespaceObject.Semaphore(concurrency);
|
|
14007
|
+
}
|
|
14008
|
+
async enqueue(url, priority) {
|
|
14009
|
+
return await this.semaphore.runExclusive(async () => {
|
|
14010
|
+
const response = await fetch(url, { cache: "no-store" });
|
|
14011
|
+
const blob = await response.blob();
|
|
14012
|
+
return blob;
|
|
14013
|
+
}, 1, priority);
|
|
14014
|
+
}
|
|
14015
|
+
wait() {
|
|
14016
|
+
return this.semaphore.waitForUnlock(this.concurrency);
|
|
14017
|
+
}
|
|
14018
|
+
clear() {
|
|
14019
|
+
this.semaphore.cancel();
|
|
14020
|
+
}
|
|
14021
|
+
async destroy() {
|
|
14022
|
+
this.clear();
|
|
14023
|
+
await this.wait();
|
|
14024
|
+
}
|
|
14025
|
+
}
|
|
14026
|
+
|
|
14027
|
+
;// CONCATENATED MODULE: ../core/src/cache/cacheManager.ts
|
|
14028
|
+
|
|
14029
|
+
|
|
14030
|
+
|
|
14031
|
+
|
|
14032
|
+
const CACHE_VERSION = 1;
|
|
14033
|
+
class CacheManager {
|
|
14034
|
+
get isDestroyed() {
|
|
14035
|
+
return this._isDestroyed;
|
|
14036
|
+
}
|
|
14037
|
+
constructor(options) {
|
|
14038
|
+
var _a, _b, _c, _d, _e;
|
|
14039
|
+
Object.defineProperty(this, "lruCache", {
|
|
14040
|
+
enumerable: true,
|
|
14041
|
+
configurable: true,
|
|
14042
|
+
writable: true,
|
|
14043
|
+
value: void 0
|
|
14044
|
+
});
|
|
14045
|
+
Object.defineProperty(this, "loader", {
|
|
14046
|
+
enumerable: true,
|
|
14047
|
+
configurable: true,
|
|
14048
|
+
writable: true,
|
|
14049
|
+
value: void 0
|
|
14050
|
+
});
|
|
14051
|
+
Object.defineProperty(this, "cacheRepository", {
|
|
14052
|
+
enumerable: true,
|
|
14053
|
+
configurable: true,
|
|
14054
|
+
writable: true,
|
|
14055
|
+
value: void 0
|
|
14056
|
+
});
|
|
14057
|
+
Object.defineProperty(this, "options", {
|
|
14058
|
+
enumerable: true,
|
|
14059
|
+
configurable: true,
|
|
14060
|
+
writable: true,
|
|
14061
|
+
value: void 0
|
|
14062
|
+
});
|
|
14063
|
+
Object.defineProperty(this, "_isDestroyed", {
|
|
14064
|
+
enumerable: true,
|
|
14065
|
+
configurable: true,
|
|
14066
|
+
writable: true,
|
|
14067
|
+
value: false
|
|
14068
|
+
});
|
|
14069
|
+
this.options = {
|
|
14070
|
+
maxSize: (_a = options.maxSize) !== null && _a !== void 0 ? _a : 20,
|
|
14071
|
+
concurrency: (_b = options.concurrency) !== null && _b !== void 0 ? _b : 5,
|
|
14072
|
+
debug: Boolean(options.debug),
|
|
14073
|
+
ttl: (_c = options.ttl) !== null && _c !== void 0 ? _c : 3600,
|
|
14074
|
+
type: (_d = options.type) !== null && _d !== void 0 ? _d : "indexeddb",
|
|
14075
|
+
storeName: (_e = options.storeName) !== null && _e !== void 0 ? _e : "resources"
|
|
14076
|
+
};
|
|
14077
|
+
const driver = this.createCacheDriver();
|
|
14078
|
+
this.cacheRepository = new CacheRepository(driver);
|
|
14079
|
+
this.loader = new ResourceLoader(this.options.concurrency);
|
|
14080
|
+
this.lruCache = new LRUCache(this.cacheRepository, this.loader, {
|
|
14081
|
+
maxSize: this.options.maxSize,
|
|
14082
|
+
debug: this.options.debug,
|
|
14083
|
+
ttl: this.options.ttl
|
|
14084
|
+
});
|
|
14085
|
+
this.lruCache.init().catch(error => console.error("[IAS]: LRU cache init error", error));
|
|
14086
|
+
}
|
|
14087
|
+
async preload(requests) {
|
|
14088
|
+
const results = await Promise.allSettled(requests.map(async (request) => {
|
|
14089
|
+
return await this.lruCache.get(request.url, request.priority);
|
|
14090
|
+
}));
|
|
14091
|
+
return results
|
|
14092
|
+
.filter((r) => r.status === "fulfilled" && r.value !== null)
|
|
14093
|
+
.map(r => r.value);
|
|
14094
|
+
}
|
|
14095
|
+
async destroy() {
|
|
14096
|
+
try {
|
|
14097
|
+
this._isDestroyed = true;
|
|
14098
|
+
await this.loader.destroy();
|
|
14099
|
+
await this.lruCache.wait();
|
|
14100
|
+
}
|
|
14101
|
+
finally {
|
|
14102
|
+
await this.cacheRepository.clear();
|
|
14103
|
+
if (this.options.debug)
|
|
14104
|
+
console.log("[IAS]: Destroy LRU cache");
|
|
14105
|
+
}
|
|
14106
|
+
}
|
|
14107
|
+
createCacheDriver() {
|
|
14108
|
+
if (this.options.type === "indexeddb")
|
|
14109
|
+
return new IndexedDBCacheDriver(`ias-cache-v${CACHE_VERSION}`, this.options.storeName);
|
|
14110
|
+
return new MemoryCacheDriver();
|
|
14111
|
+
}
|
|
14112
|
+
}
|
|
14113
|
+
|
|
14114
|
+
;// CONCATENATED MODULE: ../core/src/cache/index.ts
|
|
14115
|
+
|
|
14116
|
+
|
|
13626
14117
|
;// CONCATENATED MODULE: ../core/src/readers/storyReader/storyReaderViewModel/storyReaderViewModel.ts
|
|
13627
14118
|
var storyReaderViewModel_runInitializers = (undefined && undefined.__runInitializers) || function (thisArg, initializers, value) {
|
|
13628
14119
|
var useValue = arguments.length > 2;
|
|
@@ -13679,6 +14170,8 @@ var storyReaderViewModel_classPrivateFieldSet = (undefined && undefined.__classP
|
|
|
13679
14170
|
|
|
13680
14171
|
|
|
13681
14172
|
|
|
14173
|
+
|
|
14174
|
+
|
|
13682
14175
|
var StoryReaderEvent;
|
|
13683
14176
|
(function (StoryReaderEvent) {
|
|
13684
14177
|
StoryReaderEvent["Close"] = "closeStoryReader";
|
|
@@ -13711,6 +14204,11 @@ let StoryReaderViewModel = (() => {
|
|
|
13711
14204
|
let _get_reachEnd_decorators;
|
|
13712
14205
|
let _open_decorators;
|
|
13713
14206
|
let _close_decorators;
|
|
14207
|
+
let _showStory_decorators;
|
|
14208
|
+
let _showStoryOnce_decorators;
|
|
14209
|
+
let _showStoryFromSharePage_decorators;
|
|
14210
|
+
let _showOnboardingStories_decorators;
|
|
14211
|
+
let _showMultipleStories_decorators;
|
|
13714
14212
|
let _reloadStory_decorators;
|
|
13715
14213
|
let _nextStory_decorators;
|
|
13716
14214
|
let _prevStory_decorators;
|
|
@@ -13800,6 +14298,12 @@ let StoryReaderViewModel = (() => {
|
|
|
13800
14298
|
writable: true,
|
|
13801
14299
|
value: false
|
|
13802
14300
|
});
|
|
14301
|
+
Object.defineProperty(this, "cacheManager", {
|
|
14302
|
+
enumerable: true,
|
|
14303
|
+
configurable: true,
|
|
14304
|
+
writable: true,
|
|
14305
|
+
value: null
|
|
14306
|
+
});
|
|
13803
14307
|
this.handleWindowUnload = this.handleWindowUnload.bind(this);
|
|
13804
14308
|
this.handleKeydown = this.handleKeydown.bind(this);
|
|
13805
14309
|
window.addEventListener("beforeunload", this.handleWindowUnload);
|
|
@@ -13853,6 +14357,8 @@ let StoryReaderViewModel = (() => {
|
|
|
13853
14357
|
var _b, _c;
|
|
13854
14358
|
if (this.activeStory)
|
|
13855
14359
|
this.resetReaderToDefaultState(this.activeStory);
|
|
14360
|
+
if (this.storyManager.config.cache)
|
|
14361
|
+
this.cacheManager = new CacheManager(this.storyManager.config.cache);
|
|
13856
14362
|
this.windowReferer = payload.windowReferer;
|
|
13857
14363
|
this.setStories(payload.stories);
|
|
13858
14364
|
const activeStory = this.navigationController.setActiveStoryById(payload.id);
|
|
@@ -13890,6 +14396,7 @@ let StoryReaderViewModel = (() => {
|
|
|
13890
14396
|
});
|
|
13891
14397
|
}
|
|
13892
14398
|
resetReaderToDefaultState(activeStory, closeAction) {
|
|
14399
|
+
var _b;
|
|
13893
14400
|
const event = new CloseStoryEvent(activeStory, {
|
|
13894
14401
|
action: closeAction
|
|
13895
14402
|
});
|
|
@@ -13904,6 +14411,7 @@ let StoryReaderViewModel = (() => {
|
|
|
13904
14411
|
this._touchController.destroy();
|
|
13905
14412
|
document.removeEventListener("keydown", this.handleKeydown);
|
|
13906
14413
|
this.navigationController.destroy();
|
|
14414
|
+
(_b = this.cacheManager) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
13907
14415
|
}
|
|
13908
14416
|
canBeClosed() {
|
|
13909
14417
|
return this.activeStory ? !this.activeStory.disableClose : false;
|
|
@@ -13973,12 +14481,14 @@ let StoryReaderViewModel = (() => {
|
|
|
13973
14481
|
this.navigationController.navigateStoryWithAnimation(index, action);
|
|
13974
14482
|
}
|
|
13975
14483
|
destroy() {
|
|
14484
|
+
var _b;
|
|
13976
14485
|
if (this.activeStory) {
|
|
13977
14486
|
this.emitCloseEvents(this.activeStory, CloseStoryReaderAction.AppClose);
|
|
13978
14487
|
this.resetReaderToDefaultState(this.activeStory);
|
|
13979
14488
|
}
|
|
13980
14489
|
this.removeAllListeners();
|
|
13981
14490
|
window.removeEventListener("beforeunload", this.handleWindowUnload);
|
|
14491
|
+
(_b = this.cacheManager) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
13982
14492
|
}
|
|
13983
14493
|
closeGoodsWidget() {
|
|
13984
14494
|
var _b;
|
|
@@ -14049,7 +14559,7 @@ let StoryReaderViewModel = (() => {
|
|
|
14049
14559
|
setStories(stories) {
|
|
14050
14560
|
const slideApiHandlersFactory = new StorySlideApiHandlersFactory(this.storyManager, this, this.storyReaderStatisticV1Service, this.storyReaderStatisticV2Service);
|
|
14051
14561
|
for (const story of stories) {
|
|
14052
|
-
this._stories.push(new StoryViewModel(this.storyManager, this, story, slideApiHandlersFactory, this.storyReaderStatisticV1Service, this.storyReaderStatisticV2Service));
|
|
14562
|
+
this._stories.push(new StoryViewModel(this.storyManager, this, story, slideApiHandlersFactory, this.storyReaderStatisticV1Service, this.storyReaderStatisticV2Service, this.cacheManager));
|
|
14053
14563
|
}
|
|
14054
14564
|
}
|
|
14055
14565
|
handleKeydown(e) {
|
|
@@ -14104,6 +14614,11 @@ let StoryReaderViewModel = (() => {
|
|
|
14104
14614
|
_get_reachEnd_decorators = [external_mobx_namespaceObject.computed];
|
|
14105
14615
|
_open_decorators = [external_mobx_namespaceObject.action];
|
|
14106
14616
|
_close_decorators = [external_mobx_namespaceObject.action];
|
|
14617
|
+
_showStory_decorators = [noConcurrent];
|
|
14618
|
+
_showStoryOnce_decorators = [noConcurrent];
|
|
14619
|
+
_showStoryFromSharePage_decorators = [noConcurrent];
|
|
14620
|
+
_showOnboardingStories_decorators = [noConcurrent];
|
|
14621
|
+
_showMultipleStories_decorators = [noConcurrent];
|
|
14107
14622
|
_reloadStory_decorators = [external_mobx_namespaceObject.action];
|
|
14108
14623
|
_nextStory_decorators = [external_mobx_namespaceObject.action];
|
|
14109
14624
|
_prevStory_decorators = [external_mobx_namespaceObject.action];
|
|
@@ -14123,6 +14638,11 @@ let StoryReaderViewModel = (() => {
|
|
|
14123
14638
|
storyReaderViewModel_esDecorate(_a, null, _get_reachEnd_decorators, { kind: "getter", name: "reachEnd", static: false, private: false, access: { has: obj => "reachEnd" in obj, get: obj => obj.reachEnd }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14124
14639
|
storyReaderViewModel_esDecorate(_a, null, _open_decorators, { kind: "method", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14125
14640
|
storyReaderViewModel_esDecorate(_a, null, _close_decorators, { kind: "method", name: "close", static: false, private: false, access: { has: obj => "close" in obj, get: obj => obj.close }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14641
|
+
storyReaderViewModel_esDecorate(_a, null, _showStory_decorators, { kind: "method", name: "showStory", static: false, private: false, access: { has: obj => "showStory" in obj, get: obj => obj.showStory }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14642
|
+
storyReaderViewModel_esDecorate(_a, null, _showStoryOnce_decorators, { kind: "method", name: "showStoryOnce", static: false, private: false, access: { has: obj => "showStoryOnce" in obj, get: obj => obj.showStoryOnce }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14643
|
+
storyReaderViewModel_esDecorate(_a, null, _showStoryFromSharePage_decorators, { kind: "method", name: "showStoryFromSharePage", static: false, private: false, access: { has: obj => "showStoryFromSharePage" in obj, get: obj => obj.showStoryFromSharePage }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14644
|
+
storyReaderViewModel_esDecorate(_a, null, _showOnboardingStories_decorators, { kind: "method", name: "showOnboardingStories", static: false, private: false, access: { has: obj => "showOnboardingStories" in obj, get: obj => obj.showOnboardingStories }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14645
|
+
storyReaderViewModel_esDecorate(_a, null, _showMultipleStories_decorators, { kind: "method", name: "showMultipleStories", static: false, private: false, access: { has: obj => "showMultipleStories" in obj, get: obj => obj.showMultipleStories }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14126
14646
|
storyReaderViewModel_esDecorate(_a, null, _reloadStory_decorators, { kind: "method", name: "reloadStory", static: false, private: false, access: { has: obj => "reloadStory" in obj, get: obj => obj.reloadStory }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14127
14647
|
storyReaderViewModel_esDecorate(_a, null, _nextStory_decorators, { kind: "method", name: "nextStory", static: false, private: false, access: { has: obj => "nextStory" in obj, get: obj => obj.nextStory }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
14128
14648
|
storyReaderViewModel_esDecorate(_a, null, _prevStory_decorators, { kind: "method", name: "prevStory", static: false, private: false, access: { has: obj => "prevStory" in obj, get: obj => obj.prevStory }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -15140,8 +15660,12 @@ let StoryManagerConfig = (() => {
|
|
|
15140
15660
|
});
|
|
15141
15661
|
_StoryManagerConfig__anonymous_accessor_storage.set(this, storyManagerConfig_runInitializers(this, __anonymous_initializers, false));
|
|
15142
15662
|
_StoryManagerConfig__options_accessor_storage.set(this, (storyManagerConfig_runInitializers(this, __anonymous_extraInitializers), storyManagerConfig_runInitializers(this, __options_initializers, {})));
|
|
15143
|
-
|
|
15144
|
-
|
|
15663
|
+
Object.defineProperty(this, "_cache", {
|
|
15664
|
+
enumerable: true,
|
|
15665
|
+
configurable: true,
|
|
15666
|
+
writable: true,
|
|
15667
|
+
value: (storyManagerConfig_runInitializers(this, __options_extraInitializers), null)
|
|
15668
|
+
});
|
|
15145
15669
|
this.update(configDto);
|
|
15146
15670
|
this._isInited = true;
|
|
15147
15671
|
}
|
|
@@ -15187,6 +15711,9 @@ let StoryManagerConfig = (() => {
|
|
|
15187
15711
|
get options() {
|
|
15188
15712
|
return this._options;
|
|
15189
15713
|
}
|
|
15714
|
+
get cache() {
|
|
15715
|
+
return this._cache;
|
|
15716
|
+
}
|
|
15190
15717
|
disableStatistic() {
|
|
15191
15718
|
this._isStatisticsDisabled = true;
|
|
15192
15719
|
}
|
|
@@ -15271,9 +15798,10 @@ let StoryManagerConfig = (() => {
|
|
|
15271
15798
|
this._options = options;
|
|
15272
15799
|
}
|
|
15273
15800
|
update(configDto) {
|
|
15274
|
-
var _b, _c, _d, _e, _f;
|
|
15801
|
+
var _b, _c, _d, _e, _f, _g;
|
|
15275
15802
|
this._appPackageId = (_b = configDto.appPackageId) !== null && _b !== void 0 ? _b : "";
|
|
15276
15803
|
this._disableDeviceId = Boolean(configDto.disableDeviceId);
|
|
15804
|
+
this.setOptions(configDto.options);
|
|
15277
15805
|
this.setApiKey(configDto.apiKey);
|
|
15278
15806
|
this.setAnonymous(configDto.anonymous);
|
|
15279
15807
|
this.setUserId((_c = configDto.userId) !== null && _c !== void 0 ? _c : "", configDto.userIdSign);
|
|
@@ -15282,7 +15810,7 @@ let StoryManagerConfig = (() => {
|
|
|
15282
15810
|
this.setImagePlaceholders((_e = configDto.imagePlaceholders) !== null && _e !== void 0 ? _e : {});
|
|
15283
15811
|
this.setTags((_f = configDto.tags) !== null && _f !== void 0 ? _f : []);
|
|
15284
15812
|
this.setDir(configDto.dir);
|
|
15285
|
-
this.
|
|
15813
|
+
this._cache = configDto.cache ? Object.assign(Object.assign({}, configDto.cache), { prefetch: (_g = configDto.cache.prefetch) !== null && _g !== void 0 ? _g : true }) : null;
|
|
15286
15814
|
}
|
|
15287
15815
|
mapTextPlaceholders(textPlaceholderDtos) {
|
|
15288
15816
|
const textPlaceholders = [];
|
|
@@ -15388,6 +15916,9 @@ class NullStoryManagerConfig {
|
|
|
15388
15916
|
get options() {
|
|
15389
15917
|
return {};
|
|
15390
15918
|
}
|
|
15919
|
+
get cache() {
|
|
15920
|
+
return null;
|
|
15921
|
+
}
|
|
15391
15922
|
disableStatistic() { }
|
|
15392
15923
|
enableStatistic() { }
|
|
15393
15924
|
async setApiKey(apiKey) { }
|
|
@@ -15557,7 +16088,7 @@ var iamMessage_classPrivateFieldSet = (undefined && undefined.__classPrivateFiel
|
|
|
15557
16088
|
|
|
15558
16089
|
const DEFAULT_ITERATION_ID = (0,external_uuid_namespaceObject.v4)();
|
|
15559
16090
|
let IamMessage = (() => {
|
|
15560
|
-
var _a, _IamMessage__id_accessor_storage, _IamMessage__events_accessor_storage, _IamMessage__type_accessor_storage, _IamMessage__slides_accessor_storage, _IamMessage__appearanceOptions_accessor_storage, _IamMessage__needPlaceholders_accessor_storage, _IamMessage__hasLimit_accessor_storage, _IamMessage__isOnceOpened_accessor_storage, _IamMessage__context_accessor_storage;
|
|
16091
|
+
var _a, _IamMessage__id_accessor_storage, _IamMessage__events_accessor_storage, _IamMessage__type_accessor_storage, _IamMessage__slides_accessor_storage, _IamMessage__appearanceOptions_accessor_storage, _IamMessage__needPlaceholders_accessor_storage, _IamMessage__hasLimit_accessor_storage, _IamMessage__disableClose_accessor_storage, _IamMessage__isOnceOpened_accessor_storage, _IamMessage__context_accessor_storage;
|
|
15561
16092
|
let _instanceExtraInitializers = [];
|
|
15562
16093
|
let __id_decorators;
|
|
15563
16094
|
let __id_initializers = [];
|
|
@@ -15580,6 +16111,9 @@ let IamMessage = (() => {
|
|
|
15580
16111
|
let __hasLimit_decorators;
|
|
15581
16112
|
let __hasLimit_initializers = [];
|
|
15582
16113
|
let __hasLimit_extraInitializers = [];
|
|
16114
|
+
let __disableClose_decorators;
|
|
16115
|
+
let __disableClose_initializers = [];
|
|
16116
|
+
let __disableClose_extraInitializers = [];
|
|
15583
16117
|
let __isOnceOpened_decorators;
|
|
15584
16118
|
let __isOnceOpened_initializers = [];
|
|
15585
16119
|
let __isOnceOpened_extraInitializers = [];
|
|
@@ -15602,6 +16136,8 @@ let IamMessage = (() => {
|
|
|
15602
16136
|
set _needPlaceholders(value) { iamMessage_classPrivateFieldSet(this, _IamMessage__needPlaceholders_accessor_storage, value, "f"); }
|
|
15603
16137
|
get _hasLimit() { return iamMessage_classPrivateFieldGet(this, _IamMessage__hasLimit_accessor_storage, "f"); }
|
|
15604
16138
|
set _hasLimit(value) { iamMessage_classPrivateFieldSet(this, _IamMessage__hasLimit_accessor_storage, value, "f"); }
|
|
16139
|
+
get _disableClose() { return iamMessage_classPrivateFieldGet(this, _IamMessage__disableClose_accessor_storage, "f"); }
|
|
16140
|
+
set _disableClose(value) { iamMessage_classPrivateFieldSet(this, _IamMessage__disableClose_accessor_storage, value, "f"); }
|
|
15605
16141
|
get _isOnceOpened() { return iamMessage_classPrivateFieldGet(this, _IamMessage__isOnceOpened_accessor_storage, "f"); }
|
|
15606
16142
|
set _isOnceOpened(value) { iamMessage_classPrivateFieldSet(this, _IamMessage__isOnceOpened_accessor_storage, value, "f"); }
|
|
15607
16143
|
get _context() { return iamMessage_classPrivateFieldGet(this, _IamMessage__context_accessor_storage, "f"); }
|
|
@@ -15614,7 +16150,8 @@ let IamMessage = (() => {
|
|
|
15614
16150
|
_IamMessage__appearanceOptions_accessor_storage.set(this, (iamMessage_runInitializers(this, __slides_extraInitializers), iamMessage_runInitializers(this, __appearanceOptions_initializers, new IamAppearanceCommonOptions({}))));
|
|
15615
16151
|
_IamMessage__needPlaceholders_accessor_storage.set(this, (iamMessage_runInitializers(this, __appearanceOptions_extraInitializers), iamMessage_runInitializers(this, __needPlaceholders_initializers, false)));
|
|
15616
16152
|
_IamMessage__hasLimit_accessor_storage.set(this, (iamMessage_runInitializers(this, __needPlaceholders_extraInitializers), iamMessage_runInitializers(this, __hasLimit_initializers, false)));
|
|
15617
|
-
|
|
16153
|
+
_IamMessage__disableClose_accessor_storage.set(this, (iamMessage_runInitializers(this, __hasLimit_extraInitializers), iamMessage_runInitializers(this, __disableClose_initializers, false)));
|
|
16154
|
+
_IamMessage__isOnceOpened_accessor_storage.set(this, (iamMessage_runInitializers(this, __disableClose_extraInitializers), iamMessage_runInitializers(this, __isOnceOpened_initializers, false)));
|
|
15618
16155
|
_IamMessage__context_accessor_storage.set(this, (iamMessage_runInitializers(this, __isOnceOpened_extraInitializers), iamMessage_runInitializers(this, __context_initializers, void 0)));
|
|
15619
16156
|
/**
|
|
15620
16157
|
* null - показывать однократно
|
|
@@ -15707,11 +16244,15 @@ let IamMessage = (() => {
|
|
|
15707
16244
|
get type() {
|
|
15708
16245
|
return this._type;
|
|
15709
16246
|
}
|
|
16247
|
+
get disableClose() {
|
|
16248
|
+
return this._disableClose;
|
|
16249
|
+
}
|
|
15710
16250
|
destroy() { }
|
|
15711
16251
|
updateByDto(messageDto) {
|
|
15712
16252
|
var _b, _c, _d;
|
|
15713
16253
|
this._events = this.mapMessageEventsByDto((_b = messageDto.events) !== null && _b !== void 0 ? _b : []);
|
|
15714
16254
|
this._type = messageDto.type;
|
|
16255
|
+
this._disableClose = Boolean(messageDto.disable_close);
|
|
15715
16256
|
this._campaignName = messageDto.campaign_name;
|
|
15716
16257
|
this._frequencyLimit = messageDto.frequency_limit;
|
|
15717
16258
|
this._displayFrom = (_c = messageDto.display_from) !== null && _c !== void 0 ? _c : null;
|
|
@@ -15775,6 +16316,7 @@ let IamMessage = (() => {
|
|
|
15775
16316
|
_IamMessage__appearanceOptions_accessor_storage = new WeakMap(),
|
|
15776
16317
|
_IamMessage__needPlaceholders_accessor_storage = new WeakMap(),
|
|
15777
16318
|
_IamMessage__hasLimit_accessor_storage = new WeakMap(),
|
|
16319
|
+
_IamMessage__disableClose_accessor_storage = new WeakMap(),
|
|
15778
16320
|
_IamMessage__isOnceOpened_accessor_storage = new WeakMap(),
|
|
15779
16321
|
_IamMessage__context_accessor_storage = new WeakMap(),
|
|
15780
16322
|
(() => {
|
|
@@ -15786,6 +16328,7 @@ let IamMessage = (() => {
|
|
|
15786
16328
|
__appearanceOptions_decorators = [external_mobx_namespaceObject.observable];
|
|
15787
16329
|
__needPlaceholders_decorators = [external_mobx_namespaceObject.observable];
|
|
15788
16330
|
__hasLimit_decorators = [external_mobx_namespaceObject.observable];
|
|
16331
|
+
__disableClose_decorators = [external_mobx_namespaceObject.observable];
|
|
15789
16332
|
__isOnceOpened_decorators = [external_mobx_namespaceObject.observable];
|
|
15790
16333
|
__context_decorators = [external_mobx_namespaceObject.observable];
|
|
15791
16334
|
_updateByDto_decorators = [external_mobx_namespaceObject.action];
|
|
@@ -15796,6 +16339,7 @@ let IamMessage = (() => {
|
|
|
15796
16339
|
iamMessage_esDecorate(_a, null, __appearanceOptions_decorators, { kind: "accessor", name: "_appearanceOptions", static: false, private: false, access: { has: obj => "_appearanceOptions" in obj, get: obj => obj._appearanceOptions, set: (obj, value) => { obj._appearanceOptions = value; } }, metadata: _metadata }, __appearanceOptions_initializers, __appearanceOptions_extraInitializers);
|
|
15797
16340
|
iamMessage_esDecorate(_a, null, __needPlaceholders_decorators, { kind: "accessor", name: "_needPlaceholders", static: false, private: false, access: { has: obj => "_needPlaceholders" in obj, get: obj => obj._needPlaceholders, set: (obj, value) => { obj._needPlaceholders = value; } }, metadata: _metadata }, __needPlaceholders_initializers, __needPlaceholders_extraInitializers);
|
|
15798
16341
|
iamMessage_esDecorate(_a, null, __hasLimit_decorators, { kind: "accessor", name: "_hasLimit", static: false, private: false, access: { has: obj => "_hasLimit" in obj, get: obj => obj._hasLimit, set: (obj, value) => { obj._hasLimit = value; } }, metadata: _metadata }, __hasLimit_initializers, __hasLimit_extraInitializers);
|
|
16342
|
+
iamMessage_esDecorate(_a, null, __disableClose_decorators, { kind: "accessor", name: "_disableClose", static: false, private: false, access: { has: obj => "_disableClose" in obj, get: obj => obj._disableClose, set: (obj, value) => { obj._disableClose = value; } }, metadata: _metadata }, __disableClose_initializers, __disableClose_extraInitializers);
|
|
15799
16343
|
iamMessage_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);
|
|
15800
16344
|
iamMessage_esDecorate(_a, null, __context_decorators, { kind: "accessor", name: "_context", static: false, private: false, access: { has: obj => "_context" in obj, get: obj => obj._context, set: (obj, value) => { obj._context = value; } }, metadata: _metadata }, __context_initializers, __context_extraInitializers);
|
|
15801
16345
|
iamMessage_esDecorate(_a, null, _updateByDto_decorators, { kind: "method", name: "updateByDto", static: false, private: false, access: { has: obj => "updateByDto" in obj, get: obj => obj.updateByDto }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -17126,21 +17670,27 @@ let IamReaderViewModel = (() => {
|
|
|
17126
17670
|
await this.open(message);
|
|
17127
17671
|
return message;
|
|
17128
17672
|
}
|
|
17129
|
-
async
|
|
17673
|
+
async forceClose() {
|
|
17130
17674
|
if (!this._activeMessage)
|
|
17131
17675
|
return;
|
|
17132
17676
|
this.emitCloseEvent(this._activeMessage);
|
|
17133
17677
|
this.clearActiveMessage();
|
|
17134
17678
|
this.visibilityObserver.unsubscribe();
|
|
17135
17679
|
this.touchController.destroy();
|
|
17136
|
-
this.scrollbarHelper.
|
|
17680
|
+
this.scrollbarHelper.disable();
|
|
17681
|
+
}
|
|
17682
|
+
async close() {
|
|
17683
|
+
var _b;
|
|
17684
|
+
if ((_b = this._activeMessage) === null || _b === void 0 ? void 0 : _b.disableClose)
|
|
17685
|
+
return;
|
|
17686
|
+
this.forceClose();
|
|
17137
17687
|
}
|
|
17138
17688
|
async open(message) {
|
|
17139
17689
|
message.updatePlaceholders(this.storyManager.rootStore.placeholderStore.placeholders);
|
|
17140
17690
|
this.touchController.init(document.body);
|
|
17141
17691
|
this.setActiveMessage(message);
|
|
17142
17692
|
this.visibilityObserver.subscribe();
|
|
17143
|
-
this.scrollbarHelper.
|
|
17693
|
+
this.scrollbarHelper.enable();
|
|
17144
17694
|
}
|
|
17145
17695
|
destroy() { }
|
|
17146
17696
|
emitWidgetEvent(widgetEvent) {
|
|
@@ -17390,7 +17940,7 @@ class IamSlideApiHandlers {
|
|
|
17390
17940
|
});
|
|
17391
17941
|
}
|
|
17392
17942
|
closeCard(reason) {
|
|
17393
|
-
this.iamReader.
|
|
17943
|
+
this.iamReader.forceClose();
|
|
17394
17944
|
}
|
|
17395
17945
|
openStory(id, index) {
|
|
17396
17946
|
new showStoryAction_ShowStoryAction(this.storyManager, this.iamMessage).handle({
|
|
@@ -17712,6 +18262,9 @@ let IamMessageViewModel = (() => {
|
|
|
17712
18262
|
get timeSinceLastShow() {
|
|
17713
18263
|
return this.iamMessage.timeSinceLastShow;
|
|
17714
18264
|
}
|
|
18265
|
+
get disableClose() {
|
|
18266
|
+
return this.iamMessage.disableClose;
|
|
18267
|
+
}
|
|
17715
18268
|
open() {
|
|
17716
18269
|
this._isOnceOpened = true;
|
|
17717
18270
|
const iterationId = this.iamMessage.trackOpen();
|
|
@@ -20412,7 +20965,7 @@ class UgcEditorStore {
|
|
|
20412
20965
|
const session = await this.storyManager.rootStore.sessionStore.open();
|
|
20413
20966
|
const ugcEditorConfigDto = await this.ugcEditorApi.fetchUgcEditorConfig();
|
|
20414
20967
|
const storyManagerConfig = this.storyManager.config;
|
|
20415
|
-
const sdkVersion = "1.7.
|
|
20968
|
+
const sdkVersion = "1.7.10";
|
|
20416
20969
|
this._config = {
|
|
20417
20970
|
sessionId: session.id,
|
|
20418
20971
|
apiKey: storyManagerConfig.apiKey,
|
|
@@ -20844,11 +21397,11 @@ class StoryManager extends TypedEventEmitter {
|
|
|
20844
21397
|
return this._userAgent;
|
|
20845
21398
|
}
|
|
20846
21399
|
get sdkVersionName() {
|
|
20847
|
-
const sdkVersionName = "1.7.
|
|
21400
|
+
const sdkVersionName = "1.7.10";
|
|
20848
21401
|
return sdkVersionName || "0.0.0";
|
|
20849
21402
|
}
|
|
20850
21403
|
get sdkVersionCode() {
|
|
20851
|
-
const sdkVersionCode =
|
|
21404
|
+
const sdkVersionCode = 10710;
|
|
20852
21405
|
return sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
20853
21406
|
}
|
|
20854
21407
|
get lang() {
|
|
@@ -20905,7 +21458,7 @@ class StoryManager extends TypedEventEmitter {
|
|
|
20905
21458
|
this.rootStore.storyManagerConfigStore.setConfig(configDto);
|
|
20906
21459
|
}
|
|
20907
21460
|
setUserAgent(userAgent) {
|
|
20908
|
-
const sdkVersionCode =
|
|
21461
|
+
const sdkVersionCode = 10710;
|
|
20909
21462
|
const buildVersion = sdkVersionCode ? parseInt(sdkVersionCode) : 0;
|
|
20910
21463
|
// According to RFC5987, HTTP header values can legitimately be supplied using the ISO-8859-1 encoding.
|
|
20911
21464
|
this._userAgent = `${userAgent} ${convertStrToLatin1(navigator.userAgent)}`;
|
|
@@ -20968,7 +21521,7 @@ class StoryManager extends TypedEventEmitter {
|
|
|
20968
21521
|
clearConfig() {
|
|
20969
21522
|
this.storyReader.close(CloseStoryReaderAction.AppClose, true);
|
|
20970
21523
|
this.gameReader.closeGame();
|
|
20971
|
-
this.inAppMessaging.
|
|
21524
|
+
this.inAppMessaging.forceClose();
|
|
20972
21525
|
this.rootStore.storyManagerConfigStore.clear();
|
|
20973
21526
|
}
|
|
20974
21527
|
static isSingletonInstanceExists() {
|
|
@@ -25025,8 +25578,7 @@ const Story_Story = (0,external_mobx_react_lite_namespaceObject.observer)((_a) =
|
|
|
25025
25578
|
const shouldHideHeader = isDesktopGeometry && useModernLayout
|
|
25026
25579
|
? !isActiveStory || story.pauseState.isUIPaused
|
|
25027
25580
|
: story.pauseState.isUIPaused;
|
|
25028
|
-
const shouldHideActionPanel = isDesktopGeometry &&
|
|
25029
|
-
((useModernLayout && !isActiveStory) || story.textInput.isOpened);
|
|
25581
|
+
const shouldHideActionPanel = isDesktopGeometry && ((useModernLayout && !isActiveStory) || story.textInput.isOpened);
|
|
25030
25582
|
(0,external_react_namespaceObject.useLayoutEffect)(() => {
|
|
25031
25583
|
const bottomOffset = parseFloat(String(storyReaderOptions.actionPanelBottomOffset));
|
|
25032
25584
|
story.actionPanel.setOptions(commonOptions);
|
|
@@ -25050,7 +25602,7 @@ const Story_Story = (0,external_mobx_react_lite_namespaceObject.observer)((_a) =
|
|
|
25050
25602
|
story.sharePanel.completeNativeSharing({ result: false });
|
|
25051
25603
|
}, onTouchStart: () => {
|
|
25052
25604
|
story.sharePanel.completeNativeSharing({ result: false });
|
|
25053
|
-
}, "data-testid": "story", children: [isDesktopGeometry && useModernLayout && (
|
|
25605
|
+
}, "data-testid": "story", children: [isDesktopGeometry && useModernLayout && story.isSlideRendered && (0,jsx_runtime_namespaceObject.jsx)(StoryBackdrop, { hidden: isActiveStory }), story.canBeShown && story.isSlideRendered && ((0,jsx_runtime_namespaceObject.jsx)(StoryHeader, { hidden: shouldHideHeader, story: story, onClose: props.onClose, isDesktopGeometry: isDesktopGeometry })), (0,jsx_runtime_namespaceObject.jsx)(StorySlidesRenderer, { className: Story_story_module["story-slides"], story: story, preventNavigation: useModernLayout && isDesktopGeometry, isActiveStory: isActiveStory, isDesktopGeometry: isDesktopGeometry }), story.actionPanel.needShown && story.isSlideRendered && ((0,jsx_runtime_namespaceObject.jsx)(StoryActionPanel, { dir: story.dir, isDesktopGeometry: isDesktopGeometry, hidden: shouldHideActionPanel, actionPanel: story.actionPanel, commonOptions: commonOptions, storyReaderOptions: storyReaderOptions })), props.activeStory === story && ((0,jsx_runtime_namespaceObject.jsx)(GoodsWidgetViewer, { story: story, goodsWidgetOptions: goodsWidgetOptions })), props.activeStory === story && ((0,jsx_runtime_namespaceObject.jsx)(TextInputModal, { story: story, storyRef: storyRef, storyGeometry: geometry })), story.sharePanel.isOpened && ((0,jsx_runtime_namespaceObject.jsx)(SharePanel, { dir: story.dir, className: Story_story_module["share-panel-wrapper"], shareText: story.sharePanel.params.text, shareType: story.sharePanel.params.type, shareLink: story.sharePanel.params.link, onShareCompelete: (result) => story.sharePanel.handleShareComplete(story.sharePanel.params.id, result), sharePanelOptions: storyReaderOptions.sharePanel })), (0,jsx_runtime_namespaceObject.jsx)(Loader, { needShowErrorScreen: story.needShowErrorScreen, needShowLoaderScreen: story.needShowLoaderScreen, onReload: handleReloadStory })] }));
|
|
25054
25606
|
});
|
|
25055
25607
|
|
|
25056
25608
|
;// CONCATENATED MODULE: ./src/StoryReader/Story/index.ts
|
|
@@ -25397,7 +25949,7 @@ const ModernStoryList = (0,external_mobx_react_lite_namespaceObject.observer)((p
|
|
|
25397
25949
|
if (uiDisabled)
|
|
25398
25950
|
return;
|
|
25399
25951
|
props.storyReader.toStoryWithAnimationByIndex(index);
|
|
25400
|
-
}, children: [(0,jsx_runtime_namespaceObject.jsx)(Story_Story, { index: index, story: story, slideClickDisabled: uiDisabled, activeStory: activeStory, geometry: props.storyGeometry, onClose: props.onCloseStory }), (props.storyReader.stories.length > 1 || story.slidesCount > 1) && ((0,jsx_runtime_namespaceObject.jsx)(ModernStoryListControls, { dir: props.storyReader.dir, display: isActiveStory && activeStory.canBeShown, disabled: uiDisabled, isNextDisabled: isNextDisabled, isPrevDisabled: isPrevDisabled, navigationOptions: storyReaderOptions.navigation, onNext: () => {
|
|
25952
|
+
}, children: [(0,jsx_runtime_namespaceObject.jsx)(Story_Story, { index: index, story: story, slideClickDisabled: uiDisabled, activeStory: activeStory, geometry: props.storyGeometry, onClose: props.onCloseStory }), (props.storyReader.stories.length > 1 || story.slidesCount > 1) && activeStory.isSlideRendered && ((0,jsx_runtime_namespaceObject.jsx)(ModernStoryListControls, { dir: props.storyReader.dir, display: isActiveStory && activeStory.canBeShown, disabled: uiDisabled, isNextDisabled: isNextDisabled, isPrevDisabled: isPrevDisabled, navigationOptions: storyReaderOptions.navigation, onNext: () => {
|
|
25401
25953
|
props.storyReader.goNext();
|
|
25402
25954
|
}, onPrev: () => {
|
|
25403
25955
|
props.storyReader.goPrev();
|
|
@@ -26497,7 +27049,7 @@ var BottomSheet_classPrivateFieldSet = (undefined && undefined.__classPrivateFie
|
|
|
26497
27049
|
|
|
26498
27050
|
|
|
26499
27051
|
let BottomSheet = (() => {
|
|
26500
|
-
var _BottomSheet_open_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;
|
|
27052
|
+
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;
|
|
26501
27053
|
let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-bottom-sheet")];
|
|
26502
27054
|
let _classDescriptor;
|
|
26503
27055
|
let _classExtraInitializers = [];
|
|
@@ -26506,6 +27058,9 @@ let BottomSheet = (() => {
|
|
|
26506
27058
|
let _open_decorators;
|
|
26507
27059
|
let _open_initializers = [];
|
|
26508
27060
|
let _open_extraInitializers = [];
|
|
27061
|
+
let _disableClose_decorators;
|
|
27062
|
+
let _disableClose_initializers = [];
|
|
27063
|
+
let _disableClose_extraInitializers = [];
|
|
26509
27064
|
let _geometry_decorators;
|
|
26510
27065
|
let _geometry_initializers = [];
|
|
26511
27066
|
let _geometry_extraInitializers = [];
|
|
@@ -26536,6 +27091,8 @@ let BottomSheet = (() => {
|
|
|
26536
27091
|
var BottomSheet = _classThis = class extends _classSuper {
|
|
26537
27092
|
get open() { return BottomSheet_classPrivateFieldGet(this, _BottomSheet_open_accessor_storage, "f"); }
|
|
26538
27093
|
set open(value) { BottomSheet_classPrivateFieldSet(this, _BottomSheet_open_accessor_storage, value, "f"); }
|
|
27094
|
+
get disableClose() { return BottomSheet_classPrivateFieldGet(this, _BottomSheet_disableClose_accessor_storage, "f"); }
|
|
27095
|
+
set disableClose(value) { BottomSheet_classPrivateFieldSet(this, _BottomSheet_disableClose_accessor_storage, value, "f"); }
|
|
26539
27096
|
get geometry() { return BottomSheet_classPrivateFieldGet(this, _BottomSheet_geometry_accessor_storage, "f"); }
|
|
26540
27097
|
set geometry(value) { BottomSheet_classPrivateFieldSet(this, _BottomSheet_geometry_accessor_storage, value, "f"); }
|
|
26541
27098
|
get appearanceOptions() { return BottomSheet_classPrivateFieldGet(this, _BottomSheet_appearanceOptions_accessor_storage, "f"); }
|
|
@@ -26557,7 +27114,8 @@ let BottomSheet = (() => {
|
|
|
26557
27114
|
constructor() {
|
|
26558
27115
|
super();
|
|
26559
27116
|
_BottomSheet_open_accessor_storage.set(this, BottomSheet_runInitializers(this, _open_initializers, false));
|
|
26560
|
-
|
|
27117
|
+
_BottomSheet_disableClose_accessor_storage.set(this, (BottomSheet_runInitializers(this, _open_extraInitializers), BottomSheet_runInitializers(this, _disableClose_initializers, false)));
|
|
27118
|
+
_BottomSheet_geometry_accessor_storage.set(this, (BottomSheet_runInitializers(this, _disableClose_extraInitializers), BottomSheet_runInitializers(this, _geometry_initializers, void 0)));
|
|
26561
27119
|
_BottomSheet_appearanceOptions_accessor_storage.set(this, (BottomSheet_runInitializers(this, _geometry_extraInitializers), BottomSheet_runInitializers(this, _appearanceOptions_initializers, void 0)));
|
|
26562
27120
|
_BottomSheet_touchController_accessor_storage.set(this, (BottomSheet_runInitializers(this, _appearanceOptions_extraInitializers), BottomSheet_runInitializers(this, _touchController_initializers, void 0)));
|
|
26563
27121
|
_BottomSheet_desktopMode_accessor_storage.set(this, (BottomSheet_runInitializers(this, _touchController_extraInitializers), BottomSheet_runInitializers(this, _desktopMode_initializers, void 0)));
|
|
@@ -26600,6 +27158,8 @@ let BottomSheet = (() => {
|
|
|
26600
27158
|
super.disconnectedCallback();
|
|
26601
27159
|
}
|
|
26602
27160
|
close() {
|
|
27161
|
+
if (this.disableClose)
|
|
27162
|
+
return;
|
|
26603
27163
|
this.backdropRef.addEventListener("transitionend", this.handleTransitionEnd);
|
|
26604
27164
|
this.isVisible = false;
|
|
26605
27165
|
}
|
|
@@ -26638,10 +27198,11 @@ let BottomSheet = (() => {
|
|
|
26638
27198
|
"bottom-sheet__box-wrapper--desktop-mode": this.desktopMode
|
|
26639
27199
|
})}" style="${(0,style_map_js_namespaceObject.styleMap)(bottomSheetBoxWrapperStyle)}"><div style="${(0,style_map_js_namespaceObject.styleMap)(bottomSheetBoxStyle)}" id="bottom-sheet__box" class="bottom-sheet__box ${(0,class_map_js_namespaceObject.classMap)({
|
|
26640
27200
|
"bottom-sheet__box--open": this.isVisible
|
|
26641
|
-
})}"><div class="bottom-sheet__header"
|
|
27201
|
+
})}"><div class="bottom-sheet__header">${this.disableClose ? external_lit_namespaceObject.nothing : (0,external_lit_namespaceObject.html) `<div class="close-strip-btn" style="${(0,style_map_js_namespaceObject.styleMap)(closeStripButtonStyle)}"></div>`}</div><slot></slot></div></div></div>`;
|
|
26642
27202
|
}
|
|
26643
27203
|
};
|
|
26644
27204
|
_BottomSheet_open_accessor_storage = new WeakMap();
|
|
27205
|
+
_BottomSheet_disableClose_accessor_storage = new WeakMap();
|
|
26645
27206
|
_BottomSheet_geometry_accessor_storage = new WeakMap();
|
|
26646
27207
|
_BottomSheet_appearanceOptions_accessor_storage = new WeakMap();
|
|
26647
27208
|
_BottomSheet_touchController_accessor_storage = new WeakMap();
|
|
@@ -26656,6 +27217,7 @@ let BottomSheet = (() => {
|
|
|
26656
27217
|
var _a;
|
|
26657
27218
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
26658
27219
|
_open_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
27220
|
+
_disableClose_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
26659
27221
|
_geometry_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
26660
27222
|
_appearanceOptions_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
26661
27223
|
_touchController_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
@@ -26666,6 +27228,7 @@ let BottomSheet = (() => {
|
|
|
26666
27228
|
_bottomSheetBoxRef_decorators = [(0,decorators_js_namespaceObject.query)("#bottom-sheet__box")];
|
|
26667
27229
|
_bottomSheetRef_decorators = [(0,decorators_js_namespaceObject.query)("#bottom-sheet")];
|
|
26668
27230
|
BottomSheet_esDecorate(_classThis, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
|
|
27231
|
+
BottomSheet_esDecorate(_classThis, null, _disableClose_decorators, { kind: "accessor", name: "disableClose", static: false, private: false, access: { has: obj => "disableClose" in obj, get: obj => obj.disableClose, set: (obj, value) => { obj.disableClose = value; } }, metadata: _metadata }, _disableClose_initializers, _disableClose_extraInitializers);
|
|
26669
27232
|
BottomSheet_esDecorate(_classThis, null, _geometry_decorators, { kind: "accessor", name: "geometry", static: false, private: false, access: { has: obj => "geometry" in obj, get: obj => obj.geometry, set: (obj, value) => { obj.geometry = value; } }, metadata: _metadata }, _geometry_initializers, _geometry_extraInitializers);
|
|
26670
27233
|
BottomSheet_esDecorate(_classThis, null, _appearanceOptions_decorators, { kind: "accessor", name: "appearanceOptions", static: false, private: false, access: { has: obj => "appearanceOptions" in obj, get: obj => obj.appearanceOptions, set: (obj, value) => { obj.appearanceOptions = value; } }, metadata: _metadata }, _appearanceOptions_initializers, _appearanceOptions_extraInitializers);
|
|
26671
27234
|
BottomSheet_esDecorate(_classThis, null, _touchController_decorators, { kind: "accessor", name: "touchController", static: false, private: false, access: { has: obj => "touchController" in obj, get: obj => obj.touchController, set: (obj, value) => { obj.touchController = value; } }, metadata: _metadata }, _touchController_initializers, _touchController_extraInitializers);
|
|
@@ -26887,7 +27450,7 @@ var Modal_classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet)
|
|
|
26887
27450
|
const ANIMATION_DURATION = 350;
|
|
26888
27451
|
|
|
26889
27452
|
let Modal_Modal = (() => {
|
|
26890
|
-
var _Modal_open_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;
|
|
27453
|
+
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;
|
|
26891
27454
|
let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("iam-modal")];
|
|
26892
27455
|
let _classDescriptor;
|
|
26893
27456
|
let _classExtraInitializers = [];
|
|
@@ -26896,6 +27459,9 @@ let Modal_Modal = (() => {
|
|
|
26896
27459
|
let _open_decorators;
|
|
26897
27460
|
let _open_initializers = [];
|
|
26898
27461
|
let _open_extraInitializers = [];
|
|
27462
|
+
let _disableClose_decorators;
|
|
27463
|
+
let _disableClose_initializers = [];
|
|
27464
|
+
let _disableClose_extraInitializers = [];
|
|
26899
27465
|
let _fullscreen_decorators;
|
|
26900
27466
|
let _fullscreen_initializers = [];
|
|
26901
27467
|
let _fullscreen_extraInitializers = [];
|
|
@@ -26920,6 +27486,8 @@ let Modal_Modal = (() => {
|
|
|
26920
27486
|
var Modal = _classThis = class extends _classSuper {
|
|
26921
27487
|
get open() { return Modal_classPrivateFieldGet(this, _Modal_open_accessor_storage, "f"); }
|
|
26922
27488
|
set open(value) { Modal_classPrivateFieldSet(this, _Modal_open_accessor_storage, value, "f"); }
|
|
27489
|
+
get disableClose() { return Modal_classPrivateFieldGet(this, _Modal_disableClose_accessor_storage, "f"); }
|
|
27490
|
+
set disableClose(value) { Modal_classPrivateFieldSet(this, _Modal_disableClose_accessor_storage, value, "f"); }
|
|
26923
27491
|
get fullscreen() { return Modal_classPrivateFieldGet(this, _Modal_fullscreen_accessor_storage, "f"); }
|
|
26924
27492
|
set fullscreen(value) { Modal_classPrivateFieldSet(this, _Modal_fullscreen_accessor_storage, value, "f"); }
|
|
26925
27493
|
get geometry() { return Modal_classPrivateFieldGet(this, _Modal_geometry_accessor_storage, "f"); }
|
|
@@ -26937,7 +27505,8 @@ let Modal_Modal = (() => {
|
|
|
26937
27505
|
constructor() {
|
|
26938
27506
|
super();
|
|
26939
27507
|
_Modal_open_accessor_storage.set(this, Modal_runInitializers(this, _open_initializers, false));
|
|
26940
|
-
|
|
27508
|
+
_Modal_disableClose_accessor_storage.set(this, (Modal_runInitializers(this, _open_extraInitializers), Modal_runInitializers(this, _disableClose_initializers, false)));
|
|
27509
|
+
_Modal_fullscreen_accessor_storage.set(this, (Modal_runInitializers(this, _disableClose_extraInitializers), Modal_runInitializers(this, _fullscreen_initializers, false)));
|
|
26941
27510
|
_Modal_geometry_accessor_storage.set(this, (Modal_runInitializers(this, _fullscreen_extraInitializers), Modal_runInitializers(this, _geometry_initializers, void 0)));
|
|
26942
27511
|
_Modal_appearanceOptions_accessor_storage.set(this, (Modal_runInitializers(this, _geometry_extraInitializers), Modal_runInitializers(this, _appearanceOptions_initializers, void 0)));
|
|
26943
27512
|
_Modal_dir_accessor_storage.set(this, (Modal_runInitializers(this, _appearanceOptions_extraInitializers), Modal_runInitializers(this, _dir_initializers, void 0)));
|
|
@@ -26947,6 +27516,8 @@ let Modal_Modal = (() => {
|
|
|
26947
27516
|
Modal_runInitializers(this, _backdropRef_extraInitializers);
|
|
26948
27517
|
}
|
|
26949
27518
|
close() {
|
|
27519
|
+
if (this.disableClose)
|
|
27520
|
+
return;
|
|
26950
27521
|
const duration = this.appearanceOptions.animationType === IamModalAnimationType.None ? 0 : ANIMATION_DURATION;
|
|
26951
27522
|
setTimeout(() => {
|
|
26952
27523
|
this.isClosed = true;
|
|
@@ -27023,10 +27594,11 @@ let Modal_Modal = (() => {
|
|
|
27023
27594
|
? external_lit_namespaceObject.nothing
|
|
27024
27595
|
: (0,external_lit_namespaceObject.html) `<div class="modal__header"><iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn></div>`}<div style="${(0,style_map_js_namespaceObject.styleMap)(modalBoxContentStyle)}" class="modal__box-content ${(0,class_map_js_namespaceObject.classMap)({ "modal__box-content--fullscreen": this.fullscreen })}">${this.fullscreen
|
|
27025
27596
|
? external_lit_namespaceObject.nothing
|
|
27026
|
-
: (0,external_lit_namespaceObject.html) `<div class="modal__header"
|
|
27597
|
+
: (0,external_lit_namespaceObject.html) `<div class="modal__header">${this.disableClose ? external_lit_namespaceObject.nothing : (0,external_lit_namespaceObject.html) `<iam-modal-close-btn @click="${this.close}" .dir="${this.dir}" .closeBtnPosition="${this.appearanceOptions.closeBtnPosition}"></iam-modal-close-btn>`}</div>`}<slot></slot></div></div></div>`;
|
|
27027
27598
|
}
|
|
27028
27599
|
};
|
|
27029
27600
|
_Modal_open_accessor_storage = new WeakMap();
|
|
27601
|
+
_Modal_disableClose_accessor_storage = new WeakMap();
|
|
27030
27602
|
_Modal_fullscreen_accessor_storage = new WeakMap();
|
|
27031
27603
|
_Modal_geometry_accessor_storage = new WeakMap();
|
|
27032
27604
|
_Modal_appearanceOptions_accessor_storage = new WeakMap();
|
|
@@ -27039,6 +27611,7 @@ let Modal_Modal = (() => {
|
|
|
27039
27611
|
var _a;
|
|
27040
27612
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
|
|
27041
27613
|
_open_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
27614
|
+
_disableClose_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
27042
27615
|
_fullscreen_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
27043
27616
|
_geometry_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
27044
27617
|
_appearanceOptions_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
@@ -27047,6 +27620,7 @@ let Modal_Modal = (() => {
|
|
|
27047
27620
|
_isClosed_decorators = [(0,decorators_js_namespaceObject.state)()];
|
|
27048
27621
|
_backdropRef_decorators = [(0,decorators_js_namespaceObject.query)("#modal__backdrop")];
|
|
27049
27622
|
Modal_esDecorate(_classThis, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
|
|
27623
|
+
Modal_esDecorate(_classThis, null, _disableClose_decorators, { kind: "accessor", name: "disableClose", static: false, private: false, access: { has: obj => "disableClose" in obj, get: obj => obj.disableClose, set: (obj, value) => { obj.disableClose = value; } }, metadata: _metadata }, _disableClose_initializers, _disableClose_extraInitializers);
|
|
27050
27624
|
Modal_esDecorate(_classThis, null, _fullscreen_decorators, { kind: "accessor", name: "fullscreen", static: false, private: false, access: { has: obj => "fullscreen" in obj, get: obj => obj.fullscreen, set: (obj, value) => { obj.fullscreen = value; } }, metadata: _metadata }, _fullscreen_initializers, _fullscreen_extraInitializers);
|
|
27051
27625
|
Modal_esDecorate(_classThis, null, _geometry_decorators, { kind: "accessor", name: "geometry", static: false, private: false, access: { has: obj => "geometry" in obj, get: obj => obj.geometry, set: (obj, value) => { obj.geometry = value; } }, metadata: _metadata }, _geometry_initializers, _geometry_extraInitializers);
|
|
27052
27626
|
Modal_esDecorate(_classThis, null, _appearanceOptions_decorators, { kind: "accessor", name: "appearanceOptions", static: false, private: false, access: { has: obj => "appearanceOptions" in obj, get: obj => obj.appearanceOptions, set: (obj, value) => { obj.appearanceOptions = value; } }, metadata: _metadata }, _appearanceOptions_initializers, _appearanceOptions_extraInitializers);
|
|
@@ -27247,7 +27821,7 @@ var MessageViewFactory_classPrivateFieldSet = (undefined && undefined.__classPri
|
|
|
27247
27821
|
|
|
27248
27822
|
|
|
27249
27823
|
let MessageViewFactory = (() => {
|
|
27250
|
-
var _MessageViewFactory_appearanceOptions_accessor_storage, _MessageViewFactory_type_accessor_storage, _MessageViewFactory_open_accessor_storage, _MessageViewFactory_geometry_accessor_storage, _MessageViewFactory_touchController_accessor_storage, _MessageViewFactory_desktopMode_accessor_storage, _MessageViewFactory_dir_accessor_storage;
|
|
27824
|
+
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;
|
|
27251
27825
|
let _classDecorators = [(0,decorators_js_namespaceObject.customElement)("message-view-factory")];
|
|
27252
27826
|
let _classDescriptor;
|
|
27253
27827
|
let _classExtraInitializers = [];
|
|
@@ -27262,6 +27836,9 @@ let MessageViewFactory = (() => {
|
|
|
27262
27836
|
let _open_decorators;
|
|
27263
27837
|
let _open_initializers = [];
|
|
27264
27838
|
let _open_extraInitializers = [];
|
|
27839
|
+
let _disableClose_decorators;
|
|
27840
|
+
let _disableClose_initializers = [];
|
|
27841
|
+
let _disableClose_extraInitializers = [];
|
|
27265
27842
|
let _geometry_decorators;
|
|
27266
27843
|
let _geometry_initializers = [];
|
|
27267
27844
|
let _geometry_extraInitializers = [];
|
|
@@ -27281,6 +27858,8 @@ let MessageViewFactory = (() => {
|
|
|
27281
27858
|
set type(value) { MessageViewFactory_classPrivateFieldSet(this, _MessageViewFactory_type_accessor_storage, value, "f"); }
|
|
27282
27859
|
get open() { return MessageViewFactory_classPrivateFieldGet(this, _MessageViewFactory_open_accessor_storage, "f"); }
|
|
27283
27860
|
set open(value) { MessageViewFactory_classPrivateFieldSet(this, _MessageViewFactory_open_accessor_storage, value, "f"); }
|
|
27861
|
+
get disableClose() { return MessageViewFactory_classPrivateFieldGet(this, _MessageViewFactory_disableClose_accessor_storage, "f"); }
|
|
27862
|
+
set disableClose(value) { MessageViewFactory_classPrivateFieldSet(this, _MessageViewFactory_disableClose_accessor_storage, value, "f"); }
|
|
27284
27863
|
get geometry() { return MessageViewFactory_classPrivateFieldGet(this, _MessageViewFactory_geometry_accessor_storage, "f"); }
|
|
27285
27864
|
set geometry(value) { MessageViewFactory_classPrivateFieldSet(this, _MessageViewFactory_geometry_accessor_storage, value, "f"); }
|
|
27286
27865
|
get touchController() { return MessageViewFactory_classPrivateFieldGet(this, _MessageViewFactory_touchController_accessor_storage, "f"); }
|
|
@@ -27295,7 +27874,8 @@ let MessageViewFactory = (() => {
|
|
|
27295
27874
|
return null;
|
|
27296
27875
|
return (0,static_html_js_namespaceObject.html) `
|
|
27297
27876
|
<${MessageView}
|
|
27298
|
-
.open=${this.open}
|
|
27877
|
+
.open=${this.open}
|
|
27878
|
+
.disableClose=${this.disableClose}
|
|
27299
27879
|
.geometry=${this.geometry}
|
|
27300
27880
|
.appearanceOptions=${this.appearanceOptions}
|
|
27301
27881
|
.touchController=${this.touchController}
|
|
@@ -27310,7 +27890,8 @@ let MessageViewFactory = (() => {
|
|
|
27310
27890
|
_MessageViewFactory_appearanceOptions_accessor_storage.set(this, MessageViewFactory_runInitializers(this, _appearanceOptions_initializers, void 0));
|
|
27311
27891
|
_MessageViewFactory_type_accessor_storage.set(this, (MessageViewFactory_runInitializers(this, _appearanceOptions_extraInitializers), MessageViewFactory_runInitializers(this, _type_initializers, void 0)));
|
|
27312
27892
|
_MessageViewFactory_open_accessor_storage.set(this, (MessageViewFactory_runInitializers(this, _type_extraInitializers), MessageViewFactory_runInitializers(this, _open_initializers, false)));
|
|
27313
|
-
|
|
27893
|
+
_MessageViewFactory_disableClose_accessor_storage.set(this, (MessageViewFactory_runInitializers(this, _open_extraInitializers), MessageViewFactory_runInitializers(this, _disableClose_initializers, false)));
|
|
27894
|
+
_MessageViewFactory_geometry_accessor_storage.set(this, (MessageViewFactory_runInitializers(this, _disableClose_extraInitializers), MessageViewFactory_runInitializers(this, _geometry_initializers, void 0)));
|
|
27314
27895
|
_MessageViewFactory_touchController_accessor_storage.set(this, (MessageViewFactory_runInitializers(this, _geometry_extraInitializers), MessageViewFactory_runInitializers(this, _touchController_initializers, void 0)));
|
|
27315
27896
|
_MessageViewFactory_desktopMode_accessor_storage.set(this, (MessageViewFactory_runInitializers(this, _touchController_extraInitializers), MessageViewFactory_runInitializers(this, _desktopMode_initializers, void 0)));
|
|
27316
27897
|
_MessageViewFactory_dir_accessor_storage.set(this, (MessageViewFactory_runInitializers(this, _desktopMode_extraInitializers), MessageViewFactory_runInitializers(this, _dir_initializers, void 0)));
|
|
@@ -27320,6 +27901,7 @@ let MessageViewFactory = (() => {
|
|
|
27320
27901
|
_MessageViewFactory_appearanceOptions_accessor_storage = new WeakMap();
|
|
27321
27902
|
_MessageViewFactory_type_accessor_storage = new WeakMap();
|
|
27322
27903
|
_MessageViewFactory_open_accessor_storage = new WeakMap();
|
|
27904
|
+
_MessageViewFactory_disableClose_accessor_storage = new WeakMap();
|
|
27323
27905
|
_MessageViewFactory_geometry_accessor_storage = new WeakMap();
|
|
27324
27906
|
_MessageViewFactory_touchController_accessor_storage = new WeakMap();
|
|
27325
27907
|
_MessageViewFactory_desktopMode_accessor_storage = new WeakMap();
|
|
@@ -27331,6 +27913,7 @@ let MessageViewFactory = (() => {
|
|
|
27331
27913
|
_appearanceOptions_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
27332
27914
|
_type_decorators = [(0,decorators_js_namespaceObject.property)({ type: Number })];
|
|
27333
27915
|
_open_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
27916
|
+
_disableClose_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
27334
27917
|
_geometry_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
27335
27918
|
_touchController_decorators = [(0,decorators_js_namespaceObject.property)({ type: Object })];
|
|
27336
27919
|
_desktopMode_decorators = [(0,decorators_js_namespaceObject.property)({ type: Boolean })];
|
|
@@ -27338,6 +27921,7 @@ let MessageViewFactory = (() => {
|
|
|
27338
27921
|
MessageViewFactory_esDecorate(_classThis, null, _appearanceOptions_decorators, { kind: "accessor", name: "appearanceOptions", static: false, private: false, access: { has: obj => "appearanceOptions" in obj, get: obj => obj.appearanceOptions, set: (obj, value) => { obj.appearanceOptions = value; } }, metadata: _metadata }, _appearanceOptions_initializers, _appearanceOptions_extraInitializers);
|
|
27339
27922
|
MessageViewFactory_esDecorate(_classThis, null, _type_decorators, { kind: "accessor", name: "type", static: false, private: false, access: { has: obj => "type" in obj, get: obj => obj.type, set: (obj, value) => { obj.type = value; } }, metadata: _metadata }, _type_initializers, _type_extraInitializers);
|
|
27340
27923
|
MessageViewFactory_esDecorate(_classThis, null, _open_decorators, { kind: "accessor", name: "open", static: false, private: false, access: { has: obj => "open" in obj, get: obj => obj.open, set: (obj, value) => { obj.open = value; } }, metadata: _metadata }, _open_initializers, _open_extraInitializers);
|
|
27924
|
+
MessageViewFactory_esDecorate(_classThis, null, _disableClose_decorators, { kind: "accessor", name: "disableClose", static: false, private: false, access: { has: obj => "disableClose" in obj, get: obj => obj.disableClose, set: (obj, value) => { obj.disableClose = value; } }, metadata: _metadata }, _disableClose_initializers, _disableClose_extraInitializers);
|
|
27341
27925
|
MessageViewFactory_esDecorate(_classThis, null, _geometry_decorators, { kind: "accessor", name: "geometry", static: false, private: false, access: { has: obj => "geometry" in obj, get: obj => obj.geometry, set: (obj, value) => { obj.geometry = value; } }, metadata: _metadata }, _geometry_initializers, _geometry_extraInitializers);
|
|
27342
27926
|
MessageViewFactory_esDecorate(_classThis, null, _touchController_decorators, { kind: "accessor", name: "touchController", static: false, private: false, access: { has: obj => "touchController" in obj, get: obj => obj.touchController, set: (obj, value) => { obj.touchController = value; } }, metadata: _metadata }, _touchController_initializers, _touchController_extraInitializers);
|
|
27343
27927
|
MessageViewFactory_esDecorate(_classThis, null, _desktopMode_decorators, { kind: "accessor", name: "desktopMode", static: false, private: false, access: { has: obj => "desktopMode" in obj, get: obj => obj.desktopMode, set: (obj, value) => { obj.desktopMode = value; } }, metadata: _metadata }, _desktopMode_initializers, _desktopMode_extraInitializers);
|
|
@@ -27944,7 +28528,7 @@ let InAppMessagingReader = (() => {
|
|
|
27944
28528
|
const type = message.type;
|
|
27945
28529
|
const messageGeometry = this.createMessageGeometry(type, message.appearanceOptions);
|
|
27946
28530
|
const slideGeometry = this.createSlideGeometry(messageGeometry);
|
|
27947
|
-
return (0,external_lit_namespaceObject.html) `<message-view-factory type="${type}" @closed="${this.handleClosed}" .appearanceOptions="${message.appearanceOptions}" .geometry="${messageGeometry}" .open="${this.open}" .dir="${this.dir}" .desktopMode="${this.desktopMode}" .touchController="${touchController}"><message-slide .message="${message}" .styleContext="${message.context.style}" .geometry="${slideGeometry}"></message-slide><iam-loader .needShowErrorScreen="${message.needShowErrorScreen}" .needShowLoaderScreen="${message.needShowLoaderScreen}" @reload="${this.handleReloadMessage}"></iam-loader></message-view-factory>`;
|
|
28531
|
+
return (0,external_lit_namespaceObject.html) `<message-view-factory type="${type}" @closed="${this.handleClosed}" .disableClose="${message.disableClose}" .appearanceOptions="${message.appearanceOptions}" .geometry="${messageGeometry}" .open="${this.open}" .dir="${this.dir}" .desktopMode="${this.desktopMode}" .touchController="${touchController}"><message-slide .message="${message}" .styleContext="${message.context.style}" .geometry="${slideGeometry}"></message-slide><iam-loader .needShowErrorScreen="${message.needShowErrorScreen}" .needShowLoaderScreen="${message.needShowLoaderScreen}" @reload="${this.handleReloadMessage}"></iam-loader></message-view-factory>`;
|
|
27948
28532
|
}
|
|
27949
28533
|
};
|
|
27950
28534
|
_InAppMessagingReader_options_accessor_storage = new WeakMap();
|