@emailmaker/emailmaker 1.0.93-alpha.2 → 1.0.93-alpha.4

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.
@@ -0,0 +1 @@
1
+ "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[3403],{47827:()=>{},39941:()=>{},48122:(e,t,l)=>{l.d(t,{I:()=>B});var o,a=l(38826),i=l(49856),r=l(98447),n=l(58521),d=l(98173),m=l(2604),s=l(84572),c=l(39539),u=l(51213),p=l(1473),g=l(83339);const b="https://emcdn.ru";function E(e){const t=e.split("/"),l=t.pop();return[t.join("/"),l]}function h(e,t){if(!e)return"";const l=new RegExp(`^/?${t}/?`);return e.replace(l,"")}let f=(0,u.A)(o=class{constructor(e){this._restApi=void 0,this._projectId=void 0,this.pathMode=!0,this._restApi=e.restApi,this._projectId=e.projectId}async getFolders({parentId:e}){const t=await this._restApi.emFiles.folders_list({project_id:this._projectId,path_folder:e,per_page:20},{type:c.cM.Json});var l;if(t.error)throw t.error instanceof Error?t.error:new Error(null===(l=t.error.data)||void 0===l?void 0:l.message);return await t.data.folders.map((e=>({...e,id:h(e.full_path,this._projectId),parentId:h(e.parent_folder,this._projectId)})))}async getFiles(e){if(void 0===e.limit&&(e.limit=Number.MAX_SAFE_INTEGER),"folder"===e.itemType)return{pagination:{},files:(await this.getFolders({parentId:e.folderId})).map((e=>({...e,folderId:e.parentId,isFolder:!0,date:"",size:""})))};const t=await this._restApi.emFiles.files_list({project_id:this._projectId,path_folder:e.folderId,filter_name:e.search,sort_by:e.sortBy,sort_order:e.sortOrder,per_page:e.limit,page:e.page});var l;if(t.error)throw t.error instanceof Error?t.error:new Error(null===(l=t.error.data)||void 0===l?void 0:l.message);const o=t.data;let a=((null===o||void 0===o?void 0:o.files)||[]).map((e=>({...e,id:`${h(e.folder,this._projectId)}/${e.name}`,size:`${e.size}`,date:e.date||(new Date).toISOString(),folderId:h(e.folder,this._projectId),url:e.link,selected:!1,isFolder:e.is_folder})));return"file"===e.itemType&&(a=a.filter((e=>!e.isFolder))),{files:a,pagination:{limit:o.per_page,page:o.page,total:o.total,totalPages:o.total_pages}}}async getFile(e){const t=await fetch(`${b}/${this._projectId}/${e}`);if(t.ok)return t.blob();throw new Error(await t.text())}async deleteFile(e){const[t,l]=E(e),o=await this._restApi.emFiles.files_delete({path_folder:t,project_id:this._projectId,file_name:l},{type:c.cM.Json});var a,i;if(o.error)throw o.error instanceof Error?o.error:new Error(null===(a=o.error)||void 0===a||null===(i=a.data)||void 0===i?void 0:i.message);return o.ok}async createFolder({name:e,parentId:t}){const l=await this._restApi.emFiles.folders_create({name:e,project_id:this._projectId,path_folder:t},{type:c.cM.Json});var o;if(l.error)throw l.error instanceof Error?l.error:new Error(null===(o=l.error.data)||void 0===o?void 0:o.message);return{...l.data,id:h(l.data.full_path,this._projectId),parentId:h(l.data.parent_folder,this._projectId)}}async deleteFolder(e){return(await this._restApi.emFiles.folders_delete({path_folder:e,project_id:this._projectId},{type:c.cM.Json})).ok}async uploadFile(e){const t=await this._restApi.emFiles.files_create({file:e.data,path_folder:e.folderId,project_id:this._projectId},{type:c.cM.FormData});var l;if(t.error)throw t.error instanceof Error?t.error:new Error(null===(l=t.error.data)||void 0===l?void 0:l.message);const o=t.data;return{...o,id:h(o.folder,this._projectId)+"/"+o.name,size:`${o.size}`,folderId:h(o.folder,this._projectId),date:o.date||(new Date).toISOString(),url:o.file_url,selected:!1}}async renameFile(e,t){const[l,o]=E(e),a=await this._restApi.emFiles.files_rename_partial_update({file_name:o,new_name:t,path_folder:l,project_id:this._projectId,is_folder:!1},{type:c.cM.Json});var i,r;if(a.error)throw a.error instanceof Error?a.error:new Error(null===(i=a.error)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message);const n=a.data;return{id:h(n.folder,this._projectId)+"/"+n.name,name:n.name,size:`${n.size}`,type:n.type,folderId:h(n.folder,this._projectId)||null,url:n.file_url||`${b}/${this._projectId}/${h(n.folder,this._projectId)}/${n.name}`,date:n.date||(new Date).toISOString()}}async moveItem({itemId:e,targetFolderId:t,isFolder:l}){let o="",a="";[o,a]=E(e);const i=await this._restApi.emFiles.items_move_partial_update({file_name:a,target_folder:t,is_folder:l,path_folder:o,project_id:this._projectId},{type:c.cM.Json});var r,n;if(i.error)throw i.error instanceof Error?i.error:new Error(null===(r=i.error)||void 0===r||null===(n=r.data)||void 0===n?void 0:n.message);return i.ok}async copyItem({itemId:e,targetFolderId:t,isFolder:l}){let o="",a="";[o,a]=E(e);const i=await this._restApi.emFiles.items_move_partial_update({file_name:a,target_folder:t,is_folder:l,path_folder:o,project_id:this._projectId,is_copy:!0},{type:c.cM.Json});var r,n;if(i.error)throw i.error instanceof Error?i.error:new Error(null===(r=i.error)||void 0===r||null===(n=r.data)||void 0===n?void 0:n.message);return l?{id:h(i.data.new_path,this._projectId)}:{id:h(i.data.new_path,this._projectId),url:`${b}/${this._projectId}/${i.data.new_path}`}}async uploadFileByUrl(e){let{url:t}=e;if(t=(0,p.o)(t),e.noFolder){if(t.startsWith(`${b}/${this._projectId}`)){const t=e.url.replace(`${b}/${this._projectId}/`,"").split("/"),l=t.pop(),{files:o}=await this.getFiles({folderId:t.join("/"),search:l,limit:1});if(o.length)return o[0]}e={...e,folderId:"Edited"}}if(t.startsWith("http://localhost")||t.startsWith("https://localhost")){const l=await(await fetch(t)).blob();return this.uploadFile({name:t.split("/").pop(),size:String(l.size),folderId:e.folderId,data:l,type:g.A.getType(t)})}const l=await this._restApi.emFiles.files_upload_by_url_create({url:t,path_folder:e.folderId,project_id:this._projectId},{type:c.cM.Json});var o,a;if(l.error)throw l.error instanceof Error?l.error:new Error(null===(o=l.error)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.message);const i=l.data;return{id:`${h(i.folder,this._projectId)}/${i.name}`,name:i.name,size:`${i.size}`,type:i.type,folderId:h(e.folderId,this._projectId)||null,url:i.file_url||`${b}/${this._projectId}/${h(i.folder,this._projectId)}`,date:i.date||(new Date).toISOString()}}async updateFile(e,t){const[l,o]=E(e),a=await this._restApi.emFiles.files_partial_update({file_name:o,project_id:this._projectId,path_folder:l,updates:{data:t.data,name:t.name,type:t.type,thumbnail:t.thumbnail,dimensions:t.dimensions,aspectRatio:t.aspectRatio,extension:t.extension}},{type:c.cM.Json});var i;if(a.error)throw a.error instanceof Error?a.error:new Error(null===(i=a.error.data)||void 0===i?void 0:i.message);const r=a.data;return{...r,id:`${h(r.folder,this._projectId)}/${r.name}`,size:`${r.size}`,folderId:h(r.folder,this._projectId),date:r.date||(new Date).toISOString(),url:r.file_url||`${b}/${this._projectId}/${h(r.folder,this._projectId)}`,selected:!1}}async renameFolder(e,t){const[l,o]=E(e),a=await this._restApi.emFiles.files_rename_partial_update({file_name:o,new_name:t,path_folder:l,project_id:this._projectId,is_folder:!0},{type:c.cM.Json});var i,r;if(a.error)throw a.error instanceof Error?a.error:new Error(null===(i=a.error)||void 0===i||null===(r=i.data)||void 0===r?void 0:r.message);const n=a.data;return{id:`${l}/${n.name}`,name:n.name,parentId:l||null}}})||o;var v=l(27941);const A=d.createElement(a.A,{style:{fontSize:48},spin:!0}),_=(0,d.lazy)((()=>Promise.all([l.e(1807),l.e(57)]).then(l.bind(l,10653)))),y=(0,d.lazy)((()=>Promise.all([l.e(3085),l.e(9960),l.e(6501)]).then(l.bind(l,36501)))),S={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},B=()=>{const e=(0,v.rD)(),t=(0,n.of)(),l=(0,m.d4)(s.yN),[o,a]=(0,d.useState)(null),c=(0,n.XB)();return(0,d.useEffect)((()=>{a(t||new f({projectId:String(null===l||void 0===l?void 0:l.id),restApi:c}))}),[l,a,c,t]),(0,d.useEffect)((()=>{}),[t]),d.createElement(d.Suspense,{fallback:d.createElement(i.A,{size:"large",style:S},d.createElement(r.A,{indicator:A}))},o&&e.imageCenterFileManagerView?d.createElement(_,{storageProvider:o}):d.createElement(y,null))}},16515:(e,t,l)=>{l.d(t,{A:()=>T});var o=l(98173),a=l(2604),i=l(33309),r=l(5795),n=l(40186),d=l(54855),m=l(27499),s=l(99291),c=l(49856),u=l(13785),p=l(42490),g=l(37969),b=l(29123),E=l(94674),h=l(201),f=l(66964),v=l(12543),A=l(37133),_=l(80877),y=l(1047),S=l(22536),B=l(54838),k=l(52919),x=l(27941),w=l(32947);const R=({emailElementType:e,isSelectedElement:t=!1,selectedElement:l})=>{var R,T,N,I,P,C,L,F,O;const{__:D}=(0,v.s9)(),M=(0,a.wA)(),V=(0,k.XW)(),[z]=m.A.useForm(),H=(0,o.useRef)(),j=(0,o.useRef)(),W=(0,a.d4)(y.qX),G=(0,a.d4)(S.qX),U=(0,x.rD)(),X=l||(e===w.Tm?W:G),[q,$]=(0,o.useState)(null===(R=X.floatBlocks)||void 0===R?void 0:R.wrap),[Y,K]=(0,o.useState)(null===(T=X.floatBlocks)||void 0===T?void 0:T.dirRevers),[Q,J]=(0,o.useState)(null),[Z,ee]=(0,o.useState)(0),[te,le]=(0,o.useState)([]),oe=(0,a.d4)(B.Ct),ae=(0,o.useCallback)((t=>{M(e===w.Tm?(0,y.A9)(t):(0,S.A9)(t))}),[M,e]);(0,o.useEffect)((()=>{if(X&&"{}"!==JSON.stringify(X)&&z._init){var e,t,l,o,a;if(z.resetFields(),z.setFieldsValue({gap:null===(e=X.floatBlocks)||void 0===e?void 0:e.gap,gapMobile:null===(t=X.floatBlocks)||void 0===t?void 0:t.gapMobile,gapDim:"px",valign:null===(l=X.floatBlocks)||void 0===l?void 0:l.valign}),(null===(o=X.floatBlocks)||void 0===o?void 0:o.items.length)>0){var i;const r=X.floatBlocks.items.reduce(((e,t)=>e+t.width),0),n=X.floatBlocks.items.map((e=>{var t;return null===(t=(e.width||0)/r*100)||void 0===t?void 0:t.toFixed(1)}));function d(e,t){if(e.length!==t.length)return!1;for(let l=0;l<e.length;l++)if(e[l]!==t[l])return!1;return!0}ee(r),d(n,te)||"gap"===X.changeKey||le(n),X.floatBlocks.items.forEach(((e,t)=>z.setFieldsValue({["width-"+t]:e.width||0}))),X.floatBlocks.items.length>=8?document.querySelector(".selected-element-panel__columns-settings__links__add").classList.add("noactive"):null!==(i=document.querySelector(".selected-element-panel__columns-settings__links__add"))&&void 0!==i&&i.classList.contains("noactive")&&document.querySelector(".selected-element-panel__columns-settings__links__add").classList.remove("noactive")}$(null===(a=X.floatBlocks)||void 0===a?void 0:a.wrap)}}),[z,X,Q,te]);let ie=0;(null===(N=X.floatBlocks)||void 0===N?void 0:N.items.length)>0&&(ie=X.floatBlocks.items.length);const re=(e,t)=>{Object.keys(t).forEach((t=>{if(t.includes("width")){const l=parseInt(t.match(/\d+/));z.setFieldsValue({[t]:e.items[l]})}}))},[ne,de]=(0,o.useState)(!1);(0,o.useEffect)((()=>{const e=()=>de(!0),t=()=>de(!1);return document.addEventListener("keyup",t),document.addEventListener("keydown",e),()=>{document.removeEventListener("keyup",t),document.removeEventListener("keydown",e)}}),[]);const me=e=>{const l=z.getFieldsValue(!0),o=X.floatBlocks.items.map((e=>e.width)),a=X.floatBlocks.gap||20,i=e.cols-o.length;let r=[],n=o.reduce(((e,t)=>e+t),0);e.cols>=o.length?n-=a*i:n+=a*Math.abs(i);const d=Math.round(n/e.cols);r=function(t,l){const o=[];for(let r=0;r<t;r++){var a,i;o.push(null!==(a=e.width)&&void 0!==a&&a[r]?Math.round(n/100*(null===(i=e.width)||void 0===i?void 0:i[r])):l)}return o}(e.cols,d);const m=n-r.reduce(((e,t)=>e+t),0);if(0!==m){let e=r.map(((e,t)=>[t,e])).filter((e=>e[1]>30));const t=e.length-Math.abs(m);e=e.map(((e,l)=>{const o=t<=l?e[1]+(m>0?1:-1):e[1];return[e[0],o]})),e.map((e=>(r[e[0]]=e[1],e)))}let s={items:r,gap:l.gap||20};const c=r.reduce(((e,t)=>e+t),0);le(r.map((e=>{var t;return null===(t=e/c*100)||void 0===t?void 0:t.toFixed(1)}))),V({operation:w.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksPreset",settings:s,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,...s,items:s.items.map(((e,t)=>({width:e,current:!1})))},changeKey:"width"})},se=e=>{const l=z.getFieldsValue(!0);let o=0;document.querySelectorAll(".selected-element-panel__columns-settings__controls__column").forEach(((t,l)=>{t===e.target.closest(".selected-element-panel__columns-settings__controls__column")&&(o=l)}));const a=+X.floatBlocks.gap,i=+X.floatBlocks.items[o].width+a,r=X.floatBlocks.items.map((e=>+e.width)),n=(r.length-1)*a,d=r.reduce(((e,t)=>e+t),0)+n,m=r.length-1,s=Math.floor(i/m);let c=r.filter(((e,t)=>t!==o)).map((e=>e+s));const u=d-(c.reduce(((e,t)=>e+t),0)+(r.length-2)*a);if(0!==u){const e=c.length-Math.abs(u);c=c.map(((t,l)=>e<=l?t+(u>0?1:-1):t))}V({operation:w.Ru.SANDBOX_FLOATBLOCK_REMOVE,settings:{removedBlockIndex:o,gap:l.gap},editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,items:c.map(((e,t)=>({width:e,current:X.floatBlocks.items.filter(((e,t)=>t!==o))[t].current})))},changeKey:"width"})};return X.floatBlocks&&X.floatBlocks.items.length>0&&o.createElement(m.A,{layout:"vertical",form:z,name:"float_blocks_settings_form",autoComplete:"off",initialValues:{gap:(null===(I=X.floatBlocks)||void 0===I?void 0:I.gap)||0,gapDim:"px",gapMobile:(null===(P=X.floatBlocks)||void 0===P?void 0:P.gapMobile)||0,valign:(null===(C=X.floatBlocks)||void 0===C?void 0:C.valign)||"top",...null===(L=X.floatBlocks)||void 0===L?void 0:L.items.reduce(((e,{width:t},l)=>(e[`width-${l}`]=t,e)),{})},onValuesChange:e=>{j.current&&ne&&clearTimeout(j.current),j.current=setTimeout((()=>function(e){const l=z.getFieldsValue(!0),o=Object.keys(e)[0];if(J(o),o.includes("width")){if(l[o]&&l[o]>=30){let a={items:[],gap:l.gap,valign:l.valign,activateSection:t?void 0:"structure"},i=0;if(document.querySelectorAll(".selected-element-panel__columns-settings__controls__column").length>1){i=parseFloat(Object.keys(e)[0].substring(Object.keys(e)[0].length-1));const t=l["width-"+(i+1)]?i+1:0;let o=Z;Object.keys(l).forEach((e=>{e.includes("width")&&-1===e.indexOf("width-"+t)&&(o-=l[e])})),l["width-"+t]=o}Object.keys(l).forEach((e=>{e.includes("width")&&a.items.push(l[e])})),V({operation:w.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksWidths",settings:a}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,...a,items:X.floatBlocks.items.map(((e,t)=>({...X.floatBlocks.items[t],width:a.items[t]})))},changeKey:o})}}else if("gap"===o){const a={items:X.floatBlocks.items.map((e=>e.width)),gap:X.floatBlocks.gap},i=a.items.reduce(((e,t)=>e+t),0)+(a.items.length-1)*a.gap,r=l.gap,n=i-(a.items.length-1)*r;if(n>30*a.items.length||X.floatBlocks.gap-e>=0){const e=(e,t)=>Math.round(t*e/100);let d=a.items.map(((t,l)=>e(te[l],n)));const m=i-(d.reduce(((e,t)=>e+t),0)+(a.items.length-1)*r);if(0!==m){const e=d.length-Math.abs(m);d=d.map(((t,l)=>e<=l?t+(m>0?1:-1):t))}let s={items:d,gap:r||0};re(s,l),V({operation:w.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksGap",settings:s,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,...s,items:X.floatBlocks.items.map(((e,t)=>({...e,width:s.items[t]})))},changeKey:o})}}else if("valign"===o){let e={valign:l.valign};V({operation:w.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksValign",settings:e,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,...e},changeKey:o})}else if("gapMobile"===o){let l={mobileHeight:{classNamePrefix:"em-mob-height-",value:e[o],dim:"px"}};V({operation:w.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksGapMobile",settings:l}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,gapMobile:l.mobileHeight.value},changeKey:o})}setTimeout((()=>(null===H||void 0===H?void 0:H.current)&&H.current.focus({cursor:"end"})),600)}(e)),50)},onFieldsChange:()=>setTimeout((()=>(null===H||void 0===H?void 0:H.current)&&H.current.focus({cursor:"end"})),300),className:"element-controls"},o.createElement("div",{className:"selected-element-panel__columns-settings",style:{paddingTop:U.switchDesktopMobilePropsEnabled||U.stepToOtherElementEnabled||U.deleteButtonEnabled||"structure"===X.type?0:24}},1===X.floatBlocks.items.length&&o.createElement(s.A,{style:{marginBottom:10},message:D('The selected element is in the block that supports a multicolumn structure. To add a new column, click the "Add a column" button.'),type:"info"}),oe!==w.ND&&o.createElement(o.Fragment,null,o.createElement(c.A,{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},o.createElement("div",{className:"form-group-title",style:{paddingTop:0}},D("Columns")),o.createElement("div",{className:"selected-element-panel__columns-settings__links"},o.createElement("span",{className:"selected-element-panel__columns-settings__links__add",onClick:()=>{const e=z.getFieldsValue(!0);if(ie<8){const l=X.floatBlocks.items.map((e=>e.width)),o=X.floatBlocks.gap,a=l.reduce(((e,t)=>e+(t>30?t:0)),0),i=(a-30-o)/a,r=l.map((e=>e>30?Math.round(e*i):e)).reduce(((e,t)=>e+(t>30?t:0)),0);let n=l.map((e=>e>30?Math.round(e*i):e));n.push(30);const d=a-r-30-o;if(0!==d){let e=n.map(((e,t)=>[t,e])).filter((e=>e[1]>30));const t=e.length-Math.abs(d);e=e.map(((e,l)=>{const o=t<=l?e[1]+(d>0?1:-1):e[1];return[e[0],o]})),e.map((e=>(n[e[0]]=e[1],e)))}V({operation:w.Ru.SANDBOX_FLOATBLOCK_ADD,settings:{gap:e.gap,gapMobile:e.gapMobile,minWidth:30},editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,items:n.map(((e,t)=>{var l;return{width:e,current:(null===(l=X.floatBlocks.items[t])||void 0===l?void 0:l.current)||!1}}))},changeKey:"width"})}else document.querySelector(".selected-element-panel__columns-settings__links__add").classList.add("noactive")}},o.createElement(i.A,null)," ",D("Add column")),X.floatBlocks.items.length>1&&o.createElement("span",{onClick:()=>{const e=z.getFieldsValue(!0),l=X.floatBlocks.items.map((e=>e.width));let o={items:[],gap:e.gap};const a=l.reduce(((e,t)=>e+t),0),i=l.length,r=Math.ceil(Z/i)*i,n=r/i,d=a-r;if(o.items=Array(i).fill(n),0!==d){const e=l.length-Math.abs(d);o.items=o.items.map(((t,l)=>e<=l?t+(d>0?1:-1):t))}re(o,e),V({operation:w.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"floatBlocksWidths",settings:o,editFromStructure:!!document.querySelector(".selected-element-panel__columns-settings__links__add").closest(".selected-element-panel")}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,...o,items:X.floatBlocks.items.map(((e,t)=>({...e,width:o.items[t]})))},changeKey:"width"})}},o.createElement(u.A,{title:D("Make columns the same width.")},o.createElement(r.A,null)," ",D("Equalize"))))),X.floatBlocks.items.length>1&&o.createElement(m.A.Item,{style:{marginBottom:16}},o.createElement("div",{className:"selected-element-panel__columns-settings__controls"},X.floatBlocks.items.map(((e,t)=>o.createElement("div",{key:"floatblock-"+t,className:"selected-element-panel__columns-settings__controls__column "+(e.current?"current":""),style:{width:e.width/Z*100+"%"}},X.floatBlocks.items.length>1&&o.createElement("span",{className:"selected-element-panel__columns-settings__controls__column__remove",onClick:se},o.createElement(n.A,{style:{color:"#ff4d4f"}})),o.createElement("div",{className:"selected-element-panel__columns-settings__controls__field"},o.createElement(m.A.Item,{label:"",name:"width-"+t},o.createElement(p.A,{min:30,value:e.width||0,placeholder:D("Width"),ref:Q==="width-"+t&&H})))))))),o.createElement(c.A,{size:7,className:"columns-presets"},o.createElement(g.Ay,{onClick:()=>{me({cols:1})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"32",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{me({cols:2})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"15",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"17",y:"7",width:"15",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{me({cols:2,width:[66,34]})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"20.6667",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"22.6667",y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{me({cols:2,width:[34,66]})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"11.3333",y:"7",width:"20.6667",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{me({cols:3})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"11.3333",y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"22.6667",y:"7",width:"9.33333",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))),o.createElement(g.Ay,{onClick:()=>{me({cols:4})}},o.createElement("svg",{width:"32",height:"20",viewBox:"0 0 32 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("rect",{y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"8.5",y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"17",y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}),o.createElement("rect",{x:"25.5",y:"7",width:"6.5",height:"6",rx:"2",fill:"currentColor",fillOpacity:"0.65"}))))),X.floatBlocks.items.length>1&&o.createElement(o.Fragment,null,oe===w.ND&&o.createElement(c.A,{style:{marginBottom:24}},o.createElement(b.A,{size:"small",disabled:void 0===(null===(F=X.floatBlocks)||void 0===F?void 0:F.wrap),checked:q,onChange:e=>{$(e),V({operation:w.Ru.SANDBOX_FLOATBLOCK_WRAP,settings:{wrap:!q}}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,wrap:!q},changeKey:"wrap"})}}),o.createElement("div",{style:{position:"relative",top:2}},D("Line break on mobile devices"))),oe!==w.ND&&o.createElement(c.A,{style:{marginBottom:24}},o.createElement(b.A,{size:"small",disabled:void 0===(null===(O=X.floatBlocks)||void 0===O?void 0:O.wrap),checked:Y,onChange:e=>{K(e),V({operation:w.Ru.SANDBOX_FLOATBLOCK_DIR,settings:{dirRevert:!Y}}),ae({...X,activateSection:t?void 0:"structure",floatBlocks:{...X.floatBlocks,dirRevert:!Y},changeKey:"dir"})}}),o.createElement("div",{style:{position:"relative",top:2}},D("Revers order on desktop")))),X.floatBlocks.items.length>1&&o.createElement(o.Fragment,null,o.createElement(E.A,{className:"selected-td-form__divider"}),o.createElement(h.A,{gutter:10},o.createElement(f.A,{span:12},o.createElement("div",{className:"form-group-title"},D("Vertical alignment")),o.createElement("div",{style:{paddingBottom:4}},o.createElement(A.A,{form:z,elementSettings:{},disabled:X.floatBlocks.items.length<=1}))),o.createElement(o.Fragment,null,oe!==w.ND&&o.createElement(f.A,{span:12},o.createElement("div",{className:"form-group-title"},D("Indent between columns")),o.createElement(m.A.Item,{name:"gap",style:{marginBottom:20}},o.createElement(_.A,{min:0,disabled:X.floatBlocks.items.length<=1,placeholder:D("Indent between columns"),prefix:o.createElement(r.A,null),addonAfter:"px",ref:"gap"===Q&&H}))),oe===w.ND&&o.createElement(f.A,{span:12},o.createElement("div",{className:"form-group-title"},D("Indent in mobile")),o.createElement(m.A.Item,{name:"gapMobile",style:{marginBottom:20}},o.createElement(_.A,{min:0,disabled:X.floatBlocks.items.length<=1,placeholder:D("Indent in mobile"),prefix:o.createElement(d.A,null),addonAfter:"px"}))))))))};R.defaultProps={selectedElement:{parent:!1}};const T=R},55207:(e,t,l)=>{l.d(t,{A:()=>u});var o=l(98173),a=l(40120),i=l(27499),r=l(86774),n=l(40277),d=l(32947),m=l(87396);const{useToken:s}=a.A,c=({form:e,label:t,name:l,disabled:a,elementSettings:c})=>{var u;const p=(0,m.FH)((null===c||void 0===c?void 0:c.type)===d.bV.CAROUSEL?["images",l]:[l],e),[g,b]=(0,o.useState)("success"),{token:E}=s();return(0,o.useEffect)((()=>{p?(0,n.DI)(p).then((e=>{b(e)})).catch((e=>{b(e)})):b("")}),[p]),o.createElement(i.A.Item,{name:l,validateStatus:g,style:{marginBottom:E.formItemMarginBottomXS}},o.createElement(r.A,{validateStatus:g,placeholder:t,name:l,disabled:a,elementSettings:c,imageInfo:(null===c||void 0===c?void 0:c.type)===d.bV.CAROUSEL?null===c||void 0===c||null===(u=c.carouselImages)||void 0===u?void 0:u[l.split("_")[1]]:c}))};c.defaulProps={disabled:!1};const u=c},35895:(e,t,l)=>{l.d(t,{A:()=>A});var o=l(98173),a=l(84893),i=l(85591),r=l.n(i),n=l(40120),d=l(49856),m=l(37969),s=l(2604),c=l(75576),u=l(94160),p=l(47014),g=l(8807),b=l(40277),E=l(12543);const h=()=>{const{__:e}=(0,E.s9)(),{notification:t}=c.A.useApp(),l=(0,s.d4)(p.C1),[a]=(0,u.C)(),[i,r]=(0,o.useState)(!1);(0,o.useEffect)((()=>{l.hasOwnProperty("email_confirmation")&&r(l.email_confirmation)}),[l,i]);return null!==l&&void 0!==l&&l.email_confirmation||null===l||void 0===l||!l.privacy_policy_agreement?null:o.createElement("div",{className:"main__ribbon"},o.createElement("span",null,o.createElement(g.A,{icon:"EmailConfirmation",style:{fontSize:20,position:"relative",top:2}})," ",e("Confirmation email was sent to"),"\xa0",o.createElement("em",null,l.email),".\xa0",e("Didn't receive an email?"),"\xa0",o.createElement(m.Ay,{type:"primary",size:"small",style:{fontSize:16,lineHeight:1},onClick:()=>{a({userId:l.id,email:l.email}).then((({data:o,error:a})=>{o?(0,b.wB)(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",l.email),t):a&&(0,b.p6)(a,t)}))}},e("Resend")," ",o.createElement(g.A,{icon:"SendOutlined",style:{verticalAlign:"middle"}}))))};var f=l(27941);const{useToken:v}=n.A,A=({className:e,leftBlock:t,rightBlock:l,isHeaderCodeMenuOpen:i=!1})=>{const{token:n}=v(),m=(0,o.useRef)(),s=(0,f.rD)();return o.createElement(o.Fragment,null,o.createElement(h,null),s.headerShow&&o.createElement("header",{className:r()("header",{[e]:e}),style:{borderColor:n.colorBorder}},!i&&o.createElement(a.A,{nodeRef:m,in:!i,timeout:300,classNames:"transition"},o.createElement("div",{className:"header__container container"},o.createElement("div",{className:"header__left",style:{flexGrow:1}},t),o.createElement("div",{className:"header__right"},o.createElement(d.A,{size:10},l))))))}},10148:(e,t,l)=>{l.d(t,{A:()=>B});var o=l(98173),a=l(2604),i=l(62272),r=l(37969),n=l(93511),d=l(5553),m=l(59010),s=l(85591),c=l.n(s),u=l(8807),p=l(98845),g=l(65716),b=l(61058),E=l(54838),h=l(22536),f=l(1047),v=l(12543),A=l(40277),_=l(52919),y=l(86095),S=l(32947);const B=({emailElement:e})=>{const{__:t}=(0,v.s9)(),l=(0,_.XW)(),s=(0,a.wA)(),{projectId:B}=(0,i.g)(),k=(0,y.fn)(),x=(0,a.d4)(b.p1),w=(0,a.d4)(b.RL),R=(0,a.d4)(E.Wm),[T,N]=(0,o.useState)(!0),[I,P]=(0,o.useState)(!1),[C,L]=(0,o.useState)([]),[F,O]=(0,o.useState)([]),D=e=>s((0,E.mi)(e)),M=(0,o.useCallback)((e=>{s((0,f.no)(e)),k.setValue(null===e||void 0===e?void 0:e.html.replaceAll("\r\n","\n"))}),[k,s]),{data:V}=g.Nq.useGetProjectQuery(Number(B),{skip:!B}),[z,H]=(0,o.useState)([]);(0,o.useEffect)((()=>{if(V){const{owner:e,admins:t,users:l}=null===V||void 0===V?void 0:V.members;H([e&&{...e},t&&Array.isArray(t)&&t.map((e=>({...e}))),l&&Array.isArray(l)&&l.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[j,W]=(0,o.useState)(1),[G,U]=(0,o.useState)(!1);(0,o.useEffect)((()=>{const e=Array.isArray(x)&&x.length&&(null===x||void 0===x?void 0:x.map((e=>{var l;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===(l=e.slug)||void 0===l?void 0:l.includes("autosave")}})));O(e||[]),L(e),N(!1),w<2&&U(!0)}),[x,w,t]);const X=T||I||G?null:o.createElement("div",{style:{textAlign:"center",marginTop:24,marginBottom:24,height:32,lineHeight:"32px"}},o.createElement(r.Ay,{onClick:()=>{P(!0),O(C.concat([...new Array(3)].map((()=>({loading:!0}))))),s(p.GY.endpoints.getEmailHistory.initiate({emailId:e.id,page:j+1})).then((e=>{const{data:l,totalPages:o}=e.data,a=Array.isArray(l)&&(null===l||void 0===l?void 0:l.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);O(i),L(i),P(!1),window.dispatchEvent(new Event("resize")),j+1>=o&&U(!0),W(j+1)}))}},t("loading more"))),[q,$]=(0,o.useState)(),[Y,K]=(0,o.useState)(null),Q=(0,o.useRef)();return Q.current=e,(0,o.useEffect)((()=>{if(!R&&!Y){const e=Q.current;e&&K({html:k.getValue(),preheader:e.preheader,common_styles:e.common_styles,subject:e.subject})}}),[R,K,k,Y]),(0,o.useEffect)((()=>{R&&Y&&(M(Y),K(null))}),[R,Y,M]),o.createElement(o.Fragment,null,o.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:o.createElement(o.Fragment,null,t("Version history")),key:S.Vv,forceRender:!0,className:"email-settings__collapse-panel",style:{height:"100%"},children:o.createElement(d.A,{className:"history-panel__list",loading:T,itemLayout:"horizontal",loadMore:X,dataSource:F,header:o.createElement("div",{className:"history-panel__list-header"},o.createElement("div",{className:"history-panel__list-date"},t("Time")),o.createElement("div",{className:"history-panel__list-author"},t("Author")),o.createElement("div",{className:"history-panel__restore"},"Set")),renderItem:(e,a)=>{var i;return o.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})},o.createElement(m.A,{title:!1,loading:e.loading||!1,active:!0},o.createElement("div",{className:"history-panel__list-date"},e.date),o.createElement("div",{className:"history-panel__list-author"},(null===(i=z.find((t=>{var l,o;return(null===(l=t.id)||void 0===l?void 0:l.toString())===(null===(o=e.author)||void 0===o?void 0:o.toString())})))||void 0===i?void 0:i.display_name)||"\u2013"),e.isAutosave&&q!==a&&o.createElement("div",{style:{opacity:.45},className:"history-panel__list-autosave"},t("Auto")),!e.isAutosave&&o.createElement(r.Ay,{size:"small",className:"history-panel__restore",type:"link",onClick:e=>{q===a&&e.stopPropagation(),M(C[a]),$(null),K(null),l({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1}),s((0,E.Fk)())}},t("Set")),e.isAutosave&&q===a&&o.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),l({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1})}},t("Set"))))}})}]}),o.createElement(r.Ay,{type:"text",className:"ant-modal-close","aria-label":"Close",onClick:()=>{s((0,E.Fk)()),M(Y),K(null),D(!0),l({operation:S.Ru.SANDBOX_LOCK_EDIT,data:!1})}},o.createElement(u.A,{icon:"Close"})))}},25911:(e,t,l)=>{l.d(t,{A:()=>ne});var o=l(98173),a=l(62272),i=l(47555),r=l(40120),n=l(64909),d=l(86406),m=l(77073),s=l(91321),c=l(2604),u=l(85591),p=l.n(u),g=l(37969),b=l(93771),E=l(79245),h=l(12543),f=l(16238),v=l(76428),A=l(67756),_=l(58316),y=l(87690),S=l(62296),B=l(1549),k=l(95331),x=l(10267),w=l(6311),R=l(70178),T=l(51070),N=l(85758),I=l(27352),P=l(23424),C=l(84572),L=l(47014),F=l(78915),O=l(40277),D=l(96734),M=l(89613),V=l(32947);const z=({isMenuCollapsed:e,setIsMenuCollapsed:t,isLocked:l})=>{var i;const{__:r}=(0,h.s9)();let n=(0,c.wA)(),d=(0,a.Zp)();const{projectId:m,emailId:s,blockId:u}=(0,a.g)(),{pathname:z}=(0,a.zy)(),[H,j]=(0,o.useState)(""),W=(0,c.d4)(C.yN),G=(0,c.d4)(L.C1),U=(0,D.p)(),X=(0,M.u)(),q=(0,o.useCallback)((()=>{z.includes("blocks")?j("Blocks"):z.includes("emails")?j("Emails"):z.includes("members")&&j("Members"),!l&&t(!0)}),[z,t,l]);(0,o.useEffect)((()=>{q()}),[q]);let $=[],Y=[];const K=(null===W||void 0===W?void 0:W.title)||"",Q=()=>{try{window.LP_show(85420)}catch(e){}};let J=[{label:o.createElement("a",{href:"https://emailmaker.ru/help/",target:"_blank",rel:"noopener noreferrer"},r("Help")),key:"Help center",icon:o.createElement(f.A,{style:{fontSize:"16px"}}),className:"help-center"},{label:r("Chat support"),key:"Support chat",icon:o.createElement(v.A,{style:{fontSize:"16px"}}),className:"open-support-chat",onClick:()=>{try{window.carrotquest.open()}catch(e){}}}];(s||u)&&J.push({label:r("Onboarding"),key:"Onboarding",icon:o.createElement(A.A,{style:{fontSize:"16px"}}),className:"open-onboarding",onClick:Q});let Z=[{label:r("Account settings"),key:"Account settings",icon:o.createElement(_.A,{style:{fontSize:"16px"}}),className:"em-analytics__account-settings",onClick:()=>{n((0,P.qf)(V.lx.EDIT_PROFILE_MODAL)),!l&&t(!0)}},{label:o.createElement(E.N_,{to:"/billing"},r("Billing")),key:"Billing",icon:o.createElement(y.A,{style:{fontSize:"16px"}}),className:"em-analytics__billing"},{label:r("Sign out"),icon:o.createElement(S.A,{style:{fontSize:"16px"}}),key:"Sign out",className:"em-analytics__sign-out",onClick:()=>{(0,O.Id)(U),n(F.Q2.util.resetApiState()),d("/auth",{replace:!0})}}];const ee="/projects"+(m?"/"+m+"/emails?page=1":""),te=[{label:o.createElement(E.N_,{style:{fontSize:16},to:ee},K),key:"Project",popupOffset:[0,16],style:{fontWeight:500},icon:m?o.createElement(E.N_,{to:ee,className:"project-menu__block",style:{fontSize:"18px",zIndex:99}},o.createElement(g.Ay,{type:"primary",className:"project-menu__block-button"},null===K||void 0===K?void 0:K.split(" ").slice(0,2).map((e=>Array.from(e)[0])))):o.createElement(E.N_,{to:ee,rel:"noopener noreferrer",className:"project-menu__block",style:{fontSize:"28px"}},o.createElement("b",null,o.createElement("span",{className:"letters"},"E"),(!e||l)&&o.createElement("span",{className:"hidden-text"},"mail")),o.createElement("span",{className:"letters"},"M"),(!e||l)&&o.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:o.createElement(B.A,{style:{fontSize:"16px"}}),onClick:()=>{n((0,P.qf)(V.lx.EDIT_PROJECT_MODAL)),!l&&t(!0)}},{label:o.createElement(E.N_,{to:"/projects"},r("List of projects")),key:"List of projects",icon:o.createElement(k.A,{style:{fontSize:"16px"}}),className:"em-analytics__sign-out"}]},{type:"divider"}];return $.push({icon:o.createElement(x.A,{style:{fontSize:20}}),label:o.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:o.createElement(w.A,{style:{fontSize:20}}),label:o.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:o.createElement(R.A,{style:{fontSize:20}}),label:o.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"===G.subscription.post_name&&m&&G.counters.emails_counter>2&&Y.push({icon:o.createElement(T.A,{style:{fontSize:20,lineHeight:"44px"}}),label:o.createElement(E.N_,{to:"/billing",rel:"noopener noreferrer",style:{fontSize:16,color:"white"}},r("Upgrade")),key:"Emails",className:"project-menu__list-item",onClick:()=>{X({event:"click",action:"upgrade_tariff"})}}),Y.push({icon:o.createElement(N.A,{style:{fontSize:18}}),label:r("Help menu"),key:"Help menu",className:"project-menu__list-item support-center-menu",children:J},{icon:o.createElement(I.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:o.createElement("span",{style:{width:"20px",height:"20px",fontSize:"20px"},className:"user-profile__avatar anticon"},null!==G&&void 0!==G&&null!==(i=G.avatar_urls)&&void 0!==i&&i[24]?[o.createElement("img",{style:{width:"100%"},key:"img",src:null===G||void 0===G?void 0:G.avatar_urls[24],alt:null!==G&&void 0!==G&&G.name?`${null===G||void 0===G?void 0:G.name} avatar`:"User avatar",className:"user-profile__avatar-img"}),o.createElement(_.A,{key:"UserOutlined",style:{position:"absolute",fontSize:20,borderRadius:100,overflow:"hidden",height:20,width:20,lineHeight:0,zIndex:-1}})]:o.createElement(_.A,{style:{color:"white"}})),label:(null===G||void 0===G?void 0:G.name)||null,key:"User profile",className:"project-menu__list-item user-profile",children:Z}),o.createElement(o.Fragment,null,o.createElement("div",{className:"project-menu"},o.createElement("div",null,o.createElement(b.A,{disabledOverflow:!0,className:"project-menu__list project-menu__list_top",style:{fontSize:16},items:te,triggerSubMenuAction:"hover",subMenuOpenDelay:.3,subMenuCloseDelay:.6,selectable:!1}),m&&o.createElement(b.A,{disabledOverflow:!0,selectable:!0,selectedKeys:[H],className:"project-menu__list project-menu__list_second",style:{fontSize:16,marginTop:30},items:$,triggerSubMenuAction:"hover"})),o.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:Y,triggerSubMenuAction:"hover"})))};var H=l(63837),j=l(99460),W=l(62913),G=l(13785),U=l(8807),X=l(1047),q=l(39420),$=l(52919);const Y=()=>{var e;const{__:t}=(0,h.s9)(),l=(0,c.wA)(),[a]=(0,F.b9)(),[i,r]=(0,o.useState)(null===(e=window)||void 0===e?void 0:e.localStorage.getItem(V.V0.em_color_scheme)),n=(0,$.XW)(),d=(0,o.useCallback)(((e=null)=>{const t=e;(e=>{let t;if((0,q.Hk)(e),null===e){const e=matchMedia(V.F3).matches?V.nd:V.T;localStorage.removeItem(V.V0.em_color_scheme),t=e}else localStorage.setItem(V.V0.em_color_scheme,e),t=e;l((0,X.eX)(t===V.nd?`vs-${t}`:V.T)),(0,q.A5)(t),n({operation:V.Ru.UPDATE_PREVIEW,theme:t}),a({theme:e})})(t),r(t)}),[l,a,n]);return(0,o.useEffect)((()=>{matchMedia(V.F3).onchange=()=>d()}),[d]),o.createElement("div",{onClick:e=>e.stopPropagation()},o.createElement(W.A,{className:"theme-switcher",style:{cursor:"pointer",color:"var(--colorText)"},value:i,options:[{label:o.createElement(G.A,{title:t("Light theme")},o.createElement(U.A,{icon:"LightMode",style:{fontSize:18}})),value:V.T},{label:o.createElement(G.A,{title:t("System theme")},o.createElement(U.A,{icon:"AutoMode",style:{fontSize:18}})),value:null},{label:o.createElement(G.A,{title:t("Dark theme")},o.createElement(U.A,{icon:"DarkMode",style:{fontSize:18}})),value:V.nd}],onChange:e=>d(e)}))};var K=l(705),Q=l(22536),J=l(49982),Z=l(69201),ee=l(62347),te=l(86095),le=l(90121),oe=l(27941),ae=l(13668);const{Sider:ie}=i.A,{useToken:re}=r.A,ne=()=>{const{token:e}=re();let t=(0,a.zy)();const l=(0,c.wA)(),r=(0,a.Zp)(),{emailId:u,blockId:g}=(0,a.g)(),b=(0,c.d4)(L.C1),E=(0,c.d4)(P.cL),h=(0,o.useRef)(),f=(0,M.u)(),[v]=((0,oe.rD)(),(0,K.bw)()),A=(0,n.hN)();h.current||(h.current=(0,te.$Z)()),(0,o.useEffect)((()=>{(0,q.FN)(e)}),[e]);const{data:_=[],isSuccess:y}=(0,K.I9)(b.id,{pollingInterval:3e4,skip:E});(0,o.useEffect)((()=>{const e=_.filter((e=>""===e.seen||null===e.seen));setTimeout((()=>{e.length&&y&&e.forEach((e=>{var t,l;"subscription_payment"===e.event&&f({event:"payment",data:e.data}),A[e.type]({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(t=e.title)||void 0===t?void 0:t.rendered)||e.title||""}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:(null===(l=e.content)||void 0===l?void 0:l.rendered)||""}}),placement:"bottomRight"});const a=(new Date).toLocaleString();v({id:e.id,datetime:a}).unwrap()}))}),5e3)}),[y,v,_,A]),(0,J.A)(),(0,Z.A)(),(0,ee.A)(),(0,o.useEffect)((()=>{g||l((0,Q.nJ)()),u||l((0,X.ss)())}),[g,u,l,t.pathname]);let S=null;u||g||t.pathname.endsWith("/new")?S=h.current:h.current&&h.current.getValue()&&setTimeout((()=>h.current.setValue("")),1e3);const B=JSON.parse(localStorage.getItem(V.V0.em_menu_is_locked)),[k,x]=(0,o.useState)((null===B||void 0===B?void 0:B.isLocked)||!1),[w,R]=(0,o.useState)(!0);return(0,o.useEffect)((()=>{const e=()=>localStorage.setItem(V.V0.em_menu_is_locked,JSON.stringify({isLocked:k}));return e(),e()}),[k]),(0,le.D3)(ae._1,(0,o.useCallback)((e=>{const t=(0,oe.Mu)(e);r(t)}),[r])),o.createElement("div",{className:"main"},o.createElement(te.kx.Provider,{value:S},o.createElement("div",{className:"main__pane main__pane_main"},o.createElement("div",{className:"main__pane-content",id:"pane-content-iframe"},o.createElement(i.A,{className:"main__pane-layout",hasSider:!0},!V.EW.isPlugin&&o.createElement(ie,{theme:"light",style:{borderColor:e.colorBorder,position:"fixed",overflow:"hidden"},collapsible:!0,collapsed:!k&&w,defaultCollapsed:!0,reverseArrow:!k&&!w||k&&!w,trigger:o.createElement("div",{className:"main__pane-trigger"},k?o.createElement(s.A,{style:{fontSize:18}}):o.createElement(o.Fragment,null,o.createElement(d.A,{style:{fontSize:18}}),o.createElement(m.A,{style:{fontSize:18}})),o.createElement(Y,null)),className:p()("main__menu",{main__menu_lock:k}),width:260,collapsedWidth:80,zeroWidthTriggerStyle:{},onCollapse:(e,t)=>{e?!k&&R(!0):R(!e),x(!k)},onMouseEnter:()=>!k&&R(!1),onMouseLeave:()=>!k&&R(!0)},o.createElement(z,{isMenuCollapsed:w,setIsMenuCollapsed:R,isLocked:k})),o.createElement(H.A,{isModalVisible:E===V.lx.EDIT_PROJECT_MODAL}),o.createElement(j.A,{isModalVisible:E===V.lx.EDIT_PROFILE_MODAL}),o.createElement(a.sv,null))))))}},48956:(e,t,l)=>{l.d(t,{A:()=>c});var o=l(98173),a=l(48753),i=l(82021),r=l(37969),n=l(12543),d=l(62272),m=l(89613),s=l(98173);const c=({open:e,sideOnOk:t,onCancel:l,initialSlide:c=0})=>{const{__:u}=(0,n.s9)(),p=(0,d.Zp)(),[g,b]=(0,o.useState)(c),E=(0,o.useRef)(null),h=(0,m.u)();(0,o.useEffect)((()=>{e&&E.current&&(E.current.goTo(c,!0),b(c))}),[e,c]);const f=(0,o.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,o.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:l,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:()=>l(!1)},u("Cancel")),s.createElement(r.Ay,{type:"primary",size:"large",onClick:()=>{t&&t(),p("/billing"),l(!1)},style:{padding:"0 30px"}},u("Select plan"))))}},1753:(e,t,l)=>{l.d(t,{A:()=>s});var o=l(98173),a=l(49856),i=l(98447),r=l(38826);const n=o.createElement(r.A,{style:{fontSize:48},spin:!0}),d=(0,o.lazy)((()=>Promise.all([l.e(6819),l.e(1880),l.e(5346),l.e(8084)]).then(l.bind(l,10275)))),m={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"};function s(e){return o.createElement(o.Suspense,{fallback:o.createElement(a.A,{size:"large",style:m},o.createElement(i.A,{indicator:n}))},o.createElement(d,e))}},89687:(e,t,l)=>{l.d(t,{A:()=>i});var o=l(98173),a=l(62272);const i=({lastProjectId:e})=>{const{pathname:t,search:l}=(0,a.zy)();return!1===e?o.createElement(a.C5,{to:"/projects"}):e&&o.createElement(a.C5,{to:`/projects/${e+t+l}`})}},67007:(e,t,l)=>{l.d(t,{A:()=>i});var o=l(98173),a=l(62272);const i=({to:e})=>o.createElement(a.C5,{to:e})},96087:(e,t,l)=>{l.d(t,{A:()=>c});var o=l(98173),a=l(47555),i=l(72570),r=l(37969),n=l(62272),d=l(12543),m=l(40277);const{Content:s}=a.A,c=()=>{const{__:e}=(0,d.s9)();let t=(0,n.Zp)();return o.createElement(a.A,null,o.createElement(s,{className:"container"},o.createElement(i.Ay,{status:"500",title:"404",subTitle:e("Sorry, the page you visited does not exist."),extra:o.createElement(r.Ay,{type:"primary",onClick:()=>(0,m.XZ)(t,"/projects")},e("Back Home"))})))}},53821:(e,t,l)=>{l.d(t,{A:()=>Y});var o=l(98173),a=l(62272),i=l(2604),r=l(85591),n=l.n(r),d=l(30753),m=l(63719),s=l(49856),c=l(67034),u=l(94674),p=l(201),g=l(66964),b=l(37969),E=l(99291),h=l(5553),f=l(69194),v=l(13785),A=l(34401),_=l(66711),y=l(51717),S=l(63448),B=l(42567),k=l(2952),x=l(1047),w=l(65716),R=l(40277),T=l(64909),N=l(52919),I=l(90614),P=l(27941),C=l(12543),L=l(86095),F=l(15626),O=l(32947);const{Text:D,Link:M,Title:V}=m.A,z="Links",H="Images",j="Spam assassin",W="Problems",G="valid",U="warnings",X="errors",q=[G,X,U],$=({summary:e,__:t,selectedTags:l,setSelectedTags:a})=>o.createElement(V,{level:5,style:{margin:0,fontSize:"14px"}},o.createElement(s.A,{style:{flexWrap:"wrap"},gap:"6"},q.map(((i,r)=>o.createElement(c.A.CheckableTag,{key:i+r,checked:null===l||void 0===l?void 0:l.includes(i),onChange:e=>((e,t)=>{const o=t?2===l.length?[]:[...l,e]:l.filter((t=>t!==e));a(o)})(i,e),className:n()(`${i} optimise__button`,{[`${i}_active`]:l.includes(i)})},t(i===G?"Valid":i===U?"Warnings":"Errors"),":"," ",(null===e||void 0===e?void 0:e[i])||0))))),Y=()=>{var e,t,l,r,m,s,c;const{__:q}=(0,C.s9)(),Y=(0,i.wA)(),K=(0,L.fn)(),Q=(0,P.rD)(),J=(0,T.hN)(),{emailId:Z,projectId:ee}=(0,a.g)(),te=(0,N.QC)(),le=(0,i.d4)(x.rd),oe=(0,I.ml)(F.AZ.ON_LIMIT_ID),[ae,ie]=(0,k.Sr)(),[re,ne]=(0,k.ku)(),[de,me]=(0,k.Ju)(),{data:se,isSuccess:ce,refetch:ue}=(0,w.fo)(+ee,{skip:!!O.EW.isPlugin||!+ee}),{limits:pe}=O.EW.isPlugin?Q.limits?Q:{limits:{optimization_limit:0}}:se||{limits:{optimization_limit:0}},{optimization_limit:ge}=pe,[be,Ee]=(0,o.useState)(),[he,fe]=(0,o.useState)([]),[ve,Ae]=(0,o.useState)([]),[_e,ye]=(0,o.useState)([]),[Se,Be]=(0,o.useState)([]),[ke,xe]=(0,o.useState)(0),[we,Re]=(0,o.useState)([]),[Te,Ne]=(0,o.useState)([]),Ie=ke>=ge&&ge>0,Pe=!(!Q.limits||!Q.counters)&&O.EW.isPlugin,Ce=(0,o.useCallback)((()=>{oe.fire({name:"OptimizationCount",count:ke+1})}),[oe,ke]);(0,o.useEffect)((()=>{var e,t;Pe?xe((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)&&xe(se.counters.optimization_counter)}),[Pe,se,ce,Q]),(0,o.useEffect)((()=>{var e,t;be===z&&we.links&&Ae(he.length>0?null===(e=we.links)||void 0===e?void 0:e.filter((e=>he.includes(e.status))):we.links);be===H&&Te.images&&ye(he.length>0?null===(t=Te.images)||void 0===t?void 0:t.filter((e=>he.includes(e.status))):Te.images)}),[we.links,Te.images,he,be]);const Le=()=>{if(!Z)return void J.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});let e;Pe&&(xe((e=>e+1)),Ce());const t=K.getValue(),l=(new DOMParser).parseFromString(t,"text/html"),a={},i={};l.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:l})=>{if(l)(0,R.p6)({error:l},J);else if(null!==t&&void 0!==t&&t.result){let l=[...t.result];null===l||void 0===l||l.sort(((e,t)=>e.linkId-t.linkId));const o=e=>{var t,l,o,a;return(null!==e.statusCode?e.statusCode<300&&(null===(t=null===(l=e.page)||void 0===l?void 0:l.secure)||void 0===t||t):"invalid"!==e.type)?G:(e.statusCode&&e.statusCode<400||200===e.statusCode&&(null===(o=null===(a=e.page)||void 0===a?void 0:a.secure)||void 0===o||o))&&"invalid"!==e.type?U:X};e={links:l.map((e=>({...e,text:i[e.linkId],status:o(e)}))),summary:{valid:l.filter((e=>o(e)===G)).length||0,warnings:l.filter((e=>o(e)===U)).length||0,errors:l.filter((e=>o(e)===X)).length||0}},Re(e),(0,R.wB)(q("Links validation was successfully completed"),J),!O.EW.isPlugin&&ue()}else t.statusCode>300||!t.success?(0,R.p6)({error:{data:t}},J):J.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),!we.links&&De("")})).catch((e=>{(0,R.p6)({error:e},J)}))},Fe=()=>{if(!Z)return void J.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"});Pe&&(xe((e=>e+1)),Ce());const e=K.getValue(),t=(new DOMParser).parseFromString(e,"text/html");let l={};t.querySelectorAll("img").forEach(((e,t)=>l[`image_${t}`]=e.src)),te.send({operation:"sandbox_set_attr_to_images"}),de({entity_id:Z,data:l}).then((({data:e,error:t})=>{let l;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 o=t.reduce(((e,t)=>e+Math.round(t.image.bytes/1024)),0);const a=e=>null!==e.statusCode&&e.statusCode<300?G:e.statusCode<400&&e.statusCode>=300||200===e.statusCode&&!e.valid?U:X;l={images:t.map((e=>({...e,status:a(e)})))||[],summary:{valid:t.filter((e=>a(e)===G)).length||0,warnings:t.filter((e=>a(e)===U)).length||0,errors:t.filter((e=>a(e)===X)).length||0},summaryTime:{value:(o>1200?o/1e3:o).toFixed(1),name:q(o>1200?"MB":"KB")}},l&&Ne(l),(0,R.wB)(q("Images validation was successfully completed"),J),!O.EW.isPlugin&&ue()}else{var a;e.statusCode>300||!e.success?(0,R.p6)({error:{data:e}},J):J.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:"\u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430"}}),placement:"bottomRight"}),(null===Te||void 0===Te||null===(a=Te.images)||void 0===a||!a.length)&&De("")}})).catch((e=>{(0,R.p6)({error:e},J)}))},Oe=()=>{Z?(Pe&&(xe((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)),Be({...e.result,report:t})),(0,R.wB)(q("Spam validation was successfully completed"),J),!O.EW.isPlugin&&ue()}else e.statusCode>300||!e.success?(0,R.p6)({error:{data:e}},J):J.error({message:o.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:o.createElement("div",{dangerouslySetInnerHTML:{__html:"Save the mail first."}}),placement:"bottomRight"})},De=e=>{Ee(e!==be?e:""),fe([])};let Me=null;return(0,o.useEffect)((()=>{ge>0&&ke>=+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"})}),[ke,ge,q,J]),o.createElement("div",{className:"optimise selected_form-props-wrapper selected_form-props-wrapper_optimize"},Pe&&o.createElement(d.A,{counter:ke,limits:ge}),Q.optimizeLinksEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("Links validation"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;De(z),null!==we&&void 0!==we&&null!==(e=we.links)&&void 0!==e&&e.length||be===z||Le()},loading:ne.isLoading,disabled:Ie&&!(null!==we&&void 0!==we&&null!==(e=we.links)&&void 0!==e&&e.length)},!ne.isLoading&&(be===z?o.createElement(A.A,null):o.createElement(_.A,null))))),be===z&&!(null===we||void 0===we||!we.links)&&(0===(null===we||void 0===we||null===(t=we.links)||void 0===t?void 0:t.length)?o.createElement(p.A,{style:{marginBottom:24}},o.createElement(E.A,{message:q("No links found."),type:"info"})):o.createElement(o.Fragment,null,o.createElement(p.A,{style:{marginBottom:14}},o.createElement("div",{className:"optimise__title-wrapper"},o.createElement($,{__:q,summary:we.summary,setSelectedTags:fe,selectedTags:he}),o.createElement(b.Ay,{disabled:Ie,loading:ne.isLoading,onClick:Le,icon:o.createElement(y.A,null)},q("Refresh")))),o.createElement(p.A,{style:{marginBottom:24}},o.createElement(g.A,{span:24},o.createElement(h.A,{itemLayout:"horizontal",dataSource:ve,renderItem:(e,t)=>{var l;return o.createElement(h.A.Item,{style:{border:"none"},key:t+"_"+e.id},o.createElement(h.A.Item.Meta,{avatar:e.status===G?o.createElement(S.A,{className:G}):e.status===U?o.createElement(S.A,{className:U}):o.createElement(B.A,{className:X}),title:o.createElement(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.linkId,l=600>e.statusCode>399||!e.statusCode,void te.send({operation:O.Ru.SANDBOX_SET_POSITION_TO_LINK,settings:{elementId:t,isError:l}});var t,l}},""===e.url?q("empty link"):e.url),description:o.createElement(o.Fragment,null,!(null===(l=e.text)||void 0===l||!l.length)&&o.createElement(D,{type:"secondary"},e.text),e.page.title&&e.page.title,e.page.secure&&e.status===G&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),o.createElement("span",{className:G},q("secure"))),!e.resolvedUrl&&!e.statusCode&&"url"===e.type&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"},"\xa0\u2022\xa0"),o.createElement(D,{type:"secondary"},q("Failed to load"))))}))}})))))),Q.optimizeImagesEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("Images validation"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{var e;De(H),null!==Te&&void 0!==Te&&null!==(e=Te.images)&&void 0!==e&&e.length||be===H||Fe()},loading:me.isLoading},!me.isLoading&&(be===H?o.createElement(A.A,null):o.createElement(_.A,null))))),be===H&&!(null===Te||void 0===Te||!Te.images)&&(0===(null===Te||void 0===Te||null===(l=Te.images)||void 0===l?void 0:l.length)?o.createElement(p.A,{style:{marginBottom:24}},o.createElement(E.A,{message:q("No images found."),type:"info"})):o.createElement(o.Fragment,null,o.createElement(p.A,{style:{marginBottom:16}},o.createElement(E.A,{style:{padding:14,paddingBottom:10,width:"100%"},message:o.createElement("div",{className:"optimise__summary"},o.createElement("div",null,o.createElement(V,{level:4,style:{marginBottom:"0"}},Te.images.length," "),o.createElement("span",{style:{fontSize:"12px"}},q("images"))),o.createElement("div",null,o.createElement(V,{level:4,style:{marginBottom:"0"}},null===(r=Te.summaryTime)||void 0===r?void 0:r.value,null===(m=Te.summaryTime)||void 0===m?void 0:m.name),o.createElement("span",{style:{fontSize:"12px"}},q("total size"))),o.createElement("div",null,o.createElement(V,{level:4,style:{marginBottom:"0"}},(Math.max(...Te.images.map((e=>e.image.responseTime)))/1e3).toFixed(2)+q("s")),o.createElement("span",{style:{fontSize:"12px"}},q("time to load")))),type:"warning"})),o.createElement(p.A,{style:{marginBottom:12}},o.createElement("div",{className:"optimise__title-wrapper"},o.createElement($,{__:q,summary:Te.summary,setSelectedTags:fe,selectedTags:he}),o.createElement(b.Ay,{icon:o.createElement(y.A,null),disabled:Ie,loading:me.isLoading,onClick:()=>Fe()},q("Refresh")))),o.createElement(p.A,{style:{marginBottom:12}},o.createElement(g.A,{span:24},o.createElement(h.A,{className:"optimise__result-list",itemLayout:"horizontal",dataSource:_e,renderItem:(e,t)=>o.createElement(h.A.Item,{className:"optimise__image-item image-item",style:{border:"none"},key:t},o.createElement(h.A.Item.Meta,{className:n()("image-item__meta",{"image-item__meta_fail":!e.resolvedUrl&&!e.statusCode}),avatar:o.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 l=document.querySelector(".img-preview")?document.querySelector(".img-preview"):null,o=document.querySelector(".img-preview-content")?document.querySelector(".img-preview-content"):null;document.querySelector(".img-preview")||(l=document.createElement("div"),l.classList.add("img-preview"),o=document.createElement("div"),o.classList.add("img-preview-content"),l.append(o),document.querySelector(".email-pane__col_settings-inner").append(l)),o.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"!==l.style.opacity&&setTimeout((function(){l.style.opacity="1",l.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?o.createElement(v.A,{placement:"top",title:e.message},o.createElement(M,{className:"optimise__link",style:{color:"#177ddc",textDecoration:"underline",userSelect:"text"},draggable:!1,onClick:()=>{return t=e.imageId,l=600>e.statusCode>399||!e.statusCode,void te.send({operation:O.Ru.SANDBOX_SET_POSITION_TO_IMG,settings:{elementId:t,isError:l}});var t,l}},""===(null===e||void 0===e?void 0:e.url)?q("empty src"):e.url)):e.message,description:o.createElement(o.Fragment,null,o.createElement("div",{className:"image-size"},e.image.dimensions&&o.createElement(o.Fragment,null,e.image.dimensions.width+" \xd7 "+e.image.dimensions.height,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,Math.round(e.image.bytes/1024),q("kB")),o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,e.image.responseTime,q("ms")),o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:"image-size-format"},e.image.contentType)),e.image.secure&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:G},q("secure"))),e.resolvedUrl&&!e.valid&&o.createElement(D,{type:"danger"},q("not valid")))," ",!e.resolvedUrl&&!e.statusCode&&o.createElement(D,{type:"danger"},q("Failed to load")))}))})))))),Q.optimizeSpamAssassinEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("SpamAssassin"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",loading:ie.isLoading,onClick:()=>{var e;De(j),null!==(e=Se.report)&&void 0!==e&&e.length||Oe()},disabled:Ie&&!(null!==Se&&void 0!==Se&&null!==(s=Se.report)&&void 0!==s&&s.length)},!ie.isLoading&&(be===j?o.createElement(A.A,null):o.createElement(_.A,null))))),be===j&&!(null===(c=Se.report)||void 0===c||!c.length)&&o.createElement(o.Fragment,null,o.createElement(p.A,{style:{marginBottom:8}},o.createElement("div",{className:"optimise__title-wrapper optimise__title-wrapper_spam"},o.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"},o.createElement("span",{style:{marginRight:"12px"}},Se.spamScore||0),o.createElement(D,{style:{marginRight:"12px",fontSize:"20px"}},"Score")),o.createElement(b.Ay,{disabled:Ie,icon:o.createElement(y.A,null),loading:ie.isLoading,onClick:Oe},q("Refresh"))),Se.spamScore>Se.baseSpamScore-1&&o.createElement(D,null,q("Lower scores are better. Aim for a score less than ")+(Se.baseSpamScore-1)+".")),o.createElement(p.A,{style:{marginBottom:8}},o.createElement(g.A,{span:24},o.createElement(h.A,{itemLayout:"horizontal",dataSource:Se.report,renderItem:e=>o.createElement(h.A.Item,{style:{border:"none"}},o.createElement(h.A.Item.Meta,{title:o.createElement(o.Fragment,null,o.createElement(D,{style:{fontSize:"20px"}},e.score),o.createElement("span",{style:{marginLeft:"12px"}},e.description))}))}))))),Q.optimizeCheckCodeEnabled&&o.createElement(o.Fragment,null,o.createElement(u.A,{className:"selected-td-form__divider",style:{marginTop:0,marginBottom:0}}),o.createElement(p.A,{gutter:10,align:"middle"},o.createElement(g.A,{span:20},o.createElement("div",{className:"form-group-title"},q("Source code validation"))),o.createElement(g.A,{span:4,align:"right"},o.createElement(b.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>De(W)},be===W?o.createElement(A.A,null):o.createElement(_.A,null)))),be===W&&o.createElement(o.Fragment,null,null!==le&&void 0!==le&&le.length?o.createElement(p.A,{style:{marginBottom:8}},o.createElement(g.A,{span:24},o.createElement(h.A,{itemLayout:"horizontal",dataSource:le,renderItem:e=>o.createElement(h.A.Item,{style:{border:"none"}},o.createElement(h.A.Item.Meta,{avatar:e.severity<6?o.createElement(B.A,{className:U}):o.createElement(B.A,{className:X}),title:o.createElement(D,{onClick:()=>(e=>{const t={startColumn:e.startColumn,startLineNumber:e.startLineNumber,endColumn:e.endColumn,endLineNumber:e.endLineNumber};Y((0,x.ps)(t))})(e),style:{cursor:"pointer"},className:e.severity<6?"warning":"error"},"Line: ",e.startLineNumber," ",e.startLineNumber!==e.endLineNumber&&" \u2013 "+e.endLineNumber),description:o.createElement(D,null,e.message)}))}))):o.createElement(p.A,{style:{marginBottom:24}},o.createElement(E.A,{message:q("No problems found."),type:"info"})))))}},56605:(e,t,l)=>{l.d(t,{A:()=>n});var o=l(98173),a=l(49856),i=l(98447),r=l(38826);const n=({small:e=!1,style:t,wrap:l=!1})=>{const n={width:e?"100%":"100vw",height:"80vh",display:"flex",justifyContent:"center",alignItems:"center",...t},d=o.createElement(r.A,{style:{fontSize:48},spin:!0});return o.createElement(a.A,{size:"large",style:n,wrap:l},o.createElement(i.A,{indicator:d}))}},97041:(e,t,l)=>{l.d(t,{A:()=>p});var o=l(98173),a=l(64909),i=l(62272),r=l(79245),n=l(78915),d=l(40277),m=l(96734),s=l(89613),c=l(32947);const u="emailmaker.ru",p=({children:e})=>{const t=(0,i.zy)(),l=(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:B,isSuccess:k,error:x,data:w,refetch:R}=(0,n.CR)("",{skip:c.EW.isPlugin||!p.get(c.A9.em_token)}),T=(0,o.useMemo)((()=>({email:g.get("email"),hash:g.get("hash"),event:"confirmation"===g.get("event")})),[g]);if((0,o.useEffect)((()=>{f?(0,d.p6)({error:A},l):v&&(E({event:"email_confirmation",user_email:null===_||void 0===_?void 0:_.email}),(0,d.wB)(_.message,l),w&&R())}),[_,A,f,v,l,w,R,E]),(0,o.useEffect)((()=>{!(T.email&&T.hash&&T.event)||!1!==(null===w||void 0===w?void 0:w.email_confirmation)&&p.get(c.A9.em_token)||_||h({hash:T.hash,email:T.email,event:T.event}).catch((e=>{})).finally((()=>b("")))}),[T,h,w,p,b,_]),(0,o.useEffect)((()=>{y&&x&&((0,d.p6)({error:x},l),(0,d.Id)(p))}),[w,y,x,l,p]),c.EW.isPlugin)return e;if(!c.EW.isPlugin&&!p.get(c.A9.em_token)&&!t.pathname.includes("auth"))return o.createElement(i.C5,{to:"/auth",state:{from:t}});if((S||B)&&!t.pathname.includes("auth"))return o.createElement(o.Fragment,null);if(y&&!t.pathname.includes("auth"))return o.createElement(i.C5,{to:"/auth",state:{from:t}});if(k){const{id:l,email:a,name:r,locale:n,carrotquest_hash:d,ducalis_hash:m,email_subscription_consent:s,last_used_project:g}=w;return p.set(c.A9.em_id,l,{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?o.createElement(i.C5,{to:`/projects/${g}/emails`,replace:!0}):e}return t.pathname.includes("auth")?e:void 0}},14107:(e,t,l)=>{l.d(t,{A:()=>E});var o=l(98173),a=l(62272),i=l(2604),r=l(47555),n=l(72570),d=l(37969),m=l(12543),s=l(65716),c=l(84572),u=l(56605),p=l(40277),g=l(32947);const{Content:b}=r.A,E=()=>{var e;const{__:t}=(0,m.s9)(),{projectId:l}=(0,a.g)();let E=(0,a.Zp)(),h=(0,a.zy)();const f=(0,i.wA)(),v=(0,s.fo)(+l,{skip:!l}),{isLoading:A,isError:_,error:y,isSuccess:S,data:B}=v;return(0,o.useEffect)((()=>{S&&(null===B||void 0===B?void 0:B.id)!==l&&f((0,c.od)(B))}),[S,B,f,l]),(0,o.useEffect)((()=>{S&&l&&h.pathname.endsWith(l)&&E(`${h.pathname}/emails`)}),[S,h,E,l]),o.createElement(o.Fragment,null,A&&o.createElement(u.A,null),_&&y&&o.createElement(r.A,{className:"project-outlet"},o.createElement(b,{className:"project-outlet__container container"},o.createElement(n.Ay,{status:y.status,title:y.status,subTitle:null===(e=y.data)||void 0===e?void 0:e.message,extra:o.createElement(d.Ay,{type:"primary",onClick:()=>(0,p.XZ)(E,"/projects")},t("Back To Projects"))}))),(S||g.EW.isPlugin)&&o.createElement(a.sv,{context:{...v}}))}},40409:(e,t,l)=>{l.d(t,{A:()=>S});var o=l(98173),a=l(80703),i=l(13785),r=l(37969),n=l(64909),d=l(62272),m=l(2604),s=l(12543),c=l(52218),u=l.n(c),p=l(68984),g=l(65716),b=l(83027),E=l(62093),h=l(22536),f=l(40277),v=l(89613),A=l(86095),_=l(32947);const y=({block:e,isEditableRights:t,rightCol:l,autoSaveBlockResult:c})=>{const{__:y}=(0,s.s9)(),{projectId:S,blockId:B}=(0,d.g)();let k=(0,m.d4)(h.Fv),x=(0,m.d4)(h.Fv),w=(0,m.wA)();const R=(0,n.hN)(),T=(0,A.fn)(),N=(0,m.Pj)(),[I,P]=(0,o.useState)(!1),[C,L]=(0,o.useState)(null),[F,O]=(0,o.useState)(!1),[D,M]=(0,o.useState)(!1),V=(0,v.u)();(0,o.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:z,refetch:H}=(0,g.fo)(+S,{skip:!+S}),[j]=(0,p.Gr)(),[W,G]=(0,p.OZ)(),[U,X]=(0,p.pP)(),[q]=(0,g.OD)(),$=`project_${S}`,Y=z&&(0,f._q)(z,_.YY).find((e=>e.name===$)),K=z&&(0,f.HT)(z,_.YY),Q=(0,o.useCallback)((l=>{var o,a;if(O(!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 O(!1);if(((null===(o=e.tags)||void 0===o?void 0:o.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 O(!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 O(!1);const i=t=>{var o;const a=null===(o=e.tags)||void 0===o?void 0:o.map((e=>{const l=null===K||void 0===K?void 0:K.find((t=>t.name===e));return l?l.id:j({name:e,parent:t}).then((({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(R.fromError("TAG_CREATING_ERROR",e,t),O(!1)))}))})),i=(o=null)=>{const a=l=>{N.dispatch(b.kE.endpoints.getTags.initiate({parent:t})),H(),D&&(R.success({id:"BLOCK_EDITING_SUCCESS",message:y("The block was successfully saved.","block"),data:(0,n.x_)(e)}),O(!1)),fetch(((e,t,l,o)=>`https://scr.emcdn.ru/screenshot?delay=1000&width=800&fullPage=true&deviceScaleFactor=0.8&format=jpg&clearCache=true${o?`&cacheControl=true&cache-hash=${u()(o)}`:""}&url=${encodeURIComponent(`https://dev-backend-1.emailmaker.ru/get${e}/${l}?secret_hash=${u()(`${t}${l}${_.KI}`)}&raw=true`)}`)(_.IE,S,l.id,l.modified),{mode:"no-cors"}).then((()=>{}))},i=(0,f._q)(e,_.zh).filter((t=>(o||e.blocktags).includes(t.id))).map((e=>e.name));e.isNew?X.status!==_.eG&&U({source:l,title:null===e.title?y("New block title"):e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===T||void 0===T?void 0:T.getValue())||"",blocktags:o?o.join(","):e.blocktags,tags:i}).then((({data:t,error:l})=>{l?(R.fromError("BLOCK_CREATING_ERROR",{title:e.title,html:(null===T||void 0===T?void 0:T.getValue())||""},l),O(!1)):a(t)})):G.status!==_.eG&&W({blockId:e.id,source:l,title:e.title,project:e.project,type:e.type?e.type:"Other",description:e.description,html:(null===T||void 0===T?void 0:T.getValue())||"",blocktags:o||e.blocktags,tags:i}).then((({data:t,error:l})=>{l&&D?(R.fromError("BLOCK_EDITING_ERROR",(0,n.x_)(e),l),O(!1)):a(t)}))};a?Promise.all(a).then((e=>i(e))):i(null)};O(!0),Y?i(Y.id):j({name:$}).then((async({data:t,error:l})=>{if(l)R.fromError("FOLDER_CREATING_ERROR",$,l),O(!1);else{const{data:l,error:o}=await q({projectId:S,blocktags:t.id});o?(R.fromError("BLOCK_CLONING_ERROR",(0,n.x_)(e),o),O(!1)):l&&i(l.blocktags&&l.blocktags[0])}})).catch((e=>{}))}),[X.status,U,G.status,W,e,t,j,q,S,y,D,T,R,K,H,N,Y,$]);(0,o.useEffect)((()=>{D&&(Q(),M(!1))}),[D,Q]);const J=(0,o.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),M(!0))}),[]);(0,o.useEffect)((()=>(document.addEventListener("keydown",J),()=>{document.removeEventListener("keydown",J)})),[J]);const Z=(0,o.useCallback)((e=>{const t=e.data.operation,l=e.data.action;t===_.Ru.APPLICATION_ACTION&&"save_email"===l&&M(!0)}),[]);return(0,E.A)(Z),(0,o.useEffect)((()=>{X.isError&&(O(!1),(0,f.p6)(X,R))}),[w,X,R]),(0,o.useEffect)((()=>{const e=setTimeout((()=>{P(!0)}),1e4);return()=>{clearTimeout(e)}}),[]),(0,o.useEffect)((()=>{e.isNew&&!B&&I&&(Q(),P(!1))}),[I,e,Q,B]),o.createElement(i.A,{title:y(C?"Save by \u2318S":"Save by Ctrl+S"),placement:l?"right":"bottomRight"},o.createElement(r.Ay,{type:"primary",block:l,className:"em-analytics__block-save",icon:o.createElement(a.A,null),onClick:()=>{V({event:"click",action:"save_block"}),M(!0)},loading:G.isLoading||q.isLoading||X.isLoading||F||c},l||k||x?"":y("Save")))};y.defaultProps={block:null};const S=y},45887:(e,t,l)=>{l.d(t,{Ay:()=>O,QG:()=>L,Wv:()=>C});var o=l(98173),a=l(13785),i=l(37969),r=l(49856),n=l(64909),d=l(80703),m=l(62272),s=l(2604),c=l(52218),u=l.n(c),p=l(12543),g=l(98845),b=l(65716),E=l(83027),h=l(62093),f=l(12741),v=l(1047),A=l(40277),_=l(27941),y=l(89613),S=l(86095),B=l(90121),k=l(90614),x=l(96734),w=l(32947),R=l(15626),T=l(13668),N=l(16390);const I="NEXT_BUTTON",P="KEYBOARD",C=(e,t,l,o,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}${o?`&cacheControl=true&cache-hash=${u()(o)}`:""}&url=${encodeURIComponent(`https://app.emailmaker.ru/get${e}/${l}?secret_hash=${u()(`${t}${l}${w.KI}`)}&raw=true`)}${r?`&selector=${r}`:""}`,L=(e,t,l=!0,o=.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=${o}&format=jpg&clearCache=${l}${t?`&cacheControl=true&cache-hash=${u()(t)}`:""}&url=${encodeURIComponent(`${i}`)}${a?`&selector=${a}`:""}`},F=({email:e,isEditableRights:t,autoSaveEmailResult:l,disabled:c})=>{var u,L;let F=(0,s.wA)(),O=(0,m.Zp)();const{__:D,_x:M}=(0,p.s9)(),{projectId:V,emailId:z}=(0,m.g)(),H=(0,x.p)(),j=(0,n.hN)(),W=(0,_.rD)(),G=(0,S.fn)(),U=(0,s.Pj)(),X=(0,s.d4)(v.rY),q=(0,s.d4)(v.UI),[$,Y]=(0,o.useState)(!1),[K,Q]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&Q(!0)}),[]);const{data:J,refetch:Z}=(0,b.fo)(+V,{skip:!+V}),{data:ee,refetch:te}=(0,E.Jz)({parent:null===J||void 0===J||null===(u=J.folder)||void 0===u?void 0:u[0]},{skip:!w.EW.isPlugin||!(null!==J&&void 0!==J&&null!==(L=J.folder)&&void 0!==L&&L[0])}),[le]=(0,g.Gr)(),[oe]=(0,E.JI)(),[ae,ie]=(0,g.dN)(),[re,ne]=(0,g.Kh)(),[de]=(0,b.OD)(),[me,se]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(""),pe=`project_${V}`,ge=J&&(0,A._q)(J,w.zh).find((e=>e.name===pe)),be=J&&(0,A.HT)(J,w.zh),Ee=(0,k.ml)(R.AZ.BEFORE_SAVE_EMAIL),he=(0,y.u)(),fe=(0,o.useCallback)((l=>{var o,a;if(!t&&e.lock&&ce)return void j.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:(0,n.Gy)(e),message:D("No access to edit the letter."),placement:"bottomRight"});if(((null===e||void 0===e||null===(o=e.tags)||void 0===o?void 0:o.length)||(null===(a=e.emailtags)||void 0===a?void 0:a.length))>10&&ce)return void j.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:(0,n.Gy)(e),message:D("Maximum 10 tags available."),placement:"bottomRight"});const i=async t=>{var o;const a=Object.entries(X).flatMap((([e,t])=>t.map((({value:t,label:l})=>({id:+t,name:l,parent:+e.split("_")[0]})))));let i=[];q.length&&q.forEach((e=>{i.push(...null===e||void 0===e?void 0:e.children.map((e=>({id:e.id,parentId:e.parent}))))}));const r=(null===(o=e.tags)||void 0===o?void 0:o.map((e=>{const l=null===be||void 0===be?void 0:be.find((t=>t.name===e));return l?l.id:le({name:e,parent:t}).then((({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(j.fromError("TAG_CREATING_ERROR",e,t),se(!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:oe({name:e.name,parent:e.parent}).then((({error:t,data:l})=>{var o,a;return 400===(null===t||void 0===t?void 0:t.status)?null===t||void 0===t||null===(o=t.data)||void 0===o||null===(a=o.data)||void 0===a?void 0:a.term_id:l?l.id:void(t&&(j.fromError("GROUP_CREATING_ERROR",e,t),se(!1)))}))})))||[],m=(e,o=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())||D("Untitled email."),s=l=>{U.dispatch(E.kE.endpoints.getTags.initiate({parent:t})),!w.EW.isPlugin&&Z&&Z(),ce&&(j.success({id:"EMAIL_SAVING_SUCCESS",message:D("The email was successfully saved."),data:(0,n.Gy)(e)}),se(!1),!w.EW.isPlugin&&ee&&te()),w.EW.isPlugin||fetch(C(w.Tm,V,l.id,l.modified),{mode:"no-cors"}).then((()=>{}))},c=(0,A._q)(e,w.zh).filter((t=>(o||e.emailtags).includes(t.id))).map((e=>e.name));var u,p,g,b,h;if(e.isNew){if(ne.status!==w.eG){const t=H.get(w.A9.em_folder);re({title:m,source:l,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||w.iU,common_styles:e.common_styles||"",emailtags:o?o.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!==w.y2&&t}).then((({data:t,error:o})=>{Re.current=!1,o?(l===I&&Te(!1),ce&&j.fromError("EMAIL_CREATING_ERROR",{title:e.title,code:(null===G||void 0===G?void 0:G.getValue())||""},o),se(!1)):(F((0,f.aY)(null)),s(t),H.remove(w.A9.em_folder))}))}}else ie.status!==w.eG&&ae({emailId:e.id,source:l,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:o||e.emailtags,tags:c,group:a||e.group,is_template:e.is_template||!1}).then((({error:t})=>{Re.current=!1,t?(l===I&&Te(!1),ce&&j.fromError("EMAIL_EDITING_ERROR",(0,n.Gy)(e),t),se(!1)):s(e)}));he({event:"save",action:l?"save_email":"auto_save_email",email_id:e.id,project_id:V})},s={...e};Ee.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,[])}))};se(!0),ge?i(ge.id):le({name:pe}).then((async({data:t,error:l})=>{if(l)j.fromError("FOLDER_CREATING_ERROR",pe,l),se(!1);else{const{data:l,error:o}=await de({projectId:V,emailtags:t.id});o?(j.fromError("EMAIL_CLONING_ERROR",(0,n.Gy)(e),o),se(!1)):l&&i(l.emailtags&&l.emailtags[0])}})).catch((e=>{}))}),[ne.status,re,ie.status,ae,e,t,le,F,de,V,J,D,M,ce,G,be,Ee]);(0,B.D3)(T.Kp,(0,o.useCallback)((e=>fe(e||"EXTERNAL")),[fe]));const ve=(0,k.ml)(R.AZ.ON_NEXTBUTTON_CLICK_ID),Ae=(0,k.ml)(R.AZ.ON_SAVEBUTTON_CLICK_ID);(0,o.useEffect)((()=>{ce&&(setTimeout((()=>fe(ce))),ue(""))}),[ce]);const _e=(0,o.useCallback)((e=>{(e.ctrlKey||e.metaKey)&&83===e.keyCode&&(e.preventDefault(),ue(P))}),[fe]);(0,o.useEffect)((()=>(document.addEventListener("keydown",_e),()=>{document.removeEventListener("keydown",_e)})),[_e]);const ye=(0,o.useCallback)((e=>{const t=e.data.operation,l=e.data.action;t===w.Ru.APPLICATION_ACTION&&"save_email"===l&&ue(P)}),[fe]);(0,h.A)(ye),(0,o.useEffect)((()=>{e.isNew&&ne.isSuccess&&(se(!0),F(g.GY.util.upsertQueryData("getEmail",ne.data.id,{...ne.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((()=>{O(`/projects/${ne.data.project}/emails/${ne.data.id}`),se(!1),ce&&j.success({id:"EMAIL_SAVING_SUCCESS",message:D("The email was successfully saved."),data:(0,n.Gy)(e)})})))}),[O,F,ne,e.isNew,D,M,ce,G]);const Se=(0,k._q)(R.AZ.ON_EMAIL_INIT_ID);(0,o.useEffect)((()=>{let e=0;const t=Se((()=>{e=setTimeout((()=>Y(!0)),1e4)}));return()=>{e&&clearTimeout(e),t.dispose()}}),[Y,Se]),(0,o.useEffect)((()=>{e.isNew&&!z&&$&&(fe(),Y(!1))}),[$,e,fe,z]);const Be=ie.isLoading||(null===de||void 0===de?void 0:de.isLoading)||ne.isLoading||me||l&&l.isLoading,ke=W.saveButtonEnabled&&o.createElement(a.A,{key:"save-button",title:D(K?"Save by \u2318S":"Save by Ctrl+S"),placement:"bottom"},o.createElement(i.Ay,{disabled:c,type:W.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:Be,icon:o.createElement(d.A,null),onClick:async()=>{const t={...e,html:G.getValue()};try{!1!==await Ae.fire(t)&&ue("SAVE_BUTTON")}catch(l){j.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),l,!0)}}},W.saveButtonText||D("Save"))),xe=!1!==W.disableDoubleClickNextButton,we=!1===W.activeNextButton,Re=(0,o.useRef)(!1),Te=e=>{F((0,N.wj)(!e))},Ne=W.nextButtonEnabled&&o.createElement(i.Ay,{disabled:c||we,key:"next-button",type:"primary",block:"false",className:"em-analytics__email-save",icon:W.primaryCommandButtonIcon,loading:Be,onClick:async()=>{if(Re.current)return;Re.current=!0;const t={...e,html:G.getValue()};try{xe&&Te(!0),(await ve.fire(t)).every((e=>!1!==e))?ue(I):(Te(!1),Re.current=!1)}catch(l){j.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",(0,n.Gy)(t),l,!0),Te(!1),Re.current=!1}}},W.nextButtonText||D("Continue"));return o.createElement(o.Fragment,null,W.saveButtonEnabled&&W.nextButtonEnabled?o.createElement(r.A,null,[ke,Ne]):[ke,Ne])};F.defaultProps={email:null,isEditableRights:null};const O=F},11399:(e,t,l)=>{l.d(t,{A:()=>E});var o=l(98173),a=l(27499),i=l(50483),r=l(49856),n=l(13785),d=l(60994),m=l(2922),s=l(81149),c=l(12543),u=l(32947),p=l(8807),g=l(52919);const b=({form:e,elementSettings:t,imgParent:l,name:b="align",setAlignStateHandle:E=e=>{},withHotKeys:h=!0})=>{const{__:f}=(0,c.s9)(),v=(0,g.XW)(),[A,_]=(0,o.useState)(t[b]),[y,S]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&S(!0)}),[]);const B=l=>{const o=l.target.value;E(o);const a={[b]:""};o!==A?_(o):(_(""),e.setFieldsValue(a),v({operation:u.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(a.A.Item,{name:b},o.createElement(i.Ay.Group,{disabled:l&&!t.parent},o.createElement(r.A,{size:8},o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align left ( \u2318+Shift+L )":"Text align left ( Ctrl+Shift+L )":"Text align left")},o.createElement(i.Ay.Button,{value:"left",onClick:B},o.createElement(d.A,null))),o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align center ( \u2318+Shift+E )":"Text align center ( Ctrl+Shift+E )":"Text align center")},o.createElement(i.Ay.Button,{value:"center",onClick:B},o.createElement(m.A,null))),o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align right ( \u2318+Shift+R )":"Text align right ( Ctrl+Shift+R )":"Text align right")},o.createElement(i.Ay.Button,{value:"right",onClick:B},o.createElement(s.A,null))),o.createElement(n.A,{placement:"bottom",title:f(h?y?"Text align justify ( \u2318+Shift+J )":"Text align justify ( Ctrl+Shift+J )":"Text align justify")},o.createElement(i.Ay.Button,{value:"justify",onClick:B},o.createElement(p.A,{icon:"Justify"}))))))};b.defaultProps={imgParent:!1};const E=b},23863:(e,t,l)=>{l.d(t,{A:()=>R});var o=l(98173),a=l(40120),i=l(27499),r=l(201),n=l(66964),d=l(42490),m=l(50483),s=l(49856),c=l(13785),u=l(80320),p=l(17216),g=l(82984),b=l(85372),E=l(8239),h=l(91916),f=l(48947),v=l(51157),A=l(42734),_=l(85591),y=l.n(_),S=l(12543),B=l(2604),k=l(77637),x=l(1047);const{useToken:w}=a.A,R=({form:e,namePrefix:t="",typeOfForm:l="desktop"})=>{const{__:a,_x:_}=(0,S.s9)(),{token:R}=w(),T=(0,B.d4)(x.uJ),N="mobile"===l,I=N?"mobileBorderPosition":"borderPosition",P=i.A.useWatch(t+I,e),C=e.getFieldsValue(!0),L={borderAll:t+(N?"mobileBorderAll":"borderAll"),borderTop:t+(N?"mobileBorderTop":"borderTop"),borderBottom:t+(N?"mobileBorderBottom":"borderBottom"),borderRight:t+(N?"mobileBorderRight":"borderRight"),borderLeft:t+(N?"mobileBorderLeft":"borderLeft")},F=N?{mobileBorderAll:t+"mobileBorderAll",mobileBorderTop:t+"mobileBorderTop",mobileBorderBottom:t+"mobileBorderBottom",mobileBorderRight:t+"mobileBorderRight",mobileBorderLeft:t+"mobileBorderLeft"}:{borderAll:t+"borderAll",borderTop:t+"borderTop",borderBottom:t+"borderBottom",borderRight:t+"borderRight",borderLeft:t+"borderLeft"},O=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);return o.createElement(r.A,{gutter:30},o.createElement(n.A,{span:12,className:"selected-td-form__border-col"},o.createElement(i.A.Item,{name:[F[P],"color"],className:"form-item-margin-xs"},o.createElement(k.A,{placeholder:a("Color"),usedColors:T.usedColors})),o.createElement(i.A.Item,{name:[F[P],"width"],className:"form-item-margin-xs"},o.createElement(d.A,{min:0,placeholder:_("Width","border"),addonAfter:"px"})),o.createElement(i.A.Item,{name:[F[P],"style"],className:"form-item-margin-xs"},o.createElement(m.Ay.Group,null,o.createElement(s.A,{size:8},o.createElement(c.A,{placement:"bottom",title:a("None")},o.createElement(m.Ay.Button,{value:""},o.createElement(u.A,null))),o.createElement(c.A,{placement:"bottom",title:a("Solid")},o.createElement(m.Ay.Button,{value:"solid"},o.createElement(p.A,null))),o.createElement(c.A,{placement:"bottom",title:a("Dashed")},o.createElement(m.Ay.Button,{value:"dashed"},o.createElement(g.A,null))),o.createElement(c.A,{placement:"bottom",title:a("Dotted")},o.createElement(m.Ay.Button,{value:"dotted"},o.createElement(b.A,null))))))),o.createElement(n.A,{span:12,style:{textAlign:"center"}},o.createElement(i.A.Item,{label:"",name:I,labelCol:{span:8}},o.createElement(m.Ay.Group,null,o.createElement(s.A,{size:R.formItemMarginBottomXS,direction:"vertical"},o.createElement(r.A,null,o.createElement(c.A,{placement:"top",title:a("Above")},o.createElement(m.Ay.Button,{value:L.borderTop,style:{margin:"auto"},className:y()("",{"selected-td-form__border-radio":O(C[L.borderTop])})},o.createElement(E.A,null)))),o.createElement(r.A,null,o.createElement(s.A,{size:R.formItemMarginBottomXS},o.createElement(c.A,{placement:"left",title:a("On the left")},o.createElement(m.Ay.Button,{value:L.borderLeft,className:y()("",{"selected-td-form__border-radio":O(C[L.borderLeft])})},o.createElement(h.A,null))),o.createElement(c.A,{placement:"top",title:a("Around")},o.createElement(m.Ay.Button,{value:L.borderAll,className:y()("",{"selected-td-form__border-radio":O(C[L.borderAll])})},o.createElement(f.A,null))),o.createElement(c.A,{placement:"right",title:a("On the right")},o.createElement(m.Ay.Button,{value:L.borderRight,className:y()("",{"selected-td-form__border-radio":O(C[L.borderRight])})},o.createElement(v.A,null))))),o.createElement(r.A,null,o.createElement(c.A,{placement:"bottom",title:a("Below")},o.createElement(m.Ay.Button,{value:L.borderBottom,className:y()("",{"selected-td-form__border-radio":O(C[L.borderBottom])}),style:{margin:"auto"}},o.createElement(A.A,null)))))))))}},67151:(e,t,l)=>{l.d(t,{A:()=>_});var o=l(98173),a=l(201),i=l(66964),r=l(49856),n=l(27499),d=l(37969),m=l(13785),s=l(78469),c=l(31573),u=l(39672),p=l(70552),g=l(85591),b=l.n(g),E=l(12543),h=l(88647),f=l(80877),v=l(52919),A=l(32947);const _=({form:e,oneBorderRadiusValue:t,setOneBorderRadiusValue:l,elementSettings:g,namePrefix:_="",typeOfForm:y="desktop"})=>{const{__:S}=(0,E.s9)(),B=(0,v.XW)(),k="mobile"===y,x=k?"mobileBorderRadius":"borderRadius",w=k?"mobileBorderRadiusAll":"borderRadiusAll",R=k?"mobileBorderRadiusTopLeft":"borderRadiusTopLeft",T=k?"mobileBorderRadiusTopRight":"borderRadiusTopRight",N=k?"mobileBorderRadiusBottomRight":"borderRadiusBottomRight",I=k?"mobileBorderRadiusBottomLeft":"borderRadiusBottomLeft",P=k?A.NW:A.wF;return o.createElement(a.A,{gutter:10},o.createElement(i.A,{span:12},o.createElement(r.A,{size:10,align:"start"},o.createElement(n.A.Item,{name:_+[w]},o.createElement(f.A,{min:0,placeholder:S("Border radius"),prefix:o.createElement(h.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),o.createElement(i.A,{span:12},o.createElement(d.Ay,{className:b()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const o=e.getFieldsValue(!0);let a;if(t)e.setFieldsValue({[R]:o[w]||null,[I]:o[w]||null,[T]:o[w]||null,[N]:o[w]||null}),a={[x]:{[P[R]]:o[w]||0,[P[I]]:o[w]||0,[P[T]]:o[w]||0,[P[N]]:o[w]||0}};else{const t=o[R]===o[I]&&o[R]===o[T]&&o[R]===o[N];t?(e.setFieldsValue({[w]:t?o[R]:null}),a={[x]:{[P[w]]:o[R]}}):(e.setFieldsValue({[R]:null,[I]:null,[T]:null,[N]:null}),a={[x]:{[P[w]]:0,[P[R]]:0,[P[I]]:0,[P[T]]:0,[P[N]]:0}})}let i=k?{mobileBorderRadius:{all:o.mobileBorderRadiusAll||null,classNamePrefix:"em-mob-border_radius_all-"}}:{[x]:{...g[x],...a[x]}};B({operation:A.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:g.type,settings:i}),l((e=>!e))}},o.createElement(h.h,{className:"selected-td-form__icon-radius"}))),o.createElement(i.A,null,o.createElement(a.A,{gutter:10,style:{marginTop:-10}},o.createElement(i.A,{span:12},o.createElement(m.A,{placement:"bottom",title:S("Top left corner")},o.createElement(n.A.Item,{hidden:t,name:_+[R],className:"form-item-margin-xs"},o.createElement(f.A,{min:0,prefix:o.createElement(s.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(m.A,{placement:"bottom",title:S("Bottom left corner")},o.createElement(n.A.Item,{hidden:t,name:_+[I]},o.createElement(f.A,{min:0,prefix:o.createElement(c.A,null),style:{minHeight:10},addonAfter:"px"})))),o.createElement(i.A,{span:12},o.createElement(m.A,{placement:"bottom",title:S("Top right corner")},o.createElement(n.A.Item,{hidden:t,name:_+[T],className:"form-item-margin-xs"},o.createElement(f.A,{min:0,prefix:o.createElement(u.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(m.A,{placement:"bottom",title:S("Bottom right corner")},o.createElement(n.A.Item,{hidden:t,name:_+[N]},o.createElement(f.A,{min:0,prefix:o.createElement(p.A,null),style:{minHeight:10},addonAfter:"px"})))))))}},37133:(e,t,l)=>{l.d(t,{A:()=>u});var o=l(98173),a=l(27499),i=l(50483),r=l(49856),n=l(13785),d=l(12543),m=l(8807),s=l(32947),c=l(52919);const u=({form:e,elementSettings:t,tooltipTitle:l,disabled:u=!1})=>{const{__:p}=(0,d.s9)(),g=(0,c.XW)(),[b,E]=(0,o.useState)(t.valign),h=l=>{const o=l.target.value,a={valign:""};o!==b?E(o):(E(""),e.setFieldsValue(a),g({operation:s.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(a.A.Item,{name:"valign"},o.createElement(i.Ay.Group,{disabled:u},o.createElement(r.A,{size:8},o.createElement(n.A,{placement:"bottom",title:p("Align top")},o.createElement(i.Ay.Button,{value:"top",onClick:h},o.createElement(m.A,{icon:"AlignVerticalTop"}))),o.createElement(n.A,{placement:"bottom",title:p("Center vertically")},o.createElement(i.Ay.Button,{value:"middle",onClick:h},o.createElement(m.A,{icon:"AlignVerticalCenter"}))),o.createElement(n.A,{placement:"bottom",title:p("Align bottom")},o.createElement(i.Ay.Button,{value:"bottom",onClick:h},o.createElement(m.A,{icon:"AlignVerticalBottom"}))))))}},24075:(e,t,l)=>{l.d(t,{A:()=>d});var o=l(98173),a=l(85591),i=l.n(a),r=l(27805);l(47827);const n=({className:e,selectedElement:t,formSettings:l,emailElementType:a})=>o.createElement("div",{className:i()("selected-element-panel",{[e]:e}),style:{height:"100%"}},o.createElement(r.A,{className:i()("selected-element-panel__content SelectedElementPanel",{"column-settings-show":!!t.floatBlocks&&t.floatBlocks.items.length>1}),emailElementType:a,formSettings:l}));n.defaultProps={className:null,selectedElement:{parent:!1}};const d=n},27805:(e,t,l)=>{l.d(t,{A:()=>gl});var o=l(98173),a=l(84893),i=l(85591),r=l.n(i),n=l(2604),d=l(1047),m=l(22536),s=l(62272),c=l(40120),u=l(27499),p=l(13785),g=l(99291),b=l(201),E=l(66964),h=l(94674),f=l(37969),v=l(73114),A=l(49856),_=l(8218),y=l(48300),S=l(5795),B=l(54855),k=l(74984),x=l(72218),w=l(8122),R=l(86956),T=l.n(R),N=l(55207),I=l(23863),P=l(67151),C=l(50483),L=l(12543),F=l(8807),O=l(32947),D=l(52919);const M=({form:e,elementSettings:t,imgParent:l,name:a="align"})=>{const{__:i}=(0,L.s9)(),r=(0,D.XW)(),[n,d]=(0,o.useState)(t[a]),m=l=>{const o=l.target.value,i={[a]:""};o!==n?d(o):(d(""),e.setFieldsValue(i),r({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return o.createElement(u.A.Item,{name:a},o.createElement(C.Ay.Group,{disabled:l&&!t.parent},o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:i("Align left")},o.createElement(C.Ay.Button,{value:"left",onClick:m},o.createElement(F.A,{icon:"AlignHorizontalLeft"}))),o.createElement(p.A,{placement:"bottom",title:i("Center horizontally")},o.createElement(C.Ay.Button,{value:"center",onClick:m},o.createElement(F.A,{icon:"AlignHorizontalCenter"}))),o.createElement(p.A,{placement:"bottom",title:i("Align right ")},o.createElement(C.Ay.Button,{value:"right",onClick:m},o.createElement(F.A,{icon:"AlignHorizontalRight"}))))))};M.defaultProps={imgParent:!1};const V=M;var z=l(37133),H=l(62913),j=l(33365),W=l(80877),G=l(77637);const U=({typeOfForm:e="desktop"})=>{const{__:t}=(0,L.s9)(),l=(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 o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Horizontal offset")},o.createElement(u.A.Item,{name:i,className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:t("Horizontal offset"),prefix:o.createElement(j.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Vertical offset")},o.createElement(u.A.Item,{name:r,className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:t("Vertical offset"),prefix:o.createElement(F.A,{icon:"VerticalOffset"}),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Blur radius")},o.createElement(u.A.Item,{name:m,className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:t("Blur radius"),prefix:o.createElement(F.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:t("Spread radius")},o.createElement(u.A.Item,{name:s,className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:t("Spread radius"),prefix:o.createElement(F.A,{icon:"ZoomOutMap"}),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"start"},o.createElement(u.A.Item,{name:c},o.createElement(G.A,{usedColors:l.usedColors})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},o.createElement(u.A.Item,{name:g,valuePropName:"value"},o.createElement(H.A,{style:{width:"100%"},options:[{label:t("Outside"),value:!1},{label:t("Inside"),value:!0}]}))))))};var X=l(49823),q=l(29123);const{Option:$}=X.A,Y=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement($,{value:"px"},"px"),o.createElement($,{value:"%"},"%")),{useToken:K}=c.A,Q=({form:e,name:t,elementSettings:l,isPicture:a})=>{var i;const{__:r}=(0,L.s9)(),n=(0,D.XW)(),d=(0,o.useRef)(),m=(0,o.useRef)(),[s,c]=(0,o.useState)("auto"===(null===(i=l[t])||void 0===i?void 0:i.value)),{token:p}=K(),[g,b]=(0,o.useState)("");return o.createElement(o.Fragment,null,o.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},o.createElement(W.A,{ref:d,min:0,max:g,placeholder:r("Width"),onChange:l=>{c(!1),b("%"===e.getFieldsValue(!0)[t+"Dim"]?100:"")},prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:t+"Dim",noStyle:!0},Y)})),!a&&o.createElement(A.A,{size:8,align:"end"},o.createElement(q.A,{ref:m,size:"small",checked:s,onChange:o=>{d.current.value=null,e.setFieldsValue({[t]:"",[t+"Dim"]:"px"}),c((e=>!e)),n({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{[t]:{classNamePrefix:"em-mob-width-",value:s?null:"auto",dim:""}}})},id:"auto-width"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"auto-width"},r("Auto")))))},{useToken:J}=c.A,Z=({form:e,name:t,elementSettings:l,isPicture:a})=>{var i;const{__:r}=(0,L.s9)(),n=(0,D.XW)(),d=(0,o.useRef)(),m=(0,o.useRef)(),[s,c]=(0,o.useState)("auto"===(null===(i=l.mobileHeight)||void 0===i?void 0:i.value)),{token:p}=J();return o.createElement(o.Fragment,null,o.createElement(u.A.Item,{name:t,style:{marginBottom:p.formItemMarginBottomXS/2}},o.createElement(W.A,{ref:d,min:0,placeholder:r("Height"),onChange:e=>{c(!1)},prefix:o.createElement(B.A,null),addonAfter:"px"})),!a&&o.createElement(A.A,{size:8,align:"end"},o.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:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:l.type,settings:{mobileHeight:{classNamePrefix:"em-mob-height-",value:s?null:"auto",dim:""}}})},id:"auto-height"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"auto-height"},r("Auto")))))};var ee=l(42490),te=l(80320),le=l(17216),oe=l(82984),ae=l(85372),ie=l(8239),re=l(91916),ne=l(48947),de=l(51157),me=l(42734);const{useToken:se}=c.A,ce=({mobileBorders:e})=>{const{__:t}=(0,L.s9)(),l=(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 o.createElement(b.A,{gutter:30},o.createElement(E.A,{span:12,className:"selected-td-form__border-col"},o.createElement(u.A.Item,{name:"mobileBorderColor",className:"form-item-margin-xs"},o.createElement(G.A,{usedColors:l.usedColors})),o.createElement(u.A.Item,{name:"mobileBorderWidth",className:"form-item-margin-xs"},o.createElement(ee.A,{min:0,placeholder:t("Border width"),addonAfter:"px"})),o.createElement(u.A.Item,{name:"mobileBorderStyle",className:"form-item-margin-xs"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:t("None")},o.createElement(C.Ay.Button,{value:""},o.createElement(te.A,null))),o.createElement(p.A,{placement:"bottom",title:t("Solid")},o.createElement(C.Ay.Button,{value:"solid"},o.createElement(le.A,null))),o.createElement(p.A,{placement:"bottom",title:t("Dashed")},o.createElement(C.Ay.Button,{value:"dashed"},o.createElement(oe.A,null))),o.createElement(p.A,{placement:"bottom",title:t("Dotted")},o.createElement(C.Ay.Button,{value:"dotted"},o.createElement(ae.A,null))))))),o.createElement(E.A,{span:12,style:{textAlign:"center"}},o.createElement(u.A.Item,{label:"",name:"mobileBorderPosition",labelCol:{span:8}},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:i.formItemMarginBottomXS,direction:"vertical"},o.createElement(b.A,null,o.createElement(p.A,{placement:"top",title:t("Above")},o.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)})},o.createElement(ie.A,null)))),o.createElement(b.A,null,o.createElement(A.A,{size:i.formItemMarginBottomXS},o.createElement(p.A,{placement:"left",title:t("On the left")},o.createElement(C.Ay.Button,{value:"left",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.left)})},o.createElement(re.A,null))),o.createElement(p.A,{placement:"top",title:t("Around")},o.createElement(C.Ay.Button,{value:"all",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.all)})},o.createElement(ne.A,null))),o.createElement(p.A,{placement:"right",title:t("On the right")},o.createElement(C.Ay.Button,{value:"right",className:r()("",{"selected-td-form__border-radio":a(null===e||void 0===e?void 0:e.right)})},o.createElement(de.A,null))))),o.createElement(b.A,null,o.createElement(p.A,{placement:"bottom",title:t("Below")},o.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"}},o.createElement(me.A,null)))))))))},ue=({form:e,elementSettings:t,imgParent:l,name:a="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,d]=(0,o.useState)(null===(i=t[a])||void 0===i?void 0:i.value),m=(0,D.XW)(),s=l=>{const o=l.target.value,i={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};o!==n?d(o):(d(""),e.setFieldsValue(i),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return o.createElement(u.A.Item,{name:a},o.createElement(C.Ay.Group,{disabled:l&&!t.parent},o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:r("Align left")},o.createElement(C.Ay.Button,{value:"left",onClick:s},o.createElement(F.A,{icon:"AlignHorizontalLeft"}))),o.createElement(p.A,{placement:"bottom",title:r("Center horizontally")},o.createElement(C.Ay.Button,{value:"center",onClick:s},o.createElement(F.A,{icon:"AlignHorizontalCenter"}))),o.createElement(p.A,{placement:"bottom",title:r("Align right ")},o.createElement(C.Ay.Button,{value:"right",onClick:s},o.createElement(F.A,{icon:"AlignHorizontalRight"}))))))};ue.defaultProps={imgParent:!1};const pe=ue,ge=({form:e,elementSettings:t,tooltipTitle:l})=>{var a;const{__:i}=(0,L.s9)(),[r,n]=(0,o.useState)(null===(a=t.mobileVerticalAlign)||void 0===a?void 0:a.value),d=(0,D.XW)(),m=l=>{const o=l.target.value,a={mobileVerticalAlign:{classNamePrefix:"em-mob-vertical_align",value:""}};o!==r?n(o):(n(""),e.setFieldsValue(a),d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(u.A.Item,{name:"mobileVerticalAlign"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:i("Align top")},o.createElement(C.Ay.Button,{value:"top",onClick:m},o.createElement(F.A,{icon:"AlignVerticalTop"}))),o.createElement(p.A,{placement:"bottom",title:i("Center vertically")},o.createElement(C.Ay.Button,{value:"middle",onClick:m},o.createElement(F.A,{icon:"AlignVerticalCenter"}))),o.createElement(p.A,{placement:"bottom",title:i("Align bottom")},o.createElement(C.Ay.Button,{value:"bottom",onClick:m},o.createElement(F.A,{icon:"AlignVerticalBottom"}))))))};var be=l(7333),Ee=l(83799);const he=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)();return o.createElement(u.A.Item,{name:"show"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(C.Ay.Button,{value:"all"},l("Both")),o.createElement(p.A,{placement:"top",title:l("Desktop")},o.createElement(C.Ay.Button,{value:"desktop"},o.createElement(be.A,null))),o.createElement(p.A,{placement:"top",title:l("Mobile")},o.createElement(C.Ay.Button,{value:"mobile"},o.createElement(Ee.A,null))))))};he.defaultProps={};const fe=he;var ve=l(57140),Ae=l(46409),_e=l(67073),ye=l(20721);const{useToken:Se}=c.A,Be=({form:e,elementSettings:t,handleChangeValues:l})=>{const{__:a}=(0,L.s9)(),i=(0,o.useRef)(),{token:n}=Se(),[d,m]=(0,o.useState)(!1),[s,c]=(0,o.useState)(!1),[g,h]=(0,o.useState)(!1),[v,_]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!1);(0,o.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 B=[{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")}],k=[{value:"20",label:a("20 s")},{value:"40",label:a("40 s")},{value:"60",label:a("60 s")}],x=[{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"}],w=e=>{var t;e.target.closest(".ant-picker-dropdown")||(null===(t=i.current)||void 0===t||t.blur())};(0,o.useEffect)((()=>(window.addEventListener("scroll",w,!0),()=>{window.removeEventListener("scroll",w,!0)})));return o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("End time"),name:"countdownTime"},o.createElement(ve.A,{ref:i,format:"DD.MM.YYYY HH:mm",disabledDate:e=>e&&e<T()().endOf("day")-864e5,showTime:!0,getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),allowClear:!1,allowEmpty:!1}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Time zone"),name:"countdownTimeZone",style:{width:"100%"}},o.createElement(X.A,{placeholder:a("Select the time zone"),getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},B.map((e=>o.createElement(X.A.Option,{key:e.value,value:e.value},e.label))))))),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Background color"),name:"countdownBackgroundColor",className:"countdown-color"},o.createElement(G.A,{placeholder:a("Background color"),usedColors:t.usedColors}))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"baseline",style:{paddingTop:29}},o.createElement(u.A.Item,{name:"countdownTransparency",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"countdownTransparency",onChange:e=>{S(e)}})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"countdownTransparency"},a("Transparency")))))),o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Countdown font settings")),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownNumbersFont",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:x}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownNumbersColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(G.A,{usedColors:t.usedColors}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownNumbersFontSize"},o.createElement(ee.A,{min:12,placeholder:a("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"}))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Strong")},o.createElement(u.A.Item,{name:"countdownNumbersStrong"},o.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),l({countdownNumbersStrong:t}),m(t)}},o.createElement(_e.A,{className:"selected-td-form__icon-radius"}))))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Italic")},o.createElement(u.A.Item,{name:"countdownNumbersItalic"},o.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),l({countdownNumbersItalic:t}),c(t)}},o.createElement(ye.A,{className:"selected-td-form__icon-radius"})))))),o.createElement("div",{className:"form-group-title",style:{paddingTop:0,paddingBottom:8}},a("Time units font settings")),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownLabelsFont",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:x}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownLabelsColor",className:"countdown-color",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(G.A,{usedColors:t.usedColors}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"countdownLabelsFontSize"},o.createElement(ee.A,{min:8,placeholder:a("Font size"),addonAfter:"px",prefix:o.createElement(Ae.A,null)}))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Strong")},o.createElement(u.A.Item,{name:"countdownLabelsStrong"},o.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),l({countdownLabelsStrong:t}),h(t)}},o.createElement(_e.A,{className:"selected-td-form__icon-radius"}))))),o.createElement(E.A,{span:3},o.createElement(p.A,{placement:"bottom",title:a("Italic")},o.createElement(u.A.Item,{name:"countdownLabelsItalic"},o.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),l({countdownLabelsItalic:t}),_(t)}},o.createElement(ye.A,{className:"selected-td-form__icon-radius"})))))),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Language"),name:"countdownLanguage",style:{width:"100%"}},o.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"}]}))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{label:a("Duration"),name:"countdownDuration",style:{width:"100%"}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel"),options:k})))))};var ke=l(9593),xe=l(30245),we=l(29312),Re=l(53056);const{useToken:Te}=c.A,Ne=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)(),{token:a}=Te();return o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:l("URL of the video clip."),placement:"right"},o.createElement(u.A.Item,{name:["video","source"],className:"selected-image-form__alt"},o.createElement(_.A,{allowClear:!0,placeholder:l("Video URL"),prefix:o.createElement(ke.A,null)}))),o.createElement(u.A.Item,{label:l("Play button"),name:["video","playButton"],style:{width:"100%",marginBottom:a.formItemMarginBottomMD+4}},o.createElement(X.A,{getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")},o.createElement(X.A.Option,{value:"youtube_red"},o.createElement(xe.A,{style:{color:"#FF0000"}})," ",l("Youtube Red")),o.createElement(X.A.Option,{value:"youtube_black"},o.createElement(xe.A,null)," ",l("Youtube Black")),o.createElement(X.A.Option,{value:"youtube_white"},o.createElement(xe.A,{style:{color:"#aaa"}})," ",l("Youtube White")),o.createElement(X.A.Option,{value:"vimeo"},o.createElement(F.A,{icon:"Vimeo"})," ",l("Vimeo")),o.createElement(X.A.Option,{value:"white_circle"},o.createElement(we.A,{style:{color:"#aaa"}})," ",l("White circle")),o.createElement(X.A.Option,{value:"black_circle"},o.createElement(we.A,null)," ",l("Black circle")),o.createElement(X.A.Option,{value:"white_circle_outlined"},o.createElement(Re.A,{style:{color:"#aaa"}})," ",l("White circle outlined")),o.createElement(X.A.Option,{value:"black_circle_outlined"},o.createElement(Re.A,null)," ",l("Black circle outlined")),o.createElement(X.A.Option,{value:"none"}," ",l("Without button")))))},Ie=()=>{const{__:e}=(0,L.s9)();return o.createElement(u.A.Item,{name:"ampShow"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(C.Ay.Button,{value:"all"},e("Both")),o.createElement(p.A,{placement:"top",title:e("AMP")},o.createElement(C.Ay.Button,{value:"amp"},"AMP")),o.createElement(p.A,{placement:"top",title:e("HTML")},o.createElement(C.Ay.Button,{value:"html"},"HTML")))))};Ie.defaultProps={};const Pe=Ie;var Ce=l(62093),Le=l(40835),Fe=l(23424),Oe=l(54838),De=l(47014),Me=l(80772),Ve=l(27941),ze=l(64909),He=l(40277),je=l(99512),We=l(16390);l(47827);const{useToken:Ge}=c.A,Ue=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:l}=Ge(),[a]=u.A.useForm();let i=(0,n.wA)();const c=(0,Ve.rD)(),{projectId:R}=(0,s.g)(),C=(0,ze.hN)(),M=(0,n.d4)(d.Hs),H=(0,D.XW)(),j=(0,D.K9)(),G=(0,n.d4)(Oe.Ct),X=(0,n.d4)(Oe.CS),q=(0,n.d4)(De.C1),$=(0,n.d4)(Oe.Fv),Y=(0,n.d4)(Oe.yy),[K]=(0,Le.dS)(),[J,ee]=(0,Le.tb)(),te=(0,o.useRef)(null),le=(0,o.useRef)(null),oe=(0,o.useRef)(null),ae=(0,o.useRef)(null),ie=(0,o.useRef)(null),re=(0,o.useRef)(null),ne=(0,o.useRef)(null),de=(0,o.useRef)(null),me=(0,o.useRef)(null),[se,ce]=(0,o.useState)({}),[ue,be]=(0,o.useState)(!0),[Ee,he]=(0,o.useState)(!0),[ve,Ae]=(0,o.useState)(""),[_e,ye]=(0,o.useState)(""),[Se,ke]=(0,o.useState)(""),[xe,we]=(0,o.useState)(!1),[Re,Te]=(0,o.useState)(!1),[Ie,Ue]=(0,o.useState)(!1),[Xe,qe]=(0,o.useState)(!1),[$e,Ye]=(0,o.useState)(!1),[Ke,Qe]=(0,o.useState)(!1),[Je,Ze]=(0,o.useState)(!1),[et,tt]=(0,o.useState)(!1),[lt,ot]=(0,o.useState)("https://"),[at,it]=(0,o.useState)(),[rt,nt]=(0,o.useState)(!1),[dt,mt]=(0,o.useState)(null),[st,ct]=(0,o.useState)({start:0,end:0}),[ut,pt]=(0,o.useState)(!1),[gt,bt]=(0,o.useState)(!1),Et=$&&"bottom"!==Y,ht=M.hasOwnProperty("type")?O.IE:O.Tm;(0,o.useEffect)((()=>{rt&&me.current&&me.current.focus()}),[rt]);const ft=(0,n.d4)(We.GH);(0,o.useEffect)((()=>{var e;null!==ft&&void 0!==ft&&null!==(e=ft.items)&&void 0!==e&&e.length&&it((0,Ve.cM)(ft.items,t,((e,t)=>{nt(!1),j(O.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[ft,it,t,nt,j]);(0,o.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||mt(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||nt(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.addEventListener("click",t)}}),[]);const vt=({target:e})=>{if(e&&!ut){const{selectionStart:t,selectionEnd:l}=e;ct({start:t,end:l})}pt(!1)},At=e.border,_t=e.mobileBorder,yt=Object.keys(At).find((e=>{var t,l,o;return(null===(t=At[e])||void 0===t?void 0:t.width)||(null===(l=At[e])||void 0===l?void 0:l.style)||(null===(o=At[e])||void 0===o?void 0:o.color)})),St=Object.keys(_t).find((e=>{var t,l,o;return(null===(t=_t[e])||void 0===t?void 0:t.width)||(null===(l=_t[e])||void 0===l?void 0:l.style)||(null===(o=_t[e])||void 0===o?void 0:o.color)})),Bt=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,i,r,n,d,m,s,c,u,p,g,b,E,h,f,v,A,_,y,S,B,k,x,w,R,N,I,P,C,L,F,O,D,M,V,z,H,j,W,G,U,X,q,$,Y,K,Q,J,Z;const ee=e.boxShadow;if(ce(ee),e.link&&ot((0,je.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===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.value,heightDim:null===(i=e.height)||void 0===i?void 0:i.dim,borderAll:(0,je.ok)(e.border.all),borderTop:(0,je.ok)(e.border.top),borderBottom:(0,je.ok)(e.border.bottom),borderRight:(0,je.ok)(e.border.right),borderLeft:(0,je.ok)(e.border.left),mobileBorderAll:Bt(e.mobileBorder.all)||!(Bt(e.mobileBorder.top)||Bt(e.mobileBorder.bottom)||Bt(e.mobileBorder.right)||Bt(e.mobileBorder.left))&&Bt(e.border.all),mobileBorderTop:Bt(e.mobileBorder.top)||!Bt(e.mobileBorder.all)&&Bt(e.border.top),mobileBorderBottom:Bt(e.mobileBorder.bottom)||!Bt(e.mobileBorder.all)&&Bt(e.border.bottom),mobileBorderRight:Bt(e.mobileBorder.right)||!Bt(e.mobileBorder.all)&&Bt(e.border.right),mobileBorderLeft:Bt(e.mobileBorder.left)||!Bt(e.mobileBorder.all)&&Bt(e.border.left),borderRadiusAll:(0,je.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,je.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,je.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,je.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,je.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,je.ok)(null===(r=e.boxShadow)||void 0===r?void 0:r.inset)||!1,boxShadowHOffset:(0,je.ok)(null===(n=e.boxShadow)||void 0===n?void 0:n.hOffset),boxShadowVOffset:(0,je.ok)(null===(d=e.boxShadow)||void 0===d?void 0:d.vOffset),boxShadowBlurRadius:(0,je.ok)(null===(m=e.boxShadow)||void 0===m?void 0:m.blurRadius),boxShadowSpreadRadius:(0,je.ok)(null===(s=e.boxShadow)||void 0===s?void 0:s.spreadRadius),boxShadowColor:(0,je.ok)(null===(c=e.boxShadow)||void 0===c?void 0:c.color),mobileWidth:(0,je.xc)(null===(u=e.mobileWidth)||void 0===u?void 0:u.value)||(null===(p=e.width)||void 0===p?void 0:p.value),mobileWidthDim:(0,je.xc)(null===(g=e.mobileWidth)||void 0===g?void 0:g.value)?null===(b=e.mobileWidth)||void 0===b?void 0:b.dim:null===(E=e.width)||void 0===E?void 0:E.dim,mobileHeight:(0,je.xc)(null===(h=e.mobileHeight)||void 0===h?void 0:h.value)||(null===(f=e.height)||void 0===f?void 0:f.value),mobileHeightDim:(0,je.xc)(null===(v=e.mobileHeight)||void 0===v?void 0:v.value)?null===(A=e.mobileHeight)||void 0===A?void 0:A.dim:null===(_=e.height)||void 0===_?void 0:_.dim,mobileBorderRadiusAll:(0,je.ok)(e.mobileBorderRadius.all)||(0,je.ok)(e.borderRadius.all),mobileBorderRadiusTopLeft:(0,je.ok)(null===(y=e.mobileBorderRadius)||void 0===y?void 0:y.topLeft)||(0,je.ok)(null===(S=e.mobileBorderRadius)||void 0===S?void 0:S.all)||(0,je.ok)(null===(B=e.borderRadius)||void 0===B?void 0:B.topLeft)||(0,je.ok)(null===(k=e.borderRadius)||void 0===k?void 0:k.all),mobileBorderRadiusBottomLeft:(0,je.ok)(null===(x=e.mobileBorderRadius)||void 0===x?void 0:x.bottomLeft)||(0,je.ok)(null===(w=e.mobileBorderRadius)||void 0===w?void 0:w.all)||(0,je.ok)(null===(R=e.borderRadius)||void 0===R?void 0:R.bottomLeft)||(0,je.ok)(null===(N=e.borderRadius)||void 0===N?void 0:N.all),mobileBorderRadiusTopRight:(0,je.ok)(null===(I=e.mobileBorderRadius)||void 0===I?void 0:I.topRight)||(0,je.ok)(null===(P=e.mobileBorderRadius)||void 0===P?void 0:P.all)||(0,je.ok)(null===(C=e.borderRadius)||void 0===C?void 0:C.topRight)||(0,je.ok)(null===(L=e.borderRadius)||void 0===L?void 0:L.all),mobileBorderRadiusBottomRight:(0,je.ok)(null===(F=e.mobileBorderRadius)||void 0===F?void 0:F.bottomRight)||(0,je.ok)(null===(O=e.mobileBorderRadius)||void 0===O?void 0:O.all)||(0,je.ok)(null===(D=e.borderRadius)||void 0===D?void 0:D.bottomRight)||(0,je.ok)(null===(M=e.borderRadius)||void 0===M?void 0:M.all),mobileBoxShadowInset:null!=(null===(V=e.mobileBoxShadow)||void 0===V?void 0:V.inset)?e.mobileBoxShadow.inset:(null===(z=e.boxShadow)||void 0===z?void 0:z.inset)||!1,mobileBoxShadowHOffset:(0,je.ok)(null===(H=e.mobileBoxShadow)||void 0===H?void 0:H.hOffset)||(0,je.ok)(null===(j=e.boxShadow)||void 0===j?void 0:j.hOffset),mobileBoxShadowVOffset:(0,je.ok)(null===(W=e.mobileBoxShadow)||void 0===W?void 0:W.vOffset)||(0,je.ok)(null===(G=e.boxShadow)||void 0===G?void 0:G.vOffset),mobileBoxShadowBlurRadius:(0,je.ok)(null===(U=e.mobileBoxShadow)||void 0===U?void 0:U.blurRadius)||(0,je.ok)(null===(X=e.boxShadow)||void 0===X?void 0:X.blurRadius),mobileBoxShadowSpreadRadius:(0,je.ok)(null===(q=e.mobileBoxShadow)||void 0===q?void 0:q.spreadRadius)||(0,je.ok)(null===($=e.boxShadow)||void 0===$?void 0:$.spreadRadius),mobileBoxShadowColor:(0,je.ok)((null===(Y=e.mobileBoxShadow)||void 0===Y?void 0:Y.color)||(null===(K=e.boxShadow)||void 0===K?void 0:K.color)),mobileAlign:(0,je.ok)(null===(Q=e.mobileAlign)||void 0===Q?void 0:Q.value)||e.align,mobileVerticalAlign:(0,je.ok)((null===(J=e.mobileVerticalAlign)||void 0===J?void 0:J.value)||e.valign),show:e.show?e.show:"all",altSrc:e.src}),e.countdown){let t=new URL("https://emailmaker.ru/?"+e.countdown),l=t.searchParams.get("font1"),o=!1,i=!1;l.endsWith("-b")?(l=l.substring(0,l.length-2),o=!0):l.endsWith("-i")?(l=l.substring(0,l.length-2),i=!0):l.endsWith("-bi")&&(l=l.substring(0,l.length-3),o=!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:T()(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:l,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:o,countdownNumbersItalic:i,countdownLabelsStrong:n,countdownLabelsItalic:d})}!(0,je.ok)(e.borderRadius.all)&&((0,je.ok)(e.borderRadius.topLeft)||(0,je.ok)(e.borderRadius.bottomLeft)||(0,je.ok)(e.borderRadius.topRight)||(0,je.ok)(e.borderRadius.bottomRight))?be(!1):be(!0),!(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight))||(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight))||!(0,je.ok)(e.borderRadius.all)&&!(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.borderRadius.topLeft)||(0,je.ok)(e.borderRadius.bottomLeft)||(0,je.ok)(e.borderRadius.topRight)||(0,je.ok)(e.borderRadius.bottomRight))?he(!1):he(!0),we(!!yt),Te(!!yt||!!St),Ue(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),qe(!!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),Qe(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),Ze(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value||!!e.height.value),Ae(e.link),ye(e.alt),ke(e.title),bt(null===(Z=e.imgReplacer)||void 0===Z?void 0:Z.length)}}),[a,e]);const kt=async(e,t,l)=>{const o={};o.user_id=q.id,o.folder=e,t&&("image/gif"!==t.type&&(t=await(0,w.A)(t,{maxSizeMB:c.compressMaxSize||.45,maxWidthOrHeight:c.compressMaxWidthOrHeight||2e3})),o.file=t),l&&(o.page_url=l);const a=await K(o);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},xt=((e,t)=>{let l;return function(...o){clearTimeout(l),l=setTimeout((()=>{clearTimeout(l),e(...o)}),t)}})((()=>{const t=a.getFieldsValue(!0);let l=new URL("https://cdt3.emcdn.ru/rndt?"+e.countdown),o=t.countdownNumbersFont;t.countdownNumbersStrong&&t.countdownNumbersItalic?o+="-bi":t.countdownNumbersStrong?o+="-b":t.countdownNumbersItalic&&(o+="-i");let i=t.countdownLabelsFont;t.countdownLabelsStrong&&t.countdownLabelsItalic?i+="-bi":t.countdownLabelsStrong?i+="-b":t.countdownLabelsItalic&&(i+="-i"),l.searchParams.set("time",new Date(t.countdownTime.$d-36e5*t.countdownTimeZone-(new Date).getTimezoneOffset()/60*36e5).toISOString()),l.searchParams.set("bg",t.countdownBackgroundColor.substring(1)||"#FFFFFF"),l.searchParams.set("tp",!!t.countdownTransparency),l.searchParams.set("font1",o),l.searchParams.set("size1",2*t.countdownNumbersFontSize||12),l.searchParams.set("color1",t.countdownNumbersColor.substring(1)||"#000000"),l.searchParams.set("font2",i),l.searchParams.set("size2",2*t.countdownLabelsFontSize||8),l.searchParams.set("color2",t.countdownLabelsColor.substring(1)||"#959595"),l.searchParams.set("spacing",Math.round(.4*t.countdownNumbersFontSize)||5),l.searchParams.set("locale",t.countdownLanguage.replace("_","-")),l.searchParams.set("timezone",t.countdownTimeZone),l.searchParams.set("frames",t.countdownDuration),J({link:JSON.stringify({target:l.href})}),tt(!0)}),500),wt=(0,o.useCallback)((e=>{i(ht===O.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[i,ht]),Rt=(t,...l)=>{const o=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:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var d,m,s;if("borderAll"===o.borderPosition)n={border:{...O.iV,all:{...je.RH,...o.borderAll}}},a.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(d=o.borderAll)&&void 0!==d&&d.width||null!==(m=o.borderAll)&&void 0!==m&&m.style||null!==(s=o.borderAll)&&void 0!==s&&s.color?(n={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[je.Vz[r]]:{...o[r],...t[r]}}},a.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[r]:{...o[r],...t[r]}})):(n={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[je.Vz[r]]:{...o[r],...t[r]}}},a.setFieldsValue({border:n.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var u,p,g;if("mobileBorderAll"===o.mobileBorderPosition)n={mobileBorder:{...O.iV,all:{...je.RH,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+je.ax[r]+"-"}}},a.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(u=o.mobileBorder.all)&&void 0!==u&&u.width||null!==(p=o.mobileBorder.all)&&void 0!==p&&p.style||null!==(g=o.mobileBorder.all)&&void 0!==g&&g.color?(n={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[je.ax[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+je.ax[r]+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[r]:{...o[r],...t[r]}})):(n={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[je.ax[r]]:{...o[r],...t[r],classNamePrefix:"em-mob-border_"+je.ax[r]+"-"}}},a.setFieldsValue({mobileBorder:n.mobileBorder}));break;case"width":n={[r]:{value:t[r],dim:o.widthDim}};break;case"widthDim":n={width:{value:o.width,dim:t[r]}};break;case"height":n={[r]:{value:t[r],dim:o.heightDim}};break;case"heightDim":n={height:{value:o.height,dim:t[r]}};break;case"borderRadiusAll":n={borderRadius:{[O.wF[r]]:+t[r]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":n={borderRadius:{topLeft:o.borderRadiusTopLeft,bottomLeft:o.borderRadiusBottomLeft,topRight:o.borderRadiusTopRight,bottomRight:o.borderRadiusBottomRight,[O.wF[r]]:+t[r]}};break;case"mobileWidth":n={[r]:{classNamePrefix:"em-mob-width-",value:t[r],dim:o.mobileWidthDim}};break;case"mobileWidthDim":n={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[r]}};break;case"mobileHeight":n={[r]:{classNamePrefix:"em-mob-height-",value:t[r],dim:o.mobileHeightDim}};break;case"mobileHeightDim":n={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[r]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":n={mobileBorderRadius:{[je.NW[r]]:t[r],classNamePrefix:"em-mob-border_radius_"+je.NW[r]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":n={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":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":xt();break;case"video":(async()=>{const e=a.getFieldsValue(!0);e.video.source&&kt("tmp",null,e.video.source).then((t=>{var l=document.createElement("canvas"),o=l.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(){o.clearRect(0,0,l.width,l.height),o.drawImage(a,0,0,l.width,l.height),m=!0},a.src=n,r.onload=function(){var e=l.width/2-r.width/2,t=l.height/2-r.height/2;o.drawImage(r,e,t,r.width,r.height),s=!0},r.src=d;let u=setInterval((function(){if(m&&s){l.width=Math.max(a.width,r.width),l.height=Math.max(a.height,r.height),o.clearRect(0,0,l.width,l.height),o.drawImage(a,0,0,a.width,a.height);var e=l.width/2-r.width/2,t=l.height/2-r.height/2;o.drawImage(r,e,t,r.width,r.height),l.toBlob((async function(e){const t=await(0,w.A)(new File([e],"image.jpeg",{type:"image/jpeg"}),{maxSizeMB:c.compressMaxSize||.45,maxWidthOrHeight:c.compressMaxWidthOrHeight||2e3});kt(R,t).then((e=>{i((0,Me.tm)(e))}))}),"image/jpg",1),clearInterval(u)}}),300)}))})(),o.link=o.video.source,H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:"video",settings:{video:{...o.video,...t.video},link:o.link}});break;default:n=t}var b;"borderPosition"!==r&&"mobileBorderPosition"!==r&&-1===r.indexOf("countdown")&&"video"!==r&&(H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:n}),"video"!==r&&-1===r.indexOf("countdown")&&"mobileBorderRadiusAll"!==r&&"mobileBorderRadiusTopLeft"!==r&&"mobileBorderRadiusTopRight"!==r&&"mobileBorderRadiusBottomLeft"!==r&&"mobileBorderRadiusBottomRight"!==r&&wt({...e,...n,mobileBorderRadius:{...e.mobileBorderRadius,...null===(b=n)||void 0===b?void 0:b.mobileBorderRadius},activateSection:null,changeKey:r}))};(0,o.useEffect)((()=>{ee.isError&&((0,He.p6)(ee,C),tt(!1))}),[ee,C]),(0,o.useEffect)((()=>{if(ee.isSuccess&&et){var t;if(400===(null===(t=ee.data.data)||void 0===t?void 0:t.status))C.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:ee.data.code}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:ee.data.message}}),placement:"bottomRight"});else{let t=new URL(ee.data.target),l={countdown:{link:ee.data.link,params:t.search.substring(1)}};H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:l})}tt(!1)}}),[ee,et,e,C,H]);(0,Ce.A)((t=>{const l=t.data.operation;l===O.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Me.tm)(e.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_AI))):l===O.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Me.tm)(e.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):l===O.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Me.tm)(e.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_EDIT))):l===O.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Me.tm)(e.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_GIF))):l===O.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Me.tm)(e.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_STOCK))):l===O.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,Fe.Os)()),i((0,Fe.Oo)()))}));const Tt=()=>{ve?(Ae(""),a.setFieldValue("link",""),H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{link:""}})):(Ae(te.current&&te.current.input.value?te.current.input.value:"..."),setTimeout((()=>{te.current.focus()})))},Nt=e=>{""===e.target.value?Ae("..."):(le.current.classList.add("selected-td-form__button--active"),Ae(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?ot("https://"):"mailto:"===t.substring(0,7)?ot("mailto:"):"tel:"===t.substring(0,4)?ot("tel:"):"sms:"===t.substring(0,4)?ot("sms:"):"ftp://"===t.substring(0,6)?ot("ftp://"):"skype:"===t.substring(0,6)?ot("skype:"):"viber:"===t.substring(0,6)?ot("viber:"):ot("")},It=()=>{const t=a.getFieldsValue(!0);_e?(ye(""),t.alt="",H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{alt:""}})):(ye(oe.current&&oe.current.input.value?oe.current.input.value:"..."),setTimeout((()=>{oe.current.focus()})))},Pt=e=>{""===e.target.value?ye("..."):(ae.current.classList.add("selected-td-form__button--active"),ye(e.target.value))},Ct=()=>{const t=a.getFieldsValue(!0);Se?(ke(""),t.title="",H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{title:""}})):(ke(ie.current&&ie.current.input.value?ie.current.input.value:"..."),setTimeout((()=>{ie.current.focus()})))},Lt=e=>{""===e.target.value?ke("..."):(re.current.classList.add("selected-td-form__button--active"),ke(e.target.value))};return o.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:je.uE[yt]||"borderAll",mobileBorderPosition:je.lS[St]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",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"},!Et&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),G===O.ND&&X.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:30,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(pe,{form:a,elementSettings:e,imgParent:!0})),c.formImageFieldVerticalAlignEnabled&&o.createElement(E.A,{span:12,align:"right"},o.createElement(ge,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&o.createElement(o.Fragment,null,o.createElement(Be,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),"video"===e.type&&o.createElement(o.Fragment,null,o.createElement(Ne,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&o.createElement(u.A.Item,{style:{marginBottom:0}},o.createElement(N.A,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement(A.A,{size:8,style:{marginBottom:_e||ve||Se?l.formItemMarginBottomXS:l.formItemMarginBottomMD+4}},o.createElement(p.A,{title:_e||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!_e}),onClick:It,ref:ae},o.createElement("span",{className:"addon-text-content"},"Alt"))),c.formFieldImageTitleEnabled&&o.createElement(p.A,{title:Se||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Se}),onClick:Ct,ref:re},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(p.A,{title:ve||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!ve}),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Tt,ref:le}))),(!!ve||!!_e||!!Se)&&o.createElement("div",{style:{marginBottom:l.formItemMarginBottomMD+4}},!!ve&&o.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{ref:te,allowClear:!0,placeholder:t("Hyperlink URL"),prefix:o.createElement(y.A,null),onChange:Nt}))),!!_e&&o.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},o.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:Pt,ref:oe}))),c.formFieldImageTitleEnabled&&!!Se&&o.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},o.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Tooltip text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:Lt,ref:ie})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ze((e=>!e)),Je&&(t.mobileWidth="",t.mobileHeight="",H({operation:O.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-"}}}))}))}},Je?o.createElement(x.A,null):o.createElement(k.A,null)))),Je&&o.createElement(b.A,{gutter:10,style:{paddingBottom:24}},o.createElement(E.A,{span:12},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e,isPicture:"true"})),c.formImageFieldHeightEnabled&&o.createElement(E.A,{span:12},o.createElement(Z,{form:a,name:"mobileHeight",elementSettings:e,isPicture:"true"}))),c.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Te((e=>!e)),Re?(t.mobileBorderAll=je.RH,t.mobileBorderTop=je.RH,t.mobileBorderBottom=je.RH,t.mobileBorderRight=je.RH,t.mobileBorderLeft=je.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},Re?o.createElement(x.A,null):o.createElement(k.A,null)))),Re&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:a,typeOfForm:"mobile"}))),c.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{qe((e=>!e)),Xe?(t.mobileBorderRadiusAll=null,he(!0)):t.mobileBorderRadiusAll=5,H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},Xe?o.createElement(x.A,null):o.createElement(k.A,null)))),Xe&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:Ee,setOneBorderRadiusValue:he,elementSettings:e,typeOfForm:"mobile"}))),c.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Qe((e=>!e)),Ke?(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"),H({operation:O.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-"}}})}))}},Ke?o.createElement(x.A,null):o.createElement(k.A,null)))),Ke&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:se,typeOfForm:"mobile"}))),c.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})))),c.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(V,{form:a,elementSettings:e,imgParent:!0})),c.formImageFieldVerticalAlignEnabled&&o.createElement(E.A,{span:12,align:"right"},o.createElement(z.A,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:"countdown"===e.type?15:24}}),"countdown"===e.type&&o.createElement(o.Fragment,null,o.createElement(Be,{form:a,elementSettings:e,handleChangeValues:Rt}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),c.mergeTagsShow&&at&&o.createElement(E.A,{span:24,id:"merge_tags_wrapper"},o.createElement(u.A.Item,{style:{marginBottom:24}},o.createElement(f.Ay,{id:"merge_tags_button",icon:o.createElement(F.A,{icon:"MergeTags"}),style:{width:"100%",display:rt?"none":"block"},onClick:()=>nt(!0)},t("Merge tags")),o.createElement(v.A,{ref:me,popupClassName:"merge-tags",options:at,placeholder:t("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const l=t.map(((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map(((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t)))}));return o.createElement("div",{title:t.map((e=>e.label)).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(t,l)=>{if(nt(!1),t){const o=ft.syntax.length>1?at.findIndex((e=>e.key===l[0].key)):0,i=ft.syntax[o].replace("%value%",t[t.length-1]);"selected_image_form_title"===(null===dt||void 0===dt?void 0:dt.getAttribute("id"))||"selected_image_form_alt"===(null===dt||void 0===dt?void 0:dt.getAttribute("id"))||"selected_image_form_link"===(null===dt||void 0===dt?void 0:dt.getAttribute("id"))||"selected_image_form_imgReplacer"===(null===dt||void 0===dt?void 0:dt.getAttribute("id"))?((t,l)=>{const o=document.getElementById(l);if(o){var i,r;const n="selected_image_form_",d=l.substring(l.indexOf(n)+n.length),m=null===(i=o.value)||void 0===i?void 0:i.substring(0,st.start),s=null===(r=o.value)||void 0===r?void 0:r.substring(st.end);H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{...e,[d]:m+t+s}}),a.setFieldValue(d,m+t+s),o.focus(),setTimeout((()=>{o.selectionStart=st.start,o.selectionEnd=st.start+t.length}),400),pt(!0)}})(i,null===dt||void 0===dt?void 0:dt.getAttribute("id")):(a.setFieldValue("imgReplacer",i),H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:i}}))}},style:{display:rt?"block":"none"},open:rt,onKeyDown:e=>{"Escape"===e.key&&nt(!1)}}))),"video"===e.type&&o.createElement(o.Fragment,null,o.createElement(Ne,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}})),("img"===e.type||"video"===e.type)&&o.createElement(u.A.Item,{style:{marginBottom:0}},o.createElement(N.A,{form:a,label:t("Image path"),name:"src",placeholder:t("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement(A.A,{size:8,style:{marginBottom:_e||ve||Se||gt?l.formItemMarginBottomXS:l.formItemMarginBottomMD+4}},o.createElement(p.A,{title:_e||t("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!_e}),onClick:It,ref:ae},o.createElement("span",{className:"addon-text-content"},"Alt"))),c.formFieldImageTitleEnabled&&o.createElement(p.A,{title:Se||t("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!Se}),onClick:Ct,ref:re},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(p.A,{title:ve||t("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!ve}),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:Tt,ref:le})),c.formImageFieldReplacerEnabled&&o.createElement(p.A,{title:t("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":gt}),icon:o.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{bt(!gt),gt?(a.setFieldValue("imgReplacer",""),H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{imgReplacer:""}})):setTimeout((()=>ne.current.focus()))},ref:de}))),(!!ve||!!_e||!!Se||!!gt)&&o.createElement("div",{style:{marginBottom:l.formItemMarginBottomMD+4}},!!ve&&o.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"link",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{addonBefore:o.createElement(je.Ai,{linkProtocol:lt,handleLinkProtocolsChange:e=>{a.setFieldValue("link","mergetag"!==e?e:""),ot(e)},__:t}),placeholder:t("Hyperlink URL"),allowClear:!0,ref:te,onChange:Nt,onSelect:vt,prefix:o.createElement(je.RM,{linkProtocol:lt})}))),!!_e&&o.createElement(p.A,{trigger:["hover"],title:t("Alternative text"),placement:"bottom"},o.createElement(u.A.Item,{name:"alt",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:Pt,ref:oe,onSelect:vt}))),c.formFieldImageTitleEnabled&&!!Se&&o.createElement(p.A,{trigger:["hover"],title:t("Tooltip text"),placement:"bottom"},o.createElement(u.A.Item,{name:"title",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Enter the title of the image"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:Lt,ref:ie,onSelect:vt}))),!!gt&&o.createElement(p.A,{trigger:["hover"],title:t("Image src"),placement:"bottom"},o.createElement(u.A.Item,{name:"imgReplacer",className:"selected-image-form__alt",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:o.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:vt})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Size")),o.createElement(b.A,{gutter:l.marginSM,style:{marginBottom:c.formImageFieldHeightEnabled?4:24}},o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:l.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:e.maxWidth,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:"px"})))),c.formImageFieldHeightEnabled&&o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Height"),placement:"bottom"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"}))))),c.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{we((e=>!e)),xe?(t.borderAll=je.RH,t.borderTop=je.RH,t.borderBottom=je.RH,t.borderRight=je.RH,t.borderLeft=je.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},xe?o.createElement(x.A,null):o.createElement(k.A,null)))),xe&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:a,elementSettings:e}))),c.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Ue((e=>!e)),Ie?(t.borderRadiusAll=0,be(!0)):t.borderRadiusAll=5,H({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},Ie?o.createElement(x.A,null):o.createElement(k.A,null)))),Ie&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:ue,setOneBorderRadiusValue:be,elementSettings:e}))),c.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.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"),H({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),$e&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:se}))),c.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})))),c.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))};var Xe=l(78320);const qe=()=>{const{__:e}=(0,L.s9)();return o.createElement(p.A,{trigger:["hover"],title:e("The font-size CSS property sets the size of the font."),placement:"top"},o.createElement(u.A.Item,{name:"mobileFontSize"},o.createElement(W.A,{min:8,max:90,placeholder:e("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"})))};var $e=l(38927),Ye=l(44484),Ke=l(96698);const Qe=({form:e,elementSettings:t,name:l,icon:a,tooltipTitle:i=null,showTooltip:n=!0})=>{const{__:d}=(0,L.s9)(),m=e.getFieldValue(l),s=(0,D.XW)(),[c,g]=(0,o.useState)(t[l]);(0,o.useEffect)((()=>{t[l]!==e.getFieldValue(l)&&(e.setFieldValue(l,t[l]),g(t[l]))}),[t,e,l]),(0,o.useEffect)((()=>{c!==m&&g(m)}),[m,c,l]);const b=()=>{const o={[l]:!c};e.setFieldValue(l,!c),s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:o}),"textSuperscript"===l?e.setFieldValue("textSubscript",!1):"textSubscript"===l&&e.setFieldValue("textSuperscript",!1),g((e=>!e))};return o.createElement(u.A.Item,{name:l},n?o.createElement(p.A,{placement:"bottom",title:i||d(l.substring(4))},o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},a)):o.createElement(f.Ay,{className:r()("selected-td-form__button selected-td-form__button_style",{"selected-td-form__button--active":c}),onClick:b},a))};Qe.defaultProps={imgParent:!1};const Je=Qe;var Ze=l(11399),et=l(52427),tt=l(94338);const{useToken:lt}=c.A,ot=({form:e,elementSettings:t,showAddParagraph:l=!0,isButton:a=!1,linkProtocol:i,setLinkProtocol:d,linkTarget:m,isBulletFontColorChecked:s=!1,setIsBulletFontColorChecked:c=()=>{}})=>{var g,A,k,x,w,R,T;const{__:N}=(0,L.s9)(),{token:I}=lt(),P=(0,ze.hN)(),C=(0,D.XW)(),M=(0,D.K9)(),V=(0,Ve.rD)(),z=(0,o.useRef)(),H=(0,o.useRef)(null),j=(0,o.useRef)(null),U=(0,o.useRef)(!1),[q,$]=(0,o.useState)(!1),[Y,K]=(0,o.useState)(null),[Q,J]=(0,o.useState)({start:0,end:0}),[Z,ee]=(0,o.useState)(!1),[te,le]=(0,o.useState)([]),[oe,ae]=(0,o.useState)("#c6c3c3"),[ie,re]=(0,o.useState)(!1),ne=(0,o.useRef)(null),de=(0,tt.A)(),me=(0,o.useMemo)((()=>de),[]),se=u.A.useWatch([],e);let ce=null;(0,o.useEffect)((()=>{if(null!==se&&void 0!==se&&se.textColor&&s){const l=e.getFieldValue("textColor");C({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{ColorBullets:l}})}}),[null===se||void 0===se?void 0:se.textColor]),(0,o.useEffect)((()=>{const l=e.getFieldValue("textLink");"string"===typeof t.linkHref&&re(!0),ne&&!l&&(re(!1),e.setFieldsValue({linkHref:null})),ne.current=l||null}),[null===se||void 0===se?void 0:se.textLink,null===se||void 0===se?void 0:se.linkHref,t.linkHref,e]);(0,Ce.A)((e=>{e.data.operation===O.Ru.APPLICATION_FOCUS_IN_IFRAME&&K(null)}));const[ue,pe]=(0,o.useState)(null);(0,o.useEffect)((()=>{var e,t;null!==(e=window)&&void 0!==e&&null!==(t=e.navigator)&&void 0!==t&&t.userAgent.includes("Macintosh")&&pe(!0)}),[]);const ge=(0,o.useRef)(null);const be=e=>{C({operation:O.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"}),P.success({message:N("It`s done!"),placement:"bottomRight"})},Ee=[{key:"1",label:N("This element"),onClick:()=>be("typograf")},{key:"2",label:N("The whole email"),onClick:()=>be("typograf_all")}],[he,fe]=(0,o.useState)(),[ve,Se]=(0,o.useState)(!1);(0,o.useEffect)((()=>{const e=((e,t="#c6c3c3",l={})=>{const{symbolSize:a="25px",marginRight:i="5px",marginBottom:r="5px",textStyle:n={whiteSpace:"normal",lineHeight:"1.2"}}=l;return e.map((e=>({value:e.code,label:o.createElement("div",{style:{display:"flex",alignItems:"center"}},o.createElement("span",{style:{color:t||"#c6c3c3",marginRight:i,marginBottom:r,fontSize:a,lineHeight:"0.7",width:a,textAlign:"center",...n}},e.symbol),o.createElement("span",{style:n},e.description))})))})(me,oe,{});le(e)}),[me,oe]),(0,o.useEffect)((()=>{var e;ae(null===t||void 0===t||null===(e=t.list)||void 0===e?void 0:e.bulletsColor)}),[e,t]),(0,o.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 Be=(0,n.d4)(We.GH);(0,o.useEffect)((()=>{var e;null!==Be&&void 0!==Be&&null!==(e=Be.items)&&void 0!==e&&e.length&&fe((0,Ve.cM)(Be.items,N,((e,t)=>{Se(!1),M(O.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[Be,fe,N,Se,M]);(0,o.useEffect)((()=>{ve&&ge.current&&ge.current.focus()}),[ve]),(0,o.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||K(e)},t=({target:e})=>{e.closest(".merge-tags")||e.closest("#merge_tags_button")||Se(!1)};return window.addEventListener("focusin",e),window.addEventListener("click",t),()=>{window.removeEventListener("focusin",e),window.removeEventListener("click",t)}}),[]),(0,o.useEffect)((()=>{const e=(null===H||void 0===H?void 0:H.current)||document,t=()=>{window.getSelection().toString().length>0&&(U.current=!0)};return e.addEventListener("dblclick",t),()=>{e.removeEventListener("dblclick",t)}}),[H]);const ke=(0,o.useCallback)((({target:e})=>{if(e&&!Z){const{selectionStart:t,selectionEnd:l}=e;J({start:t,end:l})}ee(!1)}),[Z]);(0,o.useEffect)((()=>ke({target:null===m||void 0===m?void 0:m.target})),[m,ke]);const xe=(l,o)=>{const a=document.getElementById(o);if(a){var i,r;const n=null===(i=a.value)||void 0===i?void 0:i.substring(0,Q.start),d=null===(r=a.value)||void 0===r?void 0:r.substring(Q.end),m=o.substring(o.lastIndexOf("_")+1);C({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{[m]:n+l+d}}),e.setFieldValue(m,n+l+d),a.focus(),setTimeout((()=>{a.selectionStart=Q.start,a.selectionEnd=Q.start+l.length}),400),ee(!0)}};(0,o.useEffect)((()=>{var e;$(!(null===(e=t.textReplacer)||void 0===e||!e.length))}),[t,e]);return o.createElement(o.Fragment,null,l&&!t.showOnMobile&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12,gutter:20},o.createElement(Ze.A,{form:e,elementSettings:t,name:"textAlign"}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}})),t.showOnMobile&&o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:20}}),V.formTextFieldTypografEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"AddImage",style:{marginBottom:I.formItemMarginBottomXS}},o.createElement(f.Ay,{icon:o.createElement(F.A,{icon:"AddImage"}),onClick:()=>be("add_img"),style:{width:"100%"}},N("Add image")))),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"Typography",style:{marginBottom:I.formItemMarginBottomXS}},o.createElement($e.A,{arrow:!0,menu:{items:Ee},trigger:["hover"],placement:"bottom",getPopupContainer:e=>e.closest(".selected-element-panel")},o.createElement(f.Ay,{icon:o.createElement(F.A,{icon:"Typograf"}),onClick:()=>be("typograf"),style:{width:"100%"}},N("Typography"))))),V.mergeTagsShow&&he&&o.createElement(E.A,{span:24,id:"merge_tags_wrapper",style:{marginBottom:0}},o.createElement(f.Ay,{id:"merge_tags_button",icon:o.createElement(F.A,{icon:"MergeTags"}),style:{width:"100%",display:ve?"none":"block"},onClick:()=>Se(!0)},N("Merge tags")),o.createElement(v.A,{ref:ge,popupClassName:"merge-tags",options:he,placeholder:N("Start typing the title"),showSearch:{filter:(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1)),render:(e,t)=>{const l=t.map(((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map(((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t)))}));return o.createElement("div",{title:t.map((e=>e.label)).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(l,o)=>{if(Se(!1),l){const a=Be.syntax.length>1?he.findIndex((e=>e.key===o[0].key)):0,i=Be.syntax[a].replace("%value%",l[l.length-1]);if("selected_button_form_href"===(null===Y||void 0===Y?void 0:Y.getAttribute("id"))||"selected_text_form_linkHref"===(null===Y||void 0===Y?void 0:Y.getAttribute("id"))||"selected_text_form_textReplacer"===(null===Y||void 0===Y?void 0:Y.getAttribute("id")))xe(i,null===Y||void 0===Y?void 0:Y.getAttribute("id"));else{e.setFieldValue("textReplacer",i);const l=Date.now();C({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:`${i}~~${l}`}})}}},style:{display:ve?"block":"none",width:"100%"},open:ve,onKeyDown:e=>{"Escape"===e.key&&Se(!1)}}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:I.formItemMarginBottomMD,marginTop:20}})),o.createElement(p.A,{trigger:["hover"],title:N("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"fontFamily",className:"form-item-margin-xs"},o.createElement(et.A,{textEditor:!0}))),!t.showOnMobile&&o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Font size"),placement:"bottom"},o.createElement(u.A.Item,{name:"fontSize"},o.createElement(W.A,{min:8,max:90,placeholder:N("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Line height"),placement:"bottom"},o.createElement(u.A.Item,{name:"lineHeight"},o.createElement(W.A,{min:10,max:110,placeholder:N("Line height"),prefix:o.createElement(Xe.A,null),addonAfter:"px"}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:N(ue?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(_e.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:N(ue?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:N(ue?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:N(ue?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(Ke.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"textSuperscript",tooltipTitle:N("Text superscript"),icon:o.createElement(F.A,{icon:"Superscript",style:{paddingTop:"4px"}})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"textSubscript",tooltipTitle:N("Text subscript"),icon:o.createElement(F.A,{icon:"Subscript",style:{paddingTop:"4px"}})})),l&&o.createElement(E.A,{span:3},o.createElement(Je,{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:N("Link"),icon:o.createElement(y.A,{className:"selected-text-common-form__icon-radius"}),onSelect:ke})),a&&o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textColor",rules:[{message:N("Please set the font color")}]},o.createElement(G.A,{placeholder:N("Color"),usedColors:t.usedColors})))),!a&&V.formTextFieldReplacerEnabled&&o.createElement(E.A,{span:3},o.createElement(p.A,{title:N("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":q}),icon:o.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{$(!q),q?(e.setFieldValue("textReplacer",""),C({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:""}})):setTimeout((()=>H.current.focus()))},ref:j})))),l&&"string"===typeof t.linkHref&&ie&&o.createElement(p.A,{trigger:["hover"],title:N("The URL that the hyperlink directs to."),placement:"bottom"},o.createElement(u.A.Item,{name:"linkHref"},o.createElement(_.A,{ref:z,addonBefore:o.createElement(je.Ai,{linkProtocol:i,handleLinkProtocolsChange:t=>{e.setFieldValue("linkHref","mergetag"!==t?t:""),d(t)},__:N}),allowClear:!0,placeholder:N("Hyperlink URL"),autoFocus:null===t||void 0===t?void 0:t.isNewLink,onSelect:ke,prefix:o.createElement(je.RM,{linkProtocol:i})}))),!a&&q&&o.createElement(p.A,{trigger:["hover"],title:N("Text"),placement:"bottom"},o.createElement(u.A.Item,{name:"textReplacer"},o.createElement(_.A,{placeholder:N("The code that will replace this text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},N("Text")),onChange:e=>{""!==e.target.value&&j.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const l=e.target,o=l.value,a=l.selectionStart,i=function(e){const t=e.key.toLowerCase();let l=!1;return("control"!==ce&&"meta"!==ce||"a"!==t&&"A"!==t)&&("a"!==ce&&"A"!==ce||"control"!==t&&"meta"!==t)||(l=!0),ce=t,"control"!==t&&"a"!==t&&"A"!==t&&"meta"!==t&&(ce=null),l}(e);if(U.current&&0===a&&C({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{textReplacer:`${o}~`}}),U.current=i,0!==a||" "!==e.key){if(" "===e.key){if(a!==o.length)return void e.preventDefault();o.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:H,onSelect:ke}))),!a&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textColor",rules:[{message:N("Please set the font color")}]},o.createElement(G.A,{placeholder:N("Color"),usedColors:t.usedColors})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:N("Please set the background color")}]},o.createElement(G.A,{placeholder:N("Background color"),usedColors:t.usedColors}))))),!a&&(null===t||void 0===t||null===(g=t.list)||void 0===g?void 0:g.isList)&&o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:2}}),!a&&(null===t||void 0===t||null===(A=t.list)||void 0===A?void 0:A.isList)&&o.createElement(b.A,{gutter:[10,10],align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},N("List settings")))),!a&&(null===t||void 0===t||null===(k=t.list)||void 0===k?void 0:k.isList)&&o.createElement(o.Fragment,null,"OL"===(null===t||void 0===t||null===(x=t.list)||void 0===x?void 0:x.listType)&&o.createElement(b.A,null,o.createElement(E.A,{span:24},o.createElement(p.A,{trigger:["hover"],title:N("Bullets font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"BulletsFontFamily",className:"form-item-margin-xs"},o.createElement(et.A,{textEditor:!0,style:{marginTop:"-9px"}}))))),o.createElement(b.A,{gutter:[10]},"UL"===(null===t||void 0===t||null===(w=t.list)||void 0===w?void 0:w.listType)&&o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Bullets type"),placement:"bottom"},o.createElement(u.A.Item,{name:"BulletType",className:"bullet-type"},o.createElement(X.A,{size:"middle",placeholder:N("Bullets type"),onClick:e=>e.stopPropagation(),options:te}))))),o.createElement(b.A,{gutter:[10]},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Bullets color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"ColorBullets"},o.createElement(G.A,{placeholder:N("Bullets color"),usedColors:t.usedColors,isDisabled:s,onChange:e=>{ae(e),s&&c(!1)},externalValue:s?null===se||void 0===se?void 0:se.textColor:void 0})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Bullets size"),placement:"bottom"},o.createElement(u.A.Item,{name:"BulletsSize"},o.createElement(W.A,{min:8,max:90,defaultValue:null===t||void 0===t||null===(R=t.list)||void 0===R?void 0:R.bulletFontSize,placeholder:N("Bullets size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"}))))),"OL"===(null===t||void 0===t||null===(T=t.list)||void 0===T?void 0:T.listType)&&o.createElement(b.A,null,o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"BulletTextStrong",tooltipTitle:N(ue?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(_e.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"BulletTextItalic",tooltipTitle:N(ue?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"BulletTextStrikethrough",tooltipTitle:N(ue?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ye.A,{className:"selected-text-common-form__icon-radius"})})),o.createElement(E.A,{span:3},o.createElement(Je,{form:e,elementSettings:t,name:"BulletTextUnderline",tooltipTitle:N(ue?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(Ke.A,{className:"selected-text-common-form__icon-radius"})}))),o.createElement(b.A,{gutter:[10],style:{marginTop:"-8px"}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Between list items"),placement:"bottom"},o.createElement(u.A.Item,{name:"SpacingBetweenParagraphs"},o.createElement(W.A,{min:5,max:100,placeholder:N("Between list items"),prefix:o.createElement(B.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:N("Between bullets and text"),placement:"bottom"},o.createElement(u.A.Item,{name:"SpacingBetweenBulletsAndText"},o.createElement(W.A,{min:1,max:100,placeholder:N("Between bullets and text"),prefix:o.createElement(S.A,null),addonAfter:"px"})))))))};var at=l(81149),it=l(2922),rt=l(60994);const nt=({form:e,elementSettings:t,showAddParagraph:l=!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")?O.IE:O.Tm,[E,v]=(0,o.useState)(null);(0,o.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:O.Ru.SANDBOX_ELEMENT_TEXT,action:e,locale:"ru_RU"})},[B,k]=(0,o.useState)(t.textAlign),[x,w]=(0,o.useState)(t.linkHref),R=e=>k(e);return(0,o.useEffect)((()=>{k(t.textAlign),w(t.linkHref)}),[t]),o.createElement("div",{className:"selected_text_common_form_mobile"},o.createElement(A.A,{size:"8",split:o.createElement(h.A,{type:"vertical"})},o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement("div",{style:{width:190}},o.createElement(p.A,{trigger:["hover"],title:i("Text font"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"fontFamily"},o.createElement(et.A,{textEditor:!0,codeMode:!0})))),o.createElement("div",{style:{width:90}},o.createElement(p.A,{trigger:["hover"],title:i("Font size"),placement:"bottom"},o.createElement(u.A.Item,{name:"fontSize"},o.createElement(W.A,{min:8,max:90,placeholder:i("Font size"),prefix:o.createElement(Ae.A,null),addonAfter:"px"})))),o.createElement("div",{style:{width:90}},o.createElement(p.A,{trigger:["hover"],title:i("Line height"),placement:"bottom"},o.createElement(u.A.Item,{name:"lineHeight"},o.createElement(W.A,{min:10,max:110,placeholder:i("Line height"),prefix:o.createElement(Xe.A,null),addonAfter:"px"}))))),o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(Je,{form:e,elementSettings:t,name:"textStrong",tooltipTitle:i(E?"Strong ( \u2318B )":"Strong ( Ctrl+B )"),icon:o.createElement(_e.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Je,{form:e,elementSettings:t,name:"textItalic",tooltipTitle:i(E?"Italic ( \u2318I )":"Italic ( Ctrl+I )"),icon:o.createElement(ye.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Je,{form:e,elementSettings:t,name:"textStrikethrough",tooltipTitle:i(E?"Strikethrough ( \u2318+Shift+X )":"Strikethrough ( Alt+Shift+5 )"),icon:o.createElement(Ye.A,{className:"selected-td-form__icon-radius"})}),o.createElement(Je,{form:e,elementSettings:t,name:"textUnderline",tooltipTitle:i(E?"Underline ( \u2318U )":"Underline ( Ctrl+U )"),icon:o.createElement(Ke.A,{className:"selected-td-form__icon-radius"})})),o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(p.A,{trigger:["hover"],title:i("Text color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textColor",rules:[{message:i("Please set the font color")}]},o.createElement(G.A,{placeholder:i("Color"),usedColors:t.usedColors,codeMode:!0}))),!a&&o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:i("Text background"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"textBackgroundColor",rules:[{message:i("Please set the background color")}]},o.createElement(G.A,{placeholder:i("Background color"),usedColors:t.usedColors}))))),l&&o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},o.createElement(o.Fragment,null,"string"===typeof x?o.createElement($e.A,{arrow:!0,dropdownRender:()=>o.createElement(p.A,{trigger:["hover"],title:i("The URL that the hyperlink directs to."),placement:"bottom"},o.createElement(u.A.Item,{name:"linkHref"},o.createElement(_.A,{allowClear:!0,placeholder:"href",prefix:o.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")},o.createElement("div",null,o.createElement(Je,{form:e,className:"selected-td-form__button selected-td-form__button_style selected-td-form__button--active",elementSettings:t,name:"textLink",icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),showTooltip:!1}))):o.createElement(Je,{form:e,className:"selected-td-form__button selected-td-form__button_style",elementSettings:t,name:"textLink",tooltipTitle:i("Link"),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"})}),o.createElement($e.A,{arrow:!0,dropdownRender:()=>o.createElement(Ze.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")},o.createElement(f.Ay,{icon:"right"===B?o.createElement(at.A,null):"center"===B?o.createElement(it.A,null):o.createElement(rt.A,null),className:"selected-td-form__button"})))),o.createElement(A.A,{size:8,className:"selected_text_common_form_mobile__group"},l&&o.createElement(p.A,{trigger:["hover"],title:i("Add paragraph"),placement:"bottom"},o.createElement(f.Ay,{icon:o.createElement(F.A,{icon:"Paragraph"}),onClick:()=>S("add_p"),className:"selected-td-form__button"})),o.createElement(p.A,{trigger:["hover"],title:i("Add inline image"),placement:"bottom"},o.createElement(f.Ay,{icon:o.createElement(F.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),onClick:()=>S("add_img"),className:"selected-td-form__button"})),o.createElement(f.Ay,{icon:o.createElement(F.A,{icon:"Typograf"}),className:"selected-td-form__button"}),o.createElement(f.Ay,{icon:o.createElement(te.A,null),type:"icon",style:{marginLeft:26},onClick:()=>{r({operation:O.Ru.SANDBOX_ELEMENT_ACTIVE_RESET}),c((0,Oe.Fk)()),setTimeout((()=>{b===O.IE?c((0,m.A9)({type:null})):c((0,d.A9)({type:null}))}),300)}}))))},dt=({form:e,elementSettings:t,imgParent:l,name:a="mobileAlign"})=>{var i;const{__:r}=(0,L.s9)(),[n,d]=(0,o.useState)(null===(i=t[a])||void 0===i?void 0:i.value),m=(0,D.XW)(),s=l=>{const o=l.target.value,i={[a]:{classNamePrefix:"em-mob-text_align-",value:""}};o!==n?d(o):(d(""),e.setFieldsValue(i),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:i}))};return o.createElement(u.A.Item,{name:a},o.createElement(C.Ay.Group,{disabled:l&&!t.parent},o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"bottom",title:r("Text align left")},o.createElement(C.Ay.Button,{value:"left",onClick:s},o.createElement(rt.A,null))),o.createElement(p.A,{placement:"bottom",title:r("Text align center")},o.createElement(C.Ay.Button,{value:"center",onClick:s},o.createElement(it.A,null))),o.createElement(p.A,{placement:"bottom",title:r("Text align right")},o.createElement(C.Ay.Button,{value:"right",onClick:s},o.createElement(at.A,null))),o.createElement(p.A,{placement:"bottom",title:r("Text align justify")},o.createElement(C.Ay.Button,{value:"justify",onClick:s},o.createElement(F.A,{icon:"Justify"}))))))};dt.defaultProps={imgParent:!1};const mt=dt,st=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,n.wA)(),a=(0,D.XW)(),[i]=u.A.useForm(),r=(0,n.d4)(d.Hs),s=(0,n.d4)(Oe.Ct),c=(0,n.d4)(Oe.CS),h=(0,n.d4)(Oe.Fv),f=(0,n.d4)(Oe.yy),v=h&&"bottom"!==f,[A,_]=(0,o.useState)("https://"),[y,S]=(0,o.useState)(!1),B=(0,tt.A)(),k=(0,o.useMemo)((()=>B),[]),x=r.hasOwnProperty("type")?O.IE:O.Tm,w=(0,o.useCallback)((e=>{l(x===O.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[l,x]);(0,o.useEffect)((()=>{var t,l,o,a,r,n,d,m,s,c,u,p,g,b,E,h;e&&i.setFieldsValue({...e,linkHref:e.linkHref?e.linkHref:"https://",mobileFontSize:(0,je.ok)((null===(t=e.mobileFontSize)||void 0===t?void 0:t.value)||e.fontSize),mobileFontSizeDim:(null===(l=e.mobileFontSize)||void 0===l?void 0:l.dim)||e.fontSizeDim,mobileLineHeight:(0,je.ok)((null===(o=e.mobileLineHeight)||void 0===o?void 0:o.value)||e.lineHeight),mobileLineHeightDim:(null===(a=e.mobileLineHeight)||void 0===a?void 0:a.dim)||e.lineHeightDim,mobileTextAlign:(0,je.ok)((null===(r=e.mobileTextAlign)||void 0===r?void 0:r.value)||e.textAlign),SpacingBetweenBulletsAndText:null===e||void 0===e||null===(n=e.list)||void 0===n?void 0:n.betweenRowCell,SpacingBetweenParagraphs:null===e||void 0===e||null===(d=e.list)||void 0===d?void 0:d.betweenParagraphs,BulletsSize:null===e||void 0===e||null===(m=e.list)||void 0===m?void 0:m.bulletFontSize,ColorBullets:null===e||void 0===e||null===(s=e.list)||void 0===s?void 0:s.bulletsColor,BulletTextStrong:null===e||void 0===e||null===(c=e.list)||void 0===c?void 0:c.bulletFontBold,BulletTextItalic:null===e||void 0===e||null===(u=e.list)||void 0===u?void 0:u.bulletFontItalic,CheckboxColor:y,BulletsFontFamily:null===e||void 0===e||null===(p=e.list)||void 0===p?void 0:p.bulletFontFamily,BulletTextUnderline:null===e||void 0===e||null===(g=e.list)||void 0===g?void 0:g.bulletFontUnderline,BulletTextStrikethrough:null===e||void 0===e||null===(b=e.list)||void 0===b?void 0:b.bulletFontStrikethrough,BulletType:null!==(E=null===(h=k.find((t=>{var l;return t.symbol===(null===e||void 0===e||null===(l=e.list)||void 0===l?void 0:l.bulletType)})))||void 0===h?void 0:h.code)&&void 0!==E?E:k[0].code,textSuperscript:null===e||void 0===e?void 0:e.textSuperscript,textSubscript:null===e||void 0===e?void 0:e.textSubscript})}),[i,e]);return o.createElement(u.A,{form:i,layout:"vertical",name:"selected_text_form",autoComplete:"off",onValuesChange:t=>{var l,o;const r=i.getFieldsValue(!0),n=Object.keys(t)[0];let d;switch(n){case"mobileFontSize":d={[n]:{classNamePrefix:"em-mob-font_size-",value:t[n],dim:r.mobileFontSizeDim}};break;case"mobileLineHeight":d={[n]:{classNamePrefix:"em-mob-line_height-",value:t[n],dim:r.mobileLineHeightDim}};break;case"mobileTextAlign":d={[n]:{classNamePrefix:"em-mob-text_align-",value:t[n]}};break;case"linkHref":let e=t[n];"https://http"===e.substring(0,12)&&(e=e.substring(8,e.length),i.setFieldValue("linkHref",e)),d={[n]:e},"https://"===t[n].substring(0,8)||"http://"===t[n].substring(0,7)?_("https://"):"mailto:"===t[n].substring(0,7)?_("mailto:"):"tel:"===t[n].substring(0,4)?_("tel:"):"sms:"===t[n].substring(0,4)?_("sms:"):"ftp://"===t[n].substring(0,6)?_("ftp://"):"skype:"===t[n].substring(0,6)?_("skype:"):"viber:"===t[n].substring(0,6)?_("viber:"):_("");break;default:d=t}a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:d}),w({...e,list:{...e.list,bulletsColor:i.getFieldValue("ColorBullets"),bulletFontFamily:i.getFieldValue("BulletsFontFamily"),bulletFontSize:i.getFieldValue("BulletsSize"),betweenParagraphs:i.getFieldValue("SpacingBetweenParagraphs"),betweenRowCell:i.getFieldValue("SpacingBetweenBulletsAndText"),bulletType:null!==(l=null===(o=k.find((e=>e.code===i.getFieldValue("BulletType"))))||void 0===o?void 0:o.symbol)&&void 0!==l?l:k[0].symbol},...d,activateSection:null,changeKey:n})},className:"element-controls",initialValues:{textAlign:"left",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1,textColor:"",textBackgroundColor:"",textLink:!1,textReplacer:"",SpacingBetweenBulletsAndText:0,SpacingBetweenParagraphs:0,BulletsSize:0,ColorBullets:"",BulletTextStrong:!1,BulletTextItalic:!1,CheckboxColor:!1,BulletsFontFamily:"",BulletTextUnderline:!1,BulletTextStrikethrough:!1,BulletType:"",textSuperscript:!1,textSubscript:!1}},!v&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),!(s===O.ND&&!v&&c.styles)&&o.createElement("div",{id:"selected_element_form_desktop_props",style:{paddingRight:0}},o.createElement("div",{className:"selected_form-props-wrapper"},v?o.createElement(nt,{form:i,elementSettings:e}):o.createElement(ot,{form:i,elementSettings:e,linkProtocol:A,setLinkProtocol:_,isBulletFontColorChecked:y,setIsBulletFontColorChecked:S}))),!v&&o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===O.ND&&c.styles?"block":"none"}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement(mt,{form:i,elementSettings:e,name:"mobileTextAlign"}))),!!e.showOnMobile&&o.createElement(ot,{form:i,elementSettings:e,linkProtocol:A,setLinkProtocol:_}),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(qe,null)),o.createElement(E.A,{span:12},o.createElement(u.A.Item,{name:"mobileLineHeight"},o.createElement(W.A,{min:0,placeholder:t("Line height"),prefix:o.createElement(Xe.A,null),addonAfter:"px"})))))))};var ct=l(78469),ut=l(31573),pt=l(39672),gt=l(70552),bt=l(88647);const Et=({form:e,oneMobileBorderRadiusValue:t,setOneMobileBorderRadiusValue:l,elementSettings:a})=>{const{__:i}=(0,L.s9)(),n=(0,D.XW)();return o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"start"},o.createElement(u.A.Item,{name:"mobileBorderRadiusAll"},o.createElement(W.A,{min:0,placeholder:i("Border radius"),prefix:o.createElement(bt.h,{className:"selected-td-form__icon-radius"}),disabled:!t,addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!t}),onClick:()=>{const o=e.getFieldsValue(!0);t&&e.setFieldsValue({mobileBorderRadiusTopLeft:o.mobileBorderRadiusAll,mobileBorderRadiusBottomLeft:o.mobileBorderRadiusAll,mobileBorderRadiusTopRight:o.mobileBorderRadiusAll,mobileBorderRadiusBottomRight:o.mobileBorderRadiusAll}),n({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:a.type,settings:{mobileBorderRadius:{all:o.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}}),l((e=>!e))}},o.createElement(bt.h,{className:"selected-td-form__icon-radius"}))),o.createElement(E.A,null,o.createElement(b.A,{gutter:10,style:{marginTop:-10}},o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:i("Top left corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusTopLeft",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,prefix:o.createElement(ct.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(p.A,{placement:"bottom",title:i("Bottom left corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusBottomLeft"},o.createElement(W.A,{min:0,prefix:o.createElement(ut.A,null),style:{minHeight:10},addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:i("Top right corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusTopRight",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,prefix:o.createElement(pt.A,null),style:{minHeight:10},addonAfter:"px"}))),o.createElement(p.A,{placement:"bottom",title:i("Bottom right corner")},o.createElement(u.A.Item,{hidden:t,name:"mobileBorderRadiusBottomRight"},o.createElement(W.A,{min:0,prefix:o.createElement(gt.A,null),style:{minHeight:10},addonAfter:"px"})))))))},ht=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)(),a=(0,o.useRef)(),i=(0,n.d4)(d.uJ),[r,m]=(0,o.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 o.createElement(o.Fragment,null,o.createElement("div",{style:{float:"right",marginTop:-9,marginRight:50}},o.createElement(A.A,{size:8,align:"end"},o.createElement(q.A,{ref:a,size:"small",checked:r,onChange:l=>{m((e=>!e)),e.setFieldsValue({mobileBoxShadowHOffset:r?"":0,mobileBoxShadowVOffset:r?"":0,mobileBoxShadowBlurRadius:r?"":0,mobileBoxShadowSpreadRadius:r?"":0,mobileBoxShadowColor:"",mobileBoxShadowInset:!1}),s({operation:O.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"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-shadow"},l("Without shadow"))))),o.createElement("p",{style:{paddingBottom:"8px",margin:"-30px 0 0"}},"\xa0"),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Horizontal offset")},o.createElement(u.A.Item,{name:"mobileBoxShadowHOffset",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:l("Horizontal offset"),prefix:o.createElement(j.A,null),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Vertical offset")},o.createElement(u.A.Item,{name:"mobileBoxShadowVOffset",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:l("Vertical offset"),prefix:o.createElement(j.A,{style:{transform:"rotate(90deg)"}}),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Blur radius")},o.createElement(u.A.Item,{name:"mobileBoxShadowBlurRadius",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:l("Blur radius"),prefix:o.createElement(F.A,{icon:"Blur",style:{fontSize:16,marginLeft:-2}}),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(p.A,{placement:"bottom",title:l("Spread radius")},o.createElement(u.A.Item,{name:"mobileBoxShadowSpreadRadius",className:"form-item-margin-xs"},o.createElement(W.A,{placeholder:l("Spread radius"),prefix:o.createElement(F.A,{icon:"ZoomOutMap"}),addonAfter:"px",onChange:c})))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"start"},o.createElement(u.A.Item,{name:"mobileBoxShadowColor"},o.createElement(G.A,{usedColors:i.usedColors})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:l("Shadow inside or outside of the element"),key:"inset",placement:"bottom"},o.createElement(u.A.Item,{name:"mobileBoxShadowInset",valuePropName:"checked"},o.createElement(H.A,{style:{width:"100%"},options:[{label:l("Outside"),value:!1},{label:l("Inside"),value:!0}]}))))))},{useToken:ft}=c.A,vt=({form:e,elementSettings:t,label:l})=>{var a;const{__:i}=(0,L.s9)(),r=(0,o.useRef)(),[n,d]=(0,o.useState)("none"===(null===(a=t.mobileBackgroundColor)||void 0===a?void 0:a.value)),{token:m}=ft(),s=(0,D.XW)();return o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:i("Background color"),placement:"left"},o.createElement(u.A.Item,{name:"mobileBackgroundColor",style:{marginBottom:m.formItemMarginBottomXS/2}},o.createElement(G.A,{onChange:e=>{d(!1)},placeholder:l,usedColors:t.usedColors})),o.createElement(A.A,{size:8,align:"end"},o.createElement(q.A,{ref:r,size:"small",checked:n,onChange:l=>{e.setFieldsValue({mobileBackgroundColor:""}),d((e=>!e)),s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:n?"":"none"}}})},id:"without-background-color"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-background-color"},i("Without background color"))))))};var At=l(86774);const _t=({form:e,placeholder:t,name:l,tooltipTitle:a,disabled:i,elementSettings:r})=>{var n;const{__:d}=(0,L.s9)(),m=(0,D.XW)(),s=e.getFieldValue(l),[c,g]=(0,o.useState)("success"),b=(0,o.useRef)(),[E,h]=(0,o.useState)(!(!r.mobileBackgroundImage||"none"!==r.mobileBackgroundImage[0].value));(0,o.useEffect)((()=>{s?(0,He.DI)(s).then((e=>{g(e)})).catch((e=>{g(e)})):g("")}),[e,s]);return o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:a,placement:"left"},o.createElement(u.A.Item,{name:l,validateStatus:c,style:{marginBottom:-7}},o.createElement(At.A,{validateStatus:c,placeholder:t,name:l,disabled:i,elementSettings:r,imageInfo:r.type===O.bV.CAROUSEL?null===(n=r.carouselImages)||void 0===n?void 0:n[l.split("_")[1]]:r})),o.createElement(A.A,{size:8,align:"end",style:{marginTop:-3,display:"flex"}},o.createElement(q.A,{ref:b,size:"small",checked:E,onChange:t=>{e.setFieldsValue({mobileBackgroundImage:""}),h((e=>!e)),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:r.type,settings:{mobileBackgroundImage:[{classNamePrefix:"em-mob-background_image-",value:E?"":"none",type:"url"}]}})},id:"without-background-image"}),o.createElement("div",{className:"ant-form-item-switch-label-small",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"without-background-image"},d("Without background image"))))))};_t.defaulProps={disabled:!1};const yt=(e,t)=>{const{__:l}=(0,L.s9)();return o.createElement(p.A,{title:l("During export, the element is converted into an image."),key:"exportAsPicture"},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"exportAsPicture",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"convern-in-image"})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"convern-in-image"},l("Convert into an image")))))},{Option:St}=X.A,Bt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(St,{value:"px"},"px"),o.createElement(St,{value:"%"},"%")),{useToken:kt}=c.A,xt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),[i,r]=(0,o.useState)({}),[d,m]=(0,o.useState)({}),[s,c]=(0,o.useState)(!0),[v,A]=(0,o.useState)({}),[_,y]=(0,o.useState)({}),[B,w]=(0,o.useState)(!0),R=(0,n.d4)(Oe.Ct),T=(0,n.d4)(Oe.CS),C=(0,Ve.rD)(),[M,z]=(0,o.useState)(""===e.backgroundImage[0].value),{token:H}=kt(),j=(0,n.d4)(Oe.Fv),q=(0,n.d4)(Oe.yy),$=j&&"bottom"!==q,[Y,K]=(0,o.useState)(!1),[J,Z]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),[le,oe]=(0,o.useState)(!1),[ae,ie]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[de,me]=(0,o.useState)(!1),[se,ue]=(0,o.useState)(!1),[ge,be]=(0,o.useState)(!1),[Ee,he]=(0,o.useState)(!1),[ve,Ae]=(0,o.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,o.useEffect)((()=>{if(e){var t,l,o,i,n,d,s,u,p,g,b,E,h,f,v,_,S,B,k,x,R,T,N,I,P,C,L,F,O,D,M,V,H,j,W,G,U,X,q,$,Y,Q,J;const ee=e.border,le=e.boxShadow,ae=e.mobileBorder,re=e.mobileBoxShadow;r(ee),m(le),A(ae),y(re);const de=Object.keys(ee).find((e=>{var t,l,o;return(null===(t=ee[e])||void 0===t?void 0:t.width)||(null===(l=ee[e])||void 0===l?void 0:l.style)||(null===(o=ee[e])||void 0===o?void 0:o.color)})),se=Object.keys(ae).find((e=>{var t,l,o;return(null===(t=ae[e])||void 0===t?void 0:t.width)||(null===(l=ae[e])||void 0===l?void 0:l.style)||(null===(o=ae[e])||void 0===o?void 0:o.color)}));a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,maxWidth:null===(o=e.maxWidth)||void 0===o?void 0:o.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,je.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,je.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,je.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,je.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,je.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,je.ok)(null===(g=e.boxShadow)||void 0===g?void 0:g.inset)||!1,boxShadowHOffset:(0,je.ok)(null===(b=e.boxShadow)||void 0===b?void 0:b.hOffset),boxShadowVOffset:(0,je.ok)(null===(E=e.boxShadow)||void 0===E?void 0:E.vOffset),boxShadowBlurRadius:(0,je.ok)(null===(h=e.boxShadow)||void 0===h?void 0:h.blurRadius),boxShadowSpreadRadius:(0,je.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.spreadRadius),boxShadowColor:(0,je.ok)(null===(v=e.boxShadow)||void 0===v?void 0:v.color),mobileWidth:(0,je.xc)(null===(_=e.mobileWidth)||void 0===_?void 0:_.value),mobileWidthDim:null===(S=e.mobileWidth)||void 0===S?void 0:S.dim,mobileAlign:null===(B=e.mobileAlign)||void 0===B?void 0:B.value,mobileBorderPosition:se||"all",mobileBorderWidth:null!==(null===(k=ae[se])||void 0===k?void 0:k.width)?null===(x=ae[se])||void 0===x?void 0:x.width:"",mobileBorderColor:(null===(R=ae[se])||void 0===R?void 0:R.color)||"",mobileBorderStyle:(null===(T=ae[se])||void 0===T?void 0:T.style)||"",mobileBorderRadiusAll:(0,je.ok)(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:(0,je.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:(0,je.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:(0,je.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:(0,je.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,je.ok)(null===(N=e.mobileBoxShadow)||void 0===N?void 0:N.inset)||!1,mobileBoxShadowHOffset:(0,je.ok)(null===(I=e.mobileBoxShadow)||void 0===I?void 0:I.hOffset),mobileBoxShadowVOffset:(0,je.ok)(null===(P=e.mobileBoxShadow)||void 0===P?void 0:P.vOffset),mobileBoxShadowBlurRadius:(0,je.ok)(null===(C=e.mobileBoxShadow)||void 0===C?void 0:C.blurRadius),mobileBoxShadowSpreadRadius:(0,je.ok)(null===(L=e.mobileBoxShadow)||void 0===L?void 0:L.spreadRadius),mobileBoxShadowColor:(0,je.ok)(null===(F=e.mobileBoxShadow)||void 0===F?void 0:F.color),mobileBackgroundColor:(0,je.ok)("none"!==(null===(O=e.mobileBackgroundColor)||void 0===O?void 0:O.value)?null===(D=e.mobileBackgroundColor)||void 0===D?void 0:D.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,je.ok)(null===(M=e.mobileBackgroundPositionX)||void 0===M?void 0:M.value),mobileBackgroundPositionY:(0,je.ok)(null===(V=e.mobileBackgroundPositionY)||void 0===V?void 0:V.value),mobileBackgroundRepeat:null!==(H=e.mobileBackgroundRepeat)&&void 0!==H&&H.value?null===(j=e.mobileBackgroundRepeat)||void 0===j?void 0:j.value:"none",exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,je.ok)(e.borderRadius.all)&&((0,je.ok)(e.borderRadius.topLeft)||(0,je.ok)(e.borderRadius.bottomLeft)||(0,je.ok)(e.borderRadius.topRight)||(0,je.ok)(e.borderRadius.bottomRight))?c(!1):c(!0),(0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight)?w(!1):w(!0),z(""===e.backgroundImage[0].value),K(!(null===(W=ee[de])||void 0===W||!W.width)||!(null===(G=ee[de])||void 0===G||!G.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),oe(!!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 o.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 o=a.getFieldsValue(!0),n=Object.keys(t)[0];let d;switch(n){case"exportAsPicture":d={exportAsPicture:o.exportAsPicture};break;case"boxShadowInset":case"boxShadowHOffset":case"boxShadowVOffset":case"boxShadowBlurRadius":case"boxShadowSpreadRadius":case"boxShadowColor":d={boxShadow:{hOffset:o.boxShadowHOffset,vOffset:o.boxShadowVOffset,blurRadius:o.boxShadowBlurRadius,spreadRadius:o.boxShadowSpreadRadius,color:o.boxShadowColor,inset:o.boxShadowInset}};break;case"borderStyle":d={border:{[o.borderPosition]:{...i[o.borderPosition],style:t[n]}}},"all"===o.borderPosition?r((e=>({...O.iV,[o.borderPosition]:{...e[o.borderPosition],style:t[n]}}))):r((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],style:t[n]}})));break;case"borderColor":d={border:{[o.borderPosition]:{...i[o.borderPosition],color:t[n]}}},"all"===o.borderPosition?r((e=>({...O.iV,[o.borderPosition]:{...e[o.borderPosition],color:t[n]}}))):r((e=>({...e,[o.borderPosition]:{...e[o.borderPosition],color:t[n]}})));break;case"borderWidth":d={border:{[o.borderPosition]:{...i[o.borderPosition],width:t[n]}}},"all"===o.borderPosition?r((e=>({...O.iV,[o.borderPosition]:{...e[o.borderPosition],width:t[n]}}))):r((e=>({...e,[o.borderPosition]:{...e[o.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:o.widthDim}};break;case"widthDim":d={width:{value:o.width,dim:t[n]}};break;case"maxWidth":d={[n]:{value:t[n],dim:o.maxWidthDim}};break;case"maxWidthDim":d={maxWidth:{value:o.maxWidth,dim:t[n]}};break;case"minWidth":d={[n]:{value:t[n],dim:o.minWidthDim}};break;case"minWidthDim":d={minWidth:{value:o.minWidth,dim:t[n]}};break;case"backgroundImage":z(""===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:{[O.wF[n]]:+t[n]}};break;case"mobileWidth":d={[n]:{classNamePrefix:"em-mob-width-",value:t[n],dim:o.mobileWidthDim}};break;case"mobileWidthDim":d={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[n]}};break;case"mobileBorderStyle":d={mobileBorder:{[o.mobileBorderPosition]:{...v[o.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?A((e=>({...O.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):A((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],style:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderColor":d={mobileBorder:{[o.mobileBorderPosition]:{...v[o.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?A((e=>({...O.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):A((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],color:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}})));break;case"mobileBorderWidth":d={mobileBorder:{[o.mobileBorderPosition]:{...v[o.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}},"all"===o.mobileBorderPosition?A((e=>({...O.iV,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+o.mobileBorderPosition+"-"}}))):A((e=>({...e,[o.mobileBorderPosition]:{...e[o.mobileBorderPosition],width:t[n],classNamePrefix:"em-mob-border_"+o.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:{[je.NW[n]]:t[n],classNamePrefix:"em-mob-border_radius_"+je.NW[n]+"-"}};break;case"mobileBoxShadowInset":case"mobileBoxShadowHOffset":case"mobileBoxShadowVOffset":case"mobileBoxShadowBlurRadius":case"mobileBoxShadowSpreadRadius":case"mobileBoxShadowColor":d={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"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&&l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:d})},autoComplete:"off",className:"element-controls"},!$&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),R===O.ND&&T.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement("div",{style:{paddingBottom:4}},o.createElement(pe,{form:a,elementSettings:e})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.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="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileWidth:{value:null,dim:"px",classNamePrefix:"em-mob-width-"}}}))}))}},se?o.createElement(x.A,null):o.createElement(k.A,null)))),se&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},o.createElement("div",{style:{marginBottom:H.formItemMarginBottomMD+4}},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.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",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Ee?o.createElement(x.A,null):o.createElement(k.A,null)))),Ee&&o.createElement("div",{style:{marginBottom:(C.formTableFieldBackgroundImageEnabled,H.formItemMarginBottomMD+4)}},o.createElement(vt,{form:a,elementSettings:e})),!1,C.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.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=>({...O.iV,[t.mobileBorderPosition]:{...e[t.mobileBorderPosition],width:t.mobileBorderWidth,color:t.mobileBorderColor,style:t.mobileBorderStyle}}))),l({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),J&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(ce,{mobileBorders:v}))),C.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{oe((e=>!e)),le?(t.mobileBorderRadiusAll=null,w(!0)):t.mobileBorderRadiusAll=5,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},le?o.createElement(x.A,null):o.createElement(k.A,null)))),le&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Et,{form:a,oneMobileBorderRadiusValue:B,setOneMobileBorderRadiusValue:w,elementSettings:e}))),C.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.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"),l({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),re&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(ht,{mobileBoxShadow:_,form:a,elementSettings:e}))),C.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement("div",{style:{paddingBottom:4}},o.createElement(fe,{elementSettings:e,form:a}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement("div",{style:{paddingBottom:4}},o.createElement(V,{form:a,elementSettings:e,tooltipTitle:t("The align attribute sets the horizontal alignment of the table.")})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.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="",l({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),de&&o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:t("Table width"),placement:"left"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:H.formItemMarginBottomXS}},o.createElement(W.A,{min:0,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Bt),style:{width:"100%"}}))),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"left"},o.createElement(u.A.Item,{name:"minWidth"},o.createElement(W.A,{min:0,placeholder:t("Table min width"),prefix:o.createElement(F.A,{icon:"MinWidth"}),addonAfter:o.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},Bt)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"top"},o.createElement(u.A.Item,{name:"maxWidth"},o.createElement(W.A,{min:0,placeholder:t("Table max width"),prefix:o.createElement(F.A,{icon:"MaxWidth"}),addonAfter:o.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},Bt)})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.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="",z(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),ge&&o.createElement(b.A,{gutter:10,style:{marginBottom:M?16:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:C.formTableFieldBackgroundImageEnabled?H.formItemMarginBottomXS:H.formItemMarginBottomMD+4}},o.createElement(G.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),C.formTableFieldBackgroundImageEnabled&&o.createElement(E.A,{span:M?12:24},o.createElement("div",{style:{paddingBottom:M?4:0}},o.createElement(N.A,{form:a,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!M&&o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:H.formItemMarginBottomXS}},o.createElement(W.A,{placeholder:t("Horizontal position"),prefix:o.createElement(F.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:H.formItemMarginBottomXS}},o.createElement(W.A,{placeholder:t("Vertical position"),prefix:o.createElement(F.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:H.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:"Please choose",options:_e,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:H.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:"Please choose",options:ye,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),C.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.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=>({...O.iV,[t.borderPosition]:{...e[t.borderPosition],width:t.borderWidth,color:t.borderColor,style:t.borderStyle}}))),l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderColor,style:t.borderStyle,width:t.borderWidth}}}})}))}},Y?o.createElement(x.A,null):o.createElement(k.A,null)))),Y&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(I.A,{borders:i}))),C.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.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,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ee?o.createElement(x.A,null):o.createElement(k.A,null)))),ee&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:s,setOneBorderRadiusValue:c,elementSettings:e}))),C.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.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"),l({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),ae&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(U,{boxShadow:d}))),C.formFieldExportAsPictureEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Export settings"))),o.createElement(E.A,{span:4,align:"right"},o.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,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},ve?o.createElement(x.A,null):o.createElement(k.A,null)))),ve&&o.createElement(yt,{form:a,elementSettings:e})),C.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement("div",{style:{paddingBottom:4}},o.createElement(fe,{elementSettings:e,form:a}))))),C.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))};var wt=l(10206);const Rt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),i=(0,Ve.rD)(),r=(0,n.d4)(Oe.Fv),d=(0,n.d4)(Oe.yy),[m,s]=(0,o.useState)({});(0,o.useEffect)((()=>{e&&a.setFieldsValue(e)}),[a,e]);return o.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=>{l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off",className:"element-controls"},r&&"bottom"!==d?o.createElement(nt,{form:a,elementSettings:e,showAddParagraph:!1}):o.createElement(o.Fragment,null,o.createElement(p.A,{trigger:["hover"],title:t("Hyperlink URL"),placement:"left"},o.createElement(u.A.Item,{name:"href",style:{marginBottom:24,paddingRight:10}},o.createElement(_.A,{allowClear:!0,placeholder:"href",prefix:o.createElement(y.A,null),onSelect:({target:e})=>{const{selectionStart:t,selectionEnd:l}=e;e&&s({target:e,selection:{start:t,end:l}})}}))),i.formLinkFieldInsertImageEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Actions with the chosen text")),o.createElement(u.A.Item,null,o.createElement(f.Ay,{icon:o.createElement(wt.A,null),onClick:()=>{return e="add_img",void l({operation:O.Ru.SANDBOX_ELEMENT_TEXT,action:e});var e}},t("Add inline image")))),o.createElement(ot,{form:a,elementSettings:e,showAddParagraph:!1,linkTarget:m})))},Tt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[l]=u.A.useForm(),a=(0,n.wA)(),i=(0,n.d4)(d.Hs),r=(0,D.XW)(),s=(0,n.d4)(Oe.Ct),c=(0,n.d4)(Oe.CS),h=(0,n.d4)(Oe.Fv),f=(0,n.d4)(Oe.yy),v=h&&"bottom"!==f,A=i.hasOwnProperty("type")?O.IE:O.Tm;(0,o.useEffect)((()=>{var t,o,a,i,r,n,d;e&&l.setFieldsValue({...e,height:null===(t=e.height)||void 0===t?void 0:t.value,heightDim:null===(o=e.height)||void 0===o?void 0:o.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)})}),[l,e]);const _=(0,o.useCallback)((e=>{a(A===O.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[a,A]);return o.createElement(u.A,{form:l,layout:"vertical",name:"selected_vindent_form",initialValues:{height:"",heightDim:"",mobileHeight:"",mobileHeightDim:""},onValuesChange:t=>{const o=l.getFieldsValue(!0),a=Object.keys(t)[0];let i;switch(a){case"height":i={[a]:{value:t[a],dim:o.heightDim}};break;case"heightDim":i={height:{value:o.height,dim:t[a]}};break;case"mobileHeight":i={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:o.mobileHeightDim}};break;case"mobileHeightDim":i={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[a]}};break;default:i=t}r({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:i}),_({...e,...i,activateSection:null,changeKey:a})},autoComplete:"off"},!v&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),s===O.ND&&c.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:s===O.ND&&c.styles?"block":"none",marginBottom:10}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:10,style:{marginBottom:20}},o.createElement(E.A,{span:12},o.createElement(Z,{form:l,name:"mobileHeight",elementSettings:e}))))):o.createElement("div",{id:"selected_element_form_desktop_props",style:{display:s===O.ND&&c.styles?"none":"block"}},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:14},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Indent height"),prefix:o.createElement(B.A,null),addonAfter:"px"})))))))};var Nt=l(50078),It=l(35850);const Pt=({form:e,elementSettings:t})=>{const{__:l}=(0,L.s9)(),a=(0,D.XW)(),[i,r]=(0,o.useState)(t.direction),n=l=>{const o=l.target.value,n={direction:""};o!==i?r(o):(r(""),e.setFieldsValue(n),a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:n}))};return o.createElement(u.A.Item,{name:"direction"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"top",title:l("Right to left")},o.createElement(C.Ay.Button,{value:"rtl",onClick:n},o.createElement(Nt.A,null))),o.createElement(p.A,{placement:"top",title:l("Left to right")},o.createElement(C.Ay.Button,{value:"ltr",onClick:n},o.createElement(It.A,null))))))};Pt.defaultProps={};const Ct=Pt,{useToken:Lt}=c.A,Ft=({form:e,elementSettings:t,mobilePaddingsExt:l,setMobilePaddingsExt:a})=>{const{__:i}=(0,L.s9)(),{token:n}=Lt(),d=(0,D.XW)();return o.createElement(o.Fragment,null,o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:l?"block":"none"}},o.createElement(p.A,{title:i("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingLeftRight"},o.createElement(W.A,{min:0,placeholder:i("Horizontal"),prefix:o.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:l?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:i("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingLeft",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(W.A,{min:0,placeholder:i("Left"),prefix:o.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:i("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingRight"},o.createElement(W.A,{min:0,placeholder:i("Right"),prefix:o.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:l?"block":"none"}},o.createElement(p.A,{title:i("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingTopBottom"},o.createElement(W.A,{min:0,placeholder:i("Vertical"),prefix:o.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:l?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:i("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingTop",style:{marginBottom:n.formItemMarginBottomXS}},o.createElement(W.A,{min:0,placeholder:i("Top"),prefix:o.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:i("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"mobilePaddingBottom"},o.createElement(W.A,{min:0,placeholder:i("Bottom"),prefix:o.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},o.createElement(p.A,{title:i("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!l}),onClick:()=>{a((e=>!e));const o=e.getFieldsValue(!0);l||(o.mobilePaddingLeftRight=o.mobilePaddingLeft,o.mobilePaddingTopBottom=o.mobilePaddingTop,o.mobilePaddingRight=o.mobilePaddingLeft,o.mobilePaddingBottom=o.mobilePaddingTop,d({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:{mobilePadding:{top:""!==o.mobilePaddingTop?o.mobilePaddingTop:null,bottom:""!==o.mobilePaddingTopBottom?o.mobilePaddingTopBottom:null,left:""!==o.mobilePaddingLeft?o.mobilePaddingLeft:null,right:""!==o.mobilePaddingRight?o.mobilePaddingRight:null,classNamePrefix:"em-mob-padding_"}}}))}},o.createElement(F.A,{icon:"PaddingSwitcher"})))))},Ot=({form:e,elementSettings:t})=>{var l;const{__:a}=(0,L.s9)(),[i,r]=(0,o.useState)(null===(l=t.mobileDirection)||void 0===l?void 0:l.value),n=(0,D.XW)(),d=l=>{const o=l.target.value,a={mobileDirection:{classNamePrefix:"em-mob-direction-",value:""}};o!==i?r(o):(r(""),e.setFieldsValue(a),n({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:t.type,settings:a}))};return o.createElement(u.A.Item,{name:"mobileDirection"},o.createElement(C.Ay.Group,null,o.createElement(A.A,{size:8},o.createElement(p.A,{placement:"top",title:a("Right to left")},o.createElement(C.Ay.Button,{value:"rtl",onClick:d},o.createElement(Nt.A,null))),o.createElement(p.A,{placement:"top",title:a("Left to right")},o.createElement(C.Ay.Button,{value:"ltr",onClick:d},o.createElement(It.A,null))))))};Ot.defaultProps={};const Dt=Ot,{Option:Mt}=X.A,Vt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(Mt,{value:"px"},"px"),o.createElement(Mt,{value:"%"},"%")),{useToken:zt}=c.A,Ht=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),a=(0,n.wA)(),[i]=u.A.useForm(),[s,c]=(0,o.useState)(""),[v,y]=(0,o.useState)({}),[w,R]=(0,o.useState)(!0),[T,C]=(0,o.useState)(!0),M=(0,n.d4)(Oe.Ct),V=(0,n.d4)(Oe.CS),H=(0,n.d4)(d.Hs),j=(0,Ve.rD)(),[$,Y]=(0,o.useState)(""===e.backgroundImage[0].value),{token:K}=zt(),J=(0,n.d4)(Oe.Fv),ee=(0,n.d4)(Oe.yy),te=J&&"bottom"!==ee,[le,oe]=(0,o.useState)(!1),[ae,ie]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[de,me]=(0,o.useState)(!1),[se,ce]=(0,o.useState)(!1),[ue,be]=(0,o.useState)(!1),[Ee,he]=(0,o.useState)(!1),[ve,Ae]=(0,o.useState)(!1),[_e,ye]=(0,o.useState)(!1),[Se,Be]=(0,o.useState)(!1),[ke,xe]=(0,o.useState)(!1),[we,Re]=(0,o.useState)(!1),[Te,Ne]=(0,o.useState)(!1),[Ie,Ce]=(0,o.useState)(!1),Le=H.hasOwnProperty("type")?O.IE:O.Tm,Fe=[{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"}],De=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}],Me=e.border,ze=e.mobileBorder,He=Object.keys(Me).find((e=>{var t,l,o;return(null===(t=Me[e])||void 0===t?void 0:t.width)||(null===(l=Me[e])||void 0===l?void 0:l.style)||(null===(o=Me[e])||void 0===o?void 0:o.color)})),We=Object.keys(ze).find((e=>{var t,l,o;return(null===(t=ze[e])||void 0===t?void 0:t.width)||(null===(l=ze[e])||void 0===l?void 0:l.style)||(null===(o=ze[e])||void 0===o?void 0:o.color)})),Ge=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,a,r,n,d,m,s,c,u,p,g,b,E,h,f,v,A,_,S,B,k,x,w,T,N,I,P,L,F,O,D,M,V,z,H,j,W,G,U,X,q,$,K,Q,J,Z,ee,te,le,ae,re,de,se,ue,pe,ge,Ee,fe,ve,_e,Se,ke,we,Te,Ie,Pe,Le,Fe,Oe,De,Me,Ve,ze,Ue,Xe,qe,$e,Ye,Ke,Qe,Je,Ze,et,tt,lt,ot,at,it,rt,nt,dt,mt;const st=e.boxShadow;y(st),i.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.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,borderAll:(0,je.ok)(e.border.all),borderTop:(0,je.ok)(e.border.top),borderBottom:(0,je.ok)(e.border.bottom),borderRight:(0,je.ok)(e.border.right),borderLeft:(0,je.ok)(e.border.left),mobileBorderAll:Ge(e.mobileBorder.all)||!(Ge(e.mobileBorder.top)||Ge(e.mobileBorder.bottom)||Ge(e.mobileBorder.right)||Ge(e.mobileBorder.left))&&Ge(e.border.all),mobileBorderTop:Ge(e.mobileBorder.top)||!Ge(e.mobileBorder.all)&&Ge(e.border.top),mobileBorderBottom:Ge(e.mobileBorder.bottom)||!Ge(e.mobileBorder.all)&&Ge(e.border.bottom),mobileBorderRight:Ge(e.mobileBorder.right)||!Ge(e.mobileBorder.all)&&Ge(e.border.right),mobileBorderLeft:Ge(e.mobileBorder.left)||!Ge(e.mobileBorder.all)&&Ge(e.border.left),paddingTop:(0,je.ok)(null===(r=e.padding)||void 0===r?void 0:r.all)||(0,je.ok)(null===(n=e.padding)||void 0===n?void 0:n.top),paddingLeft:(0,je.ok)(null===(d=e.padding)||void 0===d?void 0:d.all)||(0,je.ok)(null===(m=e.padding)||void 0===m?void 0:m.left),paddingRight:(0,je.ok)(null===(s=e.padding)||void 0===s?void 0:s.all)||(0,je.ok)(null===(c=e.padding)||void 0===c?void 0:c.right),paddingBottom:(0,je.ok)(null===(u=e.padding)||void 0===u?void 0:u.all)||(0,je.ok)(null===(p=e.padding)||void 0===p?void 0:p.bottom),paddingLeftRight:(0,je.ok)(null===(g=e.padding)||void 0===g?void 0:g.left)||(0,je.ok)(null===(b=e.padding)||void 0===b?void 0:b.right),paddingTopBottom:(0,je.ok)(null===(E=e.padding)||void 0===E?void 0:E.top)||(0,je.ok)(null===(h=e.padding)||void 0===h?void 0:h.bottom),borderRadiusAll:(0,je.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,je.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,je.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,je.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,je.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,je.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.inset)||!1,boxShadowHOffset:(0,je.ok)(null===(v=e.boxShadow)||void 0===v?void 0:v.hOffset),boxShadowVOffset:(0,je.ok)(null===(A=e.boxShadow)||void 0===A?void 0:A.vOffset),boxShadowBlurRadius:(0,je.ok)(null===(_=e.boxShadow)||void 0===_?void 0:_.blurRadius),boxShadowSpreadRadius:(0,je.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.spreadRadius),boxShadowColor:(0,je.ok)(null===(B=e.boxShadow)||void 0===B?void 0:B.color),mobileWidth:(0,je.xc)(null===(k=e.mobileWidth)||void 0===k?void 0:k.value)||(0,je.xc)(null===(x=e.width)||void 0===x?void 0:x.value),mobileWidthDim:(0,je.xc)(null===(w=e.mobileWidth)||void 0===w?void 0:w.value)?null===(T=e.mobileWidth)||void 0===T?void 0:T.dim:null===(N=e.width)||void 0===N?void 0:N.dim,mobileHeight:(0,je.xc)(null===(I=e.mobileHeight)||void 0===I?void 0:I.value)||(0,je.xc)(null===(P=e.height)||void 0===P?void 0:P.value),mobileHeightDim:(0,je.xc)(null===(L=e.mobileHeight)||void 0===L?void 0:L.value)?null===(F=e.mobileHeight)||void 0===F?void 0:F.dim:null===(O=e.height)||void 0===O?void 0:O.dim,mobileBorderRadiusAll:(0,je.ok)(null===(D=e.mobileBorderRadius)||void 0===D?void 0:D.all)||(0,je.ok)(null===(M=e.borderRadius)||void 0===M?void 0:M.all),mobileBorderRadiusTopLeft:(0,je.ok)(null===(V=e.mobileBorderRadius)||void 0===V?void 0:V.topLeft)||(0,je.ok)(null===(z=e.mobileBorderRadius)||void 0===z?void 0:z.all)||(0,je.ok)(null===(H=e.borderRadius)||void 0===H?void 0:H.topLeft)||(0,je.ok)(null===(j=e.borderRadius)||void 0===j?void 0:j.all),mobileBorderRadiusBottomLeft:(0,je.ok)(null===(W=e.mobileBorderRadius)||void 0===W?void 0:W.bottomLeft)||(0,je.ok)(null===(G=e.mobileBorderRadius)||void 0===G?void 0:G.all)||(0,je.ok)(null===(U=e.borderRadius)||void 0===U?void 0:U.bottomLeft)||(0,je.ok)(null===(X=e.borderRadius)||void 0===X?void 0:X.all),mobileBorderRadiusTopRight:(0,je.ok)(null===(q=e.mobileBorderRadius)||void 0===q?void 0:q.topRight)||(0,je.ok)(null===($=e.mobileBorderRadius)||void 0===$?void 0:$.all)||(0,je.ok)(null===(K=e.borderRadius)||void 0===K?void 0:K.topRight)||(0,je.ok)(null===(Q=e.borderRadius)||void 0===Q?void 0:Q.all),mobileBorderRadiusBottomRight:(0,je.ok)(null===(J=e.mobileBorderRadius)||void 0===J?void 0:J.bottomRight)||(0,je.ok)(null===(Z=e.mobileBorderRadius)||void 0===Z?void 0:Z.all)||(0,je.ok)(null===(ee=e.borderRadius)||void 0===ee?void 0:ee.bottomRight)||(0,je.ok)(null===(te=e.borderRadius)||void 0===te?void 0:te.all),mobileBoxShadowInset:null!=(null===(le=e.mobileBoxShadow)||void 0===le?void 0:le.inset)?e.mobileBoxShadow.inset:(null===(ae=e.boxShadow)||void 0===ae?void 0:ae.inset)||!1,mobileBoxShadowHOffset:(0,je.ok)(null===(re=e.mobileBoxShadow)||void 0===re?void 0:re.hOffset)||(0,je.ok)(null===(de=e.boxShadow)||void 0===de?void 0:de.hOffset),mobileBoxShadowVOffset:(0,je.ok)(null===(se=e.mobileBoxShadow)||void 0===se?void 0:se.vOffset)||(0,je.ok)(null===(ue=e.boxShadow)||void 0===ue?void 0:ue.vOffset),mobileBoxShadowBlurRadius:(0,je.ok)(null===(pe=e.mobileBoxShadow)||void 0===pe?void 0:pe.blurRadius)||(0,je.ok)(null===(ge=e.boxShadow)||void 0===ge?void 0:ge.blurRadius),mobileBoxShadowSpreadRadius:(0,je.ok)(null===(Ee=e.mobileBoxShadow)||void 0===Ee?void 0:Ee.spreadRadius)||(0,je.ok)(null===(fe=e.boxShadow)||void 0===fe?void 0:fe.spreadRadius),mobileBoxShadowColor:(0,je.ok)(null===(ve=e.mobileBoxShadow)||void 0===ve?void 0:ve.color)||(0,je.ok)(null===(_e=e.boxShadow)||void 0===_e?void 0:_e.color),mobileAlign:(0,je.ok)(null===(Se=e.mobileAlign)||void 0===Se?void 0:Se.value)||e.align,mobileVerticalAlign:(0,je.ok)((null===(ke=e.mobileVerticalAlign)||void 0===ke?void 0:ke.value)||e.valign),mobileBackgroundColor:(0,je.ok)((null===(we=e.mobileBackgroundColor)||void 0===we?void 0:we.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(Te=e.mobileBackgroundImage[0])||void 0===Te?void 0:Te.value)?null===(Ie=e.mobileBackgroundImage[0])||void 0===Ie?void 0:Ie.value:(null===(Pe=e.backgroundImage)||void 0===Pe?void 0:Pe[0].value)||"",mobileBackgroundPositionX:(0,je.ok)(null===(Le=e.mobileBackgroundPositionX)||void 0===Le?void 0:Le.value)||(0,je.ok)(null===(Fe=e.backgroundPositionX)||void 0===Fe?void 0:Fe.value),mobileBackgroundPositionY:(0,je.ok)(null===(Oe=e.mobileBackgroundPositionY)||void 0===Oe?void 0:Oe.value)||(0,je.ok)(null===(De=e.backgroundPositionY)||void 0===De?void 0:De.value),mobileBackgroundRepeat:!(null===(Me=e.mobileBackgroundRepeat)||void 0===Me||!Me.value)||e.backgroundRepeat||"none",mobilePaddingTop:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.top)||(0,je.ok)(null===(Ve=e.padding)||void 0===Ve?void 0:Ve.all)||(0,je.ok)(null===(ze=e.padding)||void 0===ze?void 0:ze.top),mobilePaddingLeft:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.left)||(0,je.ok)(null===(Ue=e.padding)||void 0===Ue?void 0:Ue.all)||(0,je.ok)(null===(Xe=e.padding)||void 0===Xe?void 0:Xe.left),mobilePaddingRight:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.right)||(0,je.ok)(null===(qe=e.padding)||void 0===qe?void 0:qe.all)||(0,je.ok)(null===($e=e.padding)||void 0===$e?void 0:$e.right),mobilePaddingBottom:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.bottom)||(0,je.ok)(null===(Ye=e.padding)||void 0===Ye?void 0:Ye.all)||(0,je.ok)(null===(Ke=e.padding)||void 0===Ke?void 0:Ke.bottom),mobilePaddingTopBottom:(0,je.ok)(e.mobilePadding.top)||(0,je.ok)(e.mobilePadding.bottom)||(0,je.ok)(null===(Qe=e.padding)||void 0===Qe?void 0:Qe.top)||(0,je.ok)(null===(Je=e.padding)||void 0===Je?void 0:Je.bottom),mobilePaddingLeftRight:(0,je.ok)(e.mobilePadding.left)||(0,je.ok)(e.mobilePadding.right)||(0,je.ok)(null===(Ze=e.padding)||void 0===Ze?void 0:Ze.left)||(0,je.ok)(null===(et=e.padding)||void 0===et?void 0:et.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,je.ok)(e.borderRadius.all)&&((0,je.ok)(e.borderRadius.topLeft)||(0,je.ok)(e.borderRadius.bottomLeft)||(0,je.ok)(e.borderRadius.topRight)||(0,je.ok)(e.borderRadius.bottomRight))?R(!1):R(!0),!(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight))||(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight))||!(0,je.ok)(e.borderRadius.all)&&!(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.borderRadius.topLeft)||(0,je.ok)(e.borderRadius.bottomLeft)||(0,je.ok)(e.borderRadius.topRight)||(0,je.ok)(e.borderRadius.bottomRight))?C(!1):C(!0),Y(""===e.backgroundImage[0].value),(0,je.ok)(e.padding.all)||!((0,je.ok)(e.padding.top)||(0,je.ok)(e.padding.right)||(0,je.ok)(e.padding.bottom)||(0,je.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?oe(!0):oe(!1),!(0,je.ok)(e.mobilePadding.all)&&((0,je.ok)(e.mobilePadding.top)||(0,je.ok)(e.mobilePadding.right)||(0,je.ok)(e.mobilePadding.bottom)||(0,je.ok)(e.mobilePadding.left))&&(e.mobilePadding.top!==e.mobilePadding.bottom||e.mobilePadding.right!==e.mobilePadding.left)||!(0,je.ok)(null===(tt=e.padding)||void 0===tt?void 0:tt.all)&&((0,je.ok)(null===(lt=e.padding)||void 0===lt?void 0:lt.top)||(0,je.ok)(null===(ot=e.padding)||void 0===ot?void 0:ot.right)||(0,je.ok)(null===(at=e.padding)||void 0===at?void 0:at.bottom)||(0,je.ok)(null===(it=e.padding)||void 0===it?void 0:it.left))&&((null===(rt=e.padding)||void 0===rt?void 0:rt.top)!==(null===(nt=e.padding)||void 0===nt?void 0:nt.bottom)||(null===(dt=e.padding)||void 0===dt?void 0:dt.right)!==(null===(mt=e.padding)||void 0===mt?void 0:mt.left))?ie(!1):ie(!0),ne(!!He),me(!!He||!!We),ce(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),be(!!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),he(!!e.boxShadow),Ae(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset||!!e.boxShadow),ye(!!e.width.value&&"column"!==e.type||!!e.height.value),Be(!!e.mobileWidth.value||!!e.mobileHeight.value||!!e.width.value&&"column"!==e.type||!!e.height.value),xe(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Re(!!e.mobileBackgroundColor.value||!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Ne(!!e.exportAsPicture||!!e.isContrastBlock),Ce(!!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 Ue=(0,o.useCallback)((e=>{a(Le===O.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[a,Le]);return o.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:je.uE[He]||"borderAll",mobileBorderPosition:je.lS[We]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",boxShadowInset:"",boxShadowHOffset:"",boxShadowVOffset:"",boxShadowBlurRadius:"",boxShadowSpreadRadius:"",boxShadowColor:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",textStrong:!1,textItalic:!1,textStrikethrough:!1,textUnderline:!1},onValuesChange:t=>{const o=i.getFieldsValue(!0),a=Object.keys(t)[0];let r;switch(c("%"===i.getFieldsValue(!0).widthDim?100:""),a){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"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var n,d,m;if("borderAll"===o.borderPosition)r={border:{...O.iV,all:{...je.RH,...o.borderAll}}},i.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(n=o.borderAll)&&void 0!==n&&n.width||null!==(d=o.borderAll)&&void 0!==d&&d.style||null!==(m=o.borderAll)&&void 0!==m&&m.color?(r={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[je.Vz[a]]:{...o[a],...t[a]}}},i.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[a]:{...o[a],...t[a]}})):(r={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[je.Vz[a]]:{...o[a],...t[a]}}},i.setFieldsValue({border:r.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var s,u,p;if("mobileBorderAll"===o.mobileBorderPosition)r={mobileBorder:{...O.iV,all:{...je.RH,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+je.ax[a]+"-"}}},i.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(s=o.mobileBorder.all)&&void 0!==s&&s.width||null!==(u=o.mobileBorder.all)&&void 0!==u&&u.style||null!==(p=o.mobileBorder.all)&&void 0!==p&&p.color?(r={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[je.ax[a]]:{...o[a],...t[a],classNamePrefix:"em-mob-border_"+je.ax[a]+"-"}}},i.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[a]:{...o[a],...t[a]}})):(r={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[je.ax[a]]:{...o[a],...t[a],classNamePrefix:"em-mob-border_"+je.ax[a]+"-"}}},i.setFieldsValue({mobileBorder:r.mobileBorder}));break;case"width":r={[a]:{value:t[a],dim:o.widthDim}};break;case"height":r={[a]:{value:t[a],dim:o.heightDim}};break;case"widthDim":r={width:{value:o.width,dim:t[a]}};break;case"heightDim":r={height:{value:o.height,dim:t[a]}};break;case"backgroundImage":Y(""===t[a]),r={[a]:[{...e.backgroundImage[0],value:t[a]}],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,[je.yy[a]]:+t[a]}};break;case"paddingTopBottom":r={padding:{left:o.paddingLeft,right:o.paddingRight,top:+t[a],bottom:+t[a]}},o.paddingTop=o.paddingBottom=+t[a];break;case"paddingLeftRight":r={padding:{top:o.paddingTop,bottom:o.paddingBottom,left:+t[a],right:+t[a]}},o.paddingLeft=o.paddingRight=+t[a];break;case"borderRadiusAll":r={borderRadius:{[O.wF[a]]:+t[a]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{topLeft:o.borderRadiusTopLeft,bottomLeft:o.borderRadiusBottomLeft,topRight:o.borderRadiusTopRight,bottomRight:o.borderRadiusBottomRight,[O.wF[a]]:+t[a]}};break;case"mobileWidth":r={[a]:{classNamePrefix:"em-mob-width-",value:t[a],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[a]}};break;case"mobileHeight":r={[a]:{classNamePrefix:"em-mob-height-",value:t[a],dim:o.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[a]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[je.NW[a]]:t[a],classNamePrefix:"em-mob-border_radius_"+je.NW[a]+"-"}};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={[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:""!==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[a],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[a],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;default:r=t}var g;"borderPosition"!==a&&"mobileBorderPosition"!==a&&(l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),"mobileBorderRadiusAll"!==a&&"mobileBorderRadiusTopLeft"!==a&&"mobileBorderRadiusTopRight"!==a&&"mobileBorderRadiusBottomLeft"!==a&&"mobileBorderRadiusBottomRight"!==a&&Ue({...e,...r,mobileBorderRadius:{...e.mobileBorderRadius,...null===(g=r)||void 0===g?void 0:g.mobileBorderRadius},activateSection:null,changeKey:a}))},autoComplete:"off",className:"element-controls"},!te&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),M===O.ND&&V.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:M===O.ND&&V.styles?"block":"none"}},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:12},o.createElement(pe,{form:i,elementSettings:e,imgParent:!0})),j.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(ge,{form:i,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),j.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ce((e=>!e)),Ie&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},Ie?o.createElement(x.A,null):o.createElement(k.A,null)))),Ie&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,o.createElement(Ft,{form:i,elementSettings:e,mobilePaddingsExt:ae,setMobilePaddingsExt:ie}))),o.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&j.formCellFieldSizeEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Be((e=>!e)),Se&&(t.mobileWidth="",t.mobileHeight="",l({operation:O.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-"}}}))}))}},Se?o.createElement(x.A,null):o.createElement(k.A,null)))),Se&&o.createElement(b.A,{gutter:10,style:{paddingBottom:9}},"structure"!==e.type&&o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:15}},o.createElement(Q,{form:i,name:"mobileWidth",elementSettings:e}))),o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:15}},o.createElement(Z,{form:i,name:"mobileHeight",elementSettings:e})))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),t.mobileBackgroundColor=we?"":"#E5E5E5",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},we?o.createElement(x.A,null):o.createElement(k.A,null)))),we&&o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:(j.formCellFieldBackgroundImageEnabled,K.formItemMarginBottomMD+4)}},o.createElement(vt,{form:i,elementSettings:e,label:t("Background color")}))),!1,j.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{me((e=>!e)),de?(t.mobileBorderAll=je.RH,t.mobileBorderTop=je.RH,t.mobileBorderBottom=je.RH,t.mobileBorderRight=je.RH,t.mobileBorderLeft=je.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},de?o.createElement(x.A,null):o.createElement(k.A,null)))),de&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,typeOfForm:"mobile"}))),j.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),ue?(t.mobileBorderRadiusAll=null,C(!0)):t.mobileBorderRadiusAll=5,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},ue?o.createElement(x.A,null):o.createElement(k.A,null)))),ue&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:T,setOneBorderRadiusValue:C,elementSettings:e,typeOfForm:"mobile"}))),j.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve?(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"),l({operation:O.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-"}}})}))}},ve?o.createElement(x.A,null):o.createElement(k.A,null)))),ve&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v,typeOfForm:"mobile"}))),j.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:i})),"group"!==e.type&&o.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},o.createElement(Dt,{elementSettings:e,form:i})))),j.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(Ze.A,{form:i,elementSettings:e})),j.formCellFieldVerticalAlignEnabled&&"group"!==e.type&&("structure"!==e.type||"structure"===e.type&&1===e.floatBlocks.items.length)&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(z.A,{form:i,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),j.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("Padding")),o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,"group"!==e.type&&"column"!==e.type&&o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:le?"block":"none"}},o.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeftRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:o.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:le?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Left"),prefix:o.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Right"),prefix:o.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:"group"!==e.type&&"column"!==e.type?156:45,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:le?"block":"none"}},o.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTopBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Vertical"),prefix:o.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:le?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Top"),prefix:o.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Bottom"),prefix:o.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},o.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!le}),onClick:()=>{oe((e=>!e));const t=i.getFieldsValue(!0);le||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(F.A,{icon:"PaddingSwitcher"})))))),o.createElement(h.A,{className:"selected-td-form__divider"})),"group"!==e.type&&j.formCellFieldSizeEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ye((e=>!e)),_e&&(t.width="",t.height="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{width:{value:null,dim:"px"},height:{value:null,dim:"px"}}}))}))}},_e?o.createElement(x.A,null):o.createElement(k.A,null)))),_e&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},"structure"!==e.type&&"column"!==e.type&&o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:s,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Vt)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:t("Height"),placement:"bottom"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"}))))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{xe((e=>!e)),ke?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",Y(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:O.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}})}))}},ke?o.createElement(x.A,null):o.createElement(k.A,null)))),ke&&o.createElement(b.A,{gutter:10,style:{marginBottom:$?16:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:j.formCellFieldBackgroundImageEnabled?K.formItemMarginBottomXS:K.formItemMarginBottomMD+4}},o.createElement(G.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),j.formCellFieldBackgroundImageEnabled&&o.createElement(E.A,{span:$?12:24},o.createElement(N.A,{form:i,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"}),!$&&o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Horizontal position"),prefix:o.createElement(F.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Vertical position"),prefix:o.createElement(F.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:Fe,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:De,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),j.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re?(t.borderAll=je.RH,t.borderTop=je.RH,t.borderBottom=je.RH,t.borderRight=je.RH,t.borderLeft=je.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},re?o.createElement(x.A,null):o.createElement(k.A,null)))),re&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,elementSettings:e}))),j.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ce((e=>!e)),se?(t.borderRadiusAll=0,R(!0)):t.borderRadiusAll=5,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},se?o.createElement(x.A,null):o.createElement(k.A,null)))),se&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:w,setOneBorderRadiusValue:R,elementSettings:e}))),j.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{he((e=>!e)),Ee?(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"),l({operation:O.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}}})}))}},Ee?o.createElement(x.A,null):o.createElement(k.A,null)))),Ee&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v}))),j.formFieldExportAsPictureEnabled&&"group"!==e.type&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Settings"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ne((e=>!e)),Te&&(t.exportAsPicture=!1,t.isContrastBlock=!1,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1,isContrastBlock:!1}}))}))}},Te?o.createElement(x.A,null):o.createElement(k.A,null)))),Te&&o.createElement(o.Fragment,null,"structure"===e.type&&o.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"},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"isContrastBlock",valuePropName:"checked",style:{marginBottom:0}},o.createElement(q.A,{size:"small",id:"contrast-colors"})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"contrast-colors"},t("Contrast block"))))),o.createElement(yt,{form:i,elementSettings:e}))),j.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("group"!==e.type?"Display control & Direction":"Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:i})),"group"!==e.type&&o.createElement(E.A,{span:12,style:{textAlign:"group"!==e.type?"right":"left"}},o.createElement(Ct,{elementSettings:e,form:i})))),j.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))},{Option:jt}=X.A,Wt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(jt,{value:"px"},"px"),o.createElement(jt,{value:"%"},"%")),{useToken:Gt}=c.A,Ut=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),[i,d]=(0,o.useState)({}),[m,s]=(0,o.useState)(!0),[c,v]=(0,o.useState)({}),[A,y]=(0,o.useState)(!0),w=(0,n.d4)(Oe.Ct),R=(0,n.d4)(Oe.CS),T=(0,Ve.rD)(),[C,M]=(0,o.useState)(""===e.backgroundImage[0].value),{token:V}=Gt(),H=(0,n.d4)(Oe.Fv),j=(0,n.d4)(Oe.yy),q=H&&"bottom"!==j,[$,Y]=(0,o.useState)(!1),[K,J]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(!1),[le,oe]=(0,o.useState)(!1),[ae,ie]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[de,me]=(0,o.useState)(!1),[se,ce]=(0,o.useState)(!1),[ue,pe]=(0,o.useState)(!1),[be,Ee]=(0,o.useState)(!1),[he,ve]=(0,o.useState)(!1),[Ae,_e]=(0,o.useState)(!1),[ye,Se]=(0,o.useState)(!1),[Be,ke]=(0,o.useState)(!1),[xe,we]=(0,o.useState)(!1),[Re,Te]=(0,o.useState)(""),Ne=[{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"}],Ie=[{label:t("Not defined"),value:""},{label:t("Contain"),value:"contain"},{label:t("Cover"),value:"cover"}],Ce=e.border,Le=e.mobileBorder,Fe=Object.keys(Ce).find((e=>{var t,l,o;return(null===(t=Ce[e])||void 0===t?void 0:t.width)||(null===(l=Ce[e])||void 0===l?void 0:l.style)||(null===(o=Ce[e])||void 0===o?void 0:o.color)})),De=Object.keys(Le).find((e=>{var t,l,o;return(null===(t=Le[e])||void 0===t?void 0:t.width)||(null===(l=Le[e])||void 0===l?void 0:l.style)||(null===(o=Le[e])||void 0===o?void 0:o.color)})),Me=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,i,r,n,m,c,u,p,g,b,E,h,f,A,_,S,B,k,x,w,R,T,N,I,P,C,L,F,O,D,V,z,H,j,W,G,U,X,q,$;const K=e.boxShadow,Q=e.mobileBoxShadow;d(K),v(Q),a.setFieldsValue({...e,width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.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",borderAll:(0,je.ok)(e.border.all),borderTop:(0,je.ok)(e.border.top),borderBottom:(0,je.ok)(e.border.bottom),borderRight:(0,je.ok)(e.border.right),borderLeft:(0,je.ok)(e.border.left),mobileBorderAll:Me(e.mobileBorder.all)||!(Me(e.mobileBorder.top)||Me(e.mobileBorder.bottom)||Me(e.mobileBorder.right)||Me(e.mobileBorder.left))&&Me(e.border.all),mobileBorderTop:Me(e.mobileBorder.top)||!Me(e.mobileBorder.all)&&Me(e.border.top),mobileBorderBottom:Me(e.mobileBorder.bottom)||!Me(e.mobileBorder.all)&&Me(e.border.bottom),mobileBorderRight:Me(e.mobileBorder.right)||!Me(e.mobileBorder.all)&&Me(e.border.right),mobileBorderLeft:Me(e.mobileBorder.left)||!Me(e.mobileBorder.all)&&Me(e.border.left),paddingTop:(0,je.ok)(e.padding.all)||(0,je.ok)(e.padding.top),paddingLeft:(0,je.ok)(e.padding.all)||(0,je.ok)(e.padding.left),paddingRight:(0,je.ok)(e.padding.all)||(0,je.ok)(e.padding.right),paddingBottom:(0,je.ok)(e.padding.all)||(0,je.ok)(e.padding.bottom),paddingLeftRight:(0,je.ok)(null===(u=e.padding)||void 0===u?void 0:u.left)||(0,je.ok)(null===(p=e.padding)||void 0===p?void 0:p.right),paddingTopBottom:(0,je.ok)(null===(g=e.padding)||void 0===g?void 0:g.top)||(0,je.ok)(null===(b=e.padding)||void 0===b?void 0:b.bottom),borderRadiusAll:(0,je.ok)(e.borderRadius.all),borderRadiusTopLeft:(0,je.ok)(e.borderRadius.topLeft),borderRadiusBottomLeft:(0,je.ok)(e.borderRadius.bottomLeft),borderRadiusTopRight:(0,je.ok)(e.borderRadius.topRight),borderRadiusBottomRight:(0,je.ok)(e.borderRadius.bottomRight),boxShadowInset:(0,je.ok)(null===(E=e.boxShadow)||void 0===E?void 0:E.inset)||!1,boxShadowHOffset:(0,je.ok)(null===(h=e.boxShadow)||void 0===h?void 0:h.hOffset),boxShadowVOffset:(0,je.ok)(null===(f=e.boxShadow)||void 0===f?void 0:f.vOffset),boxShadowBlurRadius:(0,je.ok)(null===(A=e.boxShadow)||void 0===A?void 0:A.blurRadius),boxShadowSpreadRadius:(0,je.ok)(null===(_=e.boxShadow)||void 0===_?void 0:_.spreadRadius),boxShadowColor:(0,je.ok)(null===(S=e.boxShadow)||void 0===S?void 0:S.color),mobileWidth:(0,je.xc)(null===(B=e.mobileWidth)||void 0===B?void 0:B.value),mobileWidthDim:null===(k=e.mobileWidth)||void 0===k?void 0:k.dim,mobileHeight:(0,je.xc)(null===(x=e.mobileHeight)||void 0===x?void 0:x.value),mobileHeightDim:null===(w=e.mobileHeight)||void 0===w?void 0:w.dim,mobileBorderRadiusAll:(0,je.ok)(e.mobileBorderRadius.all),mobileBorderRadiusTopLeft:(0,je.ok)(null!==e.mobileBorderRadius.topLeft?e.mobileBorderRadius.topLeft:e.mobileBorderRadius.all),mobileBorderRadiusBottomLeft:(0,je.ok)(null!==e.mobileBorderRadius.bottomLeft?e.mobileBorderRadius.bottomLeft:e.mobileBorderRadius.all),mobileBorderRadiusTopRight:(0,je.ok)(null!==e.mobileBorderRadius.topRight?e.mobileBorderRadius.topRight:e.mobileBorderRadius.all),mobileBorderRadiusBottomRight:(0,je.ok)(null!==e.mobileBorderRadius.bottomRight?e.mobileBorderRadius.bottomRight:e.mobileBorderRadius.all),mobileBoxShadowInset:(0,je.ok)(null===(R=e.mobileBoxShadow)||void 0===R?void 0:R.inset)||!1,mobileBoxShadowHOffset:(0,je.ok)(null===(T=e.mobileBoxShadow)||void 0===T?void 0:T.hOffset),mobileBoxShadowVOffset:(0,je.ok)(null===(N=e.mobileBoxShadow)||void 0===N?void 0:N.vOffset),mobileBoxShadowBlurRadius:(0,je.ok)(null===(I=e.mobileBoxShadow)||void 0===I?void 0:I.blurRadius),mobileBoxShadowSpreadRadius:(0,je.ok)(null===(P=e.mobileBoxShadow)||void 0===P?void 0:P.spreadRadius),mobileBoxShadowColor:(0,je.ok)(null===(C=e.mobileBoxShadow)||void 0===C?void 0:C.color),mobileAlign:(0,je.ok)(null===(L=e.mobileAlign)||void 0===L?void 0:L.value),mobileVerticalAlign:(0,je.ok)(null===(F=e.mobileVerticalAlign)||void 0===F?void 0:F.value),mobileDirection:(0,je.ok)(null===(O=e.mobileDirection)||void 0===O?void 0:O.value),mobileBackgroundColor:(0,je.ok)("none"!==(null===(D=e.mobileBackgroundColor)||void 0===D?void 0:D.value)?null===(V=e.mobileBackgroundColor)||void 0===V?void 0:V.value:""),mobileBackgroundImage:"none"!==e.mobileBackgroundImage[0].value?e.mobileBackgroundImage[0].value:"",mobileBackgroundPositionX:(0,je.ok)(null===(z=e.mobileBackgroundPositionX)||void 0===z?void 0:z.value),mobileBackgroundPositionY:(0,je.ok)(null===(H=e.mobileBackgroundPositionY)||void 0===H?void 0:H.value),mobileBackgroundRepeat:null!==(j=e.mobileBackgroundRepeat)&&void 0!==j&&j.value?null===(W=e.mobileBackgroundRepeat)||void 0===W?void 0:W.value:"none",mobilePaddingTop:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.top),mobilePaddingLeft:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.left),mobilePaddingRight:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.right),mobilePaddingBottom:(0,je.ok)(e.mobilePadding.all)||(0,je.ok)(e.mobilePadding.bottom),mobilePaddingTopBottom:(0,je.ok)(e.mobilePadding.top)||(0,je.ok)(e.mobilePadding.bottom),mobilePaddingLeftRight:(0,je.ok)(e.mobilePadding.left)||(0,je.ok)(e.mobilePadding.right),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture}),!(0,je.ok)(e.borderRadius.all)&&((0,je.ok)(e.borderRadius.topLeft)||(0,je.ok)(e.borderRadius.bottomLeft)||(0,je.ok)(e.borderRadius.topRight)||(0,je.ok)(e.borderRadius.bottomRight))?s(!1):s(!0),!(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight))?y(!1):y(!0),M(""===e.backgroundImage[0].value),(0,je.ok)(e.padding.all)||!((0,je.ok)(e.padding.top)||(0,je.ok)(e.padding.right)||(0,je.ok)(e.padding.bottom)||(0,je.ok)(e.padding.left))||e.padding.top===e.padding.bottom&&e.padding.right===e.padding.left?Y(!0):Y(!1),(0,je.ok)(e.mobilePadding.all)||!((0,je.ok)(e.mobilePadding.top)||(0,je.ok)(e.mobilePadding.right)||(0,je.ok)(e.mobilePadding.bottom)||(0,je.ok)(e.mobilePadding.left))||e.mobilePadding.top===e.mobilePadding.bottom&&e.mobilePadding.right===e.mobilePadding.left?J(!0):J(!1),te(!!Fe),oe(!!Fe||!!De),ie(!!e.borderRadius.all||!!e.borderRadius.topLeft||!!e.borderRadius.bottomLeft||!!e.borderRadius.topRight||!!e.borderRadius.bottomRight),ne(!!e.mobileBorderRadius.all||!!e.mobileBorderRadius.topLeft||!!e.mobileBorderRadius.bottomLeft||!!e.mobileBorderRadius.topRight||!!e.mobileBorderRadius.bottomRight),me(!!e.boxShadow),ce(!!e.mobileBoxShadow.blurRadius||!!e.mobileBoxShadow.color||!!e.mobileBoxShadow.hOffset||!!e.mobileBoxShadow.inset||!!e.mobileBoxShadow.spreadRadius||!!e.mobileBoxShadow.vOffset),pe(!!e.width.value||!!e.height.value||!!e.minWidth.value||!!e.maxWidth.value),Ee(!!e.mobileWidth.value||!!e.mobileHeight.value),ve(!!e.backgroundColor||!!e.backgroundImage[0].value||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),_e(!!e.mobileBackgroundColor.value),Se(!!e.exportAsPicture),ke(!(null===(G=e.padding)||void 0===G||!G.all)||!(null===(U=e.padding)||void 0===U||!U.top)||!(null===(X=e.padding)||void 0===X||!X.bottom)||!(null===(q=e.padding)||void 0===q||!q.left)||!(null===($=e.padding)||void 0===$||!$.right)),we(!!e.mobilePadding.all||!!e.mobilePadding.top||!!e.mobilePadding.bottom||!!e.mobilePadding.left||!!e.mobilePadding.right)}}),[a,e]);return o.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:je.uE[Fe]||"borderAll",mobileBorderPosition:je.lS[De]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",direction:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileDirection:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:""},onValuesChange:t=>{const o=a.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(Te("%"===a.getFieldsValue(!0).widthDim?100:""),i){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"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var n,d,m;if("borderAll"===o.borderPosition)r={border:{...O.iV,all:{...je.RH,...o.borderAll}}},a.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(n=o.borderAll)&&void 0!==n&&n.width||null!==(d=o.borderAll)&&void 0!==d&&d.style||null!==(m=o.borderAll)&&void 0!==m&&m.color?(r={border:{all:null,left:o.borderAll,right:o.borderAll,top:o.borderAll,bottom:o.borderAll,[je.Vz[i]]:{...o[i],...t[i]}}},a.setFieldsValue({borderAll:null,borderLeft:o.borderAll,borderRight:o.borderAll,borderTop:o.borderAll,borderBottom:o.borderAll,[i]:{...o[i],...t[i]}})):(r={border:{all:null,left:o.borderLeft,right:o.borderRight,top:o.borderTop,bottom:o.borderBottom,[je.Vz[i]]:{...o[i],...t[i]}}},a.setFieldsValue({border:r.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var s,c,u;if("mobileBorderAll"===o.mobileBorderPosition)r={mobileBorder:{...O.iV,all:{...je.RH,...o.mobileBorderAll,classNamePrefix:"em-mob-border_"+je.ax[i]+"-"}}},a.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(s=o.mobileBorder.all)&&void 0!==s&&s.width||null!==(c=o.mobileBorder.all)&&void 0!==c&&c.style||null!==(u=o.mobileBorder.all)&&void 0!==u&&u.color?(r={mobileBorder:{all:null,left:o.mobileBorderAll,right:o.mobileBorderAll,top:o.mobileBorderAll,bottom:o.mobileBorderAll,[je.ax[i]]:{...o[i],...t[i],classNamePrefix:"em-mob-border_"+je.ax[i]+"-"}}},a.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:o.mobileBorderAll,mobileBorderRight:o.mobileBorderAll,mobileBorderTop:o.mobileBorderAll,mobileBorderBottom:o.mobileBorderAll,[i]:{...o[i],...t[i]}})):(r={mobileBorder:{all:null,left:o.mobileBorderLeft,right:o.mobileBorderRight,top:o.mobileBorderTop,bottom:o.mobileBorderBottom,[je.ax[i]]:{...o[i],...t[i],classNamePrefix:"em-mob-border_"+je.ax[i]+"-"}}},a.setFieldsValue({mobileBorder:r.mobileBorder}));case"width":r={[i]:{value:t[i],dim:o.widthDim}};break;case"height":r={[i]:{value:t[i],dim:o.heightDim}};break;case"widthDim":r={width:{value:o.width,dim:t[i]}};break;case"heightDim":r={height:{value:o.height,dim:t[i]}};break;case"maxWidth":r={[i]:{value:t[i],dim:o.maxWidthDim}};break;case"maxWidthDim":r={maxWidth:{value:o.maxWidth,dim:t[i]}};break;case"minWidth":r={[i]:{value:t[i],dim:o.minWidthDim}};break;case"minWidthDim":r={minWidth:{value:o.minWidth,dim:t[i]}};break;case"backgroundImage":M(""===t[i]),r={[i]:[{...e.backgroundImage[0],value:t[i]}],backgroundSize:"cover"};break;case"paddingTop":case"paddingLeft":case"paddingRight":case"paddingBottom":r={padding:{[je.yy[i]]:+t[i]}};break;case"paddingTopBottom":r={padding:{top:+t[i],bottom:+t[i]}},o.paddingTop=o.paddingBottom=+t[i];break;case"paddingLeftRight":r={padding:{left:+t[i],right:+t[i]}},o.paddingLeft=o.paddingRight=+t[i];break;case"borderRadiusAll":case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{[O.wF[i]]:+t[i]}};break;case"mobileWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[i]}};break;case"mobileHeight":r={[i]:{classNamePrefix:"em-mob-height-",value:t[i],dim:o.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:o.mobileHeight,dim:t[i]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[je.NW[i]]:t[i],classNamePrefix:"em-mob-border_radius_"+je.NW[i]+"-"}};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={[i]:{classNamePrefix:"em-mob-text_align-",value:t[i]}};break;case"mobileVerticalAlign":r={[i]:{classNamePrefix:"em-mob-vertical_align-",value:t[i]}};break;case"mobileBackgroundColor":r={[i]:{classNamePrefix:"em-mob-background_color-",value:t[i]}};break;case"mobileBackgroundImage":r={[i]:[{...e.mobileBackgroundImage[0],classNamePrefix:"em-mob-background_image-",value:t[i]}]};break;case"mobileBackgroundPositionX":r={[i]:{classNamePrefix:"em-mob-background_position_x-",value:t[i]}};break;case"mobileBackgroundPositionY":r={[i]:{classNamePrefix:"em-mob-background_position_x-",value:t[i]}};break;case"mobileBackgroundRepeat":r={[i]:{classNamePrefix:"em-mob-background_repeat-",value:t[i]}};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[i],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[i],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"mobileDirection":r={[i]:{classNamePrefix:"em-mob-direction-",value:t[i]}};break;default:r=t}"borderPosition"!==i&&"mobileBorderPosition"!==i&&l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off",className:"element-controls"},!q&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),w===O.ND&&R.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(mt,{form:a,elementSettings:e,imgParent:!0})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(ge,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),T.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{we((e=>!e)),xe&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobilePadding:{all:null,top:null,right:null,bottom:null,left:null,classNamePrefix:"em-mob-padding_"}}}))}))}},xe?o.createElement(x.A,null):o.createElement(k.A,null)))),xe&&o.createElement(b.A,{gutter:10,style:{paddingBottom:4}},o.createElement(o.Fragment,null,o.createElement(Ft,{form:a,elementSettings:e,mobilePaddingsExt:K,setMobilePaddingsExt:J})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{Ee((e=>!e))}))}},be?o.createElement(x.A,null):o.createElement(k.A,null)))),be&&o.createElement(b.A,{gutter:10,style:{paddingBottom:8}},o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:2*V.formItemMarginBottomXS}},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e}))),o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(Z,{form:a,name:"mobileHeight",elementSettings:e})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{_e((e=>!e)),t.mobileBackgroundColor=Ae?"":"#E5E5E5",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Ae?o.createElement(x.A,null):o.createElement(k.A,null)))),Ae&&o.createElement("div",{style:{marginBottom:(T.formDivFieldBackgroundImageEnabled,V.formItemMarginBottomMD+4)}},o.createElement(vt,{form:a,elementSettings:e,label:t("Background color")})),!1,T.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{oe((e=>!e)),le?(t.mobileBorderAll=je.RH,t.mobileBorderTop=je.RH,t.mobileBorderBottom=je.RH,t.mobileBorderRight=je.RH,t.mobileBorderLeft=je.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},le?o.createElement(x.A,null):o.createElement(k.A,null)))),le&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(I.A,{form:a,typeOfForm:"mobile"}))),T.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ne((e=>!e)),re?(t.mobileBorderRadiusAll=null,y(!0)):t.mobileBorderRadiusAll=5,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},re?o.createElement(x.A,null):o.createElement(k.A,null)))),re&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(Et,{form:a,oneMobileBorderRadiusValue:A,setOneMobileBorderRadiusValue:y,elementSettings:e}))),T.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ce((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"),l({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),se&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(ht,{mobileBoxShadow:c,form:a,elementSettings:e}))),T.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control & Direction")),o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(Dt,{elementSettings:e,form:a})))),T.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement(g.A,{className:"selected_form-desktop-props-title",message:t("Appearance on mobile devices"),type:"info"}),o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Ze.A,{form:a,elementSettings:e})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(z.A,{form:a,elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider"}),T.formCellFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ke((e=>!e)),Be&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},Be?o.createElement(x.A,null):o.createElement(k.A,null)))),Be&&o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(o.Fragment,null,o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:$?"block":"none"}},o.createElement(p.A,{title:t("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeftRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Horizontal"),prefix:o.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:$?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Left"),prefix:o.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingRight"},o.createElement(W.A,{min:0,max:300,placeholder:t("Right"),prefix:o.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"none"}},o.createElement("div",{className:"padding-collapsed",style:{display:$?"block":"none"}},o.createElement(p.A,{title:t("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTopBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Vertical"),prefix:o.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:$?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:t("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:t("Top"),prefix:o.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:t("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingBottom"},o.createElement(W.A,{min:0,max:300,placeholder:t("Bottom"),prefix:o.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"none"}},o.createElement(p.A,{title:t("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!$}),onClick:()=>{Y((e=>!e));const t=a.getFieldsValue(!0);$||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(F.A,{icon:"PaddingSwitcher"}))))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{pe((e=>!e))}))}},ue?o.createElement(x.A,null):o.createElement(k.A,null)))),ue&&o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width",className:"form-item-margin-xs"}," ",o.createElement(W.A,{min:0,max:Re,placeholder:t("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Wt)}))),o.createElement(p.A,{trigger:["hover"],title:t("Height"),placement:"bottom"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:t("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Minimum width"),placement:"bottom"},o.createElement(u.A.Item,{name:"minWidth",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:t("Min width"),prefix:o.createElement(F.A,{icon:"MinWidth"}),addonAfter:o.createElement(u.A.Item,{name:"minWidthDim",noStyle:!0},Wt)}))),o.createElement(p.A,{trigger:["hover"],title:t("Maximum width"),placement:"bottom"},o.createElement(u.A.Item,{name:"maxWidth",className:"form-item-margin-xs"},o.createElement(W.A,{min:0,placeholder:t("Max width"),prefix:o.createElement(F.A,{icon:"MaxWidth"}),addonAfter:o.createElement(u.A.Item,{name:"maxWidthDim",noStyle:!0},Wt)}))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ve((e=>!e)),he?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",M(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),l({operation:O.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}})}))}},he?o.createElement(x.A,null):o.createElement(k.A,null)))),he&&o.createElement(b.A,{gutter:10,style:{marginBottom:C?16:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:T.formDivFieldBackgroundImageEnabled?V.formItemMarginBottomXS:V.formItemMarginBottomMD+4}},o.createElement(G.A,{placeholder:t("Background color"),usedColors:e.usedColors})))),T.formDivFieldBackgroundImageEnabled&&o.createElement(E.A,{span:C?12:24},o.createElement("div",{style:{paddingBottom:C?4:0}},o.createElement(N.A,{form:a,label:t("Background image"),name:"backgroundImage",tooltipTitle:t("Background image"),placeholder:"Background image link/route"})),!C&&o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Horizontal position"),prefix:o.createElement(F.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:V.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:t("Vertical position"),prefix:o.createElement(F.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:V.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:Ne,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:V.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:t("Please choose"),options:Ie,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),T.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{te((e=>!e)),ee?(t.borderAll=je.RH,t.borderTop=je.RH,t.borderBottom=je.RH,t.borderRight=je.RH,t.borderLeft=je.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},ee?o.createElement(x.A,null):o.createElement(k.A,null)))),ee&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(I.A,{form:a,elementSettings:e}))),T.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{ie((e=>!e)),ae?(t.borderRadiusAll=0,s(!0)):t.borderRadiusAll=5,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},ae?o.createElement(x.A,null):o.createElement(k.A,null)))),ae&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:m,setOneBorderRadiusValue:s,elementSettings:e}))),T.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{me((e=>!e)),de?(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"),l({operation:O.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}}})}))}},de?o.createElement(x.A,null):o.createElement(k.A,null)))),de&&o.createElement("div",{style:{paddingBottom:4}},o.createElement(U,{boxShadow:i}))),T.formFieldExportAsPictureEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Export settings"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=a.getFieldsValue(!0);setTimeout((()=>{Se((e=>!e)),ye&&(t.exportAsPicture=!1,l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{exportAsPicture:!1}}))}))}},ye?o.createElement(x.A,null):o.createElement(k.A,null)))),ye&&o.createElement(yt,{form:a,elementSettings:e})),T.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control & Direction")),o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:a})),o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(Ct,{elementSettings:e,form:a})))),T.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))))};var Xt=l(61153);const{Option:qt}=X.A,$t=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(qt,{value:"px"},"px"),o.createElement(qt,{value:"%"},"%")),Yt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(qt,{value:"px"},"px"));let Kt=0;const Qt=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),l=(0,D.XW)(),[a]=u.A.useForm(),i=(0,n.d4)(Oe.Ct),r=(0,n.d4)(Oe.CS),d=(0,n.d4)(Oe.Fv),m=(0,n.d4)(Oe.yy),s=(0,Ve.rD)(),c=d&&"bottom"!==m;(0,o.useEffect)((()=>{const t=e=>e&&"auto"!==e?e:0===e?"0":"";var l,o,i,r,n,d,m,s,c,u,p,g,b,E;e&&(a.setFieldsValue({...e,width:null===(l=e.width)||void 0===l?void 0:l.value,widthDim:null===(o=e.width)||void 0===o?void 0:o.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":""))}),Kt=e.width.value+e.gap.value)}),[a,e]);return o.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 o=a.getFieldsValue(!0),i=Object.keys(t)[0];let r;switch(i){case"width":Kt=t[i]+o.gap,r={[i]:{value:t[i],dim:o.widthDim},gap:{value:o.gap}};break;case"widthDim":r={width:{value:o.width,dim:t[i]},gap:{value:o.gap}};break;case"gap":o.width=Kt-t[i],r={[i]:{value:t[i],dim:"px"}};break;case"mobileWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:o.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:o.mobileWidth||100,dim:t[i]}};break;case"mobileContentWidth":r={[i]:{classNamePrefix:"em-mob-width-",value:t[i],dim:o.mobileContentWidthDim}};break;case"mobileContentWidthDim":r={mobileContentWidth:{classNamePrefix:"em-mob-width-",value:100,dim:t[i]}};break;case"mobileVerticalAlign":r={[i]:{classNamePrefix:"em-mob-vertical_align-",value:t[i]}};break;default:r=t}l({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r})},autoComplete:"off",className:"element-controls"},c&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),i===O.ND&&r.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props",style:{display:i===O.ND&&r.styles?"block":"none"}},o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:10,style:{marginBottom:20}},o.createElement(E.A,{span:12},o.createElement(Q,{form:a,name:"mobileWidth",elementSettings:e})),o.createElement(E.A,{span:12})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Alignments")),o.createElement(ge,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(fe,{elementSettings:e,form:a}),s.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(Pe,null)))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(u.A.Item,{style:{marginBottom:"0"}},o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Float block width"),placement:"bottom"},o.createElement(u.A.Item,{name:"width"},o.createElement(ee.A,{min:0,placeholder:t("Float block width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},$t)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:t("Column gap"),placement:"bottom"},o.createElement(u.A.Item,{name:"gap"},o.createElement(ee.A,{min:0,placeholder:t("Column gap"),prefix:o.createElement(Xt.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Yt)})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Vertical alignment")),o.createElement(z.A,{form:a,elementSettings:e}),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},t("Display control")),o.createElement(fe,{elementSettings:e,form:a}),s.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement("div",{className:"form-group-title"},t("AMP visibility")),o.createElement(Pe,null)))))},{Option:Jt}=X.A,Zt=o.createElement(X.A,{className:"select-after",getPopupContainer:e=>e.parentNode},o.createElement(Jt,{value:"px"},"px"),o.createElement(Jt,{value:"%"},"%")),{useToken:el}=c.A,tl=({elementSettings:e})=>{var t;const{__:l}=(0,L.s9)(),a=(0,D.XW)(),[i]=u.A.useForm(),s=(0,n.wA)(),c=(0,n.d4)(d.Hs),[v,A]=(0,o.useState)({}),[y,w]=(0,o.useState)(!0),[R,T]=(0,o.useState)(!0),C=(0,n.d4)(Oe.Ct),M=(0,n.d4)(Oe.CS),z=(0,Ve.rD)(),[H,j]=(0,o.useState)(""===(null===(t=e.backgroundImage)||void 0===t?void 0:t[0].value)),q=(0,n.d4)(Oe.Fv),$=(0,n.d4)(Oe.yy),Y=q&&"bottom"!==$,{token:K}=el(),J=(0,o.useRef)(null),ee=(0,o.useRef)(null),[te,le]=(0,o.useState)(!1),[oe,ae]=(0,o.useState)(!1),[ie,re]=(0,o.useState)(!1),[ne,de]=(0,o.useState)(!1),[me,se]=(0,o.useState)(!1),[ce,ue]=(0,o.useState)(!1),[ge,be]=(0,o.useState)(!1),[Ee,he]=(0,o.useState)(!1),[ve,Ae]=(0,o.useState)(!1),[_e,ye]=(0,o.useState)(!1),[Se,Be]=(0,o.useState)(!1),[ke,xe]=(0,o.useState)(!1),[we,Re]=(0,o.useState)(!1),[Te,Ne]=(0,o.useState)(!1),[Ie,Ce]=(0,o.useState)(""),[Le,Fe]=(0,o.useState)("https://"),[De,Me]=(0,o.useState)({}),[ze,He]=(0,o.useState)(!1),We=c.hasOwnProperty("type")?O.IE:O.Tm,Ge=[{label:l("Not defined"),value:"none"},{label:l("Do not repeat background (no-repeat)"),value:"no-repeat"},{label:l("Repeat background (repeat)"),value:"repeat"},{label:l("Repeat background horizontally (repeat-x)"),value:"repeat-x"},{label:l("Repeat background vertically (repeat-y)"),value:"repeat-y"}],Ue=[{label:l("Not defined"),value:""},{label:l("Contain"),value:"contain"},{label:l("Cover"),value:"cover"}],Xe=e.border,$e=e.mobileBorder,Ye=Object.keys(Xe).find((e=>{var t,l,o;return(null===(t=Xe[e])||void 0===t?void 0:t.width)||(null===(l=Xe[e])||void 0===l?void 0:l.style)||(null===(o=Xe[e])||void 0===o?void 0:o.color)})),Ke=Object.keys($e).find((e=>{var t,l,o;return(null===(t=$e[e])||void 0===t?void 0:t.width)||(null===(l=$e[e])||void 0===l?void 0:l.style)||(null===(o=$e[e])||void 0===o?void 0:o.color)})),Qe=e=>e&&(null!==e&&void 0!==e&&e.width||null!==e&&void 0!==e&&e.style||null!==e&&void 0!==e&&e.color)?e:"";(0,o.useEffect)((()=>{if(e){var t,l,o,a,r,n,d,m,s,c,u,p,g,b,E,h,f,v,_,y,S,B,k,x,R,N,I,P,C,L,F,O,D,M,V,z,H,W,G,U,X,q,$,Y,K,Q,J,Z,ee,te,oe,ie,ne,me,ce,pe,ge,Ee,fe,ve,_e,Se,ke,we,Te,Ie,Pe,Ce,Le,Oe,De,Me,Ve,ze,He,We,Ge,Ue,Xe,qe,$e,Je,Ze,et,tt,lt,ot,at,it,rt,nt,dt,mt,st,ct,ut,pt,gt,bt,Et,ht,ft,vt,At,_t,yt,St,Bt,kt,xt,wt,Rt,Tt,Nt,It,Pt,Ct,Lt,Ft,Ot,Dt,Mt,Vt,zt,Ht,jt,Wt,Gt,Ut,Xt,qt,$t,Yt,Kt,Qt,Jt,Zt,el,tl,ll,ol,al,il,rl,nl,dl,ml,sl,cl,ul,pl,gl,bl,El,hl,fl,vl,Al;const _l=e.boxShadow||{},yl=e.mobilePadding||{},Sl=e.mobileAlign||{},Bl=e.mobileBackgroundImage||[];A(_l),e.href&&("https://"===e.href.substring(0,8)||"http://"===e.href.substring(0,7)?Fe("https://"):"mailto:"===e.href.substring(0,7)?Fe("mailto:"):"tel:"===e.href.substring(0,4)?Fe("tel:"):"sms:"===e.href.substring(0,4)?Fe("sms:"):"ftp://"===e.href.substring(0,6)?Fe("ftp://"):"skype:"===e.href.substring(0,6)?Fe("skype:"):"viber:"===e.href.substring(0,6)?Fe("viber:"):Fe("")),i.setFieldsValue({...e,href:e.href?e.href:"https://",width:null===(t=e.width)||void 0===t?void 0:t.value,widthDim:null===(l=e.width)||void 0===l?void 0:l.dim,height:null===(o=e.height)||void 0===o?void 0:o.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,borderAll:(0,je.ok)(e.border.all),borderTop:(0,je.ok)(e.border.top),borderBottom:(0,je.ok)(e.border.bottom),borderRight:(0,je.ok)(e.border.right),borderLeft:(0,je.ok)(e.border.left),mobileBorderAll:Qe(e.mobileBorder.all)||!(Qe(e.mobileBorder.top)||Qe(e.mobileBorder.bottom)||Qe(e.mobileBorder.right)||Qe(e.mobileBorder.left))&&Qe(e.border.all),mobileBorderTop:Qe(e.mobileBorder.top)||!Qe(e.mobileBorder.all)&&Qe(e.border.top),mobileBorderBottom:Qe(e.mobileBorder.bottom)||!Qe(e.mobileBorder.all)&&Qe(e.border.bottom),mobileBorderRight:Qe(e.mobileBorder.right)||!Qe(e.mobileBorder.all)&&Qe(e.border.right),mobileBorderLeft:Qe(e.mobileBorder.left)||!Qe(e.mobileBorder.all)&&Qe(e.border.left),paddingTop:(0,je.ok)(null===(n=e.padding)||void 0===n?void 0:n.all)||(0,je.ok)(null===(d=e.padding)||void 0===d?void 0:d.top),paddingLeft:(0,je.ok)(null===(m=e.padding)||void 0===m?void 0:m.all)||(0,je.ok)(null===(s=e.padding)||void 0===s?void 0:s.left),paddingRight:(0,je.ok)(null===(c=e.padding)||void 0===c?void 0:c.all)||(0,je.ok)(null===(u=e.padding)||void 0===u?void 0:u.right),paddingBottom:(0,je.ok)(null===(p=e.padding)||void 0===p?void 0:p.all)||(0,je.ok)(null===(g=e.padding)||void 0===g?void 0:g.bottom),paddingLeftRight:(0,je.ok)(null===(b=e.padding)||void 0===b?void 0:b.left)||(0,je.ok)(null===(E=e.padding)||void 0===E?void 0:E.right),paddingTopBottom:(0,je.ok)(null===(h=e.padding)||void 0===h?void 0:h.top)||(0,je.ok)(null===(f=e.padding)||void 0===f?void 0:f.bottom),borderRadiusAll:(0,je.ok)(null===(v=e.borderRadius)||void 0===v?void 0:v.all),borderRadiusTopLeft:(0,je.ok)(null===(_=e.borderRadius)||void 0===_?void 0:_.topLeft),borderRadiusBottomLeft:(0,je.ok)(null===(y=e.borderRadius)||void 0===y?void 0:y.bottomLeft),borderRadiusTopRight:(0,je.ok)(null===(S=e.borderRadius)||void 0===S?void 0:S.topRight),borderRadiusBottomRight:(0,je.ok)(null===(B=e.borderRadius)||void 0===B?void 0:B.bottomRight),boxShadowInset:(0,je.ok)(null===(k=e.boxShadow)||void 0===k?void 0:k.inset)||!1,boxShadowHOffset:(0,je.ok)(null===(x=e.boxShadow)||void 0===x?void 0:x.hOffset),boxShadowVOffset:(0,je.ok)(null===(R=e.boxShadow)||void 0===R?void 0:R.vOffset),boxShadowBlurRadius:(0,je.ok)(null===(N=e.boxShadow)||void 0===N?void 0:N.blurRadius),boxShadowSpreadRadius:(0,je.ok)(null===(I=e.boxShadow)||void 0===I?void 0:I.spreadRadius),boxShadowColor:(0,je.ok)(null===(P=e.boxShadow)||void 0===P?void 0:P.color),mobileWidth:(0,je.xc)(null===(C=e.mobileWidth)||void 0===C?void 0:C.value)||(null===(L=e.width)||void 0===L?void 0:L.value),mobileWidthDim:(0,je.xc)(null===(F=e.mobileWidth)||void 0===F?void 0:F.value)?null===(O=e.mobileWidth)||void 0===O?void 0:O.dim:null===(D=e.width)||void 0===D?void 0:D.dim,mobileHeight:(0,je.xc)(null===(M=e.mobileHeight)||void 0===M?void 0:M.value)||(null===(V=e.height)||void 0===V?void 0:V.value),mobileHeightDim:(0,je.xc)(null===(z=e.mobileHeight)||void 0===z?void 0:z.value)?null===(H=e.mobileHeight)||void 0===H?void 0:H.dim:null===(W=e.height)||void 0===W?void 0:W.dim,mobileBorderRadiusAll:(0,je.ok)(null===(G=e.mobileBorderRadius)||void 0===G?void 0:G.all)||(0,je.ok)(null===(U=e.borderRadius)||void 0===U?void 0:U.all),mobileBorderRadiusTopLeft:(0,je.ok)(null===(X=e.mobileBorderRadius)||void 0===X?void 0:X.topLeft)||(0,je.ok)(null===(q=e.mobileBorderRadius)||void 0===q?void 0:q.all)||(0,je.ok)(null===($=e.borderRadius)||void 0===$?void 0:$.topLeft)||(0,je.ok)(null===(Y=e.borderRadius)||void 0===Y?void 0:Y.all),mobileBorderRadiusBottomLeft:(0,je.ok)(null===(K=e.mobileBorderRadius)||void 0===K?void 0:K.bottomLeft)||(0,je.ok)(null===(Q=e.mobileBorderRadius)||void 0===Q?void 0:Q.all)||(0,je.ok)(null===(J=e.borderRadius)||void 0===J?void 0:J.bottomLeft)||(0,je.ok)(null===(Z=e.borderRadius)||void 0===Z?void 0:Z.all),mobileBorderRadiusTopRight:(0,je.ok)(null===(ee=e.mobileBorderRadius)||void 0===ee?void 0:ee.topRight)||(0,je.ok)(null===(te=e.mobileBorderRadius)||void 0===te?void 0:te.all)||(0,je.ok)(null===(oe=e.borderRadius)||void 0===oe?void 0:oe.topRight)||(0,je.ok)(null===(ie=e.borderRadius)||void 0===ie?void 0:ie.all),mobileBorderRadiusBottomRight:(0,je.ok)(null===(ne=e.mobileBorderRadius)||void 0===ne?void 0:ne.bottomRight)||(0,je.ok)(null===(me=e.mobileBorderRadius)||void 0===me?void 0:me.all)||(0,je.ok)(null===(ce=e.borderRadius)||void 0===ce?void 0:ce.bottomRight)||(0,je.ok)(null===(pe=e.borderRadius)||void 0===pe?void 0:pe.all),mobileBoxShadowInset:null!=(null===(ge=e.mobileBoxShadow)||void 0===ge?void 0:ge.inset)?e.mobileBoxShadow.inset:(null===(Ee=e.boxShadow)||void 0===Ee?void 0:Ee.inset)||!1,mobileBoxShadowHOffset:(0,je.ok)(null===(fe=e.mobileBoxShadow)||void 0===fe?void 0:fe.hOffset)||(0,je.ok)(null===(ve=e.boxShadow)||void 0===ve?void 0:ve.hOffset),mobileBoxShadowVOffset:(0,je.ok)(null===(_e=e.mobileBoxShadow)||void 0===_e?void 0:_e.vOffset)||(0,je.ok)(null===(Se=e.boxShadow)||void 0===Se?void 0:Se.vOffset),mobileBoxShadowBlurRadius:(0,je.ok)(null===(ke=e.mobileBoxShadow)||void 0===ke?void 0:ke.blurRadius)||(0,je.ok)(null===(we=e.boxShadow)||void 0===we?void 0:we.blurRadius),mobileBoxShadowSpreadRadius:(0,je.ok)(null===(Te=e.mobileBoxShadow)||void 0===Te?void 0:Te.spreadRadius)||(0,je.ok)(null===(Ie=e.boxShadow)||void 0===Ie?void 0:Ie.spreadRadius),mobileBoxShadowColor:(0,je.ok)(null===(Pe=e.mobileBoxShadow)||void 0===Pe?void 0:Pe.color)||(0,je.ok)(null===(Ce=e.boxShadow)||void 0===Ce?void 0:Ce.color),mobileAlign:(0,je.ok)(null===Sl||void 0===Sl?void 0:Sl.value)||e.align,mobileVerticalAlign:(0,je.ok)((null===(Le=e.mobileVerticalAlign)||void 0===Le?void 0:Le.value)||e.valign),mobileBackgroundColor:(0,je.ok)((null===(Oe=e.mobileBackgroundColor)||void 0===Oe?void 0:Oe.value)||e.backgroundColor||""),mobileBackgroundImage:"none"!==(null===(De=Bl[0])||void 0===De?void 0:De.value)?null===(Me=Bl[0])||void 0===Me?void 0:Me.value:(null===(Ve=e.backgroundImage)||void 0===Ve?void 0:Ve[0].value)||"",mobileBackgroundPositionX:(0,je.ok)(null===(ze=e.mobileBackgroundPositionX)||void 0===ze?void 0:ze.value)||(0,je.ok)(null===(He=e.backgroundPositionX)||void 0===He?void 0:He.value),mobileBackgroundPositionY:(0,je.ok)(null===(We=e.mobileBackgroundPositionY)||void 0===We?void 0:We.value)||(0,je.ok)(null===(Ge=e.backgroundPositionY)||void 0===Ge?void 0:Ge.value),mobileBackgroundRepeat:(null===(Ue=e.mobileBackgroundRepeat)||void 0===Ue?void 0:Ue.value)||e.backgroundRepeat||"none",mobilePaddingTop:(0,je.ok)(yl.all)||(0,je.ok)(yl.top)||(0,je.ok)(null===(Xe=e.padding)||void 0===Xe?void 0:Xe.all)||(0,je.ok)(null===(qe=e.padding)||void 0===qe?void 0:qe.top),mobilePaddingLeft:(0,je.ok)(yl.all)||(0,je.ok)(yl.left)||(0,je.ok)(null===($e=e.padding)||void 0===$e?void 0:$e.all)||(0,je.ok)(null===(Je=e.padding)||void 0===Je?void 0:Je.left),mobilePaddingRight:(0,je.ok)(yl.all)||(0,je.ok)(yl.right)||(0,je.ok)(null===(Ze=e.padding)||void 0===Ze?void 0:Ze.all)||(0,je.ok)(null===(et=e.padding)||void 0===et?void 0:et.right),mobilePaddingBottom:(0,je.ok)(yl.all)||(0,je.ok)(yl.bottom)||(0,je.ok)(null===(tt=e.padding)||void 0===tt?void 0:tt.all)||(0,je.ok)(null===(lt=e.padding)||void 0===lt?void 0:lt.bottom),mobilePaddingTopBottom:(0,je.ok)(yl.top)||(0,je.ok)(yl.bottom)||(0,je.ok)(null===(ot=e.padding)||void 0===ot?void 0:ot.top)||(0,je.ok)(null===(at=e.padding)||void 0===at?void 0:at.bottom),mobilePaddingLeftRight:(0,je.ok)(yl.left)||(0,je.ok)(yl.right)||(0,je.ok)(null===(it=e.padding)||void 0===it?void 0:it.left)||(0,je.ok)(null===(rt=e.padding)||void 0===rt?void 0:rt.right),mobileTextAlign:(0,je.ok)((null===(nt=e.mobileTextAlign)||void 0===nt?void 0:nt.value)||e.textAlign),exportAsPicture:null===e||void 0===e?void 0:e.exportAsPicture,mobileFontSize:(0,je.ok)((null===(dt=e.mobileFontSize)||void 0===dt?void 0:dt.value)||e.fontSize)}),!(0,je.ok)(null===(mt=e.borderRadius)||void 0===mt?void 0:mt.all)&&((0,je.ok)(null===(st=e.borderRadius)||void 0===st?void 0:st.topLeft)||(0,je.ok)(null===(ct=e.borderRadius)||void 0===ct?void 0:ct.bottomLeft)||(0,je.ok)(null===(ut=e.borderRadius)||void 0===ut?void 0:ut.topRight)||(0,je.ok)(null===(pt=e.borderRadius)||void 0===pt?void 0:pt.bottomRight))?w(!1):w(!0),!(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight))||(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.mobileBorderRadius.topLeft)||(0,je.ok)(e.mobileBorderRadius.bottomLeft)||(0,je.ok)(e.mobileBorderRadius.topRight)||(0,je.ok)(e.mobileBorderRadius.bottomRight))||!(0,je.ok)(e.borderRadius.all)&&!(0,je.ok)(e.mobileBorderRadius.all)&&((0,je.ok)(e.borderRadius.topLeft)||(0,je.ok)(e.borderRadius.bottomLeft)||(0,je.ok)(e.borderRadius.topRight)||(0,je.ok)(e.borderRadius.bottomRight))?T(!1):T(!0),j(""===(null===(gt=e.backgroundImage)||void 0===gt?void 0:gt[0].value)),(0,je.ok)(null===(bt=e.padding)||void 0===bt?void 0:bt.all)||!((0,je.ok)(null===(Et=e.padding)||void 0===Et?void 0:Et.top)||(0,je.ok)(null===(ht=e.padding)||void 0===ht?void 0:ht.right)||(0,je.ok)(null===(ft=e.padding)||void 0===ft?void 0:ft.bottom)||(0,je.ok)(null===(vt=e.padding)||void 0===vt?void 0:vt.left))||(null===(At=e.padding)||void 0===At?void 0:At.top)===(null===(_t=e.padding)||void 0===_t?void 0:_t.bottom)&&(null===(yt=e.padding)||void 0===yt?void 0:yt.right)===(null===(St=e.padding)||void 0===St?void 0:St.left)?le(!0):le(!1),!(0,je.ok)(yl.all)&&((0,je.ok)(yl.top)||(0,je.ok)(yl.right)||(0,je.ok)(yl.bottom)||(0,je.ok)(yl.left))&&(yl.top!==yl.bottom||yl.right!==yl.left)||!(0,je.ok)(null===(Bt=e.padding)||void 0===Bt?void 0:Bt.all)&&((0,je.ok)(null===(kt=e.padding)||void 0===kt?void 0:kt.top)||(0,je.ok)(null===(xt=e.padding)||void 0===xt?void 0:xt.right)||(0,je.ok)(null===(wt=e.padding)||void 0===wt?void 0:wt.bottom)||(0,je.ok)(null===(Rt=e.padding)||void 0===Rt?void 0:Rt.left))&&((null===(Tt=e.padding)||void 0===Tt?void 0:Tt.top)!==(null===(Nt=e.padding)||void 0===Nt?void 0:Nt.bottom)||(null===(It=e.padding)||void 0===It?void 0:It.right)!==(null===(Pt=e.padding)||void 0===Pt?void 0:Pt.left))?ae(!1):ae(!0),re(!!Ye),de(!!Ye||!!Ke),se(!(null===(Ct=e.borderRadius)||void 0===Ct||!Ct.all)||!(null===(Lt=e.borderRadius)||void 0===Lt||!Lt.topLeft)||!(null===(Ft=e.borderRadius)||void 0===Ft||!Ft.bottomLeft)||!(null===(Ot=e.borderRadius)||void 0===Ot||!Ot.topRight)||!(null===(Dt=e.borderRadius)||void 0===Dt||!Dt.bottomRight)),ue(!(null===(Mt=e.mobileBorderRadius)||void 0===Mt||!Mt.all)||!(null===(Vt=e.mobileBorderRadius)||void 0===Vt||!Vt.topLeft)||!(null===(zt=e.mobileBorderRadius)||void 0===zt||!zt.bottomLeft)||!(null===(Ht=e.mobileBorderRadius)||void 0===Ht||!Ht.topRight)||!(null===(jt=e.mobileBorderRadius)||void 0===jt||!jt.bottomRight)||!(null===(Wt=e.borderRadius)||void 0===Wt||!Wt.all)||!(null===(Gt=e.borderRadius)||void 0===Gt||!Gt.topLeft)||!(null===(Ut=e.borderRadius)||void 0===Ut||!Ut.bottomLeft)||!(null===(Xt=e.borderRadius)||void 0===Xt||!Xt.topRight)||!(null===(qt=e.borderRadius)||void 0===qt||!qt.bottomRight)),be(!!e.boxShadow),he(!(null===($t=e.mobileBoxShadow)||void 0===$t||!$t.blurRadius)||!(null===(Yt=e.mobileBoxShadow)||void 0===Yt||!Yt.color)||!(null===(Kt=e.mobileBoxShadow)||void 0===Kt||!Kt.hOffset)||!(null===(Qt=e.mobileBoxShadow)||void 0===Qt||!Qt.inset)||!(null===(Jt=e.mobileBoxShadow)||void 0===Jt||!Jt.spreadRadius)||!(null===(Zt=e.mobileBoxShadow)||void 0===Zt||!Zt.vOffset)||!!e.boxShadow),Ae(!(null===(el=e.mobileWidth)||void 0===el||!el.value)||!(null===(tl=e.mobileHeight)||void 0===tl||!tl.value)||!!e.width.value||!!e.height.value),ye(!!e.backgroundColor||!(null===(ll=e.backgroundImage)||void 0===ll||!ll[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),Be(!(null===(ol=e.mobileBackgroundColor)||void 0===ol||!ol.value)||!!e.backgroundColor||!(null===(al=e.backgroundImage)||void 0===al||!al[0].value)||!!e.backgroundPositionY||!!e.backgroundPositionX||"repeat"!==e.backgroundRepeat||!e.backgroundRepeat,!!e.backgroundSize),xe(!(null===(il=e.mobileFontSize)||void 0===il||!il.value)||!!e.fontSize||!!e.showOnMobile),Re(!(null===(rl=e.padding)||void 0===rl||!rl.all)||!(null===(nl=e.padding)||void 0===nl||!nl.top)||!(null===(dl=e.padding)||void 0===dl||!dl.bottom)||!(null===(ml=e.padding)||void 0===ml||!ml.left)||!(null===(sl=e.padding)||void 0===sl||!sl.right)),Ne(!(null===(cl=e.mobilePadding)||void 0===cl||!cl.all)||!(null===(ul=e.mobilePadding)||void 0===ul||!ul.top)||!(null===(pl=e.mobilePadding)||void 0===pl||!pl.bottom)||!(null===(gl=e.mobilePadding)||void 0===gl||!gl.left)||!(null===(bl=e.mobilePadding)||void 0===bl||!bl.right)||!(null===(El=e.padding)||void 0===El||!El.all)||!(null===(hl=e.padding)||void 0===hl||!hl.top)||!(null===(fl=e.padding)||void 0===fl||!fl.bottom)||!(null===(vl=e.padding)||void 0===vl||!vl.left)||!(null===(Al=e.padding)||void 0===Al||!Al.right))}}),[i,e,Y]);const Je=(0,o.useCallback)((e=>{s(We===O.Tm?(0,d.A9)(e):(0,m.A9)(e))}),[s,We]),et=e=>{i.setFieldValue("href","mergetag"!==e?e:""),Fe(e)},tt=({target:e})=>{const{selectionStart:t,selectionEnd:l}=e;e&&Me({target:e,selection:{start:t,end:l}})};(0,o.useEffect)((()=>{var t;He(!(null===(t=e.textReplacer)||void 0===t||!t.length))}),[e]);return o.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:je.uE[Ye]||"borderAll",mobileBorderPosition:je.lS[Ke]||"mobileBorderAll",borderColor:"",borderWidth:"",borderStyle:"",paddingTop:"",paddingLeft:"",paddingRight:"",paddingBottom:"",borderRadiusAll:"",RadiusTopLeft:"",RadiusBottomLeft:"",RadiusTopRight:"",RadiusBottomRight:"",mobileWidth:"",mobileWidthDim:"",mobileHeight:"",mobileHeightDim:"",mobileBorder:"",mobileBorderColor:"",mobileBorderWidth:"",mobileBorderStyle:"",mobileBoxShadow:"",mobileAlign:"",mobileVerticalAlign:"",mobileBackgroundColor:"",mobileBackgroundImage:"",mobilePaddingTop:"",mobilePaddingLeft:"",mobilePaddingRight:"",mobilePaddingBottom:"",borderRadiusTopLeft:"",borderRadiusBottomLeft:"",borderRadiusTopRight:"",borderRadiusBottomRight:"",href:"https://"},onValuesChange:t=>{const l=i.getFieldsValue(!0),o=Object.keys(t)[0];let r;switch(Ce("%"===i.getFieldsValue(!0).widthDim?100:""),o){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"borderAll":case"borderTop":case"borderBottom":case"borderLeft":case"borderRight":var n,d,m;if("borderAll"===l.borderPosition)r={border:{...O.iV,all:{...je.RH,...l.borderAll}}},i.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(n=l.borderAll)&&void 0!==n&&n.width||null!==(d=l.borderAll)&&void 0!==d&&d.style||null!==(m=l.borderAll)&&void 0!==m&&m.color?(r={border:{all:null,left:l.borderAll,right:l.borderAll,top:l.borderAll,bottom:l.borderAll,[je.Vz[o]]:{...l[o],...t[o]}}},i.setFieldsValue({borderAll:null,borderLeft:l.borderAll,borderRight:l.borderAll,borderTop:l.borderAll,borderBottom:l.borderAll,[o]:{...l[o],...t[o]}})):(r={border:{all:null,left:l.borderLeft,right:l.borderRight,top:l.borderTop,bottom:l.borderBottom,[je.Vz[o]]:{...l[o],...t[o]}}},i.setFieldsValue({border:r.border}));break;case"mobileBorderAll":case"mobileBorderTop":case"mobileBorderBottom":case"mobileBorderLeft":case"mobileBorderRight":var s,c,u;if("mobileBorderAll"===l.mobileBorderPosition)r={mobileBorder:{...O.iV,all:{...je.RH,...l.mobileBorderAll,classNamePrefix:"em-mob-border_"+je.ax[o]+"-"}}},i.setFieldsValue({borderLeft:je.RH,borderRight:je.RH,borderTop:je.RH,borderBottom:je.RH});else null!==(s=l.mobileBorder.all)&&void 0!==s&&s.width||null!==(c=l.mobileBorder.all)&&void 0!==c&&c.style||null!==(u=l.mobileBorder.all)&&void 0!==u&&u.color?(r={mobileBorder:{all:null,left:l.mobileBorderAll,right:l.mobileBorderAll,top:l.mobileBorderAll,bottom:l.mobileBorderAll,[je.ax[o]]:{...l[o],...t[o],classNamePrefix:"em-mob-border_"+je.ax[o]+"-"}}},i.setFieldsValue({mobileBorderAll:null,mobileBorderLeft:l.mobileBorderAll,mobileBorderRight:l.mobileBorderAll,mobileBorderTop:l.mobileBorderAll,mobileBorderBottom:l.mobileBorderAll,[o]:{...l[o],...t[o]}})):(r={mobileBorder:{all:null,left:l.mobileBorderLeft,right:l.mobileBorderRight,top:l.mobileBorderTop,bottom:l.mobileBorderBottom,[je.ax[o]]:{...l[o],...t[o],classNamePrefix:"em-mob-border_"+je.ax[o]+"-"}}},i.setFieldsValue({mobileBorder:r.mobileBorder}));break;case"width":r={[o]:{value:t[o],dim:l.widthDim}};break;case"height":r={[o]:{value:t[o],dim:l.heightDim}};break;case"widthDim":r={width:{value:l.width,dim:t[o]}};break;case"heightDim":r={height:{value:l.height,dim:t[o]}};break;case"backgroundImage":j(""===t[o]),r={[o]:[{...e.backgroundImage[0],value:t[o]}],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,[je.yy[o]]:+t[o]}};break;case"paddingTopBottom":r={padding:{left:l.paddingLeft,right:l.paddingRight,top:+t[o],bottom:+t[o]}},l.paddingTop=l.paddingBottom=+t[o];break;case"paddingLeftRight":r={padding:{top:l.paddingTop,bottom:l.paddingBottom,left:+t[o],right:+t[o]}},l.paddingLeft=l.paddingRight=+t[o];break;case"borderRadiusAll":r={borderRadius:{[O.wF[o]]:+t[o]}};break;case"borderRadiusTopLeft":case"borderRadiusBottomLeft":case"borderRadiusTopRight":case"borderRadiusBottomRight":r={borderRadius:{topLeft:l.borderRadiusTopLeft,bottomLeft:l.borderRadiusBottomLeft,topRight:l.borderRadiusTopRight,bottomRight:l.borderRadiusBottomRight,[O.wF[o]]:+t[o]}};break;case"mobileWidth":r={[o]:{classNamePrefix:"em-mob-width-",value:t[o],dim:l.mobileWidthDim}};break;case"mobileWidthDim":r={mobileWidth:{classNamePrefix:"em-mob-width-",value:l.mobileWidth||100,dim:t[o]}};break;case"mobileHeight":r={[o]:{classNamePrefix:"em-mob-height-",value:t[o],dim:l.mobileHeightDim},mobileLineHeight:{classNamePrefix:"em-mob-line_height-",value:t[o],dim:l.mobileHeightDim}};break;case"mobileHeightDim":r={mobileHeight:{classNamePrefix:"em-mob-height-",value:l.mobileHeight,dim:t[o]}};break;case"mobileBorderRadiusAll":case"mobileBorderRadiusTopLeft":case"mobileBorderRadiusBottomLeft":case"mobileBorderRadiusTopRight":case"mobileBorderRadiusBottomRight":r={mobileBorderRadius:{[je.NW[o]]:t[o],classNamePrefix:"em-mob-border_radius_"+je.NW[o]+"-"}};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={[o]:{classNamePrefix:"em-mob-table_align-",value:t[o]}};break;case"mobileTextAlign":r={[o]:{classNamePrefix:"em-mob-text_align-",value:t[o]}};break;case"mobileVerticalAlign":r={[o]:{classNamePrefix:"em-mob-vertical_align-",value:t[o]}};break;case"mobileBackgroundColor":r={[o]:{classNamePrefix:"em-mob-background_color-",value:t[o]}};break;case"mobileBackgroundPositionX":r={[o]:{classNamePrefix:"em-mob-background_position_x-",value:t[o]}};break;case"mobileBackgroundPositionY":r={[o]:{classNamePrefix:"em-mob-background_position_x-",value:t[o]}};break;case"mobileBackgroundRepeat":r={[o]:{classNamePrefix:"em-mob-background_repeat-",value:t[o]}};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[o],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[o],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"mobileFontSize":r={[o]:{classNamePrefix:"em-mob-font_size-",value:t[o],dim:l.mobileFontSizeDim}};break;case"href":let a=t[o];"https://http"===a.substring(0,12)&&(a=a.substring(8,a.length),l.href=a),r={[o]:a},"https://"===t[o].substring(0,8)||"http://"===t[o].substring(0,7)?Fe("https://"):"mailto:"===t[o].substring(0,7)?Fe("mailto:"):"tel:"===t[o].substring(0,4)?Fe("tel:"):"sms:"===t[o].substring(0,4)?Fe("sms:"):"ftp://"===t[o].substring(0,6)?Fe("ftp://"):"skype:"===t[o].substring(0,6)?Fe("skype:"):"viber:"===t[o].substring(0,6)?Fe("viber:"):Fe("");break;default:r=t}var p;"borderPosition"!==o&&"mobileBorderPosition"!==o&&(a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:r}),"mobileBorderRadiusAll"!==o&&"mobileBorderRadiusTopLeft"!==o&&"mobileBorderRadiusTopRight"!==o&&"mobileBorderRadiusBottomLeft"!==o&&"mobileBorderRadiusBottomRight"!==o&&Je({...e,...r,mobileBorderRadius:{...e.mobileBorderRadius,...null===(p=r)||void 0===p?void 0:p.mobileBorderRadius},activateSection:null,changeKey:o}))},autoComplete:"off",className:"element-controls"},!Y&&o.createElement(p.A,{title:l("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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:l("Appearance on mobile devices"),type:"info"})),Y?o.createElement(nt,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0}):o.createElement(o.Fragment,null,C===O.ND&&M.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(pe,{form:i,elementSettings:e,imgParent:!0})),z.formButtonFieldTextAlignEnabled&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(mt,{form:i,name:"mobileTextAlign",elementSettings:e,imgParent:!0}))),!!e.showOnMobile&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),o.createElement(p.A,{trigger:["hover"],title:l("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"href",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(_.A,{addonBefore:o.createElement(je.Ai,{linkProtocol:Le,handleLinkProtocolsChange:et,__:l}),placeholder:l("Hyperlink URL"),allowClear:!0,prefix:o.createElement(je.RM,{linkProtocol:Le})})))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Text"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{xe((e=>!e)),ke&&(t.mobileFontSize="",a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileFontSize:{value:null,dim:"px",classNamePrefix:"em-mob-font_size-"}}}))}))}},ke?o.createElement(x.A,null):o.createElement(k.A,null)))),ke&&o.createElement(o.Fragment,null,!!e.showOnMobile&&o.createElement(ot,{form:i,elementSettings:e,setLinkProtocol:Fe,linkProtocol:Le,showAddParagraph:!1,isButton:!0}),o.createElement(b.A,{gutter:10,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(qe,null)))),o.createElement(h.A,{className:"selected-td-form__divider"}),z.formButtonFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ne((e=>!e)),Te&&(t.mobilePaddingLeftRight="",t.mobilePaddingLeft="",t.mobilePaddingRight="",t.mobilePaddingTopBottom="",t.mobilePaddingTop="",t.mobilePaddingBottom="",a({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),Te&&o.createElement(b.A,{gutter:10,style:{paddingBottom:8}},o.createElement(o.Fragment,null,o.createElement(Ft,{form:i,elementSettings:e,mobilePaddingsExt:oe,setMobilePaddingsExt:ae}))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Size"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Ae((e=>!e)),ve&&(t.mobileWidth="",t.mobileHeight="",a({operation:O.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-"}}}))}))}},ve?o.createElement(x.A,null):o.createElement(k.A,null)))),ve&&o.createElement(b.A,{gutter:10,style:{paddingBottom:8}},o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:2*K.formItemMarginBottomXS}},o.createElement(p.A,{title:l("Width"),placement:"bottom"},o.createElement(Q,{form:i,name:"mobileWidth",elementSettings:e})))),o.createElement(E.A,{span:12},o.createElement("div",{style:{marginBottom:2*K.formItemMarginBottomXS}},o.createElement(p.A,{title:l("Height"),placement:"bottom"},o.createElement(Z,{form:i,name:"mobileHeight",elementSettings:e}))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Be((e=>!e)),t.mobileBackgroundColor=Se?"":e.commonStyles.buttons.backgroundColor||"#1C52DC",a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBackgroundColor:{classNamePrefix:"em-mob-background_color-",value:t.mobileBackgroundColor}}})}))}},Se?o.createElement(x.A,null):o.createElement(k.A,null)))),Se&&o.createElement(o.Fragment,null,o.createElement("div",{style:{marginBottom:(z.formButtonFieldBackgroundImageEnabled,K.formItemMarginBottomMD+4)}},o.createElement(vt,{form:i,elementSettings:e,label:l("Background color")}))),z.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{de((e=>!e)),ne?(t.mobileBorderAll=je.RH,t.mobileBorderTop=je.RH,t.mobileBorderBottom=je.RH,t.mobileBorderRight=je.RH,t.mobileBorderLeft=je.RH):t.mobileBorderAll={width:1,color:"#E5E5E5",style:"solid"},a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorder:{all:{color:t.mobileBorderAll.color,style:t.mobileBorderAll.style,width:t.mobileBorderAll.width}}}})}))}},ne?o.createElement(x.A,null):o.createElement(k.A,null)))),ne&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,typeOfForm:"mobile"}))),z.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ue((e=>!e)),ce?(t.mobileBorderRadiusAll=null,T(!0)):t.mobileBorderRadiusAll=5,a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{mobileBorderRadius:{all:t.mobileBorderRadiusAll,classNamePrefix:"em-mob-border_radius_all-"}}})}))}},ce?o.createElement(x.A,null):o.createElement(k.A,null)))),ce&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:R,setOneBorderRadiusValue:T,elementSettings:e,typeOfForm:"mobile"}))),z.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.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"),a({operation:O.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?o.createElement(x.A,null):o.createElement(k.A,null)))),Ee&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v,typeOfForm:"mobile"}))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))),z.formFieldAmpVisibilityEnabled&&e.isAmp&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null)))))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement(g.A,{className:"selected_form-desktop-props-title",message:l("Appearance on mobile devices"),type:"info"}),o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:20,style:{paddingBottom:4}},o.createElement(E.A,{span:12},o.createElement(V,{form:i,elementSettings:e})),z.formButtonFieldTextAlignEnabled&&o.createElement(E.A,{span:12,style:{textAlign:"right"}},o.createElement(Ze.A,{form:i,name:"textAlign",elementSettings:e}))),o.createElement(h.A,{className:"selected-td-form__divider",style:{marginBottom:24}}),o.createElement(p.A,{trigger:["hover"],title:l("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:"href",style:{marginBottom:z.formButtonFieldReplacerEnabled?K.formItemMarginBottomXS:K.formItemMarginBottomMD+4}},o.createElement(_.A,{addonBefore:o.createElement(je.Ai,{linkProtocol:Le,handleLinkProtocolsChange:et,__:l}),placeholder:l("Hyperlink URL"),allowClear:!0,onSelect:tt,prefix:o.createElement(je.RM,{linkProtocol:Le})}))),z.formButtonFieldReplacerEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:3},o.createElement(p.A,{title:l("Text replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button ant-form-item",{"selected-td-form__button--active":ze}),icon:o.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{He(!ze),ze?(i.setFieldValue("textReplacer",""),a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{textReplacer:""}})):setTimeout((()=>J.current.focus()))},ref:ee}))),o.createElement(E.A,{span:21},ze&&o.createElement(p.A,{trigger:["hover"],title:l("Text"),placement:"bottom"},o.createElement(u.A.Item,{name:"textReplacer"},o.createElement(_.A,{placeholder:l("The code that will replace this text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Text"),onChange:e=>{""!==e.target.value&&ee.current.classList.add("selected-td-form__button--active")},onKeyDown:e=>{const t=e.target,l=t.value,o=t.selectionStart;if(0!==o||" "!==e.key){if(" "===e.key){if(o!==l.length)return void e.preventDefault();l.endsWith(" ")&&e.preventDefault()}}else e.preventDefault()},ref:J,onSelect:tt})))))),o.createElement(h.A,{className:"selected-td-form__divider"}),z.formButtonFieldPaddingsEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Padding"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{Re((e=>!e)),we&&(t.paddingLeftRight="",t.paddingLeft="",t.paddingRight="",t.paddingTopBottom="",t.paddingTop="",t.paddingBottom="",a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{all:0}}}))}))}},we?o.createElement(x.A,null):o.createElement(k.A,null)))),we&&o.createElement(b.A,{gutter:K.marginSM,style:{marginBottom:4}},o.createElement(o.Fragment,null,o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:te?"block":"none"}},o.createElement(p.A,{title:l("Horizontal padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeftRight"},o.createElement(W.A,{min:0,max:300,placeholder:l("Horizontal"),prefix:o.createElement(F.A,{icon:"PaddingLeftRight"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:te?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:l("Left padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingLeft",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:l("Left"),prefix:o.createElement(F.A,{icon:"PaddingLeft"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:l("Right padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingRight"},o.createElement(W.A,{min:0,max:300,placeholder:l("Right"),prefix:o.createElement(F.A,{icon:"PaddingRight"}),addonAfter:"px"}))))),o.createElement(E.A,{span:10,style:{width:156,flex:"auto",maxWidth:"44%"}},o.createElement("div",{className:"padding-collapsed",style:{display:te?"block":"none"}},o.createElement(p.A,{title:l("Vertical padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTopBottom"},o.createElement(W.A,{min:0,max:300,placeholder:l("Vertical"),prefix:o.createElement(F.A,{icon:"PaddingTopBottom"}),addonAfter:"px"})))),o.createElement("div",{className:"padding-extended",style:{display:te?"none":"block"}},o.createElement(p.A,{trigger:["hover"],title:l("Top padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingTop",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:300,placeholder:l("Top"),prefix:o.createElement(F.A,{icon:"PaddingTop"}),addonAfter:"px"}))),o.createElement(p.A,{trigger:["hover"],title:l("Bottom padding"),placement:"bottom"},o.createElement(u.A.Item,{name:"paddingBottom"},o.createElement(W.A,{min:0,max:300,placeholder:l("Bottom"),prefix:o.createElement(F.A,{icon:"PaddingBottom"}),addonAfter:"px"}))))),o.createElement(E.A,{span:4,style:{width:45,flex:"auto",maxWidth:"12%"}},o.createElement(p.A,{title:l("Individual padding"),placement:"bottom"},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!te}),onClick:()=>{le((e=>!e));const t=i.getFieldsValue(!0);te||(t.paddingLeftRight=t.paddingLeft,t.paddingTopBottom=t.paddingTop,t.paddingRight=t.paddingLeft,t.paddingBottom=t.paddingTop,a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{padding:{top:t.paddingTopBottom,bottom:t.paddingTopBottom,left:t.paddingLeftRight,right:t.paddingLeftRight}}}))}},o.createElement(F.A,{icon:"PaddingSwitcher"})))))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement("div",{className:"form-group-title"},l("Size")),o.createElement(b.A,{gutter:K.marginSM,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(p.A,{title:l("Width"),placement:"left"},o.createElement(u.A.Item,{name:"width",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(W.A,{min:0,max:Ie,placeholder:l("Width"),prefix:o.createElement(S.A,null),addonAfter:o.createElement(u.A.Item,{name:"widthDim",noStyle:!0},Zt)})))),o.createElement(E.A,{span:12},o.createElement(p.A,{title:l("Height"),placement:"left"},o.createElement(u.A.Item,{name:"height"},o.createElement(W.A,{min:0,placeholder:l("Height"),prefix:o.createElement(B.A,null),addonAfter:"px"}))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{style:{paddingTop:K.formItemMarginBottomMD+4,paddingBottom:4}},o.createElement(ot,{form:i,elementSettings:e,showAddParagraph:!1,isButton:!0,setLinkProtocol:Fe,linkProtocol:Le,linkTarget:De})),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Background"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{ye((e=>!e)),_e?(t.backgroundColor="",t.backgroundImage="",t.backgroundPositionX="",t.backgroundPositionY="",t.backgroundRepeat="none",t.backgroundSize="",j(!0)):(t.backgroundColor="#E5E5E5",t.backgroundSize="",t.backgroundRepeat="none"),a({operation:O.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}})}))}},_e?o.createElement(x.A,null):o.createElement(k.A,null)))),_e&&o.createElement(b.A,{gutter:10,style:{marginBottom:H?14:0}},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Background color"),placement:"bottom",zIndex:1,getPopupContainer:e=>e.parentNode},o.createElement(u.A.Item,{name:"backgroundColor",style:{marginBottom:z.formButtonFieldBackgroundImageEnabled?K.formItemMarginBottomXS:K.formItemMarginBottomMD+4}},o.createElement(G.A,{placeholder:l("Background color"),usedColors:e.usedColors})))),z.formButtonFieldBackgroundImageEnabled&&o.createElement(E.A,{span:H?12:24},o.createElement("div",{style:{paddingBottom:H?4:0}},o.createElement(N.A,{form:i,label:l("Background image"),name:"backgroundImage",tooltipTitle:l("Background image")})),!H&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Horizontal position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionX",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:l("Horizontal position"),prefix:o.createElement(F.A,{icon:"BgPositionHorizontal"})})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Vertical position"),placement:"bottom"},o.createElement(u.A.Item,{name:"backgroundPositionY",style:{marginBottom:K.formItemMarginBottomXS}},o.createElement(_.A,{placeholder:l("Vertical position"),prefix:o.createElement(F.A,{icon:"BgPositionVertical"})}))))),o.createElement(b.A,{gutter:10},o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Background image repeat"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundRepeat",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:l("Please choose"),options:Ge,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))),o.createElement(E.A,{span:12},o.createElement(p.A,{trigger:["hover"],title:l("Background image size"),placement:"top"},o.createElement(u.A.Item,{name:"backgroundSize",style:{marginBottom:K.formItemMarginBottomMD+4}},o.createElement(X.A,{placeholder:l("Please choose"),options:Ue,getPopupContainer:()=>document.querySelector(".email-properties__collapse-panel")})))))))),z.formFieldBorderEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Borders"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{re((e=>!e)),ie?(t.borderAll=je.RH,t.borderTop=je.RH,t.borderBottom=je.RH,t.borderRight=je.RH,t.borderLeft=je.RH):t.borderAll={width:1,color:"#E5E5E5",style:"solid"},a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{border:{all:{color:t.borderAll.color,style:t.borderAll.style,width:t.borderAll.width}}}})}))}},ie?o.createElement(x.A,null):o.createElement(k.A,null)))),ie&&o.createElement("div",{style:{marginBottom:4}},o.createElement(I.A,{form:i,elementSettings:e}))),z.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{se((e=>!e)),me?(t.borderRadiusAll=0,w(!0)):t.borderRadiusAll=5,a({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{borderRadius:{all:t.borderRadiusAll}}})}))}},me?o.createElement(x.A,null):o.createElement(k.A,null)))),me&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:i,oneBorderRadiusValue:y,setOneBorderRadiusValue:w,elementSettings:e}))),z.formFieldBoxShadowEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},l("Box shadow"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{const t=i.getFieldsValue(!0);setTimeout((()=>{be((e=>!e)),ge?(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:O.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}}})}))}},ge?o.createElement(x.A,null):o.createElement(k.A,null)))),ge&&o.createElement("div",{style:{marginBottom:4}},o.createElement(U,{boxShadow:v}))),z.formFieldVisibilityEnabled&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("Display control")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(fe,{elementSettings:e,form:i})))),z.formFieldAmpVisibilityEnabled&&e.ampShow&&o.createElement(o.Fragment,null,o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement("div",{className:"form-group-title"},l("AMP visibility")),o.createElement(b.A,{gutter:20,style:{marginBottom:4}},o.createElement(E.A,{span:12},o.createElement(Pe,null))))))))};var ll=l(94780);const ol=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),[l]=u.A.useForm(),{TextArea:a}=_.A,i=(0,D.XW)();(0,o.useEffect)((()=>{e&&l.setFieldsValue({...e})}),[l,e]);return o.createElement(u.A,{form:l,layout:"vertical",name:"selected_variable_form",initialValues:{value:""},onValuesChange:t=>{i({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:t})},autoComplete:"off"},o.createElement("div",{className:"selected_form-props-wrapper"},o.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:o.createElement(ll.A,null)},style:{marginBottom:35}},o.createElement(a,{rows:4,placeholder:t("Variable value")}))))};var al=l(40186);const{useToken:il}=c.A,rl=({elementSettings:e,setElementSettings:t,postfix:l="",form:a,handleSelect:i})=>{const{__:n}=(0,L.s9)(),{token:d}=il(),m=(0,Ve.rD)(),s=(0,D.XW)(),c="src"+l,g="title"+l,b="alt"+l,E="link"+l,h="imgReplacer"+l,v=(0,o.useRef)(null),S=(0,o.useRef)(null),B=(0,o.useRef)(null),k=(0,o.useRef)(null),x=(0,o.useRef)(null),w=(0,o.useRef)(null),R=(0,o.useRef)(null),T=(0,o.useRef)(null),[I,P]=(0,o.useState)(""),[C,M]=(0,o.useState)(""),[V,z]=(0,o.useState)(""),[H,j]=(0,o.useState)(!1),[W,G]=(0,o.useState)("https://");(0,o.useEffect)((()=>{var t,l,o;M(null===(t=e.images)||void 0===t?void 0:t[b]),z(null===(l=e.images)||void 0===l?void 0:l[g]),P(null===(o=e.images)||void 0===o?void 0:o[E])}),[e,b,g,E]);return o.createElement(o.Fragment,null,("img"===e.type||"video"===e.type||"carousel"===e.type)&&o.createElement(u.A.Item,{style:{marginBottom:0}},o.createElement(N.A,{form:a,label:n("Image path"),name:c,placeholder:n("Image path"),elementSettings:e,tooltipTitle:""})),o.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},o.createElement(A.A,{size:8},o.createElement(p.A,{title:C||n("Alternative text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!C}),onClick:()=>{C?(M(""),a.setFieldValue("alt",""),s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[b]:""}})):(M(B.current&&B.current.input.value?B.current.input.value:"..."),setTimeout((()=>{B.current.focus()})))},ref:k},o.createElement("span",{className:"addon-text-content"},"Alt"))),m.formFieldImageTitleEnabled&&o.createElement(p.A,{title:V||n("Tooltip text"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!V}),onClick:()=>{V?(z(!1),a.setFieldValue("title",""),s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[g]:""}})):(z(x.current&&x.current.input.value?x.current.input.value:"..."),setTimeout((()=>{x.current.focus()})))},ref:w},o.createElement("span",{className:"addon-text-content"},"Title"))),o.createElement(p.A,{title:I||n("Hyperlink URL"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":!!I}),icon:o.createElement(y.A,{className:"selected-td-form__icon-radius"}),onClick:()=>{I?(P(""),a.setFieldValue(E,""),s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[E]:""}})):(P(v.current&&v.current.input.value?v.current.input.value:"..."),setTimeout((()=>{v.current.focus()})))},ref:S})),o.createElement(p.A,{title:n("Image replacer"),placement:"bottom",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper")},o.createElement(f.Ay,{className:r()("selected-td-form__button",{"selected-td-form__button--active":H}),icon:o.createElement(F.A,{icon:"Replacer",className:"selected-td-form__icon-radius"}),onClick:()=>{j(!H),H?(a.setFieldValue(h,""),s({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:e.type,settings:{[h]:""}})):setTimeout((()=>R.current.focus()))},ref:T}))),o.createElement(A.A,{size:8},o.createElement(p.A,{title:n("Remove slide"),placement:"bottom"},o.createElement(f.Ay,{type:"text",onClick:o=>{var i;const r=a.getFieldsValue(!0),n=+l.substring(1),d=Object.keys(null===r||void 0===r?void 0:r.images).reduce(((e,t)=>(t.includes(l)||(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:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,caption:e.caption,settings:{...e,carouselImages:m}}),a.setFieldsValue({images:d})},icon:o.createElement(al.A,null)})))),(!!I||!!C||!!V||!!H)&&o.createElement("div",null,!!I&&o.createElement(p.A,{trigger:["hover"],title:n("Hyperlink URL"),placement:"bottom"},o.createElement(u.A.Item,{name:E,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{addonBefore:o.createElement(je.Ai,{linkProtocol:W,handleLinkProtocolsChange:e=>{a.setFieldValue("LinkName","mergetag"!==e?e:""),G(e)},__:n}),placeholder:n("Hyperlink URL"),allowClear:!0,ref:v,onChange:e=>{""===e.target.value?P("..."):(S.current.classList.add("selected-td-form__button--active"),P(e.target.value));const t=e.target.value;"https://"===t.substring(0,8)?G("https://"):"mailto:"===t.substring(0,7)?G("mailto:"):"tel:"===t.substring(0,4)?G("tel:"):"sms:"===t.substring(0,4)?G("sms:"):"ftp://"===t.substring(0,6)?G("ftp://"):"skype:"===t.substring(0,6)?G("skype:"):"viber:"===t.substring(0,6)?G("viber:"):G("")},onSelect:i,prefix:o.createElement(je.RM,{linkProtocol:W})}))),!!C&&o.createElement(p.A,{trigger:["hover"],title:n("Alternative text"),placement:"bottom"},o.createElement(u.A.Item,{name:b,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{placeholder:n("Alternative text"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Alt"),onChange:e=>{""===e.target.value?M("..."):(k.current.classList.add("selected-td-form__button--active"),M(e.target.value))},ref:B,onSelect:i}))),m.formFieldImageTitleEnabled&&!!V&&o.createElement(p.A,{trigger:["hover"],title:n("Tooltip text"),placement:"bottom"},o.createElement(u.A.Item,{name:g,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{placeholder:n("Enter the title of the image"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},"Title"),onChange:e=>{""===e.target.value?z("..."):(w.current.classList.add("selected-td-form__button--active"),z(e.target.value))},ref:x,onSelect:i}))),!!H&&o.createElement(p.A,{trigger:["hover"],title:n("Image src"),placement:"bottom"},o.createElement(u.A.Item,{name:h,className:"selected-image-form__alt",style:{marginTop:d.formItemMarginBottomXS,marginBottom:0}},o.createElement(_.A,{placeholder:n("\u0421ode that will replace the image `src`"),allowClear:!0,prefix:o.createElement("span",{className:"addon-text-content"},n("Image src")),onChange:e=>{""!==e.target.value&&T.current.classList.add("selected-td-form__button--active")},ref:R,onSelect:i})))))},nl={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:dl}=c.A,ml=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:l}=dl(),[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)(Oe.Ct),c=(0,n.d4)(Oe.CS),[y,S]=(0,o.useState)(!0),[B,w]=(0,o.useState)(!0),[R,T]=(0,o.useState)(!1),[N,I]=(0,o.useState)(!1),[C,M]=(0,o.useState)("https://"),[V,z]=(0,o.useState)(null===a||void 0===a?void 0:a.getFieldsValue(!0)),[H,j]=(0,o.useState)(e),[W,G]=(0,o.useState)(null),[U,X]=(0,o.useState)(),[$,Y]=(0,o.useState)(!1),[K,Q]=(0,o.useState)(!1),[J,Z]=(0,o.useState)({start:0,end:0}),ee=(0,o.useRef)(null),te=`selected_${H.type}_form_link`,le=(0,n.d4)(Oe.Fv),oe=(0,n.d4)(Oe.yy),ae=le&&"bottom"!==oe;(0,o.useEffect)((()=>{$&&ee.current&&ee.current.focus()}),[$]),(0,o.useEffect)((()=>{j(e)}),[e]);const ie=(0,n.d4)(We.GH);(0,o.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(O.Ru.SANDBOX_ADD_MERGETAG,e),t.stopPropagation(),t.preventDefault()})))}),[ie,X,t,Y,d]);(0,o.useEffect)((()=>{const e=({target:e})=>{e.closest('[id="merge_tags_wrapper"]')||G(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,o.useEffect)((()=>{const e=null===a||void 0===a?void 0:a.getFieldsValue(!0);z(e)}),[a]);const re=({target:e})=>{if(e&&!K){const{selectionStart:t,selectionEnd:l}=e;Z({start:t,end:l})}Q(!1)};(0,o.useEffect)((()=>{if(H.settings){var e,t,l,o,i,r,n,d,m,s,c,u,p,g,b;const _=H.settings,y=(0,je.AO)(_);var E,h,f,v,A;if(null===a||void 0===a||a.setFieldsValue(y),z(y),_.link&&M((0,je.TW)(_.link,"https://")),!(0,je.ok)(null===(e=_.borderRadius)||void 0===e?void 0:e.all))(0,je.ok)(null===(E=_.borderRadius)||void 0===E?void 0:E.topLeft)||(0,je.ok)(null===(h=_.borderRadius)||void 0===h?void 0:h.bottomLeft)||(0,je.ok)(null===(f=_.borderRadius)||void 0===f?void 0:f.topRight)||(0,je.ok)(null===(v=_.borderRadius)||void 0===v?void 0:v.bottomRight)?S(!1):(0,je.ok)(null===(A=_.borderRadius)||void 0===A?void 0:A.all)||S(!0);(0,je.ok)(null===(t=_.mobileBorderRadius)||void 0===t?void 0:t.topLeft)||(0,je.ok)(null===(l=_.mobileBorderRadius)||void 0===l?void 0:l.bottomLeft)||(0,je.ok)(null===(o=_.mobileBorderRadius)||void 0===o?void 0:o.topRight)||(0,je.ok)(null===(i=_.mobileBorderRadius)||void 0===i?void 0:i.bottomRight)?w(!1):w(!0),T(!(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)),I(!(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,H]);(0,Ce.A)((e=>{const t=e.data.operation;t===O.Ru.APPLICATION_OPEN_IMAGE_AI_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_AI))):t===O.Ru.APPLICATION_OPEN_IMAGE_UPLOAD_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_UPLOAD))):t===O.Ru.APPLICATION_OPEN_IMAGE_EDIT_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_EDIT))):t===O.Ru.APPLICATION_OPEN_IMAGE_GIF_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_GIF))):t===O.Ru.APPLICATION_OPEN_IMAGE_STOCK_POPUP?(i((0,Me.tm)(H.settings.src)),i((0,Fe.qf)(O.lx.UPLOAD_IMAGE_MODAL_STOCK))):t===O.Ru.APPLICATION_CLOSE_IMAGE_EDIT_POPUP&&(i((0,Fe.Os)()),i((0,Fe.Oo)()))}));return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:nl,onValuesChange:e=>{const t=(0,je.Ze)(H.settings,a,e);m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,caption:t.caption,settings:t}),j((e=>({...e,settings:{...e.settings,...t}})))},autoComplete:"off",className:"element-controls"},!ae&&o.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"},o.createElement(g.A,{className:"selected_form-mobile-props-title",message:t("Appearance on mobile devices"),type:"info"})),s===O.ND&&c.styles?o.createElement("div",{id:"selected_element_form_mobile_props",className:"selected_form-mobile-props"},o.createElement("div",{className:"selected_form-mobile-props-wrapper"},o.createElement("p",null,t("No properties to edit.")))):o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(p.A,{trigger:["hover"],title:t("Link for all slides"),placement:"bottom"},o.createElement(u.A.Item,{name:"link"},o.createElement(_.A,{addonBefore:o.createElement(je.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:o.createElement(je.RM,{linkProtocol:C})}))),o.createElement(h.A,{className:"selected-td-form__divider"}),r.mergeTagsShow&&U&&o.createElement(o.Fragment,null,o.createElement(E.A,{span:24,id:"merge_tags_wrapper"},o.createElement(u.A.Item,{style:{marginBottom:l.formItemMarginBottomMD,marginTop:l.formItemMarginBottomMD}},o.createElement(f.Ay,{id:"merge_tags_button",icon:o.createElement(F.A,{icon:"MergeTags"}),style:{width:"100%",display:$?"none":"block"},onClick:()=>Y(!0)},t("Merge tags")),o.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 l=t.map(((t,l)=>{const a=t.label.split(new RegExp(`(${e})`,"gi"));return o.createElement("span",{key:t.value},0!==l&&o.createElement("span",null,"\xa0/\xa0"),a.map(((t,l)=>t.toLowerCase()===e.toLowerCase()?o.createElement("span",{key:l,style:{color:"red"}},t):t)))}));return o.createElement("div",{title:t.map((e=>e.label)).join(" / ")},l)}},spellCheck:"false",getPopupContainer:e=>e.closest(".email-pane__collapse-wrapper"),onChange:(e,t)=>{if(Y(!1),e){const l=ie.syntax.length>1?U.findIndex((e=>e.key===t[0].key)):0,o=ie.syntax[l].replace("%value%",e[e.length-1]),i=`selected_${H.type}_form${"carousel"===H.type?"_images":""}`;["imgReplacer","title","alt","src","link"].some((e=>null===W||void 0===W?void 0:W.getAttribute("id").includes(`${i}_${e}`)))||null!==W&&void 0!==W&&W.getAttribute("id").includes(te)?((e,t)=>{const l=document.getElementById(t);if(l){var o,i;const d=`selected_${H.type}_form_${t.includes("__images_")?"_images":""}_`,s=t.substring(t.indexOf(d)+d.length),c=null===(o=l.value)||void 0===o?void 0:o.substring(0,J.start),u=null===(i=l.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=H.settings)||void 0===r?void 0:r.carouselImages)||[]]},p.carouselImages[s.split("_")[1]][s.split("_")[0]]=c+e+u;else if(H.type===O.bV.CAROUSEL&&te===t){var n;p={[s]:c+e+u,carouselImages:[...(null===(n=H.settings)||void 0===n?void 0:n.carouselImages.map((t=>({...t,link:c+e+u}))))||[]]}}m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...H.settings,...p}}),j((e=>({...e,settings:{...e.settings,...p}}))),a.setFieldValue(s,c+e+u),l.focus(),setTimeout((()=>{l.selectionStart=J.start,l.selectionEnd=J.start+e.length}),400),Q(!0)}})(o,null===W||void 0===W?void 0:W.getAttribute("id")):(a.setFieldValue("imgReplacer",o),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...H.settings,imgReplacer:o}}),j((e=>({...e,settings:{...e.settings,imgReplacer:o}}))))}},style:{display:$?"block":"none"},open:$,onKeyDown:e=>{"Escape"===e.key&&Y(!1)}}))),o.createElement(h.A,{className:"selected-td-form__divider"})),o.createElement(u.A.List,{name:"images",initialValue:null===V||void 0===V?void 0:V.images},(()=>{var e,t;return o.createElement("div",{style:{paddingTop:l.formItemMarginBottomMD+4}},null===H||void 0===H||null===(e=H.settings)||void 0===e||null===(t=e.carouselImages)||void 0===t?void 0:t.map(((e,t)=>o.createElement("div",{className:"carousel__slide",key:t},o.createElement(rl,{elementSettings:V,setElementSettings:j,postfix:"_"+t,form:a,handleSelect:re})))))})),o.createElement(E.A,{span:24},o.createElement(u.A.Item,{style:{marginBottom:l.formItemMarginBottomMD}},o.createElement(f.Ay,{id:"add_slide_button",icon:o.createElement(F.A,{icon:"AddSlide"}),style:{width:"100%"},onClick:()=>(()=>{var e,t;const{width:l,height:o,renderedWidth:a,renderedHeight:i}=(null===H||void 0===H||null===(e=H.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:l.value,dim:"px"},height:{value:o.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===H||void 0===H||null===(t=H.settings)||void 0===t?void 0:t.carouselImages,r];m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...H.settings,carouselImages:n}}),j((e=>({...e,settings:{...e.settings,carouselImages:n}})))})()},t("Add slide")))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(b.A,{gutter:20,style:{marginTop:l.formItemMarginBottomMD-10}},o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"loop",valuePropName:"checked",style:{marginBottom:l.formItemMarginBottomMD-6}},o.createElement(q.A,{size:"small",id:"Loop"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Loop"},t("Loop"))))),o.createElement(E.A,{span:12},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"autoplay",valuePropName:"checked",style:{marginBottom:l.formItemMarginBottomMD-6}},o.createElement(q.A,{size:"small",id:"Autoplay"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Autoplay"},t("Autoplay")))))),o.createElement(h.A,{className:"selected-td-form__divider"}),r.formFieldBorderRadiusEnabled&&o.createElement(o.Fragment,null,o.createElement(b.A,{gutter:10,align:"middle"},o.createElement(E.A,{span:20},o.createElement("div",{className:"form-group-title"},t("Border radius"))),o.createElement(E.A,{span:4,align:"right"},o.createElement(f.Ay,{className:"selected-td-form__button ghost-button",type:"text",onClick:()=>{setTimeout((()=>{T((e=>!e)),a.setFieldValue("borderRadiusAll",R?0:5),m({operation:O.Ru.SANDBOX_ELEMENT_SETTINGS_SET,type:O.bV.CAROUSEL,settings:{...H.settings,borderRadius:{all:R?"":5}}}),j((e=>({...e,settings:{...e.settings,borderRadius:{all:R?null:5}}})))}))}},R?o.createElement(x.A,null):o.createElement(k.A,null)))),R&&o.createElement("div",{style:{marginBottom:4}},o.createElement(P.A,{form:a,oneBorderRadiusValue:y,setOneBorderRadiusValue:S,elementSettings:H.settings}))))))},sl={animate:!0,expandSingleSection:!0,sections:[{expanded:!1,index:0}]},{useToken:cl}=c.A,ul=({elementSettings:e})=>{const{__:t}=(0,L.s9)(),{token:l}=cl(),[a]=u.A.useForm(),i=(0,D.XW)(),[r,n]=(0,o.useState)(e);(0,o.useEffect)((()=>{n(e)}),[e]),(0,o.useEffect)((()=>{if(r.settings){const e=r.settings,t=(0,je.AO)(e);null===a||void 0===a||a.setFieldsValue(t)}}),[a,r]);return o.createElement(u.A,{form:a,layout:"vertical",name:"selected_carousel_form",initialValues:sl,onValuesChange:e=>{const t=(0,je.Ze)(r.settings,a,e);i({operation:O.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"},o.createElement("div",{id:"selected_element_form_desktop_props"},o.createElement("div",{className:"selected_form-props-wrapper"},o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:15},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"expandSingleSection",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"ExpandSingleSection"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"ExpandSingleSection"},t("Expand only one section"))))),o.createElement(E.A,{span:9},o.createElement(A.A,{size:10,align:"baseline"},o.createElement(u.A.Item,{name:"animate",valuePropName:"checked"},o.createElement(q.A,{size:"small",id:"Animate"})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:"Animate"},t("Animate")))))),o.createElement(h.A,{className:"selected-td-form__divider"}),o.createElement(u.A.List,{name:"sections"},(()=>{var e,a;return o.createElement("div",{style:{paddingTop:l.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,l)=>{var a,d;return o.createElement(b.A,{gutter:24,key:`expanded_${l}`},o.createElement(E.A,{span:20},o.createElement(A.A,{size:10,align:"baseline"},o.createElement("span",{style:{position:"relative",top:2}},t("Section ")+(l+1)),o.createElement(u.A.Item,{name:`expanded_${l}`},o.createElement(q.A,{size:"small",id:`expanded_${l}`,checked:e.expanded})),o.createElement("span",{style:{position:"relative",top:2}},o.createElement("label",{htmlFor:`expanded_${l}`},t("expanded"))))),o.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&&o.createElement(f.Ay,{type:"text",icon:o.createElement(al.A,null),style:{marginRight:"auto"},onClick:()=>{return e=l,n((t=>{var l;return{...t,settings:{...t.settings,sections:null===(l=r.settings.sections)||void 0===l?void 0:l.filter(((t,l)=>l!==e))}}})),void i({operation:O.Ru.SANDBOX_ACCORDION_REMOVE_SECTION,settings:{index:e}});var e}})))})))})),o.createElement(b.A,{gutter:20},o.createElement(E.A,{span:24},o.createElement(u.A.Item,{style:{marginBottom:l.formItemMarginBottomMD}},o.createElement(f.Ay,{style:{width:"100%",display:"block"},icon:o.createElement(F.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:O.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"))))),o.createElement(h.A,{className:"selected-td-form__divider"}))))},pl=({className:e,formSettings:t,emailElementType:l})=>{const i=(0,n.wA)(),s=(0,He.Cb)(),c=(0,o.useRef)(),u=(0,n.d4)(Oe.B),p=(0,n.d4)(d.qX),g=(0,n.d4)(m.qX),b=l===O.Tm?p:g,[E,h]=(0,o.useState)(b);(0,o.useEffect)((()=>{h(b.type===O.bV.CAROUSEL||b.type===O.bV.IMG?t.settings:b)}),[b,t.settings]);return(0,Ce.A)((e=>{const t=e.data.operation,l=e.data.action;if(t===O.Ru.APPLICATION_ACTION){function o(e,t=null){const l={[e]:t||!E[e]};s(l,E.type),i((0,d.G_)(l)),h((e=>({...e,...l})))}"toggle_strong"===l&&o("textStrong"),"toggle_italic"===l&&o("textItalic"),"toggle_underline"===l&&o("textUnderline"),"toggle_strikethrough"===l&&o("textStrikethrough"),"textAlign_left"===l&&o("textAlign","left"),"textAlign_right"===l&&o("textAlign","right"),"textAlign_center"===l&&o("textAlign","center")}})),o.createElement(a.A,{nodeRef:c,in:u===O.yI,timeout:300,classNames:"transition"},o.createElement("div",{ref:c,className:r()("selected-element-panel-content",{[e]:e})},(b.type===O.bV.IMG||b.type===O.bV.COUNTDOWN||b.type===O.bV.VIDEO)&&o.createElement(Ue,{elementSettings:b}),b.type===O.bV.TEXT&&o.createElement(st,{elementSettings:b}),b.type===O.bV.LINK&&o.createElement(Rt,{elementSettings:b}),b.type===O.bV.TABLE&&o.createElement(xt,{elementSettings:b}),(b.type===O.bV.TD||b.type===O.bV.STRUCTURE||b.type===O.bV.GROUP||b.type===O.bV.COLUMN)&&o.createElement(Ht,{elementSettings:b}),b.type===O.bV.VAR&&o.createElement(ol,{elementSettings:b}),b.type===O.bV.BUTTON&&o.createElement(tl,{elementSettings:b}),b.type===O.bV.DIV&&o.createElement(Ut,{elementSettings:b}),b.type===O.bV.VINDENT&&o.createElement(Tt,{elementSettings:b}),b.type===O.bV.FLOAT_BLOCK&&o.createElement(Qt,{elementSettings:b}),t.type===O.bV.CAROUSEL&&o.createElement(ml,{elementSettings:t}),t.type===O.bV.ACCORDION&&o.createElement(ul,{elementSettings:t})))};pl.defaultProps={className:null};const gl=pl},52995:(e,t,l)=>{l.d(t,{A:()=>T});var o=l(98173),a=l(2604),i=l(62272),r=l(40120),n=l(27499),d=l(48753),m=l(37969),s=l(8218),c=l(49823),u=l(67034),p=l(64909),g=l(94780),b=l(12543),E=l(8807),h=l(23424),f=l(47014),v=l(65716),A=l(40835),_=l(40277),y=l(32947),S=l(86095),B=l(90614),k=l(15626),x=l(27941);const{useToken:w}=r.A,R=({isModalVisible:e,email:t})=>{const{__:l}=(0,b.s9)(),[r]=n.A.useForm(),R=(0,a.wA)(),{emailId:T}=(0,i.g)(),N=(0,a.d4)(f.C1),[I,P]=(0,A.lg)(),{token:C}=w(),L=(0,p.hN)(),F=(0,a.Pj)(),[O,D]=(0,o.useState)(!1),M=t.project,[V,z]=(0,v.OD)(),{data:H}=v.Nq.endpoints.getProject.select(+M)(F.getState()),{testEmails:j}=(0,x.rD)(),[W,G]=(0,o.useState)([]),[U,X]=(0,o.useState)(!1),q=(0,B.ml)(k.AZ.ON_SEND_EMAIL_MODAL_ID);(0,o.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,o.useEffect)((()=>{if(H&&!y.EW.isPlugin){const{owner:e,admins:t,users:l,invited_users:o}=H.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))),o&&o.map((({invited_user_email:e})=>a.push(e))),l&&l.map((({user_email:e})=>a.push(e))),e&&a.push(e.user_email),t&&t.map((({user_email:e})=>a.push(e))),H.projects_test_emails){const e=H.projects_test_emails.map((({projects_test_email:e})=>e));a.push(...e)}const r=Array.from(new Set(a));a.length&&G(r.map((e=>({value:e}))))}}),[H,M]),(0,o.useEffect)((()=>{y.EW.isPlugin&&G(j.map((e=>({value:e}))))}),[j]),(0,o.useEffect)((()=>{var e;const t=localStorage.getItem(y.V0.em_test_emails);if(t&&O&&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,O,r]),(0,o.useEffect)((()=>{r.setFieldsValue({subject:t.subject})}),[r,t.subject]);const $=(0,S.fn)();return(0,o.useEffect)((()=>{if(P.isSuccess&&U){var e;if(200!==(null===(e=P.data)||void 0===e?void 0:e.status)){var o,a;(0,_.p6)({error:{data:{code:null===(o=P.data)||void 0===o?void 0:o.code,message:null===(a=P.data)||void 0===a?void 0:a.message}}},L)}else{const e=[...new Set([...W.map((e=>e.value)),...r.getFieldValue("recipients")])];V({projectId:M,projects_test_emails:e.map((e=>({projects_test_email:e})))});const o=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({...o,[M]:[...new Set(a)]})),(0,_.wB)(l("The email \u201c")+t.title+l("\u201d was successfully sent."),L)}X(!1),r.resetFields(),R((0,h.Oo)())}}),[P,r,M,V,W,U,R,t.title,z,l,L]),(0,o.useEffect)((()=>{z.isError&&((0,_.p6)(z,L),X(!1),r.resetFields(),R((0,h.Oo)()))}),[R,z,r,L]),(0,o.useEffect)((()=>{r.setFieldsValue({subject:t.subject||t.title})}),[t,r]),o.createElement(d.A,{width:572,title:o.createElement("div",null,o.createElement(E.A,{icon:"SendOutlined"})," ",l("Send a test email")),className:"blocks-modal",open:O,onCancel:()=>{R((0,h.Oo)()),r.resetFields()},centered:!0,footer:[o.createElement(m.Ay,{key:"submit",size:"large",className:"em-analytics__email-send-test",type:"primary",htmlType:"submit",form:"Send mail",loading:z.isLoading,icon:o.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:T,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;I(e),X(!0)})).catch((e=>{}))},disabled:P.isLoading},l("Send"))],forceRender:!0},o.createElement(n.A,{form:r,layout:"vertical",name:"send_mail_form",initialValues:{subject:t.subject||t.title,recipients:[]},autoComplete:"off"},o.createElement(n.A.Item,{label:l("Subject"),name:"subject",rules:[{required:!1,message:l("Please type subject")}]},o.createElement(s.A,{size:"large",placeholder:l("Type subject")})),o.createElement(n.A.Item,{label:l("Recipients"),name:"recipients",tooltip:{title:l("The test email will be sent to the specified addresses."),icon:o.createElement(g.A,null)},rules:[{required:!0,validator:(e,t)=>t.length>10?Promise.reject(new Error(l("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(l("Please type correct emails"))):Promise.reject(new Error(l("Please type emails")))}]},o.createElement(c.A,{size:"large",mode:"tags",placeholder:l("Add up to 10 recipients"),tooltip:{title:"Tooltip with customize icon",icon:o.createElement(g.A,null)},options:W,tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(u.A,{color:C.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.getElementById("send_mail_form")}))))};R.defaultProps={isModalVisible:!1,email:null};const T=R},91959:(e,t,l)=>{l.d(t,{A:()=>le});var o=l(98173),a=l(40120),i=l(27499),r=l(8218),n=l(49823),d=l(67034),m=l(94674),s=l(13785),c=l(49856),u=l(29123),p=l(94780),g=l(2604),b=l(62272),E=l(12543),h=l(85591),f=l.n(h),v=l(75576),A=l(59010),_=l(201),y=l(66964),S=l(37969),B=l(38927),k=l(40186),x=l(35076),w=l(71879),R=l(76937),T=l(48753),N=l(64909),I=l(83027),P=l(23424),C=l(32947);const L=({group:e,refetch:t})=>{const{__:l,_x:a}=(0,E.s9)(),n=(0,g.wA)(),[d]=i.A.useForm(),m=(0,o.useRef)(null),s=(0,g.d4)(P.cL)===C.lx.EDIT_GROUP_NAME_MODAL,c=(0,N.hN)(),{id:u=null,name:p=""}=e,b=()=>n((0,P.Oo)()),[h,f]=(0,I.CE)();(0,o.useEffect)((()=>{s&&d.setFieldsValue({name:p})}),[s,p,d]);const v=()=>{d.validateFields().then((({name:e})=>{h({id:u,data:{name:e}}).then((({data:i,error:r})=>{r?(c.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:r.data.code}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:r.data.message}}),placement:"bottomRight"}),d.setFieldValue("name",e)):(t().then((({data:e})=>{if(e){var t,l,o;const a=null===(t=e[0])||void 0===t||null===(l=t.children)||void 0===l||null===(o=l.find((e=>e.id===u)))||void 0===o?void 0:o.name;d.setFieldValue("name",a)}})),b(),c.success({message:l("The group \u201c")+e+a("\u201d was successfully changed to \u201c","group")+i.name+l("\u201d."),placement:"bottomRight"}))}))}))};return o.createElement(T.A,{title:l("Change group name"),open:s,onOk:v,onCancel:b,className:"new-group-name-modal",centered:!0,footer:[o.createElement(S.Ay,{key:"submit",type:"primary",size:"large",loading:f.isLoading,onClick:v},l("Change name"))]},o.createElement(i.A,{form:d,layout:"vertical",name:"rename_group_form",onFinish:v,initialValues:{remember:!1,name:p},autoComplete:"off",style:{paddingTop:10}},o.createElement(i.A.Item,{name:"name",rules:[{required:!0,message:l("Please enter the group name")}]},o.createElement(r.A,{disabled:f.isLoading,size:"large",placeholder:l("Enter the group name"),ref:m,style:{marginBottom:5}}))))};var F=l(8807),O=l(1047);const{useToken:D}=a.A,M=({className:e,refetchProjectGroups:t,isLoading:l})=>{const{__:a,_x:r}=(0,E.s9)(),m=(0,g.wA)(),s=(0,N.hN)(),{modal:c}=v.A.useApp(),{confirm:u}=c,{token:p}=D(),b=(0,g.d4)(O.UI),[h]=(0,I.Lh)(),T=(e,l)=>{u({maskClosable:!0,centered:!0,title:r("Are you sure to delete \u201c","group")+l+a("\u201d group and all nested groups?"),icon:o.createElement(k.A,{style:{color:"#ff4d4f"}}),okText:a("Yes"),cancelText:a("No"),onOk:()=>(e=>{h(e).unwrap().then((e=>{null!==e&&void 0!==e&&e.deleted&&(s.success({message:a("The group \u201c")+e.previous.name+r("\u201d was successfully deleted.","recovery"),placement:"bottomRight"}),t())})).catch((e=>{s.error({message:o.createElement("div",{dangerouslySetInnerHTML:{__html:e.data.code}}),description:o.createElement("div",{dangerouslySetInnerHTML:{__html:e.data.message}}),placement:"bottomRight"})}))})(String(e))})};let M=e=>[{label:a("Rename"),key:"Rename",icon:o.createElement(x.A,{style:{fontSize:"16px"}}),onClick:()=>{return t=e.id,l=e.name,m((0,P.qf)(C.lx.EDIT_GROUP_NAME_MODAL)),void z({id:t,name:l});var t,l}},{label:a("Remove"),icon:o.createElement(k.A,{style:{fontSize:"16px"}}),key:"Remove",style:{color:"#ff4d4f"},onClick:()=>T(e.id,e.name)}];const[V,z]=(0,o.useState)({id:null,name:""});return o.createElement("div",{className:f()("groups-management",{[e]:e})},l?o.createElement(A.A,{active:!0}):o.createElement(_.A,null,!(null===b||void 0===b||!b.length)&&(null===b||void 0===b?void 0:b.map(((e,t)=>{var l;return o.createElement(y.A,{key:e.id,span:24},o.createElement(i.A.Item,{name:`group_${e.id}`,style:{marginBottom:p.formItemMarginBottomMD},label:o.createElement("div",{style:{display:"flex",justifyContent:"space-between",width:"100%",alignItems:"center"}},o.createElement("span",null,e.name),o.createElement(S.Ay,{type:"text",className:"groups-management__group_menu","data-group-id":e.id,size:"large"},o.createElement(B.A,{className:"groups-management__group_menu-inner",placement:"bottomLeft",menu:{items:M(e)},trigger:["hover"]},o.createElement("span",{className:"groups-management__actions"},o.createElement(w.A,null))))),className:"groups-management__group-select",rules:[{message:"Please input category name!",type:"array"}]},o.createElement(n.A,{mode:"tags",style:{width:"100%"},placeholder:a("Type category here"),options:null===(l=e.children)||void 0===l?void 0:l.map((e=>({label:e.name,value:String(e.id)}))),tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(d.A,{color:p.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})))}))),o.createElement(y.A,{span:24},o.createElement(i.A.Item,{style:{marginBottom:p.formItemMarginBottomMD}},o.createElement(S.Ay,{id:"add_group_button",icon:o.createElement(F.A,{icon:"AddSlide"}),style:{width:"100%"},onClick:()=>m((0,P.qf)(C.lx.ADD_NEW_GROUP_MODAL))},a("Add group"))))),o.createElement(R.A,{taxonomy:C.bV.GROUP}),o.createElement(L,{group:V,refetch:t}))};var V=l(68984),z=l(98845),H=l(65716),j=l(12741),W=l(39206),G=l(27941),U=l(40277);const{useToken:X}=a.A,{title:q,description:$,tags:Y,type:K,is_template:Q,group:J}={title:"title",description:"description",tags:"tags",type:"type",is_template:"is_template",group:"group"},Z={[q]:"",[$]:"",[Y]:[],[Q]:!1},ee={[$]:"",[Y]:[],[K]:""};const te=({className:e,element:t})=>{var l,a;const{__:h}=(0,E.s9)(),{projectId:v}=(0,b.g)(),A=(0,g.wA)(),[_]=i.A.useForm(),{token:y}=X(),S=(0,G.rD)(),B=(0,g.Pj)(),k=(0,g.d4)(O.UI),{data:x}=(0,V.h1)(),{data:w}=(0,b.KC)(),R=t.hasOwnProperty("type")?C.IE:C.Tm,T=t.hasOwnProperty("type")?C.YY:C.zh,{refetch:N,isLoading:P,isFetching:L,isUninitialized:F,isSuccess:D}=(0,I.Oo)({parent:null===(l=w.group)||void 0===l?void 0:l[0]},{skip:!(null!==(a=w.group)&&void 0!==a&&a[0])});(0,o.useEffect)((()=>{!F&&N()}),[F,N]);const[Q,te]=(0,o.useState)([]),[le,oe]=(0,o.useState)([]),[ae,ie]=(0,o.useState)(t.is_template||!1),{data:re}=H.Nq.endpoints.getProject.select(+v)(B.getState());(0,o.useEffect)((()=>{!F&&N()}),[t.group,N,F]),(0,o.useEffect)((()=>{if(D&&t.is_template&&t.group.length){const e=t.group;let l={};e.length&&k.length&&(null===e||void 0===e||e.forEach((e=>{null===k||void 0===k||k.forEach((t=>{let o=t.children.find((t=>t.id===e));o&&(l.hasOwnProperty(t.id)||(l[t.id]=[]),l[t.id].push({label:o.name,value:o.id}))}))})));let o={};for(let t in l)l.hasOwnProperty(+t)&&(o[`group_${t}`]=l[t].map((e=>({...e,value:String(e.value)}))));_.setFieldsValue(o)}}),[_,k,t.is_template,t.group,D]),(0,o.useEffect)((()=>{var e;oe(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,U.HT)(re,T)))||void 0===e?void 0:e.map((e=>({value:e.name,key:e.id}))))}),[re,T]),(0,o.useEffect)((()=>{if(t){var e,l;const o=null===(e=(0,U._q)(t,T))||void 0===e?void 0:e.map((e=>e.name)),a=t.emailtags||t.blocktags,i=null===(l=(0,U._q)(t,T))||void 0===l?void 0:l.filter((e=>a.includes(e.id))).map((e=>e.name));_.setFieldsValue({title:t.title,description:t.description,tags:t.tags||i||o,type:t.type})}}),[_,t,T]);(0,o.useEffect)((()=>{if(x){const e=x.schema.properties.acf.properties.type.items.enum;let t=[];const l={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 o in e)t.push({label:l[e[o]],value:e[o]});te(t)}}),[x,h]);return o.createElement("div",{className:f()("settings-panel",{[e]:e})},o.createElement(i.A,{form:_,layout:"vertical",name:"settings_panel_form",initialValues:R===C.Tm?{EmailInitialValues:Z}:ee,onValuesChange:e=>{const l=Object.keys(e)[0];switch(l.split("_")[0]){case q:t.isNew?A((0,j.BQ)(e[l])):A((0,O.VK)(e[l]));break;case J:A((0,O.Bu)({[l.split("_")[1]]:e[l]}));break;case $:R===C.Tm?t.isNew?A((0,j.Zs)(e[l])):A(z.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{description:e[l]})}))):t.isNew?A((0,W.AS)(e[l])):A(V.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{description:e[l]})})));break;case"is":t.isNew?A((0,j.TC)(e[l])):A(z.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{is_template:e[l]})})));break;case Y:{const o=e[l].map((e=>e.trim()));R===C.Tm?t.isNew?A((0,j.yY)(o)):A(z.GY.util.updateQueryData("getEmail",t.id,(e=>{Object.assign(e,{tags:o})}))):t.isNew?A((0,W.TB)(o)):A(V.VM.util.updateQueryData("getBlock",t.id,(e=>{Object.assign(e,{tags:o})})));break}case K:A(V.VM.util.updateQueryData("getBlock",t.id,(t=>{Object.assign(t,{type:e[l]})})));break;default:return}},autoComplete:"off"},S.subjectEnabled&&R===C.Tm&&o.createElement(i.A.Item,{label:h("Title"),name:q,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:o.createElement(p.A,null)}},o.createElement(r.A.TextArea,{placeholder:h("Type title here"),autoSize:{minRows:1}})),S.descriptionEnabled&&o.createElement(i.A.Item,{label:h("Description"),name:$,tooltip:{title:h("Description is used in other sections of the service."),icon:o.createElement(p.A,null)}},o.createElement(r.A.TextArea,{placeholder:h("Type your description here"),autoSize:{minRows:2}})),S.tagsEnabled&&o.createElement(i.A.Item,{label:h("Tags"),name:Y,tooltip:{title:h("Tags help you find the block in the list."),icon:o.createElement(p.A,null)},rules:[{message:"Please input your username!",type:"array"}]},o.createElement(n.A,{mode:"tags",style:{width:"100%"},placeholder:h("Type your tags here"),options:le,tagRender:e=>{const{label:t,closable:l,onClose:a}=e;return o.createElement(d.A,{color:y.colorPrimary,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},closable:l,onClose:a,style:{borderRadius:6}},t)},getPopupContainer:()=>document.querySelector(".email-settings__collapse")})),R===C.Tm&&S.isTemplateEnabled&&o.createElement(o.Fragment,null,o.createElement(m.A,{className:"selected-td-form__divider",style:{marginBottom:16}}),o.createElement(s.A,{title:t.isNew?h("Save email first."):h("Use this email as a template for creating future emails."),key:"isTemplate"},o.createElement(c.A,{size:10,align:"baseline"},o.createElement(i.A.Item,{name:"is_template",valuePropName:"checked",initialValue:ae},o.createElement(u.A,{size:"small",id:"setIsTemplate",onChange:e=>{ie(e)},disabled:t.isNew})),o.createElement("span",{className:"ant-form-item-switch-label",style:{position:"relative",top:2,fontSize:14,color:y.colorText}},o.createElement("label",{htmlFor:"setIsTemplate"},h("Is a template")))))),ae&&o.createElement(M,{element:t,refetchProjectGroups:N,isLoading:P||L}),R===C.IE&&o.createElement(i.A.Item,{name:K,label:h("Type"),tooltip:{title:h("Select the block type to find any block on the list faster."),icon:o.createElement(p.A,null)},rules:[{message:"Please input type!"}]},o.createElement(n.A,{placeholder:h("Choose block type"),options:Q,getPopupContainer:()=>document.querySelector(".email-settings__collapse")}))))};te.defaultProps={className:"",email:void 0};const le=te},45185:(e,t,l)=>{l.d(t,{A:()=>A});var o=l(98173),a=l(201),i=l(66964),r=l(10750),n=l.n(r),d=l(97946),m=l.n(d),s=l(50664),c=l.n(s),u=l(36529),p=l.n(u),g=l(22548),b=l.n(g),E=l(20065),h=l.n(E),f=l(40277);l(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 o.createElement("div",{className:"structures blocks-search__empty-wrapper"},o.createElement("div",{className:"structures__list"},o.createElement("div",null,v&&v.map(((l,r)=>o.createElement("div",{key:l.name},o.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,l.html),onDragStart:e=>t(e,l.html)},o.createElement(a.A,{gutter:[6,6],className:"structures__item-row"},l.sizeArray.map(((e,t)=>o.createElement(i.A,{span:e,key:l.name+t},o.createElement("div",{className:"structures__item-col"}))))))))))))}},58099:(e,t,l)=>{l.d(t,{A:()=>A});var o=l(98173),a=l(201),i=l(66964),r=l(7549),n=l.n(r),d=l(29539),m=l.n(d),s=l(6573),c=l.n(s),u=l(75424),p=l.n(u),g=l(43643),b=l.n(g),E=l(96786),h=l.n(E),f=l(40277);l(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 o.createElement("div",{className:"structures blocks-search__empty-wrapper"},o.createElement("div",{className:"structures__list"},o.createElement("div",null,v&&v.map(((l,r)=>o.createElement("div",{key:l.name},o.createElement("div",{className:"structures__item",draggable:!0,onClick:t=>e(t,l.html),onDragStart:e=>t(e,l.html)},o.createElement(a.A,{gutter:[6,6],className:"structures__item-row"},l.sizeArray.map(((e,t)=>o.createElement(i.A,{span:e,key:l.name+t},o.createElement("div",{className:"structures__item-col"}))))))))))))}},45271:(e,t,l)=>{l.d(t,{A:()=>u});var o=l(98173),a=l(2407),i=l.n(a),r=l(12543),n=l(64909),d=l(98845),m=l(68984),s=l(40277);const c=({element:e})=>{const{__:t,_x:l}=(0,r.s9)(),[a]=(0,d.dN)(),[i]=(0,m.OZ)(),c=(0,n.hN)(),u=(e,o)=>{if(e.error)return(0,s.p6)(e,c),!1;(0,s.wB)(t("The ")+(o.hasOwnProperty("type")?t("block"):l("email","letter"))+" "+t("\u201c")+e.data.title+t("\u201d")+t("was successfully")+" "+(o.lock?o.hasOwnProperty("type")?l("unlocked.","block"):l("unlocked.","email"):o.hasOwnProperty("type")?l("locked.","block"):l("locked.","email")),c)};return o.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,l)=>{l.d(t,{A:()=>A});var o=l(98173),a=l(47555),i=l(63719),r=l(49856),n=l(13785),d=l(37969),m=l(62272),s=l(50078),c=l(12543),u=l(47091),p=l(79890),g=l(35895),b=l(40277),E=l(32947),h=l(96734);const{Content:f}=a.A,{Paragraph:v}=i.A,A=()=>{const{__:e}=(0,c.s9)(),{projectId:t,emailId:l}=(0,m.g)(),i=(0,h.p)();let A=(0,m.Zp)();const _=i.get(E.A9.em_template_email)||l;(0,o.useEffect)((()=>{document.body.classList.remove("editor")}),[]);const y=o.createElement(o.Fragment,null,o.createElement(r.A,{size:10},o.createElement(n.A,{title:e("To emails"),placement:"left"},o.createElement(d.Ay,{type:"text",icon:o.createElement(s.A,null),onClick:()=>(0,b.XZ)(A,`/projects/${t}`),shape:"circle"})),o.createElement(v,{className:"ant-page-header-heading-title"},e("Select email template")),o.createElement(p.A,{isBlocks:!1,templateEmailId:_}))),S=o.createElement(o.Fragment,null);return o.createElement(a.A,{className:"template-page"},o.createElement(g.A,{leftBlock:y,rightBlock:S}),o.createElement(f,{className:"template-page__container"},o.createElement("div",{className:"template-page__content container"},o.createElement(u.A,{projectId:E.p5,emailsView:E.Y$,templateEmailId:_}))))}},37037:(e,t,l)=>{l.d(t,{A:()=>_});var o=l(98173),a=l(27499),i=l(99291),r=l(8218),n=l(94780),d=l(2604),m=l(85591),s=l.n(m),c=l(12543),u=l(98845),p=l(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{__:l}=(0,c.s9)(),m=(0,d.wA)(),[A]=a.A.useForm();(0,o.useEffect)((()=>{var e,l,o,a,i;t&&A.setFieldsValue({utm_source:(null===(e=t.utm_parameters)||void 0===e?void 0:e.utm_source)||"",utm_medium:(null===(l=t.utm_parameters)||void 0===l?void 0:l.utm_medium)||"",utm_campaign:(null===(o=t.utm_parameters)||void 0===o?void 0:o.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 o.createElement("div",{className:s()("settings-panel",{[e]:e})},o.createElement(a.A,{form:A,layout:"vertical",name:"settings_panel_form_utm",initialValues:v,onValuesChange:e=>{const l=Object.keys(e)[0];switch(l){case g:t.isNew?m((0,p.K3)(e[l])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_source:e[l]}})})));break;case b:t.isNew?m((0,p.ol)(e[l])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_medium:e[l]}})})));break;case E:t.isNew?m((0,p.P3)(e[l])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_campaign:e[l]}})})));break;case h:t.isNew?m((0,p.zH)(e[l])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_term:e[l]}})})));break;case f:t.isNew?m((0,p.mk)(e[l])):m(u.GY.util.updateQueryData("getEmail",t.id,(t=>{Object.assign(t,{utm_parameters:{...t.utm_parameters,utm_content:e[l]}})})));break;default:return}},autoComplete:"off"},o.createElement(i.A,{message:l("The specified parameters will be added to all links when exporting the email."),type:"info",showIcon:!0,style:{marginBottom:20}}),o.createElement(a.A.Item,{label:l("utm_source"),name:g,tooltip:{title:l("Mandatory. Indicates the traffic source. Example: utm_source=google"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("google")})),o.createElement(a.A.Item,{label:l("utm_medium"),name:b,tooltip:{title:l("Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("cpc")})),o.createElement(a.A.Item,{label:l("utm_campaign"),name:E,tooltip:{title:l("Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("spring_sale")})),o.createElement(a.A.Item,{label:l("utm_term"),name:h,tooltip:{title:l("Identifies search terms. For example: utm_term=running+shoes"),icon:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("running+shoes")})),o.createElement(a.A.Item,{label:l("utm_content"),name:f,tooltip:{title:l("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:o.createElement(n.A,null)}},o.createElement(r.A,{placeholder:l("textlink")}))))};A.defaultProps={className:"",email:void 0};const _=A},86774:(e,t,l)=>{l.d(t,{A:()=>B});var o=l(98173),a=l(63719),i=l(37969),r=l(38927),n=l(8218),d=l(13785),m=l(2604),s=l(85591),c=l.n(s),u=l(12543),p=l(80772),g=l(8807),b=l(48956),E=l(23424),h=l(871),f=l(47014),v=l(84572),A=l(27941),_=l(32947),y=l(6969);const{Text:S}=a.A,B=({onChange:e,value:t,validateStatus:l,placeholder:a,disabled:s,name:B,elementSettings:k,imageInfo:x})=>{var w,R;const T=(0,m.d4)(f.C1),N=(0,m.d4)(f.B$),I=(0,m.d4)(v.yN),P=(0,A.rD)(),{__:C}=(0,u.s9)(),[L,F]=(0,o.useState)({width:"",height:"",size:""}),[O,D]=(0,o.useState)(!1),[M,V]=(0,o.useState)(0);let z=(0,m.wA)();const H=(0,m.d4)(p.js),j=(0,m.d4)(p.Uf),W=(0,m.d4)(p.Ac),G=(0,m.d4)(E.cL),[U]=(0,h.FQ)();let X=!N&&(null===(w=T.id)||void 0===w?void 0:w.toString())===(null===I||void 0===I||null===(R=I.members)||void 0===R?void 0:R.owner.ID)&&!0;(0,o.useEffect)((()=>{t&&U(t).then((({data:e})=>{e&&F({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,o.useEffect)((()=>{s||(B.startsWith("src")&&H&&((null===k||void 0===k?void 0:k.type)!==_.bV.CAROUSEL||j===B&&!G)?(e(H),z((0,p.BK)())):"backgroundImage"===B&&W&&((null===k||void 0===k?void 0:k.type)!==_.bV.CAROUSEL||j===B&&!G)&&(e(W),z((0,p.BK)())),G&&(null===k||void 0===k?void 0:k.type)===_.bV.CAROUSEL||!j||z((0,p.BK)()))}),[H,j,W,e,B,s,null===k||void 0===k?void 0:k.type,z,G]);const q=(e=null)=>{B.startsWith("src")?(z((0,p.Yw)(B)),z((0,p.tm)(t)),z((0,E.qf)(e||_.lx.UPLOAD_IMAGE_MODAL))):B.startsWith("backgroundImage")&&(z((0,p.Yw)(B)),z((0,p.e_)(t)),z((0,E.qf)(e||_.lx.UPLOAD_BACKGROUND_MODAL)))},$=[{label:C("Upload"),key:"Upload",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}];P.imageCenterStockEnabled&&$.push({label:C("Stock"),key:"Stock",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_STOCK:_.lx.UPLOAD_BACKGROUND_MODAL_STOCK)}),P.imageCenterGifEnabled&&$.push({label:C("GIF"),key:"GIF",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_GIF:_.lx.UPLOAD_BACKGROUND_MODAL_GIF)}),P.elementAIimageEnabled&&$.push({label:C("AI"),key:"AI",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_AI:_.lx.UPLOAD_BACKGROUND_MODAL_AI)});return o.createElement("div",{className:c()("upload-bg-image",{"upload-bg-image_disabled":s})},!t||t&&"error"===l?o.createElement(i.Ay,{type:"default",block:!0,onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)},o.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),C("Add image")):o.createElement("div",{className:"ant-input-file-uploader upload-bg-image__inner-wrap",onClick:e=>{var t,l,o,a;null!==(t=e.target)&&void 0!==t&&t.closest(".upload-bg-image__edit")||null!==(l=e.target)&&void 0!==l&&l.closest(".upload-bg-image__edit-menu")||null!==(o=e.target)&&void 0!==o&&o.closest(".upload-bg-image__menu")||null!==(a=e.target)&&void 0!==a&&a.closest(".inputGroup")||q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)}},o.createElement(r.A,{arrow:!0,dropdownRender:()=>P.imagePathDropdownEnabled?o.createElement("div",{className:"inputGroup"},o.createElement(n.A,{prefix:o.createElement(g.A,{icon:"Image",style:{fontSize:20,verticalAlign:"text-top"}}),allowClear:!0,onChange:e,value:t,placeholder:a,name:B,disabled:s,className:"upload-bg-image__input"})):o.createElement(o.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")},o.createElement("div",{className:"upload-bg-image__hover-container",style:{display:"flex",alignItems:"center"}},o.createElement("div",{className:"upload-bg-image__uploader"},o.createElement("div",{className:"upload-bg-image__uploader-content"},o.createElement("div",{className:"upload-bg-image__uploader-content-inner"},o.createElement("div",{className:"upload-bg-image__uploader-img-wrap"},o.createElement("img",{className:"upload-bg-image__uploader-img",src:t,alt:""})),o.createElement("div",{className:"upload-bg-image__uploader-icons-wrap"},o.createElement("div",{className:"upload-bg-image__uploader-content"}))))),L.width&&L.height?o.createElement("div",{className:"image-size"},L.width," \xd7 ",L.height,!!k&&(k.type===_.bV.IMG||k.type===_.bV.CAROUSEL)&&" \u2192 "+x.renderedWidth+" \xd7 "+x.renderedHeight,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",null,L.size," ",C("kB")),L.format&&o.createElement(o.Fragment,null,o.createElement("span",{className:"image-size-splitter"}," \xa0\u2022\xa0 "),o.createElement("span",{className:"image-size-format"},L.format))):o.createElement(S,{type:"secondary",className:"image-empty-text"},a))),o.createElement("div",{style:{flexGrow:1}}),"gif"!==L.format&&P.imageCenterEditorEnabled&&o.createElement(d.A,{title:C("Edit")},o.createElement(S,{type:"link",className:"upload-bg-image__edit"},o.createElement(y.A,{style:{fontSize:16},onClick:e=>{X?(D(!0),V(5)):(q(),z((0,E.Wz)(_.lx.IMAGE_EDITOR_MODAL)))}}))),o.createElement(r.A,{key:"Actions",arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:$},overlayClassName:"upload-bg-image__menu"},o.createElement(S,{type:"link",className:"upload-bg-image__edit-menu image-change"},!t||t&&"error"===l?C("Upload"):o.createElement(g.A,{style:{fontSize:20},icon:"Reload",onClick:()=>q(B.startsWith("src")?_.lx.UPLOAD_IMAGE_MODAL_UPLOAD:_.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD)})))),o.createElement(b.A,{open:O,onCancel:()=>{D(!1)},initialSlide:M}))}},33932:(e,t,l)=>{l.d(t,{EQ:()=>d,YG:()=>s,Zs:()=>n,gb:()=>m});var o=l(14721),a=l(39539),i=l(58521);const r="Ai",n=(0,o.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"},l)=>(0,i.KU)(l).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,l)=>{l.d(t,{Ll:()=>g,MN:()=>E,Uu:()=>c,y4:()=>b});var o=l(14721),a=l(58521),i=l(32947),r=l(97404),n=l(79596),d=l(18987),m=l(12352),s=l(3792);const c=(0,o.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},l){const{updateCachedData:o,cacheEntryRemoved:r}=l;let c=(0,a.KU)(l).baseUrl.indexOf("emailmaker")>=0?i.e3.maker:i.e3.blocks;const u=i.EW.isPlugin?await s.di.getInstance(l,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);o((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,l)=>{l.d(t,{V:()=>n});var o=l(18987),a=l(12352),i=l(32947),r=l(24527);async function n(e,t,l,n,d){const m={blocks:n,types:r.G,locale:t};l.current=m;try{const e=await async function(e){return i.EW.isPlugin?await e.getInstance(a.Y):o.A.get(i.A9.em_token)||null}(d),t=await fetch(r.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,l)=>{l.d(t,{Jg:()=>s,z2:()=>u,HI:()=>p,vn:()=>b,kk:()=>g,Cf:()=>c});var o=l(14721),a=l(39539),i=l(93778),r=l(31926);function n({id:e,post:t,parent:l,author:o,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)(l),author:(0,r.WY)(o),content:(0,r.vf)(a),target_id:n,comment_status:i}}var d=l(58521);const m="Comments",s=(0,o.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:l,content:o,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 o&&(g.content=o),l&&(g.parent=(0,r.mQ)(l)),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:l,targetId:o},r){const m=(0,d.KU)(r),s={},c={};return t&&(s.content=t),l&&(c["acf[status]"]=l),o&&(c["acf[targetId]"]=o),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,l)=>{l.d(t,{C:()=>r,F:()=>i});var o=l(14721),a=l(27943);const i=(0,o.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,l)=>{l.d(t,{GY:()=>u,Kh:()=>v,Gr:()=>S,LX:()=>B,dN:()=>A,YV:()=>h,sl:()=>b,Xw:()=>p,PX:()=>g,YE:()=>f,_3:()=>E});var o=l(14721),a=l(39539),i=l(93207),r=l(31926);function n({id:e,title:t,acf:{html:l,common_styles:o},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:l,common_styles:o,excerpt:(0,r.pT)(i)?i.rendered:i}}var d=l(58521),m=l(93778),s=l(50861),c=l(32947);const u=(0,o.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 l,o;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!==(l=e.tags)&&void 0!==l&&l.length||!e.status||"trash"===e.status||(r["filter[tax_query][0][taxonomy]"]="folder",r["filter[tax_query][0][operator]"]="NOT EXISTS"),(null===(o=e.tags)||void 0===o?void 0:o.length)>0&&"trash"!==e.status){r["filter[tax_query][relation]"]="AND";for(let t=0,l=e.tags.length;t<l;t++){const l=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]`]=l}}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,l,{response:o})=>{var a,i;const r=(null===o||void 0===o?void 0:o.headers.get("X-WP-Total"))||0;return e?[...e.map((({id:e})=>{var t;return{type:"Emails",id:`${l.folderTag||(null===(t=l.tags)||void 0===t?void 0:t[0])||l.projectId}_${l.page}_${l.status}_${r}`}})),{type:"Emails",id:`${l.folderTag||(null===(a=l.tags)||void 0===a?void 0:a[0])||l.projectId}_${l.page}_${l.status}_${r}`}]:[{type:"Emails",id:`${l.folderTag||(null===(i=l.tags)||void 0===i?void 0:i[0])||l.projectId}_${l.page}_${l.status}_${r}`}]},keepUnusedDataFor:0}),getTemplateEmails:e.query({queryFn(e,t){var l,o,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===(l=e.group)||void 0===l?void 0:l.length)>0||(null===(o=e.projectGroup)||void 0===o?void 0:o.length)>0){const t=[...e.group||[],...e.projectGroup||[]].reduce(((e,{key:t,parentId:l})=>(e[l]||(e[l]=[]),e[l].push(String(t)),e)),{}),l=Object.values(t).map((e=>e.sort()));n["filter[tax_query][relation]"]="AND",l.forEach(((e,t)=>{n[`filter[tax_query][${t}][relation]`]="OR",e.forEach(((e,l)=>{n[`filter[tax_query][${t}][${l}][taxonomy]`]="group",n[`filter[tax_query][${t}][${l}][field]`]="id",n[`filter[tax_query][${t}][${l}][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,l=e.tags.length;t<l;t++){const l=e.tags[t];n[`filter[tax_query][${t}][taxonomy]`]="emailtags",n[`filter[tax_query][${t}][field]`]="id",n[`filter[tax_query][${t}][terms]`]=l}}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 l=t.getState(),{groupsTemplateProjectTotal:o,groupsTemplateProjectTotalPages:a}=null===l||void 0===l?void 0:l.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&&o&&a&&!e.projectId){const t=c.mU-o%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,l)=>[{type:"Email",id:l}],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,l)=>[{type:"TemplateEmail",id:l}],keepUnusedDataFor:0}),getEmailHistory:e.query({queryFn:({emailId:e,page:t=1},l)=>(0,d.KU)(l).wp.email_revisions_list({parent:e,per_page:20,page:t},{extraQuery:{_fields:"author,slug,date,modified,title,acf.html,acf.common_styles,id,parent,date_gmt"}}).then((l=>(0,m.SA)(l,((l,o)=>({data:l.filter((e=>e.acf.html)).map((e=>({...e,acf:{...e.acf,html:e.acf.html}}))).map(n),totalPages:+o.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,...l})=>(0,d.KU)(e).wp.email_create({status:"publish",...(0,i.v)(l)},{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:l,...o})=>{const n=(0,d.KU)(e),s=(0,r.TB)((0,i.v)(o));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 l=(0,d.KU)(t);let o,a;return"object"===typeof e?(o=e.id,a=e.force):(o=e,a=!1),l.wp.email_delete(o,{force:a}).then((0,m.PI)(i.V))},invalidatesTags:(e,t,l)=>[{type:"Emails",id:l}]}),addTag:e.mutation({queryFn:(e,t)=>(0,d.KU)(t).wp.emailtags_create({...e},{type:a.cM.Json})}),getDeletableTag:e.query({queryFn:([e,t],l)=>(0,d.KU)(l).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},l){const o=(0,d.KU)(l),i=function({parent:e,title:t,html:l,project:o,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]":l,"acf[project]":o,"acf[parent_email]":m,"acf[common_styles]":n}}(t);return o.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:B}=u},38251:(e,t,l)=>{l.d(t,{U8:()=>r,cA:()=>d,ri:()=>n});var o=l(27943),a=l(14721),i=l(40277);const r=(0,a.xP)({reducerPath:"exportPngApi",baseQuery:async(e,t,l)=>{try{const{notification:a,...i}=e,r=await(0,o.cw)({baseUrl:"https://racs.rest/v3"})(i,t,l);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:l})=>{const o=new Blob([e],{type:"text/html"}),a=new FormData;return a.append("file",o,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:l}}}),deleteTemporaryMail:e.mutation({query:({id:e,notification:t})=>({url:`/${e}?resource=exportPngApi`,method:"DELETE",notification:t})})})}),{useMakeTemporaryMailForPngMutation:n,useDeleteTemporaryMailMutation:d}=r},30397:(e,t,l)=>{l.d(t,{C:()=>i,N:()=>r});var o=l(14721),a=l(27943);const i=(0,o.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,l)=>{l.d(t,{N:()=>r,m:()=>n});var o=l(27943),a=l(14721),i=l(40277);const r=(0,a.xP)({reducerPath:"htmlToPdfPlusApi",baseQuery:async(e,t,l)=>{try{const{notification:a,...i}=e,r=await(0,o.cw)({baseUrl:"https://html2pdf.emcdn.ru/convert/html-to-pdf"})(i,t,l);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,l)=>{l.d(t,{CL:()=>u,FQ:()=>p,Jg:()=>y,Mv:()=>f,eo:()=>B,gg:()=>x,h4:()=>E});var o=l(14721),a=l(79596),i=l(39539),r=l(58521),n=l(18987),d=l(32947),m=l(12352),s=l(76233),c=l(3792);const u=(0,o.xP)({reducerPath:"imageApi",baseQuery:void 0,endpoints:e=>({getImageInfo:e.query({queryFn:async function(e,t){try{var l,o;const a=(null===(l=t.getState().configSlice)||void 0===l||null===(o=l.config)||void 0===o?void 0:o.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 l=e.keywords.replace(/[^\w\d\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let o=`https://api.unsplash.com/search/photos?client_id=S5iNcLqYgRBIOLQdluHdTsCJnjCvahzhG7JfYQOrV7o&lang=ru&per_page=18&query=${l}&page=${t}`;""!==e.color&&(o+=`&color=${e.color}`),""!==e.orientation&&(o+=`&orientation=${e.orientation}`);const a=await fetch(o);return{data:await a.json()}}catch(o){}}}),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 l=(0,r.KU)(t);return await l.saveFile.ai_create(e,{type:i.cM.FormData})}catch(l){throw new Error(l)}}}),getAiImage:e.query({queryFn:async function(e,t){try{const l=(0,r.KU)(t);return await l.saveFile.ai_status_list(e)}catch(l){}}}),getAiImageSSE:e.query({queryFn:e=>({data:[]}),async onCacheEntryAdded({task_id:e,entity_id:t,setError:l},o){const{updateCachedData:i,cacheEntryRemoved:u}=o,p=(0,r.KU)(o);let g;g=p.baseUrl.indexOf("dev-")>=0?p.baseUrl:p.baseUrl.indexOf("emailmaker")>=0?(0,s.qT)(d.Rn.maker):(0,s.qT)(d.Rn.blocks);const b=d.EW.isPlugin?await c.di.getInstance(o,m.Y):n.A.get(d.A9.em_token),E=b?{Authorization:`Bearer ${b}`}:{},h=new a.EventSourcePolyfill(` ${g}/ai-generator/v1/ai-status?entity_id=${t}&stream=1&task_id=${e}`,{headers:E});h.onmessage=e=>{const t=JSON.parse(e.data);i((e=>{e.push(t)})),100===t.progress&&h.close()},h.onerror=e=>{h.close()},await u,h.close()}}),getSearchGif:e.query({queryFn:async function({query:e,page:t}){const l=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=${l}&limit=25&offset=${t}&lang=en`;const o=await fetch(e);return{data:await o.json()}}catch(o){}}})})}),{useLazyGetImageInfoQuery:p,useGetImageInfoQuery:g,useGetSearchImageQuery:b,useLazyGetSearchImageQuery:E,useSendAiImageRequestQuery:h,useLazySendAiImageRequestQuery:f,useGetAiImageQuery:v,useLazyGetAiImageQuery:A,useGetUnsplashImageQuery:_,useLazyGetUnsplashImageQuery:y,useGetSearchGifQuery:S,useLazyGetSearchGifQuery:B,useGetAiImageSSEQuery:k,useLazyGetAiImageSSEQuery:x}=u},12005:(e,t,l)=>{l.d(t,{Ad:()=>n,HO:()=>c,Yj:()=>s});var o=l(14721),a=l(27943),i=l(58521);const r="LOCALES",n=(0,o.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 l=(0,i.KU)(t);try{return await l.translations.get_translations3(e,"react_app")}catch(o){return l.translations.get_translations3("en_US","react_app")}},providesTags:(e,t,l)=>[{type:r,id:l}]}),getLocales:e.query({queryFn:function(e,t){return(0,i.KU)(t).translations.get_translations2("react_app")},providesTags:(e,t,l)=>[{type:r,id:"react_app"}]})})}),{useGetLocalesQuery:d,useGetLocaleQuery:m,useLazyGetLocaleQuery:s,useLazyGetLocalesQuery:c}=n},15422:(e,t,l)=>{l.d(t,{F:()=>r,Y:()=>i});var o=l(31926),a=l(39218);function i({id:e,type:t,title:l,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,o.vf)(l),project:(0,o.pT)(s)?s.ID:s,project_author:(0,o.pT)(s)?s.post_author:void 0,project_title:(0,o.pT)(s)?s.post_title:void 0,tags:u,is_template:g,type:p,related_email:(0,o.WY)((0,o.pT)(c)?c.ID:c),title:(0,o.vf)(l)||"",lock:b}}function r({title:e,subject:t,description:l,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,o.mQ)(u),title:e,acf:{description:l,related_email:(0,o.mQ)(m),html:i,project:r,tags:n,type:d,is_template:s,lock:c}}}},98664:(e,t,l)=>{l.d(t,{n:()=>a});var o=l(31926);function a({parent:e,title:t,html:l,project:a,author:i,...r}){return{...r,author:(0,o.mQ)(i),parent:(0,o.mQ)(e),title:(0,o.vf)(t),"acf[html]":l,"acf[project]":a}}},17487:(e,t,l)=>{l.d(t,{H:()=>a});var o=l(31926);function a({id:e,title:t,acf:{html:l},excerpt:a,parent:i,author:r,...n}){return{...n,id:(0,o.WY)(e),author:(0,o.WY)(r),parent:(0,o.WY)(i),title:(0,o.vf)(t)||"",html:l,excerpt:(0,o.pT)(a)?a.rendered:a}}},93207:(e,t,l)=>{l.d(t,{V:()=>i,v:()=>r});var o=l(31926),a=l(39218);function i({id:e,title:t,type:l,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,o.WY)(e),author:(0,o.WY)(E),title:(0,o.vf)(t)||"",lock:r,renderGuid:(0,a.l)(),description:d,html:m,project:(0,o.pT)(s)?s.ID:s,project_author:(0,o.pT)(s)?s.post_author:void 0,project_title:(0,o.pT)(s)?s.post_title:void 0,tags:c,utm_parameters:u,parent_email:(0,o.WY)(p instanceof Array&&p[0]?p[0].ID:p),common_styles:g,is_template:b}}function r({title:e,lock:t,subject:l,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,o.mQ)(p),title:e,acf:{lock:t,description:a,html:i,project:r,tags:n,utm_parameters:m,parent_email:(0,o.mQ)(s),common_styles:c,is_template:u}}}},16618:(e,t,l)=>{l.d(t,{b:()=>i,d:()=>a});var o=l(31926);function a({title:e,acf:{members:t,projects_test_emails:l,ftp_settings:a,emails:i,blocks:r,webhook:n,inbox_email:d},...m}){return{...m,title:(0,o.vf)(e)||"",members:(0,o.pT)(t)?{admins:t.admins&&t.admins.map((e=>({...e,ID:(0,o.WY)(e.ID)}))),users:t.users&&t.users.map((e=>({...e,ID:(0,o.WY)(e.ID)}))),invited_users:t.invited_users&&t.invited_users.map((e=>({...e,ID:(0,o.WY)(e.ID)}))),owner:(0,o.pT)(t.owner)?{...t.owner,ID:(0,o.WY)(t.owner.ID)}:t.owner}:void 0,projects_test_emails:l,inbox_email:d,ftp_settings:a,webhook:n,emails:i,blocks:r}}function i({title:e,members:t,projects_test_emails:l,inbox_email:a,ftp_settings:i,webhook:r,emails:n,blocks:d,...m}){const s=e=>({ID:(0,o.mQ)(e.ID||e)}),c=e=>{return(t=e,Array.isArray(t)?t:t?[t]:[]).map(s);var t};return{...m,title:e,acf:{members:t&&{admins:c(t.admins),users:c(t.users),invited_users:c(t.invited_users),owner:t.owner&&s(t.owner)},webhook:r,projects_test_emails:l,inbox_email:a,ftp_settings:i,emails:n,blocks:d}}}},68936:(e,t,l)=>{l.d(t,{i:()=>a});var o=l(31926);function a({title:e,acf:{limits:t,price:l},...a}){return{...a,title:(0,o.vf)(e)||"",limits:t,price:l}}},71676:(e,t,l)=>{l.d(t,{F:()=>a,L:()=>i});var o=l(31926);function a({acf:{autosaves:e,hide_mergetags:t,theme:l,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,o.WY)(A),username:_.username||"",email:_.email||"",password:_.password||"",autosaves:e,hide_mergetags:t,theme:l,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:l,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,o.mQ)(A),locale:E,acf:{autosaves:e,theme:t,newsletter_consent:l,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,l)=>{function o(e,t=!1){const l={};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=o(i)),l[a]=i)}return l}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}l.d(t,{TB:()=>o,WY:()=>r,mQ:()=>i,pT:()=>a,vf:()=>n})},705:(e,t,l)=>{l.d(t,{vx:()=>s,I9:()=>c,bw:()=>u});var o=l(14721),a=l(39539),i=l(93778),r=l(31926);function n({title:e,content:t,acf:{seen:l,type:o,event:a,data:i},...n}){return{...n,seen:l,type:o,event:a,data:i,title:(0,r.vf)(e),content:t}}var d=l(58521);const m="Notifications",s=(0,o.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},l)=>(0,d.KU)(l).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,l)=>{l.d(t,{Ju:()=>d,Sr:()=>m,ku:()=>n,tO:()=>r});var o=l(14721),a=l(58521);const i="Optimise",r=(0,o.xP)({reducerPath:"optimiseApi",tagTypes:[i],baseQuery:async(e,t,l)=>{const o=(0,a.KU)(t).baseUrl.replaceAll(/[\\/]$/g,""),i=(0,a.hI)({baseUrl:`${o}/optimization/v1/validate`});let r=await i(e,t,l);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},92960:(e,t,l)=>{l.d(t,{Z8:()=>i,mI:()=>n});var o=l(14721),a=l(58521);const i=(0,o.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:l},o){const i=(0,a.KU)(o),r=t?fetch(e):Promise.reject(),n=e=>(e=>{switch(l){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,l)=>{l.d(t,{Zf:()=>m,dS:()=>n,lg:()=>d,tb:()=>s,yH:()=>r});var o=l(14721),a=l(39539),i=l(58521);const r=(0,o.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,l)=>{l.d(t,{$:()=>a});const o={pro:{config:{mode:"pro",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!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,commonStylesEnabled:!0,emailResponsiveControlEnabled:!0,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuImportButton:!1,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,lockPreheaderAndTitle:!1,disableSideMenu:!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,formButtonFieldReplacerEnabled:!0,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!0,formImageFieldReplacerEnabled:!0,formImageFieldHeightEnabled:!0,formTextFieldTypografEnabled:!0,formTextFieldReplacerEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}},editor:{config:{mode:"editor",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!1,styles:"",headerShow:!0,headerTitleVisible:!0,headerPreheaderVisible:!0,headerArrowBackVisible:!0,historyEnabled:!0,codeEnabled:!1,codeSideEnabled:!0,previewIconEnabled:!0,previewModeEnabled:!0,livePreviewEnabled:!0,sendTestEnabled:!0,sharePreviewEnabled:!1,webversionEnabled:!1,commonStylesEnabled:!1,emailResponsiveControlEnabled:!1,emailDropdownMenuEnabled:!1,emailDropdownMenuClone:!0,emailDropdownMenuImport:!1,emailDropdownMenuImportButton:!1,emailDropdownMenuLock:!0,emailDropdownMenuRemove:!0,emailExportEnabled:!0,exportHtmlEnabled:!0,exportTextEnabled:!1,exportZipEnabled:!0,exportClipboardEnabled:!1,exportWebHookEnabled:!1,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:!1,saveBlockEnabled:!0,editImageControlEnabled:!0,lockEditor:!1,lockPreheaderAndTitle:!1,disableSideMenu:!1,menuDirection:"right",defaultBuildPanel:"",commentsEnabled:!1,aiAssistentEnabled:!1,optimizeEnabled:!1,optimizeLinksEnabled:!0,optimizeImagesEnabled:!0,optimizeSpamAssassinEnabled:!0,optimizeCheckCodeEnabled:!0,settingsEnabled:!0,UTMEnabled:!1,subjectEnabled:!0,preheaderEnabled:!0,descriptionEnabled:!1,tagsEnabled:!0,isTemplateEnabled:!1,switchDesktopMobilePropsEnabled:!0,stepToOtherElementEnabled:!1,deleteButtonEnabled:!0,toggleSidePanel:!1,blocksSectionsShow:!0,blocksEmptyEnabled:!0,blocksSavedEnabled:!0,blocksCommonEnabled:!0,blocksTemplateEnabled:!0,blocksSearchEnabled:!0,blocksAddPanelEnabled:!0,imagePathDropdownEnabled:!1,formFieldImageTitleEnabled:!1,formFieldBorderEnabled:!1,formFieldBorderRadiusEnabled:!1,formFieldBoxShadowEnabled:!1,formFieldVisibilityEnabled:!1,formFieldExportAsPictureEnabled:!1,emailPaneDesktopSize:0,formButtonFieldInsertImageEnabled:!1,formButtonFieldVerticalAlignEnabled:!0,formButtonFieldTextAlignEnabled:!1,formButtonFieldBackgroundImageEnabled:!0,formButtonFieldPaddingsEnabled:!1,formButtonFieldReplacerEnabled:!1,formCellFieldVerticalAlignEnabled:!1,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!1,formImageFieldReplacerEnabled:!1,formImageFieldHeightEnabled:!1,formTextFieldTypografEnabled:!1,formTextFieldReplacerEnabled:!1,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},simple:{config:{mode:"simple",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!1,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:!1,commonStylesEnabled:!1,emailResponsiveControlEnabled:!1,emailDropdownMenuEnabled:!0,emailDropdownMenuClone:!0,emailDropdownMenuImport:!0,emailDropdownMenuImportButton:!1,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,lockPreheaderAndTitle:!1,disableSideMenu:!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,formButtonFieldReplacerEnabled:!1,formCellFieldVerticalAlignEnabled:!0,formCellFieldBackgroundImageEnabled:!0,formCellFieldPaddingsEnabled:!0,formCellFieldSizeEnabled:!1,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!1,formImageFieldReplacerEnabled:!1,formImageFieldHeightEnabled:!1,formTextFieldTypografEnabled:!1,formTextFieldReplacerEnabled:!1,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!1,elementVideoEnabled:!1,elementAIimageEnabled:!0,elementAItextEnabled:!1,elementCarouselEnabled:!1,elementAccordionEnabled:!1,elementFormEnabled:!1,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!1,formFieldAmpVisibilityEnabled:!1,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!1,type:"email",project:0,id:""}},blocks:{config:{mode:"freeUserBlocks",autosaveTimeout:1e4,theme:"",themes:{},mergeTagsShow:!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,commonStylesEnabled:!0,emailResponsiveControlEnabled:!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,lockPreheaderAndTitle:!1,disableSideMenu:!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,formCellFieldSizeEnabled:!0,formButtonFieldReplacerEnabled:!0,formLinkFieldInsertImageEnabled:!0,formTableFieldBackgroundImageEnabled:!0,formDivFieldBackgroundImageEnabled:!0,formImageFieldVerticalAlignEnabled:!0,formImageFieldReplacerEnabled:!0,formImageFieldHeightEnabled:!0,formTextFieldTypografEnabled:!0,formTextFieldReplacerEnabled:!0,formEmailFieldBackgroundImageEnabled:!0,elementImageEnabled:!0,elementTextEnabled:!0,elementHeaderEnabled:!0,elementButtonEnabled:!0,elementListULEnabled:!0,elementListOLEnabled:!0,elementDividerEnabled:!0,elementSpacerEnabled:!0,elementSocialEnabled:!0,elementTableEnabled:!1,elementCountdownEnabled:!0,elementVideoEnabled:!0,elementAIimageEnabled:!0,elementAItextEnabled:!0,elementCarouselEnabled:!0,elementAccordionEnabled:!0,elementFormEnabled:!0,preventSendDataToEM:!1,imageInfoToolUrl:"",imageCenterFileManagerView:!1,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,compressMaxSize:.7,compressMaxWidthOrHeight:2e3,ampExportEnabled:!0,formFieldAmpVisibilityEnabled:!0,testEmails:[],pushToGTM:!0,activeNextButton:!0},project:void 0,page:{isNew:!0,type:"email",project:0,id:""}}},a=e=>{const t=o[e];return t||o.editor}},38540:(e,t,l)=>{l.d(t,{Ay:()=>s,M:()=>m,YT:()=>d,rI:()=>n});var o=l(1029);const a=(0,l(93778).ur)({isCollapsed:!0,isMonacoFocusing:!1}),i="defaultModePanesSlice",r=(0,o.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,l)=>{l.d(t,{A9:()=>p,AJ:()=>v,Ay:()=>W,Bj:()=>k,Bu:()=>w,CT:()=>F,G_:()=>u,HO:()=>h,Hs:()=>O,M7:()=>g,RC:()=>T,S_:()=>R,UI:()=>z,Up:()=>I,VK:()=>_,VO:()=>B,VZ:()=>M,Wm:()=>S,dH:()=>H,eX:()=>c,iy:()=>L,mD:()=>j,no:()=>y,om:()=>b,pl:()=>f,ps:()=>x,qX:()=>C,rY:()=>V,rd:()=>D,ry:()=>E,ss:()=>A,uJ:()=>P,zn:()=>N});var o=l(1029),a=l(93778),i=l(98845),r=l(83027),n=l(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,o.createSlice)({name:m,initialState:d,reducers:{setEditorThemeColor:(e,t)=>{e.editorThemeColor=t.payload},setEmailFromHistory:(e,{payload:t})=>{const l=e.email,o=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={...l,html:null===t||void 0===t?void 0:t.html,preheader:o?l.preheader:null===t||void 0===t?void 0:t.preheader,subject:a?l.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:l.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 l=e.searchFilters;e.searchFilters={...l,...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 l=Object.keys(t)[0],o=e.emailGroups,a=e.parentGroupOfProject,i=e.projectGroups,r={};var n;a&&i.length&&(null===(n=t[l])||void 0===n||n.forEach((e=>{const t=i.find((e=>e.id===+l)),o=null===t||void 0===t?void 0: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})):(r.hasOwnProperty(l)||(r[l]=[]),r[l].push({label:e,value:null}))})),0===t[l].length&&(r[l]=[]));e.emailGroups={...o,...r}}},extraReducers:e=>{e.addMatcher((e=>"emailsApi/queries/queryResultPatched"===e.type),((e,t)=>{var l,o;const a=t.payload.queryCacheKey.match(/\("([0-9]+)"\)/),i=null===(l=t.payload)||void 0===l?void 0:l.patches[0];null!==i&&void 0!==i&&null!==(o=i.path)&&void 0!==o&&o[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 l,o;(null===(l=e.email.id)||void 0===l?void 0:l.toString())===(null===(o=t.payload.id)||void 0===o?void 0:o.toString())&&(e.email.html=t.payload.html)})),e.addMatcher(i.GY.endpoints.getEmail.matchFulfilled,((e,{payload:t})=>{var l,o;e.email={...d.email,...t,is_inited:t.is_inited||(t.id===(null===(l=e.email)||void 0===l?void 0:l.id)?null===(o=e.email)||void 0===o?void 0:o.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:l})=>{const o=e.email.group,a=t.arg.originalArgs.parent,i=l;a&&(e.parentGroupOfProject=a,i.length>0&&(e.projectGroups=i));const r={};a&&o.length&&i.length&&(null===o||void 0===o||o.forEach((e=>{null===i||void 0===i||i.forEach((t=>{const l=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}))}))}))),e.emailGroups=r})),e.addMatcher(n.Nq.endpoints.getProject.matchFulfilled,((e,{meta:t,payload:l})=>{var o;e.parentGroupOfProject=(null===(o=l.group)||void 0===o?void 0:o[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:B,setProblemsList:k,setActiveProblemRange:x,setEmailGroups:w,setIsNeedUpdateAppearance:R,setIsNeedUpdateContentAppearance:T}=s.actions,N=e=>e[m].invalidateEmailId,I=e=>e[m].editorThemeColor,P=e=>e[m].settings,C=e=>e[m].elementSettings,L=e=>e[m].isSettingsDisabled,F=e=>e[m].searchFilters,O=e=>e[m].email,D=e=>e[m].problemsList,M=e=>e[m].activeProblemRange,V=e=>e[m].emailGroups,z=e=>e[m].projectGroups,H=e=>e[m].isNeedUpdateContentAppearance,j=e=>e[m].isNeedUpdateAppearance,W=s},80772:(e,t,l)=>{l.d(t,{Ac:()=>g,Ay:()=>b,BK:()=>c,Uf:()=>p,Yw:()=>m,e_:()=>s,js:()=>u,tm:()=>d});var o=l(1029),a=l(93778);const i="imageSlice",r=(0,a.ur)({currentImage:"",currentBackground:"",currentImageName:""}),n=(0,o.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,l)=>{l.d(t,{$S:()=>C,Ay:()=>L,BQ:()=>E,Et:()=>T,K3:()=>B,MZ:()=>b,P3:()=>x,TC:()=>A,TU:()=>h,Uh:()=>N,YG:()=>P,Zs:()=>v,aY:()=>_,lg:()=>I,mk:()=>w,ol:()=>k,x3:()=>f,yY:()=>S,zH:()=>R});var o=l(1029),a=l(98845),i=l(65716),r=l(32947),n=l(31557),d=l.n(n),m=l(93778),s=l(39218),c=l(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,o.createSlice)({name:p,initialState:u,reducers:{setNewEmailAll:(e,{payload:{id:t,subject:l,description:o="",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=l,e.email.description=o,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:B,setNewEmailUtmMedium:k,setNewEmailUtmCampaign:x,setNewEmailUtmContent:w,setNewEmailUtmTerm:R,resetNewEmailSlice:T,setNewIsInited:N,setNewEmailIsAmp:I}=g.actions,P=e=>e[p].email,C=e=>e[p].hasChanged,L=g},84572:(e,t,l)=>{l.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 o=l(1029),a=l(93778),i=l(65716),r=l(98845);const n=(0,a.ur)({project:null,activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),d="projectSlice",m=(0,o.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:l})=>{const{projectId:o}=l.arg.originalArgs;var a,i,r;o?(e.groupsTemplateProjectTotal=+(null===(a=l.baseQueryMeta)||void 0===a?void 0:a.response.headers.get("X-WP-Total")),e.groupsTemplateProjectTotalPages=+(null===(i=l.baseQueryMeta)||void 0===i?void 0:i.response.headers.get("X-WP-TotalPages"))):e.groupsTemplateTotal=+(null===(r=l.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,l)=>{l.d(t,{Ay:()=>p,RL:()=>u,p1:()=>c,qX:()=>m});var o=l(1029),a=l(98845),i=l(68984);const r=(0,l(93778).ur)({historyData:[],elementHistoryTotalPages:1}),n="revisionHistorySlice",d=(0,o.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:l})=>{var o;e.elementHistoryTotalPages=+(null===(o=t.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages")),t.arg.originalArgs.page&&1!==t.arg.originalArgs.page||(e.historyData=l.data||[])})),e.addMatcher(i.VM.endpoints.getBlockHistory.matchFulfilled,((e,{meta:t,payload:l})=>{var o;e.elementHistoryTotalPages=+(null===(o=t.baseQueryMeta)||void 0===o?void 0:o.response.headers.get("X-WP-TotalPages")),l.args.page&&1!==l.args.page||(e.historyData=l.data||[])}))}}),{resetElementHistorySlice:m}=d.actions,{setElementHistory:s}=d.actions,c=e=>e[n].historyData,u=e=>e[n].elementHistoryTotalPages,p=d},47014:(e,t,l)=>{l.d(t,{Ay:()=>_,B:()=>E,B$:()=>A,C1:()=>h,hZ:()=>v,ko:()=>p,ku:()=>c,ww:()=>m,yf:()=>f});var o=l(1029),a=l(78915),i=l(32947),r=l(40277);const n=(0,l(93778).ur)({currentUser:{},currentSchema:{},monacoOptions:i.rW,monacoDidMount:!1}),d="userSlice",m=(0,o.createAsyncThunk)("user/setMonacoOptions",(async(e,{getState:t})=>{const l=t()[d],o="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 o&&l.monacoOptions.fontFamily!==o&&await(0,r.iV)(e.font_family),{tabSize:e.tab_size,fontFamily:o,fontSize:e.font_size,wordWrap:a,insertSpaces:e.insert_spaces,minimap:{enabled:e.minimap}}})),s=(0,o.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 l=t.payload;e.monacoOptions=(0,r.i0)({...e.monacoOptions},l)})),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}}]);