(function(h,j,f,Ya,Q,ca,ta,i){function B(){this.sBase="#/";this.sCdnStaticDomain=e.settingsGet("CdnStaticDomain");this.sVersion=e.settingsGet("Version");this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0";this.sServer="./?";this.sCdnStaticDomain=""===this.sCdnStaticDomain?this.sCdnStaticDomain:"/"===this.sCdnStaticDomain.substr(-1)?this.sCdnStaticDomain:this.sCdnStaticDomain+"/"}function s(a,b,c,l){this.oOptions=l=j.extend({DisableHtml:!1,onSwitch:!1,LangSwitcherConferm:"EDITOR_TEXT_SWITCHER_CONFIRM", LangSwitcherTextLabel:"EDITOR_SWITCHER_TEXT_LABEL",LangSwitcherHtmlLabel:"EDITOR_SWITCHER_HTML_LABEL"},d.isUnd(l)?{}:l);this.bOnlyPlain=!!this.oOptions.DisableHtml;this.fOnSwitch=this.oOptions.onSwitch;this.textarea=j(a).empty().addClass("editorTextArea");this.htmlarea=j(b).empty().addClass("editorHtmlArea").prop("contentEditable","true");this.toolbar=j(c).empty().addClass("editorToolbar");s.htmlInitEditor.apply(this);s.htmlInitToolbar.apply(this);s.htmlAttachEditorEvents.apply(this);this.bOnlyPlain&& this.toolbar.hide()}function L(a,b,c,l,e){this.list=a;this.selectedItem=b;this.selectedItem.extend({toggleSubscribe:[null,function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]});this.oContentScrollable=this.oContentVisible=null;this.sItemSelector=c;this.sItemSelectedSelector=l;this.sItemCheckedSelector=e;this.sLastUid="";this.oCallbacks={};this.iSelectTimer=0;this.bUseKeyboard=!0;this.emptyFunction=function(){};this.useItemSelectCallback=!0;this.throttleSelection=!1;this.selectedItem.subscribe(function(a){this.useItemSelectCallback&& (this.throttleSelection?(this.throttleSelection=!1,this.selectItemCallbacksThrottle(a)):this.selectItemCallbacks(a))},this);var f=this,g=[],k=null;this.list.subscribe(function(){var a=this,b=this.list();d.isArray(b)&&i.each(b,function(b){b.checked()&&g.push(a.getItemUid(b));null===k&&b.selected()&&(k=a.getItemUid(b))})},this,"beforeChange");this.list.subscribe(function(a){this.useItemSelectCallback=!1;this.selectedItem(null);if(d.isArray(a)){var b=this,c=g.length;i.each(a,function(a){0=f||g-2<=f)l+=2;k(f);c=b=f}for(;0=c)k(c,!0),l--;else if(0>=b)break;3===b?k(2,!1):3c&&k(Math.round((g+c)/2),!0,"...");1c&&k(g,!0)}return e},this);this.checkAll=f.computed({read:function(){return 0c},this);this.hasMessages=f.computed(function(){return 0< this.messageList().length},this);this.hasCheckedLines=f.computed(function(){return 0'),c.after(l),c.remove();l&&l[0]&& l.attr("data-href",f).attr("data-theme",b[0]).text(b[1]);a.themeTrigger(g.SaveSettingsStep.TrueResult)}}).always(function(){a.iTimer=h.setTimeout(function(){a.themeTrigger(g.SaveSettingsStep.Idle)},1E3);a.oLastAjax=null}));e.remote().saveSettings(null,{Theme:b})},this)}function Qa(){d.initDataConstructorBySettings(this)}function T(){d.initDataConstructorBySettings(this);var a=function(a){return function(){var b=e.cache().getFolderFromCacheList(a());b&&b.type(g.FolderType.User)}},b=function(a){return function(b){(b= e.cache().getFolderFromCacheList(b))&&b.type(a)}};this.devPassword=this.devLogin=this.devEmail="";this.accountEmail=f.observable("");this.accountLogin=f.observable("");this.projectHash=f.observable("");this.threading=f.observable(!1);this.lastFoldersHash="";this.remoteChangePassword=this.remoteSuggestions=!1;this.sentFolder=f.observable("");this.draftFolder=f.observable("");this.spamFolder=f.observable("");this.trashFolder=f.observable("");this.sentFolder.subscribe(a(this.sentFolder),this,"beforeChange"); this.draftFolder.subscribe(a(this.draftFolder),this,"beforeChange");this.spamFolder.subscribe(a(this.spamFolder),this,"beforeChange");this.trashFolder.subscribe(a(this.trashFolder),this,"beforeChange");this.sentFolder.subscribe(b(g.FolderType.SentItems),this);this.draftFolder.subscribe(b(g.FolderType.Draft),this);this.spamFolder.subscribe(b(g.FolderType.Spam),this);this.trashFolder.subscribe(b(g.FolderType.Trash),this);this.draftFolderNotEnabled=f.computed(function(){return""===this.draftFolder()|| n.Values.UnuseOptionValue===this.draftFolder()},this);this.displayName=f.observable("");this.signature=f.observable("");this.replyTo=f.observable("");this.accounts=f.observableArray([]);this.accountsLoading=f.observable(!1);this.namespace="";this.folderList=f.observableArray([]);this.foldersListError=f.observable("");this.foldersLoading=f.observable(!1);this.foldersCreating=f.observable(!1);this.foldersDeleting=f.observable(!1);this.foldersRenaming=f.observable(!1);this.currentFolder=f.observable(null).extend({toggleSubscribe:[null, function(a){a&&a.selected(!1)},function(a){a&&a.selected(!0)}]});this.currentFolderFullNameRaw=f.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this);this.currentFolderFullName=f.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this);this.currentFolderFullNameHash=f.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this);this.currentFolderName=f.computed(function(){return this.currentFolder()? this.currentFolder().name():""},this);this.folderListSystemNames=f.computed(function(){var a=["INBOX"],b=this.folderList(),e=this.sentFolder(),f=this.draftFolder(),g=this.spamFolder(),k=this.trashFolder();d.isArray(b)&&0').appendTo("body");O.on("error",function(a){e&&(a&&a.originalEvent&&a.originalEvent.message&&-1===d.inArray(a.originalEvent.message,["Uncaught Error: Error calling method on NPObject."]))&&e.remote().jsError(d.emptyFunction, a.originalEvent.message,a.originalEvent.filename,a.originalEvent.lineno,location&&location.toString?location.toString():"",aa.attr("class"))})}function A(){J.call(this);this.oCache=this.oRemote=this.oData=null;this.iSuggestionsLimit=d.pInt(this.settingsGet("SuggestionsLimit"));this.iSuggestionsLimit=0===this.iSuggestionsLimit?20:this.iSuggestionsLimit;this.quotaDebounce=i.debounce(this.quota,3E4)}var n={},g={},u={},d={},x={},ia={},Da,Ea,Sa,pa,Ta,cb,ba,ya=f.observable(!0),ja=f.observable(!0),p=null, Fa=h.rainloopAppData||{},Ua=h.rainloopI18N||{},aa=j("html"),O=j(h),Ga=j(h.document),Ha=[],Va=[],Wa=[],ka=h.Notification&&h.Notification.requestPermission?h.Notification:null,e=null;Ea=Da=0;Sa=!1;pa=(navigator.userAgent||"").toLowerCase();Ta=-1/g,">").replace(/"/g,""").replace(/'/g,"'"): ""};d.splitPlainText=function(a,b){for(var c="",l="",e=a,f=0,g=0,b=d.isUnd(b)?100:b;e.length>b;)l=e.substring(0,b),f=l.lastIndexOf(" "),g=l.lastIndexOf("\n"),-1!==g&&(f=g),-1===f&&(f=b),c+=l.substring(0,f)+"\n",e=e.substring(f+1);return c+e};var Ia={};d.timeOutAction=function(a,b,c){d.isUnd(Ia[a])&&(Ia[a]=0);h.clearTimeout(Ia[a]);Ia[a]=h.setTimeout(b,c)};var Xa={};d.timeOutActionSecond=function(a,b,c){Xa[a]||(Xa[a]=h.setTimeout(function(){b();Xa[a]=0},c))};var P=!1;d.audio=function(a,b){if(!1===P)if(Ta)P= null;else{var c=!1,d=!1,e=h.Audio?new h.Audio:null;e&&e.canPlayType&&e.play?((c=""!==e.canPlayType('audio/mpeg; codecs="mp3"'))||(d=""!==e.canPlayType('audio/ogg; codecs="vorbis"')),c||d?(P=e,P.preload="none",P.loop=!1,P.autoplay=!1,P.muted=!1,P.src=c?a:b):P=null):P=null}return P};d.hos=function(a,b){return a&&Object.hasOwnProperty?Object.hasOwnProperty.call(a,b):!1};d.i18n=function(a,b,c){var l="",a=d.isUnd(Ua[a])?d.isUnd(c)?a:c:Ua[a];if(!d.isUnd(b)&&!d.isNull(b))for(l in b)d.hos(b,l)&&(a=a.replace("%"+ l+"%",b[l]));return a};d.i18nToNode=function(a){i.defer(function(){j(".i18n",a).each(function(){var a=j(this),c="";(c=a.data("i18n-text"))?a.text(d.i18n(c)):((c=a.data("i18n-html"))&&a.html(d.i18n(c)),(c=a.data("i18n-placeholder"))&&a.attr("placeholder",d.i18n(c)))})})};d.i18nToDoc=function(){h.rainloopI18N&&(Ua=h.rainloopI18N||{},d.i18nToNode(Ga),ja(!ja()));h.rainloopI18N={}};d.initOnStartOrLangChange=function(a,b,c){a&&a.call(b);c?ja.subscribe(function(){a&&a.call(b);c.call(b)}):a&&ja.subscribe(a, b)};d.inFocus=function(){var a=document.activeElement;return a&&("INPUT"===a.tagName||"TEXTAREA"===a.tagName||"IFRAME"===a.tagName||"DIV"===a.tagName&&"editorHtmlArea"===a.className&&a.contentEditable)};d.removeInFocus=function(){if(document&&document.activeElement&&document.activeElement.blur){var a=j(document.activeElement);(a.is("input")||a.is("textarea"))&&document.activeElement.blur()}};d.removeSelection=function(){if(h&&h.getSelection){var a=h.getSelection();a&&a.removeAllRanges&&a.removeAllRanges()}else document&& (document.selection&&document.selection.empty)&&document.selection.empty()};d.replySubjectAdd=function(a,b){var c=null,l=d.trim(b);null!==(c=(new h.RegExp("^"+a+"[\\s]?\\:(.*)$","gi")).exec(b))&&!d.isUnd(c[1])?l=a+"[2]: "+c[1]:null!==(c=(new h.RegExp("^("+a+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi")).exec(b))&&!d.isUnd(c[1])&&!d.isUnd(c[2])&&!d.isUnd(c[3])?(d.pInt(c[2]),l=c[1]+(d.pInt(c[2])+1)+c[3]):l=a+": "+b;return l};d.roundNumber=function(a,b){return Math.round(a*Math.pow(10,b))/ Math.pow(10,b)};d.friendlySize=function(a){a=d.pInt(a);return 1073741824<=a?d.roundNumber(a/1073741824,1)+"GB":1048576<=a?d.roundNumber(a/1048576,1)+"MB":1024<=a?d.roundNumber(a/1024,0)+"KB":a+"B"};d.log=function(a){h.console&&h.console.log&&h.console.log(a)};d.getNotification=function(a){a=d.pInt(a);return d.isUnd(u[a])?"":u[a]};d.initNotificationLanguage=function(){u[g.Notification.InvalidToken]=d.i18n("NOTIFICATIONS/INVALID_TOKEN");u[g.Notification.AuthError]=d.i18n("NOTIFICATIONS/AUTH_ERROR"); u[g.Notification.AccessError]=d.i18n("NOTIFICATIONS/ACCESS_ERROR");u[g.Notification.ConnectionError]=d.i18n("NOTIFICATIONS/CONNECTION_ERROR");u[g.Notification.CaptchaError]=d.i18n("NOTIFICATIONS/CAPTCHA_ERROR");u[g.Notification.SocialFacebookLoginAccessDisable]=d.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE");u[g.Notification.SocialTwitterLoginAccessDisable]=d.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE");u[g.Notification.SocialGoogleLoginAccessDisable]=d.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"); u[g.Notification.DomainNotAllowed]=d.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED");u[g.Notification.AccountNotAllowed]=d.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED");u[g.Notification.CantGetMessageList]=d.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST");u[g.Notification.CantGetMessage]=d.i18n("NOTIFICATIONS/CANT_GET_MESSAGE");u[g.Notification.CantDeleteMessage]=d.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE");u[g.Notification.CantMoveMessage]=d.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE");u[g.Notification.CantSaveMessage]= d.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE");u[g.Notification.CantSendMessage]=d.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE");u[g.Notification.InvalidRecipients]=d.i18n("NOTIFICATIONS/INVALID_RECIPIENTS");u[g.Notification.CantCreateFolder]=d.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER");u[g.Notification.CantRenameFolder]=d.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER");u[g.Notification.CantDeleteFolder]=d.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER");u[g.Notification.CantDeleteNonEmptyFolder]=d.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"); u[g.Notification.CantSubscribeFolder]=d.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER");u[g.Notification.CantUnsubscribeFolder]=d.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER");u[g.Notification.CantSaveSettings]=d.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS");u[g.Notification.CantSavePluginSettings]=d.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS");u[g.Notification.DomainAlreadyExists]=d.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS");u[g.Notification.CantInstallPackage]=d.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"); u[g.Notification.CantDeletePackage]=d.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE");u[g.Notification.InvalidPluginPackage]=d.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE");u[g.Notification.UnsupportedPluginPackage]=d.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE");u[g.Notification.LicensingServerIsUnavailable]=d.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE");u[g.Notification.LicensingExpired]=d.i18n("NOTIFICATIONS/LICENSING_EXPIRED");u[g.Notification.LicensingBanned]=d.i18n("NOTIFICATIONS/LICENSING_BANNED"); u[g.Notification.DemoSendMessageError]=d.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR");u[g.Notification.AccountAlreadyExists]=d.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS");u[g.Notification.MailServerError]=d.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR");u[g.Notification.UnknownNotification]=d.i18n("NOTIFICATIONS/UNKNOWN_ERROR");u[g.Notification.UnknownError]=d.i18n("NOTIFICATIONS/UNKNOWN_ERROR")};d.getUploadErrorDescByCode=function(a){var b="";switch(d.pInt(a)){case g.UploadErrorCode.FileIsTooBig:b=d.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG"); break;case g.UploadErrorCode.FilePartiallyUploaded:b=d.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case g.UploadErrorCode.FileNoUploaded:b=d.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case g.UploadErrorCode.MissingTempFolder:b=d.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case g.UploadErrorCode.FileOnSaveingError:b=d.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case g.UploadErrorCode.FileType:b=d.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:b=d.i18n("UPLOAD/ERROR_UNKNOWN")}return b};d.killCtrlAandS= function(a){if(a=a||h.event){var b=a.target||a.srcElement,c=a.keyCode||a.which;if(a.ctrlKey&&c===g.EventKeyCode.S)a.preventDefault();else if((!b||!b.tagName||!b.tagName.match(/INPUT|TEXTAREA/i))&&a.ctrlKey&&c===g.EventKeyCode.A)h.getSelection?h.getSelection().removeAllRanges():h.document.selection&&h.document.selection.clear&&h.document.selection.clear(),a.preventDefault()}};d.createCommand=function(a,b,c){var l=b?function(){l.canExecute&&l.canExecute()&&b.apply(a,Array.prototype.slice.call(arguments)); return!1}:function(){};l.enabled=f.observable(!0);c=d.isUnd(c)?!0:c;l.canExecute=d.isFunc(c)?f.computed(function(){return l.enabled()&&c.call(a)}):f.computed(function(){return l.enabled()&&!!c});return l};d.initDataConstructorBySettings=function(a){a.ignoreFolderSubscribe=f.observable(!1);a.editorDefaultType=f.observable(g.EditorDefaultType.Html);a.showImages=f.observable(!1);a.showAnimation=f.observable(!1);a.desktopNotifications=f.observable(!1);a.useThreads=f.observable(!0);a.replySameFolder=f.observable(!0); a.usePreviewPane=f.observable(!0);a.useCheckboxesInList=f.observable(!0);a.showAnimation.subscribe(function(a){ba?aa.removeClass("rl-anim").addClass("no-rl-anim"):aa.toggleClass("rl-anim",a).toggleClass("no-rl-anim",!a)});a.showAnimation.valueHasMutated();a.desktopNotificationsPermisions=f.computed(function(){a.desktopNotifications();var b=g.DesctopNotifications.NotSupported;if(ka&&ka.permission)switch(ka.permission.toLowerCase()){case "granted":b=g.DesctopNotifications.Allowed;break;case "denied":b= g.DesctopNotifications.Denied;break;case "default":b=g.DesctopNotifications.NotAllowed}else h.webkitNotifications&&h.webkitNotifications.checkPermission&&(b=h.webkitNotifications.checkPermission());return b});a.useDesktopNotifications=f.computed({read:function(){return a.desktopNotifications()&&g.DesctopNotifications.Allowed===a.desktopNotificationsPermisions()},write:function(b){b?(b=a.desktopNotificationsPermisions(),g.DesctopNotifications.Allowed===b?a.desktopNotifications(!0):g.DesctopNotifications.NotAllowed=== b?ka.requestPermission(function(){a.desktopNotifications.valueHasMutated();h.console.log(a.desktopNotificationsPermisions());g.DesctopNotifications.Allowed===a.desktopNotificationsPermisions()?a.desktopNotifications()?a.desktopNotifications.valueHasMutated():a.desktopNotifications(!0):a.desktopNotifications()?a.desktopNotifications(!1):a.desktopNotifications.valueHasMutated()}):a.desktopNotifications(!1)):a.desktopNotifications(!1)}});a.language=f.observable("");a.languages=f.observableArray([]); a.mainLanguage=f.computed({read:a.language,write:function(b){b!==a.language()?-1=a.diff(c,"hours")?l:a.format("L")===c.format("L")?d.i18n("MESSAGE_LIST/TODAY_AT",{TIME:c.format("LT")}):a.clone().subtract("days",1).format("L")===c.format("L")?d.i18n("MESSAGE_LIST/YESTERDAY_IN",{TIME:c.format("LT")}):a.year()===c.year()?c.format("D MMM."):c.format("LL")},a)};d.isFolderExpanded=function(a){var b=e.local().get(g.ClientSideKeyName.ExpandedFolders);return i.isArray(b)&&-1!==i.indexOf(b,a)};d.setExpandedFolder=function(a,b){var c=e.local().get(g.ClientSideKeyName.ExpandedFolders); i.isArray(c)||(c=[]);b?(c.push(a),c=i.uniq(c)):c=i.without(c,a);e.local().set(g.ClientSideKeyName.ExpandedFolders,c)};d.initLayoutResizer=function(a,b,c,d){var f=j(a),t=j(b),v=j(c),a=e.local().get(g.ClientSideKeyName.MailBoxListSize),k=function(a,b,c){if(b||c)a=v.width(),b=b?100*(b.size.width/a):null,null===b&&c&&(b=100*(f.width()/a)),null!==b&&(f.css({width:"",height:"",right:""+(100-b)+"%"}),t.css({width:"",height:"",left:""+b+"%"}))};a&&f.width(a);f.resizable({minWidth:350,maxWidth:v.width()-250, handles:"e",resize:k,stop:k});k(null,null,!0);O.resize(i.throttle(function(a,b){if(d&&d()){var c=v.width();f.resizable("option","maxWidth",c-250);b&&(b.size&&b.size.width)&&e.local().set(g.ClientSideKeyName.MailBoxListSize,b.size.width);k(null,null,!0)}},400))};d.initBlockquoteSwitcher=function(a){if(a){var b=j("blockquote:not(.rl-bq-switcher)",a).filter(function(){return 0===j(this).parent().closest("blockquote",a).length});b&&0').insertBefore(a).click(function(){a.toggleClass("hidden-bq");d.windowResize()}).after("
").before("
")})}};d.removeBlockquoteSwitcher=function(a){a&&(j(a).find("blockquote.rl-bq-switcher").each(function(){j(this).removeClass("rl-bq-switcher hidden-bq")}),j(a).find(".rlBlockquoteSwitcher").each(function(){j(this).remove()}))};d.extendAsViewModel=function(a,b){b&&(b.__name=a, x.regViewModelHook(a,b),i.extend(b.prototype,C.prototype))};d.addSettingsViewModel=function(a,b,c,d,e){a.__rlSettingsData={Label:c,Template:b,Route:d,IsDefault:!!e};Ha.push(a)};d.removeSettingsViewModel=function(a){Va.push(a)};d.disableSettingsViewModel=function(a){Wa.push(a)};d.convertThemeName=function(a){return d.trim(a.replace(/[^a-zA-Z]/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))};d.convertLangName=function(a){return d.i18n("LANGS_NAMES/LANG_"+a.toUpperCase().replace(/[^a-zA-Z0-9]+/, "_"),null,a)};d.fakeMd5=function(a){for(var b="",a=d.isUnd(a)?32:d.pInt(a);b.length/g,">").replace(/")};d.draggeblePlace=function(){return j('
 
').appendTo("#rl-hidden")}; d.defautOptionsAfterRender=function(a,b){b&&!d.isUnd(b.disable)&&f.applyBindingsToNode(a,{disable:b.disable},b)};d.windowPopupKnockout=function(a,b,c,l){var e=null,f=h.open(""),g="__OpenerApplyBindingsUid"+d.fakeMd5()+"__",k=j("#"+b);h[g]=function(){if(f&&f.document.body&&k&&k[0]){var b=j(f.document.body);j("#rl-content",b).html(k.html());j("html",f.document).addClass("external "+j("html").attr("class"));d.i18nToNode(b);E.prototype.applyExternal(a,j("#rl-content",b)[0]);h[g]=null;l(f)}};f.document.open(); f.document.write(''+d.encodeHtml(c)+'
');f.document.close();e=f.document.createElement("script");e.type="text/javascript";e.innerHTML="if(window&&window.opener&&window.opener['"+ g+"']){window.opener['"+g+"']();window.opener['"+g+"']=null}";f.document.getElementsByTagName("head")[0].appendChild(e)};d.settingsSaveHelperFunction=function(a,b,c,l){c=c||null;l=d.isUnd(l)?1E3:d.pInt(l);return function(d,e,f,k,h){b.call(c,e&&e.Result?g.SaveSettingsStep.TrueResult:g.SaveSettingsStep.FalseResult);a&&a.call(c,d,e,f,k,h);i.delay(function(){b.call(c,g.SaveSettingsStep.Idle)},l)}};d.settingsSaveHelperSimpleFunction=function(a,b){return d.settingsSaveHelperFunction(null,a,b,1E3)};d.resizeAndCrop= function(a,b,c){var d=new Image;d.onload=function(){var a=[0,0],d=document.createElement("canvas"),l=d.getContext("2d");d.width=b;d.height=b;a=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width];l.fillStyle="#fff";l.fillRect(0,0,b,b);l.drawImage(this,a[0]/2,a[1]/2,this.width-a[0],this.height-a[1],0,0,b,b);c(d.toDataURL("image/jpeg"))};d.src=a};ia={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(a){return ia.encode(a).replace(/[+]/g, "-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(a){for(var b="",c,d,e,f,g,k,i=0,a=ia._utf8_encode(a);i>2,c=(c&3)<<4|d>>4,g=(d&15)<<2|e>>6,k=e&63,isNaN(d)?g=k=64:isNaN(e)&&(k=64),b=b+this._keyStr.charAt(f)+this._keyStr.charAt(c)+this._keyStr.charAt(g)+this._keyStr.charAt(k);return b},decode:function(a){for(var b="",c,d,e,f,g,k=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");k>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),64!==f&&(b+=String.fromCharCode(d)),64!==g&&(b+=String.fromCharCode(e));return ia._utf8_decode(b)},_utf8_encode:function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",c=0,d=a.length,e=0;ce?b+=String.fromCharCode(e):(127e?b+=String.fromCharCode(e>>6|192):(b+=String.fromCharCode(e>>12|224), b+=String.fromCharCode(e>>6&63|128)),b+=String.fromCharCode(e&63|128));return b},_utf8_decode:function(a){for(var b="",c=0,d=0,e=0,f=0;cd?(b+=String.fromCharCode(d),c++):191d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|e&63),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(e&63)<<6|f&63),c+=3);return b}};f.bindingHandlers.tooltip={init:function(a,b){if(!ba){var c=j(a).data("tooltip-class")||"";j(a).tooltip({delay:{show:500, hide:100},html:!0,trigger:"hover",title:function(){return''+d.i18n(f.utils.unwrapObservable(b()))+""}})}}};f.bindingHandlers.tooltip2={init:function(a,b){var c=j(a).data("tooltip-class")||"";j(a).tooltip({delay:{show:500,hide:100},html:!0,title:function(){return''+b()()+""}})}};f.bindingHandlers.popover={init:function(a,b){var c=f.utils.unwrapObservable(b());j(a).popover({trigger:c[2]||"click",placement:c[3]||"right", title:function(){return d.i18n(c[0]||"")},content:function(){return d.i18n(c[1]||"")}})}};f.bindingHandlers.resizecrop={init:function(a){j(a).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(a,b){b()();j(a).resizecrop({width:"100",height:"100"})}};f.bindingHandlers.onEnter={init:function(a,b,c,d){j(a).on("keypress",function(c){c&&13===h.parseInt(c.keyCode,10)&&(j(a).trigger("change"),b().call(d))})}};f.bindingHandlers.onEsc={init:function(a, b,c,d){j(a).on("keypress",function(c){c&&27===h.parseInt(c.keyCode,10)&&(j(a).trigger("change"),b().call(d))})}};f.bindingHandlers.modal={init:function(a,b){j(a).modal({keyboard:!1,show:f.utils.unwrapObservable(b())}).on("hidden",function(){b()(!1)})},update:function(a,b){var c=f.utils.unwrapObservable(b());j(a).modal(c?"show":"hide");i.delay(function(){j(a).toggleClass("popup-active",c)},1)}};f.bindingHandlers.i18nInit={init:function(a){d.i18nToNode(a)}};f.bindingHandlers.i18nUpdate={update:function(a, b){f.utils.unwrapObservable(b());d.i18nToNode(a)}};f.bindingHandlers.link={update:function(a,b){j(a).attr("href",f.utils.unwrapObservable(b()))}};f.bindingHandlers.title={update:function(a,b){j(a).attr("title",f.utils.unwrapObservable(b()))}};f.bindingHandlers.textF={init:function(a,b){j(a).text(f.utils.unwrapObservable(b()))}};f.bindingHandlers.initDom={init:function(a,b){b()(a)}};f.bindingHandlers.initResizeTrigger={init:function(a,b){var c=f.utils.unwrapObservable(b());j(a).css({height:c[1],"min-height":c[1]})}, update:function(a,b){var c=f.utils.unwrapObservable(b()),l=d.pInt(c[1]),e=0,e=j(a).offset().top;0=c.left&&a.pageX<=c.left+l.width()&&(a.pageY>=b-100&&a.pageY<=b&&(b=function(){l.scrollTop(l.scrollTop()+3);d.windowResize()},l.data("timerScroll",h.setInterval(b,10)),b()),a.pageY>=c.top&&a.pageY<=c.top+100))c=function(){l.scrollTop(l.scrollTop()-3);d.windowResize()},l.data("timerScroll",h.setInterval(c,10)),c()})},c.stop= function(){j(l).each(function(){h.clearInterval(j(this).data("timerScroll"));j(this).data("timerScroll",!1)})});c.helper=function(a){return b()(a&&a.target?f.dataFor(a.target):null)};j(a).draggable(c).on("mousedown",function(){d.removeInFocus()})}}};f.bindingHandlers.droppable={init:function(a,b,c){if(!ba){var d=b(),e=(b=c())&&b.droppableOver?b.droppableOver:null,f=b&&b.droppableOut?b.droppableOut:null,b={tolerance:"pointer",hoverClass:"droppableHover"};d&&(b.drop=function(a,b){d(a,b)},e&&(b.over= function(a,b){e(a,b)}),f&&(b.out=function(a,b){f(a,b)}),j(a).droppable(b))}}};f.bindingHandlers.nano={init:function(a){ba||j(a).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}};f.bindingHandlers.saveTrigger={init:function(a){j(a).append('  ').addClass("settings-saved-trigger")},update:function(a,b){var c=f.utils.unwrapObservable(b()),d=j(a);switch(c.toString()){case "1":d.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible"); break;case "0":d.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case "-2":d.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:d.find(".animated").hide().end().find(".error,.success").removeClass("visible")}}};f.bindingHandlers.select2={init:function(a,b){var c=0,l=null,g=new h.RegExp(/[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\.\-_]+/),t=new h.RegExp(/(.+) [<]?([^\s<@]+@[a-zA-Z0-9\.\-_]+)[>]?/), v=function(){return""},k=function(a){e.getAutocomplete(a.term,a.page,function(b,c){a.callback({more:!!c,results:i.map(b,function(a){var b=a.toLine(!1);return{id:b,text:b,c:a}})})})};j(a).addClass("ko-select2").select2({query:function(a){a&&(0===c?(k(a),c=h.setTimeout(d.emptyFunction,200)):(h.clearInterval(c),c=h.setTimeout(function(){k(a)},200)))},formatSelection:function(a,b){var c=a&&a.c?a.c.select2Selection(b):a.text;if(null!==c)return c},formatResult:function(a,b,c,d){b=a&&a.c?a.c.select2Result(b): "";return""===b?d(a.text):b},createSearchChoice:function(a,b){return 0===b.length&&g.test(a)?{id:a,text:a}:null},formatNoMatches:v,formatSearching:function(){return d.i18n("SUGGESTIONS/SEARCHING_DESC")},formatInputTooShort:v,formatSelectionTooBig:v,multiple:!0,tokenSeparators:[",",";"],minimumInputLength:2,selectOnBlur:!1,closeOnSelect:!0,openOnEnter:!1});f.utils.domNodeDisposal.addDisposeCallback(a,function(){j(a).select2("destroy")});j(a).on("change",function(){for(var a=j(this).select2("data"), c=0,e=a.length,f=null,g=[];cd.pInt(j.browser.version)?(c=this.getEditorRange())&&c.execCommand("forecolor"===a?"ForeColor":"BackColor",!1,b):(c=j.browser.msie? "forecolor"===a?"ForeColor":"BackColor":"forecolor"===a?"foreColor":"backColor",this.ec(c,!1,b))};s.prototype.isHtml=function(){return!0===this.bOnlyPlain?!1:this.textarea.is(":hidden")};s.prototype.toHtmlString=function(){return this.editor.innerHTML};s.prototype.toString=function(){return this.editor.innerText};s.prototype.updateTextArea=function(){this.textarea.val(this.toHtmlString())};s.prototype.updateHtmlArea=function(){this.editor.innerHTML=this.textarea.val()};s.prototype.setRawText=function(a, b){b&&!this.bOnlyPlain?(this.isHtml()||(this.textarea.val(""),this.switchToHtml()),this.textarea.val(a.toString()),this.updateHtmlArea()):(this.textarea.val(a.toString()),this.updateHtmlArea(),this.switchToPlain(!1))};s.prototype.clear=function(){this.textarea.val("");this.editor.innerHTML="";this.bOnlyPlain?(this.toolbar.hide(),this.switchToPlain(!1)):this.switchToHtml()};s.prototype.getTextForRequest=function(){this.isHtml()&&this.updateTextArea();return this.textarea.val()};s.prototype.getTextFromHtml= function(a){var b="",c=function(){if(arguments&&1 "+d.trim(a).replace(/\n/gm,"\n> ")+"\n>\n";return a.replace(/\n([> ]+)/gm,function(){return arguments&&1]*>([\s\S]*)<\/div>/gmi,e),a="\n"+d.trim(a)+"\n");return a}return""}, a=d.isUnd(a)?!0:!!a,b=this.toHtmlString().replace(/[\s]+/gm," ").replace(//gmi,"\n").replace(/<\/h\d>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gmi,"\n_______________________________\n\n").replace(/]*>/gmi,"").replace(/]*>([\s\S]*)<\/div>/gmi,e).replace(/]*>/gmi,"\n__bq__start__\n").replace(/<\/blockquote>/gmi,"\n__bq__end__\n").replace(/]*>([\s\S]*?)<\/a>/gmi,function(){return arguments&& 1]*>/gm,"").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&").replace(/&\w{2,6};/gi,"");return(a?d.splitPlainText(b):b).replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/__bq__start__([\s\S]*)__bq__end__/gm,c).replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")};s.prototype.getHtmlFromText=function(){return d.convertPlainTextToHtml(this.textarea.val())};s.prototype.switchToggle=function(){this.isHtml()? this.switchToPlain():this.switchToHtml()};s.prototype.switchToPlain=function(a){var a=d.isUnd(a)?!0:a,b=this.getTextFromHtml(),c=i.bind(function(a){a&&(this.toolbar.addClass("editorHideToolbar"),j(".editorSwitcher",this.toolbar).text(this.switcherLinkText(!1)),this.textarea.val(b),this.textarea.show(),this.htmlarea.hide(),this.fOnSwitch&&this.fOnSwitch(!1))},this);!a||0===d.trim(b).length?c(!0):c(h.confirm(this.oOptions.LangSwitcherConferm))};s.prototype.switcherLinkText=function(a){return a?this.oOptions.LangSwitcherTextLabel: this.oOptions.LangSwitcherHtmlLabel};s.prototype.switchToHtml=function(){this.toolbar.removeClass("editorHideToolbar");j(".editorSwitcher",this.toolbar).text(this.switcherLinkText(!0));this.textarea.val(this.getHtmlFromText());this.updateHtmlArea();this.textarea.hide();this.htmlarea.show();this.fOnSwitch&&this.fOnSwitch(!0)};s.prototype.addButton=function(a,b){var c=this;j("
").addClass("editorToolbarButtom").append(j('').addClass(a)).attr("title", b).click(function(b){d.isUnd(s.htmlFunctions[a])?h.alert(a):s.htmlFunctions[a].apply(c,[j(this),b])}).appendTo(this.toolbar)};s.htmlInitToolbar=function(){if(!this.bOnlyPlain){this.addButton("bold","Bold");this.addButton("italic","Italic");this.addButton("underline","Underline");this.addButton("strikethrough","Strikethrough");this.addButton("removeformat","removeformat");this.addButton("justifyleft","justifyleft");this.addButton("justifycenter","justifycenter");this.addButton("justifyright","justifyright"); this.addButton("horizontalrule","horizontalrule");this.addButton("orderedlist","orderedlist");this.addButton("unorderedlist","unorderedlist");this.addButton("indent","indent");this.addButton("outdent","outdent");this.addButton("forecolor","forecolor");var a=this;j("").addClass("editorSwitcher").text(a.switcherLinkText(!0)).click(function(){a.switchToggle()}).appendTo(a.toolbar)}};s.htmlInitEditor=function(){this.editor=this.htmlarea[0];this.editor.innerHTML=this.textarea.val()};s.htmlAttachEditorEvents= function(){var a=this,b=function(b){if(b=(b&&b.originalEvent?b.originalEvent:b)||h.event){b.stopPropagation();b.preventDefault();var c=null,d=null;if((b=b.files||(b.dataTransfer?b.dataTransfer.files:null))&&1===b.length&&b[0]&&b[0].type&&0===b[0].type.indexOf("image/")){var d=b[0],c=new h.FileReader,e=d;c.onload=function(b){a.insertImage(b.target.result,e.name)};c.readAsDataURL(d)}}a.htmlarea.removeClass("editorDragOver")},c=function(){a.htmlarea.removeClass("editorDragOver")},d=function(b){b.stopPropagation(); b.preventDefault();a.htmlarea.addClass("editorDragOver")},e=function(b){(b=b&&b.clipboardData?b.clipboardData:b&&b.originalEvent&&b.originalEvent.clipboardData?b.originalEvent.clipboardData:null)&&b.items&&i.each(b.items,function(b){if(b&&(b.type&&0===b.type.indexOf("image/"))&&b.getAsFile){var c=null,d=b.getAsFile();d&&(c=new h.FileReader,c.onload=function(b){a.insertImage(b.target.result,d.name)},c.readAsDataURL(d))}})};!this.bOnlyPlain&&(h.File&&h.FileReader&&h.FileList)&&(this.htmlarea.bind("dragover", d),this.htmlarea.bind("dragleave",c),this.htmlarea.bind("drop",b),this.htmlarea.bind("paste",e))};for(var mb=s,qa=[],db=[],W=0,Ja=0,Ka=0,La=0,Ma="",W=0;256>W;W+=85)Ma=W.toString(16),qa.push(1===Ma.length?"0"+Ma:Ma);La=qa.length;for(W=0;W
'),gb=ra.find(".editorFpFonts"), hb=function(){};j.each("Arial;Arial Black;Courier New;Tahoma;Times New Roman;Verdana".split(";"),function(a,b){gb.append(j(''+b+"").click(function(){hb(b)}));gb.append("
")});ra.hide();nb.htmlFontPicker=function(a,b,c){fb||(ra.appendTo(c),fb=!0);hb=b;eb.unbind("click.fpNamespace");h.setTimeout(function(){eb.one("click.fpNamespace",function(){ra.hide()})},500);b=j(a).position();ra.css("top",5+b.top+ j(a).height()+"px").css("left",b.left+"px").show()};var ob=s,ib=j(h.document),jb=!1,sa=j('
'),kb=sa.find(".editorCpColors"),lb=function(){};j.each(s.htmlColorPickerColors,function(a,b){kb.append('')});sa.hide();j(".editorCpColor",kb).click(function(a){var b=1,c="#000000",a=j(a.target).css("background-color"), c=a.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(null!==c){for(delete c[0];3>=b;++b)c[b]=d.pInt(c[b]).toString(16),1===c[b].length&&(c[b]="0"+c[b]);c="#"+c.join("")}else c=a;lb(c)});ob.htmlColorPicker=function(a,b,c){jb||(sa.appendTo(c),jb=!0);c=j(a).position();lb=b;ib.unbind("click.cpNamespace");h.setTimeout(function(){ib.one("click.cpNamespace",function(){sa.hide()})},100);sa.css("top",5+c.top+j(a).height()+"px").css("left",c.left+"px").show()};s.htmlFunctions={bold:function(){this.ec("bold")}, italic:function(){this.ec("italic")},underline:function(){this.ec("underline")},strikethrough:function(){this.ec("strikethrough")},indent:function(){this.ec("indent")},outdent:function(){this.ec("outdent")},justifyleft:function(){this.ec("justifyLeft")},justifycenter:function(){this.ec("justifyCenter")},justifyright:function(){this.ec("justifyRight")},horizontalrule:function(){this.ec("insertHorizontalRule",!1,"ht")},removeformat:function(){this.ec("removeFormat")},orderedlist:function(){this.ec("insertorderedlist")}, unorderedlist:function(){this.ec("insertunorderedlist")},forecolor:function(a){s.htmlColorPicker(a,i.bind(function(a){this.setcolor("forecolor",a)},this),this.toolbar)},backcolor:function(a){s.htmlColorPicker(a,i.bind(function(a){this.setcolor("backcolor",a)},this),this.toolbar)},fontname:function(a){s.htmlFontPicker(a,i.bind(function(a){this.ec("fontname",!1,a)},this),this.toolbar)}};L.prototype.selectItemCallbacks=function(a){(this.oCallbacks.onItemSelect||this.emptyFunction)(a)};L.prototype.init= function(a,b){this.oContentVisible=a;this.oContentScrollable=b;if(this.oContentVisible&&this.oContentScrollable){var c=this;j(this.oContentVisible).on("click",this.sItemSelector,function(a){c.actionClick(f.dataFor(this),a)}).on("click",this.sItemCheckedSelector,function(a){var b=f.dataFor(this);b&&(a&&a.shiftKey?c.actionClick(b,a):(c.sLastUid=c.getItemUid(b),b.selected()?(b.checked(!1),c.selectedItem(null)):b.checked(!b.checked())))});j(h.document).on("keydown",function(a){var b=!0;if(a&&c.bUseKeyboard&& !d.inFocus())if(-1d?0:d;v=k[d];break}}else if(g.EventKeyCode.Down===a||g.EventKeyCode.Insert===a||g.EventKeyCode.Home=== a||g.EventKeyCode.PageUp===a)v=k[0];else if(g.EventKeyCode.Up===a||g.EventKeyCode.End===a||g.EventKeyCode.PageDown===a)v=k[k.length-1];v?(q&&(b?(g.EventKeyCode.Up===a||g.EventKeyCode.Down===a)&&q.checked(!q.checked()):g.EventKeyCode.Insert===a&&q.checked(!q.checked())),this.throttleSelection=!0,this.selectedItem(v),this.throttleSelection=!0,0!==this.iSelectTimer?(h.clearTimeout(this.iSelectTimer),this.iSelectTimer=h.setTimeout(function(){c.iSelectTimer=0;c.actionClick(v)},1E3)):(this.iSelectTimer= h.setTimeout(function(){c.iSelectTimer=0},200),this.actionClick(v)),this.scrollToSelected()):q&&(b&&(g.EventKeyCode.Up===a||g.EventKeyCode.Down===a)?q.checked(!q.checked()):g.EventKeyCode.Insert===a&&q.checked(!q.checked()))};L.prototype.scrollToSelected=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var a=j(this.sItemSelectedSelector,this.oContentScrollable),b=a.position(),c=this.oContentVisible.height(),a=a.outerHeight();return b&&(0>b.top||b.top+a>c)?(0>b.top?this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+ b.top-20):this.oContentScrollable.scrollTop(this.oContentScrollable.scrollTop()+b.top-c+a+20),!0):!1};L.prototype.eventClickFunction=function(a,b){var c=this.getItemUid(a),d=0,e=0,f=null,g="",k=!1,i=!1,h=[],j=!1;if(b&&b.shiftKey&&""!==c&&""!==this.sLastUid&&c!==this.sLastUid){h=this.list();j=a.checked();d=0;for(e=h.length;d").addClass("rl-view-model").addClass("RL-"+c.viewModelTemplate()).hide().attr("data-bind",'template: {name: "'+c.viewModelTemplate()+'"}, i18nInit: true'),t.appendTo(g),c.viewModelDom=t,a.__dom=t,"Popups"===l&&(c.cancelCommand=c.closeCommand=d.createCommand(c,function(){p.hideScreenPopup(a)})),x.runHook("view-model-pre-build",[a.__name,c,t]),f.applyBindings(c,t[0]),this.delegateRun(c,"onBuild",[t]),x.runHook("view-model-post-build",[a.__name,c,t])):d.log("Cannot find view model position: "+ l)}return a?a.__vm:null};E.prototype.applyExternal=function(a,b){a&&b&&f.applyBindings(a,b)};E.prototype.hideScreenPopup=function(a){a&&(a.__vm&&a.__dom)&&(a.__dom.hide(),a.__vm.modalVisibility(!1),this.delegateRun(a.__vm,"onHide"),this.popupVisibility(!1),i.defer(function(){a.__dom.find(".ko-select2").select2("close")}))};E.prototype.showScreenPopup=function(a,b){a&&(this.buildViewModel(a),a.__vm&&a.__dom&&(a.__dom.show(),a.__vm.modalVisibility(!0),this.delegateRun(a.__vm,"onShow",b||[]),this.popupVisibility(!0), x.runHook("view-model-on-show",[a.__name,a.__vm,b||[]])))};E.prototype.screenOnRoute=function(a,b){var c=this,e=null,f=null;""===d.pString(a)&&(a=this.sDefaultScreenName);if(""!==a){e=this.screen(a);if(!e&&(e=this.screen(this.sDefaultScreenName)))b=a+"/"+b,a=this.sDefaultScreenName;e&&e.__started&&(e.__builded||(e.__builded=!0,d.isNonEmptyArray(e.viewModels())&&i.each(e.viewModels(),function(a){this.buildViewModel(a,e)},this),this.delegateRun(e,"onBuild")),i.defer(function(){if(c.oCurrentScreen){c.delegateRun(c.oCurrentScreen, "onHide");d.isNonEmptyArray(c.oCurrentScreen.viewModels())&&i.each(c.oCurrentScreen.viewModels(),function(a){if(a.__vm&&a.__dom&&"Popups"!==a.__vm.viewModelPosition()){a.__dom.hide();a.__vm.viewModelVisibility(false);c.delegateRun(a.__vm,"onHide")}})}c.oCurrentScreen=e;if(c.oCurrentScreen){c.delegateRun(c.oCurrentScreen,"onShow");x.runHook("screen-on-show",[c.oCurrentScreen.screenName(),c.oCurrentScreen]);d.isNonEmptyArray(c.oCurrentScreen.viewModels())&&i.each(c.oCurrentScreen.viewModels(),function(a){if(a.__vm&& a.__dom&&"Popups"!==a.__vm.viewModelPosition()){a.__dom.show();a.__vm.viewModelVisibility(true);c.delegateRun(a.__vm,"onShow");x.runHook("view-model-on-show",[a.__name,a.__vm])}},c)}(f=e.__cross())&&f.parse(b)}))}};E.prototype.startScreens=function(a){i.each(a,function(a){var c=(a=new a)?a.screenName():"";a&&""!==c&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=c),this.oScreens[c]=a)},this);i.each(this.oScreens,function(a){a&&(!a.__started&&a.__start)&&(a.__started=!0,a.__start(),x.runHook("screen-pre-start", [a.screenName(),a]),this.delegateRun(a,"onStart"),x.runHook("screen-post-start",[a.screenName(),a]))},this);a=Ya.create();a.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this));Q.initialized.add(a.parse,a);Q.changed.add(a.parse,a);Q.init()};E.prototype.setHash=function(a,b){a="#"===a.substr(0,1)?a.substr(1):a;a="/"===a.substr(0,1)?a.substr(1):a;(d.isUnd(b)?0:b)?(Q.changed.active=!1,Q.setHash(a),Q.changed.active=!0):(Q.changed.active=!0,Q.setHash(a))};E.prototype.bootstart=function(){this.oBoot&& this.oBoot.bootstart&&this.oBoot.bootstart();return this};p=new E;F.newInstanceFromJson=function(a){var b=new F;return b.initByJson(a)?b:null};F.prototype.name="";F.prototype.email="";F.prototype.privateType=null;F.prototype.validate=function(){return""!==this.name||""!==this.email};F.prototype.hash=function(a){return"#"+(a?"":this.name)+"#"+this.email+"#"};F.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")};F.prototype.type=function(){if(null===this.privateType&&(this.email&& "@facebook.com"===this.email.substr(-13)&&(this.privateType=g.EmailType.Facebook),null===this.privateType))this.privateType=g.EmailType.Default;return this.privateType};F.prototype.search=function(a){return-1<(this.name+" "+this.email).toLowerCase().indexOf(a.toLowerCase())};F.prototype.parse=function(a){var a=d.trim(a),b=/(?:"([^"]+)")? ?,]+)>?,? ?/g.exec(a);b?(this.name=b[1]||"",this.email=b[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(a)&&(this.name="",this.email=a)};F.prototype.initByJson= function(a){var b=!1;a&&"Object/Email"===a["@Object"]&&(this.name=d.trim(a.Name),this.email=d.trim(a.Email),b=""!==this.email,this.clearDuplicateName());return b};F.prototype.toLine=function(a,b){var c="";""!==this.email&&(b=d.isUnd(b)?!1:!!b,a&&""!==this.name?c=b?'")+'" target="_blank" tabindex="-1">'+d.encodeHtml(this.name)+"":this.name:(c=this.email,""!==this.name?c=b?d.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+d.encodeHtml(c)+""+d.encodeHtml(">"):'"'+this.name+'" <'+c+">":b&&(c=''+d.encodeHtml(this.email)+"")));return c};F.prototype.select2Result=function(){var a="",b=e.cache().getUserPic(this.email),a=""!==b?a+(''):a+('');g.EmailType.Facebook===this.type()?(a+=""+(0'):a+=""+(0('+this.name+")":this.email);return a+""};F.prototype.select2Selection=function(a){var b="";if(g.EmailType.Facebook===this.type()){if(b=0").text(b).appendTo(a),a.append(''), null}else b=0+$/, ""),b=!0);return b};D.prototype.isImage=function(){return-1+$/,""),b=i.find(c,function(b){return a===b.cidWithOutTags}));return b||null};m.prototype.messageId=function(){return this.sMessageId};m.prototype.inReplyTo=function(){return this.sInReplyTo};m.prototype.references=function(){return this.sReferences};m.prototype.fromAsSingleEmail=function(){return d.isArray(this.from)&& this.from[0]?this.from[0].email:""};m.prototype.viewLink=function(){return e.link().messageViewLink(this.requestHash)};m.prototype.downloadLink=function(){return e.link().messageDownloadLink(this.requestHash)};m.prototype.replyEmails=function(a){var b=[],a=d.isUnd(a)?{}:a;m.replyHelper(this.replyTo,a,b);0===b.length&&m.replyHelper(this.from,a,b);return b};m.prototype.replyAllEmails=function(a){var b=[],c=[],a=d.isUnd(a)?{}:a;m.replyHelper(this.replyTo,a,b);0===b.length&&m.replyHelper(this.from,a, b);m.replyHelper(this.to,a,b);m.replyHelper(this.cc,a,c);return[b,c]};m.prototype.textBodyToString=function(){return this.body?this.body.html():""};m.prototype.attachmentsToStringLine=function(){var a=i.map(this.attachments(),function(a){return a.fileName+" ("+a.friendlySize+")"});return a&&0
"+k+":

"+q+"
";break;case g.ComposeType.Forward:X=r.fromToLine(!1,!0);t=r.toToLine(!1,!0);v=r.ccToLine(!1,!0);q="


"+ d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+X+"
"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+t+(0"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+v:"")+"
"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+d.encodeHtml(k)+"
"+d.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+d.encodeHtml(h)+"

"+q;break;case g.ComposeType.ForwardAsAttachment:q=""}this.oEditor.setRawText(q,r.isHtml)}}else this.oEditor&& g.ComposeType.Empty===a?this.oEditor.setRawText("
"+d.convertPlainTextToHtml(e.data().signature()),g.EditorDefaultType.Html===e.data().editorDefaultType()):d.isNonEmptyArray(b)&&i.each(b,function(a){f.addMessageAsAttachment(a)});r=this.getAttachmentsDownloadsForUpload();d.isNonEmptyArray(r)&&e.remote().messageUploadAttachments(function(a,b){if(g.StorageResultType.Success===a&&b&&b.Result){var c=null,d="";if(!f.viewModelVisibility())for(d in b.Result)b.Result.hasOwnProperty(d)&&(c=f.getAttachmentById(b.Result[d]))&& c.tempName(d)}else f.setMessageAttachmentFailedDowbloadText()},r);m&&this.oEditor&&this.oEditor.focus();this.triggerForResize()};y.prototype.onBuild=function(){this.initEditor();this.initUploader();var a=this,b=null;O.on("keydown",function(b){var d=!0;b&&(a.modalVisibility()&&e.data().useKeyboardShortcuts())&&(b.ctrlKey&&g.EventKeyCode.S===b.keyCode?(a.saveCommand(),d=!1):b.ctrlKey&&g.EventKeyCode.Enter===b.keyCode&&(a.sendCommand(),d=!1));return d});O.on("resize",function(){a.triggerForResize()}); this.dropboxEnabled()&&(b=document.createElement("script"),b.type="text/javascript",b.src="https://www.dropbox.com/static/api/1/dropins.js",j(b).attr("id","dropboxjs").attr("data-app-key",e.settingsGet("DropboxApiKey")),document.body.appendChild(b))};y.prototype.getAttachmentById=function(a){for(var b=this.attachments(),c=0,d=b.length;c').hide(),d.isNormal(a.Result.Html)&&""!==a.Result.Html?(c=!0,h.html(a.Result.Html.toString()).addClass("b-text-part html")):d.isNormal(a.Result.Plain)&&""!==a.Result.Plain?(c=!1,h.html(a.Result.Plain.toString()).addClass("b-text-part plain")):c=!1,i.append(h),h.data("rl-is-html",c),h.data("rl-has-images",f),k.isHtml(h.data("rl-is-html")),k.hasImages(h.data("rl-has-images")),k.body=h,g&&k.showInternalImages(!0),k.hasImages()&&this.showImages()&&k.showExternalImages(!0)): (k.isHtml(f.data("rl-is-html")),k.hasImages(f.data("rl-has-images")),k.body=f),this.messageActiveDom(k.body),this.hideMessageBodies(),k.body.show(),h&&d.initBlockquoteSwitcher(h);e.cache().initMessageFlagsFromCache(k);k.unseen()&&e.setMessageSeen(k);d.windowResize()}};T.prototype.setMessageList=function(a,b){if(a&&a.Result&&"Collection/MessageCollection"===a.Result["@Object"]&&a.Result["@Collection"]&&d.isArray(a.Result["@Collection"])){var c=e.data(),f=e.cache(),h=null,i=0,j=0,k=0,p=0,q=[],n=c.staticMessageList, r=null,H=null,o=null,s=0,u=!1,k=d.pInt(a.Result.MessageResultCount),p=d.pInt(a.Result.Offset);d.isNonEmptyArray(a.Result.LastCollapsedThreadUids)&&(h=a.Result.LastCollapsedThreadUids);if((o=e.cache().getFolderFromCacheList(d.isNormal(a.Result.Folder)?a.Result.Folder:""))&&!b)e.cache().setFolderHash(a.Result.Folder,a.Result.FolderHash),d.isNormal(a.Result.MessageCount)&&o.messageCountAll(a.Result.MessageCount),d.isNormal(a.Result.MessageUnseenCount)&&(d.pInt(o.messageCountUnread())!==d.pInt(a.Result.MessageUnseenCount)&& (u=!0),o.messageCountUnread(a.Result.MessageUnseenCount)),this.initUidNextAndNewMessages(o.fullNameRaw,a.Result.UidNext,a.Result.NewMessages);u&&o&&e.cache().clearMessageFlagsFromCacheByFolder(o.fullNameRaw);i=0;for(j=a.Result["@Collection"].length;i=s&&(s++,H.newForAnimation(!0)),H.deleted(!1),b?e.cache().initMessageFlagsFromCache(H): e.cache().storeMessageFlagsToCache(H),H.lastInCollapsedThread(h&&-1(new h.Date).getTime()-k);q&&t.oRequests[q]&&(t.oRequests[q].__aborted&&(e="abort"),t.oRequests[q]= null);t.defaultResponse(a,q,e,c,f,b)});q&&(0").addClass("rl-settings-view-model").hide().attr("data-bind",'template: {name: "'+g.__rlSettingsData.Template+'"}, i18nInit: true'),t.appendTo(h),c.data=e.data(),c.viewModelDom=t,c.__rlSettingsData= g.__rlSettingsData,g.__dom=t,g.__builded=!0,g.__vm=c,f.applyBindings(c,t[0]),p.delegateRun(c,"onBuild",[t])):d.log("Cannot find sub settings view model position: SettingsSubScreen"),c&&i.defer(function(){if(b.oCurrentSubScreen){p.delegateRun(b.oCurrentSubScreen,"onHide");b.oCurrentSubScreen.viewModelDom.hide()}b.oCurrentSubScreen=c;if(b.oCurrentSubScreen){b.oCurrentSubScreen.viewModelDom.show();p.delegateRun(b.oCurrentSubScreen,"onShow");i.each(b.menu(),function(a){a.selected(c&&c.__rlSettingsData&& a.route===c.__rlSettingsData.Route)})}d.windowResize()}))};ha.prototype.onBuild=function(){i.each(Ha,function(a){a&&(a.__rlSettingsData&&!i.find(Va,function(b){return b&&b===a}))&&this.menu.push({route:a.__rlSettingsData.Route,label:a.__rlSettingsData.Label,selected:f.observable(!1),disabled:!!i.find(Wa,function(b){return b&&b===a})})},this)};ha.prototype.routes=function(){var a=i.find(Ha,function(a){return a&&a.__rlSettingsData&&a.__rlSettingsData.IsDefault}),b=a?a.__rlSettingsData.Route:"general", a={subname:/^(.*)$/,normalize_:function(a,e){e.subname=d.isUnd(e.subname)?b:d.pString(e.subname);return[e.subname]}};return[["{subname}/",a],["{subname}",a],["",a]]};i.extend(Ca.prototype,K.prototype);Ca.prototype.onShow=function(){e.setTitle(d.i18n("TITLES/LOGIN"))};i.extend(V.prototype,K.prototype);V.prototype.oLastRoute={};V.prototype.onShow=function(){var a=e.data().accountEmail();e.setTitle((""===a?"":a+" - ")+d.i18n("TITLES/MAILBOX"));this.mailBoxScreenVisibily(!0)};V.prototype.onHide=function(){this.mailBoxScreenVisibily(!1)}; V.prototype.onRoute=function(a,b,c){var d=e.data(),a=e.cache().getFolderFullNameRaw(a);if(a=e.cache().getFolderFromCacheList(a))d.currentFolder(a).messageListPage(b).messageListSearch(c),!d.usePreviewPane()&&d.message()&&d.message(null),e.reloadMessageList()};V.prototype.onStart=function(){var a=e.data(),b=function(){d.windowResize()};e.settingsGet("AllowAdditionalAccounts")&&e.accounts();i.delay(function(){e.quota()},5E3);i.delay(function(){"INBOX"!==a.currentFolderFullNameRaw()&&e.folderInformation("INBOX")}, 1E3);i.delay(function(){var b=e.data().spamFolder();b!==a.currentFolderFullNameRaw()&&e.folderInformation(b)},1500);i.delay(function(){var b=e.data().draftFolder();b!==a.currentFolderFullNameRaw()&&e.folderInformation(b)},2E3);i.delay(function(){e.remote().appDelayStart(d.emptyFunction)},35E3);h.setInterval(function(){e.folderInformation("INBOX")},12E4);h.setInterval(function(){e.quota()},3E5);aa.toggleClass("rl-no-preview-pane",!a.usePreviewPane());a.folderList.subscribe(b);a.messageList.subscribe(b); a.message.subscribe(b);a.usePreviewPane.subscribe(function(b){aa.toggleClass("rl-no-preview-pane",!b);a.messageList.valueHasMutated()})};V.prototype.onBuild=function(){i.defer(i.bind(function(){d.initLayoutResizer("#rl-resizer-left","#rl-resizer-right","#rl-right",this.resizeTrigger)},this))};V.prototype.routes=function(){var a=function(a,c){c[0]=d.pString(c[0]);c[1]=d.pInt(c[1]);c[1]=0>=c[1]?1:c[1];c[2]=d.pString(c[2]);""===a&&(c[0]="Inbox",c[1]=1);return[decodeURI(c[0]),c[1],decodeURI(c[2])]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/, {normalize_:a}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/?$/,{normalize_:a}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:function(a,c){c[0]=d.pString(c[0]);c[1]=d.pString(c[1]);""===a&&(c[0]="Inbox");return[decodeURI(c[0]),1,decodeURI(c[1])]}}],[/^([^\/]*)$/,{normalize_:a}]]};i.extend(Ra.prototype,ha.prototype);Ra.prototype.onShow=function(){e.setTitle(this.sSettingsTitle)};i.extend(J.prototype,Za.prototype);J.prototype.oSettings=null;J.prototype.oLink=null;J.prototype.download=function(a){ba?this.iframe.attr("src", a):h.open(a)};J.prototype.link=function(){null===this.oLink&&(this.oLink=new B);return this.oLink};J.prototype.local=function(){null===this.oLocal&&(this.oLocal=new wa);return this.oLocal};J.prototype.settingsGet=function(a){null===this.oSettings&&(this.oSettings=d.isNormal(Fa)?Fa:{});return d.isUnd(this.oSettings[a])?null:this.oSettings[a]};J.prototype.settingsSet=function(a,b){null===this.oSettings&&(this.oSettings=d.isNormal(Fa)?Fa:{});this.oSettings[a]=b};J.prototype.setTitle=function(a){a=(0< a.length?a+" - ":"")+this.settingsGet("Title")||"";a!==h.document.title&&(h.document.title=a)};J.prototype.loginAndLogoutReload=function(a,b){var c=d.pString(this.settingsGet("CustomLogoutLink")),f=!!this.settingsGet("InIframe"),a=d.isUnd(a)?!1:!!a,b=d.isUnd(b)?!1:!!b;a&&(b&&h.close)&&h.close();a&&""!==c&&h.location.href!==c?i.defer(function(){f&&h.parent?h.parent.location.href=c:h.location.href=c}):(p.routeOff(),p.setHash(e.link().root(),!0),p.routeOff(),i.defer(function(){f&&h.parent?h.parent.location.reload(): h.location.reload()}))};J.prototype.getAutocomplete=function(a,b,c){c([],a)};J.prototype.bootstart=function(){d.initOnStartOrLangChange(function(){d.initNotificationLanguage()},null);i.delay(function(){d.windowResize()},1E3)};i.extend(A.prototype,J.prototype);A.prototype.oData=null;A.prototype.oRemote=null;A.prototype.oCache=null;A.prototype.data=function(){null===this.oData&&(this.oData=new T);return this.oData};A.prototype.remote=function(){null===this.oRemote&&(this.oRemote=new o);return this.oRemote}; A.prototype.cache=function(){null===this.oCache&&(this.oCache=new w);return this.oCache};A.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){var a=e.cache();i.each(e.data().messageList(),function(b){a.initMessageFlagsFromCache(b)});a.initMessageFlagsFromCache(e.data().message())};A.prototype.reloadMessageList=function(a,b){var c=e.data(),f=(c.messageListPage()-1)*c.messagesPerPage();(d.isUnd(b)?0:b)&&e.cache().setFolderHash(c.currentFolderFullNameRaw(),"");if(d.isUnd(a)?0:a)c.messageListPage(1), f=0;c.messageListLoading(!0);e.remote().messageList(function(a,b,e){g.StorageResultType.Success===a&&b&&b.Result?(c.messageListError(""),c.messageListLoading(!1),c.setMessageList(b,e)):g.StorageResultType.Unload===a?(c.messageListError(""),c.messageListLoading(!1)):g.StorageResultType.Abort!==a&&(c.messageList([]),c.messageListLoading(!1),c.messageListError(b&&b.ErrorCode?d.getNotification(b.ErrorCode):d.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST")))},c.currentFolderFullNameRaw(),f,c.messagesPerPage(), c.messageListSearch())};A.prototype.recacheInboxMessageList=function(){e.remote().messageList(d.emptyFunction,"INBOX",0,e.data().messagesPerPage(),"",!0)};A.prototype.folders=function(a,b){this.data().foldersLoading(!0);this.remote().folders(i.bind(function(a,d,f){e.data().foldersLoading(!1);g.StorageResultType.Success===a?(this.data().setFolders(d,f),b&&b(!0)):b&&b(!1)},this),a)};A.prototype.accounts=function(){e.data().accountsLoading(!0);e.remote().accounts(function(a,b){e.data().accountsLoading(!1); if(g.StorageResultType.Success===a&&d.isArray(b.Result)){var c=e.settingsGet("ParentEmail"),c=""===c?e.data().accountEmail():c;e.data().accounts(i.map(b.Result,function(a){return new Na(a,a!==c)}))}})};A.prototype.quota=function(){this.remote().quota(function(a,b){g.StorageResultType.Success===a&&(b&&b.Result&&d.isArray(b.Result)&&2===b.Result.length&&d.isPosNumeric(b.Result[0],!0)&&d.isPosNumeric(b.Result[1],!0))&&(e.data().userQuota(1024*d.pInt(b.Result[1])),e.data().userUsageSize(1024*d.pInt(b.Result[0])))})}; A.prototype.folderInformation=function(a,b){this.remote().folderInformation(function(a,b){if(g.StorageResultType.Success===a&&b&&b.Result&&b.Result.Hash&&b.Result.Folder){var f=e.cache().getFolderHash(b.Result.Folder),h=e.cache().getFolderFromCacheList(b.Result.Folder),i=!1,j="",m=[],m=!1,q=null;if(h){b.Result.Hash&&e.cache().setFolderHash(b.Result.Folder,b.Result.Hash);d.isNormal(b.Result.MessageCount)&&h.messageCountAll(b.Result.MessageCount);d.isNormal(b.Result.MessageUnseenCount)&&(d.pInt(h.messageCountUnread())!== d.pInt(b.Result.MessageUnseenCount)&&(m=!0),h.messageCountUnread(b.Result.MessageUnseenCount));m&&e.cache().clearMessageFlagsFromCacheByFolder(h.fullNameRaw);if(b.Result.Flags){for(j in b.Result.Flags)b.Result.Flags.hasOwnProperty(j)&&(i=!0,q=b.Result.Flags[j],e.cache().storeMessageFlagsToCacheByFolderAndUid(h.fullNameRaw,j.toString(),[!q.IsSeen,!!q.IsFlagged,!!q.IsAnswered,!!q.IsForwarded]));i&&e.reloadFlagsCurrentMessageListAndMessageFromCache()}e.data().initUidNextAndNewMessages(h.fullNameRaw, b.Result.UidNext,b.Result.NewMessages);b.Result.Hash!==f||""===f?h.fullNameRaw===e.data().currentFolderFullNameRaw()?e.reloadMessageList():"INBOX"===h.fullNameRaw&&e.recacheInboxMessageList():m&&h.fullNameRaw===e.data().currentFolderFullNameRaw()&&(m=e.data().messageList(),d.isNonEmptyArray(m)&&e.folderInformation(h.fullNameRaw,m))}}},a,b)};A.prototype.setMessageSeen=function(a){if(a.unseen()){a.unseen(!1);var b=e.cache().getFolderFromCacheList(a.folderFullNameRaw);b&&b.messageCountUnread(0<=b.messageCountUnread()- 1?b.messageCountUnread()-1:0);e.cache().storeMessageFlagsToCache(a);e.reloadFlagsCurrentMessageListAndMessageFromCache()}e.remote().messageSetSeen(d.emptyFunction,a.folderFullNameRaw,[a.uid],!0)};A.prototype.googleConnect=function(){h.open(e.link().socialGoogle(),"Google","left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes")};A.prototype.twitterConnect=function(){h.open(e.link().socialTwitter(),"Twitter","left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes")}; A.prototype.facebookConnect=function(){h.open(e.link().socialFacebook(),"Facebook","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes")};A.prototype.socialUsers=function(a){var b=e.data();a&&(b.googleActions(!0),b.facebookActions(!0),b.twitterActions(!0));e.remote().socialUsers(function(a,d){if(g.StorageResultType.Success===a&&d&&d.Result){b.googleUserName(d.Result.Google||"");b.facebookUserName(d.Result.Facebook||"");b.twitterUserName(d.Result.Twitter||"")}else{b.googleUserName(""); b.facebookUserName("");b.twitterUserName("")}b.googleLoggined(""!==b.googleUserName());b.facebookLoggined(""!==b.facebookUserName());b.twitterLoggined(""!==b.twitterUserName());b.googleActions(false);b.facebookActions(false);b.twitterActions(false)})};A.prototype.googleDisconnect=function(){e.data().googleActions(!0);e.remote().googleDisconnect(function(){e.socialUsers()})};A.prototype.facebookDisconnect=function(){e.data().facebookActions(!0);e.remote().facebookDisconnect(function(){e.socialUsers()})}; A.prototype.twitterDisconnect=function(){e.data().twitterActions(!0);e.remote().twitterDisconnect(function(){e.socialUsers()})};A.prototype.folderListOptionsBuilder=function(a,b,c,f,i,j,m,k,p,q){var o=0,r=0,n=null,s=[],p=!d.isNormal(p)?0