useblocks 1.0.53 → 1.0.55
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 +26 -24
- package/iframe/{iframe-eblock.7a0826f769e0c947abac.html → iframe-eblock.b2ba57989a9db2fc2512.html} +1 -1
- package/iframe/{iframe.7a0826f769e0c947abac.html → iframe.b2ba57989a9db2fc2512.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 +271 -265
- 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/css/{3062.7bbda02d.css → 2055.ff0d5406.css} +1 -1
- package/static/css/{5211.8f70ec84.css → 5211.45142985.css} +1 -1
- package/static/css/{8995.3b37ba81.css → 8995.d8d44365.css} +1 -1
- package/static/js/2055.6ae7ef83.js +1 -0
- package/static/js/{2151.5464acc0.js → 2151.f56d5003.js} +1 -1
- package/static/js/{8903.4dff2b06.js → 2939.a3a63d69.js} +1 -1
- package/static/js/3430.c5d049ac.js +1 -0
- package/static/js/5211.35c411f1.js +1 -0
- package/static/js/756.d91d940e.js +1 -0
- package/static/js/7883.4f3835e6.js +1 -0
- package/static/js/{8458.adf5921e.js → 8458.fd859f69.js} +1 -1
- package/static/js/{8995.d541ce63.js → 8995.ef39fca4.js} +1 -1
- package/static/js/{useblocks_core.51e2098c.js → useblocks_core.607ff647.js} +1 -1
- package/translations.pot +218 -195
- package/useblocks-esm.js +1 -1
- package/useblocks.d.ts +120 -99
- package/useblocks.js +1 -1
- package/webpack/index.js +1 -2
- package/iframe/429.js +0 -1
- package/static/js/3062.feebdd6a.js +0 -1
- package/static/js/3430.175754d6.js +0 -1
- package/static/js/5211.6a4348c2.js +0 -1
- package/static/js/756.90f4df28.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
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),k=s(68631),S=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://help.useblocks.io/docs/knowledge-center/",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.jsx)(_.N_,{to:Z,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"40px",marginLeft:"8px"},children:(0,F.jsxs)("b",{children:[(0,F.jsx)("span",{className:"letters",children:"b"}),(!e||s)&&(0,F.jsxs)("span",{className:"hidden-text",children:["l",(0,F.jsx)("em",{children:"o"}),"cks"]})]})}),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)(k.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)(S.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),[k,S]=(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&&k,defaultCollapsed:!0,reverseArrow:!w&&!k||w&&!k,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&&S(!0):S(!e),N(!w)},onMouseEnter:()=>!w&&S(!1),onMouseLeave:()=>!w&&S(!0),children:(0,F.jsx)(B,{isMenuCollapsed:k,setIsMenuCollapsed:S,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"),k=e("user"),S=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===k){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===k){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===k){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===k&&s.id!==a.ID||!r&&!n&&a.role===S?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===S?"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 k=s(20757),S=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,S.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)(k.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:()=>k});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 k=({email:e,readOnly:t,setOtherUsers:s})=>{const o=(0,v.fn)(),_=(0,j.ml)(f.A.ON_CODE_VALIDATE_ID),k=(0,l.XW)(),S=(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:S,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,t]),(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();k({operation:g.Ru.UPDATE_EDITOR_POSITION_FROM_EDITOR,data:s.getOffsetAt(e)})}})(e.getPosition())})),e.onDidBlurEditorWidget((()=>{k({operation:g.Ru.EDITOR_CHANGE_FOCUS,data:!1}),L((0,u.YT)(!1))})),e.onDidFocusEditorWidget((()=>{k({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:()=>J});var i=s(92810),r=s(64617),n=s(45934),a=s(38883),l=s.n(a),o=s(46950),d=s(76662),c=s(81e3),m=s(66522),u=s(71086),p=s(2018),h=s(7744),g=s(43005),_=s(29234),v=s(57806),x=s(67661),j=s(66726),f=s(31022),y=s(3329),A=s(13932),b=s(69825),w=s(58133),N=s(88528),k=s(65983),S=s(84568),I=s(32269),C=s(71157),T=s(45695),E=s(93982),L=s(56991),z=s(23287),D=s(32411),O=s(13522),M=s(85163),R=s(70082);const{Text:F,Link:B,Title:P}=d.A,H="Links",q="Images",$="Spam assassin",V="Problems",W="valid",U="warnings",X="errors",Y=[W,X,U],Z=({summary:e,__:t,selectedTags:s,setSelectedTags:i})=>(0,R.jsx)(P,{level:5,style:{margin:0,fontSize:"14px"},children:(0,R.jsx)(c.A,{style:{flexWrap:"wrap"},gap:"6",children:Y.map(((r,n)=>(0,R.jsxs)(m.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:l()(`${r} optimise__button`,{[`${r}_active`]:s.includes(r)}),children:[t(r===W?"Valid":r===U?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[r])||0]},r+n)))})}),J=()=>{var e,t,s,a,d,c,m;const{__:Y}=(0,z.s9)(),J=(0,n.wA)(),G=(0,D.fn)(),K=(0,L.rD)(),Q=(0,C.hN)(),{emailId:ee,projectId:te}=(0,r.g)(),se=(0,T.QC)(),ie=(0,n.d4)(k.rd),re=(0,E.ml)(O.A.ON_LIMIT_ID),[ne,ae]=(0,N.Sr)(),[le,oe]=(0,N.ku)(),[de,ce]=(0,N.Ju)(),{data:me,isSuccess:ue,refetch:pe}=(0,S.fo)(+te,{skip:!!M.EW.isPlugin||!+te}),{limits:he}=M.EW.isPlugin?K.limits?K:{limits:{optimization_limit:0}}:me||{limits:{optimization_limit:0}},{optimization_limit:ge}=he,[_e,ve]=(0,i.useState)(),[xe,je]=(0,i.useState)([]),[fe,ye]=(0,i.useState)([]),[Ae,be]=(0,i.useState)([]),[we,Ne]=(0,i.useState)([]),[ke,Se]=(0,i.useState)(0),[Ie,Ce]=(0,i.useState)([]),[Te,Ee]=(0,i.useState)([]),Le=ke>=ge&&ge>0,ze=!(!K.limits||!K.counters)&&M.EW.isPlugin,De=(0,i.useCallback)((()=>{re.fire({name:"OptimizationCount",count:ke+1})}),[re,ke]);(0,i.useEffect)((()=>{var e,t;ze?Se((null===K||void 0===K||null===(e=K.counters)||void 0===e?void 0:e.optimization_counter)||0):ue&&(null===me||void 0===me||null===(t=me.counters)||void 0===t?void 0:t.optimization_counter)&&Se(me.counters.optimization_counter)}),[ze,me,ue,K]),(0,i.useEffect)((()=>{var e,t;_e===H&&Ie.links&&ye(xe.length>0?null===(e=Ie.links)||void 0===e?void 0:e.filter((e=>xe.includes(e.status))):Ie.links);_e===q&&Te.images&&be(xe.length>0?null===(t=Te.images)||void 0===t?void 0:t.filter((e=>xe.includes(e.status))):Te.images)}),[Ie.links,Te.images,xe,_e]);const Oe=()=>{if(!ee)return void Q.error({message:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;ze&&(Se((e=>e+1)),De());const t=G.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})),se.send({operation:"sandbox_set_attr_to_links"}),le({entity_id:ee,data:i}).then((({data:t,error:s})=>{if(s)(0,I.p6)({error:s},Q);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)?W:(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?U:X};e={links:s.map((e=>({...e,text:r[e.linkId],status:i(e)}))),summary:{valid:s.filter((e=>i(e)===W)).length||0,warnings:s.filter((e=>i(e)===U)).length||0,errors:s.filter((e=>i(e)===X)).length||0}},Ce(e),(0,I.wB)(Y("Links validation was successfully completed"),Q),!M.EW.isPlugin&&pe()}else t.statusCode>300||!t.success?(0,I.p6)({error:{data:t}},Q):Q.error({message:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!Ie.links&&Fe("")})).catch((e=>{(0,I.p6)({error:e},Q)}))},Me=()=>{if(!ee)return void Q.error({message:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});ze&&(Se((e=>e+1)),De());const e=G.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let s={};t.querySelectorAll("img").forEach(((e,t)=>s[`image_${t}`]=e.src)),se.send({operation:"sandbox_set_attr_to_images"}),de({entity_id:ee,data:s}).then((({data:e,error:t})=>{let s;if(t)(0,I.p6)({error:t},Q);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?W:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?U:X;s={images:t.map((e=>({...e,status:r(e)})))||[],summary:{valid:t.filter((e=>r(e)===W)).length||0,warnings:t.filter((e=>r(e)===U)).length||0,errors:t.filter((e=>r(e)===X)).length||0},summaryTime:{value:(i>1200?i/1e3:i).toFixed(1),name:Y(i>1200?"MB":"KB")}},s&&Ee(s),(0,I.wB)(Y("Images validation was successfully completed"),Q),!M.EW.isPlugin&&pe()}else{var i;e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},Q):Q.error({message:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===Te||void 0===Te||null===(i=Te.images)||void 0===i||!i.length)&&Fe("")}})).catch((e=>{(0,I.p6)({error:e},Q)}))},Re=()=>{ee?(ze&&(Se((e=>e+1)),De()),ne({entity_id:ee,data:{html:G.getValue()}}).then((({data:e,error:t})=>{if(t)(0,I.p6)({error:t},Q);else if(e&&e.success){const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort(((e,t)=>e.score-t.score)),Ne({...e.result,report:t})),(0,I.wB)(Y("Spam validation was successfully completed"),Q),!M.EW.isPlugin&&pe()}else e.statusCode>300||!e.success?(0,I.p6)({error:{data:e}},Q):Q.error({message:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}}),placement:"bottomRight"}),(null===we||void 0===we||!we.length)&&Fe("")})).catch((e=>{(0,I.p6)({error:e},Q)}))):Q.error({message:(0,R.jsx)("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},Fe=e=>{ve(e!==_e?e:""),je([])};let Be=null;return(0,i.useEffect)((()=>{ge>0&&ke>=+ge&&Q.error({message:Y("The usage limit has been exceeded"),description:Y("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[ke,ge,Y,Q]),(0,R.jsxs)("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize",children:[ze&&(0,R.jsx)(o.A,{counter:ke,limits:ge}),K.optimizeLinksEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,R.jsxs)(p.A,{gutter:10,align:"middle",children:[(0,R.jsx)(h.A,{span:20,children:(0,R.jsx)("div",{className:"form-group-title",children:Y("Links validation")})}),(0,R.jsx)(h.A,{span:4,align:"right",children:(0,R.jsx)(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Fe(H),null!==Ie&&void 0!==Ie&&null!==(e=Ie.links)&&void 0!==e&&e.length||_e===H||Oe()},loading:oe.isLoading,disabled:Le&&!(null!==Ie&&void 0!==Ie&&null!==(e=Ie.links)&&void 0!==e&&e.length),children:!oe.isLoading&&(_e===H?(0,R.jsx)(f.A,{}):(0,R.jsx)(y.A,{}))})})]}),_e===H&&!(null===Ie||void 0===Ie||!Ie.links)&&(0===(null===Ie||void 0===Ie||null===(t=Ie.links)||void 0===t?void 0:t.length)?(0,R.jsx)(p.A,{style:{marginBottom:24},children:(0,R.jsx)(_.A,{message:Y("No links found."),type:"info"})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p.A,{style:{marginBottom:14},children:(0,R.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,R.jsx)(Z,{__:Y,summary:Ie.summary,setSelectedTags:je,selectedTags:xe}),(0,R.jsx)(g.Ay,{disabled:Le,loading:oe.isLoading,onClick:Oe,icon:(0,R.jsx)(A.A,{}),children:Y("Refresh")})]})}),(0,R.jsx)(p.A,{style:{marginBottom:24},children:(0,R.jsx)(h.A,{span:24,children:(0,R.jsx)(v.A,{itemLayout:"horizontal",dataSource:fe,renderItem:(e,t)=>{var s;return(0,R.jsx)(v.A.Item,{style:{border:"none"},children:(0,R.jsx)(v.A.Item.Meta,{avatar:e.status===W?(0,R.jsx)(b.A,{className:W}):e.status===U?(0,R.jsx)(b.A,{className:U}):(0,R.jsx)(w.A,{className:X}),title:(0,R.jsx)(B,{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 se.send({operation:M.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:s}});var t,s},children:""===e.url?Y("empty link"):e.url}),description:(0,R.jsxs)(R.Fragment,{children:[!(null===(s=e.text)||void 0===s||!s.length)&&(0,R.jsx)(F,{type:"secondary",children:e.text}),e.page.title&&e.page.title,e.page.secure&&e.status===W&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,R.jsx)("span",{className:W,children:Y("secure")})]}),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("span",{className:"image-size-splitter",children:"\xa0\u2022\xa0"}),(0,R.jsx)(F,{type:"secondary",children:Y("Failed to load")})]})]})})},t+"_"+e.id)}})})})]}))]}),K.optimizeImagesEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,R.jsxs)(p.A,{gutter:10,align:"middle",children:[(0,R.jsx)(h.A,{span:20,children:(0,R.jsx)("div",{className:"form-group-title",children:Y("Images validation")})}),(0,R.jsx)(h.A,{span:4,align:"right",children:(0,R.jsx)(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;Fe(q),null!==Te&&void 0!==Te&&null!==(e=Te.images)&&void 0!==e&&e.length||_e===q||Me()},loading:ce.isLoading,children:!ce.isLoading&&(_e===q?(0,R.jsx)(f.A,{}):(0,R.jsx)(y.A,{}))})})]}),_e===q&&!(null===Te||void 0===Te||!Te.images)&&(0===(null===Te||void 0===Te||null===(s=Te.images)||void 0===s?void 0:s.length)?(0,R.jsx)(p.A,{style:{marginBottom:24},children:(0,R.jsx)(_.A,{message:Y("No images found."),type:"info"})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(p.A,{style:{marginBottom:16},children:(0,R.jsx)(_.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:(0,R.jsxs)("div",{className:"optimise__summary",children:[(0,R.jsxs)("div",{children:[(0,R.jsxs)(P,{level:4,style:{marginBottom:"0"},children:[Te.images.length," "]}),(0,R.jsx)("span",{style:{fontSize:"12px"},children:Y("images")})]}),(0,R.jsxs)("div",{children:[(0,R.jsxs)(P,{level:4,style:{marginBottom:"0"},children:[null===(a=Te.summaryTime)||void 0===a?void 0:a.value,null===(d=Te.summaryTime)||void 0===d?void 0:d.name]}),(0,R.jsx)("span",{style:{fontSize:"12px"},children:Y("total size")})]}),(0,R.jsxs)("div",{children:[(0,R.jsx)(P,{level:4,style:{marginBottom:"0"},children:(Math.max(...Te.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+Y("s")}),(0,R.jsx)("span",{style:{fontSize:"12px"},children:Y("time to load")})]})]}),type:"warning"})}),(0,R.jsx)(p.A,{style:{marginBottom:12},children:(0,R.jsxs)("div",{className:"optimise__title-wrapper",children:[(0,R.jsx)(Z,{__:Y,summary:Te.summary,setSelectedTags:je,selectedTags:xe}),(0,R.jsx)(g.Ay,{icon:(0,R.jsx)(A.A,{}),disabled:Le,loading:ce.isLoading,onClick:()=>Me(),children:Y("Refresh")})]})}),(0,R.jsx)(p.A,{style:{marginBottom:12},children:(0,R.jsx)(h.A,{span:24,children:(0,R.jsx)(v.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:Ae,renderItem:(e,t)=>(0,R.jsx)(v.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},children:(0,R.jsx)(v.A.Item.Meta,{className:l()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:(0,R.jsx)(x.A,{className:l()("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(Be);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&&(Be=setTimeout((()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout((function(){e.remove()}),300)}),300))})()}),title:e.url?(0,R.jsx)(j.A,{placement:"top",title:e.message,children:(0,R.jsx)(B,{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 se.send({operation:M.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:s}});var t,s},children:""===(null===e||void 0===e?void 0:e.url)?Y("empty src"):e.url})}):e.message,description:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"image-size",children:[e.image.dimensions&&(0,R.jsxs)(R.Fragment,{children:[e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,(0,R.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,R.jsxs)("span",{children:[Math.round(e.image.bytes/1024),Y("kB")]}),(0,R.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,R.jsxs)("span",{children:[e.image.responseTime,Y("ms")]}),(0,R.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,R.jsx)("span",{className:"image-size-format",children:e.image.contentType})]}),e.image.secure&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,R.jsx)("span",{className:W,children:Y("secure")})]}),e.resolvedUrl&&!e.valid&&(0,R.jsx)(F,{type:"danger",children:Y("not valid")})]})," ",!e.resolvedUrl&&!e.statusCode&&(0,R.jsx)(F,{type:"danger",children:Y("Failed to load")})]})})},t)})})})]}))]}),K.optimizeSpamAssassinEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,R.jsxs)(p.A,{gutter:10,align:"middle",children:[(0,R.jsx)(h.A,{span:20,children:(0,R.jsx)("div",{className:"form-group-title",children:Y("SpamAssassin")})}),(0,R.jsx)(h.A,{span:4,align:"right",children:(0,R.jsx)(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:ae.isLoading,onClick:()=>{var e;Fe($),null!==(e=we.report)&&void 0!==e&&e.length||Re()},disabled:Le&&!(null!==we&&void 0!==we&&null!==(c=we.report)&&void 0!==c&&c.length),children:!ae.isLoading&&(_e===$?(0,R.jsx)(f.A,{}):(0,R.jsx)(y.A,{}))})})]}),_e===$&&!(null===(m=we.report)||void 0===m||!m.length)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(p.A,{style:{marginBottom:8},children:[(0,R.jsxs)("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam",children:[(0,R.jsxs)(P,{level:1,style:{margin:0},type:we.spamScore<2||!we.spamScore||we.spamScore<=we.baseSpamScore-1?"success":we.spamScore<we.baseSpamScore-1?"warning":"danger",children:[(0,R.jsx)("span",{style:{marginRight:"12px"},children:we.spamScore||0}),(0,R.jsx)(F,{style:{marginRight:"12px",fontSize:"20px"},children:"Score"})]}),(0,R.jsx)(g.Ay,{disabled:Le,icon:(0,R.jsx)(A.A,{}),loading:ae.isLoading,onClick:Re,children:Y("Refresh")})]}),we.spamScore>we.baseSpamScore-1&&(0,R.jsx)(F,{children:Y("Lower scores are better. Aim for a score less than ")+(we.baseSpamScore-1)+"."})]}),(0,R.jsx)(p.A,{style:{marginBottom:8},children:(0,R.jsx)(h.A,{span:24,children:(0,R.jsx)(v.A,{itemLayout:"horizontal",dataSource:we.report,renderItem:e=>(0,R.jsx)(v.A.Item,{style:{border:"none"},children:(0,R.jsx)(v.A.Item.Meta,{title:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(F,{style:{fontSize:"20px"},children:e.score}),(0,R.jsx)("span",{style:{marginLeft:"12px"},children:e.description})]})})})})})})]})]}),K.optimizeCheckCodeEnabled&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),(0,R.jsxs)(p.A,{gutter:10,align:"middle",children:[(0,R.jsx)(h.A,{span:20,children:(0,R.jsx)("div",{className:"form-group-title",children:Y("Source code validation")})}),(0,R.jsx)(h.A,{span:4,align:"right",children:(0,R.jsx)(g.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>Fe(V),children:_e===V?(0,R.jsx)(f.A,{}):(0,R.jsx)(y.A,{})})})]}),_e===V&&(0,R.jsx)(R.Fragment,{children:null!==ie&&void 0!==ie&&ie.length?(0,R.jsx)(p.A,{style:{marginBottom:8},children:(0,R.jsx)(h.A,{span:24,children:(0,R.jsx)(v.A,{itemLayout:"horizontal",dataSource:ie,renderItem:e=>(0,R.jsx)(v.A.Item,{style:{border:"none"},children:(0,R.jsx)(v.A.Item.Meta,{avatar:e.severity<6?(0,R.jsx)(w.A,{className:U}):(0,R.jsx)(w.A,{className:X}),title:(0,R.jsxs)(F,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};J((0,k.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,R.jsx)(F,{children:e.message})})})})})}):(0,R.jsx)(p.A,{style:{marginBottom:24},children:(0,R.jsx)(_.A,{message:Y("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),k=s(8375),S=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)(k.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)(S.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:k}=(0,r.g)(),S=(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||k,{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=S.onInit((()=>{S.send({operation:E.Ru.SANDBOX_LOCK_EDIT,data:t===Q}),S.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:ne})}));return()=>e.dispose()}),[t,I,ne,S]),(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((()=>{S.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(S.onInit((()=>{S.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,S]),(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);S.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(){S.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)),S.send({operation:E.Ru.SANDBOX_LOCK_DISCUSS,value:!ne})},Ne=()=>{C(le?Q:K),oe((e=>!e))};let ke=[{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:ke})}),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="useblocks.io",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:k,error:S,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&&S&&((0,o.p6)({error:S},s),(0,o.Id)(h))}),[I,b,S,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(k){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:()=>S});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:k}=r.A,S=()=>{var e,t,s;const{__:S}=(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)(S("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:S("Cards view"),placement:"top",children:(0,N.jsx)(l.A,{})})},{value:j.rl,label:(0,N.jsx)(a.A,{title:S("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)(k,{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),k=s(86286),S=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)(k.C1),G=(0,g.d4)(w.cL),K=(0,g.d4)(S.o8),Q=(0,g.d4)(S.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,S.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,S.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),k=s(32269),S=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,k.p6)(t,L):t.data&&(0,k.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,k.Yq)((0,f.A)(t),e),sorter:!0,sortOrder:(0,k.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)(S.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,k.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===S.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)(S.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===S.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}})},k={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}})},S={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:k.name,rules:k.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:k.prefix})}),(0,y.jsx)(a.A.Item,{name:S.name,rules:S.rules,children:(0,y.jsx)(l.A,{size:"large",disabled:E.isLoading,placeholder:S.placeholder,prefix:S.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 k=()=>{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:k,onCancel:b,className:"new-folder-name-modal",centered:!0,footer:[(0,h.jsx)(a.Ay,{type:"primary",size:"large",loading:N.isLoading,onClick:k,children:s("Change name")},"submit")],children:(0,h.jsx)(r.A,{form:v,layout:"vertical",name:"rename_folder_form",onFinish:k,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 k=()=>{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:k,onCancel:b,className:"new-group-name-modal",centered:!0,footer:[(0,h.jsx)(a.Ay,{type:"primary",size:"large",loading:N.isLoading,onClick:k,children:s("Change name")},"submit")],children:(0,h.jsx)(r.A,{form:v,layout:"vertical",name:"rename_group_form",onFinish:k,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"}})]})]})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[756],{7760:(e,a,l)=>{l.d(a,{A9:()=>p,Ay:()=>F,DL:()=>b,Dz:()=>c,Fv:()=>v,JV:()=>k,Up:()=>y,b9:()=>S,eX:()=>m,gm:()=>M,iy:()=>f,nJ:()=>E,om:()=>g,qX:()=>T,rc:()=>u,vs:()=>r});var t=l(90536),o=l(31770),i=l(55701);const d=(0,o.ur)({invalidateBlockId:null,isCodeMode:!1,codeModeDirection:"right",editorThemeColor:"light",isSettingsDisabled:!1,settings:{width:""},elementSettings:{},searchFilters:{},block:{id:void 0,isNew:!1,subject:"",description:"",html:"",project:void 0,project_title:"",project_author:void 0,tags:[],type:"Other",title:null,isAmp:!1},monacoDidMount:!1}),n="blockSlice",s=(0,t.createSlice)({name:n,initialState:d,reducers:{switchCodeMode:e=>{e.isCodeMode=!e.isCodeMode},setEditorThemeColor:(e,a)=>{e.editorThemeColor=a.payload},setBlockSettings:(e,a)=>{Object.assign(e,{...e,settings:a.payload,isSettingsDisabled:!1})},setBlockSettingsDisable:(e,a)=>{e.isSettingsDisabled=a.payload},setElementSettings:(e,a)=>{e.elementSettings=a.payload},setSearchFilters:(e,a)=>{e.searchFilters=a.payload},setBlockHtml:(e,a)=>{e.block.html=a.payload},resetBlockSlice:()=>d,setBlockIsAmp:(e,a)=>{e.block.isAmp=a.payload}},extraReducers:e=>{e.addMatcher((e=>"blocksApi/queries/queryResultPatched"===e.type),((e,a)=>{var l,t;const o=a.payload.queryCacheKey.match(/\(([0-9]+)\)/),i=null===(l=a.payload)||void 0===l?void 0:l.patches[0];if(null!==i&&void 0!==i&&null!==(t=i.path)&&void 0!==t&&t[0]&&(e.block[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==o&&void 0!==o&&o[1]&&(e.invalidateBlockId=o[1]),a.payload.queryCacheKey.startsWith("getBlock")){var d,n;const l=null===(d=a.payload)||void 0===d?void 0:d.patches[0];null!==l&&void 0!==l&&null!==(n=l.path)&&void 0!==n&&n[0]&&(e.block[null===l||void 0===l?void 0:l.path[0]]=l.value)}})),e.addMatcher((e=>"blocksApi/invalidateTags"===e.type),((e,a)=>{if(a.payload[0].id===+e.invalidateBlockId)return{...d,isCodeMode:null===e||void 0===e?void 0:e.isCodeMode,codeModeDirection:e.codeModeDirection}})),e.addMatcher(i.VM.endpoints.editBlock.matchFulfilled,((e,{payload:a})=>{e.invalidateBlockId=null,e.block={...e.block,...a,renderGuid:e.block.renderGuid}})),e.addMatcher(i.VM.endpoints.autoSaveBlock.matchFulfilled,((e,a)=>{var l,t;(null===e||void 0===e||null===(l=e.block.id)||void 0===l?void 0:l.toString())===(null===(t=a.payload.id)||void 0===t?void 0:t.toString())&&(e.block.html=a.payload.html)})),e.addMatcher(i.VM.endpoints.getBlock.matchFulfilled,((e,{payload:a})=>{e.block={...d.block,...a}}))}}),{switchCodeMode:r,setEditorThemeColor:m,setBlockSettings:c,setElementSettings:p,setBlockSettingsDisable:u,setSearchFilters:g,setBlockHtml:b,resetBlockSlice:E,setBlockIsAmp:h}=s.actions,v=e=>e[n].isCodeMode,y=e=>e[n].editorThemeColor,k=e=>e[n].settings,T=e=>e[n].elementSettings,f=e=>e[n].isSettingsDisabled,S=e=>e[n].searchFilters,M=e=>e[n].block,F=s},34524:(e,a,l)=>{l.d(a,{Ay:()=>k,D2:()=>g,FC:()=>c,NK:()=>p,NP:()=>E,dV:()=>y,jr:()=>b,qM:()=>h,ux:()=>v,wK:()=>u});var t=l(90536),o=l(55701),i=l(49211),d=l(85163);const n=(0,l(31770).ur)({blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:!d.EW.isPlugin&&i.A.get(d.A9.em_elements_view)||d.Y$,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]}),s="blocksPageSlice",r=(0,t.createSlice)({name:s,initialState:n,reducers:{resetPagesAndTotal:()=>n,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,a)=>{e.elementsView=a.payload},removeBlockFromList:(e,{payload:a})=>{var l;let t=e.customFolders;a.folder!==d.y2&&null!==(l=t[a.folder])&&void 0!==l&&l.list&&(t[a.folder]={...t[a.folder],list:t[a.folder].list.filter((e=>e.id!==a.emailId)),total:t[a.folder].total-1},e.customFolders=t)}},extraReducers:e=>{e.addMatcher(o.VM.endpoints.getBlocks.matchFulfilled,((e,{meta:a,payload:l})=>{var t,o,i,d,n,s,r,m;const c=(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"))||(null===l||void 0===l?void 0:l.length),p="trash"===(null===(o=a.arg.originalArgs)||void 0===o?void 0:o.status),u=!(null===(i=a.arg.originalArgs)||void 0===i||null===(d=i.name)||void 0===d||!d.length),g=null===(n=a.arg.originalArgs)||void 0===n?void 0:n.page,b=(null===(s=a.arg.originalArgs)||void 0===s?void 0:s.folderTag)||(null===(r=a.arg.originalArgs)||void 0===r||null===(m=r.tags)||void 0===m?void 0:m[0]);p?(u||(e.blocksTrashTotal=c),e.elementsTrashList=l):b?e.customFolders={...e.customFolders,[b]:{list:l,page:g,total:c}}:(a.arg.originalArgs.tags||u||(e.blocksTotal=c),e.elementsList=l)})),e.addMatcher(o.VM.endpoints.getParentEmailBlocks.matchFulfilled,((e,{meta:a})=>{var l,t;const o=null===(l=a.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-Total"),i=null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages");e.parentEmailBlocksTotal=o,e.parentEmailBlocksTotalPages=i})),e.addMatcher(o.VM.endpoints.getTemplateBlocks.matchFulfilled,((e,{meta:a,payload:l})=>{var t,o;const i=(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"))||null,d=null===(o=a.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages");e.templateBlocks=l,e.templateBlocksTotal=i,e.templateBlocksTotalPages=d})),e.addMatcher(o.VM.endpoints.editBlock.matchFulfilled,((e,{payload:a})=>{e.elementsList.map((e=>{var l,t;return(null===(l=e.id)||void 0===l?void 0:l.toString())===(null===(t=a.id)||void 0===t?void 0:t.toString())?Object.assign(e,{lock:a.lock,title:a.title,blocktags:a.blocktags}):e}))}))}}),{resetPagesAndTotal:m,resetElementsList:c,toggleElementsView:p,removeBlockFromList:u}=r.actions,g=e=>e[s].blocksTotal,b=e=>e[s].templateBlocksTotal,E=e=>e[s].customFolders,h=e=>e[s].elementsList,v=e=>e[s].elementsTrashList,y=e=>e[s].blocksTrashTotal,k=r},99751:(e,a,l)=>{l.d(a,{i:()=>i,$:()=>o});const t={pro:{config:{mode:"pro",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,styles:"",revisionService:!1,headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!0,formFieldBorderRadiusEnabled:!0,formFieldBoxShadowEnabled:!0,formFieldVisibilityEnabled:!0,formFieldExportAsPictureEnabled:!0,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}},editor:{config:{mode:"editor",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,webversionEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!0,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!1,editImageControlEnabled:!0,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!0,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},simple:{config:{mode:"simple",autosaveTimeout:1e4,theme:"",themes:{},mergeTags:void 0,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!0,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportZipEnabled:!0,exportClipboardEnabled:!0,exportWebHookEnabled:!0,exportOutlookEnabled:!1,exportPdfEnabled:!0,exportPngEnabled:!0,nextButtonEnabled:!1,nextButtonText:"",saveButtonEnabled:!0,saveButtonText:"",commandButtonsEnabled:!0,emailIdShow:!1,sidePanelFloating:!0,desktopMobileSwitchRule:!0,desktopMobileSwitchPanel:!1,onlyCodeModeInMobile:!1,pathEnabled:!0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!0,aiAssistentEnabled:!0,optimizeEnabled:!0,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!1,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!0,tagsEnabled:!0,isTemplateEnabled:!0,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!0,deleteButtonEnabled:!0,toggleSidePanel:!0,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!0,formFieldImageTitleEnabled:!0,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!0,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!0,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!0,elementCountdownEnabled:!1,elementVideoEnabled:!1,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}}},o=e=>{const a=t[e];return a||t.editor},i=["mode","formFieldBorderEnabled","formFieldBorderRadiusEnabled","formFieldBoxShadowEnabled","formFieldVisibilityEnabled","formFieldExportAsPictureEnabled","formButtonFieldInsertImageEnabled","formButtonFieldVerticalAlignEnabled","formButtonFieldTextAlignEnabled","formButtonFieldBackgroundImageEnabled","formButtonFieldPaddingsEnabled","formCellFieldVerticalAlignEnabled","formCellFieldBackgroundImageEnabled","formCellFieldPaddingsEnabled","formLinkFieldInsertImageEnabled","formTableFieldBackgroundImageEnabled","formDivFieldBackgroundImageEnabled","formEmailFieldBackgroundImageEnabled"]},53204:(e,a,l)=>{l.d(a,{Ay:()=>m,M:()=>r,YT:()=>s,rI:()=>n});var t=l(90536);const o=(0,l(31770).ur)({isCollapsed:!0,isMonacoFocusing:!1}),i="defaultModePanesSlice",d=(0,t.createSlice)({name:i,initialState:o,reducers:{setMonacoFocusing:(e,a)=>{e.isMonacoFocusing=a.payload},resetPanes:()=>o}}),{resetPanes:n,setMonacoFocusing:s}=d.actions,r=e=>e[i].isMonacoFocusing,m=d},65983:(e,a,l)=>{l.d(a,{A9:()=>u,AJ:()=>y,Ay:()=>R,Bj:()=>F,Bu:()=>B,CT:()=>x,G_:()=>p,HO:()=>h,Hs:()=>D,M7:()=>g,RC:()=>C,S_:()=>P,UI:()=>V,Up:()=>I,VK:()=>T,VO:()=>M,VZ:()=>G,Wm:()=>S,dH:()=>O,eX:()=>c,iy:()=>N,mD:()=>H,no:()=>f,om:()=>b,pl:()=>v,ps:()=>w,qX:()=>_,rY:()=>U,rd:()=>L,ry:()=>E,ss:()=>k,uJ:()=>j,zn:()=>A});var t=l(90536),o=l(31770),i=l(86739),d=l(93563),n=l(84568);const s=(0,o.ur)({invalidateEmailId:null,editorThemeColor:"light",isSettingsDisabled:!1,settings:{backgroundColor:"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",textStrong:!1,textItalic:!1,textUnderline:!1},elementSettings:{},searchFilters:{},emailCommonStyles:"",saveTime:null,mobileViewActive:{shutdown:!0,styles:!0},email:{id:void 0,is_inited:!1,isNew:!1,hasAmp:!1,subject:void 0,preheader:void 0,description:"",html:"",project:void 0,project_author:"",project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"",title:null,emailtags:[],group:[],isAmp:!1},emailIsEdit:!1,isCodeMode:!1,codeModeDirection:void 0,emailViewType:void 0,changeKey:null,problemsList:[],activeProblemRange:null,emailGroups:{},parentGroupOfProject:null,projectGroups:[],isNeedUpdateAppearance:!1,isNeedUpdateContentAppearance:!1}),r="emailSlice",m=(0,t.createSlice)({name:r,initialState:s,reducers:{setEditorThemeColor:(e,a)=>{e.editorThemeColor=a.payload},setEmailFromHistory:(e,{payload:a})=>{const l=e.email,t=void 0===(null===a||void 0===a?void 0:a.preheader),o=void 0===(null===a||void 0===a?void 0:a.subject);e.email={...l,html:null===a||void 0===a?void 0:a.html,preheader:t?l.preheader:null===a||void 0===a?void 0:a.preheader,subject:o?l.subject:null===a||void 0===a?void 0:a.subject,common_styles:void 0===(null===a||void 0===a?void 0:a.common_styles)?l.common_styles:null===a||void 0===a?void 0:a.common_styles},e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setEmailSettings:(e,{payload:a})=>{Object.assign(e,{...e,settings:{...a},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,a)=>{e.isSettingsDisabled=a.payload},setElementSettings:(e,{payload:a})=>{e.elementSettings=a},setSearchFilters:(e,a)=>{e.searchFilters=a.payload},updateSearchFilters:(e,a)=>{const l=e.searchFilters;e.searchFilters={...l,...a.payload}},setEmailHTML:(e,a)=>{e.email.html=a.payload},setEmailSubject:(e,a)=>{e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=a.payload),e.email.subject=a.payload},setEmailPreheader:(e,a)=>{e.email.preheader=a.payload},resetEmailSlice:e=>s,setEmailTitle:(e,a)=>{e.email.title=a.payload},setIsInited:(e,a)=>{e.email.is_inited=a.payload},setEmailIsAmp:(e,a)=>{e.email.isAmp=a.payload},setProblemsList:(e,a)=>{e.problemsList=a.payload},setActiveProblemRange:(e,a)=>{e.activeProblemRange=a.payload},setIsNeedUpdateContentAppearance:(e,a)=>{e.isNeedUpdateContentAppearance=a.payload},setIsNeedUpdateAppearance:(e,a)=>{e.isNeedUpdateAppearance=a.payload},setEmailGroups:(e,{payload:a})=>{const l=Object.keys(a)[0],t=e.emailGroups,o=e.parentGroupOfProject,i=e.projectGroups;let d={};var n;o&&i.length&&(null===(n=a[l])||void 0===n||n.forEach((e=>{const a=i.find((e=>e.id===+l));let t=null===a||void 0===a?void 0:a.children.find((a=>a.id===+e));t?(d.hasOwnProperty(a.id)||(d[a.id]=[]),d[a.id].push({label:t.name,value:t.id})):(d.hasOwnProperty(l)||(d[l]=[]),d[l].push({label:e,value:null}))})),0===a[l].length&&(d[l]=[]));e.emailGroups={...t,...d}}},extraReducers:e=>{e.addMatcher((e=>"emailsApi/queries/queryResultPatched"===e.type),((e,a)=>{var l,t;const o=a.payload.queryCacheKey.match(/\("([0-9]+)"\)/),i=null===(l=a.payload)||void 0===l?void 0:l.patches[0];null!==i&&void 0!==i&&null!==(t=i.path)&&void 0!==t&&t[0]&&(e.email[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==o&&void 0!==o&&o[1]&&(e.invalidateEmailId=o[1]),e.emailIsEdit=!0})),e.addMatcher((e=>"emailsApi/invalidateTags"===e.type),((e,a)=>{if(a.payload[0].id===+e.invalidateEmailId)return s})),e.addMatcher(i.GY.endpoints.editEmail.matchFulfilled,((e,{payload:a})=>{e.invalidateEmailId=null,e.email={...e.email,...a,renderGuid:e.email.renderGuid}})),e.addMatcher(i.GY.endpoints.autoSaveEmail.matchFulfilled,((e,a)=>{var l,t;(null===(l=e.email.id)||void 0===l?void 0:l.toString())===(null===(t=a.payload.id)||void 0===t?void 0:t.toString())&&(e.email.html=a.payload.html)})),e.addMatcher(i.GY.endpoints.getEmail.matchFulfilled,((e,{payload:a})=>{var l,t;e.email={...s.email,...a,is_inited:a.is_inited||(a.id===(null===(l=e.email)||void 0===l?void 0:l.id)?null===(t=e.email)||void 0===t?void 0:t.is_inited:s.email.is_inited)},e.emailIsEdit=!1})),e.addMatcher(d.kE.endpoints.getGroups.matchFulfilled,((e,{meta:a,payload:l})=>{const t=e.email.group,o=a.arg.originalArgs.parent,i=l;o&&(e.parentGroupOfProject=o,i.length>0&&(e.projectGroups=i));let d={};o&&t.length&&i.length&&(null===t||void 0===t||t.forEach((e=>{null===i||void 0===i||i.forEach((a=>{let l=a.children.find((a=>a.id===e));l&&(d.hasOwnProperty(a.id)||(d[a.id]=[]),d[a.id].push({label:l.name,value:l.id}))}))}))),e.emailGroups=d})),e.addMatcher(n.Nq.endpoints.getProject.matchFulfilled,((e,{meta:a,payload:l})=>{var t;e.parentGroupOfProject=(null===(t=l.group)||void 0===t?void 0:t[0])||null}))}}),{setEditorThemeColor:c,setEmailSettings:p,setElementSettings:u,setEmailSettingsDisable:g,setSearchFilters:b,updateSearchFilters:E,setEmailSubject:h,setEmailPreheader:v,setEmailHTML:y,resetEmailSlice:k,setEmailTitle:T,setEmailFromHistory:f,setIsInited:S,setEmailIsAmp:M,setProblemsList:F,setActiveProblemRange:w,setEmailGroups:B,setIsNeedUpdateAppearance:P,setIsNeedUpdateContentAppearance:C}=m.actions,A=e=>e[r].invalidateEmailId,I=e=>e[r].editorThemeColor,j=e=>e[r].settings,_=e=>e[r].elementSettings,N=e=>e[r].isSettingsDisabled,x=e=>e[r].searchFilters,D=e=>e[r].email,L=e=>e[r].problemsList,G=e=>e[r].activeProblemRange,U=e=>e[r].emailGroups,V=e=>e[r].projectGroups,O=e=>e[r].isNeedUpdateContentAppearance,H=e=>e[r].isNeedUpdateAppearance,R=m},94925:(e,a,l)=>{l.d(a,{Ay:()=>y,FC:()=>p,MY:()=>g,NK:()=>c,NP:()=>v,X:()=>u,aO:()=>h,ff:()=>m,qM:()=>b,ux:()=>E});var t=l(90536),o=l(86739),i=l(49211),d=l(85163);const n=(0,l(31770).ur)({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:!d.EW.isPlugin&&i.A.get(d.A9.em_elements_view)||d.Y$}),s="emailsPageSlice",r=(0,t.createSlice)({name:s,initialState:n,reducers:{resetPagesAndTotal:()=>n,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,a)=>{e.elementsView=a.payload},removeEmailFromList:(e,{payload:a})=>{var l;let t=e.customFolders;a.folder!==d.y2&&null!==(l=t[a.folder])&&void 0!==l&&l.list&&(t[a.folder]={...t[a.folder],list:t[a.folder].list.filter((e=>e.id!==a.emailId)),total:t[a.folder].total-1},e.customFolders=t)}},extraReducers:e=>{e.addMatcher(o.GY.endpoints.getEmails.matchFulfilled,((e,{meta:a,payload:l})=>{var t,o,i,d,n,s,r,m;const c=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"))||0,p="trash"===(null===(o=a.arg.originalArgs)||void 0===o?void 0:o.status),u=!(null===(i=a.arg.originalArgs)||void 0===i||null===(d=i.name)||void 0===d||!d.length),g=null===(n=a.arg.originalArgs)||void 0===n?void 0:n.page,b=(null===(s=a.arg.originalArgs)||void 0===s?void 0:s.folderTag)||(null===(r=a.arg.originalArgs)||void 0===r||null===(m=r.tags)||void 0===m?void 0:m[0]);p?(u||(e.emailsTrashTotal=c),e.elementsTrashList=l):b?e.customFolders={...e.customFolders,[b]:{list:l,page:g,total:c}}:(a.arg.originalArgs.tags||u||(e.emailsTotal=c),e.elementsList=l)})),e.addMatcher(o.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{meta:a,payload:l})=>{var t;const o=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-Total"))||0;e.elementsList=l,e.emailsTotal=o;const{projectGroup:i,projectId:d,tags:n}=a.arg.originalArgs;!(null!==i&&void 0!==i&&i.length&&d||null!==n&&void 0!==n&&n.length)&&(null!==n&&void 0!==n&&n.length||null!==i&&void 0!==i&&i.length)||(e.emailsTotal=o)})),e.addMatcher(o.GY.endpoints.editEmail.matchFulfilled,((e,{payload:a})=>{e.elementsList.map((e=>{var l,t;return(null===(l=e.id)||void 0===l?void 0:l.toString())===(null===(t=a.id)||void 0===t?void 0:t.toString())?Object.assign(e,{lock:a.lock,title:a.title,emailtags:a.emailtags}):e}))}))}}),{resetPagesAndTotal:m,toggleElementsView:c,resetElementsList:p,removeEmailFromList:u}=r.actions,g=e=>e[s].emailsTotal,b=e=>e[s].elementsList,E=e=>e[s].elementsTrashList,h=e=>e[s].emailsTrashTotal,v=e=>e[s].customFolders,y=r},77532:(e,a,l)=>{l.d(a,{Ac:()=>g,Ay:()=>b,BK:()=>c,Uf:()=>u,Yw:()=>r,e_:()=>m,js:()=>p,tm:()=>s});var t=l(90536),o=l(31770);const i="imageSlice",d=(0,o.ur)({currentImage:"",currentBackground:"",currentImageName:""}),n=(0,t.createSlice)({name:i,initialState:d,reducers:{setCurrentImageName(e,a){e.currentImageName=a.payload},setCurrentImage(e,a){e.currentImage=a.payload},setCurrentBackground(e,a){e.currentBackground=a.payload},clearCurrentImages(e,a){e.currentImage="",e.currentBackground="",e.currentImageName=""}}}),{setCurrentImage:s,setCurrentImageName:r,setCurrentBackground:m,clearCurrentImages:c}=n.actions,p=e=>e[i].currentImage,u=e=>e[i].currentImageName,g=e=>e[i].currentBackground,b=n},87790:(e,a,l)=>{l.d(a,{AS:()=>u,Ay:()=>k,Bp:()=>c,Sl:()=>y,TB:()=>b,X8:()=>E,ah:()=>v,qT:()=>p});var t=l(90536),o=l(55701),i=l(84568),d=l(35880),n=l.n(d);const s=(0,l(31770).ur)({block:{isNew:!0,subject:"",description:"",html:'<table cellspacing="0" cellpadding="0" border="0" width="100%">'+n()+"</table>",project:void 0,project_title:"",tags:[],type:"Other",title:null},hasChanged:!1}),r="newBlockSlice",m=(0,t.createSlice)({name:r,initialState:s,reducers:{setNewBlockAll:(e,{payload:{subject:a="",description:l="",renderGuid:t,html:o='<table cellspacing="0" cellpadding="0" border="0" width="100%">'+n()+"</table>",tags:i=[],type:d="Other",title:s,isAmp:r=!1}})=>{e.hasChanged||(e.hasChanged=!0),e.block.title=s,e.block.subject=a,e.block.description=l,e.block.html=o,e.block.tags=i,e.block.type=d,e.block.renderGuid=t,e.block.isAmp=r},setNewBlockTitle:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.title=a.payload},setNewBlockDescription:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.description=a.payload},setNewBlockHtml:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.html=a.payload},setNewBlockTags:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.block.tags=a.payload},resetNewBlockSlice:e=>({...s,block:{...s.block,project:e.block.project,project_title:e.block.project_title}}),setBlockIsAmp:(e,a)=>{e.block.isAmp=a.payload}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,a)=>{e.block.project=a.payload.id,e.block.project_title=a.payload.title})),e.addMatcher(o.VM.endpoints.getBlock.matchFulfilled,(e=>({...s,block:{...s.block,project:e.block.project,project_title:e.block.project_title}})))}}),{setNewBlockAll:c,setNewBlockTitle:p,setNewBlockDescription:u,setNewBlockHtml:g,setNewBlockTags:b,resetNewBlockSlice:E,setBlockIsAmp:h}=m.actions,v=e=>e[r].block,y=e=>e[r].hasChanged,k=m},8493:(e,a,l)=>{l.d(a,{$S:()=>_,Ay:()=>N,BQ:()=>E,Et:()=>C,K3:()=>M,MZ:()=>b,P3:()=>w,TC:()=>k,TU:()=>h,Uh:()=>A,YG:()=>j,Zs:()=>y,aY:()=>T,lg:()=>I,mk:()=>B,ol:()=>F,x3:()=>v,yY:()=>S,zH:()=>P});var t=l(90536),o=l(86739),i=l(84568),d=l(85163),n=l(573),s=l.n(n),r=l(31770),m=l(71210),c=l(32269);const p=(0,r.ur)({emailtags:[],email:{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:s(),project:void 0,project_title:"",tags:[],utm_parameters:{utm_source:"",utm_medium:"",utm_campaign:"",utm_term:"",utm_content:""},parent_email:null,common_styles:"{}",title:"",emailtags:[],isAmp:!1},hasChanged:!1}),u="newEmailSlice",g=(0,t.createSlice)({name:u,initialState:p,reducers:{setNewEmailAll:(e,{payload:{id:a,subject:l,description:t="",preheader:o,html:i=s(),utm_parameters:{utm_source:n="",utm_medium:r="",utm_campaign:m="",utm_term:p="",utm_content:u=""}={},common_styles:g={},emailtags:b=null,renderGuid:E,title:h,_embedded:v,isAmp:y=!1}})=>{var k;e.hasChanged||(e.hasChanged=!0),e.email.isAmp=y,e.email.title=h,e.emailtags=b,e.email.subject=l,e.email.description=t,e.email.common_styles=JSON.stringify(g),e.email.preheader=o,e.email.is_template=!1,e.email.html=i,e.email.tags=(null===(k=(0,c._q)({_embedded:v},d.zh))||void 0===k?void 0:k.map((e=>e.name)))||[],e.email.renderGuid=E,e.email.parent_email=a,e.email.utm_parameters={utm_source:n,utm_medium:r,utm_campaign:m,utm_term:p,utm_content:u},e.email.common_styles=JSON.stringify(d.BD)},setNewEmailTitle:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.title=a.payload},setNewEmailSubject:(e,a)=>{e.hasChanged||e.email.subject===a.payload||(e.hasChanged=!0),e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=a.payload),e.email.subject=a.payload},setNewEmailPreheader:(e,a)=>{e.hasChanged||e.email.preheader===a.payload||(e.hasChanged=!0),e.email.preheader=a.payload},setNewEmailDescription:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.description=a.payload},setNewEmailIsTemplate:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.is_template=a.payload},setNewEmailHtml:(e,a)=>{e.hasChanged||(e.hasChanged=!0),a.payload&&(e.email.html=a.payload)},setNewCommonStyles:(e,a)=>{e.hasChanged||(e.hasChanged=!0),a.payload&&(e.email.common_styles=a.payload)},setNewEmailTags:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.tags=a.payload},setNewEmailUtmSource:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_source=a.payload},setNewEmailUtmMedium:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_medium=a.payload},setNewEmailUtmCampaign:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_campaign=a.payload},setNewEmailUtmTerm:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_term=a.payload},setNewEmailUtmContent:(e,a)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_content=a.payload},setNewIsInited:(e,a)=>{e.email.is_inited=a.payload},setNewEmailIsAmp:(e,a)=>{e.email.isAmp=a.payload},resetNewEmailSlice:e=>({...p,email:{...p.email,guid:(0,m.l)(),project:e.email.project,project_title:e.email.project_title}})},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,a)=>{e.email.project=a.payload.id,e.email.project_title=a.payload.title})),e.addMatcher(o.GY.endpoints.getEmail.matchFulfilled,(e=>({...p,email:{...p.email,project:e.email.project,project_title:e.email.project_title}})))}}),{setNewEmailAll:b,setNewEmailTitle:E,setNewEmailSubject:h,setNewEmailPreheader:v,setNewEmailDescription:y,setNewEmailIsTemplate:k,setNewEmailHtml:T,setNewCommonStyles:f,setNewEmailTags:S,setNewEmailUtmSource:M,setNewEmailUtmMedium:F,setNewEmailUtmCampaign:w,setNewEmailUtmContent:B,setNewEmailUtmTerm:P,resetNewEmailSlice:C,setNewIsInited:A,setNewEmailIsAmp:I}=g.actions,j=e=>e[u].email,_=e=>e[u].hasChanged,N=g},36404:(e,a,l)=>{l.d(a,{AQ:()=>v,Ay:()=>k,BN:()=>p,GD:()=>b,RP:()=>h,Rw:()=>E,es:()=>c,mb:()=>u,od:()=>m,qV:()=>y,yN:()=>g});var t=l(90536),o=l(31770),i=l(84568),d=l(86739);const n=(0,o.ur)({project:null,activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),s="projectSlice",r=(0,t.createSlice)({name:s,initialState:n,reducers:{setProject:(e,{payload:a})=>{e.project=a},setActiveGroupsTags:(e,{payload:a})=>{e.activeGroupsTags=a,a.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:a})=>{e.activeProjectGroupsTags=a,a.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,{payload:a})=>{e.project={...n.project,...a}})),e.addMatcher(i.Nq.endpoints.editProject.matchFulfilled,((e,{payload:a})=>{e.project={...n.project,...a}})),e.addMatcher(d.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{payload:a,meta:l})=>{const{projectId:t}=l.arg.originalArgs;var o,i,d;t?(e.groupsTemplateProjectTotal=+(null===(o=l.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-Total")),e.groupsTemplateProjectTotalPages=+(null===(i=l.baseQueryMeta)||void 0===i?void 0:i.response.headers.get("X-WP-TotalPages"))):e.groupsTemplateTotal=+(null===(d=l.baseQueryMeta)||void 0===d?void 0:d.response.headers.get("X-WP-Total"))}))}}),{setProject:m,setActiveGroupsTags:c,setActiveProjectGroupsTags:p,resetAllTags:u}=r.actions,g=e=>e[s].project,b=e=>e[s].activeGroupsTags,E=e=>e[s].activeProjectGroupsTags,h=e=>e[s].groupsTemplateTotal,v=e=>e[s].groupsTemplateProjectTotal,y=e=>e[s].groupsTemplateProjectTotalPages,k=r},64936:(e,a,l)=>{l.d(a,{Ay:()=>B,Cj:()=>k,Oo:()=>E,Os:()=>v,Wz:()=>h,YF:()=>b,cL:()=>T,gU:()=>w,o8:()=>M,qf:()=>g,sB:()=>y,sK:()=>f,uM:()=>F,vW:()=>S});var t=l(90536),o=l(31770),i=l(84568),d=l(93563),n=l(85163);const s=new URLSearchParams(window.location.search),r=s.get("tag"),m=s.get("folder"),c=(0,o.ur)({activeModal:"",secondModal:"",projectsTotal:"",projectsTotalPages:"",folders:[],activeTagId:r||null,activeFolderId:m||(r?null:n.y2),activeTab:null}),p="projectsPageSlice",u=(0,t.createSlice)({name:p,initialState:c,reducers:{openModal(e,a){e.activeModal=a.payload},setActiveTab(e,a){e.activeTab=a.payload},closeModal(e){e.activeModal=""},openSecondModal(e,a){e.secondModal=a.payload},closeSecondModal(e){e.secondModal=""},setFolders(e,{payload:a}){e.folders=a},setActiveTagId(e,{payload:a}){e.activeTagId=a}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProjects.matchFulfilled,((e,{meta:a})=>{var l,t;const o=null===(l=a.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-Total"),i=null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages");e.projectsTotal=o,e.projectsTotalPages=i})),e.addMatcher(d.kE.endpoints.getFolders.matchFulfilled,((e,{payload:a})=>{e.folders=a}))}}),{openModal:g,setActiveTab:b,closeModal:E,openSecondModal:h,closeSecondModal:v,setFolders:y,setActiveTagId:k}=u.actions,T=e=>e[p].activeModal,f=e=>e[p].secondModal,S=e=>e[p].projectsTotal,M=e=>e[p].folders,F=e=>e[p].activeTagId,w=e=>e[p].activeTab,B=u},39738:(e,a,l)=>{l.d(a,{Ay:()=>u,RL:()=>p,p1:()=>c,qX:()=>r});var t=l(90536),o=l(86739),i=l(55701);const d=(0,l(31770).ur)({historyData:[],elementHistoryTotalPages:1}),n="revisionHistorySlice",s=(0,t.createSlice)({name:n,initialState:d,reducers:{resetElementHistorySlice:()=>({...d}),setElementHistory:(e,a)=>{0!==a.payload.length&&(e.historyData=a.payload)}},extraReducers:e=>{e.addMatcher(o.GY.endpoints.getEmailHistory.matchFulfilled,((e,{meta:a,payload:l})=>{var t;e.elementHistoryTotalPages=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages")),a.arg.originalArgs.page&&1!==a.arg.originalArgs.page||(e.historyData=l.data||[])})),e.addMatcher(i.VM.endpoints.getBlockHistory.matchFulfilled,((e,{meta:a,payload:l})=>{var t;e.elementHistoryTotalPages=+(null===(t=a.baseQueryMeta)||void 0===t?void 0:t.response.headers.get("X-WP-TotalPages")),l.args.page&&1!==l.args.page||(e.historyData=l.data||[])}))}}),{resetElementHistorySlice:r}=s.actions,{setElementHistory:m}=s.actions,c=e=>e[n].historyData,p=e=>e[n].elementHistoryTotalPages,u=s},86286:(e,a,l)=>{l.d(a,{Ay:()=>T,B:()=>E,B$:()=>k,C1:()=>h,hZ:()=>y,ko:()=>u,ku:()=>c,ww:()=>r,yf:()=>v});var t=l(90536),o=l(39990),i=l(85163),d=l(32269);const n=(0,l(31770).ur)({currentUser:{},currentSchema:{},monacoOptions:i.rW,monacoDidMount:!1}),s="userSlice",r=(0,t.createAsyncThunk)("user/setMonacoOptions",(async(e,{getState:a})=>{const l=a()[s],t="string"===typeof e.font_family?`${e.font_family}, sans-serif`:void 0,o=void 0!==e.word_wrap?e.word_wrap?"on":"off":void 0;return t&&l.monacoOptions.fontFamily!==t&&await(0,d.iV)(e.font_family),{tabSize:e.tab_size,fontFamily:t,fontSize:e.font_size,wordWrap:o,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}})),m=(0,t.createSlice)({name:s,initialState:n,reducers:{setMonacoDidMount:(e,{payload:a})=>{e.monacoDidMount=a},setTheme:(e,{payload:a})=>{e.currentUser.theme=a},setUserLocale:(e,{payload:a})=>{e.currentUser.locale=a},setUserAutosaves:(e,{payload:a})=>{e.currentUser.autosaves=a},setUser:(e,{payload:a})=>{e.currentUser={...e.currentUser,...a}}},extraReducers:e=>{e.addCase(r.fulfilled,((e,a)=>{const l=a.payload;e.monacoOptions=(0,d.i0)({...e.monacoOptions},l)})),e.addMatcher(o.Q2.endpoints.editMe.matchFulfilled,((e,a)=>{e.currentUser=a.payload})),e.addMatcher(o.Q2.endpoints.getMe.matchFulfilled,((e,a)=>{e.currentUser=a.payload})),e.addMatcher(o.Q2.endpoints.getSchema.matchFulfilled,((e,a)=>{e.currentSchema=a.payload.schema}))}}),{setMonacoDidMount:c,setTheme:p,setUserLocale:u,setUserAutosaves:g,setUser:b}=m.actions,E=e=>{var a;return null===(a=e[s].currentUser)||void 0===a?void 0:a.locale},h=e=>e[s].currentUser,v=e=>e[s].currentSchema,y=e=>e[s].monacoOptions,k=e=>{var a;return 3891!==(null===(a=e[s].currentUser.subscription)||void 0===a?void 0:a.ID)},T=m},15115:(e,a,l)=>{l.d(a,{A:()=>t});const t=[l.p+"static/media/tg.png",l.p+"static/media/yt.png",l.p+"static/media/pi.png",l.p+"static/media/tt.png",l.p+"static/media/tw.png",l.p+"static/media/ig.png",l.p+"static/media/fb.png"]},75855:(e,a,l)=>{e.exports=l.p+"static/media/frame_dark.png"},55231:(e,a,l)=>{e.exports=l.p+"static/media/frame_light.png"},47018:(e,a,l)=>{e.exports=l.p+"static/media/frame_template_gallery.png"}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[7883],{56991:(e,t,n)=>{n.d(t,{bD:()=>s,Mu:()=>a,cM:()=>c,rD:()=>l});var o=n(45934),r=n(18398),i=n(71210);function s(e,t){if(e!==t){if(!e||!t||"object"!==typeof e||"object"!==typeof t)return!1;const n=t instanceof Array;if(e instanceof Array){if(!n)return!1;const o=e.length;if(t.length!==o)return!1;for(let n=0;n<o;n++)if(!s(e[n],t[n]))return!1}else if(n)return!1;const o=Object.keys(e),r=Object.keys(t),i=o.length;if(i!==r.length)return!1;for(let a=0;a<i;a++){const n=o[a];if(!t.hasOwnProperty(n)||!s(e[n],t[n]))return!1}}return!0}function a(e){if(e){const{type:t,project:n,isNew:o,id:r}=e;return`/projects/${n}/${"block"===t?"blocks":"emails"}/${o?`new?template=${r}`:r}`}return""}function l(){return(0,o.d4)(r.zg)}function c(e,t,n){return null!==e&&void 0!==e&&e.length?e.map(((e,o)=>function(e){return e.hasOwnProperty("children")}(e)?{key:(0,i.l)(),value:e.value,label:e.label,children:c(e.children,t,n),type:e.type}:{key:(0,i.l)(),label:e.label,value:e.value,onClick:t=>{n(e.value,t.domEvent)}})):void 0}},12264:(e,t,n)=>{function o(){const e=new Date;return e.valueOf()-60*e.getTimezoneOffset()*1e3}n.d(t,{N:()=>o})},41664:(e,t,n)=>{n.d(t,{Q:()=>r});var o=n(71210);function r(e=(0,o.l)()){return e}},82375:(e,t,n)=>{n.d(t,{Q:()=>o});const o=new(n(95152).m)},30725:(e,t,n)=>{n.d(t,{p:()=>r});var o=n(23580);function r(e){return(t,n,r,i)=>{const s=(0,o.My)(n);return e(s)(t,n,r,i)}}},77509:(e,t,n)=>{n.d(t,{j:()=>o});class o{constructor(e=[]){this._inner=e,this._isDisposed=!1}addDisposable(e){return this._inner.push(e),e instanceof o&&e.addDispose((()=>{this.removeDisposable(e)})),e}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){const t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const e of[...this._inner])e.dispose()}}}},47381:(e,t,n)=>{n.d(t,{u:()=>i});var o=n(92810),r=n(56991);const i=()=>{const e=(0,r.rD)();return(0,o.useCallback)(((t,n)=>{!1!==e.pushToGTM&&((e,t)=>{const n=()=>{try{const t={...e,appLabel:"blocks_app"};window.dataLayer&&"function"===typeof window.dataLayer.push?window.dataLayer.push(t):console.log("Attempting to add to the dataLayer:",e)}catch(t){console.error("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 GTM:",t)}};t?setTimeout(n,t):n()})(t,n)}),[e.pushToGTM])}},71210:(e,t,n)=>{function o(){var e=(new Date).getTime(),t="undefined"!==typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(n){var o=16*Math.random();return e>0?(o=(e+o)%16|0,e=Math.floor(e/16)):(o=(t+o)%16|0,t=Math.floor(t/16)),("x"===n?o:3&o|8).toString(16)}))}n.d(t,{l:()=>o})},14004:(e,t,n)=>{n.d(t,{i:()=>r});var o=n(44141);const r=async(e,t,n)=>{const r=(0,o.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),i=(0,o.hI)({baseUrl:r});let s=await i(e,t,n);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}},89698:(e,t,n)=>{n.d(t,{V:()=>c});var o=n(85163),r=n(45695),i=n(23287),s=n(92810),a=n(45934),l=n(86286);function c(){const e=(0,r.QC)(),t=(0,a.d4)(l.C1),{__:n}=(0,i.s9)(),[c,d]=(0,s.useState)("");(0,s.useEffect)((()=>{if(t.locale!==c){const r=(0,o.QV)(n),i=e.onInit((()=>{e.send(o.Ru.SANDBOX_TRANSLATIONS,{name:t.locale,data:r}),d(t.locale)}));return()=>i.dispose()}}),[t.locale,c,d,n,e]),(0,s.useEffect)((()=>{const t=e.addListener(o.Ru.RELOAD,(()=>{d("")}));return()=>t.dispose()}),[d,e])}},37969:(e,t,n)=>{n.d(t,{y:()=>l});var o=n(85163),r=n(45695),i=n(92810),s=n(70082);const a=Symbol("isIframeEvent");function l({children:e}){const[t,n]=(0,i.useState)(),[l,c]=(0,i.useState)(),[d,u]=(0,i.useState)(!1),f=(0,r.QC)();return(0,i.useEffect)((()=>{if(t){const e=f.addListener(o.Ru.APPLICATION_IFRAME_DRAG_EVENT,(e=>{if("drageleave"!==e.type&&"dragenter"!==e.type){const n=t.getBoundingClientRect(),o=e.clientX+n.x+window.scrollX,r=e.clientY+n.y+window.scrollY,i=document.elementFromPoint(o,r);if(i){const t=new DataTransfer,n=new DragEvent(e.type,{clientX:o,clientY:r,cancelable:!0,bubbles:!0,dataTransfer:t});n[a]=!0,i.dispatchEvent(n)}}}));return()=>e.dispose()}}),[f,t]),(0,i.useEffect)((()=>{const e=e=>{e[a]||u(!0)},t=e=>{e[a]||u(!1)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",t),()=>{window.removeEventListener("dragstart",e),window.removeEventListener("dragend",t)}}),[l]),(0,i.useEffect)((()=>{const e=e=>{if(!e[a]){var t;const n=l.getBoundingClientRect();f.send(o.Ru.SANDBOX_DRAG_EVENT,{value:(null===(t=e.dataTransfer)||void 0===t?void 0:t.getData("Text"))||"",type:e.type,clientX:e.pageX-n.x-window.scrollX,clientY:e.pageY-n.y-window.scrollY})}};if(l)return l.addEventListener("dragenter",e),l.addEventListener("dragover",e),l.addEventListener("dragleave",e),l.addEventListener("drop",e),l.addEventListener("dragend",e),()=>{l.removeEventListener("dragenter",e),l.removeEventListener("dragover",e),l.removeEventListener("dragleave",e),l.removeEventListener("drop",e),l.removeEventListener("dragend",e)}}),[l,f]),(0,s.jsxs)("div",{ref:n,children:[d&&(0,s.jsx)("div",{ref:c,className:"iframe-provider"}),e]})}},43672:(e,t,n)=>{n.d(t,{w:()=>c});var o=n(95838),r=n(85163),i=n(56991),s=n(45695),a=n(92810);const{useToken:l}=o.A;function c(){const e=(0,s.QC)(),{token:t}=l(),[n,o]=(0,a.useState)();(0,a.useEffect)((()=>{if(!(0,i.bD)(n,t)){const n=e.onInit((()=>{e.send(r.Ru.SANDBOX_SET_THEME_VARIABLES,t),o(t)}));return()=>n.dispose()}}),[t,n,o,e]),(0,a.useEffect)((()=>{const t=e.addListener(r.Ru.RELOAD,(()=>{o(void 0)}));return()=>t.dispose()}),[o,e])}},38920:(e,t,n)=>{n.d(t,{r:()=>_});var o=n(85163),r=n(59287),i=n(92810),s=n(45934),a=n(64617),l=n(86739),c=n(53204),d=n(47358),u=n(65983),f=n(39738),v=n(86286),p=n(56991),m=n(32411),h=n(83863),y=n(71157),g=n(42068),b=n(47381);function _(e){const{emailId:t,projectId:n}=(0,a.g)(),_=(0,y.hN)(),E=(0,p.rD)(),w=(0,s.d4)(c.M),T=(0,m.fn)(),A=(0,i.useRef)(0),D=(0,s.d4)(f.p1),S=(0,s.d4)(d.Wm),C=(0,s.d4)(d.B),N=(0,s.d4)(v.C1),R=(0,b.u)(),[k,x]=(0,l.LX)(),L=(0,s.wA)(),{isSuccess:O,isLoading:I}=(0,l.YV)({emailId:t},{skip:!t}),[j,M]=(0,i.useState)(null);(0,i.useEffect)((()=>{if(O&&!I&&null!==D&&void 0!==D&&D.length){const n=D[0];var t;if(n&&j!==(null===e||void 0===e?void 0:e.id))null!==(t=n.slug)&&void 0!==t&&t.includes("autosave")&&T&&L((0,u.no)(n)),M(null===e||void 0===e?void 0:e.id)}}),[L,D,O,I,null===e||void 0===e?void 0:e.id,j,T,t]);const G=(0,i.useCallback)((({parent:t})=>{if(e){const i={parent:t,title:e.title,author:e.author,project:e.project,html:(null===T||void 0===T?void 0:T.getValue())||"",excerpt:e.date_gmt,subject:e.subject,preheader:e.preheader,common_styles:e.common_styles,parent_email:e.parent_email};k({emailId:e.id,body:i}).then((t=>{if(R({event:"save",action:"auto_save_email",email_id:e.id,project_id:n}),!function(e){return e.hasOwnProperty("data")}(t))throw t.error;var s,a;o.EW.isPlugin||fetch((0,r.Wv)(o.Tm,n,null===(s=t.data)||void 0===s?void 0:s.id,null===(a=t.data)||void 0===a?void 0:a.modified),{mode:"no-cors"}),_.success({id:"EMAIL_AUTOSAVE_SUCCESS",data:i,message:""},!0)})).catch((e=>{_.fromError("EMAIL_AUTOSAVE_ERROR",i,e,!0),console.log(e)}))}}),[k,e,T,n,_,R]),[P,U]=(0,i.useState)(!1),V=(0,i.useCallback)((()=>{if((null===D||void 0===D?void 0:D.length)>0){const e=[...D].sort(((e,t)=>Date.parse(null===t||void 0===t?void 0:t.modified)-Date.parse(null===e||void 0===e?void 0:e.modified)))[0];Date.parse((new Date).toString())-Date.parse(null===e||void 0===e?void 0:e.modified)>1.5*((null===E||void 0===E?void 0:E.autosaveTimeout)||1e4)&&S&&!w&&"Discuss"!==C&&G({parent:e.id})}else S&&!w&&"Discuss"!==C&&G({parent:null})}),[D,w,S,C,G,null===E||void 0===E?void 0:E.autosaveTimeout]);(0,g.Z)((([e])=>{P&&!e&&(V(),U(!1))}),[P,V,U]);const X=null===N||void 0===N?void 0:N.autosaves,[B,$]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{B&&!w&&(clearTimeout(A.current),A.current=setTimeout((()=>U(!0)),(null===E||void 0===E?void 0:E.autosaveTimeout)||1e4),$(!1))}),[B,w,null===E||void 0===E?void 0:E.autosaveTimeout,U,$]),(0,i.useEffect)((()=>{if(X&&O&&void 0!==(null===e||void 0===e?void 0:e.id)){const t=(0,h.Og)(T,(()=>{S&&null!==e&&void 0!==e&&e.is_inited&&$(!0)}));return()=>{t.dispose()}}}),[T,$,X,O,null===e||void 0===e?void 0:e.id,S,null===e||void 0===e?void 0:e.is_inited]),(0,g.Z)((([t,n])=>{X&&O&&void 0!==(null===e||void 0===e?void 0:e.id)&&S&&null!==e&&void 0!==e&&e.is_inited&&(t===(null===e||void 0===e?void 0:e.title)&&n===(null===e||void 0===e?void 0:e.common_styles)||$(!0))}),[null===e||void 0===e?void 0:e.title,null===e||void 0===e?void 0:e.common_styles,S,O,$,null===e||void 0===e?void 0:e.id,null===e||void 0===e?void 0:e.is_inited]),(0,i.useEffect)((()=>()=>{clearTimeout(A.current)}),[N,null===e||void 0===e?void 0:e.renderGuid]),(0,i.useEffect)((()=>{clearTimeout(A.current)}),[null===e||void 0===e?void 0:e.modified]),x}},9653:(e,t,n)=>{n.d(t,{U:()=>c});var o=n(85163),r=n(45695),i=n(32411),s=n(83863),a=n(42068),l=n(92810);const c=e=>{const t=(0,i.fn)(),n=(0,r.QC)(),c=(null===e||void 0===e?void 0:e.html)||"",d=(0,l.useRef)();d.current=e;const u=(0,l.useCallback)((e=>{const t=d.current;if(e===(null===t||void 0===t?void 0:t.renderGuid))return n.sendAsync(o.Ru.SANDBOX_INITED,{guid:t.renderGuid})}),[n]),f=(0,l.useCallback)((e=>{const t=d.current;if(e===(null===t||void 0===t?void 0:t.renderGuid))return n.sendAsync(o.Ru.SANDBOX_INIT_START,{guid:t.renderGuid})}),[n]),v=(0,l.useCallback)((async e=>{const r=d.current;if((null===r||void 0===r?void 0:r.renderGuid)===e){const e=null===c||void 0===c?void 0:c.replaceAll("\r\n","\n");try{(0,s.po)(t),t.setValue(e)}finally{(0,s.SF)(t)}const i=t.getValue();await n.sendAsync(o.Ru.SANDBOX_SET_ENTITY,{html:i,guid:null===r||void 0===r?void 0:r.renderGuid})}}),[c,t,n]);(0,a.Z)((async([t])=>{const n=null===e||void 0===e?void 0:e.renderGuid;n&&n!==t&&(await f(n),await v(n),await u(n))}),[null===e||void 0===e?void 0:e.renderGuid,null===e||void 0===e?void 0:e.id,v])}},69106:(e,t,n)=>{n.d(t,{f:()=>m});var o=n(85163),r=n(13522),i=n(45695),s=n(93982),a=n(32411),l=n(83863),c=n(42068),d=n(92810),u=n(65983),f=n(8493),v=n(45934),p=n(87686);const m=(e,t)=>{const n=(0,v.wA)(),m=(0,a.fn)(),h=(0,i.QC)(),y=(0,s.ml)(r.A.WILL_EMAIL_INIT_ID),g=(0,s.ml)(r.A.ON_EMAIL_INIT_ID),b=(0,s.ml)(r.A.ON_CONTENT_CHANGED_ID),_=(0,s.ml)(r.A.ON_EMAIL_CHANGED_ID),E=(0,s.ml)(r.A.ON_MODEL_CHANGE),w=(0,d.useRef)(!1),T=(0,d.useRef)();T.current=e,(0,d.useEffect)((()=>{const n=T.current;if(o.EW.isPlugin&&!w.current&&(null===e||void 0===e?void 0:e.renderGuid)===(null===n||void 0===n?void 0:n.renderGuid)&&n){const e=m.getValue();_.fire({...n,id:t||n.isNew?void 0:n.id,html:e})}}),[m,e,_,t]),(0,c.Z)((([e])=>{e!==m&&E.fire(m)}),[m,E]),(0,d.useEffect)((()=>{if(o.EW.isPlugin){const n=m.onDidChangeContent((()=>{const n=T.current;if(!w.current&&(null===e||void 0===e?void 0:e.renderGuid)===(null===n||void 0===n?void 0:n.renderGuid)&&n){const e=m.getValue();b.fire(e),_.fire({...n,id:t||n.isNew?void 0:n.id,html:e})}}));return()=>n.dispose()}}),[m,b,_,e,t]);const A=(0,d.useCallback)((async()=>{const e=T.current;try{var t;(0,l.po)(m),m.setValue((null===e||void 0===e||null===(t=e.html)||void 0===t?void 0:t.replaceAll("\r\n","\n"))||"")}finally{(0,l.SF)(m)}const n=m.getValue();await h.sendAsync(o.Ru.SANDBOX_SET_ENTITY,{html:n,guid:e.renderGuid})}),[m,h]),D=(0,d.useCallback)((async()=>{const e=T.current;await h.sendAsync(o.Ru.SANDBOX_SET_ENTITY,{html:m.getValue(),guid:e.renderGuid})}),[m,h]),S=(0,d.useCallback)((async()=>{const e=T.current;void 0!==e.preheader&&await h.sendAsync(o.Ru.SANDBOX_PREHEADER_UPDATE,{value:e.preheader,guid:e.renderGuid,force:!0})}),[h]),C=(0,d.useCallback)((async()=>{const e=T.current;void 0!==e.subject&&await h.sendAsync(o.Ru.SANDBOX_SUBJECT_UPDATE,{value:e.subject,guid:e.renderGuid,force:!0})}),[h]),N=(0,d.useCallback)((()=>{const e=T.current;return h.sendAsync(o.Ru.SANDBOX_INITED,{guid:e.renderGuid})}),[h]),R=(0,d.useCallback)((()=>{const e=T.current;return n(void 0===e.id?(0,f.Uh)(!0):(0,u.Wm)(!0)),g.fire({...e,id:t||e.isNew?void 0:e.id,html:m.getValue()})}),[n,g,m,t]),k=(0,d.useCallback)((()=>{const e=T.current;return h.sendAsync(o.Ru.SANDBOX_INIT_START,{guid:e.renderGuid})}),[h]),x=(0,d.useCallback)((()=>{const e=T.current;return y.fire({...e,id:t||e.isNew?void 0:e.id,html:m.getValue()})}),[y,m,t]),[L]=(0,c.c)((function*(){try{w.current=!0,yield*(0,p.T1)(k),yield*(0,p.T1)(x),yield*(0,p.T1)(A),yield*(0,p.T1)(S),yield*(0,p.T1)(C),yield*(0,p.T1)(N),yield*(0,p.T1)(R)}finally{w.current=!1}}),[A,S,C,R,x,k,N]),[O]=(0,c.c)((function*(){try{yield*(0,p.T1)(k),yield*(0,p.T1)(x),yield*(0,p.T1)(D),yield*(0,p.T1)(S),yield*(0,p.T1)(C),yield*(0,p.T1)(N),yield*(0,p.T1)(R)}finally{}}),[A,S,C,R,x,k,N]);(0,c.Z)((async([t])=>{const n=null===e||void 0===e?void 0:e.renderGuid;n&&n!==t&&L()}),[null===e||void 0===e?void 0:e.renderGuid,L]),(0,d.useEffect)((()=>{const e=h.addListenerAsync(o.Ru.RELOAD,(async()=>{await O()}));return()=>e.dispose()}),[h,O])}},14598:(e,t,n)=>{n.d(t,{QM:()=>a,q2:()=>u});var o=n(60564),r=n.n(o),i=n(58689),s=n(81158);function a(e,t){const n=document.createElement("input");n.type="file",n.accept=e,n.multiple=!0,n.onchange=()=>{var e;null!==(e=n.files)&&void 0!==e&&e.length&&t(n.files)},n.click()}const l="index.html";function c(e,t){return e.find((function(e){return e.name.toLowerCase().endsWith(t)}))}async function d(e,t,n){return await(0,i.bc)(e,(async e=>{e=e.replace("\\","/");const n=(0,i.$l)(e);return t(e,n)}),n)}async function u(e,t,n){if(e){switch(function(e){const t=e.split(".");return t[t.length-1].toLowerCase()}(e.name)){case"zip":return async function(e,t,n){var o=new(r());const{files:s}=await o.loadAsync(e),a=Object.keys(s).map((e=>s[e])),d=s[l]||c(a,l)||c(a,".html")||c(a,".htm");if(d){const e=d.name.split("/"),o=document.location.pathname.split("/"),r=document.location.origin+o.slice(0,o.length-e.length).join("/")+"/",a=await d.async("text"),l=e.slice(0,e.length-1).join("/");return await(0,i.bc)(a,(async e=>{(e=e.replace("\\","/")).startsWith(".")&&(e=e.substring(1)),e.startsWith("/")&&(e=e.substring(1)),e.startsWith(r)&&(e=e.substring(r.length)),l&&!e.match("^(ht|f)tp(s?)://")&&(e=`${l}/${e}`);const n=s[e];if(n){const e=n.name,o=await n.async("blob");return t(o,e)}const o=(0,i.$l)(e);return t(e,o)}),n)}}(e,t,n);case"eml":{const o=await e.text(),r=(0,s.bZ)(o);if(r instanceof Error)throw r;const i="string"===typeof r?r:r.html;if("undefined"===typeof i)throw new Error("Eml not contains text/html");return d(i,t,n)}default:return d(await e.text(),t,n)}}}},44396:(e,t,n)=>{n.d(t,{Q:()=>a});var o=n(60089),r=n(70609);const i=100;class s extends o.m{constructor(e,t,n,o){super(e,t,n,o),this._onScrollDisposable=null,this._editor=e}updateColorDecorators(e){if(this._onScrollDisposable&&(this._onScrollDisposable.dispose(),this._onScrollDisposable=null),e.length>=500){const t=this._editor;let[n,o]=[Number.MAX_VALUE,Number.MIN_VALUE];const r=()=>{const r=t.getVisibleRanges(),[s,a]=r.reduce(((e,{startLineNumber:t,endLineNumber:n})=>[Math.min(t,e[0]),Math.max(n,e[1])]),[Number.MAX_VALUE,Number.MIN_VALUE]);if(n-s>i||a-o>i){let t=e.filter((({colorInfo:e})=>{const{startLineNumber:t,endLineNumber:n}=e.range;return s-t<i&&n-a<i}));super.updateColorDecorators(t)}};this._onScrollDisposable=t.onDidScrollChange(r),r()}else super.updateColorDecorators(e)}dispose(){var e;null===(e=this._onScrollDisposable)||void 0===e||e.dispose(),super.dispose()}}function a(){(0,r.D0)(s.ID,(()=>s))}},36671:(e,t,n)=>{n.d(t,{h:()=>E});var o=n(92810),r=n(70609),i=n(85163),s=n(32411),a=n(64037),l=n(71157),c=n(45934),d=n(86286),u=n(23287),f=n(39217),v=n(45695),p=n(77509),m=n(83863);const h=1e3,y=2e3,g=10,b="iframe_errors",_=5;function E(e,t){const{__:n}=(0,u.s9)(),E=(0,v.QC)(),w=(0,s.aD)(e),{error:T}=(0,l.hN)(),A=(0,o.useRef)(0),D=(0,o.useRef)(),S=(0,o.useRef)(!1),C=(0,c.d4)(d.C1),N=(0,o.useCallback)((e=>new Promise(((t,n)=>{const o=E.addListener(i.Ru.SANDBOX_READY,(()=>{o.dispose(),t()}));e&&setTimeout((()=>{o.dispose(),n("timeout")}))}))),[E]),R=(0,o.useCallback)((o=>{N(y).catch((e=>console.log(e))).finally((()=>{Promise.resolve().then((()=>{if(!S.current){if(++A.current){if(D.current){if(A.current<_){w.restoreSnapshot(D.current);for(let e=0;e<A.current;e++)w.undo()}}else D.current=w.createSnapshot();E.send(i.Ru.RELOAD)}setTimeout((()=>{if(0===--A.current){D.current=null;const r={past:w.getPast().slice(0,g),future:w.getFuture(),errorResolved:!S.current,text:e.getValue(),message:o.message,stack:o.stack,userId:null===C||void 0===C?void 0:C.id,entityId:null===t||void 0===t?void 0:t.id,entityType:document.location.pathname.indexOf("emails")>0?"email":"block"};console.log(r),T({id:"IFRAME_ERROR",data:r,message:n("Something went wrong")}),f.CJ.post(b,r).catch((e=>console.log(e))),S.current=!1}}),y)}}))}))}),[w,e,T,null===C||void 0===C?void 0:C.id,null===t||void 0===t?void 0:t.id,n,N,E]);(0,a.A)(i.Ru.APPLICATION_DOMPARSER_ERROR,R),(0,o.useEffect)((()=>{let n=null,o=0;function s(e){const t=[];for(const{rangeOffset:n,rangeLength:o,text:r}of e.changes)t.push({range:{start:n,end:n+o},text:r});return t}let a=!1;const l=new p.j;return l.addDisposable((0,m.Og)(e,(e=>(async e=>{if(a)await E.sendAsync(i.Ru.SANDBOX_UPDATE_ENTITY,{edits:[s(e)],guid:t.renderGuid});else if(n)n.push(e);else{n=[e];do{const e=n.splice(0,n.length);await E.sendAsync(i.Ru.SANDBOX_UPDATE_ENTITY,{edits:e.map(s),guid:t.renderGuid})}while(n.length);n=null}})(e).catch((e=>console.log(e)))))),l.addDisposable(E.addListener(i.Ru.APPLICATION_UPDATE_ENTITY,(function({guid:n,edits:i,pushUndoStop:s}){if(e&&n===t.renderGuid)try{a=!0;const t=(0,r.yc)();let n=t.canUndo(e.uri),l=t.canRedo(e.uri);const c=i.map((({text:t,range:n})=>{const o=e.getPositionAt(n.start),r=e.getPositionAt(n.end);return{text:t,range:{startColumn:o.column,startLineNumber:o.lineNumber,endColumn:r.column,endLineNumber:r.lineNumber}}}));s||n||l?e.pushEditOperations([],c,(()=>null)):e.applyEdits(c),!1!==s&&(o&&clearTimeout(o),o=setTimeout((()=>{e.pushStackElement(),o=0}),h))}finally{a=!1}}))),()=>{l.dispose(),o&&clearTimeout(o)}}),[e,E,t.renderGuid])}},32411:(e,t,n)=>{n.d(t,{$Z:()=>f,TW:()=>d,aD:()=>u,fn:()=>v,kx:()=>a});var o=n(70609),r=n(92810),i=n(60382),s=n(33695);const a=(0,r.createContext)(null),l={editorWorkerService:"editor.worker.js",html:"html.worker.js",css:"css.worker.js",typescript:"ts.worker.js",json:"json.worker.js",javascript:"ts.worker.js",less:"css.worker.js",scss:"css.worker.js",handlebars:"html.worker.js",razor:"html.worker.js"};function c(e,t){/^(\/\/)/.test(e)&&(e=window.location.protocol+e);var n=new Blob(["/*"+t+'*/importScripts("'+e+'");'],{type:"application/javascript"});return URL.createObjectURL(n)}function d(e){const t=(0,o.yc)(),[n,i]=(0,r.useState)({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)});return(0,r.useEffect)((()=>{const n=e.onDidChangeContent((()=>{setTimeout((()=>i({canUndo:t.canUndo(e.uri),canRedo:t.canRedo(e.uri)})))}));return()=>{n.dispose()}}),[e,t]),n}function u(e){function t(e){var t;const n=(null===e||void 0===e||null===(t=e.actual)||void 0===t?void 0:t._data)||new s.Ov;return n instanceof s.Ov?n:s.Ov.deserialize(n)}const n=(0,o.yc)();return(0,r.useMemo)((()=>({undo:()=>n.undo(e.uri),redo:()=>n.redo(e.uri),clear:()=>n.removeElements(e.uri),getPast:()=>{var o,r;return(null===(o=n._editStacks.get(e.uri.toString()))||void 0===o||null===(r=o._past)||void 0===r?void 0:r.map(t))||[]},getFuture:()=>{var o,r;return(null===(o=n._editStacks.get(e.uri.toString()))||void 0===o||null===(r=o._future)||void 0===r?void 0:r.map(t))||[]},canUndo:()=>n.canUndo(e.uri),canRedo:()=>n.canRedo(e.uri),createSnapshot:()=>n.createSnapshot(e.uri),restoreSnapshot:e=>n.restoreSnapshot(e)})),[n,e])}function f(e="",t="html"){const n=i.editor.createModel(e,t);return n.setEOL(i.editor.EndOfLineSequence.LF),n}function v(){return(0,r.useContext)(a)}useblocksMonacoEnvironment.getWorkerUrl=(e,t)=>{var o=n.p,r=(o?o.replace(/\/$/,"")+"/":"")+l[t],i=new URL(r,window.location.origin),s=i.protocol;if("http:"===s||"https:"===s){if(i.protocol!==window.location.protocol||i.hostname!==window.location.hostname)return c(r,t);if("localhost"===i.hostname&&(i.port||"80")!==(window.location.port||"80"))return c(r,t)}else if("file:"===s)return c(r,t);return r}},83863:(e,t,n)=>{n.d(t,{Og:()=>s,SF:()=>i,po:()=>r});const o=new Set;function r(e){return o.add(e),{dispose(){i(e)}}}function i(e){o.delete(e)}function s(e,t){let n=e.getVersionId(),r=[];const i=e.onDidChangeContent((i=>{if(i.versionId>n+1){let s=e.onDidChangeContent((a=>{if(i.versionId===n+1)try{o.has(e)||t(i)}catch(l){console.log(l)}finally{n=i.versionId;let e=r.indexOf(s);e>=0&&r.splice(e,1),s.dispose()}}));r.push(s)}else try{o.has(e)||t(i)}catch(s){console.log(s)}finally{n=i.versionId}}));return{dispose:()=>{i.dispose(),r.forEach((e=>e.dispose()))}}}},70609:(e,t,n)=>{n.d(t,{D0:()=>s,yc:()=>a});var o=n(95713),r=n(42443),i=n(60332);function s(e,t){const n=o.dS.getEditorContributions().find((t=>t.id===e));if(!n)throw new Error(`No contribution ${e}`);n.ctor=t(n)}function a(){return e=i.$D,r.QE.get(e);var e}},71157:(e,t,n)=>{n.d(t,{Gy:()=>f,O5:()=>m,hN:()=>p,x_:()=>v});var o=n(13522),r=n(93982),i=n(92810),s=n(33206),a=n(13329),l=n(28316),c=n(814),d=n(70082);const u="bottomRight";function f(e){return{id:e.id,code:e.html,title:e.title,subject:e.subject,preheader:e.preheader}}function v(e){return{id:e.id,code:e.html,title:e.title}}function p(){const e=(0,r.ml)(o.A.ON_NOTIFICATION),{notification:t}=s.A.useApp(),n=(0,i.useCallback)(((n,o)=>{n.type||(n={...n,type:"info"}),e.fire((0,c.TB)({id:n.id,type:n.type,data:n.data,innerException:n.innerException})).then((e=>{if(e.every((e=>!1!==e))){n={...n};for(const t of e)"object"===typeof t&&Object.assign(n,t,t.style?{style:{...t.style,...n.style}}:{},t.props?{props:{...t.props,...n.props}}:{},t.className?{className:n.className?`${n.className} ${t.className}`:t.className}:{});o||((n=Object.assign(n,...e.filter((e=>"object"===typeof e)))).placement||(n.placement=u),t[n.type]?t[n.type](n):(console.log(n.type),console.log(n.id),n.message&&console.log(n.message)))}}))}),[t,e]),a=(0,i.useCallback)(((e,t)=>n({...e,type:"error"},t)),[n]),l=(0,i.useCallback)(((e,t)=>n({...e,type:"success"},t)),[n]),f=(0,i.useCallback)(((e,t)=>n({...e,type:"warning"},t)),[n]),v=(0,i.useCallback)(((e,t)=>n({...e,type:"info"},t)),[n]),p=(0,i.useCallback)(((e,t,n,o,r=u)=>{var i,s;n&&a({id:e,data:t,message:n.data instanceof Error?"":(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(i=n.data)||void 0===i?void 0:i.code)||n.status||n}}),description:(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:(null===(s=n.data)||void 0===s?void 0:s.message)||n.error}}),placement:r,innerException:(null===n||void 0===n?void 0:n.data)instanceof Error?n.data:n},o)}),[a]);return(0,i.useMemo)((()=>({notify:n,success:l,error:a,warning:f,fromError:p,info:v})),[n,l,a,f,p,v])}function m(){const{notify:e}=p();(0,a.D3)(l.Sb,e)}},23287:(e,t,n)=>{n.d(t,{CY:()=>a,s9:()=>l});var o=n(92810),r=n(92032);function i(e){return{__:e.__.bind(e),_x:e._x.bind(e),_n:e._n.bind(e),_nx:e._nx.bind(e),sprintf:r.nv,isRTL:e.isRTL.bind(e),hasTranslation:e.hasTranslation.bind(e)}}const s=(0,o.createContext)(i(r.y3));function a(e){const{children:t,i18n:n=r.y3}=e,[,a]=(0,o.useReducer)((()=>[]),[]);(0,o.useEffect)((()=>n.subscribe(a)),[n]);const l=(0,o.useMemo)((()=>i(n)),[n]);return(0,o.createElement)(s.Provider,{value:l},t)}const l=()=>(0,o.useContext)(s)},42068:(e,t,n)=>{n.d(t,{Z:()=>i,c:()=>s});var o=n(92810),r=n(87686);const i=(e,t)=>{const n=(0,o.useRef)();n.current=e;const r=(0,o.useRef)(void 0);(0,o.useEffect)((()=>{null!==r.current&&n.current(r.current||[]),r.current=t}),t)};function s(e,t){const n=(0,o.useRef)(),i=(0,o.useCallback)((()=>{const e=n.current;e&&(0,r.eF)(e.halt)}),[]);(0,o.useEffect)((()=>()=>i()),[i]);const s=(0,o.useCallback)(e,t);return[(0,o.useCallback)(((...e)=>{i();const t=(0,r.eF)((()=>s(...e)));return n.current=t,t}),[i,s]),i]}},69156:(e,t,n)=>{n.d(t,{A5:()=>d,FN:()=>c,Hk:()=>l,c8:()=>u});var o=n(92810),r=n(85163),i=n(45695);const s=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=dark]"),a=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=light]"),l=e=>{let t,n;e===r.IJ?(t=r.vd,n=r.F3):(t=e===r.T?r.y2:r.CJ,n=e===r.nd?r.y2:r.CJ),[...a].forEach((e=>{e.media=t})),[...s].forEach((e=>{e.media=n}))},c=(e={})=>{const t=document.querySelector("head"),n=document.createElement("style");if(n.type="text/css",n.dataset.themeVaribalse=!0,Object.entries(e).length){let o="";Object.entries(e).forEach((([e,t])=>{"object"!==typeof t&&(o+=`\t--${e}: ${t};\n`)})),o=`.blocks-body, .blocks-app, .ant-modal-root, .ant-tooltip, .ant-notification {\n${o}}`,n.appendChild(document.createTextNode(o));const r=t.querySelector('[data-theme-varibalse="true"]');r?t.replaceChild(n,r):t.insertBefore(n,t.firstChild)}},d=e=>{const t=document.body;t.classList.contains(e)||setTimeout((()=>{t.classList.remove(e===r.nd?r.T:r.nd),t.classList.add(e)}),200)},u=()=>{const e=(0,i.XW)();return(0,o.useCallback)((()=>{const t=window.localStorage.getItem(r.V0.em_color_scheme),n=matchMedia(r.F3).matches?r.nd:r.T,o=t||n;e({operation:r.Ru.UPDATE_PREVIEW,theme:o})}),[e])}},31770:(e,t,n)=>{function o(e){return e}function r({data:e,...t},n){return t.error?t:{data:n(e,t.meta),...t}}function i(e){return t=>r(t,e)}function s(e){return t=>r(t,((t,n)=>t.hasOwnProperty("previous")?e(t.previous,n):e(t,n)))}function a(e){return t=>function({data:e,...t},n){return t.error?t:{data:e.map((e=>n(e,t.meta))),...t}}(t,e)}n.d(t,{Ih:()=>a,PI:()=>s,SA:()=>r,SC:()=>i,ur:()=>o})},84869:(e,t,n)=>{function o(e,t){if("object"===typeof e&&e){t(e);for(const n of Object.values(e))o(n,t)}}function r(e=".blocks-app"){e=`${e} &`;const t=new WeakSet;return{visit:n=>{if(!t.has(n)){const r={};let i;for(const s of Object.keys(n)){const a=n[s];"object"===typeof a&&a?(a._keyframe&&o(a,(e=>t.add(e))),r[s]=a):(i||(i=r[e]={},t.add(i)),i[s]=a)}return r}return n}}}n.d(t,{A:()=>r})},44824:(e,t,n)=>{n.d(t,{e:()=>r});var o=n(26453);async function r(e,t){if("amp"===t){for(const t of e.querySelectorAll(".em-amp-show-disabled"))t.remove();await(0,o.Sc)(e,{mappedTags:{script:"___script"}})}else if("html"===t){for(const t of e.querySelectorAll(".em-amp-show-only"))t.remove();(0,o.Km)(e,{mappedTags:{script:"___script"}})}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8458],{90219:(e,t,a)=>{a.d(t,{A:()=>B});var s=a(92810),l=a(95838),i=a(12280),n=a(55039),r=a(81662),o=a(66522),c=a(71086),m=a(66726),d=a(81e3),u=a(8701),p=a(28372),h=a(45934),_=a(64617),g=a(23287),A=a(38883),x=a.n(A),j=a(69292),v=a(55701),y=a(86739),b=a(84568),f=a(93563),k=a(8493),w=a(87790),O=a(65983),N=a(56991),D=a(32269),C=a(85163),I=a(70082);const{useToken:E}=l.A,{title:P,description:L,tags:S,type:U,is_template:z,group:T}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},M={[P]:"",[L]:"",[S]:[],[z]:!1},G={[L]:"",[S]:[],[U]:""};const F=({className:e,element:t})=>{var a,l;const{__:A}=(0,g.s9)(),{projectId:z}=(0,_.g)(),F=(0,h.wA)(),[B]=i.A.useForm(),{token:V}=E(),R=(0,N.rD)(),q=(0,h.Pj)(),K=(0,h.d4)(O.UI),{data:W}=(0,v.h1)(),{data:Y}=(0,_.KC)(),Q=t.hasOwnProperty("type")?C.IE:C.Tm,H=t.hasOwnProperty("type")?C.YY:C.zh,{refetch:$,isLoading:Z,isFetching:X,isUninitialized:J,isSuccess:ee}=(0,f.Oo)({parent:null===(a=Y.group)||void 0===a?void 0:a[0]},{skip:!(null!==(l=Y.group)&&void 0!==l&&l[0])});(0,s.useEffect)((()=>{!J&&$()}),[J,$]);const[te,ae]=(0,s.useState)([]),[se,le]=(0,s.useState)([]),[ie,ne]=(0,s.useState)(t.is_template||!1),{data:re}=b.Nq.endpoints.getProject.select(+z)(q.getState());(0,s.useEffect)((()=>{!J&&$()}),[t.group,$,J]),(0,s.useEffect)((()=>{if(ee&&t.is_template&&t.group.length){const e=t.group;let a={};e.length&&K.length&&(null===e||void 0===e||e.forEach((e=>{null===K||void 0===K||K.forEach((t=>{let s=t.children.find((t=>t.id===e));s&&(a.hasOwnProperty(t.id)||(a[t.id]=[]),a[t.id].push({label:s.name,value:s.id}))}))})));let s={};for(let t in a)a.hasOwnProperty(+t)&&(s[`group_${t}`]=a[t].map((e=>({...e,value:String(e.value)}))));B.setFieldsValue(s)}}),[B,K,t.is_template,t.group,ee]),(0,s.useEffect)((()=>{var e;le(null===(e=function(e){const t=new Set;return null===e||void 0===e?void 0:e.filter((e=>!t.has(e.name)&&(t.add(e.name),!0)))}((0,D.HT)(re,H)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,H]),(0,s.useEffect)((()=>{if(t){var e,a;const s=null===(e=(0,D._q)(t,H))||void 0===e?void 0:e.map((e=>e.name)),l=t.emailtags||t.blocktags,i=null===(a=(0,D._q)(t,H))||void 0===a?void 0:a.filter((e=>l.includes(e.id))).map((e=>e.name));B.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||s,type:t.type})}}),[B,t,H]);(0,s.useEffect)((()=>{if(W){const e=W.schema.properties.acf.properties.type.items.enum;let t=[];const a={Applications:A("Apps"),Articles:A("Article"),Banners:A("Banners"),Buttons:A("Buttons"),"Call to Action":A("Call to Action"),Contacts:A("Contacts"),Content:A("Content"),"E-Commerce":A("E-Commerce"),Feature:A("Features"),Footer:A("Footers"),Header:A("Headers"),Lists:A("Lists"),Menu:A("Menus"),Other:A("Others"),Polls:A("Polls"),Promocodes:A("Promocodes"),Separators:A("Separators")};for(let s in e)t.push({label:a[e[s]],value:e[s]});ae(t)}}),[W,A]);return(0,I.jsx)("div",{className:x()("settings-panel",{[e]:e}),children:(0,I.jsxs)(i.A,{form:B,layout:"vertical",name:"settings_panel_form",initialValues:Q===C.Tm?{EmailInitialValues:M}:G,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a.split("_")[0]){case P:t.isNew?F((0,k.BQ)(e[a])):F((0,O.VK)(e[a]));break;case T:F((0,O.Bu)({[a.split("_")[1]]:e[a]}));break;case L:Q===C.Tm?t.isNew?F((0,k.Zs)(e[a])):F(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[a]})}))):t.isNew?F((0,w.AS)(e[a])):F(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[a]})})));break;case"is":t.isNew?F((0,k.TC)(e[a])):F(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[a]})})));break;case S:{const s=e[a].map((e=>e.trim()));Q===C.Tm?t.isNew?F((0,k.yY)(s)):F(y.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:s})}))):t.isNew?F((0,w.TB)(s)):F(v.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:s})})));break}case U:F(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[a]})})));break;default:return}},autoComplete:"off",children:[R.subjectEnabled&&Q===C.Tm&&(0,I.jsx)(i.A.Item,{label:A("Title"),name:P,tooltip:{title:A("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type title here"),autoSize:{minRows:1}})}),R.descriptionEnabled&&(0,I.jsx)(i.A.Item,{label:A("Description"),name:L,tooltip:{title:A("Description is used in other sections of the service."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type your description here"),autoSize:{minRows:2}})}),R.tagsEnabled&&(0,I.jsx)(i.A.Item,{label:A("Tags"),name:S,tooltip:{title:A("Tags help you find the block in the list."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input your username!",type:"array"}],children:(0,I.jsx)(r.A,{mode:"tags",style:{width:"100%"},placeholder:A("Type your tags here"),options:se,tagRender:e=>{const{label:t,closable:a,onClose:s}=e;return(0,I.jsx)(o.A,{color:V.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:a,onClose:s,style:{borderRadius:6},children:t})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})}),(0,I.jsx)(c.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),Q===C.Tm&&R.isTemplateEnabled&&(0,I.jsx)(m.A,{title:t.isNew?A("Save email first."):A("Use this email as a template for creating future emails."),children:(0,I.jsxs)(d.A,{size:10,align:"baseline",children:[(0,I.jsx)(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:ie,children:(0,I.jsx)(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ne(e)},disabled:t.isNew})}),(0,I.jsx)("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:V.colorText},children:(0,I.jsx)("label",{htmlFor:"setIsTemplate",children:A("Is a template")})})]})},"isTemplate"),ie&&(0,I.jsx)(j.A,{element:t,refetchProjectGroups:$,isLoading:Z||X}),Q===C.IE&&(0,I.jsx)(i.A.Item,{name:U,label:A("Type"),tooltip:{title:A("Select the block type to find any block on the list faster."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input type!"}],children:(0,I.jsx)(r.A,{placeholder:A("Choose block type"),options:te,getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})]})})};F.defaultProps={className:"",email:void 0};const B=F},13465:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(68694),n=a.n(i),r=a(38610),o=a.n(r),c=a(73248),m=a.n(c),d=a(41705),u=a.n(d),p=a(96588),h=a.n(p),_=a(97433),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},85291:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(69029),n=a.n(i),r=a(41579),o=a.n(r),c=a(70869),m=a.n(c),d=a(8456),u=a.n(d),p=a(20931),h=a.n(p),_=a(24186),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},57903:(e,t,a)=>{a.d(t,{A:()=>u});a(92810);var s=a(59018),l=a.n(s),i=a(23287),n=a(71157),r=a(86739),o=a(55701),c=a(32269),m=a(70082);const d=({element:e})=>{const{__:t,_x:a}=(0,i.s9)(),[s]=(0,r.dN)(),[l]=(0,o.OZ)(),d=(0,n.hN)(),u=(e,s)=>{if(e.error)return(0,c.p6)(e,d),!1;(0,c.wB)(t("The ")+(s.hasOwnProperty("type")?t("block"):a("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(s.lock?s.hasOwnProperty("type")?a("unlocked.","block"):a("unlocked.","email"):s.hasOwnProperty("type")?a("locked.","block"):a("locked.","email")),d)};return(0,m.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?l({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):s({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))},children:e.lock?t("Unlock"):t("Lock")})};d.defaultProps={element:l().shape({lock:null,id:null})};const u=d},90775:(e,t,a)=>{a.d(t,{A:()=>A});var s=a(92810),l=a(12280),i=a(14852),n=a(43005),r=a(2018),o=a(7744),c=a(55039),m=a(71157),d=a(45934),u=a(23287),p=a(64936),h=a(32269),_=a(40869),g=a(70082);const A=({isModalVisible:e,userEmail:t,subscriptionRequest:a,userName:A,currentPlane:x})=>{const{__:j}=(0,u.s9)(),v=(0,d.wA)(),[y]=l.A.useForm(),[b,f]=(0,_.E)(),k=(0,m.hN)(),w=()=>{v((0,p.Oo)())},O=()=>{y.validateFields().then((()=>{const e=y.getFieldsValue(!0);b(JSON.stringify(e)).then((e=>{var t,a,s;200===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.status)?((0,h.wB)(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.message,k),w()):e.error&&(0,h.p6)(e,k)}))})).catch((e=>{console.warn(e)}))};return(0,s.useEffect)((()=>{a&&(null===y||void 0===y||y.setFieldsValue({request_tariff:a,user_name:A,user_email:t,user_tariff:x}))}),[y,a,x,A,t]),(0,g.jsx)(i.A,{title:j("Request for changing the pricing plan"),className:"blocks-modal",open:e,onOk:O,onCancel:w,centered:!0,width:572,footer:[(0,g.jsx)(n.Ay,{type:"primary",size:"large",onClick:O,disabled:f.isLoading,children:j("Send")},"submit")],forceRender:!0,children:(0,g.jsxs)(l.A,{form:y,layout:"vertical",name:"switch_to_plan_form",onFinish:O,initialValues:{request_email:t,request_phone:"",comment:"",request_tariff:a},autoComplete:"off",style:{padding:"10px 24px 0"},children:[(0,g.jsxs)(r.A,{gutter:16,children:[(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Email"),name:"request_email",rules:[{required:!0,message:j("Please enter your email address"),validator:(e,t)=>h.au.test(t)?Promise.resolve():Promise.reject(new Error(j("Please enter the correct email.")))}],children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Email"),type:"email"})})]}),(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Phone number"),name:"request_phone",children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Phone number")})})]})]}),(0,g.jsx)(l.A.Item,{label:j("Comment"),name:"comment",children:(0,g.jsx)(c.A.TextArea,{placeholder:j("Please add a comment to your request"),autoSize:{minRows:2}})})]})})}},4519:(e,t,a)=>{a.d(t,{A:()=>y});var s=a(92810),l=a(41919),i=a(76662),n=a(81e3),r=a(66726),o=a(43005),c=a(64617),m=a(58013),d=a(23287),u=a(29718),p=a(30961),h=a(20757),_=a(32269),g=a(85163),A=a(90070),x=a(70082);const{Content:j}=l.A,{Paragraph:v}=i.A,y=()=>{const{__:e}=(0,d.s9)(),{projectId:t,emailId:a}=(0,c.g)(),i=(0,A.p6)();let y=(0,c.Zp)();const b=i.get(g.A9.em_template_email)||a;(0,s.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const f=(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(n.A,{size:10,children:[(0,x.jsx)(r.A,{title:e("To emails"),placement:"left",children:(0,x.jsx)(o.Ay,{type:"text",icon:(0,x.jsx)(m.A,{}),onClick:()=>(0,_.XZ)(y,`/projects/${t}`),shape:"circle"})}),(0,x.jsx)(v,{className:"ant-page-header-heading-title",children:e("Select email template")}),(0,x.jsx)(p.A,{isBlocks:!1,templateEmailId:b})]})}),k=(0,x.jsx)(x.Fragment,{});return(0,x.jsxs)(l.A,{className:"template-page",children:[(0,x.jsx)(h.A,{leftBlock:f,rightBlock:k}),(0,x.jsx)(j,{className:"template-page__container",children:(0,x.jsx)("div",{className:"template-page__content container",children:(0,x.jsx)(u.A,{projectId:g.p5,emailsView:g.Y$,templateEmailId:b})})})]})}},70656:(e,t,a)=>{a.d(t,{A:()=>_});var s=a(92810),l=a(37005),i=a(66726),n=a(45934),r=a(39990),o=a(62303),c=a(65983),m=a(69156),d=a(23287),u=a(45695),p=a(85163),h=a(70082);const _=()=>{var e;const{__:t}=(0,d.s9)(),a=(0,n.wA)(),[_]=(0,r.b9)(),[g,A]=(0,s.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(p.V0.em_color_scheme)),x=(0,u.XW)(),j=(0,s.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,m.Hk)(e),null===e){const e=matchMedia(p.F3).matches?p.nd:p.T;localStorage.removeItem(p.V0.em_color_scheme),t=e}else localStorage.setItem(p.V0.em_color_scheme,e),t=e;a((0,c.eX)(t===p.nd?`vs-${t}`:p.T)),(0,m.A5)(t),x({operation:p.Ru.UPDATE_PREVIEW,theme:t}),_({theme:e})})(t),A(t)}),[a,_,x]);return(0,s.useEffect)((()=>{matchMedia(p.F3).onchange=()=>j()}),[j]),(0,h.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,h.jsx)(l.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:g,options:[{label:(0,h.jsx)(i.A,{title:t("Light theme"),children:(0,h.jsx)(o.A,{icon:"LightMode",style:{fontSize:18}})}),value:p.T},{label:(0,h.jsx)(i.A,{title:t("System theme"),children:(0,h.jsx)(o.A,{icon:"AutoMode",style:{fontSize:18}})}),value:null},{label:(0,h.jsx)(i.A,{title:t("Dark theme"),children:(0,h.jsx)(o.A,{icon:"DarkMode",style:{fontSize:18}})}),value:p.nd}],onChange:e=>j(e)})})}},54565:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(92810),l=a(12280),i=a(29234),n=a(55039),r=a(28372),o=a(45934),c=a(38883),m=a.n(c),d=a(23287),u=a(86739),p=a(8493),h=a(70082);const{utm_source:_,utm_medium:g,utm_campaign:A,utm_term:x,utm_content:j}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},v={[_]:"",[g]:"",[A]:"",[x]:"",[j]:""},y=({className:e,email:t})=>{const{__:a}=(0,d.s9)(),c=(0,o.wA)(),[y]=l.A.useForm();(0,s.useEffect)((()=>{var e,a,s,l,i;t&&y.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_medium)||"",utm_campaign:(null===(s=t.utm_parameters)||void 0===s?void 0:s.utm_campaign)||"",utm_term:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[y,t]);return(0,h.jsx)("div",{className:m()("settings-panel",{[e]:e}),children:(0,h.jsxs)(l.A,{form:y,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case _:t.isNew?c((0,p.K3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[a]}})})));break;case g:t.isNew?c((0,p.ol)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[a]}})})));break;case A:t.isNew?c((0,p.P3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[a]}})})));break;case x:t.isNew?c((0,p.zH)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[a]}})})));break;case j:t.isNew?c((0,p.mk)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[a]}})})));break;default:return}},autoComplete:"off",children:[(0,h.jsx)(i.A,{message:a("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),(0,h.jsx)(l.A.Item,{label:a("utm_source"),name:_,tooltip:{title:a("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("google")})}),(0,h.jsx)(l.A.Item,{label:a("utm_medium"),name:g,tooltip:{title:a("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("cpc")})}),(0,h.jsx)(l.A.Item,{label:a("utm_campaign"),name:A,tooltip:{title:a("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("spring_sale")})}),(0,h.jsx)(l.A.Item,{label:a("utm_term"),name:x,tooltip:{title:a("Identifies search terms. For example: utm_term=running+shoes"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("running+shoes")})}),(0,h.jsx)(l.A.Item,{label:a("utm_content"),name:j,tooltip:{title:a("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("textlink")})})]})})};y.defaultProps={className:"",email:void 0};const b=y},5559:(e,t,a)=>{a.d(t,{A:()=>w});var s=a(92810),l=a(76662),i=a(43005),n=a(4800),r=a(55039),o=a(66726),c=a(45934),m=a(38883),d=a.n(m),u=a(23287),p=a(77532),h=a(62303),_=a(92779),g=a(64936),A=a(95679),x=a(86286),j=a(36404),v=a(56991),y=a(85163),b=a(85677),f=a(70082);const{Text:k}=l.A,w=({onChange:e,value:t,validateStatus:a,placeholder:l,disabled:m,name:w,elementSettings:O,imageInfo:N})=>{var D,C;const I=(0,c.d4)(x.C1),E=(0,c.d4)(x.B$),P=(0,c.d4)(j.yN),L=(0,v.rD)(),{__:S}=(0,u.s9)(),[U,z]=(0,s.useState)({width:"",height:"",size:""}),[T,M]=(0,s.useState)(!1),[G,F]=(0,s.useState)(0);let B=(0,c.wA)();const V=(0,c.d4)(p.js),R=(0,c.d4)(p.Uf),q=(0,c.d4)(p.Ac),K=(0,c.d4)(g.cL),[W]=(0,A.FQ)();let Y=!E&&(null===(D=I.id)||void 0===D?void 0:D.toString())===(null===P||void 0===P||null===(C=P.members)||void 0===C?void 0:C.owner.ID);(0,s.useEffect)((()=>{t&&W(t).then((({data:e})=>{e&&z({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(0),format:null===e||void 0===e?void 0:e.format})}))}),[t,W]),(0,s.useEffect)((()=>{m||(w.startsWith("src")&&V&&((null===O||void 0===O?void 0:O.type)!==y.bV.CAROUSEL||R===w&&!K)?e(V):"backgroundImage"===w&&q&&((null===O||void 0===O?void 0:O.type)!==y.bV.CAROUSEL||R===w&&!K)&&e(q),K&&(null===O||void 0===O?void 0:O.type)===y.bV.CAROUSEL||!R||B((0,p.BK)()))}),[V,R,q,e,w,m,null===O||void 0===O?void 0:O.type,B,K]);const Q=(e=null)=>{w.startsWith("src")?(B((0,p.Yw)(w)),B((0,p.tm)(t)),B((0,g.qf)(e||y.lx.UPLOAD_IMAGE_MODAL))):w.startsWith("backgroundImage")&&(B((0,p.Yw)(w)),B((0,p.e_)(t)),B((0,g.qf)(e||y.lx.UPLOAD_BACKGROUND_MODAL)))},H=[{label:S("Upload"),key:"Upload",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];L.imageCenterStockEnabled&&H.push({label:S("Stock"),key:"Stock",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_STOCK:y.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),L.imageCenterGifEnabled&&H.push({label:S("GIF"),key:"GIF",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_GIF:y.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),L.elementAIimageEnabled&&H.push({label:S("AI"),key:"AI",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_AI:y.lx.UPLOAD_BACKGROUND_MODAL_AI)});return(0,f.jsxs)("div",{className:d()("upload-bg-image",{"upload-bg-image_disabled":m}),children:[!t||t&&"error"===a?(0,f.jsxs)(i.Ay,{type:"default",block:!0,onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD),children:[(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),S("Add image")]}):(0,f.jsxs)("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,a,s,l;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(a=e.target)&&void 0!==a&&a.closest(".upload-bg-image__edit-menu")||null!==(s=e.target)&&void 0!==s&&s.closest(".upload-bg-image__menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".inputGroup")||Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},children:[(0,f.jsx)(n.A,{arrow:!0,dropdownRender:()=>L.imagePathDropdownEnabled?(0,f.jsx)("div",{className:"inputGroup",children:(0,f.jsx)(r.A,{prefix:(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:l,name:w,disabled:m,className:"upload-bg-image__input"})}):(0,f.jsx)(f.Fragment,{}),overlayClassName:"upload-bg-image__dropdown-overlay",overlayStyle:{top:32,marginTop:"8px",width:347,left:0},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".upload-bg-image__inner-wrap"),children:(0,f.jsxs)("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"},children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content",children:(0,f.jsxs)("div",{className:"upload-bg-image__uploader-content-inner",children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader-img-wrap",children:(0,f.jsx)("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})}),(0,f.jsx)("div",{className:"upload-bg-image__uploader-icons-wrap",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content"})})]})})}),U.width&&U.height?(0,f.jsxs)("div",{className:"image-size",children:[U.width," \xd7 ",U.height,!!O&&(O.type===y.bV.IMG||O.type===y.bV.CAROUSEL)&&" \u2192 "+N.renderedWidth+" \xd7 "+N.renderedHeight,(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsxs)("span",{children:[U.size," ",S("kB")]}),U.format&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsx)("span",{className:"image-size-format",children:U.format})]})]}):(0,f.jsx)(k,{type:"secondary",className:"image-empty-text",children:l})]})}),(0,f.jsx)("div",{style:{flexGrow:1}}),"gif"!==U.format&&L.imageCenterEditorEnabled&&(0,f.jsx)(o.A,{title:S("Edit"),children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit",children:(0,f.jsx)(b.A,{style:{fontSize:16},onClick:e=>{Y?(M(!0),F(5)):(Q(),B((0,g.Wz)(y.lx.IMAGE_EDITOR_MODAL)))}})})}),(0,f.jsx)(n.A,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:H},overlayClassName:"upload-bg-image__menu",children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit-menu image-change",children:!t||t&&"error"===a?S("Upload"):(0,f.jsx)(h.A,{style:{fontSize:20},icon:"Reload",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})})},"Actions")]}),(0,f.jsx)(_.A,{open:T,onCancel:()=>{M(!1)},initialSlide:G})]})}},13591:()=>{}}]);
|
|
1
|
+
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8458],{90219:(e,t,a)=>{a.d(t,{A:()=>F});var s=a(92810),l=a(95838),i=a(12280),n=a(55039),r=a(81662),o=a(66522),c=a(71086),m=a(66726),d=a(81e3),u=a(8701),p=a(28372),h=a(45934),_=a(64617),g=a(23287),A=a(38883),x=a.n(A),j=a(69292),v=a(55701),y=a(86739),b=a(84568),f=a(93563),k=a(8493),w=a(87790),O=a(65983),N=a(56991),D=a(32269),C=a(85163),I=a(70082);const{useToken:E}=l.A,{title:P,description:L,tags:S,type:U,is_template:z,group:T}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},M={[P]:"",[L]:"",[S]:[],[z]:!1},G={[L]:"",[S]:[],[U]:""};const B=({className:e,element:t})=>{var a,l;const{__:A}=(0,g.s9)(),{projectId:z}=(0,_.g)(),B=(0,h.wA)(),[F]=i.A.useForm(),{token:V}=E(),R=(0,N.rD)(),q=(0,h.Pj)(),K=(0,h.d4)(O.UI),{data:W}=(0,v.h1)(),{data:Y}=(0,_.KC)(),Q=t.hasOwnProperty("type")?C.IE:C.Tm,H=t.hasOwnProperty("type")?C.YY:C.zh,{refetch:$,isLoading:Z,isFetching:X,isUninitialized:J,isSuccess:ee}=(0,f.Oo)({parent:null===(a=Y.group)||void 0===a?void 0:a[0]},{skip:!(null!==(l=Y.group)&&void 0!==l&&l[0])});(0,s.useEffect)((()=>{!J&&$()}),[J,$]);const[te,ae]=(0,s.useState)([]),[se,le]=(0,s.useState)([]),[ie,ne]=(0,s.useState)(t.is_template||!1),{data:re}=b.Nq.endpoints.getProject.select(+z)(q.getState());(0,s.useEffect)((()=>{!J&&$()}),[t.group,$,J]),(0,s.useEffect)((()=>{if(ee&&t.is_template&&t.group.length){const e=t.group;let a={};e.length&&K.length&&(null===e||void 0===e||e.forEach((e=>{null===K||void 0===K||K.forEach((t=>{let s=t.children.find((t=>t.id===e));s&&(a.hasOwnProperty(t.id)||(a[t.id]=[]),a[t.id].push({label:s.name,value:s.id}))}))})));let s={};for(let t in a)a.hasOwnProperty(+t)&&(s[`group_${t}`]=a[t].map((e=>({...e,value:String(e.value)}))));F.setFieldsValue(s)}}),[F,K,t.is_template,t.group,ee]),(0,s.useEffect)((()=>{var e;le(null===(e=function(e){const t=new Set;return null===e||void 0===e?void 0:e.filter((e=>!t.has(e.name)&&(t.add(e.name),!0)))}((0,D.HT)(re,H)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,H]),(0,s.useEffect)((()=>{if(t){var e,a;const s=null===(e=(0,D._q)(t,H))||void 0===e?void 0:e.map((e=>e.name)),l=t.emailtags||t.blocktags,i=null===(a=(0,D._q)(t,H))||void 0===a?void 0:a.filter((e=>l.includes(e.id))).map((e=>e.name));F.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||s,type:t.type})}}),[F,t,H]);(0,s.useEffect)((()=>{if(W){const e=W.schema.properties.acf.properties.type.items.enum;let t=[];const a={Applications:A("Apps"),Articles:A("Article"),Banners:A("Banners"),Buttons:A("Buttons"),"Call to Action":A("Call to Action"),Contacts:A("Contacts"),Content:A("Content"),"E-Commerce":A("E-Commerce"),Feature:A("Features"),Footer:A("Footers"),Header:A("Headers"),Lists:A("Lists"),Menu:A("Menus"),Other:A("Others"),Polls:A("Polls"),Promocodes:A("Promocodes"),Separators:A("Separators")};for(let s in e)t.push({label:a[e[s]],value:e[s]});ae(t)}}),[W,A]);return(0,I.jsx)("div",{className:x()("settings-panel",{[e]:e}),children:(0,I.jsxs)(i.A,{form:F,layout:"vertical",name:"settings_panel_form",initialValues:Q===C.Tm?{EmailInitialValues:M}:G,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a.split("_")[0]){case P:t.isNew?B((0,k.BQ)(e[a])):B((0,O.VK)(e[a]));break;case T:B((0,O.Bu)({[a.split("_")[1]]:e[a]}));break;case L:Q===C.Tm?t.isNew?B((0,k.Zs)(e[a])):B(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[a]})}))):t.isNew?B((0,w.AS)(e[a])):B(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[a]})})));break;case"is":t.isNew?B((0,k.TC)(e[a])):B(y.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[a]})})));break;case S:{const s=e[a].map((e=>e.trim()));Q===C.Tm?t.isNew?B((0,k.yY)(s)):B(y.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:s})}))):t.isNew?B((0,w.TB)(s)):B(v.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:s})})));break}case U:B(v.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[a]})})));break;default:return}},autoComplete:"off",children:[R.subjectEnabled&&Q===C.Tm&&(0,I.jsx)(i.A.Item,{label:A("Title"),name:P,tooltip:{title:A("The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type title here"),autoSize:{minRows:1}})}),R.descriptionEnabled&&(0,I.jsx)(i.A.Item,{label:A("Description"),name:L,tooltip:{title:A("Description is used in other sections of the service."),icon:(0,I.jsx)(p.A,{})},children:(0,I.jsx)(n.A.TextArea,{placeholder:A("Type your description here"),autoSize:{minRows:2}})}),R.tagsEnabled&&(0,I.jsx)(i.A.Item,{label:A("Tags"),name:S,tooltip:{title:A("Tags help you find the block in the list."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input your username!",type:"array"}],children:(0,I.jsx)(r.A,{mode:"tags",style:{width:"100%"},placeholder:A("Type your tags here"),options:se,tagRender:e=>{const{label:t,closable:a,onClose:s}=e;return(0,I.jsx)(o.A,{color:V.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:a,onClose:s,style:{borderRadius:6},children:t})},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})}),(0,I.jsx)(c.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),Q===C.Tm&&R.isTemplateEnabled&&(0,I.jsx)(m.A,{title:t.isNew?A("Save email first."):A("Use this email as a template for creating future emails."),children:(0,I.jsxs)(d.A,{size:10,align:"baseline",children:[(0,I.jsx)(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:ie,children:(0,I.jsx)(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ne(e)},disabled:t.isNew})}),(0,I.jsx)("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:V.colorText},children:(0,I.jsx)("label",{htmlFor:"setIsTemplate",children:A("Is a template")})})]})},"isTemplate"),ie&&(0,I.jsx)(j.A,{element:t,refetchProjectGroups:$,isLoading:Z||X}),Q===C.IE&&(0,I.jsx)(i.A.Item,{name:U,label:A("Type"),tooltip:{title:A("Select the block type to find any block on the list faster."),icon:(0,I.jsx)(p.A,{})},rules:[{message:"Please input type!"}],children:(0,I.jsx)(r.A,{placeholder:A("Choose block type"),options:te,getPopupContainer:()=>document.querySelector(".email-settings__collapse")})})]})})};B.defaultProps={className:"",email:void 0};const F=B},13465:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(68694),n=a.n(i),r=a(38610),o=a.n(r),c=a(73248),m=a.n(c),d=a(41705),u=a.n(d),p=a(96588),h=a.n(p),_=a(97433),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},85291:(e,t,a)=>{a.d(t,{A:()=>v});a(92810);var s=a(2018),l=a(7744),i=a(69029),n=a.n(i),r=a(41579),o=a.n(r),c=a(70869),m=a.n(c),d=a(8456),u=a.n(d),p=a(20931),h=a.n(p),_=a(24186),g=a.n(_),A=a(32269),x=(a(13591),a(70082));const j=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:u()},{sizeArray:[8,8,8],name:"column-three",html:h()},{sizeArray:[6,6,6,6],name:"column-four",html:g()},{sizeArray:[8,16],name:"column-two-33",html:o()},{sizeArray:[16,8],name:"column-two-66",html:m()}],v=()=>{const e=(0,A.sh)(),t=(0,A._9)();return(0,x.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,x.jsx)("div",{className:"structures__list",children:(0,x.jsx)("div",{children:j&&j.map(((a,i)=>(0,x.jsx)("div",{children:(0,x.jsx)("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,a.html),onDragStart:e=>t(e,a.html),children:(0,x.jsx)(s.A,{gutter:[6,6],className:"structures__item-row",children:a.sizeArray.map(((e,t)=>(0,x.jsx)(l.A,{span:e,children:(0,x.jsx)("div",{className:"structures__item-col"})},a.name+t)))})})},a.name)))})})})}},57903:(e,t,a)=>{a.d(t,{A:()=>u});a(92810);var s=a(59018),l=a.n(s),i=a(23287),n=a(71157),r=a(86739),o=a(55701),c=a(32269),m=a(70082);const d=({element:e})=>{const{__:t,_x:a}=(0,i.s9)(),[s]=(0,r.dN)(),[l]=(0,o.OZ)(),d=(0,n.hN)(),u=(e,s)=>{if(e.error)return(0,c.p6)(e,d),!1;(0,c.wB)(t("The ")+(s.hasOwnProperty("type")?t("block"):a("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(s.lock?s.hasOwnProperty("type")?a("unlocked.","block"):a("unlocked.","email"):s.hasOwnProperty("type")?a("locked.","block"):a("locked.","email")),d)};return(0,m.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?l({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):s({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))},children:e.lock?t("Unlock"):t("Lock")})};d.defaultProps={element:l().shape({lock:null,id:null})};const u=d},90775:(e,t,a)=>{a.d(t,{A:()=>A});var s=a(92810),l=a(12280),i=a(14852),n=a(43005),r=a(2018),o=a(7744),c=a(55039),m=a(71157),d=a(45934),u=a(23287),p=a(64936),h=a(32269),_=a(40869),g=a(70082);const A=({isModalVisible:e,userEmail:t,subscriptionRequest:a,userName:A,currentPlane:x})=>{const{__:j}=(0,u.s9)(),v=(0,d.wA)(),[y]=l.A.useForm(),[b,f]=(0,_.E)(),k=(0,m.hN)(),w=()=>{v((0,p.Oo)())},O=()=>{y.validateFields().then((()=>{const e=y.getFieldsValue(!0);b(JSON.stringify(e)).then((e=>{var t,a,s;200===(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.status)?((0,h.wB)(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.message,k),w()):e.error&&(0,h.p6)(e,k)}))})).catch((e=>{console.warn(e)}))};return(0,s.useEffect)((()=>{a&&(null===y||void 0===y||y.setFieldsValue({request_tariff:a,user_name:A,user_email:t,user_tariff:x}))}),[y,a,x,A,t]),(0,g.jsx)(i.A,{title:j("Request for changing the pricing plan"),className:"blocks-modal",open:e,onOk:O,onCancel:w,centered:!0,width:572,footer:[(0,g.jsx)(n.Ay,{type:"primary",size:"large",onClick:O,disabled:f.isLoading,children:j("Send")},"submit")],forceRender:!0,children:(0,g.jsxs)(l.A,{form:y,layout:"vertical",name:"switch_to_plan_form",onFinish:O,initialValues:{request_email:t,request_phone:"",comment:"",request_tariff:a},autoComplete:"off",style:{padding:"10px 24px 0"},children:[(0,g.jsxs)(r.A,{gutter:16,children:[(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Email"),name:"request_email",rules:[{required:!0,message:j("Please enter your email address"),validator:(e,t)=>h.au.test(t)?Promise.resolve():Promise.reject(new Error(j("Please enter the correct email.")))}],children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Email"),type:"email"})})]}),(0,g.jsxs)(o.A,{span:12,children:[" ",(0,g.jsx)(l.A.Item,{label:j("Phone number"),name:"request_phone",children:(0,g.jsx)(c.A,{size:"large",placeholder:j("Phone number")})})]})]}),(0,g.jsx)(l.A.Item,{label:j("Comment"),name:"comment",children:(0,g.jsx)(c.A.TextArea,{placeholder:j("Please add a comment to your request"),autoSize:{minRows:2}})})]})})}},4519:(e,t,a)=>{a.d(t,{A:()=>y});var s=a(92810),l=a(41919),i=a(76662),n=a(81e3),r=a(66726),o=a(43005),c=a(64617),m=a(58013),d=a(23287),u=a(29718),p=a(30961),h=a(20757),_=a(32269),g=a(85163),A=a(90070),x=a(70082);const{Content:j}=l.A,{Paragraph:v}=i.A,y=()=>{const{__:e}=(0,d.s9)(),{projectId:t,emailId:a}=(0,c.g)(),i=(0,A.p6)();let y=(0,c.Zp)();const b=i.get(g.A9.em_template_email)||a;(0,s.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const f=(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)(n.A,{size:10,children:[(0,x.jsx)(r.A,{title:e("To emails"),placement:"left",children:(0,x.jsx)(o.Ay,{type:"text",icon:(0,x.jsx)(m.A,{}),onClick:()=>(0,_.XZ)(y,`/projects/${t}`),shape:"circle"})}),(0,x.jsx)(v,{className:"ant-page-header-heading-title",children:e("Select email template")}),(0,x.jsx)(p.A,{isBlocks:!1,templateEmailId:b})]})}),k=(0,x.jsx)(x.Fragment,{});return(0,x.jsxs)(l.A,{className:"template-page",children:[(0,x.jsx)(h.A,{leftBlock:f,rightBlock:k}),(0,x.jsx)(j,{className:"template-page__container",children:(0,x.jsx)("div",{className:"template-page__content container",children:(0,x.jsx)(u.A,{projectId:g.p5,emailsView:g.Y$,templateEmailId:b})})})]})}},70656:(e,t,a)=>{a.d(t,{A:()=>_});var s=a(92810),l=a(37005),i=a(66726),n=a(45934),r=a(39990),o=a(62303),c=a(65983),m=a(69156),d=a(23287),u=a(45695),p=a(85163),h=a(70082);const _=()=>{var e;const{__:t}=(0,d.s9)(),a=(0,n.wA)(),[_]=(0,r.b9)(),[g,A]=(0,s.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(p.V0.em_color_scheme)),x=(0,u.XW)(),j=(0,s.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,m.Hk)(e),null===e){const e=matchMedia(p.F3).matches?p.nd:p.T;localStorage.removeItem(p.V0.em_color_scheme),t=e}else localStorage.setItem(p.V0.em_color_scheme,e),t=e;a((0,c.eX)(t===p.nd?`vs-${t}`:p.T)),(0,m.A5)(t),x({operation:p.Ru.UPDATE_PREVIEW,theme:t}),_({theme:e})})(t),A(t)}),[a,_,x]);return(0,s.useEffect)((()=>{matchMedia(p.F3).onchange=()=>j()}),[j]),(0,h.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,h.jsx)(l.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:g,options:[{label:(0,h.jsx)(i.A,{title:t("Light theme"),children:(0,h.jsx)(o.A,{icon:"LightMode",style:{fontSize:18}})}),value:p.T},{label:(0,h.jsx)(i.A,{title:t("System theme"),children:(0,h.jsx)(o.A,{icon:"AutoMode",style:{fontSize:18}})}),value:null},{label:(0,h.jsx)(i.A,{title:t("Dark theme"),children:(0,h.jsx)(o.A,{icon:"DarkMode",style:{fontSize:18}})}),value:p.nd}],onChange:e=>j(e)})})}},54565:(e,t,a)=>{a.d(t,{A:()=>b});var s=a(92810),l=a(12280),i=a(29234),n=a(55039),r=a(28372),o=a(45934),c=a(38883),m=a.n(c),d=a(23287),u=a(86739),p=a(8493),h=a(70082);const{utm_source:_,utm_medium:g,utm_campaign:A,utm_term:x,utm_content:j}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},v={[_]:"",[g]:"",[A]:"",[x]:"",[j]:""},y=({className:e,email:t})=>{const{__:a}=(0,d.s9)(),c=(0,o.wA)(),[y]=l.A.useForm();(0,s.useEffect)((()=>{var e,a,s,l,i;t&&y.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_medium)||"",utm_campaign:(null===(s=t.utm_parameters)||void 0===s?void 0:s.utm_campaign)||"",utm_term:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[y,t]);return(0,h.jsx)("div",{className:m()("settings-panel",{[e]:e}),children:(0,h.jsxs)(l.A,{form:y,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const a=Object.keys(e)[0];switch(a){case _:t.isNew?c((0,p.K3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[a]}})})));break;case g:t.isNew?c((0,p.ol)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[a]}})})));break;case A:t.isNew?c((0,p.P3)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[a]}})})));break;case x:t.isNew?c((0,p.zH)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[a]}})})));break;case j:t.isNew?c((0,p.mk)(e[a])):c(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[a]}})})));break;default:return}},autoComplete:"off",children:[(0,h.jsx)(i.A,{message:a("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),(0,h.jsx)(l.A.Item,{label:a("utm_source"),name:_,tooltip:{title:a("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("google")})}),(0,h.jsx)(l.A.Item,{label:a("utm_medium"),name:g,tooltip:{title:a("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("cpc")})}),(0,h.jsx)(l.A.Item,{label:a("utm_campaign"),name:A,tooltip:{title:a("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("spring_sale")})}),(0,h.jsx)(l.A.Item,{label:a("utm_term"),name:x,tooltip:{title:a("Identifies search terms. For example: utm_term=running+shoes"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("running+shoes")})}),(0,h.jsx)(l.A.Item,{label:a("utm_content"),name:j,tooltip:{title:a("Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink"),icon:(0,h.jsx)(r.A,{})},children:(0,h.jsx)(n.A,{placeholder:a("textlink")})})]})})};y.defaultProps={className:"",email:void 0};const b=y},5559:(e,t,a)=>{a.d(t,{A:()=>w});var s=a(92810),l=a(76662),i=a(43005),n=a(4800),r=a(55039),o=a(66726),c=a(45934),m=a(38883),d=a.n(m),u=a(23287),p=a(77532),h=a(62303),_=a(92779),g=a(64936),A=a(95679),x=a(86286),j=a(36404),v=a(56991),y=a(85163),b=a(85677),f=a(70082);const{Text:k}=l.A,w=({onChange:e,value:t,validateStatus:a,placeholder:l,disabled:m,name:w,elementSettings:O,imageInfo:N})=>{var D,C;const I=(0,c.d4)(x.C1),E=(0,c.d4)(x.B$),P=(0,c.d4)(j.yN),L=(0,v.rD)(),{__:S}=(0,u.s9)(),[U,z]=(0,s.useState)({width:"",height:"",size:""}),[T,M]=(0,s.useState)(!1),[G,B]=(0,s.useState)(0);let F=(0,c.wA)();const V=(0,c.d4)(p.js),R=(0,c.d4)(p.Uf),q=(0,c.d4)(p.Ac),K=(0,c.d4)(g.cL),[W]=(0,A.FQ)();let Y=!E&&(null===(D=I.id)||void 0===D?void 0:D.toString())===(null===P||void 0===P||null===(C=P.members)||void 0===C?void 0:C.owner.ID);(0,s.useEffect)((()=>{t&&W(t).then((({data:e})=>{e&&z({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(0),format:null===e||void 0===e?void 0:e.format})}))}),[t,W]),(0,s.useEffect)((()=>{m||(w.startsWith("src")&&V&&((null===O||void 0===O?void 0:O.type)!==y.bV.CAROUSEL||R===w&&!K)?(e(V),F((0,p.BK)())):"backgroundImage"===w&&q&&((null===O||void 0===O?void 0:O.type)!==y.bV.CAROUSEL||R===w&&!K)&&(e(q),F((0,p.BK)())),K&&(null===O||void 0===O?void 0:O.type)===y.bV.CAROUSEL||!R||F((0,p.BK)()))}),[V,R,q,e,w,m,null===O||void 0===O?void 0:O.type,F,K]);const Q=(e=null)=>{w.startsWith("src")?(F((0,p.Yw)(w)),F((0,p.tm)(t)),F((0,g.qf)(e||y.lx.UPLOAD_IMAGE_MODAL))):w.startsWith("backgroundImage")&&(F((0,p.Yw)(w)),F((0,p.e_)(t)),F((0,g.qf)(e||y.lx.UPLOAD_BACKGROUND_MODAL)))},H=[{label:S("Upload"),key:"Upload",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];L.imageCenterStockEnabled&&H.push({label:S("Stock"),key:"Stock",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_STOCK:y.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),L.imageCenterGifEnabled&&H.push({label:S("GIF"),key:"GIF",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_GIF:y.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),L.elementAIimageEnabled&&H.push({label:S("AI"),key:"AI",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_AI:y.lx.UPLOAD_BACKGROUND_MODAL_AI)});return(0,f.jsxs)("div",{className:d()("upload-bg-image",{"upload-bg-image_disabled":m}),children:[!t||t&&"error"===a?(0,f.jsxs)(i.Ay,{type:"default",block:!0,onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD),children:[(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),S("Add image")]}):(0,f.jsxs)("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,a,s,l;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(a=e.target)&&void 0!==a&&a.closest(".upload-bg-image__edit-menu")||null!==(s=e.target)&&void 0!==s&&s.closest(".upload-bg-image__menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".inputGroup")||Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},children:[(0,f.jsx)(n.A,{arrow:!0,dropdownRender:()=>L.imagePathDropdownEnabled?(0,f.jsx)("div",{className:"inputGroup",children:(0,f.jsx)(r.A,{prefix:(0,f.jsx)(h.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:l,name:w,disabled:m,className:"upload-bg-image__input"})}):(0,f.jsx)(f.Fragment,{}),overlayClassName:"upload-bg-image__dropdown-overlay",overlayStyle:{top:32,marginTop:"8px",width:347,left:0},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".upload-bg-image__inner-wrap"),children:(0,f.jsxs)("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"},children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content",children:(0,f.jsxs)("div",{className:"upload-bg-image__uploader-content-inner",children:[(0,f.jsx)("div",{className:"upload-bg-image__uploader-img-wrap",children:(0,f.jsx)("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})}),(0,f.jsx)("div",{className:"upload-bg-image__uploader-icons-wrap",children:(0,f.jsx)("div",{className:"upload-bg-image__uploader-content"})})]})})}),U.width&&U.height?(0,f.jsxs)("div",{className:"image-size",children:[U.width," \xd7 ",U.height,!!O&&(O.type===y.bV.IMG||O.type===y.bV.CAROUSEL)&&" \u2192 "+N.renderedWidth+" \xd7 "+N.renderedHeight,(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsxs)("span",{children:[U.size," ",S("kB")]}),U.format&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"image-size-splitter",children:" \xa0\u2022\xa0 "}),(0,f.jsx)("span",{className:"image-size-format",children:U.format})]})]}):(0,f.jsx)(k,{type:"secondary",className:"image-empty-text",children:l})]})}),(0,f.jsx)("div",{style:{flexGrow:1}}),"gif"!==U.format&&L.imageCenterEditorEnabled&&(0,f.jsx)(o.A,{title:S("Edit"),children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit",children:(0,f.jsx)(b.A,{style:{fontSize:16},onClick:e=>{Y?(M(!0),B(5)):(Q(),F((0,g.Wz)(y.lx.IMAGE_EDITOR_MODAL)))}})})}),(0,f.jsx)(n.A,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:H},overlayClassName:"upload-bg-image__menu",children:(0,f.jsx)(k,{type:"link",className:"upload-bg-image__edit-menu image-change",children:!t||t&&"error"===a?S("Upload"):(0,f.jsx)(h.A,{style:{fontSize:20},icon:"Reload",onClick:()=>Q(w.startsWith("src")?y.lx.UPLOAD_IMAGE_MODAL_UPLOAD:y.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})})},"Actions")]}),(0,f.jsx)(_.A,{open:T,onCancel:()=>{M(!1)},initialSlide:G})]})}},13591:()=>{}}]);
|