From 664c1dca80f9eb1b6c0eaba0d7fd24c336526e6c Mon Sep 17 00:00:00 2001 From: RainLoop Team Date: Tue, 2 Sep 2014 15:34:17 +0400 Subject: [PATCH] Fix local storage (Closes #303) --- dev/Apps/RainLoopApp.js | 20 ++-- dev/Common/Consts.js | 2 +- dev/Settings/App/SettingsFolders.js | 4 +- dev/Storages/LocalStorage.js | 7 +- dev/Storages/LocalStorages/CookieDriver.js | 37 ++++--- .../LocalStorages/LocalStorageDriver.js | 34 ++++-- rainloop/v/0.0.0/static/css/app.css | 18 +-- rainloop/v/0.0.0/static/js/admin.js | 2 +- rainloop/v/0.0.0/static/js/admin.min.js | 2 +- rainloop/v/0.0.0/static/js/app.js | 104 +++++++++++------- rainloop/v/0.0.0/static/js/app.min.js | 20 ++-- 11 files changed, 147 insertions(+), 103 deletions(-) diff --git a/dev/Apps/RainLoopApp.js b/dev/Apps/RainLoopApp.js index ef2802f98..21e2f3ece 100644 --- a/dev/Apps/RainLoopApp.js +++ b/dev/Apps/RainLoopApp.js @@ -19,7 +19,7 @@ kn = require('App:Knoin'), - LocalStorage = require('Storage:LocalStorage'), + Local = require('Storage:LocalStorage'), Settings = require('Storage:Settings'), Data = require('Storage:RainLoop:Data'), Cache = require('Storage:RainLoop:Cache'), @@ -1185,7 +1185,7 @@ }); } - LocalStorage.set(Enums.ClientSideKeyName.FoldersLashHash, oData.Result.FoldersHash); + Local.set(Enums.ClientSideKeyName.FoldersLashHash, oData.Result.FoldersHash); } }; @@ -1195,8 +1195,8 @@ */ RainLoopApp.prototype.isFolderExpanded = function (sFullNameHash) { - var aExpandedList = LocalStorage.get(Enums.ClientSideKeyName.ExpandedFolders); - return _.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash); + var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders); + return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash); }; /** @@ -1205,8 +1205,8 @@ */ RainLoopApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded) { - var aExpandedList = LocalStorage.get(Enums.ClientSideKeyName.ExpandedFolders); - if (!_.isArray(aExpandedList)) + var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders); + if (!Utils.isArray(aExpandedList)) { aExpandedList = []; } @@ -1221,7 +1221,7 @@ aExpandedList = _.without(aExpandedList, sFullNameHash); } - LocalStorage.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList); + Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList); }; RainLoopApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName) @@ -1232,7 +1232,7 @@ oLeft = $(sLeft), oRight = $(sRight), - mLeftWidth = LocalStorage.get(sClientSideKeyName) || null, + mLeftWidth = Local.get(sClientSideKeyName) || null, fSetWidth = function (iWidth) { if (iWidth) @@ -1256,7 +1256,7 @@ else { oLeft.resizable('enable'); - var iWidth = Utils.pInt(LocalStorage.get(sClientSideKeyName)) || iMinWidth; + var iWidth = Utils.pInt(Local.get(sClientSideKeyName)) || iMinWidth; fSetWidth(iWidth > iMinWidth ? iWidth : iMinWidth); } }, @@ -1264,7 +1264,7 @@ fResizeFunction = function (oEvent, oObject) { if (oObject && oObject.size && oObject.size.width) { - LocalStorage.set(sClientSideKeyName, oObject.size.width); + Local.set(sClientSideKeyName, oObject.size.width); oRight.css({ 'left': '' + oObject.size.width + 'px' diff --git a/dev/Common/Consts.js b/dev/Common/Consts.js index 57006338d..c46d1ce8b 100644 --- a/dev/Common/Consts.js +++ b/dev/Common/Consts.js @@ -67,7 +67,7 @@ * @const * @type {string} */ - Consts.Values.ClientSideCookieIndexName = 'rlcsc'; + Consts.Values.ClientSideStorageIndexName = 'rlcsc'; /** * @const diff --git a/dev/Settings/App/SettingsFolders.js b/dev/Settings/App/SettingsFolders.js index 024d96e88..e47fa1caf 100644 --- a/dev/Settings/App/SettingsFolders.js +++ b/dev/Settings/App/SettingsFolders.js @@ -10,10 +10,10 @@ Utils = require('Utils'), Settings = require('Storage:Settings'), - LocalStorage = require('Storage:LocalStorage'), Data = require('Storage:RainLoop:Data'), Cache = require('Storage:RainLoop:Cache'), - Remote = require('Storage:RainLoop:Remote') + Remote = require('Storage:RainLoop:Remote'), + LocalStorage = require('Storage:LocalStorage') ; /** diff --git a/dev/Storages/LocalStorage.js b/dev/Storages/LocalStorage.js index 7f04994b3..a6b55584d 100644 --- a/dev/Storages/LocalStorage.js +++ b/dev/Storages/LocalStorage.js @@ -11,8 +11,8 @@ { var NextStorageDriver = require('_').find([ - require('Storage:LocalStorage:Cookie'), - require('Storage:LocalStorage:LocalStorage') + require('Storage:LocalStorage:LocalStorage'), + require('Storage:LocalStorage:Cookie') ], function (NextStorageDriver) { return NextStorageDriver && NextStorageDriver.supported(); }) @@ -26,6 +26,9 @@ } } + /** + * @type {LocalStorageDriver|CookieDriver|null} + */ LocalStorage.prototype.oDriver = null; /** diff --git a/dev/Storages/LocalStorages/CookieDriver.js b/dev/Storages/LocalStorages/CookieDriver.js index 6447e71f5..2d2dbc251 100644 --- a/dev/Storages/LocalStorages/CookieDriver.js +++ b/dev/Storages/LocalStorages/CookieDriver.js @@ -17,37 +17,46 @@ */ function CookieDriver() { - } + /** + * @static + * @return {boolean} + */ CookieDriver.supported = function () { - return true; + return !!(window.navigator && window.navigator.cookieEnabled); }; /** * @param {string} sKey * @param {*} mData - * @returns {boolean} + * @return {boolean} */ CookieDriver.prototype.set = function (sKey, mData) { var - mCokieValue = $.cookie(Consts.Values.ClientSideCookieIndexName), + mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), bResult = false, mResult = null ; try { - mResult = null === mCokieValue ? null : JSON.parse(mCokieValue); - if (!mResult) - { - mResult = {}; - } + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); + } + catch (oException) {} - mResult[sKey] = mData; - $.cookie(Consts.Values.ClientSideCookieIndexName, JSON.stringify(mResult), { + if (!mResult) + { + mResult = {}; + } + + mResult[sKey] = mData; + + try + { + $.cookie(Consts.Values.ClientSideStorageIndexName, JSON.stringify(mResult), { 'expires': 30 }); @@ -60,18 +69,18 @@ /** * @param {string} sKey - * @returns {*} + * @return {*} */ CookieDriver.prototype.get = function (sKey) { var - mCokieValue = $.cookie(Consts.Values.ClientSideCookieIndexName), + mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), mResult = null ; try { - mResult = null === mCokieValue ? null : JSON.parse(mCokieValue); + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); if (mResult && !Utils.isUnd(mResult[sKey])) { mResult = mResult[sKey]; diff --git a/dev/Storages/LocalStorages/LocalStorageDriver.js b/dev/Storages/LocalStorages/LocalStorageDriver.js index 56f864758..e72aaf6d1 100644 --- a/dev/Storages/LocalStorages/LocalStorageDriver.js +++ b/dev/Storages/LocalStorages/LocalStorageDriver.js @@ -19,6 +19,10 @@ { } + /** + * @static + * @return {boolean} + */ LocalStorageDriver.supported = function () { return !!window.localStorage; @@ -27,26 +31,32 @@ /** * @param {string} sKey * @param {*} mData - * @returns {boolean} + * @return {boolean} */ LocalStorageDriver.prototype.set = function (sKey, mData) { var - mCookieValue = window.localStorage[Consts.Values.ClientSideCookieIndexName] || null, + mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, bResult = false, mResult = null ; try { - mResult = null === mCookieValue ? null : JSON.parse(mCookieValue); - if (!mResult) - { - mResult = {}; - } + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); + } + catch (oException) {} - mResult[sKey] = mData; - window.localStorage[Consts.Values.ClientSideCookieIndexName] = JSON.stringify(mResult); + if (!mResult) + { + mResult = {}; + } + + mResult[sKey] = mData; + + try + { + window.localStorage[Consts.Values.ClientSideStorageIndexName] = JSON.stringify(mResult); bResult = true; } @@ -57,18 +67,18 @@ /** * @param {string} sKey - * @returns {*} + * @return {*} */ LocalStorageDriver.prototype.get = function (sKey) { var - mCokieValue = window.localStorage[Consts.Values.ClientSideCookieIndexName] || null, + mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, mResult = null ; try { - mResult = null === mCokieValue ? null : JSON.parse(mCokieValue); + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); if (mResult && !Utils.isUnd(mResult[sKey])) { mResult = mResult[sKey]; diff --git a/rainloop/v/0.0.0/static/css/app.css b/rainloop/v/0.0.0/static/css/app.css index 6bf1bc69f..5fee38042 100644 --- a/rainloop/v/0.0.0/static/css/app.css +++ b/rainloop/v/0.0.0/static/css/app.css @@ -637,7 +637,7 @@ filter: Alpha(Opacity=30); } - + /*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */ /* ============================================================================= @@ -1150,7 +1150,7 @@ table { border-spacing: 0; border-collapse: collapse; } - + @charset "UTF-8"; @font-face { @@ -1522,7 +1522,7 @@ table { .icon-resize-out:before { content: "\e06d"; } - + /** initial setup **/ .nano { /* @@ -1638,7 +1638,7 @@ table { .nano > .pane2.active > .slider2 { background-color: rgba(0, 0, 0, 0.4); } - + /* Magnific Popup CSS */ .mfp-bg { position: fixed; @@ -2094,7 +2094,7 @@ img.mfp-img { padding-top: 0; } - + /* overlay at start */ .mfp-fade.mfp-bg { @@ -2135,7 +2135,7 @@ img.mfp-img { -ms-transform: translateX(50px); transform: translateX(50px); } - + .simple-pace { pointer-events: none; @@ -2210,7 +2210,7 @@ img.mfp-img { transform: translate(-32px, 0); transform: translate(-32px, 0); } -} +} .inputosaurus-container { display: inline-block; margin: 0 5px 0 0; @@ -2275,7 +2275,7 @@ img.mfp-img { .inputosaurus-input-hidden { display: none; } - + .flag-wrapper { display: inline-block; width: 24px; @@ -2401,7 +2401,7 @@ img.mfp-img { .flag.flag-zh-cn, .flag.flag-zh-hk { background-position: -208px -22px; -} +} /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ .clearfix { *zoom: 1; diff --git a/rainloop/v/0.0.0/static/js/admin.js b/rainloop/v/0.0.0/static/js/admin.js index 35d9e9461..575328831 100644 --- a/rainloop/v/0.0.0/static/js/admin.js +++ b/rainloop/v/0.0.0/static/js/admin.js @@ -743,7 +743,7 @@ * @const * @type {string} */ - Consts.Values.ClientSideCookieIndexName = 'rlcsc'; + Consts.Values.ClientSideStorageIndexName = 'rlcsc'; /** * @const diff --git a/rainloop/v/0.0.0/static/js/admin.min.js b/rainloop/v/0.0.0/static/js/admin.min.js index f7429fe70..4c146cc67 100644 --- a/rainloop/v/0.0.0/static/js/admin.min.js +++ b/rainloop/v/0.0.0/static/js/admin.min.js @@ -1,5 +1,5 @@ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ -!function e(t,i,n){function o(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return o(i?i:e)},u,u.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var n=t("window"),o=t("_"),s=t("$"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),p=t("Knoin:AbstractBoot");o.extend(i.prototype,p.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,o=n.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=n.document.createElement("a"),i.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0"),i.now=(new n.Date).getTime(),i.momentTrigger=a.observable(!0),i.dropdownVisibility=a.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=a.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=a.observable(!0),i.useKeyboardShortcuts=a.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(n.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-11&&(n=n.replace(/[\/]+$/,""),n+="/p"+t),""!==i&&(n=n.replace(/[\/]+$/,""),n+="/"+encodeURI(i)),n},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,window:20}],10:[function(e,t){!function(e,t){"use strict";function i(){this.__boot=null,this.__data=null,this.__remote=null,this.oSettings=t("Storage:Settings"),this.oViewModelsHooks={},this.oSimpleHooks={}}var n=t("_"),o=t("Utils");i.prototype.__boot=null,i.prototype.__data=null,i.prototype.__remote=null,i.prototype.oViewModelsHooks={},i.prototype.oSimpleHooks={},i.prototype.addHook=function(e,t){o.isFunc(t)&&(o.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},i.prototype.runHook=function(e,t){o.isArray(this.oSimpleHooks[e])&&(t=t||[],n.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},i.prototype.remoteRequest=function(e,t,i,n,o,s){this.__remote&&this.__remote.defaultRequest(e,t,i,n,o,s)},i.prototype.settingsGet=function(e,t){var i=this.oSettings.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,_:19}],11:[function(e,t){!function(e,t){"use strict";var i={},n=t("window"),o=t("_"),s=t("$"),a=t("ko"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=s.trim,i.inArray=s.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?c.$win.resize():n.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var o=i.isNormal(e)&&""!==e?n.parseInt(e,10):t||0;return n.isNaN(o)?t||0:o},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0s;s++)o=i[s].split("="),t[n.decodeURIComponent(o[0])]=n.decodeURIComponent(o[1]);return t},i.mailToHelper=function(e,o){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var s={},a=null,l=e.replace(/\?.+$/,""),c=e.replace(/^[^\?]*\?/,""),u=t("Model:Email");return a=new u,a.parse(n.decodeURIComponent(l)),a&&a.email&&(s=i.simpleQueryParser(c),t("App:Knoin").showScreenPopup(o,[r.ComposeType.Empty,null,[a],i.isUnd(s.subject)?null:i.pString(s.subject),i.isUnd(s.body)?null:i.plainToHtml(i.pString(s.body))])),!0}return!1},i.rsaEncode=function(e,t,o,s){if(n.crypto&&n.crypto.getRandomValues&&n.RSAKey&&t&&o&&s){var a=new n.RSAKey;if(a.setPublic(s,o),e=a.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(n.crypto&&n.crypto.getRandomValues&&n.RSAKey),i.exportPath=function(e,t,o){for(var s=null,a=e.split("."),r=o||n;a.length&&(s=a.shift());)a.length||i.isUnd(t)?r=r[s]?r[s]:r[s]={}:r[s]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,n){return i.isUnd(e[t])?n:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var n="",o="",s=e,a=0,r=0;for(t=i.isUnd(t)?100:t;s.length>t;)o=s.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),n+=o.substring(0,a)+"\n",s=s.substring(a+1);return n+s},i.timeOutAction=function(){var e={};return function(t,o,s){i.isUnd(e[t])&&(e[t]=0),n.clearTimeout(e[t]),e[t]=n.setTimeout(o,s)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,o){e[t]||(e[t]=n.setTimeout(function(){i(),e[t]=0},o))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var o=!1,s=!1,a=n.Audio?new n.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(s=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||s?(e=a,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&n.Object&&n.Object.hasOwnProperty?n.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,n){var o="",s=i.isUnd(c.oI18N[e])?i.isUnd(n)?e:n:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(s=s.replace("%"+o+"%",t[o]));return s},i.i18nToNode=function(e){o.defer(function(){s(".i18n",e).each(function(){var e=s(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){n.rainloopI18N&&(c.oI18N=n.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),n.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return n.document.activeElement?(i.isUnd(n.document.activeElement.__inFocusCache)&&(n.document.activeElement.__inFocusCache=s(n.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!n.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(n.document&&n.document.activeElement&&n.document.activeElement.blur){var e=s(n.document.activeElement);e.is("input,textarea")&&n.document.activeElement.blur()}},i.removeSelection=function(){if(n&&n.getSelection){var e=n.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else n.document&&n.document.selection&&n.document.selection.empty&&n.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var n=!1,s=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=i.trim(e);n||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(s.push(e),n=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(s.join(":")))},i.roundNumber=function(e,t){return n.Math.round(e*n.Math.pow(10,t))/n.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){n.console&&n.console.log&&n.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR") +!function e(t,i,n){function o(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return o(i?i:e)},u,u.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var n=t("window"),o=t("_"),s=t("$"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),p=t("Knoin:AbstractBoot");o.extend(i.prototype,p.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,o=n.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=n.document.createElement("a"),i.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0"),i.now=(new n.Date).getTime(),i.momentTrigger=a.observable(!0),i.dropdownVisibility=a.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=a.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=a.observable(!0),i.useKeyboardShortcuts=a.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(n.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-11&&(n=n.replace(/[\/]+$/,""),n+="/p"+t),""!==i&&(n=n.replace(/[\/]+$/,""),n+="/"+encodeURI(i)),n},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,window:20}],10:[function(e,t){!function(e,t){"use strict";function i(){this.__boot=null,this.__data=null,this.__remote=null,this.oSettings=t("Storage:Settings"),this.oViewModelsHooks={},this.oSimpleHooks={}}var n=t("_"),o=t("Utils");i.prototype.__boot=null,i.prototype.__data=null,i.prototype.__remote=null,i.prototype.oViewModelsHooks={},i.prototype.oSimpleHooks={},i.prototype.addHook=function(e,t){o.isFunc(t)&&(o.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},i.prototype.runHook=function(e,t){o.isArray(this.oSimpleHooks[e])&&(t=t||[],n.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},i.prototype.remoteRequest=function(e,t,i,n,o,s){this.__remote&&this.__remote.defaultRequest(e,t,i,n,o,s)},i.prototype.settingsGet=function(e,t){var i=this.oSettings.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,_:19}],11:[function(e,t){!function(e,t){"use strict";var i={},n=t("window"),o=t("_"),s=t("$"),a=t("ko"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=s.trim,i.inArray=s.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?c.$win.resize():n.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var o=i.isNormal(e)&&""!==e?n.parseInt(e,10):t||0;return n.isNaN(o)?t||0:o},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0s;s++)o=i[s].split("="),t[n.decodeURIComponent(o[0])]=n.decodeURIComponent(o[1]);return t},i.mailToHelper=function(e,o){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var s={},a=null,l=e.replace(/\?.+$/,""),c=e.replace(/^[^\?]*\?/,""),u=t("Model:Email");return a=new u,a.parse(n.decodeURIComponent(l)),a&&a.email&&(s=i.simpleQueryParser(c),t("App:Knoin").showScreenPopup(o,[r.ComposeType.Empty,null,[a],i.isUnd(s.subject)?null:i.pString(s.subject),i.isUnd(s.body)?null:i.plainToHtml(i.pString(s.body))])),!0}return!1},i.rsaEncode=function(e,t,o,s){if(n.crypto&&n.crypto.getRandomValues&&n.RSAKey&&t&&o&&s){var a=new n.RSAKey;if(a.setPublic(s,o),e=a.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(n.crypto&&n.crypto.getRandomValues&&n.RSAKey),i.exportPath=function(e,t,o){for(var s=null,a=e.split("."),r=o||n;a.length&&(s=a.shift());)a.length||i.isUnd(t)?r=r[s]?r[s]:r[s]={}:r[s]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,n){return i.isUnd(e[t])?n:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var n="",o="",s=e,a=0,r=0;for(t=i.isUnd(t)?100:t;s.length>t;)o=s.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),n+=o.substring(0,a)+"\n",s=s.substring(a+1);return n+s},i.timeOutAction=function(){var e={};return function(t,o,s){i.isUnd(e[t])&&(e[t]=0),n.clearTimeout(e[t]),e[t]=n.setTimeout(o,s)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,o){e[t]||(e[t]=n.setTimeout(function(){i(),e[t]=0},o))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var o=!1,s=!1,a=n.Audio?new n.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(s=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||s?(e=a,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&n.Object&&n.Object.hasOwnProperty?n.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,n){var o="",s=i.isUnd(c.oI18N[e])?i.isUnd(n)?e:n:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(s=s.replace("%"+o+"%",t[o]));return s},i.i18nToNode=function(e){o.defer(function(){s(".i18n",e).each(function(){var e=s(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){n.rainloopI18N&&(c.oI18N=n.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),n.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return n.document.activeElement?(i.isUnd(n.document.activeElement.__inFocusCache)&&(n.document.activeElement.__inFocusCache=s(n.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!n.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(n.document&&n.document.activeElement&&n.document.activeElement.blur){var e=s(n.document.activeElement);e.is("input,textarea")&&n.document.activeElement.blur()}},i.removeSelection=function(){if(n&&n.getSelection){var e=n.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else n.document&&n.document.selection&&n.document.selection.empty&&n.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var n=!1,s=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=i.trim(e);n||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(s.push(e),n=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(s.join(":")))},i.roundNumber=function(e,t){return n.Math.round(e*n.Math.pow(10,t))/n.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){n.console&&n.console.log&&n.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR") },i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,n,s){e&&e[t]&&(s=i.pInt(s),0>=s?e[t].apply(e,i.isArray(n)?n:[]):o.delay(function(){e[t].apply(e,i.isArray(n)?n:[])},s))},i.killCtrlAandS=function(e){if(e=e||n.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===r.EventKeyCode.A&&(n.getSelection?n.getSelection().removeAllRanges():n.document.selection&&n.document.selection.clear&&n.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,n){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=a.observable(!0),n=i.isUnd(n)?!0:n,o.canExecute=a.computed(i.isFunc(n)?function(){return o.enabled()&&n.call(e)}:function(){return o.enabled()&&!!n}),o},i.initDataConstructorBySettings=function(e){e.editorDefaultType=a.observable(r.EditorDefaultType.Html),e.showImages=a.observable(!1),e.interfaceAnimation=a.observable(r.InterfaceAnimation.Full),e.contactsAutosave=a.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=a.observable(!1),e.allowLanguagesOnSettings=a.observable(!0),e.allowLanguagesOnLogin=a.observable(!0),e.useLocalProxyForExternalImages=a.observable(!1),e.desktopNotifications=a.observable(!1),e.useThreads=a.observable(!0),e.replySameFolder=a.observable(!0),e.useCheckboxesInList=a.observable(!0),e.layout=a.observable(r.Layout.SidePreview),e.usePreviewPane=a.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=a.computed(function(){e.desktopNotifications();var t=i.notificationClass(),o=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":o=r.DesktopNotifications.Allowed;break;case"denied":o=r.DesktopNotifications.Denied;break;case"default":o=r.DesktopNotifications.NotAllowed}else n.webkitNotifications&&n.webkitNotifications.checkPermission&&(o=n.webkitNotifications.checkPermission());return o}),e.useDesktopNotifications=a.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var n=i.notificationClass(),o=e.desktopNotificationsPermisions();n&&r.DesktopNotifications.Allowed===o?e.desktopNotifications(!0):n&&r.DesktopNotifications.NotAllowed===o?n.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated()}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=a.observable(""),e.languages=a.observableArray([]),e.mainLanguage=a.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(n,"hours")?o:t.format("L")===n.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:n.format("LT")}):t.clone().subtract("days",1).format("L")===n.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:n.format("LT")}):n.format(t.year()===n.year()?"D MMM.":"LL")},e)},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length/g,">").replace(/")},i.draggeblePlace=function(){return s('
 
').appendTo("#rl-hidden")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&s(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,o,r){var l=null,c=n.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",p=s("#"+t);n[u]=function(){if(c&&c.document.body&&p&&p[0]){var t=s(c.document.body);s("#rl-content",t).html(p.html()),s("html",c.document).addClass("external "+s("html").attr("class")),i.i18nToNode(t),e&&s("#rl-content",t)[0]&&a.applyBindings(e,s("#rl-content",t)[0]),n[u]=null,r(c)}},c.document.open(),c.document.write(''+i.encodeHtml(o)+'
'),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,n,s){return n=n||null,s=i.isUnd(s)?1e3:i.pInt(s),function(i,a,l,c,u){t.call(n,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(n,i,a,l,c,u),o.delay(function(){t.call(n,r.SaveSettingsStep.Idle)},s)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,n=0,o=0,a=0,r="",l=function(e){for(var t=100,i="",n="",o=e,s=0,a=0;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},u=function(e){return e=l(s.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,p),e="\n"+s.trim(e)+"\n"),e}return""},d=function(){return arguments&&1"):""},g=function(){return arguments&&1/g,">"):""},m=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,d).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,g).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,p).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,m).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)n=r.indexOf("__bq__start__",i+5),o=r.indexOf("__bq__end__",i+5),(-1===n||n>o)&&o>i?(r=r.substring(0,i)+u(r.substring(i+13,o))+r.substring(o+11),t=0):t=n>-1&&o>n?n-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var n=!1,o=!0,s=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l"===r.substr(0,1),s&&!n?(o=!0,n=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!s&&n?(n=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(s&&n?r.substr(1):r);n&&(n=!1,a.push("~~~/blockquote~~~")),c=a}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t?i.linkify(e):e},n.rainloop_Utils_htmlToPlain=i.htmlToPlain,n.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return s.fn&&s.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},i.resizeAndCrop=function(e,t,i){var o=new n.Image;o.onload=function(){var e=[0,0],o=n.document.createElement("canvas"),s=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],s.fillStyle="#fff",s.fillRect(0,0,t,t),s.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(o.toDataURL("image/jpeg"))},o.src=e},i.folderListOptionsBuilder=function(e,t,o,s,a,l,c,u,p,d){var g=null,m=!1,h=0,f=0,b="   ",S=[];for(p=i.isNormal(p)?p:0h;h++)S.push({id:s[h][0],name:s[h][1],system:!1,seporator:!1,disabled:!1});for(m=!0,h=0,f=e.length;f>h;h++)g=e[h],(c?c.call(null,g):!0)&&(m&&0h;h++)g=t[h],(g.subScribed()||!g.existen)&&(c?c.call(null,g):!0)&&(r.FolderType.User===g.type()||!p||01||c>0&&l>c){for(l>c?(u(c),o=c,s=c):((3>=l||l>=c-2)&&(a+=2),u(l),o=l,s=l);a>0;)if(o-=1,s+=1,o>0&&(u(o,!1),a--),c>=s)u(s,!0),a--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(n.Math.round((o-1)/2),!1,"..."),c-2===s?u(c-1,!0):c-2>s&&u(n.Math.round((c+s)/2),!0,"..."),o>1&&u(1,!1),c>s&&u(c,!0)}return r}},i.selectElement=function(e){var t,i;n.getSelection?(t=n.getSelection(),t.removeAllRanges(),i=n.document.createRange(),i.selectNodeContents(e),t.addRange(i)):n.document.selection&&(i=n.document.body.createTextRange(),i.moveToElementText(e),i.select())},i.detectDropdownVisibility=o.debounce(function(){c.dropdownVisibility(!!o.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){s(".checkAutocomplete").trigger("change")};(i.isUnd(e)?1:!e)?t():o.delay(t,100)},e.exports=i}(t,e)},{$:14,"App:Knoin":21,Consts:5,Enums:6,Globals:8,"Model:Email":26,_:19,ko:16,window:20}],12:[function(e,t){t.exports=crossroads},{}],13:[function(e,t){t.exports=hasher},{}],14:[function(e,t){t.exports=$},{}],15:[function(e,t){t.exports=key},{}],16:[function(e,t){!function(t,i){"use strict";var n=e("window"),o=e("_"),s=e("$");i.bindingHandlers.tooltip={init:function(t,n){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=s(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":''+a.i18n(i.utils.unwrapObservable(n()))+""}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var n=e("Globals"),o=s(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||n.dropdownVisibility()?"":''+i()()+""}}).click(function(){o.tooltip("hide")}),n.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=s(t),o=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),s(n.document).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var n=i.utils.unwrapObservable(t());""===n?s(e).data("tooltip3-data","").tooltip("hide"):s(e).data("tooltip3-data",n).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(s(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,n){if(i.utils.unwrapObservable(n())){var o=s(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),n()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){s(e).closest(".dropdown").on("click",".e-item",function(){s(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){s(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,n){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(n()):s(t).text(i.utils.unwrapObservable(n()))},update:function(t,n){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(n()):s(t).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.resizecrop={init:function(e){s(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),s(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(e,t,i,o){s(e).on("keypress",function(i){i&&13===n.parseInt(i.keyCode,10)&&(s(e).trigger("change"),t().call(o))})}},i.bindingHandlers.onEsc={init:function(e,t,i,o){s(e).on("keypress",function(i){i&&27===n.parseInt(i.keyCode,10)&&(s(e).trigger("change"),t().call(o))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&s(e).click()}},i.bindingHandlers.modal={init:function(t,n){var o=e("Globals"),a=e("Utils");s(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(n())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){n()(!1)})},update:function(e,t){s(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,n){var o=e("Utils");i.utils.unwrapObservable(n()),o.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){s(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){s(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){s(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var n=i.utils.unwrapObservable(t());s(e).css({height:n[1],"min-height":n[1]})},update:function(t,n){var o=e("Utils"),a=e("Globals"),r=i.utils.unwrapObservable(n()),l=o.pInt(r[1]),c=0,u=s(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),s(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){s(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,p=a(),d=p&&p.droppableSelector?p.droppableSelector:"",g={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};d&&(g.drag=function(e){s(d).each(function(){var t=null,i=null,o=s(this),a=o.offset(),r=a.top+o.height();n.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",n.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",n.setInterval(i,10)),i()))})},g.stop=function(){s(d).each(function(){n.clearInterval(s(this).data("timerScroll")),s(this).data("timerScroll",!1)})}),g.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},s(t).draggable(g).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,n){var o=e("Globals");if(!o.bMobileDevice){var a=i(),r=n(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),s(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||s(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var t=s(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var n=i.utils.unwrapObservable(t()),o=s(e);if("custom"===o.data("save-trigger-type"))switch(n.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(n.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,n){var a=e("Utils"),r=e("Model:Email"),l=s(t),c=i(),u=n(),p=u.autoCompleteSource||null,d=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:d,inputDelimiters:[",",";"],autoCompleteSource:p,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,n){var o=s(e),a=n(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,n){var a=e("Utils"),r=e("Model:ContactTag"),l=s(t),c=i(),u=n(),p=u.autoCompleteSource||null,d=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:d,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:p,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,n){var o=s(e),a=n(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,n,o){var a=s(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,n=s(e),o=t();i=o.enabled(),n.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),n.toggleClass("command-can-not-be-execute",!i)),n.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(n.is("input")||n.is("button"))&&n.prop("disabled",!i)}},i.extenders.trimmer=function(t){var n=e("Utils"),o=i.computed({read:t,write:function(e){t(n.trim(e.toString()))},owner:this});return o(t()),o},i.extenders.posInterer=function(t,n){var o=e("Utils"),s=i.computed({read:t,write:function(e){var i=o.pInt(e.toString(),n);0>=i&&(i=n),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return s(t()),s},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(n.clearTimeout(t.iTimeout),t.iTimeout=n.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var n=e("Utils");return this.hasFuncError=i.observable(!1),n.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:14,Globals:8,"Model:ContactTag":25,"Model:Email":26,Utils:11,_:19,window:20}],17:[function(e,t){t.exports=moment},{}],18:[function(e,t){t.exports=ssm},{}],19:[function(e,t){t.exports=_},{}],20:[function(e,t){t.exports=window},{}],21:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var n=t("_"),o=t("$"),s=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){o("#rl-loading").hide()},i.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},i.prototype.addSettingsViewModel=function(e,t,i,n,o){e.__rlSettingsData={Label:i,Template:t,Route:n,IsDefault:!!o},l.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),p=o("#rl-content #rl-"+r.toLowerCase()),d=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,a.viewModelNames=e.__names,p&&1===p.length?(d=o("
").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),d.appendTo(p),a.viewModelDom=d,e.__dom=d,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),n.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),n.delay(function(){t.viewModelDom.hide()},300))},a)),n.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,a,d])}),s.applyBindingAccessorsToNode(d[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[d]),a&&"Popups"===r&&a.registerPopupKeyDown(),n.each(e.__names,function(e){c.runHook("view-model-post-build",[e,a,d])})):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},i.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),n.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,o=null,s=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&n.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),n.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),n.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},i)),s=o.__cross?o.__cross():null,s&&s.parse(t)})))},i.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),n.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),n.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,n.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),o("#rl-content").css({visibility:"visible"}),n.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:14,Globals:8,Plugins:10,Utils:11,_:19,crossroads:12,hasher:13,ko:16}],22:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],23:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=s.isArray(t)?t:[]}var n=t("_"),o=t("crossroads"),s=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;s.isNonEmptyArray(e)&&(i=n.bind(this.onRoute||s.emptyFunction,this),t=o.create(),n.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=i}(t,e)},{Utils:11,_:19,crossroads:12}],24:[function(e,t){!function(e,t){"use strict"; function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=s.pString(e),this.sTemplate=s.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelVisibility=n.observable(!1),this.modalVisibility=n.observable(!1).extend({rateLimit:0}),this.viewModelName="",this.viewModelNames=[],this.viewModelDom=null}var n=t("ko"),o=t("Enums"),s=t("Utils"),a=t("Globals");i.prototype.bDisabeCloseOnEsc=!1,i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.sDefaultKeyScope=o.KeyState.None,i.prototype.sCurrentKeyScope=o.KeyState.None,i.prototype.viewModelName="",i.prototype.viewModelNames=[],i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;a.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return s.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!s.inFocus())return!1}return!0})},e.exports=i}(t,e)},{Enums:6,Globals:8,Utils:11,ko:16}],25:[function(e,t){!function(e,t){"use strict";function i(){this.idContactTag=0,this.name=n.observable(""),this.readOnly=!1}var n=t("ko"),o=t("Utils");i.prototype.parse=function(e){var t=!1;return e&&"Object/Tag"===e["@Object"]&&(this.idContact=o.pInt(e.IdContactTag),this.name(o.pString(e.Name)),this.readOnly=!!e.ReadOnly,t=!0),t},i.prototype.filterHelper=function(e){return-1!==this.name().toLowerCase().indexOf(e.toLowerCase())},i.prototype.toLine=function(e){return(o.isUnd(e)?1:!e)?this.name():o.encodeHtml(this.name())},e.exports=i}(t,e)},{Utils:11,ko:16}],26:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e||"",this.name=t||"",this.clearDuplicateName()}var n=t("Utils");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.name="",i.prototype.email="",i.prototype.clear=function(){this.email="",this.name=""},i.prototype.validate=function(){return""!==this.name||""!==this.email},i.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},i.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},i.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},i.prototype.parse=function(e){this.clear(),e=n.trim(e);var t=/(?:"([^"]+)")? ?,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=n.trim(e.Name),this.email=n.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var o="";return""!==this.email&&(t=n.isUnd(t)?!1:!!t,i=n.isUnd(i)?!1:!!i,e&&""!==this.name?o=t?'
")+'" target="_blank" tabindex="-1">'+n.encodeHtml(this.name)+"":i?n.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=n.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+n.encodeHtml(o)+""+n.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=n.encodeHtml(o))):t&&(o=''+n.encodeHtml(this.email)+""))),o},i.prototype.mailsoParse=function(e){if(e=n.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var n=e.length;return 0>t&&(t+=n),n="undefined"==typeof i?n:0>i?i+n:i+t,t>=e.length||0>t||t>n?!1:e.slice(t,n)},i=function(e,t,i,n){return 0>i&&(i+=e.length),n=void 0!==n?n:e.length,0>n&&(n=n+e.length-i),e.slice(0,i)+t.substr(0,n)+t.slice(n)+e.slice(i+n)},o="",s="",a="",r=!1,l=!1,c=!1,u=null,p=0,d=0,g=0;g0&&0===o.length&&(o=t(e,0,g)),l=!0,p=g);break;case">":l&&(d=g,s=t(e,p+1,d-p-1),e=i(e,"",p,d-p+1),d=0,g=0,p=0,l=!1);break;case"(":r||l||c||(c=!0,p=g);break;case")":c&&(d=g,a=t(e,p+1,d-p-1),e=i(e,"",p,d-p+1),d=0,g=0,p=0,c=!1);break;case"\\":g++}g++}return 0===s.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?s=u[0]:o=e),s.length>0&&0===o.length&&0===a.length&&(o=e.replace(s,"")),s=n.trim(s).replace(/^[<]+/,"").replace(/[>]+$/,""),o=n.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),a=n.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=s,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 0").addClass("rl-settings-view-model").hide(),d.appendTo(p),i.viewModelDom=d,i.__rlSettingsData=u.__rlSettingsData,u.__dom=d,u.__builded=!0,u.__vm=i,s.applyBindingAccessorsToNode(d[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[d])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&n.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),n.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){n.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!n.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:s.observable(!1),disabled:!!n.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=n.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:14,"App:Knoin":21,Globals:8,"Knoin:AbstractScreen":23,LinkBuilder:9,Utils:11,_:19,ko:16}],28:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"login",[t("View:Admin:Login")])}var n=t("_"),o=t("Knoin:AbstractScreen");n.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Knoin:AbstractScreen":23,"View:Admin:Login":46,_:19}],29:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,[t("View:Admin:SettingsMenu"),t("View:Admin:SettingsPane")])}var n=t("_"),o=t("Screen:AbstractSettings");n.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Screen:AbstractSettings":27,"View:Admin:SettingsMenu":47,"View:Admin:SettingsPane":48,_:19}],30:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings"),i=t("Storage:Admin:Data");this.version=n.observable(e.settingsGet("Version")),this.access=n.observable(!!e.settingsGet("CoreAccess")),this.errorDesc=n.observable(""),this.coreReal=i.coreReal,this.coreUpdatable=i.coreUpdatable,this.coreAccess=i.coreAccess,this.coreChecking=i.coreChecking,this.coreUpdating=i.coreUpdating,this.coreRemoteVersion=i.coreRemoteVersion,this.coreRemoteRelease=i.coreRemoteRelease,this.coreVersionCompare=i.coreVersionCompare,this.statusType=n.computed(function(){var e="",t=this.coreVersionCompare(),i=this.coreChecking(),n=this.coreUpdating(),o=this.coreReal();return i?e="checking":n?e="updating":o&&0===t?e="up-to-date":o&&-1===t?e="available":o||(e="error",this.errorDesc("Cannot access the repository at the moment.")),e},this)}var n=t("ko");i.prototype.onBuild=function(){this.access()&&t("App:Admin").reloadCoreData()},i.prototype.updateCoreData=function(){this.coreUpdating()||t("App:Admin").updateCoreData()},e.exports=i}(t,e)},{"App:Admin":3,"Storage:Admin:Data":43,"Storage:Settings":45,ko:16}],31:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Enums"),i=t("Storage:Settings");this.title=o.observable(i.settingsGet("Title")),this.title.trigger=o.observable(e.SaveSettingsStep.Idle),this.loadingDesc=o.observable(i.settingsGet("LoadingDescription")),this.loadingDesc.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginLogo=o.observable(i.settingsGet("LoginLogo")),this.loginLogo.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginDescription=o.observable(i.settingsGet("LoginDescription")),this.loginDescription.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginCss=o.observable(i.settingsGet("LoginCss")),this.loginCss.trigger=o.observable(e.SaveSettingsStep.Idle)}var n=t("_"),o=t("ko"),s=t("Utils");i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");n.delay(function(){var t=s.settingsSaveHelperSimpleFunction(e.title.trigger,e),n=s.settingsSaveHelperSimpleFunction(e.loadingDesc.trigger,e),o=s.settingsSaveHelperSimpleFunction(e.loginLogo.trigger,e),a=s.settingsSaveHelperSimpleFunction(e.loginDescription.trigger,e),r=s.settingsSaveHelperSimpleFunction(e.loginCss.trigger,e);e.title.subscribe(function(e){i.saveAdminConfig(t,{Title:s.trim(e)})}),e.loadingDesc.subscribe(function(e){i.saveAdminConfig(n,{LoadingDescription:s.trim(e)})}),e.loginLogo.subscribe(function(e){i.saveAdminConfig(o,{LoginLogo:s.trim(e)})}),e.loginDescription.subscribe(function(e){i.saveAdminConfig(a,{LoginDescription:s.trim(e)})}),e.loginCss.subscribe(function(e){i.saveAdminConfig(r,{LoginCss:s.trim(e)})})},50)},e.exports=i}(t,e)},{Enums:6,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16}],32:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Admin:Remote");this.defautOptionsAfterRender=a.defautOptionsAfterRender,this.enableContacts=o.observable(!!r.settingsGet("ContactsEnable")),this.contactsSharing=o.observable(!!r.settingsGet("ContactsSharing")),this.contactsSync=o.observable(!!r.settingsGet("ContactsSync"));var i=["sqlite","mysql","pgsql"],l=[],c=function(e){switch(e){case"sqlite":e="SQLite";break;case"mysql":e="MySQL";break;case"pgsql":e="PostgreSQL"}return e};r.settingsGet("SQLiteIsSupported")&&l.push("sqlite"),r.settingsGet("MySqlIsSupported")&&l.push("mysql"),r.settingsGet("PostgreSqlIsSupported")&&l.push("pgsql"),this.contactsSupported=0(new n.Date).getTime()-m),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,i,s,t)}),f&&0 iMinWidth ? iWidth : iMinWidth); } }, @@ -1545,7 +1545,7 @@ fResizeFunction = function (oEvent, oObject) { if (oObject && oObject.size && oObject.size.width) { - LocalStorage.set(sClientSideKeyName, oObject.size.width); + Local.set(sClientSideKeyName, oObject.size.width); oRight.css({ 'left': '' + oObject.size.width + 'px' @@ -2131,7 +2131,7 @@ * @const * @type {string} */ - Consts.Values.ClientSideCookieIndexName = 'rlcsc'; + Consts.Values.ClientSideStorageIndexName = 'rlcsc'; /** * @const @@ -11718,10 +11718,10 @@ module.exports = window; Utils = require('Utils'), Settings = require('Storage:Settings'), - LocalStorage = require('Storage:LocalStorage'), Data = require('Storage:RainLoop:Data'), Cache = require('Storage:RainLoop:Cache'), - Remote = require('Storage:RainLoop:Remote') + Remote = require('Storage:RainLoop:Remote'), + LocalStorage = require('Storage:LocalStorage') ; /** @@ -14735,8 +14735,8 @@ module.exports = window; { var NextStorageDriver = require('_').find([ - require('Storage:LocalStorage:Cookie'), - require('Storage:LocalStorage:LocalStorage') + require('Storage:LocalStorage:LocalStorage'), + require('Storage:LocalStorage:Cookie') ], function (NextStorageDriver) { return NextStorageDriver && NextStorageDriver.supported(); }) @@ -14750,6 +14750,9 @@ module.exports = window; } } + /** + * @type {LocalStorageDriver|CookieDriver|null} + */ LocalStorage.prototype.oDriver = null; /** @@ -14794,37 +14797,46 @@ module.exports = window; */ function CookieDriver() { - } + /** + * @static + * @return {boolean} + */ CookieDriver.supported = function () { - return true; + return !!(window.navigator && window.navigator.cookieEnabled); }; /** * @param {string} sKey * @param {*} mData - * @returns {boolean} + * @return {boolean} */ CookieDriver.prototype.set = function (sKey, mData) { var - mCokieValue = $.cookie(Consts.Values.ClientSideCookieIndexName), + mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), bResult = false, mResult = null ; try { - mResult = null === mCokieValue ? null : JSON.parse(mCokieValue); - if (!mResult) - { - mResult = {}; - } + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); + } + catch (oException) {} - mResult[sKey] = mData; - $.cookie(Consts.Values.ClientSideCookieIndexName, JSON.stringify(mResult), { + if (!mResult) + { + mResult = {}; + } + + mResult[sKey] = mData; + + try + { + $.cookie(Consts.Values.ClientSideStorageIndexName, JSON.stringify(mResult), { 'expires': 30 }); @@ -14837,18 +14849,18 @@ module.exports = window; /** * @param {string} sKey - * @returns {*} + * @return {*} */ CookieDriver.prototype.get = function (sKey) { var - mCokieValue = $.cookie(Consts.Values.ClientSideCookieIndexName), + mStorageValue = $.cookie(Consts.Values.ClientSideStorageIndexName), mResult = null ; try { - mResult = null === mCokieValue ? null : JSON.parse(mCokieValue); + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); if (mResult && !Utils.isUnd(mResult[sKey])) { mResult = mResult[sKey]; @@ -14888,6 +14900,10 @@ module.exports = window; { } + /** + * @static + * @return {boolean} + */ LocalStorageDriver.supported = function () { return !!window.localStorage; @@ -14896,26 +14912,32 @@ module.exports = window; /** * @param {string} sKey * @param {*} mData - * @returns {boolean} + * @return {boolean} */ LocalStorageDriver.prototype.set = function (sKey, mData) { var - mCookieValue = window.localStorage[Consts.Values.ClientSideCookieIndexName] || null, + mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, bResult = false, mResult = null ; try { - mResult = null === mCookieValue ? null : JSON.parse(mCookieValue); - if (!mResult) - { - mResult = {}; - } + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); + } + catch (oException) {} - mResult[sKey] = mData; - window.localStorage[Consts.Values.ClientSideCookieIndexName] = JSON.stringify(mResult); + if (!mResult) + { + mResult = {}; + } + + mResult[sKey] = mData; + + try + { + window.localStorage[Consts.Values.ClientSideStorageIndexName] = JSON.stringify(mResult); bResult = true; } @@ -14926,18 +14948,18 @@ module.exports = window; /** * @param {string} sKey - * @returns {*} + * @return {*} */ LocalStorageDriver.prototype.get = function (sKey) { var - mCokieValue = window.localStorage[Consts.Values.ClientSideCookieIndexName] || null, + mStorageValue = window.localStorage[Consts.Values.ClientSideStorageIndexName] || null, mResult = null ; try { - mResult = null === mCokieValue ? null : JSON.parse(mCokieValue); + mResult = null === mStorageValue ? null : JSON.parse(mStorageValue); if (mResult && !Utils.isUnd(mResult[sKey])) { mResult = mResult[sKey]; diff --git a/rainloop/v/0.0.0/static/js/app.min.js b/rainloop/v/0.0.0/static/js/app.min.js index a04da40dc..bd4d84ebb 100644 --- a/rainloop/v/0.0.0/static/js/app.min.js +++ b/rainloop/v/0.0.0/static/js/app.min.js @@ -1,11 +1,11 @@ /* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ -!function e(t,i,s){function o(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(n)return n(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return o(i?i:e)},u,u.exports,e,t,i,s)}return i[a].exports}for(var n="function"==typeof require&&require,a=0;a').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,s.location&&s.location.toString?s.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var s=t("window"),o=t("_"),n=t("$"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),d=t("Knoin:AbstractBoot");o.extend(i.prototype,d.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,o=s.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=s.document.createElement("a"),i.href=e,s.document.createEvent&&(t=s.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(s.open(e,"_self"),s.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0o;o++)g=e.Result["@Collection"][o],g&&"Object/Message"===g["@Object"]&&(m=h[o],m&&m.initByJson(g)||(m=C.newInstanceFromJson(g)),m&&(y.hasNewMessageAndRemoveFromCache(m.folderFullNameRaw,m.uid)&&5>=S&&(S++,m.newForAnimation(!0)),m.deleted(!1),t?y.initMessageFlagsFromCache(m):y.storeMessageFlagsToCache(m),m.lastInCollapsedThread(i&&-1s;s++)n=t[s],n&&(r=n.FullNameRaw,a=y.getFolderFromCacheList(r),a||(a=w.newInstanceFromJson(n),a&&(y.setFolderToCacheList(r,a),y.setFolderFullNameRaw(a.fullNameHash,r))),a&&(a.collapsed(!i.isFolderExpanded(a.fullNameHash)),n.Extended&&(n.Extended.Hash&&y.setFolderHash(a.fullNameRaw,n.Extended.Hash),d.isNormal(n.Extended.MessageCount)&&a.messageCountAll(n.Extended.MessageCount),d.isNormal(n.Extended.MessageUnseenCount)&&a.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&d.isArray(l["@Collection"])&&a.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(a)));return c},i.prototype.setFolders=function(e){var t=[],i=!1,s=function(e){return""===e||c.Values.UnuseOptionValue===e||null!==y.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])&&(d.isUnd(e.Result.Namespace)||(b.namespace=e.Result.Namespace),b.threading(!!f.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(b.namespace,e.Result["@Collection"]),b.folderList(t),e.Result.SystemFolders&&""==""+f.settingsGet("SentFolder")+f.settingsGet("DraftFolder")+f.settingsGet("SpamFolder")+f.settingsGet("TrashFolder")+f.settingsGet("ArchiveFolder")+f.settingsGet("NullFolder")&&(f.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),f.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),f.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),f.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),f.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),i=!0),b.sentFolder(s(f.settingsGet("SentFolder"))),b.draftFolder(s(f.settingsGet("DraftFolder"))),b.spamFolder(s(f.settingsGet("SpamFolder"))),b.trashFolder(s(f.settingsGet("TrashFolder"))),b.archiveFolder(s(f.settingsGet("ArchiveFolder"))),i&&S.saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),m.set(r.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},i.prototype.isFolderExpanded=function(e){var t=m.get(r.ClientSideKeyName.ExpandedFolders);return o.isArray(t)&&-1!==o.indexOf(t,e)},i.prototype.setExpandedFolder=function(e,t){var i=m.get(r.ClientSideKeyName.ExpandedFolders);o.isArray(i)||(i=[]),t?(i.push(e),i=o.uniq(i)):i=o.without(i,e),m.set(r.ClientSideKeyName.ExpandedFolders,i)},i.prototype.initLayoutResizer=function(e,t,i){var s=60,o=155,a=n(e),r=n(t),l=m.get(i)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(s);else{a.resizable("enable");var t=d.pInt(m.get(i))||o;c(t>o?t:o)}},p=function(e,t){t&&t.size&&t.size.width&&(m.set(i,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>o?l:o),a.resizable({helper:"ui-resizable-helper",minWidth:o,maxWidth:350,handles:"e",stop:p}),h.sub("left-panel.off",function(){u(!0)}),h.sub("left-panel.on",function(){u(!1)})},i.prototype.bootstartLoginScreen=function(){var e=d.pString(f.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),o.defer(function(){s.location.href=e})):(g.hideLoading(),g.startScreens([t("Screen:RainLoop:Login")]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"))},i.prototype.bootstart=function(){R.prototype.bootstart.call(this),b.populateDataOnStart();var e=this,i=f.settingsGet("JsHash"),a=d.pInt(f.settingsGet("ContactsSyncInterval")),c=f.settingsGet("AllowGoogleSocial"),m=f.settingsGet("AllowFacebookSocial"),y=f.settingsGet("AllowTwitterSocial");d.initOnStartOrLangChange(function(){n.extend(!0,n.magnificPopup.defaults,{tClose:d.i18n("MAGNIFIC_POPUP/CLOSE"),tLoading:d.i18n("MAGNIFIC_POPUP/LOADING"),gallery:{tPrev:d.i18n("MAGNIFIC_POPUP/GALLERY_PREV"),tNext:d.i18n("MAGNIFIC_POPUP/GALLERY_NEXT"),tCounter:d.i18n("MAGNIFIC_POPUP/GALLERY_COUNTER")},image:{tError:d.i18n("MAGNIFIC_POPUP/IMAGE_ERROR")},ajax:{tError:d.i18n("MAGNIFIC_POPUP/AJAX_ERROR")}})},this),s.SimplePace&&(s.SimplePace.set(70),s.SimplePace.sleep()),l.leftPanelDisabled.subscribe(function(e){h.pub("left-panel."+(e?"off":"on"))}),f.settingsGet("Auth")?(this.setTitle(d.i18n("TITLES/LOADING")),this.folders(o.bind(function(i){g.hideLoading(),i?(s.$LAB&&s.crypto&&s.crypto.getRandomValues&&f.capa(r.Capa.OpenPGP)?s.$LAB.script(s.openpgp?"":p.openPgpJs()).wait(function(){s.openpgp&&(b.openpgpKeyring=new s.openpgp.Keyring,b.capaOpenPGP(!0),h.pub("openpgp.init"),e.reloadOpenPgpKeys())}):b.capaOpenPGP(!1),g.startScreens([t("Screen:RainLoop:MailBox"),t("Screen:RainLoop:Settings"),t("Screen:RainLoop:About")]),(c||m||y)&&e.socialUsers(!0),h.sub("interval.2m",function(){e.folderInformation("INBOX")}),h.sub("interval.2m",function(){var t=b.currentFolderFullNameRaw();"INBOX"!==t&&e.folderInformation(t)}),h.sub("interval.3m",function(){e.folderInformationMultiply()}),h.sub("interval.5m",function(){e.quota()}),h.sub("interval.10m",function(){e.folders()}),a=a>=5?a:20,a=320>=a?a:320,s.setInterval(function(){e.contactsSync()},6e4*a+5e3),o.delay(function(){e.contactsSync()},5e3),o.delay(function(){e.folderInformationMultiply(!0)},500),u.runHook("rl-start-user-screens"),h.pub("rl.bootstart-user-screens"),f.settingsGet("AccountSignMe")&&s.navigator.registerProtocolHandler&&o.delay(function(){try{s.navigator.registerProtocolHandler("mailto",s.location.protocol+"//"+s.location.host+s.location.pathname+"?mailto&to=%s",""+(f.settingsGet("Title")||"RainLoop"))}catch(e){}f.settingsGet("MailToEmail")&&d.mailToHelper(f.settingsGet("MailToEmail"),t("View:Popup:Compose"))},500),l.bMobileDevice||o.defer(function(){e.initLayoutResizer("#rl-left","#rl-right",r.ClientSideKeyName.FolderListSize)})):e.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)},this))):(this.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)),c&&(s["rl_"+i+"_google_service"]=function(){b.googleActions(!0),e.socialUsers()}),m&&(s["rl_"+i+"_facebook_service"]=function(){b.facebookActions(!0),e.socialUsers()}),y&&(s["rl_"+i+"_twitter_service"]=function(){b.twitterActions(!0),e.socialUsers()}),h.sub("interval.1m",function(){l.momentTrigger(!l.momentTrigger())}),u.runHook("rl-start-screens"),h.pub("rl.bootstart-end")},e.exports=new i}(t,e)},{$:20,"App:Abstract":2,"App:Knoin":27,Consts:6,Enums:7,Events:8,Globals:9,LinkBuilder:11,"Model:Account":31,"Model:Email":37,"Model:Folder":40,"Model:Identity":41,"Model:Message":42,"Model:OpenPgpKey":43,Plugins:12,"Screen:RainLoop:About":44,"Screen:RainLoop:Login":46,"Screen:RainLoop:MailBox":47,"Screen:RainLoop:Settings":48,"Settings:RainLoop:Accounts":49,"Settings:RainLoop:ChangePassword":50,"Settings:RainLoop:Contacts":51,"Settings:RainLoop:Filters":52,"Settings:RainLoop:Folders":53,"Settings:RainLoop:General":54,"Settings:RainLoop:Identities":55,"Settings:RainLoop:Identity":56,"Settings:RainLoop:OpenPGP":57,"Settings:RainLoop:Security":58,"Settings:RainLoop:Social":59,"Settings:RainLoop:Themes":60,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:Compose":82,"View:Popup:FolderSystem":87,_:25,moment:23,window:26}],4:[function(e,t){!function(e,t){"use strict";e.exports=function(e){var i=t("window"),s=t("_"),o=t("$"),n=t("Globals"),a=t("Plugins"),r=t("Utils"),l=t("Enums"),c=t("Model:Email");n.__APP=e,e.setupSettings(),a.__boot=e,a.__remote=e.remote(),a.__data=e.data(),n.$html.addClass(n.bMobileDevice?"mobile":"no-mobile"),n.$win.keydown(r.killCtrlAandS).keyup(r.killCtrlAandS),n.$win.unload(function(){n.bUnload=!0}),n.$html.on("click.dropdown.data-api",function(){r.detectDropdownVisibility()}),i.rl=i.rl||{},i.rl.addHook=s.bind(a.addHook,a),i.rl.settingsGet=s.bind(a.mainSettingsGet,a),i.rl.remoteRequest=s.bind(a.remoteRequest,a),i.rl.pluginSettingsGet=s.bind(a.settingsGet,a),i.rl.createCommand=r.createCommand,i.rl.EmailModel=c,i.rl.Enums=l,i.__APP_BOOT=function(t){o(function(){i.rainloopTEMPLATES&&i.rainloopTEMPLATES[0]?(o("#rl-templates").html(i.rainloopTEMPLATES[0]),s.delay(function(){e.bootstart(),n.$html.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},10)):t(!1),i.__APP_BOOT=null})}}}(t,e)},{$:20,Enums:7,Globals:9,"Model:Email":37,Plugins:12,Utils:14,_:25,window:26}],5:[function(e,t){!function(e){"use strict";var t={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return t.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=t._utf8_encode(e);u>2,a=(3&i)<<4|s>>4,r=(15&s)<<2|o>>6,l=63&o,isNaN(s)?r=l=64:isNaN(o)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(l);return c},decode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,s=(15&a)<<4|r>>2,o=(3&r)<<6|l,c+=String.fromCharCode(i),64!==r&&(c+=String.fromCharCode(s)),64!==l&&(c+=String.fromCharCode(o));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0,s=e.length,o=0;s>i;i++)o=e.charCodeAt(i),128>o?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128));return t},_utf8_decode:function(e){for(var t="",i=0,s=0,o=0,n=0;is?(t+=String.fromCharCode(s),i++):s>191&&224>s?(o=e.charCodeAt(i+1),t+=String.fromCharCode((31&s)<<6|63&o),i+=2):(o=e.charCodeAt(i+1),n=e.charCodeAt(i+2),t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&n),i+=3);return t}};e.exports=t}(t,e)},{}],6:[function(e,t){!function(e){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideCookieIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(t)},{}],7:[function(e,t){!function(e){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={Prem:"PREM",TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",Filters:"FILTERS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t -}(t,e)},{}],8:[function(e,t){!function(e,t){"use strict";function i(){this.oSubs={}}var s=t("_"),o=t("Utils"),n=t("Plugins");i.prototype.oSubs={},i.prototype.sub=function(e,t,i){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i]),this},i.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||s.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new i}(t,e)},{Plugins:12,Utils:14,_:25}],9:[function(e,t){!function(e,t){"use strict";var i={},s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("key"),l=t("Enums");i.$win=n(s),i.$doc=n(s.document),i.$html=n("html"),i.$div=n("
"),i.now=(new s.Date).getTime(),i.momentTrigger=a.observable(!0),i.dropdownVisibility=a.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=a.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=a.observable(!0),i.useKeyboardShortcuts=a.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(s.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-1'+this.editor.getData()+"":this.editor.getData():""},i.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},i.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},i.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},i.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,i=a.settingsGet("Language"),o=!!a.settingsGet("AllowHtmlEditorSourceButton");o&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=s.CKEDITOR.ENTER_BR,t.shiftEnterMode=s.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[i]||"en",s.CKEDITOR.env&&(s.CKEDITOR.env.isCompatible=!0),e.editor=s.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(s.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};s.CKEDITOR?t():s.__initEditor=t}},i.prototype.focus=function(){this.editor&&this.editor.focus()},i.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},i.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},i.prototype.clear=function(e){this.setHtml("",e)},e.exports=i}(t,e)},{Globals:9,"Storage:Settings":69,_:25,window:26}],11:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings");this.sBase="#/",this.sServer="./?",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var s=t("window"),o=t("Utils");i.prototype.root=function(){return this.sBase},i.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},i.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},i.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},i.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},i.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},i.prototype.change=function(e){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+s.encodeURIComponent(e)+"/"},i.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},i.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+s.encodeURIComponent(e)+"/"},i.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},i.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},i.prototype.settings=function(e){var t=this.sBase+"settings";return o.isUnd(e)||""===e||(t+="/"+e),t},i.prototype.about=function(){return this.sBase+"about"},i.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},i.prototype.mailBox=function(e,t,i){t=o.isNormal(t)?o.pInt(t):1,i=o.pString(i);var s=this.sBase+"mailbox/";return""!==e&&(s+=encodeURI(e)),t>1&&(s=s.replace(/[\/]+$/,""),s+="/p"+t),""!==i&&(s=s.replace(/[\/]+$/,""),s+="/"+encodeURI(i)),s},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":69,Utils:14,window:26}],12:[function(e,t){!function(e,t){"use strict";function i(){this.__boot=null,this.__data=null,this.__remote=null,this.oSettings=t("Storage:Settings"),this.oViewModelsHooks={},this.oSimpleHooks={}}var s=t("_"),o=t("Utils");i.prototype.__boot=null,i.prototype.__data=null,i.prototype.__remote=null,i.prototype.oViewModelsHooks={},i.prototype.oSimpleHooks={},i.prototype.addHook=function(e,t){o.isFunc(t)&&(o.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},i.prototype.runHook=function(e,t){o.isArray(this.oSimpleHooks[e])&&(t=t||[],s.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},i.prototype.remoteRequest=function(e,t,i,s,o,n){this.__remote&&this.__remote.defaultRequest(e,t,i,s,o,n)},i.prototype.settingsGet=function(e,t){var i=this.oSettings.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=new i}(t,e)},{"Storage:Settings":69,Utils:14,_:25}],13:[function(e,t){!function(e,t){"use strict";function i(e,t,i,o,a,r){this.list=e,this.listChecked=n.computed(function(){return s.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=n.computed(function(){return 00&&-10)return s.newSelectPosition(i,a.shift),!1}})}},i.prototype.autoSelect=function(e){this.bAutoSelect=!!e},i.prototype.getItemUid=function(e){var t="",i=this.oCallbacks.onItemGetUid||null;return i&&e&&(t=i(e)),t.toString()},i.prototype.newSelectPosition=function(e,t,i){var o=0,n=10,a=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(r.EventKeyCode.Down===e||r.EventKeyCode.Up===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)s.each(u,function(t){if(!l)switch(e){case r.EventKeyCode.Up:p===t?l=!0:c=t;break;case r.EventKeyCode.Down:case r.EventKeyCode.Insert:a?(c=t,l=!0):p===t&&(a=!0)}});else if(r.EventKeyCode.Home===e||r.EventKeyCode.End===e)r.EventKeyCode.Home===e?c=u[0]:r.EventKeyCode.End===e&&(c=u[u.length-1]);else if(r.EventKeyCode.PageDown===e){for(;d>o;o++)if(p===u[o]){o+=n,o=o>d-1?d-1:o,c=u[o];break}}else if(r.EventKeyCode.PageUp===e)for(o=d;o>=0;o--)if(p===u[o]){o-=n,o=0>o?0:o,c=u[o];break}}else r.EventKeyCode.Down===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e||r.EventKeyCode.Home===e||r.EventKeyCode.PageUp===e?c=u[0]:(r.EventKeyCode.Up===e||r.EventKeyCode.End===e||r.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(r.EventKeyCode.Up===e||r.EventKeyCode.Down===e)&&p.checked(!p.checked()):(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!i||this.isListChecked()||r.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||r.EventKeyCode.Up!==e&&r.EventKeyCode.Down!==e?(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},i.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=o(this.sItemFocusedSelector,this.oContentScrollable),i=t.position(),s=this.oContentVisible.height(),n=t.outerHeight();return i&&(i.top<0||i.top+n>s)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-s+n+e),!0):!1},i.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},i.prototype.eventClickFunction=function(e,t){var i=this.getItemUid(e),s=0,o=0,n=null,a="",r=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==i&&""!==this.sLastUid&&i!==this.sLastUid)for(c=this.list(),u=e.checked(),s=0,o=c.length;o>s;s++)n=c[s],a=this.getItemUid(n),r=!1,(a===this.sLastUid||a===i)&&(r=!0),r&&(l=!l),(l||r)&&n.checked(u);this.sLastUid=""===i?"":i},i.prototype.actionClick=function(e,t){if(e){var i=!0,s=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(i=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(i=!1,""===this.sLastUid&&(this.sLastUid=s),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),i&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},i.prototype.on=function(e,t){this.oCallbacks[e]=t},e.exports=i}(t,e)},{$:20,Enums:7,Utils:14,_:25,key:21,ko:22}],14:[function(e,t){!function(e,t){"use strict";var i={},s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=n.trim,i.inArray=n.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?c.$win.resize():s.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var o=i.isNormal(e)&&""!==e?s.parseInt(e,10):t||0;return s.isNaN(o)?t||0:o},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0n;n++)o=i[n].split("="),t[s.decodeURIComponent(o[0])]=s.decodeURIComponent(o[1]);return t},i.mailToHelper=function(e,o){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var n={},a=null,l=e.replace(/\?.+$/,""),c=e.replace(/^[^\?]*\?/,""),u=t("Model:Email");return a=new u,a.parse(s.decodeURIComponent(l)),a&&a.email&&(n=i.simpleQueryParser(c),t("App:Knoin").showScreenPopup(o,[r.ComposeType.Empty,null,[a],i.isUnd(n.subject)?null:i.pString(n.subject),i.isUnd(n.body)?null:i.plainToHtml(i.pString(n.body))])),!0}return!1},i.rsaEncode=function(e,t,o,n){if(s.crypto&&s.crypto.getRandomValues&&s.RSAKey&&t&&o&&n){var a=new s.RSAKey;if(a.setPublic(n,o),e=a.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(s.crypto&&s.crypto.getRandomValues&&s.RSAKey),i.exportPath=function(e,t,o){for(var n=null,a=e.split("."),r=o||s;a.length&&(n=a.shift());)a.length||i.isUnd(t)?r=r[n]?r[n]:r[n]={}:r[n]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,s){return i.isUnd(e[t])?s:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var s="",o="",n=e,a=0,r=0;for(t=i.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),s+=o.substring(0,a)+"\n",n=n.substring(a+1);return s+n},i.timeOutAction=function(){var e={};return function(t,o,n){i.isUnd(e[t])&&(e[t]=0),s.clearTimeout(e[t]),e[t]=s.setTimeout(o,n)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,o){e[t]||(e[t]=s.setTimeout(function(){i(),e[t]=0},o))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var o=!1,n=!1,a=s.Audio?new s.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(n=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||n?(e=a,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&s.Object&&s.Object.hasOwnProperty?s.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,s){var o="",n=i.isUnd(c.oI18N[e])?i.isUnd(s)?e:s:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(n=n.replace("%"+o+"%",t[o]));return n},i.i18nToNode=function(e){o.defer(function(){n(".i18n",e).each(function(){var e=n(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){s.rainloopI18N&&(c.oI18N=s.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),s.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return s.document.activeElement?(i.isUnd(s.document.activeElement.__inFocusCache)&&(s.document.activeElement.__inFocusCache=n(s.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!s.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(s.document&&s.document.activeElement&&s.document.activeElement.blur){var e=n(s.document.activeElement);e.is("input,textarea")&&s.document.activeElement.blur()}},i.removeSelection=function(){if(s&&s.getSelection){var e=s.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else s.document&&s.document.selection&&s.document.selection.empty&&s.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var s=!1,n=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=i.trim(e);s||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(n.push(e),s=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(n.join(":")))},i.roundNumber=function(e,t){return s.Math.round(e*s.Math.pow(10,t))/s.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){s.console&&s.console.log&&s.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,s,n){e&&e[t]&&(n=i.pInt(n),0>=n?e[t].apply(e,i.isArray(s)?s:[]):o.delay(function(){e[t].apply(e,i.isArray(s)?s:[])},n))},i.killCtrlAandS=function(e){if(e=e||s.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===r.EventKeyCode.A&&(s.getSelection?s.getSelection().removeAllRanges():s.document.selection&&s.document.selection.clear&&s.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,s){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=a.observable(!0),s=i.isUnd(s)?!0:s,o.canExecute=a.computed(i.isFunc(s)?function(){return o.enabled()&&s.call(e)}:function(){return o.enabled()&&!!s}),o},i.initDataConstructorBySettings=function(e){e.editorDefaultType=a.observable(r.EditorDefaultType.Html),e.showImages=a.observable(!1),e.interfaceAnimation=a.observable(r.InterfaceAnimation.Full),e.contactsAutosave=a.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=a.observable(!1),e.allowLanguagesOnSettings=a.observable(!0),e.allowLanguagesOnLogin=a.observable(!0),e.useLocalProxyForExternalImages=a.observable(!1),e.desktopNotifications=a.observable(!1),e.useThreads=a.observable(!0),e.replySameFolder=a.observable(!0),e.useCheckboxesInList=a.observable(!0),e.layout=a.observable(r.Layout.SidePreview),e.usePreviewPane=a.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=a.computed(function(){e.desktopNotifications();var t=i.notificationClass(),o=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":o=r.DesktopNotifications.Allowed;break;case"denied":o=r.DesktopNotifications.Denied;break;case"default":o=r.DesktopNotifications.NotAllowed}else s.webkitNotifications&&s.webkitNotifications.checkPermission&&(o=s.webkitNotifications.checkPermission());return o}),e.useDesktopNotifications=a.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var s=i.notificationClass(),o=e.desktopNotificationsPermisions();s&&r.DesktopNotifications.Allowed===o?e.desktopNotifications(!0):s&&r.DesktopNotifications.NotAllowed===o?s.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated() -}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=a.observable(""),e.languages=a.observableArray([]),e.mainLanguage=a.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(s,"hours")?o:t.format("L")===s.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length/g,">").replace(/")},i.draggeblePlace=function(){return n('
 
').appendTo("#rl-hidden")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&n(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,o,r){var l=null,c=s.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",d=n("#"+t);s[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=n(c.document.body);n("#rl-content",t).html(d.html()),n("html",c.document).addClass("external "+n("html").attr("class")),i.i18nToNode(t),e&&n("#rl-content",t)[0]&&a.applyBindings(e,n("#rl-content",t)[0]),s[u]=null,r(c)}},c.document.open(),c.document.write(''+i.encodeHtml(o)+'
'),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,s,n){return s=s||null,n=i.isUnd(n)?1e3:i.pInt(n),function(i,a,l,c,u){t.call(s,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(s,i,a,l,c,u),o.delay(function(){t.call(s,r.SaveSettingsStep.Idle)},n)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,s=0,o=0,a=0,r="",l=function(e){for(var t=100,i="",s="",o=e,n=0,a=0;o.length>t;)s=o.substring(0,t),n=s.lastIndexOf(" "),a=s.lastIndexOf("\n"),-1!==a&&(n=a),-1===n&&(n=t),i+=s.substring(0,n)+"\n",o=o.substring(n+1);return i+o},u=function(e){return e=l(n.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+n.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},h=function(){return arguments&&1/g,">"):""},g=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,g).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)s=r.indexOf("__bq__start__",i+5),o=r.indexOf("__bq__end__",i+5),(-1===s||s>o)&&o>i?(r=r.substring(0,i)+u(r.substring(i+13,o))+r.substring(o+11),t=0):t=s>-1&&o>s?s-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var s=!1,o=!0,n=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l"===r.substr(0,1),n&&!s?(o=!0,s=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!n&&s?(s=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(n&&s?r.substr(1):r);s&&(s=!1,a.push("~~~/blockquote~~~")),c=a}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t?i.linkify(e):e},s.rainloop_Utils_htmlToPlain=i.htmlToPlain,s.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return n.fn&&n.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},i.resizeAndCrop=function(e,t,i){var o=new s.Image;o.onload=function(){var e=[0,0],o=s.document.createElement("canvas"),n=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],n.fillStyle="#fff",n.fillRect(0,0,t,t),n.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(o.toDataURL("image/jpeg"))},o.src=e},i.folderListOptionsBuilder=function(e,t,o,n,a,l,c,u,d,p){var h=null,g=!1,m=0,f=0,b="   ",y=[];for(d=i.isNormal(d)?d:0m;m++)y.push({id:n[m][0],name:n[m][1],system:!1,seporator:!1,disabled:!1});for(g=!0,m=0,f=e.length;f>m;m++)h=e[m],(c?c.call(null,h):!0)&&(g&&0m;m++)h=t[m],(h.subScribed()||!h.existen)&&(c?c.call(null,h):!0)&&(r.FolderType.User===h.type()||!d||01||c>0&&l>c){for(l>c?(u(c),o=c,n=c):((3>=l||l>=c-2)&&(a+=2),u(l),o=l,n=l);a>0;)if(o-=1,n+=1,o>0&&(u(o,!1),a--),c>=n)u(n,!0),a--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(s.Math.round((o-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(s.Math.round((c+n)/2),!0,"..."),o>1&&u(1,!1),c>n&&u(c,!0)}return r}},i.selectElement=function(e){var t,i;s.getSelection?(t=s.getSelection(),t.removeAllRanges(),i=s.document.createRange(),i.selectNodeContents(e),t.addRange(i)):s.document.selection&&(i=s.document.body.createTextRange(),i.moveToElementText(e),i.select())},i.detectDropdownVisibility=o.debounce(function(){c.dropdownVisibility(!!o.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){n(".checkAutocomplete").trigger("change")};(i.isUnd(e)?1:!e)?t():o.delay(t,100)},e.exports=i}(t,e)},{$:20,"App:Knoin":27,Consts:6,Enums:7,Globals:9,"Model:Email":37,_:25,ko:22,window:26}],15:[function(e,t){t.exports=JSON},{}],16:[function(e,t){t.exports=Jua},{}],17:[function(e,t){t.exports=crossroads},{}],18:[function(e,t){t.exports=hasher},{}],19:[function(e,t){t.exports=ifvisible},{}],20:[function(e,t){t.exports=$},{}],21:[function(e,t){t.exports=key},{}],22:[function(e,t){!function(t,i){"use strict";var s=e("window"),o=e("_"),n=e("$");i.bindingHandlers.tooltip={init:function(t,s){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=n(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":''+a.i18n(i.utils.unwrapObservable(s()))+""}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var s=e("Globals"),o=n(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||s.dropdownVisibility()?"":''+i()()+""}}).click(function(){o.tooltip("hide")}),s.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=n(t),o=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),n(s.document).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var s=i.utils.unwrapObservable(t());""===s?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",s).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(n(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,s){if(i.utils.unwrapObservable(s())){var o=n(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),s()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){n(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))},update:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))}},i.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&13===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.onEsc={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&27===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&n(e).click()}},i.bindingHandlers.modal={init:function(t,s){var o=e("Globals"),a=e("Utils");n(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(s())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){s()(!1)})},update:function(e,t){n(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,s){var o=e("Utils");i.utils.unwrapObservable(s()),o.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){n(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){n(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){n(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var s=i.utils.unwrapObservable(t());n(e).css({height:s[1],"min-height":s[1]})},update:function(t,s){var o=e("Utils"),a=e("Globals"),r=i.utils.unwrapObservable(s()),l=o.pInt(r[1]),c=0,u=n(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,d=a(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){n(p).each(function(){var t=null,i=null,o=n(this),a=o.offset(),r=a.top+o.height();s.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",s.setInterval(i,10)),i()))})},h.stop=function(){n(p).each(function(){s.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,s){var o=e("Globals");if(!o.bMobileDevice){var a=i(),r=s(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var s=i.utils.unwrapObservable(t()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(s.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:Email"),l=n(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:ContactTag"),l=n(t),c=i(),u=s(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,s,o){var a=n(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,s=n(e),o=t();i=o.enabled(),s.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),s.toggleClass("command-can-not-be-execute",!i)),s.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(s.is("input")||s.is("button"))&&s.prop("disabled",!i)}},i.extenders.trimmer=function(t){var s=e("Utils"),o=i.computed({read:t,write:function(e){t(s.trim(e.toString()))},owner:this});return o(t()),o},i.extenders.posInterer=function(t,s){var o=e("Utils"),n=i.computed({read:t,write:function(e){var i=o.pInt(e.toString(),s);0>=i&&(i=s),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return n(t()),n},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(s.clearTimeout(t.iTimeout),t.iTimeout=s.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var s=e("Utils");return this.hasFuncError=i.observable(!1),s.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:20,Globals:9,"Model:ContactTag":36,"Model:Email":37,Utils:14,_:25,window:26}],23:[function(e,t){t.exports=moment},{}],24:[function(e,t){t.exports=ssm},{}],25:[function(e,t){t.exports=_},{}],26:[function(e,t){t.exports=window},{}],27:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var s=t("_"),o=t("$"),n=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){o("#rl-loading").hide()},i.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},i.prototype.addSettingsViewModel=function(e,t,i,s,o){e.__rlSettingsData={Label:i,Template:t,Route:s,IsDefault:!!o},l.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),d=o("#rl-content #rl-"+r.toLowerCase()),p=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,a.viewModelNames=e.__names,d&&1===d.length?(p=o("
").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),p.appendTo(d),a.viewModelDom=p,e.__dom=p,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),s.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},a)),s.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,a,p])}),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[p]),a&&"Popups"===r&&a.registerPopupKeyDown(),s.each(e.__names,function(e){c.runHook("view-model-post-build",[e,a,p])})):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},i.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),s.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,o=null,n=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&s.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),s.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),s.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},i)),n=o.__cross?o.__cross():null,n&&n.parse(t)})))},i.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),s.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),s.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),o("#rl-content").css({visibility:"visible"}),s.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:20,Globals:9,Plugins:12,Utils:14,_:25,crossroads:17,hasher:18,ko:22}],28:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],29:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var s=t("_"),o=t("crossroads"),n=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;n.isNonEmptyArray(e)&&(i=s.bind(this.onRoute||n.emptyFunction,this),t=o.create(),s.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=i}(t,e)},{Utils:14,_:25,crossroads:17}],30:[function(e,t){!function(e,t){"use strict";function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=n.pString(e),this.sTemplate=n.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelVisibility=s.observable(!1),this.modalVisibility=s.observable(!1).extend({rateLimit:0}),this.viewModelName="",this.viewModelNames=[],this.viewModelDom=null}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Globals");i.prototype.bDisabeCloseOnEsc=!1,i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.sDefaultKeyScope=o.KeyState.None,i.prototype.sCurrentKeyScope=o.KeyState.None,i.prototype.viewModelName="",i.prototype.viewModelNames=[],i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;a.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return n.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!n.inFocus())return!1}return!0})},e.exports=i}(t,e)},{Enums:7,Globals:9,Utils:14,ko:22}],31:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e,this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(o.isUnd(t)?!0:!!t)}var s=t("ko"),o=t("Utils");i.prototype.email="",i.prototype.changeAccountLink=function(){return t("LinkBuilder").change(this.email)},e.exports=i}(t,e)},{LinkBuilder:11,Utils:14,ko:22}],32:[function(e,t){!function(e,t){"use strict";function i(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var s=t("window"),o=t("Globals"),n=t("Utils"),a=t("LinkBuilder");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.mimeType="",i.prototype.fileName="",i.prototype.estimatedSize=0,i.prototype.friendlySize="",i.prototype.isInline=!1,i.prototype.isLinked=!1,i.prototype.cid="",i.prototype.cidWithOutTags="",i.prototype.contentLocation="",i.prototype.download="",i.prototype.folder="",i.prototype.uid="",i.prototype.mimeIndex="",i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},i.prototype.isImage=function(){return-1,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=s.trim(e.Name),this.email=s.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var o="";return""!==this.email&&(t=s.isUnd(t)?!1:!!t,i=s.isUnd(i)?!1:!!i,e&&""!==this.name?o=t?'
")+'" target="_blank" tabindex="-1">'+s.encodeHtml(this.name)+"":i?s.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=s.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+s.encodeHtml(o)+""+s.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=s.encodeHtml(o))):t&&(o=''+s.encodeHtml(this.email)+""))),o},i.prototype.mailsoParse=function(e){if(e=s.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var s=e.length;return 0>t&&(t+=s),s="undefined"==typeof i?s:0>i?i+s:i+t,t>=e.length||0>t||t>s?!1:e.slice(t,s)},i=function(e,t,i,s){return 0>i&&(i+=e.length),s=void 0!==s?s:e.length,0>s&&(s=s+e.length-i),e.slice(0,i)+t.substr(0,s)+t.slice(s)+e.slice(i+s)},o="",n="",a="",r=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===o.length&&(o=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":r||l||c||(c=!0,d=h);break;case")":c&&(p=h,a=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===a.length&&(o=e.replace(n,"")),n=s.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=s.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),a=s.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 00){if(n.FolderType.Draft===i)return""+e;if(t>0&&n.FolderType.Trash!==i&&n.FolderType.Archive!==i&&n.FolderType.SentItems!==i)return""+t}return""},this),this.canBeDeleted=o.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=o.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.localName=o.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case n.FolderType.Inbox:t=r.i18n("FOLDER_LIST/INBOX_NAME");break;case n.FolderType.SentItems:t=r.i18n("FOLDER_LIST/SENT_NAME");break;case n.FolderType.Draft:t=r.i18n("FOLDER_LIST/DRAFTS_NAME");break;case n.FolderType.Spam:t=r.i18n("FOLDER_LIST/SPAM_NAME");break;case n.FolderType.Trash:t=r.i18n("FOLDER_LIST/TRASH_NAME");break;case n.FolderType.Archive:t=r.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=o.computed(function(){a.langChangeTrigger();var e="",t=this.type(),i=this.name();if(this.isSystemFolder())switch(t){case n.FolderType.Inbox:e="("+r.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case n.FolderType.SentItems:e="("+r.i18n("FOLDER_LIST/SENT_NAME")+")";break;case n.FolderType.Draft:e="("+r.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case n.FolderType.Spam:e="("+r.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case n.FolderType.Trash:e="("+r.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case n.FolderType.Archive:e="("+r.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+i+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=o.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=o.computed(function(){return 0"},i.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},i.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+o.quoteName(e)+'" <'+this.email()+">"},e.exports=i}(t,e)},{Utils:14,ko:22}],42:[function(e,t){!function(e,t){"use strict";function i(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=a.observable(""),this.subjectPrefix=a.observable(""),this.subjectSuffix=a.observable(""),this.size=a.observable(0),this.dateTimeStampInUTC=a.observable(0),this.priority=a.observable(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=a.observable(""),this.fromClearEmailString=a.observable(""),this.toEmailsString=a.observable(""),this.toClearEmailsString=a.observable(""),this.senderEmailsString=a.observable(""),this.senderClearEmailsString=a.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=a.observable(!1),this.deleted=a.observable(!1),this.unseen=a.observable(!1),this.flagged=a.observable(!1),this.answered=a.observable(!1),this.forwarded=a.observable(!1),this.isReadReceipt=a.observable(!1),this.focused=a.observable(!1),this.selected=a.observable(!1),this.checked=a.observable(!1),this.hasAttachments=a.observable(!1),this.attachmentsMainType=a.observable(""),this.moment=a.observable(r(r.unix(0))),this.attachmentIconClass=a.computed(function(){var e="";if(this.hasAttachments())switch(e="icon-attachment",this.attachmentsMainType()){case"image":e="icon-image";break;case"archive":e="icon-file-zip";break;case"doc":e="icon-file-text"}return e},this),this.fullFormatDateValue=a.computed(function(){return i.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=c.createMomentDate(this),this.momentShortDate=c.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=r().unix();this.moment(r.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=a.observable(!1),this.hasImages=a.observable(!1),this.attachments=a.observableArray([]),this.isPgpSigned=a.observable(!1),this.isPgpEncrypted=a.observable(!1),this.pgpSignedVerifyStatus=a.observable(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser=a.observable(""),this.priority=a.observable(l.MessagePriority.Normal),this.readReceipt=a.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=a.observable(0),this.threads=a.observableArray([]),this.threadsLen=a.observable(0),this.hasUnseenSubMessage=a.observable(!1),this.hasFlaggedSubMessage=a.observable(!1),this.lastInCollapsedThread=a.observable(!1),this.lastInCollapsedThreadLoading=a.observable(!1),this.threadsLenResult=a.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("moment"),l=t("Enums"),c=t("Utils"),u=t("Globals"),d=t("LinkBuilder"),p=t("Model:Email"),h=t("Model:Attachment");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.calculateFullFromatDateValue=function(e){return e>0?r.unix(e).format("LLL"):""},i.emailsToLine=function(e,t,i){var s=[],o=0,n=0;if(c.isNonEmptyArray(e))for(o=0,n=e.length;n>o;o++)s.push(e[o].toLine(t,i));return s.join(", ")},i.emailsToLineClear=function(e){var t=[],i=0,s=0;if(c.isNonEmptyArray(e))for(i=0,s=e.length;s>i;i++)e[i]&&e[i].email&&""!==e[i].name&&t.push(e[i].email);return t.join(", ")},i.initEmailsFromJson=function(e){var t=0,i=0,s=null,o=[];if(c.isNonEmptyArray(e))for(t=0,i=e.length;i>t;t++)s=p.newInstanceFromJson(e[t]),s&&o.push(s);return o},i.replyHelper=function(e,t,i){if(e&&0s;s++)c.isUnd(t[e[s].email])&&(t[e[s].email]=!0,i.push(e[s]))},i.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(l.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},i.prototype.friendlySize=function(){return c.friendlySize(this.size())},i.prototype.computeSenderEmail=function(){var e=t("Storage:RainLoop:Data"),i=e.sentFolder(),s=e.draftFolder();this.senderEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toClearEmailsString():this.fromClearEmailString())},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(c.pInt(e.Size)),this.from=i.initEmailsFromJson(e.From),this.to=i.initEmailsFromJson(e.To),this.cc=i.initEmailsFromJson(e.Cc),this.bcc=i.initEmailsFromJson(e.Bcc),this.replyTo=i.initEmailsFromJson(e.ReplyTo),this.deliveredTo=i.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),c.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(c.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(i.emailsToLine(this.from,!0)),this.fromClearEmailString(i.emailsToLineClear(this.from)),this.toEmailsString(i.emailsToLine(this.to,!0)),this.toClearEmailsString(i.emailsToLineClear(this.to)),this.parentUid(c.pInt(e.ParentThread)),this.threads(c.isArray(e.Threads)?e.Threads:[]),this.threadsLen(c.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},i.prototype.initUpdateByMessageJson=function(e){var i=t("Storage:RainLoop:Data"),s=!1,o=l.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(o=c.pInt(e.Priority),this.priority(-1t;t++)s=h.newInstanceFromJson(e["@Collection"][t]),s&&(""!==s.cidWithOutTags&&0+$/,""),t=o.find(i,function(t){return e===t.cidWithOutTags})),t||null},i.prototype.findAttachmentByContentLocation=function(e){var t=null,i=this.attachments();return c.isNonEmptyArray(i)&&(t=o.find(i,function(t){return e===t.contentLocation})),t||null},i.prototype.messageId=function(){return this.sMessageId},i.prototype.inReplyTo=function(){return this.sInReplyTo},i.prototype.references=function(){return this.sReferences},i.prototype.fromAsSingleEmail=function(){return c.isArray(this.from)&&this.from[0]?this.from[0].email:""},i.prototype.viewLink=function(){return d.messageViewLink(this.requestHash)},i.prototype.downloadLink=function(){return d.messageDownloadLink(this.requestHash)},i.prototype.replyEmails=function(e){var t=[],s=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,s,t),0===t.length&&i.replyHelper(this.from,s,t),t},i.prototype.replyAllEmails=function(e){var t=[],s=[],o=c.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,o,t),0===t.length&&i.replyHelper(this.from,o,t),i.replyHelper(this.to,o,t),i.replyHelper(this.cc,o,s),[t,s]},i.prototype.textBodyToString=function(){return this.body?this.body.html():""},i.prototype.attachmentsToStringLine=function(){var e=o.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&s&&!o&&i.attr("src",s)}),e&&s.setTimeout(function(){t.print()},100))})},i.prototype.printMessage=function(){this.viewPopupMessage(!0)},i.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},i.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(l.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},i.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=c.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",n("["+t+"]",this.body).each(function(){e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",n(this).attr(t)).removeAttr(t):n(this).attr("src",n(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",n("["+t+"]",this.body).each(function(){var e=c.trim(n(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+n(this).attr(t)).removeAttr(t)}),e&&(n("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:n(".RL-MailMessageView .messageView .messageItem .content")[0]}),u.$win.resize()),c.windowResize(500)}},i.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=c.isUnd(e)?!1:e;var t=this;n("[data-x-src-cid]",this.body).each(function(){var i=t.findAttachmentByCid(n(this).attr("data-x-src-cid"));i&&i.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",i.linkPreview()):n(this).attr("src",i.linkPreview()))}),n("[data-x-src-location]",this.body).each(function(){var i=t.findAttachmentByContentLocation(n(this).attr("data-x-src-location"));i||(i=t.findAttachmentByCid(n(this).attr("data-x-src-location"))),i&&i.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",i.linkPreview()):n(this).attr("src",i.linkPreview()))}),n("[data-x-style-cid]",this.body).each(function(){var e="",i="",s=t.findAttachmentByCid(n(this).attr("data-x-style-cid"));s&&s.linkPreview&&(i=n(this).attr("data-x-style-cid-name"),""!==i&&(e=c.trim(n(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+i+": url('"+s.linkPreview()+"')")))}),e&&!function(e,t){o.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(n("img.lazy",t.body),n(".RL-MailMessageView .messageView .messageItem .content")[0]),c.windowResize(500)}},i.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw); -var e=t("Storage:RainLoop:Data");e.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},i.prototype.storePgpVerifyDataToDom=function(){var e=t("Storage:RainLoop:Data");this.body&&e.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},i.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=c.pString(this.body.data("rl-plain-raw"));var e=t("Storage:RainLoop:Data");e.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},i.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],i=null,a=t("Storage:RainLoop:Data"),r=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",c=a.findPublicKeysByEmail(r),d=null,p=null,h="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{i=s.openpgp.cleartext.readArmored(this.plainRaw),i&&i.getText&&(this.pgpSignedVerifyStatus(c.length?l.SignedVerifyStatus.Unverified:l.SignedVerifyStatus.UnknownPublicKeys),e=i.verify(c),e&&0').text(h)).html(),u.$div.empty(),this.replacePlaneTextBody(h)))))}catch(g){}this.storePgpVerifyDataToDom()}},i.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var i=[],a=null,r=null,c=t("Storage:RainLoop:Data"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=c.findPublicKeysByEmail(d),h=c.findSelfPrivateKey(e),g=null,m=null,f="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(l.SignedVerifyStatus.UnknownPrivateKey);try{a=s.openpgp.message.readArmored(this.plainRaw),a&&h&&a.decrypt&&(this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Unverified),r=a.decrypt(h),r&&(i=r.verify(p),i&&0').text(f)).html(),u.$div.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},i.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},i.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},e.exports=i}(t,e)},{$:20,Enums:7,Globals:9,LinkBuilder:11,"Model:Attachment":32,"Model:Email":37,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,moment:23,window:26}],43:[function(e,t){!function(e,t){"use strict";function i(e,t,i,o,n,a,r){this.index=e,this.id=i,this.guid=t,this.user=o,this.email=n,this.armor=r,this.isPrivate=!!a,this.deleteAccess=s.observable(!1)}var s=t("ko");i.prototype.index=0,i.prototype.id="",i.prototype.guid="",i.prototype.user="",i.prototype.email="",i.prototype.armor="",i.prototype.isPrivate=!1,e.exports=i}(t,e)},{ko:22}],44:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"about",[t("View:RainLoop:About")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("RainLoop")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:About":70,_:25}],45:[function(e,t){!function(e,t){"use strict";function i(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var s=t("_"),o=t("$"),n=t("ko"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("App:Knoin"),u=t("Knoin:AbstractScreen");s.extend(i.prototype,u.prototype),i.prototype.onRoute=function(e){var t=this,i=null,u=null,d=null,p=null;u=s.find(a.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(s.find(a.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&s.find(a.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?i=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(i=new u,p=o("
").addClass("rl-settings-view-model").hide(),p.appendTo(d),i.viewModelDom=p,i.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=i,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[p])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&s.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),s.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){s.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!s.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!s.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=s.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:20,"App:Knoin":27,Globals:9,"Knoin:AbstractScreen":29,LinkBuilder:11,Utils:14,_:25,ko:22}],46:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"login",[t("View:RainLoop:Login")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:Login":72,_:25}],47:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"mailbox",[t("View:RainLoop:MailBoxSystemDropDown"),t("View:RainLoop:MailBoxFolderList"),t("View:RainLoop:MailBoxMessageList"),t("View:RainLoop:MailBoxMessageView")]),this.oLastRoute={}}var s=t("_"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Events"),l=t("Knoin:AbstractScreen"),c=t("Storage:Settings"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Cache"),p=t("Storage:RainLoop:Remote");s.extend(i.prototype,l.prototype),i.prototype.oLastRoute={},i.prototype.setNewTitle=function(){var e=u.accountEmail(),i=u.foldersInboxUnreadCount();t("App:RainLoop").setTitle((""===e?"":(i>0?"("+i+") ":" ")+e+" - ")+a.i18n("TITLES/MAILBOX"))},i.prototype.onShow=function(){this.setNewTitle(),n.keyScope(o.KeyState.MessageList)},i.prototype.onRoute=function(e,i,s,n){if(a.isUnd(n)?1:!n){var r=d.getFolderFullNameRaw(e),l=d.getFolderFromCacheList(r);l&&(u.currentFolder(l).messageListPage(i).messageListSearch(s),o.Layout.NoPreview===u.layout()&&u.message()&&u.message(null),t("App:RainLoop").reloadMessageList())}else o.Layout.NoPreview!==u.layout()||u.message()||t("App:RainLoop").historyBack()},i.prototype.onStart=function(){var e=function(){a.windowResize()};(c.capa(o.Capa.AdditionalAccounts)||c.capa(o.Capa.AdditionalIdentities))&&t("App:RainLoop").accountsAndIdentities(),s.delay(function(){"INBOX"!==u.currentFolderFullNameRaw()&&t("App:RainLoop").folderInformation("INBOX")},1e3),s.delay(function(){t("App:RainLoop").quota()},5e3),s.delay(function(){p.appDelayStart(a.emptyFunction)},35e3),n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===u.layout()),u.folderList.subscribe(e),u.messageList.subscribe(e),u.message.subscribe(e),u.layout.subscribe(function(e){n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===e)}),r.sub("mailbox.inbox-unread-count",function(e){u.foldersInboxUnreadCount(e)}),u.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},i.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},i=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:i}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},e.exports=i}(t,e)},{"App:RainLoop":3,Enums:7,Events:8,Globals:9,"Knoin:AbstractScreen":29,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:RainLoop:MailBoxFolderList":73,"View:RainLoop:MailBoxMessageList":74,"View:RainLoop:MailBoxMessageView":75,"View:RainLoop:MailBoxSystemDropDown":76,_:25}],48:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,[t("View:RainLoop:SettingsSystemDropDown"),t("View:RainLoop:SettingsMenu"),t("View:RainLoop:SettingsPane")]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){this.setSettingsTitle()})}var s=t("_"),o=t("Enums"),n=t("Utils"),a=t("Globals"),r=t("Screen:AbstractSettings");s.extend(i.prototype,r.prototype),i.prototype.onShow=function(){this.setSettingsTitle(),a.keyScope(o.KeyState.Settings)},i.prototype.setSettingsTitle=function(){t("App:RainLoop").setTitle(this.sSettingsTitle)},e.exports=i}(t,e)},{"App:RainLoop":3,Enums:7,Globals:9,"Screen:AbstractSettings":45,Utils:14,"View:RainLoop:SettingsMenu":94,"View:RainLoop:SettingsPane":95,"View:RainLoop:SettingsSystemDropDown":96,_:25}],49:[function(e,t){!function(e,t){"use strict";function i(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?r.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=t("window"),o=t("_"),n=t("ko"),a=t("Enums"),r=t("Utils"),l=t("LinkBuilder"),c=t("Storage:RainLoop:Data"),u=t("Storage:RainLoop:Remote");i.prototype.addNewAccount=function(){t("App:Knoin").showScreenPopup(t("View:Popup:AddAccount"))},i.prototype.deleteAccount=function(e){if(e&&e.deleteAccess()){this.accountForDeletion(null);var i=t("App:Knoin"),n=function(t){return e===t};e&&(this.accounts.remove(n),u.accountDelete(function(e,n){a.StorageResultType.Success===e&&n&&n.Result&&n.Reload?(i.routeOff(),i.setHash(l.root(),!0),i.routeOff(),o.defer(function(){s.location.reload()})):t("App:RainLoop").accountsAndIdentities()},e.email))}},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:AddAccount":77,_:25,ko:22,window:26}],50:[function(e,t){!function(e,t){"use strict";function i(){this.changeProcess=o.observable(!1),this.errorDescription=o.observable(""),this.passwordMismatch=o.observable(!1),this.passwordUpdateError=o.observable(!1),this.passwordUpdateSuccess=o.observable(!1),this.currentPassword=o.observable(""),this.currentPassword.error=o.observable(!1),this.newPassword=o.observable(""),this.newPassword2=o.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=a.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(a.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),r.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=s.bind(this.onChangePasswordResponse,this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},i.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(a.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},e.exports=i}(t,e)},{Enums:7,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],51:[function(e,t){!function(e,t){"use strict";function i(){this.contactsAutosave=a.contactsAutosave,this.allowContactsSync=a.allowContactsSync,this.enableContactsSync=a.enableContactsSync,this.contactsSyncUrl=a.contactsSyncUrl,this.contactsSyncUser=a.contactsSyncUser,this.contactsSyncPass=a.contactsSyncPass,this.saveTrigger=s.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var s=t("ko"),o=t("Utils"),n=t("Storage:RainLoop:Remote"),a=t("Storage:RainLoop:Data");i.prototype.onBuild=function(){a.contactsAutosave.subscribe(function(e){n.saveSettings(o.emptyFunction,{ContactsAutosave:e?"1":"0"})})},e.exports=i}(t,e)},{"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,ko:22}],52:[function(e,t){!function(e,t){"use strict";function i(){this.filters=s.observableArray([]),this.filters.loading=s.observable(!1),this.filters.subscribe(function(){o.windowResize()})}var s=t("ko"),o=t("Utils");i.prototype.deleteFilter=function(e){this.filters.remove(e)},i.prototype.addFilter=function(){var e=t("Model:Filter");t("App:Knoin").showScreenPopup(t("View:Popup:Filter"),[new e])},e.exports=i}(t,e)},{"App:Knoin":27,"Model:Filter":39,Utils:14,"View:Popup:Filter":84,ko:22}],53:[function(e,t){!function(e,t){"use strict";function i(){this.foldersListError=l.foldersListError,this.folderList=l.folderList,this.processText=s.computed(function(){var e=l.foldersLoading(),t=l.foldersCreating(),i=l.foldersDeleting(),s=l.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):i?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=s.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=s.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:Settings"),r=t("Storage:LocalStorage"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Remote");i.prototype.folderEditOnEnter=function(e){var i=e?n.trim(e.nameForEdit()):"";""!==i&&e.name()!==i&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.foldersRenaming(!0),u.folderRename(function(e,i){l.foldersRenaming(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw,i),c.removeFolderFromCacheList(e.fullNameRaw),e.name(i)),e.edited(!1)},i.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},i.prototype.onShow=function(){l.foldersListError("")},i.prototype.createFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.systemFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderSystem"))},i.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var i=function(t){return e===t?!0:(t.subFolders.remove(i),!1)};e&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.folderList.remove(i),l.foldersDeleting(!0),u.folderDelete(function(e,i){l.foldersDeleting(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw),c.removeFolderFromCacheList(e.fullNameRaw))}else 0"},i.prototype.addNewIdentity=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"))},i.prototype.editIdentity=function(e){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"),[e])},i.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var i=function(t){return e===t};e&&(this.identities.remove(i),c.identityDelete(function(){t("App:RainLoop").accountsAndIdentities()},e.id))}},i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},i.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=o.dataFor(this);e&&t.editIdentity(e)}),s.delay(function(){var e=a.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),i=a.settingsSaveHelperSimpleFunction(t.replyTrigger,t),s=a.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),o=a.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);l.defaultIdentityID.subscribe(function(e){c.saveSettings(o,{DefaultIdentityID:e})}),l.displayName.subscribe(function(t){c.saveSettings(e,{DisplayName:t})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Identity":88,_:25,ko:22}],56:[function(e,t){!function(e,t){"use strict";function i(){this.editor=null,this.displayName=l.displayName,this.signature=l.signature,this.signatureToAll=l.signatureToAll,this.replyTo=l.replyTo,this.signatureDom=o.observable(null),this.displayNameTrigger=o.observable(n.SaveSettingsStep.Idle),this.replyTrigger=o.observable(n.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(n.SaveSettingsStep.Idle)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("HtmlEditor"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Remote");i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},i.prototype.onBuild=function(){var e=this;s.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),i=a.settingsSaveHelperSimpleFunction(e.replyTrigger,e),s=a.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);l.displayName.subscribe(function(e){c.saveSettings(t,{DisplayName:e})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],57:[function(e,t){!function(e,t){"use strict";function i(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=t("ko"),o=t("App:Knoin"),n=t("Storage:RainLoop:Data");i.prototype.addOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:AddOpenPgpKey"))},i.prototype.generateOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:NewOpenPgpKey"))},i.prototype.viewOpenPgpKey=function(e){e&&o.showScreenPopup(t("View:Popup:ViewOpenPgpKey"),[e])},i.prototype.deleteOpenPgpKey=function(e){e&&e.deleteAccess()&&(this.openPgpKeyForDeletion(null),e&&n.openpgpKeyring&&(this.openpgpkeys.remove(function(t){return e===t}),n.openpgpKeyring[e.isPrivate?"privateKeys":"publicKeys"].removeForId(e.guid),n.openpgpKeyring.store(),t("App:RainLoop").reloadOpenPgpKeys()))},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Storage:RainLoop:Data":64,"View:Popup:AddOpenPgpKey":78,"View:Popup:NewOpenPgpKey":91,"View:Popup:ViewOpenPgpKey":93,ko:22}],58:[function(e,t){!function(e,t){"use strict";function i(){this.processing=s.observable(!1),this.clearing=s.observable(!1),this.secreting=s.observable(!1),this.viewUser=s.observable(""),this.viewEnable=s.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=s.observable(!1),this.viewSecret=s.observable(""),this.viewBackupCodes=s.observable(""),this.viewUrl=s.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=s.computed(function(){return n.langChangeTrigger(),a.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var s=t("ko"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.showSecret=function(){this.secreting(!0),r.showTwoFactorSecret(this.onSecretResult)},i.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.createTwoFactor=function(){this.processing(!0),r.createTwoFactor(this.onResult)},i.prototype.enableTwoFactor=function(){this.processing(!0),r.enableTwoFactor(this.onResult,this.viewEnable())},i.prototype.testTwoFactor=function(){t("App:Knoin").showScreenPopup(t("View:Popup:TwoFactorTest"))},i.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),r.clearTwoFactor(this.onResult)},i.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(a.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(a.pString(t.Result.Secret)),this.viewBackupCodes(a.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(a.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var i=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&r.enableTwoFactor(function(e,t){o.StorageResultType.Success===e&&t&&t.Result||(i.viewEnable.subs=!1,i.viewEnable(!1),i.viewEnable.subs=!0)},e)},this)}},i.prototype.onSecretResult=function(e,t){this.secreting(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(a.pString(t.Result.Secret)),this.viewUrl(a.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},i.prototype.onBuild=function(){this.processing(!0),r.getTwoFactor(this.onResult)},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,Globals:9,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:TwoFactorTest":92,ko:22}],59:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Utils"),i=t("Storage:RainLoop:Data");this.googleEnable=i.googleEnable,this.googleActions=i.googleActions,this.googleLoggined=i.googleLoggined,this.googleUserName=i.googleUserName,this.facebookEnable=i.facebookEnable,this.facebookActions=i.facebookActions,this.facebookLoggined=i.facebookLoggined,this.facebookUserName=i.facebookUserName,this.twitterEnable=i.twitterEnable,this.twitterActions=i.twitterActions,this.twitterLoggined=i.twitterLoggined,this.twitterUserName=i.twitterUserName,this.connectGoogle=e.createCommand(this,function(){this.googleLoggined()||t("App:RainLoop").googleConnect() -},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=e.createCommand(this,function(){t("App:RainLoop").googleDisconnect()}),this.connectFacebook=e.createCommand(this,function(){this.facebookLoggined()||t("App:RainLoop").facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=e.createCommand(this,function(){t("App:RainLoop").facebookDisconnect()}),this.connectTwitter=e.createCommand(this,function(){this.twitterLoggined()||t("App:RainLoop").twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=e.createCommand(this,function(){t("App:RainLoop").twitterDisconnect()})}e.exports=i}(t,e)},{"App:RainLoop":3,"Storage:RainLoop:Data":64,Utils:14}],60:[function(e,t){!function(e,t){"use strict";function i(){var e=this;this.mainTheme=u.mainTheme,this.themesObjects=a.observableArray([]),this.themeTrigger=a.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,u.theme.subscribe(function(t){o.each(this.themesObjects(),function(e){e.selected(t===e.name)});var i=n("#rlThemeLink"),a=n("#rlThemeStyle"),c=i.attr("href");c||(c=a.attr("data-href")),c&&(c=c.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),c=c.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==c.substring(c.length-5,c.length)&&(c+="Json/"),s.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=n.ajax({url:c,dataType:"json"}).done(function(t){t&&l.isArray(t)&&2===t.length&&(!i||!i[0]||a&&a[0]||(a=n(''),i.after(a),i.remove()),a&&a[0]&&(a.attr("data-href",c).attr("data-theme",t[0]),a&&a[0]&&a[0].styleSheet&&!l.isUnd(a[0].styleSheet.cssText)?a[0].styleSheet.cssText=t[1]:a.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=s.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),d.saveSettings(null,{Theme:t})},this)}var s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("Enums"),l=t("Utils"),c=t("LinkBuilder"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Remote");i.prototype.onBuild=function(){var e=u.theme();this.themesObjects(o.map(u.themes(),function(t){return{name:t,nameDisplay:l.convertThemeName(t),selected:a.observable(t===e),themePreviewSrc:c.themePreviewLink(t)}}))},e.exports=i}(t,e)},{$:20,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22,window:26}],61:[function(e,t){!function(e,t){"use strict";function i(){o.initDataConstructorBySettings(this)}var s=t("Enums"),o=t("Utils"),n=t("Storage:Settings");i.prototype.populateDataOnStart=function(){var e=o.pInt(n.settingsGet("Layout")),t=n.settingsGet("Languages"),i=n.settingsGet("Themes");o.isArray(t)&&this.languages(t),o.isArray(i)&&this.themes(i),this.mainLanguage(n.settingsGet("Language")),this.mainTheme(n.settingsGet("Theme")),this.capaAdditionalAccounts(n.capa(s.Capa.AdditionalAccounts)),this.capaAdditionalIdentities(n.capa(s.Capa.AdditionalIdentities)),this.capaGravatar(n.capa(s.Capa.Gravatar)),this.determineUserLanguage(!!n.settingsGet("DetermineUserLanguage")),this.determineUserDomain(!!n.settingsGet("DetermineUserDomain")),this.capaThemes(n.capa(s.Capa.Themes)),this.allowLanguagesOnLogin(!!n.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!n.settingsGet("AllowLanguagesOnSettings")),this.useLocalProxyForExternalImages(!!n.settingsGet("UseLocalProxyForExternalImages")),this.editorDefaultType(n.settingsGet("EditorDefaultType")),this.showImages(!!n.settingsGet("ShowImages")),this.contactsAutosave(!!n.settingsGet("ContactsAutosave")),this.interfaceAnimation(n.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(n.settingsGet("MPP")),this.desktopNotifications(!!n.settingsGet("DesktopNotifications")),this.useThreads(!!n.settingsGet("UseThreads")),this.replySameFolder(!!n.settingsGet("ReplySameFolder")),this.useCheckboxesInList(!!n.settingsGet("UseCheckboxesInList")),this.layout(s.Layout.SidePreview),-1(new s.Date).getTime()-g),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,i,n,t)}),f&&0=e?1:e},this),this.mainMessageListSearch=a.computed({read:this.messageListSearch,write:function(e){m.setHash(p.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=a.observable(""),this.messageListLoading=a.observable(!1),this.messageListIsNotCompleted=a.observable(!1),this.messageListCompleteLoadingThrottle=a.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=a.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(o.debounce(function(e){o.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new f,this.message=a.observable(null),this.messageLoading=a.observable(!1),this.messageLoadingThrottle=a.observable(!1).extend({throttle:50}),this.message.focused=a.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===this.layout()&&-10?s.Math.ceil(t/e*100):0},this),this.capaOpenPGP=a.observable(!1),this.openpgpkeys=a.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=a.observable(!1),this.googleLoggined=a.observable(!1),this.googleUserName=a.observable(""),this.facebookActions=a.observable(!1),this.facebookLoggined=a.observable(!1),this.facebookUserName=a.observable(""),this.twitterActions=a.observable(!1),this.twitterLoggined=a.observable(!1),this.twitterUserName=a.observable(""),this.customThemeType=a.observable(c.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=o.throttle(this.purgeMessageBodyCache,3e4)}var s=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("moment"),l=t("Consts"),c=t("Enums"),u=t("Globals"),d=t("Utils"),p=t("LinkBuilder"),h=t("Storage:Settings"),g=t("Storage:RainLoop:Cache"),m=t("App:Knoin"),f=t("Model:Message"),b=t("Storage:LocalStorage"),y=t("Storage:Abstract:Data");o.extend(i.prototype,y.prototype),i.prototype.purgeMessageBodyCache=function(){var e=0,t=null,i=u.iMessageBodyCacheCount-l.Values.MessageBodyCacheLimit;i>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=n(this);i>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&o.delay(function(){t.find(".rl-cache-purge").remove()},300)))},i.prototype.populateDataOnStart=function(){y.prototype.populateDataOnStart.call(this),this.accountEmail(h.settingsGet("Email")),this.accountIncLogin(h.settingsGet("IncLogin")),this.accountOutLogin(h.settingsGet("OutLogin")),this.projectHash(h.settingsGet("ProjectHash")),this.defaultIdentityID(h.settingsGet("DefaultIdentityID")),this.displayName(h.settingsGet("DisplayName")),this.replyTo(h.settingsGet("ReplyTo")),this.signature(h.settingsGet("Signature")),this.signatureToAll(!!h.settingsGet("SignatureToAll")),this.enableTwoFactor(!!h.settingsGet("EnableTwoFactor")),this.lastFoldersHash=b.get(c.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!h.settingsGet("RemoteSuggestions"),this.devEmail=h.settingsGet("DevEmail"),this.devPassword=h.settingsGet("DevPassword")},i.prototype.initUidNextAndNewMessages=function(e,t,i){if("INBOX"===e&&d.isNormal(t)&&""!==t){if(d.isArray(i)&&03)l(p.notificationMailIcon(),this.accountEmail(),d.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>a;a++)l(p.notificationMailIcon(),f.emailsToLine(f.initEmailsFromJson(i[a].From),!1),i[a].Subject)}g.setFolderUidNext(e,t)}},i.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},i.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],i=10,s=r().unix(),n=s-300,a=[],l=function(t){o.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&n>t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),o.find(a,function(e){var o=g.getFolderFromCacheList(e[1]);return o&&(o.interval=s,t.push(e[1])),i<=t.length}),o.uniq(t)},i.prototype.removeMessagesFromList=function(e,t,i,s){i=d.isNormal(i)?i:"",s=d.isUnd(s)?!1:!!s,t=o.map(t,function(e){return d.pInt(e)});var n=this,a=0,r=this.messageList(),l=g.getFolderFromCacheList(e),c=""===i?null:g.getFolderFromCacheList(i||""),u=this.currentFolderFullNameRaw(),p=this.message(),h=u===e?o.filter(r,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-a?l.messageCountUnread()-a:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),a>0&&c.messageCountUnread(c.messageCountUnread()+a),c.actionBlink(!0)),0100)&&(e.addClass("rl-bq-switcher hidden-bq"),n('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),d.windowResize()}).after("
").before("
"))})}},i.prototype.setMessage=function(e,t){var i=!1,s=!1,o=!1,a=null,r=null,l="",p="",h=!1,m=!1,f=this.messagesBodiesDom(),b=this.message();e&&b&&e.Result&&"Object/Message"===e.Result["@Object"]&&b.folderFullNameRaw===e.Result.Folder&&b.uid===e.Result.Uid&&(this.messageError(""),b.initUpdateByMessageJson(e.Result),g.addRequestedMessage(b.folderFullNameRaw,b.uid),t||b.initFlagsByJson(e.Result),f=f&&f[0]?f:null,f&&(l="rl-mgs-"+b.hash.replace(/[^a-zA-Z0-9]/g,""),r=f.find("#"+l),r&&r[0]?(b.body=r,b.body&&(b.body.data("rl-cache-count",++u.iMessageBodyCacheCount),b.fetchDataToDom())):(s=!!e.Result.HasExternals,o=!!e.Result.HasInternals,a=n('
').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++u.iMessageBodyCacheCount),d.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,p=e.Result.Html.toString()):d.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,p=d.plainToHtml(e.Result.Plain.toString(),!1),(b.isPgpSigned()||b.isPgpEncrypted())&&this.capaOpenPGP()&&(b.plainRaw=d.pString(e.Result.Plain),m=/---BEGIN PGP MESSAGE---/.test(b.plainRaw),m||(h=/-----BEGIN PGP SIGNED MESSAGE-----/.test(b.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(b.plainRaw)),u.$div.empty(),h&&b.isPgpSigned()?p=u.$div.append(n('
').text(b.plainRaw)).html():m&&b.isPgpEncrypted()&&(p=u.$div.append(n('
').text(b.plainRaw)).html()),u.$div.empty(),b.isPgpSigned(h),b.isPgpEncrypted(m))):i=!1,a.html(d.linkify(p)).addClass("b-text-part "+(i?"html":"plain")),b.isHtml(!!i),b.hasImages(!!s),b.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),b.pgpSignedVerifyUser(""),b.body=a,b.body&&f.append(b.body),b.storeDataToDom(),o&&b.showInternalImages(!0),b.hasImages()&&this.showImages()&&b.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(b.body),this.hideMessageBodies(),b.body.show(),a&&this.initBlockquoteSwitcher(a)),g.initMessageFlagsFromCache(b),b.unseen()&&u.__APP&&u.__APP.setMessageSeen(b),d.windowResize())},i.prototype.calculateMessageListHash=function(e){return o.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},i.prototype.findPublicKeyByHex=function(e){return o.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},i.prototype.findPublicKeysByEmail=function(e){return o.compact(o.map(this.openpgpkeysPublic(),function(t){var i=null;if(t&&e===t.email)try{if(i=s.openpgp.key.readArmored(t.armor),i&&!i.err&&i.keys&&i.keys[0])return i.keys[0]}catch(o){}return null}))},i.prototype.findPrivateKeyByEmail=function(e,t){var i=null,n=o.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(n)try{i=s.openpgp.key.readArmored(n.armor),i&&!i.err&&i.keys&&i.keys[0]?(i=i.keys[0],i.decrypt(d.pString(t))):i=null}catch(a){i=null}return i},i.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},e.exports=new i}(t,e)},{$:20,"App:Knoin":27,Consts:6,Enums:7,Globals:9,LinkBuilder:11,"Model:Message":42,"Storage:Abstract:Data":61,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:Settings":69,Utils:14,_:25,ko:22,moment:23,window:26}],65:[function(e,t){!function(e,t){"use strict";function i(){var e=t("_").find([t("Storage:LocalStorage:Cookie"),t("Storage:LocalStorage:LocalStorage")],function(e){return e&&e.supported()});this.oDriver=null,e&&(this.oDriver=new e)}i.prototype.oDriver=null,i.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},i.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new i}(t,e)},{"Storage:LocalStorage:Cookie":66,"Storage:LocalStorage:LocalStorage":67,_:25}],66:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("$"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!0},i.prototype.set=function(e,t){var i=s.cookie(n.Values.ClientSideCookieIndexName),a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.cookie(n.Values.ClientSideCookieIndexName,o.stringify(r),{expires:30}),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.cookie(n.Values.ClientSideCookieIndexName),i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{$:20,Consts:6,JSON:15,Utils:14}],67:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("window"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!!s.localStorage},i.prototype.set=function(e,t){var i=s.localStorage[n.Values.ClientSideCookieIndexName]||null,a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.localStorage[n.Values.ClientSideCookieIndexName]=o.stringify(r),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.localStorage[n.Values.ClientSideCookieIndexName]||null,i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{Consts:6,JSON:15,Utils:14,window:26}],68:[function(e,t){!function(e,t){"use strict";function i(){d.call(this),this.oRequests={}}var s=t("_"),o=t("Utils"),n=t("Consts"),a=t("Globals"),r=t("Base64"),l=t("Storage:Settings"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Data"),d=t("Storage:Abstract:Remote");s.extend(i.prototype,d.prototype),i.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:l.settingsGet("SentFolder"),DraftFolder:l.settingsGet("DraftFolder"),SpamFolder:l.settingsGet("SpamFolder"),TrashFolder:l.settingsGet("TrashFolder"),ArchiveFolder:l.settingsGet("ArchiveFolder")},null,"",["Folders"])},i.prototype.login=function(e,t,i,s,o,n,a,r){this.defaultRequest(e,"Login",{Email:t,Login:i,Password:s,Language:n||"",AdditionalCode:a||"",AdditionalCodeSignMe:r?"1":"0",SignMe:o?"1":"0"})},i.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},i.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},i.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},i.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},i.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},i.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)
-},i.prototype.saveContactsSyncData=function(e,t,i,s,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:i,User:s,Password:o})},i.prototype.accountAdd=function(e,t,i,s){this.defaultRequest(e,"AccountAdd",{Email:t,Login:i,Password:s})},i.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},i.prototype.identityUpdate=function(e,t,i,s,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:i,Name:s,ReplyTo:o,Bcc:n})},i.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},i.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},i.prototype.messageList=function(e,t,i,s,a,l){t=o.pString(t);var d=c.getFolderHash(t);l=o.isUnd(l)?!1:!!l,i=o.isUnd(i)?0:o.pInt(i),s=o.isUnd(i)?20:o.pInt(s),a=o.pString(a),""===d||""!==a&&-1!==a.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:i,Limit:s,Search:a,UidNext:"INBOX"===t?c.getFolderUidNext(t):"",UseThreads:u.threading()&&u.useThreads()?"1":"0",ExpandedThreadUid:u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",l?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,i,s,a,u.projectHash(),d,"INBOX"===t?c.getFolderUidNext(t):"",u.threading()&&u.useThreads()?"1":"0",u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),l?[]:["MessageList"])},i.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},i.prototype.message=function(e,t,i){return t=o.pString(t),i=o.pInt(i),c.getFolderFromCacheList(t)&&i>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,i,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},i.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},i.prototype.composeUploadDrive=function(e,t,i){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:i,Url:t},999e3)},i.prototype.folderInformation=function(e,t,i){var n=!0,r=[];o.isArray(i)&&0-1&&r.eq(o).removeClass("focused"),38===a&&o>0?o--:40===a&&os)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-s+o+e),!0):!1},i.prototype.messagesDrop=function(e,i){if(e&&i&&i.helper){var s=i.helper.data("rl-folder"),o=u.$html.hasClass("rl-ctrl-key-pressed"),n=i.helper.data("rl-uids");l.isNormal(s)&&""!==s&&l.isArray(n)&&t("App:RainLoop").moveMessagesToFolder(s,n,e.fullNameRaw,o)}},i.prototype.composeClick=function(){m.showScreenPopup(t("View:Popup:Compose"))},i.prototype.createFolder=function(){m.showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.configureFolders=function(){m.setHash(d.settings("folders"))},i.prototype.contactsClick=function(){this.allowContacts&&m.showScreenPopup(t("View:Popup:Contacts"))},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:Settings":69,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,"View:Popup:FolderCreate":86,_:25,key:21,ko:22,window:26}],74:[function(e,t){!function(e,t){"use strict";function i(){w.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=y.message,this.messageList=y.messageList,this.folderList=y.folderList,this.currentMessage=y.currentMessage,this.isMessageSelected=y.isMessageSelected,this.messageListSearch=y.messageListSearch,this.messageListError=y.messageListError,this.folderMenuForMove=y.folderMenuForMove,this.useCheckboxesInList=y.useCheckboxesInList,this.mainMessageListSearch=y.mainMessageListSearch,this.messageListEndFolder=y.messageListEndFolder,this.messageListChecked=y.messageListChecked,this.messageListCheckedOrSelected=y.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=y.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=y.messageListCompleteLoadingThrottle,p.initOnStartOrLangChange(function(){this.emptySubjectValue=p.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=y.userQuota,this.userUsageSize=y.userUsageSize,this.userUsageProc=y.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return c.Layout.NoPreview!==y.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=y.messageListEndSearch();return""===e?"":p.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(p.computedPagenatorHelper(y.messageListPage,y.messageListPageCount)),this.checkAll=n.computed({read:function(){return 00&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 01?" ("+(100>e?e:"99+")+")":""},i.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},i.prototype.moveSelectedMessagesToFolder=function(e,i){return this.canBeMoved()&&t("App:RainLoop").moveMessagesToFolder(y.currentFolderFullNameRaw(),y.messageListCheckedOrSelectedUidsWithSubMails(),e,i),!1},i.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),i=y.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",y.currentFolderFullNameRaw()),t.data("rl-uids",i),t.find(".text").text(""+i.length),s.defer(function(){var e=y.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},i.prototype.onMessageResponse=function(e,t,i){y.hideMessageBodies(),y.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?y.setMessage(t,i):c.StorageResultType.Unload===e?(y.message(null),y.messageError("")):c.StorageResultType.Abort!==e&&(y.message(null),y.messageError(p.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},i.prototype.populateMessageBody=function(e){e&&(S.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?y.messageLoading(!0):p.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},i.prototype.setAction=function(e,i,o){var n=[],a=null,r=0;if(p.isUnd(o)&&(o=y.messageListChecked()),n=s.map(o,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},i.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},i.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},i.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(g.sendReadReceiptMessage(u.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),e.isReadReceipt(!0),p.storeMessageFlagsToCache(e),t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache())},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,_:25,key:21,ko:22}],76:[function(e,t){!function(e,t){"use strict";function i(){n.call(this),o.constructorEnd(this)}var s=t("_"),o=t("App:Knoin"),n=t("View:RainLoop:AbstractSystemDropDown");o.extendAsViewModel(["View:RainLoop:MailBoxSystemDropDown","MailBoxSystemDropDownViewModel"],i),s.extend(i.prototype,n.prototype),e.exports=i}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,_:25}],77:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsAddAccount"),this.email=o.observable(""),this.password=o.observable(""),this.emailError=o.observable(!1),this.passwordError=o.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.emailFocus=o.observable(!1),this.addAccountCommand=a.createCommand(this,function(){return this.emailError(""===a.trim(this.email())),this.passwordError(""===a.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),r.accountAdd(s.bind(function(e,i){this.submitRequest(!1),n.StorageResultType.Success===e&&i&&"AccountAdd"===i.Action?i.Result?(t("App:RainLoop").accountsAndIdentities(),this.cancelCommand()):i.ErrorCode&&this.submitError(a.getNotification(i.ErrorCode)):this.submitError(a.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:AddAccount","PopupsAddAccountViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.emailFocus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],78:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsAddOpenPgpKey"),this.key=o.observable(""),this.key.error=o.observable(!1),this.key.focus=o.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=n.createCommand(this,function(){var e=30,i=null,s=n.trim(this.key()),o=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,r=a.openpgpKeyring;if(s=s.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===s),!r||this.key.error())return!1;for(;;){if(i=o.exec(s),!i||0>e)break;i[0]&&i[1]&&i[2]&&i[1]===i[2]&&("PRIVATE"===i[1]?r.privateKeys.importKey(i[0]):"PUBLIC"===i[1]&&r.publicKeys.importKey(i[0])),e--}return r.store(),t("App:RainLoop").reloadOpenPgpKeys(),n.delegateRun(this,"cancelCommand"),!0}),r.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel(["View:Popup:AddOpenPgpKey","PopupsAddOpenPgpKeyViewModel"],i),s.extend(i.prototype,l.prototype),i.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.key.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22}],79:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=o.observable(!1),this.from=o.observable(""),this.to=o.observable(""),this.subject=o.observable(""),this.text=o.observable(""),this.selectedDateValue=o.observable(-1),this.hasAttachment=o.observable(!1),this.starred=o.observable(!1),this.unseen=o.observable(!1),this.searchCommand=a.createCommand(this,function(){var e=this.buildSearchString();""!==e&&r.mainMessageListSearch(e),this.cancelCommand()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("moment"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:AdvancedSearch","PopupsAdvancedSearchViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.buildSearchStringValue=function(e){return-1"},i.prototype.sendMessageResponse=function(e,t){var i=!1,o="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(i=!0,this.modalVisibility()&&p.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),s.alert(p.trim(p.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=p.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),s.alert(o||p.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},i.prototype.saveMessageResponse=function(e,t){var i=!1,o=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(o=y.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&y.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(s.Math.round((new s.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
"+i}return e},i.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?o.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},i.prototype.onShow=function(e,t,i,s,a){C.routeOff();var r=this,l="",c="",d="",h="",g="",m=null,f="",b="",S=[],w={},A=y.accountEmail(),F=y.signature(),T=y.signatureToAll(),R=[],L=null,E=null,N=e||u.ComposeType.Empty,P=function(e,t){for(var i=0,s=e.length,o=[];s>i;i++)o.push(e[i].toLine(!!t));return o.join(", ")};if(t=t||null,t&&p.isNormal(t)&&(E=p.isArray(t)&&1===t.length?t[0]:p.isArray(t)?null:t),null!==A&&(w[A]=!0),this.currentIdentityID(this.findIdentityIdByMessage(N,E)),this.reset(),p.isNonEmptyArray(i)&&this.to(P(i)),""!==N&&E){switch(h=E.fullFormatDateValue(),g=E.subject(),L=E.aDraftInfo,m=n(E.body).clone(),m&&(m.find("blockquote.rl-bq-switcher").each(function(){n(this).removeClass("rl-bq-switcher hidden-bq")}),m.find(".rlBlockquoteSwitcher").each(function(){n(this).remove()})),m.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),f=m.html(),N){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(P(E.replyEmails(w))),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ReplyAll:S=E.replyAllEmails(w),this.to(P(S[0])),this.cc(P(S[1])),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.references());break;case u.ComposeType.Forward:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.Draft:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.bFromDraft=!0,this.draftFolder(E.folderFullNameRaw),this.draftUid(E.uid),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences;break;case u.ComposeType.EditAsNew:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences}switch(N){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=E.fromToLine(!1,!0),b=p.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:l}),f="

"+b+":

"+f+"

";break;case u.ComposeType.Forward:l=E.fromToLine(!1,!0),c=E.toToLine(!1,!0),d=E.ccToLine(!1,!0),f="


"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+p.encodeHtml(h)+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+p.encodeHtml(g)+"

"+f;break;case u.ComposeType.ForwardAsAttachment:f=""}T&&""!==F&&u.ComposeType.EditAsNew!==N&&u.ComposeType.Draft!==N&&(f=this.convertSignature(F,P(E.from,!0),f,N)),this.editor(function(e){e.setHtml(f,!1),E.isHtml()||e.modeToggle(!1)})}else u.ComposeType.Empty===N?(this.subject(p.isNormal(s)?""+s:""),f=p.isNormal(a)?""+a:"",T&&""!==F&&(f=this.convertSignature(F,"",p.convertPlainTextToHtml(f),N)),this.editor(function(e){e.setHtml(f,!1),u.EditorDefaultType.Html!==y.editorDefaultType()&&e.modeToggle(!1)})):p.isNonEmptyArray(t)&&o.each(t,function(e){r.addMessageAsAttachment(e)});R=this.getAttachmentsDownloadsForUpload(),p.isNonEmptyArray(R)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var i=null,s="";if(!r.viewModelVisibility())for(s in t.Result)t.Result.hasOwnProperty(s)&&(i=r.getAttachmentById(t.Result[s]),i&&i.tempName(s))}else r.setMessageAttachmentFailedDowbloadText()},R),this.triggerForResize()},i.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},i.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},i.prototype.tryToClosePopup=function(){var e=this,i=t("View:Popup:Ask");C.isPopupVisible(i)||C.showScreenPopup(i,[p.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&p.delegateRun(e,"closeCommand")}])},i.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),h.$win.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=s.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",n(t).attr("id","dropboxjs").attr("data-app-key",b.settingsGet("DropboxApiKey")),s.document.body.appendChild(t)),this.driveEnabled()&&n.getScript("https://apis.google.com/js/api.js",function(){s.gapi&&e.driveVisible(!0)})},i.prototype.driveCallback=function(e,t){if(t&&s.XMLHttpRequest&&s.google&&t[s.google.picker.Response.ACTION]===s.google.picker.Action.PICKED&&t[s.google.picker.Response.DOCUMENTS]&&t[s.google.picker.Response.DOCUMENTS][0]&&t[s.google.picker.Response.DOCUMENTS][0].id){var i=this,o=new s.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[s.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=l.parse(o.responseText),s=function(e,t,i){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+i,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":s(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":s(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":s(t,"image/png","png");break;case"application/vnd.google-apps.presentation":s(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:s(t,"application/pdf","pdf")}t&&t.downloadUrl&&i.addDriveAttachment(t,e)}}),o.send()}},i.prototype.driveCreatePiker=function(e){if(s.gapi&&e&&e.access_token){var t=this;s.gapi.load("picker",{callback:function(){if(s.google&&s.google.picker){var i=(new s.google.picker.PickerBuilder).addView((new s.google.picker.DocsView).setIncludeFolders(!0)).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(o.bind(t.driveCallback,t,e.access_token)).enableFeature(s.google.picker.Feature.NAV_HIDDEN).build();i.setVisible(!0)}}})}},i.prototype.driveOpenPopup=function(){if(s.gapi){var e=this;s.gapi.load("auth",{callback:function(){var t=s.gapi.auth.getToken();t?e.driveCreatePiker(t):s.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}else s.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}})})}})}},i.prototype.getAttachmentById=function(e){for(var t=this.attachments(),i=0,s=t.length;s>i;i++)if(t[i]&&e===t[i].id)return t[i];return null},i.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=p.pInt(b.settingsGet("AttachmentLimit")),i=new c({action:m.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});i?(i.on("onDragEnter",o.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",o.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",o.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",o.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",o.bind(function(t,i,o){var n=null;p.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+s.Math.floor(i/o*100)+"%")},this)).on("onSelect",o.bind(function(e,s){this.dragAndDropOver(!1);var o=this,n=p.isUnd(s.FileName)?"":s.FileName.toString(),a=p.isNormal(s.Size)?p.pInt(s.Size):null,r=new w(e,n,a);return r.cancel=function(e){return function(){o.attachments.remove(function(t){return t&&t.id===e}),i&&i.cancel(e)}}(e),this.attachments.push(r),a>0&&t>0&&a>t?(r.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",o.bind(function(t){var i=null;p.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&(i.waiting(!1),i.uploading(!0))},this)).on("onComplete",o.bind(function(t,i,s){var o="",n=null,a=null,r=this.getAttachmentById(t);a=i&&s&&s.Result&&s.Result.Attachment?s.Result.Attachment:null,n=s&&s.Result&&s.Result.ErrorCode?s.Result.ErrorCode:null,null!==n?o=p.getUploadErrorDescByCode(n):a||(o=p.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&00&&o>0&&n>o?(i.uploading(!1),i.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,t){var s=!1;i.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[i.id]&&(s=!0,i.tempName(t.Result[i.id])),s||i.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},i.prototype.addDriveAttachment=function(e,t){var i=this,s=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}},o=p.pInt(b.settingsGet("AttachmentLimit")),n=null,a=e.fileSize?p.pInt(e.fileSize):0;return n=new w(e.downloadUrl,e.title,a),n.fromMessage=!1,n.cancel=s(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),a>0&&o>0&&a>o?(n.uploading(!1),n.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var i=!1;n.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(i=!0,n.tempName(t.Result[n.id][0]),n.size(p.pInt(t.Result[n.id][1]))),i||n.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},i.prototype.prepearMessageAttachments=function(e,t){if(e){var i=this,s=p.isNonEmptyArray(e.attachments())?e.attachments():[],o=0,n=s.length,a=null,r=null,l=!1,c=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}};if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>o;o++){switch(r=s[o],l=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=r.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:l=!0}l&&(a=new w(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),a.fromMessage=!0,a.cancel=c(r.download),a.waiting(!1).uploading(!0),this.attachments.push(a))}}},i.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},i.prototype.setMessageAttachmentFailedDowbloadText=function(){o.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},i.prototype.isEmptyForm=function(e){e=p.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},i.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!1),this.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},i.prototype.getAttachmentsDownloadsForUpload=function(){return o.map(o.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},i.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,HtmlEditor:10,JSON:15,Jua:16,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:ComposeAttachment":33,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:ComposeOpenPgp":81,"View:Popup:FolderSystem":87,_:25,ko:22,moment:23,window:26}],83:[function(e,t){!function(e,t){"use strict";function i(){w.call(this,"Popups","PopupsContacts");var e=this,i=function(t){t&&0=e?1:e},this),this.contactsPagenator=a.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=a.observable(!0),this.viewClearSearch=a.observable(!1),this.viewID=a.observable(""),this.viewReadOnly=a.observable(!1),this.viewProperties=a.observableArray([]),this.viewTags=a.observable(""),this.viewTags.visibility=a.observable(!1),this.viewTags.focusTrigger=a.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=a.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1=s&&(this.bDropPageAfterDelete=!0),o.delay(function(){o.each(n,function(e){t.remove(e)})},500))},i.prototype.deleteSelectedContacts=function(){00?s:0),d.isNonEmptyArray(i.Result.Tags)&&(a=o.map(i.Result.Tags,function(e){var t=new y;return t.parse(e)?t:null}),a=o.compact(a))),t.contactsCount(s),t.contacts(n),t.contacts.loading(!1),t.contactTags(a),t.viewClearSearch(""!==t.search())},i,c.Defaults.ContactsPerPage,this.search())},i.prototype.onBuild=function(e){this.oContentVisible=n(".b-list-content",e),this.oContentScrollable=n(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;r("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=a.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},i.prototype.onShow=function(){v.routeOff(),this.reloadContactList(!0)},i.prototype.onHide=function(){v.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},e.exports=i}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:Contact":34,"Model:ContactProperty":35,"Model:ContactTag":36,"Model:Email":37,Selector:13,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,_:25,key:21,ko:22,window:26}],84:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsFilter"),this.filter=o.observable(null),this.selectedFolderValue=o.observable(n.Values.UnuseOptionValue),this.folderSelectList=r.folderMenuForMove,this.defautOptionsAfterRender=a.defautOptionsAfterRender,l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Consts"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:Filter","PopupsFilterViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){},i.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},e.exports=i}(t,e)},{"App:Knoin":27,Consts:6,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22}],85:[function(e,t){!function(e,t){"use strict";function i(){d.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=o.observable(null),this.clearingProcess=o.observable(!1),this.clearingError=o.observable(""),this.folderFullNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=o.computed(function(){return a.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=a.createCommand(this,function(){var e=this,i=this.selectedFolder();i&&(r.message(null),r.messageList([]),this.clearingProcess(!0),i.messageCountAll(0),i.messageCountUnread(0),l.setFolderHash(i.fullNameRaw,""),c.folderClear(function(i,s){e.clearingProcess(!1),n.StorageResultType.Success===i&&s&&s.Result?(t("App:RainLoop").reloadMessageList(!0),e.cancelCommand()):e.clearingError(s&&s.ErrorCode?a.getNotification(s.ErrorCode):a.getNotification(n.Notification.MailServerError))},i.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),u.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("Storage:RainLoop:Cache"),c=t("Storage:RainLoop:Remote"),u=t("App:Knoin"),d=t("Knoin:AbstractViewModel");u.extendAsViewModel(["View:Popup:FolderClear","PopupsFolderClearViewModel"],i),s.extend(i.prototype,d.prototype),i.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],86:[function(e,t){!function(e,t){"use strict";function i(){d.call(this,"Popups","PopupsFolderCreate"),r.initOnStartOrLangChange(function(){this.sNoParentText=r.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(a.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,i=null,s=l.folderList(),o=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==l.namespace&&(t=function(e){return l.namespace!==e.fullNameRaw.substr(0,l.namespace.length)}),r.folderListOptionsBuilder([],s,[],e,null,t,i,o)},this),this.createFolder=r.createCommand(this,function(){var e=this.selectedParentValue();""===e&&1 li"),o=i&&("tab"===i.shortcut||"right"===i.shortcut),n=s.index(s.filter(".active"));return!o&&n>0?n--:o&&n"),this.submitRequest(!0),o.delay(function(){n=s.openpgp.generateKeyPair({userId:i,numBits:a.pInt(e.keyBitLength()),passphrase:a.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t("App:RainLoop").reloadOpenPgpKeys(),a.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var s=t("window"),o=t("_"),n=t("ko"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:NewOpenPgpKey","PopupsNewOpenPgpKeyViewModel"],i),o.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.email.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,window:26}],92:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsTwoFactorTest");var e=this;this.code=o.observable(""),this.code.focused=o.observable(!1),this.code.status=o.observable(null),this.testing=o.observable(!1),this.testCode=a.createCommand(this,function(){this.testing(!0),r.testTwoFactor(function(t,i){e.testing(!1),e.code.status(n.StorageResultType.Success===t&&i&&i.Result?!0:!1)},this.code())},function(){return""!==this.code()&&!this.testing()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:TwoFactorTest","PopupsTwoFactorTestViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.clearPopup=function(){this.code(""),this.code.focused(!1),this.code.status(null),this.testing(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.code.focused(!0)},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],93:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=o.observable(""),this.keyDom=o.observable(null),a.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Utils"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel(["View:Popup:ViewOpenPgpKey","PopupsViewOpenPgpKeyViewModel"],i),s.extend(i.prototype,r.prototype),i.prototype.clearPopup=function(){this.key("")},i.prototype.selectKey=function(){var e=this.keyDom();e&&n.selectElement(e)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.key(e.armor)},e.exports=i}(t,e)},{"App:Knoin":27,"Knoin:AbstractViewModel":30,Utils:14,_:25,ko:22}],94:[function(e,t){!function(e,t){"use strict";function i(e){r.call(this,"Left","SettingsMenu"),this.leftPanelDisabled=o.leftPanelDisabled,this.menu=e.menu,a.constructorEnd(this)}var s=t("_"),o=t("Globals"),n=t("LinkBuilder"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel(["View:RainLoop:SettingsMenu","SettingsMenuViewModel"],i),s.extend(i.prototype,r.prototype),i.prototype.link=function(e){return n.settings(e)},i.prototype.backToMailBoxClick=function(){a.setHash(n.inbox())},e.exports=i}(t,e)},{"App:Knoin":27,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,_:25}],95:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Right","SettingsPane"),l.constructorEnd(this)}var s=t("_"),o=t("key"),n=t("Enums"),a=t("LinkBuilder"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:RainLoop:SettingsPane","SettingsPaneViewModel"],i),s.extend(i.prototype,c.prototype),i.prototype.onBuild=function(){var e=this;o("esc",n.KeyState.Settings,function(){e.backToMailBoxClick()})},i.prototype.onShow=function(){r.message(null)},i.prototype.backToMailBoxClick=function(){l.setHash(a.inbox())},e.exports=i}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Data":64,_:25,key:21}],96:[function(e,t){!function(e,t){"use strict";function i(){n.call(this),o.constructorEnd(this)}var s=t("_"),o=t("App:Knoin"),n=t("View:RainLoop:AbstractSystemDropDown");o.extendAsViewModel(["View:RainLoop:SettingsSystemDropDown","SettingsSystemDropDownViewModel"],i),s.extend(i.prototype,n.prototype),e.exports=i}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,_:25}]},{},[1]); \ No newline at end of file +!function e(t,s,i){function o(a,r){if(!s[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(n)return n(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=s[a]={exports:{}};t[a][0].call(u.exports,function(e){var s=t[a][1][e];return o(s?s:e)},u,u.exports,e,t,s,i)}return s[a].exports}for(var n="function"==typeof require&&require,a=0;a').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,i.location&&i.location.toString?i.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var i=t("window"),o=t("_"),n=t("$"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),d=t("Knoin:AbstractBoot");o.extend(s.prototype,d.prototype),s.prototype.remote=function(){return null},s.prototype.data=function(){return null},s.prototype.setupSettings=function(){return!0},s.prototype.download=function(e){var t=null,s=null,o=i.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(s=i.document.createElement("a"),s.href=e,i.document.createEvent&&(t=i.document.createEvent("MouseEvents"),t&&t.initEvent&&s.dispatchEvent))?(t.initEvent("click",!0,!0),s.dispatchEvent(t),!0):(a.bMobileDevice?(i.open(e,"_self"),i.focus()):this.iframe.attr("src",e),!0)},s.prototype.setTitle=function(e){e=(r.isNormal(e)&&0o;o++)g=e.Result["@Collection"][o],g&&"Object/Message"===g["@Object"]&&(m=h[o],m&&m.initByJson(g)||(m=C.newInstanceFromJson(g)),m&&(y.hasNewMessageAndRemoveFromCache(m.folderFullNameRaw,m.uid)&&5>=S&&(S++,m.newForAnimation(!0)),m.deleted(!1),t?y.initMessageFlagsFromCache(m):y.storeMessageFlagsToCache(m),m.lastInCollapsedThread(s&&-1i;i++)n=t[i],n&&(r=n.FullNameRaw,a=y.getFolderFromCacheList(r),a||(a=w.newInstanceFromJson(n),a&&(y.setFolderToCacheList(r,a),y.setFolderFullNameRaw(a.fullNameHash,r))),a&&(a.collapsed(!s.isFolderExpanded(a.fullNameHash)),n.Extended&&(n.Extended.Hash&&y.setFolderHash(a.fullNameRaw,n.Extended.Hash),d.isNormal(n.Extended.MessageCount)&&a.messageCountAll(n.Extended.MessageCount),d.isNormal(n.Extended.MessageUnseenCount)&&a.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&d.isArray(l["@Collection"])&&a.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(a)));return c},s.prototype.setFolders=function(e){var t=[],s=!1,i=function(e){return""===e||c.Values.UnuseOptionValue===e||null!==y.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])&&(d.isUnd(e.Result.Namespace)||(b.namespace=e.Result.Namespace),b.threading(!!f.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(b.namespace,e.Result["@Collection"]),b.folderList(t),e.Result.SystemFolders&&""==""+f.settingsGet("SentFolder")+f.settingsGet("DraftFolder")+f.settingsGet("SpamFolder")+f.settingsGet("TrashFolder")+f.settingsGet("ArchiveFolder")+f.settingsGet("NullFolder")&&(f.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),f.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),f.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),f.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),f.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),s=!0),b.sentFolder(i(f.settingsGet("SentFolder"))),b.draftFolder(i(f.settingsGet("DraftFolder"))),b.spamFolder(i(f.settingsGet("SpamFolder"))),b.trashFolder(i(f.settingsGet("TrashFolder"))),b.archiveFolder(i(f.settingsGet("ArchiveFolder"))),s&&S.saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),m.set(r.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},s.prototype.isFolderExpanded=function(e){var t=m.get(r.ClientSideKeyName.ExpandedFolders);return d.isArray(t)&&-1!==o.indexOf(t,e)},s.prototype.setExpandedFolder=function(e,t){var s=m.get(r.ClientSideKeyName.ExpandedFolders);d.isArray(s)||(s=[]),t?(s.push(e),s=o.uniq(s)):s=o.without(s,e),m.set(r.ClientSideKeyName.ExpandedFolders,s)},s.prototype.initLayoutResizer=function(e,t,s){var i=60,o=155,a=n(e),r=n(t),l=m.get(s)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(i);else{a.resizable("enable");var t=d.pInt(m.get(s))||o;c(t>o?t:o)}},p=function(e,t){t&&t.size&&t.size.width&&(m.set(s,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>o?l:o),a.resizable({helper:"ui-resizable-helper",minWidth:o,maxWidth:350,handles:"e",stop:p}),h.sub("left-panel.off",function(){u(!0)}),h.sub("left-panel.on",function(){u(!1)})},s.prototype.bootstartLoginScreen=function(){var e=d.pString(f.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),o.defer(function(){i.location.href=e})):(g.hideLoading(),g.startScreens([t("Screen:RainLoop:Login")]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"))},s.prototype.bootstart=function(){R.prototype.bootstart.call(this),b.populateDataOnStart();var e=this,s=f.settingsGet("JsHash"),a=d.pInt(f.settingsGet("ContactsSyncInterval")),c=f.settingsGet("AllowGoogleSocial"),m=f.settingsGet("AllowFacebookSocial"),y=f.settingsGet("AllowTwitterSocial");d.initOnStartOrLangChange(function(){n.extend(!0,n.magnificPopup.defaults,{tClose:d.i18n("MAGNIFIC_POPUP/CLOSE"),tLoading:d.i18n("MAGNIFIC_POPUP/LOADING"),gallery:{tPrev:d.i18n("MAGNIFIC_POPUP/GALLERY_PREV"),tNext:d.i18n("MAGNIFIC_POPUP/GALLERY_NEXT"),tCounter:d.i18n("MAGNIFIC_POPUP/GALLERY_COUNTER")},image:{tError:d.i18n("MAGNIFIC_POPUP/IMAGE_ERROR")},ajax:{tError:d.i18n("MAGNIFIC_POPUP/AJAX_ERROR")}})},this),i.SimplePace&&(i.SimplePace.set(70),i.SimplePace.sleep()),l.leftPanelDisabled.subscribe(function(e){h.pub("left-panel."+(e?"off":"on"))}),f.settingsGet("Auth")?(this.setTitle(d.i18n("TITLES/LOADING")),this.folders(o.bind(function(s){g.hideLoading(),s?(i.$LAB&&i.crypto&&i.crypto.getRandomValues&&f.capa(r.Capa.OpenPGP)?i.$LAB.script(i.openpgp?"":p.openPgpJs()).wait(function(){i.openpgp&&(b.openpgpKeyring=new i.openpgp.Keyring,b.capaOpenPGP(!0),h.pub("openpgp.init"),e.reloadOpenPgpKeys())}):b.capaOpenPGP(!1),g.startScreens([t("Screen:RainLoop:MailBox"),t("Screen:RainLoop:Settings"),t("Screen:RainLoop:About")]),(c||m||y)&&e.socialUsers(!0),h.sub("interval.2m",function(){e.folderInformation("INBOX")}),h.sub("interval.2m",function(){var t=b.currentFolderFullNameRaw();"INBOX"!==t&&e.folderInformation(t)}),h.sub("interval.3m",function(){e.folderInformationMultiply()}),h.sub("interval.5m",function(){e.quota()}),h.sub("interval.10m",function(){e.folders()}),a=a>=5?a:20,a=320>=a?a:320,i.setInterval(function(){e.contactsSync()},6e4*a+5e3),o.delay(function(){e.contactsSync()},5e3),o.delay(function(){e.folderInformationMultiply(!0)},500),u.runHook("rl-start-user-screens"),h.pub("rl.bootstart-user-screens"),f.settingsGet("AccountSignMe")&&i.navigator.registerProtocolHandler&&o.delay(function(){try{i.navigator.registerProtocolHandler("mailto",i.location.protocol+"//"+i.location.host+i.location.pathname+"?mailto&to=%s",""+(f.settingsGet("Title")||"RainLoop"))}catch(e){}f.settingsGet("MailToEmail")&&d.mailToHelper(f.settingsGet("MailToEmail"),t("View:Popup:Compose"))},500),l.bMobileDevice||o.defer(function(){e.initLayoutResizer("#rl-left","#rl-right",r.ClientSideKeyName.FolderListSize)})):e.bootstartLoginScreen(),i.SimplePace&&i.SimplePace.set(100)},this))):(this.bootstartLoginScreen(),i.SimplePace&&i.SimplePace.set(100)),c&&(i["rl_"+s+"_google_service"]=function(){b.googleActions(!0),e.socialUsers()}),m&&(i["rl_"+s+"_facebook_service"]=function(){b.facebookActions(!0),e.socialUsers()}),y&&(i["rl_"+s+"_twitter_service"]=function(){b.twitterActions(!0),e.socialUsers()}),h.sub("interval.1m",function(){l.momentTrigger(!l.momentTrigger())}),u.runHook("rl-start-screens"),h.pub("rl.bootstart-end")},e.exports=new s}(t,e)},{$:20,"App:Abstract":2,"App:Knoin":27,Consts:6,Enums:7,Events:8,Globals:9,LinkBuilder:11,"Model:Account":31,"Model:Email":37,"Model:Folder":40,"Model:Identity":41,"Model:Message":42,"Model:OpenPgpKey":43,Plugins:12,"Screen:RainLoop:About":44,"Screen:RainLoop:Login":46,"Screen:RainLoop:MailBox":47,"Screen:RainLoop:Settings":48,"Settings:RainLoop:Accounts":49,"Settings:RainLoop:ChangePassword":50,"Settings:RainLoop:Contacts":51,"Settings:RainLoop:Filters":52,"Settings:RainLoop:Folders":53,"Settings:RainLoop:General":54,"Settings:RainLoop:Identities":55,"Settings:RainLoop:Identity":56,"Settings:RainLoop:OpenPGP":57,"Settings:RainLoop:Security":58,"Settings:RainLoop:Social":59,"Settings:RainLoop:Themes":60,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:Compose":82,"View:Popup:FolderSystem":87,_:25,moment:23,window:26}],4:[function(e,t){!function(e,t){"use strict";e.exports=function(e){var s=t("window"),i=t("_"),o=t("$"),n=t("Globals"),a=t("Plugins"),r=t("Utils"),l=t("Enums"),c=t("Model:Email");n.__APP=e,e.setupSettings(),a.__boot=e,a.__remote=e.remote(),a.__data=e.data(),n.$html.addClass(n.bMobileDevice?"mobile":"no-mobile"),n.$win.keydown(r.killCtrlAandS).keyup(r.killCtrlAandS),n.$win.unload(function(){n.bUnload=!0}),n.$html.on("click.dropdown.data-api",function(){r.detectDropdownVisibility()}),s.rl=s.rl||{},s.rl.addHook=i.bind(a.addHook,a),s.rl.settingsGet=i.bind(a.mainSettingsGet,a),s.rl.remoteRequest=i.bind(a.remoteRequest,a),s.rl.pluginSettingsGet=i.bind(a.settingsGet,a),s.rl.createCommand=r.createCommand,s.rl.EmailModel=c,s.rl.Enums=l,s.__APP_BOOT=function(t){o(function(){s.rainloopTEMPLATES&&s.rainloopTEMPLATES[0]?(o("#rl-templates").html(s.rainloopTEMPLATES[0]),i.delay(function(){e.bootstart(),n.$html.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},10)):t(!1),s.__APP_BOOT=null})}}}(t,e)},{$:20,Enums:7,Globals:9,"Model:Email":37,Plugins:12,Utils:14,_:25,window:26}],5:[function(e,t){!function(e){"use strict";var t={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return t.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var s,i,o,n,a,r,l,c="",u=0;for(e=t._utf8_encode(e);u>2,a=(3&s)<<4|i>>4,r=(15&i)<<2|o>>6,l=63&o,isNaN(i)?r=l=64:isNaN(o)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(l);return c},decode:function(e){var s,i,o,n,a,r,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,i=(15&a)<<4|r>>2,o=(3&r)<<6|l,c+=String.fromCharCode(s),64!==r&&(c+=String.fromCharCode(i)),64!==l&&(c+=String.fromCharCode(o));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",s=0,i=e.length,o=0;i>s;s++)o=e.charCodeAt(s),128>o?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128));return t},_utf8_decode:function(e){for(var t="",s=0,i=0,o=0,n=0;si?(t+=String.fromCharCode(i),s++):i>191&&224>i?(o=e.charCodeAt(s+1),t+=String.fromCharCode((31&i)<<6|63&o),s+=2):(o=e.charCodeAt(s+1),n=e.charCodeAt(s+2),t+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&n),s+=3);return t}};e.exports=t}(t,e)},{}],6:[function(e,t){!function(e){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideStorageIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(t)},{}],7:[function(e,t){!function(e){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={Prem:"PREM",TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",Filters:"FILTERS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t +}(t,e)},{}],8:[function(e,t){!function(e,t){"use strict";function s(){this.oSubs={}}var i=t("_"),o=t("Utils"),n=t("Plugins");s.prototype.oSubs={},s.prototype.sub=function(e,t,s){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,s]),this},s.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||i.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new s}(t,e)},{Plugins:12,Utils:14,_:25}],9:[function(e,t){!function(e,t){"use strict";var s={},i=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("key"),l=t("Enums");s.$win=n(i),s.$doc=n(i.document),s.$html=n("html"),s.$div=n("
"),s.now=(new i.Date).getTime(),s.momentTrigger=a.observable(!0),s.dropdownVisibility=a.observable(!1).extend({rateLimit:0}),s.tooltipTrigger=a.observable(!1).extend({rateLimit:0}),s.langChangeTrigger=a.observable(!0),s.useKeyboardShortcuts=a.observable(!0),s.iAjaxErrorCount=0,s.iTokenErrorCount=0,s.iMessageBodyCacheCount=0,s.bUnload=!1,s.sUserAgent=(i.navigator.userAgent||"").toLowerCase(),s.bIsiOSDevice=-1'+this.editor.getData()+"
":this.editor.getData():""},s.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},s.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},s.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},s.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,s=a.settingsGet("Language"),o=!!a.settingsGet("AllowHtmlEditorSourceButton");o&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=i.CKEDITOR.ENTER_BR,t.shiftEnterMode=i.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[s]||"en",i.CKEDITOR.env&&(i.CKEDITOR.env.isCompatible=!0),e.editor=i.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(i.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};i.CKEDITOR?t():i.__initEditor=t}},s.prototype.focus=function(){this.editor&&this.editor.focus()},s.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},s.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},s.prototype.clear=function(e){this.setHtml("",e)},e.exports=s}(t,e)},{Globals:9,"Storage:Settings":69,_:25,window:26}],11:[function(e,t){!function(e,t){"use strict";function s(){var e=t("Storage:Settings");this.sBase="#/",this.sServer="./?",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var i=t("window"),o=t("Utils");s.prototype.root=function(){return this.sBase},s.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},s.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},s.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},s.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},s.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},s.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},s.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},s.prototype.change=function(e){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+i.encodeURIComponent(e)+"/"},s.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},s.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},s.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},s.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+i.encodeURIComponent(e)+"/"},s.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},s.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},s.prototype.settings=function(e){var t=this.sBase+"settings";return o.isUnd(e)||""===e||(t+="/"+e),t},s.prototype.about=function(){return this.sBase+"about"},s.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},s.prototype.mailBox=function(e,t,s){t=o.isNormal(t)?o.pInt(t):1,s=o.pString(s);var i=this.sBase+"mailbox/";return""!==e&&(i+=encodeURI(e)),t>1&&(i=i.replace(/[\/]+$/,""),i+="/p"+t),""!==s&&(i=i.replace(/[\/]+$/,""),i+="/"+encodeURI(s)),i},s.prototype.phpInfo=function(){return this.sServer+"Info"},s.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},s.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},s.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},s.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},s.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},s.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},s.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},s.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},s.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new s}(t,e)},{"Storage:Settings":69,Utils:14,window:26}],12:[function(e,t){!function(e,t){"use strict";function s(){this.__boot=null,this.__data=null,this.__remote=null,this.oSettings=t("Storage:Settings"),this.oViewModelsHooks={},this.oSimpleHooks={}}var i=t("_"),o=t("Utils");s.prototype.__boot=null,s.prototype.__data=null,s.prototype.__remote=null,s.prototype.oViewModelsHooks={},s.prototype.oSimpleHooks={},s.prototype.addHook=function(e,t){o.isFunc(t)&&(o.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},s.prototype.runHook=function(e,t){o.isArray(this.oSimpleHooks[e])&&(t=t||[],i.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},s.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},s.prototype.remoteRequest=function(e,t,s,i,o,n){this.__remote&&this.__remote.defaultRequest(e,t,s,i,o,n)},s.prototype.settingsGet=function(e,t){var s=this.oSettings.settingsGet("Plugins");return s=s&&!o.isUnd(s[e])?s[e]:null,s?o.isUnd(s[t])?null:s[t]:null},e.exports=new s}(t,e)},{"Storage:Settings":69,Utils:14,_:25}],13:[function(e,t){!function(e,t){"use strict";function s(e,t,s,o,a,r){this.list=e,this.listChecked=n.computed(function(){return i.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=n.computed(function(){return 00&&-10)return i.newSelectPosition(s,a.shift),!1}})}},s.prototype.autoSelect=function(e){this.bAutoSelect=!!e},s.prototype.getItemUid=function(e){var t="",s=this.oCallbacks.onItemGetUid||null;return s&&e&&(t=s(e)),t.toString()},s.prototype.newSelectPosition=function(e,t,s){var o=0,n=10,a=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(r.EventKeyCode.Down===e||r.EventKeyCode.Up===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)i.each(u,function(t){if(!l)switch(e){case r.EventKeyCode.Up:p===t?l=!0:c=t;break;case r.EventKeyCode.Down:case r.EventKeyCode.Insert:a?(c=t,l=!0):p===t&&(a=!0)}});else if(r.EventKeyCode.Home===e||r.EventKeyCode.End===e)r.EventKeyCode.Home===e?c=u[0]:r.EventKeyCode.End===e&&(c=u[u.length-1]);else if(r.EventKeyCode.PageDown===e){for(;d>o;o++)if(p===u[o]){o+=n,o=o>d-1?d-1:o,c=u[o];break}}else if(r.EventKeyCode.PageUp===e)for(o=d;o>=0;o--)if(p===u[o]){o-=n,o=0>o?0:o,c=u[o];break}}else r.EventKeyCode.Down===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e||r.EventKeyCode.Home===e||r.EventKeyCode.PageUp===e?c=u[0]:(r.EventKeyCode.Up===e||r.EventKeyCode.End===e||r.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(r.EventKeyCode.Up===e||r.EventKeyCode.Down===e)&&p.checked(!p.checked()):(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!s||this.isListChecked()||r.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||r.EventKeyCode.Up!==e&&r.EventKeyCode.Down!==e?(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},s.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=o(this.sItemFocusedSelector,this.oContentScrollable),s=t.position(),i=this.oContentVisible.height(),n=t.outerHeight();return s&&(s.top<0||s.top+n>i)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-i+n+e),!0):!1},s.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},s.prototype.eventClickFunction=function(e,t){var s=this.getItemUid(e),i=0,o=0,n=null,a="",r=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==s&&""!==this.sLastUid&&s!==this.sLastUid)for(c=this.list(),u=e.checked(),i=0,o=c.length;o>i;i++)n=c[i],a=this.getItemUid(n),r=!1,(a===this.sLastUid||a===s)&&(r=!0),r&&(l=!l),(l||r)&&n.checked(u);this.sLastUid=""===s?"":s},s.prototype.actionClick=function(e,t){if(e){var s=!0,i=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(s=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(s=!1,""===this.sLastUid&&(this.sLastUid=i),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),s&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},s.prototype.on=function(e,t){this.oCallbacks[e]=t},e.exports=s}(t,e)},{$:20,Enums:7,Utils:14,_:25,key:21,ko:22}],14:[function(e,t){!function(e,t){"use strict";var s={},i=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("Enums"),l=t("Consts"),c=t("Globals");s.trim=n.trim,s.inArray=n.inArray,s.isArray=o.isArray,s.isFunc=o.isFunction,s.isUnd=o.isUndefined,s.isNull=o.isNull,s.emptyFunction=function(){},s.isNormal=function(e){return!s.isUnd(e)&&!s.isNull(e)},s.windowResize=o.debounce(function(e){s.isUnd(e)?c.$win.resize():i.setTimeout(function(){c.$win.resize()},e)},50),s.isPosNumeric=function(e,t){return s.isNormal(e)?(s.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},s.pInt=function(e,t){var o=s.isNormal(e)&&""!==e?i.parseInt(e,10):t||0;return i.isNaN(o)?t||0:o},s.pString=function(e){return s.isNormal(e)?""+e:""},s.isNonEmptyArray=function(e){return s.isArray(e)&&0n;n++)o=s[n].split("="),t[i.decodeURIComponent(o[0])]=i.decodeURIComponent(o[1]);return t},s.mailToHelper=function(e,o){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var n={},a=null,l=e.replace(/\?.+$/,""),c=e.replace(/^[^\?]*\?/,""),u=t("Model:Email");return a=new u,a.parse(i.decodeURIComponent(l)),a&&a.email&&(n=s.simpleQueryParser(c),t("App:Knoin").showScreenPopup(o,[r.ComposeType.Empty,null,[a],s.isUnd(n.subject)?null:s.pString(n.subject),s.isUnd(n.body)?null:s.plainToHtml(s.pString(n.body))])),!0}return!1},s.rsaEncode=function(e,t,o,n){if(i.crypto&&i.crypto.getRandomValues&&i.RSAKey&&t&&o&&n){var a=new i.RSAKey;if(a.setPublic(n,o),e=a.encrypt(s.fakeMd5()+":"+e+":"+s.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},s.rsaEncode.supported=!!(i.crypto&&i.crypto.getRandomValues&&i.RSAKey),s.exportPath=function(e,t,o){for(var n=null,a=e.split("."),r=o||i;a.length&&(n=a.shift());)a.length||s.isUnd(t)?r=r[n]?r[n]:r[n]={}:r[n]=t},s.pImport=function(e,t,s){e[t]=s},s.pExport=function(e,t,i){return s.isUnd(e[t])?i:e[t]},s.encodeHtml=function(e){return s.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},s.splitPlainText=function(e,t){var i="",o="",n=e,a=0,r=0;for(t=s.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),i+=o.substring(0,a)+"\n",n=n.substring(a+1);return i+n},s.timeOutAction=function(){var e={};return function(t,o,n){s.isUnd(e[t])&&(e[t]=0),i.clearTimeout(e[t]),e[t]=i.setTimeout(o,n)}}(),s.timeOutActionSecond=function(){var e={};return function(t,s,o){e[t]||(e[t]=i.setTimeout(function(){s(),e[t]=0},o))}}(),s.audio=function(){var e=!1;return function(t,s){if(!1===e)if(c.bIsiOSDevice)e=null;else{var o=!1,n=!1,a=i.Audio?new i.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(n=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||n?(e=a,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:s):e=null):e=null}return e}}(),s.hos=function(e,t){return e&&i.Object&&i.Object.hasOwnProperty?i.Object.hasOwnProperty.call(e,t):!1},s.i18n=function(e,t,i){var o="",n=s.isUnd(c.oI18N[e])?s.isUnd(i)?e:i:c.oI18N[e];if(!s.isUnd(t)&&!s.isNull(t))for(o in t)s.hos(t,o)&&(n=n.replace("%"+o+"%",t[o]));return n},s.i18nToNode=function(e){o.defer(function(){n(".i18n",e).each(function(){var e=n(this),t="";t=e.data("i18n-text"),t?e.text(s.i18n(t)):(t=e.data("i18n-html"),t&&e.html(s.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",s.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",s.i18n(t)))})})},s.i18nReload=function(){i.rainloopI18N&&(c.oI18N=i.rainloopI18N||{},s.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),i.rainloopI18N=null},s.initOnStartOrLangChange=function(e,t,s){e&&e.call(t),s?c.langChangeTrigger.subscribe(function(){e&&e.call(t),s.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},s.inFocus=function(){return i.document.activeElement?(s.isUnd(i.document.activeElement.__inFocusCache)&&(i.document.activeElement.__inFocusCache=n(i.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!i.document.activeElement.__inFocusCache):!1},s.removeInFocus=function(){if(i.document&&i.document.activeElement&&i.document.activeElement.blur){var e=n(i.document.activeElement);e.is("input,textarea")&&i.document.activeElement.blur()}},s.removeSelection=function(){if(i&&i.getSelection){var e=i.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else i.document&&i.document.selection&&i.document.selection.empty&&i.document.selection.empty()},s.replySubjectAdd=function(e,t){e=s.trim(e.toUpperCase()),t=s.trim(t.replace(/[\s]+/g," "));var i=!1,n=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=s.trim(e);i||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(n.push(e),i=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,s.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+s.trim(n.join(":")))},s.roundNumber=function(e,t){return i.Math.round(e*i.Math.pow(10,t))/i.Math.pow(10,t)},s.friendlySize=function(e){return e=s.pInt(e),e>=1073741824?s.roundNumber(e/1073741824,1)+"GB":e>=1048576?s.roundNumber(e/1048576,1)+"MB":e>=1024?s.roundNumber(e/1024,0)+"KB":e+"B"},s.log=function(e){i.console&&i.console.log&&i.console.log(e)},s.getNotification=function(e,t){return e=s.pInt(e),r.Notification.ClientViewError===e&&t?t:s.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},s.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=s.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=s.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=s.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=s.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=s.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=s.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=s.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=s.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=s.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=s.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=s.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=s.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=s.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=s.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=s.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=s.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=s.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=s.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=s.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=s.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=s.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=s.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=s.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=s.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=s.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=s.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=s.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=s.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},s.getUploadErrorDescByCode=function(e){var t="";switch(s.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=s.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=s.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=s.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=s.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=s.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=s.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=s.i18n("UPLOAD/ERROR_UNKNOWN")}return t},s.delegateRun=function(e,t,i,n){e&&e[t]&&(n=s.pInt(n),0>=n?e[t].apply(e,s.isArray(i)?i:[]):o.delay(function(){e[t].apply(e,s.isArray(i)?i:[])},n))},s.killCtrlAandS=function(e){if(e=e||i.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,s=e.keyCode||e.which;if(s===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;s===r.EventKeyCode.A&&(i.getSelection?i.getSelection().removeAllRanges():i.document.selection&&i.document.selection.clear&&i.document.selection.clear(),e.preventDefault())}},s.createCommand=function(e,t,i){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=a.observable(!0),i=s.isUnd(i)?!0:i,o.canExecute=a.computed(s.isFunc(i)?function(){return o.enabled()&&i.call(e)}:function(){return o.enabled()&&!!i}),o},s.initDataConstructorBySettings=function(e){e.editorDefaultType=a.observable(r.EditorDefaultType.Html),e.showImages=a.observable(!1),e.interfaceAnimation=a.observable(r.InterfaceAnimation.Full),e.contactsAutosave=a.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=a.observable(!1),e.allowLanguagesOnSettings=a.observable(!0),e.allowLanguagesOnLogin=a.observable(!0),e.useLocalProxyForExternalImages=a.observable(!1),e.desktopNotifications=a.observable(!1),e.useThreads=a.observable(!0),e.replySameFolder=a.observable(!0),e.useCheckboxesInList=a.observable(!0),e.layout=a.observable(r.Layout.SidePreview),e.usePreviewPane=a.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=a.computed(function(){e.desktopNotifications();var t=s.notificationClass(),o=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":o=r.DesktopNotifications.Allowed;break;case"denied":o=r.DesktopNotifications.Denied;break;case"default":o=r.DesktopNotifications.NotAllowed}else i.webkitNotifications&&i.webkitNotifications.checkPermission&&(o=i.webkitNotifications.checkPermission());return o}),e.useDesktopNotifications=a.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var i=s.notificationClass(),o=e.desktopNotificationsPermisions();i&&r.DesktopNotifications.Allowed===o?e.desktopNotifications(!0):i&&r.DesktopNotifications.NotAllowed===o?i.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated() +}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=a.observable(""),e.languages=a.observableArray([]),e.mainLanguage=a.computed({read:e.language,write:function(t){t!==e.language()?-1=t.diff(i,"hours")?o:t.format("L")===i.format("L")?s.i18n("MESSAGE_LIST/TODAY_AT",{TIME:i.format("LT")}):t.clone().subtract("days",1).format("L")===i.format("L")?s.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:i.format("LT")}):i.format(t.year()===i.year()?"D MMM.":"LL")},e)},s.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=s.trim(e.substring(0,e.length-7))),s.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},s.quoteName=function(e){return e.replace(/["]/g,'\\"')},s.microtime=function(){return(new Date).getTime()},s.convertLangName=function(e,t){return s.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},s.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=s.isUnd(e)?32:s.pInt(e);t.length/g,">").replace(/")},s.draggeblePlace=function(){return n('
 
').appendTo("#rl-hidden")},s.defautOptionsAfterRender=function(e,t){t&&!s.isUnd(t.disabled)&&e&&n(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},s.windowPopupKnockout=function(e,t,o,r){var l=null,c=i.open(""),u="__OpenerApplyBindingsUid"+s.fakeMd5()+"__",d=n("#"+t);i[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=n(c.document.body);n("#rl-content",t).html(d.html()),n("html",c.document).addClass("external "+n("html").attr("class")),s.i18nToNode(t),e&&n("#rl-content",t)[0]&&a.applyBindings(e,n("#rl-content",t)[0]),i[u]=null,r(c)}},c.document.open(),c.document.write(''+s.encodeHtml(o)+'
'),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},s.settingsSaveHelperFunction=function(e,t,i,n){return i=i||null,n=s.isUnd(n)?1e3:s.pInt(n),function(s,a,l,c,u){t.call(i,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(i,s,a,l,c,u),o.delay(function(){t.call(i,r.SaveSettingsStep.Idle)},n)}},s.settingsSaveHelperSimpleFunction=function(e,t){return s.settingsSaveHelperFunction(null,e,t,1e3)},s.htmlToPlain=function(e){var t=0,s=0,i=0,o=0,a=0,r="",l=function(e){for(var t=100,s="",i="",o=e,n=0,a=0;o.length>t;)i=o.substring(0,t),n=i.lastIndexOf(" "),a=i.lastIndexOf("\n"),-1!==a&&(n=a),-1===n&&(n=t),s+=i.substring(0,n)+"\n",o=o.substring(n+1);return s+o},u=function(e){return e=l(n.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+n.trim(e)+"\n"),e}return""},p=function(){return arguments&&1"):""},h=function(){return arguments&&1/g,">"):""},g=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,g).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,s=r.indexOf("__bq__start__",t),s>-1);)i=r.indexOf("__bq__start__",s+5),o=r.indexOf("__bq__end__",s+5),(-1===i||i>o)&&o>s?(r=r.substring(0,s)+u(r.substring(s+13,o))+r.substring(o+11),t=0):t=i>-1&&o>i?i-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var i=!1,o=!0,n=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l"===r.substr(0,1),n&&!i?(o=!0,i=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!n&&i?(i=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(n&&i?r.substr(1):r);i&&(i=!1,a.push("~~~/blockquote~~~")),c=a}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t?s.linkify(e):e},i.rainloop_Utils_htmlToPlain=s.htmlToPlain,i.rainloop_Utils_plainToHtml=s.plainToHtml,s.linkify=function(e){return n.fn&&n.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},s.resizeAndCrop=function(e,t,s){var o=new i.Image;o.onload=function(){var e=[0,0],o=i.document.createElement("canvas"),n=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],n.fillStyle="#fff",n.fillRect(0,0,t,t),n.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),s(o.toDataURL("image/jpeg"))},o.src=e},s.folderListOptionsBuilder=function(e,t,o,n,a,l,c,u,d,p){var h=null,g=!1,m=0,f=0,b="   ",y=[];for(d=s.isNormal(d)?d:0m;m++)y.push({id:n[m][0],name:n[m][1],system:!1,seporator:!1,disabled:!1});for(g=!0,m=0,f=e.length;f>m;m++)h=e[m],(c?c.call(null,h):!0)&&(g&&0m;m++)h=t[m],(h.subScribed()||!h.existen)&&(c?c.call(null,h):!0)&&(r.FolderType.User===h.type()||!d||01||c>0&&l>c){for(l>c?(u(c),o=c,n=c):((3>=l||l>=c-2)&&(a+=2),u(l),o=l,n=l);a>0;)if(o-=1,n+=1,o>0&&(u(o,!1),a--),c>=n)u(n,!0),a--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(i.Math.round((o-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(i.Math.round((c+n)/2),!0,"..."),o>1&&u(1,!1),c>n&&u(c,!0)}return r}},s.selectElement=function(e){var t,s;i.getSelection?(t=i.getSelection(),t.removeAllRanges(),s=i.document.createRange(),s.selectNodeContents(e),t.addRange(s)):i.document.selection&&(s=i.document.body.createTextRange(),s.moveToElementText(e),s.select())},s.detectDropdownVisibility=o.debounce(function(){c.dropdownVisibility(!!o.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){n(".checkAutocomplete").trigger("change")};(s.isUnd(e)?1:!e)?t():o.delay(t,100)},e.exports=s}(t,e)},{$:20,"App:Knoin":27,Consts:6,Enums:7,Globals:9,"Model:Email":37,_:25,ko:22,window:26}],15:[function(e,t){t.exports=JSON},{}],16:[function(e,t){t.exports=Jua},{}],17:[function(e,t){t.exports=crossroads},{}],18:[function(e,t){t.exports=hasher},{}],19:[function(e,t){t.exports=ifvisible},{}],20:[function(e,t){t.exports=$},{}],21:[function(e,t){t.exports=key},{}],22:[function(e,t){!function(t,s){"use strict";var i=e("window"),o=e("_"),n=e("$");s.bindingHandlers.tooltip={init:function(t,i){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=n(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":''+a.i18n(s.utils.unwrapObservable(i()))+""}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},s.bindingHandlers.tooltip2={init:function(t,s){var i=e("Globals"),o=n(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||i.dropdownVisibility()?"":''+s()()+""}}).click(function(){o.tooltip("hide")}),i.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},s.bindingHandlers.tooltip3={init:function(t){var s=n(t),o=e("Globals");s.tooltip({container:"body",trigger:"hover manual",title:function(){return s.data("tooltip3-data")||""}}),n(i.document).click(function(){s.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){s.tooltip("hide")})},update:function(e,t){var i=s.utils.unwrapObservable(t());""===i?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",i).tooltip("show")}},s.bindingHandlers.registrateBootstrapDropdown={init:function(t){var s=e("Globals");s.aBootstrapDropdowns.push(n(t))}},s.bindingHandlers.openDropdownTrigger={update:function(t,i){if(s.utils.unwrapObservable(i())){var o=n(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),i()(!1)}}},s.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},s.bindingHandlers.popover={init:function(e,t){n(e).popover(s.utils.unwrapObservable(t()))}},s.bindingHandlers.csstext={init:function(t,i){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(i()):n(t).text(s.utils.unwrapObservable(i()))},update:function(t,i){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(i()):n(t).text(s.utils.unwrapObservable(i()))}},s.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},s.bindingHandlers.onEnter={init:function(e,t,s,o){n(e).on("keypress",function(s){s&&13===i.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},s.bindingHandlers.onEsc={init:function(e,t,s,o){n(e).on("keypress",function(s){s&&27===i.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},s.bindingHandlers.clickOnTrue={update:function(e,t){s.utils.unwrapObservable(t())&&n(e).click()}},s.bindingHandlers.modal={init:function(t,i){var o=e("Globals"),a=e("Utils");n(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:s.utils.unwrapObservable(i())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){i()(!1)})},update:function(e,t){n(e).modal(s.utils.unwrapObservable(t())?"show":"hide")}},s.bindingHandlers.i18nInit={init:function(t){var s=e("Utils");s.i18nToNode(t)}},s.bindingHandlers.i18nUpdate={update:function(t,i){var o=e("Utils");s.utils.unwrapObservable(i()),o.i18nToNode(t)}},s.bindingHandlers.link={update:function(e,t){n(e).attr("href",s.utils.unwrapObservable(t()))}},s.bindingHandlers.title={update:function(e,t){n(e).attr("title",s.utils.unwrapObservable(t()))}},s.bindingHandlers.textF={init:function(e,t){n(e).text(s.utils.unwrapObservable(t()))}},s.bindingHandlers.initDom={init:function(e,t){t()(e)}},s.bindingHandlers.initResizeTrigger={init:function(e,t){var i=s.utils.unwrapObservable(t());n(e).css({height:i[1],"min-height":i[1]})},update:function(t,i){var o=e("Utils"),a=e("Globals"),r=s.utils.unwrapObservable(i()),l=o.pInt(r[1]),c=0,u=n(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},s.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(s.utils.unwrapObservable(t())).show()}},s.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,d=a(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){n(p).each(function(){var t=null,s=null,o=n(this),a=o.offset(),r=a.top+o.height();i.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",i.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(s=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",i.setInterval(s,10)),s()))})},h.stop=function(){n(p).each(function(){i.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return o()(e&&e.target?s.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},s.bindingHandlers.droppable={init:function(t,s,i){var o=e("Globals");if(!o.bMobileDevice){var a=s(),r=i(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},s.bindingHandlers.nano={init:function(t){var s=e("Globals");s.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},s.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var i=s.utils.unwrapObservable(t()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(i.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(i.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},s.bindingHandlers.emailsTags={init:function(t,s,i){var a=e("Utils"),r=e("Model:Email"),l=n(t),c=s(),u=i(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),s=null;return""!==t?(s=new r,s.mailsoParse(t),s.clearDuplicateName(),[s.toLine(!1),s]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,i){var o=n(e),a=i(),r=a.emailsTagsFilter||null,l=s.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&s.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},s.bindingHandlers.contactTags={init:function(t,s,i){var a=e("Utils"),r=e("Model:ContactTag"),l=n(t),c=s(),u=i(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),s=null;return""!==t?(s=new r,s.name(t),[s.toLine(!1),s]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,i){var o=n(e),a=i(),r=a.contactTagsFilter||null,l=s.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&s.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},s.bindingHandlers.command={init:function(e,t,i,o){var a=n(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),s.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var s=!0,i=n(e),o=t();s=o.enabled(),i.toggleClass("command-not-enabled",!s),s&&(s=o.canExecute(),i.toggleClass("command-can-not-be-execute",!s)),i.toggleClass("command-disabled disable disabled",!s).toggleClass("no-disabled",!!s),(i.is("input")||i.is("button"))&&i.prop("disabled",!s)}},s.extenders.trimmer=function(t){var i=e("Utils"),o=s.computed({read:t,write:function(e){t(i.trim(e.toString()))},owner:this});return o(t()),o},s.extenders.posInterer=function(t,i){var o=e("Utils"),n=s.computed({read:t,write:function(e){var s=o.pInt(e.toString(),i);0>=s&&(s=i),s===t()&&""+s!=""+e&&t(s+1),t(s)}});return n(t()),n},s.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},s.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},s.extenders.falseTimeout=function(t,s){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(i.clearTimeout(t.iTimeout),t.iTimeout=i.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(s)))}),t},s.observable.fn.validateNone=function(){return this.hasError=s.observable(!1),this},s.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateFunc=function(t){var i=e("Utils");return this.hasFuncError=s.observable(!1),i.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=s}(t,ko)},{$:20,Globals:9,"Model:ContactTag":36,"Model:Email":37,Utils:14,_:25,window:26}],23:[function(e,t){t.exports=moment},{}],24:[function(e,t){t.exports=ssm},{}],25:[function(e,t){t.exports=_},{}],26:[function(e,t){t.exports=window},{}],27:[function(e,t){!function(e,t){"use strict";function s(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var i=t("_"),o=t("$"),n=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils");s.prototype.oScreens={},s.prototype.sDefaultScreenName="",s.prototype.oCurrentScreen=null,s.prototype.hideLoading=function(){o("#rl-loading").hide()},s.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},s.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},s.prototype.addSettingsViewModel=function(e,t,s,i,o){e.__rlSettingsData={Label:s,Template:t,Route:i,IsDefault:!!o},l.aViewModels.settings.push(e)},s.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},s.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},s.prototype.routeOff=function(){a.changed.active=!1},s.prototype.routeOn=function(){a.changed.active=!0},s.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},s.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var s=this,a=new e(t),r=a.viewModelPosition(),d=o("#rl-content #rl-"+r.toLowerCase()),p=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,a.viewModelNames=e.__names,d&&1===d.length?(p=o("
").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),p.appendTo(d),a.viewModelDom=p,e.__dom=p,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){s.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),i.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),i.delay(function(){t.viewModelDom.hide()},300))},a)),i.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,a,p])}),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[p]),a&&"Popups"===r&&a.registerPopupKeyDown(),i.each(e.__names,function(e){c.runHook("view-model-post-build",[e,a,p])})):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},s.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},s.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),i.each(e.__names,function(s){c.runHook("view-model-on-show",[s,e.__vm,t||[]])})))},s.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},s.prototype.screenOnRoute=function(e,t){var s=this,o=null,n=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&i.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),i.defer(function(){s.oCurrentScreen&&(u.delegateRun(s.oCurrentScreen,"onHide"),u.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=o,s.oCurrentScreen&&(u.delegateRun(s.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),u.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),i.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},s)),n=o.__cross?o.__cross():null,n&&n.parse(t)})))},s.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),i.each(e,function(e){var t=new e,s=t?t.screenName():"";t&&""!==s&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=s),this.oScreens[s]=t)},this),i.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),o("#rl-content").css({visibility:"visible"}),i.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},s.prototype.setHash=function(e,t,s){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,s=u.isUnd(s)?!1:!!s,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[s?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[s?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new s}(t,e)},{$:20,Globals:9,Plugins:12,Utils:14,_:25,crossroads:17,hasher:18,ko:22}],28:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],29:[function(e,t){!function(e,t){"use strict";function s(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var i=t("_"),o=t("crossroads"),n=t("Utils");s.prototype.oCross=null,s.prototype.sScreenName="",s.prototype.aViewModels=[],s.prototype.viewModels=function(){return this.aViewModels},s.prototype.screenName=function(){return this.sScreenName},s.prototype.routes=function(){return null},s.prototype.__cross=function(){return this.oCross},s.prototype.__start=function(){var e=this.routes(),t=null,s=null;n.isNonEmptyArray(e)&&(s=i.bind(this.onRoute||n.emptyFunction,this),t=o.create(),i.each(e,function(e){t.addRoute(e[0],s).rules=e[1]}),this.oCross=t)},e.exports=s}(t,e)},{Utils:14,_:25,crossroads:17}],30:[function(e,t){!function(e,t){"use strict";function s(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=n.pString(e),this.sTemplate=n.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelVisibility=i.observable(!1),this.modalVisibility=i.observable(!1).extend({rateLimit:0}),this.viewModelName="",this.viewModelNames=[],this.viewModelDom=null}var i=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Globals");s.prototype.bDisabeCloseOnEsc=!1,s.prototype.sPosition="",s.prototype.sTemplate="",s.prototype.sDefaultKeyScope=o.KeyState.None,s.prototype.sCurrentKeyScope=o.KeyState.None,s.prototype.viewModelName="",s.prototype.viewModelNames=[],s.prototype.viewModelDom=null,s.prototype.viewModelTemplate=function(){return this.sTemplate},s.prototype.viewModelPosition=function(){return this.sPosition},s.prototype.cancelCommand=function(){},s.prototype.closeCommand=function(){},s.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},s.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},s.prototype.registerPopupKeyDown=function(){var e=this;a.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return n.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!n.inFocus())return!1}return!0})},e.exports=s}(t,e)},{Enums:7,Globals:9,Utils:14,ko:22}],31:[function(e,t){!function(e,t){"use strict";function s(e,t){this.email=e,this.deleteAccess=i.observable(!1),this.canBeDalete=i.observable(o.isUnd(t)?!0:!!t)}var i=t("ko"),o=t("Utils");s.prototype.email="",s.prototype.changeAccountLink=function(){return t("LinkBuilder").change(this.email)},e.exports=s}(t,e)},{LinkBuilder:11,Utils:14,ko:22}],32:[function(e,t){!function(e,t){"use strict";function s(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var i=t("window"),o=t("Globals"),n=t("Utils"),a=t("LinkBuilder");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.prototype.mimeType="",s.prototype.fileName="",s.prototype.estimatedSize=0,s.prototype.friendlySize="",s.prototype.isInline=!1,s.prototype.isLinked=!1,s.prototype.cid="",s.prototype.cidWithOutTags="",s.prototype.contentLocation="",s.prototype.download="",s.prototype.folder="",s.prototype.uid="",s.prototype.mimeIndex="",s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},s.prototype.isImage=function(){return-1,]+)>?,? ?/g,s=t.exec(e);s?(this.name=s[1]||"",this.email=s[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=i.trim(e.Name),this.email=i.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},s.prototype.toLine=function(e,t,s){var o="";return""!==this.email&&(t=i.isUnd(t)?!1:!!t,s=i.isUnd(s)?!1:!!s,e&&""!==this.name?o=t?'
")+'" target="_blank" tabindex="-1">'+i.encodeHtml(this.name)+"":s?i.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=i.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(o)+""+i.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",s&&(o=i.encodeHtml(o))):t&&(o=''+i.encodeHtml(this.email)+""))),o},s.prototype.mailsoParse=function(e){if(e=i.trim(e),""===e)return!1;for(var t=function(e,t,s){e+="";var i=e.length;return 0>t&&(t+=i),i="undefined"==typeof s?i:0>s?s+i:s+t,t>=e.length||0>t||t>i?!1:e.slice(t,i)},s=function(e,t,s,i){return 0>s&&(s+=e.length),i=void 0!==i?i:e.length,0>i&&(i=i+e.length-s),e.slice(0,s)+t.substr(0,i)+t.slice(i)+e.slice(s+i)},o="",n="",a="",r=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===o.length&&(o=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":r||l||c||(c=!0,d=h);break;case")":c&&(p=h,a=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===a.length&&(o=e.replace(n,"")),n=i.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=i.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),a=i.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},s.prototype.inputoTagLine=function(){return 00){if(n.FolderType.Draft===s)return""+e;if(t>0&&n.FolderType.Trash!==s&&n.FolderType.Archive!==s&&n.FolderType.SentItems!==s)return""+t}return""},this),this.canBeDeleted=o.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=o.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.localName=o.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case n.FolderType.Inbox:t=r.i18n("FOLDER_LIST/INBOX_NAME");break;case n.FolderType.SentItems:t=r.i18n("FOLDER_LIST/SENT_NAME");break;case n.FolderType.Draft:t=r.i18n("FOLDER_LIST/DRAFTS_NAME");break;case n.FolderType.Spam:t=r.i18n("FOLDER_LIST/SPAM_NAME");break;case n.FolderType.Trash:t=r.i18n("FOLDER_LIST/TRASH_NAME");break;case n.FolderType.Archive:t=r.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=o.computed(function(){a.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case n.FolderType.Inbox:e="("+r.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case n.FolderType.SentItems:e="("+r.i18n("FOLDER_LIST/SENT_NAME")+")";break;case n.FolderType.Draft:e="("+r.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case n.FolderType.Spam:e="("+r.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case n.FolderType.Trash:e="("+r.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case n.FolderType.Archive:e="("+r.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+s+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=o.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=o.computed(function(){return 0"},s.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},s.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+o.quoteName(e)+'" <'+this.email()+">"},e.exports=s}(t,e)},{Utils:14,ko:22}],42:[function(e,t){!function(e,t){"use strict";function s(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=a.observable(""),this.subjectPrefix=a.observable(""),this.subjectSuffix=a.observable(""),this.size=a.observable(0),this.dateTimeStampInUTC=a.observable(0),this.priority=a.observable(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=a.observable(""),this.fromClearEmailString=a.observable(""),this.toEmailsString=a.observable(""),this.toClearEmailsString=a.observable(""),this.senderEmailsString=a.observable(""),this.senderClearEmailsString=a.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=a.observable(!1),this.deleted=a.observable(!1),this.unseen=a.observable(!1),this.flagged=a.observable(!1),this.answered=a.observable(!1),this.forwarded=a.observable(!1),this.isReadReceipt=a.observable(!1),this.focused=a.observable(!1),this.selected=a.observable(!1),this.checked=a.observable(!1),this.hasAttachments=a.observable(!1),this.attachmentsMainType=a.observable(""),this.moment=a.observable(r(r.unix(0))),this.attachmentIconClass=a.computed(function(){var e="";if(this.hasAttachments())switch(e="icon-attachment",this.attachmentsMainType()){case"image":e="icon-image";break;case"archive":e="icon-file-zip";break;case"doc":e="icon-file-text"}return e},this),this.fullFormatDateValue=a.computed(function(){return s.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=c.createMomentDate(this),this.momentShortDate=c.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=r().unix();this.moment(r.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=a.observable(!1),this.hasImages=a.observable(!1),this.attachments=a.observableArray([]),this.isPgpSigned=a.observable(!1),this.isPgpEncrypted=a.observable(!1),this.pgpSignedVerifyStatus=a.observable(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser=a.observable(""),this.priority=a.observable(l.MessagePriority.Normal),this.readReceipt=a.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=a.observable(0),this.threads=a.observableArray([]),this.threadsLen=a.observable(0),this.hasUnseenSubMessage=a.observable(!1),this.hasFlaggedSubMessage=a.observable(!1),this.lastInCollapsedThread=a.observable(!1),this.lastInCollapsedThreadLoading=a.observable(!1),this.threadsLenResult=a.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var i=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("moment"),l=t("Enums"),c=t("Utils"),u=t("Globals"),d=t("LinkBuilder"),p=t("Model:Email"),h=t("Model:Attachment");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.calculateFullFromatDateValue=function(e){return e>0?r.unix(e).format("LLL"):""},s.emailsToLine=function(e,t,s){var i=[],o=0,n=0;if(c.isNonEmptyArray(e))for(o=0,n=e.length;n>o;o++)i.push(e[o].toLine(t,s));return i.join(", ")},s.emailsToLineClear=function(e){var t=[],s=0,i=0;if(c.isNonEmptyArray(e))for(s=0,i=e.length;i>s;s++)e[s]&&e[s].email&&""!==e[s].name&&t.push(e[s].email);return t.join(", ")},s.initEmailsFromJson=function(e){var t=0,s=0,i=null,o=[];if(c.isNonEmptyArray(e))for(t=0,s=e.length;s>t;t++)i=p.newInstanceFromJson(e[t]),i&&o.push(i);return o},s.replyHelper=function(e,t,s){if(e&&0i;i++)c.isUnd(t[e[i].email])&&(t[e[i].email]=!0,s.push(e[i]))},s.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(l.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},s.prototype.friendlySize=function(){return c.friendlySize(this.size())},s.prototype.computeSenderEmail=function(){var e=t("Storage:RainLoop:Data"),s=e.sentFolder(),i=e.draftFolder();this.senderEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===i?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===i?this.toClearEmailsString():this.fromClearEmailString())},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(c.pInt(e.Size)),this.from=s.initEmailsFromJson(e.From),this.to=s.initEmailsFromJson(e.To),this.cc=s.initEmailsFromJson(e.Cc),this.bcc=s.initEmailsFromJson(e.Bcc),this.replyTo=s.initEmailsFromJson(e.ReplyTo),this.deliveredTo=s.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),c.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(c.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(s.emailsToLine(this.from,!0)),this.fromClearEmailString(s.emailsToLineClear(this.from)),this.toEmailsString(s.emailsToLine(this.to,!0)),this.toClearEmailsString(s.emailsToLineClear(this.to)),this.parentUid(c.pInt(e.ParentThread)),this.threads(c.isArray(e.Threads)?e.Threads:[]),this.threadsLen(c.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},s.prototype.initUpdateByMessageJson=function(e){var s=t("Storage:RainLoop:Data"),i=!1,o=l.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(o=c.pInt(e.Priority),this.priority(-1t;t++)i=h.newInstanceFromJson(e["@Collection"][t]),i&&(""!==i.cidWithOutTags&&0+$/,""),t=o.find(s,function(t){return e===t.cidWithOutTags})),t||null},s.prototype.findAttachmentByContentLocation=function(e){var t=null,s=this.attachments();return c.isNonEmptyArray(s)&&(t=o.find(s,function(t){return e===t.contentLocation})),t||null},s.prototype.messageId=function(){return this.sMessageId},s.prototype.inReplyTo=function(){return this.sInReplyTo},s.prototype.references=function(){return this.sReferences},s.prototype.fromAsSingleEmail=function(){return c.isArray(this.from)&&this.from[0]?this.from[0].email:""},s.prototype.viewLink=function(){return d.messageViewLink(this.requestHash)},s.prototype.downloadLink=function(){return d.messageDownloadLink(this.requestHash)},s.prototype.replyEmails=function(e){var t=[],i=c.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,i,t),0===t.length&&s.replyHelper(this.from,i,t),t},s.prototype.replyAllEmails=function(e){var t=[],i=[],o=c.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,o,t),0===t.length&&s.replyHelper(this.from,o,t),s.replyHelper(this.to,o,t),s.replyHelper(this.cc,o,i),[t,i]},s.prototype.textBodyToString=function(){return this.body?this.body.html():""},s.prototype.attachmentsToStringLine=function(){var e=o.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&i&&!o&&s.attr("src",i)}),e&&i.setTimeout(function(){t.print()},100))})},s.prototype.printMessage=function(){this.viewPopupMessage(!0)},s.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},s.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(l.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},s.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=c.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",n("["+t+"]",this.body).each(function(){e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",n(this).attr(t)).removeAttr(t):n(this).attr("src",n(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",n("["+t+"]",this.body).each(function(){var e=c.trim(n(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+n(this).attr(t)).removeAttr(t)}),e&&(n("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:n(".RL-MailMessageView .messageView .messageItem .content")[0]}),u.$win.resize()),c.windowResize(500)}},s.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=c.isUnd(e)?!1:e;var t=this;n("[data-x-src-cid]",this.body).each(function(){var s=t.findAttachmentByCid(n(this).attr("data-x-src-cid"));s&&s.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",s.linkPreview()):n(this).attr("src",s.linkPreview()))}),n("[data-x-src-location]",this.body).each(function(){var s=t.findAttachmentByContentLocation(n(this).attr("data-x-src-location"));s||(s=t.findAttachmentByCid(n(this).attr("data-x-src-location"))),s&&s.download&&(e&&n(this).is("img")?n(this).addClass("lazy").attr("data-original",s.linkPreview()):n(this).attr("src",s.linkPreview()))}),n("[data-x-style-cid]",this.body).each(function(){var e="",s="",i=t.findAttachmentByCid(n(this).attr("data-x-style-cid"));i&&i.linkPreview&&(s=n(this).attr("data-x-style-cid-name"),""!==s&&(e=c.trim(n(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",n(this).attr("style",e+s+": url('"+i.linkPreview()+"')")))}),e&&!function(e,t){o.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(n("img.lazy",t.body),n(".RL-MailMessageView .messageView .messageItem .content")[0]),c.windowResize(500)}},s.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw); +var e=t("Storage:RainLoop:Data");e.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},s.prototype.storePgpVerifyDataToDom=function(){var e=t("Storage:RainLoop:Data");this.body&&e.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},s.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=c.pString(this.body.data("rl-plain-raw"));var e=t("Storage:RainLoop:Data");e.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},s.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],s=null,a=t("Storage:RainLoop:Data"),r=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",c=a.findPublicKeysByEmail(r),d=null,p=null,h="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{s=i.openpgp.cleartext.readArmored(this.plainRaw),s&&s.getText&&(this.pgpSignedVerifyStatus(c.length?l.SignedVerifyStatus.Unverified:l.SignedVerifyStatus.UnknownPublicKeys),e=s.verify(c),e&&0').text(h)).html(),u.$div.empty(),this.replacePlaneTextBody(h)))))}catch(g){}this.storePgpVerifyDataToDom()}},s.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var s=[],a=null,r=null,c=t("Storage:RainLoop:Data"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=c.findPublicKeysByEmail(d),h=c.findSelfPrivateKey(e),g=null,m=null,f="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(l.SignedVerifyStatus.UnknownPrivateKey);try{a=i.openpgp.message.readArmored(this.plainRaw),a&&h&&a.decrypt&&(this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Unverified),r=a.decrypt(h),r&&(s=r.verify(p),s&&0').text(f)).html(),u.$div.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},s.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},s.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},e.exports=s}(t,e)},{$:20,Enums:7,Globals:9,LinkBuilder:11,"Model:Attachment":32,"Model:Email":37,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,moment:23,window:26}],43:[function(e,t){!function(e,t){"use strict";function s(e,t,s,o,n,a,r){this.index=e,this.id=s,this.guid=t,this.user=o,this.email=n,this.armor=r,this.isPrivate=!!a,this.deleteAccess=i.observable(!1)}var i=t("ko");s.prototype.index=0,s.prototype.id="",s.prototype.guid="",s.prototype.user="",s.prototype.email="",s.prototype.armor="",s.prototype.isPrivate=!1,e.exports=s}(t,e)},{ko:22}],44:[function(e,t){!function(e,t){"use strict";function s(){o.call(this,"about",[t("View:RainLoop:About")])}var i=t("_"),o=t("Knoin:AbstractScreen");i.extend(s.prototype,o.prototype),s.prototype.onShow=function(){t("App:RainLoop").setTitle("RainLoop")},e.exports=s}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:About":70,_:25}],45:[function(e,t){!function(e,t){"use strict";function s(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var i=t("_"),o=t("$"),n=t("ko"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("App:Knoin"),u=t("Knoin:AbstractScreen");i.extend(s.prototype,u.prototype),s.prototype.onRoute=function(e){var t=this,s=null,u=null,d=null,p=null;u=i.find(a.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(i.find(a.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&i.find(a.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?s=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(s=new u,p=o("
").addClass("rl-settings-view-model").hide(),p.appendTo(d),s.viewModelDom=p,s.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=s,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},s),r.delegateRun(s,"onBuild",[p])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),s&&i.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=s,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),i.each(t.menu(),function(e){e.selected(s&&s.__rlSettingsData&&e.route===s.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},s.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},s.prototype.onBuild=function(){i.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!i.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!i.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},s.prototype.routes=function(){var e=i.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",s={subname:/^(.*)$/,normalize_:function(e,s){return s.subname=r.isUnd(s.subname)?t:r.pString(s.subname),[s.subname]}};return[["{subname}/",s],["{subname}",s],["",s]]},e.exports=s}(t,e)},{$:20,"App:Knoin":27,Globals:9,"Knoin:AbstractScreen":29,LinkBuilder:11,Utils:14,_:25,ko:22}],46:[function(e,t){!function(e,t){"use strict";function s(){o.call(this,"login",[t("View:RainLoop:Login")])}var i=t("_"),o=t("Knoin:AbstractScreen");i.extend(s.prototype,o.prototype),s.prototype.onShow=function(){t("App:RainLoop").setTitle("")},e.exports=s}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":29,"View:RainLoop:Login":72,_:25}],47:[function(e,t){!function(e,t){"use strict";function s(){l.call(this,"mailbox",[t("View:RainLoop:MailBoxSystemDropDown"),t("View:RainLoop:MailBoxFolderList"),t("View:RainLoop:MailBoxMessageList"),t("View:RainLoop:MailBoxMessageView")]),this.oLastRoute={}}var i=t("_"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Events"),l=t("Knoin:AbstractScreen"),c=t("Storage:Settings"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Cache"),p=t("Storage:RainLoop:Remote");i.extend(s.prototype,l.prototype),s.prototype.oLastRoute={},s.prototype.setNewTitle=function(){var e=u.accountEmail(),s=u.foldersInboxUnreadCount();t("App:RainLoop").setTitle((""===e?"":(s>0?"("+s+") ":" ")+e+" - ")+a.i18n("TITLES/MAILBOX"))},s.prototype.onShow=function(){this.setNewTitle(),n.keyScope(o.KeyState.MessageList)},s.prototype.onRoute=function(e,s,i,n){if(a.isUnd(n)?1:!n){var r=d.getFolderFullNameRaw(e),l=d.getFolderFromCacheList(r);l&&(u.currentFolder(l).messageListPage(s).messageListSearch(i),o.Layout.NoPreview===u.layout()&&u.message()&&u.message(null),t("App:RainLoop").reloadMessageList())}else o.Layout.NoPreview!==u.layout()||u.message()||t("App:RainLoop").historyBack()},s.prototype.onStart=function(){var e=function(){a.windowResize()};(c.capa(o.Capa.AdditionalAccounts)||c.capa(o.Capa.AdditionalIdentities))&&t("App:RainLoop").accountsAndIdentities(),i.delay(function(){"INBOX"!==u.currentFolderFullNameRaw()&&t("App:RainLoop").folderInformation("INBOX")},1e3),i.delay(function(){t("App:RainLoop").quota()},5e3),i.delay(function(){p.appDelayStart(a.emptyFunction)},35e3),n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===u.layout()),u.folderList.subscribe(e),u.messageList.subscribe(e),u.message.subscribe(e),u.layout.subscribe(function(e){n.$html.toggleClass("rl-no-preview-pane",o.Layout.NoPreview===e)}),r.sub("mailbox.inbox-unread-count",function(e){u.foldersInboxUnreadCount(e)}),u.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},s.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},s=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:s}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},e.exports=s}(t,e)},{"App:RainLoop":3,Enums:7,Events:8,Globals:9,"Knoin:AbstractScreen":29,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:RainLoop:MailBoxFolderList":73,"View:RainLoop:MailBoxMessageList":74,"View:RainLoop:MailBoxMessageView":75,"View:RainLoop:MailBoxSystemDropDown":76,_:25}],48:[function(e,t){!function(e,t){"use strict";function s(){r.call(this,[t("View:RainLoop:SettingsSystemDropDown"),t("View:RainLoop:SettingsMenu"),t("View:RainLoop:SettingsPane")]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){this.setSettingsTitle()})}var i=t("_"),o=t("Enums"),n=t("Utils"),a=t("Globals"),r=t("Screen:AbstractSettings");i.extend(s.prototype,r.prototype),s.prototype.onShow=function(){this.setSettingsTitle(),a.keyScope(o.KeyState.Settings)},s.prototype.setSettingsTitle=function(){t("App:RainLoop").setTitle(this.sSettingsTitle)},e.exports=s}(t,e)},{"App:RainLoop":3,Enums:7,Globals:9,"Screen:AbstractSettings":45,Utils:14,"View:RainLoop:SettingsMenu":94,"View:RainLoop:SettingsPane":95,"View:RainLoop:SettingsSystemDropDown":96,_:25}],49:[function(e,t){!function(e,t){"use strict";function s(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?r.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var i=t("window"),o=t("_"),n=t("ko"),a=t("Enums"),r=t("Utils"),l=t("LinkBuilder"),c=t("Storage:RainLoop:Data"),u=t("Storage:RainLoop:Remote");s.prototype.addNewAccount=function(){t("App:Knoin").showScreenPopup(t("View:Popup:AddAccount"))},s.prototype.deleteAccount=function(e){if(e&&e.deleteAccess()){this.accountForDeletion(null);var s=t("App:Knoin"),n=function(t){return e===t};e&&(this.accounts.remove(n),u.accountDelete(function(e,n){a.StorageResultType.Success===e&&n&&n.Result&&n.Reload?(s.routeOff(),s.setHash(l.root(),!0),s.routeOff(),o.defer(function(){i.location.reload()})):t("App:RainLoop").accountsAndIdentities()},e.email))}},e.exports=s}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:AddAccount":77,_:25,ko:22,window:26}],50:[function(e,t){!function(e,t){"use strict";function s(){this.changeProcess=o.observable(!1),this.errorDescription=o.observable(""),this.passwordMismatch=o.observable(!1),this.passwordUpdateError=o.observable(!1),this.passwordUpdateSuccess=o.observable(!1),this.currentPassword=o.observable(""),this.currentPassword.error=o.observable(!1),this.newPassword=o.observable(""),this.newPassword2=o.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=a.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(a.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),r.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=i.bind(this.onChangePasswordResponse,this)}var i=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote");s.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},s.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(a.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},e.exports=s}(t,e)},{Enums:7,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],51:[function(e,t){!function(e,t){"use strict";function s(){this.contactsAutosave=a.contactsAutosave,this.allowContactsSync=a.allowContactsSync,this.enableContactsSync=a.enableContactsSync,this.contactsSyncUrl=a.contactsSyncUrl,this.contactsSyncUser=a.contactsSyncUser,this.contactsSyncPass=a.contactsSyncPass,this.saveTrigger=i.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var i=t("ko"),o=t("Utils"),n=t("Storage:RainLoop:Remote"),a=t("Storage:RainLoop:Data");s.prototype.onBuild=function(){a.contactsAutosave.subscribe(function(e){n.saveSettings(o.emptyFunction,{ContactsAutosave:e?"1":"0"})})},e.exports=s}(t,e)},{"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,ko:22}],52:[function(e,t){!function(e,t){"use strict";function s(){this.filters=i.observableArray([]),this.filters.loading=i.observable(!1),this.filters.subscribe(function(){o.windowResize()})}var i=t("ko"),o=t("Utils");s.prototype.deleteFilter=function(e){this.filters.remove(e)},s.prototype.addFilter=function(){var e=t("Model:Filter");t("App:Knoin").showScreenPopup(t("View:Popup:Filter"),[new e])},e.exports=s}(t,e)},{"App:Knoin":27,"Model:Filter":39,Utils:14,"View:Popup:Filter":84,ko:22}],53:[function(e,t){!function(e,t){"use strict";function s(){this.foldersListError=r.foldersListError,this.folderList=r.folderList,this.processText=i.computed(function(){var e=r.foldersLoading(),t=r.foldersCreating(),s=r.foldersDeleting(),i=r.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):i?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=i.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=i.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=i.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var i=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:Settings"),r=t("Storage:RainLoop:Data"),l=t("Storage:RainLoop:Cache"),c=t("Storage:RainLoop:Remote"),u=t("Storage:LocalStorage");s.prototype.folderEditOnEnter=function(e){var s=e?n.trim(e.nameForEdit()):"";""!==s&&e.name()!==s&&(u.set(o.ClientSideKeyName.FoldersLashHash,""),r.foldersRenaming(!0),c.folderRename(function(e,s){r.foldersRenaming(!1),o.StorageResultType.Success===e&&s&&s.Result||r.foldersListError(s&&s.ErrorCode?n.getNotification(s.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw,s),l.removeFolderFromCacheList(e.fullNameRaw),e.name(s)),e.edited(!1)},s.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},s.prototype.onShow=function(){r.foldersListError("")},s.prototype.createFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderCreate"))},s.prototype.systemFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderSystem"))},s.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var s=function(t){return e===t?!0:(t.subFolders.remove(s),!1)};e&&(u.set(o.ClientSideKeyName.FoldersLashHash,""),r.folderList.remove(s),r.foldersDeleting(!0),c.folderDelete(function(e,s){r.foldersDeleting(!1),o.StorageResultType.Success===e&&s&&s.Result||r.foldersListError(s&&s.ErrorCode?n.getNotification(s.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw),l.removeFolderFromCacheList(e.fullNameRaw))}else 0"},s.prototype.addNewIdentity=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"))},s.prototype.editIdentity=function(e){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"),[e])},s.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var s=function(t){return e===t};e&&(this.identities.remove(s),c.identityDelete(function(){t("App:RainLoop").accountsAndIdentities()},e.id))}},s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=o.dataFor(this);e&&t.editIdentity(e)}),i.delay(function(){var e=a.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),s=a.settingsSaveHelperSimpleFunction(t.replyTrigger,t),i=a.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),o=a.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);l.defaultIdentityID.subscribe(function(e){c.saveSettings(o,{DefaultIdentityID:e})}),l.displayName.subscribe(function(t){c.saveSettings(e,{DisplayName:t})}),l.replyTo.subscribe(function(e){c.saveSettings(s,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(i,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=s}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Identity":88,_:25,ko:22}],56:[function(e,t){!function(e,t){"use strict";function s(){this.editor=null,this.displayName=l.displayName,this.signature=l.signature,this.signatureToAll=l.signatureToAll,this.replyTo=l.replyTo,this.signatureDom=o.observable(null),this.displayNameTrigger=o.observable(n.SaveSettingsStep.Idle),this.replyTrigger=o.observable(n.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(n.SaveSettingsStep.Idle)}var i=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("HtmlEditor"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Remote");s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(){var e=this;i.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),s=a.settingsSaveHelperSimpleFunction(e.replyTrigger,e),i=a.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);l.displayName.subscribe(function(e){c.saveSettings(t,{DisplayName:e})}),l.replyTo.subscribe(function(e){c.saveSettings(s,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(i,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=s}(t,e)},{Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],57:[function(e,t){!function(e,t){"use strict";function s(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=i.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var i=t("ko"),o=t("App:Knoin"),n=t("Storage:RainLoop:Data");s.prototype.addOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:AddOpenPgpKey"))},s.prototype.generateOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:NewOpenPgpKey"))},s.prototype.viewOpenPgpKey=function(e){e&&o.showScreenPopup(t("View:Popup:ViewOpenPgpKey"),[e])},s.prototype.deleteOpenPgpKey=function(e){e&&e.deleteAccess()&&(this.openPgpKeyForDeletion(null),e&&n.openpgpKeyring&&(this.openpgpkeys.remove(function(t){return e===t}),n.openpgpKeyring[e.isPrivate?"privateKeys":"publicKeys"].removeForId(e.guid),n.openpgpKeyring.store(),t("App:RainLoop").reloadOpenPgpKeys()))},e.exports=s}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Storage:RainLoop:Data":64,"View:Popup:AddOpenPgpKey":78,"View:Popup:NewOpenPgpKey":91,"View:Popup:ViewOpenPgpKey":93,ko:22}],58:[function(e,t){!function(e,t){"use strict";function s(){this.processing=i.observable(!1),this.clearing=i.observable(!1),this.secreting=i.observable(!1),this.viewUser=i.observable(""),this.viewEnable=i.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=i.observable(!1),this.viewSecret=i.observable(""),this.viewBackupCodes=i.observable(""),this.viewUrl=i.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=i.computed(function(){return n.langChangeTrigger(),a.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var i=t("ko"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Storage:RainLoop:Remote");s.prototype.showSecret=function(){this.secreting(!0),r.showTwoFactorSecret(this.onSecretResult)},s.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.createTwoFactor=function(){this.processing(!0),r.createTwoFactor(this.onResult)},s.prototype.enableTwoFactor=function(){this.processing(!0),r.enableTwoFactor(this.onResult,this.viewEnable())},s.prototype.testTwoFactor=function(){t("App:Knoin").showScreenPopup(t("View:Popup:TwoFactorTest"))},s.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),r.clearTwoFactor(this.onResult)},s.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(a.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(a.pString(t.Result.Secret)),this.viewBackupCodes(a.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(a.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var s=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&r.enableTwoFactor(function(e,t){o.StorageResultType.Success===e&&t&&t.Result||(s.viewEnable.subs=!1,s.viewEnable(!1),s.viewEnable.subs=!0)},e)},this)}},s.prototype.onSecretResult=function(e,t){this.secreting(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(a.pString(t.Result.Secret)),this.viewUrl(a.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},s.prototype.onBuild=function(){this.processing(!0),r.getTwoFactor(this.onResult)},e.exports=s}(t,e)},{"App:Knoin":27,Enums:7,Globals:9,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:TwoFactorTest":92,ko:22}],59:[function(e,t){!function(e,t){"use strict";function s(){var e=t("Utils"),s=t("Storage:RainLoop:Data");this.googleEnable=s.googleEnable,this.googleActions=s.googleActions,this.googleLoggined=s.googleLoggined,this.googleUserName=s.googleUserName,this.facebookEnable=s.facebookEnable,this.facebookActions=s.facebookActions,this.facebookLoggined=s.facebookLoggined,this.facebookUserName=s.facebookUserName,this.twitterEnable=s.twitterEnable,this.twitterActions=s.twitterActions,this.twitterLoggined=s.twitterLoggined,this.twitterUserName=s.twitterUserName,this.connectGoogle=e.createCommand(this,function(){this.googleLoggined()||t("App:RainLoop").googleConnect() +},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=e.createCommand(this,function(){t("App:RainLoop").googleDisconnect()}),this.connectFacebook=e.createCommand(this,function(){this.facebookLoggined()||t("App:RainLoop").facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=e.createCommand(this,function(){t("App:RainLoop").facebookDisconnect()}),this.connectTwitter=e.createCommand(this,function(){this.twitterLoggined()||t("App:RainLoop").twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=e.createCommand(this,function(){t("App:RainLoop").twitterDisconnect()})}e.exports=s}(t,e)},{"App:RainLoop":3,"Storage:RainLoop:Data":64,Utils:14}],60:[function(e,t){!function(e,t){"use strict";function s(){var e=this;this.mainTheme=u.mainTheme,this.themesObjects=a.observableArray([]),this.themeTrigger=a.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,u.theme.subscribe(function(t){o.each(this.themesObjects(),function(e){e.selected(t===e.name)});var s=n("#rlThemeLink"),a=n("#rlThemeStyle"),c=s.attr("href");c||(c=a.attr("data-href")),c&&(c=c.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),c=c.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==c.substring(c.length-5,c.length)&&(c+="Json/"),i.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=n.ajax({url:c,dataType:"json"}).done(function(t){t&&l.isArray(t)&&2===t.length&&(!s||!s[0]||a&&a[0]||(a=n(''),s.after(a),s.remove()),a&&a[0]&&(a.attr("data-href",c).attr("data-theme",t[0]),a&&a[0]&&a[0].styleSheet&&!l.isUnd(a[0].styleSheet.cssText)?a[0].styleSheet.cssText=t[1]:a.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=i.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),d.saveSettings(null,{Theme:t})},this)}var i=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("Enums"),l=t("Utils"),c=t("LinkBuilder"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Remote");s.prototype.onBuild=function(){var e=u.theme();this.themesObjects(o.map(u.themes(),function(t){return{name:t,nameDisplay:l.convertThemeName(t),selected:a.observable(t===e),themePreviewSrc:c.themePreviewLink(t)}}))},e.exports=s}(t,e)},{$:20,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22,window:26}],61:[function(e,t){!function(e,t){"use strict";function s(){o.initDataConstructorBySettings(this)}var i=t("Enums"),o=t("Utils"),n=t("Storage:Settings");s.prototype.populateDataOnStart=function(){var e=o.pInt(n.settingsGet("Layout")),t=n.settingsGet("Languages"),s=n.settingsGet("Themes");o.isArray(t)&&this.languages(t),o.isArray(s)&&this.themes(s),this.mainLanguage(n.settingsGet("Language")),this.mainTheme(n.settingsGet("Theme")),this.capaAdditionalAccounts(n.capa(i.Capa.AdditionalAccounts)),this.capaAdditionalIdentities(n.capa(i.Capa.AdditionalIdentities)),this.capaGravatar(n.capa(i.Capa.Gravatar)),this.determineUserLanguage(!!n.settingsGet("DetermineUserLanguage")),this.determineUserDomain(!!n.settingsGet("DetermineUserDomain")),this.capaThemes(n.capa(i.Capa.Themes)),this.allowLanguagesOnLogin(!!n.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!n.settingsGet("AllowLanguagesOnSettings")),this.useLocalProxyForExternalImages(!!n.settingsGet("UseLocalProxyForExternalImages")),this.editorDefaultType(n.settingsGet("EditorDefaultType")),this.showImages(!!n.settingsGet("ShowImages")),this.contactsAutosave(!!n.settingsGet("ContactsAutosave")),this.interfaceAnimation(n.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(n.settingsGet("MPP")),this.desktopNotifications(!!n.settingsGet("DesktopNotifications")),this.useThreads(!!n.settingsGet("UseThreads")),this.replySameFolder(!!n.settingsGet("ReplySameFolder")),this.useCheckboxesInList(!!n.settingsGet("UseCheckboxesInList")),this.layout(i.Layout.SidePreview),-1(new i.Date).getTime()-g),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,s,n,t)}),f&&0=e?1:e},this),this.mainMessageListSearch=a.computed({read:this.messageListSearch,write:function(e){m.setHash(p.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=a.observable(""),this.messageListLoading=a.observable(!1),this.messageListIsNotCompleted=a.observable(!1),this.messageListCompleteLoadingThrottle=a.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=a.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(o.debounce(function(e){o.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new f,this.message=a.observable(null),this.messageLoading=a.observable(!1),this.messageLoadingThrottle=a.observable(!1).extend({throttle:50}),this.message.focused=a.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===this.layout()&&-10?i.Math.ceil(t/e*100):0},this),this.capaOpenPGP=a.observable(!1),this.openpgpkeys=a.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=a.observable(!1),this.googleLoggined=a.observable(!1),this.googleUserName=a.observable(""),this.facebookActions=a.observable(!1),this.facebookLoggined=a.observable(!1),this.facebookUserName=a.observable(""),this.twitterActions=a.observable(!1),this.twitterLoggined=a.observable(!1),this.twitterUserName=a.observable(""),this.customThemeType=a.observable(c.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=o.throttle(this.purgeMessageBodyCache,3e4)}var i=t("window"),o=t("_"),n=t("$"),a=t("ko"),r=t("moment"),l=t("Consts"),c=t("Enums"),u=t("Globals"),d=t("Utils"),p=t("LinkBuilder"),h=t("Storage:Settings"),g=t("Storage:RainLoop:Cache"),m=t("App:Knoin"),f=t("Model:Message"),b=t("Storage:LocalStorage"),y=t("Storage:Abstract:Data");o.extend(s.prototype,y.prototype),s.prototype.purgeMessageBodyCache=function(){var e=0,t=null,s=u.iMessageBodyCacheCount-l.Values.MessageBodyCacheLimit;s>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=n(this);s>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&o.delay(function(){t.find(".rl-cache-purge").remove()},300)))},s.prototype.populateDataOnStart=function(){y.prototype.populateDataOnStart.call(this),this.accountEmail(h.settingsGet("Email")),this.accountIncLogin(h.settingsGet("IncLogin")),this.accountOutLogin(h.settingsGet("OutLogin")),this.projectHash(h.settingsGet("ProjectHash")),this.defaultIdentityID(h.settingsGet("DefaultIdentityID")),this.displayName(h.settingsGet("DisplayName")),this.replyTo(h.settingsGet("ReplyTo")),this.signature(h.settingsGet("Signature")),this.signatureToAll(!!h.settingsGet("SignatureToAll")),this.enableTwoFactor(!!h.settingsGet("EnableTwoFactor")),this.lastFoldersHash=b.get(c.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!h.settingsGet("RemoteSuggestions"),this.devEmail=h.settingsGet("DevEmail"),this.devPassword=h.settingsGet("DevPassword")},s.prototype.initUidNextAndNewMessages=function(e,t,s){if("INBOX"===e&&d.isNormal(t)&&""!==t){if(d.isArray(s)&&03)l(p.notificationMailIcon(),this.accountEmail(),d.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>a;a++)l(p.notificationMailIcon(),f.emailsToLine(f.initEmailsFromJson(s[a].From),!1),s[a].Subject)}g.setFolderUidNext(e,t)}},s.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},s.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],s=10,i=r().unix(),n=i-300,a=[],l=function(t){o.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&n>t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),o.find(a,function(e){var o=g.getFolderFromCacheList(e[1]);return o&&(o.interval=i,t.push(e[1])),s<=t.length}),o.uniq(t)},s.prototype.removeMessagesFromList=function(e,t,s,i){s=d.isNormal(s)?s:"",i=d.isUnd(i)?!1:!!i,t=o.map(t,function(e){return d.pInt(e)});var n=this,a=0,r=this.messageList(),l=g.getFolderFromCacheList(e),c=""===s?null:g.getFolderFromCacheList(s||""),u=this.currentFolderFullNameRaw(),p=this.message(),h=u===e?o.filter(r,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-a?l.messageCountUnread()-a:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),a>0&&c.messageCountUnread(c.messageCountUnread()+a),c.actionBlink(!0)),0100)&&(e.addClass("rl-bq-switcher hidden-bq"),n('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),d.windowResize()}).after("
").before("
"))})}},s.prototype.setMessage=function(e,t){var s=!1,i=!1,o=!1,a=null,r=null,l="",p="",h=!1,m=!1,f=this.messagesBodiesDom(),b=this.message();e&&b&&e.Result&&"Object/Message"===e.Result["@Object"]&&b.folderFullNameRaw===e.Result.Folder&&b.uid===e.Result.Uid&&(this.messageError(""),b.initUpdateByMessageJson(e.Result),g.addRequestedMessage(b.folderFullNameRaw,b.uid),t||b.initFlagsByJson(e.Result),f=f&&f[0]?f:null,f&&(l="rl-mgs-"+b.hash.replace(/[^a-zA-Z0-9]/g,""),r=f.find("#"+l),r&&r[0]?(b.body=r,b.body&&(b.body.data("rl-cache-count",++u.iMessageBodyCacheCount),b.fetchDataToDom())):(i=!!e.Result.HasExternals,o=!!e.Result.HasInternals,a=n('
').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++u.iMessageBodyCacheCount),d.isNormal(e.Result.Html)&&""!==e.Result.Html?(s=!0,p=e.Result.Html.toString()):d.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(s=!1,p=d.plainToHtml(e.Result.Plain.toString(),!1),(b.isPgpSigned()||b.isPgpEncrypted())&&this.capaOpenPGP()&&(b.plainRaw=d.pString(e.Result.Plain),m=/---BEGIN PGP MESSAGE---/.test(b.plainRaw),m||(h=/-----BEGIN PGP SIGNED MESSAGE-----/.test(b.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(b.plainRaw)),u.$div.empty(),h&&b.isPgpSigned()?p=u.$div.append(n('
').text(b.plainRaw)).html():m&&b.isPgpEncrypted()&&(p=u.$div.append(n('
').text(b.plainRaw)).html()),u.$div.empty(),b.isPgpSigned(h),b.isPgpEncrypted(m))):s=!1,a.html(d.linkify(p)).addClass("b-text-part "+(s?"html":"plain")),b.isHtml(!!s),b.hasImages(!!i),b.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),b.pgpSignedVerifyUser(""),b.body=a,b.body&&f.append(b.body),b.storeDataToDom(),o&&b.showInternalImages(!0),b.hasImages()&&this.showImages()&&b.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(b.body),this.hideMessageBodies(),b.body.show(),a&&this.initBlockquoteSwitcher(a)),g.initMessageFlagsFromCache(b),b.unseen()&&u.__APP&&u.__APP.setMessageSeen(b),d.windowResize())},s.prototype.calculateMessageListHash=function(e){return o.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},s.prototype.findPublicKeyByHex=function(e){return o.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},s.prototype.findPublicKeysByEmail=function(e){return o.compact(o.map(this.openpgpkeysPublic(),function(t){var s=null;if(t&&e===t.email)try{if(s=i.openpgp.key.readArmored(t.armor),s&&!s.err&&s.keys&&s.keys[0])return s.keys[0]}catch(o){}return null}))},s.prototype.findPrivateKeyByEmail=function(e,t){var s=null,n=o.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(n)try{s=i.openpgp.key.readArmored(n.armor),s&&!s.err&&s.keys&&s.keys[0]?(s=s.keys[0],s.decrypt(d.pString(t))):s=null}catch(a){s=null}return s},s.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},e.exports=new s}(t,e)},{$:20,"App:Knoin":27,Consts:6,Enums:7,Globals:9,LinkBuilder:11,"Model:Message":42,"Storage:Abstract:Data":61,"Storage:LocalStorage":65,"Storage:RainLoop:Cache":63,"Storage:Settings":69,Utils:14,_:25,ko:22,moment:23,window:26}],65:[function(e,t){!function(e,t){"use strict";function s(){var e=t("_").find([t("Storage:LocalStorage:LocalStorage"),t("Storage:LocalStorage:Cookie")],function(e){return e&&e.supported()});this.oDriver=null,e&&(this.oDriver=new e)}s.prototype.oDriver=null,s.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},s.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new s}(t,e)},{"Storage:LocalStorage:Cookie":66,"Storage:LocalStorage:LocalStorage":67,_:25}],66:[function(e,t){!function(e,t){"use strict";function s(){}var i=t("$"),o=t("JSON"),n=t("Consts"),a=t("Utils");s.supported=function(){return!(!window.navigator||!window.navigator.cookieEnabled)},s.prototype.set=function(e,t){var s=i.cookie(n.Values.ClientSideStorageIndexName),a=!1,r=null;try{r=null===s?null:o.parse(s)}catch(l){}r||(r={}),r[e]=t;try{i.cookie(n.Values.ClientSideStorageIndexName,o.stringify(r),{expires:30}),a=!0}catch(l){}return a},s.prototype.get=function(e){var t=i.cookie(n.Values.ClientSideStorageIndexName),s=null;try{s=null===t?null:o.parse(t),s=s&&!a.isUnd(s[e])?s[e]:null}catch(r){}return s},e.exports=s}(t,e)},{$:20,Consts:6,JSON:15,Utils:14}],67:[function(e,t){!function(e,t){"use strict";function s(){}var i=t("window"),o=t("JSON"),n=t("Consts"),a=t("Utils");s.supported=function(){return!!i.localStorage},s.prototype.set=function(e,t){var s=i.localStorage[n.Values.ClientSideStorageIndexName]||null,a=!1,r=null;try{r=null===s?null:o.parse(s)}catch(l){}r||(r={}),r[e]=t;try{i.localStorage[n.Values.ClientSideStorageIndexName]=o.stringify(r),a=!0}catch(l){}return a},s.prototype.get=function(e){var t=i.localStorage[n.Values.ClientSideStorageIndexName]||null,s=null;try{s=null===t?null:o.parse(t),s=s&&!a.isUnd(s[e])?s[e]:null}catch(r){}return s},e.exports=s}(t,e)},{Consts:6,JSON:15,Utils:14,window:26}],68:[function(e,t){!function(e,t){"use strict";function s(){d.call(this),this.oRequests={}}var i=t("_"),o=t("Utils"),n=t("Consts"),a=t("Globals"),r=t("Base64"),l=t("Storage:Settings"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Data"),d=t("Storage:Abstract:Remote");i.extend(s.prototype,d.prototype),s.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:l.settingsGet("SentFolder"),DraftFolder:l.settingsGet("DraftFolder"),SpamFolder:l.settingsGet("SpamFolder"),TrashFolder:l.settingsGet("TrashFolder"),ArchiveFolder:l.settingsGet("ArchiveFolder")},null,"",["Folders"])},s.prototype.login=function(e,t,s,i,o,n,a,r){this.defaultRequest(e,"Login",{Email:t,Login:s,Password:i,Language:n||"",AdditionalCode:a||"",AdditionalCodeSignMe:r?"1":"0",SignMe:o?"1":"0"})},s.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},s.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},s.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},s.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},s.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},s.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},s.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")
+},s.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)},s.prototype.saveContactsSyncData=function(e,t,s,i,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:s,User:i,Password:o})},s.prototype.accountAdd=function(e,t,s,i){this.defaultRequest(e,"AccountAdd",{Email:t,Login:s,Password:i})},s.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},s.prototype.identityUpdate=function(e,t,s,i,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:s,Name:i,ReplyTo:o,Bcc:n})},s.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},s.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},s.prototype.messageList=function(e,t,s,i,a,l){t=o.pString(t);var d=c.getFolderHash(t);l=o.isUnd(l)?!1:!!l,s=o.isUnd(s)?0:o.pInt(s),i=o.isUnd(s)?20:o.pInt(i),a=o.pString(a),""===d||""!==a&&-1!==a.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:s,Limit:i,Search:a,UidNext:"INBOX"===t?c.getFolderUidNext(t):"",UseThreads:u.threading()&&u.useThreads()?"1":"0",ExpandedThreadUid:u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",l?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,s,i,a,u.projectHash(),d,"INBOX"===t?c.getFolderUidNext(t):"",u.threading()&&u.useThreads()?"1":"0",u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),l?[]:["MessageList"])},s.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},s.prototype.message=function(e,t,s){return t=o.pString(t),s=o.pInt(s),c.getFolderFromCacheList(t)&&s>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,s,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},s.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},s.prototype.composeUploadDrive=function(e,t,s){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:s,Url:t},999e3)},s.prototype.folderInformation=function(e,t,s){var n=!0,r=[];o.isArray(s)&&0-1&&r.eq(o).removeClass("focused"),38===a&&o>0?o--:40===a&&oi)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-i+o+e),!0):!1},s.prototype.messagesDrop=function(e,s){if(e&&s&&s.helper){var i=s.helper.data("rl-folder"),o=u.$html.hasClass("rl-ctrl-key-pressed"),n=s.helper.data("rl-uids");l.isNormal(i)&&""!==i&&l.isArray(n)&&t("App:RainLoop").moveMessagesToFolder(i,n,e.fullNameRaw,o)}},s.prototype.composeClick=function(){m.showScreenPopup(t("View:Popup:Compose"))},s.prototype.createFolder=function(){m.showScreenPopup(t("View:Popup:FolderCreate"))},s.prototype.configureFolders=function(){m.setHash(d.settings("folders"))},s.prototype.contactsClick=function(){this.allowContacts&&m.showScreenPopup(t("View:Popup:Contacts"))},e.exports=s}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:Settings":69,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,"View:Popup:FolderCreate":86,_:25,key:21,ko:22,window:26}],74:[function(e,t){!function(e,t){"use strict";function s(){w.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=y.message,this.messageList=y.messageList,this.folderList=y.folderList,this.currentMessage=y.currentMessage,this.isMessageSelected=y.isMessageSelected,this.messageListSearch=y.messageListSearch,this.messageListError=y.messageListError,this.folderMenuForMove=y.folderMenuForMove,this.useCheckboxesInList=y.useCheckboxesInList,this.mainMessageListSearch=y.mainMessageListSearch,this.messageListEndFolder=y.messageListEndFolder,this.messageListChecked=y.messageListChecked,this.messageListCheckedOrSelected=y.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=y.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=y.messageListCompleteLoadingThrottle,p.initOnStartOrLangChange(function(){this.emptySubjectValue=p.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=y.userQuota,this.userUsageSize=y.userUsageSize,this.userUsageProc=y.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return c.Layout.NoPreview!==y.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=y.messageListEndSearch();return""===e?"":p.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(p.computedPagenatorHelper(y.messageListPage,y.messageListPageCount)),this.checkAll=n.computed({read:function(){return 00&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 01?" ("+(100>e?e:"99+")+")":""},s.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},s.prototype.moveSelectedMessagesToFolder=function(e,s){return this.canBeMoved()&&t("App:RainLoop").moveMessagesToFolder(y.currentFolderFullNameRaw(),y.messageListCheckedOrSelectedUidsWithSubMails(),e,s),!1},s.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),s=y.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",y.currentFolderFullNameRaw()),t.data("rl-uids",s),t.find(".text").text(""+s.length),i.defer(function(){var e=y.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},s.prototype.onMessageResponse=function(e,t,s){y.hideMessageBodies(),y.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?y.setMessage(t,s):c.StorageResultType.Unload===e?(y.message(null),y.messageError("")):c.StorageResultType.Abort!==e&&(y.message(null),y.messageError(p.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},s.prototype.populateMessageBody=function(e){e&&(S.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?y.messageLoading(!0):p.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},s.prototype.setAction=function(e,s,o){var n=[],a=null,r=0;if(p.isUnd(o)&&(o=y.messageListChecked()),n=i.map(o,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},s.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},s.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},s.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(g.sendReadReceiptMessage(u.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),e.isReadReceipt(!0),p.storeMessageFlagsToCache(e),t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache())},e.exports=s}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,_:25,key:21,ko:22}],76:[function(e,t){!function(e,t){"use strict";function s(){n.call(this),o.constructorEnd(this)}var i=t("_"),o=t("App:Knoin"),n=t("View:RainLoop:AbstractSystemDropDown");o.extendAsViewModel(["View:RainLoop:MailBoxSystemDropDown","MailBoxSystemDropDownViewModel"],s),i.extend(s.prototype,n.prototype),e.exports=s}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,_:25}],77:[function(e,t){!function(e,t){"use strict";function s(){c.call(this,"Popups","PopupsAddAccount"),this.email=o.observable(""),this.password=o.observable(""),this.emailError=o.observable(!1),this.passwordError=o.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.emailFocus=o.observable(!1),this.addAccountCommand=a.createCommand(this,function(){return this.emailError(""===a.trim(this.email())),this.passwordError(""===a.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),r.accountAdd(i.bind(function(e,s){this.submitRequest(!1),n.StorageResultType.Success===e&&s&&"AccountAdd"===s.Action?s.Result?(t("App:RainLoop").accountsAndIdentities(),this.cancelCommand()):s.ErrorCode&&this.submitError(a.getNotification(s.ErrorCode)):this.submitError(a.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var i=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:AddAccount","PopupsAddAccountViewModel"],s),i.extend(s.prototype,c.prototype),s.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.emailFocus(!0)},e.exports=s}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],78:[function(e,t){!function(e,t){"use strict";function s(){l.call(this,"Popups","PopupsAddOpenPgpKey"),this.key=o.observable(""),this.key.error=o.observable(!1),this.key.focus=o.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=n.createCommand(this,function(){var e=30,s=null,i=n.trim(this.key()),o=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,r=a.openpgpKeyring;if(i=i.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===i),!r||this.key.error())return!1;for(;;){if(s=o.exec(i),!s||0>e)break;s[0]&&s[1]&&s[2]&&s[1]===s[2]&&("PRIVATE"===s[1]?r.privateKeys.importKey(s[0]):"PUBLIC"===s[1]&&r.publicKeys.importKey(s[0])),e--}return r.store(),t("App:RainLoop").reloadOpenPgpKeys(),n.delegateRun(this,"cancelCommand"),!0}),r.constructorEnd(this)}var i=t("_"),o=t("ko"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel(["View:Popup:AddOpenPgpKey","PopupsAddOpenPgpKeyViewModel"],s),i.extend(s.prototype,l.prototype),s.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.key.focus(!0)},e.exports=s}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22}],79:[function(e,t){!function(e,t){"use strict";function s(){c.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=o.observable(!1),this.from=o.observable(""),this.to=o.observable(""),this.subject=o.observable(""),this.text=o.observable(""),this.selectedDateValue=o.observable(-1),this.hasAttachment=o.observable(!1),this.starred=o.observable(!1),this.unseen=o.observable(!1),this.searchCommand=a.createCommand(this,function(){var e=this.buildSearchString();""!==e&&r.mainMessageListSearch(e),this.cancelCommand()}),l.constructorEnd(this)}var i=t("_"),o=t("ko"),n=t("moment"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:AdvancedSearch","PopupsAdvancedSearchViewModel"],s),i.extend(s.prototype,c.prototype),s.prototype.buildSearchStringValue=function(e){return-1"},s.prototype.sendMessageResponse=function(e,t){var s=!1,o="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(s=!0,this.modalVisibility()&&p.delegateRun(this,"closeCommand")),this.modalVisibility()&&!s&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),i.alert(p.trim(p.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=p.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),i.alert(o||p.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},s.prototype.saveMessageResponse=function(e,t){var s=!1,o=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(o=y.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&y.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(i.Math.round((new i.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
"+s}return e},s.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?o.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},s.prototype.onShow=function(e,t,s,i,a){C.routeOff();var r=this,l="",c="",d="",h="",g="",m=null,f="",b="",S=[],w={},A=y.accountEmail(),F=y.signature(),T=y.signatureToAll(),R=[],L=null,E=null,N=e||u.ComposeType.Empty,P=function(e,t){for(var s=0,i=e.length,o=[];i>s;s++)o.push(e[s].toLine(!!t));return o.join(", ")};if(t=t||null,t&&p.isNormal(t)&&(E=p.isArray(t)&&1===t.length?t[0]:p.isArray(t)?null:t),null!==A&&(w[A]=!0),this.currentIdentityID(this.findIdentityIdByMessage(N,E)),this.reset(),p.isNonEmptyArray(s)&&this.to(P(s)),""!==N&&E){switch(h=E.fullFormatDateValue(),g=E.subject(),L=E.aDraftInfo,m=n(E.body).clone(),m&&(m.find("blockquote.rl-bq-switcher").each(function(){n(this).removeClass("rl-bq-switcher hidden-bq")}),m.find(".rlBlockquoteSwitcher").each(function(){n(this).remove()})),m.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),f=m.html(),N){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(P(E.replyEmails(w))),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ReplyAll:S=E.replyAllEmails(w),this.to(P(S[0])),this.cc(P(S[1])),this.subject(p.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.references());break;case u.ComposeType.Forward:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(p.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+E.sReferences);break;case u.ComposeType.Draft:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.bFromDraft=!0,this.draftFolder(E.folderFullNameRaw),this.draftUid(E.uid),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences;break;case u.ComposeType.EditAsNew:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=p.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences}switch(N){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=E.fromToLine(!1,!0),b=p.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:l}),f="

"+b+":

"+f+"

";break;case u.ComposeType.Forward:l=E.fromToLine(!1,!0),c=E.toToLine(!1,!0),d=E.ccToLine(!1,!0),f="


"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+p.encodeHtml(h)+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+p.encodeHtml(g)+"

"+f;break;case u.ComposeType.ForwardAsAttachment:f=""}T&&""!==F&&u.ComposeType.EditAsNew!==N&&u.ComposeType.Draft!==N&&(f=this.convertSignature(F,P(E.from,!0),f,N)),this.editor(function(e){e.setHtml(f,!1),E.isHtml()||e.modeToggle(!1)})}else u.ComposeType.Empty===N?(this.subject(p.isNormal(i)?""+i:""),f=p.isNormal(a)?""+a:"",T&&""!==F&&(f=this.convertSignature(F,"",p.convertPlainTextToHtml(f),N)),this.editor(function(e){e.setHtml(f,!1),u.EditorDefaultType.Html!==y.editorDefaultType()&&e.modeToggle(!1)})):p.isNonEmptyArray(t)&&o.each(t,function(e){r.addMessageAsAttachment(e)});R=this.getAttachmentsDownloadsForUpload(),p.isNonEmptyArray(R)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var s=null,i="";if(!r.viewModelVisibility())for(i in t.Result)t.Result.hasOwnProperty(i)&&(s=r.getAttachmentById(t.Result[i]),s&&s.tempName(i))}else r.setMessageAttachmentFailedDowbloadText()},R),this.triggerForResize()},s.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},s.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},s.prototype.tryToClosePopup=function(){var e=this,s=t("View:Popup:Ask");C.isPopupVisible(s)||C.showScreenPopup(s,[p.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&p.delegateRun(e,"closeCommand")}])},s.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),h.$win.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=i.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",n(t).attr("id","dropboxjs").attr("data-app-key",b.settingsGet("DropboxApiKey")),i.document.body.appendChild(t)),this.driveEnabled()&&n.getScript("https://apis.google.com/js/api.js",function(){i.gapi&&e.driveVisible(!0)})},s.prototype.driveCallback=function(e,t){if(t&&i.XMLHttpRequest&&i.google&&t[i.google.picker.Response.ACTION]===i.google.picker.Action.PICKED&&t[i.google.picker.Response.DOCUMENTS]&&t[i.google.picker.Response.DOCUMENTS][0]&&t[i.google.picker.Response.DOCUMENTS][0].id){var s=this,o=new i.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[i.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=l.parse(o.responseText),i=function(e,t,s){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+s,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":i(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":i(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":i(t,"image/png","png");break;case"application/vnd.google-apps.presentation":i(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:i(t,"application/pdf","pdf")}t&&t.downloadUrl&&s.addDriveAttachment(t,e)}}),o.send()}},s.prototype.driveCreatePiker=function(e){if(i.gapi&&e&&e.access_token){var t=this;i.gapi.load("picker",{callback:function(){if(i.google&&i.google.picker){var s=(new i.google.picker.PickerBuilder).addView((new i.google.picker.DocsView).setIncludeFolders(!0)).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(o.bind(t.driveCallback,t,e.access_token)).enableFeature(i.google.picker.Feature.NAV_HIDDEN).build();s.setVisible(!0)}}})}},s.prototype.driveOpenPopup=function(){if(i.gapi){var e=this;i.gapi.load("auth",{callback:function(){var t=i.gapi.auth.getToken();t?e.driveCreatePiker(t):i.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var s=i.gapi.auth.getToken();s&&e.driveCreatePiker(s)}else i.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var s=i.gapi.auth.getToken();s&&e.driveCreatePiker(s)}})})}})}},s.prototype.getAttachmentById=function(e){for(var t=this.attachments(),s=0,i=t.length;i>s;s++)if(t[s]&&e===t[s].id)return t[s];return null},s.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=p.pInt(b.settingsGet("AttachmentLimit")),s=new c({action:m.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.on("onDragEnter",o.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",o.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",o.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",o.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",o.bind(function(t,s,o){var n=null;p.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+i.Math.floor(s/o*100)+"%")},this)).on("onSelect",o.bind(function(e,i){this.dragAndDropOver(!1);var o=this,n=p.isUnd(i.FileName)?"":i.FileName.toString(),a=p.isNormal(i.Size)?p.pInt(i.Size):null,r=new w(e,n,a);return r.cancel=function(e){return function(){o.attachments.remove(function(t){return t&&t.id===e}),s&&s.cancel(e)}}(e),this.attachments.push(r),a>0&&t>0&&a>t?(r.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",o.bind(function(t){var s=null;p.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&(s.waiting(!1),s.uploading(!0))},this)).on("onComplete",o.bind(function(t,s,i){var o="",n=null,a=null,r=this.getAttachmentById(t);a=s&&i&&i.Result&&i.Result.Attachment?i.Result.Attachment:null,n=i&&i.Result&&i.Result.ErrorCode?i.Result.ErrorCode:null,null!==n?o=p.getUploadErrorDescByCode(n):a||(o=p.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&00&&o>0&&n>o?(s.uploading(!1),s.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,t){var i=!1;s.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(i=!0,s.tempName(t.Result[s.id])),i||s.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},s.prototype.addDriveAttachment=function(e,t){var s=this,i=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}},o=p.pInt(b.settingsGet("AttachmentLimit")),n=null,a=e.fileSize?p.pInt(e.fileSize):0;return n=new w(e.downloadUrl,e.title,a),n.fromMessage=!1,n.cancel=i(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),a>0&&o>0&&a>o?(n.uploading(!1),n.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var s=!1;n.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(s=!0,n.tempName(t.Result[n.id][0]),n.size(p.pInt(t.Result[n.id][1]))),s||n.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},s.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,i=p.isNonEmptyArray(e.attachments())?e.attachments():[],o=0,n=i.length,a=null,r=null,l=!1,c=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}};if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>o;o++){switch(r=i[o],l=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=r.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:l=!0}l&&(a=new w(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),a.fromMessage=!0,a.cancel=c(r.download),a.waiting(!1).uploading(!0),this.attachments.push(a))}}},s.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},s.prototype.setMessageAttachmentFailedDowbloadText=function(){o.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},s.prototype.isEmptyForm=function(e){e=p.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},s.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!1),this.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},s.prototype.getAttachmentsDownloadsForUpload=function(){return o.map(o.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},s.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=s}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,HtmlEditor:10,JSON:15,Jua:16,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:ComposeAttachment":33,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,"Storage:Settings":69,Utils:14,"View:Popup:Ask":80,"View:Popup:ComposeOpenPgp":81,"View:Popup:FolderSystem":87,_:25,ko:22,moment:23,window:26}],83:[function(e,t){!function(e,t){"use strict";function s(){w.call(this,"Popups","PopupsContacts");var e=this,s=function(t){t&&0=e?1:e},this),this.contactsPagenator=a.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=a.observable(!0),this.viewClearSearch=a.observable(!1),this.viewID=a.observable(""),this.viewReadOnly=a.observable(!1),this.viewProperties=a.observableArray([]),this.viewTags=a.observable(""),this.viewTags.visibility=a.observable(!1),this.viewTags.focusTrigger=a.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=a.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1=i&&(this.bDropPageAfterDelete=!0),o.delay(function(){o.each(n,function(e){t.remove(e)})},500))},s.prototype.deleteSelectedContacts=function(){00?i:0),d.isNonEmptyArray(s.Result.Tags)&&(a=o.map(s.Result.Tags,function(e){var t=new y;return t.parse(e)?t:null}),a=o.compact(a))),t.contactsCount(i),t.contacts(n),t.contacts.loading(!1),t.contactTags(a),t.viewClearSearch(""!==t.search())},s,c.Defaults.ContactsPerPage,this.search())},s.prototype.onBuild=function(e){this.oContentVisible=n(".b-list-content",e),this.oContentScrollable=n(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;r("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=a.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},s.prototype.onShow=function(){v.routeOff(),this.reloadContactList(!0)},s.prototype.onHide=function(){v.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},e.exports=s}(t,e)},{$:20,"App:Knoin":27,"App:RainLoop":3,Consts:6,Enums:7,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Model:Contact":34,"Model:ContactProperty":35,"Model:ContactTag":36,"Model:Email":37,Selector:13,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,"View:Popup:Compose":82,"View:Popup:Contacts":83,_:25,key:21,ko:22,window:26}],84:[function(e,t){!function(e,t){"use strict";function s(){c.call(this,"Popups","PopupsFilter"),this.filter=o.observable(null),this.selectedFolderValue=o.observable(n.Values.UnuseOptionValue),this.folderSelectList=r.folderMenuForMove,this.defautOptionsAfterRender=a.defautOptionsAfterRender,l.constructorEnd(this)}var i=t("_"),o=t("ko"),n=t("Consts"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:Filter","PopupsFilterViewModel"],s),i.extend(s.prototype,c.prototype),s.prototype.clearPopup=function(){},s.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},e.exports=s}(t,e)},{"App:Knoin":27,Consts:6,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22}],85:[function(e,t){!function(e,t){"use strict";function s(){d.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=o.observable(null),this.clearingProcess=o.observable(!1),this.clearingError=o.observable(""),this.folderFullNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=o.computed(function(){return a.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=a.createCommand(this,function(){var e=this,s=this.selectedFolder();s&&(r.message(null),r.messageList([]),this.clearingProcess(!0),s.messageCountAll(0),s.messageCountUnread(0),l.setFolderHash(s.fullNameRaw,""),c.folderClear(function(s,i){e.clearingProcess(!1),n.StorageResultType.Success===s&&i&&i.Result?(t("App:RainLoop").reloadMessageList(!0),e.cancelCommand()):e.clearingError(i&&i.ErrorCode?a.getNotification(i.ErrorCode):a.getNotification(n.Notification.MailServerError))},s.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),u.constructorEnd(this)}var i=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("Storage:RainLoop:Cache"),c=t("Storage:RainLoop:Remote"),u=t("App:Knoin"),d=t("Knoin:AbstractViewModel");u.extendAsViewModel(["View:Popup:FolderClear","PopupsFolderClearViewModel"],s),i.extend(s.prototype,d.prototype),s.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},s.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},e.exports=s}(t,e)},{"App:Knoin":27,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Cache":63,"Storage:RainLoop:Data":64,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],86:[function(e,t){!function(e,t){"use strict";function s(){d.call(this,"Popups","PopupsFolderCreate"),r.initOnStartOrLangChange(function(){this.sNoParentText=r.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(a.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,s=null,i=l.folderList(),o=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==l.namespace&&(t=function(e){return l.namespace!==e.fullNameRaw.substr(0,l.namespace.length)}),r.folderListOptionsBuilder([],i,[],e,null,t,s,o)},this),this.createFolder=r.createCommand(this,function(){var e=this.selectedParentValue();""===e&&1 li"),o=s&&("tab"===s.shortcut||"right"===s.shortcut),n=i.index(i.filter(".active"));return!o&&n>0?n--:o&&n"),this.submitRequest(!0),o.delay(function(){n=i.openpgp.generateKeyPair({userId:s,numBits:a.pInt(e.keyBitLength()),passphrase:a.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t("App:RainLoop").reloadOpenPgpKeys(),a.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var i=t("window"),o=t("_"),n=t("ko"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:NewOpenPgpKey","PopupsNewOpenPgpKeyViewModel"],s),o.extend(s.prototype,c.prototype),s.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.email.focus(!0)},e.exports=s}(t,e)},{"App:Knoin":27,"App:RainLoop":3,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Data":64,Utils:14,_:25,ko:22,window:26}],92:[function(e,t){!function(e,t){"use strict";function s(){c.call(this,"Popups","PopupsTwoFactorTest");var e=this;this.code=o.observable(""),this.code.focused=o.observable(!1),this.code.status=o.observable(null),this.testing=o.observable(!1),this.testCode=a.createCommand(this,function(){this.testing(!0),r.testTwoFactor(function(t,s){e.testing(!1),e.code.status(n.StorageResultType.Success===t&&s&&s.Result?!0:!1)},this.code())},function(){return""!==this.code()&&!this.testing()}),l.constructorEnd(this)}var i=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:TwoFactorTest","PopupsTwoFactorTestViewModel"],s),i.extend(s.prototype,c.prototype),s.prototype.clearPopup=function(){this.code(""),this.code.focused(!1),this.code.status(null),this.testing(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.code.focused(!0)},e.exports=s}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,"Storage:RainLoop:Remote":68,Utils:14,_:25,ko:22}],93:[function(e,t){!function(e,t){"use strict";function s(){r.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=o.observable(""),this.keyDom=o.observable(null),a.constructorEnd(this)}var i=t("_"),o=t("ko"),n=t("Utils"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel(["View:Popup:ViewOpenPgpKey","PopupsViewOpenPgpKeyViewModel"],s),i.extend(s.prototype,r.prototype),s.prototype.clearPopup=function(){this.key("")},s.prototype.selectKey=function(){var e=this.keyDom();e&&n.selectElement(e)},s.prototype.onShow=function(e){this.clearPopup(),e&&this.key(e.armor)},e.exports=s}(t,e)},{"App:Knoin":27,"Knoin:AbstractViewModel":30,Utils:14,_:25,ko:22}],94:[function(e,t){!function(e,t){"use strict";function s(e){r.call(this,"Left","SettingsMenu"),this.leftPanelDisabled=o.leftPanelDisabled,this.menu=e.menu,a.constructorEnd(this)}var i=t("_"),o=t("Globals"),n=t("LinkBuilder"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel(["View:RainLoop:SettingsMenu","SettingsMenuViewModel"],s),i.extend(s.prototype,r.prototype),s.prototype.link=function(e){return n.settings(e)},s.prototype.backToMailBoxClick=function(){a.setHash(n.inbox())},e.exports=s}(t,e)},{"App:Knoin":27,Globals:9,"Knoin:AbstractViewModel":30,LinkBuilder:11,_:25}],95:[function(e,t){!function(e,t){"use strict";function s(){c.call(this,"Right","SettingsPane"),l.constructorEnd(this)}var i=t("_"),o=t("key"),n=t("Enums"),a=t("LinkBuilder"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:RainLoop:SettingsPane","SettingsPaneViewModel"],s),i.extend(s.prototype,c.prototype),s.prototype.onBuild=function(){var e=this;o("esc",n.KeyState.Settings,function(){e.backToMailBoxClick()})},s.prototype.onShow=function(){r.message(null)},s.prototype.backToMailBoxClick=function(){l.setHash(a.inbox())},e.exports=s}(t,e)},{"App:Knoin":27,Enums:7,"Knoin:AbstractViewModel":30,LinkBuilder:11,"Storage:RainLoop:Data":64,_:25,key:21}],96:[function(e,t){!function(e,t){"use strict";function s(){n.call(this),o.constructorEnd(this)}var i=t("_"),o=t("App:Knoin"),n=t("View:RainLoop:AbstractSystemDropDown");o.extendAsViewModel(["View:RainLoop:SettingsSystemDropDown","SettingsSystemDropDownViewModel"],s),i.extend(s.prototype,n.prototype),e.exports=s}(t,e)},{"App:Knoin":27,"View:RainLoop:AbstractSystemDropDown":71,_:25}]},{},[1]); \ No newline at end of file