diff --git a/README.md b/README.md index b2e5fd6a2..b94d43dcc 100644 --- a/README.md +++ b/README.md @@ -112,23 +112,23 @@ RainLoop 1.14 vs SnappyMail |js/* |RainLoop |Snappy | |--------------- |--------: |--------: | -|admin.js |2.130.942 | 628.009 | -|app.js |4.184.455 |2.340.222 | +|admin.js |2.130.942 | 627.638 | +|app.js |4.184.455 |2.337.633 | |boot.js | 671.522 | 4.842 | -|libs.js | 647.614 | 235.361 | +|libs.js | 647.614 | 235.475 | |polyfills.js | 325.834 | 0 | |serviceworker.js | 0 | 285 | -|TOTAL |7.960.367 |3.208.719 | +|TOTAL |7.960.367 |3.205.873 | |js/min/* |RainLoop |Snappy |Rain gzip |gzip |brotli | |--------------- |--------: |--------: |--------: |--------: |--------: | -|admin.min.js | 252.147 | 85.184 | 73.657 | 22.617 | 19.879 | -|app.min.js | 511.202 | 310.381 |140.462 | 84.002 | 68.447 | +|admin.min.js | 252.147 | 85.136 | 73.657 | 22.606 | 19.875 | +|app.min.js | 511.202 | 309.954 |140.462 | 83.913 | 68.565 | |boot.min.js | 66.007 | 2.630 | 22.567 | 1.375 | 1.189 | -|libs.min.js | 572.545 | 130.817 |176.720 | 47.296 | 42.076 | +|libs.min.js | 572.545 | 130.930 |176.720 | 47.397 | 42.116 | |polyfills.min.js | 32.452 | 0 | 11.312 | 0 | 0 | -|TOTAL |1.434.353 | 529.012 |424.718 |155.290 |131.591 | -|TOTAL (no admin) |1.182.206 | 443.828 |351.061 |132.673 |111.712 | +|TOTAL |1.434.353 | 528.650 |424.718 |155.291 |131.745 | +|TOTAL (no admin) |1.182.206 | 443.514 |351.061 |132.685 |111.870 | For a user its around 62% smaller and faster than traditional RainLoop. diff --git a/dev/App/Admin.js b/dev/App/Admin.js index f54b4ab47..661dac3ac 100644 --- a/dev/App/Admin.js +++ b/dev/App/Admin.js @@ -69,7 +69,7 @@ class AdminApp extends AbstractApp { let list = []; const loading = {}; - PackageStore.packages().forEach(item => { + PackageStore.packages.forEach(item => { if (item && item.loading()) { loading[item.file] = item; } diff --git a/dev/App/User.js b/dev/App/User.js index 793f52e13..44fb6d130 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -122,7 +122,7 @@ class AppUser extends AbstractApp { } reloadFlagsCurrentMessageListAndMessageFromCache() { - MessageStore.messageList().forEach(message => + MessageStore.messageList.forEach(message => MessageFlagsCache.initMessage(message) ); MessageFlagsCache.initMessage(MessageStore.message()); @@ -271,7 +271,7 @@ class AppUser extends AbstractApp { } } - this.reloadMessageList(!MessageStore.messageList().length); + this.reloadMessageList(!MessageStore.messageList.length); this.quotaDebounce(); } } @@ -479,9 +479,9 @@ class AppUser extends AbstractApp { let parentEmail = Settings.get('ParentEmail') || sAccountEmail; if (Array.isArray(oData.Result.Accounts)) { - AccountStore.accounts().forEach(oAccount => { - counts[oAccount.email] = oAccount.count(); - }); + AccountStore.accounts.forEach(oAccount => + counts[oAccount.email] = oAccount.count() + ); delegateRunOnDestroy(AccountStore.accounts()); @@ -673,13 +673,10 @@ class AppUser extends AbstractApp { if (folder.fullNameRaw === FolderStore.currentFolderFullNameRaw()) { this.reloadMessageList(); } - } else if (unreadCountChange) { - if (folder.fullNameRaw === FolderStore.currentFolderFullNameRaw()) { - const list = MessageStore.messageList(); - if (Array.isNotEmpty(list)) { - this.folderInformation(folder.fullNameRaw, list); - } - } + } else if (unreadCountChange + && folder.fullNameRaw === FolderStore.currentFolderFullNameRaw() + && MessageStore.messageList.length) { + this.folderInformation(folder.fullNameRaw, MessageStore.messageList()); } } }); diff --git a/dev/Common/Cache.js b/dev/Common/Cache.js index 1de309971..72437771b 100644 --- a/dev/Common/Cache.js +++ b/dev/Common/Cache.js @@ -210,8 +210,8 @@ export class MessageFlagsCache } } - if (message.threads().length) { - const unseenSubUid = message.threads().find(sSubUid => { + if (message.threads.length) { + const unseenSubUid = message.threads.find(sSubUid => { if (uid !== sSubUid) { const subFlags = this.getFor(message.folder, sSubUid); return subFlags && subFlags.length && !!subFlags[0]; @@ -219,7 +219,7 @@ export class MessageFlagsCache return false; }); - const flaggedSubUid = message.threads().find(sSubUid => { + const flaggedSubUid = message.threads.find(sSubUid => { if (uid !== sSubUid) { const subFlags = this.getFor(message.folder, sSubUid); return subFlags && subFlags.length && !!subFlags[1]; diff --git a/dev/Common/Selector.js b/dev/Common/Selector.js index 0a5c925a2..1a8159cc9 100644 --- a/dev/Common/Selector.js +++ b/dev/Common/Selector.js @@ -42,7 +42,7 @@ class Selector { ) { this.list = koList; - this.listChecked = ko.computed(() => this.list().filter(item => item.checked())).extend({ rateLimit: 0 }); + this.listChecked = ko.computed(() => this.list.filter(item => item.checked())).extend({ rateLimit: 0 }); this.isListChecked = ko.computed(() => 0 < this.listChecked().length); this.focusedItem = koFocusedItem || ko.observable(null); @@ -329,11 +329,11 @@ class Selector { result = null; const pageStep = 10, - list = this.list(), - listLen = list ? list.length : 0, + list = this.list, + listLen = list.length, focused = this.focusedItem(); - if (0 < listLen) { + if (listLen) { if (focused) { if (isArrow) { let i = list.indexOf(focused); diff --git a/dev/Common/UtilsUser.js b/dev/Common/UtilsUser.js index 7e5fb9011..df3454a58 100644 --- a/dev/Common/UtilsUser.js +++ b/dev/Common/UtilsUser.js @@ -326,7 +326,7 @@ export function folderListOptionsBuilder( } } - if (oItem.subscribed() && oItem.subFolders().length) { + if (oItem.subscribed() && oItem.subFolders.length) { aResult = aResult.concat( folderListOptionsBuilder( [], diff --git a/dev/Knoin/AbstractScreen.js b/dev/Knoin/AbstractScreen.js index e367ad960..10eeffc26 100644 --- a/dev/Knoin/AbstractScreen.js +++ b/dev/Knoin/AbstractScreen.js @@ -11,7 +11,7 @@ export class AbstractScreen { /** * @returns {Array} */ - viewModels() { + get viewModels() { return this.aViewModels; } diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index 0af4fca10..79cbf8bcc 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -263,8 +263,8 @@ function screenOnRoute(screenName, subPart) { if (!vmScreen.__builded) { vmScreen.__builded = true; - if (isNonEmptyArray(vmScreen.viewModels())) { - vmScreen.viewModels().forEach(ViewModelClass => { + if (vmScreen.viewModels.length) { + vmScreen.viewModels.forEach(ViewModelClass => { buildViewModel(ViewModelClass, vmScreen); }); } @@ -278,8 +278,8 @@ function screenOnRoute(screenName, subPart) { currentScreen.onHide && currentScreen.onHide(); currentScreen.onHideWithDelay && setTimeout(()=>currentScreen.onHideWithDelay(), 500); - if (isNonEmptyArray(currentScreen.viewModels())) { - currentScreen.viewModels().forEach(ViewModelClass => { + if (isNonEmptyArray(currentScreen.viewModels)) { + currentScreen.viewModels.forEach(ViewModelClass => { if ( ViewModelClass.__vm && ViewModelClass.__dom && @@ -302,8 +302,8 @@ function screenOnRoute(screenName, subPart) { if (currentScreen && !isSameScreen) { currentScreen.onShow && currentScreen.onShow(); - if (isNonEmptyArray(currentScreen.viewModels())) { - currentScreen.viewModels().forEach(ViewModelClass => { + if (isNonEmptyArray(currentScreen.viewModels)) { + currentScreen.viewModels.forEach(ViewModelClass => { if ( ViewModelClass.__vm && ViewModelClass.__dom && diff --git a/dev/Model/Filter.js b/dev/Model/Filter.js index ea1ae21d3..e398d77b1 100644 --- a/dev/Model/Filter.js +++ b/dev/Model/Filter.js @@ -46,7 +46,7 @@ class FilterModel extends AbstractModel { actionType: FiltersAction.MoveTo }); - this.conditions = ko.observableArray([]); + this.conditions = ko.observableArray(); const fGetRealFolderName = (folderFullNameRaw) => { const folder = getFolderFromCacheList(folderFullNameRaw); @@ -137,7 +137,7 @@ class FilterModel extends AbstractModel { return false; } - if (this.conditions().length && this.conditions().find(cond => cond && !cond.verify())) { + if (this.conditions.length && this.conditions.find(cond => cond && !cond.verify())) { return false; } @@ -180,7 +180,7 @@ class FilterModel extends AbstractModel { ID: this.id, Enabled: this.enabled() ? '1' : '0', Name: this.name(), - Conditions: this.conditions().map(item => item.toJson()), + Conditions: this.conditions.map(item => item.toJson()), ConditionsType: this.conditionsType(), ActionType: this.actionType(), @@ -259,7 +259,7 @@ class FilterModel extends AbstractModel { filter.actionKeep(this.actionKeep()); filter.actionNoStop(this.actionNoStop()); - filter.conditions(this.conditions().map(item => item.cloneSelf())); + filter.conditions(this.conditions.map(item => item.cloneSelf())); return filter; } diff --git a/dev/Model/Folder.js b/dev/Model/Folder.js index 7580bd467..f06ee9c1d 100644 --- a/dev/Model/Folder.js +++ b/dev/Model/Folder.js @@ -85,7 +85,7 @@ class FolderModel extends AbstractModel { hasSubscribedSubfolders: () => - !!folder.subFolders().find( + !!folder.subFolders.find( oFolder => (oFolder.subscribed() || oFolder.hasSubscribedSubfolders()) && !oFolder.isSystemFolder() ), @@ -129,7 +129,7 @@ class FolderModel extends AbstractModel { return ''; }, - canBeDeleted: () => !folder.isSystemFolder() && !folder.subFolders().length, + canBeDeleted: () => !folder.isSystemFolder() && !folder.subFolders.length, selectableForFolderList: () => !folder.isSystemFolder() && folder.selectable, @@ -218,7 +218,7 @@ class FolderModel extends AbstractModel { hasUnreadMessages: () => 0 < folder.messageCountUnread() && folder.printableUnreadCount(), hasSubscribedUnreadMessagesSubfolders: () => - !!folder.subFolders().find( + !!folder.subFolders.find( folder => folder.hasUnreadMessages() || folder.hasSubscribedUnreadMessagesSubfolders() ) }); diff --git a/dev/Model/Message.js b/dev/Model/Message.js index 95b8f4f3d..bde218f19 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -72,12 +72,12 @@ class MessageModel extends AbstractModel { }); this.attachments = ko.observableArray(new AttachmentCollectionModel); - this.attachmentsSpecData = ko.observableArray([]); - this.threads = ko.observableArray([]); + this.attachmentsSpecData = ko.observableArray(); + this.threads = ko.observableArray(); this.addComputables({ attachmentIconClass: () => File.getCombinedIconClass(this.hasAttachments() ? this.attachmentsSpecData() : []), - threadsLen: () => this.threads().length, + threadsLen: () => this.threads.length, isImportant: () => MessagePriority.High === this.priority(), }); } @@ -502,7 +502,7 @@ class MessageModel extends AbstractModel { el.src = attachment.linkPreview(); } } else if (data.xSrcLocation) { - const attachment = this.attachments().find(item => data.xSrcLocation === item.contentLocation) + const attachment = this.attachments.find(item => data.xSrcLocation === item.contentLocation) || findAttachmentByCid(data.xSrcLocation); if (attachment && attachment.download) { el.loading = 'lazy'; diff --git a/dev/Model/SieveScript.js b/dev/Model/SieveScript.js index e5722e7f2..6022470bd 100644 --- a/dev/Model/SieveScript.js +++ b/dev/Model/SieveScript.js @@ -274,7 +274,7 @@ class SieveScriptModel extends AbstractModel hasChanges: false }); - this.filters = ko.observableArray([]); + this.filters = ko.observableArray(); // this.saving = ko.observable(false).extend({ throttle: 200 }); this.addSubscribables({ @@ -296,7 +296,7 @@ class SieveScriptModel extends AbstractModel verify() { this.nameError(!this.name().trim()); - this.bodyError(this.allowFilters() ? !this.filters().length : !this.body().trim()); + this.bodyError(this.allowFilters() ? !this.filters.length : !this.body().trim()); return !this.nameError() && !this.bodyError(); } @@ -305,7 +305,7 @@ class SieveScriptModel extends AbstractModel name: this.name(), active: this.active() ? '1' : '0', body: this.body(), - filters: this.filters().map(item => item.toJson()) + filters: this.filters.map(item => item.toJson()) }; } diff --git a/dev/Remote/User/Fetch.js b/dev/Remote/User/Fetch.js index 5f05d1d71..468ffa3a9 100644 --- a/dev/Remote/User/Fetch.js +++ b/dev/Remote/User/Fetch.js @@ -446,8 +446,8 @@ class RemoteUserFetch extends AbstractFetchRemote { uids.push(messageListItem.uid); } - if (messageListItem.threads().length) { - messageListItem.threads().forEach(uid => { + if (messageListItem.threads.length) { + messageListItem.threads.forEach(uid => { if (!MessageFlagsCache.getFor(messageListItem.folder, uid)) { uids.push(uid); } diff --git a/dev/Screen/AbstractSettings.js b/dev/Screen/AbstractSettings.js index 25cecb726..e2c394b5c 100644 --- a/dev/Screen/AbstractSettings.js +++ b/dev/Screen/AbstractSettings.js @@ -13,7 +13,7 @@ class AbstractSettingsScreen extends AbstractScreen { constructor(viewModels) { super('settings', viewModels); - this.menu = ko.observableArray([]); + this.menu = ko.observableArray(); this.oCurrentSubScreen = null; @@ -113,7 +113,7 @@ class AbstractSettingsScreen extends AbstractScreen { o.oCurrentSubScreen.viewModelDom.hidden = false; o.oCurrentSubScreen.onShow && o.oCurrentSubScreen.onShow(); - o.menu().forEach(item => { + o.menu.forEach(item => { item.selected( settingsScreen && settingsScreen.__rlSettingsData && diff --git a/dev/Screen/User/MailBox.js b/dev/Screen/User/MailBox.js index b0b28d484..aee96bb48 100644 --- a/dev/Screen/User/MailBox.js +++ b/dev/Screen/User/MailBox.js @@ -106,7 +106,7 @@ class MailBoxUserScreen extends AbstractScreen { FolderStore.foldersInboxUnreadCount(e.detail); const email = AccountStore.email(); - AccountStore.accounts().forEach(item => { + AccountStore.accounts.forEach(item => { if (item && email === item.email) { item.count(e.detail); } diff --git a/dev/Settings/Admin/General.js b/dev/Settings/Admin/General.js index 4684fac65..afe06c067 100644 --- a/dev/Settings/Admin/General.js +++ b/dev/Settings/Admin/General.js @@ -67,7 +67,7 @@ class GeneralAdminSettings { : ''; this.themesOptions = ko.computed(() => - this.themes().map(theme => ({ optValue: theme, optText: convertThemeName(theme) })) + this.themes.map(theme => ({ optValue: theme, optText: convertThemeName(theme) })) ); this.languageFullName = ko.computed(() => convertLangName(this.language())); diff --git a/dev/Settings/Admin/Packages.js b/dev/Settings/Admin/Packages.js index 370ada9bd..d4197e197 100644 --- a/dev/Settings/Admin/Packages.js +++ b/dev/Settings/Admin/Packages.js @@ -15,13 +15,13 @@ class PackagesAdminSettings { this.packagesMainUpdatable = PackageStore.packagesMainUpdatable; this.packagesCurrent = ko.computed(() => - this.packages().filter(item => item && item.installed && !item.compare) + this.packages.filter(item => item && item.installed && !item.compare) ); this.packagesAvailableForUpdate = ko.computed(() => - this.packages().filter(item => item && item.installed && !!item.compare) + this.packages.filter(item => item && item.installed && !!item.compare) ); this.packagesAvailableForInstallation = ko.computed(() => - this.packages().filter(item => item && !item.installed) + this.packages.filter(item => item && !item.installed) ); this.visibility = ko.computed(() => (PackageStore.packages.loading() ? 'visible' : 'hidden')); @@ -47,7 +47,7 @@ class PackagesAdminSettings { } } - this.packages().forEach(item => { + this.packages.forEach(item => { if (item && packageToRequest && item.loading && item.loading() && packageToRequest.file === item.file) { packageToRequest.loading(false); item.loading(false); diff --git a/dev/Settings/User/Filters.js b/dev/Settings/User/Filters.js index 69017f0a8..f77e0fbe9 100644 --- a/dev/Settings/User/Filters.js +++ b/dev/Settings/User/Filters.js @@ -91,7 +91,7 @@ class FiltersUserSettings { Remote.filtersScriptActivate( (result, data) => { if (StorageResultType.Success === result && data && data.Result) { - this.scripts().forEach(script => script.active(script.name() === name)); + this.scripts.forEach(script => script.active(script.name() === name)); } else { this.setError((data && data.ErrorCode) ? (data.ErrorMessageAdditional || getNotification(data.ErrorCode)) diff --git a/dev/Settings/User/OpenPgp.js b/dev/Settings/User/OpenPgp.js index 6293766ac..64dd77d72 100644 --- a/dev/Settings/User/OpenPgp.js +++ b/dev/Settings/User/OpenPgp.js @@ -43,7 +43,7 @@ class OpenPgpUserSettings { this.openPgpKeyForDeletion(null); if (openPgpKeyToRemove && PgpStore.openpgpKeyring) { - const findedItem = PgpStore.openpgpkeys().find(key => openPgpKeyToRemove === key); + const findedItem = PgpStore.openpgpkeys.find(key => openPgpKeyToRemove === key); if (findedItem) { PgpStore.openpgpkeys.remove(findedItem); delegateRunOnDestroy(findedItem); diff --git a/dev/Settings/User/Themes.js b/dev/Settings/User/Themes.js index 18c9e8c64..fb86d4a37 100644 --- a/dev/Settings/User/Themes.js +++ b/dev/Settings/User/Themes.js @@ -13,7 +13,7 @@ class ThemesUserSettings { constructor() { this.theme = ThemeStore.theme; this.themes = ThemeStore.themes; - this.themesObjects = ko.observableArray([]); + this.themesObjects = ko.observableArray(); this.background = {}; this.background.name = ThemeStore.themeBackgroundName; @@ -27,7 +27,7 @@ class ThemesUserSettings { this.themeTrigger = ko.observable(SaveSettingsStep.Idle).extend({ throttle: 100 }); this.theme.subscribe((value) => { - this.themesObjects().forEach(theme => { + this.themesObjects.forEach(theme => { theme.selected(value === theme.name); }); @@ -54,7 +54,7 @@ class ThemesUserSettings { const currentTheme = this.theme(); this.themesObjects( - this.themes().map(theme => ({ + this.themes.map(theme => ({ name: theme, nameDisplay: convertThemeName(theme), selected: ko.observable(theme === currentTheme), diff --git a/dev/Stores/Admin/Domain.js b/dev/Stores/Admin/Domain.js index 4bd9914ab..ffdbe767c 100644 --- a/dev/Stores/Admin/Domain.js +++ b/dev/Stores/Admin/Domain.js @@ -2,9 +2,9 @@ import ko from 'ko'; class DomainAdminStore { constructor() { - this.domains = ko.observableArray([]); + this.domains = ko.observableArray(); this.domains.loading = ko.observable(false).extend({ 'throttle': 100 }); - this.domainsWithoutAliases = ko.computed(() => this.domains().filter(item => item && !item.alias)); + this.domainsWithoutAliases = ko.computed(() => this.domains.filter(item => item && !item.alias)); } } diff --git a/dev/Stores/Admin/Package.js b/dev/Stores/Admin/Package.js index 43ec82348..3edb010a1 100644 --- a/dev/Stores/Admin/Package.js +++ b/dev/Stores/Admin/Package.js @@ -2,7 +2,7 @@ import ko from 'ko'; class PackageAdminStore { constructor() { - this.packages = ko.observableArray([]); + this.packages = ko.observableArray(); this.packages.loading = ko.observable(false).extend({ throttle: 100 }); ko.addObservablesTo(this, { diff --git a/dev/Stores/Admin/Plugin.js b/dev/Stores/Admin/Plugin.js index 3dc4d8bc8..c60b03e84 100644 --- a/dev/Stores/Admin/Plugin.js +++ b/dev/Stores/Admin/Plugin.js @@ -2,7 +2,7 @@ import ko from 'ko'; class PluginAdminStore { constructor() { - this.plugins = ko.observableArray([]); + this.plugins = ko.observableArray(); this.plugins.loading = ko.observable(false).extend({ throttle: 100 }); this.plugins.error = ko.observable(''); } diff --git a/dev/Stores/Language.js b/dev/Stores/Language.js index 1da16c77b..a2d1139e0 100644 --- a/dev/Stores/Language.js +++ b/dev/Stores/Language.js @@ -2,8 +2,8 @@ import ko from 'ko'; class LanguageStore { constructor() { - this.languages = ko.observableArray([]); - this.languagesAdmin = ko.observableArray([]); + this.languages = ko.observableArray(); + this.languagesAdmin = ko.observableArray(); this.language = ko .observable('') diff --git a/dev/Stores/Theme.js b/dev/Stores/Theme.js index 9a7d441e1..6198c87e9 100644 --- a/dev/Stores/Theme.js +++ b/dev/Stores/Theme.js @@ -2,7 +2,7 @@ import ko from 'ko'; class ThemeStore { constructor() { - this.themes = ko.observableArray([]); + this.themes = ko.observableArray(); this.themeBackgroundName = ko.observable(''); this.themeBackgroundHash = ko.observable(''); diff --git a/dev/Stores/User/Account.js b/dev/Stores/User/Account.js index 4e0c1ca18..512172026 100644 --- a/dev/Stores/User/Account.js +++ b/dev/Stores/User/Account.js @@ -8,10 +8,10 @@ class AccountUserStore { signature: '' }); - this.accounts = ko.observableArray([]); + this.accounts = ko.observableArray(); this.accounts.loading = ko.observable(false).extend({ throttle: 100 }); - this.getEmailAddresses = () => this.accounts().map(item => item ? item.email : null).filter(v => v); + this.getEmailAddresses = () => this.accounts.map(item => item ? item.email : null).filter(v => v); this.accountsUnreadCount = ko.computed(() => 0); // this.accountsUnreadCount = ko.computed(() => { diff --git a/dev/Stores/User/App.js b/dev/Stores/User/App.js index 3504be412..042eecb7b 100644 --- a/dev/Stores/User/App.js +++ b/dev/Stores/User/App.js @@ -50,7 +50,7 @@ class AppUserStore { } }); - this.attachmentsActions = ko.observableArray([]); + this.attachmentsActions = ko.observableArray(); this.devEmail = ''; this.devPassword = ''; diff --git a/dev/Stores/User/Contact.js b/dev/Stores/User/Contact.js index aaa5cead8..8137f8f59 100644 --- a/dev/Stores/User/Contact.js +++ b/dev/Stores/User/Contact.js @@ -2,7 +2,7 @@ import ko from 'ko'; class ContactUserStore { constructor() { - this.contacts = ko.observableArray([]); + this.contacts = ko.observableArray(); this.contacts.loading = ko.observable(false).extend({ throttle: 200 }); this.contacts.importing = ko.observable(false).extend({ throttle: 200 }); this.contacts.syncing = ko.observable(false).extend({ throttle: 200 }); diff --git a/dev/Stores/User/Folder.js b/dev/Stores/User/Folder.js index 5487a5777..1c43079fe 100644 --- a/dev/Stores/User/Folder.js +++ b/dev/Stores/User/Folder.js @@ -36,7 +36,7 @@ class FolderUserStore { this.namespace = ''; - this.folderList = ko.observableArray([]); + this.folderList = ko.observableArray(); this.currentFolder = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'selected'] }); @@ -47,7 +47,7 @@ class FolderUserStore { ); this.foldersListWithSingleInboxRootFolder = ko.computed( - () => !this.folderList().find(folder => folder && !folder.isSystemFolder() && folder.visible()) + () => !this.folderList.find(folder => folder && !folder.isSystemFolder() && folder.visible()) ); this.currentFolderFullNameRaw = ko.computed(() => (this.currentFolder() ? this.currentFolder().fullNameRaw : '')); @@ -66,14 +66,13 @@ class FolderUserStore { this.folderListSystemNames = ko.computed(() => { const list = [getFolderInboxName()], - folders = this.folderList(), sentFolder = this.sentFolder(), draftFolder = this.draftFolder(), spamFolder = this.spamFolder(), trashFolder = this.trashFolder(), archiveFolder = this.archiveFolder(); - if (Array.isNotEmpty(folders)) { + if (this.folderList.length) { if (sentFolder && UNUSED_OPTION_VALUE !== sentFolder) { list.push(sentFolder); } @@ -178,7 +177,7 @@ class FolderUserStore { timeouts.push([folder.interval, folder.fullNameRaw]); } - if (folder && folder.subFolders().length) { + if (folder && folder.subFolders.length) { fSearchFunction(folder.subFolders()); } }); diff --git a/dev/Stores/User/Identity.js b/dev/Stores/User/Identity.js index 7fa4ee9f4..ed3344c46 100644 --- a/dev/Stores/User/Identity.js +++ b/dev/Stores/User/Identity.js @@ -2,10 +2,10 @@ import ko from 'ko'; class IdentityUserStore { constructor() { - this.identities = ko.observableArray([]); + this.identities = ko.observableArray(); this.identities.loading = ko.observable(false).extend({ throttle: 100 }); - this.getIDS = () => this.identities().map(item => (item ? item.id() : null)).filter(value => null !== value); + this.getIDS = () => this.identities.map(item => (item ? item.id() : null)).filter(value => null !== value); } } diff --git a/dev/Stores/User/Message.js b/dev/Stores/User/Message.js index 13df98381..46c48d03b 100644 --- a/dev/Stores/User/Message.js +++ b/dev/Stores/User/Message.js @@ -57,7 +57,7 @@ class MessageUserStore { constructor() { this.staticMessage = new MessageModel(); - this.messageList = ko.observableArray([]).extend({ rateLimit: 0 }); + this.messageList = ko.observableArray().extend({ rateLimit: 0 }); ko.addObservablesTo(this, { messageListCount: 0, @@ -136,7 +136,7 @@ class MessageUserStore { this.isMessageSelected = ko.computed(() => null !== this.message()); this.messageListChecked = ko - .computed(() => this.messageList().filter(item => item.checked())) + .computed(() => this.messageList.filter(item => item.checked())) .extend({ rateLimit: 0 }); this.hasCheckedMessages = ko.computed(() => 0 < this.messageListChecked().length).extend({ rateLimit: 0 }); @@ -279,7 +279,7 @@ class MessageUserStore { uidForRemove = uidForRemove.map(mValue => pInt(mValue)); let unseenCount = 0, - messageList = this.messageList(), + messageList = this.messageList, currentMessage = this.message(); const trashFolder = FolderStore.trashFolder(), @@ -342,7 +342,7 @@ class MessageUserStore { setTimeout(() => { messages.forEach(item => { - this.messageList.remove(item); + messageList.remove(item); }); }, 350); } @@ -357,10 +357,7 @@ class MessageUserStore { } if (this.messageListThreadUid()) { - messageList = this.messageList(); - if ( - messageList && messageList.length && !!messageList.find(item => !!(item && item.deleted() && item.uid === this.messageListThreadUid())) ) { @@ -592,11 +589,11 @@ class MessageUserStore { (message.folder !== selectedMessage.folder || message.uid !== selectedMessage.uid) ) { this.selectorMessageSelected(null); - if (1 === this.messageList().length) { + if (1 === this.messageList.length) { this.selectorMessageFocused(null); } } else if (!selectedMessage && message) { - selectedMessage = this.messageList().find( + selectedMessage = this.messageList.find( subMessage => subMessage && subMessage.folder === message.folder && diff --git a/dev/Stores/User/Pgp.js b/dev/Stores/User/Pgp.js index 516dc8e6f..08d2f7fdf 100644 --- a/dev/Stores/User/Pgp.js +++ b/dev/Stores/User/Pgp.js @@ -135,11 +135,11 @@ class PgpUserStore { this.openpgp = null; - this.openpgpkeys = ko.observableArray([]); + this.openpgpkeys = ko.observableArray(); this.openpgpKeyring = null; - this.openpgpkeysPublic = ko.computed(() => this.openpgpkeys().filter(item => item && !item.isPrivate)); - this.openpgpkeysPrivate = ko.computed(() => this.openpgpkeys().filter(item => item && item.isPrivate)); + this.openpgpkeysPublic = ko.computed(() => this.openpgpkeys.filter(item => item && !item.isPrivate)); + this.openpgpkeysPrivate = ko.computed(() => this.openpgpkeys.filter(item => item && item.isPrivate)); } /** diff --git a/dev/Stores/User/Sieve.js b/dev/Stores/User/Sieve.js index c2b1ef06c..5e72c0da2 100644 --- a/dev/Stores/User/Sieve.js +++ b/dev/Stores/User/Sieve.js @@ -3,9 +3,9 @@ import ko from 'ko'; class SieveUserStore { constructor() { // capabilities - this.capa = ko.observableArray([]); + this.capa = ko.observableArray(); // Sieve scripts SieveScriptModel - this.scripts = ko.observableArray([]); + this.scripts = ko.observableArray(); } } diff --git a/dev/Stores/User/Template.js b/dev/Stores/User/Template.js index 21fc7bf15..21fdb6e88 100644 --- a/dev/Stores/User/Template.js +++ b/dev/Stores/User/Template.js @@ -4,10 +4,10 @@ import ko from 'ko'; class TemplateUserStore { constructor() { - this.templates = ko.observableArray([]); + this.templates = ko.observableArray(); this.templates.loading = ko.observable(false).extend({ throttle: 100 }); - this.templatesNames = ko.observableArray([]).extend({ throttle: 1000 }); + this.templatesNames = ko.observableArray().extend({ throttle: 1000 }); this.templatesNames.skipFirst = true; this.subscribers(); diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index 0c59c262a..b0147e7c1 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -208,7 +208,7 @@ class ComposePopupView extends AbstractViewNext { } }).extend({ notify: 'always' }); - this.attachments = ko.observableArray([]); + this.attachments = ko.observableArray(); this.dragAndDropOver = ko.observable(false).extend({ throttle: 1 }); this.dragAndDropVisible = ko.observable(false).extend({ throttle: 1 }); @@ -256,17 +256,17 @@ class ComposePopupView extends AbstractViewNext { return result; }, - attachmentsInProcess: () => this.attachments().filter(item => item && !item.complete()), - attachmentsInReady: () => this.attachments().filter(item => item && item.complete()), - attachmentsInError: () => this.attachments().filter(item => item && item.error()), + attachmentsInProcess: () => this.attachments.filter(item => item && !item.complete()), + attachmentsInReady: () => this.attachments.filter(item => item && item.complete()), + attachmentsInError: () => this.attachments.filter(item => item && item.error()), - attachmentsCount: () => this.attachments().length, - attachmentsInErrorCount: () => this.attachmentsInError().length, - attachmentsInProcessCount: () => this.attachmentsInProcess().length, + attachmentsCount: () => this.attachments.length, + attachmentsInErrorCount: () => this.attachmentsInError.length, + attachmentsInProcessCount: () => this.attachmentsInProcess.length, isDraftFolderMessage: () => this.draftFolder() && this.draftUid(), identitiesOptions: () => - IdentityStore.identities().map(item => ({ + IdentityStore.identities.map(item => ({ 'item': item, 'optValue': item.id(), 'optText': item.formattedName() @@ -1106,7 +1106,7 @@ class ComposePopupView extends AbstractViewNext { } }); } else { - this.attachments().forEach(attachment => { + this.attachments.forEach(attachment => { if (attachment && attachment.fromMessage) { attachment .waiting(false) @@ -1221,7 +1221,7 @@ class ComposePopupView extends AbstractViewNext { * @returns {?Object} */ getAttachmentById(id) { - return this.attachments().find(item => item && id === item.id); + return this.attachments.find(item => item && id === item.id); } cancelAttachmentHelper(id, oJua) { @@ -1428,7 +1428,7 @@ class ComposePopupView extends AbstractViewNext { if (ComposeType.ForwardAsAttachment === type) { this.addMessageAsAttachment(message); } else { - message.attachments().forEach(item => { + message.attachments.forEach(item => { let add = false; switch (type) { case ComposeType.Reply: @@ -1464,15 +1464,15 @@ class ComposePopupView extends AbstractViewNext { */ isEmptyForm(includeAttachmentInProgress = true) { const withoutAttachment = includeAttachmentInProgress - ? !this.attachments().length + ? !this.attachments.length : !this.attachmentsInReady().length; return ( - !this.to().length && - !this.cc().length && - !this.bcc().length && - !this.replyTo().length && - !this.subject().length && + !this.to.length && + !this.cc.length && + !this.bcc.length && + !this.replyTo.length && + !this.subject.length && withoutAttachment && (!this.oEditor || !this.oEditor.getData()) ); @@ -1528,7 +1528,7 @@ class ComposePopupView extends AbstractViewNext { * @returns {Array} */ getAttachmentsDownloadsForUpload() { - return this.attachments().filter(item => item && !item.tempName()).map( + return this.attachments.filter(item => item && !item.tempName()).map( item => item.id ); } diff --git a/dev/View/Popup/ComposeOpenPgp.js b/dev/View/Popup/ComposeOpenPgp.js index 48839e601..5f0e5c607 100644 --- a/dev/View/Popup/ComposeOpenPgp.js +++ b/dev/View/Popup/ComposeOpenPgp.js @@ -41,10 +41,10 @@ class ComposeOpenPgpPopupView extends AbstractViewNext { submitRequest: false }); - this.encryptKeys = ko.observableArray([]); + this.encryptKeys = ko.observableArray(); this.addComputables({ - encryptKeysView: () => this.encryptKeys().map(oKey => (oKey ? oKey.key : null)).filter(v => v), + encryptKeysView: () => this.encryptKeys.map(oKey => (oKey ? oKey.key : null)).filter(v => v), privateKeysOptions: () => { const opts = PgpStore.openpgpkeysPrivate().map((oKey, iIndex) => { @@ -150,13 +150,10 @@ class ComposeOpenPgpPopupView extends AbstractViewNext { } if (result && this.encrypt()) { - if (!this.encryptKeys().length) { - this.notification(i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND')); - result = false; - } else if (this.encryptKeys()) { + if (this.encryptKeys.length) { aPublicKeys = []; - this.encryptKeys().forEach(oKey => { + this.encryptKeys.forEach(oKey => { if (oKey && oKey.key) { aPublicKeys = aPublicKeys.concat(oKey.key.getNativeKeys().flat(Infinity).filter(v => v)); } else if (oKey && oKey.email) { @@ -170,9 +167,12 @@ class ComposeOpenPgpPopupView extends AbstractViewNext { } }); - if (result && (!aPublicKeys.length || this.encryptKeys().length !== aPublicKeys.length)) { + if (result && (!aPublicKeys.length || this.encryptKeys.length !== aPublicKeys.length)) { result = false; } + } else { + this.notification(i18n('PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND')); + result = false; } } @@ -261,11 +261,10 @@ class ComposeOpenPgpPopupView extends AbstractViewNext { @command() addCommand() { const keyId = this.selectedPublicKey(), - keys = this.encryptKeys(), option = keyId ? this.publicKeysOptions().find(item => item && keyId === item.id) : null; if (option) { - keys.push({ + this.encryptKeys.push({ 'empty': !option.key, 'selected': ko.observable(!!option.key), 'removable': ko.observable(!this.sign() || !this.signKey() || this.signKey().key.id !== option.key.id), @@ -273,16 +272,14 @@ class ComposeOpenPgpPopupView extends AbstractViewNext { 'hash': option.key.id.substr(KEY_NAME_SUBSTR).toUpperCase(), 'key': option.key }); - - this.encryptKeys(keys); } } @command() updateCommand() { - this.encryptKeys().forEach(oKey => { - oKey.removable(!this.sign() || !this.signKey() || this.signKey().key.id !== oKey.key.id); - }); + this.encryptKeys.forEach(oKey => + oKey.removable(!this.sign() || !this.signKey() || this.signKey().key.id !== oKey.key.id) + ); } deletePublickKey(publicKey) { @@ -390,7 +387,7 @@ class ComposeOpenPgpPopupView extends AbstractViewNext { }).flat().validUnique(encryptKey => encryptKey.hash) ); - if (this.encryptKeys().length) { + if (this.encryptKeys.length) { this.encrypt(true); } } diff --git a/dev/View/Popup/Contacts.js b/dev/View/Popup/Contacts.js index e0bc46974..b0bfbdc27 100644 --- a/dev/View/Popup/Contacts.js +++ b/dev/View/Popup/Contacts.js @@ -73,7 +73,7 @@ class ContactsPopupView extends AbstractViewNext { this.contacts = ContactStore.contacts; - this.viewProperties = ko.observableArray([]); + this.viewProperties = ko.observableArray(); /* // Somehow this is broken now when calling addNewProperty @@ -127,17 +127,17 @@ class ContactsPopupView extends AbstractViewNext { contactsPaginator: computedPaginatorHelper(this.contactsPage, pagecount), - viewPropertiesNames: () => this.viewProperties().filter(propertyIsName), + viewPropertiesNames: () => this.viewProperties.filter(propertyIsName), - viewPropertiesEmails: () => this.viewProperties().filter(propertyIsMail), + viewPropertiesEmails: () => this.viewProperties.filter(propertyIsMail), - viewPropertiesOther: () => this.viewProperties().filter(property => property.isType(ContactPropertyType.Nick)), + viewPropertiesOther: () => this.viewProperties.filter(property => property.isType(ContactPropertyType.Nick)), - viewPropertiesWeb: () => this.viewProperties().filter(property => property.isType(ContactPropertyType.Web)), + viewPropertiesWeb: () => this.viewProperties.filter(property => property.isType(ContactPropertyType.Web)), - viewPropertiesPhones: () => this.viewProperties().filter(property => property.isType(ContactPropertyType.Phone)), + viewPropertiesPhones: () => this.viewProperties.filter(property => property.isType(ContactPropertyType.Phone)), - contactHasValidName: () => !!this.viewProperties().find(prop => propertyIsName(prop) && prop.isValid()), + contactHasValidName: () => !!this.viewProperties.find(prop => propertyIsName(prop) && prop.isValid()), /* viewPropertiesEmailsEmptyAndOnFocused: () => this.viewPropertiesEmails().filter(propertyFocused), viewPropertiesPhonesEmptyAndOnFocused: () => this.viewPropertiesPhones().filter(propertyFocused), @@ -145,7 +145,7 @@ class ContactsPopupView extends AbstractViewNext { viewPropertiesOtherEmptyAndOnFocused: () => this.viewPropertiesOther().filter(propertyFocused), */ contactsCheckedOrSelected: () => { - const checked = this.contacts().filter(item => item.checked && item.checked()), + const checked = this.contacts.filter(item => item.checked && item.checked()), selected = this.currentContact(); return selected @@ -155,7 +155,7 @@ class ContactsPopupView extends AbstractViewNext { contactsCheckedOrSelectedUids: () => this.contactsCheckedOrSelected().map(contact => contact.id), - viewHash: () => '' + this.viewProperties().map(property => property.value && property.value()).join('') + viewHash: () => '' + this.viewProperties.map(property => property.value && property.value()).join('') }); this.search.subscribe(() => this.reloadContactList()); @@ -243,7 +243,7 @@ class ContactsPopupView extends AbstractViewNext { @command(self => !self.viewSaving() && !self.viewReadOnly() - && (self.contactHasValidName() || self.viewProperties().find(prop => propertyIsMail(prop) && prop.isValid())) + && (self.contactHasValidName() || self.viewProperties.find(prop => propertyIsMail(prop) && prop.isValid())) ) saveCommand() { this.viewSaving(true); @@ -282,7 +282,7 @@ class ContactsPopupView extends AbstractViewNext { }, requestUid, this.viewID(), - this.viewProperties().map(oItem => oItem.toJSON()) + this.viewProperties.map(oItem => oItem.toJSON()) ); } @@ -322,7 +322,7 @@ class ContactsPopupView extends AbstractViewNext { } addNewOrFocusProperty(type, typeStr) { - const item = this.viewProperties().find(prop => prop.isType(type)); + const item = this.viewProperties.find(prop => prop.isType(type)); if (item) { item.focused(true); } else { @@ -393,7 +393,7 @@ class ContactsPopupView extends AbstractViewNext { contacts = this.contactsCheckedOrSelected(); let currentContact = this.currentContact(), - count = this.contacts().length; + count = this.contacts.length; if (contacts.length) { contacts.forEach(contact => { diff --git a/dev/View/Popup/Filter.js b/dev/View/Popup/Filter.js index af7d13ece..84040c351 100644 --- a/dev/View/Popup/Filter.js +++ b/dev/View/Popup/Filter.js @@ -33,7 +33,7 @@ class FilterPopupView extends AbstractViewNext { this.selectedFolderValue.subscribe(() => this.filter() && this.filter().actionValueError(false)); ['actionTypeOptions','fieldOptions','typeOptions','typeOptionsSize','typeOptionsBody'].forEach( - key => this[key] = ko.observableArray([]) + key => this[key] = ko.observableArray() ); initOnStartOrLangChange(this.populateOptions.bind(this)); @@ -80,7 +80,7 @@ class FilterPopupView extends AbstractViewNext { // this.actionTypeOptions.push({'id': FiltersAction.None, // 'name': i18n('GLOBAL/NONE')}); - const modules = SieveStore.capa(); + const modules = SieveStore.capa; if (modules) { if (modules.includes('imap4flags')) { this.allowMarkAsRead(true); diff --git a/dev/View/Popup/Languages.js b/dev/View/Popup/Languages.js index 35a966c3c..83e0d1248 100644 --- a/dev/View/Popup/Languages.js +++ b/dev/View/Popup/Languages.js @@ -17,11 +17,11 @@ class LanguagesPopupView extends AbstractViewNext { this.fLang = null; this.userLanguage = ko.observable(''); - this.langs = ko.observableArray([]); + this.langs = ko.observableArray(); this.languages = ko.computed(() => { const userLanguage = this.userLanguage(); - return this.langs().map(language => ({ + return this.langs.map(language => ({ key: language, user: language === userLanguage, selected: ko.observable(false), @@ -39,9 +39,7 @@ class LanguagesPopupView extends AbstractViewNext { setLanguageSelection() { const currentLang = this.fLang ? ko.unwrap(this.fLang) : ''; - this.languages().forEach(item => { - item.selected(item.key === currentLang); - }); + this.languages.forEach(item => item.selected(item.key === currentLang)); } onBeforeShow() { diff --git a/dev/View/Popup/MessageOpenPgp.js b/dev/View/Popup/MessageOpenPgp.js index 464cafabf..7761c04dc 100644 --- a/dev/View/Popup/MessageOpenPgp.js +++ b/dev/View/Popup/MessageOpenPgp.js @@ -20,7 +20,7 @@ class MessageOpenPgpPopupView extends AbstractViewNext { password: '', submitRequest: false }); - this.privateKeys = ko.observableArray([]); + this.privateKeys = ko.observableArray(); this.resultCallback = null; diff --git a/dev/View/Popup/Plugin.js b/dev/View/Popup/Plugin.js index 5bd9a9ac2..a4f88669b 100644 --- a/dev/View/Popup/Plugin.js +++ b/dev/View/Popup/Plugin.js @@ -24,10 +24,10 @@ class PluginPopupView extends AbstractViewNext { readme: '' }); - this.configures = ko.observableArray([]); + this.configures = ko.observableArray(); this.hasReadme = ko.computed(() => !!this.readme()); - this.hasConfiguration = ko.computed(() => 0 < this.configures().length); + this.hasConfiguration = ko.computed(() => 0 < this.configures.length); this.bDisabeCloseOnEsc = true; this.sDefaultKeyScope = KeyState.All; @@ -40,7 +40,7 @@ class PluginPopupView extends AbstractViewNext { const list = {}; list.Name = this.name(); - this.configures().forEach(oItem => { + this.configures.forEach(oItem => { let value = oItem.value(); if (false === value || true === value) { value = value ? '1' : '0'; diff --git a/dev/View/User/MailBox/MessageList.js b/dev/View/User/MailBox/MessageList.js index 36b784e5e..79145e364 100644 --- a/dev/View/User/MailBox/MessageList.js +++ b/dev/View/User/MailBox/MessageList.js @@ -141,7 +141,7 @@ class MessageListMailBoxUserView extends AbstractViewNext { read: () => 0 < MessageStore.messageListChecked().length, write: (value) => { value = !!value; - MessageStore.messageList().forEach(message => message.checked(value)); + MessageStore.messageList.forEach(message => message.checked(value)); } }, @@ -152,10 +152,10 @@ class MessageListMailBoxUserView extends AbstractViewNext { isIncompleteChecked: () => { const c = MessageStore.messageListChecked().length; - return c && MessageStore.messageList().length > c; + return c && MessageStore.messageList.length > c; }, - hasMessages: () => 0 < this.messageList().length, + hasMessages: () => 0 < this.messageList.length, hasCheckedOrSelectedLines: () => 0 < this.messageListCheckedOrSelected().length, @@ -219,7 +219,7 @@ class MessageListMailBoxUserView extends AbstractViewNext { addEventListener('mailbox.message.show', e => { const sFolder = e.detail.Folder, sUid = e.detail.Uid; - const message = this.messageList().find( + const message = this.messageList.find( item => item && sFolder === item.folder && sUid === item.uid ); @@ -492,7 +492,7 @@ class MessageListMailBoxUserView extends AbstractViewNext { case MessageSetAction.SetSeen: folder = getFolderFromCacheList(sFolderFullNameRaw); if (folder) { - MessageStore.messageList().forEach(message => { + MessageStore.messageList.forEach(message => { if (message.isUnseen()) { ++cnt; } @@ -518,7 +518,7 @@ class MessageListMailBoxUserView extends AbstractViewNext { case MessageSetAction.UnsetSeen: folder = getFolderFromCacheList(sFolderFullNameRaw); if (folder) { - MessageStore.messageList().forEach(message => { + MessageStore.messageList.forEach(message => { if (!message.isUnseen()) { ++cnt; } @@ -675,7 +675,7 @@ class MessageListMailBoxUserView extends AbstractViewNext { !this.messageListSearchDesc() && !this.messageListError() && !this.messageListEndThreadUid() && - this.messageList().length && + this.messageList.length && (this.isSpamFolder() || this.isTrashFolder()) ); } @@ -864,7 +864,7 @@ class MessageListMailBoxUserView extends AbstractViewNext { prefetchNextTick() { if (ifvisible && !this.bPrefetch && !ifvisible.now() && this.viewModelVisible) { - const message = this.messageList().find( + const message = this.messageList.find( item => item && !hasRequestedMessage(item.folder, item.uid) ); if (message) { diff --git a/dev/View/User/MailBox/MessageView.js b/dev/View/User/MailBox/MessageView.js index 67d92385c..b4db76270 100644 --- a/dev/View/User/MailBox/MessageView.js +++ b/dev/View/User/MailBox/MessageView.js @@ -157,9 +157,9 @@ class MessageViewMailBoxUserView extends AbstractViewNext { }); this.addComputables({ - allowAttachmnetControls: () => this.attachmentsActions().length && Settings.capa(Capa.AttachmentsActions), + allowAttachmnetControls: () => this.attachmentsActions.length && Settings.capa(Capa.AttachmentsActions), - downloadAsZipAllowed: () => this.attachmentsActions().includes('zip') && this.allowAttachmnetControls(), + downloadAsZipAllowed: () => this.attachmentsActions.includes('zip') && this.allowAttachmnetControls(), lastReplyAction: { read: this.lastReplyAction_, @@ -206,7 +206,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext { this.addSubscribables({ showAttachmnetControls: v => this.message() - && this.message().attachments().forEach(item => item && item.checked(!!v)), + && this.message().attachments.forEach(item => item && item.checked(!!v)), lastReplyAction_: value => Local.set(ClientSideKeyName.LastReplyAction, value), @@ -380,7 +380,7 @@ class MessageViewMailBoxUserView extends AbstractViewNext { attachmentPreview(/*attachment*/) { /* if (attachment && attachment.isImage() && !attachment.isLinked && this.message() && this.message().attachments()) { - const items = this.message().attachments().map(item => { + const items = this.message().attachments.map(item => { if (item && !item.isLinked && item.isImage()) { if (item === attachment) { index = listIndex; @@ -712,13 +712,10 @@ class MessageViewMailBoxUserView extends AbstractViewNext { } } - getAttachmentsHashes() { - const atts = this.message() ? this.message().attachments() : []; - return atts.map(item => (item && !item.isLinked && item.checked() ? item.download : '')).filter(v => v); - } - downloadAsZip() { - const hashes = this.getAttachmentsHashes(); + const hashes = (this.message() ? this.message().attachments : []) + .map(item => (item && !item.isLinked && item.checked() ? item.download : '')) + .filter(v => v); if (hashes.length) { Remote.attachmentsActions('Zip', hashes, this.downloadAsZipLoading) .then((result) => { diff --git a/vendors/knockout/build/output/knockout-latest.debug.js b/vendors/knockout/build/output/knockout-latest.debug.js index 999a758fe..73875a3de 100644 --- a/vendors/knockout/build/output/knockout-latest.debug.js +++ b/vendors/knockout/build/output/knockout-latest.debug.js @@ -814,14 +814,7 @@ ko.observable = initialValue => { observable[observableLatestValue] = initialValue; Object.defineProperty(observable, length, { - get: () => length in observable[observableLatestValue] ? observable[observableLatestValue][length] : undefined, - set: function(value) { - if (length in observable[observableLatestValue]) { - this.valueWillMutate(); - observable[observableLatestValue][length] = value; - this.valueHasMutated(); - } - } + get: () => null == observable[observableLatestValue] ? undefined : observable[observableLatestValue][length] }); // Inherit from 'subscribable' @@ -932,9 +925,11 @@ Object.setPrototypeOf(ko.observableArray['fn'], ko.observable['fn']); // Populate ko.observableArray.fn with native arrays functions Object.getOwnPropertyNames(Array.prototype).forEach(methodName => { - if (typeof Array.prototype[methodName] === 'function') { - if (["pop", "push", "reverse", "shift", "sort", "splice", "unshift"].includes(methodName)) { + // skip property length + if (typeof Array.prototype[methodName] === 'function' && 'constructor' != methodName) { + if (["copyWithin", "fill", "pop", "push", "reverse", "shift", "sort", "splice", "unshift"].includes(methodName)) { // Mutator methods + // https://developer.mozilla.org/tr/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype#mutator_methods // Important: Do not add any additional functions here that may reasonably be used to *read* data from the array // because we'll eval them without causing subscriptions, so ko.computed output could end up getting stale ko.observableArray['fn'][methodName] = function (...args) { diff --git a/vendors/knockout/build/output/knockout-latest.js b/vendors/knockout/build/output/knockout-latest.js index ce162d7e8..8bdf53e04 100644 --- a/vendors/knockout/build/output/knockout-latest.js +++ b/vendors/knockout/build/output/knockout-latest.js @@ -4,86 +4,86 @@ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */ -(C=>{function G(b,c){return null===b||typeof b in ha?b===c:!1}function F(b,c){var e;return()=>{e||(e=a.a.setTimeout(()=>{e=void 0;b()},c))}}function I(b,c){var e;return()=>{clearTimeout(e);e=a.a.setTimeout(b,c)}}function T(b,c){null!==c&&c.o&&c.o()}function X(b,c){var e=this.rc,g=e[D];g.ca||(this.ab&&this.Ia[c]?(e.Fb(c,b,this.Ia[c]),this.Ia[c]=null,--this.ab):g.u[c]||e.Fb(c,b,g.v?{X:b}:e.fc(b)),b.oa&&b.kc())}var U=C.document,Z={},a="undefined"!==typeof Z?Z:{};a.l=(b,c)=>{b=b.split(".");for(var e= -a,g=0;g{b[c]=e};a.version="3.5.1-sm";a.l("version",a.version);a.a={Ea:(b,c)=>{c=b.indexOf(c);0{c&&Object.entries(c).forEach(e=>b[e[0]]=e[1]);return b},P:(b,c)=>b&&Object.entries(b).forEach(e=>c(e[0],e[1])),nb:(b,c,e)=>{if(!b)return b;var g={};Object.entries(b).forEach(k=>g[k[0]]=c.call(e,k[1],k[0],b));return g},eb:b=>{for(;b.firstChild;)a.removeNode(b.firstChild)},lb:b=>{var c=[...b],e=(c[0]&& -c[0].ownerDocument||U).createElement("div");b.forEach(g=>e.append(a.ia(g)));return e},Ga:(b,c)=>Array.prototype.map.call(b,c?e=>a.ia(e.cloneNode(!0)):e=>e.cloneNode(!0)),za:(b,c)=>{a.a.eb(b);c&&b.append(...c)},wa:(b,c)=>{if(b.length){for(c=8===c.nodeType&&c.parentNode||c;b.length&&b[0].parentNode!==c;)b.splice(0,1);for(;1null==b?"": +(C=>{function G(b,c){return null===b||typeof b in ha?b===c:!1}function F(b,c){var e;return()=>{e||(e=a.a.setTimeout(()=>{e=void 0;b()},c))}}function I(b,c){var e;return()=>{clearTimeout(e);e=a.a.setTimeout(b,c)}}function T(b,c){null!==c&&c.o&&c.o()}function X(b,c){var e=this.rc,g=e[D];g.ca||(this.ab&&this.Ha[c]?(e.Fb(c,b,this.Ha[c]),this.Ha[c]=null,--this.ab):g.u[c]||e.Fb(c,b,g.v?{X:b}:e.fc(b)),b.na&&b.kc())}var U=C.document,Z={},a="undefined"!==typeof Z?Z:{};a.l=(b,c)=>{b=b.split(".");for(var e= +a,g=0;g{b[c]=e};a.version="3.5.1-sm";a.l("version",a.version);a.a={Da:(b,c)=>{c=b.indexOf(c);0{c&&Object.entries(c).forEach(e=>b[e[0]]=e[1]);return b},P:(b,c)=>b&&Object.entries(b).forEach(e=>c(e[0],e[1])),nb:(b,c,e)=>{if(!b)return b;var g={};Object.entries(b).forEach(k=>g[k[0]]=c.call(e,k[1],k[0],b));return g},eb:b=>{for(;b.firstChild;)a.removeNode(b.firstChild)},lb:b=>{var c=[...b],e=(c[0]&& +c[0].ownerDocument||U).createElement("div");b.forEach(g=>e.append(a.ia(g)));return e},Fa:(b,c)=>Array.prototype.map.call(b,c?e=>a.ia(e.cloneNode(!0)):e=>e.cloneNode(!0)),ya:(b,c)=>{a.a.eb(b);c&&b.append(...c)},va:(b,c)=>{if(b.length){for(c=8===c.nodeType&&c.parentNode||c;b.length&&b[0].parentNode!==c;)b.splice(0,1);for(;1null==b?"": b.trim?b.trim():b.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,""),Mc:(b,c)=>{b=b||"";return c.length>b.length?!1:b.substring(0,c.length)===c},uc:(b,c)=>c.contains(1!==b.nodeType?b.parentNode:b),cb:b=>a.a.uc(b,b.ownerDocument.documentElement),Mb:b=>a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b,setTimeout:(b,c)=>setTimeout(a.a.Mb(b),c),Qb:b=>setTimeout(()=>{a.onError&&a.onError(b);throw b;},0),J:(b,c,e)=>{b.addEventListener(c,a.a.Mb(e),!1)},hc:(b, c)=>{if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");b.dispatchEvent(new Event(c))},g:b=>a.M(b)?b():b,rb:(b,c)=>b.textContent=a.a.g(c)||""};a.l("utils",a.a);a.l("unwrap",a.a.g);a.a.b=new function(){var b=0,c="__ko__"+Date.now(),e=(g,k)=>{var n=g[c];!n&&k&&(n=g[c]={});return n};return{get:(g,k)=>(g=e(g,!1))&&g[k],set:(g,k,n)=>{(g=e(g,void 0!==n))&&(g[k]=n)},hb:(g,k,n)=>{g=e(g,!0);return g[k]||(g[k]=n)},clear:g=>g[c]?(delete g[c],!0):!1,U:()=>b++ +c}};a.a.L=new function(){function b(d, -f){var h=a.a.b.get(d,g);void 0===h&&f&&(h=[],a.a.b.set(d,g,h));return h}function c(d){var f=b(d,!1);if(f){f=f.slice(0);for(var h=0;h{if("function"!=typeof f)throw Error("Callback must be a function");b(d,!0).push(f)},qb:(d,f)=> -{var h=b(d,!1);h&&(a.a.Ea(h,f),0==h.length&&a.a.b.set(d,g,void 0))},ia:d=>{a.m.H(()=>{k[d.nodeType]&&(c(d),n[d.nodeType]&&e(d.getElementsByTagName("*")))});return d},removeNode:d=>{a.ia(d);d.parentNode&&d.parentNode.removeChild(d)}}};a.ia=a.a.L.ia;a.removeNode=a.a.L.removeNode;a.l("utils.domNodeDisposal",a.a.L);a.l("utils.domNodeDisposal.addDisposeCallback",a.a.L.ra);(()=>{var b=[0,"",""],c=[1,"","
"],e=[3,"","
"],g=[1,""],k={thead:c,tbody:c,tfoot:c,tr:[2,"","
"],td:e,th:e,option:g,optgroup:g};a.a.Qa=(n,d)=>{d||(d=U);var f=a.a.tb(n).toLowerCase();d=d.createElement("div");f=(f=f.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&k[f[1]]||b;var h=f[0];for(d.innerHTML="
"+f[1]+n+f[2]+"
";h--;)d=d.lastChild;return[...d.lastChild.childNodes]};a.a.Fc=(n,d)=>{n=a.a.Qa(n,d);return n.length&&n[0].parentElement||a.a.lb(n)};a.a.ec=(n,d)=>{a.a.eb(n);d=a.a.g(d);if(null!==d&&void 0!== -d){"string"!=typeof d&&(d=d.toString());d=a.a.Qa(d,n.ownerDocument);for(var f=0;f{function b(){if(e)for(var d=e,f=0,h;kd){if(5E3<=++f){k=e;a.a.Qb(Error("'Too much recursion' after processing "+f+" task groups."));break}d=e}try{h()}catch(m){a.a.Qb(m)}}k=e=c.length=0}var c=[],e=0,g=1,k=0,n=(d=>{var f=U.createElement("div");(new MutationObserver(d)).observe(f,{attributes:!0});return()=>f.classList.toggle("foo")})(b);return{cc:d=> +f){var h=a.a.b.get(d,g);void 0===h&&f&&(h=[],a.a.b.set(d,g,h));return h}function c(d){var f=b(d,!1);if(f){f=f.slice(0);for(var h=0;h{if("function"!=typeof f)throw Error("Callback must be a function");b(d,!0).push(f)},qb:(d,f)=> +{var h=b(d,!1);h&&(a.a.Da(h,f),0==h.length&&a.a.b.set(d,g,void 0))},ia:d=>{a.m.H(()=>{k[d.nodeType]&&(c(d),n[d.nodeType]&&e(d.getElementsByTagName("*")))});return d},removeNode:d=>{a.ia(d);d.parentNode&&d.parentNode.removeChild(d)}}};a.ia=a.a.L.ia;a.removeNode=a.a.L.removeNode;a.l("utils.domNodeDisposal",a.a.L);a.l("utils.domNodeDisposal.addDisposeCallback",a.a.L.qa);(()=>{var b=[0,"",""],c=[1,"","
"],e=[3,"","
"],g=[1,""],k={thead:c,tbody:c,tfoot:c,tr:[2,"","
"],td:e,th:e,option:g,optgroup:g};a.a.Pa=(n,d)=>{d||(d=U);var f=a.a.tb(n).toLowerCase();d=d.createElement("div");f=(f=f.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&k[f[1]]||b;var h=f[0];for(d.innerHTML="
"+f[1]+n+f[2]+"
";h--;)d=d.lastChild;return[...d.lastChild.childNodes]};a.a.Fc=(n,d)=>{n=a.a.Pa(n,d);return n.length&&n[0].parentElement||a.a.lb(n)};a.a.ec=(n,d)=>{a.a.eb(n);d=a.a.g(d);if(null!==d&&void 0!== +d){"string"!=typeof d&&(d=d.toString());d=a.a.Pa(d,n.ownerDocument);for(var f=0;f{function b(){if(e)for(var d=e,f=0,h;kd){if(5E3<=++f){k=e;a.a.Qb(Error("'Too much recursion' after processing "+f+" task groups."));break}d=e}try{h()}catch(m){a.a.Qb(m)}}k=e=c.length=0}var c=[],e=0,g=1,k=0,n=(d=>{var f=U.createElement("div");(new MutationObserver(d)).observe(f,{attributes:!0});return()=>f.classList.toggle("foo")})(b);return{cc:d=> {e||n(b);c[e++]=d;return g++},cancel:d=>{d-=g-e;d>=k&&d{b.throttleEvaluation=c;var e=null;return a.i({read:b,write:g=>{clearTimeout(e);e=a.a.setTimeout(()=>b(g),c)}})},rateLimit:(b,c)=>{if("number"==typeof c)var e=c;else{e=c.timeout;var g=c.method}var k="function"==typeof g?g:"notifyWhenChangesStop"==g?I:F;b.kb(n=>k(n,e,c))},notify:(b,c)=>{b.equalityComparer="always"==c?null:G}};var ha={undefined:1,"boolean":1,number:1,string:1};a.l("extenders", -a.fb);class ia{constructor(b,c,e){this.X=b;this.yb=c;this.Kb=e;this.Ua=!1;this.fa=this.Xa=null;a.ba(this,"dispose",this.o);a.ba(this,"disposeWhenNodeIsRemoved",this.j)}o(){this.Ua||(this.fa&&a.a.L.qb(this.Xa,this.fa),this.Ua=!0,this.Kb(),this.X=this.yb=this.Kb=this.Xa=this.fa=null)}j(b){this.Xa=b;a.a.L.ra(b,this.fa=this.o.bind(this))}}a.V=function(){Object.setPrototypeOf(this,P);P.Na(this)};var P={Na:b=>{b.W={change:[]};b.Eb=1},subscribe:function(b,c,e){var g=this;e=e||"change";var k=new ia(g,c?b.bind(c): -b,()=>{a.a.Ea(g.W[e],k);g.Da&&g.Da(e)});g.sa&&g.sa(e);g.W[e]||(g.W[e]=[]);g.W[e].push(k);return k},notifySubscribers:function(b,c){c=c||"change";"change"===c&&this.Sa();if(this.xa(c)){c="change"===c&&this.ic||this.W[c].slice(0);try{a.m.Ib();for(var e=0,g;g=c[e++];)g.Ua||g.yb(b)}finally{a.m.end()}}},La:function(){return this.Eb},yc:function(b){return this.La()!==b},Sa:function(){++this.Eb},kb:function(b){var c=this,e=a.M(c),g,k,n,d,f;c.Ca||(c.Ca=c.notifySubscribers,c.notifySubscribers=function(m,r){r&& -"change"!==r?"beforeChange"===r?this.Bb(m):this.Ca(m,r):this.Cb(m)});var h=b(()=>{c.oa=!1;e&&d===c&&(d=c.zb?c.zb():c());var m=k||f&&c.Pa(n,d);f=k=g=!1;m&&c.Ca(n=d)});c.Cb=(m,r)=>{r&&c.oa||(f=!r);c.ic=c.W.change.slice(0);c.oa=g=!0;d=m;h()};c.Bb=m=>{g||(n=m,c.Ca(m,"beforeChange"))};c.Db=()=>{f=!0};c.kc=()=>{c.Pa(n,c.I(!0))&&(k=!0)}},xa:function(b){return this.W[b]&&this.W[b].length},Pa:function(b,c){return!this.equalityComparer||!this.equalityComparer(b,c)},toString:()=>"[object Object]",extend:function(b){var c= -this;b&&a.a.P(b,(e,g)=>{e=a.fb[e];"function"==typeof e&&(c=e(c,g)||c)});return c}};a.ba(P,"init",P.Na);a.ba(P,"subscribe",P.subscribe);a.ba(P,"extend",P.extend);Object.setPrototypeOf(P,Function.prototype);a.V.fn=P;a.Ac=b=>null!=b&&"function"==typeof b.subscribe&&"function"==typeof b.notifySubscribers;a.ta=a.m=(()=>{var b=[],c,e=0;return{Ib:g=>{b.push(c);c=g},end:()=>c=b.pop(),bc:g=>{if(c){if(!a.Ac(g))throw Error("Only subscribable things can act as dependencies");c.oc.call(c.pc,g,g.jc||(g.jc=++e))}}, -H:(g,k,n)=>{try{return b.push(c),c=void 0,g.apply(k,n||[])}finally{c=b.pop()}},Ka:()=>c&&c.i.Ka(),gb:()=>c&&c.i.gb(),jb:()=>c&&c.jb,i:()=>c&&c.i}})();const M=Symbol("_latestValue");a.ea=b=>{function c(){if(0"length"in c[M]?c[M].length:void 0,set:function(e){"length"in c[M]&&(this.Ba(),c[M].length=e,this.ma())}});a.V.fn.Na(c);Object.setPrototypeOf(c, -Q);return c};var Q={toJSON:function(){let b=this[M];return b&&b.toJSON?b.toJSON():b},equalityComparer:G,I:function(){return this[M]},ma:function(){this.notifySubscribers(this[M],"spectate");this.notifySubscribers(this[M])},Ba:function(){this.notifySubscribers(this[M],"beforeChange")}};Object.setPrototypeOf(Q,a.V.fn);var R=a.ea.fa="__ko_proto__";Q[R]=a.ea;a.M=b=>{if((b="function"==typeof b&&b[R])&&b!==Q[R]&&b!==a.i.fn[R])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance"); -return!!b};a.Cc=b=>"function"==typeof b&&(b[R]===Q[R]||b[R]===a.i.fn[R]&&b.Vb);a.l("observable",a.ea);a.l("isObservable",a.M);a.l("observable.fn",Q);a.ba(Q,"valueHasMutated",Q.ma);a.la=b=>{b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.ea(b);Object.setPrototypeOf(b,a.la.fn);return b.extend({trackArrayChanges:!0})};a.la.fn={remove:function(b){for(var c=this.I(),e=[],g="function"!=typeof b|| -a.M(b)?function(d){return d===b}:b,k=c.length;k--;){var n=c[k];if(g(n)){0===e.length&&this.Ba();if(c[k]!==n)throw Error("Array modified during remove; cannot remove item");e.push(n);c.splice(k,1)}}e.length&&this.ma();return e},removeAll:function(b){if(void 0===b){var c=this.I(),e=c.slice(0);this.Ba();c.splice(0,c.length);this.ma();return e}return b?this.remove(g=>b.includes(g)):[]}};Object.setPrototypeOf(a.la.fn,a.ea.fn);Object.getOwnPropertyNames(Array.prototype).forEach(b=>{"function"===typeof Array.prototype[b]&& -("pop push reverse shift sort splice unshift".split(" ").includes(b)?a.la.fn[b]=function(...c){var e=this.I();this.Ba();this.Lb(e,b,c);c=e[b](...c);this.ma();return c===e?this:c}:a.la.fn[b]=function(...c){return this()[b](...c)})});a.Xb=b=>a.M(b)&&"function"==typeof b.remove&&"function"==typeof b.push;a.l("observableArray",a.la);a.l("isObservableArray",a.Xb);a.fb.trackArrayChanges=(b,c)=>{function e(){function p(){if(f){var u=[].concat(b.I()||[]);if(b.xa("arrayChange")){if(!k||1++f,null,"spectate"),h=[].concat(b.I()||[]),k=null,n=b.subscribe(p))}b.Za={};c&&"object"==typeof c&&a.a.extend(b.Za,c);b.Za.sparse=!0;if(!b.Lb){var g=!1,k=null,n,d,f=0,h,m=b.sa,r=b.Da;b.sa=p=>{m&&m.call(b,p);"arrayChange"===p&&e()};b.Da=p=>{r&&r.call(b,p);"arrayChange"!==p||b.xa("arrayChange")||(n&&n.o(),d&&d.o(),d=n=null,g=!1,h=void 0)};b.Lb=(p,u,x)=>{function v(J,z,K){return l[l.length]={status:J, -value:z,index:K}}if(g&&!f){var l=[],q=p.length,t=x.length,w=0;switch(u){case "push":w=q;case "unshift":for(u=0;ux[0]?q+x[0]:x[0]),q);q=1===t?q:Math.min(u+(x[1]||0),q);t=u+t-2;w=Math.max(q,t);for(var A=[],y=[],E=2;u -b[e.pa]=e.X);return b},ib:function(b){if(!this[D].K)return!1;var c=this.gb();return c.includes(b)?!0:!!c.find(e=>e.ib&&e.ib(b))},Fb:function(b,c,e){if(this[D].pb&&c===this)throw Error("A 'pure' computed must not be called recursively");this[D].u[b]=e;e.pa=this[D].K++;e.qa=c.La()},ya:function(){var b,c=this[D].u;for(b in c)if(Object.prototype.hasOwnProperty.call(c,b)){var e=c[b];if(this.na&&e.X.oa||e.X.yc(e.qa))return!0}},Pc:function(){this.na&&!this[D].Oa&&this.na(!1)},ka:function(){var b=this[D]; -return b.Y||0b.T(!0),c)):b.na?b.na(!0):b.T(!0)},T:function(b){var c=this[D],e=c.ua,g=!1;if(!c.Oa&&!c.ca){if(c.j&&!a.a.cb(c.j)||e&&e()){if(!c.ub){this.o();return}}else c.ub=!1;c.Oa=!0;try{g=this.wc(b)}finally{c.Oa=!1}return g}},wc:function(b){var c=this[D],e=c.pb?void 0:!c.K; -var g={rc:this,Ia:c.u,ab:c.K};a.m.Ib({pc:g,oc:X,i:this,jb:e});c.u={};c.K=0;var k=this.vc(c,g);c.K?g=this.Pa(c.N,k):(this.o(),g=!0);g&&(c.v?this.Sa():this.notifySubscribers(c.N,"beforeChange"),c.N=k,this.notifySubscribers(c.N,"spectate"),!c.v&&b&&this.notifySubscribers(c.N),this.Db&&this.Db());e&&this.notifySubscribers(c.N,"awake");return g},vc:(b,c)=>{try{var e=b.ac;return b.Ja?e.call(b.Ja):e()}finally{a.m.end(),c.ab&&!b.v&&a.a.P(c.Ia,T),b.da=b.Y=!1}},I:function(b){var c=this[D];(c.Y&&(b||!c.K)|| -c.v&&this.ya())&&this.T();return c.N},kb:function(b){a.V.fn.kb.call(this,b);this.zb=function(){this[D].v||(this[D].da?this.T():this[D].Y=!1);return this[D].N};this.na=function(c){this.Bb(this[D].N);this[D].Y=!0;c&&(this[D].da=!0);this.Cb(this,!c)}},o:function(){var b=this[D];!b.v&&b.u&&a.a.P(b.u,(c,e)=>e.o&&e.o());b.j&&b.bb&&a.a.L.qb(b.j,b.bb);b.u=void 0;b.K=0;b.ca=!0;b.da=!1;b.Y=!1;b.v=!1;b.j=void 0;b.ua=void 0;b.ac=void 0;this.Vb||(b.Ja=void 0)}},ja={sa:function(b){var c=this,e=c[D];if(!e.ca&&e.v&& -"change"==b){e.v=!1;if(e.da||c.ya())e.u=null,e.K=0,c.T()&&c.Sa();else{var g=[];a.a.P(e.u,(k,n)=>g[n.pa]=k);g.forEach((k,n)=>{var d=e.u[k],f=c.fc(d.X);f.pa=n;f.qa=d.qa;e.u[k]=f});c.ya()&&c.T()&&c.Sa()}e.ca||c.notifySubscribers(e.N,"awake")}},Da:function(b){var c=this[D];c.ca||"change"!=b||this.xa("change")||(a.a.P(c.u,(e,g)=>{g.o&&(c.u[e]={X:g.X,pa:g.pa,qa:g.qa},g.o())}),c.v=!0,this.notifySubscribers(void 0,"asleep"))},La:function(){var b=this[D];b.v&&(b.da||this.ya())&&this.T();return a.V.fn.La.call(this)}}, -ka={sa:function(b){"change"!=b&&"beforeChange"!=b||this.I()}};Object.setPrototypeOf(V,a.V.fn);V[a.ea.fa]=a.i;a.l("computed",a.i);a.l("computed.fn",V);a.ba(V,"dispose",V.o);a.Ic=b=>{if("function"===typeof b)return a.i(b,void 0,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.i(b,void 0)};(()=>{a.A={R:b=>{switch(b.nodeName){case "OPTION":return!0===b.__ko__hasDomDataOptionValue__?a.a.b.get(b,a.c.options.ob):b.value;case "SELECT":return 0<=b.selectedIndex?a.A.R(b.options[b.selectedIndex]):void 0;default:return b.value}}, -Ta:(b,c,e)=>{switch(b.nodeName){case "OPTION":"string"===typeof c?(a.a.b.set(b,a.c.options.ob,void 0),delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.b.set(b,a.c.options.ob,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===typeof c?c:"");break;case "SELECT":if(""===c||null===c)c=void 0;for(var g=-1,k=0,n=b.options.length,d;k{function b(f){f=a.a.tb(f);123===f.charCodeAt(0)&&(f=f.slice(1,-1));f+="\n,";var h=[],m=f.match(g),r=[],p=0;if(1=p){h.push(l&&r.length?{key:l,value:r.join("")}:{unknown:l||r.join("")});var l=p=0;r=[];continue}}else if(58===v){if(!p&&!l&&1===r.length){l=r.pop();continue}}else if(47===v&&1m(v.key||v.unknown,v.value));p.length&&m("_ko_property_writers","{"+p.join(",")+" }");return r.join(",")},Dc:(f,h)=>{for(var m=0;m{if(f&&a.M(f))!a.Cc(f)||p&&f.I()===r||f(r);else if((f=h.get("_ko_property_writers"))&&f[m])f[m](r)}}})();(()=>{function b(d){return 8==d.nodeType&&g.test(d.nodeValue)}function c(d){return 8==d.nodeType&&k.test(d.nodeValue)}function e(d,f){for(var h=d,m=1,r=[];h=h.nextSibling;){if(c(h)&& -(a.a.b.set(h,n,!0),m--,0===m))return r;r.push(h);b(h)&&m++}if(!f)throw Error("Cannot find closing comment tag to match: "+d.nodeValue);return null}var g=/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=/^\s*\/ko\s*$/,n="__ko_matchedEndComment__";a.h={ga:{},childNodes:d=>b(d)?e(d):d.childNodes,va:d=>{if(b(d)){d=e(d);for(var f=0,h=d.length;f{if(b(d)){a.h.va(d);d=d.nextSibling;for(var h=0,m=f.length;h{if(b(d)){var h=d.nextSibling;d=d.parentNode}else h=d.firstChild;d.insertBefore(f,h)},Wb:(d,f,h)=>{h?(h=h.nextSibling,b(d)&&(d=d.parentNode),d.insertBefore(f,h)):a.h.prepend(d,f)},firstChild:d=>{if(b(d))return!d.nextSibling||c(d.nextSibling)?null:d.nextSibling;if(d.firstChild&&c(d.firstChild))throw Error("Found invalid end comment, as the first child of "+d);return d.firstChild},nextSibling:d=>{if(b(d)){var f=e(d,void 0);d=f?0(d=d.nodeValue.match(g))?d[1]:null}})();(function(){a.$=function(){this.nc={}};a.a.extend(a.$.prototype,{nodeHasBindings:b=>{switch(b.nodeType){case 1:return null!=b.getAttribute("data-bind");case 8:return a.h.xc(b);default:return!1}},getBindings:function(b,c){var e=this.getBindingsString(b,c);return e?this.parseBindingsString(e, -c,b):null},getBindingAccessors:function(b,c){var e=this.getBindingsString(b,c);return e?this.parseBindingsString(e,c,b,{valueAccessors:!0}):null},getBindingsString:b=>{switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.h.Nc(b)}return null},parseBindingsString:function(b,c,e,g){try{var k=this.nc,n=b+(g&&g.valueAccessors||""),d;if(!(d=k[n])){var f="with($context){with($data||{}){return{"+a.G.Hc(b,g)+"}}}";var h=new Function("$context","$element",f);d=k[n]=h}return d(c,e)}catch(m){throw m.message= -"Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+m.message,m;}}});a.$.instance=new a.$})();(()=>{function b(l){var q=(l=a.a.b.get(l,v))&&l.F;q&&(l.F=null,q.$b())}function c(l,q,t){this.node=l;this.Jb=q;this.Fa=[];this.B=!1;q.F||a.a.L.ra(l,b);t&&t.F&&(t.F.Fa.push(l),this.Va=t)}function e(l){return a.a.nb(a.m.H(l),(q,t)=>()=>l()[t])}function g(l,q,t){return"function"===typeof l?e(l.bind(null,q,t)):a.a.nb(l,w=>()=>w)}function k(l,q){return e(this.getBindings.bind(this,l,q))}function n(l, -q){var t=a.h.firstChild(q);if(t){var w,A=a.$.instance,y=A.preprocessNode;if(y){for(;w=t;)t=a.h.nextSibling(w),y.call(A,w);t=a.h.firstChild(q)}for(;w=t;)t=a.h.nextSibling(w),d(l,w)}a.f.notify(q,a.f.B)}function d(l,q){var t=l;if(1===q.nodeType||a.$.instance.nodeHasBindings(q))t=h(q,null,l).bindingContextForDescendants;t&&q.matches&&!q.matches("SCRIPT,TEXTAREA,TEMPLATE")&&n(t,q)}function f(l){var q=[],t={},w=[];a.a.P(l,function E(y){if(!t[y]){var J=a.getBindingHandler(y);J&&(J.after&&(w.push(y),J.after.forEach(z=> -{if(l[z]){if(w.includes(z))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+w.join(", "));E(z)}}),w.length--),q.push({key:y,Ub:J}));t[y]=!0}});return q}function h(l,q,t){var w=a.a.b.hb(l,v,{}),A=w.lc;if(!q){if(A)throw Error("You cannot apply bindings multiple times to the same element.");w.lc=!0}A||(w.context=t);w.mb||(w.mb={});if(q&&"function"!==typeof q)var y=q;else{var E=a.$.instance,J=E.getBindingAccessors||k,z=a.i(()=>{if(y=q?q(t,l):J.call(E,l,t)){if(t[r])t[r](); -if(t[u])t[u]()}return y},null,{j:l});y&&z.ka()||(z=null)}var K=t,N;if(y){var H=z?B=>()=>z()[B]():B=>y[B];function L(){return a.a.nb(z?z():y,B=>B())}L.get=B=>y[B]&&H(B)();L.has=B=>B in y;a.f.B in y&&a.f.subscribe(l,a.f.B,()=>{var B=y[a.f.B]();if(B){var O=a.h.childNodes(l);O.length&&B(O,a.Pb(O[0]))}});a.f.aa in y&&(K=a.f.sb(l,t),a.f.subscribe(l,a.f.aa,()=>{var B=y[a.f.aa]();B&&a.h.firstChild(l)&&B(l)}));f(y).forEach(B=>{var O=B.Ub.init,Y=B.Ub.update,S=B.key;if(8===l.nodeType&&!a.h.ga[S])throw Error("The binding '"+ -S+"' cannot be used with virtual elements");try{"function"==typeof O&&a.m.H(()=>{var W=O(l,H(S),L,K.$data,K);if(W&&W.controlsDescendantBindings){if(void 0!==N)throw Error("Multiple bindings ("+N+" and "+S+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");N=S}}),"function"==typeof Y&&a.i(()=>Y(l,H(S),L,K.$data,K),null,{j:l})}catch(W){throw W.message='Unable to process binding "'+S+": "+y[S]+'"\nMessage: '+W.message,W;}})}w= -void 0===N;return{shouldBindDescendants:w,bindingContextForDescendants:w&&K}}function m(l,q){return l&&l instanceof a.S?l:new a.S(l,void 0,void 0,q)}var r=Symbol("_subscribable"),p=Symbol("_ancestorBindingInfo"),u=Symbol("_dataDependency");a.c={};a.getBindingHandler=l=>a.c[l];var x={};a.S=function(l,q,t,w,A){function y(){var L=K?z():z,B=a.a.g(L);q?(a.a.extend(E,q),p in q&&(E[p]=q[p])):(E.$parents=[],E.$root=B,E.ko=a);E[r]=H;J?B=E.$data:(E.$rawData=L,E.$data=B);t&&(E[t]=B);w&&w(E,q,B);if(q&&q[r]&& -!a.ta.i().ib(q[r]))q[r]();N&&(E[u]=N);return E.$data}var E=this,J=l===x,z=J?void 0:l,K="function"==typeof z&&!a.M(z),N=A&&A.dataDependency;if(A&&A.exportDependencies)y();else{var H=a.Ic(y);H.I();H.ka()?H.equalityComparer=null:E[r]=void 0}};a.S.prototype.createChildContext=function(l,q,t,w){!w&&q&&"object"==typeof q&&(w=q,q=w.as,t=w.extend);if(q&&w&&w.noChildContext){var A="function"==typeof l&&!a.M(l);return new a.S(x,this,null,y=>{t&&t(y);y[q]=A?l():l},w)}return new a.S(l,this,q,(y,E)=>{y.$parentContext= -E;y.$parent=E.$data;y.$parents=(E.$parents||[]).slice(0);y.$parents.unshift(y.$parent);t&&t(y)},w)};a.S.prototype.extend=function(l,q){return new a.S(x,this,null,t=>a.a.extend(t,"function"==typeof l?l(t):l),q)};var v=a.a.b.U();c.prototype.$b=function(){this.Va&&this.Va.F&&this.Va.F.tc(this.node)};c.prototype.tc=function(l){a.a.Ea(this.Fa,l);!this.Fa.length&&this.B&&this.Ob()};c.prototype.Ob=function(){this.B=!0;this.Jb.F&&!this.Fa.length&&(this.Jb.F=null,a.a.L.qb(this.node,b),a.f.notify(this.node, -a.f.aa),this.$b())};a.f={B:"childrenComplete",aa:"descendantsComplete",subscribe:(l,q,t,w,A)=>{var y=a.a.b.hb(l,v,{});y.ja||(y.ja=new a.V);A&&A.notifyImmediately&&y.mb[q]&&a.m.H(t,w,[l]);return y.ja.subscribe(t,w,q)},notify:(l,q)=>{var t=a.a.b.get(l,v);if(t&&(t.mb[q]=!0,t.ja&&t.ja.notifySubscribers(l,q),q==a.f.B))if(t.F)t.F.Ob();else if(void 0===t.F&&t.ja&&t.ja.xa(a.f.aa))throw Error("descendantsComplete event not supported for bindings on this node");},sb:(l,q)=>{var t=a.a.b.hb(l,v,{});t.F||(t.F= -new c(l,t,q[p]));return q[p]==t?q:q.extend(w=>{w[p]=t})}};a.Lc=l=>(l=a.a.b.get(l,v))&&l.context;a.Wa=(l,q,t)=>h(l,q,m(t));a.Oc=(l,q,t)=>{t=m(t);return a.Wa(l,g(q,t,l),t)};a.Hb=(l,q)=>{1!==q.nodeType&&8!==q.nodeType||n(m(l),q)};a.Gb=function(l,q,t){if(2>arguments.length){if(q=U.body,!q)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");}else if(!q||1!==q.nodeType&&8!==q.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"); -d(m(l,t),q)};a.Pb=l=>(l=l&&[1,8].includes(l.nodeType)&&a.Lc(l))?l.$data:void 0;a.l("bindingHandlers",a.c);a.l("applyBindings",a.Gb);a.l("applyBindingAccessorsToNode",a.Wa);a.l("dataFor",a.Pb)})();(()=>{function b(d,f){return Object.prototype.hasOwnProperty.call(d,f)?d[f]:void 0}function c(d,f){var h=b(k,d);if(h)h.subscribe(f);else{h=k[d]=new a.V;h.subscribe(f);e(d,(r,p)=>{p=!(!p||!p.synchronous);n[d]={definition:r,Bc:p};delete k[d];m||p?h.notifySubscribers(r):a.vb.cc(()=>h.notifySubscribers(r))}); -var m=!0}}function e(d,f){g("getConfig",[d],h=>{h?g("loadComponent",[d,h],m=>f(m,h)):f(null,null)})}function g(d,f,h,m){m||(m=a.s.loaders.slice(0));var r=m.shift();if(r){var p=r[d];if(p){var u=!1;if(void 0!==p.apply(r,f.concat(function(x){u?h(null):null!==x?h(x):g(d,f,h,m)}))&&(u=!0,!r.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else g(d,f,h,m)}else h(null)}var k={},n={};a.s={get:(d,f)=>{var h=b(n, -d);h?h.Bc?a.m.H(()=>f(h.definition)):a.vb.cc(()=>f(h.definition)):c(d,f)},qc:d=>delete n[d],Ab:g};a.s.loaders=[];a.l("components",a.s)})();(()=>{function b(d,f,h,m){var r={},p=2;f=h.template;h=h.viewModel;f?a.s.Ab("loadTemplate",[d,f],u=>{r.template=u;0===--p&&m(r)}):0===--p&&m(r);h?a.s.Ab("loadViewModel",[d,h],u=>{r[n]=u;0===--p&&m(r)}):0===--p&&m(r)}function c(d,f,h){if("function"===typeof f)h(r=>new f(r));else if("function"===typeof f[n])h(f[n]);else if("instance"in f){var m=f.instance;h(()=>m)}else"viewModel"in -f?c(d,f.viewModel,h):d("Unknown viewModel value: "+f)}function e(d){if(d.matches("TEMPLATE")&&d.content instanceof DocumentFragment)return a.a.Ga(d.content.childNodes);throw"Template Source Element not a