"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[571],{68062:function(e,t,i){i(55014);var s=i(2226),n=i(14526),a=i(37441),r=i(92883),l=i(9515),o=i(44584),c=i(23584),m=i(59355),d=i(44259),u=i(38358),p=i(35250);function h(e){let{title:t,description:i,htmlFor:s}=e;return(0,p.jsxs)("div",{className:"mailpoet-settings-label",children:[(0,p.jsx)("label",{className:"mailpoet-settings-label-title",htmlFor:s,children:t}),i&&(0,p.jsx)("p",{className:"description",children:i})]})}function x(e){let{children:t}=e;return(0,p.jsx)("div",{className:"mailpoet-settings-inputs",children:t})}var g=i(70079),j=i(69177),b=i(49773),_=i(19613),v=i(34352),f=i.n(v);const y=(e,t,i)=>{if("deactivate"!==e){if("reactivate"===e){const e=f()(j.MailPoet.I18n.t("re-engagementReactivatedNotice"),/\[link\](.*?)\[\/link\]/g,(e=>(0,p.jsx)("a",{href:"?page=mailpoet-newsletters#/re_engagement",rel:"noopener noreferrer",children:e},"reEngagementEmailsTabLink")));i((0,p.jsx)("p",{children:e}),{scroll:!0})}}else t((0,p.jsx)("p",{children:j.MailPoet.I18n.t("re-engagementDisabledNotice")}),{scroll:!0})};function k(){const[e,t]=(0,g.useState)(!1),i=(0,_.v9)("isSaving")(),s=(0,_.v9)("hasErrorFlag")(),a=(0,_.v9)("getSavingError")(),r=(0,_.v9)("hasReEngagementNotice")(),l=(0,_.v9)("getReEngagementAction")(),o=(0,_.BH)("saveSettings"),{notices:c}=(0,g.useContext)(n.k),m=c.error,d=c.success;return(0,g.useEffect)((()=>{e&&!i&&(a?m(a.map((e=>(0,p.jsx)("p",{children:e}))),{scroll:!0}):(d((0,p.jsx)("p",{children:j.MailPoet.I18n.t("settingsSaved")}),{scroll:!0}),r&&y(l,m,d)))}),[e,a,i,m,d,r,l]),(0,p.jsx)("div",{className:"mailpoet-settings-save",children:(0,p.jsx)(b.z,{type:"button",automationId:"settings-submit-button",isDisabled:i||s,onClick:()=>{t(!0),o()},children:j.MailPoet.I18n.t("saveSettings")})})}var w=i(46166);function C(e){const t=e.segmentsSelector?e.segmentsSelector:"getDefaultSegments",i=(0,_.v9)(t)().map((e=>({value:e.id,label:e.name,count:e.subscribers}))),s=i.filter((t=>e.value.includes(t.value)));return(0,p.jsx)(w.ReactSelect,{isMulti:!0,defaultValue:s,id:e.id,placeholder:e.placeholder,options:i,onChange:t=>{e.setValue((t||[]).map((e=>e.value)))}})}var F=i(67902);function S(e){const t=(0,_.v9)("getPages")();let i=t.find((t=>t.id===parseInt(e.value,10)));return i||(i=t[0]),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row mailpoet-settings-inputs-row-centered",children:[(0,p.jsx)(F.Select,{id:e.id,automationId:e.automationId,value:i.id,onChange:(0,o.z2)(e.setValue),isMinWidth:!0,dimension:"small",children:t.map((e=>(0,p.jsx)("option",{value:e.id,children:`${e.title}`},e.id)))}),(0,p.jsx)("span",{className:"mailpoet-gap"}),(0,p.jsx)("a",{className:"mailpoet-link",target:"_blank",title:(0,o.t)("previewPage"),rel:"noopener noreferrer",href:i.url[e.preview],"data-automation-id":e.linkAutomationId,children:(0,o.t)("preview")})]})}var N=i(3537),I=i(86656),z=i(50438);function T(){const e=(0,_.v9)("isMssActive")(),[t,i]=(0,_.yu)("sender","name"),[s,n]=(0,_.yu)("sender","address"),[a,r]=(0,g.useState)(!0),[l,c]=(0,g.useState)(!1),[m,d]=(0,_.yu)("reply_to","name"),[u,b]=(0,_.yu)("reply_to","address"),v=(0,_.BH)("setErrorFlag"),f=s&&!(0,o.Jh)(s),y=u&&!(0,o.Jh)(u);return(0,g.useEffect)((()=>{v(f||y||!a&&e)}),[y,f,v,a,e]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("defaultSenderTitle"),description:(0,o.t)("defaultSenderDescription"),htmlFor:"sender-name"}),(0,p.jsxs)(x,{children:[(0,p.jsx)("label",{htmlFor:"sender-name",children:(0,o.t)("from")}),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"sender-name",placeholder:(0,o.t)("yourName"),"data-automation-id":"from-name-field",value:t,onChange:(0,o.z2)(i)}),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"text",placeholder:"from@mydomain.com","data-automation-id":"from-email-field",value:s,onChange:(0,o.z2)((0,o.pz)((e=>{r(!0),c(!1),n(e)}))),onBlur:(0,o.z2)((t=>{if(!e)return;const i=(0,o.DA)(t);window.mailpoet_verified_sender_domains.includes(i)||((e=>{r(window.mailpoet_authorized_emails.includes(e))})(t),j.MailPoet.freeMailDomains.indexOf(i)>-1||(0,z.g)(t,e).then((e=>{c(e)})).catch((()=>{})))}))}),(0,p.jsx)("br",{}),f&&(0,p.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("invalidEmail")}),(0,p.jsx)("div",{className:"regular-text",children:(0,p.jsx)(I.L,{emailAddress:s,mssActive:e,isEmailAuthorized:a,showSenderDomainWarning:l,onSuccessfulEmailOrDomainAuthorization:e=>{"email"===e.type&&(r(!0),j.MailPoet.trackEvent("MSS in plugin authorize email",{"authorized email source":"settings",wasSuccessful:"yes"})),"domain"===e.type&&(c(!1),j.MailPoet.trackEvent("MSS in plugin verify sender domain",{"verify sender domain source":"settings",wasSuccessful:"yes"}))}})}),(0,p.jsx)("label",{className:"mailpoet-settings-inputs-row",htmlFor:"reply_to-name",children:"Reply-to"}),(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"reply_to-name",placeholder:(0,o.t)("yourName"),"data-automation-id":"reply_to-name-field",value:m,onChange:(0,o.z2)(d)}),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"text",placeholder:"reply_to@mydomain.com","data-automation-id":"reply_to-email-field",value:u,onChange:(0,o.z2)((0,o.pz)(b))}),(0,p.jsx)("br",{}),y&&(0,p.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("invalidEmail")})]})]})}var M=i(49321);function E(e){let{title:t,description:i,event:s}=e;const[n,a]=(0,_.yu)("subscribe",s,"enabled"),[r,l]=(0,_.yu)("subscribe",s,"label"),[c,m]=(0,_.yu)("subscribe",s,"segments");return(0,g.useEffect)((()=>{""===r&&l((0,o.t)("yesAddMe"))}),[r,l]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:t,description:i,htmlFor:`subscribe-${s}-enabled`}),(0,p.jsxs)(x,{children:[(0,p.jsx)(M.X,{id:`subscribe-${s}-enabled`,automationId:`subscribe-${s}-checkbox`,checked:"1"===n,onCheck:e=>a(e?"1":"0")}),"1"===n&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"text",value:r,onChange:(0,o.z2)(l)}),(0,p.jsx)("label",{className:"mailpoet-settings-inputs-row",htmlFor:`subscribe-${s}-segments`,children:(0,o.t)("usersWillBeSubscribedTo")}),(0,p.jsx)("div",{"data-automation-id":`subscribe-${s}-segments-selection`,children:(0,p.jsx)(C,{id:`subscribe-${s}-segments`,placeholder:(0,o.t)("chooseList"),value:c,setValue:m})})]})]})]})}function D(){const[e,t]=(0,_.yu)("subscription","pages","manage");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("manageSubTitle"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("manageSubDescription1")," ",f()((0,o.t)("manageSubDescription2"),/\[link\](.*?)\[\/link\]/,(e=>(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/222-customize-your-manage-subscription-page",rel:"noopener noreferrer",target:"_blank",children:e},e)))]}),htmlFor:"subscription-manage-page"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(S,{value:e,preview:"manage",setValue:t,id:"subscription-manage-page",automationId:"subscription-manage-page-selection",linkAutomationId:"preview_manage_subscription_page_link"}),(0,p.jsx)("p",{children:f()((0,o.t)("hideListFromManageSubPage"),/\[link\](.*?)\[\/link\]/,(e=>(0,p.jsx)("a",{className:"mailpoet-link",href:"/wp-admin/admin.php?page=mailpoet-lists#/",rel:"noopener noreferrer",target:"_blank",children:e},e)))})]})]})}function P(){const[e,t]=(0,_.yu)("subscription","pages","unsubscribe"),[i,s]=(0,_.yu)("subscription","pages","confirm_unsubscribe");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("unsubscribeTitle"),description:(0,p.jsxs)(p.Fragment,{children:[f()((0,o.t)("unsubscribeDescription1"),"[mailpoet_page]",(()=>(0,p.jsx)("code",{children:"[mailpoet_page]"},"mp")))," ",f()((0,o.t)("unsubscribeDescription2"),/\[link\](.*?)\[\/link\]/,(e=>(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/221-customize-your-unsubscribe-page",rel:"noopener noreferrer",target:"_blank",children:e},e)))]}),htmlFor:"subscription-pages-unsubscribe"}),(0,p.jsxs)(x,{children:[(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,o.t)("confirmationPageTitle"),":"]}),(0,p.jsx)(S,{value:i,preview:"confirm_unsubscribe",setValue:s,id:"subscription-pages-unsubscribe-confirmation",automationId:"unsubscribe-confirmation-page-selection",linkAutomationId:"unsubscribe_page_preview_link_confirmation"}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,o.t)("successPageTitle"),":"]}),(0,p.jsx)(S,{value:e,preview:"unsubscribe",setValue:t,id:"subscription-pages-unsubscribe",automationId:"unsubscribe-success-page-selection",linkAutomationId:"unsubscribe_page_preview_link"})]})]})}function A(){const[e,t]=(0,_.yu)("stats_notifications","enabled"),[i,s]=(0,_.yu)("stats_notifications","automated"),[n,a]=(0,_.yu)("stats_notifications","address"),r=(0,_.BH)("setErrorFlag"),l=("1"===e||"1"===i)&&""===n.trim(),c=n&&!(0,o.Jh)(n);return(0,g.useEffect)((()=>{r(l||c)}),[l,c,r]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("statsNotifsTitle"),description:(0,o.t)("statsNotifsDescription"),htmlFor:"stats-enabled"}),(0,p.jsxs)(x,{children:[(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(M.X,{id:"stats-enabled",checked:"1"===e,onCheck:e=>t(e?"1":"0")}),(0,p.jsx)("label",{htmlFor:"stats-enabled",children:(0,o.t)("newslettersAndPostNotifs")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(M.X,{id:"stats-automated",checked:"1"===i,onCheck:e=>s(e?"1":"0")}),(0,p.jsx)("label",{htmlFor:"stats-automated",children:(0,o.t)("welcomeAndWcEmails")})]}),(0,p.jsx)(N.I,{dimension:"small",type:"email",value:n,onChange:(0,o.z2)((0,o.pz)(a)),placeholder:"me@mydomain.com"}),l&&(0,p.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("pleaseFillEmail")}),c&&(0,p.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("invalidEmail")})]})]})}var B=i(60216);function O(){const[e,t]=(0,_.yu)("subscriber_email_notification","enabled"),[i,s]=(0,_.yu)("subscriber_email_notification","address"),n=(0,_.BH)("setErrorFlag"),a="1"===e&&""===i.trim(),r=i&&!(0,o.Jh)(i);return(0,g.useEffect)((()=>{n(a||r)}),[a,r,n]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("newSubscriberNotifsTitle"),description:(0,o.t)("newSubscriberNotifsDescription"),htmlFor:"subscriber_email_notification-enabled"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(B.Y,{checked:"1"===e,value:"1",onCheck:t}),(0,o.t)("yes")," ",(0,p.jsx)(B.Y,{checked:""===e,value:"",onCheck:t}),(0,o.t)("no"),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"email",value:i,onChange:(0,o.z2)((0,o.pz)(s)),placeholder:"me@mydomain.com"}),a&&(0,p.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("pleaseFillEmail")}),r&&(0,p.jsx)("div",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("invalidEmail")})]})]})}var $=i(40612),Y=i(7936),H=i(39425);function L(e){let{name:t,title:i,description:s}=e;const[n,a]=(0,g.useState)([]),[r,l]=(0,g.useState)(""),[c,m]=(0,g.useState)(null),[d,u]=(0,g.useState)(null),[b,_]=(0,g.useState)(""),[v,f]=(0,g.useState)("");let y=`[${t}`;return n.length&&(y+=` segments="${n.join(",")}"`),c&&(y+=` start_date="${j.MailPoet.Date.format(c,{format:"Y-m-d"})}"`),d&&(y+=` end_date="${j.MailPoet.Date.format(d,{format:"Y-m-d"})}"`),r&&parseInt(r,10)>0&&(y+=` in_the_last_days="${r}"`),b&&b.length>0&&(y+=` subject_contains="${b}"`),v&&parseInt(v,10)>0&&(y+=` limit="${v}"`),y+="]",(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:i,description:s,htmlFor:`${t}-shortcode`}),(0,p.jsxs)(x,{children:[(0,p.jsx)(N.I,{dimension:"small",readOnly:!0,type:"text",value:y,onClick:e=>{e.target.focus(),e.target.select()},id:`${t}-shortcode`}),(0,p.jsx)(H.m,{variant:"secondary",targetId:`${t}-shortcode`,alwaysSelectText:!0}),(0,p.jsx)("br",{}),(0,p.jsx)(C,{value:n,setValue:a,id:`${t}-shortcode-segments`,placeholder:(0,o.t)("leaveEmptyToDisplayAll"),segmentsSelector:"getSegments"}),"mailpoet_archive"===t&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{type:"number",min:"1",max:"365000",dimension:"small",tooltip:(0,Y.__)("Include newsletters sent no more than this many days ago. This overrides start and end dates.","mailpoet"),placeholder:(0,Y.__)("In the last days","mailpoet"),onChange:e=>{const t=e.target.value.trim();if(""===t)return void l("");const i=Number(t);Number.isInteger(i)&&i>0&&(m(null),u(null),l(t))},value:r}),(0,p.jsx)("br",{}),(0,p.jsx)($.a,{dimension:"small",dateFormat:"MMMM d, yyyy",onChange:e=>{m(e),null!==e&&l("")},selected:c,maxDate:d,placeholderText:(0,Y.__)("Start date","mailpoet"),isClearable:!0}),(0,p.jsx)($.a,{dimension:"small",dateFormat:"MMMM d, yyyy",onChange:e=>{u(e),null!==e&&l("")},selected:d,minDate:c,placeholderText:(0,Y.__)("End date","mailpoet"),isClearable:!0}),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"text",value:b,onChange:e=>_(e.target.value),placeholder:(0,Y.__)("Subject lines containing","mailpoet")}),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{type:"number",min:"1",max:"1000",dimension:"small",placeholder:(0,Y.__)("Maximum number to display","mailpoet"),onChange:e=>{const t=e.target.value.trim();if(""===t)return void f("");const i=Number(t);Number.isInteger(i)&&i>0&&f(t)},value:v})]})]})]})}function R(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("gdprTitle"),description:(0,o.t)("gdprDescription"),htmlFor:"gdpr-compliant"}),(0,p.jsx)(x,{children:(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/246-guide-to-conform-to-gdpr",title:(0,o.t)("readGuide"),target:"_blank",rel:"noopener noreferrer",children:(0,o.t)("readGuide")})})]})}function W(){const[e,t]=(0,_.yu)("reEngagement","page");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("reEngagementTitle"),description:(0,o.t)("reEngagementDescription"),htmlFor:"re-engagement-page"}),(0,p.jsx)(x,{children:(0,p.jsx)(S,{value:e,preview:"re_engagement",setValue:t,id:"re-engagement-page"})})]})}function V(){return(0,p.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,p.jsx)(T,{}),(0,p.jsx)(E,{event:"on_comment",title:(0,o.t)("subscribeInCommentsTitle"),description:(0,o.t)("subscribeInCommentsDescription")}),(0,p.jsx)(E,{event:"on_register",title:(0,o.t)("subscribeInRegistrationTitle"),description:(0,o.t)("subscribeInRegistrationDescription")}),(0,p.jsx)(D,{}),(0,p.jsx)(P,{}),(0,p.jsx)(W,{}),(0,p.jsx)(A,{}),(0,p.jsx)(O,{}),(0,p.jsx)(L,{name:"mailpoet_archive",title:(0,o.t)("archiveShortcodeTitle"),description:(0,o.t)("archiveShortcodeDescription")}),(0,p.jsx)(L,{name:"mailpoet_subscribers_count",title:(0,o.t)("subscribersCountShortcodeTitle"),description:(0,o.t)("subscribersCountShortcodeDescription")}),(0,p.jsx)(R,{}),(0,p.jsx)(k,{})]})}function K(){const[e,t]=(0,_.yu)("cron_trigger","method"),i=(0,_.v9)("getPaths")();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("taskCron"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("taskCronDescription")," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/129-what-is-the-newsletter-task-scheduler",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("readMore")})]}),htmlFor:"cron_trigger-method"}),(0,p.jsxs)(x,{children:[(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"cron_trigger-method-action-scheduler",value:"Action Scheduler",checked:"Action Scheduler"===e,onCheck:t,automationId:"action_scheduler_cron_radio"}),(0,p.jsx)("label",{htmlFor:"cron_trigger-method-action-scheduler",children:(0,o.t)("actionSchedulerCron")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"cron_trigger-method-wordpress",value:"WordPress",checked:"WordPress"===e,onCheck:t,automationId:"wordress_cron_radio"}),(0,p.jsx)("label",{htmlFor:"cron_trigger-method-wordpress",children:(0,o.t)("websiteVisitors")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"cron_trigger-method-cron",value:"Linux Cron",checked:"Linux Cron"===e,onCheck:t,automationId:"linux_cron_radio"}),(0,p.jsx)("label",{htmlFor:"cron_trigger-method-cron",children:(0,o.t)("serverCron")})]}),"Linux Cron"===e&&(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,o.t)("addCommandToCrontab")}),(0,p.jsx)(N.I,{dimension:"small",type:"text",readOnly:!0,value:`php ${i.plugin}/mailpoet-cron.php ${i.root}`}),(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,o.t)("withFrequency")}),(0,p.jsx)(N.I,{dimension:"small",type:"text",readOnly:!0,value:"*/1 * * * *"})]})]})]})}function q(){const e=(0,_.v9)("hasMembersPlugin")();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("rolesTitle"),description:(0,o.t)("rolesDescription"),htmlFor:""}),(0,p.jsx)(x,{children:(0,p.jsx)("p",{children:e?(0,p.jsx)("a",{className:"mailpoet-link",href:"?page=roles",children:(0,o.t)("manageUsingMembers")}):f()((0,o.t)("installMembers"),/\[link\](.*?)\[\/link\]/,(e=>(0,p.jsx)("a",{className:"mailpoet-link",href:"https://wordpress.org/plugins/members/",rel:"noopener noreferrer",target:"_blank",children:e},e)))})})]})}function G(){const[e,t]=(0,_.yu)("tracking","level");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("engagementTrackingTitle"),description:(0,o.t)("engagementTrackingDescription"),htmlFor:"engagement_tracking"}),(0,p.jsxs)(x,{children:[(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"tracking-basic",value:"basic",checked:"basic"===e,onCheck:t,automationId:"tracking-basic-radio"}),(0,p.jsx)("label",{htmlFor:"tracking-basic",children:(0,o.t)("engagementTrackingBasic")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"tracking-partial",value:"partial",checked:"partial"===e,onCheck:t,automationId:"tracking-partial-radio"}),(0,p.jsx)("label",{htmlFor:"tracking-partial",children:(0,o.t)("engagementTrackingPartial")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"tracking-full",value:"full",checked:"full"===e,onCheck:t,automationId:"tracking-full-radio"}),(0,p.jsx)("label",{htmlFor:"tracking-full",children:(0,o.t)("engagementTrackingFull")})]})]})]})}function X(){const[e]=(0,_.yu)("smtp_provider"),t=(0,_.v9)("isMssActive")(),[i,s]=(0,_.yu)("send_transactional_emails");let n="";return t?n="MailPoet Sending Service":"manual"===e?n="SMTP":"SendGrid"===e?n="SendGrid":"AmazonSES"===e?n="Amazon SES":"server"===e&&(n=(0,o.t)("hostOption")),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("transactionalTitle"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("transactionalDescription")," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("transactionalLink")})]}),htmlFor:""}),(0,p.jsxs)(x,{children:[(0,p.jsx)(B.Y,{id:"transactional-enabled",value:"1",checked:"1"===i,onCheck:s}),(0,p.jsxs)("label",{htmlFor:"transactional-enabled",children:[(0,o.t)("transactionalCurrentMethod").replace("%1$s",n),(0,p.jsx)("br",{}),(0,p.jsx)("span",{className:"mailpoet-note",children:f()((0,o.t)("transactionalMssNote"),/\[link\](.*?)\[\/link\]/,(e=>(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails#attachments",rel:"noopener noreferrer",target:"_blank",children:e},e)))})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"transactional-disabled",value:"",checked:""===i,onCheck:s}),(0,p.jsx)("label",{htmlFor:"transactional-disabled",children:(0,o.t)("transactionalWP")})]})]})]})}function U(){const[e,t]=(0,_.yu)("deactivate_subscriber_after_inactive_days"),[i]=(0,_.yu)("tracking","level"),s="basic"!==i;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("inactiveSubsTitle"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("inactiveSubsDescription")," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/264-inactive-subscribers",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("readMore")})]}),htmlFor:""}),(0,p.jsxs)(x,{children:[!s&&(0,p.jsx)("p",{"data-automation-id":"inactive-subscribers-disabled",children:(0,o.t)("disabledBecauseTrackingIs")}),s&&(0,p.jsxs)("div",{"data-automation-id":"inactive-subscribers-enabled",children:[(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"inactive-subscribers-disabled",automationId:"inactive-subscribers-option-never",value:"",checked:""===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"inactive-subscribers-disabled",children:(0,o.t)("never")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"inactive-subscribers-3-months",value:"90",checked:"90"===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"inactive-subscribers-3-months",children:(0,o.t)("after3months")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"inactive-subscribers-6-months",value:"180",checked:"180"===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"inactive-subscribers-6-months",children:(0,o.t)("after6months")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"inactive-subscribers-12-months",value:"365",checked:"365"===e,onCheck:t,automationId:"inactive-subscribers-default"}),(0,p.jsx)("label",{htmlFor:"inactive-subscribers-12-months",children:(0,o.t)("after12months")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"inactive-subscribers-18-months",value:"540",checked:"540"===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"inactive-subscribers-18-months",children:(0,o.t)("after18months")})]})]})]})]})}function J(){const[e,t]=(0,_.yu)("analytics","enabled");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("shareDataTitle"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("shareDataDescription")," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/130-sharing-your-data-with-us",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("readMore")})]}),htmlFor:""}),(0,p.jsxs)(x,{children:[(0,p.jsx)(B.Y,{id:"share-data-enabled",value:"1",checked:"1"===e,onCheck:t,automationId:"analytics-yes"}),(0,p.jsx)("label",{htmlFor:"share-data-enabled",children:(0,o.t)("yes")}),(0,p.jsx)("span",{className:"mailpoet-gap"}),(0,p.jsx)(B.Y,{id:"share-data-disabled",value:"",checked:""===e,onCheck:t,automationId:"analytics-no"}),(0,p.jsx)("label",{htmlFor:"share-data-disabled",children:(0,o.t)("no")})]})]})}function Q(){const[e,t]=(0,_.yu)("3rd_party_libs","enabled");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("libs3rdPartyTitle"),description:(0,p.jsxs)(p.Fragment,{children:[f()((0,o.t)("libs3rdPartyDescription"),/\[link\](.*?)\[\/link\]/,(e=>(0,p.jsx)("a",{href:"https://www.mailpoet.com/support/",rel:"noopener noreferrer",target:"_blank",children:e},e)))," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/338-what-3rd-party-libraries-we-use",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("readMore")})]}),htmlFor:""}),(0,p.jsxs)(x,{children:[(0,p.jsx)(B.Y,{id:"libs-3rd-party-enabled",value:"1",checked:"1"===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"libs-3rd-party-enabled",children:(0,o.t)("yes")}),(0,p.jsx)("span",{className:"mailpoet-gap"}),(0,p.jsx)(B.Y,{id:"libs-3rd-party-disabled",value:"",checked:""===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"libs-3rd-party-disabled",children:(0,o.t)("no")})]})]})}function Z(){const[e,t]=(0,_.yu)("captcha","type"),[i,s]=(0,_.yu)("captcha","recaptcha_site_token"),[n,a]=(0,_.yu)("captcha","recaptcha_secret_token"),[r,l]=(0,_.yu)("captcha","recaptcha_invisible_site_token"),[c,m]=(0,_.yu)("captcha","recaptcha_invisible_secret_token"),d=(0,_.v9)("isBuiltInCaptchaSupported")(),u=(0,_.BH)("setErrorFlag"),j="recaptcha"===e&&""===i.trim(),b="recaptcha"===e&&""===n.trim(),v="recaptcha-invisible"===e&&""===r.trim(),f="recaptcha-invisible"===e&&""===c.trim();return(0,g.useEffect)((()=>{u(j||b||f||v)}),[b,j,f,v,u]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("captchaTitle"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("captchaDescription")," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/182-add-a-captcha-to-subscription-forms",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("readMore")}),("recaptcha"===e||"recaptcha-invisible"===e)&&(0,p.jsxs)("p",{children:[(0,p.jsxs)("span",{children:[(0,o.t)("reCaptchaDescription")," "]}),(0,p.jsx)("a",{className:"mailpoet-link",href:"https://www.google.com/recaptcha/admin",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("signupForCaptchaKey")})]})]}),htmlFor:""}),(0,p.jsxs)(x,{children:[(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"built-in-captcha",disabled:!d,value:"built-in",checked:"built-in"===e,onCheck:t}),(0,p.jsxs)("label",{htmlFor:"built-in-captcha",children:[(0,o.t)("builtInCaptcha")," ",!d&&(0,o.t)("disbaledBecauseExtensionMissing")]})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"google-captcha",value:"recaptcha",checked:"recaptcha"===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"google-captcha",children:(0,o.t)("googleReCaptchaCheckbox")})]}),"recaptcha"===e&&(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(N.I,{dimension:"small",type:"text",value:i,onChange:(0,o.z2)(s),placeholder:(0,o.t)("yourReCaptchaKey")}),j&&(0,p.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("fillReCaptchaKeys")}),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"text",value:n,onChange:(0,o.z2)(a),placeholder:(0,o.t)("yourReCaptchaSecret")}),b&&(0,p.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("fillReCaptchaKeys")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"google-captcha-invisible",value:"recaptcha-invisible",checked:"recaptcha-invisible"===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"google-captcha-invisible",children:(0,o.t)("googleReCaptchaInvisible")})]}),"recaptcha-invisible"===e&&(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(N.I,{dimension:"small",type:"text",value:r,onChange:(0,o.z2)(l),placeholder:(0,o.t)("yourReCaptchaKey")}),v&&(0,p.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("fillReCaptchaKeys")}),(0,p.jsx)("br",{}),(0,p.jsx)(N.I,{dimension:"small",type:"text",value:c,onChange:(0,o.z2)(m),placeholder:(0,o.t)("yourReCaptchaSecret")}),f&&(0,p.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("fillReCaptchaKeys")})]}),(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,p.jsx)(B.Y,{id:"no-captcha",value:"",checked:""===e,onCheck:t}),(0,p.jsx)("label",{htmlFor:"no-captcha",children:(0,o.t)("disable")})]})]})]})}function ee(){const e=(0,_.BH)("reinstall"),{notices:t}=(0,g.useContext)(n.k);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("reinstallTitle"),description:(0,o.t)("reinstallDescription"),htmlFor:""}),(0,p.jsx)(x,{children:(0,p.jsx)(b.z,{type:"button",onClick:async()=>{if(window.confirm((0,o.t)("reinstallConfirmation"))){const i=await e();"SAVE_FAILED"===i.type?t.error(i.error.map((e=>(0,p.jsx)("p",{children:e}))),{scroll:!0}):window.location.href=`admin.php?page=${j.MailPoet.mainPageSlug}`}},automationId:"reinstall-button",variant:"destructive",children:(0,o.t)("reinstallNow")})})]})}function te(){const e=(0,_.BH)("recalculateSubscribersScore"),{notices:t}=(0,g.useContext)(n.k);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("recalculateSubscribersScoreTitle"),description:(0,o.t)("recalculateSubscribersScoreDescription"),htmlFor:""}),(0,p.jsx)(x,{children:(0,p.jsx)(b.z,{type:"button",onClick:async()=>{await e(),t.info((0,p.jsx)("p",{children:(0,o.t)("recalculateSubscribersScoreNotice")}),{scroll:!0})},variant:"secondary",dimension:"small",children:(0,o.t)("recalculateSubscribersScoreNow")})})]})}function ie(){const[e,t]=(0,_.yu)("logging");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("loggingTitle"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("loggingDescription")," ",(0,p.jsx)("a",{href:"?page=mailpoet-logs",className:"mailpoet-link",children:(0,o.t)("loggingDescriptionLink")})]}),htmlFor:"logging-level"}),(0,p.jsx)(x,{children:(0,p.jsxs)(F.Select,{id:"logging-level",value:e,onChange:(0,o.z2)(t),automationId:"logging-select-box",isMinWidth:!0,dimension:"small",children:[(0,p.jsx)("option",{value:"everything","data-automation-id":"log-everything",children:(0,o.t)("everythingLogOption")}),(0,p.jsx)("option",{value:"errors","data-automation-id":"log-errors",children:(0,o.t)("errorsLogOption")}),(0,p.jsx)("option",{value:"nothing","data-automation-id":"log-nothing",children:(0,o.t)("nothingLogOption")})]})})]})}function se(){const[e,t]=(0,_.yu)("bounce","address");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("bounceEmail"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("yourBouncedEmails")," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/180-how-bounce-management-works-in-mailpoet-3",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("readMore")})]}),htmlFor:"bounce-address"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"bounce-address",placeholder:"bounce@mydomain.com","data-automation-id":"bounce-address-field",value:e,onChange:(0,o.z2)((0,o.pz)(t))})})]})}function ne(){return(0,p.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,p.jsx)(se,{}),(0,p.jsx)(K,{}),(0,p.jsx)(q,{}),(0,p.jsx)(G,{}),(0,p.jsx)(X,{}),(0,p.jsx)(te,{}),(0,p.jsx)(U,{}),(0,p.jsx)(J,{}),(0,p.jsx)(Q,{}),(0,p.jsx)(Z,{}),(0,p.jsx)(ee,{}),(0,p.jsx)(ie,{}),(0,p.jsx)(k,{})]})}var ae=i(22482),re=i(634),le=i(86873),oe=i(77135);const ce=f()((0,o.t)("premiumTabDescription"),/\[link\](.*?)\[\/link\]/g,(e=>(0,p.jsx)("a",{href:"https://account.mailpoet.com/account?utm_source=plugin&utm_medium=settings&utm_campaign=activate-existing-plan&ref=settings-key-activation",target:"_blank",rel:"noopener noreferrer",children:e},"premium-tab-description"))),me=f()((0,o.t)("premiumTabGetKey"),/\[link\](.*?)\[\/link\]/g,(e=>(0,p.jsx)("a",{href:"https://account.mailpoet.com/account?utm_source=plugin&utm_medium=settings&utm_campaign=activate-existing-plan&ref=settings-key-activation",target:"_blank",rel:"noopener noreferrer",children:e},"premium-tab-get-key")));function de(e){let{subscribersCount:t}=e;const i=(0,_.v9)("getKeyActivationState")(),s=(0,_.BH)("updateKeyActivationState"),n=(0,_.BH)("sendCongratulatoryMssEmail"),[a,r]=(0,_.yu)("sender","address"),[l,c]=(0,_.yu)("authorized_emails_addresses_check"),m=(0,_.BH)("setSaveDone"),d=i.fromAddressModalCanBeShown&&i.mssStatus===ae.ov.VALID_MSS_ACTIVE&&(!a||l);return(0,p.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,p.jsx)(h,{htmlFor:"mailpoet_premium_key",title:(0,o.t)("premiumTabActivationKeyLabel"),description:(0,p.jsxs)(p.Fragment,{children:[ce,(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),me,(0,p.jsx)("br",{}),(0,p.jsx)("br",{}),f()((0,o.t)("premiumTabGetPlan"),/\[link\](.*?)\[\/link\]/g,(e=>(0,p.jsx)("a",{href:`https://account.mailpoet.com/?s=${t}&utm_source=plugin&utm_medium=settings&utm_campaign=create-new-plan&ref=settings-key-activation`,target:"_blank",rel:"noopener noreferrer",children:e},"premium-tab-get-plan")))]})}),(0,p.jsxs)(x,{children:[(0,p.jsx)(oe.c,{}),(0,p.jsx)(le.X,{label:(0,o.t)("premiumTabVerifyButton")})]}),d&&(0,p.jsx)(re.d,{onRequestClose:()=>{s({fromAddressModalCanBeShown:!1}),n()},setAuthorizedAddress:async e=>{await r(e),await c(null),m()}})]})}var ue=i(16374),pe=i(26952);function he(){const e=(0,ue.k6)(),t=(0,_.v9)("isMssActive")(),[i]=(0,_.yu)("mta","mailpoet_api_key"),{mssStatus:s,premiumStatus:n}=(0,_.v9)("getKeyActivationState")(),a=null!==s&&s!==ae.ov.INVALID,r=null!==n&&n!==ae.ul.INVALID,l=window.mailpoet_free_plan_url,c=(0,_.BH)("setSetting"),m=(0,_.BH)("saveSettings");return(0,p.jsxs)("ul",{className:"mailpoet-sending-methods",children:[(0,p.jsx)("li",{children:(0,p.jsxs)("label",{className:"mailpoet-sending-method mailpoet-form-checkbox",children:[(0,p.jsx)("input",{type:"radio",checked:t,onChange:async s=>{s.preventDefault(),t||a||e.push("/premium"),!t&&a&&await(async()=>(await c(["mta_group"],"mailpoet"),await c(["mta","method"],"MailPoet"),await c(["mta","mailpoet_api_key"],i),await c(["signup_confirmation","enabled"],"1"),m()))()}}),(0,p.jsx)("span",{className:"mailpoet-form-radio-control"}),(0,p.jsx)("h4",{className:"mailpoet-h4",children:(0,o.t)("mssTitle")}),(0,p.jsx)("p",{children:t?(0,o.t)("youreSendingWithMss"):(0,o.t)("solveSendingProblems")}),(0,p.jsxs)("ul",{className:"mailpoet-sending-method-benefits mailpoet_success",children:[(0,p.jsx)("li",{className:"mailpoet_success_item",children:(0,o.t)("mssBenefit1")}),(0,p.jsx)("li",{className:"mailpoet_success_item",children:(0,o.t)("mssBenefit2")}),(0,p.jsx)("li",{className:"mailpoet_success_item",children:(0,o.t)("mssBenefit3")}),(0,p.jsx)("li",{className:"mailpoet_success_item",children:(0,o.t)("mssBenefit4")}),(0,p.jsx)("li",{className:"mailpoet_success_item",children:(0,o.t)("mssBenefit5")})]}),!a&&!r&&(0,p.jsxs)("div",{className:"mailpoet-sending-method-actions",children:[(0,p.jsx)("a",{className:"mailpoet-button button-primary",href:l,rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("freeUpto")}),(0,p.jsxs)("span",{children:[" ",(0,o.t)("or")," "]}),f()((0,o.t)("enterYourKey"),/\[link\](.*?)\[\/link\]/g,((e,t)=>(0,p.jsx)(pe.Link,{to:"/premium",className:"mailpoet-link",children:e},t)))]}),!a&&r&&(0,p.jsxs)("div",{className:"mailpoet-sending-method-actions",children:[(0,p.jsx)("i",{children:(0,o.t)("invalidKeyForMss")})," ",(0,p.jsx)("a",{className:"mailpoet-button button-primary",href:"https://account.mailpoet.com/",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("getPlan")})]})]})}),(0,p.jsx)("li",{children:(0,p.jsxs)("label",{className:"mailpoet-sending-method mailpoet-form-checkbox",children:[(0,p.jsx)("input",{type:"radio",checked:!t,onChange:t=>{t.preventDefault(),e.push("/mta/other")}}),(0,p.jsx)("span",{className:"mailpoet-form-radio-control"}),(0,p.jsx)("h4",{className:"mailpoet-h4",children:(0,o.t)("otherTitle")}),(0,p.jsxs)("p",{children:[(0,o.t)("sendViaHost")," ",(0,p.jsx)("strong",{children:(0,o.t)("notRecommended")})," ",(0,o.t)("orViaThirdParty")]}),(0,p.jsx)("div",{className:"mailpoet-sending-method-actions",children:(0,p.jsx)(pe.Link,{to:"/mta/other",className:"mailpoet-link",children:(0,o.t)("configure")})})]})})]})}function xe(){const[e,t]=(0,_.yu)("smtp_provider"),[,i]=(0,_.yu)("mta_group"),[,s]=(0,_.yu)("mta","method");return(0,g.useEffect)((()=>{switch(e){case"server":i("website"),s("PHPMail");break;case"manual":i("smtp"),s("SMTP");break;case"AmazonSES":i("smtp"),s("AmazonSES");break;case"SendGrid":i("smtp"),s("SendGrid");break;default:s("PHPMail")}}),[e,i,s]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("method"),htmlFor:"mailpoet_smtp_method"}),(0,p.jsx)(x,{children:(0,p.jsxs)(F.Select,{id:"mailpoet_smtp_method",value:e,onChange:(0,o.z2)(t),isMinWidth:!0,dimension:"small",children:[(0,p.jsx)("option",{value:"server",children:(0,o.t)("hostOption")}),(0,p.jsx)("option",{value:"manual",children:(0,o.t)("smtpOption")}),(0,p.jsxs)("optgroup",{label:(0,o.t)("selectProvider"),children:[(0,p.jsx)("option",{value:"AmazonSES",children:"Amazon SES"}),(0,p.jsx)("option",{value:"SendGrid",children:"SendGrid"})]})]})})]})}function ge(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("spfTitle"),description:(0,o.t)("spfDescription"),htmlFor:""}),(0,p.jsx)(x,{children:(0,o.t)("spfSetup")})]})}var je=i(37248),be=i(82299);function _e(){const[e,t]=(0,g.useState)(window.mailpoet_current_user_email),[i]=(0,_.yu)("mta"),{state:s,error:n}=(0,_.v9)("getTestEmailState")(),a=(0,_.BH)("sendTestEmail");return(0,p.jsxs)(p.Fragment,{children:[s===ae.xg.SENDING&&(0,p.jsx)(l.g,{}),s===ae.xg.SUCCESS&&(0,p.jsx)(be.q,{type:"success",scroll:!0,children:(0,p.jsx)("p",{children:(0,o.t)("emailSent")})}),s===ae.xg.FAILURE&&(0,p.jsx)(be.q,{type:"error",scroll:!0,children:(0,p.jsx)("p",{children:n.map((e=>(0,p.jsx)("p",{children:e},e)))})}),(0,p.jsx)(h,{title:(0,o.t)("testSending"),htmlFor:"mailpoet_mta_test_email"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"mailpoet_mta_test_email",value:e,onChange:(0,o.z2)(t)}),(0,p.jsx)(b.z,{type:"button",dimension:"small",variant:"secondary",onClick:()=>a(e,i),children:(0,o.t)("sendTestEmail")}),(0,p.jsx)(je.Tooltip,{tooltipId:"tooltip-settings-test",className:"mailpoet_tooltip_icon",tooltip:(0,p.jsx)("span",{style:{pointerEvents:"all"},children:f()((0,o.t)("testEmailTooltip"),/\[link\](.*?)\[\/link\]/g,((e,t)=>(0,p.jsx)("a",{className:"mailpoet-link",target:"_blank",rel:"noopener noreferrer",href:"https://kb.mailpoet.com/article/146-my-newsletters-are-not-being-received",children:e},t)))})})]})]})}function ve(){const e=(0,_.BH)("saveSettings"),t=(0,_.BH)("loadSettings"),i=(0,ue.k6)();return(0,p.jsxs)("div",{className:"mailpoet-settings-save",children:[(0,p.jsx)(b.z,{type:"button",onClick:async()=>{await e(),i.push("/mta")},children:(0,o.t)("activate")}),(0,p.jsx)(b.z,{onClick:async()=>{j.MailPoet.Modal.loading(!0),await t(),i.push("/mta"),j.MailPoet.Modal.loading(!1)},variant:"tertiary",children:(0,o.t)("orCancel")})]})}const fe=1440,ye=86400;function ke(e){const t=Math.floor(parseInt(e,10));return t>60?(0,o.t)("everyHours").replace("%1$d",""+t/60):60===t?(0,o.t)("everyHour"):t>1?(0,o.t)("everyMinutes").replace("%1$d",`${t}`):(0,o.t)("everyMinute")}function we(e){let{recommendedEmails:t,recommendedInterval:i}=e;const[s,n]=(0,_.yu)("mailpoet_sending_frequency"),[a,r]=(0,_.yu)("mta","frequency","emails"),[l,c]=(0,_.yu)("mta","frequency","interval");(0,g.useEffect)((()=>{"auto"===s&&(r(`${t}`),c(`${i}`))}),[s,t,i,r,c]);const m=Math.floor(fe*parseInt(a,10)/parseInt(l,10)),d=Math.floor(m/ye*10)/10;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("sendingFrequency"),htmlFor:"mailpoet_sending_frequency"}),(0,p.jsxs)(x,{children:[(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,p.jsxs)(F.Select,{id:"mailpoet_sending_frequency",value:s,onChange:(0,o.z2)(n),dimension:"small",children:[(0,p.jsx)("option",{value:"auto",children:(0,o.t)("recommendedTitle")}),(0,p.jsx)("option",{value:"manual",children:(0,o.t)("ownFrequency")})]})}),"manual"===s&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row mailpoet-settings-inputs-row-centered",children:[(0,p.jsx)(N.I,{dimension:"small",id:"other_frequency_emails",type:"number",min:"1",max:"1000",value:a,onChange:(0,o.z2)(r)}),(0,p.jsx)("span",{className:"mailpoet-gap"}),(0,p.jsx)("span",{children:(0,o.t)("emails")})]}),(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,p.jsxs)(F.Select,{id:"other_frequency_interval",value:l,onChange:(0,o.z2)(c),dimension:"small",children:[(0,p.jsx)("option",{value:"1",children:"every minute"}),(0,p.jsx)("option",{value:"2",children:"every 2 minutes"}),(0,p.jsx)("option",{value:"5",children:"every 5 minutes (recommended)"}),(0,p.jsx)("option",{value:"10",children:"every 10 minutes"}),(0,p.jsx)("option",{value:"15",children:"every 15 minutes"}),(0,p.jsx)("option",{value:"30",children:"every 30 minutes"})]})})]}),"auto"===s&&(0,p.jsxs)("div",{className:"mailpoet-settings-inputs-row",children:[(0,o.t)("xEmails").replace("%1$s",a)," ",ke(l),". "]}),(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:f()((0,o.t)("thatsXEmailsPerDay").replace("%1$s",m.toLocaleString()),/(.*?)<\/strong>/g,((e,t)=>(0,p.jsx)("strong",{children:e},t)))}),d>1&&(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,p.jsx)("span",{className:"mailpoet_emails_per_second_warning",children:f()((0,o.t)("thatsXEmailsPerSecond").replace("%1$s",d.toLocaleString()),/(.*?)<\/strong>/g,((e,t)=>(0,p.jsx)("strong",{children:e},t)))})}),"manual"===s&&(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:f()((0,o.t)("frequencyWarning").replace("%1$s",d.toLocaleString()),/(.*?)<\/strong>/g,((e,t)=>(0,p.jsx)("strong",{children:e},t)))})]})]})}function Ce(){const[e,t]=(0,_.yu)("web_host"),i=(0,_.v9)("getWebHosts")(),s=i[e];return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("yourHost"),htmlFor:"mailpoet_web_host"}),(0,p.jsx)(x,{children:(0,p.jsx)(F.Select,{id:"mailpoet_web_host",value:e,onChange:(0,o.z2)(t),isMinWidth:!0,dimension:"small",children:Object.entries(i).map((e=>{let[t,i]=e;return(0,p.jsx)("option",{value:t,children:i.name},t)}))})}),(0,p.jsx)(we,{recommendedEmails:s.emails,recommendedInterval:s.interval})]})}function Fe(){const[e,t]=(0,_.yu)("mta","host"),[i,s]=(0,_.yu)("mta","port"),[n,a]=(0,_.yu)("mta","login"),[r,l]=(0,_.yu)("mta","password"),[c,m]=(0,_.yu)("mta","encryption"),[d,u]=(0,_.yu)("mta","authentication");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(we,{recommendedEmails:100,recommendedInterval:5}),(0,p.jsx)(h,{title:(0,o.t)("smtpHost"),description:(0,o.t)("smtpHostExample"),htmlFor:"mailpoet_smtp_host"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"mailpoet_smtp_host",value:e,onChange:(0,o.z2)(t)})}),(0,p.jsx)(h,{title:(0,o.t)("smtpPort"),htmlFor:"mailpoet_smtp_port"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"mailpoet_smtp_port",value:i,onChange:(0,o.z2)(s)})}),(0,p.jsx)(h,{title:(0,o.t)("login"),htmlFor:"mailpoet_smtp_login"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"mailpoet_smtp_login",value:n,onChange:(0,o.z2)(a)})}),(0,p.jsx)(h,{title:(0,o.t)("password"),htmlFor:"mailpoet_smtp_password"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"password",id:"mailpoet_smtp_password",value:r,onChange:(0,o.z2)(l)})}),(0,p.jsx)(h,{title:(0,o.t)("secureConnectioon"),htmlFor:"mailpoet_smtp_encryption"}),(0,p.jsx)(x,{children:(0,p.jsxs)(F.Select,{id:"mailpoet_smtp_encryption",value:c,onChange:(0,o.z2)(m),isMinWidth:!0,dimension:"small",children:[(0,p.jsx)("option",{value:"",children:(0,o.t)("no")}),(0,p.jsx)("option",{value:"ssl",children:"SSL"}),(0,p.jsx)("option",{value:"tls",children:"TLS"})]})}),(0,p.jsx)(h,{title:(0,o.t)("authentication"),description:(0,o.t)("authenticationDescription"),htmlFor:"mailpoet_smtp_authentication"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(B.Y,{value:"1",checked:"1"===d,onCheck:u}),(0,o.t)("yes")," ",(0,p.jsx)(B.Y,{value:"-1",checked:"-1"===d,onCheck:u}),(0,o.t)("no")]})]})}function Se(){const[e,t]=(0,_.yu)("mta","region"),[i,s]=(0,_.yu)("mta","access_key"),[n,a]=(0,_.yu)("mta","secret_key"),r=(0,_.v9)("getAmazonSesOptions")();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(we,{recommendedEmails:r.emails,recommendedInterval:r.interval}),(0,p.jsx)(h,{title:(0,o.t)("region"),htmlFor:"mailpoet_amazon_ses_region"}),(0,p.jsx)(x,{children:(0,p.jsx)(F.Select,{id:"mailpoet_amazon_ses_region",value:e,onChange:(0,o.z2)(t),isMinWidth:!0,dimension:"small",children:Object.entries(r.regions).map((e=>{let[t,i]=e;return(0,p.jsx)("option",{value:i,children:t},i)}))})}),(0,p.jsx)(h,{title:(0,o.t)("accessKey"),htmlFor:"mailpoet_amazon_ses_access_key"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",value:i,className:"regular-text",onChange:(0,o.z2)(s),id:"mailpoet_amazon_ses_access_key"})}),(0,p.jsx)(h,{title:(0,o.t)("secretKey"),htmlFor:"mailpoet_amazon_ses_secret_key"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",value:n,className:"regular-text",onChange:(0,o.z2)(a),id:"mailpoet_amazon_ses_secret_key"})})]})}function Ne(){const[e,t]=(0,_.yu)("mta","api_key"),i=(0,_.v9)("getSendGridOptions")();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(we,{recommendedEmails:i.emails,recommendedInterval:i.interval}),(0,p.jsx)(h,{title:(0,o.t)("apiKey"),htmlFor:"mailpoet_sendgrid_api_key"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",value:e,onChange:(0,o.z2)(t),id:"mailpoet_sendgrid_api_key"})})]})}function Ie(){const[e]=(0,_.yu)("mta","method");return(0,p.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,p.jsx)(xe,{}),"PHPMail"===e&&(0,p.jsx)(Ce,{}),"SMTP"===e&&(0,p.jsx)(Fe,{}),"AmazonSES"===e&&(0,p.jsx)(Se,{}),"SendGrid"===e&&(0,p.jsx)(Ne,{}),(0,p.jsx)(ge,{}),(0,p.jsx)(_e,{}),(0,p.jsx)(ve,{})]})}function ze(){const{subPage:e}=(0,ue.UO)();return"other"===e?(0,p.jsx)(Ie,{}):(0,p.jsx)(he,{})}function Te(){const e=(0,_.v9)("isMssActive")(),[t,i]=(0,_.yu)("signup_confirmation","enabled"),s=e=>{"1"===e&&window.confirm((0,o.t)("subscribersNeedToActivateSub"))&&i("1"),""===e&&window.confirm((0,o.t)("newSubscribersAutoConfirmed"))&&i("")};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("enableSignupConfTitle"),description:(0,p.jsxs)(p.Fragment,{children:[(0,o.t)("enableSignupConfDescription")," ",(0,p.jsx)("a",{className:"mailpoet-link",href:"https://kb.mailpoet.com/article/128-why-you-should-use-signup-confirmation-double-opt-in",rel:"noopener noreferrer",target:"_blank",children:(0,o.t)("readAboutDoubleOptIn")})]}),htmlFor:"signup_confirmation-enabled"}),(0,p.jsx)(x,{children:e?(0,p.jsx)("p",{children:(0,o.t)("signupConfirmationIsMandatory")}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(B.Y,{id:"signup_confirmation-enabled",checked:"1"===t,value:"1",onCheck:s,automationId:"enable_signup_confirmation"}),(0,o.t)("yes")," ",(0,p.jsx)(B.Y,{checked:""===t,value:"",onCheck:s,automationId:"disable_signup_confirmation"}),(0,o.t)("no")]})})]})}function Me(){const[e]=(0,_.yu)("signup_confirmation","enabled"),[t,i]=(0,_.yu)("signup_confirmation","subject"),[s]=(0,_.yu)("signup_confirmation","use_mailpoet_editor");return e?"1"===s?null:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("emailSubject"),htmlFor:"signup_confirmation-subject"}),(0,p.jsx)(x,{children:(0,p.jsx)(N.I,{dimension:"small",type:"text",size:50,id:"signup_confirmation-subject","data-automation-id":"signup_confirmation_email_subject",value:t,onChange:(0,o.z2)(i)})})]}):null}var Ee=i(62865);function De(){const[e]=(0,_.yu)("signup_confirmation","enabled"),[t,i]=(0,_.yu)("signup_confirmation","body"),[s]=(0,_.yu)("signup_confirmation","use_mailpoet_editor");if(!e)return null;if("1"===s)return null;const n=(0,o.t)("emailContentDescription").replace("[current_site_title]",window.mailpoet_current_site_title||"").split("
").filter((e=>e));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("emailContent"),description:n.map((e=>(0,p.jsxs)("span",{children:[e,(0,p.jsx)("br",{}),(0,p.jsx)("br",{})]},e))),htmlFor:"signup_confirmation-body"}),(0,p.jsx)(x,{children:(0,p.jsx)(Ee.g,{id:"signup_confirmation-body",cols:50,rows:15,"data-automation-id":"signup_confirmation_email_body",value:t,onChange:(0,o.z2)(i)})})]})}function Pe(){const[e]=(0,_.yu)("signup_confirmation","enabled"),[t,i]=(0,_.yu)("subscription","pages","confirmation");return e?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("confirmationPage"),description:(0,o.t)("confirmationPageDescription"),htmlFor:"subscription-pages-confirmation"}),(0,p.jsx)(x,{children:(0,p.jsx)(S,{value:t,preview:"confirm",setValue:i,id:"subscription-pages-confirmation",automationId:"page_selection",linkAutomationId:"preview_page_link"})})]}):null}function Ae(){const[e]=(0,_.yu)("signup_confirmation","enabled"),[t,i]=(0,_.yu)("signup_confirmation","use_mailpoet_editor"),[s]=(0,_.yu)("signup_confirmation","transactional_email_id"),n=(0,_.BH)("openEmailCustomizer");return e?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("emailCustomizerTitle"),description:(0,o.t)("emailCustomizerDescription"),htmlFor:"mailpoet_confirmation_email_customizer"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(M.X,{id:"mailpoet_confirmation_email_customizer",automationId:"mailpoet_confirmation_email_customizer",checked:"1"===t,onCheck:e=>i(e?"1":"")}),(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,p.jsx)(b.z,{type:"button",onClick:()=>n(s),variant:"secondary",dimension:"small",children:(0,o.t)("openTemplateEditor")})})]})]}):null}function Be(){return(0,p.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,p.jsx)(Te,{}),(0,p.jsx)(Ae,{}),(0,p.jsx)(Me,{}),(0,p.jsx)(De,{}),(0,p.jsx)(Pe,{}),(0,p.jsx)(k,{})]})}var Oe=i(85143);function $e(){const[e,t]=(0,_.yu)("woocommerce","use_mailpoet_editor"),[i]=(0,_.yu)("woocommerce","transactional_email_id"),s=(0,_.BH)("openWoocommerceCustomizer");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("wcCustomizerTitle"),description:(0,o.t)("wcCustomizerDescription"),htmlFor:"mailpoet_wc_customizer"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(M.X,{id:"mailpoet_wc_customizer",automationId:"mailpoet_wc_customizer",checked:"1"===e,onCheck:e=>t(e?"1":"")}),(0,p.jsx)("div",{className:"mailpoet-settings-inputs-row",children:(0,p.jsx)(b.z,{type:"button",onClick:()=>s(i),variant:"secondary",dimension:"small",children:(0,o.t)("openTemplateEditor")})})]})]})}function Ye(){const[e,t]=(0,_.yu)("woocommerce","optin_on_checkout","enabled"),[i,s]=(0,_.yu)("woocommerce","optin_on_checkout","segments"),[n,a]=(0,_.yu)("woocommerce","optin_on_checkout","message"),r=(0,_.BH)("setErrorFlag"),l=""===n.trim();return(0,g.useEffect)((()=>{r(l)}),[l,r]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("wcOptinTitle"),description:(0,o.t)("wcOptinDescription"),htmlFor:"mailpoet_wc_checkout_optin"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(M.X,{id:"mailpoet_wc_checkout_optin",automationId:"mailpoet_wc_checkout_optin",checked:"1"===e,onCheck:e=>t(e?"1":"")}),"1"===e&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("br",{}),(0,p.jsxs)("label",{htmlFor:"mailpoet_wc_checkout_optin_segments",children:[(0,o.t)("wcOptinSegmentsTitle"),(0,p.jsx)("br",{}),(0,p.jsx)("span",{children:(0,o.t)("leaveEmptyToSubscribeToWCCustomers")})]}),(0,p.jsx)("br",{}),(0,p.jsx)(C,{id:"mailpoet_wc_checkout_optin_segments",value:i,setValue:s,placeholder:(0,o.t)("wcOptinSegmentsPlaceholder")})]})]}),"1"===e&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("wcOptinMsgTitle"),description:(0,o.t)("wcOptinMsgDescription"),htmlFor:"mailpoet_wc_checkout_optin_message"}),(0,p.jsxs)(x,{children:[(0,p.jsx)(N.I,{dimension:"small",type:"text",id:"mailpoet_wc_checkout_optin_message","data-automation-id":"mailpoet_wc_checkout_optin_message",value:n,onChange:(0,o.z2)(a),placeholder:(0,o.t)("wcOptinMsgPlaceholder")}),(0,p.jsx)("br",{}),l&&(0,p.jsx)("span",{className:"mailpoet_error_item mailpoet_error",children:(0,o.t)("wcOptinMsgCannotBeEmpty")})]})]})]})}function He(){const[e,t]=(0,_.yu)("mailpoet_subscribe_old_woocommerce_customers","enabled");return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(h,{title:(0,o.t)("subscribeOldWCTitle"),description:(0,o.t)("subscribeOldWCDescription"),htmlFor:"mailpoet_subscribe_old_wc_customers"}),(0,p.jsx)(x,{children:(0,p.jsx)(M.X,{id:"mailpoet_subscribe_old_wc_customers",automationId:"mailpoet_subscribe_old_wc_customers",checked:"1"===e,onCheck:e=>t(e?"1":"")})})]})}function Le(){return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(Oe.R,{}),(0,p.jsxs)("div",{className:"mailpoet-settings-grid",children:[(0,p.jsx)($e,{}),(0,p.jsx)(Ye,{}),(0,p.jsx)(He,{}),(0,p.jsx)(k,{})]})]})}function Re(){const e=(0,_.v9)("isSaving")(),t=(0,_.v9)("hasWooCommerce")();return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(d.D,{}),e&&(0,p.jsx)(l.g,{}),(0,p.jsx)(r.w,{}),(0,p.jsx)(u.D,{storeName:"mailpoet-settings"}),(0,p.jsxs)(c.t,{activeKey:"basics",children:[(0,p.jsx)(m.O,{title:(0,o.t)("basicsTab"),automationId:"basic_settings_tab",children:(0,p.jsx)(V,{})},"basics"),(0,p.jsx)(m.O,{title:(0,o.t)("signupConfirmationTab"),automationId:"signup_settings_tab",children:(0,p.jsx)(Be,{})},"signup"),(0,p.jsx)(m.O,{route:"mta/:subPage?",title:(0,o.t)("sendWithTab"),automationId:"send_with_settings_tab",children:(0,p.jsx)(ze,{})},"mta"),t&&(0,p.jsx)(m.O,{title:(0,o.t)("wooCommerceTab"),automationId:"woocommerce_settings_tab",children:(0,p.jsx)(Le,{})},"woocommerce"),(0,p.jsx)(m.O,{title:(0,o.t)("advancedTab"),automationId:"settings-advanced-tab",children:(0,p.jsx)(ne,{})},"advanced"),(0,p.jsx)(m.O,{title:(0,o.t)("keyActivationTab"),automationId:"activation_settings_tab",children:(0,p.jsx)(de,{subscribersCount:window.mailpoet_subscribers_count})},"premium")]})]})}var We=i(89912);function Ve(){return(0,p.jsx)(n.k.Provider,{value:(0,n.S)(window),children:(0,p.jsx)(Re,{})})}const Ke=document.getElementById("settings_container");Ke&&((0,We.registerTranslations)(),(0,a.N)(),(0,s.s)(Ke).render((0,p.jsx)(Ve,{})))},65311:function(e){e.exports=jQuery}},function(e){e.O(0,[351],(function(){return 68062,e(e.s=68062)})),e.O()}]);