- 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
132 KiB
JavaScript
Executable File
1 line
132 KiB
JavaScript
Executable File
(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{1134:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(125),a={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};function o(t,e,r){if(Object(n.a)(t),r&&r.strictMode&&!t.startsWith("+"))return!1;if(Array.isArray(e))return e.some((function(e){if(a.hasOwnProperty(e)&&a[e].test(t))return!0;return!1}));if(e in a)return a[e].test(t);if(!e||"any"===e){for(var o in a){if(a.hasOwnProperty(o))if(a[o].test(t))return!0}return!1}throw new Error("Invalid locale '".concat(e,"'"))}a["en-CA"]=a["en-US"],a["fr-CA"]=a["en-CA"],a["fr-BE"]=a["nl-BE"],a["zh-HK"]=a["en-HK"],a["zh-MO"]=a["en-MO"],a["ga-IE"]=a["en-IE"],a["fr-CH"]=a["de-CH"],a["it-CH"]=a["fr-CH"];Object.keys(a)},1428:function(t,e,r){},1438:function(t,e,r){"use strict";r.r(e);var n=r(0),a=r(5),o=r(11),i=r(1),c=r(1063),u=r(1076),l=r(9),s=r.n(l),f=r(12),m=r(3),d=r(2),b=r(200),p=r(158),h=r(1072),g=r(1068),y=r(48);function v(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return w(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)?w(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 w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var O=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},j=function(t){var e=Object(h.a)().sendTestEmail,r=(0,Object(g.a)().getSendTestEmailStatus)(),a=v(Object(n.useState)("http://app.getautonami.com"),2),o=a[0],c=a[1],u=Object(n.useRef)();Object(n.useEffect)((function(){u.current=t}),[t]);var l=function(t){if(-1!==t.origin.indexOf("app.getautonami.com")&&t.data&&t.data.action&&"send_test_email"===t.data.action&&t.data.token===O.editor_nonce&&t.data.data){var r=t.data.data,n=r.email,a=r.body,o=r.subject,l=void 0===o?"":o;n&&a&&(c(t.origin),e(n,u.current,l||Object(i.__)("FunnelKit Automations - Test email subject","wp-marketing-automations"),a))}};return Object(n.useEffect)((function(){return window.addEventListener("message",l),function(){return window.removeEventListener("message",l)}}),[]),Object(n.useEffect)((function(){if(r&&1!==r){var t=2===r,e=document.getElementById("bwf_email_editor_frame");e&&e.contentWindow.postMessage({token:O.editor_nonce,action:"send_test_email",data:{isSent:t}},o)}}),[r]),!0};function _(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||k(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||k(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 k(t,e){if(t){if("string"==typeof t)return S(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)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var L=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},x=function(t){var e=Object(h.a)().saveBroadcastContent,r=Object(g.a)(),a=r.getSaveContentStatus,o=r.getEmailsToSubmit,i=r.getCurrentEmailIndex,c=a(),u=o(),l=i(),s=Object(n.useRef)(u),f=Object(n.useRef)(l);Object(n.useEffect)((function(){s.current=u,f.current=l}),[u,l]);var m=E(Object(n.useState)("http://app.getautonami.com"),2),d=m[0],b=m[1],p=function(t){if(-1!==t.origin.indexOf("app.getautonami.com")&&t.data&&t.data.action&&"save_design"===t.data.action&&t.data.token===L.editor_nonce&&t.data.data){var r=t.data.data,n=r.body,a=r.design;if(n&&a){b(t.origin);var o=_(s.current);o[f.current].editor={body:n,design:a},e(o,!0)}}};return Object(n.useEffect)((function(){return window.addEventListener("message",p),function(){return window.removeEventListener("message",p)}}),[]),Object(n.useEffect)((function(){if(c&&1!==c&&t){var e=2===c,r=document.getElementById("bwf_email_editor_frame");r&&r.contentWindow.postMessage({token:L.editor_nonce,action:"save_design",data:{isSaved:e}},d)}}),[c]),!0};function C(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return N(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)?N(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 N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var T=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},P=function(){var t=C(Object(n.useState)("http://app.getautonami.com"),2),e=t[0],r=t[1],a=function(t){-1!==t.origin.indexOf("app.getautonami.com")&&t.data&&t.data.action&&"wp_image_upload"===t.data.action&&t.data.token===T.editor_nonce&&t.data.data&&(r(t.origin),s())},o=Object(n.useRef)(),c=C(Object(n.useState)(""),2),u=c[0],l=c[1],s=function(){if(!wp||!wp.media)return"";o.current||(o.current=wp.media({title:Object(i.__)("Select or Upload Media","wp-marketing-automations"),button:{text:"Select Image"},multiple:!1}),o.current.on("select",(function(){var t=o.current.state().get("selection").first().toJSON();l(t.url)}))),o.current.open()};return Object(n.useEffect)((function(){return window.addEventListener("message",a),function(){return window.removeEventListener("message",a)}}),[]),Object(n.useEffect)((function(){if(u){var t=document.getElementById("bwf_email_editor_frame");t&&t.contentWindow.postMessage({token:T.editor_nonce,action:"wp_image_upload",data:{isUploaded:!0,imageURL:u}},e)}}),[u]),!0},$=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},A=function(t){var e=(0,Object(g.a)().getEmailContent)(),r=Object(n.useRef)(),a=Object(n.useRef)();Object(n.useEffect)((function(){r.current=e,a.current=function(t){var e={};for(var r in t){var n=t[r];if(n){var a={};for(var o in n)n[o]&&n[o].hasOwnProperty("tag_description")&&n[o].hasOwnProperty("tag_name")&&(a[o]={name:n[o].tag_description,value:"{{".concat(n[o].tag_name,"}}")});e[r]={name:r,mergeTags:a}}}return e}(t)}),[e,t]);var o=function(t){if(-1!==t.origin.indexOf("app.getautonami.com")&&t.data&&t.data.action&&"get_design"===t.data.action&&t.data.token===$.editor_nonce){var e=Object(m.Gb)(),n=r.current&&r.current.editor&&r.current.editor.design?r.current.editor.design:e,o=document.getElementById("bwf_email_editor_frame");o&&o.contentWindow.postMessage({token:$.editor_nonce,action:"get_design",data:{gotDesign:!0,json:n,subject:r.current&&r.current.subject?r.current.subject:"",mergeTags:a.current,enableLinkTrigger:!0,textDirection:Object(m.ec)()?"rtl":""}},t.origin)}};return Object(n.useEffect)((function(){return window.addEventListener("message",o),function(){return window.removeEventListener("message",o)}}),[]),!0},I=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},M=function(t){var e=function(e){-1!==e.origin.indexOf("app.getautonami.com")&&e.data&&e.data.action&&"open_merge_tags"===e.data.action&&e.data.token===I.editor_nonce&&e.data.data&&t&&t()};return Object(n.useEffect)((function(){return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}}),[]),!0},R=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},F=function(t){var e=function(e){-1!==e.origin.indexOf("app.getautonami.com")&&e.data&&e.data.action&&"close_editor"===e.data.action&&e.data.token===R.editor_nonce&&e.data.data&&t&&t()};return Object(n.useEffect)((function(){return window.addEventListener("message",e),function(){return window.removeEventListener("message",e)}}),[]),!0},G=r(472),D=function(t){var e=function(){t&&t()};return Object(n.useEffect)((function(){return window.history.pushState(null,null,window.location.href),window.addEventListener("popstate",e),function(){return window.removeEventListener("popstate",e)}}),[]),!0},B=r(8),U=r(40),V=r(26),H=r(55);function z(t){return(z="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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new C(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=s;var m="suspendedStart",d="executing",b="completed",p={};function h(){}function g(){}function y(){}var v={};l(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(N([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=y.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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===d)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 u=S(c,n);if(u){if(u===p)continue;return u}}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=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?b:"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=b,n.method="throw",n.arg=l.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")),p;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;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,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(z(e)+" is not iterable")}return g.prototype=y,a(j,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,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 r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}function K(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 Y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?K(Object(r),!0).forEach((function(e){W(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=z(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==z(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Z(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}function J(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)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);r<e;r++)n[r]=t[r];return n}var X=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},tt=function(){return Object(n.createElement)("div",{className:"bwf-c-save-content-loading"},Object(n.createElement)(y.a,null),Object(n.createElement)("h3",null,Object(i.__)("Loading Visual Builder","wp-marketing-automations")))},et=function(t){var e=t.iframeRef,r=t.editorSrc;return Object(n.createElement)("iframe",{ref:e,title:Object(i.__)("Email Editor","wp-marketing-automations"),src:r,id:"bwf_email_editor_frame",style:{width:"100%",height:"100%"}})},rt=function(t){var e=Object(f.i)(),r=J(Object(n.useState)(!1),2),c=r[0],u=r[1],l=J(Object(n.useState)(!1),2),b=l[0],p=l[1],y=J(Object(n.useState)(!1),2),v=y[0],w=y[1],O=J(Object(n.useState)(!1),2),_=O[0],E=O[1],k=J(Object(n.useState)({status:!1}),2),S=k[0],L=k[1],C=t.broadcastId,N=t.contentNumber,T=t.openMergeTags,$=t.mailData,I=t.mergeTags,R=t.openLinkTrigger,z=X.license,K=X.editor_nonce,W=X.url,Q=Object(h.a)(),rt=Q.fetchCurrentMailEditorContent,nt=Q.saveBroadcastContent,at=Q.resetSaveContentStatus,ot=Q.setEmailContentForBlock,it=Object(g.a)(),ct=it.getSaveContentStatus(),ut=it.getEmailContent(),lt=J(Object(n.useState)(!1),2),st=lt[0],ft=lt[1];Object(n.useEffect)((function(){st||2!==ct&&3!==ct||(ft(!0),at())}),[ct]);var mt=Object(n.useCallback)((function(){u(!1),rt()}));A(I||[]),j($),x(st),P(),M(T),F(mt),Object(G.a)(R),D(mt);var dt="//app.getautonami.com/get/".concat(z,"/").concat(K,"/").concat(W,"/crm.broadcast.").concat(C,".content.").concat(N),bt=Object(n.useRef)();Object(n.useEffect)((function(){c?(nt(),document.body.classList.add("bwf-c-modal-open")):(ft(!1),document.body.classList.remove("bwf-c-modal-open"))}),[c]);var pt=function(){var t,r=(t=q().mark((function t(){var r,n;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=ut.editor,!(n=void 0===r?{}:r).hasOwnProperty("design")||Object(d.isEmpty)(n.design)){t.next=12;break}return t.prev=2,w(!0),t.next=6,s()({path:Object(m.A)("/block-migrator"),method:"POST",data:{unlayer_data:n.design,domain:W,key:z}}).then((function(t){if(t.hasOwnProperty("result")){var r=t.result,n=r.status,a=void 0!==n&&n,o=r.block_data,c=void 0===o?{}:o;if(a&&!Object(d.isEmpty)(c)&&c.hasOwnProperty("body")&&""!==c.body&&c.hasOwnProperty("settings")&&!Object(d.isEmpty)(c.settings))ot(c),Object(f.l)(Y(Y({},e),{},{editor:"block"}),"/",{});else{if(t.result.hasOwnProperty("license_error"))return w(!1),void E(!0);L({status:!0,error:t.hasOwnProperty("message")&&""!==t.message?t.message:Object(i.__)("Failed to migrate the content. Please try again later.","wp-marketing-automations")})}}else L({status:!0,error:t.hasOwnProperty("message")&&""!==t.message?t.message:Object(i.__)("Failed to migrate the content. Please try again later.","wp-marketing-automations")});w(!1)}));case 6:t.next=12;break;case 8:t.prev=8,t.t0=t.catch(2),w(!1),L({status:!0,error:t.t0.hasOwnProperty("message")&&""!==t.t0.message?t.t0.message:Object(i.__)("Failed to migrate the content. Please try again later.","wp-marketing-automations")});case 12:case"end":return t.stop()}}),t,null,[[2,8]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){Z(o,n,a,i,c,"next",t)}function c(t){Z(o,n,a,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),ht=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return Object(n.createElement)(V.a,{status:"error",className:t?"bwf-m-0 bwf-no-b-radius bwf-w-100p bwf-ptb-5 bwf-unlayer-notice-center":"bwf-mb-16 bwf-mt-0"},Object(n.createElement)("div",{className:"bwf-display-flex"},Object(n.createElement)("div",null,Object(n.createElement)("strong",null,Object(i.__)("Notice","wp-marketing-automations")),": "+Object(i.__)("The legacy visual builder will soon be deprecated. We recommend switching the content to the new email builder.","wp-marketing-automations")+" ",Object(n.createElement)("a",{href:Object(m.fb)("",{utm_campaign:"FKA+Pro+Plugin",utm_medium:"Migrate+Legacy+Email+Builder/"},"https://funnelkit.com/docs/autonami-2/email-builder/migration-from-legacy-email-builder/"),target:"__blank"},Object(n.createElement)("span",{className:"bwf_bold"},Object(i.__)("Learn More","wp-marketing-automations")))),Object(n.createElement)(o.a,{onClick:pt,className:"bwf-btn-small is-black bwf-no-wrap",isBusy:v},Object(i.__)("Switch to New Builder","wp-marketing-automations"))))};return Object(n.createElement)(n.Fragment,null,c&&Object(n.createElement)("div",{className:"bwf-c-editor-modal-wrapper",style:{flexDirection:"column"}},ht(!0),Object(n.createElement)("div",{className:"bwf-c-editor-modal bwf-c-editor-modal-full-width"},!st&&Object(n.createElement)(tt,null),!!st&&Object(n.createElement)(et,{iframeRef:bt,editorSrc:dt}))),Object(n.createElement)(n.Fragment,null,ht(!1),Object(n.createElement)("div",{className:"bwf-c-editor-button-wrapper"},Object(n.createElement)(B.a,{icon:"launch-editor",size:40}),Object(n.createElement)("div",{className:"bwf-heading5-new"},Object(i.__)("Visually get email with drop & drop builder.","wp-marketing-automations")),Object(n.createElement)(a.Button,{isTertiary:!0,onClick:function(){Object(m.ac)()?u(!0):p(!0)}},!Object(m.ac)()&&m.e,Object(i.__)("Edit","wp-marketing-automations")))),!Object(m.ac)()&&Object(n.createElement)(U.b,{isOpen:b,onRequestClose:function(){return p(!1)},modalContent:{isFeature:!0,featureTitle:Object(i.__)("Visual Builder","wp-marketing-automations"),proLink:Object(m.fb)("upgrade",{utm_medium:"Visual+Builder+Upgrade+Modal"})}}),_&&Object(n.createElement)(a.Modal,{title:Object(i.__)("License Invalid","wp-marketing-automations"),onRequestClose:function(){E(!1),u(!1)},className:"bwf-admin-modal bwf-admin-modal-squeezy"},Object(n.createElement)("div",{className:"bwf-p bwf-break-word"},Object(i.__)("Drag and Drop Email Editor requires an active license. Please go to ","wp-marketing-automations"),Object(n.createElement)("span",{className:"bwf_bold"},sprintf(Object(i.__)(" %s > %s ","wp-marketing-automations"),Object(i.__)("Settings","wp-marketing-automations"),Object(i.__)("General","wp-marketing-automations"))),Object(i.__)("and add valid license keys.","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-admin-modal-actions"},Object(n.createElement)(a.Button,{className:"bwf-modal-cancel-btn",onClick:function(){E(!1),u(!1)}},Object(i.__)("Cancel","wp-marketing-automations")),Object(n.createElement)(a.Button,{className:"components-button is-primary",onClick:function(){Object(f.l)({page:"autonami",path:"/settings"},"/",{})}},Object(i.__)("Go To Settings","wp-marketing-automations")))),Object(n.createElement)(H.a,{modalTitle:Object(i.__)("Migration","wp-marketing-automations"),errorMessage:S.error,onRequestClose:function(){return L({status:!1})},isOpen:S.status}))},nt=r(206),at=r(44),ot=r(6),it=r.n(ot),ct=r(83),ut=r(375);function lt(t){return(lt="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 st(){st=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new C(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=s;var m="suspendedStart",d="executing",b="completed",p={};function h(){}function g(){}function y(){}var v={};l(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(N([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=y.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==lt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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===d)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 u=S(c,n);if(u){if(u===p)continue;return u}}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=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?b:"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=b,n.method="throw",n.arg=l.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")),p;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;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,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(lt(e)+" is not iterable")}return g.prototype=y,a(j,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,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 r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}function ft(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}function mt(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){ft(o,n,a,i,c,"next",t)}function c(t){ft(o,n,a,i,c,"throw",t)}i(void 0)}))}}function dt(t){return function(t){if(Array.isArray(t))return ht(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||pt(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 pt(t,e){if(t){if("string"==typeof t)return ht(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)?ht(t,e):void 0}}function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var gt=function(t){var e=t.value,r=void 0===e?"":e,a=t.onUpdate,o=void 0===a?function(){}:a,i=t.label,c=void 0===i?"":i,u=t.placeholder,l=void 0===u?"":u,s=bt(Object(n.useState)(""),2),f=s[0],b=s[1],p=Object(n.useRef)(null),h=""!==r?r.split(","):[];return Object(n.createElement)(n.Fragment,null,""!==c&&Object(n.createElement)("div",{className:"bwf-add-mail-input-label"},c),Object(n.createElement)("div",{className:"bwf-add-mail-input-wrap",onClick:function(){return p.current.focus()}},function(){if(""!==r)return Object(n.createElement)(n.Fragment,null,h.map((function(t,e){return""!==t.trim()&&Object(n.createElement)("span",{key:e,className:"bwf-search__selected-tag",onClick:function(t){return t.stopPropagation()}},t,Object(n.createElement)("span",{onClick:function(e){e.stopPropagation();var r=dt(h).filter((function(e){return e!=t}));o(r.join(","))}},Object(n.createElement)(B.a,{size:16,icon:"cross-circle"})))})))}(),h.length<10&&Object(n.createElement)("input",{type:"text",ref:p,value:f,onChange:function(t){return b(t.target.value)},onKeyDown:function(t){if(["Enter"," "].includes(t.key)&&(t.preventDefault(),Object(m.gc)(f))){var e=Object(d.cloneDeep)(h);e.push(f),o(e.join(",")),b("")}},onBlur:function(t){if(t.preventDefault(),Object(m.gc)(f)){var e=Object(d.cloneDeep)(h);e.push(f),o(e.join(",")),b("")}},autoComplete:"off",placeholder:l})))},yt=function(t){var e=t.setPreview,r=t.content,c=t.type,u=t.maildata,l=bt(Object(n.useState)(Object(m.Cb)()),2),f=l[0],b=l[1],p=bt(Object(n.useState)(!0),2),v=p[0],w=p[1],O=bt(Object(n.useState)(Object(m.Cb)()),2),j=O[0],_=O[1],E=bt(Object(n.useState)(""),2),k=E[0],S=E[1],L=bt(Object(n.useState)(!1),2),x=L[0],C=L[1],N=bt(Object(n.useState)("desktop"),2),T=N[0],P=N[1],$=Object(h.a)(),A=Object(g.a)().validateCurrentEmail(),I=Object(n.useContext)(m.h),M=$.sendTestEmail;Object(n.useEffect)((function(){R()}),[]);var R=function(){var t=mt(st().mark((function t(){var e;return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r){t.next=4;break}return b(""),w(!1),t.abrupt("return");case 4:return t.prev=4,e={content:r,type:c},t.next=8,s()({path:Object(m.A)("/broadcast/email-preview"),method:"POST",data:e}).then((function(t){b(t.result.body.replace(/\\/g,"")),w(!1)}));case 8:t.next=12;break;case 10:t.prev=10,t.t0=t.catch(4);case 12:case"end":return t.stop()}}),t,null,[[4,10]])})));return function(){return t.apply(this,arguments)}}(),F=function(){var t=mt(st().mark((function t(){var e;return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(C(!0),r=void 0,r=!1,!Object(d.isEmpty)(j)&&A.content&&A.type&&A.utmMedium&&A.utmSource||(r=!0),r){t.next=7;break}return S(""),t.next=5,M(j,u,"","").then((function(t){setTimeout((function(){C(!1),Object(d.isInteger)(t)&&2===parseInt(t)?I(Object(i.__)("Test mail sent successfully.","wp-marketing-automations")):I(Object(i.__)("Test mail failed to send.","wp-marketing-automations")),Object(m.Lb)(I,3e3)}),1e3)}));case 5:t.next=12;break;case 7:e="",Object(d.isEmpty)(j)&&(e=Object(i.__)("Email is required.","wp-marketing-automations")),Object(d.isEmpty)(e)&&!A.content&&(e=Object(i.__)("Mail content is required field.","wp-marketing-automations")),S(e),C(!1);case 12:case"end":return t.stop()}var r}),t)})));return function(){return t.apply(this,arguments)}}();return Object(n.createElement)(a.Modal,{className:"bwf-admin-modal bwf-admin-modal-no-header bwf-admin-modal-fullscreen bwf-fullsc-modal",shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!1},Object(n.createElement)("div",{className:"bwf-stretch-header-single"},Object(n.createElement)("div",{className:"bwf-left-section"},Object(n.createElement)("div",{className:"bwf-editable-title"},Object(i.__)("Preview & Test","wp-marketing-automations"))),Object(n.createElement)("div",{className:"bwfan-responsive-toggle"},["desktop","mobile"].map((function(t){return Object(n.createElement)(o.a,{key:t,className:it()("bwf-responsive-toggle-icon",{"active-screen":T===t}),onClick:function(){void 0!==P&&P(t)},showTooltip:!1,size:20,title:Object(d.capitalize)(t)},Object(n.createElement)(B.a,{icon:t,size:20,color:T===t?"#353030":"#82838e"}))}))),Object(n.createElement)("div",{className:"bwf-right-section"},Object(n.createElement)("div",{className:"bwf-back-button bwf-display-flex bwf-cursor-pointer",onClick:function(){return e(!1)}},Object(n.createElement)(B.a,{icon:"cross"})))),Object(n.createElement)("div",{className:"bwf-preview-model-content"},Object(n.createElement)("div",{className:"bwf-preview-model-c-sidebar"},Object(n.createElement)("div",{className:it()("bwf-send-test-email",{"bwf-has-error":!!k})},Object(n.createElement)("div",{className:"bwf-send-test-email-header"},Object(i.__)("Send Test Email","wp-marketing-automations")),Object(n.createElement)(gt,{value:j,onUpdate:function(t){var e,r;Object(m.wc)(t),_(t),e=t,r="",Object(d.isEmpty)(e)&&(r=Object(i.__)("Email is required.","wp-marketing-automations")),S(r),Object(d.isEmpty)(r)},placeholder:Object(i.__)("Enter email address…","wp-marketing-automations")}),""!==k&&Object(n.createElement)("div",{className:"bwf-send-email-err"},k),Object(n.createElement)(o.a,{variant:"primary",className:"bwf-test-email-btn bwf-no-ripple "+(x?"isloading":""),onClick:F},x?Object(n.createElement)(ct.a,{color:"#ffffff"}):Object(i.__)("Send Email","wp-marketing-automations"))),!v&&Object(n.createElement)(ut.a,{previewData:f,content:r})),Object(n.createElement)("div",{className:"bwf-preview-model-c-preview"},Object(n.createElement)("div",{className:"bwf-iframe bwf-preview-screen-"+T},v?Object(n.createElement)(y.a,null):Object(n.createElement)("iframe",{srcDoc:f})))))},vt=r(1134),wt=r(487),Ot=r(169),jt=function(t){var e=t.enable,r=t.position,o=t.imageURL,c=t.setData;return Object(n.createElement)("div",{className:"bwf-c-campaign-email"},Object(n.createElement)("div",{className:"bwf_clear_16"}),Object(n.createElement)(a.ToggleControl,{label:Object(i.__)("Enable Image Sending","wp-marketing-automations"),className:"bwf-tooglecontrol-advance",checked:e,onChange:function(t){return c("enable",t)}}),e&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf_clear_16"}),Object(n.createElement)(a.RadioControl,{className:"bwfcrm-inline-option",selected:r,label:Object(i.__)("Select Image Position","wp-marketing-automations"),options:[{value:"after",label:Object(i.__)("After","wp-marketing-automations")},{value:"before",label:Object(i.__)("Before","wp-marketing-automations")}],onChange:function(t){return c("position",t)}}),Object(n.createElement)("div",{className:"bwf_clear_16"}),Object(n.createElement)(Ot.a,{image:o?{url:o}:"",onChange:function(t){!Object(d.isNull)(t)&&t.hasOwnProperty("url")?c("imageURL",t.url):c("imageURL","")}})))},_t=r(236),Et=r(47);function kt(t){return(kt="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 St(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 Lt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?St(Object(r),!0).forEach((function(e){xt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function xt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=kt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ct(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Nt(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)?Nt(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 Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Tt=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},Pt=function(){var t=Ct(Object(n.useState)(!1),2),e=t[0],r=t[1],a=Ct(Object(n.useState)(!1),2),o=a[0],i=a[1],c=Object(Et.a)(Object(m.zb)()).formatAmount,u=Object(n.useCallback)((function(t){var e=document.getElementById("bwf_email_editor_frame");e&&e.contentWindow.postMessage({token:Tt.editor_nonce,action:"select_product_for_tool",data:{product:Lt(Lt({},t),{},{formattedPrice:c(t.price)})}},o),r(!1)}),[o]),l=Object(n.useCallback)((function(t){-1!==t.origin.indexOf("app.getautonami.com")&&t.data&&t.data.action&&"select_product_for_tool"===t.data.action&&t.data.token===Tt.editor_nonce&&(i(t.origin),r(!0))}),[r]);return Object(n.useEffect)((function(){return window.addEventListener("message",l),function(){return window.removeEventListener("message",l)}}),[]),e&&Object(n.createElement)(_t.a,{onRequestClose:function(){return r(!1)},onProductSelected:u})},$t=r(361),At=r(31),It=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},Mt=function(t){var e=t.mergeTags,r=(t.enableConditional,Object(g.a)()),a=r.getEmailContent,o=r.getCurrentEmailIndex,u=r.getLastUpdatedTime,l=r.getIsMigrating,s=a(),f=(o(),Object(n.useRef)()),b=Object(n.useRef)(),p=Object(n.useRef)(),h=c.a.getCampaignData(),y=l(),v=h.last_modified,w=void 0===v?"":v,O=u();Object(n.useEffect)((function(){f.current=s,b.current=function(t){var e={group:[],data:{}};for(var r in t){var n=t[r];if(n){var a="";switch(r){case"contact":a={label:Object(i.__)("Contact","wp-marketing-automations"),value:"contact"};break;case"contact_fields":a={label:Object(i.__)("Fields","wp-marketing-automations"),value:"contact_fields"};break;case"general":a={label:Object(i.__)("General","wp-marketing-automations"),value:"general"};break;case"affwp":a={label:Object(i.__)("Affiliate WP","wp-marketing-automations"),value:"affwp"}}e.group.push(a),e.data[r]=n}}return e}(e),p.current=y}),[s,e,y]);var j=It.license,_=void 0===j?"":j,E=function(t){var e,r,n,a=f.current&&f.current.block&&f.current.block.body?f.current.block.body:"",o=f.current&&f.current.block&&f.current.block.settings&&!Object(d.isEmpty)(f.current.block.settings)?f.current.block.settings:{};return{title:f.current&&f.current.subject?f.current.subject:"",previewText:f.current&&f.current.preheader?f.current.preheader:"",content:a,siteSettings:Object(m.kb)(),last_updated:O||w,editorSettings:o,disableTitleHeader:!1,enableTemplate:!0,enableMergeTags:!Object(d.isEmpty)(b.current),mergeTagData:b.current,enableConditions:!1,enableMediaUpload:!0,blockSupported:[],isWCActive:Object(m.qc)(),isPro:Object(m.ac)(),proModalData:{heading:Object(i.__)("This is a Pro Feature","wp-marketing-automations"),content:Object(i.__)("We're sorry, this feature is not available on your plan. Please upgrade to the PRO plan to unlock all these awesome features.","wp-marketing-automations"),cta_text:Object(i.__)("Go Pro","wp-marketing-automations"),link:"#"},client_id:"e682ca5385e5cbd92e285aae974f73cf",client_secret:"5ab88daa93c6279318ea6fbaae56ee69",license:(n=_,n?n.split("").filter((function(t,e){return e%2!=0})).reverse().join(""):n),support:(r={},Object(m.qc)()&&(r.wc=[]),r),integrations:{wc:{blocks:[],subscriptions:!!Object(d.get)(bwfcrm_contacts_data,"is_wcs_active",!1)}},siteDomain:Object(m.wb)(),blockNavigationToolbar:[{name:"merge-tag",title:"Merge Tag",icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <g> <path d="M3.375 4.3125C3.375 3.17341 4.29841 2.25 5.4375 2.25C5.74816 2.25 6 2.50184 6 2.8125C6 3.12316 5.74816 3.375 5.4375 3.375C4.91973 3.375 4.5 3.79473 4.5 4.3125V7.54386C4.5 8.10258 4.27499 8.62185 3.89825 9C4.27499 9.37815 4.5 9.89742 4.5 10.4561V13.6875C4.5 14.2053 4.91973 14.625 5.4375 14.625C5.74816 14.625 6 14.8768 6 15.1875C6 15.4982 5.74816 15.75 5.4375 15.75C4.29841 15.75 3.375 14.8266 3.375 13.6875V10.4561C3.375 10.0526 3.11678 9.69436 2.73396 9.56675L2.63462 9.53363C2.40493 9.45707 2.25 9.24212 2.25 9C2.25 8.75788 2.40493 8.54293 2.63462 8.46637L2.73396 8.43325C3.11678 8.30564 3.375 7.94739 3.375 7.54386V4.3125ZM14.625 4.3125C14.625 3.17341 13.7016 2.25 12.5625 2.25C12.2518 2.25 12 2.50184 12 2.8125C12 3.12316 12.2518 3.375 12.5625 3.375C13.0803 3.375 13.5 3.79473 13.5 4.3125V7.54386C13.5 8.10258 13.725 8.62185 14.1017 9C13.725 9.37815 13.5 9.89742 13.5 10.4561V13.6875C13.5 14.2053 13.0803 14.625 12.5625 14.625C12.2518 14.625 12 14.8768 12 15.1875C12 15.4982 12.2518 15.75 12.5625 15.75C13.7016 15.75 14.625 14.8266 14.625 13.6875V10.4561C14.625 10.0526 14.8832 9.69436 15.266 9.56675L15.3654 9.53363C15.5951 9.45707 15.75 9.24212 15.75 9C15.75 8.75788 15.5951 8.54293 15.3654 8.46637L15.266 8.43325C14.8832 8.30564 14.625 7.94739 14.625 7.54386V4.3125Z" fill="#0073AA"/> </g> </svg>',clickAction:At.a.OPEN_MERGE_TAG,visibility:{show:["email-block/heading","email-block/button","email-block/text","email-block/list","email-block/menu"],hide:[]}},{name:"link-trigger",title:"Link Trigger",icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <g> <path d="M8.38495 4.85271C8.17288 5.0012 8.12134 5.29349 8.26983 5.50555C8.40182 5.69405 8.64743 5.75572 8.84932 5.66281L8.92267 5.62067L10.4586 4.54521C11.731 3.65427 13.4847 3.9635 14.3756 5.23589C15.2309 6.45738 14.9802 8.12248 13.833 9.04197L13.685 9.15294L12.149 10.2284C11.937 10.3769 11.8854 10.6692 12.0339 10.8812C12.1659 11.0697 12.4115 11.1314 12.6134 11.0385L12.6868 10.9964L14.2227 9.92089C15.9192 8.73298 16.3315 6.39468 15.1436 4.69816C13.9953 3.05819 11.772 2.61825 10.0926 3.66379L9.92086 3.77725L8.38495 4.85271ZM3.77722 8.07908C2.0807 9.26699 1.66839 11.6053 2.85631 13.3018C4.00463 14.9418 6.22791 15.3817 7.90731 14.3362L8.07904 14.2227L9.61495 13.1473C9.82701 12.9988 9.87855 12.7065 9.73006 12.4944C9.59807 12.3059 9.35246 12.2443 9.15057 12.3372L9.07722 12.3793L7.54131 13.4548C6.26892 14.3457 4.5152 14.0365 3.62426 12.7641C2.76896 11.5426 3.01974 9.8775 4.1669 8.958L4.31494 8.84703L5.85085 7.77158C6.06292 7.62309 6.11446 7.3308 5.96597 7.11874C5.83398 6.93023 5.58837 6.86857 5.38648 6.96148L5.31313 7.00362L3.77722 8.07908ZM11.8029 6.4651L5.65926 10.7669C5.4472 10.9154 5.39566 11.2077 5.54415 11.4198C5.67614 11.6083 5.92175 11.6699 6.12364 11.577L6.19699 11.5349L12.3406 7.23305C12.5527 7.08456 12.6042 6.79228 12.4557 6.58021C12.3238 6.39171 12.0781 6.33004 11.8763 6.42295L11.8029 6.4651L5.65926 10.7669L11.8029 6.4651Z" fill="#0073AA"/> </g> </svg>',clickAction:At.a.OPEN_LINK_TRIGGER,visibility:{show:["email-block/heading","email-block/button","email-block/text","email-block/list","email-block/menu"],hide:[]}}],isRTL:Object(m.ec)(),testEmails:Object(m.Cb)(),footer:bwfanParams.bwfan_global_settings.bwfan_email_footer_setting,webFonts:m.Jb,customFonts:m.q,version:m.l,imageSizes:m.Mb,isMigration:null!==(e=p.current)&&void 0!==e&&e}};return Object(n.useEffect)((function(){At.c.registerRequestHandler(At.a.GET_EDITOR_CONTENT,E)}),[]),!0},Rt=function(t){var e=Object(g.a)().getIsMigrating,r=Object(h.a)().setEmailContentByKey,a=e(),o=Object(n.useRef)();return Object(n.useEffect)((function(){o.current=a}),[a]),Object(n.useEffect)((function(){At.c.registerRequestHandler(At.a.CLOSE_EDITOR,(function(){if(o.current&&r("type","editor"),!t)throw{message:Object(i.__)("Close editor callback is not defined","wp-marketing-automations"),code:"CLOSE_EDITOR_ERROR"};t()}))}),[]),!0};function Ft(t){return(Ft="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 Gt(){Gt=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new C(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=s;var m="suspendedStart",d="executing",b="completed",p={};function h(){}function g(){}function y(){}var v={};l(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(N([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=y.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Ft(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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===d)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 u=S(c,n);if(u){if(u===p)continue;return u}}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=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?b:"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=b,n.method="throw",n.arg=l.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")),p;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;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,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Ft(e)+" is not iterable")}return g.prototype=y,a(j,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,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 r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}function Dt(t){return function(t){if(Array.isArray(t))return Bt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Bt(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)?Bt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ut(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}var Vt=function(){var t=Object(h.a)().saveBroadcastContent,e=Object(g.a)(),r=e.getEmailsToSubmit,a=e.getCurrentEmailIndex,o=r(),c=a(),u=Object(n.useRef)(o),l=Object(n.useRef)(c);Object(n.useEffect)((function(){u.current=o,l.current=c}),[o,c]);var s=function(){var e,r=(e=Gt().mark((function e(){var r,n,a,o,l,s,f,m,b,p=arguments;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p.length>0&&void 0!==p[0]?p[0]:{},e.prev=1,n=r.block,a=void 0===n?{}:n,o=r.subject,l=void 0===o?"":o,s=r.preheader,f=void 0===s?"":s,!Object(d.isEmpty)(a)||!Object(d.isEmpty)(l)){e.next=5;break}throw Error(Object(i.__)("Please add subject or content to save","wp-marketing-automations"));case 5:return m=Dt(u.current),Object(d.isEmpty)(a)||(m[c].block=a),a.hasOwnProperty("template")&&(m[c].body=a.template),""!==l&&(m[c].subject=l),""!==f&&(m[c].preheader=f),e.next=12,t(m,!0);case 12:if(b=e.sent,2!==parseInt(b)){e.next=15;break}return e.abrupt("return",{isSaved:!0});case 15:throw Error(Object(i.__)("Failed to save email content","wp-marketing-automations"));case 18:throw e.prev=18,e.t0=e.catch(1),{message:e.t0.message,code:"SAVE_CONTENT_ERROR"};case 21:case"end":return e.stop()}}),e,null,[[1,18]])})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(t){Ut(o,n,a,i,c,"next",t)}function c(t){Ut(o,n,a,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return Object(n.useEffect)((function(){At.c.registerRequestHandler(At.a.SAVE_EDITOR_CONTENT,s)}),[]),!0};function Ht(t){return(Ht="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 zt(){zt=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new C(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=s;var m="suspendedStart",d="executing",b="completed",p={};function h(){}function g(){}function y(){}var v={};l(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(N([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=y.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Ht(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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===d)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 u=S(c,n);if(u){if(u===p)continue;return u}}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=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?b:"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=b,n.method="throw",n.arg=l.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")),p;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;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,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Ht(e)+" is not iterable")}return g.prototype=y,a(j,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,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 r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}function qt(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}var Kt=function(t){var e=Object(h.a)().sendTestEmail,r=Object(n.useRef)();Object(n.useEffect)((function(){r.current=t}),[t]);var a=function(){var t,n=(t=zt().mark((function t(){var n,a,o,c,u,l=arguments;return zt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=l.length>0&&void 0!==l[0]?l[0]:{},t.prev=1,a=n.email,o=n.body,a&&o){t.next=5;break}throw Error(Object(i.__)("Please add email and content to send test email","wp-marketing-automations"));case 5:return c=r.current&&r.current.subject?r.current.subject:"",t.next=8,e(a,r.current,c,o);case 8:if(u=t.sent,2!==parseInt(u)){t.next=11;break}return t.abrupt("return",{sent:!0});case 11:throw Error(Object(i.__)("Test mail failed to send.","wp-marketing-automations"));case 14:throw t.prev=14,t.t0=t.catch(1),{message:t.t0.message,code:"TEST_EMAIL_ERROR"};case 17:case"end":return t.stop()}}),t,null,[[1,14]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){qt(o,n,a,i,c,"next",t)}function c(t){qt(o,n,a,i,c,"throw",t)}i(void 0)}))});return function(){return n.apply(this,arguments)}}();return Object(n.useEffect)((function(){At.c.registerRequestHandler(At.a.SEND_TEST_EMAIL,a)}),[]),!0};function Yt(t){return(Yt="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 Wt(){Wt=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new C(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=s;var m="suspendedStart",d="executing",b="completed",p={};function h(){}function g(){}function y(){}var v={};l(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(N([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=y.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Yt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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===d)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 u=S(c,n);if(u){if(u===p)continue;return u}}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=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?b:"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=b,n.method="throw",n.arg=l.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")),p;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;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,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Yt(e)+" is not iterable")}return g.prototype=y,a(j,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,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 r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}function Zt(t){return function(t){if(Array.isArray(t))return Jt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Jt(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)?Jt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Qt(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}var Xt=function(t,e,r,a){var o=Object(h.a)().saveBroadcastContent,c=Object(g.a)(),u=c.getSaveContentStatus,l=c.getEmailsToSubmit,s=c.getCurrentEmailIndex,f=(u(),l()),m=s(),b=Object(n.useRef)(f),p=Object(n.useRef)(m);Object(n.useEffect)((function(){b.current=f,p.current=m}),[f,m]);var y=function(){var t,e=(t=Wt().mark((function t(){var e,n,c,u,l,s,f,p,h=arguments;return Wt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=h.length>0&&void 0!==h[0]?h[0]:{},t.prev=1,n=e.block,c=void 0===n?{}:n,u=e.subject,l=void 0===u?"":u,s=e.preheader,f=void 0===s?"":s,e.utmEnable,e.utm,!Object(d.isEmpty)(c)||!Object(d.isEmpty)(l)){t.next=5;break}throw Error(Object(i.__)("please add subject or content to import","wp-marketing-automations"));case 5:return(p=Zt(b.current))[m].block=c,""!==l&&(p[m].subject=l,p[m].preheader=f),r(!0),t.next=11,o(p);case 11:return r(!0),document.getElementById("bwf_block_editor_frame").src=a,setTimeout((function(){r(!1)}),2e3),t.abrupt("return",{isSaved:!0});case 18:throw t.prev=18,t.t0=t.catch(1),{message:t.t0.message,code:"IMPORT_TEMPLATE_ERROR"};case 21:case"end":return t.stop()}}),t,null,[[1,18]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){Qt(o,n,a,i,c,"next",t)}function c(t){Qt(o,n,a,i,c,"throw",t)}i(void 0)}))});return function(){return e.apply(this,arguments)}}();return Object(n.useEffect)((function(){At.c.registerRequestHandler(At.a.IMPORT_TEMPLATE,y)}),[]),!0},te=function(t){var e=function(){t&&t()};return Object(n.useEffect)((function(){return window.history.pushState(null,null,window.location.href),window.addEventListener("popstate",e),function(){return window.removeEventListener("popstate",e)}}),[]),!0},ee=r(310),re=r.n(ee),ne=r(323);function ae(t){return(ae="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 oe(){return(oe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(null,arguments)}function ie(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ae(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ae(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ce(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ue(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)?ue(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 ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var le=bwfcrm_contacts_data&&bwfcrm_contacts_data.editor_settings?bwfcrm_contacts_data.editor_settings:{},se=function(){return Object(n.createElement)("div",{className:"bwf-c-save-content-loading"},Object(n.createElement)(re.a,{options:{loop:!0,autoplay:!0,animationData:ne,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}},height:480,width:480}),Object(n.createElement)("div",{style:{marginTop:"-60px",fontSize:"21px",fontWeight:"400",paddingLeft:"40px"}},Object(i.__)("Launching Editor","wp-marketing-automations")))},fe=function(t){var e=t.iframeRef,r=t.editorSrc,a=t.isImport;return Object(n.createElement)("iframe",{ref:e,title:Object(i.__)("Block Editor","wp-marketing-automations"),src:r,id:"bwf_block_editor_frame",style:{width:"100%",height:"100%",display:a?"none":"block"}})},me=function(){return Object(n.createElement)("div",{className:"bwf-c-save-content-loading"},Object(n.createElement)(re.a,{options:{loop:!0,autoplay:!0,animationData:ne,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}},height:480,width:480}),Object(n.createElement)("div",{style:{marginTop:"-60px",fontSize:"21px",fontWeight:"400",paddingLeft:"40px"}},Object(i.__)("Importing Template","wp-marketing-automations")))},de=function(t){var e=Object(f.i)(),r=t.mailData,a=t.mergeTags,o=t.setOpen,i=t.enableConditional,c=(le.license,le.editor_nonce,le.url,Object(h.a)()),u=c.fetchCurrentMailEditorContent,l=c.saveBroadcastContent,s=c.resetSaveContentStatus,b=Object(g.a)(),p=b.getSaveContentStatus(),y=(b.getDisableSaveValue(),ce(Object(n.useState)(!1),2)),v=y[0],w=y[1],O=ce(Object(n.useState)(!1),2),j=O[0],_=O[1];Object(n.useEffect)((function(){v||2!==p&&3!==p||(w(!0),s())}),[p]);var E=Object(n.useCallback)((function(){if(e.hasOwnProperty("editor")){var t=Object(d.cloneDeep)(e);delete t.editor,Object(f.l)(t,"/",{})}o(!1),u()})),k=Object(m.R)().editorSrc;Mt({mergeTags:a||[],enableConditional:i}),Vt(),Rt(E),Kt(r),Xt(v,j,_,k),te(E);var S=Object(n.useRef)();return Object(n.useEffect)((function(){return l(),document.body.classList.add("bwf-c-modal-open"),w(!1),function(){document.body.classList.remove("bwf-c-modal-open")}}),[]),Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-c-editor-modal-wrapper"},Object(n.createElement)("div",{className:"bwf-c-editor-modal bwf-c-editor-modal-full-width"},!v&&Object(n.createElement)(se,null),j&&Object(n.createElement)(me,null),!!v&&Object(n.createElement)(fe,{iframeRef:S,editorSrc:k,isImport:j}))))},be=function(t){var e=Object(f.i)().editor,r=void 0===e?"":e,o=ce(Object(n.useState)(!1),2),c=o[0],u=o[1],l=ce(Object(n.useState)(!1),2),s=l[0],d=l[1],b=(0,Object(g.a)().getDisableSaveValue)();Object(n.useEffect)((function(){("block"===r||b)&&u(!0)}),[]);var p=t.openLinkTrigger,h=t.openMergeTags,y=ie(ie({},At.a.OPEN_LINK_TRIGGER,(function(){if(p)return p(!0),{opened:!0};throw{message:Object(i.__)("Failed to open Link trigger","wp-marketing-automations"),code:"OPEN_LINK_TRIGGER_FETCH_ERROR"}})),At.a.OPEN_MERGE_TAG,(function(){if(h)return h(!0),{opened:!0};throw{message:Object(i.__)("Failed to open Merge Tags","wp-marketing-automations"),code:"OPEN_LINK_TRIGGER_FETCH_ERROR"}}));return c?Object(n.createElement)(n.Fragment,null,Object(n.createElement)(de,oe({},t,{setOpen:u})),Object(n.createElement)(At.b,{customHandlers:y})):Object(n.createElement)("div",{className:"bwf-c-editor-button-wrapper"},Object(n.createElement)(B.a,{icon:"launch-editor",size:40}),Object(n.createElement)("div",{className:"bwf-heading5-new"},Object(i.__)("Utilize our drag & drop builder to craft elegant email templates including WooCommerce Blocks.","wp-marketing-automations")),Object(n.createElement)(a.Button,{isTertiary:!0,onClick:function(){Object(m.ac)()?u(!0):d(!0)}},!Object(m.ac)()&&m.e,Object(i.__)("Edit","wp-marketing-automations")),!Object(m.ac)()&&Object(n.createElement)(U.b,{isOpen:s,onRequestClose:function(){return d(!1)},modalContent:{isFeature:!0,featureTitle:Object(i.__)("New Visual Builder","wp-marketing-automations"),proLink:Object(m.fb)("upgrade",{utm_medium:"New+Visual+Builder+Upgrade+Modal"})}}))},pe=r(529),he=r(41),ge=r(505),ye=r(105);function ve(t){return(ve="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 we(){we=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new C(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=s;var m="suspendedStart",d="executing",b="completed",p={};function h(){}function g(){}function y(){}var v={};l(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(N([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=y.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==ve(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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===d)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 u=S(c,n);if(u){if(u===p)continue;return u}}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=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?b:"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=b,n.method="throw",n.arg=l.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")),p;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;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,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(ve(e)+" is not iterable")}return g.prototype=y,a(j,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,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 r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}function Oe(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}function je(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 _e(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?je(Object(r),!0).forEach((function(e){Ee(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ee(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=ve(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ve(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ve(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ke(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Se(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)?Se(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 Se(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Le=Object(m.Ab)(),xe=[{label:Object(i.__)("Visual Builder","wp-marketing-automations"),value:"block",className:"bwf-display-flex bwf-campaign-template-type"},{label:Object(i.__)("Rich Text","wp-marketing-automations"),value:"rich",className:"bwf-display-flex bwf-campaign-template-type "},Le.includes("wc")&&{label:Object(i.__)("WooCommerce","wp-marketing-automations"),value:"wc",className:"bwf-display-flex bwf-campaign-template-type "},{label:Object(i.__)("Raw HTML","wp-marketing-automations"),value:"html",className:"bwf-display-flex bwf-campaign-template-type"},Object(m.fc)()&&{label:Object(i.__)("Visual Builder (Legacy)","wp-marketing-automations"),value:"editor",className:"bwf-display-flex bwf-campaign-template-type"}].filter(Boolean),Ce=function(t){var e=t.maildata,r=t.setTemplateModal,u=c.a.getCampaignData(),l=parseInt(u.type),s=Object(m.I)(),f=Object(h.a)(),y=f.setEmailContentByKey,v=f.setEmailUtmByKey,w=f.setMultipleUtm,O=f.resetSendTestEmailStatus,j=f.sendTestEmail,_=Object(n.useContext)(m.h),E=ke(Object(n.useState)(!1),2),k=E[0],S=E[1],L=ke(Object(n.useState)(""),2),x=L[0],C=L[1],N=ke(Object(n.useState)(!1),2),T=N[0],P=N[1],$=Object(g.a)(),A=$.getEmailContent()?$.getEmailContent():{},I=Object(n.useRef)(null);Object(n.useLayoutEffect)((function(){I.current=A}),[]);var M=Object(n.useMemo)((function(){return null===I.current||JSON.stringify(I.current)===JSON.stringify(A)}),[A]),R=$.getIsMigrating(),F=ke(Object(n.useState)(!1),2),G=F[0],D=F[1],V="utm"in A?A.utm:{},H=ke(Object(n.useState)(!1),2),z=H[0],q=H[1],K=ke(Object(n.useState)(""),2),Y=K[0],W=K[1],Z=ke(Object(n.useState)([]),2),J=Z[0],Q=Z[1],X="subject"in A?A.subject:"",tt="preheader"in A?A.preheader:"",et="type"in A?A.type:"block",ot="utmEnabled"in A&&A.utmEnabled,ct=ke(Object(n.useState)({message:"",type:1}),2),ut=ct[0],lt=ct[1],st="whatsAppImage"in A&&A.whatsAppImage,ft="whatsAppImageSetting"in A?A.whatsAppImageSetting:{},mt="position"in ft?ft.position:"after",dt="imageURL"in ft?ft.imageURL:"",bt="source"in V?V.source:"",pt="medium"in V?V.medium:"",ht="name"in V?V.name:"",gt="content"in V?V.content:"",Ot="term"in V?V.term:"",_t=ke(Object(n.useState)(!1),2),Et=_t[0],kt=_t[1],St=$.getShowValidationFlag(),Lt=ke(Object(n.useState)(!1),2),xt=Lt[0],Ct=Lt[1],Nt=ke(Object(n.useState)("content"),2),Tt=Nt[0],At=Nt[1],It=ke(Object(n.useState)([]),2),Mt=It[0],Rt=It[1],Ft=ke(Object(n.useState)(!1),2),Gt=Ft[0],Dt=Ft[1],Bt=ke(Object(n.useState)(!1),2),Ut=Bt[0],Vt=Bt[1],Ht=ke(Object(n.useState)(""),2),zt=(Ht[0],Ht[1]),qt=$.getCurrentEmailIndex(),Kt=A&&A.body?A.body:"",Yt="editor"in A?A.editor:{},Wt=Yt&&Yt.body?Yt.body:"",Zt="editor"===et?Wt:Kt,Jt="<p>Hi {{contact_first_name}},</p><p></p>"+bwfanParams.bwfan_global_settings.bwfan_email_footer_setting;Object(n.useEffect)((function(){Object(d.isEmpty)(Kt)&&y("body",1==l?Jt:"Hi {{contact_first_name}},")}),[Kt]);var Qt=ot?_e(_e({},e),{},{utmName:ht,utmMedium:pt,utmContent:gt,utmSource:bt,utmTerm:Ot}):e;Object(n.useEffect)((function(){if(ot){var t={};!bt&&(t.source=Object(m.r)("source")),!pt&&(t.medium=s[l].label),!ht&&(t.name=Object(d.trim)(u.title).replace(/\s/g,"+")),w(t)}}),[ot]);var Xt=$.validateCurrentEmail(),te={1:Object(i.__)("Place your HTML here","wp-marketing-automations"),2:Object(i.__)("Enter the SMS Body","wp-marketing-automations"),3:Object(i.__)("Place your message here","wp-marketing-automations")},ee=function(){return"editor"==A.type?A.hasOwnProperty("editor")&&A.editor.hasOwnProperty("body")?A.editor.body:"":A.body},re=$.getSendTestEmailStatus();Object(n.useEffect)((function(){null!==re&&setTimeout((function(){O(),lt({message:"",type:1})}),2e3),1!=l&&(2===re&<({message:Object(i.__)("Test message sent","wp-marketing-automations"),type:1}),3===re&<({message:Object(i.__)("Unable to send message","wp-marketing-automations"),type:1}))}),[re]);var ne=St&&!Xt.subject?" bwf-field-error":"",ae=St&&!Xt.content?" bwf-field-error-textarea":"",oe=St&&!Xt.utmSource?" bwf-field-error":"",ie=St&&!Xt.utmMedium?" bwf-field-error":"",ce=Object(n.useMemo)((function(){return xe.map((function(t){return!("editor"!==et&&"editor"===t.value&&!R)&&t})).filter(Boolean)}),[R,M,qt]);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-c-campaign-body"},1===l&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(ye.a,{value:X,onChange:function(t){return y("subject",t)},onButtonClick:function(){Ct(!0),At("subject")},buttonText:Object(n.createElement)(B.a,{size:28,icon:"merge-tag"}),label:Object(i.__)("Subject","wp-marketing-automations"),placeholder:Object(i.__)("Enter subject","wp-marketing-automations"),className:"bwf-field-m0"+ne}),Object(n.createElement)("div",{className:"bwf_clear_24"}),Object(n.createElement)("div",{className:"bwf-campaign-mail-headers-wrap"},Object(n.createElement)(ye.a,{value:tt,placeholder:Object(i.__)("Enter preview text","wp-marketing-automations"),onButtonClick:function(){Ct(!0),At("preheader")},buttonText:Object(n.createElement)(B.a,{size:28,icon:"merge-tag"}),label:Object(i.__)("Preview Text","wp-marketing-automations"),onChange:function(t){return y("preheader",t)}})),Object(n.createElement)("div",{className:"bwf_clear_16"}),Object(n.createElement)("div",{className:"bwf-heading7-new bwf-mb-8"},Object(i.__)("Template Type","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-select-template-type"},ce.map((function(t){return Object(n.createElement)("label",{key:t.value,className:it()("components-radio-control__option",{"is-selected":et===t.value})},Object(n.createElement)("input",{type:"radio",className:"components-radio-control__input",value:t.value,onChange:function(){f.showValidation(!1),y("type",t.value)},checked:et===t.value&&"checked"}),Object(n.createElement)("span",null,t.label),"block"===t.value&&Object(n.createElement)("span",{className:"bwf-tags bwf-tag-green"},Object(i.__)("New","wp-marketing-automations")))}))),Object(n.createElement)("div",{className:"bwf_clear_24"}),Object(n.createElement)(n.Fragment,null,Object(n.createElement)(a.Flex,null,Object(n.createElement)(a.FlexBlock,null,Object(n.createElement)(a.Flex,{gap:3,justify:"flex-start"},!["editor","block"].includes(et)&&Object(n.createElement)(a.FlexItem,null,Object(n.createElement)(o.a,{className:"bwf-btn-small bwf-btn-gray btn-svg-none is-light",onClick:function(){if(Object(m.ac)())return At("content"),void Ct(!0);D(!0)}},Object(n.createElement)(B.a,{icon:Object(m.ac)()?"merge-tag":"king",size:16}),Object(i.__)("Merge Tags","wp-marketing-automations"))),Object(n.createElement)(a.FlexItem,null,Object(n.createElement)("div",null,Object(n.createElement)($t.a,{canCreate:!0,isLinkTriggerOpen:Gt,onClose:function(){return Dt(!1)},setLinkTriggerOpen:function(t){Object(m.ac)()?Dt(t):D(!0)},modelOpenContent:Object(n.createElement)(o.a,{className:"bwf-btn-small bwf-btn-gray btn-svg-none is-light"},Object(n.createElement)(B.a,{icon:Object(m.ac)()?"link-trigger":"king",size:16}),Object(i.__)("Link Triggers","wp-marketing-automations")),hideButton:["editor","block"].includes(et)}))))),Object(n.createElement)(a.FlexItem,null,Object(n.createElement)(o.a,{className:"bwf-btn-small is-light",onClick:function(){Object(m.ac)()?r(!0):D(!0)}},Object(n.createElement)(B.a,{icon:Object(m.ac)()?"templates":"king",size:16}),Object(i.__)("Templates","wp-marketing-automations"))))),Object(n.createElement)("div",{className:"bwf_clear_24"})),Object(n.createElement)("div",{className:ae},1===l&&("rich"===et||"wc"===et)&&Object(n.createElement)(p.a,{content:Zt,keyid:"bwf-campaign-email-editor",setContent:function(t){return y("body",t)}}),("html"===et||2===l||3===l)&&Object(n.createElement)(a.TextareaControl,{value:Zt,onChange:function(t){return y("body",t)},label:2===l||3===l?Object(i.__)("Message","wp-marketing-automations"):"",placeholder:te[l],rows:[2,3].includes(l)?5:24,className:"bwf-email-raw-html"}),1===l&&"editor"===et&&Object(n.createElement)(rt,{broadcastId:u.id,contentNumber:parseInt(qt),openMergeTags:function(){return Ct(!0)},mailData:Qt,mergeTags:Mt,openLinkTrigger:Dt}),1===l&&"block"===et&&Object(n.createElement)(be,{objectId:"emialblock",contentNumber:parseInt(qt),openMergeTags:function(){return Ct(!0)},mailData:e,mergeTags:Mt,openLinkTrigger:Dt,enableConditional:!!Object(m.ac)(),setConditionalModal:q,setConditionalEventOrigin:W,setConditionalData:Q,openSiteSettings:Vt,setSiteSettingsEventOrigin:zt})),Object(n.createElement)("div",{className:"bwf_clear_24"}),Object(n.createElement)(a.Flex,null,Object(n.createElement)(a.FlexItem,null,Object(n.createElement)("div",{className:"bwf-display-flex gap-12"},1==l&&Object(n.createElement)(wt.a,{templateData:A,type:1,checkIfValid:function(){return!!Xt.subject||(f.showValidation(!0),!1)}}),1!=l&&Object(n.createElement)("div",null,Object(n.createElement)(o.a,{isTertiary:!0,className:"bwf-btn-grey bwf-btn-small",onClick:function(){S(!0)}},Object(i.__)("Send Test Message","wp-marketing-automations")),k&&Object(n.createElement)(he.a,{className:"bwf-campaign-test-mail-popup",onFocusOutside:function(){S(!1)},onClick:function(t){return t.stopPropagation()},focusOnMount:"no-focus"},Object(n.createElement)("div",{className:"bwf-campaign-test-mail-wrap"},Object(n.createElement)("div",{className:"bwf-p",style:{marginBottom:"16px"}},Object(n.createElement)(a.TextControl,{value:x,onChange:function(t){return C(t)},placeholder:Object(i.__)("Enter phone no.","wp-marketing-automations")})),Object(n.createElement)(o.a,{isPrimary:!0,isBusy:T,onClick:function(){var t,e=(t=we().mark((function t(e){var r;return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.preventDefault(),P(!0),n=void 0,n=!1,!(Object(d.isEmpty)(x)||![2,3].includes(l)&&!Object(m.gc)(x)||[2,3].includes(l)&&!Object(vt.a)(x))&&Xt.content&&Xt.type&&Xt.utmMedium&&Xt.utmSource||(n=!0),n){t.next=7;break}return t.next=5,j(x,Qt,"","").then((function(){setTimeout((function(){P(!1),S(!1)}),1e3)})).catch((function(t){console.log(t),P(!1),S(!1),_(Object(i.__)("Unable to send message","wp-marketing-automations")),Object(m.Lb)(_,3e3)}));case 5:t.next=13;break;case 7:r="",Object(d.isEmpty)(x)&&[2,3].includes(l)&&(r=Object(i.__)("Phone is required field.","wp-marketing-automations")),Object(d.isEmpty)(r)&&[2,3].includes(l)&&(Object(vt.a)(x)||(r=Object(i.__)("Entered phone is not valid.","wp-marketing-automations"))),Object(d.isEmpty)(r)&&!Xt.content&&(r=Object(i.__)("Content is required field.","wp-marketing-automations")),lt({message:r,type:2}),P(!1);case 13:case"end":return t.stop()}var n}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){Oe(o,n,a,i,c,"next",t)}function c(t){Oe(o,n,a,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}()},Object(i.__)("Send","wp-marketing-automations"))))),1==l&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(o.a,{isTertiary:!0,className:"bwf-btn-grey bwf-btn-small",onClick:function(){Object(d.isEmpty)(ee())?lt({message:Object(i.__)("No content available for preview.","wp-marketing-automations"),status:2}):kt(!0)}},Object(i.__)("Preview and Test","wp-marketing-automations")),Et&&Object(n.createElement)(yt,{setPreview:kt,content:ee(),type:et,maildata:e})))),Object(n.createElement)(a.FlexItem,null,!(1===l&&["editor","block"].includes(et))&&3!==l&&Object(n.createElement)(o.a,{isTertiary:!0,className:"bwf-btn-grey bwf-btn-small",onClick:function(t){t.preventDefault(),At("content");var e=2===l?bwfanParams.bwfan_global_settings.bwfan_sms_unsubscribe_text:bwfanParams.bwfan_global_settings.bwfan_email_footer_setting;y("body","".concat(Zt||""," \n").concat(e))}},Object(i.__)("Add Unsubscribe Text","wp-marketing-automations")))),Object(n.createElement)("div",{className:"bwf_clear_24"}),Object(n.createElement)(at.a,{checked:ot,label:Object(i.__)("Automatically append UTM parameters to email links","wp-marketing-automations"),className:"bwf-crm-campaign-third-step-utm",onChange:function(t){return y("utmEnabled",t)}}),ot&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf_clear_24"}),Object(n.createElement)("div",{className:"bwf-campaign-utm-section"},Object(n.createElement)(a.TextControl,{value:bt,onChange:function(t){return v("source",t.replace(/\s/g,"+"))},label:Object(i.__)("Campaign Source","wp-marketing-automations"),placeholder:Object(i.__)("Enter UTM source","wp-marketing-automations"),help:Object(i.__)("Referrer: (e.g., google, newsletter)","wp-marketing-automations"),className:"bwf-field-comp-label-content"+oe}),Object(n.createElement)(a.TextControl,{value:pt,onChange:function(t){return v("medium",t.replace(/\s/g,"+"))},label:Object(i.__)("Campaign Medium","wp-marketing-automations"),placeholder:Object(i.__)("Enter UTM medium","wp-marketing-automations"),help:Object(i.__)("Marketing medium: (e.g., CPC, banner, email)","wp-marketing-automations"),className:"bwf-field-comp-label-content"+ie}),Object(n.createElement)(a.TextControl,{value:ht,onChange:function(t){return v("name",t.replace(/\s/g,"+"))},label:Object(i.__)("Campaign Name","wp-marketing-automations"),placeholder:Object(i.__)("Enter UTM name","wp-marketing-automations"),help:Object(i.__)("Product, promo code, or slogan (e.g., spring_sale)","wp-marketing-automations"),className:"bwf-field-comp-label-content"}),Object(n.createElement)(a.TextControl,{value:Ot,onChange:function(t){return v("term",t.replace(/\s/g,"+"))},label:Object(i.__)("Campaign Term","wp-marketing-automations"),placeholder:Object(i.__)("Enter UTM term","wp-marketing-automations"),className:"bwf-field-comp-label-content"}),Object(n.createElement)(a.TextControl,{value:gt,onChange:function(t){return v("content",t.replace(/\s/g,"+"))},label:Object(i.__)("Campaign Content","wp-marketing-automations"),placeholder:Object(i.__)("Enter UTM content","wp-marketing-automations"),className:"bwf-field-comp-label-content bwf-mb-0"}))),3==l&&Object(n.createElement)(jt,{enable:st,position:mt,imageURL:dt,setData:function(t,e){if("enable"==t)y("whatsAppImage",e);else if(["position","imageURL"].includes(t)){var r={position:mt,imageURL:dt};r[t]=e,y("whatsAppImageSetting",r)}}}),Object(n.createElement)(b.a,{message:ut.message,type:ut.type,removeMessage:function(){return lt({message:"",type:1})}})),Object(n.createElement)(nt.a,{isOpen:xt,setOpenTags:Ct,onMergeTagSelected:function(t){"subject"===Tt&&y("subject","".concat(X||""," ").concat(t)),"preheader"===Tt&&y("preheader","".concat(tt||""," ").concat(t)),"content"===Tt&&y("body","".concat(Zt||""," ").concat(t)),Ct(!1)},onMergeTagsLoaded:function(t){return Rt(t)}}),Object(n.createElement)(ge.a,{isOpen:Ut,setOpen:Vt}),Object(m.qc)()&&Object(n.createElement)(Pt,null),Object(m.ac)()&&Object(n.createElement)(pe.a,{isConditionalModal:z,setConditionalModal:q,conditionalEventOrigin:Y,setConditionalData:Q,conditionalData:J}),!Object(m.ac)()&&Object(n.createElement)(U.b,{isOpen:G,onRequestClose:function(){return D(!1)},modalContent:{isFeature:!0,featureTitle:Object(i.__)("Broadcast","wp-marketing-automations")}}))},Ne=r(506),Te=(r(1428),r(70)),Pe=function(t){var e=Object(h.a)(),r=Object(g.a)(),o=r.getSmartSendSettings(),c=o.enable,u=o.percent,l=o.hours,s=e.setSmartSendByKey,f=r.getShowValidationFlag(),m=r.getEmails();return Array.isArray(m)&&m.length>1?Object(n.createElement)("div",{className:"bwf-c-campaign-email bwf-mt-24 bwf-campaign-smart-send-container"},Object(n.createElement)("div",{className:"bwf-heading3-new bwf-mb-16"},Object(i.__)("Smart Sending","wp-marketing-automations")),Object(n.createElement)(a.ToggleControl,{label:Object(i.__)("Enable Smart Sending","wp-marketing-automations"),className:"bwf-tooglecontrol-advance",checked:c,onChange:function(t){return s("enable",t)}}),c&&Object(n.createElement)("div",{className:"bwf-display-flex"},Object(n.createElement)("div",{className:"bwf-w-280"}),Object(n.createElement)("div",{className:"bwf-w-100p"},parseInt(u)>0&&parseInt(l)>0?Object(n.createElement)("div",{className:"bwf-campaign-smart-send-notice"},Object(n.createElement)("div",{className:"bwf-campaign-smart-s-svg"},Object(n.createElement)(B.a,{icon:"icon-bulb",width:13,height:17})),Object(n.createElement)("div",{className:"bwf-campaign-smart-send-n-txt"},Object(n.createElement)("span",{className:"bwf-n-b"},Object(i.__)("How Smart Sending Works?","wp-marketing-automations")),Object(n.createElement)("span",null,Object(i.sprintf)(Object(i.__)("This broadcast will first go to %d percent of your contacts. After %d hours, the variant with the highest open rate will be sent to the rest.","wp-marketing-automations"),parseInt(u),parseInt(l))))):Object(n.createElement)("div",{className:"bwf_clear_16"}),Object(n.createElement)(a.TextControl,{type:"number",value:u,onChange:function(t){return s("percent",t)},label:Object(i.__)("Sample size (in percent)","wp-marketing-automations"),placeholder:Object(i.__)("Enter percent","wp-marketing-automations"),className:it()({"bwf-field-comp-label-content":!0,"bwf-field-error":f&&!parseInt(u)})}),Object(n.createElement)(a.TextControl,{type:"number",value:l,onChange:function(t){return s("hours",t)},label:Object(i.__)("Wait time (in hours)","wp-marketing-automations"),placeholder:Object(i.__)("Enter hour difference","wp-marketing-automations"),className:it()({"bwf-field-comp-label-content":!0,"bwf-mb-0":!0,"bwf-field-error":f&&!parseInt(l)})})))):null};function $e(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ae(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)?Ae(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 Ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Me=function(t){var e=t.mailData,r=t.unsubscribeLink,a=t.errMsg,o=Object(h.a)(),u=Object(g.a)(),l=o.setCurrentEmail,s=o.addEmail,f=o.showValidation,b=o.deleteEmail,p=o.overrideCurrentContent,y=$e(Object(n.useState)(!1),2),v=y[0],w=y[1],O=u.getEmails(),j=u.getCurrentEmail(),_=u.getSmartSendSettings(),E=u.emailsValidToSubmit(),k=u.getShowValidationFlag(),S=c.a.getCampaignData(),L=!!(S&&S.data&&S.data.ab_type)&&"ab"===S.data.ab_type,x=Object(n.useRef)(!1),C=Object(n.useCallback)((function(t){return it()({active:j===t})})),N=!L||!![!_.enable||!!parseInt(_.hours)&&O.length>1,!_.enable||!!parseInt(_.percent)&&O.length>1].reduce((function(t,e){return t&&e}),!0),T=Object(n.useContext)(m.h);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:""},(!E||!N||!r)&&k&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Te.a,null),Object(n.createElement)(V.a,{className:"bwf-error-notice",status:"error",onRemove:function(){return f(!1)}},(!E||!N)&&Object(i.__)("Some required fields are not filled, check below","wp-marketing-automations"),!r&&Object(n.createElement)(n.Fragment,null,(!E||!N)&&Object(n.createElement)("br",null),Object(d.isEmpty)(a)?Object(i.__)("{{unsubscribe_link}} are required merge tags, they must be missing from the email body","wp-marketing-automations"):a))),L&&Object(n.createElement)("div",{className:"bwf-c-campaign-email-tabs bwf-mb-16"},Object(n.createElement)("ul",null,O.map((function(t,e){return Object(n.createElement)("li",{onClick:function(){return function(t){!x.current&&l(t),x.current=!1}(t)},className:C(t),key:"bwf-c-campaign-email-tabs-".concat(e)},0===e?Object(i.__)("Control","wp-marketing-automations"):Object(i.__)("Variant","wp-marketing-automations")," ",e>0&&Ie[parseInt(e)%Ie.length-1],e>0&&Object(n.createElement)("span",{className:"bwf-w-20 bwf-h-20 bwf-cursor-pointer bwf-ml-4 bwf-display-flex",onClick:function(){return function(t){x.current=!0,b(t)}(t)}},Object(n.createElement)(B.a,{icon:"cross",size:16})))})),O.length<3&&Object(n.createElement)("li",{className:"bwf-c-campaign-email-variant"},Object(n.createElement)("div",{className:"bwf-display-flex bwf-h-20",onClick:function(){return s()}},Object(n.createElement)("span",{className:"bwf-rotate-45 bwf-p-0"},Object(n.createElement)(B.a,{icon:"cross",size:16,color:"#353030"})),Object(n.createElement)("span",null,Object(i.__)("Add Variant","wp-marketing-automations")))))),1===parseInt(S.type)&&Object(n.createElement)("span",{className:"bwf-c-campaign-template-selector"},Object(n.createElement)(Ne.a,{showText:!1,openTemplate:v,setTemplateModal:w,applyTemplate:function(t){p(t),T(Object(i.__)("Template Applied Successfully.","wp-marketing-automations")),setTimeout((function(){T("")}),2e3)}})),Object(n.createElement)(Ce,{maildata:e,setTemplateModal:w}),Object(n.createElement)(Pe,null)))},Re=r(76);function Fe(t){return(Fe="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 Ge(){Ge=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",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof h?e:h,i=Object.create(o.prototype),c=new C(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=s;var m="suspendedStart",d="executing",b="completed",p={};function h(){}function g(){}function y(){}var v={};l(v,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(N([])));O&&O!==r&&n.call(O,i)&&(v=O);var j=y.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var u=f(t[a],t,o);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Fe(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.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===d)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 u=S(c,n);if(u){if(u===p)continue;return u}}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=d;var l=f(e,r,n);if("normal"===l.type){if(a=n.done?b:"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(a=b,n.method="throw",n.arg=l.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")),p;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;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,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}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 C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(Fe(e)+" is not iterable")}return g.prototype=y,a(j,"constructor",{value:y,configurable:!0}),a(y,"constructor",{value:g,configurable:!0}),g.displayName=l(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),l(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,C.prototype={constructor:C,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 r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=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 r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,p):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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),p}},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;x(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}function De(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 Be(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?De(Object(r),!0).forEach((function(e){Ue(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):De(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ue(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Fe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Fe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Fe(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ve(t,e,r,n,a,o,i){try{var c=t[o](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,a)}function He(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=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,a=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ze(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)?ze(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 ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}e.default=function(t){var e=Object(f.i)(),r=He(Object(n.useState)({message:"",type:1}),2),l=r[0],p=r[1],y=He(Object(n.useState)([]),2),v=y[0],w=y[1],O=He(Object(n.useState)([]),2),j=O[0],_=O[1],E=He(Object(n.useState)(Object(m.P)("from_name")),2),k=E[0],S=E[1],L=He(Object(n.useState)(Object(m.P)("from_email")),2),x=L[0],C=L[1],N=He(Object(n.useState)(Object(m.P)("reply_to_email")),2),T=N[0],P=N[1],$=He(Object(n.useState)(""),2),A=$[0],I=$[1],M=Object(u.a)().setCampaignValues,R=c.a.getCampaignId(),F=c.a.getCampaignData(),G=parseInt(F.type);Object(n.useEffect)((function(){F&&!Object(d.isNull)(F.data)&&(F.data.hasOwnProperty("content")&&!Object(d.isEmpty)(F.data.content)?w(F.data.content):w(1==G?[{subject:"",preheader:"",type:"block",body:"",utm:{}}]:[{body:"",utm:{}}]),F.data.hasOwnProperty("senders_name")&&S(F.data.senders_name),F.data.hasOwnProperty("senders_email")&&C(F.data.senders_email),F.data.hasOwnProperty("replyto")&&!Object(d.isEmpty)(F.data.replyto)&&P(F.data.replyto))}),[]);var D=Object(Re.a)().setL2Title;Object(n.useEffect)((function(){D("title"in F?Object(n.createElement)(n.Fragment,null,F.title):"")}),[F]);var B={name:1!==G||null===k||k.length>0,email:1!==G||null===x||Object(m.gc)(x),content:null===v||v.length>0},U=Object(g.a)(),V=U.emailsValidToSubmit(),H=U.getEmails(),z=U.getAllEmailContent(),q=U.getSmartSendSettings(),K=Object(h.a)();Object(n.useEffect)((function(){if(F&&F.data){var t=!F.data.ab_type||"ab"===F.data.ab_type,e=F.data.content?Array.isArray(F.data.content)&&!t?[F.data.content[0]]:F.data.content:[],r=F.data.smart_send&&t?F.data.smart_send:{};K.initContent(e,r)}}),[R]);var Y=!![1!==G||k&&k.length>0,1!==G||x&&Object(m.gc)(x),1!==G||Object(d.isEmpty)(T)||T&&Object(m.gc)(T)].reduce((function(t,e){return t&&e}),!0),W=!(!(F&&F.data&&F.data.ab_type)||"ab"===F.data.ab_type)||!![!q.enable||!!parseInt(q.hours)&&H.length>1,!q.enable||!!parseInt(q.percent)&&H.length>1].reduce((function(t,e){return t&&e}),!0),Z=function(){if(1!==G)return!0;var t=Object(m.E)();I("");var e=!0,r=[];return H.map((function(n){var a=z.hasOwnProperty(n)?z[n]:{},o="";a.hasOwnProperty("type")&&("editor"==a.type?a.hasOwnProperty("editor")&&a.editor.hasOwnProperty("body")&&(o=a.editor.body):a.hasOwnProperty("body")&&(o=a.body)),o.includes("{{mail_footer}}")||(e=(t.includes("unsubscribe_link")||o.includes("unsubscribe_link"))&&(t.includes("business_name")||o.includes("business_name"))&&(t.includes("business_address")||o.includes("business_address")))||(t.includes("unsubscribe_link")||o.includes("unsubscribe_link")||r.includes("{{unsubscribe_link}}")||r.push("{{unsubscribe_link}}"),t.includes("business_name")||o.includes("business_name")||r.includes("{{business_name}}")||r.push("{{business_name}}"),t.includes("business_address")||o.includes("business_address")||r.includes("{{business_address}}")||r.push("{{business_address}}"))})),Object(d.isEmpty)(r)||I(Object(i.__)("The required merge tags","wp-marketing-automations")+" "+r.join(", ")+(r.length>1?" are ":" is ")+" "+Object(i.__)("missing in the email body","wp-marketing-automations")),_(e),e},J=function(){var e,r=(e=Ge().mark((function e(){var r,n,a;return Ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Z(),K.showValidation(!1),!(Y&&V&&W&&r)){e.next=17;break}return t.setPending(!0),e.prev=4,n=Be({content:H.map((function(t){return V[t]})),senders_name:k,senders_email:x,replyto:T,modified_by:Object(m.N)()},q.enable?{smart_send:{enable:q.enable,percent:q.percent,hours:q.hours}}:{}),a={content:JSON.stringify(n),step:3},e.next=9,s()({path:Object(m.A)("/broadcast/".concat(R)),method:"POST",data:a}).then((function(t){200===t.code?(M("data",t.result),M("step",4)):p({message:t.message,type:0})}));case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),p({message:e.t0.message,type:0});case 14:t.setPending(!1),e.next=18;break;case 17:K.showValidation(!0);case 18:case"end":return e.stop()}}),e,null,[[4,11]])})),function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function i(t){Ve(o,n,a,i,c,"next",t)}function c(t){Ve(o,n,a,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),Q=B&&!B.email?" bwf-field-error":"",X=B&&!B.name?" bwf-field-error":"";return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(Te.a,null),Object(n.createElement)("div",{className:"bwf-campaign-step-div bwf-card-wrap bwf-campaign-step-3"},Object(n.createElement)("div",{className:"bwf-card-header"},Object(n.createElement)("span",{className:"bwf-form-title"},Object(i.__)("Content","wp-marketing-automations"))),1===G&&Object(n.createElement)("div",{className:"bwf-p-gap"},Object(n.createElement)("div",{className:"bwf-c-campaign-email"},Object(n.createElement)(a.TextControl,{value:k,onChange:S,label:Object(i.__)("From Name","wp-marketing-automations"),placeholder:Object(i.__)("Enter From Name","wp-marketing-automations"),className:X}),Object(n.createElement)("div",{className:"bwf_clear_16"}),Object(n.createElement)(a.Flex,null,Object(n.createElement)(a.FlexBlock,null,Object(n.createElement)(a.TextControl,{value:x,onChange:C,label:Object(i.__)("From Email","wp-marketing-automations"),placeholder:Object(i.__)("Enter From Email","wp-marketing-automations"),className:Q})),Object(n.createElement)(a.FlexBlock,null,Object(n.createElement)(a.TextControl,{value:T,placeholder:Object(i.__)("Enter Reply-To Email","wp-marketing-automations"),label:Object(i.__)("Reply-To Email","wp-marketing-automations"),onChange:P}))))),Object(n.createElement)("div",{className:"bwf-p-gap "+(1===parseInt(G)?"bwf-pt-0":"")},Object(n.createElement)(Me,{mailData:{reply_to:T,senders_email:x,senders_name:k},unsubscribeLink:j,errMsg:A}),Object(n.createElement)(b.a,{message:l.message,type:l.type,removeMessage:function(){return p({message:"",type:1})}})),Object(n.createElement)("div",{className:"bwf-p-gap bwf-pt-0"},Object(n.createElement)("div",{className:"bwf-crm-campaign-navigation"},Object(n.createElement)(o.a,{className:"bwf-crm-navigation-previous",isSecondary:!0,onClick:function(){var t=F.data&&!Object(d.isNull)(F.data)&&F.data.hasOwnProperty("filters")?F.data.filters:{};Object(d.isEmpty)(t)||Object(f.l)(t,"/",e),M("step",2)}},Object(i.__)("Previous","wp-marketing-automations")),Object(n.createElement)(o.a,{isPrimary:!0,className:"bwf-crm-navigation-next",disabled:!Y,onClick:J,isBusy:t.isPending},Object(i.__)("Next","wp-marketing-automations"))))))}}}]); |