easy-email-pro-migrations 1.59.8 → 1.59.10

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/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var _e=Object.defineProperty,Ae=Object.defineProperties;var ke=Object.getOwnPropertyDescriptors;var Ut=Object.getOwnPropertySymbols;var xe=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable;var jt=(t,n,e)=>n in t?_e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,N=(t,n)=>{for(var e in n||(n={}))xe.call(n,e)&&jt(t,e,n[e]);if(Ut)for(var e of Ut(n))Se.call(n,e)&&jt(t,e,n[e]);return t},W=(t,n)=>Ae(t,ke(n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Te=require("he"),St={PAGE:"page",SECTION:"section",COLUMN:"column",GROUP:"group",TEXT:"text",IMAGE:"image",DIVIDER:"divider",SPACER:"spacer",BUTTON:"button",WRAPPER:"wrapper",RAW:"raw",HERO:"hero",CAROUSEL:"carousel",NAVBAR:"navbar",NAVBAR_LINK:"navbar-link",SOCIAL:"social",SOCIAL_ELEMENT:"social-element",MERGETAG:"mergetag",LINE_BREAK:"line-break",PLACEHOLDER:"placeholder",TABLE:"table",DANGEROUS_CODE:"dangerous-code",HTML_NODE:"html-node",HTML_BLOCK_NODE:"html-block-node",HTML_DOM_NODE:"html-dom-node",CONTENT_WIDGET:"content_widget",SECTION_WIDGET:"section_widget",WRAPPER_WIDGET:"wrapper_widget",PAGE_HEADER:"page-header",PAGE_FOOTER:"page-footer"},we={STANDARD_HERO:"standard-hero",STANDARD_WRAPPER:"standard-wrapper",STANDARD_SECTION:"standard-section",STANDARD_GROUP:"standard-group",STANDARD_COLUMN:"standard-column",STANDARD_IMAGE:"standard-image",STANDARD_DIVIDER:"standard-divider",STANDARD_SPACER:"standard-spacer",STANDARD_NAVBAR:"standard-navbar",STANDARD_NAVBAR_LINK:"standard-navbar-link",STANDARD_SOCIAL:"standard-social",STANDARD_SOCIAL_ELEMENT:"standard-social-element",STANDARD_BUTTON:"standard-button",STANDARD_TEXT:"standard-text",STANDARD_PARAGRAPH:"standard-paragraph",STANDARD_H1:"standard-h1",STANDARD_H2:"standard-h2",STANDARD_H3:"standard-h3",STANDARD_H4:"standard-h4",STANDARD_TABLE:"standard-table",STANDARD_TEXT_LIST:"standard-text-list",STANDARD_TEXT_LIST_ITEM:"standard-text-list-item",STANDARD_BLOCK_QUOTE:"standard-blockquote",STANDARD_TABLE2:"standard-table2",STANDARD_TABLE2_TR:"standard-table2-tr",STANDARD_TABLE2_TD:"standard-table2-td"},De={FOR_EACH:"logic-for-each",SHOW:"logic-show"},y=N(N(N({},St),we),De),oe={PAGE:"page",RAW:"raw",HERO:"hero",WRAPPER:"wrapper",SECTION:"section",COLUMN:"column",GROUP:"group",TEXT:"text",TABLE:"table",BUTTON:"button",IMAGE:"image",DIVIDER:"divider",NAVBAR:"navbar",NAVBAR_LINK:"navbar-link",SOCIAL:"social",SOCIAL_ELEMENT:"social-element",SPACER:"spacer",TEXT_LIST:"text-list",TEXT_LIST_ITEM:"text-list-item",INLINE_TEXT:"inline-text",BLOCK_NODE:"block-node",DANGEROUS_CODE:"dangerous_code",UNKNOWN_CONTENT:"unknown-content ",AMP_BLOCK:"amp-block",UNSET:"unset",UNSET_RENDER:"unset-render",TABLE2_TR:"table2-tr",TABLE2_TD:"table2-td",PAGE_HEADER:"page-header",PAGE_FOOTER:"page-footer"};function wt(t){if(!t||typeof t!="string")return null;const n=t.trim().split(/\s+/).filter(Boolean);if(n.length===0)return null;let e,o,i,r;return n.length===1?e=o=i=r=n[0]:n.length===2?(e=i=n[0],o=r=n[1]):n.length===3?(e=n[0],o=r=n[1],i=n[2]):(e=n[0],o=n[1],i=n[2],r=n[3]),{top:e,right:o,bottom:i,left:r}}function J(t,n="padding"){const e=t[n];if(!e)return t;const o=wt(e);if(!o)return delete t[n],t;const i={top:`${n}-top`,right:`${n}-right`,bottom:`${n}-bottom`,left:`${n}-left`};return t[i.top]==null&&(t[i.top]=o.top),t[i.right]==null&&(t[i.right]=o.right),t[i.bottom]==null&&(t[i.bottom]=o.bottom),t[i.left]==null&&(t[i.left]=o.left),delete t[n],t}function ie(t){return Te.decode(t)}function Re(t){var i,r,a;const n={},e=/([a-zA-Z_:][-\w:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g;let o;for(;(o=e.exec(t))!==null;)n[o[1].toLowerCase()]=ie((a=(r=(i=o[2])!=null?i:o[3])!=null?r:o[4])!=null?a:"");return n}function Ee(t){const n={};return t.split(";").forEach(e=>{const o=e.indexOf(":");if(o<0)return;const i=e.slice(0,o).trim().toLowerCase(),r=e.slice(o+1).trim();r&&(i==="color"?n.color=r:i==="font-size"?n.fontSize=r:i==="font-family"?n.fontFamily=r:i==="line-height"?n.lineHeight=r:i==="font-weight"&&/^(bold|[6-9]\d{2})$/.test(r)?n.bold=!0:i==="font-style"&&r==="italic"?n.italic=!0:i==="text-decoration"&&/underline/.test(r)?n.underline=!0:i==="text-decoration"&&/line-through/.test(r)&&(n.strikethrough=!0))}),n}const Ce=new Set(["br","img","hr","input","meta","link"]),Vt=new Set(["p","div","h1","h2","h3","h4","h5","h6","li"]),Kt=/%%([A-Za-z0-9_.-]+)%%|{{\s*([A-Za-z0-9_.-]+)\s*}}/g;function Ne(t){const n=[],e=/<!--[\s\S]*?-->|<\/([a-zA-Z][\w-]*)\s*>|<([a-zA-Z][\w-]*)([^>]*?)\/?\s*>/g;let o=0,i;for(;(i=e.exec(t))!==null;)if(i.index>o&&n.push({kind:"text",text:t.slice(o,i.index)}),o=i.index+i[0].length,!i[0].startsWith("<!--")){if(i[1])n.push({kind:"close",name:i[1].toLowerCase()});else if(i[2]){const r=i[2].toLowerCase(),a=Re(i[3]||""),l=i[0].endsWith("/>")||Ce.has(r);n.push({kind:"open",name:r,attrs:a,selfClose:l})}}return o<t.length&&n.push({kind:"text",text:t.slice(o)}),n}function j(t){if(!t)return[{text:""}];const n=Ne(t),e=[{}],o=[];let i=0;const r=()=>e[e.length-1],a=g=>{const b=r();return b.bold&&(g.bold=!0),b.italic&&(g.italic=!0),b.underline&&(g.underline=!0),b.strikethrough&&(g.strikethrough=!0),b.color&&(g.color=b.color),b.fontSize&&(g.fontSize=b.fontSize),b.fontFamily&&(g.fontFamily=b.fontFamily),b.lineHeight&&(g.lineHeight=b.lineHeight),b.link&&(g.link={href:b.link.href,blank:b.link.blank}),g},l=g=>{g&&o.push(a({text:g}))},d=g=>{o.push({type:St.MERGETAG,data:{},attributes:{},children:[a({text:g})]})},s=g=>{if(!g)return;Kt.lastIndex=0;let b=0,f;for(;(f=Kt.exec(g))!==null;)l(g.slice(b,f.index)),d(f[1]||f[2]),b=f.index+f[0].length;l(g.slice(b))},c=()=>{o.push({type:St.LINE_BREAK,data:{},attributes:{},children:[{text:""}]})},u=()=>{const g=o[o.length-1];return!!g&&"type"in g&&g.type===St.LINE_BREAK},p=()=>{if(i>0&&o.length>0)for(let g=0;g<i;g++)c();i=0},h=g=>!!g&&g.kind==="open"&&!g.selfClose&&!Vt.has(g.name);for(let g=0;g<n.length;g++){const b=n[g];if(b.kind==="text"){const f=ie(b.text);if(i>0&&!f.trim())continue;let _=f.replace(/\s+/g," ");if(!_)continue;_.endsWith(" ")&&h(n[g+1])&&(_+="​"),p(),s(_)}else if(b.kind==="open"){const{name:f,attrs:_,selfClose:S}=b;if(f==="br"){p(),c();continue}const k=W(N({},r()),{tag:f});if(f==="strong"||f==="b"?k.bold=!0:f==="em"||f==="i"?k.italic=!0:f==="u"?k.underline=!0:f==="s"||f==="strike"||f==="del"?k.strikethrough=!0:f==="a"&&_.href&&(k.link={href:_.href,blank:(_.target||"").toLowerCase()==="_blank"}),_.style&&Object.assign(k,Ee(_.style)),S)continue;e.push(k)}else{const f=e.findLastIndex(_=>_.tag===b.name);f>0&&(e.splice(f),Vt.has(b.name)&&!u()&&(i+=1))}}return o.length===0?[{text:""}]:o}function $e(t,n={}){var g,b,f,_;const e=[],o=Le(t,(g=n.pageIndex)!=null?g:0);if(!o)throw new Error("unlayerToEasyEmailPro: could not find a design with body.rows in the input");const i=o.body,r=(i==null?void 0:i.values)||{},a=typeof r.contentWidth=="number"?r.contentWidth:parseInt(String(r.contentWidth||""),10)||600,l=`${a}px`,d={};(b=r.fontFamily)!=null&&b.value&&(d["font-family"]=r.fontFamily.value);const s={};r.textColor&&(s[oe.TEXT]={color:r.textColor});const c=en(i,r.fontFamily),u=480,p=((i==null?void 0:i.rows)||[]).flatMap(S=>{var k,x;return Oe(S,{contentWidthPx:a,columnPxWidth:a,bodyLinkColor:((k=r.linkStyle)==null?void 0:k.linkColor)||"",bodyFontFamily:((x=r.fontFamily)==null?void 0:x.value)||"",templateUsesFullWidth:Pe((i==null?void 0:i.rows)||[],a),warnings:e})});return{page:{type:y.PAGE,data:N({breakpoint:`${u}px`,globalAttributes:d,categoryAttributes:s,blockAttributes:{},classAttributes:{},preheader:r.preheaderText||""},c.length>0?{fonts:c}:{}),attributes:M({width:l,"background-color":r.backgroundColor||"","content-background-color":"","margin-top":"0px","margin-bottom":"0px","link-color":((f=r.linkStyle)==null?void 0:f.linkColor)||"","link-text-decoration":(_=r.linkStyle)!=null&&_.linkUnderline?"underline":""}),children:p},warnings:e}}function Pe(t,n){for(const e of t){const i=((e==null?void 0:e.values)||{}).backgroundImage;if((i==null?void 0:i.fullWidth)===!0&&typeof i.width=="number"&&i.width>n)return!0}return!1}function Le(t,n){var e,o,i,r,a,l,d,s,c,u,p;if(!t)return null;if((e=t.body)!=null&&e.rows)return t;if((i=(o=t.design)==null?void 0:o.body)!=null&&i.rows)return t.design;if(Array.isArray(t.templates)&&t.templates.length>0){const h=t.templates[0],g=((r=h.StockTemplatePages)==null?void 0:r[n])||((a=h.StockTemplatePages)==null?void 0:a[0]);if((d=(l=g==null?void 0:g.design)==null?void 0:l.body)!=null&&d.rows)return g.design;if((c=(s=h.design)==null?void 0:s.body)!=null&&c.rows)return h.design}if(Array.isArray(t.StockTemplatePages)){const h=t.StockTemplatePages[n]||t.StockTemplatePages[0];if((p=(u=h==null?void 0:h.design)==null?void 0:u.body)!=null&&p.rows)return h.design}return null}function Oe(t,n){var u;const e=t.values||{};if(lt(e)==="hidden")return[];const o=(u=wt(e.padding))!=null?u:{top:"0px",right:"0px",bottom:"0px",left:"0px"},i=te(o.top),r=te(o.bottom),a=!!e.backgroundColor,d=!!(Dt(t.columns||[])||e.columnsBackgroundColor),s=!a&&d&&(!i||!r);if(dn(t))return Pt([sn(t,n,o)],e);if(ln(t),!s)return Pt([Xt(t,n,o,!0)],e);const c=[];return i||c.push(Zt({top:o.top,right:o.right,bottom:"0px",left:o.left},n)),c.push(Xt(t,n,{top:"0px",right:o.right,bottom:"0px",left:o.left},!0)),r||c.push(Zt({top:"0px",right:o.right,bottom:o.bottom,left:o.left},n)),Pt(c,e)}function Xt(t,n,e,o){var A,w,D,E;const i=t.values||{},r=t.cells||[1],a=r.reduce((P,C)=>P+Number(C||0),0)||1,l=o?Dt(t.columns||[]):"",d=o&&!l?an(t.columns||[]):"",s=l||d||i.columnsBackgroundColor||"",c=l||d||i.backgroundColor||s||"",u=o&&!i.backgroundColor&&(!!l||!!d||ce(t.columns||[])),p={"background-color":c,"padding-top":e.top,"padding-right":e.right,"padding-bottom":e.bottom,"padding-left":e.left};Wt(p);const h=(t.columns||[]).map(P=>{var $;const C=(($=P.values)==null?void 0:$.border)||{};return H(C.borderLeftWidth)+H(C.borderRightWidth)});if(o){const P=nn(t.columns||[]);Object.assign(p,P);const C=on(t.columns||[]);Object.assign(p,C)}const g=i.backgroundImage;!!(g!=null&&g.url)&&(Object.assign(p,ne(g)),p["background-image-enabled"]=!0),n.templateUsesFullWidth&&!u&&(p["full-width"]="full-width");const f=tt(i._override);p["border-left"]&&(f["border-left"]="0px solid transparent"),p["border-right"]&&(f["border-right"]="0px solid transparent");const _=(w=(A=i._override)==null?void 0:A.mobile)==null?void 0:w.backgroundImage;_!=null&&_.url&&_.url!==(g==null?void 0:g.url)&&(Object.assign(f,ne(_)),f["background-image-enabled"]=!0);const S=Qe(i.alignItems),k=(t.columns||[]).map((P,C)=>{var Y;const $=Number((Y=r[C])!=null?Y:1)/a,L=Ye($),F=Math.max(1,Math.round(n.contentWidthPx*$)-(h[C]||0)),U=Ie(P,L,W(N({},n),{columnPxWidth:F}));return U&&S&&(U.attributes=W(N({},U.attributes),{"vertical-align":S})),U}).filter(P=>P!=null),x=!!((E=(D=i._override)==null?void 0:D.mobile)!=null&&E.noStackMobile),T=k.length>0?x&&k.length>1?[B({type:y.STANDARD_GROUP,data:{},attributes:{width:"100%"},children:k})]:k:[qe()];return B({type:y.STANDARD_SECTION,data:{},attributes:M(p),mobileAttributes:M(f),children:T})}function Zt(t,n){const e={"background-color":"","padding-top":t.top,"padding-right":t.right,"padding-bottom":t.bottom,"padding-left":t.left};Wt(e),n.templateUsesFullWidth&&(e["full-width"]="full-width");const o=B({type:y.STANDARD_PARAGRAPH,data:{},attributes:{"padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",padding:"0px 0px 0px 0px","font-size":"0px","line-height":"0"},children:[{text:""}]}),i=B({type:y.STANDARD_COLUMN,data:{},attributes:{width:"100%","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},children:[o]});return B({type:y.STANDARD_SECTION,data:{},attributes:M(e),children:[i]})}function Ie(t,n,e){var l,d;const o=t.values||{};if(lt(o)==="hidden")return null;const i={width:n,"background-color":o.backgroundColor||"","border-radius":o.borderRadius||""};J(Object.assign(i,un(o))),Object.assign(i,ee(o.border));const r=tt(o._override);Object.assign(r,ee((d=(l=o._override)==null?void 0:l.mobile)==null?void 0:d.border,{includeZero:!0}));let a=(t.contents||[]).map(s=>re(s,e)).filter(s=>s!=null);return a.length===0&&(a=[yt()]),Rt(B({type:y.STANDARD_COLUMN,data:{},attributes:M(i),mobileAttributes:M(r),children:a}),o)}function re(t,n){const e=t.values||{};if(lt(e)==="hidden")return null;let o;switch(t.type){case"heading":o=He(e,n);break;case"text":o=ae(e,n);break;case"paragraph":o=ze(e,n);break;case"image":o=le(e,n);break;case"button":o=Ge(e,n);break;case"divider":o=Ue(e);break;case"menu":o=je(e,n);break;case"social":o=Ve(e);break;case"timer":throw new Error("Unlayer countdown/timer block is not supported — skip this template");case"html":o=Ze(e);break;default:return n.warnings.push(`Unsupported block type "${t.type}" — skipped`),null}return Rt(o,e)}function Mt(t,n){const e=t==null?void 0:t.linkStyle;return e&&e.inherit===!1&&e.linkColor?e.linkColor:n.bodyLinkColor}function Ot(t,n){return n?t.map(e=>"text"in e&&e.link&&!e.color?W(N({},e),{color:n}):e):t}function Ht(t,n){const e=Me(t),o={align:t.textAlign||"",color:t.color||"","font-family":zt(t.fontFamily,n),"font-size":t.fontSize||"","line-height":e||t.lineHeight||"","letter-spacing":t.letterSpacing||"","container-background-color":""};return J(Object.assign(o,ft(t))),o}function zt(t,n){const e=(t==null?void 0:t.value)||"";return e?e.trim().toLowerCase()==="inherit"?n.bodyFontFamily||"":e:""}const Be=/<(?:span|strong|em|b|i)\b[^>]*\bstyle\s*=\s*"[^"]*\bline-height\s*:\s*([^;"]+)/i;function Me(t){const n=t.text;if(!n)return"";const e=Be.exec(n);if(!e)return"";const o=e[1].trim(),i=H(t.fontSize);if(!i)return"";const r=qt(o,i),a=qt(t.lineHeight,i);return r==null||a!=null&&r<=a?"":o}function qt(t,n){if(t==null||t==="")return null;const e=String(t).trim();if(e.endsWith("%")){const i=parseFloat(e);return Number.isFinite(i)?i/100*n:null}if(e.endsWith("px")){const i=parseFloat(e);return Number.isFinite(i)?i:null}const o=parseFloat(e);return Number.isFinite(o)?o*n:null}function He(t,n){const e=Je(t.headingType),o=Ht(t,n);return t.fontWeight==null&&!o["font-weight"]&&(o["font-weight"]="400"),B({type:e,data:{},attributes:M(o),mobileAttributes:M(tt(t._override,{padding:!0})),children:Ot(j(t.text),Mt(t,n))})}function ae(t,n){const e=Ht(t,n),o=pe(t.text||"",Mt(t,n));return B({type:y.STANDARD_PARAGRAPH,data:{},attributes:M(e),mobileAttributes:M(tt(t._override,{padding:!0})),children:o.length>0?o:[{text:""}]})}function ze(t,n){const e=We(t.textJson);return ae(W(N({},t),{text:e}),n)}function We(t){if(!t)return"";let n;try{n=typeof t=="string"?JSON.parse(t):t}catch(o){return""}const e=n==null?void 0:n.root;return!e||!Array.isArray(e.children)?"":Tt(e.children)}function Tt(t){return t.map(ve).join("")}function ve(t){var e,o,i,r,a,l;if(!t)return"";switch(t.type){case"paragraph":return`<p>${Tt(t.children||[])||"&nbsp;"}</p>`;case"extended-link":case"link":{const d=t.url||((e=t.values)==null?void 0:e.href)||((o=t.attrs)==null?void 0:o.href)||"",s=t.target||((i=t.values)==null?void 0:i.target)||((r=t.attrs)==null?void 0:r.target)||"",c=Tt(t.children||[]),u=[`href="${Yt(d)}"`];return s&&u.push(`target="${Yt(s)}"`),`<a ${u.join(" ")}>${c}</a>`}case"extended-text":case"text":{const d=Jt(String((a=t.text)!=null?a:""));return Fe(d,Number(t.format||0))}case"merge_tag":{const d=t.text||((l=t.properties)==null?void 0:l.value)||t.value||"";return Jt(String(d))}case"linebreak":return"<br>";default:return Array.isArray(t.children)?Tt(t.children):""}}function Fe(t,n){return n&&(n&1&&(t=`<strong>${t}</strong>`),n&2&&(t=`<em>${t}</em>`),n&4&&(t=`<s>${t}</s>`),n&8&&(t=`<u>${t}</u>`)),t}function Jt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Yt(t){return String(t).replace(/"/g,"&quot;")}function le(t,n){var _,S,k,x,T,A,w,D,E,P,C,$,L,F,U,Y,dt,st,At;const e=((_=t.src)==null?void 0:_.url)||"",o=t.action||{},i={src:e,alt:t.altText||"",title:t.title||"",href:((S=o.values)==null?void 0:S.href)||"",target:((k=o.values)==null?void 0:k.target)||"",align:t.textAlign||"center"};J(Object.assign(i,ft(t)));const r=typeof((x=t.src)==null?void 0:x.height)=="number"?t.src.height:0,a=typeof((T=t.src)==null?void 0:T.width)=="number"?t.src.width:0;if(r>0&&r<=5&&a>0&&a/r>=50){const Z=H((A=i["padding-bottom"])!=null?A:"0px");i["padding-bottom"]=`${Z+16}px`}const l=H(i["padding-left"])+H(i["padding-right"]),d=Math.max(1,n.columnPxWidth-l),s=(w=t.src)==null?void 0:w.maxWidth;s?i.width=It(s,d):typeof((D=t.src)==null?void 0:D.width)=="number"&&(i.width=`${Math.min(t.src.width,d)}px`),Qt(e)&&(i.height=(E=t.src)!=null&&E.height?se(t.src.height,(P=t.src)==null?void 0:P.width,i.width):"18px");const c=typeof((C=t.src)==null?void 0:C.width)=="number"?t.src.width:void 0,u=H(i.width),p=hn(t._override,c,u||void 0,typeof(($=t.src)==null?void 0:$.maxWidth)=="string"?t.src.maxWidth:void 0,{brokenImage:Qt(e),srcNativeHeight:typeof((L=t.src)==null?void 0:L.height)=="number"?t.src.height:void 0,desktopPaddingLeft:H(i["padding-left"]),desktopPaddingRight:H(i["padding-right"]),align:t.textAlign||"center"}),h=(dt=(Y=(U=(F=t._override)==null?void 0:F.mobile)==null?void 0:U.src)==null?void 0:Y.maxWidth)!=null?dt:s,g=h==="0%"||h==="0"||h===0,b=et=>{if(!et)return!1;const Z=String(et).trim();return Z!=="0"&&Z!=="0px"&&Z!=="0 0 0 0"},f=b(p["padding-top"])||b(p["padding-bottom"])||b(p.padding);if(g&&!f&&(p["padding-top"]="8px",p["padding-bottom"]="9px"),u&&p["fluid-on-mobile"]!=="true"){const et=H(i["padding-left"]),Z=H(i["padding-right"]),kt=Math.max(1,n.columnPxWidth-et-Z),ht=Math.min(u,kt),ct=p["padding-left"],pt=p["padding-right"],gt=ct!=null&&ct!==""?H(String(ct)):et,z=pt!=null&&pt!==""?H(String(pt)):Z;if(n.columnPxWidth-gt-z<ht){const V=Math.max(0,n.columnPxWidth-ht),ut=gt+z;if(ut>0&&V<ut){const Ct=V/ut,Nt=Math.round(gt*Ct),Gt=V-Nt;if(p["padding-left"]=`${Nt}px`,p["padding-right"]=`${Gt}px`,p.padding){const me=H(String((st=p["padding-top"])!=null?st:0)),ye=H(String((At=p["padding-bottom"])!=null?At:0));p.padding=`${me}px ${Gt}px ${ye}px ${Nt}px`}}}}return B({type:y.STANDARD_IMAGE,data:{},attributes:M(i),mobileAttributes:M(p),children:[{text:""}]})}function Ge(t,n){var a,l;const e=t.href||{},o=t.buttonColors||{},i={align:t.textAlign||"center",href:((a=e.values)==null?void 0:a.href)||"",target:((l=e.values)==null?void 0:l.target)||"",color:o.color||"","background-color":o.backgroundColor||"","font-size":t.fontSize||"","font-family":zt(t.fontFamily,n),"line-height":t.lineHeight||"","border-radius":t.borderRadius||"",width:de(t.size)};J(Object.assign(i,ft(t))),J(Object.assign(i,{"inner-padding":t.padding}),"inner-padding");const r=ge(t.border);return r.width&&(i["border-enabled"]=!0,i["border-width"]=r.width,i["border-style"]=r.style,i["border-color"]=r.color),B({type:y.STANDARD_BUTTON,data:{},attributes:M(i),mobileAttributes:M(bn(t._override)),children:j(t.text)})}function Ue(t){const n=ge(t.border,"borderTop"),e={width:t.width||"100%",align:t.textAlign||"center","border-color":n.color||"#000000","border-style":n.style||"solid","border-width":n.width||"1px"};return J(Object.assign(e,ft(t))),B({type:y.STANDARD_DIVIDER,data:{},attributes:M(e),mobileAttributes:M(tt(t._override,{padding:!0})),children:[{text:""}]})}function je(t,n){var g,b,f;const e=((g=t.menu)==null?void 0:g.items)||[],o="",i=t.linkColor||t.textColor||"",r=t.fontSize||"",a=zt(t.fontFamily,n),l=t.padding||"",d=((f=(b=t._override)==null?void 0:b.mobile)==null?void 0:f.padding)||"",s=t.textTransform||"none",c=(_,S,k)=>{var x,T;return B({type:y.STANDARD_NAVBAR_LINK,data:{},attributes:M({href:S?"":((x=k==null?void 0:k.values)==null?void 0:x.href)||"",target:S?"":((T=k==null?void 0:k.values)==null?void 0:T.target)||"",color:i,"font-size":r,"font-family":a,"line-height":"1.2",padding:l,"text-transform":s,"text-decoration":"none"}),mobileAttributes:d?{padding:d}:void 0,children:S?[{text:_}]:j(_)})},u=[];e.forEach((_,S)=>{S>0&&o&&u.push(c(o,!0)),u.push(c(_.text||"",!1,_.link))});const p={align:t.align||"center",color:i,"font-size":r,"font-family":a,"text-transform":s};J(Object.assign(p,ft(t)));const h=t._override?W(N({},t._override),{mobile:t._override.mobile?W(N({},t._override.mobile),{padding:void 0}):void 0}):void 0;return B({type:y.STANDARD_NAVBAR,data:{},attributes:M(p),mobileAttributes:M(tt(h,{padding:!0})),children:u.length>0?u:[yt()]})}function Ve(t,n){var a,l;const e=((a=t.icons)==null?void 0:a.icons)||[],o=((l=t.icons)==null?void 0:l.iconType)||"rounded",i=e.map(d=>{const s=String(d.name||"").trim(),c=Xe(s);return B({type:y.STANDARD_SOCIAL_ELEMENT,data:{},attributes:M({src:c?Ke(o,c):"",mode:"custom",href:d.url||"",name:s.toLowerCase(),alt:s?`${s} icon`:"",title:s,target:"_blank"}),children:[{text:""}]})}),r={align:t.align||"center",mode:"horizontal","icon-size":t.iconSize?`${t.iconSize}px`:"",spacing:t.spacing!=null?`${t.spacing}px`:"",color:t.color||"","font-size":t.fontSize||""};return J(Object.assign(r,ft(t))),B({type:y.STANDARD_SOCIAL,data:{},attributes:M(r),mobileAttributes:M(tt(t._override,{padding:!0})),children:i.length>0?i:[yt()]})}function Ke(t,n){return`https://cdn.tools.unlayer.com/social/icons/${t}/${n}.png`}function Xe(t){var o;if(!t)return"";const n={facebook:"facebook",linkedin:"linkedin",instagram:"instagram",twitter:"twitter",x:"x",youtube:"youtube",pinterest:"pinterest",tiktok:"tiktok",snapchat:"snapchat",whatsapp:"whatsapp",github:"github"},e=t.toLowerCase();return(o=n[e])!=null?o:e.replace(/[^a-z0-9]/g,"")}function Ze(t){return B({type:y.DANGEROUS_CODE,data:{code:t.html||t.content||""},attributes:{},children:[{text:""}]})}function qe(){return B({type:y.STANDARD_COLUMN,data:{},attributes:{width:"100%"},children:[yt()]})}function yt(){return B({type:y.STANDARD_PARAGRAPH,data:{},attributes:{},children:[{text:""}]})}function Je(t){switch(t){case"h2":return y.STANDARD_H2;case"h3":return y.STANDARD_H3;case"h4":return y.STANDARD_H4;case"h1":default:return y.STANDARD_H1}}function de(t){if(t==null)return"";if(typeof t=="number")return`${t}px`;if(typeof t=="string")return t;if(typeof t=="object"){if(t.autoWidth)return"";if(typeof t.width=="number")return`${t.width}px`;if(typeof t.width=="string")return t.width}return""}function H(t){if(typeof t=="number")return t;if(typeof t!="string")return 0;const n=/^(-?\d+(?:\.\d+)?)(px)?$/.exec(t.trim());return n?parseFloat(n[1]):0}function Ye(t){return`${Number((t*100).toFixed(4))}%`}function Qe(t){const n=String(t||"").trim().toLowerCase();return n?n==="center"||n==="middle"?"middle":n==="flex-end"||n==="end"||n==="bottom"?"bottom":n==="flex-start"||n==="start"||n==="top"?"top":"":""}function It(t,n){if(!t)return"";const e=String(t).trim(),o=/^(-?\d+(?:\.\d+)?)%$/.exec(e);if(o){const i=parseFloat(o[1]);return`${Math.max(1,Math.round(i/100*n))}px`}return/^-?\d+(?:\.\d+)?$/.test(e)?`${e}px`:e}function Qt(t){const n=String(t||"").trim();return!n||tn(n)?!1:!/^(?:https?:|data:|blob:)/i.test(n)}function tn(t){return/%%[A-Za-z0-9_]+%%/.test(t)}function se(t,n,e){if(typeof t!="number"||t<=0)return"";const o=typeof n=="number"&&n>0?n:0,i=H(e);return o>0&&i>0?`${Math.max(1,Math.round(t*i/o))}px`:`${t}px`}function en(t,n){const e=new Set,o=[],i=a=>{if(!a||typeof a!="object"||!a.url)return;const l=String(a.url);e.has(l)||(e.add(l),o.push({name:String(a.label||a.value||"").trim(),href:l}))};i(n);const r=a=>{if(!(!a||typeof a!="object")){a.fontFamily&&i(a.fontFamily);for(const l of Object.keys(a)){const d=a[l];Array.isArray(d)?d.forEach(r):d&&typeof d=="object"&&r(d)}}};return r(t),o}function nn(t){var a,l,d,s,c,u;if(t.length===0)return{};const n={},e=(t[0].contents||[]).map(p=>p.type).join(","),o=((a=t[0].values)==null?void 0:a.backgroundColor)||"",i=!!e&&t.every(p=>{var b;const h=(p.contents||[]).map(f=>f.type).join(","),g=((b=p.values)==null?void 0:b.backgroundColor)||"";return h===e&&g===o}),r=["Top"];i||r.push("Bottom");for(const p of r){const h=`border${p}Width`,g=`border${p}Color`,b=`border${p}Style`,f=(d=(l=t[0])==null?void 0:l.values)==null?void 0:d.border;if(!f)continue;const _=f[h],S=f[g],k=f[b]||"solid";if(!_||_==="0"||_==="0px")continue;let x=!0;for(let T=1;T<t.length;T++){const A=(c=(s=t[T])==null?void 0:s.values)==null?void 0:c.border;if(!A||A[h]!==_||A[g]!==S||(A[b]||"solid")!==k){x=!1;break}}if(x){n[`border-${p.toLowerCase()}`]=`${_} ${k} ${S||"transparent"}`;for(const T of t){const A=(u=T.values)==null?void 0:u.border;A&&(A[h]="0px")}}}return n}function on(t){const n={};if(t.length===0)return n;const e=(o,i,r)=>{var c;const a=(c=o==null?void 0:o.values)==null?void 0:c.border;if(!a)return;const l=a[`border${i}Width`],d=a[`border${i}Color`],s=a[`border${i}Style`]||"solid";!l||l==="0"||l==="0px"||(n[r]=`${l} ${s} ${d||"transparent"}`,a[`border${i}Width`]="0px")};return e(t[0],"Left","border-left"),e(t[t.length-1],"Right","border-right"),n}function Dt(t){var e,o,i,r;if(t.length===0)return"";const n=(o=(e=t[0])==null?void 0:e.values)==null?void 0:o.backgroundColor;if(!n)return"";for(let a=1;a<t.length;a++)if(((r=(i=t[a])==null?void 0:i.values)==null?void 0:r.backgroundColor)!==n)return"";return n}function rn(t){var i,r;const n=t.contents||[];if(n.length===0)return!0;if(n.length>1)return!1;const e=n[0];if(e.type!=="image")return!1;const o=(r=(i=e.values)==null?void 0:i.src)==null?void 0:r.maxWidth;return o==="0%"||o==="0"||o===0}function an(t){var i,r,a,l,d;if(t.length<3)return"";const n=((r=(i=t[0])==null?void 0:i.values)==null?void 0:r.backgroundColor)||"",e=((l=(a=t[t.length-1])==null?void 0:a.values)==null?void 0:l.backgroundColor)||"";if(!n||n!==e)return"";let o="";for(let s=1;s<t.length-1;s++){const c=t[s],u=((d=c==null?void 0:c.values)==null?void 0:d.backgroundColor)||"";if(u&&u!==n){if(!rn(c)||o&&o!==u)return"";o=u}}return o}function ce(t){var n;for(const e of t){const o=(n=e==null?void 0:e.values)==null?void 0:n.border;if(!o)continue;const i=["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"];for(const r of i){const a=o[r];if(a&&a!=="0px"&&a!=="0")return!0}}return!1}function ln(t){var i,r,a;const n=t.columns||[];if(n.length<2)return;const e=t.cells||n.map(()=>1),o=new Map;n.forEach((l,d)=>{var h;const s=(l.contents||[]).map(g=>g.type).join(","),c=((h=l.values)==null?void 0:h.backgroundColor)||"";if(!s)return;const u=`${s}|${c}`,p=o.get(u)||[];p.push(d),o.set(u,p)});for(const l of o.values()){if(l.length<2)continue;const d=l.map(p=>{var h;return Number((h=e[p])!=null?h:1)}),s=Math.min(...d),c=Math.max(...d);if(c>0&&(c-s)/c>.2)continue;const u=n[l[0]].contents.length;for(let p=0;p<u;p++){let h=0,g=0,b=1/0,f=1/0;for(const x of l){const T=n[x].contents[p],A=wt((i=T.values)==null?void 0:i.containerPadding),w=A?H(A.top):0,D=A?H(A.bottom):0;h=Math.max(h,w),g=Math.max(g,D),b=Math.min(b,w),f=Math.min(f,D)}const _=h-b>80,S=g-f>80,k=h>b;for(const x of l){const T=n[x].contents[p],A=(a=wt((r=T.values)==null?void 0:r.containerPadding))!=null?a:{top:"0px",right:"0px",bottom:"0px",left:"0px"};let w=!1;!_&&!k&&H(A.top)<h&&(A.top=`${h}px`,w=!0),!S&&H(A.bottom)<g&&(A.bottom=`${g}px`,w=!0),w&&(T.values=T.values||{},T.values.containerPadding=`${A.top} ${A.right} ${A.bottom} ${A.left}`)}}}}function dn(t){var i,r,a,l;const n=t.columns||[];if(n.length<2||!((a=(r=(i=t.values)==null?void 0:i._override)==null?void 0:r.mobile)!=null&&a.noStackMobile)||!Dt(n)||!ce(n))return!1;const e=new Set(["image","text","heading"]),o=(n[0].contents||[]).map(d=>d.type).join(",");if(!o)return!1;for(const d of n){const s=((l=d.values)==null?void 0:l.border)||{},c=s.borderTopWidth,u=s.borderBottomWidth;if(!c||c==="0"||c==="0px"||!u||u==="0"||u==="0px")return!1}for(const d of n){const s=d.contents||[];for(const u of s)if(!e.has(u.type))return!1;if(s.map(u=>u.type).join(",")!==o)return!1}return!0}function sn(t,n,e){var f;const o=t.values||{},i=t.columns||[],r=t.cells||i.map(()=>1),a=r.reduce((_,S)=>_+Number(S||0),0)||1,l=Dt(i);let d="#000000",s="solid",c="1px";for(const _ of i){const S=(f=_.values)==null?void 0:f.border;if(!S)continue;const k=S.borderTopWidth||S.borderRightWidth||S.borderBottomWidth||S.borderLeftWidth;if(k&&k!=="0px"&&k!=="0"){c=k,d=S.borderTopColor||S.borderRightColor||S.borderBottomColor||S.borderLeftColor||d,s=S.borderTopStyle||S.borderRightStyle||S.borderBottomStyle||S.borderLeftStyle||s;break}}const u=i.map((_,S)=>{var P,C,$;const k=_.values||{};if(lt(k)==="hidden")return null;const x=Number((P=r[S])!=null?P:1)/a,T=Math.round(n.contentWidthPx*x),A=(_.contents||[]).map(L=>cn(L,W(N({},n),{columnPxWidth:T}))).filter(L=>L!=null),w=((C=_.values)==null?void 0:C.border)||{},D=[w.borderTopWidth,w.borderRightWidth,w.borderBottomWidth,w.borderLeftWidth].some(L=>L&&L!=="0px"&&L!=="0"),E=`${(Number(($=r[S])!=null?$:1)/a*100).toFixed(4)}%`;return Rt(B({type:y.STANDARD_TABLE2_TD,data:{rowspan:1,colspan:1},attributes:M({"border-enabled":D?!0:void 0,"text-align":"center",width:E}),children:A.length>0?A:[yt()]}),k)}).filter(_=>_!=null),p=B({type:y.STANDARD_TABLE2_TR,data:{},attributes:M({"background-color":l||""}),children:u}),h=B({type:y.STANDARD_TABLE2,data:{},attributes:M({"border-enabled":!0,"border-color":d,"border-style":s,"border-width":c,"text-align":"center","cell-padding-top":"0px","cell-padding-right":"0px","cell-padding-bottom":"0px","cell-padding-left":"0px",padding:"0px 0px 0px 0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",width:"100%"}),children:[p]}),g=B({type:y.STANDARD_COLUMN,data:{},attributes:{width:"100%","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},children:[h]}),b={"background-color":o.backgroundColor||"","padding-top":e.top,"padding-right":e.right,"padding-bottom":e.bottom,"padding-left":e.left};return Wt(b),n.templateUsesFullWidth&&(b["full-width"]="full-width"),B({type:y.STANDARD_SECTION,data:{},attributes:M(b),children:[g]})}function cn(t,n){const e=t.values||{};if(lt(e)==="hidden")return null;let o;switch(t.type){case"image":o=pn(e,n);break;case"heading":case"text":o=gn(e,n);break;default:return re(t,n)}return Rt(o,e)}function pn(t,n){var g,b;const e=((g=t.src)==null?void 0:g.url)||"",o=t.altText||"",r=(b=le(t,n).attributes)!=null?b:{},a=r.width||"",l=r["padding-top"]||"0px",d=r["padding-right"]||"0px",s=r["padding-bottom"]||"0px",c=r["padding-left"]||"0px",u=["display:block","margin:0 auto","max-width:100%","height:auto","border:0",a?`width:${a}`:""].filter(Boolean).join(";"),p=`padding:${l} ${d} ${s} ${c};text-align:center`,h=B({type:y.HTML_BLOCK_NODE,data:{tagName:"img"},attributes:{src:e,alt:o,style:u},children:[{text:""}]});return B({type:y.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{style:p},children:[h]})}function gn(t,n){const e=Ht(t,n),o=e["padding-top"]||"0px",i=e["padding-right"]||"0px",r=e["padding-bottom"]||"0px",a=e["padding-left"]||"0px",l=[e.color?`color:${e.color}`:"",e["font-family"]?`font-family:${e["font-family"]}`:"",e["font-size"]?`font-size:${e["font-size"]}`:"",e["line-height"]?`line-height:${e["line-height"]}`:"",e["letter-spacing"]?`letter-spacing:${e["letter-spacing"]}`:"",e.align?`text-align:${e.align}`:"",`padding:${o} ${i} ${r} ${a}`,"margin:0","word-wrap:break-word"].filter(Boolean).join(";"),d=pe(t.text||"",Mt(t,n));return B({type:y.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{style:l},children:d.length>0?d:[{text:""}]})}function pe(t,n){if(!t)return[];const e=(s,c,u)=>{if(!u&&!s.trim())return null;const p=Ot(j(s),n),h=c?`margin:0;${c}`:"margin:0";return{type:y.HTML_BLOCK_NODE,data:{tagName:"p"},attributes:{style:h},children:p.length?p:[{text:""}]}},o=(s,c,u)=>{const p=/<li\b([^>]*)>([\s\S]*?)<\/li>/gi,h=[];let g;for(;(g=p.exec(u))!==null;){const f=$t(g[1]||""),_=Ot(j(g[2]),n);h.push({type:y.HTML_BLOCK_NODE,data:{tagName:"li"},attributes:f?{style:f}:{},children:_.length?_:[{text:""}]})}if(h.length===0)return null;const b=$t(c);return{type:y.HTML_BLOCK_NODE,data:{tagName:s},attributes:b?{style:b}:{},children:h}},i=[],r=/<(p|ul|ol)\b([^>]*)>([\s\S]*?)<\/\1>/gi;let a=0,l;for(;(l=r.exec(t))!==null;){const s=e(t.slice(a,l.index),"",!1);s&&i.push(s);const c=l[1].toLowerCase(),u=l[2]||"",p=c==="p"?e(l[3],$t(u),!0):o(c,u,l[3]);p&&i.push(p),a=l.index+l[0].length}const d=e(t.slice(a),"",!1);return d&&i.push(d),i}function $t(t){var e,o;const n=/\bstyle\s*=\s*"([^"]*)"|\bstyle\s*=\s*'([^']*)'/i.exec(t);return n&&(o=(e=n[1])!=null?e:n[2])!=null?o:""}function Wt(t){const n=t["padding-top"],e=t["padding-right"],o=t["padding-bottom"],i=t["padding-left"];n==null&&e==null&&o==null&&i==null||(t.padding=`${n!=null?n:"0px"} ${e!=null?e:"0px"} ${o!=null?o:"0px"} ${i!=null?i:"0px"}`)}function un(t){const n={};return t!=null&&t.padding&&(n.padding=t.padding),n}function te(t){return t?/^0(?:px|em|rem|%|pt)?$/i.test(t.trim()):!0}function ft(t){const n={};return t!=null&&t.containerPadding&&(n.padding=t.containerPadding),n}function ee(t,n={}){if(!t||typeof t!="object")return{};const e={},o=["Top","Right","Bottom","Left"];let i=!1;for(const r of o){const a=t[`border${r}Width`],l=t[`border${r}Color`],d=t[`border${r}Style`];(a||l||d)&&(a&&a!=="0"&&a!=="0px"&&(i=!0),e[`border-${r.toLowerCase()}`]=`${a||"0px"} ${d||"solid"} ${l||"transparent"}`)}return i||n.includeZero?e:{}}function ge(t,n="borderAll"){if(!t||typeof t!="object")return{width:"",style:"",color:""};const e=(n==="borderTop"||t.borderTopWidth||t.borderTopColor,"borderTop");return{width:t[`${e}Width`]||"",style:t[`${e}Style`]||"",color:t[`${e}Color`]||""}}function ne(t){const n={};return t.url&&(n["background-url"]=t.url),t.repeat&&(n["background-repeat"]=t.repeat),t.position==="custom"&&t.customPosition?n["background-position"]=t.customPosition.join(" "):t.position?n["background-position"]=fn(t.position):t.customPosition&&(n["background-position"]=t.customPosition.join(" ")),typeof t.size=="string"?t.size==="custom"&&t.width?n["background-size"]=`${t.width}px auto`:t.size!=="custom"&&(n["background-size"]=t.size):t.fullWidth&&t.width&&(n["background-size"]=`${t.width}px auto`),n}function fn(t){const n=t.trim();if(!n||n.includes(" ")||/[%\d]/.test(n))return n;const e=n.split("-").filter(Boolean);if(e.length!==2)return n;const o=new Set(["top","bottom"]);return o.has(e[0])&&!o.has(e[1])?`${e[1]} ${e[0]}`:e.join(" ")}function tt(t,n={}){const e=t==null?void 0:t.mobile;if(!e)return{};const o={};return e.textAlign&&(o.align=e.textAlign),e.fontSize&&(o["font-size"]=e.fontSize),e.lineHeight&&(o["line-height"]=e.lineHeight),e.backgroundColor&&(o["background-color"]=e.backgroundColor),n.padding&&e.containerPadding&&(Object.assign(o,{padding:e.containerPadding}),J(o,"padding")),e.padding&&J(Object.assign(o,{padding:e.padding}),"padding"),o}const bt=375;function hn(t,n,e,o,i={}){var l,d,s,c,u,p;const r=tt(t,{padding:!0}),a=t==null?void 0:t.mobile;if(!((l=a==null?void 0:a.src)!=null&&l.maxWidth)&&o&&/^-?\d+(?:\.\d+)?%$/.test(o.trim())){const h=It(o,bt);if(h){const g=H(h);e&&g>e?r.width=`${e}px`:r.width=h}}if(((d=a==null?void 0:a.src)==null?void 0:d.autoWidth)===!0&&(n&&(r.width=`${n}px`),r["fluid-on-mobile"]="true"),(s=a==null?void 0:a.src)!=null&&s.maxWidth&&((c=a==null?void 0:a.src)==null?void 0:c.autoWidth)!==!0){const h=String(a.src.maxWidth).trim(),g=/^(-?\d+(?:\.\d+)?)%$/.exec(h),b=h==="100%"||h==="100",f=It(h,bt);let _=f;if(f){const S=H(f);!i.brokenImage&&n&&n>0&&S>n&&(_=`${n}px`)}if(_&&(r.width=_),b)r["fluid-on-mobile"]="true";else if(g){const S=parseFloat(g[1]),k=r["padding-left"]!=null?H(String(r["padding-left"])):(u=i.desktopPaddingLeft)!=null?u:0,x=r["padding-right"]!=null?H(String(r["padding-right"])):(p=i.desktopPaddingRight)!=null?p:0,T=Math.max(0,bt-k-x);let A=S/100*T;if(!i.brokenImage&&n&&n>0&&A>n&&(A=n),A>0&&A<bt){r.width=`${Math.round(A)}px`;const w=Math.max(0,bt-A),D=String(i.align||"").toLowerCase();let E=w/2,P=w/2;D==="left"?(E=k,P=Math.max(0,w-E)):D==="right"&&(P=x,E=Math.max(0,w-P)),r["padding-left"]=`${E}px`,r["padding-right"]=`${P}px`,r["fluid-on-mobile"]="true"}}}if(i.brokenImage&&i.srcNativeHeight&&n){const h=H(r.width);h>0&&(r.height=se(i.srcNativeHeight,n,`${h}px`))}return r}function bn(t){const n=tt(t,{padding:!0}),e=t==null?void 0:t.mobile,o=de(e==null?void 0:e.size);return o&&(n.width=o),n}function M(t){const n={};for(const e of Object.keys(t)){const o=t[e];o===""||o==null||(n[e]=o)}return n}function lt(t){var o,i,r,a;if(!t)return;const n=t.hideDesktop===!0||((i=(o=t._override)==null?void 0:o.desktop)==null?void 0:i.hideDesktop)===!0,e=t.hideMobile===!0||((a=(r=t._override)==null?void 0:r.mobile)==null?void 0:a.hideMobile)===!0;if(n&&e)return"hidden";if(n)return"mobile";if(e)return"desktop"}function Rt(t,n){if(!t)return t;const e=lt(n);return e==="hidden"?null:(e&&(t.visible=e),ue(t,n))}function Pt(t,n){const e=lt(n);return e==="hidden"?[]:t.map(o=>{const i=e?W(N({},o),{visible:e}):o;return ue(i,n)})}function ue(t,n){const e=mn(n==null?void 0:n.displayCondition);return e?W(N({},t),{logic:W(N({},t.logic),{condition:{expression:e,enabled:!0}})}):t}function mn(t){const n=String((t==null?void 0:t.before)||"").trim();if(!n)return;const e=n.match(/^\{%\s*if\s+([\s\S]*?)\s*%\}$/);return e?e[1].trim()||void 0:n}function B(t){return t!=null&&t.mobileAttributes&&typeof t.mobileAttributes=="object"&&Object.keys(t.mobileAttributes).length===0&&delete t.mobileAttributes,t}const K={HEADING:"mailup-bee-newsletter-modules-heading",PARAGRAPH:"mailup-bee-newsletter-modules-paragraph",TEXT:"mailup-bee-newsletter-modules-text",BUTTON:"mailup-bee-newsletter-modules-button",IMAGE:"mailup-bee-newsletter-modules-image",SPACER:"mailup-bee-newsletter-modules-spacer",DIVIDER:"mailup-bee-newsletter-modules-divider",MENU:"mailup-bee-newsletter-modules-menu",SOCIAL:"mailup-bee-newsletter-modules-social",ICONS:"mailup-bee-newsletter-modules-icons",HTML:"mailup-bee-newsletter-modules-html",LIST:"mailup-bee-newsletter-modules-list",TABLE:"mailup-bee-newsletter-modules-table",VIDEO:"mailup-bee-newsletter-modules-video",CAROUSEL:"mailup-bee-newsletter-modules-carousel",FORM:"mailup-bee-newsletter-modules-form",MERGE_CONTENT:"mailup-bee-newsletter-modules-merge-content",EMPTY:"mailup-bee-newsletter-modules-empty"};function yn(t){var f,_,S,k,x,T,A,w,D,E,P,C;const n=[],e=_n(t);if(!e)throw new Error("beefreeToEasyEmailPro: input has no { page: { body, rows } }");for(const $ of e.rows||[])for(const L of $.columns||[])for(const F of L.modules||[])if(F.type===K.MENU)throw new Error("beefreeToEasyEmailPro: template uses `menu` module (navbar), which is not supported — conversion aborted");const o=e.body,i=((_=(f=o==null?void 0:o.content)==null?void 0:f.computedStyle)==null?void 0:_.messageWidth)||"700px",r=parseInt(String(i),10)||700,a=((k=(S=o==null?void 0:o.content)==null?void 0:S.computedStyle)==null?void 0:k.linkColor)||"",l=((T=(x=o==null?void 0:o.content)==null?void 0:x.style)==null?void 0:T["background-color"])||((w=(A=o==null?void 0:o.container)==null?void 0:A.style)==null?void 0:w["background-color"])||"",d=((E=(D=o==null?void 0:o.content)==null?void 0:D.style)==null?void 0:E["font-family"])||"",s=((C=(P=o==null?void 0:o.content)==null?void 0:P.style)==null?void 0:C.color)||"",c={};d&&(c["font-family"]=d);const u={};s&&(u[oe.TEXT]={color:s});const h=(e.rows||[]).flatMap($=>An($,{contentWidthPx:r,columnPxWidth:r,bodyLinkColor:a,warnings:n})),g=((o==null?void 0:o.webFonts)||[]).map($=>({name:$.name||"",href:$.url||""})).filter($=>$.name&&$.href);return{page:{type:y.PAGE,data:N({breakpoint:r>700?"768px":"720px",globalAttributes:c,categoryAttributes:u,blockAttributes:{},classAttributes:{},preheader:""},g.length>0?{fonts:g}:{}),attributes:O({width:`${r}px`,"background-color":l,"content-background-color":"","margin-top":"0px","margin-bottom":"0px","link-color":a}),children:h},warnings:n}}function _n(t){var n,e,o;return t?(n=t.page)!=null&&n.rows?t.page:(o=(e=t.template)==null?void 0:e.page)!=null&&o.rows?t.template.page:t.rows&&t.body?t:null:null}function An(t,n){var ht,ct,pt,gt;const e=((ht=t.content)==null?void 0:ht.style)||{},o=((ct=t.content)==null?void 0:ct.mobileStyle)||{},i=((pt=t.container)==null?void 0:pt.style)||{},r=((gt=t.content)==null?void 0:gt.computedStyle)||{},a=t.columns||[];if(a.length===0)return[];if(r.hideContentOnDesktop===!0&&r.hideContentOnMobile===!0)return[];const l=r.hideContentOnDesktop===!0?"mobile":r.hideContentOnMobile===!0?"desktop":void 0,d=(e["background-color"]||"").trim(),s=(i["background-color"]||"").trim(),c=z=>!z||z.toLowerCase()==="transparent",u=c(d)&&!c(s)?s:d,p=c(d)&&(!c(s)||!!mt(i["background-image"])),h=a.reduce((z,X)=>z+(X["grid-columns"]||0),0)||12,g=r.rowColStackOnMobile===!1&&a.length>1,b=(a[0].style||{})["background-color"]||"",_=(z=>!!z&&z.trim().toLowerCase()!=="transparent")(b)&&a.every(z=>(z.style||{})["background-color"]===b),S=String(r.columnsSpacing||"").trim(),k=!!S&&S!=="0px"&&S!=="0",x=_&&!k?b:"",T=r.columnsBorderRadius||"",A=k?T:"",w=e.padding||e["padding-top"]||e["padding-right"]||e["padding-bottom"]||e["padding-left"],D={top:e["padding-top"]||"",right:e["padding-right"]||"",bottom:e["padding-bottom"]||"",left:e["padding-left"]||"",shorthand:e.padding||(w?"":"0")},E=mt(e["background-image"])?e:c(d)&&mt(i["background-image"])?i:null,P=E?mt(E["background-image"]):"",C=P?O({"background-url":P,"background-position":E["background-position"]||"","background-repeat":E["background-repeat"]||"","background-size":E["background-size"]||"","background-image-enabled":!0}):{},$=!g&&a.length>1,L=z=>z.map((X,V)=>{const ut=X["grid-columns"]||12,Ct=Math.round(n.contentWidthPx*ut/h);return kn(X,ut,h,W(N({},n),{columnPxWidth:Ct,columnStacksOnMobile:$,skipColBg:!!x,perColumnRadius:A,columnsSpacing:k?S:"",colIndex:V,colCount:z.length}))}).filter(X=>X!=null),F=r.rowReverseColStackOnMobile===!0&&r.rowColStackOnMobile!==!1&&a.length>1;let U;if(F){const z=L(a).map(V=>W(N({},V),{visible:"desktop"})),X=L([...a].reverse()).map(V=>W(N({},V),{visible:"mobile"}));U=[...z,...X]}else U=L(a);if(U.length===0)return[];const Y=g?[I({type:y.STANDARD_GROUP,data:{},attributes:{width:"100%"},children:U})]:U,dt=he(o);if(x){const z=O(N({"background-color":u,"border-radius":e["border-radius"]||"",padding:D.shorthand,"padding-top":D.top,"padding-right":D.right,"padding-bottom":D.bottom,"padding-left":D.left},C)),X=I({type:y.STANDARD_SECTION,data:{},attributes:O({"background-color":x,"border-radius":T,padding:"0"}),children:Y}),V=I({type:y.STANDARD_WRAPPER,data:{},attributes:z,mobileAttributes:dt,children:[X]});return l&&(V.visible=l),[V]}const st=mt(i["background-image"]),At=!!st||!c(s)&&s!==d,et=!c(d);if(!x&&At&&et){const z=O(N({"full-width":"full-width","background-color":s,padding:D.shorthand,"padding-top":D.top,"padding-right":D.right,"padding-bottom":D.bottom,"padding-left":D.left},st?{"background-url":st,"background-position":i["background-position"]||"","background-repeat":i["background-repeat"]||"","background-size":i["background-size"]||"","background-image-enabled":!0}:{})),X=I({type:y.STANDARD_SECTION,data:{},attributes:O({"background-color":d,"border-radius":(A?"":T)||e["border-radius"]||"",padding:"0"}),children:Y}),V=I({type:y.STANDARD_WRAPPER,data:{},attributes:z,mobileAttributes:dt,children:[X]});return l&&(V.visible=l),[V]}const Z=O(N(W(N({},p?{"full-width":"full-width"}:{}),{"background-color":u,"border-radius":(A?"":T)||e["border-radius"]||"",padding:D.shorthand,"padding-top":D.top,"padding-right":D.right,"padding-bottom":D.bottom,"padding-left":D.left}),C)),kt=I({type:y.STANDARD_SECTION,data:{},attributes:Z,mobileAttributes:dt,children:Y});return l&&(kt.visible=l),[kt]}function kn(t,n,e,o){const i=t.style||{},r=t.mobileStyle||{},a=`${Math.round(100*n/e)}%`,l=O({width:a,"background-color":o.skipColBg?"":i["background-color"]||"","border-radius":i["border-radius"]||o.perColumnRadius||"","border-top":nt(i["border-top"]),"border-right":nt(i["border-right"]),"border-bottom":nt(i["border-bottom"]),"border-left":nt(i["border-left"]),padding:i.padding||"","padding-top":i["padding-top"]||"","padding-right":i["padding-right"]||"","padding-bottom":i["padding-bottom"]||"","padding-left":i["padding-left"]||"","vertical-align":i["vertical-align"]||""}),d=he(r),s=o.colCount!=null&&o.colIndex!=null?o.colIndex>=o.colCount-1:!0;if(o.columnsSpacing&&!s){const u=parseInt(o.columnsSpacing,10)||0;if(u>0){const p=parseInt(d["padding-bottom"]||"0",10)||0;d["padding-bottom"]=`${p+u}px`}}const c=(t.modules||[]).map(u=>xn(u,o)).filter(u=>!!u);return c.length===0?null:I({type:y.STANDARD_COLUMN,data:{},attributes:l,mobileAttributes:d,children:c})}function xn(t,n){const e=t.descriptor||{},o=(()=>{switch(t.type){case K.HEADING:return Tn(e,n);case K.PARAGRAPH:case K.TEXT:return wn(e,n);case K.BUTTON:return Dn(e);case K.IMAGE:return Rn(e,n);case K.SPACER:return En(e);case K.DIVIDER:return Cn(e);case K.HTML:return Ln(e);case K.LIST:return On(e);case K.SOCIAL:return Nn(e);case K.ICONS:return $n(e);case K.TABLE:return Pn(e,n);case K.EMPTY:return null;default:return n.warnings.push(`unsupported module type: ${t.type}`),null}})();return Sn(o,e)}function Sn(t,n){if(!t)return t;const e=(n==null?void 0:n.computedStyle)||{},o=e.hideContentOnDesktop===!0,i=e.hideContentOnMobile===!0;return o&&i?null:(o?t.visible="mobile":i&&(t.visible="desktop"),t)}function Tn(t,n){var h;const e=t.heading||{},o=t.style||{},i=e.style||{},r=e.title||"h1",a=e.text||"",l=r==="h2"?y.STANDARD_H2:r==="h3"?y.STANDARD_H3:y.STANDARD_H1,d=O({align:i["text-align"]||o["text-align"]||"",color:i.color||"","font-family":_t(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":i["line-height"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""}),s=Q(t.mobileStyle||{}),c=((h=e.computedStyle)==null?void 0:h.linkColor)||n.bodyLinkColor||"",u=c?vt(a,c):a,p=j(Et(u))||[{text:""}];return I({type:l,data:{},attributes:d,mobileAttributes:s,children:p})}function wn(t,n){var p,h,g;const e=t.paragraph||{},o=t.style||{},i=e.style||{},r=e.html||((p=t.text)==null?void 0:p.html)||"",a=i["line-height"]||((h=e.computedStyle)==null?void 0:h.paragraphSpacing)||"",l=((g=e.computedStyle)==null?void 0:g.linkColor)||n.bodyLinkColor||"",d=l?vt(r,l):r,s=O({align:i["text-align"]||"",color:i.color||"","font-family":_t(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":a,"padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""}),c=Q(t.mobileStyle||{}),u=j(Et(d))||[{text:""}];return I({type:y.STANDARD_PARAGRAPH,data:{},attributes:s,mobileAttributes:c,children:u})}function Dn(t,n){const e=t.button||{},o=t.style||{},i=e.style||{},r=Et(e.label||""),a=i.width&&i.width!=="auto"?i.width:"",l=O({align:o["text-align"]||"center",href:e.href||"",target:e.target||"",color:i.color||"","background-color":i["background-color"]||"","border-top":nt(i["border-top"]),"border-right":nt(i["border-right"]),"border-bottom":nt(i["border-bottom"]),"border-left":nt(i["border-left"]),"border-radius":i["border-radius"]||"","font-family":_t(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":i["line-height"]||"","inner-padding-top":i["padding-top"]||"","inner-padding-right":i["padding-right"]||"","inner-padding-bottom":i["padding-bottom"]||"","inner-padding-left":i["padding-left"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||"",width:a}),d=Q(t.mobileStyle||{}),s=j(r)||[{text:""}];return I({type:y.STANDARD_BUTTON,data:{},attributes:l,mobileAttributes:d,children:s})}function Rn(t,n){const e=t.image||{},o=t.style||{},i=t.computedStyle||{},r=i.width||o.width||e.width||"",a=Mn(r,n.columnPxWidth),l=In(i.class)||"center",d=O(W(N({src:e.src||"",alt:e.alt||"",title:e.title||"",href:e.href||"",target:e.target||"",align:l,width:a},Lt(i.class,"fullwidthOnMobile")?{"fluid-on-mobile":"true"}:{}),{"border-radius":o["border-radius"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""})),s=Q(t.mobileStyle||{});return n.columnStacksOnMobile&&Lt(i.class,"fixedwidth")&&!Lt(i.class,"fullwidthOnMobile")&&l!=="center"&&!s.align&&(s.align="center"),I({type:y.STANDARD_IMAGE,data:{},attributes:d,mobileAttributes:s,children:[{text:""}]})}function En(t){var o,i,r;const n=((i=(o=t.spacer)==null?void 0:o.style)==null?void 0:i.height)||"10px",e=((r=t.mobileStyle)==null?void 0:r.height)||"";return I({type:y.STANDARD_SPACER,data:{},attributes:O({height:n}),mobileAttributes:e?{height:e}:{},children:[{text:""}]})}function Cn(t){var c;const n=((c=t.divider)==null?void 0:c.style)||{},e=t.style||{},o=fe(n["border-top"]),i=n["border-top-color"]||n.color||o.color||"",r=n["border-top-style"]||o.style||"solid",a=n["border-top-width"]||o.width||"1px",l=parseInt(n.height||"0",10)||0;if((!i||i.toLowerCase()==="transparent"||a==="0"||a==="0px")&&l>0)return I({type:y.STANDARD_SPACER,data:{},attributes:O({height:`${l}px`,"padding-top":e["padding-top"]||"","padding-right":e["padding-right"]||"","padding-bottom":e["padding-bottom"]||"","padding-left":e["padding-left"]||""}),mobileAttributes:Q(t.mobileStyle||{}),children:[{text:""}]});const s=O({"border-color":i,"border-style":r,"border-width":a,width:n.width||"100%","padding-top":e["padding-top"]||"","padding-right":e["padding-right"]||"","padding-bottom":e["padding-bottom"]||"","padding-left":e["padding-left"]||""});return I({type:y.STANDARD_DIVIDER,data:{},attributes:s,mobileAttributes:Q(t.mobileStyle||{}),children:[{text:""}]})}function fe(t){if(!t||typeof t!="string")return{width:"",style:"",color:""};const n=t.trim().split(/\s+/),e=new Set(["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"]);let o="",i="",r="";for(const a of n)!o&&/^[\d.]+(px|em|rem|%|pt)?$/.test(a)?o=a:!i&&e.has(a.toLowerCase())?i=a:r||(r=a);return{width:o,style:i,color:r}}function Nn(t){var a;const n=((a=t.iconsList)==null?void 0:a.icons)||[],e=t.style||{},o=t.computedStyle||{},i=n.map(l=>{const d=l.image||{},s=String(l.name||l.id||"").toLowerCase();return I({type:y.STANDARD_SOCIAL_ELEMENT,data:{},attributes:O({src:d.src||"",mode:"custom",href:d.href||"",name:s,alt:d.alt||s,title:d.title||s,target:d.target||"_blank"}),children:[{text:""}]})}),r=typeof o.iconsDefaultWidth=="number"?`${o.iconsDefaultWidth}px`:"";return I({type:y.STANDARD_SOCIAL,data:{},attributes:O({align:e["text-align"]||"center",mode:"horizontal","icon-size":r,"inner-padding":typeof o.padding=="string"?o.padding:"","padding-top":e["padding-top"]||"","padding-right":e["padding-right"]||"","padding-bottom":e["padding-bottom"]||"","padding-left":e["padding-left"]||""}),mobileAttributes:Q(t.mobileStyle||{}),children:i.length>0?i:[{text:""}]})}function $n(t){var g,b;const e=(((g=t.iconsList)==null?void 0:g.icons)||[]).filter(f=>{const _=String((f==null?void 0:f.href)||"");return!/(?:^|\/\/)(?:www\.)?designedwithbeefree\.com/i.test(_)});if(e.length===0)return null;const o=t.style||{},i=t.computedStyle||{},r=parseInt(String(i.iconHeight||"0"),10)||0;if(e.length===1&&!((b=e[0])!=null&&b.text)){const f=e[0],_=parseInt(String(f.width||"0"),10)||0,S=parseInt(String(f.height||"0"),10)||0,k=r>0&&_>0&&S>0?`${Math.round(r*_/S)}px`:_>0?`${_}px`:"",x=i.iconSpacing||{};return I({type:y.STANDARD_IMAGE,data:{},attributes:O({src:f.image||"",alt:f.alt||"",title:f.title||f.alt||"",href:f.href||"",target:f.target||"_blank",align:o["text-align"]||"center",width:k,"padding-top":x["padding-top"]||o["padding-top"]||"","padding-right":x["padding-right"]||o["padding-right"]||"","padding-bottom":x["padding-bottom"]||o["padding-bottom"]||"","padding-left":x["padding-left"]||o["padding-left"]||""}),children:[{text:""}]})}const a=i.iconSpacing||{},l=a["padding-top"]||"",d=a["padding-right"]||"",s=a["padding-bottom"]||"",c=a["padding-left"]||"",u=e.map(f=>{const _=typeof f.text=="string"?f.text:"",S=parseInt(String(f.width||"0"),10)||0,k=parseInt(String(f.height||"0"),10)||0,x=r>0&&S>0&&k>0?`${Math.round(r*S/k)}px`:"",T=r>0?`${r}px`:"";return I({type:y.STANDARD_SOCIAL_ELEMENT,data:{},attributes:O(W(N(N({src:f.image||"",mode:"custom",href:f.href||"",alt:f.alt||"",title:f.title||f.alt||"",target:f.target||"_blank"},x?{"icon-size":x}:{}),T?{"icon-height":T}:{}),{"padding-top":l,"padding-right":d,"padding-bottom":s,"padding-left":c})),children:_?[{text:_}]:[{text:""}]})}),p=typeof i.iconHeight=="string"?i.iconHeight:"",h=l||d||s||c?`${l||"0px"} ${d||"0px"} ${s||"0px"} ${c||"0px"}`:"";return I({type:y.STANDARD_SOCIAL,data:{},attributes:O({align:o["text-align"]||"left",mode:"horizontal","icon-size":p,"inner-padding":h,color:o.color||"","font-family":o["font-family"]||"","font-size":o["font-size"]||"","font-weight":o["font-weight"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""}),mobileAttributes:Q(t.mobileStyle||{}),children:u})}function Pn(t,n){var E,P;const e=t.table||{},o=e.style||{},i=e.computedStyle||{},r=t.style||{},a=((E=e.content)==null?void 0:E.rows)||[],l=((P=e.content)==null?void 0:P.headers)||[];if(a.length===0&&l.length===0)return null;const d=fe(o["border-top"]||o["border-right"]||o["border-bottom"]||o["border-left"]||""),s=d.color||"",c=d.style||"solid",u=d.width||"1px",p=!!s&&s.toLowerCase()!=="transparent",h=i.linkColor||n.bodyLinkColor||"",g=(C,$={})=>{const L=h?vt(C,h):C,F=j(Et(L))||[{text:""}];return I({type:y.STANDARD_TABLE2_TD,data:{rowspan:1,colspan:1},attributes:O($),children:F})},b=(C,$,L={})=>I({type:y.STANDARD_TABLE2_TR,data:{},attributes:O({"background-color":$}),children:C.map(F=>g((F==null?void 0:F.html)||"",L))}),f=[],_=i.headersBackgroundColor||"",S=i.headersColor||"",k=i.headersFontSize||"",x=i.headersFontWeight||"",T=i.headersTextAlign||"",A=[S?`color:${S}`:"",k?`font-size:${k}`:"",x?`font-weight:${x}`:"",T?`text-align:${T}`:""].filter(Boolean).join(";"),w=C=>A&&C.trim()?`<span style="${A}">${C}</span>`:C;l.forEach(C=>{const $=(C.cells||[]).map(L=>({html:w((L==null?void 0:L.html)||"")}));f.push(b($,_))});const D=i.alternateRowBackgroundColor||"";return a.forEach((C,$)=>{const L=$%2===1?D:"";f.push(b(C.cells||[],L))}),f.length===0?null:I({type:y.STANDARD_TABLE2,data:{},attributes:O({align:o["text-align"]||"center",color:o.color||"","font-family":_t(o["font-family"]),"font-size":o["font-size"]||"","line-height":o["line-height"]||"",width:"100%","table-layout":"auto","border-color":s,"border-style":c,"border-width":u,"border-enabled":!!p,"cell-padding-top":"10px","cell-padding-right":"10px","cell-padding-bottom":"10px","cell-padding-left":"10px","padding-top":r["padding-top"]||"","padding-right":r["padding-right"]||"","padding-bottom":r["padding-bottom"]||"","padding-left":r["padding-left"]||""}),children:f})}function Ln(t){var i,r,a,l,d;const n=((i=t.html)==null?void 0:i.html)||"",e=j(n)||[{text:n}],o=I({type:y.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{},children:e});return I({type:y.STANDARD_PARAGRAPH,data:{},attributes:O({"padding-top":((r=t.style)==null?void 0:r["padding-top"])||"","padding-right":((a=t.style)==null?void 0:a["padding-right"])||"","padding-bottom":((l=t.style)==null?void 0:l["padding-bottom"])||"","padding-left":((d=t.style)==null?void 0:d["padding-left"])||""}),children:[o]})}function On(t,n){const e=t.list||{},o=t.style||{},i=e.style||{},r=e.computedStyle||{},a=e.html||"",l=(e.tag||"ul").toLowerCase()==="ol"?"ol":"ul",d=Bn({"margin-bottom":r.liSpacing&&r.liSpacing!=="0px"?r.liSpacing:"","padding-left":r.liIndent||"","list-style-position":r.listStylePosition||""}),s=[],c=/<li[^>]*>([\s\S]*?)<\/li>/gi;let u;for(;(u=c.exec(a))!==null;)s.push(u[1]);s.length===0&&s.push(a);const p=s.map(b=>{const f=j(b)||[{text:b}];return I({type:y.HTML_BLOCK_NODE,data:{tagName:"li"},attributes:O({style:d}),children:f})}),h=I({type:y.HTML_BLOCK_NODE,data:{tagName:l},attributes:O({style:"margin:0;padding:0 0 0 1.25em"}),children:p}),g=O({align:i["text-align"]||"",color:i.color||"","font-family":_t(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":i["line-height"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""});return I({type:y.STANDARD_PARAGRAPH,data:{},attributes:g,mobileAttributes:Q(t.mobileStyle||{}),children:[h]})}function he(t){if(!t)return{};const n={},e=["padding-top","padding-right","padding-bottom","padding-left","font-size"];for(const o of e)t[o]&&(n[o]=t[o]);return t["text-align"]&&(n.align=t["text-align"]),n}function nt(t){if(!t||typeof t!="string")return"";const n=t.trim().toLowerCase();return!n||n.startsWith("0px")||n.startsWith("0 ")||n.includes("transparent")?"":t}function mt(t){if(!t||typeof t!="string")return"";const n=t.trim();if(!n||n==="none")return"";const e=/^url\((['"]?)([^)]+?)\1\)$/.exec(n);return e?e[2]:""}function vt(t,n){return!t||!n?t:t.replace(/<a\b([^>]*)>/gi,(e,o)=>{if(/\bcolor\s*:/i.test(o))return e;const i=/\bstyle\s*=\s*"([^"]*)"/i.exec(o);if(i){const r=i[1].trim(),a=r&&!r.endsWith(";")?";":"",l=`${r}${a}color:${n};`;return`<a${o.replace(/\bstyle\s*=\s*"[^"]*"/i,`style="${l}"`)}>`}return`<a${o} style="color:${n};">`})}function In(t){if(!t||typeof t!="string")return"";const n=t.toLowerCase().split(/\s+/);return n.includes("left")?"left":n.includes("right")?"right":n.includes("center")?"center":""}function Lt(t,n){return!t||typeof t!="string"?!1:t.split(/\s+/).includes(n)}function Bn(t){const n=[];for(const[e,o]of Object.entries(t))o&&n.push(`${e}:${o}`);return n.join(";")}function Et(t){return t.replace(/<span class="tinyMce-placeholder">/g,"<span>").replace(/<div class="txtTinyMce-wrapper"[^>]*>/g,"<div>")}function _t(t,n){return!t||t==="inherit"?"":t}function Q(t){const n={};for(const[e,o]of Object.entries(t))o&&(e==="padding-top"||e==="padding-right"||e==="padding-bottom"||e==="padding-left"||e==="font-size"||e==="text-align")&&(e==="text-align"?n.align=o:n[e]=o);return n}function Mn(t,n){if(!t)return"";const e=String(t).trim(),o=/^(-?\d+(?:\.\d+)?)%$/.exec(e);if(o)return`${Math.max(1,Math.round(parseFloat(o[1])/100*n))}px`;const i=/^(-?\d+(?:\.\d+)?)(?:px)?$/.exec(e);return i?`${i[1]}px`:e}function O(t){const n={};for(const e of Object.keys(t)){const o=t[e];o===""||o==null||(n[e]=o)}return n}function I(t){return t!=null&&t.mobileAttributes&&typeof t.mobileAttributes=="object"&&Object.keys(t.mobileAttributes).length===0&&delete t.mobileAttributes,t}const q={Text:0,Image:1,Button:2,Social:3,Split:4,Table:5,Product:6,Spacer:7,DropShadow:8,HorizontalRule:9,Header:10,Review:11,Video:13,Coupon:14},Hn={0:"Text",1:"Image",2:"Button",3:"Social",4:"Split",5:"Table",6:"Product",7:"Spacer",8:"DropShadow",9:"HorizontalRule",10:"Header",11:"Review",13:"Video",14:"Coupon"},zn=600;function Wn(t){var f,_,S,k,x;const n=[],e=vn(t);if(!e)throw new Error("klaviyoToEasyEmailPro: input has no { body: { sections } } — pass the template `.data`, not the outer entry");const o=((f=e.body)==null?void 0:f.attributes)||{},i=oo((_=o.width)!=null?_:o.content_width,zn),r=xt(o.background_color,o.bg_color,""),a=e.styles||[],l=((S=a.find(T=>(T==null?void 0:T.style_type)===200))==null?void 0:S.attributes)||{},d=((k=a.find(T=>(T==null?void 0:T.style_type)===300))==null?void 0:k.attributes)||{},s=xt(l.font_family),c=xt(l.color),u=xt(d.color),p={contentWidthPx:i,warnings:n,globalParagraphStyle:l},g=(((x=e.body)==null?void 0:x.sections)||[]).slice().sort(rt).flatMap(T=>Fn(T,p));return{page:{type:y.PAGE,data:{breakpoint:i>700?"768px":"600px",globalAttributes:v({"font-family":s}),categoryAttributes:{},blockAttributes:{},classAttributes:{},preheader:""},attributes:v(N({width:`${i}px`,"background-color":r,"content-background-color":"","margin-top":"0px","margin-bottom":"0px","link-color":u},c?{color:c}:{})),children:g},warnings:n}}function vn(t){var n,e,o;return t?(n=t.body)!=null&&n.sections?t:(o=(e=t.data)==null?void 0:e.body)!=null&&o.sections?t.data:null:null}function Fn(t,n){var s,c,u;const e=((s=t.data)==null?void 0:s.rows)||[];if(e.length===0)return[];const o=N({},((c=t.data)==null?void 0:c.attributes)||{});let i=!1,r;const l=e.flatMap(p=>{var h;return(((h=p.data)==null?void 0:h.columns)||[]).flatMap(g=>{var b;return((b=g.data)==null?void 0:b.blocks)||[]})}).filter(p=>{var h;return((h=p.data)==null?void 0:h.block_type)!==q.Spacer});if(l.length===1){const p=((u=l[0].data)==null?void 0:u.attributes)||{};o.background_color==null&&p.block_background_color!=null&&(r=m(o.background_color,o.content_color),o.background_color=p.block_background_color,i=!0),o.inner_padding_top==null&&p.block_padding_top!=null&&(o.inner_padding_top=p.block_padding_top,i=!0),o.inner_padding_right==null&&p.block_padding_right!=null&&(o.inner_padding_right=p.block_padding_right,i=!0),o.inner_padding_bottom==null&&p.block_padding_bottom!=null&&(o.inner_padding_bottom=p.block_padding_bottom,i=!0),o.inner_padding_left==null&&p.block_padding_left!=null&&(o.inner_padding_left=p.block_padding_left,i=!0)}const d=W(N({},n),{sectionAttrs:o,hoistedToSection:i,originalSectionBg:r});return e.slice().sort(rt).flatMap(p=>Gn(p,d))}function Gn(t,n){var p;const e=(((p=t.data)==null?void 0:p.columns)||[]).slice().sort(rt);if(e.length===0)return[];const o=n.sectionAttrs||{},i=m(o.background_url),r=m(o.background_color,o.content_color),a=m(o.background_format),l=o.background_repeat===!1?"no-repeat":o.background_repeat===!0?"repeat":"",d=m(o.background_position),s=v(W(N({"background-color":r,"background-url":i,"background-position":d,"background-repeat":l,"background-size":a==="cover"?"cover":a==="contain"?"contain":""},i?{"background-image-enabled":"true"}:{}),{"padding-top":R(o.inner_padding_top)||"0px","padding-right":R(o.inner_padding_right)||"0px","padding-bottom":R(o.inner_padding_bottom)||"0px","padding-left":R(o.inner_padding_left)||"0px"})),c={type:y.STANDARD_SECTION,data:{},attributes:s,children:[]},u=e.map(h=>Un(h,n));if(e.length===1)c.children=u;else{const h={type:y.STANDARD_GROUP,data:{},attributes:{},children:u};c.children=[h]}return[c]}function Un(t,n){var i;const o=(((i=t.data)==null?void 0:i.blocks)||[]).slice().sort(rt).flatMap(r=>jn(r,n));return{type:y.STANDARD_COLUMN,data:{},attributes:{},children:o}}function jn(t,n){var o;const e=(o=t.data)==null?void 0:o.block_type;switch(e){case q.Text:return Vn(t,n);case q.Spacer:return Kn(t,n);case q.HorizontalRule:return no(t,n);case q.Image:return Xn(t,n);case q.Button:return Zn(t,n);case q.Social:return qn(t,n);case q.Header:return eo(t,n);case q.Split:return to(t,n);case q.Table:return Jn(t);default:{const i=Hn[e]||`Unknown(${e})`;return n.warnings.push(`block:${i}`),[be(`[TODO Klaviyo block_type=${e} (${i})]`)]}}}function Vn(t,n){var $;const e=it(t,n),o=((($=t.data)==null?void 0:$.content)||"").trim();if(!o)return[];const i=(L,F)=>{var U;return(U=e[L])!=null?U:F?e[F]:void 0},r=ot(i("block_padding_top","block-padding-top"),i("inner_padding_top","inner-padding-top")),a=ot(i("block_padding_right","block-padding-right"),i("inner_padding_right","inner-padding-right")),l=ot(i("block_padding_bottom","block-padding-bottom"),i("inner_padding_bottom","inner-padding-bottom")),d=ot(i("block_padding_left","block-padding-left"),i("inner_padding_left","inner-padding-left")),s=ro(o),c=m(i("text_align","text-align"),s.styles["text-align"]),u=m(i("color"),s.styles.color),p=m(i("font_family","font-family"),s.styles["font-family"]),h=m(i("font_size","font-size"),s.styles["font-size"]),g=n.globalParagraphStyle||{},b=m(i("line_height","line-height"),s.styles["line-height"],g.line_height),f=m(i("letter_spacing","letter-spacing"),s.styles["letter-spacing"]),_=m(i("font_weight","font-weight"),s.styles["font-weight"]),S=m(i("font_style","font-style"),s.styles["font-style"]),k=m(i("block_background_color"),i("background_color")),x=m(i("block_border_width")),T=m(i("block_border_color")),A=m(i("block_border_style")),w=s.tag||io(o),D=w==="h1"?y.STANDARD_H1:w==="h2"?y.STANDARD_H2:w==="h3"?y.STANDARD_H3:y.STANDARD_PARAGRAPH,E=v({align:c,color:u,"font-family":p,"font-size":G(h),"font-weight":_,"font-style":S,"letter-spacing":G(f),"line-height":b,padding:"0px","padding-top":r||"0px","padding-right":a||"0px","padding-bottom":l||"0px","padding-left":d||"0px","container-background-color":k,border:x&&A&&T?`${G(x)} ${A} ${T}`:""}),C=(o.match(/<p[\s>]/gi)||[]).length>1?[{text:o}]:j(o)||[{text:Ft(o)}];return[{type:D,data:{},attributes:E,children:C}]}function Kn(t,n){const e=it(t,n),o=at(e.height),i=m(e.background_color)||(n.hoistedToSection?n.originalSectionBg||"transparent":"");return[{type:y.STANDARD_SPACER,data:{},attributes:v({height:`${o!=null?o:30}px`,"container-background-color":i}),children:[{text:""}]}]}function Xn(t,n){const e=it(t,n),o=m(e.cropped_src,e.src);if(!o)return[];const i=(f,_)=>{var S;return(S=e[f])!=null?S:_?e[_]:void 0},r=m(e.max_width),a=m(e.align)||"center",l=ot(i("block_padding_top","block-padding-top"),i("inner_padding_top","inner-padding-top")),d=ot(i("block_padding_right","block-padding-right"),i("inner_padding_right","inner-padding-right")),s=ot(i("block_padding_bottom","block-padding-bottom"),i("inner_padding_bottom","inner-padding-bottom")),c=ot(i("block_padding_left","block-padding-left"),i("inner_padding_left","inner-padding-left")),u=m(i("border_width")),p=m(i("border_color")),h=m(i("border_style")),g=e.full_width_mobile===!0||e.mobile_stretch_content===!0,b=v(N({src:o,alt:m(e.alt_text),href:m(e.href),align:a,width:r?G(r):"",padding:"0px","padding-top":l||"0px","padding-right":d||"0px","padding-bottom":s||"0px","padding-left":c||"0px","container-background-color":m(e.block_background_color,e.background_color),border:u&&h&&p?`${G(u)} ${h} ${p}`:""},g?{"fluid-on-mobile":"true"}:{}));return[{type:y.STANDARD_IMAGE,data:{},attributes:b,children:[{text:""}]}]}function Zn(t,n){var h;const e=it(t,n),o=(((h=t.data)==null?void 0:h.content)||"").trim(),i=(g,b)=>{var f;return(f=e[g])!=null?f:b?e[b]:void 0},r=m(i("border_width")),a=m(i("border_color")),l=m(i("border_style")),d=r&&l&&a?`${G(r)} ${l} ${a}`:"",s=m(i("font_style")),c=e.stretch===!0,u=v({align:m(i("text_align","text-align"))||"center",href:m(i("href")),color:m(i("color")),"background-color":m(i("background_color")),"border-radius":R(i("border_radius")),border:d,"font-family":m(i("font_family","font-family")),"font-size":G(m(i("font_size","font-size"))),"font-weight":m(i("font_weight","font-weight")),"font-style":s,"line-height":"100%","letter-spacing":G(m(i("letter_spacing","letter-spacing"))),"text-decoration":m(i("text_decoration","text-decoration")),"inner-padding-top":R(i("inner_padding_top","inner-padding-top")),"inner-padding-right":R(i("inner_padding_right","inner-padding-right")),"inner-padding-bottom":R(i("inner_padding_bottom","inner-padding-bottom")),"inner-padding-left":R(i("inner_padding_left","inner-padding-left")),padding:"0px","padding-top":R(i("block_padding_top","block-padding-top"))||"0px","padding-right":R(i("block_padding_right","block-padding-right"))||"0px","padding-bottom":R(i("block_padding_bottom","block-padding-bottom"))||"0px","padding-left":R(i("block_padding_left","block-padding-left"))||"0px","container-background-color":m(i("block_background_color")),width:c?"100%":""}),p=j(o)||[{text:o}];return[{type:y.STANDARD_BUTTON,data:{},attributes:u,children:p}]}function qn(t,n){var d;const e=it(t,n),o=(s,c)=>{var u;return(u=e[s])!=null?u:c?e[c]:void 0},r=(((d=t.data)==null?void 0:d.sub_blocks)||[]).slice().sort(rt).filter(s=>s.block_type===2).map(s=>{const c=s.attributes||{},u=m(c.type).toLowerCase(),p=m(c.link_url,c["link-url"]),h=m(c.text),g=m(c.icon_url);return{type:y.STANDARD_SOCIAL_ELEMENT,data:{},attributes:v(W(N({name:u},g?{mode:"custom",src:g}:{}),{href:p,alt:h||u,title:h||u,target:p?"_blank":""})),children:[{text:""}]}});if(r.length===0)return[];const a=at(o("spacing")),l=a!=null?`0px ${a}px`:"";return[{type:y.STANDARD_SOCIAL,data:{},attributes:v({align:m(o("align"))||"center",mode:e.stack_on_mobile===!0?"vertical":"horizontal","icon-size":G(m(o("size"))),"inner-padding":l,"padding-top":R(o("block_padding_top","block-padding-top")),"padding-right":R(o("block_padding_right","block-padding-right")),"padding-bottom":R(o("block_padding_bottom","block-padding-bottom")),"padding-left":R(o("block_padding_left","block-padding-left")),"container-background-color":m(o("block_background_color"))}),children:r}]}function Jn(t,n){var x,T;const e=((x=t.data)==null?void 0:x.attributes)||{},o=(((T=t.data)==null?void 0:T.sub_blocks)||[]).slice().sort(rt);if(o.length===0)return[];const i=(A,w)=>{var D;return(D=e[A])!=null?D:w?e[w]:void 0},r=at(i("static_num_columns"))||o.length,a=Math.max(1,Math.floor(r)),l=e.headers_enabled===!0,d=o.map(A=>Yn(A)),s=[];for(let A=0;A<d.length;A+=a)s.push(d.slice(A,A+a));const c=m(i("table_background_color")),u=R(i("cell_padding_top"))||"10px",p=R(i("cell_padding_right"))||"10px",h=R(i("cell_padding_bottom"))||"10px",g=R(i("cell_padding_left"))||"10px",b=m(i("block_border_width")),f=m(i("block_border_color")),_=m(i("block_border_style")),S=!!b&&!!f,k=s.map((A,w)=>{const D=l&&w===0;return{type:y.STANDARD_TABLE2_TR,data:{},attributes:v({"background-color":D?c:""}),children:A.map(E=>Qn(E))}});return[{type:y.STANDARD_TABLE2,data:{},attributes:v({align:"center",width:"100%","table-layout":"auto","border-color":f,"border-style":_||"solid","border-width":G(b)||"1px","border-enabled":!!S,"cell-padding-top":u,"cell-padding-right":p,"cell-padding-bottom":h,"cell-padding-left":g,"padding-top":R(i("block_padding_top","block-padding-top")),"padding-right":R(i("block_padding_right","block-padding-right")),"padding-bottom":R(i("block_padding_bottom","block-padding-bottom")),"padding-left":R(i("block_padding_left","block-padding-left")),"container-background-color":m(i("block_background_color"))}),children:k}]}function Yn(t){const n=t.attributes||{};if(t.block_type===6){const e=m(n.cropped_src,n.src);if(!e)return"";const o=m(n.image_width,n.width),i=m(n.image_align),r=m(n.href),a=[];o&&a.push(`width:${G(o)}`),a.push("display:block"),i==="center"?a.push("margin:0 auto"):i==="right"&&a.push("margin-left:auto");const l=` style="${a.join(";")}"`,d=`<img src="${e}" alt="${Bt(m(n.alt))}"${l}>`;return r?`<a href="${r}">${d}</a>`:d}return(t.content||"").trim()}function Qn(t){const n=j(t)||[{text:Ft(t)||""}];return{type:y.STANDARD_TABLE2_TD,data:{rowspan:1,colspan:1},attributes:{},children:n}}function to(t,n){var _,S;const e=it(t,n),o=(((_=t.data)==null?void 0:_.sub_blocks)||[]).slice().sort(rt);if(o.length===0)return[];const i=(k,x)=>{var T;return(T=e[k])!=null?T:x?e[x]:void 0},r=m(i("block_background_color")),a=R(i("block_padding_top","block-padding-top")),l=R(i("block_padding_bottom","block-padding-bottom")),d=R(i("block_padding_left","block-padding-left")),s=R(i("block_padding_right","block-padding-right")),c=(S=at(i("padding_in_between")))!=null?S:0,u=(()=>{const x=m(i("column_widths")).match(/^(\d+(?:\.\d+)?)%$/);return x?parseFloat(x[1]):null})(),p=k=>{const x=k.attributes||{};if(k.block_type===6){const T=m(x.cropped_src,x.src);if(!T)return null;const A=m(x.image_width,x.width),w=A?` width="${parseInt(A,10)||A}"`:"",D=Bt(m(x.alt,x.alt_text));return`<img src="${Bt(T)}" alt="${D}"${w} style="display:block;max-width:100%;border:0;">`}return k.block_type===5||k.block_type===7?(k.content||"").trim():null};if(o.length===1){const k=o[0],x=k.attributes||{};if(k.block_type===6){const A=m(x.cropped_src,x.src);return A?[{type:y.STANDARD_IMAGE,data:{},attributes:v({src:A,alt:m(x.alt,x.alt_text),href:m(x.href,x.link_url),align:m(x.image_align)||"center",width:m(x.image_width,x.width)?G(m(x.image_width,x.width)):"",padding:"0px","padding-top":a||"0px","padding-right":s||"0px","padding-bottom":l||"0px","padding-left":d||"0px","container-background-color":r}),children:[{text:""}]}]:[]}const T=(k.content||"").trim();return T?[{type:y.STANDARD_PARAGRAPH,data:{},attributes:v({padding:"0px","padding-top":a||"0px","padding-right":s||"0px","padding-bottom":l||"0px","padding-left":d||"0px","container-background-color":r}),children:j(T)||[{text:Ft(T)}]}]:[]}const h=(()=>{if(u!=null&&o.length===2)return[u,100-u];const k=(100/o.length).toFixed(2);return o.map(()=>parseFloat(k))})(),b=`<table role="presentation" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse"><tr>${o.map((k,x)=>{const T=p(k);if(T==null)return"";const A=h[x]!=null?`width:${h[x]}%;`:"",D=!(x===o.length-1)&&c>0?`padding-right:${c/2}px;`:"",E=x>0&&c>0?`padding-left:${c/2}px;`:"";return`<td valign="top" style="${A}${D}${E}">${T}</td>`}).join("")}</tr></table>`,f=[{type:y.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{},children:[{text:b}]}];return[{type:y.STANDARD_PARAGRAPH,data:{},attributes:v({padding:"0px","padding-top":a||"0px","padding-right":s||"0px","padding-bottom":l||"0px","padding-left":d||"0px","container-background-color":r}),children:f}]}function eo(t,n){var x;const e=it(t,n),o=(((x=t.data)==null?void 0:x.sub_blocks)||[]).slice().sort(rt),i=(T,A)=>{var w;return(w=e[T])!=null?w:A?e[A]:void 0},r=m(i("block_background_color")),a=R(i("block_padding_top","block-padding-top")),l=R(i("block_padding_right","block-padding-right")),d=R(i("block_padding_bottom","block-padding-bottom")),s=R(i("block_padding_left","block-padding-left")),c=m(i("color")),u=m(i("font_family","font-family")),p=G(m(i("font_size","font-size"))),h=m(i("font_weight","font-weight")),g=m(i("font_style","font-style")),b=G(m(i("letter_spacing","letter-spacing"))),f=m(i("text_decoration","text-decoration")),_=R(i("logo_link_spacing")),S=[];for(const T of o){const A=T.attributes||{};if(T.block_type===10||T.block_type===12){const w=m(A.src);if(!w)continue;const D=m(A.width),E=m(A.height);S.push({type:y.STANDARD_IMAGE,data:{},attributes:v({src:w,alt:m(A.alt_text,A.alt),href:m(A.link_url,A["link-url"],A.href),align:m(i("logo_align"))||"center",width:D?G(D):"",height:E?G(E):"",padding:"0px","padding-top":a||"0px","padding-right":l||"0px","padding-bottom":_||"0px","padding-left":s||"0px","container-background-color":r}),children:[{text:""}]})}}const k=o.filter(T=>T.block_type===11);if(k.length>0){const T=v({color:c,"font-family":u,"font-size":p,"font-weight":h,"font-style":g,"letter-spacing":b,"line-height":"100%","text-decoration":f||"none","text-transform":"none","padding-top":"10px","padding-right":"10px","padding-bottom":"10px","padding-left":"10px"}),A=k.map(w=>{const D=m((w.attributes||{}).text,w.content),E=m((w.attributes||{}).link_url,(w.attributes||{})["link-url"]);return{type:y.STANDARD_NAVBAR_LINK,data:{},attributes:v(N({href:E,target:E?"_blank":""},T)),children:[{text:D}]}});S.push({type:y.STANDARD_NAVBAR,data:{},attributes:v({align:m(i("item_align"))||"center","padding-top":"0px","padding-right":l,"padding-bottom":d,"padding-left":s,"container-background-color":r}),children:A})}return S.length===0?[be("[TODO Klaviyo Header (no recognized sub_blocks)]")]:S}function no(t,n){const e=it(t,n),o=(i,r)=>{var a;return(a=e[i])!=null?a:r?e[r]:void 0};return[{type:y.STANDARD_DIVIDER,data:{},attributes:v({"border-color":m(o("border_color")),"border-style":m(o("border_style"))||"solid","border-width":G(m(o("border_width"))||"1"),width:"100%",padding:"0px","padding-top":R(o("block_padding_top","block-padding-top"))||"0px","padding-right":R(o("block_padding_right","block-padding-right"))||"0px","padding-bottom":R(o("block_padding_bottom","block-padding-bottom"))||"0px","padding-left":R(o("block_padding_left","block-padding-left"))||"0px","container-background-color":m(o("block_background_color"))}),children:[{text:""}]}]}function it(t,n){var o;const e=N({},((o=t.data)==null?void 0:o.attributes)||{});return n.hoistedToSection&&(delete e.block_background_color,delete e.block_padding_top,delete e.block_padding_right,delete e.block_padding_bottom,delete e.block_padding_left,delete e["block-padding-top"],delete e["block-padding-right"],delete e["block-padding-bottom"],delete e["block-padding-left"]),e}function be(t){return{type:y.STANDARD_PARAGRAPH,data:{},attributes:{color:"#888888","font-size":"12px"},children:[{text:t}]}}function rt(t,n){var e,o;return((e=t.position)!=null?e:0)-((o=n.position)!=null?o:0)}function oo(t,n){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const e=parseInt(t,10);if(Number.isFinite(e)&&e>0)return e}return n}function xt(...t){for(const n of t)if(typeof n=="string"&&n.length>0)return n;return""}function v(t){const n={};for(const e of Object.keys(t))t[e]!==""&&t[e]!=null&&(n[e]=t[e]);return n}function m(...t){for(const n of t){if(typeof n=="string"&&n.length>0)return n;if(typeof n=="number"&&Number.isFinite(n))return String(n)}return""}function ot(t,n){const e=at(t),o=at(n);return e==null&&o==null?"":`${(e||0)+(o||0)}px`}function at(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const n=t.match(/^(-?\d+(?:\.\d+)?)/);if(n)return parseFloat(n[1])}return null}function G(t){return t?/^\d+(?:\.\d+)?$/.test(t)?`${t}px`:t:""}function R(t){const n=at(t);return n==null?"":`${n}px`}function io(t){const n=t.match(/<\s*(h1|h2|h3|p|div)\b/i);return n?n[1].toLowerCase():"p"}function ro(t){const n=t.match(/^\s*<(p|h[1-6]|div)\b([^>]*)>([\s\S]*?)<\/\1>\s*$/i);if(!n)return{tag:"",styles:{}};const e=n[1].toLowerCase(),i=n[2].match(/style\s*=\s*"([^"]*)"/i),r={};if(i)for(const a of i[1].split(";")){const l=a.indexOf(":");if(l<0)continue;const d=a.slice(0,l).trim().toLowerCase(),s=a.slice(l+1).trim();d&&s&&(r[d]=s)}return{tag:e,styles:r}}function Ft(t){return t.replace(/<[^>]*>/g,"")}function Bt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}exports.beefreeToEasyEmailPro=yn;exports.htmlToTextNodes=j;exports.klaviyoToEasyEmailPro=Wn;exports.unlayerToEasyEmailPro=$e;
1
+ "use strict";var ye=Object.defineProperty,_e=Object.defineProperties;var Ae=Object.getOwnPropertyDescriptors;var Ut=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable;var jt=(t,n,e)=>n in t?ye(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,N=(t,n)=>{for(var e in n||(n={}))ke.call(n,e)&&jt(t,e,n[e]);if(Ut)for(var e of Ut(n))xe.call(n,e)&&jt(t,e,n[e]);return t},W=(t,n)=>_e(t,Ae(n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Se=require("he"),Pt={PAGE:"page",SECTION:"section",COLUMN:"column",GROUP:"group",TEXT:"text",IMAGE:"image",DIVIDER:"divider",SPACER:"spacer",BUTTON:"button",WRAPPER:"wrapper",RAW:"raw",HERO:"hero",CAROUSEL:"carousel",NAVBAR:"navbar",NAVBAR_LINK:"navbar-link",SOCIAL:"social",SOCIAL_ELEMENT:"social-element",MERGETAG:"mergetag",LINE_BREAK:"line-break",PLACEHOLDER:"placeholder",TABLE:"table",DANGEROUS_CODE:"dangerous-code",HTML_NODE:"html-node",HTML_BLOCK_NODE:"html-block-node",HTML_DOM_NODE:"html-dom-node",CONTENT_WIDGET:"content_widget",SECTION_WIDGET:"section_widget",WRAPPER_WIDGET:"wrapper_widget",PAGE_HEADER:"page-header",PAGE_FOOTER:"page-footer"},Te={STANDARD_HERO:"standard-hero",STANDARD_WRAPPER:"standard-wrapper",STANDARD_SECTION:"standard-section",STANDARD_GROUP:"standard-group",STANDARD_COLUMN:"standard-column",STANDARD_IMAGE:"standard-image",STANDARD_DIVIDER:"standard-divider",STANDARD_SPACER:"standard-spacer",STANDARD_NAVBAR:"standard-navbar",STANDARD_NAVBAR_LINK:"standard-navbar-link",STANDARD_SOCIAL:"standard-social",STANDARD_SOCIAL_ELEMENT:"standard-social-element",STANDARD_BUTTON:"standard-button",STANDARD_TEXT:"standard-text",STANDARD_PARAGRAPH:"standard-paragraph",STANDARD_H1:"standard-h1",STANDARD_H2:"standard-h2",STANDARD_H3:"standard-h3",STANDARD_H4:"standard-h4",STANDARD_TABLE:"standard-table",STANDARD_TEXT_LIST:"standard-text-list",STANDARD_TEXT_LIST_ITEM:"standard-text-list-item",STANDARD_BLOCK_QUOTE:"standard-blockquote",STANDARD_TABLE2:"standard-table2",STANDARD_TABLE2_TR:"standard-table2-tr",STANDARD_TABLE2_TD:"standard-table2-td"},we={FOR_EACH:"logic-for-each",SHOW:"logic-show"},m=N(N(N({},Pt),Te),we),ne={PAGE:"page",RAW:"raw",HERO:"hero",WRAPPER:"wrapper",SECTION:"section",COLUMN:"column",GROUP:"group",TEXT:"text",TABLE:"table",BUTTON:"button",IMAGE:"image",DIVIDER:"divider",NAVBAR:"navbar",NAVBAR_LINK:"navbar-link",SOCIAL:"social",SOCIAL_ELEMENT:"social-element",SPACER:"spacer",TEXT_LIST:"text-list",TEXT_LIST_ITEM:"text-list-item",INLINE_TEXT:"inline-text",BLOCK_NODE:"block-node",DANGEROUS_CODE:"dangerous_code",UNKNOWN_CONTENT:"unknown-content ",AMP_BLOCK:"amp-block",UNSET:"unset",UNSET_RENDER:"unset-render",TABLE2_TR:"table2-tr",TABLE2_TD:"table2-td",PAGE_HEADER:"page-header",PAGE_FOOTER:"page-footer"};function Tt(t){if(!t||typeof t!="string")return null;const n=t.trim().split(/\s+/).filter(Boolean);if(n.length===0)return null;let e,o,i,r;return n.length===1?e=o=i=r=n[0]:n.length===2?(e=i=n[0],o=r=n[1]):n.length===3?(e=n[0],o=r=n[1],i=n[2]):(e=n[0],o=n[1],i=n[2],r=n[3]),{top:e,right:o,bottom:i,left:r}}function J(t,n="padding"){const e=t[n];if(!e)return t;const o=Tt(e);if(!o)return delete t[n],t;const i={top:`${n}-top`,right:`${n}-right`,bottom:`${n}-bottom`,left:`${n}-left`};return t[i.top]==null&&(t[i.top]=o.top),t[i.right]==null&&(t[i.right]=o.right),t[i.bottom]==null&&(t[i.bottom]=o.bottom),t[i.left]==null&&(t[i.left]=o.left),delete t[n],t}function oe(t){return Se.decode(t)}function De(t){var i,r,a;const n={},e=/([a-zA-Z_:][-\w:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/g;let o;for(;(o=e.exec(t))!==null;)n[o[1].toLowerCase()]=oe((a=(r=(i=o[2])!=null?i:o[3])!=null?r:o[4])!=null?a:"");return n}function Re(t){const n={};return t.split(";").forEach(e=>{const o=e.indexOf(":");if(o<0)return;const i=e.slice(0,o).trim().toLowerCase(),r=e.slice(o+1).trim();r&&(i==="color"?n.color=r:i==="font-size"?n.fontSize=r:i==="font-family"?n.fontFamily=r:i==="line-height"?n.lineHeight=r:i==="font-weight"&&/^(bold|[6-9]\d{2})$/.test(r)?n.bold=!0:i==="font-style"&&r==="italic"?n.italic=!0:i==="text-decoration"&&/underline/.test(r)?n.underline=!0:i==="text-decoration"&&/line-through/.test(r)&&(n.strikethrough=!0))}),n}const Ce=new Set(["br","img","hr","input","meta","link"]),Vt=new Set(["p","div","h1","h2","h3","h4","h5","h6","li"]);function Ee(t){const n=[],e=/<!--[\s\S]*?-->|<\/([a-zA-Z][\w-]*)\s*>|<([a-zA-Z][\w-]*)([^>]*?)\/?\s*>/g;let o=0,i;for(;(i=e.exec(t))!==null;)if(i.index>o&&n.push({kind:"text",text:t.slice(o,i.index)}),o=i.index+i[0].length,!i[0].startsWith("<!--")){if(i[1])n.push({kind:"close",name:i[1].toLowerCase()});else if(i[2]){const r=i[2].toLowerCase(),a=De(i[3]||""),d=i[0].endsWith("/>")||Ce.has(r);n.push({kind:"open",name:r,attrs:a,selfClose:d})}}return o<t.length&&n.push({kind:"text",text:t.slice(o)}),n}function V(t){if(!t)return[{text:""}];const n=Ee(t),e=[{}],o=[];let i=0;const r=()=>e[e.length-1],a=g=>{if(!g)return;const u={text:g},l=r();l.bold&&(u.bold=!0),l.italic&&(u.italic=!0),l.underline&&(u.underline=!0),l.strikethrough&&(u.strikethrough=!0),l.color&&(u.color=l.color),l.fontSize&&(u.fontSize=l.fontSize),l.fontFamily&&(u.fontFamily=l.fontFamily),l.lineHeight&&(u.lineHeight=l.lineHeight),l.link&&(u.link={href:l.link.href,blank:l.link.blank}),o.push(u)},d=()=>{o.push({type:Pt.LINE_BREAK,data:{},attributes:{},children:[{text:""}]})},c=()=>{const g=o[o.length-1];return!!g&&"type"in g&&g.type===Pt.LINE_BREAK},s=()=>{if(i>0&&o.length>0)for(let g=0;g<i;g++)d();i=0},p=g=>!!g&&g.kind==="open"&&!g.selfClose&&!Vt.has(g.name);for(let g=0;g<n.length;g++){const u=n[g];if(u.kind==="text"){const l=oe(u.text);if(i>0&&!l.trim())continue;let f=l.replace(/\s+/g," ");if(!f)continue;f.endsWith(" ")&&p(n[g+1])&&(f+="​"),s(),a(f)}else if(u.kind==="open"){const{name:l,attrs:f,selfClose:T}=u;if(l==="br"){s(),d();continue}const h=W(N({},r()),{tag:l});if(l==="strong"||l==="b"?h.bold=!0:l==="em"||l==="i"?h.italic=!0:l==="u"?h.underline=!0:l==="s"||l==="strike"||l==="del"?h.strikethrough=!0:l==="a"&&f.href&&(h.link={href:f.href,blank:(f.target||"").toLowerCase()==="_blank"}),f.style&&Object.assign(h,Re(f.style)),T)continue;e.push(h)}else{const l=e.findLastIndex(f=>f.tag===u.name);l>0&&(e.splice(l),Vt.has(u.name)&&!c()&&(i+=1))}}return o.length===0?[{text:""}]:o}function Ne(t,n={}){var f,T,h,x;const e=[],o=Pe(t,(f=n.pageIndex)!=null?f:0);if(!o)throw new Error("unlayerToEasyEmailPro: could not find a design with body.rows in the input");const i=o.body,r=(i==null?void 0:i.values)||{},a=typeof r.contentWidth=="number"?r.contentWidth:parseInt(String(r.contentWidth||""),10)||600,d=`${a}px`,c={};(T=r.fontFamily)!=null&&T.value&&(c["font-family"]=r.fontFamily.value);const s={};r.textColor&&(s[ne.TEXT]={color:r.textColor});const p=tn(i,r.fontFamily),g=480,u=((i==null?void 0:i.rows)||[]).flatMap(A=>{var S,_;return Le(A,{contentWidthPx:a,columnPxWidth:a,bodyLinkColor:((S=r.linkStyle)==null?void 0:S.linkColor)||"",bodyFontFamily:((_=r.fontFamily)==null?void 0:_.value)||"",templateUsesFullWidth:$e((i==null?void 0:i.rows)||[],a),warnings:e})});return{page:{type:m.PAGE,data:N({breakpoint:`${g}px`,globalAttributes:c,categoryAttributes:s,blockAttributes:{},classAttributes:{},preheader:r.preheaderText||""},p.length>0?{fonts:p}:{}),attributes:M({width:d,"background-color":r.backgroundColor||"","content-background-color":"","margin-top":"0px","margin-bottom":"0px","link-color":((h=r.linkStyle)==null?void 0:h.linkColor)||"","link-text-decoration":(x=r.linkStyle)!=null&&x.linkUnderline?"underline":""}),children:u},warnings:e}}function $e(t,n){for(const e of t){const i=((e==null?void 0:e.values)||{}).backgroundImage;if((i==null?void 0:i.fullWidth)===!0&&typeof i.width=="number"&&i.width>n)return!0}return!1}function Pe(t,n){var e,o,i,r,a,d,c,s,p,g,u;if(!t)return null;if((e=t.body)!=null&&e.rows)return t;if((i=(o=t.design)==null?void 0:o.body)!=null&&i.rows)return t.design;if(Array.isArray(t.templates)&&t.templates.length>0){const l=t.templates[0],f=((r=l.StockTemplatePages)==null?void 0:r[n])||((a=l.StockTemplatePages)==null?void 0:a[0]);if((c=(d=f==null?void 0:f.design)==null?void 0:d.body)!=null&&c.rows)return f.design;if((p=(s=l.design)==null?void 0:s.body)!=null&&p.rows)return l.design}if(Array.isArray(t.StockTemplatePages)){const l=t.StockTemplatePages[n]||t.StockTemplatePages[0];if((u=(g=l==null?void 0:l.design)==null?void 0:g.body)!=null&&u.rows)return l.design}return null}function Le(t,n){var g;const e=t.values||{};if(dt(e)==="hidden")return[];const o=(g=Tt(e.padding))!=null?g:{top:"0px",right:"0px",bottom:"0px",left:"0px"},i=Qt(o.top),r=Qt(o.bottom),a=!!e.backgroundColor,c=!!(wt(t.columns||[])||e.columnsBackgroundColor),s=!a&&c&&(!i||!r);if(dn(t))return Nt([ln(t,n,o)],e);if(an(t),!s)return Nt([Kt(t,n,o,!0)],e);const p=[];return i||p.push(Xt({top:o.top,right:o.right,bottom:"0px",left:o.left},n)),p.push(Kt(t,n,{top:"0px",right:o.right,bottom:"0px",left:o.left},!0)),r||p.push(Xt({top:"0px",right:o.right,bottom:o.bottom,left:o.left},n)),Nt(p,e)}function Kt(t,n,e,o){var y,w,D,C;const i=t.values||{},r=t.cells||[1],a=r.reduce((P,E)=>P+Number(E||0),0)||1,d=o?wt(t.columns||[]):"",c=o&&!d?rn(t.columns||[]):"",s=d||c||i.columnsBackgroundColor||"",p=d||c||i.backgroundColor||s||"",g=o&&!i.backgroundColor&&(!!d||!!c||se(t.columns||[])),u={"background-color":p,"padding-top":e.top,"padding-right":e.right,"padding-bottom":e.bottom,"padding-left":e.left};zt(u);const l=(t.columns||[]).map(P=>{var $;const E=(($=P.values)==null?void 0:$.border)||{};return H(E.borderLeftWidth)+H(E.borderRightWidth)});if(o){const P=en(t.columns||[]);Object.assign(u,P);const E=nn(t.columns||[]);Object.assign(u,E)}const f=i.backgroundImage;!!(f!=null&&f.url)&&(Object.assign(u,ee(f)),u["background-image-enabled"]=!0),n.templateUsesFullWidth&&!g&&(u["full-width"]="full-width");const h=tt(i._override);u["border-left"]&&(h["border-left"]="0px solid transparent"),u["border-right"]&&(h["border-right"]="0px solid transparent");const x=(w=(y=i._override)==null?void 0:y.mobile)==null?void 0:w.backgroundImage;x!=null&&x.url&&x.url!==(f==null?void 0:f.url)&&(Object.assign(h,ee(x)),h["background-image-enabled"]=!0);const A=Ye(i.alignItems),S=(t.columns||[]).map((P,E)=>{var Y;const $=Number((Y=r[E])!=null?Y:1)/a,L=Je($),F=Math.max(1,Math.round(n.contentWidthPx*$)-(l[E]||0)),U=Oe(P,L,W(N({},n),{columnPxWidth:F}));return U&&A&&(U.attributes=W(N({},U.attributes),{"vertical-align":A})),U}).filter(P=>P!=null),_=!!((C=(D=i._override)==null?void 0:D.mobile)!=null&&C.noStackMobile),k=S.length>0?_&&S.length>1?[B({type:m.STANDARD_GROUP,data:{},attributes:{width:"100%"},children:S})]:S:[qe()];return B({type:m.STANDARD_SECTION,data:{},attributes:M(u),mobileAttributes:M(h),children:k})}function Xt(t,n){const e={"background-color":"","padding-top":t.top,"padding-right":t.right,"padding-bottom":t.bottom,"padding-left":t.left};zt(e),n.templateUsesFullWidth&&(e["full-width"]="full-width");const o=B({type:m.STANDARD_PARAGRAPH,data:{},attributes:{"padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",padding:"0px 0px 0px 0px","font-size":"0px","line-height":"0"},children:[{text:""}]}),i=B({type:m.STANDARD_COLUMN,data:{},attributes:{width:"100%","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},children:[o]});return B({type:m.STANDARD_SECTION,data:{},attributes:M(e),children:[i]})}function Oe(t,n,e){var d,c;const o=t.values||{};if(dt(o)==="hidden")return null;const i={width:n,"background-color":o.backgroundColor||"","border-radius":o.borderRadius||""};J(Object.assign(i,gn(o))),Object.assign(i,te(o.border));const r=tt(o._override);Object.assign(r,te((c=(d=o._override)==null?void 0:d.mobile)==null?void 0:c.border,{includeZero:!0}));let a=(t.contents||[]).map(s=>ie(s,e)).filter(s=>s!=null);return a.length===0&&(a=[_t()]),Dt(B({type:m.STANDARD_COLUMN,data:{},attributes:M(i),mobileAttributes:M(r),children:a}),o)}function ie(t,n){const e=t.values||{};if(dt(e)==="hidden")return null;let o;switch(t.type){case"heading":o=Me(e,n);break;case"text":o=re(e,n);break;case"paragraph":o=He(e,n);break;case"image":o=ae(e,n);break;case"button":o=Fe(e,n);break;case"divider":o=Ge(e);break;case"menu":o=Ue(e,n);break;case"social":o=je(e);break;case"timer":throw new Error("Unlayer countdown/timer block is not supported — skip this template");case"html":o=Xe(e);break;default:return n.warnings.push(`Unsupported block type "${t.type}" — skipped`),null}return Dt(o,e)}function Bt(t,n){const e=t==null?void 0:t.linkStyle;return e&&e.inherit===!1&&e.linkColor?e.linkColor:n.bodyLinkColor}function Lt(t,n){return n?t.map(e=>"text"in e&&e.link&&!e.color?W(N({},e),{color:n}):e):t}function Mt(t,n){const e=Be(t),o={align:t.textAlign||"",color:t.color||"","font-family":Ht(t.fontFamily,n),"font-size":t.fontSize||"","line-height":e||t.lineHeight||"","letter-spacing":t.letterSpacing||"","container-background-color":""};return J(Object.assign(o,ut(t))),o}function Ht(t,n){const e=(t==null?void 0:t.value)||"";return e?e.trim().toLowerCase()==="inherit"?n.bodyFontFamily||"":e:""}const Ie=/<(?:span|strong|em|b|i)\b[^>]*\bstyle\s*=\s*"[^"]*\bline-height\s*:\s*([^;"]+)/i;function Be(t){const n=t.text;if(!n)return"";const e=Ie.exec(n);if(!e)return"";const o=e[1].trim(),i=H(t.fontSize);if(!i)return"";const r=qt(o,i),a=qt(t.lineHeight,i);return r==null||a!=null&&r<=a?"":o}function qt(t,n){if(t==null||t==="")return null;const e=String(t).trim();if(e.endsWith("%")){const i=parseFloat(e);return Number.isFinite(i)?i/100*n:null}if(e.endsWith("px")){const i=parseFloat(e);return Number.isFinite(i)?i:null}const o=parseFloat(e);return Number.isFinite(o)?o*n:null}function Me(t,n){const e=Ze(t.headingType),o=Mt(t,n);return t.fontWeight==null&&!o["font-weight"]&&(o["font-weight"]="400"),B({type:e,data:{},attributes:M(o),mobileAttributes:M(tt(t._override,{padding:!0})),children:Lt(V(t.text),Bt(t,n))})}function re(t,n){const e=Mt(t,n),o=ce(t.text||"",Bt(t,n));return B({type:m.STANDARD_PARAGRAPH,data:{},attributes:M(e),mobileAttributes:M(tt(t._override,{padding:!0})),children:o.length>0?o:[{text:""}]})}function He(t,n){const e=We(t.textJson);return re(W(N({},t),{text:e}),n)}function We(t){if(!t)return"";let n;try{n=typeof t=="string"?JSON.parse(t):t}catch(o){return""}const e=n==null?void 0:n.root;return!e||!Array.isArray(e.children)?"":St(e.children)}function St(t){return t.map(ze).join("")}function ze(t){var e,o,i,r,a,d;if(!t)return"";switch(t.type){case"paragraph":return`<p>${St(t.children||[])||"&nbsp;"}</p>`;case"extended-link":case"link":{const c=t.url||((e=t.values)==null?void 0:e.href)||((o=t.attrs)==null?void 0:o.href)||"",s=t.target||((i=t.values)==null?void 0:i.target)||((r=t.attrs)==null?void 0:r.target)||"",p=St(t.children||[]),g=[`href="${Jt(c)}"`];return s&&g.push(`target="${Jt(s)}"`),`<a ${g.join(" ")}>${p}</a>`}case"extended-text":case"text":{const c=Zt(String((a=t.text)!=null?a:""));return ve(c,Number(t.format||0))}case"merge_tag":{const c=t.text||((d=t.properties)==null?void 0:d.value)||t.value||"";return Zt(String(c))}case"linebreak":return"<br>";default:return Array.isArray(t.children)?St(t.children):""}}function ve(t,n){return n&&(n&1&&(t=`<strong>${t}</strong>`),n&2&&(t=`<em>${t}</em>`),n&4&&(t=`<s>${t}</s>`),n&8&&(t=`<u>${t}</u>`)),t}function Zt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Jt(t){return String(t).replace(/"/g,"&quot;")}function ae(t,n){var A,S,_,k,y,w,D,C,P,E,$,L,F,U,Y,lt,st;const e=((A=t.src)==null?void 0:A.url)||"",o=t.action||{},i=Wt(o),r={src:e,alt:t.altText||"",title:t.title||"",href:i.href,target:i.target,align:t.textAlign||"center"};J(Object.assign(r,ut(t)));const a=typeof((S=t.src)==null?void 0:S.height)=="number"?t.src.height:0,d=typeof((_=t.src)==null?void 0:_.width)=="number"?t.src.width:0;if(a>0&&a<=5&&d>0&&d/a>=50){const q=H((k=r["padding-bottom"])!=null?k:"0px");r["padding-bottom"]=`${q+16}px`}const c=H(r["padding-left"])+H(r["padding-right"]),s=Math.max(1,n.columnPxWidth-c),p=(y=t.src)==null?void 0:y.maxWidth;p?r.width=Ot(p,s):typeof((w=t.src)==null?void 0:w.width)=="number"&&(r.width=`${Math.min(t.src.width,s)}px`),Yt(e)&&(r.height=(D=t.src)!=null&&D.height?le(t.src.height,(C=t.src)==null?void 0:C.width,r.width):"18px");const g=typeof((P=t.src)==null?void 0:P.width)=="number"?t.src.width:void 0,u=H(r.width),l=fn(t._override,g,u||void 0,typeof((E=t.src)==null?void 0:E.maxWidth)=="string"?t.src.maxWidth:void 0,{brokenImage:Yt(e),srcNativeHeight:typeof(($=t.src)==null?void 0:$.height)=="number"?t.src.height:void 0,desktopPaddingLeft:H(r["padding-left"]),desktopPaddingRight:H(r["padding-right"]),align:t.textAlign||"center"}),f=(Y=(U=(F=(L=t._override)==null?void 0:L.mobile)==null?void 0:F.src)==null?void 0:U.maxWidth)!=null?Y:p,T=f==="0%"||f==="0"||f===0,h=et=>{if(!et)return!1;const q=String(et).trim();return q!=="0"&&q!=="0px"&&q!=="0 0 0 0"},x=h(l["padding-top"])||h(l["padding-bottom"])||h(l.padding);if(T&&!x&&(l["padding-top"]="8px",l["padding-bottom"]="9px"),u&&l["fluid-on-mobile"]!=="true"){const et=H(r["padding-left"]),q=H(r["padding-right"]),Ct=Math.max(1,n.columnPxWidth-et-q),ft=Math.min(u,Ct),ct=l["padding-left"],pt=l["padding-right"],gt=ct!=null&&ct!==""?H(String(ct)):et,ht=pt!=null&&pt!==""?H(String(pt)):q;if(n.columnPxWidth-gt-ht<ft){const j=Math.max(0,n.columnPxWidth-ft),K=gt+ht;if(K>0&&j<K){const kt=j/K,bt=Math.round(gt*kt),Gt=j-bt;if(l["padding-left"]=`${bt}px`,l["padding-right"]=`${Gt}px`,l.padding){const be=H(String((lt=l["padding-top"])!=null?lt:0)),me=H(String((st=l["padding-bottom"])!=null?st:0));l.padding=`${be}px ${Gt}px ${me}px ${bt}px`}}}}return B({type:m.STANDARD_IMAGE,data:{},attributes:M(r),mobileAttributes:M(l),children:[{text:""}]})}function Fe(t,n){const e=t.href||{},o=Wt(e),i=t.buttonColors||{},r={align:t.textAlign||"center",href:o.href,target:o.target,color:i.color||"","background-color":i.backgroundColor||"","font-size":t.fontSize||"","font-family":Ht(t.fontFamily,n),"line-height":t.lineHeight||"","border-radius":t.borderRadius||"",width:de(t.size)};J(Object.assign(r,ut(t))),J(Object.assign(r,{"inner-padding":t.padding}),"inner-padding");const a=pe(t.border);return a.width&&(r["border-enabled"]=!0,r["border-width"]=a.width,r["border-style"]=a.style,r["border-color"]=a.color),B({type:m.STANDARD_BUTTON,data:{},attributes:M(r),mobileAttributes:M(hn(t._override)),children:V(t.text)})}function Ge(t){const n=pe(t.border,"borderTop"),e={width:t.width||"100%",align:t.textAlign||"center","border-color":n.color||"#000000","border-style":n.style||"solid","border-width":n.width||"1px"};return J(Object.assign(e,ut(t))),B({type:m.STANDARD_DIVIDER,data:{},attributes:M(e),mobileAttributes:M(tt(t._override,{padding:!0})),children:[{text:""}]})}function Ue(t,n){var f,T,h;const e=((f=t.menu)==null?void 0:f.items)||[],o="",i=t.linkColor||t.textColor||"",r=t.fontSize||"",a=Ht(t.fontFamily,n),d=t.padding||"",c=((h=(T=t._override)==null?void 0:T.mobile)==null?void 0:h.padding)||"",s=t.textTransform||"none",p=(x,A,S)=>{const _=Wt(S);return B({type:m.STANDARD_NAVBAR_LINK,data:{},attributes:M({href:A?"":_.href,target:A?"":_.target,color:i,"font-size":r,"font-family":a,"line-height":"1.2",padding:d,"text-transform":s,"text-decoration":"none"}),mobileAttributes:c?{padding:c}:void 0,children:A?[{text:x}]:V(x)})},g=[];e.forEach((x,A)=>{A>0&&o&&g.push(p(o,!0)),g.push(p(x.text||"",!1,x.link))});const u={align:t.align||"center",color:i,"font-size":r,"font-family":a,"text-transform":s};J(Object.assign(u,ut(t)));const l=t._override?W(N({},t._override),{mobile:t._override.mobile?W(N({},t._override.mobile),{padding:void 0}):void 0}):void 0;return B({type:m.STANDARD_NAVBAR,data:{},attributes:M(u),mobileAttributes:M(tt(l,{padding:!0})),children:g.length>0?g:[_t()]})}function je(t,n){var a,d;const e=((a=t.icons)==null?void 0:a.icons)||[],o=((d=t.icons)==null?void 0:d.iconType)||"rounded",i=e.map(c=>{const s=String(c.name||"").trim(),p=Ke(s);return B({type:m.STANDARD_SOCIAL_ELEMENT,data:{},attributes:M({src:p?Ve(o,p):"",mode:"custom",href:c.url||"",name:s.toLowerCase(),alt:s?`${s} icon`:"",title:s,target:"_blank"}),children:[{text:""}]})}),r={align:t.align||"center",mode:"horizontal","icon-size":t.iconSize?`${t.iconSize}px`:"",spacing:t.spacing!=null?`${t.spacing}px`:"",color:t.color||"","font-size":t.fontSize||""};return J(Object.assign(r,ut(t))),B({type:m.STANDARD_SOCIAL,data:{},attributes:M(r),mobileAttributes:M(tt(t._override,{padding:!0})),children:i.length>0?i:[_t()]})}function Ve(t,n){return`https://cdn.tools.unlayer.com/social/icons/${t}/${n}.png`}function Ke(t){var o;if(!t)return"";const n={facebook:"facebook",linkedin:"linkedin",instagram:"instagram",twitter:"twitter",x:"x",youtube:"youtube",pinterest:"pinterest",tiktok:"tiktok",snapchat:"snapchat",whatsapp:"whatsapp",github:"github"},e=t.toLowerCase();return(o=n[e])!=null?o:e.replace(/[^a-z0-9]/g,"")}function Xe(t){return B({type:m.DANGEROUS_CODE,data:{code:t.html||t.content||""},attributes:{},children:[{text:""}]})}function qe(){return B({type:m.STANDARD_COLUMN,data:{},attributes:{width:"100%"},children:[_t()]})}function _t(){return B({type:m.STANDARD_PARAGRAPH,data:{},attributes:{},children:[{text:""}]})}function Ze(t){switch(t){case"h2":return m.STANDARD_H2;case"h3":return m.STANDARD_H3;case"h4":return m.STANDARD_H4;case"h1":default:return m.STANDARD_H1}}function de(t){if(t==null)return"";if(typeof t=="number")return`${t}px`;if(typeof t=="string")return t;if(typeof t=="object"){if(t.autoWidth)return"";if(typeof t.width=="number")return`${t.width}px`;if(typeof t.width=="string")return t.width}return""}function H(t){if(typeof t=="number")return t;if(typeof t!="string")return 0;const n=/^(-?\d+(?:\.\d+)?)(px)?$/.exec(t.trim());return n?parseFloat(n[1]):0}function Je(t){return`${Number((t*100).toFixed(4))}%`}function Ye(t){const n=String(t||"").trim().toLowerCase();return n?n==="center"||n==="middle"?"middle":n==="flex-end"||n==="end"||n==="bottom"?"bottom":n==="flex-start"||n==="start"||n==="top"?"top":"":""}function Wt(t){var e,o;const n=(t==null?void 0:t.values)||{};return{href:n.href||n.url||((e=t==null?void 0:t.attrs)==null?void 0:e.href)||"",target:n.target||((o=t==null?void 0:t.attrs)==null?void 0:o.target)||""}}function Ot(t,n){if(!t)return"";const e=String(t).trim(),o=/^(-?\d+(?:\.\d+)?)%$/.exec(e);if(o){const i=parseFloat(o[1]);return`${Math.max(1,Math.round(i/100*n))}px`}return/^-?\d+(?:\.\d+)?$/.test(e)?`${e}px`:e}function Yt(t){const n=String(t||"").trim();return!n||Qe(n)?!1:!/^(?:https?:|data:|blob:)/i.test(n)}function Qe(t){return/%%[A-Za-z0-9_]+%%/.test(t)}function le(t,n,e){if(typeof t!="number"||t<=0)return"";const o=typeof n=="number"&&n>0?n:0,i=H(e);return o>0&&i>0?`${Math.max(1,Math.round(t*i/o))}px`:`${t}px`}function tn(t,n){const e=new Set,o=[],i=a=>{if(!a||typeof a!="object"||!a.url)return;const d=String(a.url);e.has(d)||(e.add(d),o.push({name:String(a.label||a.value||"").trim(),href:d}))};i(n);const r=a=>{if(!(!a||typeof a!="object")){a.fontFamily&&i(a.fontFamily);for(const d of Object.keys(a)){const c=a[d];Array.isArray(c)?c.forEach(r):c&&typeof c=="object"&&r(c)}}};return r(t),o}function en(t){var a,d,c,s,p,g;if(t.length===0)return{};const n={},e=(t[0].contents||[]).map(u=>u.type).join(","),o=((a=t[0].values)==null?void 0:a.backgroundColor)||"",i=!!e&&t.every(u=>{var T;const l=(u.contents||[]).map(h=>h.type).join(","),f=((T=u.values)==null?void 0:T.backgroundColor)||"";return l===e&&f===o}),r=["Top"];i||r.push("Bottom");for(const u of r){const l=`border${u}Width`,f=`border${u}Color`,T=`border${u}Style`,h=(c=(d=t[0])==null?void 0:d.values)==null?void 0:c.border;if(!h)continue;const x=h[l],A=h[f],S=h[T]||"solid";if(!x||x==="0"||x==="0px")continue;let _=!0;for(let k=1;k<t.length;k++){const y=(p=(s=t[k])==null?void 0:s.values)==null?void 0:p.border;if(!y||y[l]!==x||y[f]!==A||(y[T]||"solid")!==S){_=!1;break}}if(_){n[`border-${u.toLowerCase()}`]=`${x} ${S} ${A||"transparent"}`;for(const k of t){const y=(g=k.values)==null?void 0:g.border;y&&(y[l]="0px")}}}return n}function nn(t){const n={};if(t.length===0)return n;const e=(o,i,r)=>{var p;const a=(p=o==null?void 0:o.values)==null?void 0:p.border;if(!a)return;const d=a[`border${i}Width`],c=a[`border${i}Color`],s=a[`border${i}Style`]||"solid";!d||d==="0"||d==="0px"||(n[r]=`${d} ${s} ${c||"transparent"}`,a[`border${i}Width`]="0px")};return e(t[0],"Left","border-left"),e(t[t.length-1],"Right","border-right"),n}function wt(t){var e,o,i,r;if(t.length===0)return"";const n=(o=(e=t[0])==null?void 0:e.values)==null?void 0:o.backgroundColor;if(!n)return"";for(let a=1;a<t.length;a++)if(((r=(i=t[a])==null?void 0:i.values)==null?void 0:r.backgroundColor)!==n)return"";return n}function on(t){var i,r;const n=t.contents||[];if(n.length===0)return!0;if(n.length>1)return!1;const e=n[0];if(e.type!=="image")return!1;const o=(r=(i=e.values)==null?void 0:i.src)==null?void 0:r.maxWidth;return o==="0%"||o==="0"||o===0}function rn(t){var i,r,a,d,c;if(t.length<3)return"";const n=((r=(i=t[0])==null?void 0:i.values)==null?void 0:r.backgroundColor)||"",e=((d=(a=t[t.length-1])==null?void 0:a.values)==null?void 0:d.backgroundColor)||"";if(!n||n!==e)return"";let o="";for(let s=1;s<t.length-1;s++){const p=t[s],g=((c=p==null?void 0:p.values)==null?void 0:c.backgroundColor)||"";if(g&&g!==n){if(!on(p)||o&&o!==g)return"";o=g}}return o}function se(t){var n;for(const e of t){const o=(n=e==null?void 0:e.values)==null?void 0:n.border;if(!o)continue;const i=["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"];for(const r of i){const a=o[r];if(a&&a!=="0px"&&a!=="0")return!0}}return!1}function an(t){var i,r,a;const n=t.columns||[];if(n.length<2)return;const e=t.cells||n.map(()=>1),o=new Map;n.forEach((d,c)=>{var l;const s=(d.contents||[]).map(f=>f.type).join(","),p=((l=d.values)==null?void 0:l.backgroundColor)||"";if(!s)return;const g=`${s}|${p}`,u=o.get(g)||[];u.push(c),o.set(g,u)});for(const d of o.values()){if(d.length<2)continue;const c=d.map(u=>{var l;return Number((l=e[u])!=null?l:1)}),s=Math.min(...c),p=Math.max(...c);if(p>0&&(p-s)/p>.2)continue;const g=n[d[0]].contents.length;for(let u=0;u<g;u++){let l=0,f=0,T=1/0,h=1/0;for(const _ of d){const k=n[_].contents[u],y=Tt((i=k.values)==null?void 0:i.containerPadding),w=y?H(y.top):0,D=y?H(y.bottom):0;l=Math.max(l,w),f=Math.max(f,D),T=Math.min(T,w),h=Math.min(h,D)}const x=l-T>80,A=f-h>80,S=l>T;for(const _ of d){const k=n[_].contents[u],y=(a=Tt((r=k.values)==null?void 0:r.containerPadding))!=null?a:{top:"0px",right:"0px",bottom:"0px",left:"0px"};let w=!1;!x&&!S&&H(y.top)<l&&(y.top=`${l}px`,w=!0),!A&&H(y.bottom)<f&&(y.bottom=`${f}px`,w=!0),w&&(k.values=k.values||{},k.values.containerPadding=`${y.top} ${y.right} ${y.bottom} ${y.left}`)}}}}function dn(t){var i,r,a,d;const n=t.columns||[];if(n.length<2||!((a=(r=(i=t.values)==null?void 0:i._override)==null?void 0:r.mobile)!=null&&a.noStackMobile)||!wt(n)||!se(n))return!1;const e=new Set(["image","text","heading"]),o=(n[0].contents||[]).map(c=>c.type).join(",");if(!o)return!1;for(const c of n){const s=((d=c.values)==null?void 0:d.border)||{},p=s.borderTopWidth,g=s.borderBottomWidth;if(!p||p==="0"||p==="0px"||!g||g==="0"||g==="0px")return!1}for(const c of n){const s=c.contents||[];for(const g of s)if(!e.has(g.type))return!1;if(s.map(g=>g.type).join(",")!==o)return!1}return!0}function ln(t,n,e){var h;const o=t.values||{},i=t.columns||[],r=t.cells||i.map(()=>1),a=r.reduce((x,A)=>x+Number(A||0),0)||1,d=wt(i);let c="#000000",s="solid",p="1px";for(const x of i){const A=(h=x.values)==null?void 0:h.border;if(!A)continue;const S=A.borderTopWidth||A.borderRightWidth||A.borderBottomWidth||A.borderLeftWidth;if(S&&S!=="0px"&&S!=="0"){p=S,c=A.borderTopColor||A.borderRightColor||A.borderBottomColor||A.borderLeftColor||c,s=A.borderTopStyle||A.borderRightStyle||A.borderBottomStyle||A.borderLeftStyle||s;break}}const g=i.map((x,A)=>{var P,E,$;const S=x.values||{};if(dt(S)==="hidden")return null;const _=Number((P=r[A])!=null?P:1)/a,k=Math.round(n.contentWidthPx*_),y=(x.contents||[]).map(L=>sn(L,W(N({},n),{columnPxWidth:k}))).filter(L=>L!=null),w=((E=x.values)==null?void 0:E.border)||{},D=[w.borderTopWidth,w.borderRightWidth,w.borderBottomWidth,w.borderLeftWidth].some(L=>L&&L!=="0px"&&L!=="0"),C=`${(Number(($=r[A])!=null?$:1)/a*100).toFixed(4)}%`;return Dt(B({type:m.STANDARD_TABLE2_TD,data:{rowspan:1,colspan:1},attributes:M({"border-enabled":D?!0:void 0,"text-align":"center",width:C}),children:y.length>0?y:[_t()]}),S)}).filter(x=>x!=null),u=B({type:m.STANDARD_TABLE2_TR,data:{},attributes:M({"background-color":d||""}),children:g}),l=B({type:m.STANDARD_TABLE2,data:{},attributes:M({"border-enabled":!0,"border-color":c,"border-style":s,"border-width":p,"text-align":"center","cell-padding-top":"0px","cell-padding-right":"0px","cell-padding-bottom":"0px","cell-padding-left":"0px",padding:"0px 0px 0px 0px","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px",width:"100%"}),children:[u]}),f=B({type:m.STANDARD_COLUMN,data:{},attributes:{width:"100%","padding-top":"0px","padding-right":"0px","padding-bottom":"0px","padding-left":"0px"},children:[l]}),T={"background-color":o.backgroundColor||"","padding-top":e.top,"padding-right":e.right,"padding-bottom":e.bottom,"padding-left":e.left};return zt(T),n.templateUsesFullWidth&&(T["full-width"]="full-width"),B({type:m.STANDARD_SECTION,data:{},attributes:M(T),children:[f]})}function sn(t,n){const e=t.values||{};if(dt(e)==="hidden")return null;let o;switch(t.type){case"image":o=cn(e,n);break;case"heading":case"text":o=pn(e,n);break;default:return ie(t,n)}return Dt(o,e)}function cn(t,n){var f,T;const e=((f=t.src)==null?void 0:f.url)||"",o=t.altText||"",r=(T=ae(t,n).attributes)!=null?T:{},a=r.width||"",d=r["padding-top"]||"0px",c=r["padding-right"]||"0px",s=r["padding-bottom"]||"0px",p=r["padding-left"]||"0px",g=["display:block","margin:0 auto","max-width:100%","height:auto","border:0",a?`width:${a}`:""].filter(Boolean).join(";"),u=`padding:${d} ${c} ${s} ${p};text-align:center`,l=B({type:m.HTML_BLOCK_NODE,data:{tagName:"img"},attributes:{src:e,alt:o,style:g},children:[{text:""}]});return B({type:m.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{style:u},children:[l]})}function pn(t,n){const e=Mt(t,n),o=e["padding-top"]||"0px",i=e["padding-right"]||"0px",r=e["padding-bottom"]||"0px",a=e["padding-left"]||"0px",d=[e.color?`color:${e.color}`:"",e["font-family"]?`font-family:${e["font-family"]}`:"",e["font-size"]?`font-size:${e["font-size"]}`:"",e["line-height"]?`line-height:${e["line-height"]}`:"",e["letter-spacing"]?`letter-spacing:${e["letter-spacing"]}`:"",e.align?`text-align:${e.align}`:"",`padding:${o} ${i} ${r} ${a}`,"margin:0","word-wrap:break-word"].filter(Boolean).join(";"),c=ce(t.text||"",Bt(t,n));return B({type:m.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{style:d},children:c.length>0?c:[{text:""}]})}function ce(t,n){if(!t)return[];const e=(s,p,g)=>{if(!g&&!s.trim())return null;const u=Lt(V(s),n),l=p?`margin:0;${p}`:"margin:0";return{type:m.HTML_BLOCK_NODE,data:{tagName:"p"},attributes:{style:l},children:u.length?u:[{text:""}]}},o=(s,p,g)=>{const u=/<li\b([^>]*)>([\s\S]*?)<\/li>/gi,l=[];let f;for(;(f=u.exec(g))!==null;){const h=Et(f[1]||""),x=Lt(V(f[2]),n);l.push({type:m.HTML_BLOCK_NODE,data:{tagName:"li"},attributes:h?{style:h}:{},children:x.length?x:[{text:""}]})}if(l.length===0)return null;const T=Et(p);return{type:m.HTML_BLOCK_NODE,data:{tagName:s},attributes:T?{style:T}:{},children:l}},i=[],r=/<(p|ul|ol)\b([^>]*)>([\s\S]*?)<\/\1>/gi;let a=0,d;for(;(d=r.exec(t))!==null;){const s=e(t.slice(a,d.index),"",!1);s&&i.push(s);const p=d[1].toLowerCase(),g=d[2]||"",u=p==="p"?e(d[3],Et(g),!0):o(p,g,d[3]);u&&i.push(u),a=d.index+d[0].length}const c=e(t.slice(a),"",!1);return c&&i.push(c),i}function Et(t){var e,o;const n=/\bstyle\s*=\s*"([^"]*)"|\bstyle\s*=\s*'([^']*)'/i.exec(t);return n&&(o=(e=n[1])!=null?e:n[2])!=null?o:""}function zt(t){const n=t["padding-top"],e=t["padding-right"],o=t["padding-bottom"],i=t["padding-left"];n==null&&e==null&&o==null&&i==null||(t.padding=`${n!=null?n:"0px"} ${e!=null?e:"0px"} ${o!=null?o:"0px"} ${i!=null?i:"0px"}`)}function gn(t){const n={};return t!=null&&t.padding&&(n.padding=t.padding),n}function Qt(t){return t?/^0(?:px|em|rem|%|pt)?$/i.test(t.trim()):!0}function ut(t){const n={};return t!=null&&t.containerPadding&&(n.padding=t.containerPadding),n}function te(t,n={}){if(!t||typeof t!="object")return{};const e={},o=["Top","Right","Bottom","Left"];let i=!1;for(const r of o){const a=t[`border${r}Width`],d=t[`border${r}Color`],c=t[`border${r}Style`];(a||d||c)&&(a&&a!=="0"&&a!=="0px"&&(i=!0),e[`border-${r.toLowerCase()}`]=`${a||"0px"} ${c||"solid"} ${d||"transparent"}`)}return i||n.includeZero?e:{}}function pe(t,n="borderAll"){if(!t||typeof t!="object")return{width:"",style:"",color:""};const e=(n==="borderTop"||t.borderTopWidth||t.borderTopColor,"borderTop");return{width:t[`${e}Width`]||"",style:t[`${e}Style`]||"",color:t[`${e}Color`]||""}}function ee(t){const n={};return t.url&&(n["background-url"]=t.url),t.repeat&&(n["background-repeat"]=t.repeat),t.position==="custom"&&t.customPosition?n["background-position"]=t.customPosition.join(" "):t.position?n["background-position"]=un(t.position):t.customPosition&&(n["background-position"]=t.customPosition.join(" ")),typeof t.size=="string"?t.size==="custom"&&t.width?n["background-size"]=`${t.width}px auto`:t.size!=="custom"&&(n["background-size"]=t.size):t.fullWidth&&t.width&&(n["background-size"]=`${t.width}px auto`),n}function un(t){const n=t.trim();if(!n||n.includes(" ")||/[%\d]/.test(n))return n;const e=n.split("-").filter(Boolean);if(e.length!==2)return n;const o=new Set(["top","bottom"]);return o.has(e[0])&&!o.has(e[1])?`${e[1]} ${e[0]}`:e.join(" ")}function tt(t,n={}){const e=t==null?void 0:t.mobile;if(!e)return{};const o={};return e.textAlign&&(o.align=e.textAlign),e.fontSize&&(o["font-size"]=e.fontSize),e.lineHeight&&(o["line-height"]=e.lineHeight),e.backgroundColor&&(o["background-color"]=e.backgroundColor),n.padding&&e.containerPadding&&(Object.assign(o,{padding:e.containerPadding}),J(o,"padding")),e.padding&&J(Object.assign(o,{padding:e.padding}),"padding"),o}const mt=375;function fn(t,n,e,o,i={}){var d,c,s,p,g,u;const r=tt(t,{padding:!0}),a=t==null?void 0:t.mobile;if(!((d=a==null?void 0:a.src)!=null&&d.maxWidth)&&o&&/^-?\d+(?:\.\d+)?%$/.test(o.trim())){const l=Ot(o,mt);if(l){const f=H(l);e&&f>e?r.width=`${e}px`:r.width=l}}if(((c=a==null?void 0:a.src)==null?void 0:c.autoWidth)===!0&&(n&&(r.width=`${n}px`),r["fluid-on-mobile"]="true"),(s=a==null?void 0:a.src)!=null&&s.maxWidth&&((p=a==null?void 0:a.src)==null?void 0:p.autoWidth)!==!0){const l=String(a.src.maxWidth).trim(),f=/^(-?\d+(?:\.\d+)?)%$/.exec(l),T=l==="100%"||l==="100",h=Ot(l,mt);let x=h;if(h){const A=H(h);!i.brokenImage&&n&&n>0&&A>n&&(x=`${n}px`)}if(x&&(r.width=x),T)r["fluid-on-mobile"]="true";else if(f){const A=parseFloat(f[1]),S=r["padding-left"]!=null?H(String(r["padding-left"])):(g=i.desktopPaddingLeft)!=null?g:0,_=r["padding-right"]!=null?H(String(r["padding-right"])):(u=i.desktopPaddingRight)!=null?u:0,k=Math.max(0,mt-S-_);let y=A/100*k;if(!i.brokenImage&&n&&n>0&&y>n&&(y=n),y>0&&y<mt){r.width=`${Math.round(y)}px`;const w=Math.max(0,mt-y),D=String(i.align||"").toLowerCase();let C=w/2,P=w/2;D==="left"?(C=S,P=Math.max(0,w-C)):D==="right"&&(P=_,C=Math.max(0,w-P)),r["padding-left"]=`${C}px`,r["padding-right"]=`${P}px`,r["fluid-on-mobile"]="true"}}}if(i.brokenImage&&i.srcNativeHeight&&n){const l=H(r.width);l>0&&(r.height=le(i.srcNativeHeight,n,`${l}px`))}return r}function hn(t){const n=tt(t,{padding:!0}),e=t==null?void 0:t.mobile,o=de(e==null?void 0:e.size);return o&&(n.width=o),n}function M(t){const n={};for(const e of Object.keys(t)){const o=t[e];o===""||o==null||(n[e]=o)}return n}function dt(t){var o,i,r,a;if(!t)return;const n=t.hideDesktop===!0||((i=(o=t._override)==null?void 0:o.desktop)==null?void 0:i.hideDesktop)===!0,e=t.hideMobile===!0||((a=(r=t._override)==null?void 0:r.mobile)==null?void 0:a.hideMobile)===!0;if(n&&e)return"hidden";if(n)return"mobile";if(e)return"desktop"}function Dt(t,n){if(!t)return t;const e=dt(n);return e==="hidden"?null:(e&&(t.visible=e),ge(t,n))}function Nt(t,n){const e=dt(n);return e==="hidden"?[]:t.map(o=>{const i=e?W(N({},o),{visible:e}):o;return ge(i,n)})}function ge(t,n){const e=bn(n==null?void 0:n.displayCondition);return e?W(N({},t),{logic:W(N({},t.logic),{condition:{expression:e,enabled:!0}})}):t}function bn(t){const n=String((t==null?void 0:t.before)||"").trim();if(!n)return;const e=n.match(/^\{%\s*if\s+([\s\S]*?)\s*%\}$/);return e?e[1].trim()||void 0:n}function B(t){return t!=null&&t.mobileAttributes&&typeof t.mobileAttributes=="object"&&Object.keys(t.mobileAttributes).length===0&&delete t.mobileAttributes,t}const X={HEADING:"mailup-bee-newsletter-modules-heading",PARAGRAPH:"mailup-bee-newsletter-modules-paragraph",TEXT:"mailup-bee-newsletter-modules-text",BUTTON:"mailup-bee-newsletter-modules-button",IMAGE:"mailup-bee-newsletter-modules-image",SPACER:"mailup-bee-newsletter-modules-spacer",DIVIDER:"mailup-bee-newsletter-modules-divider",MENU:"mailup-bee-newsletter-modules-menu",SOCIAL:"mailup-bee-newsletter-modules-social",ICONS:"mailup-bee-newsletter-modules-icons",HTML:"mailup-bee-newsletter-modules-html",LIST:"mailup-bee-newsletter-modules-list",TABLE:"mailup-bee-newsletter-modules-table",VIDEO:"mailup-bee-newsletter-modules-video",CAROUSEL:"mailup-bee-newsletter-modules-carousel",FORM:"mailup-bee-newsletter-modules-form",MERGE_CONTENT:"mailup-bee-newsletter-modules-merge-content",EMPTY:"mailup-bee-newsletter-modules-empty"};function mn(t){var h,x,A,S,_,k,y,w,D,C,P,E;const n=[],e=yn(t);if(!e)throw new Error("beefreeToEasyEmailPro: input has no { page: { body, rows } }");for(const $ of e.rows||[])for(const L of $.columns||[])for(const F of L.modules||[])if(F.type===X.MENU)throw new Error("beefreeToEasyEmailPro: template uses `menu` module (navbar), which is not supported — conversion aborted");const o=e.body,i=((x=(h=o==null?void 0:o.content)==null?void 0:h.computedStyle)==null?void 0:x.messageWidth)||"700px",r=parseInt(String(i),10)||700,a=((S=(A=o==null?void 0:o.content)==null?void 0:A.computedStyle)==null?void 0:S.linkColor)||"",d=((k=(_=o==null?void 0:o.content)==null?void 0:_.style)==null?void 0:k["background-color"])||((w=(y=o==null?void 0:o.container)==null?void 0:y.style)==null?void 0:w["background-color"])||"",c=((C=(D=o==null?void 0:o.content)==null?void 0:D.style)==null?void 0:C["font-family"])||"",s=((E=(P=o==null?void 0:o.content)==null?void 0:P.style)==null?void 0:E.color)||"",p={};c&&(p["font-family"]=c);const g={};s&&(g[ne.TEXT]={color:s});const l=(e.rows||[]).flatMap($=>_n($,{contentWidthPx:r,columnPxWidth:r,bodyLinkColor:a,warnings:n})),f=((o==null?void 0:o.webFonts)||[]).map($=>({name:$.name||"",href:$.url||""})).filter($=>$.name&&$.href);return{page:{type:m.PAGE,data:N({breakpoint:r>700?"768px":"720px",globalAttributes:p,categoryAttributes:g,blockAttributes:{},classAttributes:{},preheader:""},f.length>0?{fonts:f}:{}),attributes:O({width:`${r}px`,"background-color":d,"content-background-color":"","margin-top":"0px","margin-bottom":"0px","link-color":a}),children:l},warnings:n}}function yn(t){var n,e,o;return t?(n=t.page)!=null&&n.rows?t.page:(o=(e=t.template)==null?void 0:e.page)!=null&&o.rows?t.template.page:t.rows&&t.body?t:null:null}function _n(t,n){var ct,pt,gt,ht;const e=((ct=t.content)==null?void 0:ct.style)||{},o=((pt=t.content)==null?void 0:pt.mobileStyle)||{},i=((gt=t.container)==null?void 0:gt.style)||{},r=((ht=t.content)==null?void 0:ht.computedStyle)||{},a=t.columns||[];if(a.length===0)return[];if(r.hideContentOnDesktop===!0&&r.hideContentOnMobile===!0)return[];const d=r.hideContentOnDesktop===!0?"mobile":r.hideContentOnMobile===!0?"desktop":void 0,c=(e["background-color"]||"").trim(),s=(i["background-color"]||"").trim(),p=z=>!z||z.toLowerCase()==="transparent",g=p(c)&&!p(s)?s:c,u=p(c)&&(!p(s)||!!yt(i["background-image"])),l=a.reduce((z,j)=>z+(j["grid-columns"]||0),0)||12,f=r.rowColStackOnMobile===!1&&a.length>1,T=(a[0].style||{})["background-color"]||"",x=(z=>!!z&&z.trim().toLowerCase()!=="transparent")(T)&&a.every(z=>(z.style||{})["background-color"]===T),A=String(r.columnsSpacing||"").trim(),S=!!A&&A!=="0px"&&A!=="0",_=x&&!S?T:"",k=r.columnsBorderRadius||"",y=S?k:"",w=e.padding||e["padding-top"]||e["padding-right"]||e["padding-bottom"]||e["padding-left"],D={top:e["padding-top"]||"",right:e["padding-right"]||"",bottom:e["padding-bottom"]||"",left:e["padding-left"]||"",shorthand:e.padding||(w?"":"0")},C=yt(e["background-image"])?e:p(c)&&yt(i["background-image"])?i:null,P=C?yt(C["background-image"]):"",E=P?O({"background-url":P,"background-position":C["background-position"]||"","background-repeat":C["background-repeat"]||"","background-size":C["background-size"]||"","background-image-enabled":!0}):{},$=!f&&a.length>1,L=z=>z.map((j,K)=>{const kt=j["grid-columns"]||12,bt=Math.round(n.contentWidthPx*kt/l);return An(j,kt,l,W(N({},n),{columnPxWidth:bt,columnStacksOnMobile:$,skipColBg:!!_,perColumnRadius:y,columnsSpacing:S?A:"",colIndex:K,colCount:z.length}))}).filter(j=>j!=null),F=r.rowReverseColStackOnMobile===!0&&r.rowColStackOnMobile!==!1&&a.length>1;let U;if(F){const z=L(a).map(K=>W(N({},K),{visible:"desktop"})),j=L([...a].reverse()).map(K=>W(N({},K),{visible:"mobile"}));U=[...z,...j]}else U=L(a);if(U.length===0)return[];const Y=f?[I({type:m.STANDARD_GROUP,data:{},attributes:{width:"100%"},children:U})]:U,lt=fe(o);if(_){const z=O(N({"background-color":g,"border-radius":e["border-radius"]||"",padding:D.shorthand,"padding-top":D.top,"padding-right":D.right,"padding-bottom":D.bottom,"padding-left":D.left},E)),j=I({type:m.STANDARD_SECTION,data:{},attributes:O({"background-color":_,"border-radius":k,padding:"0"}),children:Y}),K=I({type:m.STANDARD_WRAPPER,data:{},attributes:z,mobileAttributes:lt,children:[j]});return d&&(K.visible=d),[K]}const st=yt(i["background-image"]),et=!!st||!p(s)&&s!==c,q=!p(c);if(!_&&et&&q){const z=O(N({"full-width":"full-width","background-color":s,padding:D.shorthand,"padding-top":D.top,"padding-right":D.right,"padding-bottom":D.bottom,"padding-left":D.left},st?{"background-url":st,"background-position":i["background-position"]||"","background-repeat":i["background-repeat"]||"","background-size":i["background-size"]||"","background-image-enabled":!0}:{})),j=I({type:m.STANDARD_SECTION,data:{},attributes:O({"background-color":c,"border-radius":(y?"":k)||e["border-radius"]||"",padding:"0"}),children:Y}),K=I({type:m.STANDARD_WRAPPER,data:{},attributes:z,mobileAttributes:lt,children:[j]});return d&&(K.visible=d),[K]}const Ct=O(N(W(N({},u?{"full-width":"full-width"}:{}),{"background-color":g,"border-radius":(y?"":k)||e["border-radius"]||"",padding:D.shorthand,"padding-top":D.top,"padding-right":D.right,"padding-bottom":D.bottom,"padding-left":D.left}),E)),ft=I({type:m.STANDARD_SECTION,data:{},attributes:Ct,mobileAttributes:lt,children:Y});return d&&(ft.visible=d),[ft]}function An(t,n,e,o){const i=t.style||{},r=t.mobileStyle||{},a=`${Math.round(100*n/e)}%`,d=O({width:a,"background-color":o.skipColBg?"":i["background-color"]||"","border-radius":i["border-radius"]||o.perColumnRadius||"","border-top":nt(i["border-top"]),"border-right":nt(i["border-right"]),"border-bottom":nt(i["border-bottom"]),"border-left":nt(i["border-left"]),padding:i.padding||"","padding-top":i["padding-top"]||"","padding-right":i["padding-right"]||"","padding-bottom":i["padding-bottom"]||"","padding-left":i["padding-left"]||"","vertical-align":i["vertical-align"]||""}),c=fe(r),s=o.colCount!=null&&o.colIndex!=null?o.colIndex>=o.colCount-1:!0;if(o.columnsSpacing&&!s){const g=parseInt(o.columnsSpacing,10)||0;if(g>0){const u=parseInt(c["padding-bottom"]||"0",10)||0;c["padding-bottom"]=`${u+g}px`}}const p=(t.modules||[]).map(g=>kn(g,o)).filter(g=>!!g);return p.length===0?null:I({type:m.STANDARD_COLUMN,data:{},attributes:d,mobileAttributes:c,children:p})}function kn(t,n){const e=t.descriptor||{},o=(()=>{switch(t.type){case X.HEADING:return Sn(e,n);case X.PARAGRAPH:case X.TEXT:return Tn(e,n);case X.BUTTON:return wn(e);case X.IMAGE:return Dn(e,n);case X.SPACER:return Rn(e);case X.DIVIDER:return Cn(e);case X.HTML:return Pn(e);case X.LIST:return Ln(e);case X.SOCIAL:return En(e);case X.ICONS:return Nn(e);case X.TABLE:return $n(e,n);case X.EMPTY:return null;default:return n.warnings.push(`unsupported module type: ${t.type}`),null}})();return xn(o,e)}function xn(t,n){if(!t)return t;const e=(n==null?void 0:n.computedStyle)||{},o=e.hideContentOnDesktop===!0,i=e.hideContentOnMobile===!0;return o&&i?null:(o?t.visible="mobile":i&&(t.visible="desktop"),t)}function Sn(t,n){var l;const e=t.heading||{},o=t.style||{},i=e.style||{},r=e.title||"h1",a=e.text||"",d=r==="h2"?m.STANDARD_H2:r==="h3"?m.STANDARD_H3:m.STANDARD_H1,c=O({align:i["text-align"]||o["text-align"]||"",color:i.color||"","font-family":At(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":i["line-height"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""}),s=Q(t.mobileStyle||{}),p=((l=e.computedStyle)==null?void 0:l.linkColor)||n.bodyLinkColor||"",g=p?vt(a,p):a,u=V(Rt(g))||[{text:""}];return I({type:d,data:{},attributes:c,mobileAttributes:s,children:u})}function Tn(t,n){var u,l,f;const e=t.paragraph||{},o=t.style||{},i=e.style||{},r=e.html||((u=t.text)==null?void 0:u.html)||"",a=i["line-height"]||((l=e.computedStyle)==null?void 0:l.paragraphSpacing)||"",d=((f=e.computedStyle)==null?void 0:f.linkColor)||n.bodyLinkColor||"",c=d?vt(r,d):r,s=O({align:i["text-align"]||"",color:i.color||"","font-family":At(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":a,"padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""}),p=Q(t.mobileStyle||{}),g=V(Rt(c))||[{text:""}];return I({type:m.STANDARD_PARAGRAPH,data:{},attributes:s,mobileAttributes:p,children:g})}function wn(t,n){const e=t.button||{},o=t.style||{},i=e.style||{},r=Rt(e.label||""),a=i.width&&i.width!=="auto"?i.width:"",d=O({align:o["text-align"]||"center",href:e.href||"",target:e.target||"",color:i.color||"","background-color":i["background-color"]||"","border-top":nt(i["border-top"]),"border-right":nt(i["border-right"]),"border-bottom":nt(i["border-bottom"]),"border-left":nt(i["border-left"]),"border-radius":i["border-radius"]||"","font-family":At(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":i["line-height"]||"","inner-padding-top":i["padding-top"]||"","inner-padding-right":i["padding-right"]||"","inner-padding-bottom":i["padding-bottom"]||"","inner-padding-left":i["padding-left"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||"",width:a}),c=Q(t.mobileStyle||{}),s=V(r)||[{text:""}];return I({type:m.STANDARD_BUTTON,data:{},attributes:d,mobileAttributes:c,children:s})}function Dn(t,n){const e=t.image||{},o=t.style||{},i=t.computedStyle||{},r=i.width||o.width||e.width||"",a=Bn(r,n.columnPxWidth),d=On(i.class)||"center",c=O(W(N({src:e.src||"",alt:e.alt||"",title:e.title||"",href:e.href||"",target:e.target||"",align:d,width:a},$t(i.class,"fullwidthOnMobile")?{"fluid-on-mobile":"true"}:{}),{"border-radius":o["border-radius"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""})),s=Q(t.mobileStyle||{});return n.columnStacksOnMobile&&$t(i.class,"fixedwidth")&&!$t(i.class,"fullwidthOnMobile")&&d!=="center"&&!s.align&&(s.align="center"),I({type:m.STANDARD_IMAGE,data:{},attributes:c,mobileAttributes:s,children:[{text:""}]})}function Rn(t){var o,i,r;const n=((i=(o=t.spacer)==null?void 0:o.style)==null?void 0:i.height)||"10px",e=((r=t.mobileStyle)==null?void 0:r.height)||"";return I({type:m.STANDARD_SPACER,data:{},attributes:O({height:n}),mobileAttributes:e?{height:e}:{},children:[{text:""}]})}function Cn(t){var p;const n=((p=t.divider)==null?void 0:p.style)||{},e=t.style||{},o=ue(n["border-top"]),i=n["border-top-color"]||n.color||o.color||"",r=n["border-top-style"]||o.style||"solid",a=n["border-top-width"]||o.width||"1px",d=parseInt(n.height||"0",10)||0;if((!i||i.toLowerCase()==="transparent"||a==="0"||a==="0px")&&d>0)return I({type:m.STANDARD_SPACER,data:{},attributes:O({height:`${d}px`,"padding-top":e["padding-top"]||"","padding-right":e["padding-right"]||"","padding-bottom":e["padding-bottom"]||"","padding-left":e["padding-left"]||""}),mobileAttributes:Q(t.mobileStyle||{}),children:[{text:""}]});const s=O({"border-color":i,"border-style":r,"border-width":a,width:n.width||"100%","padding-top":e["padding-top"]||"","padding-right":e["padding-right"]||"","padding-bottom":e["padding-bottom"]||"","padding-left":e["padding-left"]||""});return I({type:m.STANDARD_DIVIDER,data:{},attributes:s,mobileAttributes:Q(t.mobileStyle||{}),children:[{text:""}]})}function ue(t){if(!t||typeof t!="string")return{width:"",style:"",color:""};const n=t.trim().split(/\s+/),e=new Set(["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"]);let o="",i="",r="";for(const a of n)!o&&/^[\d.]+(px|em|rem|%|pt)?$/.test(a)?o=a:!i&&e.has(a.toLowerCase())?i=a:r||(r=a);return{width:o,style:i,color:r}}function En(t){var a;const n=((a=t.iconsList)==null?void 0:a.icons)||[],e=t.style||{},o=t.computedStyle||{},i=n.map(d=>{const c=d.image||{},s=String(d.name||d.id||"").toLowerCase();return I({type:m.STANDARD_SOCIAL_ELEMENT,data:{},attributes:O({src:c.src||"",mode:"custom",href:c.href||"",name:s,alt:c.alt||s,title:c.title||s,target:c.target||"_blank"}),children:[{text:""}]})}),r=typeof o.iconsDefaultWidth=="number"?`${o.iconsDefaultWidth}px`:"";return I({type:m.STANDARD_SOCIAL,data:{},attributes:O({align:e["text-align"]||"center",mode:"horizontal","icon-size":r,"inner-padding":typeof o.padding=="string"?o.padding:"","padding-top":e["padding-top"]||"","padding-right":e["padding-right"]||"","padding-bottom":e["padding-bottom"]||"","padding-left":e["padding-left"]||""}),mobileAttributes:Q(t.mobileStyle||{}),children:i.length>0?i:[{text:""}]})}function Nn(t){var f,T;const e=(((f=t.iconsList)==null?void 0:f.icons)||[]).filter(h=>{const x=String((h==null?void 0:h.href)||"");return!/(?:^|\/\/)(?:www\.)?designedwithbeefree\.com/i.test(x)});if(e.length===0)return null;const o=t.style||{},i=t.computedStyle||{},r=parseInt(String(i.iconHeight||"0"),10)||0;if(e.length===1&&!((T=e[0])!=null&&T.text)){const h=e[0],x=parseInt(String(h.width||"0"),10)||0,A=parseInt(String(h.height||"0"),10)||0,S=r>0&&x>0&&A>0?`${Math.round(r*x/A)}px`:x>0?`${x}px`:"",_=i.iconSpacing||{};return I({type:m.STANDARD_IMAGE,data:{},attributes:O({src:h.image||"",alt:h.alt||"",title:h.title||h.alt||"",href:h.href||"",target:h.target||"_blank",align:o["text-align"]||"center",width:S,"padding-top":_["padding-top"]||o["padding-top"]||"","padding-right":_["padding-right"]||o["padding-right"]||"","padding-bottom":_["padding-bottom"]||o["padding-bottom"]||"","padding-left":_["padding-left"]||o["padding-left"]||""}),children:[{text:""}]})}const a=i.iconSpacing||{},d=a["padding-top"]||"",c=a["padding-right"]||"",s=a["padding-bottom"]||"",p=a["padding-left"]||"",g=e.map(h=>{const x=typeof h.text=="string"?h.text:"",A=parseInt(String(h.width||"0"),10)||0,S=parseInt(String(h.height||"0"),10)||0,_=r>0&&A>0&&S>0?`${Math.round(r*A/S)}px`:"",k=r>0?`${r}px`:"";return I({type:m.STANDARD_SOCIAL_ELEMENT,data:{},attributes:O(W(N(N({src:h.image||"",mode:"custom",href:h.href||"",alt:h.alt||"",title:h.title||h.alt||"",target:h.target||"_blank"},_?{"icon-size":_}:{}),k?{"icon-height":k}:{}),{"padding-top":d,"padding-right":c,"padding-bottom":s,"padding-left":p})),children:x?[{text:x}]:[{text:""}]})}),u=typeof i.iconHeight=="string"?i.iconHeight:"",l=d||c||s||p?`${d||"0px"} ${c||"0px"} ${s||"0px"} ${p||"0px"}`:"";return I({type:m.STANDARD_SOCIAL,data:{},attributes:O({align:o["text-align"]||"left",mode:"horizontal","icon-size":u,"inner-padding":l,color:o.color||"","font-family":o["font-family"]||"","font-size":o["font-size"]||"","font-weight":o["font-weight"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""}),mobileAttributes:Q(t.mobileStyle||{}),children:g})}function $n(t,n){var C,P;const e=t.table||{},o=e.style||{},i=e.computedStyle||{},r=t.style||{},a=((C=e.content)==null?void 0:C.rows)||[],d=((P=e.content)==null?void 0:P.headers)||[];if(a.length===0&&d.length===0)return null;const c=ue(o["border-top"]||o["border-right"]||o["border-bottom"]||o["border-left"]||""),s=c.color||"",p=c.style||"solid",g=c.width||"1px",u=!!s&&s.toLowerCase()!=="transparent",l=i.linkColor||n.bodyLinkColor||"",f=(E,$={})=>{const L=l?vt(E,l):E,F=V(Rt(L))||[{text:""}];return I({type:m.STANDARD_TABLE2_TD,data:{rowspan:1,colspan:1},attributes:O($),children:F})},T=(E,$,L={})=>I({type:m.STANDARD_TABLE2_TR,data:{},attributes:O({"background-color":$}),children:E.map(F=>f((F==null?void 0:F.html)||"",L))}),h=[],x=i.headersBackgroundColor||"",A=i.headersColor||"",S=i.headersFontSize||"",_=i.headersFontWeight||"",k=i.headersTextAlign||"",y=[A?`color:${A}`:"",S?`font-size:${S}`:"",_?`font-weight:${_}`:"",k?`text-align:${k}`:""].filter(Boolean).join(";"),w=E=>y&&E.trim()?`<span style="${y}">${E}</span>`:E;d.forEach(E=>{const $=(E.cells||[]).map(L=>({html:w((L==null?void 0:L.html)||"")}));h.push(T($,x))});const D=i.alternateRowBackgroundColor||"";return a.forEach((E,$)=>{const L=$%2===1?D:"";h.push(T(E.cells||[],L))}),h.length===0?null:I({type:m.STANDARD_TABLE2,data:{},attributes:O({align:o["text-align"]||"center",color:o.color||"","font-family":At(o["font-family"]),"font-size":o["font-size"]||"","line-height":o["line-height"]||"",width:"100%","table-layout":"auto","border-color":s,"border-style":p,"border-width":g,"border-enabled":!!u,"cell-padding-top":"10px","cell-padding-right":"10px","cell-padding-bottom":"10px","cell-padding-left":"10px","padding-top":r["padding-top"]||"","padding-right":r["padding-right"]||"","padding-bottom":r["padding-bottom"]||"","padding-left":r["padding-left"]||""}),children:h})}function Pn(t){var i,r,a,d,c;const n=((i=t.html)==null?void 0:i.html)||"",e=V(n)||[{text:n}],o=I({type:m.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{},children:e});return I({type:m.STANDARD_PARAGRAPH,data:{},attributes:O({"padding-top":((r=t.style)==null?void 0:r["padding-top"])||"","padding-right":((a=t.style)==null?void 0:a["padding-right"])||"","padding-bottom":((d=t.style)==null?void 0:d["padding-bottom"])||"","padding-left":((c=t.style)==null?void 0:c["padding-left"])||""}),children:[o]})}function Ln(t,n){const e=t.list||{},o=t.style||{},i=e.style||{},r=e.computedStyle||{},a=e.html||"",d=(e.tag||"ul").toLowerCase()==="ol"?"ol":"ul",c=In({"margin-bottom":r.liSpacing&&r.liSpacing!=="0px"?r.liSpacing:"","padding-left":r.liIndent||"","list-style-position":r.listStylePosition||""}),s=[],p=/<li[^>]*>([\s\S]*?)<\/li>/gi;let g;for(;(g=p.exec(a))!==null;)s.push(g[1]);s.length===0&&s.push(a);const u=s.map(T=>{const h=V(T)||[{text:T}];return I({type:m.HTML_BLOCK_NODE,data:{tagName:"li"},attributes:O({style:c}),children:h})}),l=I({type:m.HTML_BLOCK_NODE,data:{tagName:d},attributes:O({style:"margin:0;padding:0 0 0 1.25em"}),children:u}),f=O({align:i["text-align"]||"",color:i.color||"","font-family":At(i["font-family"]),"font-size":i["font-size"]||"","font-weight":i["font-weight"]||"","letter-spacing":i["letter-spacing"]||"","line-height":i["line-height"]||"","padding-top":o["padding-top"]||"","padding-right":o["padding-right"]||"","padding-bottom":o["padding-bottom"]||"","padding-left":o["padding-left"]||""});return I({type:m.STANDARD_PARAGRAPH,data:{},attributes:f,mobileAttributes:Q(t.mobileStyle||{}),children:[l]})}function fe(t){if(!t)return{};const n={},e=["padding-top","padding-right","padding-bottom","padding-left","font-size"];for(const o of e)t[o]&&(n[o]=t[o]);return t["text-align"]&&(n.align=t["text-align"]),n}function nt(t){if(!t||typeof t!="string")return"";const n=t.trim().toLowerCase();return!n||n.startsWith("0px")||n.startsWith("0 ")||n.includes("transparent")?"":t}function yt(t){if(!t||typeof t!="string")return"";const n=t.trim();if(!n||n==="none")return"";const e=/^url\((['"]?)([^)]+?)\1\)$/.exec(n);return e?e[2]:""}function vt(t,n){return!t||!n?t:t.replace(/<a\b([^>]*)>/gi,(e,o)=>{if(/\bcolor\s*:/i.test(o))return e;const i=/\bstyle\s*=\s*"([^"]*)"/i.exec(o);if(i){const r=i[1].trim(),a=r&&!r.endsWith(";")?";":"",d=`${r}${a}color:${n};`;return`<a${o.replace(/\bstyle\s*=\s*"[^"]*"/i,`style="${d}"`)}>`}return`<a${o} style="color:${n};">`})}function On(t){if(!t||typeof t!="string")return"";const n=t.toLowerCase().split(/\s+/);return n.includes("left")?"left":n.includes("right")?"right":n.includes("center")?"center":""}function $t(t,n){return!t||typeof t!="string"?!1:t.split(/\s+/).includes(n)}function In(t){const n=[];for(const[e,o]of Object.entries(t))o&&n.push(`${e}:${o}`);return n.join(";")}function Rt(t){return t.replace(/<span class="tinyMce-placeholder">/g,"<span>").replace(/<div class="txtTinyMce-wrapper"[^>]*>/g,"<div>")}function At(t,n){return!t||t==="inherit"?"":t}function Q(t){const n={};for(const[e,o]of Object.entries(t))o&&(e==="padding-top"||e==="padding-right"||e==="padding-bottom"||e==="padding-left"||e==="font-size"||e==="text-align")&&(e==="text-align"?n.align=o:n[e]=o);return n}function Bn(t,n){if(!t)return"";const e=String(t).trim(),o=/^(-?\d+(?:\.\d+)?)%$/.exec(e);if(o)return`${Math.max(1,Math.round(parseFloat(o[1])/100*n))}px`;const i=/^(-?\d+(?:\.\d+)?)(?:px)?$/.exec(e);return i?`${i[1]}px`:e}function O(t){const n={};for(const e of Object.keys(t)){const o=t[e];o===""||o==null||(n[e]=o)}return n}function I(t){return t!=null&&t.mobileAttributes&&typeof t.mobileAttributes=="object"&&Object.keys(t.mobileAttributes).length===0&&delete t.mobileAttributes,t}const Z={Text:0,Image:1,Button:2,Social:3,Split:4,Table:5,Product:6,Spacer:7,DropShadow:8,HorizontalRule:9,Header:10,Review:11,Video:13,Coupon:14},Mn={0:"Text",1:"Image",2:"Button",3:"Social",4:"Split",5:"Table",6:"Product",7:"Spacer",8:"DropShadow",9:"HorizontalRule",10:"Header",11:"Review",13:"Video",14:"Coupon"},Hn=600;function Wn(t){var h,x,A,S,_;const n=[],e=zn(t);if(!e)throw new Error("klaviyoToEasyEmailPro: input has no { body: { sections } } — pass the template `.data`, not the outer entry");const o=((h=e.body)==null?void 0:h.attributes)||{},i=no((x=o.width)!=null?x:o.content_width,Hn),r=xt(o.background_color,o.bg_color,""),a=e.styles||[],d=((A=a.find(k=>(k==null?void 0:k.style_type)===200))==null?void 0:A.attributes)||{},c=((S=a.find(k=>(k==null?void 0:k.style_type)===300))==null?void 0:S.attributes)||{},s=xt(d.font_family),p=xt(d.color),g=xt(c.color),u={contentWidthPx:i,warnings:n,globalParagraphStyle:d},f=(((_=e.body)==null?void 0:_.sections)||[]).slice().sort(rt).flatMap(k=>vn(k,u));return{page:{type:m.PAGE,data:{breakpoint:i>700?"768px":"600px",globalAttributes:v({"font-family":s}),categoryAttributes:{},blockAttributes:{},classAttributes:{},preheader:""},attributes:v(N({width:`${i}px`,"background-color":r,"content-background-color":"","margin-top":"0px","margin-bottom":"0px","link-color":g},p?{color:p}:{})),children:f},warnings:n}}function zn(t){var n,e,o;return t?(n=t.body)!=null&&n.sections?t:(o=(e=t.data)==null?void 0:e.body)!=null&&o.sections?t.data:null:null}function vn(t,n){var s,p,g;const e=((s=t.data)==null?void 0:s.rows)||[];if(e.length===0)return[];const o=N({},((p=t.data)==null?void 0:p.attributes)||{});let i=!1,r;const d=e.flatMap(u=>{var l;return(((l=u.data)==null?void 0:l.columns)||[]).flatMap(f=>{var T;return((T=f.data)==null?void 0:T.blocks)||[]})}).filter(u=>{var l;return((l=u.data)==null?void 0:l.block_type)!==Z.Spacer});if(d.length===1){const u=((g=d[0].data)==null?void 0:g.attributes)||{};o.background_color==null&&u.block_background_color!=null&&(r=b(o.background_color,o.content_color),o.background_color=u.block_background_color,i=!0),o.inner_padding_top==null&&u.block_padding_top!=null&&(o.inner_padding_top=u.block_padding_top,i=!0),o.inner_padding_right==null&&u.block_padding_right!=null&&(o.inner_padding_right=u.block_padding_right,i=!0),o.inner_padding_bottom==null&&u.block_padding_bottom!=null&&(o.inner_padding_bottom=u.block_padding_bottom,i=!0),o.inner_padding_left==null&&u.block_padding_left!=null&&(o.inner_padding_left=u.block_padding_left,i=!0)}const c=W(N({},n),{sectionAttrs:o,hoistedToSection:i,originalSectionBg:r});return e.slice().sort(rt).flatMap(u=>Fn(u,c))}function Fn(t,n){var u;const e=(((u=t.data)==null?void 0:u.columns)||[]).slice().sort(rt);if(e.length===0)return[];const o=n.sectionAttrs||{},i=b(o.background_url),r=b(o.background_color,o.content_color),a=b(o.background_format),d=o.background_repeat===!1?"no-repeat":o.background_repeat===!0?"repeat":"",c=b(o.background_position),s=v(W(N({"background-color":r,"background-url":i,"background-position":c,"background-repeat":d,"background-size":a==="cover"?"cover":a==="contain"?"contain":""},i?{"background-image-enabled":"true"}:{}),{"padding-top":R(o.inner_padding_top)||"0px","padding-right":R(o.inner_padding_right)||"0px","padding-bottom":R(o.inner_padding_bottom)||"0px","padding-left":R(o.inner_padding_left)||"0px"})),p={type:m.STANDARD_SECTION,data:{},attributes:s,children:[]},g=e.map(l=>Gn(l,n));if(e.length===1)p.children=g;else{const l={type:m.STANDARD_GROUP,data:{},attributes:{},children:g};p.children=[l]}return[p]}function Gn(t,n){var i;const o=(((i=t.data)==null?void 0:i.blocks)||[]).slice().sort(rt).flatMap(r=>Un(r,n));return{type:m.STANDARD_COLUMN,data:{},attributes:{},children:o}}function Un(t,n){var o;const e=(o=t.data)==null?void 0:o.block_type;switch(e){case Z.Text:return jn(t,n);case Z.Spacer:return Vn(t,n);case Z.HorizontalRule:return eo(t,n);case Z.Image:return Kn(t,n);case Z.Button:return Xn(t,n);case Z.Social:return qn(t,n);case Z.Header:return to(t,n);case Z.Split:return Qn(t,n);case Z.Table:return Zn(t);default:{const i=Mn[e]||`Unknown(${e})`;return n.warnings.push(`block:${i}`),[he(`[TODO Klaviyo block_type=${e} (${i})]`)]}}}function jn(t,n){var $;const e=it(t,n),o=((($=t.data)==null?void 0:$.content)||"").trim();if(!o)return[];const i=(L,F)=>{var U;return(U=e[L])!=null?U:F?e[F]:void 0},r=ot(i("block_padding_top","block-padding-top"),i("inner_padding_top","inner-padding-top")),a=ot(i("block_padding_right","block-padding-right"),i("inner_padding_right","inner-padding-right")),d=ot(i("block_padding_bottom","block-padding-bottom"),i("inner_padding_bottom","inner-padding-bottom")),c=ot(i("block_padding_left","block-padding-left"),i("inner_padding_left","inner-padding-left")),s=io(o),p=b(i("text_align","text-align"),s.styles["text-align"]),g=b(i("color"),s.styles.color),u=b(i("font_family","font-family"),s.styles["font-family"]),l=b(i("font_size","font-size"),s.styles["font-size"]),f=n.globalParagraphStyle||{},T=b(i("line_height","line-height"),s.styles["line-height"],f.line_height),h=b(i("letter_spacing","letter-spacing"),s.styles["letter-spacing"]),x=b(i("font_weight","font-weight"),s.styles["font-weight"]),A=b(i("font_style","font-style"),s.styles["font-style"]),S=b(i("block_background_color"),i("background_color")),_=b(i("block_border_width")),k=b(i("block_border_color")),y=b(i("block_border_style")),w=s.tag||oo(o),D=w==="h1"?m.STANDARD_H1:w==="h2"?m.STANDARD_H2:w==="h3"?m.STANDARD_H3:m.STANDARD_PARAGRAPH,C=v({align:p,color:g,"font-family":u,"font-size":G(l),"font-weight":x,"font-style":A,"letter-spacing":G(h),"line-height":T,padding:"0px","padding-top":r||"0px","padding-right":a||"0px","padding-bottom":d||"0px","padding-left":c||"0px","container-background-color":S,border:_&&y&&k?`${G(_)} ${y} ${k}`:""}),E=(o.match(/<p[\s>]/gi)||[]).length>1?[{text:o}]:V(o)||[{text:Ft(o)}];return[{type:D,data:{},attributes:C,children:E}]}function Vn(t,n){const e=it(t,n),o=at(e.height),i=b(e.background_color)||(n.hoistedToSection?n.originalSectionBg||"transparent":"");return[{type:m.STANDARD_SPACER,data:{},attributes:v({height:`${o!=null?o:30}px`,"container-background-color":i}),children:[{text:""}]}]}function Kn(t,n){const e=it(t,n),o=b(e.cropped_src,e.src);if(!o)return[];const i=(h,x)=>{var A;return(A=e[h])!=null?A:x?e[x]:void 0},r=b(e.max_width),a=b(e.align)||"center",d=ot(i("block_padding_top","block-padding-top"),i("inner_padding_top","inner-padding-top")),c=ot(i("block_padding_right","block-padding-right"),i("inner_padding_right","inner-padding-right")),s=ot(i("block_padding_bottom","block-padding-bottom"),i("inner_padding_bottom","inner-padding-bottom")),p=ot(i("block_padding_left","block-padding-left"),i("inner_padding_left","inner-padding-left")),g=b(i("border_width")),u=b(i("border_color")),l=b(i("border_style")),f=e.full_width_mobile===!0||e.mobile_stretch_content===!0,T=v(N({src:o,alt:b(e.alt_text),href:b(e.href),align:a,width:r?G(r):"",padding:"0px","padding-top":d||"0px","padding-right":c||"0px","padding-bottom":s||"0px","padding-left":p||"0px","container-background-color":b(e.block_background_color,e.background_color),border:g&&l&&u?`${G(g)} ${l} ${u}`:""},f?{"fluid-on-mobile":"true"}:{}));return[{type:m.STANDARD_IMAGE,data:{},attributes:T,children:[{text:""}]}]}function Xn(t,n){var l;const e=it(t,n),o=(((l=t.data)==null?void 0:l.content)||"").trim(),i=(f,T)=>{var h;return(h=e[f])!=null?h:T?e[T]:void 0},r=b(i("border_width")),a=b(i("border_color")),d=b(i("border_style")),c=r&&d&&a?`${G(r)} ${d} ${a}`:"",s=b(i("font_style")),p=e.stretch===!0,g=v({align:b(i("text_align","text-align"))||"center",href:b(i("href")),color:b(i("color")),"background-color":b(i("background_color")),"border-radius":R(i("border_radius")),border:c,"font-family":b(i("font_family","font-family")),"font-size":G(b(i("font_size","font-size"))),"font-weight":b(i("font_weight","font-weight")),"font-style":s,"line-height":"100%","letter-spacing":G(b(i("letter_spacing","letter-spacing"))),"text-decoration":b(i("text_decoration","text-decoration")),"inner-padding-top":R(i("inner_padding_top","inner-padding-top")),"inner-padding-right":R(i("inner_padding_right","inner-padding-right")),"inner-padding-bottom":R(i("inner_padding_bottom","inner-padding-bottom")),"inner-padding-left":R(i("inner_padding_left","inner-padding-left")),padding:"0px","padding-top":R(i("block_padding_top","block-padding-top"))||"0px","padding-right":R(i("block_padding_right","block-padding-right"))||"0px","padding-bottom":R(i("block_padding_bottom","block-padding-bottom"))||"0px","padding-left":R(i("block_padding_left","block-padding-left"))||"0px","container-background-color":b(i("block_background_color")),width:p?"100%":""}),u=V(o)||[{text:o}];return[{type:m.STANDARD_BUTTON,data:{},attributes:g,children:u}]}function qn(t,n){var c;const e=it(t,n),o=(s,p)=>{var g;return(g=e[s])!=null?g:p?e[p]:void 0},r=(((c=t.data)==null?void 0:c.sub_blocks)||[]).slice().sort(rt).filter(s=>s.block_type===2).map(s=>{const p=s.attributes||{},g=b(p.type).toLowerCase(),u=b(p.link_url,p["link-url"]),l=b(p.text),f=b(p.icon_url);return{type:m.STANDARD_SOCIAL_ELEMENT,data:{},attributes:v(W(N({name:g},f?{mode:"custom",src:f}:{}),{href:u,alt:l||g,title:l||g,target:u?"_blank":""})),children:[{text:""}]}});if(r.length===0)return[];const a=at(o("spacing")),d=a!=null?`0px ${a}px`:"";return[{type:m.STANDARD_SOCIAL,data:{},attributes:v({align:b(o("align"))||"center",mode:e.stack_on_mobile===!0?"vertical":"horizontal","icon-size":G(b(o("size"))),"inner-padding":d,"padding-top":R(o("block_padding_top","block-padding-top")),"padding-right":R(o("block_padding_right","block-padding-right")),"padding-bottom":R(o("block_padding_bottom","block-padding-bottom")),"padding-left":R(o("block_padding_left","block-padding-left")),"container-background-color":b(o("block_background_color"))}),children:r}]}function Zn(t,n){var _,k;const e=((_=t.data)==null?void 0:_.attributes)||{},o=(((k=t.data)==null?void 0:k.sub_blocks)||[]).slice().sort(rt);if(o.length===0)return[];const i=(y,w)=>{var D;return(D=e[y])!=null?D:w?e[w]:void 0},r=at(i("static_num_columns"))||o.length,a=Math.max(1,Math.floor(r)),d=e.headers_enabled===!0,c=o.map(y=>Jn(y)),s=[];for(let y=0;y<c.length;y+=a)s.push(c.slice(y,y+a));const p=b(i("table_background_color")),g=R(i("cell_padding_top"))||"10px",u=R(i("cell_padding_right"))||"10px",l=R(i("cell_padding_bottom"))||"10px",f=R(i("cell_padding_left"))||"10px",T=b(i("block_border_width")),h=b(i("block_border_color")),x=b(i("block_border_style")),A=!!T&&!!h,S=s.map((y,w)=>{const D=d&&w===0;return{type:m.STANDARD_TABLE2_TR,data:{},attributes:v({"background-color":D?p:""}),children:y.map(C=>Yn(C))}});return[{type:m.STANDARD_TABLE2,data:{},attributes:v({align:"center",width:"100%","table-layout":"auto","border-color":h,"border-style":x||"solid","border-width":G(T)||"1px","border-enabled":!!A,"cell-padding-top":g,"cell-padding-right":u,"cell-padding-bottom":l,"cell-padding-left":f,"padding-top":R(i("block_padding_top","block-padding-top")),"padding-right":R(i("block_padding_right","block-padding-right")),"padding-bottom":R(i("block_padding_bottom","block-padding-bottom")),"padding-left":R(i("block_padding_left","block-padding-left")),"container-background-color":b(i("block_background_color"))}),children:S}]}function Jn(t){const n=t.attributes||{};if(t.block_type===6){const e=b(n.cropped_src,n.src);if(!e)return"";const o=b(n.image_width,n.width),i=b(n.image_align),r=b(n.href),a=[];o&&a.push(`width:${G(o)}`),a.push("display:block"),i==="center"?a.push("margin:0 auto"):i==="right"&&a.push("margin-left:auto");const d=` style="${a.join(";")}"`,c=`<img src="${e}" alt="${It(b(n.alt))}"${d}>`;return r?`<a href="${r}">${c}</a>`:c}return(t.content||"").trim()}function Yn(t){const n=V(t)||[{text:Ft(t)||""}];return{type:m.STANDARD_TABLE2_TD,data:{rowspan:1,colspan:1},attributes:{},children:n}}function Qn(t,n){var x,A;const e=it(t,n),o=(((x=t.data)==null?void 0:x.sub_blocks)||[]).slice().sort(rt);if(o.length===0)return[];const i=(S,_)=>{var k;return(k=e[S])!=null?k:_?e[_]:void 0},r=b(i("block_background_color")),a=R(i("block_padding_top","block-padding-top")),d=R(i("block_padding_bottom","block-padding-bottom")),c=R(i("block_padding_left","block-padding-left")),s=R(i("block_padding_right","block-padding-right")),p=(A=at(i("padding_in_between")))!=null?A:0,g=(()=>{const _=b(i("column_widths")).match(/^(\d+(?:\.\d+)?)%$/);return _?parseFloat(_[1]):null})(),u=S=>{const _=S.attributes||{};if(S.block_type===6){const k=b(_.cropped_src,_.src);if(!k)return null;const y=b(_.image_width,_.width),w=y?` width="${parseInt(y,10)||y}"`:"",D=It(b(_.alt,_.alt_text));return`<img src="${It(k)}" alt="${D}"${w} style="display:block;max-width:100%;border:0;">`}return S.block_type===5||S.block_type===7?(S.content||"").trim():null};if(o.length===1){const S=o[0],_=S.attributes||{};if(S.block_type===6){const y=b(_.cropped_src,_.src);return y?[{type:m.STANDARD_IMAGE,data:{},attributes:v({src:y,alt:b(_.alt,_.alt_text),href:b(_.href,_.link_url),align:b(_.image_align)||"center",width:b(_.image_width,_.width)?G(b(_.image_width,_.width)):"",padding:"0px","padding-top":a||"0px","padding-right":s||"0px","padding-bottom":d||"0px","padding-left":c||"0px","container-background-color":r}),children:[{text:""}]}]:[]}const k=(S.content||"").trim();return k?[{type:m.STANDARD_PARAGRAPH,data:{},attributes:v({padding:"0px","padding-top":a||"0px","padding-right":s||"0px","padding-bottom":d||"0px","padding-left":c||"0px","container-background-color":r}),children:V(k)||[{text:Ft(k)}]}]:[]}const l=(()=>{if(g!=null&&o.length===2)return[g,100-g];const S=(100/o.length).toFixed(2);return o.map(()=>parseFloat(S))})(),T=`<table role="presentation" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse"><tr>${o.map((S,_)=>{const k=u(S);if(k==null)return"";const y=l[_]!=null?`width:${l[_]}%;`:"",D=!(_===o.length-1)&&p>0?`padding-right:${p/2}px;`:"",C=_>0&&p>0?`padding-left:${p/2}px;`:"";return`<td valign="top" style="${y}${D}${C}">${k}</td>`}).join("")}</tr></table>`,h=[{type:m.HTML_BLOCK_NODE,data:{tagName:"div"},attributes:{},children:[{text:T}]}];return[{type:m.STANDARD_PARAGRAPH,data:{},attributes:v({padding:"0px","padding-top":a||"0px","padding-right":s||"0px","padding-bottom":d||"0px","padding-left":c||"0px","container-background-color":r}),children:h}]}function to(t,n){var _;const e=it(t,n),o=(((_=t.data)==null?void 0:_.sub_blocks)||[]).slice().sort(rt),i=(k,y)=>{var w;return(w=e[k])!=null?w:y?e[y]:void 0},r=b(i("block_background_color")),a=R(i("block_padding_top","block-padding-top")),d=R(i("block_padding_right","block-padding-right")),c=R(i("block_padding_bottom","block-padding-bottom")),s=R(i("block_padding_left","block-padding-left")),p=b(i("color")),g=b(i("font_family","font-family")),u=G(b(i("font_size","font-size"))),l=b(i("font_weight","font-weight")),f=b(i("font_style","font-style")),T=G(b(i("letter_spacing","letter-spacing"))),h=b(i("text_decoration","text-decoration")),x=R(i("logo_link_spacing")),A=[];for(const k of o){const y=k.attributes||{};if(k.block_type===10||k.block_type===12){const w=b(y.src);if(!w)continue;const D=b(y.width),C=b(y.height);A.push({type:m.STANDARD_IMAGE,data:{},attributes:v({src:w,alt:b(y.alt_text,y.alt),href:b(y.link_url,y["link-url"],y.href),align:b(i("logo_align"))||"center",width:D?G(D):"",height:C?G(C):"",padding:"0px","padding-top":a||"0px","padding-right":d||"0px","padding-bottom":x||"0px","padding-left":s||"0px","container-background-color":r}),children:[{text:""}]})}}const S=o.filter(k=>k.block_type===11);if(S.length>0){const k=v({color:p,"font-family":g,"font-size":u,"font-weight":l,"font-style":f,"letter-spacing":T,"line-height":"100%","text-decoration":h||"none","text-transform":"none","padding-top":"10px","padding-right":"10px","padding-bottom":"10px","padding-left":"10px"}),y=S.map(w=>{const D=b((w.attributes||{}).text,w.content),C=b((w.attributes||{}).link_url,(w.attributes||{})["link-url"]);return{type:m.STANDARD_NAVBAR_LINK,data:{},attributes:v(N({href:C,target:C?"_blank":""},k)),children:[{text:D}]}});A.push({type:m.STANDARD_NAVBAR,data:{},attributes:v({align:b(i("item_align"))||"center","padding-top":"0px","padding-right":d,"padding-bottom":c,"padding-left":s,"container-background-color":r}),children:y})}return A.length===0?[he("[TODO Klaviyo Header (no recognized sub_blocks)]")]:A}function eo(t,n){const e=it(t,n),o=(i,r)=>{var a;return(a=e[i])!=null?a:r?e[r]:void 0};return[{type:m.STANDARD_DIVIDER,data:{},attributes:v({"border-color":b(o("border_color")),"border-style":b(o("border_style"))||"solid","border-width":G(b(o("border_width"))||"1"),width:"100%",padding:"0px","padding-top":R(o("block_padding_top","block-padding-top"))||"0px","padding-right":R(o("block_padding_right","block-padding-right"))||"0px","padding-bottom":R(o("block_padding_bottom","block-padding-bottom"))||"0px","padding-left":R(o("block_padding_left","block-padding-left"))||"0px","container-background-color":b(o("block_background_color"))}),children:[{text:""}]}]}function it(t,n){var o;const e=N({},((o=t.data)==null?void 0:o.attributes)||{});return n.hoistedToSection&&(delete e.block_background_color,delete e.block_padding_top,delete e.block_padding_right,delete e.block_padding_bottom,delete e.block_padding_left,delete e["block-padding-top"],delete e["block-padding-right"],delete e["block-padding-bottom"],delete e["block-padding-left"]),e}function he(t){return{type:m.STANDARD_PARAGRAPH,data:{},attributes:{color:"#888888","font-size":"12px"},children:[{text:t}]}}function rt(t,n){var e,o;return((e=t.position)!=null?e:0)-((o=n.position)!=null?o:0)}function no(t,n){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const e=parseInt(t,10);if(Number.isFinite(e)&&e>0)return e}return n}function xt(...t){for(const n of t)if(typeof n=="string"&&n.length>0)return n;return""}function v(t){const n={};for(const e of Object.keys(t))t[e]!==""&&t[e]!=null&&(n[e]=t[e]);return n}function b(...t){for(const n of t){if(typeof n=="string"&&n.length>0)return n;if(typeof n=="number"&&Number.isFinite(n))return String(n)}return""}function ot(t,n){const e=at(t),o=at(n);return e==null&&o==null?"":`${(e||0)+(o||0)}px`}function at(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const n=t.match(/^(-?\d+(?:\.\d+)?)/);if(n)return parseFloat(n[1])}return null}function G(t){return t?/^\d+(?:\.\d+)?$/.test(t)?`${t}px`:t:""}function R(t){const n=at(t);return n==null?"":`${n}px`}function oo(t){const n=t.match(/<\s*(h1|h2|h3|p|div)\b/i);return n?n[1].toLowerCase():"p"}function io(t){const n=t.match(/^\s*<(p|h[1-6]|div)\b([^>]*)>([\s\S]*?)<\/\1>\s*$/i);if(!n)return{tag:"",styles:{}};const e=n[1].toLowerCase(),i=n[2].match(/style\s*=\s*"([^"]*)"/i),r={};if(i)for(const a of i[1].split(";")){const d=a.indexOf(":");if(d<0)continue;const c=a.slice(0,d).trim().toLowerCase(),s=a.slice(d+1).trim();c&&s&&(r[c]=s)}return{tag:e,styles:r}}function Ft(t){return t.replace(/<[^>]*>/g,"")}function It(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}exports.beefreeToEasyEmailPro=mn;exports.htmlToTextNodes=V;exports.klaviyoToEasyEmailPro=Wn;exports.unlayerToEasyEmailPro=Ne;