@emailmaker/emailmaker 1.0.51 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/asset-manifest.json +14 -14
- package/emailmaker-esm.js +1 -1
- package/emailmaker.js +1 -1
- package/iframe/429.js +1 -0
- package/iframe/{iframe-eblock.984ccdb9e9538ea29c8a.html → iframe-eblock.76570d99a8b854c1e97e.html} +1 -1
- package/iframe/{iframe.984ccdb9e9538ea29c8a.html → iframe.76570d99a8b854c1e97e.html} +1 -1
- package/iframe/js/cssbeautify.js +1 -1
- package/iframe/sandbox-eblock.js +1 -1
- package/iframe/sandbox.js +1 -1
- package/package.json +1 -1
- package/plugin.html +1 -1
- package/plugin_blocks_test.html +1 -1
- package/plugin_default.html +1 -1
- package/plugin_idigital.html +1 -1
- package/plugin_s.html +1 -1
- package/static/js/{1821.456c1a15.js → 1821.7dc6c88e.js} +1 -1
- package/static/js/3062.6ce869e9.js +1 -0
- package/static/js/4035.bd6171d1.js +1 -0
- package/static/js/5211.2afa2b82.js +1 -0
- package/static/js/6898.63dc3be1.js +1 -0
- package/static/js/7291.9fbc644b.js +1 -0
- package/static/js/{8458.7ac6ec33.js → 8458.adf5921e.js} +1 -1
- package/translations.pot +124 -124
- package/static/js/3062.c4964587.js +0 -1
- package/static/js/4035.8367303a.js +0 -1
- package/static/js/5211.0ebfdb27.js +0 -1
- package/static/js/6898.9eb2b03f.js +0 -1
- package/static/js/7291.06a4c8c4.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[4035],{46929:(e,t,s)=>{s.d(t,{A:()=>O});var l=s(92810),o=s(45934),i=s(95838),n=s(2018),r=s(7744),a=s(71086),c=s(12280),m=s(43005),d=s(4800),p=s(79579),u=s(66726),g=s(55039),h=s(7166),x=s(28348),f=s(6391),_=s(69372),A=s(40886),j=s(14461),b=s(7228),v=s(23287),y=s(38883),S=s.n(y),k=s(73721),N=s(68031),E=s(44997),T=s(88296),w=s(26238),C=s(62303),I=s(18398),L=s(85163),P=s(47520),F=s(45695),H=s(56991),R=s(71157),B=s(64037),D=s(70082);const{useToken:V}=i.A,O=({form:e,elementSettings:t,showAddParagraph:s=!0,isButton:i=!1,linkProtocol:y,setLinkProtocol:O,linkTarget:M})=>{const{__:z}=(0,v.s9)(),{token:X}=V(),U=(0,R.hN)(),G=(0,F.XW)(),W=(0,F.K9)(),J=(0,l.useRef)(),q=(0,l.useRef)(null),K=(0,l.useRef)(null),[$,Q]=(0,l.useState)(!1),[Y,Z]=(0,l.useState)(null),[ee,te]=(0,l.useState)({start:0,end:0}),[se,le]=(0,l.useState)(!1);(0,B.A)((e=>{e.data.operation===L.Ru.APPLICATION_FOCUS_IN_IFRAME&&Z(null)}));const[oe,ie]=(0,l.useState)(null);(0,l.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&ie(!0)}),[]);const ne=(0,l.useRef)(null),re=e=>{G({operation:L.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"}),U.success({message:z("It`s done!"),placement:"bottomRight"})},ae=[{key:"1",label:z("This element"),onClick:()=>re("typograf")},{key:"2",label:z("The whole email"),onClick:()=>re("typograf_all")}],[ce,me]=(0,l.useState)(),[de,pe]=(0,l.useState)(!1);(0,l.useEffect)((()=>{t.linkHref&&("https://"===t.linkHref.substring(0,8)||"http://"===t.linkHref.substring(0,7)?O("https://"):"mailto:"===t.linkHref.substring(0,7)?O("mailto:"):"tel:"===t.linkHref.substring(0,4)?O("tel:"):"sms:"===t.linkHref.substring(0,4)?O("sms:"):"ftp://"===t.linkHref.substring(0,6)?O("ftp://"):"skype:"===t.linkHref.substring(0,6)?O("skype:"):"viber:"===t.linkHref.substring(0,6)?O("viber:"):O("")),e.setFieldsValue({linkHref:t.linkHref?t.linkHref:"https://"})}),[e,t,O]);const ue=(0,o.d4)(I.GH);(0,l.useEffect)((()=>{var e;null!==ue&&void 0!==ue&&null!==(e=ue.items)&&void 0!==e&&e.length&&me((0,H.cM)(ue.items,z,((e,t)=>{pe(!1),W(L.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[ue,me,z,pe,W]);(0,l.useEffect)((()=>{de&&ne.current&&ne.current.focus()}),[de]),(0,l.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||Z(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||pe(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);const ge=(0,l.useCallback)((({target:e})=>{if(e&&!se){const{selectionStart:t,selectionEnd:s}=e;te({start:t,end:s})}le(!1)}),[se]);(0,l.useEffect)((()=>ge({target:null===M||void 0===M?void 0:M.target})),[M,ge]);const he=(s,l)=>{const o=document.getElementById(l);if(o){var i,n;const r=null===(i=o.value)||void 0===i?void 0:i.substring(0,ee.start),a=null===(n=o.value)||void 0===n?void 0:n.substring(ee.end),c=l.substring(l.lastIndexOf("_")+1);G({operation:L.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{[c]:r+s+a}}),e.setFieldValue(c,r+s+a),o.focus(),setTimeout((()=>{o.selectionStart=ee.start,o.selectionEnd=ee.start+s.length}),400),le(!0)}};return(0,l.useEffect)((()=>{var e;Q(!(null===(e=t.textReplacer)||void 0===e||!e.length))}),[t,e]),(0,D.jsxs)(D.Fragment,{children:[s&&!t.showOnMobile&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n.A,{gutter:20,style:{paddingBottom:4},children:(0,D.jsx)(r.A,{span:12,gutter:20,children:(0,D.jsx)(N.A,{form:e,elementSettings:t,name:"textAlign"})})}),(0,D.jsx)(a.A,{className:"selected-td-form__divider",style:{marginBottom:20}})]}),t.showOnMobile&&(0,D.jsx)(a.A,{className:"selected-td-form__divider",style:{marginBottom:20}}),(0,D.jsxs)(n.A,{gutter:10,children:[(0,D.jsx)(r.A,{span:12,children:(0,D.jsx)(c.A.Item,{name:"AddImage",style:{marginBottom:X.formItemMarginBottomXS},children:(0,D.jsx)(m.Ay,{icon:(0,D.jsx)(C.A,{icon:"AddImage"}),onClick:()=>re("add_img"),style:{width:"100%"},children:z("Add image")})})}),(0,D.jsx)(r.A,{span:12,children:(0,D.jsx)(c.A.Item,{name:"Typography",style:{marginBottom:X.formItemMarginBottomXS},children:(0,D.jsx)(d.A,{arrow:!0,menu:{items:ae},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected-element-panel"),children:(0,D.jsx)(m.Ay,{icon:(0,D.jsx)(C.A,{icon:"Typograf"}),onClick:()=>re("typograf"),style:{width:"100%"},children:z("Typography")})})})}),ce&&(0,D.jsxs)(r.A,{span:24,id:"merge_tags_wrapper",style:{marginBottom:0},children:[(0,D.jsx)(m.Ay,{id:"merge_tags_button",icon:(0,D.jsx)(C.A,{icon:"MergeTags"}),style:{width:"100%",display:de?"none":"block"},onClick:()=>pe(!0),children:z("Merge tags")}),(0,D.jsx)(p.A,{ref:ne,popupClassName:"merge-tags",options:ce,placeholder:z("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const s=t.map(((t,s)=>{const l=t.label.split(new RegExp(`(${e})`,"gi"));return(0,D.jsxs)("span",{children:[0!==s&&(0,D.jsx)("span",{children:"\xa0/\xa0"}),l.map(((t,s)=>t.toLowerCase()===e.toLowerCase()?(0,D.jsx)("span",{style:{color:"red"},children:t},s):t))]},t.value)}));return(0,D.jsx)("div",{title:t.map((e=>e.label)).join(" / "),children:s})}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(s,l)=>{if(pe(!1),s){const o=ue.syntax.length>1?ce.findIndex((e=>e.key===l[0].key)):0,i=ue.syntax[o].replace("%value%",s[s.length-1]);"selected_button_form_href"===(null===Y||void 0===Y?void 0:Y.getAttribute("id"))||"selected_text_form_linkHref"===(null===Y||void 0===Y?void 0:Y.getAttribute("id"))||"selected_text_form_textReplacer"===(null===Y||void 0===Y?void 0:Y.getAttribute("id"))?he(i,null===Y||void 0===Y?void 0:Y.getAttribute("id")):(e.setFieldValue("textReplacer",i),G({operation:L.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:i}}))}},style:{display:de?"block":"none",width:"100%"},open:de,onKeyDown:e=>{"Escape"===e.key&&pe(!1)}})]})]}),(0,D.jsx)(a.A,{className:"selected-td-form__divider",style:{marginBottom:t.showOnMobile?20:0,marginTop:20}}),!t.showOnMobile&&(0,D.jsx)("div",{className:"form-group-title",children:z("Text")}),(0,D.jsx)(u.A,{trigger:["hover"],title:z("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode,children:(0,D.jsx)(c.A.Item,{name:"fontFamily",className:"form-item-margin-xs",children:(0,D.jsx)(T.A,{textEditor:!0})})}),!t.showOnMobile&&(0,D.jsxs)(n.A,{gutter:10,children:[(0,D.jsx)(r.A,{span:12,children:(0,D.jsx)(u.A,{trigger:["hover"],title:z("Font size"),placement:"bottom",children:(0,D.jsx)(c.A.Item,{name:"fontSize",children:(0,D.jsx)(E.A,{min:0,placeholder:z("Font size"),prefix:(0,D.jsx)(h.A,{}),addonAfter:"px"})})})}),(0,D.jsx)(r.A,{span:12,children:(0,D.jsx)(u.A,{trigger:["hover"],title:z("Line height"),placement:"bottom",children:(0,D.jsx)(c.A.Item,{name:"lineHeight",children:(0,D.jsx)(E.A,{min:0,placeholder:z("Line height"),prefix:(0,D.jsx)(x.A,{}),addonAfter:"px"})})})})]}),(0,D.jsxs)(n.A,{gutter:10,children:[(0,D.jsx)(r.A,{span:3,children:(0,D.jsx)(k.A,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:z(oe?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:(0,D.jsx)(f.A,{className:"selected-text-common-form__icon-radius"})})}),(0,D.jsx)(r.A,{span:3,children:(0,D.jsx)(k.A,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:z(oe?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:(0,D.jsx)(_.A,{className:"selected-text-common-form__icon-radius"})})}),(0,D.jsx)(r.A,{span:3,children:(0,D.jsx)(k.A,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:z(oe?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,D.jsx)(A.A,{className:"selected-text-common-form__icon-radius"})})}),(0,D.jsx)(r.A,{span:3,children:(0,D.jsx)(k.A,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:z(oe?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:(0,D.jsx)(j.A,{className:"selected-text-common-form__icon-radius"})})}),s&&(0,D.jsx)(r.A,{span:3,children:(0,D.jsx)(k.A,{form:e,className:S()("selected-text-common-form__button selected-text-common-form__button_style",{"selected-text-common-form__button--active":"string"===typeof t.linkHref}),elementSettings:t,name:"textLink",tooltipTitle:z("Link"),icon:(0,D.jsx)(b.A,{className:"selected-text-common-form__icon-radius"})})}),i&&(0,D.jsx)(r.A,{span:12,children:(0,D.jsx)(u.A,{trigger:["hover"],title:z("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode,children:(0,D.jsx)(c.A.Item,{name:"textColor",rules:[{message:z("Please set the font color")}],children:(0,D.jsx)(w.A,{placeholder:z("Color"),usedColors:t.usedColors})})})}),!i&&(0,D.jsx)(r.A,{span:3,children:(0,D.jsx)(u.A,{title:z("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),children:(0,D.jsx)(m.Ay,{className:S()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":$}),icon:(0,D.jsx)(C.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{Q(!$),$?(e.setFieldValue("textReplacer",""),G({operation:L.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:""}})):setTimeout((()=>q.current.focus()))},ref:K})})})]}),s&&"string"===typeof t.linkHref&&(0,D.jsx)(u.A,{trigger:["hover"],title:z("The URL that the hyperlink directs to."),placement:"bottom",children:(0,D.jsx)(c.A.Item,{name:"linkHref",children:(0,D.jsx)(g.A,{ref:J,addonBefore:(0,D.jsx)(P.Ai,{linkProtocol:y,handleLinkProtocolsChange:t=>{e.setFieldValue("linkHref","mergetag"!==t?t:""),O(t)},__:z}),allowClear:!0,placeholder:z("Hyperlink URL"),autoFocus:null===t||void 0===t?void 0:t.isNewLink,onSelect:ge,prefix:(0,D.jsx)(P.RM,{linkProtocol:y})})})}),!i&&$&&(0,D.jsx)(u.A,{trigger:["hover"],title:z("Text"),placement:"bottom",children:(0,D.jsx)(c.A.Item,{name:"textReplacer",children:(0,D.jsx)(g.A,{placeholder:z("The code that will replace this text"),allowClear:!0,prefix:(0,D.jsx)("span",{className:"addon-text-content",children:z("Text")}),onChange:e=>{""!==e.target.value&&K.current.classList.add("selected-td-form__button--active")},ref:q})})}),!i&&(0,D.jsxs)(n.A,{gutter:10,style:{paddingBottom:4},children:[(0,D.jsx)(r.A,{span:12,children:(0,D.jsx)(u.A,{trigger:["hover"],title:z("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode,children:(0,D.jsx)(c.A.Item,{name:"textColor",rules:[{message:z("Please set the font color")}],children:(0,D.jsx)(w.A,{placeholder:z("Color"),usedColors:t.usedColors})})})}),(0,D.jsx)(r.A,{span:12,children:(0,D.jsx)(u.A,{trigger:["hover"],title:z("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode,children:(0,D.jsx)(c.A.Item,{name:"textBackgroundColor",rules:[{message:z("Please set the background color")}],children:(0,D.jsx)(w.A,{placeholder:z("Background color"),usedColors:t.usedColors})})})})]})]})}},77416:(e,t,s)=>{s.d(t,{A:()=>B});var l=s(92810),o=s(64617),i=s(81e3),n=s(71086),r=s(66726),a=s(12280),c=s(4800),m=s(55039),d=s(43005),p=s(7166),u=s(28348),g=s(6391),h=s(69372),x=s(40886),f=s(14461),_=s(7228),A=s(98885),j=s(87984),b=s(73170),v=s(38587),y=s(45934),S=s(23287),k=s(73721),N=s(88296),E=s(44997),T=s(68031),w=s(62303),C=s(65983),I=s(47358),L=s(7760),P=s(85163),F=s(45695),H=s(26238),R=s(70082);const B=({form:e,elementSettings:t,showAddParagraph:s=!0,isButton:B=!1})=>{const{__:D}=(0,S.s9)(),V=(0,F.XW)(),O=(0,y.wA)(),{emailId:M}=(0,o.g)(),z=(0,y.d4)(M?C.Hs:L.gm).hasOwnProperty("type")?P.IE:P.Tm,[X,U]=(0,l.useState)(null);(0,l.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&U(!0)}),[]);const G=e=>{V({operation:P.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"})},W=[{key:"1",label:D("This element"),onClick:()=>G("typograf")},{key:"2",label:D("The whole email"),onClick:()=>G("typograf_all")}],[J,q]=(0,l.useState)(t.textAlign),[K,$]=(0,l.useState)(t.linkHref),Q=e=>q(e);return(0,l.useEffect)((()=>{q(t.textAlign),$(t.linkHref)}),[t]),(0,R.jsx)("div",{className:"selected_text_common_form_mobile",children:(0,R.jsxs)(i.A,{size:"8",split:(0,R.jsx)(n.A,{type:"vertical"}),children:[(0,R.jsxs)(i.A,{size:8,className:"selected_text_common_form_mobile__group",children:[(0,R.jsx)("div",{style:{width:190},children:(0,R.jsx)(r.A,{trigger:["hover"],title:D("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode,children:(0,R.jsx)(a.A.Item,{name:"fontFamily",children:(0,R.jsx)(N.A,{textEditor:!0,codeMode:!0})})})}),(0,R.jsx)("div",{style:{width:90},children:(0,R.jsx)(r.A,{trigger:["hover"],title:D("Font size"),placement:"bottom",children:(0,R.jsx)(a.A.Item,{name:"fontSize",children:(0,R.jsx)(E.A,{min:0,placeholder:D("Font size"),prefix:(0,R.jsx)(p.A,{}),addonAfter:"px"})})})}),(0,R.jsx)("div",{style:{width:90},children:(0,R.jsx)(r.A,{trigger:["hover"],title:D("Line height"),placement:"bottom",children:(0,R.jsx)(a.A.Item,{name:"lineHeight",children:(0,R.jsx)(E.A,{min:0,placeholder:D("Line height"),prefix:(0,R.jsx)(u.A,{}),addonAfter:"px"})})})})]}),(0,R.jsxs)(i.A,{size:8,className:"selected_text_common_form_mobile__group",children:[(0,R.jsx)(k.A,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:D(X?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:(0,R.jsx)(g.A,{className:"selected-td-form__icon-radius"})}),(0,R.jsx)(k.A,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:D(X?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:(0,R.jsx)(h.A,{className:"selected-td-form__icon-radius"})}),(0,R.jsx)(k.A,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:D(X?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:(0,R.jsx)(x.A,{className:"selected-td-form__icon-radius"})}),(0,R.jsx)(k.A,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:D(X?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:(0,R.jsx)(f.A,{className:"selected-td-form__icon-radius"})})]}),(0,R.jsxs)(i.A,{size:8,className:"selected_text_common_form_mobile__group",children:[(0,R.jsx)(r.A,{trigger:["hover"],title:D("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode,children:(0,R.jsx)(a.A.Item,{name:"textColor",rules:[{message:D("Please set the font color")}],children:(0,R.jsx)(H.A,{placeholder:D("Color"),usedColors:t.usedColors,codeMode:!0})})}),!B&&(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(r.A,{trigger:["hover"],title:D("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode,children:(0,R.jsx)(a.A.Item,{name:"textBackgroundColor",rules:[{message:D("Please set the background color")}],children:(0,R.jsx)(H.A,{placeholder:D("Background color"),usedColors:t.usedColors})})})})]}),s&&(0,R.jsx)(i.A,{size:8,className:"selected_text_common_form_mobile__group",children:(0,R.jsxs)(R.Fragment,{children:["string"===typeof K?(0,R.jsx)(c.A,{arrow:!0,dropdownRender:()=>(0,R.jsx)(r.A,{trigger:["hover"],title:D("The URL that the hyperlink directs to."),placement:"bottom",children:(0,R.jsx)(a.A.Item,{name:"linkHref",children:(0,R.jsx)(m.A,{allowClear:!0,placeholder:"href",prefix:(0,R.jsx)(_.A,{}),autoFocus:null===t||void 0===t?void 0:t.isNewLink})})}),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:520,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile"),children:(0,R.jsx)("div",{children:(0,R.jsx)(k.A,{form:e,className:"selected-td-form__button selected-td-form__button_style selected-td-form__button--active",elementSettings:t,name:"textLink",icon:(0,R.jsx)(_.A,{className:"selected-td-form__icon-radius"}),showTooltip:!1})})}):(0,R.jsx)(k.A,{form:e,className:"selected-td-form__button selected-td-form__button_style",elementSettings:t,name:"textLink",tooltipTitle:D("Link"),icon:(0,R.jsx)(_.A,{className:"selected-td-form__icon-radius"})}),(0,R.jsx)(c.A,{arrow:!0,dropdownRender:()=>(0,R.jsx)(T.A,{form:e,elementSettings:t,name:"textAlign",setAlignStateHandle:Q}),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:615,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile"),children:(0,R.jsx)(d.Ay,{icon:"right"===J?(0,R.jsx)(A.A,{}):"center"===J?(0,R.jsx)(j.A,{}):(0,R.jsx)(b.A,{}),className:"selected-td-form__button"})})]})}),(0,R.jsxs)(i.A,{size:8,className:"selected_text_common_form_mobile__group",children:[s&&(0,R.jsx)(r.A,{trigger:["hover"],title:D("Add paragraph"),placement:"bottom",children:(0,R.jsx)(d.Ay,{icon:(0,R.jsx)(w.A,{icon:"Paragraph"}),onClick:()=>G("add_p"),className:"selected-td-form__button"})}),(0,R.jsx)(r.A,{trigger:["hover"],title:D("Add inline image"),placement:"bottom",children:(0,R.jsx)(d.Ay,{icon:(0,R.jsx)(w.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),onClick:()=>G("add_img"),className:"selected-td-form__button"})}),(0,R.jsx)(c.A,{arrow:!0,menu:{items:W},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile"),overlayStyle:{left:750,top:52,transform:"translateX(0)",marginLeft:57},children:(0,R.jsx)(d.Ay,{icon:(0,R.jsx)(w.A,{icon:"Typograf"}),className:"selected-td-form__button"})}),(0,R.jsx)(d.Ay,{icon:(0,R.jsx)(v.A,{}),type:"icon",style:{marginLeft:26},onClick:()=>{V({operation:P.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),O((0,I.Fk)()),setTimeout((()=>{z===P.IE?O((0,L.A9)({type:null})):O((0,C.A9)({type:null}))}),300)}})]})]})})}},40857:(e,t,s)=>{s.d(t,{A:()=>v});var l=s(92810),o=s(12280),i=s(66726),n=s(29234),r=s(2018),a=s(7744),c=s(28348),m=s(23287),d=s(45934),p=s(65655),u=s(46929),g=s(77416),h=s(40187),x=s(44997),f=s(85163),_=s(47520),A=s(45695),j=s(47358),b=s(70082);const v=({elementSettings:e})=>{const{__:t}=(0,m.s9)(),s=(0,A.XW)(),[v]=o.A.useForm(),y=(0,d.d4)(j.Ct),S=(0,d.d4)(j.CS),k=(0,d.d4)(j.Fv),N=(0,d.d4)(j.yy),E=k&&"bottom"!==N,[T,w]=(0,l.useState)("https://");(0,l.useEffect)((()=>{var t,s,l,o,i;e&&v.setFieldsValue({...e,linkHref:e.linkHref?e.linkHref:"https://",mobileFontSize:(0,_.ok)(null===(t=e.mobileFontSize)||void 0===t?void 0:t.value),mobileFontSizeDim:null===(s=e.mobileFontSize)||void 0===s?void 0:s.dim,mobileLineHeight:(0,_.ok)(null===(l=e.mobileLineHeight)||void 0===l?void 0:l.value),mobileLineHeightDim:null===(o=e.mobileLineHeight)||void 0===o?void 0:o.dim,mobileTextAlign:(0,_.ok)(null===(i=e.mobileTextAlign)||void 0===i?void 0:i.value)})}),[v,e]);return(0,b.jsxs)(o.A,{form:v,layout:"vertical",name:"selected_text_form",autoComplete:"off",onValuesChange:t=>{const l=v.getFieldsValue(!0),o=Object.keys(t)[0];let i;switch(o){case"mobileFontSize":i={[o]:{classNamePrefix:"em-mob-font_size-",value:t[o],dim:l.mobileFontSizeDim}};break;case"mobileLineHeight":i={[o]:{classNamePrefix:"em-mob-line_height-",value:t[o],dim:l.mobileLineHeightDim}};break;case"mobileTextAlign":i={[o]:{classNamePrefix:"em-mob-text_align-",value:t[o]}};break;case"linkHref":let e=t[o];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),v.setFieldValue("linkHref",e)),i={[o]:e},"https://"===t[o].substring(0,8)||"http://"===t[o].substring(0,7)?w("https://"):"mailto:"===t[o].substring(0,7)?w("mailto:"):"tel:"===t[o].substring(0,4)?w("tel:"):"sms:"===t[o].substring(0,4)?w("sms:"):"ftp://"===t[o].substring(0,6)?w("ftp://"):"skype:"===t[o].substring(0,6)?w("skype:"):"viber:"===t[o].substring(0,6)?w("viber:"):w("");break;default:i=t}s({operation:f.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:i})},className:"element-controls",initialValues:{textAlign:"left",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textColor:"",textBackgroundColor:"",textLink:!1,textReplacer:""},children:[!E&&(0,b.jsx)(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,b.jsx)(n.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})}),!(y===f.ND&&!E&&S.styles)&&(0,b.jsx)("div",{id:"selected_element_form_desktop_props",style:{paddingRight:0},children:(0,b.jsx)("div",{className:"selected_form-props-wrapper",children:E?(0,b.jsx)(g.A,{form:v,elementSettings:e}):(0,b.jsx)(u.A,{form:v,elementSettings:e,linkProtocol:T,setLinkProtocol:w})})}),!E&&(0,b.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:y===f.ND&&S.styles?"block":"none"},children:(0,b.jsxs)("div",{className:"selected_form-mobile-props-wrapper",children:[(0,b.jsx)(r.A,{gutter:20,children:(0,b.jsx)(a.A,{span:12,children:(0,b.jsx)(h.A,{form:v,elementSettings:e,name:"mobileTextAlign"})})}),!!e.showOnMobile&&(0,b.jsx)(u.A,{form:v,elementSettings:e,linkProtocol:T,setLinkProtocol:w}),(0,b.jsxs)(r.A,{gutter:10,style:{marginBottom:4},children:[(0,b.jsx)(a.A,{span:12,children:(0,b.jsx)(p.A,{})}),(0,b.jsx)(a.A,{span:12,children:(0,b.jsx)(o.A.Item,{name:"mobileLineHeight",children:(0,b.jsx)(x.A,{min:0,placeholder:t("Line height"),prefix:(0,b.jsx)(c.A,{}),addonAfter:"px"})})})]})]})})]})}},2091:(e,t,s)=>{s.d(t,{A:()=>d});var l=s(92810),o=s(12280),i=s(55039),n=s(28372),r=s(23287),a=s(85163),c=s(45695),m=s(70082);const d=({elementSettings:e})=>{const{__:t}=(0,r.s9)(),[s]=o.A.useForm(),{TextArea:d}=i.A,p=(0,c.XW)();(0,l.useEffect)((()=>{e&&s.setFieldsValue({...e})}),[s,e]);return(0,m.jsx)(o.A,{form:s,layout:"vertical",name:"selected_variable_form",initialValues:{value:""},onValuesChange:t=>{p({operation:a.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off",children:(0,m.jsx)("div",{className:"selected_form-props-wrapper",children:(0,m.jsx)(o.A.Item,{label:t("Variable value"),name:"value",tooltip:{title:t("Type the output parameters of your platform. E.g., ")+"${Recipient.FirstName}",icon:(0,m.jsx)(n.A,{})},style:{marginBottom:35},children:(0,m.jsx)(d,{rows:4,placeholder:t("Variable value")})})})})}},90847:(e,t,s)=>{s.d(t,{A:()=>_});var l=s(92810),o=s(12280),i=s(66726),n=s(29234),r=s(2018),a=s(7744),c=s(11007),m=s(23287),d=s(45934),p=s(85163),u=s(45695),g=s(95955),h=s(44997),x=s(47358),f=s(70082);const _=({elementSettings:e})=>{const{__:t}=(0,m.s9)(),[s]=o.A.useForm(),_=(0,u.XW)(),A=(0,d.d4)(x.Ct),j=(0,d.d4)(x.CS),b=(0,d.d4)(x.Fv),v=(0,d.d4)(x.yy),y=b&&"bottom"!==v;(0,l.useEffect)((()=>{var t,l,o,i,n;e&&s.setFieldsValue({...e,height:null===(t=e.height)||void 0===t?void 0:t.value,heightDim:null===(l=e.height)||void 0===l?void 0:l.dim,mobileHeight:(n=null===(o=e.mobileHeight)||void 0===o?void 0:o.value,n&&"auto"!==n?n:0===n?"0":""),mobileHeightDim:null===(i=e.mobileHeight)||void 0===i?void 0:i.dim})}),[s,e]);return(0,f.jsxs)(o.A,{form:s,layout:"vertical",name:"selected_vindent_form",initialValues:{height:"",heightDim:"",mobileHeight:"",mobileHeightDim:""},onValuesChange:t=>{const l=s.getFieldsValue(!0),o=Object.keys(t)[0];let i;switch(o){case"height":i={[o]:{value:t[o],dim:l.heightDim}};break;case"heightDim":i={height:{value:l.height,dim:t[o]}};break;case"mobileHeight":i={[o]:{classNamePrefix:"em-mob-height-",value:t[o],dim:l.mobileHeightDim}};break;case"mobileHeightDim":i={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[o]}};break;default:i=t}_({operation:p.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:i})},autoComplete:"off",children:[!y&&(0,f.jsx)(i.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom",children:(0,f.jsx)(n.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})}),A===p.ND&&j.styles?(0,f.jsx)("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:A===p.ND&&j.styles?"block":"none",marginBottom:10},children:(0,f.jsx)("div",{className:"selected_form-mobile-props-wrapper",children:(0,f.jsx)(r.A,{gutter:10,style:{marginBottom:20},children:(0,f.jsx)(a.A,{span:12,children:(0,f.jsx)(g.A,{form:s,name:"mobileHeight",elementSettings:e})})})})}):(0,f.jsx)("div",{id:"selected_element_form_desktop_props",style:{display:A===p.ND&&j.styles?"none":"block"},children:(0,f.jsx)("div",{className:"selected_form-props-wrapper",children:(0,f.jsx)(r.A,{gutter:10,children:(0,f.jsx)(a.A,{span:14,children:(0,f.jsx)(o.A.Item,{name:"height",children:(0,f.jsx)(h.A,{min:0,placeholder:t("Indent height"),prefix:(0,f.jsx)(c.A,{}),addonAfter:"px"})})})})})})]})}},77019:(e,t,s)=>{s.d(t,{A:()=>C});var l=s(92810),o=s(45934),i=s(64617),n=s(95838),r=s(12280),a=s(14852),c=s(43005),m=s(55039),d=s(81662),p=s(66522),u=s(71157),g=s(28372),h=s(23287),x=s(62303),f=s(64936),_=s(86286),A=s(84568),j=s(63531),b=s(32269),v=s(85163),y=s(32411),S=s(93982),k=s(13522),N=s(56991),E=s(70082);const{useToken:T}=n.A,w=({isModalVisible:e,email:t})=>{const{__:s}=(0,h.s9)(),[n]=r.A.useForm(),w=(0,o.wA)(),{emailId:C}=(0,i.g)(),I=(0,o.d4)(_.C1),[L,P]=(0,j.lg)(),{token:F}=T(),H=(0,u.hN)(),R=(0,o.Pj)(),[B,D]=(0,l.useState)(!1),V=t.project,[O,M]=(0,A.OD)(),{data:z}=A.Nq.endpoints.getProject.select(+V)(R.getState()),{testEmails:X}=(0,N.rD)(),[U,G]=(0,l.useState)([]),[W,J]=(0,l.useState)(!1),q=(0,S.ml)(k.A.ON_SEND_EMAIL_MODAL_ID);(0,l.useEffect)((()=>{v.EW.isPlugin&&e?q.fire(t).then((t=>{t.some((e=>!1===e))?w((0,f.Oo)()):D(e)})):D(e)}),[e,w,D,t,q]),(0,l.useEffect)((()=>{if(z&&!v.EW.isPlugin){const{owner:e,admins:t,users:s,invited_users:l}=z.members;let o=[];const i=localStorage.getItem(v.V0.em_test_emails)?JSON.parse(localStorage.getItem(v.V0.em_test_emails)):[];if(i.length&&i[V]&&i[V].map((({prevLSEmail:e})=>o.push(e))),l&&l.map((({invited_user_email:e})=>o.push(e))),s&&s.map((({user_email:e})=>o.push(e))),e&&o.push(e.user_email),t&&t.map((({user_email:e})=>o.push(e))),z.projects_test_emails){const e=z.projects_test_emails.map((({projects_test_email:e})=>e));o.push(...e)}const n=Array.from(new Set(o));o.length&&G(n.map((e=>({value:e}))))}}),[z,V]),(0,l.useEffect)((()=>{v.EW.isPlugin&&G(X.map((e=>({value:e}))))}),[X]),(0,l.useEffect)((()=>{var e;const t=localStorage.getItem(v.V0.em_test_emails);if(t&&B&&0===(null===(e=n.getFieldValue("recipients"))||void 0===e?void 0:e.length)){const e=JSON.parse(t);null!==e&&void 0!==e&&e[V]&&n.setFieldsValue({recipients:e[V]})}}),[V,B,n]),(0,l.useEffect)((()=>{n.setFieldsValue({subject:t.subject})}),[n,t.subject]);const K=(0,y.fn)();return(0,l.useEffect)((()=>{if(P.isSuccess&&W){var e;if(200!==(null===(e=P.data)||void 0===e?void 0:e.status)){var l,o;(0,b.p6)({error:{data:{code:null===(l=P.data)||void 0===l?void 0:l.code,message:null===(o=P.data)||void 0===o?void 0:o.message}}},H)}else{const e=[...new Set([...U.map((e=>e.value)),...n.getFieldValue("recipients")])];O({projectId:V,projects_test_emails:e.map((e=>({projects_test_email:e})))});const l=localStorage.getItem(v.V0.em_test_emails)?JSON.parse(localStorage.getItem(v.V0.em_test_emails)):[];let o=n.getFieldValue("recipients");localStorage.setItem(v.V0.em_test_emails,JSON.stringify({...l,[V]:[...new Set(o)]})),(0,b.wB)(s("The email \u201c")+t.title+s("\u201d was successfully sent."),H)}J(!1),n.resetFields(),w((0,f.Oo)())}}),[P,n,V,O,U,W,w,t.title,M,s,H]),(0,l.useEffect)((()=>{M.isError&&((0,b.p6)(M,H),J(!1),n.resetFields(),w((0,f.Oo)()))}),[w,M,n,H]),(0,l.useEffect)((()=>{n.setFieldsValue({subject:t.subject||t.title})}),[t,n]),(0,E.jsx)(a.A,{width:572,title:(0,E.jsxs)("div",{children:[(0,E.jsx)(x.A,{icon:"SendOutlined"})," ",s("Send a test email")]}),className:"blocks-modal",open:B,onCancel:()=>{w((0,f.Oo)()),n.resetFields()},centered:!0,footer:[(0,E.jsx)(c.Ay,{size:"large",className:"em-analytics__email-send-test",type:"primary",htmlType:"submit",form:"Send mail",loading:M.isLoading,icon:(0,E.jsx)(x.A,{icon:"SendOutlined",className:"email-preview-menu__list-item-icon"}),onClick:()=>{n.validateFields().then((()=>{const e={user_id:I.id,project_id:V,email_id:C,subject:n.getFieldValue("subject"),email:n.getFieldValue("recipients").join(","),html:(t=(null===K||void 0===K?void 0:K.getValue())||"",t.replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[/]/g,"\\/").replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))};var t;L(e),J(!0)})).catch((e=>{console.warn(e)}))},disabled:P.isLoading,children:s("Send")},"submit")],forceRender:!0,children:(0,E.jsxs)(r.A,{form:n,layout:"vertical",name:"send_mail_form",initialValues:{subject:t.subject||t.title,recipients:[]},autoComplete:"off",style:{padding:"10px 24px 0"},children:[(0,E.jsx)(r.A.Item,{label:s("Subject"),name:"subject",rules:[{required:!1,message:s("Please type subject")}],children:(0,E.jsx)(m.A,{size:"large",placeholder:s("Type subject")})}),(0,E.jsx)(r.A.Item,{label:s("Recipients"),name:"recipients",tooltip:{title:s("The test email will be sent to the specified addresses."),icon:(0,E.jsx)(g.A,{})},rules:[{required:!0,validator:(e,t)=>t.length>10?Promise.reject(new Error(s("A test email can be sent to a maximum of 10 addresses."))):0!==t.length?t.every((e=>b.au.test(e.toLowerCase())))?Promise.resolve():Promise.reject(new Error(s("Please type correct emails"))):Promise.reject(new Error(s("Please type emails")))}],children:(0,E.jsx)(d.A,{size:"large",mode:"tags",placeholder:s("Add up to 10 recipients"),tooltip:{title:"Tooltip with customize icon",icon:(0,E.jsx)(g.A,{})},options:U,tagRender:e=>{const{label:t,closable:s,onClose:l}=e;return(0,E.jsx)(p.A,{color:F.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:s,onClose:l,style:{borderRadius:6},children:t})},getPopupContainer:()=>document.getElementById("send_mail_form")})})]})})};w.defaultProps={isModalVisible:!1,email:null};const C=w}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[5211],{79381:(e,t,s)=>{s.d(t,{A:()=>se});var i=s(92810),r=s(64617),n=s(41919),a=s(95838),l=s(71157),o=s(98915),d=s(17590),c=s(21195),m=s(45934),u=s(38883),p=s.n(u),h=s(43005),g=s(24696),_=s(94822),v=s(23287),x=s(3824),j=s(75111),f=s(81325),y=s(74919),A=s(39475),b=s(8375),w=s(32293),N=s(9588),S=s(68631),k=s(84501),I=s(85025),C=s(94219),T=s(81577),E=s(64936),L=s(36404),z=s(86286),D=s(39990),O=s(32269),M=s(90070),R=s(85163),F=s(70082);const B=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:s})=>{var n;const{__:a}=(0,v.s9)();let l=(0,m.wA)(),o=(0,r.Zp)();const{projectId:d}=(0,r.g)(),{pathname:c}=(0,r.zy)(),[u,B]=(0,i.useState)(""),P=(0,m.d4)(L.yN),H=(0,m.d4)(z.C1),q=(0,M.p6)(),$=(0,i.useCallback)((()=>{c.includes("blocks")?B("Blocks"):c.includes("emails")?B("Emails"):c.includes("members")&&B("Members"),!s&&t(!0)}),[c,t,s]);(0,i.useEffect)((()=>{$()}),[$]);let V=[],W=[];const U=(null===P||void 0===P?void 0:P.title)||"";let X=[{label:(0,F.jsx)("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer",children:a("Help")}),key:"Help center",icon:(0,F.jsx)(x.A,{style:{fontSize:"16px"}}),className:"help-center"},{label:a("Chat support"),key:"Support chat",icon:(0,F.jsx)(j.A,{style:{fontSize:"16px"}}),className:"open-support-chat",onClick:()=>{try{window.carrotquest.open()}catch(e){console.log(e)}}}],Y=[{label:a("Account settings"),key:"Account settings",icon:(0,F.jsx)(f.A,{style:{fontSize:"16px"}}),className:"em-analytics__account-settings",onClick:()=>{l((0,E.qf)(R.lx.EDIT_PROFILE_MODAL)),!s&&t(!0)}},{label:(0,F.jsx)(_.N_,{to:"/billing",children:a("Billing")}),key:"Billing",icon:(0,F.jsx)(y.A,{style:{fontSize:"16px"}}),className:"em-analytics__billing"},{label:a("Sign out"),icon:(0,F.jsx)(A.A,{style:{fontSize:"16px"}}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{(0,O.Id)(q),l(D.Q2.util.resetApiState()),o("/auth",{replace:!0})}}];const Z="/projects"+(d?"/"+d+"/emails?page=1":""),J=[{label:(0,F.jsx)(_.N_,{style:{fontSize:16},to:Z,children:U}),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:d?(0,F.jsx)(_.N_,{to:Z,className:"project-menu__block",style:{fontSize:"18px",zIndex:99},children:(0,F.jsx)(h.Ay,{type:"primary",className:"project-menu__block-button",children:null===U||void 0===U?void 0:U.split(" ").slice(0,2).map((e=>Array.from(e)[0]))})}):(0,F.jsxs)(_.N_,{to:Z,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"28px"},children:[(0,F.jsxs)("b",{children:[(0,F.jsx)("span",{className:"letters",children:"E"}),(!e||s)&&(0,F.jsx)("span",{className:"hidden-text",children:"mail"})]}),(0,F.jsx)("span",{className:"letters",children:"M"}),(!e||s)&&(0,F.jsx)("span",{className:"hidden-text",children:"aker"})]}),className:p()("project-menu__list-item project-menu__list-item_project project-menu__list-item_project",{"project-menu__list-item_logo":!d,"project-menu__list-item_project":d}),children:d&&[{label:a("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:(0,F.jsx)(b.A,{style:{fontSize:"16px"}}),onClick:()=>{l((0,E.qf)(R.lx.EDIT_PROJECT_MODAL)),!s&&t(!0)}},{label:(0,F.jsx)(_.N_,{to:"/projects",children:a("List of projects")}),key:"List of projects",icon:(0,F.jsx)(w.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}]},{type:"divider"}];return V.push({icon:(0,F.jsx)(N.A,{style:{fontSize:20}}),label:(0,F.jsx)(_.N_,{to:`/projects/${d}/emails`,rel:"noopener noreferrer",children:a("Emails")}),key:"Emails",className:"project-menu__list-item em-analytics__project-menu-emails"},{icon:(0,F.jsx)(S.A,{style:{fontSize:20}}),label:(0,F.jsx)(_.N_,{to:`/projects/${d}/blocks`,rel:"noopener noreferrer",children:a("Blocks")}),key:"Blocks",className:"project-menu__list-item em-analytics__project-menu-blocks"},{icon:(0,F.jsx)(k.A,{style:{fontSize:20}}),label:(0,F.jsx)(_.N_,{to:`/projects/${d}/members`,rel:"noopener noreferrer",children:a("Members")}),key:"Members",className:"project-menu__list-item em-analytics__project-menu-members"}),"community"===H.subscription.post_name&&d&&H.counters.emails_counter>2&&W.push({icon:(0,F.jsx)(I.A,{style:{fontSize:20,lineHeight:"44px"}}),label:(0,F.jsx)(_.N_,{to:"/billing",rel:"noopener noreferrer",style:{fontSize:16,color:"white"},children:a("Upgrade")}),key:"Emails",className:"project-menu__list-item"}),W.push({icon:(0,F.jsx)(C.A,{style:{fontSize:18}}),label:a("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:X},{icon:(0,F.jsx)(T.A,{style:{fontSize:18}}),label:a("What's new"),key:"What's new",className:"project-menu__list-item ducalis-changelog-widget em-analytics__project-menu-ducalis"},{icon:(0,F.jsx)("span",{style:{width:"20px",height:"20px",fontSize:"20px"},className:"user-profile__avatar anticon",children:null!==H&&void 0!==H&&null!==(n=H.avatar_urls)&&void 0!==n&&n[24]?[(0,F.jsx)("img",{style:{width:"100%"},src:null===H||void 0===H?void 0:H.avatar_urls[24],alt:null!==H&&void 0!==H&&H.name?`${null===H||void 0===H?void 0:H.name} avatar`:"User avatar",className:"user-profile__avatar-img"},"img"),(0,F.jsx)(f.A,{style:{position:"absolute",fontSize:20,borderRadius:100,overflow:"hidden",height:20,width:20,lineHeight:0,zIndex:-1}},"UserOutlined")]:(0,F.jsx)(f.A,{style:{color:"white"}})}),label:(null===H||void 0===H?void 0:H.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:Y}),(0,F.jsx)(F.Fragment,{children:(0,F.jsxs)("div",{className:"project-menu",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)(g.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:J,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),d&&(0,F.jsx)(g.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[u],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:V,triggerSubMenuAction:"hover"})]}),(0,F.jsx)(g.A,{disabledOverflow:!0,selectable:!0,selectedKeys:["Emails"],forceSubMenuRender:"true",className:"project-menu__list project-menu__list_bottom",style:{fontSize:14,marginBottom:6},subMenuOpenDelay:.3,subMenuCloseDelay:.6,items:W,triggerSubMenuAction:"hover"})]})})};var P=s(35285),H=s(65052),q=s(70656),$=s(62689),V=s(65983),W=s(7760),U=s(19366),X=s(3289),Y=s(78451),Z=s(32411),J=s(69156),G=s(13329),K=s(56991),Q=s(28316);const{Sider:ee}=n.A,{useToken:te}=a.A,se=()=>{const{token:e}=te();let t=(0,r.zy)();const s=(0,m.wA)(),a=(0,r.Zp)(),{emailId:u,blockId:h}=(0,r.g)(),g=(0,m.d4)(z.C1),_=(0,m.d4)(E.cL),v=(0,i.useRef)(),[x]=(0,$.bw)(),j=(0,l.hN)();v.current||(v.current=(0,Z.$Z)()),(0,i.useEffect)((()=>{(0,J.FN)(e)}),[e]);const{data:f=[],isSuccess:y}=(0,$.I9)(g.id,{pollingInterval:3e4,skip:_});(0,i.useEffect)((()=>{const e=f.filter((e=>""===e.seen||null===e.seen));setTimeout((()=>{e.length&&y&&e.forEach((e=>{var t,s;j[e.type]({message:(0,F.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(t=e.title)||void 0===t?void 0:t.rendered)||e.title||""}}),description:(0,F.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(s=e.content)||void 0===s?void 0:s.rendered)||""}}),placement:"bottomRight"});const i=(new Date).toLocaleString();x({id:e.id,datetime:i}).unwrap()}))}),5e3)}),[y,x,f,j]),(0,U.A)(),(0,X.A)(),(0,Y.A)(),(0,i.useEffect)((()=>{h||s((0,W.nJ)()),u||s((0,V.ss)())}),[h,u,s,t.pathname]);let A=null;u||h||t.pathname.endsWith("/new")?A=v.current:v.current&&v.current.getValue()&&setTimeout((()=>v.current.setValue("")),1e3);const b=JSON.parse(localStorage.getItem(R.V0.em_menu_is_locked)),[w,N]=(0,i.useState)((null===b||void 0===b?void 0:b.isLocked)||!1),[S,k]=(0,i.useState)(!0);return(0,i.useEffect)((()=>{const e=()=>localStorage.setItem(R.V0.em_menu_is_locked,JSON.stringify({isLocked:w}));return e(),e()}),[w]),(0,G.D3)(Q._1,(0,i.useCallback)((e=>{const t=(0,K.Mu)(e);a(t)}),[a])),(0,F.jsx)("div",{className:"main",children:(0,F.jsx)(Z.kx.Provider,{value:A,children:(0,F.jsx)("div",{className:"main__pane main__pane_main",children:(0,F.jsx)("div",{className:"main__pane-content",id:"pane-content-iframe",children:(0,F.jsxs)(n.A,{className:"main__pane-layout",hasSider:!0,children:[!R.EW.isPlugin&&(0,F.jsx)(ee,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed"},collapsible:!0,collapsed:!w&&S,defaultCollapsed:!0,reverseArrow:!w&&!S||w&&!S,trigger:(0,F.jsxs)("div",{className:"main__pane-trigger",children:[w?(0,F.jsx)(c.A,{style:{fontSize:18}}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(o.A,{style:{fontSize:18}}),(0,F.jsx)(d.A,{style:{fontSize:18}})]}),(0,F.jsx)(q.A,{})]}),className:p()("main__menu",{main__menu_lock:w}),width:260,onCollapse:(e,t)=>{e?!w&&k(!0):k(!e),N(!w)},onMouseEnter:()=>!w&&k(!1),onMouseLeave:()=>!w&&k(!0),children:(0,F.jsx)(B,{isMenuCollapsed:S,setIsMenuCollapsed:k,isLocked:w})}),(0,F.jsx)(P.A,{isModalVisible:_===R.lx.EDIT_PROJECT_MODAL}),(0,F.jsx)(H.A,{isModalVisible:_===R.lx.EDIT_PROFILE_MODAL}),(0,F.jsx)(r.sv,{})]})})})})})}},24495:(e,t,s)=>{s.d(t,{A:()=>E});var i=s(92810),r=s(76662),n=s(41919),a=s(43005),l=s(71157),o=s(20258),d=s(64617),c=s(12280),m=s(55039),u=s(45934),p=s(23287),h=s(4800),g=s(21349),_=s(8114),v=s(85163);const x=(e,t,s,i,r,n)=>{var a,l;const o=n("Owner","member"),d=n("Administrator","member"),c=r("The invitation has been sent");let m=[];e.role===c?m.push({label:r("Revoke the invite"),key:v.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>i(t,e)}):(e.role!==o&&m.push({label:r("Assign the project owner"),key:v.gY,className:"em-analytics__members-owner",onClick:({key:t})=>i(t,e)}),e.role!==d&&m.push({label:r("Change role to Administrator"),key:v.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>i(t,e)}),e.role===d&&m.push({label:r("Change role to User"),key:v.aO,className:"em-analytics__members-user",onClick:({key:t})=>i(t,e)}),m.push({label:r("Remove member"),key:v.eA,onClick:({key:t})=>i(t,e)}));let u=[];(null===(a=e.ID)||void 0===a?void 0:a.toString())===(null===(l=s.id)||void 0===l?void 0:l.toString())&&u.push({label:r("Change role to User"),key:v.aO,className:"em-analytics__members-user",onClick:({key:t})=>i(t,e)}),e.role===v.m3&&u.push({label:r("Change role to Administrator"),key:v.Qz,className:"em-analytics__members-admin",onClick:({key:t})=>i(t,e)}),e.role===v.G$?u.push({label:r("Revoke the invite"),key:v.JE,className:"em-analytics__revoke-invite",onClick:({key:t})=>i(t,e)}):u.push({label:r("Remove member"),key:v.eA,className:"em-analytics__members-remove",onClick:({key:t})=>{i(t,e)}});let p=[{label:r("Remove member"),key:v.eA,className:"em-analytics__members-remove",onClick:({key:t})=>i(t,e)}];switch(t){case v.yo:return m;case v.St:return u;case v.m3:return p;default:return null}};x.propTypes={};const j=x;var f=s(86286),y=s(84568),A=s(31844),b=s(32269),w=s(70082);const N=()=>{const{__:e,_x:t}=(0,p.s9)(),s=(0,u.d4)(f.C1),{owner:r,admin:n}=(0,A.A)();let a=(0,d.Zp)();const o=(0,l.hN)(),[c,m]=(0,i.useState)(""),x=t("Owner","member"),N=t("Administrator","member"),S=e("user"),k=e("The invitation has been sent");(0,i.useEffect)((()=>{r||n||m(v.m3),r&&m(v.yo),n&&m(v.St)}),[r,n,s]);const{data:I,isFetching:C,refetch:T}=(0,d.KC)(),[E,L]=(0,i.useState)([]);(0,i.useEffect)((()=>{const{owner:s,admins:i,users:r,invited_users:n}=I.members||{};L([s&&{...s,role:t("Owner","member")},i&&Array.isArray(i)&&i.map((e=>({...e,role:t("Administrator","member")}))),r&&Array.isArray(r)&&r.map((t=>({...t,role:e("user")}))),n&&Array.isArray(n)&&n.filter((e=>null===e||void 0===e?void 0:e.invited_user_email)).map((t=>({role:e("The invitation has been sent"),user_email:t.invited_user_email,user_firstname:" ",user_lastname:" "})))].filter((e=>e)).flat(1))}),[I.members,e,t]);const[z,D]=(0,y.OD)(),O=(i,{role:r,...n})=>{var l,d;let c,m={};switch(i){case v.gY:if(r===N){const e=I.members.admins,t=I.members.owner;m={admins:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)),t.ID]:0,owner:n.ID}}if(r===S){const e=I.members.users,t=I.members.owner;m={users:e&&Array.isArray(e)&&e.length>0?[...e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)),t.ID]:0,owner:n.ID}}c=e("You changed the role of ")+n.display_name+t(" to ","member")+e("owner")+".";break;case v.Qz:if(r===S){const s=I.members.users,i=I.members.admins;m={users:s&&Array.isArray(s)&&s.length>1?s.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0,admins:i&&Array.isArray(i)&&i.length>0?[...i.map((e=>e.ID)),n.ID]:[n.ID]},c=e("You changed the role of ")+n.display_name+t(" to ","member")+e("Administrator")+"."}break;case v.aO:if(r===N){const s=I.members.admins,i=I.members.users;m={admins:s&&Array.isArray(s)&&s.length>1?s.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0,users:i&&Array.isArray(i)&&i.length>0?[...i.map((e=>e.ID)),n.ID]:[n.ID]},c=e("You changed the role of ")+n.display_name+t(" to ","member")+e("user")+"."}break;case v.eA:if(r===N){const e=I.members.admins;m={admins:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0}}if(r===S){const e=I.members.users;m={users:e&&Array.isArray(e)&&e.length>1?e.filter((e=>e.ID!==n.ID)).map((e=>e.ID)):0}}c=(null===(l=s.id)||void 0===l?void 0:l.toString())===(null===(d=n.ID)||void 0===d?void 0:d.toString())?e("You deleted yourself from the project successfully."):e("You deleted ")+n.display_name+" "+e(" from the project successfully.");break;case v.JE:const i=I.members.invited_users;m={invited_users:!!(i&&Array.isArray(i)&&i.length>0)&&i.filter((e=>e.invited_user_email&&e.invited_user_email!==n.user_email))},c=e("You revoke invite for ")+n.user_email+" "+e(" from the project successfully.");break;default:return}z({projectId:I.id,members:{...I.members,...m}}).then((e=>{var t,i;if(e.error)return(null===(t=s.id)||void 0===t?void 0:t.toString())===(null===(i=n.ID)||void 0===i?void 0:i.toString())?((0,b.wB)(c,o),void a("/projects")):void(0,b.p6)(e,o);T(),(0,b.wB)(c,o)}))},M=[{width:"25%",title:e("Email"),dataIndex:["user_email"]},{width:"25%",title:e("Name"),dataIndex:["user_firstname"],render:(e,{user_lastname:t})=>(0,w.jsx)(w.Fragment,{children:e||t?`${e} ${t}`:"-"})},{width:"25%",title:e("Role"),dataIndex:["role"],render:(e,t,s)=>e},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(i,a)=>{const l=j(a,c,s,O,e,t);return a.role===x||!r&&!n&&a.role===N||n&&a.role===N&&s.id!==a.ID||!r&&!n&&a.role===S&&s.id!==a.ID||!r&&!n&&a.role===k?null:(0,w.jsx)(h.A,{arrow:"true",placement:"bottomRight",menu:{items:l},trigger:["hover"],children:(0,w.jsx)("span",{className:"members-table__actions",children:(0,w.jsx)(_.A,{})})})}}];return(0,w.jsx)("div",{children:(0,w.jsx)(g.A,{bordered:!0,className:"members-table",rowClassName:e=>e.role===k?"members-table__invite_member_row":"",rowKey:e=>`${e.role}_${e.ID||e.user_email}`,dataSource:E,columns:M,loading:D.isLoading||C,showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomLeft"]}})})};var S=s(20757),k=s(53200),I=s(22197);const{Paragraph:C}=r.A,{Content:T}=n.A,E=()=>{const{__:e}=(0,p.s9)(),t=(0,u.wA)(),{owner:s,admin:r}=(0,A.A)(),[h]=c.A.useForm(),g=(0,l.hN)(),[_,v]=(0,k.N)(),{data:x,refetch:j}=(0,d.KC)();(0,I.A)(e("Members")),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}));const f=(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(C,{className:"ant-page-header-heading-title",children:e("Members")})}),E=(0,w.jsx)(w.Fragment,{children:s||r?[(0,w.jsxs)(c.A,{form:h,name:"search-members-form",initialValues:{remember:!0},onFinish:({email:e})=>{_({email:e,project_id:x.id}).then((e=>{var s,i,r;e.isError?(0,b.p6)(e,g):(null===(s=e.data)||void 0===s||null===(i=s.data)||void 0===i?void 0:i.status)<400?(h.resetFields(),j(),(0,b.wB)(null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.message,g),t(y.Nq.util.invalidateTags([{type:"Projects",id:x.id}]))):g.error({message:(0,w.jsx)("div",{dangerouslySetInnerHTML:{__html:e.data.code}}),description:(0,w.jsx)("div",{dangerouslySetInnerHTML:{__html:e.data.message}}),placement:"bottomRight"})}))},autoComplete:"off",layout:"inline",validateTrigger:"onSubmit",onValuesChange:()=>{h.setFields([{errors:[],name:["email"]}])},className:"members-page__search-form",children:[(0,w.jsx)(c.A.Item,{className:"members-page__search-form-item members-page__search-form-item_input-item",name:"email",rules:[{required:!0,message:e("Please enter the correct email address."),type:"email"}],children:(0,w.jsx)(m.A,{placeholder:e("Email of a new member"),disabled:v.isLoading})}),(0,w.jsx)(c.A.Item,{className:"members-page__search-form-item",children:(0,w.jsx)(a.Ay,{type:"primary",className:"em-analytics__members-add",htmlType:"submit",disabled:v.isLoading,icon:(0,w.jsx)(o.A,{}),children:e("Add a member")})})]},"search-members-form")]:[]});return(0,w.jsxs)(n.A,{className:"members-page",children:[(0,w.jsx)(S.A,{leftBlock:f,rightBlock:E}),(0,w.jsx)(T,{className:"members-page__container",children:(0,w.jsx)("div",{className:"members-page__content container",children:(0,w.jsx)(N,{})})})]})}},92779:(e,t,s)=>{s.d(t,{A:()=>m});var i=s(92810),r=s(14852),n=s(89831),a=s(43005),l=s(23287),o=s(64617),d=s(47381),c=s(70082);const m=({open:e,sideOnOk:t,onCancel:s,initialSlide:m=0})=>{const{__:u}=(0,l.s9)(),p=(0,o.Zp)(),[h,g]=(0,i.useState)(m),_=(0,i.useRef)(null),v=(0,d.u)();(0,i.useEffect)((()=>{e&&_.current&&(_.current.goTo(m,!0),g(m))}),[e,m]);const x=(0,i.useMemo)((()=>[{image:u("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--blue-2)",title:u("More editing functions"),description:u("Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png"),backgroundColor:"var(--purple-2)",title:u("Work with the HTML code"),description:u("Edit the HTML version of your email template in \xabCode\xbb mode and see the changes in real time. Blocks has no restrictions on the code: you can create templates of any complexity!")},{image:u("https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png"),backgroundColor:"var(--cyan-2)",title:u("AI image generation"),description:u("Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.")},{image:u("https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png"),backgroundColor:"var(--green-2)",title:u("Stock photos and GIFs"),description:u("Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.")},{image:u("https://cdn.useblocks.io/1351/241017_18_NDYloAO.png"),backgroundColor:"var(--magenta-2)",title:u("Version history"),description:u("Check who and when made changes to the email template and, if necessary, restore one of the previous versions.")},{image:u("https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png"),backgroundColor:"var(--red-2)",title:u("Image editor"),description:u("Want to resize an image, add some text, or apply a filter? No need to leave Blocks! You can make all the basic changes in our image editor.")},{image:u("https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png"),backgroundColor:"var(--orange-2)",title:u("Email optimization"),description:u("Check your email against broken links, missing alt texts, heavy images, and other obstacles that might prevent your emails from hitting inboxes.")},{image:u("https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png"),backgroundColor:"var(--volcano-2)",title:u("Team collaboration"),description:u("Add your team members and work on your project simultaneously. Attach comments to individual email blocks and discuss necessary edits right in the editor.")},{image:u("https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png"),backgroundColor:"var(--geekblue-2)",title:u("Email testing"),description:u("Check how your email will look like across various devices and email clients.")},{image:u("https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png"),backgroundColor:"var(--geekblue-2)",title:u("AI assistant"),description:u("Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!")}]),[u]);return(0,i.useEffect)((()=>{if(e&&_.current){_.current.goTo(m,!0),g(m);const e=x[m];v({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:e.title})}}),[e,x,m,v]),(0,c.jsxs)(r.A,{open:e,footer:null,onCancel:s,centered:!0,closable:!1,className:"premium-features-modal",classNames:{mask:"premium-features-modal-mask"},styles:{mask:{background:"rgba(0, 0, 0, 0.65)"}},width:1100,style:{maxWidth:"80%"},children:[(0,c.jsx)(n.A,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:h,ref:_,children:x.map(((e,t)=>(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:"carousel-slide",style:{background:`${e.backgroundColor}`},children:[(0,c.jsx)("div",{className:"slide-item-image",children:(0,c.jsx)("img",{src:e.image,alt:`slide-${t}`})}),(0,c.jsxs)("div",{className:"slide-item-content",children:[(0,c.jsx)("h3",{className:"slide-title",children:e.title}),(0,c.jsx)("p",{className:"slide-description",children:e.description})]})]})},t)))}),(0,c.jsx)("div",{className:"modal-subtitle",children:u("This and other features are available for you on any paid billing plan.")}),(0,c.jsxs)("div",{className:"modal-buttons",children:[(0,c.jsx)(a.Ay,{size:"large",onClick:()=>s(!1),children:u("Cancel")}),(0,c.jsx)(a.Ay,{type:"primary",size:"large",onClick:()=>{t&&t(),p("/billing"),s(!1)},style:{padding:"0 30px"},children:u("Select plan")})]})]})}},84e3:(e,t,s)=>{s.d(t,{A:()=>S});var i=s(92810),r=s(71503),n=s(45934),a=s(887),l=s(45695),o=s(44396),d=s(86286),c=s(65983),m=s(7760),u=s(53204),p=s(64037),h=s(60382),g=s(85163),_=s(8685),v=s(32411),x=s(56991),j=s(93982),f=s(13522),y=s(19911),A=s(79716),b=s(19493),w=s(24293),N=s(70082);h.languages.html.htmlDefaults.options.format.wrapLineLength=0,r.wG.config({monaco:h}),(0,o.Q)(),(0,_.Gr)(h),(0,_.Wz)(h,["html"]);const S=({email:e,readOnly:t,setOtherUsers:s})=>{const o=(0,v.fn)(),_=(0,j.ml)(f.A.ON_CODE_VALIDATE_ID),S=(0,l.XW)(),k=(0,n.d4)(c.Up),I=(0,n.d4)(m.Up),C=(0,n.d4)(c.VZ),T=null!==e&&void 0!==e&&e.hasOwnProperty("type")?I:k,E=(0,n.d4)(d.hZ),L=(0,n.wA)(),z=(0,i.useRef)(null),D=(0,i.useRef)(null),O=(0,i.useRef)(null),M=(0,i.useRef)([]),R=(0,x.rD)(),F=(0,i.useCallback)((()=>{L((0,d.ku)(!1))}),[L]),[B,P]=(0,i.useState)(!1),[,H,q]=(0,y.useCollaborateEditor)({emailId:null===e||void 0===e?void 0:e.id,editorRef:D,setIsSpin:P});M.current=H,(0,i.useEffect)((()=>{t||s(M.current)}),[null===H||void 0===H?void 0:H.length,s]),(0,i.useEffect)((()=>F()),[F]),(0,i.useEffect)((()=>{if(C){const{current:e}=z;e&&(e.revealRangeInCenterIfOutsideViewport(C),e.setSelection(C))}}),[C]);(0,i.useEffect)((()=>{matchMedia(g.F3).addEventListener("change",(t=>{const s=window.localStorage.getItem(g.V0.em_color_scheme),i=t.matches?g.nd:g.T;e.hasOwnProperty("type")?L(s?(0,m.eX)(s===g.nd?`vs-${s}`:g.T):(0,m.eX)(i===g.nd?`vs-${i}`:g.T)):L(s?(0,c.eX)(s===g.nd?`vs-${s}`:g.T):(0,c.eX)(i===g.nd?`vs-${i}`:g.T))}))}),[L,e]),(0,i.useEffect)((()=>{const t=window.localStorage.getItem(g.V0.em_color_scheme),s=matchMedia(g.F3).matches?g.nd:g.T;null!==e&&void 0!==e&&e.hasOwnProperty("type")?L(t?(0,m.eX)(t===g.nd?`vs-${t}`:g.T):(0,m.eX)(s===g.nd?`vs-${s}`:g.T)):L(t?(0,c.eX)(t===g.nd?`vs-${t}`:g.T):(0,c.eX)(s===g.nd?`vs-${s}`:g.T))}),[L,e]);(0,p.A)((e=>{const t=e.data.operation,s=e.data;O.current=t,t===g.Ru.UPDATE_EDITOR_POSITION_FROM_IFRAME&&(e=>{const{current:t}=z;if(t&&!t.hasTextFocus()){const s=t.getModel(),i=s.getPositionAt(e.start),r=s.getPositionAt(e.end),n={startColumn:i.column,startLineNumber:i.lineNumber,endColumn:r.column,endLineNumber:r.lineNumber};t.revealRangeInCenterIfOutsideViewport(n),t.setSelection(n)}})(s.data)}));const $=(0,i.useMemo)((()=>document.createElement("div")),[]),V=(0,i.useMemo)((()=>({...E,domReadOnly:t,readOnly:t,unusualLineTerminators:"off",mouseWheelZoom:!0,wordWrap:R.onlyCodeModeInMobile?"off":E.wordWrap,ariaContainerElement:$})),[E,R.onlyCodeModeInMobile,t,$]);return(null===o||void 0===o?void 0:o.uri)&&(0,N.jsxs)(N.Fragment,{children:[B&&(0,N.jsx)(b.A,{className:"monaco-editor__spin",children:(0,N.jsx)(w.A,{indicator:(0,N.jsx)(A.A,{spin:!0,rev:void 0,style:{fontSize:48}})})}),(0,N.jsx)(r.Ay,{theme:T,className:"monaco-editor",defaultLanguage:"html",onMount:(e,t)=>{z.current=e,D.current=e;const s=e.getContribution("editor.linkDetector").openerService,i=s.open.bind(s),r=document.createElement("div"),n=new a.Ay(e,h,{"doctype-html5":!1,"html-lang-require":!1,"head-script-disabled":!1,"style-disabled":!1,"script-disabled":!1,"attr-lowercase":!1,"attr-value-single-quotes":!1,"attr-value-not-empty":!1,"attr-sorted":!1,"attr-whitespace":!1,"input-requires-label":!1,"tag-self-close":!1,"tagname-lowercase":!1,"href-abs-or-rel":!1,"inline-style-disabled":!1,"space-tab-mixed-disabled":!1,"attr-no-unnecessary-whitespace":!0,"tags-check":{img:{selfclosing:!1,attrsRequired:["src","alt"]},a:{selfclosing:!1,attrsRequired:["href"]}},"empty-tag-not-self-closed":!1,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0,"alt-require":!0,"inline-script-disabled":!0,"id-class-value":!1,"id-class-ad-disabled":!0,"attr-unsafe-chars":!0,csslint:{"display-property-grouping":!0,"known-properties":!0}});g._P.isEditor&&D.current&&q(D.current),n.watch(),e.getContribution("editor.linkDetector").openerService.open=e=>(r.innerHTML=e,i(r.textContent)),L((0,d.ku)(!0)),e.onMouseUp((()=>{const t=e.getSelection();t.startColumn===t.endColumn&&t.startLineNumber===t.endLineNumber&&(async e=>{const{current:t}=z;if(t){const s=t.getModel();S({operation:g.Ru.UPDATE_EDITOR_POSITION_FROM_EDITOR,data:s.getOffsetAt(e)})}})(e.getPosition())})),e.onDidBlurEditorWidget((()=>{S({operation:g.Ru.EDITOR_CHANGE_FOCUS,data:!1}),L((0,u.YT)(!1))})),e.onDidFocusEditorWidget((()=>{S({operation:g.Ru.EDITOR_CHANGE_FOCUS,data:!0}),L((0,u.YT)(!0))}))},options:V,keepCurrentModel:!0,path:o.uri.toString(),onValidate:function(e){var t;"Doctype must be declared first."!==(null===(t=e[0])||void 0===t?void 0:t.message)&&(g.EW.isPlugin&&_.fire(e),L((0,c.Bj)(e)))}})]})}},21999:(e,t,s)=>{s.d(t,{A:()=>n});s(92810);var i=s(64617),r=s(70082);const n=({lastProjectId:e})=>{const{pathname:t,search:s}=(0,i.zy)();return!1===e?(0,r.jsx)(i.C5,{to:"/projects"}):e&&(0,r.jsx)(i.C5,{to:`/projects/${e+t+s}`})}},32983:(e,t,s)=>{s.d(t,{A:()=>n});s(92810);var i=s(64617),r=s(70082);const n=({to:e})=>(0,r.jsx)(i.C5,{to:e})},24239:(e,t,s)=>{s.d(t,{A:()=>m});s(92810);var i=s(41919),r=s(25072),n=s(43005),a=s(64617),l=s(23287),o=s(32269),d=s(70082);const{Content:c}=i.A,m=()=>{const{__:e}=(0,l.s9)();let t=(0,a.Zp)();return(0,d.jsx)(i.A,{children:(0,d.jsx)(c,{className:"container",children:(0,d.jsx)(r.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:(0,d.jsx)(n.Ay,{type:"primary",onClick:()=>(0,o.XZ)(t,"/projects"),children:e("Back Home")})})})})}},26201:(e,t,s)=>{s.d(t,{A:()=>Y});var i=s(92810),r=s(45934),n=s(64617),a=s(94822),l=s(76662),o=s(81e3),d=s(66522),c=s(43005),m=s(71086),u=s(2018),p=s(7744),h=s(29234),g=s(57806),_=s(67661),v=s(66726),x=s(31022),j=s(3329),f=s(13932),y=s(69825),A=s(58133),b=s(38883),w=s.n(b),N=s(88528),S=s(65983),k=s(84568),I=s(32269),C=s(71157),T=s(45695),E=s(23287),L=s(32411),z=s(56991),D=s(85163),O=s(70082);const{Text:M,Link:R,Title:F}=l.A,B="Links",P="Images",H="Spam assassin",q="Problems",$="valid",V="warnings",W="errors",U=[$,W,V],X=({summary:e,__:t,selectedTags:s,setSelectedTags:i})=>(0,O.jsx)(F,{level:5,style:{margin:0,fontSize:"14px"},children:(0,O.jsx)(o.A,{style:{flexWrap:"wrap"},gap:"6",children:U.map(((r,n)=>(0,O.jsxs)(d.A.CheckableTag,{checked:null===s||void 0===s?void 0:s.includes(r),onChange:e=>((e,t)=>{const r=t?2===s.length?[]:[...s,e]:s.filter((t=>t!==e));i(r)})(r,e),className:w()(`${r} optimise__button`,{[`${r}_active`]:s.includes(r)}),children:[t(r===$?"Valid":r===V?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[r])||0]},r+n)))})}),Y=()=>{var e,t,s,l,o;const{__:d,_n:b}=(0,E.s9)(),U=(0,r.wA)(),{emailId:Y,projectId:Z}=(0,n.g)(),J=(0,C.hN)(),G=(0,T.QC)(),K=(0,L.fn)(),Q=(0,r.d4)(S.rd),ee=(0,z.rD)(),[te,se]=(0,N.ku)(),[ie,re]=(0,N.Ju)(),[ne,ae]=(0,N.Sr)(),{data:le,isSuccess:oe,refetch:de}=(0,k.fo)(+Z,{skip:!!D.EW.isPlugin||!+Z}),{limits:ce}=le&&!D.EW.isPlugin?le:{limits:{optimization_limit:0}},{optimization_limit:me}=ce,ue=me>0,[pe,he]=(0,i.useState)([]),[ge,_e]=(0,i.useState)([]),[ve,xe]=(0,i.useState)([]),[je,fe]=(0,i.useState)([]),[ye,Ae]=(0,i.useState)([]),[be,we]=(0,i.useState)([]),[Ne,Se]=(0,i.useState)(),[ke,Ie]=(0,i.useState)(0);(0,i.useEffect)((()=>{var e;oe&&(null===le||void 0===le||null===(e=le.counters)||void 0===e?void 0:e.optimization_counter)&&Ie(le.counters.optimization_counter)}),[oe,le]),(0,i.useEffect)((()=>{var e,t;Ne===B&&pe.links&&Ae(je.length>0?null===(e=pe.links)||void 0===e?void 0:e.filter((e=>je.includes(e.status))):pe.links);Ne===P&&ge.images&&we(je.length>0?null===(t=ge.images)||void 0===t?void 0:t.filter((e=>je.includes(e.status))):ge.images)}),[pe.links,ge.images,je,Ne]);const Ce=()=>{if(!Y)return void J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;const t=K.getValue(),s=(new DOMParser).parseFromString(t,"text/html"),i={},r={};s.querySelectorAll("a[href]").forEach(((e,t)=>{i[`link_${t}`]=e.getAttribute("href"),r[`link_${t}`]=e.innerText})),G.send({operation:"sandbox_set_attr_to_links"}),te({entity_id:Y,data:i}).then((({data:t,error:s})=>{if(s)(0,I.p6)({error:s},J);else if(null!==t&&void 0!==t&&t.result){let s=[...t.result];null===s||void 0===s||s.sort(((e,t)=>e.linkId-t.linkId));const i=e=>{var t,s,i,r;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(s=e.page)||void 0===s?void 0:s.secure)||void 0===t||t):"invalid"!==e.type)?$:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(i=null===(r=e.page)||void 0===r?void 0:r.secure)||void 0===i||i))&&"invalid"!==e.type?V:W};e={links:s.map((e=>({...e,text:r[e.linkId],status:i(e)}))),summary:{valid:s.filter((e=>i(e)===$)).length||0,warnings:s.filter((e=>i(e)===V)).length||0,errors:s.filter((e=>i(e)===W)).length||0}},he(e),(0,I.wB)(d("Links validation was successfully completed"),J),!D.EW.isPlugin&&de()}else t.statusCode>300||!t.success?(0,I.p6)({error:{data:t}},J):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!pe.links&&Le("")})).catch((e=>{(0,I.p6)({error:e},J)}))},Te=()=>{if(!Y)return void J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});const e=K.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let s={};t.querySelectorAll("img").forEach(((e,t)=>s[`image_${t}`]=e.src)),G.send({operation:"sandbox_set_attr_to_images"}),ie({entity_id:Y,data:s}).then((({data:e,error:t})=>{let s;if(t)(0,I.p6)({error:t},J);else if(null!==e&&void 0!==e&&e.result){let t=Object.values(e.result);t.sort(((e,t)=>e.imageId-t.imageId));let i=t.reduce(((e,t)=>e+Math.round(t.image.bytes/1024)),0);const r=e=>null!==e.statusCode&&e.statusCode<300?$:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?V:W;s={images:t.map((e=>({...e,status:r(e)})))||[],summary:{valid:t.filter((e=>r(e)===$)).length||0,warnings:t.filter((e=>r(e)===V)).length||0,errors:t.filter((e=>r(e)===W)).length||0},summaryTime:{value:(i>1200?i/1e3:i).toFixed(1),name:d(i>1200?"MB":"KB")}},s&&_e(s),(0,I.wB)(d("Images validation was successfully completed"),J),!D.EW.isPlugin&&de()}else{var i;e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},J):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===ge||void 0===ge||null===(i=ge.images)||void 0===i||!i.length)&&Le("")}})).catch((e=>{(0,I.p6)({error:e},J)}))},Ee=()=>{Y?ne({entity_id:Y,data:{html:K.getValue()}}).then((({data:e,error:t})=>{if(t)(0,I.p6)({error:t},J);else if(e&&e.success){const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort(((e,t)=>e.score-t.score)),xe({...e.result,report:t})),(0,I.wB)(d("Spam validation was successfully completed"),J),!D.EW.isPlugin&&de()}else e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},J):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}}),placement:"bottomRight"}),(null===ve||void 0===ve||!ve.length)&&Le("")})).catch((e=>{(0,I.p6)({error:e},J)})):J.error({message:(0,O.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},Le=e=>{Se(e!==Ne?e:""),fe([])};let ze=null;return(0,i.useEffect)((()=>{ue&&ke>=+me&&J.error({message:d("The usage limit has been exceeded"),description:d("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[ke,me,d,J,ue]),(0,O.jsxs)("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize",children:[(0,O.jsxs)("div",{className:"optimise__couter-wrapper",children:[!D.EW.isPlugin&&(0,O.jsx)(c.Ay,{className:w()("optimise__counter-bar",{"optimise__counter-bar_full":ue&&ke>=+me}),size:"small",children:ke+" "+d("of")+" "+(ue?me:"\u221e")+" "+b("test","tests",me)+" "+d(" were used")}),ue&&(0,O.jsx)(a.N_,{style:{fontSize:14,textDecoration:"underline"},to:"/billing",children:d("Need more?")})]}),ee.optimizeLinksEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("Links validation")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Le(B),null!==pe&&void 0!==pe&&null!==(e=pe.links)&&void 0!==e&&e.length||Ne===B||Ce()},loading:se.isLoading,children:!se.isLoading&&(Ne===B?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{}))})})]}),Ne===B&&!(null===pe||void 0===pe||!pe.links)&&(0===(null===pe||void 0===pe||null===(e=pe.links)||void 0===e?void 0:e.length)?(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(h.A,{message:d("No links found."),type:"info"})}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(u.A,{style:{marginBottom:14},children:(0,O.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,O.jsx)(X,{__:d,summary:pe.summary,setSelectedTags:fe,selectedTags:je}),(0,O.jsx)(c.Ay,{loading:se.isLoading,onClick:Ce,icon:(0,O.jsx)(f.A,{}),children:d("Refresh")})]})}),(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{itemLayout:"horizontal",dataSource:ye,renderItem:(e,t)=>{var s;return(0,O.jsx)(g.A.Item,{style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{avatar:e.status===$?(0,O.jsx)(y.A,{className:$}):e.status===V?(0,O.jsx)(y.A,{className:V}):(0,O.jsx)(A.A,{className:W}),title:(0,O.jsx)(R,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,s=600>e.statusCode>399||!e.statusCode,void G.send({operation:D.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:s}});var t,s},children:""===e.url?d("empty link"):e.url}),description:(0,O.jsxs)(O.Fragment,{children:[!(null===(s=e.text)||void 0===s||!s.length)&&(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(M,{type:"secondary",children:e.text})}),e.page.title&&e.page.title,e.page.secure&&e.status===$&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,O.jsx)("span",{className:$,children:d("secure")})]}),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,O.jsx)(M,{type:"secondary",children:d("Failed to load")})]})]})})},t+"_"+e.id)}})})})]}))]}),ee.optimizeImagesEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("Images validation")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Le(P),null!==ge&&void 0!==ge&&null!==(e=ge.images)&&void 0!==e&&e.length||Ne===P||Te()},loading:re.isLoading,children:!re.isLoading&&(Ne===P?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{}))})})]}),Ne===P&&!(null===ge||void 0===ge||!ge.images)&&(0===(null===ge||void 0===ge||null===(t=ge.images)||void 0===t?void 0:t.length)?(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(h.A,{message:d("No images found."),type:"info"})}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(u.A,{style:{marginBottom:16},children:(0,O.jsx)(h.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:(0,O.jsxs)("div",{className:"optimise__summary",children:[(0,O.jsxs)("div",{children:[(0,O.jsxs)(F,{level:4,style:{marginBottom:"0"},children:[ge.images.length," "]}),(0,O.jsx)("span",{style:{fontSize:"12px"},children:d("images")})]}),(0,O.jsxs)("div",{children:[(0,O.jsxs)(F,{level:4,style:{marginBottom:"0"},children:[null===(s=ge.summaryTime)||void 0===s?void 0:s.value,null===(l=ge.summaryTime)||void 0===l?void 0:l.name]}),(0,O.jsx)("span",{style:{fontSize:"12px"},children:d("total size")})]}),(0,O.jsxs)("div",{children:[(0,O.jsx)(F,{level:4,style:{marginBottom:"0"},children:(Math.max(...ge.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+d("s")}),(0,O.jsx)("span",{style:{fontSize:"12px"},children:d("time to load")})]})]}),type:"warning"})}),(0,O.jsx)(u.A,{style:{marginBottom:12},children:(0,O.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,O.jsx)(X,{__:d,summary:ge.summary,setSelectedTags:fe,selectedTags:je}),(0,O.jsx)(c.Ay,{loading:re.isLoading,onClick:()=>Te(),icon:(0,O.jsx)(f.A,{}),children:d("Refresh")})]})}),(0,O.jsx)(u.A,{style:{marginBottom:12},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:be,renderItem:(e,t)=>(0,O.jsx)(g.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{className:w()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:(0,O.jsx)(_.A,{className:w()("image-item__image",{"image-item__image_fail":!e.resolvedUrl||!e.valid}),width:92,height:"auto",style:{height:"auto"},src:e.resolvedUrl||"",preview:!1,onMouseEnter:()=>{var t;return((e,t)=>{clearTimeout(ze);let s=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,i=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(s=document.createElement("div"),s.classList.add("img-preview"),i=document.createElement("div"),i.classList.add("img-preview-content"),s.append(i),document.querySelector(".email-pane__col_settings-inner").append(s)),i.innerHTML=`<table cellspacing="0" cellpadding="0" border="0" width="100%"><img height="auto" width=${t+"px"} alt="" style="max-width: 100%; object-fit: contain" src=${e}></table>`,"1"!==s.style.opacity&&setTimeout((function(){s.style.opacity="1",s.style.transform="translateX(-100%)"}),10)})(e.url,null===(t=e.image.dimensions)||void 0===t?void 0:t.width)},onMouseLeave:()=>(()=>{let e=document.querySelector(".img-preview");e&&(ze=setTimeout((()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout((function(){e.remove()}),300)}),300))})()}),title:e.url?(0,O.jsx)(v.A,{placement:"top",title:e.message,children:(0,O.jsx)(R,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,s=600>e.statusCode>399||!e.statusCode,void G.send({operation:D.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:s}});var t,s},children:""===(null===e||void 0===e?void 0:e.url)?d("empty src"):e.url})}):e.message,description:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:"image-size",children:[e.image.dimensions&&(0,O.jsxs)(O.Fragment,{children:[e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsxs)("span",{children:[Math.round(e.image.bytes/1024),d("kB")]}),(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsxs)("span",{children:[e.image.responseTime,d("ms")]}),(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsx)("span",{className:"image-size-format",children:e.image.contentType})]}),e.image.secure&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,O.jsx)("span",{className:$,children:d("secure")})]}),e.resolvedUrl&&!e.valid&&(0,O.jsx)(M,{type:"danger",children:d("not valid")})]})," ",!e.resolvedUrl&&!e.statusCode&&(0,O.jsx)(M,{type:"danger",children:d("Failed to load")})]})})},t)})})})]}))]}),ee.optimizeSpamAssassinEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("SpamAssassin")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:ae.isLoading,onClick:()=>{var e;Le(H),null!==(e=ve.report)&&void 0!==e&&e.length||Ee()},children:!ae.isLoading&&(Ne===H?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{}))})})]}),Ne===H&&!(null===(o=ve.report)||void 0===o||!o.length)&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(u.A,{style:{marginBottom:8},children:[(0,O.jsxs)("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam",children:[(0,O.jsxs)(F,{level:1,style:{margin:0},type:ve.spamScore<2||!ve.spamScore||ve.spamScore<=ve.baseSpamScore-1?"success":ve.spamScore<ve.baseSpamScore-1?"warning":"danger",children:[(0,O.jsx)("span",{style:{marginRight:"12px"},children:ve.spamScore||0}),(0,O.jsx)(M,{style:{marginRight:"12px",fontSize:"20px"},children:"Score"})]}),(0,O.jsx)(c.Ay,{icon:(0,O.jsx)(f.A,{}),loading:ae.isLoading,onClick:Ee,children:d("Refresh")})]}),ve.spamScore>ve.baseSpamScore-1&&(0,O.jsx)(M,{children:d("Lower scores are better. Aim for a score less than ")+(ve.baseSpamScore-1)+"."})]}),(0,O.jsx)(u.A,{style:{marginBottom:8},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{itemLayout:"horizontal",dataSource:ve.report,renderItem:e=>(0,O.jsx)(g.A.Item,{style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{title:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(M,{style:{fontSize:"20px"},children:e.score}),(0,O.jsx)("span",{style:{marginLeft:"12px"},children:e.description})]})})})})})})]})]}),ee.optimizeCheckCodeEnabled&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,O.jsxs)(u.A,{gutter:10,align:"middle",children:[(0,O.jsx)(p.A,{span:20,children:(0,O.jsx)("div",{className:"form-group-title",children:d("Source code validation")})}),(0,O.jsx)(p.A,{span:4,align:"right",children:(0,O.jsx)(c.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>Le(q),children:Ne===q?(0,O.jsx)(x.A,{}):(0,O.jsx)(j.A,{})})})]}),Ne===q&&(0,O.jsx)(O.Fragment,{children:null!==Q&&void 0!==Q&&Q.length?(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(u.A,{style:{marginBottom:8},children:(0,O.jsx)(p.A,{span:24,children:(0,O.jsx)(g.A,{itemLayout:"horizontal",dataSource:Q,renderItem:e=>(0,O.jsx)(g.A.Item,{style:{border:"none"},children:(0,O.jsx)(g.A.Item.Meta,{avatar:e.severity<6?(0,O.jsx)(A.A,{className:V}):(0,O.jsx)(A.A,{className:W}),title:(0,O.jsx)(O.Fragment,{children:(0,O.jsxs)(M,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};U((0,S.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error",children:["Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber]})}),description:(0,O.jsx)(M,{children:e.message})})})})})})}):(0,O.jsx)(u.A,{style:{marginBottom:24},children:(0,O.jsx)(h.A,{message:d("No problems found."),type:"info"})})})]})]})}},72981:(e,t,s)=>{s.d(t,{A:()=>l});s(92810);var i=s(81e3),r=s(24293),n=s(79716),a=s(70082);const l=({small:e=!1,style:t,wrap:s=!1})=>{const l={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},o=(0,a.jsx)(n.A,{style:{fontSize:48},spin:!0});return(0,a.jsx)(i.A,{size:"large",style:l,wrap:s,children:(0,a.jsx)(r.A,{indicator:o})})}},53765:(e,t,s)=>{s.d(t,{A:()=>te});var i=s(92810),r=s(64617),n=s(29218),a=s(76662),l=s(66726),o=s(29234),d=s(81e3),c=s(43005),m=s(2018),u=s(7744),p=s(86889),h=s(73035),g=s(85677),_=s(38587),v=s(45934),x=s(23287),j=s(38883),f=s.n(j),y=s(84e3),A=s(79060),b=s(4800),w=s(79304),N=s(94822),S=s(8375),k=s(32293),I=s(35285),C=s(64936),T=s(36404),E=s(85163),L=s(70082);const z=({title:e})=>{const{__:t}=(0,x.s9)();let s=(0,v.wA)();const{projectId:n}=(0,r.g)(),a=(0,v.d4)(C.cL),l=(0,v.d4)(T.yN);let o=[{label:t("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:(0,L.jsx)(S.A,{style:{fontSize:"16px"}}),onClick:()=>{s((0,C.qf)(E.lx.EDIT_PROJECT_MODAL))}},{label:(0,L.jsx)(N.N_,{to:"/projects",children:t("List of projects")}),key:"List of projects",icon:(0,L.jsx)(k.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}];const d=(null===l||void 0===l?void 0:l.title)||e;return(0,i.useEffect)((()=>{if(n){const e=document.querySelector(".header__project");null===e||void 0===e||e.setAttribute("data-project-id",n)}}),[n]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b.A,{menu:{items:o},arrow:"true",overlayStyle:{minWidth:0},getPopupContainer:()=>document.querySelector("header"),children:(0,L.jsxs)(N.N_,{to:"/projects/"+n+"/emails?page=1",className:"header__project",children:[(0,L.jsxs)(w.A,{size:28,style:{backgroundColor:"#777",marginRight:8,fontWeight:700,fontSize:18,textTransform:"uppercase"},children:[null===d||void 0===d?void 0:d[0],null!==d&&void 0!==d&&d.split(" ")[1]?d.split(" ")[1][0]:""]}),d]})}),(0,L.jsx)(I.A,{isModalVisible:a===E.lx.EDIT_PROJECT_MODAL})]})};var D=s(97562),O=s(57918),M=s(47358),R=s(7760),F=s(8493),B=s(64037),P=s(18777),H=s(86739),q=s(32269),$=s(45695),V=s(69106);const W=[50,50],U=[420,420],X=[45,10,45],Y=[0,100,0],Z=[50,420,50],J="all 0.5s ease 0s",{Paragraph:G}=a.A,K="code",Q="view",ee=({email:e,viewMode:t="view",isLoggedIn:s})=>{const{__:a,_x:j}=(0,x.s9)(),b=(0,v.wA)(),w=(0,v.d4)(M.Fv),{emailId:N,blockId:S}=(0,r.g)(),k=(0,$.QC)(),[I,C]=(0,i.useState)(t),[T,ee]=(0,i.useState)(I===Q?Y:W),[te,se]=(0,i.useState)(I===Q?Z:U),[ie,re]=(0,i.useState)([]),[ne,ae]=(0,i.useState)(!1),[le,oe]=(0,i.useState)(!1),de=(0,i.useRef)(null),ce=(0,i.useRef)(),me=(0,i.useRef)(),ue=(0,i.useRef)(),pe=N||S,{data:he=[],refetch:ge}=(0,P.Cf)(pe);(0,i.useEffect)((()=>{pe&&ge(pe)}),[I,pe,ge]),(0,V.f)(e);(0,B.A)((e=>{const t=e.data.operation,s=document.querySelector(".preview-mode__pane_editor")?document.getElementById("pane-content-iframe"):document.querySelector(".preview-mode__row > .preview-mode__col_preview");t===E.Ru.APPLICATION_SCROLL_TO&&setTimeout((()=>{s.scrollTo({top:e.data.settings.value,behavior:"smooth"})}),100),t===E.Ru.APPLICATION_IFRAME_SET_HEIGHT&&(document.querySelector(".preview-mode__iframe").style.height=e.data.settings.height+"px")}));const _e=e=>{e.target.classList.contains("preview-mode__resizer")&&(ce.current&&(ce.current.style.transition="none"),me.current&&(me.current.style.transition="none"),ue.current&&(ue.current.style.transition="none"))},ve=()=>{const e=I===Q?J:"none";ce.current.style.transition!==J&&(ce.current&&(ce.current.style.transition=e),me.current&&(me.current.style.transition=e),ue.current&&(ue.current.style.transition=e))};(0,i.useEffect)((()=>(document.addEventListener("mousedown",_e),document.addEventListener("mouseup",ve),()=>{document.removeEventListener("mousedown",_e),document.removeEventListener("mouseup",ve)}))),(0,i.useEffect)((()=>{const e=k.onInit((()=>{k.send({operation:E.Ru.SANDBOX_LOCK_EDIT,data:t===Q}),k.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:ne})}));return()=>e.dispose()}),[t,I,ne,k]),(0,i.useEffect)((()=>{ee(I===Q?Y:W),se(I===Q?Z:U)}),[I]);const xe=({key:e,domEvent:t})=>{switch(t.preventDefault(),ce.current.style.transition=J,me.current.style.transition=J,ue.current.style.transition=J,de.current.resize(),e){case"Desktop":default:ee(I===Q?Y:W);break;case"Mobile":ee(X)}setTimeout((()=>{k.send({operation:E.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:ce.current.getBoundingClientRect().width}}),de.current.resize()}),550)};(0,i.useEffect)((()=>{const e=new q.jG;if(ie.length<2){var t,s;const i=null===(t=ce.current)||void 0===t?void 0:t.getBoundingClientRect(),r=null===(s=document.getElementById("pane-content-iframe"))||void 0===s?void 0:s.getBoundingClientRect(),n=setInterval(l,50);re((e=>[...e,n]));const a=t=>{e.addDisposable(k.onInit((()=>{k.send({operation:E.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:t})})))};function l(){a({iframeOffsetTop:i.top-r.top,scrollTop:r.top?-r.top:0,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,mode:K})}}return e.addDispose((()=>clearInterval(ie[ie.length-1]))),()=>e.dispose()}),[ie,k]),(0,i.useEffect)((()=>{if(I===K){const e=window.localStorage.getItem(E.V0.em_code_mode_pane_sizes);e&&ee(JSON.parse(e))}}),[I]);const je=e=>{if(I===K&&window.localStorage.setItem(E.V0.em_code_mode_pane_sizes,JSON.stringify(e)),I===Q){const t=(e[2]+e[0])/2;ee([t,e[1],t])}else ee(e);k.send({operation:E.Ru.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:ce.current.getBoundingClientRect().width}}),de.current.resize()},fe=()=>{de.current.resize()},ye=(0,i.useCallback)((()=>{e.hasOwnProperty("type")?b((0,R.vs)()):b((0,M.vs)())}),[b,e]);let Ae;const be=()=>{var e,t;const s=null===(e=ce.current)||void 0===e?void 0:e.getBoundingClientRect(),i=null===(t=document.getElementById("pane-content-iframe"))||void 0===t?void 0:t.getBoundingClientRect();Ae&&window.clearTimeout(Ae),Ae=window.setTimeout((function(){k.send({operation:E.Ru.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:s.top-i.top,scrollTop:document.getElementById("pane-content-iframe").scrollTop,innerHeight:window.innerHeight,previewHeight:document.querySelector(".preview-mode__pane-content").getBoundingClientRect().height,CODE:K}})}),100)};(0,i.useEffect)((()=>(document.addEventListener("scroll",be,!0),()=>{document.removeEventListener("scroll",be,!0)})));const we=()=>{ae((e=>!e)),k.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:!ne})},Ne=()=>{C(le?Q:K),oe((e=>!e))};let Se=[{key:E.yI,children:(0,L.jsx)("div",{className:"preview-mode__collapse-wrapper"})},{label:(0,L.jsxs)(l.A,{placement:"right",title:j("Discuss","tab"),children:[(0,L.jsx)(h.A,{}),!!he.length&&(0,L.jsx)("span",{className:"email-pane__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]}),key:E.hc,className:"preview-mode__tab-discuss em-analytics__email-tab-discuss",style:{overflow:"hidden"},children:(0,L.jsx)("div",{className:"email-pane__collapse-wrapper",children:pe?(0,L.jsx)("div",{className:"ant-tabs-content discuss-wrapper",children:(0,L.jsx)(D.A,{email:e,comments:he,subjectId:pe,isLoggedIn:!0})}):(0,L.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,L.jsx)(o.A,{description:a("Save the block before commenting."),type:"info",showIcon:!0}):(0,L.jsx)(o.A,{description:a("Save the email before commenting."),type:"info",showIcon:!0})})})}];return(0,L.jsxs)("div",{className:f()("preview-mode",{"preview-mode_view":I===Q}),children:[(0,L.jsx)("div",{style:{display:"none"},children:(0,L.jsx)(y.A,{email:e,readOnly:t===Q})}),(0,L.jsxs)("div",{className:"preview-mode__header",children:[(0,L.jsxs)("div",{className:"preview-mode__header__title",children:[(0,L.jsx)(z,{style:{float:"left",cursor:"none"},title:null===e||void 0===e?void 0:e.project_title}),(0,L.jsx)(G,{editable:w&&{icon:(0,L.jsx)(g.A,{className:"email-page-header__icon-edit"}),onChange:t=>{e.isNew?b((0,F.BQ)(t)):b(H.GY.util.updateQueryData("getEmail",e.id,(e=>{Object.assign(e,{title:t})})))}},children:null===e.title?a("New email title"):e.title})]}),(0,L.jsx)("div",{children:(0,L.jsx)("div",{className:"preview-mode__buttons",children:(0,L.jsx)(d.A,{size:10,children:(s||w)&&(0,L.jsx)(l.A,{placement:"bottom",title:a("Close"),children:(0,L.jsx)(c.Ay,{className:"preview-mode__close-btn",onClick:w?ye:()=>{window.close(),window.location.href="/"},children:(0,L.jsx)(_.A,{})})})})})})]}),t!==K&&(0,L.jsx)("div",{className:"preview-mode__wrapper",children:(0,L.jsxs)(m.A,{className:"preview-mode__row",children:[(0,L.jsx)(u.A,{xl:{span:ne?6:0},lg:{span:ne?6:0},md:{span:ne?10:0},sm:{span:0},xs:{span:0},className:f()("preview-mode__col preview-mode__col_settings comment-block",{"preview-mode__col_settings-collapsed":!ne,"preview-mode__col_code-mode":I===K}),children:ne&&(0,L.jsx)(p.A,{className:"preview-mode__col_settings-inner",size:"middle",animated:{inkBar:!1,tabPane:!0},activeKey:E.hc,onTabClick:we,renderTabBar:(e,t)=>(0,L.jsx)(t,{className:"preview-mode__tab-bar",...e}),tabPosition:"left",items:Se})}),I===K&&(0,L.jsxs)(u.A,{xl:{span:ne?18:24},lg:{span:ne?18:24},md:{span:ne?14:24},sm:{span:24},xs:{span:24},className:f()("preview-mode__col preview-mode__col_preview preview-mode__code-mode",{"preview-mode__col_preview-collapsed":!ne}),children:[!ne&&(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu",children:(0,L.jsx)("div",{className:"preview-mode__comments-icon-wrapper",onClick:we,children:(0,L.jsxs)(l.A,{placement:"right",title:j("Discuss","tab"),children:[(0,L.jsx)(h.A,{style:{fontSize:"20px"}}),!!he.length&&(0,L.jsx)("span",{className:"preview-mode__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]})})}),(0,L.jsxs)(n.A,{className:"preview-mode__panes",direction:"horizontal",gutterSize:0,snapOffset:0,sizes:T,minSize:te,gutter:()=>(0,q.Dx)("preview-mode__panes-resizer"),onDragEnd:je,onDrag:fe,children:[(0,L.jsx)("div",{className:"preview-mode__pane preview-mode__pane_editor",children:(0,L.jsx)("div",{className:"preview-mode__pane-content",children:(0,L.jsx)(y.A,{email:e,readOnly:t===Q})})}),(0,L.jsx)("div",{className:"preview-mode__pane preview-mode__pane_main",ref:ce,children:(0,L.jsxs)("div",{className:"preview-mode__pane-content",id:"pane-content-iframe",children:[(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),(0,L.jsx)(A.A,{ref:de,email:e}),(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]})})]}),(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right",children:(0,L.jsx)(O.A,{setSizes:xe,sizes:[T[1]],codeModeShow:Ne,codeModeIsVisible:le,email:e})})]}),I===Q&&(0,L.jsx)(u.A,{xl:{span:ne?18:24},lg:{span:ne?18:24},md:{span:ne?14:24},sm:{span:24},xs:{span:24},className:f()("preview-mode__col preview-mode__col_preview",{"preview-mode__col_preview-collapsed":!ne}),children:(0,L.jsxs)(n.A,{className:"preview-mode__content",sizes:T,minSize:Z,snapOffset:0,gutter:()=>(0,q.Dx)("preview-mode__resizer"),onDragEnd:je,onDrag:fe,expandToMin:!0,gutterAlign:"center",dragInterval:1,children:[(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu",ref:me,children:!ne&&(0,L.jsx)("div",{className:"element-preview-menu",style:{width:"100%"},children:(0,L.jsx)("div",{className:"preview-mode__comments-icon-wrapper",onClick:we,children:(0,L.jsxs)(l.A,{placement:"right",title:j("Discuss","tab"),children:[(0,L.jsx)(h.A,{style:{fontSize:"20px"}}),!!he.length&&(0,L.jsx)("span",{className:"preview-mode__comment-counter",children:he.filter((e=>"deleted"!==e.comment_status)).length})]})})})}),(0,L.jsxs)("div",{className:"preview-mode__content-col preview-mode__pane-content preview-mode__content-col_main",ref:ce,id:"pane-content-iframe",children:[(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-top",id:"iframe-scroll-top"}),(0,L.jsx)(A.A,{ref:de,className:"preview-mode__iframe",email:e,handlerSendPosition:be}),(0,L.jsx)("div",{className:"preview-mode__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,L.jsx)("div",{className:"preview-mode__content-col preview-mode__content-col_menu preview-mode__content-col_menu-right",ref:ue,children:(0,L.jsx)(O.A,{setSizes:xe,sizes:[T[1]],codeModeShow:Ne,codeModeIsVisible:le,email:e})})]})})]})}),(0,L.jsx)("div",{className:"preview-mode__footer"})]})};ee.defaultProps={viewMode:K,sendOptionsHandler:()=>{}};const te=ee},19817:(e,t,s)=>{s.d(t,{A:()=>h});var i=s(92810),r=s(71157),n=s(64617),a=s(94822),l=s(39990),o=s(32269),d=s(90070),c=s(47381),m=s(85163),u=s(70082);const p="emailmaker.ru",h=({children:e})=>{const t=(0,n.zy)(),s=(0,r.hN)(),h=(0,d.p6)(),[g,_]=(0,a.ok)(),v=(0,c.u)(),[x,{isError:j,isSuccess:f,error:y,data:A}]=(0,l.i2)(),{isError:b,isUninitialized:w,isLoading:N,isSuccess:S,error:k,data:I,refetch:C}=(0,l.CR)("",{skip:m.EW.isPlugin||!h.get(m.A9.em_token)}),T=(0,i.useMemo)((()=>({email:g.get("email"),hash:g.get("hash"),event:"confirmation"===g.get("event")})),[g]);if((0,i.useEffect)((()=>{j?(0,o.p6)({error:y},s):f&&(v({event:"email_confirmation",user_email:null===A||void 0===A?void 0:A.email}),(0,o.wB)(A.message,s),I&&C())}),[A,y,j,f,s,I,C,v]),(0,i.useEffect)((()=>{!(T.email&&T.hash&&T.event)||!1!==(null===I||void 0===I?void 0:I.email_confirmation)&&h.get(m.A9.em_token)||A||x({hash:T.hash,email:T.email,event:T.event}).catch((e=>{console.warn("e",e)})).finally((()=>_("")))}),[T,x,I,h,_,A]),(0,i.useEffect)((()=>{b&&k&&((0,o.p6)({error:k},s),(0,o.Id)(h))}),[I,b,k,s,h]),m.EW.isPlugin)return e;if(!m.EW.isPlugin&&!h.get(m.A9.em_token)&&!t.pathname.includes("auth"))return(0,u.jsx)(n.C5,{to:"/auth",state:{from:t}});if((w||N)&&!t.pathname.includes("auth"))return(0,u.jsx)(u.Fragment,{});if(b&&!t.pathname.includes("auth"))return(0,u.jsx)(n.C5,{to:"/auth",state:{from:t}});if(S){const{id:s,email:i,name:r,locale:a,carrotquest_hash:l,ducalis_hash:o,email_subscription_consent:d,last_used_project:c}=I;return h.set(m.A9.em_id,s,{domain:p}),h.set(m.A9.em_email,i,{domain:p}),h.set(m.A9.em_name,r,{domain:p}),h.set(m.A9.em_locale,a,{domain:p}),h.set(m.A9.em_carrotquest_hash,l,{domain:p}),h.set(m.A9.em_ducalis_hash,o,{domain:p}),h.set(m.A9.em_email_subscription_consent,d,{domain:p}),c&&"/"===t.pathname?(0,u.jsx)(n.C5,{to:`/projects/${c}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},19263:(e,t,s)=>{s.d(t,{A:()=>k});var i=s(92810),r=s(41919),n=s(37005),a=s(66726),l=s(32085),o=s(32293),d=s(64617),c=s(94822),m=s(45934),u=s(23287),p=s(29067),h=s(30961),g=s(20757),_=s(32398),v=s(34524),x=s(7760),j=s(85163),f=s(22197),y=s(90070),A=s(32269),b=s(93563),w=s(64936),N=s(70082);const{Content:S}=r.A,k=()=>{var e,t,s;const{__:k}=(0,u.s9)(),I=(0,m.wA)(),C=(0,y.p6)(),T=C.get(j.A9.em_elements_view),{data:E}=(0,d.KC)(),[L]=(0,c.ok)(),z=(0,m.d4)(x.b9),D=(0,m.d4)(w.o8),O=L.get("folder"),M=+L.get("tag"),R=(0,A.HT)(E,j.YY),[F,B]=(0,i.useState)(O||(M?null:j.y2)),[P,H]=(0,i.useState)(M||null),[q,$]=(0,i.useState)(T||j.Y$),{data:V,refetch:W}=(0,b.Jz)({parent:null===(e=E.blockfolder)||void 0===e?void 0:e[0]},{skip:!(null!==(t=E.blockfolder)&&void 0!==t&&t[0])});(0,i.useEffect)((()=>{I((0,w.sB)(V||[]))}),[I,V]);const U=(e=!1,t=null)=>{H(t),B(e),I((0,x.om)({...z,tags:t?[t]:[],folderTag:e}))};(0,i.useEffect)((()=>{var e;M&&null!==R&&void 0!==R&&R.find((e=>e.id===M))&&(null===z||void 0===z||null===(e=z.tags)||void 0===e?void 0:e[0])!==P&&I((0,x.om)({...z,tags:[M],folderTag:F}))}),[R,M,P,I,z,F]);(0,f.A)(k("Blocks")+" "+E.title),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const X=(0,N.jsx)(h.A,{isBlocks:!0}),Y=(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(n.A,{defaultValue:q,onChange:e=>{$(e),I((0,v.NK)(e)),C.set(j.A9.em_elements_view,e)},value:q,options:[{value:j.Y$,label:(0,N.jsx)(a.A,{title:k("Cards view"),placement:"top",children:(0,N.jsx)(l.A,{})})},{value:j.rl,label:(0,N.jsx)(a.A,{title:k("Table view"),placement:"top",children:(0,N.jsx)(o.A,{})})}]},"Switch radio")});return(0,N.jsxs)(r.A,{className:"project-blocks-page",children:[(0,N.jsx)(g.A,{leftBlock:X,rightBlock:Y}),(0,N.jsx)(S,{className:"project-blocks-page__container",children:(0,N.jsxs)("div",{className:"project-blocks-page__content container",children:[(0,N.jsx)("div",{className:"project-blocks-page__menu-wrapper",children:(0,N.jsx)(_.A,{currentFolderId:F,setCurrentFolderId:B,activeTagId:P,setActiveTagHandler:U,projectTags:R,folderTaxonomy:"blockfolder"})}),(0,N.jsx)(p.A,{projectId:E.id,projectEmailsCounter:+(null===E||void 0===E||null===(s=E.counters)||void 0===s?void 0:s.blocks_counter),emailsView:q,currentFolderId:F,foldersList:D,refetchProjectFolders:D.length?W:()=>{},projectTags:R,activeTagId:P,setActiveTagHandler:U})]})})]})}},6099:(e,t,s)=>{s.d(t,{A:()=>_});var i=s(92810),r=s(64617),n=s(45934),a=s(41919),l=s(25072),o=s(43005),d=s(23287),c=s(84568),m=s(36404),u=s(72981),p=s(32269),h=s(70082);const{Content:g}=a.A,_=()=>{var e;const{__:t}=(0,d.s9)(),{projectId:s}=(0,r.g)();let _=(0,r.Zp)(),v=(0,r.zy)();const x=(0,n.wA)(),j=(0,c.fo)(+s,{skip:!s}),{isLoading:f,isError:y,error:A,isSuccess:b,data:w}=j;return(0,i.useEffect)((()=>{b&&(null===w||void 0===w?void 0:w.id)!==s&&x((0,m.od)(w))}),[b,w,x,s]),(0,i.useEffect)((()=>{b&&s&&v.pathname.endsWith(s)&&_(`${v.pathname}/emails`)}),[b,v,_,s]),(0,h.jsxs)(h.Fragment,{children:[f&&(0,h.jsx)(u.A,{}),y&&A&&(0,h.jsx)(a.A,{className:"project-outlet",children:(0,h.jsx)(g,{className:"project-outlet__container container",children:(0,h.jsx)(l.Ay,{status:A.status,title:A.status,subTitle:null===(e=A.data)||void 0===e?void 0:e.message,extra:(0,h.jsx)(o.Ay,{type:"primary",onClick:()=>(0,p.XZ)(_,"/projects"),children:t("Back To Projects")})})})}),b&&(0,h.jsx)(r.sv,{context:{...j}})]})}},44338:(e,t,s)=>{s.d(t,{A:()=>V});var i=s(92810),r=s(41919),n=s(37005),a=s(66726),l=s(43005),o=s(71157),d=s(32085),c=s(32293),m=s(3625),u=s(52360),p=s(64617),h=s(94822),g=s(45934),_=s(23287),v=s(44335),x=s(29718),j=s(30961),f=s(28288),y=s(72981),A=s(32398),b=s(20757),w=s(47358),N=s(94925),S=s(86286),k=s(64936),I=s(65983),C=s(39990),T=s(46312),E=s(86739),L=s(63531),z=s(93563),D=s(85163),O=s(22197),M=s(14598),R=s(58689),F=s(47381),B=s(32269),P=s(90070),H=s(7205),q=s(70082);const{Content:$}=r.A,V=()=>{var e;const{__:t,_n:s}=(0,_.s9)(),V=(0,g.wA)(),W=(0,p.Zp)(),U=(0,P.p6)(),X=(0,o.hN)();let Y=(0,p.zy)();const Z=(0,g.d4)(I.CT),J=(0,g.d4)(S.C1),G=(0,g.d4)(w.cL),K=(0,g.d4)(k.o8),Q=(0,g.d4)(k.uM),[ee]=(0,C.on)(),[te]=(0,E.Kh)(),[se]=(0,L.dS)(),[ie]=(0,T.mI)(),[re]=(0,h.ok)(),{data:ne}=(0,p.KC)(),ae=(0,F.u)(),[le,oe]=(0,i.useState)(!1),de=re.get("folder"),ce=(0,B.HT)(ne,D.zh),{data:me,refetch:ue}=(0,z.Jz)({parent:null===ne||void 0===ne?void 0:ne.folder[0]},{skip:!(null!==ne&&void 0!==ne&&ne.folder[0])}),[pe,he]=(0,i.useState)(de||(Q?null:D.y2));(0,i.useEffect)((()=>{V((0,k.sB)(me||[]))}),[V,me]);const[ge,_e]=(0,i.useState)(U.get(D.A9.em_elements_view)||D.Y$);(0,O.A)(t("Emails")+" "+ne.title),(0,i.useEffect)((()=>{(null===J||void 0===J?void 0:J.last_used_project)!==ne.id&&V(C.Q2.endpoints.editMe.initiate({last_used_project:ne.id}))}),[V,ne.id,null===J||void 0===J?void 0:J.last_used_project]);const[ve,xe]=(0,i.useState)(null);const je=async e=>{if(1===e.length){const t=e[0];try{oe(!0);const e=await(0,M.q2)(t,(async(e,t)=>{let s;if("string"===typeof e)try{var i;e=(0,H.A)(e),s=null===(i=await ie({url:e}))||void 0===i?void 0:i.data}catch(l){return e}else s=e;if(s){if(t.split(".").length<2){const e=v.extension(s.type);e&&(t=`${t}.${e}`)}const e=new File([s],t.toLowerCase()),i=await se({user_id:J.id,folder:ne.id,file:e});var r,n,a;if(!i.error)if(400!==(null===(r=i.data.data)||void 0===r?void 0:r.status))return null===(n=i.data)||void 0===n||null===(a=n[0])||void 0===a?void 0:a.file_url}return"string"===typeof e?e:""})),[s]=(0,R.Ay)(t.name),i=(0,B.ez)(e)||s||"";return te({title:i,project:ne.id,subject:i,description:"",html:e,parent_email:D.iU,folder:de!==D.y2?[+de]:[]}).then((e=>{e&&(e.error?X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}):(me&&ue(),W(`/projects/${ne.id}/emails/${e.data.id}`),ae({event:"upload_file",action:"import_email"})))})).finally((()=>oe(!1)))}catch(i){oe(!1);const e=i instanceof Error?i.message:i;X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),placement:"bottomRight"})}}else{const r=[];oe(!0);for(let s=0;s<e.length;s++){let n=e[s];const a=await(0,M.q2)(n,(async(e,t)=>{let s;if("string"===typeof e)try{var r;e=(0,H.A)(e),s=null===(r=await ie({url:e}))||void 0===r?void 0:r.data}catch(i){return e}else s=e;if(t.split(".").length<2){const e=v.extension(s.type);e&&(t=`${t}.${e}`)}const n=new File([s],t.toLowerCase()),a=await se({user_id:J.id,folder:ne.id,file:n});var l,o,d;if(!a.error&&400!==(null===(l=a.data.data)||void 0===l?void 0:l.status))return null===(o=a.data)||void 0===o||null===(d=o[0])||void 0===d?void 0:d.file_url;return"string"===typeof e?e:""})),[l]=(0,R.Ay)(n.name),o=(0,B.ez)(a)||l||"",d=te({title:o,project:ne.id,subject:o,description:"",html:a,parent_email:D.iU,folder:de!==D.y2?[+de]:[]}).then((e=>{if(e)return e.error?(X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.code}}),description:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:e.error.data.message}}),placement:"bottomRight"}),null):(X.success({message:t("The email \u201c")+e.data.title+t("\u201d was successfully imported."),placement:"bottomRight"}),e.data)})).catch((e=>{const t=e instanceof Error?e.message:e;return X.error({message:(0,q.jsx)("div",{dangerouslySetInnerHTML:{__html:t}}),placement:"bottomRight"}),null}));r.push(d)}let n=await Promise.all(r);oe(!1),n=n.filter((e=>!!e)),n.length&&X.success({message:n.length+s(" email was"," emails were",n.length)+t(" successfully imported."),placement:"bottomRight"}),ve&&ve.refetch()}},[fe,ye]=(0,i.useState)(!1);(0,i.useEffect)((()=>{!fe&&J.counters.emails_counter<3&&(ee(),ye(!0))}),[ee,J.counters.emails_counter,fe]),(0,i.useEffect)((()=>{document.body.classList.remove("editor"),U.remove(D.A9.em_folder)}),[V,U]);const Ae=(e=!1,t=null)=>{V((0,k.Cj)(t)),he(e),V((0,I.om)({...Z,tags:t?[t]:[],folderTag:e}))},be=(0,q.jsx)(j.A,{isBlocks:!1}),we=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(n.A,{defaultValue:ge,onChange:e=>{U.set(D.A9.em_elements_view,e),_e(e),V((0,N.NK)(e))},value:ge,options:[{value:D.Y$,label:(0,q.jsx)(a.A,{title:t("Cards view"),placement:"top",children:(0,q.jsx)(d.A,{})})},{value:D.rl,label:(0,q.jsx)(a.A,{title:t("Table view"),placement:"top",children:(0,q.jsx)(c.A,{})})}]},"Switch radio"),(0,q.jsx)(a.A,{title:t("Available formats: HTML, EML, ZIP"),placement:"top",children:(0,q.jsx)(l.Ay,{className:"em-analytics__project-page__import",type:"default",icon:(0,q.jsx)(m.A,{}),onClick:()=>{ae({event:"click",action:"import_email"}),(0,M.QM)("application/zip, message/rfc822, text/html",je)},children:t("Import email")},"Import email from file")},"Import email from file tooltip"),(0,q.jsx)(l.Ay,{className:"em-analytics__email-create",type:"primary",icon:(0,q.jsx)(u.A,{}),onClick:()=>{V((0,I.om)({tags:[]})),U.set(D.A9.em_folder,"deleted"===de?D.y2:de),(0,B.XZ)(W,`${Y.pathname}/create/`),ae({event:"click",action:"create_new_email",description:"Go to the email template selection"})},children:t("Create a new email")},"Create new email")]});return(0,q.jsxs)(r.A,{className:"project-page",children:[(0,q.jsx)(b.A,{leftBlock:be,rightBlock:we}),(0,q.jsx)($,{className:"project-page__container",children:(0,q.jsxs)("div",{className:"project-page__content container",children:[(0,q.jsx)("div",{className:"project-page__menu-wrapper",children:(0,q.jsx)(A.A,{currentFolderId:pe,setCurrentFolderId:he,activeTagId:Q,setActiveTagHandler:Ae,projectTags:ce,folderTaxonomy:"folder"})}),(0,q.jsx)(x.A,{projectId:ne.id,projectEmailsCounter:+(null===ne||void 0===ne||null===(e=ne.counters)||void 0===e?void 0:e.emails_counter),emailsView:ge,currentFolderId:pe,foldersList:K,refetchProjectFolders:K.length?ue:()=>{},projectTags:ce,activeTagId:Q,setActiveTagHandler:Ae,registerFunction:xe})]})}),le&&(0,q.jsx)(y.A,{wrap:!0,style:{position:"fixed",width:"100%",height:"100%",top:0,left:0}}),(0,q.jsx)(f.A,{isModalVisible:G===D.lx.ADD_NEW_EMAIL_MODAL})]})}},24420:(e,t,s)=>{s.d(t,{A:()=>M});var i=s(92810),r=s(41919),n=s(43005),a=s(45934),l=s(23287),o=s(68919),d=s(33206),c=s(4800),m=s(49246),u=s(29234),p=s(21349),h=s(71157),g=s(9452),_=s(22339),v=s(8375),x=s(45130),j=s(8114),f=s(74267),y=s(64617),A=s(94822),b=s(35285),w=s(84568),N=s(64936),S=s(32269),k=s(85163),I=s(70082);const C=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/emails?page=1`,T=(e,t)=>`${e.pathname.replace(/\/+$/,"")}/${t.id}/members`,E=()=>{const{__:e,_x:t}=(0,l.s9)();let s=(0,a.d4)(N.vW),r=(0,y.zy)(),n=(0,a.wA)(),o=(0,a.d4)(N.cL);const{modal:E}=d.A.useApp(),L=(0,h.hN)(),{confirm:z}=E,D=(0,a.Pj)(),O=s=>{z({maskClosable:!0,centered:!0,title:t("Are you sure to delete \u201c","project")+s.title+e("\u201d project?"),icon:(0,I.jsx)(g.A,{}),okText:e("Yes"),cancelText:e("No"),onOk:()=>(t=>D.dispatch(w.Nq.endpoints.deleteProject.initiate(t.id)).then((t=>{t.error?(0,S.p6)(t,L):t.data&&(0,S.wB)(e("The project \u201c")+t.data.title+e("\u201d was successfully removed."),L)})))(s)})},[M,R]=(0,i.useState)({page:1}),{isLoading:F,isSuccess:B,isError:P,isFetching:H,data:q=[]}=(0,w.su)(M),[$,V]=(0,i.useState)(null),W=[{width:"35%",title:e("Project"),dataIndex:"title",render:(e,t,s)=>(0,I.jsx)(A.N_,{to:C(r,t),children:e})},{width:"16%",title:e("Owner"),dataIndex:["members","owner","nickname"],render:(e,t,s)=>e||t.members.owner.user_email},{width:"12%",title:t("Created","block"),dataIndex:"date",render:(t,s,i)=>(0,S.Yq)((0,f.A)(t),e),sorter:!0,sortOrder:(0,S.Np)(M.order)},{width:"10%",title:e("Emails"),dataIndex:"emails",sorter:!0,render:(e,t,s)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"10%",title:e("Blocks"),dataIndex:"blocks",render:(e,t,s)=>null!==e&&void 0!==e&&e.length?null===e||void 0===e?void 0:e.length:"\u2013"},{width:"3%",title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(t,s)=>{let i=[];return i.push({label:(0,I.jsx)(A.N_,{to:C(r,s),children:e("Open")}),key:"Enter",icon:(0,I.jsx)(_.A,{style:{fontSize:"16px"}}),className:"em-analytics__open"},{label:e("Settings"),key:"Edit",icon:(0,I.jsx)(v.A,{style:{fontSize:"16px"}}),className:"em-analytics__edit",onClick:()=>(V(s),void n((0,N.qf)(k.lx.EDIT_PROJECT_MODAL)))},{label:(0,I.jsx)(A.N_,{to:T(r,s),children:e("Members")}),key:"Members",icon:(0,I.jsx)(x.A,{style:{fontSize:"16px"}}),className:"em-analytics__members"},{label:e("Remove"),key:"Remove",icon:(0,I.jsx)(g.A,{style:{fontSize:"16px"}}),className:"em-analytics__remove",style:{color:"#ff4d4f"},onClick:()=>O(s)}),(0,I.jsx)(c.A,{arrow:"true",placement:"bottom",menu:{items:i},trigger:["hover"],children:(0,I.jsx)("span",{className:"projects-table__actions",children:(0,I.jsx)(j.A,{})})})}}];return(0,I.jsxs)("div",{className:"container",children:[F&&(0,I.jsx)(m.A,{active:!0}),P&&(0,I.jsx)(u.A,{message:e("Error"),description:e("Error when receiving data. Try again (reload page) or contact support."),type:"error",showIcon:!0}),B&&0===q.length&&(0,I.jsx)(u.A,{message:e("You don't have any projects yet."),description:e("Click the Add a new project button to add your first project."),type:"info",showIcon:!0}),B&&q.length>0&&(0,I.jsx)(p.A,{rowKey:e=>e.id,dataSource:q,bordered:!0,columns:W,loading:H,onChange:(e,t,{order:s,field:i},{action:r})=>{"sort"===r&&R(s?{page:1,order:(0,S.gq)(s),orderby:i}:{page:1})},showSizeChanger:!1,pagination:{showSizeChanger:!1,hideOnSinglePage:!0,position:["bottomCenter"],current:M.page,total:s,onChange:(e,t)=>{R({page:e})}},className:"projects-table"}),(0,I.jsx)(b.A,{isModalVisible:o===k.lx.EDIT_PROJECT_MODAL,selectedProject:$})]})};var L=s(20757),z=s(47381),D=s(22197);const{Content:O}=r.A,M=()=>{const{__:e}=(0,l.s9)(),t=(0,a.d4)(N.cL),s=(0,a.wA)(),d=(0,z.u)();(0,D.A)(e("Projects")),(0,i.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const c=(0,I.jsx)("div",{className:"ant-page-header-heading-title",children:e("Projects")}),m=(0,I.jsx)(n.Ay,{className:"em-analytics__add-project",type:"primary",onClick:()=>{d({event:"open_modal",action:"create_new_project"}),s((0,N.qf)(k.lx.ADD_NEW_PROJECT_MODAL))},children:e("Add a new project")},"Add a new project");return(0,I.jsxs)(r.A,{className:"projects-page",children:[(0,I.jsx)(L.A,{leftBlock:c,rightBlock:m}),(0,I.jsxs)(O,{className:"projects-page__container",children:[(0,I.jsx)(E,{}),(0,I.jsx)(o.A,{isModalVisible:t===k.lx.ADD_NEW_PROJECT_MODAL})]})]})}},36852:(e,t,s)=>{s.d(t,{A:()=>N});var i=s(92810),r=s(59297),n=s(76662),a=s(12280),l=s(55039),o=s(43005),d=s(71157),c=s(9588),m=s(82013),u=s(48236),p=s(64617),h=s(94822),g=s(38883),_=s.n(g),v=s(23287),x=s(65119),j=s(85163),f=s(47381),y=s(70082);const{Title:A,Text:b}=n.A,w=({className:e})=>{const{__:t}=(0,v.s9)();let s=(0,p.Zp)();const r=(0,d.hN)(),n=(0,f.u)(),[g,w]=(0,i.useState)(!1),N={name:"email",rules:[{required:!0,message:t("Please type your email address."),type:"email"}],placeholder:t("email"),prefix:(0,y.jsx)(c.A,{style:{color:j.VG}})},S={name:"password",rules:[{required:!0,message:t("Please type your password.")},()=>({validator:(e,s)=>s.length>=8&&/[0-9]/.test(s)&&/[a-z]/.test(s)&&/[A-Z]/.test(s)&&/\W+|_/g.test(s)?Promise.resolve():Promise.reject(new Error(t("The password is too simple.")))})],placeholder:t("password"),prefix:(0,y.jsx)(m.A,{style:{color:j.VG}})},k={name:"code",rules:[{required:!0,message:t("Please type your password confirmation code.")}],placeholder:t("confirmation code"),prefix:(0,y.jsx)(u.A,{style:{color:j.VG}})},[I,C]=(0,x.Lv)(),[T,E]=(0,x.kg)(),[L,z]=(0,i.useState)("");(0,i.useEffect)((()=>{C.isError&&r.error({message:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:C.error.data.code}}),description:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:C.error.data.message}}),placement:"bottomRight"})}),[C,r]),(0,i.useEffect)((()=>{E.isError&&r.error({message:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:E.error.data.code}}),description:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:E.error.data.message}}),placement:"bottomRight"}),E.isSuccess&&(r.success({message:t("Your password successfully reset."),description:t("Try sign in with your new password."),placement:"bottomRight"}),s("/auth",{replace:!0}))}),[E,s,t,r]);return(0,y.jsxs)("div",{className:_()("recover-password-form",{[e]:e}),children:[!C.isSuccess&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"recover-password-form__heading",children:[(0,y.jsx)(A,{level:2,style:{fontWeight:500,fontSize:24},children:t("Forgot the password?")}),(0,y.jsx)(b,{className:"recover-password-form__sub-title",children:t("Enter your email address and we will send you password reset instructions.")})]}),(0,y.jsxs)(a.A,{name:"recover_password_form",initialValues:{remember:!0},onFinish:e=>{z(e.email),n({event:"submit_form",action:"password_recovery",label:e.email}),I({email:e.email})},onFinishFailed:()=>{},autoComplete:"off",children:[(0,y.jsx)(a.A.Item,{name:N.name,rules:N.rules,children:(0,y.jsx)(l.A,{size:"large",disabled:C.isLoading,placeholder:N.name,prefix:N.prefix})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(o.Ay,{size:"large",loading:C.isLoading,block:!0,type:"primary",htmlType:"submit",className:"em-analytics__password-reset",children:t("Send")})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(h.N_,{to:"/auth",children:t("Back to Log In")})})]})]}),C.isSuccess&&!E.isSuccess&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"recover-password-form__heading",children:[(0,y.jsx)(A,{level:2,style:{fontWeight:500,fontSize:24},children:t("Set new password")}),(0,y.jsx)(b,{className:"recover-password-form__sub-title",children:t("Enter the confirmation code from the email and set a new password.")})]}),(0,y.jsxs)(a.A,{name:"set_new_password_form",initialValues:{remember:!0},onFinish:e=>{T({email:L,password:e.password,code:e.code})},onFinishFailed:()=>{},autoComplete:"off",children:[(0,y.jsx)(a.A.Item,{name:S.name,rules:S.rules,extra:t("At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters."),children:(0,y.jsx)(l.A.Password,{readOnly:!g,onFocus:()=>w(!0),size:"large",type:"password",disabled:E.isLoading,placeholder:t("new password"),prefix:S.prefix})}),(0,y.jsx)(a.A.Item,{name:k.name,rules:k.rules,children:(0,y.jsx)(l.A,{size:"large",disabled:E.isLoading,placeholder:k.placeholder,prefix:k.prefix})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(o.Ay,{size:"large",loading:E.isLoading,block:!0,type:"primary",htmlType:"submit",children:t("Recover password")})}),(0,y.jsx)(a.A.Item,{children:(0,y.jsx)(h.N_,{to:"/auth",children:t("Back to Log In")})})]})]})]})},N=()=>(0,y.jsx)(r.A,{className:"recover-password-page",children:(0,y.jsx)(w,{className:"recover-password-page__form"})})},70431:(e,t,s)=>{s.d(t,{A:()=>g});var i=s(92810),r=s(12280),n=s(14852),a=s(43005),l=s(55039),o=s(71157),d=s(45934),c=s(23287),m=s(93563),u=s(64936),p=s(85163),h=s(70082);const g=({folder:e,refetch:t})=>{const{__:s,_x:g}=(0,c.s9)(),_=(0,d.wA)(),[v]=r.A.useForm(),x=(0,i.useRef)(null),j=(0,d.d4)(u.cL)===p.lx.EDIT_FOLDER_NAME_MODAL,f=(0,o.hN)(),{folderId:y=null,folderName:A=""}=e,b=()=>_((0,u.Oo)()),[w,N]=(0,m.$s)();(0,i.useEffect)((()=>{j&&v.setFieldsValue({name:A})}),[j,A,v]);const S=()=>{v.validateFields().then((({name:e})=>{w({id:y,data:{name:e}}).then((({data:e,error:i})=>{i?(f.error({message:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i.data.code}}),description:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:i.data.message}}),placement:"bottomRight"}),v.setFieldValue("name",A)):(t().then((({data:e})=>{if(e){var t,s,i;const r=null===(t=e[0])||void 0===t||null===(s=t.children)||void 0===s||null===(i=s.find((e=>e.id===y)))||void 0===i?void 0:i.name;v.setFieldValue("name",r)}})),b(),f.success({message:s("The folder \u201c")+A+g("\u201d was successfully changed to \u201c","folder")+e.name+s("\u201d."),placement:"bottomRight"}))}))}))};return(0,h.jsx)(n.A,{title:s("Change folder name"),open:j,onOk:S,onCancel:b,className:"new-folder-name-modal",centered:!0,footer:[(0,h.jsx)(a.Ay,{type:"primary",size:"large",loading:N.isLoading,onClick:S,children:s("Change name")},"submit")],children:(0,h.jsx)(r.A,{form:v,layout:"vertical",name:"rename_folder_form",onFinish:S,initialValues:{remember:!1,name:A},autoComplete:"off",style:{paddingTop:10},children:(0,h.jsx)(r.A.Item,{name:"name",rules:[{required:!0,message:s("Please enter the folder name")}],children:(0,h.jsx)(l.A,{disabled:N.isLoading,size:"large",placeholder:s("Enter the folder name"),ref:x,style:{marginBottom:5}})})})})}},35825:(e,t,s)=>{s.d(t,{A:()=>g});var i=s(92810),r=s(12280),n=s(14852),a=s(43005),l=s(55039),o=s(71157),d=s(45934),c=s(23287),m=s(93563),u=s(64936),p=s(85163),h=s(70082);const g=({group:e,refetch:t})=>{const{__:s,_x:g}=(0,c.s9)(),_=(0,d.wA)(),[v]=r.A.useForm(),x=(0,i.useRef)(null),j=(0,d.d4)(u.cL)===p.lx.EDIT_GROUP_NAME_MODAL,f=(0,o.hN)(),{id:y=null,name:A=""}=e,b=()=>_((0,u.Oo)()),[w,N]=(0,m.CE)();(0,i.useEffect)((()=>{j&&v.setFieldsValue({name:A})}),[j,A,v]);const S=()=>{v.validateFields().then((({name:e})=>{w({id:y,data:{name:e}}).then((({data:i,error:r})=>{r?(f.error({message:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:r.data.code}}),description:(0,h.jsx)("div",{dangerouslySetInnerHTML:{__html:r.data.message}}),placement:"bottomRight"}),v.setFieldValue("name",e)):(t().then((({data:e})=>{if(e){var t,s,i;const r=null===(t=e[0])||void 0===t||null===(s=t.children)||void 0===s||null===(i=s.find((e=>e.id===y)))||void 0===i?void 0:i.name;v.setFieldValue("name",r)}})),b(),f.success({message:s("The group \u201c")+e+g("\u201d was successfully changed to \u201c","group")+i.name+s("\u201d."),placement:"bottomRight"}))}))}))};return(0,h.jsx)(n.A,{title:s("Change group name"),open:j,onOk:S,onCancel:b,className:"new-group-name-modal",centered:!0,footer:[(0,h.jsx)(a.Ay,{type:"primary",size:"large",loading:N.isLoading,onClick:S,children:s("Change name")},"submit")],children:(0,h.jsx)(r.A,{form:v,layout:"vertical",name:"rename_group_form",onFinish:S,initialValues:{remember:!1,name:A},autoComplete:"off",style:{paddingTop:10},children:(0,h.jsx)(r.A.Item,{name:"name",rules:[{required:!0,message:s("Please enter the group name")}],children:(0,h.jsx)(l.A,{disabled:N.isLoading,size:"large",placeholder:s("Enter the group name"),ref:x,style:{marginBottom:5}})})})})}},33284:(e,t,s)=>{s.d(t,{A:()=>p});var i=s(92810),r=s(43005),n=s(45934),a=s(33206),l=s(56920),o=s(86286),d=s(62303),c=s(32269),m=s(23287),u=s(70082);const p=()=>{const{__:e}=(0,m.s9)(),{notification:t}=a.A.useApp(),s=(0,n.d4)(o.C1),[p]=(0,l.C)(),[h,g]=(0,i.useState)(!1);(0,i.useEffect)((()=>{s.hasOwnProperty("email_confirmation")&&g(s.email_confirmation)}),[s,h]);return null!==s&&void 0!==s&&s.email_confirmation||null===s||void 0===s||!s.privacy_policy_agreement?null:(0,u.jsx)("div",{className:"main__ribbon",children:(0,u.jsxs)("span",{children:[(0,u.jsx)(d.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}})," ",e("Confirmation email was sent to"),"\xa0",(0,u.jsx)("em",{children:s.email}),".\xa0",e("Didn't receive an email?"),"\xa0",(0,u.jsxs)(r.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{p({userId:s.id,email:s.email}).then((({data:i,error:r})=>{i?(0,c.wB)(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",s.email),t):r&&(0,c.p6)(r,t)}))},children:[e("Resend")," ",(0,u.jsx)(d.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}})]})]})})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[6898],{84612:(e,t,a)=>{a.d(t,{EQ:()=>u,YG:()=>d,Zs:()=>n,gb:()=>l});var r=a(33298),o=a(14315),i=a(44141);const s="Ai",n=(0,r.xP)({reducerPath:"AiApi",tagTypes:[s],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn:({body:e},t)=>(0,i.KU)(t).saveFile.ai_create(e,{type:o.cM.FormData})}),getDialog:e.query({queryFn:({entity_id:e,connection:t="chat"},a)=>(0,i.KU)(a).saveFile.ai_status_list({connection:t,entity_id:e}),providesTags:e=>null!==e&&void 0!==e&&e.documents?[...e.documents.map((({id:e})=>({type:s,id:e}))),{type:s,id:"LIST"}]:[{type:s,id:"LIST"}]})})}),{useSendMessageMutation:u,useGetDialogQuery:l,useLazyGetDialogQuery:d}=n},58819:(e,t,a)=>{a.d(t,{Ll:()=>y,MN:()=>g,Uu:()=>p,y4:()=>_});var r=a(33298),o=a(44141),i=a(85163),s=a(14004),n=a(78347),u=a(49211),l=a(1383),d=a(33288);const p=(0,r.xP)({reducerPath:"AiApiGenerator",baseQuery:s.i,endpoints:e=>({generateIdForTask:e.mutation({queryFn:(e,t)=>(0,o.u$)(t).tasks.tasksControllerCreateTask(e).then((e=>e))}),clearAiChat:e.query({queryFn:(e,t)=>(0,o.KU)(t).aiGenerator.clear_history_list(e).then((e=>e))}),getGeneratedContent:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({id:e,setError:t},a){const{updateCachedData:r,cacheEntryRemoved:s}=a;let p=(0,o.KU)(a).baseUrl.indexOf("emailmaker")>=0?i.e3.maker:i.e3.blocks;const c=i.EW.isPlugin?await d.di.getInstance(a,l.Y):u.A.get(i.A9.em_token),m=c?{Authorization:`Bearer ${c}`}:{},y=new n.EventSourcePolyfill(`${p}/tasks/${e}`,{headers:m});y.onmessage=e=>{const t=JSON.parse(e.data);r((e=>{e.push(t)}))},y.onerror=e=>{t("Error connecting to EventSource"),y.close()},await s,y.close()}}),getAiGenerateStatus:e.mutation({query:e=>({url:"/constructor/v1/ai-save-task",method:"POST",body:e})})})}),{useGenerateIdForTaskMutation:c,useGetGeneratedContentQuery:m,useLazyClearAiChatQuery:y,useLazyGetGeneratedContentQuery:_,useGetAiGenerateStatusMutation:g}=p},53200:(e,t,a)=>{a.d(t,{B:()=>s,N:()=>n});var r=a(33298),o=a(14315),i=a(44141);const s=(0,r.xP)({reducerPath:"addUserToProjectApi",baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).userToProject.add_user_create(e,{type:o.cM.FormData})})})}),{useAddUserToProjectMutation:n}=s},39990:(e,t,a)=>{a.d(t,{Q2:()=>d,b9:()=>y,Lj:()=>f,CR:()=>c,W5:()=>g,i2:()=>h,on:()=>m,hZ:()=>_});var r=a(33298),o=a(14315),i=a(31770);function s({title:{rendered:e}={rendered:""},acf:{limits:t,price:a},...r}){return{...r,title:e,limits:t,price:a}}var n=a(814);function u({acf:{autosaves:e,hide_mergetags:t,theme:a,newsletter_consent:r,code_editor:o,counters:i,subscription:s,subscription_end:u,recurring_payments:l,subscription_id:d,promocode:p,subscription_amount:c,enterprise_users_limit:m,enterprise_price:y,enterprise_12_price:_,privacy_policy_agreement:g,last_used_project:h,email_confirmation:f,email_builder_config:b},id:v,...q}){return{...q,id:(0,n.WY)(v),autosaves:e,hide_mergetags:t,theme:a,newsletter_consent:r,code_editor:o?{...o,font_size:Number(o.font_size)}:void 0,counters:Object.keys(i).reduce(((e,t)=>(e[t]=Number(i[t]),e)),{}),subscription:s,subscription_end:u,recurring_payments:l,subscription_id:d,promocode:p,subscription_amount:c,enterprise_users_limit:m,enterprise_price:y,enterprise_12_price:_,privacy_policy_agreement:g,last_used_project:h,email_confirmation:f,email_builder_config:b}}var l=a(44141);const d=(0,r.xP)({reducerPath:"authorizationApi",baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({userRegistration:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.users_register_create({body:e,type:o.cM.Json})}),emailUserRegistration:e.mutation({query:e=>({url:`${"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}/wp-json/auth/v1/users/register`,method:"POST",body:e})}),getMailConfirmation:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.confirmation_list({...e})}),getSchema:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.users_me_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema"}})}),getMe:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.users_me_list(null).then((0,i.SC)((e=>e instanceof Array?e[0]:e))).then((0,i.SC)(u))}),getUser:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.users_detail({id:e}).then((0,i.SC)(u))}),editMe:e.mutation({queryFn(e,t){const a=(0,l.KU)(t),r=(0,n.TB)(function({autosaves:e,theme:t,newsletter_consent:a,code_editor:r,counters:o,subscription:i,subscription_end:s,recurring_payments:u,subscription_id:l,promocode:d,subscription_amount:p,enterprise_users_limit:c,enterprise_price:m,enterprise_12_price:y,privacy_policy_agreement:_,locale:g,last_used_project:h,email_confirmation:f,email_builder_config:b,id:v,...q}){return{...q,id:(0,n.mQ)(v),locale:g,acf:{autosaves:e,theme:t,newsletter_consent:a,code_editor:r?{...r,font_size:String(r.font_size)}:void 0,counters:o,subscription:i,subscription_end:s,recurring_payments:u,subscription_id:l,promocode:d,subscription_amount:p,enterprise_users_limit:c,enterprise_price:m,enterprise_12_price:y,privacy_policy_agreement:_,last_used_project:h,email_confirmation:f,email_builder_config:b}}}(e),!0);return a.wp.users_me_create(r,{type:o.cM.Json}).then((0,i.SC)(u))}}),getSubscriptions:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.subscription_list(void 0).then((0,i.Ih)(s))})})}),{useUserRegistrationMutation:p,useGetMeQuery:c,useLazyGetMeQuery:m,useEditMeMutation:y,useLazyGetSchemaQuery:_,useGetSubscriptionsQuery:g,useLazyGetMailConfirmationQuery:h,useEmailUserRegistrationMutation:f}=d},55701:(e,t,a)=>{a.d(t,{VM:()=>y,pP:()=>k,Gr:()=>T,yW:()=>I,OZ:()=>w,J4:()=>f,bg:()=>g,SB:()=>_,h1:()=>v,OD:()=>q,kz:()=>U,lx:()=>b,R2:()=>h});var r=a(33298),o=a(14315),i=a(31770),s=a(814),n=a(71210);function u({id:e,type:t,title:{rendered:a}={rendered:""},excerpt:r,author:o,acf:{subject:i,description:u,html:l,project:d,related_email:p,tags:c,type:m,is_template:y,lock:_},...g}){return{...g,id:String(e),author:String(o),renderGuid:(0,n.l)(),description:u,html:l,excerpt:null===r||void 0===r?void 0:r.rendered,project:(0,s.pT)(d)?d.ID:d,project_author:(0,s.pT)(d)?d.post_author:void 0,project_title:(0,s.pT)(d)?d.post_title:void 0,tags:c,is_template:y,type:m,related_email:(0,s.WY)((0,s.pT)(p)?p.ID:p),title:a,lock:_}}function l({title:e,subject:t,description:a,renderGuid:r,html:o,project:i,tags:n,type:u,related_email:l,is_template:d,lock:p,author:c,...m}){return{...m,author:(0,s.mQ)(c),title:e,acf:{description:a,related_email:(0,s.mQ)(l),html:o,project:i,tags:n,type:u,is_template:d,lock:p}}}function d({id:e,title:{rendered:t}={rendered:""},acf:{html:a},excerpt:r,parent:o,author:i,...n}){return{...n,id:(0,s.WY)(e),author:(0,s.WY)(i),parent:(0,s.WY)(o),title:t,html:a,excerpt:(0,s.pT)(r)?r.rendered:r}}var p=a(44141),c=a(30725),m=a(85163);const y=(0,r.xP)({reducerPath:"blocksApi",tagTypes:["Blocks","TemplatesBlocks","ParentsBlocks","Block"],baseQuery:(0,p.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getBlocks:e.query({queryFn(e,t){var a,r;const o=(0,p.KU)(t),s={order:"desc",orderby:"modified"},n={};if(e.notEmbed||(n._embed=""),e.projectId&&(n._embed="author",n._fields="id,title,blocktags,blockfolder,group,modified,date,type,acf.lock,acf.project.ID,acf.type,author,acf.is_template,acf.html",s["filter[meta_key]"]="project",s["filter[meta_value]"]=e.projectId),e.fields&&(n._fields=e.fields),e.page&&(s.page=e.page),e.order&&(s.order=e.order),e.orderby&&(s.orderby=e.orderby),e.folderTag&&e.folderTag!==m.y2?(s["filter[tax_query][relation]"]="AND",s["filter[tax_query][0][taxonomy]"]="blockfolder",s["filter[tax_query][0][field]"]="id",s["filter[tax_query][0][terms]"]=e.folderTag):!e.hasOwnProperty("folderTag")||e.folderTag===m.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(a=e.tags)&&void 0!==a&&a.length||"trash"===e.status||(s["filter[tax_query][0][taxonomy]"]="blockfolder",s["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(r=e.tags)||void 0===r?void 0:r.length)>0&&"trash"!==e.status){s["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];s[`filter[tax_query][${t+1}][taxonomy]`]="blocktags",s[`filter[tax_query][${t+1}][field]`]="id",s[`filter[tax_query][${t+1}][terms]`]=a}}return e.type&&(s["filter[meta_query][2][key]"]="type",s["filter[meta_query][2][value]"]=e.type),e.name&&(s.search=e.name),e.pageSize&&(s.per_page=e.pageSize),"trash"===e.status&&(n.status="trash"),o.wp.eblock_list(s,{extraQuery:n}).then((0,i.Ih)(u))},providesTags:(e,t,a,r)=>{var o,i;const s=null===r||void 0===r?void 0:r.response,n=(null===s||void 0===s?void 0:s.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Blocks",id:`${a.folderTag||(null===(t=a.tags)||void 0===t?void 0:t[0])||a.projectId}_${a.page}_${a.status}_${n}`}})),{type:"Blocks",id:`${a.folderTag||(null===(o=a.tags)||void 0===o?void 0:o[0])||a.projectId}_${a.page}_${a.status}_${n}`}]:[{type:"Blocks",id:`${a.folderTag||(null===(i=a.tags)||void 0===i?void 0:i[0])||a.projectId}_${a.page}_${a.status}_${n}`}]},keepUnusedDataFor:0}),getBlocksSchema:e.query({queryFn:(e,t)=>(0,p.KU)(t).wp.eblock_list(void 0,{method:"OPTIONS",extraQuery:{_fields:"schema.properties.acf"}})}),getParentEmailBlocks:e.query({queryFn(e,t){var a;const r=(0,p.KU)(t),o={"filter[meta_query][0][compare]":"LIKE"},s={};if(e.notEmbed||(s._embed=""),e.emailId&&(o["filter[meta_query][0][key]"]="related_email",o["filter[meta_query][0][value]"]=e.emailId),e.fields&&(s._fields=e.fields),e.page&&(o.page=e.page),(null===(a=e.tags)||void 0===a?void 0:a.length)>0){o["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];o[`filter[tax_query][${t}][taxonomy]`]="blocktags",o[`filter[tax_query][${t}][field]`]="id",o[`filter[tax_query][${t}][terms]`]=a}}return e.type&&(o["filter[meta_query][2][key]"]="type",o["filter[meta_query][2][value]"]=e.type),e.name&&(o.search=e.name),e.pageSize&&(o.per_page=e.pageSize),r.wp.eblock_list(o,{extraQuery:s}).then((0,i.Ih)(u))},providesTags:e=>e?[...e.map((({id:e})=>({type:"ParentsBlocks",id:e}))),{type:"ParentsBlocks",id:"LIST"}]:[{type:"ParentsBlocks",id:"LIST"}],keepUnusedDataFor:0}),getTemplateBlocks:e.query({queryFn:(e,t)=>{var a;const r=(0,p.KU)(t),o={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1",orderby:"modified",order:"desc"},s={};if(e.notEmbed||(s._embed=""),e.fields&&(s._fields=e.fields),e.page&&(o.page=e.page),(null===(a=e.tags)||void 0===a?void 0:a.length)>0){o["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];o[`filter[tax_query][${t}][taxonomy]`]="blocktags",o[`filter[tax_query][${t}][field]`]="id",o[`filter[tax_query][${t}][terms]`]=a}}return e.type&&(o["filter[meta_query][2][key]"]="type",o["filter[meta_query][2][value]"]=e.type),e.name&&(o.search=e.name),e.pageSize&&(o.per_page=e.pageSize),r.wp.eblock_list(o,{extraQuery:s}).then((0,i.Ih)(u))},providesTags:e=>e?[...e.map((({id:e})=>({type:"TemplatesBlocks",id:e}))),{type:"TemplatesBlocks",id:"LIST"}]:[{type:"TemplatesBlocks",id:"LIST"}],keepUnusedDataFor:0}),getBlock:e.query({queryFn:(e,t)=>(0,p.KU)(t).wp.eblock_detail({id:(0,s.mQ)(e)},{extraQuery:{_embed:""}}).then((0,i.SC)(u)),providesTags:(e,t,a)=>[{type:"Block",id:a}],keepUnusedDataFor:0}),getBlockHistory:e.query({queryFn:({blockId:e,page:t=1},a)=>(0,p.KU)(a).wp.eblock_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id"}}).then((a=>(0,i.SA)(a,((a,r)=>({data:a.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(d),totalPages:+r.response.headers.get("X-WP-TotalPages"),args:{blockId:e,page:t}}))))),keepUnusedDataFor:0}),addBlock:e.mutation({queryFn:(e,t)=>(0,p.KU)(t).wp.eblock_create({...l(e),status:"publish"},{type:o.cM.Json}).then((0,i.SC)(u)),invalidatesTags:[{type:"Blocks",id:"LIST"}]}),editBlock:e.mutation({queryFn:(0,c.p)((e=>({blockId:t,source:a,...r},n)=>{const d=(0,p.KU)(e),c=(0,s.TB)(l(r));return d.wp.eblock_partial_update(t,c,{type:o.cM.Json,extraQuery:{_embed:"wp:term"}}).then((0,i.SC)(u))}))}),deleteBlock:e.mutation({queryFn(e,t){const a=(0,p.KU)(t);let r,o;return"object"===typeof e?(r=e.id,o=e.force):(r=e,o=!1),a.wp.eblock_delete(r,{force:o}).then((0,i.PI)(u))},invalidatesTags:(e,t,a)=>[{type:"Blocks",id:a}]}),addTag:e.mutation({queryFn:(e,t)=>(0,p.KU)(t).wp.blocktags_create({...e},{type:o.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],a)=>(0,p.KU)(a).wp.eblock_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,blocktags:[t]},{extraQuery:{"_fields[]":"blocktags"}}).then((0,i.Ih)(u))}),autoSaveBlock:e.mutation({queryFn({blockId:e,body:t},a){const r=(0,p.KU)(a),n=function({parent:e,title:t,html:a,project:r,author:o,...i}){return{...i,author:(0,s.mQ)(o),parent:(0,s.mQ)(e),title:t,"acf[html]":a,"acf[project]":r}}(t);return r.wp.eblock_autosaves_create(e,n,{type:o.cM.Json}).then((0,i.SC)(d))}})})}),{useGetBlocksQuery:_,useGetBlockQuery:g,useLazyGetBlockQuery:h,useGetBlockHistoryQuery:f,useLazyGetBlockHistoryQuery:b,useGetBlocksSchemaQuery:v,useGetParentEmailBlocksQuery:q,useAddBlockMutation:k,useEditBlockMutation:w,useAddTagMutation:T,useAutoSaveBlockMutation:I,useGetTemplateBlocksQuery:U}=y},18777:(e,t,a)=>{a.d(t,{Jg:()=>d,z2:()=>c,HI:()=>m,vn:()=>_,kk:()=>y,Cf:()=>p});var r=a(33298),o=a(14315),i=a(31770),s=a(814);function n({id:e,post:t,parent:a,author:r,content:{rendered:o},acf:{status:i,target_id:n},...u}){return{...u,id:(0,s.WY)(e),post:(0,s.WY)(t),parent:(0,s.WY)(a),author:(0,s.WY)(r),content:o,target_id:n,comment_status:i}}var u=a(44141);const l="Comments",d=(0,r.xP)({reducerPath:"commentsApi",tagTypes:[l],baseQuery:(0,u.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(e,t){return(0,u.KU)(t).wp.comments_list({post:[(0,s.mQ)(e)],per_page:50,order:"asc"}).then((0,i.Ih)(n))},providesTags:e=>e?[...e.map((({id:e})=>({type:l,id:e}))),{type:l,id:"LIST"}]:[{type:l,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:e,author:t,parent:a,content:r,author_name:l,author_email:d,targetId:p},c){const m=(0,u.KU)(c),y={post:(0,s.mQ)(e),author:(0,s.mQ)(t),author_name:l,author_email:d},_={};return r&&(y.content=r),a&&(y.parent=(0,s.mQ)(a)),p&&(_["acf[target_id]"]=p),m.wp.comments_create(y,{type:o.cM.UrlEncoded,extraQuery:_}).then((0,i.SC)(n))},invalidatesTags:[{type:l,id:"LIST"}]}),deleteComment:e.mutation({queryFn:(e,t)=>(0,u.KU)(t).wp.comments_delete(e,{}).then((0,i.PI)(n)),invalidatesTags:[{type:l,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:e,content:t,status:a,targetId:r},s){const l=(0,u.KU)(s),d={},p={};return t&&(d.content=t),a&&(p["acf[status]"]=a),r&&(p["acf[targetId]"]=r),l.wp.comments_update(e,d,{type:o.cM.UrlEncoded,extraQuery:p}).then((0,i.SC)(n))},invalidatesTags:[{type:l,id:"LIST"}]}),deleteTarget:e.mutation({queryFn:(e,t)=>(0,u.KU)(t).wp.comments_delete(e,{},{extraQuery:{"acf[target_id]":""}}).then((0,i.PI)(n)),invalidatesTags:[{type:l,id:"LIST"}]})})}),{useGetCommentsQuery:p,useAddCommentMutation:c,useDeleteCommentMutation:m,useEditCommentMutation:y,useDeleteTargetMutation:_}=d},56920:(e,t,a)=>{a.d(t,{C:()=>s,F:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"confirmationMailApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:e,email:t})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${e}&user_email=${t}`)}`})})})}),{useLazyGetConfirmationMailQuery:s}=i},47036:(e,t,a)=>{a.d(t,{c:()=>d,f:()=>l});var r=a(33298),o=a(31052),i=a(31770),s=a(91967),n=a(39217);const u="EmailRaw",l=(0,r.xP)({reducerPath:"emailRawApi",tagTypes:[u],baseQuery:(0,o.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:e,secret_hash:t},a){return(0,n.mg)(a).wp.email_detail({id:e},{extraQuery:{secret_hash:t}}).then((0,i.SC)(s.V))},providesTags:(e,t,a)=>[{type:u,id:a}]})})}),{useGetEmailRawQuery:d}=l},86739:(e,t,a)=>{a.d(t,{GY:()=>c,Kh:()=>b,Gr:()=>w,LX:()=>T,dN:()=>v,YV:()=>h,sl:()=>_,Xw:()=>m,PX:()=>y,YE:()=>f,_3:()=>g});var r=a(33298),o=a(14315),i=a(91967),s=a(814);function n({id:e,title:{rendered:t}={rendered:""},acf:{html:a,common_styles:r},parent:o,excerpt:i,author:n,...u}){return{...u,author:(0,s.WY)(n),id:(0,s.WY)(e),parent:(0,s.WY)(o),title:t,html:a,common_styles:r,excerpt:(0,s.pT)(i)?i.rendered:i}}var u=a(44141),l=a(31770),d=a(30725),p=a(85163);const c=(0,r.xP)({reducerPath:"emailsApi",tagTypes:["Emails","Email","EmailAutosaves","TemplateEmail"],baseQuery:(0,u.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({queryFn(e,t){var a,r;const o=(0,u.KU)(t),s={order:"desc",orderby:"modified"},n={};if(e.notEmbed||(n._embed=""),e.projectId&&(n._embed="author",n._fields="id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template",s["filter[meta_key]"]="project",s["filter[meta_value]"]=e.projectId),e.fields&&(n._fields=e.fields),e.page&&(s.page=e.page),e.order&&(s.order=e.order),e.orderby&&(s.orderby=e.orderby),e.folderTag&&e.folderTag!==p.y2?(s["filter[tax_query][relation]"]="AND",s["filter[tax_query][0][taxonomy]"]="folder",s["filter[tax_query][0][field]"]="id",s["filter[tax_query][0][terms]"]=e.folderTag):e.folderTag===p.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(a=e.tags)&&void 0!==a&&a.length||!e.status||"trash"===e.status||(s["filter[tax_query][0][taxonomy]"]="folder",s["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(r=e.tags)||void 0===r?void 0:r.length)>0&&"trash"!==e.status){s["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];s[`filter[tax_query][${t+1}][taxonomy]`]="emailtags",s[`filter[tax_query][${t+1}][field]`]="id",s[`filter[tax_query][${t+1}][terms]`]=a}}return e.name&&(s.search=e.name),e.pageSize&&(s.per_page=e.pageSize),"trash"===e.status&&(n.status="trash"),o.wp.email_list(s,{extraQuery:n}).then((0,l.Ih)(i.V))},providesTags:(e,t,a,{response:r})=>{var o,i;const s=(null===r||void 0===r?void 0:r.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Emails",id:`${a.folderTag||(null===(t=a.tags)||void 0===t?void 0:t[0])||a.projectId}_${a.page}_${a.status}_${s}`}})),{type:"Emails",id:`${a.folderTag||(null===(o=a.tags)||void 0===o?void 0:o[0])||a.projectId}_${a.page}_${a.status}_${s}`}]:[{type:"Emails",id:`${a.folderTag||(null===(i=a.tags)||void 0===i?void 0:i[0])||a.projectId}_${a.page}_${a.status}_${s}`}]},keepUnusedDataFor:0}),getTemplateEmails:e.query({queryFn(e,t){var a,r,o;const s=(0,u.KU)(t);let n={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"};const d={_embed:"wp:term",_fields:"_embedded,id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"};if(e.emailId&&(n["filter[meta_query][0][key]"]="parent_email",n["filter[meta_query][0][value]"]=e.emailId),e.fields&&(d._fields=e.fields),(null===(a=e.group)||void 0===a?void 0:a.length)>0||(null===(r=e.projectGroup)||void 0===r?void 0:r.length)>0){const t=[...e.group||[],...e.projectGroup||[]].reduce(((e,{key:t,parentId:a})=>(e[a]||(e[a]=[]),e[a].push(String(t)),e)),{}),a=Object.values(t).map((e=>e.sort()));n["filter[tax_query][relation]"]="AND",a.forEach(((e,t)=>{n[`filter[tax_query][${t}][relation]`]="OR",e.forEach(((e,a)=>{n[`filter[tax_query][${t}][${a}][taxonomy]`]="group",n[`filter[tax_query][${t}][${a}][field]`]="id",n[`filter[tax_query][${t}][${a}][terms]`]=e}))}))}if((null===(o=e.tags)||void 0===o?void 0:o.length)>0){n["filter[tax_query][relation]"]="AND";for(let t=0,a=e.tags.length;t<a;t++){const a=e.tags[t];n[`filter[tax_query][${t}][taxonomy]`]="emailtags",n[`filter[tax_query][${t}][field]`]="id",n[`filter[tax_query][${t}][terms]`]=a}}if(e.type&&(n["filter[meta_query][2][key]"]="type",n["filter[meta_query][2][value]"]=e.type),e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),e.page){var c,m;n.page=e.page;const a=t.getState(),{groupsTemplateProjectTotal:r,groupsTemplateProjectTotalPages:o}=null===a||void 0===a?void 0:a.projectSlice;if((null===(c=e.projectGroup)||void 0===c||!c.length)&&(null===(m=e.group)||void 0===m||!m.length)&&o<e.page&&e.groupType===p.ti.ALL&&!e.projectId){const t=p.mU-r%p.mU+(e.page-(o+1))*p.mU;t&&(n.page=1,n.offset=t)}}return e.projectId&&(n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),s.wp.email_list(n,{extraQuery:d}).then((0,l.Ih)(i.V))},keepUnusedDataFor:0}),getEmail:e.query({queryFn:(e,t)=>(0,u.KU)(t).wp.email_detail({id:(0,s.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,l.SC)(i.V)),providesTags:(e,t,a)=>[{type:"Email",id:a}],keepUnusedDataFor:0}),getTemplateEmail:e.query({queryFn:(e,t)=>(0,u.KU)(t).wp.email_detail({id:(0,s.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,l.SC)(i.V)),providesTags:(e,t,a)=>[{type:"TemplateEmail",id:a}],keepUnusedDataFor:0}),getEmailHistory:e.query({queryFn:({emailId:e,page:t=1},a)=>(0,u.KU)(a).wp.email_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id,parent,date_gmt"}}).then((a=>(0,l.SA)(a,((a,r)=>({data:a.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(n),totalPages:+r.response.headers.get("X-WP-TotalPages"),args:{emailId:e,page:t}}))))),providesTags:e=>e?[...e.data.map((({id:e})=>({type:"EmailAutosaves",id:e}))),{type:"EmailAutosaves",id:"LIST"}]:[{type:"EmailAutosaves",id:"LIST"}],keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:(0,d.p)((e=>({source:t,...a})=>(0,u.KU)(e).wp.email_create({status:"publish",...(0,i.v)(a)},{type:o.cM.Json}).then((0,l.SC)(i.V)))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:(0,d.p)((e=>({emailId:t,source:a,...r})=>{const n=(0,u.KU)(e),d=(0,s.TB)((0,i.v)(r));return n.wp.email_partial_update(t,d,{type:o.cM.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then((0,l.SC)(i.V))}))}),deleteEmail:e.mutation({queryFn(e,t){const a=(0,u.KU)(t);let r,o;return"object"===typeof e?(r=e.id,o=e.force):(r=e,o=!1),a.wp.email_delete(r,{force:o}).then((0,l.PI)(i.V))},invalidatesTags:(e,t,a)=>[{type:"Emails",id:a}]}),addTag:e.mutation({queryFn:(e,t)=>(0,u.KU)(t).wp.emailtags_create({...e},{type:o.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],a)=>(0,u.KU)(a).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,emailtags:[t]},{extraQuery:{"_fields[]":"emailtags"}}).then((0,l.Ih)(i.V))}),autoSaveEmail:e.mutation({queryFn({emailId:e,body:t},a){const r=(0,u.KU)(a),i=function({parent:e,title:t,html:a,project:r,subject:o,preheader:i,common_styles:n,author:u,parent_email:l,...d}){return{...d,author:(0,s.mQ)(u),title:t,parent:(0,s.mQ)(e),"acf[html]":a,"acf[project]":r,"acf[parent_email]":l,"acf[common_styles]":n}}(t);return r.wp.email_autosaves_create(e,i,{type:o.cM.FormData}).then((0,l.SC)(n))}})})}),{useGetEmailsQuery:m,useGetTemplateEmailsQuery:y,useGetEmailQuery:_,useLazyGetEmailQuery:g,useGetEmailHistoryQuery:h,useLazyGetEmailHistoryQuery:f,useAddEmailMutation:b,useEditEmailMutation:v,useDeleteEmailMutation:q,useGetDeletableTagQuery:k,useAddTagMutation:w,useAutoSaveEmailMutation:T}=c},4115:(e,t,a)=>{a.d(t,{U8:()=>s,cA:()=>u,ri:()=>n});var r=a(31052),o=a(33298),i=a(32269);const s=(0,o.xP)({reducerPath:"exportPngApi",baseQuery:async(e,t,a)=>{try{const{notification:o,...i}=e,s=await(0,r.cw)({baseUrl:"https://racs.rest/v3"})(i,t,a);if(s.error)throw new Error;return s}catch(o){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(o,t),{error:o}}},endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:e,title:t,notification:a})=>{const r=new Blob([e],{type:"text/html"}),o=new FormData;return o.append("file",r,"base.html"),o.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:o,notification:a}}}),deleteTemporaryMail:e.mutation({query:({id:e,notification:t})=>({url:`/${e}?resource=exportPngApi`,method:"DELETE",notification:t})})})}),{useMakeTemporaryMailForPngMutation:n,useDeleteTemporaryMailMutation:u}=s},62677:(e,t,a)=>{a.d(t,{C:()=>i,N:()=>s});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"webHookApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:e,body:t})=>({url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t})})})}),{usePostDataByWebHookMutation:s}=i},35317:(e,t,a)=>{a.d(t,{O:()=>s,y:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"getCheckoutUrlApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:e=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:e})})})}),{useGetCheckoutUrlMutation:s}=i},141:(e,t,a)=>{a.d(t,{k:()=>i,x:()=>s});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"googleAuthApi",baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api//wp-json/auth/v1/google/callback"}),endpoints:e=>({validateGoogleToken:e.mutation({query:e=>({url:"",method:"POST",body:e})})})}),{useValidateGoogleTokenMutation:s}=i},48426:(e,t,a)=>{a.d(t,{N:()=>s,m:()=>n});var r=a(31052),o=a(33298),i=a(32269);const s=(0,o.xP)({reducerPath:"htmlToPdfPlusApi",baseQuery:async(e,t,a)=>{try{const{notification:o,...i}=e,s=await(0,r.cw)({baseUrl:"https://html2pdf.emcdn.ru/convert/html-to-pdf"})(i,t,a);if(s.error)throw new Error;return s}catch(o){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(o,t),{error:o}}},endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:e,notification:t})=>({url:"",method:"POST",body:e,notification:t,responseHandler:e=>e.blob()})})})}),{useGenerateHtmlToPdfMutation:n}=s},95679:(e,t,a)=>{a.d(t,{CL:()=>p,FQ:()=>c,Jg:()=>q,Mv:()=>h,eo:()=>w,gg:()=>I,h4:()=>_});var r=a(33298),o=a(78347),i=a(14315),s=a(44141),n=a(49211),u=a(85163),l=a(1383),d=a(33288);const p=(0,r.xP)({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(e,t){try{var a,r;const o=(null===(a=t.getState().configSlice)||void 0===a||null===(r=a.config)||void 0===r?void 0:r.imageInfoToolUrl)||"https://scr.emcdn.ru/imageinfo",i=await fetch(`${o}?url=${encodeURIComponent(e)}`);return{data:await i.json()}}catch(o){console.log(o)}}}),getSearchImage:e.query({queryFn:async function({query:e,page:t}){const a=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let r=`https://api.unsplash.com/search/photos?client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o&lang=ru&per_page=18&query=${a}&page=${t}`;""!==e.color&&(r+=`&color=${e.color}`),""!==e.orientation&&(r+=`&orientation=${e.orientation}`);const o=await fetch(r);return{data:await o.json()}}catch(r){console.log(r)}}}),getUnsplashImage:e.query({queryFn:async function(e){try{const t=await fetch(`${e}&client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o`);return{data:await t.json()}}catch(t){console.log(t)}}}),sendAiImageRequest:e.query({queryFn:async function({body:e},t){try{const a=(0,s.KU)(t);return await a.saveFile.ai_create(e,{type:i.cM.FormData})}catch(a){throw new Error(a)}}}),getAiImage:e.query({queryFn:async function(e,t){try{const a=(0,s.KU)(t);return await a.saveFile.ai_status_list(e)}catch(a){console.log(a)}}}),getAiImageSSE:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({task_id:e,entity_id:t,setError:a},r){const{updateCachedData:i,cacheEntryRemoved:p}=r;let c=(0,s.KU)(r).baseUrl.indexOf("emailmaker")>=0?u.Rn.maker:u.Rn.blocks;const m=u.EW.isPlugin?await d.di.getInstance(r,l.Y):n.A.get(u.A9.em_token),y=m?{Authorization:`Bearer ${m}`}:{},_=new o.EventSourcePolyfill(` ${c}/wp-json/ai-generator/v1/ai-status?entity_id=${t}&stream=1&task_id=${e}`,{headers:y});_.onmessage=e=>{const t=JSON.parse(e.data);i((e=>{e.push(t)})),100===t.progress&&_.close()},_.onerror=e=>{_.close()},await p,_.close()}}),getSearchGif:e.query({queryFn:async function({query:e,page:t}){const a=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let e=`https://api.giphy.com/v1/gifs/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${a}&limit=25&offset=${t}&lang=en`;const r=await fetch(e);return{data:await r.json()}}catch(r){console.log(r)}}})})}),{useLazyGetImageInfoQuery:c,useGetImageInfoQuery:m,useGetSearchImageQuery:y,useLazyGetSearchImageQuery:_,useSendAiImageRequestQuery:g,useLazySendAiImageRequestQuery:h,useGetAiImageQuery:f,useLazyGetAiImageQuery:b,useGetUnsplashImageQuery:v,useLazyGetUnsplashImageQuery:q,useGetSearchGifQuery:k,useLazyGetSearchGifQuery:w,useGetAiImageSSEQuery:T,useLazyGetAiImageSSEQuery:I}=p},94381:(e,t,a)=>{a.d(t,{Ad:()=>n,HO:()=>p,Yj:()=>d});var r=a(33298),o=a(31052),i=a(44141);const s="LOCALES",n=(0,r.xP)({reducerPath:"localesApi",tagTypes:[s],baseQuery:(0,o.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/translations/v1"}),endpoints:e=>({getLocale:e.query({async queryFn({id:e},t){const a=(0,i.KU)(t);try{return await a.translations.get_translations3(e,"react_app")}catch(r){return console.log(r),a.translations.get_translations3("en_US","react_app")}},providesTags:(e,t,a)=>[{type:s,id:a}]}),getLocales:e.query({queryFn:function(e,t){return(0,i.KU)(t).translations.get_translations2("react_app")},providesTags:(e,t,a)=>[{type:s,id:a}]})})}),{useGetLocalesQuery:u,useGetLocaleQuery:l,useLazyGetLocaleQuery:d,useLazyGetLocalesQuery:p}=n},91967:(e,t,a)=>{a.d(t,{V:()=>i,v:()=>s});var r=a(814),o=a(71210);function i({id:e,title:{rendered:t}={rendered:""},type:a,guid:i,acf:{lock:s,subject:n,description:u,html:l,project:d,tags:p,utm_parameters:c,parent_email:m,common_styles:y,is_template:_},author:g,...h}){return{...h,id:(0,r.WY)(e),author:(0,r.WY)(g),title:t,lock:s,renderGuid:(0,o.l)(),description:u,html:l,project:(0,r.pT)(d)?d.ID:d,project_author:(0,r.pT)(d)?d.post_author:void 0,project_title:(0,r.pT)(d)?d.post_title:void 0,tags:p,utm_parameters:c,parent_email:(0,r.WY)(m instanceof Array&&m[0]?m[0].ID:m),common_styles:y,is_template:_}}function s({title:e,lock:t,subject:a,description:o,html:i,project:s,tags:n,renderGuid:u,utm_parameters:l,parent_email:d,common_styles:p,is_template:c,author:m,...y}){return{...y,author:(0,r.mQ)(m),title:e,acf:{lock:t,description:o,html:i,project:s,tags:n,utm_parameters:l,parent_email:(0,r.mQ)(d),common_styles:p,is_template:c}}}},814:(e,t,a)=>{function r(e,t=!1){const a={};for(const o of Object.keys(e)){let i=e[o];void 0===i||"number"===typeof i&&Number.isNaN(i)||(t&&"object"===typeof i&&null!==i&&(i=r(i)),a[o]=i)}return a}function o(e){return"object"===typeof e&&e}function i(e){const t=Number(e);return isNaN(t)?e:t}function s(e){return"number"===typeof e?String(e):e}a.d(t,{TB:()=>r,WY:()=>s,mQ:()=>i,pT:()=>o})},62689:(e,t,a)=>{a.d(t,{vx:()=>l,I9:()=>d,bw:()=>p});var r=a(33298),o=a(14315),i=a(31770);function s({title:e,acf:{seen:t,type:a},...r}){return{...r,seen:t,type:a,title:e.rendered}}var n=a(44141);const u="Notifications",l=(0,r.xP)({reducerPath:"notificationsApi",tagTypes:[u],baseQuery:(0,n.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn:(e,t)=>(0,n.KU)(t).wp.notification_list({author:[Number(e)]}).then((0,i.Ih)(s)),providesTags:e=>e?[...e.map((({id:e})=>({type:u,id:e}))),{type:u,id:"LIST"}]:[{type:u,id:"LIST"}]}),notificationShown:e.mutation({queryFn:({id:e,datetime:t},a)=>(0,n.KU)(a).wp.notification_create2(e,{},{type:o.cM.Json,extraQuery:{"acf[seen]":t}}).then((0,i.SC)(s)),invalidatesTags:[{type:u,id:"LIST"}]})})}),{useGetNotificationsQuery:d,useNotificationShownMutation:p}=l},88528:(e,t,a)=>{a.d(t,{Ju:()=>u,Sr:()=>l,ku:()=>n,tO:()=>s});var r=a(33298),o=a(44141);const i="Optimise",s=(0,r.xP)({reducerPath:"optimiseApi",tagTypes:[i],baseQuery:async(e,t,a)=>{const r=(0,o.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),i=(0,o.hI)({baseUrl:`${r}/optimization/v1/validate`});let s=await i(e,t,a);if(s.error){let e=s.error;if("function"===typeof e.json)try{e=await e.json()}catch{e=await e,console.log("error",e)}return{error:e}}return s},endpoints:e=>({editLinks:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:e}),invalidatesTags:[i]}),editImages:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:e})}),editSpam:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:e})})})}),{useEditLinksMutation:n,useEditImagesMutation:u,useEditSpamMutation:l}=s},84568:(e,t,a)=>{a.d(t,{Nq:()=>p,lD:()=>y,OD:()=>_,fo:()=>m,su:()=>c});var r=a(33298),o=a(14315),i=a(31770),s=a(814);function n({title:{rendered:e}={rendered:""},acf:{members:t,projects_test_emails:a,ftp_settings:r,emails:o,blocks:i,webhook:n},...u}){return{...u,title:e,members:(0,s.pT)(t)?{admins:t.admins&&t.admins.map((e=>({...e,ID:(0,s.WY)(e.ID)}))),users:t.users&&t.users.map((e=>({...e,ID:(0,s.WY)(e.ID)}))),invited_users:t.invited_users&&t.invited_users.map((e=>({...e,ID:(0,s.WY)(e.ID)}))),owner:(0,s.pT)(t.owner)?{...t.owner,ID:(0,s.WY)(t.owner.ID)}:t.owner}:void 0,projects_test_emails:a,ftp_settings:r,webhook:n,emails:o,blocks:i}}function u({title:e,members:t,projects_test_emails:a,ftp_settings:r,webhook:o,emails:i,blocks:n,...u}){const l=e=>({ID:(0,s.mQ)(e.ID||e)}),d=e=>{return(t=e,Array.isArray(t)?t:t?[t]:[]).map(l);var t};return{...u,title:e,acf:{members:t&&{admins:d(t.admins),users:d(t.users),invited_users:d(t.invited_users),owner:t.owner&&l(t.owner)},webhook:o,projects_test_emails:a,ftp_settings:r,emails:i,blocks:n}}}var l=a(44141);const d="Projects",p=(0,r.xP)({reducerPath:"projectsApi",tagTypes:[d,"project"],baseQuery:(0,l.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getProjects:e.query({queryFn(e={page:1},t){const a=(0,l.KU)(t),r={status:["private"]};return e.page&&(r.page=e.page),e.order&&(r.order=e.order),e.orderby&&(r.orderby=e.order),a.wp.project_list(r).then((0,i.Ih)(n))},providesTags:e=>e?[...e.map((({id:e})=>({type:d,id:e}))),{type:d,id:"LIST"}]:[{type:d,id:"LIST"}]}),getProject:e.query({queryFn:(e,t)=>(0,l.KU)(t).wp.project_detail({id:e},{extraQuery:{_embed:"wp:term"}}).then((0,i.SC)(n)),providesTags:(e,t,a)=>[{type:"project",id:a}]}),addProject:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.project_create({status:"private",...u(e)},{type:o.cM.Json}).then((0,i.SC)(n)),invalidatesTags:[{type:d,id:"LIST"}]}),editProject:e.mutation({queryFn({projectId:e,...t},a){const r=(0,l.KU)(a),d=(0,s.TB)(u(t),!0);return r.wp.project_partial_update(e,d,{type:o.cM.Json}).then((0,i.SC)(n))},invalidatesTags:(e,t,{projectId:a})=>[{type:d,id:a}]}),deleteProject:e.mutation({queryFn:(e,t)=>(0,l.KU)(t).wp.project_delete(e,{}).then((0,i.PI)(n)),invalidatesTags:(e,t,a)=>[{type:d,id:a}]})})}),{useGetProjectsQuery:c,useGetProjectQuery:m,useAddProjectMutation:y,useEditProjectMutation:_}=p},15865:(e,t,a)=>{a.d(t,{So:()=>i});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"promoApi",baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:e,type:t},a)=>(0,o.KU)(a).promo.set_code_create({code:e,type:t})}),getPromoInfo:e.query({queryFn:({code:e},t)=>(0,o.KU)(t).promo.get_code_info_list({code:e})})})}),{useCheckPromoMutation:s,useGetPromoInfoQuery:n}=i},46312:(e,t,a)=>{a.d(t,{Z8:()=>i,mI:()=>n});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:e,tryFetch:t=!0,type:a},r){const i=(0,o.KU)(r),s=t?fetch(e):Promise.reject(),n=e=>(e=>{switch(a){case"json":return e.json();case"text":return e.text();default:return e.blob()}})(e).then((e=>({data:e})));return s.then((e=>n(e))).catch((()=>i.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(e)}})))}})})}),{useGetFileQuery:s,useLazyGetFileQuery:n}=i},65119:(e,t,a)=>{a.d(t,{Lv:()=>u,kg:()=>l,yR:()=>n});var r=a(33298),o=a(31052),i=a(14315),s=a(39217);const n=(0,r.xP)({reducerPath:"recoverPasswordApi",baseQuery:(0,o.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:e=>({resetPassword:e.mutation({queryFn:(e,t)=>(0,s.mg)(t).bdpwr.reset_password_create({body:e,type:i.cM.Json})}),setPassword:e.mutation({queryFn:(e,t)=>(0,s.mg)(t).bdpwr.set_password_create({body:e,type:i.cM.Json})}),validateRecoverPasswordCode:e.mutation({queryFn:(e,t)=>(0,s.mg)(t).bdpwr.validate_code_create({body:e,type:i.cM.Json})})})}),{useResetPasswordMutation:u,useSetPasswordMutation:l,useValidateRecoverPasswordCodeMutation:d}=n},76793:(e,t,a)=>{a.d(t,{Cl:()=>s,KA:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:e=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${e.sid}&user_id=${e.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:s,useGetCanselRecurrenceQuery:n}=i},843:(e,t,a)=>{a.d(t,{IJ:()=>s,Sd:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:e=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${e.sid}&user_id=${e.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:s,useGetRecurrenceQuery:n}=i},40869:(e,t,a)=>{a.d(t,{E:()=>s,M:()=>i});var r=a(33298),o=a(31052);const i=(0,r.xP)({reducerPath:"requestPlaneApi",baseQuery:(0,o.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:e=>({url:`?proxy_url=${encodeURIComponent("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8")}`,method:"POST",body:e})})})}),{useGetRequestMutation:s}=i},63531:(e,t,a)=>{a.d(t,{Zf:()=>l,dS:()=>n,lg:()=>u,tb:()=>d,yH:()=>s});var r=a(33298),o=a(14315),i=a(44141);const s=(0,r.xP)({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.upload_create(e,{type:o.cM.FormData})}),sendTestEmail:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.send_email_create(e,{type:o.cM.FormData})}),sendLivePreview:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.get_link_create(e,{type:o.cM.FormData})}),sendShortLink:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.shortener_create(e,{type:o.cM.FormData})})})}),{useUploadImageMutation:n,useSendTestEmailMutation:u,useSendLivePreviewMutation:l,useSendShortLinkMutation:d}=s},93563:(e,t,a)=>{a.d(t,{$s:()=>g,CE:()=>p,JI:()=>c,Jz:()=>n,Lh:()=>d,Oo:()=>u,Yb:()=>_,f1:()=>y,kE:()=>s,y$:()=>l});var r=a(33298),o=a(44141);const i=()=>window.location.toString().includes("/blocks")?"block":"",s=(0,r.xP)({reducerPath:"taxonomiesApi",tagTypes:["Taxonomies","folder","block_folder","Group"],baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({addFolder:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"folder_create"](e).then((e=>e))}),editFolder:e.mutation({queryFn:({id:e,data:t},a)=>(0,o.KU)(a).wp[i()+"folder_partial_update"](e,t).then((e=>e))}),deleteFolder:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"folder_delete"](e,{force:!0}).then((e=>e))}),getFolders:e.query({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"folder_list"]({per_page:100,...e}).then((e=>e)),providesTags:(e,t,a)=>[{type:"folder",id:a}]}),addGroup:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"group_create"](e).then((e=>e))}),editGroup:e.mutation({queryFn:({id:e,data:t},a)=>(0,o.KU)(a).wp[i()+"group_partial_update"](e,t).then((e=>e))}),getGroups:e.query({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"group_list"]({per_page:100,...e}).then((e=>e)),providesTags:(e,t,a)=>[{type:"Group",id:a}]}),deleteGroup:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp[i()+"group_delete"](e,{force:!0}).then((e=>e))}),addEmailsTag:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp.emailtags_create(e).then((e=>e))}),editEmailsTag:e.mutation({queryFn:({id:e,...t},a)=>(0,o.KU)(a).wp.emailtags_partial_update(e,t).then((e=>e))}),deleteEmailsTag:e.mutation({queryFn:(e,t)=>(0,o.KU)(t).wp.emailtags_delete(e,{force:!0}).then((e=>e))}),getTags:e.query({queryFn:(e,t)=>(0,o.KU)(t).wp[(window.location.toString().includes("/blocks")?"block":"email")+"tags_list"]({per_page:100,...e}).then((e=>e))})})}),{useGetFoldersQuery:n,useGetGroupsQuery:u,useLazyGetGroupsQuery:l,useDeleteGroupMutation:d,useEditGroupMutation:p,useAddGroupMutation:c,useGetTagsQuery:m,useLazyGetFoldersQuery:y,useAddFolderMutation:_,useEditFolderMutation:g}=s},83351:(e,t,a)=>{a.d(t,{OV:()=>s,UH:()=>u,uX:()=>n});var r=a(33298),o=a(14315),i=a(44141);const s=(0,r.xP)({reducerPath:"tokenApi",baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).jwtAuth.token_create({body:e,type:o.cM.Json})}),tokenValidate:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).jwtAuth.token_validate_create({type:o.cM.Json})})})}),{useTokenCreateMutation:n,useTokenValidateMutation:u}=s},1779:(e,t,a)=>{a.d(t,{S:()=>i,p:()=>s});var r=a(33298),o=a(44141);const i=(0,r.xP)({reducerPath:"yandexAuthApi",baseQuery:(0,o.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/auth/v1/yandex/callback"}),endpoints:e=>({validateYandexToken:e.mutation({query:e=>({url:"",method:"POST",body:e})})})}),{useValidateYandexTokenMutation:s}=i}}]);
|