403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.145.163.242
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/thread-self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/assets/dist/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/thread-self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/assets/dist/js//automation_editor.js
"use strict";(globalThis.webpackChunk=globalThis.webpackChunk||[]).push([[392],{77978:(e,t,a)=>{var i=a(65443),o=a.n(i),s=a(99581),n=a(70079),r=a(93850),l=a(3939),c=a(82248),d=a(59216),m=a(46824),u=a(81433),p=a(10159),h=a(15063),_=a(64645),v=a(17834),b=a(18883),x=a(7936),g=a(15312),j=a(83201),N=a(650),f=a(23351),y=a(63983),Z=a(48405),S=a(85180),A=a(96061),w=a(71458),k=a(50899),D=a(82963),C=a(87036),E=a(46583),I=a(96328),T=a(73496),P=a(8131),F=a(35250);function L(e){let{children:t}=e;const{automationName:a,automationStatus:i,showIconLabels:o}=(0,p.Z)((e=>({automationName:e(T.storeName).getAutomationData().name,automationStatus:e(T.storeName).getAutomationData().status,showIconLabels:e(T.storeName).isFeatureActive("showIconLabels")})),[]),s=(0,n.useRef)();let r="mailpoet-automation-editor-chip-gray";return i===P.b.ACTIVE?r="mailpoet-automation-editor-chip-success":i===P.b.DEACTIVATING&&(r="mailpoet-automation-editor-chip-danger"),(0,F.jsx)("div",{className:"edit-site-document-actions has-secondary-label",children:(0,F.jsx)("div",{ref:s,className:"edit-site-document-actions__title-wrapper",children:t&&(0,F.jsx)(D.Z,{popoverProps:{placement:"bottom",anchor:s.current},renderToggle:e=>{let{isOpen:t,onToggle:s}=e;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(l.ZP,{className:"mailpoet-automation-editor-dropdown-toggle-link",onClick:s,children:[(0,F.jsxs)(C.Z,{size:"body",className:"edit-site-document-actions__title",as:"h1",children:[(0,F.jsx)(E.Z,{as:"span",children:(0,x.__)("Editing automation:","mailpoet")}),a]}),(0,F.jsxs)(C.Z,{size:"body",className:`edit-site-document-actions__secondary-item ${r}`,children:[i===P.b.ACTIVE&&(0,x.__)("Active","mailpoet"),i===P.b.DEACTIVATING&&(0,x.__)("Deactivating","mailpoet"),i===P.b.DRAFT&&(0,x.__)("Draft","mailpoet")]})]}),(0,F.jsx)(l.ZP,{className:"edit-site-document-actions__get-info",icon:I.Z,"aria-expanded":t,"aria-haspopup":"true",onClick:s,label:(0,x.__)("Change automation name","mailpoet"),children:o&&(0,x.__)("Rename","mailpoet")})]})},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:t})})})}L.displayName="DocumentActions";var O=a(83453),V=a(77996),R=a(60369),K=a(18981),B=a(34726);const G=d.Z,M=(0,n.createContext)(void 0);function U(e){let{stepId:t}=e;const a=(0,n.useContext)(M),{steps:i,automationData:o}=(0,p.Z)((e=>({steps:e(T.storeName).getSteps(),automationData:e(T.storeName).getAutomationData()})),[]),{openSidebar:s,selectStep:r}=(0,Z.Z)(T.storeName),l=o.steps[t],c=i.find((e=>{let{key:t}=e;return t===l.key}));return(0,F.jsxs)(O.A,{className:"mailpoet-automation-step-error",role:"listitem",state:a,onClick:()=>{s(T.stepSidebarKey),r(l)},children:[(0,F.jsx)(B.O,{icon:c.icon,foreground:c.foreground,background:c.background,width:"23px",height:"23px"}),c.title(l,"other")]})}function z(){const[e,t]=(0,n.useState)(!1),a=(0,V.u)({orientation:"vertical",shift:!0}),{errors:i,automationData:o}=(0,p.Z)((e=>({errors:e(T.storeName).getErrors(),automationData:e(T.storeName).getAutomationData()})),[]),s=(0,n.useMemo)((()=>{if(!i)return[];const e=new Map,t=o.steps.root.next_steps.map((e=>{let{id:t}=e;return t}));for(;t.length>0;){const n=t.shift();var a,s;e.has(n)||(e.set(n,i.steps[n]),null===(a=o.steps[n])||void 0===a||null===(s=a.next_steps)||void 0===s||s.forEach((e=>t.push(e.id))))}return[...e.values()].filter((e=>!!e))}),[i,o]),r=s.length>0;return(0,n.useEffect)((()=>{r&&t(!0)}),[r]),0===s.length?null:(0,F.jsxs)("div",{children:[(0,F.jsx)(l.ZP,{variant:"link",onClick:()=>t((e=>void 0!==e&&!e)),onMouseDown:()=>t((e=>e?void 0:e)),style:{textDecoration:"none",borderRadius:99999},children:(0,F.jsxs)(K.A,{children:[s.length," issues"]})}),e&&(0,F.jsx)(G,{offset:10,placement:"bottom-end",onClose:()=>t((e=>void 0===e&&void 0)),children:(0,F.jsx)(M.Provider,{value:a,children:(0,F.jsxs)(R.b,{state:a,role:"list","aria-label":(0,x.__)("Automation errors","mailpoet"),className:"mailpoet-automation-errors",children:[(0,F.jsx)("div",{className:"mailpoet-automation-errors-header",children:(0,x.__)("The following steps are not fully set:","mailpoet")}),(0,F.jsx)(j.ErrorBoundary,{children:s.map((e=>(0,F.jsx)(U,{stepId:e.step_id},e.step_id)))})]})})})]})}U.displayName="StepError";var W=a(23315),q=a(74731);function H(){const{isInserterOpened:e,showIconLabels:t}=(0,p.Z)((e=>({isInserterOpened:e(T.storeName).isInserterSidebarOpened(),showIconLabels:e(T.storeName).isFeatureActive("showIconLabels")})),[]),{toggleInserterSidebar:a}=(0,Z.Z)(T.storeName);return(0,F.jsx)(W.Z,{as:l.ZP,className:"edit-site-header-toolbar__inserter-toggle",variant:"primary",isPressed:e,onMouseDown:e=>e.preventDefault(),onClick:a,icon:q.Z,label:(0,x.__)("Toggle step inserter","mailpoet"),showTooltip:!t,children:t&&(e?(0,x.__)("Close","mailpoet"):(0,x.__)("Add","mailpoet"))})}var $=a(26013),Y=a(44612),Q=a(15439),J=a(40806);function X(e){let{scope:t,name:a,label:i,info:o,messageActivated:s,messageDeactivated:r,shortcut:l,onToggle:c=(()=>null),disabled:d=!1}=e;const m=(0,p.Z)((e=>!!e(J.h).get(t,a)),[a]),{toggle:u}=(0,Z.Z)(J.h);return(0,n.createElement)(Y.Z,{icon:m&&w.Z,isSelected:m,onClick:()=>{c(),u(t,a),(()=>{if(m){const e=r||(0,x.sprintf)((0,x.__)("Preference deactivated - %s"),i);(0,Q.speak)(e)}else{const e=s||(0,x.sprintf)((0,x.__)("Preference activated - %s"),i);(0,Q.speak)(e)}})()},role:"menuitemcheckbox",info:o,shortcut:l,disabled:d},i)}var ee=a(17816);function te(){const e=(0,p.Z)((e=>e(T.storeName).getAutomationData()));return(0,F.jsx)(v.Eo,{className:"edit-site-more-menu",popoverProps:{className:"edit-site-more-menu__content"},children:()=>(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)($.Z,{label:(0,x._x)("View","noun","mailpoet"),children:(0,F.jsx)(X,{scope:T.storeName,name:"fullscreenMode",label:(0,x.__)("Fullscreen mode","mailpoet"),info:(0,x.__)("Work without distraction","mailpoet"),messageActivated:(0,x.__)("Fullscreen mode activated","mailpoet"),messageDeactivated:(0,x.__)("Fullscreen mode deactivated","mailpoet"),shortcut:k.displayShortcut.secondary("f")})}),(0,F.jsxs)($.Z,{children:[(0,F.jsx)(Y.Z,{onClick:()=>{window.location.href=(0,g.f)(ee.x.urls.automationAnalytics,{id:e.id})},children:(0,x.__)("Analytics","mailpoet")}),(0,F.jsx)(Y.Z,{onClick:()=>{window.location.href=ee.x.urls.automationListing},children:(0,x.__)("View all automations","mailpoet")})]})]})})}var ae=a(14134);function ie(e){let{onClose:t}=e;const[a,i]=(0,n.useState)(!1);return(0,F.jsxs)(ae.Z,{className:"mailpoet-automatoin-deactivate-modal",title:(0,x.__)("Stop automation for all subscribers?","mailpoet"),onRequestClose:t,children:[(0,F.jsx)("p",{children:(0,x.__)("Are you sure you want to deactivate now? This would stop this automation for all subscribers immediately.","mailpoet")}),(0,F.jsx)(l.ZP,{isBusy:a,variant:"primary",onClick:()=>{i(!0),(0,u.dispatch)(T.storeName).deactivate(!0)},children:(0,x.__)("Deactivate now","mailpoet")}),(0,F.jsx)(l.ZP,{disabled:a,variant:"tertiary",onClick:t,children:(0,x.__)("Cancel","mailpoet")})]})}function oe(e){let{onClose:t}=e;const{automationName:a}=(0,p.Z)((e=>({automationName:e(T.storeName).getAutomationData().name})),[]),[i,o]=(0,n.useState)(P.b.DEACTIVATING),[s,r]=(0,n.useState)(!1),c=(0,x.sprintf)((0,x.__)('Deactivate the "%s" automation?',"mailpoet"),a);return(0,F.jsxs)(ae.Z,{className:"mailpoet-automatoin-deactivate-modal",title:c,onRequestClose:t,children:[(0,x.__)("Some subscribers entered but have not finished the flow. Let's decide what to do in this case.","mailpoet"),(0,F.jsxs)("ul",{className:"mailpoet-automation-options",children:[(0,F.jsx)("li",{children:(0,F.jsxs)("label",{className:i===P.b.DEACTIVATING?"mailpoet-automation-option active":"mailpoet-automation-option",children:[(0,F.jsx)("span",{children:(0,F.jsx)("input",{type:"radio",disabled:s,name:"deactivation-method",checked:i===P.b.DEACTIVATING,onChange:()=>o(P.b.DEACTIVATING)})}),(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:(0,x.__)("Let entered subscribers finish the flow","mailpoet")}),(0,x.__)("New subscribers won't enter, but recently entered could proceed.","mailpoet")]})]})}),(0,F.jsx)("li",{children:(0,F.jsxs)("label",{className:i===P.b.DRAFT?"mailpoet-automation-option active":"mailpoet-automation-option",children:[(0,F.jsx)("span",{children:(0,F.jsx)("input",{type:"radio",disabled:s,name:"deactivation-method",checked:i===P.b.DRAFT,onChange:()=>o(P.b.DRAFT)})}),(0,F.jsxs)("span",{children:[(0,F.jsx)("strong",{children:(0,x.__)("Stop automation for all subscribers","mailpoet")}),(0,x.__)("Automation will be deactivated for all the subscribers immediately.","mailpoet")]})]})})]}),(0,F.jsx)(l.ZP,{isBusy:s,variant:"primary",onClick:()=>{r(!0),(0,u.dispatch)(T.storeName).deactivate(i!==P.b.DEACTIVATING)},children:(0,x.__)("Deactivate automation","mailpoet")}),(0,F.jsx)(l.ZP,{disabled:s,variant:"tertiary",onClick:t,children:(0,x.__)("Cancel","mailpoet")})]})}function se(e){let{label:t}=e;const{errors:a,isDeactivating:i}=(0,p.Z)((e=>({errors:e(T.storeName).getErrors(),isDeactivating:e(T.storeName).getAutomationData().status===P.b.DEACTIVATING})),[]),{openActivationPanel:o}=(0,Z.Z)(T.storeName),s=(0,F.jsx)(l.ZP,{variant:"primary",className:"editor-post-publish-button",onClick:o,disabled:i||!!a,children:t});return i?(0,F.jsx)(N.Z,{delay:0,text:(0,x.__)("Editing an active automation is temporarily unavailable. We are working on introducing this functionality.","mailpoet"),children:s}):s}function ne(){const{save:e}=(0,Z.Z)(T.storeName),{automation:t,savedState:a}=(0,p.Z)((e=>({automation:e(T.storeName).getAutomationData(),savedState:e(T.storeName).getSavedState()})),[]),i="saving"===a||"saved"===a,o="saving"===a?(0,x.__)("Updating…","mailpoet"):(0,x.__)("Update","mailpoet");return 0===t.stats.totals.in_progress?(0,F.jsx)(l.ZP,{variant:"primary",className:"editor-post-publish-button",label:o,showTooltip:!0,shortcut:i?void 0:k.displayShortcut.primary("s"),isBusy:"saving"===a,disabled:i,"aria-disabled":i,onClick:e,children:o}):(0,F.jsx)(N.Z,{delay:0,text:(0,x.__)("Editing an active automation is temporarily unavailable. We are working on introducing this functionality.","mailpoet"),children:(0,F.jsx)(l.ZP,{variant:"primary",className:"editor-post-publish-button",onClick:e,disabled:!0,children:(0,x.__)("Update","mailpoet")})})}function re(){const e=(0,p.Z)((e=>e(T.storeName).getSavedState()),[]),{save:t}=(0,Z.Z)(T.storeName),a=(0,n.useMemo)((()=>"saving"===e?(0,x.__)("Saving","mailpoet"):"saved"===e?(0,x.__)("Saved","mailpoet"):(0,x.__)("Save draft","mailpoet")),[e]),i="saving"===e||"saved"===e;return(0,F.jsxs)(l.ZP,{className:o()(["mailpoet-automation-editor-saved-state",`is-${e}`,{"components-animate__loading":"saving"===e}]),variant:"tertiary",label:a,shortcut:i?void 0:k.displayShortcut.primary("s"),showTooltip:!0,disabled:i,"aria-disabled":i,onClick:t,children:["saving"===e&&(0,F.jsx)(S.Z,{icon:A.Z}),"saved"===e&&(0,F.jsx)(S.Z,{icon:w.Z}),a]})}function le(){const[e,t]=(0,n.useState)(!1),[a,i]=(0,n.useState)(!1),{hasUsersInProgress:o}=(0,p.Z)((e=>({hasUsersInProgress:e(T.storeName).getAutomationData().stats.totals.in_progress>0})),[]);return(0,F.jsxs)(F.Fragment,{children:[e&&(0,F.jsx)(oe,{onClose:()=>{t(!1)}}),(0,F.jsx)(l.ZP,{isBusy:a,variant:"tertiary",onClick:()=>{o?t(!0):(i(!0),(0,u.dispatch)(T.storeName).deactivate())},children:(0,x.__)("Deactivate","mailpoet")})]})}function ce(){const[e,t]=(0,n.useState)(!1),[a,i]=(0,n.useState)(!1),{hasUsersInProgress:o}=(0,p.Z)((e=>({hasUsersInProgress:e(T.storeName).getAutomationData().stats.totals.in_progress>0})),[]);return(0,F.jsxs)(F.Fragment,{children:[e&&(0,F.jsx)(ie,{onClose:()=>{t(!1)}}),(0,F.jsx)(l.ZP,{isBusy:a,variant:"tertiary",onClick:()=>{o?t(!0):(i(!0),(0,u.dispatch)(T.storeName).deactivate())},children:(0,x.__)("Deactivate now","mailpoet")})]})}function de(e){let{showInserterToggle:t}=e;const{setAutomationName:a}=(0,Z.Z)(T.storeName),{automationName:i,automationStatus:o}=(0,p.Z)((e=>({automationName:e(T.storeName).getAutomationData().name,automationStatus:e(T.storeName).getAutomationData().status})),[]);return(0,F.jsxs)("div",{className:"edit-site-header-edit-mode",children:[(0,F.jsx)("div",{className:"edit-site-header-edit-mode_start",children:(0,F.jsx)(f.Z,{className:"edit-site-header-edit-mode__toolbar",orientation:"horizontal",role:"toolbar",children:t&&(0,F.jsx)(H,{})})}),(0,F.jsx)("div",{className:"edit-site-header-edit-mode_center",children:(0,F.jsx)(j.ErrorBoundary,{children:(0,F.jsx)(L,{children:()=>(0,F.jsxs)("div",{className:"mailpoet-automation-editor-dropdown-name-edit",children:[(0,F.jsx)("div",{className:"mailpoet-automation-editor-dropdown-name-edit-title",children:(0,x.__)("Automation name","mailpoet")}),(0,F.jsx)(y.Z,{value:i,onChange:e=>a(e),help:(0,x.__)('Give the automation a name that indicates its purpose. E.g. "Abandoned cart recovery"',"mailpoet")})]})})})}),(0,F.jsx)("div",{className:"edit-site-header-edit-mode_end",children:(0,F.jsxs)("div",{className:"edit-site-header-edit-mode__actions",children:[(0,F.jsx)(j.ErrorBoundary,{children:(0,F.jsx)(z,{})}),o===P.b.DRAFT&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(re,{}),(0,F.jsx)(se,{label:(0,x.__)("Activate","mailpoet")})]}),o===P.b.ACTIVE&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(le,{}),(0,F.jsx)(ne,{})]}),o===P.b.DEACTIVATING&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ce,{}),(0,F.jsx)(se,{label:(0,x.__)("Update & Activate","mailpoet")})]}),(0,F.jsx)(v.Ox.Slot,{scope:T.storeName}),(0,F.jsx)(te,{})]})})]})}function me(){const{isSidebarOpened:e,selectedStep:t,savedState:a}=(0,p.Z)((e=>({isSidebarOpened:e(T.storeName).isSidebarOpened,selectedStep:e(T.storeName).getSelectedStep,savedState:e(T.storeName).getSavedState()}))),{openSidebar:i,closeSidebar:o,save:s,toggleFeature:r}=(0,Z.Z)(T.storeName),{registerShortcut:l}=(0,Z.Z)(b.h);return(0,n.useEffect)((()=>{l({name:"mailpoet/automation-editor/toggle-fullscreen",category:"global",description:(0,x.__)("Toggle fullscreen mode.","mailpoet"),keyCombination:{modifier:"secondary",character:"f"}}),l({name:"mailpoet/automation-editor/toggle-sidebar",category:"global",description:(0,x.__)("Show or hide the settings sidebar.","mailpoet"),keyCombination:{modifier:"primaryShift",character:","}}),l({name:"mailpoet/automation-editor/save",category:"global",description:(0,x.__)("Save your changes.","mailpoet"),keyCombination:{modifier:"primary",character:"s"}})}),[l]),(0,b.bx)("mailpoet/automation-editor/toggle-fullscreen",(()=>{r("fullscreenMode")})),(0,b.bx)("mailpoet/automation-editor/toggle-sidebar",(a=>{if(a.preventDefault(),e())o();else{const e=t()?T.stepSidebarKey:T.automationSidebarKey;i(e)}})),(0,b.bx)("mailpoet/automation-editor/save",(e=>{e.preventDefault(),"unsaved"===a&&s()})),null}a(67823);var ue=a(23725),pe=a(48041),he=a(2734),_e=a(98377);const ve=(0,n.forwardRef)((function(e,t){let{className:a,children:i,spokenMessage:s=i,politeness:r="polite",actions:c=[],onRemove:d,icon:m=null,explicitDismiss:u=!1,onDismiss:p,listRef:h}=e;function _(e){var t;e&&e.preventDefault&&e.preventDefault(),null==h||null===(t=h.current)||void 0===t||t.focus(),null==p||p(),null==d||d()}!function(e,t){const a="string"==typeof e?e:(0,_e.ZP)(e);(0,n.useEffect)((()=>{a&&(0,Q.speak)(a,t)}),[a,t])}(s,r),(0,n.useEffect)((()=>{const e=setTimeout((()=>{u||(null==p||p(),null==d||d())}),1e4);return()=>clearTimeout(e)}),[p,d,u]);const v=o()(a,"components-snackbar",{"components-snackbar-explicit-dismiss":!!u});c&&c.length>1&&("undefined"!=typeof process&&process.env,c=[c[0]]);const b=o()("components-snackbar__content",{"components-snackbar__content-with-icon":!!m});return(0,n.createElement)("div",{ref:t,className:v,onClick:u?void 0:_,tabIndex:0,role:u?"":"button",onKeyPress:u?void 0:_,"aria-label":u?"":(0,x.__)("Dismiss this notice")},(0,n.createElement)("div",{className:b},m&&(0,n.createElement)("div",{className:"components-snackbar__icon"},m),i,c.map(((e,t)=>{let{label:a,onClick:i,url:o}=e;return(0,n.createElement)(l.ZP,{key:t,href:o,variant:"tertiary",onClick:e=>function(e,t){e.stopPropagation(),null==d||d(),t&&t(e)}(e,i),className:"components-snackbar__action"},a)})),u&&(0,n.createElement)("span",{role:"button","aria-label":"Dismiss this notice",tabIndex:0,className:"components-snackbar__dismiss-button",onClick:_,onKeyPress:_},"✕")))})),be=ve;var xe=a(95073),ge=a(52750);const je={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{stiffness:1e3,velocity:-100}}},exit:{opacity:0,transition:{duration:.5}}},Ne=function(e){let{notices:t,className:a,children:i,onRemove:s}=e;const r=(0,n.useRef)(null),l=(0,he.Z)();a=o()("components-snackbar-list",a);const c=e=>()=>null==s?void 0:s(e.id);return(0,n.createElement)("div",{className:a,tabIndex:-1,ref:r},i,(0,n.createElement)(xe.M,null,t.map((e=>{const{content:t,...a}=e;return(0,n.createElement)(ge.E.div,{layout:!l,initial:"init",animate:"open",exit:"exit",key:e.id,variants:l?void 0:je},(0,n.createElement)("div",{className:"components-snackbar-list__notice-container"},(0,n.createElement)(be,(0,pe.Z)({},a,{onRemove:c(e),listRef:r}),e.content)))}))))};function fe(){const{notices:e}=(0,p.Z)((e=>({notices:e(m.h).getNotices()})),[]),{removeNotice:t}=(0,Z.Z)(m.h),a=e.filter((e=>{let{isDismissible:t,type:a}=e;return t&&"default"===a})),i=e.filter((e=>{let{isDismissible:t,type:a}=e;return!t&&"default"===a})),o=e.filter((e=>{let{type:t}=e;return"snackbar"===t}));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ue.Z,{notices:i,className:"mailpoet-automation-editor-notices__notice-list"}),(0,F.jsx)(ue.Z,{notices:a,className:"mailpoet-automation-editor-notices__notice-list",onRemove:t}),(0,F.jsx)(Ne,{notices:o,className:"mailpoet-automation-editor-notices__snackbar-list",onRemove:t})]})}var ye=a(37392),Ze=a(45029);function Se(e){let{sidebarKey:t}=e;const{openSidebar:a}=(0,Z.Z)(T.storeName),[i,o]=t===T.automationSidebarKey?[(0,x.__)("Automation (selected)","mailpoet"),"is-active"]:[(0,x.__)("Automation","mailpoet"),""],[s,n]=t===T.stepSidebarKey?[(0,x.__)("Step (selected)","mailpoet"),"is-active"]:[(0,x.__)("Step","mailpoet"),""];return(0,F.jsxs)("ul",{children:[(0,F.jsx)("li",{children:(0,F.jsx)(l.ZP,{onClick:()=>a(T.automationSidebarKey),className:`edit-site-sidebar-edit-mode__panel-tab ${o}`,"aria-label":i,"data-label":(0,x.__)("Automation","mailpoet"),children:(0,x.__)("Automation","mailpoet")})}),(0,F.jsx)("li",{children:(0,F.jsx)(l.ZP,{onClick:()=>a(T.stepSidebarKey),className:`edit-site-sidebar-edit-mode__panel-tab ${n}`,"aria-label":s,"data-label":(0,x.__)("Step","mailpoet"),children:(0,x.__)("Step","mailpoet")})})]})}var Ae=a(63964),we=a(43876),ke=a(8620),De=a(3507);function Ce(e){let{title:t,description:a,icon:i}=e;return(0,F.jsxs)("div",{className:"block-editor-block-card",children:[(0,F.jsx)(De.Z,{icon:i}),(0,F.jsxs)("div",{className:"block-editor-block-card__content",children:[(0,F.jsx)("h2",{className:"block-editor-block-card__title",children:t}),(0,F.jsx)("span",{className:"block-editor-block-card__description",children:a})]})]})}function Ee(){var e;const{errors:t}=(0,p.Z)((e=>({errors:e(T.storeName).getStepError(e(T.storeName).getSelectedStep().id)})),[]);if(!t||null==t||!t.fields)return null;const a=null===(e=t.fields)||void 0===e?void 0:e.general;return a?(0,F.jsx)(Ae.Z,{isDismissible:!1,status:"error",children:a}):null}function Ie(){const{selectedStep:e,selectedStepType:t}=(0,p.Z)((e=>({selectedStep:e(T.storeName).getSelectedStep(),selectedStepType:e(T.storeName).getSelectedStepType()})),[]);if(!e)return(0,F.jsx)(we.Z,{children:"No step selected."});if(!t)return(0,F.jsx)(we.Z,{children:"Unknown step type."});const a=t.edit;return(0,F.jsxs)("div",{className:"block-editor-block-inspector",children:[(0,F.jsx)(Ee,{}),(0,F.jsx)(Ce,{title:t.title(e,"sidebar"),description:t.description(e,"sidebar"),icon:t.icon}),(0,F.jsx)(a,{},e.id),"trigger"===e.type&&(0,F.jsx)(ke.G,{})]})}var Te=a(17554),Pe=a(67507);function Fe(){const[e,t]=(0,n.useState)(!1),{automation:a}=(0,p.Z)((e=>({automation:e(T.storeName).getAutomationData()})),[]),{trash:i}=(0,Z.Z)(T.storeName);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(Pe.Z,{isOpen:e,title:(0,x.__)("Delete automation","mailpoet"),confirmButtonText:(0,x.__)("Yes, delete","mailpoet"),onConfirm:async()=>{i((()=>{t(!1)}))},onCancel:()=>t(!1),__experimentalHideHeader:!1,children:[(0,x.sprintf)((0,x.__)('You are about to delete the automation "%s".',"mailpoet"),a.name),(0,F.jsx)("br",{}),(0,x.__)(" This will stop it for all subscribers immediately.","mailpoet")]}),(0,F.jsx)(l.ZP,{variant:"secondary",isDestructive:!0,onClick:()=>t(!0),children:(0,x.__)("Move to Trash","mailpoet")})]})}var Le=a(42163),Oe=a(97442);function Ve(){const e=Oe.Hooks.applyFilters("mailpoet.automation.settings.render",{});return 0===Object.keys(e).length?null:(0,F.jsx)(we.Z,{title:(0,x.__)("Automation settings","mailpoet"),initialOpen:!0,children:Object.keys(e).map((t=>(0,F.jsx)(Te.Z,{children:e[t]},t)))})}function Re(){const{automationData:e}=(0,p.Z)((e=>({automationData:e(T.storeName).getAutomationData()})),[]),t={year:"numeric",month:"long",day:"numeric"};return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(we.Z,{title:(0,x.__)("Automation details","mailpoet"),initialOpen:!0,children:[(0,F.jsxs)(Te.Z,{children:[(0,F.jsx)("strong",{children:"Date added"})," ",new Date(Date.parse(e.created_at)).toLocaleDateString(Le.locale.toString(),t)]}),(0,F.jsxs)(Te.Z,{children:[(0,F.jsx)("strong",{children:"Activated"})," ","active"===e.status&&new Date(Date.parse(e.updated_at)).toLocaleDateString(Le.locale.toString(),t),"active"!==e.status&&e.activated_at&&new Date(Date.parse(e.activated_at)).toLocaleDateString(Le.locale.toString(),t),"active"!==e.status&&!e.activated_at&&(0,F.jsx)("span",{className:"mailpoet-deactive",children:"Not activated yet."})]}),(0,F.jsxs)(Te.Z,{children:[(0,F.jsx)("strong",{children:"Author"})," ",e.author.name]}),(0,F.jsx)(Te.Z,{children:(0,F.jsx)(Fe,{})})]}),(0,F.jsx)(Ve,{})]})}const Ke=ye.Z.select({web:!0,native:!1});function Be(e){const{keyboardShortcut:t,sidebarKey:a,showIconLabels:i,automationName:o}=(0,p.Z)((e=>({keyboardShortcut:e(b.h).getShortcutRepresentation("mailpoet/automation-editor/toggle-sidebar"),sidebarKey:e(v.h).getActiveComplementaryArea(T.storeName)??T.automationSidebarKey,showIconLabels:e(T.storeName).isFeatureActive("showIconLabels"),automationName:e(T.storeName).getAutomationData().name})),[]);return(0,F.jsxs)(v.Vi,{identifier:a,header:(0,F.jsx)(Se,{sidebarKey:a}),closeLabel:(0,x.__)("Close settings","mailpoet"),headerClassName:"edit-site-sidebar-edit-mode__panel-tabs",title:(0,x.__)("Settings","mailpoet"),icon:Ze.Z,className:"edit-site-sidebar mailpoet-automation-sidebar",panelClassName:"edit-site-sidebar",smallScreenTitle:o||(0,x.__)("(no title)","mailpoet"),scope:T.storeName,toggleShortcut:t,isActiveByDefault:Ke,showIconLabels:i,...e,children:[a===T.automationSidebarKey&&(0,F.jsx)(Re,{}),a===T.stepSidebarKey&&(0,F.jsx)(Ie,{})]})}var Ge=a(38220),Me=a(16184),Ue=a(13750),ze=a(25410),We=a(75858),qe=a(46449),He=a(77159),$e=a(25853),Ye=a(15128);function Qe(e){let{onClose:t}=e;const[a,i]=(0,n.useState)(!1),{activate:o}=(0,Z.Z)(T.storeName);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"mailpoet-automation-activate-panel__header",children:[(0,F.jsx)("div",{className:"mailpoet-automation-activate-panel__header-activate-button",children:(0,F.jsxs)(l.ZP,{variant:"primary",disabled:a,isBusy:a,autoFocus:!a,onClick:()=>{i(!0),o()},children:[a&&(0,x.__)("Activating…","mailpoet"),!a&&(0,x.__)("Activate","mailpoet")]})}),(0,F.jsx)("div",{className:"mailpoet-automation-activate-panel__header-cancel-button",children:(0,F.jsx)(l.ZP,{variant:"secondary",onClick:t,disabled:a,children:(0,x.__)("Cancel","mailpoet")})})]}),a&&(0,F.jsx)("div",{className:"mailpoet-automation-activate-panel__body",children:(0,F.jsx)($e.ZP,{})}),!a&&(0,F.jsxs)("div",{className:"mailpoet-automation-activate-panel__body",children:[(0,F.jsx)("p",{children:(0,F.jsx)("strong",{children:(0,x.__)("Are you ready to activate?","mailpoet")})}),(0,F.jsx)("p",{children:(0,x.__)("Double-check your settings before activating.","mailpoet")})]})]})}function Je(e){let{onClose:t}=e;const{automation:a}=(0,p.Z)((e=>({automation:e(T.storeName).getAutomationData()})),[]);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"mailpoet-automation-activate-panel__header",children:(0,F.jsx)(l.ZP,{icon:Ye.Z,onClick:t,label:(0,x.__)("Close","mailpoet")})}),(0,F.jsxs)("div",{className:"mailpoet-automation-activate-panel__body",children:[(0,F.jsx)("div",{className:"mailpoet-automation-activate-panel__section",children:(0,x.sprintf)((0,x.__)('"%s" is now live.',"mailpoet"),a.name)}),(0,F.jsx)("p",{children:(0,F.jsx)("strong",{children:(0,x.__)("What’s next?","mailpoet")})}),(0,F.jsx)("p",{children:(0,x.__)("View all your automations to track statistics and create new ones.","mailpoet")}),(0,F.jsx)(l.ZP,{variant:"secondary",onClick:()=>{window.location.href=ee.x.urls.automationListing},children:(0,x.__)("View all automations","mailpoet")})]})]})}function Xe(){const{automation:e,errors:t}=(0,p.Z)((e=>({errors:e(T.storeName).getErrors(),automation:e(T.storeName).getAutomationData()})),[]),{closeActivationPanel:a}=(0,Z.Z)(T.storeName);if((0,n.useEffect)((()=>{t&&a()}),[t,a]),t)return null;const i=e.status===P.b.ACTIVE;return(0,F.jsxs)("div",{className:"mailpoet-automation-activate-panel",children:[i&&(0,F.jsx)(Je,{onClose:a}),!i&&(0,F.jsx)(Qe,{onClose:a})]})}function et(e){return"saved"!==(0,u.select)(T.storeName).getSavedState()?(e.returnValue=(0,x.__)("There are unsaved changes that will be lost. Do you want to continue?","mailpoet"),e.returnValue):""}function tt(){const{isFullscreenActive:e,isInserterOpened:t,isActivationPanelOpened:a,isSidebarOpened:i,showIconLabels:s,automation:h}=(0,p.Z)((e=>({isFullscreenActive:e(T.storeName).isFeatureActive("fullscreenMode"),isInserterOpened:e(T.storeName).isInserterSidebarOpened(),isSidebarOpened:e(T.storeName).isSidebarOpened(),isActivationPanelOpened:e(T.storeName).isActivationPanelOpened(),showIconLabels:e(T.storeName).isFeatureActive("showIconLabels"),automation:e(T.storeName).getAutomationData()})),[]),[j,N]=(0,n.useState)(!0);(0,n.useEffect)((()=>(window.addEventListener("beforeunload",et),()=>window.removeEventListener("beforeunload",et))),[]),(0,n.useEffect)((()=>{j&&(function(){const e=(0,u.select)(T.storeName).getAutomationData();if(![P.b.ACTIVE,P.b.DEACTIVATING].includes(e.status))return;if(0===e.stats.totals.in_progress)return;const{createNotice:t}=(0,u.dispatch)(m.h);t("success",(0,x.__)("Editing an active automation is temporarily unavailable. We are working on introducing this functionality.","mailpoet"),{type:"snackbar"})}(),N(!1))}),[j]);const f=o()("interface-interface-skeleton",{"is-sidebar-opened":i,"show-icon-labels":s});return"trash"===h.status?(window.location.href=(0,g.f)(ee.x.urls.automationListing,{[qe.E.automationHadBeenDeleted]:h.id}),null):(0,F.jsx)(b.vn,{children:(0,F.jsxs)(r.zt,{children:[(0,F.jsx)(v.x4,{isActive:e}),(0,F.jsx)(me,{}),(0,F.jsx)(Be,{}),(0,F.jsx)(v.v4,{className:f,drawer:e&&(0,F.jsx)("div",{className:"edit-site-navigation-toggle",children:(0,F.jsx)(l.ZP,{className:"edit-site-navigation-toggle__button has-icon",href:"admin.php?page=mailpoet-automation",children:(0,F.jsx)(c.Z,{size:36,icon:_.Z})})}),header:(0,F.jsx)(de,{showInserterToggle:!1}),content:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(fe,{}),(0,F.jsx)(Ge.q,{context:"edit"})]}),sidebar:(0,F.jsx)(v.Vi.Slot,{scope:T.storeName}),secondarySidebar:null}),a&&(0,F.jsx)(Xe,{}),(0,F.jsx)(d.Z.Slot,{})]})})}window.addEventListener("DOMContentLoaded",(()=>{if((0,x.setLocaleData)(window.wp.i18n.getLocaleData()),void 0!==window.wp.date.getSettings){const e=window.wp;(0,h.setSettings)(e.date.getSettings())}else{const e=window.wp;(0,h.setSettings)(e.date.__experimentalGetSettings())}(0,T.createStore)();const e=document.getElementById("mailpoet_automation_editor");e&&((0,j.registerTranslations)(),He.Z.use((async(e,t)=>{try{return await t(e)}catch(e){var a;const t=e,i=null===(a=t.data)||void 0===a?void 0:a.status;if("mailpoet_automation_not_valid"===t.code)return void(0,u.dispatch)(T.storeName).setErrors({steps:t.data.errors});if(i&&i>=400&&i<500){const e=t.message;return(0,u.dispatch)(m.h).createErrorNotice(e??(0,x.__)("An unknown error occurred.","mailpoet"),{explicitDismiss:!0}),void(0,u.dispatch)(T.storeName).setErrors({steps:[]})}throw(0,u.dispatch)(m.h).createErrorNotice((0,x.__)("An unknown error occurred.","mailpoet"),{explicitDismiss:!0}),e}})),(0,Me.q)(),(0,Ue.j)(),(0,ze.j)(),(0,We.j)(),s.render((0,F.jsx)(tt,{}),e))}))},65311:e=>{e.exports=jQuery}},e=>{e.O(0,[351],(()=>(77978,e(e.s=77978)))),e.O()}]);

Youez - 2016 - github.com/yon3zu
LinuXploit