@emailmaker/emailmaker 1.1.103 → 1.1.108
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +1 -0
- package/emailmaker-core.d5e4bde1.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.3529b1de.js → emailmaker-po.d5e4bde1.js} +1 -1
- package/emailmaker.d.ts +144 -13
- package/emailmaker.js +12 -12
- package/iframe/.vite/manifest.json +13 -25
- package/iframe/css/sandbox.css +11 -9
- package/iframe/{iframe-eblock.3529b1de.html → iframe-eblock.d5e4bde1.html} +2 -2
- package/iframe/{iframe.3529b1de.html → iframe.d5e4bde1.html} +2 -2
- package/iframe/js/elMarkupHelper.C66zL1zp.js +279 -0
- package/iframe/js/iframe-eblock.body.d5e4bde1.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.d5e4bde1.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/iframe/js/{typograf.all.B0pVhMV_.js → typograf.all.Mun9CrLC.js} +12 -12
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{6efc4a78.js → 13b2a363.js} +3 -3
- package/static/core/{a4d1fdc5.js → 22140fa1.js} +1 -1
- package/static/core/{71d7c710.js → 2455e45e.js} +11 -11
- package/static/core/{7fd8d843.js → 2734fa96.js} +1 -1
- package/static/core/3a6dbf2b.js +7 -0
- package/static/core/{0cb54b92.js → 4797d4f7.js} +6 -6
- package/static/core/{5eaa42ac.js → 566e8ce8.js} +1 -1
- package/static/core/{b99c36c9.js → 6ba8aedc.js} +1 -1
- package/static/core/{9909de51.js → 6c52be40.js} +1 -1
- package/static/core/{73291b7c.js → 6e8d008d.js} +1 -1
- package/static/core/{c1460335.js → 6f6a92e3.js} +1 -1
- package/static/core/{2a6bfcb1.js → 756e184f.js} +1 -1
- package/static/core/7985de17.js +28 -0
- package/static/core/{b3d5871e.js → 7e51da74.js} +1 -1
- package/static/core/{3b315cf0.js → 7e69b03c.js} +1 -1
- package/static/core/{82f5152d.js → 8889dbc6.js} +1 -1
- package/static/core/8a621181.js +2 -0
- package/static/core/a22823f9.js +1 -0
- package/static/core/{1922419a.js → abcacabc.js} +1 -1
- package/static/core/{48387a41.js → b43852b9.js} +1 -1
- package/static/core/{9f7f5230.js → b712bb05.js} +1 -1
- package/static/core/{e420456c.js → b916e437.js} +1 -1
- package/static/core/{8fe408ef.js → d5cd2a7b.js} +1 -1
- package/static/core/{91e9b542.js → d74c1e57.js} +1 -1
- package/static/core/{66be8204.js → d8800deb.js} +1 -1
- package/static/core/{fbd1b42a.js → dbc12df7.js} +2 -2
- package/static/core/{5de7475e.js → e1f8b6ea.js} +1 -1
- package/static/core/e88db487.js +1 -0
- package/static/core/{9ca4cda3.js → ecaf7c36.js} +1 -1
- package/static/core/edf49656.js +4 -0
- package/static/core/{6dd152e5.js → f20ffa90.js} +3 -3
- package/static/core/{682a8e2c.js → f37da79c.js} +1 -1
- package/static/esm/73c89921.js +1 -0
- package/static/esm/delivery-libs.js +1 -1
- package/static/umd-runtime/delivery-libs.eFZaeVgo.js +1 -0
- package/static/umd-runtime/{runtime.D9PiY8Jx.js → runtime.BZcjM8iG.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.3529b1de.js +0 -859
- package/iframe/js/discussHandlers.BrvInbT7.js +0 -88
- package/iframe/js/iframe-eblock.body.3529b1de.js +0 -233
- package/iframe/js/iframe.body.3529b1de.js +0 -319
- package/iframe/js/rolldown-runtime.qcwTIabA.js +0 -1
- package/static/core/90715222.js +0 -28
- package/static/core/c9a013a6.js +0 -4
- package/static/core/d4619860.js +0 -7
- package/static/core/e6f6edff.js +0 -1
- package/static/esm/d4338c39.js +0 -1
- package/static/umd-runtime/delivery-libs.Cmqsjupj.js +0 -1
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
__emailmaker__.define("js/iframe-eblock.js",["require","exports","module","js/discussHandlers.BrvInbT7.js","js/typograf.all.B0pVhMV_.js"],function(Me,Ct,Pt){const o=Me("./discussHandlers.BrvInbT7.js"),qe=Me("./typograf.all.B0pVhMV_.js");function et(e){const i=new Map,t=[],l=[],n=[];for(const d of e)if(d instanceof HTMLLinkElement)d.getAttribute("em-class")?.startsWith("em-font-")&&l.push(d);else if(d instanceof HTMLStyleElement){const m=d.getAttribute("em")||"",a=i.get(m);a?a.push(d):i.set(m,[d])}else if(d instanceof Element)if(d.getAttribute("em")==="block")t.push(d);else{const m=d.querySelector("[em='block']");m&&t.push(m)}else d.textContent===`
|
|
2
|
-
`&&n.push(d);const s=[];for(const d of l)s.push(d);for(const[d,m]of i)if(m.length>1){let a=o.minifyStylesheet(m.map(r=>r.innerHTML).join(`
|
|
3
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;if(a=cssbeautify(a,{indent:" ",autosemicolon:!0}),a){const r=document.createElement("style");r.innerHTML=`
|
|
4
|
-
${a}
|
|
5
|
-
`,d&&r.setAttribute("em",d),s.push(r)}}else s.push(m[0]);for(const d of t)s.push(d);for(let d=s.length-1;d>0;d--)s.splice(d,0,n.length>=d?n[d-1]:document.createTextNode(`
|
|
6
|
-
`));return s}function Oe(e){let i=document.querySelector('body>[em="block-contaner"]');if(i){const t=document.querySelectorAll("style"),l=document.querySelectorAll("[em=block]"),n=document.querySelectorAll('link[em-class="*"]');for(const m of t)m.parentNode!==i&&!m.dataset.emLocalization&&!m.dataset.themeVaribalse&&(i.insertBefore(document.createTextNode(`
|
|
7
|
-
`),i.firstChild),i.insertBefore(m,i.firstChild));for(const m of l)m.parentNode!==i&&(i.appendChild(document.createTextNode(`
|
|
8
|
-
`)),i.appendChild(m));for(const m of n)i.querySelector(`link[em-class="${m.getAttribute("em-class")}"]`)||(i.insertBefore(document.createTextNode(`
|
|
9
|
-
`),i.firstChild),i.insertBefore(m,i.firstChild));e||(e=i.childNodes);const s=et(e);for(const m of e){const a=m.parentNode;s.indexOf(m)<0&&a&&a.removeChild(m)}let d=null;for(const m of[...s].reverse())(m.parentNode!==i||m.nextSibling!==d)&&i.insertBefore(m,d),d=m;return s}return[]}function tt(e){if(e.length){const i=document.documentElement||document.appendChild(document.createElement("html"));document.head||i.insertBefore(document.createElement("head"),i.firstChild);const t=document.body||i.appendChild(document.createElement("body"));let l=null;for(const d of e)if(d instanceof Element&&d.tagName!=="STYLE")if(d.getAttribute("em")==="block"){l=d;break}else{const m=d.querySelector("[em='block']");if(m){l=m;break}}const n=l?.tagName.toLowerCase()==="tr"?"table":"div";let s=document.querySelector('body>[em="block-contaner"]');if(s&&s.tagName.toLowerCase()!==n&&s.remove(),!s){let d=t.insertBefore(document.createElement(n),t.firstChild);d.setAttribute("em","block-contaner"),n==="div"?(d.style.width="100%",d.style.margin="0 auto",d.style.maxWidth="100%"):(d.setAttribute("align","center"),d.setAttribute("cellspacing","0"),d.setAttribute("cellpadding","0"),d.setAttribute("border","0"),d.setAttribute("width","100%")),s=t.appendChild(d)}return Oe(e)}return e}var it={name:"block",mapHTMLRoots:tt,rootsParent:()=>document.querySelector('body>[em="block-contaner"]'),beforeCommit:()=>{Oe()}};function lt(){o.provideSandboxState(o.container);const{pipeline:e}=o.provideAttributePipeline(o.container),i=o.provideDocumentSync(o.container,it,{prepareHtml:a=>o.emFilter({node:a,isPartial:!0}),lock:{increment:()=>o.state.increment("activeElementLocked"),decrement:()=>o.state.decrement("activeElementLocked")}}),{htmlDocument:t,remoteDocument:l,textDocument:n,documentMapping:s}=i;o.provideImageCache(o.container,{pipeline:e,htmlDocument:t});const d=o.provideEmVersion(o.container,{pipeline:e,htmlDocument:t}).reload;i.onDocumentReplaced(()=>d.clear()),o.messageService.addListener(o.EVENT_TYPES.SANDBOX_IMAGE_RESET,({url:a})=>{a&&(o.container.getInstance(o.IMAGE_CACHE_ID)?.forget(a),d.reload(a))});const m=o.provideFocus(o.container,{htmlDocument:t,remoteDocument:l});return o.initFocusManager(m.controller),o.attachFocusService(m),o.registerCrossDomainDD(),o.registerThemeVariablesService(t),o.registerCorrectVariableSelectionService(),o.registerResizeWatch(t,l),o.registerResetService(t),o.provideAmp(o.container,t),{documentSync:i,htmlDocument:t,remoteDocument:l,textDocument:n,documentMapping:s,focus:m,localizationService:o.registerLocalizationService(t),mapObj:o.createMapObj(s),commit:a=>i.commit(a),commitLockedAsync:a=>i.commitLockedAsync(a)}}var ot=lt(),ke='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 9 4 C 6.800781 4 5 5.800781 5 8 C 5 9.113281 5.476563 10.117188 6.21875 10.84375 C 4.886719 11.746094 4 13.28125 4 15 L 4 20.625 L 6 21.625 L 6 28 L 12 28 L 12 21.625 L 14 20.625 L 14 19 L 12 19 L 12 19.375 L 10 20.375 L 10 26 L 8 26 L 8 20.375 L 6 19.375 L 6 15 C 6 13.332031 7.332031 12 9 12 C 10.667969 12 12 13.332031 12 15 L 14 15 C 14 13.28125 13.113281 11.746094 11.78125 10.84375 C 12.523438 10.117188 13 9.113281 13 8 C 13 5.800781 11.199219 4 9 4 Z M 23 4 C 20.800781 4 19 5.800781 19 8 C 19 9.113281 19.476563 10.117188 20.21875 10.84375 C 18.886719 11.746094 18 13.28125 18 15 L 18 20.625 L 20 21.625 L 20 28 L 26 28 L 26 21.625 L 28 20.625 L 28 15 C 28 13.28125 27.113281 11.746094 25.78125 10.84375 C 26.523438 10.117188 27 9.113281 27 8 C 27 5.800781 25.199219 4 23 4 Z M 9 6 C 10.117188 6 11 6.882813 11 8 C 11 9.117188 10.117188 10 9 10 C 7.882813 10 7 9.117188 7 8 C 7 6.882813 7.882813 6 9 6 Z M 23 6 C 24.117188 6 25 6.882813 25 8 C 25 9.117188 24.117188 10 23 10 C 21.882813 10 21 9.117188 21 8 C 21 6.882813 21.882813 6 23 6 Z M 23 12 C 24.667969 12 26 13.332031 26 15 L 26 19.375 L 24 20.375 L 24 26 L 22 26 L 22 20.375 L 20 19.375 L 20 15 C 20 13.332031 21.332031 12 23 12 Z M 15 14.1875 L 15 16 L 11 16 L 11 18 L 15 18 L 15 19.8125 L 17.8125 17 Z"/></svg>',nt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 3 C 13.742188 3 12.847656 3.890625 12.40625 5 L 5 5 L 5 28 L 13 28 L 13 30 L 27 30 L 27 14 L 25 14 L 25 5 L 17.59375 5 C 17.152344 3.890625 16.257813 3 15 3 Z M 15 5 C 15.554688 5 16 5.445313 16 6 L 16 7 L 19 7 L 19 9 L 11 9 L 11 7 L 14 7 L 14 6 C 14 5.445313 14.445313 5 15 5 Z M 7 7 L 9 7 L 9 11 L 21 11 L 21 7 L 23 7 L 23 14 L 13 14 L 13 26 L 7 26 Z M 15 16 L 25 16 L 25 28 L 15 28 Z"/></svg>',st="",We=!0;setTimeout(()=>{o.state.set("loadStylesTimer",!0)},1e3);var{documentSync:Ht,htmlDocument:z,remoteDocument:Ie,textDocument:at,documentMapping:Fe,focus:De,localizationService:$e,mapObj:ze,commit:S,commitLockedAsync:me}=ot,C=z,v=$e.localized;$e.onChangeLocale(({data:e})=>{v=e}),o.initResizableElements({getLocale:()=>v,commit:e=>S(e),messageService:o.messageService}),z.onChange(e=>{e.some(i=>i.added.length||i.characterDataChanged||i.reordered?.length||i.reparented?.length)&&o.initSortable(C)});function I(){return{parseFromString:o.parseFromString,HTMLDocument:C,commit:S,implementElementEditor:ee,setCursorPosition:N,scrollTop:o.state.get("scrollTop"),iframeOffsetTop:o.state.get("iframeOffsetTop"),emFilter:o.emFilter}}o.initSandboxStyles({textDocument:at,commit:S});var ce=()=>{};function ge(){return{messageService:o.messageService,removeAllAttributes:o.removeAllAttributes,applicationElementSettingsSet:w}}function rt(){return{getElementParent:pe,setCursorPosition:N,removeElementEditors:G,getVariableByIcon:o.getVariableByIcon,removeEmptyParents:o.removeEmptyParents,getAllComments:o.getAllComments,isVariableComment:o.isVariableComment,getVariableIcon:o.getVariableIcon,commit:S,messageService:o.messageService}}function dt(){const e=window.getSelection(),i=(e?.rangeCount?e.getRangeAt(0):null)?.commonAncestorContainer;return(i?.nodeType===1?i:i?.parentElement)?.closest("editor")??null}function mt(){return{removeAllAttributes:o.removeAllAttributes,state:o.state,commitLockedAsync:me}}function j(){return{commit:S,removeAllAttributes:o.removeAllAttributes,messageService:o.messageService,iframeOffsetTop:o.state.get("iframeOffsetTop"),previewHeight:o.state.get("previewHeight")}}function ct(e){let i=[];return o.getAllComments(e).forEach(t=>{if((t.nodeValue.substring(0,2)==="${"||t.nodeValue.substring(0,2)==="{{"&&t.parentElement)&&(t.parentElement.tagName==="DIV"||t.parentElement.tagName==="B"||t.parentElement.tagName==="STRONG"||t.parentElement.tagName==="I"||t.parentElement.tagName==="EM"||t.parentElement.tagName==="S"||t.parentElement.tagName==="STRIKE"||t.parentElement.tagName==="P"||t.parentElement.tagName==="SPAN")){const l=t.previousElementSibling;if(l&&l.tagName==="SPAN"&&l.classList.contains("em-code")&&l.classList.contains("em-code_var"))return;let n=document.createElement("span");n.classList.add("em-code","em-code_var"),n.setAttribute("contenteditable","false"),t.before(n),i.push(t)}}),i}C.onChange(()=>{o.checkSandboxStyles()});function gt(){o.state.set("lockEditorInit",!0),Ye(document),o.state.set("globalHolder",document.querySelector('[em="block-contaner"]'));let e={operation:"application_block_settings_set",settings:{structuresMedia:!document.querySelector('[em="block"] div[style*="display: inline-block"]')}};o.state.get("globalHolder")&&(o.state.get("globalHolder").tagName==="TABLE"?e.settings.width={value:o.state.get("globalHolder").getAttribute("width")&&o.state.get("globalHolder").getAttribute("width")!=="auto"?parseFloat(o.state.get("globalHolder").getAttribute("width")):null,dim:o.state.get("globalHolder").getAttribute("width")&&o.state.get("globalHolder").getAttribute("width")!=="auto"&&o.state.get("globalHolder").getAttribute("width").indexOf("%")>-1?"%":"px"}:e.settings.width={value:o.state.get("globalHolder").style.maxWidth?parseFloat(o.state.get("globalHolder").style.maxWidth):null,dim:o.state.get("globalHolder").style.maxWidth&&o.state.get("globalHolder").style.maxWidth.indexOf("%")>-1?"%":"px"}),e.settings.structuresMedia=!document.querySelector('[em="block"] div[style*="display: inline-block"]'),ht(),o.messageService.send(e)}C.onRefresh(()=>{gt()}),C.onChange(o.createHandleChangesWithRemovedElementsOnly(w));var q=[],Te=new o.UpdateQueue,V=De.controller;C.onChange(e=>{const i=document.body;o.state.get("lockEdit")!==i.classList.contains("mceNonEditable")&&(o.state.get("lockEdit")?i.classList.add("mceNonEditable"):i.classList.remove("mceNonEditable"));for(const t of e)for(const l of t.added)q=[...q,...ct(l)]}),C.onChange(()=>{V.whenEditorLostFocus(()=>{if(q.length){const e=new Set;for(const i of q)if(i.isConnected){const t=i.parentNode;t&&!e.has(t)&&e.add(t)}q=[]}},"comments")});var je=e=>De.setEditorFocus(e);function be(e,i){let t={};i.settings.hasOwnProperty("textStrong")?t={name:"textStrong",tags:["b","strong","[style*=font-weight]","a"],value:i.settings.textStrong,command:"bold"}:i.settings.hasOwnProperty("textItalic")?t={name:"textItalic",tags:["em","i","[style*=font-style]","a"],value:i.settings.textItalic,command:"italic"}:i.settings.hasOwnProperty("textStrikethrough")?t={name:"textStrikethrough",tags:["s","strike","u","[style*=text-decoration]","a"],value:i.settings.textStrikethrough,command:"strikethrough"}:i.settings.hasOwnProperty("textUnderline")?t={name:"textUnderline",tags:["u","strike","[style*=text-decoration]","span","a"],value:i.settings.textUnderline,command:"underline"}:i.settings.hasOwnProperty("textColor")?t={name:"textColor",tags:["a","[style*='color']","span"],value:o.rgbToHex(i.settings.textColor)||"",command:"foreColor"}:i.settings.hasOwnProperty("textBackgroundColor")?t={name:"textBackgroundColor",tags:["a","[style*='background-color']","[style*='color']","span"],value:o.rgbToHex(i.settings.textBackgroundColor)||"",command:"hilitecolor"}:i.settings.hasOwnProperty("fontFamily")?t={name:"fontFamily",tags:["[style*='font-family']","span","a"],value:i.settings.fontFamily?.[i.settings.fontFamily.length-1],command:"fontName"}:i.settings.hasOwnProperty("textLink")?t={name:"textLink",tags:["a","[href]","div","p","td"],value:i.settings.textLink||"",command:"createLink"}:i.settings.hasOwnProperty("fontSize")?t={name:"fontSize",tags:["a","[style*='font-size']","span","div"],value:parseFloat(i.settings.fontSize),command:"fontSize"}:i.settings.hasOwnProperty("lineHeight")&&(t={name:"lineHeight",tags:["div","[style*='line-height']","p","td"],value:parseFloat(i.settings.lineHeight),command:null}),e?.querySelectorAll(".em-element-path").forEach(c=>c.remove());const l=Object.keys(i.settings)[0];let n=window.getSelection(),s=n.getRangeAt(0),d=n.anchorNode===1?n.anchorNode:n.anchorNode.parentElement;const m=s.commonAncestorContainer;let a=m.nodeType===1?m:m.parentElement;e||(e=d);let r=i.type==="button"?(e||d)?.closest("a"):(e||d)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol");const b=i.settings.fontFamily;let p=null;const y=Array.from(r.classList).some(c=>(c.startsWith("em-font-")&&(p=c),c.startsWith("em-font-")&&c.includes(t.name==="textItalic"?"Italic":"Bold")));y&&(t.name==="textItalic"||t.name==="textStrong")&&p&&r.classList.remove(p);function f(){const c=Array.from(r?.getElementsByTagName("span")||[]).reverse();let g=o.getSelectedText();c.forEach(h=>{if(h.attributes.length===0||!h.getAttribute("style"))if(h.childNodes.length===1&&h.childNodes[0].nodeType===3){const u=h.childNodes[0];h.parentNode.replaceChild(u,h),R&&r.innerText.trim()!==g.trim()&&(s.selectNode(u),A(s))}else{const u=Array.from(h.childNodes);u.forEach(L=>{h.parentNode.insertBefore(L,h)}),g===h.innerText&&(s=document.createRange(),s.setStartBefore(u[0]),s.setEndAfter(u[u.length-1]),A(s)),h.parentNode.removeChild(h)}})}function A(c){n.removeAllRanges(),n.addRange(c)}function H(){if(n?.rangeCount>0){const c=n.getRangeAt(0),g=c.commonAncestorContainer;let h=c.startOffset,u=c.endOffset;for(;g.data&&h>0&&!/\s/.test(g.data[h-1]);)h--;for(;g.data&&u<g.length&&!/\s/.test(g.data[u]);)u++;s.setStart(g,h),s.setEnd(g,u),A(s)}}let T;l==="textColor"&&(T="color"),l==="textBackgroundColor"&&(T="backgroundColor");let x=o.getSelectedText();const D=i.settings.hasOwnProperty("textColor")||i.settings.hasOwnProperty("textBackgroundColor"),R=!!a?.closest("editor")||a?.innerText.trim()===x?.trim()||a.querySelector("editor")?.innerText.trim()===x?.trim();if(t.name==="lineHeight"){const c=a.closest('[style*="line-height"]')||a.closest("div, p, td");if(a?.querySelector('[em-edit="active"]')){let g=[];o.checkForTextNodes(d,g),g.forEach(h=>{const u=h.closest('[style*="line-height"]')||h.closest("div, p, td");u.style.lineHeight=t.value+"px"})}else c.style.lineHeight=t.value+"px";return S(),!1}if(t.name==="fontFamily"){let c=r,g=o.getSelectedText();const h=!!a?.querySelector('[em-edit="active"]');if(!h&&(!s?.collapsed||o.getSelectedText()))if(r.innerText.trim()===g.trim())c=r;else if(a.innerText.trim()===g.trim())c=a;else{let L=document.createElement("span");s.surroundContents(L),c=L,s.deleteContents(),s.insertNode(L),s.selectNode(L),A(s)}b?b[0]==="Safe Fonts"?(c.style.fontFamily=b[1],c.classList.remove(...[...c.classList].filter(L=>L.startsWith("em-font"))),o.clearLinkTags({elem:document.head},S)):b[0]==="Google Fonts"&&(b[1]==="Sans Serif"?c.style.fontFamily="Helvetica, Arial, sans-serif":b[1]==="Serif"&&(c.style.fontFamily='"Times New Roman", Times, serif'),c.classList.remove(...[...c.classList].filter(L=>L.startsWith("em-font"))),c.classList.add(`em-font-${b[2].replace(/\s/g,"")}-${b[3].replace(/\s/g,"")}`),Se({fontFamilyArray:b})):c.style.removeProperty("font-family");let u;return h?(u=a.querySelectorAll('[style*="font-family"]'),u.forEach(L=>L.style.fontFamily=c.style.fontFamily)):(u=c.querySelectorAll('[style*="font-family"]'),u.forEach(L=>L.style.fontFamily="")),f(),S(),!1}const re=a.closest(t.tags.find(c=>a?.closest(c)));(s?.collapsed||!o.getSelectedText())&&(t.value?t.value&&R&&(i.type==="button"||e.tagName==="A"?s.selectNodeContents(re):H()):re&&s.selectNodeContents(re)),(i.type==="button"||e.tagName==="A"||e?.closest("a"))&&o.getSelectedText()&&o.getSelectedText().trim()!==e.innerText.trim()&&re&&s.selectNodeContents(re),n=window.getSelection(),s=n.getRangeAt(0),x=o.getSelectedText();const Qe=Array.from(r?.querySelectorAll("span,div")||[]).reverse();Qe.length&&Qe.forEach(c=>{c.getAttribute("style")===""&&c.removeAttribute("style"),c.hasAttribute("contenteditable")&&c.removeAttribute("contenteditable"),c.hasAttribute("em-edit")&&c.removeAttribute("em-edit"),c.hasAttribute("em-relative")&&c.removeAttribute("em-relative"),c.hasAttribute("class")&&(c.classList.remove("em-relative"),c.classList.length===0&&c.removeAttribute("class"))});let Re=null;const _e=T==="color"?T:"background-color";t.name==="textColor"&&r.style.hasOwnProperty(_e)&&(Re=r.style[_e],r.style.removeProperty(_e)),R&&(!t.value&&t.name!=="fontSize"&&t.name!=="textLink"||t.value)&&(!(t.name==="textUnderline"||t.name==="textStrikethrough")||i.type!=="button")&&(t.name!=="fontSize"&&!D&&r.innerText.trim()===x.trim()||r.innerText.trim()!==x.trim())&&document.execCommand(t.command,!1,D?t.value:t.name==="textLink"?" ":null),Array.from(document?.getElementsByTagName("b")||[]).reverse(),Array.from(document?.getElementsByTagName("strong")||[]).reverse(),Array.from(document?.getElementsByTagName("i")||[]).reverse(),Array.from(document?.getElementsByTagName("span")||[]).reverse(),Array.from(document?.getElementsByTagName("u")||[]).reverse();const Nt=Array.from(document?.getElementsByTagName("strike")||[]).reverse(),Bt=Array.from(document?.getElementsByTagName("font")||[]).reverse();function W(c,g){g=g||document.body;const h=g.childNodes;let u=null;for(let L=0;L<h.length;L++){const O=h[L];if(O.nodeType===Node.TEXT_NODE&&O.textContent.includes(c)){u=O.parentNode;break}else if(O.nodeType===Node.ELEMENT_NODE&&(u=W(c,O),u))break}return u}function $(c){c&&(o.state.decrement("activeElementLocked"),w({elem:c}),o.state.increment("activeElementLocked"))}if(t.name==="fontSize"){let c=null;if(a?.tagName==="FONT"){const u=document.createElement("span");u.innerHTML=a.innerHTML,a.getAttribute("size")?u.style["font-size"]=t.value+"px":Array.from(a.attributes).forEach(L=>u.setAttribute(L.name,L.value)),a.parentNode.replaceChild(u,a)}(e.tagName==="A"||e.closest("a"))&&(r=e.closest("a")),r.innerText.trim()===x.trim()?(Array.from(r.getElementsByTagName("span"))?.forEach(u=>u.style.fontSize=""),r.style.fontSize=t.value+"px",r.firstChild.nodeType===1&&r.firstChild.tagName==="SPAN"&&r.firstChild.innerText===x&&(r.firstChild.style.fontSize="")):r.style.hasOwnProperty("font-size")&&(c=r.style.fontSize,r.style.removeProperty("font-size")),r.innerText.trim()!==x.trim()&&document.execCommand("fontSize",!1,1),c&&(r.style.fontSize=c);const g=Array.from(d?.querySelectorAll("font")||[]).reverse();let h=[];R?t.value||(n=window.getSelection(),s=n.getRangeAt(0),d=n.anchorNode===1?n.anchorNode:n.anchorNode.parentElement,d.style.removeProperty(T),f()):(o.checkForTextNodes(d,h),h.filter(u=>o.checkForWorkClass(u)).forEach(u=>{u.style["font-size"]=t.value+"px",u.querySelectorAll('[style*="font-size"]').forEach(L=>{L.tagName!=="A"?L.style.removeProperty("font-size"):L.style["font-size"]=t.value+"px"})})),R&&g.forEach(u=>{const L=document.createElement("span");L.innerHTML=u.innerHTML;let O=t.value+"px";const de=u.children?.length===1&&u.firstChild?.nodeType===1?u.firstChild:null;if(o.checkForTextNodes(u,h),h.forEach(_=>{if(_.tagName==="FONT"){const M=document.createElement("span");M.innerHTML=_.innerHTML,_.getAttribute("size")?M.style["font-size"]=_.innerText.trim()===x.trim()?O:"":Array.from(_.attributes).forEach(Q=>M.setAttribute(Q.name,Q.value)),_?.parentNode?.replaceChild(M,_)}}),de)u.parentNode?.replaceChild(de,u);else if(u.attributes.size?.value&&u.parentNode){const _=document.createElement("span");_.innerHTML=u.innerHTML,_.style["font-size"]=O,u.parentNode?.replaceChild(_,u)}if(!h.length&&u.tagName==="FONT"){const _=document.createElement("span");_.innerHTML=u.innerHTML,u.parentNode?.replaceChild(_,u)}}),Array.from(document?.getElementsByTagName("span")||[]).reverse().forEach(u=>{u.innerText===x&&(s.selectNode(u),A(s))})}if(t.command==="bold"){if(y&&p&&r.classList.add(p),!R){let c=[];o.checkForTextNodes(d,c);const g=c.filter(h=>o.checkForWorkClass(h));t.value,g.forEach(h=>{h.innerHTML=h.innerHTML.replaceAll(/<\/?(strong|s|b)>/gi,""),h.tagName!=="STRONG"?t.value&&(h.innerHTML="<strong>"+h.innerHTML+"</strong>"):t.value||(h.outerHTML=h.innerHTML)})}t.value===!0?Array.from(d?.getElementsByTagName("b")||[]).reverse().forEach(c=>{const g=document.createElement("strong");if(g.innerHTML=c.innerHTML,c.parentNode.replaceChild(g,c),g.innerText===x){const h=g.closest("span");h?.textContent===g.innerText&&!h.getAttribute("style")&&h.childNodes[0].nodeType===3&&h.parentNode.replaceChild(g,h),s.selectNode(g),A(s)}}):(Array.from(r?.getElementsByTagName("b")||[]).reverse().forEach(c=>{const g=document.createElement("strong");g.innerHTML=c.innerHTML,c.parentNode.replaceChild(g,c)}),f(),r?.innerText.trim()===x.trim()&&W(x)&&(s.selectNode(W(x)),A(s)))}if(t.command==="italic"){if(y&&p&&r.classList.add(p),!R){let c=[];o.checkForTextNodes(d,c),c.filter(g=>o.checkForWorkClass(g)).forEach(g=>{g.innerHTML=g.innerHTML.replaceAll(/<\/?(em|i)>/gi,""),g.tagName!=="EM"?t.value&&(g.innerHTML="<em>"+g.innerHTML+"</em>"):t.value||(g.outerHTML=g.innerHTML)})}t.value?(Array.from(d?.getElementsByTagName("i")||[]).reverse().forEach(c=>{const g=document.createElement("em");if(g.innerHTML=c.innerHTML,c.parentNode.replaceChild(g,c),c.innerText===x){const h=g.closest("span");h?.textContent===g.innerText&&!h.getAttribute("style")&&h.childNodes[0].nodeType===3&&h.parentNode.replaceChild(g,h),s.selectNode(g),A(s)}}),Array.from(d?.getElementsByTagName("em")||[]).reverse().forEach(c=>{c.innerText===x&&(s.selectNode(c),A(s))})):(Array.from(d?.getElementsByTagName("i")||[]).reverse().forEach(c=>{const g=document.createElement("em");g.innerHTML=c.innerHTML,c.parentNode.replaceChild(g,c)}),r?.innerText.trim()===x.trim()&&W(x)&&(s.selectNode(W(x)),A(s)))}if(t.command==="strikethrough"){if(!R){let c=[];o.checkForTextNodes(d,c),c.filter(g=>o.checkForWorkClass(g)).forEach(g=>{g.innerHTML=g.innerHTML.replaceAll(/<\/?(strike)>/gi,""),g.tagName!=="STRIKE"?t.value&&(g.innerHTML="<strike>"+g.innerHTML+"</strike>"):t.value||(g.outerHTML=g.innerHTML)})}if(t.value===!0?Nt.forEach(c=>{c.innerText.trim()===x.trim()&&(c.parentNode?.innerText.trim()===x.trim()&&c.parentNode.tagName==="U"&&(c.parentNode.outerHTML=c.parentNode.innerHTML),$(W(x)))}):(f(),r?.innerText.trim()===x.trim()&&(s.selectNode(W(x)),A(s))),i.type==="button"||e.tagName==="A")if(i.type!=="button"&&e.tagName==="A"&&(r=e),r.innerText.trim()===o.getSelectedText().trim())r.style.textDecoration=t.value?"line-through":"none",Array.from(r.querySelectorAll('span[style*="text-decoration"]')).forEach(c=>c.style.textDecoration=""),r.innerHTML=r.innerHTML.replaceAll(/<\/?(strike|u)>/gi,""),$(r),s.selectNode(r),A(s);else{const c=n.getRangeAt(0),g=document.createElement("span");g.style.textDecoration=t.value?"line-through":"none",e.nodeType===1&&e.tagName==="SPAN"?(e.style.textDecoration=e.style.textDecoration==="line-through"?"none":"line-through",Array.from(e.querySelectorAll('span[style*="text-decoration"]')).forEach(h=>h.style.textDecoration=""),$(e)):(g.appendChild(c.extractContents()),Array.from(g.querySelectorAll('span[style*="text-decoration"]')).forEach(h=>h.style.textDecoration=""),c.insertNode(g),$(g))}}if(t.command==="underline"){if(!R){let c=[];o.checkForTextNodes(d,c),c.filter(g=>o.checkForWorkClass(g)).forEach(g=>{g.innerHTML=g.innerHTML.replaceAll(/<\/?(u)>/gi,""),g.tagName!=="U"?t.value&&(g.innerHTML="<u>"+g.innerHTML+"</u>"):t.value||(g.outerHTML=g.innerHTML)})}if(t.value){const c=Array.from(r?.getElementsByTagName("u")||[]).reverse();c.push(...Array.from(r?.querySelectorAll("a,span[style*=text-decoration]")||[]).reverse()),c.filter(g=>g.innerText.trim()===x.trim()).forEach(g=>{if(x.trim()&&g.innerText.trim()===x.trim()){let h=g.childNodes[0].nodeType===3;g.style.textDecoration="underline",g.firstChild.tagName==="STRIKE"&&g.firstChild.innerText.trim()===x.trim()&&[...g.firstChild.attributes].forEach(function(u){g.setAttribute(u.name,u.value),g.firstChild.removeAttribute(u.name)}),g.innerHTML=g.innerHTML.replaceAll(/<\/?strike[^>]*>/gi,""),$(W(x)),h&&W(x)&&(s.selectNode(W(x)),A(s))}})}else f(),r?.innerText.trim()===x.trim()&&W(x)&&(s.selectNode(W(x)),A(s));if(i.type==="button"||e.tagName==="A")if(i.type!=="button"&&e.tagName==="A"&&(r=e),r.innerText.trim()===o.getSelectedText().trim())r.style.textDecoration=t.value?"underline solid":"none",Array.from(r.querySelectorAll('span[style*="text-decoration"]')).forEach(c=>c.style.textDecoration=""),r.innerHTML=r.innerHTML.replaceAll(/<\/?(strike|u)[^>]*>/gi,""),$(r),s.selectNode(r),A(s);else{const c=n.getRangeAt(0),g=document.createElement("span");g.style.textDecoration=t.value?"underline":"none",e.nodeType===1&&e.tagName==="SPAN"?(e.style.textDecoration=e.style.textDecoration==="underline"?"none":"underline",Array.from(e.querySelectorAll('span[style*="text-decoration"]')).forEach(h=>h.style.textDecoration=""),$(e)):(g.appendChild(c.extractContents()),Array.from(g.querySelectorAll('span[style*="text-decoration"]')).forEach(h=>h.style.textDecoration=""),c.insertNode(g),$(g))}}if(D){let c=[];const g=T==="color"?T:"background-color";if(Re&&R&&(r.style[g]=Re),r.innerText.trim()===x.trim()){if(T==="color")if(i.type==="button"){const u=(e||d).closest("a");u.style.color=o.rgbToHex(t.value),u.querySelectorAll('span[style*="color"]').forEach(L=>L.style.color="")}else r.style.color=o.rgbToHex(t.value),r.firstChild.nodeType===1&&r.firstChild.tagName==="SPAN"&&r.firstChild.innerText.trim()===x.trim()&&(r.firstChild.style[g]="");else{const u=document.createElement("span");if(u.style[g]=o.rgbToHex(t.value),r.firstChild.nodeType===1&&r.firstChild.tagName==="SPAN"&&r.firstChild.innerText.trim()===x.trim())r.firstChild.style[g]=o.rgbToHex(t.value);else{for(;r.firstChild;)u.appendChild(r.firstChild);r.appendChild(u)}}r.querySelectorAll(`span[style*="${g}"]`).forEach(u=>u.innerText!==r.innerText&&u.style.removeProperty(g))}R?t.value||(n=window.getSelection(),s=n.getRangeAt(0),d=n.anchorNode===1?n.anchorNode:n.anchorNode.parentElement,d.style.removeProperty(g),f()):(o.checkForTextNodes(d,c),c.forEach(u=>{o.checkForWorkClass(u)&&(u.style[g]=t.value,u.querySelectorAll(`[style*="${g}"]`).forEach(L=>{L.tagName!=="A"?L.style.removeProperty(T):L.style[g]=t.value}))})),R&&Bt.forEach(u=>{const L=document.createElement("span");L.innerHTML=u.innerHTML;const O=o.rgbToHex(u.attributes[T].value).toString(),de=u.children.length===1&&u.firstChild.nodeType===1?u.firstChild:null;let _=[];if(o.checkForTextNodes(u,_),_.forEach(M=>{if(M.tagName==="FONT"){const Q=document.createElement("span");Q.innerHTML=M.innerHTML,Q.style[g]=O,M.parentNode.replaceChild(Q,M)}else M.style[g]=O}),de)u.parentNode.replaceChild(de,u);else if(u.attributes[T].value&&u.parentNode){const M=document.createElement("span");M.innerHTML=u.innerHTML,M.style[g]=O,u.closest("a")&&u.closest("a").innerText===u.innerText&&(u.closest("a").style[g]=O),u.parentNode.replaceChild(M,u)}});const h=Array.from(r?.getElementsByTagName("span")||[]).reverse();R&&h.forEach(u=>{u.innerText===x&&(s.selectNode(u),A(s))})}if(t.name==="textLink"){let c=d.querySelector('a[href=" "]');if(!R){let g=function(h){const u=document.getElementsByTagName("*");for(let L=0;L<u.length;L++)if(u[L].textContent.includes(h))return u[L];return null};var Rt=g;c=g(x)}if(t.value){const g=o.state.get("commonStyles")?.links?.underline===void 0||o.state.get("commonStyles")?.links?.underline?"underline":"none";c.setAttribute("target","_blank"),c.setAttribute("href",""),c.setAttribute("style",`color: ${o.state.get("commonStyles")?.links?.color||c.closest('[style*="color"]')?.color}; text-decoration: ${g};`),c.setAttribute("new",!0),$(c)}else{if(c=d.closest("a")||d.querySelector('a[em-edit="active"]'),c){const g=Array.from(c.childNodes);g.forEach(h=>{c.parentNode.insertBefore(h,c)}),s=document.createRange(),s.setStartBefore(g[0]),s.setEndAfter(g[g.length-1]),A(s),c.parentNode.removeChild(c),d=n.anchorNode===1?n.anchorNode:n.anchorNode.parentElement,$(d)}f()}}f(),S()}function bt(e){const i=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];try{o.state.increment("activeElementLocked");let t=e.data,l=document.querySelector("[em-edit]");if(t.settings=ze.escape(t.settings),t.type==="img"||t.type==="countdown"||t.type==="video"){if((t.settings.src||t.settings.src==="")&&(l.getAttribute("src").indexOf("<!--")>-1?l.setAttribute("src","<!--"+t.settings.src+"-->"):l.setAttribute("src",t.settings.src)),(t.settings.alt||t.settings.alt==="")&&l.setAttribute("alt",t.settings.alt),t.settings.border&&U({settings:t.settings,elem:l}),t.settings.boxShadow&&te({settings:t.settings,elem:l}),t.settings.align&&t.settings.align!=="undefined"?l.closest("td").setAttribute("align",t.settings.align):t.settings.align===""&&l.closest("td").removeAttribute("align"),t.settings.valign?l.style.verticalAlign=t.settings.valign:t.settings.valign===""&&l.style.removeProperty("vertical-align"),t.settings.width&&(t.settings.width.value?(l.setAttribute("width",t.settings.width.value+(t.settings.width.dim==="px"?"":"%")),l.style.width="100%",l.style.maxWidth=t.settings.width.value+t.settings.width.dim):(l.removeAttribute("width"),l.style.removeProperty("width"),l.style.removeProperty("max-width"))),t.settings.height&&(t.settings.height.value?(l.setAttribute("height",t.settings.height.value+(t.settings.height.dim==="px"?"":"%")),l.style.height=t.settings.height.valign+t.settings.height.dim):(l.removeAttribute("height"),l.style.removeProperty("height"))),t.settings.borderRadius&&K({settings:t.settings,elem:l}),t.settings.mobileWidth&&Z({settings:t.settings,elem:l}),t.settings.mobileHeight&&ie({settings:t.settings,elem:l}),t.settings.mobileBorder&&le({settings:t.settings,elem:l}),t.settings.mobileBorderRadius&&oe({settings:t.settings,elem:l}),t.settings.mobileBoxShadow&&ne({settings:t.settings,elem:l}),t.settings.mobileAlign){const n=l.closest("td");se({settings:t.settings,elem:n})}t.settings.mobileVerticalAlign&&ae({settings:t.settings,elem:l}),t.settings.show&&J({settings:t.settings,elem:l})}else if(t.type==="a"){if((t.settings.href||t.settings.href==="")&&(t.settings.href!==""&&t.settings.href.substring(0,4)!=="http"&&l.getAttribute("href").indexOf("<!--")>-1?l.setAttribute("href","<!--"+t.settings.href+"-->"):l.setAttribute("href",t.settings.href)),t.settings.target&&l.setAttribute("target",t.settings.target),i.some(n=>t.settings.hasOwnProperty(n)))try{be(l,t)}catch{}}else if(t.type==="table")t.settings.align?l.setAttribute("align",t.settings.align):t.settings.align===""&&l.removeAttribute("align"),t.settings.width&&(t.settings.width.value?(l.setAttribute("width",t.settings.width.value+(t.settings.width.dim==="px"?"":"%")),l.style.width=t.settings.width.value+t.settings.width.dim,t.settings.width.dim==="px"&&o.editConditionalComment({elem:l,width:t.settings.width.value})):(l.removeAttribute("width"),l.style.removeProperty("width"))),t.settings.maxWidth&&(t.settings.maxWidth.value?(l.style.maxWidth=t.settings.maxWidth.value+t.settings.maxWidth.dim,o.editConditionalComment({elem:l,width:t.settings.maxWidth.value})):l.style.removeProperty("max-width")),t.settings.minWidth&&(t.settings.minWidth.value?l.style.minWidth=t.settings.minWidth.value+t.settings.minWidth.dim:l.style.removeProperty("min-width")),t.settings.border&&U({settings:t.settings,elem:l}),t.settings.boxShadow&&te({settings:t.settings,elem:l}),(t.settings.backgroundColor||t.settings.backgroundColor==="")&&(t.settings.backgroundColor===""?(l.removeAttribute("bgcolor"),l.style.removeProperty("background-color")):(l.setAttribute("bgcolor",t.settings.backgroundColor),l.style.backgroundColor=t.settings.backgroundColor)),t.settings.backgroundImage&&(t.settings.backgroundImage[0].value===""?(l.style.removeProperty("background-image"),l.removeAttribute("background")):(l.style.removeProperty("background-image"),l.setAttribute("background",t.settings.backgroundImage[0].value))),(t.settings.backgroundPositionX||t.settings.backgroundPositionX==="")&&(t.settings.backgroundPositionX===""?l.style.removeProperty("background-position-x"):l.style.backgroundPositionX=t.settings.backgroundPositionX),(t.settings.backgroundPositionY||t.settings.backgroundPositionY==="")&&(t.settings.backgroundPositionY===""?l.style.removeProperty("background-position-y"):l.style.backgroundPositionY=t.settings.backgroundPositionY),t.settings.backgroundRepeat&&(t.settings.backgroundRepeat==="none"?l.style.removeProperty("background-repeat"):l.style.backgroundRepeat=t.settings.backgroundRepeat),t.settings.borderRadius&&K({settings:t.settings,elem:l}),t.settings.mobileWidth&&Z({settings:t.settings,elem:l}),t.settings.mobileBorder&&le({settings:t.settings,elem:l}),t.settings.mobileBorderRadius&&oe({settings:t.settings,elem:l}),t.settings.mobileBoxShadow&&ne({settings:t.settings,elem:l}),t.settings.mobileBackgroundColor&&fe({settings:t.settings,elem:l}),t.settings.mobileBackgroundImage&&ue({settings:t.settings,elem:l}),t.settings.mobileBackgroundPositionX&&he({settings:t.settings,elem:l}),t.settings.mobileBackgroundPositionY&&ye({settings:t.settings,elem:l}),t.settings.mobileBackgroundRepeat&&ve({settings:t.settings,elem:l}),t.settings.show&&J({settings:t.settings,elem:l});else if(t.type==="td"||t.type==="structure"){if(t.settings.align?l.setAttribute("align",t.settings.align):t.settings.align===""&&l.removeAttribute("align"),t.settings.valign?l.closest("table").getAttribute("em")&&l.closest("table").getAttribute("em")==="atom"?l.closest("table").parentElement.setAttribute("valign",t.settings.valign):l.setAttribute("valign",t.settings.valign):t.settings.valign===""&&(l.closest("table").getAttribute("em")&&l.closest("table").getAttribute("em")==="atom"?l.closest("table").parentElement.removeAttribute("valign"):l.removeAttribute("valign")),t.settings.width&&(l.closest("table").getAttribute("em")&&l.closest("table").getAttribute("em")==="atom"?t.settings.width.value?l.closest("table").setAttribute("width",t.settings.width.value+(t.settings.width.dim==="px"?"":"%")):l.closest("table").removeAttribute("width"):t.settings.width.value?l.setAttribute("width",t.settings.width.value+(t.settings.width.dim==="px"?"":"%")):l.removeAttribute("width")),t.settings.height)if(t.settings.height.value){if(l.setAttribute("height",t.settings.height.value+(t.settings.height.dim==="px"?"":"%")),l.style.height=t.settings.height.value+t.settings.height.dim,l.firstElementChild&&l.firstElementChild.tagName==="A"&&l.firstElementChild.style.display==="block"){let n=l.firstElementChild;n.style.height=t.settings.height.value+t.settings.height.dim,n.style.lineHeight=t.settings.height.value+t.settings.height.dim}}else l.removeAttribute("height"),l.style.removeProperty("height");if(t.settings.border&&U({settings:t.settings,elem:l}),t.settings.boxShadow&&te({settings:t.settings,elem:l}),(t.settings.backgroundColor||t.settings.backgroundColor==="")&&(t.settings.backgroundColor===""?(l.removeAttribute("bgcolor"),l.style.removeProperty("background-color")):(l.setAttribute("bgcolor",t.settings.backgroundColor),l.style.backgroundColor=t.settings.backgroundColor)),t.settings.backgroundImage&&(t.settings.backgroundImage[0].value===""?(l.style.removeProperty("background-image"),l.removeAttribute("background")):(l.style.removeProperty("background-image"),l.setAttribute("background",t.settings.backgroundImage[0].value))),(t.settings.backgroundPositionX||t.settings.backgroundPositionX==="")&&(t.settings.backgroundPositionX===""?l.style.removeProperty("background-position-x"):l.style.backgroundPositionX=t.settings.backgroundPositionX),(t.settings.backgroundPositionY||t.settings.backgroundPositionY==="")&&(t.settings.backgroundPositionY===""?l.style.removeProperty("background-position-y"):l.style.backgroundPositionY=t.settings.backgroundPositionY),t.settings.backgroundRepeat&&(t.settings.backgroundRepeat==="none"?l.style.removeProperty("background-repeat"):l.style.backgroundRepeat=t.settings.backgroundRepeat),t.settings.direction?(l.setAttribute("dir",t.settings.direction),t.settings.direction==="rtl"&&l.querySelectorAll("td").forEach(n=>{for(let s=n.firstChild;s;s=s.nextSibling)if(s.nodeType===3){s.parentNode.setAttribute("dir","ltr");break}})):t.settings.direction===""&&(l.removeAttribute("dir"),l.querySelectorAll("[dir]").forEach(n=>n.removeAttribute("dir"))),t.settings.padding&&(t.settings.padding.all!==void 0?(l.style.paddingTop=t.settings.padding.all+"px",l.style.paddingRight=t.settings.padding.all+"px",l.style.paddingBottom=t.settings.padding.all+"px",l.style.paddingLeft=t.settings.padding.all+"px"):((t.settings.padding.top||t.settings.padding.top===0)&&(l.style.paddingTop=t.settings.padding.top+"px"),(t.settings.padding.right||t.settings.padding.right===0)&&(l.style.paddingRight=t.settings.padding.right+"px"),(t.settings.padding.bottom||t.settings.padding.bottom===0)&&(l.style.paddingBottom=t.settings.padding.bottom+"px"),(t.settings.padding.left||t.settings.padding.left===0)&&(l.style.paddingLeft=t.settings.padding.left+"px"))),t.settings.borderRadius&&K({settings:t.settings,elem:l}),i.some(n=>t.settings.hasOwnProperty(n)))try{be(l,t)}catch{}t.settings.mobileWidth&&Z({settings:t.settings,elem:l}),t.settings.mobileHeight&&ie({settings:t.settings,elem:l}),t.settings.mobileBorder&&le({settings:t.settings,elem:l}),t.settings.mobileBorderRadius&&oe({settings:t.settings,elem:l}),t.settings.mobileBoxShadow&&ne({settings:t.settings,elem:l}),t.settings.mobileAlign&&se({settings:t.settings,elem:l}),t.settings.mobileVerticalAlign&&ae({settings:t.settings,elem:l}),t.settings.mobileDirection&&Ge({settings:t.settings,elem:l}),t.settings.mobileBackgroundColor&&fe({settings:t.settings,elem:l}),t.settings.mobileBackgroundImage&&ue({settings:t.settings,elem:l}),t.settings.mobileBackgroundPositionX&&he({settings:t.settings,elem:l}),t.settings.mobileBackgroundPositionY&&ye({settings:t.settings,elem:l}),t.settings.mobileBackgroundRepeat&&ve({settings:t.settings,elem:l}),t.settings.mobilePadding&&we({settings:t.settings,elem:l}),t.settings.show&&J({settings:t.settings,elem:l})}else if(t.type==="button"){if((t.settings.href||t.settings.href==="")&&l.closest("a").setAttribute("href",t.settings.href),t.settings.align?l.closest("td").setAttribute("align",t.settings.align):t.settings.align===""&&l.closest("td").removeAttribute("align"),t.settings.valign?l.closest("td").setAttribute("valign",t.settings.valign):t.settings.valign===""&&l.closest("td").removeAttribute("valign"),t.settings.width)if(t.settings.width.value){const n=l.closest("table");n.setAttribute("width",t.settings.width.value+(t.settings.width.dim==="px"?"":"%")),n.style.width=t.settings.width.value+t.settings.width.dim}else{const n=l.closest("table");n.removeAttribute("width"),n.style.removeProperty("width")}if(t.settings.height)if(t.settings.height.value){const n=l.closest("td");n.setAttribute("height",t.settings.height.value+(t.settings.height.dim==="px"?"":"%")),n.style.height=t.settings.height.value+t.settings.height.dim;let s=l.closest("a");s.style.height=t.settings.height.value+t.settings.height.dim,s.style.lineHeight=t.settings.height.value+t.settings.height.dim,s.firstElementChild&&(s.firstElementChild.style.lineHeight=t.settings.height.value+t.settings.height.dim),s.closest("editor").style.height=t.settings.height.value+t.settings.height.dim,s.closest("editor").style.lineHeight=t.settings.height.value+t.settings.height.dim}else{const n=l.closest("td");n.removeAttribute("height"),n.style.removeProperty("height");let s=l.closest("a");s.style.removeProperty("height"),s.style.removeProperty("line-height"),s.closest("editor").style.removeProperty("height"),s.closest("editor").style.removeProperty("line-height")}if(t.settings.border&&U({settings:t.settings,elem:l.closest("td")}),t.settings.boxShadow&&te({settings:t.settings,elem:l.closest("td")}),t.settings.backgroundColor||t.settings.backgroundColor==="")if(t.settings.backgroundColor===""){const n=l.closest("td");n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")}else{const n=l.closest("td");n.setAttribute("bgcolor",t.settings.backgroundColor),n.style.backgroundColor=t.settings.backgroundColor}if(t.settings.backgroundImage){const n=l.closest("td");t.settings.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.setAttribute("background",t.settings.backgroundImage[0].value))}if(t.settings.backgroundPositionX||t.settings.backgroundPositionX==="")if(t.settings.backgroundPositionX==="")l.closest("td").style.removeProperty("background-position-x");else{const n=l.closest("td");n.style.backgroundPositionX=t.settings.backgroundPositionX}if(t.settings.backgroundPositionY||t.settings.backgroundPositionY==="")if(t.settings.backgroundPositionY==="")l.closest("td").style.removeProperty("background-position-y");else{const n=l.closest("td");n.style.backgroundPositionY=t.settings.backgroundPositionY}if(t.settings.backgroundRepeat)if(t.settings.backgroundRepeat==="none")l.closest("td").style.removeProperty("background-repeat");else{const n=l.closest("td");n.style.backgroundRepeat=t.settings.backgroundRepeat}if(t.settings.padding){const n=l.closest("a");t.settings.padding.all!==void 0?(n.style.paddingTop=t.settings.padding.all+"px",n.style.paddingRight=t.settings.padding.all+"px",n.style.paddingBottom=t.settings.padding.all+"px",n.style.paddingLeft=t.settings.padding.all+"px"):((t.settings.padding.top||t.settings.padding.top===0)&&(n.style.paddingTop=t.settings.padding.top+"px"),(t.settings.padding.right||t.settings.padding.right===0)&&(n.style.paddingRight=t.settings.padding.right+"px"),(t.settings.padding.bottom||t.settings.padding.bottom===0)&&(n.style.paddingBottom=t.settings.padding.bottom+"px"),(t.settings.padding.left||t.settings.padding.left===0)&&(n.style.paddingLeft=t.settings.padding.left+"px"))}if(t.settings.borderRadius){const n=l.closest("td");K({settings:t.settings,elem:n})}if(t.settings.mobileWidth){const n=l.closest("table");Z({settings:t.settings,elem:n})}if(t.settings.mobileHeight){const n=l.closest("td");ie({settings:t.settings,elem:n})}if(t.settings.mobileBorder){const n=l.closest("td");le({settings:t.settings,elem:n})}if(t.settings.mobileBorderRadius){const n=l.closest("td");oe({settings:t.settings,elem:n})}if(t.settings.mobileBoxShadow){const n=l.closest("td");ne({settings:t.settings,elem:n})}if(t.settings.mobileAlign){const n=l.closest("td");se({settings:t.settings,elem:n})}if(t.settings.mobileVerticalAlign){const n=l.closest("td");ae({settings:t.settings,elem:n})}if(t.settings.mobileBackgroundColor){const n=l.closest("td");fe({settings:t.settings,elem:n})}if(t.settings.mobileBackgroundImage){const n=l.closest("td");ue({settings:t.settings,elem:n})}if(t.settings.mobileBackgroundPositionX){const n=l.closest("td");he({settings:t.settings,elem:n})}if(t.settings.mobileBackgroundPositionY){const n=l.closest("td");ye({settings:t.settings,elem:n})}if(t.settings.mobileBackgroundRepeat){const n=l.closest("td");ve({settings:t.settings,elem:n})}if(t.settings.mobilePadding&&we({settings:t.settings,elem:l}),t.settings.show){const n=l.closest("table");J({settings:t.settings,elem:n})}if(i.some(n=>t.settings.hasOwnProperty(n)))try{be(l,t)}catch{}}else if(t.type==="div")t.settings.align?l.style.textAlign=t.settings.align:t.settings.valign===""&&l.style.removeProperty("text-align"),t.settings.valign?l.style.verticalAlign=t.settings.valign:t.settings.valign===""&&l.style.removeProperty("vertical-align"),t.settings.width&&(t.settings.width.value?l.style.width=t.settings.width.value+t.settings.width.dim:l.style.removeProperty("width")),t.settings.minWidth&&(t.settings.minWidth.value?l.style.minWidth=t.settings.minWidth.value+t.settings.minWidth.dim:l.style.removeProperty("min-width")),t.settings.maxWidth&&(t.settings.maxWidth.value?l.style.maxWidth=t.settings.maxWidth.value+t.settings.maxWidth.dim:l.style.removeProperty("max-width")),t.settings.height&&(t.settings.height.value?l.style.height=t.settings.height.value+t.settings.height.dim:l.style.removeProperty("height")),t.settings.border&&U({settings:t.settings,elem:l}),t.settings.boxShadow&&te({settings:t.settings,elem:l}),(t.settings.backgroundColor||t.settings.backgroundColor==="")&&(t.settings.backgroundColor===""?l.style.removeProperty("background-color"):l.style.backgroundColor=t.settings.backgroundColor),t.settings.backgroundImage&&(t.settings.backgroundImage[0].value===""?l.style.removeProperty("background-image"):l.style.backgroundImage=t.settings.backgroundImage[0].type+"("+t.settings.backgroundImage[0].value+")"),(t.settings.backgroundPositionX||t.settings.backgroundPositionX==="")&&(t.settings.backgroundPositionX===""?l.style.removeProperty("background-position-x"):l.style.backgroundPositionX=t.settings.backgroundPositionX),(t.settings.backgroundPositionY||t.settings.backgroundPositionY==="")&&(t.settings.backgroundPositionY===""?l.style.removeProperty("background-position-y"):l.style.backgroundPositionY=t.settings.backgroundPositionY),t.settings.backgroundRepeat&&(t.settings.backgroundRepeat==="none"?l.style.removeProperty("background-repeat"):l.style.backgroundRepeat=t.settings.backgroundRepeat),t.settings.padding&&(t.settings.padding.all?(l.style.paddingTop=t.settings.padding.all+"px",l.style.paddingRight=t.settings.padding.all+"px",l.style.paddingBottom=t.settings.padding.all+"px",l.style.paddingLeft=t.settings.padding.all+"px"):(t.settings.padding.top&&(l.style.paddingTop=t.settings.padding.top+"px"),t.settings.padding.right&&(l.style.paddingRight=t.settings.padding.right+"px"),t.settings.padding.bottom&&(l.style.paddingBottom=t.settings.padding.bottom+"px"),t.settings.padding.left&&(l.style.paddingLeft=t.settings.padding.left+"px"))),t.settings.borderRadius&&K({settings:t.settings,elem:l}),t.settings.mobileWidth&&Z({settings:t.settings,elem:l}),t.settings.mobileHeight&&ie({settings:t.settings,elem:l}),t.settings.mobileBorder&&le({settings:t.settings,elem:l}),t.settings.mobileBorderRadius&&oe({settings:t.settings,elem:l}),t.settings.mobileBoxShadow&&ne({settings:t.settings,elem:l}),t.settings.mobileAlign&&se({settings:t.settings,elem:l}),t.settings.mobileVerticalAlign&&ae({settings:t.settings,elem:l}),t.settings.mobileDirection&&Ge({settings:t.settings,elem:l}),t.settings.mobileBackgroundColor&&fe({settings:t.settings,elem:l}),t.settings.mobileBackgroundImage&&ue({settings:t.settings,elem:l}),t.settings.mobileBackgroundPositionX&&he({settings:t.settings,elem:l}),t.settings.mobileBackgroundPositionY&&ye({settings:t.settings,elem:l}),t.settings.mobileBackgroundRepeat&&ve({settings:t.settings,elem:l}),t.settings.mobilePadding&&we({settings:t.settings,elem:l}),t.settings.show&&J({settings:t.settings,elem:l});else if(t.type==="vindent")t.settings.height&&(l.tagName==="DIV"?(l.style.height=t.settings.height.value+t.settings.height.dim,l.style.lineHeight=t.settings.height.value+t.settings.height.dim,l.style.fontSize=parseInt(t.settings.height.value)-2+t.settings.height.dim):l.tagName==="TD"&&l.setAttribute("height",t.settings.height.value)),t.settings.mobileHeight&&ie({settings:t.settings,elem:l});else if(t.type==="var"){let n=l.nextSibling.nodeType===8?l.nextSibling:null;if(n){const s=t.settings.value;n.nodeValue=t.settings.value.substring(4,s.length-3)}}else if(t.type==="floatBlock"){if(t.settings.width)if(t.settings.width.value){let n=parseFloat(l.style.width)-parseFloat(l.firstElementChild.getAttribute("width"));l.style.width=t.settings.width.value+t.settings.width.dim,t.settings.width.dim==="px"&&(o.editConditionalComment({elem:l,width:t.settings.width.value}),l.firstElementChild.tagName==="TABLE"&&l.firstElementChild.setAttribute("width",t.settings.width.value-n))}else l.style.removeProperty("width");t.settings.gap&&(t.settings.gap.value||t.settings.gap.value===0)&&l.parentElement.querySelectorAll('div[style*="display: inline-block"], div[style*="display:inline-block"]').forEach(n=>{n.firstElementChild.tagName==="TABLE"&&n.firstElementChild.setAttribute("width",parseFloat(n.style.width)-parseFloat(t.settings.gap.value))}),t.settings.maxWidth&&(t.settings.maxWidth.value?(l.style.maxWidth=t.settings.maxWidth.value+t.settings.maxWidth.dim,o.editConditionalComment({elem:l,width:t.settings.width.value})):l.style.removeProperty("max-width")),t.settings.minWidth&&(t.settings.minWidth.value?l.style.minWidth=t.settings.minWidth.value+t.settings.minWidth.dim:l.style.removeProperty("min-width")),t.settings.valign&&(l.style.verticalAlign=t.settings.valign),t.settings.mobileWidth&&Z({settings:t.settings,elem:l}),t.settings.mobileVerticalAlign&&ae({settings:t.settings,elem:l}),t.settings.show&&J({settings:t.settings,elem:l})}else if(t.type==="text"){if(typeof t.settings?.linkHref=="string"&&l.closest("a").setAttribute("href",t.settings.linkHref),i.some(n=>t.settings.hasOwnProperty(n)))try{be(l,t)}catch{}if(t.settings.mobileFontSize&&At({settings:t.settings,elem:l}),t.settings.mobileLineHeight&&xt({settings:t.settings,elem:l}),t.settings.textAlign||t.settings.textAlign===""){const n=l.closest("div, p, td");t.settings.textAlign?n.style.textAlign?n.style.textAlign=t.settings.textAlign:n.setAttribute("align",t.settings.textAlign):n.removeAttribute("align")}if(t.settings.mobileTextAlign){const n=l.closest("div, p, td");se({settings:t.settings,elem:n,fieldName:"mobileTextAlign"})}}else if(t.type==="floatBlocksWidths")l.querySelector(".em-mob-wrap")||l.closest(".em-mob-wrap")?(l.querySelector(".em-mob-wrap")?document.querySelector('[em-edit="active"]'):l.closest(".em-mob-wrap").parentElement).querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((n,s)=>{n.setAttribute("width",t.settings.items[s])}):(l.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):l.closest('div[style*="inline-block"]').parentElement).querySelectorAll('div[style*="inline-block"]').forEach((n,s)=>{n.style.width=t.settings.items[s]+t.settings.gap+"px",o.editConditionalComment({elem:n.closest('div[style*="inline-block"]'),width:t.settings.items[s]+t.settings.gap}),n.firstElementChild.tagName==="TABLE"&&n.firstElementChild.setAttribute("width",t.settings.items[s])});else if(t.type==="floatBlocksValign")l.querySelector(".em-mob-wrap")||l.closest(".em-mob-wrap")?(l.querySelector(".em-mob-wrap")?document.querySelector('[em-edit="active"]'):l.closest(".em-mob-wrap").parentElement).querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((n,s)=>{n.setAttribute("valign",t.settings.valign)}):(l.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):l.closest('div[style*="inline-block"]').parentElement).querySelectorAll('div[style*="inline-block"]').forEach((n,s)=>{n.style.verticalAlign=t.settings.valign});else if(t.type==="floatBlocksGap")if(l.querySelector(".em-mob-wrap")||l.closest(".em-mob-wrap")){let n=l.querySelector(".em-mob-wrap")?document.querySelector('[em-edit="active"]'):l.closest(".em-mob-wrap").parentElement;n.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((s,d)=>{s.setAttribute("width",t.settings.items[d])}),n.querySelectorAll(".em-mob-wrap:nth-child(even)").forEach((s,d)=>{s.setAttribute("width",t.settings.gap)})}else(l.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):l.closest('div[style*="inline-block"]').parentElement).querySelectorAll('div[style*="inline-block"]').forEach((n,s)=>{n.style.width=t.settings.items[s]+t.settings.gap+"px",o.editConditionalComment({elem:n.closest('div[style*="inline-block"]'),width:t.settings.items[s]+t.settings.gap}),n.firstElementChild.tagName==="TABLE"&&n.firstElementChild.setAttribute("width",t.settings.items[s])});me().finally(()=>{const n=C.getMappedParent(l);if(n?.isConnected){const s=z.getOuterHtml(n),d=o.parseFromString(s)[0];n.parentNode?.replaceChild(d,n),d.setAttribute("em-edit","active"),l=d,me().finally(()=>{o.state.decrement("activeElementLocked"),N(l)})}else o.state.decrement("activeElementLocked"),N(l)})}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}o.messageService.addListener(function(e){if(e.data.operation==="update_position_from_editor"){let i=e.data.data;if(i){i=Ie.correctOffset(i,!0),i=Fe.correctOffset(i,!0);let t=C.getElementByPosition(i);if(t&&!(t instanceof Element)&&(t=t.parentElement),t){const l=t.getBoundingClientRect();t.tagName!=="BODY"&&l.height&&l.width&&w({elem:t});let n=t,s={operation:"application_scroll-to",settings:{value:o.state.get("applicationMode")==="default"?n.getBoundingClientRect().top+o.state.get("iframeOffsetTop")-o.state.get("previewHeight")/2+n.getBoundingClientRect().height/2:n.getBoundingClientRect().top-o.state.get("previewHeight")/2+n.getBoundingClientRect().height/2}};o.messageService.send(s)}}}if(e.data.operation==="editor_change_focus"&&V.isEditorInFocus!==e.data.data){let i=e.data.data;if(i)Te=new o.UpdateQueue;else{const t=Te.nodes;if(t.length)for(const l of t);Te=void 0}S(!i),je(i)}if(e.data.operation==="update_preview"&&(e.data.theme&&o.state.set("applicationTheme",e.data.theme),typeof e.data.pathEnabled!==void 0&&(We=e.data.pathEnabled),e.data.commonStyles&&o.state.set("commonStyles",e.data.commonStyles)),e.data.operation==="sandbox_block_settings_set"){let i=e.data;o.state.set("globalHolder",document.querySelector('[em="block-contaner"]')),o.state.get("globalHolder")&&(i.settings.width||i.settings.backgroundColor==="")&&(o.state.get("globalHolder").tagName==="TABLE"?o.state.get("globalHolder").setAttribute("width",i.settings.width.value+(i.settings.width.dim==="px"?"":"%")):o.state.get("globalHolder").style.maxWidth=i.settings.width.value+i.settings.width.dim),me()}if(e.data.operation==="sandbox_element_settings_set"&&V.whenEditorLostFocus(()=>bt(e)),e.data.operation==="sandbox_floatBlock_add"){let i=document.querySelector("[em-edit]");try{if(o.state.increment("activeElementLocked"),i.querySelector(".em-mob-wrap")||i.closest(".em-mob-wrap")){let t=i.querySelector(".em-mob-wrap")?document.querySelector('[em-edit="active"]'):i.closest(".em-mob-wrap").parentElement,l=e.data.settings.minWidth,n=t.querySelectorAll(".em-mob-wrap:nth-child(odd)").length,s=n>1?e.data.settings.gap:20,d=`<td width="${s}" class="em-mob-wrap"></td>
|
|
10
|
-
<td width="${l}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`,m=0,a=0,r=0;t.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach(p=>{parseFloat(p.getAttribute("width"))>l&&r++;let y=parseFloat(p.getAttribute("width"));m+=y});let b=(l+e.data.settings.gap)/r;if(t.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach(p=>{if(parseFloat(p.getAttribute("width"))>l){let y=parseFloat(p.getAttribute("width"))+s,f=Math.round(y-b);p.setAttribute("width",f)}}),t.querySelectorAll(".em-mob-wrap:nth-child(odd)")[n-1].insertAdjacentHTML("afterEnd",d),t.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach(p=>{let y=parseFloat(p.getAttribute("width"));a+=y}),m-a-s!==0){let p=t.querySelector(".em-mob-wrap"),y=parseFloat(p.getAttribute("width"))+(m-a-s);p.setAttribute("width",y)}S()}else{let t=i.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):i.closest('div[style*="inline-block"]').parentElement,l=e.data.settings.minWidth,n=t.querySelectorAll('div[style*="inline-block"]').length,s=n>1?e.data.settings.gap:20,d='<!--[if (gte mso 9)|(IE)]></td><td width="'+(l+s)+`" valign="top"><![endif]-->
|
|
11
|
-
<div style="display: inline-block; width: `+(l+s)+`px; vertical-align: top;" class="em-mobile-width-100">
|
|
12
|
-
<table width="`+l+`" border="0" cellspacing="0" cellpadding="0" class="em-mobile-width-91">
|
|
13
|
-
<tr>
|
|
14
|
-
<td align="left"></td>
|
|
15
|
-
</tr>
|
|
16
|
-
</table>
|
|
17
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
18
|
-
</div>`,m=0,a=0,r=0;n===1&&(i.querySelector('div[style*="inline-block"]')?(t.querySelector('div[style*="inline-block"]').style.removeProperty("max-width"),t.querySelector('div[style*="inline-block"]').firstElementChild.style.removeProperty("max-width"),t.querySelector('div[style*="inline-block"]').firstElementChild.style.removeProperty("width")):(i.closest('div[style*="inline-block"]').style.removeProperty("max-width"),i.closest('div[style*="inline-block"]').firstElementChild.style.removeProperty("max-width"),i.closest('div[style*="inline-block"]').firstElementChild.style.removeProperty("width"))),t.querySelectorAll('div[style*="inline-block"]').forEach(p=>{parseFloat(p.firstElementChild.getAttribute("width"))>l&&r++;let y=parseFloat(p.firstElementChild.getAttribute("width"));m+=y});let b=(l+e.data.settings.gap)/r;if(t.querySelectorAll('div[style*="inline-block"]').forEach(p=>{if(parseFloat(p.firstElementChild.getAttribute("width"))>l){let y=parseFloat(p.style.width),f=Math.round(y-b),A=f-s;p.style.width=f+"px",o.editConditionalComment({elem:p,width:f}),p.firstElementChild.tagName==="TABLE"&&p.firstElementChild.setAttribute("width",A)}}),t.querySelectorAll('div[style*="inline-block"]')[n-1].insertAdjacentHTML("afterEnd",d),t.querySelectorAll('div[style*="inline-block"]').forEach(p=>{let y=parseFloat(p.firstElementChild.getAttribute("width"));a+=y}),m-a-s!==0){let p=t.querySelector('div[style*="inline-block"]'),y=parseFloat(p.style.width)+(m-a-s);p.style.width=y+"px",o.editConditionalComment({elem:p,width:y}),p.firstElementChild.tagName==="TABLE"&&p.firstElementChild.setAttribute("width",y-s)}S()}}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}if(e.data.operation==="sandbox_floatBlock_remove"){let i=document.querySelector("[em-edit]");try{if(o.state.increment("activeElementLocked"),i.querySelector(".em-mob-wrap")||i.closest(".em-mob-wrap")){let t=i.querySelector(".em-mob-wrap")?document.querySelector('[em-edit="active"]'):i.closest(".em-mob-wrap").parentElement,l=0,n=0,s=parseFloat(e.data.settings.gap);t.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((m,a)=>{a===e.data.settings.removedBlockIndex&&(l=parseFloat(m.getAttribute("width")),i.closest(".em-mob-wrap"),m.nextElementSibling&&m.previousElementSibling?m.previousElementSibling.remove():m.nextElementSibling&&!m.previousElementSibling?m.nextElementSibling.remove():!m.nextElementSibling&&m.previousElementSibling&&m.previousElementSibling.remove(),m.remove())});let d=t.querySelectorAll(".em-mob-wrap:nth-child(odd)").length;if(n=Math.floor((l+s)/d),t.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((m,a)=>{let r=parseFloat(m.getAttribute("width")),b=Math.round(r+n);m.setAttribute("width",b)}),d===1){let m=t.querySelector(".em-mob-wrap"),a=m.closest("table").parentElement;m.setAttribute("width",a.getBoundingClientRect().width-parseFloat(a.style.paddingLeft)-parseFloat(a.style.paddingRight))}S()}else{let t=function(a){let r="";a.removedBlockIndex===0?r="nextSibling":r="previousSibling",a.elem.nodeName==="#comment"&&a.elem.textContent.indexOf("mso")>-1?a.elem.remove():a.elem[r]&&t({elem:a.elem[r],removedBlockIndex:a.removedBlockIndex})},l=i.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):i.closest('div[style*="inline-block"]').parentElement,n=0,s=0,d=parseFloat(e.data.settings.gap);l.querySelectorAll('div[style*="inline-block"]').forEach((a,r)=>{r===e.data.settings.removedBlockIndex&&(n=parseFloat(a.style.width),i.closest('div[style*="inline-block"]'),t({elem:a,removedBlockIndex:e.data.settings.removedBlockIndex}),a.remove())});let m=l.querySelectorAll('div[style*="inline-block"]').length;if(s=Math.round(n/m),l.querySelectorAll('div[style*="inline-block"]').forEach((a,r)=>{let b=parseFloat(a.style.width),p=Math.round(b+s),y=p-d;a.style.width=p+"px",o.editConditionalComment({elem:a,width:p}),a.firstElementChild.tagName==="TABLE"&&a.firstElementChild.setAttribute("width",y)}),m===1){let a=l.querySelector('div[style*="inline-block"]');a.style.width="100%",a.style.maxWidth=l.closest("table").style.maxWidth,o.editConditionalComment({elem:a,width:l.closest("table").style.maxWidth}),a.firstElementChild.style.width="91%",a.firstElementChild.style.maxWidth=parseFloat(a.firstElementChild.getAttribute("width"))+"px"}S()}}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}}if(e.data.operation==="sandbox_floatblock_wrap"){let i=document.querySelector("[em-edit]"),t=i.querySelector(".em-mob-wrap")?document.querySelector('[em-edit="active"]'):i.closest(".em-mob-wrap").parentElement;e.data.settings.wrap?t.querySelectorAll(".em-mob-wrap").forEach((l,n)=>{l.classList.remove("em-mob-wrap-cancel"),n%2===0&&(l.classList.add("em-mob-width-100perc"),l.classList.remove("em-mob-width-auto"))}):(t.querySelectorAll(".em-mob-wrap").forEach((l,n)=>{l.classList.add("em-mob-wrap-cancel"),l.classList.remove("em-mob-width-100perc"),n%2===0&&l.classList.add("em-mob-width-auto")}),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
19
|
-
@media only screen and (max-device-width:${o.state.get("emailWidth")?o.state.get("emailWidth"):660}px),only screen and (max-width:${o.state.get("emailWidth")?o.state.get("emailWidth"):660}px) {
|
|
20
|
-
.em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
|
|
21
|
-
.em-mob-width-auto { width: auto !important; }
|
|
22
|
-
}
|
|
23
|
-
`)),S()}if(e.data.operation==="sandbox_element_parent_get"){let i=pe(document.querySelector("[em-edit]"));N(i),w({elem:i})}if(e.data.operation==="sandbox_element_prev_get"){let i=document.querySelector("[em-edit]"),t=i;i.tagName==="IMG"?t=i.closest('div[em="atom"]')?i.closest('div[em="atom"]'):i.closest(".em-element-resize-img-container"):i.closest("editor")?t=i.closest('[style*="font-family"][style*="font-size"]'):i.tagName==="TD"&&i.classList.contains("em-vindent")?t=i.closest(".em-vindent-table"):i.tagName==="TD"&&i.parentElement.getAttribute("em")&&i.parentElement.getAttribute("em")==="block"&&(t=i.parentElement);let l=t.previousElementSibling;l.classList.contains("em-vindent-table")?l=l.querySelector("td"):l.classList.contains("em-element-resize-img-container")?l=l.querySelector("img"):l.tagName==="TR"&&l.getAttribute("em")&&l.getAttribute("em")==="block"&&(l=l.firstElementChild),N(l),w({elem:l})}if(e.data.operation==="sandbox_element_next_get"){let i=document.querySelector("[em-edit]"),t=i;i.tagName==="IMG"?t=i.closest('div[em="atom"]')?i.closest('div[em="atom"]'):i.closest(".em-element-resize-img-container"):i.closest("editor")?t=i.closest('[style*="font-family"][style*="font-size"]'):i.tagName==="TD"&&i.classList.contains("em-vindent")?t=i.closest(".em-vindent-table"):i.tagName==="TD"&&i.parentElement.getAttribute("em")&&i.parentElement.getAttribute("em")==="block"&&(t=i.parentElement);let l=t.nextElementSibling;l.classList.contains("em-vindent-table")?l=l.querySelector("td"):l.classList.contains("em-element-resize-img-container")?l=l.querySelector("img"):l.tagName==="TR"&&l.getAttribute("em")&&l.getAttribute("em")==="block"&&(l=l.firstElementChild),N(l),w({elem:l})}if(e.data.operation==="sandbox_element_remove"){let i=document.querySelector("[em-edit]"),t=pe(i),l=i.parentNode;if(N(t),i.tagName==="TD"&&i.innerHTML===""&&i.hasAttribute("height")){const d=i.closest("table");if(d){const m=d.previousSibling;m&&m?.textContent?.trim()===""&&m.remove(),d.remove()}}else if(i.closest(".em-element-resize-img-container"))i.closest(".em-element-resize-img-container").remove();else if(i.closest("table")?.getAttribute("em")==="atom"){const d=i.closest(".em-mob-wrap");i.closest("table").remove(),d&&d.textContent?.trim()===""&&(d.textContent="")}else{i.remove();const d=i.previousSibling;d&&d?.textContent?.trim()===""&&d.remove(),i.remove()}let n=function(d){d.elem.nodeName==="#comment"&&d.elem.textContent.indexOf("mso")>-1?d.elem.remove():d.elem.previousSibling&&n({elem:d.elem.previousSibling})},s=function(d){d.elem.querySelector(".em-element-editor")&&d.elem.querySelector(".em-element-editor").remove();let m=d.elem.parentElement;if(d.elem.innerHTML.trim()==="")n({elem:d.elem}),d.elem.remove(),s({elem:m});else if(!m.querySelector('div[style*="display"]')){for(let a of d.elem.childNodes)a.nodeName==="#text"&&a.textContent.trim()===""?(n({elem:a}),a.textContent=""):a.nodeName==="#comment"&&a.textContent.indexOf("mso")>-1&&(n({elem:a}),a.remove());d.elem.innerHTML.trim()===""&&s({elem:d.elem})}};s({elem:l}),S(),o.messageService.send({operation:"application_element_settings_close"})}if(e.data.operation==="sandbox_element_active_reset"){const i=document.querySelector("[em-edit]");i&&i.removeAttribute("em-edit");const t=document.querySelector(".em-editor-wrapper");t&&(t.style.display="none");const l=document.querySelectorAll("editor");l&&l.forEach(n=>n.blur())}if(e.data.operation==="sandbox_element_text"){if(e.data.action==="add_p"){let i=document.querySelector("[em-edit]"),t=null;(i.tagName==="DIV"||i.tagName==="P"||i.tagName==="TD"||i.tagName==="EDITOR"||i.tagName==="B"||i.tagName==="STRONG"||i.tagName==="SPAN"||i.tagName==="I"||i.tagName==="EM")&&(i.closest("div").style.fontFamily?t=i.closest("div"):i.closest("p").style.fontFamily?t=i.closest("p"):t=i,t&&(t.closest("table")?.getAttribute("em")==="atom"?t.closest("table").insertAdjacentHTML("afterend",'<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">'+C.getOuterHtml(t)+"</td></tr></table>"):t.insertAdjacentHTML("afterend",'<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">'+C.getOuterHtml(t)+"</td></tr></table>")),S()),N(i)}else if(e.data.action==="add_img"){if(window.getSelection){let i=document.createElement("img");i.setAttribute("src","https://emcdn.ru/843/20220715_113006_18.png"),i.setAttribute("width","25"),i.setAttribute("border","0"),i.setAttribute("alt",""),i.style.display="inline-block",i.style.verticalAlign="text-bottom";let t=window.getSelection();if(t.getRangeAt&&t.rangeCount){let l=t.getRangeAt(0);l.deleteContents(),l.insertNode(i)}else document.querySelector("[em-edit]")?.prepend(i);S()}N(document.querySelector("[em-edit]"))}else if(e.data.action==="typograf"||e.data.action==="typograf_all"){let i=document.querySelector("[em-edit]").closest("div")||document.querySelector("[em-edit]").closest("editor");const t=new qe.__CJS__export_default__({locale:["ru","en-US"],htmlEntity:{type:"name",onlyInvisible:!0,list:["nbsp","shy","mdash","ndash","laquo","raquo"]}});t.disableRule("ru/punctuation/*"),t.disableRule("common/punctuation/*"),t.enableRule("common/punctuation/quote"),t.disableRule("ru/dash/kakto"),t.disableRule("ru/dash/taki"),t.disableRule("ru/dash/izpod"),t.disableRule("ru/dash/izza"),t.disableRule("ru/dash/ka"),t.disableRule("ru/dash/to"),t.disableRule("ru/dash/koe"),t.disableRule("common/nbsp/nowrap"),t.disableRule("common/nbsp/dpi"),t.disableRule("common/nbsp/afterParagraphMark"),t.enableRule("common/nbsp/afterNumber"),t.disableRule("common/html/quot"),t.disableRule("ru/date/*"),t.disableRule("common/number/mathSigns"),t.disableRule("ru/number/ordinals"),t.disableRule("ru/number/comma"),t.disableRule("ru/symbols/NN"),t.disableRule("common/symbols/cf"),t.disableRule("ru/other/phone-number"),t.addSafeTag('<span[^>]*?class="preheader"[^>]*?>',"</span>"),t.addSafeTag("<!--","-->"),e.data.action==="typograf_all"&&(i=document.body),i.innerHTML=t.execute(i.innerHTML),S()}}if(e.data.operation==="sandbox_window-characteristic"&&(o.state.set("iframeOffsetTop",e.data.settings.iframeOffsetTop),o.state.set("scrollTop",e.data.settings.scrollTop),e.data.settings.windowHeight,o.state.set("previewHeight",e.data.settings.previewHeight),o.state.set("applicationMode",e.data.settings.mode),document.querySelector(".em-element-path")&&(document.querySelector(".em-element-path").style.top=o.state.get("previewHeight")-o.state.get("iframeOffsetTop")-65+o.state.get("scrollTop")+"px")),e.data.operation==="sandbox_iframe-setsize"&&o.state.get("globalHolder").querySelector("table:first-child").getAttribute("width").indexOf("%")===-1&&parseFloat(o.state.get("globalHolder").querySelector("table:first-child").style.minWidth)===parseFloat(o.state.get("globalHolder").querySelector("table:first-child").getAttribute("width"))){document.documentElement.style.transition="all 0.2s",document.documentElement.style.overflowX="visible",document.documentElement.style.height="100%",document.documentElement.style.transformOrigin="left top";let i=e.data.settings.iframeWidth/parseFloat(o.state.get("globalHolder").querySelector("table:first-child").getAttribute("width"));document.documentElement.style.transform="scale("+(i<1?i:1)+")"}if(e.data.operation==="sandbox_atom-insert")try{if(o.state.increment("activeElementLocked"),Ae=null,document.body.classList.add("em-atom-insert-body"),e.data.action==="insert"){Ae=null;let i=e.data.settings.atomHTML,t=null;document.querySelector('[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width]):empty')?t=document.querySelector('[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width]):empty'):document.querySelector('[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width])')?t=document.querySelector('[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width])'):document.querySelector('[em="block"].em-structure td[em-edit="active"]:not([height]):not([width]):empty')?t=document.querySelector('[em="block"].em-structure td[em-edit="active"]:not([height]):not([width]):empty'):document.querySelector('[em="block"].em-structure td[em-edit="active"]:not([height]):not([width])')?t=document.querySelector('[em="block"].em-structure td[em-edit="active"]:not([height]):not([width])'):document.querySelector('[em="block"].em-structure td.em-mob-wrap[em-edit="active"]')&&(t=document.querySelector('[em="block"].em-structure td.em-mob-wrap[em-edit="active"]')),t&&(i.match(/em="atom"><img/gi)&&(i=o.setImageWidth({atomHTML:i,targetAtom:t})),t.querySelector('[em="atom"]')?i.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:t.querySelector('[em="atom"]:last-child'),targetPlace:"afterend",atomHTML:i},S):t.querySelector('[em="atom"]:last-child')?.insertAdjacentHTML("afterend",i):i.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:t,targetPlace:"beforeend",atomHTML:i},S):t.insertAdjacentHTML("beforeend",i)),document.body.classList.remove("em-atom-insert-body")}S()}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}if(e.data.operation==="sandbox_block-insert")try{if(o.state.increment("activeElementLocked"),document.body.classList.add("em-block-insert-body"),e.data.action==="insert"){const i=document.querySelector('body>[em="block-contaner"]')||document.head;let t=e.data;const l=o.parseFromString(t.settings.blockHTML);let n=l.filter(r=>r.tagName&&r.tagName!=="LINK"&&r.tagName!=="STYLE").map(r=>o.getOuterHtml(r)).join(""),s=l.filter(r=>r.tagName==="STYLE").map(r=>o.getOuterHtml(r)).join(""),d=l.filter(r=>r.tagName==="LINK"&&r.getAttribute("em-class")).filter(r=>!i?.querySelector(`link[em-class="${r.getAttribute("em-class")}"]`));if(s){let r=i.querySelector('style[em="styles"]'),b="";r?b=C.getInnerHtml(r):(r=document.createElement("style"),r.setAttribute("em","styles"),r=i.insertAdjacentElement("beforeend",r));let p=document.createElement("div");p.insertAdjacentHTML("afterbegin",s);let y=o.minifyStylesheet(b+`
|
|
24
|
-
`+[...p.querySelectorAll("style")].map(f=>f.innerHTML).join(`
|
|
25
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;y=cssbeautify(y,{indent:" ",autosemicolon:!0}),r.textContent=`
|
|
26
|
-
`+y+`
|
|
27
|
-
`}for(const r of d.reverse())i?.prepend(r),i?.insertAdjacentHTML("afterbegin",`
|
|
28
|
-
`);let m=null,a=null;if(document.querySelector("table:empty")?(m=document.querySelector("table:empty"),a=m,n.substring(0,3)==="<tr"?m.insertAdjacentHTML("beforeend",n):m.insertAdjacentHTML("beforeend",'<tr><td align="center">'+n+"</td></tr>")):document.querySelector('[em="group"]:last-child [em="block"]')&&(m=document.querySelector('[em="group"]:last-child [em="block"]:last-child'),m.tagName==="TR"?n.substring(0,3)==="<tr"?m.insertAdjacentHTML("afterend",n):m.insertAdjacentHTML("afterend",'<tr em="block"><td align="center">'+n+"</td></tr>"):m.insertAdjacentHTML("afterend",n),a=m.nextSibling),document.documentElement.scrollHeight+o.state.get("iframeOffsetTop")>o.state.get("previewHeight")){let r={operation:"application_scroll-to",settings:{value:a.getBoundingClientRect().top+a.getBoundingClientRect().height}};o.messageService.send(r)}}S()}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}if(e.data.operation==="sandbox_drag-cancel"&&o.handleDragCancel(e,j()),e.data.operation==="sandbox_lock_edit"&&(e.data.data?document.body.classList.add("mceNonEditable"):document.body.classList.remove("mceNonEditable"),o.state.set("lockEdit",!!e.data.data)),e.data.operation==="sandbox_lock_discuss"&&o.handleLockDiscuss(e,j()),e.data.operation==="sandbox_discuss_set_target"&&o.handleDiscussSetTarget(e,j()),e.data.operation==="sandbox_discuss_remove_target"&&o.handleDiscussRemoveTarget(e,j()),e.data.operation==="sandbox_discuss_reset"&&o.handleDiscussReset(e,j()),e.data.operation==="sandbox_discuss_get_target"&&o.handleDiscussGetTarget(e,j()),e.data.operation==="sandbox_email_content_get"){let i={operation:"application_email_content_get",htmlCode:o.serializeOuterHtml(document.body)};o.messageService.send(i)}});var Y=null;function X(e,i){V.whenEditorLostFocus(()=>pt(e,i),"editor")}document.addEventListener("click",e=>{}),document.addEventListener("keyup",e=>{});var pt=o.createWrapEditor({removeHiddenClasses:Ye,checkIsInited:o.checkIsEditorInited,prepareEditorHTML:e=>o.prepareEditorHTML(e,o.parseFromString),getVisibleText:o.getVisibleText,defaultVisibleTextMapFn:o.defaultVisibleTextMapFn,getTagNameForContainer:o.getTagNameForContainer,applyAttributesToTag:(e,i,t)=>o.applyAttributesToTag(e,i,t,o.rgbToHex),setCursorToElement:o.setCursorToElement,removeLastWord:o.removeLastWord,hasOnlyTextNodesDeep:o.hasOnlyTextNodesDeep,isRangeCoveringAllVisibleText:o.isRangeCoveringAllVisibleText,isEditorContentOnlyNbsp:o.isEditorContentOnlyNbsp,isClickAtEndOfEmReplace:o.isClickAtEndOfEmReplace,getOrCreateAfterSpan:o.getOrCreateAfterSpan,setCursorInsideSpan:o.setCursorInsideSpan,commit:S,createBeforeInputHandler:o.createBeforeInputHandler});document.onmouseover=function(e){let i=e.target;try{if(o.state.increment("activeElementLocked"),document.body.classList.contains("mceNonEditable")&&!document.body.classList.contains("em-sandbox-discuss")||o.isDiscussViewMode())return!1;if(o.isDiscussSetTargetMode())return document.querySelectorAll('[em-hover="true"]').forEach(function(l){l.removeAttribute("em-hover")}),i.closest(".em-element-vindent")||i.setAttribute("em-hover","true"),!1;if(i&&i.getAttribute("contenteditable")!=="false"&&i.parentElement?.getAttribute("contenteditable")!=="false"&&i.tagName!=="BODY"&&!i.closest(".em-tiny-editor")&&!i.closest("editor")&&!o.state.get("lockEditorInit")&&i.tagName!=="IMG"&&!(i.childElementCount===1&&i.firstElementChild.tagName==="IMG"&&i.textContent.trim()==="")){let l=i;do if(l=l.closest("div, p, h1, h2, h3, h4, h5, span, b, strong, i, em, s, a"),l)if(z.isVisible(l))l=l.parentElement;else break;while(l);if(i.tagName==="LI"&&i.style.fontFamily&&i.style.fontSize)X(i.closest("ul, ol"),!0);else if(i.tagName==="TD"&&i.style.fontFamily&&i.style.fontSize&&!i.querySelector("editor"))X(i);else if(l&&l.style.fontFamily&&l.style.fontSize)i.tagName==="LI"?X(i.closest("ul, ol"),!0):X(i,!0);else if(l&&l.closest('[style*="font-family"][style*="font-size"]')&&l.closest('[style*="font-family"][style*="font-size"]').tagName!=="BODY"&&l.closest('[style*="font-family"][style*="font-size"]').tagName!=="TD"&&l.closest('[style*="font-family"][style*="font-size"]').tagName!=="TABLE")X(l.closest('[style*="font-family"][style*="font-size"]'),!0);else for(var t=0;t<i.childNodes.length;t++)if(i.childNodes[t].nodeName==="#text"&&i.childNodes[t].textContent.trim().length>0&&!i.querySelector("table")){X(i);break}}ft(i),(o.state.get("loadStylesTimer")&&i.tagName==="TD"&&i.innerHTML===""&&i.getAttribute("height")||i.tagName==="DIV"&&i.style.height&&i.style.fontSize||i.tagName==="IMG")&&kt(i)}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}V.whenEditorLostFocus(()=>ut(i),"paths")};function ft(e){if(!e.isConnected&&C.isInExternal(e))return;let i;(i=e.closest('[em="atom"]'))?(G(i),i.querySelector(".em-element-editor.of-atom")||ee(i.tagName==="TR"?i.querySelector("td"):i,"atom"),i.closest('[em="block"]').querySelector(".em-element-editor.of-block")||(document.querySelectorAll('[em="block"] > td > .em-element-editor').forEach(t=>{t.remove()}),document.querySelectorAll("[em-state]").forEach(t=>{t.removeAttribute("em-state")}),ee(i.closest('[em="block"]').tagName==="TR"?i.closest('[em="block"]').querySelector("td"):i.closest('[em="block"]'),"block"))):(i=e.closest('[em="block"]'))?(G(i),i.querySelector(".em-element-editor.of-block")||(ee(i.tagName==="TR"?i.querySelector("td"):i,"block"),Ne())):(i=e.closest('[em="group"]'))&&(G(i),i.querySelector(".em-element-editor.of-group")||(ee(i.tagName==="TR"?i.querySelector("td"):i,"group"),Ne())),e.closest(".em-element-path")||document.querySelectorAll('[em-hover="true"]').forEach(function(t){t.removeAttribute("em-hover")}),!e.closest(".em-editor-wrapper")&&!e.closest(".em-element-editor")&&!e.closest(".em-vindent")&&!e.closest(".em-element-resize-img")&&!e.closest(".em-element-img-change")&&!e.closest(".em-element-img-change-group")&&!e.closest(".em-element-path")&&e.tagName!=="IMG"?e.setAttribute("em-hover","true"):e.tagName==="IMG"&&e.parentElement.setAttribute("em-hover","true")}var Ve=null;function ut(e){!e.isConnected||!We||(!document.body?.classList.contains("mceNonEditable")&&Y&&!Y.closest(".em-element-path")&&e!==Y.closest('[style*="font-size"][style*="line-height"][style*="color"]')&&e!==Y.querySelector("editor")&&Y!==e.closest('[style*="font-size"][style*="line-height"][style*="color"]')&&(Ve=setTimeout(function(){try{if(o.state.increment("activeElementLocked"),document.querySelector(".em-element-path_img")&&document.querySelector(".em-element-path_img").classList.remove("em-element-path_img"),document.querySelector(".em-element-path")&&document.querySelectorAll(".em-element-path").length>0&&!e.closest(".em-element-path")&&document.querySelector(".em-element-path").remove(),document.querySelector(".em-relative")&&document.querySelectorAll(".em-element-path").length>0&&!e.closest(".em-element-path")&&document.querySelector(".em-relative").classList.remove("em-relative"),document.querySelector(".em-display-block")&&!e.closest(".em-element-path")&&document.querySelector(".em-display-block").classList.remove("em-display-block"),(e.tagName==="IMG"||e.innerHTML!==""||e.closest(".em-vindent"))&&!e.closest(".em-element-path")&&!e.closest(".em-editor-wrapper")&&!e.closest(".em-element-resize-img")&&!e.closest(".em-element-img-change")&&!e.closest(".em-element-img-change-group")&&!e.closest(".em-element-editor")){let i=e;if(i.closest('[em="atom"]')&&!e.closest('[class*="em-vindent-padding"]'))i=i.closest('[em="atom"]'),i.classList.add("em-relative");else if(i.tagName==="EDITOR")i=i.closest("editor").parentElement,i.classList.add("em-relative");else if(i.style.fontSize&&i.style.lineHeight&&i.style.color)i.classList.add("em-relative");else if(i.tagName==="IMG"){i=i.closest(".em-element-resize-img-container")?i.closest(".em-element-resize-img-container"):i;const d=i.querySelector("img");!d?.style.width||d?.style.width==="100%"?(i.classList.add("em-relative"),d?.style.width==="100%"&&d?.style.maxWidth&&parseFloat(d?.style.maxWidth)>=i.parentElement.clientWidth&&i.classList.add("em-display-block")):i.classList.add("em-element-path_img")}else e.closest(".em-vindent")&&!document.querySelector(".em-narrow-table")?i=i.parentElement:e.closest('[class*="em-vindent-padding"]')?e=i.closest("td"):i.classList.add("em-relative");let t=o.addElement({targetElement:i.tagName==="TR"?i.querySelector(":scope > td:last-child"):i,insertType:"append",className:"em-element-path "+(e.getBoundingClientRect().top<35?"em-element-path_bottom":"")}),l=o.addElement({targetElement:t,insertType:"append",className:"em-element-path-panel"}),n=o.addElement({targetElement:l,insertType:"append",className:"em-element-path-content"}),s=yt(e);s.forEach(d=>{let m="",a="";switch(d.tagName){case"A":m=v.ELEMENT_PATH_LINK;break;case"IMG":m=v.ELEMENT_PATH_IMG;break;case"TD":d.parentElement.getAttribute("em")==="block"?(m=v.ELEMENT_PATH_BLOCK,a="em-element-path-item-block"):d.parentElement.getAttribute("em")==="atom"||d.closest("table").getAttribute("em")==="atom"?(m=v.ELEMENT_PATH_ATOM,a="em-element-path-item-atom"):d.parentElement.getAttribute("em")==="group"?(m=v.ELEMENT_PATH_GROUP,a="em-element-path-item-group"):d.classList.contains("em-vindent")?m=v.ELEMENT_PATH_VINDENT:d.classList.contains("em-mob-wrap")?m=v.ELEMENT_PATH_FLOATBLOCK:m=v.ELEMENT_PATH_TD;break;case"TABLE":d.getAttribute("em")==="block"?(m=v.ELEMENT_PATH_BLOCK,a="em-element-path-item-block"):d.getAttribute("em")==="atom"?(m=v.ELEMENT_PATH_ATOM,a="em-element-path-item-atom"):d.getAttribute("em")==="group"?(m=v.ELEMENT_PATH_GROUP,a="em-element-path-item-group"):d.parentElement.tagName==="BODY"?(m=v.ELEMENT_PATH_EMAIL,a="em-element-path-item-email"):m=v.ELEMENT_PATH_TABLE;break;case"SPAN":case"B":case"I":case"EM":case"STRONG":case"S":case"P":case"H1":case"H2":case"H3":case"H4":case"H5":case"DIV":d.style.display==="inline-block"?m=v.ELEMENT_PATH_FLOATBLOCK:d.style.fontFamily&&d.style.fontSize&&d.style.lineHeight&&d.style.color?m=v.ELEMENT_PATH_TEXT:d.getAttribute("em")==="block"?(m=v.ELEMENT_PATH_BLOCK,a="em-element-path-item-block"):d.getAttribute("em")==="atom"?(m=v.ELEMENT_PATH_ATOM,a="em-element-path-item-atom"):d.getAttribute("em")==="group"?(m=v.ELEMENT_PATH_GROUP,a="em-element-path-item-group"):d.classList.contains("em-vindent")?m=v.ELEMENT_PATH_VINDENT:m=v.ELEMENT_PATH_DIV}d.getAttribute("style")&&(a+=" em-element-path-item-style"),d.className.indexOf("em-mob-")>-1&&(a+=" em-element-path-item-mob"),o.addElement({targetElement:n,insertType:"append",HTMLcontent:m,className:a})}),n.querySelector("div:last-child")&&(l.style.maxWidth=n.querySelector("div:last-child").getBoundingClientRect().width+"px"),!i.classList.contains("em-element-path_img")&&i.getBoundingClientRect().left+i.getBoundingClientRect().width>document.documentElement.clientWidth/2&&t.classList.add("em-element-path_right"),t.addEventListener("mouseover",function(){t.getBoundingClientRect().right>document.documentElement.clientWidth?(t.style.maxWidth=document.documentElement.clientWidth-t.getBoundingClientRect().left-20+"px",l.classList.add("em-element-path-overflow-left")):t.getBoundingClientRect().left<0&&(t.style.maxWidth=t.getBoundingClientRect().right-20+"px",l.classList.add("em-element-path-overflow-left"));let d=0;n.querySelectorAll("div").forEach(m=>{d+=m.getBoundingClientRect().width}),l.style.maxWidth=d+"px"}),t.addEventListener("mouseout",function(){l.style.maxWidth=n.querySelector("div:last-child").getBoundingClientRect().width+"px",l.classList.remove("em-element-path-overflow-left")}),n.querySelectorAll("div").forEach(d=>{d.addEventListener("click",function(m){const a=s[Array.from(m.target.parentElement.children).indexOf(d)];w({elem:a}),N(a)})})}}catch{}finally{Promise.resolve().then(()=>o.state.decrement("activeElementLocked"))}},500),e.addEventListener("mouseout",function(){clearTimeout(Ve)})),Y=e)}document.onmouseleave=function(){G(),document.querySelectorAll('[em="group"] .em-element-editor, .em-element-path, .em-element-block-add').forEach(e=>e.remove())},document.onclick=function(e){if(document.body&&!document.body.classList.contains("mceNonEditable")&&(e.stopPropagation(),e.preventDefault()),je(!1),document.documentElement.classList.contains("em-resize-start")||e.target.classList.contains("em-element-editor-widget")||e.target.classList.contains("em-element-block-add"))return!1;let i=e.target;const t=i.closest("a");if(t instanceof HTMLAnchorElement&&t.target!=="_blank"&&(t.href&&window.open(t.href),e.stopPropagation(),e.preventDefault()),i=="HTML"||i.classList.contains(o.ICON_ROLE.drag)||i.classList.contains("em-element-editor"))return!1;if(document.body?.classList.contains("mceNonEditable")&&!document.body.classList.contains("em-sandbox-discuss")&&i.tagName!=="A"&&!i.closest("a")&&i.tagName!=="IMG")return N(i),!1;if(o.isDiscussViewMode())return o.handleDiscussViewClick(i),!1;if(o.isDiscussSetTargetMode())return o.handleDiscussSetTargetClick(i,{makeId:o.makeId,commit:S}),!1;i instanceof Element&&i.tagName==="EDITOR"&&(i=i.parentElement);let l=i.closest('[em="atom"]');if(l&&i.closest(".em-element-editor-widget-remove")){let d=l.parentElement;return l.remove(),d.innerHTML.trim()===""&&(d.innerHTML=""),S(),l.querySelector("[em-edit]")&&o.messageService.send({operation:"application_element_settings_close"}),!1}if(l&&i.closest(".em-element-editor-widget-edit"))return w({elem:l}),N(l),!1;if(l&&i.closest(".em-element-editor-widget-clone"))return o.handleCloneAtom(l,I()),!1;let n=i.closest('[em="block"]');if(n&&i.classList.contains(o.ICON_ROLE.moveUp))return o.handleMoveBlockUp(n,I()),!1;if(n&&i.classList.contains(o.ICON_ROLE.moveDown))return o.handleMoveBlockDown(n,I()),!1;if(n&&i.closest(".em-element-editor-widget-edit"))return w({elem:n.querySelector("td")}),N(n),!1;if(n&&i.closest(".em-element-editor-widget-remove"))return o.handleRemoveBlock(n,I()),!1;if(n&&i.closest(".em-element-editor-widget-add-block"))return o.addBlockToProject(i,{HTMLDocument:C,messageService:o.messageService}),!1;if(n&&i.closest(".em-element-editor-widget-clone"))return o.handleCloneBlock(n,I()),!1;if(n&&o.isAddBlockMenuClick(i))return o.handleAddBlockMenu(n,i,mt()),!1;if(n&&i.closest(".em-element-editor-widget-copy")){i.parentNode.style.backgroundColor="rgba(0,255,0,0.3)";let d=C.getOuterHtml(n);return navigator.clipboard.writeText(d),setTimeout(function(){i.parentNode.style.removeProperty("background-color")},2e3),!1}if(n&&i.closest(".em-element-editor-widget-paste"))return navigator.clipboard.readText().then(d=>{if(n.tagName=="TR"){let m=document.createElement("table");m.insertAdjacentHTML("afterbegin",d),m.querySelector('[em="block"]')?(m.querySelector(".em-element-editor")?.remove(),n.removeAttribute("em-state"),n.after(m.querySelector("tbody > tr")),S(),N(n)):(i.parentNode.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(function(){i.parentNode.style.removeProperty("background-color")},2e3))}else{let m=document.createElement("div");m.insertAdjacentHTML("afterbegin",d),m.querySelector('[em="block"]')?(m.querySelector(".em-element-editor")?.remove(),n.removeAttribute("em-state"),n.after(m.querySelector('[em="block"]')),S(),N(n)):(i.parentNode.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(function(){i.parentNode.style.removeProperty("background-color")},2e3))}}).catch(d=>{}),!1;if(n&&i.classList.contains(o.ICON_ROLE.merge))return o.handleMergeBlocks(n,I()),!1;let s=i.closest('[em="group"]');if(s&&i.classList.contains(o.ICON_ROLE.moveUp))return o.handleMoveGroupUp(s,I()),!1;if(s&&i.classList.contains(o.ICON_ROLE.moveDown))return o.handleMoveGroupDown(s,I()),!1;if(s&&i.classList.contains(o.ICON_ROLE.add))return o.handleAddGroup(s,I()),!1;if(s&&i.closest(".em-element-editor-widget-edit"))return N(s),w({elem:s.tagName!="TR"?s:s.querySelector("td")}),!1;if(s&&i.closest(".em-element-editor-widget-clone"))return o.handleCloneGroup(s,I()),!1;if(s&&i.closest(".em-element-editor-widget-remove")&&i.closest(".of-group"))return o.handleRemoveGroup(s,I()),!1;if(!i.closest(".em-editor-wrapper")&&!i.closest(".em-element-path")&&!i.closest(".em-element-vindent-remove")){N(i),w({elem:i});let d=document.querySelector(".em-editor-wrapper");d&&(d.style.display="none"),Ne()}},document.addEventListener("mouseup",()=>{}),window.addEventListener("scroll",function(){o.stickyCheck(ce)}),window.addEventListener("mousemove",function(){o.state.set("lockEditorInit",!1)}),document.addEventListener("keydown",function(e){o.handleSaveHotkey(e,ge()),o.handleUndoRedoHotkey(e,ge()),o.handleToggleEditorHotkey(e,ge());const i=dt();o.handleDeleteKey(e,o.getListContext(e.target).isList,i?o.getCursorPositionType(i):null,rt()),o.handleEscapeKey(e,ge())},!1);function Ye(e){e.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-block-insert_bottom").forEach(i=>{i.classList.remove("em-block-insert_bottom")}),e.querySelectorAll(".em-block-insert_top").forEach(i=>{i.classList.remove("em-block-insert_top")}),e.querySelectorAll(".em-blockatom-insert").forEach(i=>{i.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),e.querySelectorAll(".em-block-insert-empty").forEach(i=>i.classList.remove("em-block-insert-empty")),e.querySelectorAll(".em-atom-insert-empty").forEach(i=>i.classList.remove("em-atom-insert-empty")),e.querySelectorAll(".em-block-insert-body").forEach(i=>i.classList.remove("em-block-insert-body")),e.querySelectorAll(".em-atom-insert-body").forEach(i=>i.classList.remove("em-atom-insert-body")),e.querySelectorAll(".em-resize-start").forEach(i=>i.classList.remove("em-resize-start")),e.querySelectorAll(".sortable-chosen").forEach(i=>i.classList.remove("sortable-chosen")),e.querySelectorAll(".sortable-ghost").forEach(i=>i.classList.remove("sortable-ghost")),e.querySelectorAll(".em-vindent-table").forEach(i=>i.classList.remove("em-vindent-table")),e.querySelectorAll(".em-vindent_low").forEach(i=>i.classList.remove("em-vindent_low")),e.querySelectorAll(".em-vindent").forEach(i=>i.classList.remove("em-vindent")),e.querySelectorAll(".em-relative").forEach(i=>i.classList.remove("em-relative")),e.querySelectorAll(".em-display-block").forEach(i=>i.classList.remove("em-display-block")),e.querySelectorAll(".em-sandbox-discuss_set-target").forEach(i=>i.classList.remove("em-sandbox-discuss_set-target")),e.querySelectorAll(".em-sandbox-discuss").forEach(i=>i.classList.remove("em-sandbox-discuss"));for(const i of e.querySelectorAll("[class='']"))i.removeAttribute("class");o.removeBySelector(e,"[data-mce-caret=before]",!0),o.removeBySelector(e,"span.em-element-resize-img-container"),o.removeBySelector(e,"span.em-element-img-change"),o.removeBySelector(e,".em-element-img-change-group"),o.removeBySelector(e,"[class*=mce-]"),o.removeBySelector(e,"meta[http-equiv=Content-Security-Policy]",!0),o.removeBySelector(e,".em-editor-wrapper",!0),o.removeBySelector(e,"div.iframe-resizer-inner")}function ht(){if(document.querySelector("[em=atoms]")){let e=document.querySelector("[em=atoms]");for(let i of e.children)i.setAttribute("em","atom");e.removeAttribute("em")}document.documentElement.style.height&&document.documentElement.style.removeProperty("height"),document.body.style.height&&document.body.style.removeProperty("height")}function ee(e,i){if(i==="atom"){e.setAttribute("em-state","active"),e.offsetLeft<50&&e.setAttribute("em-state","active-inside");let t=o.addElement({targetElement:e,insertType:"append",className:"em-element-editor",width:26,height:e.offsetHeight});t.classList.add("of-atom"),document.body.getBoundingClientRect().height>70&&e.getBoundingClientRect().top+70>document.body.getBoundingClientRect().height&&t.classList.add("out-of-iframe");let l=o.addElement({targetElement:t,insertType:"append",className:"em-element-editor-widget"});o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:o.icon(o.braille_solid_default,`${o.ICON_SIZE} ${o.ICON_ROLE.drag}`),title:v.REORDER_ATOM}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:o.icon(o.pen_solid_default,`${o.ICON_SIZE} em-analytics__atoms-panel-edit`),title:v.EDIT_ATOM}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:o.icon(ke,`${o.ICON_SIZE} em-analytics__atoms-panel-clone`),title:v.CLONE_ATOM}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:o.icon(o.trash_alt_solid_default,`${o.ICON_SIZE} em-analytics__atoms-panel-remove`),title:v.REMOVE_ATOM}),o.stickyCheck(ce)}if(i==="block"){e.setAttribute("em-state","active");let t=o.addElement({targetElement:e,insertType:"append",className:"em-element-editor"});t.classList.add("of-block"),e.offsetLeft<35&&e.setAttribute("em-state","active-inside"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&t.classList.add("out-of-iframe");let l=o.addElement({targetElement:t,insertType:"append",className:"em-element-editor-widget"}),n=o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-group"});o.addElement({targetElement:n,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:o.icon(o.braille_solid_default,`${o.ICON_SIZE} ${o.ICON_ROLE.drag}`),title:v.REORDER_BLOCK}),o.addElement({targetElement:n,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]').previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:o.icon(o.arrow_up_solid_default,`${o.ICON_SIZE} ${o.ICON_ROLE.moveUp}`),title:v.REORDER_BLOCK_UP}),o.addElement({targetElement:n,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]').nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:o.icon(o.arrow_down_solid_default,`${o.ICON_SIZE} ${o.ICON_ROLE.moveDown}`),title:v.REORDER_BLOCK_DOWN}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:o.icon(o.pen_solid_default,`${o.ICON_SIZE} em-analytics__blocks-panel-edit`),title:v.EDIT_BLOCK});let s=o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-group"});o.addElement({targetElement:s,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:o.icon(ke,`${o.ICON_SIZE} em-analytics__blocks-panel-clone`),title:v.CLONE_BLOCK}),o.addElement({targetElement:s,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:o.icon(o.copy_solid_default,`${o.ICON_SIZE} em-analytics__blocks-panel-copy`),title:v.COPY_BLOCK_TO_CLIPBOARD}),o.addElement({targetElement:s,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:o.icon(nt,`${o.ICON_SIZE} em-analytics__blocks-panel-paste`),title:v.PASTE_BLOCK_FROM_CLIPBOARD}),document.querySelector(".em-narrow-table")&&(document.querySelector('[em="block"][em-edit="active"]')&&document.querySelector('[em="block"][em-edit="active"]')!==l.closest('[em-edit="active"]')||document.querySelector('[em="block"] > [em-edit="active"]')&&document.querySelector('[em="block"] > [em-edit="active"]')!==l.closest('[em-edit="active"]'))&&o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:o.icon(o.object_group_solid_default,`${o.ICON_SIZE} ${o.ICON_ROLE.merge} em-analytics__blocks-panel-merge`),title:v.MERGE_BLOCK}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:o.icon(o.save_solid_default,`${o.ICON_SIZE} em-analytics__blocks-panel-save`),title:v.SAVE_TO_BLOCKS}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:o.icon(o.trash_alt_solid_default,`${o.ICON_SIZE} em-analytics__blocks-panel-remove`),title:v.REMOVE_BLOCK}),o.stickyCheck(ce),e.closest('[em="block"]').onmouseleave=function(){G()}}if(i==="group"){e.tagName==="TR"?e.querySelector("td").setAttribute("em-state","active"):e.setAttribute("em-state","active");let t=o.addElement({targetElement:e,insertType:"append",className:"em-element-editor"});t.classList.add("of-group"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&t.classList.add("out-of-iframe");let l=o.addElement({targetElement:t,insertType:"append",className:"em-element-editor-widget"});o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:o.icon(o.braille_solid_default,`${o.ICON_SIZE} ${o.ICON_ROLE.drag}`),title:v.REORDER_GROUP}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:o.icon(o.plus_solid_default,`${o.ICON_SIZE} ${o.ICON_ROLE.add} em-analytics__groups-panel-add`),title:v.ADD_GROUP}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:o.icon(o.pen_solid_default,`${o.ICON_SIZE} em-analytics__groups-panel-edit`),title:v.EDIT_GROUP}),o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:o.icon(ke,`${o.ICON_SIZE} em-analytics__groups-panel-clone`),title:v.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&o.addElement({targetElement:l,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:o.icon(o.trash_alt_solid_default,`${o.ICON_SIZE} em-analytics__groups-panel-remove`),title:v.REMOVE_GROUP}),o.stickyCheck(ce)}}function G(e){e&&e.getAttribute("em")==="atom"?(document.querySelectorAll('[em="atom"] .em-element-editor').forEach(i=>{i.closest('[em="atom"]')!==e&&i.remove()}),document.querySelectorAll('[em="atom"][em-state], [em="atom"] [em-state]').forEach(i=>{i.closest('[em="atom"]')!==e&&i.removeAttribute("em-state")})):e&&e.getAttribute("em")==="block"?(document.querySelectorAll('[em="block"] .em-element-editor').forEach(i=>{i.closest('[em="block"]')!==e&&i.remove()}),document.querySelectorAll('[em="atom"] .em-element-editor').forEach(i=>{i.remove()}),document.querySelectorAll("[em-state]").forEach(i=>{(i.closest('[em="block"]')!==e||i.closest('[em="atom"]'))&&i.removeAttribute("em-state")})):(e&&e.getAttribute("em")==="group"||e===void 0)&&(document.querySelectorAll('[em="block"] .em-element-editor').forEach(i=>{i.remove()}),document.querySelectorAll('[em="atom"] .em-element-editor').forEach(i=>{i.remove()}),document.querySelectorAll('[em="group"] .em-element-editor').forEach(i=>{i.closest('[em="group"]')!==e&&i.remove()}),document.querySelectorAll("[em-state]").forEach(i=>{(i.closest('[em="group"]')!==e||i.closest('[em="block"]')||i.closest('[em="atom"]'))&&i.removeAttribute("em-state")})),document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")),document.querySelectorAll(".em-block-insert-empty").forEach(i=>i.classList.remove("em-block-insert-empty")),document.querySelectorAll('[em-hover="true"]').forEach(i=>i.removeAttribute("em-hover"))}function pe(e){return e.parentNode.tagName==="A"||e.parentNode.tagName==="TD"||e.parentNode.tagName==="TABLE"&&e.parentNode.parentNode.style.display!=="inline-block"&&!e.closest(".em-narrow-table")&&e.parentNode.getAttribute("em")!=="atom"||e.parentNode.tagName==="DIV"&&(e.parentNode.style.display==="inline-block"||e.parentNode.style.display==="table-cell")&&e.parentNode.style.verticalAlign||e.parentNode&&e.parentNode.tagName==="DIV"&&(e.parentNode.style.width||e.parentNode.style.minWidth||e.parentNode.style.maxWidth||e.parentNode.style.background||e.parentNode.style.backgroundColor||e.parentNode.style.backgroundPositionX||e.parentNode.style.backgroundPositionY||e.parentNode.style.backgroundImage||e.parentNode.style.backgroundRepeat||e.parentNode.style.height||e.parentNode.style.padding||e.parentNode.style.paddingTop||e.parentNode.style.paddingRight||e.parentNode.style.paddingBottom||e.parentNode.style.paddingLeft||e.parentNode.style.border||e.parentNode.style.borderBottom||e.parentNode.style.borderBottomWidth||e.parentNode.style.borderBottomStyle||e.parentNode.style.borderBottomColor||e.parentNode.style.borderLeft||e.parentNode.style.borderLeftWidth||e.parentNode.style.borderLeftStyle||e.parentNode.style.borderLeftColor||e.parentNode.style.borderTop||e.parentNode.style.borderTopWidth||e.parentNode.style.borderTopStyle||e.parentNode.style.borderTopColor||e.parentNode.style.borderRight||e.parentNode.style.borderRightWidth||e.parentNode.style.borderRightStyle||e.parentNode.style.borderRightColor||e.parentNode.style.borderRadius||e.parentNode.style.borderTopLeftRadius||e.parentNode.style.borderTopRightRadius||e.parentNode.style.borderBottomLeftRadius||e.parentNode.style.borderBottomRightRadius||e.parentNode.style.boxShadow||e.parentNode.style.textAlign||e.parentNode.style.align||e.parentNode.style.verticalAlign)?e.parentNode:e.parentNode?pe(e.parentNode):!1}function yt(e){let i=[];for((e.tagName==="IMG"||e.tagName==="TD"||e.tagName!=="EDITOR"&&e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight&&e.style.color||e.tagName==="DIV"&&e.style.height&&e.style.lineHeight)&&i.push(e);e.parentElement&&e.parentElement.tagName!=="BODY";)e=e.parentElement,(e.tagName==="A"||e.tagName==="TD"&&!e.closest(".em-narrow-table")||e.tagName==="TABLE"&&e.parentElement.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(".em-narrow-table")&&e.getAttribute("em")!=="atom"||e.tagName==="DIV"&&(e.style.display==="inline-block"||e.style.display==="table-cell")&&e.style.verticalAlign||e.tagName==="DIV"&&(e.style.width||e.style.minWidth||e.style.maxWidth||e.style.background||e.style.backgroundColor||e.style.backgroundPositionX||e.style.backgroundPositionY||e.style.backgroundImage||e.style.backgroundRepeat||e.style.height||e.style.padding||e.style.paddingTop||e.style.paddingRight||e.style.paddingBottom||e.style.paddingLeft||e.style.border||e.style.borderBottom||e.style.borderBottomWidth||e.style.borderBottomStyle||e.style.borderBottomColor||e.style.borderLeft||e.style.borderLeftWidth||e.style.borderLeftStyle||e.style.borderLeftColor||e.style.borderTop||e.style.borderTopWidth||e.style.borderTopStyle||e.style.borderTopColor||e.style.borderRight||e.style.borderRightWidth||e.style.borderRightStyle||e.style.borderRightColor||e.style.borderRadius||e.style.borderTopLeftRadius||e.style.borderTopRightRadius||e.style.borderBottomLeftRadius||e.style.borderBottomRightRadius||e.style.boxShadow||e.style.textAlign||e.style.align||e.style.verticalAlign)||e.tagName!=="EDITOR"&&e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight&&e.style.color||e.tagName==="TD"&&e.closest("table").getAttribute("em")==="atom"||e.tagName==="TD"&&e.closest("tr").getAttribute("em")==="block")&&i.push(e);return i=i.reverse(),i}function Xe(e){return e.parentNode&&e.parentNode.tagName==="A"?v.LINK:e.parentNode&&e.parentNode.tagName==="TD"?v.TABLE_COLUMN:e.parentNode&&e.parentNode.tagName==="TABLE"&&!(e.parentNode.parentNode.tagName==="DIV"&&e.parentNode.parentNode.style.display==="inline-block")?v.TABLE:e.parentNode&&e.parentNode.tagName==="DIV"&&(e.parentNode.style.display==="inline-block"||e.parentNode.style.display==="table-cell")&&e.parentNode.style.verticalAlign?v.FLOAT_BLOCK:e.parentNode&&e.parentNode.tagName==="DIV"&&(e.parentNode.style.width||e.parentNode.style.minWidth||e.parentNode.style.maxWidth||e.parentNode.style.background||e.parentNode.style.backgroundColor||e.parentNode.style.backgroundPositionX||e.parentNode.style.backgroundPositionY||e.parentNode.style.backgroundImage||e.parentNode.style.backgroundRepeat||e.parentNode.style.height||e.parentNode.style.padding||e.parentNode.style.paddingTop||e.parentNode.style.paddingRight||e.parentNode.style.paddingBottom||e.parentNode.style.paddingLeft||e.parentNode.style.border||e.parentNode.style.borderBottom||e.parentNode.style.borderBottomWidth||e.parentNode.style.borderBottomStyle||e.parentNode.style.borderBottomColor||e.parentNode.style.borderLeft||e.parentNode.style.borderLeftWidth||e.parentNode.style.borderLeftStyle||e.parentNode.style.borderLeftColor||e.parentNode.style.borderTop||e.parentNode.style.borderTopWidth||e.parentNode.style.borderTopStyle||e.parentNode.style.borderTopColor||e.parentNode.style.borderRight||e.parentNode.style.borderRightWidth||e.parentNode.style.borderRightStyle||e.parentNode.style.borderRightColor||e.parentNode.style.borderRadius||e.parentNode.style.borderTopLeftRadius||e.parentNode.style.borderTopRightRadius||e.parentNode.style.borderBottomLeftRadius||e.parentNode.style.borderBottomRightRadius||e.parentNode.style.boxShadow||e.parentNode.style.textAlign||e.parentNode.style.align||e.parentNode.style.verticalAlign)?v.CONTAINER:e.parentNode?Xe(e.parentNode):void 0}function w(e){if(o.state.isActiveElementLocked())return;let i=document.querySelector("[em-edit]");i&&i.removeAttribute("em-edit");let t={};if(e.elem){let d=function(a){let r=[];const b=a.style.fontFamily||getComputedStyle(s)["font-family"];if([...a.classList].filter(p=>p.startsWith("em-font-")).length>0){r=["Google Fonts"],r[1]=b.indexOf("sans-serif")>-1?"Sans Serif":"Serif",r[2]=[...a.classList].filter(y=>y.startsWith("em-font-"))[0].match(/em-font-(.*?)-/)[1];const p=new RegExp(`${r[2]}-(.*)`);r[3]=[...a.classList].filter(y=>y.startsWith("em-font-"))[0].match(p)[1]}else b&&(r=["Safe Fonts",b.replaceAll('"',"'")]);return r},m=function(a,r,b=null){const p=a.tagName.toLowerCase(),y=window.getSelection(),f=y.anchorNode?.parentElement||y.anchorNode,A=f?.tagName.toLowerCase(),H=f?.closest(r)||f?.closest(b);return p===r||p===b||A===r||A===b||!!H};var l=d,n=m;e.elem=o.getVariableByIcon(e.elem)||!z.getMappedParent(e.elem)?e.elem:z.getVisibleNode(e.elem);const s=e.elem.tagName==="EDITOR"?e.elem?.firstChild:e.elem;if(e.elem.closest(".em-vindent")&&(e.elem.closest('div[style*="height"][style*="line-height"]')?e.elem=e.elem.closest('div[style*="height"][style*="line-height"]'):e.elem=e.elem.closest("td")),(e.elem.closest(".em-element-resize-img")||e.elem.closest(".em-element-img-change")||e.elem.closest(".em-element-img-change-group"))&&(e.elem=e.elem.closest(".em-element-resize-img-container").querySelector("img")),e.elem.tagName!=="IMG"&&e.elem.closest("editor")&&e.elem.closest("a")&&!e.elem.parentElement.style.display&&!e.elem.closest("td[height]")&&(e.elem=e.elem.closest("a")),document.body.classList.contains("mceNonEditable")||(e.elem.setAttribute("em-edit","active"),[...e.elem.parentElement?.querySelectorAll("strike, s")||[]].forEach(a=>{a.style.textDecoration="line-through"}),[...e.elem.parentElement?.getElementsByTagName("u")||[]].forEach(a=>{a.style.textDecoration="underline"})),t={operation:"application_element_settings_set",settings:{}},e.elem.tagName==="IMG"){let a=e.elem.getAttribute("src").indexOf("<!--")>-1?e.elem.getAttribute("src").replace("<!--","").replace("-->",""):e.elem.getAttribute("src"),r=B({elem:e.elem}),b=B({elem:e.elem.closest("td")}),p=r.mobileWidth,y=r.mobileHeight;e.elem.classList.contains("em-countdown")?(t.type="countdown",t.caption=v.COUNTDOWN):e.elem.classList.contains("em-video")?(t.type="video",t.caption=v.VIDEO):(t.type="img",t.caption=v.PICTURE),t.settings={src:a??"",width:{value:e.elem.getAttribute("width")&&e.elem.getAttribute("width")!=="auto"?parseFloat(e.elem.getAttribute("width")):null,dim:e.elem.getAttribute("width")&&e.elem.getAttribute("width")!=="auto"&&e.elem.getAttribute("width").indexOf("%")>-1?"%":"px"},height:{value:e.elem.getAttribute("height")&&e.elem.getAttribute("height")!=="auto"?parseFloat(e.elem.getAttribute("height")):null,dim:e.elem.getAttribute("height")&&e.elem.getAttribute("height")!=="auto"&&e.elem.getAttribute("height").indexOf("%")>-1?"%":"px"},alt:e.elem.getAttribute("alt")??"",title:e.elem.getAttribute("title")??"",align:e.elem.closest("td")?e.elem.closest("td").getAttribute("align"):"undefined",valign:e.elem.style.verticalAlign??"undefined",border:o.getElementBorder(e.elem),borderRadius:o.getElementBorderRadius(e.elem),boxShadow:o.getElementBoxShadow(e.elem),mobileWidth:{value:p!==null?p:null,dim:r.mobileWidthDim},mobileHeight:{value:y!==null?y:null,dim:r.mobileHeightDim},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,mobileAlign:b.mobileAlign,mobileVerticalAlign:r.mobileVerticalAlign,show:r.show,link:e.elem.closest("a")?e.elem.closest("a").getAttribute("href"):null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width*10)/10,renderedHeight:Math.round(e.elem.getBoundingClientRect().height*10)/10},e.elem.classList.contains("em-countdown")&&(t.settings.countdown=e.elem.getAttribute("em-cd-settings")),e.elem.classList.contains("em-video")&&(t.settings.video=e.elem.getAttribute("em-video-settings")?JSON.parse(e.elem.getAttribute("em-video-settings").replaceAll("'",'"')):{})}else if(e.elem.tagName==="A"){if(e.elem.getAttribute("style")&&e.elem.getAttribute("style").indexOf("display")>-1&&e.elem.closest("td[height]")){let a=e.elem,r=e.elem.closest("td"),b=e.elem.closest("table"),p={all:null,top:null,right:null,bottom:null,left:null},y={all:null,top:null,right:null,bottom:null,left:null},f=B({elem:e.elem}),A=B({elem:e.elem.closest("td")}),H=B({elem:e.elem.closest("td").closest("table").closest("td")}),T=B({elem:e.elem.closest("table")}),x=T.mobileWidth,D=A.mobileHeight;(a.style.padding||a.style.paddingTop||a.style.paddingRight||a.style.paddingBottom||a.style.paddingLeft)&&(!a.style.padding||a.style.padding.indexOf(" ")>-1?p.all=null:!a.style.padding&&a.style.paddingTop&&a.style.paddingRight&&a.style.paddingBottom&&a.style.paddingLeft&&a.style.paddingTop===a.style.paddingRight===a.style.paddingBottom===a.style.paddingLeft?p.all=parseFloat(a.style.paddingTop):p.all=parseFloat(a.style.padding),p.top=a.style.paddingTop||a.style.paddingTop===0?parseFloat(a.style.paddingTop):null,p.right=a.style.paddingRight||a.style.paddingRight===0?parseFloat(a.style.paddingRight):null,p.bottom=a.style.paddingBottom||a.style.paddingBottom===0?parseFloat(a.style.paddingBottom):null,p.left=a.style.paddingLeft||a.style.paddingLeft===0?parseFloat(a.style.paddingLeft):null),(f.mobilePadding.all||f.mobilePadding.top||f.mobilePadding.right||f.mobilePadding.bottom||f.mobilePadding.left)&&(f.mobilePadding.all?!f.mobilePadding.all&&f.mobilePadding.top&&f.mobilePadding.right&&f.mobilePadding.bottom&&f.mobilePadding.left&&f.mobilePadding.top===f.mobilePadding.right===f.mobilePadding.bottom===f.mobilePadding.left?y.all=parseFloat(f.mobilePadding.top):y.all=parseFloat(f.mobilePadding.all):y.all=null,y.top=f.mobilePadding.top||f.mobilePadding.top===0?parseFloat(f.mobilePadding.top):f.mobilePadding.all?f.mobilePadding.all:null,y.right=f.mobilePadding.right||f.mobilePadding.right===0?parseFloat(f.mobilePadding.right):f.mobilePadding.all?f.mobilePadding.all:null,y.bottom=f.mobilePadding.bottom||f.mobilePadding.bottom===0?parseFloat(f.mobilePadding.bottom):f.mobilePadding.all?f.mobilePadding.all:null,y.left=f.mobilePadding.left||f.mobilePadding.left===0?parseFloat(f.mobilePadding.left):f.mobilePadding.all?f.mobilePadding.all:null),t.settings={fontFamily:d(s),fontSize:parseFloat(e.elem?.closest('[style*="font-size"]')?.style.fontSize),fontSizeDim:"px",lineHeight:o.getLineHeightInPixels$1(e.elem),lineHeightDim:"px",textStrong:m(e.elem,"strong","b")||o.isElementHasBold$1(e.elem),textItalic:m(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem?.style?.fontStyle==="italic",textStrikethrough:m(e.elem,"s","strike")||e.elem.style.textDecoration==="line-through",textUnderline:m(e.elem,"u")||e.elem.style.textDecoration==="underline"||!e.elem.style["text-decoration"]?.length&&e.elem.tagName==="A",textColor:o.rgbToHex(e.elem?.closest('[style*="color"]')?.style.color)||o.rgbToHex(getComputedStyle(e.elem).color),padding:p,borderRadius:o.getElementBorderRadius(r),backgroundColor:r.style.backgroundColor?o.rgbToHex(r.style.backgroundColor):r.getAttribute("bgcolor")?r.getAttribute("bgcolor"):"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:r.style.backgroundPositionX&&r.style.backgroundPositionX!=="initial"?r.style.backgroundPositionX:"",backgroundPositionY:r.style.backgroundPositionY&&r.style.backgroundPositionY!=="initial"?r.style.backgroundPositionY:"",backgroundRepeat:r.style.backgroundRepeat?r.style.backgroundRepeat:"repeat",width:{value:b.getAttribute("width")&&b.getAttribute("width")!=="auto"?parseFloat(b.getAttribute("width")):null,dim:b.getAttribute("width")&&b.getAttribute("width")!=="auto"&&b.getAttribute("width").indexOf("%")>-1?"%":"px"},height:{value:r.getAttribute("height")&&r.getAttribute("height")!=="auto"?parseFloat(r.getAttribute("height")):null,dim:r.getAttribute("height")&&r.getAttribute("height")!=="auto"&&r.getAttribute("height").indexOf("%")>-1?"%":"px"},align:r.closest("table").closest("td").getAttribute("align")??"",valign:r.closest("table").closest("td").getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:o.getElementBorder(r),boxShadow:o.getElementBoxShadow(r),href:a.getAttribute("href")??"",mobileWidth:{value:x!==null?x:null,dim:T.mobileWidthDim},mobileHeight:{value:D!==null?D:null,dim:A.mobileHeightDim},mobileBorder:A.mobileBorder,mobileBorderRadius:A.mobileBorderRadius,mobileBoxShadow:A.mobileBoxShadow,mobileAlign:T.mobileAlign,mobileTextAlign:A.mobileAlign,mobileVerticalAlign:H.mobileVerticalAlign,mobileBackgroundColor:A.mobileBackgroundColor,mobileBackgroundImage:A.mobileBackgroundImage,mobileBackgroundPositionX:A.mobileBackgroundPositionX,mobileBackgroundPositionY:A.mobileBackgroundPositionY,mobileBackgroundRepeat:A.mobileBackgroundRepeat,mobilePadding:y,show:T.show,exportAsPicture:!!b.getAttribute("em-operation")&&b.getAttribute("em-operation")==="exportAsPicture"},r.style.backgroundImage?t.settings.backgroundImage=[{type:"url",value:r.style.backgroundImage?r.style.backgroundImage.substring(5,r.style.backgroundImage.length-2):""}]:r.getAttribute("background")&&(t.settings.backgroundImage=[{type:"url",value:r.getAttribute("background")?r.getAttribute("background"):""}]),t.type="button",t.caption=v.BUTTON}else{let a=e.elem.closest("div, p, td");t.type="text",t.caption=v.LINK,t.settings={linkHref:e.elem.getAttribute("href")?.trim()??"",textLink:!!e.elem.closest("a"),target:e.elem.getAttribute("target")??"",fontFamily:d(a),fontSize:parseFloat(e.elem?.closest('[style*="font-size"]')?.style.fontSize),textStrong:m(e.elem,"strong","b")||o.isElementHasBold$1(e.elem),textItalic:m(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem?.style?.fontStyle==="italic",textStrikethrough:m(e.elem,"s","strike")||e.elem.style.textDecoration==="line-through",textUnderline:m(e.elem,"u")||e.elem.style.textDecoration.includes("underline")||!e.elem.style["text-decoration"]?.length&&e.elem.tagName==="A",textColor:o.rgbToHex(e.elem.tagName==="A"?o.findParentWithExplicitStyle$1(e.elem.querySelector('[style*="color"]'),"color"):o.findParentWithExplicitStyle$1(e.elem,"color"))||o.rgbToHex(getComputedStyle(e.elem).color),textBackgroundColor:o.rgbToHex(e.elem.tagName==="A"?o.findParentWithExplicitStyle$1(e.elem.querySelector('[style*="background-color"]'),"background-color"):o.findParentWithExplicitStyle$1(e.elem,"background-color"))||"",fontSizeDim:"px",lineHeight:o.getLineHeightInPixels$1(e.elem),lineHeightDim:"px"}}e.elem.getAttribute("new")&&(e.elem.removeAttribute("new"),t.settings.isNewLink=!0)}else if(e.elem.tagName==="TABLE")if(e.elem.innerHTML!==""){let a=B({elem:e.elem}),r=a.mobileWidth;t.type="table",t.caption=v.TABLE,t.settings={backgroundColor:e.elem.style.backgroundColor?o.rgbToHex(e.elem.style.backgroundColor):"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:e.elem.style.backgroundPositionX&&e.elem.style.backgroundPositionX!=="initial"?e.elem.style.backgroundPositionX:"",backgroundPositionY:e.elem.style.backgroundPositionY&&e.elem.style.backgroundPositionY!=="initial"?e.elem.style.backgroundPositionY:"",backgroundRepeat:e.elem.style.backgroundRepeat?e.elem.style.backgroundRepeat:"repeat",width:{value:e.elem.getAttribute("width")&&e.elem.getAttribute("width")!=="auto"?parseFloat(e.elem.getAttribute("width")):null,dim:e.elem.getAttribute("width")&&e.elem.getAttribute("width")!=="auto"&&e.elem.getAttribute("width").indexOf("%")>-1?"%":"px"},maxWidth:{value:e.elem.style.maxWidth?parseFloat(e.elem.style.maxWidth):null,dim:e.elem.style.maxWidth&&e.elem.style.maxWidth.indexOf("%")>-1?"%":"px"},minWidth:{value:e.elem.style.minWidth?parseFloat(e.elem.style.minWidth):null,dim:e.elem.style.minWidth&&e.elem.style.minWidth.indexOf("%")>-1?"%":"px"},align:e.elem.getAttribute("align")??"",border:o.getElementBorder(e.elem),boxShadow:o.getElementBoxShadow(e.elem),borderRadius:o.getElementBorderRadius(e.elem),mobileWidth:{value:r!==null?r:null,dim:a.mobileWidthDim},mobileBorder:a.mobileBorder,mobileBorderRadius:a.mobileBorderRadius,mobileBoxShadow:a.mobileBoxShadow,show:a.show,mobileBackgroundColor:a.mobileBackgroundColor,mobileBackgroundImage:a.mobileBackgroundImage,mobileBackgroundPositionX:a.mobileBackgroundPositionX,mobileBackgroundPositionY:a.mobileBackgroundPositionY,mobileBackgroundRepeat:a.mobileBackgroundRepeat},e.elem.style.backgroundImage?t.settings.backgroundImage=[{type:"url",value:e.elem.style.backgroundImage?e.elem.style.backgroundImage.substring(5,e.elem.style.backgroundImage.length-2):""}]:e.elem.getAttribute("background")&&(t.settings.backgroundImage=[{type:"url",value:e.elem.getAttribute("background")?e.elem.getAttribute("background"):""}])}else t.type="emptyTable";else if(e.elem.tagName==="TABLE"&&e.elem.getAttribute("em")==="atom")t.settings={...o.getElementTdDiv(e.elem.querySelector("td")),direction:e.elem.querySelector("td").getAttribute("dir")??"none"},t.type="td",t.caption=v.ELEMENT,document.querySelector('[em-edit="active"]').removeAttribute("em-edit"),e.elem.querySelector("td").setAttribute("em-edit","active"),e.elem.querySelector("td").setAttribute("contenteditable","true");else if(e.elem.tagName==="TD"&&!e.elem.classList.contains("em-vindent")&&e.elem.innerHTML!==""&&!e.elem.querySelector(':scope > div[style*="inline-block"]')&&!e.elem.querySelector(":scope > table > tr > .em-mob-wrap")&&e.elem.closest("table").getAttribute("em")!=="atom"||e.elem.tagName==="TD"&&!e.elem.classList.contains("em-vindent")&&e.elem.innerHTML!==""&&e.elem.querySelector('div[style*="inline-block"]')&&e.elem.parentElement.getAttribute("em")!=="block"&&!e.elem.querySelector(".em-mob-wrap")||e.elem.closest("table")?.parentElement?.tagName==="BODY")t.settings={...o.getElementTdDiv(e.elem),direction:e.elem.getAttribute("dir")??"none"},t.type="td",e.elem.closest("table").parentElement.tagName==="BODY"?t.caption=v.EMAIL:t.caption=v.TABLE_COLUMN;else if(e.elem.tagName==="TD"&&e.elem.closest("table").getAttribute("em")==="atom")t.settings={...o.getElementTdDiv(e.elem),direction:e.elem.getAttribute("dir")??"none"},t.type="td",t.caption=v.ELEMENT;else if(e.elem.tagName==="TD"&&!e.elem.classList.contains("em-vindent")&&e.elem.innerHTML!==""&&e.elem.parentElement.getAttribute("em")==="block"&&(e.elem.querySelector('div[style*="inline-block"]')||e.elem.querySelector(":scope > table > tr > .em-mob-wrap")||e.elem.querySelector(":scope > table > tbody > tr > .em-mob-wrap"))&&e.elem.firstChild.tagName!=="EDITOR"){t.settings={...o.getElementTdDiv(e.elem),direction:e.elem.getAttribute("dir")??"none"};let a=[],r=null,b="",p;e.elem.querySelector(".em-mob-wrap")&&e.elem.querySelectorAll(".em-mob-wrap:first-child").length===1?(p=!0,e.elem.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach(y=>{a.push({width:parseFloat(y.getAttribute("width")),current:!1}),r=e.elem.querySelectorAll(".em-mob-wrap").length>1?parseFloat(e.elem.querySelector(".em-mob-wrap").nextElementSibling.getAttribute("width")):0,y.classList.contains("em-mob-wrap-cancel")&&(p=!1)}),b=e.elem.querySelector(".em-mob-wrap").getAttribute("valign")):e.elem.querySelector('div[style*="inline-block"]')&&(e.elem.querySelectorAll('div[style*="inline-block"]').length>1?e.elem.querySelectorAll('div[style*="inline-block"]').forEach(y=>{a.push({width:parseFloat(y.firstElementChild.getAttribute("width")),current:!1}),r=parseFloat(y.style.width)-(!y.firstElementChild.getAttribute("width")||y.firstElementChild.getAttribute("width").indexOf("%")>-1?parseFloat(y.style.width):parseFloat(y.firstElementChild.getAttribute("width")))}):(a=[{width:parseFloat(e.elem.querySelector('div[style*="inline-block"]').firstElementChild.getAttribute("width")),current:!0}],r=0),b=e.elem.querySelector('div[style*="inline-block"]').style.verticalAlign),t.settings.floatBlocks={items:a,gap:r,valign:b,wrap:p},t.type="structure",t.caption=v.STRUCTURE}else if(e.elem.tagName==="TD"&&(e.elem.classList.contains("em-vindent")||e.elem.innerHTML===""&&e.elem.closest("table").getAttribute("width")==="100%")){let a=B({elem:e.elem}),r=a.mobileHeight;t.type="vindent",t.caption=v.VERTICAL_INDENT,t.settings={height:{value:parseFloat(e.elem.getAttribute("height")),dim:"px"},mobileHeight:{value:r!==null?r:null,dim:a.mobileHeightDim}}}else if(e.elem.tagName==="TD"&&e.elem.innerHTML===""&&(!e.elem.getAttribute("width")||e.elem.classList.contains("em-mob-wrap"))&&!e.elem.getAttribute("height")&&(e.elem.closest('[em="block"].empty-structure')||e.elem.closest('[em="block"].em-structure')))t.type="emptyTd";else if(e.elem.tagName==="DIV"&&!e.elem.style.fontFamily&&e.elem.style.height&&e.elem.style.lineHeight&&e.elem.style.fontSize){let a=B({elem:e.elem}),r=a.mobileHeight;t.type="vindent",t.caption=v.VERTICAL_INDENT,t.settings={height:{value:parseFloat(e.elem.style.height),dim:"px"},mobileHeight:{value:r!==null?r:null,dim:a.mobileHeightDim}}}else if(e.elem.tagName==="DIV"&&(e.elem.style.display==="inline-block"||e.elem.style.display==="table-cell")&&e.elem.style.verticalAlign){let a=B({elem:e.elem}),r=a.mobileWidth,b=B({elem:e.elem.firstElementChild}).mobileWidth,p=0;e.elem.style.maxWidth?p=parseFloat(e.elem.style.maxWidth)-parseFloat(e.elem.firstElementChild.getAttribute("width")):e.elem.style.width&&(e.elem.firstElementChild.getAttribute("width").indexOf("0%")>-1?p=0:p=parseFloat(e.elem.style.width)-parseFloat(e.elem.firstElementChild.getAttribute("width"))),t.type="floatBlock",t.caption=v.FLOAT_BLOCK,t.settings={width:{value:e.elem.firstElementChild.getAttribute("width")?parseFloat(e.elem.firstElementChild.getAttribute("width")):null,dim:e.elem.firstElementChild.getAttribute("width")&&e.elem.firstElementChild.getAttribute("width").indexOf("%")>-1?"%":"px"},gap:{value:p,dim:"px"},maxWidth:{value:e.elem.style.maxWidth?parseFloat(e.elem.style.maxWidth):null,dim:e.elem.style.maxWidth&&e.elem.style.maxWidth.indexOf("%")>-1?"%":"px"},minWidth:{value:e.elem.style.minWidth?parseFloat(e.elem.style.minWidth):null,dim:e.elem.style.minWidth&&e.elem.style.minWidth.indexOf("%")>-1?"%":"px"},valign:e.elem.style.verticalAlign??"",mobileWidth:{value:r!==null?r:null,dim:a.mobileWidthDim},mobileContentWidth:{value:b!==null?b:null,dim:B({elem:e.elem.firstElementChild}).mobileWidthDim},mobileVerticalAlign:a.mobileVerticalAlign,show:a.show}}else if(e.elem.tagName==="DIV"||e.elem.tagName==="TD"&&e.elem.firstChild.tagName==="EDITOR")if(e.elem.style.fontFamily&&e.elem.style.fontSize&&e.elem.style.lineHeight){let a=B({elem:e.elem});t.settings={fontFamily:d(s),fontSize:parseFloat(s?.closest('[style*="font-size"]')?.style.fontSize),fontSizeDim:"px",lineHeight:o.getLineHeightInPixels$1(s),lineHeightDim:"px",textAlign:e.elem.getAttribute("align")??"left",textStrong:m(e.elem,"strong","b")||o.isElementHasBold$1(s),textItalic:m(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s?.style?.fontStyle==="italic",textStrikethrough:m(e.elem,"s","strike")||s.style.textDecoration==="line-through",textUnderline:m(e.elem,"u")||s.style.textDecoration.includes("underline")||!s.style["text-decoration"]&&e.elem?.tagName==="A",textColor:o.rgbToHex(s?.closest('[style*="color"]')?.style.color)||o.rgbToHex(getComputedStyle(s).color),textBackgroundColor:o.rgbToHex(s?.closest('[style*="background-color"]')?.style["background-color"])||"",mobileFontSize:{value:a.mobileFontSize,dim:a.mobileFontSizeDim},mobileTextAlign:a.mobileAlign,textLink:m(e.elem,"a")},t.type="text",t.caption=v.TEXT}else t.type="div",t.caption=v.CONTAINER,t.settings={...o.getElementTdDiv(e.elem),width:{value:e.elem.style.width?parseFloat(e.elem.style.width):null,dim:e.elem.style.width&&e.elem.style.width.indexOf("%")>-1?"%":"px"},maxWidth:{value:e.elem.style.maxWidth?parseFloat(e.elem.style.maxWidth):null,dim:e.elem.style.maxWidth&&e.elem.style.maxWidth.indexOf("%")>-1?"%":"px"},minWidth:{value:e.elem.style.minWidth?parseFloat(e.elem.style.minWidth):null,dim:e.elem.style.minWidth&&e.elem.style.minWidth.indexOf("%")>-1?"%":"px"},height:{value:e.elem.style.height?parseFloat(e.elem.style.height):null,dim:e.elem.style.height&&e.elem.style.height.indexOf("%")>-1?"%":"px"},valign:e.elem.style.verticalAlign??"",align:e.elem.style.textAlign??"",direction:e.elem.getAttribute("dir")??"none"};else if(e.elem.tagName==="EDITOR"||e.elem.tagName==="B"||e.elem.tagName==="STRONG"||e.elem.tagName==="U"||e.elem.tagName==="S"||e.elem.tagName==="STRIKE"||e.elem.tagName==="SPAN"||e.elem.tagName==="FONT"||e.elem.tagName==="I"||e.elem.tagName==="EM"||e.elem.tagName==="P"||e.elem.tagName==="A"||e.elem.tagName==="H1"||e.elem.tagName==="H2"||e.elem.tagName==="H3"||e.elem.tagName==="H4"||e.elem.tagName==="H5"||e.elem.tagName==="H6")if(e.elem.closest("a")&&e.elem.closest('a[style*="display"]')&&e.elem.closest("td[height]")||e.elem.tagName==="A"&&e.elem.getAttribute("style").indexOf("display")>-1&&e.elem.closest("td[height]")){let a=e.elem.closest("a"),r=e.elem.closest("td"),b=e.elem.closest("table"),p={all:null,top:null,right:null,bottom:null,left:null},y={all:null,top:null,right:null,bottom:null,left:null},f=B({elem:e.elem}),A=B({elem:e.elem.closest("td")}),H=B({elem:e.elem.closest("td").closest("table").closest("td")}),T=B({elem:e.elem.closest("table")}),x=T.mobileWidth,D=A.mobileHeight,R=e.elem.closest("a");(a.style.padding||a.style.paddingTop||a.style.paddingRight||a.style.paddingBottom||a.style.paddingLeft)&&(!a.style.padding||a.style.padding.indexOf(" ")>-1?p.all=null:!a.style.padding&&a.style.paddingTop&&a.style.paddingRight&&a.style.paddingBottom&&a.style.paddingLeft&&a.style.paddingTop===a.style.paddingRight===a.style.paddingBottom===a.style.paddingLeft?p.all=parseFloat(a.style.paddingTop):p.all=parseFloat(a.style.padding),p.top=a.style.paddingTop||a.style.paddingTop===0?parseFloat(a.style.paddingTop):null,p.right=a.style.paddingRight||a.style.paddingRight===0?parseFloat(a.style.paddingRight):null,p.bottom=a.style.paddingBottom||a.style.paddingBottom===0?parseFloat(a.style.paddingBottom):null,p.left=a.style.paddingLeft||a.style.paddingLeft===0?parseFloat(a.style.paddingLeft):null),(f.mobilePadding.all||f.mobilePadding.top||f.mobilePadding.right||f.mobilePadding.bottom||f.mobilePadding.left)&&(f.mobilePadding.all?!f.mobilePadding.all&&f.mobilePadding.top&&f.mobilePadding.right&&f.mobilePadding.bottom&&f.mobilePadding.left&&f.mobilePadding.top===f.mobilePadding.right===f.mobilePadding.bottom===f.mobilePadding.left?y.all=parseFloat(f.mobilePadding.top):y.all=parseFloat(f.mobilePadding.all):y.all=null,y.top=f.mobilePadding.top||f.mobilePadding.top===0?parseFloat(f.mobilePadding.top):f.mobilePadding.all?f.mobilePadding.all:null,y.right=f.mobilePadding.right||f.mobilePadding.right===0?parseFloat(f.mobilePadding.right):f.mobilePadding.all?f.mobilePadding.all:null,y.bottom=f.mobilePadding.bottom||f.mobilePadding.bottom===0?parseFloat(f.mobilePadding.bottom):f.mobilePadding.all?f.mobilePadding.all:null,y.left=f.mobilePadding.left||f.mobilePadding.left===0?parseFloat(f.mobilePadding.left):f.mobilePadding.all?f.mobilePadding.all:null),t.settings={textStrong:m(e.elem,"strong","b")||o.isElementHasBold$1(e.elem),textItalic:m(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&R?.style?.fontStyle==="italic",textStrikethrough:m(e.elem,"s","strike")||e.elem.style.textDecoration==="line-through",textUnderline:m(e.elem,"u")||e.elem.style.textDecoration.includes("underline")||!e.elem.style["text-decoration"]?.length&&e.elem.tagName==="A",textColor:o.rgbToHex(o.findParentWithExplicitStyle$1(e.elem,"color"))||o.rgbToHex(getComputedStyle(e.elem).color),textBackgroundColor:o.rgbToHex(o.findParentWithExplicitStyle$1(e.elem,"background-color"))||"",fontFamily:d(R),fontSize:parseFloat(s?.closest('[style*="font-size"]')?.style.fontSize),fontSizeDim:"px",lineHeight:o.getLineHeightInPixels$1(s),lineHeightDim:"px",padding:p,borderRadius:o.getElementBorderRadius(r),backgroundColor:r.style.backgroundColor?o.rgbToHex(r.style.backgroundColor):r.getAttribute("bgcolor")?r.getAttribute("bgcolor"):"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:r.style.backgroundPositionX&&r.style.backgroundPositionX!=="initial"?r.style.backgroundPositionX:"",backgroundPositionY:r.style.backgroundPositionY&&r.style.backgroundPositionY!=="initial"?r.style.backgroundPositionY:"",backgroundRepeat:r.style.backgroundRepeat?r.style.backgroundRepeat:"repeat",width:{value:b.getAttribute("width")&&b.getAttribute("width")!=="auto"?parseFloat(b.getAttribute("width")):null,dim:b.getAttribute("width")&&b.getAttribute("width")!=="auto"&&b.getAttribute("width").indexOf("%")>-1?"%":"px"},height:{value:r.getAttribute("height")&&r.getAttribute("height")!=="auto"?parseFloat(r.getAttribute("height")):null,dim:r.getAttribute("height")&&r.getAttribute("height")!=="auto"&&r.getAttribute("height").indexOf("%")>-1?"%":"px"},align:r.getAttribute("align")??"",valign:r.getAttribute("valign")??"",border:o.getElementBorder(r),boxShadow:o.getElementBoxShadow(r),href:a.getAttribute("href")??"",mobileWidth:{value:x??null,dim:T.mobileWidthDim},mobileHeight:{value:D??null,dim:A.mobileHeightDim},mobileBorder:A.mobileBorder,mobileBorderRadius:A.mobileBorderRadius,mobileBoxShadow:A.mobileBoxShadow,mobileAlign:T.mobileAlign,mobileTextAlign:A.mobileAlign,mobileVerticalAlign:H.mobileVerticalAlign,mobileBackgroundColor:A.mobileBackgroundColor,mobileBackgroundImage:A.mobileBackgroundImage,mobileBackgroundPositionX:A.mobileBackgroundPositionX,mobileBackgroundPositionY:A.mobileBackgroundPositionY,mobileBackgroundRepeat:A.mobileBackgroundRepeat,mobilePadding:y,show:T.show},r.style.backgroundImage?t.settings.backgroundImage=[{type:"url",value:r.style.backgroundImage?r.style.backgroundImage.substring(5,r.style.backgroundImage.length-2):""}]:r.getAttribute("background")&&(t.settings.backgroundImage=[{type:"url",value:r.getAttribute("background")?r.getAttribute("background"):""}]),t.type="button",t.caption=v.BUTTON}else if(e.elem.classList.contains("em-code_var"))t.settings={value:e.elem.nextSibling.nodeType===8?e.elem.nextSibling.nodeValue:""},t.type="var",t.caption=v.VAR;else{let a=B({elem:e.elem}),r=B({elem:e.elem.closest("div, p, td")}),b=s.closest("div, p, td");t.settings={fontFamily:d(b),fontSize:parseFloat(s?.closest('[style*="font-size"]')?.style.fontSize),fontSizeDim:"px",lineHeight:o.getLineHeightInPixels$1(s),lineHeightDim:"px",linkHref:s.closest("a")?.getAttribute("href")?.trim(),textLink:!!s.closest("a"),textAlign:b.getAttribute("align")??"left",mobileFontSize:{value:a.mobileFontSize,dim:a.mobileFontSizeDim},mobileTextAlign:r.mobileAlign,textStrong:m(e.elem,"strong","b")||o.isElementHasBold$1(s),textItalic:m(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&b?.style?.fontStyle==="italic",textStrikethrough:m(e.elem,"s","strike")||s.style.textDecoration==="line-through",textUnderline:m(e.elem,"u")||s.style.textDecoration.includes("underline")||!s.style["text-decoration"]&&e.elem.tagName==="A",textColor:o.rgbToHex(o.findParentWithExplicitStyle$1(e.elem,"color"))||o.rgbToHex(getComputedStyle(s).color),textBackgroundColor:o.rgbToHex(o.findParentWithExplicitStyle$1(s,"background-color"))||""},t.type="text",t.caption=v.TEXT}else t.type=null;if(e.elem.parentNode.tagName!=="BODY"){t.settings.parent=Xe(e.elem);let a=e.elem;e.elem.tagName==="IMG"?a=e.elem.closest('div[em="atom"]')?e.elem.closest('div[em="atom"]'):e.elem.closest(".em-element-resize-img-container"):e.elem.closest("editor")?a=e.elem.parentElement:e.elem.tagName==="TD"&&e.elem.classList.contains("em-vindent")?a=e.elem.closest(".em-vindent-table"):e.elem.tagName==="TD"&&e.elem.parentElement.getAttribute("em")&&e.elem.parentElement.getAttribute("em")==="block"&&(a=e.elem.parentElement),t.settings.nextElem=!!a?.nextElementSibling&&(!a.nextElementSibling.getAttribute("contenteditable")||a.nextElementSibling.getAttribute("contenteditable")!=="false"),t.settings.prevElem=!!a?.previousElementSibling&&(!a.previousElementSibling.getAttribute("contenteditable")||a.previousElementSibling.getAttribute("contenteditable")!=="false")}else t.settings.parent=void 0;(e.elem.closest('div[style*="inline-block"]')||e.elem.closest(".em-mob-wrap"))&&(t.settings.floatBlocks=vt({elem:e.elem})),e.activateSection&&(t.settings.activateSection=e.activateSection),t.settings.deletable=!e.elem.classList.contains("em-mob-wrap")}else t={operation:"application_element_settings_set",settings:{parent:void 0,nextElem:!1,prevElem:!1},type:null};t.settings=ze.unescape(t.settings),St=JSON.stringify(t),o.messageService.send(t)}function vt(e){let i=[],t=null,l="",n;if(e.elem.closest(".em-mob-wrap")){let s=e.elem.closest(".em-mob-wrap");n=!0,s.parentElement.querySelectorAll(".em-mob-wrap").length>1?s.parentElement.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach(d=>{i.push({width:parseFloat(d.getAttribute("width")),current:d===s}),t=s.parentElement.querySelector(".em-mob-wrap").nextElementSibling.getAttribute("width"),d.classList.contains("em-mob-wrap-cancel")&&(n=!1)}):(i=[{width:parseFloat(s.parentElement.querySelector(".em-mob-wrap").getAttribute("width")),current:!0}],t=0),l=s.parentElement.querySelector(".em-mob-wrap").getAttribute("valign")}else{let s=e.elem.closest('div[style*="inline-block"]');s.parentElement.querySelectorAll('div[style*="inline-block"]').length>1?s.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(d=>{d.style.fontFamily||(i.push({width:parseFloat(d.firstElementChild.getAttribute("width")),current:d===s}),t=parseFloat(d.style.width)-(!d.firstElementChild.getAttribute("width")||d.firstElementChild.getAttribute("width").indexOf("%")>-1?parseFloat(d.style.width):parseFloat(d.firstElementChild.getAttribute("width"))))}):(i=[{width:parseFloat(s.parentElement.querySelector('div[style*="inline-block"]').firstElementChild.getAttribute("width")),current:!0}],t=0),l=s.parentElement.querySelector('div[style*="inline-block"]').style.verticalAlign}return{items:i,gap:t,valign:l,wrap:n}}var St=JSON.stringify();function te(e){const{hOffset:i,vOffset:t}=e.settings.boxShadow||{};if(i!==""&&i!==null&&i!==void 0&&t!==""&&t!==null&&t!==void 0){let l="";l=e.settings.boxShadow.inset?"inset ":"",l+=e.settings.boxShadow.hOffset+"px ",l+=e.settings.boxShadow.vOffset+"px ",l+=e.settings.boxShadow.blurRadius!==""&&e.settings.boxShadow.blurRadius!==null?e.settings.boxShadow.blurRadius+"px ":"",l+=e.settings.boxShadow.spreadRadius!==""&&e.settings.boxShadow.spreadRadius!==null?e.settings.boxShadow.spreadRadius+"px ":"",l+=e.settings.boxShadow.color?e.settings.boxShadow.color:"",e.elem.style.boxShadow=l}else e.elem.style.removeProperty("box-shadow")}function U(e){e.settings.border.all?e.settings.border.all.width!=null&&(e.settings.border.all.style||e.settings.border.all.color)?(e.elem.style.borderWidth=e.settings.border.all.width+"px",e.elem.style.borderStyle=e.settings.border.all.style,e.elem.style.borderColor=e.settings.border.all.color):e.elem.style.removeProperty("border"):(e.settings.border.top&&(e.settings.border.top.width!=null&&(e.settings.border.top.style||e.settings.border.top.color)?(e.elem.style.borderTopWidth=e.settings.border.top.width+"px",e.elem.style.borderTopStyle=e.settings.border.top.style,e.elem.style.borderTopColor=e.settings.border.top.color):e.elem.style.removeProperty("border-top")),e.settings.border.right&&(e.settings.border.right.width!=null&&(e.settings.border.right.style||e.settings.border.right.color)?(e.elem.style.borderRightWidth=e.settings.border.right.width+"px",e.elem.style.borderRightStyle=e.settings.border.right.style,e.elem.style.borderRightColor=e.settings.border.right.color):e.elem.style.removeProperty("border-right")),e.settings.border.bottom&&(e.settings.border.bottom.width!=null&&(e.settings.border.bottom.style||e.settings.border.bottom.color)?(e.elem.style.borderBottomWidth=e.settings.border.bottom.width+"px",e.elem.style.borderBottomStyle=e.settings.border.bottom.style,e.elem.style.borderBottomColor=e.settings.border.bottom.color):e.elem.style.removeProperty("border-bottom")),e.settings.border.left&&(e.settings.border.left.width!=null&&(e.settings.border.left.style||e.settings.border.left.color)?(e.elem.style.borderLeftWidth=e.settings.border.left.width+"px",e.elem.style.borderLeftStyle=e.settings.border.left.style,e.elem.style.borderLeftColor=e.settings.border.left.color):e.elem.style.removeProperty("border-left")))}function K(e){e.settings.borderRadius.all?e.elem.style.borderRadius=e.settings.borderRadius.all+"px":e.settings.borderRadius.all===""?e.elem.style.removeProperty("border-radius"):(e.settings.borderRadius.topLeft?e.elem.style.borderTopLeftRadius=e.settings.borderRadius.topLeft+"px":e.settings.borderRadius.topLeft===""&&e.elem.style.removeProperty("border-top-left-radius"),e.settings.borderRadius.topRight?e.elem.style.borderTopRightRadius=e.settings.borderRadius.topRight+"px":e.settings.borderRadius.topRight===""&&e.elem.style.removeProperty("border-top-right-radius"),e.settings.borderRadius.bottomRight?e.elem.style.borderBottomRightRadius=e.settings.borderRadius.bottomRight+"px":e.settings.borderRadius.bottomRight===""&&e.elem.style.removeProperty("border-bottom-right-radius"),e.settings.borderRadius.bottomLeft?e.elem.style.borderBottomLeftRadius=e.settings.borderRadius.bottomLeft+"px":e.settings.borderRadius.bottomLeft===""&&e.elem.style.removeProperty("border-bottom-left-radius"))}function B(e){let i={mobileWidth:null,mobileWidthDim:"px",mobileHeight:null,mobileHeightDim:"px",mobileBorder:{all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},mobileBoxShadow:{hOffset:null,vOffset:null,blurRadius:null,spreadRadius:null,color:null,inset:null},mobileAlign:{value:""},mobileVerticalAlign:{value:""},mobileDirection:{value:""},mobileBackgroundColor:{value:""},mobileBackgroundImage:[{type:"url",value:""}],mobileBackgroundPositionX:{value:""},mobileBackgroundPositionY:{value:""},mobileBackgroundRepeat:{value:"none"},mobilePadding:{all:null,bottom:null,left:null,right:null,top:null},show:"all",mobileFontSize:null,mobileFontSizeDim:"px"};return e.elem.classList.forEach(t=>{if(t.indexOf("em-mob-width-")>-1&&(t.substring(t.length-2)==="px"?(i.mobileWidthDim="px",i.mobileWidth=parseFloat(t.substring(13,t.length-2))):t.substring(t.length-4)==="perc"?(i.mobileWidthDim="%",i.mobileWidth=parseFloat(t.substring(13,t.length-4))):t.substring(t.length-4)==="auto"&&(i.mobileWidthDim="px",i.mobileWidth="auto")),t.indexOf("em-mob-height-")>-1&&(t.substring(t.length-2)==="px"?(i.mobileHeightDim="px",i.mobileHeight=parseFloat(t.substring(14,t.length-2))):t.substring(t.length-4)==="perc"?(i.mobileHeightDim="%",i.mobileHeight=parseFloat(t.substring(14,t.length-4))):t.substring(t.length-4)==="auto"&&(i.mobileHeightDim="px",i.mobileHeight="auto")),t.indexOf("em-mob-border")>-1){if(t.substring(14,17)==="all"){let l=t.substring(18).split("_");i.mobileBorder.all.width=parseFloat(l[0]),i.mobileBorder.all.style=l[1],i.mobileBorder.all.color=l[2]?"#"+l[2]:""}if(t.substring(14,17)==="top"){let l=t.substring(18).split("_");i.mobileBorder.top.width=parseFloat(l[0]),i.mobileBorder.top.style=l[1],i.mobileBorder.top.color=l[2]?"#"+l[2]:""}if(t.substring(14,19)==="right"){let l=t.substring(20).split("_");i.mobileBorder.right.width=parseFloat(l[0]),i.mobileBorder.right.style=l[1],i.mobileBorder.right.color=l[2]?"#"+l[2]:""}if(t.substring(14,20)==="bottom"){let l=t.substring(21).split("_");i.mobileBorder.bottom.width=parseFloat(l[0]),i.mobileBorder.bottom.style=l[1],i.mobileBorder.bottom.color=l[2]?"#"+l[2]:""}if(t.substring(14,18)==="left"){let l=t.substring(19).split("_");i.mobileBorder.left.width=parseFloat(l[0]),i.mobileBorder.left.style=l[1],i.mobileBorder.left.color=l[2]?"#"+l[2]:""}}if(t.indexOf("em-mob-border_radius")>-1&&(t.substring(21,24)==="all"&&(i.mobileBorderRadius.all=parseFloat(t.substring(25))),t.substring(21,28)==="topLeft"&&(i.mobileBorderRadius.topLeft=parseFloat(t.substring(29))),t.substring(21,28)==="topRight"&&(i.mobileBorderRadius.topRight=parseFloat(t.substring(29))),t.substring(21,32)==="bottomRight"&&(i.mobileBorderRadius.bottomRight=parseFloat(t.substring(33))),t.substring(21,31)==="bottomLeft"&&(i.mobileBorderRadius.bottomLeft=parseFloat(t.substring(32)))),t.indexOf("em-mob-box_shadow")>-1){let l=t.substring(18).split("_");i.mobileBoxShadow.hOffset=parseFloat(l[0]),i.mobileBoxShadow.vOffset=parseFloat(l[1]),i.mobileBoxShadow.blurRadius=parseFloat(l[2]),i.mobileBoxShadow.spreadRadius=parseFloat(l[3]),i.mobileBoxShadow.color=l[4]?"#"+l[4]:"",i.mobileBoxShadow.inset=!!l[5]}if(t.indexOf("em-mob-text_align")>-1&&(i.mobileAlign.value=t.substring(18)),t.indexOf("em-mob-vertical_align")>-1&&(i.mobileVerticalAlign.value=t.substring(22)),t.indexOf("em-mob-direction")>-1&&(i.mobileDirection.value=t.substring(17)),t.indexOf("em-mob-background_color")>-1&&(i.mobileBackgroundColor.value=t.substring(24)!=="none"?"#"+t.substring(24):"none"),t.indexOf("em-mob-background_image")>-1){let l=t.substring(24);l=l.replace(/em-doubledots/gi,":").replace(/em-dot/gi,".").replace(/em-slash/gi,"/"),i.mobileBackgroundImage[0].value=l!=="none"?l:"none"}t.indexOf("em-mob-background_position_x")>-1&&(i.mobileBackgroundPositionX.value=t.substring(29)),t.indexOf("em-mob-background_position_y")>-1&&(i.mobileBackgroundPositionY.value=t.substring(29)),t.indexOf("em-mob-background_repeat")>-1&&(i.mobileBackgroundRepeat.value=t.substring(25)),t.indexOf("em-mob-padding")>-1&&(t.substring(15,18)==="all"&&(i.mobilePadding.all=parseFloat(t.substring(19))),t.substring(15,18)==="top"&&(i.mobilePadding.top=parseFloat(t.substring(19))),t.substring(15,20)==="right"&&(i.mobilePadding.right=parseFloat(t.substring(21))),t.substring(15,21)==="bottom"&&(i.mobilePadding.bottom=parseFloat(t.substring(22))),t.substring(15,19)==="left"&&(i.mobilePadding.left=parseFloat(t.substring(20)))),t.indexOf("em-show")>-1&&(t.substring(t.length-6)==="mobile"?i.show="mobile":t.substring(t.length-7)==="desktop"&&(i.show="desktop")),t.indexOf("em-mob-font_size")>-1&&(i.mobileFontSizeDim="px",i.mobileFontSize=t.substring(17,t.length-2))}),i}function Z(e){if(e.settings.mobileWidth.value!==null){let i="";e.settings.mobileWidth.dim?i=e.settings.mobileWidth.classNamePrefix+e.settings.mobileWidth.value+(e.settings.mobileWidth.dim==="%"?"perc":"px"):i=e.settings.mobileWidth.classNamePrefix+e.settings.mobileWidth.value,e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileWidth.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),e.settings.mobileWidth.dim?document.head.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
29
|
-
`+E()+`
|
|
30
|
-
.${i} { width: ${e.settings.mobileWidth.value}${e.settings.mobileWidth.dim} !important; max-width: ${e.settings.mobileWidth.value}${e.settings.mobileWidth.dim} !important; min-width: ${e.settings.mobileWidth.value}${e.settings.mobileWidth.dim} !important; }
|
|
31
|
-
}
|
|
32
|
-
`):document.head.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
33
|
-
`+E()+`
|
|
34
|
-
.${i} { width: ${e.settings.mobileWidth.value} !important; max-width: ${e.settings.mobileWidth.value} !important; min-width: ${e.settings.mobileWidth.value!=="auto"?e.settings.mobileWidth.value:"none"} !important; }
|
|
35
|
-
}
|
|
36
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileWidth.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function ie(e){if(e.settings.mobileHeight.value!==null){let i="";e.settings.mobileHeight.dim?i=e.settings.mobileHeight.classNamePrefix+e.settings.mobileHeight.value+(e.settings.mobileHeight.dim==="%"?"perc":"px"):i=e.settings.mobileHeight.classNamePrefix+e.settings.mobileHeight.value,e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileHeight.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),e.settings.mobileHeight.dim?document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
37
|
-
`+E()+`
|
|
38
|
-
.${i} { height: ${e.settings.mobileHeight.value}${e.settings.mobileHeight.dim} !important; }
|
|
39
|
-
}
|
|
40
|
-
`):document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
41
|
-
`+E()+`
|
|
42
|
-
.${i} { height: ${e.settings.mobileHeight.value} !important; }
|
|
43
|
-
}
|
|
44
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileHeight.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function le(e){let i="";if(e.settings.mobileBorder.all?i="all":e.settings.mobileBorder.top?i="top":e.settings.mobileBorder.right?i="right":e.settings.mobileBorder.bottom?i="bottom":e.settings.mobileBorder.left&&(i="left"),e.settings.mobileBorder[i].width!==null||e.settings.mobileBorder[i].style||e.settings.mobileBorder[i].color){let t=e.settings.mobileBorder[i].classNamePrefix+(e.settings.mobileBorder[i].width!==null?e.settings.mobileBorder[i].width+"px":"")+(e.settings.mobileBorder[i].style?"_"+e.settings.mobileBorder[i].style:"")+(e.settings.mobileBorder[i].color?"_"+e.settings.mobileBorder[i].color.substring(1):"");e.elem.classList.forEach(l=>{l.indexOf(e.settings.mobileBorder[i].classNamePrefix)>-1&&e.elem.classList.remove(l)}),e.elem.classList.add(t),P(),i==="all"?document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
45
|
-
`+E()+`
|
|
46
|
-
.${t} { ${e.settings.mobileBorder[i].width!==null?"border-width: "+e.settings.mobileBorder[i].width+`px !important;
|
|
47
|
-
`:""}${e.settings.mobileBorder[i].style?"border-style: "+e.settings.mobileBorder[i].style+` !important;
|
|
48
|
-
`:""}${e.settings.mobileBorder[i].color?"border-color: "+e.settings.mobileBorder[i].color+` !important;
|
|
49
|
-
`:""}}
|
|
50
|
-
}
|
|
51
|
-
`):document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
52
|
-
`+E()+`
|
|
53
|
-
.${t} { ${e.settings.mobileBorder[i].width!==null?"border-"+i+"-width: "+e.settings.mobileBorder[i].width+`px !important;
|
|
54
|
-
`:""}${e.settings.mobileBorder[i].style?"border-"+i+"-style: "+e.settings.mobileBorder[i].style+` !important;
|
|
55
|
-
`:""}${e.settings.mobileBorder[i].color?"border-"+i+"-color: "+e.settings.mobileBorder[i].color+` !important;
|
|
56
|
-
`:""}}
|
|
57
|
-
}
|
|
58
|
-
`)}else e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileBorder[i].classNamePrefix)>-1&&e.elem.classList.remove(t)})}function oe(e){let i="";if(e.settings.mobileBorderRadius.all||e.settings.mobileBorderRadius.all===0||e.settings.mobileBorderRadius.all===null?i="all":e.settings.mobileBorderRadius.topLeft||e.settings.mobileBorderRadius.topLeft===0||e.settings.mobileBorderRadius.topLeft===null?i="topLeft":e.settings.mobileBorderRadius.topRight||e.settings.mobileBorderRadius.topRight===0||e.settings.mobileBorderRadius.topRight===null?i="topRight":e.settings.mobileBorderRadius.bottomRight||e.settings.mobileBorderRadius.bottomRight===0||e.settings.mobileBorderRadius.bottomRight===null?i="bottomRight":(e.settings.mobileBorderRadius.bottomLeft||e.settings.mobileBorderRadius.bottomLeft===0||e.settings.mobileBorderRadius.bottomLeft===null)&&(i="bottomLeft"),e.settings.mobileBorderRadius[i]!==null){let t=e.settings.mobileBorderRadius.classNamePrefix+e.settings.mobileBorderRadius[i];if(e.elem.classList.forEach(l=>{l.indexOf(e.settings.mobileBorderRadius.classNamePrefix)>-1&&e.elem.classList.remove(l)}),e.elem.classList.add(t),P(),i==="all")document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
59
|
-
`+E()+`
|
|
60
|
-
.${t} { border-radius: ${e.settings.mobileBorderRadius[i]}px !important; }
|
|
61
|
-
}
|
|
62
|
-
`);else{let l="";i==="topLeft"?l="top-left":i==="topRight"?l="top-right":i==="bottomRight"?l="bottom-right":i==="bottomLeft"&&(l="bottom-left"),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
63
|
-
`+E()+`
|
|
64
|
-
.${t} { border-${l}-radius: ${e.settings.mobileBorderRadius[i]}px !important; }
|
|
65
|
-
}
|
|
66
|
-
`)}}else e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileBorderRadius.classNamePrefix)>-1&&e.elem.classList.remove(t)})}function ne(e){if(e.settings.mobileBoxShadow.hOffset!==null||e.settings.mobileBoxShadow.vOffset!==null||e.settings.mobileBoxShadow.blurRadius!==null||e.settings.mobileBoxShadow.spreadRadius!==null){let i=e.settings.mobileBoxShadow.classNamePrefix+(e.settings.mobileBoxShadow.hOffset?e.settings.mobileBoxShadow.hOffset+"px":"0px")+"_"+(e.settings.mobileBoxShadow.vOffset?e.settings.mobileBoxShadow.vOffset+"px":"0px")+"_"+(e.settings.mobileBoxShadow.blurRadius?e.settings.mobileBoxShadow.blurRadius+"px":"0px")+"_"+(e.settings.mobileBoxShadow.spreadRadius?e.settings.mobileBoxShadow.spreadRadius+"px":"0px")+"_"+(e.settings.mobileBoxShadow.color?e.settings.mobileBoxShadow.color.substring(1):"000000")+(e.settings.mobileBoxShadow.inset?"_inset":"");e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileBoxShadow.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
67
|
-
`+E()+`
|
|
68
|
-
.${i} { box-shadow:${e.settings.mobileBoxShadow.inset?" inset":""} ${e.settings.mobileBoxShadow.hOffset?e.settings.mobileBoxShadow.hOffset+"px":"0px"} ${e.settings.mobileBoxShadow.vOffset?e.settings.mobileBoxShadow.vOffset+"px":"0px"} ${e.settings.mobileBoxShadow.blurRadius?e.settings.mobileBoxShadow.blurRadius+"px":"0px"} ${e.settings.mobileBoxShadow.spreadRadius?e.settings.mobileBoxShadow.spreadRadius+"px":"0px"} ${e.settings.mobileBoxShadow.color?e.settings.mobileBoxShadow.color:"#000000"} !important; }
|
|
69
|
-
}
|
|
70
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileBoxShadow.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function se(e){if(e.settings.mobileAlign.value){let i=e.settings.mobileAlign.classNamePrefix+e.settings.mobileAlign.value;e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileAlign.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
71
|
-
`+E()+`
|
|
72
|
-
.${i} { text-align: ${e.settings.mobileAlign.value} !important; }
|
|
73
|
-
}
|
|
74
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileAlign.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function ae(e){if(e.settings.mobileVerticalAlign.value){let i=e.settings.mobileVerticalAlign.classNamePrefix+e.settings.mobileVerticalAlign.value;e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileVerticalAlign.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
75
|
-
`+E()+`
|
|
76
|
-
.${i} { vertical-align: ${e.settings.mobileVerticalAlign.value} !important; }
|
|
77
|
-
}
|
|
78
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileVerticalAlign.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function Ge(e){if(e.settings.mobileDirection.value){let i=e.settings.mobileDirection.classNamePrefix+e.settings.mobileDirection.value;e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileDirection.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
79
|
-
`+E()+`
|
|
80
|
-
.${i} { direction: ${e.settings.mobileDirection.value} !important; }
|
|
81
|
-
}
|
|
82
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileDirection.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function fe(e){if(e.settings.mobileBackgroundColor.value){let i=e.settings.mobileBackgroundColor.classNamePrefix+(e.settings.mobileBackgroundColor.value!=="none"?e.settings.mobileBackgroundColor.value.substring(1):"none");e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileBackgroundColor.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
83
|
-
`+E()+`
|
|
84
|
-
.${i} { background-color: ${e.settings.mobileBackgroundColor.value!=="none"?e.settings.mobileBackgroundColor.value:"transparent"} !important; }
|
|
85
|
-
}
|
|
86
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileBackgroundColor.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function ue(e){if(e.settings.mobileBackgroundImage[0].value){let i="none";e.settings.mobileBackgroundImage[0].value!=="none"&&(i=e.settings.mobileBackgroundImage[0].value.replace(/\:/gi,"em-doubledots").replace(/\./gi,"em-dot").replace(/\//gi,"em-slash"));let t=e.settings.mobileBackgroundImage[0].classNamePrefix+i;e.elem.classList.forEach(l=>{l.indexOf(e.settings.mobileBackgroundImage[0].classNamePrefix)>-1&&e.elem.classList.remove(l)}),e.elem.classList.add(t),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
87
|
-
`+E()+`
|
|
88
|
-
.${t} { background-image: ${e.settings.mobileBackgroundImage[0].value!=="none"?"url("+e.settings.mobileBackgroundImage[0].value+")":"none"} !important; }
|
|
89
|
-
}
|
|
90
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileBackgroundImage[0].classNamePrefix)>-1&&e.elem.classList.remove(i)})}function he(e){if(e.settings.mobileBackgroundPositionX.value){let i=e.settings.mobileBackgroundPositionX.classNamePrefix+e.settings.mobileBackgroundPositionX.value;e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileBackgroundPositionX.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
91
|
-
`+E()+`
|
|
92
|
-
.${i} { background-position-x: ${e.settings.mobileBackgroundPositionX.value} !important; }
|
|
93
|
-
}
|
|
94
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileBackgroundPositionX.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function ye(e){if(e.settings.mobileBackgroundPositionY.value){let i=e.settings.mobileBackgroundPositionY.classNamePrefix+e.settings.mobileBackgroundPositionY.value;e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileBackgroundPositionY.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
95
|
-
`+E()+`
|
|
96
|
-
.${i} { background-position-x: ${e.settings.mobileBackgroundPositionY.value} !important; }
|
|
97
|
-
}
|
|
98
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileBackgroundPositionY.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function ve(e){if(e.settings.mobileBackgroundRepeat.value!=="none"){let i=e.settings.mobileBackgroundRepeat.classNamePrefix+e.settings.mobileBackgroundRepeat.value;e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileBackgroundRepeat.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
99
|
-
`+E()+`
|
|
100
|
-
.${i} { background-repeat: ${e.settings.mobileBackgroundRepeat.value} !important; }
|
|
101
|
-
}
|
|
102
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileBackgroundRepeat.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function we(e){if(e.elem.getAttribute("class")){let i=e.elem.getAttribute("class").split(" ");for(let t of i)t.indexOf("em-mob-padding")>-1&&e.elem.classList.remove(t)}if(e.settings.mobilePadding.all!==null||e.settings.mobilePadding.top!==null||e.settings.mobilePadding.right!==null||e.settings.mobilePadding.bottom!==null||e.settings.mobilePadding.left!==null){let i="",t="";P(),e.settings.mobilePadding.all!==null&&(i=e.settings.mobilePadding.classNamePrefix+"all-"+e.settings.mobilePadding.all,e.elem.classList.add(i),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
103
|
-
`+E()+`
|
|
104
|
-
.${i} { padding: ${e.settings.mobilePadding.all}px !important; }
|
|
105
|
-
}
|
|
106
|
-
`)),e.settings.mobilePadding.top!==null&&(i=e.settings.mobilePadding.classNamePrefix+"top-"+e.settings.mobilePadding.top,t="top",e.elem.classList.add(i),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
107
|
-
`+E()+`
|
|
108
|
-
.${i} { padding-${t}: ${e.settings.mobilePadding[t]}px !important; }
|
|
109
|
-
}
|
|
110
|
-
`)),e.settings.mobilePadding.right!==null&&(i=e.settings.mobilePadding.classNamePrefix+"right-"+e.settings.mobilePadding.right,t="right",e.elem.classList.add(i),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
111
|
-
`+E()+`
|
|
112
|
-
.${i} { padding-${t}: ${e.settings.mobilePadding[t]}px !important; }
|
|
113
|
-
}
|
|
114
|
-
`)),e.settings.mobilePadding.bottom!==null&&(i=e.settings.mobilePadding.classNamePrefix+"bottom-"+e.settings.mobilePadding.bottom,t="bottom",e.elem.classList.add(i),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
115
|
-
`+E()+`
|
|
116
|
-
.${i} { padding-${t}: ${e.settings.mobilePadding[t]}px !important; }
|
|
117
|
-
}
|
|
118
|
-
`)),e.settings.mobilePadding.left!==null&&(i=e.settings.mobilePadding.classNamePrefix+"left-"+e.settings.mobilePadding.left,t="left",e.elem.classList.add(i),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
119
|
-
`+E()+`
|
|
120
|
-
.${i} { padding-${t}: ${e.settings.mobilePadding[t]}px !important; }
|
|
121
|
-
}
|
|
122
|
-
`))}}function J(e){let i=function(){e.elem.style.removeProperty("display"),e.elem.previousSibling&&e.elem.previousSibling.textContent.indexOf("mso")>-1&&e.elem.previousSibling.remove(),e.elem.nextSibling&&e.elem.nextSibling.textContent.indexOf("endif")>-1&&e.elem.nextSibling.remove()};if(e.settings.show!=="all"){let t="em-show-"+e.elem.tagName.toLowerCase()+"-"+e.settings.show,l="";e.elem.classList.forEach(n=>{n.indexOf("em-show-")>-1&&e.elem.classList.remove(n)}),e.elem.classList.add(t),P(),e.settings.show==="mobile"&&(e.elem.style.display="none",(!e.elem.previousSibling||e.elem.previousSibling.textContent.indexOf("mso")===-1)&&(e.elem.insertAdjacentHTML("beforebegin","<!--[if !mso]><!-->"),e.elem.insertAdjacentHTML("afterend","<!--<![endif]-->")),e.elem.tagName==="TD"?l="table-cell":e.elem.tagName==="IMG"?l="inline-block":e.elem.tagName==="TABLE"?l="table":l="block",document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
123
|
-
`+E()+`
|
|
124
|
-
.${t} { display: ${l} !important; }
|
|
125
|
-
}
|
|
126
|
-
`)),e.settings.show==="desktop"&&(i(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
127
|
-
`+E()+`
|
|
128
|
-
.${t} { display: none !important; }
|
|
129
|
-
}
|
|
130
|
-
`))}else i(),e.elem.classList.forEach(t=>{t.indexOf("em-show-")>-1&&e.elem.classList.remove(t)})}function At(e){if(e.settings.mobileFontSize.value!==null){let i="";i=e.settings.mobileFontSize.classNamePrefix+e.settings.mobileFontSize.value+"px",e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileFontSize.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
131
|
-
`+E()+`
|
|
132
|
-
.${i} { font-size: ${e.settings.mobileFontSize.value}px !important;}
|
|
133
|
-
}
|
|
134
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileFontSize.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function xt(e){if(e.settings.mobileLineHeight.value!==null){let i="";i=e.settings.mobileLineHeight.classNamePrefix+e.settings.mobileLineHeight.value+"px",e.elem.classList.forEach(t=>{t.indexOf(e.settings.mobileLineHeight.classNamePrefix)>-1&&e.elem.classList.remove(t)}),e.elem.classList.add(i),P(),document.head.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
135
|
-
`+E()+`
|
|
136
|
-
.${i} { line-height: ${e.settings.mobileLineHeight.value}px !important;}
|
|
137
|
-
}
|
|
138
|
-
`)}else e.elem.classList.forEach(i=>{i.indexOf(e.settings.mobileLineHeight.classNamePrefix)>-1&&e.elem.classList.remove(i)})}function P(){if(!document.querySelector('style[em="styles"]')){let e=document.createElement("style");e.setAttribute("em","styles"),document.querySelector('[em="block"]')?.appendChild(e)}}function E(){let e=null;e:for(let i of document.querySelectorAll("style"))if(i.innerHTML.match(/@media.*?max((.|\n|\r)*?){/)){e=i.innerHTML.match(/@media.*?max((.|\n|\r)*?){/)[0];break e}return e===null&&(e="@media only screen and (max-device-width: 700px), only screen and (max-width: 700px) {"),e}function Lt(e){let i=C.getRangeByElement(e);if(i){i=Fe.correctRange(i),i=Ie.correctRange(i);const t={operation:"update_position_from_iframe",doctype:st,data:i};o.messageService.send(t)}}var Ue=Promise.resolve(),Ke=null;function N(e){Ke=e,Ue=Ue.finally(()=>{Ke===e&&Lt(e)})}function Ne(){let e=document.querySelector(".em-element-editor");if(e){let i=(e.closest('[em="block"]')?e.closest('[em="block"]'):e.closest('[em="group"]')).getBoundingClientRect().top;if(o.state.get("scrollTop")>o.state.get("iframeOffsetTop")+i){let t=o.state.get("scrollTop")-o.state.get("iframeOffsetTop")-i;e.style.top=t+8+"px"}else e.style.removeProperty("top")}}function Be(e){function i(d){for(;d;){if(d.tagName==="TR")return d;d=d.parentNode}return null}let t=document.createElement("table");t.replaceChildren(...o.parseFromString(e.blockHTML));let l=660;if(e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap"))if(l=0,document.body.clientWidth>425)l=e.targetBlock.clientWidth;else{let d=e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");d.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(r=>l+=parseFloat(r.getAttribute("width")));let m=parseFloat(d.parentElement.closest("td").style.paddingLeft)||0,a=parseFloat(d.parentElement.closest("td").style.paddingRight)||0;l+=m,l+=a}else e.targetBlock.querySelector('table[style*="max-width"]')?l=parseInt(e.targetBlock.querySelector('table[style*="max-width"]').offsetWidth):e.targetBlock.querySelector('div[style*="max-width"]')?l=parseInt(e.targetBlock.querySelector('div[style*="max-width"]').offsetWidth):e.targetBlock.querySelector('.row-content[style*="width"]')?l=parseInt(e.targetBlock.querySelector('.row-content[style*="width"]').offsetWidth):l=e.targetBlock.style.maxWidth?parseFloat(e.targetBlock.style.maxWidth):e.targetBlock.getBoundingClientRect().width;let n=t.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(t.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){n=0;let d=t.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");d.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(r=>{n+=parseFloat(r.getAttribute("width"))});let m=parseFloat(d.parentElement.closest("td").style.paddingLeft)||0,a=parseFloat(d.parentElement.closest("td").style.paddingRight)||0;n+=m,n+=a}if(t.querySelector('div[style*="inline-block"]')){if(l<660&&t.querySelector('div[style*="inline-block"]'))if(t.querySelectorAll('div[style*="inline-block"]').length>1)t.querySelectorAll('div[style*="inline-block"]').forEach(d=>{let m=parseFloat(d.style.width),a=m/n,r=d.firstElementChild,b=m-parseFloat(r.getAttribute("width")),p=parseFloat(l*a);d.style.width=p+"px",r.setAttribute("width",p-b),o.editConditionalComment({elem:d,width:p})});else{let d=t.querySelector('div[style*="inline-block"]');d.style.maxWidth=l+"px",o.editConditionalComment({elem:d,width:l}),d.firstElementChild.setAttribute("width",Math.round(l*.91)),d.firstElementChild.style.maxWidth=Math.round(l*.91)+"px"}}else if(t.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){let d=[];t.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(function(m){let a=i(m);a&&d.indexOf(a)===-1&&d.push(a)}),d.forEach(m=>{let a=m.querySelector(".em-mob-wrap, .noresp-em-mob-wrap"),r=parseFloat(a.parentElement.closest("td").style.paddingLeft)||0,b=parseFloat(a.parentElement.closest("td").style.paddingRight)||0;if(m.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1){let p=m.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)")?parseFloat(m.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").getAttribute("width")):0,y=m.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(even)").length,f=0;m.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(even)").forEach(H=>{if(H.getAttribute("width")&&!H.classList.contains("em-insert-ignore")){let T=parseFloat(H.getAttribute("width"))/n,x=Math.round(parseFloat(l*T)-p/(y*2));H.setAttribute("width",x),f+=x}});let A=l-(r+b+p*(y-1)+f);m.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(even)").forEach(H=>{H.getAttribute("width")&&!H.classList.contains("em-insert-ignore")&&H.setAttribute("width",parseFloat(H.getAttribute("width"))+Math.round(A/y))})}else if(a.getAttribute("width")&&!a.classList.contains("em-insert-ignore")){let p=Math.round(l-r-b);a.setAttribute("width",p)}})}const s=t.querySelector("tr");return s?o.getOuterHtml(s):o.getElementInnerHTML(t)}function Ze(e){let i=document.createElement("table");i.replaceChildren(...o.parseFromString(e.blockHTML));let t=660,l=e.targetBlock.tagName=="TR"?document.createElement("table"):document.createElement("div");if(l.style.width=o.state.get("emailWidth")+"px",l.style.height="1000px",l.style.borderCollapse="collapse",l.setAttribute("cellpadding","0"),l.setAttribute("cellspacing","0"),l.style.position="absolute",l.style.top="-9999px",l.style.left="-9999px",document.body.appendChild(l),l.innerHTML=e.targetBlock.outerHTML,o.state.get("emailWidth"))t=o.state.get("emailWidth");else if(l.querySelector('table[style*="max-width"]'))t=parseInt(l.querySelector('table[style*="max-width"]').offsetWidth);else if(l.querySelector('div[style*="max-width"]'))t=parseInt(l.querySelector('div[style*="max-width"]').offsetWidth);else if(l.querySelector('.row-content[style*="width"]'))t=parseInt(l.querySelector('.row-content[style*="width"]').offsetWidth);else{let s=l.querySelector(e.targetBlock.tagName);t=s.style.maxWidth?parseFloat(s.style.maxWidth):s.getBoundingClientRect().width}if(document.body.removeChild(l),i.querySelector("table:first-child")&&i.querySelector("table:first-child").style.maxWidth){let s=i.querySelector("table:first-child");s.style.maxWidth=t+"px",o.editConditionalComment({elem:s,width:t})}const n=i.querySelector("tr");return n?o.getOuterHtml(n):o.getElementInnerHTML(i)}function Se(e){o.clearLinkTags({elem:document.head},S);let i=document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",`https://fonts.googleapis.com/css2?family=${e.fontFamilyArray[2]}:ital,wght@${o.fontValues[e.fontFamilyArray[3]].indexOf("i")>-1?"1":"0"},${o.fontValues[e.fontFamilyArray[3]].replaceAll("i","")}&display=swap`),i.setAttribute("em-class",`em-font-${e.fontFamilyArray[2].replace(/\s/g,"")}-${e.fontFamilyArray[3].replace(/\s/g,"")}`),document.querySelector("title").insertAdjacentElement("afterend",i),P();let t=`font-family: '${e.fontFamilyArray[2]}', ${o.fontFamilyValues[e.fontFamilyArray[1]]}!important;`;t+=` font-weight: ${o.fontValues[e.fontFamilyArray[3]].replaceAll("i","")}!important;`,o.fontValues[e.fontFamilyArray[3]].indexOf("i")>-1&&(t+=" font-style: italic!important;"),document.querySelector('style[em="styles"]').insertAdjacentHTML("beforeend",`
|
|
139
|
-
.em-font-${e.fontFamilyArray[2].replace(/\s/g,"")}-${e.fontFamilyArray[3].replace(/\s/g,"")} { ${t} }`)}function Et(e){const i=o.state.get("commonStyles");if(!i?.text)return e.html;let t=e.html.substring(0,3)=="<tr"?document.createElement("table"):document.createElement("div");return t.innerHTML=e.html,t.querySelectorAll('[em="atom"] div[style*="font-family"]').forEach(l=>{if(!l.style.display&&parseFloat(l.style.fontSize)<=20){let n="",s=i.text.fontFamily;if(n=l.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${i.text.fontSize}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${i.text.lineHeight}px`).replace(/color:(\s+)?.*?;/,`color: ${i.text.color};`),l.setAttribute("style",n),s[0]==="Safe Fonts"?(l.style.fontFamily=s[1],o.clearLinkTags({elem:document.head},S)):s[0]==="Google Fonts"&&(s[1]==="Sans Serif"?l.style.fontFamily="Helvetica, Arial, sans-serif":s[1]==="Serif"&&(l.style.fontFamily='"Times New Roman", Times, serif'),l.classList.remove(...[...l.classList].filter(d=>d.startsWith("em-font"))),l.classList.add(`em-font-${s[2].replace(/\s/g,"")}-${s[3]}`),Se({fontFamilyArray:s})),l.closest('[em="atom"] > tbody > tr > td')&&l.closest('[em="atom"] > tbody > tr > td').style.paddingBottom)l.closest('[em="atom"] > tbody > tr > td').style.paddingBottom=i.text.paddingBottom+"px";else if(l.nextElementSibling||l.closest("table")&&l.closest("table").nextElementSibling){let d=l.nextElementSibling??l.closest("table").nextElementSibling;d&&d.tagName=="TABLE"&&(d.classList.contains("em-vindent-table")||d.querySelector("td").innerHTML=="")&&d.querySelector("td").setAttribute("height",i.text.paddingBottom)}}else if(!l.style.display&&parseFloat(l.style.fontSize)>20){let n="",s=i.headings.fontFamily;n=l.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${i.headings.fontSize}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${i.headings.lineHeight}px`).replace(/color:(\s+)?.*?;/,`color: ${i.headings.color};`),l.setAttribute("style",n),s[0]==="Safe Fonts"?(l.style.fontFamily=s[1],o.clearLinkTags({elem:document.head},S)):s[0]==="Google Fonts"&&(s[1]==="Sans Serif"?l.style.fontFamily="Helvetica, Arial, sans-serif":s[1]==="Serif"&&(l.style.fontFamily='"Times New Roman", Times, serif'),l.classList.remove(...[...l.classList].filter(m=>m.startsWith("em-font"))),l.classList.add(`em-font-${s[2].replace(/\s/g,"")}-${s[3].replace(/\s/g,"")}`),Se({fontFamilyArray:s}));let d="";if(i.headings.letterSpacing>0?d=l.style.letterSpacing?l.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${i.headings.letterSpacing}px`):l.getAttribute("style")+` letter-spacing: ${i.headings.letterSpacing}px;`:d=l.getAttribute("style").replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,""),l.setAttribute("style",d),i.headings.bold?l.querySelector("b")?l.querySelector("b").replaceWith(...l.querySelector("b").childNodes):l.querySelector("strong")||(l.innerHTML="<strong>"+l.innerHTML+"</strong>"):l.querySelector("strong")?l.querySelector("strong").replaceWith(...l.querySelector("strong").childNodes):l.querySelector("b")&&l.querySelector("b").replaceWith(...l.querySelector("b").childNodes),l.style.fontWeight){let m=l.getAttribute("style").replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"");l.setAttribute("style",m)}if(i.headings.italic?l.querySelector("i")?l.querySelector("i").replaceWith(...l.querySelector("i").childNodes):l.querySelector("em")||(l.innerHTML="<em>"+l.innerHTML+"</em>"):l.querySelector("em")?l.querySelector("em").replaceWith(...l.querySelector("em").childNodes):l.querySelector("i")&&l.querySelector("i").replaceWith(...l.querySelector("i").childNodes),l.style.fontStyle){let m=l.getAttribute("style").replace(/(\s+)?font-style:(\s+)?.*?;/,"");l.setAttribute("style",m)}if(l.closest('[em="atom"] > tbody > tr > td')&&l.closest('[em="atom"] > tbody > tr > td').style.paddingTop)l.closest('[em="atom"] > tbody > tr > td').style.paddingTop=i.headings.paddingTop+"px";else if(l.previousElementSibling){let m=l.previousElementSibling;m&&m.tagName=="TABLE"&&(m.classList.contains("em-vindent-table")||m.querySelector("td").innerHTML=="")&&m.querySelector("td").setAttribute("height",i.headings.paddingTop)}if(l.closest('[em="atom"] > tbody > tr > td')&&l.closest('[em="atom"] > tbody > tr > td').style.paddingBottom)l.closest('[em="atom"] > tbody > tr > td').style.paddingBottom=i.headings.paddingBottom+"px";else if(l.nextElementSibling){let m=l.nextElementSibling;m&&m.tagName=="TABLE"&&(m.classList.contains("em-vindent-table")||m.querySelector("td").innerHTML=="")&&m.querySelector("td").setAttribute("height",i.headings.paddingBottom)}}}),t.querySelectorAll('[em="atom"] a[style*="color"]').forEach(l=>{if(l.style.display){if(l.style.display&&l.style.display=="block"){let n=l.getAttribute("style").replace(/font-size:(\s+)?.*?px/,`font-size: ${i.buttons.fontSize}px`).replace(/color:(\s+)?.*?;/,`color: ${i.buttons.color};`);l.setAttribute("style",n);let s=i.buttons.fontFamily;s[0]==="Safe Fonts"?(l.style.fontFamily=s[1],o.clearLinkTags({elem:document.head},S)):s[0]==="Google Fonts"&&(s[1]==="Sans Serif"?l.style.fontFamily="Helvetica, Arial, sans-serif":s[1]==="Serif"&&(l.style.fontFamily='"Times New Roman", Times, serif'),l.classList.remove(...[...l.classList].filter(a=>a.startsWith("em-font"))),l.classList.add(`em-font-${s[2].replace(/\s/g,"")}-${s[3].replace(/\s/g,"")}`),Se({fontFamilyArray:s}));let d=l.closest("td").getAttribute("style").replace(/background-color:(\s+)?.*?;/,`background-color: ${i.buttons.backgroundColor};`);l.closest("td").setAttribute("style",d),l.closest("td").setAttribute("align",i.buttons.textAlign);let m="";if(i.buttons.letterSpacing>0?m=l.style.letterSpacing?l.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${i.buttons.letterSpacing}px`):l.getAttribute("style")+` letter-spacing: ${i.buttons.letterSpacing}px;`:m=l.getAttribute("style").replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,""),l.setAttribute("style",m),i.buttons.bold?l.querySelector("b")?l.querySelector("b").replaceWith(...l.querySelector("b").childNodes):l.querySelector("strong")||(l.innerHTML="<strong>"+l.innerHTML+"</strong>"):l.querySelector("strong")?l.querySelector("strong").replaceWith(...l.querySelector("strong").childNodes):l.querySelector("b")&&l.querySelector("b").replaceWith(...l.querySelector("b").childNodes),l.style.fontWeight){let a=l.getAttribute("style").replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"");l.setAttribute("style",a)}if(i.buttons.italic?l.querySelector("i")?l.querySelector("i").replaceWith(...l.querySelector("i").childNodes):l.querySelector("em")||(l.innerHTML="<em>"+l.innerHTML+"</em>"):l.querySelector("em")?l.querySelector("em").replaceWith(...l.querySelector("em").childNodes):l.querySelector("i")&&l.querySelector("i").replaceWith(...l.querySelector("i").childNodes),l.style.fontStyle){let a=l.getAttribute("style").replace(/(\s+)?font-style:(\s+)?.*?;/,"");l.setAttribute("style",a)}if(l.closest('[em="atom"] > tbody > tr > td')&&l.closest('[em="atom"] > tbody > tr > td').style.paddingTop)l.closest('[em="atom"] > tbody > tr > td').style.paddingTop=i.buttons.marginTop+"px";else if(l.closest("table").previousElementSibling){let a=l.closest("table").previousElementSibling;a&&a.tagName=="TABLE"&&(a.classList.contains("em-vindent-table")||a.querySelector("td").innerHTML=="")&&a.querySelector("td").setAttribute("height",i.buttons.marginTop)}if(l.closest('[em="atom"] > tbody > tr > td')&&l.closest('[em="atom"] > tbody > tr > td').style.paddingBottom)l.closest('[em="atom"] > tbody > tr > td').style.paddingBottom=i.buttons.marginBottom+"px";else if(l.closest("table").previousElementSibling){let a=l.closest("table").nextElementSibling;a&&a.tagName=="TABLE"&&(a.classList.contains("em-vindent-table")||a.querySelector("td").innerHTML=="")&&a.querySelector("td").setAttribute("height",i.buttons.marginBottom)}i.buttons.padding.all&&(l.style.padding=i.buttons.padding.all+"px"),i.buttons.padding.top&&(l.style.paddingTop=i.buttons.padding.top+"px"),i.buttons.padding.right&&(l.style.paddingRight=i.buttons.padding.right+"px"),i.buttons.padding.bottom&&(l.style.paddingBottom=i.buttons.padding.bottom+"px"),i.buttons.padding.left&&(l.style.paddingLeft=i.buttons.padding.left+"px"),U({settings:{border:i.buttons.border},elem:l.closest("td")}),K({settings:{borderRadius:i.buttons.borderRadius},elem:l.closest("td")})}}else{let n=l.getAttribute("style").replace(/color:(\s+)?.*?;/,`color: ${i.links.color};`);l.setAttribute("style",n);let s="";i.links.underline?s=l.style.textDecoration?l.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: underline;"):l.getAttribute("style")+" text-decoration: underline;":s=l.style.textDecoration?l.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: none;"):l.getAttribute("style")+" text-decoration: none;",l.setAttribute("style",s)}}),t.querySelectorAll('[em="block"]')&&i.block?.backgroundColor&&t.querySelectorAll('[em="block"]').forEach(l=>{l.querySelectorAll(":scope > td").forEach(n=>{n.setAttribute("bgcolor",i.block.backgroundColor)})}),t.tagName=="DIV"?t.innerHTML:t.querySelector("tbody").innerHTML}var k=null,F=null,Ae=null;document.addEventListener("drag",function(e){e.preventDefault()},!1),document.addEventListener("dragstart",function(e){document.body.classList.contains("em-block-insert-body")||o.messageService.send({operation:"application_scroll-block-show"}),e.target.getAttribute("em")==="atom"&&(document.body.classList.add("em-atom-insert-body-inside"),Ae=e.target)},!1),document.addEventListener("dragover",function(e){if(e.preventDefault(),document.body.classList.contains("em-block-insert-body")){if(e.target.closest('[em="block"]')){k=e.target.closest('[em="block"]');let i=null;k.tagName==="TABLE"||k.tagName==="TR"?i=k.querySelector("[data-template-content]")??k.querySelector("td"):i=k;let t=i.getBoundingClientRect().top+i.getBoundingClientRect().height/2;i.classList.add("em-block-insert"),e.pageY>t?(i.classList.remove("em-block-insert_top","em-block-insert_top-document"),i.getBoundingClientRect().bottom>document.body.getBoundingClientRect().height-21?i.classList.add("em-block-insert_bottom-document"):i.classList.add("em-block-insert_bottom")):(i.classList.remove("em-block-insert_bottom","em-block-insert_bottom-document"),i.getBoundingClientRect().top<2?i.classList.add("em-block-insert_top-document"):i.classList.add("em-block-insert_top"))}}else if(document.body.classList.contains("em-atom-insert-body")&&e.target.closest('[em="atom"]')){k=e.target.closest('[em="atom"]');let i=k.getBoundingClientRect().top+k.getBoundingClientRect().height/2;k.classList.add("em-atom-insert"),e.pageY>i?(k.classList.remove("em-atom-insert_top","em-atom-insert_top-document"),k.getBoundingClientRect().bottom>document.body.getBoundingClientRect().height-21?k.classList.add("em-atom-insert_bottom-document"):k.classList.add("em-atom-insert_bottom")):(k.classList.remove("em-atom-insert_bottom","em-atom-insert_bottom-document"),k.getBoundingClientRect().top<2?k.classList.add("em-atom-insert_top-document"):k.classList.add("em-atom-insert_top"))}},!1),document.addEventListener("dragenter",function(e){document.body.classList.contains("em-block-insert-body")?(document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert-empty")}),e.target.closest('[em="block"]')?k=e.target.closest('[em="block"]'):e.target.tagName==="TABLE"&&!e.target.innerHTML?(e.target.classList.add("em-block-insert-empty"),document.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")})):document.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")})):(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside"))&&(document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert-empty")}),e.target.closest('[em="atom"]')?k=e.target.closest('[em="atom"]'):e.target.closest('[em="block"]')&&e.target.tagName==="TD"&&!e.target.innerHTML&&!e.target.hasAttribute("height")?(e.target.classList.add("em-atom-insert-empty"),document.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):document.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}))},!1),document.addEventListener("dragleave",function(e){document.body.classList.contains("em-block-insert-body")?(F=e.target.closest('[em="block"]'),F&&(e.target.closest('[em="block"]')&&(F!==k||F.closest('[em="group"]')!==k.closest('[em="group"]'))?F.tagName==="DIV"?F.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):F.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))):document.body.classList.contains("em-atom-insert-body")&&(F=e.target.closest('[em="atom"]'),F&&(e.target.getAttribute("em")==="atom"&&F!==k?F.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"):document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})))},!1),document.addEventListener("drop",function(e){try{if(o.state.increment("activeElementLocked"),e.preventDefault(),e.stopPropagation(),document.body.classList.contains("em-block-insert-body"))try{const i=document.querySelector('body>[em="block-contaner"]')||document.head;let t=JSON.parse(e.dataTransfer.getData("Text"));const l=o.parseFromString(t.settings.blockHTML);let n=l.filter(m=>m.tagName&&m.tagName!=="LINK"&&m.tagName!=="STYLE").map(m=>o.getOuterHtml(m)).join(""),s=l.filter(m=>m.tagName==="STYLE").map(m=>o.getOuterHtml(m)).join(""),d=l.filter(m=>m.tagName==="LINK"&&m.getAttribute("em-class")).filter(m=>!i?.querySelector(`link[em-class="${m.getAttribute("em-class")}"]`));if(s){let m=i.querySelector('style[em="styles"]'),a="";m?a=C.getInnerHtml(m):(m=document.createElement("style"),m.setAttribute("em","styles"),m=i.insertAdjacentElement("beforeend",m));let r=document.createElement("div");r.insertAdjacentHTML("afterbegin",s);let b=o.minifyStylesheet(a+`
|
|
140
|
-
`+[...r.querySelectorAll("style")].map(p=>p.innerHTML).join(`
|
|
141
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;b=cssbeautify(b,{indent:" ",autosemicolon:!0}),m.textContent=`
|
|
142
|
-
`+b+`
|
|
143
|
-
`}for(const m of d.reverse())i?.prepend(m),i?.insertAdjacentHTML("afterbegin",`
|
|
144
|
-
`);if(n.match(/class="em-countdown"/gi)&&(n=o.uptimeCountdown({blockHTML:n})),e.target.tagName==="TABLE"&&!e.target.innerHTML)n=Ze({blockHTML:n,targetBlock:e.target}),(n.indexOf("empty-structure")>-1||n.indexOf("em-structure")>-1)&&(n=Be({blockHTML:n,targetBlock:e.target,project:t.settings.project})),n.substring(0,3)==="<tr"?e.target.insertAdjacentHTML("beforeend",`
|
|
145
|
-
`+n+`
|
|
146
|
-
`):e.target.insertAdjacentHTML("beforeend",`
|
|
147
|
-
<tr><td align="center">
|
|
148
|
-
`+n+`
|
|
149
|
-
</td></tr>
|
|
150
|
-
`);else if(e.target.closest('[em="block"]')){let m=e.target.closest('[em="block"]'),a=null;m.tagName==="TABLE"||m.tagName=="TR"?a=m.querySelector("[data-template-content]")??m.querySelector("td"):a=m;let r="";if(n=Ze({blockHTML:n,targetBlock:m}),(n.indexOf("empty-structure")>-1||n.indexOf("em-structure")>-1)&&(n=Be({blockHTML:n,targetBlock:m,project:t.settings.project})),a.classList.contains("em-block-insert_bottom-document")||a.classList.contains("em-block-insert_bottom")?r="afterend":(a.classList.contains("em-block-insert_top-document")||a.classList.contains("em-block-insert_top"))&&(r="beforebegin"),m.tagName=="TR")if(n.substring(0,3)=="<tr"){let b=document.createElement("table");b.innerHTML=`
|
|
151
|
-
`+n+`
|
|
152
|
-
`,[...b.querySelectorAll(":scope> tbody > tr")].reverse().forEach(p=>m.insertAdjacentElement(r,p))}else{let b=document.createElement("table");b.innerHTML=`
|
|
153
|
-
<tr em="block"><td align="center">
|
|
154
|
-
`+n+`
|
|
155
|
-
</td></tr>
|
|
156
|
-
`,[...b.querySelectorAll(":scope> tbody > tr")].reverse().forEach(p=>m.insertAdjacentElement(r,p))}else if(n.substring(0,3)=="<tr")if(m.tagName=="TABLE"){let b=document.createElement("table");b.setAttribute("cellspacing","0"),b.setAttribute("cellpadding","0"),b.setAttribute("align","center"),b.setAttribute("border","0"),b.setAttribute("em","block"),b.classList.add("em-mob-width-100perc"),b.innerHTML=`
|
|
157
|
-
`+n+`
|
|
158
|
-
`,b.querySelectorAll('tr[em="block"]').forEach(p=>p.removeAttribute("em")),m.insertAdjacentElement(r,b)}else{let b=document.createElement("div");b.setAttribute("align","center"),b.setAttribute("em","block"),b.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
159
|
-
`+n+`
|
|
160
|
-
</table>`,b.querySelectorAll('tr[em="block"]').forEach(p=>p.removeAttribute("em")),m.insertAdjacentElement(r,b)}else m.insertAdjacentHTML(r,`
|
|
161
|
-
`+n+`
|
|
162
|
-
`);m.querySelectorAll(".em-block-insert").forEach(b=>{b.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")})}}catch{}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside")){let i=Ae,t={};try{e.dataTransfer.getData("Text")&&o.isJsonString(e.dataTransfer.getData("Text"))?t=JSON.parse(e.dataTransfer.getData("Text")):t={settings:{atomHTML:o.serializeOuterHtml(i)}};let l=t.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim(),n=t.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g);if(n){let s=document.head.querySelector('style[em="styles"]'),d="";s?d=C.getInnerHtml(s):(s=document.createElement("style"),s.setAttribute("em","styles"),s=document.head.insertAdjacentElement("beforeend",s));let m=document.createElement("div");m.insertAdjacentHTML("afterbegin",n);let a=o.minifyStylesheet(d+`
|
|
163
|
-
`+[...m.querySelectorAll("style")].map(r=>r.innerHTML).join(`
|
|
164
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;a=cssbeautify(a,{indent:" ",autosemicolon:!0}),s.textContent=`
|
|
165
|
-
`+a+`
|
|
166
|
-
`}if(l=Et({html:l}),e.target.closest('[em="block"]')&&e.target.tagName=="TD"&&!e.target.innerHTML&&!e.target.hasAttribute("height"))l.match(/em="atom"><tbody><tr><td>\s*<img/gi)&&!l.match(/class="em-countdown"/gi)&&(l=o.setImageWidth({atomHTML:l,targetAtom:e.target})),l.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:e.target,targetPlace:"beforeend",atomHTML:l},S):e.target.insertAdjacentHTML("beforeend",`
|
|
167
|
-
`+l+`
|
|
168
|
-
`),i!=null&&(e.target.closest(".empty-structure")||e.target.closest(".em-structure"))&&i.remove();else if(document.querySelector(".em-blockatom-insert")||e.target.tagName=="TABLE"&&!e.target.innerHTML){let s=document.querySelector(".em-blockatom-insert")?e.target.closest('[em="block"]'):e.target,d=null,m=document.querySelector(".em-blockatom-insert")?document.querySelector(".em-blockatom-insert"):document.querySelector(".em-block-insert-empty");l.match(/em="atom"><tbody><tr><td>\s*<img/gi)&&(l=o.setImageWidth({atomHTML:l,targetAtom:m}));let a="";l=='<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tbody><tr><td height="20"></td></tr></tbody></table>'?a=`
|
|
169
|
-
<tr em="block" class="em-structure">
|
|
170
|
-
<td align="center">
|
|
171
|
-
${l}
|
|
172
|
-
</td>
|
|
173
|
-
</tr>`:a=`
|
|
174
|
-
<style>
|
|
175
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
176
|
-
' +
|
|
177
|
-
.em-mob-wrap {
|
|
178
|
-
display: block!important;
|
|
179
|
-
}
|
|
180
|
-
.em-mob-width-100perc {
|
|
181
|
-
width: 100%!important;
|
|
182
|
-
max-width: 100%!important;
|
|
183
|
-
}
|
|
184
|
-
.em-mob-padding_right-20 {
|
|
185
|
-
padding-right: 20px!important;
|
|
186
|
-
}
|
|
187
|
-
.em-mob-padding_left-20 {
|
|
188
|
-
padding-left: 20px!important;
|
|
189
|
-
}
|
|
190
|
-
</style>
|
|
191
|
-
<tr em="block" class="em-structure">
|
|
192
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
193
|
-
<table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
194
|
-
<tr>
|
|
195
|
-
<td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
|
|
196
|
-
${l}
|
|
197
|
-
</td>
|
|
198
|
-
</tr>
|
|
199
|
-
</table>
|
|
200
|
-
</td>
|
|
201
|
-
</tr>`,s.tagName=="TABLE"||s.tagName=="TR"?d=s.querySelector("[data-template-content]")??s.querySelector("td"):d=s;let r="";if((a.indexOf("empty-structure")>-1||a.indexOf("em-structure")>-1)&&(a=Be({blockHTML:a,targetBlock:s,project:t.settings.project})),document.querySelector(".em-blockatom-insert")?d.classList.contains("em-block-insert_bottom-document")||d.classList.contains("em-block-insert_bottom")?r="afterend":(d.classList.contains("em-block-insert_top-document")||d.classList.contains("em-block-insert_top"))&&(r="beforebegin"):r="beforeend",s.tagName=="TR")if(a.substring(0,3)=="<tr")if(l.match(/class="em-countdown"/gi))o.insertCountdown({targetElem:s,targetPlace:r,atomHTML:a},S);else{let b=document.createElement("tr");b.setAttribute("em","block"),b.classList.add("em-structure"),b.innerHTML=`
|
|
202
|
-
`+a+`
|
|
203
|
-
`,s.insertAdjacentElement(r,b)}else if(l.match(/class="em-countdown"/gi))o.insertCountdown({targetElem:s,targetPlace:r,atomHTML:`<tr em="block"><td align="center">
|
|
204
|
-
`+a+`
|
|
205
|
-
</td></tr>`},S);else{let b=document.createElement("tr");b.setAttribute("em","block"),b.innerHTML=`
|
|
206
|
-
<td align="center">
|
|
207
|
-
`+a+`
|
|
208
|
-
</td>
|
|
209
|
-
`,s.insertAdjacentElement(r,b)}else a.substring(0,3)=="<tr"?s.tagName=="TABLE"?l.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:s,targetPlace:r,atomHTML:`<table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
210
|
-
`+a+`
|
|
211
|
-
</table>`},S):s.insertAdjacentHTML(r,`
|
|
212
|
-
<table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
213
|
-
`+a+`
|
|
214
|
-
</table>
|
|
215
|
-
`):l.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:s,targetPlace:r,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
216
|
-
`+a+`
|
|
217
|
-
</table></div>`},S):s.insertAdjacentHTML(r,`
|
|
218
|
-
<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
219
|
-
`+a+`
|
|
220
|
-
</table></div>
|
|
221
|
-
`):l.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:s,targetPlace:r,atomHTML:a},S):s.insertAdjacentHTML(r,`
|
|
222
|
-
`+a+`
|
|
223
|
-
`);document.querySelectorAll(".em-blockatom-insert").forEach(b=>{b.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")})}else if(e.target.closest('[em="atom"]')){let s=document.querySelector(".em-atom-insert"),d="";if(l.match(/em="atom"><tbody><tr><td>\s*<img/gi)&&(l=o.setImageWidth({atomHTML:l,targetAtom:s})),s){if(s.classList.contains("em-atom-insert_bottom-document")||s.classList.contains("em-atom-insert_bottom")?d="afterend":(s.classList.contains("em-atom-insert_top-document")||s.classList.contains("em-atom-insert_top"))&&(d="beforebegin"),s.tagName==="TR"){let m=document.createElement("div");m.innerHTML=l,m.querySelector('[em="atom"]').removeAttribute("em");let a=0;s.querySelector("[colspan]")?a=s.querySelector("[colspan]").getAttribute("colspan"):a=s.childElementCount,l.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:s,targetPlace:d,atomHTML:`
|
|
224
|
-
<tr em="atom"><td colspan="`+a+`">
|
|
225
|
-
`+m.innerHTML+`
|
|
226
|
-
</td></tr>
|
|
227
|
-
`},S):s.insertAdjacentHTML(d,`
|
|
228
|
-
<tr em="atom"><td colspan="`+a+`">
|
|
229
|
-
`+m.innerHTML+`
|
|
230
|
-
</td></tr>
|
|
231
|
-
`)}else l.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:s,targetPlace:d,atomHTML:l},S):s.insertAdjacentHTML(d,`
|
|
232
|
-
`+l+`
|
|
233
|
-
`);s.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}}}catch{}}return e.target.closest(".sortable-chosen")||e.target.querySelector(".sortable-chosen"),document.body.classList.remove("em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert-empty")}),document.body.classList.remove("em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert-empty")}),document.querySelectorAll(".sortable-chosen.sortable-ghost").forEach(i=>{i.classList.remove("sortable-chosen","sortable-ghost")}),S(),!1}finally{Promise.resolve().then(()=>{o.state.decrement("activeElementLocked"),document.querySelector(".em-just-inserted")&&(w({elem:document.querySelector(".em-just-inserted")}),document.querySelector(".em-just-inserted").classList.remove("em-just-inserted"),setTimeout(()=>{o.messageService.send({operation:"application_open-image-ai-popup"})},1e3))})}},!1),document.addEventListener("dragend",function(e){e.preventDefault(),o.messageService.send({operation:"application_scroll-block-hide"})},!1);function kt(e){V.whenEditorLostFocus(()=>{e.isConnected&&Tt(e,!0)})}function Tt(e){if(document.body&&!document.body.classList.contains("mceNonEditable")){if(e.tagName=="TD"&&e.innerHTML==""&&e.getAttribute("height")&&!e.classList.contains("em-vindent")&&!e.closest("editor")){e.classList.add("em-vindent"),e.closest("table").classList.add("em-vindent-table"),parseInt(e.getAttribute("height"))<30&&e.classList.add("em-vindent_low");let i=o.addElement({targetElement:e,insertType:"append",className:"em-element-resize-height"}),t=o.addElement({targetElement:e,insertType:"append",className:"em-element-vindent-remove",HTMLcontent:"×"}),l=o.addElement({targetElement:e,insertType:"append",className:"em-element-vindent"});o.addElement({targetElement:l,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.getAttribute("height")+"px"}),xe(i,function(s){Le(i,s.movementY)},function(){Ee(i)});let n=null;l.addEventListener("mouseenter",function(){n=setTimeout(()=>{l.classList.add("em-element-vindent-show-vars")},500)}),l.addEventListener("mouseleave",function(){l.classList.remove("em-element-vindent-show-vars"),clearTimeout(n)}),t.addEventListener("click",function(){const s=e.closest(".em-vindent-table");if(s){const d=s.previousSibling;d&&d?.textContent?.trim()===""&&d.remove()}e.closest(".em-vindent-table")?.remove(),S()})}if(e.tagName=="DIV"&&e.style.height&&e.style.fontSize&&!e.classList.contains("em-vindent")&&!e.closest("editor")&&e.style.height&&e.style.lineHeight&&!e.style.fontFamily){e.classList.add("em-vindent"),parseFloat(e.style.height)<30&&e.classList.add("em-vindent_low");let i=o.addElement({targetElement:e,insertType:"append",className:"em-element-resize-height"}),t=o.addElement({targetElement:e,insertType:"append",className:"em-element-vindent-remove",HTMLcontent:"×"}),l=o.addElement({targetElement:e,insertType:"append",className:"em-element-vindent"});o.addElement({targetElement:l,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),xe(i,function(s){Le(i,s.movementY)},function(){Ee(i)});let n=null;l.addEventListener("mouseenter",function(){n=setTimeout(()=>{l.classList.add("em-element-vindent-show-vars")},500)}),l.addEventListener("mouseleave",function(){l.classList.remove("em-element-vindent-show-vars"),clearTimeout(n)}),t.addEventListener("click",function(){e.remove(),S()})}if((e.style.padding||e.style.paddingTop||e.style.paddingBottom||e.style.paddingLeft||e.style.paddingRight)&&!e.closest("editor")&&(e.style.paddingTop&&!e.querySelector(":scope > .em-vindent-paddingTop")&&o.addElement({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`}),e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&o.addElement({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${e.style.paddingBottom}`}),e.style.paddingLeft&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&o.addElement({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${e.style.paddingLeft}`}),e.style.paddingRight&&!e.querySelector(":scope > .em-vindent-paddingRight")&&o.addElement({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(i=>{if(!i.querySelector(".em-element-resize-height")){(parseFloat(i.style.height)<30||parseFloat(i.style.width)<30)&&i.classList.add("em-vindent_low");let t=o.addElement({targetElement:i,insertType:"append",className:"em-element-resize-height"});o.addElement({targetElement:i,insertType:"append",className:"em-element-vindent-marker"});let l=o.addElement({targetElement:i,insertType:"append",className:"em-element-vindent"}),n="";i.className.indexOf("paddingTop")>-1?(n=e.style.paddingTop,xe(t,function(s){Le(t,s.movementY)},function(){Ee(t)})):i.className.indexOf("paddingBottom")>-1?(n=e.style.paddingBottom,xe(t,function(s){Le(t,s.movementY)},function(){Ee(t)})):i.className.indexOf("paddingLeft")>-1?(n=e.style.paddingLeft,Je(t,function(s){Pe(t,s.movementX)},function(){He(t)})):i.className.indexOf("paddingRight")>-1&&(n=e.style.paddingRight,Je(t,function(s){Pe(t,-s.movementX)},function(){He(t)})),o.addElement({targetElement:l,insertType:"append",className:"em-element-vindent-value",HTMLcontent:n})}})),e.querySelectorAll(".em-element-vindent-control > div").forEach(i=>{i.addEventListener("click",function(){let t=null;i.closest('div[style*="height"][style*="line-height"]')?(t=i.closest('div[style*="height"][style*="line-height"]'),t.style.height=i.innerHTML,t.style.lineHeight=i.innerHTML):i.closest(".em-vindent").classList.contains("em-vindent-paddingTop")?(t=i.closest(".em-vindent-paddingTop"),t.style.height=i.innerHTML,t.closest(".em-vindent-paddingTop").parentElement.style.paddingTop=i.innerHTML):i.closest(".em-vindent").classList.contains("em-vindent-paddingBottom")?(t=i.closest(".em-vindent-paddingBottom"),t.style.height=i.innerHTML,t.closest(".em-vindent-paddingBottom").parentElement.style.paddingBottom=i.innerHTML):i.closest(".em-vindent").classList.contains("em-vindent-paddingLeft")?(t=i.closest(".em-vindent-paddingLeft"),t.style.width=i.innerHTML,t.closest(".em-vindent-paddingLeft").parentElement.style.paddingLeft=i.innerHTML):i.closest(".em-vindent").classList.contains("em-vindent-paddingRight")?(t=i.closest(".em-vindent-paddingRight"),t.style.width=i.innerHTML,t.closest(".em-vindent-paddingRight").parentElement.style.paddingRight=i.innerHTML):(t=i.closest("td"),t.setAttribute("height",parseInt(i.innerHTML))),parseInt(i.innerHTML)<30?t.classList.add("em-vindent_low"):t.classList.remove("em-vindent_low"),t.querySelector(".em-element-vindent-value").innerHTML=i.innerHTML,S(),setTimeout(()=>{N(t)})})}),e.tagName=="IMG"){if(e.closest(".em-element-resize-img-container")||e.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||e.closest("editor")||e.classList.contains("em-video"))return;let i=document.createElement("span");i.classList.add("em-element-resize-img-container");const t=e.parentElement instanceof HTMLAnchorElement?e.parentElement:e;t.parentElement?.insertBefore(i,t),i.appendChild(t);let l=o.addElement({targetElement:i,insertType:"append",tag:"span",className:"em-element-resize-img"});wt(l,function(n){Pe(l,n.movementX)},function(){He(l)}),e?.style.maxWidth&&e?.style.display=="block"&&e.closest(".em-element-resize-img-container").classList.add("em-display-block"),o.implementImageControls(e,i)}}}function Ce(e,i,t,l){var n=e;n.style.cursor=t,n.mousemove=i,n.onmousedown=function(s){w({elem:e});const d=document.querySelector("[em-edit]");d&&N(d),document.documentElement.classList.add("em-resize-start");try{document.documentElement.addEventListener("mousemove",n.doDrag,!1),document.documentElement.addEventListener("mouseup",n.stopDrag,!1)}catch{}},n.doDrag=function(s){if(s.which!=1){n.stopDrag(s);return}n.mousemove(s)},n.stopDrag=function(s){document.documentElement.removeEventListener("mousemove",n.doDrag,!1),document.documentElement.removeEventListener("mouseup",n.stopDrag,!1),l&&l(),setTimeout(()=>{document.documentElement.classList.remove("em-resize-start"),S(!1)})}}function xe(e,i,t){Ce(e,i,"n-resize",t)}function Je(e,i,t){Ce(e,i,"w-resize",t)}function wt(e,i,t){Ce(e,i,"nw-resize",t)}function Le(e,i){let t=null,l=0;e.closest('div[style*="height"][style*="line-height"]')?(t=e.closest('div[style*="height"][style*="line-height"]'),l=t.clientHeight+i,t.style.height=l+"px",t.style.lineHeight=l+"px"):e.closest(".em-vindent").classList.contains("em-vindent-paddingTop")?(t=e.closest(".em-vindent-paddingTop"),t.classList.add("em-hover"),l=t.clientHeight+i,t.style.height=l+"px",t.closest(".em-vindent-paddingTop").parentElement.style.paddingTop=l+"px"):e.closest(".em-vindent").classList.contains("em-vindent-paddingBottom")?(t=e.closest(".em-vindent-paddingBottom"),t.classList.add("em-hover"),l=t.clientHeight+i,t.style.height=l+"px",t.closest(".em-vindent-paddingBottom").parentElement.style.paddingBottom=l+"px"):(t=e.closest("td"),l=t.clientHeight+i,t.setAttribute("height",l)),l>=0&&(t.querySelector(".em-element-vindent-value").innerHTML=l+"px"),l<30?t.classList.add("em-vindent_low"):t.classList.remove("em-vindent_low"),t&&S()}function Ee(e){let i=null;e.closest('div[style*="height"][style*="line-height"]')?(i=e.closest('div[style*="height"][style*="line-height"]'),parseInt(i.style.height)<=0?i.remove():w({elem:i})):e.closest(".em-vindent").classList.contains("em-vindent-paddingTop")?(i=e.closest(".em-vindent-paddingTop"),i.classList.remove("em-hover"),parseInt(i.style.height)<=0?i.closest(".em-vindent-paddingTop").parentElement.style.removeProperty("padding-top"):w({elem:i.closest(".em-vindent-paddingTop").parentElement})):e.closest(".em-vindent").classList.contains("em-vindent-paddingBottom")?(i=e.closest(".em-vindent-paddingBottom"),i.classList.remove("em-hover"),parseInt(i.style.height)<=0?i.closest(".em-vindent-paddingBottom").parentElement.style.removeProperty("padding-bottom"):w({elem:i.closest(".em-vindent-paddingBottom").parentElement})):(i=e.closest("td"),i.getAttribute("height")<=0?i.closest("table").remove():w({elem:i})),i&&S()}function Pe(e,i){let t=null,l=0;if(e.closest(".em-element-resize-img-container")){let n=e.closest(".em-element-resize-img-container").querySelector("img"),s=n.clientWidth+i;n.style.maxWidth=s+"px",n.setAttribute("width",s),S()}else e.closest(".em-vindent").classList.contains("em-vindent-paddingLeft")?(t=e.closest(".em-vindent-paddingLeft"),t.classList.add("em-hover"),l=t.clientWidth+i,t.style.width=l+"px",t.closest(".em-vindent-paddingLeft").parentElement.style.paddingLeft=l+"px",l>=0&&(t.querySelector(".em-element-vindent-value").innerHTML=l+"px"),l<30?t.classList.add("em-vindent_low"):t.classList.remove("em-vindent_low"),t.closest(".em-vindent-paddingLeft").parentElement.querySelectorAll(":scope > table").forEach(n=>setStructureBlocksWidth(n))):e.closest(".em-vindent").classList.contains("em-vindent-paddingRight")&&(t=e.closest(".em-vindent-paddingRight"),t.classList.add("em-hover"),l=t.clientWidth+i,t.style.width=l+"px",t.closest(".em-vindent-paddingRight").parentElement.style.paddingRight=l+"px",l>=0&&(t.querySelector(".em-element-vindent-value").innerHTML=l+"px"),l<30?t.classList.add("em-vindent_low"):t.classList.remove("em-vindent_low"),t.closest(".em-vindent-paddingRight").parentElement.querySelectorAll(":scope > table").forEach(n=>setStructureBlocksWidth(n)));t&&S()}function He(e){let i=null;if(e.closest(".em-element-resize-img-container")){let t=e.closest(".em-element-resize-img-container").querySelector("img");w({elem:t}),t&&S()}else e.closest(".em-vindent").classList.contains("em-vindent-paddingLeft")?(i=e.closest(".em-vindent-paddingLeft"),parseInt(i.style.width)<=0?i.closest(".em-vindent-paddingLeft").parentElement.style.removeProperty("padding-left"):w({elem:i.closest(".em-vindent-paddingLeft").parentElement}),i.classList.remove("em-hover")):e.closest(".em-vindent").classList.contains("em-vindent-paddingRight")&&(i=e.closest(".em-vindent-paddingRight"),i.classList.remove("em-hover"),parseInt(i.style.width)<=0?i.closest(".em-vindent-paddingRight").parentElement.style.removeProperty("padding-right"):w({elem:i.closest(".em-vindent-paddingRight").parentElement}));i&&S()}document.addEventListener("paste",function(e){e.preventDefault();const i=(e.clipboardData||window.clipboardData).getData("text");document.execCommand("insertHTML",!1,i),S(!0)})});
|