| Server IP : 104.26.3.156 / Your IP : 216.73.216.185 Web Server : nginx/1.27.1 System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64 User : vinodai ( 3134) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v1396/themastermynd/public_html/wp-content/plugins/mailpoet/assets/dist/js/ |
Upload File : |
"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[662],{32162(t,e,a){var o={};a.r(o),a.d(o,{deleteAutomation:()=>R,duplicateAutomation:()=>D,loadAutomations:()=>O,restoreAutomation:()=>M,trashAutomation:()=>I});var i={};a.r(i),a.d(i,{deleteLegacyAutomation:()=>K,loadLegacyAutomations:()=>z,restoreLegacyAutomation:()=>W,trashLegacyAutomation:()=>J});var s={};a.r(s),a.d(s,{getAllAutomations:()=>Z,getAutomationCount:()=>tt,getAutomations:()=>Q,getLegacyAutomations:()=>X});var n=a(7378),r=a(79124),l=a(34662),u=a(25354),m=a(91923),c=a(51751),d=a(14762),p=a(65591),h=a(10812),g=a(77327),_=a(69360);const A="mailpoet/automation-listing";var y=a(89074),f=a(95924),w=a(91736),b=a(73201),x=a(69611),T=a(69139),j=a(62623),v=a(37048),S=a(59717),N=a(86106);function E({automation:t,previousStatus:e}){const{restoreAutomation:a}=(0,S.A)(A);return(0,N.jsx)(x.Ay,{variant:"link",onClick:()=>{a(t,e)},children:(0,T.__)("Undo","mailpoet")})}var k=a(85123),U=a(92794);function L(t){return t.isLegacy?`?page=mailpoet-newsletter-editor&id=${t.id}`:(0,k.F)(U.U.urls.automationEditor,{id:t.id})}const C=(t,e)=>(0,b.J)(j.store).createSuccessNotice(t,e),P=t=>!1!==t?.showSuccessNotice;function*O(){const t=yield(0,w.apiFetch)({path:"/automations"});return{type:"SET_AUTOMATIONS",automations:Array.isArray(t.data?.items)?t.data.items:[]}}function*D(t,e){const a=yield(0,w.apiFetch)({path:`/automations/${t.id}/duplicate`,method:"POST"});return P(e)&&C((0,T.sprintf)((0,T.__)('Automation "%s" was duplicated.',"mailpoet"),t.name)),{type:"ADD_AUTOMATION",automation:a.data}}function*I(t,e){const a=yield(0,w.apiFetch)({path:`/automations/${t.id}`,method:"PUT",data:{status:v.i.TRASH}}),o=(0,T.sprintf)((0,T.__)('Automation "%s" was moved to the trash.',"mailpoet"),t.name);return P(e)&&C(o,{id:`automation-trashed-${t.id}`,__unstableHTML:(0,N.jsxs)("p",{children:[o," ",(0,N.jsx)(E,{automation:t,previousStatus:t.status})]})}),{type:"UPDATE_AUTOMATION",automation:a.data}}function*M(t,e,a){const o=yield(0,w.apiFetch)({path:`/automations/${t.id}`,method:"PUT",data:{status:e}});var i;i=`automation-trashed-${t.id}`,(0,b.J)(j.store).removeNotice(i);const s=(0,T.sprintf)((0,T.__)('Automation "%s" was restored from the trash.',"mailpoet"),t.name);return P(a)&&C(s,{__unstableHTML:(0,N.jsxs)("p",{children:[s," ",(0,N.jsx)(x.Ay,{variant:"link",href:L(t),children:(0,T.__)("Edit automation","mailpoet")})]})}),{type:"UPDATE_AUTOMATION",automation:o.data}}function*R(t,e){return yield(0,w.apiFetch)({path:`/automations/${t.id}`,method:"DELETE"}),P(e)&&C((0,T.sprintf)((0,T.__)('Automation "%s" and all associated data were permanently deleted.',"mailpoet"),t.name)),{type:"DELETE_AUTOMATION",automation:t}}var $=a(73193);const F=window.mailpoet_roles||{},H=window.mailpoet_segments||[],Y=window.mailpoet_woocommerce_automatic_emails||{},B=t=>{const e="welcome"===t.type?(t=>{const e=t.options;if("user"===e.event)return"mailpoet_all"===e.role?(0,T.__)("Sent when a new WordPress user is added to your site.","mailpoet"):(0,T.sprintf)((0,T.__)("Sent when a new WordPress user with the role %s is added to your site.","mailpoet"),F[e.role]);const a=Object.values(H).find(({id:t})=>Number(t)===Number(e.segment));return void 0===a?(0,N.jsx)("a",{href:`/send/${t.id}`,children:(0,T.__)("You need to select a list to send to.","mailpoet")}):(0,T.sprintf)((0,T.__)("Sent when someone subscribes to the list: %s.","mailpoet"),a.name)})(t):(t=>{const e=t.options,a=Y[e.group].events[e.event];let o;try{o=JSON.parse(e.meta??null)}catch(t){o=e.meta??null}const i=o&&o.option&&Array.isArray(o.option)?o.option.map(({name:t})=>t):[];if(o&&0===i.length)return(0,N.jsx)("span",{className:"mailpoet-listing-error",children:(0,T.__)("You need to configure email options before this email can be sent.","mailpoet")});const s=i.length>1&&"listingScheduleDisplayTextPlural"in a?a.listingScheduleDisplayTextPlural:a.listingScheduleDisplayText;return(0,T.sprintf)(s.endsWith(".")?s:`${s}.`,i.join(", "))})(t),a=e?(t=>{const e=t.options;if("immediate"===e.afterTimeType)return;const a=e.afterTimeNumber;switch(e.afterTimeType){case"minutes":return(0,T.sprintf)((0,T.__)("%d minute(s) later","mailpoet"),a);case"hours":return(0,T.sprintf)((0,T.__)("%d hour(s) later","mailpoet"),a);case"days":return(0,T.sprintf)((0,T.__)("%d day(s) later","mailpoet"),a);case"weeks":return(0,T.sprintf)((0,T.__)("%d week(s) later","mailpoet"),a);default:return(0,T.__)("Invalid sending delay.","mailpoet")}})(t):void 0;return e?(0,N.jsxs)(N.Fragment,{children:[e,a&&(0,N.jsxs)(N.Fragment,{children:[" ",a]})]}):void 0},G=(t,e)=>(0,b.J)(j.store).createSuccessNotice(t,e),q=t=>!1!==t?.showSuccessNotice,V=t=>({id:t.id,name:t.subject,status:t.deleted_at?v.i.TRASH:t.status,stats:{totals:{entered:t.total_scheduled+t.total_sent,in_progress:t.total_scheduled,exited:t.total_sent}},isLegacy:!0,description:B(t)});function*z(){return{type:"SET_LEGACY_AUTOMATIONS",automations:(yield(0,w.__unstableAwaitPromise)(Promise.all([(0,$.M)("welcome"),(0,$.M)("automatic")]))).flatMap(t=>t).map(V)}}function*J(t,e){return yield(0,w.__unstableAwaitPromise)((0,$.k)({endpoint:"newsletters",method:"trash","data[id]":`${t.id}`})),q(e)&&G((0,T.sprintf)((0,T.__)('Automation "%s" was moved to the trash.',"mailpoet"),t.name)),{type:"UPDATE_LEGACY_AUTOMATION_STATUS",id:t.id,status:v.i.TRASH}}function*W(t,e){const a=yield(0,w.__unstableAwaitPromise)((0,$.k)({endpoint:"newsletters",method:"restore","data[id]":`${t.id}`}));var o;return o=`automation-trashed-${t.id}`,(0,b.J)(j.store).removeNotice(o),q(e)&&G((0,T.sprintf)((0,T.__)('Automation "%s" was restored from the trash.',"mailpoet"),t.name)),{type:"UPDATE_LEGACY_AUTOMATION_STATUS",id:t.id,status:a.data.status}}function*K(t,e){return yield(0,w.__unstableAwaitPromise)((0,$.k)({endpoint:"newsletters",method:"delete","data[id]":`${t.id}`})),q(e)&&G((0,T.sprintf)((0,T.__)('Automation "%s" and all associated data were permanently deleted.',"mailpoet"),t.name)),{type:"DELETE_LEGACY_AUTOMATION",id:t.id}}function Q(t){return t.automations}function X(t){return t.legacyAutomations}function Z(t){return t.automations&&t.legacyAutomations?[...t.automations,...t.legacyAutomations]:void 0}function tt(t){return t.automations&&t.legacyAutomations?t.automations.length+t.legacyAutomations.length:_.automationCount+_.legacyAutomationCount}var et=a(94779),at=a(53169),ot=a(58295),it=a(90708),st=a(93062),nt=a(45372),rt=a(4686),lt=a(81667),ut=a(80307);const mt=[{id:"name",label:(0,T.__)("Name","mailpoet"),type:"text",enableGlobalSearch:!0,enableSorting:!0,render:({item:t})=>(0,N.jsx)("a",{href:L(t),children:t.name})},{id:"description",label:(0,T.__)("Description","mailpoet"),enableGlobalSearch:!1,enableSorting:!1,enableHiding:!1,render:({item:t})=>t.description?(0,N.jsx)("div",{children:t.description}):null},{id:"subscribers",label:(0,T.__)("Subscribers","mailpoet"),enableGlobalSearch:!1,enableSorting:!1,getValue:({item:t})=>t.stats.totals.entered,render:({item:t})=>(0,N.jsx)(ut.K,{labelPosition:"after",items:[{key:"entered",label:(0,T._x)("Entered","automation stats","mailpoet"),value:t.stats.totals.entered},{key:"processing",label:(0,T._x)("Processing","automation stats","mailpoet"),value:t.stats.totals.in_progress},{key:"exited",label:(0,T._x)("Exited","automation stats","mailpoet"),value:t.stats.totals.exited}]})},{id:"status",label:(0,T.__)("Status","mailpoet"),enableGlobalSearch:!1,enableSorting:!1,getValue:({item:t})=>t.status,render:({item:t})=>(0,N.jsx)("span",{className:"mailpoet-automation-listing-cell-status",children:(0,N.jsx)(lt.iM,{status:t.status})})}],ct={type:"table",perPage:25,page:1,fields:["subscribers","status"],titleField:"name",descriptionField:"description",showTitle:!0,showDescription:!0,layout:{styles:{subscribers:{minWidth:"360px"},status:{width:"120px"}}}},dt=["all",v.i.ACTIVE,v.i.DRAFT,v.i.TRASH];function pt(t){if(!t)return;const e=Number(t);return Number.isInteger(e)&&e>0?e:void 0}function ht(t){const e=t.get("status");return dt.includes(e)?e:"all"}function gt(t,e=ct){const a=t.get("order"),o=t.get("orderby");return{...e,page:pt(t.get("paged"))??e.page,perPage:pt(t.get("per_page"))??e.perPage,search:t.get("search")??void 0,sort:!o||"asc"!==a&&"desc"!==a?e.sort:{field:o,direction:a}}}function _t(t,e){return e>0?`${t} (${e})`:t}function At(t,e){switch(t){case"duplicate":return e.filter(t=>!t.isLegacy&&t.status!==v.i.TRASH);case"trash":return e.filter(t=>t.status!==v.i.TRASH);case"restore":case"delete":return e.filter(t=>t.status===v.i.TRASH);default:return[]}}function yt(){return(0,N.jsx)(rt.z,{heading:(0,T.__)("Automations","mailpoet"),children:(0,N.jsx)("a",{href:U.U.urls.automationTemplates,className:"page-title-action",children:(0,T.__)("Add new automation","mailpoet")})})}function ft(){const t=(0,st.Zp)(),e=(0,st.zy)(),a=(0,n.useMemo)(()=>(0,nt.Aq)("automation",ct,mt),[]),[o,i]=(0,n.useState)(()=>ht(new URLSearchParams(e.search))),[s,r]=(0,n.useState)(()=>gt(new URLSearchParams(e.search),a)),[l,u]=(0,n.useState)([]),[m,d]=(0,n.useState)(null),p=(0,n.useRef)(o),h=(0,n.useRef)(s),g=(0,c.A)(t=>t(A).getAllAutomations()),{loadAutomations:y,loadLegacyAutomations:f,restoreAutomation:w,restoreLegacyAutomation:x,duplicateAutomation:E,trashAutomation:C,trashLegacyAutomation:P,deleteAutomation:O,deleteLegacyAutomation:D}=(0,S.A)(A);(0,n.useEffect)(()=>{y(),f()},[y,f]),(0,n.useEffect)(()=>{p.current=o,h.current=s},[o,s]),(0,n.useEffect)(()=>{const t=new URLSearchParams(e.search),a=ht(t),o=(0,nt.Aq)("automation",ct,mt);let s=!1;a!==p.current&&(i(a),s=!0),function(t,e,a=ct){const o=gt(e,a);return(t.page??1)===(o.page??1)&&(t.perPage??25)===(o.perPage??25)&&(t.search??"")===(o.search??"")&&(t.sort?.field??"")===(o.sort?.field??"")&&(t.sort?.direction??"")===(o.sort?.direction??"")}(h.current,t,o)||(r(gt(t,o)),s=!0),s&&u([])},[e.search]);const I=(0,n.useCallback)((a,o)=>{const i=new URLSearchParams(e.search);i.set("status",a),(o.page??1)>1?i.set("paged",String(o.page)):i.delete("paged");const s=(0,nt.Aq)("automation",ct,mt).perPage??25;(o.perPage??s)!==s?i.set("per_page",String(o.perPage)):i.delete("per_page"),o.search?i.set("search",o.search):i.delete("search"),o.sort?(i.set("orderby",o.sort.field),i.set("order",o.sort.direction)):(i.delete("orderby"),i.delete("order"));const n=e.search.startsWith("?")?e.search.slice(1):e.search,r=i.toString();r!==n&&t({search:r})},[e.search,t]),M=(0,n.useCallback)(t=>{u([]),r(t),I(o,t)},[o,I]),R=(0,nt.wh)("automation",s,M),$=(0,n.useMemo)(()=>{const t={all:[],[v.i.ACTIVE]:[],[v.i.DRAFT]:[],[v.i.TRASH]:[]};return(g??[]).forEach(e=>{e.status in t&&t[e.status].push(e),e.status!==v.i.TRASH&&t.all.push(e)}),t},[g]),F=_.automationCount+_.legacyAutomationCount,{data:H,paginationInfo:Y}=(0,n.useMemo)(()=>{if(!g)return{data:[],paginationInfo:{totalItems:F,totalPages:Math.ceil(F/(s.perPage??25))}};const t=$[o]??[];return(0,ot.A)(t,s,mt)},[g,o,$,F,s]);(0,n.useEffect)(()=>{const t=s.page??1,e=Y.totalPages;g&&e>0&&t>e&&M({...s,page:e})},[g,M,Y.totalPages,s]);const B=(0,n.useMemo)(()=>[{name:"all",title:_t((0,T.__)("All","mailpoet"),$.all.length),className:"mailpoet-dataviews-group-all mailpoet-tab-all"},{name:v.i.ACTIVE,title:_t((0,T.__)("Active","mailpoet"),$[v.i.ACTIVE].length),className:"mailpoet-tab-active"},{name:v.i.DRAFT,title:_t((0,T._x)("Inactive","noun","mailpoet"),$[v.i.DRAFT].length),className:"mailpoet-tab-draft"},{name:v.i.TRASH,title:_t((0,T._x)("Trash","noun","mailpoet"),$[v.i.TRASH].length),className:"mailpoet-dataviews-group-trash mailpoet-tab-trash"}],[$]),G=(0,n.useCallback)(async(t,e)=>{const a=At(t,e);if(0===a.length)return;const o=1===a.length,i={showSuccessNotice:o};var s;await Promise.all(a.map(e=>"duplicate"===t?E(e,i):"trash"===t?(e.isLegacy?P:C)(e,i):"restore"===t?e.isLegacy?x(e,i):w(e,v.i.DRAFT,i):(e.isLegacy?D:O)(e,i))),o||(s=function(t,e){return"duplicate"===t?(0,T.sprintf)((0,T._n)("%d automation was duplicated.","%d automations were duplicated.",e,"mailpoet"),e):"trash"===t?(0,T.sprintf)((0,T._n)("%d automation was moved to the trash.","%d automations were moved to the trash.",e,"mailpoet"),e):"restore"===t?(0,T.sprintf)((0,T._n)("%d automation was restored from the trash.","%d automations were restored from the trash.",e,"mailpoet"),e):(0,T.sprintf)((0,T._n)("%d automation was permanently deleted.","%d automations were permanently deleted.",e,"mailpoet"),e)}(t,a.length),(0,b.J)(j.store).createSuccessNotice(s)),u([])},[O,D,E,w,x,C,P]),q=(0,n.useCallback)(()=>{m&&(G(m.action,m.targets),d(null))},[m,G]),V=(0,n.useMemo)(()=>[{id:"analytics",label:(0,T.__)("Analytics","mailpoet"),isPrimary:!0,supportsBulk:!1,callback:t=>{var e;t[0]&&(window.location.href=(e=t[0]).isLegacy?`?page=mailpoet-newsletters&context=automation#/stats/${e.id}`:(0,k.F)(U.U.urls.automationAnalytics,{id:e.id}))}},{id:"edit",label:(0,T.__)("Edit","mailpoet"),icon:"edit",isPrimary:!0,supportsBulk:!1,callback:t=>{t[0]&&(window.location.href=L(t[0]))}},{id:"duplicate",label:(0,T.__)("Duplicate","mailpoet"),supportsBulk:!0,isEligible:t=>!t.isLegacy&&t.status!==v.i.TRASH,callback:t=>{G("duplicate",t)}},{id:"trash",label:(0,T._x)("Trash","verb","mailpoet"),supportsBulk:!0,isEligible:t=>t.status!==v.i.TRASH,callback:t=>{const e=At("trash",t);e.length>0&&d({action:"trash",targets:e})}},{id:"restore",label:(0,T.__)("Restore","mailpoet"),supportsBulk:!0,isEligible:t=>t.status===v.i.TRASH,callback:t=>{G("restore",t)}},{id:"delete",label:(0,T.__)("Delete permanently","mailpoet"),supportsBulk:!0,isDestructive:!0,isEligible:t=>t.status===v.i.TRASH,callback:t=>{const e=At("delete",t);e.length>0&&d({action:"delete",targets:e})}}],[G]),z=o===v.i.TRASH?(0,T.__)("Trash is empty.","mailpoet"):(0,T.__)("No automations found.","mailpoet"),J=function(t){if(!t)return{title:"",message:"",confirmText:""};const e=t.targets.length,a=t.targets.map(t=>`"${t.name}"`).join(", ");return"trash"===t.action?{title:(0,T._n)("Trash automation","Trash automations",e,"mailpoet"),message:(0,T.sprintf)((0,T._n)("Are you sure you want to move the automation %s to the Trash?","Are you sure you want to move the automations %s to the Trash?",e,"mailpoet"),a),confirmText:(0,T.__)("Yes, move to trash","mailpoet")}:{title:(0,T._n)("Permanently delete automation","Permanently delete automations",e,"mailpoet"),message:(0,T.sprintf)((0,T._n)("Are you sure you want to permanently delete %s and all associated data? This cannot be undone!","Are you sure you want to permanently delete %s and all associated data? This cannot be undone!",e,"mailpoet"),a),confirmText:(0,T.__)("Yes, permanently delete","mailpoet")}}(m);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(et.A,{className:"mailpoet-dataviews__tabs",activeClass:"is-active",tabs:B,initialTabName:o,onSelect:t=>{if(!dt.includes(t))return;const e=t;if(e===o)return;const a={...s,page:1};i(e),u([]),r(a),I(e,a)},children:()=>(0,N.jsx)("div",{className:"mailpoet-dataviews mailpoet-automation-dataviews","data-automation-id":"automation_listing",children:(0,N.jsxs)(it.A,{data:H,fields:mt,view:s,onChangeView:R,actions:V,paginationInfo:Y,defaultLayouts:{table:{}},getItemId:t=>`${t.isLegacy?"legacy":"automation"}-${t.id}`,selection:l,onChangeSelection:u,isLoading:!g,empty:(0,N.jsx)("div",{children:z}),children:[(0,N.jsxs)("div",{className:"mailpoet-dataviews__toolbar",children:[(0,N.jsx)(it.A.Search,{label:(0,T.__)("Search automations","mailpoet")}),(0,N.jsx)("div",{className:"mailpoet-dataviews__toolbar-end",children:(0,N.jsx)(it.A.ViewConfig,{})})]}),(0,N.jsx)(it.A.Layout,{}),(0,N.jsx)(it.A.Footer,{})]},o)})},o),(0,N.jsx)(at.A,{className:"mailpoet-confirm-dialog",isOpen:!!m,title:J.title,confirmButtonText:J.confirmText,__experimentalHideHeader:!1,onConfirm:q,onCancel:()=>d(null),children:J.message})]})}var wt=a(35843),bt=a(88138),xt=a(42176),Tt=a(90194),jt=a(45919);function vt({controls:t,title:e,onClick:a,variant:o}){const[i,s]=(0,n.useState)(!1),r=Object.values(t).filter(t=>t.slot),l=i?"mailpoet-option-button-opener is-busy":"mailpoet-option-button-opener";return(0,N.jsxs)("div",{className:"mailpoet-option-button",children:[(0,N.jsx)(x.Ay,{isBusy:i,disabled:i,variant:o,className:"mailpoet-option-button-main",onClick:()=>{s(!0),a(s)},children:e}),r.length>0&&r.map(({key:t,slot:e})=>(0,N.jsx)(e,{},t)),Object.values(t).length>0&&(0,N.jsx)(Tt.A,{className:l,label:(0,T.__)("More","mailpoet"),icon:jt.A,controls:Object.values(t).map(t=>({...t.control,onClick:()=>{s(!0),t.control.onClick()}})),popoverProps:{placement:"bottom-start"}})]})}function St(){const t=xt.Hooks.applyFilters("mailpoet.automation.hero.actions",{});return(0,N.jsx)("section",{className:"mailpoet-automation-section mailpoet-automation-white-background",children:(0,N.jsxs)("div",{className:"mailpoet-automation-section-content mailpoet-automation-section-hero",children:[(0,N.jsxs)("div",{children:[(0,N.jsx)("span",{className:"mailpoet-automation-preheading",children:(0,T.__)("Automations","mailpoet")}),(0,N.jsx)("h1",{children:(0,T.__)("Better engagement begins with automation","mailpoet")}),(0,N.jsx)("p",{children:(0,T.__)("Send emails that inform, reward, and engage your audience through powerful segmenting, scheduling, and design tools.","mailpoet")}),(0,N.jsx)(vt,{variant:"primary",onClick:()=>{window.location.href=U.U.urls.automationTemplates},title:(0,T.__)("Start with a template","mailpoet"),controls:t})]}),(0,N.jsx)("img",{src:`${U.U.cdnUrl}automation/sections/hero.png`,alt:(0,T.__)("Welcome","mailpoet")})]})})}var Nt=a(328),Et=a(8666);function kt(){const t=Nt.X.slice(0,3);return(0,N.jsx)("section",{className:"mailpoet-automation-section",children:(0,N.jsxs)("div",{className:"mailpoet-automation-section-content mailpoet-section-templates",children:[(0,N.jsx)("h2",{children:(0,T.__)("Explore essentials","mailpoet")}),(0,N.jsx)("p",{children:(0,T.__)("Choose from our list of pre-made templates and make it your own.","mailpoet")}),(0,N.jsx)("ul",{className:"mailpoet-section-template-list",children:(0,N.jsx)(Et.i,{templates:t})}),(0,N.jsx)(x.Ay,{variant:"link",href:U.U.urls.automationTemplates,children:(0,T.__)("Browse all templates →","mailpoet")})]})})}function Ut(){const[t,e]=(0,n.useState)("start-with-a-trigger"),a=[{slug:"start-with-a-trigger",title:(0,T.__)("Start with a trigger","mailpoet"),text:(0,T.__)("Deliver relevant messages to your customers based on who they are and how they interact with your business.","mailpoet"),image:`${U.U.cdnUrl}automation/sections/start-with-a-trigger.png`},{slug:"customize-your-automation",title:(0,T.__)("Customize your automation","mailpoet"),text:(0,T.__)("Choose steps and create a custom journey to best suit your needs.","mailpoet"),image:`${U.U.cdnUrl}automation/sections/customize-your-automation.png`},{slug:"design-your-email",title:(0,T.__)("Design your email","mailpoet"),text:(0,T.__)("Modify one of our pre-made email templates or create your own design.","mailpoet"),image:`${U.U.cdnUrl}automation/sections/design-your-email.png`},{slug:"start-engaging",title:(0,T.__)("Start engaging","mailpoet"),text:(0,T.__)("Activate the automation and start engaging with your customers as they interact with your business.","mailpoet"),image:`${U.U.cdnUrl}automation/sections/start-engaging.png`}],o=a.filter(e=>e.slug===t)[0];return(0,N.jsx)("section",{className:"mailpoet-automation-section mailpoet-automation-white-background",children:(0,N.jsxs)("div",{className:"mailpoet-automation-section-content mailpoet-section-build-your-own",children:[(0,N.jsxs)("div",{children:[(0,N.jsx)("h2",{children:(0,T.__)("Build your own automations","mailpoet")}),(0,N.jsx)("p",{children:(0,T.__)("Create customized email sequences with our new automation editor.","mailpoet")}),(0,N.jsx)("ol",{children:a.map((a,o)=>(0,N.jsxs)("li",{className:t===a.slug?"open":"",children:[(0,N.jsx)("div",{className:"marker",children:o<10?`0${o+1}`:o+1}),(0,N.jsxs)("div",{children:[(0,N.jsx)("button",{type:"button",onClick:()=>e(a.slug),className:"mailpoet-section-build-list-button",children:a.title}),(0,N.jsx)("p",{children:a.text})]})]},a.slug))})]}),(0,N.jsx)("img",{src:o.image,alt:o.title})]})})}var Lt=a(10995),Ct=a(27314),Pt=a(98933),Ot=a(14442);const Dt=(0,Pt.qN)();function It(){const t=(0,n.useCallback)(()=>{(0,$.k)({endpoint:"UserFlags",method:"set","data[legacy_automations_notice_dismissed]":"1"})},[]);return(0,N.jsx)(Ot.$,{type:"info",timeout:!1,closable:!0,renderInPlace:!0,onClose:t,children:(0,N.jsx)("p",{children:Dt?(0,T.__)("Your existing automations are now listed here. You can also create new, more powerful automations with our new Automations editor.","mailpoet"):(0,Ct.A)((0,T.__)("Your existing automations are now listed here. You can also create new, more powerful automations with our new Automations editor. <link>Learn more</link>","mailpoet"),{link:(0,N.jsx)("a",{href:"https://kb.mailpoet.com/article/397-how-to-set-up-an-automation",target:"_blank",rel:"noopener noreferrer"})})})})}function Mt(){const[t,e]=(0,n.useState)(!0),a=(0,c.A)(t=>t(A).getAutomationCount());(0,n.useEffect)(()=>{t&&0!==a&&(U.U.trackEvent("Automations > Listing viewed"),e(!1))},[t,a]);const o=a>0?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(yt,{}),_.legacyAutomationCount>0&&!window.mailpoet_legacy_automations_notice_dismissed&&(0,N.jsx)(It,{}),(0,N.jsx)(ft,{})]}):(0,N.jsx)(St,{});return(0,n.useEffect)(()=>{const t="mailpoet-automation-is-onboarding",e=document.querySelector("body");0!==a||e.classList.contains(t)||e.classList.add(t),a>0&&e.classList.contains(t)&&e.classList.remove(t)},[a]),(0,N.jsxs)(N.Fragment,{children:[o,(0,N.jsx)(kt,{}),(0,N.jsx)(Ut,{})]})}function Rt(){return(0,Lt.A)(),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(u.x,{}),(0,N.jsx)(p.D,{}),(0,N.jsx)(bt.q,{}),(0,N.jsx)(h.D,{}),(0,N.jsx)(Mt,{})]})}function $t(){return(0,N.jsx)(m.Kq,{children:(0,N.jsx)(l.BrowserRouter,{basename:new URL(U.U.urls.automationListing).pathname,children:(0,N.jsx)(Rt,{})})})}window.addEventListener("DOMContentLoaded",()=>{(()=>{const t=(0,y.A)(A,{actions:{...o,...i},controls:w.controls,selectors:s,reducer:(t,e)=>function(t,e){switch(e.type){case"SET_LEGACY_AUTOMATIONS":return{...t,legacyAutomations:e.automations};case"UPDATE_LEGACY_AUTOMATION_STATUS":return{...t,legacyAutomations:t.legacyAutomations.map(t=>t.id===e.id?{...t,status:e.status}:t)};case"DELETE_LEGACY_AUTOMATION":return{...t,legacyAutomations:t.legacyAutomations.filter(t=>t.id!==e.id)};default:return t}}(function(t,e){switch(e.type){case"SET_AUTOMATIONS":return{...t,automations:e.automations};case"ADD_AUTOMATION":return{...t,automations:[e.automation,...t.automations]};case"UPDATE_AUTOMATION":return{...t,automations:t.automations.map(t=>t.id===e.automation.id?e.automation:t)};case"DELETE_AUTOMATION":return{...t,automations:t.automations.filter(t=>t.id!==e.automation.id)};default:return t}}(t,e),e),initialState:{automations:void 0,legacyAutomations:void 0}});(0,f.register)(t)})();const t=document.getElementById("mailpoet_automation");t&&((0,d.registerTranslations)(),(0,wt._)(),(0,g.b)(),(0,r.H)(t).render((0,N.jsx)($t,{})))})},41669(t){t.exports=jQuery}},t=>{t.O(0,[223],()=>t(t.s=32162)),t.O()}]);