- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 line
55 KiB
JavaScript
Executable File
1 line
55 KiB
JavaScript
Executable File
(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{1069:function(t,e,n){"use strict";var a=n(76),o=n(0),r=n(1),i=n(3),c=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={workflow:{name:Object(r.__)("Workflow","wp-marketing-automations"),link:e?"admin.php?page=autonami&path=/automation/".concat(t):"admin.php?page=autonami-automations&edit=".concat(t),redirect:!e}};return e&&(n.single_a_contacts={name:Object(r.__)("Contacts","wp-marketing-automations"),link:"admin.php?page=autonami&path=/automation/".concat(t,"/contacts"),showOnClick:!0},n.analytics={name:Object(r.__)("Analytics","wp-marketing-automations"),link:e?"admin.php?page=autonami&path=/automation/".concat(t,"/analytics"):"admin.php?page=autonami&path=/automation-v1/".concat(t,"/analytics"),isPro:!0,showOnClick:!0}),n.engagement={name:Object(r.__)("Engagements","wp-marketing-automations"),link:e?"admin.php?page=autonami&path=/automation/".concat(t,"/engagements"):"admin.php?page=autonami&path=/automation-v1/".concat(t,"/engagements"),isPro:!0,showOnClick:!0},Object(i.qc)()&&(n.orders={name:Object(r.__)("Orders","wp-marketing-automations"),link:e?"admin.php?page=autonami&path=/automation/".concat(t,"/orders"):"admin.php?page=autonami&path=/automation-v1/".concat(t,"/orders"),isPro:!0,showOnClick:!0}),n};e.a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,l=arguments.length>6&&void 0!==arguments[6]&&arguments[6],m=arguments.length>7&&void 0!==arguments[7]&&arguments[7],f=arguments.length>8&&void 0!==arguments[8]&&arguments[8],p=bwfcrm_contacts_data&&bwfcrm_contacts_data.header_data?bwfcrm_contacts_data.header_data:{},b=(p.automation_nav,p.automationv2_nav),g=Object(a.a)(),d=g.setActiveMultiple,h=g.resetHeaderMenu,y=g.setL2NavType,O=g.setL2Nav,j=g.setBackLink,w=g.setL2Title,v=g.setL2Content,_=g.setBackLinkLabel,k=g.setL2NavAlign,E=g.setPageHeader,C=g.setTabHeader;return Object(o.useEffect)((function(){h(!0),!i&&y("menu");var a=c(s,m);f||O(s?a:b),t&&a.hasOwnProperty(t)&&a[t].hasOwnProperty("name")&&C(a[t].name),d({leftNav:"automations-v2",rightNav:t}),n&&j(n),s&&j(n&&!m?"admin.php?page=autonami&path=/automations-v1":"admin.php?page=autonami&path=/automations"),i||m&&s&&_(Object(r.__)("All Automations","wp-marketing-automations")),!m&&s&&_(Object(r.__)("All Automations","wp-marketing-automations")),s&&k("left"),e&&""!==e&&w(e),!n&&u&&v(u),E(Object(r.__)("Automations","wp-marketing-automations")),l&&O({})}),[t,m,f]),!0}},1070:function(t,e){t.exports=function(t,e,n,a){for(var o=t.length,r=n+(a?1:-1);a?r--:++r<o;)if(e(t[r],r,t))return r;return-1}},1074:function(t,e){t.exports=function(t){return t!=t}},1075:function(t,e){t.exports=function(t,e,n){for(var a=n-1,o=t.length;++a<o;)if(t[a]===e)return a;return-1}},1077:function(t,e,n){"use strict";var a=n(51),o=n(150);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=["getStateProp"];function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}e.a=function(){var t=Object(a.a)("automationList"),e=t.getStateProp,n=function(t,e){if(null==t)return{};var n,a,o=function(t,e){if(null==t)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.includes(a))continue;n[a]=t[a]}return n}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(a=0;a<r.length;a++)n=r[a],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,i),r=Object(a.a)(o.a.recipient).getStateProp,c=Object(a.a)(o.a.conversion).getStateProp,s=Object(a.a)(o.a.contacts).getStateProp,l=Object(a.a)(o.a.analytics).getStateProp;return u(u({},n),{},{getAutomations:function(){return e("automations")},getPageNumber:function(){return parseInt(e("offset"))/parseInt(e("limit"))+1},getPerPageCount:function(){return parseInt(e("limit"))},getOffset:function(){return parseInt(e("offset"))},getTotalCount:function(){return parseInt(e("total"))},getLoadingStatus:function(){return e("isLoading")},getWorkerResponseCode:function(){return e("response_code")},getWorkerDelay:function(){return e("worker_delayed")},getRecipientData:function(){return r("data")},getRecipientLoading:function(){return r("isLoading")},getRecipientOffset:function(){return r("offset")},getRecipientAutomationId:function(){return r("automationId")},getRecipientTotal:function(){return r("total")},getRecipientAutomation:function(){return r("automation")},getRecipientPage:function(){return parseInt(r("offset"))/parseInt(r("limit"))+1},getRecipientLimit:function(){return r("limit")},getRecipientSingleAutomationFailedCount:function(){return r("failedCount")},getConversionData:function(){return c("data")},getConversionLoading:function(){return c("isLoading")},getConversionOffset:function(){return c("offset")},getConversionAutomationId:function(){return c("automationId")},getConversionTotal:function(){return c("total")},getConversionAutomation:function(){return c("automation")},getConversionPage:function(){return parseInt(c("offset"))/parseInt(c("limit"))+1},getConversionLimit:function(){return c("limit")},getCountData:function(){return e("countData")},getConversionSingleAutomationFailedCount:function(){return c("failedCount")},getContactData:function(){return s("data")},getContactLoading:function(){return s("isLoading")},getContactOffset:function(){return s("offset")},getContactAutomationId:function(){return s("automationId")},getContactTotal:function(){return s("total")},getContactAutomation:function(){return s("automation")},getContactPage:function(){return parseInt(s("offset"))/parseInt(s("limit"))+1},getContactLimit:function(){return s("limit")},getContactCountData:function(){return s("contactCount")},getContactSingleAutomationFailedCount:function(){return s("failedCount")},getAnalyticsData:function(){return l("analytics")},getAnalyticsTileData:function(){return l("tiles")},getAnalyticsTableData:function(){return l("tableData")},getAnalyticsLoading:function(){return l("isLoading")},getAnalyticsType:function(){return l("type")},getAnalyticsAutomationData:function(){return l("automation")},getAnalyticsSingleAutomationFailedCount:function(){return l("failedCount")}})}},1084:function(t,e,n){var a=n(1070),o=n(1074),r=n(1075);t.exports=function(t,e,n){return e==e?r(t,e,n):a(t,o,n)}},1091:function(t,e){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return n.test(t)}},1095:function(t,e,n){"use strict";var a=n(50),o=n(3),r=n(150),i=n(17);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var u=["fetch","setStateProp"],s=["s","page","filter","path"];function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function m(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function f(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!=c(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p(t,e){if(null==t)return{};var n,a,o=function(t,e){if(null==t)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.includes(a))continue;n[a]=t[a]}return n}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(a=0;a<r.length;a++)n=r[a],e.includes(n)||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}e.a=function(){var t=Object(a.a)("automationList"),e=t.fetch,n=t.setStateProp,c=p(t,u),l=Object(a.a)(r.a.recipient),f=l.fetch,b=l.setStateProp,g=Object(a.a)(r.a.conversion),d=g.fetch,h=g.setStateProp,y=Object(a.a)(r.a.contacts),O=y.fetch,j=y.setStateProp,w=Object(a.a)(r.a.analytics),v=w.fetch,_=w.setStateProp;return m(m({},c),{},{fetch:function(t,a,r,i){var c=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n("automation",{});var u=a.s,l=void 0===u?"":u,m=(a.page,a.filter,a.path,p(a,s)),f={offset:r,limit:i,status:t,search:l,filters:m,version:c?2:1};e("GET",Object(o.A)("/automations"),f)},setAutomationListValues:function(t,e){n(t,e)},fetchRecipient:function(t,e,n){f("GET",Object(o.A)("/v3/automation/".concat(t,"/recipients?limit=").concat(e,"&offset=").concat(n)))},setRecipientsValues:function(t,e){b(t,e)},fetchConversion:function(t,e,n){h("automation",{}),d("GET",Object(o.A)("/v3/automation/".concat(t,"/conversions?limit=").concat(e,"&offset=").concat(n)))},setConversionValues:function(t,e){h(t,e)},fetchContacts:function(t,e,n,a){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";j("automation",{}),O("GET",Object(o.A)("/automation/".concat(t,"/contacts?limit=").concat(e,"&offset=").concat(n,"&type=").concat(a,"&search=").concat(r)))},setContactValues:function(t,e){j(t,e)},fetchAnalytics:function(t,e,n,a){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,u=0;4===parseInt(c)&&(u=1),v("GET",Object(o.A)("/analytics/emails/chart/")+"?"+Object(i.stringify)({after:e,before:n,interval:a,oid:t,type:r,mode:c,contact:u}))},setAnalyticsValues:function(t,e){_(t,e)}})}},1163:function(t,e,n){"use strict";var a=n(0),o=n(96),r=n(9),i=n.n(r),c=n(3),u=n(55),s=n(1);function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(){m=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",c=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function f(t,e,n,a){var r=e&&e.prototype instanceof y?e:y,i=Object.create(r.prototype),c=new S(a||[]);return o(i,"_invoke",{value:A(t,n,c)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var b="suspendedStart",g="executing",d="completed",h={};function y(){}function O(){}function j(){}var w={};s(w,i,(function(){return this}));var v=Object.getPrototypeOf,_=v&&v(v(T([])));_&&_!==n&&a.call(_,i)&&(w=_);var k=j.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(o,r,i,c){var u=p(t[o],t,r);if("throw"!==u.type){var s=u.arg,m=s.value;return m&&"object"==l(m)&&a.call(m,"__await")?e.resolve(m.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(m).then((function(t){s.value=t,i(s)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var r;o(this,"_invoke",{value:function(t,a){function o(){return new e((function(e,o){n(t,a,e,o)}))}return r=r?r.then(o,o):o()}})}function A(e,n,a){var o=b;return function(r,i){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===r)throw i;return{value:t,done:!0}}for(a.method=r,a.arg=i;;){var c=a.delegate;if(c){var u=P(c,a);if(u){if(u===h)continue;return u}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(o===b)throw o=d,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o=g;var s=p(e,n,a);if("normal"===s.type){if(o=a.done?d:"suspendedYield",s.arg===h)continue;return{value:s.arg,done:a.done}}"throw"===s.type&&(o=d,a.method="throw",a.arg=s.arg)}}}function P(e,n){var a=n.method,o=e.iterator[a];if(o===t)return n.delegate=null,"throw"===a&&e.iterator.return&&(n.method="return",n.arg=t,P(e,n),"throw"===n.method)||"return"!==a&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+a+"' method")),h;var r=p(o,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;var i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return r.next=r}}throw new TypeError(l(e)+" is not iterable")}return O.prototype=j,o(k,"constructor",{value:j,configurable:!0}),o(j,"constructor",{value:O,configurable:!0}),O.displayName=s(j,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===O||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,s(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(C.prototype),s(C.prototype,c,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,a,o,r){void 0===r&&(r=Promise);var i=new C(f(t,n,a,o),r);return e.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(k),s(k,u,"Generator"),s(k,i,(function(){return this})),s(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var a in e)n.push(a);return n.reverse(),function t(){for(;n.length;){var a=n.pop();if(a in e)return t.value=a,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(a,o){return c.type="throw",c.arg=e,n.next=a,o&&(n.method="next",n.arg=t),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var i=r?r.completion:{};return i.type=t,i.arg=e,r?(this.method="next",this.next=r.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var a=n.completion;if("throw"===a.type){var o=a.arg;x(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,a){return this.delegate={iterator:T(e),resultName:n,nextLoc:a},"next"===this.method&&(this.arg=t),h}},e}function f(t,e,n,a,o,r,i){try{var c=t[r](i),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(a,o)}function p(t){return function(){var e=this,n=arguments;return new Promise((function(a,o){var r=t.apply(e,n);function i(t){f(r,a,o,i,c,"next",t)}function c(t){f(r,a,o,i,c,"throw",t)}i(void 0)}))}}e.a=function(t){var e=t.isOpen,n=t.tasks,r=t.onSuccess,l=t.onError,f=t.onRequestClose,b=t.actionType,g=(t.screenType,t.screenTypeId),d=Object(a.useContext)(c.h),h=n?n.length:0,y=Object(o.useMutation)(function(){var t=p(m().mark((function t(e){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i()({path:Object(c.A)("/automation/bulk-action"),method:"POST",data:{action:b,a_cids:e,status:g}}).then((function(t){d(t.message),Object(c.Lb)(d,2e3)}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),{onSuccess:function(){setTimeout((function(){return y.reset()}),2500),r&&setTimeout((function(){return r()}),2e3)},onError:function(){l&&l()}}),O=function(){var t=p(m().mark((function t(){return m().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.mutate(n.map((function(t){return t.ID})));case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),j={delete:{title:Object(s._n)("Delete Automation for Contact","Delete Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to delete ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(" from this automation. This action cannot be undone. Cancel to stop, Delete to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Delete","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk action has been scheduled, it will be executed within one minute","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to delete automation for contacts","wp-marketing-automations"),confirmDescription:Object(s.__)("This action is irreversible","wp-marketing-automations")},end:{title:Object(s._n)("End Automation for Contact","End Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to end automation for ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(". Confirm to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk action has been scheduled, it will be executed within one minute.","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to end automation for contacts","wp-marketing-automations")},paused:{title:Object(s._n)("Pause Automation for Contact","Pause Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to pause automation for ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(". Confirm to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk action has been scheduled, it will be executed within one minute","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to pause automation for contacts","wp-marketing-automations")},run_now:{title:Object(s._n)("Run Automation for Contact","Run Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to run automation for ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(". Confirm to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk Action has been scheduled, it will be executed within one minute","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to run automation for contacts","wp-marketing-automations")},unpaused:{title:Object(s._n)("Resume Automation for Contact","Resume Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to resume automation for ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(". Confirm to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk Action has been scheduled, it will be executed within one minute","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to resume automation for contacts","wp-marketing-automations")},retry:{title:Object(s._n)("Retry Automation for Contact","Retry Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to retry automation for ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(". Confirm to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk Action has been scheduled, it will be executed within one minute","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to re-run automation for contacts","wp-marketing-automations")},rerun:{title:Object(s._n)("Re-Run Automation for Contact","Re-Run Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to re-run automation for ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(". Confirm to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk Action has been scheduled, it will be executed within one minute","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to re-run automation for contacts","wp-marketing-automations")},startbegin:{title:Object(s._n)("Start From Beginning Automation for Contact","Start From Beginning Automation for Contacts",h,"wp-marketing-automations"),description:Object(a.createElement)(a.Fragment,null,Object(s.__)("You are about to start automation from beginning for ","wp-marketing-automations"),Object(s._n)("contact","contacts",h,"wp-marketing-automations"),Object(s.__)(". Confirm to proceed.","wp-marketing-automations")),confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),successMsg:Object(s.__)("Bulk Action has been scheduled, it will be executed within one minute","wp-marketing-automations"),errorMsg:Object(s.__)("Unable to start automation from beginning for contacts","wp-marketing-automations")}};return Object(a.createElement)(u.a,{modalTitle:j.hasOwnProperty(b)&&j[b].hasOwnProperty("title")?j[b].title:Object(s._n)("Perform Actions","Perform Actions",h,"wp-marketing-automations"),deleteDescriptionText:j.hasOwnProperty(b)&&j[b].hasOwnProperty("description")?j[b].description:"",confirmButtonText:j.hasOwnProperty(b)&&j[b].hasOwnProperty("confirmBtn")?j[b].confirmBtn:Object(s.__)("Confirm","wp-marketing-automations"),cancelButtonText:j.hasOwnProperty(b)&&j[b].hasOwnProperty("cancelBtn")?j[b].cancelBtn:Object(s.__)("Cancel","wp-marketing-automations"),onConfirm:O,isLoading:y.isLoading,successMessage:y.isSuccess&&(j.hasOwnProperty(b)&&j[b].hasOwnProperty("successMsg")?j[b].successMsg:Object(s.__)("Actions Done!","wp-marketing-automations")),errorMessage:y.isError&&(y.error&&y.error.message?y.error.message:j.hasOwnProperty(b)&&j[b].hasOwnProperty("errorMsg")?j[b].errorMsg:Object(s.__)("Unable to perform action","wp-marketing-automations")),onRequestClose:function(){return!!f&&f()},isOpen:e,confirmDescription:j.hasOwnProperty(b)&&j[b].hasOwnProperty("confirmDescription")?j[b].confirmDescription:"",isDelete:!0})}},1473:function(t,e,n){"use strict";n.r(e);var a=n(0),o=n(1),r=n(146),i=n(1095),c=n(1077),u=n(3),s=n(70),l=n(33),m=n(335),f=n(1069),p=n(76),b=n(61),g=n(62),d=n(19),h=n(8),y=n(2),O=n(5),j=n(1117),w=n(1062),v=n(9),_=n.n(v),k=n(55),E=n(147),C=n(333),A=n(148),P=n(336),L=n(44),x=n(195),S=n(1163),T=n(40),I=n(12),N=n(108);function R(t){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(){D=function(){return e};var t,e={},n=Object.prototype,a=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",c=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,a){var r=e&&e.prototype instanceof d?e:d,i=Object.create(r.prototype),c=new L(a||[]);return o(i,"_invoke",{value:E(t,n,c)}),i}function m(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",p="executing",b="completed",g={};function d(){}function h(){}function y(){}var O={};s(O,i,(function(){return this}));var j=Object.getPrototypeOf,w=j&&j(j(x([])));w&&w!==n&&a.call(w,i)&&(O=w);var v=y.prototype=d.prototype=Object.create(O);function _(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function n(o,r,i,c){var u=m(t[o],t,r);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==R(l)&&a.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var r;o(this,"_invoke",{value:function(t,a){function o(){return new e((function(e,o){n(t,a,e,o)}))}return r=r?r.then(o,o):o()}})}function E(e,n,a){var o=f;return function(r,i){if(o===p)throw Error("Generator is already running");if(o===b){if("throw"===r)throw i;return{value:t,done:!0}}for(a.method=r,a.arg=i;;){var c=a.delegate;if(c){var u=C(c,a);if(u){if(u===g)continue;return u}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(o===f)throw o=b,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);o=p;var s=m(e,n,a);if("normal"===s.type){if(o=a.done?b:"suspendedYield",s.arg===g)continue;return{value:s.arg,done:a.done}}"throw"===s.type&&(o=b,a.method="throw",a.arg=s.arg)}}}function C(e,n){var a=n.method,o=e.iterator[a];if(o===t)return n.delegate=null,"throw"===a&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==a&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+a+"' method")),g;var r=m(o,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,g;var i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function x(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return r.next=r}}throw new TypeError(R(e)+" is not iterable")}return h.prototype=y,o(v,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:h,configurable:!0}),h.displayName=s(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,u,"GeneratorFunction")),t.prototype=Object.create(v),t},e.awrap=function(t){return{__await:t}},_(k.prototype),s(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,a,o,r){void 0===r&&(r=Promise);var i=new k(l(t,n,a,o),r);return e.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(v),s(v,u,"Generator"),s(v,i,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var a in e)n.push(a);return n.reverse(),function t(){for(;n.length;){var a=n.pop();if(a in e)return t.value=a,t.done=!1,t}return t.done=!0,t}},e.values=x,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(a,o){return c.type="throw",c.arg=e,n.next=a,o&&(n.method="next",n.arg=t),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&a.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var i=r?r.completion:{};return i.type=t,i.arg=e,r?(this.method="next",this.next=r.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var a=n.completion;if("throw"===a.type){var o=a.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,a){return this.delegate={iterator:x(e),resultName:n,nextLoc:a},"next"===this.method&&(this.arg=t),g}},e}function B(t,e,n,a,o,r,i){try{var c=t[r](i),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(a,o)}function M(t){return function(){var e=this,n=arguments;return new Promise((function(a,o){var r=t.apply(e,n);function i(t){B(r,a,o,i,c,"next",t)}function c(t){B(r,a,o,i,c,"throw",t)}i(void 0)}))}}function F(){return(F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)({}).hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t}).apply(null,arguments)}function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,a)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?U(Object(n),!0).forEach((function(e){Y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):U(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Y(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=R(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e||"default");if("object"!=R(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==R(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a,o,r,i,c=[],u=!0,s=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(a=r.call(n)).done)&&(c.push(a.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(t,e)||V(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(t,e){if(t){if("string"==typeof t)return J(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?J(t,e):void 0}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);n<e;n++)a[n]=t[n];return a}var H=function(t){var e=[];return"completed"!==t?(["active","delayed"].includes(t)&&(e.push({id:"run_now",icon:"play",hint:Object(o.__)("Run Now","wp-marketing-automations"),isPro:!0,featureTitle:Object(o.__)("Run Now Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Bulk+Action+Run+Now+Upgrade+Modal"})}),e.push({id:"paused",icon:"pause",hint:Object(o.__)("Pause Automation","wp-marketing-automations"),isPro:!0,featureTitle:Object(o.__)("Pause Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Bulk+Action+Pause+Upgrade+Modal"})})),"paused"===t&&e.push({id:"unpaused",icon:"play",hint:Object(o.__)("Resume Automation","wp-marketing-automations"),isPro:!0,featureTitle:Object(o.__)("Resume Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Bulk+Action+Resume+Upgrade+Modal"})}),"failed"===t&&(e.push({id:"retry",icon:"retry",hint:Object(o.__)("Retry Action","wp-marketing-automations"),isPro:!0,featureTitle:Object(o.__)("Retry Action","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Bulk+Action+Retry+Upgrade+Modal"})}),e.push({id:"startbegin",icon:"start-beginning",hint:Object(o.__)("Re-Enter Automation","wp-marketing-automations"),isPro:!0,featureTitle:Object(o.__)("Re-Enter Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Bulk+Action+Re+Enter+Upgrade+Modal"})})),"inactive"!==t&&e.push({id:"end",icon:"end-status",hint:Object(o.__)("End","wp-marketing-automations")})):e.push({id:"rerun",icon:"retry",hint:Object(o.__)("Restart Automation","wp-marketing-automations"),isPro:!0,featureTitle:Object(o.__)("Retry Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Bulk+Action+Restart+Upgrade+Modal"})}),e.push({id:"delete",icon:"trash",hint:Object(o.__)("Delete","wp-marketing-automations")}),e};e.default=function(t){var e=Object(a.useContext)(u.h),n=t.match.params,v=n.automationId,R=n.type,B=void 0===R?"active":R,U=q(Object(a.useState)({loading:!1,status:!1}),2),Y=U[0],J=U[1],W=q(Object(a.useState)(""),2),z=W[0],Q=W[1],$=q(Object(a.useState)(""),2),K=$[0],X=$[1],Z=q(Object(a.useState)(!1),2),tt=Z[0],et=Z[1],nt=q(Object(a.useState)({isFeature:!0}),2),at=nt[0],ot=nt[1],rt=q(Object(a.useState)({}),2),it=rt[0],ct=rt[1],ut=Object(c.a)(),st=ut.getContactData(),lt=ut.getContactAutomation(),mt=lt.title,ft=void 0===mt?"":mt,pt=ut.getContactSingleAutomationFailedCount(),bt=Object(p.a)(),gt=bt.setL2NavAlign,dt=bt.setL2Title,ht=bt.setPageCountData,yt=Object(E.a)(),Ot=yt.getAutomationData,jt=yt.getAutomationId,wt=Object(C.a)().setAutomationData,vt=Object(i.a)(),_t=vt.fetchContacts,kt=vt.setContactValues,Et=q(Object(a.useState)([]),2),Ct=Et[0],At=Et[1],Pt=q(Object(a.useState)(!1),2),Lt=Pt[0],xt=Pt[1],St=q(Object(a.useState)(""),2),Tt=St[0],It=St[1],Nt=(0,Object(N.a)().getPageCountData)();Object(a.useEffect)((function(){qt||ht(G(G({},Nt),{},{single_a_contacts:pt}))}),[pt]),Object(a.useEffect)((function(){Object(y.isEmpty)(lt)||wt("data",lt)}),[lt]);var Rt=function(){te&&te(),At([])},Dt=Object(a.useCallback)((function(t,e){At(e),It(t),xt(!0)}),[]);Object(a.useEffect)((function(){return Rt(),function(){kt("automation",{}),kt("offset",0)}}),[]);var Bt=Ot(),Mt=Bt.title,Ft=void 0===Mt?"":Mt,Ut=Bt.status,Gt=void 0===Ut?"":Ut,Yt=jt();Object(f.a)("single_a_contacts","",!0,!1,null,v,!1,!0);var qt=ut.getContactLoading(),Vt=ut.getContactLimit(),Jt=ut.getContactOffset(),Ht=ut.getContactTotal(),Wt=ut.getContactCountData();Object(a.useEffect)((function(){_t(v,Vt,Jt,B,K)}),[Vt,Jt,B,K]),Object(a.useEffect)((function(){["active","inactive"].includes(B)&&""!==Gt&&Object(I.l)({page:"autonami",path:"/automation/".concat(v,"/contacts/").concat(1===parseInt(Gt)?"active":"inactive")},"/",{})}),[Gt]),Object(a.useEffect)((function(){gt("left"),Object(u.m)("Automation #"+v)}),[qt]),Object(a.useEffect)((function(){dt(parseInt(v)===parseInt(Yt)&&""!==Ft&&""===ft?Ft:""!==ft?ft:Object(a.createElement)("div",{className:"bwf-placeholder-temp bwf-h-15 bwf-w-90"}))}),[Ft,ft,v]);var zt,Qt=Object(a.useMemo)((function(){var t={};if(Array.isArray(st)){var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=V(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var a=0,o=function(){};return{s:o,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){c=!0,r=t},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw r}}}}(st);try{for(n.s();!(e=n.n()).done;){var a=e.value;t[a.ID]=a}}catch(t){n.e(t)}finally{n.f()}}return t}),[st]),$t=Object(A.b)(Qt),Kt=$t.singleSelectProps,Xt=$t.selectAllProps,Zt=$t.floatingBarProps,te=$t.resetSelection,ee=$t.selected,ne=void 0===ee?{}:ee,ae=Object.keys(ne).filter((function(t){return ne[t]})).length,oe=[{key:"select_contact",label:Object(a.createElement)(L.a,F({type:"checkbox",checked:!1,onChange:function(){}},Xt)),isLeftAligned:!0,required:!0,cellClassName:"bwf-col-action bwf-w-30 bwf-table-col-sticky bwf-sticky-left"},{key:"action",label:"",isLeftAligned:!0,required:!0,cellClassName:"bwf-col-action bwf-w-30 bwf-table-col-sticky bwf-sticky-left"},{key:"contact",label:Object(o.__)("Contact","wp-marketing-automations"),required:!0,cellClassName:"bwf-crm-col-contact bwf-w-210 bwf-table-col-sticky bwf-sticky-left"},{key:"details",label:Object(o.__)("Details","wp-marketing-automations"),cellClassName:"bwf-crm-col-contact-details"},{key:"startedon ",label:Object(o.__)("Started On","wp-marketing-automations"),cellClassName:"bwf-crm-col-stats-m"},{key:"last_run",label:"completed"===B?Object(o.__)("Completed On","wp-marketing-automations"):Object(o.__)("Last Run","wp-marketing-automations"),cellClassName:"bwf-crm-col-stats-m bwf-w-180"},"failed"===B&&{key:"error_msg",label:Object(o.__)("Reason","wp-marketing-automations"),cellClassName:"bwf-crm-col-stats-m bwf-w-210 bwf-word-break",isLeftAligned:!0},"active"===B&&{key:"next_last_run",label:Object(o.__)("Next Run Time","wp-marketing-automations"),cellClassName:"bwf-crm-col-stats-m bwf-w-120"},{key:"journey",label:Object(o.__)("Journey","wp-marketing-automations"),cellClassName:"bwf-crm-col-stats-m bwf-w-90 bwf-table-col-sticky bwf-sticky-right"}],re=function(){var t=M(D().mark((function t(n){var a,o,r=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=r.length>1&&void 0!==r[1]?r[1]:{},o=r.length>2&&void 0!==r[2]?r[2]:0,J(G(G({},a),{},{status:!0})),t.prev=3,t.next=6,_()({path:Object(u.A)("/automation/".concat(v,"/delete-contact")),method:"DELETE",data:{trail_id:n,ac_id:o,type:B}}).then((function(t){if(200!==t.code)throw Error(Object(u.u)(null==t?void 0:t.message));J({status:!1}),e(t.message),_t(v,Vt,Jt,B,K)})).catch((function(t){throw Error(Object(u.u)(null==t?void 0:t.message))}));case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(3),J(G(G({},a),{},{status:!0,error:t.t0.message}));case 11:Object(u.Lb)(e,3e3);case 12:case"end":return t.stop()}}),t,null,[[3,8]])})));return function(e){return t.apply(this,arguments)}}(),ie=function(){var t=M(D().mark((function t(n,a,o){return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e("Updating status..."),t.prev=1,t.next=4,_()({path:Object(u.A)("/automation/".concat(n,"/contact/status")),method:"POST",data:{to:o,from:a}}).then((function(t){200===t.code?(e(t.message),_t(v,Vt,Jt,B,K)):e(t.message)}));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),e(t.t0.message);case 9:Object(u.Lb)(e,3e3);case 10:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(e,n,a){return t.apply(this,arguments)}}(),ce=ut.getContactPage(),ue=function(t){t!==Vt&&(kt("limit",t),kt("offset",0))},se=function(t){return Object(a.createElement)(l.a,{href:"admin.php?page=autonami&path=/contact/"+t.cid,type:"bwf-crm",className:"bwf-crm-campaign-contactData-contact-link bwf-a-no-underline",key:t.cid},Object(a.createElement)(m.a,{contact:t,date:t.date,dateText:Object(o.__)("Joined on","wp-marketing-automations")}))},le=function(t){var e=t.trail,n=void 0===e?"":e;return Object(y.isEmpty)(n)?"-":Object(a.createElement)(O.Button,{isSecondary:!0,className:"bwf-btn-small is-light bwf-btn-gray",onClick:function(){Object(u.ac)()?(Q(n),ct(t)):(ot(G(G({},at),{},{featureTitle:Object(o.__)("Contact Journey","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contacts+Journey+Upgrade+Modal"})})),et(!0))}},!Object(u.ac)()&&Object(a.createElement)(h.a,{icon:"king",size:16}),Object(o.__)("View","wp-marketing-automations"))},me={1:Object(o.__)("Delay","wp-marketing-automations"),2:Object(o.__)("Action","wp-marketing-automations"),3:Object(o.__)("Goal","wp-marketing-automations"),4:Object(o.__)("Condition","wp-marketing-automations")},fe=function(t){var e=t.data,n=void 0===e?{}:e;if(Object(y.isEmpty)(n))return Object(a.createElement)(a.Fragment,null);var o=n.action,r=void 0===o?"":o,i=n.run_time,c=void 0===i?"":i,s=n.type,l=void 0===s?"":s;return Object(a.createElement)("div",{className:"bwf-c-contact-details-cell"},!Object(y.isEmpty)(l)&&!Object(y.isEmpty)(r)&&me.hasOwnProperty(parseInt(l))&&Object(a.createElement)(d.a,{justify:"justify",align:"top"},Object(a.createElement)(d.c,null,Object(a.createElement)("span",{className:"bwf_bold"},me[parseInt(l)]),Object(y.isEmpty)(r)?"":" : "+r)),!Object(y.isEmpty)(c)&&Object(a.createElement)(d.a,{justify:"justify",align:"top"},Object(a.createElement)(d.c,null,Object(u.ib)(c))),(Object(y.isEmpty)(l)||!me.hasOwnProperty(parseInt(l)))&&Object(y.isEmpty)(c)&&Object(a.createElement)("span",null,"-"))},pe=function(t){var e=t.data,n=void 0===e?{}:e;return!(!n.hasOwnProperty("type")||3!==parseInt(n.type))},be=[{slug:1===parseInt(Gt)?"active":"inactive",name:1===parseInt(Gt)?Object(o.__)("Active","wp-marketing-automations"):Object(o.__)("Inactive","wp-marketing-automations"),path:"/automation/".concat(v,"/contacts/").concat(1===parseInt(Gt)?"active":"inactive")},{slug:"failed",name:Object(o.__)("Failed","wp-marketing-automations"),path:"/automation/".concat(v,"/contacts/failed")},{slug:"completed",name:Object(o.__)("Completed","wp-marketing-automations"),path:"/automation/".concat(v,"/contacts/completed")},{slug:"paused",name:Object(o.__)("Paused","wp-marketing-automations"),path:"/automation/".concat(v,"/contacts/paused")}];return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{dangerouslySetInnerHTML:{__html:"<style>#bwfcrm-page{ overflow: auto !important; }</style>"}}),Object(a.createElement)(s.a,null),Object(a.createElement)("div",{className:"bwf-single-automation-body-header",style:{paddingBottom:"8px"}},Object(a.createElement)("div",{className:"bwf-content-header-left"},Object(a.createElement)("div",{className:"bwf-content-header-title2"},Object(o.__)("Contacts","wp-marketing-automations")),parseInt(Ht)>0&&Object(a.createElement)("div",{className:"bwf-content-header-count"},Object(o.sprintf)(Object(o.__)("(%s Results)","wp-marketing-automations"),Ht)))),Object(a.createElement)(P.a,{tabs:be,selected:B,count:Wt,disableUrlUpdate:!0,onChange:function(t,e){kt("offset",0),Object(I.l)({page:"autonami",path:e},"/",{})}}),Object(a.createElement)(r.a,{className:"bwf-crm-automation-contact has-search",rows:st.map((function(t){var e,n,r,i,c,s,l,m,f,p=[];return p.push({display:Kt.hasOwnProperty(t.ID)?Object(a.createElement)(L.a,F({type:"checkbox",checked:!1,onChange:function(){}},Kt[t.ID])):Object(a.createElement)(a.Fragment,null),value:null},{display:(n=t,r=n.status,i=void 0===r?"":r,c=n.trail,s=void 0===c?"":c,l=n.ID,m=n.aid,f=void 0===m?"":m,Object(a.createElement)(b.a,{label:Object(o.__)("Quick Actions","wp-marketing-automations"),menuPosition:"bottom right",renderContent:function(t){var e=t.onToggle;return Object(a.createElement)(a.Fragment,null,[1,4,6].includes(parseInt(i))&&"inactive"!==B&&Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){Object(u.ac)()?ie(l,i,"now"):(ot(G(G({},at),{},{featureTitle:Object(o.__)("Run Now Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Run+Now+Upgrade+Modal"})})),et(!0)),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("Run Now","wp-marketing-automations")),!Object(u.ac)()&&Object(a.createElement)(d.c,null,u.e))),[1,4,6].includes(parseInt(i))&&"inactive"!==B&&Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){Object(u.ac)()?ie(l,i,3):(ot(G(G({},at),{},{featureTitle:Object(o.__)("Pause Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Pause+Upgrade+Modal"})})),et(!0)),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("Pause Automation","wp-marketing-automations")),!Object(u.ac)()&&Object(a.createElement)(d.c,null,u.e))),3===parseInt(i)&&"inactive"!==B&&Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){Object(u.ac)()?ie(l,i,1):(ot(G(G({},at),{},{featureTitle:Object(o.__)("Resume Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Resume+Upgrade+Modal"})})),et(!0)),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("Resume Automation","wp-marketing-automations")),!Object(u.ac)()&&Object(a.createElement)(d.c,null,u.e))),2===parseInt(i)&&"inactive"!==B&&Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){Object(u.ac)()?ie(l,i,6):(ot(G(G({},at),{},{featureTitle:Object(o.__)("Retry Action","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Retry+Action+Upgrade+Modal"})})),et(!0)),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("Retry Action","wp-marketing-automations")),!Object(u.ac)()&&Object(a.createElement)(d.c,null,u.e))),[2].includes(parseInt(i))&&"inactive"!==B&&Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){Object(u.ac)()?ie(l,i,"startbegin"):(ot(G(G({},at),{},{featureTitle:Object(o.__)("Re-Enter Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Re+Automation+Upgrade+Modal"})})),et(!0)),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("Re-Enter Automation","wp-marketing-automations")),!Object(u.ac)()&&Object(a.createElement)(d.c,null,u.e))),!Object(y.isEmpty)(i)&&"inactive"!==B&&Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){ie(l,i,"end"),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("End Automation","wp-marketing-automations")))),"completed"===B&&Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){Object(u.ac)()?ie(l,i,"re_run"):(ot(G(G({},at),{},{featureTitle:Object(o.__)("Restart Automation","wp-marketing-automations"),proLink:Object(u.fb)("upgrade",{utm_medium:"Automation+Contact+Activity+Restart+Upgrade+Modal"})})),et(!0)),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("Restart Automation","wp-marketing-automations")),!Object(u.ac)()&&Object(a.createElement)(d.c,null,u.e))),Object(a.createElement)(g.a,{isClickable:!0,onInvoke:function(){var t={status:!0,deleteEntityName:Object(a.createElement)(a.Fragment,null,Object(a.createElement)("span",{style:{fontWeight:"normal"}},Object(o.__)("contact ")),n.f_name," ",n.l_name),buttonConfirm:Object(o.__)("Delete","wp-marketing-automations"),buttonCancel:Object(o.__)("Cancel","wp-marketing-automations"),modalTitle:Object(o.__)("Delete Contact","wp-marketing-automations"),entityExtraText:Object(o.__)("from this automation","wp-marketing-automations"),aid:f};J(G(G({},t),{},{onConfirm:function(){return re(s,t,l)}})),e()}},Object(a.createElement)(d.a,{justify:"space-between"},Object(a.createElement)(d.c,null,Object(o.__)("Delete","wp-marketing-automations")))))}})),value:""},{display:se(t),value:t.hasOwnProperty("contact_name")?t.contact_name:"-"},{display:(e=t,Object(a.createElement)("div",{className:"bwf-c-contact-details-cell"},e.email&&Object(a.createElement)(d.a,{justify:"justify",align:"top"},Object(a.createElement)(d.c,null,e.email)),e.contact_no&&Object(a.createElement)(d.a,{justify:"justify",align:"top"},Object(a.createElement)(d.c,null,e.contact_no)),!e.email&&!e.contact_no&&"-")),value:""},{display:t.hasOwnProperty("c_date")?Object(u.ib)(t.c_date):"-",value:t.hasOwnProperty("c_date")?t.c_date:"-"}),"active"===B&&p.push({display:fe(t),value:""}),p.push({display:t.hasOwnProperty("e_time")&&!pe(t)?Object(u.ib)(t.e_time):"-",value:"-"}),"failed"===B&&p.push({display:t.hasOwnProperty("error_msg")&&!Object(y.isEmpty)(t.error_msg)?t.error_msg:"-",value:""}),p.push({display:le(t),value:"-"}),p})),headers:oe.filter((function(t){return!!t})),query:{paged:ce},rowsPerPage:Vt,totalRows:Ht,isLoading:qt,onPageChange:function(t){kt("offset",(t-1)*Vt)},onQueryChange:function(t){return"per_page"!==t?function(){}:ue},rowHeader:!0,showMenu:!1,emptyMessage:Object(o.__)("No contacts found","wp-marketing-automations"),actions:ae>0?[Object(a.createElement)(A.a,F({key:"list-bulk-action",actions:H(B),onAction:Dt,inLine:!0,reset:Rt},Zt))]:[Object(a.createElement)(x.a,{key:"search",isLoading:qt,searchTerm:K,showResultCount:!1,setSearchData:function(t){Object(y.size)(t)?X(t):X("")}})]}),Object(u.ac)()&&!Object(y.isEmpty)(z)&&Object(a.createElement)(O.Modal,{title:"",className:"bwf-admin-modal bwf-admin-modal-no-header bwf-admin-modal-fullscreen bwf-fullsc-modal",shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1},Object(a.createElement)("div",{className:"bwf-stretch-header-single"},Object(a.createElement)("div",{className:"bwf-modal-heading"},(zt="-",Object(y.isEmpty)(it)||(zt=Object(y.isEmpty)(it.f_name)&&Object(y.isEmpty)(it.l_name)?it.email:it.f_name+" "+it.l_name),zt)," ",Object(a.createElement)("span",{className:"bwf-tags bwf-tag-light-blue"},Object(o.__)("Customer Journey","wp-marketing-automations"))),Object(a.createElement)("div",{className:"bwf-display-flex gap-24"},Object(a.createElement)(O.Button,{isSecondary:!0,className:"bwf-btn-small is-light bwf-btn-gray",onClick:function(){Object(I.l)({page:"autonami",path:"/automation/"+it.aid},"/",{})}},Object(o.__)("View Automation","wp-marketing-automations")),Object(a.createElement)("span",{onClick:function(){Q(""),ct({})},className:"bwf-modal-close"},Object(a.createElement)(h.a,{icon:"close",color:"#353030"})))),Object(a.createElement)(w.e,null,Object(a.createElement)(j.a,{customerData:{trail:z},isConatctTab:!0,automatonID:v,hasHeader:!0}))),Object(a.createElement)(k.a,{modalTitle:Y.modalTitle,content:Y.content,deleteEntityName:Y.deleteEntityName,confirmText:Y.confirmText,confirmButtonText:Y.buttonConfirm,cancelButtonText:Y.buttonCancel,onConfirm:Y.onConfirm,entityExtraText:Y.entityExtraText,isLoading:Y.loading,successMessage:Y.success,errorMessage:Y.error,onRequestClose:function(){return J({status:!1})},isOpen:Y.status,isDelete:!0}),!Object(u.ac)()&&Object(a.createElement)(T.b,{isOpen:tt,onRequestClose:function(){return et(!1)},modalContent:at}),Object(a.createElement)(S.a,{tasks:Ct,isOpen:Lt,onSuccess:function(){_t(v,Vt,Jt,B,K),Rt()},onError:Rt,onRequestClose:function(){return xt(!1)},screenType:"automation-contact",screenTypeId:B,actionType:Tt}))}}}]); |