1"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["app/email-address/form-ajax"],{3197(e,t,n){n.r(t),n.d(t,{default:()=>a});var i=n(95);class o extends i.FormAjax{_initConfiguration(e){super._initConfiguration({waitButtonTitle:i.Locale.getSection("components.buttons").lmsg("wait"),...e})}_initComponentElement(){super._initComponentElement(),this._domainsConfiguration=this._getConfigParam("domainsConfiguration",[]),this._isUnix=this._getConfigParam("isUnix",!0),this._attachmentsCount=this.getAttachments().length,this.isAttachmentsSupported=!0}updateRedirectControlsState(){const e=document.getElementById("general-generalSection-postbox"),t=e&&"none"!==e.closest(".form-row")?.style.display?e.checked:"true"===document.getElementById("general-generalSection-reason")?.dataset.value,n=document.getElementById("redirect-redirectSection-enabled").checked;this.enableControl(document.getElementById("redirect-redirectSection-remove"),n&&t),this.enableControl(document.getElementById("redirect-redirectSection-subscribers"),n)}updateAutoresponderControlsState(){const e=["autoResponder-autoResponderSection-contentType-textplain","autoResponder-autoResponderSection-contentType-texthtml","autoResponder-autoResponderSection-codepage","autoResponder-autoResponderSection-subject","autoResponder-autoResponderSection-message","autoResponder-autoResponderSection-replyTo","autoResponder-autoResponderSection-forwardAddress","autoResponder-autoResponderSection-replyLimit","autoResponder-autoResponderSection-endDateEnabled"];document.getElementById("autoResponder-autoResponderSection-enabled").checked?(e.forEach(e=>{document.getElementById(e)&&(document.getElementById(e).disabled=!1)}),document.getElementById("attachments")&&(document.getElementById("attachments").style.display="")):(e.forEach(e=>{document.getElementById(e)&&(document.getElementById(e).disabled=!0)}),document.getElementById("attachments")&&(document.getElementById("attachments").style.display="none")),this.updateEndDateControlsState()}updateEndDateControlsState(){const e=[document.getElementById("autoResponder-autoResponderSection-endDate-year"),document.getElementById("autoResponder-autoResponderSection-endDate-month"),document.getElementById("autoResponder-autoResponderSection-endDate-day")],t=document.getElementById("autoResponder-autoResponderSection-endDateEnabled");e.filter(e=>e).forEach(e=>{e.disabled=t.disabled||!t.checked})}updateAntivirusControlsState(){document.getElementById("antivirus-antivirusSection-enabled").checked?(document.getElementById("antivirus-antivirusSection-antivirusSettings-incoming")&&(document.getElementById("antivirus-antivirusSection-antivirusSettings-incoming").disabled=!1),document.getElementById("antivirus-antivirusSection-antivirusSettings-outgoing")&&(document.getElementById("antivirus-antivirusSection-antivirusSettings-outgoing").disabled=!1),document.getElementById("antivirus-antivirusSection-antivirusSettings-both")&&(document.getElementById("antivirus-antivirusSection-antivirusSettings-both").disabled=!1)):(document.getElementById("antivirus-antivirusSection-antivirusSettings-incoming")&&(document.getElementById("antivirus-antivirusSection-antivirusSettings-incoming").disabled=!0),document.getElementById("antivirus-antivirusSection-antivirusSettings-outgoing")&&(document.getElementById("antivirus-antivirusSection-antivirusSettings-outgoing").disabled=!0),document.getElementById("antivirus-antivirusSection-antivirusSettings-both")&&(document.getElementById("antivirus-antivirusSection-antivirusSettings-both").disabled=!0))}updateAntispamControlsState(){if(!this._isAntispamManagementAvailable())return void(document.getElementById("tab-antispam-button").style.display="none");document.getElementById("tab-antispam-button").style.display="";const e=document.getElementById("antispam-mainSection-enabled").checked;this.enableControl(document.getElementById("antispam-mainSection-antispamSettings-mark"),e);const t=document.getElementById("antispam-mainSection-antispamSettings-mark").checked;this.enableControl(document.getElementById("antispam-mainSection-subjText"),e&&t),this.enableControl(document.getElementById("antispam-mainSection-reportText"),e&&t),this.enableControl(document.getElementById("antispam-mainSection-antispam
1Settings-delete"),e);const n=this._isUnix&&document.getElementById("redirect-redirectSection-remove")&&document.getElementById("redirect-redirectSection-remove").checked&&document.getElementById("redirect-redirectSection-enabled").checked;this.enableControl(document.getElementById("antispam-mainSection-antispamSettings-move"),e&&!n),this.enableControl(document.getElementById("antispam-advancedSection-filterScore-score"),e),this.enableControl(document.getElementById("antispam-advancedSection-whiteList-list"),e),this.enableControl(document.getElementById("antispam-advancedSection-blackList-list"),e),this.enableControl(document.getElementById("antispam-advancedSection-trustedNetworks-networks"),e)}enableControl(e,t){e&&(e.disabled=!t)}updateDomain(){const{isAttachmentsSupported:e,isAntispamManagmentAllowed:t,isAntivirusManagmentAllowed:n,isPostboxAllowed:i,isOutgoingMessagesLimitSupported:o}=this._domainsConfiguration[document.getElementById("general-generalSection-domain").value];document.getElementById("attachments")&&(this.isAttachmentsSupported=e,this.updateAutoresponderControlsState());const a=document.getElementById("tab-antispam-button");a&&(a.style.display=t&&this._isAntispamManagementAvailable()?"":"none");const d=document.getElementById("tab-antivirus-button");d&&(d.style.display=n?"":"none");const s=document.getElementById("general-generalSection-postbox"),r=document.getElementById("general-generalSection-reason");s&&r&&(s.checked=i,s.closest(".form-row").style.display=i?"":"none",r.closest(".form-row").style.display=i?"none":"");const c=document.getElementById("general-generalSection-mboxOutgoingMessages-default");c&&(c.closest(".form-row").style.display=o?"":"none"),this.updateRedirectControlsState()}getAttachments(){const e=document.getElementById("attachments");return e?[...e.querySelectorAll("div.dynamicSubFormContent input")].filter(({value:e})=>""!==e):[]}disable(){this.getAttachments().forEach(e=>{e.disabled=!0}),super.disable()}enable(){this.getAttachments().forEach(e=>{e.disabled=!1}),super.enable()}_processForm(e){if(e.emailId){const t=this.getAttachments(),n=t.filter(({type:e})=>"file"===e).length,i=this._attachmentsCount-(t.length-n);if(n||i)return void this.processAttachments(super._processForm,e)}super._processForm(e)}processAttachments(e,t){const n=new Element("form",{action:(0,i.prepareUrl)(`/email-address/responder-attachments/id/${t.emailId}`),method:"post",enctype:"multipart/form-data",encoding:"multipart/form-data",style:"display:none"});document.getElementById("forgery_protection_token")&&(0,i.render)(n,new Element("input",{type:"hidden",name:"forgery_protection_token",value:document.getElementById("forgery_protection_token").content})),(0,i.render)(this._componentElement,n,"after"),this.getAttachments().forEach(e=>{e.disabled=!1,e.name="file[]";const t=e.cloneNode();e.style.display="none",(0,i.render)(e,t,"after"),(0,i.render)(n,e)}),n.submit()}_addEvents(){super._addEvents(),document.getElementById("redirect-redirectSection-enabled")&&(this.updateRedirectControlsState(),document.getElementById("redirect-redirectSection-enabled").addEventListener("click",this.updateRedirectControlsState.bind(this))),document.getElementById("autoResponder-autoResponderSection-enabled")&&(this.updateAutoresponderControlsState(),document.getElementById("autoResponder-autoResponderSection-enabled").addEventListener("click",this.updateAutoresponderControlsState.bind(this)),document.getElementById("autoResponder-autoResponderSection-endDateEnabled").addEventListener("click",this.updateEndDateControlsState.bind(this))),document.getElementById("antivirus-antivirusSection-enabled")&&(this.updateAntivirusControlsState(),document.getElementById("antivirus-antivirusSection-enabled").addEventListener("click",this.updateAntivirusControlsState.bind(this))),document.getElementById("antispam-mainSection-enabled")&&(this.updateAntispamControlsState(),document.getElementById("antispam-mainSection-enabled").addEventListener("click",this.updateAntispamControlsState.bind(this)),document.getElementById("antispam-mainSection-antispam
1Settings-mark").addEventListener("click",this.updateAntispamControlsState.bind(this)),document.getElementById("antispam-mainSection-antispamSettings-delete").addEventListener("click",this.updateAntispamControlsState.bind(this)),document.getElementById("antispam-mainSection-antispamSettings-move")&&document.getElementById("antispam-mainSection-antispamSettings-move").addEventListener("click",this.updateAntispamControlsState.bind(this)),document.getElementById("general-generalSection-postbox")&&document.getElementById("general-generalSection-postbox").addEventListener("change",this.updateAntispamControlsState.bind(this)),document.getElementById("redirect-redirectSection-enabled")&&(document.getElementById("redirect-redirectSection-enabled").addEventListener("change",this.updateAntispamControlsState.bind(this)),document.getElementById("redirect-redirectSection-remove").addEventListener("change",this.updateAntispamControlsState.bind(this)))),document.getElementById("general-generalSection-domain")&&(this.updateDomain(),document.getElementById("general-generalSection-domain").addEventListener("change",this.updateDomain.bind(this)))}_isAntispamManagementAvailable(){return!!this._isUnix||!(document.getElementById("general-generalSection-postbox")&&!document.getElementById("general-generalSection-postbox").checked)&&(!(!document.getElementById("redirect-redirectSection-enabled")||document.getElementById("redirect-redirectSection-enabled").checked)||!(document.getElementById("redirect-redirectSection-enabled")&&document.getElementById("redirect-redirectSection-remove")&&document.getElementById("redirect-redirectSection-remove").checked))}}const a=o},3196(e,t,n){n.r(t),n.d(t,{default:()=>o});var i=n(3197);const o=e=>new i.default(e);n.dn(o)}}]); 2//# sourceMappingURL=form-ajax.js.map?29b585c7e579e912ee9e
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.