(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{1066:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r(0);var a=function(t,e){var r=Object(n.useRef)();Object(n.useEffect)((function(){r.current=t}),[t]),Object(n.useEffect)((function(){if(null!==e){var t=setInterval((function(){r.current()}),e);return function(){return clearInterval(t)}}}),[e])}},1446:function(t,e,r){"use strict";r.r(e);var n=r(0),a=r(5),o=r(1),i=r(1063),c=r(1076),s=r(3),u=(r(1222),r(33)),l=r(62),f=r(19),m=r(61),p=r(55),b=r(344);function h(t){return(h="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={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),c=new P(n||[]);return a(i,"_invoke",{value:x(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var m="suspendedStart",p="executing",b="completed",y={};function v(){}function w(){}function g(){}var O={};u(O,i,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&n.call(E,i)&&(O=E);var _=g.prototype=v.prototype=Object.create(O);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(a,o,i,c){var s=f(t[a],t,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==h(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function x(e,r,n){var a=m;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===b){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var s=S(c,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===m)throw a=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var u=f(e,r,n);if("normal"===u.type){if(a=n.done?b:"suspendedYield",u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=b,n.method="throw",n.arg=u.arg)}}}function S(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}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 I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;I(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function y(t,e,r,n,a,o,i){try{var c=t[o](i),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,a)}function v(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;S(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function H(t,e,r,n,a,o,i){try{var c=t[o](i),s=c.value}catch(t){return void r(t)}c.done?e(s):Promise.resolve(s).then(n,a)}function M(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){H(o,n,a,i,c,"next",t)}function c(t){H(o,n,a,i,c,"throw",t)}i(void 0)}))}}function Y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o,i,c=[],s=!0,u=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){u=!0,a=t}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return q(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?q(t,e):void 0}}(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 q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:0;t&&(d(t),Object(F.l)({page:"autonami",path:"/broadcast/"+t.id},"/",{})),r(!1)},v=Object(A.useMutation)(function(){var t=M(R().mark((function t(e){return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,I()({path:Object(s.A)("/broadcast/"),method:"POST",data:e});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(t){return y(t.result)},onError:function(){return y()}}),w=Object(n.useCallback)(M(R().mark((function t(){var e;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r(!0),e={title:Object(o.__)("Send to Unopen","wp-marketing-automations"),description:"",type:h.type,created_by:Object(s.N)(),createUnopen:h.id},v.mutate(e);case 3:case"end":return t.stop()}}),t)}))),[h]);return Object(n.useEffect)((function(){v.isSuccess&&(r(!1),v.reset())}),[v.isSuccess]),Object(n.createElement)(n.Fragment,null,Object(n.createElement)(p.a,{modalTitle:Object(o.__)("Create Broadcast","wp-marketing-automations"),onRequestClose:function(){r(!1),b(!1),v.reset()},content:Object(o.__)("This will create a new broadcast for contacts who have not opened this broadcast. Are you sure you want to proceed?","wp-marketing-automations"),isLoading:e,errorMessage:v.isError&&(v.error&&v.error.message?v.error.message:Object(o.__)("Unable to create unopen broadcast","wp-marketing-automations")),onConfirm:w,isOpen:m}),Object(n.createElement)(D.a,{isSecondary:!0,className:"bwf-display-flex",onClick:function(){Object(s.ac)()?b(!0):l(!0)}},!Object(s.ac)()&&Object(n.createElement)(G.a,{icon:"king",size:16}),Object(o.__)("Send to Unopen","wp-marketing-automations")),!Object(s.ac)()&&Object(n.createElement)(B.b,{isOpen:u,onRequestClose:function(){return l(!1)},modalContent:{isFeature:!0,featureTitle:Object(o.__)("Create Unopen Broadcast","wp-marketing-automations")}}))},$=function(){var t=i.a.getCampaignData();return 4===parseInt(t.status)&&1===parseInt(t.type)&&!t.is_unopen_grandchild&&Object(n.createElement)(a.Card,{className:"bwf-crm-overview-detail-wrap bwf-card-display-block"},Object(n.createElement)(a.CardHeader,{className:"bwf-crm-overview-report-header"},Object(o.__)("Actions","wp-marketing-automations")),Object(n.createElement)(a.CardBody,null,Object(n.createElement)("div",{className:"bwf-report-row",key:1},Object(n.createElement)("div",{className:"bwf-report-row-label bwf-report-row-full"},Object(o.__)("Send to contacts who haven't opened the emails yet.","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf_clear_20"}),Object(n.createElement)("div",null,Object(n.createElement)(V,null)))))},z=r(26);function J(t){return(J="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 Q(){Q=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,i=Object.create(o.prototype),c=new L(n||[]);return a(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var m="suspendedStart",p="executing",b="completed",h={};function d(){}function y(){}function v(){}var w={};u(w,i,(function(){return this}));var g=Object.getPrototypeOf,O=g&&g(g(I([])));O&&O!==r&&n.call(O,i)&&(w=O);var j=v.prototype=d.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(a,o,i,c){var s=f(t[a],t,o);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==J(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(s.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function k(e,r,n){var a=m;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===b){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var s=N(c,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===m)throw a=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var u=f(e,r,n);if("normal"===u.type){if(a=n.done?b:"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=b,n.method="throw",n.arg=u.arg)}}}function N(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,N(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function x(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;S(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),h}},e}function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function K(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r1?Object(o.__)("Content #","wp-marketing-automations")+(parseInt(e)+1):Object(o.__)("Content","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-report-row-value bwf-report-value-modal"},1===parseInt(u.type)&&t.subject&&Object(n.createElement)("span",null,t.subject),Object(n.createElement)(a.Button,{isTertiary:!0,className:"bwf-btn-small is-light",onClick:tt(Q().mark((function e(){var r;return Q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,q(t,1);case 3:r=e.sent,A(r);case 5:case"end":return e.stop()}}),e)})))},Object(o.__)("View details","wp-marketing-automations"))))})),!!u.data&&u.data.hasOwnProperty("smart_send")&&u.data.smart_send.hasOwnProperty("enable")&&u.data.smart_send.enable&&function(){var t=u.data,e=t.smart_send,r=void 0===e?{}:e,a=t.smart_send_stat,i=void 0===a?{}:a,c=t.content,s=void 0===c?[]:c,l=t.winner,f=void 0===l?"":l;if(Object(P.isEmpty)(r))return Object(n.createElement)(n.Fragment,null);var m=[];return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-report-row",key:11},Object(n.createElement)("div",{className:"bwf-report-row-label"},Object(o.__)("Smart sending","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-report-row-value"},Object(o.__)("Enabled","wp-marketing-automations"))),Object(n.createElement)("div",{className:"bwf-report-row",key:12},Object(n.createElement)("div",{className:"bwf-report-row-label"},Object(o.__)("Sample size","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-report-row-value"},r.percent+" %")),Object(n.createElement)("div",{className:"bwf-report-row",key:13},Object(n.createElement)("div",{className:"bwf-report-row-label"},Object(o.__)("Wait Time","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-report-row-value"},Object(o.sprintf)(Object(o._n)("%s Hour","%s Hours",parseInt(r.hours),"wp-marketing-automations"),parseInt(r.hours)))),s.length>0&&!Object(P.isEmpty)(i)&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-report-row",key:11},Object(n.createElement)("div",{className:"bwf-report-row-label"},Object(o.__)("Smart Sending Stats","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-report-row-value"},s.map((function(t,e){var r=t.template_id,a=void 0===r?"":r;return""===a||!i.hasOwnProperty(a)||m.includes(a)?Object(n.createElement)(n.Fragment,null):(m.push(a),Object(n.createElement)("div",{className:"bwf-smart-send-analytics-item",key:e},Object(n.createElement)("div",{className:"bwf-smart-send-analytics-header"},Object(n.createElement)("span",{className:"bwf-smart-send-title"},Object(o.__)("Content #","wp-marketing-automations")+(parseInt(e)+1)),a==f&&Object(n.createElement)(G.a,{icon:"winner"})),Object(n.createElement)("div",{className:"bwf-smart-send-analytics-content"},i[a].map((function(t,e){return Object(n.createElement)("div",{className:"bwf-smart-send-test-content-stat",key:e},Object(n.createElement)("span",{className:"bwf-smart-send-test-content-value"},t.v),Object(n.createElement)("span",{className:"bwf-smart-send-test-content-label"},t.l))})))))}))))))}(),Object(n.createElement)(S.a,{isOpen:d,isLoading:w,onRequestClose:function(){return y(!1)},subject:L.subject,preHeader:L.preheader,body:j,type:L.type,sourceType:2,mode:u.type,utm:L.utm}),Object(n.createElement)(p.a,{modalTitle:"Broadcast Action",confirmText:B.confirmText,confirmButtonText:B.buttonConfirm,cancelButtonText:B.buttonCancel,onConfirm:B.onConfirm,isLoading:B.loading,successMessage:B.success,errorMessage:B.error,onRequestClose:function(){return D({status:!1})},isOpen:B.status}))),Object(n.createElement)("div",{className:"bwf_clear_20"}),Object(n.createElement)($,null))))}}}]);