1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00
rainloop_ynh/sources/rainloop/v/1.8.0.251/static/js/min/app.js
polytan02 bb2bdad8e0 Update to version 1.8.0.251
We keep previous version, just in case.
2015-02-06 19:51:46 +00:00

12 lines
332 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
!function(e){function t(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return e[s].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};return t.m=e,t.c=i,t.p="rainloop/v/0.0.0/static/js/min/",t(0)}([function(e,t,i){i(69)(i(6))},function(e,t,i){!function(){"use strict";var t=null,s={},o=i(10),n=i(2),r=i(13),a=i(3),l=i(71),c=i(72),u=i(48),d=i(4),h=i(8);s.trim=r.trim,s.inArray=r.inArray,s.isArray=n.isArray,s.isFunc=n.isFunction,s.isUnd=n.isUndefined,s.isNull=n.isNull,s.emptyFunction=function(){},s.isNormal=function(e){return!s.isUnd(e)&&!s.isNull(e)},s.windowResize=n.debounce(function(e){s.isUnd(e)?h.$win.resize():o.setTimeout(function(){h.$win.resize()},e)},50),s.windowResizeCallback=function(){s.windowResize()},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 i=s.isNormal(e)&&""!==e?o.parseInt(e,10):t||0;return o.isNaN(i)?t||0:i},s.pString=function(e){return s.isNormal(e)?""+e:""},s.encodeURIComponent=function(e){return o.encodeURIComponent(e)},s.isNonEmptyArray=function(e){return s.isArray(e)&&0<e.length},s.simpleQueryParser=function(e){var t={},i=[],s=[],n=0,r=0;for(i=e.split("&"),n=0,r=i.length;r>n;n++)s=i[n].split("="),t[o.decodeURIComponent(s[0])]=o.decodeURIComponent(s[1]);return t},s.mailToHelper=function(e,t){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var n={},r=null,a=null,l=null,c=e.replace(/\?.+$/,""),u=e.replace(/^[^\?]*\?/,""),h=i(25);return r=new h,r.parse(o.decodeURIComponent(c)),n=s.simpleQueryParser(u),s.isUnd(n.cc)||(a=new h,a.parse(o.decodeURIComponent(n.cc))),s.isUnd(n.bcc)||(l=new h,l.parse(o.decodeURIComponent(n.bcc))),i(5).showScreenPopup(t,[d.ComposeType.Empty,null,r&&r.email?[r]:null,a&&a.email?[a]:null,l&&l.email?[l]:null,s.isUnd(n.subject)?null:s.pString(n.subject),s.isUnd(n.body)?null:s.plainToHtml(s.pString(n.body))]),!0}return!1},s.rsaObject=function(e){return c&&e&&(null===t||t&&t.__sPublicKey!==e)&&o.crypto&&o.crypto.getRandomValues?(t=new c,t.setPublicKey(e),t.__sPublicKey=e):t=!1,t},s.rsaEncode=function(e,t){if(o.crypto&&o.crypto.getRandomValues&&t){var i=!1,n=s.rsaObject(t);if(n&&(i=n.encrypt(s.fakeMd5()+":"+e+":"+s.fakeMd5()),!1!==i&&s.isNormal(i)))return"rsa:xxx:"+i}return e},s.rsaEncode.supported=!1,s.encodeHtml=function(e){return s.isNormal(e)?e.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""},s.splitPlainText=function(e,t){var i="",o="",n=e,r=0,a=0;for(t=s.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),r=o.lastIndexOf(" "),a=o.lastIndexOf("\n"),-1!==a&&(r=a),-1===r&&(r=t),i+=o.substring(0,r)+"\n",n=n.substring(r+1);return i+n},s.timeOutAction=function(){var e={};return function(t,i,n){s.isUnd(e[t])&&(e[t]=0),o.clearTimeout(e[t]),e[t]=o.setTimeout(i,n)}}(),s.timeOutActionSecond=function(){var e={};return function(t,i,s){e[t]||(e[t]=o.setTimeout(function(){i(),e[t]=0},s))}}(),s.audio=function(){var e=!1;return function(t,i){if(!1===e)if(h.bIsiOSDevice)e=null;else{var s=!1,n=!1,r=o.Audio?new o.Audio:null;r&&r.canPlayType&&r.play?(s=""!==r.canPlayType('audio/mpeg; codecs="mp3"'),s||(n=""!==r.canPlayType('audio/ogg; codecs="vorbis"')),s||n?(e=r,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=s?t:i):e=null):e=null}return e}}(),s.hos=function(e,t){return e&&o.Object&&o.Object.hasOwnProperty?o.Object.hasOwnProperty.call(e,t):!1},s.inFocus=function(){return o.document.activeElement?(s.isUnd(o.document.activeElement.__inFocusCache)&&(o.document.activeElement.__inFocusCache=r(o.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!o.document.activeElement.__inFocusCache):!1},s.removeInFocus=function(){if(o.document&&o.document.activeElement&&o.document.activeElement.blur){var e=r(o.document.activeElement);e.is("input,textarea")&&o.document.activeElement.blur()}},s.removeSelection=function(){if(o&&o.getSelection){var e=o.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else o.document&&o.document.selection&&o.document.selection.empty&&o.document.selection.empty()},s.replySubjectAdd=function(e,t){e=s.trim(e.toUpperCase()),t=s.trim(t.replace(/[\s]+/g," "));var i=!1,o=[],r="RE"===e,a="FWD"===e,l=!a;return""!==t&&n.each(t.split(":"),function(e){var t=s.trim(e);i||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(o.push(e),i=!0):(r||(r=!!/^RE/i.test(t)),a||(a=!!/^FWD/i.test(t)))}),l?r=!1:a=!1,s.trim((l?"Re: ":"Fwd: ")+(r?"Re: ":"")+(a?"Fwd: ":"")+s.trim(o.join(":")))},s.roundNumber=function(e,t){return o.Math.round(e*o.Math.pow(10,t))/o.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){o.console&&o.console.log&&o.console.log(e)},s.delegateRun=function(e,t,i,o){e&&e[t]&&(o=s.pInt(o),0>=o?e[t].apply(e,s.isArray(i)?i:[]):n.delay(function(){e[t].apply(e,s.isArray(i)?i:[])},o))},s.killCtrlAandS=function(e){if(e=e||o.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===d.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===d.EventKeyCode.A&&(o.getSelection?o.getSelection().removeAllRanges():o.document.selection&&o.document.selection.clear&&o.document.selection.clear(),e.preventDefault())}},s.createCommand=function(e,t,i){var o=function(){return n&&n.canExecute&&n.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1},n=t?o:s.emptyFunction;return n.enabled=a.observable(!0),i=s.isUnd(i)?!0:i,n.canExecute=a.computed(s.isFunc(i)?function(){return n.enabled()&&i.call(e)}:function(){return n.enabled()&&!!i}),n},s.createMomentDate=function(e){return s.isUnd(e.moment)&&(e.moment=a.observable(moment())),a.computed(function(){h.momentTrigger();var e=this.moment();return 1970===e.year()?"":e.fromNow()},e)},s.createMomentShortDate=function(e){return a.computed(function(){var e="",t=moment(),s=this.moment(),o=this.momentDate();return e=1970===s.year()?"":4>=t.diff(s,"hours")?o:t.format("L")===s.format("L")?i(7).i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i(7).i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.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.timestamp=function(){return o.Math.round(s.microtime()/1e3)},s.convertLangName=function(e,t){return i(7).i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},s.fakeMd5=function(e){var t="",i="0123456789abcdefghijklmnopqrstuvwxyz";for(e=s.isUnd(e)?32:s.pInt(e);t.length<e;)t+=i.substr(o.Math.round(o.Math.random()*i.length),1);return t},s.draggablePlace=function(){return r('<div class="draggablePlace"><span class="text"></span>&nbsp;<i class="icon-copy icon-white visible-on-ctrl"></i><i class="icon-mail icon-white hidden-on-ctrl"></i></div>').appendTo("#rl-hidden")},s.defautOptionsAfterRender=function(e,t){t&&!s.isUnd(t.disabled)&&e&&r(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},s.windowPopupKnockout=function(e,t,n,l){var c=null,u=o.open(""),d="__OpenerApplyBindingsUid"+s.fakeMd5()+"__",h=r("#"+t);o[d]=function(){if(u&&u.document.body&&h&&h[0]){var t=r(u.document.body);r("#rl-content",t).html(h.html()),r("html",u.document).addClass("external "+r("html").attr("class")),i(7).i18nToNode(t),e&&r("#rl-content",t)[0]&&a.applyBindings(e,r("#rl-content",t)[0]),o[d]=null,l(u)}},u.document.open(),u.document.write('<html><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="viewport" content="user-scalable=no" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="robots" content="noindex, nofollow, noodp" /><title>'+s.encodeHtml(n)+'</title></head><body><div id="rl-content"></div></body></html>'),u.document.close(),c=u.document.createElement("script"),c.type="text/javascript",c.innerHTML="if(window&&window.opener&&window.opener['"+d+"']){window.opener['"+d+"']();window.opener['"+d+"']=null}",u.document.getElementsByTagName("head")[0].appendChild(c)},s.settingsSaveHelperFunction=function(e,t,i,o){return i=i||null,o=s.isUnd(o)?1e3:s.pInt(o),function(s,r,a,l,c){t.call(i,r&&r.Result?d.SaveSettingsStep.TrueResult:d.SaveSettingsStep.FalseResult),e&&e.call(i,s,r,a,l,c),n.delay(function(){t.call(i,d.SaveSettingsStep.Idle)},o)}},s.settingsSaveHelperSimpleFunction=function(e,t){return s.settingsSaveHelperFunction(null,e,t,1e3)},s.settingsSaveHelperSubscribeFunction=function(e,t,i,o){return function(n){if(e){switch(i){default:n=s.pString(n);break;case"bool":case"boolean":n=n?"1":"0";break;case"int":case"integer":case"number":n=s.pInt(n);break;case"trim":n=s.trim(n)}var r={};r[t]=n,e.saveAdminConfig?e.saveAdminConfig(o||null,r):e.saveSettings&&e.saveSettings(o||null,r)}}},s.htmlToPlain=function(e){var t=0,i=0,s=0,o=0,n=0,a="",l=function(e){for(var t=100,i="",s="",o=e,n=0,r=0;o.length>t;)s=o.substring(0,t),n=s.lastIndexOf(" "),r=s.lastIndexOf("\n"),-1!==r&&(n=r),-1===n&&(n=t),i+=s.substring(0,n)+"\n",o=o.substring(n+1);return i+o},c=function(e){return e=l(r.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2<arguments.length?arguments[1]+r.trim(arguments[2].replace(/[\s]/g,""))+" ":""})},u=function(){if(arguments&&1<arguments.length){var e=r.trim(arguments[1]);return 0<e.length&&(e=e.replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gim,u),e="\n"+r.trim(e)+"\n"),e}return""},d=function(){return arguments&&1<arguments.length?arguments[1].toString().replace(/[\n]/gm,"<br />"):""},p=function(){return arguments&&1<arguments.length?""+arguments[1]+arguments[2].replace(/</g,"&lt;").replace(/>/g,"&gt;"):""},m=function(){return arguments&&1<arguments.length?r.trim(arguments[1]):""};for(a=e.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gim,d).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,p).replace(/<br[^>]*>/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(/<hr[^>]*>/gim,"\n_______________________________\n\n").replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gim,u).replace(/<blockquote[^>]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/<a [^>]*>([\s\S\r\n]*?)<\/a>/gim,m).replace(/<\/div>/gi,"\n").replace(/&nbsp;/gi," ").replace(/&quot;/gi,'"').replace(/<[^>]*>/gm,""),a=h.$div.html(a).text(),a=a.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/&gt;/gi,">").replace(/&lt;/gi,"<").replace(/&amp;/gi,"&"),t=0,n=100;n>0&&(n--,i=a.indexOf("__bq__start__",t),i>-1);)s=a.indexOf("__bq__start__",i+5),o=a.indexOf("__bq__end__",i+5),(-1===s||s>o)&&o>i?(a=a.substring(0,i)+c(a.substring(i+13,o))+a.substring(o+11),t=0):t=s>-1&&o>s?s-1:0;return a=a.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,""),t=s.isUnd(t)?!1:!!t;var i=!1,o=!0,n=!0,r=[],a="",l=0,c=e.split("\n");do{for(o=!1,r=[],l=0;l<c.length;l++)a=c[l],n=">"===a.substr(0,1),n&&!i?(o=!0,i=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&i?""!==a?(i=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(a):r.push(n&&i?a.substr(1):a);i&&(i=!1,r.push("~~~/blockquote~~~")),c=r}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/~~~blockquote~~~[\s]*/g,"<blockquote>").replace(/[\s]*~~~\/blockquote~~~/g,"</blockquote>").replace(/\n/g,"<br />"),t?s.findEmailAndLinks(e):e},o.rainloop_Utils_htmlToPlain=s.htmlToPlain,o.rainloop_Utils_plainToHtml=s.plainToHtml,s.findEmailAndLinks=function(e){return e=l.link(e,{newWindow:!0,stripPrefix:!1,urls:!0,email:!0,twitter:!1,replaceFn:function(e,t){return!(e&&t&&"url"===t.getType()&&t.matchedText&&0!==t.matchedText.indexOf("http"))}})},s.resizeAndCrop=function(e,t,i){var s=new o.Image;s.onload=function(){var e=[0,0],s=o.document.createElement("canvas"),n=s.getContext("2d");s.width=t,s.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(s.toDataURL("image/jpeg"))},s.src=e},s.folderListOptionsBuilder=function(e,t,i,n,r,a,l,c,u,h){var p=null,m=!1,f=0,g=0,b="   ",y=[];for(h=s.isUnd(h)?!1:!!h,u=s.isNormal(u)?u:0<e.length,r=s.isNormal(r)?r:0,a=s.isNormal(a)?a:null,l=s.isNormal(l)?l:null,c=s.isNormal(c)?c:null,s.isArray(i)||(i=[]),s.isArray(n)||(n=[]),f=0,g=n.length;g>f;f++)y.push({id:n[f][0],name:n[f][1],system:!1,seporator:!1,disabled:!1});for(m=!0,f=0,g=e.length;g>f;f++)p=e[f],(l?l.call(null,p):!0)&&(m&&0<y.length&&y.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),m=!1,y.push({id:p.fullNameRaw,name:c?c.call(null,p):p.name(),system:!0,seporator:!1,disabled:!p.selectable||-1<s.inArray(p.fullNameRaw,i)||(a?a.call(null,p):!1)}));for(m=!0,f=0,g=t.length;g>f;f++)p=t[f],!p.subScribed()&&p.existen&&!h||!p.selectable&&!p.hasSubScribedSubfolders()||(l?l.call(null,p):!0)&&(d.FolderType.User===p.type()||!u||p.hasSubScribedSubfolders())&&(m&&0<y.length&&y.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),m=!1,y.push({id:p.fullNameRaw,name:new o.Array(p.deep+1-r).join(b)+(c?c.call(null,p):p.name()),system:!1,seporator:!1,disabled:!p.selectable||-1<s.inArray(p.fullNameRaw,i)||(a?a.call(null,p):!1)})),p.subScribed()&&0<p.subFolders().length&&(y=y.concat(s.folderListOptionsBuilder([],p.subFolders(),i,[],r,a,l,c,u,h)));return y},s.computedPagenatorHelper=function(e,t){return function(){var i=0,n=0,r=2,a=[],l=e(),c=t(),u=function(e,t,i){var o={current:e===l,name:s.isUnd(i)?e.toString():i.toString(),custom:s.isUnd(i)?!1:!0,title:s.isUnd(i)?"":e.toString(),value:e.toString()};(s.isUnd(t)?0:!t)?a.unshift(o):a.push(o)};if(c>1||c>0&&l>c){for(l>c?(u(c),i=c,n=c):((3>=l||l>=c-2)&&(r+=2),u(l),i=l,n=l);r>0;)if(i-=1,n+=1,i>0&&(u(i,!1),r--),c>=n)u(n,!0),r--;else if(0>=i)break;3===i?u(2,!1):i>3&&u(o.Math.round((i-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(o.Math.round((c+n)/2),!0,"..."),i>1&&u(1,!1),c>n&&u(c,!0)}return a}},s.selectElement=function(e){var t,i;o.getSelection?(t=o.getSelection(),t.removeAllRanges(),i=o.document.createRange(),i.selectNodeContents(e),t.addRange(i)):o.document.selection&&(i=o.document.body.createTextRange(),i.moveToElementText(e),i.select())},s.detectDropdownVisibility=n.debounce(function(){h.dropdownVisibility(!!n.find(h.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){r(".checkAutocomplete").trigger("change")};(s.isUnd(e)?1:!e)?t():n.delay(t,100)},s.setHeadViewport=function(e){var t=[];n.each(e,function(e,i){t.push(""+e+"="+i)}),r("#rl-head-viewport").attr("content",t.join(", "))},s.getFileExtension=function(e){e=s.trim(e).toLowerCase();var t=e.split(".").pop();return t===e?"":t},s.mimeContentType=function(e){var t="",i="application/octet-stream";return e=s.trim(e).toLowerCase(),"winmail.dat"===e?"application/ms-tnef":(t=s.getFileExtension(e),t&&0<t.length&&!s.isUnd(u[t])&&(i=u[t]),i)},s.disposeOne=function(e,t){var i=t||e;i&&"function"==typeof i.dispose&&i.dispose()},s.disposeObject=function(e){e&&(s.isArray(e.disposables)&&n.each(e.disposables,s.disposeOne),a.utils.objectForEach(e,s.disposeOne))},s.delegateRunOnDestroy=function(e){e&&(s.isArray(e)?n.each(e,function(e){s.delegateRunOnDestroy(e)}):e&&e.onDestroy&&e.onDestroy())},s.__themeTimer=0,s.__themeAjax=null,s.changeTheme=function(e,t,i,n){var a=r("#rlThemeLink"),l=r("#rlThemeStyle"),c=a.attr("href");c||(c=l.attr("data-href")),c&&(c=c.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+e+"/-/"),c=c.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),c=c.toString().replace(/\/Hash\/[^\/]+\//,"/Hash/-/"),"Json/"!==c.substring(c.length-5,c.length)&&(c+="Json/"),o.clearTimeout(s.__themeTimer),i(d.SaveSettingsStep.Animate),s.__themeAjax&&s.__themeAjax.abort&&s.__themeAjax.abort(),s.__themeAjax=r.ajax({url:c,dataType:"json"}).done(function(e){if(e&&s.isArray(e)&&2===e.length){if(!a||!a[0]||l&&l[0]||(l=r('<style id="rlThemeStyle"></style>'),a.after(l),a.remove()),l&&l[0]&&(l.attr("data-href",c).attr("data-theme",e[0]),l[0].styleSheet&&!s.isUnd(l[0].styleSheet.cssText)?l[0].styleSheet.cssText=e[1]:l.text(e[1])),n){var o=r("#rl-bg");t?o.backstretch(n.publicLink(t),{fade:h.bAnimationSupported?1e3:0,centeredX:!0,centeredY:!0}):o.data("backstretch")&&o.backstretch("destroy").attr("style","")}i(d.SaveSettingsStep.TrueResult)}}).always(function(){s.__themeTimer=o.setTimeout(function(){i(d.SaveSettingsStep.Idle)},1e3),s.__themeAjax=null}))},e.exports=s}()},function(e){e.exports=window._},function(e,t,i){!function(t){"use strict";var s=i(10),o=i(2),n=i(13),r=function(e,i,s){t.utils.domNodeDisposal.addDisposeCallback(e,function(){s&&s.dispose&&s.dispose(),i&&(i.off("click.koTooltip"),i.tooltip&&i.tooltip("destroy")),i=null})};t.bindingHandlers.tooltip={init:function(e,s){var o=null,a=!0,l="",c="",u=null,d=i(8),h=i(7);d.bMobileDevice||(o=n(e),l=o.data("tooltip-class")||"",a="on"===(o.data("tooltip-i18n")||"on"),c=o.data("tooltip-placement")||"top",o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){var e=a?t.unwrap(s()):s()();return""===e||o.is(".disabled")||d.dropdownVisibility()?"":'<span class="tooltip-class '+l+'">'+(a?h.i18n(e):e)+"</span>"}}).on("click.koTooltip",function(){o.tooltip("hide")}),u=d.tooltipTrigger.subscribe(function(){o.tooltip("hide")}),r(e,o,u))}},t.bindingHandlers.tooltipForTest={init:function(e){var t=n(e),o=null,a=i(8);t.tooltip({container:"body",trigger:"hover manual",title:function(){return t.data("tooltip3-data")||""}}),n(s.document).on("click",function(){t.tooltip("hide")}),o=a.tooltipTrigger.subscribe(function(){t.tooltip("hide")}),r(e,t,o)},update:function(e,i){var s=t.unwrap(i());""===s?n(e).data("tooltip3-data","").tooltip("hide"):(n(e).data("tooltip3-data",s),o.delay(function(){n(e).is(":visible")&&n(e).tooltip("show")},100))}},t.bindingHandlers.registrateBootstrapDropdown={init:function(e){var t=i(8);t&&t.aBootstrapDropdowns&&t.aBootstrapDropdowns.push(n(e))}},t.bindingHandlers.openDropdownTrigger={update:function(e,s){if(t.unwrap(s())){var o=n(e),r=i(1);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),r.detectDropdownVisibility()),s()(!1)}}},t.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},t.bindingHandlers.popover={init:function(e,i){n(e).popover(t.unwrap(i())),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).popover("destroy")})}},t.bindingHandlers.csstext={init:function(e,s){var o=i(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(s()):n(e).text(t.unwrap(s()))},update:function(e,s){var o=i(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(s()):n(e).text(t.unwrap(s()))}},t.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"})}},t.bindingHandlers.onEnter={init:function(e,i,o,r){n(e).on("keypress.koOnEnter",function(t){t&&13===s.parseInt(t.keyCode,10)&&(n(e).trigger("change"),i().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEnter")})}},t.bindingHandlers.onEsc={init:function(e,i,o,r){n(e).on("keypress.koOnEsc",function(t){t&&27===s.parseInt(t.keyCode,10)&&(n(e).trigger("change"),i().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEsc")})}},t.bindingHandlers.clickOnTrue={update:function(e,i){t.unwrap(i())&&n(e).click()}},t.bindingHandlers.modal={init:function(e,s){var o=i(8),r=i(1);n(e).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:t.unwrap(s())}).on("shown.koModal",r.windowResizeCallback).find(".close").on("click.koModal",function(){s()(!1)}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("shown.koModal").find(".close").off("click.koModal")})},update:function(e,i){n(e).modal(t.unwrap(i())?"show":"hide")}},t.bindingHandlers.i18nInit={init:function(e){i(7).i18nToNode(e)}},t.bindingHandlers.i18nUpdate={update:function(e,s){t.unwrap(s()),i(7).i18nToNode(e)}},t.bindingHandlers.link={update:function(e,i){n(e).attr("href",t.unwrap(i()))}},t.bindingHandlers.title={update:function(e,i){n(e).attr("title",t.unwrap(i()))}},t.bindingHandlers.textF={init:function(e,i){n(e).text(t.unwrap(i()))}},t.bindingHandlers.initDom={init:function(e,t){t()(e)}},t.bindingHandlers.initFixedTrigger={init:function(e,i){var o=t.unwrap(i()),r=null,a=n(e),l=null,c=o[1]||0;r=n(o[0]||null),r=r[0]?r:null,r&&n(s).resize(function(){l=r.offset(),l&&l.top&&a.css("top",l.top+c)})}},t.bindingHandlers.initResizeTrigger={init:function(e,i){var s=t.unwrap(i());n(e).css({height:s[1],"min-height":s[1]})},update:function(e,s){var o=i(1),r=i(8),a=t.unwrap(s()),l=o.pInt(a[1]),c=0,u=n(e).offset().top;u>0&&(u+=o.pInt(a[2]),c=r.$win.height()-u,c>l&&(l=c),n(e).css({height:l,"min-height":l}))}},t.bindingHandlers.appendDom={update:function(e,i){n(e).hide().empty().append(t.unwrap(i())).show()}},t.bindingHandlers.draggable={init:function(e,o,r){var a=i(8),l=i(1);if(!a.bMobileDevice){var c=100,u=3,d=r(),h=d&&d.droppableSelector?d.droppableSelector:"",p={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};h&&(p.drag=function(e){n(h).each(function(){var t=null,i=null,o=n(this),r=o.offset(),a=r.top+o.height();s.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=r.left&&e.pageX<=r.left+o.width()&&(e.pageY>=a-c&&e.pageY<=a&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",s.setInterval(i,10)),i()))})},p.stop=function(){n(h).each(function(){s.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),p.helper=function(e){return o()(e&&e.target?t.dataFor(e.target):null)},n(e).draggable(p).on("mousedown.koDraggable",function(){l.removeInFocus()}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("mousedown.koDraggable").draggable("destroy")})}}},t.bindingHandlers.droppable={init:function(e,s,o){var r=i(8);if(!r.bMobileDevice){var a=s(),l=o(),c=l&&l.droppableOver?l.droppableOver:null,u=l&&l.droppableOut?l.droppableOut:null,d={tolerance:"pointer",hoverClass:"droppableHover"};a&&(d.drop=function(e,t){a(e,t)},c&&(d.over=function(e,t){c(e,t)}),u&&(d.out=function(e,t){u(e,t)}),n(e).droppable(d),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).droppable("destroy")}))}}},t.bindingHandlers.nano={init:function(e){var t=i(8);t.bDisableNanoScroll||n(e).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},t.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('&nbsp;&nbsp;<i class="icon-spinner animated"></i><i class="icon-remove error"></i><i class="icon-ok success"></i>').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,i){var s=t.unwrap(i()),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")}}},t.bindingHandlers.emailsTags={init:function(e,t,s){var r=i(1),a=i(25),l=n(e),c=t(),u=s(),d=u.autoCompleteSource||null,h=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:h,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=r.trim(e),i=null;return""!==t?(i=new a,i.mailsoParse(t),[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,i,s){var o=n(e),r=s(),a=r.emailsTagsFilter||null,l=t.unwrap(i());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),a&&t.unwrap(a)&&o.inputosaurus("focus")}},t.bindingHandlers.command={init:function(e,i,s,o){var r=n(e),a=i();if(!a||!a.enabled||!a.canExecute)throw new Error("You are not using command function");r.addClass("command"),t.bindingHandlers[r.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)}},t.extenders.trimmer=function(e){var s=i(1),o=t.computed({read:e,write:function(t){e(s.trim(t.toString()))},owner:this});return o(e()),o},t.extenders.posInterer=function(e,s){var o=i(1),n=t.computed({read:e,write:function(t){var i=o.pInt(t.toString(),s);0>=i&&(i=s),i===e()&&""+i!=""+t&&e(i+1),e(i)}});return n(e()),n},t.extenders.limitedList=function(e,s){var o=i(1),n=t.computed({read:e,write:function(i){var n=t.unwrap(e),r=t.unwrap(s);o.isNonEmptyArray(r)?-1<o.inArray(i,r)?e(i):-1<o.inArray(n,r)?(e(n+" "),e(n)):(e(r[0]+" "),e(r[0])):e("")}}).extend({notify:"always"});return n(e()),n.valueHasMutated||(n.valueHasMutated=function(){e.valueHasMutated()}),n},t.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},t.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},t.extenders.toggleSubscribeProperty=function(e,t){var i=t[1];return i&&(e.subscribe(function(e){e&&e[i]&&e[i](!1)},t[0],"beforeChange"),e.subscribe(function(e){e&&e[i]&&e[i](!0)},t[0])),e},t.extenders.falseTimeout=function(e,t){var o=i(1);return e.iTimeout=0,e.subscribe(function(i){i&&(s.clearTimeout(e.iTimeout),e.iTimeout=s.setTimeout(function(){e(!1),e.iTimeout=0},o.pInt(t)))}),e},t.observable.fn.validateNone=function(){return this.hasError=t.observable(!1),this},t.observable.fn.validateEmail=function(){var e=i(1);return this.hasError=t.observable(!1),this.subscribe(function(t){t=e.trim(t),this.hasError(""!==t&&!/^[^@\s]+@[^@\s]+$/.test(t))},this),this.valueHasMutated(),this},t.observable.fn.validateSimpleEmail=function(){var e=i(1);return this.hasError=t.observable(!1),this.subscribe(function(t){t=e.trim(t),this.hasError(""!==t&&!/^.+@.+$/.test(t))},this),this.valueHasMutated(),this},t.observable.fn.validateFunc=function(e){var s=i(1);return this.hasFuncError=t.observable(!1),s.isFunc(e)&&(this.subscribe(function(t){this.hasFuncError(!e(t))},this),this.valueHasMutated()),this},e.exports=t}(ko)},function(e){!function(){"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={TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",UserBackground:"USER_BACKGROUND",Sieve:"SIEVE",AttachmentThumbnails:"ATTACHMENT_THUMBNAILS",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,MessageListSize:5,LastReplyAction:6},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.DesktopNotification={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain",HtmlForced:"HtmlForced",PlainForced:"PlainForced"},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.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",MoveTo:"MoveTo",Discard:"Discard",Vacation:"Vacation",Reject:"Reject",Forward:"Forward"},t.FilterRulesType={All:"All",Any:"Any"},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,CantSaveFilters:351,CantGetFilters:352,FiltersAreNotCorrect:355,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,DemoAccountError:751,AccountAlreadyExists:801,AccountDoesNotExist:802,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t
}()},function(e,t,i){!function(){"use strict";function t(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var s=i(2),o=i(13),n=i(3),r=i(76),a=i(41),l=i(8),c=i(23),u=i(1);t.prototype.oScreens={},t.prototype.sDefaultScreenName="",t.prototype.oCurrentScreen=null,t.prototype.hideLoading=function(){o("#rl-loading").hide()},t.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},t.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},t.prototype.addSettingsViewModel=function(e,t,i,s,o){e.__rlSettingsData={Label:i,Template:t,Route:s,IsDefault:!!o},l.aViewModels.settings.push(e)},t.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},t.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},t.prototype.routeOff=function(){r.changed.active=!1},t.prototype.routeOn=function(){r.changed.active=!0},t.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},t.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,r=new e(t),a=r.viewModelPosition(),d=o("#rl-content #rl-"+a.toLowerCase()),h=null;e.__builded=!0,e.__vm=r,r.onShowTrigger=n.observable(!1),r.onHideTrigger=n.observable(!1),r.viewModelName=e.__name,r.viewModelNames=e.__names,d&&1===d.length?(h=o("<div></div>").addClass("rl-view-model").addClass("RL-"+r.viewModelTemplate()).hide(),h.appendTo(d),r.viewModelDom=h,e.__dom=h,"Popups"===a&&(r.cancelCommand=r.closeCommand=u.createCommand(r,function(){i.hideScreenPopup(e)}),r.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),r.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.onHideTrigger&&this.onHideTrigger(!this.onHideTrigger()),this.restoreKeyScope(),s.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),r.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},r)),s.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,r,h])}),n.applyBindingAccessorsToNode(h[0],{i18nInit:!0,template:function(){return{name:r.viewModelTemplate()}}},r),u.delegateRun(r,"onBuild",[h]),r&&"Popups"===a&&r.registerPopupKeyDown(),s.each(e.__names,function(e){c.runHook("view-model-post-build",[e,r,h])})):u.log("Cannot find view model position: "+a)}return e?e.__vm:null},t.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},t.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),e.__vm.onShowTrigger&&e.__vm.onShowTrigger(!e.__vm.onShowTrigger()),s.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},t.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},t.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"),i.oCurrentScreen.onHideTrigger&&i.oCurrentScreen.onHideTrigger(!i.oCurrentScreen.onHideTrigger()),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"),e.__vm.onHideTrigger&&e.__vm.onHideTrigger(!e.__vm.onHideTrigger()))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),i.oCurrentScreen.onShowTrigger&&i.oCurrentScreen.onShowTrigger(!i.oCurrentScreen.onShowTrigger()),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"),e.__vm.onShowTrigger&&e.__vm.onShowTrigger(!e.__vm.onShowTrigger()),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)})))},t.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=a.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),s.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50),s.delay(function(){l.$html.addClass("rl-started-delay")},200)},t.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)?(r.changed.active=!0,r[i?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[i?"replaceHash":"setHash"](e),r.changed.active=!0)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){x.call(this,R),this.oMoveCache={},this.quotaDebounce=o.debounce(this.quota,3e4),this.moveOrDeleteResponseHelper=o.bind(this.moveOrDeleteResponseHelper,this),this.messagesMoveTrigger=o.debounce(this.messagesMoveTrigger,500),s.setInterval(function(){m.pub("interval.30s")},3e4),s.setInterval(function(){m.pub("interval.1m")},6e4),s.setInterval(function(){m.pub("interval.2m")},12e4),s.setInterval(function(){m.pub("interval.3m")},18e4),s.setInterval(function(){m.pub("interval.5m")},3e5),s.setInterval(function(){m.pub("interval.10m")},6e5),s.setInterval(function(){m.pub("interval.15m")},9e5),s.setInterval(function(){m.pub("interval.20m")},9e5),s.setTimeout(function(){s.setInterval(function(){m.pub("interval.5m-after5m")},3e5)},3e5),s.setTimeout(function(){s.setInterval(function(){m.pub("interval.10m-after5m")},6e5)},3e5),n.wakeUp(function(){R.jsVersion(function(e,t){l.StorageResultType.Success===e&&t&&!t.Result&&(s.parent&&A.settingsGet("InIframe")?s.parent.location.reload():s.location.reload())},A.settingsGet("Version"))},{},36e5),A.settingsGet("UserBackgroundHash")&&o.delay(function(){n("#rl-bg").attr("style","background-image: none !important;").backstretch(p.publicLink(A.settingsGet("UserBackgroundHash")),{fade:c.bAnimationSupported?1e3:0}).removeAttr("style")},2e3),this.socialUsers=o.bind(this.socialUsers,this)}var s=i(10),o=i(2),n=i(13),r=i(36),a=i(75),l=i(4),c=i(8),u=i(16),d=i(23),h=i(1),p=i(12),m=i(28),f=i(7),g=i(5),b=i(35),y=i(30),S=i(26),v=i(22),w=i(43),C=i(32),T=i(20),F=i(60),A=i(9),E=i(15),N=i(19),R=i(14),I=i(25),P=i(100),L=i(81),M=i(95),D=i(101),k=i(102),x=i(46);o.extend(t.prototype,x.prototype),t.prototype.remote=function(){return R},t.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){o.each(E.messageList(),function(e){N.initMessageFlagsFromCache(e)}),N.initMessageFlagsFromCache(E.message())},t.prototype.reloadMessageList=function(e,t){var i=this,s=(E.messageListPage()-1)*S.messagesPerPage();(h.isUnd(t)?1:!t)||N.setFolderHash(E.currentFolderFullNameRaw(),""),(h.isUnd(e)?1:!e)||(E.messageListPage(1),s=0),E.messageListLoading(!0),R.messageList(function(e,t,s){l.StorageResultType.Success===e&&t&&t.Result?(E.messageListError(""),E.messageListLoading(!1),i.setMessageList(t,s)):l.StorageResultType.Unload===e?(E.messageListError(""),E.messageListLoading(!1)):l.StorageResultType.Abort!==e&&(E.messageList([]),E.messageListLoading(!1),E.messageListError(t&&t.ErrorCode?f.getNotification(t.ErrorCode):f.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST")))},E.currentFolderFullNameRaw(),s,S.messagesPerPage(),E.messageListSearch())},t.prototype.recacheInboxMessageList=function(){R.messageList(h.emptyFunction,N.getFolderInboxName(),0,S.messagesPerPage(),"",!0)},t.prototype.reloadMessageListHelper=function(e){this.reloadMessageList(e)},t.prototype.contactsSync=function(e){var t=E.contacts;return t.importing()||t.syncing()||!E.enableContactsSync()||!E.allowContactsSync()?!1:(t.syncing(!0),R.contactsSync(function(i,s){t.syncing(!1),e&&e(i,s)}),!0)},t.prototype.messagesMoveTrigger=function(){var e=this,t=C.spamFolder();o.each(this.oMoveCache,function(i){var s=t===i.To,o=!s&&t===i.From&&N.getFolderInboxName()===i.To;R.messagesMove(e.moveOrDeleteResponseHelper,i.From,i.To,i.Uid,s?"SPAM":o?"HAM":"")}),this.oMoveCache={}},t.prototype.messagesMoveHelper=function(e,t,i){var s="$$"+e+"$$"+t+"$$";this.oMoveCache[s]||(this.oMoveCache[s]={From:e,To:t,Uid:[]}),this.oMoveCache[s].Uid=o.union(this.oMoveCache[s].Uid,i),this.messagesMoveTrigger()},t.prototype.messagesCopyHelper=function(e,t,i){R.messagesCopy(this.moveOrDeleteResponseHelper,e,t,i)},t.prototype.messagesDeleteHelper=function(e,t){R.messagesDelete(this.moveOrDeleteResponseHelper,e,t)},t.prototype.moveOrDeleteResponseHelper=function(e,t){l.StorageResultType.Success===e&&E.currentFolder()&&(t&&h.isArray(t.Result)&&2===t.Result.length?N.setFolderHash(t.Result[0],t.Result[1]):(N.setFolderHash(E.currentFolderFullNameRaw(),""),t&&-1<h.inArray(t.ErrorCode,[l.Notification.CantMoveMessage,l.Notification.CantCopyMessage])&&s.alert(f.getNotification(t.ErrorCode))),this.reloadMessageListHelper(0===E.messageList().length),this.quotaDebounce())},t.prototype.deleteMessagesFromFolderWithoutCheck=function(e,t){this.messagesDeleteHelper(e,t),E.removeMessagesFromList(e,t)},t.prototype.deleteMessagesFromFolder=function(e,t,s,o){var n=this,r=null,a=null;switch(e){case l.FolderType.Spam:r=N.getFolderFromCacheList(C.spamFolder()),a=l.SetSystemFoldersNotification.Spam;break;case l.FolderType.NotSpam:r=N.getFolderFromCacheList(N.getFolderInboxName());break;case l.FolderType.Trash:r=N.getFolderFromCacheList(C.trashFolder()),a=l.SetSystemFoldersNotification.Trash;break;case l.FolderType.Archive:r=N.getFolderFromCacheList(C.archiveFolder()),a=l.SetSystemFoldersNotification.Archive}o=h.isUnd(o)?!0:!!o,o&&(l.FolderType.Spam===e&&u.Values.UnuseOptionValue===C.spamFolder()||l.FolderType.Trash===e&&u.Values.UnuseOptionValue===C.trashFolder()||l.FolderType.Archive===e&&u.Values.UnuseOptionValue===C.archiveFolder())&&(o=!1),!r&&o?g.showScreenPopup(i(44),[a]):o&&(l.FolderType.Trash!==e||t!==C.spamFolder()&&t!==C.trashFolder())?r&&(this.messagesMoveHelper(t,r.fullNameRaw,s),E.removeMessagesFromList(t,s,r.fullNameRaw)):g.showScreenPopup(i(40),[f.i18n("POPUPS_ASK/DESC_WANT_DELETE_MESSAGES"),function(){n.messagesDeleteHelper(t,s),E.removeMessagesFromList(t,s)}])},t.prototype.moveMessagesToFolder=function(e,t,i,s){if(e!==i&&h.isArray(t)&&0<t.length){var o=N.getFolderFromCacheList(e),n=N.getFolderFromCacheList(i);if(o&&n)return(h.isUnd(s)?1:!s)?this.messagesMoveHelper(o.fullNameRaw,n.fullNameRaw,t):this.messagesCopyHelper(o.fullNameRaw,n.fullNameRaw,t),E.removeMessagesFromList(o.fullNameRaw,t,n.fullNameRaw,s),!0}return!1},t.prototype.folders=function(e){E.foldersLoading(!0),R.folders(o.bind(function(t,i){var s=!1;E.foldersLoading(!1),l.StorageResultType.Success===t&&i&&i.Result&&(s=!0,this.setFolders(i)),e&&e(s)},this))},t.prototype.reloadOpenPgpKeys=function(){if(T.capaOpenPGP()){var e=[],t=new I,i=T.openpgpKeyring,s=i?i.getAllKeys():[];o.each(s,function(i,s){if(i&&i.primaryKey){var o=i.getPrimaryUser(),n=o&&o.user?o.user.userId.userid:i.users&&i.users[0]?i.users[0].userId.userid:"";t.clear(),t.mailsoParse(n),t.validate()&&e.push(new k(s,i.primaryKey.getFingerprint(),i.primaryKey.getKeyId().toHex().toLowerCase(),n,t.email,i.isPrivate(),i.armor()))}}),h.delegateRunOnDestroy(T.openpgpkeys()),T.openpgpkeys(e)}},t.prototype.accountsCounts=function(){return!1},t.prototype.accountsAndIdentities=function(e){var t=this;v.accounts.loading(!0),w.identities.loading(!0),R.accountsAndIdentities(function(i,s){if(v.accounts.loading(!1),w.identities.loading(!1),l.StorageResultType.Success===i&&s.Result){var n={},r=A.settingsGet("ParentEmail"),a=v.email();r=""===r?a:r,h.isArray(s.Result.Accounts)&&(o.each(v.accounts(),function(e){n[e.email]=e.count()}),h.delegateRunOnDestroy(v.accounts()),v.accounts(o.map(s.Result.Accounts,function(e){return new M(e,e!==r,n[e]||0)}))),(h.isUnd(e)?1:!e)||(o.delay(function(){t.accountsCounts()},5e3),m.sub("interval.10m-after5m",function(){t.accountsCounts()})),h.isArray(s.Result.Identities)&&(h.delegateRunOnDestroy(w.identities()),w.identities(o.map(s.Result.Identities,function(e){var t=h.pString(e.Id),i=h.pString(e.Email),s=new D(t,i,t!==a);return s.name(h.pString(e.Name)),s.replyTo(h.pString(e.ReplyTo)),s.bcc(h.pString(e.Bcc)),s})))}})},t.prototype.quota=function(){R.quota(function(e,t){l.StorageResultType.Success===e&&t&&t.Result&&h.isArray(t.Result)&&1<t.Result.length&&h.isPosNumeric(t.Result[0],!0)&&h.isPosNumeric(t.Result[1],!0)&&i(84).populateData(h.pInt(t.Result[1]),h.pInt(t.Result[0]))})},t.prototype.folderInformation=function(e,t){if(""!==h.trim(e)){var i=this;R.folderInformation(function(e,t){if(l.StorageResultType.Success===e&&t&&t.Result&&t.Result.Hash&&t.Result.Folder){var s=r().unix(),o=N.getFolderHash(t.Result.Folder),n=N.getFolderFromCacheList(t.Result.Folder),a=!1,c="",u=[],d=!1,p=null;if(n){if(n.interval=s,t.Result.Hash&&N.setFolderHash(t.Result.Folder,t.Result.Hash),h.isNormal(t.Result.MessageCount)&&n.messageCountAll(t.Result.MessageCount),h.isNormal(t.Result.MessageUnseenCount)&&(h.pInt(n.messageCountUnread())!==h.pInt(t.Result.MessageUnseenCount)&&(d=!0),n.messageCountUnread(t.Result.MessageUnseenCount)),d&&N.clearMessageFlagsFromCacheByFolder(n.fullNameRaw),t.Result.Flags){for(c in t.Result.Flags)t.Result.Flags.hasOwnProperty(c)&&(a=!0,p=t.Result.Flags[c],N.storeMessageFlagsToCacheByFolderAndUid(n.fullNameRaw,c.toString(),[!p.IsSeen,!!p.IsFlagged,!!p.IsAnswered,!!p.IsForwarded,!!p.IsReadReceipt]));a&&i.reloadFlagsCurrentMessageListAndMessageFromCache()}E.initUidNextAndNewMessages(n.fullNameRaw,t.Result.UidNext,t.Result.NewMessages),t.Result.Hash!==o||""===o?n.fullNameRaw===E.currentFolderFullNameRaw()?i.reloadMessageList():N.getFolderInboxName()===n.fullNameRaw&&i.recacheInboxMessageList():d&&n.fullNameRaw===E.currentFolderFullNameRaw()&&(u=E.messageList(),h.isNonEmptyArray(u)&&i.folderInformation(n.fullNameRaw,u))}}},e,t)}},t.prototype.folderInformationMultiply=function(e){e=h.isUnd(e)?!1:!!e;var t=this,i=r().unix(),s=E.getNextFolderNames(e);h.isNonEmptyArray(s)&&R.folderInformationMultiply(function(s,n){l.StorageResultType.Success===s&&n&&n.Result&&n.Result.List&&h.isNonEmptyArray(n.Result.List)&&(o.each(n.Result.List,function(e){var s=[],o=N.getFolderHash(e.Folder),n=N.getFolderFromCacheList(e.Folder),r=!1;n&&(n.interval=i,e.Hash&&N.setFolderHash(e.Folder,e.Hash),h.isNormal(e.MessageCount)&&n.messageCountAll(e.MessageCount),h.isNormal(e.MessageUnseenCount)&&(h.pInt(n.messageCountUnread())!==h.pInt(e.MessageUnseenCount)&&(r=!0),n.messageCountUnread(e.MessageUnseenCount)),r&&N.clearMessageFlagsFromCacheByFolder(n.fullNameRaw),e.Hash!==o||""===o?n.fullNameRaw===E.currentFolderFullNameRaw()&&t.reloadMessageList():r&&n.fullNameRaw===E.currentFolderFullNameRaw()&&(s=E.messageList(),h.isNonEmptyArray(s)&&t.folderInformation(n.fullNameRaw,s)))}),e&&o.delay(function(){t.folderInformationMultiply(!0)},2e3))},s)},t.prototype.setMessageSeen=function(e){if(e.unseen()){e.unseen(!1);var t=N.getFolderFromCacheList(e.folderFullNameRaw);t&&t.messageCountUnread(0<=t.messageCountUnread()-1?t.messageCountUnread()-1:0),N.storeMessageFlagsToCache(e),this.reloadFlagsCurrentMessageListAndMessageFromCache()}R.messageSetSeen(h.emptyFunction,e.folderFullNameRaw,[e.uid],!0)},t.prototype.googleConnect=function(){s.open(p.socialGoogle(),"Google","left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes")},t.prototype.twitterConnect=function(){s.open(p.socialTwitter(),"Twitter","left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes")},t.prototype.facebookConnect=function(){s.open(p.socialFacebook(),"Facebook","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes")},t.prototype.socialUsers=function(e){!0===e&&(b.google.loading(!0),b.facebook.loading(!0),b.twitter.loading(!0)),R.socialUsers(function(e,t){l.StorageResultType.Success===e&&t&&t.Result?(b.google.userName(t.Result.Google||""),b.facebook.userName(t.Result.Facebook||""),b.twitter.userName(t.Result.Twitter||"")):(b.google.userName(""),b.facebook.userName(""),b.twitter.userName("")),b.google.loading(!1),b.facebook.loading(!1),b.twitter.loading(!1)})},t.prototype.googleDisconnect=function(){b.google.loading(!0),R.googleDisconnect(this.socialUsers)},t.prototype.facebookDisconnect=function(){b.facebook.loading(!0),R.facebookDisconnect(this.socialUsers)},t.prototype.twitterDisconnect=function(){b.twitter.loading(!0),R.twitterDisconnect(this.socialUsers)},t.prototype.getAutocomplete=function(e,t){var i=[];R.suggestions(function(e,s){l.StorageResultType.Success===e&&s&&h.isArray(s.Result)?(i=o.map(s.Result,function(e){return e&&e[0]?new I(e[0],e[1]):null}),t(o.compact(i))):l.StorageResultType.Abort!==e&&t([])},e)},t.prototype.setMessageList=function(e,t){if(e&&e.Result&&"Collection/MessageCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])){var i=null,o=0,n=0,a=0,c=0,u=[],d=r().unix(),p=E.staticMessageList,m=null,g=null,b=null,y=0,v=!1;for(a=h.pInt(e.Result.MessageResultCount),c=h.pInt(e.Result.Offset),h.isNonEmptyArray(e.Result.LastCollapsedThreadUids)&&(i=e.Result.LastCollapsedThreadUids),b=N.getFolderFromCacheList(h.isNormal(e.Result.Folder)?e.Result.Folder:""),b&&!t&&(b.interval=d,N.setFolderHash(e.Result.Folder,e.Result.FolderHash),h.isNormal(e.Result.MessageCount)&&b.messageCountAll(e.Result.MessageCount),h.isNormal(e.Result.MessageUnseenCount)&&(h.pInt(b.messageCountUnread())!==h.pInt(e.Result.MessageUnseenCount)&&(v=!0),b.messageCountUnread(e.Result.MessageUnseenCount)),E.initUidNextAndNewMessages(b.fullNameRaw,e.Result.UidNext,e.Result.NewMessages)),v&&b&&N.clearMessageFlagsFromCacheByFolder(b.fullNameRaw),o=0,n=e.Result["@Collection"].length;n>o;o++)m=e.Result["@Collection"][o],m&&"Object/Message"===m["@Object"]&&(g=p[o],g&&g.initByJson(m)||(g=L.newInstanceFromJson(m)),g&&(N.hasNewMessageAndRemoveFromCache(g.folderFullNameRaw,g.uid)&&5>=y&&(y++,g.newForAnimation(!0)),g.deleted(!1),t?N.initMessageFlagsFromCache(g):N.storeMessageFlagsToCache(g),g.lastInCollapsedThread(i&&-1<h.inArray(h.pInt(g.uid),i)?!0:!1),u.push(g)));E.messageListCount(a),E.messageListSearch(h.isNormal(e.Result.Search)?e.Result.Search:""),E.messageListPage(s.Math.ceil(c/S.messagesPerPage()+1)),E.messageListEndFolder(h.isNormal(e.Result.Folder)?e.Result.Folder:""),E.messageListEndSearch(h.isNormal(e.Result.Search)?e.Result.Search:""),E.messageListEndPage(E.messageListPage()),E.messageList(u),E.messageListIsNotCompleted(!1),p.length<u.length&&(E.staticMessageList=u),N.clearNewMessageCache(),b&&(t||v||S.useThreads())&&this.folderInformation(b.fullNameRaw,u)}else E.messageListCount(0),E.messageList([]),E.messageListError(f.getNotification(e&&e.ErrorCode?e.ErrorCode:l.Notification.CantGetMessageList))},t.prototype.folderResponseParseRec=function(e,t){var i=this,s=0,o=0,n=null,r=null,a="",l=[],c=[];for(s=0,o=t.length;o>s;s++)n=t[s],n&&(a=n.FullNameRaw,r=N.getFolderFromCacheList(a),r||(r=P.newInstanceFromJson(n),r&&(N.setFolderToCacheList(a,r),N.setFolderFullNameRaw(r.fullNameHash,a,r))),r&&(r.collapsed(!i.isFolderExpanded(r.fullNameHash)),n.Extended&&(n.Extended.Hash&&N.setFolderHash(r.fullNameRaw,n.Extended.Hash),h.isNormal(n.Extended.MessageCount)&&r.messageCountAll(n.Extended.MessageCount),h.isNormal(n.Extended.MessageUnseenCount)&&r.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&h.isArray(l["@Collection"])&&r.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(r)));return c},t.prototype.setFolders=function(e){var t=[],i=!1,s=function(e){return""===e||u.Values.UnuseOptionValue===e||null!==N.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])&&(h.isUnd(e.Result.Namespace)||(E.namespace=e.Result.Namespace),y.threadsAllowed(!!A.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(E.namespace,e.Result["@Collection"]),E.folderList(t),e.Result.SystemFolders&&""==""+A.settingsGet("SentFolder")+A.settingsGet("DraftFolder")+A.settingsGet("SpamFolder")+A.settingsGet("TrashFolder")+A.settingsGet("ArchiveFolder")+A.settingsGet("NullFolder")&&(A.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),A.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),A.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),A.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),A.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),i=!0),C.sentFolder(s(A.settingsGet("SentFolder"))),C.draftFolder(s(A.settingsGet("DraftFolder"))),C.spamFolder(s(A.settingsGet("SpamFolder"))),C.trashFolder(s(A.settingsGet("TrashFolder"))),C.archiveFolder(s(A.settingsGet("ArchiveFolder"))),i&&R.saveSystemFolders(h.emptyFunction,{SentFolder:C.sentFolder(),DraftFolder:C.draftFolder(),SpamFolder:C.spamFolder(),TrashFolder:C.trashFolder(),ArchiveFolder:C.archiveFolder(),NullFolder:"NullFolder"}),F.set(l.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},t.prototype.isFolderExpanded=function(e){var t=F.get(l.ClientSideKeyName.ExpandedFolders);return h.isArray(t)&&-1!==o.indexOf(t,e)},t.prototype.setExpandedFolder=function(e,t){var i=F.get(l.ClientSideKeyName.ExpandedFolders);h.isArray(i)||(i=[]),t?(i.push(e),i=o.uniq(i)):i=o.without(i,e),F.set(l.ClientSideKeyName.ExpandedFolders,i)},t.prototype.initHorizontalLayoutResizer=function(e){var t=200,i=500,s=null,o=null,r=function(t,i){i&&i.size&&i.size.height&&(F.set(e,i.size.height),u(i.size.height),h.windowResize())},a={helper:"ui-resizable-helper-h",minHeight:t,maxHeight:i,handles:"s",stop:r},u=function(e){e&&(s&&s.attr("style","height:"+e+"px"),o&&o.attr("style","top:"+(55+e)+"px"))},d=function(i){if(i)s&&s.hasClass("ui-resizable")&&s.resizable("destroy").removeAttr("style"),o&&o.removeAttr("style");else if(c.$html.hasClass("rl-bottom-preview-pane")){s=n(".b-message-list-wrapper"),o=n(".b-message-view-wrapper"),s.hasClass("ui-resizable")||s.resizable(a);var r=h.pInt(F.get(e))||300;u(r>t?r:t)}};d(!1),m.sub("layout",function(e){d(l.Layout.BottomPreview!==e)})},t.prototype.initVerticalLayoutResizer=function(e){var t=60,i=155,s=n("#rl-left"),o=n("#rl-right"),r=F.get(e)||null,a=function(e){e&&(s.css({width:""+e+"px"}),o.css({left:""+e+"px"}))},l=function(o){if(o)s.resizable("disable"),a(t);else{s.resizable("enable");var n=h.pInt(F.get(e))||i;a(n>i?n:i)}},c=function(t,i){i&&i.size&&i.size.width&&(F.set(e,i.size.width),o.css({left:""+i.size.width+"px"}))};null!==r&&a(r>i?r:i),s.resizable({helper:"ui-resizable-helper-w",minWidth:i,maxWidth:350,handles:"e",stop:c}),m.sub("left-panel.off",function(){l(!0)}),m.sub("left-panel.on",function(){l(!1)})},t.prototype.bootstartLoginScreen=function(){c.$html.removeClass("rl-user-auth").addClass("rl-user-no-auth");var e=h.pString(A.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),o.defer(function(){s.location.href=e})):(g.hideLoading(),g.startScreens([i(106)]),d.runHook("rl-start-login-screens"),m.pub("rl.bootstart-login-screens"))},t.prototype.bootstart=function(){x.prototype.bootstart.call(this),i(30).populate(),i(26).populate(),i(66).populate(),i(43).populate(),i(22).populate();var e=this,t=i(152),n=A.settingsGet("JsHash"),r=h.pInt(A.settingsGet("ContactsSyncInterval")),u=A.settingsGet("AllowGoogleSocial"),y=A.settingsGet("AllowFacebookSocial"),S=A.settingsGet("AllowTwitterSocial");a&&(a.set(70),a.sleep()),c.leftPanelDisabled.subscribe(function(e){m.pub("left-panel."+(e?"off":"on"))}),A.settingsGet("Auth")?(c.$html.addClass("rl-user-auth"),this.setTitle(f.i18n("TITLES/LOADING")),e.folders(o.bind(function(n){if(g.hideLoading(),n){if(t&&s.crypto&&s.crypto.getRandomValues&&A.capa(l.Capa.OpenPGP)){var f=function(t){T.openpgp=t,T.openpgpKeyring=new t.Keyring,T.capaOpenPGP(!0),m.pub("openpgp.init"),e.reloadOpenPgpKeys()};s.openpgp?f(s.openpgp):t.script(p.openPgpJs()).wait(function(){s.openpgp&&f(s.openpgp)})}else T.capaOpenPGP(!1);g.startScreens([i(107),i(108),i(105)]),(u||y||S)&&e.socialUsers(!0),m.sub("interval.2m",function(){e.folderInformation(N.getFolderInboxName())}),m.sub("interval.3m",function(){var t=E.currentFolderFullNameRaw();N.getFolderInboxName()!==t&&e.folderInformation(t)}),m.sub("interval.5m-after5m",function(){e.folderInformationMultiply()}),m.sub("interval.15m",function(){e.quota()}),m.sub("interval.20m",function(){e.folders()}),r=r>=5?r:20,r=320>=r?r:320,o.delay(function(){e.contactsSync()},1e4),o.delay(function(){e.folderInformationMultiply(!0)},2e3),s.setInterval(function(){e.contactsSync()},6e4*r+5e3),(A.capa(l.Capa.AdditionalAccounts)||A.capa(l.Capa.AdditionalIdentities))&&e.accountsAndIdentities(!0),o.delay(function(){var t=E.currentFolderFullNameRaw();N.getFolderInboxName()!==t&&e.folderInformation(t)},1e3),o.delay(function(){e.quota()},5e3),o.delay(function(){R.appDelayStart(h.emptyFunction)},35e3),d.runHook("rl-start-user-screens"),m.pub("rl.bootstart-user-screens"),A.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",""+(A.settingsGet("Title")||"RainLoop"))}catch(e){}A.settingsGet("MailToEmail")&&h.mailToHelper(A.settingsGet("MailToEmail"),i(27))},500),c.bMobileDevice||o.defer(function(){e.initVerticalLayoutResizer(l.ClientSideKeyName.FolderListSize)})}else this.bootstartLoginScreen();a&&a.set(100)},e))):(this.bootstartLoginScreen(),a&&a.set(100)),u&&(s["rl_"+n+"_google_service"]=function(){b.google.loading(!0),e.socialUsers()}),y&&(s["rl_"+n+"_facebook_service"]=function(){b.facebook.loading(!0),e.socialUsers()}),S&&(s["rl_"+n+"_twitter_service"]=function(){b.twitter.loading(!0),e.socialUsers()}),m.sub("interval.1m",function(){c.momentTrigger(!c.momentTrigger())}),d.runHook("rl-start-screens"),m.pub("rl.bootstart-end")},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.data=s.rainloopI18N||{},this.notificationI18N={},this.trigger=r.observable(!1),this.i18n=n.bind(this.i18n,this)}var s=i(10),o=i(13),n=i(2),r=i(3),a=i(4),l=i(8);t.prototype.data={},t.prototype.notificationI18N={},t.prototype.i18n=function(e,t,i){var s="",o=n.isUndefined(this.data[e])?n.isUndefined(i)?e:i:this.data[e];if(!n.isUndefined(t)&&!n.isNull(t))for(s in t)n.has(t,s)&&(o=o.replace("%"+s+"%",t[s]));return o},t.prototype.i18nToNode=function(e,t){var i=this;n.defer(function(){o(".i18n",e).each(function(){var e=o(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)))}),t&&l.bAnimationSupported&&o(".i18n-animation.i18n",e).letterfx({fx:"fall fade",backwards:!1,timing:50,fx_duration:"50ms",letter_end:"restore",element_end:"restore"})})},t.prototype.reloadData=function(){s.rainloopI18N&&(this.data=s.rainloopI18N||{},this.i18nToNode(o(s.document),!0),this.trigger(!this.trigger())),s.rainloopI18N=null},t.prototype.initNotificationLanguage=function(){var e=this.notificationI18N||{};e[a.Notification.InvalidToken]=this.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[a.Notification.AuthError]=this.i18n("NOTIFICATIONS/AUTH_ERROR"),e[a.Notification.AccessError]=this.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[a.Notification.ConnectionError]=this.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[a.Notification.CaptchaError]=this.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[a.Notification.SocialFacebookLoginAccessDisable]=this.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[a.Notification.SocialTwitterLoginAccessDisable]=this.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[a.Notification.SocialGoogleLoginAccessDisable]=this.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[a.Notification.DomainNotAllowed]=this.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[a.Notification.AccountNotAllowed]=this.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[a.Notification.AccountTwoFactorAuthRequired]=this.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[a.Notification.AccountTwoFactorAuthError]=this.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[a.Notification.CouldNotSaveNewPassword]=this.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[a.Notification.CurrentPasswordIncorrect]=this.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[a.Notification.NewPasswordShort]=this.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[a.Notification.NewPasswordWeak]=this.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[a.Notification.NewPasswordForbidden]=this.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[a.Notification.ContactsSyncError]=this.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[a.Notification.CantGetMessageList]=this.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[a.Notification.CantGetMessage]=this.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[a.Notification.CantDeleteMessage]=this.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[a.Notification.CantMoveMessage]=this.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[a.Notification.CantCopyMessage]=this.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[a.Notification.CantSaveMessage]=this.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[a.Notification.CantSendMessage]=this.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[a.Notification.InvalidRecipients]=this.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[a.Notification.CantSaveFilters]=this.i18n("NOTIFICATIONS/CANT_SAVE_FILTERS"),e[a.Notification.CantGetFilters]=this.i18n("NOTIFICATIONS/CANT_GET_FILTERS"),e[a.Notification.FiltersAreNotCorrect]=this.i18n("NOTIFICATIONS/FILTERS_ARE_NOT_CORRECT"),e[a.Notification.CantCreateFolder]=this.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[a.Notification.CantRenameFolder]=this.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[a.Notification.CantDeleteFolder]=this.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[a.Notification.CantDeleteNonEmptyFolder]=this.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[a.Notification.CantSubscribeFolder]=this.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[a.Notification.CantUnsubscribeFolder]=this.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[a.Notification.CantSaveSettings]=this.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[a.Notification.CantSavePluginSettings]=this.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[a.Notification.DomainAlreadyExists]=this.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[a.Notification.CantInstallPackage]=this.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[a.Notification.CantDeletePackage]=this.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[a.Notification.InvalidPluginPackage]=this.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[a.Notification.UnsupportedPluginPackage]=this.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[a.Notification.LicensingServerIsUnavailable]=this.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[a.Notification.LicensingExpired]=this.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[a.Notification.LicensingBanned]=this.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[a.Notification.DemoSendMessageError]=this.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[a.Notification.DemoAccountError]=this.i18n("NOTIFICATIONS/DEMO_ACCOUNT_ERROR"),e[a.Notification.AccountAlreadyExists]=this.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[a.Notification.AccountDoesNotExist]=this.i18n("NOTIFICATIONS/ACCOUNT_DOES_NOT_EXIST"),e[a.Notification.MailServerError]=this.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[a.Notification.InvalidInputArgument]=this.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[a.Notification.UnknownNotification]=this.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[a.Notification.UnknownError]=this.i18n("NOTIFICATIONS/UNKNOWN_ERROR")
},t.prototype.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?this.trigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&this.trigger.subscribe(e,t)},t.prototype.getNotification=function(e,t){return e=s.parseInt(e,10)||0,a.Notification.ClientViewError===e&&t?t:n.isUndefined(this.notificationI18N[e])?"":this.notificationI18N[e]},t.prototype.getUploadErrorDescByCode=function(e){var t="";switch(s.parseInt(e,10)||0){case a.UploadErrorCode.FileIsTooBig:t=this.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case a.UploadErrorCode.FilePartiallyUploaded:t=this.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case a.UploadErrorCode.FileNoUploaded:t=this.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case a.UploadErrorCode.MissingTempFolder:t=this.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case a.UploadErrorCode.FileOnSaveingError:t=this.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case a.UploadErrorCode.FileType:t=this.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=this.i18n("UPLOAD/ERROR_UNKNOWN")}return t},t.prototype.reload=function(e,t,s){var r=this,a=o("html"),l=function(){},c=(new Date).getTime();a.addClass("rl-changing-language"),o.ajax({url:i(12).langLink(e),dataType:"script",cache:!0}).fail(s||l).done(function(){n.delay(function(){r.reloadData(),(t||l)(),a.removeClass("rl-changing-language")},500<(new Date).getTime()-c?1:500)})},e.exports=new t}()},function(e,t,i){!function(){"use strict";var t={},s=i(10),o=i(2),n=i(13),r=i(3),a=i(21),l=i(4);t.$win=n(s),t.$doc=n(s.document),t.$html=n("html"),t.$div=n("<div></div>"),t.now=(new s.Date).getTime(),t.momentTrigger=r.observable(!0),t.dropdownVisibility=r.observable(!1).extend({rateLimit:0}),t.tooltipTrigger=r.observable(!1).extend({rateLimit:0}),t.useKeyboardShortcuts=r.observable(!0),t.iAjaxErrorCount=0,t.iTokenErrorCount=0,t.iMessageBodyCacheCount=0,t.bUnload=!1,t.sUserAgent=(s.navigator.userAgent||"").toLowerCase(),t.bIsiOSDevice=-1<t.sUserAgent.indexOf("iphone")||-1<t.sUserAgent.indexOf("ipod")||-1<t.sUserAgent.indexOf("ipad"),t.bIsAndroidDevice=-1<t.sUserAgent.indexOf("android"),t.bMobileDevice=t.bIsiOSDevice||t.bIsAndroidDevice,t.bDisableNanoScroll=t.bMobileDevice,t.bAllowPdfPreview=!t.bMobileDevice,t.bAnimationSupported=!t.bMobileDevice&&t.$html.hasClass("csstransitions")&&t.$html.hasClass("cssanimations"),t.bXMLHttpRequestSupported=!!s.XMLHttpRequest,t.__APP__=null,t.oHtmlEditorDefaultConfig={title:!1,stylesSet:!1,customConfig:"",contentsCss:"",toolbarGroups:[{name:"spec"},{name:"styles"},{name:"basicstyles",groups:["basicstyles","cleanup","bidi"]},{name:"colors"},{name:"paragraph",groups:["list","indent","blocks","align"]},{name:"links"},{name:"insert"},{name:"document",groups:["mode","document","doctools"]},{name:"others"}],removePlugins:"liststyle,table,quicktable,tableresize,tabletools,contextmenu",removeButtons:"Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll,Source",removeDialogTabs:"link:advanced;link:target;image:advanced;images:advanced",extraPlugins:"plain",allowedContent:!0,font_defaultLabel:"Arial",fontSize_defaultLabel:"13",fontSize_sizes:"10/10px;12/12px;13/13px;14/14px;16/16px;18/18px;20/20px;24/24px;28/28px;36/36px;48/48px"},t.oHtmlEditorLangsMap={bg:"bg",de:"de",es:"es",fr:"fr",hu:"hu",is:"is",it:"it",ja:"ja","ja-jp":"ja",ko:"ko","ko-kr":"ko",lt:"lt",lv:"lv",nl:"nl",no:"no",pl:"pl",pt:"pt","pt-pt":"pt","pt-br":"pt-br",ro:"ro",ru:"ru",sk:"sk",sv:"sv",tr:"tr",ua:"ru",zh:"zh","zh-tw":"zh","zh-cn":"zh-cn"},t.bAllowPdfPreview&&s.navigator&&s.navigator.mimeTypes&&(t.bAllowPdfPreview=!!o.find(s.navigator.mimeTypes,function(e){return e&&"application/pdf"===e.type})),t.aBootstrapDropdowns=[],t.aViewModels={settings:[],"settings-removed":[],"settings-disabled":[]},t.leftPanelDisabled=r.observable(!1),t.popupVisibilityNames=r.observableArray([]),t.popupVisibility=r.computed(function(){return 0<t.popupVisibilityNames().length},this),t.keyScopeReal=r.observable(l.KeyState.All),t.keyScopeFake=r.observable(l.KeyState.All),t.keyScope=r.computed({owner:this,read:function(){return t.keyScopeFake()},write:function(e){l.KeyState.Menu!==e&&(a.filter=l.KeyState.Compose===e?function(){return t.useKeyboardShortcuts()}:function(e){if(t.useKeyboardShortcuts()){var i=e.target||e.srcElement,s=i?i.tagName:"";return s=s.toUpperCase(),!("INPUT"===s||"SELECT"===s||"TEXTAREA"===s||i&&"DIV"===s&&"editorHtmlArea"===i.className&&i.contentEditable)}return!1},t.keyScopeFake(e),t.dropdownVisibility()&&(e=l.KeyState.Menu)),t.keyScopeReal(e)}}),t.keyScopeReal.subscribe(function(e){a.setScope(e)}),t.dropdownVisibility.subscribe(function(e){e?(t.tooltipTrigger(!t.tooltipTrigger()),t.keyScope(l.KeyState.Menu)):l.KeyState.Menu===a.getScope()&&t.keyScope(t.keyScopeFake())}),e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.oSettings=s.rainloopAppData||{},this.oSettings=o.isNormal(this.oSettings)?this.oSettings:{}}var s=i(10),o=i(1);t.prototype.oSettings=null,t.prototype.settingsGet=function(e){return o.isUnd(this.oSettings[e])?null:this.oSettings[e]},t.prototype.settingsSet=function(e,t){this.oSettings[e]=t},t.prototype.capa=function(e){var t=this.settingsGet("Capa");return o.isArray(t)&&o.isNormal(e)&&-1<o.inArray(e,t)},e.exports=new t}()},function(e){e.exports=window},function(e,t,i){!function(){"use strict";function t(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=i(3),o=i(4),n=i(1),r=i(8);t.prototype.bDisabeCloseOnEsc=!1,t.prototype.sPosition="",t.prototype.sTemplate="",t.prototype.sDefaultKeyScope=o.KeyState.None,t.prototype.sCurrentKeyScope=o.KeyState.None,t.prototype.viewModelName="",t.prototype.viewModelNames=[],t.prototype.viewModelDom=null,t.prototype.viewModelTemplate=function(){return this.sTemplate},t.prototype.viewModelPosition=function(){return this.sPosition},t.prototype.cancelCommand=function(){},t.prototype.closeCommand=function(){},t.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=r.keyScope(),r.keyScope(this.sDefaultKeyScope)},t.prototype.restoreKeyScope=function(){r.keyScope(this.sCurrentKeyScope)},t.prototype.registerPopupKeyDown=function(){var e=this;r.$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=t}()},function(e,t,i){!function(){"use strict";function t(){var e=i(9);this.sBase="#/",this.sServer="./?",this.sSubQuery="&s=/",this.sSubSubQuery="&ss=/",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var s=i(10),o=i(1);t.prototype.root=function(){return this.sBase},t.prototype.rootAdmin=function(){return this.sServer+"/Admin/"},t.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/Download/"+this.sSubSubQuery+e},t.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/View/"+this.sSubSubQuery+e},t.prototype.attachmentThumbnailPreview=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ViewThumbnail/"+this.sSubSubQuery+e},t.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ViewAsPlain/"+this.sSubSubQuery+e},t.prototype.attachmentFramed=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/FramedView/"+this.sSubSubQuery+e},t.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.append=function(){return this.sServer+"/Append/"+this.sSubQuery+this.sSpecSuffix+"/"},t.prototype.change=function(e){return this.sServer+"/Change/"+this.sSubQuery+this.sSpecSuffix+"/"+o.encodeURIComponent(e)+"/"},t.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSubQuery+this.sSpecSuffix+"/"+e},t.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ViewAsPlain/"+this.sSubSubQuery+e},t.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/Download/"+this.sSubSubQuery+e},t.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+o.encodeURIComponent(e)+"/"},t.prototype.publicLink=function(e){return this.sServer+"/Raw/0/Public/"+e+"/"},t.prototype.inbox=function(e){return e=o.isUnd(e)?"INBOX":e,this.sBase+"mailbox/"+e},t.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},t.prototype.settings=function(e){var t=this.sBase+"settings";return o.isUnd(e)||""===e||(t+="/"+e),t},t.prototype.about=function(){return this.sBase+"about"},t.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},t.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},t.prototype.phpInfo=function(){return this.sServer+"Info"},t.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},t.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ContactsVcf/"},t.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ContactsCsv/"},t.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},t.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},t.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/"+s.encodeURI(e)+"/images/preview.png"},t.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},t.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/min/openpgp.js"},t.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},t.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},t.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},e.exports=new t}()},function(e){e.exports=window.jQuery},function(e,t,i){!function(){"use strict";function t(){h.call(this),this.oRequests={}}var s=i(2),o=i(1),n=i(16),r=i(92),a=i(30),l=i(26),c=i(9),u=i(19),d=i(15),h=i(59);s.extend(t.prototype,h.prototype),t.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:c.settingsGet("SentFolder"),DraftFolder:c.settingsGet("DraftFolder"),SpamFolder:c.settingsGet("SpamFolder"),TrashFolder:c.settingsGet("TrashFolder"),ArchiveFolder:c.settingsGet("ArchiveFolder")},null,"",["Folders"])},t.prototype.login=function(e,t,i,s,o,n,r,a){this.defaultRequest(e,"Login",{Email:t,Login:i,Password:s,Language:n||"",AdditionalCode:r||"",AdditionalCodeSignMe:a?"1":"0",SignMe:o?"1":"0"})},t.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},t.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},t.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},t.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},t.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},t.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},t.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},t.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)},t.prototype.saveContactsSyncData=function(e,t,i,s,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:i,User:s,Password:o})},t.prototype.accountSetup=function(e,t,i,s){s=o.isUnd(s)?!0:!!s,this.defaultRequest(e,"AccountSetup",{Email:t,Password:i,New:s?"1":"0"})},t.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},t.prototype.accountSortOrder=function(e,t){this.defaultRequest(e,"AccountSortOrder",{Accounts:t})},t.prototype.identityUpdate=function(e,t,i,s,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:i,Name:s,ReplyTo:o,Bcc:n})},t.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},t.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},t.prototype.accountsCounts=function(e){this.defaultRequest(e,"AccountsCounts")},t.prototype.filtersSave=function(e,t,i,o){this.defaultRequest(e,"FiltersSave",{Raw:i,RawIsActive:o?"1":"0",Filters:s.map(t,function(e){return e.toJson()})})},t.prototype.filtersGet=function(e){this.defaultRequest(e,"Filters",{})},t.prototype.messageList=function(e,t,i,s,c,h){t=o.pString(t);var p=u.getFolderHash(t);return h=o.isUnd(h)?!1:!!h,i=o.isUnd(i)?0:o.pInt(i),s=o.isUnd(i)?20:o.pInt(s),c=o.pString(c),""===p||""!==c&&-1!==c.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:i,Limit:s,Search:c,UidNext:u.getFolderInboxName()===t?u.getFolderUidNext(t):"",UseThreads:a.threadsAllowed()&&l.useThreads()?"1":"0",ExpandedThreadUid:a.threadsAllowed()&&t===d.messageListThreadFolder()?d.messageListThreadUids().join(","):""},""===c?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",h?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===c?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,i,s,c,a.projectHash(),p,u.getFolderInboxName()===t?u.getFolderUidNext(t):"",a.threadsAllowed()&&l.useThreads()?"1":"0",a.threadsAllowed()&&t===d.messageListThreadFolder()?d.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),h?[]:["MessageList"])},t.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},t.prototype.message=function(e,t,i){return t=o.pString(t),i=o.pInt(i),u.getFolderFromCacheList(t)&&i>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,i,a.projectHash(),a.threadsAllowed()&&l.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},t.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},t.prototype.composeUploadDrive=function(e,t,i){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:i,Url:t},999e3)},t.prototype.folderInformation=function(e,t,n){var r=!0,a=[];o.isArray(n)&&0<n.length&&(r=!1,s.each(n,function(e){u.getMessageFlagsFromCache(e.folderFullNameRaw,e.uid)||a.push(e.uid),0<e.threads().length&&s.each(e.threads(),function(t){u.getMessageFlagsFromCache(e.folderFullNameRaw,t)||a.push(t)})}),0<a.length&&(r=!0)),r?this.defaultRequest(e,"FolderInformation",{Folder:t,FlagsUids:o.isArray(a)?a.join(","):"",UidNext:u.getFolderInboxName()===t?u.getFolderUidNext(t):""}):l.useThreads()&&i(6).reloadFlagsCurrentMessageListAndMessageFromCache()},t.prototype.folderInformationMultiply=function(e,t){this.defaultRequest(e,"FolderInformationMultiply",{Folders:t})},t.prototype.logout=function(e){this.defaultRequest(e,"Logout")},t.prototype.messageSetFlagged=function(e,t,i,s){this.defaultRequest(e,"MessageSetFlagged",{Folder:t,Uids:i.join(","),SetAction:s?"1":"0"})},t.prototype.messageSetSeen=function(e,t,i,s){this.defaultRequest(e,"MessageSetSeen",{Folder:t,Uids:i.join(","),SetAction:s?"1":"0"})},t.prototype.messageSetSeenToAll=function(e,t,i){this.defaultRequest(e,"MessageSetSeenToAll",{Folder:t,SetAction:i?"1":"0"})},t.prototype.saveMessage=function(e,t,i,s,o,r,a,l,c,u,d,h,p,m,f,g){this.defaultRequest(e,"SaveMessage",{MessageFolder:t,MessageUid:i,DraftFolder:s,From:o,To:r,Cc:a,Bcc:l,Subject:c,TextIsHtml:u?"1":"0",Text:d,DraftInfo:p,InReplyTo:m,References:f,MarkAsImportant:g?"1":"0",Attachments:h},n.Defaults.SaveMessageAjaxTimeout)},t.prototype.sendReadReceiptMessage=function(e,t,i,s,o,n){this.defaultRequest(e,"SendReadReceiptMessage",{MessageFolder:t,MessageUid:i,ReadReceipt:s,Subject:o,Text:n})},t.prototype.sendMessage=function(e,t,i,s,o,r,a,l,c,u,d,h,p,m,f,g,b){this.defaultRequest(e,"SendMessage",{MessageFolder:t,MessageUid:i,SentFolder:s,From:o,To:r,Cc:a,Bcc:l,Subject:c,TextIsHtml:u?"1":"0",Text:d,DraftInfo:p,InReplyTo:m,References:f,ReadReceiptRequest:g?"1":"0",MarkAsImportant:b?"1":"0",Attachments:h},n.Defaults.SendMessageAjaxTimeout)},t.prototype.saveSystemFolders=function(e,t){this.defaultRequest(e,"SystemFoldersUpdate",t)},t.prototype.saveSettings=function(e,t){this.defaultRequest(e,"SettingsUpdate",t)},t.prototype.changePassword=function(e,t,i){this.defaultRequest(e,"ChangePassword",{PrevPassword:t,NewPassword:i})},t.prototype.folderCreate=function(e,t,i){this.defaultRequest(e,"FolderCreate",{Folder:t,Parent:i},null,"",["Folders"])},t.prototype.folderDelete=function(e,t){this.defaultRequest(e,"FolderDelete",{Folder:t},null,"",["Folders"])},t.prototype.folderRename=function(e,t,i){this.defaultRequest(e,"FolderRename",{Folder:t,NewFolderName:i},null,"",["Folders"])},t.prototype.folderClear=function(e,t){this.defaultRequest(e,"FolderClear",{Folder:t})},t.prototype.folderSetSubscribe=function(e,t,i){this.defaultRequest(e,"FolderSubscribe",{Folder:t,Subscribe:i?"1":"0"})},t.prototype.messagesMove=function(e,t,i,s,o){this.defaultRequest(e,"MessageMove",{FromFolder:t,ToFolder:i,Uids:s.join(","),Learning:o||""},null,"",["MessageList"])},t.prototype.messagesCopy=function(e,t,i,s){this.defaultRequest(e,"MessageCopy",{FromFolder:t,ToFolder:i,Uids:s.join(",")})},t.prototype.messagesDelete=function(e,t,i){this.defaultRequest(e,"MessageDelete",{Folder:t,Uids:i.join(",")},null,"",["MessageList"])},t.prototype.appDelayStart=function(e){this.defaultRequest(e,"AppDelayStart")},t.prototype.quota=function(e){this.defaultRequest(e,"Quota")},t.prototype.contacts=function(e,t,i,s){this.defaultRequest(e,"Contacts",{Offset:t,Limit:i,Search:s},null,"",["Contacts"])},t.prototype.contactSave=function(e,t,i,s){this.defaultRequest(e,"ContactSave",{RequestUid:t,Uid:o.trim(i),Properties:s})},t.prototype.contactsDelete=function(e,t){this.defaultRequest(e,"ContactsDelete",{Uids:t.join(",")})},t.prototype.suggestions=function(e,t,i){this.defaultRequest(e,"Suggestions",{Query:t,Page:i},null,"",["Suggestions"])},t.prototype.clearUserBackground=function(e){this.defaultRequest(e,"ClearUserBackground")},t.prototype.facebookUser=function(e){this.defaultRequest(e,"SocialFacebookUserInformation")},t.prototype.facebookDisconnect=function(e){this.defaultRequest(e,"SocialFacebookDisconnect")},t.prototype.twitterUser=function(e){this.defaultRequest(e,"SocialTwitterUserInformation")},t.prototype.twitterDisconnect=function(e){this.defaultRequest(e,"SocialTwitterDisconnect")},t.prototype.googleUser=function(e){this.defaultRequest(e,"SocialGoogleUserInformation")},t.prototype.googleDisconnect=function(e){this.defaultRequest(e,"SocialGoogleDisconnect")},t.prototype.socialUsers=function(e){this.defaultRequest(e,"SocialUsers")},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.contacts=r.observableArray([]),this.contacts.loading=r.observable(!1).extend({throttle:200}),this.contacts.importing=r.observable(!1).extend({throttle:200}),this.contacts.syncing=r.observable(!1).extend({throttle:200}),this.contacts.exportingVcf=r.observable(!1).extend({throttle:200}),this.contacts.exportingCsv=r.observable(!1).extend({throttle:200}),this.allowContactsSync=r.observable(!1),this.enableContactsSync=r.observable(!1),this.contactsSyncUrl=r.observable(""),this.contactsSyncUser=r.observable(""),this.contactsSyncPass=r.observable(""),this.allowContactsSync=r.observable(!!f.settingsGet("ContactsSyncIsAllowed")),this.enableContactsSync=r.observable(!!f.settingsGet("EnableContactsSync")),this.contactsSyncUrl=r.observable(f.settingsGet("ContactsSyncUrl")),this.contactsSyncUser=r.observable(f.settingsGet("ContactsSyncUser")),this.contactsSyncPass=r.observable(f.settingsGet("ContactsSyncPassword")),this.namespace="",this.folderList=r.observableArray([]),this.folderList.focused=r.observable(!1),this.folderList.optimized=r.observable(!1),this.folderList.error=r.observable(""),this.foldersLoading=r.observable(!1),this.foldersCreating=r.observable(!1),this.foldersDeleting=r.observable(!1),this.foldersRenaming=r.observable(!1),this.foldersChanging=r.computed(function(){var e=this.foldersLoading(),t=this.foldersCreating(),i=this.foldersDeleting(),s=this.foldersRenaming();return e||t||i||s},this),this.foldersInboxUnreadCount=r.observable(0),this.currentFolder=r.observable(null).extend({toggleSubscribe:[null,function(e){e&&e.selected(!1)},function(e){e&&e.selected(!0)}]}),this.currentFolderFullNameRaw=r.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this),this.currentFolderFullName=r.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this),this.currentFolderFullNameHash=r.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this),this.currentFolderName=r.computed(function(){return this.currentFolder()?this.currentFolder().name():""},this),this.folderListSystemNames=r.computed(function(){var e=i(32),t=[g.getFolderInboxName()],s=this.folderList(),o=e.sentFolder(),n=e.draftFolder(),r=e.spamFolder(),a=e.trashFolder(),c=e.archiveFolder();return d.isArray(s)&&0<s.length&&(""!==o&&l.Values.UnuseOptionValue!==o&&t.push(o),""!==n&&l.Values.UnuseOptionValue!==n&&t.push(n),""!==r&&l.Values.UnuseOptionValue!==r&&t.push(r),""!==a&&l.Values.UnuseOptionValue!==a&&t.push(a),""!==c&&l.Values.UnuseOptionValue!==c&&t.push(c)),t},this),this.folderListSystem=r.computed(function(){return o.compact(o.map(this.folderListSystemNames(),function(e){return g.getFolderFromCacheList(e)}))},this),this.folderMenuForMove=r.computed(function(){return d.folderListOptionsBuilder(this.folderListSystem(),this.folderList(),[this.currentFolderFullNameRaw()],null,null,null,null,function(e){return e?e.localName():""})},this),this.folderMenuForFilters=r.computed(function(){return d.folderListOptionsBuilder(this.folderListSystem(),this.folderList(),["INBOX"],[["",""]],null,null,null,function(e){return e?e.localName():""})},this),this.staticMessageList=[],this.messageList=r.observableArray([]).extend({rateLimit:0}),this.messageListCount=r.observable(0),this.messageListSearch=r.observable(""),this.messageListPage=r.observable(1),this.messageListThreadFolder=r.observable(""),this.messageListThreadUids=r.observableArray([]),this.messageListThreadFolder.subscribe(function(){this.messageListThreadUids([])},this),this.messageListEndFolder=r.observable(""),this.messageListEndSearch=r.observable(""),this.messageListEndPage=r.observable(1),this.messageListEndHash=r.computed(function(){return this.messageListEndFolder()+"|"+this.messageListEndSearch()+"|"+this.messageListEndPage()},this),this.messageListPageCount=r.computed(function(){var e=s.Math.ceil(this.messageListCount()/m.messagesPerPage());return 0>=e?1:e},this),this.mainMessageListSearch=r.computed({read:this.messageListSearch,write:function(e){b.setHash(h.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=r.observable(""),this.messageListLoading=r.observable(!1),this.messageListIsNotCompleted=r.observable(!1),this.messageListCompleteLoadingThrottle=r.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=r.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 y,this.message=r.observable(null),this.messageLoading=r.observable(!1),this.messageLoadingThrottle=r.observable(!1).extend({throttle:50}),this.message.focused=r.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===m.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===m.layout()&&-1<s.location.hash.indexOf("message-preview")&&i(6).historyBack())},this),this.message.focused.subscribe(function(e){e?(this.folderList.focused(!1),u.keyScope(c.KeyState.MessageView)):c.KeyState.MessageView===u.keyScope()&&u.keyScope(c.Layout.NoPreview===m.layout()&&this.message()?c.KeyState.MessageView:c.KeyState.MessageList)},this),this.folderList.focused.subscribe(function(e){e?u.keyScope(c.KeyState.FolderList):c.KeyState.FolderList===u.keyScope()&&u.keyScope(c.KeyState.MessageList)}),this.messageLoading.subscribe(function(e){this.messageLoadingThrottle(e)},this),this.messageFullScreenMode=r.observable(!1),this.messageError=r.observable(""),this.messagesBodiesDom=r.observable(null),this.messagesBodiesDom.subscribe(function(e){!e||e instanceof n||this.messagesBodiesDom(n(e))},this),this.messageActiveDom=r.observable(null),this.isMessageSelected=r.computed(function(){return null!==this.message()},this),this.currentMessage=r.observable(null),this.messageListChecked=r.computed(function(){return o.filter(this.messageList(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.hasCheckedMessages=r.computed(function(){return 0<this.messageListChecked().length},this).extend({rateLimit:0}),this.messageListCheckedOrSelected=r.computed(function(){var e=this.messageListChecked(),t=this.currentMessage();return o.union(e,t?[t]:[])},this),this.messageListCheckedOrSelectedUidsWithSubMails=r.computed(function(){var e=[];return o.each(this.messageListCheckedOrSelected(),function(t){t&&(e.push(t.uid),0<t.threadsLen()&&0===t.parentUid()&&t.lastInCollapsedThread()&&(e=o.union(e,t.threads())))}),e},this),this.composeInEdit=r.observable(!1),this.purgeMessageBodyCacheThrottle=o.throttle(this.purgeMessageBodyCache,3e4)}var s=i(10),o=i(2),n=i(13),r=i(3),a=i(36),l=i(16),c=i(4),u=i(8),d=i(1),h=i(12),p=i(7),m=i(26),f=i(9),g=i(19),b=i(5),y=i(81);t.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)))},t.prototype.initUidNextAndNewMessages=function(e,t,s){if(g.getFolderInboxName()===e&&d.isNormal(t)&&""!==t){if(d.isArray(s)&&0<s.length){var n=0,r=s.length,a=i(66);if(o.each(s,function(t){g.addNewMessageCache(e,t.Uid)}),a.playSoundNotification(),r>3)a.displayDesktopNotification(h.notificationMailIcon(),i(22).email(),p.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>n;n++)a.displayDesktopNotification(h.notificationMailIcon(),y.emailsToLine(y.initEmailsFromJson(s[n].From),!1),s[n].Subject)}g.setFolderUidNext(e,t)}},t.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},t.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],i=5,s=a().unix(),n=s-300,r=[],l=g.getFolderInboxName(),c=function(t){o.each(t,function(t){t&&l!==t.fullNameRaw&&t.selectable&&t.existen&&n>t.interval&&(!e||t.subScribed())&&r.push([t.interval,t.fullNameRaw]),t&&0<t.subFolders().length&&c(t.subFolders())})};return c(this.folderList()),r.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),o.find(r,function(e){var o=g.getFolderFromCacheList(e[1]);return o&&(o.interval=s,t.push(e[1])),i<=t.length}),o.uniq(t)},t.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,r=0,a=this.messageList(),l=g.getFolderFromCacheList(e),c=""===i?null:g.getFolderFromCacheList(i||""),u=this.currentFolderFullNameRaw(),h=this.message(),p=u===e?o.filter(a,function(e){return e&&-1<d.inArray(d.pInt(e.uid),t)}):[];o.each(p,function(e){e&&e.unseen()&&r++}),l&&!s&&(l.messageCountAll(0<=l.messageCountAll()-t.length?l.messageCountAll()-t.length:0),r>0&&l.messageCountUnread(0<=l.messageCountUnread()-r?l.messageCountUnread()-r:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),r>0&&c.messageCountUnread(c.messageCountUnread()+r),c.actionBlink(!0)),0<p.length&&(s?o.each(p,function(e){e.checked(!1)}):(this.messageListIsNotCompleted(!0),o.each(p,function(e){h&&h.hash===e.hash&&(h=null,n.message(null)),e.deleted(!0)}),o.delay(function(){o.each(p,function(e){n.messageList.remove(e)})},400))),""!==e&&g.setFolderHash(e,""),""!==i&&g.setFolderHash(i,"")},t.prototype.initBlockquoteSwitcher=function(e){if(e){var t=n("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===n(this).parent().closest("blockquote",e).length});t&&0<t.length&&o.delay(function(){t.each(function(){var e=n(this),t=e.height();(0===t||t>150)&&(e.addClass("rl-bq-switcher hidden-bq"),n('<span class="rlBlockquoteSwitcher"><i class="icon-ellipsis" /></span>').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),d.windowResize()}).after("<br />").before("<br />"))})},100)}},t.prototype.setMessage=function(e,t){var s=!1,o=!1,r=!1,a=null,l=null,h="",p="",f=!1,b=!1,y=this.messagesBodiesDom(),S=this.message();e&&S&&e.Result&&"Object/Message"===e.Result["@Object"]&&S.folderFullNameRaw===e.Result.Folder&&S.uid===e.Result.Uid&&(this.messageError(""),S.initUpdateByMessageJson(e.Result),g.addRequestedMessage(S.folderFullNameRaw,S.uid),t||S.initFlagsByJson(e.Result),y=y&&y[0]?y:null,y&&(h="rl-mgs-"+S.hash.replace(/[^a-zA-Z0-9]/g,""),l=y.find("#"+h),l&&l[0]?(S.body=l,S.body&&(S.body.data("rl-cache-count",++u.iMessageBodyCacheCount),S.fetchDataToDom())):(o=!!e.Result.HasExternals,r=!!e.Result.HasInternals,a=n('<div id="'+h+'" />').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),(S.isPgpSigned()||S.isPgpEncrypted())&&i(20).capaOpenPGP()&&(S.plainRaw=d.pString(e.Result.Plain),b=/---BEGIN PGP MESSAGE---/.test(S.plainRaw),b||(f=/-----BEGIN PGP SIGNED MESSAGE-----/.test(S.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(S.plainRaw)),u.$div.empty(),f&&S.isPgpSigned()?p=u.$div.append(n('<pre class="b-plain-openpgp signed"></pre>').text(S.plainRaw)).html():b&&S.isPgpEncrypted()&&(p=u.$div.append(n('<pre class="b-plain-openpgp encrypted"></pre>').text(S.plainRaw)).html()),u.$div.empty(),S.isPgpSigned(f),S.isPgpEncrypted(b))):s=!1,a.html(d.findEmailAndLinks(p)).addClass("b-text-part "+(s?"html":"plain")),S.isHtml(!!s),S.hasImages(!!o),S.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),S.pgpSignedVerifyUser(""),S.body=a,S.body&&y.append(S.body),S.storeDataToDom(),r&&S.showInternalImages(!0),S.hasImages()&&m.showImages()&&S.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(S.body),this.hideMessageBodies(),S.body.show(),a&&this.initBlockquoteSwitcher(a)),g.initMessageFlagsFromCache(S),S.unseen()&&i(6).setMessageSeen(S),d.windowResize())},t.prototype.calculateMessageListHash=function(e){return o.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()
}).join("|")},t.prototype.findPublicKeyByHex=function(e){return o.find(i(20).openpgpkeysPublic(),function(t){return t&&e===t.id})},t.prototype.findPublicKeysByEmail=function(e){var t=this;return o.compact(o.map(i(20).openpgpkeysPublic(),function(i){var s=null;if(i&&e===i.email)try{if(s=t.openpgp.key.readArmored(i.armor),s&&!s.err&&s.keys&&s.keys[0])return s.keys[0]}catch(o){}return null}))},t.prototype.findPrivateKeyByEmail=function(e,t){var s=this,n=null,r=o.find(i(20).openpgpkeysPrivate(),function(t){return t&&e===t.email});if(r)try{n=s.openpgp.key.readArmored(r.armor),n&&!n.err&&n.keys&&n.keys[0]?(n=n.keys[0],n.decrypt(d.pString(t))):n=null}catch(a){n=null}return n},t.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(i(22).email(),e)},e.exports=new t}()},function(e,t,i){(function(e){!function(){"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.SieveDefaulPort=4190,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.Values.RainLoopTrialKey="RAINLOOP-TRIAL-KEY",t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAHHklEQVRoQ7VZW08bVxCeXRuwIbTGXIwNtBBaqjwgVUiR8lDlbza9qe1DpVZ9aNQ/0KpPeaJK07SpcuEeCEmUAObm21bfrL9lONjexSYrWfbunj37zXdmvpkz9oIgCKTD0Wg0xPd94TDP83Q0zvWa50vzklSrdanVanqf4/D84GBGr+F+Op3S8fqoJxLOdnZgTvsO/nYhenHA+UC7CWF1uXwkb9++ldPTUwVerVbVqFQqpR8YPjQ0JCMjI5LNDijoRgP3PQVu5+5Eor2XGLg7IV4GkIdHJ/LmzRs5ODiIwNbrdR0O0GCcq4Xz4eFhmZyclP7+tDQaIik/BG5XKQn4SwG3zJTLZXn9+rUclI8UHD5YVoDDN8bSzXhONwL48fFxGR4eilzFZT1uFRIB5yT8BqCdnR3Z3d0VP9Un6XRawYJpggVrZBv38ME4XKtUKnLt2jUplUoy1PR/l3U7T6sVSAQcgMAkj8PDQ9ne3pajoyMRL7zeKsYZWHgWYDGmv78/mmdwcFA+mJlSgziHDWrERrsjEXDXegTi1tZW+DLxI2bxIrqFNYTXyDyCFweMAHCwb8e4RnTNuOsqe3t7sra21pTD0Kct666E8XlcZyzw9/RUUXK5nK5oUinUQI6TQ3cynO/v78vq6qrKXCNwlTiJJpyNGc3nZHp6uqV2dwrQWOCtZBDAV1ZWwsQk7f0wiQn5kffbAu/0/KWBYzIC1+XukfGx0RGZmppKlC2tIV0Bh4aDcZW7HhkfH8urLLZL7T2pihvlkMNnz56FiadHxicL41IsFpN41bkxsYxbRdFo9jwB8KdPn14J8KnSpBQKhQs63nPmbCVRcBUAR2Lq1VVmpksyMTFxAXjcEsQybiegESionjx5osCZOeNe1O4+EhCAX7bQSgQcxRHTMgAgcz5+/Dis/hL4uHU3/B4YGNASGHIKxuEql0k+l05AeIAF1vPnz5VxFFmdDlaJrMtZITJeSsXCOTlMunKxjLtMYOKNjQ158eJFuAuKkUOb5sEwgff19SkJUBVkThZUbnXZrtCKBQ6gbnWIkjZpyne3ejAWoGnA7Icz6irvBLgbOMicCM6TkxPx/LAkbXfgWcsazuE2kFRsKD5Z+CiqDumKncpZvieWcS6dDVD8xiYCNflpJdwcdwJOf9airLmVQ7DPzMxIYWLsXGXoVqLt5k0M3K3JUVPDZdbWNzsCp48TPFdvdnZWUz32nDha7bJ63kgAJPzSdRks9/Kf9xMJAQ1gq2NpaUmy2Yz4zar4nQC3xb99AQwCcGzLAAwuhG8YiWvcOKts+r4GOe5nMhm5efOm9lUA3E3vSZJRrKvE0fnPv//Jy5cvo5cTHIPQbSjhOoqq69evS19f6lxDKK4+sVhigZPtKJqbrQeqxd5+WR4+fKgqgT0k2XX3nhiPgETWXFhYkFzuPZ2yVq1GTSOXpE47/VjgNnD4m4GG7/LhsTx69EiwD4Vr2MwIIxgbAH18fKx1yfz8vEogNvGtWnCuhLZa9UTAreVWFsHy/b/+Vrbdl7E5REMQD2jDoUbByty+/ZnU64GkU2HzyJLhktU1cLv8nARgkYS2d3ajAgwG8qU2oLmDZ92CMaOjo7K4uCiZgbDWaRWgnZhPxLhrMUCvr69riwKZk1LHF7XqrWAO9hJxH6ozNzcnCx/PqztZg9mf6SQMscCtm2C5ke4BGMlHWTUp36036AJajDVrFMzBrhhWslQsSrFYiOqVpMriNYIgqFRq2j3FAb/zffT6zuxFXxsNzs3NTXn16lW4gYiW96w1FyedF+83xG/2FNGCRpU4NjamMsn+OZ9xE5RXqdaDdPpib6RWCzuwKF9RxqI2AVNQBwQYJoK0wdBejnqtEikP3pfP51XjUTESl12FqJEKxsEorARYDD44ONTeID7YpsEnrRvQfWAI2e8WfDaTUSIwJ0iBCmFOtOUAHvVMPp/TPwvYFVYFIuP8l+DBgwdaa2Miqwa0GgYwfeMltovbDfh6c1vIgMYcliSsKv4IWFr6VDHxvldvBAH+1sA+cnl5WYOPmmr9ir+1l9I0Cgz0yjhXjfJJ0JROnmezWbl165ayr/5fqwcBNr7IfhjMqKcvESSM4eRcCasQ3bDNObmKPLdGUGpZsN24cUNLBm9zazu4d++e6qpNBFaTuUS26U5dpuR1CxyA7J9ddrMRqlz4pwLLYawymPd++/2PADt2ugcGwq9gCCdhQ96C6xWwa6j1ceuq+I0EhW0i8MAIVJfeL3d/DVD8EKi12P6/2S2jV/EccVB54O/ejz/9HGCpoBBMta5rXMXLu53D1XAwjhXwvvv+h4BAXVe4bOu3O3ChxF08LiZFG3fel199G9CH3fLyqv24NcB44MRhpdK788U3CpyKwsCw590xmfSpzsBt0Fqc3ud3vtZigxWcVZCklVpSiN0w3q5E/h9TGMIUuA3+EQAAAABJRU5ErkJggg==",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(e)}).call(t,i(70)(e))},,,function(e,t,i){!function(){"use strict";function t(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={},this.bCapaGravatar=a.capa(o.Capa.Gravatar)}var s=i(2),o=i(4),n=i(1),r=i(12),a=i(9);t.prototype.bCapaGravatar=!1,t.prototype.oFoldersCache={},t.prototype.oFoldersNamesCache={},t.prototype.oFolderHashCache={},t.prototype.oFolderUidNextCache={},t.prototype.oMessageListHashCache={},t.prototype.oMessageFlagsCache={},t.prototype.oBodies={},t.prototype.oNewMessage={},t.prototype.oRequestedMessage={},t.prototype.clear=function(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oBodies={}},t.prototype.getUserPic=function(e,t){e=n.trim(e),t(this.bCapaGravatar&&""!==e?r.avatarLink(e):"",e)},t.prototype.getMessageKey=function(e,t){return e+"#"+t},t.prototype.addRequestedMessage=function(e,t){this.oRequestedMessage[this.getMessageKey(e,t)]=!0},t.prototype.hasRequestedMessage=function(e,t){return!0===this.oRequestedMessage[this.getMessageKey(e,t)]},t.prototype.addNewMessageCache=function(e,t){this.oNewMessage[this.getMessageKey(e,t)]=!0},t.prototype.hasNewMessageAndRemoveFromCache=function(e,t){return this.oNewMessage[this.getMessageKey(e,t)]?(this.oNewMessage[this.getMessageKey(e,t)]=null,!0):!1},t.prototype.clearNewMessageCache=function(){this.oNewMessage={}},t.prototype.sInboxFolderName="",t.prototype.getFolderInboxName=function(){return""===this.sInboxFolderName?"INBOX":this.sInboxFolderName},t.prototype.getFolderFullNameRaw=function(e){return""!==e&&this.oFoldersNamesCache[e]?this.oFoldersNamesCache[e]:""},t.prototype.setFolderFullNameRaw=function(e,t){this.oFoldersNamesCache[e]=t,("INBOX"===t||""===this.sInboxFolderName)&&(this.sInboxFolderName=t)},t.prototype.getFolderHash=function(e){return""!==e&&this.oFolderHashCache[e]?this.oFolderHashCache[e]:""},t.prototype.setFolderHash=function(e,t){this.oFolderHashCache[e]=t},t.prototype.getFolderUidNext=function(e){return""!==e&&this.oFolderUidNextCache[e]?this.oFolderUidNextCache[e]:""},t.prototype.setFolderUidNext=function(e,t){this.oFolderUidNextCache[e]=t},t.prototype.getFolderFromCacheList=function(e){return""!==e&&this.oFoldersCache[e]?this.oFoldersCache[e]:null},t.prototype.setFolderToCacheList=function(e,t){this.oFoldersCache[e]=t},t.prototype.removeFolderFromCacheList=function(e){this.setFolderToCacheList(e,null)},t.prototype.getMessageFlagsFromCache=function(e,t){return this.oMessageFlagsCache[e]&&this.oMessageFlagsCache[e][t]?this.oMessageFlagsCache[e][t]:null},t.prototype.setMessageFlagsToCache=function(e,t,i){this.oMessageFlagsCache[e]||(this.oMessageFlagsCache[e]={}),this.oMessageFlagsCache[e][t]=i},t.prototype.clearMessageFlagsFromCacheByFolder=function(e){this.oMessageFlagsCache[e]={}},t.prototype.initMessageFlagsFromCache=function(e){if(e){var t=this,i=this.getMessageFlagsFromCache(e.folderFullNameRaw,e.uid),o=null,r=null;i&&0<i.length&&(e.unseen(!!i[0]),e.flagged(!!i[1]),e.answered(!!i[2]),e.forwarded(!!i[3]),e.isReadReceipt(!!i[4])),0<e.threads().length&&(o=s.find(e.threads(),function(i){var s=t.getMessageFlagsFromCache(e.folderFullNameRaw,i);return s&&0<s.length&&!!s[0]}),r=s.find(e.threads(),function(i){var s=t.getMessageFlagsFromCache(e.folderFullNameRaw,i);return s&&0<s.length&&!!s[1]}),e.hasUnseenSubMessage(o&&0<n.pInt(o)),e.hasFlaggedSubMessage(r&&0<n.pInt(r)))}},t.prototype.storeMessageFlagsToCache=function(e){e&&this.setMessageFlagsToCache(e.folderFullNameRaw,e.uid,[e.unseen(),e.flagged(),e.answered(),e.forwarded(),e.isReadReceipt()])},t.prototype.storeMessageFlagsToCacheByFolderAndUid=function(e,t,i){n.isArray(i)&&0<i.length&&this.setMessageFlagsToCache(e,t,i)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.capaOpenPGP=s.observable(!1),this.openpgp=null,this.openpgpkeys=s.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)})}var s=i(3);t.prototype.isSupported=function(){return!!this.openpgp},e.exports=new t}()},function(e){e.exports=window.key},function(e,t,i){!function(){"use strict";function t(){this.email=o.observable(""),this.displayName=o.observable(""),this.replyTo=o.observable(""),this.signature=o.observable(""),this.accounts=o.observableArray([]),this.accounts.loading=o.observable(!1).extend({throttle:100}),this.accountsEmailNames=o.observableArray([]).extend({throttle:1e3}),this.accountsEmailNames.skipFirst=!0,this.accounts.subscribe(function(e){this.accountsEmailNames(s.compact(s.map(e,function(e){return e?e.email:null})))},this),this.accountsEmailNames.subscribe(function(e){this.accountsEmailNames.skipFirst?this.accountsEmailNames.skipFirst=!1:e&&1<e.length&&r.accountSortOrder(null,e)},this),this.accountsUnreadCount=o.computed(function(){var e=0;return e},this)}var s=i(2),o=i(3),n=i(9),r=i(14);t.prototype.populate=function(){this.email(n.settingsGet("Email")),this.displayName(n.settingsGet("DisplayName")),this.replyTo(n.settingsGet("ReplyTo")),this.signature(n.settingsGet("Signature"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.oSettings=i(9),this.oViewModelsHooks={},this.oSimpleHooks={}}var s=i(2),o=i(8),n=i(1);t.prototype.oSettings={},t.prototype.oViewModelsHooks={},t.prototype.oSimpleHooks={},t.prototype.addHook=function(e,t){n.isFunc(t)&&(n.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},t.prototype.runHook=function(e,t){n.isArray(this.oSimpleHooks[e])&&(t=t||[],s.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},t.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},t.prototype.remoteRequest=function(e,t,i,s,n,r){o.__APP__&&o.__APP__.remote().defaultRequest(e,t,i,s,n,r)},t.prototype.settingsGet=function(e,t){var i=this.oSettings.settingsGet("Plugins");return i=i&&!n.isUnd(i[e])?i[e]:null,i?n.isUnd(i[t])?null:i[t]:null},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(e){this.sModelName=e||"",this.disposables=[]}var s=i(2),o=i(1);t.prototype.regDisposables=function(e){o.isArray(e)?s.each(e,function(e){this.disposables.push(e)},this):e&&this.disposables.push(e)},t.prototype.onDestroy=function(){o.disposeObject(this)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t,i,s){this.email=e||"",this.name=t||"",this.dkimStatus=i||"none",this.dkimValue=s||"",this.clearDuplicateName()}var s=i(1);t.newInstanceFromJson=function(e){var i=new t;return i.initByJson(e)?i:null},t.prototype.name="",t.prototype.email="",t.prototype.dkimStatus="none",t.prototype.dkimValue="",t.prototype.clear=function(){this.email="",this.name="",this.dkimStatus="none",this.dkimValue=""},t.prototype.validate=function(){return""!==this.name||""!==this.email},t.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},t.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},t.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},t.prototype.parse=function(e){this.clear(),e=s.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)},t.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),this.dkimStatus=s.trim(e.DkimStatus||""),this.dkimValue=s.trim(e.DkimValue||""),t=""!==this.email,this.clearDuplicateName()),t},t.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?'<a href="mailto:'+s.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+s.encodeHtml(this.name)+"</a>":i?s.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=s.encodeHtml('"'+this.name+'" <')+'<a href="mailto:'+s.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+s.encodeHtml(o)+"</a>"+s.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=s.encodeHtml(o))):t&&(o='<a href="mailto:'+s.encodeHtml(this.email)+'" target="_blank" tabindex="-1">'+s.encodeHtml(this.email)+"</a>"))),o},t.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="",r="",a=!1,l=!1,c=!1,u=null,d=0,h=0,p=0;p<e.length;){switch(e.substr(p,1)){case'"':a||l||c?l||c||(h=p,o=t(e,d+1,h-d-1),e=i(e,"",d,h-d+1),h=0,p=0,d=0,a=!1):(a=!0,d=p);break;case"<":a||l||c||(p>0&&0===o.length&&(o=t(e,0,p)),l=!0,d=p);break;case">":l&&(h=p,n=t(e,d+1,h-d-1),e=i(e,"",d,h-d+1),h=0,p=0,d=0,l=!1);break;case"(":a||l||c||(c=!0,d=p);break;case")":c&&(h=p,r=t(e,d+1,h-d-1),e=i(e,"",d,h-d+1),h=0,p=0,d=0,c=!1);break;case"\\":p++}p++}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===r.length&&(o=e.replace(n,"")),n=s.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=s.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=s.trim(r).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),r=r.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.layout=s.observable(n.Layout.SidePreview).extend({limitedList:[n.Layout.SidePreview,n.Layout.BottomPreview,n.Layout.NoPreview]}),this.editorDefaultType=s.observable(n.EditorDefaultType.Html).extend({limitedList:[n.EditorDefaultType.Html,n.EditorDefaultType.Plain,n.EditorDefaultType.HtmlForced,n.EditorDefaultType.PlainForced]}),this.messagesPerPage=s.observable(o.Defaults.MessagesPerPage).extend({limitedList:o.Defaults.MessagesPerPageArray}),this.showImages=s.observable(!1),this.useCheckboxesInList=s.observable(!0),this.useThreads=s.observable(!1),this.replySameFolder=s.observable(!1),this.computedProperies(),this.subscribes()}var s=i(3),o=i(16),n=i(4),r=i(8),a=i(1),l=i(28),c=i(9);t.prototype.computedProperies=function(){this.usePreviewPane=s.computed(function(){return n.Layout.NoPreview!==this.layout()},this)},t.prototype.subscribes=function(){this.layout.subscribe(function(e){r.$html.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===e),r.$html.toggleClass("rl-side-preview-pane",n.Layout.SidePreview===e),r.$html.toggleClass("rl-bottom-preview-pane",n.Layout.BottomPreview===e),l.pub("layout",[e])})},t.prototype.populate=function(){this.layout(a.pInt(c.settingsGet("Layout"))),this.editorDefaultType(c.settingsGet("EditorDefaultType")),this.messagesPerPage(c.settingsGet("MPP")),this.showImages(!!c.settingsGet("ShowImages")),this.useCheckboxesInList(!!c.settingsGet("UseCheckboxesInList")),this.useThreads(!!c.settingsGet("UseThreads")),this.replySameFolder(!!c.settingsGet("ReplySameFolder"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){L.call(this,"Popups","PopupsCompose");var e=this;this.oEditor=null,this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.triggerForResize=o.bind(this.triggerForResize,this),this.bCapaAdditionalIdentities=A.capa(u.Capa.AdditionalIdentities),this.allowContacts=!!y.contactsIsAllowed(),this.bSkipNextHide=!1,this.composeInEdit=E.composeInEdit,this.editorDefaultType=S.editorDefaultType,this.capaOpenPGP=T.capaOpenPGP,this.resizer=r.observable(!1).extend({throttle:50}),this.identitiesDropdownTrigger=r.observable(!1),this.to=r.observable(""),this.to.focusTrigger=r.observable(!1),this.cc=r.observable(""),this.bcc=r.observable(""),this.replyTo=r.observable(""),this.subject=r.observable(""),this.isHtml=r.observable(!1),this.requestReadReceipt=r.observable(!1),this.markAsImportant=r.observable(!1),this.sendError=r.observable(!1),this.sendSuccessButSaveError=r.observable(!1),this.savedError=r.observable(!1),this.savedTime=r.observable(0),this.savedOrSendingText=r.observable(""),this.emptyToError=r.observable(!1),this.attachmentsInProcessError=r.observable(!1),this.attachmentsInErrorError=r.observable(!1),this.showCc=r.observable(!1),this.showBcc=r.observable(!1),this.cc.subscribe(function(t){!1===e.showCc()&&0<t.length&&e.showCc(!0)},this),this.bcc.subscribe(function(t){!1===e.showBcc()&&0<t.length&&e.showBcc(!0)},this),this.draftFolder=r.observable(""),this.draftUid=r.observable(""),this.sending=r.observable(!1),this.saving=r.observable(!1),this.attachments=r.observableArray([]),this.attachmentsInProcess=this.attachments.filter(function(e){return e&&!e.complete()}),this.attachmentsInReady=this.attachments.filter(function(e){return e&&e.complete()}),this.attachmentsInError=this.attachments.filter(function(e){return e&&""!==e.error()}),this.attachmentsCount=r.computed(function(){return this.attachments().length},this),this.attachmentsInErrorCount=r.computed(function(){return this.attachmentsInError().length},this),this.attachmentsInProcessCount=r.computed(function(){return this.attachmentsInProcess().length},this),this.isDraftFolderMessage=r.computed(function(){return""!==this.draftFolder()&&""!==this.draftUid()},this),this.attachmentsPlace=r.observable(!1),this.attachments.subscribe(h.windowResizeCallback),this.attachmentsPlace.subscribe(h.windowResizeCallback),this.attachmentsInErrorCount.subscribe(function(e){0===e&&this.attachmentsInErrorError(!1)},this),this.composeUploaderButton=r.observable(null),this.composeUploaderDropPlace=r.observable(null),this.dragAndDropEnabled=r.observable(!1),this.dragAndDropOver=r.observable(!1).extend({throttle:1}),this.dragAndDropVisible=r.observable(!1).extend({throttle:1}),this.attacheMultipleAllowed=r.observable(!1),this.addAttachmentEnabled=r.observable(!1),this.composeEditorArea=r.observable(null),this.identities=v.identities,this.defaultIdentityID=v.defaultIdentityID,this.currentIdentityID=r.observable(""),this.currentIdentityString=r.observable(""),this.currentIdentityResultEmail=r.observable(""),this.identitiesOptions=r.computed(function(){var e=[{optValue:w.email(),optText:this.formattedFrom(!1)}];return o.each(v.identities(),function(t){e.push({optValue:t.id,optText:t.formattedNameForCompose()})}),e},this),r.computed(function(){var e="",t="",i=null,s=v.identities(),n=this.currentIdentityID();return this.bCapaAdditionalIdentities&&n&&n!==w.email()&&(i=o.find(s,function(e){return e&&n===e.id}),e=i?i.formattedNameForCompose():"",t=i?i.formattedNameForEmail():"",""===e&&s[0])?(this.currentIdentityID(s[0].id),""):(""===e&&(e=this.formattedFrom(!1),t=this.formattedFrom(!0)),this.currentIdentityString(e),this.currentIdentityResultEmail(t),e)},this),this.to.subscribe(function(e){this.emptyToError()&&0<e.length&&this.emptyToError(!1)},this),this.attachmentsInProcess.subscribe(function(e){this.attachmentsInProcessError()&&h.isArray(e)&&0===e.length&&this.attachmentsInProcessError(!1)},this),this.editorResizeThrottle=o.throttle(o.bind(this.editorResize,this),100),this.resizer.subscribe(function(){this.editorResizeThrottle()},this),this.canBeSendedOrSaved=r.computed(function(){return!this.sending()&&!this.saving()},this),this.deleteCommand=h.createCommand(this,function(){i(6).deleteMessagesFromFolderWithoutCheck(this.draftFolder(),[this.draftUid()]),P.hideScreenPopup(t)},function(){return this.isDraftFolderMessage()}),this.sendMessageResponse=o.bind(this.sendMessageResponse,this),this.saveMessageResponse=o.bind(this.saveMessageResponse,this),this.sendCommand=h.createCommand(this,function(){var e=h.trim(this.to()),t=C.sentFolder(),s=[];0<this.attachmentsInProcess().length?(this.attachmentsInProcessError(!0),this.attachmentsPlace(!0)):0<this.attachmentsInError().length?(this.attachmentsInErrorError(!0),this.attachmentsPlace(!0)):0===e.length?this.emptyToError(!0):(S.replySameFolder()&&h.isArray(this.aDraftInfo)&&3===this.aDraftInfo.length&&h.isNormal(this.aDraftInfo[2])&&0<this.aDraftInfo[2].length&&(t=this.aDraftInfo[2]),""===t?P.showScreenPopup(i(44),[u.SetSystemFoldersNotification.Sent]):(this.sendError(!1),this.sending(!0),h.isArray(this.aDraftInfo)&&3===this.aDraftInfo.length&&(s=N.getMessageFlagsFromCache(this.aDraftInfo[2],this.aDraftInfo[1]),s&&("forward"===this.aDraftInfo[0]?s[3]=!0:s[2]=!0,N.setMessageFlagsToCache(this.aDraftInfo[2],this.aDraftInfo[1],s),i(6).reloadFlagsCurrentMessageListAndMessageFromCache(),N.setFolderHash(this.aDraftInfo[2],""))),t=d.Values.UnuseOptionValue===t?"":t,N.setFolderHash(this.draftFolder(),""),N.setFolderHash(t,""),R.sendMessage(this.sendMessageResponse,this.draftFolder(),this.draftUid(),t,this.currentIdentityResultEmail(),e,this.cc(),this.bcc(),this.subject(),this.oEditor?this.oEditor.isHtml():!1,this.oEditor?this.oEditor.getData(!0):"",this.prepearAttachmentsForSendOrSave(),this.aDraftInfo,this.sInReplyTo,this.sReferences,this.requestReadReceipt(),this.markAsImportant())))},this.canBeSendedOrSaved),this.saveCommand=h.createCommand(this,function(){C.draftFolderNotEnabled()?P.showScreenPopup(i(44),[u.SetSystemFoldersNotification.Draft]):(this.savedError(!1),this.saving(!0),this.autosaveStart(),N.setFolderHash(C.draftFolder(),""),R.saveMessage(this.saveMessageResponse,this.draftFolder(),this.draftUid(),C.draftFolder(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc(),this.subject(),this.oEditor?this.oEditor.isHtml():!1,this.oEditor?this.oEditor.getData(!0):"",this.prepearAttachmentsForSendOrSave(),this.aDraftInfo,this.sInReplyTo,this.sReferences,this.markAsImportant()))},this.canBeSendedOrSaved),this.skipCommand=h.createCommand(this,function(){this.bSkipNextHide=!0,!this.modalVisibility()||this.saving()||this.sending()||C.draftFolderNotEnabled()||this.saveCommand(),this.tryToClosePopup()},this.canBeSendedOrSaved),this.contactsCommand=h.createCommand(this,function(){this.allowContacts&&(this.skipCommand(),o.delay(function(){P.showScreenPopup(i(68),[!0])},200))},function(){return this.allowContacts}),m.sub("interval.2m",function(){!this.modalVisibility()||C.draftFolderNotEnabled()||this.isEmptyForm(!1)||this.saving()||this.sending()||this.savedError()||this.saveCommand()},this),this.showCc.subscribe(this.triggerForResize),this.showBcc.subscribe(this.triggerForResize),this.dropboxEnabled=F.dropbox.enabled,this.dropboxApiKey=F.dropbox.apiKey,this.dropboxCommand=h.createCommand(this,function(){return s.Dropbox&&s.Dropbox.choose({success:function(t){t&&t[0]&&t[0].link&&e.addDropboxAttachment(t[0])},linkType:"direct",multiselect:!1}),!0},function(){return this.dropboxEnabled()}),this.driveEnabled=r.observable(p.bXMLHttpRequestSupported&&!!A.settingsGet("AllowGoogleSocial")&&!!A.settingsGet("AllowGoogleSocialDrive")&&!!A.settingsGet("GoogleClientID")&&!!A.settingsGet("GoogleApiKey")),this.driveVisible=r.observable(!1),this.driveCommand=h.createCommand(this,function(){return this.driveOpenPopup(),!0},function(){return this.driveEnabled()}),this.driveCallback=o.bind(this.driveCallback,this),this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=u.KeyState.Compose,this.tryToClosePopup=o.debounce(o.bind(this.tryToClosePopup,this),200),this.emailsSource=o.bind(this.emailsSource,this),this.autosaveFunction=o.bind(this.autosaveFunction,this),this.iTimer=0,P.constructorEnd(this)}var s=i(10),o=i(2),n=i(13),r=i(3),a=i(36),l=i(73),c=i(74),u=i(4),d=i(16),h=i(1),p=i(8),m=i(28),f=i(12),g=i(47),b=i(7),y=i(30),S=i(26),v=i(43),w=i(22),C=i(32),T=i(20),F=i(35),A=i(9),E=i(15),N=i(19),R=i(14),I=i(96),P=i(5),L=i(11);P.extendAsViewModel(["View/Popup/Compose","PopupsComposeViewModel"],t),o.extend(t.prototype,L.prototype),t.prototype.autosaveFunction=function(){!this.modalVisibility()||C.draftFolderNotEnabled()||this.isEmptyForm(!1)||this.saving()||this.sending()||this.savedError()||this.saveCommand(),this.autosaveStart()},t.prototype.autosaveStart=function(){s.clearTimeout(this.iTimer),this.iTimer=s.setTimeout(this.autosaveFunction,6e4)},t.prototype.autosaveStop=function(){s.clearTimeout(this.iTimer)},t.prototype.emailsSource=function(e,t){i(6).getAutocomplete(e.term,function(e){t(o.map(e,function(e){return e.toLine(!1)}))})},t.prototype.openOpenPgpPopup=function(){if(T.capaOpenPGP()&&this.oEditor&&!this.oEditor.isHtml()){var e=this;P.showScreenPopup(i(137),[function(t){e.editor(function(e){e.setPlain(t)})},this.oEditor.getData(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc()])}},t.prototype.reloadDraftFolder=function(){var e=C.draftFolder();""!==e&&(N.setFolderHash(e,""),E.currentFolderFullNameRaw()===e?i(6).reloadMessageList(!0):i(6).folderInformation(e))},t.prototype.findIdentityIdByMessage=function(e,t){var i={},s="",n="",r=function(e){return e&&e.email&&i[e.email]?(n=e.email,s=i[e.email],!0):!1};if(this.bCapaAdditionalIdentities&&o.each(v.identities(),function(e){i[e.email()]=e.id}),i[w.email()]=w.email(),t)switch(e){case u.ComposeType.Empty:break;case u.ComposeType.Reply:case u.ComposeType.ReplyAll:case u.ComposeType.Forward:case u.ComposeType.ForwardAsAttachment:o.find(o.union(t.to,t.cc,t.bcc,t.deliveredTo),r);break;case u.ComposeType.Draft:o.find(o.union(t.from,t.replyTo),r)}return""===s&&(s=v.defaultIdentityID()),""===s&&(s=w.email(),n=s),[s,n]},t.prototype.selectIdentity=function(e){e&&this.currentIdentityID(e.optValue)},t.prototype.formattedFrom=function(e){var t=w.displayName(),i=w.email();return""===t?i:(h.isUnd(e)?1:!e)?t+" ("+i+")":'"'+h.quoteName(t)+'" <'+i+">"},t.prototype.sendMessageResponse=function(e,t){var i=!1,o="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(i=!0,this.modalVisibility()&&h.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),s.alert(h.trim(b.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=b.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),s.alert(o||b.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},t.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&&(i=!0,this.bFromDraft&&(o=E.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&E.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.savedTime(s.Math.round((new s.Date).getTime()/1e3)),this.savedOrSendingText(0<this.savedTime()?b.i18n("COMPOSE/SAVED_TIME",{TIME:a.unix(this.savedTime()-1).format("LT")}):""),this.bFromDraft&&N.setFolderHash(this.draftFolder(),"")),i||(this.savedError(!0),this.savedOrSendingText(b.getNotification(u.Notification.CantSaveMessage))),this.reloadDraftFolder()},t.prototype.onHide=function(){this.autosaveStop(),this.bSkipNextHide||(this.composeInEdit(!1),this.reset()),this.bSkipNextHide=!1,P.routeOn()},t.prototype.convertSignature=function(e,t,i,s){var o=!1,n=!1;if(""!==t&&(":HTML:"===t.substr(0,6)&&(o=!0,t=t.substr(6)),t=t.replace(/[\r]/g,""),i=h.pString(i),""!==i&&(t=t.replace(/{{FROM-FULL}}/g,i),-1===i.indexOf(" ")&&0<i.indexOf("@")&&(i=i.replace(/@(.+)$/,"")),t=t.replace(/{{FROM}}/g,i)),t=t.replace(/[\s]{1,2}{{FROM}}/g,"{{FROM}}"),t=t.replace(/[\s]{1,2}{{FROM-FULL}}/g,"{{FROM-FULL}}"),t=t.replace(/{{FROM}}/g,""),t=t.replace(/{{FROM-FULL}}/g,""),-1<t.indexOf("{{DATE}}")&&(t=t.replace(/{{DATE}}/g,a().format("llll"))),-1<t.indexOf("{{BODY}}")?e?(n=!0,t=o?t:h.plainToHtml(t,!0),t=t.replace("{{BODY}}",e)):(t=t.replace(/[\n]?{{BODY}}[\n]?/g,"{{BODY}}"),t=t.replace(/{{BODY}}/g,""),t=o?t:h.plainToHtml(t,!0)):t=o?t:h.plainToHtml(t,!0)),n)e=t;else if(t)switch(s){case u.ComposeType.Empty:e=e+"<br />"+t;break;default:e=t+"<br />"+e}return e},t.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?o.delay(function(){t.oEditor=new g(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},t.prototype.onShow=function(e,t,s,o,n,r,a){if(P.routeOff(),this.autosaveStart(),this.composeInEdit()){e=e||u.ComposeType.Empty;var l=this;u.ComposeType.Empty!==e?P.showScreenPopup(i(40),[b.i18n("COMPOSE/DISCARD_UNSAVED_DATA"),function(){l.initOnShow(e,t,s,o,n,r,a)},null,null,null,!1]):(this.addEmailsTo(this.to,s),this.addEmailsTo(this.cc,o),this.addEmailsTo(this.bcc,n),h.isNormal(r)&&""!==r&&""===this.subject()&&this.subject(r))}else this.initOnShow(e,t,s,o,n,r,a)},t.prototype.addEmailsTo=function(e,t){var i=h.trim(e()),s=[];h.isNonEmptyArray(t)&&(s=o.uniq(o.compact(o.map(t,function(e){return e?e.toLine(!1):null}))),e(i+(""===i?"":", ")+h.trim(s.join(", "))))},t.prototype.initOnShow=function(e,t,i,s,r,a,l){this.composeInEdit(!0);var c=this,d="",p="",m="",f="",g="",y=null,S="",v="",C=[],T={},F=null,A=w.email(),E=w.signature(),N=[],I=null,P=null,L=e||u.ComposeType.Empty,M=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&&h.isNormal(t)&&(P=h.isArray(t)&&1===t.length?t[0]:h.isArray(t)?null:t),null!==A&&(T[A]=!0),F=this.findIdentityIdByMessage(L,P),F&&F[0]&&(T[F[1]]=!0,this.currentIdentityID(F[0])),this.reset(),h.isNonEmptyArray(i)&&this.to(M(i)),h.isNonEmptyArray(s)&&this.cc(M(s)),h.isNonEmptyArray(r)&&this.bcc(M(r)),""!==L&&P){switch(f=P.fullFormatDateValue(),g=P.subject(),I=P.aDraftInfo,y=n(P.body).clone(),y&&(y.find("blockquote.rl-bq-switcher").each(function(){n(this).removeClass("rl-bq-switcher hidden-bq")}),y.find(".rlBlockquoteSwitcher").each(function(){n(this).remove()})),y.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),S=y.html(),L){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(M(P.replyEmails(T))),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["reply",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.sReferences);break;case u.ComposeType.ReplyAll:C=P.replyAllEmails(T),this.to(M(C[0])),this.cc(M(C[1])),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["reply",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.references());break;case u.ComposeType.Forward:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["forward",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["forward",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.sReferences);break;case u.ComposeType.Draft:this.to(M(P.to)),this.cc(M(P.cc)),this.bcc(M(P.bcc)),this.bFromDraft=!0,this.draftFolder(P.folderFullNameRaw),this.draftUid(P.uid),this.subject(g),this.prepearMessageAttachments(P,L),this.aDraftInfo=h.isNonEmptyArray(I)&&3===I.length?I:null,this.sInReplyTo=P.sInReplyTo,this.sReferences=P.sReferences;break;case u.ComposeType.EditAsNew:this.to(M(P.to)),this.cc(M(P.cc)),this.bcc(M(P.bcc)),this.subject(g),this.prepearMessageAttachments(P,L),this.aDraftInfo=h.isNonEmptyArray(I)&&3===I.length?I:null,this.sInReplyTo=P.sInReplyTo,this.sReferences=P.sReferences}switch(L){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:d=P.fromToLine(!1,!0),v=b.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:f,EMAIL:d}),S="<br /><br />"+v+":<blockquote><p>"+S+"</p></blockquote>";
break;case u.ComposeType.Forward:d=P.fromToLine(!1,!0),p=P.toToLine(!1,!0),m=P.ccToLine(!1,!0),S="<br /><br /><br />"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"<br />"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+d+"<br />"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+p+(0<m.length?"<br />"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+m:"")+"<br />"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+h.encodeHtml(f)+"<br />"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+h.encodeHtml(g)+"<br /><br />"+S;break;case u.ComposeType.ForwardAsAttachment:S=""}""!==E&&u.ComposeType.EditAsNew!==L&&u.ComposeType.Draft!==L&&(S=this.convertSignature(S,E,M(P.from,!0),L)),this.editor(function(e){e.setHtml(S,!1),(u.EditorDefaultType.PlainForced===c.editorDefaultType()||!P.isHtml()&&u.EditorDefaultType.HtmlForced!==c.editorDefaultType())&&e.modeToggle(!1)})}else u.ComposeType.Empty===L?(this.subject(h.isNormal(a)?""+a:""),S=h.isNormal(l)?""+l:"",""!==E&&(S=this.convertSignature(h.plainToHtml(S,!0),E,"",L)),this.editor(function(e){e.setHtml(S,!1),u.EditorDefaultType.Html!==c.editorDefaultType()&&u.EditorDefaultType.HtmlForced!==c.editorDefaultType()&&e.modeToggle(!1)})):h.isNonEmptyArray(t)&&o.each(t,function(e){c.addMessageAsAttachment(e)});N=this.getAttachmentsDownloadsForUpload(),h.isNonEmptyArray(N)&&R.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var i=null,s="";if(!c.viewModelVisibility())for(s in t.Result)t.Result.hasOwnProperty(s)&&(i=c.getAttachmentById(t.Result[s]),i&&(i.tempName(s),i.waiting(!1).uploading(!1).complete(!0)))}else c.setMessageAttachmentFailedDownloadText()},N),this.triggerForResize()},t.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},t.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},t.prototype.tryToClosePopup=function(){var e=this,t=i(40);!P.isPopupVisible(t)&&this.modalVisibility()&&(this.bSkipNextHide||this.isEmptyForm()&&!this.draftUid()?h.delegateRun(e,"closeCommand"):P.showScreenPopup(t,[b.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&h.delegateRun(e,"closeCommand")}]))},t.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}),A.settingsGet("AllowСtrlEnterOnCompose")&&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}),p.$win.on("resize",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",e.dropboxApiKey()),s.document.body.appendChild(t)),this.driveEnabled()&&n.getScript("https://apis.google.com/js/api.js",function(){s.gapi&&e.driveVisible(!0)})},t.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()}},t.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(s.google.picker.ViewId.DOCS).setAppId(A.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)}}})}},t.prototype.driveOpenPopup=function(){if(s.gapi){var e=this;s.gapi.load("auth",{callback:function(){var t=s.gapi.auth.getToken(),i=function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();return i&&e.driveCreatePiker(i),!0}return!1};t?e.driveCreatePiker(t):s.gapi.auth.authorize({client_id:A.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(e){i(e)||s.gapi.auth.authorize({client_id:A.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},i)})}})}},t.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},t.prototype.cancelAttachmentHelper=function(e,t){var i=this;return function(){var s=o.find(i.attachments(),function(t){return t&&t.id===e});s&&(i.attachments.remove(s),h.delegateRunOnDestroy(s),t&&t.cancel(e))}},t.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=h.pInt(A.settingsGet("AttachmentLimit")),i=new c({action:f.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;h.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=h.isUnd(s.FileName)?"":s.FileName.toString(),r=h.isNormal(s.Size)?h.pInt(s.Size):null,a=new I(e,n,r);return a.cancel=o.cancelAttachmentHelper(e,i),this.attachments.push(a),this.attachmentsPlace(!0),r>0&&t>0&&r>t?(a.waiting(!1).uploading(!0).complete(!0).error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",o.bind(function(t){var i=null;h.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&i.waiting(!1).uploading(!0).complete(!1)},this)).on("onComplete",o.bind(function(t,i,s){var o="",n=null,r=null,a=this.getAttachmentById(t);r=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=b.getUploadErrorDescByCode(n):r||(o=b.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==o&&0<o.length?a.waiting(!1).uploading(!1).complete(!0).error(o):r&&(a.waiting(!1).uploading(!1).complete(!0),a.initByUploadJson(r)),h.isUnd(e[t])&&delete e[t])},this)),this.addAttachmentEnabled(!0).dragAndDropEnabled(i.isDragAndDropSupported())):this.addAttachmentEnabled(!1).dragAndDropEnabled(!1)}},t.prototype.prepearAttachmentsForSendOrSave=function(){var e={};return o.each(this.attachmentsInReady(),function(t){t&&""!==t.tempName()&&t.enabled()&&(e[t.tempName()]=[t.fileName(),t.isInline?"1":"0",t.CID,t.contentLocation])}),e},t.prototype.addMessageAsAttachment=function(e){if(e){var t=null,i=e.subject();i=".eml"===i.substr(-4).toLowerCase()?i:i+".eml",t=new I(e.requestHash,i,e.size()),t.fromMessage=!0,t.cancel=this.cancelAttachmentHelper(e.requestHash),t.waiting(!1).uploading(!0).complete(!0),this.attachments.push(t)}},t.prototype.addDropboxAttachment=function(e){var t=null,i=h.pInt(A.settingsGet("AttachmentLimit")),s=e.bytes;return t=new I(e.link,e.name,s),t.fromMessage=!1,t.cancel=this.cancelAttachmentHelper(e.link),t.waiting(!1).uploading(!0).complete(!1),this.attachments.push(t),this.attachmentsPlace(!0),s>0&&i>0&&s>i?(t.uploading(!1).complete(!0),t.error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(R.composeUploadExternals(function(e,i){var s=!1;t.uploading(!1).complete(!0),u.StorageResultType.Success===e&&i&&i.Result&&i.Result[t.id]&&(s=!0,t.tempName(i.Result[t.id])),s||t.error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},t.prototype.addDriveAttachment=function(e,t){var i=h.pInt(A.settingsGet("AttachmentLimit")),s=null,o=e.fileSize?h.pInt(e.fileSize):0;return s=new I(e.downloadUrl,e.title,o),s.fromMessage=!1,s.cancel=this.cancelAttachmentHelper(e.downloadUrl),s.waiting(!1).uploading(!0).complete(!1),this.attachments.push(s),this.attachmentsPlace(!0),o>0&&i>0&&o>i?(s.uploading(!1).complete(!0),s.error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(R.composeUploadDrive(function(e,t){var i=!1;s.uploading(!1).complete(!0),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(i=!0,s.tempName(t.Result[s.id][0]),s.size(h.pInt(t.Result[s.id][1]))),i||s.error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},t.prototype.prepearMessageAttachments=function(e,t){if(e){var i=h.isNonEmptyArray(e.attachments())?e.attachments():[],s=0,o=i.length,n=null,r=null,a=!1;if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;o>s;s++){switch(r=i[s],a=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:a=r.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:a=!0}a&&(n=new I(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),n.fromMessage=!0,n.cancel=this.cancelAttachmentHelper(r.download),n.waiting(!1).uploading(!0).complete(!1),this.attachments.push(n))}}},t.prototype.removeLinkedAttachments=function(){var e=o.find(this.attachments(),function(e){return e&&e.isLinked});e&&(this.attachments.remove(e),h.delegateRunOnDestroy(e))},t.prototype.setMessageAttachmentFailedDownloadText=function(){o.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).complete(!0).error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},t.prototype.isEmptyForm=function(e){e=h.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())},t.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.markAsImportant(!1),this.attachmentsPlace(!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.showCc(!1),this.showBcc(!1),h.delegateRunOnDestroy(this.attachments()),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},t.prototype.getAttachmentsDownloadsForUpload=function(){return o.map(o.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},t.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.oSubs={}}var s=i(2),o=i(1),n=i(23);t.prototype.oSubs={},t.prototype.sub=function(e,t,i){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i]),this},t.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 t}()},function(e,t,i){!function(){"use strict";function t(){this.disposable=[]}var s=i(2),o=i(3),n=i(1);t.prototype.disposable=[],t.prototype.dispose=function(){s.each(this.disposable,function(e){e&&e.dispose&&e.dispose()})},t.componentExportHelper=function(e,t){return{viewModel:{createViewModel:function(t,s){return t=t||{},t.element=null,s.element&&(t.element=$(s.element),i(7).i18nToNode(t.element),!n.isUnd(t.inline)&&o.unwrap(t.inline)&&t.element.css("display","inline-block")),new e(t)}},template:{element:t}}},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){n.call(this),this.projectHash=s.observable(""),this.threadsAllowed=s.observable(!1),this.contactsAutosave=s.observable(!1),this.useLocalProxyForExternalImages=s.observable(!1),this.contactsIsAllowed=s.observable(!1),this.devEmail="",this.devPassword=""}var s=i(3),o=i(9),n=i(65);t.prototype.populate=function(){n.prototype.populate.call(this),this.projectHash(o.settingsGet("ProjectHash")),this.useLocalProxyForExternalImages(!!o.settingsGet("UseLocalProxyForExternalImages")),this.contactsIsAllowed(!!o.settingsGet("ContactsIsAllowed")),this.devEmail=o.settingsGet("DevEmail"),this.devPassword=o.settingsGet("DevPassword")},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.languages=s.observableArray([]),this.language=s.observable("").extend({limitedList:this.languages})}var s=i(3),o=i(1),n=i(9);t.prototype.populate=function(){var e=n.settingsGet("Languages");this.languages(o.isArray(e)?e:[]),this.language(n.settingsGet("Language"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.sentFolder=s.observable(""),this.draftFolder=s.observable(""),this.spamFolder=s.observable(""),this.trashFolder=s.observable(""),this.archiveFolder=s.observable(""),this.computed(),this.subscribe()}var s=i(3),o=i(4),n=i(16),r=i(19);t.prototype.computed=function(){this.draftFolderNotEnabled=s.computed(function(){return""===this.draftFolder()||n.Values.UnuseOptionValue===this.draftFolder()},this)},t.prototype.subscribe=function(){var e=function(e){return function(){var t=r.getFolderFromCacheList(e());t&&t.type(o.FolderType.User)}},t=function(e){return function(t){var i=r.getFolderFromCacheList(t);i&&i.type(e)}};this.sentFolder.subscribe(e(this.sentFolder),this,"beforeChange"),this.draftFolder.subscribe(e(this.draftFolder),this,"beforeChange"),this.spamFolder.subscribe(e(this.spamFolder),this,"beforeChange"),this.trashFolder.subscribe(e(this.trashFolder),this,"beforeChange"),this.archiveFolder.subscribe(e(this.archiveFolder),this,"beforeChange"),this.sentFolder.subscribe(t(o.FolderType.SentItems),this),this.draftFolder.subscribe(t(o.FolderType.Draft),this),this.spamFolder.subscribe(t(o.FolderType.Spam),this),this.trashFolder.subscribe(t(o.FolderType.Trash),this),this.archiveFolder.subscribe(t(o.FolderType.Archive),this)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(e){a.call(this),this.value=e.value||"",this.size=e.size||0,this.label=e.label||"",this.preLabel=e.preLabel||"",this.enable=r.isUnd(e.enable)?!0:e.enable,this.trigger=e.trigger&&e.trigger.subscribe?e.trigger:null,this.placeholder=e.placeholder||"",this.labeled=!r.isUnd(e.label),this.preLabeled=!r.isUnd(e.preLabel),this.triggered=!r.isUnd(e.trigger)&&!!this.trigger,this.classForTrigger=o.observable(""),this.className=o.computed(function(){var e=o.unwrap(this.size),t=this.trigger?" "+r.trim("settings-saved-trigger-input "+this.classForTrigger()):"";return(e>0?"span"+e:"")+t},this),!r.isUnd(e.width)&&e.element&&e.element.find("input,select,textarea").css("width",e.width),this.disposable.push(this.className),this.trigger&&(this.setTriggerState(this.trigger()),this.disposable.push(this.trigger.subscribe(this.setTriggerState,this)))}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(29);t.prototype.setTriggerState=function(e){switch(r.pInt(e)){case n.SaveSettingsStep.TrueResult:this.classForTrigger("success");break;case n.SaveSettingsStep.FalseResult:this.classForTrigger("error");break;default:this.classForTrigger("")}},s.extend(t.prototype,a.prototype),t.componentExportHelper=a.componentExportHelper,e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var s=i(2),o=i(41),n=i(1);t.prototype.oCross=null,t.prototype.sScreenName="",t.prototype.aViewModels=[],t.prototype.viewModels=function(){return this.aViewModels},t.prototype.screenName=function(){return this.sScreenName},t.prototype.routes=function(){return null},t.prototype.__cross=function(){return this.oCross},t.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=t}()},function(e,t,i){!function(){"use strict";function t(){this.google={},this.twitter={},this.facebook={},this.dropbox={},this.google.enabled=s.observable(!1),this.google.clientID=s.observable(""),this.google.clientSecret=s.observable(""),this.google.apiKey=s.observable(""),this.google.loading=s.observable(!1),this.google.userName=s.observable(""),this.google.loggined=s.computed(function(){return""!==this.google.userName()},this),this.google.capa={},this.google.capa.auth=s.observable(!1),this.google.capa.drive=s.observable(!1),this.google.capa.preview=s.observable(!1),this.google.require={},this.google.require.clientSettings=s.computed(function(){return this.google.enabled()&&(this.google.capa.auth()||this.google.capa.drive())},this),this.google.require.apiKeySettings=s.computed(function(){return this.google.enabled()&&this.google.capa.drive()},this),this.facebook.enabled=s.observable(!1),this.facebook.appID=s.observable(""),this.facebook.appSecret=s.observable(""),this.facebook.loading=s.observable(!1),this.facebook.userName=s.observable(""),this.facebook.supported=s.observable(!1),this.facebook.loggined=s.computed(function(){return""!==this.facebook.userName()},this),this.twitter.enabled=s.observable(!1),this.twitter.consumerKey=s.observable(""),this.twitter.consumerSecret=s.observable(""),this.twitter.loading=s.observable(!1),this.twitter.userName=s.observable(""),this.twitter.loggined=s.computed(function(){return""!==this.twitter.userName()},this),this.dropbox.enabled=s.observable(!1),this.dropbox.apiKey=s.observable("")}var s=i(3);t.prototype.google={},t.prototype.twitter={},t.prototype.facebook={},t.prototype.dropbox={},t.prototype.populate=function(){var e=i(9);this.google.enabled(!!e.settingsGet("AllowGoogleSocial")),this.google.clientID(e.settingsGet("GoogleClientID")),this.google.clientSecret(e.settingsGet("GoogleClientSecret")),this.google.apiKey(e.settingsGet("GoogleApiKey")),this.google.capa.auth(!!e.settingsGet("AllowGoogleSocialAuth")),this.google.capa.drive(!!e.settingsGet("AllowGoogleSocialDrive")),this.google.capa.preview(!!e.settingsGet("AllowGoogleSocialPreview")),this.facebook.enabled(!!e.settingsGet("AllowFacebookSocial")),this.facebook.appID(e.settingsGet("FacebookAppID")),this.facebook.appSecret(e.settingsGet("FacebookAppSecret")),this.facebook.supported(!!e.settingsGet("SupportedFacebookSocial")),this.twitter.enabled=s.observable(!!e.settingsGet("AllowTwitterSocial")),this.twitter.consumerKey=s.observable(e.settingsGet("TwitterConsumerKey")),this.twitter.consumerSecret=s.observable(e.settingsGet("TwitterConsumerSecret")),this.dropbox.enabled(!!e.settingsGet("AllowDropboxSocial")),this.dropbox.apiKey(e.settingsGet("DropboxApiKey"))},e.exports=new t}()},function(e){e.exports=window.moment},,function(e,t,i){!function(){"use strict";function t(e){r.call(this),this.value=e.value,(n.isUnd(this.value)||!this.value.subscribe)&&(this.value=o.observable(n.isUnd(this.value)?!1:!!this.value)),this.enable=e.enable,(n.isUnd(this.enable)||!this.enable.subscribe)&&(this.enable=o.observable(n.isUnd(this.enable)?!0:!!this.enable)),this.disable=e.disable,(n.isUnd(this.disable)||!this.disable.subscribe)&&(this.disable=o.observable(n.isUnd(this.disable)?!1:!!this.disable)),this.label=e.label||"",this.inline=n.isUnd(e.inline)?!1:e.inline,this.readOnly=n.isUnd(e.readOnly)?!1:!!e.readOnly,this.inverted=n.isUnd(e.inverted)?!1:!!e.inverted,this.labeled=!n.isUnd(e.label)}var s=i(2),o=i(3),n=i(1),r=i(29);s.extend(t.prototype,r.prototype),t.prototype.click=function(){this.readOnly||!this.enable()||this.disable()||this.value(!this.value())},t.componentExportHelper=r.componentExportHelper,e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.themes=s.observableArray([]),this.themeBackgroundName=s.observable(""),this.themeBackgroundHash=s.observable(""),this.theme=s.observable("").extend({limitedList:this.themes})}var s=i(3),o=i(1),n=i(9);t.prototype.populate=function(){var e=n.settingsGet("Themes");this.themes(o.isArray(e)?e:[]),this.theme(n.settingsGet("Theme")),this.themeBackgroundName(n.settingsGet("UserBackgroundName")),this.themeBackgroundHash(n.settingsGet("UserBackgroundHash"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,"Popups","PopupsAsk"),this.askDesc=o.observable(""),this.yesButton=o.observable(""),this.noButton=o.observable(""),this.yesFocus=o.observable(!1),this.noFocus=o.observable(!1),this.fYesAction=null,this.fNoAction=null,this.bFocusYesOnShow=!0,this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=r.KeyState.PopupAsk,c.constructorEnd(this)}var s=i(2),o=i(3),n=i(21),r=i(4),a=i(1),l=i(7),c=i(5),u=i(11);c.extendAsViewModel(["View/Popup/Ask","PopupsAskViewModel"],t),s.extend(t.prototype,u.prototype),t.prototype.clearPopup=function(){this.askDesc(""),this.yesButton(l.i18n("POPUPS_ASK/BUTTON_YES")),this.noButton(l.i18n("POPUPS_ASK/BUTTON_NO")),this.yesFocus(!1),this.noFocus(!1),this.fYesAction=null,this.fNoAction=null},t.prototype.yesClick=function(){this.cancelCommand(),a.isFunc(this.fYesAction)&&this.fYesAction.call(null)},t.prototype.noClick=function(){this.cancelCommand(),a.isFunc(this.fNoAction)&&this.fNoAction.call(null)},t.prototype.onShow=function(e,t,i,s,o,n){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=i||null,this.askDesc(e||""),s&&this.yesButton(s),s&&this.yesButton(o),this.bFocusYesOnShow=a.isUnd(n)?!0:!!n},t.prototype.onFocus=function(){this.bFocusYesOnShow&&this.yesFocus(!0)},t.prototype.onBuild=function(){n("tab, shift+tab, right, left",r.KeyState.PopupAsk,s.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),n("esc",r.KeyState.PopupAsk,s.bind(function(){return this.noClick(),!1},this))},e.exports=t}()},function(e){e.exports=window.crossroads},,function(e,t,i){!function(){"use strict";function t(){this.defaultIdentityID=s.observable(""),this.identities=s.observableArray([]),this.identities.loading=s.observable(!1).extend({throttle:100})}var s=i(3),o=i(9);t.prototype.populate=function(){this.defaultIdentityID(o.settingsGet("DefaultIdentityID"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){m.call(this,"Popups","PopupsFolderSystem"),l.initOnStartOrLangChange(function(){this.sChooseOnText=l.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE"),this.sUnuseText=l.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME")},this),this.notification=o.observable(""),this.folderSelectList=o.computed(function(){return a.folderListOptionsBuilder([],d.folderList(),d.folderListSystemNames(),[["",this.sChooseOnText],[r.Values.UnuseOptionValue,this.sUnuseText]],null,null,null,null,null,!0)},this);var e=null,t=null;this.sentFolder=c.sentFolder,this.draftFolder=c.draftFolder,this.spamFolder=c.spamFolder,this.trashFolder=c.trashFolder,this.archiveFolder=c.archiveFolder,e=s.debounce(function(){u.settingsSet("SentFolder",c.sentFolder()),u.settingsSet("DraftFolder",c.draftFolder()),u.settingsSet("SpamFolder",c.spamFolder()),u.settingsSet("TrashFolder",c.trashFolder()),u.settingsSet("ArchiveFolder",c.archiveFolder()),h.saveSystemFolders(a.emptyFunction,{SentFolder:c.sentFolder(),DraftFolder:c.draftFolder(),SpamFolder:c.spamFolder(),TrashFolder:c.trashFolder(),ArchiveFolder:c.archiveFolder(),NullFolder:"NullFolder"})},1e3),t=function(){u.settingsSet("SentFolder",c.sentFolder()),u.settingsSet("DraftFolder",c.draftFolder()),u.settingsSet("SpamFolder",c.spamFolder()),u.settingsSet("TrashFolder",c.trashFolder()),u.settingsSet("ArchiveFolder",c.archiveFolder()),e()},c.sentFolder.subscribe(t),c.draftFolder.subscribe(t),c.spamFolder.subscribe(t),c.trashFolder.subscribe(t),c.archiveFolder.subscribe(t),this.defautOptionsAfterRender=a.defautOptionsAfterRender,p.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(16),a=i(1),l=i(7),c=i(32),u=i(9),d=i(15),h=i(14),p=i(5),m=i(11);p.extendAsViewModel(["View/Popup/FolderSystem","PopupsFolderSystemViewModel"],t),s.extend(t.prototype,m.prototype),t.prototype.sChooseOnText="",t.prototype.sUnuseText="",t.prototype.onShow=function(e){var t="";switch(e=a.isUnd(e)?n.SetSystemFoldersNotification.None:e){case n.SetSystemFoldersNotification.Sent:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case n.SetSystemFoldersNotification.Draft:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case n.SetSystemFoldersNotification.Spam:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case n.SetSystemFoldersNotification.Trash:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case n.SetSystemFoldersNotification.Archive:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){a.call(this,"Popups","PopupsLanguages"),this.LanguageStore=i(31),this.exp=o.observable(!1),this.languages=o.computed(function(){return s.map(this.LanguageStore.languages(),function(e){return{key:e,selected:o.observable(!1),fullName:n.convertLangName(e)}})},this),this.LanguageStore.language.subscribe(function(){this.resetMainLanguage()},this),r.constructorEnd(this)}var s=i(2),o=i(3),n=i(1),r=i(5),a=i(11);r.extendAsViewModel(["View/Popup/Languages","PopupsLanguagesViewModel"],t),s.extend(t.prototype,a.prototype),t.prototype.languageEnName=function(e){var t=n.convertLangName(e,!0);return"English"===t?"":t},t.prototype.resetMainLanguage=function(){var e=this.LanguageStore.language();s.each(this.languages(),function(t){t.selected(t.key===e)})},t.prototype.onShow=function(){this.exp(!0),this.resetMainLanguage()},t.prototype.onHide=function(){this.exp(!1)},t.prototype.changeLanguage=function(e){this.LanguageStore.language(e),this.cancelCommand()},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e){h.call(this),this.isLocalAutocomplete=!0,this.iframe=n('<iframe style="display:none" src="javascript:;" />').appendTo("body"),r.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===a.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(a.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,s.location&&s.location.toString?s.location.toString():"",r.$html.attr("class"),a.microtime()-r.now)}),r.$doc.on("keydown",function(e){e&&e.ctrlKey&&r.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&r.$html.removeClass("rl-ctrl-key-pressed")})}var s=i(10),o=i(2),n=i(13),r=i(8),a=i(1),l=i(12),c=i(28),u=i(7),d=i(9),h=i(57);o.extend(t.prototype,h.prototype),t.prototype.remote=function(){return null},t.prototype.data=function(){return null},t.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):(r.bMobileDevice?(s.open(e,"_self"),s.focus()):this.iframe.attr("src",e),!0)},t.prototype.googlePreviewSupportedCache=null,t.prototype.googlePreviewSupported=function(){return null===this.googlePreviewSupportedCache&&(this.googlePreviewSupportedCache=!!d.settingsGet("AllowGoogleSocial")&&!!d.settingsGet("AllowGoogleSocialPreview")),this.googlePreviewSupportedCache},t.prototype.setTitle=function(e){e=(a.isNormal(e)&&0<e.length?e+" - ":"")+d.settingsGet("Title")||"",s.document.title=e+" ...",s.document.title=e},t.prototype.redirectToAdminPanel=function(){o.delay(function(){s.location.href=l.rootAdmin()},100)},t.prototype.clearClientSideToken=function(){s.__rlah_clear&&s.__rlah_clear()},t.prototype.loginAndLogoutReload=function(e,t){var n=i(5),r=a.pString(d.settingsGet("CustomLogoutLink")),c=!!d.settingsGet("InIframe");e=a.isUnd(e)?!1:!!e,t=a.isUnd(t)?!1:!!t,e&&this.clearClientSideToken(),e&&t&&s.close&&s.close(),r=r||"./",e&&s.location.href!==r?o.delay(function(){c&&s.parent?s.parent.location.href=r:s.location.href=r},100):(n.routeOff(),n.setHash(l.root(),!0),n.routeOff(),o.delay(function(){c&&s.parent?s.parent.location.reload():s.location.reload()},100))},t.prototype.historyBack=function(){s.history.back()},t.prototype.bootstart=function(){c.pub("rl.bootstart");var e=i(77),t=i(3);t.components.register("SaveTrigger",i(54)),t.components.register("Input",i(51)),t.components.register("Select",i(55)),t.components.register("TextArea",i(56)),t.components.register("Radio",i(53)),d.settingsGet("MaterialDesign")&&r.bAnimationSupported?t.components.register("Checkbox",i(52)):t.components.register("Checkbox",i(50)),u.initOnStartOrLangChange(u.initNotificationLanguage,u),o.delay(a.windowResizeCallback,1e3),e.addState({id:"mobile",maxWidth:767,onEnter:function(){r.$html.addClass("ssm-state-mobile"),c.pub("ssm.mobile-enter")},onLeave:function(){r.$html.removeClass("ssm-state-mobile"),c.pub("ssm.mobile-leave")}}),e.addState({id:"tablet",minWidth:768,maxWidth:999,onEnter:function(){r.$html.addClass("ssm-state-tablet")},onLeave:function(){r.$html.removeClass("ssm-state-tablet")}}),e.addState({id:"desktop",minWidth:1e3,maxWidth:1400,onEnter:function(){r.$html.addClass("ssm-state-desktop")},onLeave:function(){r.$html.removeClass("ssm-state-desktop")}}),e.addState({id:"desktop-large",minWidth:1400,onEnter:function(){r.$html.addClass("ssm-state-desktop-large")},onLeave:function(){r.$html.removeClass("ssm-state-desktop-large")}}),c.sub("ssm.mobile-enter",function(){r.leftPanelDisabled(!0)}),c.sub("ssm.mobile-leave",function(){r.leftPanelDisabled(!1)}),r.leftPanelDisabled.subscribe(function(e){r.$html.toggleClass("rl-left-panel-disabled",e)}),e.ready(),i(31).populate(),i(39).populate(),i(35).populate()},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t,i,s){this.editor=null,this.iBlurTimer=0,this.fOnBlur=t||null,this.fOnReady=i||null,this.fOnModeChange=s||null,this.$element=$(e),this.resize=o.throttle(o.bind(this.resize,this),100),this.init()}var s=i(10),o=i(2),n=i(8),r=i(9);t.prototype.blurTrigger=function(){if(this.fOnBlur){var e=this;s.clearTimeout(this.iBlurTimer),this.iBlurTimer=s.setTimeout(function(){e.fOnBlur()},200)}},t.prototype.focusTrigger=function(){this.fOnBlur&&s.clearTimeout(this.iBlurTimer)},t.prototype.isHtml=function(){return this.editor?"wysiwyg"===this.editor.mode:!1},t.prototype.setSignature=function(e){this.editor&&this.editor.execCommand("insertSignature",{signature:e})},t.prototype.checkDirty=function(){return this.editor?this.editor.checkDirty():!1},t.prototype.resetDirty=function(){this.editor&&this.editor.resetDirty()},t.prototype.getData=function(e){return this.editor?"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain?this.editor.__plain.getRawData():e?'<div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;">'+this.editor.getData()+"</div>":this.editor.getData():""
},t.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())},t.prototype.setHtml=function(e,t){if(this.editor){this.modeToggle(!0);try{this.editor.setData(e)}catch(i){}t&&this.focus()}},t.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);try{this.editor.setData(e)}catch(i){}t&&this.focus()}},t.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,i=r.settingsGet("Language"),o=!!r.settingsGet("AllowHtmlEditorSourceButton"),a=!!r.settingsGet("AllowHtmlEditorBitiButtons");!o&&a||t.toolbarGroups.__cfgInited||(t.toolbarGroups.__cfgInited=!0,o&&(t.removeButtons=t.removeButtons.replace(",Source","")),a||(t.removePlugins+=(t.removePlugins?",":"")+"bidi")),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.removeMenuItem&&(e.editor.removeMenuItem("cut"),e.editor.removeMenuItem("copy"),e.editor.removeMenuItem("paste")),e.editor.setKeystroke(s.CKEDITOR.CTRL+65,"selectAll"),e.editor.editable().addClass("cke_enable_context_menu"),e.fOnReady(),e.__resizable=!0,e.resize()})};s.CKEDITOR?t():s.__initEditor=t}},t.prototype.focus=function(){if(this.editor)try{this.editor.focus()}catch(e){}},t.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},t.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},t.prototype.clear=function(e){this.setHtml("",e)},e.exports=t}()},function(e){!function(){"use strict";e.exports={eml:"message/rfc822",mime:"message/rfc822",txt:"text/plain",text:"text/plain",def:"text/plain",list:"text/plain","in":"text/plain",ini:"text/plain",log:"text/plain",sql:"text/plain",cfg:"text/plain",conf:"text/plain",asc:"text/plain",rtx:"text/richtext",vcard:"text/vcard",vcf:"text/vcard",htm:"text/html",html:"text/html",csv:"text/csv",ics:"text/calendar",ifb:"text/calendar",xml:"text/xml",json:"application/json",swf:"application/x-shockwave-flash",hlp:"application/winhlp",wgt:"application/widget",chm:"application/vnd.ms-htmlhelp",p10:"application/pkcs10",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",torrent:"application/x-bittorrent",js:"application/javascript",pl:"text/perl",css:"text/css",asp:"text/asp",php:"application/x-httpd-php",php3:"application/x-httpd-php",php4:"application/x-httpd-php",php5:"application/x-httpd-php",phtml:"application/x-httpd-php",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",jpe:"image/jpeg",jfif:"image/jpeg",gif:"image/gif",bmp:"image/bmp",cgm:"image/cgm",ief:"image/ief",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",svgz:"image/svg+xml",djv:"image/vnd.djvu",djvu:"image/vnd.djvu",webp:"image/webp",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",exe:"application/x-msdownload",dll:"application/x-msdownload",scr:"application/x-msdownload",com:"application/x-msdownload",bat:"application/x-msdownload",msi:"application/x-msdownload",cab:"application/vnd.ms-cab-compressed",gz:"application/x-gzip",tgz:"application/x-gzip",bz:"application/x-bzip",bz2:"application/x-bzip2",deb:"application/x-debian-package",psf:"application/x-font-linux-psf",otf:"application/x-font-otf",pcf:"application/x-font-pcf",snf:"application/x-font-snf",ttf:"application/x-font-ttf",ttc:"application/x-font-ttf",mp3:"audio/mpeg",amr:"audio/amr",aac:"audio/x-aac",aif:"audio/x-aiff",aifc:"audio/x-aiff",aiff:"audio/x-aiff",wav:"audio/x-wav",wma:"audio/x-ms-wma",wax:"audio/x-ms-wax",midi:"audio/midi",mp4a:"audio/mp4",ogg:"audio/ogg",weba:"audio/webm",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",rmp:"audio/x-pn-realaudio-plugin",m3u:"audio/x-mpegurl",flv:"video/x-flv",qt:"video/quicktime",mov:"video/quicktime",wmv:"video/windows-media",avi:"video/x-msvideo",mpg:"video/mpeg",mpeg:"video/mpeg",mpe:"video/mpeg",m1v:"video/mpeg",m2v:"video/mpeg","3gp":"video/3gpp","3g2":"video/3gpp2",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgv:"video/jpgv",mp4:"video/mp4",mp4v:"video/mp4",mpg4:"video/mp4",ogv:"video/ogg",webm:"video/webm",m4v:"video/x-m4v",asf:"video/x-ms-asf",asx:"video/x-ms-asf",wm:"video/x-ms-wm",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",movie:"video/x-sgi-movie",pdf:"application/pdf",psd:"image/vnd.adobe.photoshop",ai:"application/postscript",eps:"application/postscript",ps:"application/postscript",doc:"application/msword",dot:"application/msword",rtf:"application/rtf",xls:"application/vnd.ms-excel",ppt:"application/vnd.ms-powerpoint",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",odt:"application/vnd.oasis.opendocument.text",ods:"application/vnd.oasis.opendocument.spreadsheet"}}()},function(e,t,i){!function(){"use strict";function t(e){if(r.call(this),this.values=o.observableArray([]),this.value=e.value,(n.isUnd(this.value)||!this.value.subscribe)&&(this.value=o.observable("")),this.inline=n.isUnd(e.inline)?!1:e.inline,this.readOnly=n.isUnd(e.readOnly)?!1:!!e.readOnly,e.values){var t=s.map(e.values,function(e,t){return{label:e,value:t}});this.values(t)}this.click=s.bind(this.click,this)}var s=i(2),o=i(3),n=i(1),r=i(29);t.prototype.click=function(e){!this.readOnly&&e&&this.value(e.value)},s.extend(t.prototype,r.prototype),t.componentExportHelper=r.componentExportHelper,e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e){o.call(this,e)}var s=i(2),o=i(38);s.extend(t.prototype,o.prototype),e.exports=o.componentExportHelper(t,"CheckboxComponent")}()},function(e,t,i){!function(){"use strict";function t(e){o.call(this,e)}var s=i(2),o=i(33);s.extend(t.prototype,o.prototype),e.exports=o.componentExportHelper(t,"InputComponent")}()},function(e,t,i){!function(){"use strict";function t(e){n.call(this,e),this.animationBox=o.observable(!1).extend({falseTimeout:200}),this.animationCheckmark=o.observable(!1).extend({falseTimeout:200}),this.animationBoxSetTrue=s.bind(this.animationBoxSetTrue,this),this.animationCheckmarkSetTrue=s.bind(this.animationCheckmarkSetTrue,this),this.disposable.push(this.value.subscribe(function(e){this.triggerAnimation(e)},this))}var s=i(2),o=i(3),n=i(38);s.extend(t.prototype,n.prototype),t.prototype.animationBoxSetTrue=function(){this.animationBox(!0)},t.prototype.animationCheckmarkSetTrue=function(){this.animationCheckmark(!0)},t.prototype.triggerAnimation=function(e){e?(this.animationBoxSetTrue(),s.delay(this.animationCheckmarkSetTrue,200)):(this.animationCheckmarkSetTrue(),s.delay(this.animationBoxSetTrue,200))},e.exports=n.componentExportHelper(t,"CheckboxMaterialDesignComponent")}()},function(e,t,i){!function(){"use strict";function t(e){o.call(this,e)}var s=i(2),o=i(49);s.extend(t.prototype,o.prototype),e.exports=o.componentExportHelper(t,"RadioComponent")}()},function(e,t,i){!function(){"use strict";function t(e){r.call(this),this.element=e.element||null,this.value=e.value&&e.value.subscribe?e.value:null,this.element&&(this.value?(this.element.css("display","inline-block"),e.verticalAlign&&this.element.css("vertical-align",e.verticalAlign),this.setState(this.value()),this.disposable.push(this.value.subscribe(this.setState,this))):this.element.hide())}var s=i(2),o=i(4),n=i(1),r=i(29);t.prototype.setState=function(e){switch(n.pInt(e)){case o.SaveSettingsStep.TrueResult:this.element.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case o.SaveSettingsStep.FalseResult:this.element.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case o.SaveSettingsStep.Animate:this.element.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:case o.SaveSettingsStep.Idle:this.element.find(".animated").hide().end().find(".error,.success").removeClass("visible")}},s.extend(t.prototype,r.prototype),e.exports=r.componentExportHelper(t,"SaveTriggerComponent")}()},function(e,t,i){!function(){"use strict";function t(e){n.call(this,e),this.options=e.options||"",this.optionsText=e.optionsText||null,this.optionsValue=e.optionsValue||null,this.defautOptionsAfterRender=o.defautOptionsAfterRender}var s=i(2),o=i(1),n=i(33);s.extend(t.prototype,n.prototype),e.exports=n.componentExportHelper(t,"SelectComponent")}()},function(e,t,i){!function(){"use strict";function t(e){n.call(this,e),this.rows=e.rows||5,this.spellcheck=o.isUnd(e.spellcheck)?!1:!!e.spellcheck}var s=i(2),o=i(1),n=i(33);s.extend(t.prototype,n.prototype),e.exports=n.componentExportHelper(t,"TextAreaComponent")}()},function(e){!function(){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null,this.setupSettings()}var s=i(2),o=i(13),n=i(3),r=i(8),a=i(1),l=i(12),c=i(5),u=i(34);s.extend(t.prototype,u.prototype),t.prototype.setupSettings=function(e){e&&e()},t.prototype.onRoute=function(e){var t=this,i=null,u=null,d=null,h=null;u=s.find(r.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(s.find(r.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&s.find(r.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,h=o("<div></div>").addClass("rl-settings-view-model").hide(),h.appendTo(d),i.viewModelDom=h,i.__rlSettingsData=u.__rlSettingsData,u.__dom=h,u.__builded=!0,u.__vm=i,n.applyBindingAccessorsToNode(h[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),a.delegateRun(i,"onBuild",[h])):a.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&s.defer(function(){t.oCurrentSubScreen&&(a.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),a.delegateRun(t.oCurrentSubScreen,"onShow"),a.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)),a.windowResize()})):c.setHash(l.settings(),!1,!0)},t.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(a.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},t.prototype.onBuild=function(){s.each(r.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!s.find(r.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(r.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},t.prototype.routes=function(){var e=s.find(r.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=a.isUnd(i.subname)?t:a.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.oRequests={}}var s=i(10),o=i(2),n=i(13),r=i(16),a=i(4),l=i(8),c=i(1),u=i(23),d=i(12),h=i(9);t.prototype.oRequests={},t.prototype.defaultResponse=function(e,t,i,s,n,d){var h=function(){a.StorageResultType.Success!==i&&l.bUnload&&(i=a.StorageResultType.Unload),a.StorageResultType.Success===i&&s&&!s.Result?(s&&-1<c.inArray(s.ErrorCode,[a.Notification.AuthError,a.Notification.AccessError,a.Notification.ConnectionError,a.Notification.DomainNotAllowed,a.Notification.AccountNotAllowed,a.Notification.MailServerError,a.Notification.UnknownNotification,a.Notification.UnknownError])&&l.iAjaxErrorCount++,s&&a.Notification.InvalidToken===s.ErrorCode&&l.iTokenErrorCount++,r.Values.TokenErrorLimit<l.iTokenErrorCount&&l.__APP__&&l.__APP__.loginAndLogoutReload(!0),(s.ClearAuth||s.Logout||r.Values.AjaxErrorLimit<l.iAjaxErrorCount)&&l.__APP__&&(l.__APP__.clearClientSideToken(),s.ClearAuth||l.__APP__.loginAndLogoutReload(!0))):a.StorageResultType.Success===i&&s&&s.Result&&(l.iAjaxErrorCount=0,l.iTokenErrorCount=0),e&&(u.runHook("ajax-default-response",[t,a.StorageResultType.Success===i?s:null,i,n,d]),e(i,a.StorageResultType.Success===i?s:null,n,t,d))};switch(i){case"success":i=a.StorageResultType.Success;break;case"abort":i=a.StorageResultType.Abort;break;default:i=a.StorageResultType.Error}a.StorageResultType.Error===i?o.delay(h,300):h()},t.prototype.ajaxRequest=function(e,t,i,r,a){var l=this,u=""===r,p={},m=(new s.Date).getTime(),f=null,g="";return t=t||{},i=c.isNormal(i)?i:2e4,r=c.isUnd(r)?"":c.pString(r),a=c.isArray(a)?a:[],g=t.Action||"",g&&0<a.length&&o.each(a,function(e){l.oRequests[e]&&(l.oRequests[e].__aborted=!0,l.oRequests[e].abort&&l.oRequests[e].abort(),l.oRequests[e]=null)}),u&&(t.XToken=h.settingsGet("Token")),f=n.ajax({type:u?"POST":"GET",url:d.ajax(r),async:!0,dataType:"json",data:u?t:{},headers:p,timeout:i,global:!0}),f.always(function(i,o){var n=!1;i&&i.Time&&(n=c.pInt(i.Time)>(new s.Date).getTime()-m),g&&l.oRequests[g]&&(l.oRequests[g].__aborted&&(o="abort"),l.oRequests[g]=null),l.defaultResponse(e,g,o,i,n,t)}),g&&0<a.length&&-1<c.inArray(g,a)&&(this.oRequests[g]&&(this.oRequests[g].__aborted=!0,this.oRequests[g].abort&&this.oRequests[g].abort(),this.oRequests[g]=null),this.oRequests[g]=f),f},t.prototype.defaultRequest=function(e,t,i,s,o,n){return i=i||{},i.Action=t,o=c.pString(o),u.runHook("ajax-default-request",[t,i,o]),this.ajaxRequest(e,i,c.isUnd(s)?r.Defaults.DefaultAjaxTimeout:c.pInt(s),o,n)},t.prototype.noop=function(e){this.defaultRequest(e,"Noop")},t.prototype.jsError=function(e,t,i,s,o,n,r){this.defaultRequest(e,"JsError",{Message:t,FileName:i,LineNo:s,Location:o,HtmlCapa:n,TimeOnPage:r})},t.prototype.jsInfo=function(e,t,i,s){this.defaultRequest(e,"JsInfo",{Type:t,Data:i,IsError:(c.isUnd(s)?1:!s)?"0":"1"})},t.prototype.getPublicKey=function(e){this.defaultRequest(e,"GetPublicKey")},t.prototype.jsVersion=function(e,t){this.defaultRequest(e,"Version",{Version:t})},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){var e=i(2).find([i(94),i(93)],function(e){return e&&e.supported()});this.oDriver=null,e&&(this.oDriver=new e)}t.prototype.oDriver=null,t.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},t.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new t}()},,,,,function(e,t,i){!function(){"use strict";function t(){this.allowLanguagesOnSettings=s.observable(!0),this.allowLanguagesOnLogin=s.observable(!0),this.interfaceAnimation=s.observable(!0),this.interfaceAnimation.subscribe(function(e){var t=o.bMobileDevice||!e;o.$html.toggleClass("rl-anim",!t).toggleClass("no-rl-anim",t)}),this.interfaceAnimation.valueHasMutated(),this.prem=s.observable(!1)}var s=i(3),o=i(8),n=i(9);t.prototype.populate=function(){this.allowLanguagesOnLogin(!!n.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!n.settingsGet("AllowLanguagesOnSettings")),this.interfaceAnimation(!!n.settingsGet("InterfaceAnimation")),this.prem(!!n.settingsGet("PremType"))},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){var e=this;this.buzz=null,this.enableSoundNotification=o.observable(!0),this.soundNotificationIsSupported=o.observable(!1),this.allowDesktopNotification=o.observable(!1),this.desktopNotificationPermisions=o.computed(function(){this.allowDesktopNotification();var e=this.notificationClass(),t=r.DesktopNotification.NotSupported;if(e&&e.permission)switch(e.permission.toLowerCase()){case"granted":t=r.DesktopNotification.Allowed;break;case"denied":t=r.DesktopNotification.Denied;break;case"default":t=r.DesktopNotification.NotAllowed}else s.webkitNotifications&&s.webkitNotifications.checkPermission&&(t=s.webkitNotifications.checkPermission());return t},this).extend({notify:"always"}),this.enableDesktopNotification=o.computed({owner:this,read:function(){return this.allowDesktopNotification()&&r.DesktopNotification.Allowed===this.desktopNotificationPermisions()},write:function(t){if(t){var i=this.notificationClass(),s=this.desktopNotificationPermisions();i&&r.DesktopNotification.Allowed===s?this.allowDesktopNotification(!0):i&&r.DesktopNotification.NotAllowed===s?i.requestPermission(function(){e.allowDesktopNotification.valueHasMutated(),r.DesktopNotification.Allowed===e.desktopNotificationPermisions()?e.allowDesktopNotification()?e.allowDesktopNotification.valueHasMutated():e.allowDesktopNotification(!0):e.allowDesktopNotification()?e.allowDesktopNotification(!1):e.allowDesktopNotification.valueHasMutated()}):this.allowDesktopNotification(!1)}else this.allowDesktopNotification(!1)}}).extend({notify:"always"}),this.enableDesktopNotification.valueHasMutated||(this.enableDesktopNotification.valueHasMutated=function(){e.allowDesktopNotification.valueHasMutated()}),this.computedProperies(),this.initNotificationPlayer()}var s=i(10),o=i(3),n=i(155),r=i(4),a=i(12),l=i(9);t.prototype.computedProperies=function(){this.isDesktopNotificationSupported=o.computed(function(){return r.DesktopNotification.NotSupported!==this.desktopNotificationPermisions()},this),this.isDesktopNotificationDenied=o.computed(function(){return r.DesktopNotification.NotSupported===this.desktopNotificationPermisions()||r.DesktopNotification.Denied===this.desktopNotificationPermisions()},this)},t.prototype.initNotificationPlayer=function(){n&&n.isSupported()&&(n.isOGGSupported()||n.isMP3Supported())?(this.soundNotificationIsSupported(!0),this.buzz=new n.sound(a.sound("new-mail"),{preload:"none",formats:["mp3","ogg"]})):(this.enableSoundNotification(!1),this.soundNotificationIsSupported(!1))},t.prototype.playSoundNotification=function(e){this.buzz&&(e?!0:this.enableSoundNotification())&&this.buzz.play()},t.prototype.displayDesktopNotification=function(e,t,i){if(this.enableDesktopNotification()){var o=this.notificationClass(),n=o?new o(t,{body:i,icon:e}):null;n&&(n.show&&n.show(),s.setTimeout(function(e){return function(){e.cancel?e.cancel():e.close&&e.close()}}(n),7e3))}},t.prototype.populate=function(){this.enableSoundNotification(!!l.settingsGet("SoundNotification")),this.enableDesktopNotification(!!l.settingsGet("DesktopNotifications"))},t.prototype.notificationClass=function(){return s.Notification&&s.Notification.requestPermission?s.Notification:null},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,"Popups","PopupsAddAccount"),this.isNew=o.observable(!0),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=r.createCommand(this,function(){return this.emailError(""===r.trim(this.email())),this.passwordError(""===r.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),l.accountSetup(s.bind(function(e,t){this.submitRequest(!1),n.StorageResultType.Success===e&&t&&"AccountSetup"===t.Action?t.Result?(i(6).accountsAndIdentities(),this.cancelCommand()):t.ErrorCode&&this.submitError(a.getNotification(t.ErrorCode)):this.submitError(a.getNotification(n.Notification.UnknownError))},this),this.email(),this.password(),this.isNew()),!0)},function(){return!this.submitRequest()}),c.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(14),c=i(5),u=i(11);c.extendAsViewModel(["View/Popup/AddAccount","PopupsAddAccountViewModel"],t),s.extend(t.prototype,u.prototype),t.prototype.clearPopup=function(){this.isNew(!0),this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},t.prototype.onShow=function(e){this.clearPopup(),e&&e.canBeEdit()&&(this.isNew(!1),this.email(e.email))},t.prototype.onFocus=function(){this.emailFocus(!0)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){C.call(this,"Popups","PopupsContacts");var e=this,t=function(t){t&&0<t.length&&(e.viewProperties.removeAll(t),d.delegateRunOnDestroy(t))};this.bBackToCompose=!1,this.allowContactsSync=g.allowContactsSync,this.enableContactsSync=g.enableContactsSync,this.allowExport=!u.bMobileDevice,this.search=r.observable(""),this.contactsCount=r.observable(0),this.contacts=g.contacts,this.currentContact=r.observable(null),this.importUploaderButton=r.observable(null),this.contactsPage=r.observable(1),this.contactsPageCount=r.computed(function(){var e=s.Math.ceil(this.contactsCount()/c.Defaults.ContactsPerPage);return 0>=e?1:e},this),this.contactsPagenator=r.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=r.observable(!0),this.viewClearSearch=r.observable(!1),this.viewID=r.observable(""),this.viewReadOnly=r.observable(!1),this.viewProperties=r.observableArray([]),this.viewSaveTrigger=r.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1<d.inArray(e.type(),[l.ContactPropertyType.FirstName,l.ContactPropertyType.LastName])}),this.viewPropertiesOther=this.viewProperties.filter(function(e){return-1<d.inArray(e.type(),[l.ContactPropertyType.Note])}),this.viewPropertiesOther=r.computed(function(){var e=o.filter(this.viewProperties(),function(e){return-1<d.inArray(e.type(),[l.ContactPropertyType.Nick])});return o.sortBy(e,function(e){return e.type()})},this),this.viewPropertiesEmails=this.viewProperties.filter(function(e){return l.ContactPropertyType.Email===e.type()}),this.viewPropertiesWeb=this.viewProperties.filter(function(e){return l.ContactPropertyType.Web===e.type()}),this.viewHasNonEmptyRequaredProperties=r.computed(function(){var e=this.viewPropertiesNames(),t=this.viewPropertiesEmails(),i=function(e){return""!==d.trim(e.value())};return!(!o.find(e,i)&&!o.find(t,i))},this),this.viewPropertiesPhones=this.viewProperties.filter(function(e){return l.ContactPropertyType.Phone===e.type()}),this.viewPropertiesEmailsNonEmpty=this.viewPropertiesNames.filter(function(e){return""!==d.trim(e.value())}),this.viewPropertiesEmailsEmptyAndOnFocused=this.viewPropertiesEmails.filter(function(e){var t=e.focused();return""===d.trim(e.value())&&!t}),this.viewPropertiesPhonesEmptyAndOnFocused=this.viewPropertiesPhones.filter(function(e){var t=e.focused();return""===d.trim(e.value())&&!t}),this.viewPropertiesWebEmptyAndOnFocused=this.viewPropertiesWeb.filter(function(e){var t=e.focused();return""===d.trim(e.value())&&!t}),this.viewPropertiesOtherEmptyAndOnFocused=r.computed(function(){return o.filter(this.viewPropertiesOther(),function(e){var t=e.focused();return""===d.trim(e.value())&&!t})},this),this.viewPropertiesEmailsEmptyAndOnFocused.subscribe(function(e){t(e)}),this.viewPropertiesPhonesEmptyAndOnFocused.subscribe(function(e){t(e)}),this.viewPropertiesWebEmptyAndOnFocused.subscribe(function(e){t(e)}),this.viewPropertiesOtherEmptyAndOnFocused.subscribe(function(e){t(e)}),this.viewSaving=r.observable(!1),this.useCheckboxesInList=f.useCheckboxesInList,this.search.subscribe(function(){this.reloadContactList()},this),this.contacts.subscribe(d.windowResizeCallback),this.viewProperties.subscribe(d.windowResizeCallback),this.contactsChecked=r.computed(function(){return o.filter(this.contacts(),function(e){return e.checked()})},this),this.contactsCheckedOrSelected=r.computed(function(){var e=this.contactsChecked(),t=this.currentContact();return o.union(e,t?[t]:[])},this),this.contactsCheckedOrSelectedUids=r.computed(function(){return o.map(this.contactsCheckedOrSelected(),function(e){return e.idContact})},this),this.selector=new h(this.contacts,this.currentContact,".e-contact-item .actionHandle",".e-contact-item.selected",".e-contact-item .checkboxItem",".e-contact-item.focused"),this.selector.on("onItemSelect",o.bind(function(e){this.populateViewContact(e?e:null),e||this.emptySelection(!0)},this)),this.selector.on("onItemGetUid",function(e){return e?e.generateUid():""}),this.newCommand=d.createCommand(this,function(){this.populateViewContact(null),this.currentContact(null)}),this.deleteCommand=d.createCommand(this,function(){this.deleteSelectedContacts(),this.emptySelection(!0)},function(){return 0<this.contactsCheckedOrSelected().length}),this.newMessageCommand=d.createCommand(this,function(){var t=this.contactsCheckedOrSelected(),s=[];d.isNonEmptyArray(t)&&(s=o.map(t,function(e){if(e){var t=e.getNameAndEmailHelper(),i=t?new y(t[0],t[1]):null;if(i&&i.validate())return i}return null}),s=o.compact(s)),d.isNonEmptyArray(s)&&(e.bBackToCompose=!1,w.hideScreenPopup(i(68)),o.delay(function(){w.showScreenPopup(i(27),[l.ComposeType.Empty,null,s])},200))},function(){return 0<this.contactsCheckedOrSelected().length}),this.clearCommand=d.createCommand(this,function(){this.search("")}),this.saveCommand=d.createCommand(this,function(){this.viewSaving(!0),this.viewSaveTrigger(l.SaveSettingsStep.Animate);var t=d.fakeMd5(),i=[];o.each(this.viewProperties(),function(e){e.type()&&""!==d.trim(e.value())&&i.push([e.type(),e.value(),e.typeStr()])}),b.contactSave(function(i,s){var n=!1;e.viewSaving(!1),l.StorageResultType.Success===i&&s&&s.Result&&s.Result.RequestUid===t&&0<d.pInt(s.Result.ResultID)&&(""===e.viewID()&&e.viewID(d.pInt(s.Result.ResultID)),e.reloadContactList(),n=!0),o.delay(function(){e.viewSaveTrigger(n?l.SaveSettingsStep.TrueResult:l.SaveSettingsStep.FalseResult)},300),n&&(e.watchDirty(!1),o.delay(function(){e.viewSaveTrigger(l.SaveSettingsStep.Idle)},1e3))},t,this.viewID(),i)},function(){var e=this.viewHasNonEmptyRequaredProperties(),t=this.viewReadOnly();return!this.viewSaving()&&e&&!t}),this.syncCommand=d.createCommand(this,function(){var e=this;i(6).contactsSync(function(t,i){l.StorageResultType.Success===t&&i&&i.Result||s.alert(m.getNotification(i&&i.ErrorCode?i.ErrorCode:l.Notification.ContactsSyncError)),e.reloadContactList(!0)})},function(){return!this.contacts.syncing()&&!this.contacts.importing()}),this.bDropPageAfterDelete=!1,this.watchDirty=r.observable(!1),this.watchHash=r.observable(!1),this.viewHash=r.computed(function(){return""+o.map(e.viewProperties(),function(e){return e.value()}).join("")}),this.viewHash.subscribe(function(){!this.watchHash()||this.viewReadOnly()||this.watchDirty()||this.watchDirty(!0)},this),this.sDefaultKeyScope=l.KeyState.ContactList,w.constructorEnd(this)}var s=i(10),o=i(2),n=i(13),r=i(3),a=i(21),l=i(4),c=i(16),u=i(8),d=i(1),h=i(78),p=i(12),m=i(7),f=i(26),g=i(15),b=i(14),y=i(25),S=i(97),v=i(98),w=i(5),C=i(11);w.extendAsViewModel(["View/Popup/Contacts","PopupsContactsViewModel"],t),o.extend(t.prototype,C.prototype),t.prototype.getPropertyPlceholder=function(e){var t="";switch(e){case l.ContactPropertyType.LastName:t="CONTACTS/PLACEHOLDER_ENTER_LAST_NAME";break;case l.ContactPropertyType.FirstName:t="CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME";break;case l.ContactPropertyType.Nick:t="CONTACTS/PLACEHOLDER_ENTER_NICK_NAME"}return t},t.prototype.addNewProperty=function(e,t){this.viewProperties.push(new v(e,t||"","",!0,this.getPropertyPlceholder(e)))},t.prototype.addNewOrFocusProperty=function(e,t){var i=o.find(this.viewProperties(),function(t){return e===t.type()});i?i.focused(!0):this.addNewProperty(e,t)},t.prototype.addNewEmail=function(){this.addNewProperty(l.ContactPropertyType.Email,"Home")},t.prototype.addNewPhone=function(){this.addNewProperty(l.ContactPropertyType.Phone,"Mobile")},t.prototype.addNewWeb=function(){this.addNewProperty(l.ContactPropertyType.Web)},t.prototype.addNewNickname=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Nick)},t.prototype.addNewNotes=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Note)},t.prototype.addNewBirthday=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Birthday)},t.prototype.exportVcf=function(){i(6).download(p.exportContactsVcf())},t.prototype.exportCsv=function(){i(6).download(p.exportContactsCsv())},t.prototype.initUploader=function(){if(this.importUploaderButton()){var e=new Jua({action:p.uploadContacts(),name:"uploader",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,disableDragAndDrop:!0,disableMultiple:!0,disableDocumentDropPrevent:!0,clickElement:this.importUploaderButton()});e&&e.on("onStart",o.bind(function(){this.contacts.importing(!0)},this)).on("onComplete",o.bind(function(e,t,i){this.contacts.importing(!1),this.reloadContactList(),e&&t&&i&&i.Result||s.alert(m.i18n("CONTACTS/ERROR_IMPORT_FILE"))},this))}},t.prototype.removeCheckedOrSelectedContactsFromList=function(){var e=this,t=this.contacts,i=this.currentContact(),s=this.contacts().length,n=this.contactsCheckedOrSelected();0<n.length&&(o.each(n,function(t){i&&i.idContact===t.idContact&&(i=null,e.currentContact(null)),t.deleted(!0),s--}),0>=s&&(this.bDropPageAfterDelete=!0),o.delay(function(){o.each(n,function(e){t.remove(e),d.delegateRunOnDestroy(e)})},500))},t.prototype.deleteSelectedContacts=function(){0<this.contactsCheckedOrSelected().length&&(b.contactsDelete(o.bind(this.deleteResponse,this),this.contactsCheckedOrSelectedUids()),this.removeCheckedOrSelectedContactsFromList())},t.prototype.deleteResponse=function(e,t){500<(l.StorageResultType.Success===e&&t&&t.Time?d.pInt(t.Time):0)?this.reloadContactList(this.bDropPageAfterDelete):o.delay(function(e){return function(){e.reloadContactList(e.bDropPageAfterDelete)}}(this),500)},t.prototype.removeProperty=function(e){this.viewProperties.remove(e),d.delegateRunOnDestroy(e)},t.prototype.populateViewContact=function(e){var t="",i="",s="",n=[];this.watchHash(!1),this.emptySelection(!1),this.viewReadOnly(!1),e&&(t=e.idContact,d.isNonEmptyArray(e.properties)&&o.each(e.properties,function(e){e&&e[0]&&(l.ContactPropertyType.LastName===e[0]?i=e[1]:l.ContactPropertyType.FirstName===e[0]?s=e[1]:n.push(new v(e[0],e[2]||"",e[1])))}),this.viewReadOnly(!!e.readOnly)),n.unshift(new v(l.ContactPropertyType.LastName,"",i,!1,this.getPropertyPlceholder(l.ContactPropertyType.LastName))),n.unshift(new v(l.ContactPropertyType.FirstName,"",s,!e,this.getPropertyPlceholder(l.ContactPropertyType.FirstName))),this.viewID(t),d.delegateRunOnDestroy(this.viewProperties()),this.viewProperties([]),this.viewProperties(n),this.watchDirty(!1),this.watchHash(!0)},t.prototype.reloadContactList=function(e){var t=this,i=(this.contactsPage()-1)*c.Defaults.ContactsPerPage;this.bDropPageAfterDelete=!1,(d.isUnd(e)?1:!e)||(this.contactsPage(1),i=0),this.contacts.loading(!0),b.contacts(function(e,i){var s=0,n=[];l.StorageResultType.Success===e&&i&&i.Result&&i.Result.List&&d.isNonEmptyArray(i.Result.List)&&(n=o.map(i.Result.List,function(e){var t=new S;return t.parse(e)?t:null}),n=o.compact(n),s=d.pInt(i.Result.Count),s=s>0?s:0),t.contactsCount(s),d.delegateRunOnDestroy(t.contacts()),t.contacts(n),t.contacts.loading(!1),t.viewClearSearch(""!==t.search())
},i,c.Defaults.ContactsPerPage,this.search())},t.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;a("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=r.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},t.prototype.onShow=function(e){this.bBackToCompose=d.isUnd(e)?!1:!!e,w.routeOff(),this.reloadContactList(!0)},t.prototype.onHide=function(){w.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),d.delegateRunOnDestroy(this.contacts()),this.contacts([]),this.bBackToCompose&&(this.bBackToCompose=!1,w.showScreenPopup(i(27)))},e.exports=t}()},function(e,t,i){!function(){"use strict";e.exports=function(e){var t=i(10),s=i(2),o=i(13),n=i(8),r=i(23),a=i(1),l=i(4),c=i(7),u=i(25);n.__APP__=e,n.$win.keydown(a.killCtrlAandS).keyup(a.killCtrlAandS).unload(function(){n.bUnload=!0}),n.$html.addClass(n.bMobileDevice?"mobile":"no-mobile").on("click.dropdown.data-api",function(){a.detectDropdownVisibility()}),t.rl=t.rl||{},t.rl.i18n=s.bind(c.i18n,c),t.rl.addHook=s.bind(r.addHook,r),t.rl.settingsGet=s.bind(r.mainSettingsGet,r),t.rl.remoteRequest=s.bind(r.remoteRequest,r),t.rl.pluginSettingsGet=s.bind(r.settingsGet,r),t.rl.createCommand=a.createCommand,t.rl.EmailModel=u,t.rl.Enums=l,t.__APP_BOOT=function(i){o(function(){o("#rl-content").is(":visible")||n.$html.addClass("no-css"),t.rainloopTEMPLATES&&t.rainloopTEMPLATES[0]?(o("#rl-templates").html(t.rainloopTEMPLATES[0]),s.delay(function(){e.bootstart(),n.$html.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},10)):i(!1),t.__APP_BOOT=null})}}}()},function(e){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e){e.exports=window.Autolinker},function(e){e.exports=window.JSEncrypt},function(e){e.exports=window.JSON},function(e){e.exports=window.Jua},function(e){e.exports=window.SimplePace},function(e){e.exports=window.hasher},function(e){e.exports=window.ssm},function(e,t,i){!function(){"use strict";function t(e,t,i,o,r,a){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 0<this.listChecked().length},this),this.focusedItem=n.observable(null),this.selectedItem=t,this.selectedItemUseCallback=!0,this.itemSelectedThrottle=s.debounce(s.bind(this.itemSelected,this),300),this.listChecked.subscribe(function(e){0<e.length?null===this.selectedItem()?this.selectedItem.valueHasMutated&&this.selectedItem.valueHasMutated():this.selectedItem(null):this.bAutoSelect&&this.focusedItem()&&this.selectedItem(this.focusedItem())},this),this.selectedItem.subscribe(function(e){e?(this.isListChecked()&&s.each(this.listChecked(),function(e){e.checked(!1)}),this.selectedItemUseCallback&&this.itemSelectedThrottle(e)):this.selectedItemUseCallback&&this.itemSelected(null)},this),this.selectedItem.extend({toggleSubscribe:[null,function(e){e&&e.selected(!1)},function(e){e&&e.selected(!0)}]}),this.focusedItem.extend({toggleSubscribe:[null,function(e){e&&e.focused(!1)},function(e){e&&e.focused(!0)}]}),this.oContentVisible=null,this.oContentScrollable=null,this.sItemSelector=i,this.sItemSelectedSelector=o,this.sItemCheckedSelector=r,this.sItemFocusedSelector=a,this.sLastUid="",this.bAutoSelect=!0,this.oCallbacks={},this.emptyFunction=function(){},this.focusedItem.subscribe(function(e){e&&(this.sLastUid=this.getItemUid(e))},this);var c=[],u=[],d=null,h=null;this.list.subscribe(function(e){var t=this;l.isArray(e)&&s.each(e,function(e){if(e){var i=t.getItemUid(e);c.push(i),e.checked()&&u.push(i),null===d&&e.focused()&&(d=i),null===h&&e.selected()&&(h=i)}})},this,"beforeChange"),this.list.subscribe(function(e){var t=this,i=null,o=!1,n=[],r=d,a=!1,p=!1,m=0;this.selectedItemUseCallback=!1,this.focusedItem(null),this.selectedItem(null),l.isArray(e)&&(m=u.length,s.each(e,function(e){var i=t.getItemUid(e);n.push(i),null!==d&&d===i&&(t.focusedItem(e),d=null),m>0&&-1<l.inArray(i,u)&&(a=!0,e.checked(!0),m--),a||null===h||h!==i||(p=!0,t.selectedItem(e),h=null)}),this.selectedItemUseCallback=!0,a||p||!this.bAutoSelect||(t.focusedItem()?t.selectedItem(t.focusedItem()):0<e.length&&(null!==r&&(o=!1,r=s.find(c,function(e){return o&&-1<l.inArray(e,n)?e:(r===e&&(o=!0),!1)}),r&&(i=s.find(e,function(e){return r===t.getItemUid(e)}))),t.selectedItem(i||null),t.focusedItem(t.selectedItem())))),c=[],u=[],d=null,h=null},this)}var s=i(2),o=i(13),n=i(3),r=i(21),a=i(4),l=i(1);t.prototype.itemSelected=function(e){this.isListChecked()?e||(this.oCallbacks.onItemSelect||this.emptyFunction)(e||null):e&&(this.oCallbacks.onItemSelect||this.emptyFunction)(e)},t.prototype.goDown=function(e){this.newSelectPosition(a.EventKeyCode.Down,!1,e)},t.prototype.goUp=function(e){this.newSelectPosition(a.EventKeyCode.Up,!1,e)},t.prototype.init=function(e,t,i){if(this.oContentVisible=e,this.oContentScrollable=t,i=i||"all",this.oContentVisible&&this.oContentScrollable){var s=this;o(this.oContentVisible).on("selectstart",function(e){e&&e.preventDefault&&e.preventDefault()}).on("click",this.sItemSelector,function(e){s.actionClick(n.dataFor(this),e)}).on("click",this.sItemCheckedSelector,function(e){var t=n.dataFor(this);t&&(e&&e.shiftKey?s.actionClick(t,e):(s.focusedItem(t),t.checked(!t.checked())))}),r("enter",i,function(){return s.focusedItem()&&!s.focusedItem().selected()?(s.actionClick(s.focusedItem()),!1):!0}),r("ctrl+up, command+up, ctrl+down, command+down",i,function(){return!1}),r("up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space",i,function(e,t){if(e&&t&&t.shortcut){var i=0;switch(t.shortcut){case"up":case"shift+up":i=a.EventKeyCode.Up;break;case"down":case"shift+down":i=a.EventKeyCode.Down;break;case"insert":i=a.EventKeyCode.Insert;break;case"space":i=a.EventKeyCode.Space;break;case"home":i=a.EventKeyCode.Home;break;case"end":i=a.EventKeyCode.End;break;case"pageup":i=a.EventKeyCode.PageUp;break;case"pagedown":i=a.EventKeyCode.PageDown}if(i>0)return s.newSelectPosition(i,r.shift),!1}})}},t.prototype.autoSelect=function(e){this.bAutoSelect=!!e},t.prototype.getItemUid=function(e){var t="",i=this.oCallbacks.onItemGetUid||null;return i&&e&&(t=i(e)),t.toString()},t.prototype.newSelectPosition=function(e,t,i){var o=0,n=10,r=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,h=this.focusedItem();if(d>0)if(h){if(h)if(a.EventKeyCode.Down===e||a.EventKeyCode.Up===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)s.each(u,function(t){if(!l)switch(e){case a.EventKeyCode.Up:h===t?l=!0:c=t;break;case a.EventKeyCode.Down:case a.EventKeyCode.Insert:r?(c=t,l=!0):h===t&&(r=!0)}});else if(a.EventKeyCode.Home===e||a.EventKeyCode.End===e)a.EventKeyCode.Home===e?c=u[0]:a.EventKeyCode.End===e&&(c=u[u.length-1]);else if(a.EventKeyCode.PageDown===e){for(;d>o;o++)if(h===u[o]){o+=n,o=o>d-1?d-1:o,c=u[o];break}}else if(a.EventKeyCode.PageUp===e)for(o=d;o>=0;o--)if(h===u[o]){o-=n,o=0>o?0:o,c=u[o];break}}else a.EventKeyCode.Down===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e||a.EventKeyCode.Home===e||a.EventKeyCode.PageUp===e?c=u[0]:(a.EventKeyCode.Up===e||a.EventKeyCode.End===e||a.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),h&&(t?(a.EventKeyCode.Up===e||a.EventKeyCode.Down===e)&&h.checked(!h.checked()):(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&h.checked(!h.checked())),!this.bAutoSelect&&!i||this.isListChecked()||a.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):h&&(!t||a.EventKeyCode.Up!==e&&a.EventKeyCode.Down!==e?(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&h.checked(!h.checked()):h.checked(!h.checked()),this.focusedItem(h))},t.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},t.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e||50>this.oContentScrollable.scrollTop()?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},t.prototype.eventClickFunction=function(e,t){var i=this.getItemUid(e),s=0,o=0,n=null,r="",a=!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],r=this.getItemUid(n),a=!1,(r===this.sLastUid||r===i)&&(a=!0),a&&(l=!l),(l||a)&&n.checked(u);this.sLastUid=""===i?"":i},t.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())}},t.prototype.on=function(e,t){this.oCallbacks[e]=t},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){l.call(this,"AttachmentModel"),this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.isThumbnail=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex="",this.framed=!1}var s=i(10),o=i(2),n=i(8),r=i(1),a=i(12),l=i(24);o.extend(t.prototype,l.prototype),t.newInstanceFromJson=function(e){var i=new t;return i.initByJson(e)?i:null},t.prototype.mimeType="",t.prototype.fileName="",t.prototype.estimatedSize=0,t.prototype.friendlySize="",t.prototype.isInline=!1,t.prototype.isLinked=!1,t.prototype.isThumbnail=!1,t.prototype.cid="",t.prototype.cidWithOutTags="",t.prototype.contentLocation="",t.prototype.download="",t.prototype.folder="",t.prototype.uid="",t.prototype.mimeIndex="",t.prototype.framed=!1,t.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=r.trim((e.MimeType||"").toLowerCase()),this.fileName=r.trim(e.FileName),this.estimatedSize=r.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.isThumbnail=!!e.IsThumbnail,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.framed=!!e.Framed,this.friendlySize=r.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},t.prototype.isImage=function(){return-1<r.inArray(this.mimeType.toLowerCase(),["image/png","image/jpg","image/jpeg","image/gif"])},t.prototype.hasThumbnail=function(){return this.isThumbnail},t.prototype.isText=function(){return-1<r.inArray(this.mimeType,["application/pgp-signature"])||"text/"===this.mimeType.substr(0,5)&&-1===r.inArray(this.mimeType,["text/html"])},t.prototype.isPdf=function(){return n.bAllowPdfPreview&&"application/pdf"===this.mimeType},t.prototype.isFramed=function(){return this.framed&&n.__APP__&&n.__APP__.googlePreviewSupported()&&!this.isPdf()&&!this.isText()&&!this.isImage()},t.prototype.hasPreview=function(){return this.isImage()||this.isPdf()||this.isText()||this.isFramed()},t.prototype.linkDownload=function(){return a.attachmentDownload(this.download)},t.prototype.linkPreview=function(){return a.attachmentPreview(this.download)},t.prototype.linkThumbnail=function(){return this.hasThumbnail()?a.attachmentThumbnailPreview(this.download):""},t.prototype.linkThumbnailPreviewStyle=function(){var e=this.linkThumbnail();return""===e?"":"background:url("+e+")"},t.prototype.linkFramed=function(){return a.attachmentFramed(this.download)},t.prototype.linkPreviewAsPlain=function(){return a.attachmentPreviewAsPlain(this.download)},t.prototype.linkPreviewMain=function(){var e="";switch(!0){case this.isImage():case this.isPdf():e=this.linkPreview();break;case this.isText():e=this.linkPreviewAsPlain();break;case this.isFramed():e=this.linkFramed()}return e},t.prototype.hasPreview=function(){return this.isImage()||this.isPdf()||this.isText()||this.isFramed()},t.prototype.generateTransferDownloadUrl=function(){var e=this.linkDownload();return"http"!==e.substr(0,4)&&(e=s.location.protocol+"//"+s.location.host+s.location.pathname+e),this.mimeType+":"+this.fileName+":"+e},t.prototype.eventDragStart=function(e,t){var i=t.originalEvent||t;return e&&i&&i.dataTransfer&&i.dataTransfer.setData&&i.dataTransfer.setData("DownloadURL",this.generateTransferDownloadUrl()),!0},t.staticIconClassHelper=function(e){e=r.trim(e).toLowerCase();var t="",i="icon-file",s=e.split("/");return s&&s[1]&&("image"===s[0]?i="icon-file-image":"text"===s[0]?i="icon-file-text":"audio"===s[0]?i="icon-file-music":"video"===s[0]?i="icon-file-movie":-1<r.inArray(s[1],["zip","7z","tar","rar","gzip","bzip","bzip2","x-zip","x-7z","x-rar","x-tar","x-gzip","x-bzip","x-bzip2","x-zip-compressed","x-7z-compressed","x-rar-compressed"])?i="icon-file-zip":-1<r.inArray(s[1],["pdf","x-pdf"])?(t="pdf",i="icon-none"):-1<r.inArray(e,["application/pgp-signature","application/pkcs7-signature"])?i="icon-file-certificate":-1<r.inArray(s[1],["rtf","msword","vnd.msword","vnd.openxmlformats-officedocument.wordprocessingml.document","vnd.openxmlformats-officedocument.wordprocessingml.template","vnd.ms-word.document.macroEnabled.12","vnd.ms-word.template.macroEnabled.12"])?i="icon-file-text":-1<r.inArray(s[1],["excel","ms-excel","vnd.ms-excel","vnd.openxmlformats-officedocument.spreadsheetml.sheet","vnd.openxmlformats-officedocument.spreadsheetml.template","vnd.ms-excel.sheet.macroEnabled.12","vnd.ms-excel.template.macroEnabled.12","vnd.ms-excel.addin.macroEnabled.12","vnd.ms-excel.sheet.binary.macroEnabled.12"])?i="icon-file-excel":-1<r.inArray(s[1],["powerpoint","ms-powerpoint","vnd.ms-powerpoint","vnd.openxmlformats-officedocument.presentationml.presentation","vnd.openxmlformats-officedocument.presentationml.template","vnd.openxmlformats-officedocument.presentationml.slideshow","vnd.ms-powerpoint.addin.macroEnabled.12","vnd.ms-powerpoint.presentation.macroEnabled.12","vnd.ms-powerpoint.template.macroEnabled.12","vnd.ms-powerpoint.slideshow.macroEnabled.12"])&&(i="icon-file-chart-graph")),[i,t]},t.prototype.iconClass=function(){return t.staticIconClassHelper(this.mimeType)[0]},t.prototype.iconText=function(){return t.staticIconClassHelper(this.mimeType)[1]},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,"FilterModel"),this.enabled=o.observable(!0),this.id="",this.name=o.observable(""),this.name.error=o.observable(!1),this.name.focused=o.observable(!1),this.conditions=o.observableArray([]),this.conditionsType=o.observable(n.FilterRulesType.Any),this.actionValue=o.observable(""),this.actionValue.error=o.observable(!1),this.actionValueSecond=o.observable(""),this.actionValueThird=o.observable(""),this.actionMarkAsRead=o.observable(!1),this.actionKeep=o.observable(!0),this.actionNoStop=o.observable(!1),this.actionType=o.observable(n.FiltersAction.MoveTo),this.actionType.subscribe(function(){this.actionValue(""),this.actionValue.error(!1),this.actionValueSecond(""),this.actionValueThird("")},this);var e=function(e){var t=l.getFolderFromCacheList(e);return t?t.fullName.replace("."===t.delimiter?/\./:/[\\\/]+/," / "):e};this.nameSub=o.computed(function(){var t="",i=this.actionValue();switch(this.actionType()){case n.FiltersAction.MoveTo:t=a.i18n("SETTINGS_FILTERS/SUBNAME_MOVE_TO",{FOLDER:e(i)});break;case n.FiltersAction.Forward:t=a.i18n("SETTINGS_FILTERS/SUBNAME_FORWARD_TO",{EMAIL:i});break;case n.FiltersAction.Vacation:t=a.i18n("SETTINGS_FILTERS/SUBNAME_VACATION_MESSAGE");break;case n.FiltersAction.Reject:t=a.i18n("SETTINGS_FILTERS/SUBNAME_REJECT");break;case n.FiltersAction.Discard:t=a.i18n("SETTINGS_FILTERS/SUBNAME_DISCARD")}return t?"("+t+")":""},this),this.actionTemplate=o.computed(function(){var e="";switch(this.actionType()){default:case n.FiltersAction.MoveTo:e="SettingsFiltersActionMoveToFolder";break;case n.FiltersAction.Forward:e="SettingsFiltersActionForward";break;case n.FiltersAction.Vacation:e="SettingsFiltersActionVacation";break;case n.FiltersAction.Reject:e="SettingsFiltersActionReject";break;case n.FiltersAction.None:e="SettingsFiltersActionNone";break;case n.FiltersAction.Discard:e="SettingsFiltersActionDiscard"}return e},this),this.regDisposables(this.conditions.subscribe(r.windowResizeCallback)),this.regDisposables(this.name.subscribe(function(e){this.name.error(""===e)},this)),this.regDisposables(this.actionValue.subscribe(function(e){this.actionValue.error(""===e)},this)),this.regDisposables([this.actionNoStop,this.actionTemplate]),this.deleteAccess=o.observable(!1),this.canBeDalete=o.observable(!0)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(19),c=i(99),u=i(24);s.extend(t.prototype,u.prototype),t.prototype.generateID=function(){this.id=r.fakeMd5()},t.prototype.verify=function(){return""===this.name()?(this.name.error(!0),!1):0<this.conditions().length&&s.find(this.conditions(),function(e){return e&&!e.verify()})?!1:""===this.actionValue()&&-1<r.inArray(this.actionType(),[n.FiltersAction.MoveTo,n.FiltersAction.Forward,n.FiltersAction.Reject,n.FiltersAction.Vacation])?(this.actionValue.error(!0),!1):n.FiltersAction.Forward===this.actionType()&&-1===this.actionValue().indexOf("@")?(this.actionValue.error(!0),!1):(this.name.error(!1),this.actionValue.error(!1),!0)},t.prototype.toJson=function(){return{ID:this.id,Enabled:this.enabled()?"1":"0",Name:this.name(),ConditionsType:this.conditionsType(),Conditions:s.map(this.conditions(),function(e){return e.toJson()}),ActionValue:this.actionValue(),ActionValueSecond:this.actionValueSecond(),ActionValueThird:this.actionValueThird(),ActionType:this.actionType(),Stop:this.actionNoStop()?"0":"1",Keep:this.actionKeep()?"1":"0",MarkAsRead:this.actionMarkAsRead()?"1":"0"}},t.prototype.addCondition=function(){this.conditions.push(new c)},t.prototype.removeCondition=function(e){this.conditions.remove(e),r.delegateRunOnDestroy(e)},t.prototype.parse=function(e){var t=!1;return e&&"Object/Filter"===e["@Object"]&&(this.id=r.pString(e.ID),this.name(r.pString(e.Name)),this.enabled(!!e.Enabled),this.conditionsType(r.pString(e.ConditionsType)),this.conditions([]),r.isNonEmptyArray(e.Conditions)&&this.conditions(s.compact(s.map(e.Conditions,function(e){var t=new c;return t&&t.parse(e)?t:null}))),this.actionType(r.pString(e.ActionType)),this.actionValue(r.pString(e.ActionValue)),this.actionValueSecond(r.pString(e.ActionValueSecond)),this.actionValueThird(r.pString(e.ActionValueThird)),this.actionNoStop(!e.Stop),this.actionKeep(!!e.Keep),this.actionMarkAsRead(!!e.MarkAsRead),t=!0),t},t.prototype.cloneSelf=function(){var e=new t;return e.id=this.id,e.enabled(this.enabled()),e.name(this.name()),e.name.error(this.name.error()),e.conditionsType(this.conditionsType()),e.actionMarkAsRead(this.actionMarkAsRead()),e.actionType(this.actionType()),e.actionValue(this.actionValue()),e.actionValue.error(this.actionValue.error()),e.actionValueSecond(this.actionValueSecond()),e.actionValueThird(this.actionValueThird()),e.actionKeep(this.actionKeep()),e.actionNoStop(this.actionNoStop()),e.conditions(s.map(this.conditions(),function(e){return e.cloneSelf()})),e},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){f.call(this,"MessageModel"),this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=r.observable(""),this.subjectPrefix=r.observable(""),this.subjectSuffix=r.observable(""),this.size=r.observable(0),this.dateTimeStampInUTC=r.observable(0),this.priority=r.observable(l.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=r.observable(""),this.fromClearEmailString=r.observable(""),this.toEmailsString=r.observable(""),this.toClearEmailsString=r.observable(""),this.senderEmailsString=r.observable(""),this.senderClearEmailsString=r.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=r.observable(!1),this.deleted=r.observable(!1),this.unseen=r.observable(!1),this.flagged=r.observable(!1),this.answered=r.observable(!1),this.forwarded=r.observable(!1),this.isReadReceipt=r.observable(!1),this.focused=r.observable(!1),this.selected=r.observable(!1),this.checked=r.observable(!1),this.hasAttachments=r.observable(!1),this.attachmentsMainType=r.observable(""),this.moment=r.observable(a(a.unix(0))),this.attachmentIconClass=r.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";break;case"certificate":e="icon-file-certificate"}return e},this),this.fullFormatDateValue=r.computed(function(){return t.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=c.createMomentDate(this),this.momentShortDate=c.createMomentShortDate(this),this.regDisposables(this.dateTimeStampInUTC.subscribe(function(e){var t=a().unix();this.moment(a.unix(e>t?t:e))},this)),this.body=null,this.plainRaw="",this.isHtml=r.observable(!1),this.hasImages=r.observable(!1),this.attachments=r.observableArray([]),this.isPgpSigned=r.observable(!1),this.isPgpEncrypted=r.observable(!1),this.pgpSignedVerifyStatus=r.observable(l.SignedVerifyStatus.None),this.pgpSignedVerifyUser=r.observable(""),this.priority=r.observable(l.MessagePriority.Normal),this.readReceipt=r.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=r.observable(0),this.threads=r.observableArray([]),this.threadsLen=r.observable(0),this.hasUnseenSubMessage=r.observable(!1),this.hasFlaggedSubMessage=r.observable(!1),this.lastInCollapsedThread=r.observable(!1),this.lastInCollapsedThreadLoading=r.observable(!1),this.threadsLenResult=r.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this),this.isImportant=r.computed(function(){return l.MessagePriority.High===this.priority()},this),this.regDisposables([this.attachmentIconClass,this.fullFormatDateValue,this.threadsLenResult,this.isImportant])}var s=i(10),o=i(2),n=i(13),r=i(3),a=i(36),l=i(4),c=i(1),u=i(8),d=i(12),h=i(20),p=i(25),m=i(79),f=i(24);o.extend(t.prototype,f.prototype),t.newInstanceFromJson=function(e){var i=new t;return i.initByJson(e)?i:null},t.calculateFullFromatDateValue=function(e){return e>0?a.unix(e).format("LLL"):""},t.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(", ")},t.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(", ")},t.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},t.replyHelper=function(e,t,i){if(e&&0<e.length)for(var s=0,o=e.length;o>s;s++)c.isUnd(t[e[s].email])&&(t[e[s].email]=!0,i.push(e[s]))},t.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)},t.prototype.friendlySize=function(){return c.friendlySize(this.size())},t.prototype.computeSenderEmail=function(){var e=i(32).sentFolder(),t=i(32).draftFolder();this.senderEmailsString(this.folderFullNameRaw===e||this.folderFullNameRaw===t?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===e||this.folderFullNameRaw===t?this.toClearEmailsString():this.fromClearEmailString())},t.prototype.initByJson=function(e){var i=!1,s=l.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(s=c.pInt(e.Priority),this.priority(-1<c.inArray(s,[l.MessagePriority.High,l.MessagePriority.Low])?s:l.MessagePriority.Normal),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=t.initEmailsFromJson(e.From),this.to=t.initEmailsFromJson(e.To),this.cc=t.initEmailsFromJson(e.Cc),this.bcc=t.initEmailsFromJson(e.Bcc),this.replyTo=t.initEmailsFromJson(e.ReplyTo),this.deliveredTo=t.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(t.emailsToLine(this.from,!0)),this.fromClearEmailString(t.emailsToLineClear(this.from)),this.toEmailsString(t.emailsToLine(this.to,!0)),this.toClearEmailsString(t.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(),i=!0),i},t.prototype.initUpdateByMessageJson=function(e){var t=!1,s=l.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(s=c.pInt(e.Priority),this.priority(-1<c.inArray(s,[l.MessagePriority.High,l.MessagePriority.Low])?s:l.MessagePriority.Normal),this.aDraftInfo=e.DraftInfo,this.sMessageId=e.MessageId,this.sInReplyTo=e.InReplyTo,this.sReferences=e.References,this.proxy=!!e.ExternalProxy,i(20).capaOpenPGP()&&(this.isPgpSigned(!!e.PgpSigned),this.isPgpEncrypted(!!e.PgpEncrypted)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.foundedCIDs=c.isArray(e.FoundedCIDs)?e.FoundedCIDs:[],this.attachments(this.initAttachmentsFromJson(e.Attachments)),this.readReceipt(e.ReadReceipt||""),this.computeSenderEmail(),t=!0),t},t.prototype.initAttachmentsFromJson=function(e){var t=0,i=0,s=null,o=[];if(e&&"Collection/AttachmentCollection"===e["@Object"]&&c.isNonEmptyArray(e["@Collection"]))for(t=0,i=e["@Collection"].length;i>t;t++)s=m.newInstanceFromJson(e["@Collection"][t]),s&&(""!==s.cidWithOutTags&&0<this.foundedCIDs.length&&0<=c.inArray(s.cidWithOutTags,this.foundedCIDs)&&(s.isLinked=!0),o.push(s));return o},t.prototype.initFlagsByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.unseen(!e.IsSeen),this.flagged(!!e.IsFlagged),this.answered(!!e.IsAnswered),this.forwarded(!!e.IsForwarded),this.isReadReceipt(!!e.IsReadReceipt),t=!0),t},t.prototype.fromToLine=function(e,i){return t.emailsToLine(this.from,e,i)},t.prototype.fromDkimData=function(){var e=["none",""];return c.isNonEmptyArray(this.from)&&1===this.from.length&&this.from[0]&&this.from[0].dkimStatus&&(e=[this.from[0].dkimStatus,this.from[0].dkimValue||""]),e},t.prototype.toToLine=function(e,i){return t.emailsToLine(this.to,e,i)},t.prototype.ccToLine=function(e,i){return t.emailsToLine(this.cc,e,i)},t.prototype.bccToLine=function(e,i){return t.emailsToLine(this.bcc,e,i)},t.prototype.lineAsCcc=function(){var e=[];if(this.deleted()&&e.push("deleted"),this.selected()&&e.push("selected"),this.checked()&&e.push("checked"),this.flagged()&&e.push("flagged"),this.unseen()&&e.push("unseen"),this.answered()&&e.push("answered"),this.forwarded()&&e.push("forwarded"),this.focused()&&e.push("focused"),this.isImportant()&&e.push("important"),this.hasAttachments())switch(e.push("withAttachments"),this.attachmentsMainType()){case"image":e.push("imageOnlyAttachments");break;case"archive":e.push("archiveOnlyAttachments")}return this.newForAnimation()&&e.push("new"),""===this.subject()&&e.push("emptySubject"),0<this.parentUid()&&e.push("hasParentMessage"),0<this.threadsLen()&&0===this.parentUid()&&e.push("hasChildrenMessage"),this.hasUnseenSubMessage()&&e.push("hasUnseenSubMessage"),this.hasFlaggedSubMessage()&&e.push("hasFlaggedSubMessage"),e.join(" ")},t.prototype.hasVisibleAttachments=function(){return!!o.find(this.attachments(),function(e){return!e.isLinked})},t.prototype.findAttachmentByCid=function(e){var t=null,i=this.attachments();return c.isNonEmptyArray(i)&&(e=e.replace(/^<+/,"").replace(/>+$/,""),t=o.find(i,function(t){return e===t.cidWithOutTags})),t||null},t.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},t.prototype.messageId=function(){return this.sMessageId},t.prototype.inReplyTo=function(){return this.sInReplyTo},t.prototype.references=function(){return this.sReferences},t.prototype.fromAsSingleEmail=function(){return c.isArray(this.from)&&this.from[0]?this.from[0].email:""},t.prototype.viewLink=function(){return d.messageViewLink(this.requestHash)},t.prototype.downloadLink=function(){return d.messageDownloadLink(this.requestHash)},t.prototype.replyEmails=function(e){var i=[],s=c.isUnd(e)?{}:e;return t.replyHelper(this.replyTo,s,i),0===i.length&&t.replyHelper(this.from,s,i),i},t.prototype.replyAllEmails=function(e){var i=[],s=[],o=c.isUnd(e)?{}:e;return t.replyHelper(this.replyTo,o,i),0===i.length&&t.replyHelper(this.from,o,i),t.replyHelper(this.to,o,i),t.replyHelper(this.cc,o,s),[i,s]},t.prototype.textBodyToString=function(){return this.body?this.body.html():""},t.prototype.attachmentsToStringLine=function(){var e=o.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0<e.length?e.join(", "):""},t.prototype.getDataForWindowPopup=function(){return{popupFrom:this.fromToLine(!1),popupTo:this.toToLine(!1),popupCc:this.ccToLine(!1),popupBcc:this.bccToLine(!1),popupSubject:this.subject(),popupIsHtml:this.isHtml(),popupDate:this.fullFormatDateValue(),popupAttachments:this.attachmentsToStringLine(),popupBody:this.textBodyToString()}},t.prototype.viewPopupMessage=function(e){c.windowPopupKnockout(this.getDataForWindowPopup(),"PopupsWindowSimpleMessage",this.subject(),function(t){t&&t.document&&t.document.body&&(n("img.lazy",t.document.body).each(function(e,t){var i=n(t),s=i.data("original"),o=i.attr("src");e>=0&&s&&!o&&i.attr("src",s)}),e&&s.setTimeout(function(){t.print()},100))})},t.prototype.printMessage=function(){this.viewPopupMessage(!0)},t.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},t.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.priority(e.priority()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this
},t.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)}},t.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)}},t.prototype.storeDataToDom=function(){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),i(20).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())))},t.prototype.storePgpVerifyDataToDom=function(){this.body&&i(20).capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},t.prototype.fetchDataToDom=function(){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")),i(20).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("")))},t.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],t=null,s=i(15),r=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",a=s.findPublicKeysByEmail(r),c=null,d=null,p="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{t=h.openpgp.cleartext.readArmored(this.plainRaw),t&&t.getText&&(this.pgpSignedVerifyStatus(a.length?l.SignedVerifyStatus.Unverified:l.SignedVerifyStatus.UnknownPublicKeys),e=t.verify(a),e&&0<e.length&&(c=o.find(e,function(e){return e&&e.keyid&&e.valid}),c&&(d=s.findPublicKeyByHex(c.keyid.toHex()),d&&(p=t.getText(),this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Success),this.pgpSignedVerifyUser(d.user),p=u.$div.empty().append(n('<pre class="b-plain-openpgp signed verified"></pre>').text(p)).html(),u.$div.empty(),this.replacePlaneTextBody(p)))))}catch(m){}this.storePgpVerifyDataToDom()}},t.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var t=[],s=null,r=null,a=i(15),c=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",d=a.findPublicKeysByEmail(c),p=a.findSelfPrivateKey(e),m=null,f=null,g="";this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),p||this.pgpSignedVerifyStatus(l.SignedVerifyStatus.UnknownPrivateKey);try{s=h.openpgp.message.readArmored(this.plainRaw),s&&p&&s.decrypt&&(this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Unverified),r=s.decrypt(p),r&&(t=r.verify(d),t&&0<t.length&&(m=o.find(t,function(e){return e&&e.keyid&&e.valid}),m&&(f=a.findPublicKeyByHex(m.keyid.toHex()),f&&(this.pgpSignedVerifyStatus(l.SignedVerifyStatus.Success),this.pgpSignedVerifyUser(f.user)))),g=r.getText(),g=u.$div.empty().append(n('<pre class="b-plain-openpgp signed verified"></pre>').text(g)).html(),u.$div.empty(),this.replacePlaneTextBody(g)))}catch(b){}this.storePgpVerifyDataToDom()}},t.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},t.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},e.exports=t}()},,function(e,t,i){!function(){"use strict";function t(){this.capa=s.observable(""),this.modules=s.observable({}),this.filters=s.observableArray([]),this.filters.loading=s.observable(!1).extend({throttle:200}),this.filters.saving=s.observable(!1).extend({throttle:200}),this.raw=s.observable("")}var s=i(3);e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.quota=o.observable(0),this.usage=o.observable(0),this.percentage=o.computed(function(){var e=this.quota(),t=this.usage();return e>0?s.Math.ceil(t/e*100):0},this)}var s=i(10),o=i(3);t.prototype.populateData=function(e,t){this.quota(1024*e),this.usage(1024*t)},e.exports=new t}()},,,function(e,t,i){!function(){"use strict";function t(){d.call(this,"Popups","PopupsFilter"),this.isNew=o.observable(!0),this.modules=c.modules,this.fTrueCallback=null,this.filter=o.observable(null),this.allowMarkAsRead=o.observable(!1),this.defautOptionsAfterRender=r.defautOptionsAfterRender,this.folderSelectList=l.folderMenuForFilters,this.selectedFolderValue=o.observable(""),this.selectedFolderValue.subscribe(function(){this.filter()&&this.filter().actionValue.error(!1)},this),this.saveFilter=r.createCommand(this,function(){if(this.filter()){if(n.FiltersAction.MoveTo===this.filter().actionType()&&this.filter().actionValue(this.selectedFolderValue()),!this.filter().verify())return!1;this.fTrueCallback&&this.fTrueCallback(this.filter()),this.modalVisibility()&&r.delegateRun(this,"closeCommand")}return!0}),this.actionTypeOptions=o.observableArray([]),this.fieldOptions=o.observableArray([]),this.typeOptions=o.observableArray([]),a.initOnStartOrLangChange(this.populateOptions,this),this.modules.subscribe(this.populateOptions,this),u.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(15),c=i(83),u=i(5),d=i(11);u.extendAsViewModel(["View/Popup/Filter","PopupsFilterViewModel"],t),s.extend(t.prototype,d.prototype),t.prototype.populateOptions=function(){this.actionTypeOptions([]);var e=this.modules();e&&(e.markasread&&this.allowMarkAsRead(!0),e.moveto&&this.actionTypeOptions.push({id:n.FiltersAction.MoveTo,name:a.i18n("POPUPS_FILTER/SELECT_ACTION_MOVE_TO")}),e.redirect&&this.actionTypeOptions.push({id:n.FiltersAction.Forward,name:a.i18n("POPUPS_FILTER/SELECT_ACTION_FORWARD_TO")}),e.reject&&this.actionTypeOptions.push({id:n.FiltersAction.Reject,name:a.i18n("POPUPS_FILTER/SELECT_ACTION_REJECT")}),e.vacation&&this.actionTypeOptions.push({id:n.FiltersAction.Vacation,name:a.i18n("POPUPS_FILTER/SELECT_ACTION_VACATION_MESSAGE")})),this.actionTypeOptions.push({id:n.FiltersAction.Discard,name:a.i18n("POPUPS_FILTER/SELECT_ACTION_DISCARD")}),this.fieldOptions([{id:n.FilterConditionField.From,name:a.i18n("POPUPS_FILTER/SELECT_FIELD_FROM")},{id:n.FilterConditionField.Recipient,name:a.i18n("POPUPS_FILTER/SELECT_FIELD_RECIPIENTS")},{id:n.FilterConditionField.Subject,name:a.i18n("POPUPS_FILTER/SELECT_FIELD_SUBJECT")}]),this.typeOptions([{id:n.FilterConditionType.Contains,name:a.i18n("POPUPS_FILTER/SELECT_TYPE_CONTAINS")},{id:n.FilterConditionType.NotContains,name:a.i18n("POPUPS_FILTER/SELECT_TYPE_NOT_CONTAINS")},{id:n.FilterConditionType.EqualTo,name:a.i18n("POPUPS_FILTER/SELECT_TYPE_EQUAL_TO")},{id:n.FilterConditionType.NotEqualTo,name:a.i18n("POPUPS_FILTER/SELECT_TYPE_NOT_EQUAL_TO")}])},t.prototype.removeCondition=function(e){this.filter()&&this.filter().removeCondition(e)},t.prototype.clearPopup=function(){this.isNew(!0),this.fTrueCallback=null,this.filter(null)},t.prototype.onShow=function(e,t,i){this.clearPopup(),this.fTrueCallback=t,this.filter(e),e&&this.selectedFolderValue(e.actionValue()),this.isNew(!i),!i&&e&&e.name.focused(!0)},t.prototype.onFocus=function(){this.isNew()&&this.filter()&&this.filter().name.focused(!0)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){h.call(this,"Popups","PopupsFolderCreate"),l.initOnStartOrLangChange(function(){this.sNoParentText=l.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(r.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,i=null,s=c.folderList(),o=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==c.namespace&&(t=function(e){return c.namespace!==e.fullNameRaw.substr(0,c.namespace.length)}),a.folderListOptionsBuilder([],s,[],e,null,t,i,o)},this),this.createFolder=a.createCommand(this,function(){var e=this.selectedParentValue();""===e&&1<c.namespace.length&&(e=c.namespace.substr(0,c.namespace.length-1)),c.foldersCreating(!0),u.folderCreate(function(e,t){c.foldersCreating(!1),n.StorageResultType.Success===e&&t&&t.Result?i(6).folders():c.folderList.error(t&&t.ErrorCode?l.getNotification(t.ErrorCode):l.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"))},this.folderName(),e),this.cancelCommand()},function(){return this.simpleFolderNameValidation(this.folderName())}),this.defautOptionsAfterRender=a.defautOptionsAfterRender,d.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(16),a=i(1),l=i(7),c=i(15),u=i(14),d=i(5),h=i(11);d.extendAsViewModel(["View/Popup/FolderCreate","PopupsFolderCreateViewModel"],t),s.extend(t.prototype,h.prototype),t.prototype.sNoParentText="",t.prototype.simpleFolderNameValidation=function(e){return/^[^\\\/]+$/g.test(a.trim(e))},t.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.folderName.focused(!1)},t.prototype.onShow=function(){this.clearPopup()},t.prototype.onFocus=function(){this.folderName.focused(!0)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){d.call(this,"Popups","PopupsIdentity"),this.id="",this.edit=o.observable(!1),this.owner=o.observable(!1),this.email=o.observable("").validateEmail(),this.email.focused=o.observable(!1),this.name=o.observable(""),this.name.focused=o.observable(!1),this.replyTo=o.observable("").validateSimpleEmail(),this.replyTo.focused=o.observable(!1),this.bcc=o.observable("").validateSimpleEmail(),this.bcc.focused=o.observable(!1),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.addOrEditIdentityCommand=r.createCommand(this,function(){return this.email.hasError()||this.email.hasError(""===r.trim(this.email())),this.email.hasError()?(this.owner()||this.email.focused(!0),!1):this.replyTo.hasError()?(this.replyTo.focused(!0),!1):this.bcc.hasError()?(this.bcc.focused(!0),!1):(this.submitRequest(!0),l.identityUpdate(s.bind(function(e,t){this.submitRequest(!1),n.StorageResultType.Success===e&&t?t.Result?(i(6).accountsAndIdentities(),this.cancelCommand()):t.ErrorCode&&this.submitError(a.getNotification(t.ErrorCode)):this.submitError(a.getNotification(n.Notification.UnknownError))},this),this.id,this.email(),this.name(),this.replyTo(),this.bcc()),!0)},function(){return!this.submitRequest()}),u.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(14),c=i(22),u=i(5),d=i(11);u.extendAsViewModel(["View/Popup/Identity","PopupsIdentityViewModel"],t),s.extend(t.prototype,d.prototype),t.prototype.clearPopup=function(){this.id="",this.edit(!1),this.owner(!1),this.name(""),this.email(""),this.replyTo(""),this.bcc(""),this.email.hasError(!1),this.replyTo.hasError(!1),this.bcc.hasError(!1),this.submitRequest(!1),this.submitError("")},t.prototype.onShow=function(e){this.clearPopup(),e&&(this.edit(!0),this.id=e.id,this.name(e.name()),this.email(e.email()),this.replyTo(e.replyTo()),this.bcc(e.bcc()),this.owner(this.id===c.email()))},t.prototype.onFocus=function(){this.owner()||this.email.focused(!0)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){a.call(this,"Popups","PopupsKeyboardShortcutsHelp"),this.sDefaultKeyScope=n.KeyState.PopupKeyboardShortcutsHelp,r.constructorEnd(this)}var s=i(2),o=i(21),n=i(4),r=i(5),a=i(11);r.extendAsViewModel(["View/Popup/KeyboardShortcutsHelp","PopupsKeyboardShortcutsHelpViewModel"],t),s.extend(t.prototype,a.prototype),t.prototype.onBuild=function(e){o("tab, shift+tab, left, right",n.KeyState.PopupKeyboardShortcutsHelp,s.throttle(s.bind(function(t,i){if(t&&i){var s=e.find(".nav.nav-tabs > li"),o=i&&("tab"===i.shortcut||"right"===i.shortcut),n=s.index(s.filter(".active"));return!o&&n>0?n--:o&&n<s.length-1?n++:n=o?0:s.length-1,s.eq(n).find('a[data-toggle="tab"]').tab("show"),!1}},this),100))},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){h.call(this,"Right","SystemDropDown"),this.accountEmail=c.email,this.accounts=c.accounts,this.accountsUnreadCount=c.accountsUnreadCount,this.accountMenuDropdownTrigger=o.observable(!1),this.capaAdditionalAccounts=o.observable(u.capa(r.Capa.AdditionalAccounts)),this.accountClick=s.bind(this.accountClick,this)}var s=i(2),o=i(3),n=i(21),r=i(4),a=i(1),l=i(12),c=i(22),u=i(9),d=i(14),h=i(11);s.extend(t.prototype,h.prototype),t.prototype.accountClick=function(e,t){return e&&t&&!a.isUnd(t.which)&&1===t.which&&(c.accounts.loading(!0),s.delay(function(){c.accounts.loading(!1)},1e3)),!0},t.prototype.emailTitle=function(){return c.email()},t.prototype.settingsClick=function(){i(5).setHash(l.settings())},t.prototype.settingsHelp=function(){i(5).showScreenPopup(i(90))},t.prototype.addAccountClick=function(){this.capaAdditionalAccounts()&&i(5).showScreenPopup(i(67))},t.prototype.logoutClick=function(){d.logout(function(){i(6).loginAndLogoutReload(!0,u.settingsGet("ParentEmail")&&0<u.settingsGet("ParentEmail").length)})},t.prototype.onBuild=function(){var e=this;n("`",[r.KeyState.MessageList,r.KeyState.MessageView,r.KeyState.Settings],function(){e.viewModelVisibility()&&e.accountMenuDropdownTrigger(!0)}),n("shift+/",[r.KeyState.MessageList,r.KeyState.MessageView,r.KeyState.Settings],function(){return e.viewModelVisibility()?(i(5).showScreenPopup(i(90)),!1):void 0})},e.exports=t}()},function(e){!function(){"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,r,a,l,c="",u=0;for(e=t._utf8_encode(e);u<e.length;)i=e.charCodeAt(u++),s=e.charCodeAt(u++),o=e.charCodeAt(u++),n=i>>2,r=(3&i)<<4|s>>4,a=(15&s)<<2|o>>6,l=63&o,isNaN(s)?a=l=64:isNaN(o)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(r)+this._keyStr.charAt(a)+this._keyStr.charAt(l);return c},decode:function(e){var i,s,o,n,r,a,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)n=this._keyStr.indexOf(e.charAt(u++)),r=this._keyStr.indexOf(e.charAt(u++)),a=this._keyStr.indexOf(e.charAt(u++)),l=this._keyStr.indexOf(e.charAt(u++)),i=n<<2|r>>4,s=(15&r)<<4|a>>2,o=(3&a)<<6|l,c+=String.fromCharCode(i),64!==a&&(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;i<e.length;)s=e.charCodeAt(i),128>s?(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}()},function(e,t,i){!function(){"use strict";function t(){}var s=i(13),o=i(73),n=i(16),r=i(1);t.supported=function(){return!(!window.navigator||!window.navigator.cookieEnabled)},t.prototype.set=function(e,t){var i=s.cookie(n.Values.ClientSideStorageIndexName),r=!1,a=null;try{a=null===i?null:o.parse(i)}catch(l){}a||(a={}),a[e]=t;try{s.cookie(n.Values.ClientSideStorageIndexName,o.stringify(a),{expires:30}),r=!0}catch(l){}return r},t.prototype.get=function(e){var t=s.cookie(n.Values.ClientSideStorageIndexName),i=null;try{i=null===t?null:o.parse(t),i=i&&!r.isUnd(i[e])?i[e]:null}catch(a){}return i},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){}var s=i(10),o=i(73),n=i(16),r=i(1);t.supported=function(){return!!s.localStorage},t.prototype.set=function(e,t){var i=s.localStorage[n.Values.ClientSideStorageIndexName]||null,r=!1,a=null;try{a=null===i?null:o.parse(i)}catch(l){}a||(a={}),a[e]=t;try{s.localStorage[n.Values.ClientSideStorageIndexName]=o.stringify(a),r=!0}catch(l){}return r},t.prototype.get=function(e){var t=s.localStorage[n.Values.ClientSideStorageIndexName]||null,i=null;try{i=null===t?null:o.parse(t),i=i&&!r.isUnd(i[e])?i[e]:null}catch(a){}return i},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t,i){r.call(this,"AccountModel"),this.email=e,this.count=o.observable(i||0),this.deleteAccess=o.observable(!1),this.canBeDalete=o.observable(n.isUnd(t)?!0:!!t),this.canBeEdit=this.canBeDalete}var s=i(2),o=i(3),n=i(1),r=i(24);s.extend(t.prototype,r.prototype),t.prototype.email="",t.prototype.changeAccountLink=function(){return i(12).change(this.email)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t,i,s,r,l,c){a.call(this,"ComposeAttachmentModel"),this.id=e,this.isInline=n.isUnd(s)?!1:!!s,this.isLinked=n.isUnd(r)?!1:!!r,this.CID=n.isUnd(l)?"":l,this.contentLocation=n.isUnd(c)?"":c,this.fromMessage=!1,this.fileName=o.observable(t),this.size=o.observable(n.isUnd(i)?null:i),this.tempName=o.observable(""),this.progress=o.observable(0),this.error=o.observable(""),this.waiting=o.observable(!0),this.uploading=o.observable(!1),this.enabled=o.observable(!0),this.complete=o.observable(!1),this.progressText=o.computed(function(){var e=this.progress();return 0===e?"":""+(99===e?100:e)+"%"},this),this.progressStyle=o.computed(function(){var e=this.progress();return 0===e?"":"width:"+(99===e?100:e)+"%"},this),this.title=o.computed(function(){var e=this.error();return""!==e?e:this.fileName()},this),this.friendlySize=o.computed(function(){var e=this.size();return null===e?"":n.friendlySize(this.size())},this),this.mimeType=o.computed(function(){return n.mimeContentType(this.fileName())},this),this.regDisposables([this.friendlySize])}var s=i(2),o=i(3),n=i(1),r=i(79),a=i(24);s.extend(t.prototype,a.prototype),t.prototype.id="",t.prototype.isInline=!1,t.prototype.isLinked=!1,t.prototype.CID="",t.prototype.contentLocation="",t.prototype.fromMessage=!1,t.prototype.cancel=n.emptyFunction,t.prototype.initByUploadJson=function(e){var t=!1;return e&&(this.fileName(e.Name),this.size(n.isUnd(e.Size)?0:n.pInt(e.Size)),this.tempName(n.isUnd(e.TempName)?"":e.TempName),this.isInline=!1,t=!0),t},t.prototype.iconClass=function(){return r.staticIconClassHelper(this.mimeType())[0]},t.prototype.iconText=function(){return r.staticIconClassHelper(this.mimeType())[1]},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){l.call(this,"ContactModel"),this.idContact=0,this.display="",this.properties=[],this.readOnly=!1,this.focused=o.observable(!1),this.selected=o.observable(!1),this.checked=o.observable(!1),this.deleted=o.observable(!1)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(12),l=i(24);s.extend(t.prototype,l.prototype),t.prototype.getNameAndEmailHelper=function(){var e="",t="";return r.isNonEmptyArray(this.properties)&&s.each(this.properties,function(i){i&&(n.ContactPropertyType.FirstName===i[0]?e=r.trim(i[1]+" "+e):n.ContactPropertyType.LastName===i[0]?e=r.trim(e+" "+i[1]):""===t&&n.ContactPropertyType.Email===i[0]&&(t=i[1]))},this),""===t?null:[t,e]},t.prototype.parse=function(e){var t=!1;return e&&"Object/Contact"===e["@Object"]&&(this.idContact=r.pInt(e.IdContact),this.display=r.pString(e.Display),this.readOnly=!!e.ReadOnly,r.isNonEmptyArray(e.Properties)&&s.each(e.Properties,function(e){e&&e.Type&&r.isNormal(e.Value)&&r.isNormal(e.TypeStr)&&this.properties.push([r.pInt(e.Type),r.pString(e.Value),r.pString(e.TypeStr)])},this),t=!0),t},t.prototype.srcAttr=function(){return a.emptyContactPic()},t.prototype.generateUid=function(){return""+this.idContact},t.prototype.lineAsCcc=function(){var e=[];return this.deleted()&&e.push("deleted"),this.selected()&&e.push("selected"),this.checked()&&e.push("checked"),this.focused()&&e.push("focused"),e.join(" ")},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t,i,s,c){l.call(this,"ContactPropertyModel"),this.type=o.observable(r.isUnd(e)?n.ContactPropertyType.Unknown:e),this.typeStr=o.observable(r.isUnd(t)?"":t),this.focused=o.observable(r.isUnd(s)?!1:!!s),this.value=o.observable(r.pString(i)),this.placeholder=o.observable(c||""),this.placeholderValue=o.computed(function(){var e=this.placeholder();return e?a.i18n(e):""},this),this.largeValue=o.computed(function(){return n.ContactPropertyType.Note===this.type()},this),this.regDisposables([this.placeholderValue,this.largeValue])}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(24);s.extend(t.prototype,l.prototype),e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){a.call(this,"FilterConditionModel"),this.field=o.observable(n.FilterConditionField.From),this.type=o.observable(n.FilterConditionType.Contains),this.value=o.observable(""),this.value.error=o.observable(!1),this.template=o.computed(function(){var e="";switch(this.type()){default:e="SettingsFiltersConditionDefault"}return e},this),this.regDisposables([this.template])}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(24);s.extend(t.prototype,a.prototype),t.prototype.verify=function(){return""===this.value()?(this.value.error(!0),!1):!0},t.prototype.parse=function(e){return e&&e.Field&&e.Type?(this.field(r.pString(e.Field)),this.type(r.pString(e.Type)),this.value(r.pString(e.Value)),!0):!1},t.prototype.toJson=function(){return{Field:this.field(),Type:this.type(),Value:this.value()}},t.prototype.cloneSelf=function(){var e=new t;return e.field(this.field()),e.type(this.type()),e.value(this.value()),e},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,"FolderModel"),this.name=o.observable(""),this.fullName="",this.fullNameRaw="",this.fullNameHash="",this.delimiter="",this.namespace="",this.deep=0,this.interval=0,this.selectable=!1,this.existen=!0,this.type=o.observable(n.FolderType.User),this.focused=o.observable(!1),this.selected=o.observable(!1),this.edited=o.observable(!1),this.collapsed=o.observable(!0),this.subScribed=o.observable(!0),this.subFolders=o.observableArray([]),this.deleteAccess=o.observable(!1),this.actionBlink=o.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=o.observable(""),this.privateMessageCountAll=o.observable(0),this.privateMessageCountUnread=o.observable(0),this.collapsedPrivate=o.observable(!0)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(28),l=i(7),c=i(19),u=i(24);s.extend(t.prototype,u.prototype),t.newInstanceFromJson=function(e){var i=new t;return i.initByJson(e)?i.initComputed():null},t.prototype.initComputed=function(){var e=c.getFolderInboxName();return this.hasSubScribedSubfolders=o.computed(function(){return!!s.find(this.subFolders(),function(e){return e.subScribed()&&!e.isSystemFolder()})},this),this.canBeEdited=o.computed(function(){return n.FolderType.User===this.type()&&this.existen&&this.selectable},this),this.visible=o.computed(function(){var e=this.subScribed(),t=this.hasSubScribedSubfolders();return e||t&&(!this.existen||!this.selectable)},this),this.isSystemFolder=o.computed(function(){return n.FolderType.User!==this.type()},this),this.hidden=o.computed(function(){var e=this.isSystemFolder(),t=this.hasSubScribedSubfolders();return e&&!t||!this.selectable&&!t},this),this.selectableForFolderList=o.computed(function(){return!this.isSystemFolder()&&this.selectable},this),this.messageCountAll=o.computed({read:this.privateMessageCountAll,write:function(e){r.isPosNumeric(e,!0)?this.privateMessageCountAll(e):this.privateMessageCountAll.valueHasMutated()},owner:this}).extend({notify:"always"}),this.messageCountUnread=o.computed({read:this.privateMessageCountUnread,write:function(e){r.isPosNumeric(e,!0)?this.privateMessageCountUnread(e):this.privateMessageCountUnread.valueHasMutated()},owner:this}).extend({notify:"always"}),this.printableUnreadCount=o.computed(function(){var e=this.messageCountAll(),t=this.messageCountUnread(),i=this.type();if(e>0){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 t=this.isSystemFolder();return!t&&0===this.subFolders().length&&e!==this.fullNameRaw},this),this.canBeSubScribed=o.computed(function(){return!this.isSystemFolder()&&this.selectable&&e!==this.fullNameRaw},this),this.localName=o.computed(function(){l.trigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case n.FolderType.Inbox:t=l.i18n("FOLDER_LIST/INBOX_NAME");break;case n.FolderType.SentItems:t=l.i18n("FOLDER_LIST/SENT_NAME");break;case n.FolderType.Draft:t=l.i18n("FOLDER_LIST/DRAFTS_NAME");break;case n.FolderType.Spam:t=l.i18n("FOLDER_LIST/SPAM_NAME");break;case n.FolderType.Trash:t=l.i18n("FOLDER_LIST/TRASH_NAME");break;case n.FolderType.Archive:t=l.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=o.computed(function(){l.trigger();var e="",t=this.type(),i=this.name();if(this.isSystemFolder())switch(t){case n.FolderType.Inbox:e="("+l.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case n.FolderType.SentItems:e="("+l.i18n("FOLDER_LIST/SENT_NAME")+")";break;case n.FolderType.Draft:e="("+l.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case n.FolderType.Spam:e="("+l.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case n.FolderType.Trash:e="("+l.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case n.FolderType.Archive:e="("+l.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<this.messageCountUnread()},this),this.hasSubScribedUnreadMessagesSubfolders=o.computed(function(){return!!s.find(this.subFolders(),function(e){return e.hasUnreadMessages()||e.hasSubScribedUnreadMessagesSubfolders()})},this),this.name.subscribe(function(e){this.nameForEdit(e)},this),this.edited.subscribe(function(e){e&&this.nameForEdit(this.name())},this),this.messageCountUnread.subscribe(function(e){n.FolderType.Inbox===this.type()&&a.pub("mailbox.inbox-unread-count",[e])},this),this},t.prototype.fullName="",t.prototype.fullNameRaw="",t.prototype.fullNameHash="",t.prototype.delimiter="",t.prototype.namespace="",t.prototype.deep=0,t.prototype.interval=0,t.prototype.collapsedCss=function(){return this.hasSubScribedSubfolders()?this.collapsed()?"icon-right-mini e-collapsed-sign":"icon-down-mini e-collapsed-sign":"icon-none e-collapsed-sign"},t.prototype.initByJson=function(e){var t=!1,i=c.getFolderInboxName();return e&&"Object/Folder"===e["@Object"]&&(this.name(e.Name),this.delimiter=e.Delimiter,this.fullName=e.FullName,this.fullNameRaw=e.FullNameRaw,this.fullNameHash=e.FullNameHash,this.deep=e.FullNameRaw.split(this.delimiter).length-1,this.selectable=!!e.IsSelectable,this.existen=!!e.IsExists,this.subScribed(!!e.IsSubscribed),this.type(i===this.fullNameRaw?n.FolderType.Inbox:n.FolderType.User),t=!0),t},t.prototype.printableFullName=function(){return this.fullName.split(this.delimiter).join(" / ")},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t,i){r.call(this,"IdentityModel"),this.id=e,this.email=o.observable(t),this.name=o.observable(""),this.replyTo=o.observable(""),this.bcc=o.observable(""),this.deleteAccess=o.observable(!1),this.canBeDalete=o.observable(i)}var s=i(2),o=i(3),n=i(1),r=i(24);s.extend(t.prototype,r.prototype),t.prototype.formattedName=function(){var e=this.name();return""===e?this.email():e+" <"+this.email()+">"},t.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},t.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+n.quoteName(e)+'" <'+this.email()+">"},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t,i,s,r,a,l){n.call(this,"OpenPgpKeyModel"),this.index=e,this.id=i,this.guid=t,this.user=s,this.email=r,this.armor=l,this.isPrivate=!!a,this.deleteAccess=o.observable(!1)}var s=i(2),o=i(3),n=i(24);s.extend(t.prototype,n.prototype),t.prototype.index=0,t.prototype.id="",t.prototype.guid="",t.prototype.user="",t.prototype.email="",t.prototype.armor="",t.prototype.isPrivate=!1,e.exports=t}()},,,function(e,t,i){!function(){"use strict";function t(){o.call(this,"about",[i(143)])}var s=i(2),o=i(34);s.extend(t.prototype,o.prototype),t.prototype.onShow=function(){i(6).setTitle("RainLoop")},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){o.call(this,"login",[i(144)])}var s=i(2),o=i(34);s.extend(t.prototype,o.prototype),t.prototype.onShow=function(){i(6).setTitle("")},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){p.call(this,"mailbox",[i(148),i(145),i(146),i(147)]),this.oLastRoute={}}var s=i(2),o=i(4),n=i(8),r=i(1),a=i(28),l=i(7),c=i(22),u=i(26),d=i(15),h=i(19),p=i(34);s.extend(t.prototype,p.prototype),t.prototype.oLastRoute={},t.prototype.setNewTitle=function(){var e=c.email(),t=d.foldersInboxUnreadCount();i(6).setTitle((""===e?"":(t>0?"("+t+") ":" ")+e+" - ")+l.i18n("TITLES/MAILBOX"))},t.prototype.onShow=function(){this.setNewTitle(),n.keyScope(o.KeyState.MessageList)},t.prototype.onRoute=function(e,t,s,n){if(r.isUnd(n)?1:!n){var a=h.getFolderFullNameRaw(e),l=h.getFolderFromCacheList(a);l&&(d.currentFolder(l).messageListPage(t).messageListSearch(s),o.Layout.NoPreview===u.layout()&&d.message()&&d.message(null),i(6).reloadMessageList())}else o.Layout.NoPreview!==u.layout()||d.message()||i(6).historyBack()},t.prototype.onStart=function(){d.folderList.subscribe(r.windowResizeCallback),d.messageList.subscribe(r.windowResizeCallback),d.message.subscribe(r.windowResizeCallback),s.delay(function(){u.layout.valueHasMutated()},50),a.sub("mailbox.inbox-unread-count",function(e){d.foldersInboxUnreadCount(e);var t=c.email();s.each(c.accounts(),function(i){i&&t===i.email&&i.count(e)})}),d.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},t.prototype.onBuild=function(){n.bMobileDevice||s.defer(function(){i(6).initHorizontalLayoutResizer(o.ClientSideKeyName.MessageListSize)
})},t.prototype.routes=function(){var e=h.getFolderInboxName(),t=function(){return[e,1,"",!0]},i=function(t,i){return i[0]=r.pString(i[0]),i[1]=r.pInt(i[1]),i[1]=0>=i[1]?1:i[1],i[2]=r.pString(i[2]),""===t&&(i[0]=e,i[1]=1),[decodeURI(i[0]),i[1],decodeURI(i[2]),!1]},s=function(t,i){return i[0]=r.pString(i[0]),i[1]=r.pString(i[1]),""===t&&(i[0]=e),[decodeURI(i[0]),1,decodeURI(i[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:i}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:i}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:s}],[/^message-preview$/,{normalize_:t}],[/^([^\/]*)$/,{normalize_:i}]]},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,[i(151),i(149),i(150)]),r.initOnStartOrLangChange(function(){this.sSettingsTitle=r.i18n("TITLES/SETTINGS")},this,function(){this.setSettingsTitle()})}var s=i(2),o=i(4),n=i(8),r=i(7),a=i(30),l=i(9),c=i(5),u=i(58);s.extend(t.prototype,u.prototype),t.prototype.setupSettings=function(e){c.addSettingsViewModel(i(125),"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),a.contactsIsAllowed()&&c.addSettingsViewModel(i(122),"SettingsContacts","SETTINGS_LABELS/LABEL_CONTACTS_NAME","contacts"),l.capa(o.Capa.AdditionalAccounts)&&c.addSettingsViewModel(i(120),"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),l.capa(o.Capa.AdditionalIdentities)?c.addSettingsViewModel(i(126),"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"):c.addSettingsViewModel(i(127),"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),l.capa(o.Capa.Sieve)&&c.addSettingsViewModel(i(123),"SettingsFilters","SETTINGS_LABELS/LABEL_FILTERS_NAME","filters"),l.capa(o.Capa.TwoFactor)&&c.addSettingsViewModel(i(129),"SettingsSecurity","SETTINGS_LABELS/LABEL_SECURITY_NAME","security"),(l.settingsGet("AllowGoogleSocial")&&l.settingsGet("AllowGoogleSocialAuth")||l.settingsGet("AllowFacebookSocial")||l.settingsGet("AllowTwitterSocial"))&&c.addSettingsViewModel(i(130),"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),l.settingsGet("ChangePasswordIsAllowed")&&c.addSettingsViewModel(i(121),"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),c.addSettingsViewModel(i(124),"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),l.capa(o.Capa.Themes)&&c.addSettingsViewModel(i(131),"SettingsThemes","SETTINGS_LABELS/LABEL_THEMES_NAME","themes"),l.capa(o.Capa.OpenPGP)&&c.addSettingsViewModel(i(128),"SettingsOpenPGP","SETTINGS_LABELS/LABEL_OPEN_PGP_NAME","openpgp"),e&&e()},t.prototype.onShow=function(){this.setSettingsTitle(),n.keyScope(o.KeyState.Settings)},t.prototype.setSettingsTitle=function(){i(6).setTitle(this.sSettingsTitle)},e.exports=t}()},,,,,,,,,,,,function(e,t,i){!function(){"use strict";function t(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accounts.loading()?a.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=i(10),o=i(2),n=i(3),r=i(4),a=i(7),l=i(12),c=i(22),u=i(14);t.prototype.scrollableOptions=function(){return{handle:".drag-handle"}},t.prototype.addNewAccount=function(){i(5).showScreenPopup(i(67))},t.prototype.editAccount=function(e){e&&e.canBeEdit()&&i(5).showScreenPopup(i(67),[e])},t.prototype.deleteAccount=function(e){if(e&&e.deleteAccess()){this.accountForDeletion(null);var t=i(5),n=function(t){return e===t};e&&(this.accounts.remove(n),u.accountDelete(function(e,n){r.StorageResultType.Success===e&&n&&n.Result&&n.Reload?(t.routeOff(),t.setHash(l.root(),!0),t.routeOff(),o.defer(function(){s.location.reload()})):i(6).accountsAndIdentities()},e.email))}},t.prototype.onBuild=function(e){var t=this;e.on("click",".account-item .e-action",function(){var e=n.dataFor(this);e&&t.editAccount(e)})},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){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=r.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(""),l.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=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(14);t.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},t.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=t}()},function(e,t,i){!function(){"use strict";function t(){this.contactsAutosave=o.contactsAutosave,this.allowContactsSync=r.allowContactsSync,this.enableContactsSync=r.enableContactsSync,this.contactsSyncUrl=r.contactsSyncUrl,this.contactsSyncUser=r.contactsSyncUser,this.contactsSyncPass=r.contactsSyncPass,this.saveTrigger=s.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500})}var s=i(3),o=i(30),n=i(14),r=i(15);t.prototype.onBuild=function(){this.contactsAutosave.subscribe(function(e){n.saveSettings(null,{ContactsAutosave:e?"1":"0"})}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){var e=this;this.modules=l.modules,this.filters=l.filters,this.inited=s.observable(!1),this.serverError=s.observable(!1),this.serverErrorDesc=s.observable(""),this.haveChanges=s.observable(!1),this.processText=s.observable(""),this.saveErrorText=s.observable(""),this.visibility=s.observable(!1),this.filters.subscribe(r.windowResizeCallback),this.serverError.subscribe(function(e){e||this.serverErrorDesc("")},this),this.filterRaw=l.raw,this.filterRaw.capa=l.capa,this.filterRaw.active=s.observable(!1),this.filterRaw.allow=s.observable(!1),this.filterRaw.error=s.observable(!1),this.processText=s.computed(function(){return this.filters.loading()?a.i18n("SETTINGS_FILTERS/LOADING_PROCESS"):""},this),this.visibility=s.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.filterForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribeProperty:[this,"deleteAccess"]}),this.saveChanges=r.createCommand(this,function(){if(!this.filters.saving()){if(this.filterRaw.active()&&""===r.trim(this.filterRaw()))return this.filterRaw.error(!0),!1;this.filters.saving(!0),this.saveErrorText(""),c.filtersSave(function(t,i){e.filters.saving(!1),n.StorageResultType.Success===t&&i&&i.Result?(e.haveChanges(!1),e.updateList()):e.saveErrorText(a.getNotification(i&&i.ErrorCode?i.ErrorCode:n.Notification.CantSaveFilters))},this.filters(),this.filterRaw(),this.filterRaw.active())}return!0},function(){return this.haveChanges()}),this.filters.subscribe(function(){this.haveChanges(!0)},this),this.filterRaw.subscribe(function(){this.haveChanges(!0),this.filterRaw.error(!1)},this),this.filterRaw.active.subscribe(function(){this.haveChanges(!0),this.filterRaw.error(!1)},this)}var s=i(3),o=i(2),n=i(4),r=i(1),a=i(7),l=i(83),c=i(14);t.prototype.scrollableOptions=function(){return{handle:".drag-handle"}},t.prototype.updateList=function(){var e=this,t=i(80);this.filters.loading()||(this.filters.loading(!0),c.filtersGet(function(i,s){if(e.filters.loading(!1),e.serverError(!1),n.StorageResultType.Success===i&&s&&s.Result&&r.isArray(s.Result.Filters)){e.inited(!0),e.serverError(!1);var l=o.compact(o.map(s.Result.Filters,function(e){var i=new t;return i&&i.parse(e)?i:null}));e.filters(l),e.modules(s.Result.Modules?s.Result.Modules:{}),e.filterRaw(s.Result.Raw||""),e.filterRaw.capa(r.isArray(s.Result.Capa)?s.Result.Capa.join(" "):""),e.filterRaw.active(!!s.Result.RawIsActive),e.filterRaw.allow(!!s.Result.RawIsAllow)}else e.filters([]),e.modules({}),e.filterRaw(""),e.filterRaw.capa({}),e.serverError(!0),e.serverErrorDesc(a.getNotification(s&&s.ErrorCode?s.ErrorCode:n.Notification.CantGetFilters));e.haveChanges(!1)}))},t.prototype.deleteFilter=function(e){this.filters.remove(e),r.delegateRunOnDestroy(e)},t.prototype.addFilter=function(){var e=this,t=i(80),s=new t;s.generateID(),i(5).showScreenPopup(i(87),[s,function(){e.filters.push(s),e.filterRaw.active(!1)},!1])},t.prototype.editFilter=function(e){var t=this,s=e.cloneSelf();i(5).showScreenPopup(i(87),[s,function(){var i=t.filters(),o=i.indexOf(e);o>-1&&i[o]&&(r.delegateRunOnDestroy(i[o]),i[o]=s,t.filters(i),t.haveChanges(!0))},!0])},t.prototype.onBuild=function(e){var t=this;e.on("click",".filter-item .e-action",function(){var e=s.dataFor(this);e&&t.editFilter(e)})},t.prototype.onShow=function(){this.updateList()},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.folderList=l.folderList,this.processText=s.computed(function(){var e=l.foldersLoading(),t=l.foldersCreating(),i=l.foldersDeleting(),s=l.foldersRenaming();return t?r.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):i?r.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):s?r.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?r.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=i(3),o=i(4),n=i(1),r=i(7),a=i(9),l=i(15),c=i(19),u=i(14),d=i(60);t.prototype.folderEditOnEnter=function(e){var t=e?n.trim(e.nameForEdit()):"";""!==t&&e.name()!==t&&(d.set(o.ClientSideKeyName.FoldersLashHash,""),l.foldersRenaming(!0),u.folderRename(function(e,t){l.foldersRenaming(!1),o.StorageResultType.Success===e&&t&&t.Result||l.folderList.error(t&&t.ErrorCode?r.getNotification(t.ErrorCode):r.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),i(6).folders()},e.fullNameRaw,t),c.removeFolderFromCacheList(e.fullNameRaw),e.name(t)),e.edited(!1)},t.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},t.prototype.onShow=function(){l.folderList.error("")},t.prototype.createFolder=function(){i(5).showScreenPopup(i(88))},t.prototype.systemFolder=function(){i(5).showScreenPopup(i(44))},t.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var t=function(i){return e===i?!0:(i.subFolders.remove(t),!1)};e&&(d.set(o.ClientSideKeyName.FoldersLashHash,""),l.folderList.remove(t),l.foldersDeleting(!0),u.folderDelete(function(e,t){l.foldersDeleting(!1),o.StorageResultType.Success===e&&t&&t.Result||l.folderList.error(t&&t.ErrorCode?r.getNotification(t.ErrorCode):r.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),i(6).folders()},e.fullNameRaw),c.removeFolderFromCacheList(e.fullNameRaw))}else 0<e.privateMessageCountAll()&&l.folderList.error(r.getNotification(o.Notification.CantDeleteNonEmptyFolder))},t.prototype.subscribeFolder=function(e){d.set(o.ClientSideKeyName.FoldersLashHash,""),u.folderSetSubscribe(n.emptyFunction,e.fullNameRaw,!0),e.subScribed(!0)},t.prototype.unSubscribeFolder=function(e){d.set(o.ClientSideKeyName.FoldersLashHash,""),u.folderSetSubscribe(n.emptyFunction,e.fullNameRaw,!1),e.subScribed(!1)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.language=d.language,this.messagesPerPage=h.messagesPerPage,this.messagesPerPageArray=r.Defaults.MessagesPerPageArray,this.editorDefaultType=h.editorDefaultType,this.layout=h.layout,this.usePreviewPane=h.usePreviewPane,this.soundNotificationIsSupported=p.soundNotificationIsSupported,this.enableSoundNotification=p.enableSoundNotification,this.enableDesktopNotification=p.enableDesktopNotification,this.isDesktopNotificationSupported=p.isDesktopNotificationSupported,this.isDesktopNotificationDenied=p.isDesktopNotificationDenied,this.showImages=h.showImages,this.useCheckboxesInList=h.useCheckboxesInList,this.threadsAllowed=u.threadsAllowed,this.useThreads=h.useThreads,this.replySameFolder=h.replySameFolder,this.allowLanguagesOnSettings=u.allowLanguagesOnSettings,this.languageFullName=o.computed(function(){return l.convertLangName(this.language())},this),this.languageTrigger=o.observable(n.SaveSettingsStep.Idle).extend({throttle:100}),this.mppTrigger=o.observable(n.SaveSettingsStep.Idle),this.editorDefaultTypeTrigger=o.observable(n.SaveSettingsStep.Idle),this.layoutTrigger=o.observable(n.SaveSettingsStep.Idle),this.isAnimationSupported=a.bAnimationSupported,this.editorDefaultTypes=o.computed(function(){return c.trigger(),[{id:n.EditorDefaultType.Html,name:c.i18n("SETTINGS_GENERAL/LABEL_EDITOR_HTML")},{id:n.EditorDefaultType.Plain,name:c.i18n("SETTINGS_GENERAL/LABEL_EDITOR_PLAIN")},{id:n.EditorDefaultType.HtmlForced,name:c.i18n("SETTINGS_GENERAL/LABEL_EDITOR_HTML_FORCED")},{id:n.EditorDefaultType.PlainForced,name:c.i18n("SETTINGS_GENERAL/LABEL_EDITOR_PLAIN_FORCED")}]},this),this.layoutTypes=o.computed(function(){return c.trigger(),[{id:n.Layout.NoPreview,name:c.i18n("SETTINGS_GENERAL/LABEL_LAYOUT_NO_SPLIT")},{id:n.Layout.SidePreview,name:c.i18n("SETTINGS_GENERAL/LABEL_LAYOUT_VERTICAL_SPLIT")},{id:n.Layout.BottomPreview,name:c.i18n("SETTINGS_GENERAL/LABEL_LAYOUT_HORIZONTAL_SPLIT")}]},this)}var s=i(2),o=i(3),n=i(4),r=i(16),a=i(8),l=i(1),c=i(7),u=i(30),d=i(31),h=i(26),p=i(66),m=i(15),f=i(14);t.prototype.testSoundNotification=function(){p.playSoundNotification(!0)},t.prototype.onBuild=function(){var e=this;s.delay(function(){var t=l.settingsSaveHelperSimpleFunction(e.editorDefaultTypeTrigger,e),i=l.settingsSaveHelperSimpleFunction(e.mppTrigger,e),o=l.settingsSaveHelperSimpleFunction(e.layoutTrigger,e),r=function(t){return function(){e.languageTrigger(t),s.delay(function(){e.languageTrigger(n.SaveSettingsStep.Idle)},1e3)}};e.language.subscribe(function(t){e.languageTrigger(n.SaveSettingsStep.Animate),c.reload(t,r(n.SaveSettingsStep.TrueResult),r(n.SaveSettingsStep.FalseResult)),f.saveSettings(null,{Language:t})}),e.editorDefaultType.subscribe(function(e){f.saveSettings(t,{EditorDefaultType:e})}),e.messagesPerPage.subscribe(function(e){f.saveSettings(i,{MPP:e})}),e.showImages.subscribe(function(e){f.saveSettings(null,{ShowImages:e?"1":"0"})}),e.enableDesktopNotification.subscribe(function(e){l.timeOutAction("SaveDesktopNotifications",function(){f.saveSettings(null,{DesktopNotifications:e?"1":"0"})},3e3)}),e.enableSoundNotification.subscribe(function(e){l.timeOutAction("SaveSoundNotification",function(){f.saveSettings(null,{SoundNotification:e?"1":"0"})},3e3)}),e.replySameFolder.subscribe(function(e){l.timeOutAction("SaveReplySameFolder",function(){f.saveSettings(null,{ReplySameFolder:e?"1":"0"})},3e3)}),e.useThreads.subscribe(function(e){m.messageList([]),f.saveSettings(null,{UseThreads:e?"1":"0"})}),e.layout.subscribe(function(e){m.messageList([]),f.saveSettings(o,{Layout:e})}),e.useCheckboxesInList.subscribe(function(e){f.saveSettings(null,{UseCheckboxesInList:e?"1":"0"})})},50)},t.prototype.onShow=function(){this.enableDesktopNotification.valueHasMutated()},t.prototype.selectLanguage=function(){i(5).showScreenPopup(i(45))},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.editor=null,this.defautOptionsAfterRender=r.defautOptionsAfterRender,this.accountEmail=c.email,this.displayName=c.displayName,this.signature=c.signature,this.replyTo=c.replyTo,this.signatureDom=o.observable(null),this.defaultIdentityIDTrigger=o.observable(n.SaveSettingsStep.Idle),this.displayNameTrigger=o.observable(n.SaveSettingsStep.Idle),this.replyTrigger=o.observable(n.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(n.SaveSettingsStep.Idle),this.identities=u.identities,this.defaultIdentityID=u.defaultIdentityID,this.identitiesOptions=o.computed(function(){var e=u.identities(),t=[];return 0<e.length&&(t.push({id:c.email.peek(),name:this.formattedAccountIdentity(),seporator:!1}),t.push({id:"---",name:"---",seporator:!0,disabled:!0}),s.each(e,function(e){t.push({id:e.id,name:e.formattedNameForEmail(),seporator:!1})})),t},this),this.processText=o.computed(function(){return u.identities.loading()?l.i18n("SETTINGS_IDENTITIES/LOADING_PROCESS"):""},this),this.visibility=o.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.identityForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(47),l=i(7),c=i(22),u=i(43),d=i(14);t.prototype.formattedAccountIdentity=function(){var e=c.displayName.peek(),t=c.email.peek();return""===e?t:'"'+r.quoteName(e)+'" <'+t+">"},t.prototype.addNewIdentity=function(){i(5).showScreenPopup(i(89))},t.prototype.editIdentity=function(e){i(5).showScreenPopup(i(89),[e])},t.prototype.deleteIdentity=function(e){e&&e.deleteAccess()&&(this.identityForDeletion(null),e&&(u.identities.remove(function(t){return e===t}),d.identityDelete(function(){i(6).accountsAndIdentities()},e.id)))},t.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=c.signature();this.editor=new a(e.signatureDom(),function(){c.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)})}},t.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=r.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),i=r.settingsSaveHelperSimpleFunction(t.replyTrigger,t),s=r.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),o=r.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);u.defaultIdentityID.subscribe(function(e){d.saveSettings(o,{DefaultIdentityID:e})}),c.displayName.subscribe(function(t){d.saveSettings(e,{DisplayName:t})}),c.replyTo.subscribe(function(e){d.saveSettings(i,{ReplyTo:e})}),c.signature.subscribe(function(e){d.saveSettings(s,{Signature:e})})},50)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.editor=null,this.displayName=l.displayName,this.signature=l.signature,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=i(2),o=i(3),n=i(4),r=i(1),a=i(47),l=i(22),c=i(14);t.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new a(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)})}},t.prototype.onBuild=function(){var e=this;s.delay(function(){var t=r.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),i=r.settingsSaveHelperSimpleFunction(e.replyTrigger,e),s=r.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})})},50)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.openpgpkeys=a.openpgpkeys,this.openpgpkeysPublic=a.openpgpkeysPublic,this.openpgpkeysPrivate=a.openpgpkeysPrivate,this.openPgpKeyForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=i(2),o=i(3),n=i(1),r=i(5),a=i(20);t.prototype.addOpenPgpKey=function(){r.showScreenPopup(i(135))},t.prototype.generateOpenPgpKey=function(){r.showScreenPopup(i(139))},t.prototype.viewOpenPgpKey=function(e){e&&r.showScreenPopup(i(142),[e])},t.prototype.deleteOpenPgpKey=function(e){if(e&&e.deleteAccess()&&(this.openPgpKeyForDeletion(null),e&&a.openpgpKeyring)){var t=s.find(a.openpgpkeys(),function(t){return e===t});t&&(a.openpgpkeys.remove(t),n.delegateRunOnDestroy(t),a.openpgpKeyring[t.isPrivate?"privateKeys":"publicKeys"].removeForId(t.guid),a.openpgpKeyring.store()),i(6).reloadOpenPgpKeys()}},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.processing=o.observable(!1),this.clearing=o.observable(!1),this.secreting=o.observable(!1),this.viewUser=o.observable(""),this.viewEnable=o.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=o.observable(!1),this.viewSecret=o.observable(""),this.viewBackupCodes=o.observable(""),this.viewUrl=o.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=o.computed(function(){return a.trigger(),a.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=s.bind(this.onResult,this),this.onSecretResult=s.bind(this.onSecretResult,this)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(14);t.prototype.showSecret=function(){this.secreting(!0),l.showTwoFactorSecret(this.onSecretResult)},t.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},t.prototype.createTwoFactor=function(){this.processing(!0),l.createTwoFactor(this.onResult)},t.prototype.testTwoFactor=function(){i(5).showScreenPopup(i(141))},t.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),l.clearTwoFactor(this.onResult)},t.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},t.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(r.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(r.pString(t.Result.Secret)),this.viewBackupCodes(r.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(r.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&&l.enableTwoFactor(function(e,t){n.StorageResultType.Success===e&&t&&t.Result||(i.viewEnable.subs=!1,i.viewEnable(!1),i.viewEnable.subs=!0)},e)},this)}},t.prototype.onSecretResult=function(e,t){this.secreting(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(r.pString(t.Result.Secret)),this.viewUrl(r.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},t.prototype.onBuild=function(){this.processing(!0),l.getTwoFactor(this.onResult)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){var e=i(1),t=i(35);this.googleEnable=t.google.enabled,this.googleEnableAuth=t.google.capa.auth,this.googleEnableDrive=t.google.capa.drive,this.googleEnablePreview=t.google.capa.preview,this.googleActions=t.google.loading,this.googleLoggined=t.google.loggined,this.googleUserName=t.google.userName,this.facebookEnable=t.facebook.enabled,this.facebookActions=t.facebook.loading,this.facebookLoggined=t.facebook.loggined,this.facebookUserName=t.facebook.userName,this.twitterEnable=t.twitter.enabled,this.twitterActions=t.twitter.loading,this.twitterLoggined=t.twitter.loggined,this.twitterUserName=t.twitter.userName,this.connectGoogle=e.createCommand(this,function(){this.googleLoggined()||i(6).googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=e.createCommand(this,function(){i(6).googleDisconnect()}),this.connectFacebook=e.createCommand(this,function(){this.facebookLoggined()||i(6).facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=e.createCommand(this,function(){i(6).facebookDisconnect()}),this.connectTwitter=e.createCommand(this,function(){this.twitterLoggined()||i(6).twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=e.createCommand(this,function(){i(6).twitterDisconnect()})}e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.theme=u.theme,this.themes=u.themes,this.themesObjects=o.observableArray([]),this.background={},this.background.name=u.themeBackgroundName,this.background.hash=u.themeBackgroundHash,this.background.uploaderButton=o.observable(null),this.background.loading=o.observable(!1),this.background.error=o.observable(""),this.capaUserBackground=o.observable(d.capa(r.Capa.UserBackground)),this.themeTrigger=o.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.iTimer=0,this.oThemeAjaxRequest=null,this.theme.subscribe(function(e){s.each(this.themesObjects(),function(t){t.selected(e===t.name)}),a.changeTheme(e,this.background.hash(),this.themeTrigger,l),h.saveSettings(null,{Theme:e})},this),this.background.hash.subscribe(function(e){a.changeTheme(this.theme(),e,this.themeTrigger,l)},this)}var s=i(2),o=i(3),n=i(74),r=i(4),a=i(1),l=i(12),c=i(7),u=i(39),d=i(9),h=i(14);t.prototype.onBuild=function(){var e=this.theme();this.themesObjects(s.map(this.themes(),function(t){return{name:t,nameDisplay:a.convertThemeName(t),selected:o.observable(t===e),themePreviewSrc:l.themePreviewLink(t)}})),this.initUploader()},t.prototype.onShow=function(){this.background.error("")},t.prototype.clearBackground=function(){if(this.capaUserBackground()){var e=this;h.clearUserBackground(function(){e.background.name(""),e.background.hash("")})}},t.prototype.initUploader=function(){if(this.background.uploaderButton()&&this.capaUserBackground()){var e=new n({action:l.uploadBackground(),name:"uploader",queueSize:1,multipleSizeLimit:1,disableDragAndDrop:!0,disableMultiple:!0,clickElement:this.background.uploaderButton()});e.on("onStart",s.bind(function(){return this.background.loading(!0),this.background.error(""),!0},this)).on("onComplete",s.bind(function(e,t,i){if(this.background.loading(!1),t&&e&&i&&i.Result&&i.Result.Name&&i.Result.Hash)this.background.name(i.Result.Name),this.background.hash(i.Result.Hash);else{this.background.name(""),this.background.hash("");var s="";if(i.ErrorCode)switch(i.ErrorCode){case r.UploadErrorCode.FileIsTooBig:s=c.i18n("SETTINGS_THEMES/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FileType:s=c.i18n("SETTINGS_THEMES/ERROR_FILE_TYPE_ERROR")}!s&&i.ErrorMessage&&(s=i.ErrorMessage),this.background.error(s||c.i18n("SETTINGS_THEMES/ERROR_UNKNOWN"))}return!0},this))}},e.exports=t}()},,,,function(e,t,i){!function(){"use strict";function t(){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,t=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,a=r.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),!a||this.key.error())return!1;for(;;){if(t=o.exec(s),!t||0>e)break;t[0]&&t[1]&&t[2]&&t[1]===t[2]&&("PRIVATE"===t[1]?a.privateKeys.importKey(t[0]):"PUBLIC"===t[1]&&a.publicKeys.importKey(t[0])),e--}return a.store(),i(6).reloadOpenPgpKeys(),n.delegateRun(this,"cancelCommand"),!0}),a.constructorEnd(this)}var s=i(2),o=i(3),n=i(1),r=i(20),a=i(5),l=i(11);a.extendAsViewModel(["View/Popup/AddOpenPgpKey","PopupsAddOpenPgpKeyViewModel"],t),s.extend(t.prototype,l.prototype),t.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},t.prototype.onShow=function(){this.clearPopup()},t.prototype.onFocus=function(){this.key.focus(!0)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){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=r.createCommand(this,function(){var e=this.buildSearchString();""!==e&&a.mainMessageListSearch(e),this.cancelCommand()}),l.constructorEnd(this)}var s=i(2),o=i(3),n=i(36),r=i(1),a=i(15),l=i(5),c=i(11);l.extendAsViewModel(["View/Popup/AdvancedSearch","PopupsAdvancedSearchViewModel"],t),s.extend(t.prototype,c.prototype),t.prototype.buildSearchStringValue=function(e){return-1<e.indexOf(" ")&&(e='"'+e+'"'),e},t.prototype.buildSearchString=function(){var e=[],t=r.trim(this.from()),i=r.trim(this.to()),s=r.trim(this.subject()),o=r.trim(this.text()),a=[],l=[];return t&&""!==t&&e.push("from:"+this.buildSearchStringValue(t)),i&&""!==i&&e.push("to:"+this.buildSearchStringValue(i)),s&&""!==s&&e.push("subject:"+this.buildSearchStringValue(s)),this.hasAttachment()&&l.push("attachment"),this.unseen()&&a.push("unseen"),this.starred()&&a.push("flagged"),0<l.length&&e.push("has:"+l.join(",")),0<a.length&&e.push("is:"+a.join(",")),-1<this.selectedDateValue()&&e.push("date:"+n().subtract("days",this.selectedDateValue()).format("YYYY.MM.DD")+"/"),o&&""!==o&&e.push("text:"+this.buildSearchStringValue(o)),r.trim(e.join(" "))},t.prototype.clearPopup=function(){this.from(""),this.to(""),this.subject(""),this.text(""),this.selectedDateValue(-1),this.hasAttachment(!1),this.starred(!1),this.unseen(!1),this.fromFocus(!0)},t.prototype.onShow=function(){this.clearPopup()},t.prototype.onFocus=function(){this.fromFocus(!0)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){p.call(this,"Popups","PopupsComposeOpenPgp"),this.notification=o.observable(""),this.sign=o.observable(!0),this.encrypt=o.observable(!0),this.password=o.observable(""),this.password.focus=o.observable(!1),this.buttonFocus=o.observable(!1),this.from=o.observable(""),this.to=o.observableArray([]),this.text=o.observable(""),this.resultCallback=null,this.submitRequest=o.observable(!1),this.doCommand=r.createCommand(this,function(){var e=this,t=!0,i=null,o=[];
this.submitRequest(!0),t&&this.sign()&&""===this.from()&&(this.notification(l.i18n("PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL")),t=!1),t&&this.sign()&&(i=c.findPrivateKeyByEmail(this.from(),this.password()),i||(this.notification(l.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR",{EMAIL:this.from()})),t=!1)),t&&this.encrypt()&&0===this.to().length&&(this.notification(l.i18n("PGP_NOTIFICATIONS/SPECIFY_AT_LEAST_ONE_RECIPIENT")),t=!1),t&&this.encrypt()&&(o=[],s.each(this.to(),function(i){var s=c.findPublicKeysByEmail(i);0===s.length&&t&&(e.notification(l.i18n("PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR",{EMAIL:i})),t=!1),o=o.concat(s)}),!t||0!==o.length&&this.to().length===o.length||(t=!1)),s.delay(function(){if(e.resultCallback&&t)try{i&&0===o.length?e.resultCallback(u.openpgp.signClearMessage([i],e.text())):i&&0<o.length?e.resultCallback(u.openpgp.signAndEncryptMessage(o,i,e.text())):!i&&0<o.length&&e.resultCallback(u.openpgp.encryptMessage(o,e.text()))}catch(s){e.notification(l.i18n("PGP_NOTIFICATIONS/PGP_ERROR",{ERROR:""+s})),t=!1}t&&e.cancelCommand(),e.submitRequest(!1)},10)},function(){return!this.submitRequest()&&(this.sign()||this.encrypt())}),this.sDefaultKeyScope=a.KeyState.PopupComposeOpenPGP,h.constructorEnd(this)}var s=i(2),o=i(3),n=i(21),r=i(1),a=i(4),l=i(7),c=i(15),u=i(20),d=i(25),h=i(5),p=i(11);h.extendAsViewModel(["View/Popup/ComposeOpenPgp","PopupsComposeOpenPgpViewModel"],t),s.extend(t.prototype,p.prototype),t.prototype.clearPopup=function(){this.notification(""),this.password(""),this.password.focus(!1),this.buttonFocus(!1),this.from(""),this.to([]),this.text(""),this.submitRequest(!1),this.resultCallback=null},t.prototype.onBuild=function(){n("tab,shift+tab",a.KeyState.PopupComposeOpenPGP,s.bind(function(){switch(!0){case this.password.focus():this.buttonFocus(!0);break;case this.buttonFocus():this.password.focus(!0)}return!1},this))},t.prototype.onHide=function(){this.clearPopup()},t.prototype.onFocus=function(){this.sign()?this.password.focus(!0):this.buttonFocus(!0)},t.prototype.onShow=function(e,t,i,o,n,a){this.clearPopup();var l=new d,c="",u=[];this.resultCallback=e,l.clear(),l.mailsoParse(i),""!==l.email&&(c=l.email),""!==o&&u.push(o),""!==n&&u.push(n),""!==a&&u.push(a),u=u.join(", ").split(","),u=s.compact(s.map(u,function(e){return l.clear(),l.mailsoParse(r.trim(e)),""===l.email?!1:l.email})),this.from(c),this.to(u),this.text(t)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){h.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=r.createCommand(this,function(){var e=this,t=this.selectedFolder();t&&(l.message(null),l.messageList([]),this.clearingProcess(!0),t.messageCountAll(0),t.messageCountUnread(0),c.setFolderHash(t.fullNameRaw,""),u.folderClear(function(t,s){e.clearingProcess(!1),n.StorageResultType.Success===t&&s&&s.Result?(i(6).reloadMessageList(!0),e.cancelCommand()):e.clearingError(s&&s.ErrorCode?a.getNotification(s.ErrorCode):a.getNotification(n.Notification.MailServerError))},t.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),d.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(7),l=i(15),c=i(19),u=i(14),d=i(5),h=i(11);d.extendAsViewModel(["View/Popup/FolderClear","PopupsFolderClearViewModel"],t),s.extend(t.prototype,h.prototype),t.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},t.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){l.call(this,"Popups","PopupsNewOpenPgpKey"),this.email=o.observable(""),this.email.focus=o.observable(""),this.email.error=o.observable(!1),this.name=o.observable(""),this.password=o.observable(""),this.keyBitLength=o.observable(2048),this.submitRequest=o.observable(!1),this.email.subscribe(function(){this.email.error(!1)},this),this.generateOpenPgpKeyCommand=n.createCommand(this,function(){var e=this,t="",o=null,a=r.openpgpKeyring;return this.email.error(""===n.trim(this.email())),!a||this.email.error()?!1:(t=this.email(),""!==this.name()&&(t=this.name()+" <"+t+">"),this.submitRequest(!0),s.delay(function(){o=r.openpgp.generateKeyPair({userId:t,numBits:n.pInt(e.keyBitLength()),passphrase:n.trim(e.password())}),o&&o.privateKeyArmored&&(a.privateKeys.importKey(o.privateKeyArmored),a.publicKeys.importKey(o.publicKeyArmored),a.store(),i(6).reloadOpenPgpKeys(),n.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),a.constructorEnd(this)}var s=i(2),o=i(3),n=i(1),r=i(20),a=i(5),l=i(11);a.extendAsViewModel(["View/Popup/NewOpenPgpKey","PopupsNewOpenPgpKeyViewModel"],t),s.extend(t.prototype,l.prototype),t.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)},t.prototype.onShow=function(){this.clearPopup()},t.prototype.onFocus=function(){this.email.focus(!0)},e.exports=t}()},,function(e,t,i){!function(){"use strict";function t(){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=r.createCommand(this,function(){this.testing(!0),a.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=i(2),o=i(3),n=i(4),r=i(1),a=i(14),l=i(5),c=i(11);l.extendAsViewModel(["View/Popup/TwoFactorTest","PopupsTwoFactorTestViewModel"],t),s.extend(t.prototype,c.prototype),t.prototype.clearPopup=function(){this.code(""),this.code.focused(!1),this.code.status(null),this.testing(!1)},t.prototype.onShow=function(){this.clearPopup()},t.prototype.onFocus=function(){this.code.focused(!0)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){a.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=o.observable(""),this.keyDom=o.observable(null),r.constructorEnd(this)}var s=i(2),o=i(3),n=i(1),r=i(5),a=i(11);r.extendAsViewModel(["View/Popup/ViewOpenPgpKey","PopupsViewOpenPgpKeyViewModel"],t),s.extend(t.prototype,a.prototype),t.prototype.clearPopup=function(){this.key("")},t.prototype.selectKey=function(){var e=this.keyDom();e&&n.selectElement(e)},t.prototype.onShow=function(e){this.clearPopup(),e&&this.key(e.armor)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){a.call(this,"Center","About"),this.version=o.observable(n.settingsGet("Version")),r.constructorEnd(this)}var s=i(2),o=i(3),n=i(9),r=i(5),a=i(11);r.extendAsViewModel(["View/User/About","View/App/About","AboutViewModel"],t),s.extend(t.prototype,a.prototype),e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){b.call(this,"Center","Login"),this.email=r.observable(""),this.password=r.observable(""),this.signMe=r.observable(!1),this.additionalCode=r.observable(""),this.additionalCode.error=r.observable(!1),this.additionalCode.focused=r.observable(!1),this.additionalCode.visibility=r.observable(!1),this.additionalCodeSignMe=r.observable(!1),this.logoImg=l.trim(m.settingsGet("LoginLogo")),this.logoPowered=!!m.settingsGet("LoginPowered"),this.loginDescription=l.trim(m.settingsGet("LoginDescription")),this.forgotPasswordLinkUrl=m.settingsGet("ForgotPasswordLinkUrl"),this.registrationLinkUrl=m.settingsGet("RegistrationLinkUrl"),this.emailError=r.observable(!1),this.passwordError=r.observable(!1),this.emailFocus=r.observable(!1),this.submitFocus=r.observable(!1),this.email.subscribe(function(){this.emailError(!1),this.additionalCode(""),this.additionalCode.visibility(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.additionalCode.subscribe(function(){this.additionalCode.error(!1)},this),this.additionalCode.visibility.subscribe(function(){this.additionalCode.error(!1)},this),this.submitRequest=r.observable(!1),this.submitError=r.observable(""),this.submitErrorAddidional=r.observable(""),this.submitError.subscribe(function(e){""===e&&this.submitErrorAddidional("")},this),this.allowLanguagesOnLogin=p.allowLanguagesOnLogin,this.langRequest=r.observable(!1),this.language=h.language,this.bSendLanguage=!1,this.languageFullName=r.computed(function(){return l.convertLangName(this.language())},this),this.signMeType=r.observable(a.LoginSignMeType.Unused),this.signMeType.subscribe(function(e){this.signMe(a.LoginSignMeType.DefaultOn===e)},this),this.signMeVisibility=r.computed(function(){return a.LoginSignMeType.Unused!==this.signMeType()},this),this.submitCommand=l.createCommand(this,function(){if(l.triggerAutocompleteInputChange(),this.emailError(""===l.trim(this.email())),this.passwordError(""===l.trim(this.password())),this.additionalCode.visibility()&&this.additionalCode.error(""===l.trim(this.additionalCode())),this.emailError()||this.passwordError()||this.additionalCode.error())return!1;var e=0,t="",s=function(i,s){e=i||0,t=s||""};if(d.runHook("user-login-submit",[s]),e>0)return this.submitError(u.getNotification(e)),!1;if(""!==t)return this.submitError(t),!1;this.submitRequest(!0);var n=this.password(),r=o.bind(function(e){f.login(o.bind(function(e,t){a.StorageResultType.Success===e&&t&&"Login"===t.Action?t.Result?t.TwoFactorAuth?(this.additionalCode(""),this.additionalCode.visibility(!0),this.additionalCode.focused(!0),this.submitRequest(!1)):t.Admin?i(6).redirectToAdminPanel():i(6).loginAndLogoutReload():t.ErrorCode?(this.submitRequest(!1),-1<l.inArray(t.ErrorCode,[a.Notification.InvalidInputArgument])&&(t.ErrorCode=a.Notification.AuthError),this.submitError(u.getNotification(t.ErrorCode)),""===this.submitError()?this.submitError(u.getNotification(a.Notification.UnknownError)):t.ErrorMessageAdditional&&this.submitErrorAddidional(t.ErrorMessageAdditional)):this.submitRequest(!1):(this.submitRequest(!1),this.submitError(u.getNotification(a.Notification.UnknownError)))},this),this.email(),"",e,!!this.signMe(),this.bSendLanguage?this.language():"",this.additionalCode.visibility()?this.additionalCode():"",this.additionalCode.visibility()?!!this.additionalCodeSignMe():!1)},this);return r(m.settingsGet("UseRsaEncryption")&&l.rsaEncode.supported&&m.settingsGet("RsaPublicKey")?l.rsaEncode(n,m.settingsGet("RsaPublicKey")):n),!0},function(){return!this.submitRequest()}),this.facebookLoginEnabled=r.observable(!1),this.facebookCommand=l.createCommand(this,function(){return s.open(c.socialFacebook(),"Facebook","left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes"),!0},function(){return!this.submitRequest()&&this.facebookLoginEnabled()}),this.googleLoginEnabled=r.observable(!1),this.googleCommand=l.createCommand(this,function(){return s.open(c.socialGoogle(),"Google","left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes"),!0},function(){return!this.submitRequest()&&this.googleLoginEnabled()}),this.twitterLoginEnabled=r.observable(!1),this.twitterCommand=l.createCommand(this,function(){return s.open(c.socialTwitter(),"Twitter","left=200,top=100,width=650,height=450,menubar=no,status=no,resizable=yes,scrollbars=yes"),!0},function(){return!this.submitRequest()&&this.twitterLoginEnabled()}),this.socialLoginEnabled=r.computed(function(){var e=this.facebookLoginEnabled(),t=this.googleLoginEnabled(),i=this.twitterLoginEnabled();return e||t||i},this),g.constructorEnd(this)}var s=i(10),o=i(2),n=i(13),r=i(3),a=i(4),l=i(1),c=i(12),u=i(7),d=i(23),h=i(31),p=i(30),m=i(9),f=i(14),g=i(5),b=i(11);g.extendAsViewModel(["View/User/Login","View/App/Login","LoginViewModel"],t),o.extend(t.prototype,b.prototype),t.prototype.onShow=function(){g.routeOff(),o.delay(o.bind(function(){""!==this.email()&&""!==this.password()?this.submitFocus(!0):this.emailFocus(!0),m.settingsGet("UserLanguage")&&n.cookie("rllang",h.language(),{expires:30})},this),100)},t.prototype.onHide=function(){this.submitFocus(!1),this.emailFocus(!1)},t.prototype.onBuild=function(){var e=this,t=m.settingsGet("JsHash"),r=function(t){t=l.pInt(t),0===t?(e.submitRequest(!0),i(6).loginAndLogoutReload()):e.submitError(u.getNotification(t))};switch(this.facebookLoginEnabled(!!m.settingsGet("AllowFacebookSocial")),this.twitterLoginEnabled(!!m.settingsGet("AllowTwitterSocial")),this.googleLoginEnabled(!!m.settingsGet("AllowGoogleSocial")&&!!m.settingsGet("AllowGoogleSocialAuth")),(m.settingsGet("SignMe")||"unused").toLowerCase()){case a.LoginSignMeTypeAsString.DefaultOff:this.signMeType(a.LoginSignMeType.DefaultOff);break;case a.LoginSignMeTypeAsString.DefaultOn:this.signMeType(a.LoginSignMeType.DefaultOn);break;default:case a.LoginSignMeTypeAsString.Unused:this.signMeType(a.LoginSignMeType.Unused)}this.email(p.devEmail),this.password(p.devPassword),this.googleLoginEnabled()&&(s["rl_"+t+"_google_login_service"]=r),this.facebookLoginEnabled()&&(s["rl_"+t+"_facebook_login_service"]=r),this.twitterLoginEnabled()&&(s["rl_"+t+"_twitter_login_service"]=r),o.delay(function(){h.language.subscribe(function(t){e.langRequest(!0),u.reload(t,function(){e.langRequest(!1),e.bSendLanguage=!0,n.cookie("rllang",t,{expires:30})},function(){e.langRequest(!1)})})},50),l.triggerAutocompleteInputChange(!0)},t.prototype.submitForm=function(){this.submitCommand()},t.prototype.selectLanguage=function(){g.showScreenPopup(i(45))},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){b.call(this,"Left","MailFolderList"),this.oContentVisible=null,this.oContentScrollable=null,this.composeInEdit=f.composeInEdit,this.messageList=f.messageList,this.folderList=f.folderList,this.folderListSystem=f.folderListSystem,this.foldersChanging=f.foldersChanging,this.leftPanelDisabled=u.leftPanelDisabled,this.iDropOverTimer=0,this.allowContacts=!!h.contactsIsAllowed(),g.constructorEnd(this)}var s=i(10),o=i(2),n=i(13),r=i(3),a=i(21),l=i(1),c=i(4),u=i(8),d=i(12),h=i(30),p=i(26),m=i(19),f=i(15),g=i(5),b=i(11);g.extendAsViewModel(["View/User/MailBox/FolderList","View/App/MailBox/FolderList","MailBoxFolderListViewModel"],t),o.extend(t.prototype,b.prototype),t.prototype.onBuild=function(e){this.oContentVisible=n(".b-content",e),this.oContentScrollable=n(".content",this.oContentVisible);var t=this;e.on("click",".b-folders .e-item .e-link .e-collapsed-sign",function(e){var t=r.dataFor(this),s=!1;t&&e&&(s=t.collapsed(),i(6).setExpandedFolder(t.fullNameHash,s),t.collapsed(!s),e.preventDefault(),e.stopPropagation())}).on("click",".b-folders .e-item .e-link.selectable",function(e){e.preventDefault();var t=r.dataFor(this);t&&(c.Layout.NoPreview===p.layout()&&f.message(null),t.fullNameRaw===f.currentFolderFullNameRaw()&&m.setFolderHash(t.fullNameRaw,""),g.setHash(d.mailBox(t.fullNameHash)))}),a("up, down",c.KeyState.FolderList,function(i,s){var o=-1,r=s&&"up"===s.shortcut?38:40,a=n(".b-folders .e-item .e-link:not(.hidden):visible",e);return i&&a.length&&(o=a.index(a.filter(".focused")),o>-1&&a.eq(o).removeClass("focused"),38===r&&o>0?o--:40===r&&o<a.length-1&&o++,a.eq(o).addClass("focused"),t.scrollToFocused()),!1}),a("enter",c.KeyState.FolderList,function(){var i=n(".b-folders .e-item .e-link:not(.hidden).focused",e);return i.length&&i[0]&&(t.folderList.focused(!1),i.click()),!1}),a("space",c.KeyState.FolderList,function(){var t=!0,s=null,o=n(".b-folders .e-item .e-link:not(.hidden).focused",e);return o.length&&o[0]&&(s=r.dataFor(o[0]),s&&(t=s.collapsed(),i(6).setExpandedFolder(s.fullNameHash,t),s.collapsed(!t))),!1}),a("esc, tab, shift+tab, right",c.KeyState.FolderList,function(){return t.folderList.focused(!1),!1}),t.folderList.focused.subscribe(function(t){n(".b-folders .e-item .e-link.focused",e).removeClass("focused"),t&&n(".b-folders .e-item .e-link.selected",e).addClass("focused")})},t.prototype.messagesDropOver=function(e){s.clearTimeout(this.iDropOverTimer),e&&e.collapsed()&&(this.iDropOverTimer=s.setTimeout(function(){e.collapsed(!1),i(6).setExpandedFolder(e.fullNameHash,!0),l.windowResize()},500))},t.prototype.messagesDropOut=function(){s.clearTimeout(this.iDropOverTimer)},t.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=n(".e-item .e-link.focused",this.oContentScrollable),i=t.position(),s=this.oContentVisible.height(),o=t.outerHeight();return i&&(i.top<0||i.top+o>s)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-s+o+e),!0):!1},t.prototype.messagesDrop=function(e,t){if(e&&t&&t.helper){var s=t.helper.data("rl-folder"),o=u.$html.hasClass("rl-ctrl-key-pressed"),n=t.helper.data("rl-uids");l.isNormal(s)&&""!==s&&l.isArray(n)&&i(6).moveMessagesToFolder(s,n,e.fullNameRaw,o)}},t.prototype.composeClick=function(){g.showScreenPopup(i(27))},t.prototype.createFolder=function(){g.showScreenPopup(i(88))},t.prototype.configureFolders=function(){g.setHash(d.settings("folders"))},t.prototype.contactsClick=function(){this.allowContacts&&g.showScreenPopup(i(68))},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){A.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!v.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=C.message,this.messageList=C.messageList,this.folderList=C.folderList,this.currentMessage=C.currentMessage,this.isMessageSelected=C.isMessageSelected,this.messageListSearch=C.messageListSearch,this.messageListError=C.messageListError,this.folderMenuForMove=C.folderMenuForMove,this.useCheckboxesInList=y.useCheckboxesInList,this.mainMessageListSearch=C.mainMessageListSearch,this.messageListEndFolder=C.messageListEndFolder,this.messageListChecked=C.messageListChecked,this.messageListCheckedOrSelected=C.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=C.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=C.messageListCompleteLoadingThrottle,g.initOnStartOrLangChange(function(){this.emptySubjectValue=g.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=b.quota,this.userUsageSize=b.usage,this.userUsageProc=b.percentage,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.SidePreview===y.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=C.messageListEndSearch();return""===e?"":g.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(h.computedPagenatorHelper(C.messageListPage,C.messageListPageCount)),this.checkAll=n.computed({read:function(){return 0<C.messageListChecked().length},write:function(e){e=!!e,s.each(C.messageList(),function(t){t.checked(e)})}}),this.inputMessageListSearchFocus=n.observable(!1),this.sLastSearchValue="",this.inputProxyMessageListSearch=n.computed({read:this.mainMessageListSearch,write:function(e){this.sLastSearchValue=e},owner:this}),this.isIncompleteChecked=n.computed(function(){var e=C.messageList().length,t=C.messageListChecked().length;return e>0&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 0<this.messageList().length},this),this.hasCheckedOrSelectedLines=n.computed(function(){return 0<this.messageListCheckedOrSelected().length},this),this.isSpamFolder=n.computed(function(){return S.spamFolder()===this.messageListEndFolder()&&""!==S.spamFolder()},this),this.isSpamDisabled=n.computed(function(){return u.Values.UnuseOptionValue===S.spamFolder()},this),this.isTrashFolder=n.computed(function(){return S.trashFolder()===this.messageListEndFolder()&&""!==S.trashFolder()},this),this.isDraftFolder=n.computed(function(){return S.draftFolder()===this.messageListEndFolder()&&""!==S.draftFolder()},this),this.isSentFolder=n.computed(function(){return S.sentFolder()===this.messageListEndFolder()&&""!==S.sentFolder()},this),this.isArchiveFolder=n.computed(function(){return S.archiveFolder()===this.messageListEndFolder()&&""!==S.archiveFolder()},this),this.isArchiveDisabled=n.computed(function(){return u.Values.UnuseOptionValue===S.archiveFolder()},this),this.canBeMoved=this.hasCheckedOrSelectedLines,this.clearCommand=h.createCommand(this,function(){F.showScreenPopup(i(138),[C.currentFolder()])}),this.multyForwardCommand=h.createCommand(this,function(){F.showScreenPopup(i(27),[c.ComposeType.ForwardAsAttachment,C.messageListCheckedOrSelected()])},this.canBeMoved),this.deleteWithoutMoveCommand=h.createCommand(this,function(){i(6).deleteMessagesFromFolder(c.FolderType.Trash,C.currentFolderFullNameRaw(),C.messageListCheckedOrSelectedUidsWithSubMails(),!1)},this.canBeMoved),this.deleteCommand=h.createCommand(this,function(){i(6).deleteMessagesFromFolder(c.FolderType.Trash,C.currentFolderFullNameRaw(),C.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.archiveCommand=h.createCommand(this,function(){i(6).deleteMessagesFromFolder(c.FolderType.Archive,C.currentFolderFullNameRaw(),C.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.spamCommand=h.createCommand(this,function(){i(6).deleteMessagesFromFolder(c.FolderType.Spam,C.currentFolderFullNameRaw(),C.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.notSpamCommand=h.createCommand(this,function(){i(6).deleteMessagesFromFolder(c.FolderType.NotSpam,C.currentFolderFullNameRaw(),C.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.moveCommand=h.createCommand(this,h.emptyFunction,this.canBeMoved),this.reloadCommand=h.createCommand(this,function(){C.messageListCompleteLoadingThrottle()||i(6).reloadMessageList(!1,!0)}),this.quotaTooltip=s.bind(this.quotaTooltip,this),this.selector=new f(this.messageList,this.currentMessage,".messageListItem .actionHandle",".messageListItem.selected",".messageListItem .checkboxMessage",".messageListItem.focused"),this.selector.on("onItemSelect",s.bind(function(e){e?(C.message(C.staticMessageList.populateByMessageListItem(e)),this.populateMessageBody(C.message()),c.Layout.NoPreview===y.layout()&&(F.setHash(p.messagePreview(),!0),C.message.focused(!0))):C.message(null)},this)),this.selector.on("onItemGetUid",function(e){return e?e.generateUid():""}),C.messageListEndHash.subscribe(function(){this.selector.scrollToTop()},this),y.layout.subscribe(function(e){this.selector.autoSelect(c.Layout.NoPreview!==e)},this),y.layout.valueHasMutated(),m.sub("mailbox.message-list.selector.go-down",function(){this.selector.goDown(!0)},this).sub("mailbox.message-list.selector.go-up",function(){this.selector.goUp(!0)},this),F.constructorEnd(this)}var s=i(2),o=i(13),n=i(3),r=i(21),a=i(74),l=i(156),c=i(4),u=i(16),d=i(8),h=i(1),p=i(12),m=i(28),f=i(78),g=i(7),b=i(84),y=i(26),S=i(32),v=i(9),w=i(19),C=i(15),T=i(14),F=i(5),A=i(11);F.extendAsViewModel(["View/User/MailBox/MessageList","View/App/MailBox/MessageList","MailBoxMessageListViewModel"],t),s.extend(t.prototype,A.prototype),t.prototype.emptySubjectValue="",t.prototype.searchEnterAction=function(){this.mainMessageListSearch(this.sLastSearchValue),this.inputMessageListSearchFocus(!1)},t.prototype.printableMessageCountForDeletion=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>1?" ("+(100>e?e:"99+")+")":""},t.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},t.prototype.moveSelectedMessagesToFolder=function(e,t){return this.canBeMoved()&&i(6).moveMessagesToFolder(C.currentFolderFullNameRaw(),C.messageListCheckedOrSelectedUidsWithSubMails(),e,t),!1},t.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=h.draggablePlace(),i=C.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",C.currentFolderFullNameRaw()),t.data("rl-uids",i),t.find(".text").text(""+i.length),s.defer(function(){var e=C.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},t.prototype.onMessageResponse=function(e,t,i){C.hideMessageBodies(),C.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?C.setMessage(t,i):c.StorageResultType.Unload===e?(C.message(null),C.messageError("")):c.StorageResultType.Abort!==e&&(C.message(null),C.messageError(g.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},t.prototype.populateMessageBody=function(e){e&&(T.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?C.messageLoading(!0):h.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},t.prototype.setAction=function(e,t,o){var n=[],r=null,a=0;if(h.isUnd(o)&&(o=C.messageListChecked()),n=s.map(o,function(e){return e.uid}),""!==e&&0<n.length){switch(t){case c.MessageSetAction.SetSeen:s.each(o,function(e){e.unseen()&&a++,e.unseen(!1),w.storeMessageFlagsToCache(e)}),r=w.getFolderFromCacheList(e),r&&r.messageCountUnread(r.messageCountUnread()-a),T.messageSetSeen(h.emptyFunction,e,n,!0);break;case c.MessageSetAction.UnsetSeen:s.each(o,function(e){e.unseen()&&a++,e.unseen(!0),w.storeMessageFlagsToCache(e)}),r=w.getFolderFromCacheList(e),r&&r.messageCountUnread(r.messageCountUnread()-a+n.length),T.messageSetSeen(h.emptyFunction,e,n,!1);break;case c.MessageSetAction.SetFlag:s.each(o,function(e){e.flagged(!0),w.storeMessageFlagsToCache(e)}),T.messageSetFlagged(h.emptyFunction,e,n,!0);break;case c.MessageSetAction.UnsetFlag:s.each(o,function(e){e.flagged(!1),w.storeMessageFlagsToCache(e)}),T.messageSetFlagged(h.emptyFunction,e,n,!1)}i(6).reloadFlagsCurrentMessageListAndMessageFromCache()}},t.prototype.setActionForAll=function(e,t){var o=null,n=C.messageList();if(""!==e&&(o=w.getFolderFromCacheList(e))){switch(t){case c.MessageSetAction.SetSeen:o=w.getFolderFromCacheList(e),o&&(s.each(n,function(e){e.unseen(!1)}),o.messageCountUnread(0),w.clearMessageFlagsFromCacheByFolder(e)),T.messageSetSeenToAll(h.emptyFunction,e,!0);break;case c.MessageSetAction.UnsetSeen:o=w.getFolderFromCacheList(e),o&&(s.each(n,function(e){e.unseen(!0)}),o.messageCountUnread(o.messageCountAll()),w.clearMessageFlagsFromCacheByFolder(e)),T.messageSetSeenToAll(h.emptyFunction,e,!1)}i(6).reloadFlagsCurrentMessageListAndMessageFromCache()}},t.prototype.listSetSeen=function(){this.setAction(C.currentFolderFullNameRaw(),c.MessageSetAction.SetSeen,C.messageListCheckedOrSelected())},t.prototype.listSetAllSeen=function(){this.setActionForAll(C.currentFolderFullNameRaw(),c.MessageSetAction.SetSeen)},t.prototype.listUnsetSeen=function(){this.setAction(C.currentFolderFullNameRaw(),c.MessageSetAction.UnsetSeen,C.messageListCheckedOrSelected())},t.prototype.listSetFlags=function(){this.setAction(C.currentFolderFullNameRaw(),c.MessageSetAction.SetFlag,C.messageListCheckedOrSelected())},t.prototype.listUnsetFlags=function(){this.setAction(C.currentFolderFullNameRaw(),c.MessageSetAction.UnsetFlag,C.messageListCheckedOrSelected())},t.prototype.flagMessages=function(e){var t=this.messageListCheckedOrSelected(),i=[];e&&(0<t.length&&(i=s.map(t,function(e){return e.uid})),0<i.length&&-1<h.inArray(e.uid,i)?this.setAction(e.folderFullNameRaw,e.flagged()?c.MessageSetAction.UnsetFlag:c.MessageSetAction.SetFlag,t):this.setAction(e.folderFullNameRaw,e.flagged()?c.MessageSetAction.UnsetFlag:c.MessageSetAction.SetFlag,[e]))},t.prototype.flagMessagesFast=function(e){var t=this.messageListCheckedOrSelected(),i=[];0<t.length&&(i=s.filter(t,function(e){return e.flagged()}),h.isUnd(e)?this.setAction(t[0].folderFullNameRaw,t.length===i.length?c.MessageSetAction.UnsetFlag:c.MessageSetAction.SetFlag,t):this.setAction(t[0].folderFullNameRaw,e?c.MessageSetAction.SetFlag:c.MessageSetAction.UnsetFlag,t))},t.prototype.seenMessagesFast=function(e){var t=this.messageListCheckedOrSelected(),i=[];0<t.length&&(i=s.filter(t,function(e){return e.unseen()}),h.isUnd(e)?this.setAction(t[0].folderFullNameRaw,0<i.length?c.MessageSetAction.SetSeen:c.MessageSetAction.UnsetSeen,t):this.setAction(t[0].folderFullNameRaw,e?c.MessageSetAction.SetSeen:c.MessageSetAction.UnsetSeen,t))},t.prototype.onBuild=function(e){var t=this;this.oContentVisible=o(".b-content",e),this.oContentScrollable=o(".content",this.oContentVisible),this.oContentVisible.on("click",".fullThreadHandle",function(){var e=[],t=n.dataFor(this);return t&&!t.lastInCollapsedThreadLoading()&&(C.messageListThreadFolder(t.folderFullNameRaw),e=C.messageListThreadUids(),t.lastInCollapsedThread()?e.push(0<t.parentUid()?t.parentUid():t.uid):e=s.without(e,0<t.parentUid()?t.parentUid():t.uid),C.messageListThreadUids(s.uniq(e)),t.lastInCollapsedThreadLoading(!0),t.lastInCollapsedThread(!t.lastInCollapsedThread()),i(6).reloadMessageList()),!1}),this.selector.init(this.oContentVisible,this.oContentScrollable,c.KeyState.MessageList),e.on("click",".messageList .b-message-list-wrapper",function(){t.message.focused()&&t.message.focused(!1)}).on("click",".e-pagenator .e-page",function(){var e=n.dataFor(this);e&&F.setHash(p.mailBox(C.currentFolderFullNameHash(),e.value,C.messageListSearch()))}).on("click",".messageList .checkboxCkeckAll",function(){t.checkAll(!t.checkAll())}).on("click",".messageList .messageListItem .flagParent",function(){t.flagMessages(n.dataFor(this))}),this.initUploaderForAppend(),this.initShortcuts(),!d.bMobileDevice&&l&&v.capa(c.Capa.Prefetch)&&(l.setIdleDuration(10),l.idle(function(){t.prefetchNextTick()}))},t.prototype.initShortcuts=function(){var e=this;r("ctrl+p, command+p",c.KeyState.MessageList,function(){return!1}),r("z",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.archiveCommand(),!1}),r("delete, shift+delete, shift+3",c.KeyState.MessageList,function(t,i){return t?(0<C.messageListCheckedOrSelected().length&&(i&&"shift+delete"===i.shortcut?e.deleteWithoutMoveCommand():e.deleteCommand()),!1):void 0}),r("ctrl+r, command+r",[c.KeyState.FolderList,c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.reloadCommand(),!1}),r("ctrl+a, command+a",c.KeyState.MessageList,function(){return e.checkAll(!(e.checkAll()&&!e.isIncompleteChecked())),!1}),r("w,c",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return F.showScreenPopup(i(27)),!1}),r("i",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.flagMessagesFast(),!1}),r("m",c.KeyState.MessageList,function(){return e.moveDropdownTrigger(!0),!1}),r("q",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.seenMessagesFast(!0),!1}),r("u",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.seenMessagesFast(!1),!1}),r("shift+f",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.multyForwardCommand(),!1}),r("/",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.inputMessageListSearchFocus(!0),!1}),r("esc",c.KeyState.MessageList,function(){return""!==e.messageListSearchDesc()?(e.cancelSearch(),!1):void 0}),r("tab, shift+tab, left, right",c.KeyState.MessageList,function(t,i){return t&&i&&("shift+tab"===i.shortcut||"left"===i.shortcut)?e.folderList.focused(!0):e.message()&&e.message.focused(!0),!1}),r("ctrl+left, command+left",c.KeyState.MessageView,function(){return!1}),r("ctrl+right, command+right",c.KeyState.MessageView,function(){return!1})},t.prototype.prefetchNextTick=function(){if(l&&!this.bPrefetch&&!l.now()&&this.viewModelVisibility()){var e=this,t=s.find(this.messageList(),function(e){return e&&!w.hasRequestedMessage(e.folderFullNameRaw,e.uid)});t&&(this.bPrefetch=!0,w.addRequestedMessage(t.folderFullNameRaw,t.uid),T.message(function(t,i){var o=!(c.StorageResultType.Success!==t||!i||!i.Result);
s.delay(function(){e.bPrefetch=!1,o&&e.prefetchNextTick()},1e3)},t.folderFullNameRaw,t.uid))}},t.prototype.composeClick=function(){F.showScreenPopup(i(27))},t.prototype.advancedSearchClick=function(){F.showScreenPopup(i(136))},t.prototype.quotaTooltip=function(){return g.i18n("MESSAGE_LIST/QUOTA_SIZE",{SIZE:h.friendlySize(this.userUsageSize()),PROC:this.userUsageProc(),LIMIT:h.friendlySize(this.userQuota())})},t.prototype.initUploaderForAppend=function(){if(!v.settingsGet("AllowAppendMessage")||!this.dragOverArea())return!1;var e=new a({action:p.append(),name:"AppendFile",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,hidden:{Folder:function(){return C.currentFolderFullNameRaw()}},dragAndDropElement:this.dragOverArea(),dragAndDropBodyElement:this.dragOverBodyArea()});return this.dragOver.subscribe(function(e){e&&this.selector.scrollToTop()},this),e.on("onDragEnter",s.bind(function(){this.dragOverEnter(!0)},this)).on("onDragLeave",s.bind(function(){this.dragOverEnter(!1)},this)).on("onBodyDragEnter",s.bind(function(){this.dragOver(!0)},this)).on("onBodyDragLeave",s.bind(function(){this.dragOver(!1)},this)).on("onSelect",s.bind(function(e,t){return e&&t&&"message/rfc822"===t.Type?(C.messageListLoading(!0),!0):!1},this)).on("onComplete",s.bind(function(){i(6).reloadMessageList(!0,!0)},this)),!!e},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){T.call(this,"Right","MailMessageView");var e=this,t="",s=function(t){return h.createCommand(e,function(){this.lastReplyAction(t),this.replyOrforward(t)},e.canBeRepliedOrForwarded)};this.oHeaderDom=null,this.oMessageScrollerDom=null,this.pswp=null,this.message=v.message,this.currentMessage=v.currentMessage,this.messageListChecked=v.messageListChecked,this.hasCheckedMessages=v.hasCheckedMessages,this.messageListCheckedOrSelectedUidsWithSubMails=v.messageListCheckedOrSelectedUidsWithSubMails,this.messageLoading=v.messageLoading,this.messageLoadingThrottle=v.messageLoadingThrottle,this.messagesBodiesDom=v.messagesBodiesDom,this.useThreads=f.useThreads,this.replySameFolder=f.replySameFolder,this.layout=f.layout,this.usePreviewPane=f.usePreviewPane,this.isMessageSelected=v.isMessageSelected,this.messageActiveDom=v.messageActiveDom,this.messageError=v.messageError,this.fullScreenMode=v.messageFullScreenMode,this.lastReplyAction_=n.observable(""),this.lastReplyAction=n.computed({read:this.lastReplyAction_,write:function(e){e=-1===h.inArray(e,[u.ComposeType.Reply,u.ComposeType.ReplyAll,u.ComposeType.Forward])?u.ComposeType.Reply:e,this.lastReplyAction_(e)},owner:this}),this.lastReplyAction(y.get(u.ClientSideKeyName.LastReplyAction)||u.ComposeType.Reply),this.lastReplyAction_.subscribe(function(e){y.set(u.ClientSideKeyName.LastReplyAction,e)}),this.showFullInfo=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.messageDomFocused=n.observable(!1).extend({rateLimit:0}),this.messageVisibility=n.computed(function(){return!this.messageLoadingThrottle()&&!!this.message()},this),this.message.subscribe(function(e){e||this.currentMessage(null)},this),this.canBeRepliedOrForwarded=n.computed(function(){var e=this.messageVisibility();return!this.isDraftFolder()&&e},this),this.closeMessage=h.createCommand(this,function(){v.message(null)}),this.replyCommand=s(u.ComposeType.Reply),this.replyAllCommand=s(u.ComposeType.ReplyAll),this.forwardCommand=s(u.ComposeType.Forward),this.forwardAsAttachmentCommand=s(u.ComposeType.ForwardAsAttachment),this.editAsNewCommand=s(u.ComposeType.EditAsNew),this.messageVisibilityCommand=h.createCommand(this,h.emptyFunction,this.messageVisibility),this.messageEditCommand=h.createCommand(this,function(){this.editMessage()},this.messageVisibility),this.deleteCommand=h.createCommand(this,function(){this.message()&&i(6).deleteMessagesFromFolder(u.FolderType.Trash,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.deleteWithoutMoveCommand=h.createCommand(this,function(){this.message()&&i(6).deleteMessagesFromFolder(u.FolderType.Trash,v.currentFolderFullNameRaw(),[this.message().uid],!1)},this.messageVisibility),this.archiveCommand=h.createCommand(this,function(){this.message()&&i(6).deleteMessagesFromFolder(u.FolderType.Archive,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.spamCommand=h.createCommand(this,function(){this.message()&&i(6).deleteMessagesFromFolder(u.FolderType.Spam,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.notSpamCommand=h.createCommand(this,function(){this.message()&&i(6).deleteMessagesFromFolder(u.FolderType.NotSpam,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.viewBodyTopValue=n.observable(0),this.viewHash="",this.viewSubject=n.observable(""),this.viewFromShort=n.observable(""),this.viewFromDkimData=n.observable(["none",""]),this.viewToShort=n.observable(""),this.viewFrom=n.observable(""),this.viewTo=n.observable(""),this.viewCc=n.observable(""),this.viewBcc=n.observable(""),this.viewDate=n.observable(""),this.viewSize=n.observable(""),this.viewMoment=n.observable(""),this.viewLineAsCcc=n.observable(""),this.viewViewLink=n.observable(""),this.viewDownloadLink=n.observable(""),this.viewUserPic=n.observable(c.DataImages.UserDotPic),this.viewUserPicVisible=n.observable(!1),this.viewIsImportant=n.observable(!1),this.viewPgpPassword=n.observable(""),this.viewPgpSignedVerifyStatus=n.computed(function(){return this.message()?this.message().pgpSignedVerifyStatus():u.SignedVerifyStatus.None},this),this.viewPgpSignedVerifyUser=n.computed(function(){return this.message()?this.message().pgpSignedVerifyUser():""},this),this.viewFromDkimStatusIconClass=n.computed(function(){var e="icon-none iconcolor-display-none";switch(this.viewFromDkimData()[0]){case"none":break;case"pass":e="icon-ok iconcolor-green";break;default:e="icon-warning-alt iconcolor-red"}return e},this),this.viewFromDkimStatusTitle=n.computed(function(){var e=this.viewFromDkimData();if(h.isNonEmptyArray(e)){if(e[0]&&e[1])return e[1];if(e[0])return"DKIM: "+e[0]}return""},this),this.message.subscribe(function(i){this.messageActiveDom(null),this.viewPgpPassword(""),i?(this.viewHash!==i.hash&&this.scrollMessageToTop(),this.viewHash=i.hash,this.viewSubject(i.subject()),this.viewFromShort(i.fromToLine(!0,!0)),this.viewFromDkimData(i.fromDkimData()),this.viewToShort(i.toToLine(!0,!0)),this.viewFrom(i.fromToLine(!1)),this.viewTo(i.toToLine(!1)),this.viewCc(i.ccToLine(!1)),this.viewBcc(i.bccToLine(!1)),this.viewDate(i.fullFormatDateValue()),this.viewSize(i.friendlySize()),this.viewMoment(i.momentDate()),this.viewLineAsCcc(i.lineAsCcc()),this.viewViewLink(i.viewLink()),this.viewDownloadLink(i.downloadLink()),this.viewIsImportant(i.isImportant()),t=i.fromAsSingleEmail(),S.getUserPic(t,function(i,s){i!==e.viewUserPic()&&t===s&&(e.viewUserPicVisible(!1),e.viewUserPic(c.DataImages.UserDotPic),""!==i&&(e.viewUserPicVisible(!0),e.viewUserPic(i)))})):(this.viewHash="",this.scrollMessageToTop())},this),this.fullScreenMode.subscribe(function(e){e?d.$html.addClass("rl-message-fullscreen"):d.$html.removeClass("rl-message-fullscreen"),h.windowResize()}),this.messageLoadingThrottle.subscribe(h.windowResizeCallback),this.goUpCommand=h.createCommand(this,function(){p.pub("mailbox.message-list.selector.go-up")}),this.goDownCommand=h.createCommand(this,function(){p.pub("mailbox.message-list.selector.go-down")}),C.constructorEnd(this)}var s=i(2),o=i(13),n=i(3),r=i(21),a=i(153),l=i(154),c=i(16),u=i(4),d=i(8),h=i(1),p=i(28),m=i(7),f=i(26),g=i(22),b=i(32),y=i(60),S=i(19),v=i(15),w=i(14),C=i(5),T=i(11);C.extendAsViewModel(["View/User/MailBox/MessageView","View/App/MailBox/MessageView","MailBoxMessageViewViewModel"],t),s.extend(t.prototype,T.prototype),t.prototype.isPgpActionVisible=function(){return u.SignedVerifyStatus.Success!==this.viewPgpSignedVerifyStatus()},t.prototype.isPgpStatusVerifyVisible=function(){return u.SignedVerifyStatus.None!==this.viewPgpSignedVerifyStatus()},t.prototype.isPgpStatusVerifySuccess=function(){return u.SignedVerifyStatus.Success===this.viewPgpSignedVerifyStatus()},t.prototype.pgpStatusVerifyMessage=function(){var e="";switch(this.viewPgpSignedVerifyStatus()){case u.SignedVerifyStatus.UnknownPublicKeys:e=m.i18n("PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND");break;case u.SignedVerifyStatus.UnknownPrivateKey:e=m.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND");break;case u.SignedVerifyStatus.Unverified:e=m.i18n("PGP_NOTIFICATIONS/UNVERIFIRED_SIGNATURE");break;case u.SignedVerifyStatus.Error:e=m.i18n("PGP_NOTIFICATIONS/DECRYPTION_ERROR");break;case u.SignedVerifyStatus.Success:e=m.i18n("PGP_NOTIFICATIONS/GOOD_SIGNATURE",{USER:this.viewPgpSignedVerifyUser()})}return e},t.prototype.fullScreen=function(){this.fullScreenMode(!0),h.windowResize()},t.prototype.unFullScreen=function(){this.fullScreenMode(!1),h.windowResize()},t.prototype.toggleFullScreen=function(){h.removeSelection(),this.fullScreenMode(!this.fullScreenMode()),h.windowResize()},t.prototype.replyOrforward=function(e){C.showScreenPopup(i(27),[e,v.message()])},t.prototype.onBuild=function(e){var t=this,r=m.i18n("PREVIEW_POPUP/IMAGE_ERROR"),c=function(){t.oHeaderDom&&t.viewBodyTopValue(t.message()?t.oHeaderDom.height()+20+1:0)};this.fullScreenMode.subscribe(function(e){e&&t.message.focused(!0)},this),this.fullScreenMode.subscribe(c),this.showFullInfo.subscribe(c),this.message.subscribe(c),d.$win.on("resize",function(){s.delay(c,1),s.delay(c,200),s.delay(c,500)}),this.showFullInfo.subscribe(function(){h.windowResize(),h.windowResize(250)}),this.oHeaderDom=o(".messageItemHeader",e),this.oHeaderDom=this.oHeaderDom[0]?this.oHeaderDom:null,this.pswpDom=o(".pswp",e)[0],this.pswpDom&&e.on("click",".attachmentImagePreview[data-index]",function(i){var s=null,n=i.currentTarget||null,c=[];return e.find(".attachmentImagePreview[data-index]").each(function(e,t){var i=o(t);c.push({w:600,h:400,src:i.attr("href"),title:i.attr("title")||""})}),c&&0<c.length&&(d.useKeyboardShortcuts(!1),s=new a(t.pswpDom,l,c,{index:h.pInt(o(n).data("index")),bgOpacity:.85,loadingIndicatorDelay:500,errorMsg:'<div class="pswp__error-msg">'+r+"</div>",showHideOpacity:!0,tapToToggleControls:!1,timeToIdle:0,timeToIdleOutside:0,history:!1,arrowEl:1<c.length,counterEl:1<c.length,shareEl:!1}),s.listen("imageLoadComplete",function(e,t){t&&t.img&&t.img.width&&t.img.height&&(t.w=t.img.width,t.h=t.img.height,s.updateSize(!0))}),s.listen("close",function(){d.useKeyboardShortcuts(!0)}),s.init()),!1}),e.on("click","a",function(e){return!(e&&3!==e.which&&h.mailToHelper(o(this).attr("href"),i(27)))}).on("click",".attachmentsPlace .attachmentIconParent",function(e){e&&e.stopPropagation&&e.stopPropagation()}).on("click",".attachmentsPlace .attachmentItem .attachmentNameParent",function(){var e=n.dataFor(this);e&&e.download&&i(6).download(e.linkDownload())}),this.message.focused.subscribe(function(e){e&&!h.inFocus()?this.messageDomFocused(!0):(this.messageDomFocused(!1),this.scrollMessageToTop(),this.scrollMessageToLeft())},this),this.messageDomFocused.subscribe(function(e){e||u.KeyState.MessageView!==d.keyScope()||this.message.focused(!1)},this),d.keyScope.subscribe(function(e){u.KeyState.MessageView===e&&this.message.focused()&&this.messageDomFocused(!0)},this),this.oMessageScrollerDom=e.find(".messageItem .content"),this.oMessageScrollerDom=this.oMessageScrollerDom&&this.oMessageScrollerDom[0]?this.oMessageScrollerDom:null,this.initShortcuts()},t.prototype.escShortcuts=function(){return this.viewModelVisibility()&&this.message()?(this.fullScreenMode()?this.fullScreenMode(!1):u.Layout.NoPreview===this.layout()?this.message(null):this.message.focused(!1),!1):void 0},t.prototype.initShortcuts=function(){var e=this;r("esc",u.KeyState.MessageView,s.bind(this.escShortcuts,this)),r("enter",u.KeyState.MessageView,function(){return e.toggleFullScreen(),!1}),r("enter",u.KeyState.MessageList,function(){return u.Layout.NoPreview!==e.layout()&&e.message()?(e.toggleFullScreen(),!1):void 0}),r("r",[u.KeyState.MessageList,u.KeyState.MessageView],function(){return v.message()?(e.replyCommand(),!1):void 0}),r("a",[u.KeyState.MessageList,u.KeyState.MessageView],function(){return v.message()?(e.replyAllCommand(),!1):void 0}),r("f",[u.KeyState.MessageList,u.KeyState.MessageView],function(){return v.message()?(e.forwardCommand(),!1):void 0}),r("b",[u.KeyState.MessageList,u.KeyState.MessageView],function(){return v.message()&&v.message().body?(v.message().body.find(".rlBlockquoteSwitcher").click(),!1):void 0}),r("ctrl+left, command+left, ctrl+up, command+up",u.KeyState.MessageView,function(){return e.goUpCommand(),!1}),r("ctrl+right, command+right, ctrl+down, command+down",u.KeyState.MessageView,function(){return e.goDownCommand(),!1}),r("ctrl+p, command+p",u.KeyState.MessageView,function(){return e.message()&&e.message().printMessage(),!1}),r("delete, shift+delete",u.KeyState.MessageView,function(t,i){return t?(i&&"shift+delete"===i.shortcut?e.deleteWithoutMoveCommand():e.deleteCommand(),!1):void 0}),r("tab, shift+tab, left",u.KeyState.MessageView,function(t,i){if(!e.fullScreenMode()&&e.message()&&u.Layout.NoPreview!==e.layout())if(t&&i&&"left"===i.shortcut){if(e.oMessageScrollerDom&&0<e.oMessageScrollerDom.scrollLeft())return!0;e.message.focused(!1)}else e.message.focused(!1);else if(e.message()&&u.Layout.NoPreview===e.layout()&&t&&i&&"left"===i.shortcut)return!0;return!1})},t.prototype.isDraftFolder=function(){return v.message()&&b.draftFolder()===v.message().folderFullNameRaw},t.prototype.isSentFolder=function(){return v.message()&&b.sentFolder()===v.message().folderFullNameRaw},t.prototype.isSpamFolder=function(){return v.message()&&b.spamFolder()===v.message().folderFullNameRaw},t.prototype.isSpamDisabled=function(){return v.message()&&b.spamFolder()===c.Values.UnuseOptionValue},t.prototype.isArchiveFolder=function(){return v.message()&&b.archiveFolder()===v.message().folderFullNameRaw},t.prototype.isArchiveDisabled=function(){return v.message()&&b.archiveFolder()===c.Values.UnuseOptionValue},t.prototype.isDraftOrSentFolder=function(){return this.isDraftFolder()||this.isSentFolder()},t.prototype.composeClick=function(){C.showScreenPopup(i(27))},t.prototype.editMessage=function(){v.message()&&C.showScreenPopup(i(27),[u.ComposeType.Draft,v.message()])},t.prototype.scrollMessageToTop=function(){this.oMessageScrollerDom&&(50<this.oMessageScrollerDom.scrollTop()?this.oMessageScrollerDom.scrollTop(50).animate({scrollTop:0},200):this.oMessageScrollerDom.scrollTop(0),h.windowResize())},t.prototype.scrollMessageToLeft=function(){this.oMessageScrollerDom&&(this.oMessageScrollerDom.scrollLeft(0),h.windowResize())},t.prototype.showImages=function(e){e&&e.showExternalImages&&e.showExternalImages(!0)},t.prototype.printableCheckedMessageCount=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>0?100>e?e:"99+":""},t.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},t.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},t.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(w.sendReadReceiptMessage(h.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),m.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),m.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":g.email()})),e.isReadReceipt(!0),S.storeMessageFlagsToCache(e),i(6).reloadFlagsCurrentMessageListAndMessageFromCache())},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){n.call(this),o.constructorEnd(this)}var s=i(2),o=i(5),n=i(91);o.extendAsViewModel(["View/User/MailBox/SystemDropDown","View/App/MailBox/SystemDropDown","MailBoxSystemDropDownViewModel"],t),s.extend(t.prototype,n.prototype),e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e){l.call(this,"Left","SettingsMenu"),this.leftPanelDisabled=o.leftPanelDisabled,this.menu=e.menu,a.constructorEnd(this)}var s=i(2),o=i(8),n=i(12),r=i(19),a=i(5),l=i(11);a.extendAsViewModel(["View/User/Settings/Menu","View/App/Settings/Menu","SettingsMenuViewModel"],t),s.extend(t.prototype,l.prototype),t.prototype.link=function(e){return n.settings(e)},t.prototype.backToMailBoxClick=function(){a.setHash(n.inbox(r.getFolderInboxName()))},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,"Right","SettingsPane"),c.constructorEnd(this)}var s=i(2),o=i(21),n=i(4),r=i(12),a=i(15),l=i(19),c=i(5),u=i(11);c.extendAsViewModel(["View/User/Settings/Pane","View/App/Settings/Pane","SettingsPaneViewModel"],t),s.extend(t.prototype,u.prototype),t.prototype.onBuild=function(){var e=this;o("esc",n.KeyState.Settings,function(){e.backToMailBoxClick()})},t.prototype.onShow=function(){a.message(null)},t.prototype.backToMailBoxClick=function(){c.setHash(r.inbox(l.getFolderInboxName()))},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){n.call(this),o.constructorEnd(this)}var s=i(2),o=i(5),n=i(91);o.extendAsViewModel(["View/User/Settings/SystemDropDown","View/App/Settings/SystemDropDown","SettingsSystemDropDownViewModel"],t),s.extend(t.prototype,n.prototype),e.exports=t}()},function(e){e.exports=window.$LAB},function(e){e.exports=window.PhotoSwipe},function(e){e.exports=window.PhotoSwipeUI_Default},function(e){e.exports=window.buzz},function(e){e.exports=window.ifvisible}]);