HEX
Server: Apache/2.4.57 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
System: Linux vmi267337.contaboserver.net 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
User: ohirex (1008)
PHP: 8.2.8
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec
Upload Files
File: /home/ohirex/web/ohirex.com/public_html/wp-content/plugins/mailster/build/workflows/jumper/index.js
(()=>{var e={6942:(e,t)=>{var s;!function(){"use strict";var i={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var s=arguments[t];s&&(e=o(e,r(s)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var s in e)i.call(e,s)&&e[s]&&(t=o(t,s));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):void 0===(s=function(){return n}.apply(t,[]))||(e.exports=s)}()}},t={};function s(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,s),r.exports}s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.wp.i18n,i=window.wp.serverSideRender;var n=s.n(i);const r=window.wp.components,o=window.wp.blockEditor,l=(window.lodash,window.moment,window.wp.element),a=window.wp.data,c=window.ReactJSXRuntime;function d({id:e,align:t}){const s=new URL("https://kb.mailster.co/"+e);s.searchParams.set("utm_campaign","plugin"),s.searchParams.set("utm_medium","link"),s.searchParams.set("utm_source","Mailster Plugin"),s.searchParams.set("utm_term","workflow");var i={};return t&&(i.float=t),(0,c.jsx)("a",{className:"mailster-help",href:s.toString(),"data-article":e,style:i})}function m(){return new Promise((e=>{const t=(0,a.subscribe)((()=>{if((0,a.select)("core/editor").isCleanNewPost()||(0,a.select)("core/block-editor").getBlockCount()>0){const s=document.querySelector('iframe[name="editor-canvas"]'),i=s?s.contentWindow:window,n=()=>{i.removeEventListener("load",n),t(),e(i)};i.document.querySelector(".is-root-container")?n():i.addEventListener("load",n)}}))}))}function h(e,t){const[s,i]=(0,l.useState)();return(0,l.useEffect)((()=>{m().then((t=>{i(t),e&&e(t)}))}),t||[]),s}function u(e){const{attributes:s,setAttributes:i,help:o="",label:d,title:m}=e,{conditions:h}=s,[u,f]=(0,l.useState)(!1),[p,_]=(0,l.useState)(!1),x=(0,a.useSelect)((e=>e("mailster/automation").getEmails()));return(0,l.useEffect)((()=>{const e=setInterval((function(){const t=document.querySelector(".mailster-conditions");t&&(f(!0),mailster.conditions.init(t),clearInterval(e))}),100);return()=>{clearInterval(e)}})),(0,l.useEffect)((()=>{h&&i({conditions:h.replace("&amp;","&")})}),[h]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(r.BaseControl,{__nextHasNoMarginBottom:!0,label:d||(0,t.__)("Conditions","mailster"),help:o,children:[h&&(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(n(),{block:"mailster-workflow/conditions",className:"conditions-preview",attributes:{...s,render:!0,plain:!1,emails:x},EmptyResponsePlaceholder:()=>(0,c.jsx)(r.Spinner,{})})}),(0,c.jsxs)(r.PanelRow,{children:[(0,c.jsx)(r.Button,{variant:"secondary",onClick:()=>_(!0),children:h?(0,t.__)("Change Conditions","mailster"):(0,t.__)("Add Conditions","mailster")}),h&&(0,c.jsx)(r.Button,{variant:"link",isDestructive:!0,onClick:()=>i({conditions:void 0}),children:(0,t.__)("Clear","mailster")})]})]}),p&&(0,c.jsxs)(r.Modal,{title:m||(0,t.__)("Define your conditions for this step","mailster"),className:"mailster-conditions-modal",onRequestClose:()=>_(!1),shouldCloseOnClickOutside:!0,__experimentalhideheader:!0,children:[(0,c.jsx)(n(),{block:"mailster-workflow/conditions",attributes:{...s,emails:x}}),(0,c.jsxs)("div",{className:"modal-conditions-buttons",children:[(0,c.jsx)(r.Button,{variant:"primary",disabled:!u,onClick:()=>{_(!1),i({conditions:mailster.conditions.serialize()})},children:(0,t.__)("Save","mailster")}),(0,c.jsx)(r.Button,{disabled:!u,variant:"secondary",onClick:()=>{_(!1)},children:(0,t.__)("Cancel","mailster")})]})]})]})}const f=(0,c.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,c.jsx)("path",{d:"M11,11V5a2,2,0,0,1,2-2h6a2,2,0,0,1,2,2v6a2,2,0,0,1-2,2H13",fill:"none",stroke:"#323232",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,c.jsx)("rect",{x:"3",y:"11",width:"10",height:"10",rx:"2",strokeWidth:"1.5",stroke:"#323232",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,c.jsx)("line",{x1:"8",y1:"5",x2:"6",y2:"7",fill:"none",stroke:"#323232",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,c.jsx)("line",{x1:"6",y1:"3",x2:"8",y2:"5",fill:"none",stroke:"#323232",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,c.jsx)("path",{d:"M8,5H5A2,2,0,0,0,3,7V8",fill:"none",stroke:"#323232",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"}),(0,c.jsx)("path",{d:"M24,0V24H0V0Z",fill:"none"})]});function p(s){const{attributes:i,setAttributes:n,clientId:o,isSelected:d}=s,{step:m}=i,[u,p]=(0,l.useState)(),[_,x]=(0,l.useState)(!1),j=h(),{toggleBlockHighlight:w}=(0,a.dispatch)("core/block-editor"),y=function(e){const[t,s]=(0,l.useState)([]);return(0,l.useEffect)((()=>{const e=function(e,t=null,s=!0){const{getBlocks:i,getBlockRootClientId:n}=(0,a.select)("core/block-editor"),r=i(t);let o=[];return function t(i){i.forEach((i=>{i.name&&new RegExp(e,"g").test(i.name)&&(i.rootClientId=n(i.clientId),o.push(i)),s&&i.innerBlocks.length>0&&t(i.innerBlocks)}))}(r),o}("^mailster-workflow/(conditions|action|email|delay|stop|jumper|notification)$");t!==e&&s(e)}),[e]),t}(d);(0,l.useEffect)((()=>{if(!y.length)return;const e=y.find((e=>e.attributes.id===m));e?p(e):(p(void 0),b(void 0))}),[m,y]);const b=e=>{n({step:e})},k={block:"center",inline:"nearest"},g=({onClose:t})=>y.map(((s,i)=>{if(s.clientId===o)return null;const n=s.attributes.id,l=(0,e.getBlockType)(s.name);return(0,c.jsx)(r.MenuGroup,{children:(0,c.jsx)(r.MenuItem,{icon:l.icon.src||l.icon,iconPosition:"left",info:n,isSelected:n===m,onMouseOver:()=>{w(s.clientId,!0);const e=j.document.getElementById("block-"+s.clientId);e&&e.scrollIntoView(k)},onClick:()=>{b(n),t();const e=j.document.getElementById("block-"+o);e&&e.scrollIntoView({behavior:"smooth"}),w(o,!0)},children:l.title})},i)})),v=u&&(0,e.getBlockType)(u.name).title||(0,t.__)("Select a step","mailster"),S=u&&(0,e.getBlockType)(u.name).icon.src||f;return(0,c.jsx)(r.BaseControl,{__nextHasNoMarginBottom:!0,children:(0,c.jsx)(r.Panel,{children:y.length<=1?(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(r.Tip,{children:(0,t.__)("Please add additional steps to your workflow.","mailster")})}):(0,c.jsxs)(r.BaseControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Jump to Step","mailster"),children:[(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(r.DropdownMenu,{text:v,icon:S,children:e=>(0,c.jsx)(g,{...e})})}),m&&(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(r.Button,{variant:"secondary",isPressed:_,icon:_?"controls-back":"search",onClick:()=>{const e=_?o:u.clientId;w(e,!0);const t=j.document.getElementById("block-"+e);t&&t.scrollIntoView(k),x(!_)},children:_?(0,t.__)("Back to Jumper","mailster"):(0,t.__)("Find Step","mailster")})})]})})})}function _(e){const{attributes:s}=e,{conditions:i}=s;return(0,c.jsxs)(o.InspectorControls,{children:[(0,c.jsx)(r.Panel,{children:(0,c.jsxs)(r.PanelBody,{children:[(0,c.jsx)(d,{id:"66336f4fc3d8e87cfb53c423",align:"right"}),(0,c.jsx)(p,{...e})]})}),(0,c.jsx)(r.Panel,{children:(0,c.jsx)(r.PanelBody,{children:(0,c.jsx)(u,{...e,label:i?(0,t.__)("Only if following conditions are fullfilled.","mailster"):(0,t.__)("Conditions","mailster"),title:(0,t.__)("Only jump if these condtions are fullfilled","mailster")})})})]})}var x=s(6942),j=s.n(x);const w=window.wp.apiFetch;var y=s.n(w);const b=window.wp.date,k=(0,b.getSettings)(),g=((0,t.__)("Minute","mailster"),(0,t.__)("Minutes","mailster"),(0,t.__)("Hour","mailster"),(0,t.__)("Hours","mailster"),(0,t.__)("Day","mailster"),(0,t.__)("Days","mailster"),(0,t.__)("Week","mailster"),(0,t.__)("Weeks","mailster"),(0,t.__)("Month","mailster"),(0,t.__)("Months","mailster"),(0,t.__)("Specific Time of the day","mailster"),(0,t.__)("Specific day of the week","mailster"),(0,t.__)("Specific day of the month","mailster"),(0,t.__)("Specific date","mailster"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"1st"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"2nd"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"3rd"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"4th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"5th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"6th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"7th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"8th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"9th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"10th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"11st"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"12nd"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"13rd"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"14th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"15th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"16th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"17th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"18th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"19th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"20th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"21st"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"22nd"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"23rd"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"24th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"25th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"26th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"27th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"28th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"29th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"30th"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"31st"),(0,t.sprintf)((0,t.__)("%s day of the month","mailster"),"Last"),k.l10n.weekdays.slice(k.l10n.startOfWeek),k.l10n.weekdays.slice(0,k.l10n.startOfWeek),k.l10n.startOfWeek,k.formats.date),v=k.formats.time;function S(e){const{attributes:s}=e,{id:i}=s,n=(0,a.useSelect)((e=>e("core/editor").getCurrentPostId()),[]),[m,h]=(0,l.useState)(!1),[u,f]=(0,l.useState)(!1),p=function(e){const t=(0,a.useSelect)((e=>e("mailster/automation").getQueue()),[]),[s,i]=(0,l.useState)(0);return(0,l.useEffect)((()=>{t&&i(t[e]||0)}),[e,t]),s}(i),_=(0,t.sprintf)((0,t._n)("%s subscriber queued","%s subscribers queued",p,"mailster"),p);return(0,l.useEffect)((()=>{if(m&&i&&n)return p?void y()({path:"/mailster/v1/automations/queue/"+n+"/"+i}).then((e=>{f(e)})):f([])}),[m,n,i,p]),(0,c.jsxs)(c.Fragment,{children:[p>0&&(0,c.jsx)("span",{className:"mailster-step-queued",title:_,onClick:()=>h(!0),children:p}),m&&(0,c.jsxs)(r.Modal,{title:_,onRequestClose:()=>h(!1),children:[(0,c.jsx)(d,{id:"66b09cdba62a7505fcf33836",align:"right"}),(0,c.jsxs)("div",{className:"mailster-queue-table",children:[!u&&(0,c.jsx)(r.Panel,{children:(0,c.jsx)(r.PanelBody,{children:(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(r.Spinner,{})})})}),u&&(0,c.jsx)(C,{data:u,setData:f,...e})]}),(0,c.jsx)(r.Tip,{children:(0,t.__)("This table shows you the subscribers which are currently queued in this step. You can finish, trash or move them to the next step with the action buttons.","mailster")})]}),(0,c.jsx)(o.InspectorControls,{children:p>0&&(0,c.jsxs)(r.Panel,{children:[(0,c.jsxs)(r.PanelBody,{title:(0,t.__)("Queue","mailster"),children:[(0,c.jsx)(d,{id:"66b09cdba62a7505fcf33836",align:"right"}),(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(r.Button,{onClick:()=>h(!0),variant:"secondary",children:_})})]}),(0,c.jsx)(r.PanelBody,{children:(0,c.jsx)(r.Tip,{children:(0,t.__)("Subscribers who are already queued in this step will not be affected by any changes you make.","mailster")})})]})})]})}k.formats.datetime,k.formats.time.match(/[a|A]/);const C=e=>{const{attributes:s,data:i,setData:n}=e,{id:o}=s,[d,m]=(0,l.useState)(!1),h=(0,a.useSelect)((e=>e("core/editor").getCurrentPostId()),[]),u=(e,t,s,r)=>{const l="/mailster/v1/automations/queue/"+h+"/"+o+"/"+e.ID;m(!0),y()({path:l,method:s,data:r}).then((e=>{e&&n(i.filter(((e,s)=>s!==t))),m(!1),(0,a.dispatch)("mailster/automation").invalidateResolutionForStoreSelector("getQueue")}))},f=(new Date).getTime(),p=i.map(((e,i)=>{const n=1e3*e.timestamp,o=1e3*e.added;return(0,c.jsxs)("tr",{children:[(0,c.jsxs)("td",{children:[(0,c.jsx)(r.ExternalLink,{href:"edit.php?post_type=newsletter&page=mailster_subscribers&ID="+e.subscriber_id,children:e.email}),0==e.status&&(0,c.jsx)("p",{className:"description",children:(0,t.__)("This subscriber hasn't confirmed their subscription yet. The workflow will continue once the user confirms their subscriptions.","mailster")})]}),(0,c.jsx)("td",{children:e.trigger}),(0,c.jsx)("td",{children:o&&(0,c.jsx)(r.Tooltip,{text:(0,b.dateI18n)(g,o)+" @ "+(0,b.dateI18n)(v,o),children:(0,c.jsx)("div",{children:(0,b.humanTimeDiff)(o)})})}),(0,c.jsx)("td",{children:n&&(0,c.jsx)(r.Tooltip,{text:(0,b.dateI18n)(g,n)+" @ "+(0,b.dateI18n)(v,n),children:(0,c.jsx)("div",{children:n>f?(0,b.humanTimeDiff)(n):(0,t.__)("right now","mailster")})})}),(0,c.jsxs)("td",{children:[(0,c.jsx)(r.Button,{icon:"flag",disabled:d,label:(0,t.__)("Finish Journey","mailster"),onClick:()=>((e,s)=>{const i=(0,t.sprintf)((0,t.__)("Do you really like to finish the journey for %s?","mailster"),e.email);confirm(i)&&u(e,s,"POST",{finish:!0})})(e,i)}),(0,c.jsx)(r.Button,{icon:"controls-skipforward",disabled:d||1!=e.status||s.disabled,label:(0,t.__)("Forward to next step","mailster"),onClick:()=>((e,s)=>{const i=(0,t.sprintf)((0,t.__)("Do you really like to forward %s to the next step?","mailster"),e.email);confirm(i)&&u(e,s,"POST",{forward:!0})})(e,i)}),(0,c.jsx)(r.Button,{icon:"trash",disabled:d,isDestructive:!0,label:(0,t.__)("Remove entry","mailster"),onClick:()=>((e,s)=>{const i=(0,t.sprintf)((0,t.__)("Do you really like to remove %s from the queue?","mailster"),e.email);confirm(i)&&u(e,s,"DELETE")})(e,i)})]})]},i)}));return(0,c.jsxs)("table",{className:"wp-list-table widefat striped",children:[(0,c.jsx)("thead",{children:(0,c.jsxs)("tr",{children:[(0,c.jsx)("th",{children:(0,t.__)("Subscriber","mailster")}),(0,c.jsx)("th",{children:(0,t.__)("Trigger","mailster")}),(0,c.jsx)("th",{children:(0,t.__)("Added","mailster")}),(0,c.jsx)("th",{children:(0,t.__)("Continues","mailster")}),(0,c.jsx)("th",{style:{width:"150px"},children:(0,t.__)("Actions","mailster")})]})}),(0,c.jsx)("tbody",{children:p})]})},B={label:(0,t.__)("Skip Step","mailster"),help:(0,t.__)("Skip this step when the workflow is executed.","mailster")},P={label:(0,t.__)("Skip Trigger","mailster"),help:(0,t.__)("Disable this trigger for the workflow.","mailster")};function I(e){const{attributes:t,setAttributes:s,name:i}=e,{disabled:n=!1}=t;if("mailster-workflow/stop"===i)return null;const l="mailster-workflow/trigger"==i?P:B;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o.BlockControls,{group:"other",children:(0,c.jsx)(r.ToolbarButton,{icon:n?"hidden":"visibility",isPressed:n,title:l.label,onClick:()=>s({disabled:!n||void 0})})}),(0,c.jsx)(o.InspectorControls,{children:(0,c.jsx)(r.Panel,{children:(0,c.jsx)(r.PanelBody,{children:(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,icon:n?"hidden":"visibility",label:l.label,help:l.help,checked:n,onChange:e=>s({disabled:!!e||void 0})})})})})})]})}function E(e){const{attributes:s,setAttributes:i,name:n}=e,{comment:l=""}=s;return"mailster-workflow/trigger"===n?null:(0,c.jsxs)(c.Fragment,{children:[l&&(0,c.jsx)("div",{className:"mailster-step-comment",children:l}),(0,c.jsx)(o.InspectorControls,{children:(0,c.jsx)(r.Panel,{children:(0,c.jsx)(r.PanelBody,{children:(0,c.jsx)(r.PanelRow,{children:(0,c.jsx)(r.TextControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Comment","mailster"),help:(0,t.__)("Add a comment to help you understand your workflow.","mailster"),value:l,onChange:e=>i({comment:e||void 0})})})})})})]})}function N(e){const{attributes:s}=e,{id:i}=s;if(i)return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"mailster-step-id",title:sprintf((0,t.__)("Step ID : %s","mailster"),i),children:i}),(0,c.jsx)(o.InspectorControls,{children:(0,c.jsx)(r.Panel,{children:(0,c.jsx)(r.PanelBody,{className:"code",children:sprintf((0,t.__)("Step ID : %s","mailster"),i)})})})]})}function T(e){const{attributes:s,clientId:i,name:n,isSelectionEnabled:l}=e,{isExample:d}=s;if((0,a.useSelect)((e=>{const t=e("core/block-editor").getBlocks();return t.length?t.at(-1).clientId:null}))!==i)return null;const m="mailster-workflow/triggers"===n?(0,t.__)("Click + to add a step","mailster"):(0,t.__)("Workflow Finished","mailster");return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r.Tooltip,{text:(0,t.__)("Once the user reaches this point the workflow will be finished.","mailster"),children:(0,c.jsx)("span",{className:"workflow-finished "+n.replace("mailster-workflow/","workflow-finished-"),children:!d&&m})}),l&&(0,c.jsx)(o.ButtonBlockAppender,{})]})}function R(e){const{attributes:t,setAttributes:s,children:i,className:n=[],hasStepId:a=!0,before:d,after:h,inspectorControls:u,isSelected:f,isIncomplete:p,clientId:_,blockAttributes:x={},isSelectionEnabled:w}=e,{id:y,disabled:b=!1}=t;!function(e){const[t,s]=(0,l.useState)();(0,l.useEffect)((()=>{m().then((t=>{s(t.document),e&&e(t.document)}))}),[])}((e=>{e&&a&&(!y||e.querySelectorAll(".mailster-step-"+y).length>1)&&s({id:_.substring(30)})})),(0,l.useEffect)((()=>{if(f&&y)return history.replaceState(void 0,void 0,"#step-"+y),()=>{history.pushState("",document.title,location.pathname+location.search)}}),[f]);const k=(0,l.useRef)();y&&n.push("mailster-step-"+y),p&&w&&n.push("mailster-step-incomplete"),b&&n.push("mailster-step-disabled");const g=(0,o.useBlockProps)({className:j()({},n),...x});return(0,c.jsxs)(c.Fragment,{children:[u,(0,c.jsxs)("div",{...g,children:[d,(0,c.jsxs)(r.Card,{className:"mailster-step",ref:k,children:[(0,c.jsx)(E,{...e}),(0,c.jsx)(I,{...e}),(0,c.jsx)(S,{...e}),(0,c.jsx)(N,{...e}),(0,c.jsx)("div",{className:"mailster-step-inner",children:i})]}),h,(0,c.jsx)("div",{className:"end-stop canvas-handle"})]}),(0,c.jsx)(T,{...e})]})}const D=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"mailster-workflow/jumper","title":"Jumper","category":"mailster-workflow-steps","keywords":["jumper","time"],"description":"Jump to a specific step in this workflow.","parent":["core/post-content","mailster-workflow/condition-yes","mailster-workflow/condition-no"],"example":{"attributes":{"step":"12345"}},"supports":{"html":false,"className":false,"customClassName":false},"attributes":{"id":{"type":"string"},"disabled":{"type":"boolean"},"step":{"type":"string"},"conditions":{"type":"string"},"comment":{"type":"string"}},"textdomain":"mailster","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'),{name:M,...L}=D;(0,e.registerBlockType)(M,{...L,__experimentalLabel:function(e,{context:s}){const{step:i,content:n,metadata:r}=e;return r?.name?r.name:(0,t.sprintf)((0,t.__)("Jump to #%s","mailster"),i||"…")||n},icon:f,edit:function(e){const{attributes:s,isSelected:i}=e,{conditions:o,step:a}=s,d=sprintf((0,t.__)("Jump to #%s","mailster"),a||"…"),m=h();return(0,l.useEffect)((()=>{if(!a||!m)return;const e=m.document.querySelector(".mailster-step-"+a);e&&(i?e.classList.add("is-jumper"):e.classList.remove("is-jumper"))}),[m,a,i]),(0,c.jsx)(R,{...e,isIncomplete:!a,inspectorControls:(0,c.jsx)(_,{...e}),children:(0,c.jsxs)(r.CardBody,{size:"small",children:[(0,c.jsxs)("div",{className:"mailster-step-label",children:[(0,c.jsx)(r.Icon,{icon:f}),d]}),o&&(0,c.jsxs)("div",{className:"mailster-step-info",children:[(0,t.__)("only if","mailster"),(0,c.jsx)(n(),{block:"mailster-workflow/conditions",attributes:{...s,render:!0,plain:!0},EmptyResponsePlaceholder:()=>(0,c.jsx)(r.Spinner,{})}),(0,t.__)("otherwise continue","mailster")]})]})})},save:()=>null})})()})();