/home/ivoiecob/email.hirewise-va.com/static/js/8611.app.95cee7c673d22ba6d80a.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[8611],{"0HIo":(e,t,s)=>{var i=s("p09A"),o=s("ERH9");function n(e){this.iAccountId=e,this.enable=i.observable(!0).extend({reversible:!0}),this.field=i.observable("").extend({reversible:!0}),this.condition=i.observable("").extend({reversible:!0}),this.filter=i.observable("").extend({reversible:!0}),this.action=i.observable("").extend({reversible:!0}),this.folder=i.observable("").extend({reversible:!0}),this.email=i.observable("").extend({reversible:!0})}n.prototype.parse=function(e){this.enable(!!e.Enable),this.field(o.pInt(e.Field)),this.condition(o.pInt(e.Condition)),this.filter(o.pString(e.Filter)),this.action(o.pInt(e.Action)),this.folder(o.pString(e.FolderFullName)),this.email(o.pString(e.Email)),this.commit()},n.prototype.revert=function(){this.enable.revert(),this.field.revert(),this.condition.revert(),this.filter.revert(),this.action.revert(),this.folder.revert(),this.email.revert()},n.prototype.commit=function(){this.enable.commit(),this.field.commit(),this.condition.commit(),this.filter.commit(),this.action.commit(),this.folder.commit(),this.email.commit()},n.prototype.toString=function(){return[this.enable(),this.field(),this.condition(),this.filter(),this.action(),this.folder(),this.email()].join(":")},e.exports=n},"1uL4":(e,t,s)=>{var i=s("M4cL"),o=s("a7T2"),n=s("p09A"),r=s("rBrp"),a=s("LKDt"),l=s("5D2l"),h=s("PMEU"),d=s("MYiO"),c=s("yHWv");function u(){this.recipientsInfo=n.observable({}),this.autoEncryptSignMessage=n.observable(!1)}u.prototype.setAutoEncryptSubscribes=function(){this.hasRecipientsWithKey=n.computed(function(){return!!o.find(this.recipientsInfo(),function(e){return e.hasKey&&(e.encryptMessage||e.signMessage)&&-1!==o.indexOf(this.recipientEmails(),e.email)}.bind(this))},this).extend({throttle:10}),this.allowAtoEncryptSignMessage=n.computed(function(){return this.hasRecipientsWithKey()&&!this.messageSignedOrEncrypted()},this),this.allowAtoEncryptSignMessage.subscribe(function(){this.autoEncryptSignMessage(this.allowAtoEncryptSignMessage())},this),this.recipientEmails.subscribe(function(){var e=o.keys(this.recipientsInfo()),t=o.difference(this.recipientEmails(),e);t.length>0&&l.run("ContactsWebclient","getContactsByEmails",[t,function(e){o.each(o.values(e),function(e){e&&(this.recipientsInfo()[e.email()]={email:e.email(),encryptMessage:e.pgpEncryptMessages(),hasKey:"string"==typeof e.publicPgpKey()&&""!==e.publicPgpKey(),id:e.uuid(),label:e.email(),name:e.displayName(),sharedToAll:e.sharedToAll(),signMessage:e.pgpSignMessages(),storage:e.storage(),team:e.team(),value:e.email()})}.bind(this)),i(this.toAddrDom()).inputosaurus("refresh"),i(this.ccAddrDom()).inputosaurus("refresh"),i(this.bccAddrDom()).inputosaurus("refresh"),this.recipientsInfo.valueHasMutated()}.bind(this)])},this)},u.prototype.getInputosaurusMethods=function(){return{addRecipientInfo:function(e){var t=r.getEmailParts(e.value);this.recipientsInfo()[t.email]=e,this.recipientsInfo.valueHasMutated()}.bind(this),getRecipientPgpKeyHtml:function(e){var t=r.getEmailParts(e),s=this.recipientsInfo()[t.email],i="";return!!s&&!!s.hasKey&&(i+='<span class="address_capsule_key address_capsule_key_unset"></span>',s.encryptMessage?i+='<span class="address_capsule_key address_capsule_key_encrypt" title="'+a.i18n("MAILWEBCLIENT/HINT_MESSAGE_ENCRYPT_WITH_KEY")+'"></span>':i+='<span class="address_capsule_key address_capsule_key_not_encrypt"></span>',s.signMessage&&(i+='<span class="address_capsule_key address_capsule_key_sign" title="'+a.i18n("MAILWEBCLIENT/HINT_MESSAGE_SIGN_WITH_KEY")+'"></span>')),i}.bind(this)}},u.prototype.groupAllRecipients=function(e){var t=[],s=[],i=[],n=[],r=[],a=[],l=0;return o.each(e,function(e){var o=this.recipientsInfo()[e];o&&o.hasKey?o.encryptMessage?o.signMessage?(n.push(e),a.push(o.uuid)):(s.push(e),r.push(o.uuid)):o.signMessage?i.push(e):t.push(e):t.push(e)}.bind(this)),t.length>0&&l++,s.length>0&&l++,i.length>0&&l++,n.length>0&&l++,{simple:t,encrypt:s,sign:i,signEncrypt:n,encryptContactsUuids:r,signEncryptContactsUuids:a,simpleCount:t.length,encryptCount:s.length,signCount:i.length,signEncryptCount:n.length,groupCount:l}},u.prototype.confirmNotAllRecipientsEncryptSign=function(e,t){var s=null;e.simpleCount>0?e.encryptCount>0||e.signEncryptCount>0?s=a.i18n("MAILWEBCLIENT/CONFIRM_ENCRYPT_NOT_ALL_RECIPIENTS"):e.signCount>0&&(s=a.i18n("MAILWEBCLIENT/CONFIRM_SIGN_NOT_ALL_RECIPIENTS")):e.signCount>0&&(e.encryptCount>0||e.signEncryptCount>0)?s=a.i18n("MAILWEBCLIENT/CONFIRM_ENCRYPT_NOT_ALL_RECIPIENTS"):0===e.signCount&&e.encryptCount>0&&e.signEncryptCount>0&&(s=a.i18n("MAILWEBCLIENT/CONFIRM_SIGN_NOT_ALL_RECIPIENTS")),null!==s?h.showPopup(d,[s,t,"",a.i18n("MAILWEBCLIENT/ACTION_PROCEED_SENDING")]):t(!0)},u.prototype.proceedEncryptSignAndSend=function(e,t,s){var i=this.oHtmlEditor.getPlainText(),n=this.getSendSaveParameters(!0),r=[],a=function(e,t,s,i){var r=o.clone(n);r.Text=s,r.IsHtml=!1,r.Recipients=e,h(r,t)},h=o.bind(function(t,s){r.push({oSendParameters:t,bAddToSentFolder:s}),r.length===e.groupCount&&(this.sending(!0),this.requiresPostponedSending(!this.allowStartSending()),this.backToListOnSendOrSave(!0),o.each(r,function(e){c.send("SendMessage",e.oSendParameters,!0,this.onSendOrSaveMessageResponse,this,this.requiresPostponedSending(),e.bAddToSentFolder)}.bind(this)))},this);if(e.simpleCount>0){var d=o.clone(n);d.Recipients=e.simple,h(d,0===e.signCount&&0===e.encryptCount&&0===e.signEncryptCount)}e.signCount>0&&l.run("OpenPgpWebclient","encryptSign",[!1,!0,i,e.sign,[],a.bind(this,e.sign,0===e.encryptCount&&0===e.signEncryptCount),t,s]),e.encryptContactsUuids.length,e.encryptCount>0&&l.run("OpenPgpWebclient","encryptSign",[!0,!1,i,e.encrypt,e.encryptContactsUuids,a.bind(this,e.encrypt,0===e.signEncryptCount),t]),e.signEncryptCount>0&&l.run("OpenPgpWebclient","encryptSign",[!0,!0,i,e.signEncrypt,e.signEncryptContactsUuids,a.bind(this,e.signEncrypt,!0),t,s])},u.prototype.encryptSignAndSend=function(){var e=this.selectedFetcherOrIdentity().email(),t=this.recipientEmails(),s=this.groupAllRecipients(t);this.confirmNotAllRecipientsEncryptSign(s,function(t){t&&(s.signCount>0||s.signEncryptCount>0?l.run("OpenPgpWebclient","getPrivateKeyPassword",[e,function(t){this.proceedEncryptSignAndSend(s,e,t)}.bind(this)]):this.proceedEncryptSignAndSend(s,e))}.bind(this))},e.exports=u},"3boL":(e,t,s)=>{function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var s={}.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,i=Array(t);s<t;s++)i[s]=e[s];return i}var n=s("a7T2"),r=s("M4cL"),a=s("p09A"),l=s("LKDt"),h=s("ERH9"),d=s("yU9o"),c=s("zVyH"),u=s("LIBG"),p=s("P7bQ");function m(e){this.iAccountId=e||d.currentAccountId(),this.folderName=a.observable(""),this.messageUid=a.observable(""),this.cid=a.observable(""),this.contentLocation=a.observable(""),this.inline=a.observable(!1),this.linked=a.observable(!1),this.mimePartIndex=a.observable(""),this.messagePart=a.observable(null),u.call(this),this.cancelButtonTooltip=l.i18n("COREWEBCLIENT/ACTION_REMOVE"),this.content=a.observable(""),this.isMessageType=a.computed(function(){return this.mimeType(),this.mimePartIndex(),"message/rfc822"===this.mimeType()},this)}n.extendOwn(m.prototype,u.prototype),m.prototype.getNewInstance=function(){return new m(this.iAccountId)},m.prototype.getCopy=function(){var e=new m(this.iAccountId);return e.copyProperties(this),e},m.prototype.copyProperties=function(e){this.folderName(e.folderName()),this.messageUid(e.messageUid()),this.cid(e.cid()),this.contentLocation(e.contentLocation()),this.inline(e.inline()),this.linked(e.linked()),this.mimePartIndex(e.mimePartIndex()),this.messagePart(e.messagePart()),this.content(e.content()),this.fileName(e.fileName()),this.tempName(e.tempName()),this.size(e.size()),this.hash(e.hash()),this.mimeType(e.mimeType()),this.thumbnailSrc(e.thumbnailSrc()),this.thumbnailLoaded(e.thumbnailLoaded()),this.statusText(e.statusText()),this.uploaded(e.uploaded()),this.oActionsData=Object.assign({},e.oActionsData),this.actions(i(e.actions())),this.thumbUrlInQueue(e.thumbUrlInQueue()),this.subFilesExpanded(e.subFilesExpanded()),this.subFiles(i(e.subFiles())),d.broadcastEvent("MailWebclient::CopyFileProperties::after",{file:this,source:e})},m.prototype.additionalParse=function(e){this.content(h.pString(e.Content)),this.mimePartIndex(h.pString(e.MimePartIndex)),this.isMessageType()&&""===this.mimePartIndex()&&this.actions(n.without(this.actions(),"view")),this.cid(h.pString(e.CID)),this.contentLocation(h.pString(e.ContentLocation)),this.inline(!!e.IsInline),this.linked(!!e.IsLinked),d.broadcastEvent("MailWebclient::ParseFile::after",this)},m.prototype.setMessageData=function(e,t){this.folderName(e),this.messageUid(t)},m.prototype.onGetMessageResponse=function(e,t){var i=t.Parameters,o=(e=e.Result,new(s("WzKm")));e&&this.oNewWindow&&(e.TimeStampInUTC=e.ReceivedOrDateTimeStampInUTC,o.parse(e,i.AccountID,!1,!0),this.messagePart(o),this.messagePart().viewMessage(this.oNewWindow),this.oNewWindow=void 0)},m.prototype.viewFile=function(){this.isMessageType()?this.viewMessageFile():this.viewCommonFile()},m.prototype.viewMessageFile=function(){var e=null,t='<div style="margin: 30px; text-align: center; font: normal 14px Tahoma;">'+l.i18n("COREWEBCLIENT/INFO_LOADING")+"</div>";(e=c.open("",this.fileName()))&&(this.messagePart()?this.messagePart().viewMessage(e):(r(e.document.body).html(t),this.oNewWindow=e,p.send("GetMessage",{AccountID:this.iAccountId,Folder:this.folderName(),Uid:this.messageUid(),Rfc822MimeIndex:this.mimePartIndex()},this.onGetMessageResponse,this)),e.focus())},m.prototype.fillDataAfterUploadComplete=function(e,t){this.cid(h.pString(t)),e&&e.Result&&e.Result.Attachment&&(this.tempName(h.pString(e.Result.Attachment.TempName)),this.mimeType(h.pString(e.Result.Attachment.MimeType)),this.size(h.pInt(e.Result.Attachment.Size)),this.hash(h.pString(e.Result.Attachment.Hash)),this.parseActions(e.Result.Attachment))},m.prototype.parseFromUpload=function(e,t,s){this.setMessageData(t,s),this.fileName(h.pString(e.Name)),this.tempName(e.TempName?h.pString(e.TempName):this.fileName()),this.mimeType(h.pString(e.MimeType)),this.size(h.pInt(e.Size)),this.hash(h.pString(e.Hash)),this.parseActions(e),this.uploadUid(this.hash()),this.uploaded(!0),this.uploadStarted(!1)},m.prototype.parseActions=function(e){this.thumbUrlInQueue(""!==h.pString(e.ThumbnailUrl)?h.pString(e.ThumbnailUrl)+"/"+Math.random():""),this.commonParseActions(e),this.isMessageType()?""!==this.folderName()&&""!==this.messageUid()?(this.hasAction("view")||this.actions.unshift("view"),this.otherTemplates.push({name:"MailWebclient_PrintMessageView",data:this.messagePart})):this.actions(n.without(this.actions(),"view")):e.IsInline||this.commonExcludeActions()},m.prototype.errorFromUpload=function(){this.uploaded(!0),this.uploadError(!0),this.uploadStarted(!1),this.statusText(l.i18n("COREWEBCLIENT/ERROR_UPLOAD_UNKNOWN"))},e.exports=m},"68+x":(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=s("LKDt"),r=s("uQaC"),a=s("Z9uT"),l=s("69av"),h=s("Fj7m"),d=s("P7bQ"),c=s("eGl8");function u(){l.call(this),this.isSaving=o.observable(!1),c.folderListLoading.subscribe(function(){-1===c.folderListLoading.indexOf(c.editedFolderList().iAccountId)&&this.isSaving()&&(this.isSaving(!1),this.closePopup())},this),this.options=o.observableArray([]),this.parentFolder=o.observable(""),this.folderName=o.observable(""),this.folderNameFocus=o.observable(!1),this.oFolder=null,this.defaultOptionsAfterRender=r.defaultOptionsAfterRender}i.extendOwn(u.prototype,l.prototype),u.prototype.PopupTemplate="MailWebclient_Settings_EditFolderPopup",u.prototype.onOpen=function(e){this.oFolder=e,this.options(c.editedFolderList().getOptions(n.i18n("MAILWEBCLIENT/LABEL_NO_PARENT_FOLDER"),!0,!1,!0,!1,[e.fullName()])),this.parentFolder(e.parentFullName()),this.folderName(e.name()),this.folderNameFocus(!0)},u.prototype.save=function(){if(this.oFolder.parentFullName()!==this.parentFolder()){var e={AccountID:this.oFolder.iAccountId,PrevFolderFullNameRaw:this.oFolder.fullName(),NewFolderNameInUtf8:this.folderName(),ChangeParent:!0,NewParentFolder:this.parentFolder()};this.isSaving(!0),d.send("RenameFolder",e,i.bind(this.onResponseFolderRename,this),this)}else this.oFolder.name()!==this.folderName()?(e={AccountID:this.oFolder.iAccountId,PrevFolderFullNameRaw:this.oFolder.fullName(),NewFolderNameInUtf8:this.folderName(),ChangeParent:!1},this.isSaving(!0),d.send("RenameFolder",e,i.bind(this.onResponseFolderRename,this),this)):this.closePopup()},u.prototype.onResponseFolderRename=function(e,t){e&&e.Result&&e.Result.FullName||(this.isSaving(!1),a.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_RENAME_FOLDER"))),c.getFolderList(h.editedId())},u.prototype.cancelPopup=function(){this.isSaving()||this.closePopup()},e.exports=new u},"73GV":(e,t,s)=>{var i,o,n=s("LKDt"),r=s("PMEU"),a=s("Rjyw"),l=s("KIwC"),h={getDownloadLink:function(e,t,s){return t.length>0?"?/Download/"+e+"/DownloadFile/"+t+"/"+(s?"0/"+s:""):""},getIframeWrappwer:function(e,t){return"?/Raw/Iframe/"+e+"/"+window.encodeURIComponent(t)+"/"}};h.thumbQueue=(i={},o={},function(e,t){t?!(e in o)||o[e]>0?(e in o||(o[e]=2,i[e]=[]),o[e]--,t(e)):i[e].push({imageSrc:e,imageSrcObserver:t}):i[e]&&i[e].length&&(i[e][0].imageSrcObserver(i[e][0].imageSrc),i[e].shift())}),h.showErrorIfAttachmentSizeLimit=function(e,t){var s=n.i18n("COREWEBCLIENT/ERROR_UPLOAD_SIZE_DETAILED",{FILENAME:e,MAXSIZE:n.getFriendlySize(l.AttachmentSizeLimit)});return l.AttachmentSizeLimit>0&&t>l.AttachmentSizeLimit&&(r.showPopup(a,[s]),!0)},e.exports=h},"7VXH":(e,t,s)=>{var i=s("a7T2"),o={setCursorAtTheEnd:function(e){if(document.createRange){var t=document.createRange();t.selectNodeContents(e),t.collapse(!1);var s=window.getSelection();s.removeAllRanges(),s.addRange(t),e.focus(),t.detach()}},getSelectionRanges:function(){var e=[];if(window.getSelection)for(var t=window.getSelection(),s=t.rangeCount,i=0;i<s;i++)e.push(t.getRangeAt(i));return e},setSelectionRanges:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s="";if(window.getSelection&&i.isArray(e)){var o=e.length,n=window.getSelection();n.removeAllRanges();for(var r=0;r<o;r++){var a=e[r];a&&(n.addRange(a),s+=a,t&&a.collapse(!1))}}return s}};e.exports=o},Fj7m:(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=s("ERH9"),r=s("yU9o").isNewTab()&&window.opener?window.opener.MainTabMailMethods:null,a=s("ioSH"),l=s("8QQh"),h=s("P7bQ"),d=s("dpSB"),c=s("Ua3z"),u=s("YmTJ"),p=s("Vbjo"),m=s("slJ3"),g=s("JI31");function f(){this.collection=o.observableArray([]),this.unifiedMailboxAccounts=o.computed(function(){return c.AllowUnifiedInbox?i.filter(this.collection(),function(e){return e.includeInUnifiedMailbox()}):[]},this),this.unifiedInboxAllowed=o.computed(function(){return this.unifiedMailboxAccounts().length>1},this),this.unifiedInboxReady=o.observable(!1)}f.prototype.getAccountByHash=function(e){return i.find(this.collection(),function(t){return t.hash()===e},this)},f.prototype.changeCurrentAccountByHash=function(e){var t=this.getAccountByHash(e);t&&t.id()!==this.currentId()&&this.changeCurrentAccount(t.id(),!1)},f.prototype.changeCurrentAccount=function(e,t){var s=this.getCurrent(),i=this.getAccount(e);i&&this.currentId()!==e?(s&&s.isCurrent(!1),this.currentId(e),i.isCurrent(!0)):s||this.currentId(0),t&&a.setHash(d.getMailbox())},f.prototype.changeEditedAccountByHash=function(e){var t=this.getAccountByHash(e);t&&t.id()!==this.editedId()&&this.changeEditedAccount(t.id())},f.prototype.changeEditedAccount=function(e){var t=this.getEdited(),s=this.getAccount(e);s&&this.editedId()!==e?(t&&t.isEdited(!1),this.editedId(e),s.isEdited(!0)):t||this.editedId(0)},f.prototype.getDefaultFriendlyName=function(){var e=this.getCurrent(),t=i.find(e&&e.identities()||[],function(e){return e.isDefault()})||e;return t?t.friendlyName()||t.email():""},f.prototype.getIdentityByHash=function(e){var t=null;return i.each(this.collection(),function(s){t||(t=i.find(s.identities()||[],function(t){return t.hash()===e}))},this),t},f.prototype.getFetcherByHash=function(e){var t=null;return i.each(this.collection(),function(s){t||(t=i.find(s.fetchers(),function(t){return t.hash()===e}))},this),t},f.prototype.getAliasByHash=function(e){var t=null;return i.each(this.collection(),function(s){t||(t=i.find(s.aliases()||[],function(t){return t.hash()===e}))},this),t},f.prototype.parse=function(e){i.isArray(e)&&(this.collection(i.map(e,function(e){return new u(e)})),this.initObservables(this.collection().length>0?this.collection()[0].id():0))},f.prototype.initObservables=function(e){var t=this.getAccount(e);t&&(t.isCurrent(!0),t.isEdited(!0)),this.currentId=o.observable(e),this.editedId=o.observable(e)},f.prototype.hasAccount=function(){return this.collection().length>0},f.prototype.getAccount=function(e){return i.find(this.collection(),function(t){return t.id()===e},this)},f.prototype.getDefault=function(){return i.find(this.collection(),function(e){return e.bDefault},this)},f.prototype.getCurrent=function(){return this.getAccount(this.currentId())},f.prototype.getEdited=function(){return this.getAccount(this.editedId())},f.prototype.getEmail=function(e){e=e||this.currentId();var t="",s=this.getAccount(e);return s&&(t=s.email()),t},f.prototype.addAccount=function(e){this.collection.push(e)},f.prototype.deleteAccount=function(e){this.collection.remove(function(t){return t.id()===e});var t=this.collection().length>0?this.collection()[0].id():0;this.changeCurrentAccount(t,!1),this.changeEditedAccount(t)},f.prototype.hasAccountWithId=function(e){return!!i.find(this.collection(),function(t){return t.id()===e},this)},f.prototype.populateFetchersIdentities=function(){this.populateFetchers(),this.populateIdentities(),this.populateAliases()},f.prototype.populateFetchers=function(){c.AllowFetchers&&l.send(c.FetchersServerModuleName,"GetFetchers",{AccountID:this.editedId()},this.onGetFetchersResponse,this)},f.prototype.populateAliases=function(e){c.AllowAliases&&l.send(c.AliasesServerModuleName,"GetAliases",{AccountID:this.editedId()},function(t,s){this.onGetAliasesResponse(t,s),i.isFunction(e)&&e()},this)},f.prototype.onGetFetchersResponse=function(e,t){var s={};n.isNonEmptyArray(e.Result)&&i.each(e.Result,function(e){var t=new p;t.parse(e),s[t.accountId()]||(s[t.accountId()]=[]),s[t.accountId()].push(t)}),i.each(this.collection(),function(e){var t=n.isNonEmptyArray(s[e.id()])?s[e.id()]:[];e.fetchers(t)},this)},f.prototype.onGetAliasesResponse=function(e,t){var s={};e.Result&&n.isNonEmptyArray(e.Result.ObjAliases)&&i.each(e.Result.ObjAliases,function(e){var t=new m;t.parse(e),s[t.accountId()]||(s[t.accountId()]=[]),s[t.accountId()].push(t)}),i.each(this.collection(),function(e){var t=n.isNonEmptyArray(s[e.id()])?s[e.id()]:[];e.aliases(t)},this)},f.prototype.populateIdentities=function(e){c.AllowIdentities&&this.collection().length>=1&&h.send("GetIdentities",null,function(t,s){this.onGetIdentitiesResponse(t,s),i.isFunction(e)&&e()},this)},f.prototype.onGetIdentitiesResponse=function(e,t){var s={};n.isNonEmptyArray(e.Result)&&i.each(e.Result,function(e){var t,i=new g;i.parse(e),t=i.accountId(),s[t]||(s[t]=[]),s[t].push(i)}),i.each(this.collection(),function(e){var t=s[e.id()],o=new g;e.bAllowUseIdentities&&n.isNonEmptyArray(t)||(t=[]),o.parse({AccountPart:!0,Default:!i.find(t,function(e){return e.isDefault()}),Email:e.email(),FriendlyName:e.friendlyName(),IdAccount:e.id(),EntityId:0,Signature:e.signature(),UseSignature:e.useSignature()}),t.unshift(o),e.identities(t)})},f.prototype.populateIdentitiesFromSourceAccount=function(e){e&&i.each(this.collection(),function(t){var s=e.getAccount(t.id());s&&(t.fetchers(s.fetchers()),t.identities(s.identities()),t.signature(s.signature()),t.useSignature(s.useSignature()))})},f.prototype.getAccountsEmails=function(){return i.uniq(i.map(this.collection(),function(e){return e.email()}))},f.prototype.getAllFullEmails=function(){var e=[];return i.each(this.collection(),function(t){t&&(n.isNonEmptyArray(t.identities())?i.each(t.identities(),function(t){e.push(t.fullEmail())}):e.push(t.fullEmail()),i.each(t.fetchers(),function(t){t.isEnabled()&&t.isOutgoingEnabled()&&""!==t.fullEmail()&&e.push(t.fullEmail())}))}),e},f.prototype.getCurrentFetchersAndFiltersFolderNames=function(){var e=this.getCurrent(),t=[];return e&&(e.filters()&&i.each(e.filters().collection(),function(e){t.push(e.folder())},this),i.each(e.fetchers(),function(e){t.push(e.folder())},this)),t},f.prototype.getAttendee=function(e){var t=[],s="";return i.each(this.collection(),function(e){t=e.isCurrent()?i.union([e.email()],e.getFetchersIdentitiesEmails(),t):i.union(t,[e.email()],e.getFetchersIdentitiesEmails())}),t=i.uniq(t),i.each(t,i.bind(function(t){""===s&&i.find(e,function(e){return e===t})===t&&(s=t)},this)),s};var b=new f;window.auroraAppData.Mail&&i.isArray(window.auroraAppData.Mail.Accounts)?b.parse(window.auroraAppData.Mail.Accounts):b.parse([]),r&&b.populateIdentitiesFromSourceAccount(r.getAccountList()),e.exports=b},Hq9N:(e,t,s)=>{var i=s("yU9o"),o=s("eGl8"),n=s("Ua3z");e.exports={fillTemplatesOptions:function(e){n.AllowInsertTemplateOnCompose&&e(this.getTemplatesOptions())},initTemplatesSubscription:function(e){var t=this;n.AllowInsertTemplateOnCompose&&i.subscribeEvent("MailWebclient::ParseMessagesBodies::after",function(s){s.AccountID===o.currentAccountId()&&s.Folder===o.getTemplateFolder()&&e(t.getTemplatesOptions())})},getTemplatesOptions:function(){var e=o.folderList(),t=o.getTemplateFolder(),s=t?e.getFolderByFullName(t):null,i=s?s.getUidList("","",n.MessagesSortBy.DefaultSortBy,n.MessagesSortBy.DefaultSortOrder):null,r=[];if(i){var a=i.collection();a.length>n.MaxTemplatesCountOnCompose&&(a.splice(n.MaxTemplatesCountOnCompose),function(){throw new TypeError('"uids" is read-only')}()),a.forEach(function(e){var t=s.getMessageByUid(e);""!==t.text()&&r.push({subject:t.subject(),text:t.text()})})}return r}}},J08i:(e,t,s)=>{var i=s("ioSH"),o=s("dpSB"),n={composeMessage:function(){i.setHash(o.getCompose())},composeMessageFromDrafts:function(e,t,s){var n=o.getComposeFromMessage("drafts",e,t,s);i.setHash(n)},composeMessageAsReplyOrForward:function(e,t,s,n){var r=o.getComposeFromMessage(e,t,s,n);i.setHash(r)},composeMessageToAddresses:function(e){var t=o.getComposeWithToField(e);i.setHash(t)},composeMessageWithData:function(e){var t=o.getComposeWithData(e);t.shift(),t.shift(),i.goDirectly(o.getCompose(),t)},composeMessageWithEml:function(e){var t=o.getComposeWithEmlObject(e.accountId(),e.folder(),e.longUid(),e);t.shift(),t.shift(),i.goDirectly(o.getCompose(),t)},composeMessageWithAttachments:function(e){var t=o.getComposeWithObject("attachments",e);t.shift(),t.shift(),i.goDirectly(o.getCompose(),t)}};e.exports=n},JI31:(e,t,s)=>{var i=s("p09A"),o=s("rBrp"),n=s("ERH9"),r=s("uQaC");function a(){this.IDENTITY=!0,this.bAccountPart=!1,this.isDefault=i.observable(!1),this.email=i.observable(""),this.friendlyName=i.observable(""),this.fullEmail=i.computed(function(){return o.getFullEmail(this.friendlyName(),this.email())},this),this.accountId=i.observable(-1),this.id=i.observable(-1),this.signature=i.observable(""),this.useSignature=i.observable(!1),this.hash=i.computed(function(){return r.getHash(this.accountId()+"identity"+this.id())},this)}a.prototype.parse=function(e){this.bAccountPart=!!e.AccountPart,this.isDefault(!!e.Default),this.email(n.pString(e.Email)),this.friendlyName(n.pString(e.FriendlyName)),this.accountId(n.pInt(e.IdAccount)),this.id(n.pInt(e.EntityId));var t=n.pString(e.Signature);0!==t.indexOf("<")&&(t="<div>"+t+"</div>"),this.signature=i.observable(t),this.useSignature(!!e.UseSignature)},e.exports=a},Jd7T:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("rBrp"),a=s("LKDt"),l=s("ERH9"),h=s("yU9o"),d=s("/Odb"),c=s("hr1f"),u=s("KIwC"),p=s("PMEU"),m=s("Rjyw"),g=s("MYiO"),f=s("3boL"),b=s("gbYw"),y=s("y9oY"),A=s("eGl8"),v=s("Ua3z"),F=s("Hq9N"),I=s("bpAE");function C(e,t,s){var o=this;this.oParent=s,this.creaId="creaId"+Math.random().toString().replace(".",""),this.textFocused=n.observable(!1),this.workareaDom=n.observable(),this.plaintextDom=n.observable(),this.uploaderAreaDom=n.observable(),this.editorUploaderBodyDragOver=n.observable(!1),this.htmlEditorDom=n.observable(),this.toolbarDom=n.observable(),this.colorPickerDropdownDom=n.observable(),this.insertLinkDropdownDom=n.observable(),this.insertImageDropdownDom=n.observable(),this.isFWBold=n.observable(!1),this.isFSItalic=n.observable(!1),this.isTDUnderline=n.observable(!1),this.isTDStrikeThrough=n.observable(!1),this.isEnumeration=n.observable(!1),this.isBullets=n.observable(!1),this.isEnable=n.observable(!0),this.isEnable.subscribe(function(){this.oCrea&&this.oCrea.setEditable(this.isEnable())},this),this.bInsertImageAsBase64=e,this.bAllowFileUpload=!(e&&void 0===window.File),this.bAllowInsertImage=v.AllowInsertImage,this.bAllowHorizontalLineButton=v.AllowHorizontalLineButton,this.bAllowComposePlainText=t,this.plainTextMode=n.observable(!1),this.changeTextModeTitle=n.computed(function(){return this.plainTextMode()?a.i18n("MAILWEBCLIENT/LINK_TURNOFF_PLAINTEXT"):a.i18n("MAILWEBCLIENT/LINK_TURNON_PLAINTEXT")},this),this.bAllowEditHtmlSource=v.AllowEditHtmlSource,this.editSourceMode=n.observable(!1),this.htmlSourceDom=n.observable(),this.htmlSourceDom.subscribe(function(){I.setHtmlSourceDom(o.htmlSourceDom())}),this.sourceCodeButtonText=n.computed(function(){return o.editSourceMode()?a.i18n("MAILWEBCLIENT/ACTION_EDIT_HTML_PREVIEW"):a.i18n("MAILWEBCLIENT/ACTION_EDIT_HTML_SOURCE_CODE")}),this.lockFontSubscribing=n.observable(!1),this.bAllowImageDragAndDrop=!d.ie10AndAbove,this.aFonts=["Arial","Arial Black","Courier New","Tahoma","Times New Roman","Verdana"],this.sDefaultFont=v.DefaultFontName,this.correctFontFromSettings(),this.selectedFont=n.observable(""),this.selectedFont.subscribe(function(){!this.oCrea||this.lockFontSubscribing()||this.inactive()||this.oCrea.fontName(this.selectedFont())},this),this.iDefaultSize=v.DefaultFontSize,this.selectedSize=n.observable(0),this.selectedSize.subscribe(function(){!this.oCrea||this.lockFontSubscribing()||this.inactive()||this.oCrea.fontSize(this.selectedSize())},this),this.visibleInsertLinkPopup=n.observable(!1),this.linkForInsert=n.observable(""),this.linkFocused=n.observable(!1),this.visibleLinkPopup=n.observable(!1),this.linkPopupDom=n.observable(null),this.linkHrefDom=n.observable(null),this.linkHref=n.observable(""),this.visibleLinkHref=n.observable(!1),this.visibleImagePopup=n.observable(!1),this.visibleImagePopup.subscribe(function(){this.onImageOut()},this),this.imagePopupTop=n.observable(0),this.imagePopupLeft=n.observable(0),this.imageSelected=n.observable(!1),this.tooltipText=n.observable(""),this.tooltipPopupTop=n.observable(0),this.tooltipPopupLeft=n.observable(0),this.visibleInsertImagePopup=n.observable(!1),this.imageUploaderButton=n.observable(null),this.aUploadedImagesData=[],this.imagePathFromWeb=n.observable(""),this.visibleTemplatePopup=n.observable(!1),this.visibleFontColorPopup=n.observable(!1),this.oFontColorPickerView=new b(a.i18n("MAILWEBCLIENT/LABEL_TEXT_COLOR"),this.setTextColorFromPopup,this),this.oBackColorPickerView=new b(a.i18n("MAILWEBCLIENT/LABEL_BACKGROUND_COLOR"),this.setBackColorFromPopup,this),this.inactive=n.observable(!1),this.sPlaceholderText="",this.bAllowChangeInputDirection=u.IsRTL||v.AllowChangeInputDirection,this.disableEdit=n.observable(!1),this.textChanged=n.observable(!1),this.actualTextChanged=n.observable(!1),this.templates=n.observableArray([]),F.initTemplatesSubscription(this.templates),this.imageResizeOptions=[],i.each(v.ImageResizerOptions,function(e,t){o.imageResizeOptions.push({label:a.i18n(t),value:e})})}C.prototype.ViewTemplate="MailWebclient_HtmlEditorView",C.prototype.setInactive=function(e){this.inactive(e),this.inactive()?(this.editSourceMode()&&this.toggleSourceEdit(),this.setPlaceholder()):this.removePlaceholder()},C.prototype.setPlaceholder=function(){var e=this.removeAllTags(this.getText());""!==e&&" "!==e||(this.setText("<span>"+this.sPlaceholderText+"</span>"),this.oCrea&&this.oCrea.setBlur())},C.prototype.removePlaceholder=function(){(this.oCrea?this.removeAllTags(this.oCrea.getText(!1)):"")===this.sPlaceholderText&&(this.setText(""),this.oCrea&&this.oCrea.setFocus(!0))},C.prototype.hasOpenedPopup=function(){return this.visibleInsertLinkPopup()||this.visibleLinkPopup()||this.visibleImagePopup()||this.visibleInsertImagePopup()||this.visibleFontColorPopup()||this.visibleTemplatePopup()},C.prototype.setDisableEdit=function(e){this.disableEdit(!!e)},C.prototype.correctFontFromSettings=function(){var e=this.sDefaultFont,t=!1;i.each(this.aFonts,function(s){s.toLowerCase()===e.toLowerCase()&&(e=s,t=!0)}),t?this.sDefaultFont=e:this.aFonts.push(e)},C.prototype.showLinkPopup=function(e){var t=o(this.workareaDom()),s=t.closest(".panel.compose"),i=t.position(),n=e.position(),r=e.height(),a=Math.round(n.left+i.left),l=Math.round(n.top+r+i.top);this.linkHref(e.attr("href")||e.text()),o(this.linkPopupDom()).css({left:a,top:l}),o(this.linkHrefDom()).css({left:a,top:l}),d.firefox||1!==s.length||o(this.linkPopupDom()).css({"max-width":s.width()-a-40+"px","white-space":"pre-line","word-wrap":"break-word"}),this.visibleLinkPopup(!0)},C.prototype.hideLinkPopup=function(){this.visibleLinkPopup(!1)},C.prototype.showChangeLink=function(){this.visibleLinkHref(!0),this.hideLinkPopup()},C.prototype.changeLink=function(){this.oCrea.changeLink(this.linkHref()),this.hideChangeLink()},C.prototype.hideChangeLink=function(){this.visibleLinkHref(!1)},C.prototype.showImagePopup=function(e,t){var s=o(this.workareaDom()),i=s.position(),n=s.offset();this.imagePopupLeft(Math.round(t.pageX+i.left-n.left)),this.imagePopupTop(Math.round(t.pageY+i.top-n.top)),this.visibleImagePopup(!0)},C.prototype.hideImagePopup=function(){this.visibleImagePopup(!1)},C.prototype.resizeImage=function(e){var t={width:"auto",height:"auto"};e&&(t.width=e),this.oCrea.changeCurrentImage(t),this.visibleImagePopup(!1)},C.prototype.onImageOver=function(e){if("IMG"===e.target.nodeName&&!this.visibleImagePopup()){this.imageSelected(!0),this.tooltipText(a.i18n("MAILWEBCLIENT/ACTION_CLICK_TO_EDIT_IMAGE"));var t=this,s=o(this.workareaDom());s.bind("mousemove.image",function(e){var i=s.position(),o=s.offset();t.tooltipPopupTop(Math.round(e.pageY+i.top-o.top)),t.tooltipPopupLeft(Math.round(e.pageX+i.left-o.left))})}return!0},C.prototype.onImageOut=function(e){return this.imageSelected()&&(this.imageSelected(!1),o(this.workareaDom()).unbind("mousemove.image")),!0},C.prototype.commit=function(){this.textChanged(!1)},C.prototype.init=function(e,t,s,n){var r=this;this.sPlaceholderText=n||"",this.oCrea?(this.oCrea.$container=o("#"+this.oCrea.oOptions.creaId),0===this.oCrea.$container.children().length&&(this.oCrea.start(this.isEnable()),this.initEditorUploader())):(o(document.body).on("click",i.bind(function(e){0===o(e.target).parents("span.dropdown_helper").length&&this.closeAllPopups(!0)},this)),this.initEditorUploader(),this.oCrea=new y({creaId:this.creaId,fontNameArray:this.aFonts,defaultFontName:this.sDefaultFont,defaultFontSize:this.iDefaultSize,alwaysTryUseImageWhilePasting:v.AlwaysTryUseImageWhilePasting,isRtl:u.IsRTL,enableDrop:!1,onChange:i.bind(function(){this.textChanged(!0),this.actualTextChanged.valueHasMutated()},this),onCursorMove:i.bind(this.setFontValuesFromText,this),onFocus:i.bind(this.onCreaFocus,this),onBlur:i.bind(this.onCreaBlur,this),onUrlIn:i.bind(this.showLinkPopup,this),onUrlOut:i.bind(this.hideLinkPopup,this),onImageSelect:i.bind(this.showImagePopup,this),onImageBlur:i.bind(this.hideImagePopup,this),onItemOver:d.mobileDevice||h.isMobile()?null:i.bind(this.onImageOver,this),onItemOut:d.mobileDevice||h.isMobile()?null:i.bind(this.onImageOut,this),openInsertLinkDialog:i.bind(this.insertLink,this),onUrlClicked:!0}),this.oCrea.start(this.isEnable()),I.setOnChangeHandler(function(){r.textChanged(!0),r.actualTextChanged.valueHasMutated()})),this.plaintextDom()&&this.plaintextDom().on("keyup paste",function(){r.textChanged(!0),r.actualTextChanged.valueHasMutated()}),this.oCrea.setTabIndex(s),this.clearUndoRedo(),this.editSourceMode(!1),I.clear(),this.setText(e,t),this.setFontValuesFromText(),this.aUploadedImagesData=[],this.selectedFont(this.sDefaultFont),this.selectedSize(this.iDefaultSize),F.fillTemplatesOptions(this.templates)},C.prototype.toggleTemplatePopup=function(e,t){this.visibleTemplatePopup()?this.visibleTemplatePopup(!1):(t.stopPropagation(),this.closeAllPopups(),this.visibleTemplatePopup(!0))},C.prototype.insertTemplate=function(e,t){t.stopPropagation(),this.insertHtml(e)},C.prototype.isInitialized=function(){return!!this.oCrea},C.prototype.setFocus=function(){this.oCrea&&this.oCrea.setFocus(!1)},C.prototype.changeSignatureContent=function(e,t){this.oCrea&&!this.disableEdit()&&this.oCrea.changeSignatureContent(e,t)},C.prototype.setFontValuesFromText=function(){this.lockFontSubscribing(!0),this.isFWBold(this.oCrea.getIsBold()),this.isFSItalic(this.oCrea.getIsItalic()),this.isTDUnderline(this.oCrea.getIsUnderline()),this.isTDStrikeThrough(this.oCrea.getIsStrikeThrough()),this.isEnumeration(this.oCrea.getIsEnumeration()),this.isBullets(this.oCrea.getIsBullets()),this.selectedFont(this.oCrea.getFontName()),this.selectedSize(this.oCrea.getFontSizeInNumber().toString()),this.lockFontSubscribing(!1)},C.prototype.isUndoAvailable=function(){return!!this.oCrea&&this.oCrea.isUndoAvailable()},C.prototype.getPlainText=function(){return this.oCrea?this.oCrea.getPlainText():""},C.prototype.getText=function(e){if(this.plainTextMode())return this.plaintextDom()?this.plaintextDom().val():"";if(this.editSourceMode()&&I.isInitialized())return I.getText();var t=this.oCrea?this.oCrea.getText(e):"";return""!==this.sPlaceholderText&&this.removeAllTags(t)===this.sPlaceholderText?"":t},C.prototype.getEditableArea=function(){return this.oCrea.$editableArea},C.prototype.setText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.oCrea&&!this.disableEdit()&&(null!==t&&this.plainTextMode(!!t),this.plainTextMode()?(a.isHtml(e)&&(e=a.htmlToPlain(e)),this.plaintextDom().val(e)):(a.isHtml(e)||(e=a.plainToHtml(e)),this.oCrea.setText(e)),this.inactive()&&""===e&&this.setPlaceholder())},C.prototype.undoAndClearRedo=function(){this.oCrea&&(this.oCrea.undo(),this.oCrea.clearRedo())},C.prototype.clearUndoRedo=function(){this.oCrea&&this.oCrea.clearUndoRedo()},C.prototype.removeAllTags=function(e){return e.replace(/<style>.*<\/style>/g,"").replace(/<[^>]*>/g,"")},C.prototype.onCreaFocus=function(){this.oCrea&&(this.closeAllPopups(),this.textFocused(!0))},C.prototype.onCreaBlur=function(){this.oCrea&&this.textFocused(!1)},C.prototype.onEscHandler=function(){p.hasOpenedMaximizedPopups()||this.closeAllPopups()},C.prototype.closeAllPopups=function(e){(e=!!e)||this.visibleLinkPopup(!1),this.visibleInsertLinkPopup(!1),this.visibleImagePopup(!1),this.visibleInsertImagePopup(!1),this.visibleFontColorPopup(!1),this.visibleTemplatePopup(!1)},C.prototype.insertHtml=function(e){this.oCrea&&(this.oCrea.isFocused()||this.oCrea.setFocus(!0),this.oCrea.insertHtml(e,!1))},C.prototype.insertLink=function(e,t){this.inactive()||this.visibleInsertLinkPopup()||(t&&i.isFunction(t.stopPropagation)&&t.stopPropagation(),this.linkForInsert(this.oCrea.getSelectedText()),this.closeAllPopups(),this.visibleInsertLinkPopup(!0),this.linkFocused(!0))},C.prototype.insertLinkFromPopup=function(e,t){return this.linkForInsert().length>0&&(r.isCorrectEmail(this.linkForInsert())?this.oCrea.insertEmailLink(this.linkForInsert()):this.oCrea.insertLink(this.linkForInsert())),this.closeInsertLinkPopup(e,t),!1},C.prototype.closeInsertLinkPopup=function(e,t){this.visibleInsertLinkPopup(!1),t&&t.stopPropagation()},C.prototype.textColor=function(e,t){this.inactive()||(this.closeAllPopups(),this.visibleFontColorPopup()||(t.stopPropagation(),this.visibleFontColorPopup(!0),this.oFontColorPickerView.onShow(),this.oBackColorPickerView.onShow()))},C.prototype.colorToHex=function(e){if("#"===e.substr(0,1))return e;for(var t=/(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(e),s=l.pInt(t[2]),i=l.pInt(t[3]),o=(l.pInt(t[4])|i<<8|s<<16).toString(16);o.length<6;)o="0"+o;return t[1]+"#"+o},C.prototype.setTextColorFromPopup=function(e){this.oCrea.textColor(this.colorToHex(e)),this.closeAllPopups()},C.prototype.setBackColorFromPopup=function(e){this.oCrea.backgroundColor(this.colorToHex(e)),this.closeAllPopups()},C.prototype.insertImage=function(e,t){return this.inactive()||!v.AllowInsertImage||this.visibleInsertImagePopup()||(t.stopPropagation(),this.imagePathFromWeb(""),this.closeAllPopups(),this.visibleInsertImagePopup(!0),this.initUploader()),!0},C.prototype.insertWebImageFromPopup=function(e,t){v.AllowInsertImage&&this.imagePathFromWeb().length>0&&this.oCrea.insertImage(this.imagePathFromWeb()),this.closeInsertImagePopup(e,t)},C.prototype.insertComputerImageFromPopup=function(e,t){var s,n=i.isFunction(this.oParent&&this.oParent.senderAccountId)?this.oParent.senderAccountId():A.currentAccountId(),r=new f(n);r.parse(t),s=r.getActionUrl("view"),v.AllowInsertImage&&s.length>0&&this.oCrea.insertImage(s)&&(o(this.oCrea.$editableArea).find('img[src="'+s+'"]').attr("data-x-src-cid",e),t.CID=e,this.aUploadedImagesData.push(t)),this.closeInsertImagePopup()},C.prototype.getUploadedImagesData=function(){return this.aUploadedImagesData},C.prototype.closeInsertImagePopup=function(e,t){this.visibleInsertImagePopup(!1),t&&t.stopPropagation()},C.prototype.initUploader=function(){this.imageUploaderButton()&&(this.oJua=new c({action:"?/Api/",name:"jua-uploader",queueSize:2,clickElement:this.imageUploaderButton(),hiddenElementsPosition:u.IsRTL?"right":"left",disableMultiple:!0,disableAjaxUpload:!1,disableDragAndDrop:!0,hidden:i.extendOwn({Module:v.ServerModuleName,Method:"UploadAttachment",Parameters:function(){return JSON.stringify({AccountID:A.currentAccountId()})}},h.getCommonRequestParameters())}),this.bInsertImageAsBase64?this.oJua.on("onSelect",i.bind(this.onEditorDrop,this)):this.oJua.on("onSelect",i.bind(this.onFileUploadSelect,this)).on("onComplete",i.bind(this.onFileUploadComplete,this)))},C.prototype.initEditorUploader=function(){if(v.AllowInsertImage&&this.uploaderAreaDom()){var e=null,t=null;this.oParent&&this.oParent.composeUploaderDragOver&&this.oParent.onFileUploadProgress&&this.oParent.onFileUploadStart&&this.oParent.onFileUploadComplete?(e=i.bind(function(){this.editorUploaderBodyDragOver(!0),this.oParent.composeUploaderDragOver(!0)},this),t=i.bind(function(){this.editorUploaderBodyDragOver(!1),this.oParent.composeUploaderDragOver(!1)},this),this.editorUploader=new c({action:"?/Api/",name:"jua-uploader",queueSize:1,dragAndDropElement:this.bAllowImageDragAndDrop?this.uploaderAreaDom():null,disableMultiple:!0,disableAjaxUpload:!1,disableDragAndDrop:!this.bAllowImageDragAndDrop,hidden:i.extendOwn({Module:v.ServerModuleName,Method:"UploadAttachment",Parameters:function(){return JSON.stringify({AccountID:A.currentAccountId()})}},h.getCommonRequestParameters())}),this.editorUploader.on("onDragEnter",i.bind(this.oParent.composeUploaderDragOver,this.oParent,!0)).on("onDragLeave",i.bind(this.oParent.composeUploaderDragOver,this.oParent,!1)).on("onBodyDragEnter",e).on("onBodyDragLeave",t).on("onProgress",i.bind(this.oParent.onFileUploadProgress,this.oParent)).on("onSelect",i.bind(this.onEditorDrop,this)).on("onStart",i.bind(this.oParent.onFileUploadStart,this.oParent)).on("onComplete",i.bind(this.oParent.onFileUploadComplete,this.oParent))):(e=i.bind(this.editorUploaderBodyDragOver,this,!0),t=i.bind(this.editorUploaderBodyDragOver,this,!1),this.editorUploader=new c({queueSize:1,dragAndDropElement:this.bAllowImageDragAndDrop?this.uploaderAreaDom():null,disableMultiple:!0,disableAjaxUpload:!1,disableDragAndDrop:!this.bAllowImageDragAndDrop}),this.editorUploader.on("onBodyDragEnter",e).on("onBodyDragLeave",t).on("onSelect",i.bind(this.onEditorDrop,this)))}},C.prototype.isDragAndDropSupported=function(){return!!this.editorUploader&&this.editorUploader.isDragAndDropSupported()},C.prototype.onEditorDrop=function(e,t){var s=null,i=null,o=this,n=!1,r=Math.random().toString(),l="";if(t&&t.File&&"string"==typeof t.File.type)if(v.AllowInsertImage&&0===t.File.type.indexOf("image/"))i=t.File,v.ImageUploadSizeLimit>0&&i.size>v.ImageUploadSizeLimit?p.showPopup(m,[a.i18n("COREWEBCLIENT/ERROR_UPLOAD_SIZE")]):(s=new window.FileReader,(n=this.oCrea.isFocused())||this.oCrea.setFocus(!0),l=i.name+"_"+r,this.oCrea.insertHtml('<img id="'+l+'" src="./static/styles/images/wait.gif" />',!0),n||this.oCrea.fixFirefoxCursorBug(),s.onload=function(e){o.oCrea.changeImageSource(l,e.target.result)},s.readAsDataURL(i));else{if(this.oParent&&this.oParent.onFileUploadSelect)return this.oParent.onFileUploadSelect(e,t),!0;d.ie10AndAbove||p.showPopup(m,[a.i18n("MAILWEBCLIENT/ERROR_NOT_IMAGE_CHOOSEN")])}return!1},C.prototype.isFileImage=function(e){if("string"==typeof e.Type)return-1!==e.Type.indexOf("image");var t=e.FileName.lastIndexOf("."),s=e.FileName.substr(t+1);return-1!==o.inArray(s,["jpg","jpeg","gif","tif","tiff","png"])},C.prototype.onFileUploadSelect=function(e,t){return this.isFileImage(t)?(this.closeInsertImagePopup(),!0):(p.showPopup(m,[a.i18n("MAILWEBCLIENT/ERROR_NOT_IMAGE_CHOOSEN")]),!1)},C.prototype.onFileUploadComplete=function(e,t,s){var i="";s&&s.Result?s.Result.Error?(i="size"===s.Result.Error?a.i18n("COREWEBCLIENT/ERROR_UPLOAD_SIZE"):a.i18n("COREWEBCLIENT/ERROR_UPLOAD_UNKNOWN"),p.showPopup(m,[i])):(this.oCrea.setFocus(!0),this.insertComputerImageFromPopup(e,s.Result.Attachment)):p.showPopup(m,[a.i18n("COREWEBCLIENT/ERROR_UPLOAD_UNKNOWN")])},C.prototype.undo=function(){return this.inactive()||this.oCrea.undo(),!1},C.prototype.redo=function(){return this.inactive()||this.oCrea.redo(),!1},C.prototype.bold=function(){return this.inactive()||(this.oCrea.bold(),this.isFWBold(!this.isFWBold())),!1},C.prototype.italic=function(){return this.inactive()||(this.oCrea.italic(),this.isFSItalic(!this.isFSItalic())),!1},C.prototype.underline=function(){return this.inactive()||(this.oCrea.underline(),this.isTDUnderline(!this.isTDUnderline())),!1},C.prototype.strikeThrough=function(){return this.inactive()||(this.oCrea.strikeThrough(),this.isTDStrikeThrough(!this.isTDStrikeThrough())),!1},C.prototype.numbering=function(){return this.inactive()||(this.oCrea.numbering(),this.isBullets(!1),this.isEnumeration(!this.isEnumeration())),!1},C.prototype.bullets=function(){return this.inactive()||(this.oCrea.bullets(),this.isEnumeration(!1),this.isBullets(!this.isBullets())),!1},C.prototype.insertHorizontalLine=function(){return this.inactive()||this.oCrea.insertHorizontalLine(),!1},C.prototype.blockquote=function(){return this.inactive()||this.oCrea.blockquote(),!1},C.prototype.removeFormat=function(){return this.inactive()||this.oCrea.removeFormat(),!1},C.prototype.setRtlDirection=function(){return this.inactive()||this.oCrea.setRtlDirection(),!1},C.prototype.setLtrDirection=function(){return this.inactive()||this.oCrea.setLtrDirection(),!1},C.prototype.changeTextMode=function(){var e=this,t=function(){if(e.plainTextMode()){var t="<div>"+a.plainToHtml(e.getText())+"</div>";e.setText(t,!1)}else e.setText(e.getPlainText(),!0)};if(this.plainTextMode())t();else{var s=a.i18n("MAILWEBCLIENT/CONFIRM_HTML_TO_PLAIN_FORMATTING");p.showPopup(g,[s,function(e){e&&t()}])}},C.prototype.setPlainTextMode=function(e){this.plainTextMode(e)},C.prototype.toggleSourceEdit=function(){this.editSourceMode()?(this.setText(I.getText()),this.editSourceMode(!1)):(I.setText(this.getText()),this.editSourceMode(!0))},C.prototype.getHotKeysDescriptions=function(){return[{value:"Ctrl+Z",action:a.i18n("MAILWEBCLIENT/LABEL_UNDO_HOTKEY"),visible:n.observable(!0)},{value:"Ctrl+Y",action:a.i18n("MAILWEBCLIENT/LABEL_REDO_HOTKEY"),visible:n.observable(!0)},{value:"Ctrl+K",action:a.i18n("MAILWEBCLIENT/LABEL_LINK_HOTKEY"),visible:n.observable(!0)},{value:"Ctrl+B",action:a.i18n("MAILWEBCLIENT/LABEL_BOLD_HOTKEY"),visible:n.observable(!0)},{value:"Ctrl+I",action:a.i18n("MAILWEBCLIENT/LABEL_ITALIC_HOTKEY"),visible:n.observable(!0)},{value:"Ctrl+U",action:a.i18n("MAILWEBCLIENT/LABEL_UNDERLINE_HOTKEY"),visible:n.observable(!0)}]},e.exports=C},LIBG:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("sdEb"),a=s("yU9o"),l=s("73GV"),h=s("LKDt"),d=s("ERH9"),c=s("3cxN"),u=s("uQaC"),p=s("zVyH"),m=["image/jpeg","image/jpg","image/png","image/gif","text/html","text/plain","text/css","text/rfc822-headers","message/delivery-status","application/x-httpd-php","application/javascript"],g=[];function f(){this.id=n.observable(""),this.index=n.observable(0),this.fileName=n.observable(""),this.tempName=n.observable(""),this.extension=n.observable(""),this.fileName.subscribe(function(e){this.id(e),this.extension(u.getFileExtension(e))},this),this.displayName=n.computed(function(){return this.fileName()},this),this.size=n.observable(0),this.friendlySize=n.computed(function(){return this.size()>0?h.getFriendlySize(this.size()):""},this),this.hash=n.observable(""),this.thumbUrlInQueue=n.observable(""),this.thumbUrlInQueueSubscribtion=this.thumbUrlInQueue.subscribe(function(){this.getInThumbQueue()},this),this.thumbnailSrc=n.observable(""),this.thumbnailLoaded=n.observable(!1),this.mimeType=n.observable(""),this.uploadUid=n.observable(""),this.uploaded=n.observable(!1),this.uploadError=n.observable(!1),this.downloading=n.observable(!1),this.bHasHtmlEmbed=!1,this.otherTemplates=n.observableArray([]),this.visibleCancelButton=n.observable(!0),this.cancelButtonTooltip=h.i18n("COREWEBCLIENT/ACTION_CANCEL"),this.statusText=n.observable(""),this.statusTooltip=n.computed(function(){return this.uploadError()?this.statusText():""},this),this.progressPercent=n.observable(0),this.visibleProgress=n.observable(!1),this.uploadStarted=n.observable(!1),this.uploadStarted.subscribe(function(){this.uploadStarted()?(this.uploaded(!1),this.visibleProgress(!0),this.progressPercent(20)):(this.progressPercent(100),this.visibleProgress(!1),this.uploaded(!0))},this),this.downloading.subscribe(function(){this.downloading()?this.visibleProgress(!0):(this.visibleProgress(!1),this.progressPercent(0))},this),this.allowDrag=n.observable(!1),this.allowUpload=n.observable(!1),this.allowPublicLink=n.observable(!1),this.bIsSecure=n.observable(!1),this.sHeaderText="",this.oActionsData={view:{Text:h.i18n("COREWEBCLIENT/ACTION_VIEW_FILE"),HandlerName:"viewFile"},download:{Text:h.i18n("COREWEBCLIENT/ACTION_DOWNLOAD_FILE"),HandlerName:"downloadFile",Tooltip:n.computed(function(){var e=h.i18n("COREWEBCLIENT/INFO_CLICK_TO_DOWNLOAD_FILE",{FILENAME:this.fileName(),SIZE:this.friendlySize()});return""===this.friendlySize()&&(e=e.replace(" ()","")),e},this)}},this.allowActions=n.observable(!0),this.iconAction=n.observable("download"),this.cssClasses=n.computed(function(){return this.getCommonClasses().join(" ")},this),this.actions=n.observableArray([]),this.firstAction=n.computed(function(){return this.actions().length>1?this.actions()[0]:""},this),this.secondAction=n.computed(function(){return 1===this.actions().length?this.actions()[0]:this.actions().length>1?this.actions()[1]:""},this),this.subFiles=n.observableArray([]),this.subFilesExpanded=n.observable(!1),this.sUploadSubFolder="",this.bIsHidden=!1}navigator.pdfViewerEnabled&&(m.push("application/pdf"),m.push("application/x-pdf")),f.prototype.addAction=function(e,t,s){t?this.actions.unshift(e):this.actions.push(e),this.actions(i.compact(this.actions())),s&&(this.oActionsData[e]=s)},f.prototype.removeAction=function(e){this.actions(i.without(this.actions(),e))},f.prototype.getMainAction=function(){return this.actions()[0]},f.prototype.hasAction=function(e){return-1!==i.indexOf(this.actions(),e)},f.prototype.getActionText=function(e){return this.hasAction(e)&&this.oActionsData[e]&&("string"==typeof this.oActionsData[e].Text||i.isFunction(this.oActionsData[e].Text))?i.isFunction(this.oActionsData[e].Text)?this.oActionsData[e].Text():this.oActionsData[e].Text:""},f.prototype.getActionUrl=function(e){return this.hasAction(e)&&this.oActionsData[e]&&this.oActionsData[e].Url||""},f.prototype.executeAction=function(e){var t=this.hasAction(e)&&this.oActionsData[e];t&&(i.isFunction(t.Handler)?t.Handler():"string"==typeof t.HandlerName&&i.isFunction(this[t.HandlerName])&&this[t.HandlerName]())},f.prototype.getTooltip=function(e){var t=this.hasAction(e)&&this.oActionsData[e]?this.oActionsData[e].Tooltip:"";return"string"==typeof t?t:i.isFunction(t)?t():""},f.prototype.getCommonClasses=function(){var e=[];return(this.allowUpload()&&!this.uploaded()||this.downloading())&&e.push("incomplete"),this.uploadError()?e.push("fail"):e.push("success"),e},f.prototype.parse=function(e){this.fileName(d.pString(e.FileName)),this.tempName(d.pString(e.TempName)),""===this.tempName()&&this.tempName(this.fileName()),this.mimeType(d.pString(e.MimeType)),this.size(e.EstimatedSize?d.pInt(e.EstimatedSize):d.pInt(e.SizeInBytes)),this.hash(d.pString(e.Hash)),this.parseActions(e),this.uploadUid(this.hash()),this.uploaded(!0),i.isFunction(this.additionalParse)&&this.additionalParse(e)},f.prototype.parseActions=function(e){this.thumbUrlInQueue(""!==d.pString(e.ThumbnailUrl)?d.pString(e.ThumbnailUrl)+"/"+Math.random():""),this.commonParseActions(e),this.commonExcludeActions()},f.prototype.commonExcludeActions=function(){this.isViewSupported()||this.removeAction("view")},f.prototype.commonParseActions=function(e){i.each(e.Actions,function(e,t){this.oActionsData[t]||(this.oActionsData[t]={}),this.oActionsData[t].Url=d.pString(e.url),this.actions.push(t)},this)},f.addViewExtensions=function(e){i.isArray(e)&&(g=i.union(g,e))},f.prototype.isViewSupported=function(){return-1!==o.inArray(this.mimeType(),m)||-1!==o.inArray(d.pString(this.extension()).toLowerCase(),g)},f.prototype.getInThumbQueue=function(){""===this.thumbUrlInQueue()||this.linked&&(!this.linked||this.linked())||l.thumbQueue(this.thumbUrlInQueue(),this.thumbnailSrc)},f.prototype.downloadFile=function(e){var t=this.getActionUrl("download"),s={File:this,CancelDownload:!1};t.length>0&&"#"!==t&&(e||a.broadcastEvent("AbstractFileModel::FileDownload::before",s),s.CancelDownload||(i.isFunction(s.CustomDownloadHandler)?s.CustomDownloadHandler():(t+="/"+r().unix(),c.downloadByUrl(t,"eml"===this.extension()))))},f.prototype.viewFile=function(e,t){u.calmEvent(t),this.viewCommonFile()},f.prototype.viewCommonFile=function(e){var t=null,s=null;d.isNonEmptyString(e)||(e=c.getAppPath()+this.getActionUrl("view")),e.length>0&&"#"!==e&&(s={sUrl:e+="/"+r().unix(),index:this.index(),hash:this.hash(),continueView:!0},a.broadcastEvent("AbstractFileModel::FileView::before",s),s.continueView&&(t=p.open(s.sUrl,s.sUrl,!1))&&t.focus())},f.prototype.eventDragStart=function(e,t){var s=t.originalEvent||t;return e&&s&&s.dataTransfer&&s.dataTransfer.setData&&s.dataTransfer.setData("DownloadURL",this.generateTransferDownloadUrl()),!0},f.prototype.generateTransferDownloadUrl=function(){var e=this.getActionUrl("download");return"http"!==e.substr(0,4)&&(e=c.getAppPath()+e),this.mimeType()+":"+this.fileName()+":"+e},f.prototype.onUploadSelect=function(e,t,s){s||(this.fileName(d.pString(t.FileName)),this.mimeType(d.pString(t.Type)),this.size(d.pInt(t.Size))),this.uploadUid(e),this.uploaded(!1),this.statusText(""),this.progressPercent(0),this.visibleProgress(!1),this.sUploadSubFolder=d.pString(t.Folder),this.bIsHidden=""!==this.sUploadSubFolder},f.prototype.onUploadStart=function(){this.visibleProgress(!0)},f.prototype.onUploadProgress=function(e,t){t>0&&(this.progressPercent(Math.ceil(e/t*100)),this.visibleProgress(!0))},f.prototype.onDownloadProgress=function(e,t){t>0&&(this.progressPercent(Math.ceil(e/t*100)),this.visibleProgress(this.progressPercent()<100))},f.prototype.onUploadComplete=function(e,t,s){var i=!(t&&s&&!s.ErrorCode&&s.Result&&!s.Result.Error),o=s&&s.ErrorCode&&s.ErrorCode===Enums.Errors.CanNotUploadFileLimit?h.i18n("COREWEBCLIENT/ERROR_UPLOAD_SIZE"):h.i18n("COREWEBCLIENT/ERROR_UPLOAD_UNKNOWN");this.progressPercent(0),this.visibleProgress(!1),this.uploaded(!0),this.uploadError(i),this.statusText(i?o:h.i18n("COREWEBCLIENT/REPORT_UPLOAD_COMPLETE")),i||(this.fillDataAfterUploadComplete(s,e),setTimeout(function(e){return function(){e.statusText("")}}(this),3e3))},f.prototype.fillDataAfterUploadComplete=function(e,t){},f.prototype.onImageLoad=function(e,t){""===this.thumbUrlInQueue()||this.thumbnailLoaded()||(this.thumbnailLoaded(!0),l.thumbQueue(this.thumbUrlInQueue()))},f.prototype.stopDownloading=function(){this.downloading(!1)},f.prototype.startDownloading=function(){this.downloading(!0)},e.exports=f},NM3O:(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=s("ERH9"),r=s("yHWv"),a=s("Fj7m");function l(){this.senderList=o.observableArray([]),this.senderAccountId=o.observable(a.currentId()),this.selectedFetcherOrIdentity=o.observable(null),this.lockSelectedSender=o.observable(!1),this.selectedSender=o.observable(""),this.selectedSender.subscribe(function(){if(!this.lockSelectedSender()){var e=a.getAccount(this.senderAccountId()),t=this.selectedSender(),s=null;n.isNonEmptyString(t)&&(0===t.indexOf("fetcher")?(t=t.replace("fetcher",""),s=i.find(e.fetchers(),function(e){return e.id()===n.pInt(t)})):0===t.indexOf("alias")?(t=t.replace("alias",""),s=i.find(e.aliases(),function(e){return e.id()===n.pInt(t)})):s=i.find(e.identities(),function(e){return e.id()===n.pInt(t)})),s&&this.selectedFetcherOrIdentity(s)}},this)}l.prototype.changeSelectedSender=function(e){if(e){var t=n.pString(e.id());e.FETCHER?t="fetcher"+t:e.ALIAS&&(t="alias"+t),i.find(this.senderList(),function(e){return e.id===t})&&(this.lockSelectedSender(!0),this.selectedSender(t),this.selectedFetcherOrIdentity(e),this.lockSelectedSender(!1))}},l.prototype.changeSenderAccountId=function(e,t){var s=!1;this.senderAccountId()!==e&&(a.hasAccountWithId(e)?(this.senderAccountId(e),s=!0):a.hasAccountWithId(this.senderAccountId())||(this.senderAccountId(a.currentId()),s=!0)),(s||0===this.senderList().length)&&(this.fillSenderList(t),s=!0),!s&&t&&this.changeSelectedSender(t)},l.prototype.fillSenderList=function(e){var t=[],s=a.getAccount(this.senderAccountId());s&&(i.isArray(s.identities())&&i.each(s.identities(),function(e){t.push({fullEmail:e.fullEmail(),id:n.pString(e.id())})},this),s.identitiesSubscribtion&&s.identitiesSubscribtion.dispose(),s.identitiesSubscribtion=s.identities.subscribe(function(){this.fillSenderList(e),this.changeSelectedSender(s.getDefaultIdentity())},this),i.each(s.fetchers(),function(e){var s=e.fullEmail();e.isEnabled()&&e.isOutgoingEnabled()&&s.length>0&&t.push({fullEmail:s,id:"fetcher"+e.id()})},this),s.fetchersSubscribtion&&s.fetchersSubscribtion.dispose(),s.fetchersSubscribtion=s.fetchers.subscribe(function(){this.fillSenderList(e)},this),i.each(s.aliases(),function(e){var s=e.fullEmail();s.length>0&&t.push({fullEmail:s,id:"alias"+e.id()})},this)),this.senderList(t),this.changeSelectedSender(e)},l.prototype.setFetcherOrIdentityByReplyMessage=function(e){var t=e.oTo.aCollection.concat(e.oCc.aCollection),s=r.getFirstFetcherOrIdentityByRecipientsOrDefault(t,e.accountId());s&&(s.accountId()!==this.senderAccountId()?this.changeSenderAccountId(s.accountId(),s):this.changeSelectedSender(s))},e.exports=new l},P7bQ:(e,t,s)=>{var i=s("a7T2"),o=s("LKDt"),n=s("ERH9"),r=s("8QQh"),a=s("yU9o"),l=s("D2Gh"),h=s("Ua3z");r.registerAbortRequestHandler(h.ServerModuleName,function(e,t){var s=e.Parameters,i=t.Parameters;switch(e.Method){case"MoveMessages":case"DeleteMessages":return"GetRelevantFoldersInformation"===t.Method||"GetUnifiedRelevantFoldersInformation"===t.Method||"GetMessage"===t.Method||"GetUnifiedMailboxMessages"===t.Method||"GetMessagesByFolders"===t.Method||"GetMessages"===t.Method&&i.Folder===s.Folder;case"GetMessages":case"GetUnifiedMailboxMessages":return"GetUnifiedMailboxMessages"===t.Method||"GetMessagesByFolders"===t.Method||"GetMessages"===t.Method&&i.Folder===s.Folder;case"SetMessagesSeen":case"SetMessageFlagged":return"GetRelevantFoldersInformation"===t.Method||"GetUnifiedRelevantFoldersInformation"===t.Method||"GetUnifiedMailboxMessages"===t.Method||"GetMessagesByFolders"===t.Method||"GetMessages"===t.Method&&i.Folder===s.Folder;case"SetAllMessagesSeen":case"ClearFolder":return"GetRelevantFoldersInformation"===t.Method||"GetUnifiedRelevantFoldersInformation"===t.Method||"GetMessages"===t.Method&&i.Folder===s.Folder;case"GetRelevantFoldersInformation":return"GetRelevantFoldersInformation"===t.Method&&s.AccountID===i.AccountID||"GetUnifiedRelevantFoldersInformation"===t.Method;case"GetMessagesFlags":return"GetMessagesFlags"===t.Method}return!1}),e.exports={getOpenedRequest:function(e){r.getOpenedRequest("Mail",e)},hasOpenedRequests:function(e){return r.hasOpenedRequests("Mail",e||"")},hasInternetConnectionProblem:function(){return r.hasInternetConnectionProblem()},registerOnAllRequestsClosedHandler:r.registerOnAllRequestsClosedHandler,send:function(e,t,d,c){var u=s("eGl8");!t||t.AccountID||["GetUnifiedMailboxMessages","CreateAccount"].includes(e)||(t.AccountID=u.currentAccountId()),r.send(h.ServerModuleName,e,t,function(e,t){if(!e.Result&&4002===e.ErrorCode&&a.getUserRole()!==Enums.UserRole.Anonymous){var r=s("Fj7m"),h=e.ErrorMessage.split(":"),u=n.pInt(h.shift()),p=r.getAccount(u),m=h.join(":");if(p&&p.bDefault)e={Result:!1,ErrorCode:Enums.Errors.AuthError},a.logoutAndGotoLogin();else if(p){p.passwordMightBeIncorrect(!0);var g=o.i18n("MAILWEBCLIENT/ERROR_CREDENTIALS_INCORRECT",{EMAIL:p.email()});m&&(g+=" ("+m+")"),l.showError(g,!0),e={Result:!1,ErrorCode:Enums.Errors.NotDisplayedError}}}i.isFunction(d)&&d.apply(c,[e,t])},null)}}},PV2F:(e,t,s)=>{var i=s("yU9o"),o=s("Jd7T");e.exports={getCHtmlEditorView:function(){var e={CHtmlEditorView:null};return i.broadcastEvent("MailWebclient::GetCHtmlEditorView",e),e.CHtmlEditorView||o}}},Panx:(e,t,s)=>{var i=s("a7T2"),o=s("LKDt"),n=s("3cxN"),r=s("oJUS"),a=s("KIwC"),l=s("PMEU"),h=s("MYiO"),d=s("Fj7m"),c=s("eGl8"),u={isPermanentDelete:function(){if(!c.isSearchInMultiFolders()){var e=c.folderList(),t=e.currentFolderFullName(),s=e.trashFolder(),i=s&&t===s.fullName(),o=e.spamFolder();return o&&t===o.fullName()||i}return!1},deleteMessages:function(e,t){i.isFunction(t)||(t=function(){});var s=u.isPermanentDelete(),n=function(i){i&&u.actualDeleteMessages(e,s,t)};s?l.showPopup(h,[o.i18n("MAILWEBCLIENT/CONFIRM_DELETE_MESSAGES_PLURAL",{},null,e.length),n,"",o.i18n("COREWEBCLIENT/ACTION_DELETE")]):n(!0)},actualDeleteMessages:function(e,t,s){var n=!1,r=!1,a=c.getUidsSeparatedByFolders(e),u=function(e,t,i){i&&(c.deleteMessagesFromFolder(e,t),s())};i.each(a,function(e){var s=e.iAccountId,i=c.oFolderListItems[s],a=d.getAccount(s),p=i?i.trashFolder():null,m=i?i.getFolderByFullName(e.sFolder):null;m&&(t?(u(m,e.aUids,!0),n=!0):p?(c.moveMessagesToFolder(m,p,e.aUids),n=!0):(l.showPopup(h,[o.i18n("MAILWEBCLIENT/CONFIRM_MESSAGES_DELETE_NO_TRASH_FOLDER"),u.bind(null,m,e.aUids),a?a.fullEmail():""]),r=!0))}),n&&!r&&s()},isAvailableRegisterMailto:function(){return window.navigator&&i.isFunction(window.navigator.registerProtocolHandler)},registerMailto:function(e){!u.isAvailableRegisterMailto()||e&&!0===r.getData("aurora_mail_is-mailto-asked")||(window.navigator.registerProtocolHandler("mailto",n.getAppPath()+"#mail/compose/to/%s",""!==a.SiteName?a.SiteName:"WebMail"),r.setData("aurora_mail_is-mailto-asked",!0))}};e.exports=u},Ssud:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("rBrp"),a=s("73GV"),l=s("LKDt"),h=s("ERH9"),d=s("uQaC"),c=s("yU9o"),u=s("/Odb"),p=s("hr1f"),m=s("8QQh"),g=s("5D2l"),f=s("ioSH"),b=s("D2Gh"),y=s("KIwC"),A=s("zVyH"),v=s("db2p"),F=s("PMEU"),I=s("Rjyw"),C=g.run("FilesWebclient","getSelectFilesPopup"),S=s("dpSB"),E=s("yHWv"),M=s("PV2F"),T=s("Fj7m"),w=s("P7bQ"),L=s("eGl8"),U=s("fcI1"),R=s("NM3O"),N=s("Ua3z"),D=s("WzKm"),x=s("3boL"),P=s("1uL4"),O=M.getCHtmlEditorView(),B=c.isNewTab()&&window.opener&&window.opener.MainTabMailMethods,H=o("html");function k(){v.call(this,"MailWebclient"),P.call(this),this.browserTitle=n.computed(function(){return T.getEmail()+" - "+l.i18n("MAILWEBCLIENT/HEADING_COMPOSE_BROWSER_TAB")});var e=this;this.toAddrDom=n.observable(),this.toAddrDom.subscribe(function(){this.initInputosaurus(this.toAddrDom,this.toAddr,this.lockToAddr,"to")},this),this.ccAddrDom=n.observable(),this.ccAddrDom.subscribe(function(){this.initInputosaurus(this.ccAddrDom,this.ccAddr,this.lockCcAddr,"cc")},this),this.bccAddrDom=n.observable(),this.bccAddrDom.subscribe(function(){this.initInputosaurus(this.bccAddrDom,this.bccAddr,this.lockBccAddr,"bcc")},this),this.folderList=L.folderList,this.folderList.subscribe(function(){this.getMessageOnRoute()},this),this.bNewTab=c.isNewTab(),this.bDemo=y.IsDemo,this.sending=n.observable(!1),this.saving=n.observable(!1),this.oHtmlEditor=new O(!1,N.AllowComposePlainText,this),this.visibleBcc=n.observable(!1),this.visibleBcc.subscribe(function(){H.toggleClass("screen-compose-bcc",this.visibleCc()),i.defer(i.bind(function(){o(this.bccAddrDom()).inputosaurus("resizeInput")},this))},this),this.visibleCc=n.observable(!1),this.visibleCc.subscribe(function(){H.toggleClass("screen-compose-cc",this.visibleCc()),i.defer(i.bind(function(){o(this.ccAddrDom()).inputosaurus("resizeInput")},this))},this),this.sendReadingConfirmation=n.observable(!1).extend({reversible:!0}),this.composeUploaderButton=n.observable(null),this.composeUploaderButton.subscribe(function(){this.initUploader()},this),this.composeUploaderDropPlace=n.observable(null),this.composeUploaderBodyDragOver=n.observable(!1),this.composeUploaderDragOver=n.observable(!1),this.allowDragNDrop=n.observable(!1),this.uploaderBodyDragOver=n.computed(function(){return this.allowDragNDrop()&&this.composeUploaderBodyDragOver()},this),this.uploaderDragOver=n.computed(function(){return this.allowDragNDrop()&&this.composeUploaderDragOver()},this),this.selectedImportance=n.observable(Enums.Importance.Normal).extend({reversible:!0}),this.senderAccountId=R.senderAccountId,this.senderList=R.senderList,this.visibleFrom=n.computed(function(){return c.isNewTab()||this.senderList().length>1||this.senderAccountId()!==L.currentAccountId()},this),this.selectedSender=R.selectedSender,this.selectedFetcherOrIdentity=R.selectedFetcherOrIdentity,this.selectedFetcherOrIdentity.subscribe(function(){this.oHtmlEditor.clearUndoRedo(),this.oHtmlEditor.commit()},this),this.signature=n.observable(""),this.prevSignature=n.observable(null),n.computed(function(){var e=E.getClearSignature(this.senderAccountId(),this.selectedFetcherOrIdentity());null===this.prevSignature()?(this.prevSignature(e),this.signature(e)):(this.prevSignature(this.signature()),this.signature(e),this.oHtmlEditor.changeSignatureContent(this.signature(),this.prevSignature()))},this),this.lockToAddr=n.observable(!1),this.toAddr=n.observable("").extend({reversible:!0}),this.toAddr.subscribe(function(){this.lockToAddr()||(o(this.toAddrDom()).val(this.toAddr()),o(this.toAddrDom()).inputosaurus("refresh"))},this),this.lockCcAddr=n.observable(!1),this.ccAddr=n.observable("").extend({reversible:!0}),this.ccAddr.subscribe(function(){this.lockCcAddr()||(o(this.ccAddrDom()).val(this.ccAddr()),o(this.ccAddrDom()).inputosaurus("refresh"))},this),this.lockBccAddr=n.observable(!1),this.bccAddr=n.observable("").extend({reversible:!0}),this.bccAddr.subscribe(function(){this.lockBccAddr()||(o(this.bccAddrDom()).val(this.bccAddr()),o(this.bccAddrDom()).inputosaurus("refresh"))},this),this.recipientEmails=n.computed(function(){var e=[this.toAddr(),this.ccAddr(),this.bccAddr()].join(",").split(","),t=[];return i.each(e,function(e){var s=o.trim(e),i=null;""!==s&&(i=r.getEmailParts(s)).email&&t.push(i.email)}),t},this),this.subject=n.observable("").extend({reversible:!0}),this.textBody=n.observable(""),this.textBody.subscribe(function(e){this.oHtmlEditor.setText(this.textBody(),this.oHtmlEditor.plainTextMode()),this.oHtmlEditor.commit()},this),this.focusedField=n.observable(),this.oHtmlEditor.textFocused.subscribe(function(e){this.oHtmlEditor.textFocused()&&this.focusedField("text")},this),this.subjectFocused=n.observable(!1),this.subjectFocused.subscribe(function(){this.subjectFocused()&&this.focusedField("subject")},this),this.templateUid=n.observable(""),this.templateFolderName=n.observable(L.getTemplateFolder()),this.draftUid=n.observable(""),this.draftUid.subscribe(function(){L.editedDraftUid(this.draftUid())},this),this.draftInfo=n.observableArray([]),this.routeType=n.observable(""),this.routeParams=n.observableArray([]),this.inReplyTo=n.observable(""),this.references=n.observable(""),this.bUploadStatus=!1,this.iUploadAttachmentsTimer=0,this.messageUploadAttachmentsStarted=n.observable(!1),this.messageUploadAttachmentsStarted.subscribe(function(t){window.clearTimeout(e.iUploadAttachmentsTimer),t?e.iUploadAttachmentsTimer=window.setTimeout(function(){e.bUploadStatus=!0,b.showLoading(l.i18n("MAILWEBCLIENT/INFO_ATTACHMENTS_LOADING"))},4e3):e.bUploadStatus?e.iUploadAttachmentsTimer=window.setTimeout(function(){e.bUploadStatus=!1,b.hideLoading()},1e3):b.hideLoading()},this),this.attachments=n.observableArray([]),this.attachmentsChanged=n.observable(!1),this.attachments.subscribe(function(){this.attachmentsChanged(!0)},this),this.notUploadedAttachments=n.computed(function(){return i.filter(this.attachments(),function(e){return!e.uploaded()})},this),this.allAttachmentsUploaded=n.computed(function(){return 0===this.notUploadedAttachments().length&&!this.messageUploadAttachmentsStarted()},this),this.notInlineAttachments=n.computed(function(){return i.filter(this.attachments(),function(e){return!e.linked()})},this),this.notInlineAttachments.subscribe(function(){H.toggleClass("screen-compose-attachments",this.notInlineAttachments().length>0)},this),this.allowStartSending=n.computed(function(){return!this.saving()},this),this.allowStartSending.subscribe(function(){this.allowStartSending()&&this.requiresPostponedSending()&&(E.sendPostponedMail(this.draftUid()),this.requiresPostponedSending(!1))},this),this.requiresPostponedSending=n.observable(!1),this.oJua=null,this.isDraftsCleared=n.observable(!1),this.backToListOnSendOrSave=n.observable(!1),this.composeShown=n.computed(function(){return!!this.opened&&this.opened()||!!this.shown&&this.shown()},this),this.toolbarControllers=n.observableArray([]),this.messageRowControllers=n.observableArray([]),this.uploadAttachmentsController=n.observableArray([]),this.allControllers=n.computed(function(){return i.union(this.toolbarControllers(),this.messageRowControllers(),this.uploadAttachmentsController())},this),this.disableHeadersEdit=n.computed(function(){var e=!1;return i.each(this.allControllers(),function(t){e=e||!!t.disableHeadersEdit&&t.disableHeadersEdit()}),e},this),this.disableFromEdit=n.computed(function(){var e=!1;return i.each(this.allControllers(),function(t){e=e||!!t.disableFromEdit&&t.disableFromEdit()}),e},this),this.messageSignedOrEncrypted=n.computed(function(){var e=!1;return i.each(this.allControllers(),function(t){i.isFunction(t.pgpEncrypted)&&i.isFunction(t.pgpSecured)&&(e=e||t.pgpEncrypted()||t.pgpSecured())}),e},this),n.computed(function(){var e=!1;i.each(this.allControllers(),function(t){e=e||!!t.disableBodyEdit&&t.disableBodyEdit()}),this.oHtmlEditor.setDisableEdit(e)},this),this.draftFolderIsAvailable=n.computed(function(){return!!L.folderList().draftsFolder()},this),this.disableAutosave=n.observable(!1),N.AllowAutosaveInDrafts&&N.AutoSaveIntervalSeconds>0&&(this.iAutosaveInterval=-1,n.computed(function(){var e=this.draftFolderIsAvailable()&&this.composeShown()&&!this.sending()&&!this.saving()&&!this.disableAutosave()&&!L.disableComposeAutosave();i.each(this.allControllers(),function(t){e=e&&!(t.disableAutosave&&t.disableAutosave())}),window.clearInterval(this.iAutosaveInterval),e&&(this.iAutosaveInterval=window.setInterval(i.bind(this.executeSave,this,!0),1e3*N.AutoSaveIntervalSeconds))},this)),this.backToListCommand=d.createCommand(this,this.executeBackToList),this.sendCommand=d.createCommand(this,this.executeSend,this.isEnableSending),this.saveCommand=d.createCommand(this,this.executeSaveCommand,this.isEnableSaving),this.visibleSaveTemplateControl=n.observable(!1),this.saveTemplateCommand=d.createCommand(this,this.executeTemplateSaveCommand,this.isEnableSaving),this.messageFields=n.observable(null),this.bottomPanel=n.observable(null),this.sHotkeysHintsViewTemplate=u.mobileDevice?"":"MailWebclient_Compose_HotkeysHintsView",this.sPopupButtonsViewTemplate=c.isNewTab()?"":"MailWebclient_Compose_PopupButtonsView",this.aHotkeys=[{value:"Ctrl+S",action:l.i18n("MAILWEBCLIENT/LABEL_SAVE_HOTKEY"),visible:this.draftFolderIsAvailable}].concat(this.oHtmlEditor.getHotKeysDescriptions()),N.AllowQuickSendOnCompose&&this.aHotkeys.unshift({value:"Ctrl+Enter",action:l.i18n("MAILWEBCLIENT/LABEL_SEND_HOTKEY"),visible:n.observable(!0)}),this.bAllowFiles=!!C,this.ignoreHasUnsavedChanges=n.observable(!1),this.changedInPreviousWindow=n.observable(!1),this.hasUnsavedChanges=n.computed(function(){return!this.ignoreHasUnsavedChanges()&&this.isChanged()&&this.isEnableSaving()},this),this.saveAndCloseTooltip=n.computed(function(){return this.draftFolderIsAvailable()&&this.hasUnsavedChanges()?l.i18n("MAILWEBCLIENT/ACTION_SAVE_CLOSE"):l.i18n("MAILWEBCLIENT/ACTION_CLOSE")},this),this.splitterDom=n.observable(),this.headersCompressed=n.observable(!1),this.allowCcBccSwitchers=n.computed(function(){return!this.disableHeadersEdit()&&!this.headersCompressed()},this),this.registerOwnToolbarControllers(),this.setAutoEncryptSubscribes(),c.broadcastEvent("MailWebclient::ConstructView::after",{Name:this.ViewConstructorName,View:this})}i.extendOwn(k.prototype,v.prototype),i.extendOwn(k.prototype,P.prototype),k.prototype.ViewTemplate=c.isNewTab()?"MailWebclient_ComposeScreenView":"MailWebclient_ComposeView",k.prototype.ViewConstructorName="CComposeView",k.prototype.isEnableSending=function(){var e=0===this.toAddr().length&&0===this.ccAddr().length&&0===this.bccAddr().length;return this.folderList()&&0!==this.folderList().iAccountId&&!this.sending()&&!e&&this.allAttachmentsUploaded()},k.prototype.isEnableSaving=function(){var e=this.folderList()&&0!==this.folderList().iAccountId;return this.composeShown()&&e&&!this.sending()&&!this.saving()},k.prototype.initInputosaurus=function(e,t,s,n){if(e()&&o(e()).length>0){var r={storage:"all",addContactGroups:!0,addUserGroups:N.AllowUserGroupsInComposeAutocomplete,addEmailsToGroups:!0,exceptEmail:"",withoutEmptyEmails:!0},a=g.run("ContactsWebclient","getSuggestionsAutocompleteCallback",[r]),l={width:"auto",parseOnBlur:!0,autoCompleteSource:i.isFunction(a)?a:function(){},autoCompleteDeleteItem:g.run("ContactsWebclient","getSuggestionsAutocompleteDeleteHandler")||function(){},autoCompleteAppendTo:o(e()).closest("td"),change:i.bind(function(e){s(!0),this.setRecipient(t,e.target.value),s(!1)},this),copy:i.bind(function(e){this.inputosaurusBuffer=e},this),paste:i.bind(function(){var e=this.inputosaurusBuffer||"";return this.inputosaurusBuffer="",e},this),focus:i.bind(this.focusedField,this,n),mobileDevice:u.mobileDevice};o(e()).inputosaurus(i.extendOwn(l,this.getInputosaurusMethods()))}},k.prototype.changeHeadersCompressed=function(){this.headersCompressed(!this.headersCompressed())},k.prototype.onBind=function(){g.run("SessionTimeoutWeblient","registerFunction",[i.bind(this.executeSave,this,!1)]),c.isMobile()||this.hotKeysBind()},k.prototype.hotKeysBind=function(){(this.$popupDom||this.$viewDom).on("keydown",o.proxy(function(e){if(e&&e.ctrlKey&&!e.altKey&&!e.shiftKey){var t=e.keyCode,s=this.composeShown()&&(!this.minimized||!this.minimized())&&e&&e.ctrlKey;s&&t===Enums.Key.s?(e.preventDefault(),e.returnValue=!1,this.isEnableSaving()&&this.saveCommand()):N.AllowQuickSendOnCompose&&s&&t===Enums.Key.Enter&&""!==this.toAddr()&&this.sendCommand()}},this))},k.prototype.getMessageOnRoute=function(){var e=S.parseCompose(this.routeParams()),t=T.getAccountByHash(e.AccountHash);t&&""!==this.routeType()&&e.MessageFolderName&&e.MessageUid&&L.getMessage(t.id(),e.MessageFolderName,e.MessageUid,this.onMessageResponse,this)},k.prototype.onShow=function(){this.reset();var e=this.focusedField();o(this.splitterDom()).trigger("resize"),o(this.bottomPanel()).trigger("resize"),this.oHtmlEditor.init(this.textBody(),this.oHtmlEditor.plainTextMode(),"7"),this.oHtmlEditor.commit(),this.initUploader(),this.backToListOnSendOrSave(!1),this.focusedField(e),H.addClass("screen-compose"),this.oJua&&this.oJua.setDragAndDropEnabledStatus(!0),this.visibleSaveTemplateControl(L.getCurrentTemplateFolders().length>0)},k.prototype.reset=function(){this.setTextBody("",!1),this.bUploadStatus=!1,window.clearTimeout(this.iUploadAttachmentsTimer),this.messageUploadAttachmentsStarted(!1),this.templateUid(""),this.templateFolderName(L.getTemplateFolder()),this.draftUid(""),this.draftInfo.removeAll(),this.setDataFromMessage(new D),this.isDraftsCleared(!1),this.ignoreHasUnsavedChanges(!1)},k.prototype.setTextBody=function(e,t){this.oHtmlEditor.plainTextMode(t),this.textBody(e)},k.prototype.onRoute=function(e){this.setDataFromMessage(new D);var t=S.parseCompose(e);switch(c.isNewTab()&&T.changeCurrentAccountByHash(t.AccountHash),this.routeType(t.RouteType),this.routeType()){case Enums.ReplyType.ForwardAsAttach:this.routeParams(e),this.fillDefault(t);case Enums.ReplyType.Reply:case Enums.ReplyType.ReplyAll:case Enums.ReplyType.Resend:case Enums.ReplyType.Forward:case"drafts":this.routeParams(e),0!==this.folderList().iAccountId&&this.getMessageOnRoute();break;case"data":var s=t.Object;if(s){s.to&&this.setRecipient(this.toAddr,s.to),s.subject&&this.subject(s.subject),s.selectedSenderId&&this.selectedSender(s.selectedSenderId);var i=!s.isHtml,o="<div></div>";if(s.body&&(o=s.isHtml?"<div>"+s.body+"</div>":s.body),s.replyToMessage){var n=E.getReplyDataFromMessage(s.replyToMessage,Enums.ReplyType.Reply,c.currentAccountId(),null,!0);this.draftInfo(n.DraftInfo),this.draftUid(n.DraftUid),this.setRecipient(this.toAddr,n.To),this.setRecipient(this.ccAddr,n.Cc),this.setRecipient(this.bccAddr,n.Bcc),this.subject(n.Subject),i=!1,o=n.Text,this.attachments(n.Attachments),this.inReplyTo(n.InReplyTo),this.references(n.References),this.requestAttachmentsTempName()}s.attachments&&this.addAttachments(s.attachments),this.setTextBody(o,i),this.triggerToolbarControllersAfterPopulatingMessage(!0,i,o),this.commit(!0)}break;default:this.routeParams(e),this.fillDefault(t)}},k.prototype.fillDefault=function(e){var t=E.getSignatureText(this.senderAccountId(),this.selectedFetcherOrIdentity(),!0),s=B?B.getComposedMessage(window.name):null,o=e.ToAddr;s?(this.setMessageDataInNewTab(s),this.changedInPreviousWindow()&&i.defer(i.bind(this.executeSave,this,!0))):""!==t&&this.setTextBody("<br /><br />"+t+"<br />",!1),o&&(this.setRecipient(this.toAddr,o.to),o.hasMailto&&(this.subject(o.subject),this.setRecipient(this.ccAddr,o.cc),this.setRecipient(this.bccAddr,o.bcc),""!==o.body&&this.setTextBody("<div>"+o.body+"</div>",!1))),this.routeType()===Enums.ReplyType.ForwardAsAttach&&e.Object&&this.addMessageAsAttachment(e.Object),"attachments"===this.routeType()&&e.Object&&this.addAttachments(e.Object),i.defer(i.bind(function(){this.focusAfterFilling()},this)),this.visibleCc(""!==this.ccAddr()),this.visibleBcc(""!==this.bccAddr()),this.commit(!0)},k.prototype.focusToAddr=function(){o(this.toAddrDom()).inputosaurus("focus")},k.prototype.focusCcAddr=function(){o(this.ccAddrDom()).inputosaurus("focus")},k.prototype.focusBccAddr=function(){o(this.bccAddrDom()).inputosaurus("focus")},k.prototype.focusAfterFilling=function(){switch(this.focusedField()){case"to":this.focusToAddr();break;case"cc":this.visibleCc(!0),this.focusCcAddr();break;case"bcc":this.visibleBcc(!0),this.focusBccAddr();break;case"subject":this.subjectFocused(!0);break;case"text":this.oHtmlEditor.setFocus();break;default:0===this.toAddr().length?this.focusToAddr():0===this.subject().length?this.subjectFocused(!0):this.oHtmlEditor.setFocus()}},k.prototype.onHide=function(){!i.isFunction(this.closePopup)&&this.hasUnsavedChanges()&&this.executeSave(!0),this.headersCompressed(!1),this.routeParams([]),this.subjectFocused(!1),this.focusedField(""),this.messageUploadAttachmentsStarted(!1),H.removeClass("screen-compose").removeClass("screen-compose-cc").removeClass("screen-compose-bcc").removeClass("screen-compose-attachments"),this.oJua&&this.oJua.setDragAndDropEnabledStatus(!1),this.recipientsInfo({}),this.recipientsInfo.valueHasMutated()},k.prototype.setRecipient=function(e,t){e()===t?e.valueHasMutated():e(t)},k.prototype.onMessageResponse=function(e){var t=null;if(null===e)this.setDataFromMessage(new D);else{switch(this.routeType()){case Enums.ReplyType.Reply:case Enums.ReplyType.ReplyAll:R.setFetcherOrIdentityByReplyMessage(e),t=E.getReplyDataFromMessage(e,this.routeType(),this.senderAccountId(),this.selectedFetcherOrIdentity(),!0),this.draftInfo(t.DraftInfo),this.draftUid(t.DraftUid),this.setRecipient(this.toAddr,t.To),this.setRecipient(this.ccAddr,t.Cc),this.setRecipient(this.bccAddr,t.Bcc),this.subject(t.Subject),this.setTextBody(t.Text,!1),this.attachments(t.Attachments),this.inReplyTo(t.InReplyTo),this.references(t.References);break;case Enums.ReplyType.ForwardAsAttach:t=E.getReplyDataFromMessage(e,this.routeType(),this.senderAccountId(),this.selectedFetcherOrIdentity(),!0),this.draftInfo(t.DraftInfo),this.draftUid(t.DraftUid),this.inReplyTo(t.InReplyTo),this.references(t.References);break;case Enums.ReplyType.Forward:R.setFetcherOrIdentityByReplyMessage(e),t=E.getReplyDataFromMessage(e,this.routeType(),this.senderAccountId(),this.selectedFetcherOrIdentity(),!0),this.draftInfo(t.DraftInfo),this.draftUid(t.DraftUid),this.setRecipient(this.toAddr,t.To),this.setRecipient(this.ccAddr,t.Cc),this.subject(t.Subject),this.setTextBody(t.Text,!1),this.attachments(t.Attachments),this.inReplyTo(t.InReplyTo),this.references(t.References);break;case Enums.ReplyType.Resend:this.setDataFromMessage(e);break;case"drafts":if(-1!==o.inArray(e.folder(),L.getCurrentTemplateFolders()))this.templateUid(e.uid()),this.templateFolderName(e.folder());else{var s=L.oFolderListItems[e.accountId()];(s?s.draftsFolderFullName():"")===e.folder()&&this.draftUid(e.uid())}this.setDataFromMessage(e)}this.routeType()!==Enums.ReplyType.ForwardAsAttach&&this.attachments().length>0&&this.requestAttachmentsTempName(),this.routeType("")}if(this.visibleCc(""!==this.ccAddr()),this.visibleBcc(""!==this.bccAddr()),this.commit(!0),i.defer(i.bind(function(){this.focusAfterFilling()},this)),e){var n={AccountId:e.accountId(),FolderFullName:e.folder(),MessageUid:e.uid(),Compose:this};if(this.allAttachmentsUploaded())c.broadcastEvent("MailWebclient::ComposeMessageLoaded",n);else var r=this.allAttachmentsUploaded.subscribe(function(){this.allAttachmentsUploaded()&&c.broadcastEvent("MailWebclient::ComposeMessageLoaded",n),r.dispose()},this)}},k.prototype.setDataFromMessage=function(e){var t,s=E.getFirstFetcherOrIdentityByRecipientsOrDefault(e.oFrom.aCollection,e.accountId());R.changeSenderAccountId(e.accountId(),s),t=e.isPlain()?e.textRaw():e.getConvertedHtml(),this.draftInfo(e.draftInfo()),this.inReplyTo(e.inReplyTo()),this.references(e.references()),this.setRecipient(this.toAddr,e.oTo.getFull()),this.setRecipient(this.ccAddr,e.oCc.getFull()),this.setRecipient(this.bccAddr,e.oBcc.getFull()),this.subject(e.subject()),this.attachments(e.attachments()),this.setTextBody(t,e.isPlain()),this.selectedImportance(e.importance()),this.sendReadingConfirmation(""!==e.readingConfirmationAddressee());var i=!!e.folderObject()&&e.folderObject().type()===Enums.FolderTypes.Drafts;this.triggerToolbarControllersAfterPopulatingMessage(i,e.isPlain(),e.textRaw(),e.sensitivity())},k.prototype.triggerToolbarControllersAfterPopulatingMessage=function(e,t,s,o){i.each(this.allControllers(),function(n){i.isFunction(n.doAfterPopulatingMessage)&&n.doAfterPopulatingMessage({bDraft:e,bPlain:t,sRawText:s,iSensitivity:o})}.bind(this))},k.prototype.onDataAsAttachmentUpload=function(e,t){var s=t.Parameters,o=e.Result,n=s.Hash,r=i.find(this.attachments(),function(e){return e.hash()===n});this.messageUploadAttachmentsStarted(!1),r&&(o&&o.Attachment?r.parseFromUpload(o.Attachment):r.errorFromUpload())},k.prototype.addAttachments=function(e){i.each(e,i.bind(function(e){var t=new x(this.senderAccountId());t.parseFromUpload(e),this.attachments.push(t)},this))},k.prototype.addFilesAsAttachment=function(e){var t=null,s=[];i.each(e,function(e){(t=new x(this.senderAccountId())).fileName(e.fileName()),t.hash(e.hash()),t.thumbUrlInQueue(e.thumbUrlInQueue()),t.uploadStarted(!0),this.attachments.push(t),s.push(e.hash())},this),s.length>0&&(this.messageUploadAttachmentsStarted(!0),m.send("Files","GetFilesForUpload",{Hashes:s},this.onFilesUpload,this))},k.prototype.addUploadingAttachments=function(e){var t=this;Array.isArray(e)&&e.length>0&&(e.forEach(function(e){t.attachments.push(e)}),this.messageUploadAttachmentsStarted(!0))},k.prototype.onFilesUpload=function(e,t){var s=t.Parameters,o=e.Result,n=s.Hashes;this.messageUploadAttachmentsStarted(!1),i.isArray(o)?i.each(o,function(e){var t=i.find(this.attachments(),function(t){return t.hash()===e.Hash});t&&(t.parseFromUpload(e),t.hash(e.NewHash))},this):i.each(n,function(e){var t=i.find(this.attachments(),function(t){return t.hash()===e});t&&t.errorFromUpload()},this)},k.prototype.addMessageAsAttachment=function(e){var t=new x(e.accountId()),s=null;e&&(t.fileName(e.subject()+".eml"),t.uploadStarted(!0),this.attachments.push(t),s={AccountID:e.accountId(),MessageFolder:e.folder(),MessageUid:e.uid(),FileName:t.fileName()},this.messageUploadAttachmentsStarted(!0),w.send("SaveMessageAsTempFile",s,this.onSaveMessageAsTempFile,this))},k.prototype.onSaveMessageAsTempFile=function(e,t){var s=e.Result,o=t.Parameters.FileName,n=null;this.messageUploadAttachmentsStarted(!1),s?(n=i.find(this.attachments(),function(e){return e.fileName()===o&&e.uploadStarted()}))&&n.parseFromUpload(s,t.Parameters.MessageFolder,t.Parameters.MessageUid):(n=i.find(this.attachments(),function(e){return e.fileName()===o&&e.uploadStarted()}))&&n.errorFromUpload()},k.prototype.onContactVCardUpload=function(e,t){var s=t.Parameters,o=e.Result,n=null;this.messageUploadAttachmentsStarted(!1),o?(n=i.find(this.attachments(),function(e){return e.fileName()===o.Name&&e.uploadStarted()}))&&n.parseFromUpload(o):(n=i.find(this.attachments(),function(e){return e.fileName()===s.Name&&e.uploadStarted()}))&&n.errorFromUpload()},k.prototype.requestAttachmentsTempName=function(){var e=i.map(this.attachments(),function(e){return e.uploadUid(e.hash()),e.uploadStarted(!0),e.hash()});e.length>0&&(this.messageUploadAttachmentsStarted(!0),w.send("SaveAttachmentsAsTempFiles",{AccountID:this.senderAccountId(),Attachments:e},this.onMessageUploadAttachmentsResponse,this))},k.prototype.onMessageUploadAttachmentsResponse=function(e,t){var s=t.Parameters.Attachments;this.messageUploadAttachmentsStarted(!1),e.Result?i.each(e.Result,i.bind(this.setAttachTempNameByHash,this)):(i.each(s,function(e){var t=i.find(this.attachments(),function(t){return t.hash()===e});t&&t.errorFromUpload()},this),b.showError(l.i18n("MAILWEBCLIENT/ERROR_UPLOAD_FORWARD_ATTACHMENTS")))},k.prototype.setAttachTempNameByHash=function(e,t){i.each(this.attachments(),function(s){s.hash()===e&&(s.tempName(t),s.uploadStarted(!1))})},k.prototype.setMessageDataInNewTab=function(e){this.templateUid(e.templateUid),this.templateFolderName(e.templateFolderName),this.draftInfo(e.draftInfo),this.draftUid(e.draftUid),this.inReplyTo(e.inReplyTo),this.references(e.references),this.setRecipient(this.toAddr,e.toAddr),this.setRecipient(this.ccAddr,e.ccAddr),this.setRecipient(this.bccAddr,e.bccAddr),this.subject(e.subject),this.attachments(i.map(e.attachments,function(t){var s=new x(e.senderAccountId);return s.parse(t),s},this)),this.setTextBody(e.textBody,e.plainTextMode),this.selectedImportance(e.selectedImportance),this.sendReadingConfirmation(e.sendReadingConfirmation),this.changedInPreviousWindow(e.changedInPreviousWindow),i.each(this.allControllers(),function(t){i.isFunction(t.doAfterApplyingMainTabParameters)&&t.doAfterApplyingMainTabParameters(e)}),R.changeSenderAccountId(e.senderAccountId,e.selectedFetcherOrIdentity),this.focusedField(e.focusedField)},k.prototype.commit=function(e){this.toAddr.commit(),this.ccAddr.commit(),this.bccAddr.commit(),this.subject.commit(),this.selectedImportance.commit(),this.sendReadingConfirmation.commit(),i.each(this.allControllers(),function(e){i.isFunction(e.commit)&&e.commit()}),this.oHtmlEditor.commit(),this.attachmentsChanged(!1),e||this.changedInPreviousWindow(!1)},k.prototype.isChanged=function(){var e=this.toAddr.changed(),t=this.ccAddr.changed(),s=this.bccAddr.changed(),o=this.subject.changed(),n=this.selectedImportance.changed(),r=this.sendReadingConfirmation.changed(),a=!1,l=this.oHtmlEditor.textChanged(),h=this.attachmentsChanged(),d=this.changedInPreviousWindow();return i.each(this.allControllers(),function(e){i.isFunction(e.isChanged)&&(a=a||e.isChanged())}),e||t||s||o||n||r||a||l||h||d},k.prototype.executeBackToList=function(){c.isNewTab()?window.close():this.shown&&this.shown()&&f.setPreviousHash(),this.backToListOnSendOrSave(!1)},k.prototype.onFileUploadSelect=function(e,t){var s;return!a.showErrorIfAttachmentSizeLimit(t.FileName,h.pInt(t.Size))&&((s=new x(this.senderAccountId())).onUploadSelect(e,t),this.attachments.push(s),!0)},k.prototype.getAttachmentByUid=function(e){return i.find(this.attachments(),function(t){return t.uploadUid()===e})},k.prototype.onFileUploadStart=function(e){var t=this.getAttachmentByUid(e);t&&t.onUploadStart()},k.prototype.onFileUploadProgress=function(e,t,s){var i=this.getAttachmentByUid(e);i&&i.onUploadProgress(t,s)},k.prototype.onFileUploadComplete=function(e,t,s){var i=this.getAttachmentByUid(e);i&&i.onUploadComplete(e,t,s)},k.prototype.onFileRemove=function(e){var t=this.getAttachmentByUid(e);this.oJua&&this.oJua.cancel(e),this.attachments.remove(t)},k.prototype.initUploader=function(){this.composeShown()&&this.composeUploaderButton()&&(this.oJua=new p({action:"?/Api/",name:"jua-uploader",queueSize:2,clickElement:this.composeUploaderButton(),hiddenElementsPosition:y.IsRTL?"right":"left",dragAndDropElement:this.composeUploaderDropPlace(),disableAjaxUpload:!1,disableFolderDragAndDrop:!1,disableDragAndDrop:!1,hidden:i.extendOwn({Module:N.ServerModuleName,Method:"UploadAttachment",Parameters:function(){return JSON.stringify({AccountID:L.currentAccountId()})}},c.getCommonRequestParameters())}),this.oJua.on("onDragEnter",i.bind(this.composeUploaderDragOver,this,!0)).on("onDragLeave",i.bind(this.composeUploaderDragOver,this,!1)).on("onBodyDragEnter",i.bind(this.composeUploaderBodyDragOver,this,!0)).on("onBodyDragLeave",i.bind(this.composeUploaderBodyDragOver,this,!1)).on("onProgress",i.bind(this.onFileUploadProgress,this)).on("onSelect",i.bind(this.onFileUploadSelect,this)).on("onStart",i.bind(this.onFileUploadStart,this)).on("onComplete",i.bind(this.onFileUploadComplete,this)),this.allowDragNDrop(this.oJua.isDragAndDropSupported()))},k.prototype.getSendSaveParameters=function(e,t){var s=E.convertAttachmentsForSending(this.attachments()),o=null;return i.each(this.oHtmlEditor.getUploadedImagesData(),function(e){s[e.TempName]=[e.Name,e.CID,"1","1"]}),o={AccountID:this.senderAccountId(),IdentityID:this.selectedFetcherOrIdentity()&&this.selectedFetcherOrIdentity().IDENTITY?this.selectedFetcherOrIdentity().id():"",AliasID:this.selectedFetcherOrIdentity()&&this.selectedFetcherOrIdentity().ALIAS?this.selectedFetcherOrIdentity().id():"",FetcherID:this.selectedFetcherOrIdentity()&&this.selectedFetcherOrIdentity().FETCHER?this.selectedFetcherOrIdentity().id():"",DraftInfo:this.draftInfo(),DraftUid:this.draftUid(),To:this.toAddr(),Cc:this.ccAddr(),Bcc:this.bccAddr(),Subject:this.subject(),Text:this.oHtmlEditor.getText(e),IsHtml:!this.oHtmlEditor.plainTextMode(),Importance:this.selectedImportance(),SendReadingConfirmation:this.sendReadingConfirmation(),Attachments:s,InReplyTo:this.inReplyTo(),References:this.references()},i.each(this.allControllers(),function(e){i.isFunction(e.doAfterPreparingSendMessageParameters)&&e.doAfterPreparingSendMessageParameters(o)}),""!==this.templateFolderName()&&t&&(o.DraftFolder=this.templateFolderName(),o.DraftUid=this.templateUid()),o},k.prototype.onSendOrSaveMessageResponse=function(e,t){var s=E.onSendOrSaveMessageResponse(e,t,this.requiresPostponedSending()),o=t.Parameters;switch(this.commit(),s.Method){case"SaveMessage":s.Result&&o.DraftUid===this.templateUid()&&o.DraftFolder===this.templateFolderName()?(this.templateUid(h.pString(s.NewUid)),this.composeShown()&&this instanceof k&&f.replaceHashDirectly(S.getComposeFromMessage("drafts",L.currentAccountId(),o.DraftFolder,this.templateUid()))):s.Result&&o.DraftUid===this.draftUid()&&(this.draftUid(h.pString(s.NewUid)),this.composeShown()&&this instanceof k&&f.replaceHashDirectly(S.getComposeFromMessage("drafts",L.currentAccountId(),o.DraftFolder,this.draftUid()))),this.saving(!1);break;case"SendMessage":s.Result&&this.backToListOnSendOrSave()&&(i.isFunction(this.closePopup)?this.closePopup():this.executeBackToList()),this.sending(!1)}},k.prototype.verifyDataForSending=function(){var e=r.getIncorrectEmailsFromAddressString(this.toAddr()),t=r.getIncorrectEmailsFromAddressString(this.ccAddr()),s=r.getIncorrectEmailsFromAddressString(this.bccAddr()),o=i.union(e,t,s),n=i.map(o,function(e){return l.encodeHtml(e)}),a=l.i18n("MAILWEBCLIENT/ERROR_INPUT_CORRECT_EMAILS")+n.join(", ");return!(o.length>0&&(F.showPopup(I,[a]),1))},k.prototype.executeSend=function(e){var t=!1,s=i.bind(function(){this.sending(!0),this.requiresPostponedSending(!this.allowStartSending()),E.send("SendMessage",this.getSendSaveParameters(!0),!0,this.onSendOrSaveMessageResponse,this,this.requiresPostponedSending()),this.backToListOnSendOrSave(!0)},this);this.autoEncryptSignMessage()?this.encryptSignAndSend():this.isEnableSending()&&this.verifyDataForSending()&&(i.each(this.allControllers(),function(e){i.isFunction(e.doBeforeSend)&&(t=t||e.doBeforeSend(s))}),t||s())},k.prototype.executeSaveCommand=function(){this.draftFolderIsAvailable()&&this.executeSave(!1)},k.prototype.executeTemplateSaveCommand=function(){this.executeSave(!1,!0,!0)},k.prototype.executeSave=function(e,t,s){e=!!e,s=!!s;var o=(t=void 0===t||t)?this.onSendOrSaveMessageResponse:E.onSendOrSaveMessageResponse,n=t?this:E,r=i.bind(function(i){i&&(this.saving(t),E.send("SaveMessage",this.getSendSaveParameters(!1,s),!e,o,n))},this),a=!1;this.isEnableSaving()&&(e&&!this.isChanged()||(e||i.each(this.allControllers(),function(e){i.isFunction(e.doBeforeSave)&&(a=a||e.doBeforeSave(r))},this),a||r(!0)),this.backToListOnSendOrSave(!0))},k.prototype.changeBccVisibility=function(){this.visibleBcc(!this.visibleBcc()),this.visibleBcc()?this.focusBccAddr():this.focusToAddr()},k.prototype.changeCcVisibility=function(){this.visibleCc(!this.visibleCc()),this.visibleCc()?this.focusCcAddr():this.focusToAddr()},k.prototype.getMessageDataForNewTab=function(){var e,t=i.map(this.attachments(),function(e){return{FileName:e.fileName(),TempName:e.tempName(),MimeType:e.mimeType(),MimePartIndex:e.mimePartIndex(),EstimatedSize:e.size(),CID:e.cid(),ContentLocation:e.contentLocation(),IsInline:e.inline(),IsLinked:e.linked(),Hash:e.hash()}});return e={accountId:this.senderAccountId(),templateUid:this.templateUid(),templateFolderName:this.templateFolderName(),draftInfo:this.draftInfo(),draftUid:this.draftUid(),inReplyTo:this.inReplyTo(),references:this.references(),senderAccountId:this.senderAccountId(),selectedFetcherOrIdentity:this.selectedFetcherOrIdentity(),toAddr:this.toAddr(),ccAddr:this.ccAddr(),bccAddr:this.bccAddr(),subject:this.subject(),attachments:t,plainTextMode:this.oHtmlEditor.plainTextMode(),textBody:this.oHtmlEditor.getText(),selectedImportance:this.selectedImportance(),sendReadingConfirmation:this.sendReadingConfirmation(),changedInPreviousWindow:this.isChanged(),focusedField:this.focusedField()},i.each(this.allControllers(),function(t){i.isFunction(t.doAfterPreparingMainTabParameters)&&t.doAfterPreparingMainTabParameters(e)}),e},k.prototype.openInNewWindow=function(){var e,t="id"+Math.random().toString(),s=f.buildHashFromArray(S.getCompose());this.ignoreHasUnsavedChanges(!0),e=this.getMessageDataForNewTab(),this.draftUid().length>0&&!this.isChanged()?(s=f.buildHashFromArray(S.getComposeFromMessage("drafts",L.currentAccountId(),L.folderList().draftsFolderFullName(),this.draftUid(),!0)),A.openTab("?message-newtab"+s)):this.templateUid().length>0&&!this.isChanged()?(s=f.buildHashFromArray(S.getComposeFromMessage("drafts",L.currentAccountId(),this.templateFolderName(),this.templateUid(),!0)),A.openTab("?message-newtab"+s)):this.isChanged()?(U.passComposedMessage(t,e),A.openTab("?message-newtab"+s,t)):(this.routeParams().length>0&&(s=f.buildHashFromArray(i.union([N.HashModuleName+"-compose"],this.routeParams()))),A.openTab("?message-newtab"+s)),this.commit(),i.isFunction(this.closePopup)?this.closePopup():this.executeBackToList()},k.prototype.onShowFilesPopupClick=function(){this.bAllowFiles&&F.showPopup(C,[i.bind(this.addFilesAsAttachment,this)])},k.prototype.registerOwnToolbarControllers=function(){this.registerToolbarController({ViewTemplate:"MailWebclient_Compose_BackButtonView",sId:"back",bOnlyMobile:!0,backToListCommand:this.backToListCommand}),this.registerToolbarController({ViewTemplate:"MailWebclient_Compose_SendButtonView",sId:"send",bAllowMobile:!0,sendCommand:this.sendCommand,toolbarControllers:n.computed(function(){return i.filter(this.toolbarControllers(),function(e){return e.bSendButton})},this)}),this.registerToolbarController({ViewTemplate:"MailWebclient_Compose_SaveButtonView",sId:"save",bAllowMobile:!0,visible:this.draftFolderIsAvailable,saveCommand:this.saveCommand}),this.registerToolbarController({ViewTemplate:"MailWebclient_Compose_SaveTemplateButtonView",sId:"save-template",bAllowMobile:!1,visible:this.visibleSaveTemplateControl,saveTemplateCommand:this.saveTemplateCommand}),this.registerToolbarController({ViewTemplate:"MailWebclient_Compose_ImportanceDropdownView",sId:"importance",selectedImportance:this.selectedImportance}),this.registerToolbarController({ViewTemplate:"MailWebclient_Compose_ConfirmationCheckboxView",sId:"confirmation",sendReadingConfirmation:this.sendReadingConfirmation})},k.prototype.registerToolbarController=function(e){var t=c.isMobile()?e.bAllowMobile:!e.bOnlyMobile,s=N.ComposeToolbarOrder.length;t&&(e.bSendButton=!!e.bSendButton,this.toolbarControllers.push(e),this.toolbarControllers(i.sortBy(this.toolbarControllers(),function(e){var t=i.indexOf(N.ComposeToolbarOrder,e.sId);return-1!==t?t:s})),i.isFunction(e.assignComposeExtInterface)&&e.assignComposeExtInterface(this.getExtInterface()))},k.prototype.registerMessageRowController=function(e){(c.isMobile()?e.bAllowMobile:!e.bOnlyMobile)&&(this.messageRowControllers.push(e),i.isFunction(e.assignComposeExtInterface)&&e.assignComposeExtInterface(this.getExtInterface()))},k.prototype.registerUploadAttachmentsController=function(e){(c.isMobile()?e.bAllowMobile:!e.bOnlyMobile)&&(this.uploadAttachmentsController.push(e),i.isFunction(e.assignComposeExtInterface)&&e.assignComposeExtInterface(this.getExtInterface()))},k.prototype.getExtInterface=function(){return{isHtml:i.bind(function(){return!this.oHtmlEditor.plainTextMode()},this),hasAttachments:i.bind(function(){return this.notInlineAttachments().length>0},this),getPlainText:i.bind(this.oHtmlEditor.getPlainText,this.oHtmlEditor),koTextChange:this.oHtmlEditor.textChanged,getFromEmail:i.bind(function(){return this.selectedFetcherOrIdentity()?this.selectedFetcherOrIdentity().email():T.getEmail()},this),getRecipientEmails:i.bind(function(){return this.recipientEmails()},this),getRecipientsInfo:i.bind(function(){return i.values(this.recipientsInfo())},this),getSelectedSender:i.bind(this.selectedSender,this),saveSilently:i.bind(this.executeSave,this,!0),setPlainTextMode:i.bind(this.oHtmlEditor.plainTextMode,this,!0),setPlainText:i.bind(function(e){this.setTextBody(e,!0)},this),setHtmlTextMode:i.bind(this.oHtmlEditor.plainTextMode,this,!1),setHtmlText:i.bind(function(e){this.setTextBody(e,!1)},this),undoHtml:i.bind(this.oHtmlEditor.undoAndClearRedo,this.oHtmlEditor),getSubject:i.bind(function(){return this.subject()},this),koSubject:this.subject,getAutoEncryptSignMessage:function(){return this.autoEncryptSignMessage()}.bind(this),getRecipientsEmpty:function(){return 0===this.toAddr().length&&0===this.ccAddr().length&&0===this.bccAddr().length}.bind(this),getSendSaveParameters:function(){return this.getSendSaveParameters()}.bind(this),isEnableSending:function(){return this.isEnableSending()}.bind(this),isEnableSaving:function(){return this.isEnableSaving()}.bind(this),getDraftFolderFullName:function(e){var t=L.oFolderListItems[e];return t?t.draftsFolderFullName():""},addUploadingAttachments:i.bind(this.addUploadingAttachments,this),onFilesUpload:i.bind(this.onFilesUpload,this),koSenderAccountId:this.senderAccountId,koAllAttachmentsUploaded:this.allAttachmentsUploaded,clearFolderCache:function(e,t){B?B.removeMessagesFromCacheForFolder(e,t):L.removeMessagesFromCacheForFolder(e,t)},commitAndClose:function(){this.commit(),i.isFunction(this.closePopup)?this.closePopup():this.executeBackToList()}.bind(this)}},e.exports=k},TmsQ:(e,t,s)=>{var i=s("a7T2"),o=s("sdEb"),n=s("uQaC"),r=s("IWyd"),a=s("Ua3z"),l=null;function h(){this.oMessages={},setInterval(this.checkAndClear.bind(this),18e5)}h.prototype.get=function(e){var t=JSON.stringify(e);return this.oMessages[t]},h.prototype.set=function(e,t){var s=JSON.stringify(e);this.oMessages[s]=t},h.prototype.requireMailCache=function(){null===l&&(l=s("eGl8"))},h.prototype.checkAndClear=function(){this.requireMailCache();var e=l.getCurrentFolder();if(!e&&l.folderList()&&(e=l.folderList().inboxFolder()),e&&!(o().diff(e.oRelevantInformationLastMoment)>18e5)){var t=i.size(this.oMessages),s=o().add(-4,"hours").unix(),h=8*a.MailsPerPage+700;t>h&&(r.log("checkAndClear",t,a.MailsPerPage,h),i.each(l.messages(),function(e){e.updateLastAccessTime()}),l.currentMessage()&&l.currentMessage().updateLastAccessTime(),i.each(this.oMessages,function(e,t){0!==e.iLastAccessTime&&e.iLastAccessTime<s&&n.destroyObjectWithObservables(this.oMessages,t)}.bind(this)),r.log("checkAndClear",i.size(this.oMessages)))}},h.prototype.remove=function(e){var t=JSON.stringify(e);n.destroyObjectWithObservables(this.oMessages,t)},h.prototype.updateMomentDates=function(){i.each(this.oMessages,function(e){e.updateMomentDate()},this)},e.exports=new h},UVn1:(e,t,s)=>{var i=s("ERH9");e.exports=function(e){this.iId=e?i.pInt(e.EntityId)||i.pInt(e.ServerId):0,this.iTenantId=e?i.pInt(e.TenantId):0,this.sName=e?i.pString(e.Name):"",this.sIncomingServer=e?i.pString(e.IncomingServer):"",this.iIncomingPort=e?i.pInt(e.IncomingPort):143,this.bIncomingUseSsl=!!e&&!!e.IncomingUseSsl,this.sOutgoingServer=e?i.pString(e.OutgoingServer):"",this.iOutgoingPort=e?i.pInt(e.OutgoingPort):25,this.bOutgoingUseSsl=!!e&&!!e.OutgoingUseSsl,this.sDomains=e?i.pString(e.Domains):"",this.sSmtpAuthType=e?i.pString(e.SmtpAuthType):window.Enums.SmtpAuthType.UseUserCredentials,this.sSmtpLogin=e?i.pString(e.SmtpLogin):"",this.sSmtpPassword=e?i.pString(e.SmtpPassword):"",this.bEnableSieve=!!e&&!!e.EnableSieve,this.iSievePort=e&&e.SievePort?i.pInt(e.SievePort):4190,this.bEnableThreading=!!e&&!!e.EnableThreading,this.bUseFullEmailAddressAsLogin=!e||!!e.UseFullEmailAddressAsLogin,this.bSetExternalAccessServers=i.pBool(e&&e.SetExternalAccessServers,!1),this.sExternalAccessImapServer=i.pString(e&&e.ExternalAccessImapServer,""),this.iExternalAccessImapPort=i.pInt(e&&e.ExternalAccessImapPort,143),this.iExternalAccessImapAlterPort=i.pInt(e&&e.ExternalAccessImapAlterPort,0),this.bExternalAccessImapUseSsl=i.pBool(e&&e.ExternalAccessImapUseSsl,!1),this.sExternalAccessPop3Server=i.pString(e&&e.ExternalAccessPop3Server,""),this.iExternalAccessPop3Port=i.pInt(e&&e.ExternalAccessPop3Port,110),this.iExternalAccessPop3AlterPort=i.pInt(e&&e.ExternalAccessPop3AlterPort,0),this.bExternalAccessPop3UseSsl=i.pBool(e&&e.ExternalAccessPop3UseSsl,!1),this.sExternalAccessSmtpServer=i.pString(e&&e.ExternalAccessSmtpServer,""),this.iExternalAccessSmtpPort=i.pInt(e&&e.ExternalAccessSmtpPort,25),this.iExternalAccessSmtpAlterPort=i.pInt(e&&e.ExternalAccessSmtpAlterPort,0),this.bExternalAccessSmtpUseSsl=i.pBool(e&&e.ExternalAccessSmtpUseSsl,!1),this.bAllowToDelete=i.pBool(e&&e.AllowToDelete,!0),this.bAllowEditDomains=i.pBool(e&&e.AllowEditDomains,!0),this.sOwnerType=e?i.pString(e.OwnerType):"",this.bOauthEnable=i.pBool(e&&e.OAuthEnable,!1),this.sOauthName=i.pString(e&&e.OAuthName,""),this.sOauthType=i.pString(e&&e.OAuthType,""),this.sOauthIconUrl=i.pString(e&&e.OAuthIconUrl,"")}},Ua3z:(e,t,s)=>{var i=s("p09A"),o=s("a7T2"),n=s("ERH9"),r=s("yU9o");e.exports={ServerModuleName:"Mail",HashModuleName:"mail",FetchersServerModuleName:"MtaConnector",AliasesServerModuleName:"CpanelIntegrator",EnableMultiTenant:!1,AllowAddAccounts:!1,AllowAutosaveInDrafts:!0,AllowChangeMailQuotaOnMailServer:!1,AllowDefaultAccountForUser:!0,AllowEditDomainsInServer:!0,AllowFetchers:!1,AllowIdentities:!1,AllowAliases:!1,OnlyUserEmailsInIdentities:!1,AllowInsertImage:!0,AllowMultiAccounts:!1,AutoSaveIntervalSeconds:60,AllowTemplateFolders:!1,AllowInsertTemplateOnCompose:!1,MaxTemplatesCountOnCompose:100,AllowAlwaysRefreshFolders:!1,AutocreateMailAccountOnNewUserFirstLogin:!1,IgnoreImapSubscription:!1,ImageUploadSizeLimit:0,AllowUnifiedInbox:!0,AllowScheduledAutoresponder:!1,AllowAppRegisterMailto:!1,AllowChangeInputDirection:!0,FoldersExpandedByDefault:!1,AllowSpamFolder:!0,AllowAddNewFolderOnMainScreen:!1,ComposeToolbarOrder:["back","send","save","importance","MailSensitivity","confirmation","OpenPgp"],DefaultFontName:"Tahoma",DefaultFontSize:3,AlwaysTryUseImageWhilePasting:!0,AllowHorizontalLineButton:!1,AllowComposePlainText:!1,AllowEditHtmlSource:!1,JoinReplyPrefixes:!0,MailsPerPage:20,AllowChangeStarredMessagesSource:!1,StarredMessagesSource:Enums.StarredMessagesSource.InboxOnly,MaxMessagesBodiesSizeToPrefetch:5e4,MessageBodyTruncationThreshold:65e4,MessagesSortBy:{},ShowEmailAsTabName:!0,AllowOtherModulesToReplaceTabsbarHeader:!1,AllowShowMessagesCountInFolderList:!1,showMessagesCountInFolderList:i.observable(!1),AllowSearchMessagesBySubject:!1,PrefixesToRemoveBeforeSearchMessagesBySubject:[],AllowHorizontalLayout:!1,HorizontalLayout:!1,HorizontalLayoutByDefault:!1,DisableRtlRendering:!1,AllowQuickReply:!1,AllowQuickSendOnCompose:!1,AllowUserGroupsInComposeAutocomplete:!0,MarkMessageSeenWhenViewing:!0,MarkMessageSeenWhenAnswerForward:!1,UserLoginPartInAccountDropdown:!1,UseMeRecipientForMessages:!0,userMailAccountsCount:i.observable(0),mailAccountsEmails:i.observableArray([]),ImageResizerOptions:{"MailWebclient/ACTION_MAKE_IMAGE_SMALL":"300px","MailWebclient/ACTION_MAKE_IMAGE_MEDIUM":"600px","MailWebclient/ACTION_MAKE_IMAGE_LARGE":"1200px","MailWebclient/ACTION_MAKE_IMAGE_ORIGINAL":""},init:function(e){var t=e.Core,s=e[this.ServerModuleName],i=e.MailWebclient,a=e[this.FetchersServerModuleName],l=e[this.AliasesServerModuleName];if(o.isEmpty(t)||(this.EnableMultiTenant=n.pBool(t.EnableMultiTenant,this.EnableMultiTenant)),!o.isEmpty(s)){this.AllowAddAccounts=n.pBool(s.AllowAddAccounts,this.AllowAddAccounts),this.AllowAutosaveInDrafts=n.pBool(s.AllowAutosaveInDrafts,this.AllowAutosaveInDrafts),this.AllowChangeMailQuotaOnMailServer=n.pBool(s.AllowChangeMailQuotaOnMailServer,this.AllowChangeMailQuotaOnMailServer),this.AllowDefaultAccountForUser=n.pBool(s.AllowDefaultAccountForUser,this.AllowDefaultAccountForUser),this.AllowEditDomainsInServer=n.pBool(s.AllowEditDomainsInServer,this.AllowEditDomainsInServer),this.AllowIdentities=n.pBool(s.AllowIdentities,this.AllowIdentities),this.OnlyUserEmailsInIdentities=n.pBool(s.OnlyUserEmailsInIdentities,this.OnlyUserEmailsInIdentities),this.AllowInsertImage=n.pBool(s.AllowInsertImage,this.AllowInsertImage),this.AllowMultiAccounts=n.pBool(s.AllowMultiAccounts,this.AllowMultiAccounts),this.AutoSaveIntervalSeconds=n.pNonNegativeInt(s.AutoSaveIntervalSeconds,this.AutoSaveIntervalSeconds),this.AllowTemplateFolders=n.pBool(s.AllowTemplateFolders,this.AllowTemplateFolders),this.AllowInsertTemplateOnCompose=n.pBool(s.AllowInsertTemplateOnCompose,this.AllowInsertTemplateOnCompose),this.MaxTemplatesCountOnCompose=n.pPositiveInt(s.MaxTemplatesCountOnCompose,this.MaxTemplatesCountOnCompose),this.AllowAlwaysRefreshFolders=n.pBool(s.AllowAlwaysRefreshFolders,this.AllowAlwaysRefreshFolders),this.AutocreateMailAccountOnNewUserFirstLogin=n.pBool(s.AutocreateMailAccountOnNewUserFirstLogin,this.AutocreateMailAccountOnNewUserFirstLogin),this.IgnoreImapSubscription=n.pBool(s.IgnoreImapSubscription,this.IgnoreImapSubscription),this.ImageUploadSizeLimit=n.pNonNegativeInt(s.ImageUploadSizeLimit,this.ImageUploadSizeLimit),this.AllowUnifiedInbox=n.pBool(s.AllowUnifiedInbox,this.AllowUnifiedInbox),this.AllowScheduledAutoresponder=n.pBool(s.AllowScheduledAutoresponder,this.AllowScheduledAutoresponder),window.Enums.SmtpAuthType=n.pObject(s.SmtpAuthType),this.MessagesSortBy=o.clone(n.pObject(s.MessagesSortBy,this.MessagesSortBy)),this.MessagesSortBy.Allow=n.pBool(this.MessagesSortBy.Allow,!1),this.MessagesSortBy.List=n.pArray(this.MessagesSortBy.List,[]),this.MessagesSortBy.DefaultSortBy=n.pString(this.MessagesSortBy.DefaultSortBy,"arrival");var h=n.pString(this.MessagesSortBy.DefaultSortOrder,"desc");this.MessagesSortBy.DefaultSortOrder="desc"===h?Enums.SortOrder.Desc:Enums.SortOrder.Asc}o.isEmpty(i)||(this.AllowAppRegisterMailto=n.pBool(i.AllowAppRegisterMailto,this.AllowAppRegisterMailto),this.AllowChangeInputDirection=n.pBool(i.AllowChangeInputDirection,this.AllowChangeInputDirection),this.FoldersExpandedByDefault=n.pBool(i.FoldersExpandedByDefault,this.FoldersExpandedByDefault),this.AllowSpamFolder=n.pBool(i.AllowSpamFolder,this.AllowSpamFolder),this.AllowAddNewFolderOnMainScreen=n.pBool(i.AllowAddNewFolderOnMainScreen,this.AllowAddNewFolderOnMainScreen),this.ComposeToolbarOrder=n.pArray(i.ComposeToolbarOrder,this.ComposeToolbarOrder),this.DefaultFontName=n.pString(i.DefaultFontName,this.DefaultFontName),this.DefaultFontSize=n.pPositiveInt(i.DefaultFontSize,this.DefaultFontSize),this.AlwaysTryUseImageWhilePasting=n.pBool(i.AlwaysTryUseImageWhilePasting,this.AlwaysTryUseImageWhilePasting),this.AllowHorizontalLineButton=n.pBool(i.AllowHorizontalLineButton,this.AllowHorizontalLineButton),this.AllowComposePlainText=n.pBool(i.AllowComposePlainText,this.AllowComposePlainText),this.AllowEditHtmlSource=n.pBool(i.AllowEditHtmlSource,this.AllowEditHtmlSource),this.JoinReplyPrefixes=n.pBool(i.JoinReplyPrefixes,this.JoinReplyPrefixes),this.MailsPerPage=n.pPositiveInt(i.MailsPerPage,this.MailsPerPage),this.AllowChangeStarredMessagesSource=n.pBool(i.AllowChangeStarredMessagesSource,this.AllowChangeStarredMessagesSource),this.AllowChangeStarredMessagesSource&&(this.StarredMessagesSource=n.pEnum(i.StarredMessagesSource,Enums.StarredMessagesSource,Enums.StarredMessagesSource.InboxOnly)),this.MaxMessagesBodiesSizeToPrefetch=n.pNonNegativeInt(i.MaxMessagesBodiesSizeToPrefetch,this.MaxMessagesBodiesSizeToPrefetch),this.MessageBodyTruncationThreshold=n.pNonNegativeInt(i.MessageBodyTruncationThreshold,this.MessageBodyTruncationThreshold),this.ShowEmailAsTabName=n.pBool(i.ShowEmailAsTabName,this.ShowEmailAsTabName),this.AllowOtherModulesToReplaceTabsbarHeader=n.pBool(i.AllowOtherModulesToReplaceTabsbarHeader,this.AllowOtherModulesToReplaceTabsbarHeader),this.AllowShowMessagesCountInFolderList=n.pBool(i.AllowShowMessagesCountInFolderList,this.AllowShowMessagesCountInFolderList),this.showMessagesCountInFolderList(n.pBool(i.ShowMessagesCountInFolderList,this.showMessagesCountInFolderList())),this.AllowSearchMessagesBySubject=n.pBool(i.AllowSearchMessagesBySubject,this.AllowSearchMessagesBySubject),this.PrefixesToRemoveBeforeSearchMessagesBySubject=n.pArray(i.PrefixesToRemoveBeforeSearchMessagesBySubject,this.PrefixesToRemoveBeforeSearchMessagesBySubject),this.AllowHorizontalLayout=n.pBool(i.AllowHorizontalLayout,this.AllowHorizontalLayout),this.HorizontalLayoutByDefault=this.AllowHorizontalLayout&&n.pBool(i.HorizontalLayoutByDefault,this.HorizontalLayoutByDefault),this.HorizontalLayout=this.AllowHorizontalLayout&&n.pBool(i.HorizontalLayout,this.HorizontalLayoutByDefault),this.DisableRtlRendering=n.pBool(i.DisableRtlRendering,this.DisableRtlRendering),this.AllowQuickReply=n.pBool(i.AllowQuickReply,this.AllowQuickReply),this.AllowQuickSendOnCompose=n.pBool(i.AllowQuickSendOnCompose,this.AllowQuickSendOnCompose),this.AllowUserGroupsInComposeAutocomplete=n.pBool(i.AllowUserGroupsInComposeAutocomplete,this.AllowUserGroupsInComposeAutocomplete),this.MarkMessageSeenWhenViewing=n.pBool(i.MarkMessageSeenWhenViewing,this.MarkMessageSeenWhenViewing),this.MarkMessageSeenWhenAnswerForward=n.pBool(i.MarkMessageSeenWhenAnswerForward,this.MarkMessageSeenWhenAnswerForward),this.UserLoginPartInAccountDropdown=n.pBool(i.UserLoginPartInAccountDropdown,this.UserLoginPartInAccountDropdown),this.UseMeRecipientForMessages=n.pBool(i.UseMeRecipientForMessages,this.UseMeRecipientForMessages),this.ImageResizerOptions=n.pObject(i.TextEditorImageResizerOptions,this.ImageResizerOptions)),o.isEmpty(a)||(this.AllowFetchers=n.pBool(a.AllowFetchers,this.AllowFetchers)),o.isEmpty(l)||(this.AllowAliases=n.pBool(l.AllowAliases,this.AllowAliases)),r.registerUserAccountsCount(this.userMailAccountsCount),r.registerAccountsWithPass(this.mailAccountsEmails)},update:function(e){this.AllowAutosaveInDrafts=n.pBool(e.AllowAutosaveInDrafts,this.AllowAutosaveInDrafts),this.AllowChangeInputDirection=n.pBool(e.AllowChangeInputDirection,this.AllowChangeInputDirection),this.MailsPerPage=n.pPositiveInt(e.MailsPerPage,this.MailsPerPage),this.showMessagesCountInFolderList(n.pBool(e.ShowMessagesCountInFolderList,this.showMessagesCountInFolderList())),this.StarredMessagesSource=n.pEnum(e.StarredMessagesSource,Enums.StarredMessagesSource,Enums.StarredMessagesSource.InboxOnly)},updateAdmin:function(e,t,s){this.AutocreateMailAccountOnNewUserFirstLogin=n.pBool(e,this.AutocreateMailAccountOnNewUserFirstLogin),this.AllowAddAccounts=n.pBool(t,this.AllowAddAccounts),this.HorizontalLayoutByDefault=n.pBool(s,this.HorizontalLayoutByDefault)},disableEditDomainsInServer:function(){this.AllowEditDomainsInServer=!1}}},V8Bf:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("sdEb"),a=s("IWyd"),l=s("LKDt"),h=s("ERH9"),d=s("P7bQ"),c=s("Z9uT"),u=s("yU9o"),p=s("ioSH"),m=s("oJUS"),g=s("PMEU"),f=s("MYiO"),b=s("dpSB"),y=s("Fj7m"),A=null,v=s("TmsQ"),F=s("Ua3z"),I=s("WzKm"),C=s("eL/8");function S(e,t){this.iAccountId=e,this.bIsUnifiedInbox=!!t,this.oUnifiedInboxes={},this.bNamespace=!1,this.iDisplayedLevel=0,this.bIgnoreImapSubscription=F.IgnoreImapSubscription,this.bAllowTemplateFolders=F.AllowTemplateFolders,this.isTemplateStorage=n.observable(!1),this.bAllowAlwaysRefreshFolders=F.AllowAlwaysRefreshFolders,this.isAlwaysRefresh=n.observable(!1),this.sDelimiter="",this.bExists=!0,this.sUidNext="",this.sHash="",this.messageCount=n.observable(0),this.unseenMessageCount=n.observable(0),this.iRealUnseenMessageCount=0,this.hasExtendedInfo=n.observable(!1),this.fullName=n.observable(""),this.fullNameHash=n.observable(""),this.parentFullName=n.observable(""),this.parentDisplayFullName=n.observable(""),this.bSelectable=!0,this.subscribed=n.observable(!0),this.name=n.observable(""),this.nameForEdit=n.observable(""),this.subfolders=n.observableArray([]),this.subfoldersMessagesCount=n.observable(0),this.type=n.observable(Enums.FolderTypes.User),this.bVirtual=!1,this.selected=n.observable(!1),this.expanded=n.observable(!1),this.recivedAnim=n.observable(!1).extend({autoResetToFalse:500}),this.edited=n.observable(!1),this.aMessagesDictionaryUids=[],this.oUids={},this.aResponseHandlers=[],this.aRequestedUids=[],this.aRequestedThreadUids=[],this.requestedLists=[],this.hasChanges=n.observable(!1),this.oRelevantInformationLastMoment=null,this.bSubscribtionsInitialized=!1,this.disableMoveTo=n.observable(this.bVirtual||this.bIsUnifiedInbox),this.disableMoveFrom=n.observable(this.bIsUnifiedInbox)}S.prototype.setDisableMoveTo=function(e){this.disableMoveTo(this.bVirtual||this.bIsUnifiedInbox||e)},S.prototype.setDisableMoveFrom=function(e){this.disableMoveFrom(this.bIsUnifiedInbox||e)},S.prototype.requireMailCache=function(){null===A&&(A=s("eGl8"))},S.prototype.setDisplayedLevel=function(e){this.iDisplayedLevel=e},S.prototype.getDisplayedLevel=function(){return this.iDisplayedLevel},S.prototype.getUnifiedInbox=function(e){var t=this.oUnifiedInboxes[e];if(!t){this.requireMailCache();var s=A.oFolderListItems[e];t=s?s.inboxFolder():null,this.oUnifiedInboxes[e]=t}return t},S.prototype.getMessageByUid=function(e){this.requireMailCache();var t=A.getMessageActualIdentifiers(this.iAccountId,this.fullName(),e);return v.get([t.iAccountId,t.sFolder,t.sUid])},S.prototype.removeMessageFromDict=function(e){v.remove([this.iAccountId,this.fullName(),e]),this.aMessagesDictionaryUids=i.without(this.aMessagesDictionaryUids,e),this.aRequestedUids=i.without(this.aRequestedUids,e),this.aRequestedThreadUids=i.without(this.aRequestedThreadUids,e),u.broadcastEvent("MailWebclient::removeMessageFromDict::after",[this.iAccountId,this.fullName(),e])},S.prototype.updateLastAccessTime=function(e){i.each(e,function(e){var t=this.getMessageByUid(e);t&&t.updateLastAccessTime()},this)},S.prototype.doForAllMessages=function(e){var t=[];i.each(this.aMessagesDictionaryUids,function(s){var i=this.getMessageByUid(s);i?e(i):t.push(s)},this),t.length>0&&(this.aMessagesDictionaryUids=i.difference(this.aMessagesDictionaryUids,t),this.aRequestedUids=i.difference(this.aRequestedUids,t),this.aRequestedThreadUids=i.difference(this.aRequestedThreadUids,t))},S.prototype.getFlaggedMessageUids=function(){var e=[];return this.doForAllMessages(function(t){t.flagged()&&e.push(t.uid())}),e},S.prototype.setMessageUnflaggedByUid=function(e){var t=this.getMessageByUid(e);t&&t.flagged(!1)},S.prototype.hideThreadMessages=function(e){i.each(e.threadUids(),function(e){var t=this.getMessageByUid(e);t&&(t.deleted()||(t.threadShowAnimation(!1),t.threadHideAnimation(!0),setTimeout(function(){t.threadHideAnimation(!1)},1e3)))},this)},S.prototype.getThreadMessages=function(e){var t=[],s=[],o=[],n=0,r=null;return i.each(e.threadUids(),function(i){if(n<e.threadCountForLoad()){var a=this.getMessageByUid(i);a?a.deleted()||(a.markAsThreadPart(50,e.uid()),t.push(a),o.push(a.uid()),n++,r=a):(s.push(i),o.push(i),n++)}else o.push(i)},this),e.threadLoading()||this.loadThreadMessages(s),e.changeThreadUids(o,t.length),r&&t.length<e.threadUids().length&&r.showNextLoadingLink(i.bind(e.increaseThreadCountForLoad,e)),t},S.prototype.computeThreadData=function(e){var t=0,s=!1,n=[],r=[],a=e.oFrom.getFirstEmail();i.each(e.threadUids(),function(i){var h=this.bIsUnifiedInbox?this.getUnifiedInbox(e.accountId()):null,d=h?h.getMessageByUid(i):this.getMessageByUid(i),c="";d&&!d.deleted()&&(d.seen()||t++,d.flagged()&&(s=!0),(c=d.oFrom.getFirstEmail())!==a&&-1===o.inArray(c,r)&&(r.push(c),c===y.getEmail()?n.push(l.i18n("MAILWEBCLIENT/LABEL_ME_SENDER")):n.push(d.oFrom.getFirstDisplay())))},this),e.threadUnreadCount(t),e.partialFlagged(s)},S.prototype.loadThreadMessages=function(e){if(e.length>0){var t={AccountID:this.iAccountId,Folder:this.fullName(),Uids:e};d.send("GetMessagesByUids",t,this.onGetMessagesByUidsResponse,this)}},S.prototype.getThreadCheckedUidsFromList=function(e){var t=[];return i.each(e,function(e){e.threadCount()>0&&!e.threadOpened()&&i.each(e.threadUids(),function(s){var i=this.bIsUnifiedInbox?this.getUnifiedInbox(e.accountId()):null,o=i?i.getMessageByUid(s):this.getMessageByUid(s);o&&!o.deleted()&&o.checked()&&t.push(o.longUid())},this)},this),t},S.prototype.parseAndCacheMessage=function(e,t,s){var o=e.Uid.toString(),n=!1,r=this.getMessageByUid(o);return r||(n=!0,r=new I),r.parse(e,this.iAccountId,t,s),this.type()===Enums.FolderTypes.Inbox&&n&&r.flagged()&&(this.requireMailCache(),A.increaseStarredCount()),v.set([r.accountId(),r.folder(),o],r),n&&(this.aRequestedUids=i.without(this.aRequestedUids,o),-1===i.indexOf(this.aMessagesDictionaryUids,o)&&this.aMessagesDictionaryUids.push(o)),r},S.prototype.onGetMessagesByUidsResponse=function(e,t){var s=e.Result;s&&"Collection/MessageCollection"===s["@Object"]&&(i.each(s["@Collection"],function(e){this.parseAndCacheMessage(e,!0,!0)},this),this.requireMailCache(),A.showOpenedThreads(this.fullName()))},S.prototype.addRequestedUids=function(e){this.aRequestedUids=i.union(this.aRequestedUids,e)},S.prototype.hasUidBeenRequested=function(e){return-1!==i.indexOf(this.aRequestedUids,e)},S.prototype.addRequestedThreadUids=function(e){this.aRequestedThreadUids=i.union(this.aRequestedThreadUids,e)},S.prototype.hasThreadUidBeenRequested=function(e){return-1!==i.indexOf(this.aRequestedThreadUids,e)},S.prototype.hasListBeenRequested=function(e){var t=i.where(this.requestedLists,e).length>0;return t||this.requestedLists.push(e),t},S.prototype.markMessageReplied=function(e,t){var s=this.getMessageByUid(e),i=s?A.getFolderByFullName(s.accountId(),s.folder()):null;if(s)switch(t){case Enums.ReplyType.Reply:case Enums.ReplyType.ReplyAll:s.answered(!0),F.MarkMessageSeenWhenAnswerForward&&i&&!s.seen()&&A.executeGroupOperationForFolder("SetMessagesSeen",i,[s.longUid()],"seen",!0);break;case Enums.ReplyType.Forward:case Enums.ReplyType.ForwardAsAttach:s.forwarded(!0),F.MarkMessageSeenWhenAnswerForward&&i&&!s.seen()&&A.executeGroupOperationForFolder("SetMessagesSeen",i,[s.longUid()],"seen",!0)}},S.prototype.removeAllMessages=function(){var e=this.oUids,t=this.aMessagesDictionaryUids;this.aMessagesDictionaryUids=[],this.aRequestedUids=[],this.aRequestedThreadUids=[],this.requestedLists=[],this.oUids={},this.messageCount(0),this.unseenMessageCount(0),this.iRealUnseenMessageCount=0,this.getUidList("","",F.MessagesSortBy.DefaultSortBy,F.MessagesSortBy.DefaultSortOrder).resultCount(0),A.currentMessage()&&A.currentMessage().accountId()===this.iAccountId&&A.currentMessage().folder()===this.fullName()&&(a.log("removeAllMessages, the current message is in the list to remove",A.currentMessage()?{accountId:A.currentMessage().accountId(),folder:A.currentMessage().folder(),uid:A.currentMessage().uid()}:null),t=i.without(t,A.currentMessage().longUid())),i.each(t,function(e){this.removeMessageFromDict(e)},this),t=null,i.each(e,function(e){e.clearData()}),e=null},S.prototype.removeAllMessageListsFromCacheIfHasChanges=function(){this.hasChanges()&&(this.oUids={},this.requestedLists=[],this.aRequestedThreadUids=[],this.hasChanges(!1))},S.prototype.removeMultiFoldersMessageListsFromCache=function(){i.each(this.oUids,function(e){A.isSearchInMultiFolders(e.search())&&(this.requestedLists=i.filter(this.requestedLists,function(t){return t.search!==e.search()}),e.clearData())},this)},S.prototype.removeFlaggedMessageListsFromCache=function(){i.each(this.oUids,function(e){e.filters()===Enums.FolderFilter.Flagged&&e.clearData()},this)},S.prototype.removeUnseenMessageListsFromCache=function(){i.each(this.oUids,function(e){e.filters()===Enums.FolderFilter.Unseen&&e.clearData()},this)},S.prototype.setRelevantInformation=function(e,t,s,i,o){var n=this.hasExtendedInfo()&&(this.sHash!==t||this.iRealUnseenMessageCount!==i||this.unseenMessageCount()!==i);return this.sHash=t,this.iRealUnseenMessageCount=i,this.hasExtendedInfo()&&o||(this.sUidNext=e,this.messageCount(s),this.unseenMessageCount(i),0===i&&this.unseenMessageCount.valueHasMutated()),this.hasExtendedInfo(!0),n&&this.markHasChanges(),this.oRelevantInformationLastMoment=r(),n},S.prototype.increaseCountIfHasNotInfo=function(){this.hasExtendedInfo()||this.messageCount(this.messageCount()+1)},S.prototype.markHasChanges=function(){this.hasChanges(!0)},S.prototype.addMessagesCountsDiff=function(e,t){var s=this.messageCount()+e,i=this.unseenMessageCount()+t;s<0&&(s=0),this.messageCount(s),i<0&&(i=0),i>s&&(i=s),this.unseenMessageCount(i)},S.prototype.markDeletedByUids=function(e){var t=0,s=0;return i.each(e,function(e){var i=this.getMessageByUid(e);i&&(t++,i.seen()||s++,i.deleted(!0))},this),this.addMessagesCountsDiff(-t,-s),A.setUnifiedInboxUnseenChanges(this.iAccountId,this.fullName(),-t,-s),{MinusDiff:t,UnseenMinusDiff:s}},S.prototype.revertDeleted=function(e){var t=0,s=0;return i.each(e,function(e){var i=this.getMessageByUid(e);i&&i.deleted()&&(t++,i.seen()||s++,i.deleted(!1))},this),this.addMessagesCountsDiff(t,s),{PlusDiff:t,UnseenPlusDiff:s}},S.prototype.commitDeleted=function(e){i.each(e,i.bind(function(e){A.currentMessage()&&A.currentMessage().accountId()===this.iAccountId&&A.currentMessage().folder()===this.fullName()&&A.currentMessage().uid()===e?a.log("commitDeleted, the current message is to remove",A.currentMessage()?{accountId:A.currentMessage().accountId(),folder:A.currentMessage().folder(),uid:A.currentMessage().uid()}:null):this.removeMessageFromDict(e),this.aMessagesDictionaryUids=i.without(this.aMessagesDictionaryUids,e),this.aRequestedUids=i.without(this.aRequestedUids,e),this.aRequestedThreadUids=i.without(this.aRequestedThreadUids,e)},this)),i.each(this.oUids,function(t){t.deleteUids(e)})},S.prototype.getUidList=function(e,t,s,i){var o=JSON.stringify([e,t,s,i]),n=null;return void 0===this.oUids[o]&&((n=new C).iAccountId=this.iAccountId,n.sFullName=this.fullName(),n.search(e),n.filters(t),n.sortBy(s),n.sortOrder(i),this.oUids[o]=n),this.oUids[o]},S.prototype.initStarredFolder=function(e,t){this.bVirtual=!0,this.setDisplayedLevel(e),this.fullName(t),this.name(l.i18n("MAILWEBCLIENT/LABEL_FOLDER_STARRED")),this.type(Enums.FolderTypes.Starred),this.initSubscriptions(""),this.initComputedFields(!0)},S.prototype.parse=function(e,t,s,i){var o="",n=Enums.FolderTypes.User;return"Object/Folder"===e["@Object"]?(o=h.pString(e.Name),this.name(o),this.nameForEdit(o),this.fullName(h.pString(e.FullNameRaw)),this.fullNameHash(h.pString(e.FullNameHash)),this.parentFullName(h.pString(t)),this.parentDisplayFullName(h.pString(i)),this.sDelimiter=e.Delimiter,n=h.pInt(e.Type),F.AllowTemplateFolders||n!==Enums.FolderTypes.Template||(n=Enums.FolderTypes.User),(F.AllowSpamFolder||n!==Enums.FolderTypes.Spam)&&this.type(n),this.isTemplateStorage(this.type()===Enums.FolderTypes.Template),this.bNamespace=s===this.fullName(),this.isAlwaysRefresh(F.AllowAlwaysRefreshFolders&&!!e.AlwaysRefresh),this.subscribed(!!F.IgnoreImapSubscription||e.IsSubscribed),this.bSelectable=e.IsSelectable,this.bExists=e.Exists,e.Extended&&this.setRelevantInformation(e.Extended.UidNext.toString(),e.Extended.Hash,e.Extended.MessageCount,e.Extended.MessageUnseenCount,!1),this.initSubscriptions(t),this.initComputedFields(),u.broadcastEvent("MailWebclient::ParseFolder::after",this),e.SubFolders):null},S.prototype.initSubscriptions=function(e){this.bSubscribtionsInitialized||(this.requireMailCache(),this.unseenMessageCount.subscribe(function(){i.delay(i.bind(function(){A.countMessages(this)},this),1e3)},this),this.subscribed.subscribe(function(){if(e){var t=A.folderList().getFolderByFullName(e);t&&A.countMessages(t)}},this),this.edited.subscribe(function(e){!1===e&&this.nameForEdit(this.name())},this),this.hasChanges.subscribe(function(){this.requestedLists=[]},this),this.bSubscribtionsInitialized=!0)},S.prototype.initComputedFields=function(){this.routingHash=n.computed(function(){if(this.bVirtual){var e="";return F.AllowChangeStarredMessagesSource&&F.StarredMessagesSource===Enums.StarredMessagesSource.AllFolders&&(e="folders:all"),p.buildHashFromArray(b.getMailbox(this.fullName(),1,"",e,Enums.FolderFilter.Flagged))}return p.buildHashFromArray(b.getMailbox(this.fullName()))},this),this.isSystem=n.computed(function(){return this.type()!==Enums.FolderTypes.User},this),this.withoutThreads=n.computed(function(){return this.type()===Enums.FolderTypes.Drafts||this.type()===Enums.FolderTypes.Spam||this.type()===Enums.FolderTypes.Trash},this),this.enableEmptyFolder=n.computed(function(){return(this.type()===Enums.FolderTypes.Spam||this.type()===Enums.FolderTypes.Trash)&&this.messageCount()>0},this),this.virtualEmpty=n.computed(function(){return this.bVirtual&&0===this.messageCount()},this),this.hasSubscribedSubfolders=n.computed(function(){return i.any(this.subfolders(),function(e){return e.subscribed()})},this),this.canExpand=n.computed(function(){return!this.bNamespace&&this.hasSubscribedSubfolders()},this),this.unseenMessagesCountToShow=n.computed(function(){return!u.isMobile()&&this.canExpand()?this.unseenMessageCount()+this.subfoldersMessagesCount():this.unseenMessageCount()},this),this.showTotalInsteadUnseenCount=n.observable(!1),this.showUnseenMessagesCount=n.computed(function(){return this.unseenMessagesCountToShow()>0&&this.type()!==Enums.FolderTypes.Drafts&&!this.showTotalInsteadUnseenCount()},this),this.showMessagesCount=n.computed(function(){return this.messageCount()>0&&(this.type()===Enums.FolderTypes.Drafts||this.showTotalInsteadUnseenCount()||F.AllowShowMessagesCountInFolderList&&F.showMessagesCountInFolderList())},this),this.visible=n.computed(function(){return this.subscribed()||this.isSystem()||this.hasSubscribedSubfolders()},this),this.canBeSelected=n.computed(function(){return this.bExists&&this.bSelectable&&this.subscribed()},this),this.canSubscribe=n.computed(function(){return!F.IgnoreImapSubscription&&!this.isSystem()&&this.bExists&&this.bSelectable},this),this.canDelete=n.computed(function(){return!this.isSystem()&&this.hasExtendedInfo()&&0===this.messageCount()&&0===this.subfolders().length},this),this.canRename=n.computed(function(){return!this.isSystem()&&this.bExists},this),this.visibleTemplateTrigger=n.computed(function(){return F.AllowTemplateFolders&&(this.bSelectable&&!this.isSystem()||this.isTemplateStorage())},this),this.templateButtonHint=n.computed(function(){return this.visibleTemplateTrigger()?this.isTemplateStorage()?l.i18n("MAILWEBCLIENT/ACTION_TURN_TEMPLATE_FOLDER_OFF"):l.i18n("MAILWEBCLIENT/ACTION_TURN_TEMPLATE_FOLDER_ON"):""},this),this.alwaysRefreshButtonHint=n.computed(function(){return F.AllowAlwaysRefreshFolders?this.isAlwaysRefresh()?l.i18n("MAILWEBCLIENT/ACTION_TURN_ALWAYS_REFRESH_OFF"):l.i18n("MAILWEBCLIENT/ACTION_TURN_ALWAYS_REFRESH_ON"):""},this),this.subscribeButtonHint=n.computed(function(){return this.canSubscribe()?this.subscribed()?l.i18n("MAILWEBCLIENT/ACTION_HIDE_FOLDER"):l.i18n("MAILWEBCLIENT/ACTION_SHOW_FOLDER"):""},this),this.deleteButtonHint=n.computed(function(){return this.canDelete()?l.i18n("MAILWEBCLIENT/ACTION_DELETE_FOLDER"):""},this),this.editButtonHint=n.computed(function(){return!this.isSystem()&&this.bSelectable?l.i18n("MAILWEBCLIENT/LABEL_EDIT_FOLDER"):""},this),this.usedAs=n.computed(function(){switch(this.type()){case Enums.FolderTypes.Inbox:return l.i18n("MAILWEBCLIENT/LABEL_USED_AS_INBOX");case Enums.FolderTypes.Sent:return l.i18n("MAILWEBCLIENT/LABEL_USED_AS_SENT");case Enums.FolderTypes.Drafts:return l.i18n("MAILWEBCLIENT/LABEL_USED_AS_DRAFTS");case Enums.FolderTypes.Trash:return l.i18n("MAILWEBCLIENT/LABEL_USED_AS_TRASH");case Enums.FolderTypes.Spam:return l.i18n("MAILWEBCLIENT/LABEL_USED_AS_SPAM")}return""},this),this.displayName=n.computed(function(){if(this.bIsUnifiedInbox)return l.i18n("MAILWEBCLIENT/LABEL_FOLDER_ALL_INBOXES");switch(this.type()){case Enums.FolderTypes.Inbox:return l.i18n("MAILWEBCLIENT/LABEL_FOLDER_INBOX");case Enums.FolderTypes.Sent:return l.i18n("MAILWEBCLIENT/LABEL_FOLDER_SENT");case Enums.FolderTypes.Drafts:return l.i18n("MAILWEBCLIENT/LABEL_FOLDER_DRAFTS");case Enums.FolderTypes.Trash:return l.i18n("MAILWEBCLIENT/LABEL_FOLDER_TRASH");case Enums.FolderTypes.Spam:return l.i18n("MAILWEBCLIENT/LABEL_FOLDER_SPAM")}return this.name()},this),this.displayFullName=n.computed(function(){return""!==this.parentDisplayFullName()?this.parentDisplayFullName()+this.sDelimiter+this.displayName():this.displayName()},this),this.setDisableMoveTo(!1),this.setDisableMoveFrom(!1)},S.prototype.setShowTotalInsteadUnseenCount=function(e){this.showTotalInsteadUnseenCount(e)},S.prototype.onGetMessageResponse=function(e,t){var s=e.Result,i=t.Parameters,o=null,n=s?s.Uid.toString():i.Uid.toString(),r=this.getMessageByUid(n),a=!!r&&r.selected(),h=!1;s?r=this.parseAndCacheMessage(s,!1,!1):(a&&c.showErrorByCode(e,l.i18n("COREWEBCLIENT/ERROR_UNKNOWN")),r&&(p.replaceHashWithoutMessageUid(r.longUid()),a||r.deleted()||this.removeMessageFromDict(n)),r=null,h=!0),(o=this.aResponseHandlers[n])&&(o.handler.call(o.context,r,n,h?e:null),delete this.aResponseHandlers[n])},S.prototype.getCompletelyFilledMessage=function(e,t,s,i){var o=this.getMessageByUid(e),n={AccountID:o?o.accountId():0,Folder:this.fullName(),Uid:e,MessageBodyTruncationThreshold:F.MessageBodyTruncationThreshold};e.length>0&&(!o||!o.completelyFilled()||o.truncated()||i?(t&&s&&(this.aResponseHandlers[e]={handler:t,context:s}),d.send("GetMessage",n,this.onGetMessageResponse,this)):t&&s&&t.call(s,o,e))},S.prototype.showExternalPictures=function(e){var t=this.getMessageByUid(e);void 0!==t&&t.showExternalPictures()},S.prototype.alwaysShowExternalPicturesForSender=function(e){this.doForAllMessages(function(t){var s=t.oFrom.aCollection;s.length>0&&s[0].sEmail===e&&t.alwaysShowExternalPicturesForSender()})},S.prototype.executeGroupOperation=function(e,t,s){var o=0;this.doForAllMessages(function(n){t.length>0?i.each(t,function(t){n.uid()===t&&n[e]()!==s&&(n[e](s),o++)}):n[e](s)}),0===t.length&&(o=s?this.unseenMessageCount():this.messageCount()-this.unseenMessageCount()),"seen"===e&&o>0&&(s?(this.addMessagesCountsDiff(0,-o),A.setUnifiedInboxUnseenChanges(this.iAccountId,this.fullName(),0,-o)):(this.addMessagesCountsDiff(0,o),A.setUnifiedInboxUnseenChanges(this.iAccountId,this.fullName(),0,o)),this.markHasChanges(),this.requireMailCache())},S.prototype.emptyFolder=function(){var e=l.i18n("MAILWEBCLIENT/CONFIRM_EMPTY_FOLDER"),t=i.bind(this.clearFolder,this);this.enableEmptyFolder()&&g.showPopup(f,[e,t])},S.prototype.clearFolder=function(e){this.enableEmptyFolder()&&e&&(d.send("ClearFolder",{Folder:this.fullName()}),this.requireMailCache(),A.onClearFolder(this),this.removeAllMessages())},S.prototype.onAccordion=function(e,t){var s="aurora_mail_account_".concat(this.iAccountId,"_expanded-folders"),o=!this.expanded(),n=m.getData(s)||[];o?n.push(this.fullName()):n=i.reject(n,function(e){return e===this.name()},this),m.setData(s,n),this.expanded(o),this.requireMailCache(),A.countMessages(this),t&&t.stopPropagation()},S.prototype.executeUnseenFilter=function(){return this.unseenMessagesCountToShow()>this.unseenMessageCount()&&this.onAccordion(),!(this.unseenMessageCount()>0&&(this.requireMailCache(),A.waitForUnseenMessages(!0),p.setHash(b.getMailbox(this.fullName(),1,"","",Enums.FolderFilter.Unseen))&&A.changeCurrentMessageList(this.fullName(),1,"",Enums.FolderFilter.Unseen,F.MessagesSortBy.DefaultSortBy,F.MessagesSortBy.DefaultSortOrder),1))},S.prototype.onDeleteClick=function(){var e=l.i18n("MAILWEBCLIENT/CONFIRM_DELETE_FOLDER"),t=i.bind(this.deleteAfterConfirm,this);this.canDelete()?g.showPopup(f,[e,t]):u.broadcastEvent("MailWebclient::AttemptDeleteNonemptyFolder")},S.prototype.deleteAfterConfirm=function(e){if(e){var t=A.editedFolderList(),s=this.fullName(),i=function(e){return s===e.fullName()||(e.subfolders.remove(i),!1)};t.collection.remove(i),d.send("DeleteFolder",{AccountID:y.editedId(),Folder:this.fullName()},function(e){e.Result||(c.showErrorByCode(e,l.i18n("MAILWEBCLIENT/ERROR_DELETE_FOLDER")),A.getFolderList(y.editedId()))},this)}},S.prototype.onSubscribeClick=function(){if(this.canSubscribe()){var e={AccountID:y.editedId(),Folder:this.fullName(),SetAction:!this.subscribed()};this.subscribed(!this.subscribed()),d.send("SubscribeFolder",e,function(e){e.Result||(this.subscribed()?c.showErrorByCode(e,l.i18n("MAILWEBCLIENT/ERROR_SUBSCRIBE_FOLDER")):c.showErrorByCode(e,l.i18n("MAILWEBCLIENT/ERROR_UNSUBSCRIBE_FOLDER")),A.getFolderList(y.editedId()))},this)}},S.prototype.afterMove=function(e){i.each(e,function(e){i.isFunction(e.afterMove)&&e.afterMove()})},S.prototype.cancelNameEdit=function(){this.edited(!1)},S.prototype.applyNameEdit=function(){if(this.name()!==this.nameForEdit()){var e={AccountID:y.editedId(),PrevFolderFullNameRaw:this.fullName(),NewFolderNameInUtf8:this.nameForEdit()};d.send("RenameFolder",e,i.bind(this.onResponseFolderRename,this),this),this.name(this.nameForEdit())}this.edited(!1)},S.prototype.onResponseFolderRename=function(e,t){e&&e.Result?e&&e.Result&&e.Result.FullName&&A.editedFolderList().renameFolder(this.fullName(),e.Result.FullName,e.Result.FullNameHash):(c.showErrorByCode(e,l.i18n("MAILWEBCLIENT/ERROR_RENAME_FOLDER")),A.getFolderList(y.editedId()))},S.prototype.triggerTemplateState=function(){if(this.visibleTemplateTrigger()){this.isTemplateStorage()?(this.type(Enums.FolderTypes.User),this.isTemplateStorage(!1)):(this.type(Enums.FolderTypes.Template),this.isTemplateStorage(!0)),A.changeTemplateFolder(this.fullName(),this.isTemplateStorage());var e={AccountID:this.iAccountId,FolderFullName:this.fullName(),SetTemplate:this.isTemplateStorage()};d.send("SetTemplateFolderType",e,this.onSetTemplateFolderType,this)}},S.prototype.onSetTemplateFolderType=function(e){e.Result||(c.showErrorByCode(e,l.i18n("MAILWEBCLIENT/ERROR_SETUP_SPECIAL_FOLDERS")),A.getFolderList(y.editedId()))},S.prototype.openEditFolderPopup=function(){if(!this.isSystem()&&this.bSelectable){var e=s("68+x");g.showPopup(e,[this])}},S.prototype.triggerAlwaysRefreshState=function(){if(F.AllowAlwaysRefreshFolders){this.isAlwaysRefresh(!this.isAlwaysRefresh());var e={AccountID:this.iAccountId,FolderFullName:this.fullName(),AlwaysRefresh:this.isAlwaysRefresh()};d.send("SetAlwaysRefreshFolder",e,this.onSetAlwaysRefreshFolder,this)}},S.prototype.onSetAlwaysRefreshFolder=function(e){e.Result||(c.showErrorByCode(e),A.getFolderList(y.editedId()))},e.exports=S},Vbjo:(e,t,s)=>{var i=s("p09A"),o=s("rBrp"),n=s("ERH9"),r=s("uQaC");function a(){this.FETCHER=!0,this.id=i.observable(0),this.accountId=i.observable(0),this.hash=i.computed(function(){return r.getHash(this.accountId()+"fetcher"+this.id())},this),this.isEnabled=i.observable(!1),this.isLocked=i.observable(!1).extend({autoResetToFalse:1e3}),this.email=i.observable(""),this.userName=i.observable(""),this.folder=i.observable(""),this.useSignature=i.observable(!1),this.signature=i.observable(""),this.incomingServer=i.observable(""),this.incomingPort=i.observable(0),this.incomingUseSsl=i.observable(!1),this.incomingLogin=i.observable(""),this.leaveMessagesOnServer=i.observable(""),this.isOutgoingEnabled=i.observable(!1),this.outgoingServer=i.observable(""),this.outgoingPort=i.observable(0),this.outgoingUseSsl=i.observable(!1),this.outgoingUseAuth=i.observable(!1),this.iCheckIntervalMinutes=0,this.fullEmail=i.computed(function(){return o.getFullEmail(this.userName(),this.email())},this)}a.prototype.parse=function(e){this.id(n.pInt(e.EntityId)),this.accountId(n.pInt(e.IdAccount)),this.isEnabled(!!e.IsEnabled),this.isLocked(!!e.IsLocked),this.email(n.pString(e.Email)),this.userName(n.pString(e.Name)),this.folder(n.pString(e.Folder)),this.useSignature(!!e.UseSignature);var t=n.pString(e.Signature);0!==t.indexOf("<")&&(t="<div>"+t+"</div>"),this.signature=i.observable(t),this.incomingServer(n.pString(e.IncomingServer)),this.incomingPort(n.pInt(e.IncomingPort)),this.incomingUseSsl(!!e.IncomingUseSsl),this.incomingLogin(n.pString(e.IncomingLogin)),this.leaveMessagesOnServer(!!e.LeaveMessagesOnServer),this.isOutgoingEnabled(!!e.IsOutgoingEnabled),this.outgoingServer(n.pString(e.OutgoingServer)),this.outgoingPort(n.pInt(e.OutgoingPort)),this.outgoingUseSsl(!!e.OutgoingUseSsl),this.outgoingUseAuth(!!e.OutgoingUseAuth),this.iCheckIntervalMinutes=n.pInt(e.CheckInterval,0)},e.exports=a},WzKm:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("sdEb"),a=s("LKDt"),l=s("ERH9"),h=s("3cxN"),d=s("yU9o"),c=s("D2Gh"),u=s("lZd5"),p=s("ebd4"),m=s("wXcN"),g=s("Fj7m"),f=null,b=s("TmsQ"),y=s("Ua3z"),A=s("3boL");function v(){this.accountId=n.observable(g.currentId()),this.accountEmail=n.computed(function(){var e=g.getAccount(this.accountId());return e?e.email():""},this),this.showUnifiedMailboxLabel=n.observable(""),this.unifiedMailboxLabelText=n.observable(""),this.unifiedMailboxLabelColor=n.observable(""),n.computed(function(){var e=this.accountId?g.getAccount(this.accountId()):null;e&&(this.showUnifiedMailboxLabel(e.showUnifiedMailboxLabel()),this.unifiedMailboxLabelText(e.unifiedMailboxLabelText()||e.email()),this.unifiedMailboxLabelColor(e.unifiedMailboxLabelColor()))},this),this.folder=n.observable(""),this.uid=n.observable(""),this.longUid=n.observable(""),this.subject=n.observable(""),this.emptySubject=n.computed(function(){return""===o.trim(this.subject())},this),this.subjectForDisplay=n.computed(function(){return this.emptySubject()?a.i18n("MAILWEBCLIENT/LABEL_NO_SUBJECT"):this.subject()},this),this.messageId=n.observable(""),this.size=n.observable(0),this.friendlySize=n.computed(function(){return a.getFriendlySize(this.size())},this),this.textSize=n.observable(0),this.oDateModel=new p,this.fullDate=n.observable(""),this.oFrom=new u,this.fullFrom=n.observable(""),this.oTo=new u,this.to=n.observable(""),this.fromOrToText=n.observable(""),this.oCc=new u,this.cc=n.observable(""),this.oBcc=new u,this.bcc=n.observable(""),this.oReplyTo=new u,this.seen=n.observable(!1),this.flagged=n.observable(!1),this.partialFlagged=n.observable(!1),this.answered=n.observable(!1),this.forwarded=n.observable(!1),this.hasAttachments=n.observable(!1),this.hasIcalAttachment=n.observable(!1),this.hasVcardAttachment=n.observable(!1),this.folderObject=n.computed(function(){return this.requireMailCache(),f.getFolderByFullName(this.accountId(),this.folder())},this),this.threadsAllowed=n.computed(function(){var e=g.getAccount(this.accountId()),t=this.folderObject(),s=t&&(t.type()===Enums.FolderTypes.Drafts||t.type()===Enums.FolderTypes.Spam||t.type()===Enums.FolderTypes.Trash);return e&&e.threadingIsAvailable()&&!s},this),this.otherSendersAllowed=n.computed(function(){var e=this.folderObject();return e&&e.type()!==Enums.FolderTypes.Drafts&&e.type()!==Enums.FolderTypes.Sent},this),this.threadPart=n.observable(!1),this.threadPart.subscribe(function(){this.threadPart()&&this.partialFlagged(!1)},this),this.threadParentUid=n.observable(""),this.threadUids=n.observableArray([]),this.threadCount=n.computed(function(){return this.threadUids().length},this),this.threadUnreadCount=n.observable(0),this.threadOpened=n.observable(!1),this.threadLoading=n.observable(!1),this.threadLoadingVisible=n.computed(function(){return this.threadsAllowed()&&this.threadOpened()&&this.threadLoading()},this),this.threadCountVisible=n.computed(function(){return this.threadsAllowed()&&this.threadCount()>0&&!this.threadLoading()},this),this.threadCountHint=n.computed(function(){return this.threadCount()>0?this.threadOpened()?a.i18n("MAILWEBCLIENT/ACTION_FOLD_THREAD"):this.threadUnreadCount()>0?a.i18n("MAILWEBCLIENT/ACTION_UNFOLD_THREAD_WITH_UNREAD",{},null,this.threadUnreadCount()):a.i18n("MAILWEBCLIENT/ACTION_UNFOLD_THREAD"):""},this),this.threadCountForLoad=n.observable(5),this.threadNextLoadingVisible=n.observable(!1),this.threadNextLoadingLinkVisible=n.observable(!1),this.threadFunctionLoadNext=null,this.threadShowAnimation=n.observable(!1),this.threadHideAnimation=n.observable(!1),this.importance=n.observable(Enums.Importance.Normal),this.draftInfo=n.observableArray([]),this.hash=n.observable(""),this.sDownloadAsEmlUrl="",this.completelyFilled=n.observable(!1),this.iLastAccessTime=0,this.updateLastAccessTime(),this.checked=n.observable(!1),this.checked.subscribe(function(e){if(this.requireMailCache(),!this.threadOpened()&&f.useThreadingInCurrentList()){var t=f.getFolderByFullName(this.accountId(),this.folder());i.each(this.threadUids(),function(s){var i=b.get([t.iAccountId,t.fullName(),s]);i&&i.checked(e)})}},this),this.selected=n.observable(!1),this.deleted=n.observable(!1),this.truncated=n.observable(!1),this.inReplyTo=n.observable(""),this.references=n.observable(""),this.readingConfirmationAddressee=n.observable(""),this.sensitivity=n.observable(Enums.Sensitivity.Nothing),this.isPlain=n.observable(!1),this.text=n.observable(""),this.textBodyForNewWindow=n.observable(""),this.$text=null,this.rtl=n.observable(!1),this.hasExternals=n.observable(!1),this.isExternalsShown=n.observable(!1),this.isExternalsAlwaysShown=n.observable(!1),this.foundCids=n.observableArray([]),this.attachments=n.observableArray([]),this.safety=n.observable(!1),this.sourceHeaders=n.observable(""),this.unsubscribe={},this.date=n.observable(""),this.textRaw=n.observable(""),this.domMessageForPrint=n.observable(null),this.notInlineAttachments=n.computed(function(){return i.filter(this.attachments(),function(e){return!e.linked()})},this),this.Custom={},this.customLabels=n.observableArray([])}v.prototype.isEqual=function(e){return this.accountId()===e.accountId()&&this.folder()===e.folder()&&this.uid()===e.uid()},v.prototype.setCustomLabel=function(e,t,s){if(l.isString(e)&&l.isNonEmptyString(t)&&l.isString(s)){var o=i.find(this.customLabels(),function(t){return t.id===e});o?(o.text=t,o.cssClass=s):this.customLabels.push({id:e,text:t,cssClass:s})}},v.prototype.removeCustomLabel=function(e){this.customLabels(i.filter(this.customLabels(),function(t){return t.id!==e}))},v.prototype.requireMailCache=function(){null===f&&(f=s("eGl8"))},v.prototype.updateLastAccessTime=function(){this.iLastAccessTime=r().unix(),i.each(this.threadUids(),function(e){var t=b.get([this.accountId(),this.folder(),e]);t&&t.updateLastAccessTime()},this)},v.prototype.viewMessage=function(e){var t,s=this.getDomText(h.getAppPath());this.textBodyForNewWindow(s.html()),t=o(this.domMessageForPrint()).html(),e&&(o(e.document.body).html(t),e.focus(),i.each(this.attachments(),function(t){var s=o(e.document.body).find("[data-hash='download-"+t.hash()+"']");t.hasAction("download")?s.on("click",i.bind(t.executeAction,t,"download")):s.hide(),s=o(e.document.body).find("[data-hash='view-"+t.hash()+"']"),t.hasAction("view")?s.on("click",i.bind(t.executeAction,t,"view")):s.hide()},this))},v.prototype.fillFromOrToText=function(){this.requireMailCache();var e=f.getFolderByFullName(this.accountId(),this.folder());if(!e||e.type()!==Enums.FolderTypes.Drafts&&e.type()!==Enums.FolderTypes.Sent){var t=y.UseMeRecipientForMessages?a.i18n("MAILWEBCLIENT/LABEL_ME_SENDER"):null;this.fromOrToText(this.oFrom.getDisplay(t,this.accountEmail()))}else{var s=y.UseMeRecipientForMessages?a.i18n("MAILWEBCLIENT/LABEL_ME_RECIPIENT"):null,i=this.oTo.getDisplay(s,this.accountEmail()),o=this.oCc.getDisplay(s,this.accountEmail()),n=this.oBcc.getDisplay(s,this.accountEmail()),r=[];l.isNonEmptyString(i)&&r.push(i),l.isNonEmptyString(o)&&r.push(o),l.isNonEmptyString(n)&&r.push(n),this.fromOrToText(r)}},v.prototype.changeThreadUids=function(e,t){this.threadUids(e),this.threadLoading(t<Math.min(this.threadUids().length,this.threadCountForLoad()))},v.prototype.showNextLoadingLink=function(e){this.threadNextLoadingLinkVisible()&&(this.threadNextLoadingVisible(!0),this.threadFunctionLoadNext=e)},v.prototype.increaseThreadCountForLoad=function(){this.threadCountForLoad(this.threadCountForLoad()+5),this.requireMailCache(),f.showOpenedThreads(this.folder())},v.prototype.loadNextMessages=function(){this.threadFunctionLoadNext&&(this.threadFunctionLoadNext(),this.threadNextLoadingLinkVisible(!1),this.threadFunctionLoadNext=null)},v.prototype.markAsThreadPart=function(e,t){var s=this;this.threadPart(!0),this.threadParentUid(t),this.threadUids([]),this.threadNextLoadingVisible(!1),this.threadNextLoadingLinkVisible(!0),this.threadFunctionLoadNext=null,this.threadHideAnimation(!1),setTimeout(function(){s.threadShowAnimation(!0)},e)},v.prototype.parse=function(e,t,s,o){var n="",r="";if(o&&this.threadPart(s),this.threadPart()||this.threadParentUid(""),"Object/MessageListItem"===e["@Object"]&&(this.seen(!!e.IsSeen),this.flagged(!!e.IsFlagged),this.answered(!!e.IsAnswered),this.forwarded(!!e.IsForwarded),e.Custom&&(this.Custom=e.Custom)),"Object/Message"===e["@Object"]||"Object/MessageListItem"===e["@Object"]){if(this.Custom.Sensitivity=e.Sensitivity,this.accountId(t),this.folder(e.Folder),this.uid(l.pString(e.Uid)),l.isNonEmptyString(e.UnifiedUid)){this.longUid(e.UnifiedUid);var a=f.getMessageActualIdentifiers(this.accountId(),this.folder(),this.longUid());this.accountId(a.iAccountId)}else this.longUid(this.accountId()+":"+this.folder()+":"+l.pString(e.Uid));this.subject(l.pString(e.Subject)),this.messageId(l.pString(e.MessageId)),this.size(e.Size),this.textSize(e.TextSize),this.oDateModel.parse(e.TimeStampInUTC),this.oFrom.parse(e.From),this.oTo.parse(e.To),this.oCc.parse(e.Cc),this.oBcc.parse(e.Bcc),this.oReplyTo.parse(e.ReplyTo),this.fillFromOrToText(),this.fullDate(this.oDateModel.getFullDate()),this.fullFrom(this.oFrom.getFull()),this.to(this.oTo.getFull()),this.cc(this.oCc.getFull()),this.bcc(this.oBcc.getFull()),this.hasAttachments(!!e.HasAttachments),this.hasIcalAttachment(!!e.HasIcalAttachment),this.hasVcardAttachment(!!e.HasVcardAttachment),"Object/MessageListItem"===e["@Object"]&&o&&this.threadUids(i.map(e.Threads,function(e){return e.toString()},this)),this.importance(l.pInt(e.Importance)),Enums.has("Importance",this.importance())||this.importance(Enums.Importance.Normal),this.sensitivity(l.pInt(e.Sensitivity)),Enums.has("Sensitivity",this.sensitivity())||this.sensitivity(Enums.Sensitivity.Nothing),i.isArray(e.DraftInfo)&&this.draftInfo(e.DraftInfo),this.hash(l.pString(e.Hash)),this.sDownloadAsEmlUrl=l.pString(e.DownloadAsEmlUrl),"Object/Message"===e["@Object"]?(this.truncated(e.Truncated),this.inReplyTo(e.InReplyTo),this.references(e.References),this.readingConfirmationAddressee(l.pString(e.ReadingConfirmationAddressee)),n=l.pString(e.Html),r=l.pString(e.Plain),""!==n?(this.textRaw(e.HtmlRaw),this.text(n),this.isPlain(!1)):(this.textRaw(e.PlainRaw),this.text(""!==r?"<div>"+r+"</div>":""),this.isPlain(!0)),this.$text=null,this.isExternalsShown(!1),this.rtl(e.Rtl),this.hasExternals(!!e.HasExternals),this.foundCids(e.FoundedCIDs),this.parseAttachments(e.Attachments,t),this.safety(e.Safety),this.sourceHeaders(e.Headers),this.unsubscribe=l.pObject(e.Unsubscribe),this.aExtend=e.Extend,this.completelyFilled(!0),d.broadcastEvent("MailWebclient::ParseMessage::after",{msg:this})):d.broadcastEvent("MailWebclient::ParseMessageListItem::after",{msg:this}),this.updateMomentDate()}},v.prototype.changeText=function(e){this.text(e),this.$text=null},v.prototype.updateMomentDate=function(){this.date(this.oDateModel.getShortDate(r().clone().subtract(1,"days").format("L")===r.unix(this.oDateModel.getTimeStampInUTC()).format("L")))},v.prototype.getDomText=function(e,t){var s=this.$text;return e=e||"",null!==this.$text&&""===e||(this.completelyFilled()?(this.$text=o(this.text()),this.showInlinePictures(e),!0===this.safety()?this.alwaysShowExternalPicturesForSender(t):(t&&this.isExternalsShown()||this.isExternalsAlwaysShown())&&this.showExternalPictures(),s=this.$text):s=o("")),s.clone()},v.prototype.getConvertedHtml=function(e,t){var s=this.getDomText(e,t);return s.length>0?s.wrap("<p>").parent().html():""},v.prototype.parseAttachments=function(e,t){var s=e?e["@Collection"]:[];this.attachments([]),l.isNonEmptyArray(s)&&this.attachments(i.map(s,function(e){var s=new A(t);return s.setMessageData(this.folder(),this.uid()),s.parse(e,this.folder(),this.longUid()),s},this))},v.prototype.parseAddressArray=function(e){var t=[];return i.isArray(e)&&(t=i.map(e,function(e){var t=new CAddressModel;return t.parse(e),t})),t},v.prototype.showInlinePictures=function(e){var t=i.map(this.attachments(),function(e){return{CID:e.cid(),ContentLocation:e.contentLocation(),ViewLink:e.getActionUrl("view")}});m.showInlinePictures(this.$text,t,this.foundCids(),e)},v.prototype.showExternalPictures=function(){m.showExternalPictures(this.$text),this.isExternalsShown(!0)},v.prototype.alwaysShowExternalPicturesForSender=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isExternalsAlwaysShown(!0),!this.completelyFilled()||!e&&this.isExternalsShown()||this.showExternalPictures()},v.prototype.openThread=function(){if(this.threadCountVisible()){var e=this.folder();this.threadOpened(!this.threadOpened()),this.requireMailCache(),this.threadOpened()?f.showOpenedThreads(e):(f.hideThreads(this),setTimeout(function(){f.showOpenedThreads(e)},500))}},v.prototype.onSaveAttachmentsToFilesResponse=function(e,t){var s=t.Parameters,o=0,n=s.Attachments.length;e.Result&&i.each(s.Attachments,function(t){void 0!==e.Result[t]&&o++}),0===o?c.showError(a.i18n("MAILWEBCLIENT/ERROR_CANT_SAVE_ATTACHMENTS_TO_FILES")):o<n?c.showError(a.i18n("MAILWEBCLIENT/ERROR_SOME_ATTACHMENTS_WERE_NOT_SAVED",{SAVED_COUNT:o,TOTAL_COUNT:n})):c.showReport(a.i18n("MAILWEBCLIENT/REPORT_ATTACHMENTS_SAVED_TO_FILES"))},v.prototype.downloadAllAttachmentsSeparately=function(){i.each(this.attachments(),function(e){e.linked()||e.executeAction("download")})},v.prototype.toJSON=function(){return{uid:this.uid(),longUid:this.longUid(),accountId:this.accountId(),to:this.to(),subject:this.subject(),threadPart:this.threadPart(),threadUids:this.threadUids(),threadOpened:this.threadOpened()}},v.prototype.getHeaderValue=function(e){var t=new RegExp(e+":s*(.+)(\n|$)","gm").exec(this.sourceHeaders());return o.trim(l.pString(t&&t[1]))},e.exports=v},YmTJ:(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=s("rBrp"),r=s("LKDt"),a=s("ERH9"),l=s("uQaC"),h=null,d=s("Z9uT"),c=null,u=s("KIwC"),p=s("PMEU"),m=s("MYiO"),g=s("sHZb"),f=s("UVn1"),b=null,y=null,A=s("Ua3z");function v(e){c=s("yU9o"),h=s("P7bQ"),this.id=o.observable(a.pInt(e.AccountID)),this.email=o.observable(a.pString(e.Email)),this.friendlyName=o.observable(a.pString(e.FriendlyName)),this.incomingLogin=o.observable(a.pString(e.IncomingLogin)),this.passwordMightBeIncorrect=o.observable(!1),this.passwordMightBeIncorrect.subscribe(function(){this.passwordMightBeIncorrect()||(this.requireCache(),y.getFolderList(this.id()))},this);var t=a.pString(e.Signature);0!==t.indexOf("<")&&(t="<div>"+t+"</div>"),this.signature=o.observable(t),this.useSignature=o.observable(!!e.UseSignature),this.bAllowEditSignature=a.pBool(e.AllowEditSignature,!0),this.bAllowUseIdentities=a.pBool(e.AllowUseIdentities,!0),this.serverId=o.observable(a.pInt(e.ServerId)),this.oServer=new f(e.Server),this.useToAuthorize=o.observable(!!e.UseToAuthorize),this.canBeUsedToAuthorize=o.observable(!!e.CanBeUsedToAuthorize),this.useThreading=o.observable(!!e.UseThreading),this.useThreading.subscribe(function(){this.requireCache(),y.clearMessagesCache(this.id())},this),this.bSaveRepliesToCurrFolder=!!e.SaveRepliesToCurrFolder,this.isCurrent=o.observable(!1),this.isEdited=o.observable(!1),this.hash=o.computed(function(){return l.getHash(this.id()+this.email())},this),this.fetchers=o.observableArray([]),this.identities=o.observable(null),this.aliases=o.observableArray([]),this.allowAutoresponder=o.observable(a.pBool(e.AllowAutoresponder,!1)),this.autoresponder=o.observable(null),this.allowForward=o.observable(a.pBool(e.AllowForward,!1)),this.forward=o.observable(null),this.allowFilters=o.observable(a.pBool(e.AllowFilters,!1)),this.filters=o.observable(null),this.enableAllowBlockLists=o.observable(a.pBool(e.EnableAllowBlockLists)),this.allowManageFolders=o.observable(a.pBool(e.AllowManageFolders,!0)),this.quota=o.observable(0),this.usedSpace=o.observable(0),this.quotaRecieved=o.observable(!1),this.fullEmail=o.computed(function(){return n.getFullEmail(this.friendlyName(),this.email())},this),this.bDefault=A.AllowDefaultAccountForUser&&this.email()===c.getUserPublicId(),this.aExtend=a.pObject(e.Extend),this.includeInUnifiedMailbox=o.observable(A.AllowUnifiedInbox&&!!e.IncludeInUnifiedMailbox),this.showUnifiedMailboxLabel=o.observable(A.AllowUnifiedInbox&&!!e.ShowUnifiedMailboxLabel),this.unifiedMailboxLabelText=o.observable(a.pString(e.UnifiedMailboxLabelText)),this.unifiedMailboxLabelColor=o.observable(a.pString(e.UnifiedMailboxLabelColor)),o.computed(function(){var e=this.signature(),t=this.useSignature(),s=this.friendlyName(),o=i.find(this.identities(),function(e){return e.bAccountPart});o&&(o.signature(e),o.useSignature(t),o.friendlyName(s))},this),c.broadcastEvent("MailWebclient::ParseAccount::after",{account:this,data:e})}v.prototype.threadingIsAvailable=function(){return this.oServer.bEnableThreading&&this.useThreading()},v.prototype.updateFromServer=function(e){this.email(a.pString(e.Email)),this.friendlyName(a.pString(e.FriendlyName)),this.incomingLogin(a.pString(e.IncomingLogin)),this.serverId(a.pInt(e.ServerId)),this.oServer=new f(e.Server),this.useToAuthorize(!!e.UseToAuthorize),this.useThreading(!!e.UseThreading),this.bSaveRepliesToCurrFolder=!!e.SaveRepliesToCurrFolder,this.includeInUnifiedMailbox(!!e.IncludeInUnifiedMailbox),this.showUnifiedMailboxLabel(!!e.ShowUnifiedMailboxLabel),this.unifiedMailboxLabelText(a.pString(e.UnifiedMailboxLabelText)),this.unifiedMailboxLabelColor(a.pString(e.UnifiedMailboxLabelColor))},v.prototype.requireAccounts=function(){null===b&&(b=s("Fj7m"))},v.prototype.requireCache=function(){null===y&&(y=s("eGl8"))},v.prototype.onGetQuotaResponse=function(e,t){i.isArray(e.Result)&&1<e.Result.length&&(this.quota(a.pInt(e.Result[1])),this.usedSpace(a.pInt(e.Result[0])),this.requireCache(),y.quotaChangeTrigger(!y.quotaChangeTrigger())),this.quotaRecieved(!0)},v.prototype.updateQuotaParams=function(){u.ShowQuotaBar&&h.send("GetQuota",{AccountID:this.id()},this.onGetQuotaResponse,this)},v.prototype.updateFriendlyName=function(e){this.friendlyName(e)},v.prototype.changeAccount=function(){this.requireAccounts(),b.changeCurrentAccount(this.id(),!0)},v.prototype.getDefaultIdentity=function(){return i.find(this.identities()||[],function(e){return e.isDefault()})},v.prototype.getFetchersIdentitiesEmails=function(){var e=this.identities()||[],t=[];return i.each(this.fetchers(),function(e){t.push(e.email())}),i.each(e,function(e){t.push(e.email())}),t},v.prototype.remove=function(){var e=i.bind(this.confirmedRemove,this);this.bDefault||p.showPopup(m,[r.i18n("MAILWEBCLIENT/CONFIRM_REMOVE_ACCOUNT"),e,this.email()])},v.prototype.confirmedRemove=function(e){e&&h.send("DeleteAccount",{AccountID:this.id()},this.onAccountDeleteResponse,this)},v.prototype.onAccountDeleteResponse=function(e,t){if(e.Result){var o=s("sXLm");i.isFunction(o.closeComposePopup)&&o.closeComposePopup(t.Parameters.AccountID),this.requireAccounts(),b.deleteAccount(this.id())}else d.showErrorByCode(e,r.i18n("MAILWEBCLIENT/ERROR_REMOVE_ACCOUNT"))},v.prototype.requestFilters=function(){h.send("GetFilters",{AccountID:this.id()},this.onGetFiltersResponse,this)},v.prototype.onGetFiltersResponse=function(e,t){var s=new g;e.Result&&s.parse(this.id(),e.Result),this.filters(s)},e.exports=v},ZXeO:(e,t,s)=>{var i=s("M4cL");function o(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var s={}.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,i=Array(t);s<t;s++)i[s]=e[s];return i}e.exports={preparePastedHtml:function(e){var t=o(e.matchAll(/class=["']{0,1}(xl\d+)["']{0,1}/gm));if(t.length>0){var s=i("<div>".concat(e,"</div>"));return t.forEach(function(t){var i=t[1],n=function(e,t){var s=new RegExp(".".concat(t,"\\s*{([^}]*)}"),"gm"),i=o(e.matchAll(s));if(1===i.length&&2===i[0].length){var n=i[0][1].replaceAll("\r","").replaceAll("\n","").replaceAll("\t","").split(";"),r={};return n.forEach(function(e){if(e){var t=e.split(":");r[t[0]]=t[1]}}),r}return!1}(e,i);n&&s.find(".".concat(i)).css(n)}),s.html()}return!1}}},Zm5i:(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=s("ERH9"),r=s("uQaC"),a=s("oJUS"),l=null,h=s("Ua3z"),d=s("V8Bf");function c(){this.iAccountId=0,this.initialized=o.observable(!1),this.collection=o.observableArray([]),this.options=o.observableArray([]),this.sNamespaceFolder="",this.oStarredFolder=null,this.oNamedCollection={},this.aLinedCollection=[];var e=this,t=function(e){return function(t){t&&t.type(e)}},s=function(t){return{read:function(){return this.collection(),t()?t().fullName():""},write:function(e){t(this.getFolderByFullName(e))},owner:e}};this.currentFolder=o.observable(null),this.inboxFolder=o.observable(null),this.sentFolder=o.observable(null),this.draftsFolder=o.observable(null),this.spamFolder=o.observable(null),this.trashFolder=o.observable(null),this.aTemplateFolders=[],this.countsCompletelyFilled=o.observable(!1),this.inboxFolder.subscribe(t(Enums.FolderTypes.User),this,"beforeChange"),this.sentFolder.subscribe(t(Enums.FolderTypes.User),this,"beforeChange"),this.draftsFolder.subscribe(t(Enums.FolderTypes.User),this,"beforeChange"),this.spamFolder.subscribe(t(Enums.FolderTypes.User),this,"beforeChange"),this.trashFolder.subscribe(t(Enums.FolderTypes.User),this,"beforeChange"),this.inboxFolder.subscribe(t(Enums.FolderTypes.Inbox)),this.sentFolder.subscribe(t(Enums.FolderTypes.Sent)),this.draftsFolder.subscribe(t(Enums.FolderTypes.Drafts)),this.spamFolder.subscribe(t(Enums.FolderTypes.Spam)),this.trashFolder.subscribe(t(Enums.FolderTypes.Trash)),this.inboxFolderFullName=o.computed(s(this.inboxFolder)),this.sentFolderFullName=o.computed(s(this.sentFolder)),this.draftsFolderFullName=o.computed(s(this.draftsFolder)),this.spamFolderFullName=o.computed(s(this.spamFolder)),this.trashFolderFullName=o.computed(s(this.trashFolder)),this.currentFolderFullName=o.computed(s(this.currentFolder)),this.currentFolderType=o.computed(function(){return this.currentFolder()?this.currentFolder().type():Enums.FolderTypes.User},this),this.sDelimiter=""}c.prototype.requireMailCache=function(){null===l&&(l=s("eGl8"))},c.prototype.getFoldersCount=function(){return this.aLinedCollection.length},c.prototype.getTotalMessageCount=function(){var e=0;return i.each(this.oNamedCollection,function(t){e+=t.messageCount()},this),e},c.prototype.getFoldersWithoutCountInfo=function(){return i.compact(i.map(this.oNamedCollection,function(e,t){return e.canBeSelected()&&!e.hasExtendedInfo()?t:null}))},c.prototype.getNamesOfFoldersToRefresh=function(){var e=[this.inboxFolderFullName(),this.spamFolderFullName(),this.currentFolderFullName()];return i.each(this.oNamedCollection,function(t){t.isAlwaysRefresh()&&e.push(t.fullName())}),i.uniq(e)},c.prototype.setCurrentFolder=function(e,t){this.requireMailCache();var s=this.getFolderByFullName(e);null!==s&&s.canBeSelected()||(s=this.inboxFolder()),null!==s&&(this.currentFolder()&&(this.currentFolder().selected(!1),this.oStarredFolder&&this.oStarredFolder.selected(!1)),e===l.oUnifiedInbox.fullName()?this.currentFolder(null):(this.currentFolder(s),t===Enums.FolderFilter.Flagged?this.oStarredFolder&&this.oStarredFolder.selected(!0):this.currentFolder().selected(!0)))},c.prototype.getFolderByFullName=function(e){return this.oNamedCollection[e]||null},c.prototype.renameFolder=function(e,t,s){var i=this.oNamedCollection[e];i.fullName(t),i.fullNameHash(s),this.oNamedCollection[t]=i,delete this.oNamedCollection[e]},c.prototype.changeTemplateFolder=function(e,t){h.AllowTemplateFolders&&(t?this.aTemplateFolders.push(e):this.aTemplateFolders=i.without(this.aTemplateFolders,e))},c.prototype.expandFolders=function(){var e=this,t="aurora_mail_account_".concat(this.iAccountId,"_expanded-folders"),s=[];h.FoldersExpandedByDefault&&!a.hasData(t)?s=this.aLinedCollection.filter(function(e){return e.subfolders().length>0}):a.hasData(t)&&(s=a.getData(t).map(function(t){return e.oNamedCollection[t]}).filter(function(e){return!!e})),s.forEach(function(e){e.expanded(!0)}),a.setData(t,s.map(function(e){return e.name()}))},c.prototype.parse=function(e,t,s){var i=n.pString(t.Namespace),o=t.Folders["@Collection"];i.length>0&&(this.sNamespaceFolder=i.substring(0,i.length-1)),this.iAccountId=e,this.initialized(!0),this.oNamedCollection={},this.aLinedCollection=[],this.collection(this.parseRecursively(o,s)),this.expandFolders()},c.prototype.destroyFolders=function(){for(var e in r.destroyObjectWithObservables(this,"oStarredFolder"),this.collection.removeAll(),this.aLinedCollection=[],this.oNamedCollection)r.destroyObjectWithObservables(this.oNamedCollection,e)},c.prototype.parseRecursively=function(e,t,s,o,r){var a=[],l=0,h=0,c=null,u="",p=null,m=[];if(o=o||"",void 0===s&&(s=-1),s++,i.isArray(e))for(h=e.length;l<h;l++){switch(p=(c=t[u=n.pString(e[l].FullNameRaw)]||new d(this.iAccountId)).parse(e[l],o,this.sNamespaceFolder,r),delete t[u],c.setDisplayedLevel(s),c.type()){case Enums.FolderTypes.Inbox:this.inboxFolder(c),this.sDelimiter=c.sDelimiter;break;case Enums.FolderTypes.Sent:this.sentFolder(c);break;case Enums.FolderTypes.Drafts:this.draftsFolder(c);break;case Enums.FolderTypes.Trash:this.trashFolder(c);break;case Enums.FolderTypes.Spam:this.spamFolder(c);break;case Enums.FolderTypes.Template:this.aTemplateFolders.push(c.fullName())}this.oNamedCollection[c.fullName()]=c,this.aLinedCollection.push(c),a.push(c),null===p&&c.type()===Enums.FolderTypes.Inbox?(c.subfolders([]),this.createStarredFolder(c.fullName(),s),this.oStarredFolder&&a.push(this.oStarredFolder)):null!==p?(m=c.bNamespace&&c.type()===Enums.FolderTypes.Inbox?this.parseRecursively(p["@Collection"],t,s-1,c.fullName(),c.displayFullName()):this.parseRecursively(p["@Collection"],t,s,c.fullName(),c.displayFullName()),c.type()===Enums.FolderTypes.Inbox&&(this.createStarredFolder(c.fullName(),s),c.bNamespace?this.oStarredFolder&&m.unshift(this.oStarredFolder):this.oStarredFolder&&a.push(this.oStarredFolder)),c.subfolders(m)):c.subfolders([])}return a},c.prototype.createStarredFolder=function(e,t){this.oStarredFolder=new d(this.iAccountId),this.oStarredFolder.initStarredFolder(t,e)},c.prototype.repopulateLinedCollection=function(){var e=this;return this.aLinedCollection=[],function t(s){i.each(s,function(s){e.aLinedCollection.push(s),s.subfolders().length>0&&t(s.subfolders())})}(this.collection()),this.aLinedCollection},c.prototype.getOptions=function(e,t,s,o,r,a){t=!!t,s=!!s,o=!!o,r=!!r,a=n.pArray(a);var l=[];return i.each(this.aLinedCollection,function(e){if(e&&!e.bVirtual&&(!s||Enums.FolderTypes.Inbox!==e.type())&&(!r||e.subscribed())){var n=new Array(e.getDisplayedLevel()+1).join("Â Â Â Â "),h=!1;!t&&e.isSystem()&&(h=!0),o||e.canBeSelected()||(h=!0),-1!==i.indexOf(a,e.fullName())&&(h=!0),l.push({name:e.name(),fullName:e.fullName(),displayName:n+e.name(),translatedDisplayName:n+e.displayName(),disable:h})}}),""!==e&&l.unshift({name:e,fullName:"",displayName:e,translatedDisplayName:e,disable:!1}),l},e.exports=c},bpAE:(e,t,s)=>{var i=s("VJBI"),o=s("7ymw"),n=s("leQx"),r=s("/M09");e.exports={view:null,htmlSourceDom:null,onChangeHandler:function(){},setHtmlSourceDom:function(e){this.htmlSourceDom=e},setOnChangeHandler:function(e){this.onChangeHandler=e},clear:function(){this.view=null},isInitialized:function(){return null!==this.view},getText:function(){return this.view&&this.view.viewState&&this.view.viewState.state&&this.view.viewState.state.doc?this.view.viewState.state.doc.toString():null},setText:function(e){var t=this,s=function(e){try{return r.format(e,{parser:"html",plugins:[n]})}catch(t){return e}}(e);if(this.view&&this.view.viewState&&this.view.viewState.state&&this.view.viewState.state.doc)this.view.dispatch({changes:{from:0,to:this.view.viewState.state.doc.length,insert:s}});else{var a=this.htmlSourceDom&&this.htmlSourceDom.length?this.htmlSourceDom[0]:null;if(a){var l=i.EditorView,h=i.basicSetup,d=o.html;this.view=new l({doc:s,extensions:[h,d(),l.updateListener.of(function(){t.onChangeHandler()})],parent:a})}}}}},dpSB:(e,t,s)=>{var i=s("a7T2"),o=s("ERH9"),n=(s("ioSH"),null),r=s("Ua3z"),a={};function l(e){return"p"===e.substr(0,1)&&/^[1-9][\d]*$/.test(e.substr(1))}function h(e){return"s"===e.substr(0,1)&&/^[1-9][\d]*$/.test(e.substr(1))}a.getMailbox=function(e,t,i,n,a,l,h,d){var c=s("Fj7m").getCurrent(),u=[r.HashModuleName,c?c.hash():""];return t=o.pInt(t,1),i=o.pString(i),n=o.pString(n),a=o.pString(a),l=o.pString(l,r.MessagesSortBy.DefaultSortBy),h=o.pInt(h,r.MessagesSortBy.DefaultSortOrder),d=o.pString(d),o.isNonEmptyString(e)&&u.push(e),""!==a&&u.push("filter:"+a),""!==l&&r.MessagesSortBy.DefaultSortBy!==l&&u.push("sortby:"+l),r.MessagesSortBy.DefaultSortOrder!==h&&u.push("sortorder:"+h),1<t&&u.push("p"+t),""!==i&&u.push("msg"+i),""!==n&&u.push(n),""!==d&&u.push("custom:"+d),u},a.requireMailCache=function(){null===n&&(n=s("eGl8"))},a.parseMailbox=function(e){this.requireMailCache();var t=e.length>0&&"compose"===e[0]&&"to"===e[1],s=t?[]:e,a="",h="",d=n.folderList().inboxFolderFullName()||"INBOX",c=1,u="",p="",m="",g=r.MessagesSortBy.DefaultSortBy,f=r.MessagesSortBy.DefaultSortOrder,b="",y="",A=0;return o.isNonEmptyArray(s)&&(a=o.pString(s[A]),A++),o.isNonEmptyArray(s)&&(h=o.pString(s[A]),A++,s.length>A&&((y=o.pString(s[A]))==="filter:"+Enums.FolderFilter.Flagged&&(m=Enums.FolderFilter.Flagged,A++),y==="filter:"+Enums.FolderFilter.Unseen&&(m=Enums.FolderFilter.Unseen,A++)),s.length>A&&"sortby:"===(y=o.pString(s[A])).substr(0,7)&&(r.MessagesSortBy.Allow&&(g=y.substr(7)),A++),s.length>A&&"sortorder:"===(y=o.pString(s[A])).substr(0,10)&&(r.MessagesSortBy.Allow&&(f=o.pEnum(o.pInt(y.substr(10)),Enums.SortOrder,r.MessagesSortBy.DefaultSortOrder)),A++),i.find(r.MessagesSortBy.List,function(e){return e.SortBy===g})||(g=r.MessagesSortBy.DefaultSortBy,f=r.MessagesSortBy.DefaultSortOrder),s.length>A&&l(y=o.pString(s[A]))&&((c=o.pInt(y.substr(1)))<=0&&(c=1),A++),s.length>A&&function(e){if("msg"===e.substr(0,3)){var t=e.substr(3).split(":");if(1===t.length)return/^[1-9][\d:]*$/.test(t[0]);if(t.length>=3)return/^[1-9][\d:]*$/.test(t[0])&&/^[1-9][\d:]*$/.test(t[t.length-1])}return!1}(y=o.pString(s[A]))&&(u=y.substr(3),A++),s.length>A&&"custom:"!==(y=o.pString(s[A])).substr(0,7)&&(p=y,A++),s.length>A&&"custom:"===(y=o.pString(s[A])).substr(0,7)&&(b=y.substr(7))),{MailtoCompose:t,AccountHash:a,Folder:""===h?d:h,Page:c,Uid:u,Search:p,Filters:m,SortBy:g,SortOrder:f,Custom:b}},a.getViewMessage=function(e,t,i){var o=s("Fj7m").getAccount(e),n=o?o.hash():"";return[r.HashModuleName+"-view",n,t,"msg"+i]},a.getCompose=function(){var e=s("Fj7m").getCurrent(),t=e?e.hash():"";return[r.HashModuleName+"-compose",t]},a.getComposeFromMessage=function(e,t,i,o){var n=s("Fj7m").getAccount(t),a=n?n.hash():"";return[r.HashModuleName+"-compose",a,e,i,o]},a.getComposeWithToField=function(e){var t=s("Fj7m").getCurrent(),i=t?t.hash():"";return[r.HashModuleName+"-compose",i,"to",e]},a.getComposeWithData=function(e){var t=s("Fj7m").getCurrent(),i=t?t.hash():"";return[r.HashModuleName+"-compose",i,"data",e]},a.getComposeWithObject=function(e,t){var i=s("Fj7m").getCurrent(),o=i?i.hash():"";return[r.HashModuleName+"-compose",o,e,t]},a.getComposeWithEmlObject=function(e,t,i,o){var n=s("Fj7m").getAccount(e),a=n?n.hash():"";return[r.HashModuleName+"-compose",a,Enums.ReplyType.ForwardAsAttach,t,i,o]},a.parseCompose=function(e){this.requireMailCache();var t=s("Fj7m"),i=e.length>0?e[0]:"",o=e.length>1?e[1]:"",r=(o===Enums.ReplyType.ForwardAsAttach||"attachments"===o||"data"===o)&&e.length>2?o===Enums.ReplyType.ForwardAsAttach?e[4]:e[2]:null,l="to"===o&&e.length>2?a.parseToAddr(e[2]):null,h=(o===Enums.ReplyType.Reply||o===Enums.ReplyType.ReplyAll||o===Enums.ReplyType.Resend||o===Enums.ReplyType.Forward||"drafts"===o||o===Enums.ReplyType.ForwardAsAttach)&&e.length>2,d=h?e[2]:"",c=h?e[3]:"",u=t.getAccountByHash(i),p=u?u.id():t.currentId(),m=n.getMessageActualIdentifiers(p,d,c);return{AccountHash:i,RouteType:o,ToAddr:l,Object:r,MessageFolderName:m.sFolder,MessageUid:m.sUid}},a.parseToAddr=function(e){var t=o.pString(e),s=-1!==t.indexOf("mailto:"),n=[],r=[],a="",l="",h="",d="";return s&&(n=t.replace(/^mailto:/,"").split("?"),t=n[0],2===n.length&&(r=n[1].split("&"),i.each(r,function(e){var t=e.split("=");if(2===t.length)switch(t[0].toLowerCase()){case"subject":a=decodeURIComponent(t[1]);break;case"cc":l=decodeURIComponent(t[1]);break;case"bcc":h=decodeURIComponent(t[1]);break;case"body":d=decodeURIComponent(t[1])}}))),{to:t,hasMailto:s,subject:a,cc:l,bcc:h,body:d}},a.parseMailServers=function(e){var t=0,s="",i=1,n="",r=!1,a=0;return o.isNonEmptyArray(e)&&(e.length>t&&l(s=o.pString(e[t]))&&((i=o.pInt(s.substr(1)))<=0&&(i=1),t++),e.length>t&&(h(s=o.pString(e[t]))||"create"===s||(n=s,t++)),e.length>t&&h(s=o.pString(e[t]))&&((a=o.pInt(s.substr(1),a))<=0&&(a=1),t++),e.length>t&&(r="create"===(s=o.pString(e[t])))),{Page:i,Search:n,Create:r,EditServerId:a}},e.exports=a},eGl8:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("sdEb"),a=s("LKDt"),l=s("ERH9"),h=s("uQaC"),d=s("IWyd"),c=s("Z9uT"),u=s("yU9o"),p=s("jIlg"),m=s("ioSH"),g=s("KIwC"),f=s("zVyH"),b=s("PMEU"),y=s("MYiO"),A=s("dpSB"),v=s("Fj7m"),F=s("P7bQ"),I=s("TmsQ"),C=null,S=s("Ua3z"),E=s("V8Bf"),M=s("Zm5i"),T=s("eL/8"),w=u.isNewTab()&&window.opener&&window.opener.MainTabMailMethods;function L(){this.currentAccountId=v.currentId,this.currentAccountId.subscribe(function(e){var t=v.getAccount(e),s=this.oFolderListItems[e];t?(t.quotaRecieved(!1),this.messagesLoadingError(!1),s?this.folderList(s):(this.messagesLoading(!0),this.folderList(new M),this.messages([]),this.currentMessage(null),this.getFolderList(e))):this.folderList(new M)},this),this.editedAccountId=v.editedId,this.editedAccountId.subscribe(function(e){var t=this.oFolderListItems[e];t?this.editedFolderList(t):(this.editedFolderList(new M),this.currentAccountId()!==e&&this.getFolderList(e))},this),this.oFolderListItems={},this.quotaChangeTrigger=n.observable(!1),this.checkMailStarted=n.observable(!1),this.checkMailStartedAccountId=n.observable(0),this.folderList=n.observable(new M),this.folderListLoading=n.observableArray([]),this.oUnifiedInbox=new E(0,!0),this.getCurrentFolder=n.computed(function(){return this.oUnifiedInbox.selected()?this.oUnifiedInbox:this.folderList().currentFolder()},this),this.getCurrentFolderFullname=n.computed(function(){return this.oUnifiedInbox.selected()?this.oUnifiedInbox.fullName():this.folderList().currentFolderFullName()},this),this.getCurrentFolderType=n.computed(function(){return this.oUnifiedInbox.selected()?this.oUnifiedInbox.type():this.folderList().currentFolderType()},this),this.editedFolderList=n.observable(new M),this.newMessagesCount=n.computed(function(){if(this.oUnifiedInbox.selected())return this.oUnifiedInbox.unseenMessageCount();var e=this.folderList().inboxFolder();return e?e.unseenMessageCount():0},this),this.messages=n.observableArray([]),this.messages.subscribe(function(){if(this.messages().length>0&&this.messagesLoadingError(!1),this.currentMessage()){var e=i.find(this.messages(),function(e){return e.longUid()===this.currentMessage().longUid()}.bind(this)),t=e?this.getFolderByFullName(e.accountId(),e.folder()):null;t&&!e&&t.getCompletelyFilledMessage(this.currentMessage().longUid(),null,null,!0)}},this),this.uidList=n.observable(new T),this.page=n.observable(1),this.messagesLoading=n.observable(!1),this.messagesLoadingError=n.observable(!1),this.currentMessage=n.observable(null),this.nextMessageUid=n.observable(""),this.prevMessageUid=n.observable(""),this.savingDraftUid=n.observable(""),this.editedDraftUid=n.observable(""),this.disableComposeAutosave=n.observable(!1),this.aResponseHandlers=[],this.iAutoCheckMailTimer=-1,this.waitForUnseenMessages=n.observable(!0),this.iSetMessagesSeenCount=0,u.subscribeEvent("ReceiveAjaxResponse::after",i.bind(function(e){!this.checkMailStarted()&&"Ping"===e.Response.Method&&"Core"===e.Response.Module&&e.Response.Result&&this.executeCheckMail()},this))}L.prototype.requirePrefetcher=function(){C=s("qG1F")},L.prototype.init=function(){if(F.registerOnAllRequestsClosedHandler(function(){i.delay(function(){F.hasOpenedRequests()||(U.checkMailStarted(!1),U.folderListLoading.removeAll())},10),F.hasOpenedRequests()||U.savingDraftUid("")}),w){if(this.oFolderListItems=w.getFolderListItems(),this.uidList(w.getUidList()),window.name){var e=l.pInt(window.name);0===e&&(e=w.getComposedMessageAccountId(window.name)),0!==e&&this.currentAccountId(e)}this.currentAccountId.valueHasMutated(),this.initPrevNextSubscribes()}else this.currentAccountId.valueHasMutated(),this.initPrevNextSubscribes();this.oUnifiedInbox.parse({"@Object":"Object/Folder",Name:a.i18n("MAILWEBCLIENT/LABEL_FOLDER_ALL_INBOXES"),FullNameRaw:"__unified__inbox__",FullNameHash:"",Delimiter:"/",Type:Enums.FolderTypes.AllInboxes,AlwaysRefresh:!0,IsSubscribed:!0,IsSelectable:!0,Exists:!0,SubFolders:[]},"","")},L.prototype.initPrevNextSubscribes=function(){this.bInThreadLevel=!1,this.currentMessage.subscribe(this.calcNextMessageUid,this),this.uidList.subscribe(this.calcNextMessageUid,this),this.currentMessage.subscribe(this.calcPrevMessageUid,this),this.uidList.subscribe(this.calcPrevMessageUid,this)},L.prototype.calcNextMessageUid=function(){var e="",t=null,s=null,o=!1;if(this.currentMessage()&&i.isFunction(this.currentMessage().longUid)){var n=this.currentMessage().uid(),r=i.indexOf(this.uidList().collection(),n);-1===r&&(n=this.currentMessage().longUid(),r=i.indexOf(this.uidList().collection(),n)),o=this.currentMessage().threadPart()&&""!==this.currentMessage().threadParentUid(),t=this.getFolderByFullName(this.currentMessage().accountId(),this.currentMessage().folder()),this.bInThreadLevel||o?(this.bInThreadLevel=!!w,o&&(s=t.getMessageByUid(this.currentMessage().threadParentUid()))&&(i.each(s.threadUids(),function(t,s,i){t===n&&s>0&&(e=i[s-1])}),l.isNonEmptyString(e)||(e=s.longUid()))):(i.each(this.uidList().collection(),function(t,s,i){t===n&&s>0&&(e=i[s-1]||"")}),""===e&&w&&-1!==r&&(this.requirePrefetcher(),C.prefetchNextPage(r)))}this.nextMessageUid(e)},L.prototype.calcPrevMessageUid=function(){var e="",t=null,s=null,o=!1;if(this.currentMessage()&&i.isFunction(this.currentMessage().longUid)){var n=this.currentMessage().uid(),r=i.indexOf(this.uidList().collection(),n);-1===r&&(n=this.currentMessage().longUid(),r=i.indexOf(this.uidList().collection(),n)),o=this.currentMessage().threadPart()&&""!==this.currentMessage().threadParentUid(),t=this.getFolderByFullName(this.currentMessage().accountId(),this.currentMessage().folder()),this.bInThreadLevel||o?(this.bInThreadLevel=!0,o?(s=t.getMessageByUid(this.currentMessage().threadParentUid()))&&i.each(s.threadUids(),function(t,s,i){t===n&&s+1<i.length&&(e=i[s+1]||"")}):this.currentMessage().threadCount()>0&&(e=this.currentMessage().threadUids()[0])):(i.each(this.uidList().collection(),function(t,s,i){t===n&&s+1<i.length&&(e=i[s+1]||"")}),""===e&&w&&-1!==r&&(this.requirePrefetcher(),C.prefetchPrevPage(r)))}this.prevMessageUid(e)},L.prototype.getFolderByFullName=function(e,t){if(t===this.oUnifiedInbox.fullName())return this.oUnifiedInbox;var s=this.oFolderListItems[e];return s?s.getFolderByFullName(t):null},L.prototype.checkCurrentFolderList=function(){var e=v.getCurrent(),t=e?this.oFolderListItems[e.id()]:null;!e||t||this.messagesLoading()||(this.messagesLoading(!0),this.messagesLoadingError(!1),this.getFolderList(e.id()))},L.prototype.getFolderList=function(e){v.getAccount(e)?(this.folderListLoading.push(e),F.send("GetFolders",{AccountID:e},this.onGetFoldersResponse,this)):e===this.currentAccountId()&&this.messagesLoading(!1)},L.prototype.markMessageReplied=function(e,t,s,i){var o=this.getFolderByFullName(e,t);o&&o.markMessageReplied(s,i)},L.prototype.hideThreads=function(e){var t=v.getCurrent();t&&t.threadingIsAvailable()&&e.folder()===this.getCurrentFolderFullname()&&!e.threadOpened()&&this.getCurrentFolder().hideThreadMessages(e)},L.prototype.showOpenedThreads=function(e){this.messages(this.getMessagesWithThreads(e,this.uidList(),this.messages()))},L.prototype.useThreadingInCurrentList=function(e){e=e||this.uidList();var t=v.getCurrent(),s=this.getCurrentFolder(),i=s&&s.withoutThreads(),o=""===e.search()&&""===e.filters();return t&&t.threadingIsAvailable()&&!i&&o},L.prototype.getMessagesWithThreads=function(e,t,s){var o=[],n=[],r=this.getCurrentFolder();return r&&(e===r.fullName()||this.oUnifiedInbox.selected()&&"INBOX"===e)&&this.useThreadingInCurrentList(t)?(n=i.filter(s,function(e){return!e.threadPart()}),i.each(n,function(e){var t=[];o.push(e),e.threadCount()>0&&(e.threadOpened()&&(t=this.getFolderByFullName(e.accountId(),e.folder()).getThreadMessages(e),o=i.union(o,t)),r.computeThreadData(e))},this),o):s},L.prototype.getMessageActualIdentifiers=function(e,t,s){var i,o=(i=l.pString(s)).split(":");return o.length>=3?{iAccountId:e=l.pInt(o[0]),sFolder:t=o.slice(1,o.length-1).join(":"),sUid:i=o[o.length-1]}:{iAccountId:e,sFolder:t,sUid:i}},L.prototype.setMessagesFromUidList=function(e,t,s){var o=e.getUidsForOffset(t),n=i.map(o,function(t){var s=e.iAccountId,i=e.sFullName,o=this.getMessageActualIdentifiers(s,i,t);return I.get([o.iAccountId,o.sFolder,o.sUid])},this),r=n.length;return s&&(this.messages(this.getMessagesWithThreads(this.getCurrentFolderFullname(),e,n)),t+r<e.resultCount()&&r<S.MailsPerPage&&(e.filters()!==Enums.FolderFilter.Unseen||this.waitForUnseenMessages())&&this.messagesLoading(!0),this.currentMessage()&&this.currentMessage().deleted()&&this.currentMessage(null)),o},L.prototype.getNamesOfFoldersToRefresh=function(e){var t=this.oFolderListItems[e],s=t?t.getNamesOfFoldersToRefresh():[],o=v.getCurrentFetchersAndFiltersFolderNames();return i.uniq(i.compact(i.union(s,o)))},L.prototype.getUseListStatusIfPossibleValue=function(e,t){var s=this.oFolderListItems[e];return(s?s.getFoldersCount():0)<100||t>50},L.prototype.executeCheckMail=function(e){clearTimeout(this.iAutoCheckMailTimer);var t=this.currentAccountId(),s=[],o=[],n=this.checkMailStarted()&&this.checkMailStartedAccountId()===t,r=e||!F.hasOpenedRequests("GetRelevantFoldersInformation")||!F.hasOpenedRequests("GetUnifiedRelevantFoldersInformation")||!n,a=null;u.getUserRole()!==Enums.UserRole.Anonymous&&r&&(v.unifiedInboxReady()?(i.each(v.collection(),function(e){(t===e.id()||e.includeInUnifiedMailbox())&&(s=this.getNamesOfFoldersToRefresh(e.id())).length>0&&o.push({AccountID:e.id(),Folders:s,UseListStatusIfPossible:this.getUseListStatusIfPossibleValue(e.id(),s.length)})},this),o.length>0&&(a={AccountsData:o},this.checkMailStarted(!0),this.checkMailStartedAccountId(t),F.send("GetUnifiedRelevantFoldersInformation",a,this.onGetRelevantFoldersInformationResponse,this))):(s=this.getNamesOfFoldersToRefresh(this.currentAccountId())).length>0&&(a={AccountID:t,Folders:s,UseListStatusIfPossible:this.getUseListStatusIfPossibleValue(t,s.length)},this.checkMailStarted(!0),this.checkMailStartedAccountId(t),F.send("GetRelevantFoldersInformation",a,this.onGetRelevantFoldersInformationResponse,this)))},L.prototype.setAutocheckmailTimer=function(){clearTimeout(this.iAutoCheckMailTimer),!u.isNewTab()&&g.AutoRefreshIntervalMinutes>0&&(this.iAutoCheckMailTimer=setTimeout(function(){U.isSearchExecuting()||(U.checkMessageFlags(),U.executeCheckMail(!1))},60*g.AutoRefreshIntervalMinutes*1e3))},L.prototype.isSearchExecuting=function(){var e=F.getOpenedRequest("GetMessages"),t=e&&e.Parameters;return t&&""!==t.Search},L.prototype.checkMessageFlags=function(){var e=this.folderList().inboxFolder(),t=e?e.getFlaggedMessageUids():[],s={Folder:this.folderList().inboxFolderFullName(),Uids:t};t.length>0&&F.send("GetMessagesFlags",s,this.onGetMessagesFlagsResponse,this)},L.prototype.onGetMessagesFlagsResponse=function(e,t){var s=t.Parameters,o=this.oFolderListItems[s.AccountID],n=o?o.inboxFolder():null;n&&(e.Result&&i.each(e.Result,function(e,t){-1===i.indexOf(e,"\\flagged")&&n.setMessageUnflaggedByUid(t)}),n.removeFlaggedMessageListsFromCache(),this.requirePrefetcher(),C.prefetchStarredMessageList())},L.prototype.changeCurrentMessageList=function(e,t,s,i,o,n){this.requestCurrentMessageList(e,t,s,i,o,n,!0)},L.prototype.requestCurrentMessageList=function(e,t,s,i,o,n,a){var l=this.requestMessageList(e,t,s,i||"",o,n,!0,a||!1);if(l){var h=60*g.AutoRefreshIntervalMinutes*1e3,d=l.Folder.oRelevantInformationLastMoment?r().diff(l.Folder.oRelevantInformationLastMoment):h+1;this.uidList(l.UidList),this.page(t),this.messagesLoading(l.RequestStarted),this.messagesLoadingError(!1),!l.RequestStarted&&h>0&&d>h&&this.executeCheckMail(!0)}},L.prototype.isSearchInMultiFolders=function(e){return e=l.pString(e,this.uidList().search()),/(^|\s)folders:(all|sub)(\s|$)/.test(e)},L.prototype.requestMessageList=function(e,t,s,i,o,n,r,a,h){h=l.pBool(h,!1);var c=this.getFolderByFullName(this.currentAccountId(),e);if(!c)return d.log("requestMessageList, error: folder not found ",JSON.stringify({currentAccountId:this.currentAccountId(),sFolder:e,iPage:t,sSearch:s,sFilters:i,sSortBy:o,iSortOrder:n,bCurrent:r,bFillMessages:a})),null;var u=c&&c.withoutThreads(),p=v.getCurrent(),m=p&&p.threadingIsAvailable()&&!u&&""===s&&""===i,g=c?c.getUidList(s,i,o,n):null,f=g&&-1===g.resultCount(),b=(t-1)*S.MailsPerPage,y={Folder:e,Offset:b,Limit:S.MailsPerPage,Search:s,Filters:i,SortBy:o,SortOrder:n,UseThreading:m},A=!1,I=!1,C=r?this.onCurrentGetMessagesResponse:this.onGetMessagesResponse,E=[];return e===this.getTemplateFolder()&&0===b&&S.MailsPerPage<S.MaxTemplatesCountOnCompose&&""===s&&""===i&&o===S.MessagesSortBy.DefaultSortBy&&n===S.MessagesSortBy.DefaultSortOrder&&(y.Limit=S.MaxTemplatesCountOnCompose),c.type()===Enums.FolderTypes.Inbox&&""===i?y.InboxUidnext=c.sUidNext:y.InboxUidnext="",f&&g.iAccountId===this.uidList().iAccountId&&g.sFullName===this.uidList().sFullName&&g.search()===this.uidList().search()&&g.filters()===this.uidList().filters()&&g.sortBy()===this.uidList().sortBy()&&g.sortOrder()===this.uidList().sortOrder()&&(g=this.uidList()),g&&(E=this.setMessagesFromUidList(g,b,a),c.updateLastAccessTime(E)),g&&(I=f||b+E.length<g.resultCount()&&E.length<S.MailsPerPage,A=!h&&(c.hasChanges()||I)),A?y.Folder===this.oUnifiedInbox.fullName()?(delete y.Folder,F.send("GetUnifiedMailboxMessages",y,C,this)):this.isSearchInMultiFolders(y.Search)?F.send("GetMessagesByFolders",y,C,this):F.send("GetMessages",y,C,this):a&&!h&&this.waitForUnseenMessages(!1),{UidList:g,RequestStarted:A,DataExpected:I,Folder:c}},L.prototype.executeEmptyTrash=function(){var e=this.folderList().trashFolder();e&&e.emptyFolder()},L.prototype.executeEmptySpam=function(){var e=this.folderList().spamFolder();e&&e.emptyFolder()},L.prototype.onClearFolder=function(e){if(e&&e.selected()){this.messages.removeAll(),this.currentMessage(null);var t=e?e.getUidList(this.uidList().search(),this.uidList().filters(),this.uidList().sortBy(),this.uidList().sortOrder()):null;t?(t.resultCount(0),this.uidList(t)):this.uidList(new T),this.checkMailStarted(!1),this.setAutocheckmailTimer()}},L.prototype.getOpenedDraftUids=function(){var e=f.getOpenedWindows(),t=i.map(e,function(e){return e.SlaveTabMailMethods?e.SlaveTabMailMethods.getEditedDraftUid():""});return b.hasOpenedMinimizedPopups()&&t.push(this.editedDraftUid()),i.uniq(i.compact(t))},L.prototype.closeComposesWithDraftUids=function(e){var t=f.getOpenedWindows();if(i.each(t,function(t){t.SlaveTabMailMethods&&-1!==o.inArray(t.SlaveTabMailMethods.getEditedDraftUid(),e)&&t.close()}),-1!==o.inArray(this.editedDraftUid(),e)){var n=s("sXLm");i.isFunction(n.closeComposePopup)&&n.closeComposePopup()}},L.prototype.moveMessagesToFolder=function(e,t,s){if(l.isNonEmptyArray(s)){var n=e&&e.type()===Enums.FolderTypes.Drafts,r=n&&this.getOpenedDraftUids(),h=n&&i.find(s,i.bind(function(e){return-1!==o.inArray(e,r)},this)),d={AccountID:e?e.iAccountId:0,Folder:e?e.fullName():"",ToFolder:t.fullName(),Uids:s.join(",")},c=null,u=i.bind(function(){this.uidList().filters()===Enums.FolderFilter.Unseen&&(this.uidList().resultCount()>S.MailsPerPage||-1===this.uidList().resultCount())&&this.waitForUnseenMessages(!0),c=e.markDeletedByUids(s),t.addMessagesCountsDiff(c.MinusDiff,c.UnseenMinusDiff),this.setUnifiedInboxUnseenChanges(t.iAccountId,t.fullName(),c.MinusDiff,c.UnseenMinusDiff),t.recivedAnim(!0),this.excludeDeletedMessages(),t.markHasChanges(),F.send("MoveMessages",d,this.onMoveMessagesResponse,this)},this);e&&t&&(h?(this.disableComposeAutosave(!0),b.showPopup(y,[a.i18n("MAILWEBCLIENT/CONFIRM_MESSAGE_FOR_DELETE_IS_EDITED"),i.bind(function(e){e&&(this.closeComposesWithDraftUids(s),u()),this.disableComposeAutosave(!1)},this),"",a.i18n("MAILWEBCLIENT/ACTION_CLOSE_DELETE_DRAFT")])):u())}},L.prototype.copyMessagesToFolder=function(e,t,s){if(e&&t&&s.length>0){var i={Folder:e.fullName(),ToFolder:t.fullName(),Uids:s.join(",")};t.recivedAnim(!0),t.markHasChanges(),F.send("CopyMessages",i,this.onCopyMessagesResponse,this)}},L.prototype.excludeDeletedMessages=function(){i.delay(i.bind(function(){var e=(this.page()-1)*S.MailsPerPage;this.setMessagesFromUidList(this.uidList(),e,!0)},this),500)},L.prototype.removeOneMessageFromCacheForFolder=function(e,t,s){var i=this.getFolderByFullName(e,t);i&&i.type()===Enums.FolderTypes.Drafts&&(this.currentMessage()&&this.currentMessage().folder()===t&&this.currentMessage().longUid()===s&&this.currentMessage(null),i.markDeletedByUids([s]),i.commitDeleted([s]))},L.prototype.startMessagesLoadingWhenDraftSaving=function(e,t){var s=this.getFolderByFullName(e,t);s&&s.type()===Enums.FolderTypes.Drafts&&s.selected()&&this.messagesLoading(!0)},L.prototype.removeMessagesFromCacheForFolder=function(e,t){var s=this.getFolderByFullName(e,t),i=this.getCurrentFolderFullname();s&&(s.markHasChanges(),this.currentAccountId()===e&&t===i&&this.requestCurrentMessageList(i,this.page(),this.uidList().search(),"",this.uidList().sortBy(),this.uidList().sortOrder(),!0))},L.prototype.deleteMessages=function(e){var t=this.getCurrentFolder();t&&this.deleteMessagesFromFolder(t,e)},L.prototype.deleteMessagesFromFolder=function(e,t){var s={AccountID:e.iAccountId,Folder:e.fullName(),Uids:t.join(",")};e.markDeletedByUids(t),this.excludeDeletedMessages(),F.send("DeleteMessages",s,this.onMoveMessagesResponse,this)},L.prototype.showExternalPictures=function(e){var t=this.currentMessage(),s=t?t.oFrom.aCollection:[],i=t?this.getFolderByFullName(t.accountId(),t.folder()):null;i&&(e&&s.length>0?i.alwaysShowExternalPicturesForSender(s[0].sEmail):i.showExternalPictures(t.longUid()))},L.prototype.setCurrentFolder=function(e,t){v.unifiedInboxAllowed()||e!==this.oUnifiedInbox.fullName()||(e=this.folderList().inboxFolderFullName()),this.oUnifiedInbox.selected(e===this.oUnifiedInbox.fullName()),this.folderList().setCurrentFolder(e,t)},L.prototype.setCurrentMessage=function(e,t,s){var i=this.getFolderByFullName(e,t),o=null;i&&s&&i.fullName()===t&&(o=I.get([i.iAccountId,i.fullName(),s])),o&&!o.deleted()?(this.currentMessage(o),S.MarkMessageSeenWhenViewing&&!this.currentMessage().seen()&&this.executeGroupOperation("SetMessagesSeen",[this.currentMessage().longUid()],"seen",!0),i.getCompletelyFilledMessage(s,this.onCurrentMessageResponse,this)):(this.currentMessage(null),u.isNewTab()&&i&&i.getCompletelyFilledMessage(s,this.onCurrentMessageResponse,this))},L.prototype.onCurrentMessageResponse=function(e,t,s){var i=this.currentMessage()&&this.currentMessage().longUid?this.currentMessage().longUid():"";null===e&&w&&s&&c.showErrorByCode(s,"",!0),null===e&&i===t?this.currentMessage(null):e&&i===t?this.currentMessage.valueHasMutated():u.isNewTab()&&e&&null===this.currentMessage()&&this.currentMessage(e)},L.prototype.getMessage=function(e,t,s,i,o){var n=this.getFolderByFullName(e,t);n&&n.getCompletelyFilledMessage(s,i,o)},L.prototype.setUnifiedInboxUnseenChanges=function(e,t,s,i){if(v.unifiedInboxReady()){var o=this.oUnifiedInbox.getUnifiedInbox(e);o&&o.fullName()===t&&(this.oUnifiedInbox.addMessagesCountsDiff(s,i),this.oUnifiedInbox.markHasChanges())}},L.prototype.getUidsSeparatedByFolders=function(e){var t={};return i.each(e,function(e){var s=this.getMessageActualIdentifiers(this.currentAccountId(),this.getCurrentFolderFullname(),e);""!==s.sUid&&(t[s.iAccountId+":"+s.sFolder]||(t[s.iAccountId+":"+s.sFolder]={iAccountId:s.iAccountId,sFolder:s.sFolder,aUids:[]}),t[s.iAccountId+":"+s.sFolder].aUids.push(s.sUid))}.bind(this)),t},L.prototype.executeGroupOperation=function(e,t,s,o){if(0===t.length)if(this.oUnifiedInbox.selected())i.each(v.unifiedMailboxAccounts(),function(i){var n=this.oUnifiedInbox.getUnifiedInbox(i.id());n&&this.executeGroupOperationForFolder(e,n,t,s,o)},this);else{var n=this.getCurrentFolder();n&&this.executeGroupOperationForFolder(e,n,t,s,o)}else{var r=this.getUidsSeparatedByFolders(t);i.each(r,function(t){var i=this.oFolderListItems[t.iAccountId],n=i?i.getFolderByFullName(t.sFolder):null;n&&this.executeGroupOperationForFolder(e,n,t.aUids,s,o)},this)}},L.prototype.executeGroupOperationForFolder=function(e,t,s,i,o){var n=t.iAccountId,r=this.oFolderListItems[n],a={AccountID:n,Folder:t.fullName(),Uids:s.join(","),SetAction:o},l=(this.page()-1)*S.MailsPerPage,h=s.length,d=r.oStarredFolder?r.oStarredFolder.messageCount():0,c=t.getUidList("",Enums.FolderFilter.Flagged,S.MessagesSortBy.DefaultSortBy,S.MessagesSortBy.DefaultSortOrder),u="SetMessagesSeen"===e?this.onSetMessagesSeenResponse:function(){};"SetMessagesSeen"===e&&this.iSetMessagesSeenCount++,F.send(e,a,u,this),t.executeGroupOperation(i,s,o),t.type()===Enums.FolderTypes.Inbox&&"flagged"===i&&(this.uidList().filters()===Enums.FolderFilter.Flagged?o||(this.uidList().deleteUids(s),r.oStarredFolder&&r.oStarredFolder.messageCount(c.resultCount())):(t.removeFlaggedMessageListsFromCache(),""===this.uidList().search()&&r.oStarredFolder&&(o?r.oStarredFolder.messageCount(d+h):r.oStarredFolder.messageCount(d-h>0?d-h:0)))),"seen"===i&&t.removeUnseenMessageListsFromCache(),(this.uidList().filters()!==Enums.FolderFilter.Unseen||this.waitForUnseenMessages())&&this.setMessagesFromUidList(this.uidList(),l,!0)},L.prototype.onSetMessagesSeenResponse=function(e,t){this.iSetMessagesSeenCount--,this.iSetMessagesSeenCount<0&&(this.iSetMessagesSeenCount=0),this.getCurrentFolder()&&0===this.iSetMessagesSeenCount&&(this.uidList().filters()!==Enums.FolderFilter.Unseen||this.waitForUnseenMessages())&&this.requestCurrentMessageList(this.getCurrentFolder().fullName(),this.page(),this.uidList().search(),this.uidList().filters(),this.uidList().sortBy(),this.uidList().sortOrder(),!1)},L.prototype.onGetFoldersResponse=function(e,t){var s=t.Parameters,o=new M,n=s.AccountID,r=this.oFolderListItems[n],a=r?r.oNamedCollection:{};!1===e.Result?(c.showErrorByCode(e),s.AccountID===this.currentAccountId()&&0===this.messages().length&&(this.messagesLoading(!1),this.messagesLoadingError(!0))):(o.parse(n,e.Result,a),r&&o.oStarredFolder.messageCount(r.oStarredFolder.messageCount()),this.__oldFolderList=this.oFolderListItems[n],this.oFolderListItems[n]=o,this.__oldFolderList&&(this.__oldFolderList.destroyFolders(),h.destroyObjectWithObservables(this,"__oldFolderList")),this.currentAccountId()===n&&this.folderList(o),this.editedAccountId()===n&&this.editedFolderList(o),this.requirePrefetcher(),C.prefetchFolderLists()||setTimeout(i.bind(this.getAllFoldersRelevantInformation,this,n),2e3)),this.folderListLoading.remove(n)},L.prototype.getAllFoldersRelevantInformation=function(e){if(v.unifiedInboxReady()){var t=[];i.each(v.collection(),function(s){var i=[];if(s.id()===e){var o=this.oFolderListItems[e];i=o?o.getFoldersWithoutCountInfo():[]}else s.includeInUnifiedMailbox()&&(i=this.getNamesOfFoldersToRefresh(e));i.length>0&&t.push({AccountID:s.id(),Folders:i,UseListStatusIfPossible:this.getUseListStatusIfPossibleValue(s.id(),i.length)})},this),t.length>0&&(n={AccountsData:t},F.send("GetUnifiedRelevantFoldersInformation",n,this.onGetRelevantFoldersInformationResponse,this))}else{var s=this.oFolderListItems[e],o=s?s.getFoldersWithoutCountInfo():[],n={AccountID:e,Folders:o,UseListStatusIfPossible:this.getUseListStatusIfPossibleValue(e,o.length)};o.length>0&&F.send("GetRelevantFoldersInformation",n,this.onGetRelevantFoldersInformationResponse,this)}},L.prototype.onGetRelevantFoldersInformationResponse=function(e,t){var s=!1,o=t.Parameters.AccountID,n=e.Result;if(!1===n)c.showErrorByCode(e),(F.hasOpenedRequests("GetRelevantFoldersInformation")||F.hasOpenedRequests("GetUnifiedRelevantFoldersInformation"))&&(s=!0);else if(n.Unified&&n.Accounts){i.each(n.Accounts,function(e){this.onGetRelevantFoldersInformationResponseForAccount(e.AccountId,e.Counts)},this);var r=this.oUnifiedInbox.selected(),a=n.Unified,l=a[0],h=a[1],d=a[2],u=a[3],p=this.oUnifiedInbox.setRelevantInformation(d,u,l,h,r);r&&p&&this.uidList().filters()!==Enums.FolderFilter.Unseen&&(this.requestCurrentMessageList(this.getCurrentFolder().fullName(),this.page(),this.uidList().search(),this.uidList().filters(),this.uidList().sortBy(),this.uidList().sortOrder(),!1),s=!0)}else n.Counts&&(s=s||this.onGetRelevantFoldersInformationResponseForAccount(o,n.Counts));this.checkMailStarted(s),this.checkMailStarted()||this.setAutocheckmailTimer()},L.prototype.onGetRelevantFoldersInformationResponseForAccount=function(e,t){var s=!1,o=this.oFolderListItems[e],n=this.currentAccountId()===e,r=this.getCurrentFolderFullname();return o&&(i.each(t,function(t,o){if(i.isArray(t)&&t.length>3){var a=t[0],l=t[1],h=t[2],d=t[3],c=!1,u=!1,p=null;(p=this.getFolderByFullName(e,o))&&(u=n&&p.fullName()===r,c=p.setRelevantInformation(h,d,a,l,u&&!this.isSearchInMultiFolders()),u&&c&&this.uidList().filters()!==Enums.FolderFilter.Unseen&&(this.requestCurrentMessageList(p.fullName(),this.page(),this.uidList().search(),this.uidList().filters(),this.uidList().sortBy(),this.uidList().sortOrder(),!1),s=!0))}},this),o.countsCompletelyFilled(!0)),s},L.prototype.showNotificationsForNewMessages=function(e){var t=this.getCurrentFolderFullname(),s=0,o="",n={},r="",d=[];if(e.Result.New&&e.Result.New.length>0){s=e.Result.New.length,o=e.Result.New[0].Uid;var c=e.Result.New[0].AccountId;t===this.oUnifiedInbox.fullName()&&(o=c+":"+t+":"+o),n={action:"show",icon:"static/styles/images/logo_140x140.png",title:a.i18n("MAILWEBCLIENT/INFO_NEW_MESSAGES_PLURAL",{COUNT:s},null,s),timeout:5e3,callback:function(){window.focus(),m.setHash(A.getMailbox(t,1,o,"",""))}},1===s&&(l.isNonEmptyString(e.Result.New[0].Subject)&&d.push(a.i18n("MAILWEBCLIENT/LABEL_SUBJECT")+": "+e.Result.New[0].Subject),r=i.map(e.Result.New[0].From,function(e){return""!==e.DisplayName?e.DisplayName:e.Email}).join(", "),l.isNonEmptyString(r)&&d.push(a.i18n("MAILWEBCLIENT/LABEL_FROM")+": "+r),n.body=d.join("\r\n")),h.desktopNotify(n)}},L.prototype.onCurrentGetMessagesResponse=function(e,t){this.checkMailStarted(!1),e.Result?(this.messagesLoadingError(!1),this.parseMessageList(e,t)):(d.log("onCurrentGetMessagesResponse, error ",JSON.stringify(t).substr(0,300),JSON.stringify(e).substr(0,300)),c.showErrorByCode(e),!0!==this.messagesLoading()||0!==this.messages().length&&e.ErrorCode===Enums.Errors.NotDisplayedError||this.messagesLoadingError(!0),this.messagesLoading(!1),this.setAutocheckmailTimer())},L.prototype.onGetMessagesResponse=function(e,t){e&&e.Result?this.parseMessageList(e,t):d.log("onGetMessagesResponse, error ",JSON.stringify(t).substr(0,300),JSON.stringify(e).substr(0,300))},L.prototype.parseAndCacheMessages=function(e,t,s,o){var n={};i.each(e,function(e){var i=this.getMessageActualIdentifiers(t.iAccountId,t.fullName(),e.UnifiedUid||e.Uid),r=n[i.iAccountId+":"+i.sFolder];if(!r){var a=this.oFolderListItems[i.iAccountId];r=a?a.getFolderByFullName(i.sFolder):null}if(r){var l=r.parseAndCacheMessage(e,!1,s);o.push(l),n[i.iAccountId+":"+i.sFolder]=r}},this)},L.prototype.removeAllMessageListsFromCacheIfHasChanges=function(e){if(e&&e.hasChanges()){var t=this.oFolderListItems[e.iAccountId],s=t?t.oNamedCollection:{};i.each(s,function(e){e.removeMultiFoldersMessageListsFromCache()},this),this.oUnifiedInbox.removeMultiFoldersMessageListsFromCache(),e.removeAllMessageListsFromCacheIfHasChanges()}},L.prototype.parseMessageList=function(e,t){t.Parameters&&!l.isNonEmptyString(t.Parameters.Folder)&&(t.Parameters.Folder=this.oUnifiedInbox.fullName());var s=e.Result,i=t.Parameters,o=i.AccountID,n=null,r=null,a=i.UseThreading,h=!1,d=(this.currentAccountId()===o||i.Folder===this.oUnifiedInbox.fullName())&&this.getCurrentFolderFullname()===i.Folder,c=d&&this.uidList().search()===s.Search&&this.uidList().filters()===s.Filters&&this.uidList().sortBy()===i.SortBy&&this.uidList().sortOrder()===i.SortOrder,u=this.page()===i.Offset/S.MailsPerPage+1;if(this.showNotificationsForNewMessages(e),!1!==s&&"Collection/MessageCollection"===s["@Object"]){if(n=this.getFolderByFullName(o,i.Folder),!this.isSearchInMultiFolders(i.Search)){var p=this.isSearchInMultiFolders(),m=d&&!c&&!p;n.setRelevantInformation(s.UidNext.toString(),s.FolderHash,s.MessageCount,s.MessageUnseenCount,m)}h=n.hasChanges(),this.removeAllMessageListsFromCacheIfHasChanges(n),(r=n.getUidList(s.Search,s.Filters,i.SortBy,i.SortOrder)).setUidsAndCount(i.Offset,s),this.parseAndCacheMessages(s["@Collection"],n,a,[]),c&&(this.uidList(r),u&&(r.filters()!==Enums.FolderFilter.Unseen||this.waitForUnseenMessages())&&(this.messagesLoading(!1),this.waitForUnseenMessages(!1),this.setMessagesFromUidList(r,i.Offset,!0),this.messagesLoading()||this.setAutocheckmailTimer())),!h||!d||c&&u||this.uidList().filters()===Enums.FolderFilter.Unseen||this.requestCurrentMessageList(this.getCurrentFolderFullname(),this.page(),this.uidList().search(),this.uidList().filters(),this.uidList().sortBy(),this.uidList().sortOrder(),!1),n.type()===Enums.FolderTypes.Inbox&&r.filters()===Enums.FolderFilter.Flagged&&""===r.search()&&this.folderList().oStarredFolder&&(this.folderList().oStarredFolder.messageCount(r.resultCount()),this.folderList().oStarredFolder.hasExtendedInfo(!0))}},L.prototype.increaseStarredCount=function(){this.folderList().oStarredFolder&&this.folderList().oStarredFolder.increaseCountIfHasNotInfo()},L.prototype.removeMessageFromCurrentList=function(e,t,s){var o=this.getFolderByFullName(e,t),n=o?o.getMessageByUid(s):null;n&&(this.messages(i.filter(this.messages(),function(e){return e.longUid()!==s})),m.replaceHashWithoutMessageUid(n.longUid()),o.markHasChanges())},L.prototype.onMoveMessagesResponse=function(e,t){var s=e.Result,o=t.Parameters,n=o.Uids.split(","),r=this.getFolderByFullName(o.AccountID,o.Folder),h=this.getFolderByFullName(o.AccountID,o.ToFolder),d=h&&h.type()===Enums.FolderTypes.Trash,u=h&&h.type()===Enums.FolderTypes.Spam,p=null,g=d?a.i18n("MAILWEBCLIENT/CONFIRM_MESSAGES_DELETE_WITHOUT_TRASH"):a.i18n("MAILWEBCLIENT/CONFIRM_MESSAGES_MARK_SPAM_WITHOUT_SPAM"),f=i.bind(function(e){e&&r&&this.deleteMessagesFromFolder(r,n)},this),A=this.getCurrentFolder(),v=A?A.fullName():"",F=!1;if(!1===s)r&&(p=r.revertDeleted(n)),h?(p&&h.addMessagesCountsDiff(-p.PlusDiff,-p.UnseenPlusDiff),e.ErrorCode===Enums.MailErrors.CannotMoveMessageQuota&&(d||u)?(l.isNonEmptyString(e.ErrorMessage)&&(g+=" ("+e.ErrorMessage+")"),b.showPopup(y,[g,f])):c.showErrorByCode(e,a.i18n("MAILWEBCLIENT/ERROR_MOVING_MESSAGES"))):c.showErrorByCode(e,a.i18n("MAILWEBCLIENT/ERROR_DELETING_MESSAGES")),F=!0;else if(r){var I=i.map(n,function(e){return r.iAccountId+":"+r.fullName()+":"+l.pString(e)});this.messages(i.filter(this.messages(),function(e){return-1===i.indexOf(I,e&&e.longUid&&e.longUid())})),r.commitDeleted(n),i.each(I,function(e){m.replaceHashWithoutMessageUid(e)})}if(r&&v===r.fullName()||h&&v===h.fullName()||this.isSearchInMultiFolders()||A.bIsUnifiedInbox&&(r&&r.type()===Enums.FolderTypes.Inbox||h&&h.type()===Enums.FolderTypes.Inbox))switch(A.markHasChanges(),this.uidList().filters()){case Enums.FolderFilter.Flagged:break;case Enums.FolderFilter.Unseen:this.waitForUnseenMessages()&&this.requestCurrentMessageList(v,this.page(),this.uidList().search(),this.uidList().filters(),this.uidList().sortBy(),this.uidList().sortOrder(),F);break;default:this.requestCurrentMessageList(v,this.page(),this.uidList().search(),this.uidList().filters(),this.uidList().sortBy(),this.uidList().sortOrder(),F)}else r&&v!==r.fullName()?(this.requirePrefetcher(),C.startFolderPrefetch(r)):h&&v!==h.fullName()&&(this.requirePrefetcher(),C.startFolderPrefetch(h))},L.prototype.onCopyMessagesResponse=function(e,t){var s=e.Result,i=t.Parameters,o=this.getFolderByFullName(i.AccountID,i.Folder),n=this.getFolderByFullName(i.AccountID,i.ToFolder),r=this.getCurrentFolder(),l=r.fullName();!1===s&&c.showErrorByCode(e,a.i18n("MAILWEBCLIENT/ERROR_COPYING_MESSAGES")),l===o.fullName()||n&&l===n.fullName()?(r.markHasChanges(),this.requestCurrentMessageList(l,this.page(),this.uidList().search(),"",this.uidList().sortBy(),this.uidList().sortOrder(),!1)):l!==o.fullName()?(this.requirePrefetcher(),C.startFolderPrefetch(o)):n&&l!==n.fullName()&&(this.requirePrefetcher(),C.startFolderPrefetch(n))},L.prototype.searchMessagesInCurrentFolder=function(e){var t=this.getCurrentFolderFullname()||"INBOX",s=this.currentMessage()?this.currentMessage().longUid():"",i=this.uidList().filters();m.setHash(A.getMailbox(t,1,s,e,i))},L.prototype.searchMessagesInInbox=function(e){m.setHash(A.getMailbox(this.folderList().inboxFolderFullName()||"INBOX",1,"",e,""))},L.prototype.getFolderHash=function(e){return m.buildHashFromArray(A.getMailbox(e,1,"","",""))},L.prototype.countMessages=function(e){var t=[],s=function(e){i.each(e.subfolders(),function(e,i){e.subscribed()&&(t.push(e.unseenMessageCount()),e.subfolders().length&&e.subscribed()&&s(e))},this)};e.expanded()||e.bNamespace?e.subfoldersMessagesCount(0):(s(e),e.subfoldersMessagesCount(i.reduce(t,function(e,t){return e+t},0)))},L.prototype.changeDatesInMessages=function(){I.updateMomentDates()},L.prototype.clearMessagesCache=function(e){var t=this.oFolderListItems[e];i.each(t.collection(),function(e){e.markHasChanges(),this.removeAllMessageListsFromCacheIfHasChanges(e)},this),e===this.currentAccountId()&&this.messages([])},L.prototype.getTemplateFolder=function(){var e=this.folderList(),t="",s=e.currentFolder()?e.currentFolder().fullName():"";return l.isNonEmptyArray(this.getCurrentTemplateFolders())&&(t=-1!==o.inArray(s,this.getCurrentTemplateFolders())?s:i.find(this.getCurrentTemplateFolders(),function(t){return!!e.oNamedCollection[t]})),"string"==typeof t?t:""},L.prototype.getCurrentTemplateFolders=function(){return S.AllowTemplateFolders?this.folderList().aTemplateFolders:[]},L.prototype.isTemplateFolder=function(e){return-1!==o.inArray(e,this.getCurrentTemplateFolders())},L.prototype.changeTemplateFolder=function(e,t){S.AllowTemplateFolders&&this.folderList().changeTemplateFolder(e,t)};var U=new L;p.registerDayOfMonthFunction(i.bind(U.changeDatesInMessages,U)),g.timeFormat.subscribe(U.changeDatesInMessages,U),g.dateFormat.subscribe(U.changeDatesInMessages,U),e.exports=U},"eL/8":(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=(s("ERH9"),null),r=s("TmsQ"),a=s("Ua3z");function l(){this.iAccountId=0,this.sFullName="",this.search=o.observable(""),this.filters=o.observable(""),this.sortBy=o.observable(a.MessagesSortBy.DefaultSortBy),this.sortOrder=o.observable(a.MessagesSortBy.DefaultSortOrder),this.resultCount=o.observable(-1),this.collection=o.observableArray([])}l.prototype.requireMailCache=function(){null===n&&(n=s("eGl8"))},l.prototype.setUidsAndCount=function(e,t){"Collection/MessageCollection"===t["@Object"]&&(i.each(t.Uids,function(t,s){this.collection()[s+e]=t.toString()},this),this.resultCount(t.MessageResultCount))},l.prototype.getUidsForOffset=function(e){this.requireMailCache();for(var t=0,s=this.collection().length,i="",o=(this.iAccountId,this.sFullName,0),l=[],h=null;t<s;t++)if(t>=e&&o<a.MailsPerPage){if(void 0!==(i=this.collection()[t])){var d=n.getMessageActualIdentifiers(this.iAccountId,this.sFullName,i);h=r.get([d.iAccountId,d.sFolder,d.sUid])}(h&&!h.deleted()||void 0===i)&&(o++,void 0!==i&&l.push(i))}return l},l.prototype.deleteUids=function(e){for(var t=0,s=this.collection().length,o="",n=[],r=0;t<s;t++)o=this.collection()[t],-1===i.indexOf(e,o)?n.push(o):r++;this.collection(n),this.resultCount(this.resultCount()-r)},l.prototype.clearData=function(){this.resultCount(-1),this.collection([])},e.exports=l},fcI1:(e,t,s)=>{var i=s("yU9o"),o=s("D2Gh"),n=s("ioSH"),r=s("Panx"),a=s("Fj7m"),l=s("eGl8"),h=[],d=[];if(i.isNewTab()){var c={getEditedDraftUid:function(){return l.editedDraftUid()}};window.SlaveTabMailMethods=c,e.exports={}}else{var u={showReport:function(e){o.showReport(e)},getAccountList:function(){return a},getFolderListItems:function(){return l.oFolderListItems},getUidList:function(){return l.uidList()},getComposedMessageAccountId:function(e){var t=h[e];return t?t.accountId:0},getComposedMessage:function(e){var t=h[e];return delete h[e],t},removeOneMessageFromCacheForFolder:function(e,t,s){l.removeOneMessageFromCacheForFolder(e,t,s)},replaceHashWithoutMessageUid:function(e){n.replaceHashWithoutMessageUid(e)},startMessagesLoadingWhenDraftSaving:function(e,t){l.startMessagesLoadingWhenDraftSaving(e,t)},removeMessagesFromCacheForFolder:function(e,t){l.removeMessagesFromCacheForFolder(e,t)},searchMessagesInCurrentFolder:function(e){l.searchMessagesInCurrentFolder(e)},getReplyData:function(e){var t=d[e];return delete d[e],t},deleteMessage:function(e,t){r.deleteMessages([e],t)}};window.MainTabMailMethods=u,e.exports={passReplyData:function(e,t){d[e]=t},passComposedMessage:function(e,t){h[e]=t}}}},gbYw:(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=s("M4cL");function r(e,t,s){this.aGreyColors=["rgb(0, 0, 0)","rgb(68, 68, 68)","rgb(102, 102, 102)","rgb(153, 153, 153)","rgb(204, 204, 204)","rgb(238, 238, 238)","rgb(243, 243, 243)","rgb(255, 255, 255)"],this.aBrightColors=["rgb(255, 0, 0)","rgb(255, 153, 0)","rgb(255, 255, 0)","rgb(0, 255, 0)","rgb(0, 255, 255)","rgb(0, 0, 255)","rgb(153, 0, 255)","rgb(255, 0, 255)"],this.aColorLines=[["rgb(244, 204, 204)","rgb(252, 229, 205)","rgb(255, 242, 204)","rgb(217, 234, 211)","rgb(208, 224, 227)","rgb(207, 226, 243)","rgb(217, 210, 233)","rgb(234, 209, 220)"],["rgb(234, 153, 153)","rgb(249, 203, 156)","rgb(255, 229, 153)","rgb(182, 215, 168)","rgb(162, 196, 201)","rgb(159, 197, 232)","rgb(180, 167, 214)","rgb(213, 166, 189)"],["rgb(224, 102, 102)","rgb(246, 178, 107)","rgb(255, 217, 102)","rgb(147, 196, 125)","rgb(118, 165, 175)","rgb(111, 168, 220)","rgb(142, 124, 195)","rgb(194, 123, 160)"],["rgb(204, 0, 0)","rgb(230, 145, 56)","rgb(241, 194, 50)","rgb(106, 168, 79)","rgb(69, 129, 142)","rgb(61, 133, 198)","rgb(103, 78, 167)","rgb(166, 77, 121)"],["rgb(153, 0, 0)","rgb(180, 95, 6)","rgb(191, 144, 0)","rgb(56, 118, 29)","rgb(19, 79, 92)","rgb(11, 83, 148)","rgb(53, 28, 117)","rgb(116, 27, 71)"],["rgb(102, 0, 0)","rgb(120, 63, 4)","rgb(127, 96, 0)","rgb(39, 78, 19)","rgb(12, 52, 61)","rgb(7, 55, 99)","rgb(32, 18, 77)","rgb(76, 17, 48)"]],this.caption=e,this.pickHandler=t,this.pickContext=s,this.colorPickerDom=o.observable(null)}r.prototype.ViewTemplate="MailWebclient_ColorPickerView",r.prototype.onShow=function(){n(this.colorPickerDom()).find("span.color-item").on("click",i.bind(function(e){e.stopPropagation(),this.setColorFromPopup(n(e.target).data("color"))},this))},r.prototype.setColorFromPopup=function(e){this.pickHandler.call(this.pickContext,e)},e.exports=r},jqos:(e,t,s)=>{var i=s("p09A"),o=s("rBrp"),n=s("ERH9");function r(){this.sName="",this.sEmail="",this.sDisplay="",this.sFull="",this.loaded=i.observable(!1),this.found=i.observable(!1)}r.prototype.parse=function(e){null!==e&&(this.sName=n.pString(e.DisplayName),this.sEmail=n.pString(e.Email),this.sDisplay=this.sName.length>0?this.sName:this.sEmail,this.sFull=o.getFullEmail(this.sName,this.sEmail))},r.prototype.getEmail=function(){return this.sEmail},r.prototype.getName=function(){return this.sName},r.prototype.getDisplay=function(){return this.sDisplay},r.prototype.getFull=function(){return this.sFull},e.exports=r},lZd5:(e,t,s)=>{var i=s("a7T2"),o=s("jqos");function n(){this.aCollection=[]}n.prototype.parse=function(e){var t=e?e["@Collection"]:[];this.aCollection=[],i.isArray(t)&&(this.aCollection=i.map(t,function(e){var t=new o;return t.parse(e),t}))},n.prototype.addCollection=function(e){i.each(e,function(e){i.find(this.aCollection,function(t){return e.sEmail===t.sEmail})||this.aCollection.push(e)},this)},n.prototype.excludeCollection=function(e){i.each(e,function(e){this.aCollection=i.filter(this.aCollection,function(t){return e.sEmail.toLowerCase()!==t.sEmail.toLowerCase()})},this)},n.prototype.getFirstEmail=function(){return this.aCollection.length>0?this.aCollection[0].getEmail():""},n.prototype.getFirstName=function(){return this.aCollection.length>0?this.aCollection[0].getName():""},n.prototype.getFirstDisplay=function(){return this.aCollection.length>0?this.aCollection[0].getDisplay():""},n.prototype.getDisplay=function(e,t){return i.map(this.aCollection,function(s){return e&&t===s.sEmail?e:s.getDisplay(e)}).join(", ")},n.prototype.getFull=function(){return i.map(this.aCollection,function(e){return e.getFull()}).join(", ")},n.prototype.getEmails=function(){return i.map(this.aCollection,function(e){return e.getEmail()})},e.exports=n},njx6:(e,t,s)=>{var i=s("PMEU"),o=s("dpSB"),n={};function r(){return s("v4rC")}n.composeMessage=function(){i.showPopup(r())},n.composeMessageFromDrafts=function(e,t,s){var n=o.getComposeFromMessage("drafts",e,t,s);n.shift(),i.showPopup(r(),[n])},n.composeMessageAsReplyOrForward=function(e,t,s,n){var a=o.getComposeFromMessage(e,t,s,n);a.shift(),i.showPopup(r(),[a])},n.composeMessageToAddresses=function(e){var t=o.getComposeWithToField(e);t.shift(),i.showPopup(r(),[t])},n.composeMessageWithData=function(e){var t=o.getComposeWithData(e);t.shift(),i.showPopup(r(),[t])},n.composeMessageWithEml=function(e){var t=o.getComposeWithEmlObject(e.accountId(),e.folder(),e.longUid(),e);t.shift(),i.showPopup(r(),[t])},n.composeMessageWithAttachments=function(e){var t=o.getComposeWithObject("attachments",e);t.shift(),i.showPopup(r(),[t])},n.closeComposePopup=function(e){var t=r();!t.opened()||e&&t.senderAccountId()!==e||i.showPopup(t,[["close"]])},e.exports=n},p5xg:(e,t,s)=>{var i=s("a7T2"),o=s("69av");function n(){o.call(this),this.fConfirmCallback=null,this.shown=!1}i.extendOwn(n.prototype,o.prototype),n.prototype.PopupTemplate="MailWebclient_ConfirmAnotherMessageComposedPopup",n.prototype.onOpen=function(e){this.fConfirmCallback=i.isFunction(e)?e:null,this.shown=!0},n.prototype.onClose=function(){this.shown=!1},n.prototype.onDiscardClick=function(){this.shown&&this.fConfirmCallback&&this.fConfirmCallback(Enums.AnotherMessageComposedAnswer.Discard),this.closePopup()},n.prototype.onSaveAsDraftClick=function(){this.shown&&this.fConfirmCallback&&this.fConfirmCallback(Enums.AnotherMessageComposedAnswer.SaveAsDraft),this.closePopup()},n.prototype.cancelPopup=function(){this.fConfirmCallback&&this.fConfirmCallback(Enums.AnotherMessageComposedAnswer.Cancel),this.closePopup()},n.prototype.onEnterHandler=function(){this.onSaveAsDraftClick()},e.exports=new n},qG1F:(e,t,s)=>{var i=s("a7T2"),o=(s("ERH9"),s("yU9o")),n=s("KIwC"),r=s("Fj7m"),a=s("P7bQ"),l=s("Ua3z"),h=s("eGl8"),d={},c=!1;d.prefetchFolderLists=function(){if(r.unifiedInboxAllowed()&&!r.unifiedInboxReady()){var e=i.find(r.collection(),function(e){return e.includeInUnifiedMailbox()&&!h.oFolderListItems[e.id()]},this);if(e)return h.getFolderList(e.id()),!0;r.unifiedInboxReady(!0)}return!1},d.prefetchFetchersIdentities=function(){return!(o.isNewTab()||c||!l.AllowFetchers&&!l.AllowIdentities||(r.populateFetchersIdentities(),c=!0,0))},d.prefetchAccountFilters=function(){var e=r.getCurrent(),t=!1;return e&&e.allowFilters()&&!e.filters()&&(e.requestFilters(),t=!0),t},d.prefetchMessageList=function(e,t,s,i){var o,n={page:t,search:s,filters:i},r=e.hasListBeenRequested(n);return o=h.requestMessageList(e.fullName(),n.page,n.search,n.filters,l.MessagesSortBy.DefaultSortBy,l.MessagesSortBy.DefaultSortOrder,!1,!1,r),!r&&!!o&&o.RequestStarted},d.prefetchStarredMessageList=function(){var e=h.folderList(),t=e?e.inboxFolder():null,s=!1;return t&&(s=this.prefetchMessageList(t,1,"",Enums.FolderFilter.Flagged)),s},d.prefetchUnseenMessageList=function(){var e=h.folderList(),t=e?e.inboxFolder():null,s=!1;return t&&(s=this.prefetchMessageList(t,1,"",Enums.FolderFilter.Unseen)),s},d.prefetchNextPage=function(e){var t=Math.ceil(e/l.MailsPerPage)+1;this.startPagePrefetch(t-1)},d.prefetchPrevPage=function(e){var t=Math.ceil((e+1)/l.MailsPerPage)+1;this.startPagePrefetch(t)},d.startPagePrefetch=function(e){var t=h.getCurrentFolder(),s=h.uidList(),i=(e-1)*l.MailsPerPage,o=e>0&&i<s.resultCount(),n=!1;return t&&!t.hasChanges()&&o&&(n=this.prefetchMessageList(t,e,s.search(),"")),n},d.startUnifiedInboxPrefetch=function(){return!!r.unifiedInboxReady()&&this.startFolderPrefetch(h.oUnifiedInbox)},d.startOtherFoldersPrefetch=function(){var e=h.folderList(),t=e.currentFolderFullName(),s=h.getNamesOfFoldersToRefresh(h.currentAccountId()),o=e?[e.inboxFolderFullName(),e.sentFolderFullName(),e.draftsFolderFullName(),e.spamFolderFullName()]:[],n=s.length<5?this.getOtherFolderNames(5-s.length):[],r=i.uniq(i.compact(i.union(o,s,n))),a=!1;return i.each(r,i.bind(function(s){a||t===s||(a=this.startFolderPrefetch(e.getFolderByFullName(s)))},this)),a},d.getOtherFolderNames=function(e){var t=h.folderList().inboxFolder(),s=t?t.subfolders():[],o=i.filter(h.folderList().collection(),function(e){return!e.isSystem()},this),n=i.first(i.union(s,o),e);return i.map(n,function(e){return e.fullName()})},d.startFolderPrefetch=function(e){var t=!1;return e&&(t=this.prefetchMessageList(e,1,"","")),t},d.startThreadListPrefetch=function(){var e=!1,t={};return i.each(h.messages(),function(e){if(e&&e.threadCount&&e.threadCount()>0){var s=e.accountId(),o=e.folder(),n=h.getFolderByFullName(s,o),r=s+":"+o;t[r]||(t[r]={oFolder:n,aUids:[]}),i.each(e.threadUids(),function(e){n.hasThreadUidBeenRequested(e)||t[r].aUids.push(e)})}},this),i.each(t,function(t,s){var i=t.oFolder,o=t.aUids;i&&o.length>0&&(o=o.slice(0,l.MailsPerPage),i.addRequestedThreadUids(o),i.loadThreadMessages(o),e=!0)}),e},d.startMessagesPrefetch=function(e){var t=e||h.getCurrentFolder(),s=!1;return t&&(t.bIsUnifiedInbox?i.each(r.unifiedMailboxAccounts(),function(e){var t=h.oUnifiedInbox.getUnifiedInbox(e.id());t&&(s=s||this.startMessagesPrefetchForFolder(t,h.oUnifiedInbox.selected()))},this):s=this.startMessagesPrefetchForFolder(t,t.selected())),s},d.startMessagesPrefetchForFolder=function(e,t){var s=0,o=l.MaxMessagesBodiesSizeToPrefetch,n=[],r=null,d=function(t){if(t&&i.isFunction(t.uid)){var r=t.accountId()===e.iAccountId&&t.folder()===e.fullName(),a=!t.deleted()&&!t.completelyFilled(),h=!i.find(n,function(e){return e===t.uid()},this),d=!e.hasUidBeenRequested(t.uid()),c=t.textSize()<l.MessageBodyTruncationThreshold?t.textSize():l.MessageBodyTruncationThreshold;s<o&&r&&a&&h&&d&&(n.push(t.uid()),s+=c+2048)}};return!!(e&&(t&&i.each(h.messages(),d),e.doForAllMessages(d),n.length>0))&&(e.addRequestedUids(n),r={AccountID:e.iAccountId,Folder:e.fullName(),Uids:n,MessageBodyTruncationThreshold:l.MessageBodyTruncationThreshold},a.send("GetMessagesBodies",r,this.onGetMessagesBodiesResponse,this),!0)},d.onGetMessagesBodiesResponse=function(e,t){var s=t.Parameters,n=h.getFolderByFullName(s.AccountID,s.Folder);i.isArray(e.Result)&&(i.each(e.Result,function(e){n.parseAndCacheMessage(e,!1,!1)}),o.broadcastEvent("MailWebclient::ParseMessagesBodies::after",{AccountID:s.AccountID,Folder:s.Folder}))},d.prefetchAccountQuota=function(){var e=r.getCurrent(),t=e&&!e.quotaRecieved();return!(!n.ShowQuotaBar||!t||(e.updateQuotaParams(),0))},d.prefetchTemplateFolder=function(){var e=h.folderList(),t=h.getTemplateFolder();return""!==t&&this.startFolderPrefetch(e.getFolderByFullName(t))},d.prefetchTemplateMessages=function(){var e=h.folderList(),t=h.getTemplateFolder(),s=t?e.getFolderByFullName(t):null;if(s)return this.startMessagesPrefetch(s)},e.exports={startMin:function(){var e=!1;return(e=d.prefetchFetchersIdentities())||(e=d.prefetchFolderLists()),e||(e=d.prefetchTemplateFolder()),e||(e=d.prefetchTemplateMessages()),e||(e=d.prefetchAccountFilters()),e||(e=d.prefetchStarredMessageList()),e||(e=d.prefetchAccountQuota()),e},startAll:function(){var e=!1;return(e=d.prefetchFetchersIdentities())||(e=d.prefetchFolderLists()),e||(e=d.prefetchTemplateFolder()),e||(e=d.prefetchTemplateMessages()),e||(e=d.prefetchAccountFilters()),e||(e=d.startMessagesPrefetch()),e||(e=d.startThreadListPrefetch()),e||(e=d.prefetchStarredMessageList()),e||(e=d.startPagePrefetch(h.page()+1)),e||(e=d.startPagePrefetch(h.page()-1)),e||(e=d.prefetchUnseenMessageList()),e||(e=d.prefetchAccountQuota()),e||(e=d.startUnifiedInboxPrefetch()),e||(e=d.startOtherFoldersPrefetch()),e},prefetchStarredMessageList:function(){d.prefetchStarredMessageList()},prefetchFolderLists:function(){return d.prefetchFolderLists()},startFolderPrefetch:function(e){d.startFolderPrefetch(e)},prefetchNextPage:function(e){d.prefetchNextPage(e)},prefetchPrevPage:function(e){d.prefetchPrevPage(e)}}},sHZb:(e,t,s)=>{var i=s("a7T2"),o=s("p09A"),n=s("0HIo");function r(){this.iAccountId=0,this.collection=o.observableArray([])}r.prototype.parse=function(e,t){var s=0,o=t.length,r=null;if(this.iAccountId=e,i.isArray(t))for(o=t.length;s<o;s++)(r=new n(e)).parse(t[s]),this.collection.push(r)},e.exports=r},sXLm:(e,t,s)=>{var i=s("yU9o"),o=i.isMobile()||i.isNewTab()?s("J08i"):s("njx6");e.exports=o},slJ3:(e,t,s)=>{var i=s("p09A"),o=s("ERH9"),n=s("uQaC"),r=s("rBrp");function a(){this.ALIAS=!0,this.email=i.observable(""),this.friendlyName=i.observable(""),this.fullEmail=i.computed(function(){return r.getFullEmail(this.friendlyName(),this.email())},this),this.accountId=i.observable(-1),this.id=i.observable(-1),this.signature=i.observable(""),this.useSignature=i.observable(!1),this.hash=i.computed(function(){return n.getHash(this.accountId()+"alias"+this.id())},this)}a.prototype.parse=function(e){this.email(o.pString(e.Email)),this.friendlyName(o.pString(e.FriendlyName)),this.accountId(o.pInt(e.IdAccount)),this.id(o.pInt(e.EntityId));var t=o.pString(e.Signature);0!==t.indexOf("<")&&(t="<div>"+t+"</div>"),this.signature=i.observable(t),this.useSignature(!!e.UseSignature)},e.exports=a},v4rC:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("p09A"),r=s("LKDt"),a=s("/Odb"),l=s("PMEU"),h=s("69av"),d=s("p5xg"),c=s("Ssud");function u(){h.call(this),c.call(this),this.minimized=n.observable(!1),this.fPreventBackspace=function(e){var t=e.which===o.ui.keyCode.BACKSPACE,s="INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName,i="DIV"===e.target.tagName&&"true"===o(e.target).attr("contenteditable");!t||s||i||(e.preventDefault(),e.stopPropagation())},this.minimized.subscribe(function(){this.minimized()?this.preventBackspaceOff():this.shown()&&this.preventBackspaceOn()},this),this.minimizedTitle=n.computed(function(){return this.subject()||r.i18n("MAILWEBCLIENT/HEADING_MINIMIZED_NEW_MESSAGE")},this)}i.extendOwn(u.prototype,h.prototype),i.extendOwn(u.prototype,c.prototype),u.prototype.PopupTemplate="MailWebclient_ComposePopup",u.prototype.preventBackspaceOn=function(){o(document).on("keydown",this.fPreventBackspace)},u.prototype.preventBackspaceOff=function(){o(document).off("keydown",this.fPreventBackspace)},u.prototype.onClose=function(){this.preventBackspaceOff(),this.minimized(!1)},u.prototype.onOpen=function(e){if(1===(e=e||[]).length&&"close"===e[0])this.closePopup();else{var t=3===e.length&&"drafts"===e[0]&&e[2]===this.draftUid(),s=this.minimized();this.maximize(),this.shown()||s?(e.length>0&&!t?this.hasUnsavedChanges()?(this.disableAutosave(!0),l.showPopup(d,[i.bind(function(t){switch(t){case Enums.AnotherMessageComposedAnswer.Discard:this.onRoute(e);break;case Enums.AnotherMessageComposedAnswer.SaveAsDraft:this.hasUnsavedChanges()&&this.executeSave(!0,!1),this.onRoute(e);case Enums.AnotherMessageComposedAnswer.Cancel:}this.disableAutosave(!1)},this)])):this.onRoute(e):s||this.onRoute(e),this.oHtmlEditor.clearUndoRedo()):this.onRoute(e),this.preventBackspaceOn()}},u.prototype.minimize=function(){this.minimized(!0),this.$popupDom&&this.$popupDom.addClass("minimized")},u.prototype.maximize=function(){this.minimized(!1),this.$popupDom&&this.$popupDom.removeClass("minimized")},u.prototype.saveAndClose=function(){this.hasUnsavedChanges()&&this.saveCommand(),setTimeout(this.closePopup.bind(this),0)},u.prototype.cancelPopup=function(){this.hasUnsavedChanges()?this.minimize():this.closePopup()},u.prototype.onEscHandler=function(e){var t=this.oHtmlEditor.hasOpenedPopup(),s=!a.ie&&e.target&&"input"===e.target.tagName.toLowerCase()&&"file"===e.target.type.toLowerCase();s&&e.target.blur(),!l.hasOnlyOneOpenedPopup()||t||s||this.minimize(),t&&this.oHtmlEditor.closeAllPopups()},e.exports=new u},wXcN:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("ERH9"),r={showInlinePictures:function(e,t,s,n){var r=function(e){return i.find(t,function(t){return t.CID===e})};"string"!=typeof n&&(n=""),s.length>0&&(o("[data-x-src-cid]",e).each(function(){var e=o(this).attr("data-x-src-cid"),t=r(e);t&&t.ViewLink.length>0&&o(this).attr("src",n+t.ViewLink)}),o("[data-x-style-cid]",e).each(function(){var e="",t=o(this).attr("data-x-style-cid-name"),s=o(this).attr("data-x-style-cid"),i=r(s);i&&i.ViewLink.length>0&&""!==t&&(e=""===(e=o.trim(o(this).attr("style")))?"":";"===e.substr(-1)?e+" ":e+"; ",o(this).attr("style",e+t+": url('"+i.ViewLink+"')"))})),o("[data-x-src-location]",e).each(function(){var e,s=o(this).attr("data-x-src-location"),a=(e=s,i.find(t,function(t){return t.ContentLocation===e}));a||(a=r(s)),a&&a.ViewLink.length>0&&o(this).attr("src",n+a.ViewLink)})},showExternalPictures:function(e){o("[data-x-src]",e).each(function(){o(this).attr("src",o(this).attr("data-x-src")).removeAttr("data-x-src")}),o("[data-x-style-url]",e).each(function(){var e=o.trim(o(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",o(this).attr("style",e+o(this).attr("data-x-style-url")).removeAttr("data-x-style-url")})},joinReplyPrefixesInSubject:function(e,t,s){var r=[t.toUpperCase()],a=[s.toUpperCase()],l=i.union(r,a).join("|"),h="",d=e.split(":"),c=[],u="";return i.each(d,function(e){if(0===u.length){var h=o.trim(e.toUpperCase()),d=-1!==i.indexOf(r,h),p=-1!==i.indexOf(a,h),m=1,g=c.length>0?c[c.length-1]:null;if(!d&&!p){var f=new window.RegExp("^\\s?("+l+")\\s?[\\[\\(]([\\d]+)[\\]\\)]$","gi").exec(h);f&&3===f.length&&(d=-1!==i.indexOf(r,f[1].toUpperCase()),p=-1!==i.indexOf(a,f[1].toUpperCase()),m=n.pInt(f[2]))}d?g&&g.prefix===t?g.count+=m:c.push({prefix:t,count:m}):p?g&&g.prefix===s?g.count+=m:c.push({prefix:s,count:m}):u=e}else u+=":"+e}),i.each(c,function(e){1===e.count?h+=e.prefix+": ":h+=e.prefix+"["+e.count+"]: "}),h+=o.trim(u)}};e.exports=r},y9oY:(e,t,s)=>{var i=s("a7T2"),o=s("M4cL"),n=s("yU9o"),r=s("/Odb"),a=s("7VXH"),l=s("ERH9"),h=s("ZXeO");function d(e){this.oOptions=i.extend({creaId:"creaId",fontNameArray:["Tahoma"],defaultFontName:"Tahoma",defaultFontSize:3,alwaysTryUseImageWhilePasting:!0,dropableArea:null,isRtl:!1,onChange:function(){},onCursorMove:function(){},onFocus:function(){},onBlur:function(){},onUrlIn:function(){},onUrlOut:function(){},onImageSelect:function(){},onImageBlur:function(){},onItemOver:null,onItemOut:null,openInsertLinkDialog:function(){},onUrlClicked:!1},void 0===e?{}:e)}d.prototype.oOptions={},d.prototype.$container=null,d.prototype.$editableArea=null,d.prototype.aEditableAreaHtml=[],d.prototype.iUndoRedoPosition=0,d.prototype.bEditable=!1,d.prototype.bFocused=!1,d.prototype.aSizes=[{inNumber:1,inPixels:10},{inNumber:2,inPixels:13},{inNumber:3,inPixels:16},{inNumber:4,inPixels:18},{inNumber:5,inPixels:24},{inNumber:6,inPixels:32},{inNumber:7,inPixels:48}],d.prototype.bInUrl=!1,d.prototype.oCurrLink=null,d.prototype.oCurrImage=null,d.prototype.bInImage=!1,d.prototype.sBasicFontName="",d.prototype.sBasicFontSize="",d.prototype.sBasicDirection="",d.prototype.start=function(e){function t(e){return/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/.test(e)}function s(e){return!!e.match(/^[A-Z0-9\"!#\$%\^\{\}`~&'\+\-=_\.]+@[A-Z0-9\.\-]+$/i)}this.aRanges=null,this.$container=o("#"+this.oOptions.creaId),this.$editableArea=o("<div></div>").addClass("crea-content-editable").prop("contentEditable","true").appendTo(this.$container);var r=this;this.$editableArea.on("focus",function(){r.bFocused=!0}),this.$editableArea.on("blur",function(){r.bFocused=!1}),this.$editableArea.on("click","img",function(e){var t=o(this);r.bInImage=!0,r.oCurrImage=t,r.oOptions.onImageSelect(t,e),e.stopPropagation()}),this.$editableArea.on("click",function(e){r.bInImage=!1,r.oCurrImage=null,r.oOptions.onImageBlur()}),null!==r.oOptions.onItemOver&&this.$editableArea.on("mouseover",function(e){r.oOptions.onItemOver(e)}),null!==r.oOptions.onItemOver&&this.$editableArea.on("mouseout",function(e){r.oOptions.onItemOut(e)}),this.$editableArea.on("cut paste",function(){r.editableSave(),i.defer(function(){r.editableSave()})}),this.$editableArea.on("paste",function(e){if((e=e.originalEvent||e).clipboardData){var i=e.clipboardData.getData("text/plain"),o=e.clipboardData.getData("text/html");if(r.oOptions.alwaysTryUseImageWhilePasting&&r.pasteImage(e))e.preventDefault();else if(t(i))e.preventDefault(),r.execCom("insertHTML",'<a href="'+i+'">'+i.replaceAll("&","&")+"</a>");else if(s(i))e.preventDefault(),r.execCom("insertHTML",'<a href="mailto:'+i+'">'+i.replaceAll("&","&")+"</a>");else if(""!==o){var n=h.preparePastedHtml(o);n&&(e.preventDefault(),r.execCom("insertHTML",n))}}}),this.$editableArea.on("keydown",function(e){var i=e.keyCode||e.which||e.charCode||0,o=e.ctrlKey||e.metaKey,n=e.altKey,a=e.shiftKey,l="";if(a&&o&&i===Enums.Key.z||o&&i===Enums.Key.y)e.preventDefault(),r.editableRedo();else if(o&&!n&&i===Enums.Key.z)e.preventDefault(),r.editableUndo();else if(!o||i!==Enums.Key.k&&i!==Enums.Key.b&&i!==Enums.Key.i&&i!==Enums.Key.u)n||a||o||i!==Enums.Key.Del&&i!==Enums.Key.Backspace||r.editableSave();else switch(e.preventDefault(),i){case Enums.Key.k:t(l=r.getSelectedText())?r.insertLink(l):s(l)?r.insertLink("mailto:"+l):r.oOptions.openInsertLinkDialog();break;case Enums.Key.b:r.bold();break;case Enums.Key.i:r.italic();break;case Enums.Key.u:r.underline()}}),this.$editableArea.on("keyup",function(e){var t=e.keyCode||e.which||e.charCode||0,s=e.ctrlKey||e.metaKey,i=e.altKey,o=e.shiftKey;i||o||s||(t===Enums.Key.Space||t===Enums.Key.Enter||t===Enums.Key.Del||t===Enums.Key.Backspace?r.editableSave():r.oOptions.onChange())}),this.initContentEditable(),this.setEditable(e),n.broadcastEvent("MailWebclient::StartCrea::after",{EditableArea:this.$editableArea,InsertHtmlHandler:this.insertHtml.bind(this)})},d.prototype.clearUndoRedo=function(){this.aEditableAreaHtml=[],this.iUndoRedoPosition=0},d.prototype.isUndoAvailable=function(){return this.iUndoRedoPosition>0},d.prototype.clearRedo=function(){this.aEditableAreaHtml=this.aEditableAreaHtml.slice(0,this.iUndoRedoPosition+1)},d.prototype.editableSave=function(){var e=this.$editableArea.html(),t=i.last(this.aEditableAreaHtml);e!==(t?t[0]:"")&&(this.clearRedo(),this.aEditableAreaHtml.push([e,this.getCaretPos(this.$editableArea[0])]),this.iUndoRedoPosition=this.aEditableAreaHtml.length-1,this.oOptions.onChange())},d.prototype.editableUndo=function(){var e=this.$editableArea.html(),t=this.aEditableAreaHtml[this.iUndoRedoPosition];e!==(t?t[0]:"")&&this.editableSave(),this.iUndoRedoPosition>0&&(this.iUndoRedoPosition--,this.$editableArea.html(this.aEditableAreaHtml[this.iUndoRedoPosition]),this.setCaretPos(this.$editableArea[0],this.aEditableAreaHtml[this.iUndoRedoPosition][1]))},d.prototype.editableRedo=function(){this.iUndoRedoPosition<this.aEditableAreaHtml.length-1&&(this.iUndoRedoPosition++,this.$editableArea.html(this.aEditableAreaHtml[this.iUndoRedoPosition]),this.setCaretPos(this.$editableArea[0],this.aEditableAreaHtml[this.iUndoRedoPosition]?this.aEditableAreaHtml[this.iUndoRedoPosition][1]:{}))},d.prototype.getCaretPos=function(e){var t=null,s={},i={},o=0,n={};return window.getSelection&&document.createRange?(t=window.getSelection()).rangeCount>0&&((i=(s=t.getRangeAt(0)).cloneRange()).selectNodeContents(e),i.setEnd(s.startContainer,s.startOffset),n={start:o=i.toString().length,end:o+s.toString().length}):document.selection&&document.body.createTextRange&&(s=document.selection.createRange(),(i=document.body.createTextRange()).moveToElementText(e),"function"==typeof i.setEndPoint&&i.setEndPoint("EndToStart",s),n={start:o=i.text.length,end:o+s.text.length}),n},d.prototype.setCaretPos=function(e,t){if(window.getSelection&&document.createRange){var s=[e],i={},o={},n=!1,r=!1,a=0,l=0,h=0,d=document.createRange();for(d.setStart(e,0),d.collapse(!0),i=s.pop();!r&&i;){if(3===i.nodeType)l=a+i.length,!n&&t.start>=a&&t.start<=l&&(d.setStart(i,t.start-a),n=!0),n&&t.end>=a&&t.end<=l&&(d.setEnd(i,t.end-a),r=!0),a=l;else for(h=i.childNodes.length;h--;)s.push(i.childNodes[h]);i=s.pop()}(o=window.getSelection()).removeAllRanges(),o.addRange(d)}else if(document.selection&&document.body.createTextRange){var c=document.body.createTextRange();c.moveToElementText(e),c.collapse(!0),c.moveEnd("character",t.end),c.moveStart("character",t.start),c.select()}},d.prototype.setTabIndex=function(e){e&&this.$editableArea.attr("tabindex",e)},d.prototype.initContentEditable=function(){this.$editableArea.bind({mousemove:i.bind(this.storeSelectionPosition,this),mouseup:i.bind(this.onCursorMove,this),keydown:i.bind(this.onButtonPressed,this),keyup:i.bind(this.onCursorMove,this),click:i.bind(this.onClickWith,this),focus:this.oOptions.onFocus,blur:this.oOptions.onBlur}),window.File&&window.FileReader&&window.FileList&&this.oOptions.enableDrop&&this.$editableArea.bind({dragover:i.bind(this.onDragOver,this),dragleave:i.bind(this.onDragLeave,this),drop:i.bind(this.onFileSelect,this)});var e=this,t=i.debounce(function(){e.oCurrLink=null,e.bInUrl=!1,e.oOptions.onUrlOut()},300);o("html, body").on("scroll",t)},d.prototype.onCursorMove=function(e){var t=-1;window.event?t=window.event.keyCode:e&&(t=e.which),13===t&&this.breakQuotes(e),17===t&&this.$editableArea.find("a").css("cursor","inherit"),8===t&&this.uniteWithNextQuote(e),46===t&&r.chrome&&this.uniteWithPrevQuote(e),this.storeSelectionPosition(),this.oOptions.onCursorMove()},d.prototype.onClickWith=function(e){e.ctrlKey&&"A"===e.target.nodeName&&window.open(e.target.href,"_blank"),this.checkAnchorNode()},d.prototype.onButtonPressed=function(e){var t=-1;window.event?t=window.event.keyCode:e&&(t=e.which),17===t&&this.$editableArea.find("a").css("cursor","pointer")},d.prototype.onFileSelect=function(e){if(e=(e&&e.originalEvent?e.originalEvent:e)||window.event){e.stopPropagation(),e.preventDefault();var t=null,s=null,i=e.files||(e.dataTransfer?e.dataTransfer.files:null),o=this;i&&1===i.length&&this.checkIsImage(i[0])&&(s=i[0],(t=new window.FileReader).onload=function(e){o.insertImage(e.target.result)},t.readAsDataURL(s))}},d.prototype.onDragLeave=function(){this.$editableArea.removeClass("editorDragOver")},d.prototype.onDragOver=function(e){e.stopPropagation(),e.preventDefault(),this.$editableArea.addClass("editorDragOver")},d.prototype.pasteImage=function(e){var t=e.clipboardData&&e.clipboardData.items,s=this,o=!1;return window.File&&window.FileReader&&window.FileList&&t&&i.each(t,function(e){if(s.checkIsImage(e)&&e.getAsFile){var t=null,i=e.getAsFile();i&&((t=new window.FileReader).onload=function(e){s.insertImage(e.target.result)},t.readAsDataURL(i),o=!0)}}),o},d.prototype.checkIsImage=function(e){return e&&e.type&&0===e.type.indexOf("image/")},d.prototype.setPlainText=function(e){"string"!=typeof e&&(e=""),this.$editableArea&&(this.editableSave(),this.$editableArea.empty().text(e).css("white-space","pre"),this.editableSave())},d.prototype.setText=function(e){if("string"!=typeof e&&(e=""),this.$editableArea){0===e.length&&(e="<br />");var t=this.prepareHtmlWithoutWrappers(e);this.$editableArea.empty().append(t).css("white-space","normal"),this.clearUndoRedo(),this.editableSave()}},d.prototype.prepareHtmlWithoutWrappers=function(e){for(var t=o(e),s=!1;1===t.length&&("html"===t.data("x-div-type")||"body"===t.data("x-div-type"));)t=t.children(),s=!0;if(1===t.length&&"font-wrapper"===t.data("crea"))return this.setBasicStyles(t.css("font-family"),t.css("font-size"),t.css("direction")),t.html();if(this.setBasicStyles(this.oOptions.defaultFontName,this.convertFontSizeToPixels(this.oOptions.defaultFontSize),this.oOptions.isRtl?"rtl":"ltr"),s){var i="";return t.each(function(e,t){i+=t.outerHTML}),i}return e},d.prototype.setBasicStyles=function(e,t,s){this.sBasicFontName=e,this.sBasicFontSize=t,this.sBasicDirection=s,this.$editableArea.css({"font-family":this.getFontNameWithFamily(this.sBasicFontName),"font-size":this.sBasicFontSize,direction:this.sBasicDirection})},d.prototype.getPlainText=function(){var e="";return this.$editableArea&&(e=this.$editableArea.html().replace(/([^>]{1})<div>/gi,"$1\n").replace(/<style[^>]*>[^<]*<\/style>/gi,"\n").replace(/<br *\/{0,1}>/gi,"\n").replace(/<\/p>/gi,"\n").replace(/<\/div>/gi,"\n").replace(/<a [^>]*href="([^"]*?)"[^>]*>(.*?)<\/a>/gi,"$2 ($1)").replace(/<[^>]*>/g,"").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"')),e},d.prototype.getText=function(e){var t="";return this.$editableArea&&this.$editableArea.length>0&&(e&&this.$editableArea.find('div[data-anchor="signature"]').removeAttr("data-anchor"),t=this.$editableArea.html(),t='<div data-crea="font-wrapper" style="font-family: '+this.getFontNameWithFamily(this.sBasicFontName)+"; font-size: "+this.sBasicFontSize+"; direction: "+this.sBasicDirection+'">'+t+"</div>"),t},d.prototype.changeSignatureContent=function(e,t){var s,i,n,r,a,l,h,d=this.$editableArea.find('div[data-anchor="signature"]'),c=o(e).closest('div[data-crea="font-wrapper"]'),u=o(t).closest('div[data-crea="font-wrapper"]');if(d.length>0)n=d.html(),""===t?d.html(n+e):-1!==n.indexOf(t)?d.html(n.replace(t,e)):-1!==n.indexOf(e)||(s=0===c.length||0===u.length?t:u.html(),i=0===c.length||0===u.length?e:c.html(),-1!==n.indexOf(s)?d.html(n.replace(s,e)):-1!==n.indexOf(i)||d.html(n+e));else{l=t;try{r=this.$editableArea.find('*:contains("'+l+'")')}catch(e){r=o("")}if(0===r.length&&u.length>0){l=u.html();try{r=this.$editableArea.find('*:contains("'+l+'")')}catch(e){r=o("")}}r.length>0&&(a=(r=o(r[0])).closest("blockquote")),a&&0===a.length?r.html(r.html().replace(l,e)):(h=(d=this.$editableArea.find('div[data-anchor="reply-title"]')).length>0?o(d[0]).closest("blockquote"):d,(0===d.length||h.length>0)&&(d=this.$editableArea.find("blockquote")),d.length>0?o(d[0]).before(o('<br /><div data-anchor="signature">'+e+"</div><br />")):this.$editableArea.append(o('<br /><div data-anchor="signature">'+e+"</div><br />")))}this.editableSave()},d.prototype.isFocused=function(){return this.bFocused},d.prototype.setFocus=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,s=this.$editableArea.contents();if(this.$editableArea.focus(),e&&i.isArray(this.aRanges)&&this.aRanges.length>0)this.restoreSelectionPosition(t);else if(s.length>0){var n=null;3===s[0].nodeType?n=o(s[0]):(n=o(document.createTextNode("")),o(s[0]).before(n));var r=n.text();this.setCursorPosition(n[0],r.length)}},d.prototype.setBlur=function(){this.$editableArea.blur()},d.prototype.setEditable=function(e){e?this.enableContentEditable():this.disableContentEditable()},d.prototype.disableContentEditable=function(){this.bEditable=!1,this.$editableArea.prop("contentEditable","false")},d.prototype.enableContentEditable=function(){this.$editableArea.prop("contentEditable","true"),setTimeout(i.bind(function(){this.bEditable=!0},this),0)},d.prototype.fixFirefoxCursorBug=function(){r.firefox&&(this.disableContentEditable(),setTimeout(i.bind(function(){this.enableContentEditable()},this),0))},d.prototype.setRtlDirection=function(){this.setBasicStyles(this.sBasicFontName,this.sBasicFontSize,"rtl")},d.prototype.setLtrDirection=function(){this.setBasicStyles(this.sBasicFontName,this.sBasicFontSize,"ltr")},d.prototype.pasteHtmlAtCaret=function(e){var t,s;if(window.getSelection){if((t=window.getSelection()).getRangeAt&&t.rangeCount){(s=t.getRangeAt(0)).deleteContents();var i=document.createElement("div");i.innerHTML=e;for(var o,n,r=document.createDocumentFragment();o=i.firstChild;)n=r.appendChild(o);s.insertNode(r),n&&((s=s.cloneRange()).setStartAfter(n),s.collapse(!0),t.removeAllRanges(),t.addRange(s))}}else document.selection&&"Control"!==document.selection.type&&(s=document.selection.createRange())&&s.pasteHTML&&s.pasteHTML(e)},d.prototype.execCom=function(e,t,s){var i,o=!1;return this.bEditable&&(this.editableSave(),r.opera&&this.restoreSelectionPosition(),"insertHTML"===e&&r.ie?this.pasteHtmlAtCaret(t):o=void 0===t?window.document.execCommand(e):window.document.execCommand(e,!1,t),r.chrome&&(this.storeSelectionPosition(),"insertHTML"===e&&this.aRanges.length>0&&((i=this.aRanges[0]).setEnd(i.startContainer,i.startOffset),this.restoreSelectionPosition())),s||this.editableSave()),o},d.prototype.insertHtml=function(e,t){this.execCom("insertHTML",e,t)},d.prototype.changeImageSource=function(e,t){this.$editableArea.find('img[id="'+e+'"]').attr("src",t),this.editableSave()},d.prototype.insertEmailLink=function(e){this.restoreSelectionPosition(),""===this.getSelectedText()?this.execCom("insertHTML",'<a href="mailto:'+e+'">'+e+"</a>"):this.insertLink("mailto:"+e)},d.prototype.insertLink=function(e){var t=this.normaliseURL(e);this.isFocused()?this.restoreSelectionPosition(t):this.setFocus(!0,t),this.execCom("createlink",t)},d.prototype.removeLink=function(){var e=r.ie8AndBelow?"Unlink":"unlink";this.execCom(e)},d.prototype.insertImage=function(e){var t=r.ie8AndBelow?"InsertImage":"insertimage";return this.isFocused()?this.restoreSelectionPosition():this.setFocus(!0),this.execCom(t,e)},d.prototype.numbering=function(){this.execCom("InsertOrderedList")},d.prototype.bullets=function(){this.execCom("InsertUnorderedList")},d.prototype.insertHorizontalLine=function(){this.isFocused()?this.restoreSelectionPosition():this.setFocus(!0),this.execCom("InsertHorizontalRule")},d.prototype.getFontNameWithFamily=function(e){var t="";switch(e){case"Arial":case"Arial Black":case"Tahoma":case"Verdana":t=", sans-serif";break;case"Courier New":t=", monospace";break;case"Times New Roman":t=", serif"}return e+t},d.prototype.fontName=function(e){var t=!this.aRanges;this.setFocus(!0),this.execCom("FontName",this.getFontNameWithFamily(e)),t&&this.setBasicStyles(e,this.sBasicFontSize,this.sBasicDirection)},d.prototype.fontSize=function(e){var t=!this.aRanges;this.setFocus(!0),this.execCom("FontSize",e),t&&this.setBasicStyles(this.sBasicFontName,this.convertFontSizeToPixels(e),this.sBasicDirection)},d.prototype.bold=function(){this.execCom("Bold"),this.$editableArea.focus()},d.prototype.italic=function(){this.execCom("Italic"),this.$editableArea.focus()},d.prototype.underline=function(){this.execCom("Underline"),this.$editableArea.focus()},d.prototype.strikeThrough=function(){this.execCom("StrikeThrough"),this.$editableArea.focus()},d.prototype.undo=function(){this.editableUndo()},d.prototype.redo=function(){this.editableRedo()},d.prototype.alignLeft=function(){this.execCom("JustifyLeft")},d.prototype.center=function(){this.execCom("JustifyCenter")},d.prototype.alignRight=function(){this.execCom("JustifyRight")},d.prototype.justify=function(){this.execCom("JustifyFull")},d.prototype.textColor=function(e){this.execCom("ForeColor",e),this.$editableArea.focus()},d.prototype.backgroundColor=function(e){var t=r.ie?"BackColor":"hilitecolor";this.execCom(t,e),this.$editableArea.focus()},d.prototype.blockquote=function(e){this.execCom("formatBlock","<blockquote>"),this.$editableArea.focus()},d.prototype.removeFormat=function(){this.execCom("removeformat"),this.$editableArea.focus()},d.prototype.getFontName=function(){if(this.bEditable){var e=window.document.queryCommandValue("FontName"),t=this.sBasicFontName,s="";"string"==typeof e&&(e=e.replace(/'/g,""),o.each(this.oOptions.fontNameArray,function(t,i){(e.indexOf(i)>-1||e.indexOf(i.toLowerCase())>-1)&&(s=i)}),""!==s&&(t=s))}return t},d.prototype.getIsBold=function(){if(this.bEditable)var e=window.document.queryCommandState("bold");return e},d.prototype.getIsItalic=function(){if(this.bEditable)var e=window.document.queryCommandState("italic");return e},d.prototype.getIsUnderline=function(){if(this.bEditable)var e=window.document.queryCommandState("underline");return e},d.prototype.getIsEnumeration=function(){if(this.bEditable)var e=window.document.queryCommandState("insertOrderedList");return e},d.prototype.getIsBullets=function(){if(this.bEditable)var e=window.document.queryCommandState("insertUnorderedList");return e},d.prototype.getIsStrikeThrough=function(){if(this.bEditable)var e=window.document.queryCommandState("StrikeThrough");return e},d.prototype.convertFontSizeToPixels=function(e){var t=0;return o.each(this.aSizes,function(s,i){0===t&&e<=i.inNumber&&(t=i.inPixels)}),t+"px"},d.prototype.convertFontSizeToNumber=function(e){var t=l.pInt(e),s=0;return t>0&&o.each(this.aSizes,function(e,i){0===s&&t<=i.inPixels&&(s=i.inNumber)}),s},d.prototype.getFontSizeInNumber=function(){var e="",t=0;return this.bEditable&&(e=window.document.queryCommandValue("FontSize"),t=l.pInt(e)),(isNaN(t)||t<=0)&&(t=this.convertFontSizeToNumber(this.sBasicFontSize)),t},d.prototype.changeLink=function(e){var t=this.normaliseURL(e),s=o(this.oCurrLink);this.oCurrLink&&(s.attr("href")===s.text()&&s.text(t),"A"===this.oCurrLink.tagName?s.attr("href",t):s.parent().attr("href",t),this.oCurrLink=null,this.bInUrl=!1)},d.prototype.removeCurrentLink=function(){if(this.oCurrLink&&document.createRange&&window.getSelection){var e=document.createRange(),t=window.getSelection();e.selectNodeContents(this.oCurrLink),t.removeAllRanges(),t.addRange(e),this.removeLink(),this.oCurrLink=null,this.bInUrl=!1,this.oOptions.onUrlOut()}},d.prototype.removeCurrentImage=function(){this.oCurrImage&&(this.oCurrImage.remove(),this.oCurrImage=null,this.bInImage=!1,this.oOptions.onImageBlur()),this.setFocus(!0)},d.prototype.changeCurrentImage=function(e){if(this.oCurrImage&&void 0!==e){var t=this.oCurrImage;o.each(e,function(e,s){t.css(e,s)})}this.setFocus(!0)},d.prototype.showImageTooltip=function(e){if(this.oCurrImage&&void 0!==e){var t=this.oCurrImage;o.each(e,function(e,s){t.css(e,s)})}},d.prototype.normaliseURL=function(e){return-1!==e.search(/^https?:\/\/|^mailto:|^tel:/g)?e:"http://"+e},d.prototype.getSelectedText=function(){var e="",t=null;return window.getSelection&&(t=window.getSelection()).rangeCount>0&&(e=t.getRangeAt(0).toString()),e},d.prototype.storeSelectionPosition=function(){var e=a.getSelectionRanges();i.isArray(e)&&e.length>0&&this.$editableArea[0].contains(e[0].commonAncestorContainer)&&(this.aRanges=[e[0]])},d.prototype.editableIsActive=function(){return!(!o(document.activeElement).hasClass("crea-content-editable")&&!o(document.activeElement).children().first().hasClass("crea-content-editable"))},d.prototype.checkAnchorNode=function(){if(window.getSelection&&this.editableIsActive()){var e=window.getSelection(),t=null;e.anchorNode&&(e.anchorNode.parentElement||e.anchorNode.parentNode)&&(("A"===(t=e.anchorNode.parentElement||e.anchorNode.parentNode).parentNode.tagName||"A"===t.parentElement.tagName)&&(t=t.parentNode),"A"===t.tagName?this.bInUrl&&t===this.oCurrLink?this.bInUrl&&t===this.oCurrLink&&(this.oCurrLink=null,this.bInUrl=!1,this.oOptions.onUrlOut()):(this.oCurrLink=t,this.bInUrl=!0,this.oOptions.onUrlIn(o(t))):this.bInUrl&&(this.oCurrLink=null,this.bInUrl=!1,this.oOptions.onUrlOut()))}},d.prototype.restoreSelectionPosition=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=a.setSelectionRanges(this.aRanges);if(window.getSelection&&i.isArray(this.aRanges)&&r.firefox&&""===t&&""!==e)if(window.getSelection&&window.getSelection().getRangeAt){var s=window.getSelection();if(s.getRangeAt&&s.rangeCount>0){var o=s.getRangeAt(0),n=o.createContextualFragment(e);o.insertNode(n)}}else document.selection&&document.selection.createRange&&document.selection.createRange().pasteHTML(e)},d.prototype.uniteWithNextQuote=function(){var e=window.getSelection?window.getSelection():null,t=e?e.focusNode:null,s=t?this.getLastBlockQuote(t):null,i=s?o(s).next():null,n=i&&i.length>0&&"BLOCKQUOTE"===i[0].tagName?i[0]:null,r=[],a=0,l=0,h=null;if(s&&n){for(o("<br />").appendTo(s),l=(r=o(n).contents()).length,a=0;a<l;a++)h=r[a],o(h).appendTo(s);o(n).remove()}},d.prototype.uniteWithPrevQuote=function(){var e=window.getSelection?window.getSelection():null,t=e?e.focusNode:null,s=t?this.getLastBlockQuote(t):null;this.getPrevAndUnite(s),this.getPrevAndUnite(s)},d.prototype.getPrevAndUnite=function(e){var t=e?o(e).prev():null,s=t&&t.length>0&&"BLOCKQUOTE"===t[0].tagName?t[0]:null,i=[],n=0,r=null;if(e&&s){for(o("<br />").prependTo(e),n=(i=o(s).contents()).length-1;n>0;n--)r=i[n],o(r).prependTo(e);o(s).remove()}},d.prototype.getLastBlockQuote=function(e){for(var t=e,s=null;t&&t.parentNode;)"BLOCKQUOTE"===t.tagName&&(s=t),t=t.parentNode;return s},d.prototype.breakQuotes=function(e){var t=window.getSelection?window.getSelection():null,s=t?t.focusNode:null,i=s?this.getLastBlockQuote(s):null;s&&i&&this.breakBlocks(s,i,t.focusOffset)},d.prototype.setCursorPosition=function(e,t){if(document.createRange&&window.getSelection){var s=document.createRange(),i=window.getSelection();i.removeAllRanges(),s.setStart(e,t),s.setEnd(e,t),s.collapse(!0),i.addRange(s),this.aRanges=[s]}},d.prototype.cloneNode=function(e){var t=null,s="";try{t=o(e).clone()}catch(i){s=e.tagName,t=o("<"+s+"></"+s+">")}return t},d.prototype.breakBlocks=function(e,t,s){for(var i=e,n=null,r=[],a=0,l=0,h=null,d=!0,c=null,u=null,p=null,m=null,g=!0,f=null;g&&i.parentNode;){for(p=c,m=u,c=this.cloneNode(i).empty(),u=this.cloneNode(i).empty(),l=(r=o(i).contents()).length,d=!0,null===n&&(n=r[s]),0===l&&(c=null),a=0;a<l;a++)(h=r[a])===n?(null===p?a===s&&"BR"===h.tagName||o(h).appendTo(u):(p.html().length>0&&p.appendTo(c),m.appendTo(u)),d=!1):d?o(h).appendTo(c):o(h).appendTo(u);t===i&&(g=!1),n=i,i=i.parentNode}null!==c&&null!==u&&(c.insertBefore(o(t)),f=o("<span> </span>").insertBefore(o(t)),o("<br>").insertBefore(o(t)),u.insertBefore(o(t)),o(t).remove(),this.setCursorPosition(f[0],0))},e.exports=d},yHWv:(e,t,s)=>{var i=s("M4cL"),o=s("a7T2"),n=s("LKDt"),r=s("ERH9"),a=s("Z9uT"),l=s("yU9o"),h=s("ioSH"),d=s("D2Gh"),c=s("jqos"),u=s("lZd5"),p=s("wXcN"),m=s("Fj7m"),g=s("P7bQ"),f=s("eGl8"),b=s("Ua3z"),y=l.isNewTab()&&window.opener&&window.opener.MainTabMailMethods,A={sReplyText:"",sReplyDraftUid:"",oPostponedMailData:null};function v(e){return"".concat(e.AccountID,":").concat(e.DraftFolder,":").concat(e.DraftUid)}function F(e,t,s,i){var o=n.i18n("MAILWEBCLIENT/TEXT_REPLY_MESSAGE",{DATE:e.oDateModel.getDate(),TIME:e.oDateModel.getTime(),SENDER:n.encodeHtml(e.oFrom.getFull())});return"<br /><br />"+this.getSignatureText(t,s,i)+'<br /><br /><div data-anchor="reply-title">'+o+"</div><blockquote>"+e.getConvertedHtml()+"</blockquote>"}A.setReplyData=function(e,t){this.sReplyText=e,this.sReplyDraftUid=t},A.send=function(e,t,s,i,o,a,l){l="boolean"!=typeof l||l;var c=t.AccountID,u=m.getAccount(c),p=f.oFolderListItems[c],b="",A=p?p.sentFolderFullName():"",F=p?p.draftsFolderFullName():"",I=u?u.email():"",C=t.To.indexOf(I)>-1||t.Cc.indexOf(I)>-1||t.Bcc.indexOf(I)>-1;switch(u.bSaveRepliesToCurrFolder&&!C&&r.isNonEmptyArray(t.DraftInfo,3)&&(A=t.DraftInfo[2]),t.Method=e,t.ShowReport=s,e){case"SendMessage":b=n.i18n("COREWEBCLIENT/INFO_SENDING"),l?(r.isNonEmptyString(t.SentFolder)||(t.SentFolder=A),""!==t.DraftUid&&(t.DraftFolder=F,y?(y.removeOneMessageFromCacheForFolder(t.AccountID,t.DraftFolder,t.DraftUid),y.replaceHashWithoutMessageUid(v(t))):(f.removeOneMessageFromCacheForFolder(t.AccountID,t.DraftFolder,t.DraftUid),h.replaceHashWithoutMessageUid(v(t))))):(delete t.SentFolder,delete t.DraftUid,delete t.DraftFolder);break;case"SaveMessage":b=n.i18n("MAILWEBCLIENT/INFO_SAVING"),void 0===t.DraftFolder&&(t.DraftFolder=F),f.savingDraftUid(t.DraftUid),y?(y.startMessagesLoadingWhenDraftSaving(t.AccountID,t.DraftFolder),y.replaceHashWithoutMessageUid(v(t))):(f.startMessagesLoadingWhenDraftSaving(t.AccountID,t.DraftFolder),h.replaceHashWithoutMessageUid(v(t)))}s&&d.showLoading(b),a?this.postponedMailData={Parameters:t,SendMessageResponseHandler:i,SendMessageResponseContext:o}:g.send(e,t,i,o)},A.sendPostponedMail=function(e){var t=this.postponedMailData,s=t.Parameters,i=s.AccountID,o=f.oFolderListItems[i],n=o?o.draftsFolderFullName():"";""!==e&&(s.DraftUid=e,s.DraftFolder=n,y?(y.removeOneMessageFromCacheForFolder(s.AccountID,s.DraftFolder,s.DraftUid),y.replaceHashWithoutMessageUid(v(s))):(f.removeOneMessageFromCacheForFolder(s.AccountID,s.DraftFolder,s.DraftUid),h.replaceHashWithoutMessageUid(v(s)))),this.postponedMailData&&(g.send(s.Method,s,t.SendMessageResponseHandler,t.SendMessageResponseContext),this.postponedMailData=null)},A.sendReplyMessage=function(e,t,s,i,o,n){var r=null,a=f.currentMessage(),l=[],h=null;a&&(l=a.oTo.aCollection.concat(a.oCc.aCollection),h=this.getFirstFetcherOrIdentityByRecipientsOrDefault(l,a.accountId()),(r=this.getReplyDataFromMessage(a,Enums.ReplyType.ReplyAll,a.accountId(),h,!1,t,s)).AccountID=a.accountId(),h&&(r.IdentityID=h&&h.IDENTITY?h.id():"",r.AliasID=h&&h.ALIAS?h.id():"",r.FetcherID=h&&h.FETCHER?h.id():""),r.Bcc="",r.Importance=Enums.Importance.Normal,r.SendReadingConfirmation=!1,r.IsQuickReply=!0,r.IsHtml=!0,r.Attachments=this.convertAttachmentsForSending(r.Attachments),this.send(e,r,!1,i,o,n))},A.convertAttachmentsForSending=function(e){var t={};return o.each(e,function(e){t[e.tempName()]=[e.fileName(),e.linked()?e.cid():"",e.inline()?"1":"0",e.linked()?"1":"0",e.contentLocation()]}),t},A.onSendOrSaveMessageResponse=function(e,t,s){var r,l,h,c=t.Parameters,u=!!e.Result;switch(s||d.hideLoading(),t.Method){case"SaveMessage":f.savingDraftUid(""),u?(c.ShowReport&&!s&&(-1!==i.inArray(t.Parameters.DraftFolder,f.getCurrentTemplateFolders())?d.showReport(n.i18n("MAILWEBCLIENT/REPORT_TEMPLATE_SAVED")):d.showReport(n.i18n("MAILWEBCLIENT/REPORT_MESSAGE_SAVED"))),e.Result.NewUid||(b.AllowAutosaveInDrafts=!1)):c.ShowReport&&(-1!==i.inArray(t.Parameters.DraftFolder,f.getCurrentTemplateFolders())?a.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_TEMPLATE_SAVING"),!0):a.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_MESSAGE_SAVING"),!0));break;case"SendMessage":u?(c.IsQuickReply?d.showReport(n.i18n("MAILWEBCLIENT/REPORT_MESSAGE_SENT")):y?y.showReport(n.i18n("MAILWEBCLIENT/REPORT_MESSAGE_SENT")):d.showReport(n.i18n("MAILWEBCLIENT/REPORT_MESSAGE_SENT")),o.isArray(c.DraftInfo)&&3===c.DraftInfo.length&&(h=c.DraftInfo[0],l=c.DraftInfo[1],r=c.DraftInfo[2],f.markMessageReplied(c.AccountID,r,l,h))):a.showErrorByCode(e,n.i18n("MAILWEBCLIENT/ERROR_MESSAGE_SENDING"),!0),c.SentFolder&&(y?y.removeMessagesFromCacheForFolder(c.AccountID,c.SentFolder):f.removeMessagesFromCacheForFolder(c.AccountID,c.SentFolder))}return c.DraftFolder&&!s&&(y?y.removeMessagesFromCacheForFolder(c.AccountID,c.DraftFolder):f.removeMessagesFromCacheForFolder(c.AccountID,c.DraftFolder)),{Method:t.Method,Result:u,NewUid:e.Result?e.Result.NewUid:""}},A.getReplytoAddresses=function(e){var t=e.oReplyTo;return(""===t.getFull()||e.oFrom.getFirstEmail()===t.getFirstEmail()&&""===t.getFirstName())&&(t=e.oFrom),t},A.getReplyDataFromMessage=function(e,t,s,i,n,r,a){var l={DraftInfo:[],DraftUid:"",To:"",Cc:"",Bcc:"",Subject:"",Attachments:[],InReplyTo:e.messageId(),References:this.getReplyReferences(e)},h=[],d=this.getReplytoAddresses(e).getFull();switch(r&&""!==r||(r=this.sReplyText,this.sReplyText=""),"forward"===t?l.Text=r+this.getForwardMessageBody(e,s,i):"resend"===t?(l.Text=e.getConvertedHtml(),l.Cc=e.cc(),l.Bcc=e.bcc()):l.Text=r+F.call(this,e,s,i,n),a?l.DraftUid=a:(l.DraftUid=this.sReplyDraftUid,this.sReplyDraftUid=""),t){case Enums.ReplyType.Reply:l.DraftInfo=[Enums.ReplyType.Reply,e.uid(),e.folder()],l.To=d,l.Subject=this.getReplySubject(e.subject(),!0),h=o.filter(e.attachments(),function(e){return e.linked()});break;case Enums.ReplyType.ReplyAll:l.DraftInfo=[Enums.ReplyType.ReplyAll,e.uid(),e.folder()],l.To=d,l.Cc=this.getReplyAllCcAddr(e,s,i),l.Subject=this.getReplySubject(e.subject(),!0),h=o.filter(e.attachments(),function(e){return e.linked()});break;case Enums.ReplyType.Resend:l.DraftInfo=[Enums.ReplyType.Resend,e.uid(),e.folder(),e.cc(),e.bcc()],l.To=e.oTo.getFull(),l.Subject=e.subject(),h=e.attachments();break;case Enums.ReplyType.ForwardAsAttach:case Enums.ReplyType.Forward:l.DraftInfo=[Enums.ReplyType.Forward,e.uid(),e.folder()],l.Subject=this.getReplySubject(e.subject(),!1),h=e.attachments()}return o.each(h,function(e){if(e.getCopy){var t=e.getCopy();l.Attachments.push(t)}}),l},A.getReplyReferences=function(e){var t=e.references(),s=e.messageId();return-1===t.indexOf(s)&&(t+=" "+s),t},A.getClearSignature=function(e,t){var s=m.getAccount(e),i="";return t&&t.accountId()===e?t.useSignature()&&(i=t.signature()):s&&s.useSignature()&&(i=s.signature()),i},A.getSignatureText=function(e,t,s){var i=this.getClearSignature(e,t);return s?'<div data-anchor="signature">'+i+"</div>":"<div>"+i+"</div>"},A.getFirstFetcherOrIdentityByRecipientsOrDefault=function(e,t){var s=m.getAccount(t),i=this.getAccountFetchersIdentitiesList(s),n=[],r=null;return o.each(e,function(e){if(!r)switch((n=o.filter(i,function(t){return e.sEmail===t.email})).length){case 0:break;case 1:r=n[0];break;default:(r=o.find(n,function(t){return e.sEmail===t.email&&e.sName===t.name}))||(r=o.find(n,function(e){return e.isDefault}))||(r=n[0])}}),r||(r=o.find(i,function(e){return e.isDefault})),r&&r.result},A.getAccountFetchersIdentitiesList=function(e){var t=[];return e&&(o.each(e.fetchers(),function(e){t.push({email:e.email(),name:e.userName(),isDefault:!1,result:e})}),o.each(e.identities(),function(e){t.push({email:e.email(),name:e.friendlyName(),isDefault:e.isDefault(),result:e})}),o.each(e.aliases(),function(e){t.push({email:e.email(),name:e.friendlyName(),isDefault:!1,result:e})})),t},A.getForwardMessageBody=function(e,t,s){var i=n.encodeHtml(e.oCc.getFull()),o=""!==i?n.i18n("MAILWEBCLIENT/TEXT_FORWARD_MESSAGE_CCPART",{CCADDR:i}):"",r=n.i18n("MAILWEBCLIENT/TEXT_FORWARD_MESSAGE",{FROMADDR:n.encodeHtml(e.oFrom.getFull()),TOADDR:n.encodeHtml(e.oTo.getFull()),CCPART:o,FULLDATE:e.oDateModel.getFullDate(),SUBJECT:n.encodeHtml(e.subject())});return"<br /><br />"+this.getSignatureText(t,s,!0)+'<br /><br /><div data-anchor="reply-title">'+r+"</div><br /><br />"+e.getConvertedHtml()},A.hasReplyAllCcAddrs=function(e){var t=e.accountId(),s=e.oTo.aCollection.concat(e.oCc.aCollection),i=this.getFirstFetcherOrIdentityByRecipientsOrDefault(s,e.accountId());return""!==this.getReplyAllCcAddr(e,t,i)},A.getReplyAllCcAddr=function(e,t,s){var i=new u,n=o.union(e.oTo.aCollection,e.oCc.aCollection,e.oBcc.aCollection),r=o.find(m.collection(),function(e){return e.id()===t},this),a=new c,l=new c,h=this.getReplytoAddresses(e);return a.sEmail=r.email(),l.sEmail=s?s.email():"",i.addCollection(n),i.excludeCollection(o.union(h.aCollection,[a,l])),i.getFull()},A.getReplySubject=function(e,t){var s=n.i18n("MAILWEBCLIENT/TEXT_REPLY_PREFIX"),i=n.i18n("MAILWEBCLIENT/TEXT_FORWARD_PREFIX"),o=(t?s:i)+": "+e;return b.JoinReplyPrefixes&&(o=p.joinReplyPrefixesInSubject(o,s,i)),o},A.getHtmlFromText=function(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/\r/g,"").replace(/\n/g,"<br />")},e.exports=A}}]);