@emailmaker/emailmaker 1.0.77 → 1.0.78
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 +38 -38
- package/emailmaker-esm.js +1 -1
- package/emailmaker.js +1 -1
- package/iframe/429.js +1 -1
- package/iframe/766.js +1 -1
- package/iframe/iframe-eblock.bce17e2e504979a8da17.html +1 -0
- package/iframe/iframe.bce17e2e504979a8da17.html +1 -0
- package/iframe/js/826.1b2fdba2.js +1 -0
- package/iframe/sandbox-eblock.js +1 -1
- package/iframe/sandbox.js +1 -1
- package/package.json +1 -1
- package/plugin.html +1 -1
- package/plugin_blocks_test.html +1 -1
- package/plugin_default.html +1 -1
- package/plugin_idigital.html +1 -1
- package/plugin_nota.html +1 -1
- package/plugin_s.html +1 -1
- package/static/css/3397.fc40ad46.chunk.css +1 -0
- package/static/js/{1538.6c145daa.chunk.js → 1538.9e47c193.chunk.js} +2 -2
- package/static/js/1867.0e30089e.js +1 -0
- package/static/js/{3017.57dc3aee.chunk.js → 3017.d419c579.chunk.js} +1 -1
- package/static/js/3056.5895caeb.js +1 -0
- package/static/js/{3397.32d0df56.chunk.js → 3397.4165a92b.chunk.js} +2 -2
- package/static/js/{emailmaker_core.00fdf411.js → emailmaker_core.44e840fe.js} +2 -2
- package/translations.pot +309 -275
- package/iframe/iframe-eblock.7d3b5ca8b527c4873807.html +0 -1
- package/iframe/iframe.7d3b5ca8b527c4873807.html +0 -1
- package/iframe/js/826.ba8e4b98.js +0 -1
- package/static/css/3397.d03d7572.chunk.css +0 -1
- package/static/js/3056.aa9e6845.js +0 -1
- package/static/js/4350.5184287a.js +0 -1
- /package/iframe/js/{826.ba8e4b98.js.LICENSE.txt → 826.1b2fdba2.js.LICENSE.txt} +0 -0
- /package/static/js/{1538.6c145daa.chunk.js.LICENSE.txt → 1538.9e47c193.chunk.js.LICENSE.txt} +0 -0
- /package/static/js/{3397.32d0df56.chunk.js.LICENSE.txt → 3397.4165a92b.chunk.js.LICENSE.txt} +0 -0
- /package/static/js/{emailmaker_core.00fdf411.js.LICENSE.txt → emailmaker_core.44e840fe.js.LICENSE.txt} +0 -0
- /package/static/media/{ai-image.png → ai-image.7c42c2e12001ebf31881.png} +0 -0
- /package/static/media/{codicon.ttf → codicon.f13d28f3e470ec5c0896.ttf} +0 -0
- /package/static/media/{empty-image.png → empty-image.1827d6561f3c4042dfb3.png} +0 -0
- /package/static/media/{fb.png → fb.ff10384394f8044ec889.png} +0 -0
- /package/static/media/{frame_dark.png → frame_dark.318d7ed53535d80662dc.png} +0 -0
- /package/static/media/{frame_light.png → frame_light.22a9b4ec728365d8193f.png} +0 -0
- /package/static/media/{frame_template_gallery.png → frame_template_gallery.85693b3950e7689fb3a5.png} +0 -0
- /package/static/media/{icon-menu-block-welcome.png → icon-menu-block-welcome.1c534a003522feadd2e7.png} +0 -0
- /package/static/media/{ig.png → ig.47a89992b4bec92d4364.png} +0 -0
- /package/static/media/{sign_up_01.png → sign_up_01.333271584216122b89ba.png} +0 -0
- /package/static/media/{sign_up_01_blocks.png → sign_up_01_blocks.5538cfdb90d4869794dc.png} +0 -0
- /package/static/media/{sign_up_02.png → sign_up_02.d99d2aa6bf1ea74f01fa.png} +0 -0
- /package/static/media/{sign_up_02_blocks.png → sign_up_02_blocks.837fc2c9a9461fda13be.png} +0 -0
- /package/static/media/{sign_up_03.png → sign_up_03.5545ffad60a2cb5e0336.png} +0 -0
- /package/static/media/{sign_up_03_blocks.png → sign_up_03_blocks.126601f7a6fbea4b6c54.png} +0 -0
- /package/static/media/{sign_up_04.png → sign_up_04.398a4ca50d5f5b3cd837.png} +0 -0
- /package/static/media/{sign_up_04_blocks.png → sign_up_04_blocks.255c5c07b23cbcc256fd.png} +0 -0
- /package/static/media/{sign_up_05.png → sign_up_05.4c58df1be2edaa79d52b.png} +0 -0
- /package/static/media/{sign_up_05_blocks.png → sign_up_05_blocks.431b6844fdf3e14642c2.png} +0 -0
- /package/static/media/{tg.png → tg.10f004529a98df9732b9.png} +0 -0
- /package/static/media/{tw.png → tw.823a7736ac2d82815c71.png} +0 -0
- /package/static/media/{video.png → video.854adea50295d0a3f7ae.png} +0 -0
- /package/static/media/{vk.png → vk.fe41df919f4e8718e0b3.png} +0 -0
- /package/static/media/{yd.png → yd.c40d05dde64ef695fdf2.png} +0 -0
- /package/static/media/{yt.png → yt.4ac57e55d158b40c7fc1.png} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3056],{47827:()=>{},39941:()=>{},10148:(e,t,o)=>{o.d(t,{A:()=>k});var l=o(98173),a=o(2604),i=o(30150),r=o(37969),n=o(93511),d=o(5553),m=o(59010),s=o(26298),c=o.n(s),u=o(8807),p=o(98845),g=o(65716),b=o(61058),E=o(54838),h=o(22536),f=o(1047),v=o(12543),A=o(40277),_=o(52919),y=o(86095),S=o(32947);const k=({emailElement:e})=>{const{__:t}=(0,v.s9)(),o=(0,_.XW)(),s=(0,a.wA)(),{projectId:k}=(0,i.g)(),B=(0,y.fn)(),w=(0,a.d4)(b.p1),x=(0,a.d4)(b.RL),R=(0,a.d4)(E.Wm),[P,N]=(0,l.useState)(!0),[T,I]=(0,l.useState)(!1),[C,L]=(0,l.useState)([]),[O,F]=(0,l.useState)([]),D=e=>s((0,E.mi)(e)),M=(0,l.useCallback)((e=>{s((0,f.no)(e)),B.setValue(null===e||void 0===e?void 0:e.html.replaceAll("\r\n","\n"))}),[B,s]),{data:V}=g.Nq.useGetProjectQuery(Number(k),{skip:!k}),[W,z]=(0,l.useState)([]);(0,l.useEffect)((()=>{if(V){const{owner:e,admins:t,users:o}=null===V||void 0===V?void 0:V.members;z([e&&{...e},t&&Array.isArray(t)&&t.map((e=>({...e}))),o&&Array.isArray(o)&&o.map((e=>({...e})))].filter((e=>e)).flat(1).map((e=>({id:e.ID,display_name:e.display_name}))))}}),[V,null===V||void 0===V?void 0:V.members,t]);const[G,j]=(0,l.useState)(1),[H,U]=(0,l.useState)(!1);(0,l.useEffect)((()=>{const e=Array.isArray(w)&&w.length&&(null===w||void 0===w?void 0:w.map((e=>{var o;return{key:e.id,author:e.author,date:(0,A.Yq)((0,A.Cl)(e.date||e.modified),t),title:e.title,html:e.html,common_styles:e.common_styles,loading:!1,isAutosave:null===(o=e.slug)||void 0===o?void 0:o.includes("autosave")}})));F(e||[]),L(e),N(!1),x<2&&U(!0)}),[w,x,t]);const X=P||T||H?null:l.createElement("div",{style:{textAlign:"center",marginTop:24,marginBottom:24,height:32,lineHeight:"32px"}},l.createElement(r.Ay,{onClick:()=>{I(!0),F(C.concat([...new Array(3)].map((()=>({loading:!0}))))),s(p.GY.endpoints.getEmailHistory.initiate({emailId:e.id,page:G+1})).then((e=>{const{data:o,totalPages:l}=e.data,a=Array.isArray(o)&&(null===o||void 0===o?void 0:o.map((e=>({key:e.id,author:e.author,date:(0,A.Yq)((0,A.Cl)(e.date||e.modified),t),title:e.title,html:e.html,loading:!1})))),i=C.concat(a);F(i),L(i),I(!1),window.dispatchEvent(new Event("resize")),G+1>=l&&U(!0),j(G+1)}))}},t("loading more"))),[q,$]=(0,l.useState)(),[Y,K]=(0,l.useState)(null),Q=(0,l.useRef)();return Q.current=e,(0,l.useEffect)((()=>{if(!R&&!Y){const e=Q.current;e&&K({html:B.getValue(),preheader:e.preheader,common_styles:e.common_styles,subject:e.subject})}}),[R,K,B,Y]),(0,l.useEffect)((()=>{R&&Y&&(M(Y),K(null))}),[R,Y,M]),l.createElement(l.Fragment,null,l.createElement(n.A,{className:"secondary-tabs email-settings__collapse secondary-tabs_unset_scroll",size:"large",animated:{inkBar:!1,tabPane:!1},activeKey:S.Vv,items:[{label:l.createElement(l.Fragment,null,t("Version history")),key:S.Vv,forceRender:!0,className:"email-settings__collapse-panel",style:{height:"100%"},children:l.createElement(d.A,{className:"history-panel__list",loading:P,itemLayout:"horizontal",loadMore:X,dataSource:O,header:l.createElement("div",{className:"history-panel__list-header"},l.createElement("div",{className:"history-panel__list-date"},t("Time")),l.createElement("div",{className:"history-panel__list-author"},t("Author")),l.createElement("div",{className:"history-panel__restore"},"Set")),renderItem:(e,a)=>{var i;return l.createElement(d.A.Item,{onClick:()=>{a!==q&&($(a),M(C[a])),s((0,h.rc)(!0))},className:c()("history-panel__item",{"history-panel__item_active":a===q})},l.createElement(m.A,{title:!1,loading:e.loading||!1,active:!0},l.createElement("div",{className:"history-panel__list-date"},e.date),l.createElement("div",{className:"history-panel__list-author"},(null===(i=W.find((t=>{var o,l;return(null===(o=t.id)||void 0===o?void 0:o.toString())===(null===(l=e.author)||void 0===l?void 0:l.toString())})))||void 0===i?void 0:i.display_name)||"\u2013"),e.isAutosave&&q!==a&&l.createElement("div",{style:{opacity:.45},className:"history-panel__list-autosave"},t("Auto")),!e.isAutosave&&l.createElement(r.Ay,{size:"small",className:"history-panel__restore",type:"link",onClick:e=>{q===a&&e.stopPropagation(),M(C[a]),$(null),K(null),o({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1}),s((0,E.Fk)())}},t("Set")),e.isAutosave&&q===a&&l.createElement(r.Ay,{size:"small",className:"history-panel__restore",type:"link",onClick:e=>{q===a&&e.stopPropagation(),M(C[a]),D(!0),$(null),K(null),o({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1})}},t("Set"))))}})}]}),l.createElement(r.Ay,{type:"text",className:"ant-modal-close","aria-label":"Close",onClick:()=>{s((0,E.Fk)()),M(Y),K(null),D(!0),o({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1})}},l.createElement(u.A,{icon:"Close"})))}},21397:(e,t,o)=>{o.d(t,{A:()=>Ae});var l=o(98173),a=o(2604),i=o(67594),r=o(71446),n=o(27499),d=o(8218),m=o(48753),s=o(98447),c=o(93511),u=o(64909),p=o(5889),g=o(38826),b=o(12543),E=o(30150),h=o(8122),f=o(40835),v=o(871),A=o(47014),_=o(23424),y=o(80772),S=o(84572),k=o(32947),B=o(56545),w=o(37969),x=o(76293),R=o(80320),P=o(96734),N=o(90614),T=o(3792),I=o(15626),C=o(12352);const L={text:{replaceDefault:!0,defaultCategory:"handwriting",items:[{family:"Montserrat Light",src:"customFonts/Montserrat-Light.woff2"},{family:"Montserrat Regular",src:"customFonts/Montserrat-Regular.woff2"},{family:"Montserrat Bold",src:"customFonts/Montserrat-Bold.woff2"},{family:"Montserrat Black",src:"customFonts/Montserrat-Black.woff2"},{family:"Roboto Light",src:"customFonts/Roboto-Light.woff2"},{family:"Roboto Regular",src:"customFonts/Roboto-Regular.woff2"},{family:"Roboto Bold",src:"customFonts/Roboto-Bold.woff2"},{family:"Roboto Black",src:"customFonts/Roboto-Black.woff2"},{family:"Lato Light",src:"customFonts/Lato-Light.woff2"},{family:"Lato Regular",src:"customFonts/Lato-Regular.woff2"},{family:"Lato Bold",src:"customFonts/Lato-Bold.woff2"},{family:"Lato Black",src:"customFonts/Lato-Black.woff2"},{family:"Rubik Light",src:"customFonts/Rubik-Light.woff2"},{family:"Rubik Regular",src:"customFonts/Rubik-Regular.woff2"},{family:"Rubik Bold",src:"customFonts/Rubik-Bold.woff2"},{family:"Rubik Black",src:"customFonts/Rubik-Black.woff2"},{family:"Bebas Neue Light",src:"customFonts/BebasNeueLight.woff2"},{family:"Bebas Neue Regular",src:"customFonts/BebasNeueRegular.woff2"},{family:"Bebas Neue Book",src:"customFonts/BebasNeueBook.woff2"},{family:"Bebas Neue Bold",src:"customFonts/BebasNeueBold.woff2"},{family:"Arial",src:"customFonts/ArialMT.woff2"},{family:"Arial Bold",src:"customFonts/Arial-BoldMT.woff2"}]}};function O(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const o=`image/${e}`;return((e,t="application/octet-stream")=>fetch(`data:${t};base64,${e}`).then((e=>e.blob())))(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),o)}const F=l.createElement(g.A,{style:{fontSize:48},spin:!0}),D=({currentImageLink:e,newLink:t,onSave:i,uploadImageResultIsLoading:r})=>{const n=(0,P.p)(),[d,c]=(0,l.useState)(),[u,p]=(0,l.useState)(),{__:g}=(0,b.s9)();let E=(0,a.wA)();const h=(0,a.Pj)(),f=(0,a.d4)(A.C1),v=(0,a.d4)(_.sK),D=(0,a.d4)(S.yN),M=(0,l.useRef)(!1),[V,W]=(0,l.useState)(),z=(0,N.ml)(I.AZ.FILE_PROXY_EVENT_ID);(0,l.useEffect)((()=>{(async()=>{let t;try{const o=await fetch(e);t=await o.blob()}catch{if(t=await z.fire({url:e,project:D}).filter((e=>e instanceof Blob))[0],!t){const o=n.get(k.A9.em_token)||await T.di.getInstance(h,C.Y),l=await fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${o}`}});t=await l.blob()}}if(t){let e=new FileReader;e.onload=()=>{null===V||void 0===V||V.tools.import.openBackgroundImage(d),e.result!==d&&(c(e.result),p(t.type))},e.readAsDataURL(t)}})().catch((e=>{}))}),[e,t,c,n,d,V,z,D,h]);const G=(0,l.useCallback)((()=>{c(null),p(null),E((0,y.BK)()),E((0,_.Os)()),E((0,_.Oo)(k.lx.UPLOAD_IMAGE_MODAL))}),[E]),j=(0,l.useRef)();j.current=async function(e,t,o){const l=await O(o,e);i&&i(new File([l],t,{lastModified:(new Date).getTime(),type:l.type}))};const H=(0,l.useCallback)((e=>{if(e)if(M.current&&V);else{M.current=!0;const e=f.locale?f.locale.replace("_","-"):"ru-RU",t=f.theme===k.IJ?matchMedia(k.F3).matches?k.nd:k.T:f.theme;Promise.all([o.e(3085),o.e(9880)]).then(o.bind(o,85466)).then((({Pixie:o})=>o.init({selector:"#pixie-editor",baseUrl:"https://emailmaker.ru/assets/pixie",image:d,activeLanguage:e,languages:(0,B.g)(e,g),tools:L,ui:{menubar:{replaceDefaultItems:!0,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:l.createElement(x.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:l.createElement(R.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:()=>G()}]},nav:{position:"top"},activeTheme:t,mode:"inline",forceOverlayModeOnMobile:!1},onSave:async function(e,t,o){j.current(e,t,o)}}))).then((e=>{W(e)})).catch((e=>{}))}}),[f.theme,d,V,W,f.locale,g,G]),U=(0,l.useCallback)((()=>{null===V||void 0===V||V.tools.export.save(null===e||void 0===e?void 0:e.split("/").pop().split(".")[0],null===u||void 0===u?void 0:u.split("/")[1])}),[V,e,u]);return l.createElement(m.A,{afterOpenChange:H,width:"100%",style:{maxWidth:"100%",minHeight:"100vh"},className:"image-editor-modal blocks-modal",centered:!0,closable:!1,zIndex:1100,mask:!1,open:v,footer:[l.createElement(w.Ay,{key:"Cancel",className:"em-analytics__profile-cancel",onClick:G},g("Cancel")),l.createElement(w.Ay,{key:"Ok",className:"em-analytics__profile-updapixiete",id:"save",type:"primary",onClick:U},g("Update"))]},r&&l.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},l.createElement(s.A,{size:"large",indicator:F})),l.createElement("div",{id:"pixie-editor"}))},M=l.createElement(g.A,{style:{fontSize:48},spin:!0}),V=({currentImageLink:e,newLink:t,onSave:o,uploadImageResultIsLoading:a})=>l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"image-preview"},a&&l.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},l.createElement(s.A,{size:"large",indicator:M})),(t||e)&&l.createElement("img",{alt:"uploadedImage",src:t||e}))),l.createElement(D,{currentImageLink:e,newLink:t,onSave:o,uploadImageResultIsLoading:a}));var W=o(201),z=o(66964),G=o(50483),j=o(13785),H=o(94674),U=o(20127),X=o(21867),q=o(80293),$=o(8807);const Y="blocks",K=({setCurrentImageLink:e,setModalHeight:t,setModalWidth:o,setImageStockList:a,imageStockList:i,currentReq:r,setCurrentReq:m,inputRef:c,setStockLink:u,customRequest:p})=>{const[E,h]=(0,l.useState)(!1),[f,A]=(0,l.useState)(2),{__:_}=(0,b.s9)(),[y]=(0,v.Jg)(),[S]=(0,v.h4)();(0,l.useEffect)((()=>{""!==r.keywords&&k()}),[r.color,r.orientation]);const k=async()=>{const e=await S({query:r,page:1});e.data.results.length>0&&(a(e.data.results),setTimeout((()=>{o(1060),t("84vh")}),0))},[B,w]=(0,l.useState)(null);return l.createElement("div",{className:"stock-tab"},l.createElement(n.A,{onValuesChange:k,className:i.length>0?"serach-results":""},l.createElement(W.A,{gutter:24},l.createElement(z.A,{span:i.length>0?"":24},l.createElement(n.A.Item,{className:"stock-search-input"},l.createElement(d.A,{onKeyDown:e=>"Space"===e.code&&k(),onPressEnter:e=>k(),allowClear:!0,size:i.length>0?"medium":"large",placeholder:_("Search image"),value:r.keywords,onChange:e=>m((t=>({...t,keywords:e.target.value}))),ref:c,spellCheck:"false",suffix:l.createElement(q.A,{onClick:k,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})}))),i.length>0&&l.createElement(l.Fragment,null,l.createElement(z.A,null,l.createElement(G.Ay.Group,{defaultValue:"",onChange:e=>m((t=>({...t,orientation:e.target.value})))},l.createElement(j.A,{title:_("All"),placement:"top"},l.createElement(G.Ay.Button,{value:""},l.createElement($.A,{icon:"MixedView"}))),l.createElement(j.A,{title:_("Landscape"),placement:"top"},l.createElement(G.Ay.Button,{value:"landscape"},l.createElement($.A,{icon:"LandscapeView"}))),l.createElement(j.A,{title:_("Portrait"),placement:"top"},l.createElement(G.Ay.Button,{value:"portrait"},l.createElement($.A,{icon:"PortraitView"}))),l.createElement(j.A,{title:_("Squarish"),placement:"top"},l.createElement(G.Ay.Button,{value:"squarish"},l.createElement($.A,{icon:"SquareView"}))))),l.createElement(z.A,null,l.createElement(G.Ay.Group,{defaultValue:"",className:"stock-color-filter",onChange:e=>m((t=>({...t,color:e.target.value})))},l.createElement(j.A,{title:_("All"),placement:"top"},l.createElement(G.Ay.Button,{className:"all-colors",value:""},"All")),l.createElement(j.A,{title:_("Black"),placement:"top"},l.createElement(G.Ay.Button,{className:"black-color",value:"black"},"B")),l.createElement(j.A,{title:_("Black and White"),placement:"top"},l.createElement(G.Ay.Button,{className:"bw-color",value:"black_and_white"},"B&\xa7W")),l.createElement(j.A,{title:_("White"),placement:"top"},l.createElement(G.Ay.Button,{className:"white-color",value:"white"},"W")),l.createElement(j.A,{title:_("Orange"),placement:"top"},l.createElement(G.Ay.Button,{className:"orange-color",value:"orange"},"O")),l.createElement(j.A,{title:_("Red"),placement:"top"},l.createElement(G.Ay.Button,{className:"red-color",value:"red"},"R")),l.createElement(j.A,{title:_("Purple"),placement:"top"},l.createElement(G.Ay.Button,{className:"purple-color",value:"purple"},"P")),l.createElement(j.A,{title:_("Magenta"),placement:"top"},l.createElement(G.Ay.Button,{className:"magenta-color",value:"magenta"},"M")),l.createElement(j.A,{title:_("Green"),placement:"top"},l.createElement(G.Ay.Button,{className:"green-color",value:"green"},"G")),l.createElement(j.A,{title:_("Teal"),placement:"top"},l.createElement(G.Ay.Button,{className:"teal-color",value:"teal"},"T")),l.createElement(j.A,{title:_("Blue"),placement:"top"},l.createElement(G.Ay.Button,{className:"blue-color",value:"blue"},"Blue")))))),i.length>0&&l.createElement("div",{className:"blocks-search__divider-wrapper"},l.createElement("div",{className:"ant-divider ant-divider-horizontal",role:"separator"}))),l.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},i.length>0&&l.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},l.createElement(U.A,{dataLength:i&&i.length,next:async()=>{E||(h(!0),S({query:r,page:f}).then((e=>{a((t=>[...t,...e.data.results])),h(!1),A((e=>e+1))})).catch((()=>{h(!1)})))},hasMore:i,endMessage:l.createElement(H.A,{plain:!0},_("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:null},l.createElement(X.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},i.map((t=>l.createElement("div",{className:"list-item",key:t.id,onClick:()=>{return o=t.urls,l=t.links,a=t.id,y(l.download_location),w(a),setTimeout((()=>w(null)),2e3),u(`${o.raw}&w=1200&q=96`),e(`${o.raw}&w=1200&q=96`),void p(`${o.raw}&w=1200&q=96`);var o,l,a}},l.createElement("img",{className:B===t.id?"loaded-image":"",width:"322px",src:`${t.urls.raw}&w=644&q=96`,alt:t.description,onLoad:e=>e.target.parentNode.classList.add("loaded")}),l.createElement("p",{className:"creator-info",onClick:e=>e.stopPropagation()},"Photo by"," ",l.createElement("a",{target:"_blank",href:`${t.user.links.html}?utm_source=${Y}&utm_medium=referral`,rel:"noreferrer"},t.user.name)," ","on"," ",l.createElement("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${Y}&utm_medium=referral`,rel:"noreferrer"},"Unsplash")),B===t.id&&l.createElement(s.A,{className:"ant-spin",indicator:l.createElement(g.A,{spin:!0})})))))))))};var Q=o(82021),J=o(35850),Z=o(50078),ee=o(36236);const te=({images:e,transitionDuration:t=1e3})=>{const[o,a]=(0,l.useState)([]);return(0,l.useEffect)((()=>{if(e.length>0){const t=e[e.length-1];a((e=>[...e,{src:t,opacity:0}])),setTimeout((()=>{a((e=>e.map(((t,o)=>o===e.length-1?{...t,opacity:1}:t))))}),1e3)}}),[e]),l.createElement("div",{className:"slideshow-container"},o.map(((e,o)=>l.createElement("img",{key:o,src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${o+1}`,className:"slideshow-image",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`}}))))};var oe=o(30753),le=o(27941),ae=o(89613);const ie=e=>{const{className:t,style:o,onClick:a}=e;return l.createElement("div",{className:t,style:{...o,zIndex:"3000",display:"block",position:"absolute",top:"50%",right:"0",transform:"translateY(-50%) translateX(-100%)",backgroundColor:"transparent",opacity:.8},onClick:a},l.createElement(w.Ay,{style:{borderRadius:100,right:10},size:"large",icon:l.createElement(J.A,null)}))},re=e=>{const{className:t,style:o,onClick:a}=e;return l.createElement("div",{className:t,style:{...o,display:"block",position:"absolute",zIndex:"1000",top:"50%",left:"0",transform:"translateY(-50%)",backgroundColor:"transparent",opacity:.8},onClick:a},l.createElement(w.Ay,{style:{borderRadius:100,left:10},size:"large",icon:l.createElement(Z.A,null)}))},ne=({setModalHeight:e,customRequest:t,aiImageRequest:o,setAiImageRequest:a,aiTabRef:i,imageAiList:r,setImageAiList:m,isLoadingAi:s,setIsLoadingAi:c,inputAiRef:p,isImageUploaded:h,setIsImageUploaded:f})=>{const{__:A}=(0,b.s9)(),_=(0,le.rD)(),y=(0,u.hN)(),S=(0,ae.u)(),{emailId:B,blockId:x,projectId:R}=(0,E.g)(),P=(0,N.ml)(I.AZ.ON_LIMIT_ID),[T,C]=(0,l.useState)(0),[L,O]=(0,l.useState)(null),[F,D]=(0,l.useState)(!1),[M,V]=(0,l.useState)(A("Evaluating the task")),[G,j]=(0,l.useState)(!1),[H]=(0,v.Mv)(),[U,{data:X=[]}]=(0,v.gg)(),q=B||x,{limits:Y}=null!==_&&void 0!==_&&_.limits?_:{limits:{ai_img_limit:0}},{ai_img_limit:K}=Y,J=T>=K&&K>0,Z=!(!_.limits||!_.counters)&&k.EW.isPlugin,ne=(0,l.useCallback)((()=>{P.fire({name:"AiImgCount",count:T+1})}),[P,T]);(0,l.useEffect)((()=>{var e;Z&&C((null===_||void 0===_||null===(e=_.counters)||void 0===e?void 0:e.ai_img_counter)||0)}),[_,Z]);const de=async()=>{V(A("Evaluating the task")),""===o||s||(c(!0),j(!0),m([]),S({event:"submit_form",action:"ai_image_generation",entity_id:B,project_id:R}),H({body:{project_id:R,request:"create-image",connection:"midjourney",message:o}}).then((({data:e})=>{if(401===e.data.status)throw new Error(k.ff);200===(null===e||void 0===e?void 0:e.data.status)?(null!==e&&void 0!==e&&e.data.task.id&&(V(e.data.task.message),O(e.data.task.id)),e.message&&y.success({id:"AI_IMAGE_SEND_SUCCESS",message:e.message,placement:"bottomRight",data:o}),U({task_id:null===e||void 0===e?void 0:e.data.task.id,entity_id:q})):(c(!1),j(!1),y.error({id:"AI_IMAGE_SEND_ERROR",message:(null===e||void 0===e?void 0:e.message)||A("Something went wrong, please try again"),placement:"bottomRight",data:o,innerException:e}))})).catch((e=>{c(!1),j(!1),e.error&&y.fromError("AI_IMAGE_SEND_ERROR",o,e.error)})))};(0,l.useEffect)((()=>{X.length>1&&("error"!==X[X.length-1].status||"Canceled"!==X[X.length-1].status?X[X.length-1].images?(V(X[X.length-1].status),100===X[X.length-1].progress&&(m(X[X.length-1].images),V(A("Evaluating the task")),O(null),j(!1))):(m([X[X.length-1].data]),c(!1)):(c(!1),j(!1),y.error({id:"AI_IMAGE_GET_ERROR",message:A("Something went wrong, please try again"),placement:"bottomRight",data:L})))}),[X,m,V,A,c,e,L,y]),(0,l.useEffect)((()=>{(s||r.length>0)&&setTimeout((()=>{let t=550;i.current&&(t=i.current.offsetHeight+68),e(t)}),0)}),[i,X,r.length,s,e]);const[me,se]=(0,l.useState)(!1);return l.createElement("div",{className:"image-ai"},Z&&l.createElement(oe.A,{text:A("images"),counter:T,limits:K,wrapperStyles:{marginTop:-25}}),l.createElement(W.A,{gutter:24,style:{padding:"0 2px"}},l.createElement(z.A,{span:24},l.createElement(n.A.Item,{style:{margin:0}},l.createElement("span",{className:"ant-input-affix-wrapper ant-input-affix-wrapper-lg "+(me?"ant-input-affix-wrapper-focused":""),style:{paddingLeft:0}},l.createElement(d.A.TextArea,{ref:p,onKeyDown:e=>{"Shift"===e.key?D(!0):"Enter"!==e.key||F||(e.preventDefault(),J?Z&&y.error({message:A("The usage limit has been exceeded"),description:A("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"}):Z?(C((e=>e+1)),ne(),de()):de())},onKeyUp:e=>{"Shift"===e.key&&D(!1)},onFocus:()=>{se(!0)},onBlur:()=>{se(!1)},autoSize:!0,allowClear:!0,className:"text-area-input-hybrid",placeholder:A("Generate image"),value:o,onChange:t=>{a(t.target.value),setTimeout((()=>{let t=0;i.current&&(t=i.current.offsetHeight+68,s||0!==r.length||(t=i.current.offsetHeight+68)),setTimeout((()=>{e(t)}),0)}),10)},style:{fontSize:16},spellCheck:"false"}),l.createElement("span",{className:"ant-input-suffix"},s||G?l.createElement(g.A,{style:{fontSize:18},className:"input-icon",spin:!0}):l.createElement($.A,{icon:"AI",style:{fontSize:16,top:0,right:0},className:"input-icon",onClick:()=>{Z?J||(C((e=>e+1)),ne(),de()):de()}})))))),(s||r.length>0)&&l.createElement(Q.A,{dotPosition:"top",arrows:!0,nextArrow:l.createElement(ie,null),prevArrow:l.createElement(re,null),style:{marginTop:24}},s&&l.createElement("div",{className:"image-ai__loading"},l.createElement("div",{className:"spin"},l.createElement(g.A,{style:{fontSize:48},spin:!0}),l.createElement("p",{className:"status"},M))),r.length>0&&r.map(((e,o)=>l.createElement("div",{key:o,className:"image-ai__image-item"},l.createElement(te,{images:r}),l.createElement("div",{className:"buttons"},"Ready"===X[X.length-1].status&&l.createElement(w.Ay,{onClick:()=>(e=>{if(!h){f(!0);const o=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/),l=o[1],a=o[2],i=atob(a),r=new Array(i.length);for(let e=0;e<i.length;e++)r[e]=i.charCodeAt(e);const n=new Uint8Array(r),d=new Blob([n],{type:`image/${l}`}),m=new File([d],"image.jpeg",{type:d.type});t({file:m})}})(`data:image/jpeg;base64, ${e}`),icon:l.createElement(ee.A,null)},A("Use this variant"))))))))};var de=o(42811);const me=({setNewLink:e,setCurrentImageLink:t,setModalHeight:o,setModalWidth:a,setImageGifList:i,imageGifList:r,currentReqGif:m,setCurrentReqGif:c,inputRef:u,setStockLink:p,customRequest:E})=>{const{__:h}=(0,b.s9)(),[f,A]=(0,l.useState)(null),[_,y]=(0,l.useState)(!1),[S,k]=(0,l.useState)(25),[B]=(0,v.eo)(),w=async()=>{var e,t;const l=await B({query:m,page:0});(null===l||void 0===l||null===(e=l.data)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.length)>0&&(i(l.data.data),setTimeout((()=>{o("84vh"),a(1060)}),0))},x=l.createElement(g.A,{style:{fontSize:20},spin:!0});return l.createElement("div",{className:"stock-tab"},l.createElement(n.A,{onValuesChange:w,className:r.length>0?"serach-results":""},l.createElement(W.A,{gutter:24},l.createElement(z.A,{span:r.length>0?"":24},l.createElement(n.A.Item,{className:"stock-search-input"},l.createElement(d.A,{onKeyDown:e=>"Space"===e.code&&w(),onPressEnter:e=>w(),allowClear:!0,size:r.length>0?"medium":"large",placeholder:h("Search GIFs"),value:m.keywords,onChange:e=>c((t=>({...t,keywords:e.target.value}))),ref:u,spellCheck:"false",suffix:l.createElement(q.A,{onClick:w,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})))),r.length>0&&l.createElement("div",{className:"blocks-search__divider-wrapper"},l.createElement("div",{className:"ant-divider ant-divider-horizontal blocks-search__divider",role:"separator"}))),l.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},r.length>0&&l.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},l.createElement(U.A,{dataLength:r&&r.length,next:async()=>{_||(y(!0),B({query:m,page:S}).then((e=>{i((t=>[...t,...e.data.data])),y(!1),k((e=>e+25))})).catch((()=>{y(!1)})))},hasMore:r,endMessage:l.createElement(H.A,{plain:!0},h("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:l.createElement(s.A,{indicator:x})},l.createElement(X.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},r.map(((e,o)=>l.createElement("div",{className:"list-item",key:e.id+o,onClick:()=>{return o=e.images.downsized.url,l=e.id,A(l),setTimeout((()=>{A(null)}),2e3),p(`${o}`),t(`${o}`),void E(`${o}`);var o,l}},l.createElement("img",{className:f===e.id?"loaded-image":"",width:"322px",src:`${e.images.downsized.url}`,alt:e.title,onLoad:e=>e.target.parentNode.classList.add("loaded")}),l.createElement("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()},l.createElement("div",{className:"overlay-image",style:{backgroundImage:`url(${de})`}})),f===e.id&&l.createElement(s.A,{className:"ant-spin",indicator:l.createElement(g.A,{spin:!0})})))))))))};var se=o(48956),ce=o(40277);const ue="IMG",pe="BACKGROUND",ge="EDITOR",be="UPLOAD",Ee="STOCK",he="GIF",fe="AI",{Dragger:ve}=i.A,Ae=()=>{var e,t;const o=(0,le.rD)(),{__:i}=(0,b.s9)(),B=(0,a.wA)(),{projectId:w}=(0,E.g)(),[x,R]=(0,f.dS)(),[P]=(0,v.FQ)(),{modal:T}=r.A.useApp(),C=(0,u.hN)(),L=(0,a.d4)(A.B$),O=(0,a.d4)(A.C1),F=(0,a.d4)(_.cL),D=(0,a.d4)(y.js),M=(0,a.d4)(y.Ac),[W,z]=(0,l.useState)(""),[G,j]=(0,l.useState)(""),[H,U]=(0,l.useState)(""),[X,q]=(0,l.useState)(""),[$,Y]=(0,l.useState)(be),[Q,J]=(0,l.useState)({width:"",height:"",size:"",format:""}),[Z,ee]=(0,l.useState)("success"),[te,oe]=(0,l.useState)(!1),ae=l.useRef(null),ie=l.useRef(null),re=l.useRef(null),de=l.useRef(null),Ae=l.useRef(null),_e=l.useRef(null),ye=l.useRef(null),Se=l.useRef(null),ke=l.useRef(null),[Be,we]=(0,l.useState)("auto"),[xe,Re]=(0,l.useState)(572),[Pe,Ne]=(0,l.useState)(null),[Te,Ie]=(0,l.useState)(!1),[Ce,Le]=(0,l.useState)({keywords:"",color:"",orientation:""}),[Oe,Fe]=(0,l.useState)({keywords:""}),[De,Me]=(0,l.useState)([]),[Ve,We]=(0,l.useState)([]),[ze,Ge]=(0,l.useState)([]),[je,He]=(0,l.useState)(!1),[Ue,Xe]=(0,l.useState)(""),[qe,$e]=(0,l.useState)(!1),[Ye,Ke]=(0,l.useState)(0),Qe=(0,a.d4)(S.yN),Je=(0,N.ml)(I.AZ.FILE_PROXY_EVENT_ID);let Ze=!(L||(null===(e=O.id)||void 0===e?void 0:e.toString())!==(null===Qe||void 0===Qe||null===(t=Qe.members)||void 0===t?void 0:t.owner.ID))&&!0;const et=async e=>{if(e)try{const t=await tt(e);lt({url:e}),t&&at(t)&&it({file:t})}catch(t){}},tt=async e=>{try{const t=(await Je.fire({url:e,project:Qe})).filter((e=>e instanceof Blob))[0];if(t)return t;const o=`https://api.emailmaker.ru/tools/file-proxy.php?url=${encodeURIComponent(e)}`,l=await fetch(o);if(!l.ok)throw new Error(`Server returned ${l.status}`);const a=await l.blob();return new File([a],e.split("/").pop(),{type:a.type})}catch(t){}};document.onpaste=function(e){const t=e.clipboardData.items[0];if($===be&&X){if(0===t.type.indexOf("image")){const e=t.getAsFile();at(e);const o={file:e};j(""),it(o)}0===t.type.indexOf("text")&&t.getAsString((e=>{"http"===e.slice(0,4)?(j(""),z(e),lt({url:e})):"meta"===e.toString().slice(1,5)&&(j(""),z(e.toString().split('"')[1]),lt({url:e.toString().split('"')[1]}))}))}};const ot=(0,l.useMemo)((()=>({IMG:D,BACKGROUND:M})),[D,M]);(0,l.useEffect)((()=>{const e=e=>{let t=null;F.includes("UPLOAD_BACKGROUND_MODAL")?(t=pe,q(pe)):F.includes("UPLOAD_IMAGE_MODAL")&&(q(ue),t=ue),ot[t]&&(z(ot[t]),Y(e))};F===k.lx.UPLOAD_IMAGE_MODAL||F===k.lx.UPLOAD_BACKGROUND_MODAL?e(ge):F===k.lx.UPLOAD_IMAGE_MODAL_AI||F===k.lx.UPLOAD_BACKGROUND_MODAL_AI?(Ze?($e(!0),Ke(2)):e(fe),setTimeout((()=>{var e;return null===(e=ke.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===k.lx.UPLOAD_IMAGE_MODAL_UPLOAD||F===k.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD?(e(be),setTimeout((()=>{var e;return null===(e=_e.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===k.lx.UPLOAD_IMAGE_MODAL_STOCK||F===k.lx.UPLOAD_BACKGROUND_MODAL_STOCK?(Ze?($e(!0),Ke(3)):e(Ee),setTimeout((()=>{var e;return null===(e=Se.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===k.lx.UPLOAD_IMAGE_MODAL_GIF||F===k.lx.UPLOAD_BACKGROUND_MODAL_GIF?(Ze?($e(!0),Ke(3)):e(he),setTimeout((()=>{var e;return null===(e=ye.current)||void 0===e?void 0:e.focus({cursor:"start"})}),100)):F===k.lx.UPLOAD_IMAGE_MODAL_EDIT||F===k.lx.UPLOAD_BACKGROUND_MODAL_EDIT?(Ze?($e(!0),Ke(5)):e(ge),B((0,_.Wz)(k.lx.IMAGE_EDITOR_MODAL))):q("")}),[F,B,Ze,ot]);const lt=(0,l.useCallback)((({url:e=W||""})=>{z(e),X===ue&&B((0,y.tm)(e)),X===pe&&B((0,y.e_)(e)),setTimeout((()=>{Le({keywords:"",color:"",orientation:""}),Fe({keywords:""}),We([]),Me([]),q(""),Xe(""),He(!1),U(""),j(""),Y(be)}),200),B((0,_.Oo)()),B((0,_.Os)())}),[W,B,X]);(0,l.useEffect)((()=>{const e=G||H;e?(0,ce.DI)(e).then((t=>{ee(t),Re(572),setTimeout((()=>{let e=0;ie.current&&(e=ie.current.offsetHeight+62),we(e)}),0),lt(e)})).catch((e=>{ee(e)})):ee("")}),[G,H,lt]),(0,l.useEffect)((()=>{W&&P(W).then((({data:e})=>{J({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(2),format:null===e||void 0===e?void 0:e.format})}))}),[W,P]);(0,l.useEffect)((()=>{var e;""===Ce.keywords&&(null===_e||void 0===_e||null===(e=_e.current)||void 0===e||e.focus({cursor:"start"}),We([]),setTimeout((()=>{we("auto"),Re(572)}),0))}),[Ce,We,we,Re]);const at=e=>{const t="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type||"image/webp"===e.type||"image/gif"===e.type||"image/svg+xml"===e.type;return t||C.error({id:"IMAGE_UPLOAD_WRONG_FORMAT",data:e,message:"Upload",description:"You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!",placement:"bottomRight"}),t},it=({file:e})=>{const t="image/svg+xml"===e.type,a="image/webp"===e.type,r=e=>{const t=new Image;t.src=URL.createObjectURL(e),t.onload=()=>{(async e=>{Ie(!0);const t=e.file;try{"image/gif"!==t.type&&(e.file=await(0,h.A)(t,{maxSizeMB:o.compressMaxSize||.45,maxWidthOrHeight:o.compressMaxWidthOrHeight||2e3})),x(e).then((({error:e,data:o})=>{var a;if(e)C.fromError("IMAGE_UPLOAD_ERROR",t,e);else if(400===(null===o||void 0===o||null===(a=o.data)||void 0===a?void 0:a.status))C.error({id:"IMAGE_UPLOAD_ERROR",data:t,innerException:null===o||void 0===o?void 0:o.data,message:l.createElement("div",{dangerouslySetInnerHTML:{__html:o.code}}),description:l.createElement("div",{dangerouslySetInnerHTML:{__html:o.message}}),placement:"bottomRight"});else{var r;const e=null===o||void 0===o||null===(r=o[0])||void 0===r?void 0:r.file_url;e&&(we("auto"),oe(!1),lt({url:e})),C.success({id:"IMAGE_UPLOAD_SUCCESS",data:t,message:i("The image was successfully uploaded.")})}})).catch((e=>{})).finally((()=>{Ie(!1)}))}catch(a){Ie(!1)}})({user_id:O.id,folder:w,file:e})}};t?((e,t)=>{const o=new FileReader;o.onload=function(o){const l=o.target.result,a=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(a),r=new Image;r.onload=function(){const o=document.createElement("canvas");o.width=2*r.width,o.height=2*r.height,o.getContext("2d").drawImage(r,0,0,o.width,o.height),o.toBlob((o=>{const l=new File([o],e.name.replace(".svg",".png"),{type:"image/png"});t(l),URL.revokeObjectURL(i)}),"image/png")},r.src=i},o.readAsText(e)})(e,(e=>r(e))):a?((e,t,o=90)=>{const l=new Image;l.src=URL.createObjectURL(e),l.onload=()=>{const e=document.createElement("canvas");e.width=l.width,e.height=l.height;const a=e.getContext("2d");a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high",a.drawImage(l,0,0,e.width,e.height),e.toBlob((e=>{const o=new File([e],"converted.jpg",{type:"image/jpeg"});t(o)}),"image/jpeg",o/100)},l.onerror=e=>{t(null)}})(e,(e=>r(e))):r(e)},rt=e=>it({file:e});let nt=[{label:i("Upload"),key:be,children:l.createElement("div",{ref:ae,style:{paddingBottom:24}},l.createElement(ve,{showUploadList:!1,name:"Image",beforeUpload:at,customRequest:it,style:{marginBottom:10},multiple:!1,accept:"image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml"},l.createElement("p",{className:"ant-upload-drag-icon"},l.createElement(p.A,null)),l.createElement("p",{className:"ant-upload-text"},i("Click to select, paste from the clipboard, or drag and drop")),l.createElement("p",{className:"ant-upload-hint"},i("Accepted formats: PNG, JPG, WEBP, SVG or GIF."))),l.createElement(n.A,{style:{padding:"0 2px 0 2px"}},l.createElement(n.A.Item,{validateStatus:Z},l.createElement(d.A,{ref:_e,allowClear:!0,size:"large",placeholder:i("Paste image URL here"),value:G,onChange:e=>{const t=e.target.value;j(t),Pe&&clearTimeout(Pe);const o=setTimeout((()=>et(t)),1e3);Ne(o)},spellCheck:"false"}))))}];o.imageCenterStockEnabled&&!Ze&&nt.push({label:i("Stock"),key:Ee,children:l.createElement("div",{ref:re,style:{paddingBottom:24}},l.createElement(K,{currentReq:Ce,setCurrentReq:Le,imageStockList:Ve,setImageStockList:We,setModalWidth:Re,setModalHeight:we,setStockLink:U,setCurrentImageLink:z,inputRef:Se,customRequest:et}))}),o.imageCenterGifEnabled&&!Ze&&nt.push({label:i("GIF"),key:he,children:l.createElement("div",{ref:de,style:{paddingBottom:24}},l.createElement(me,{currentReqGif:Oe,setCurrentReqGif:Fe,imageGifList:De,setImageGifList:Me,setModalWidth:Re,setModalHeight:we,setStockLink:U,setCurrentImageLink:z,inputRef:ye,customRequest:et}))}),o.elementAIimageEnabled&&!Ze&&nt.push({label:i("AI"),key:fe,children:l.createElement("div",{ref:Ae,style:{paddingBottom:24}},l.createElement(ne,{setModalHeight:we,customRequest:it,aiImageRequest:Ue,setAiImageRequest:Xe,imageAiList:ze,setImageAiList:Ge,isLoadingAi:je,setIsLoadingAi:He,aiTabRef:Ae,inputAiRef:ke,isImageUploaded:te,setIsImageUploaded:oe}))}),o.imageCenterEditorEnabled&&nt.push({label:"",key:ge,children:l.createElement("div",{ref:ie},l.createElement(V,{currentImageLink:W,newLink:G,imageSize:Q,onSave:rt,uploadImageResultIsLoading:R.isLoading||!1}))});const dt=l.createElement(g.A,{style:{fontSize:32,margin:-16},spin:!0});return l.createElement(l.Fragment,null,l.createElement(m.A,{width:xe,className:"image-center blocks-modal",title:i("Image Center"),centered:!0,style:{minHeight:390},open:!!X,onOk:lt,onCancel:()=>{B((0,_.Oo)()),setTimeout((()=>{z(""),j(""),We([]),We([]),Le({keywords:"",color:"",orientation:""}),Fe({keywords:""}),we("auto"),!je&&Xe(""),Re(572),Y(be)}),200)},footer:$===ge?l.createElement(l.Fragment,null):null},l.createElement(s.A,{spinning:Te,indicator:dt},l.createElement(c.A,{activeKey:$,onChange:e=>{"GALLERY"===e?T.success({maskClosable:!0,centered:!0,title:i("Coming soon"),content:i("The feature is under development."),okText:i("Ok. I'll be waiting"),onOk:()=>{}}):e===ge&&""===W?T.warning({maskClosable:!0,centered:!0,title:i(""),content:i("To preview and edit the uploaded image"),okText:i("Upload Image"),onOk:()=>{Y(be)}}):(setTimeout((()=>{let t=0,o=0;var l;if(e===be&&ae.current)""===Ce.keywords&&(null===(l=_e.current)||void 0===l||l.focus({cursor:"start"})),t=300,o=572;else if(e===ge&&ie.current)t=ie.current.offsetHeight+62,o=572;else if(e===Ee&&re.current){var a;""===Ce.keywords&&(null===(a=Se.current)||void 0===a||a.focus({cursor:"start"})),t=130,o=572,Ve.length>0&&(o=1060,t="84vh")}else if(e===he&&de.current){var i;""===Ce.keywords&&(null===(i=ye.current)||void 0===i||i.focus({cursor:"start"})),t=130,o=572,De.length>0&&(o=1060,t="84vh")}else if(e===fe&&Ae.current){var r;if(""===Ue&&0===ze.length)null===(r=ke.current)||void 0===r||r.focus({cursor:"start"}),t=130;else t=Ae.current.offsetHeight+82;o=572}we(t),Re(o)}),0),Y(e))},items:nt,style:{height:Be,minHeight:130}}))),l.createElement(se.A,{open:qe,onCancel:()=>$e(!1),initialSlide:Ye}))}},25911:(e,t,o)=>{o.d(t,{A:()=>ie});var l=o(98173),a=o(30150),i=o(47555),r=o(40120),n=o(64909),d=o(86406),m=o(77073),s=o(91321),c=o(2604),u=o(26298),p=o.n(u),g=o(37969),b=o(93771),E=o(79245),h=o(12543),f=o(16238),v=o(76428),A=o(58316),_=o(87690),y=o(62296),S=o(1549),k=o(95331),B=o(10267),w=o(6311),x=o(70178),R=o(51070),P=o(85758),N=o(27352),T=o(23424),I=o(84572),C=o(47014),L=o(78915),O=o(40277),F=o(96734),D=o(32947);const M=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:o})=>{var i;const{__:r}=(0,h.s9)();let n=(0,c.wA)(),d=(0,a.Zp)();const{projectId:m}=(0,a.g)(),{pathname:s}=(0,a.zy)(),[u,M]=(0,l.useState)(""),V=(0,c.d4)(I.yN),W=(0,c.d4)(C.C1),z=(0,F.p)(),G=(0,l.useCallback)((()=>{s.includes("blocks")?M("Blocks"):s.includes("emails")?M("Emails"):s.includes("members")&&M("Members"),!o&&t(!0)}),[s,t,o]);(0,l.useEffect)((()=>{G()}),[G]);let j=[],H=[];const U=(null===V||void 0===V?void 0:V.title)||"";let X=[{label:l.createElement("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer"},r("Help")),key:"Help center",icon:l.createElement(f.A,{style:{fontSize:"16px"}}),className:"help-center"},{label:r("Chat support"),key:"Support chat",icon:l.createElement(v.A,{style:{fontSize:"16px"}}),className:"open-support-chat",onClick:()=>{try{window.carrotquest.open()}catch(e){}}}],q=[{label:r("Account settings"),key:"Account settings",icon:l.createElement(A.A,{style:{fontSize:"16px"}}),className:"em-analytics__account-settings",onClick:()=>{n((0,T.qf)(D.lx.EDIT_PROFILE_MODAL)),!o&&t(!0)}},{label:l.createElement(E.N_,{to:"/billing"},r("Billing")),key:"Billing",icon:l.createElement(_.A,{style:{fontSize:"16px"}}),className:"em-analytics__billing"},{label:r("Sign out"),icon:l.createElement(y.A,{style:{fontSize:"16px"}}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{(0,O.Id)(z),n(L.Q2.util.resetApiState()),d("/auth",{replace:!0})}}];const $="/projects"+(m?"/"+m+"/emails?page=1":""),Y=[{label:l.createElement(E.N_,{style:{fontSize:16},to:$},U),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:m?l.createElement(E.N_,{to:$,className:"project-menu__block",style:{fontSize:"18px",zIndex:99}},l.createElement(g.Ay,{type:"primary",className:"project-menu__block-button"},null===U||void 0===U?void 0:U.split(" ").slice(0,2).map((e=>Array.from(e)[0])))):l.createElement(E.N_,{to:$,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"28px"}},l.createElement("b",null,l.createElement("span",{className:"letters"},"E"),(!e||o)&&l.createElement("span",{className:"hidden-text"},"mail")),l.createElement("span",{className:"letters"},"M"),(!e||o)&&l.createElement("span",{className:"hidden-text"},"aker")),className:p()("project-menu__list-item project-menu__list-item_project project-menu__list-item_project",{"project-menu__list-item_logo":!m,"project-menu__list-item_project":m}),children:m&&[{label:r("Project settings"),key:"Project settings",className:"em-analytics__account-settings",icon:l.createElement(S.A,{style:{fontSize:"16px"}}),onClick:()=>{n((0,T.qf)(D.lx.EDIT_PROJECT_MODAL)),!o&&t(!0)}},{label:l.createElement(E.N_,{to:"/projects"},r("List of projects")),key:"List of projects",icon:l.createElement(k.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}]},{type:"divider"}];return j.push({icon:l.createElement(B.A,{style:{fontSize:20}}),label:l.createElement(E.N_,{to:`/projects/${m}/emails`,rel:"noopener noreferrer"},r("Emails")),key:"Emails",className:"project-menu__list-item em-analytics__project-menu-emails"},{icon:l.createElement(w.A,{style:{fontSize:20}}),label:l.createElement(E.N_,{to:`/projects/${m}/blocks`,rel:"noopener noreferrer"},r("Blocks")),key:"Blocks",className:"project-menu__list-item em-analytics__project-menu-blocks"},{icon:l.createElement(x.A,{style:{fontSize:20}}),label:l.createElement(E.N_,{to:`/projects/${m}/members`,rel:"noopener noreferrer"},r("Members")),key:"Members",className:"project-menu__list-item em-analytics__project-menu-members"}),"community"===W.subscription.post_name&&m&&W.counters.emails_counter>2&&H.push({icon:l.createElement(R.A,{style:{fontSize:20,lineHeight:"44px"}}),label:l.createElement(E.N_,{to:"/billing",rel:"noopener noreferrer",style:{fontSize:16,color:"white"}},r("Upgrade")),key:"Emails",className:"project-menu__list-item"}),H.push({icon:l.createElement(P.A,{style:{fontSize:18}}),label:r("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:X},{icon:l.createElement(N.A,{style:{fontSize:18}}),label:r("What's new"),key:"What's new",className:"project-menu__list-item ducalis-changelog-widget em-analytics__project-menu-ducalis"},{icon:l.createElement("span",{style:{width:"20px",height:"20px",fontSize:"20px"},className:"user-profile__avatar anticon"},null!==W&&void 0!==W&&null!==(i=W.avatar_urls)&&void 0!==i&&i[24]?[l.createElement("img",{style:{width:"100%"},key:"img",src:null===W||void 0===W?void 0:W.avatar_urls[24],alt:null!==W&&void 0!==W&&W.name?`${null===W||void 0===W?void 0:W.name} avatar`:"User avatar",className:"user-profile__avatar-img"}),l.createElement(A.A,{key:"UserOutlined",style:{position:"absolute",fontSize:20,borderRadius:100,overflow:"hidden",height:20,width:20,lineHeight:0,zIndex:-1}})]:l.createElement(A.A,{style:{color:"white"}})),label:(null===W||void 0===W?void 0:W.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:q}),l.createElement(l.Fragment,null,l.createElement("div",{className:"project-menu"},l.createElement("div",null,l.createElement(b.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:Y,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),m&&l.createElement(b.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[u],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:j,triggerSubMenuAction:"hover"})),l.createElement(b.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:H,triggerSubMenuAction:"hover"})))};var V=o(63837),W=o(99460),z=o(62913),G=o(13785),j=o(8807),H=o(1047),U=o(39420),X=o(52919);const q=()=>{var e;const{__:t}=(0,h.s9)(),o=(0,c.wA)(),[a]=(0,L.b9)(),[i,r]=(0,l.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(D.V0.em_color_scheme)),n=(0,X.XW)(),d=(0,l.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,U.Hk)(e),null===e){const e=matchMedia(D.F3).matches?D.nd:D.T;localStorage.removeItem(D.V0.em_color_scheme),t=e}else localStorage.setItem(D.V0.em_color_scheme,e),t=e;o((0,H.eX)(t===D.nd?`vs-${t}`:D.T)),(0,U.A5)(t),n({operation:D.Ru.UPDATE_PREVIEW,theme:t}),a({theme:e})})(t),r(t)}),[o,a,n]);return(0,l.useEffect)((()=>{matchMedia(D.F3).onchange=()=>d()}),[d]),l.createElement("div",{onClick:e=>e.stopPropagation()},l.createElement(z.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:i,options:[{label:l.createElement(G.A,{title:t("Light theme")},l.createElement(j.A,{icon:"LightMode",style:{fontSize:18}})),value:D.T},{label:l.createElement(G.A,{title:t("System theme")},l.createElement(j.A,{icon:"AutoMode",style:{fontSize:18}})),value:null},{label:l.createElement(G.A,{title:t("Dark theme")},l.createElement(j.A,{icon:"DarkMode",style:{fontSize:18}})),value:D.nd}],onChange:e=>d(e)}))};var $=o(705),Y=o(22536),K=o(49982),Q=o(69201),J=o(62347),Z=o(86095),ee=o(90121),te=o(27941),oe=o(13668);const{Sider:le}=i.A,{useToken:ae}=r.A,ie=()=>{const{token:e}=ae();let t=(0,a.zy)();const o=(0,c.wA)(),r=(0,a.Zp)(),{emailId:u,blockId:g}=(0,a.g)(),b=(0,c.d4)(C.C1),E=(0,c.d4)(T.cL),h=(0,l.useRef)(),[f]=(0,$.bw)(),v=(0,n.hN)();h.current||(h.current=(0,Z.$Z)()),(0,l.useEffect)((()=>{(0,U.FN)(e)}),[e]);const{data:A=[],isSuccess:_}=(0,$.I9)(b.id,{pollingInterval:3e4,skip:E});(0,l.useEffect)((()=>{const e=A.filter((e=>""===e.seen||null===e.seen));setTimeout((()=>{e.length&&_&&e.forEach((e=>{var t,o;v[e.type]({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(t=e.title)||void 0===t?void 0:t.rendered)||e.title||""}}),description:l.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(o=e.content)||void 0===o?void 0:o.rendered)||""}}),placement:"bottomRight"});const a=(new Date).toLocaleString();f({id:e.id,datetime:a}).unwrap()}))}),5e3)}),[_,f,A,v]),(0,K.A)(),(0,Q.A)(),(0,J.A)(),(0,l.useEffect)((()=>{g||o((0,Y.nJ)()),u||o((0,H.ss)())}),[g,u,o,t.pathname]);let y=null;u||g||t.pathname.endsWith("/new")?y=h.current:h.current&&h.current.getValue()&&setTimeout((()=>h.current.setValue("")),1e3);const S=JSON.parse(localStorage.getItem(D.V0.em_menu_is_locked)),[k,B]=(0,l.useState)((null===S||void 0===S?void 0:S.isLocked)||!1),[w,x]=(0,l.useState)(!0);return(0,l.useEffect)((()=>{const e=()=>localStorage.setItem(D.V0.em_menu_is_locked,JSON.stringify({isLocked:k}));return e(),e()}),[k]),(0,ee.D3)(oe._1,(0,l.useCallback)((e=>{const t=(0,te.Mu)(e);r(t)}),[r])),l.createElement("div",{className:"main"},l.createElement(Z.kx.Provider,{value:y},l.createElement("div",{className:"main__pane main__pane_main"},l.createElement("div",{className:"main__pane-content",id:"pane-content-iframe"},l.createElement(i.A,{className:"main__pane-layout",hasSider:!0},!D.EW.isPlugin&&l.createElement(le,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed",overflow:window.innerWidth>1400?"hidden":""},collapsible:!0,collapsed:!k&&w,defaultCollapsed:!0,reverseArrow:!k&&!w||k&&!w,trigger:l.createElement("div",{className:"main__pane-trigger"},k?l.createElement(s.A,{style:{fontSize:window.innerWidth>1400?18:13}}):l.createElement(l.Fragment,null,l.createElement(d.A,{style:{fontSize:window.innerWidth>1400?18:13}}),l.createElement(m.A,{style:{fontSize:window.innerWidth>1400?18:13}})),l.createElement(q,null)),className:p()("main__menu",{main__menu_lock:k}),width:260,collapsedWidth:window.innerWidth>1400?80:0,zeroWidthTriggerStyle:{},onCollapse:(e,t)=>{e?!k&&x(!0):x(!e),B(!k)},onMouseEnter:()=>!k&&x(!1),onMouseLeave:()=>!k&&x(!0)},l.createElement(M,{isMenuCollapsed:w,setIsMenuCollapsed:x,isLocked:k})),l.createElement(V.A,{isModalVisible:E===D.lx.EDIT_PROJECT_MODAL}),l.createElement(W.A,{isModalVisible:E===D.lx.EDIT_PROFILE_MODAL}),l.createElement(a.sv,null))))))}},48956:(e,t,o)=>{o.d(t,{A:()=>c});var l=o(98173),a=o(48753),i=o(82021),r=o(37969),n=o(12543),d=o(30150),m=o(89613),s=o(98173);const c=({open:e,sideOnOk:t,onCancel:o,initialSlide:c=0})=>{const{__:u}=(0,n.s9)(),p=(0,d.Zp)(),[g,b]=(0,l.useState)(c),E=(0,l.useRef)(null),h=(0,m.u)();(0,l.useEffect)((()=>{e&&E.current&&(E.current.goTo(c,!0),b(c))}),[e,c]);const f=(0,l.useMemo)((()=>[{image:u("https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png"),backgroundColor:"var(--blue-2)",title:u("More editing features"),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 the Code mode and see the changes in real time. Builder has no code restrictions \u2014 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 builder! 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, large images, and other issues 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("Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.")},{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 appears 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,l.useEffect)((()=>{if(e&&E.current){E.current.goTo(c,!0),b(c);const e=f[c];h({event:"open_modal",action:"open_premium-features_modal",modal_id:"premium-features",offer_id:e.title})}}),[e,f,c,h]),s.createElement(a.A,{open:e,footer:null,onCancel:o,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%"}},s.createElement(i.A,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:"carousel-slider",draggable:!0,autoplaySpeed:5e3,initialSlide:g,ref:E},f.map(((e,t)=>s.createElement("div",{key:t},s.createElement("div",{className:"carousel-slide",style:{background:`${e.backgroundColor}`}},s.createElement("div",{className:"slide-item-image"},s.createElement("img",{src:e.image,alt:`slide-${t}`})),s.createElement("div",{className:"slide-item-content"},s.createElement("h3",{className:"slide-title"},e.title),s.createElement("p",{className:"slide-description"},e.description))))))),s.createElement("div",{className:"modal-subtitle"},u("This and other features are available for you on any paid plan.")),s.createElement("div",{className:"modal-buttons"},s.createElement(r.Ay,{size:"large",onClick:()=>o(!1)},u("Cancel")),s.createElement(r.Ay,{type:"primary",size:"large",onClick:()=>{t&&t(),p("/billing"),o(!1)},style:{padding:"0 30px"}},u("Select plan"))))}},1753:(e,t,o)=>{o.d(t,{A:()=>s});var l=o(98173),a=o(49856),i=o(98447),r=o(38826);const n=l.createElement(r.A,{style:{fontSize:48},rev:null,spin:!0}),d=(0,l.lazy)((()=>Promise.all([o.e(6819),o.e(1880),o.e(5346),o.e(8084)]).then(o.bind(o,10275)))),m={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"};function s(e){return l.createElement(l.Suspense,{fallback:l.createElement(a.A,{size:"large",style:m},l.createElement(i.A,{indicator:n}))},l.createElement(d,e))}},89687:(e,t,o)=>{o.d(t,{A:()=>i});var l=o(98173),a=o(30150);const i=({lastProjectId:e})=>{const{pathname:t,search:o}=(0,a.zy)();return!1===e?l.createElement(a.C5,{to:"/projects"}):e&&l.createElement(a.C5,{to:`/projects/${e+t+o}`})}},67007:(e,t,o)=>{o.d(t,{A:()=>i});var l=o(98173),a=o(30150);const i=({to:e})=>l.createElement(a.C5,{to:e})},96087:(e,t,o)=>{o.d(t,{A:()=>c});var l=o(98173),a=o(47555),i=o(72570),r=o(37969),n=o(30150),d=o(12543),m=o(40277);const{Content:s}=a.A,c=()=>{const{__:e}=(0,d.s9)();let t=(0,n.Zp)();return l.createElement(a.A,null,l.createElement(s,{className:"container"},l.createElement(i.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:l.createElement(r.Ay,{type:"primary",onClick:()=>(0,m.XZ)(t,"/projects")},e("Back Home"))})))}},53821:(e,t,o)=>{o.d(t,{A:()=>Y});var l=o(98173),a=o(30150),i=o(2604),r=o(26298),n=o.n(r),d=o(30753),m=o(63719),s=o(49856),c=o(67034),u=o(94674),p=o(201),g=o(66964),b=o(37969),E=o(38976),h=o(5553),f=o(69194),v=o(13785),A=o(34401),_=o(66711),y=o(51717),S=o(63448),k=o(42567),B=o(2952),w=o(1047),x=o(65716),R=o(40277),P=o(64909),N=o(52919),T=o(90614),I=o(27941),C=o(12543),L=o(86095),O=o(15626),F=o(32947);const{Text:D,Link:M,Title:V}=m.A,W="Links",z="Images",G="Spam assassin",j="Problems",H="valid",U="warnings",X="errors",q=[H,X,U],$=({summary:e,__:t,selectedTags:o,setSelectedTags:a})=>l.createElement(V,{level:5,style:{margin:0,fontSize:"14px"}},l.createElement(s.A,{style:{flexWrap:"wrap"},gap:"6"},q.map(((i,r)=>l.createElement(c.A.CheckableTag,{key:i+r,checked:null===o||void 0===o?void 0:o.includes(i),onChange:e=>((e,t)=>{const l=t?2===o.length?[]:[...o,e]:o.filter((t=>t!==e));a(l)})(i,e),className:n()(`${i} optimise__button`,{[`${i}_active`]:o.includes(i)})},t(i===H?"Valid":i===U?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[i])||0))))),Y=()=>{var e,t,o,r,m,s,c;const{__:q}=(0,C.s9)(),Y=(0,i.wA)(),K=(0,L.fn)(),Q=(0,I.rD)(),J=(0,P.hN)(),{emailId:Z,projectId:ee}=(0,a.g)(),te=(0,N.QC)(),oe=(0,i.d4)(w.rd),le=(0,T.ml)(O.AZ.ON_LIMIT_ID),[ae,ie]=(0,B.Sr)(),[re,ne]=(0,B.ku)(),[de,me]=(0,B.Ju)(),{data:se,isSuccess:ce,refetch:ue}=(0,x.fo)(+ee,{skip:!!F.EW.isPlugin||!+ee}),{limits:pe}=F.EW.isPlugin?Q.limits?Q:{limits:{optimization_limit:0}}:se||{limits:{optimization_limit:0}},{optimization_limit:ge}=pe,[be,Ee]=(0,l.useState)(),[he,fe]=(0,l.useState)([]),[ve,Ae]=(0,l.useState)([]),[_e,ye]=(0,l.useState)([]),[Se,ke]=(0,l.useState)([]),[Be,we]=(0,l.useState)(0),[xe,Re]=(0,l.useState)([]),[Pe,Ne]=(0,l.useState)([]),Te=Be>=ge&&ge>0,Ie=!(!Q.limits||!Q.counters)&&F.EW.isPlugin,Ce=(0,l.useCallback)((()=>{le.fire({name:"OptimizationCount",count:Be+1})}),[le,Be]);(0,l.useEffect)((()=>{var e,t;Ie?we((null===Q||void 0===Q||null===(e=Q.counters)||void 0===e?void 0:e.optimization_counter)||0):ce&&(null===se||void 0===se||null===(t=se.counters)||void 0===t?void 0:t.optimization_counter)&&we(se.counters.optimization_counter)}),[Ie,se,ce,Q]),(0,l.useEffect)((()=>{var e,t;be===W&&xe.links&&Ae(he.length>0?null===(e=xe.links)||void 0===e?void 0:e.filter((e=>he.includes(e.status))):xe.links);be===z&&Pe.images&&ye(he.length>0?null===(t=Pe.images)||void 0===t?void 0:t.filter((e=>he.includes(e.status))):Pe.images)}),[xe.links,Pe.images,he,be]);const Le=()=>{if(!Z)return void J.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;Ie&&(we((e=>e+1)),Ce());const t=K.getValue(),o=(new DOMParser).parseFromString(t,"text/html"),a={},i={};o.querySelectorAll("a[href]").forEach(((e,t)=>{a[`link_${t}`]=e.getAttribute("href"),i[`link_${t}`]=e.innerText})),te.send({operation:"sandbox_set_attr_to_links"}),re({entity_id:Z,data:a}).then((({data:t,error:o})=>{if(o)(0,R.p6)({error:o},J);else if(null!==t&&void 0!==t&&t.result){let o=[...t.result];null===o||void 0===o||o.sort(((e,t)=>e.linkId-t.linkId));const l=e=>{var t,o,l,a;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(o=e.page)||void 0===o?void 0:o.secure)||void 0===t||t):"invalid"!==e.type)?H:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(l=null===(a=e.page)||void 0===a?void 0:a.secure)||void 0===l||l))&&"invalid"!==e.type?U:X};e={links:o.map((e=>({...e,text:i[e.linkId],status:l(e)}))),summary:{valid:o.filter((e=>l(e)===H)).length||0,warnings:o.filter((e=>l(e)===U)).length||0,errors:o.filter((e=>l(e)===X)).length||0}},Re(e),(0,R.wB)(q("Links validation was successfully completed"),J),!F.EW.isPlugin&&ue()}else t.statusCode>300||!t.success?(0,R.p6)({error:{data:t}},J):J.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!xe.links&&De("")})).catch((e=>{(0,R.p6)({error:e},J)}))},Oe=()=>{if(!Z)return void J.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});Ie&&(we((e=>e+1)),Ce());const e=K.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let o={};t.querySelectorAll("img").forEach(((e,t)=>o[`image_${t}`]=e.src)),te.send({operation:"sandbox_set_attr_to_images"}),de({entity_id:Z,data:o}).then((({data:e,error:t})=>{let o;if(t)(0,R.p6)({error:t},J);else if(null!==e&&void 0!==e&&e.result){let t=Object.values(e.result);t.sort(((e,t)=>e.imageId-t.imageId));let l=t.reduce(((e,t)=>e+Math.round(t.image.bytes/1024)),0);const a=e=>null!==e.statusCode&&e.statusCode<300?H:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?U:X;o={images:t.map((e=>({...e,status:a(e)})))||[],summary:{valid:t.filter((e=>a(e)===H)).length||0,warnings:t.filter((e=>a(e)===U)).length||0,errors:t.filter((e=>a(e)===X)).length||0},summaryTime:{value:(l>1200?l/1e3:l).toFixed(1),name:q(l>1200?"MB":"KB")}},o&&Ne(o),(0,R.wB)(q("Images validation was successfully completed"),J),!F.EW.isPlugin&&ue()}else{var a;e.statusCode>300||!e.success?(0,R.p6)({error:{data:e}},J):J.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===Pe||void 0===Pe||null===(a=Pe.images)||void 0===a||!a.length)&&De("")}})).catch((e=>{(0,R.p6)({error:e},J)}))},Fe=()=>{Z?(Ie&&(we((e=>e+1)),Ce()),ae({entity_id:Z,data:{html:K.getValue()}}).then((({data:e,error:t})=>{if(t)(0,R.p6)({error:t},J);else if(e&&e.success){const t=!!e.result.report&&Object.values(e.result.report);t&&(t.sort(((e,t)=>e.score-t.score)),ke({...e.result,report:t})),(0,R.wB)(q("Spam validation was successfully completed"),J),!F.EW.isPlugin&&ue()}else e.statusCode>300||!e.success?(0,R.p6)({error:{data:e}},J):J.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430."}}),placement:"bottomRight"}),(null===Se||void 0===Se||!Se.length)&&De("")})).catch((e=>{(0,R.p6)({error:e},J)}))):J.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},De=e=>{Ee(e!==be?e:""),fe([])};let Me=null;return(0,l.useEffect)((()=>{ge>0&&Be>=+ge&&J.error({message:q("The usage limit has been exceeded"),description:q("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})}),[Be,ge,q,J]),l.createElement("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize"},Ie&&l.createElement(d.A,{counter:Be,limits:ge}),Q.optimizeLinksEnabled&&l.createElement(l.Fragment,null,l.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),l.createElement(p.A,{gutter:10,align:"middle"},l.createElement(g.A,{span:20},l.createElement("div",{className:"form-group-title"},q("Links validation"))),l.createElement(g.A,{span:4,align:"right"},l.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;De(W),null!==xe&&void 0!==xe&&null!==(e=xe.links)&&void 0!==e&&e.length||be===W||Le()},loading:ne.isLoading,disabled:Te&&!(null!==xe&&void 0!==xe&&null!==(e=xe.links)&&void 0!==e&&e.length)},!ne.isLoading&&(be===W?l.createElement(A.A,null):l.createElement(_.A,null))))),be===W&&!(null===xe||void 0===xe||!xe.links)&&(0===(null===xe||void 0===xe||null===(t=xe.links)||void 0===t?void 0:t.length)?l.createElement(p.A,{style:{marginBottom:24}},l.createElement(E.A,{message:q("No links found."),type:"info"})):l.createElement(l.Fragment,null,l.createElement(p.A,{style:{marginBottom:14}},l.createElement("div",{className:"optimise__title-wrapper"},l.createElement($,{__:q,summary:xe.summary,setSelectedTags:fe,selectedTags:he}),l.createElement(b.Ay,{disabled:Te,loading:ne.isLoading,onClick:Le,icon:l.createElement(y.A,null)},q("Refresh")))),l.createElement(p.A,{style:{marginBottom:24}},l.createElement(g.A,{span:24},l.createElement(h.A,{itemLayout:"horizontal",dataSource:ve,renderItem:(e,t)=>{var o;return l.createElement(h.A.Item,{style:{border:"none"},key:t+"_"+e.id},l.createElement(h.A.Item.Meta,{avatar:e.status===H?l.createElement(S.A,{className:H}):e.status===U?l.createElement(S.A,{className:U}):l.createElement(k.A,{className:X}),title:l.createElement(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,o=600>e.statusCode>399||!e.statusCode,void te.send({operation:F.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:o}});var t,o}},""===e.url?q("empty link"):e.url),description:l.createElement(l.Fragment,null,!(null===(o=e.text)||void 0===o||!o.length)&&l.createElement(D,{type:"secondary"},e.text),e.page.title&&e.page.title,e.page.secure&&e.status===H&&l.createElement(l.Fragment,null,l.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),l.createElement("span",{className:H},q("secure"))),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&l.createElement(l.Fragment,null,l.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),l.createElement(D,{type:"secondary"},q("Failed to load"))))}))}})))))),Q.optimizeImagesEnabled&&l.createElement(l.Fragment,null,l.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),l.createElement(p.A,{gutter:10,align:"middle"},l.createElement(g.A,{span:20},l.createElement("div",{className:"form-group-title"},q("Images validation"))),l.createElement(g.A,{span:4,align:"right"},l.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;De(z),null!==Pe&&void 0!==Pe&&null!==(e=Pe.images)&&void 0!==e&&e.length||be===z||Oe()},loading:me.isLoading},!me.isLoading&&(be===z?l.createElement(A.A,null):l.createElement(_.A,null))))),be===z&&!(null===Pe||void 0===Pe||!Pe.images)&&(0===(null===Pe||void 0===Pe||null===(o=Pe.images)||void 0===o?void 0:o.length)?l.createElement(p.A,{style:{marginBottom:24}},l.createElement(E.A,{message:q("No images found."),type:"info"})):l.createElement(l.Fragment,null,l.createElement(p.A,{style:{marginBottom:16}},l.createElement(E.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:l.createElement("div",{className:"optimise__summary"},l.createElement("div",null,l.createElement(V,{level:4,style:{marginBottom:"0"}},Pe.images.length," "),l.createElement("span",{style:{fontSize:"12px"}},q("images"))),l.createElement("div",null,l.createElement(V,{level:4,style:{marginBottom:"0"}},null===(r=Pe.summaryTime)||void 0===r?void 0:r.value,null===(m=Pe.summaryTime)||void 0===m?void 0:m.name),l.createElement("span",{style:{fontSize:"12px"}},q("total size"))),l.createElement("div",null,l.createElement(V,{level:4,style:{marginBottom:"0"}},(Math.max(...Pe.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+q("s")),l.createElement("span",{style:{fontSize:"12px"}},q("time to load")))),type:"warning"})),l.createElement(p.A,{style:{marginBottom:12}},l.createElement("div",{className:"optimise__title-wrapper"},l.createElement($,{__:q,summary:Pe.summary,setSelectedTags:fe,selectedTags:he}),l.createElement(b.Ay,{icon:l.createElement(y.A,null),disabled:Te,loading:me.isLoading,onClick:()=>Oe()},q("Refresh")))),l.createElement(p.A,{style:{marginBottom:12}},l.createElement(g.A,{span:24},l.createElement(h.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:_e,renderItem:(e,t)=>l.createElement(h.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},key:t},l.createElement(h.A.Item.Meta,{className:n()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:l.createElement(f.A,{className:n()("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(Me);let o=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,l=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(o=document.createElement("div"),o.classList.add("img-preview"),l=document.createElement("div"),l.classList.add("img-preview-content"),o.append(l),document.querySelector(".email-pane__col_settings-inner").append(o)),l.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"!==o.style.opacity&&setTimeout((function(){o.style.opacity="1",o.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&&(Me=setTimeout((()=>{e.style.opacity="0",e.style.transform="translateX(-99%)",setTimeout((function(){e.remove()}),300)}),300))})()}),title:e.url?l.createElement(v.A,{placement:"top",title:e.message},l.createElement(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,o=600>e.statusCode>399||!e.statusCode,void te.send({operation:F.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:o}});var t,o}},""===(null===e||void 0===e?void 0:e.url)?q("empty src"):e.url)):e.message,description:l.createElement(l.Fragment,null,l.createElement("div",{className:"image-size"},e.image.dimensions&&l.createElement(l.Fragment,null,e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,l.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),l.createElement("span",null,Math.round(e.image.bytes/1024),q("kB")),l.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),l.createElement("span",null,e.image.responseTime,q("ms")),l.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),l.createElement("span",{className:"image-size-format"},e.image.contentType)),e.image.secure&&l.createElement(l.Fragment,null,l.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),l.createElement("span",{className:H},q("secure"))),e.resolvedUrl&&!e.valid&&l.createElement(D,{type:"danger"},q("not valid")))," ",!e.resolvedUrl&&!e.statusCode&&l.createElement(D,{type:"danger"},q("Failed to load")))}))})))))),Q.optimizeSpamAssassinEnabled&&l.createElement(l.Fragment,null,l.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),l.createElement(p.A,{gutter:10,align:"middle"},l.createElement(g.A,{span:20},l.createElement("div",{className:"form-group-title"},q("SpamAssassin"))),l.createElement(g.A,{span:4,align:"right"},l.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:ie.isLoading,onClick:()=>{var e;De(G),null!==(e=Se.report)&&void 0!==e&&e.length||Fe()},disabled:Te&&!(null!==Se&&void 0!==Se&&null!==(s=Se.report)&&void 0!==s&&s.length)},!ie.isLoading&&(be===G?l.createElement(A.A,null):l.createElement(_.A,null))))),be===G&&!(null===(c=Se.report)||void 0===c||!c.length)&&l.createElement(l.Fragment,null,l.createElement(p.A,{style:{marginBottom:8}},l.createElement("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam"},l.createElement(V,{level:1,style:{margin:0},type:Se.spamScore<2||!Se.spamScore||Se.spamScore<=Se.baseSpamScore-1?"success":Se.spamScore<Se.baseSpamScore-1?"warning":"danger"},l.createElement("span",{style:{marginRight:"12px"}},Se.spamScore||0),l.createElement(D,{style:{marginRight:"12px",fontSize:"20px"}},"Score")),l.createElement(b.Ay,{disabled:Te,icon:l.createElement(y.A,null),loading:ie.isLoading,onClick:Fe},q("Refresh"))),Se.spamScore>Se.baseSpamScore-1&&l.createElement(D,null,q("Lower scores are better. Aim for a score less than ")+(Se.baseSpamScore-1)+".")),l.createElement(p.A,{style:{marginBottom:8}},l.createElement(g.A,{span:24},l.createElement(h.A,{itemLayout:"horizontal",dataSource:Se.report,renderItem:e=>l.createElement(h.A.Item,{style:{border:"none"}},l.createElement(h.A.Item.Meta,{title:l.createElement(l.Fragment,null,l.createElement(D,{style:{fontSize:"20px"}},e.score),l.createElement("span",{style:{marginLeft:"12px"}},e.description))}))}))))),Q.optimizeCheckCodeEnabled&&l.createElement(l.Fragment,null,l.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),l.createElement(p.A,{gutter:10,align:"middle"},l.createElement(g.A,{span:20},l.createElement("div",{className:"form-group-title"},q("Source code validation"))),l.createElement(g.A,{span:4,align:"right"},l.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>De(j)},be===j?l.createElement(A.A,null):l.createElement(_.A,null)))),be===j&&l.createElement(l.Fragment,null,null!==oe&&void 0!==oe&&oe.length?l.createElement(p.A,{style:{marginBottom:8}},l.createElement(g.A,{span:24},l.createElement(h.A,{itemLayout:"horizontal",dataSource:oe,renderItem:e=>l.createElement(h.A.Item,{style:{border:"none"}},l.createElement(h.A.Item.Meta,{avatar:e.severity<6?l.createElement(k.A,{className:U}):l.createElement(k.A,{className:X}),title:l.createElement(D,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};Y((0,w.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error"},"Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber),description:l.createElement(D,null,e.message)}))}))):l.createElement(p.A,{style:{marginBottom:24}},l.createElement(E.A,{message:q("No problems found."),type:"info"})))))}},56605:(e,t,o)=>{o.d(t,{A:()=>n});var l=o(98173),a=o(49856),i=o(98447),r=o(38826);const n=({small:e=!1,style:t,wrap:o=!1})=>{const n={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},d=l.createElement(r.A,{style:{fontSize:48},spin:!0});return l.createElement(a.A,{size:"large",style:n,wrap:o},l.createElement(i.A,{indicator:d}))}},97041:(e,t,o)=>{o.d(t,{A:()=>p});var l=o(98173),a=o(64909),i=o(30150),r=o(79245),n=o(78915),d=o(40277),m=o(96734),s=o(89613),c=o(32947);const u="emailmaker.ru",p=({children:e})=>{const t=(0,i.zy)(),o=(0,a.hN)(),p=(0,m.p)(),[g,b]=(0,r.ok)(),E=(0,s.u)(),[h,{isError:f,isSuccess:v,error:A,data:_}]=(0,n.i2)(),{isError:y,isUninitialized:S,isLoading:k,isSuccess:B,error:w,data:x,refetch:R}=(0,n.CR)("",{skip:c.EW.isPlugin||!p.get(c.A9.em_token)}),P=(0,l.useMemo)((()=>({email:g.get("email"),hash:g.get("hash"),event:"confirmation"===g.get("event")})),[g]);if((0,l.useEffect)((()=>{f?(0,d.p6)({error:A},o):v&&(E({event:"email_confirmation",user_email:null===_||void 0===_?void 0:_.email}),(0,d.wB)(_.message,o),x&&R())}),[_,A,f,v,o,x,R,E]),(0,l.useEffect)((()=>{!(P.email&&P.hash&&P.event)||!1!==(null===x||void 0===x?void 0:x.email_confirmation)&&p.get(c.A9.em_token)||_||h({hash:P.hash,email:P.email,event:P.event}).catch((e=>{})).finally((()=>b("")))}),[P,h,x,p,b,_]),(0,l.useEffect)((()=>{y&&w&&((0,d.p6)({error:w},o),(0,d.Id)(p))}),[x,y,w,o,p]),c.EW.isPlugin)return e;if(!c.EW.isPlugin&&!p.get(c.A9.em_token)&&!t.pathname.includes("auth"))return l.createElement(i.C5,{to:"/auth",state:{from:t}});if((S||k)&&!t.pathname.includes("auth"))return l.createElement(l.Fragment,null);if(y&&!t.pathname.includes("auth"))return l.createElement(i.C5,{to:"/auth",state:{from:t}});if(B){const{id:o,email:a,name:r,locale:n,carrotquest_hash:d,ducalis_hash:m,email_subscription_consent:s,last_used_project:g}=x;return p.set(c.A9.em_id,o,{domain:u}),p.set(c.A9.em_email,a,{domain:u}),p.set(c.A9.em_name,r,{domain:u}),p.set(c.A9.em_locale,n,{domain:u}),p.set(c.A9.em_carrotquest_hash,d,{domain:u}),p.set(c.A9.em_ducalis_hash,m,{domain:u}),p.set(c.A9.em_email_subscription_consent,s,{domain:u}),g&&"/"===t.pathname?l.createElement(i.C5,{to:`/projects/${g}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},14107:(e,t,o)=>{o.d(t,{A:()=>E});var l=o(98173),a=o(30150),i=o(2604),r=o(47555),n=o(72570),d=o(37969),m=o(12543),s=o(65716),c=o(84572),u=o(56605),p=o(40277),g=o(32947);const{Content:b}=r.A,E=()=>{var e;const{__:t}=(0,m.s9)(),{projectId:o}=(0,a.g)();let E=(0,a.Zp)(),h=(0,a.zy)();const f=(0,i.wA)(),v=(0,s.fo)(+o,{skip:!o}),{isLoading:A,isError:_,error:y,isSuccess:S,data:k}=v;return(0,l.useEffect)((()=>{S&&(null===k||void 0===k?void 0:k.id)!==o&&f((0,c.od)(k))}),[S,k,f,o]),(0,l.useEffect)((()=>{S&&o&&h.pathname.endsWith(o)&&E(`${h.pathname}/emails`)}),[S,h,E,o]),l.createElement(l.Fragment,null,A&&l.createElement(u.A,null),_&&y&&l.createElement(r.A,{className:"project-outlet"},l.createElement(b,{className:"project-outlet__container container"},l.createElement(n.Ay,{status:y.status,title:y.status,subTitle:null===(e=y.data)||void 0===e?void 0:e.message,extra:l.createElement(d.Ay,{type:"primary",onClick:()=>(0,p.XZ)(E,"/projects")},t("Back To Projects"))}))),(S||g.EW.isPlugin)&&l.createElement(a.sv,{context:{...v}}))}},15737:(e,t,o)=>{o.d(t,{A:()=>g});var l=o(98173),a=o(27499),i=o(48753),r=o(37969),n=o(8218),d=o(64909),m=o(2604),s=o(12543),c=o(83027),u=o(23424),p=o(32947);const g=({group:e,refetch:t})=>{const{__:o,_x:g}=(0,s.s9)(),b=(0,m.wA)(),[E]=a.A.useForm(),h=(0,l.useRef)(null),f=(0,m.d4)(u.cL)===p.lx.EDIT_GROUP_NAME_MODAL,v=(0,d.hN)(),{id:A=null,name:_=""}=e,y=()=>b((0,u.Oo)()),[S,k]=(0,c.CE)();(0,l.useEffect)((()=>{f&&E.setFieldsValue({name:_})}),[f,_,E]);const B=()=>{E.validateFields().then((({name:e})=>{S({id:A,data:{name:e}}).then((({data:a,error:i})=>{i?(v.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:i.data.code}}),description:l.createElement("div",{dangerouslySetInnerHTML:{__html:i.data.message}}),placement:"bottomRight"}),E.setFieldValue("name",e)):(t().then((({data:e})=>{if(e){var t,o,l;const a=null===(t=e[0])||void 0===t||null===(o=t.children)||void 0===o||null===(l=o.find((e=>e.id===A)))||void 0===l?void 0:l.name;E.setFieldValue("name",a)}})),y(),v.success({message:o("The group \u201c")+e+g("\u201d was successfully changed to \u201c","group")+a.name+o("\u201d."),placement:"bottomRight"}))}))}))};return l.createElement(i.A,{title:o("Change group name"),open:f,onOk:B,onCancel:y,className:"new-group-name-modal",centered:!0,footer:[l.createElement(r.Ay,{key:"submit",type:"primary",size:"large",loading:k.isLoading,onClick:B},o("Change name"))]},l.createElement(a.A,{form:E,layout:"vertical",name:"rename_group_form",onFinish:B,initialValues:{remember:!1,name:_},autoComplete:"off",style:{paddingTop:10}},l.createElement(a.A.Item,{name:"name",rules:[{required:!0,message:o("Please enter the group name")}]},l.createElement(n.A,{disabled:k.isLoading,size:"large",placeholder:o("Enter the group name"),ref:h,style:{marginBottom:5}}))))}},95942:(e,t,o)=>{o.d(t,{A:()=>u});var l=o(98173),a=o(37969),i=o(2604),r=o(71446),n=o(94160),d=o(47014),m=o(8807),s=o(40277),c=o(12543);const u=()=>{const{__:e}=(0,c.s9)(),{notification:t}=r.A.useApp(),o=(0,i.d4)(d.C1),[u]=(0,n.C)(),[p,g]=(0,l.useState)(!1);(0,l.useEffect)((()=>{o.hasOwnProperty("email_confirmation")&&g(o.email_confirmation)}),[o,p]);return null!==o&&void 0!==o&&o.email_confirmation||null===o||void 0===o||!o.privacy_policy_agreement?null:l.createElement("div",{className:"main__ribbon"},l.createElement("span",null,l.createElement(m.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}})," ",e("Confirmation email was sent to"),"\xa0",l.createElement("em",null,o.email),".\xa0",e("Didn't receive an email?"),"\xa0",l.createElement(a.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{u({userId:o.id,email:o.email}).then((({data:l,error:a})=>{l?(0,s.wB)(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",o.email),t):a&&(0,s.p6)(a,t)}))}},e("Resend")," ",l.createElement(m.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}}))))}},40409:(e,t,o)=>{o.d(t,{A:()=>S});var l=o(98173),a=o(80703),i=o(13785),r=o(37969),n=o(64909),d=o(30150),m=o(2604),s=o(12543),c=o(52218),u=o.n(c),p=o(68984),g=o(65716),b=o(83027),E=o(62093),h=o(22536),f=o(40277),v=o(89613),A=o(86095),_=o(32947);const y=({block:e,isEditableRights:t,rightCol:o,autoSaveBlockResult:c})=>{const{__:y}=(0,s.s9)(),{projectId:S,blockId:k}=(0,d.g)();let B=(0,m.d4)(h.Fv),w=(0,m.d4)(h.Fv),x=(0,m.wA)();const R=(0,n.hN)(),P=(0,A.fn)(),N=(0,m.Pj)(),[T,I]=(0,l.useState)(!1),[C,L]=(0,l.useState)(null),[O,F]=(0,l.useState)(!1),[D,M]=(0,l.useState)(!1),V=(0,v.u)();(0,l.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&L(!0)}),[]);const{data:W,refetch:z}=(0,g.fo)(+S,{skip:!+S}),[G]=(0,p.Gr)(),[j,H]=(0,p.OZ)(),[U,X]=(0,p.pP)(),[q]=(0,g.OD)(),$=`project_${S}`,Y=W&&(0,f._q)(W,_.YY).find((e=>e.name===$)),K=W&&(0,f.HT)(W,_.YY),Q=(0,l.useCallback)((o=>{var l,a;if(F(!0),!t&&e.lock&&D)return R.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",message:y("No access to edit the letter."),placement:"bottomRight",data:(0,n.x_)(e)}),void F(!1);if(((null===(l=e.tags)||void 0===l?void 0:l.length)||(null===(a=e.blocktags)||void 0===a?void 0:a.length))>10&&D)return R.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",message:y("Maximum 10 tags available."),placement:"bottomRight",data:(0,n.x_)(e)}),void F(!1);if(""===e.type)return R.error({message:y("Set the type"),description:y("Please set the 'Type' field in the Settings section."),placement:"bottomRight"}),void F(!1);const i=t=>{var l;const a=null===(l=e.tags)||void 0===l?void 0:l.map((e=>{const o=null===K||void 0===K?void 0:K.find((t=>t.name===e));return o?o.id:G({name:e,parent:t}).then((({error:t,data:o})=>{var l,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(l=t.data)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.term_id:o?o.id:void(t&&(R.fromError("TAG_CREATING_ERROR",e,t),F(!1)))}))})),i=(l=null)=>{const a=o=>{N.dispatch(b.kE.endpoints.getTags.initiate({parent:t})),z(),D&&(R.success({id:"BLOCK_EDITING_SUCCESS",message:y("The block was successfully saved.","block"),data:(0,n.x_)(e)}),F(!1)),fetch(((e,t,o,l)=>`https://scr.emcdn.ru/screenshot?delay=1000&width=800&fullPage=true&deviceScaleFactor=0.8&format=jpg&clearCache=true${l?`&cacheControl=true&cache-hash=${u()(l)}`:""}&url=${encodeURIComponent(`https://dev-backend-1.emailmaker.ru/get${e}/${o}?secret_hash=${u()(`${t}${o}${_.KI}`)}&raw=true`)}`)(_.IE,S,o.id,o.modified),{mode:"no-cors"}).then((()=>{}))},i=(0,f._q)(e,_.zh).filter((t=>(l||e.blocktags).includes(t.id))).map((e=>e.name));e.isNew?X.status!==_.eG&&U({source:o,title:null===e.title?y("New block title"):e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===P||void 0===P?void 0:P.getValue())||"",blocktags:l?l.join(","):e.blocktags,tags:i}).then((({data:t,error:o})=>{o?(R.fromError("BLOCK_CREATING_ERROR",{title:e.title,html:(null===P||void 0===P?void 0:P.getValue())||""},o),F(!1)):a(t)})):H.status!==_.eG&&j({blockId:e.id,source:o,title:e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===P||void 0===P?void 0:P.getValue())||"",blocktags:l||e.blocktags,tags:i}).then((({data:t,error:o})=>{o&&D?(R.fromError("BLOCK_EDITING_ERROR",(0,n.x_)(e),o),F(!1)):a(t)}))};a?Promise.all(a).then((e=>i(e))):i(null)};F(!0),Y?i(Y.id):G({name:$}).then((async({data:t,error:o})=>{if(o)R.fromError("FOLDER_CREATING_ERROR",$,o),F(!1);else{const{data:o,error:l}=await q({projectId:S,blocktags:t.id});l?(R.fromError("BLOCK_CLONING_ERROR",(0,n.x_)(e),l),F(!1)):o&&i(o.blocktags&&o.blocktags[0])}})).catch((e=>{}))}),[X.status,U,H.status,j,e,t,G,q,S,y,D,P,R,K,z,N,Y,$]);(0,l.useEffect)((()=>{D&&(Q(),M(!1))}),[D,Q]);const J=(0,l.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),M(!0))}),[]);(0,l.useEffect)((()=>(document.addEventListener("keydown",J),()=>{document.removeEventListener("keydown",J)})),[J]);const Z=(0,l.useCallback)((e=>{const t=e.data.operation,o=e.data.action;t===_.Ru.APPLICATION_ACTION&&"save_email"===o&&M(!0)}),[]);return(0,E.A)(Z),(0,l.useEffect)((()=>{X.isError&&(F(!1),(0,f.p6)(X,R))}),[x,X,R]),(0,l.useEffect)((()=>{const e=setTimeout((()=>{I(!0)}),1e4);return()=>{clearTimeout(e)}}),[]),(0,l.useEffect)((()=>{e.isNew&&!k&&T&&(Q(),I(!1))}),[T,e,Q,k]),l.createElement(i.A,{title:y(C?"Save by \u2318S":"Save by Ctrl+S"),placement:o?"right":"bottomRight"},l.createElement(r.Ay,{type:"primary",block:o,className:"em-analytics__block-save",icon:l.createElement(a.A,null),onClick:()=>{V({event:"click",action:"save_block"}),M(!0)},loading:H.isLoading||q.isLoading||X.isLoading||O||c},o||B||w?"":y("Save")))};y.defaultProps={block:null};const S=y},45887:(e,t,o)=>{o.d(t,{Ay:()=>L,QG:()=>I,Wv:()=>T});var l=o(98173),a=o(13785),i=o(37969),r=o(49856),n=o(64909),d=o(80703),m=o(30150),s=o(2604),c=o(52218),u=o.n(c),p=o(12543),g=o(98845),b=o(65716),E=o(83027),h=o(62093),f=o(12741),v=o(1047),A=o(40277),_=o(27941),y=o(89613),S=o(86095),k=o(90121),B=o(90614),w=o(96734),x=o(32947),R=o(15626),P=o(13668);const N="KEYBOARD",T=(e,t,o,l,a=!0,i=.8,r)=>`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${r?"":"&fullPage=true"}&deviceScaleFactor=${i}&format=jpg&clearCache=${a}${l?`&cacheControl=true&cache-hash=${u()(l)}`:""}&url=${encodeURIComponent(`https://app.emailmaker.ru/get${e}/${o}?secret_hash=${u()(`${t}${o}${x.KI}`)}&raw=true`)}${r?`&selector=${r}`:""}`,I=(e,t,o=!0,l=.8,a)=>{let i=`https://racs.rest/v3/file/${e}?resource=exportPngApi`;return`${window.location.host.indexOf("localhost"),"https://scr.emcdn.ru"}/screenshot?delay=1000&width=800${a?"":"&fullPage=true"}&deviceScaleFactor=${l}&format=jpg&clearCache=${o}${t?`&cacheControl=true&cache-hash=${u()(t)}`:""}&url=${encodeURIComponent(`${i}`)}${a?`&selector=${a}`:""}`},C=({email:e,isEditableRights:t,autoSaveEmailResult:o,disabled:c})=>{var u,I;let C=(0,s.wA)(),L=(0,m.Zp)();const{__:O,_x:F}=(0,p.s9)(),{projectId:D,emailId:M}=(0,m.g)(),V=(0,w.p)(),W=(0,n.hN)(),z=(0,_.rD)(),G=(0,S.fn)(),j=(0,s.Pj)(),H=(0,s.d4)(v.rY),U=(0,s.d4)(v.UI),[X,q]=(0,l.useState)(!1),[$,Y]=(0,l.useState)(null);(0,l.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&Y(!0)}),[]);const{data:K,refetch:Q}=(0,b.fo)(+D,{skip:!+D}),{data:J,refetch:Z}=(0,E.Jz)({parent:null===K||void 0===K||null===(u=K.folder)||void 0===u?void 0:u[0]},{skip:!x.EW.isPlugin||!(null!==K&&void 0!==K&&null!==(I=K.folder)&&void 0!==I&&I[0])}),[ee]=(0,g.Gr)(),[te]=(0,E.JI)(),[oe,le]=(0,g.dN)(),[ae,ie]=(0,g.Kh)(),[re]=(0,b.OD)(),[ne,de]=(0,l.useState)(!1),[me,se]=(0,l.useState)(""),ce=`project_${D}`,ue=K&&(0,A._q)(K,x.zh).find((e=>e.name===ce)),pe=K&&(0,A.HT)(K,x.zh),ge=(0,B.ml)(R.AZ.BEFORE_SAVE_EMAIL),be=(0,y.u)(),Ee=(0,l.useCallback)((o=>{var l,a;if(!t&&e.lock&&me)return void W.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:(0,n.Gy)(e),message:O("No access to edit the letter."),placement:"bottomRight"});if(((null===e||void 0===e||null===(l=e.tags)||void 0===l?void 0:l.length)||(null===(a=e.emailtags)||void 0===a?void 0:a.length))>10&&me)return void W.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:(0,n.Gy)(e),message:O("Maximum 10 tags available."),placement:"bottomRight"});const i=async t=>{var l;const a=Object.entries(H).flatMap((([e,t])=>t.map((({value:t,label:o})=>({id:+t,name:o,parent:+e.split("_")[0]})))));let i=[];U.length&&U.forEach((e=>{i.push(...null===e||void 0===e?void 0:e.children.map((e=>({id:e.id,parentId:e.parent}))))}));const r=(null===(l=e.tags)||void 0===l?void 0:l.map((e=>{const o=null===pe||void 0===pe?void 0:pe.find((t=>t.name===e));return o?o.id:ee({name:e,parent:t}).then((({error:t,data:o})=>{var l,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(l=t.data)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.term_id:o?o.id:void(t&&(W.fromError("TAG_CREATING_ERROR",e,t),de(!1)))}))})))||[],d=(null===a||void 0===a?void 0:a.map((e=>{const t=null===i||void 0===i?void 0:i.find((t=>t.id===e.id));return t?t.id:te({name:e.name,parent:e.parent}).then((({error:t,data:o})=>{var l,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(l=t.data)||void 0===l||null===(a=l.data)||void 0===a?void 0:a.term_id:o?o.id:void(t&&(W.fromError("GROUP_CREATING_ERROR",e,t),de(!1)))}))})))||[],m=(e,l=null,a=null,i=[])=>{var r,d;const m=(null===(r=e.title)||void 0===r?void 0:r.trim())||(null===(d=e.subject)||void 0===d?void 0:d.trim())||O("Untitled email."),s=o=>{j.dispatch(E.kE.endpoints.getTags.initiate({parent:t})),!x.EW.isPlugin&&Q&&Q(),me&&(W.success({id:"EMAIL_SAVING_SUCCESS",message:O("The email was successfully saved."),data:(0,n.Gy)(e)}),de(!1),!x.EW.isPlugin&&J&&Z()),x.EW.isPlugin||fetch(T(x.Tm,D,o.id,o.modified),{mode:"no-cors"}).then((()=>{}))},c=(0,A._q)(e,x.zh).filter((t=>(l||e.emailtags).includes(t.id))).map((e=>e.name));var u,p,g,b,h;if(e.isNew){if(ie.status!==x.eG){const t=V.get(x.A9.em_folder);ae({title:m,source:o,project:e.project,subject:e.subject,preheader:e.preheader,description:e.description,utm_parameters:{utm_source:e.utm_parameters.utm_source,utm_medium:e.utm_parameters.utm_medium,utm_campaign:e.utm_parameters.utm_campaign,utm_term:e.utm_parameters.utm_term,utm_content:e.utm_parameters.utm_content},html:(null===G||void 0===G?void 0:G.getValue())||"",parent_email:e.parent_email||x.iU,common_styles:e.common_styles||"",emailtags:l?l.join(","):e.emailtags,tags:c,group:a||e.group,is_template:e.is_template||!1,is_inited:e.is_inited,renderGuid:e.renderGuid,folder:t!==x.y2&&t}).then((({data:t,error:o})=>{o?(me&&W.fromError("EMAIL_CREATING_ERROR",{title:e.title,code:(null===G||void 0===G?void 0:G.getValue())||""},o),de(!1)):(C((0,f.aY)(null)),s(t),V.remove(x.A9.em_folder))}))}}else le.status!==x.eG&&oe({emailId:e.id,source:o,title:m,project:e.project,preheader:e.preheader,subject:e.subject,utm_parameters:{utm_source:null===(u=e.utm_parameters)||void 0===u?void 0:u.utm_source,utm_medium:null===(p=e.utm_parameters)||void 0===p?void 0:p.utm_medium,utm_campaign:null===(g=e.utm_parameters)||void 0===g?void 0:g.utm_campaign,utm_term:null===(b=e.utm_parameters)||void 0===b?void 0:b.utm_term,utm_content:null===(h=e.utm_parameters)||void 0===h?void 0:h.utm_content},description:e.description,html:(null===G||void 0===G?void 0:G.getValue())||"",common_styles:e.common_styles||"",emailtags:l||e.emailtags,tags:c,group:a||e.group,is_template:e.is_template||!1}).then((({error:t})=>{t?(me&&W.fromError("EMAIL_EDITING_ERROR",(0,n.Gy)(e),t),de(!1)):s(e)}));be({event:"save",action:o?"save_email":"auto_save_email",email_id:e.id,project_id:D})},s={...e};ge.fire(s).finally((()=>{r.length||d.length?Promise.all(r).then((e=>{Promise.all(d).then((t=>{m(s,e,t,[])}))})):m(s,null,null,[])}))};de(!0),ue?i(ue.id):ee({name:ce}).then((async({data:t,error:o})=>{if(o)W.fromError("FOLDER_CREATING_ERROR",ce,o),de(!1);else{const{data:o,error:l}=await re({projectId:D,emailtags:t.id});l?(W.fromError("EMAIL_CLONING_ERROR",(0,n.Gy)(e),l),de(!1)):o&&i(o.emailtags&&o.emailtags[0])}})).catch((e=>{}))}),[ie.status,ae,le.status,oe,e,t,ee,C,re,D,K,O,F,me,G,pe,ge]);(0,k.D3)(P.Kp,(0,l.useCallback)((e=>Ee(e||"EXTERNAL")),[Ee]));const he=(0,B.ml)(R.AZ.ON_NEXTBUTTON_CLICK_ID),fe=(0,B.ml)(R.AZ.ON_SAVEBUTTON_CLICK_ID);(0,l.useEffect)((()=>{me&&(setTimeout((()=>Ee(me))),se(""))}),[me]);const ve=(0,l.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),se(N))}),[Ee]);(0,l.useEffect)((()=>(document.addEventListener("keydown",ve),()=>{document.removeEventListener("keydown",ve)})),[ve]);const Ae=(0,l.useCallback)((e=>{const t=e.data.operation,o=e.data.action;t===x.Ru.APPLICATION_ACTION&&"save_email"===o&&se(N)}),[Ee]);(0,h.A)(Ae),(0,l.useEffect)((()=>{e.isNew&&ie.isSuccess&&(de(!0),C(g.GY.util.upsertQueryData("getEmail",ie.data.id,{...ie.data,lock:e.lock,isAmp:e.isAmp,subject:e.subject,preheader:e.preheader,description:e.description,html:(null===G||void 0===G?void 0:G.getValue())||"",project:e.project,tags:e.tags,utm_parameters:e.utm_parameters,parent_email:e.parent_email,common_styles:e.common_styles,renderGuid:e.renderGuid,is_inited:e.is_inited,isNew:!1})).then((()=>{L(`/projects/${ie.data.project}/emails/${ie.data.id}`),de(!1),me&&W.success({id:"EMAIL_SAVING_SUCCESS",message:O("The email was successfully saved."),data:(0,n.Gy)(e)})})))}),[L,C,ie,e.isNew,O,F,me,G]);const _e=(0,B._q)(R.AZ.ON_EMAIL_INIT_ID);(0,l.useEffect)((()=>{let e=0;const t=_e((()=>{e=setTimeout((()=>q(!0)),1e4)}));return()=>{e&&clearTimeout(e),t.dispose()}}),[q,_e]),(0,l.useEffect)((()=>{e.isNew&&!M&&X&&(Ee(),q(!1))}),[X,e,Ee,M]);const ye=le.isLoading||(null===re||void 0===re?void 0:re.isLoading)||ie.isLoading||ne||o&&o.isLoading,Se=z.saveButtonEnabled&&l.createElement(a.A,{key:"save-button",title:O($?"Save by \u2318S":"Save by Ctrl+S"),placement:"bottom"},l.createElement(i.Ay,{disabled:c,type:z.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:ye,icon:l.createElement(d.A,null),onClick:async()=>{const t={...e,html:G.getValue()};try{!1!==await fe.fire(t)&&se("SAVE_BUTTON")}catch(o){W.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),o,!0)}}},z.saveButtonText||O("Save"))),[ke,Be]=(0,l.useState)(!1),we=(0,l.useRef)(!1),xe=z.nextButtonEnabled&&l.createElement(i.Ay,{disabled:c||ke,key:"next-button",type:"primary",block:"false",className:"em-analytics__email-save",icon:z.primaryCommandButtonIcon,loading:ye,onClick:async()=>{if(we.current)return;we.current=!0;const t={...e,html:G.getValue()};try{Be(!0),!1!==await he.fire(t)?se("NEXT_BUTTON"):(Be(!1),we.current=!1)}catch(o){W.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),o,!0),Be(!1),we.current=!1}}},z.nextButtonText||O("Continue"));return l.createElement(l.Fragment,null,z.saveButtonEnabled&&z.nextButtonEnabled?l.createElement(r.A,null,[Se,xe]):[Se,xe])};C.defaultProps={email:null,isEditableRights:null};const L=C},11399:(e,t,o)=>{o.d(t,{A:()=>E});var l=o(98173),a=o(27499),i=o(50483),r=o(49856),n=o(13785),d=o(60994),m=o(2922),s=o(81149),c=o(12543),u=o(32947),p=o(8807),g=o(52919);const b=({form:e,elementSettings:t,imgParent:o,name:b="align",setAlignStateHandle:E=e=>{},withHotKeys:h=!0})=>{const{__:f}=(0,c.s9)(),v=(0,g.XW)(),[A,_]=(0,l.useState)(t[b]),[y,S]=(0,l.useState)(null);(0,l.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&S(!0)}),[]);const k=o=>{const l=o.target.value;E(l);const a={[b]:""};l!==A?_(l):(_(""),e.setFieldsValue(a),v({operation:u.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return l.createElement(a.A.Item,{name:b},l.createElement(i.Ay.Group,{disabled:o&&!t.parent},l.createElement(r.A,{size:8},l.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align left ( \u2318+Shift+L )":"Text align left ( Ctrl+Shift+L )":"Text align left")},l.createElement(i.Ay.Button,{value:"left",onClick:k},l.createElement(d.A,null))),l.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align center ( \u2318+Shift+E )":"Text align center ( Ctrl+Shift+E )":"Text align center")},l.createElement(i.Ay.Button,{value:"center",onClick:k},l.createElement(m.A,null))),l.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align right ( \u2318+Shift+R )":"Text align right ( Ctrl+Shift+R )":"Text align right")},l.createElement(i.Ay.Button,{value:"right",onClick:k},l.createElement(s.A,null))),l.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align justify ( \u2318+Shift+J )":"Text align justify ( Ctrl+Shift+J )":"Text align justify")},l.createElement(i.Ay.Button,{value:"justify",onClick:k},l.createElement(p.A,{icon:"Justify"}))))))};b.defaultProps={imgParent:!1};const E=b},23863:(e,t,o)=>{o.d(t,{A:()=>R});var l=o(98173),a=o(40120),i=o(201),r=o(66964),n=o(27499),d=o(42490),m=o(50483),s=o(49856),c=o(13785),u=o(80320),p=o(17216),g=o(82984),b=o(85372),E=o(8239),h=o(91916),f=o(48947),v=o(51157),A=o(42734),_=o(26298),y=o.n(_),S=o(12543),k=o(2604),B=o(77637),w=o(1047);const{useToken:x}=a.A,R=({borders:e,namePrefix:t="",typeOfForm:o="desktop"})=>{const a=(0,k.d4)(w.uJ),{__:_,_x:R}=(0,S.s9)(),P="mobile"===o,N=P?"mobileBorderColor":"borderColor",T=P?"mobileBorderWidth":"borderWidth",I=P?"mobileBorderStyle":"borderStyle",C=P?"mobileBorderPosition":"borderPosition",L=e=>(null===e||void 0===e?void 0:e.width)||(null===e||void 0===e?void 0:e.style)||(null===e||void 0===e?void 0:e.color),{token:O}=x();return l.createElement(i.A,{gutter:30},l.createElement(r.A,{span:12,className:"selected-td-form__border-col"},l.createElement(n.A.Item,{name:t+N,className:"form-item-margin-xs"},l.createElement(B.A,{placeholder:_("Color"),usedColors:a.usedColors})),l.createElement(n.A.Item,{name:t+T,className:"form-item-margin-xs"},l.createElement(d.A,{min:0,placeholder:R("Width","border"),addonAfter:"px"})),l.createElement(n.A.Item,{name:t+I,className:"form-item-margin-xs"},l.createElement(m.Ay.Group,null,l.createElement(s.A,{size:8},l.createElement(c.A,{placement:"bottom",title:_("None")},l.createElement(m.Ay.Button,{value:""},l.createElement(u.A,null))),l.createElement(c.A,{placement:"bottom",title:_("Solid")},l.createElement(m.Ay.Button,{value:"solid"},l.createElement(p.A,null))),l.createElement(c.A,{placement:"bottom",title:_("Dashed")},l.createElement(m.Ay.Button,{value:"dashed"},l.createElement(g.A,null))),l.createElement(c.A,{placement:"bottom",title:_("Dotted")},l.createElement(m.Ay.Button,{value:"dotted"},l.createElement(b.A,null))))))),l.createElement(r.A,{span:12,style:{textAlign:"center"}},l.createElement(n.A.Item,{label:"",name:t+C,labelCol:{span:8}},l.createElement(m.Ay.Group,null,l.createElement(s.A,{size:O.formItemMarginBottomXS,direction:"vertical"},l.createElement(i.A,null,l.createElement(c.A,{placement:"top",title:_("Above")},l.createElement(m.Ay.Button,{value:"top",style:{margin:"auto"},className:y()("",{"selected-td-form__border-radio":L(null===e||void 0===e?void 0:e.top)})},l.createElement(E.A,null)))),l.createElement(i.A,null,l.createElement(s.A,{size:O.formItemMarginBottomXS},l.createElement(c.A,{placement:"left",title:_("On the left")},l.createElement(m.Ay.Button,{value:"left",className:y()("",{"selected-td-form__border-radio":L(null===e||void 0===e?void 0:e.left)})},l.createElement(h.A,null))),l.createElement(c.A,{placement:"top",title:_("Around")},l.createElement(m.Ay.Button,{value:"all",className:y()("",{"selected-td-form__border-radio":L(null===e||void 0===e?void 0:e.all)})},l.createElement(f.A,null))),l.createElement(c.A,{placement:"right",title:_("On the right")},l.createElement(m.Ay.Button,{value:"right",className:y()("",{"selected-td-form__border-radio":L(null===e||void 0===e?void 0:e.right)})},l.createElement(v.A,null))))),l.createElement(i.A,null,l.createElement(c.A,{placement:"bottom",title:_("Below")},l.createElement(m.Ay.Button,{value:"bottom",className:y()("",{"selected-td-form__border-radio":L(null===e||void 0===e?void 0:e.bottom)}),style:{margin:"auto"}},l.createElement(A.A,null)))))))))}},67151:(e,t,o)=>{o.d(t,{A:()=>_});var l=o(98173),a=o(201),i=o(66964),r=o(49856),n=o(27499),d=o(37969),m=o(13785),s=o(78469),c=o(31573),u=o(39672),p=o(70552),g=o(26298),b=o.n(g),E=o(12543),h=o(88647),f=o(80877),v=o(52919),A=o(32947);const _=({form:e,oneBorderRadiusValue:t,setOneBorderRadiusValue:o,elementSettings:g,namePrefix:_="",typeOfForm:y="desktop"})=>{const{__:S}=(0,E.s9)(),k=(0,v.XW)(),B="mobile"===y,w=B?"mobileBorderRadius":"borderRadius",x=B?"mobileBorderRadiusAll":"borderRadiusAll",R=B?"mobileBorderRadiusTopLeft":"borderRadiusTopLeft",P=B?"mobileBorderRadiusTopRight":"borderRadiusTopRight",N=B?"mobileBorderRadiusBottomRight":"borderRadiusBottomRight",T=B?"mobileBorderRadiusBottomLeft":"borderRadiusBottomLeft";return l.createElement(a.A,{gutter:10},l.createElement(i.A,{span:12},l.createElement(r.A,{size:10,align:"start"},l.createElement(n.A.Item,{name:_+[x]},l.createElement(f.A,{min:0,placeholder:S("Border radius"),prefix:l.createElement(h.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),l.createElement(i.A,{span:12},l.createElement(d.Ay,{className:b()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const l=e.getFieldsValue(!0);let a;if(t)e.setFieldsValue({[R]:l[x]||null,[T]:l[x]||null,[P]:l[x]||null,[N]:l[x]||null}),a={[w]:{[A.wF[R]]:l[x]||0,[A.wF[T]]:l[x]||0,[A.wF[P]]:l[x]||0,[A.wF[N]]:l[x]||0}};else{const t=l[R]===l[T]&&l[R]===l[P]&&l[R]===l[N];t?(e.setFieldsValue({[x]:t?l[R]:null}),a={[w]:{[A.wF[x]]:l[R]}}):(e.setFieldsValue({[x]:null,[R]:null,[T]:null,[P]:null,[N]:null}),a={[w]:{[A.wF[x]]:0,[A.wF[R]]:0,[A.wF[T]]:0,[A.wF[P]]:0,[A.wF[N]]:0}})}k({operation:A.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:g.type,settings:{[w]:{...g[w],...a[w]}}}),o((e=>!e))}},l.createElement(h.h,{className:"selected-td-form__icon-radius"}))),l.createElement(i.A,null,l.createElement(a.A,{gutter:10,style:{marginTop:-10}},l.createElement(i.A,{span:12},l.createElement(m.A,{placement:"bottom",title:S("Top left corner")},l.createElement(n.A.Item,{hidden:t,name:_+[R],className:"form-item-margin-xs"},l.createElement(f.A,{min:0,prefix:l.createElement(s.A,null),style:{minHeight:10},addonAfter:"px"}))),l.createElement(m.A,{placement:"bottom",title:S("Bottom left corner")},l.createElement(n.A.Item,{hidden:t,name:_+[T]},l.createElement(f.A,{min:0,prefix:l.createElement(c.A,null),style:{minHeight:10},addonAfter:"px"})))),l.createElement(i.A,{span:12},l.createElement(m.A,{placement:"bottom",title:S("Top right corner")},l.createElement(n.A.Item,{hidden:t,name:_+[P],className:"form-item-margin-xs"},l.createElement(f.A,{min:0,prefix:l.createElement(u.A,null),style:{minHeight:10},addonAfter:"px"}))),l.createElement(m.A,{placement:"bottom",title:S("Bottom right corner")},l.createElement(n.A.Item,{hidden:t,name:_+[N]},l.createElement(f.A,{min:0,prefix:l.createElement(p.A,null),style:{minHeight:10},addonAfter:"px"})))))))}},37133:(e,t,o)=>{o.d(t,{A:()=>u});var l=o(98173),a=o(27499),i=o(50483),r=o(49856),n=o(13785),d=o(12543),m=o(8807),s=o(32947),c=o(52919);const u=({form:e,elementSettings:t,tooltipTitle:o,disabled:u=!1})=>{const{__:p}=(0,d.s9)(),g=(0,c.XW)(),[b,E]=(0,l.useState)(t.valign),h=o=>{const l=o.target.value,a={valign:""};l!==b?E(l):(E(""),e.setFieldsValue(a),g({operation:s.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return l.createElement(a.A.Item,{name:"valign"},l.createElement(i.Ay.Group,{disabled:u},l.createElement(r.A,{size:8},l.createElement(n.A,{placement:"bottom",title:p("Align top")},l.createElement(i.Ay.Button,{value:"top",onClick:h},l.createElement(m.A,{icon:"AlignVerticalTop"}))),l.createElement(n.A,{placement:"bottom",title:p("Center vertically")},l.createElement(i.Ay.Button,{value:"middle",onClick:h},l.createElement(m.A,{icon:"AlignVerticalCenter"}))),l.createElement(n.A,{placement:"bottom",title:p("Align bottom")},l.createElement(i.Ay.Button,{value:"bottom",onClick:h},l.createElement(m.A,{icon:"AlignVerticalBottom"}))))))}},24075:(e,t,o)=>{o.d(t,{A:()=>d});var l=o(98173),a=o(26298),i=o.n(a),r=o(26327);o(47827);const n=({className:e,selectedElement:t,formSettings:o,emailElementType:a})=>l.createElement("div",{className:i()("selected-element-panel",{[e]:e}),style:{height:"100%"}},l.createElement(r.A,{className:i()("selected-element-panel__content SelectedElementPanel",{"column-settings-show":!!t.floatBlocks&&t.floatBlocks.items.length>1}),emailElementType:a,formSettings:o}));n.defaultProps={className:null,selectedElement:{parent:!1}};const d=n},26327:(e,t,o)=>{o.d(t,{A:()=>uo});var l=o(98173),a=o(84893),i=o(26298),r=o.n(i),n=o(2604),d=o(1047),m=o(22536),s=o(30150),c=o(40120),u=o(27499),p=o(13785),g=o(38976),b=o(201),E=o(66964),h=o(94674),f=o(37969),v=o(73114),A=o(49856),_=o(8218),y=o(48300),S=o(5795),k=o(54855),B=o(74984),w=o(72218),x=o(8122),R=o(86956),P=o.n(R),N=o(55207),T=o(23863),I=o(67151),C=o(50483),L=o(12543),O=o(8807),F=o(32947),D=o(52919);const M=({form:e,elementSettings:t,imgParent:o,name:a="align"})=>{const{__:i}=(0,L.s9)(),r=(0,D.XW)(),[n,d]=(0,l.useState)(t[a]),m=o=>{const l=o.target.value,i={[a]:""};l!==n?d(l):(d(""),e.setFieldsValue(i),r({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return l.createElement(u.A.Item,{name:a},l.createElement(C.Ay.Group,{disabled:o&&!t.parent},l.createElement(A.A,{size:8},l.createElement(p.A,{placement:"bottom",title:i("Align left")},l.createElement(C.Ay.Button,{value:"left",onClick:m},l.createElement(O.A,{icon:"AlignHorizontalLeft"}))),l.createElement(p.A,{placement:"bottom",title:i("Center horizontally")},l.createElement(C.Ay.Button,{value:"center",onClick:m},l.createElement(O.A,{icon:"AlignHorizontalCenter"}))),l.createElement(p.A,{placement:"bottom",title:i("Align right ")},l.createElement(C.Ay.Button,{value:"right",onClick:m},l.createElement(O.A,{icon:"AlignHorizontalRight"}))))))};M.defaultProps={imgParent:!1};const V=M;var W=o(37133),z=o(62913),G=o(33365),j=o(80877),H=o(77637);const U=({typeOfForm:e="desktop"})=>{const{__:t}=(0,L.s9)(),o=(0,n.d4)(d.uJ),a="mobile"===e,i=a?"mobileBoxShadowHOffset":"boxShadowHOffset",r=a?"mobileBoxShadowVOffset":"boxShadowVOffset",m=a?"mobileBoxShadowBlurRadius":"boxShadowBlurRadius",s=a?"mobileBoxShadowSpreadRadius":"boxShadowSpreadRadius",c=a?"mobileBoxShadowColor":"boxShadowColor",g=a?"mobileBoxShadowInset":"boxShadowInset";return l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:t("Horizontal offset")},l.createElement(u.A.Item,{name:i,className:"form-item-margin-xs"},l.createElement(j.A,{placeholder:t("Horizontal offset"),prefix:l.createElement(G.A,null),addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:t("Vertical offset")},l.createElement(u.A.Item,{name:r,className:"form-item-margin-xs"},l.createElement(j.A,{placeholder:t("Vertical offset"),prefix:l.createElement(O.A,{icon:"VerticalOffset"}),addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:t("Blur radius")},l.createElement(u.A.Item,{name:m,className:"form-item-margin-xs"},l.createElement(j.A,{min:0,placeholder:t("Blur radius"),prefix:l.createElement(O.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:t("Spread radius")},l.createElement(u.A.Item,{name:s,className:"form-item-margin-xs"},l.createElement(j.A,{placeholder:t("Spread radius"),prefix:l.createElement(O.A,{icon:"ZoomOutMap"}),addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(A.A,{size:10,align:"start"},l.createElement(u.A.Item,{name:c},l.createElement(H.A,{usedColors:o.usedColors})))),l.createElement(E.A,{span:12},l.createElement(p.A,{title:t("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},l.createElement(u.A.Item,{name:g,valuePropName:"value"},l.createElement(z.A,{style:{width:"100%"},options:[{label:t("Outside"),value:!1},{label:t("Inside"),value:!0}]}))))))};var X=o(49823),q=o(29123);const{Option:$}=X.A,Y=l.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},l.createElement($,{value:"px"},"px"),l.createElement($,{value:"%"},"%")),{useToken:K}=c.A,Q=({form:e,name:t,elementSettings:o,isPicture:a})=>{var i;const{__:r}=(0,L.s9)(),n=(0,D.XW)(),d=(0,l.useRef)(),m=(0,l.useRef)(),[s,c]=(0,l.useState)("auto"===(null===(i=o[t])||void 0===i?void 0:i.value)),{token:p}=K(),[g,b]=(0,l.useState)("");return l.createElement(l.Fragment,null,l.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},l.createElement(j.A,{ref:d,min:0,max:g,placeholder:r("Width"),onChange:o=>{c(!1),b("%"===e.getFieldsValue(!0)[t+"Dim"]?100:"")},prefix:l.createElement(S.A,null),addonAfter:l.createElement(u.A.Item,{name:t+"Dim",noStyle:!0},Y)})),!a&&l.createElement(A.A,{size:8,align:"end"},l.createElement(q.A,{ref:m,size:"small",checked:s,onChange:l=>{d.current.value=null,e.setFieldsValue({[t]:"",[t+"Dim"]:"px"}),c((e=>!e)),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:o.type,settings:{[t]:{classNamePrefix:"em-mob-width-",value:s?null:"auto",dim:""}}})},id:"auto-width"}),l.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"auto-width"},r("Auto")))))},{useToken:J}=c.A,Z=({form:e,name:t,elementSettings:o,isPicture:a})=>{var i;const{__:r}=(0,L.s9)(),n=(0,D.XW)(),d=(0,l.useRef)(),m=(0,l.useRef)(),[s,c]=(0,l.useState)("auto"===(null===(i=o.mobileHeight)||void 0===i?void 0:i.value)),{token:p}=J();return l.createElement(l.Fragment,null,l.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},l.createElement(j.A,{ref:d,min:0,placeholder:r("Height"),onChange:e=>{c(!1)},prefix:l.createElement(k.A,null),addonAfter:"px"})),!a&&l.createElement(A.A,{size:8,align:"end"},l.createElement(q.A,{ref:m,size:"small",checked:s,onChange:t=>{d.current.value=null,e.setFieldsValue({mobileHeight:"",mobileHeightDim:"px"}),c((e=>!e)),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:o.type,settings:{mobileHeight:{classNamePrefix:"em-mob-height-",value:s?null:"auto",dim:""}}})},id:"auto-height"}),l.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"auto-height"},r("Auto")))))};var ee=o(42490),te=o(80320),oe=o(17216),le=o(82984),ae=o(85372),ie=o(8239),re=o(91916),ne=o(48947),de=o(51157),me=o(42734);const{useToken:se}=c.A,ce=({mobileBorders:e})=>{const{__:t}=(0,L.s9)(),o=(0,n.d4)(d.uJ),a=e=>(null===e||void 0===e?void 0:e.width)||(null===e||void 0===e?void 0:e.style)||(null===e||void 0===e?void 0:e.color),{token:i}=se();return l.createElement(b.A,{gutter:30},l.createElement(E.A,{span:12,className:"selected-td-form__border-col"},l.createElement(u.A.Item,{name:"mobileBorderColor",className:"form-item-margin-xs"},l.createElement(H.A,{usedColors:o.usedColors})),l.createElement(u.A.Item,{name:"mobileBorderWidth",className:"form-item-margin-xs"},l.createElement(ee.A,{min:0,placeholder:t("Border width"),addonAfter:"px"})),l.createElement(u.A.Item,{name:"mobileBorderStyle",className:"form-item-margin-xs"},l.createElement(C.Ay.Group,null,l.createElement(A.A,{size:8},l.createElement(p.A,{placement:"bottom",title:t("None")},l.createElement(C.Ay.Button,{value:""},l.createElement(te.A,null))),l.createElement(p.A,{placement:"bottom",title:t("Solid")},l.createElement(C.Ay.Button,{value:"solid"},l.createElement(oe.A,null))),l.createElement(p.A,{placement:"bottom",title:t("Dashed")},l.createElement(C.Ay.Button,{value:"dashed"},l.createElement(le.A,null))),l.createElement(p.A,{placement:"bottom",title:t("Dotted")},l.createElement(C.Ay.Button,{value:"dotted"},l.createElement(ae.A,null))))))),l.createElement(E.A,{span:12,style:{textAlign:"center"}},l.createElement(u.A.Item,{label:"",name:"mobileBorderPosition",labelCol:{span:8}},l.createElement(C.Ay.Group,null,l.createElement(A.A,{size:i.formItemMarginBottomXS,direction:"vertical"},l.createElement(b.A,null,l.createElement(p.A,{placement:"top",title:t("Above")},l.createElement(C.Ay.Button,{value:"top",style:{margin:"auto"},className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.top)})},l.createElement(ie.A,null)))),l.createElement(b.A,null,l.createElement(A.A,{size:i.formItemMarginBottomXS},l.createElement(p.A,{placement:"left",title:t("On the left")},l.createElement(C.Ay.Button,{value:"left",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.left)})},l.createElement(re.A,null))),l.createElement(p.A,{placement:"top",title:t("Around")},l.createElement(C.Ay.Button,{value:"all",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.all)})},l.createElement(ne.A,null))),l.createElement(p.A,{placement:"right",title:t("On the right")},l.createElement(C.Ay.Button,{value:"right",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.right)})},l.createElement(de.A,null))))),l.createElement(b.A,null,l.createElement(p.A,{placement:"bottom",title:t("Below")},l.createElement(C.Ay.Button,{value:"bottom",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.bottom)}),style:{margin:"auto"}},l.createElement(me.A,null)))))))))},ue=({form:e,elementSettings:t,imgParent:o,name:a="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,d]=(0,l.useState)(null===(i=t[a])||void 0===i?void 0:i.value),m=(0,D.XW)(),s=o=>{const l=o.target.value,i={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};l!==n?d(l):(d(""),e.setFieldsValue(i),m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return l.createElement(u.A.Item,{name:a},l.createElement(C.Ay.Group,{disabled:o&&!t.parent},l.createElement(A.A,{size:8},l.createElement(p.A,{placement:"bottom",title:r("Align left")},l.createElement(C.Ay.Button,{value:"left",onClick:s},l.createElement(O.A,{icon:"AlignHorizontalLeft"}))),l.createElement(p.A,{placement:"bottom",title:r("Center horizontally")},l.createElement(C.Ay.Button,{value:"center",onClick:s},l.createElement(O.A,{icon:"AlignHorizontalCenter"}))),l.createElement(p.A,{placement:"bottom",title:r("Align right ")},l.createElement(C.Ay.Button,{value:"right",onClick:s},l.createElement(O.A,{icon:"AlignHorizontalRight"}))),l.createElement(p.A,{placement:"bottom",title:r("Text align justify")},l.createElement(C.Ay.Button,{value:"justify",onClick:s},l.createElement(O.A,{icon:"Justify"}))))))};ue.defaultProps={imgParent:!1};const pe=ue,ge=({form:e,elementSettings:t,tooltipTitle:o})=>{var a;const{__:i}=(0,L.s9)(),[r,n]=(0,l.useState)(null===(a=t.mobileVerticalAlign)||void 0===a?void 0:a.value),d=(0,D.XW)(),m=o=>{const l=o.target.value,a={mobileVerticalAlign:{classNamePrefix:"em-mob-vertical_align",value:""}};l!==r?n(l):(n(""),e.setFieldsValue(a),d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return l.createElement(u.A.Item,{name:"mobileVerticalAlign"},l.createElement(C.Ay.Group,null,l.createElement(A.A,{size:8},l.createElement(p.A,{placement:"bottom",title:i("Align top")},l.createElement(C.Ay.Button,{value:"top",onClick:m},l.createElement(O.A,{icon:"AlignVerticalTop"}))),l.createElement(p.A,{placement:"bottom",title:i("Center vertically")},l.createElement(C.Ay.Button,{value:"middle",onClick:m},l.createElement(O.A,{icon:"AlignVerticalCenter"}))),l.createElement(p.A,{placement:"bottom",title:i("Align bottom")},l.createElement(C.Ay.Button,{value:"bottom",onClick:m},l.createElement(O.A,{icon:"AlignVerticalBottom"}))))))};var be=o(7333),Ee=o(83799);const he=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)();return l.createElement(u.A.Item,{name:"show"},l.createElement(C.Ay.Group,null,l.createElement(A.A,{size:8},l.createElement(C.Ay.Button,{value:"all"},o("Both")),l.createElement(p.A,{placement:"top",title:o("Desktop")},l.createElement(C.Ay.Button,{value:"desktop"},l.createElement(be.A,null))),l.createElement(p.A,{placement:"top",title:o("Mobile")},l.createElement(C.Ay.Button,{value:"mobile"},l.createElement(Ee.A,null))))))};he.defaultProps={};const fe=he;var ve=o(57140),Ae=o(46409),_e=o(67073),ye=o(20721);const{useToken:Se}=c.A,ke=({form:e,elementSettings:t,handleChangeValues:o})=>{const{__:a}=(0,L.s9)(),i=(0,l.useRef)(),{token:n}=Se(),[d,m]=(0,l.useState)(!1),[s,c]=(0,l.useState)(!1),[g,h]=(0,l.useState)(!1),[v,_]=(0,l.useState)(!1),[y,S]=(0,l.useState)(!1);(0,l.useEffect)((()=>{let e=new URL("https://emailmaker.ru/?"+t.countdown);m(e.searchParams.get("font1").endsWith("-b")||e.searchParams.get("font1").endsWith("-bi")),c(e.searchParams.get("font1").endsWith("-i")||e.searchParams.get("font1").endsWith("-bi")),h(e.searchParams.get("font2").endsWith("-b")||e.searchParams.get("font2").endsWith("-bi")),_(e.searchParams.get("font2").endsWith("-i")||e.searchParams.get("font2").endsWith("-bi")),S("true"===e.searchParams.get("tp"))}),[t]);const k=[{value:"-12",label:a("-12:00 Apia")},{value:"-11",label:a("-11:00 Pago Pago, Midway Atoll")},{value:"-10",label:a("-10:00 Honolulu, Anchorage")},{value:"-9",label:a("-9:00 Anchorage, Yukon")},{value:"-8",label:a("-8:00 Los Angeles, Vancouver")},{value:"-7",label:a("-7:00 Denver, Phoenix")},{value:"-6",label:a("-6:00 Mexico City, Guadalajara")},{value:"-5",label:a("-5:00 New York, Toronto, Havana")},{value:"-4",label:a("-4:00 Caracas, Santo Domingo")},{value:"-3",label:a("-3:00 Buenos Aires, Santiago, Montevideo")},{value:"-2",label:a("-2:00 South Georgia, Saint Helena")},{value:"-1",label:a("-1:00 Azores, Cape Verde")},{value:"0",label:a("+0:00 London, Lisbon, Dublin")},{value:"1",label:a("+1:00 Paris, Berlin, Rome")},{value:"2",label:a("+2:00 Athens, Kiev, Istanbul")},{value:"3",label:a("+3:00 Istanbul, Doha, Baghdad")},{value:"4",label:a("+4:00 Baku, Dubai, Tbilisi")},{value:"5",label:a("+5:00 Karachi, Tashkent, Islamabad")},{value:"6",label:a("+6:00 Almaty, Dhaka, Bishkek")},{value:"7",label:a("+7:00 Bangkok, Ho Chi Minh City, Jakarta")},{value:"8",label:a("+8:00 Beijing, Hong Kong, Singapore")},{value:"9",label:a("+9:00 Tokyo, Seoul, Jayapura")},{value:"10",label:a("+10:00 Sydney, Melbourne, Port Moresby")},{value:"11",label:a("+11:00 Honiara, Nuku'alofa, Apia")}],B=[{value:"20",label:a("20 s")},{value:"40",label:a("40 s")},{value:"60",label:a("60 s")}],w=[{value:"arial",label:"Arial"},{value:"courier-new",label:"Courier New"},{value:"georgia",label:"Georgia"},{value:"helvetica",label:"Helvetica"},{value:"tahoma",label:"Tahoma"},{value:"times-new-roman",label:"Times New Roman"},{value:"trebuchet-ms",label:"Trebuchet MS"},{value:"verdana",label:"Verdana"},{value:"open-sans",label:"Open Sans"},{value:"roboto",label:"Roboto"}],x=e=>{var t;e.target.closest(".ant-picker-dropdown")||(null===(t=i.current)||void 0===t||t.blur())};(0,l.useEffect)((()=>(window.addEventListener("scroll",x,!0),()=>{window.removeEventListener("scroll",x,!0)})));return l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(u.A.Item,{label:a("End time"),name:"countdownTime"},l.createElement(ve.A,{ref:i,format:"DD.MM.YYYY HH:mm",disabledDate:e=>e&&e<P()().endOf("day")-864e5,showTime:!0,getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),allowClear:!1,allowEmpty:!1}))),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{label:a("Time zone"),name:"countdownTimeZone",style:{width:"100%"}},l.createElement(X.A,{placeholder:a("Select the time zone"),getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},k.map((e=>l.createElement(X.A.Option,{key:e.value,value:e.value},e.label))))))),l.createElement(b.A,{gutter:20},l.createElement(E.A,{span:12},l.createElement(u.A.Item,{label:a("Background color"),name:"countdownBackgroundColor",className:"countdown-color"},l.createElement(H.A,{placeholder:a("Background color"),isDisabled:y,usedColors:t.usedColors}))),l.createElement(E.A,{span:12},l.createElement(A.A,{size:10,align:"baseline",style:{paddingTop:29}},l.createElement(u.A.Item,{name:"countdownTransparency",valuePropName:"checked"},l.createElement(q.A,{size:"small",id:"countdownTransparency",onChange:e=>{S(e)}})),l.createElement("span",{style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"countdownTransparency"},a("Transparency")))))),l.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Countdown font settings")),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"countdownNumbersFont",style:{marginBottom:n.formItemMarginBottomXS}},l.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:w}))),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"countdownNumbersColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},l.createElement(H.A,{usedColors:t.usedColors}))),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"countdownNumbersFontSize"},l.createElement(ee.A,{min:12,placeholder:a("Font size"),prefix:l.createElement(Ae.A,null),addonAfter:"px"}))),l.createElement(E.A,{span:3},l.createElement(p.A,{placement:"bottom",title:a("Strong")},l.createElement(u.A.Item,{name:"countdownNumbersStrong"},l.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":d}),onClick:()=>{const t=!d;e.setFieldValue("countdownNumbersStrong",t),o({countdownNumbersStrong:t}),m(t)}},l.createElement(_e.A,{className:"selected-td-form__icon-radius"}))))),l.createElement(E.A,{span:3},l.createElement(p.A,{placement:"bottom",title:a("Italic")},l.createElement(u.A.Item,{name:"countdownNumbersItalic"},l.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":s}),onClick:()=>{const t=!s;e.setFieldValue("countdownNumbersItalic",t),o({countdownNumbersItalic:t}),c(t)}},l.createElement(ye.A,{className:"selected-td-form__icon-radius"})))))),l.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Time units font settings")),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"countdownLabelsFont",style:{marginBottom:n.formItemMarginBottomXS}},l.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:w}))),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"countdownLabelsColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},l.createElement(H.A,{usedColors:t.usedColors}))),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"countdownLabelsFontSize"},l.createElement(ee.A,{min:8,placeholder:a("Font size"),addonAfter:"px",prefix:l.createElement(Ae.A,null)}))),l.createElement(E.A,{span:3},l.createElement(p.A,{placement:"bottom",title:a("Strong")},l.createElement(u.A.Item,{name:"countdownLabelsStrong"},l.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":g}),onClick:()=>{const t=!g;e.setFieldValue("countdownLabelsStrong",t),o({countdownLabelsStrong:t}),h(t)}},l.createElement(_e.A,{className:"selected-td-form__icon-radius"}))))),l.createElement(E.A,{span:3},l.createElement(p.A,{placement:"bottom",title:a("Italic")},l.createElement(u.A.Item,{name:"countdownLabelsItalic"},l.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":v}),onClick:()=>{const t=!v;e.setFieldValue("countdownLabelsItalic",t),o({countdownLabelsItalic:t}),_(t)}},l.createElement(ye.A,{className:"selected-td-form__icon-radius"})))))),l.createElement(b.A,{gutter:10,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(u.A.Item,{label:a("Language"),name:"countdownLanguage",style:{width:"100%"}},l.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:[{value:"ru_RU",label:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"},{value:"en_US",label:"English"},{value:"uk_UA",label:"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"},{value:"pt_BR",label:"Portugu\xeas"},{value:"fr-CA",label:"Fran\xe7ais"},{value:"de_DE",label:"Deutsch"},{value:"pl_PL",label:"Polski"},{value:"es_ES",label:"Espa\xf1ol"},{value:"tr_TR",label:"T\xfcrk\xe7e"},{value:"lt_LT",label:"Lietuvi\u0173 kalba"},{value:"lv_LV",label:"Latvie\u0161u valoda"},{value:"et_EE",label:"Eesti keel"},{value:"hu_HU",label:"Magyar"},{value:"el_GR",label:"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"},{value:"it_IT",label:"Italiano"}]}))),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{label:a("Duration"),name:"countdownDuration",style:{width:"100%"}},l.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:B})))))};var Be=o(9593),we=o(30245),xe=o(29312),Re=o(53056);const{useToken:Pe}=c.A,Ne=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)(),{token:a}=Pe();return l.createElement(l.Fragment,null,l.createElement(p.A,{trigger:["hover"],title:o("URL of the video clip."),placement:"right"},l.createElement(u.A.Item,{name:["video","source"],className:"selected-image-form__alt"},l.createElement(_.A,{allowClear:!0,placeholder:o("Video URL"),prefix:l.createElement(Be.A,null)}))),l.createElement(u.A.Item,{label:o("Play button"),name:["video","playButton"],style:{width:"100%",marginBottom:a.formItemMarginBottomMD+4}},l.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},l.createElement(X.A.Option,{value:"youtube_red"},l.createElement(we.A,{style:{color:"#FF0000"}})," ",o("Youtube Red")),l.createElement(X.A.Option,{value:"youtube_black"},l.createElement(we.A,null)," ",o("Youtube Black")),l.createElement(X.A.Option,{value:"youtube_white"},l.createElement(we.A,{style:{color:"#aaa"}})," ",o("Youtube White")),l.createElement(X.A.Option,{value:"vimeo"},l.createElement(O.A,{icon:"Vimeo"})," ",o("Vimeo")),l.createElement(X.A.Option,{value:"white_circle"},l.createElement(xe.A,{style:{color:"#aaa"}})," ",o("White circle")),l.createElement(X.A.Option,{value:"black_circle"},l.createElement(xe.A,null)," ",o("Black circle")),l.createElement(X.A.Option,{value:"white_circle_outlined"},l.createElement(Re.A,{style:{color:"#aaa"}})," ",o("White circle outlined")),l.createElement(X.A.Option,{value:"black_circle_outlined"},l.createElement(Re.A,null)," ",o("Black circle outlined")),l.createElement(X.A.Option,{value:"none"}," ",o("Without button")))))},Te=()=>{const{__:e}=(0,L.s9)();return l.createElement(u.A.Item,{name:"ampShow"},l.createElement(C.Ay.Group,null,l.createElement(A.A,{size:8},l.createElement(C.Ay.Button,{value:"all"},e("Both")),l.createElement(p.A,{placement:"top",title:e("AMP")},l.createElement(C.Ay.Button,{value:"amp"},"AMP")),l.createElement(p.A,{placement:"top",title:e("HTML")},l.createElement(C.Ay.Button,{value:"html"},"HTML")))))};Te.defaultProps={};const Ie=Te;var Ce=o(62093),Le=o(40835),Oe=o(23424),Fe=o(54838),De=o(47014),Me=o(80772),Ve=o(27941),We=o(64909),ze=o(40277),Ge=o(99512),je=o(16390);o(47827);const{useToken:He}=c.A,Ue=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:o}=He(),[a]=u.A.useForm();let i=(0,n.wA)();const c=(0,Ve.rD)(),{projectId:R}=(0,s.g)(),C=(0,We.hN)(),M=(0,n.d4)(d.Hs),z=(0,D.XW)(),G=(0,D.K9)(),H=(0,n.d4)(Fe.Ct),X=(0,n.d4)(Fe.CS),q=(0,n.d4)(De.C1),$=(0,n.d4)(Fe.Fv),Y=(0,n.d4)(Fe.yy),[K]=(0,Le.dS)(),[J,ee]=(0,Le.tb)(),te=(0,l.useRef)(null),oe=(0,l.useRef)(null),le=(0,l.useRef)(null),ae=(0,l.useRef)(null),ie=(0,l.useRef)(null),re=(0,l.useRef)(null),ne=(0,l.useRef)(null),de=(0,l.useRef)(null),me=(0,l.useRef)(null),[se,ue]=(0,l.useState)({}),[be,Ee]=(0,l.useState)({}),[he,ve]=(0,l.useState)({}),[Ae,_e]=(0,l.useState)(!0),[ye,Se]=(0,l.useState)(!0),[Be,we]=(0,l.useState)(""),[xe,Re]=(0,l.useState)(""),[Pe,Te]=(0,l.useState)(""),[Ue,Xe]=(0,l.useState)(!1),[qe,$e]=(0,l.useState)(!1),[Ye,Ke]=(0,l.useState)(!1),[Qe,Je]=(0,l.useState)(!1),[Ze,et]=(0,l.useState)(!1),[tt,ot]=(0,l.useState)(!1),[lt,at]=(0,l.useState)(!1),[it,rt]=(0,l.useState)(!1),[nt,dt]=(0,l.useState)("https://"),[mt,st]=(0,l.useState)(),[ct,ut]=(0,l.useState)(!1),[pt,gt]=(0,l.useState)(null),[bt,Et]=(0,l.useState)({start:0,end:0}),[ht,ft]=(0,l.useState)(!1),[vt,At]=(0,l.useState)(!1),_t=$&&"bottom"!==Y,yt=M.hasOwnProperty("type")?F.IE:F.Tm;(0,l.useEffect)((()=>{ct&&me.current&&me.current.focus()}),[ct]);const St=(0,n.d4)(je.GH);(0,l.useEffect)((()=>{var e;null!==St&&void 0!==St&&null!==(e=St.items)&&void 0!==e&&e.length&&st((0,Ve.cM)(St.items,t,((e,t)=>{ut(!1),G(F.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[St,st,t,ut,G]);(0,l.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||gt(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||ut(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);const kt=({target:e})=>{if(e&&!ht){const{selectionStart:t,selectionEnd:o}=e;Et({start:t,end:o})}ft(!1)};(0,l.useEffect)((()=>{if(e){var t,o,l,i,r,n,d,m,s,c,u,p,g,b,E,h,f,v,A,_,y,S,k,B,w,x,R,N,T,I,C,L,O,F,D,M,V,W,z,G,j,H,U,X,q,$,Y,K,Q,J,Z,ee,te,oe,le,ae,ie,re,ne,de,me,se,ce,pe,ge,be,he,fe,Ae,ye,ke,Be,xe,Pe,Ne;const Ie=e.border,Ce=e.mobileBorder,Le=e.boxShadow;ue(Ie),Ee(Ce),ve(Le);const Oe=Object.keys(Ie).find((e=>{var t,o,l;return(null===(t=Ie[e])||void 0===t?void 0:t.width)||(null===(o=Ie[e])||void 0===o?void 0:o.style)||(null===(l=Ie[e])||void 0===l?void 0:l.color)})),Fe=Object.keys(Ce).find((e=>{var t,o,l;return(null===(t=Ce[e])||void 0===t?void 0:t.width)||(null===(o=Ce[e])||void 0===o?void 0:o.style)||(null===(l=Ce[e])||void 0===l?void 0:l.color)}));if(e.link&&dt((0,Ge.TW)(e.link,"https://")),a.setFieldsValue({...e,link:e.link?e.link:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(l=e.height)||void 0===l?void 0:l.value,heightDim:null===(i=e.height)||void 0===i?void 0:i.dim,borderPosition:Oe||"all",borderWidth:null!==(null===(r=Ie[Oe])||void 0===r?void 0:r.width)?null===(n=Ie[Oe])||void 0===n?void 0:n.width:"",borderColor:(null===(d=Ie[Oe])||void 0===d?void 0:d.color)||"",borderStyle:(null===(m=Ie[Oe])||void 0===m?void 0:m.style)||"",borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(s=e.boxShadow)||void 0===s?void 0:s.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(c=e.boxShadow)||void 0===c?void 0:c.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(u=e.boxShadow)||void 0===u?void 0:u.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(p=e.boxShadow)||void 0===p?void 0:p.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(g=e.boxShadow)||void 0===g?void 0:g.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(b=e.boxShadow)||void 0===b?void 0:b.color),mobileWidth:(0,Ge.xc)(null===(E=e.mobileWidth)||void 0===E?void 0:E.value)||(null===(h=e.width)||void 0===h?void 0:h.value),mobileWidthDim:(0,Ge.xc)(null===(f=e.mobileWidth)||void 0===f?void 0:f.value)?null===(v=e.mobileWidth)||void 0===v?void 0:v.dim:null===(A=e.width)||void 0===A?void 0:A.dim,mobileHeight:(0,Ge.xc)(null===(_=e.mobileHeight)||void 0===_?void 0:_.value)||(null===(y=e.height)||void 0===y?void 0:y.value),mobileHeightDim:(0,Ge.xc)(null===(S=e.mobileHeight)||void 0===S?void 0:S.value)?null===(k=e.mobileHeight)||void 0===k?void 0:k.dim:null===(B=e.height)||void 0===B?void 0:B.dim,mobileBorderPosition:Fe||Oe||"all",mobileBorderWidth:(null===(w=Ce[Fe])||void 0===w?void 0:w.width)||(null===(x=Ie[Oe])||void 0===x?void 0:x.width)||"",mobileBorderColor:(null===(R=Ce[Fe])||void 0===R?void 0:R.color)||(null===(N=Ie[Oe])||void 0===N?void 0:N.color)||"",mobileBorderStyle:(null===(T=Ce[Fe])||void 0===T?void 0:T.style)||(null===(I=Ie[Oe])||void 0===I?void 0:I.style)||"",mobileBorderRadiusAll:(0,Ge.ok)(e.mobileBorderRadius.all)||(0,Ge.ok)(e.borderRadius.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null===(C=e.mobileBorderRadius)||void 0===C?void 0:C.topLeft)||(0,Ge.ok)(null===(L=e.mobileBorderRadius)||void 0===L?void 0:L.all)||(0,Ge.ok)(null===(O=e.borderRadius)||void 0===O?void 0:O.topLeft)||(0,Ge.ok)(null===(F=e.borderRadius)||void 0===F?void 0:F.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null===(D=e.mobileBorderRadius)||void 0===D?void 0:D.bottomLeft)||(0,Ge.ok)(null===(M=e.mobileBorderRadius)||void 0===M?void 0:M.all)||(0,Ge.ok)(null===(V=e.borderRadius)||void 0===V?void 0:V.bottomLeft)||(0,Ge.ok)(null===(W=e.borderRadius)||void 0===W?void 0:W.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null===(z=e.mobileBorderRadius)||void 0===z?void 0:z.topRight)||(0,Ge.ok)(null===(G=e.mobileBorderRadius)||void 0===G?void 0:G.all)||(0,Ge.ok)(null===(j=e.borderRadius)||void 0===j?void 0:j.topRight)||(0,Ge.ok)(null===(H=e.borderRadius)||void 0===H?void 0:H.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null===(U=e.mobileBorderRadius)||void 0===U?void 0:U.bottomRight)||(0,Ge.ok)(null===(X=e.mobileBorderRadius)||void 0===X?void 0:X.all)||(0,Ge.ok)(null===(q=e.borderRadius)||void 0===q?void 0:q.bottomRight)||(0,Ge.ok)(null===($=e.borderRadius)||void 0===$?void 0:$.all),mobileBoxShadowInset:null!=(null===(Y=e.mobileBoxShadow)||void 0===Y?void 0:Y.inset)?e.mobileBoxShadow.inset:(null===(K=e.boxShadow)||void 0===K?void 0:K.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(Q=e.mobileBoxShadow)||void 0===Q?void 0:Q.hOffset)||(0,Ge.ok)(null===(J=e.boxShadow)||void 0===J?void 0:J.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(Z=e.mobileBoxShadow)||void 0===Z?void 0:Z.vOffset)||(0,Ge.ok)(null===(ee=e.boxShadow)||void 0===ee?void 0:ee.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(te=e.mobileBoxShadow)||void 0===te?void 0:te.blurRadius)||(0,Ge.ok)(null===(oe=e.boxShadow)||void 0===oe?void 0:oe.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(le=e.mobileBoxShadow)||void 0===le?void 0:le.spreadRadius)||(0,Ge.ok)(null===(ae=e.boxShadow)||void 0===ae?void 0:ae.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)((null===(ie=e.mobileBoxShadow)||void 0===ie?void 0:ie.color)||(null===(re=e.boxShadow)||void 0===re?void 0:re.color)),mobileAlign:(0,Ge.ok)(null===(ne=e.mobileAlign)||void 0===ne?void 0:ne.value)||e.align,mobileVerticalAlign:(0,Ge.ok)((null===(de=e.mobileVerticalAlign)||void 0===de?void 0:de.value)||e.valign),show:e.show?e.show:"all",altSrc:e.src}),e.countdown){let t=new URL("https://emailmaker.ru/?"+e.countdown),o=t.searchParams.get("font1"),l=!1,i=!1;o.endsWith("-b")?(o=o.substring(0,o.length-2),l=!0):o.endsWith("-i")?(o=o.substring(0,o.length-2),i=!0):o.endsWith("-bi")&&(o=o.substring(0,o.length-3),l=!0,i=!0);let r=t.searchParams.get("font2"),n=!1,d=!1;r.endsWith("-b")?(r=r.substring(0,r.length-2),n=!0):r.endsWith("-i")?(r=r.substring(0,r.length-2),d=!0):r.endsWith("-bi")&&(r=r.substring(0,r.length-3),n=!0,d=!0),a.setFieldsValue({countdownTime:P()(new Date(Date.parse(t.searchParams.get("time"))+36e5*t.searchParams.get("timezone")+(new Date).getTimezoneOffset()/60*36e5).toISOString()),countdownDuration:t.searchParams.get("frames")||20,countdownTimeZone:t.searchParams.get("timezone"),countdownLanguage:t.searchParams.get("locale").replace("-","_"),countdownBackgroundColor:"#"+t.searchParams.get("bg"),countdownTransparency:"true"===t.searchParams.get("tp")?"checked":"",countdownNumbersFont:o,countdownNumbersFontSize:t.searchParams.get("size1")/2,countdownNumbersFontSizeDim:"px",countdownNumbersColor:"#"+t.searchParams.get("color1"),countdownLabelsFont:r,countdownLabelsFontSize:t.searchParams.get("size2")/2,countdownLabelsFontSizeDim:"px",countdownLabelsColor:"#"+t.searchParams.get("color2"),countdownNumbersStrong:l,countdownNumbersItalic:i,countdownLabelsStrong:n,countdownLabelsItalic:d})}!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?_e(!1):_e(!0),(0,Ge.ok)(e.mobileBorderRadius.all)||(0,Ge.ok)(null===(me=e.borderRadius)||void 0===me?void 0:me.all)||!((0,Ge.ok)(null===(se=e.borderRadius)||void 0===se?void 0:se.topLeft)||(0,Ge.ok)(null===(ce=e.borderRadius)||void 0===ce?void 0:ce.bottomLeft)||(0,Ge.ok)(null===(pe=e.borderRadius)||void 0===pe?void 0:pe.topRight)||(0,Ge.ok)(null===(ge=e.borderRadius)||void 0===ge?void 0:ge.bottomRight))?Se(!0):Se(!1),Xe(!(null===(be=Ie[Oe])||void 0===be||!be.width)||!(null===(he=Ie[Oe])||void 0===he||!he.style)||!(null===(fe=Ie[Oe])||void 0===fe||!fe.color)),$e(!(null===(Ae=Ce[Fe])||void 0===Ae||!Ae.width)||!(null===(ye=Ce[Fe])||void 0===ye||!ye.style)||!(null===(ke=Ce[Fe])||void 0===ke||!ke.color)||!(null===(Be=Ie[Oe])||void 0===Be||!Be.width)||!(null===(xe=Ie[Oe])||void 0===xe||!xe.style)||!(null===(Pe=Ie[Oe])||void 0===Pe||!Pe.color)),Ke(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),Je(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),et(!!e.boxShadow),ot(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),at(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value||!!e.height.value),we(e.link),Re(e.alt),Te(e.title),At(null===(Ne=e.imgReplacer)||void 0===Ne?void 0:Ne.length)}}),[a,e]);const Bt=async(e,t,o)=>{const l={};l.user_id=q.id,l.folder=e,t&&("image/gif"!==t.type&&(t=await(0,x.A)(t,{maxSizeMB:c.compressMaxSize||.45,maxWidthOrHeight:c.compressMaxWidthOrHeight||2e3})),l.file=t),o&&(l.page_url=o);const a=await K(l);var i,r,n;if(a.error)C.fromError("IMAGE_UPLOAD_ERROR",t,a.error,!0);else if(400!==(null===(i=a.data.data)||void 0===i?void 0:i.status))return null===(r=a.data)||void 0===r||null===(n=r[0])||void 0===n?void 0:n.file_url},wt=((e,t)=>{let o;return function(...l){clearTimeout(o),o=setTimeout((()=>{clearTimeout(o),e(...l)}),t)}})((()=>{const t=a.getFieldsValue(!0);let o=new URL("https://cdt3.emcdn.ru/timer/?"+e.countdown),l=t.countdownNumbersFont;t.countdownNumbersStrong&&t.countdownNumbersItalic?l+="-bi":t.countdownNumbersStrong?l+="-b":t.countdownNumbersItalic&&(l+="-i");let i=t.countdownLabelsFont;t.countdownLabelsStrong&&t.countdownLabelsItalic?i+="-bi":t.countdownLabelsStrong?i+="-b":t.countdownLabelsItalic&&(i+="-i"),o.searchParams.set("time",new Date(t.countdownTime.$d-36e5*t.countdownTimeZone-(new Date).getTimezoneOffset()/60*36e5).toISOString()),o.searchParams.set("bg",t.countdownBackgroundColor.substring(1)||"#FFFFFF"),o.searchParams.set("tp",!!t.countdownTransparency),o.searchParams.set("font1",l),o.searchParams.set("size1",2*t.countdownNumbersFontSize||12),o.searchParams.set("color1",t.countdownNumbersColor.substring(1)||"#000000"),o.searchParams.set("font2",i),o.searchParams.set("size2",2*t.countdownLabelsFontSize||8),o.searchParams.set("color2",t.countdownLabelsColor.substring(1)||"#959595"),o.searchParams.set("spacing",Math.round(.4*t.countdownNumbersFontSize)||5),o.searchParams.set("locale",t.countdownLanguage.replace("_","-")),o.searchParams.set("timezone",t.countdownTimeZone),o.searchParams.set("frames",t.countdownDuration),J({link:JSON.stringify({target:o.href})}),rt(!0)}),500),xt=(0,l.useCallback)((e=>{i(yt===F.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[i,yt]),Rt=(t,...o)=>{const l=a.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(r){case"link":let e=t[r];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),a.setFieldValue("link",e)),n={link:e};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:l.boxShadowHOffset,vOffset:l.boxShadowVOffset,blurRadius:l.boxShadowBlurRadius,spreadRadius:l.boxShadowSpreadRadius,color:l.boxShadowColor,inset:l.boxShadowInset}};break;case"borderStyle":n={border:{[l.borderPosition]:{...se[l.borderPosition],style:t[r]}}},"all"===l.borderPosition?ue((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],style:t[r]}}))):ue((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],style:t[r]}})));break;case"borderColor":n={border:{[l.borderPosition]:{...se[l.borderPosition],color:t[r]}}},"all"===l.borderPosition?ue((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],color:t[r]}}))):ue((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],color:t[r]}})));break;case"borderWidth":n={border:{[l.borderPosition]:{...se[l.borderPosition],width:t[r]}}},"all"===l.borderPosition?ue((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],width:t[r]}}))):ue((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],width:t[r]}})));break;case"borderPosition":a.setFieldsValue({borderWidth:se[t[r]].width||"",borderColor:se[t[r]].color||"",borderStyle:se[t[r]].style||""});break;case"width":n={[r]:{value:t[r],dim:l.widthDim}};break;case"widthDim":n={width:{value:l.width,dim:t[r]}};break;case"height":n={[r]:{value:t[r],dim:l.heightDim}};break;case"heightDim":n={height:{value:l.height,dim:t[r]}};break;case"borderRadiusAll":n={borderRadius:{[F.wF[r]]:+t[r]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{topLeft:l.borderRadiusTopLeft,bottomLeft:l.borderRadiusBottomLeft,topRight:l.borderRadiusTopRight,bottomRight:l.borderRadiusBottomRight,[F.wF[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:l.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth,dim:t[r]}};break;case"mobileHeight":n={[r]:{classNamePrefix:"em-mob-height-",value:t[r],dim:l.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[r]}};break;case"mobileBorderStyle":n={mobileBorder:{[l.mobileBorderPosition]:{...be[l.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?Ee((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):Ee((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":n={mobileBorder:{[l.mobileBorderPosition]:{...be[l.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?Ee((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):Ee((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":n={mobileBorder:{[l.mobileBorderPosition]:{...be[l.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?Ee((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):Ee((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":a.setFieldsValue({mobileBorderWidth:be[t[r]].width||"",mobileBorderColor:be[t[r]].color||"",mobileBorderStyle:be[t[r]].style||""});break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[Ge.NW[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+Ge.NW[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:l.mobileBoxShadowHOffset,vOffset:l.mobileBoxShadowVOffset,blurRadius:l.mobileBoxShadowBlurRadius,spreadRadius:l.mobileBoxShadowSpreadRadius,color:l.mobileBoxShadowColor,inset:l.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[r]:{classNamePrefix:"em-mob-text_align-",value:t[r]}};break;case"mobileVerticalAlign":n={[r]:{classNamePrefix:"em-mob-vertical_align-",value:t[r]}};break;case"countdownTime":case"countdownTimeZone":case"countdownBackgroundColor":case"countdownNumbersFont":case"countdownNumbersFontSize":case"countdownNumbersColor":case"countdownLabelsFont":case"countdownLabelsFontSize":case"countdownLabelsColor":case"countdownLanguage":case"countdownDuration":case"countdownTransparency":case"countdownNumbersStrong":case"countdownNumbersItalic":case"countdownLabelsStrong":case"countdownLabelsItalic":wt();break;case"video":(async()=>{const e=a.getFieldsValue(!0);e.video.source&&Bt("tmp",null,e.video.source).then((t=>{var o=document.createElement("canvas"),l=o.getContext("2d"),a=new Image,r=new Image;let n=t,d="https://useblocks.io/app/"+e.video.playButton+".png";a.crossOrigin="Anonymous",r.crossOrigin="Anonymous";let m=!1,s=!1;a.onload=function(){l.clearRect(0,0,o.width,o.height),l.drawImage(a,0,0,o.width,o.height),m=!0},a.src=n,r.onload=function(){var e=o.width/2-r.width/2,t=o.height/2-r.height/2;l.drawImage(r,e,t,r.width,r.height),s=!0},r.src=d;let u=setInterval((function(){if(m&&s){o.width=Math.max(a.width,r.width),o.height=Math.max(a.height,r.height),l.clearRect(0,0,o.width,o.height),l.drawImage(a,0,0,a.width,a.height);var e=o.width/2-r.width/2,t=o.height/2-r.height/2;l.drawImage(r,e,t,r.width,r.height),o.toBlob((async function(e){const t=await(0,x.A)(new File([e],"image.jpeg",{type:"image/jpeg"}),{maxSizeMB:c.compressMaxSize||.45,maxWidthOrHeight:c.compressMaxWidthOrHeight||2e3});Bt(R,t).then((e=>{i((0,Me.tm)(e))}))}),"image/jpg",1),clearInterval(u)}}),300)}))})(),l.link=l.video.source,z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"video",settings:{video:{...l.video,...t.video},link:l.link}});break;default:n=t}var d;("borderPosition"!==r&&"mobileBorderPosition"!==r&&-1===r.indexOf("countdown")&&"video"!==r&&z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n}),"video"!==r&&-1===r.indexOf("countdown"))&&xt({...e,...n,mobileBorderRadius:{...e.mobileBorderRadius,...null===(d=n)||void 0===d?void 0:d.mobileBorderRadius},activateSection:null,changeKey:r})};(0,l.useEffect)((()=>{ee.isError&&((0,ze.p6)(ee,C),rt(!1))}),[ee,C]),(0,l.useEffect)((()=>{if(ee.isSuccess&&it){var t;if(400===(null===(t=ee.data.data)||void 0===t?void 0:t.status))C.error({message:l.createElement("div",{dangerouslySetInnerHTML:{__html:ee.data.code}}),description:l.createElement("div",{dangerouslySetInnerHTML:{__html:ee.data.message}}),placement:"bottomRight"});else{let t=new URL(ee.data.target),o={countdown:{link:ee.data.link,params:t.search.substring(1)}};z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:o})}rt(!1)}}),[ee,it,e,C,z]);(0,Ce.A)((t=>{const o=t.data.operation;o===F.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_AI))):o===F.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):o===F.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_EDIT))):o===F.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_GIF))):o===F.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Me.tm)(e.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_STOCK))):o===F.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,Oe.Os)()),i((0,Oe.Oo)()))}));const Pt=()=>{Be?(we(""),a.setFieldValue("link",""),z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{link:""}})):(we(te.current&&te.current.input.value?te.current.input.value:"..."),setTimeout((()=>{te.current.focus()})))},Nt=e=>{""===e.target.value?we("..."):(oe.current.classList.add("selected-td-form__button--active"),we(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?dt("https://"):"mailto:"===t.substring(0,7)?dt("mailto:"):"tel:"===t.substring(0,4)?dt("tel:"):"sms:"===t.substring(0,4)?dt("sms:"):"ftp://"===t.substring(0,6)?dt("ftp://"):"skype:"===t.substring(0,6)?dt("skype:"):"viber:"===t.substring(0,6)?dt("viber:"):dt("")},Tt=()=>{const t=a.getFieldsValue(!0);xe?(Re(""),t.alt="",z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{alt:""}})):(Re(le.current&&le.current.input.value?le.current.input.value:"..."),setTimeout((()=>{le.current.focus()})))},It=e=>{""===e.target.value?Re("..."):(ae.current.classList.add("selected-td-form__button--active"),Re(e.target.value))},Ct=()=>{const t=a.getFieldsValue(!0);Pe?(Te(""),t.title="",z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{title:""}})):(Te(ie.current&&ie.current.input.value?ie.current.input.value:"..."),setTimeout((()=>{ie.current.focus()})))},Lt=e=>{""===e.target.value?Te("..."):(re.current.classList.add("selected-td-form__button--active"),Te(e.target.value))};return l.createElement(u.A,{form:a,layout:"vertical",name:"selected_image_form",initialValues:{src:"",width:"",height:"",widthDim:"",heightDim:"",alt:"",align:"left",border:"",boxShadow:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"left",mobileVerticalAlign:"",link:"https://",imgReplacer:"",countdownNumbersStrong:!1,countdownNumbersItalic:!1,countdownLabelsStrong:!1,countdownLabelsItalic:!1,video:{source:"",playButton:"youtube_red"}},onValuesChange:Rt,autoComplete:"off",className:"element-controls"},!_t&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),H===F.ND&&X.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement(b.A,{gutter:30,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(pe,{form:a,elementSettings:e,imgParent:!0})),l.createElement(E.A,{span:12,align:"right"},l.createElement(ge,{form:a,elementSettings:e}))),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&l.createElement(l.Fragment,null,l.createElement(ke,{form:a,elementSettings:e}),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),"video"===e.type&&l.createElement(l.Fragment,null,l.createElement(Ne,{form:a,elementSettings:e}),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&l.createElement(u.A.Item,{style:{marginBottom:0}},l.createElement(N.A,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),l.createElement(A.A,{size:8,style:{marginBottom:xe||Be||Pe?o.formItemMarginBottomXS:o.formItemMarginBottomMD+4}},l.createElement(p.A,{title:Be||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Be}),icon:l.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Pt,ref:oe})),l.createElement(p.A,{title:xe||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!xe}),onClick:Tt,ref:ae},l.createElement("span",{className:"addon-text-content"},"Alt"))),c.formFieldImageTitleEnabled&&l.createElement(p.A,{title:Pe||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Pe}),onClick:Ct,ref:re},l.createElement("span",{className:"addon-text-content"},"Title")))),(!!Be||!!xe||!!Pe)&&l.createElement("div",{style:{marginBottom:o.formItemMarginBottomMD+4}},!!Be&&l.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},l.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(_.A,{ref:te,allowClear:!0,placeholder:t("Hyperlink URL"),prefix:l.createElement(y.A,null),onChange:Nt}))),!!xe&&l.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},l.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},"Alt"),onChange:It,ref:le}))),c.formFieldImageTitleEnabled&&!!Pe&&l.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},l.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Tooltip text"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},"Title"),onChange:Lt,ref:ie})))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{at((e=>!e)),lt&&(t.mobileWidth="",t.mobileHeight="",z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},lt?l.createElement(w.A,null):l.createElement(B.A,null)))),lt&&l.createElement(b.A,{gutter:10,style:{paddingBottom:24}},l.createElement(E.A,{span:12},l.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e,isPicture:"true"})),l.createElement(E.A,{span:12},l.createElement(Z,{form:a,name:"mobileHeight",elementSettings:e,isPicture:"true"}))),c.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{$e((e=>!e)),qe&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),Ee((e=>({...F.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},qe?l.createElement(w.A,null):l.createElement(B.A,null)))),qe&&l.createElement("div",{style:{marginBottom:4}},l.createElement(ce,{mobileBorders:be}))),c.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Je((e=>!e)),Qe?(t.mobileBorderRadiusAll=null,Se(!0)):t.mobileBorderRadiusAll=5,z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},Qe?l.createElement(w.A,null):l.createElement(B.A,null)))),Qe&&l.createElement("div",{style:{marginBottom:4}},l.createElement(I.A,{form:a,oneBorderRadiusValue:ye,setOneBorderRadiusValue:Se,elementSettings:e,typeOfForm:"mobile"}))),c.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ot((e=>!e)),tt?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},tt?l.createElement(w.A,null):l.createElement(B.A,null)))),tt&&l.createElement("div",{style:{marginBottom:4}},l.createElement(U,{boxShadow:he,typeOfForm:"mobile"}))),c.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(fe,{elementSettings:e,form:a})))),c.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))):l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(b.A,{gutter:10,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(V,{form:a,elementSettings:e,imgParent:!0})),l.createElement(E.A,{span:12,align:"right"},l.createElement(W.A,{form:a,elementSettings:e}))),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&l.createElement(l.Fragment,null,l.createElement(ke,{form:a,elementSettings:e,handleChangeValues:Rt}),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),mt&&l.createElement(E.A,{span:24,id:"merge_tags_wrapper"},l.createElement(u.A.Item,{style:{marginBottom:24}},l.createElement(f.Ay,{id:"merge_tags_button",icon:l.createElement(O.A,{icon:"MergeTags"}),style:{width:"100%",display:ct?"none":"block"},onClick:()=>ut(!0)},t("Merge tags")),l.createElement(v.A,{ref:me,popupClassName:"merge-tags",options:mt,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const o=t.map(((t,o)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return l.createElement("span",{key:t.value},0!==o&&l.createElement("span",null,"\xa0/\xa0"),a.map(((t,o)=>t.toLowerCase()===e.toLowerCase()?l.createElement("span",{key:o,style:{color:"red"}},t):t)))}));return l.createElement("div",{title:t.map((e=>e.label)).join(" / ")},o)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(t,o)=>{if(ut(!1),t){const l=St.syntax.length>1?mt.findIndex((e=>e.key===o[0].key)):0,i=St.syntax[l].replace("%value%",t[t.length-1]);"selected_image_form_title"===(null===pt||void 0===pt?void 0:pt.getAttribute("id"))||"selected_image_form_alt"===(null===pt||void 0===pt?void 0:pt.getAttribute("id"))||"selected_image_form_link"===(null===pt||void 0===pt?void 0:pt.getAttribute("id"))||"selected_image_form_imgReplacer"===(null===pt||void 0===pt?void 0:pt.getAttribute("id"))?((t,o)=>{const l=document.getElementById(o);if(l){var i,r;const n="selected_image_form_",d=o.substring(o.indexOf(n)+n.length),m=null===(i=l.value)||void 0===i?void 0:i.substring(0,bt.start),s=null===(r=l.value)||void 0===r?void 0:r.substring(bt.end);z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{...e,[d]:m+t+s}}),a.setFieldValue(d,m+t+s),l.focus(),setTimeout((()=>{l.selectionStart=bt.start,l.selectionEnd=bt.start+t.length}),400),ft(!0)}})(i,null===pt||void 0===pt?void 0:pt.getAttribute("id")):(a.setFieldValue("imgReplacer",i),z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:i}}))}},style:{display:ct?"block":"none"},open:ct,onKeyDown:e=>{"Escape"===e.key&&ut(!1)}}))),"video"===e.type&&l.createElement(l.Fragment,null,l.createElement(Ne,{form:a,elementSettings:e}),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&l.createElement(u.A.Item,{style:{marginBottom:0}},l.createElement(N.A,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),l.createElement(A.A,{size:8,style:{marginBottom:xe||Be||Pe||vt?o.formItemMarginBottomXS:o.formItemMarginBottomMD+4}},l.createElement(p.A,{title:xe||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!xe}),onClick:Tt,ref:ae},l.createElement("span",{className:"addon-text-content"},"Alt"))),c.formFieldImageTitleEnabled&&l.createElement(p.A,{title:Pe||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Pe}),onClick:Ct,ref:re},l.createElement("span",{className:"addon-text-content"},"Title"))),l.createElement(p.A,{title:Be||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Be}),icon:l.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Pt,ref:oe})),l.createElement(p.A,{title:t("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":vt}),icon:l.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{At(!vt),vt?(a.setFieldValue("imgReplacer",""),z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:""}})):setTimeout((()=>ne.current.focus()))},ref:de}))),(!!Be||!!xe||!!Pe||!!vt)&&l.createElement("div",{style:{marginBottom:o.formItemMarginBottomMD+4}},!!Be&&l.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},l.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(_.A,{addonBefore:l.createElement(Ge.Ai,{linkProtocol:nt,handleLinkProtocolsChange:e=>{a.setFieldValue("link","mergetag"!==e?e:""),dt(e)},__:t}),placeholder:t("Hyperlink URL"),allowClear:!0,ref:te,onChange:Nt,onSelect:kt,prefix:l.createElement(Ge.RM,{linkProtocol:nt})}))),!!xe&&l.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},l.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},"Alt"),onChange:It,ref:le,onSelect:kt}))),c.formFieldImageTitleEnabled&&!!Pe&&l.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},l.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Enter the title of the image"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},"Title"),onChange:Lt,ref:ie,onSelect:kt}))),!!vt&&l.createElement(p.A,{trigger:["hover"],title:t("Image src"),placement:"bottom"},l.createElement(u.A.Item,{name:"imgReplacer",className:"selected-image-form__alt",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},t("Image src")),onChange:e=>{""!==e.target.value&&de.current.classList.add("selected-td-form__button--active")},ref:ne,onSelect:kt})))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Size")),l.createElement(b.A,{gutter:o.marginSM,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(p.A,{title:t("Width"),placement:"bottom"},l.createElement(u.A.Item,{name:"width",style:{marginBottom:o.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:e.maxWidth,placeholder:t("Width"),prefix:l.createElement(S.A,null),addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(p.A,{title:t("Height"),placement:"bottom"},l.createElement(u.A.Item,{name:"height"},l.createElement(j.A,{min:0,placeholder:t("Height"),prefix:l.createElement(k.A,null),addonAfter:"px"}))))),c.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Xe((e=>!e)),Ue&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),ue((e=>({...F.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},Ue?l.createElement(w.A,null):l.createElement(B.A,null)))),Ue&&l.createElement("div",{style:{marginBottom:4}},l.createElement(T.A,{borders:se}))),c.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ke((e=>!e)),Ye?(t.borderRadiusAll=0,_e(!0)):t.borderRadiusAll=5,z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},Ye?l.createElement(w.A,null):l.createElement(B.A,null)))),Ye&&l.createElement("div",{style:{marginBottom:4}},l.createElement(I.A,{form:a,oneBorderRadiusValue:Ae,setOneBorderRadiusValue:_e,elementSettings:e}))),c.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{et((e=>!e)),Ze?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),z({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},Ze?l.createElement(w.A,null):l.createElement(B.A,null)))),Ze&&l.createElement("div",{style:{marginBottom:4}},l.createElement(U,{boxShadow:he}))),c.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(fe,{elementSettings:e,form:a})))),c.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))))};var Xe=o(78320);const qe=()=>{const{__:e}=(0,L.s9)();return l.createElement(p.A,{trigger:["hover"],title:e("The font-size CSS property sets the size of the font."),placement:"top"},l.createElement(u.A.Item,{name:"mobileFontSize"},l.createElement(j.A,{min:8,max:90,placeholder:e("Font size"),prefix:l.createElement(Ae.A,null),addonAfter:"px"})))};var $e=o(44484),Ye=o(96698);const Ke=({form:e,elementSettings:t,name:o,icon:a,tooltipTitle:i=null,showTooltip:n=!0})=>{const{__:d}=(0,L.s9)(),m=e.getFieldValue(o),s=(0,D.XW)(),[c,g]=(0,l.useState)(t[o]);(0,l.useEffect)((()=>{t[o]!==e.getFieldValue(o)&&(e.setFieldValue(o,t[o]),g(t[o]))}),[t,e,o]),(0,l.useEffect)((()=>{c!==m&&g(m)}),[m,c,o]);const b=()=>{const l={[o]:!c};e.setFieldValue(o,!c),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:l}),g((e=>!e))};return l.createElement(u.A.Item,{name:o},n?l.createElement(p.A,{placement:"bottom",title:i||d(o.substring(4))},l.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},a)):l.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},a))};Ke.defaultProps={imgParent:!1};const Qe=Ke;var Je=o(11399),Ze=o(52427);const{useToken:et}=c.A,tt=({form:e,elementSettings:t,showAddParagraph:o=!0,isButton:a=!1,linkProtocol:i,setLinkProtocol:d,linkTarget:m})=>{const{__:s}=(0,L.s9)(),{token:c}=et(),g=(0,We.hN)(),A=(0,D.XW)(),S=(0,D.K9)(),k=(0,l.useRef)(),B=(0,l.useRef)(null),w=(0,l.useRef)(null),[x,R]=(0,l.useState)(!1),[P,N]=(0,l.useState)(null),[T,I]=(0,l.useState)({start:0,end:0}),[C,M]=(0,l.useState)(!1);(0,Ce.A)((e=>{e.data.operation===F.Ru.APPLICATION_FOCUS_IN_IFRAME&&N(null)}));const[V,W]=(0,l.useState)(null);(0,l.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&W(!0)}),[]);const z=(0,l.useRef)(null),G=e=>{A({operation:F.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"}),g.success({message:s("It`s done!"),placement:"bottomRight"})},[U,X]=(0,l.useState)(),[q,$]=(0,l.useState)(!1);(0,l.useEffect)((()=>{t.linkHref&&("https://"===t.linkHref.substring(0,8)||"http://"===t.linkHref.substring(0,7)?d("https://"):"mailto:"===t.linkHref.substring(0,7)?d("mailto:"):"tel:"===t.linkHref.substring(0,4)?d("tel:"):"sms:"===t.linkHref.substring(0,4)?d("sms:"):"ftp://"===t.linkHref.substring(0,6)?d("ftp://"):"skype:"===t.linkHref.substring(0,6)?d("skype:"):"viber:"===t.linkHref.substring(0,6)?d("viber:"):d("")),e.setFieldsValue({linkHref:t.linkHref?t.linkHref:"https://"})}),[e,t,d]);const Y=(0,n.d4)(je.GH);(0,l.useEffect)((()=>{var e;null!==Y&&void 0!==Y&&null!==(e=Y.items)&&void 0!==e&&e.length&&X((0,Ve.cM)(Y.items,s,((e,t)=>{$(!1),S(F.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[Y,X,s,$,S]);(0,l.useEffect)((()=>{q&&z.current&&z.current.focus()}),[q]),(0,l.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||N(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||$(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.removeEventListener("click",t)}}),[]);const K=(0,l.useCallback)((({target:e})=>{if(e&&!C){const{selectionStart:t,selectionEnd:o}=e;I({start:t,end:o})}M(!1)}),[C]);(0,l.useEffect)((()=>K({target:null===m||void 0===m?void 0:m.target})),[m,K]);const Q=(o,l)=>{const a=document.getElementById(l);if(a){var i,r;const n=null===(i=a.value)||void 0===i?void 0:i.substring(0,T.start),d=null===(r=a.value)||void 0===r?void 0:r.substring(T.end),m=l.substring(l.lastIndexOf("_")+1);A({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{[m]:n+o+d}}),e.setFieldValue(m,n+o+d),a.focus(),setTimeout((()=>{a.selectionStart=T.start,a.selectionEnd=T.start+o.length}),400),M(!0)}};(0,l.useEffect)((()=>{var e;R(!(null===(e=t.textReplacer)||void 0===e||!e.length))}),[t,e]);return l.createElement(l.Fragment,null,o&&!t.showOnMobile&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:20,style:{paddingBottom:4}},l.createElement(E.A,{span:12,gutter:20},l.createElement(Je.A,{form:e,elementSettings:t,name:"textAlign"}))),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}})),t.showOnMobile&&l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}}),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"AddImage",style:{marginBottom:c.formItemMarginBottomXS}},l.createElement(f.Ay,{icon:l.createElement(O.A,{icon:"AddImage"}),onClick:()=>G("add_img"),style:{width:"100%"}},s("Add image")))),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"Typography",style:{marginBottom:c.formItemMarginBottomXS}},l.createElement(f.Ay,{icon:l.createElement(O.A,{icon:"Typograf"}),onClick:()=>G("typograf"),style:{width:"100%"}},s("Typography")))),U&&l.createElement(E.A,{span:24,id:"merge_tags_wrapper",style:{marginBottom:0}},l.createElement(f.Ay,{id:"merge_tags_button",icon:l.createElement(O.A,{icon:"MergeTags"}),style:{width:"100%",display:q?"none":"block"},onClick:()=>$(!0)},s("Merge tags")),l.createElement(v.A,{ref:z,popupClassName:"merge-tags",options:U,placeholder:s("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const o=t.map(((t,o)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return l.createElement("span",{key:t.value},0!==o&&l.createElement("span",null,"\xa0/\xa0"),a.map(((t,o)=>t.toLowerCase()===e.toLowerCase()?l.createElement("span",{key:o,style:{color:"red"}},t):t)))}));return l.createElement("div",{title:t.map((e=>e.label)).join(" / ")},o)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(o,l)=>{if($(!1),o){const a=Y.syntax.length>1?U.findIndex((e=>e.key===l[0].key)):0,i=Y.syntax[a].replace("%value%",o[o.length-1]);"selected_button_form_href"===(null===P||void 0===P?void 0:P.getAttribute("id"))||"selected_text_form_linkHref"===(null===P||void 0===P?void 0:P.getAttribute("id"))||"selected_text_form_textReplacer"===(null===P||void 0===P?void 0:P.getAttribute("id"))?Q(i,null===P||void 0===P?void 0:P.getAttribute("id")):(e.setFieldValue("textReplacer",i),A({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:i}}))}},style:{display:q?"block":"none",width:"100%"},open:q,onKeyDown:e=>{"Escape"===e.key&&$(!1)}}))),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:t.showOnMobile?20:0,marginTop:20}}),!t.showOnMobile&&l.createElement("div",{className:"form-group-title"},s("Text")),l.createElement(p.A,{trigger:["hover"],title:s("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"fontFamily",className:"form-item-margin-xs"},l.createElement(Ze.A,{textEditor:!0}))),!t.showOnMobile&&l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:s("Font size"),placement:"bottom"},l.createElement(u.A.Item,{name:"fontSize"},l.createElement(j.A,{min:8,max:90,placeholder:s("Font size"),prefix:l.createElement(Ae.A,null),addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:s("Line height"),placement:"bottom"},l.createElement(u.A.Item,{name:"lineHeight"},l.createElement(j.A,{min:10,max:110,placeholder:s("Line height"),prefix:l.createElement(Xe.A,null),addonAfter:"px"}))))),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:3},l.createElement(Qe,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:s(V?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:l.createElement(_e.A,{className:"selected-text-common-form__icon-radius"})})),l.createElement(E.A,{span:3},l.createElement(Qe,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:s(V?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:l.createElement(ye.A,{className:"selected-text-common-form__icon-radius"})})),l.createElement(E.A,{span:3},l.createElement(Qe,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:s(V?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:l.createElement($e.A,{className:"selected-text-common-form__icon-radius"})})),l.createElement(E.A,{span:3},l.createElement(Qe,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:s(V?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:l.createElement(Ye.A,{className:"selected-text-common-form__icon-radius"})})),o&&l.createElement(E.A,{span:3},l.createElement(Qe,{form:e,className:r()("selected-text-common-form__button selected-text-common-form__button_style",{"selected-text-common-form__button--active":"string"===typeof t.linkHref}),elementSettings:t,name:"textLink",tooltipTitle:s("Link"),icon:l.createElement(y.A,{className:"selected-text-common-form__icon-radius"}),onSelect:K})),a&&l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:s("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"textColor",rules:[{message:s("Please set the font color")}]},l.createElement(H.A,{placeholder:s("Color"),usedColors:t.usedColors})))),!a&&l.createElement(E.A,{span:3},l.createElement(p.A,{title:s("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":x}),icon:l.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{R(!x),x?(e.setFieldValue("textReplacer",""),A({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:""}})):setTimeout((()=>B.current.focus()))},ref:w})))),o&&"string"===typeof t.linkHref&&l.createElement(p.A,{trigger:["hover"],title:s("The URL that the hyperlink directs to."),placement:"bottom"},l.createElement(u.A.Item,{name:"linkHref"},l.createElement(_.A,{ref:k,addonBefore:l.createElement(Ge.Ai,{linkProtocol:i,handleLinkProtocolsChange:t=>{e.setFieldValue("linkHref","mergetag"!==t?t:""),d(t)},__:s}),allowClear:!0,placeholder:s("Hyperlink URL"),autoFocus:null===t||void 0===t?void 0:t.isNewLink,onSelect:K,prefix:l.createElement(Ge.RM,{linkProtocol:i})}))),!a&&x&&l.createElement(p.A,{trigger:["hover"],title:s("Text"),placement:"bottom"},l.createElement(u.A.Item,{name:"textReplacer"},l.createElement(_.A,{placeholder:s("The code that will replace this text"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},s("Text")),onChange:e=>{""!==e.target.value&&w.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const t=e.target,o=t.value,l=t.selectionStart;if(0!==l||" "!==e.key){if(" "===e.key){if(l!==o.length)return void e.preventDefault();o.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:B,onSelect:K}))),!a&&l.createElement(b.A,{gutter:10,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:s("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"textColor",rules:[{message:s("Please set the font color")}]},l.createElement(H.A,{placeholder:s("Color"),usedColors:t.usedColors})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:s("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:s("Please set the background color")}]},l.createElement(H.A,{placeholder:s("Background color"),usedColors:t.usedColors}))))))};var ot=o(38927),lt=o(81149),at=o(2922),it=o(60994);const rt=({form:e,elementSettings:t,showAddParagraph:o=!0,isButton:a=!1})=>{const{__:i}=(0,L.s9)(),r=(0,D.XW)(),c=(0,n.wA)(),{emailId:g}=(0,s.g)(),b=(0,n.d4)(g?d.Hs:m.gm).hasOwnProperty("type")?F.IE:F.Tm,[E,v]=(0,l.useState)(null);(0,l.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&v(!0)}),[]);const S=e=>{r({operation:F.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"})},[k,B]=(0,l.useState)(t.textAlign),[w,x]=(0,l.useState)(t.linkHref),R=e=>B(e);return(0,l.useEffect)((()=>{B(t.textAlign),x(t.linkHref)}),[t]),l.createElement("div",{className:"selected_text_common_form_mobile"},l.createElement(A.A,{size:"8",split:l.createElement(h.A,{type:"vertical"})},l.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},l.createElement("div",{style:{width:190}},l.createElement(p.A,{trigger:["hover"],title:i("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"fontFamily"},l.createElement(Ze.A,{textEditor:!0,codeMode:!0})))),l.createElement("div",{style:{width:90}},l.createElement(p.A,{trigger:["hover"],title:i("Font size"),placement:"bottom"},l.createElement(u.A.Item,{name:"fontSize"},l.createElement(j.A,{min:8,max:90,placeholder:i("Font size"),prefix:l.createElement(Ae.A,null),addonAfter:"px"})))),l.createElement("div",{style:{width:90}},l.createElement(p.A,{trigger:["hover"],title:i("Line height"),placement:"bottom"},l.createElement(u.A.Item,{name:"lineHeight"},l.createElement(j.A,{min:10,max:110,placeholder:i("Line height"),prefix:l.createElement(Xe.A,null),addonAfter:"px"}))))),l.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},l.createElement(Qe,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:i(E?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:l.createElement(_e.A,{className:"selected-td-form__icon-radius"})}),l.createElement(Qe,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:i(E?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:l.createElement(ye.A,{className:"selected-td-form__icon-radius"})}),l.createElement(Qe,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:i(E?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:l.createElement($e.A,{className:"selected-td-form__icon-radius"})}),l.createElement(Qe,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:i(E?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:l.createElement(Ye.A,{className:"selected-td-form__icon-radius"})})),l.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},l.createElement(p.A,{trigger:["hover"],title:i("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"textColor",rules:[{message:i("Please set the font color")}]},l.createElement(H.A,{placeholder:i("Color"),usedColors:t.usedColors,codeMode:!0}))),!a&&l.createElement(l.Fragment,null,l.createElement(p.A,{trigger:["hover"],title:i("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:i("Please set the background color")}]},l.createElement(H.A,{placeholder:i("Background color"),usedColors:t.usedColors}))))),o&&l.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},l.createElement(l.Fragment,null,"string"===typeof w?l.createElement(ot.A,{arrow:!0,dropdownRender:()=>l.createElement(p.A,{trigger:["hover"],title:i("The URL that the hyperlink directs to."),placement:"bottom"},l.createElement(u.A.Item,{name:"linkHref"},l.createElement(_.A,{allowClear:!0,placeholder:"href",prefix:l.createElement(y.A,null),autoFocus:null===t||void 0===t?void 0:t.isNewLink}))),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:520,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},l.createElement("div",null,l.createElement(Qe,{form:e,className:"selected-td-form__button selected-td-form__button_style selected-td-form__button--active",elementSettings:t,name:"textLink",icon:l.createElement(y.A,{className:"selected-td-form__icon-radius"}),showTooltip:!1}))):l.createElement(Qe,{form:e,className:"selected-td-form__button selected-td-form__button_style",elementSettings:t,name:"textLink",tooltipTitle:i("Link"),icon:l.createElement(y.A,{className:"selected-td-form__icon-radius"})}),l.createElement(ot.A,{arrow:!0,dropdownRender:()=>l.createElement(Je.A,{form:e,elementSettings:t,name:"textAlign",setAlignStateHandle:R}),overlayClassName:"codemode-textalign-dropdown",overlayStyle:{left:615,top:52,transform:"translateX(0)",marginLeft:57},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected_text_common_form_mobile")},l.createElement(f.Ay,{icon:"right"===k?l.createElement(lt.A,null):"center"===k?l.createElement(at.A,null):l.createElement(it.A,null),className:"selected-td-form__button"})))),l.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o&&l.createElement(p.A,{trigger:["hover"],title:i("Add paragraph"),placement:"bottom"},l.createElement(f.Ay,{icon:l.createElement(O.A,{icon:"Paragraph"}),onClick:()=>S("add_p"),className:"selected-td-form__button"})),l.createElement(p.A,{trigger:["hover"],title:i("Add inline image"),placement:"bottom"},l.createElement(f.Ay,{icon:l.createElement(O.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),onClick:()=>S("add_img"),className:"selected-td-form__button"})),l.createElement(f.Ay,{icon:l.createElement(O.A,{icon:"Typograf"}),className:"selected-td-form__button"}),l.createElement(f.Ay,{icon:l.createElement(te.A,null),type:"icon",style:{marginLeft:26},onClick:()=>{r({operation:F.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),c((0,Fe.Fk)()),setTimeout((()=>{b===F.IE?c((0,m.A9)({type:null})):c((0,d.A9)({type:null}))}),300)}}))))},nt=({form:e,elementSettings:t,imgParent:o,name:a="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,d]=(0,l.useState)(null===(i=t[a])||void 0===i?void 0:i.value),m=(0,D.XW)(),s=o=>{const l=o.target.value,i={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};l!==n?d(l):(d(""),e.setFieldsValue(i),m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return l.createElement(u.A.Item,{name:a},l.createElement(C.Ay.Group,{disabled:o&&!t.parent},l.createElement(A.A,{size:8},l.createElement(p.A,{placement:"bottom",title:r("Text align left")},l.createElement(C.Ay.Button,{value:"left",onClick:s},l.createElement(it.A,null))),l.createElement(p.A,{placement:"bottom",title:r("Text align center")},l.createElement(C.Ay.Button,{value:"center",onClick:s},l.createElement(at.A,null))),l.createElement(p.A,{placement:"bottom",title:r("Text align right")},l.createElement(C.Ay.Button,{value:"right",onClick:s},l.createElement(lt.A,null))),l.createElement(p.A,{placement:"bottom",title:r("Text align justify")},l.createElement(C.Ay.Button,{value:"justify",onClick:s},l.createElement(O.A,{icon:"Justify"}))))))};nt.defaultProps={imgParent:!1};const dt=nt,mt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,n.wA)(),a=(0,D.XW)(),[i]=u.A.useForm(),r=(0,n.d4)(d.Hs),s=(0,n.d4)(Fe.Ct),c=(0,n.d4)(Fe.CS),h=(0,n.d4)(Fe.Fv),f=(0,n.d4)(Fe.yy),v=h&&"bottom"!==f,[A,_]=(0,l.useState)("https://"),y=r.hasOwnProperty("type")?F.IE:F.Tm,S=(0,l.useCallback)((e=>{o(y===F.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[o,y]);(0,l.useEffect)((()=>{var t,o,l,a,r;e&&i.setFieldsValue({...e,linkHref:e.linkHref?e.linkHref:"https://",mobileFontSize:(0,Ge.ok)((null===(t=e.mobileFontSize)||void 0===t?void 0:t.value)||e.fontSize),mobileFontSizeDim:(null===(o=e.mobileFontSize)||void 0===o?void 0:o.dim)||e.fontSizeDim,mobileLineHeight:(0,Ge.ok)((null===(l=e.mobileLineHeight)||void 0===l?void 0:l.value)||e.lineHeight),mobileLineHeightDim:(null===(a=e.mobileLineHeight)||void 0===a?void 0:a.dim)||e.lineHeightDim,mobileTextAlign:(0,Ge.ok)((null===(r=e.mobileTextAlign)||void 0===r?void 0:r.value)||e.textAlign)})}),[i,e]);return l.createElement(u.A,{form:i,layout:"vertical",name:"selected_text_form",autoComplete:"off",onValuesChange:t=>{const o=i.getFieldsValue(!0),l=Object.keys(t)[0];let r;switch(l){case"mobileFontSize":r={[l]:{classNamePrefix:"em-mob-font_size-",value:t[l],dim:o.mobileFontSizeDim}};break;case"mobileLineHeight":r={[l]:{classNamePrefix:"em-mob-line_height-",value:t[l],dim:o.mobileLineHeightDim}};break;case"mobileTextAlign":r={[l]:{classNamePrefix:"em-mob-text_align-",value:t[l]}};break;case"linkHref":let e=t[l];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),i.setFieldValue("linkHref",e)),r={[l]:e},"https://"===t[l].substring(0,8)||"http://"===t[l].substring(0,7)?_("https://"):"mailto:"===t[l].substring(0,7)?_("mailto:"):"tel:"===t[l].substring(0,4)?_("tel:"):"sms:"===t[l].substring(0,4)?_("sms:"):"ftp://"===t[l].substring(0,6)?_("ftp://"):"skype:"===t[l].substring(0,6)?_("skype:"):"viber:"===t[l].substring(0,6)?_("viber:"):_("");break;default:r=t}a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),S({...e,...r,activateSection:null,changeKey:l})},className:"element-controls",initialValues:{textAlign:"left",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textColor:"",textBackgroundColor:"",textLink:!1,textReplacer:""}},!v&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),!(s===F.ND&&!v&&c.styles)&&l.createElement("div",{id:"selected_element_form_desktop_props",style:{paddingRight:0}},l.createElement("div",{className:"selected_form-props-wrapper"},v?l.createElement(rt,{form:i,elementSettings:e}):l.createElement(tt,{form:i,elementSettings:e,linkProtocol:A,setLinkProtocol:_}))),!v&&l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===F.ND&&c.styles?"block":"none"}},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement(b.A,{gutter:20},l.createElement(E.A,{span:12},l.createElement(dt,{form:i,elementSettings:e,name:"mobileTextAlign"}))),!!e.showOnMobile&&l.createElement(tt,{form:i,elementSettings:e,linkProtocol:A,setLinkProtocol:_}),l.createElement(b.A,{gutter:10,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(qe,null)),l.createElement(E.A,{span:12},l.createElement(u.A.Item,{name:"mobileLineHeight"},l.createElement(j.A,{min:0,placeholder:t("Line height"),prefix:l.createElement(Xe.A,null),addonAfter:"px"})))))))};var st=o(78469),ct=o(31573),ut=o(39672),pt=o(70552),gt=o(88647);const bt=({form:e,oneMobileBorderRadiusValue:t,setOneMobileBorderRadiusValue:o,elementSettings:a})=>{const{__:i}=(0,L.s9)(),n=(0,D.XW)();return l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(A.A,{size:10,align:"start"},l.createElement(u.A.Item,{name:"mobileBorderRadiusAll"},l.createElement(j.A,{min:0,placeholder:i("Border radius"),prefix:l.createElement(gt.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const l=e.getFieldsValue(!0);t&&e.setFieldsValue({mobileBorderRadiusTopLeft:l.mobileBorderRadiusAll,mobileBorderRadiusBottomLeft:l.mobileBorderRadiusAll,mobileBorderRadiusTopRight:l.mobileBorderRadiusAll,mobileBorderRadiusBottomRight:l.mobileBorderRadiusAll}),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileBorderRadius:{all:l.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}}),o((e=>!e))}},l.createElement(gt.h,{className:"selected-td-form__icon-radius"}))),l.createElement(E.A,null,l.createElement(b.A,{gutter:10,style:{marginTop:-10}},l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:i("Top left corner")},l.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusTopLeft",className:"form-item-margin-xs"},l.createElement(j.A,{min:0,prefix:l.createElement(st.A,null),style:{minHeight:10},addonAfter:"px"}))),l.createElement(p.A,{placement:"bottom",title:i("Bottom left corner")},l.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusBottomLeft"},l.createElement(j.A,{min:0,prefix:l.createElement(ct.A,null),style:{minHeight:10},addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:i("Top right corner")},l.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusTopRight",className:"form-item-margin-xs"},l.createElement(j.A,{min:0,prefix:l.createElement(ut.A,null),style:{minHeight:10},addonAfter:"px"}))),l.createElement(p.A,{placement:"bottom",title:i("Bottom right corner")},l.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusBottomRight"},l.createElement(j.A,{min:0,prefix:l.createElement(pt.A,null),style:{minHeight:10},addonAfter:"px"})))))))},Et=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)(),a=(0,l.useRef)(),i=(0,n.d4)(d.uJ),[r,m]=(0,l.useState)(!t.mobileBoxShadow||0===t.mobileBoxShadow.hOffset&&0===t.mobileBoxShadow.vOffset&&0===t.mobileBoxShadow.blurRadius&&0===t.mobileBoxShadow.spreadRadius&&0===t.mobileBoxShadow.spreadRadius),s=(0,D.XW)(),c=e=>{m(!1)};return l.createElement(l.Fragment,null,l.createElement("div",{style:{float:"right",marginTop:-9,marginRight:50}},l.createElement(A.A,{size:8,align:"end"},l.createElement(q.A,{ref:a,size:"small",checked:r,onChange:o=>{m((e=>!e)),e.setFieldsValue({mobileBoxShadowHOffset:r?"":0,mobileBoxShadowVOffset:r?"":0,mobileBoxShadowBlurRadius:r?"":0,mobileBoxShadowSpreadRadius:r?"":0,mobileBoxShadowColor:"",mobileBoxShadowInset:!1}),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBoxShadow:{classNamePrefix:"em-mob-box_shadow-",hOffset:r?null:0,vOffset:r?null:0,blurRadius:r?null:0,spreadRadius:r?null:0,color:null,inset:!1}}})},id:"without-shadow"}),l.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"without-shadow"},o("Without shadow"))))),l.createElement("p",{style:{paddingBottom:"8px",margin:"-30px 0 0"}},"\xa0"),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:o("Horizontal offset")},l.createElement(u.A.Item,{name:"mobileBoxShadowHOffset",className:"form-item-margin-xs"},l.createElement(j.A,{min:0,placeholder:o("Horizontal offset"),prefix:l.createElement(G.A,null),addonAfter:"px",onChange:c})))),l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:o("Vertical offset")},l.createElement(u.A.Item,{name:"mobileBoxShadowVOffset",className:"form-item-margin-xs"},l.createElement(j.A,{min:0,placeholder:o("Vertical offset"),prefix:l.createElement(G.A,{style:{transform:"rotate(90deg)"}}),addonAfter:"px",onChange:c})))),l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:o("Blur radius")},l.createElement(u.A.Item,{name:"mobileBoxShadowBlurRadius",className:"form-item-margin-xs"},l.createElement(j.A,{min:0,placeholder:o("Blur radius"),prefix:l.createElement(O.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px",onChange:c})))),l.createElement(E.A,{span:12},l.createElement(p.A,{placement:"bottom",title:o("Spread radius")},l.createElement(u.A.Item,{name:"mobileBoxShadowSpreadRadius",className:"form-item-margin-xs"},l.createElement(j.A,{placeholder:o("Spread radius"),prefix:l.createElement(O.A,{icon:"ZoomOutMap"}),addonAfter:"px",onChange:c})))),l.createElement(E.A,{span:12},l.createElement(A.A,{size:10,align:"start"},l.createElement(u.A.Item,{name:"mobileBoxShadowColor"},l.createElement(H.A,{usedColors:i.usedColors})))),l.createElement(E.A,{span:12},l.createElement(p.A,{title:o("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},l.createElement(u.A.Item,{name:"mobileBoxShadowInset",valuePropName:"checked"},l.createElement(z.A,{style:{width:"100%"},options:[{label:o("Outside"),value:!1},{label:o("Inside"),value:!0}]}))))))},{useToken:ht}=c.A,ft=({form:e,elementSettings:t,label:o})=>{var a;const{__:i}=(0,L.s9)(),r=(0,l.useRef)(),[n,d]=(0,l.useState)("none"===(null===(a=t.mobileBackgroundColor)||void 0===a?void 0:a.value)),{token:m}=ht(),s=(0,D.XW)();return l.createElement(l.Fragment,null,l.createElement(p.A,{trigger:["hover"],title:i("Background color"),placement:"left"},l.createElement(u.A.Item,{name:"mobileBackgroundColor",style:{marginBottom:m.formItemMarginBottomXS/2}},l.createElement(H.A,{onChange:e=>{d(!1)},placeholder:o,usedColors:t.usedColors})),l.createElement(A.A,{size:8,align:"end"},l.createElement(q.A,{ref:r,size:"small",checked:n,onChange:o=>{e.setFieldsValue({mobileBackgroundColor:""}),d((e=>!e)),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:n?"":"none"}}})},id:"without-background-color"}),l.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"without-background-color"},i("Without background color"))))))};o(3783);const vt=(e,t)=>{const{__:o}=(0,L.s9)();return l.createElement(p.A,{title:o("During export, the element is converted into an image."),key:"exportAsPicture"},l.createElement(A.A,{size:10,align:"baseline"},l.createElement(u.A.Item,{name:"exportAsPicture",valuePropName:"checked"},l.createElement(q.A,{size:"small",id:"convern-in-image"})),l.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"convern-in-image"},o("Convert into an image")))))},{Option:At}=X.A,_t=l.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},l.createElement(At,{value:"px"},"px"),l.createElement(At,{value:"%"},"%")),{useToken:yt}=c.A,St=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,D.XW)(),[a]=u.A.useForm(),[i,r]=(0,l.useState)({}),[d,m]=(0,l.useState)({}),[s,c]=(0,l.useState)(!0),[v,A]=(0,l.useState)({}),[_,y]=(0,l.useState)({}),[k,x]=(0,l.useState)(!0),R=(0,n.d4)(Fe.Ct),P=(0,n.d4)(Fe.CS),C=(0,Ve.rD)(),[M,W]=(0,l.useState)(""===e.backgroundImage[0].value),{token:z}=yt(),G=(0,n.d4)(Fe.Fv),q=(0,n.d4)(Fe.yy),$=G&&"bottom"!==q,[Y,K]=(0,l.useState)(!1),[J,Z]=(0,l.useState)(!1),[ee,te]=(0,l.useState)(!1),[oe,le]=(0,l.useState)(!1),[ae,ie]=(0,l.useState)(!1),[re,ne]=(0,l.useState)(!1),[de,me]=(0,l.useState)(!1),[se,ue]=(0,l.useState)(!1),[ge,be]=(0,l.useState)(!1),[Ee,he]=(0,l.useState)(!1),[ve,Ae]=(0,l.useState)(!1),_e=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],ye=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}];(0,l.useEffect)((()=>{if(e){var t,o,l,i,n,d,s,u,p,g,b,E,h,f,v,_,S,k,B,w,R,P,N,T,I,C,L,O,F,D,M,V,z,G,j,H,U,X,q,$,Y,Q,J;const ee=e.border,oe=e.boxShadow,ae=e.mobileBorder,re=e.mobileBoxShadow;r(ee),m(oe),A(ae),y(re);const de=Object.keys(ee).find((e=>{var t,o,l;return(null===(t=ee[e])||void 0===t?void 0:t.width)||(null===(o=ee[e])||void 0===o?void 0:o.style)||(null===(l=ee[e])||void 0===l?void 0:l.color)})),se=Object.keys(ae).find((e=>{var t,o,l;return(null===(t=ae[e])||void 0===t?void 0:t.width)||(null===(o=ae[e])||void 0===o?void 0:o.style)||(null===(l=ae[e])||void 0===l?void 0:l.color)}));a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,maxWidth:null===(l=e.maxWidth)||void 0===l?void 0:l.value,maxWidthDim:null===(i=e.maxWidth)||void 0===i?void 0:i.dim,minWidth:null===(n=e.minWidth)||void 0===n?void 0:n.value,minWidthDim:null===(d=e.minWidth)||void 0===d?void 0:d.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderPosition:de||"all",borderWidth:(null===(s=ee[de])||void 0===s?void 0:s.width)||"",borderColor:(null===(u=ee[de])||void 0===u?void 0:u.color)||"",borderStyle:(null===(p=ee[de])||void 0===p?void 0:p.style)||"",borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(g=e.boxShadow)||void 0===g?void 0:g.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(b=e.boxShadow)||void 0===b?void 0:b.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(E=e.boxShadow)||void 0===E?void 0:E.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(h=e.boxShadow)||void 0===h?void 0:h.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(v=e.boxShadow)||void 0===v?void 0:v.color),mobileWidth:(0,Ge.xc)(null===(_=e.mobileWidth)||void 0===_?void 0:_.value),mobileWidthDim:null===(S=e.mobileWidth)||void 0===S?void 0:S.dim,mobileAlign:null===(k=e.mobileAlign)||void 0===k?void 0:k.value,mobileBorderPosition:se||"all",mobileBorderWidth:null!==(null===(B=ae[se])||void 0===B?void 0:B.width)?null===(w=ae[se])||void 0===w?void 0:w.width:"",mobileBorderColor:(null===(R=ae[se])||void 0===R?void 0:R.color)||"",mobileBorderStyle:(null===(P=ae[se])||void 0===P?void 0:P.style)||"",mobileBorderRadiusAll:(0,Ge.ok)(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Ge.ok)(null===(N=e.mobileBoxShadow)||void 0===N?void 0:N.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(T=e.mobileBoxShadow)||void 0===T?void 0:T.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(I=e.mobileBoxShadow)||void 0===I?void 0:I.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(C=e.mobileBoxShadow)||void 0===C?void 0:C.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(L=e.mobileBoxShadow)||void 0===L?void 0:L.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(O=e.mobileBoxShadow)||void 0===O?void 0:O.color),mobileBackgroundColor:(0,Ge.ok)("none"!==(null===(F=e.mobileBackgroundColor)||void 0===F?void 0:F.value)?null===(D=e.mobileBackgroundColor)||void 0===D?void 0:D.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,Ge.ok)(null===(M=e.mobileBackgroundPositionX)||void 0===M?void 0:M.value),mobileBackgroundPositionY:(0,Ge.ok)(null===(V=e.mobileBackgroundPositionY)||void 0===V?void 0:V.value),mobileBackgroundRepeat:null!==(z=e.mobileBackgroundRepeat)&&void 0!==z&&z.value?null===(G=e.mobileBackgroundRepeat)||void 0===G?void 0:G.value:"none",exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?c(!1):c(!0),(0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight)?x(!1):x(!0),W(""===e.backgroundImage[0].value),K(!(null===(j=ee[de])||void 0===j||!j.width)||!(null===(H=ee[de])||void 0===H||!H.style)||!(null===(U=ee[de])||void 0===U||!U.color)),Z(!(null===(X=ae[se])||void 0===X||!X.width)||!(null===(q=ae[se])||void 0===q||!q.style)||!(null===($=ae[se])||void 0===$||!$.color)),te(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),le(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),ie(!!e.boxShadow),ne(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),me(!(null===(Y=e.width)||void 0===Y||!Y.value)||!(null===(Q=e.minWidth)||void 0===Q||!Q.value)||!(null===(J=e.maxWidth)||void 0===J||!J.value)),ue(!!e.mobileWidth.value),be(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),he(!!e.mobileBackgroundColor.value),Ae(!!e.exportAsPicture)}}),[a,e]);return l.createElement(u.A,{form:a,layout:"vertical",name:"selected_table_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,show:"all",width:{value:"",dim:""},maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",mobileAlign:"",border:"",boxShadow:"",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileBackgroundColor:"",mobileBackgroundImage:""},onValuesChange:t=>{const l=a.getFieldsValue(!0),n=Object.keys(t)[0];let d;switch(n){case"exportAsPicture":d={exportAsPicture:l.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":d={boxShadow:{hOffset:l.boxShadowHOffset,vOffset:l.boxShadowVOffset,blurRadius:l.boxShadowBlurRadius,spreadRadius:l.boxShadowSpreadRadius,color:l.boxShadowColor,inset:l.boxShadowInset}};break;case"borderStyle":d={border:{[l.borderPosition]:{...i[l.borderPosition],style:t[n]}}},"all"===l.borderPosition?r((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],style:t[n]}}))):r((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],style:t[n]}})));break;case"borderColor":d={border:{[l.borderPosition]:{...i[l.borderPosition],color:t[n]}}},"all"===l.borderPosition?r((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],color:t[n]}}))):r((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],color:t[n]}})));break;case"borderWidth":d={border:{[l.borderPosition]:{...i[l.borderPosition],width:t[n]}}},"all"===l.borderPosition?r((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],width:t[n]}}))):r((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],width:t[n]}})));break;case"borderPosition":a.setFieldsValue({borderWidth:i[t[n]].width||"",borderColor:i[t[n]].color||"",borderStyle:i[t[n]].style||""});break;case"width":d={[n]:{value:t[n],dim:l.widthDim}};break;case"widthDim":d={width:{value:l.width,dim:t[n]}};break;case"maxWidth":d={[n]:{value:t[n],dim:l.maxWidthDim}};break;case"maxWidthDim":d={maxWidth:{value:l.maxWidth,dim:t[n]}};break;case"minWidth":d={[n]:{value:t[n],dim:l.minWidthDim}};break;case"minWidthDim":d={minWidth:{value:l.minWidth,dim:t[n]}};break;case"backgroundImage":W(""===t[n]),d={[n]:[{...e.backgroundImage[0],value:t[n]}],backgroundSize:"cover"};break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":d={borderRadius:{[F.wF[n]]:+t[n]}};break;case"mobileWidth":d={[n]:{classNamePrefix:"em-mob-width-",value:t[n],dim:l.mobileWidthDim}};break;case"mobileWidthDim":d={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth,dim:t[n]}};break;case"mobileBorderStyle":d={mobileBorder:{[l.mobileBorderPosition]:{...v[l.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?A((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):A((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":d={mobileBorder:{[l.mobileBorderPosition]:{...v[l.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?A((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):A((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":d={mobileBorder:{[l.mobileBorderPosition]:{...v[l.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?A((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):A((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":a.setFieldsValue({mobileBorderWidth:v[t[n]].width||"",mobileBorderColor:v[t[n]].color||"",mobileBorderStyle:v[t[n]].style||""});break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":d={mobileBorderRadius:{[Ge.NW[n]]:t[n],classNamePrefix:"em-mob-border_radius_"+Ge.NW[n]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":d={mobileBoxShadow:{hOffset:l.mobileBoxShadowHOffset,vOffset:l.mobileBoxShadowVOffset,blurRadius:l.mobileBoxShadowBlurRadius,spreadRadius:l.mobileBoxShadowSpreadRadius,color:l.mobileBoxShadowColor,inset:l.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileBackgroundColor":d={[n]:{classNamePrefix:"em-mob-background_color-",value:t[n]}};break;case"mobileBackgroundImage":d={[n]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[n]}]};break;case"mobileBackgroundPositionX":d={[n]:{classNamePrefix:"em-mob-background_position_x-",value:t[n]}};break;case"mobileBackgroundPositionY":d={[n]:{classNamePrefix:"em-mob-background_position_x-",value:t[n]}};break;case"mobileBackgroundRepeat":d={[n]:{classNamePrefix:"em-mob-background_repeat-",value:t[n]}};break;case"mobileAlign":d={[n]:{classNamePrefix:"em-mob-table_align-",value:t[n]}};break;default:d=t}"borderPosition"!==n&&o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:d})},autoComplete:"off",className:"element-controls"},!$&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),R===F.ND&&P.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement("div",{style:{paddingBottom:4}},l.createElement(pe,{form:a,elementSettings:e})),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ue((e=>!e)),se&&(t.mobileWidth="",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"}}}))}))}},se?l.createElement(w.A,null):l.createElement(B.A,null)))),se&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},l.createElement("div",{style:{marginBottom:z.formItemMarginBottomMD+4}},l.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e})))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{he((e=>!e)),t.mobileBackgroundColor=Ee?"":"#E5E5E5",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Ee?l.createElement(w.A,null):l.createElement(B.A,null)))),Ee&&l.createElement("div",{style:{marginBottom:(C.formTableFieldBackgroundImageEnabled,z.formItemMarginBottomMD+4)}},l.createElement(ft,{form:a,elementSettings:e})),!1,C.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Z((e=>!e)),J&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),A((e=>({...F.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},J?l.createElement(w.A,null):l.createElement(B.A,null)))),J&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(ce,{mobileBorders:v}))),C.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{le((e=>!e)),oe?(t.mobileBorderRadiusAll=null,x(!0)):t.mobileBorderRadiusAll=5,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},oe?l.createElement(w.A,null):l.createElement(B.A,null)))),oe&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(bt,{form:a,oneMobileBorderRadiusValue:k,setOneMobileBorderRadiusValue:x,elementSettings:e}))),C.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},re?l.createElement(w.A,null):l.createElement(B.A,null)))),re&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(Et,{mobileBoxShadow:_,form:a,elementSettings:e}))),C.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control")),l.createElement(b.A,{gutter:20},l.createElement(E.A,{span:12},l.createElement("div",{style:{paddingBottom:4}},l.createElement(fe,{elementSettings:e,form:a}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))):l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement("div",{style:{paddingBottom:4}},l.createElement(V,{form:a,elementSettings:e,tooltipTitle:t("The align attribute sets the horizontal alignment of the table.")})),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{me((e=>!e)),de&&(t.width="",t.minWidth="",t.maxWidth="",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},minWidth:{value:null,dim:"px"},maxWidth:{value:null,dim:"px"}}}))}))}},de?l.createElement(w.A,null):l.createElement(B.A,null)))),de&&l.createElement(l.Fragment,null,l.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},l.createElement(u.A.Item,{name:"width",style:{marginBottom:z.formItemMarginBottomXS}},l.createElement(j.A,{min:0,placeholder:t("Width"),prefix:l.createElement(S.A,null),addonAfter:l.createElement(u.A.Item,{name:"widthDim",noStyle:!0},_t),style:{width:"100%"}}))),l.createElement(b.A,{gutter:10,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"left"},l.createElement(u.A.Item,{name:"minWidth"},l.createElement(j.A,{min:0,placeholder:t("Table min width"),prefix:l.createElement(O.A,{icon:"MinWidth"}),addonAfter:l.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},_t)})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"top"},l.createElement(u.A.Item,{name:"maxWidth"},l.createElement(j.A,{min:0,placeholder:t("Table max width"),prefix:l.createElement(O.A,{icon:"MaxWidth"}),addonAfter:l.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},_t)})))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),ge?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",W(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},ge?l.createElement(w.A,null):l.createElement(B.A,null)))),ge&&l.createElement(b.A,{gutter:10,style:{marginBottom:M?16:0}},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:C.formTableFieldBackgroundImageEnabled?z.formItemMarginBottomXS:z.formItemMarginBottomMD+4}},l.createElement(H.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),C.formTableFieldBackgroundImageEnabled&&l.createElement(E.A,{span:M?12:24},l.createElement("div",{style:{paddingBottom:M?4:0}},l.createElement(N.A,{form:a,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!M&&l.createElement(u.A.Item,{style:{marginBottom:"0"}},l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:z.formItemMarginBottomXS}},l.createElement(j.A,{placeholder:t("Horizontal position"),prefix:l.createElement(O.A,{icon:"BgPositionHorizontal"})})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:z.formItemMarginBottomXS}},l.createElement(j.A,{placeholder:t("Vertical position"),prefix:l.createElement(O.A,{icon:"BgPositionVertical"})}))))),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:z.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:"Please choose",options:_e,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:z.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:"Please choose",options:ye,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),C.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{K((e=>!e)),Y&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),r((e=>({...F.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},Y?l.createElement(w.A,null):l.createElement(B.A,null)))),Y&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(T.A,{borders:i}))),C.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{te((e=>!e)),ee?(t.borderRadiusAll=0,c(!0)):t.borderRadiusAll=5,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ee?l.createElement(w.A,null):l.createElement(B.A,null)))),ee&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(I.A,{form:a,oneBorderRadiusValue:s,setOneBorderRadiusValue:c,elementSettings:e}))),C.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ie((e=>!e)),ae?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},ae?l.createElement(w.A,null):l.createElement(B.A,null)))),ae&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(U,{boxShadow:d}))),C.formFieldExportAsPictureEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Export settings"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve&&(t.exportAsPicture=!1,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},ve?l.createElement(w.A,null):l.createElement(B.A,null)))),ve&&l.createElement(vt,{form:a,elementSettings:e})),C.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control")),l.createElement(b.A,{gutter:20},l.createElement(E.A,{span:12},l.createElement("div",{style:{paddingBottom:4}},l.createElement(fe,{elementSettings:e,form:a}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))))};var kt=o(10206);const Bt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,D.XW)(),[a]=u.A.useForm(),i=(0,Ve.rD)(),r=(0,n.d4)(Fe.Fv),d=(0,n.d4)(Fe.yy),[m,s]=(0,l.useState)({});(0,l.useEffect)((()=>{e&&a.setFieldsValue(e)}),[a,e]);return l.createElement(u.A,{form:a,layout:"vertical",name:"selected_link_form",initialValues:{href:"https://",target:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textReplacer:""},onValuesChange:t=>{o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off",className:"element-controls"},r&&"bottom"!==d?l.createElement(rt,{form:a,elementSettings:e,showAddParagraph:!1}):l.createElement(l.Fragment,null,l.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"left"},l.createElement(u.A.Item,{name:"href",style:{marginBottom:24,paddingRight:10}},l.createElement(_.A,{allowClear:!0,placeholder:"href",prefix:l.createElement(y.A,null),onSelect:({target:e})=>{const{selectionStart:t,selectionEnd:o}=e;e&&s({target:e,selection:{start:t,end:o}})}}))),i.formLinkFieldInsertImageEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Actions with the chosen text")),l.createElement(u.A.Item,null,l.createElement(f.Ay,{icon:l.createElement(kt.A,null),onClick:()=>{return e="add_img",void o({operation:F.Ru.SANDBOX_ELEMENT_TEXT,action:e});var e}},t("Add inline image")))),l.createElement(tt,{form:a,elementSettings:e,showAddParagraph:!1,linkTarget:m})))},wt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[o]=u.A.useForm(),a=(0,n.wA)(),i=(0,n.d4)(d.Hs),r=(0,D.XW)(),s=(0,n.d4)(Fe.Ct),c=(0,n.d4)(Fe.CS),h=(0,n.d4)(Fe.Fv),f=(0,n.d4)(Fe.yy),v=h&&"bottom"!==f,A=i.hasOwnProperty("type")?F.IE:F.Tm;(0,l.useEffect)((()=>{var t,l,a,i,r,n,d;e&&o.setFieldsValue({...e,height:null===(t=e.height)||void 0===t?void 0:t.value,heightDim:null===(l=e.height)||void 0===l?void 0:l.dim,mobileHeight:(d=(null===(a=e.mobileHeight)||void 0===a?void 0:a.value)||(null===(i=e.height)||void 0===i?void 0:i.value),d&&"auto"!==d?d:0===d?"0":""),mobileHeightDim:(null===(r=e.mobileHeight)||void 0===r?void 0:r.dim)||(null===(n=e.height)||void 0===n?void 0:n.dim)})}),[o,e]);const _=(0,l.useCallback)((e=>{a(A===F.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[a,A]);return l.createElement(u.A,{form:o,layout:"vertical",name:"selected_vindent_form",initialValues:{height:"",heightDim:"",mobileHeight:"",mobileHeightDim:""},onValuesChange:t=>{const l=o.getFieldsValue(!0),a=Object.keys(t)[0];let i;switch(a){case"height":i={[a]:{value:t[a],dim:l.heightDim}};break;case"heightDim":i={height:{value:l.height,dim:t[a]}};break;case"mobileHeight":i={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:l.mobileHeightDim}};break;case"mobileHeightDim":i={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[a]}};break;default:i=t}r({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:i}),_({...e,...i,activateSection:null,changeKey:a})},autoComplete:"off"},!v&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),s===F.ND&&c.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===F.ND&&c.styles?"block":"none",marginBottom:10}},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement(b.A,{gutter:10,style:{marginBottom:20}},l.createElement(E.A,{span:12},l.createElement(Z,{form:o,name:"mobileHeight",elementSettings:e}))))):l.createElement("div",{id:"selected_element_form_desktop_props",style:{display:s===F.ND&&c.styles?"none":"block"}},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:14},l.createElement(u.A.Item,{name:"height"},l.createElement(j.A,{min:0,placeholder:t("Indent height"),prefix:l.createElement(k.A,null),addonAfter:"px"})))))))};var xt=o(50078),Rt=o(35850);const Pt=({form:e,elementSettings:t})=>{const{__:o}=(0,L.s9)(),a=(0,D.XW)(),[i,r]=(0,l.useState)(t.direction),n=o=>{const l=o.target.value,n={direction:""};l!==i?r(l):(r(""),e.setFieldsValue(n),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:n}))};return l.createElement(u.A.Item,{name:"direction"},l.createElement(C.Ay.Group,null,l.createElement(A.A,{size:8},l.createElement(p.A,{placement:"top",title:o("Right to left")},l.createElement(C.Ay.Button,{value:"rtl",onClick:n},l.createElement(xt.A,null))),l.createElement(p.A,{placement:"top",title:o("Left to right")},l.createElement(C.Ay.Button,{value:"ltr",onClick:n},l.createElement(Rt.A,null))))))};Pt.defaultProps={};const Nt=Pt,{useToken:Tt}=c.A,It=({form:e,elementSettings:t,mobilePaddingsExt:o,setMobilePaddingsExt:a})=>{const{__:i}=(0,L.s9)(),{token:n}=Tt(),d=(0,D.XW)();return l.createElement(l.Fragment,null,l.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},l.createElement("div",{className:"padding-collapsed",style:{display:o?"block":"none"}},l.createElement(p.A,{title:i("Horizontal padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"mobilePaddingLeftRight"},l.createElement(j.A,{min:0,placeholder:i("Horizontal"),prefix:l.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:o?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:i("Left padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"mobilePaddingLeft",style:{marginBottom:n.formItemMarginBottomXS}},l.createElement(j.A,{min:0,placeholder:i("Left"),prefix:l.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:i("Right padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"mobilePaddingRight"},l.createElement(j.A,{min:0,placeholder:i("Right"),prefix:l.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),l.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},l.createElement("div",{className:"padding-collapsed",style:{display:o?"block":"none"}},l.createElement(p.A,{title:i("Vertical padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"mobilePaddingTopBottom"},l.createElement(j.A,{min:0,placeholder:i("Vertical"),prefix:l.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:o?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:i("Top padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"mobilePaddingTop",style:{marginBottom:n.formItemMarginBottomXS}},l.createElement(j.A,{min:0,placeholder:i("Top"),prefix:l.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:i("Bottom padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"mobilePaddingBottom"},l.createElement(j.A,{min:0,placeholder:i("Bottom"),prefix:l.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),l.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},l.createElement(p.A,{title:i("Individual padding"),placement:"bottom"},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!o}),onClick:()=>{a((e=>!e));const l=e.getFieldsValue(!0);o||(l.mobilePaddingLeftRight=l.mobilePaddingLeft,l.mobilePaddingTopBottom=l.mobilePaddingTop,l.mobilePaddingRight=l.mobilePaddingLeft,l.mobilePaddingBottom=l.mobilePaddingTop,d({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobilePadding:{top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,bottom:""!==l.mobilePaddingTopBottom?l.mobilePaddingTopBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,classNamePrefix:"em-mob-padding_"}}}))}},l.createElement(O.A,{icon:"PaddingSwitcher"})))))},Ct=({form:e,elementSettings:t})=>{var o;const{__:a}=(0,L.s9)(),[i,r]=(0,l.useState)(null===(o=t.mobileDirection)||void 0===o?void 0:o.value),n=(0,D.XW)(),d=o=>{const l=o.target.value,a={mobileDirection:{classNamePrefix:"em-mob-direction-",value:""}};l!==i?r(l):(r(""),e.setFieldsValue(a),n({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return l.createElement(u.A.Item,{name:"mobileDirection"},l.createElement(C.Ay.Group,null,l.createElement(A.A,{size:8},l.createElement(p.A,{placement:"top",title:a("Right to left")},l.createElement(C.Ay.Button,{value:"rtl",onClick:d},l.createElement(xt.A,null))),l.createElement(p.A,{placement:"top",title:a("Left to right")},l.createElement(C.Ay.Button,{value:"ltr",onClick:d},l.createElement(Rt.A,null))))))};Ct.defaultProps={};const Lt=Ct,{Option:Ot}=X.A,Ft=l.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},l.createElement(Ot,{value:"px"},"px"),l.createElement(Ot,{value:"%"},"%")),{useToken:Dt}=c.A,Mt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,D.XW)(),a=(0,n.wA)(),[i]=u.A.useForm(),[s,c]=(0,l.useState)(""),[v,y]=(0,l.useState)({}),[x,R]=(0,l.useState)({}),[P,C]=(0,l.useState)({}),[M,V]=(0,l.useState)(!0),[z,G]=(0,l.useState)(!0),$=(0,n.d4)(Fe.Ct),Y=(0,n.d4)(Fe.CS),K=(0,n.d4)(d.Hs),J=(0,Ve.rD)(),[ee,te]=(0,l.useState)(""===e.backgroundImage[0].value),{token:oe}=Dt(),le=(0,n.d4)(Fe.Fv),ae=(0,n.d4)(Fe.yy),ie=le&&"bottom"!==ae,[re,ne]=(0,l.useState)(!1),[de,me]=(0,l.useState)(!1),[se,ce]=(0,l.useState)(!1),[ue,be]=(0,l.useState)(!1),[Ee,he]=(0,l.useState)(!1),[ve,Ae]=(0,l.useState)(!1),[_e,ye]=(0,l.useState)(!1),[Se,ke]=(0,l.useState)(!1),[Be,we]=(0,l.useState)(!1),[xe,Re]=(0,l.useState)(!1),[Pe,Ne]=(0,l.useState)(!1),[Te,Ce]=(0,l.useState)(!1),[Le,Oe]=(0,l.useState)(!1),[De,Me]=(0,l.useState)(!1),We=K.hasOwnProperty("type")?F.IE:F.Tm,ze=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],je=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}];(0,l.useEffect)((()=>{if(e){var t,o,l,a,r,n,d,m,s,c,u,p,g,b,E,h,f,v,A,_,S,k,B,w,x,P,N,T,I,L,O,F,D,M,W,z,j,H,U,X,q,$,Y,K,Q,J,Z,ee,oe,le,ae,ie,re,de,se,ue,pe,ge,Ee,fe,ve,_e,Se,Be,xe,Pe,Te,Ie,Le,Fe,De,Ve,We,ze,je,He,Ue,Xe,qe,$e,Ye,Ke,Qe,Je,Ze,et,tt,ot,lt,at,it,rt,nt,dt,mt,st,ct,ut,pt,gt,bt,Et,ht,ft,vt,At,_t,yt,St,kt,Bt,wt,xt,Rt,Pt,Nt,Tt;const It=e.border,Ct=e.boxShadow,Lt=e.mobileBorder;y(It),C(Ct),R(Lt);const Ot=Object.keys(It).find((e=>{var t,o,l;return(null===(t=It[e])||void 0===t?void 0:t.width)||(null===(o=It[e])||void 0===o?void 0:o.style)||(null===(l=It[e])||void 0===l?void 0:l.color)})),Ft=Object.keys(Lt).find((e=>{var t,o,l;return(null===(t=Lt[e])||void 0===t?void 0:t.width)||(null===(o=Lt[e])||void 0===o?void 0:o.style)||(null===(l=Lt[e])||void 0===l?void 0:l.color)}));i.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(l=e.height)||void 0===l?void 0:l.value,heightDim:null===(a=e.height)||void 0===a?void 0:a.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",isContrastBlock:e.isContrastBlock,borderPosition:Ot||"all",borderWidth:(null===(r=It[Ot])||void 0===r?void 0:r.width)||"",borderColor:(null===(n=It[Ot])||void 0===n?void 0:n.color)||"",borderStyle:(null===(d=It[Ot])||void 0===d?void 0:d.style)||"",paddingTop:(0,Ge.ok)(null===(m=e.padding)||void 0===m?void 0:m.all)||(0,Ge.ok)(null===(s=e.padding)||void 0===s?void 0:s.top),paddingLeft:(0,Ge.ok)(null===(c=e.padding)||void 0===c?void 0:c.all)||(0,Ge.ok)(null===(u=e.padding)||void 0===u?void 0:u.left),paddingRight:(0,Ge.ok)(null===(p=e.padding)||void 0===p?void 0:p.all)||(0,Ge.ok)(null===(g=e.padding)||void 0===g?void 0:g.right),paddingBottom:(0,Ge.ok)(null===(b=e.padding)||void 0===b?void 0:b.all)||(0,Ge.ok)(null===(E=e.padding)||void 0===E?void 0:E.bottom),paddingLeftRight:(0,Ge.ok)(null===(h=e.padding)||void 0===h?void 0:h.left)||(0,Ge.ok)(null===(f=e.padding)||void 0===f?void 0:f.right),paddingTopBottom:(0,Ge.ok)(null===(v=e.padding)||void 0===v?void 0:v.top)||(0,Ge.ok)(null===(A=e.padding)||void 0===A?void 0:A.bottom),borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(_=e.boxShadow)||void 0===_?void 0:_.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(k=e.boxShadow)||void 0===k?void 0:k.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(B=e.boxShadow)||void 0===B?void 0:B.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(w=e.boxShadow)||void 0===w?void 0:w.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(x=e.boxShadow)||void 0===x?void 0:x.color),mobileWidth:(0,Ge.xc)(null===(P=e.mobileWidth)||void 0===P?void 0:P.value)||(0,Ge.xc)(null===(N=e.width)||void 0===N?void 0:N.value),mobileWidthDim:(0,Ge.xc)(null===(T=e.mobileWidth)||void 0===T?void 0:T.value)?null===(I=e.mobileWidth)||void 0===I?void 0:I.dim:null===(L=e.width)||void 0===L?void 0:L.dim,mobileHeight:(0,Ge.xc)(null===(O=e.mobileHeight)||void 0===O?void 0:O.value)||(0,Ge.xc)(null===(F=e.height)||void 0===F?void 0:F.value),mobileHeightDim:(0,Ge.xc)(null===(D=e.mobileHeight)||void 0===D?void 0:D.value)?null===(M=e.mobileHeight)||void 0===M?void 0:M.dim:null===(W=e.height)||void 0===W?void 0:W.dim,mobileBorderPosition:Ft||Ot||"all",mobileBorderWidth:(null===(z=Lt[Ft])||void 0===z?void 0:z.width)||(null===(j=It[Ot])||void 0===j?void 0:j.width)||"",mobileBorderColor:(null===(H=Lt[Ft])||void 0===H?void 0:H.color)||(null===(U=It[Ot])||void 0===U?void 0:U.color)||"",mobileBorderStyle:(null===(X=Lt[Ft])||void 0===X?void 0:X.style)||(null===(q=It[Ot])||void 0===q?void 0:q.style)||"",mobileBorderRadiusAll:(0,Ge.ok)(null===($=e.mobileBorderRadius)||void 0===$?void 0:$.all)||(0,Ge.ok)(null===(Y=e.borderRadius)||void 0===Y?void 0:Y.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null===(K=e.mobileBorderRadius)||void 0===K?void 0:K.topLeft)||(0,Ge.ok)(null===(Q=e.mobileBorderRadius)||void 0===Q?void 0:Q.all)||(0,Ge.ok)(null===(J=e.borderRadius)||void 0===J?void 0:J.topLeft)||(0,Ge.ok)(null===(Z=e.borderRadius)||void 0===Z?void 0:Z.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null===(ee=e.mobileBorderRadius)||void 0===ee?void 0:ee.bottomLeft)||(0,Ge.ok)(null===(oe=e.mobileBorderRadius)||void 0===oe?void 0:oe.all)||(0,Ge.ok)(null===(le=e.borderRadius)||void 0===le?void 0:le.bottomLeft)||(0,Ge.ok)(null===(ae=e.borderRadius)||void 0===ae?void 0:ae.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null===(ie=e.mobileBorderRadius)||void 0===ie?void 0:ie.topRight)||(0,Ge.ok)(null===(re=e.mobileBorderRadius)||void 0===re?void 0:re.all)||(0,Ge.ok)(null===(de=e.borderRadius)||void 0===de?void 0:de.topRight)||(0,Ge.ok)(null===(se=e.borderRadius)||void 0===se?void 0:se.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null===(ue=e.mobileBorderRadius)||void 0===ue?void 0:ue.bottomRight)||(0,Ge.ok)(null===(pe=e.mobileBorderRadius)||void 0===pe?void 0:pe.all)||(0,Ge.ok)(null===(ge=e.borderRadius)||void 0===ge?void 0:ge.bottomRight)||(0,Ge.ok)(null===(Ee=e.borderRadius)||void 0===Ee?void 0:Ee.all),mobileBoxShadowInset:null!=(null===(fe=e.mobileBoxShadow)||void 0===fe?void 0:fe.inset)?e.mobileBoxShadow.inset:(null===(ve=e.boxShadow)||void 0===ve?void 0:ve.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(_e=e.mobileBoxShadow)||void 0===_e?void 0:_e.hOffset)||(0,Ge.ok)(null===(Se=e.boxShadow)||void 0===Se?void 0:Se.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(Be=e.mobileBoxShadow)||void 0===Be?void 0:Be.vOffset)||(0,Ge.ok)(null===(xe=e.boxShadow)||void 0===xe?void 0:xe.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(Pe=e.mobileBoxShadow)||void 0===Pe?void 0:Pe.blurRadius)||(0,Ge.ok)(null===(Te=e.boxShadow)||void 0===Te?void 0:Te.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(Ie=e.mobileBoxShadow)||void 0===Ie?void 0:Ie.spreadRadius)||(0,Ge.ok)(null===(Le=e.boxShadow)||void 0===Le?void 0:Le.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(Fe=e.mobileBoxShadow)||void 0===Fe?void 0:Fe.color)||(0,Ge.ok)(null===(De=e.boxShadow)||void 0===De?void 0:De.color),mobileAlign:(0,Ge.ok)(null===(Ve=e.mobileAlign)||void 0===Ve?void 0:Ve.value)||e.align,mobileVerticalAlign:(0,Ge.ok)((null===(We=e.mobileVerticalAlign)||void 0===We?void 0:We.value)||e.valign),mobileBackgroundColor:(0,Ge.ok)((null===(ze=e.mobileBackgroundColor)||void 0===ze?void 0:ze.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(je=e.mobileBackgroundImage[0])||void 0===je?void 0:je.value)?null===(He=e.mobileBackgroundImage[0])||void 0===He?void 0:He.value:(null===(Ue=e.backgroundImage)||void 0===Ue?void 0:Ue[0].value)||"",mobileBackgroundPositionX:(0,Ge.ok)(null===(Xe=e.mobileBackgroundPositionX)||void 0===Xe?void 0:Xe.value)||(0,Ge.ok)(null===(qe=e.backgroundPositionX)||void 0===qe?void 0:qe.value),mobileBackgroundPositionY:(0,Ge.ok)(null===($e=e.mobileBackgroundPositionY)||void 0===$e?void 0:$e.value)||(0,Ge.ok)(null===(Ye=e.backgroundPositionY)||void 0===Ye?void 0:Ye.value),mobileBackgroundRepeat:!(null===(Ke=e.mobileBackgroundRepeat)||void 0===Ke||!Ke.value)||e.backgroundRepeat||"none",mobilePaddingTop:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(null===(Qe=e.padding)||void 0===Qe?void 0:Qe.all)||(0,Ge.ok)(null===(Je=e.padding)||void 0===Je?void 0:Je.top),mobilePaddingLeft:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.left)||(0,Ge.ok)(null===(Ze=e.padding)||void 0===Ze?void 0:Ze.all)||(0,Ge.ok)(null===(et=e.padding)||void 0===et?void 0:et.left),mobilePaddingRight:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(null===(tt=e.padding)||void 0===tt?void 0:tt.all)||(0,Ge.ok)(null===(ot=e.padding)||void 0===ot?void 0:ot.right),mobilePaddingBottom:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(null===(lt=e.padding)||void 0===lt?void 0:lt.all)||(0,Ge.ok)(null===(at=e.padding)||void 0===at?void 0:at.bottom),mobilePaddingTopBottom:(0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(null===(it=e.padding)||void 0===it?void 0:it.top)||(0,Ge.ok)(null===(rt=e.padding)||void 0===rt?void 0:rt.bottom),mobilePaddingLeftRight:(0,Ge.ok)(e.mobilePadding.left)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(null===(nt=e.padding)||void 0===nt?void 0:nt.left)||(0,Ge.ok)(null===(dt=e.padding)||void 0===dt?void 0:dt.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?V(!1):V(!0),(0,Ge.ok)(e.mobileBorderRadius.all)||(0,Ge.ok)(null===(mt=e.borderRadius)||void 0===mt?void 0:mt.all)||!((0,Ge.ok)(null===(st=e.borderRadius)||void 0===st?void 0:st.topLeft)||(0,Ge.ok)(null===(ct=e.borderRadius)||void 0===ct?void 0:ct.bottomLeft)||(0,Ge.ok)(null===(ut=e.borderRadius)||void 0===ut?void 0:ut.topRight)||(0,Ge.ok)(null===(pt=e.borderRadius)||void 0===pt?void 0:pt.bottomRight))?G(!0):G(!1),te(""===e.backgroundImage[0].value),(0,Ge.ok)(e.padding.all)||!((0,Ge.ok)(e.padding.top)||(0,Ge.ok)(e.padding.right)||(0,Ge.ok)(e.padding.bottom)||(0,Ge.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?ne(!0):ne(!1),!(0,Ge.ok)(e.mobilePadding.all)&&((0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(e.mobilePadding.left))&&(e.mobilePadding.top!==e.mobilePadding.bottom||e.mobilePadding.right!==e.mobilePadding.left)||!(0,Ge.ok)(null===(gt=e.padding)||void 0===gt?void 0:gt.all)&&((0,Ge.ok)(null===(bt=e.padding)||void 0===bt?void 0:bt.top)||(0,Ge.ok)(null===(Et=e.padding)||void 0===Et?void 0:Et.right)||(0,Ge.ok)(null===(ht=e.padding)||void 0===ht?void 0:ht.bottom)||(0,Ge.ok)(null===(ft=e.padding)||void 0===ft?void 0:ft.left))&&((null===(vt=e.padding)||void 0===vt?void 0:vt.top)!==(null===(At=e.padding)||void 0===At?void 0:At.bottom)||(null===(_t=e.padding)||void 0===_t?void 0:_t.right)!==(null===(yt=e.padding)||void 0===yt?void 0:yt.left))?me(!1):me(!0),ce(!(null===(St=It[Ot])||void 0===St||!St.width)||!(null===(kt=It[Ot])||void 0===kt||!kt.style)||!(null===(Bt=It[Ot])||void 0===Bt||!Bt.color)),be(!(null===(wt=Lt[Ft])||void 0===wt||!wt.width)||!(null===(xt=Lt[Ft])||void 0===xt||!xt.style)||!(null===(Rt=Lt[Ft])||void 0===Rt||!Rt.color)||!(null===(Pt=It[Ot])||void 0===Pt||!Pt.width)||!(null===(Nt=It[Ot])||void 0===Nt||!Nt.style)||!(null===(Tt=It[Ot])||void 0===Tt||!Tt.color)),he(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),Ae(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight||!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ye(!!e.boxShadow),ke(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),we(!!e.width.value&&"column"!==e.type||!!e.height.value),Re(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value&&"column"!==e.type||!!e.height.value),Ne(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Ce(!!e.mobileBackgroundColor.value||!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Oe(!!e.exportAsPicture||!!e.isContrastBlock),Me(!!e.mobilePadding.all||0===e.mobilePadding.all||!!e.mobilePadding.top||0===e.mobilePadding.top||!!e.mobilePadding.bottom||0===e.mobilePadding.bottom||!!e.mobilePadding.left||0===e.mobilePadding.left||!!e.mobilePadding.right||0===e.mobilePadding.right||!!e.padding.all||0===e.padding.all||!!e.padding.top||0===e.padding.top||!!e.padding.bottom||0===e.padding.bottom||!!e.padding.left||0===e.padding.left||!!e.padding.right||0===e.padding.right)}}),[i,e]);const He=(0,l.useCallback)((e=>{a(We===F.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[a,We]);return l.createElement(u.A,{form:i,layout:"vertical",name:"selected_td_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",boxShadowInset:"",boxShadowHOffset:"",boxShadowVOffset:"",boxShadowBlurRadius:"",boxShadowSpreadRadius:"",boxShadowColor:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1},onValuesChange:t=>{const l=i.getFieldsValue(!0),a=Object.keys(t)[0];let r;switch(c("%"===i.getFieldsValue(!0).widthDim?100:""),a){case"exportAsPicture":r={exportAsPicture:l.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":r={boxShadow:{hOffset:l.boxShadowHOffset,vOffset:l.boxShadowVOffset,blurRadius:l.boxShadowBlurRadius,spreadRadius:l.boxShadowSpreadRadius,color:l.boxShadowColor,inset:l.boxShadowInset}};break;case"borderStyle":r={border:{[l.borderPosition]:{...v[l.borderPosition],style:t[a]}}},"all"===l.borderPosition?y((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],style:t[a]}}))):y((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],style:t[a]}})));break;case"borderColor":r={border:{[l.borderPosition]:{...v[l.borderPosition],color:t[a]}}},"all"===l.borderPosition?y((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],color:t[a]}}))):y((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],color:t[a]}})));break;case"borderWidth":r={border:{[l.borderPosition]:{...v[l.borderPosition],width:t[a]}}},"all"===l.borderPosition?y((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],width:t[a]}}))):y((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],width:t[a]}})));break;case"borderPosition":i.setFieldsValue({borderWidth:v[t[a]].width||"",borderColor:v[t[a]].color||"",borderStyle:v[t[a]].style||""});break;case"width":r={[a]:{value:t[a],dim:l.widthDim}};break;case"height":r={[a]:{value:t[a],dim:l.heightDim}};break;case"widthDim":r={width:{value:l.width,dim:t[a]}};break;case"heightDim":r={height:{value:l.height,dim:t[a]}};break;case"backgroundImage":te(""===t[a]),r={[a]:[{...e.backgroundImage[0],value:t[a]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{left:l.paddingLeft,right:l.paddingRight,top:l.paddingTop,bottom:l.paddingBottom,[Ge.yy[a]]:+t[a]}};break;case"paddingTopBottom":r={padding:{left:l.paddingLeft,right:l.paddingRight,top:+t[a],bottom:+t[a]}},l.paddingTop=l.paddingBottom=+t[a];break;case"paddingLeftRight":r={padding:{top:l.paddingTop,bottom:l.paddingBottom,left:+t[a],right:+t[a]}},l.paddingLeft=l.paddingRight=+t[a];break;case"borderRadiusAll":r={borderRadius:{[F.wF[a]]:+t[a]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{topLeft:l.borderRadiusTopLeft,bottomLeft:l.borderRadiusBottomLeft,topRight:l.borderRadiusTopRight,bottomRight:l.borderRadiusBottomRight,[F.wF[a]]:+t[a]}};break;case"mobileWidth":r={[a]:{classNamePrefix:"em-mob-width-",value:t[a],dim:l.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth,dim:t[a]}};break;case"mobileHeight":r={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:l.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[a]}};break;case"mobileBorderStyle":r={mobileBorder:{[l.mobileBorderPosition]:{...x[l.mobileBorderPosition],style:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?R((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):R((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":r={mobileBorder:{[l.mobileBorderPosition]:{...x[l.mobileBorderPosition],color:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?R((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):R((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":r={mobileBorder:{[l.mobileBorderPosition]:{...x[l.mobileBorderPosition],width:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?R((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):R((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[a],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":i.setFieldsValue({mobileBorderWidth:x[t[a]].width||"",mobileBorderColor:x[t[a]].color||"",mobileBorderStyle:x[t[a]].style||""});break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[Ge.NW[a]]:+t[a],classNamePrefix:"em-mob-border_radius_"+Ge.NW[a]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":r={mobileBoxShadow:{hOffset:l.mobileBoxShadowHOffset,vOffset:l.mobileBoxShadowVOffset,blurRadius:l.mobileBoxShadowBlurRadius,spreadRadius:l.mobileBoxShadowSpreadRadius,color:l.mobileBoxShadowColor,inset:l.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":r={[a]:{classNamePrefix:"em-mob-text_align-",value:t[a]}};break;case"mobileVerticalAlign":r={[a]:{classNamePrefix:"em-mob-vertical_align-",value:t[a]}};break;case"mobileBackgroundColor":r={[a]:{classNamePrefix:"em-mob-background_color-",value:t[a]}};break;case"mobileBackgroundImage":r={[a]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[a]}]};break;case"mobileBackgroundPositionX":r={[a]:{classNamePrefix:"em-mob-background_position_x-",value:t[a]}};break;case"mobileBackgroundPositionY":r={[a]:{classNamePrefix:"em-mob-background_position_y-",value:t[a]}};break;case"mobileBackgroundRepeat":r={[a]:{classNamePrefix:"em-mob-background_repeat-",value:t[a]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":r={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":l.mobilePaddingTop=l.mobilePaddingBottom=t[a],r={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":l.mobilePaddingLeft=l.mobilePaddingRight=t[a],r={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;default:r=t}var n;"borderPosition"!==a&&(o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),He({...e,...r,mobileBorderRadius:{...e.mobileBorderRadius,...null===(n=r)||void 0===n?void 0:n.mobileBorderRadius},activateSection:null,changeKey:a}))},autoComplete:"off",className:"element-controls"},!ie&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),$===F.ND&&Y.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:$===F.ND&&Y.styles?"block":"none"}},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement(b.A,{gutter:20},l.createElement(E.A,{span:12},l.createElement(pe,{form:i,elementSettings:e,imgParent:!0})),J.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(ge,{form:i,elementSettings:e}))),l.createElement(h.A,{className:"selected-td-form__divider"}),J.formCellFieldPaddingsEnabled&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Padding"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Me((e=>!e)),De&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},De?l.createElement(w.A,null):l.createElement(B.A,null)))),De&&l.createElement(b.A,{gutter:10,style:{paddingBottom:4}},l.createElement(l.Fragment,null,l.createElement(It,{form:i,elementSettings:e,mobilePaddingsExt:de,setMobilePaddingsExt:me}))),l.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),xe&&(t.mobileWidth="",t.mobileHeight="",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},xe?l.createElement(w.A,null):l.createElement(B.A,null)))),xe&&l.createElement(b.A,{gutter:10,style:{paddingBottom:9}},"structure"!==e.type&&l.createElement(E.A,{span:12},l.createElement("div",{style:{marginBottom:15}},l.createElement(Q,{form:i,name:"mobileWidth",elementSettings:e}))),l.createElement(E.A,{span:12},l.createElement("div",{style:{marginBottom:15}},l.createElement(Z,{form:i,name:"mobileHeight",elementSettings:e})))),l.createElement(h.A,{className:"selected-td-form__divider"})),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ce((e=>!e)),t.mobileBackgroundColor=Te?"":"#E5E5E5",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Te?l.createElement(w.A,null):l.createElement(B.A,null)))),Te&&l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:(J.formCellFieldBackgroundImageEnabled,oe.formItemMarginBottomMD+4)}},l.createElement(ft,{form:i,elementSettings:e,label:t("Background color")}))),!1,J.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),ue&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),R((e=>({...F.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},ue?l.createElement(w.A,null):l.createElement(B.A,null)))),ue&&l.createElement("div",{style:{marginBottom:4}},l.createElement(T.A,{borders:x,typeOfForm:"mobile"}))),J.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve?(t.mobileBorderRadiusAll=null,G(!0)):t.mobileBorderRadiusAll=5,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},ve?l.createElement(w.A,null):l.createElement(B.A,null)))),ve&&l.createElement("div",{style:{marginBottom:4}},l.createElement(I.A,{form:i,oneBorderRadiusValue:z,setOneBorderRadiusValue:G,elementSettings:e,typeOfForm:"mobile"}))),J.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ke((e=>!e)),Se?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},Se?l.createElement(w.A,null):l.createElement(B.A,null)))),Se&&l.createElement("div",{style:{marginBottom:4}},l.createElement(U,{boxShadow:P,typeOfForm:"mobile"}))),J.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(fe,{elementSettings:e,form:i})),"group"!==e.type&&l.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},l.createElement(Lt,{elementSettings:e,form:i})))),J.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))):l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(b.A,{gutter:10,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(Je.A,{form:i,elementSettings:e})),J.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(W.A,{form:i,elementSettings:e}))),l.createElement(h.A,{className:"selected-td-form__divider"}),J.formCellFieldPaddingsEnabled&&l.createElement(l.Fragment,null,l.createElement("div",{className:"form-group-title"},t("Padding")),l.createElement(b.A,{gutter:10,style:{paddingBottom:4}},l.createElement(l.Fragment,null,"group"!==e.type&&"column"!==e.type&&l.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},l.createElement("div",{className:"padding-collapsed",style:{display:re?"block":"none"}},l.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingLeftRight"},l.createElement(j.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:l.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:re?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:300,placeholder:t("Left"),prefix:l.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingRight"},l.createElement(j.A,{min:0,max:300,placeholder:t("Right"),prefix:l.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),l.createElement(E.A,{span:10,style:{width:"group"!==e.type&&"column"!==e.type?156:45,flex:"auto",maxWidth:"44%"}},l.createElement("div",{className:"padding-collapsed",style:{display:re?"block":"none"}},l.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingTopBottom"},l.createElement(j.A,{min:0,max:300,placeholder:t("Vertical"),prefix:l.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:re?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:300,placeholder:t("Top"),prefix:l.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingBottom"},l.createElement(j.A,{min:0,max:300,placeholder:t("Bottom"),prefix:l.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),l.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},l.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!re}),onClick:()=>{ne((e=>!e));const t=i.getFieldsValue(!0);re||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},l.createElement(O.A,{icon:"PaddingSwitcher"})))))),l.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{we((e=>!e)),Be&&(t.width="",t.height="",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},height:{value:null,dim:"px"}}}))}))}},Be?l.createElement(w.A,null):l.createElement(B.A,null)))),Be&&l.createElement(b.A,{gutter:10,style:{paddingBottom:4}},"structure"!==e.type&&"column"!==e.type&&l.createElement(E.A,{span:12},l.createElement(p.A,{title:t("Width"),placement:"bottom"},l.createElement(u.A.Item,{name:"width",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:s,placeholder:t("Width"),prefix:l.createElement(S.A,null),addonAfter:l.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Ft)})))),l.createElement(E.A,{span:12},l.createElement(p.A,{title:t("Height"),placement:"bottom"},l.createElement(u.A.Item,{name:"height"},l.createElement(j.A,{min:0,placeholder:t("Height"),prefix:l.createElement(k.A,null),addonAfter:"px"}))))),l.createElement(h.A,{className:"selected-td-form__divider"})),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ne((e=>!e)),Pe?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",te(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},Pe?l.createElement(w.A,null):l.createElement(B.A,null)))),Pe&&l.createElement(b.A,{gutter:10,style:{marginBottom:ee?16:0}},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:J.formCellFieldBackgroundImageEnabled?oe.formItemMarginBottomXS:oe.formItemMarginBottomMD+4}},l.createElement(H.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),J.formCellFieldBackgroundImageEnabled&&l.createElement(E.A,{span:ee?12:24},l.createElement(N.A,{form:i,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"}),!ee&&l.createElement(u.A.Item,{style:{marginBottom:"0"}},l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Horizontal position"),prefix:l.createElement(O.A,{icon:"BgPositionHorizontal"})})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Vertical position"),prefix:l.createElement(O.A,{icon:"BgPositionVertical"})}))))),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:oe.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:t("Please choose"),options:ze,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:oe.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:t("Please choose"),options:je,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),J.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ce((e=>!e)),se&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),y((e=>({...F.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},se?l.createElement(w.A,null):l.createElement(B.A,null)))),se&&l.createElement("div",{style:{marginBottom:4}},l.createElement(T.A,{borders:v}))),J.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{he((e=>!e)),Ee?(t.borderRadiusAll=0,V(!0)):t.borderRadiusAll=5,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},Ee?l.createElement(w.A,null):l.createElement(B.A,null)))),Ee&&l.createElement("div",{style:{marginBottom:4}},l.createElement(I.A,{form:i,oneBorderRadiusValue:M,setOneBorderRadiusValue:V,elementSettings:e}))),J.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ye((e=>!e)),_e?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},_e?l.createElement(w.A,null):l.createElement(B.A,null)))),_e&&l.createElement("div",{style:{marginBottom:4}},l.createElement(U,{boxShadow:P}))),J.formFieldExportAsPictureEnabled&&"group"!==e.type&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Settings"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Oe((e=>!e)),Le&&(t.exportAsPicture=!1,t.isContrastBlock=!1,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1,isContrastBlock:!1}}))}))}},Le?l.createElement(w.A,null):l.createElement(B.A,null)))),Le&&l.createElement(l.Fragment,null,"structure"===e.type&&l.createElement(p.A,{title:t("The block will change its colors to contrasting colors. You can change them in the Content Styles section."),key:"isContrastBlock"},l.createElement(A.A,{size:10,align:"baseline"},l.createElement(u.A.Item,{name:"isContrastBlock",valuePropName:"checked",style:{marginBottom:0}},l.createElement(q.A,{size:"small",id:"contrast-colors"})),l.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"contrast-colors"},t("Contrast block"))))),l.createElement(vt,{form:i,elementSettings:e}))),J.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(fe,{elementSettings:e,form:i})),"group"!==e.type&&l.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},l.createElement(Nt,{elementSettings:e,form:i})))),J.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))))},{Option:Vt}=X.A,Wt=l.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},l.createElement(Vt,{value:"px"},"px"),l.createElement(Vt,{value:"%"},"%")),{useToken:zt}=c.A,Gt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,D.XW)(),[a]=u.A.useForm(),[i,d]=(0,l.useState)({}),[m,s]=(0,l.useState)({}),[c,v]=(0,l.useState)(!0),[A,y]=(0,l.useState)({}),[x,R]=(0,l.useState)({}),[P,C]=(0,l.useState)(!0),M=(0,n.d4)(Fe.Ct),V=(0,n.d4)(Fe.CS),z=(0,Ve.rD)(),[G,q]=(0,l.useState)(""===e.backgroundImage[0].value),{token:$}=zt(),Y=(0,n.d4)(Fe.Fv),K=(0,n.d4)(Fe.yy),J=Y&&"bottom"!==K,[ee,te]=(0,l.useState)(!1),[oe,le]=(0,l.useState)(!1),[ae,ie]=(0,l.useState)(!1),[re,ne]=(0,l.useState)(!1),[de,me]=(0,l.useState)(!1),[se,ue]=(0,l.useState)(!1),[pe,be]=(0,l.useState)(!1),[Ee,he]=(0,l.useState)(!1),[ve,Ae]=(0,l.useState)(!1),[_e,ye]=(0,l.useState)(!1),[Se,ke]=(0,l.useState)(!1),[Be,we]=(0,l.useState)(!1),[xe,Re]=(0,l.useState)(!1),[Pe,Ne]=(0,l.useState)(!1),[Te,Ce]=(0,l.useState)(!1),[Le,Oe]=(0,l.useState)(""),De=[{label:t("Not defined"),value:"none"},{label:t("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:t("Repeat background (repeat)"),value:"repeat"},{label:t("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:t("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Me=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}];(0,l.useEffect)((()=>{if(e){var t,o,l,i,r,n,m,c,u,p,g,b,E,h,f,A,_,S,k,B,w,x,P,N,T,I,L,O,F,D,M,V,W,z,G,j,H,U,X,$,Y,K,Q,J,Z,ee,oe,ae,re,de,se,ce,pe,ge,Ee;const fe=e.border,ve=e.boxShadow,_e=e.mobileBorder,Se=e.mobileBoxShadow;d(fe),s(ve),y(_e),R(Se);const Be=Object.keys(fe).find((e=>{var t,o,l;return(null===(t=fe[e])||void 0===t?void 0:t.width)||(null===(o=fe[e])||void 0===o?void 0:o.style)||(null===(l=fe[e])||void 0===l?void 0:l.color)})),xe=Object.keys(_e).find((e=>{var t,o,l;return(null===(t=_e[e])||void 0===t?void 0:t.width)||(null===(o=_e[e])||void 0===o?void 0:o.style)||(null===(l=_e[e])||void 0===l?void 0:l.color)}));a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(l=e.height)||void 0===l?void 0:l.value,heightDim:null===(i=e.height)||void 0===i?void 0:i.dim,maxWidth:null===(r=e.maxWidth)||void 0===r?void 0:r.value,maxWidthDim:null===(n=e.maxWidth)||void 0===n?void 0:n.dim,minWidth:null===(m=e.minWidth)||void 0===m?void 0:m.value,minWidthDim:null===(c=e.minWidth)||void 0===c?void 0:c.dim,backgroundImage:e.backgroundImage[0].value,show:e.show?e.show:"all",borderPosition:Be||"all",borderWidth:(null===(u=fe[Be])||void 0===u?void 0:u.width)||"",borderColor:(null===(p=fe[Be])||void 0===p?void 0:p.color)||"",borderStyle:(null===(g=fe[Be])||void 0===g?void 0:g.style)||"",paddingTop:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.top),paddingLeft:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.left),paddingRight:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.right),paddingBottom:(0,Ge.ok)(e.padding.all)||(0,Ge.ok)(e.padding.bottom),paddingLeftRight:(0,Ge.ok)(null===(b=e.padding)||void 0===b?void 0:b.left)||(0,Ge.ok)(null===(E=e.padding)||void 0===E?void 0:E.right),paddingTopBottom:(0,Ge.ok)(null===(h=e.padding)||void 0===h?void 0:h.top)||(0,Ge.ok)(null===(f=e.padding)||void 0===f?void 0:f.bottom),borderRadiusAll:(0,Ge.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,Ge.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,Ge.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,Ge.ok)(null===(A=e.boxShadow)||void 0===A?void 0:A.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(_=e.boxShadow)||void 0===_?void 0:_.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(k=e.boxShadow)||void 0===k?void 0:k.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(B=e.boxShadow)||void 0===B?void 0:B.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(w=e.boxShadow)||void 0===w?void 0:w.color),mobileWidth:(0,Ge.xc)(null===(x=e.mobileWidth)||void 0===x?void 0:x.value),mobileWidthDim:null===(P=e.mobileWidth)||void 0===P?void 0:P.dim,mobileHeight:(0,Ge.xc)(null===(N=e.mobileHeight)||void 0===N?void 0:N.value),mobileHeightDim:null===(T=e.mobileHeight)||void 0===T?void 0:T.dim,mobileBorderPosition:xe||"all",mobileBorderWidth:null!==(null===(I=_e[xe])||void 0===I?void 0:I.width)?null===(L=_e[xe])||void 0===L?void 0:L.width:"",mobileBorderColor:(null===(O=_e[xe])||void 0===O?void 0:O.color)||"",mobileBorderStyle:(null===(F=_e[xe])||void 0===F?void 0:F.style)||"",mobileBorderRadiusAll:(0,Ge.ok)(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,Ge.ok)(null===(D=e.mobileBoxShadow)||void 0===D?void 0:D.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(M=e.mobileBoxShadow)||void 0===M?void 0:M.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(V=e.mobileBoxShadow)||void 0===V?void 0:V.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(W=e.mobileBoxShadow)||void 0===W?void 0:W.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(z=e.mobileBoxShadow)||void 0===z?void 0:z.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(G=e.mobileBoxShadow)||void 0===G?void 0:G.color),mobileAlign:(0,Ge.ok)(null===(j=e.mobileAlign)||void 0===j?void 0:j.value),mobileVerticalAlign:(0,Ge.ok)(null===(H=e.mobileVerticalAlign)||void 0===H?void 0:H.value),mobileDirection:(0,Ge.ok)(null===(U=e.mobileDirection)||void 0===U?void 0:U.value),mobileBackgroundColor:(0,Ge.ok)("none"!==(null===(X=e.mobileBackgroundColor)||void 0===X?void 0:X.value)?null===($=e.mobileBackgroundColor)||void 0===$?void 0:$.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,Ge.ok)(null===(Y=e.mobileBackgroundPositionX)||void 0===Y?void 0:Y.value),mobileBackgroundPositionY:(0,Ge.ok)(null===(K=e.mobileBackgroundPositionY)||void 0===K?void 0:K.value),mobileBackgroundRepeat:null!==(Q=e.mobileBackgroundRepeat)&&void 0!==Q&&Q.value?null===(J=e.mobileBackgroundRepeat)||void 0===J?void 0:J.value:"none",mobilePaddingTop:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.top),mobilePaddingLeft:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.left),mobilePaddingRight:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.right),mobilePaddingBottom:(0,Ge.ok)(e.mobilePadding.all)||(0,Ge.ok)(e.mobilePadding.bottom),mobilePaddingTopBottom:(0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.bottom),mobilePaddingLeftRight:(0,Ge.ok)(e.mobilePadding.left)||(0,Ge.ok)(e.mobilePadding.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,Ge.ok)(e.borderRadius.all)&&((0,Ge.ok)(e.borderRadius.topLeft)||(0,Ge.ok)(e.borderRadius.bottomLeft)||(0,Ge.ok)(e.borderRadius.topRight)||(0,Ge.ok)(e.borderRadius.bottomRight))?v(!1):v(!0),!(0,Ge.ok)(e.mobileBorderRadius.all)&&((0,Ge.ok)(e.mobileBorderRadius.topLeft)||(0,Ge.ok)(e.mobileBorderRadius.bottomLeft)||(0,Ge.ok)(e.mobileBorderRadius.topRight)||(0,Ge.ok)(e.mobileBorderRadius.bottomRight))?C(!1):C(!0),q(""===e.backgroundImage[0].value),(0,Ge.ok)(e.padding.all)||!((0,Ge.ok)(e.padding.top)||(0,Ge.ok)(e.padding.right)||(0,Ge.ok)(e.padding.bottom)||(0,Ge.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?te(!0):te(!1),(0,Ge.ok)(e.mobilePadding.all)||!((0,Ge.ok)(e.mobilePadding.top)||(0,Ge.ok)(e.mobilePadding.right)||(0,Ge.ok)(e.mobilePadding.bottom)||(0,Ge.ok)(e.mobilePadding.left))||e.mobilePadding.top===e.mobilePadding.bottom&&e.mobilePadding.right===e.mobilePadding.left?le(!0):le(!1),ie(!(null===(Z=fe[Be])||void 0===Z||!Z.width)||!(null===(ee=fe[Be])||void 0===ee||!ee.style)||!(null===(oe=fe[Be])||void 0===oe||!oe.color)),ne(!(null===(ae=_e[xe])||void 0===ae||!ae.width)||!(null===(re=_e[xe])||void 0===re||!re.style)||!(null===(de=_e[xe])||void 0===de||!de.color)),me(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ue(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),be(!!e.boxShadow),he(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),Ae(!!e.width.value||!!e.height.value||!!e.minWidth.value||!!e.maxWidth.value),ye(!!e.mobileWidth.value||!!e.mobileHeight.value),ke(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),we(!!e.mobileBackgroundColor.value),Re(!!e.exportAsPicture),Ne(!(null===(se=e.padding)||void 0===se||!se.all)||!(null===(ce=e.padding)||void 0===ce||!ce.top)||!(null===(pe=e.padding)||void 0===pe||!pe.bottom)||!(null===(ge=e.padding)||void 0===ge||!ge.left)||!(null===(Ee=e.padding)||void 0===Ee||!Ee.right)),Ce(!!e.mobilePadding.all||!!e.mobilePadding.top||!!e.mobilePadding.bottom||!!e.mobilePadding.left||!!e.mobilePadding.right)}}),[a,e]);return l.createElement(u.A,{form:a,layout:"vertical",name:"selected_div_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",maxWidth:{value:"",dim:""},minWidth:{value:"",dim:""},align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileDirection:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:""},onValuesChange:t=>{const l=a.getFieldsValue(!0),r=Object.keys(t)[0];let n;switch(Oe("%"===a.getFieldsValue(!0).widthDim?100:""),r){case"exportAsPicture":n={exportAsPicture:l.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":n={boxShadow:{hOffset:l.boxShadowHOffset,vOffset:l.boxShadowVOffset,blurRadius:l.boxShadowBlurRadius,spreadRadius:l.boxShadowSpreadRadius,color:l.boxShadowColor,inset:l.boxShadowInset}};break;case"borderStyle":n={border:{[l.borderPosition]:{...i[l.borderPosition],style:t[r]}}},"all"===l.borderPosition?d((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],style:t[r]}}))):d((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],style:t[r]}})));break;case"borderColor":n={border:{[l.borderPosition]:{...i[l.borderPosition],color:t[r]}}},"all"===l.borderPosition?d((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],color:t[r]}}))):d((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],color:t[r]}})));break;case"borderWidth":n={border:{[l.borderPosition]:{...i[l.borderPosition],width:t[r]}}},"all"===l.borderPosition?d((e=>({...F.iV,[l.borderPosition]:{...e[l.borderPosition],width:t[r]}}))):d((e=>({...e,[l.borderPosition]:{...e[l.borderPosition],width:t[r]}})));break;case"borderPosition":a.setFieldsValue({borderWidth:i[t[r]].width||"",borderColor:i[t[r]].color||"",borderStyle:i[t[r]].style||""});break;case"width":n={[r]:{value:t[r],dim:l.widthDim}};break;case"height":n={[r]:{value:t[r],dim:l.heightDim}};break;case"widthDim":n={width:{value:l.width,dim:t[r]}};break;case"heightDim":n={height:{value:l.height,dim:t[r]}};break;case"maxWidth":n={[r]:{value:t[r],dim:l.maxWidthDim}};break;case"maxWidthDim":n={maxWidth:{value:l.maxWidth,dim:t[r]}};break;case"minWidth":n={[r]:{value:t[r],dim:l.minWidthDim}};break;case"minWidthDim":n={minWidth:{value:l.minWidth,dim:t[r]}};break;case"backgroundImage":q(""===t[r]),n={[r]:[{...e.backgroundImage[0],value:t[r]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":n={padding:{[Ge.yy[r]]:+t[r]}};break;case"paddingTopBottom":n={padding:{top:+t[r],bottom:+t[r]}},l.paddingTop=l.paddingBottom=+t[r];break;case"paddingLeftRight":n={padding:{left:+t[r],right:+t[r]}},l.paddingLeft=l.paddingRight=+t[r];break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{[F.wF[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:l.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth,dim:t[r]}};break;case"mobileHeight":n={[r]:{classNamePrefix:"em-mob-height-",value:t[r],dim:l.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[r]}};break;case"mobileBorderStyle":n={mobileBorder:{[l.mobileBorderPosition]:{...A[l.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?y((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):y((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],style:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":n={mobileBorder:{[l.mobileBorderPosition]:{...A[l.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?y((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):y((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],color:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":n={mobileBorder:{[l.mobileBorderPosition]:{...A[l.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}},"all"===l.mobileBorderPosition?y((e=>({...F.iV,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}}))):y((e=>({...e,[l.mobileBorderPosition]:{...e[l.mobileBorderPosition],width:t[r],classNamePrefix:"em-mob-border_"+l.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":a.setFieldsValue({mobileBorderWidth:A[t[r]].width||"",mobileBorderColor:A[t[r]].color||"",mobileBorderStyle:A[t[r]].style||""});break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[Ge.NW[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+Ge.NW[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={mobileBoxShadow:{hOffset:l.mobileBoxShadowHOffset,vOffset:l.mobileBoxShadowVOffset,blurRadius:l.mobileBoxShadowBlurRadius,spreadRadius:l.mobileBoxShadowSpreadRadius,color:l.mobileBoxShadowColor,inset:l.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":n={[r]:{classNamePrefix:"em-mob-text_align-",value:t[r]}};break;case"mobileVerticalAlign":n={[r]:{classNamePrefix:"em-mob-vertical_align-",value:t[r]}};break;case"mobileBackgroundColor":n={[r]:{classNamePrefix:"em-mob-background_color-",value:t[r]}};break;case"mobileBackgroundImage":n={[r]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[r]}]};break;case"mobileBackgroundPositionX":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundPositionY":n={[r]:{classNamePrefix:"em-mob-background_position_x-",value:t[r]}};break;case"mobileBackgroundRepeat":n={[r]:{classNamePrefix:"em-mob-background_repeat-",value:t[r]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":n={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":l.mobilePaddingTop=l.mobilePaddingBottom=t[r],n={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":l.mobilePaddingLeft=l.mobilePaddingRight=t[r],n={mobilePadding:{all:null,top:""!==l.mobilePaddingTop?l.mobilePaddingTop:null,right:""!==l.mobilePaddingRight?l.mobilePaddingRight:null,bottom:""!==l.mobilePaddingBottom?l.mobilePaddingBottom:null,left:""!==l.mobilePaddingLeft?l.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileDirection":n={[r]:{classNamePrefix:"em-mob-direction-",value:t[r]}};break;default:n=t}"borderPosition"!==r&&o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n})},autoComplete:"off",className:"element-controls"},!J&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),M===F.ND&&V.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement(b.A,{gutter:20,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(dt,{form:a,elementSettings:e,imgParent:!0})),l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(ge,{form:a,elementSettings:e}))),l.createElement(h.A,{className:"selected-td-form__divider"}),z.formCellFieldPaddingsEnabled&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Padding"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ce((e=>!e)),Te&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},Te?l.createElement(w.A,null):l.createElement(B.A,null)))),Te&&l.createElement(b.A,{gutter:10,style:{paddingBottom:4}},l.createElement(l.Fragment,null,l.createElement(It,{form:a,elementSettings:e,mobilePaddingsExt:oe,setMobilePaddingsExt:le})))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{ye((e=>!e))}))}},_e?l.createElement(w.A,null):l.createElement(B.A,null)))),_e&&l.createElement(b.A,{gutter:10,style:{paddingBottom:8}},l.createElement(E.A,{span:12},l.createElement("div",{style:{marginBottom:2*$.formItemMarginBottomXS}},l.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e}))),l.createElement(E.A,{span:12},l.createElement("div",{style:{marginBottom:$.formItemMarginBottomXS}},l.createElement(Z,{form:a,name:"mobileHeight",elementSettings:e})))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{we((e=>!e)),t.mobileBackgroundColor=Be?"":"#E5E5E5",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Be?l.createElement(w.A,null):l.createElement(B.A,null)))),Be&&l.createElement("div",{style:{marginBottom:(z.formDivFieldBackgroundImageEnabled,$.formItemMarginBottomMD+4)}},l.createElement(ft,{form:a,elementSettings:e,label:t("Background color")})),!1,z.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),y((e=>({...F.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},re?l.createElement(w.A,null):l.createElement(B.A,null)))),re&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(ce,{mobileBorders:A}))),z.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ue((e=>!e)),se?(t.mobileBorderRadiusAll=null,C(!0)):t.mobileBorderRadiusAll=5,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},se?l.createElement(w.A,null):l.createElement(B.A,null)))),se&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(bt,{form:a,oneMobileBorderRadiusValue:P,setOneMobileBorderRadiusValue:C,elementSettings:e}))),z.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{he((e=>!e)),Ee?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},Ee?l.createElement(w.A,null):l.createElement(B.A,null)))),Ee&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(Et,{mobileBoxShadow:x,form:a,elementSettings:e}))),z.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control & Direction")),l.createElement(b.A,{gutter:20,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(fe,{elementSettings:e,form:a})),l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(Lt,{elementSettings:e,form:a})))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))):l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement(g.A,{className:"selected_form-desktop-props-title",message:t("Appearance on mobile devices"),type:"info"}),l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Je.A,{form:a,elementSettings:e})),l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(W.A,{form:a,elementSettings:e}))),l.createElement(h.A,{className:"selected-td-form__divider"}),z.formCellFieldPaddingsEnabled&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Padding"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ne((e=>!e)),Pe&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},Pe?l.createElement(w.A,null):l.createElement(B.A,null)))),Pe&&l.createElement(b.A,{gutter:10,style:{marginBottom:4}},l.createElement(l.Fragment,null,l.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},l.createElement("div",{className:"padding-collapsed",style:{display:ee?"block":"none"}},l.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingLeftRight"},l.createElement(j.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:l.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:ee?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:$.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:300,placeholder:t("Left"),prefix:l.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingRight"},l.createElement(j.A,{min:0,max:300,placeholder:t("Right"),prefix:l.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),l.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},l.createElement("div",{className:"padding-collapsed",style:{display:ee?"block":"none"}},l.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingTopBottom"},l.createElement(j.A,{min:0,max:300,placeholder:t("Vertical"),prefix:l.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:ee?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:$.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:300,placeholder:t("Top"),prefix:l.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingBottom"},l.createElement(j.A,{min:0,max:300,placeholder:t("Bottom"),prefix:l.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),l.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},l.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!ee}),onClick:()=>{te((e=>!e));const t=a.getFieldsValue(!0);ee||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},l.createElement(O.A,{icon:"PaddingSwitcher"}))))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{Ae((e=>!e))}))}},ve?l.createElement(w.A,null):l.createElement(B.A,null)))),ve&&l.createElement(b.A,{gutter:10,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Width"),placement:"bottom"},l.createElement(u.A.Item,{name:"width",className:"form-item-margin-xs"}," ",l.createElement(j.A,{min:0,max:Le,placeholder:t("Width"),prefix:l.createElement(S.A,null),addonAfter:l.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Wt)}))),l.createElement(p.A,{trigger:["hover"],title:t("Height"),placement:"bottom"},l.createElement(u.A.Item,{name:"height"},l.createElement(j.A,{min:0,placeholder:t("Height"),prefix:l.createElement(k.A,null),addonAfter:"px"})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"bottom"},l.createElement(u.A.Item,{name:"minWidth",className:"form-item-margin-xs"},l.createElement(j.A,{min:0,placeholder:t("Min width"),prefix:l.createElement(O.A,{icon:"MinWidth"}),addonAfter:l.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},Wt)}))),l.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"bottom"},l.createElement(u.A.Item,{name:"maxWidth",className:"form-item-margin-xs"},l.createElement(j.A,{min:0,placeholder:t("Max width"),prefix:l.createElement(O.A,{icon:"MaxWidth"}),addonAfter:l.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},Wt)}))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ke((e=>!e)),Se?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",q(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},Se?l.createElement(w.A,null):l.createElement(B.A,null)))),Se&&l.createElement(b.A,{gutter:10,style:{marginBottom:G?16:0}},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:z.formDivFieldBackgroundImageEnabled?$.formItemMarginBottomXS:$.formItemMarginBottomMD+4}},l.createElement(H.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),z.formDivFieldBackgroundImageEnabled&&l.createElement(E.A,{span:G?12:24},l.createElement("div",{style:{paddingBottom:G?4:0}},l.createElement(N.A,{form:a,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!G&&l.createElement(u.A.Item,{style:{marginBottom:"0"}},l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:$.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Horizontal position"),prefix:l.createElement(O.A,{icon:"BgPositionHorizontal"})})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:$.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:t("Vertical position"),prefix:l.createElement(O.A,{icon:"BgPositionVertical"})}))))),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:$.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:t("Please choose"),options:De,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:$.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:t("Please choose"),options:Me,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),z.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ie((e=>!e)),ae&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),d((e=>({...F.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},ae?l.createElement(w.A,null):l.createElement(B.A,null)))),ae&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(T.A,{borders:i}))),z.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{me((e=>!e)),de?(t.borderRadiusAll=0,v(!0)):t.borderRadiusAll=5,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},de?l.createElement(w.A,null):l.createElement(B.A,null)))),de&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(I.A,{form:a,oneBorderRadiusValue:c,setOneBorderRadiusValue:v,elementSettings:e}))),z.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),pe?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},pe?l.createElement(w.A,null):l.createElement(B.A,null)))),pe&&l.createElement("div",{style:{paddingBottom:4}},l.createElement(U,{boxShadow:m}))),z.formFieldExportAsPictureEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Export settings"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),xe&&(t.exportAsPicture=!1,o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},xe?l.createElement(w.A,null):l.createElement(B.A,null)))),xe&&l.createElement(vt,{form:a,elementSettings:e})),z.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control & Direction")),l.createElement(b.A,{gutter:20,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(fe,{elementSettings:e,form:a})),l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(Nt,{elementSettings:e,form:a})))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))))};var jt=o(61153);const{Option:Ht}=X.A,Ut=l.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},l.createElement(Ht,{value:"px"},"px"),l.createElement(Ht,{value:"%"},"%")),Xt=l.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},l.createElement(Ht,{value:"px"},"px"));let qt=0;const $t=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),o=(0,D.XW)(),[a]=u.A.useForm(),i=(0,n.d4)(Fe.Ct),r=(0,n.d4)(Fe.CS),d=(0,n.d4)(Fe.Fv),m=(0,n.d4)(Fe.yy),s=(0,Ve.rD)(),c=d&&"bottom"!==m;(0,l.useEffect)((()=>{const t=e=>e&&"auto"!==e?e:0===e?"0":"";var o,l,i,r,n,d,m,s,c,u,p,g,b,E;e&&(a.setFieldsValue({...e,width:null===(o=e.width)||void 0===o?void 0:o.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,gap:null===(i=e.gap)||void 0===i?void 0:i.value,gapDim:null===(r=e.gap)||void 0===r?void 0:r.dim,maxWidth:null===(n=e.maxWidth)||void 0===n?void 0:n.value,maxWidthDim:null===(d=e.maxWidth)||void 0===d?void 0:d.dim,minWidth:null===(m=e.minWidth)||void 0===m?void 0:m.value,minWidthDim:null===(s=e.minWidth)||void 0===s?void 0:s.dim,show:e.show?e.show:"all",mobileWidth:t(null===(c=e.mobileWidth)||void 0===c?void 0:c.value),mobileWidthDim:null===(u=e.mobileWidth)||void 0===u?void 0:u.dim,mobileContentWidth:t(null===(p=e.mobileContentWidth)||void 0===p?void 0:p.value),mobileContentWidthDim:null===(g=e.mobileContentWidth)||void 0===g?void 0:g.dim,mobileVerticalAlign:(E=null===(b=e.mobileVerticalAlign)||void 0===b?void 0:b.value,E||(0===E?"0":""))}),qt=e.width.value+e.gap.value)}),[a,e]);return l.createElement(u.A,{form:a,layout:"vertical",name:"selected_float_block_form",initialValues:{width:{value:"",dim:""},gap:{value:"",dim:"px"},valign:"",show:"all",mobileWidth:"",mobileWidthDim:"",mobileContentWidth:"",mobileContentWidthDim:"",mobileVerticalAlign:""},onValuesChange:t=>{const l=a.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(i){case"width":qt=t[i]+l.gap,r={[i]:{value:t[i],dim:l.widthDim},gap:{value:l.gap}};break;case"widthDim":r={width:{value:l.width,dim:t[i]},gap:{value:l.gap}};break;case"gap":l.width=qt-t[i],r={[i]:{value:t[i],dim:"px"}};break;case"mobileWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:l.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth,dim:t[i]}};break;case"mobileContentWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:l.mobileContentWidthDim}};break;case"mobileContentWidthDim":r={mobileContentWidth:{classNamePrefix:"em-mob-width-",value:l.mobileContentWidth,dim:t[i]}};break;case"mobileVerticalAlign":r={[i]:{classNamePrefix:"em-mob-vertical_align-",value:t[i]}};break;default:r=t}o({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off",className:"element-controls"},c&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),i===F.ND&&r.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:i===F.ND&&r.styles?"block":"none"}},l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement(b.A,{gutter:10,style:{marginBottom:20}},l.createElement(E.A,{span:12},l.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e})),l.createElement(E.A,{span:12})),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Alignments")),l.createElement(ge,{form:a,elementSettings:e}),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control")),l.createElement(fe,{elementSettings:e,form:a}),s.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(Ie,null)))):l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(u.A.Item,{style:{marginBottom:"0"}},l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Float block width"),placement:"bottom"},l.createElement(u.A.Item,{name:"width"},l.createElement(ee.A,{min:0,placeholder:t("Float block width"),prefix:l.createElement(S.A,null),addonAfter:l.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Ut)})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:t("Column gap"),placement:"bottom"},l.createElement(u.A.Item,{name:"gap"},l.createElement(ee.A,{min:0,placeholder:t("Column gap"),prefix:l.createElement(jt.A,null),addonAfter:l.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Xt)})))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Vertical alignment")),l.createElement(W.A,{form:a,elementSettings:e}),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},t("Display control")),l.createElement(fe,{elementSettings:e,form:a}),s.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement("div",{className:"form-group-title"},t("AMP visibility")),l.createElement(Ie,null)))))},{Option:Yt}=X.A,Kt=l.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},l.createElement(Yt,{value:"px"},"px"),l.createElement(Yt,{value:"%"},"%")),{useToken:Qt}=c.A,Jt=({elementSettings:e})=>{var t;const{__:o}=(0,L.s9)(),a=(0,D.XW)(),[i]=u.A.useForm(),s=(0,n.wA)(),c=(0,n.d4)(d.Hs),[v,A]=(0,l.useState)({}),[y,x]=(0,l.useState)({}),[R,P]=(0,l.useState)(!0),[C,M]=(0,l.useState)({}),[W,z]=(0,l.useState)(!0),G=(0,n.d4)(Fe.Ct),q=(0,n.d4)(Fe.CS),$=(0,Ve.rD)(),[Y,K]=(0,l.useState)(""===(null===(t=e.backgroundImage)||void 0===t?void 0:t[0].value)),J=(0,n.d4)(Fe.Fv),ee=(0,n.d4)(Fe.yy),te=J&&"bottom"!==ee,{token:oe}=Qt(),le=(0,l.useRef)(null),ae=(0,l.useRef)(null),[ie,re]=(0,l.useState)(!1),[ne,de]=(0,l.useState)(!1),[me,se]=(0,l.useState)(!1),[ue,ge]=(0,l.useState)(!1),[be,Ee]=(0,l.useState)(!1),[he,ve]=(0,l.useState)(!1),[Ae,_e]=(0,l.useState)(!1),[ye,Se]=(0,l.useState)(!1),[ke,Be]=(0,l.useState)(!1),[we,xe]=(0,l.useState)(!1),[Re,Pe]=(0,l.useState)(!1),[Ne,Te]=(0,l.useState)(!1),[Ce,Le]=(0,l.useState)(!1),[Oe,De]=(0,l.useState)(!1),[Me,We]=(0,l.useState)(""),[ze,je]=(0,l.useState)("https://"),[He,Ue]=(0,l.useState)({}),[Xe,$e]=(0,l.useState)(!1),Ye=c.hasOwnProperty("type")?F.IE:F.Tm,Ke=[{label:o("Not defined"),value:"none"},{label:o("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:o("Repeat background (repeat)"),value:"repeat"},{label:o("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:o("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Qe=[{label:o("Not defined"),value:""},{label:o("Contain"),value:"contain"},{label:o("Cover"),value:"cover"}];(0,l.useEffect)((()=>{if(e){var t,o,l,a,r,n,d,m,s,c,u,p,g,b,E,h,f,v,_,y,S,k,B,w,R,N,T,I,C,L,O,F,D,V,W,G,j,H,U,X,q,$,Y,Q,J,Z,ee,te,oe,le,ae,ie,ne,me,ce,ue,pe,be,he,fe,Ae,ye,ke,we,Re,Ne,Ie,Ce,Oe,Fe,Me,Ve,We,ze,He,Ue,Xe,qe,$e,Ye,Ke,Qe,Je,Ze,et,tt,ot,lt,at,it,rt,nt,dt,mt,st,ct,ut,pt,gt,bt,Et,ht,ft,vt,At,_t,yt,St,kt,Bt,wt,xt,Rt,Pt,Nt,Tt,It,Ct,Lt,Ot,Ft,Dt,Mt,Vt,Wt,zt,Gt,jt,Ht,Ut,Xt,qt,$t,Yt,Kt,Qt,Jt,Zt,eo,to,oo,lo,ao,io,ro,no,mo,so,co,uo,po,go,bo,Eo,ho,fo,vo,Ao,_o,yo,So,ko,Bo,wo,xo,Ro,Po,No,To,Io,Co,Lo,Oo,Fo,Do,Mo,Vo,Wo,zo,Go,jo;const Ho=e.border||{},Uo=e.boxShadow||{},Xo=e.mobileBorder||{},qo=e.mobilePadding||{},$o=e.mobileAlign||{},Yo=e.mobileBackgroundImage||[];A(Ho),x(Uo),M(Xo);const Ko=Object.keys(Ho).find((e=>{var t,o,l;return(null===(t=Ho[e])||void 0===t?void 0:t.width)||(null===(o=Ho[e])||void 0===o?void 0:o.style)||(null===(l=Ho[e])||void 0===l?void 0:l.color)})),Qo=Object.keys(Xo).find((e=>{var t,o,l;return(null===(t=Xo[e])||void 0===t?void 0:t.width)||(null===(o=Xo[e])||void 0===o?void 0:o.style)||(null===(l=Xo[e])||void 0===l?void 0:l.color)}));e.href&&("https://"===e.href.substring(0,8)||"http://"===e.href.substring(0,7)?je("https://"):"mailto:"===e.href.substring(0,7)?je("mailto:"):"tel:"===e.href.substring(0,4)?je("tel:"):"sms:"===e.href.substring(0,4)?je("sms:"):"ftp://"===e.href.substring(0,6)?je("ftp://"):"skype:"===e.href.substring(0,6)?je("skype:"):"viber:"===e.href.substring(0,6)?je("viber:"):je("")),i.setFieldsValue({...e,href:e.href?e.href:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.dim,height:null===(l=e.height)||void 0===l?void 0:l.value,heightDim:null===(a=e.height)||void 0===a?void 0:a.dim,backgroundImage:null===(r=e.backgroundImage)||void 0===r?void 0:r[0].value,show:e.show?e.show:"all",textAlign:e.textAlign,borderPosition:Ko||"all",borderWidth:(null===(n=Ho[Ko])||void 0===n?void 0:n.width)||"",borderColor:(null===(d=Ho[Ko])||void 0===d?void 0:d.color)||"",borderStyle:(null===(m=Ho[Ko])||void 0===m?void 0:m.style)||"",paddingTop:(0,Ge.ok)(null===(s=e.padding)||void 0===s?void 0:s.all)||(0,Ge.ok)(null===(c=e.padding)||void 0===c?void 0:c.top),paddingLeft:(0,Ge.ok)(null===(u=e.padding)||void 0===u?void 0:u.all)||(0,Ge.ok)(null===(p=e.padding)||void 0===p?void 0:p.left),paddingRight:(0,Ge.ok)(null===(g=e.padding)||void 0===g?void 0:g.all)||(0,Ge.ok)(null===(b=e.padding)||void 0===b?void 0:b.right),paddingBottom:(0,Ge.ok)(null===(E=e.padding)||void 0===E?void 0:E.all)||(0,Ge.ok)(null===(h=e.padding)||void 0===h?void 0:h.bottom),paddingLeftRight:(0,Ge.ok)(null===(f=e.padding)||void 0===f?void 0:f.left)||(0,Ge.ok)(null===(v=e.padding)||void 0===v?void 0:v.right),paddingTopBottom:(0,Ge.ok)(null===(_=e.padding)||void 0===_?void 0:_.top)||(0,Ge.ok)(null===(y=e.padding)||void 0===y?void 0:y.bottom),borderRadiusAll:(0,Ge.ok)(null===(S=e.borderRadius)||void 0===S?void 0:S.all),borderRadiusTopLeft:(0,Ge.ok)(null===(k=e.borderRadius)||void 0===k?void 0:k.topLeft),borderRadiusBottomLeft:(0,Ge.ok)(null===(B=e.borderRadius)||void 0===B?void 0:B.bottomLeft),borderRadiusTopRight:(0,Ge.ok)(null===(w=e.borderRadius)||void 0===w?void 0:w.topRight),borderRadiusBottomRight:(0,Ge.ok)(null===(R=e.borderRadius)||void 0===R?void 0:R.bottomRight),boxShadowInset:(0,Ge.ok)(null===(N=e.boxShadow)||void 0===N?void 0:N.inset)||!1,boxShadowHOffset:(0,Ge.ok)(null===(T=e.boxShadow)||void 0===T?void 0:T.hOffset),boxShadowVOffset:(0,Ge.ok)(null===(I=e.boxShadow)||void 0===I?void 0:I.vOffset),boxShadowBlurRadius:(0,Ge.ok)(null===(C=e.boxShadow)||void 0===C?void 0:C.blurRadius),boxShadowSpreadRadius:(0,Ge.ok)(null===(L=e.boxShadow)||void 0===L?void 0:L.spreadRadius),boxShadowColor:(0,Ge.ok)(null===(O=e.boxShadow)||void 0===O?void 0:O.color),mobileWidth:(0,Ge.xc)(null===(F=e.mobileWidth)||void 0===F?void 0:F.value)||(null===(D=e.width)||void 0===D?void 0:D.value),mobileWidthDim:(0,Ge.xc)(null===(V=e.mobileWidth)||void 0===V?void 0:V.value)?null===(W=e.mobileWidth)||void 0===W?void 0:W.dim:null===(G=e.width)||void 0===G?void 0:G.dim,mobileHeight:(0,Ge.xc)(null===(j=e.mobileHeight)||void 0===j?void 0:j.value)||(null===(H=e.height)||void 0===H?void 0:H.value),mobileHeightDim:(0,Ge.xc)(null===(U=e.mobileHeight)||void 0===U?void 0:U.value)?null===(X=e.mobileHeight)||void 0===X?void 0:X.dim:null===(q=e.height)||void 0===q?void 0:q.dim,mobileBorderPosition:Qo||Ko||"all",mobileBorderWidth:(null===($=Xo[Qo])||void 0===$?void 0:$.width)||(null===(Y=Ho[Ko])||void 0===Y?void 0:Y.width)||"",mobileBorderColor:(null===(Q=Xo[Qo])||void 0===Q?void 0:Q.color)||(null===(J=Ho[Ko])||void 0===J?void 0:J.color)||"",mobileBorderStyle:(null===(Z=Xo[Qo])||void 0===Z?void 0:Z.style)||(null===(ee=Ho[Ko])||void 0===ee?void 0:ee.style)||"",mobileBorderRadiusAll:(0,Ge.ok)(null===(te=e.mobileBorderRadius)||void 0===te?void 0:te.all)||(0,Ge.ok)(null===(oe=e.borderRadius)||void 0===oe?void 0:oe.all),mobileBorderRadiusTopLeft:(0,Ge.ok)(null===(le=e.mobileBorderRadius)||void 0===le?void 0:le.topLeft)||(0,Ge.ok)(null===(ae=e.mobileBorderRadius)||void 0===ae?void 0:ae.all)||(0,Ge.ok)(null===(ie=e.borderRadius)||void 0===ie?void 0:ie.topLeft)||(0,Ge.ok)(null===(ne=e.borderRadius)||void 0===ne?void 0:ne.all),mobileBorderRadiusBottomLeft:(0,Ge.ok)(null===(me=e.mobileBorderRadius)||void 0===me?void 0:me.bottomLeft)||(0,Ge.ok)(null===(ce=e.mobileBorderRadius)||void 0===ce?void 0:ce.all)||(0,Ge.ok)(null===(ue=e.borderRadius)||void 0===ue?void 0:ue.bottomLeft)||(0,Ge.ok)(null===(pe=e.borderRadius)||void 0===pe?void 0:pe.all),mobileBorderRadiusTopRight:(0,Ge.ok)(null===(be=e.mobileBorderRadius)||void 0===be?void 0:be.topRight)||(0,Ge.ok)(null===(he=e.mobileBorderRadius)||void 0===he?void 0:he.all)||(0,Ge.ok)(null===(fe=e.borderRadius)||void 0===fe?void 0:fe.topRight)||(0,Ge.ok)(null===(Ae=e.borderRadius)||void 0===Ae?void 0:Ae.all),mobileBorderRadiusBottomRight:(0,Ge.ok)(null===(ye=e.mobileBorderRadius)||void 0===ye?void 0:ye.bottomRight)||(0,Ge.ok)(null===(ke=e.mobileBorderRadius)||void 0===ke?void 0:ke.all)||(0,Ge.ok)(null===(we=e.borderRadius)||void 0===we?void 0:we.bottomRight)||(0,Ge.ok)(null===(Re=e.borderRadius)||void 0===Re?void 0:Re.all),mobileBoxShadowInset:null!=(null===(Ne=e.mobileBoxShadow)||void 0===Ne?void 0:Ne.inset)?e.mobileBoxShadow.inset:(null===(Ie=e.boxShadow)||void 0===Ie?void 0:Ie.inset)||!1,mobileBoxShadowHOffset:(0,Ge.ok)(null===(Ce=e.mobileBoxShadow)||void 0===Ce?void 0:Ce.hOffset)||(0,Ge.ok)(null===(Oe=e.boxShadow)||void 0===Oe?void 0:Oe.hOffset),mobileBoxShadowVOffset:(0,Ge.ok)(null===(Fe=e.mobileBoxShadow)||void 0===Fe?void 0:Fe.vOffset)||(0,Ge.ok)(null===(Me=e.boxShadow)||void 0===Me?void 0:Me.vOffset),mobileBoxShadowBlurRadius:(0,Ge.ok)(null===(Ve=e.mobileBoxShadow)||void 0===Ve?void 0:Ve.blurRadius)||(0,Ge.ok)(null===(We=e.boxShadow)||void 0===We?void 0:We.blurRadius),mobileBoxShadowSpreadRadius:(0,Ge.ok)(null===(ze=e.mobileBoxShadow)||void 0===ze?void 0:ze.spreadRadius)||(0,Ge.ok)(null===(He=e.boxShadow)||void 0===He?void 0:He.spreadRadius),mobileBoxShadowColor:(0,Ge.ok)(null===(Ue=e.mobileBoxShadow)||void 0===Ue?void 0:Ue.color)||(0,Ge.ok)(null===(Xe=e.boxShadow)||void 0===Xe?void 0:Xe.color),mobileAlign:(0,Ge.ok)(null===$o||void 0===$o?void 0:$o.value)||e.align,mobileVerticalAlign:(0,Ge.ok)((null===(qe=e.mobileVerticalAlign)||void 0===qe?void 0:qe.value)||e.valign),mobileBackgroundColor:(0,Ge.ok)((null===($e=e.mobileBackgroundColor)||void 0===$e?void 0:$e.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(Ye=Yo[0])||void 0===Ye?void 0:Ye.value)?null===(Ke=Yo[0])||void 0===Ke?void 0:Ke.value:(null===(Qe=e.backgroundImage)||void 0===Qe?void 0:Qe[0].value)||"",mobileBackgroundPositionX:(0,Ge.ok)(null===(Je=e.mobileBackgroundPositionX)||void 0===Je?void 0:Je.value)||(0,Ge.ok)(null===(Ze=e.backgroundPositionX)||void 0===Ze?void 0:Ze.value),mobileBackgroundPositionY:(0,Ge.ok)(null===(et=e.mobileBackgroundPositionY)||void 0===et?void 0:et.value)||(0,Ge.ok)(null===(tt=e.backgroundPositionY)||void 0===tt?void 0:tt.value),mobileBackgroundRepeat:(null===(ot=e.mobileBackgroundRepeat)||void 0===ot?void 0:ot.value)||e.backgroundRepeat||"none",mobilePaddingTop:(0,Ge.ok)(qo.all)||(0,Ge.ok)(qo.top)||(0,Ge.ok)(null===(lt=e.padding)||void 0===lt?void 0:lt.all)||(0,Ge.ok)(null===(at=e.padding)||void 0===at?void 0:at.top),mobilePaddingLeft:(0,Ge.ok)(qo.all)||(0,Ge.ok)(qo.left)||(0,Ge.ok)(null===(it=e.padding)||void 0===it?void 0:it.all)||(0,Ge.ok)(null===(rt=e.padding)||void 0===rt?void 0:rt.left),mobilePaddingRight:(0,Ge.ok)(qo.all)||(0,Ge.ok)(qo.right)||(0,Ge.ok)(null===(nt=e.padding)||void 0===nt?void 0:nt.all)||(0,Ge.ok)(null===(dt=e.padding)||void 0===dt?void 0:dt.right),mobilePaddingBottom:(0,Ge.ok)(qo.all)||(0,Ge.ok)(qo.bottom)||(0,Ge.ok)(null===(mt=e.padding)||void 0===mt?void 0:mt.all)||(0,Ge.ok)(null===(st=e.padding)||void 0===st?void 0:st.bottom),mobilePaddingTopBottom:(0,Ge.ok)(qo.top)||(0,Ge.ok)(qo.bottom)||(0,Ge.ok)(null===(ct=e.padding)||void 0===ct?void 0:ct.top)||(0,Ge.ok)(null===(ut=e.padding)||void 0===ut?void 0:ut.bottom),mobilePaddingLeftRight:(0,Ge.ok)(qo.left)||(0,Ge.ok)(qo.right)||(0,Ge.ok)(null===(pt=e.padding)||void 0===pt?void 0:pt.left)||(0,Ge.ok)(null===(gt=e.padding)||void 0===gt?void 0:gt.right),mobileTextAlign:(0,Ge.ok)((null===(bt=e.mobileTextAlign)||void 0===bt?void 0:bt.value)||e.textAlign),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture,mobileFontSize:(0,Ge.ok)((null===(Et=e.mobileFontSize)||void 0===Et?void 0:Et.value)||e.fontSize)}),!(0,Ge.ok)(null===(ht=e.borderRadius)||void 0===ht?void 0:ht.all)&&((0,Ge.ok)(null===(ft=e.borderRadius)||void 0===ft?void 0:ft.topLeft)||(0,Ge.ok)(null===(vt=e.borderRadius)||void 0===vt?void 0:vt.bottomLeft)||(0,Ge.ok)(null===(At=e.borderRadius)||void 0===At?void 0:At.topRight)||(0,Ge.ok)(null===(_t=e.borderRadius)||void 0===_t?void 0:_t.bottomRight))?P(!1):P(!0),(0,Ge.ok)(e.mobileBorderRadius.all)||(0,Ge.ok)(null===(yt=e.borderRadius)||void 0===yt?void 0:yt.all)||!((0,Ge.ok)(null===(St=e.borderRadius)||void 0===St?void 0:St.topLeft)||(0,Ge.ok)(null===(kt=e.borderRadius)||void 0===kt?void 0:kt.bottomLeft)||(0,Ge.ok)(null===(Bt=e.borderRadius)||void 0===Bt?void 0:Bt.topRight)||(0,Ge.ok)(null===(wt=e.borderRadius)||void 0===wt?void 0:wt.bottomRight))?z(!0):z(!1),K(""===(null===(xt=e.backgroundImage)||void 0===xt?void 0:xt[0].value)),(0,Ge.ok)(null===(Rt=e.padding)||void 0===Rt?void 0:Rt.all)||!((0,Ge.ok)(null===(Pt=e.padding)||void 0===Pt?void 0:Pt.top)||(0,Ge.ok)(null===(Nt=e.padding)||void 0===Nt?void 0:Nt.right)||(0,Ge.ok)(null===(Tt=e.padding)||void 0===Tt?void 0:Tt.bottom)||(0,Ge.ok)(null===(It=e.padding)||void 0===It?void 0:It.left))||(null===(Ct=e.padding)||void 0===Ct?void 0:Ct.top)===(null===(Lt=e.padding)||void 0===Lt?void 0:Lt.bottom)&&(null===(Ot=e.padding)||void 0===Ot?void 0:Ot.right)===(null===(Ft=e.padding)||void 0===Ft?void 0:Ft.left)?re(!0):re(!1),!(0,Ge.ok)(qo.all)&&((0,Ge.ok)(qo.top)||(0,Ge.ok)(qo.right)||(0,Ge.ok)(qo.bottom)||(0,Ge.ok)(qo.left))&&(qo.top!==qo.bottom||qo.right!==qo.left)||!(0,Ge.ok)(null===(Dt=e.padding)||void 0===Dt?void 0:Dt.all)&&((0,Ge.ok)(null===(Mt=e.padding)||void 0===Mt?void 0:Mt.top)||(0,Ge.ok)(null===(Vt=e.padding)||void 0===Vt?void 0:Vt.right)||(0,Ge.ok)(null===(Wt=e.padding)||void 0===Wt?void 0:Wt.bottom)||(0,Ge.ok)(null===(zt=e.padding)||void 0===zt?void 0:zt.left))&&((null===(Gt=e.padding)||void 0===Gt?void 0:Gt.top)!==(null===(jt=e.padding)||void 0===jt?void 0:jt.bottom)||(null===(Ht=e.padding)||void 0===Ht?void 0:Ht.right)!==(null===(Ut=e.padding)||void 0===Ut?void 0:Ut.left))?de(!1):de(!0),se(!(null===(Xt=Ho[Ko])||void 0===Xt||!Xt.width)||!(null===(qt=Ho[Ko])||void 0===qt||!qt.style)||!(null===($t=Ho[Ko])||void 0===$t||!$t.color)),ge(!(null===(Yt=Xo[Qo])||void 0===Yt||!Yt.width)||!(null===(Kt=Xo[Qo])||void 0===Kt||!Kt.style)||!(null===(Qt=Xo[Qo])||void 0===Qt||!Qt.color)||!(null===(Jt=Ho[Ko])||void 0===Jt||!Jt.width)||!(null===(Zt=Ho[Ko])||void 0===Zt||!Zt.style)||!(null===(eo=Ho[Ko])||void 0===eo||!eo.color)),Ee(!(null===(to=e.borderRadius)||void 0===to||!to.all)||!(null===(oo=e.borderRadius)||void 0===oo||!oo.topLeft)||!(null===(lo=e.borderRadius)||void 0===lo||!lo.bottomLeft)||!(null===(ao=e.borderRadius)||void 0===ao||!ao.topRight)||!(null===(io=e.borderRadius)||void 0===io||!io.bottomRight)),ve(!(null===(ro=e.mobileBorderRadius)||void 0===ro||!ro.all)||!(null===(no=e.mobileBorderRadius)||void 0===no||!no.topLeft)||!(null===(mo=e.mobileBorderRadius)||void 0===mo||!mo.bottomLeft)||!(null===(so=e.mobileBorderRadius)||void 0===so||!so.topRight)||!(null===(co=e.mobileBorderRadius)||void 0===co||!co.bottomRight)||!(null===(uo=e.borderRadius)||void 0===uo||!uo.all)||!(null===(po=e.borderRadius)||void 0===po||!po.topLeft)||!(null===(go=e.borderRadius)||void 0===go||!go.bottomLeft)||!(null===(bo=e.borderRadius)||void 0===bo||!bo.topRight)||!(null===(Eo=e.borderRadius)||void 0===Eo||!Eo.bottomRight)),_e(!!e.boxShadow),Se(!(null===(ho=e.mobileBoxShadow)||void 0===ho||!ho.blurRadius)||!(null===(fo=e.mobileBoxShadow)||void 0===fo||!fo.color)||!(null===(vo=e.mobileBoxShadow)||void 0===vo||!vo.hOffset)||!(null===(Ao=e.mobileBoxShadow)||void 0===Ao||!Ao.inset)||!(null===(_o=e.mobileBoxShadow)||void 0===_o||!_o.spreadRadius)||!(null===(yo=e.mobileBoxShadow)||void 0===yo||!yo.vOffset)||!!e.boxShadow),Be(!(null===(So=e.mobileWidth)||void 0===So||!So.value)||!(null===(ko=e.mobileHeight)||void 0===ko||!ko.value)||!!e.width.value||!!e.height.value),xe(!!e.backgroundColor||!(null===(Bo=e.backgroundImage)||void 0===Bo||!Bo[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Pe(!(null===(wo=e.mobileBackgroundColor)||void 0===wo||!wo.value)||!!e.backgroundColor||!(null===(xo=e.backgroundImage)||void 0===xo||!xo[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Te(!(null===(Ro=e.mobileFontSize)||void 0===Ro||!Ro.value)||!!e.fontSize||!!e.showOnMobile),Le(!(null===(Po=e.padding)||void 0===Po||!Po.all)||!(null===(No=e.padding)||void 0===No||!No.top)||!(null===(To=e.padding)||void 0===To||!To.bottom)||!(null===(Io=e.padding)||void 0===Io||!Io.left)||!(null===(Co=e.padding)||void 0===Co||!Co.right)),De(!(null===(Lo=e.mobilePadding)||void 0===Lo||!Lo.all)||!(null===(Oo=e.mobilePadding)||void 0===Oo||!Oo.top)||!(null===(Fo=e.mobilePadding)||void 0===Fo||!Fo.bottom)||!(null===(Do=e.mobilePadding)||void 0===Do||!Do.left)||!(null===(Mo=e.mobilePadding)||void 0===Mo||!Mo.right)||!(null===(Vo=e.padding)||void 0===Vo||!Vo.all)||!(null===(Wo=e.padding)||void 0===Wo||!Wo.top)||!(null===(zo=e.padding)||void 0===zo||!zo.bottom)||!(null===(Go=e.padding)||void 0===Go||!Go.left)||!(null===(jo=e.padding)||void 0===jo||!jo.right))}}),[i,e,te]);const Ze=(0,l.useCallback)((e=>{s(Ye===F.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[s,Ye]),et=e=>{i.setFieldValue("href","mergetag"!==e?e:""),je(e)},ot=({target:e})=>{const{selectionStart:t,selectionEnd:o}=e;e&&Ue({target:e,selection:{start:t,end:o}})};(0,l.useEffect)((()=>{var t;$e(!(null===(t=e.textReplacer)||void 0===t||!t.length))}),[e]);return l.createElement(u.A,{form:i,layout:"vertical",name:"selected_button_form",initialValues:{backgroundColor:"",backgroundImage:"",backgroundPositionX:"",backgroundPositionY:"",backgroundRepeat:"",backgroundSize:"",exportAsPicture:!1,width:"",height:"",widthDim:"",heightDim:"",align:"",valign:"",border:"",boxShadow:"",show:"all",borderPosition:"",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderPosition:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",href:"https://"},onValuesChange:t=>{const o=i.getFieldsValue(!0),l=Object.keys(t)[0];let r;switch(We("%"===i.getFieldsValue(!0).widthDim?100:""),l){case"exportAsPicture":r={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":r={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderStyle":r={border:{[o.borderPosition]:{...v[o.borderPosition],style:t[l]}}},"all"===o.borderPosition?A((e=>({...F.iV,[o.borderPosition]:{...e[o.borderPosition],style:t[l]}}))):A((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],style:t[l]}})));break;case"borderColor":r={border:{[o.borderPosition]:{...v[o.borderPosition],color:t[l]}}},"all"===o.borderPosition?A((e=>({...F.iV,[o.borderPosition]:{...e[o.borderPosition],color:t[l]}}))):A((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],color:t[l]}})));break;case"borderWidth":r={border:{[o.borderPosition]:{...v[o.borderPosition],width:t[l]}}},"all"===o.borderPosition?A((e=>({...F.iV,[o.borderPosition]:{...e[o.borderPosition],width:t[l]}}))):A((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],width:t[l]}})));break;case"borderPosition":i.setFieldsValue({borderWidth:v[t[l]].width||"",borderColor:v[t[l]].color||"",borderStyle:v[t[l]].style||""});break;case"width":r={[l]:{value:t[l],dim:o.widthDim}};break;case"height":r={[l]:{value:t[l],dim:o.heightDim}};break;case"widthDim":r={width:{value:o.width,dim:t[l]}};break;case"heightDim":r={height:{value:o.height,dim:t[l]}};break;case"backgroundImage":K(""===t[l]),r={[l]:[{...e.backgroundImage[0],value:t[l]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{left:o.paddingLeft,right:o.paddingRight,top:o.paddingTop,bottom:o.paddingBottom,[Ge.yy[l]]:+t[l]}};break;case"paddingTopBottom":r={padding:{left:o.paddingLeft,right:o.paddingRight,top:+t[l],bottom:+t[l]}},o.paddingTop=o.paddingBottom=+t[l];break;case"paddingLeftRight":r={padding:{top:o.paddingTop,bottom:o.paddingBottom,left:+t[l],right:+t[l]}},o.paddingLeft=o.paddingRight=+t[l];break;case"borderRadiusAll":r={borderRadius:{[F.wF[l]]:+t[l]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{topLeft:o.borderRadiusTopLeft,bottomLeft:o.borderRadiusBottomLeft,topRight:o.borderRadiusTopRight,bottomRight:o.borderRadiusBottomRight,[F.wF[l]]:+t[l]}};break;case"mobileWidth":r={[l]:{classNamePrefix:"em-mob-width-",value:t[l],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth,dim:t[l]}};break;case"mobileHeight":r={[l]:{classNamePrefix:"em-mob-height-",value:t[l],dim:o.mobileHeightDim},mobileLineHeight:{classNamePrefix:"em-mob-line_height-",value:t[l],dim:o.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[l]}};break;case"mobileBorderStyle":r={mobileBorder:{[o.mobileBorderPosition]:{...C[o.mobileBorderPosition],style:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?M((e=>({...F.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):M((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":r={mobileBorder:{[o.mobileBorderPosition]:{...C[o.mobileBorderPosition],color:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?M((e=>({...F.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):M((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":r={mobileBorder:{[o.mobileBorderPosition]:{...C[o.mobileBorderPosition],width:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?M((e=>({...F.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):M((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[l],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderPosition":i.setFieldsValue({mobileBorderWidth:C[t[l]].width||"",mobileBorderColor:C[t[l]].color||"",mobileBorderStyle:C[t[l]].style||""});break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[Ge.NW[l]]:t[l],classNamePrefix:"em-mob-border_radius_"+Ge.NW[l]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":r={mobileBoxShadow:{hOffset:o.mobileBoxShadowHOffset,vOffset:o.mobileBoxShadowVOffset,blurRadius:o.mobileBoxShadowBlurRadius,spreadRadius:o.mobileBoxShadowSpreadRadius,color:o.mobileBoxShadowColor,inset:o.mobileBoxShadowInset,classNamePrefix:"em-mob-box_shadow-"}};break;case"mobileAlign":r={[l]:{classNamePrefix:"em-mob-table_align-",value:t[l]}};break;case"mobileTextAlign":r={[l]:{classNamePrefix:"em-mob-text_align-",value:t[l]}};break;case"mobileVerticalAlign":r={[l]:{classNamePrefix:"em-mob-vertical_align-",value:t[l]}};break;case"mobileBackgroundColor":r={[l]:{classNamePrefix:"em-mob-background_color-",value:t[l]}};break;case"mobileBackgroundPositionX":r={[l]:{classNamePrefix:"em-mob-background_position_x-",value:t[l]}};break;case"mobileBackgroundPositionY":r={[l]:{classNamePrefix:"em-mob-background_position_x-",value:t[l]}};break;case"mobileBackgroundRepeat":r={[l]:{classNamePrefix:"em-mob-background_repeat-",value:t[l]}};break;case"mobilePaddingTop":case"mobilePaddingLeft":case"mobilePaddingRight":case"mobilePaddingBottom":r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingTopBottom":o.mobilePaddingTop=o.mobilePaddingBottom=t[l],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobilePaddingLeftRight":o.mobilePaddingLeft=o.mobilePaddingRight=t[l],r={mobilePadding:{all:null,top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,bottom:""!==o.mobilePaddingBottom?o.mobilePaddingBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,classNamePrefix:"em-mob-padding_"}};break;case"mobileFontSize":r={[l]:{classNamePrefix:"em-mob-font_size-",value:t[l],dim:o.mobileFontSizeDim}};break;case"href":let a=t[l];"https://http"===a.substring(0,12)&&(a=a.substring(8,a.length),o.href=a),r={[l]:a},"https://"===t[l].substring(0,8)||"http://"===t[l].substring(0,7)?je("https://"):"mailto:"===t[l].substring(0,7)?je("mailto:"):"tel:"===t[l].substring(0,4)?je("tel:"):"sms:"===t[l].substring(0,4)?je("sms:"):"ftp://"===t[l].substring(0,6)?je("ftp://"):"skype:"===t[l].substring(0,6)?je("skype:"):"viber:"===t[l].substring(0,6)?je("viber:"):je("");break;default:r=t}var n;"borderPosition"!==l&&(a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),Ze({...e,...r,mobileBorderRadius:{...e.mobileBorderRadius,...null===(n=r)||void 0===n?void 0:n.mobileBorderRadius},activateSection:null,changeKey:l}))},autoComplete:"off",className:"element-controls"},!te&&l.createElement(p.A,{title:o("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:o("Appearance on mobile devices"),type:"info"})),te?l.createElement(rt,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0}):l.createElement(l.Fragment,null,G===F.ND&&q.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement(b.A,{gutter:20,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(pe,{form:i,elementSettings:e,imgParent:!0})),$.formButtonFieldTextAlignEnabled&&l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(dt,{form:i,name:"mobileTextAlign",elementSettings:e,imgParent:!0}))),!!e.showOnMobile&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),l.createElement(p.A,{trigger:["hover"],title:o("Hyperlink URL"),placement:"bottom"},l.createElement(u.A.Item,{name:"href",style:{marginBottom:oe.formItemMarginBottomMD+4}},l.createElement(_.A,{addonBefore:l.createElement(Ge.Ai,{linkProtocol:ze,handleLinkProtocolsChange:et,__:o}),placeholder:o("Hyperlink URL"),allowClear:!0,prefix:l.createElement(Ge.RM,{linkProtocol:ze})})))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Text"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Te((e=>!e)),Ne&&(t.mobileFontSize="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileFontSize:{value:null,dim:"px",classNamePrefix:"em-mob-font_size-"}}}))}))}},Ne?l.createElement(w.A,null):l.createElement(B.A,null)))),Ne&&l.createElement(l.Fragment,null,!!e.showOnMobile&&l.createElement(tt,{form:i,elementSettings:e,setLinkProtocol:je,linkProtocol:ze,showAddParagraph:!1,isButton:!0}),l.createElement(b.A,{gutter:10,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(qe,null)))),l.createElement(h.A,{className:"selected-td-form__divider"}),$.formButtonFieldPaddingsEnabled&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Padding"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{De((e=>!e)),Oe&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},Oe?l.createElement(w.A,null):l.createElement(B.A,null)))),Oe&&l.createElement(b.A,{gutter:10,style:{paddingBottom:8}},l.createElement(l.Fragment,null,l.createElement(It,{form:i,elementSettings:e,mobilePaddingsExt:ne,setMobilePaddingsExt:de}))),l.createElement(h.A,{className:"selected-td-form__divider"})),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Size"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Be((e=>!e)),ke&&(t.mobileWidth="",t.mobileHeight="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"},mobileHeight:{value:null,dim:"px",classNamePrefix:"em-mob-height-"}}}))}))}},ke?l.createElement(w.A,null):l.createElement(B.A,null)))),ke&&l.createElement(b.A,{gutter:10,style:{paddingBottom:8}},l.createElement(E.A,{span:12},l.createElement("div",{style:{marginBottom:2*oe.formItemMarginBottomXS}},l.createElement(p.A,{title:o("Width"),placement:"bottom"},l.createElement(Q,{form:i,name:"mobileWidth",elementSettings:e})))),l.createElement(E.A,{span:12},l.createElement("div",{style:{marginBottom:2*oe.formItemMarginBottomXS}},l.createElement(p.A,{title:o("Height"),placement:"bottom"},l.createElement(Z,{form:i,name:"mobileHeight",elementSettings:e}))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Pe((e=>!e)),t.mobileBackgroundColor=Re?"":e.commonStyles.buttons.backgroundColor||"#1C52DC",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Re?l.createElement(w.A,null):l.createElement(B.A,null)))),Re&&l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:($.formButtonFieldBackgroundImageEnabled,oe.formItemMarginBottomMD+4)}},l.createElement(ft,{form:i,elementSettings:e,label:o("Background color")}))),$.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ge((e=>!e)),ue&&(t.mobileBorderWidth=null,t.mobileBorderColor="",t.mobileBorderStyle=""),M((e=>({...F.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderColor,style:t.mobileBorderStyle,width:t.mobileBorderWidth,classNamePrefix:"em-mob-border_"+t.mobileBorderPosition+"-"}}}})}))}},ue?l.createElement(w.A,null):l.createElement(B.A,null)))),ue&&l.createElement("div",{style:{marginBottom:4}},l.createElement(ce,{mobileBorders:C}))),$.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ve((e=>!e)),he?(t.mobileBorderRadiusAll=null,z(!0)):t.mobileBorderRadiusAll=5,a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},he?l.createElement(w.A,null):l.createElement(B.A,null)))),he&&l.createElement("div",{style:{marginBottom:4}},l.createElement(I.A,{form:i,oneBorderRadiusValue:W,setOneBorderRadiusValue:z,elementSettings:e,typeOfForm:"mobile"}))),$.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Se((e=>!e)),ye?(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=null,t.mobileBoxShadowVOffset=null,t.mobileBoxShadowBlurRadius=null,t.mobileBoxShadowSpreadRadius=null,t.mobileBoxShadowColor=""):(t.mobileBoxShadowInset=!1,t.mobileBoxShadowHOffset=5,t.mobileBoxShadowVOffset=5,t.mobileBoxShadowBlurRadius=10,t.mobileBoxShadowSpreadRadius=-5,t.mobileBoxShadowColor="#000000"),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBoxShadow:{blurRadius:t.mobileBoxShadowBlurRadius,color:t.mobileBoxShadowColor,hOffset:t.mobileBoxShadowHOffset,inset:t.mobileBoxShadowInset,spreadRadius:t.mobileBoxShadowSpreadRadius,vOffset:t.mobileBoxShadowVOffset,classNamePrefix:"em-mob-box_shadow-"}}})}))}},ye?l.createElement(w.A,null):l.createElement(B.A,null)))),ye&&l.createElement("div",{style:{marginBottom:4}},l.createElement(U,{boxShadow:y,typeOfForm:"mobile"}))),$.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},o("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))),$.formFieldAmpVisibilityEnabled&&e.isAmp&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},o("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null)))))):l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement(g.A,{className:"selected_form-desktop-props-title",message:o("Appearance on mobile devices"),type:"info"}),l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(b.A,{gutter:20,style:{paddingBottom:4}},l.createElement(E.A,{span:12},l.createElement(V,{form:i,elementSettings:e})),$.formButtonFieldTextAlignEnabled&&l.createElement(E.A,{span:12,style:{textAlign:"right"}},l.createElement(Je.A,{form:i,name:"textAlign",elementSettings:e}))),l.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),l.createElement(p.A,{trigger:["hover"],title:o("Hyperlink URL"),placement:"bottom"},l.createElement(u.A.Item,{name:"href",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(_.A,{addonBefore:l.createElement(Ge.Ai,{linkProtocol:ze,handleLinkProtocolsChange:et,__:o}),placeholder:o("Hyperlink URL"),allowClear:!0,onSelect:ot,prefix:l.createElement(Ge.RM,{linkProtocol:ze})}))),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:3},l.createElement(p.A,{title:o("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":Xe}),icon:l.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{$e(!Xe),Xe?(i.setFieldValue("textReplacer",""),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{textReplacer:""}})):setTimeout((()=>le.current.focus()))},ref:ae}))),l.createElement(E.A,{span:21},Xe&&l.createElement(p.A,{trigger:["hover"],title:o("Text"),placement:"bottom"},l.createElement(u.A.Item,{name:"textReplacer"},l.createElement(_.A,{placeholder:o("The code that will replace this text"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},"Text"),onChange:e=>{""!==e.target.value&&ae.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const t=e.target,o=t.value,l=t.selectionStart;if(0!==l||" "!==e.key){if(" "===e.key){if(l!==o.length)return void e.preventDefault();o.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:le,onSelect:ot}))))),l.createElement(h.A,{className:"selected-td-form__divider"}),$.formButtonFieldPaddingsEnabled&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Padding"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Le((e=>!e)),Ce&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},Ce?l.createElement(w.A,null):l.createElement(B.A,null)))),Ce&&l.createElement(b.A,{gutter:oe.marginSM,style:{marginBottom:4}},l.createElement(l.Fragment,null,l.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},l.createElement("div",{className:"padding-collapsed",style:{display:ie?"block":"none"}},l.createElement(p.A,{title:o("Horizontal padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingLeftRight"},l.createElement(j.A,{min:0,max:300,placeholder:o("Horizontal"),prefix:l.createElement(O.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:ie?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:o("Left padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:300,placeholder:o("Left"),prefix:l.createElement(O.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:o("Right padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingRight"},l.createElement(j.A,{min:0,max:300,placeholder:o("Right"),prefix:l.createElement(O.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),l.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},l.createElement("div",{className:"padding-collapsed",style:{display:ie?"block":"none"}},l.createElement(p.A,{title:o("Vertical padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingTopBottom"},l.createElement(j.A,{min:0,max:300,placeholder:o("Vertical"),prefix:l.createElement(O.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),l.createElement("div",{className:"padding-extended",style:{display:ie?"none":"block"}},l.createElement(p.A,{trigger:["hover"],title:o("Top padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:300,placeholder:o("Top"),prefix:l.createElement(O.A,{icon:"PaddingTop"}),addonAfter:"px"}))),l.createElement(p.A,{trigger:["hover"],title:o("Bottom padding"),placement:"bottom"},l.createElement(u.A.Item,{name:"paddingBottom"},l.createElement(j.A,{min:0,max:300,placeholder:o("Bottom"),prefix:l.createElement(O.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),l.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},l.createElement(p.A,{title:o("Individual padding"),placement:"bottom"},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!ie}),onClick:()=>{re((e=>!e));const t=i.getFieldsValue(!0);ie||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},l.createElement(O.A,{icon:"PaddingSwitcher"})))))),l.createElement(h.A,{className:"selected-td-form__divider"})),l.createElement("div",{className:"form-group-title"},o("Size")),l.createElement(b.A,{gutter:oe.marginSM,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(p.A,{title:o("Width"),placement:"left"},l.createElement(u.A.Item,{name:"width",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(j.A,{min:0,max:Me,placeholder:o("Width"),prefix:l.createElement(S.A,null),addonAfter:l.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Kt)})))),l.createElement(E.A,{span:12},l.createElement(p.A,{title:o("Height"),placement:"left"},l.createElement(u.A.Item,{name:"height"},l.createElement(j.A,{min:0,placeholder:o("Height"),prefix:l.createElement(k.A,null),addonAfter:"px"}))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{style:{paddingTop:oe.formItemMarginBottomMD+4,paddingBottom:4}},l.createElement(tt,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0,setLinkProtocol:je,linkProtocol:ze,linkTarget:He})),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Background"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{xe((e=>!e)),we?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",K(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{backgroundColor:t.backgroundColor,backgroundImage:[{type:"url",value:t.backgroundImage}],backgroundPositionX:t.backgroundPositionX,backgroundPositionY:t.backgroundPositionY,backgroundRepeat:t.backgroundRepeat,backgroundSize:t.backgroundSize}})}))}},we?l.createElement(w.A,null):l.createElement(B.A,null)))),we&&l.createElement(b.A,{gutter:10,style:{marginBottom:Y?14:0}},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:o("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},l.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:$.formButtonFieldBackgroundImageEnabled?oe.formItemMarginBottomXS:oe.formItemMarginBottomMD+4}},l.createElement(H.A,{placeholder:o("Background color"),usedColors:e.usedColors})))),$.formButtonFieldBackgroundImageEnabled&&l.createElement(E.A,{span:Y?12:24},l.createElement("div",{style:{paddingBottom:Y?4:0}},l.createElement(N.A,{form:i,label:o("Background image"),name:"backgroundImage",tooltipTitle:o("Background image")})),!Y&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:o("Horizontal position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:o("Horizontal position"),prefix:l.createElement(O.A,{icon:"BgPositionHorizontal"})})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:o("Vertical position"),placement:"bottom"},l.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:oe.formItemMarginBottomXS}},l.createElement(_.A,{placeholder:o("Vertical position"),prefix:l.createElement(O.A,{icon:"BgPositionVertical"})}))))),l.createElement(b.A,{gutter:10},l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:o("Background image repeat"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:oe.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:o("Please choose"),options:Ke,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),l.createElement(E.A,{span:12},l.createElement(p.A,{trigger:["hover"],title:o("Background image size"),placement:"top"},l.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:oe.formItemMarginBottomMD+4}},l.createElement(X.A,{placeholder:o("Please choose"),options:Qe,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),$.formFieldBorderEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Borders"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{se((e=>!e)),me&&(t.borderWidth=null,t.borderColor="",t.borderStyle=""),A((e=>({...F.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},me?l.createElement(w.A,null):l.createElement(B.A,null)))),me&&l.createElement("div",{style:{marginBottom:4}},l.createElement(T.A,{borders:v}))),$.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ee((e=>!e)),be?(t.borderRadiusAll=0,P(!0)):t.borderRadiusAll=5,a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},be?l.createElement(w.A,null):l.createElement(B.A,null)))),be&&l.createElement("div",{style:{marginBottom:4}},l.createElement(I.A,{form:i,oneBorderRadiusValue:R,setOneBorderRadiusValue:P,elementSettings:e}))),$.formFieldBoxShadowEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},o("Box shadow"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{_e((e=>!e)),Ae?(t.boxShadowInset=!1,t.boxShadowHOffset=0,t.boxShadowVOffset=0,t.boxShadowBlurRadius=0,t.boxShadowSpreadRadius=0,t.boxShadowColor=""):(t.boxShadowInset=!1,t.boxShadowHOffset=5,t.boxShadowVOffset=5,t.boxShadowBlurRadius=10,t.boxShadowSpreadRadius=-5,t.boxShadowColor="#000000"),a({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{boxShadow:{blurRadius:t.boxShadowBlurRadius,color:t.boxShadowColor,hOffset:t.boxShadowHOffset,inset:t.boxShadowInset,spreadRadius:t.boxShadowSpreadRadius,vOffset:t.boxShadowVOffset}}})}))}},Ae?l.createElement(w.A,null):l.createElement(B.A,null)))),Ae&&l.createElement("div",{style:{marginBottom:4}},l.createElement(U,{boxShadow:y}))),$.formFieldVisibilityEnabled&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},o("Display control")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(fe,{elementSettings:e,form:i})))),$.formFieldAmpVisibilityEnabled&&e.ampShow&&l.createElement(l.Fragment,null,l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement("div",{className:"form-group-title"},o("AMP visibility")),l.createElement(b.A,{gutter:20,style:{marginBottom:4}},l.createElement(E.A,{span:12},l.createElement(Ie,null))))))))};var Zt=o(94780);const eo=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[o]=u.A.useForm(),{TextArea:a}=_.A,i=(0,D.XW)();(0,l.useEffect)((()=>{e&&o.setFieldsValue({...e})}),[o,e]);return l.createElement(u.A,{form:o,layout:"vertical",name:"selected_variable_form",initialValues:{value:""},onValuesChange:t=>{i({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off"},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(u.A.Item,{label:t("Variable value"),name:"value",tooltip:{title:t("Type the output parameters of your platform. E.g., ")+"${Recipient.FirstName}",icon:l.createElement(Zt.A,null)},style:{marginBottom:35}},l.createElement(a,{rows:4,placeholder:t("Variable value")}))))};var to=o(40186);const{useToken:oo}=c.A,lo=({elementSettings:e,setElementSettings:t,postfix:o="",form:a,handleSelect:i})=>{const{__:n}=(0,L.s9)(),{token:d}=oo(),m=(0,Ve.rD)(),s=(0,D.XW)(),c="src"+o,g="title"+o,b="alt"+o,E="link"+o,h="imgReplacer"+o,v=(0,l.useRef)(null),S=(0,l.useRef)(null),k=(0,l.useRef)(null),B=(0,l.useRef)(null),w=(0,l.useRef)(null),x=(0,l.useRef)(null),R=(0,l.useRef)(null),P=(0,l.useRef)(null),[T,I]=(0,l.useState)(""),[C,M]=(0,l.useState)(""),[V,W]=(0,l.useState)(""),[z,G]=(0,l.useState)(!1),[j,H]=(0,l.useState)("https://");(0,l.useEffect)((()=>{var t,o,l;M(null===(t=e.images)||void 0===t?void 0:t[b]),W(null===(o=e.images)||void 0===o?void 0:o[g]),I(null===(l=e.images)||void 0===l?void 0:l[E])}),[e,b,g,E]);return l.createElement(l.Fragment,null,("img"===e.type||"video"===e.type||"carousel"===e.type)&&l.createElement(u.A.Item,{style:{marginBottom:0}},l.createElement(N.A,{form:a,label:n("Image path"),name:c,placeholder:n("Image path"),elementSettings:e,tooltipTitle:""})),l.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},l.createElement(A.A,{size:8},l.createElement(p.A,{title:C||n("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!C}),onClick:()=>{C?(M(""),a.setFieldValue("alt",""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[b]:""}})):(M(k.current&&k.current.input.value?k.current.input.value:"..."),setTimeout((()=>{k.current.focus()})))},ref:B},l.createElement("span",{className:"addon-text-content"},"Alt"))),m.formFieldImageTitleEnabled&&l.createElement(p.A,{title:V||n("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!V}),onClick:()=>{V?(W(!1),a.setFieldValue("title",""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[g]:""}})):(W(w.current&&w.current.input.value?w.current.input.value:"..."),setTimeout((()=>{w.current.focus()})))},ref:x},l.createElement("span",{className:"addon-text-content"},"Title"))),l.createElement(p.A,{title:T||n("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!T}),icon:l.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:()=>{T?(I(""),a.setFieldValue(E,""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[E]:""}})):(I(v.current&&v.current.input.value?v.current.input.value:"..."),setTimeout((()=>{v.current.focus()})))},ref:S})),l.createElement(p.A,{title:n("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},l.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":z}),icon:l.createElement(O.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{G(!z),z?(a.setFieldValue(h,""),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[h]:""}})):setTimeout((()=>R.current.focus()))},ref:P}))),l.createElement(A.A,{size:8},l.createElement(p.A,{title:n("Remove slide"),placement:"bottom"},l.createElement(f.Ay,{type:"text",onClick:l=>{var i;const r=a.getFieldsValue(!0),n=+o.substring(1),d=Object.keys(null===r||void 0===r?void 0:r.images).reduce(((e,t)=>(t.includes(o)||(e[t]=r[t]),e)),{}),m=null===(i=e.carouselImages)||void 0===i?void 0:i.filter(((e,t)=>t!==n));t((e=>({...e,settings:{...e.settings,carouselImages:m}}))),s({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,caption:e.caption,settings:{...e,carouselImages:m}}),a.setFieldsValue({images:d})},icon:l.createElement(to.A,null)})))),(!!T||!!C||!!V||!!z)&&l.createElement("div",null,!!T&&l.createElement(p.A,{trigger:["hover"],title:n("Hyperlink URL"),placement:"bottom"},l.createElement(u.A.Item,{name:E,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},l.createElement(_.A,{addonBefore:l.createElement(Ge.Ai,{linkProtocol:j,handleLinkProtocolsChange:e=>{a.setFieldValue("LinkName","mergetag"!==e?e:""),H(e)},__:n}),placeholder:n("Hyperlink URL"),allowClear:!0,ref:v,onChange:e=>{""===e.target.value?I("..."):(S.current.classList.add("selected-td-form__button--active"),I(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?H("https://"):"mailto:"===t.substring(0,7)?H("mailto:"):"tel:"===t.substring(0,4)?H("tel:"):"sms:"===t.substring(0,4)?H("sms:"):"ftp://"===t.substring(0,6)?H("ftp://"):"skype:"===t.substring(0,6)?H("skype:"):"viber:"===t.substring(0,6)?H("viber:"):H("")},onSelect:i,prefix:l.createElement(Ge.RM,{linkProtocol:j})}))),!!C&&l.createElement(p.A,{trigger:["hover"],title:n("Alternative text"),placement:"bottom"},l.createElement(u.A.Item,{name:b,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},l.createElement(_.A,{placeholder:n("Alternative text"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},"Alt"),onChange:e=>{""===e.target.value?M("..."):(B.current.classList.add("selected-td-form__button--active"),M(e.target.value))},ref:k,onSelect:i}))),m.formFieldImageTitleEnabled&&!!V&&l.createElement(p.A,{trigger:["hover"],title:n("Tooltip text"),placement:"bottom"},l.createElement(u.A.Item,{name:g,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},l.createElement(_.A,{placeholder:n("Enter the title of the image"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},"Title"),onChange:e=>{""===e.target.value?W("..."):(x.current.classList.add("selected-td-form__button--active"),W(e.target.value))},ref:w,onSelect:i}))),!!z&&l.createElement(p.A,{trigger:["hover"],title:n("Image src"),placement:"bottom"},l.createElement(u.A.Item,{name:h,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},l.createElement(_.A,{placeholder:n("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:l.createElement("span",{className:"addon-text-content"},n("Image src")),onChange:e=>{""!==e.target.value&&P.current.classList.add("selected-td-form__button--active")},ref:R,onSelect:i})))))},ao={loop:!1,autoplay:!1,borderRadiusAll:0,borderRadiusTopLeft:0,borderRadiusBottomLeft:0,borderRadiusTopRight:0,borderRadiusBottomRight:0,link:"https://",images:{},src_0:"",renderedHeight_0:0,renderedWidth_0:0,imgReplacer_0:"",title_0:"",alt_0:""},{useToken:io}=c.A,ro=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:o}=io(),[a]=u.A.useForm();let i=(0,n.wA)();const r=(0,Ve.rD)(),d=(0,D.K9)(),m=(0,D.XW)(),s=(0,n.d4)(Fe.Ct),c=(0,n.d4)(Fe.CS),[y,S]=(0,l.useState)(!0),[k,x]=(0,l.useState)(!0),[R,P]=(0,l.useState)(!1),[N,T]=(0,l.useState)(!1),[C,M]=(0,l.useState)("https://"),[V,W]=(0,l.useState)(null===a||void 0===a?void 0:a.getFieldsValue(!0)),[z,G]=(0,l.useState)(e),[j,H]=(0,l.useState)(null),[U,X]=(0,l.useState)(),[$,Y]=(0,l.useState)(!1),[K,Q]=(0,l.useState)(!1),[J,Z]=(0,l.useState)({start:0,end:0}),ee=(0,l.useRef)(null),te=`selected_${z.type}_form_link`,oe=(0,n.d4)(Fe.Fv),le=(0,n.d4)(Fe.yy),ae=oe&&"bottom"!==le;(0,l.useEffect)((()=>{$&&ee.current&&ee.current.focus()}),[$]),(0,l.useEffect)((()=>{G(e)}),[e]);const ie=(0,n.d4)(je.GH);(0,l.useEffect)((()=>{var e;null!==ie&&void 0!==ie&&null!==(e=ie.items)&&void 0!==e&&e.length&&X((0,Ve.cM)(ie.items,t,((e,t)=>{Y(!1),d(F.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[ie,X,t,Y,d]);(0,l.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||H(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||Y(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);(0,l.useEffect)((()=>{const e=null===a||void 0===a?void 0:a.getFieldsValue(!0);W(e)}),[a]);const re=({target:e})=>{if(e&&!K){const{selectionStart:t,selectionEnd:o}=e;Z({start:t,end:o})}Q(!1)};(0,l.useEffect)((()=>{if(z.settings){var e,t,o,l,i,r,n,d,m,s,c,u,p,g,b;const _=z.settings,y=(0,Ge.AO)(_);var E,h,f,v,A;if(null===a||void 0===a||a.setFieldsValue(y),W(y),_.link&&M((0,Ge.TW)(_.link,"https://")),!(0,Ge.ok)(null===(e=_.borderRadius)||void 0===e?void 0:e.all))(0,Ge.ok)(null===(E=_.borderRadius)||void 0===E?void 0:E.topLeft)||(0,Ge.ok)(null===(h=_.borderRadius)||void 0===h?void 0:h.bottomLeft)||(0,Ge.ok)(null===(f=_.borderRadius)||void 0===f?void 0:f.topRight)||(0,Ge.ok)(null===(v=_.borderRadius)||void 0===v?void 0:v.bottomRight)?S(!1):(0,Ge.ok)(null===(A=_.borderRadius)||void 0===A?void 0:A.all)||S(!0);(0,Ge.ok)(null===(t=_.mobileBorderRadius)||void 0===t?void 0:t.topLeft)||(0,Ge.ok)(null===(o=_.mobileBorderRadius)||void 0===o?void 0:o.bottomLeft)||(0,Ge.ok)(null===(l=_.mobileBorderRadius)||void 0===l?void 0:l.topRight)||(0,Ge.ok)(null===(i=_.mobileBorderRadius)||void 0===i?void 0:i.bottomRight)?x(!1):x(!0),P(!(null===(r=_.borderRadius)||void 0===r||!r.all)||!(null===(n=_.borderRadius)||void 0===n||!n.topLeft)||!(null===(d=_.borderRadius)||void 0===d||!d.bottomLeft)||!(null===(m=_.borderRadius)||void 0===m||!m.topRight)||!(null===(s=_.borderRadius)||void 0===s||!s.bottomRight)),T(!(null===(c=_.mobileBorderRadius)||void 0===c||!c.all)||!(null===(u=_.mobileBorderRadius)||void 0===u||!u.topLeft)||!(null===(p=_.mobileBorderRadius)||void 0===p||!p.bottomLeft)||!(null===(g=_.mobileBorderRadius)||void 0===g||!g.topRight)||!(null===(b=_.mobileBorderRadius)||void 0===b||!b.bottomRight))}}),[a,z]);(0,Ce.A)((e=>{const t=e.data.operation;t===F.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Me.tm)(z.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_AI))):t===F.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Me.tm)(z.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):t===F.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Me.tm)(z.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_EDIT))):t===F.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Me.tm)(z.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_GIF))):t===F.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Me.tm)(z.settings.src)),i((0,Oe.qf)(F.lx.UPLOAD_IMAGE_MODAL_STOCK))):t===F.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,Oe.Os)()),i((0,Oe.Oo)()))}));return l.createElement(u.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:ao,onValuesChange:e=>{const t=(0,Ge.Ze)(z.settings,a,e);m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,caption:t.caption,settings:t}),G((e=>({...e,settings:{...e.settings,...t}})))},autoComplete:"off",className:"element-controls"},!ae&&l.createElement(p.A,{title:t("To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version."),placement:"bottom"},l.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),s===F.ND&&c.styles?l.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},l.createElement("div",{className:"selected_form-mobile-props-wrapper"},l.createElement("p",null,t("No properties to edit.")))):l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(p.A,{trigger:["hover"],title:t("Link for all slides"),placement:"bottom"},l.createElement(u.A.Item,{name:"link"},l.createElement(_.A,{addonBefore:l.createElement(Ge.Ai,{linkProtocol:C,handleLinkProtocolsChange:e=>{a.setFieldValue("link","mergetag"!==e?e:""),M(e)},__:t}),placeholder:t("Link for all slides"),allowClear:!0,onSelect:re,prefix:l.createElement(Ge.RM,{linkProtocol:C})}))),l.createElement(h.A,{className:"selected-td-form__divider"}),U&&l.createElement(l.Fragment,null,l.createElement(E.A,{span:24,id:"merge_tags_wrapper"},l.createElement(u.A.Item,{style:{marginBottom:o.formItemMarginBottomMD,marginTop:o.formItemMarginBottomMD}},l.createElement(f.Ay,{id:"merge_tags_button",icon:l.createElement(O.A,{icon:"MergeTags"}),style:{width:"100%",display:$?"none":"block"},onClick:()=>Y(!0)},t("Merge tags")),l.createElement(v.A,{ref:ee,popupClassName:"merge-tags",options:U,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const o=t.map(((t,o)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return l.createElement("span",{key:t.value},0!==o&&l.createElement("span",null,"\xa0/\xa0"),a.map(((t,o)=>t.toLowerCase()===e.toLowerCase()?l.createElement("span",{key:o,style:{color:"red"}},t):t)))}));return l.createElement("div",{title:t.map((e=>e.label)).join(" / ")},o)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(e,t)=>{if(Y(!1),e){const o=ie.syntax.length>1?U.findIndex((e=>e.key===t[0].key)):0,l=ie.syntax[o].replace("%value%",e[e.length-1]),i=`selected_${z.type}_form${"carousel"===z.type?"_images":""}`;["imgReplacer","title","alt","src","link"].some((e=>null===j||void 0===j?void 0:j.getAttribute("id").includes(`${i}_${e}`)))||null!==j&&void 0!==j&&j.getAttribute("id").includes(te)?((e,t)=>{const o=document.getElementById(t);if(o){var l,i;const d=`selected_${z.type}_form_${t.includes("__images_")?"_images":""}_`,s=t.substring(t.indexOf(d)+d.length),c=null===(l=o.value)||void 0===l?void 0:l.substring(0,J.start),u=null===(i=o.value)||void 0===i?void 0:i.substring(J.end);let p={[s]:c+e+u};var r;if(s.includes("_"))p={carouselImages:[...(null===(r=z.settings)||void 0===r?void 0:r.carouselImages)||[]]},p.carouselImages[s.split("_")[1]][s.split("_")[0]]=c+e+u;else if(z.type===F.bV.CAROUSEL&&te===t){var n;p={[s]:c+e+u,carouselImages:[...(null===(n=z.settings)||void 0===n?void 0:n.carouselImages.map((t=>({...t,link:c+e+u}))))||[]]}}m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...z.settings,...p}}),G((e=>({...e,settings:{...e.settings,...p}}))),a.setFieldValue(s,c+e+u),o.focus(),setTimeout((()=>{o.selectionStart=J.start,o.selectionEnd=J.start+e.length}),400),Q(!0)}})(l,null===j||void 0===j?void 0:j.getAttribute("id")):(a.setFieldValue("imgReplacer",l),m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...z.settings,imgReplacer:l}}),G((e=>({...e,settings:{...e.settings,imgReplacer:l}}))))}},style:{display:$?"block":"none"},open:$,onKeyDown:e=>{"Escape"===e.key&&Y(!1)}}))),l.createElement(h.A,{className:"selected-td-form__divider"})),l.createElement(u.A.List,{name:"images",initialValue:null===V||void 0===V?void 0:V.images},(()=>{var e,t;return l.createElement("div",{style:{paddingTop:o.formItemMarginBottomMD+4}},null===z||void 0===z||null===(e=z.settings)||void 0===e||null===(t=e.carouselImages)||void 0===t?void 0:t.map(((e,t)=>l.createElement("div",{className:"carousel__slide",key:t},l.createElement(lo,{elementSettings:V,setElementSettings:G,postfix:"_"+t,form:a,handleSelect:re})))))})),l.createElement(E.A,{span:24},l.createElement(u.A.Item,{style:{marginBottom:o.formItemMarginBottomMD}},l.createElement(f.Ay,{id:"add_slide_button",icon:l.createElement(O.A,{icon:"AddSlide"}),style:{width:"100%"},onClick:()=>(()=>{var e,t;const{width:o,height:l,renderedWidth:a,renderedHeight:i}=(null===z||void 0===z||null===(e=z.settings)||void 0===e?void 0:e.carouselImages[0])||{width:{value:600},height:{value:600},renderedWidth:600,renderedHeight:600},r={src:"https://emcdn.ru/1865/231031_17_BGU9Mso.png",width:{value:o.value,dim:"px"},height:{value:l.value,dim:"px"},alt:"",title:"",link:null,renderedWidth:a,renderedHeight:i,imgReplacer:"",mobileWidth:{value:null,dim:"px"},mobileHeight:{value:null,dim:"px"},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}},n=[...null===z||void 0===z||null===(t=z.settings)||void 0===t?void 0:t.carouselImages,r];m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...z.settings,carouselImages:n}}),G((e=>({...e,settings:{...e.settings,carouselImages:n}})))})()},t("Add slide")))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(b.A,{gutter:20,style:{marginTop:o.formItemMarginBottomMD-10}},l.createElement(E.A,{span:12},l.createElement(A.A,{size:10,align:"baseline"},l.createElement(u.A.Item,{name:"loop",valuePropName:"checked",style:{marginBottom:o.formItemMarginBottomMD-6}},l.createElement(q.A,{size:"small",id:"Loop"})),l.createElement("span",{style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"Loop"},t("Loop"))))),l.createElement(E.A,{span:12},l.createElement(A.A,{size:10,align:"baseline"},l.createElement(u.A.Item,{name:"autoplay",valuePropName:"checked",style:{marginBottom:o.formItemMarginBottomMD-6}},l.createElement(q.A,{size:"small",id:"Autoplay"})),l.createElement("span",{style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"Autoplay"},t("Autoplay")))))),l.createElement(h.A,{className:"selected-td-form__divider"}),r.formFieldBorderRadiusEnabled&&l.createElement(l.Fragment,null,l.createElement(b.A,{gutter:10,align:"middle"},l.createElement(E.A,{span:20},l.createElement("div",{className:"form-group-title"},t("Border radius"))),l.createElement(E.A,{span:4,align:"right"},l.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{P((e=>!e)),a.setFieldValue("borderRadiusAll",R?0:5),m({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:F.bV.CAROUSEL,settings:{...z.settings,borderRadius:{all:R?"":5}}}),G((e=>({...e,settings:{...e.settings,borderRadius:{all:R?null:5}}})))}))}},R?l.createElement(w.A,null):l.createElement(B.A,null)))),R&&l.createElement("div",{style:{marginBottom:4}},l.createElement(I.A,{form:a,oneBorderRadiusValue:y,setOneBorderRadiusValue:S,elementSettings:z.settings}))))))},no={animate:!0,expandSingleSection:!0,sections:[{expanded:!1,index:0}]},{useToken:mo}=c.A,so=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:o}=mo(),[a]=u.A.useForm(),i=(0,D.XW)(),[r,n]=(0,l.useState)(e);(0,l.useEffect)((()=>{n(e)}),[e]),(0,l.useEffect)((()=>{if(r.settings){const e=r.settings,t=(0,Ge.AO)(e);null===a||void 0===a||a.setFieldsValue(t)}}),[a,r]);return l.createElement(u.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:no,onValuesChange:e=>{const t=(0,Ge.Ze)(r.settings,a,e);i({operation:F.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:r.type,caption:t.caption,settings:t}),n((e=>({...e,settings:{...e.settings,...t}})))},autoComplete:"off",className:"element-controls"},l.createElement("div",{id:"selected_element_form_desktop_props"},l.createElement("div",{className:"selected_form-props-wrapper"},l.createElement(b.A,{gutter:20},l.createElement(E.A,{span:15},l.createElement(A.A,{size:10,align:"baseline"},l.createElement(u.A.Item,{name:"expandSingleSection",valuePropName:"checked"},l.createElement(q.A,{size:"small",id:"ExpandSingleSection"})),l.createElement("span",{style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"ExpandSingleSection"},t("Expand only one section"))))),l.createElement(E.A,{span:9},l.createElement(A.A,{size:10,align:"baseline"},l.createElement(u.A.Item,{name:"animate",valuePropName:"checked"},l.createElement(q.A,{size:"small",id:"Animate"})),l.createElement("span",{style:{position:"relative",top:2}},l.createElement("label",{htmlFor:"Animate"},t("Animate")))))),l.createElement(h.A,{className:"selected-td-form__divider"}),l.createElement(u.A.List,{name:"sections"},(()=>{var e,a;return l.createElement("div",{style:{paddingTop:o.formItemMarginBottomMD+4}},null===r||void 0===r||null===(e=r.settings)||void 0===e||null===(a=e.sections)||void 0===a?void 0:a.map(((e,o)=>{var a,d;return l.createElement(b.A,{gutter:24,key:`expanded_${o}`},l.createElement(E.A,{span:20},l.createElement(A.A,{size:10,align:"baseline"},l.createElement("span",{style:{position:"relative",top:2}},t("Section ")+(o+1)),l.createElement(u.A.Item,{name:`expanded_${o}`},l.createElement(q.A,{size:"small",id:`expanded_${o}`,checked:e.expanded})),l.createElement("span",{style:{position:"relative",top:2}},l.createElement("label",{htmlFor:`expanded_${o}`},t("expanded"))))),l.createElement(E.A,null,(null===r||void 0===r||null===(a=r.settings)||void 0===a||null===(d=a.sections)||void 0===d?void 0:d.length)>1&&l.createElement(f.Ay,{type:"text",icon:l.createElement(to.A,null),style:{marginRight:"auto"},onClick:()=>{return e=o,n((t=>{var o;return{...t,settings:{...t.settings,sections:null===(o=r.settings.sections)||void 0===o?void 0:o.filter(((t,o)=>o!==e))}}})),void i({operation:F.Ru.SANDBOX_ACCORDION_REMOVE_SECTION,settings:{index:e}});var e}})))})))})),l.createElement(b.A,{gutter:20},l.createElement(E.A,{span:24},l.createElement(u.A.Item,{style:{marginBottom:o.formItemMarginBottomMD}},l.createElement(f.Ay,{style:{width:"100%",display:"block"},icon:l.createElement(O.A,{icon:"MergeTags"}),onClick:()=>(n((e=>{var t;return{...e,sections:null===r||void 0===r||null===(t=r.settings)||void 0===t?void 0:t.sections.push({expanded:!1})}})),void i({operation:F.Ru.SANDBOX_ACCORDION_ADD_SECTION,settings:{section:t("Section title"),text:t("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}}))},t(" Add section"))))),l.createElement(h.A,{className:"selected-td-form__divider"}))))},co=({className:e,formSettings:t,emailElementType:o})=>{const i=(0,n.wA)(),s=(0,ze.Cb)(),c=(0,l.useRef)(),u=(0,n.d4)(Fe.B),p=(0,n.d4)(d.qX),g=(0,n.d4)(m.qX),b=o===F.Tm?p:g,[E,h]=(0,l.useState)(b);(0,l.useEffect)((()=>{h(b.type===F.bV.CAROUSEL||b.type===F.bV.IMG?t.settings:b)}),[b,t.settings]);return(0,Ce.A)((e=>{const t=e.data.operation,o=e.data.action;if(t===F.Ru.APPLICATION_ACTION){function l(e,t=null){const o={[e]:t||!E[e]};s(o,E.type),i((0,d.G_)(o)),h((e=>({...e,...o})))}"toggle_strong"===o&&l("textStrong"),"toggle_italic"===o&&l("textItalic"),"toggle_underline"===o&&l("textUnderline"),"toggle_strikethrough"===o&&l("textStrikethrough"),"textAlign_left"===o&&l("textAlign","left"),"textAlign_right"===o&&l("textAlign","right"),"textAlign_center"===o&&l("textAlign","center")}})),l.createElement(a.A,{nodeRef:c,in:u===F.yI,timeout:300,classNames:"transition"},l.createElement("div",{ref:c,className:r()("selected-element-panel-content",{[e]:e})},(b.type===F.bV.IMG||b.type===F.bV.COUNTDOWN||b.type===F.bV.VIDEO)&&l.createElement(Ue,{elementSettings:b}),b.type===F.bV.TEXT&&l.createElement(mt,{elementSettings:b}),b.type===F.bV.LINK&&l.createElement(Bt,{elementSettings:b}),b.type===F.bV.TABLE&&l.createElement(St,{elementSettings:b}),(b.type===F.bV.TD||b.type===F.bV.STRUCTURE||b.type===F.bV.GROUP||b.type===F.bV.COLUMN)&&l.createElement(Mt,{elementSettings:b}),b.type===F.bV.VAR&&l.createElement(eo,{elementSettings:b}),b.type===F.bV.BUTTON&&l.createElement(Jt,{elementSettings:b}),b.type===F.bV.DIV&&l.createElement(Gt,{elementSettings:b}),b.type===F.bV.VINDENT&&l.createElement(wt,{elementSettings:b}),b.type===F.bV.FLOAT_BLOCK&&l.createElement($t,{elementSettings:b}),t.type===F.bV.CAROUSEL&&l.createElement(ro,{elementSettings:t}),t.type===F.bV.ACCORDION&&l.createElement(so,{elementSettings:t})))};co.defaultProps={className:null};const uo=co},52995:(e,t,o)=>{o.d(t,{A:()=>P});var l=o(98173),a=o(2604),i=o(30150),r=o(40120),n=o(27499),d=o(48753),m=o(37969),s=o(8218),c=o(49823),u=o(67034),p=o(64909),g=o(94780),b=o(12543),E=o(8807),h=o(23424),f=o(47014),v=o(65716),A=o(40835),_=o(40277),y=o(32947),S=o(86095),k=o(90614),B=o(15626),w=o(27941);const{useToken:x}=r.A,R=({isModalVisible:e,email:t})=>{const{__:o}=(0,b.s9)(),[r]=n.A.useForm(),R=(0,a.wA)(),{emailId:P}=(0,i.g)(),N=(0,a.d4)(f.C1),[T,I]=(0,A.lg)(),{token:C}=x(),L=(0,p.hN)(),O=(0,a.Pj)(),[F,D]=(0,l.useState)(!1),M=t.project,[V,W]=(0,v.OD)(),{data:z}=v.Nq.endpoints.getProject.select(+M)(O.getState()),{testEmails:G}=(0,w.rD)(),[j,H]=(0,l.useState)([]),[U,X]=(0,l.useState)(!1),q=(0,k.ml)(B.AZ.ON_SEND_EMAIL_MODAL_ID);(0,l.useEffect)((()=>{y.EW.isPlugin&&e?q.fire(t).then((t=>{t.some((e=>!1===e))?R((0,h.Oo)()):D(e)})):D(e)}),[e,R,D,t,q]),(0,l.useEffect)((()=>{if(z&&!y.EW.isPlugin){const{owner:e,admins:t,users:o,invited_users:l}=z.members;let a=[];const i=localStorage.getItem(y.V0.em_test_emails)?JSON.parse(localStorage.getItem(y.V0.em_test_emails)):[];if(i.length&&i[M]&&i[M].map((({prevLSEmail:e})=>a.push(e))),l&&l.map((({invited_user_email:e})=>a.push(e))),o&&o.map((({user_email:e})=>a.push(e))),e&&a.push(e.user_email),t&&t.map((({user_email:e})=>a.push(e))),z.projects_test_emails){const e=z.projects_test_emails.map((({projects_test_email:e})=>e));a.push(...e)}const r=Array.from(new Set(a));a.length&&H(r.map((e=>({value:e}))))}}),[z,M]),(0,l.useEffect)((()=>{y.EW.isPlugin&&H(G.map((e=>({value:e}))))}),[G]),(0,l.useEffect)((()=>{var e;const t=localStorage.getItem(y.V0.em_test_emails);if(t&&F&&0===(null===(e=r.getFieldValue("recipients"))||void 0===e?void 0:e.length)){const e=JSON.parse(t);null!==e&&void 0!==e&&e[M]&&r.setFieldsValue({recipients:e[M]})}}),[M,F,r]),(0,l.useEffect)((()=>{r.setFieldsValue({subject:t.subject})}),[r,t.subject]);const $=(0,S.fn)();return(0,l.useEffect)((()=>{if(I.isSuccess&&U){var e;if(200!==(null===(e=I.data)||void 0===e?void 0:e.status)){var l,a;(0,_.p6)({error:{data:{code:null===(l=I.data)||void 0===l?void 0:l.code,message:null===(a=I.data)||void 0===a?void 0:a.message}}},L)}else{const e=[...new Set([...j.map((e=>e.value)),...r.getFieldValue("recipients")])];V({projectId:M,projects_test_emails:e.map((e=>({projects_test_email:e})))});const l=localStorage.getItem(y.V0.em_test_emails)?JSON.parse(localStorage.getItem(y.V0.em_test_emails)):[];let a=r.getFieldValue("recipients");localStorage.setItem(y.V0.em_test_emails,JSON.stringify({...l,[M]:[...new Set(a)]})),(0,_.wB)(o("The email \u201c")+t.title+o("\u201d was successfully sent."),L)}X(!1),r.resetFields(),R((0,h.Oo)())}}),[I,r,M,V,j,U,R,t.title,W,o,L]),(0,l.useEffect)((()=>{W.isError&&((0,_.p6)(W,L),X(!1),r.resetFields(),R((0,h.Oo)()))}),[R,W,r,L]),(0,l.useEffect)((()=>{r.setFieldsValue({subject:t.subject||t.title})}),[t,r]),l.createElement(d.A,{width:572,title:l.createElement("div",null,l.createElement(E.A,{icon:"SendOutlined"})," ",o("Send a test email")),className:"blocks-modal",open:F,onCancel:()=>{R((0,h.Oo)()),r.resetFields()},centered:!0,footer:[l.createElement(m.Ay,{key:"submit",size:"large",className:"em-analytics__email-send-test",type:"primary",htmlType:"submit",form:"Send mail",loading:W.isLoading,icon:l.createElement(E.A,{icon:"SendOutlined",className:"email-preview-menu__list-item-icon"}),onClick:()=>{r.validateFields().then((()=>{const e={user_id:N.id,project_id:M,email_id:P,subject:r.getFieldValue("subject"),email:r.getFieldValue("recipients").join(","),html:(t=(null===$||void 0===$?void 0:$.getValue())||"",t.replace(/[\\]/g,"\\\\").replace(/["]/g,'\\"').replace(/[/]/g,"\\/").replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t"))};var t;T(e),X(!0)})).catch((e=>{}))},disabled:I.isLoading},o("Send"))],forceRender:!0},l.createElement(n.A,{form:r,layout:"vertical",name:"send_mail_form",initialValues:{subject:t.subject||t.title,recipients:[]},autoComplete:"off",style:{padding:"10px 24px 0"}},l.createElement(n.A.Item,{label:o("Subject"),name:"subject",rules:[{required:!1,message:o("Please type subject")}]},l.createElement(s.A,{size:"large",placeholder:o("Type subject")})),l.createElement(n.A.Item,{label:o("Recipients"),name:"recipients",tooltip:{title:o("The test email will be sent to the specified addresses."),icon:l.createElement(g.A,null)},rules:[{required:!0,validator:(e,t)=>t.length>10?Promise.reject(new Error(o("A test email can be sent to a maximum of 10 addresses."))):0!==t.length?t.every((e=>_.au.test(e.toLowerCase())))?Promise.resolve():Promise.reject(new Error(o("Please type correct emails"))):Promise.reject(new Error(o("Please type emails")))}]},l.createElement(c.A,{size:"large",mode:"tags",placeholder:o("Add up to 10 recipients"),tooltip:{title:"Tooltip with customize icon",icon:l.createElement(g.A,null)},options:j,tagRender:e=>{const{label:t,closable:o,onClose:a}=e;return l.createElement(u.A,{color:C.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:o,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.getElementById("send_mail_form")}))))};R.defaultProps={isModalVisible:!1,email:null};const P=R},72915:(e,t,o)=>{o.d(t,{A:()=>W});var l=o(98173),a=o(40120),i=o(27499),r=o(8218),n=o(49823),d=o(67034),m=o(94674),s=o(13785),c=o(49856),u=o(29123),p=o(94780),g=o(2604),b=o(30150),E=o(12543),h=o(26298),f=o.n(h),v=o(77306),A=o(68984),_=o(98845),y=o(65716),S=o(83027),k=o(12741),B=o(39206),w=o(1047),x=o(27941),R=o(40277),P=o(32947);const{useToken:N}=a.A,{title:T,description:I,tags:C,type:L,is_template:O,group:F}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},D={[T]:"",[I]:"",[C]:[],[O]:!1},M={[I]:"",[C]:[],[L]:""};const V=({className:e,element:t})=>{var o,a;const{__:h}=(0,E.s9)(),{projectId:O}=(0,b.g)(),V=(0,g.wA)(),[W]=i.A.useForm(),{token:z}=N(),G=(0,x.rD)(),j=(0,g.Pj)(),H=(0,g.d4)(w.UI),{data:U}=(0,A.h1)(),{data:X}=(0,b.KC)(),q=t.hasOwnProperty("type")?P.IE:P.Tm,$=t.hasOwnProperty("type")?P.YY:P.zh,{refetch:Y,isLoading:K,isFetching:Q,isUninitialized:J,isSuccess:Z}=(0,S.Oo)({parent:null===(o=X.group)||void 0===o?void 0:o[0]},{skip:!(null!==(a=X.group)&&void 0!==a&&a[0])});(0,l.useEffect)((()=>{!J&&Y()}),[J,Y]);const[ee,te]=(0,l.useState)([]),[oe,le]=(0,l.useState)([]),[ae,ie]=(0,l.useState)(t.is_template||!1),{data:re}=y.Nq.endpoints.getProject.select(+O)(j.getState());(0,l.useEffect)((()=>{!J&&Y()}),[t.group,Y,J]),(0,l.useEffect)((()=>{if(Z&&t.is_template&&t.group.length){const e=t.group;let o={};e.length&&H.length&&(null===e||void 0===e||e.forEach((e=>{null===H||void 0===H||H.forEach((t=>{let l=t.children.find((t=>t.id===e));l&&(o.hasOwnProperty(t.id)||(o[t.id]=[]),o[t.id].push({label:l.name,value:l.id}))}))})));let l={};for(let t in o)o.hasOwnProperty(+t)&&(l[`group_${t}`]=o[t].map((e=>({...e,value:String(e.value)}))));W.setFieldsValue(l)}}),[W,H,t.is_template,t.group,Z]),(0,l.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,R.HT)(re,$)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,$]),(0,l.useEffect)((()=>{if(t){var e,o;const l=null===(e=(0,R._q)(t,$))||void 0===e?void 0:e.map((e=>e.name)),a=t.emailtags||t.blocktags,i=null===(o=(0,R._q)(t,$))||void 0===o?void 0:o.filter((e=>a.includes(e.id))).map((e=>e.name));W.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||l,type:t.type})}}),[W,t,$]);(0,l.useEffect)((()=>{if(U){const e=U.schema.properties.acf.properties.type.items.enum;let t=[];const o={Applications:h("Apps"),Articles:h("Article"),Banners:h("Banners"),Buttons:h("Buttons"),"Call to Action":h("Call to Action"),Contacts:h("Contacts"),Content:h("Content"),"E-Commerce":h("E-Commerce"),Feature:h("Features"),Footer:h("Footers"),Header:h("Headers"),Lists:h("Lists"),Menu:h("Menus"),Other:h("Others"),Polls:h("Polls"),Promocodes:h("Promocodes"),Separators:h("Separators")};for(let l in e)t.push({label:o[e[l]],value:e[l]});te(t)}}),[U,h]);return l.createElement("div",{className:f()("settings-panel",{[e]:e})},l.createElement(i.A,{form:W,layout:"vertical",name:"settings_panel_form",initialValues:q===P.Tm?{EmailInitialValues:D}:M,onValuesChange:e=>{const o=Object.keys(e)[0];switch(o.split("_")[0]){case T:t.isNew?V((0,k.BQ)(e[o])):V((0,w.VK)(e[o]));break;case F:V((0,w.Bu)({[o.split("_")[1]]:e[o]}));break;case I:q===P.Tm?t.isNew?V((0,k.Zs)(e[o])):V(_.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[o]})}))):t.isNew?V((0,B.AS)(e[o])):V(A.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[o]})})));break;case"is":t.isNew?V((0,k.TC)(e[o])):V(_.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[o]})})));break;case C:{const l=e[o].map((e=>e.trim()));q===P.Tm?t.isNew?V((0,k.yY)(l)):V(_.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:l})}))):t.isNew?V((0,B.TB)(l)):V(A.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:l})})));break}case L:V(A.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[o]})})));break;default:return}},autoComplete:"off"},G.subjectEnabled&&q===P.Tm&&l.createElement(i.A.Item,{label:h("Title"),name:T,tooltip:{title:h("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:l.createElement(p.A,null)}},l.createElement(r.A.TextArea,{placeholder:h("Type title here"),autoSize:{minRows:1}})),G.descriptionEnabled&&l.createElement(i.A.Item,{label:h("Description"),name:I,tooltip:{title:h("Description is used in other sections of the service."),icon:l.createElement(p.A,null)}},l.createElement(r.A.TextArea,{placeholder:h("Type your description here"),autoSize:{minRows:2}})),G.tagsEnabled&&l.createElement(i.A.Item,{label:h("Tags"),name:C,tooltip:{title:h("Tags help you find the block in the list."),icon:l.createElement(p.A,null)},rules:[{message:"Please input your username!",type:"array"}]},l.createElement(n.A,{mode:"tags",style:{width:"100%"},placeholder:h("Type your tags here"),options:oe,tagRender:e=>{const{label:t,closable:o,onClose:a}=e;return l.createElement(d.A,{color:z.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:o,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})),l.createElement(m.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),q===P.Tm&&G.isTemplateEnabled&&l.createElement(s.A,{title:t.isNew?h("Save email first."):h("Use this email as a template for creating future emails."),key:"isTemplate"},l.createElement(c.A,{size:10,align:"baseline"},l.createElement(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:ae},l.createElement(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ie(e)},disabled:t.isNew})),l.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:z.colorText}},l.createElement("label",{htmlFor:"setIsTemplate"},h("Is a template"))))),ae&&l.createElement(v.A,{element:t,refetchProjectGroups:Y,isLoading:K||Q}),q===P.IE&&l.createElement(i.A.Item,{name:L,label:h("Type"),tooltip:{title:h("Select the block type to find any block on the list faster."),icon:l.createElement(p.A,null)},rules:[{message:"Please input type!"}]},l.createElement(n.A,{placeholder:h("Choose block type"),options:ee,getPopupContainer:()=>document.querySelector(".email-settings__collapse")}))))};V.defaultProps={className:"",email:void 0};const W=V},45185:(e,t,o)=>{o.d(t,{A:()=>A});var l=o(98173),a=o(201),i=o(66964),r=o(10750),n=o.n(r),d=o(97946),m=o.n(d),s=o(50664),c=o.n(s),u=o(36529),p=o.n(u),g=o(22548),b=o.n(g),E=o(20065),h=o.n(E),f=o(40277);o(39941);const v=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:p()},{sizeArray:[8,8,8],name:"column-three",html:b()},{sizeArray:[6,6,6,6],name:"column-four",html:h()},{sizeArray:[8,16],name:"column-two-33",html:m()},{sizeArray:[16,8],name:"column-two-66",html:c()}],A=()=>{const e=(0,f.sh)(),t=(0,f._9)();return l.createElement("div",{className:"structures blocks-search__empty-wrapper"},l.createElement("div",{className:"structures__list"},l.createElement("div",null,v&&v.map(((o,r)=>l.createElement("div",{key:o.name},l.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,o.html),onDragStart:e=>t(e,o.html)},l.createElement(a.A,{gutter:[6,6],className:"structures__item-row"},o.sizeArray.map(((e,t)=>l.createElement(i.A,{span:e,key:o.name+t},l.createElement("div",{className:"structures__item-col"}))))))))))))}},58099:(e,t,o)=>{o.d(t,{A:()=>A});var l=o(98173),a=o(201),i=o(66964),r=o(7549),n=o.n(r),d=o(29539),m=o.n(d),s=o(6573),c=o.n(s),u=o(75424),p=o.n(u),g=o(43643),b=o.n(g),E=o(96786),h=o.n(E),f=o(40277);o(39941);const v=[{sizeArray:[24],name:"column-one",html:n()},{sizeArray:[12,12],name:"column-two-50",html:p()},{sizeArray:[8,8,8],name:"column-three",html:b()},{sizeArray:[6,6,6,6],name:"column-four",html:h()},{sizeArray:[8,16],name:"column-two-33",html:m()},{sizeArray:[16,8],name:"column-two-66",html:c()}],A=()=>{const e=(0,f.sh)(),t=(0,f._9)();return l.createElement("div",{className:"structures blocks-search__empty-wrapper"},l.createElement("div",{className:"structures__list"},l.createElement("div",null,v&&v.map(((o,r)=>l.createElement("div",{key:o.name},l.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,o.html),onDragStart:e=>t(e,o.html)},l.createElement(a.A,{gutter:[6,6],className:"structures__item-row"},o.sizeArray.map(((e,t)=>l.createElement(i.A,{span:e,key:o.name+t},l.createElement("div",{className:"structures__item-col"}))))))))))))}},45271:(e,t,o)=>{o.d(t,{A:()=>u});var l=o(98173),a=o(2407),i=o.n(a),r=o(12543),n=o(64909),d=o(98845),m=o(68984),s=o(40277);const c=({element:e})=>{const{__:t,_x:o}=(0,r.s9)(),[a]=(0,d.dN)(),[i]=(0,m.OZ)(),c=(0,n.hN)(),u=(e,l)=>{if(e.error)return(0,s.p6)(e,c),!1;(0,s.wB)(t("The ")+(l.hasOwnProperty("type")?t("block"):o("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(l.lock?l.hasOwnProperty("type")?o("unlocked.","block"):o("unlocked.","email"):l.hasOwnProperty("type")?o("locked.","block"):o("locked.","email")),c)};return l.createElement("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:()=>{e.hasOwnProperty("type")?i({blockId:e.id,lock:!e.lock}).then((t=>{u(t,e)})):a({emailId:e.id,lock:!e.lock}).then((t=>{u(t,e)}))}},e.lock?t("Unlock"):t("Lock"))};c.defaultProps={element:i().shape({lock:null,id:null})};const u=c},41882:(e,t,o)=>{o.d(t,{A:()=>A});var l=o(98173),a=o(47555),i=o(63719),r=o(49856),n=o(13785),d=o(37969),m=o(30150),s=o(50078),c=o(12543),u=o(47091),p=o(79890),g=o(47113),b=o(40277),E=o(32947),h=o(96734);const{Content:f}=a.A,{Paragraph:v}=i.A,A=()=>{const{__:e}=(0,c.s9)(),{projectId:t,emailId:o}=(0,m.g)(),i=(0,h.p)();let A=(0,m.Zp)();const _=i.get(E.A9.em_template_email)||o;(0,l.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const y=l.createElement(l.Fragment,null,l.createElement(r.A,{size:10},l.createElement(n.A,{title:e("To emails"),placement:"left"},l.createElement(d.Ay,{type:"text",icon:l.createElement(s.A,null),onClick:()=>(0,b.XZ)(A,`/projects/${t}`),shape:"circle"})),l.createElement(v,{className:"ant-page-header-heading-title"},e("Select email template")),l.createElement(p.A,{isBlocks:!1,templateEmailId:_}))),S=l.createElement(l.Fragment,null);return l.createElement(a.A,{className:"template-page"},l.createElement(g.A,{leftBlock:y,rightBlock:S}),l.createElement(f,{className:"template-page__container"},l.createElement("div",{className:"template-page__content container"},l.createElement(u.A,{projectId:E.p5,emailsView:E.Y$,templateEmailId:_}))))}},37037:(e,t,o)=>{o.d(t,{A:()=>_});var l=o(98173),a=o(27499),i=o(38976),r=o(8218),n=o(94780),d=o(2604),m=o(26298),s=o.n(m),c=o(12543),u=o(98845),p=o(12741);const{utm_source:g,utm_medium:b,utm_campaign:E,utm_term:h,utm_content:f}={utm_source:"utm_source",utm_medium:"utm_medium",utm_campaign:"utm_campaign",utm_term:"utm_term",utm_content:"utm_content"},v={[g]:"",[b]:"",[E]:"",[h]:"",[f]:""},A=({className:e,email:t})=>{const{__:o}=(0,c.s9)(),m=(0,d.wA)(),[A]=a.A.useForm();(0,l.useEffect)((()=>{var e,o,l,a,i;t&&A.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(o=t.utm_parameters)||void 0===o?void 0:o.utm_medium)||"",utm_campaign:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_campaign)||"",utm_term:(null===(a=t.utm_parameters)||void 0===a?void 0:a.utm_term)||"",utm_content:(null===(i=t.utm_parameters)||void 0===i?void 0:i.utm_content)||""})}),[A,t]);return l.createElement("div",{className:s()("settings-panel",{[e]:e})},l.createElement(a.A,{form:A,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const o=Object.keys(e)[0];switch(o){case g:t.isNew?m((0,p.K3)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[o]}})})));break;case b:t.isNew?m((0,p.ol)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[o]}})})));break;case E:t.isNew?m((0,p.P3)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[o]}})})));break;case h:t.isNew?m((0,p.zH)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[o]}})})));break;case f:t.isNew?m((0,p.mk)(e[o])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[o]}})})));break;default:return}},autoComplete:"off"},l.createElement(i.A,{message:o("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),l.createElement(a.A.Item,{label:o("utm_source"),name:g,tooltip:{title:o("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:l.createElement(n.A,null)}},l.createElement(r.A,{placeholder:o("google")})),l.createElement(a.A.Item,{label:o("utm_medium"),name:b,tooltip:{title:o("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:l.createElement(n.A,null)}},l.createElement(r.A,{placeholder:o("cpc")})),l.createElement(a.A.Item,{label:o("utm_campaign"),name:E,tooltip:{title:o("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:l.createElement(n.A,null)}},l.createElement(r.A,{placeholder:o("spring_sale")})),l.createElement(a.A.Item,{label:o("utm_term"),name:h,tooltip:{title:o("Identifies search terms. For example: utm_term=running+shoes"),icon:l.createElement(n.A,null)}},l.createElement(r.A,{placeholder:o("running+shoes")})),l.createElement(a.A.Item,{label:o("utm_content"),name:f,tooltip:{title:o("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:l.createElement(n.A,null)}},l.createElement(r.A,{placeholder:o("textlink")}))))};A.defaultProps={className:"",email:void 0};const _=A},86774:(e,t,o)=>{o.d(t,{A:()=>k});var l=o(98173),a=o(63719),i=o(37969),r=o(38927),n=o(8218),d=o(13785),m=o(2604),s=o(26298),c=o.n(s),u=o(12543),p=o(80772),g=o(8807),b=o(48956),E=o(23424),h=o(871),f=o(47014),v=o(84572),A=o(27941),_=o(32947),y=o(6969);const{Text:S}=a.A,k=({onChange:e,value:t,validateStatus:o,placeholder:a,disabled:s,name:k,elementSettings:B,imageInfo:w})=>{var x,R;const P=(0,m.d4)(f.C1),N=(0,m.d4)(f.B$),T=(0,m.d4)(v.yN),I=(0,A.rD)(),{__:C}=(0,u.s9)(),[L,O]=(0,l.useState)({width:"",height:"",size:""}),[F,D]=(0,l.useState)(!1),[M,V]=(0,l.useState)(0);let W=(0,m.wA)();const z=(0,m.d4)(p.js),G=(0,m.d4)(p.Uf),j=(0,m.d4)(p.Ac),H=(0,m.d4)(E.cL),[U]=(0,h.FQ)();let X=!N&&(null===(x=P.id)||void 0===x?void 0:x.toString())===(null===T||void 0===T||null===(R=T.members)||void 0===R?void 0:R.owner.ID)&&!0;(0,l.useEffect)((()=>{t&&U(t).then((({data:e})=>{e&&O({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,U]),(0,l.useEffect)((()=>{s||(k.startsWith("src")&&z&&((null===B||void 0===B?void 0:B.type)!==_.bV.CAROUSEL||G===k&&!H)?(e(z),W((0,p.BK)())):"backgroundImage"===k&&j&&((null===B||void 0===B?void 0:B.type)!==_.bV.CAROUSEL||G===k&&!H)&&(e(j),W((0,p.BK)())),H&&(null===B||void 0===B?void 0:B.type)===_.bV.CAROUSEL||!G||W((0,p.BK)()))}),[z,G,j,e,k,s,null===B||void 0===B?void 0:B.type,W,H]);const q=(e=null)=>{k.startsWith("src")?(W((0,p.Yw)(k)),W((0,p.tm)(t)),W((0,E.qf)(e||_.lx.UPLOAD_IMAGE_MODAL))):k.startsWith("backgroundImage")&&(W((0,p.Yw)(k)),W((0,p.e_)(t)),W((0,E.qf)(e||_.lx.UPLOAD_BACKGROUND_MODAL)))},$=[{label:C("Upload"),key:"Upload",onClick:()=>q(k.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];I.imageCenterStockEnabled&&$.push({label:C("Stock"),key:"Stock",onClick:()=>q(k.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_STOCK:_.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),I.imageCenterGifEnabled&&$.push({label:C("GIF"),key:"GIF",onClick:()=>q(k.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_GIF:_.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),I.elementAIimageEnabled&&$.push({label:C("AI"),key:"AI",onClick:()=>q(k.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_AI:_.lx.UPLOAD_BACKGROUND_MODAL_AI)});return l.createElement("div",{className:c()("upload-bg-image",{"upload-bg-image_disabled":s})},!t||t&&"error"===o?l.createElement(i.Ay,{type:"default",block:!0,onClick:()=>q(k.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},l.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),C("Add image")):l.createElement("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,o,l,a;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(o=e.target)&&void 0!==o&&o.closest(".upload-bg-image__edit-menu")||null!==(l=e.target)&&void 0!==l&&l.closest(".upload-bg-image__menu")||null!==(a=e.target)&&void 0!==a&&a.closest(".inputGroup")||q(k.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}},l.createElement(r.A,{arrow:!0,dropdownRender:()=>I.imagePathDropdownEnabled?l.createElement("div",{className:"inputGroup"},l.createElement(n.A,{prefix:l.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:a,name:k,disabled:s,className:"upload-bg-image__input"})):l.createElement(l.Fragment,null),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")},l.createElement("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"}},l.createElement("div",{className:"upload-bg-image__uploader"},l.createElement("div",{className:"upload-bg-image__uploader-content"},l.createElement("div",{className:"upload-bg-image__uploader-content-inner"},l.createElement("div",{className:"upload-bg-image__uploader-img-wrap"},l.createElement("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})),l.createElement("div",{className:"upload-bg-image__uploader-icons-wrap"},l.createElement("div",{className:"upload-bg-image__uploader-content"}))))),L.width&&L.height?l.createElement("div",{className:"image-size"},L.width," \xd7 ",L.height,!!B&&(B.type===_.bV.IMG||B.type===_.bV.CAROUSEL)&&" \u2192 "+w.renderedWidth+" \xd7 "+w.renderedHeight,l.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),l.createElement("span",null,L.size," ",C("kB")),L.format&&l.createElement(l.Fragment,null,l.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),l.createElement("span",{className:"image-size-format"},L.format))):l.createElement(S,{type:"secondary",className:"image-empty-text"},a))),l.createElement("div",{style:{flexGrow:1}}),"gif"!==L.format&&I.imageCenterEditorEnabled&&l.createElement(d.A,{title:C("Edit")},l.createElement(S,{type:"link",className:"upload-bg-image__edit"},l.createElement(y.A,{style:{fontSize:16},onClick:e=>{X?(D(!0),V(5)):(q(),W((0,E.Wz)(_.lx.IMAGE_EDITOR_MODAL)))}}))),l.createElement(r.A,{key:"Actions",arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:$},overlayClassName:"upload-bg-image__menu"},l.createElement(S,{type:"link",className:"upload-bg-image__edit-menu image-change"},!t||t&&"error"===o?C("Upload"):l.createElement(g.A,{style:{fontSize:20},icon:"Reload",onClick:()=>q(k.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})))),l.createElement(b.A,{open:F,onCancel:()=>{D(!1)},initialSlide:M}))}},33932:(e,t,o)=>{o.d(t,{EQ:()=>d,YG:()=>s,Zs:()=>n,gb:()=>m});var l=o(14721),a=o(39539),i=o(58521);const r="Ai",n=(0,l.xP)({reducerPath:"AiApi",tagTypes:[r],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({sendMessage:e.mutation({queryFn:({body:e},t)=>(0,i.KU)(t).saveFile.ai_create(e,{type:a.cM.FormData})}),getDialog:e.query({queryFn:({entity_id:e,connection:t="chat"},o)=>(0,i.KU)(o).saveFile.ai_status_list({connection:t,entity_id:e}),providesTags:e=>null!==e&&void 0!==e&&e.documents?[...e.documents.map((({id:e})=>({type:r,id:e}))),{type:r,id:"LIST"}]:[{type:r,id:"LIST"}]})})}),{useSendMessageMutation:d,useGetDialogQuery:m,useLazyGetDialogQuery:s}=n},70875:(e,t,o)=>{o.d(t,{Ll:()=>g,MN:()=>E,Uu:()=>c,y4:()=>b});var l=o(14721),a=o(58521),i=o(32947),r=o(97404),n=o(79596),d=o(18987),m=o(12352),s=o(3792);const c=(0,l.xP)({reducerPath:"AiApiGenerator",baseQuery:r.i,endpoints:e=>({generateIdForTask:e.mutation({queryFn:(e,t)=>(0,a.u$)(t).tasks.tasksControllerCreateTask(e).then((e=>e))}),clearAiChat:e.query({queryFn:(e,t)=>(0,a.KU)(t).aiGenerator.clear_history_list(e).then((e=>e))}),getGeneratedContent:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({id:e,setError:t},o){const{updateCachedData:l,cacheEntryRemoved:r}=o;let c=(0,a.KU)(o).baseUrl.indexOf("emailmaker")>=0?i.e3.maker:i.e3.blocks;const u=i.EW.isPlugin?await s.di.getInstance(o,m.Y):d.A.get(i.A9.em_token),p=u?{Authorization:`Bearer ${u}`}:{},g=new n.EventSourcePolyfill(`${c}/tasks/${e}`,{headers:p});g.onmessage=e=>{const t=JSON.parse(e.data);l((e=>{e.push(t)}))},g.onerror=e=>{t("Error connecting to EventSource"),g.close()},await r,g.close()}}),getAiGenerateStatus:e.mutation({query:e=>({url:"/constructor/v1/ai-save-task",method:"POST",body:e})})})}),{useGenerateIdForTaskMutation:u,useGetGeneratedContentQuery:p,useLazyClearAiChatQuery:g,useLazyGetGeneratedContentQuery:b,useGetAiGenerateStatusMutation:E}=c},7026:(e,t,o)=>{o.d(t,{V:()=>d});var l=o(18987),a=o(3792),i=o(12352),r=o(32947),n=o(24527);async function d(e,t,o,d){const m={blocks:d,types:n.G,locale:t};o.current=m;try{const e=await async function(){return r.EW.isPlugin?await a.di.getInstance(null,i.Y):l.A.get(r.A9.em_token)||null}(),t=await fetch(n.M,{method:"POST",headers:{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}},body:JSON.stringify(m)});if(!t.ok||200!==t.status)throw new Error(`${t.statusText}`);return await t.json()}catch(s){throw s}}},8111:(e,t,o)=>{o.d(t,{Jg:()=>s,z2:()=>u,HI:()=>p,vn:()=>b,kk:()=>g,Cf:()=>c});var l=o(14721),a=o(39539),i=o(93778),r=o(31926);function n({id:e,post:t,parent:o,author:l,content:a,acf:{status:i,target_id:n},...d}){return{...d,id:(0,r.WY)(e),post:(0,r.WY)(t),parent:(0,r.WY)(o),author:(0,r.WY)(l),content:(0,r.vf)(a),target_id:n,comment_status:i}}var d=o(58521);const m="Comments",s=(0,l.xP)({reducerPath:"commentsApi",tagTypes:[m],baseQuery:(0,d.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getComments:e.query({queryFn:function(e,t){return(0,d.KU)(t).wp.comments_list({post:[(0,r.mQ)(e)],per_page:50,order:"asc"}).then((0,i.Ih)(n))},providesTags:e=>e?[...e.map((({id:e})=>({type:m,id:e}))),{type:m,id:"LIST"}]:[{type:m,id:"LIST"}]}),addComment:e.mutation({queryFn({subjectId:e,author:t,parent:o,content:l,author_name:m,author_email:s,targetId:c},u){const p=(0,d.KU)(u),g={post:(0,r.mQ)(e),author:(0,r.mQ)(t),author_name:m,author_email:s},b={};return l&&(g.content=l),o&&(g.parent=(0,r.mQ)(o)),c&&(b["acf[target_id]"]=c),p.wp.comments_create(g,{type:a.cM.UrlEncoded,extraQuery:b}).then((0,i.SC)(n))},invalidatesTags:[{type:m,id:"LIST"}]}),deleteComment:e.mutation({queryFn:(e,t)=>(0,d.KU)(t).wp.comments_delete(e,{}).then((0,i.PI)(n)),invalidatesTags:[{type:m,id:"LIST"}]}),editComment:e.mutation({queryFn({commentId:e,content:t,status:o,targetId:l},r){const m=(0,d.KU)(r),s={},c={};return t&&(s.content=t),o&&(c["acf[status]"]=o),l&&(c["acf[targetId]"]=l),m.wp.comments_update(e,s,{type:a.cM.UrlEncoded,extraQuery:c}).then((0,i.SC)(n))},invalidatesTags:[{type:m,id:"LIST"}]}),deleteTarget:e.mutation({queryFn:(e,t)=>(0,d.KU)(t).wp.comments_delete(e,{},{extraQuery:{"acf[target_id]":""}}).then((0,i.PI)(n)),invalidatesTags:[{type:m,id:"LIST"}]})})}),{useGetCommentsQuery:c,useAddCommentMutation:u,useDeleteCommentMutation:p,useEditCommentMutation:g,useDeleteTargetMutation:b}=s},94160:(e,t,o)=>{o.d(t,{C:()=>r,F:()=>i});var l=o(14721),a=o(27943);const i=(0,l.xP)({reducerPath:"confirmationMailApi",baseQuery:(0,a.cw)({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:e,email:t})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${e}&user_email=${t}`)}`})})})}),{useLazyGetConfirmationMailQuery:r}=i},98845:(e,t,o)=>{o.d(t,{GY:()=>u,Kh:()=>v,Gr:()=>S,LX:()=>k,dN:()=>A,YV:()=>h,sl:()=>b,Xw:()=>p,PX:()=>g,YE:()=>f,_3:()=>E});var l=o(14721),a=o(39539),i=o(93207),r=o(31926);function n({id:e,title:t,acf:{html:o,common_styles:l},parent:a,excerpt:i,author:n,...d}){return{...d,author:(0,r.WY)(n),id:(0,r.WY)(e),parent:(0,r.WY)(a),title:(0,r.vf)(t)||"",html:o,common_styles:l,excerpt:(0,r.pT)(i)?i.rendered:i}}var d=o(58521),m=o(93778),s=o(50861),c=o(32947);const u=(0,l.xP)({reducerPath:"emailsApi",tagTypes:["Emails","Email","EmailAutosaves","TemplateEmail"],baseQuery:(0,d.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmails:e.query({queryFn(e,t){var o,l;const a=(0,d.KU)(t),r={order:"desc",orderby:"modified"},n={};if(e.notEmbed||(n._embed=""),e.projectId&&(n._embed="author",n._fields="id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,author,acf.is_template",r["filter[meta_key]"]="project",r["filter[meta_value]"]=e.projectId),e.fields&&(n._fields=e.fields),e.page&&(r.page=e.page),e.order&&(r.order=e.order),e.orderby&&(r.orderby=e.orderby),e.folderTag&&e.folderTag!==c.y2?(r["filter[tax_query][relation]"]="AND",r["filter[tax_query][0][taxonomy]"]="folder",r["filter[tax_query][0][field]"]="id",r["filter[tax_query][0][terms]"]=e.folderTag,r["filter[tax_query][0][include_children]"]="0"):e.folderTag===c.y2&&("object"!==typeof e.folderTag||null!==e.folderTag)||null!==(o=e.tags)&&void 0!==o&&o.length||!e.status||"trash"===e.status||(r["filter[tax_query][0][taxonomy]"]="folder",r["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(l=e.tags)||void 0===l?void 0:l.length)>0&&"trash"!==e.status){r["filter[tax_query][relation]"]="AND";for(let t=0,o=e.tags.length;t<o;t++){const o=e.tags[t];r[`filter[tax_query][${t+1}][taxonomy]`]="emailtags",r[`filter[tax_query][${t+1}][field]`]="id",r[`filter[tax_query][${t+1}][terms]`]=o}}return e.name&&(r.search=e.name),e.pageSize&&(r.per_page=e.pageSize),"trash"===e.status&&(n.status="trash"),a.wp.email_list(r,{extraQuery:n}).then((0,m.Ih)(i.V))},providesTags:(e,t,o,{response:l})=>{var a,i;const r=(null===l||void 0===l?void 0:l.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Emails",id:`${o.folderTag||(null===(t=o.tags)||void 0===t?void 0:t[0])||o.projectId}_${o.page}_${o.status}_${r}`}})),{type:"Emails",id:`${o.folderTag||(null===(a=o.tags)||void 0===a?void 0:a[0])||o.projectId}_${o.page}_${o.status}_${r}`}]:[{type:"Emails",id:`${o.folderTag||(null===(i=o.tags)||void 0===i?void 0:i[0])||o.projectId}_${o.page}_${o.status}_${r}`}]},keepUnusedDataFor:0}),getTemplateEmails:e.query({queryFn(e,t){var o,l,a;const r=(0,d.KU)(t);let n={"filter[meta_query][1][key]":"is_template","filter[meta_query][1][value]":"1","filter[meta_query][0][compare]":"LIKE",orderby:"modified",order:"desc"};const s={_embed:"wp:term",_fields:"_embedded,id,title,emailtags,folder,group,modified,date,type,acf.lock,acf.project.ID,acf.is_template"};if(e.emailId&&(n["filter[meta_query][0][key]"]="parent_email",n["filter[meta_query][0][value]"]=e.emailId),e.fields&&(s._fields=e.fields),(null===(o=e.group)||void 0===o?void 0:o.length)>0||(null===(l=e.projectGroup)||void 0===l?void 0:l.length)>0){const t=[...e.group||[],...e.projectGroup||[]].reduce(((e,{key:t,parentId:o})=>(e[o]||(e[o]=[]),e[o].push(String(t)),e)),{}),o=Object.values(t).map((e=>e.sort()));n["filter[tax_query][relation]"]="AND",o.forEach(((e,t)=>{n[`filter[tax_query][${t}][relation]`]="OR",e.forEach(((e,o)=>{n[`filter[tax_query][${t}][${o}][taxonomy]`]="group",n[`filter[tax_query][${t}][${o}][field]`]="id",n[`filter[tax_query][${t}][${o}][terms]`]=e}))}))}if((null===(a=e.tags)||void 0===a?void 0:a.length)>0){n["filter[tax_query][relation]"]="AND";for(let t=0,o=e.tags.length;t<o;t++){const o=e.tags[t];n[`filter[tax_query][${t}][taxonomy]`]="emailtags",n[`filter[tax_query][${t}][field]`]="id",n[`filter[tax_query][${t}][terms]`]=o}}if(e.type&&(n["filter[meta_query][2][key]"]="type",n["filter[meta_query][2][value]"]=e.type),e.name&&(n.search=e.name),e.pageSize&&(n.per_page=e.pageSize),e.page){var u,p;n.page=e.page;const o=t.getState(),{groupsTemplateProjectTotal:l,groupsTemplateProjectTotalPages:a}=null===o||void 0===o?void 0:o.projectSlice;if((null===(u=e.projectGroup)||void 0===u||!u.length)&&(null===(p=e.group)||void 0===p||!p.length)&&a<e.page&&e.groupType===c.ti.ALL&&l&&a&&!e.projectId){const t=c.mU-l%c.mU+(e.page-(a+1))*c.mU;t&&(n.page=1,n.offset=t)}}return e.projectId&&(n["filter[meta_key]"]="project",n["filter[meta_value]"]=e.projectId),r.wp.email_list(n,{extraQuery:s}).then((0,m.Ih)(i.V))},keepUnusedDataFor:0}),getEmail:e.query({queryFn:(e,t)=>(0,d.KU)(t).wp.email_detail({id:(0,r.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,m.SC)(i.V)),providesTags:(e,t,o)=>[{type:"Email",id:o}],keepUnusedDataFor:0}),getTemplateEmail:e.query({queryFn:(e,t)=>(0,d.KU)(t).wp.email_detail({id:(0,r.mQ)(e)},{extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,parent,date_gmt\n acf.description,\n acf.html,\n acf.common_styles,\n acf.is_template,\n acf.lock,\n acf.parent_email,\n acf.project,\n acf.secret_hash,\n acf.subject,\n acf.utm_parameters\n "}}).then((0,m.SC)(i.V)),providesTags:(e,t,o)=>[{type:"TemplateEmail",id:o}],keepUnusedDataFor:0}),getEmailHistory:e.query({queryFn:({emailId:e,page:t=1},o)=>(0,d.KU)(o).wp.email_revisions_detail({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id,parent,date_gmt"}}).then((o=>(0,m.SA)(o,((o,l)=>({data:o.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(n),totalPages:+l.response.headers.get("X-WP-TotalPages"),args:{emailId:e,page:t}}))))),providesTags:e=>e?[...e.data.map((({id:e})=>({type:"EmailAutosaves",id:e}))),{type:"EmailAutosaves",id:"LIST"}]:[{type:"EmailAutosaves",id:"LIST"}],keepUnusedDataFor:0}),addEmail:e.mutation({queryFn:(0,s.p)((e=>({source:t,...o})=>(0,d.KU)(e).wp.email_create({status:"publish",...(0,i.v)(o)},{type:a.cM.Json}).then((0,m.SC)(i.V)))),invalidatesTags:[{type:"Emails",id:"LIST"}]}),editEmail:e.mutation({queryFn:(0,s.p)((e=>({emailId:t,source:o,...l})=>{const n=(0,d.KU)(e),s=(0,r.TB)((0,i.v)(l));return n.wp.email_partial_update(t,s,{type:a.cM.Json,extraQuery:{_embed:"wp:term",_fields:"_embedded,id,author,title,emailtags,folder,group,modified,date,type,acf.description,acf.html,acf.common_styles,acf.is_template,acf.lock,acf.parent_email,acf.project,acf.secret_hash,acf.subject,acf.utm_parameters"}}).then((0,m.SC)(i.V))}))}),deleteEmail:e.mutation({queryFn(e,t){const o=(0,d.KU)(t);let l,a;return"object"===typeof e?(l=e.id,a=e.force):(l=e,a=!1),o.wp.email_delete(l,{force:a}).then((0,m.PI)(i.V))},invalidatesTags:(e,t,o)=>[{type:"Emails",id:o}]}),addTag:e.mutation({queryFn:(e,t)=>(0,d.KU)(t).wp.emailtags_create({...e},{type:a.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],o)=>(0,d.KU)(o).wp.email_list({status:["private"],"filter[meta_key]":"project","filter[meta_value]":e,emailtags:[t]},{extraQuery:{"_fields[]":"emailtags"}}).then((0,m.Ih)(i.V))}),autoSaveEmail:e.mutation({queryFn({emailId:e,body:t},o){const l=(0,d.KU)(o),i=function({parent:e,title:t,html:o,project:l,subject:a,preheader:i,common_styles:n,author:d,parent_email:m,...s}){return{...s,author:(0,r.mQ)(d),title:t,parent:(0,r.mQ)(e),"acf[html]":o,"acf[project]":l,"acf[parent_email]":m,"acf[common_styles]":n}}(t);return l.wp.email_autosaves_create(e,i,{type:a.cM.FormData}).then((0,m.SC)(n))}})})}),{useGetEmailsQuery:p,useGetTemplateEmailsQuery:g,useGetEmailQuery:b,useLazyGetEmailQuery:E,useGetEmailHistoryQuery:h,useLazyGetEmailHistoryQuery:f,useAddEmailMutation:v,useEditEmailMutation:A,useDeleteEmailMutation:_,useGetDeletableTagQuery:y,useAddTagMutation:S,useAutoSaveEmailMutation:k}=u},38251:(e,t,o)=>{o.d(t,{U8:()=>r,cA:()=>d,ri:()=>n});var l=o(27943),a=o(14721),i=o(40277);const r=(0,a.xP)({reducerPath:"exportPngApi",baseQuery:async(e,t,o)=>{try{const{notification:a,...i}=e,r=await(0,l.cw)({baseUrl:"https://racs.rest/v3"})(i,t,o);if(r.error)throw new Error;return r}catch(a){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(a,t),{error:a}}},endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:e,title:t,notification:o})=>{const l=new Blob([e],{type:"text/html"}),a=new FormData;return a.append("file",l,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:o}}}),deleteTemporaryMail:e.mutation({query:({id:e,notification:t})=>({url:`/${e}?resource=exportPngApi`,method:"DELETE",notification:t})})})}),{useMakeTemporaryMailForPngMutation:n,useDeleteTemporaryMailMutation:d}=r},30397:(e,t,o)=>{o.d(t,{C:()=>i,N:()=>r});var l=o(14721),a=o(27943);const i=(0,l.xP)({reducerPath:"webHookApi",baseQuery:(0,a.cw)({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:e,body:t})=>({url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t})})})}),{usePostDataByWebHookMutation:r}=i},64706:(e,t,o)=>{o.d(t,{N:()=>r,m:()=>n});var l=o(27943),a=o(14721),i=o(40277);const r=(0,a.xP)({reducerPath:"htmlToPdfPlusApi",baseQuery:async(e,t,o)=>{try{const{notification:a,...i}=e,r=await(0,l.cw)({baseUrl:"https://html2pdf.emcdn.ru/convert/html-to-pdf"})(i,t,o);if(r.error)throw new Error;return r}catch(a){const t=null===e||void 0===e?void 0:e.notification;return(0,i.p6)(a,t),{error:a}}},endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:e,notification:t})=>({url:"",method:"POST",body:e,notification:t,responseHandler:e=>e.blob()})})})}),{useGenerateHtmlToPdfMutation:n}=r},871:(e,t,o)=>{o.d(t,{CL:()=>c,FQ:()=>u,Jg:()=>_,Mv:()=>h,eo:()=>S,gg:()=>B,h4:()=>b});var l=o(14721),a=o(79596),i=o(39539),r=o(58521),n=o(18987),d=o(32947),m=o(12352),s=o(3792);const c=(0,l.xP)({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(e,t){try{var o,l;const a=(null===(o=t.getState().configSlice)||void 0===o||null===(l=o.config)||void 0===l?void 0:l.imageInfoToolUrl)||"https://scr.emcdn.ru/imageinfo",i=await fetch(`${a}?url=${encodeURIComponent(e)}`);return{data:await i.json()}}catch(a){}}}),getSearchImage:e.query({queryFn:async function({query:e,page:t}){const o=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let l=`https://api.unsplash.com/search/photos?client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o&lang=ru&per_page=18&query=${o}&page=${t}`;""!==e.color&&(l+=`&color=${e.color}`),""!==e.orientation&&(l+=`&orientation=${e.orientation}`);const a=await fetch(l);return{data:await a.json()}}catch(l){}}}),getUnsplashImage:e.query({queryFn:async function(e){try{const t=await fetch(`${e}&client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o`);return{data:await t.json()}}catch(t){}}}),sendAiImageRequest:e.query({queryFn:async function({body:e},t){try{const o=(0,r.KU)(t);return await o.saveFile.ai_create(e,{type:i.cM.FormData})}catch(o){throw new Error(o)}}}),getAiImage:e.query({queryFn:async function(e,t){try{const o=(0,r.KU)(t);return await o.saveFile.ai_status_list(e)}catch(o){}}}),getAiImageSSE:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({task_id:e,entity_id:t,setError:o},l){const{updateCachedData:i,cacheEntryRemoved:c}=l;let u=(0,r.KU)(l).baseUrl.indexOf("emailmaker")>=0?d.Rn.maker:d.Rn.blocks;const p=d.EW.isPlugin?await s.di.getInstance(l,m.Y):n.A.get(d.A9.em_token),g=p?{Authorization:`Bearer ${p}`}:{},b=new a.EventSourcePolyfill(` ${u}/wp-json/ai-generator/v1/ai-status?entity_id=${t}&stream=1&task_id=${e}`,{headers:g});b.onmessage=e=>{const t=JSON.parse(e.data);i((e=>{e.push(t)})),100===t.progress&&b.close()},b.onerror=e=>{b.close()},await c,b.close()}}),getSearchGif:e.query({queryFn:async function({query:e,page:t}){const o=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let e=`https://api.giphy.com/v1/gifs/search?api_key=Nh77eBlPeMn1ed9MBAvL542NUGeNO26F&q=${o}&limit=25&offset=${t}&lang=en`;const l=await fetch(e);return{data:await l.json()}}catch(l){}}})})}),{useLazyGetImageInfoQuery:u,useGetImageInfoQuery:p,useGetSearchImageQuery:g,useLazyGetSearchImageQuery:b,useSendAiImageRequestQuery:E,useLazySendAiImageRequestQuery:h,useGetAiImageQuery:f,useLazyGetAiImageQuery:v,useGetUnsplashImageQuery:A,useLazyGetUnsplashImageQuery:_,useGetSearchGifQuery:y,useLazyGetSearchGifQuery:S,useGetAiImageSSEQuery:k,useLazyGetAiImageSSEQuery:B}=c},12005:(e,t,o)=>{o.d(t,{Ad:()=>n,HO:()=>c,Yj:()=>s});var l=o(14721),a=o(27943),i=o(58521);const r="LOCALES",n=(0,l.xP)({reducerPath:"localesApi",tagTypes:[r],baseQuery:(0,a.cw)({baseUrl:"https://app.emailmaker.ru/api/wp-json/translations/v1"}),endpoints:e=>({getLocale:e.query({async queryFn({id:e},t){const o=(0,i.KU)(t);try{return await o.translations.get_translations3(e,"react_app")}catch(l){return o.translations.get_translations3("en_US","react_app")}},providesTags:(e,t,o)=>[{type:r,id:o}]}),getLocales:e.query({queryFn:function(e,t){return(0,i.KU)(t).translations.get_translations2("react_app")},providesTags:(e,t,o)=>[{type:r,id:"react_app"}]})})}),{useGetLocalesQuery:d,useGetLocaleQuery:m,useLazyGetLocaleQuery:s,useLazyGetLocalesQuery:c}=n},15422:(e,t,o)=>{o.d(t,{F:()=>r,Y:()=>i});var l=o(31926),a=o(39218);function i({id:e,type:t,title:o,excerpt:i,author:r,acf:{subject:n,description:d,html:m,project:s,related_email:c,tags:u,type:p,is_template:g,lock:b},...E}){return{...E,id:String(e),author:String(r),renderGuid:(0,a.l)(),description:d,html:m,excerpt:(0,l.vf)(o),project:(0,l.pT)(s)?s.ID:s,project_author:(0,l.pT)(s)?s.post_author:void 0,project_title:(0,l.pT)(s)?s.post_title:void 0,tags:u,is_template:g,type:p,related_email:(0,l.WY)((0,l.pT)(c)?c.ID:c),title:(0,l.vf)(o)||"",lock:b}}function r({title:e,subject:t,description:o,renderGuid:a,html:i,project:r,tags:n,type:d,related_email:m,is_template:s,lock:c,author:u,...p}){return{...p,author:(0,l.mQ)(u),title:e,acf:{description:o,related_email:(0,l.mQ)(m),html:i,project:r,tags:n,type:d,is_template:s,lock:c}}}},98664:(e,t,o)=>{o.d(t,{n:()=>a});var l=o(31926);function a({parent:e,title:t,html:o,project:a,author:i,...r}){return{...r,author:(0,l.mQ)(i),parent:(0,l.mQ)(e),title:(0,l.vf)(t),"acf[html]":o,"acf[project]":a}}},17487:(e,t,o)=>{o.d(t,{H:()=>a});var l=o(31926);function a({id:e,title:t,acf:{html:o},excerpt:a,parent:i,author:r,...n}){return{...n,id:(0,l.WY)(e),author:(0,l.WY)(r),parent:(0,l.WY)(i),title:(0,l.vf)(t)||"",html:o,excerpt:(0,l.pT)(a)?a.rendered:a}}},93207:(e,t,o)=>{o.d(t,{V:()=>i,v:()=>r});var l=o(31926),a=o(39218);function i({id:e,title:t,type:o,guid:i,acf:{lock:r,subject:n,description:d,html:m,project:s,tags:c,utm_parameters:u,parent_email:p,common_styles:g,is_template:b},author:E,...h}){return{...h,id:(0,l.WY)(e),author:(0,l.WY)(E),title:(0,l.vf)(t)||"",lock:r,renderGuid:(0,a.l)(),description:d,html:m,project:(0,l.pT)(s)?s.ID:s,project_author:(0,l.pT)(s)?s.post_author:void 0,project_title:(0,l.pT)(s)?s.post_title:void 0,tags:c,utm_parameters:u,parent_email:(0,l.WY)(p instanceof Array&&p[0]?p[0].ID:p),common_styles:g,is_template:b}}function r({title:e,lock:t,subject:o,description:a,html:i,project:r,tags:n,renderGuid:d,utm_parameters:m,parent_email:s,common_styles:c,is_template:u,author:p,...g}){return{...g,author:(0,l.mQ)(p),title:e,acf:{lock:t,description:a,html:i,project:r,tags:n,utm_parameters:m,parent_email:(0,l.mQ)(s),common_styles:c,is_template:u}}}},16618:(e,t,o)=>{o.d(t,{b:()=>i,d:()=>a});var l=o(31926);function a({title:e,acf:{members:t,projects_test_emails:o,ftp_settings:a,emails:i,blocks:r,webhook:n},...d}){return{...d,title:(0,l.vf)(e)||"",members:(0,l.pT)(t)?{admins:t.admins&&t.admins.map((e=>({...e,ID:(0,l.WY)(e.ID)}))),users:t.users&&t.users.map((e=>({...e,ID:(0,l.WY)(e.ID)}))),invited_users:t.invited_users&&t.invited_users.map((e=>({...e,ID:(0,l.WY)(e.ID)}))),owner:(0,l.pT)(t.owner)?{...t.owner,ID:(0,l.WY)(t.owner.ID)}:t.owner}:void 0,projects_test_emails:o,ftp_settings:a,webhook:n,emails:i,blocks:r}}function i({title:e,members:t,projects_test_emails:o,ftp_settings:a,webhook:i,emails:r,blocks:n,...d}){const m=e=>({ID:(0,l.mQ)(e.ID||e)}),s=e=>{return(t=e,Array.isArray(t)?t:t?[t]:[]).map(m);var t};return{...d,title:e,acf:{members:t&&{admins:s(t.admins),users:s(t.users),invited_users:s(t.invited_users),owner:t.owner&&m(t.owner)},webhook:i,projects_test_emails:o,ftp_settings:a,emails:r,blocks:n}}}},68936:(e,t,o)=>{o.d(t,{i:()=>a});var l=o(31926);function a({title:e,acf:{limits:t,price:o},...a}){return{...a,title:(0,l.vf)(e)||"",limits:t,price:o}}},71676:(e,t,o)=>{o.d(t,{F:()=>a,L:()=>i});var l=o(31926);function a({acf:{autosaves:e,hide_mergetags:t,theme:o,newsletter_consent:a,code_editor:i,counters:r,subscription:n,subscription_end:d,recurring_payments:m,subscription_id:s,promocode:c,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:b,privacy_policy_agreement:E,last_used_project:h,email_confirmation:f,email_builder_config:v},id:A,..._}){return{..._,id:(0,l.WY)(A),autosaves:e,hide_mergetags:t,theme:o,newsletter_consent:a,code_editor:i?{...i,font_size:Number(i.font_size)}:void 0,counters:Object.keys(r).reduce(((e,t)=>(e[t]=Number(r[t]),e)),{}),subscription:n,subscription_end:d,recurring_payments:m,subscription_id:s,promocode:c,subscription_amount:u,enterprise_users_limit:p,enterprise_price:g,enterprise_12_price:b,privacy_policy_agreement:E,last_used_project:h,email_confirmation:f,email_builder_config:v}}function i({autosaves:e,theme:t,newsletter_consent:o,code_editor:a,counters:i,subscription:r,subscription_end:n,recurring_payments:d,subscription_id:m,promocode:s,subscription_amount:c,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:b,locale:E,last_used_project:h,email_confirmation:f,email_builder_config:v,id:A,..._}){return{..._,id:(0,l.mQ)(A),locale:E,acf:{autosaves:e,theme:t,newsletter_consent:o,code_editor:a?{...a,font_size:String(a.font_size)}:void 0,counters:i,subscription:r,subscription_end:n,recurring_payments:d,subscription_id:m,promocode:s,subscription_amount:c,enterprise_users_limit:u,enterprise_price:p,enterprise_12_price:g,privacy_policy_agreement:b,last_used_project:h,email_confirmation:f,email_builder_config:v}}}},31926:(e,t,o)=>{function l(e,t=!1){const o={};for(const a of Object.keys(e)){let i=e[a];void 0===i||"number"===typeof i&&Number.isNaN(i)||(t&&"object"===typeof i&&null!==i&&(i=l(i)),o[a]=i)}return o}function a(e){return"object"===typeof e&&e}function i(e){const t=Number(e);return isNaN(t)?e:t}function r(e){return"number"===typeof e?String(e):e}function n(e){return"object"===typeof e?e.rendered:e}o.d(t,{TB:()=>l,WY:()=>r,mQ:()=>i,pT:()=>a,vf:()=>n})},705:(e,t,o)=>{o.d(t,{vx:()=>s,I9:()=>c,bw:()=>u});var l=o(14721),a=o(39539),i=o(93778),r=o(31926);function n({title:e,content:t,acf:{seen:o,type:l},...a}){return{...a,seen:o,type:l,title:(0,r.vf)(e),content:t}}var d=o(58521);const m="Notifications",s=(0,l.xP)({reducerPath:"notificationsApi",tagTypes:[m],baseQuery:(0,d.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn:(e,t)=>(0,d.KU)(t).wp.notification_list({author:[Number(e)]}).then((0,i.Ih)(n)),providesTags:e=>e?[...e.map((({id:e})=>({type:m,id:e}))),{type:m,id:"LIST"}]:[{type:m,id:"LIST"}]}),notificationShown:e.mutation({queryFn:({id:e,datetime:t},o)=>(0,d.KU)(o).wp.notification_create2(e,{},{type:a.cM.Json,extraQuery:{"acf[seen]":t}}).then((0,i.SC)(n)),invalidatesTags:[{type:m,id:"LIST"}]})})}),{useGetNotificationsQuery:c,useNotificationShownMutation:u}=s},2952:(e,t,o)=>{o.d(t,{Ju:()=>d,Sr:()=>m,ku:()=>n,tO:()=>r});var l=o(14721),a=o(58521);const i="Optimise",r=(0,l.xP)({reducerPath:"optimiseApi",tagTypes:[i],baseQuery:async(e,t,o)=>{const l=(0,a.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),i=(0,a.hI)({baseUrl:`${l}/optimization/v1/validate`});let r=await i(e,t,o);if(r.error){let e=r.error;if("function"===typeof e.json)try{e=await e.json()}catch{e=await e}return{error:e}}return r},endpoints:e=>({editLinks:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/links",body:e}),invalidatesTags:[i]}),editImages:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/images",body:e})}),editSpam:e.mutation({query:e=>({headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",type:"application/json",url:"/spamassasin",body:e})})})}),{useEditLinksMutation:n,useEditImagesMutation:d,useEditSpamMutation:m}=r},59089:(e,t,o)=>{o.d(t,{So:()=>i});var l=o(14721),a=o(58521);const i=(0,l.xP)({reducerPath:"promoApi",baseQuery:(0,a.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:e,type:t},o)=>(0,a.KU)(o).promo.set_code_create({code:e,type:t})}),getPromoInfo:e.query({queryFn:({code:e},t)=>(0,a.KU)(t).promo.get_code_info_list({code:e})})})}),{useCheckPromoMutation:r,useGetPromoInfoQuery:n}=i},92960:(e,t,o)=>{o.d(t,{Z8:()=>i,mI:()=>n});var l=o(14721),a=o(58521);const i=(0,l.xP)({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:(0,a.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:e,tryFetch:t=!0,type:o},l){const i=(0,a.KU)(l),r=t?fetch(e):Promise.reject(),n=e=>(e=>{switch(o){case"json":return e.json();case"text":return e.text();default:return e.blob()}})(e).then((e=>({data:e})));return r.then((e=>n(e))).catch((()=>i.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(e)}})))}})})}),{useGetFileQuery:r,useLazyGetFileQuery:n}=i},40835:(e,t,o)=>{o.d(t,{Zf:()=>m,dS:()=>n,lg:()=>d,tb:()=>s,yH:()=>r});var l=o(14721),a=o(39539),i=o(58521);const r=(0,l.xP)({reducerPath:"saveFileApi",tagTypes:["Images"],baseQuery:(0,i.hI)({baseUrl:"https://app.emailmaker.ru/api/wp-json/save-file/v1/"}),endpoints:e=>({uploadImage:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.upload_create(e,{type:a.cM.FormData})}),sendTestEmail:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.send_email_create(e,{type:a.cM.FormData})}),sendLivePreview:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.get_link_create(e,{type:a.cM.FormData})}),sendShortLink:e.mutation({queryFn:(e,t)=>(0,i.KU)(t).saveFile.shortener_create(e,{type:a.cM.FormData})})})}),{useUploadImageMutation:n,useSendTestEmailMutation:d,useSendLivePreviewMutation:m,useSendShortLinkMutation:s}=r},53774:(e,t,o)=>{o.d(t,{i:()=>i,$:()=>a});const l={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,exportTextEnabled:!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,lockEditor:!1,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,exportTextEnabled:!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,lockEditor:!1,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,exportTextEnabled:!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,lockEditor:!1,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:""}},blocks:{config:{mode:"freeUserBlocks",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,exportTextEnabled:!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,lockEditor:!1,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:""}}},a=e=>{const t=l[e];return t||l.editor},i=["mode","formFieldBorderEnabled","formFieldBorderRadiusEnabled","formFieldBoxShadowEnabled","formFieldVisibilityEnabled","formFieldExportAsPictureEnabled","formButtonFieldInsertImageEnabled","formButtonFieldVerticalAlignEnabled","formButtonFieldTextAlignEnabled","formButtonFieldBackgroundImageEnabled","formButtonFieldPaddingsEnabled","formCellFieldVerticalAlignEnabled","formCellFieldBackgroundImageEnabled","formCellFieldPaddingsEnabled","formLinkFieldInsertImageEnabled","formTableFieldBackgroundImageEnabled","formDivFieldBackgroundImageEnabled","formEmailFieldBackgroundImageEnabled"]},38540:(e,t,o)=>{o.d(t,{Ay:()=>s,M:()=>m,YT:()=>d,rI:()=>n});var l=o(1029);const a=(0,o(93778).ur)({isCollapsed:!0,isMonacoFocusing:!1}),i="defaultModePanesSlice",r=(0,l.createSlice)({name:i,initialState:a,reducers:{setMonacoFocusing:(e,t)=>{e.isMonacoFocusing=t.payload},resetPanes:()=>a}}),{resetPanes:n,setMonacoFocusing:d}=r.actions,m=e=>e[i].isMonacoFocusing,s=r},1047:(e,t,o)=>{o.d(t,{A9:()=>p,AJ:()=>v,Ay:()=>j,Bj:()=>B,Bu:()=>x,CT:()=>O,G_:()=>u,HO:()=>h,Hs:()=>F,M7:()=>g,RC:()=>P,S_:()=>R,UI:()=>W,Up:()=>T,VK:()=>_,VO:()=>k,VZ:()=>M,Wm:()=>S,dH:()=>z,eX:()=>c,iy:()=>L,mD:()=>G,no:()=>y,om:()=>b,pl:()=>f,ps:()=>w,qX:()=>C,rY:()=>V,rd:()=>D,ry:()=>E,ss:()=>A,uJ:()=>I,zn:()=>N});var l=o(1029),a=o(93778),i=o(98845),r=o(83027),n=o(65716);const d=(0,a.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,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}),m="emailSlice",s=(0,l.createSlice)({name:m,initialState:d,reducers:{setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setEmailFromHistory:(e,{payload:t})=>{const o=e.email,l=void 0===(null===t||void 0===t?void 0:t.preheader),a=void 0===(null===t||void 0===t?void 0:t.subject);e.email={...o,html:null===t||void 0===t?void 0:t.html,preheader:l?o.preheader:null===t||void 0===t?void 0:t.preheader,subject:a?o.subject:null===t||void 0===t?void 0:t.subject,common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:o.common_styles||"{}"},e.isNeedUpdateAppearance=!0,e.isNeedUpdateContentAppearance=!0},setEmailSettings:(e,{payload:t})=>{Object.assign(e,{...e,settings:{...t},isSettingsDisabled:!1})},setEmailSettingsDisable:(e,t)=>{e.isSettingsDisabled=t.payload},setElementSettings:(e,{payload:t})=>{e.elementSettings=t},setSearchFilters:(e,t)=>{e.searchFilters=t.payload},updateSearchFilters:(e,t)=>{const o=e.searchFilters;e.searchFilters={...o,...t.payload}},setEmailHTML:(e,t)=>{e.email.html=t.payload},setEmailSubject:(e,t)=>{e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setEmailPreheader:(e,t)=>{e.email.preheader=t.payload},resetEmailSlice:()=>d,setEmailTitle:(e,t)=>{e.email.title=t.payload},setIsInited:(e,t)=>{e.email.is_inited=t.payload},setEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},setProblemsList:(e,t)=>{e.problemsList=t.payload},setActiveProblemRange:(e,t)=>{e.activeProblemRange=t.payload},setIsNeedUpdateContentAppearance:(e,t)=>{e.isNeedUpdateContentAppearance=t.payload},setIsNeedUpdateAppearance:(e,t)=>{e.isNeedUpdateAppearance=t.payload},setEmailGroups:(e,{payload:t})=>{const o=Object.keys(t)[0],l=e.emailGroups,a=e.parentGroupOfProject,i=e.projectGroups,r={};var n;a&&i.length&&(null===(n=t[o])||void 0===n||n.forEach((e=>{const t=i.find((e=>e.id===+o)),l=null===t||void 0===t?void 0:t.children.find((t=>t.id===+e));l?(r.hasOwnProperty(t.id)||(r[t.id]=[]),r[t.id].push({label:l.name,value:l.id})):(r.hasOwnProperty(o)||(r[o]=[]),r[o].push({label:e,value:null}))})),0===t[o].length&&(r[o]=[]));e.emailGroups={...l,...r}}},extraReducers:e=>{e.addMatcher((e=>"emailsApi/queries/queryResultPatched"===e.type),((e,t)=>{var o,l;const a=t.payload.queryCacheKey.match(/\("([0-9]+)"\)/),i=null===(o=t.payload)||void 0===o?void 0:o.patches[0];null!==i&&void 0!==i&&null!==(l=i.path)&&void 0!==l&&l[0]&&(e.email[null===i||void 0===i?void 0:i.path[0]]=i.value),null!==a&&void 0!==a&&a[1]&&(e.invalidateEmailId=a[1]),e.emailIsEdit=!0})),e.addMatcher((e=>"emailsApi/invalidateTags"===e.type),((e,t)=>{if(t.payload[0].id===+e.invalidateEmailId)return d})),e.addMatcher(i.GY.endpoints.editEmail.matchFulfilled,((e,{payload:t})=>{e.invalidateEmailId=null,e.email={...e.email,...t,renderGuid:e.email.renderGuid}})),e.addMatcher(i.GY.endpoints.autoSaveEmail.matchFulfilled,((e,t)=>{var o,l;(null===(o=e.email.id)||void 0===o?void 0:o.toString())===(null===(l=t.payload.id)||void 0===l?void 0:l.toString())&&(e.email.html=t.payload.html)})),e.addMatcher(i.GY.endpoints.getEmail.matchFulfilled,((e,{payload:t})=>{var o,l;e.email={...d.email,...t,is_inited:t.is_inited||(t.id===(null===(o=e.email)||void 0===o?void 0:o.id)?null===(l=e.email)||void 0===l?void 0:l.is_inited:d.email.is_inited),common_styles:"string"===typeof(null===t||void 0===t?void 0:t.common_styles)&&null!==t&&void 0!==t&&t.common_styles.startsWith("{")?null===t||void 0===t?void 0:t.common_styles:"{}"},e.emailIsEdit=!1})),e.addMatcher(r.kE.endpoints.getGroups.matchFulfilled,((e,{meta:t,payload:o})=>{const l=e.email.group,a=t.arg.originalArgs.parent,i=o;a&&(e.parentGroupOfProject=a,i.length>0&&(e.projectGroups=i));const r={};a&&l.length&&i.length&&(null===l||void 0===l||l.forEach((e=>{null===i||void 0===i||i.forEach((t=>{const o=t.children.find((t=>t.id===e));o&&(r.hasOwnProperty(t.id)||(r[t.id]=[]),r[t.id].push({label:o.name,value:o.id}))}))}))),e.emailGroups=r})),e.addMatcher(n.Nq.endpoints.getProject.matchFulfilled,((e,{meta:t,payload:o})=>{var l;e.parentGroupOfProject=(null===(l=o.group)||void 0===l?void 0:l[0])||null}))}}),{setEditorThemeColor:c,setEmailSettings:u,setElementSettings:p,setEmailSettingsDisable:g,setSearchFilters:b,updateSearchFilters:E,setEmailSubject:h,setEmailPreheader:f,setEmailHTML:v,resetEmailSlice:A,setEmailTitle:_,setEmailFromHistory:y,setIsInited:S,setEmailIsAmp:k,setProblemsList:B,setActiveProblemRange:w,setEmailGroups:x,setIsNeedUpdateAppearance:R,setIsNeedUpdateContentAppearance:P}=s.actions,N=e=>e[m].invalidateEmailId,T=e=>e[m].editorThemeColor,I=e=>e[m].settings,C=e=>e[m].elementSettings,L=e=>e[m].isSettingsDisabled,O=e=>e[m].searchFilters,F=e=>e[m].email,D=e=>e[m].problemsList,M=e=>e[m].activeProblemRange,V=e=>e[m].emailGroups,W=e=>e[m].projectGroups,z=e=>e[m].isNeedUpdateContentAppearance,G=e=>e[m].isNeedUpdateAppearance,j=s},80772:(e,t,o)=>{o.d(t,{Ac:()=>g,Ay:()=>b,BK:()=>c,Uf:()=>p,Yw:()=>m,e_:()=>s,js:()=>u,tm:()=>d});var l=o(1029),a=o(93778);const i="imageSlice",r=(0,a.ur)({currentImage:"",currentBackground:"",currentImageName:""}),n=(0,l.createSlice)({name:i,initialState:r,reducers:{setCurrentImageName(e,t){e.currentImageName=t.payload},setCurrentImage(e,t){e.currentImage=t.payload},setCurrentBackground(e,t){e.currentBackground=t.payload},clearCurrentImages(e,t){e.currentImage="",e.currentBackground="",e.currentImageName=""}}}),{setCurrentImage:d,setCurrentImageName:m,setCurrentBackground:s,clearCurrentImages:c}=n.actions,u=e=>e[i].currentImage,p=e=>e[i].currentImageName,g=e=>e[i].currentBackground,b=n},12741:(e,t,o)=>{o.d(t,{$S:()=>C,Ay:()=>L,BQ:()=>E,Et:()=>P,K3:()=>k,MZ:()=>b,P3:()=>w,TC:()=>A,TU:()=>h,Uh:()=>N,YG:()=>I,Zs:()=>v,aY:()=>_,lg:()=>T,mk:()=>x,ol:()=>B,x3:()=>f,yY:()=>S,zH:()=>R});var l=o(1029),a=o(98845),i=o(65716),r=o(32947),n=o(31557),d=o.n(n),m=o(93778),s=o(39218),c=o(40277);const u=(0,m.ur)({emailtags:[],email:{isNew:!0,is_inited:!1,subject:void 0,preheader:void 0,description:"",html:d(),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}),p="newEmailSlice",g=(0,l.createSlice)({name:p,initialState:u,reducers:{setNewEmailAll:(e,{payload:{id:t,subject:o,description:l="",preheader:a,html:i=d(),utm_parameters:{utm_source:n="",utm_medium:m="",utm_campaign:s="",utm_term:u="",utm_content:p=""}={},common_styles:g="{}",emailtags:b=null,renderGuid:E,title:h,_embedded:f,isAmp:v=!1}})=>{var A;e.hasChanged||(e.hasChanged=!0),e.email.isAmp=v,e.email.title=h,e.emailtags=b,e.email.subject=o,e.email.description=l,e.email.common_styles=g||JSON.stringify(r.BD),e.email.preheader=a,e.email.is_template=!1,e.email.html=i,e.email.tags=(null===(A=(0,c._q)({_embedded:f},r.zh))||void 0===A?void 0:A.map((e=>e.name)))||[],e.email.renderGuid=E,e.email.parent_email=t,e.email.utm_parameters={utm_source:n,utm_medium:m,utm_campaign:s,utm_term:u,utm_content:p}},setNewEmailTitle:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.title=t.payload},setNewEmailSubject:(e,t)=>{e.hasChanged||e.email.subject===t.payload||(e.hasChanged=!0),e.email.title!==e.email.subject&&(e.email.subject||e.email.title)||(e.email.title=t.payload),e.email.subject=t.payload},setNewEmailPreheader:(e,t)=>{e.hasChanged||e.email.preheader===t.payload||(e.hasChanged=!0),e.email.preheader=t.payload},setNewEmailDescription:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.description=t.payload},setNewEmailIsTemplate:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.is_template=t.payload},setNewEmailHtml:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.html=t.payload)},setNewCommonStyles:(e,t)=>{e.hasChanged||(e.hasChanged=!0),t.payload&&(e.email.common_styles=t.payload)},setNewEmailTags:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.tags=t.payload},setNewEmailUtmSource:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_source=t.payload},setNewEmailUtmMedium:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_medium=t.payload},setNewEmailUtmCampaign:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_campaign=t.payload},setNewEmailUtmTerm:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_term=t.payload},setNewEmailUtmContent:(e,t)=>{e.hasChanged||(e.hasChanged=!0),e.email.utm_parameters.utm_content=t.payload},setNewIsInited:(e,t)=>{e.email.is_inited=t.payload},setNewEmailIsAmp:(e,t)=>{e.email.isAmp=t.payload},resetNewEmailSlice:e=>({...u,email:{...u.email,guid:(0,s.l)(),project:e.email.project,project_title:e.email.project_title}})},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,t)=>{e.email.project=t.payload.id,e.email.project_title=t.payload.title})),e.addMatcher(a.GY.endpoints.getEmail.matchFulfilled,(e=>({...u,email:{...u.email,project:e.email.project,project_title:e.email.project_title}})))}}),{setNewEmailAll:b,setNewEmailTitle:E,setNewEmailSubject:h,setNewEmailPreheader:f,setNewEmailDescription:v,setNewEmailIsTemplate:A,setNewEmailHtml:_,setNewCommonStyles:y,setNewEmailTags:S,setNewEmailUtmSource:k,setNewEmailUtmMedium:B,setNewEmailUtmCampaign:w,setNewEmailUtmContent:x,setNewEmailUtmTerm:R,resetNewEmailSlice:P,setNewIsInited:N,setNewEmailIsAmp:T}=g.actions,I=e=>e[p].email,C=e=>e[p].hasChanged,L=g},84572:(e,t,o)=>{o.d(t,{AQ:()=>f,Ay:()=>A,BN:()=>u,GD:()=>b,RP:()=>h,Rw:()=>E,es:()=>c,mb:()=>p,od:()=>s,qV:()=>v,yN:()=>g});var l=o(1029),a=o(93778),i=o(65716),r=o(98845);const n=(0,a.ur)({project:null,activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),d="projectSlice",m=(0,l.createSlice)({name:d,initialState:n,reducers:{setProject:(e,{payload:t})=>{e.project=t},setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(i.Nq.endpoints.getProject.matchFulfilled,((e,{payload:t})=>{e.project={...n.project,...t}})),e.addMatcher(i.Nq.endpoints.editProject.matchFulfilled,((e,{payload:t})=>{e.project={...n.project,...t}})),e.addMatcher(r.GY.endpoints.getTemplateEmails.matchFulfilled,((e,{payload:t,meta:o})=>{const{projectId:l}=o.arg.originalArgs;var a,i,r;l?(e.groupsTemplateProjectTotal=+(null===(a=o.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total")),e.groupsTemplateProjectTotalPages=+(null===(i=o.baseQueryMeta)||void 0===i?void 0:i.response.headers.get("X-WP-TotalPages"))):e.groupsTemplateTotal=+(null===(r=o.baseQueryMeta)||void 0===r?void 0:r.response.headers.get("X-WP-Total"))}))}}),{setProject:s,setActiveGroupsTags:c,setActiveProjectGroupsTags:u,resetAllTags:p}=m.actions,g=e=>e[d].project,b=e=>e[d].activeGroupsTags,E=e=>e[d].activeProjectGroupsTags,h=e=>e[d].groupsTemplateTotal,f=e=>e[d].groupsTemplateProjectTotal,v=e=>e[d].groupsTemplateProjectTotalPages,A=m},61058:(e,t,o)=>{o.d(t,{Ay:()=>p,RL:()=>u,p1:()=>c,qX:()=>m});var l=o(1029),a=o(98845),i=o(68984);const r=(0,o(93778).ur)({historyData:[],elementHistoryTotalPages:1}),n="revisionHistorySlice",d=(0,l.createSlice)({name:n,initialState:r,reducers:{resetElementHistorySlice:()=>({...r}),setElementHistory:(e,t)=>{0!==t.payload.length&&(e.historyData=t.payload)}},extraReducers:e=>{e.addMatcher(a.GY.endpoints.getEmailHistory.matchFulfilled,((e,{meta:t,payload:o})=>{var l;e.elementHistoryTotalPages=+(null===(l=t.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-TotalPages")),t.arg.originalArgs.page&&1!==t.arg.originalArgs.page||(e.historyData=o.data||[])})),e.addMatcher(i.VM.endpoints.getBlockHistory.matchFulfilled,((e,{meta:t,payload:o})=>{var l;e.elementHistoryTotalPages=+(null===(l=t.baseQueryMeta)||void 0===l?void 0:l.response.headers.get("X-WP-TotalPages")),o.args.page&&1!==o.args.page||(e.historyData=o.data||[])}))}}),{resetElementHistorySlice:m}=d.actions,{setElementHistory:s}=d.actions,c=e=>e[n].historyData,u=e=>e[n].elementHistoryTotalPages,p=d},47014:(e,t,o)=>{o.d(t,{Ay:()=>_,B:()=>E,B$:()=>A,C1:()=>h,hZ:()=>v,ko:()=>p,ku:()=>c,ww:()=>m,yf:()=>f});var l=o(1029),a=o(78915),i=o(32947),r=o(40277);const n=(0,o(93778).ur)({currentUser:{},currentSchema:{},monacoOptions:i.rW,monacoDidMount:!1}),d="userSlice",m=(0,l.createAsyncThunk)("user/setMonacoOptions",(async(e,{getState:t})=>{const o=t()[d],l="string"===typeof e.font_family?`${e.font_family}, sans-serif`:void 0,a=void 0!==e.word_wrap?e.word_wrap?"on":"off":void 0;return l&&o.monacoOptions.fontFamily!==l&&await(0,r.iV)(e.font_family),{tabSize:e.tab_size,fontFamily:l,fontSize:e.font_size,wordWrap:a,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}})),s=(0,l.createSlice)({name:d,initialState:n,reducers:{setMonacoDidMount:(e,{payload:t})=>{e.monacoDidMount=t},setTheme:(e,{payload:t})=>{e.currentUser.theme=t},setUserLocale:(e,{payload:t})=>{e.currentUser.locale=t},setUserAutosaves:(e,{payload:t})=>{e.currentUser.autosaves=t},setUser:(e,{payload:t})=>{e.currentUser={...e.currentUser,...t}}},extraReducers:e=>{e.addCase(m.fulfilled,((e,t)=>{const o=t.payload;e.monacoOptions=(0,r.i0)({...e.monacoOptions},o)})),e.addMatcher(a.Q2.endpoints.editMe.matchFulfilled,((e,t)=>{e.currentUser=t.payload})),e.addMatcher(a.Q2.endpoints.getMe.matchFulfilled,((e,t)=>{e.currentUser=t.payload})),e.addMatcher(a.Q2.endpoints.getSchema.matchFulfilled,((e,t)=>{e.currentSchema=t.payload.schema}))}}),{setMonacoDidMount:c,setTheme:u,setUserLocale:p,setUserAutosaves:g,setUser:b}=s.actions,E=e=>{var t;return null===(t=e[d].currentUser)||void 0===t?void 0:t.locale},h=e=>e[d].currentUser,f=e=>e[d].currentSchema,v=e=>e[d].monacoOptions,A=e=>{var t;return 3891!==(null===(t=e[d].currentUser.subscription)||void 0===t?void 0:t.ID)},_=s}}]);
|