@emailmaker/emailmaker 1.1.109 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -1
- package/emailmaker-core.8c2b05d7.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.7b3c64f5.js → emailmaker-po.8c2b05d7.js} +1 -1
- package/emailmaker.d.ts +254 -3
- package/emailmaker.js +12 -12
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/{iframe-eblock.7b3c64f5.html → iframe-eblock.8c2b05d7.html} +2 -2
- package/iframe/{iframe.7b3c64f5.html → iframe.8c2b05d7.html} +2 -2
- package/iframe/js/elMarkupHelper.DnlKn-Lc.js +277 -0
- package/iframe/js/iframe-eblock.body.8c2b05d7.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.8c2b05d7.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{efb5b933.js → 1687225b.js} +1 -1
- package/static/core/{86b377fd.js → 1912a30e.js} +1 -1
- package/static/core/{2f32a31d.js → 286097e2.js} +2 -2
- package/static/core/{874f77d2.js → 316f71b7.js} +1 -1
- package/static/core/{26971a74.js → 42ec1ce9.js} +2 -2
- package/static/core/466f98bb.js +28 -0
- package/static/core/{8c37b60d.js → 48e93de9.js} +1 -1
- package/static/core/{26473b73.js → 492992bb.js} +1 -1
- package/static/core/{98ab1508.js → 60b75c99.js} +1 -1
- package/static/core/{f115f982.js → 6535dd13.js} +7 -7
- package/static/core/{5c4304c8.js → 6e548251.js} +1 -1
- package/static/core/844fbb88.js +1 -0
- package/static/core/{9ef544f4.js → 97aabe39.js} +1 -1
- package/static/core/{cebc7ae2.js → 9e7c400d.js} +10 -10
- package/static/core/9ff19e12.js +4 -0
- package/static/core/{b35140b6.js → aab84cf4.js} +1 -1
- package/static/core/{a85c7f02.js → b6999cba.js} +1 -1
- package/static/core/{1157da89.js → b752ed52.js} +1 -1
- package/static/core/{ee6c9aa1.js → b99f4f42.js} +1 -1
- package/static/core/{213ffad0.js → bbb11e65.js} +1 -1
- package/static/core/{6314ae82.js → c2daae71.js} +1 -1
- package/static/core/{3bfab25b.js → c6cd3dc2.js} +1 -1
- package/static/core/{2e29db3c.js → c7b2d60e.js} +1 -1
- package/static/core/{850805d7.js → d2a90b69.js} +1 -1
- package/static/core/{756e184f.js → dfbe3ba4.js} +1 -1
- package/static/core/{87dcdb89.js → e13d6875.js} +1 -1
- package/static/core/{e8fa95c8.js → ed4586a5.js} +1 -1
- package/static/core/{dfcb8d34.js → ee6a6899.js} +1 -1
- package/static/esm/ea997fe3.js +1 -0
- package/static/umd-runtime/runtime.BqNyFZPj.js +1 -0
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.7b3c64f5.js +0 -859
- package/iframe/js/elMarkupHelper.BcpgksI_.js +0 -279
- package/iframe/js/iframe-eblock.body.7b3c64f5.js +0 -9
- package/iframe/js/iframe.body.7b3c64f5.js +0 -129
- package/static/core/6fb2f217.js +0 -4
- package/static/core/e4b8362a.js +0 -28
- package/static/core/e90908e7.js +0 -1
- package/static/esm/73c89921.js +0 -1
- package/static/umd-runtime/runtime.DaVzSc6X.js +0 -1
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
__emailmaker__.define("js/elMarkupHelper.DnlKn-Lc.js",["require","exports","module"],function(Hc,z,cj){var up=Object.defineProperty,ar=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),se=(e,t)=>{let n={};for(var r in e)up(n,r,{get:e[r],enumerable:!0});return t||up(n,Symbol.toStringTag,{value:"Module"}),n};function pi(e){"@babel/helpers - typeof";return pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pi(e)}function HC(e,t){if(pi(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(pi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FC(e){var t=HC(e,"string");return pi(t)=="symbol"?t:t+""}function L(e,t,n){return(t=FC(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var dp;dp=Symbol.toStringTag;var Fc=class{constructor(){L(this,"_valuesMap",new Map),L(this,dp,"Storage")}getItem(e){const t=String(e);return this._valuesMap.has(e)?String(this._valuesMap.get(t)):null}setItem(e,t){this._valuesMap.set(String(e),String(t))}removeItem(e){this._valuesMap.delete(e)}clear(){this._valuesMap.clear()}key(e){if(arguments.length===0)throw new TypeError("Failed to execute 'key' on 'Storage': 1 argument required, but only 0 present.");return Array.from(this._valuesMap.keys())[e]}get length(){return this._valuesMap.size}};function fp(){const e=new Fc;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&Fc.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(Fc.prototype.hasOwnProperty(n)){const r=e[n];if(typeof r=="function"){const o=r;return(...i)=>o.apply(e,i)}return r}return e.getItem(n)}}})}function mp(){const e=fp(),t=fp();Object.defineProperty(window,"localStorage",{configurable:!0,enumerable:!0,get:()=>e}),Object.defineProperty(window,"sessionStorage",{configurable:!0,enumerable:!0,get:()=>t});let n=Object.create(null);Object.defineProperty(document,"cookie",{enumerable:!1,configurable:!0,get(){const r=[];for(var o in n)r.push(o+"="+n[o]);return r.join(";")},set(r){const o=r.indexOf("=");var i=r.substr(0,o),s=r.substring(o+1);return n[i]=s,i+"="+s}}),Object.defineProperty(document,"clearCookies",{enumerable:!1,configurable:!0,value:()=>n=Object.create(null)})}mp();var pp=Symbol.for("emailmaker.commandInputPause");function hp(){const e=window,t=e[pp];if(t)return t;const n=new Set;return e[pp]=n,window.addEventListener("input",r=>n.forEach(o=>o(r)),!0),n}function $C(){hp()}function WC(e){const t=hp();return t.add(e),()=>{t.delete(e)}}$C();var gp=class{constructor(e){L(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},wt=(function(e){return e[e.StartCommentTag=0]="StartCommentTag",e[e.Comment=1]="Comment",e[e.EndCommentTag=2]="EndCommentTag",e[e.StartTagOpen=3]="StartTagOpen",e[e.StartTagClose=4]="StartTagClose",e[e.StartTagSelfClose=5]="StartTagSelfClose",e[e.StartTag=6]="StartTag",e[e.EndTagOpen=7]="EndTagOpen",e[e.EndTagClose=8]="EndTagClose",e[e.EndTag=9]="EndTag",e[e.DelimiterAssign=10]="DelimiterAssign",e[e.AttributeName=11]="AttributeName",e[e.AttributeValue=12]="AttributeValue",e[e.StartDoctypeTag=13]="StartDoctypeTag",e[e.Doctype=14]="Doctype",e[e.EndDoctypeTag=15]="EndDoctypeTag",e[e.Content=16]="Content",e[e.Whitespace=17]="Whitespace",e[e.Unknown=18]="Unknown",e[e.Script=19]="Script",e[e.Styles=20]="Styles",e[e.EOS=21]="EOS",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),qC=class{constructor(e,t){L(this,"source",void 0),L(this,"len",void 0),L(this,"position",void 0),this.source=e,this.len=e.length,this.position=t}eos(){return this.len<=this.position}getSource(){return this.source}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}goToEnd(){this.position=this.source.length}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)?(this.position++,!0):!1}advanceIfChars(e){let t;if(this.position+e.length>this.source.length)return!1;for(t=0;t<e.length;t++)if(this.source.charCodeAt(this.position+t)!==e[t])return!1;return this.advance(t),!0}advanceIfRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index+t[0].length,t[0]):""}advanceUntilRegExp(e){const t=this.source.substr(this.position).match(e);return t?(this.position=this.position+t.index,t[0]):(this.goToEnd(),"")}advanceUntilChar(e){for(;this.position<this.source.length;){if(this.source.charCodeAt(this.position)===e)return!0;this.advance(1)}return!1}advanceUntilChars(e){for(;this.position+e.length<=this.source.length;){let t=0;for(;t<e.length&&this.source.charCodeAt(this.position+t)===e[t];t++);if(t===e.length)return!0;this.advance(1)}return this.goToEnd(),!1}skipWhitespace(){return this.advanceWhileChar(e=>e===GC||e===XC||e===UC||e===jC||e===VC)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},bp=33,ao=45,hi=60,sn=62,ta=47,zC=61,yp=34,vp=39,UC=10,VC=13,jC=12,GC=32,XC=9,na="(?=[\\s/>])",YC=new RegExp(`<!--|-->|<\\/?script${na}\\s*\\/?>?`,"i"),KC=new RegExp(`<\\/style${na}`,"i"),ZC={"text/x-handlebars-template":!0,"text/html":!0};function QC(e,t=0,n=0,r=!1){const o=new qC(e,t);let i=n,s=0,a=18,l,c,u=!1,d,f,p;function m(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function h(){const b=o.pos();for(;!o.eos();){const v=o.nextChar();if(v===sn)return!0;if(v===hi)break;if(v===yp||v===vp){if(!o.advanceUntilChar(v))break;o.advance(1)}}return o.goBackTo(b),!1}function y(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function w(b,v,S){return a=v,s=b,l=S,v}function A(){const b=o.pos(),v=i,S=k();return S!==21&&b===o.pos()&&!(r&&(S===4||S===8))?(o.advance(1),w(b,18)):S}function k(){const b=o.pos();if(o.eos())return w(b,21);let v;switch(i){case 6:return o.advanceIfChars([ao,ao,sn])?(i=0,w(b,2)):(o.advanceUntilChars([ao,ao,sn]),w(b,1));case 3:return o.advanceIfChar(sn)?(i=0,w(b,15)):(o.advanceUntilChar(sn),w(b,14));case 0:if(o.advanceIfChar(hi)){if(!o.eos()&&o.peekChar()===bp){if(o.advanceIfChars([bp,ao,ao]))return i=6,w(b,0);if(o.advanceIfRegExp(/^!doctype/i))return i=3,w(b,13)}return o.advanceIfChar(ta)?(i=2,w(b,7)):(i=1,w(b,3))}return o.advanceUntilChar(hi),w(b,16);case 2:return m().length>0?(i=5,u=!1,w(b,9)):o.skipWhitespace()?w(b,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(sn),b<o.pos()?w(b,18,"End tag name expected."):k());case 5:if(o.skipWhitespace())return u=!0,w(b,17);if(o.advanceIfChar(sn))return i=0,w(b,8);if(r&&o.peekChar()===hi)return i=0,w(b,8,"Closing bracket missing.");if((u||o.peekChar()===ta)&&h())return i=0,w(b,8);v="Closing bracket expected.";break;case 1:return d=m(),p=void 0,f=void 0,d.length>0?(c=!1,i=4,w(b,6)):o.skipWhitespace()?w(b,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(sn),b<o.pos()?w(b,18,"Start tag name expected."):k());case 4:return o.skipWhitespace()?(c=!0,w(b,17)):c&&(f=y(),f.length>0)?(i=9,c=!1,w(b,11)):o.advanceIfChars([ta,sn])?(i=0,w(b,5)):o.advanceIfChar(sn)?(d==="script"?p&&ZC[p]?i=0:i=7:d==="style"?i=8:i=0,w(b,4)):r&&o.peekChar()===hi?(i=0,w(b,4,"Closing bracket missing.")):(o.advance(1),w(b,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,w(b,17)):o.advanceIfChar(zC)?(i=10,w(b,10)):(i=4,k());case 10:if(o.skipWhitespace())return w(b,17);let S=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(S.length>0)return o.peekChar()===sn&&o.peekChar(-1)===ta&&(o.goBack(1),S=S.substr(0,S.length-1)),f==="type"&&(p=S),i=4,c=!1,w(b,12);const T=o.peekChar();return T===vp||T===yp?(o.advance(1),o.advanceUntilChar(T)&&o.advance(1),f==="type"&&(p=o.getSource().substring(b+1,o.pos()-1)),i=4,c=!1,w(b,12)):(i=4,c=!1,k());case 7:let g=1;for(;!o.eos();){const E=o.advanceIfRegExp(YC);if(E.length===0)return o.goToEnd(),w(b,19);if(E==="<!--")g===1&&(g=2);else if(E==="-->")g=1;else if(E[1]!=="/")g===2&&(g=3);else if(g===3)g=2;else{o.goBack(E.length);break}}return i=0,b<o.pos()?w(b,19):k();case 8:return o.advanceUntilRegExp(KC),i=0,b<o.pos()?w(b,20):k()}return o.advance(1),i=0,w(b,18,v)}return{scan:A,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function JC(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function e0(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function t0(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function n0(e,t){const n=`<!--${e.content}-->`;return e.start=t,e.startTagEnd=t+4,e.end=t+n.length,e.endTagStart=e.end-3,n}var $c=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function r0(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Ep=Object.create(null);function o0(e,t){const n=Ep[e]||(Ep[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[r0(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function Wc(e,t){if(e.start===e.end||t)return"";switch(e.type){case $.ELEMENT:return Uc(e,t);case $.ROOT:return[...e.children].map(n=>Wc(n,t)).join("");case $.DOCTYPE:return JC(e,t);case $.COMMENT:return t0(e,t);default:return e.content||""}}function qc(){return{exact:new WeakMap,collapsed:new WeakMap}}function Lr(e,t=!1,n){if(e.start===e.end&&e.type!==$.ROOT)return"";const r=n&&(t?n.collapsed:n.exact),o=r?.get(e);if(o!==void 0)return o;const i=()=>e.children.map(a=>Lr(a,t,n)).join("");let s;switch(e.type){case $.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case $.ROOT:s=i();break;case $.COMMENT:s=`<!--${e.content??""}-->`;break;case $.DOCTYPE:s=`<!${e.content??""}>`;break;default:{const a=e.content??"";s=t?a.replace(/\s+/g," ").trim():a}}return r?.set(e,s),s}function zc(e,t=0){if(e.start===e.end)return"";switch(e.type){case $.ELEMENT:return s0(e,t);case $.ROOT:return wp(e,t);case $.DOCTYPE:return e0(e,t);case $.COMMENT:return n0(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function Sp(e){const t=e.tag?.toLowerCase();let n="";if(t){const r=e.attributes;if(r){const o=Object.keys(r);for(const i of o){const s=r[i]===null?"":r[i];typeof s=="string"&&(n+=s===""&&i!=="em"&&!o0(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function i0(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=Wc(r);return n}function wp(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=zc(r,t+n.length);return n}function Cp(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=Sp(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function Ap(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function Uc(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=Cp(e,t);if($c.has(r))return o;{const i=Ap(e,t);return`${o}${n?i0(e,t):""}${i}`}}function s0(e,t){const n=e.tag?.toLowerCase()||"div",r=Cp(e);if(e.start=t,e.startTagEnd=t+r.length,$c.has(n)){e.endTagStart=e.startTagEnd,e.end=e.startTagEnd;const o=i=>{for(const s of i.children)s.start=s.startTagEnd=s.endTagStart=s.end=i.end,o(s)};return o(e),r}else{const o=wp(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=Ap(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function Vc(e,t){let n=0,r=e.length;if(r===0)return 0;for(;n<r;){const o=Math.floor((n+r)/2);t(e[o])?r=o:n=o+1}return n}var $=(function(e){return e[e.HTML=0]="HTML",e[e.ELEMENT=1]="ELEMENT",e[e.ROOT=2]="ROOT",e[e.COMMENT=3]="COMMENT",e[e.DOCTYPE=4]="DOCTYPE",e[e.ADVANCED=5]="ADVANCED",e})({}),ra=e=>e.type===0?e.start-1:e.start,a0=e=>e.type===0?e.end+1:e.end,Ct=class MC{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){L(this,"start",void 0),L(this,"end",void 0),L(this,"children",void 0),L(this,"parent",void 0),L(this,"content",void 0),L(this,"type",1),L(this,"tag",void 0),L(this,"closed",!1),L(this,"startTagEnd",void 0),L(this,"endTagStart",void 0),L(this,"attributes",void 0),L(this,"createdBy",void 0),L(this,"isDirty",void 0),this.start=t,this.end=n,this.children=r,this.parent=o}isSameTag(t){return this.tag===void 0?t===void 0:t!==void 0&&this.tag.length===t.length&&this.tag.toLowerCase()===t}get firstChild(){return this.children[0]}get lastChild(){return this.children.length?this.children[this.children.length-1]:void 0}findNodeBefore(t){const n=Vc(this.children,r=>t<=ra(r))-1;if(n>=0){const r=this.children[n];if(t>ra(r)){if(t<r.end)return r.findNodeBefore(t);const o=r.lastChild;return o&&o.end===r.end?r.findNodeBefore(t):r}}return this}findNodeAt(t){const n=Vc(this.children,r=>t<=ra(r))-1;if(n>=0){const r=this.children[n];if(t>=ra(r)&&t<=a0(r))return r.findNodeAt(t)}return this}find(t){if(t(this))return this;for(const n of this.children){const r=n.find(t);if(r)return r}}closest(t){let n=this;do if(t(n))return n;while(n=n.parent)}parents(){return this.parent?[this.parent,...this.parent.parents()]:[]}closestFromRoot(t,n=!0){const r=n?[this,...this.parents()]:this.parents();for(let o=r.length-1;o>=0;o--){const i=r[o];if(t(i))return i}}contains(t){return!!t.closest(n=>n===this)}clone(t=this.parent,n=this.start,r=!0){const o=this.start-n,i=new MC(n,this.end-o,[],t);return i.children=r?this.children.map(s=>s.clone(i,s.start-o)):[],i.attributes={...this.attributes},i.closed=this.closed,i.content=this.content,i.startTagEnd=this.startTagEnd,i.endTagStart=this.endTagStart,i.tag=this.tag,i.type=this.type,i}};function l0(e){if(typeof e=="string"){const t=e.startsWith("'")||e.startsWith('"')?1:0,n=e.endsWith("'")||e.endsWith('"')?e.length-1:e.length;return e.substring(t,n)}return e}var Tp=class{constructor(e,t){L(this,"text",void 0),L(this,"type",void 0),L(this,"node",void 0),L(this,"replaces",void 0),this.text=e,this.type=t}get hasNode(){return!!this.node}addReplace(e){this.replaces?.push(e)}start(e,t,n){if(!this.node){const r=this.node=new Ct(e,this.text.length,[],n);r.type=this.type,r.startTagEnd=t,this.replaces=[]}}finish(e,t){const n=this.replaces,r=this.node,o=e+(t||0);if(n){for(const i of n){const s=i.parent;if(!s)throw new Error("parent not defined");const a=s.children.indexOf(i);s.children.splice(a,1)}this.replaces=void 0}if(r){const i=r.parent;if(!i)throw new Error("parent not defined");i.children.push(r),r.closed=t!==void 0,r.endTagStart=e,r.end=o,r.content=this.text.substring(r.startTagEnd,e),this.node=void 0}}},_p=class{constructor(e){L(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=QC(e,void 0,void 0,!0),r=new Ct(0,e.length,[],void 0);r.type=$.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const m=o.parent.children,h=m[m.length-2],y=e.substring(o.start,o.end);h?.type===$.HTML?(h.content=(h.content||"")+y,h.end=o.end,m.splice(m.length-1,1)):(o.type=$.HTML,o.content=y,o.children=[]),o.type=$.HTML}o=o.parent},u=new Tp(e,$.COMMENT),d=new Tp(e,$.DOCTYPE),f=m=>{o.children.push(m)};for(;l!==wt.EOS;){switch(l){case wt.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case wt.EndDoctypeTag:{const A=o.lastChild,k=d.node;if(!k)throw new Error("");const b=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(b!==k.start){const v=e.substring(b,k.start);if(v){const S=new Ct(b,k.start,[],o);S.type=$.HTML,S.content=v,f(S)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case wt.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case wt.EndCommentTag:{const A=o.lastChild,k=u.node;if(!k)throw new Error("");const b=A?A.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(b!==k.start){const v=e.substring(b,k.start);if(v){const S=new Ct(b,k.start,[],o);S.type=$.HTML,S.content=v,f(S)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case wt.StartTagOpen:const m=o.lastChild,h=new Ct(n.getTokenOffset(),e.length,[],o),y=m?m.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(y!==h.start){const A=e.substring(y,h.start);if(A){const k=new Ct(y,h.start,[],o);k.type=$.HTML,k.content=A,f(k)}}f(h),o=h;break;case wt.StartTag:o.tag=n.getTokenText();break;case wt.StartTagClose:o.parent&&(o.end=n.getTokenEnd(),n.getTokenLength()?(o.startTagEnd=n.getTokenEnd(),o.tag&&this.dataManager.isVoidElement(o.tag)&&(o.closed=!0,c())):c());break;case wt.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case wt.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case wt.EndTag:s=n.getTokenText().toLowerCase();break;case wt.EndTagClose:let w=o;for(;!w.isSameTag(s)&&w.parent;)w=w.parent;if(w.parent){const A=o.lastChild,k=A?A.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(k!==i){const b=e.substring(k,i);if(b){const v=new Ct(k,i,[],o);v.type=$.HTML,v.content=b,f(v)}}for(;o!==w;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case wt.AttributeName:{a=n.getTokenText();let A=o.attributes;A||(o.attributes=A={}),A[a]=null;break}case wt.AttributeValue:{const A=n.getTokenText(),k=o.attributes;k&&a&&(k[a]=l0(A),a=null);break}}l=n.scan()}for(;o.parent;)o.end=e.length,o.closed=!1,c();u.hasNode,u.finish(e.length);const p=r.lastChild?.end||0;if(p<e.length){const m=e.substring(p);if(m){const h=new Ct(p,e.length,[],r);h.type=$.HTML,h.content=m,f(h)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},uj=new _p(new gp(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),c0=new gp(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),u0=new _p(c0);function Tn(e){return u0.parse(e)}function oa(e){if(e){const t=document.createElement("div");return t.insertAdjacentHTML("afterbegin",e),t.firstChild||document.createTextNode("")}else return document.createTextNode("")}var kp=new Set(["text/x-handlebars-template","text/html"]);function ia(e,t){if(e.type!==$.HTML||!t)return!1;const n=t.tag?.toLowerCase(),r=t.attributes?.type;return n==="style"||n==="script"&&!kp.has(typeof r=="string"?r:"")}var d0={amp:"&",lt:"<",gt:">",nbsp:String.fromCodePoint(160),quot:'"'};function jc(e){return e.replaceAll(/&(amp|lt|gt|nbsp|quot);/g,(t,n)=>d0[n])}var Lp=Symbol("rawTextSource");function Gc(e){const t=document.createTextNode(jc(e));return Np(t,e),t}function Np(e,t){Object.defineProperty(e,Lp,{value:t,configurable:!0})}function f0(e,t){e.data=jc(t),Np(e,t)}function xp(e){const t=e[Lp];return t!==void 0&&jc(t)===e.textContent?t:void 0}var lo,Nr;function Op(e){const t=lo;return lo=e,()=>{lo===e&&(lo=t)}}function m0(e){const t=Nr;return Nr=e,()=>{Nr===e&&(Nr=t)}}function Rp(e,t,n){return lo?lo(e,t,n):n}function p0(){return Nr!==void 0}function Mp(e,t,n){return Nr?Nr(e,t,n):n}var Xc;function h0(){return Xc||(Xc=document.implementation.createHTMLDocument("")),Xc}function g0(e,t){let n;switch(t?.toLowerCase()){case"tr":n=e.createElement("table");break;case"td":n=e.createElement("tr");break;case"head":case"body":n=e.createElement("html");break;case"documenttype":case"html":{const r=e.implementation.createHTMLDocument();for(const o of[...r.childNodes])o.remove();return r}default:n=e.createElement("div")}return n}var b0=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),y0=new Set(["script","style","xmp"]);function v0(e,t){return!(t&&y0.has(t.toLowerCase())||b0.has(e.toLowerCase()))}var E0=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},S0=new Set(["head","body"]);function Pp(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=h0(),s=S0.has(r)?g0(i,r):i.createElement("template");if(s instanceof Document)return;s.innerHTML=o;const a=(s.tagName==="TEMPLATE"?s.content:s).querySelector(r);if(!a)throw new Error("targetElement is not defined");const l=a.getAttributeNode(t);l&&e.setAttributeNode(l.cloneNode())}function Gn(e,t,n){try{v0(t,e.tagName)&&!E0(n)?e.setAttribute(t,n):Pp(e,t,n)}catch{Pp(e,t,n)}}function Ip(){return oa("<script><\/script>")}var w0="text/x-em-dormant",gi=Symbol("dormantScriptType");function Yc(e){e[gi]=e.getAttribute("type"),e.setAttribute("type",w0)}function sa(e){return gi in e}function C0(e){const t=[...e].filter(n=>!sa(n));return t.forEach(Yc),t}function A0(e,t){return sa(e)?(e[gi]=t,!0):!1}function Dp(e){const t=new Set;for(const n of e){const r="querySelectorAll"in n?n.querySelectorAll("script"):[];for(const o of[n,...r])sa(o)&&t.add(o)}return[...t]}function Bp(e){if(!sa(e))return;const t=e[gi];delete e[gi],typeof t=="string"?e.setAttribute("type",t):e.removeAttribute("type")}var T0=["application/ecmascript","application/javascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"];function _0(e){const t=e.getAttribute("type"),n=e.getAttribute("language");return t===""||t===null&&!n?"text/javascript":(t===null?`text/${n}`:t.trim()).toLowerCase()}function Hp(e){const t=_0(e);return T0.includes(t)?"classic":t==="module"||t==="importmap"||t==="speculationrules"?t:void 0}function k0(e){return Hp(e)==="classic"}function L0(e){const t=e.getAttribute("for"),n=e.getAttribute("event");return t===null||n===null?!0:t.trim().toLowerCase()==="window"&&["onload","onload()"].includes(n.trim().toLowerCase())}function N0(e){const t=Hp(e);return!t||t==="speculationrules"||aa(e)?!1:t!=="classic"||!e.hasAttribute("nomodule")&&L0(e)}function x0(e){return e.hasAttribute("src")&&!["async","defer","nomodule"].some(t=>e.hasAttribute(t))&&k0(e)}function aa(e){for(let t=e.parentElement;t;t=t.parentElement)if(t.localName==="template"&&t.namespaceURI==="http://www.w3.org/1999/xhtml")return!0;return!1}function Fp(e,t){const n=e.parentNode;!n||!e.isConnected||(e.hasAttribute("src")&&!e.hasAttribute("async")&&(e.async=!1),t.run(e,()=>n.insertBefore(e,e.nextSibling)))}function $p(e,t){[...t.attributes].forEach(r=>t.removeAttributeNode(r)),[...e.attributes].forEach(r=>t.setAttributeNode(r.cloneNode()));const n=Object.getOwnPropertyDescriptor(e,"$$tagName");n&&!Object.getOwnPropertyDescriptor(t,"$$tagName")&&Object.defineProperty(t,"$$tagName",n)}function Wp(e,t,n){e.replaceWith(t),t.append(...e.childNodes),n.substitute?.(e,t)}function qp(e,t){const n=Ip();return $p(e,n),t.quiet(()=>Wp(e,n,t)),n}function O0(e,t,n){const r=qp(t,n),o=()=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r.isConnected&&(n.quiet(()=>{$p(r,t),Yc(t),Wp(r,t,n),Bp(t)}),Fp(t,n))};e.addEventListener("load",o),e.addEventListener("error",o)}function zp(e,t){e.forEach(Bp);const n=e.filter(aa),r=e.filter(i=>i.isConnected&&!aa(i));if(!r.length&&!n.length)return;r.sort((i,s)=>i.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),t.awake?.(),n.forEach(i=>qp(i,t));let o;for(const i of r)o&&!i.hasAttribute("src")?O0(o,i,t):(Fp(i,t),o=x0(i)?i:o)}function xr(e,t=!0,n=!1){const r=e.content;switch(e.type){case $.ROOT:{const o=document.implementation.createHTMLDocument();for(const i of[...o.childNodes])o.removeChild(i);if(t)for(const i of e.children)o.appendChild(xr(i,!0,n));return o}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(r||"");case $.ELEMENT:if(e.tag){const o=e.tag.toLowerCase()==="script",i=n===!0&&o?Ip():document.createElement(e.tag);if(Object.defineProperty(i,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const s of e.attributeNames){const a=e.attributes[s];try{const l=Rp(i,s,typeof a=="string"?a:"");l!==null&&Gn(i,s,l)}catch{}}if(n==="dormant"&&o&&Yc(i),t){const s=e.tag.toLowerCase()==="template"?!0:n;for(const a of e.children)i.appendChild(ia(a,e)?Gc(a.content||""):xr(a,!0,s))}return i}return document.createTextNode("<");case $.HTML:return oa(r||"");default:throw new Error("unsupported node")}}function Ie(e,t=!1){return Tn(e).roots.map(n=>xr(n,!0,t))}function la(e,t,n){switch(t){case"afterend":e.after(...n);break;case"afterbegin":e.prepend(...n);break;case"beforeend":e.append(...n);break;case"beforebegin":e.before(...n)}}function R0(e,t){e.replaceChildren(...Ie(t,!0))}function Xn(e,t,n){la(e,t,Ie(n,!0))}var Up=Symbol.for("emailmaker.documentWriteGuard"),bi=Symbol.for("emailmaker.documentWriteSink");function M0(e,t=document){const n=t,r=n[bi];return n[bi]=e,()=>{n[bi]===e&&(n[bi]=r)}}function dj(e){}function Kc(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0})}function P0(e,t,n){for(let r=e.writerOf.get(t);r;r=e.writerOf.get(r))if(r===n)return!0;return!1}function I0(e,t){let n=t;for(;n.nextSibling&&P0(e,n.nextSibling,t);)n=n.nextSibling;return n}function Vp(e,t,n){if(!n.length)return;n.forEach(i=>e.writerOf.set(i,t));const r=()=>{for(const i of n){const s=t.parentNode;if(!s)return;s.insertBefore(i,I0(e,t).nextSibling)}},o=e.doc[bi];o?o(n,r,t):r()}function jp(e,t){return!!e&&e.type===$.ELEMENT&&!e.closed&&e.end===t}function D0(e,t){let n="";for(let r=e;jp(r,t);r=r.lastChild)n=`</${r.tag}>${n}`;return n}function B0(e){const t=Tn(e).roots,n=t[t.length-1],r=jp(n,e.length);return{nodes:(r?t.slice(0,-1):t).map(o=>xr(o)),rest:r?e.slice(n.start):""}}function H0(e){const t=[...e.pending];e.pending.clear();for(const[n,r]of t){const o=Tn(r).roots,i=r+D0(o[o.length-1],r.length);Vp(e,n,Tn(i).roots.map(s=>xr(s)))}}function Gp(e,t,n){const r=e.doc.currentScript;if(!r?.parentNode){return}const{nodes:o,rest:i}=B0((e.pending.get(r)??"")+n);i?(e.pending.size||queueMicrotask(()=>H0(e)),e.pending.set(r,i)):e.pending.delete(r),Vp(e,r,o)}function F0(e=document){const t=e;if(t[Up])return;t[Up]=!0;const n={doc:t,writerOf:new WeakMap,pending:new Map};Kc(e,"write",(...r)=>Gp(n,"write",r.join(""))),Kc(e,"writeln",(...r)=>Gp(n,"writeln",`${r.join("")}
|
|
2
|
+
`)),Kc(e,"open",(...r)=>r.length>=3?e.defaultView?.open(r[0],r[1],r[2])??null:e)}F0();function $0(e){return e}var W0=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),L(this,"cycle",void 0),this.cycle=e}};function q0(e){const t=new Map;for(const n of e)for(const r of n.provides??[]){const o=t.get(r)??[];o.push(n),t.set(r,o)}return t}function z0(e,t){const n=[];for(const r of e.awaits?.services??[])for(const o of t.get(r)??[])o!==e&&n.push(o);return n}function U0(e){const t=q0(e),n=[],r=new Set,o=[],i=new Set,s=a=>{if(!r.has(a)){if(i.has(a)){const l=o.indexOf(a);throw new W0([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of z0(a,t))s(l);o.pop(),i.delete(a),r.add(a),n.push(a)}};for(const a of e)s(a);return n}var Ae=class PC{constructor(t=[]){L(this,"_inner",void 0),L(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof PC&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(t){this.addDisposable({dispose:t})}removeDisposable(t){const n=this._inner.indexOf(t);n>=0&&this._inner.splice(n,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const t of[...this._inner])t.dispose()}}};function Zc(e){return`service_container_${e}`}var yi=new Set,Qc;function V0(){if(!Qc)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,Xp.prototype.getInstanceAsync),e.stack}function Jc(e){yi.delete(e)&&Qc?.end(e)}var Xp=class cp extends Ae{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),L(this,"_parent",void 0),L(this,"_injectCallbacks",[]),L(this,"_injections",Object.create(null)),L(this,"onInject",n=>(this._injectCallbacks.push(n),{dispose:()=>{const r=this._injectCallbacks.indexOf(n);r>=0&&this._injectCallbacks.splice(r,1)}})),this._parent=t,t&&this.addDisposable(t.onInject(n=>this._runCallbacks(n)))}inject(t,n){this._injections[t]=()=>n,this._runCallbacks(t)}injectFactory(t,n,r){const o=this._injections[t];let i=typeof o=="function"?o():o;const s=this._injections[t]=()=>(i=n(this,i),i);r&&s(),this._runCallbacks(t)}_find(t,n=!0){return this._injections[t]||n&&this._parent?._find(t)}_onInject(t,n,r=new Ae){return r.addDisposable(this.onInject(o=>{t===o&&!r.isDisposed()&&(r.dispose(),n(this.getInstance(o)))})),this._parent&&r.addDisposable(this._parent._onInject(t,n,r)),this.addDisposable(r),r}getInstance(t,n=!0){const r=this._find(t,n);if(typeof r=="function")return r()}getOrCreateInstance(t,n){const r=this._find(t);if(typeof r=="function")return r();const o=n(this);return this.inject(t,o),o}getInstanceAsync(t){const n=this._find(t);if(typeof n=="function")return Promise.resolve(n());const r=V0();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};yi.add(s),Qc?.start(s),this._onInject(t,()=>{Jc(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(yi))n.container===this&&(Jc(n),n.reject(t))}pendingWaits(){return[...yi].filter(t=>t.container===this)}addService(t,n){const r=Zc(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new Ae;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=Zc(t);let i;this.injectFactory(o,(a,l=[])=>(i=n(a,i),i===void 0?l:l.indexOf(i)<0?[...l,i]:l),r);const s=new Ae;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=Zc(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new cp(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new cp(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(yi))t.container===this&&Jc(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function eu(e){return e.startsWith("__")?e:`__${e}__`}function j0(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=eu(e),n=globalThis;return n[t]??(n[t]={})}function G0(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function X0(e){if(e)return eu(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return eu(t)}function tu(e){const t=X0(e),n=j0(t);if(G0(n.container))return n.container;const r=new Xp(null);return n.container=r,r}function Y0(){let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n==="x"?r:r&3|8).toString(16)})}function K0(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Y0()}function fe(e=K0()){return e}function Yp(){return"iframe".trim()||"unknown"}function Z0(e){if(typeof globalThis>"u")return;const t=Yp(),n=globalThis[e]??{};globalThis[e]=n;const r=n.__diagnostics??(n.__diagnostics={}),o=r.diModuleEval??(r.diModuleEval={evalCount:0,records:[]});o.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),o.evalCount+=1}function Q0(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function J0(e,t){if(Z0(t),typeof globalThis>"u")return e;const n=Yp(),r=globalThis,o=r[t]=r[t]||{},i=o.__diagnostics=o.__diagnostics||{},s=i.dependencyResolver=i.dependencyResolver||{entries:[]},a={container:e,source:"packages/runtime-core/di/index.ts",buildSource:n,timestamp:Date.now(),stack:new Error().stack};return s.entries.push(a),e}var ca;function eA(){if(ca)return ca;const e=Q0();return ca=J0(tu(e),e),ca}var fj=new Proxy({},{get(e,t,n){const r=eA(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),tA=new Function("url","return import(url)");function nA(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function nu(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function Kp(e){return e.type==="umd"||e.resolve==="registry"}var rA="If the plugin is built on globals, enable the compatibility layer: the `compatGlobals` option of the bundler plugin or `import '<package>/compat-globals'` before creating the editor.";function oA(e){const t=Array.isArray(e)?e[0]:e;return nu(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function iA(e,t){const n=oA(e),r=nu(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&Kp(r)&&!/compat/iu.test(o)?` ${rA}`:"",s=new Error(`Plugin "${n}" was skipped: it failed to load. ${o}${i}`);return s.cause=t,{name:n,url:r?.url,error:s}}function sA(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function mj(e){return e}var aA=class{constructor(e,t,n={}){L(this,"_context",void 0),L(this,"_pluginRegistry",void 0),L(this,"_options",void 0),L(this,"_map",new Map),L(this,"_optionsMap",new Map),L(this,"_readyMap",new Map),L(this,"_resolveMap",new Map),L(this,"_initializingPlugins",new Map),L(this,"_creatingPlugins",new Set),L(this,"_initializedPlugins",new Set),L(this,"_creationOrder",[]),L(this,"_lifecycleListeners",new Set),L(this,"_activated",!1),this._context=e,this._pluginRegistry=t,this._options=n}activate(){return this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}activateSync(){this._activated=!0,this._startPluginsBatch(Array.from(this._map.values()))}onLifecycle(e){return this._lifecycleListeners.add(e),{dispose:()=>this._lifecycleListeners.delete(e)}}_emitLifecycle(e){for(const t of Array.from(this._lifecycleListeners))try{t(e)}catch{}}async _resolveEntry(e){if(typeof e=="string"||typeof e=="symbol"){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);return{ctor:t}}if(typeof e=="function")return e.length===0?{ctor:await e()}:{ctor:e};if(Array.isArray(e)){const[t,n]=e;if(typeof t=="function")return{ctor:t,options:n};const r=await this._pluginRegistry.getAsync(t);if(!r)throw new Error(`Plugin "${String(t)}" not registered.`);return{ctor:r,options:n}}if(nu(e))return this._resolveDescriptor(e);throw new Error(`Unknown plugin entry format: ${JSON.stringify(e)}`)}async _resolveDescriptor(e){const t=e.resolve??(e.type==="umd"?"window":"module");if(Kp(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await tA(e.url);if(t==="module")return{ctor:n.default??n};if(t==="registry"&&e.name){const r=await this._pluginRegistry.getAsync(e.name);if(!r)throw new Error(`Plugin "${e.name}" not found in registry after ESM load`);return{ctor:r}}}if(e.type==="umd"){if(await this._loadScript(e.url),t==="window"&&e.name){const n=globalThis[e.name];if(!n)throw new Error(`Plugin "${e.name}" not found on window after script load`);return{ctor:n}}if(t==="registry"&&e.name){const n=await this._pluginRegistry.getAsync(e.name);if(!n)throw new Error(`Plugin "${e.name}" not found in registry after script load`);return{ctor:n}}}throw new Error(`Cannot resolve descriptor: type=${e.type}, resolve=${t}, name=${e.name??"none"}`)}_loadScript(e){return new Promise((t,n)=>{if(typeof document>"u"){n(new Error("Cannot load UMD script in non-browser environment"));return}const r=document.createElement("script");r.src=e,this._options.explainScriptFailure?.();let o;const i=a=>{o||(a.filename===r.src?o=this._scriptExecutionError(e,a.error??a.message):sA(a)&&(o=this._scriptExecutionError(e,this._options.explainScriptFailure?.()??a.message)))},s=()=>window.removeEventListener("error",i);window.addEventListener("error",i),r.onload=()=>{if(s(),o){n(o);return}t()},r.onerror=()=>{s(),n(new Error(`Failed to load script: ${e}`))},document.head.appendChild(r)})}_scriptExecutionError(e,t){const n=t instanceof Error?t.message:String(t),r=new Error(`Plugin script "${e}" threw while executing: ${n}`);return r.cause=t,r}initSync(e){const t=[];for(const n of e){const r=this._createOrSkip(n,void 0);r&&t.push(r)}this._activated=!0,this._startPluginsBatch(t)}async init(e){const t=[],n=new Set;for(const r of e){const o=await this._resolveOrSkip(r);if(!o)continue;const i=this._createOrSkip(o.ctor,o.options);i&&!n.has(i)&&(n.add(i),t.push(i))}this._activated=!0,await this._startPluginsBatch(t)}async setPlugins(e){const t=new Set,n=[];for(const s of e){const a=await this._resolveOrSkip(s);a&&(t.add(a.ctor),n.push(a))}const r=[];this._map.forEach((s,a)=>{t.has(a)||r.push({key:a,plugin:s})});for(let s=r.length-1;s>=0;s--){const{key:a,plugin:l}=r[s];await this._initializingPlugins.get(l),await this._disposePlugin(l,l.constructor.name),this._map.delete(a),this._optionsMap.delete(a),this._readyMap.delete(l),this._resolveMap.delete(l),this._initializingPlugins.delete(l),this._initializedPlugins.delete(l);const c=this._creationOrder.indexOf(l);c>=0&&this._creationOrder.splice(c,1)}const o=[],i=new Set;for(const{ctor:s,options:a}of n){const l=this._createOrSkip(s,a);l&&!i.has(l)&&(i.add(l),o.push(l))}this._activated&&await this._startPluginsBatch(o)}isReady(e){return this._initializedPlugins.has(e)}ready(e){return this._initializingPlugins.get(e)??this._readyMap.get(e)??Promise.resolve()}async waitFor(e,t){if(this._pluginRegistry.has(e))return this.useByKeyAsync(e);const{timeout:n}=t??{};return await new Promise((r,o)=>{let i,s=!1;const a=()=>{s||(s=!0,i&&clearTimeout(i),this._pluginRegistry.off(e,a),r())};this._pluginRegistry.on(e,a),n!==void 0&&n>0&&(i=setTimeout(()=>{s||(s=!0,this._pluginRegistry.off(e,a),o(new Error(`waitFor("${String(e)}") timed out after ${n}ms`)))},n))}),this.useByKeyAsync(e)}useByKey(e){const t=this._pluginRegistry.get(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered or not loaded yet. Use useByKeyAsync() for async plugins.`);const n=this._getOrCreate(t);return this._activated&&this._startPluginsBatch([n]),n}async useByKeyAsync(e){const t=await this._pluginRegistry.getAsync(e);if(!t)throw new Error(`Plugin "${String(e)}" not registered.`);const n=this._getOrCreate(t);return this._activated&&await this._startPluginsBatch([n]),n}useByCtor(e,t){const n=this._getOrCreate(e,t);return this._activated&&this._startPluginsBatch([n]),n}use(e){return typeof e=="function"?this.useByCtor(e):this.useByKey(e)}async useAsync(e){const{ctor:t,options:n}=await this._resolveEntry(e),r=this._getOrCreate(t,n);return this._activated&&await this._startPluginsBatch([r]),r}_getOrCreate(e,t){const n=e;if(!this._map.has(n)){t!==void 0&&this._optionsMap.set(n,t);const r=this._optionsMap.get(n),o=this._createPluginInstance(e,r),i=o.constructor.name;this._emitLifecycle({type:"created",plugin:o,name:i}),o.required?.(),this._map.set(n,o),this._creationOrder.push(o),this._setupReadyPromise(o)}return this._map.get(n)}async _resolveOrSkip(e){try{return await this._resolveEntry(e)}catch(t){const n=iA(e,t);try{this._options.reportLoadFailure?.(n)}catch{}return}}_createOrSkip(e,t){try{return this._getOrCreate(e,t)}catch(n){const r=e.name||"anonymous plugin";this._emitLifecycle({type:"create:error",ctor:e,name:r,error:n});return}}_createPluginInstance(e,t){const n=e;if(this._creatingPlugins.has(n))throw new Error(`Cyclic dependency for plugin ${e.name}`);this._creatingPlugins.add(n);const r=this._options.openEarlyWindow?.();try{return nA(e)?new e(this._context,t):e(this._context,t)||{}}finally{r?.(),this._creatingPlugins.delete(n)}}_setupReadyPromise(e){const t=new Promise(n=>{this._resolveMap.set(e,n)});this._readyMap.set(e,t)}async _startPluginsBatch(e){const t=Array.from(new Set(e)),n=new Set,r=[];for(const o of t){if(this._initializedPlugins.has(o))continue;const i=this._initializingPlugins.get(o);if(i){n.add(i);continue}r.push(o)}if(r.length>0){const o=this._runBatchLifecycle(r);for(const i of r)this._initializingPlugins.set(i,o);n.add(o),o.finally(()=>{for(const i of r)this._initializingPlugins.get(i)===o&&this._initializingPlugins.delete(i)})}await Promise.all(n)}async _runBatchLifecycle(e){const t=[];for(const n of e){const r=n.constructor.name;this._emitLifecycle({type:"init:start",plugin:n,name:r});const o=this._options.openEarlyWindow?.();try{await n.init?.(),this._emitLifecycle({type:"init:success",plugin:n,name:r}),t.push(n)}catch(i){this._emitLifecycle({type:"init:error",plugin:n,name:r,error:i})}finally{o?.()}}for(const n of t){const r=n.constructor.name;this._emitLifecycle({type:"afterInit:start",plugin:n,name:r});try{await n.afterInit?.(),this._emitLifecycle({type:"afterInit:success",plugin:n,name:r})}catch(o){this._emitLifecycle({type:"afterInit:error",plugin:n,name:r,error:o})}}for(const n of e)this._initializedPlugins.add(n),this._resolveMap.get(n)?.(),this._resolveMap.delete(n)}async _disposePlugin(e,t){this._emitLifecycle({type:"dispose:start",plugin:e,name:t});try{await e.dispose?.(),this._emitLifecycle({type:"dispose:success",plugin:e,name:t})}catch(n){this._emitLifecycle({type:"dispose:error",plugin:e,name:t,error:n})}}async dispose(){for(let e=this._creationOrder.length-1;e>=0;e--){const t=this._creationOrder[e];await this._initializingPlugins.get(t),await this._disposePlugin(t,t.constructor.name)}this._map.clear(),this._optionsMap.clear(),this._readyMap.clear(),this._resolveMap.clear(),this._initializingPlugins.clear(),this._initializedPlugins.clear(),this._creationOrder.length=0,this._lifecycleListeners.clear()}getStatus(){return Array.from(this._map.values()).map(e=>({name:e.constructor.name,initialized:this._initializedPlugins.has(e)}))}},lA=class{constructor(){L(this,"_plugins",new Map),L(this,"_listeners",new Map)}_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){const n=this._plugins.get(e);if(n?.overrides)for(const r of n.overrides)t=r(t)||t;return t}_notifyListeners(e,t){const n=this._listeners.get(e);if(!n||n.length===0)return;for(const o of n)try{o.callback(t)}catch{}const r=n.filter(o=>!o.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){const t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){const n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){const n=Promise.resolve(t.factory()).then(o=>(t.ctor=o,t.loading=void 0,this._notifyListeners(e,o),o));t.loading=n;const r=await n;return this._applyOverrides(e,r)}return new Promise(n=>{this.on(e,r=>n(this._applyOverrides(e,r)))})}add(e,t){const n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(const t of Object.keys(e)){const n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){const n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){const t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){const n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{const r=n.overrides.indexOf(t);r>=0&&n.overrides.splice(r,1)}}}on(e,t){const n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!1};return r.push(o),{dispose:()=>this._removeListener(e,t)}}once(e,t){const n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));const o={callback:t,once:!0};return r.push(o),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){const n=this._listeners.get(e);if(n){const r=n.findIndex(o=>o.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){const e=this;return{add(t,n){e.add(t,n)}}}},cA=class{constructor(e){L(this,"resolveRegistry",void 0),this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},J=fe("SandboxHtmlDocument"),gt=fe("SandboxRemoteDocument"),vi=fe("SandboxTextDocument"),an=fe("SandboxDocumentMapping"),Oe=fe("SandboxSyncCommit"),Ei=fe("SandboxLayoutProfile"),ua=fe("SandboxState"),co=fe("SandboxAttributePipeline"),ru=fe("SandboxAmpService"),ou=fe("SandboxImageReload"),da=fe("SandboxImageCache"),lt=fe("SandboxFocus"),iu=fe("SandboxLocalization"),He=fe("SandboxElementSettings"),At=fe("SandboxSetCursor"),Zp=fe("SandboxStyleRoot"),Qp=fe("SandboxVmlWidthResolver"),fa=fe("SandboxPrepareHtml"),Si=fe("SandboxSurfaceName"),ma=fe("SandboxDocumentSync"),uo=fe("SandboxMapObj"),fo=fe("SandboxActiveElementFingerprint"),pa=fe("SandboxToggleTextStyle"),ln=fe("SandboxWrapEditor"),mo=fe("SandboxInsertServices"),wi=fe("SandboxInitPreview"),su=fe("SandboxInsertPolicy"),Jp=fe("SandboxNarrowTableTextAtom"),eh=fe("SandboxSettingsExtras"),th=fe("SandboxViewportHandlers"),nh=fe("SandboxOperations"),ha=fe("SandboxApplyElementSettings"),lr=fe("SandboxOperationEnvironment"),po=fe("SandboxHostFacts"),uA="__sandbox__",Tt=tu(uA);function dA(e){return e}function fA(e,t=Tt){t.inject(Si,e.name),t.inject(Ei,e.profile);for(const n of U0(e.units))n.setup(t);return t}function cn(e,t){e.remove?.(t)}function D(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var rh=class extends Ae{constructor(e={}){super(),L(this,"_options",void 0),L(this,"_listeners",[]),L(this,"on",this._addListener.bind(this)),L(this,"event",this._addListener.bind(this)),L(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),L(this,"un",t=>{const n=this._listeners.findIndex(([r])=>r===t);n>=0&&(this._listeners.splice(n,1),this._listeners.length===0&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove())}),this._options=e}getListeners(e){return this._listeners.flatMap(([t])=>typeof t=="function"?t:t.getListeners(e))}hasListeners(){for(const[e]of this._listeners){if(typeof e=="function")return!0;const t=e;if(typeof t.hasListeners=="function"){if(t.hasListeners())return!0;continue}return!0}return!1}_addListener(e,t=0,n){if(this.isDisposed())return{dispose:()=>{}};const r=this._listeners,o=this._options;n&&typeof e=="function"&&(e=e.bind(n));const i=r.findIndex(([,a])=>a<t),s=[e,t];return r.splice(i>=0?i:r.length,0,s),r.length===1&&o.onFirstListenerAdd&&o.onFirstListenerAdd(),{dispose:()=>{const a=r.indexOf(s);a>=0&&(r.splice(a,1),!r.length&&o.onLastListenerRemove&&o.onLastListenerRemove())}}}dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},mA=class extends rh{execute(e,t){for(const n of t)try{n(...e)}catch{}}fire(...e){if(!this.isDisposed()){const t=this.execute(e,this.getListeners(e));return t===void 0?void 0:t}}},_e=class extends mA{execute([e],t){for(const n of t)try{n(e)}catch{}}},pA=class extends rh{fire(e){if(this.isDisposed())return;let t=!1,n=!1;const r={value:e,preventDefault(){t=!0},stopPropagation(){n=!0}},o=this.getListeners([r]);for(const i of o){if(n)break;try{i(r)}catch{}}return t?!1:void 0}};function hA(e,t,n){let r;const o=new _e({onFirstListenerAdd(){r=o.addDisposable(new Ae),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function gA(e,t=window){return{peer:e,send(n){e.postMessage(n,"*")},subscribe(n){const r=o=>{n({data:o.data,source:o.source,ports:o.ports})};return t.addEventListener("message",r),{dispose:()=>t.removeEventListener("message",r)}},close(){}}}function bA(e){let t=!1;return{peer:e,send(n){e.postMessage(n)},subscribe(n){const r=o=>{n({data:o.data,source:e})};return e.addEventListener("message",r),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",r)}},close(){e.close()}}}function pj(e){return e}function yA(e){return e&&typeof e=="object"}function oh(e,t){return e&&typeof e=="object"&&e.operationId===t}var _n="INIT_MESSAGE",vA="em:port-ready",EA="em:window-drained",au="";function ih(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var SA=class extends Ae{constructor(...e){super(...e),L(this,"_listeners",Object.create(null)),L(this,"addListenerAsync",(t,n,r=0,o)=>{const i=this._listeners[t]||(this._listeners[t]=[]);o&&typeof n=="function"&&(n=n.bind(o));const s=i.findIndex(([l,c])=>r<=c),a=[n,r];return this.isDisposed()||i.splice(s>=0?s:i.length,0,a),{dispose(){const l=i.indexOf(a);l>=0&&i.splice(l,1)}}}),L(this,"fireAsync",(t,n)=>{if(!this.isDisposed()){const r=this._listeners[t]||(this._listeners[t]=[]);let o;for(let i=0;i<r.length;i++){const s=r[i][0],a=o;o=l=>s(l,a)}if(o)return o(n)}}),L(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},wA=class extends Ae{constructor(e,t){super(),L(this,"_singleton",void 0),L(this,"_target",void 0),L(this,"_transport",void 0),L(this,"_transportSubscription",void 0),L(this,"_ports",new Map),L(this,"_drained",new WeakSet),L(this,"_portSendHeld",new WeakSet),L(this,"_inited",!1),L(this,"_emitter",this.addDisposable(new SA)),L(this,"_handshaken",new WeakSet),L(this,"_greeted",new WeakSet),L(this,"_outgoingFilter",void 0),L(this,"_outgoingObservers",new Set),L(this,"_offTargetListeners",new Map),L(this,"_onTransportMessage",n=>{const r=n,o=r.data,i=r.source,s=o?.port===!0?r.ports?.[0]:void 0,a=!this._isPortSource(r.source);if(a&&i&&o?.operationId==="em:window-drained"){this._ports.has(i)&&this._drained.add(i);return}if(a&&i&&this._drained.has(i))return;if(i&&i!==this._target&&this._greeted.has(i)&&oh(o,_n)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:_n,data:{}}),s&&this.usePort(s,!0,i);return}const l=r.source===this.target||this._isCurrentPort(r.source);if(l||this._notifyOffTarget(o?.operationId,r.source),yA(o)&&l||this._singleton&&oh(o,_n)){if(s&&l){const f=this._target;Promise.resolve().then(()=>this.usePort(s,!0,f))}const c=this._emitter.fireAsync(o.operationId||au,o.operationId===void 0?r:o.data),u=o.result,d=o.error;u&&d&&Promise.resolve(c).then(f=>this._sendMessage(u,f),f=>this._sendMessage(d,f))}}),this._singleton=t,this._transport=gA({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(_n,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(_n))}),e&&this.setTarget(e)}setTarget(e){if(this._target!==e){if(this._target=e,!e){this._inited=!1;return}if(this._handshaken.has(e)){this._inited=!0,this._emitter.fireAsync(_n,void 0);return}this._inited=!1,this._postMessage(e,{operationId:_n,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:_n,data:{},port:!0},[t])}observeOutgoing(e){return this._outgoingObservers.add(e),{dispose:()=>{this._outgoingObservers.delete(e)}}}_notifyOutgoing(e,t){for(const n of Array.from(this._outgoingObservers))try{n(e,t)}catch{}}addOffTargetListener(e,t){let n=this._offTargetListeners.get(e);return n||(n=new Set,this._offTargetListeners.set(e,n)),n.add(t),{dispose:()=>{n.delete(t)}}}_notifyOffTarget(e,t){const n=typeof e=="string"?this._offTargetListeners.get(e):void 0,r=n?.size?this._knownPeer(t):void 0;if(!(!n||!r))for(const o of Array.from(n))try{o(r)}catch{}}_knownPeer(e){for(const[n,r]of this._ports)if(r.transport.peer===e)return n;const t=e;return typeof e=="object"&&e!==null&&(this._handshaken.has(t)||this._greeted.has(t))?t:void 0}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}sendNow(e){const t=this._target;return!this._inited||!t?!1:(this._postMessage(t,e),!0)}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:_n,data:{}}))}forget(e){this._handshaken.delete(e),this._greeted.delete(e),this._closePort(e),this._drained.delete(e),this._target===e&&(this._inited=!1)}usePort(e,t=!1,n=this._target){if(!n||this._ports.has(n))return;const r=bA(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:vA,data:{}}),this.drainWindow(n))}holdPort(e=this._target){!e||!this._ports.has(e)||(this._portSendHeld.add(e),this._drained.delete(e))}resumePort(e=this._target){e&&this._portSendHeld.delete(e)}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)&&!this._portSendHeld.has(this._target)}hasPort(e,t){const n=this._ports.get(e);return n!==void 0&&(t===void 0||n.transport.peer===t)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e),this._portSendHeld.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:EA,data:{}},"*")}isWindowDrained(e){return this._drained.has(e)}_isPortSource(e){for(const t of this._ports.values())if(t.transport.peer===e)return!0;return!1}_isCurrentPort(e){return this._target!==void 0&&this._ports.get(this._target)?.transport.peer===e}getTarget(){return this._target}get target(){return this._target}_postMessage(e,t,n){let r=t;this._outgoingFilter&&!n?.length&&(r="data"in t?{...t,data:this._outgoingFilter(t.data)}:this._outgoingFilter(t));try{const o=this._ports.get(e);if(o&&!this._portSendHeld.has(e)){o.transport.send(r);return}if(n?.length){e.postMessage(r,"*",n);return}e.postMessage(r,"*")}catch(o){if(o?.name==="DataCloneError"){const i=typeof r?.data=="object"&&r?.data!==null?r.data:void 0}throw o}}_sendMessage(e,t,n=!0){if(!n&&!this.isInited())return;e&&this._notifyOutgoing(e,t);const r=this.addDisposable(this.onInit(o=>{const i=e?{operationId:e,data:t}:t;try{this._postMessage(o,{...i})}finally{r.dispose()}}))}send(e,t,n){return typeof e=="string"?this._sendMessage(e,t,n):this._sendMessage(au,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=ih(),o=ih();return new Promise((i,s)=>{const a=this.addDisposable(new Ae);a.addDisposable(this.onInit(l=>{try{this._postMessage(l,{operationId:e,data:t,result:r,error:o})}catch(c){a.dispose(),s(c);return}a.addDisposable(this._onMessage(r,c=>{i(c),a.dispose()})),a.addDisposable(this._onMessage(o,c=>{s(c),a.dispose()}))}))})}_onMessage(e,t,n=0){return this._emitter.addListener(e,t,n)}addListener(e,t,n){return t?this._onMessage(e,t,n):this._onMessage(au,e)}addListenerAsyncPipe(e,t,n=0){return this._emitter.addListenerAsync(e,t,n)}addListenerAsync(e,t,n=0){return this._emitter.addListenerAsync(e,async(r,o)=>{const i=await t(r);return o?o(r):i},n)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,n=0){const r=this.addDisposable(new Ae);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?r.addDisposable(this.onInit(e,t,n)):e(this._target)}):r.addDisposable(this._onMessage(_n,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}},CA=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function AA(e){return e.replace(CA,t=>/^<br\b/i.test(t)?" ":"")}var TA={theme:"canvas_fact_theme",flags:"canvas_fact_flags",commonStyles:"canvas_fact_common_styles",lockEditor:"canvas_fact_lock_editor",codeMode:"canvas_fact_code_mode",appName:"canvas_fact_app_name",previewPage:"canvas_fact_preview_page",viewport:"canvas_fact_viewport"},_A="fonts.googleapis.com",kA=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},LA=e=>{const t=kA(String(e??""));return t?t.hostname===_A&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},ke={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_IMAGE_RESET:"sandbox_image_reset",SANDBOX_NATIVE_IMAGE_DROP_CLEAR:"sandbox_native-image-drop-clear",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",_APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",SANDBOX_EBLOCK_SET_EM_BLOCK_ID:"sandbox_eblock_set_em_block_id",SANDBOX_GLOBAL_BLOCK_REPLACE:"sandbox_global_block_replace",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_NATIVE_IMAGE_DROP:"application_native-image-drop",APPLICATION_SUBJECT_UPDATE:"application_subject_update",APPLICATION_PREHEADER_UPDATE:"application_preheader_update",APPLICATION_DOMPARSER_ERROR:"application_domparser_error",APPLICATION_SYNC_DRIFT:"application_sync_drift",APPLICATION_UPDATE_ENTITY:"application_update_entity",APPLICATION_IFRAME_DRAG_EVENT:"application_iframe_drag_event",APPLICATION_HAS_AMP:"application_has_amp",APPLICATION_CANVAS_IMAGE_GET:"application_canvas_image_get",APPLICATION_PREVIEW_ALERT_SHOW:"application_preview_alert_show",APPLICATION_ATOM_INSERTED:"application_atom_inserted",APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW:"application_template_not_em_alert_show",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",SANDBOX_FLOATBLOCK_COPY:"sandbox_floatBlock_copy",SANDBOX_FLOATBLOCK_SWAP:"sandbox_floatBlock_swap",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:"SANDBOX_READY",SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:"sandbox_subject_update",SANDBOX_PREHEADER_UPDATE:"sandbox_preheader_update",SANDBOX_DRAG_EVENT:"sandbox_drag_event",SANDBOX_WHEEL:"sandbox_wheel",SANDBOX_TRANSLATIONS:"sandbox_send_translations",SANDBOX_SET_THEME_VARIABLES:"sandbox_send_theme_variables",SANDBOX_SET_PROJECT_FONTS:"sandbox_set_project_fonts",SANDBOX_CANVAS_IMAGE_CACHE_SETUP:"sandbox_canvas_image_cache_setup",SANDBOX_SET_ENTITY:"sandbox_set_entity",SANDBOX_INIT_START:"sandbox_init_start",SANDBOX_INITED:"sandbox_inited",SANDBOX_UPDATE_ENTITY:"sandbox_update_entity",RELOAD:"reload",SANDBOX_ADD_EXTENSIONS:"sandbox_add_extensions",SANDBOX_REMOVE_EXTENSIONS:"sandbox_remove_extensions",SANDBOX_ADD_SCRIPT:"sandbox_add_script",SANDBOX_IS_EMAIL_EMPTY:"sandbox_is_email_empty",SANDBOX_SWITCH_THEME:"sandbox_switch_theme",SANDBOX_CANVAS_HEALTH:"sandbox_canvas_health",SANDBOX_CANVAS_SYNCED:"sandbox_canvas_synced"},NA=e=>({REORDER_ATOM:e("Reorder element"),CLONE_ATOM:e("Clone element"),REMOVE_ATOM:e("Remove element"),EDIT_ATOM:e("Edit element"),CHANGE_IMAGE:e("Change image"),CHANGE_IMAGE_EDIT:e("Edit"),CHANGE_IMAGE_STOCK:e("Stock"),CHANGE_IMAGE_CHANGETO:e("Upload"),CHANGE_IMAGE_GIF:e("GIF"),CHANGE_IMAGE_AI:e("Generate"),REORDER_BLOCK:e("Reorder block"),REORDER_BLOCK_UP:e("Move up"),REORDER_BLOCK_DOWN:e("Move down"),EDIT_BLOCK:e("Edit block"),CLONE_BLOCK:e("Clone block"),MERGE_BLOCK:e("Merge with the chosen block"),UNMERGE_BLOCK:e("Split blocks"),COPY_BLOCK_TO_CLIPBOARD:e("Copy block to clipboard"),PASTE_BLOCK_FROM_CLIPBOARD:e("Paste block from clipboard"),REMOVE_BLOCK:e("Remove block"),SAVE_TO_BLOCKS:e("Save to Blocks"),UPDATE_GLOBAL_BLOCK_IN_TEMPLATES:e("Push block update to all templates"),ADD_BLOCK:e("Add block"),ADD_EMPTY_BLOCK:e("Add an empty block"),ADD_SAVED_BLOCK:e("Add a saved block"),ADD_COMMON_BLOCK:e("Add a common block"),ADD_TEMPLATE_BLOCK:e("Add a template block"),ADD_SEARCH_BLOCK:e("Search a block"),REORDER_GROUP:e("Reorder group"),EDIT_GROUP:e("Edit group"),CLONE_GROUP:e("Clone group"),REMOVE_GROUP:e("Remove group"),ADD_GROUP:e("Add group"),LINK:e("link"),TABLE_COLUMN:e("cell"),TABLE:e("table"),FLOAT_BLOCK:e("column"),CONTAINER:e("container"),PICTURE:e("picture"),CAROUSEL:e("carousel"),ACCORDION:e("accordion"),SOCIAL:e("Social media"),VERTICAL_INDENT:e("indent"),TEXT:e("text"),BUTTON:e("button"),VAR:e("variable"),STRUCTURE:e("block"),EMAIL:e("email"),GROUP:e("group"),TYPOGRAF:e("Typograf"),COUNTDOWN:e("countdown"),ELEMENT:e("element"),VIDEO:e("video"),ELEMENT_PATH_LINK:e("Link"),ELEMENT_PATH_BLOCK:e("Block"),ELEMENT_PATH_ATOM:e("Element"),ELEMENT_PATH_TD:e("Cell"),ELEMENT_PATH_TABLE:e("Table"),ELEMENT_PATH_FLOATBLOCK:e("Column"),ELEMENT_PATH_TEXT:e("Text"),ELEMENT_PATH_DIV:e("Container"),ELEMENT_PATH_GROUP:e("Group"),ELEMENT_PATH_EMAIL:e("Email"),ELEMENT_PATH_IMG:e("Picture"),ELEMENT_PATH_VINDENT:e("Indent"),ELEMENT_PATH_BUTTON:e("Button"),ELEMENT_PATH_CAROUSEL:e("Carousel"),ELEMENT_PATH_ACCORDION:e("Accordion"),ELEMENT_PATH_SOCIAL:e("Social media"),ELEMENT_PATH_SECTION:e("Section"),TINYMCE_CHANGECASE:e("Case Change"),TINYMCE_UPPERCASE:e("Uppercase"),TINYMCE_LOWERCASE:e("Lowercase"),PASTE_HERE:e("Drop here"),INSERT_COLUMN_BEFORE_TABLE:e("Insert column before"),INSERT_COLUMN_AFTER_TABLE:e("Insert column after"),INSERT_ROW_BEFORE_TABLE:e("Insert row before"),INSERT_ROW_AFTER_TABLE:e("Insert row after"),MERGE_RIGHT_CELL_TABLE:e("Merge right cell"),MERGE_LEFT_CELL_TABLE:e("Merge left cell"),MERGE_TOP_CELL_TABLE:e("Merge top cell"),MERGE_BOTTOM_CELL_TABLE:e("Merge bottom cell"),SPLIT_CELL_TABLE:e("Split cell"),REMOVE_COLUMN_TABLE:e("Remove column"),REMOVE_ROW_TABLE:e("Remove row"),DROP_BLOCK_HINT:e("Click or drag a block")}),K=new wA(window.parent,!0),ga,Ci,sh=Math.random().toString(36).slice(2,8),xA=0,ba;function ah(e,t){const n=ga;ga=e;try{return t()}finally{ga=n}}function ya(e,t){const n=Ci;Ci=e;try{return t()}finally{Ci=n}}function OA(){return Ci}function RA(){try{return ga?.()}catch{return}}function MA(){return ba||(ba=`${sh}:${++xA}`,Promise.resolve().then(()=>{ba=void 0})),ba}function it(e,t){const n=RA();return K.send(ke.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:Ci??"other",batch:MA(),instance:sh}),t}function lu(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(lu(e,o)===!1)return!1;return!0}function lh(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function PA(e,t){return lh(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(lu(e,o[i])===!1)return!1}},t)}function Or(e,t,n){lu(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(lh(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),PA(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var IA=e=>e.type===$.HTML?e.start-1:e.start,DA=e=>e.type===$.HTML?e.end+1:e.end;function BA(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(IA(o)>=n||DA(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function HA(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function cr(e){let t=e;do t=FA(t);while(t&&t.type===$.HTML&&!t.content);return t}function FA(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return it("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var Rr=class{constructor(e,t,n,r){L(this,"originalStart",void 0),L(this,"originalLength",void 0),L(this,"modifiedStart",void 0),L(this,"modifiedLength",void 0),this.originalStart=e,this.originalLength=t,this.modifiedStart=n,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}};function ch(e,t){return(t<<5)-t+e|0}function $A(e,t){t=ch(149417,t);for(let n=0,r=e.length;n<r;n++)t=ch(e.charCodeAt(n),t);return t}var uh=class{constructor(e){L(this,"source",void 0),this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=e.charCodeAt(n);return t}};function dh(e,t,n){return new WA(new uh(e),new uh(t)).ComputeDiff(n).changes}var ho=class{static Assert(e,t){if(!e)throw new Error(t)}},go=class{static Copy(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}static Copy2(e,t,n,r,o){for(let i=0;i<o;i++)n[r+i]=e[t+i]}},fh=class{constructor(){L(this,"m_changes",void 0),L(this,"m_originalStart",void 0),L(this,"m_modifiedStart",void 0),L(this,"m_originalCount",void 0),L(this,"m_modifiedCount",void 0),this.m_changes=[],this.m_originalStart=1073741824,this.m_modifiedStart=1073741824,this.m_originalCount=0,this.m_modifiedCount=0}MarkNextChange(){(this.m_originalCount>0||this.m_modifiedCount>0)&&this.m_changes.push(new Rr(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}},WA=class mi{constructor(t,n,r=null){L(this,"ContinueProcessingPredicate",void 0),L(this,"_originalSequence",void 0),L(this,"_modifiedSequence",void 0),L(this,"_hasStrings",void 0),L(this,"_originalStringElements",void 0),L(this,"_originalElementsOrHash",void 0),L(this,"_modifiedStringElements",void 0),L(this,"_modifiedElementsOrHash",void 0),L(this,"m_forwardHistory",void 0),L(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=mi._getElements(t),[a,l,c]=mi._getElements(n);this._hasStrings=s&&c,this._originalStringElements=o,this._originalElementsOrHash=i,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(t){return t.length>0&&typeof t[0]=="string"}static _getElements(t){const n=t.getElements();if(mi._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=$A(n[o],0);return[n,r,!0]}return n instanceof Int32Array?[[],n,!1]:[[],new Int32Array(n),!1]}ElementsAreEqual(t,n){return this._originalElementsOrHash[t]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[t]===this._modifiedStringElements[n]:!0}ElementsAreStrictEqual(t,n){return this.ElementsAreEqual(t,n)?mi._getStrictElement(this._originalSequence,t)===mi._getStrictElement(this._modifiedSequence,n):!1}static _getStrictElement(t,n){return typeof t.getStrictElement=="function"?t.getStrictElement(n):null}OriginalElementsAreEqual(t,n){return this._originalElementsOrHash[t]!==this._originalElementsOrHash[n]?!1:this._hasStrings?this._originalStringElements[t]===this._originalStringElements[n]:!0}ModifiedElementsAreEqual(t,n){return this._modifiedElementsOrHash[t]!==this._modifiedElementsOrHash[n]?!1:this._hasStrings?this._modifiedStringElements[t]===this._modifiedStringElements[n]:!0}ComputeDiff(t){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,t)}_ComputeDiff(t,n,r,o,i){const s=[!1];let a=this.ComputeDiffRecursive(t,n,r,o,s);return i&&(a=this.PrettifyChanges(a)),{quitEarly:s[0],changes:a}}ComputeDiffRecursive(t,n,r,o,i){for(i[0]=!1;t<=n&&r<=o&&this.ElementsAreEqual(t,r);)t++,r++;for(;n>=t&&o>=r&&this.ElementsAreEqual(n,o);)n--,o--;if(t>n||r>o){let c;return r<=o?(ho.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new Rr(t,0,r,o-r+1)]):t<=n?(ho.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new Rr(t,n-t+1,r,0)]):(ho.Assert(t===n+1,"originalStart should only be one more than originalEnd"),ho.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[]),c}const s=[0],a=[0],l=this.ComputeRecursionPoint(t,n,r,o,s,a,i);return s[0],a[0],l!==null?l:[new Rr(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,f,p,m,h,y,w,A){let k=null,b=null,v=new fh,S=n,T=r,g=p[0]-y[0]-o,E=-1073741824,C=this.m_forwardHistory.length-1;do{const _=g+t;_===S||_<T&&c[_-1]<c[_+1]?(d=c[_+1],m=d-g-o,d<E&&v.MarkNextChange(),E=d,v.AddModifiedElement(d+1,m),g=_+1-t):(d=c[_-1]+1,m=d-g-o,d<E&&v.MarkNextChange(),E=d-1,v.AddOriginalElement(d,m+1),g=_-1-t),C>=0&&(c=this.m_forwardHistory[C],t=c[0],S=1,T=c.length-1)}while(--C>=-1);if(k=v.getReverseChanges(),A[0]){let _=p[0]+1,x=y[0]+1;if(k!==null&&k.length>0){const N=k[k.length-1];_=Math.max(_,N.getOriginalEnd()),x=Math.max(x,N.getModifiedEnd())}b=[new Rr(_,f-_+1,x,h-x+1)]}else{v=new fh,S=s,T=a,g=p[0]-y[0]-l,E=1073741824,C=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const _=g+i;_===S||_<T&&u[_-1]>=u[_+1]?(d=u[_+1]-1,m=d-g-l,d>E&&v.MarkNextChange(),E=d+1,v.AddOriginalElement(d+1,m+1),g=_+1-i):(d=u[_-1],m=d-g-l,d>E&&v.MarkNextChange(),E=d,v.AddModifiedElement(d+1,m+1),g=_-1-i),C>=0&&(u=this.m_reverseHistory[C],i=u[0],S=1,T=u.length-1)}while(--C>=-1);b=v.getChanges()}return this.ConcatenateChanges(k,b)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,f=0,p=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const m=n-t+(o-r),h=m+1,y=new Int32Array(h),w=new Int32Array(h),A=o-r,k=n-t,b=t-r,v=n-o,S=(k-A)%2===0;y[A]=t,w[k]=n,a[0]=!1;for(let T=1;T<=m/2+1;T++){let g=0,E=0;if(T>100)return null;u=this.ClipDiagonalBound(A-T,T,A,h),d=this.ClipDiagonalBound(A+T,T,A,h);for(let _=u;_<=d;_+=2){_===u||_<d&&y[_-1]<y[_+1]?l=y[_+1]:l=y[_-1]+1,c=l-(_-A)-b;const x=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(y[_]=l,l+c>g+E&&(g=l,E=c),!S&&Math.abs(_-k)<=T-1&&l>=w[_])return i[0]=l,s[0]=c,x<=w[_]&&T<=1448?this.WALKTRACE(A,u,d,b,k,f,p,v,y,w,l,n,i,c,o,s,S,a):null}const C=(g-t+(E-r)-T)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(g,C))return a[0]=!0,i[0]=g,s[0]=E,C>0&&T<=1448?this.WALKTRACE(A,u,d,b,k,f,p,v,y,w,l,n,i,c,o,s,S,a):(t++,r++,[new Rr(t,n-t+1,r,o-r+1)]);f=this.ClipDiagonalBound(k-T,T,k,h),p=this.ClipDiagonalBound(k+T,T,k,h);for(let _=f;_<=p;_+=2){_===f||_<p&&w[_-1]>=w[_+1]?l=w[_+1]-1:l=w[_-1],c=l-(_-k)-v;const x=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(w[_]=l,S&&Math.abs(_-A)<=T&&l<=y[_])return i[0]=l,s[0]=c,x>=y[_]&&T<=1448?this.WALKTRACE(A,u,d,b,k,f,p,v,y,w,l,n,i,c,o,s,S,a):null}if(T<=1447){let _=new Int32Array(d-u+2);_[0]=A-u+1,go.Copy2(y,u,_,1,d-u+1),this.m_forwardHistory.push(_),_=new Int32Array(p-f+2),_[0]=k-f+1,go.Copy2(w,f,_,1,p-f+1),this.m_reverseHistory.push(_)}}return this.WALKTRACE(A,u,d,b,k,f,p,v,y,w,l,n,i,c,o,s,S,a)}PrettifyChanges(t){for(let n=0;n<t.length;n++){const r=t[n],o=n<t.length-1?t[n+1].originalStart:this._originalElementsOrHash.length,i=n<t.length-1?t[n+1].modifiedStart:this._modifiedElementsOrHash.length,s=r.originalLength>0,a=r.modifiedLength>0;for(;r.originalStart+r.originalLength<o&&r.modifiedStart+r.modifiedLength<i&&(!s||this.OriginalElementsAreEqual(r.originalStart,r.originalStart+r.originalLength))&&(!a||this.ModifiedElementsAreEqual(r.modifiedStart,r.modifiedStart+r.modifiedLength));){const c=this.ElementsAreStrictEqual(r.originalStart,r.modifiedStart);if(this.ElementsAreStrictEqual(r.originalStart+r.originalLength,r.modifiedStart+r.modifiedLength)&&!c)break;r.originalStart++,r.modifiedStart++}const l=[null];if(n<t.length-1&&this.ChangesOverlap(t[n],t[n+1],l)){t[n]=l[0],t.splice(n+1,1),n--;continue}}for(let n=t.length-1;n>=0;n--){const r=t[n];let o=0,i=0;if(n>0){const d=t[n-1];o=d.originalStart+d.originalLength,i=d.modifiedStart+d.modifiedLength}const s=r.originalLength>0,a=r.modifiedLength>0;let l=0,c=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength);for(let d=1;;d++){const f=r.originalStart-d,p=r.modifiedStart-d;if(f<o||p<i||s&&!this.OriginalElementsAreEqual(f,f+r.originalLength)||a&&!this.ModifiedElementsAreEqual(p,p+r.modifiedLength))break;const m=(f===o&&p===i?5:0)+this._boundaryScore(f,r.originalLength,p,r.modifiedLength);m>c&&(c=m,l=d)}r.originalStart-=l,r.modifiedStart-=l;const u=[null];if(n>0&&this.ChangesOverlap(t[n-1],t[n],u)){t[n-1]=u[0],t.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,r=t.length;n<r;n++){const o=t[n-1],i=t[n],s=i.originalStart-o.originalStart-o.originalLength,a=o.originalStart,l=i.originalStart+i.originalLength,c=l-a,u=o.modifiedStart,d=i.modifiedStart+i.modifiedLength,f=d-u;if(s<5&&c<20&&f<20){const p=this._findBetterContiguousSequence(a,c,u,f,s);if(p){const[m,h]=p;(m!==o.originalStart+o.originalLength||h!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=m-o.originalStart,o.modifiedLength=h-o.modifiedStart,i.originalStart=m+s,i.modifiedStart=h+s,i.originalLength=l-i.originalStart,i.modifiedLength=d-i.modifiedStart)}}}return t}_findBetterContiguousSequence(t,n,r,o,i){if(n<i||o<i)return null;const s=t+n-i+1,a=r+o-i+1;let l=0,c=0,u=0;for(let d=t;d<s;d++)for(let f=r;f<a;f++){const p=this._contiguousSequenceScore(d,f,i);p>0&&p>l&&(l=p,c=d,u=f)}return l>0?[c,u]:null}_contiguousSequenceScore(t,n,r){let o=0;for(let i=0;i<r;i++){if(!this.ElementsAreEqual(t+i,n+i))return 0;o+=this._originalStringElements[t+i].length}return o}_OriginalIsBoundary(t){return t<=0||t>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[t])}_OriginalRegionIsBoundary(t,n){if(this._OriginalIsBoundary(t)||this._OriginalIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._OriginalIsBoundary(r-1)||this._OriginalIsBoundary(r))return!0}return!1}_ModifiedIsBoundary(t){return t<=0||t>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[t])}_ModifiedRegionIsBoundary(t,n){if(this._ModifiedIsBoundary(t)||this._ModifiedIsBoundary(t-1))return!0;if(n>0){const r=t+n;if(this._ModifiedIsBoundary(r-1)||this._ModifiedIsBoundary(r))return!0}return!1}_boundaryScore(t,n,r,o){return(this._OriginalRegionIsBoundary(t,n)?1:0)+(this._ModifiedRegionIsBoundary(r,o)?1:0)}ConcatenateChanges(t,n){const r=[];if(t.length===0||n.length===0)return n.length>0?n:t;if(this.ChangesOverlap(t[t.length-1],n[0],r)){const o=new Array(t.length+n.length-1);return go.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],go.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return go.Copy(t,0,o,0,t.length),go.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(ho.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),ho.Assert(t.modifiedStart<=n.modifiedStart,"Left change is not less than or equal to right change"),t.originalStart+t.originalLength>=n.originalStart||t.modifiedStart+t.modifiedLength>=n.modifiedStart){const o=t.originalStart;let i=t.originalLength;const s=t.modifiedStart;let a=t.modifiedLength;return t.originalStart+t.originalLength>=n.originalStart&&(i=n.originalStart+n.originalLength-t.originalStart),t.modifiedStart+t.modifiedLength>=n.modifiedStart&&(a=n.modifiedStart+n.modifiedLength-t.modifiedStart),r[0]=new Rr(o,i,s,a),!0}else return r[0]=null,!1}ClipDiagonalBound(t,n,r,o){if(t>=0&&t<o)return t;const i=r,s=o-r-1,a=n%2===0;return t<0?a===(i%2===0)?0:1:a===(s%2===0)?o-1:o-2}};function va(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var jt=class{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){L(this,"oldPosition",void 0),L(this,"oldText",void 0),L(this,"newPosition",void 0),L(this,"newText",void 0),this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${va(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${va(this.oldText)}")`:`(replace@${this.oldPosition} "${va(this.oldText)}" with "${va(this.newText)}")`}};function Gt(e,t){return e===null||e.length===0?t:new qA(e,t).compress()}var qA=class sr{constructor(t,n){L(this,"_prevEdits",void 0),L(this,"_currEdits",void 0),L(this,"_result",void 0),L(this,"_resultLen",void 0),L(this,"_prevLen",void 0),L(this,"_prevDeltaOffset",void 0),L(this,"_currLen",void 0),L(this,"_currDeltaOffset",void 0),this._prevEdits=t,this._currEdits=n,this._result=[],this._resultLen=0,this._prevLen=this._prevEdits.length,this._prevDeltaOffset=0,this._currLen=this._currEdits.length,this._currDeltaOffset=0}compress(){let t=0,n=0,r=this._getPrev(t),o=this._getCurr(n);for(;t<this._prevLen||n<this._currLen;){if(r===null){if(o===null)break;this._acceptCurr(o),o=this._getCurr(++n);continue}if(o===null){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldEnd<=r.newPosition){this._acceptCurr(o),o=this._getCurr(++n);continue}if(r.newEnd<=o.oldPosition){this._acceptPrev(r),r=this._getPrev(++t);continue}if(o.oldPosition<r.newPosition){const[l,c]=sr._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=sr._splitPrev(r,o.oldPosition-r.newPosition);this._acceptPrev(l),r=c;continue}let s,a;if(o.oldEnd===r.newEnd)s=r,a=o,r=this._getPrev(++t),o=this._getCurr(++n);else if(o.oldEnd<r.newEnd){const[l,c]=sr._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=sr._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new jt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=sr._merge(this._result);return sr._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=sr._rebaseCurr(this._prevDeltaOffset,t),this._currDeltaOffset+=t.newLength-t.oldLength}_getCurr(t){return t<this._currLen?this._currEdits[t]:null}_acceptPrev(t){this._result[this._resultLen++]=sr._rebasePrev(this._currDeltaOffset,t),this._prevDeltaOffset+=t.newLength-t.oldLength}_getPrev(t){return t<this._prevLen?this._prevEdits[t]:null}static _rebaseCurr(t,n){return new jt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new jt(n.oldPosition,n.oldText,n.newPosition+t,n.newText)}static _splitPrev(t,n){const r=t.newText.substr(0,n),o=t.newText.substr(n);return[new jt(t.oldPosition,t.oldText,t.newPosition,r),new jt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new jt(t.oldPosition,r,t.newPosition,t.newText),new jt(t.oldPosition+n,o,t.newEnd,"")]}static _merge(t){if(t.length===0)return t;const n=[];let r=0,o=t[0];for(let i=1;i<t.length;i++){const s=t[i];o.oldEnd===s.oldPosition?o=new jt(o.oldPosition,o.oldText+s.oldText,o.newPosition,o.newText+s.newText):(n[r++]=o,o=s)}return n[r++]=o,n}static _removeNoOps(t){if(t.length===0)return t;const n=[];let r=0;for(let o=0;o<t.length;o++){const i=t[o];i.oldText!==i.newText&&(n[r++]=i)}return n}};function mh(e){return new jt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Yn(e){return e.map(mh)}function zA(e,t,n){let r=0;const o=e.start===e.end;for(const i of t){const s=i.newLength-i.oldLength;if(i.oldLength===0){const a=i.oldPosition;if(o&&a===e.start)r+=n==="after"?s:0;else{if(e.start<a&&a<e.end)return null;a<=e.start&&(r+=s)}continue}if(o){if(e.start>=i.oldEnd)r+=s;else if(e.start>i.oldPosition)return null;continue}if(e.start>=i.oldEnd)r+=s;else if(e.end>i.oldPosition)return null}return{start:e.start+r,end:e.end+r}}function Ea(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=zA({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new jt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function ph(e,t,n=0){const r=e.range;return new jt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function bo(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),ph({text:r,range:{start:o,end:i}},t,s)})}function UA(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function Mr(e){return e.map(t=>UA(t))}function VA(e,t=cu(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var hj=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function jA(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function cu(e){return{start:0,end:e.getLength()}}function GA(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function Ai(e,t){const n=[e];for(let r=t.length-1;r>=0;r--){const{text:o,range:i}=t[r],s=n[0];n.splice(0,1,s.substring(0,i.start),o,s.substring(i.end))}return n.join("")}function XA(e,t){return t=Sa(t).sort(({range:n},{range:r})=>n.start-r.start),Ai(e,t)}function Ti(e,t){return e>=t.start&&e<=t.end}function Sa(e,t){e=[...e];let n=e.length;if(n<=1)return e;e=e.sort(({range:r},{range:o})=>r.start-o.start);for(let r=0;r<n;r++){let o=e[r],i=e[r].range;for(let s=r+1;s<n;s++){const a=e[s];let l=e[s].range,c;if(Ti(i.start,l)&&Ti(i.start,l))c=l;else if(Ti(l.start,i))Ti(l.end,i)?c=i:c={start:i.start,end:l.end};else if(Ti(l.end,i))c={start:l.start,end:i.end};else continue;const u=o.text;let d=l.start-i.start+u.length,f=l.end-i.start+u.length;const p=GA(u,a.text,{start:d,end:f});e[r]=o={range:i=c,text:p},e.splice(s--,1),n--}}return e}function YA(e,t){if(e.length<=1)return e[0]||null;e=Sa(e);const n=e.reduce((r,{range:o})=>({start:Math.min(r.start,o.start),end:Math.max(r.end,o.end)}),{start:Number.MAX_VALUE,end:Number.MIN_VALUE});return{text:Ai(t.substring(n.start,n.end),e.map(({range:r,text:o})=>({text:o,range:{start:r.start-n.start,end:r.end-n.start}}))),range:n}}function KA(e,t){const n=Yn(e),r=YA(Mr(n),t);if(r){const o=ph(r,t);return mh(o)}return null}function ZA(e,{range:t,text:n}){const r=e.getText(t);return dh(r,n,!0).map(o=>({range:{start:t.start+o.originalStart,end:t.start+o.originalStart+o.originalLength},text:n.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)}))}function hh({oldText:e,newText:t,oldPosition:n,newPosition:r}){return dh(e,t,!0).map(o=>new jt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var QA=class{constructor(e,t){L(this,"index",void 0),L(this,"values",void 0),L(this,"type","insert"),this.index=e,this.values=t}},JA=class{constructor(e,t){L(this,"index",void 0),L(this,"howMany",void 0),L(this,"type","remove"),this.index=e,this.howMany=t}},eT=class{constructor(e,t,n){L(this,"from",void 0),L(this,"to",void 0),L(this,"howMany",void 0),L(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function tT(e,t){return e===t}function nT(e,t,n=tT){for(var r=e.length,o=t.length,i=[],s=Object.create(null),a=Object.create(null),l=0;l<r;l++)for(var c=e[l],u=0;u<o;u++)if(!a[u]&&n(c,t[u])){var d=l,f=u,p=0;do s[l++]=a[u++]=!0,p++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new eT(d,f,p)),l--;break}var m=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var h=l,p=0;l<r&&!s[l++];)p++;m.push(new JA(h,p))}for(var y=[],u=0;u<o;){if(a[u]){u++;continue}for(var h=u,p=0;u<o&&!a[u++];)p++;var w=t.slice(h,h+p);y.push(new QA(h,w))}var A=y.length,k=m.length,b=i.length,v,S,T=0;for(v=0;v<k;v++){var g=m[v];for(g.index-=T,T+=g.howMany,S=0;S<b;S++){var E=i[S];E.from>=g.index&&(E.from-=g.howMany)}}for(v=A;v--;){var C=y[v],p=C.values.length;for(S=b;S--;){var E=i[S];E.to>=C.index&&(E.to-=p)}}for(v=b;v-- >1;){var E=i[v];if(E.to!==E.from)for(S=v;S--;){var _=i[S];_.to>=E.to&&(_.to-=E.howMany),_.to>=E.from&&(_.to+=E.howMany)}}var x=[];for(v=0;v<b;v++){var E=i[v];if(E.to!==E.from)for(x.push(E),S=v+1;S<b;S++){var N=i[S];N.from>=E.from&&(N.from-=E.howMany),N.from>=E.to&&(N.from+=E.howMany)}}return[...m,...x,...y]}var gh=class{constructor(){L(this,"_byKey",new Map),L(this,"_byValue",new Map)}set(e,t){this._byKey.set(e,t),this._byValue.set(t,e)}getByKey(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)}delete(e){const t=this._byKey.has(e);if(t){const n=this._byKey.get(e);this._byKey.delete(e),this._byValue.delete(n)}return t}deleteByValue(e){const t=this._byValue.has(e);if(t){const n=this._byValue.get(e);this._byValue.delete(e),this._byKey.delete(n)}return t}get size(){return this._byKey.size}},ue;(function(e){function t(d,f,p){return{type:"Add",node:f,nextSibling:p,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,f,p){return{type:"Attribute",node:d,name:f,value:p}}e.attribute=r;function o(d,f,p){return p?{type:"Update",prev:d,next:f,soft:p}:{type:"Update",prev:d,next:f}}e.update=o;function i(d,f,p,m){return[{type:"Remove",node:d},{type:"Add",node:p,nextSibling:m,parent:f,replaces:d}]}e.recreate=i;function s(d,f,p){return{type:"Move",node:f,nextSibling:p,parent:d}}e.move=s;function a(d,f){return{type:"Set",node:d,data:f}}e.set=a;function l(d,f,p){return{type:"ClassList",node:d,addedClasses:f,removedClasses:p}}e.classList=l;function c(d,f){return{type:"Style",node:d,value:f}}e.style=c;function u(d,f){return{type:"Hidden",node:d,value:f}}e.hidden=u})(ue||(ue={}));function bh(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var yh=[],vh=[];function rT(e){return bh(yh,e)}function uu(e){return e?yh.some(t=>t(e)):!1}function oT(e){return bh(vh,e)}function iT(e){return vh.some(t=>t(e))}function sT(e,t){const n=e.attributes||{},r=t.attributes||{},o=e.attributeNames,i=t.attributeNames,s=o.length,a=i.length,l=[];let c=0;for(;c<s;c++){const u=o[c];if(u!==i[c]){for(let d=c;d<s;d++){const f=o[d];l.push(ue.attribute(t,f,void 0))}break}else r[u]!==n[u]&&l.push(ue.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(ue.attribute(t,u,r[u]))}return l}function aT(e){let t=[];const n=e.children.filter(o=>o.type!==$.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(ue.add(e,n[o],r)),r=n[o];return t}function lT(e){return ue.remove(e)}var cT=new Set(["head","body","html"]),uT=e=>e.type===$.ROOT||e.type===$.DOCTYPE||e.type===$.ELEMENT&&e.tag&&cT.has(e.tag.toLowerCase());function Eh(e){const t=new gh,n=Object.create(null);for(const r of e){const o=String(r.type===$.ELEMENT?r.tag:r.type)+(!uT(r)&&r.start===r.end?"_hidden":"");let i="";r.type===$.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function du(e,t,n=!1,r=qc()){let o=[];const i=Eh(e.children),s=Eh(t.children);for(let d=e.children.length-1;d>=0;d--){const f=e.children[d];if(f.type===$.ELEMENT&&f.start===f.end){const p=i.getByValue(f);if(!s.getByKey(p)){let m=!1;for(let h=d+1;d<e.children.length;d++)if(e.children[h]){const y=i.getByValue(f),w=s.getByKey(y);if(w){const A=w.start,k=f.clone();t.children.splice(t.children.indexOf(w),0,k),Or(k,A-f.start),k.parent=t,s.set(p,k),m=!0;break}}if(!m){const h=t.endTagStart===void 0?t.end:t.endTagStart,y=f.clone();t.children.push(y),s.set(p,y),Or(y,h-f.start),y.parent=t}}}}const a=e.children.filter(d=>d.type!==$.HTML||!!d.content),l=t.children.filter(d=>d.type!==$.HTML||!!d.content),c=nT(a,l,(d,f)=>i.getByValue(d)===s.getByValue(f)),u=new Set;for(const d of c)switch(d.type){case"insert":{const f=d.index;let p=a[f];for(const m of d.values.reverse())a.splice(f,0,m),u.add(m),o.push(ue.add(t,m,p)),p=m;break}case"remove":{const f=a.splice(d.index,d.howMany);for(const p of f)o.push(ue.remove(p));break}case"move":{const f=a.splice(d.from,d.howMany);let p=a[d.to];a.splice(d.to,0,...f);for(const m of f.reverse()){const h=i.getByValue(m),y=s.getByKey(h);u.add(y),o=[...o,...mu(m,y,n,r)],o.push(ue.move(t,y,p)),p=m}break}}l.length!==a.length&&it("error while sync");for(let d=l.length-1;d>=0;d--){const f=l[d];u.has(f)||(o=[...o,...mu(a[d],f,n,r)])}return o}function fu(e){return e.type===$.ELEMENT&&uu(e.tag)}function mu(e,t,n=!1,r=qc()){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(fu(e)&&e.tag===t.tag){if(Lr(e,!1,r)===Lr(t,!1,r))return[ue.update(e,t,n),...du(e,t,!0,r)]}else if((e.type===$.ELEMENT||e.type===$.ROOT)&&e.tag===t.tag)return[ue.update(e,t,n),...sT(e,t),...du(e,t,n,r)];if(e.type===$.HTML||e.type===$.COMMENT)return e.content===t.content?[ue.update(e,t,n)]:[ue.update(e,t,n),ue.set(t,t.content)]}return!e.parent||!t.parent?it("cannot replace document",[]):fu(e)&&e.tag===t.tag?ue.recreate(e,t.parent,t,cr(t)||void 0):[ue.remove(e),ue.add(t.parent,t,cr(t)||void 0)]}var yo="FROM_DOM",vo="FROM_REMOTE",dT=/<\/.*>/gi,fT=class extends Ae{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_createRoot",void 0),L(this,"_beforeTextChangeEmitter",this.addDisposable(new _e)),L(this,"_onTextChangeEmitter",this.addDisposable(new _e)),L(this,"_onMutateEmitter",this.addDisposable(new _e)),L(this,"_beforeRefreshEmitter",this.addDisposable(new _e)),L(this,"_onRefreshEmitter",this.addDisposable(new _e)),L(this,"_root",new Ct(0,0,[])),L(this,"_applyingMutation",void 0),L(this,"beforeTextChange",this._beforeTextChangeEmitter.event),L(this,"beforeRefresh",this._beforeRefreshEmitter.event),L(this,"onTextChange",this._onTextChangeEmitter.event),L(this,"onRefresh",this._onRefreshEmitter.event),L(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new Ct(0,0,[]);n.type=$.ROOT}get root(){return this._root}contains(e){return e.root===this.root}isAttached(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t===this.root}get applyingMutation(){return this._applyingMutation}initialize(e,t){const n=this._root;this._beforeRefreshEmitter.fire();let{roots:r}=Tn(e),o=this._root=this._createRoot?this._createRoot(r,e):new Ct(0,e.length,r);o.type=$.ROOT,this._createRoot||r.forEach(i=>i.parent=o),t||this._onRefreshEmitter.fire(n?du(n,o):aT(o))}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=KA(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),ya("text",()=>this.replaceWithHtml(n,vo))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&cr(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=zc(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return it("referenced node is not a child of parent node",t);s.splice(a,0,t);const l=n?n.start:e.endTagStart===void 0?e.end:e.endTagStart;return t.parent=e,Or(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([ue.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}getContext(e){return e.closest(t=>uu(t.tag))}replaceWithHtml(e,t){const n=this._baseDocument,r=c=>{const u=this.getContext(c);if(u)return u.isDirty=!0,Promise.resolve().then(()=>{u.isDirty=!1}),!1;if(c.type!==$.HTML){if(!c.closed)return!1}else return!c.content||!dT.test(c.content);return!0};if(!this._root)return this.initialize(n.getText());let o={start:e.oldPosition,end:e.oldEnd},i=BA(o,this._root);if(!i)return this.initialize(n.getText());let s,a,l;do{const c=jA(e,i);s=this._baseDocument.getText(c),[a,...l]=Tn(s).roots}while((!a||l.length||!r(i)||!r(a)||a.end-a.start!==s.length)&&(i=i.parent));if(!i||!i.parent)return this.initialize(n.getText());this.replaceChild(i.parent,{node:a,text:s},i,t)}replaceChild(e,t,n,r){const{text:o,node:i}=t,s=e.children,a=s.indexOf(n);if(a<0)return it("referenced node is not a child of parent node",i);s.splice(a,1,i);const l=o.length-(n.end-n.start);return i.parent=e,Or(i,n.start-i.start,l),this._baseDocument.getText(i)!==o?(it("Error while sync"),i):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(mu(n,i)),n.parent=void 0,i)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return it("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return it("referenced node is not a child of parent node");const s=e.end-e.start;Or(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([lT(e)]),t!=="FROM_REMOTE"&&this._baseDocument.applyEdits(t,[{text:"",range:{start:e.start,end:e.end}}])),e.parent=void 0}setAttribute(e,t,n,r){const o=this.contains(e),i=e.attributes||(e.attributes=Object.create(null));if(typeof n=="string"?i[t]=n:delete i[t],e.start===e.startTagEnd)return;const s=Sp(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=HA(e),c=s.length-a,u=e.start;Or(e,c,c),e.start=u,o&&this._baseDocument.applyEdits(r,[{text:s,range:l}])}setContent(e,t,n){const r=this.contains(e),o=e.start,i=e.end;e.content=t;const s=e.end-e.start;if(!s)return;const a=zc(e,o),l=a.length-s;Or(e,0,l),r&&this._baseDocument.applyEdits(n,[{text:a,range:{start:o,end:i}}])}replaceWith(e,t,n){const r=e.parent;if(r){let o=cr(e);this.remove(e,n);for(let i=t.length-1;i>=0;i--){const s=t[i];this.insertBefore(r,s,o,n),o=s}}return t}replaceWithEx(e,t,n){if(typeof t=="string"){const i=Tn(t).roots;i.length!==1&&it("Error while replacing with string"),t=i[0]}const r=e.children;this.replaceWith(e,[t],n);let o=null;for(let i=r.length-1;i>=0;i--){let s=r[i];this.insertBefore(t,s,o,n),o=s}return t}setHidden(e,t,n){t?e.parent&&this.remove(e,n):this.replaceWith(e,[...e.children],n)}applyMutations(e){this._baseDocument.beginUpdate();try{for(const t of e)switch(this._applyingMutation=t,t.type){case"Add":this.insertBefore(t.parent||this.root,t.node,t.nextSibling||null,yo);break;case"Remove":this.remove(t.node,yo);break;case"Set":this.setContent(t.node,t.data,yo);break;case"Hidden":this.setHidden(t.node,t.value,yo);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,yo)}}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function mT(e,t){return e.replace(new RegExp(`<(?=/${t.tagName}${na})`,"gi"),"<")}function Sh(e,t){return xp(e)??mT(e.textContent??"",t)}function Pr(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!kp.has(e.getAttribute("type")??"")}var pT=4,hT=3,gT=80,wh={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},bT={[$.HTML]:"text",[$.ELEMENT]:"element",[$.ROOT]:"root",[$.COMMENT]:"comment",[$.DOCTYPE]:"doctype",[$.ADVANCED]:"advanced"},yT=new Set(["head","body"]);function pu(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function Ch(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,hT);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,gT)}function vT(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return Ch(e.tag,pu(t.id),pu(t.class),pu(t.em))}function Ah(e){return e instanceof Element?Ch(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function hu(e,t,n){const r=[];let o=e;for(;o&&r.length<pT;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function ET(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&yT.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==$.ROOT?"outside":t??"top"}function gu(e,t,n){const r=t(e);return{path:hu(e,o=>o.parent,vT),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:hu(r,o=>o.parentNode,Ah)}:{},inMap:!!r,hasParent:!!e.parent,kind:bT[e.type]??String(e.type),root:ET(e)}}function Th(e,t,n){if(!e)return;const r=i=>gu(i,t,n);if(e.type==="Update")return{type:wh.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:wh[e.type]??e.type,node:r(e.node)};return e.type==="Add"||e.type==="Move"?(e.parent&&(o.parent=r(e.parent)),e.nextSibling&&(o.reference=r(e.nextSibling))):e.node.parent&&(o.parent=r(e.node.parent)),o}function bu(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===$.ROOT}function ST(e,t,n,r){const o=s=>gu(s,a=>r.getByNode(a),bu),i=hu(e,s=>s.parentNode,Ah);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function wT(e,t){const n=r=>gu(r,o=>t.getByNode(o),bu);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function CT(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function _h(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var kh=Object.create(null);function Lh(e,t){const n=kh[e]||(kh[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[CT(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function kn(e){return e.nodeType===Node.ELEMENT_NODE}function Nh(e){return kn(e)?e.tagName==="AMP-IMG"?!0:Lh(e.tagName.toLowerCase(),"src"):!1}function yu(e){return kn(e)&&!e.ownerSVGElement}function AT(e){return e.tagName==="IMG"}function TT(e){return e.tagName==="FORM"}function _T(e){return e.tagName==="SCRIPT"}function kT(e){return e.tagName==="STYLE"}function vu(e){return e.nodeType===Node.DOCUMENT_NODE}function xh(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var _i;(function(e){function t(f){return f.constructor.name==="CSSStyleRule"}e.isStyleRule=t;function n(f){return f.constructor.name==="CSSImportRule"}e.isImportRule=n;function r(f){return f.constructor.name==="CSSMediaRule"}e.isMediaRule=r;function o(f){return f.constructor.name==="CSSFontFaceRule"}e.isFontFaceRule=o;function i(f){return f.constructor.name==="CSSPageRule"}e.isPageRule=i;function s(f){return f.constructor.name==="CSSKeyframesRule"}e.isKeyframesRule=s;function a(f){return f.constructor.name==="CSSKeyframeRule"}e.isKeyframeRuleRule=a;function l(f){return f.constructor.name==="CSSNamespaceRule"}e.isNamespaceRule=l;function c(f){return f.constructor.name==="CSSCounterStyleRule"}e.isCounterStyleRule=c;function u(f){return f.constructor.name==="CSSSupportsRule"}e.isSupportsRule=u;function d(f){return f.constructor.name==="CSSFontFeatureValuesRule"}e.isFontFeatureValuesRuleRule=d})(_i||(_i={}));function wa(e){return e.nodeType===Node.COMMENT_NODE}function ki(e){return e.nodeType===Node.TEXT_NODE}function LT(e){return e.tagName==="TABLE"}async function NT(e,t=5e3){return typeof e.complete<"u"&&!e.complete?new Promise((n,r)=>{setTimeout(n,t),e.onload=()=>n(getComputedStyle(e)),e.onerror=o=>{}}):getComputedStyle(e)}function Xt(e){if(kn(e))return Oh(e);if(vu(e))return[...e.childNodes].map(n=>Xt(n)).join("");if(xh(e))return _h(e);const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function xT(e){const t=e.tagName.toLowerCase();let n="";for(const r of e.attributes){const o=r.name,i=r.value;n+=i===""&&o!=="em"&&!Lh(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function bt(e){let t="";for(const n of e.childNodes)t+=xp(n)??Xt(n);return t}function Oh(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=xT(e);return $c.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:kT(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${bt(e)}</${t}>`}function OT(e){return typeof e=="string"?e:""}function Rh(e,t,n){if(n&&e.type===$.DOCTYPE&&n?.type!==$.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=ia(e,n)?Gc(e.content||""):xr(e,!1,"dormant");t.set(e,r);for(const o of e.children){const i=Rh(o,t,e);r.appendChild(i)}return r}function RT(e,t,n=bu){let r,o;const i=new Map,s=()=>{const l=Th(r,c=>t.getByNode(c)||i.get(c),n);return l&&{...l,stage:"dom",...o?{cause:o}:{}}},a=l=>{o=l;try{it("Element node not in tree")}finally{o=void 0}};return ah(s,()=>MT(e,t,i,l=>r=l,a))}function MT(e,t,n,r,o){const i=[],s=new Map,a=c=>t.getByNode(c)||n.get(c),l=c=>{if(c){const u=c.lastChild;let d=(u?a(u)?.nextSibling:a(c)?.firstChild)||void 0;for(;d&&s.has(d);)d=d.nextSibling||void 0;return d?.parentNode===a(c)?d:void 0}};for(const c of e)switch(r(c),c.type){case"Add":{let{node:u,nextSibling:d}=c;const f=u.parent;if(f){const p=Rh(u,n,f);if(f.type===$.ROOT)i.push(ue.add(null,p,d&&a(d)));else{const m=a(f);if(m){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let w=t.getByNode(d);if(w&&!s.has(w)&&m.contains(w)){for(h=w;w.parentNode!==m&&w.parentNode;)w=w.parentNode,kn(w)&&w.replaceWith(...w.childNodes);break}d=cr(d)||void 0}h||(h=l(f)),i.push(ue.add(m,p,h))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:u,nextSibling:d}=c;const f=u.parent,p=a(u);if(f&&p)if(f.type===$.ROOT)i.push(ue.move(null,p,d&&a(d)));else{const m=a(f);if(m){let h;for(;d;){const y=n.get(d);if(y){h=y;break}let w=t.getByNode(d);if(w&&!s.has(w)&&m.contains(w)){for(;w.parentNode!==m&&w.parentNode;)w=w.parentNode;w||it("error while calculating next sibling"),h=w;break}d=cr(d)||void 0}h||(h=l(f)),i.push(ue.move(m,p,h))}else o("parent-not-mapped")}else o(f?"node-not-mapped":"no-parent");break}case"Remove":{const u=c.node,d=a(u);if(u.type===$.HTML&&!u.content)continue;d?(s.set(d,u),i.push(ue.remove(d))):o("node-not-mapped");break}case"Update":{const u=c.prev,d=a(u);d?n.set(c.next,d):c.soft||o("node-not-mapped");break}case"Attribute":{const u=a(c.node);u?i.push(ue.attribute(u,c.name,c.value)):o("node-not-mapped");break}case"Set":{const u=c.node,d=a(u);d?ki(d)&&u.type===$.HTML||wa(d)&&u.type===$.HTML||xh(d)&&u.type===$.DOCTYPE?i.push(ue.set(d,c.data||"")):e.push(ue.remove(u),ue.add(u.parent||null,u,cr(u)||void 0)):o("node-not-mapped");break}}return{mutations:i,toAdd:n,toRemove:s}}function PT({mutations:e}){return Dp(e.flatMap(t=>t.type==="Add"?[t.node]:[]))}var IT=["src","type"];function DT({mutations:e}){const t=new Set,n=r=>{r instanceof HTMLScriptElement&&r.isConnected&&!aa(r)&&t.add(r)};for(const r of e)r.type==="Add"||r.type==="Move"?(n(r.parent),n(r.node.parentNode)):r.type==="Remove"||r.type==="Set"?n(r.node.parentNode):r.type==="Attribute"&&IT.includes(r.name.toLowerCase())&&n(r.node);return[...t]}function BT(e,t,n){const r=e.data,o=Math.min(r.length,t.length);let i=0;for(;i<o&&r[i]===t[i];)i++;let s=0;for(;s<o-i&&r[r.length-1-s]===t[t.length-1-s];)s++;const a=r.length-i-s,l=t.slice(i,t.length-s),c=e.ownerDocument.getSelection(),u=!!c?.isCollapsed&&c.anchorNode===e&&c.anchorOffset>=i&&c.anchorOffset<=i+a,d=u&&n.get(e)===c.anchorOffset;e.replaceData(i,a,l),l&&c?.anchorNode!==e&&n.set(e,i),u&&c.collapse(e,d?i:i+l.length)}function Mh(e){const t=e.ownerDocument?.getSelection();return t?.anchorNode&&e.contains(t.anchorNode)?t:null}function Ph(e,t){const n=e?.ownerDocument;if(!e||!n)return null;if(e.nodeType===Node.TEXT_NODE)return e;const r=n.createTreeWalker(e,NodeFilter.SHOW_TEXT);let o=null;for(let i=r.nextNode();i&&(o=i,!!t);i=r.nextNode());return o}function HT(e,t,n){const r=Mh(t),{anchorNode:o,anchorOffset:i,focusNode:s,focusOffset:a}=r??{};if(e.insertBefore(t,n),!(!r||!o||!s))try{const l=t.contains(o),c=t.contains(s);r.setBaseAndExtent(l?o:r.anchorNode??o,l?i??0:r.anchorOffset,c?s:r.focusNode??s,c?a??0:r.focusOffset)}catch{}}function FT(e,t){const n=Mh(e),r=n&&Ph(e.previousSibling,!0),o=n&&!r?Ph(e.nextSibling,!1):null;e.parentNode?.removeChild(e);try{if(r){const i=t.get(r)??r.length;t.set(r,i),n.collapse(r,i)}else o&&n.collapse(o,0)}catch{}}function $T({mutations:e,toAdd:t,toRemove:n},r){const o=(s,a,l)=>{if(!s)return it("Element node not in tree");if(!(s instanceof Element))return it("node is not HTMLEement");const c=l===void 0?void 0:Rp(s,a,OT(l));if(!(a.toLowerCase()==="type"&&A0(s,c??null)))try{c!=null?Gn(s,a,c):s.removeAttribute(a)}catch{}},i=new Map;for(const s of e)switch(s.type){case"Add":{const{node:a,nextSibling:l,parent:c}=s;c?.insertBefore(a,l?.parentNode===c&&l||null);break}case"Move":{const{node:a,nextSibling:l,parent:c}=s;c&&HT(c,a,l?.parentNode===c&&l||null);break}case"Remove":{const{node:a}=s;if(a instanceof Document)for(const l of[...a.childNodes])l.parentNode?.removeChild(l);else FT(a,i);break}case"Attribute":o(s.node,s.name,s.value);break;case"Set":{const{node:a,data:l}=s;if(a instanceof Comment)a.data=l;else if(a instanceof Text){const c=String(l??"");Pr(a.parentNode)?f0(a,c):BT(a,oa(c).textContent??"",i)}break}}for(const[s,a]of n)r.remove(a);for(const[s,a]of t){const l=r.getByElement(a);l&&r.remove(l),r.set(s,a)}}var WT=class{constructor(){L(this,"_byKey",new WeakMap),L(this,"_byValue",new WeakMap)}get(e){return this._byKey.get(e)}getByValue(e){return this._byValue.get(e)?.deref()}set(e,t){this._byKey.set(e,t),this._byValue.set(t,new WeakRef(e))}delete(e){const t=this.get(e);t&&(this._byKey.delete(e),this._byValue.delete(t))}deleteByValue(e){const t=this.getByValue(e);t&&(this._byKey.delete(t),this._byValue.delete(e))}},qT=class{constructor(){L(this,"_map",new WT)}getByNode(e){return this._map.getByValue(e)}getByElement(e){return this._map.get(e)}set(e,t){this._map.set(t,e)}remove(e,t=!0){const n=this._map.getByValue(e);if(n&&this._map.delete(n),t){const r=e.children;for(let o=0,i=r.length;o<i;o++)this.remove(r[o])}}};function Ih(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function zT(e){let t;for(let n=e;n;n=n.parent)fu(n)&&(t=n);return t}function UT(e){return e.type==="Update"?e.prev:e.node}function VT(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=zT(o.next);if(!i?.parent||n.has(i))continue;const s=e.find(c=>c.type==="Update"&&c.next===i),a=s?.type==="Update"?t.getByNode(s.prev):void 0;if(s?.type!=="Update"||!a?.isConnected)continue;const l=t.getByNode(o.prev);(!l||!l.isConnected||!a.contains(l))&&n.set(i,s.prev)}if(!n.size)return e;const r=[];for(const o of e){const i=UT(o),s=o.type==="Update"||o.type==="Remove"?t.getByNode(i):void 0;let a=!1;for(const[l,c]of n){const u=t.getByNode(c);if(Ih(i,l)||Ih(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...ue.recreate(c,l.parent,l,cr(l)||void 0));break}}a||r.push(o)}return r}var Eu;(function(e){function t(r,o,i=(s,a)=>s===a){const s=r.length;let a=s===o.length;if(a){for(let l=0;l<s;l++)if(!i(r[l],o[l])){a=!1;break}}return a}e.isEqual=t;function n(r,o,i=(s,a)=>s===a){const s=new Set,a=new Set;for(const l of r)for(const c of o)i(l,c)&&(s.add(l),a.add(c));return{added:o.filter(l=>!a.has(l)),removed:r.filter(l=>!s.has(l))}}e.compare=n})(Eu||(Eu={}));var Ca=new Set;function Ir(e,t){Ca.has(e)||(Ca.size||Promise.resolve().then(()=>Ca.clear()),Ca.add(e),K.send(ke.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var Dh=new WeakMap;function jT(e){const t=[],n=new Set(e);function r(o){if(n.has(o)){const{parentNode:i,nextSibling:s}=o;i&&n.has(i)&&r(i),s&&n.has(s)&&r(s),t.push(o),n.delete(o)}}for(const o of n)r(o);return t}function GT(e,t){let n=Dh.get(e);if(!n){let l=function(c){for(const u of c)o.push(u),t(u)?i.push(u):l(u.childNodes)};var r=l;let{added:o,removed:i,reparented:s=[],reordered:a=[]}=e;o=[...o],i=[...i],s&&l(s),a&&l(a),o=jT(o),n={added:o,removed:i},Dh.set(e,n)}return n}var Bh=Object.getPrototypeOf(customElements),XT=Reflect.get(Bh,"define"),Su=new _e,wu=new _e,YT=Su.event,KT=wu.event,ZT=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function QT(e){Su.fire();try{return e()}finally{wu.fire()}}Bh.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Su.fire();try{super(...i)}finally{wu.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of ZT){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return QT(()=>s.call(this,...a))}})}XT.call(this,e,o,n)};function Hh(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,Hh(s,t,n,i));return i}function Eo(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])Eo(r,t,e)}var Kn="___em-internal";function Cu(e,t=!0,n=!1){let r=e.content;switch(e.type){case $.ROOT:{const o=document.implementation.createHTMLDocument();for(const i of[...o.childNodes])o.removeChild(i);if(t)for(const i of e.children)o.appendChild(Cu(i,t,n));return o}case $.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case $.COMMENT:return document.createComment(r||"");case $.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=Wc(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{Gn(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(ia(i,e)?Gc(i.content||""):Cu(i,t,n));return o}return document.createTextNode("<");case $.HTML:return oa(r||"");default:throw new Error("unsupported node")}}function JT(e){return Tn(e).roots.map(t=>Cu(t,!0,!0))}function Fh(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function e_(e){let t;switch(e){case"tr":t=document.createElement("table");break;case"td":t=document.createElement("tr");break;case"head":case"body":t=document.createElement("html");break;case"DocumentType":case"html":return Fh();default:t=document.createElement("div")}return t}function t_(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function Aa(e){if(e instanceof Element)return Oh(e);if(e instanceof Document)return[...e.childNodes].map(n=>Aa(n)).join("");if(e instanceof DocumentType)return t_(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(n=>Aa(n)).join("");const t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function $h(e,t=e.parentNode){return Pr(t)?Sh(e,t):Aa(e)}function n_(e,t,n){let r=1;const o=new gh,i=new Map,s=new Map,a=new Map;let l=!1;const c=Hh(e,p=>{const m=String(r++);let h;if(Nh(p)||p instanceof Element&&p.hasAttribute("src")){const y=document.createElement(p.tagName);for(const{name:w,value:A}of p.attributes){const k=Mp(p,w,A);k!==null&&Gn(y,w==="src"?"___src":w,k)}h=y}else h=p.cloneNode(),m_(p,h);if(h)h instanceof DocumentType&&(l=!0),a.set(h,m),i.set(p,m);else return document.createDocumentFragment();return h},(p,m)=>p&&m&&p.appendChild(m));let u=l?Fh():document.createDocumentFragment();u.appendChild(c),Eo(u,(p,m)=>{if(m){const h=a.get(p);if(Pr(m))return;if(!h)return it("Error while mapping: not found element");p instanceof Element?p.setAttribute(Kn,h):m.insertBefore(document.createComment(`${Kn}${h}`),p)}});let d=JT(t(u)).filter(p=>!!p),f;if(!d.length)return o;if(u instanceof Document){const p=e_("html");for(const m of d)p.appendChild(m);f=p}else{f=document.createDocumentFragment();for(const p of d)f.appendChild(p)}return Eo(f,(p,m)=>{let h=null;if(p instanceof HTMLHtmlElement)s.set("1",p);else{if(p instanceof Element&&p.hasAttribute(Kn)){h=p.getAttribute(Kn),h&&s.set(h,p);return}const y=p.previousSibling;if(y instanceof Comment&&(!(p instanceof Comment)||p.data.indexOf(Kn)<0)){const w=y.data,A=w.indexOf(Kn);A>=0&&(h=w.substring(A+14),h&&s.set(h,p))}}}),Eo(f,p=>{if(p instanceof Element&&p.hasAttribute(Kn)){p.removeAttribute(Kn);return}p instanceof Comment&&p.data.indexOf(Kn)>=0&&p.remove()}),Eo(e,p=>{const m=i.get(p),h=s.get(m);h&&(o.set(p,h),Pr(p)&&p.firstChild&&h.firstChild&&o.set(p.firstChild,h.firstChild))}),o}function r_(e){const t=Wh(e.cloneNode()),n=Uc(t),r=n.length;return t.startTagEnd=t.startTagEnd===void 0?void 0:n.indexOf(">",Math.max(n.lastIndexOf("'"),n.lastIndexOf('"')))+1,t.endTagStart=t.endTagStart===void 0?void 0:t.endTagStart+(r-t.end),t.end=r,t.type=$.ELEMENT,t}var So;(function(e){e.HiddenResult=(function(t){return t[t.none=0]="none",t[t.node=1]="node",t[t.children=2]="children",t[t.all=3]="all",t})({})})(So||(So={}));function Wh(e){if(ki(e)&&Pr(e.parentNode))return o_(Sh(e,e.parentNode));let t=Tn(Aa(e.cloneNode())).roots[0];return t||(t=new Ct(0,0,[]),t.type=$.HTML,t.content=""),t}function o_(e){const t=new Ct(0,e.length,[]);return t.type=$.HTML,t.content=e,t}function qh(e,t=So.HiddenResult.node){if(t&So.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&So.HiddenResult.children)for(const n of e.children)qh(n,So.HiddenResult.all)}function i_(e,t=[],n){let r;return e instanceof Element?r=r_(e):r=Wh(e),r.children=t,r.parent=void 0,n&&qh(r,n(r)),r}function Au(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=Au(o,t,n),r)return r}function zh(e,t,n,r){Ir("tree-node-out-of-place",()=>({mutation:n()}))}function s_(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(zh("insertBefore",c,()=>ST(e,u,c,t),u),!1);for(;i;){const c=t.getByElement(i)??(n&&i===n.node?n.treeNode:void 0);if(c){if(a){let u=t.getByNode(a);if(u&&i.contains(u)&&l(a,c))return{parentTreeNode:c,nextSiblingTreeNode:a};a=void 0}for(;s;){const u=Au(s,t,r);if(u&&l(u,c))return{parentTreeNode:c,nextSiblingTreeNode:u};s=s.nextSibling}return{parentTreeNode:c}}if(!a)for(;s;){const u=Au(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function a_(e,t){const n=[],r=e.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i){const a=t.getByElement(s);if(a){const l=s.getAttribute(o);n.push(ue.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function l_(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(ue.set(i,wa(o)?o.data:$h(o)))}return n}function c_(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function u_(e){if(e.nodeType!==Node.TEXT_NODE)return!1;const t=e.parentElement;if(!t||t.closest(".em-element-list-ul, .em-element-list-ol")&&t.closest(".em-element-list-bullet"))return!1;const n=t.closest('[class*="em-element-"]:not(.em-element-resize-img-container)');return!(!n||[".em-element-list-ul",".em-element-list-ol",".em-element-custom-table"].some(r=>n.matches(r)))}function d_(e,t,n){const r=[],o=new Set,i=new Map,s=(a,l)=>{const c=i.get(a);return c?c===l:a.parent===l&&l.children.includes(a)};for(const a of e){const{added:l,removed:c}=GT(a,u=>!!t.getByElement(u));for(const u of c)if(!o.has(u)){const d=t.getByElement(u);if(d){const f=i.get(d)??d.parent;!f||!s(d,f)?zh("remove",d,()=>wT(d,t)):r.push(ue.remove(d)),i.delete(d),o.add(u)}}for(const u of l){if(u_(u))continue;const d=c_(u);if(d&&!t.getByElement(d))continue;const{parentTreeNode:f,nextSiblingTreeNode:p}=s_(u,t,n,m=>o.has(m),s)||{};if(f){let m=t.getByElement(u);m||(m=i_(u),t.set(m,u)),r.push(ue.add(f,m,p)),i.set(m,f),o.delete(u)}}r.push(...a_(a,t)),r.push(...l_(a,t))}return r}function f_(e,t,n){const r=[],o=t.attributes,i=n.attributes;for(const s of o){const a=s.name,l=i.getNamedItem(a==="src"?"___src":a);if(l){const c=l.value;c!==s.value&&r.push(ue.attribute(e,a,c))}else r.push(ue.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(ue.attribute(e,a,s.value))}return r}function m_(e,t){if(!(!p0()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=Mp(e,n,r);o===null?t.removeAttribute(n):o!==r&&Gn(t,n,o)}}function p_(e,t,n,r=()=>!1){const o=[],i=n_(e,n,t);return Eo(e,s=>{const a=t.getByElement(s);if(!a)return;const l=i.getByKey(s);if(l){if(l instanceof Element){if(!(s instanceof Element))return it("CharacterData mapped to Element");o.push(...f_(a,s,l))}else if(l instanceof CharacterData){if(!(s instanceof CharacterData))return it("Element mapped to CharacterData");const c=Pr(s.parentNode)&&(s.parentNode?.nodeName==="SCRIPT"||!r(s));l.data!==s.data&&!c&&o.push(ue.set(a,wa(l)?l.data:$h(l,s.parentNode)))}else if(l instanceof Document&&!(s instanceof Document))return it("Node mapped to Document")}else{const c=d=>{for(const f of d.childNodes)if(i.getByKey(f)||!c(f))return!1;return!0};let u;return c(s)?(o.push(ue.hidden(a,!0)),u=!1):o.push(ue.hidden(a,!1)),u}}),o}function h_(e,t){let n,r=e;do{if(t.getByElement(r))return n;n=r}while(r=r.parentNode);for(;e.parentNode;)e=e.parentNode}function g_(e){return[...new Set(e)]}function b_(e,t){return g_([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>h_(n,t)||n))}function y_(e,t){let n=[];for(const r of e){const o=b_(r,t),i=s=>{for(let a=0;a<n.length;a++){const l=n[a];if(l.contains(s)||l===s)return;if(s.contains(l)){n.splice(a,1,s);return}}n.push(s)};for(const s of o)i(s)}return n}function v_(e,t,n){const r=y_(e,t),o=E_(e);return r.flatMap(i=>p_(i,t,n,o))}function E_(e){const t=new Set(e.flatMap(n=>[...n.added,...Object.values(n.characterDataChanged||{}).flat()]));return n=>{for(let r=n;r;r=r.parentNode)if(t.has(r))return!0;return!1}}function S_(e,t,n,r){return[...d_(e,t,r),...v_(e,t,n)]}function w_(e){const t=[],n=new Map;for(let r=e.length-1;r>=0;r--){const o=e[r];if(o.type==="Attribute"){const{node:i,name:s,value:a}=o;let l=n.get(i);l||n.set(i,l={}),l.hasOwnProperty(s)||(l[s]=a,i.attributes?.[s]!==a&&t.unshift(o))}else t.unshift(o)}return t}var C_=class{constructor(){L(this,"_map",new WeakMap)}getAttribute(e,t){return this._map.get(e)?.[t]}setAttribute(e,t,n){let r=this._map.get(e);r||this._map.set(e,r=Object.create(null)),r[t]=n}removeAttribute(e,t){let n=this._map.get(e);n&&delete n[t]}hasAttribute(e,t){return this._map.has(e)?.hasOwnProperty(t)}getAttributes(e){return this._map.get(e)}has(e){return this._map.has(e)}replaceNode(e,t){const n=this._map.get(e);n&&(this._map.delete(e),this._map.set(t,n))}},Uh=class{constructor(e=10){L(this,"_max",void 0),L(this,"_cache",new Map),this._max=e}get(e){let t=this._cache.get(e);return t!==void 0&&(this._cache.delete(e),this._cache.set(e,t)),t}put(e,t){this._cache.has(e)?this._cache.delete(e):this._cache.size==this._max&&this._cache.delete(this.first()),this._cache.set(e,t)}first(){return this._cache.keys().next().value}},Vh=new Uh(1e3);function wo(e){if(e=e?.trim(),e){let t=Vh.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),Vh.put(e,t)),t}else return new Set}function Ta(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var jh=new Uh(1e3);function Li(e){e||(e="");let t=jh.get(e);return t||(t=Ta(e),jh.put(e,t)),t}function A_(e,t,n){const r=e?e.split(" "):[],o=wo(n),i=wo(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function T_(e,t,n){const r=Ta(e),o=Li(n),i=Li(t);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,r.removeProperty(a))}return s?r.cssText:e}function Gh(e,t,n,r){return typeof r!="string"?t:e==="class"?A_(t,n,r)||null:e==="style"?T_(t,n,r)||null:n!==t&&t===r?null:t}function __(e,t){const n=wo(e),r=wo(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function k_(e,t){const n=Ta(e),r=Li(t);let o=!1;for(const i of r){const s=r.getPropertyValue(i);n.getPropertyValue(i)!==s&&(o=!0,n.setProperty(i,s))}return o?n.cssText:e}function L_(e,t,n){return typeof n!="string"?t:e==="class"?__(t,n)||null:e==="style"?k_(t,n)||null:t}function N_(e,t,n){if(!t)return t;const r=wo(e),o=wo(n),i=t.split(" "),s=i.filter(a=>(a=a.trim(),!r.has(a)||o.has(a)));return s.length!==i.length?s.join(" "):t}function x_(e,t,n){if(!t)return t;const r=Li(e),o=Ta(t),i=Li(n);let s=!1;for(const a of o){const l=o.getPropertyValue(a);r.getPropertyValue(a)===l&&i.getPropertyValue(a)!==l&&(s=!0,o.removeProperty(a))}return s?o.cssText:t}function Xh(e){return e.type===$.ELEMENT&&e.start!==e.end}function Yh(e){return e.filter(t=>t.type===$.ELEMENT)}function O_(e,t,n){const r=Yh(e),o=Yh(t),i=[],s=new Set,a=new Set,l=u=>{const d=(p,m)=>{const h=new Map;for(const y of p){const w=m.has(y)?void 0:u(y);w!==void 0&&h.set(w,h.has(w)?null:y)}return h},f=d(r,s);for(const[p,m]of d(o,a)){const h=f.get(p);m&&h&&(i.push([h,m,!0]),s.add(h),a.add(m))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>Lr(u,!1,n)),l(u=>Lr(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=m=>m.filter(h=>h.tag===u),f=d(r).filter(m=>!s.has(m)),p=d(o).filter(m=>!a.has(m));if(f.length===p.length&&d(r).length===d(o).length){const m=f.length===1&&!f[0].attributes?.id&&!p[0].attributes?.id;p.forEach((h,y)=>i.push([f[y],h,m]))}}return i}var R_=class{constructor(e,t,n,r){L(this,"element",void 0),L(this,"name",void 0),L(this,"nextValue",void 0),L(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},M_=class{constructor(e){L(this,"_nodeMap",void 0),L(this,"_map",new C_),L(this,"_hiddenMutations",[]),L(this,"_restore",[]),this._nodeMap=e}_onHiddenMutate(){try{for(const{name:e,element:t,prevValue:n,nextValue:r}of this._hiddenMutations){const o=this._nodeMap.getByElement(t);if(o)if(e==="class"){const i=N_(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i)}else if(e==="style"){const i=x_(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i)}else r===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,r)}}finally{this._hiddenMutations=[]}}onHiddenMutate(e){const t=this._hiddenMutations;for(const n of e){const r=n.attributeChanged;if(r)for(const o of Object.keys(r)){const i=r[o];for(const s of i)t.push(new R_(s,o,s.getAttribute(o),n.getOldAttribute(s,o)))}}}beforeCommit(e){this._onHiddenMutate();const t=[];for(const n of e){if(n.type==="Attribute"){const{name:r,node:o,value:i}=n,s=Gh(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(ue.attribute(o,r,s));continue}}if(t.push(n),n.type==="Add"){const{node:r}=n,o=r.attributes;if(o)for(const i of Object.keys(o)){const s=o[i],a=this._map.getAttribute(r,i);if(a){const l=Gh(i,s,null,a);l!==s&&t.push(ue.attribute(r,i,l))}}}}return t}onRemoteMutate(e){this._onHiddenMutate(),this._restore=[];const t=[];for(const n of e){if(n.type==="Attribute"){const{name:r,node:o,value:i}=n,s=L_(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(ue.attribute(o,r,s));continue}}else n.type==="Update"?this._map.replaceNode(n.prev,n.next):n.type==="Add"&&n.replaces&&this._carryHidden(n.replaces,n.node,!0,qc());t.push(n)}return t}_carryHidden(e,t,n,r){if(e.type!==t.type||e.tag!==t.tag)return;const o=this._map.getAttributes(e);if(n&&!uu(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))iT(s)||(this._map.setAttribute(t,s,a),i.push([s,e.attributes?.[s]??null]));i.length&&this._restore.push({node:t,carried:i})}if(n&&Lr(e,!1,r)===Lr(t,!1,r)){const i=t.children.filter(Xh);e.children.filter(Xh).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of O_(e.children,t.children,r))this._carryHidden(i,s,a,r)}restoreHidden(){const e=this._restore;this._restore=[];for(const{node:t,carried:n}of e){const r=this._nodeMap.getByNode(t);if(r instanceof Element)for(const[o,i]of n){if((t.attributes?.[o]??null)!==i){this._map.removeAttribute(t,o);continue}const s=this._map.getAttribute(t,o);typeof s=="string"&&r.setAttribute(o,s)}}}},P_=class{constructor(e){L(this,"_isMapped",void 0),L(this,"_foreign",new WeakSet),L(this,"_movedTo",new WeakMap),L(this,"_output",new WeakSet),L(this,"_service",new WeakSet),L(this,"_hasForeign",!1),L(this,"_hasOutput",!1),this._isMapped=e}observeLost(e){for(const t of e){for(const n of t.added)this.markForeign(n);for(const n of[...t.reparented??[],...t.reordered??[]])!this._foreign.has(n)&&n.parentNode&&this._movedTo.set(n,n.parentNode)}}markForeign(e){this._hasForeign=!0,this._foreign.add(e)}markOutput(e){this.markForeign(e),this._hasOutput=!0,this._output.add(e)}isOutput(e){return this._hasOutput&&this._isInside(e,this._output)}get hasOutput(){return this._hasOutput}isMarked(e){return this._foreign.has(e)}isOffModel(e){return this._hasForeign&&this._isInside(e,this._foreign)}isForeign(e){return this._hasForeign&&this._nearestMark(e)==="foreign"}markService(e){this._service.add(e)}isService(e){return this._isInside(e,this._service)}markOf(e){return this._service.has(e)?"service":this._foreign.has(e)?"foreign":void 0}_nearestMark(e){for(let t=e;t&&!this._isMapped(t);t=t.parentNode){const n=this.markOf(t);if(n)return n}}_isInside(e,t){for(let n=e;n;n=n.parentNode){if(this._isMapped(n))return!1;if(t.has(n))return!0}return!1}isPlacedInForeign(e){return this._hasForeign&&this.isForeign(this._isMapped(e)?e.parentNode:e)}movedTo(e){return this._movedTo.get(e)}forget(e){this._movedTo.delete(e)}},Kh="foreign-structure-in-commit";function I_(e,t,n){const r=[],o=(s,a)=>{t.isPlacedInForeign(s)&&r.push({kind:t.movedTo(s)?"moved-own-node":a,node:s})},i=s=>{o(s,"moved"),n(s)||s.childNodes.forEach(i)};for(const s of e)s.added.forEach(a=>o(a,"inserted")),[...s.reparented??[],...s.reordered??[]].forEach(i),new Set(Object.values(s.attributeChanged??{}).flat()).forEach(a=>t.isForeign(a)&&r.push({kind:"attribute",node:a})),(s.characterDataChanged??[]).forEach(a=>t.isForeign(a)&&r.push({kind:"text",node:a}));for(const s of e)[...s.added,...s.reparented??[],...s.reordered??[]].forEach(a=>t.forget(a));return r}function _a(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var Zh="implicit-tbody-in-canvas";function D_(e,t){const n=new Set;for(const r of e)for(const o of r.added)o instanceof Element&&(o.tagName==="TBODY"?[o]:Array.from(o.querySelectorAll("tbody"))).filter(i=>!t(i)).forEach(i=>n.add(i));return[...n]}function B_(e,t){if(!e.length||t.has("implicit-tbody-in-canvas"))return;const[n]=e,r={kind:"implicit-tbody",kinds:["implicit-tbody"],count:e.length,node:_a(n),parent:n.parentNode?_a(n.parentNode):void 0};t.add(Zh),Ir(Zh,()=>({foreign:r}))}function H_(e,t){if(!e.length)return;const[n]=e,r=[...new Set(e.map(({kind:i})=>i))],o={kind:n.kind,kinds:r,count:e.length,node:_a(n.node),parent:n.node.parentNode?_a(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(Kh),Ir(Kh,()=>({foreign:o})))}var Tu="unaccounted-node";function Qh(e,t,n,r){if(t.isMapped(e))return"own";const o=t.markOf(e)??n;return o==="foreign"||o==="service"?o:!r||t.isCanvasNode(e)?"interface":"unaccounted"}function Jh(e,t){let n,r=!1,o=t.isMapped(e);for(let i=e.parentNode;i;i=i.parentNode)r||(r=t.roots.has(i)),!o&&!n&&(o=t.isMapped(i),n=o?void 0:t.markOf(i));return Qh(e,t,n,r||t.roots.has(e))}function eg(e,t){const n=[],r=[];for(let o=e.lastChild;o;o=o.previousSibling)r.push([o,void 0,!1]);for(let o=r.pop();o;o=r.pop()){const[i,s,a]=o,l=a||t.roots.has(i),c=Qh(i,t,s,l);c==="unaccounted"&&s!=="unaccounted"&&n.push(i);const u=c==="own"||c==="interface"?void 0:c;for(let d=i.lastChild;d;d=d.previousSibling)r.push([d,u,l])}return n}function F_(e){const t=new WeakSet,n=(e.ownerDocument??e).createTreeWalker(e,NodeFilter.SHOW_ALL);for(let r=n.nextNode();r;r=n.nextNode())t.add(r);return t}function $_(e,t){const n=new Set;for(const r of e)r.isConnected&&Jh(r,t)==="unaccounted"&&n.add(r);return[...n].filter(r=>!r.parentNode||!n.has(r.parentNode))}function W_(e){const t=e.nodeType===Node.ELEMENT_NODE?e.tagName.toLowerCase():e.nodeName,n=e.parentNode;return n?`${t}:${Array.prototype.indexOf.call(n.childNodes,e)+1}`:t}function tg(e){const t=[];for(let o=e;o&&o.nodeType!==Node.DOCUMENT_NODE;o=o.parentNode)t.unshift(W_(o));const n=e instanceof Element?e.getAttribute("class"):null,r=e instanceof Element?e.tagName.toLowerCase():e.nodeName;return{path:t.join(" > "),tag:r,...n?{class:n}:{}}}function ng(e,t){if(!e.length)return;const n={count:e.length,node:tg(e[0])};t.has(Tu)||(t.add(Tu),Ir(Tu,()=>({unaccounted:n})))}var q_=ar(((e,t)=>{(function(n,r){typeof e=="object"&&typeof t<"u"?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.MutationSummary={}))})(e,(function(n){"use strict";var r=(function(){function b(){this._nodes=[],this._values=[]}return b._isIndex=function(v){return+v===v>>>0},b._nodeId=function(v){var S=v[b._ID_PROP];return S||(S=v[b._ID_PROP]=b._NEXT_ID++),S},b.prototype.set=function(v,S){var T=b._nodeId(v);this._nodes[T]=v,this._values[T]=S},b.prototype.get=function(v){var S=b._nodeId(v);return S!==void 0?this._values[S]:void 0},b.prototype.has=function(v){return b._nodeId(v)in this._nodes},b.prototype.delete=function(v){var S=b._nodeId(v);delete this._nodes[S],this._values[S]=void 0},b.prototype.keys=function(){var v=[];for(var S in this._nodes)b._isIndex(S)&&v.push(this._nodes[S]);return v},b._ID_PROP="__mutation_summary_node_map_id__",b._NEXT_ID=1,b})(),o=(function(){function b(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return b})();n.Movement=void 0,(function(b){b[b.STAYED_OUT=0]="STAYED_OUT",b[b.ENTERED=1]="ENTERED",b[b.STAYED_IN=2]="STAYED_IN",b[b.REPARENTED=3]="REPARENTED",b[b.REORDERED=4]="REORDERED",b[b.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(b,v){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,T){S.__proto__=T}||function(S,T){for(var g in T)Object.prototype.hasOwnProperty.call(T,g)&&(S[g]=T[g])},i(b,v)};function s(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");i(b,v);function S(){this.constructor=b}b.prototype=v===null?Object.create(v):(S.prototype=v.prototype,new S)}var a=(function(){function b(v,S,T,g,E,C,_,x){S===void 0&&(S=!1),T===void 0&&(T=!1),g===void 0&&(g=!1),E===void 0&&(E=null),C===void 0&&(C=!1),_===void 0&&(_=null),x===void 0&&(x=null),this.node=v,this.childList=S,this.attributes=T,this.characterData=g,this.oldParentNode=E,this.added=C,this.attributeOldValues=_,this.characterDataOldValue=x,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return b.prototype.getAttributeOldValue=function(v){if(this.attributeOldValues)return this.isCaseInsensitive&&(v=v.toLowerCase()),this.attributeOldValues[v]},b.prototype.getAttributeNamesMutated=function(){var v=[];if(!this.attributeOldValues)return v;for(var S in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(S)&&v.push(S);return v},b.prototype.attributeMutated=function(v,S){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(v in this.attributeOldValues)&&(this.attributeOldValues[v]=S)},b.prototype.characterDataMutated=function(v){this.characterData||(this.characterData=!0,this.characterDataOldValue=v)},b.prototype.removedFromParent=function(v){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=v},b.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},b.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},b})(),l=(function(b){s(v,b);function v(S,T){var g=b.call(this)||this;g.rootNode=S,g.reachableCache=void 0,g.wasReachableCache=void 0,g.anyParentsChanged=!1,g.anyAttributesChanged=!1,g.anyCharacterDataChanged=!1;for(var E=0;E<T.length;E++){var C=T[E];switch(C.type){case"childList":g.anyParentsChanged=!0;for(var _=0;_<C.removedNodes.length;_++){var x=C.removedNodes[_];g.getChange(x).removedFromParent(C.target)}for(var _=0;_<C.addedNodes.length;_++){var x=C.addedNodes[_];g.getChange(x).insertedIntoParent()}break;case"attributes":g.anyAttributesChanged=!0;var N=g.getChange(C.target);N.attributeMutated(C.attributeName,C.oldValue);break;case"characterData":g.anyCharacterDataChanged=!0;var N=g.getChange(C.target);N.characterDataMutated(C.oldValue)}}return g}return v.prototype.getChange=function(S){var T=this.get(S);return T||(T=new a(S),this.set(S,T)),T},v.prototype.getOldParent=function(S){var T=this.get(S);return T?T.getOldParent():S.parentNode},v.prototype.getIsReachable=function(S){if(S===this.rootNode)return!0;if(!S)return!1;this.reachableCache=this.reachableCache||new r;var T=this.reachableCache.get(S);return T===void 0&&(T=this.getIsReachable(S.parentNode),this.reachableCache.set(S,T)),T},v.prototype.getWasReachable=function(S){if(S===this.rootNode)return!0;if(!S)return!1;this.wasReachableCache=this.wasReachableCache||new r;var T=this.wasReachableCache.get(S);return T===void 0&&(T=this.getWasReachable(this.getOldParent(S)),this.wasReachableCache.set(S,T)),T},v.prototype.reachabilityChange=function(S){return this.getIsReachable(S)?this.getWasReachable(S)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.getWasReachable(S)?n.Movement.EXITED:n.Movement.STAYED_OUT},v})(r),c=(function(){function b(v,S,T,g,E){this.rootNode=v,this.mutations=S,this.selectors=T,this.calcReordered=g,this.calcOldPreviousSibling=E,this.treeChanges=new l(v,S),this.entered=[],this.exited=[],this.stayedIn=new r,this.visited=new r,this.childListChangeMap=void 0,this.characterDataOnly=void 0,this.matchCache=void 0,this.processMutations()}return b.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var v=this.treeChanges.keys(),S=0;S<v.length;S++)this.visitNode(v[S],void 0)},b.prototype.visitNode=function(v,S){if(!this.visited.has(v)){this.visited.set(v,!0);var T=this.treeChanges.get(v),g=S;if((T&&T.childList||g==null)&&(g=this.treeChanges.reachabilityChange(v)),g!==n.Movement.STAYED_OUT){if(this.matchabilityChange(v),g===n.Movement.ENTERED)this.entered.push(v);else if(g===n.Movement.EXITED)this.exited.push(v),this.ensureHasOldPreviousSiblingIfNeeded(v);else if(g===n.Movement.STAYED_IN){var E=n.Movement.STAYED_IN;T&&T.childList&&(T.oldParentNode!==v.parentNode?(E=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(v)):this.calcReordered&&this.wasReordered(v)&&(E=n.Movement.REORDERED)),this.stayedIn.set(v,E)}if(g!==n.Movement.STAYED_IN)for(var C=v.firstChild;C;C=C.nextSibling)this.visitNode(C,g)}}},b.prototype.ensureHasOldPreviousSiblingIfNeeded=function(v){if(this.calcOldPreviousSibling){this.processChildlistChanges();var S=v.parentNode,T=this.treeChanges.get(v);T&&T.oldParentNode&&(S=T.oldParentNode);var g=this.childListChangeMap.get(S);g||(g=new o,this.childListChangeMap.set(S,g)),g.oldPrevious.has(v)||g.oldPrevious.set(v,v.previousSibling)}},b.prototype.getChanged=function(v,S,T){this.selectors=S,this.characterDataOnly=T;for(var g=0;g<this.entered.length;g++){var E=this.entered[g],C=this.matchabilityChange(E);(C===n.Movement.ENTERED||C===n.Movement.STAYED_IN)&&v.added.push(E)}for(var _=this.stayedIn.keys(),g=0;g<_.length;g++){var E=_[g],C=this.matchabilityChange(E);if(C===n.Movement.ENTERED)v.added.push(E);else if(C===n.Movement.EXITED)v.removed.push(E);else if(C===n.Movement.STAYED_IN&&(v.reparented||v.reordered)){var x=this.stayedIn.get(E);v.reparented&&x===n.Movement.REPARENTED?v.reparented.push(E):v.reordered&&x===n.Movement.REORDERED&&v.reordered.push(E)}}for(var g=0;g<this.exited.length;g++){var E=this.exited[g],C=this.matchabilityChange(E);(C===n.Movement.EXITED||C===n.Movement.STAYED_IN)&&v.removed.push(E)}},b.prototype.getOldParentNode=function(v){var S=this.treeChanges.get(v);if(S&&S.childList)return S.oldParentNode?S.oldParentNode:null;var T=this.treeChanges.reachabilityChange(v);if(T===n.Movement.STAYED_OUT||T===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return v.parentNode},b.prototype.getOldPreviousSibling=function(v){var S=v.parentNode,T=this.treeChanges.get(v);T&&T.oldParentNode&&(S=T.oldParentNode);var g=this.childListChangeMap.get(S);if(!g)throw Error("getOldPreviousSibling requested on invalid node.");return g.oldPrevious.get(v)},b.prototype.getOldAttribute=function(v,S){var T=this.treeChanges.get(v);if(!T||!T.attributes)throw Error("getOldAttribute requested on invalid node.");var g=T.getAttributeOldValue(S);if(g===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return g},b.prototype.attributeChangedNodes=function(v){if(!this.treeChanges.anyAttributesChanged)return{};var S,T;if(v){S={},T={};for(var g=0;g<v.length;g++){var E=v[g];S[E]=!0,T[E.toLowerCase()]=E}}for(var C={},_=this.treeChanges.keys(),g=0;g<_.length;g++){var x=_[g],N=this.treeChanges.get(x);if(N.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(x)||n.Movement.STAYED_IN!==this.matchabilityChange(x)))for(var W=x,R=N.getAttributeNamesMutated(),M=0;M<R.length;M++){var E=R[M];S&&!S[E]&&!(N.isCaseInsensitive&&T[E])||N.getAttributeOldValue(E)!==W.getAttribute(E)&&(T&&N.isCaseInsensitive&&(E=T[E]),C[E]=C[E]||[],C[E].push(W))}}return C},b.prototype.getOldCharacterData=function(v){var S=this.treeChanges.get(v);if(!S||!S.characterData)throw Error("getOldCharacterData requested on invalid node.");return S.characterDataOldValue},b.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var v=this.treeChanges.keys(),S=[],T=0;T<v.length;T++){var g=v[T];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(g)){var E=this.treeChanges.get(g);!E.characterData||g.textContent==E.characterDataOldValue||S.push(g)}}return S},b.prototype.computeMatchabilityChange=function(v,S){this.matchCache||(this.matchCache=[]),this.matchCache[v.uid]||(this.matchCache[v.uid]=new r);var T=this.matchCache[v.uid],g=T.get(S);return g===void 0&&(g=v.matchabilityChange(S,this.treeChanges.get(S)),T.set(S,g)),g},b.prototype.matchabilityChange=function(v){var S=this;if(this.characterDataOnly)switch(v.nodeType){case Node.COMMENT_NODE:case Node.TEXT_NODE:return n.Movement.STAYED_IN;default:return n.Movement.STAYED_OUT}if(!this.selectors)return n.Movement.STAYED_IN;if(v.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var T=v,g=this.selectors.map(function(_){return S.computeMatchabilityChange(_,T)}),E=n.Movement.STAYED_OUT,C=0;E!==n.Movement.STAYED_IN&&C<g.length;){switch(g[C]){case n.Movement.STAYED_IN:E=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:E===n.Movement.EXITED?E=n.Movement.STAYED_IN:E=n.Movement.ENTERED;break;case n.Movement.EXITED:E===n.Movement.ENTERED?E=n.Movement.STAYED_IN:E=n.Movement.EXITED}C++}return E},b.prototype.getChildlistChange=function(v){var S=this.childListChangeMap.get(v);return S||(S=new o,this.childListChangeMap.set(v,S)),S},b.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var v=function(g){var E=S.mutations[g];if(E.type!="childList"||S.treeChanges.reachabilityChange(E.target)!==n.Movement.STAYED_IN&&!S.calcOldPreviousSibling)return"continue";for(var C=S.getChildlistChange(E.target),_=E.previousSibling,x=function(R,M){!R||C.oldPrevious.has(R)||C.added.has(R)||C.maybeMoved.has(R)||M&&(C.added.has(M)||C.maybeMoved.has(M))||C.oldPrevious.set(R,M)},N=0;N<E.removedNodes.length;N++){var W=E.removedNodes[N];x(W,_),C.added.has(W)?C.added.delete(W):(C.removed.set(W,!0),C.maybeMoved.delete(W)),_=W}x(E.nextSibling,_);for(var N=0;N<E.addedNodes.length;N++){var W=E.addedNodes[N];C.removed.has(W)?(C.removed.delete(W),C.maybeMoved.set(W,!0)):C.added.set(W,!0)}},S=this,T=0;T<this.mutations.length;T++)v(T)}},b.prototype.wasReordered=function(v){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var S=v.parentNode,T=this.treeChanges.get(v);T&&T.oldParentNode&&(S=T.oldParentNode);var g=this.childListChangeMap.get(S);if(!g)return!1;if(g.moved)return g.moved.get(v);g.moved=new r;var E=new r;function C(R){if(!R||!g.maybeMoved.has(R))return!1;var M=g.moved.get(R);return M!==void 0||(E.has(R)?M=!0:(E.set(R,!0),M=W(R)!==x(R)),E.has(R)?(E.delete(R),g.moved.set(R,M)):M=g.moved.get(R)),M}var _=new r;function x(R){var M=_.get(R);if(M!==void 0)return M;for(M=g.oldPrevious.get(R);M&&(g.removed.has(M)||C(M));)M=x(M);return M===void 0&&(M=R.previousSibling),_.set(R,M),M}var N=new r;function W(R){if(N.has(R))return N.get(R);for(var M=R.previousSibling;M&&(g.added.has(M)||C(M));)M=M.previousSibling;return N.set(R,M),M}return g.maybeMoved.keys().forEach(C),g.moved.get(v)},b})(),u=(function(){function b(v,S){var T=this;if(this.projection=v,this.added=[],this.removed=[],this.reparented=S.all||S.element||S.characterData?[]:void 0,this.reordered=S.all?[]:void 0,v.getChanged(this,S.elementFilter,S.characterData),S.all||S.attribute||S.attributeList){var g=S.attribute?[S.attribute]:S.attributeList,E=v.attributeChangedNodes(g);S.attribute?this.valueChanged=E[S.attribute]||[]:(this.attributeChanged=E,S.attributeList&&S.attributeList.forEach(function(_){T.attributeChanged.hasOwnProperty(_)||(T.attributeChanged[_]=[])}))}if(S.all||S.characterData){var C=v.getCharacterDataChanged();S.characterData?this.valueChanged=C:this.characterDataChanged=C}this.reordered&&(this.getOldPreviousSibling=v.getOldPreviousSibling.bind(v))}return b.prototype.getOldParentNode=function(v){return this.projection.getOldParentNode(v)},b.prototype.getOldAttribute=function(v,S){return this.projection.getOldAttribute(v,S)},b.prototype.getOldCharacterData=function(v){return this.projection.getOldCharacterData(v)},b.prototype.getOldPreviousSibling=function(v){return this.projection.getOldPreviousSibling(v)},b})(),d=(function(){function b(){}return b.prototype.matches=function(v){if(v===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==v;for(var S=v.split(" "),T=0;T<S.length;T++)if(this.attrValue===S[T])return!0;return!1},b.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+f(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+f(this.attrValue)+"]":"["+this.attrName+"]"},b})();function f(b){return'"'+b.replace(/"/,'\\"')+'"'}var p=/[a-zA-Z_]+/,m=/[a-zA-Z0-9_\-]+/,h=(function(){function b(){this.uid=b.nextUid++,this.qualifiers=[]}return Object.defineProperty(b.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),b.prototype.isMatching=function(v){return v[b.matchesSelector](this.selectorString)},b.prototype.wasMatching=function(v,S,T){if(!S||!S.attributes)return T;var g=S.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(g!=="*"&&g!==v.tagName)return!1;for(var E=[],C=!1,_=0;_<this.qualifiers.length;_++){var x=this.qualifiers[_],N=S.getAttributeOldValue(x.attrName);E.push(N),C=C||N!==void 0}if(!C)return T;for(var _=0;_<this.qualifiers.length;_++){var x=this.qualifiers[_],N=E[_];if(N===void 0&&(N=v.getAttribute(x.attrName)),!x.matches(N))return!1}return!0},b.prototype.matchabilityChange=function(v,S){var T=this.isMatching(v);return T?this.wasMatching(v,S,T)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(v,S,T)?n.Movement.EXITED:n.Movement.STAYED_OUT},b.parseSelectors=function(v){var S=[],T,g;function E(){T&&(g&&(T.qualifiers.push(g),g=void 0),S.push(T)),T=new b}function C(){g&&T.qualifiers.push(g),g=new d}for(var _=/\s/,x=void 0,N="Invalid or unsupported selector syntax.",W=1,R=2,M=3,te=4,j=5,ne=6,re=7,Q=8,be=9,de=10,Ee=11,me=12,X=13,B=14,Y=W,Ot=0;Ot<v.length;){var U=v[Ot++];switch(Y){case W:if(U.match(p)){E(),T.tagName=U,Y=R;break}if(U=="*"){E(),T.tagName="*",Y=M;break}if(U=="."){E(),C(),T.tagName="*",g.attrName="class",g.contains=!0,Y=te;break}if(U=="#"){E(),C(),T.tagName="*",g.attrName="id",Y=te;break}if(U=="["){E(),C(),T.tagName="*",g.attrName="",Y=ne;break}if(U.match(_))break;throw Error(N);case R:if(U.match(m)){T.tagName+=U;break}if(U=="."){C(),g.attrName="class",g.contains=!0,Y=te;break}if(U=="#"){C(),g.attrName="id",Y=te;break}if(U=="["){C(),g.attrName="",Y=ne;break}if(U.match(_)){Y=B;break}if(U==","){Y=W;break}throw Error(N);case M:if(U=="."){C(),g.attrName="class",g.contains=!0,Y=te;break}if(U=="#"){C(),g.attrName="id",Y=te;break}if(U=="["){C(),g.attrName="",Y=ne;break}if(U.match(_)){Y=B;break}if(U==","){Y=W;break}throw Error(N);case te:if(U.match(p)){g.attrValue=U,Y=j;break}throw Error(N);case j:if(U.match(m)){g.attrValue+=U;break}if(U=="."){C(),g.attrName="class",g.contains=!0,Y=te;break}if(U=="#"){C(),g.attrName="id",Y=te;break}if(U=="["){C(),Y=ne;break}if(U.match(_)){Y=B;break}if(U==","){Y=W;break}throw Error(N);case ne:if(U.match(p)){g.attrName=U,Y=re;break}if(U.match(_))break;throw Error(N);case re:if(U.match(m)){g.attrName+=U;break}if(U.match(_)){Y=Q;break}if(U=="~"){g.contains=!0,Y=be;break}if(U=="="){g.attrValue="",Y=Ee;break}if(U=="]"){Y=M;break}throw Error(N);case Q:if(U=="~"){g.contains=!0,Y=be;break}if(U=="="){g.attrValue="",Y=Ee;break}if(U=="]"){Y=M;break}if(U.match(_))break;throw Error(N);case be:if(U=="="){g.attrValue="",Y=Ee;break}throw Error(N);case de:if(U=="]"){Y=M;break}if(U.match(_))break;throw Error(N);case Ee:if(U.match(_))break;if(U=='"'||U=="'"){x=U,Y=X;break}g.attrValue+=U,Y=me;break;case me:if(U.match(_)){Y=de;break}if(U=="]"){Y=M;break}if(U=="'"||U=='"')throw Error(N);g.attrValue+=U;break;case X:if(U==x){Y=de;break}g.attrValue+=U;break;case B:if(U.match(_))break;if(U==","){Y=W;break}throw Error(N)}}switch(Y){case W:case R:case M:case j:case B:E();break;default:throw Error(N)}if(!S.length)throw Error(N);return S},b.nextUid=1,b.matchesSelector="matches",b})(),y=(function(){function b(){}return b.createObserverOptions=function(v){var S={childList:!0,subtree:!0},T;function g(E){if(!(S.attributes&&!T)){if(S.attributes=!0,S.attributeOldValue=!0,!E){T=void 0;return}T=T||{},E.forEach(function(C){T[C]=!0,T[C.toLowerCase()]=!0})}}return v.forEach(function(E){if(E.characterData){S.characterData=!0,S.characterDataOldValue=!0;return}if(E.all){g(),S.characterData=!0,S.characterDataOldValue=!0;return}if(E.attribute){g([E.attribute.trim()]);return}var C=b._elementFilterAttributes(E.elementFilter).concat(E.attributeList||[]);C.length&&g(C)}),T&&(S.attributeFilter=Object.keys(T)),S},b.validateOptions=function(v){for(var S in v)if(!(S in b._optionKeys))throw Error("Invalid option: "+S);if(typeof v.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!v.queries||!v.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var T={callback:v.callback,rootNode:v.rootNode||document,observeOwnChanges:!!v.observeOwnChanges,oldPreviousSibling:!!v.oldPreviousSibling,queries:[]},g=0;g<v.queries.length;g++){var E=v.queries[g];if(E.all){if(Object.keys(E).length>1)throw Error("Invalid request option. all has no options.");T.queries.push({all:!0});continue}if("attribute"in E){var C={attribute:b._validateAttribute(E.attribute)};if(C.elementFilter=h.parseSelectors("*["+C.attribute+"]"),Object.keys(E).length>1)throw Error("Invalid request option. attribute has no options.");T.queries.push(C);continue}if("element"in E){var _=Object.keys(E).length,C={element:E.element,elementFilter:h.parseSelectors(E.element)};if(E.hasOwnProperty("elementAttributes")&&(C.attributeList=b._validateElementAttributes(E.elementAttributes),_--),_>1)throw Error("Invalid request option. element only allows elementAttributes option.");T.queries.push(C);continue}if(E.characterData){if(Object.keys(E).length>1)throw Error("Invalid request option. characterData has no options.");T.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return T},b._validateElementAttributes=function(v){if(!v.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var S={},T={},g=v.split(/\s+/),E=0;E<g.length;E++){var C=g[E];if(C){C=b._validateAttribute(C);var _=C.toLowerCase();if(S[_])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");T[C]=!0,S[_]=!0}}return Object.keys(T)},b._elementFilterAttributes=function(v){var S={};return v.forEach(function(T){T.qualifiers.forEach(function(g){S[g.attrName]=!0})}),Object.keys(S)},b._validateAttribute=function(v){if(typeof v!="string"||(v=v.trim(),!v))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!v.match(b._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+v);return v},b._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,b._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},b})(),w=(function(){function b(v){var S=this;this._connected=!1,this._options=y.validateOptions(v),this._observerOptions=y.createObserverOptions(this._options.queries),this._root=this._options.rootNode,this._callback=this._options.callback,this._elementFilter=Array.prototype.concat.apply([],this._options.queries.map(function(T){return T.elementFilter?T.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(T){return T.all}),this._queryValidators=[],b.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(T){return b.createQueryValidator(S._root,T)})),this._observer=new MutationObserver(function(T){S._observerCallback(T)}),this.reconnect()}return b.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},b.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var v=this._createSummaries(this._observer.takeRecords());return this._changesToReport(v)?v:void 0},b.prototype.disconnect=function(){var v=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,v},b.prototype._observerCallback=function(v){this._options.observeOwnChanges||this._observer.disconnect();var S=this._createSummaries(v);this._runQueryValidators(S),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(S)&&this._callback(S),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},b.prototype._createSummaries=function(v){if(!v||!v.length)return[];for(var S=new c(this._root,v,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),T=[],g=0;g<this._options.queries.length;g++)T.push(new u(S,this._options.queries[g]));return T},b.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(v){v&&v.recordPreviousState()})},b.prototype._runQueryValidators=function(v){this._queryValidators.forEach(function(S,T){S&&S.validate(v[T])})},b.prototype._changesToReport=function(v){return v.some(function(S){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(T){return S[T]&&S[T].length})||S.attributeChanged&&Object.keys(S.attributeChanged).some(function(T){return!!S.attributeChanged[T].length}))})},b})(),A=(function(){function b(v,S){this.root=v,this.delegate=S,this.idMap={}}return b.prototype.initialize=function(v,S){this.idMap[v]=this.root;for(var T=0;T<S.length;T++)this.deserializeNode(S[T],this.root)},b.prototype.applyChanged=function(v,S,T,g){var E=this;S.forEach(function(C){var _=E.deserializeNode(C);E.deserializeNode(C.parentNode),E.deserializeNode(C.previousSibling),_.parentNode&&_.parentNode.removeChild(_)}),v.forEach(function(C){var _=E.deserializeNode(C);_.parentNode&&_.parentNode.removeChild(_)}),S.forEach(function(C){var _=E.deserializeNode(C),x=E.deserializeNode(C.parentNode),N=E.deserializeNode(C.previousSibling);x.insertBefore(_,N?N.nextSibling:x.firstChild)}),T.forEach(function(C){var _=E.deserializeNode(C);Object.keys(C.attributes).forEach(function(x){var N=C.attributes[x];N===null?_.removeAttribute(x):(!E.delegate||!E.delegate.setAttribute||!E.delegate.setAttribute(_,x,N))&&_.setAttribute(x,N)})}),g.forEach(function(C){var _=E.deserializeNode(C);_.textContent=C.textContent}),v.forEach(function(C){delete E.idMap[C.id]})},b.prototype.deserializeNode=function(v,S){var T=this;if(v===null)return null;var g=this.idMap[v.id];if(g)return g;var E=this.root.ownerDocument;switch(E===null&&(E=this.root),v.nodeType){case Node.COMMENT_NODE:g=E.createComment(v.textContent);break;case Node.TEXT_NODE:g=E.createTextNode(v.textContent);break;case Node.DOCUMENT_TYPE_NODE:g=E.implementation.createDocumentType(v.name,v.publicId,v.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(g=this.delegate.createElement(v.tagName)),g||(g=E.createElement(v.tagName)),Object.keys(v.attributes).forEach(function(_){(!T.delegate||!T.delegate.setAttribute||!T.delegate.setAttribute(g,_,v.attributes[_]))&&g.setAttribute(_,v.attributes[_])});break;default:throw"Unsupported node type: "+v.nodeType}if(this.idMap[v.id]=g,S&&S.appendChild(g),v.childNodes)for(var C=0;C<v.childNodes.length;C++)this.deserializeNode(v.childNodes[C],g);return g},b})(),k=(function(){function b(v,S,T){var g=this;this.target=v,this.mirror=S,this.nextId=1,this.knownNodes=new r;for(var E=this.serializeNode(v).id,C=[],_=v.firstChild;_;_=_.nextSibling)C.push(this.serializeNode(_,!0));this.mirror.initialize(E,C);var x=[{all:!0}];T&&(x=x.concat(T)),this.mutationSummary=new w({rootNode:v,callback:function(N){g.applyChanged(N)},queries:x})}return b.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},b.prototype.rememberNode=function(v){var S=this.nextId++;return this.knownNodes.set(v,S),S},b.prototype.forgetNode=function(v){this.knownNodes.delete(v)},b.prototype.serializeNode=function(v,S){if(v===null)return null;var T=this.knownNodes.get(v);if(T!==void 0)return{id:T};var g={nodeType:v.nodeType,id:this.rememberNode(v)};switch(g.nodeType){case Node.DOCUMENT_TYPE_NODE:var E=v;g.name=E.name,g.publicId=E.publicId,g.systemId=E.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:g.textContent=v.textContent;break;case Node.ELEMENT_NODE:var C=v;g.tagName=C.tagName,g.attributes={};for(var _=0;_<C.attributes.length;_++){var x=C.attributes[_];g.attributes[x.name]=x.value}if(S&&C.childNodes.length){g.childNodes=[];for(var N=C.firstChild;N;N=N.nextSibling)g.childNodes.push(this.serializeNode(N,!0))}}return g},b.prototype.serializeAddedAndMoved=function(v,S,T){var g=this,E=v.concat(S).concat(T),C=new r;E.forEach(function(x){var N=x.parentNode,W=C.get(N);W||(W=new r,C.set(N,W)),W.set(x,!0)});var _=[];return C.keys().forEach(function(x){for(var N=C.get(x),W=N.keys();W.length;){for(var R=W[0];R.previousSibling&&N.has(R.previousSibling);)R=R.previousSibling;for(;R&&N.has(R);){var M=g.serializeNode(R);M.previousSibling=g.serializeNode(R.previousSibling),M.parentNode=g.serializeNode(R.parentNode),_.push(M),N.delete(R),R=R.nextSibling}W=N.keys()}}),_},b.prototype.serializeAttributeChanges=function(v){var S=this,T=new r;return Object.keys(v).forEach(function(g){v[g].forEach(function(E){var C=T.get(E);C||(C=S.serializeNode(E),C.attributes={},T.set(E,C)),C.attributes[g]=E.getAttribute(g)})}),T.keys().map(function(g){return T.get(g)})},b.prototype.applyChanged=function(v){var S=this,T=v[0],g=T.removed.map(function(x){return S.serializeNode(x)}),E=this.serializeAddedAndMoved(T.added,T.reparented,T.reordered),C=this.serializeAttributeChanges(T.attributeChanged),_=T.characterDataChanged.map(function(x){var N=S.serializeNode(x);return N.textContent=x.textContent,N});this.mirror.applyChanged(g,E,C,_),T.removed.forEach(function(x){S.forgetNode(x)})},b})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=w,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=h,n.Summary=u,n.TreeChanges=l,n.TreeMirror=A,n.TreeMirrorClient=k,Object.defineProperty(n,"__esModule",{value:!0})}))})),z_=q_(),Co=0,Ao=new Array(1e3);function U_(){for(let e=0;e<Co;e+=2){const t=Ao[e],n=Ao[e+1];t(...n),Ao[e]=void 0,Ao[e+1]=void 0}Co=0}function V_(e,...t){Ao[Co]=e,Ao[Co+1]=t,Co+=2,Co===2&&G_()}function j_(){let e=0;const t=new MutationObserver(U_),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var G_=j_();function rg(){V_(()=>{_u.hasListeners()&&(_u.fire(),rg())})}var _u=new _e({onFirstListenerAdd:rg}),ka=_u.once;function X_(e,t,n){const r=new _e;let o=[];return r.addDisposable(e(i=>{ka(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var Y_=class extends _e{constructor(e={}){super(),L(this,"_mutationSummary",void 0),this._mutationSummary=new z_.MutationSummary({...e,observeOwnChanges:!0,callback:t=>this.fire(t),queries:[{all:!0}]})}dispose(){this._mutationSummary.disconnect(),super.dispose()}trigger(e){if(this.isDisposed())return;const t=this._mutationSummary.takeSummaries();return(e||t?.length)&&this.fire(t||[]),t}},K_=class extends Ae{_nextTickHandler(){ka(()=>{this.trigger(),this._summaries.length&&(this._innerEmitter.hasListeners()?this._innerEmitter.fire(this._summaries):this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)}constructor(e={}){super(),L(this,"_mutationEmitter",void 0),L(this,"_innerEmitter",this.addDisposable(new _e({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),L(this,"_lostEmitter",this.addDisposable(new _e)),L(this,"_paused",0),L(this,"_stopped",0),L(this,"_foreignCode",0),L(this,"_summaries",[]),L(this,"onMutate",this._innerEmitter.event),L(this,"onLost",this._lostEmitter.event),L(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new Y_(e)),this.onNativeMutate=this._mutationEmitter.event,this.addDisposable(this._mutationEmitter.event(t=>{(!this._stopped||this._foreignCode)&&(this._paused?this._lostEmitter.fire(t):(this._summaries.push(...t),ka(()=>{this._summaries.length&&!this._innerEmitter.hasListeners()&&(this._lostEmitter.fire(this._summaries),this._summaries=[])},Number.MAX_VALUE)))}))}get isStoped(){return this._paused>0||this._stopped>0}stop(){this._mutationEmitter.trigger(),this._stopped++}start(){this._mutationEmitter.trigger(),this._stopped--}pause(){this._mutationEmitter.trigger(),this._paused++}resume(){this._mutationEmitter.trigger(),this._paused--}pauseForForeignCode(){this.pause(),this._foreignCode++}resumeAfterForeignCode(){this.resume(),this._foreignCode--}unpaused(e){if(!this._paused||this._stopped)return e();this._mutationEmitter.trigger();const t=this._paused;this._paused=0;try{return e()}finally{try{this._mutationEmitter.trigger()}finally{this._paused+=t}}}trigger(){this._mutationEmitter.trigger(!0)}takeRecords(){this._mutationEmitter.trigger()}flush(){if(this._mutationEmitter.trigger(),this._summaries.length&&this._innerEmitter.hasListeners()){const e=this._summaries;this._summaries=[],this._innerEmitter.fire(e)}}},Z_=ka,og=2e3,Q_=class extends Ae{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),L(this,"_baseDocument",void 0),L(this,"_remoteDocument",void 0),L(this,"_parsedDocument",void 0),L(this,"_nodeMap",void 0),L(this,"_beforeChangeEmitter",this.addDisposable(new _e)),L(this,"_beforeCommitEmitter",this.addDisposable(new _e)),L(this,"_onRefreshEmitter",this.addDisposable(new _e)),L(this,"_documentElement",void 0),L(this,"_docType",void 0),L(this,"_parseFn",void 0),L(this,"_mapHTMLRoots",void 0),L(this,"_roots",void 0),L(this,"_getRootsParent",void 0),L(this,"_mutationCollector",this.addDisposable(new K_)),L(this,"_attributeMapper",void 0),L(this,"ownership",void 0),L(this,"_reportedDrifts",new Set),L(this,"_canvasNodes",F_(document)),L(this,"_accountingTimer",void 0),L(this,"_lastAccounting",0),L(this,"_capture",void 0),L(this,"_openBatches",0),L(this,"_pushUndoStop",!1),L(this,"_locked",!1),L(this,"_beforeCommitPending",!1),L(this,"_outputs",new Map),L(this,"_runningScripts",[]),L(this,"scriptRunner",{run:(o,i)=>this.runScript(o,i),quiet:o=>this.renderOnly(o),substitute:(o,i)=>{const s=this._nodeMap.getByElement(o);s&&(this._nodeMap.remove(s,!1),this._nodeMap.set(s,i))}}),L(this,"_commands",[]),L(this,"_pauseOnCommandInput",o=>{const i=this._commands[this._commands.length-1];if(i){i.paused||(i.paused=!0,this._mutationCollector.pause());return}o.isTrusted&&(this._pushUndoStop=!0,this.recordNow())}),L(this,"_treeMutations",[]),L(this,"beforeChange",this._beforeChangeEmitter.event),L(this,"beforeCommit",this._beforeCommitEmitter.event),L(this,"onChange",hA(X_(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),L(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new fT(e,n.createRoot);this._nodeMap=new qT,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new M_(this._nodeMap),this.addDisposable(YT(()=>this._mutationCollector.pauseForForeignCode())),this.addDisposable(KT(()=>this._mutationCollector.resumeAfterForeignCode())),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new P_(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>this._bindScriptOutput(o))),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o))),this.addDispose(WC(this._pauseOnCommandInput)),t.collectCanvasEdits=()=>this.commit(!1),this.addDispose(()=>clearTimeout(this._accountingTimer))}isUntracked(e){return this.ownership.isMarked(e)||this.ownership.isOffModel(e.parentNode)||this.ownership.isService(e)}markUntracked(e){this.ownership.markForeign(e)}_reportSafely(e){try{e()}catch{}}_reportForeignStructure(e){this._reportSafely(()=>{const t=n=>!!this._nodeMap.getByElement(n);H_(I_(e,this.ownership,t),this._reportedDrifts),B_(D_(e,t),this._reportedDrifts)})}_accountingRules(){const e=new Set;for(const t of this._parsedDocument.root.children){const n=this._nodeMap.getByNode(t);n&&e.add(n)}return this._getRootsParent?.()?.childNodes.forEach(t=>e.add(t)),{isMapped:t=>!!this._nodeMap.getByElement(t),markOf:t=>this.ownership.markOf(t),isCanvasNode:t=>this._canvasNodes.has(t),roots:e}}nodeBucket(e){return Jh(e,this._accountingRules())}auditNodes(){return eg(document,this._accountingRules()).map(tg)}checkAccounting(){this._reportSafely(()=>ng(eg(document,this._accountingRules()),this._reportedDrifts))}_checkCommitted(e){this._reportSafely(()=>{const t=e.flatMap(n=>[...n.added,...n.reparented??[],...n.reordered??[]]);ng($_(t,this._accountingRules()),this._reportedDrifts)})}_scheduleAccountingCheck(){if(this._accountingTimer!==void 0||this.isDisposed())return;const e=()=>{this._accountingTimer=void 0,this._lastAccounting=Date.now(),this.isDisposed()||this.checkAccounting()},t=Math.max(0,this._lastAccounting+og-Date.now());this._accountingTimer=setTimeout(()=>{const n=window.requestIdleCallback;n?n(e,{timeout:og}):e()},t)}commit(e=!0,t=!1){this._pushUndoStop||(this._pushUndoStop=e),this._locked||(this._locked=t);const n=this._capture??this._startCapture();return this._runBeforeCommit(),n}_runBeforeCommit(){this._beforeCommitPending&&!this.isDisposed()&&(this._beforeCommitPending=!1,this._mutationCollector.unpaused(()=>this._beforeCommitEmitter.fire()))}flushCommit(){this._capture!==void 0&&this._mutationCollector.flush()}recordNow(){this._capture===void 0&&this._startCapture(),this._mutationCollector.flush()}_startCapture(){let e;const t=new Promise(n=>e=n);return this._capture=t,this._openBatches++,this._beforeCommitPending=!0,this._sealOnNextTick(e),t}_sealOnNextTick(e){const t=this._mutationCollector.onMutate(n=>{n.length&&(this._dropForeignOutput(n),this._reportForeignStructure(n),ya("commit",()=>{const r=S_(n,this._nodeMap,this._parseFn,this._rootsParent());this._commit(r)}),this._checkCommitted(n),this._dropOrphanedOutput())});Z_(()=>{this._beforeCommitPending&&this._reportSafely(()=>this._runBeforeCommit()),this._reportSafely(()=>this._mutationCollector.flush()),this._beforeCommitPending=!1,t.dispose();const{_pushUndoStop:n,_locked:r}=this;this._capture=void 0,this._pushUndoStop=this._locked=!1;const o=()=>{this._openBatches--,e()};if(r&&!this.isDisposed()){this._remoteDocument.saveChangesAsync(n).finally(o);return}try{this.isDisposed()||this._remoteDocument.saveChanges(n)}finally{o()}})}get entityId(){return this._remoteDocument.entityId}whenSent(e=!1){return this._remoteDocument.whenSent(e)}sendAfterCurrentEdits(e){const t=this._pushUndoStop;return this._pushUndoStop=!1,this._remoteDocument.sendAfterCurrentEdits(e,t)}renderOnly(e){this._mutationCollector.stop();try{return e()}finally{this._mutationCollector.start()}}applyHidden(e){this._mutationCollector.pause();try{return e()}finally{this._mutationCollector.resume()}}applyForeignOutput(e,t,n){e.forEach(r=>this.ownership.markOutput(r)),this.applyHidden(t),this._keepOutput(n,e)}_keepOutput(e,t){t.length&&this._outputs.set(e,[...this._outputs.get(e)??[],...t])}_isGone(e){return!e.isConnected&&!this.isInLetter(e)}isInLetter(e){const t=this._nodeMap.getByElement(e);return!!t&&this._parsedDocument.isAttached(t)}letterChildren(e){return(this._nodeMap.getByElement(e)?.children??[]).flatMap(t=>{const n=this._nodeMap.getByNode(t);return n?[n]:[]})}runScript(e,t){this._mutationCollector.pauseForForeignCode(),this._runningScripts.push(e);try{t()}finally{try{this._mutationCollector.resumeAfterForeignCode()}finally{this._runningScripts.pop()}}}_scriptOf(){if(this._runningScripts.length)return this._runningScripts[this._runningScripts.length-1]??void 0;const e=document.currentScript;return e&&(this._nodeMap.getByElement(e)||this.ownership.isOutput(e))?e:void 0}_bindScriptOutput(e){const t=this._scriptOf();if(!t)return;const n=new Set(e.flatMap(o=>o.added)),r=[...n].filter(o=>!(o.parentNode&&n.has(o.parentNode))&&!this._nodeMap.getByElement(o)&&!this.ownership.isOutput(o)&&!this.ownership.isService(o)&&!this._runningScripts.includes(o));r.forEach(o=>this.ownership.markOutput(o)),this._keepOutput(t,r)}_dropOrphanedOutput(){let e=[...this._outputs.keys()].filter(t=>this._isGone(t));for(;e.length;){const t=e.flatMap(n=>this._outputs.get(n)??[]);e.forEach(n=>this._outputs.delete(n)),this.applyHidden(()=>t.flatMap(n=>this._unwrapOutput(n))).forEach(n=>this.ownership.forget(n)),e=[...this._outputs.keys()].filter(n=>this._isGone(n))}}_unwrapOutput(e){const t=[],n=r=>r.childNodes.forEach(o=>this.isInLetter(o)?t.push(o):n(o));return n(e),e.parentNode&&e.replaceWith(...t),t}_dropForeignOutput(e){if(this.ownership.hasOutput){const t=n=>!(this.ownership.isMarked(n)&&this.ownership.isOutput(n));for(const n of e)n.added=n.added.filter(t),n.reparented=n.reparented?.filter(t),n.reordered=n.reordered?.filter(t)}}applyOwn(e){this._mutationCollector.takeRecords(),this._runningScripts.push(null);try{return this._mutationCollector.unpaused(e)}finally{this._runningScripts.pop()}}applyCommand(e){const t={paused:!1};this._commands.push(t);try{return this._mutationCollector.unpaused(e)}finally{this._commands.pop(),t.paused&&this._mutationCollector.resume()}}_rootsParent(){const e=this._getRootsParent?.();return e?{node:e,treeNode:this._parsedDocument.root}:void 0}getMappedParent(e){for(;e;){const t=this._nodeMap.getByElement(e);if(t){const n=this._parsedDocument.getContext(t);return n?this._nodeMap.getByNode(n):void 0}else e=e.parentNode}}getContext(e){return this.getMappedParent(e)||e}isInExternal(e){return this.getContext(e)!==e}isVisible(e){return!!this._nodeMap.getByElement(e)}getVisibleNode(e){let t=e;do{if(!t||this._nodeMap.getByElement(t))return t;t=t.parentNode||void 0}while(t)}_commit(e){if(e.length){e=this._attributeMapper.beforeCommit(e),e=w_(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;ah(()=>{const n=Th(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)if(n.type==="Hidden"){const r=this._nodeMap.getByNode(n.node);r&&this.ownership.markService(r),this._nodeMap.remove(n.node,n.value)}}finally{this._baseDocument.endUpdate()}}}correctNodes(e){const t=new Map;for(const n of e)if(!t.has(n)&&this._parsedDocument.contains(n)&&n.type===$.ELEMENT){const r=Uc(n,!1,!1);r!==this._baseDocument.getText({start:n.start,end:n.startTagEnd===void 0?n.start:n.startTagEnd})+this._baseDocument.getText({start:n.endTagStart===void 0?n.end:n.endTagStart,end:n.end})&&t.set(n,r)}try{this._baseDocument.beginUpdate();for(const[n,r]of t)if(r!==this._baseDocument.getText({start:n.start,end:n.end})){const o=this._parsedDocument.replaceWithEx(n,r,yo),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{ya("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,OA()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)ya(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=VT(this._attributeMapper.onRemoteMutate(e),this._nodeMap),this._treeMutations=[],!t){const o=this._parsedDocument.root;for(const i of e)if(i.type==="Add"){if(i.parent===o){t=!0;break}}else if(i.type==="Remove"){if(i.node.parent===o){t=!0;break}}else if(i.type==="Move"&&(i.node.parent===o||i.parent===o)){t=!0;break}}const n=RT(e,this._nodeMap,o=>this._parsedDocument.isAttached(o)),r=PT(n);this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),r.push(...C0(DT(n)));try{if($T(n,this._nodeMap),this._dropOrphanedOutput(),this._attributeMapper.restoreHidden(),t){const o=this._parsedDocument.root?.children;if(o){const i=o.map(a=>this._nodeMap.getByNode(a)).filter(a=>!!a),s=this._roots=this._mapHTMLRoots(i,this);Eu.isEqual(i,s)}}}finally{zp(r,this.scriptRunner)}}finally{this._mutationCollector.start(),this._scheduleAccountingCheck()}}getLinks(e){const t=this._nodeMap.getByElement(e),n=t?[[t,e]]:[];for(const r of e.childNodes)n.push(...this.getLinks(r));return n}setLinks(e){for(const[t,n]of e)this._nodeMap.set(t,n)}_clearLinks(e){for(const[t]of e)this._nodeMap.remove(t)}_removeByLinks(e,t){const n=new Set,r=[];for(const[o,i]of e)o.parent&&!n.has(o.parent)&&(this._parsedDocument.remove(o,t),r.unshift(ue.remove(i))),n.add(o);return r}getInnerHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.startTagEnd===void 0?t.start:t.startTagEnd,end:t.endTagStart===void 0?t.end:t.endTagStart}):""}getOuterHtml(e){let t=this._nodeMap.getByElement(e);return t?this._baseDocument.getText({start:t.start,end:t.end}):""}getRootsHtml(){const e=this._getRootsParent?.();return e?[...e.childNodes].map(t=>this.getOuterHtml(t)).join(""):""}setInnerHtml(e,t){if(e instanceof Element)e.innerHTML=t;else if(e instanceof Comment)e.data=t;else if(e instanceof Document){it("not supported inner html of Document");return}else e instanceof Text&&(e.textContent=t)}getElementByPosition(e){let t=this._parsedDocument.getNodeByPosition(e);if(t){let n;do n=this._nodeMap.getByNode(t);while(!n&&(t=t?.parent));return n}}getRangeByElement(e,t=!1){if(e){let n=null;do n=this._nodeMap.getByElement(e);while(t&&!n&&(e=e.parentElement));if(n)return{start:n.start,end:n.end}}}},gj=1500,bj=2,J_=100,ek=class{constructor(e){L(this,"_options",void 0),L(this,"_watches",new Map),L(this,"_timer",void 0),L(this,"_last",0),L(this,"_tick",()=>{const t=Date.now(),n=Math.min(Math.max(t-this._last,0),200);this._last=t;for(const[r,o]of this._watches){if(!this._options.isAwaiting(r)){this._watches.delete(r);continue}if(o.waited+=n,!(o.waited<1500)){if(o.retries<2){o.retries+=1,o.waited=0,o.resend();continue}this._watches.delete(r),this._options.onGiveUp(r,o.retries)}}this._watches.size||this._stop()}),this._options=e}watch(e,t){this._watches.set(e,{waited:0,retries:0,resend:t}),this._timer===void 0&&(this._last=Date.now(),this._timer=setInterval(this._tick,J_))}dispose(){this._watches.clear(),this._stop()}_stop(){this._timer!==void 0&&(clearInterval(this._timer),this._timer=void 0)}},ig=class{constructor(){L(this,"_changes",null)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){const t=Gt(this._changes,e);this._changes=t.length?t:null}clear(){this._changes=null}replace(e){this._changes=e.length?e:null}correctOffset(e,t){const n=this._changes;if(n){let r=0;for(let o=0,i=n.length;o<i;o++){const s=n[o];if(s.oldPosition<e)r+=s.newLength-s.oldLength;else break}e=e+(t?1:-1)*r}return e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}},sg=60;function tk(e,t){if(e===t)return;const n=Math.min(e.length,t.length);let r=0;for(;r<n&&e[r]===t[r];)r+=1;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+sg),cached:t.substring(r,r+sg)}}var nk=64,rk=class extends Ae{constructor(...e){super(...e),L(this,"_onApplyEmitter",this.addDisposable(new _e)),L(this,"_onEmptyEmitter",this.addDisposable(new _e)),L(this,"_dispatched",[]),L(this,"_echoed",new Set),L(this,"_revertedAwaiting",new Set),L(this,"onApply",this._onApplyEmitter.event),L(this,"onEmpty",this._onEmptyEmitter.event)}_emit(e){e.length&&this._onApplyEmitter.fire(e),this.hasDispatched()||this._onEmptyEmitter.fire()}hasDispatched(){return!!this._dispatched.length}isInFlight(e){return this._dispatched.some(t=>t.changeId===e)}hasRevertedAwaiting(){return this._revertedAwaiting.size>0}wasEchoed(e){return e!==void 0&&this._echoed.has(e)}countDispatched(){return this._dispatched.reduce((e,t)=>e+t.textChanges.length,0)}_remember(e){this._echoed.add(e),this._echoed.size>nk&&this._echoed.delete(this._echoed.values().next().value)}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t){const n=t===void 0?-1:this._dispatched.findIndex(r=>r.changeId===t);if(t!==void 0&&(this._remember(t),this._revertedAwaiting.delete(t)),n>=0){this._confirmEcho(n,e);return}this._applyExternal(e)}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(Gt(Yn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=Gt(t,Yn(n.textChanges)),n.changeId!==void 0&&this._revertedAwaiting.add(n.changeId);this._dispatched=[],this._emit(Gt(t,e))}clear(){this._dispatched=[],this._revertedAwaiting.clear()}},ok=class IC extends Ae{constructor(t=""){super(),L(this,"_text",void 0),this._text=t}getText(t){const n=VA(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new IC(this._text)}},La=class DC extends ok{constructor(t=""){super(t),L(this,"_eventQueue",void 0),L(this,"_lockCounter",0),L(this,"_onChangeEmitter",this.addDisposable(new _e)),L(this,"_onChangedEmitter",this.addDisposable(new _e)),L(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>ZA(this,r)),n.length){const r=bo(n,this);this._eventQueue&&this._eventQueue.push({source:t,changes:r}),this.change(t,n),this._eventQueue||this._onChangedEmitter.fire({source:t,changes:r})}}change(t,n){this._text=XA(this._text,n)}beginUpdate(){this._lockCounter++===0&&(this._eventQueue=[])}endUpdate(t){const n=this._eventQueue;if(--this._lockCounter===0&&n&&(this._eventQueue=void 0,n.length)){t===void 0&&(t=n[0].source);let r=null;for(const{changes:o}of n)r=Gt(r,o);if(r=r?.filter(o=>o.oldPosition!==o.newPosition||o.newText!==o.oldText),r?.length)return this._onChangedEmitter.fire({source:t,changes:r}),!0}return!1}clone(){return new DC(this._text)}};function ag(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function Na(e){const t=e.indexOf("(");if(t<0)return!0;let n=0,r="",o=!1;for(let i=t;i<e.length;i++){const s=e[i];if(o){o=!1;continue}if(s==="\\"){o=!0;continue}if(r){s===r&&(r="");continue}if(s==='"'||s==="'"){r=s;continue}if(s==="("){n++;continue}if(s===")"&&(n--,n<0))return!1}return n===0}function ik(e){return(t,n,r)=>Na(t)?e(t,n,r):!1}function sk(e){return t=>Na(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function ak(e){return(t,n,r)=>Na(t)?ag(t)?e(t,n,r):t:!1}function lk(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return Na(n)?ag(n)?e(t):t:!1}}function ck(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function ku(e,t){const n=e.length;for(let r=0;r<n;r++){const o=e.charCodeAt(r);if(o===0||t==='"'&&o===34||t==="'"&&o===39||t===""&&(o===32||o===9||o===10||o===13||o===12||o===34||o===39||o===60||o===62||o===61||o===96))return!1}return!0}function uk(e){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",r=new Uint8Array(e);crypto.getRandomValues(r);let o="";for(let i=0;i<e;i++){const s=r[i]%62;o+=t.charAt(s)}return o}var dk=8,fk=class{constructor(){L(this,"_byKey",Object.create(null)),L(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=uk(dk),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},xa=new fk;function lg(e,t){return t!==void 0&&!ku(e,t)?`%|{${xa.getOrCreateByKey(e)}}|%`:e}function mk(e){const t=xa.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ke(e,t,n){return t!==void 0?ku(e,t)?e:`%|{${xa.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function pk(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function qe(e){return e.startsWith("<!--")&&e.endsWith("-->")?pk(e.slice(4,-3)):e}function hk(e){const t=/^(IF|ELSE|ELSIF|ELSEIF|END|FOREACH|WHILE|NEXT|LAST|BREAK|DO|UNLESS|CONTINUE|SET|UNSET|DEFINE|INCLUDE)\b/i,n=/\w+\s*\(/;let r=e;const o=e.match(/\[%\s*([^%]*?)\s*%\]/);o&&(r=o[1]);const i=r.trim();return t.test(i)||n.test(i)}function gk(e,t,n){return t!==void 0?ku(e,t)?e:`%|{${xa.getOrCreateByKey(e)}}|%`:n||ck(e)||hk(e)?`<!--${e}-->`:e}var Dr=ik(Ke),Br=sk(qe),bk=ak(Ke),yk=lk(qe),vk=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",mk),e.escape("@{","}",Ke,!0).unescape("<!--@{","}-->",qe,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",lg,!0),e.escape("{{","}}",lg,!0),e.createSyntax("brace-percent").escape("{%","%}",Ke).unescape("<!--{%","%}-->",qe),e.createSyntax("brace-hash").escape("{#","#}",Ke).unescape("<!--{#","#}-->",qe),e.createSyntax("proscript").escape("[%","%]",gk,!0).unescape("<!--[%","%]-->",qe,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ke).escape("[[if","]]",Ke).escape("[[ELSE]]","",Ke).escape("[[else]]","",Ke).escape("[[ENDIF]]","",Ke).escape("[[endif]]","",Ke).unescape("<!--[[IF","]]-->",qe).unescape("<!--[[if","]]-->",qe).unescape("<!--[[ELSE]]","-->",qe).unescape("<!--[[else]]","-->",qe).unescape("<!--[[ENDIF]]","-->",qe).unescape("<!--[[endif]]","-->",qe),e.createSyntax("expert-sender").escape("<if",">",Ke).escape("</if",">",Ke).escape("<else",">",Ke).escape("</else",">",Ke).escape("<var ",">",Ke,!0).unescape("<!--<if ",">-->",qe).unescape("<!--</if",">-->",qe).unescape("<!--<else ",">-->",qe).unescape("<!--</else",">-->",qe).unescape("<!--<var",">-->",qe,!0),e.createSyntax("velocity").escape("#if",")",Dr).escape("#elseif",")",Dr).escape("#else","",Ke).escape("#foreach",")",Dr).escape("#macro",")",Dr).escape("#set",")",bk,!0).escape("#parse",")",Dr).escape("#include",")",Dr).escape("#evaluate",")",Dr).escape("#end","",Ke).escape("#break","",Ke).escape("#stop","",Ke).unescape("<!--#macro","-->",Br).unescape("<!--#if","-->",Br).unescape("<!--#elseif","-->",Br).unescape("<!--#else","-->",qe).unescape("<!--#foreach","-->",Br).unescape("<!--#parse","-->",Br).unescape("<!--#include","-->",Br).unescape("<!--#evaluate","-->",Br).unescape("<!--#end","-->",qe).unescape("<!--#break","-->",qe).unescape("<!--#stop","-->",qe).unescape("<!--#set","-->",yk,!0),e.createSyntax("mailchimp").escape("*|","|*",Ke).unescape("<!--*|","|*-->",qe)},cg="bare",Lu=new Map;function Ek(e){for(const t of Object.keys(e)){const n=e[t];n&&Lu.set(t,n)}}function Sk(e){return e?Lu.get(e)??cg:cg}function wk(){Lu.clear()}function ug(e,t,n,r){for(let o=t;o<n;o++){const i=e[o];r.insideAttributeValue?r.attributeQuoteChar==='"'||r.attributeQuoteChar==="'"?i===r.attributeQuoteChar&&(r.insideAttributeValue=!1,r.attributeQuoteChar=void 0):r.unquotedAttr&&/[\s>]/.test(i)&&(r.insideAttributeValue=!1,r.attributeQuoteChar=void 0,r.unquotedAttr=!1):i==="<"?r.insideTag=!0:i===">"?r.insideTag=!1:r.insideTag&&(i==='"'||i==="'")?(r.insideAttributeValue=!0,r.attributeQuoteChar=i,r.unquotedAttr=!1):r.insideTag&&/\S/.test(i)&&r.attributeQuoteChar===void 0&&e[o-1]==="="&&!['"',"'","`"].includes(i)&&(r.insideAttributeValue=!0,r.attributeQuoteChar="",r.unquotedAttr=!0)}}function Ni(e,t){return e.start<t.end&&t.start<e.end}function dg(e,t,n,r,o=[]){if(n&&(t=t.filter(u=>u.isVariable)),!t.length)return[];const i=t.flatMap(u=>u.match(e).flatMap(d=>!Number.isInteger(d.start)||!Number.isInteger(d.end)||d.start<0||d.end>e.length||d.start>=d.end?[]:[{range:d,mapFn:u.mapFn,overrideBuiltins:u.overrideBuiltins,syntax:u.syntax,isVariable:u.isVariable}])).sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end),s=[],a=o.slice().sort((u,d)=>u.start-d.start),l={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let c=0;for(const{range:u,mapFn:d,overrideBuiltins:f,syntax:p,isVariable:m}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):ug(e,c,u.start,l),c=u.end,a.some(A=>Ni(A,u)))continue;const h=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,y=e.substring(u.start,u.end),w=d(y,h,l.insideTag);w!==!1&&w!==y&&(s.push({range:u,text:w,overrideBuiltins:f,syntax:p,isVariable:m}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function Ck(e,t){const n=t.reduce((a,{mapFn:l,start:c,end:u,syntax:d,isVariable:f})=>(a[c]||(a[c]=[]),a[c].push({value:u,mapFn:l,syntax:d,isVariable:f}),a),Object.create(null)),r=Object.keys(n).map(a=>a.replace(/[-[\]{}()*+?.,\\^$|]/g,"\\$&")).join("|"),o=new RegExp(r,"g"),i=[];let s;for(;(s=o.exec(e))!==null;){const a=s[0];i.push({start:s.index,startToken:a,endTokens:n[a]})}return i}function Nu(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=Ck(e,t),a={insideTag:!1,insideAttributeValue:!1,attributeQuoteChar:void 0,unquotedAttr:!1};let l=0;for(let c=0;c<s.length;c++){const{start:u,startToken:d,endTokens:f}=s[c];r?(a.insideAttributeValue=!0,a.attributeQuoteChar='"'):ug(e,l,u,a),l=u;const p=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let m=!1;for(const{mapFn:h,value:y,syntax:w,isVariable:A}of f){let k=u+d.length,b=e.indexOf(y,k);for(;b!==-1;){let v=b,S=u+d.length,T=0;for(;v!==-1;){const x=e.indexOf(d,S);if(x!==-1&&x<v)T++,S=x+d.length,v=e.indexOf(y,S);else if(T>0)T--,S=v+y.length,v=e.indexOf(y,S);else break}if(v<0)break;const g=v+y.length,E=e.substring(u,g),C=h(E,p,a.insideTag);if(C===!1){k=b+Math.max(y.length,1),b=e.indexOf(y,k);continue}(o||C!==E)&&i.push({range:{start:u,end:g},text:o?E:C,syntax:w,isVariable:A});const _=s.findIndex(({start:x})=>x>=g);_>c?c=_-1:c=s.length,m=!0;break}if(m)break}}return i}function Oa(e,t){if(!t.length)return e;const n=t.slice().sort((o,i)=>i.range.start-o.range.start);let r=e;for(const{text:o,range:i}of n)r=r.slice(0,i.start)+o+r.slice(i.end);return r}var fg=class{constructor(e=vk){L(this,"_disposables",[]),L(this,"_escapes",[]),L(this,"_unescapes",[]),L(this,"_escapeMatchers",[]),L(this,"_unescapeMatchers",[]);const{_escapes:t,_unescapes:n}=this;e({createSyntax(r){return{...this,syntax:r}},escape(r,o,i,s){return t.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this},unescape(r,o,i,s){return n.push({start:r,end:o,mapFn:i,isVariable:s,syntax:this.syntax||r}),this}})}registerMatcherPair(e){const t=e.syntax||"matcher",n={syntax:t,match:e.escape.match,mapFn:e.escape.mapFn,isVariable:e.escape.isVariable,overrideBuiltins:e.escape.overrideBuiltins},r={syntax:t,match:e.unescape.match,mapFn:e.unescape.mapFn,isVariable:e.unescape.isVariable,overrideBuiltins:e.unescape.overrideBuiltins};this._escapeMatchers.push(n),this._unescapeMatchers.push(r);let o=!1;const i={dispose:()=>{o||(o=!0,this._escapeMatchers=this._escapeMatchers.filter(s=>s!==n),this._unescapeMatchers=this._unescapeMatchers.filter(s=>s!==r))}};return this.addDisposable(i),i}_collectMappings(e,t,n){const r=Nu(e,this._escapes,t,n),o=dg(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>Ni(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>Ni(l.range,c.range)));return[...s,...a].sort((l,c)=>l.range.start-c.range.start||l.range.end-c.range.end)}getMappings(e,t,n){return this._collectMappings(e,t,n)}_collectRevertMappings(e,t){const n=Nu(e,this._unescapes,t),r=dg(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>Ni(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>Ni(a.range,l.range)));return[...i,...s].sort((a,l)=>a.range.start-l.range.start||a.range.end-l.range.end)}getRevertMappings(e,t,n){const r=n?o=>o!==void 0&&n.has(o):o=>Sk(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return Nu(e,this._escapes,t,n,!0)}getEscapedText(e,t){return Oa(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return Oa(e,this.getRevertMappings(e,t,n))}normalizeToPolicy(e,t){const n=i=>i===void 0?void 0:t[i],r=Object.values(t);let o=e;return r.includes("bare")&&(o=Oa(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=Oa(o,this._collectMappings(o).filter(i=>!i.isVariable&&n(i.syntax)==="html-comment"&&i.text.startsWith("<!--")&&i.text.endsWith("-->")))),o}hasDetectedMappings(e,t,n){return this.getDetectedMappings(e,t,n).length>0}addDisposable(e){this._disposables.push(e)}dispose(){for(const e of this._disposables)e.dispose()}},Ak=1e4,mg=3,Tk=class extends La{constructor(){super(),L(this,"_editStack",new ig),L(this,"_frozenStack",new ig),L(this,"_frozenUndoStop",!0),L(this,"_barrierSends",[]),L(this,"_barrierResolves",[]),L(this,"_editLog",[]),L(this,"_entityId",void 0),L(this,"_versionController",this.addDisposable(new rk)),L(this,"_beforeSaveEmitter",this.addDisposable(new pA)),L(this,"_onReadyEmitter",this.addDisposable(new _e)),L(this,"_onEntitySetEmitter",this.addDisposable(new _e)),L(this,"_onPendingSentEmitter",this.addDisposable(new _e)),L(this,"_cache",new La),L(this,"beforeSave",this._beforeSaveEmitter.event),L(this,"_reverting",!1),L(this,"_inited",!1),L(this,"_nextChangeId",1),L(this,"_rev",null),L(this,"_pendingSave",null),L(this,"_saveHeld",!1),L(this,"_heldUndoStop",!1),L(this,"_applyingRemote",!1),L(this,"collectCanvasEdits",()=>Promise.resolve()),L(this,"_echoLost",!1),L(this,"_onEchoLostEmitter",this.addDisposable(new _e)),L(this,"_echoWatchdog",this.addDisposable(new ek({isAwaiting:e=>this._versionController.isInFlight(e),onGiveUp:(e,t)=>this._onEchoLost(e,t)}))),L(this,"_handleUpdateEntity",({edits:e,guid:t,changeId:n,rev:r})=>{if(!this._versionController.wasEchoed(n)&&t===this._entityId)return this._reportSyncDrift("update-entity"),this._onRemoteChange(e,n,r)}),L(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),wk(),Ek(e.templateDirectivesPolicy??{});const t=e.guid===this._entityId;this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._editStack.clear(),this._frozenStack.clear(),this._finishBarrier(t),this._versionController.clear(),this._pendingSave=null,this._saveHeld=!1,this._heldUndoStop=!1,this._echoLost=!1,this._onPendingSentEmitter.fire();const n=[[{range:cu(this._cache),text:e.html}]];return this._onRemoteChange(n,void 0,e.rev)}),L(this,"_onRemoteChange",(e,t,n)=>new Promise((r,o)=>{const{_cache:i}=this;let s=[];for(const a of e){const l=a.reverse();s=Gt(s,bo(l,i)),i.applyEdits(vo,l)}this._rev=n??null,this._versionController.apply(s,t),this._versionController.hasDispatched()||(this._echoLost=!1,this._flushPendingSave()),this._versionController.hasDispatched()?this.addDisposable(this._versionController.onEmpty(()=>{r()})):(this._onReadyEmitter.fire(),r())})),L(this,"onReady",this._onReadyEmitter.event),L(this,"onEntitySet",this._onEntitySetEmitter.event),this.addDisposable(K.addListenerAsync(ke.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(K.addListenerAsync(ke.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this.addDisposable(K.addListenerAsync(ke.SANDBOX_CANVAS_SYNCED,()=>this.whenSynced())),this._versionController.onApply(this._onApply.bind(this))}loadState(e){this._entityId=e.entityId;const t=[[{range:cu(this._cache),text:e.text}]];this._onRemoteChange(t)}get entityId(){return this._entityId}saveState(){return{entityId:this._entityId,text:this.getText()}}_onApply(e){const t=this._frozenStack.get(),n=this._editStack.get();if(!t&&!n){super.applyEdits(vo,Mr(e));return}const r=t&&Ea(t,e,"after"),o=t?r&&Ea(e,t,"before"):e,i=n&&o&&Ea(n,o,"after"),s=n?i&&o&&Ea(o,n,"before"):o;if(t&&!r||n&&!i||!s){const a=Gt(t,n??[]);this._editStack.clear(),this._frozenStack.clear(),this._setSaveHeld(!1),super.applyEdits(vo,Mr(Gt(Yn(a),e))),this._finishBarrier(!0);return}try{this._applyingRemote=!0,super.applyEdits(vo,Mr(s))}finally{this._applyingRemote=!1}r&&this._frozenStack.replace(r),i&&this._editStack.replace(i)}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){if(!(this._frozenStack.hasChanges()&&this._versionController.hasRevertedAwaiting())&&(this._releaseBarrier(),this._pendingSave!==null)){const e=this._pendingSave;this._pendingSave=null,this.saveChanges(e),this._onPendingSentEmitter.fire()}}_setSaveHeld(e){const t=this._saveHeld&&!e;this._saveHeld=e,e||(this._heldUndoStop=!1),t&&this._onPendingSentEmitter.fire()}_isSent(e=!1){return this._pendingSave===null&&!this._frozenStack.hasChanges()&&(e||!this._saveHeld)}whenSent(e=!1){return this._isSent(e)?Promise.resolve():new Promise(t=>{const n=this._onPendingSentEmitter.event(()=>{this._isSent(e)&&(n.dispose(),t())})})}_countUnsent(){const e=(this._frozenStack.get()?.length??0)+(this._editStack.get()?.length??0);return this._versionController.countDispatched()+e}_onEchoLost(e,t){this._echoLost=!0;const n=this._countUnsent();Ir("echo-timeout",()=>({at:"update-entity",unsent:n})),this._onEchoLostEmitter.fire()}async whenSynced(){await this.collectCanvasEdits();let e=0;for(;;){if(this._echoLost)return{synced:!1,unsent:this._countUnsent()};if(this._saveHeld&&e++<mg&&this.saveChanges(!0,!0),await new Promise(t=>{const n=this._onEchoLostEmitter.event(()=>r()),r=()=>{n.dispose(),t()};this.whenSent(!0).then(r)}),this._echoLost)return{synced:!1,unsent:this._countUnsent()};if(!(this._pendingSave!==null||this._saveHeld&&e<mg)){if(!this._versionController.hasDispatched())return{synced:!0,unsent:0};await new Promise(t=>{const n=this._versionController.onEmpty(()=>o()),r=this._onEchoLostEmitter.event(()=>o()),o=()=>{n.dispose(),r.dispose(),t()}})}}}_reportSyncDrift(e){if(this.hasChanges()||this._versionController.hasDispatched())return;const t=tk(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;Ir("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}applyEdits(e,t){if(!this._reverting){const n=bo(t,this);this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){return t?this._editStack.correctOffset(this._frozenStack.correctOffset(e,!0),!0):this._frozenStack.correctOffset(this._editStack.correctOffset(e))}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}saveChanges(e=!0,t=!1){if(!this._reverting&&this._rev!==null&&(this._versionController.hasDispatched()||this._frozenStack.hasChanges()))return this._editStack.hasChanges()&&(this._pendingSave=(this._pendingSave??!1)||e),!0;if(this._reverting)return!1;if(!t&&this._beforeSaveEmitter.fire(e)===!1)return this._heldUndoStop||(this._heldUndoStop=e),this._setSaveHeld(this._editStack.hasChanges()),!1;if(!this._entityId)return!1;const n=this._editStack.get()?.flatMap(r=>hh(r));return n&&(this._editStack.clear(),this._dispatch(this._entityId,n,e)),this._setSaveHeld(!1),!0}_dispatch(e,t,n){const r=this._nextChangeId++;this._versionController.append(t,r);const o={guid:e,pushUndoStop:n,edits:Mr(t),changeId:r,...this._rev!==null?{baseRev:this._rev}:{}},i=()=>K.send(ke.APPLICATION_UPDATE_ENTITY,o);i(),this._echoWatchdog.watch(r,()=>{i()})}async sendAfterCurrentEdits(e,t=!1){const n=this._entityId;for(;this._frozenStack.hasChanges()&&this._editStack.hasChanges();)if(await new Promise(o=>{const i=this._onPendingSentEmitter.event(()=>{i.dispose(),o()})}),this._entityId!==n)return!1;const r=this._frozenStack.hasChanges();if(!r&&this._rev!==null&&this._editStack.hasChanges()&&this._versionController.hasDispatched())this._frozenStack.replace(this._editStack.get()??[]),this._editStack.clear(),this._frozenUndoStop=this._undoStopOfUnsent(t),this._pendingSave=null;else if(!r)return this._editStack.hasChanges()&&this.saveChanges(this._undoStopOfUnsent(t)),e(),!0;return new Promise(o=>{this._barrierSends.push(e),this._barrierResolves.push(o)})}_undoStopOfUnsent(e){return e||(this._pendingSave??(this._saveHeld&&this._heldUndoStop))}_releaseBarrier(){const e=this._frozenStack.get();e&&(this._frozenStack.clear(),this._entityId&&this._dispatch(this._entityId,e.flatMap(t=>hh(t)),this._frozenUndoStop),this._finishBarrier(!0))}_finishBarrier(e){const t=this._barrierSends,n=this._barrierResolves;this._barrierSends=[],this._barrierResolves=[],e&&t.forEach(r=>r()),n.forEach(r=>r(e)),this._onPendingSentEmitter.fire()}saveChangesAsync(e=!0){return new Promise(t=>{if(this.saveChanges(e),!this.hasChanges()||!this._isSent()){t();return}const n=setTimeout(()=>{r.dispose(),this._reportSaveTimeout(),t()},Ak),r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})})}_reportSaveTimeout(){Ir("save-timeout",()=>({}))}hasChanges(){return this._editStack.hasChanges()||this._frozenStack.hasChanges()}},_k=class extends fg{constructor(e,t){super(),L(this,"_baseDocument",void 0),L(this,"_mappedDocument",void 0),L(this,"_mappings",[]),L(this,"_cachedMappedDocument",new La),this._baseDocument=e,this._mappedDocument=t,this._baseDocument.onChanged(this._onBaseChange.bind(this),Number.MAX_SAFE_INTEGER),this._mappedDocument.onChanged(this._onMappedChange.bind(this),Number.MAX_SAFE_INTEGER)}_onBaseChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=this._baseDocument.getText(),r=bo(this.getMappings(n),this._baseDocument),o=Yn(this._mappings);if(t=Gt(o,t),t=Gt(t,r),this._mappings=r,t.length){const i=Mr(t);this._mappedDocument.applyEdits(e,Sa(i))}}}correctOffset(e,t){const n=t?this._mappings:Yn(this._mappings),r=Vc(n,({oldPosition:i})=>i>=e),o=r>0?n[r-1]:void 0;return o&&(o.oldEnd>e?e+=o.newPosition-o.oldPosition:e+=o.newEnd-o.oldEnd),e}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}getMappedReplacementRangeAtPosition(e){const t=Yn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Yn(this._mappings).some(({oldPosition:t,oldEnd:n})=>t<e.end&&n>e.start)}isMappedElementInPosition(e){return!!this._mappings.find(t=>t.newPosition<e&&t.newEnd>e)}escape(e,t){const n=this.getMappings(e,!1,t);return Ai(e,n)}unescape(e){const t=this.getRevertMappings(e);return Ai(e,t)}registerMatcherPair(e){const t=super.registerMatcherPair(e);this.rebuildFromBase();let n=!1;return{dispose:()=>{n||(n=!0,t.dispose(),this.rebuildFromBase())}}}rebuildFromBase(e=vo){const t=this._baseDocument.getText(),n=this.getMappings(t),r=Ai(t,n);this._mappings=bo(n,this._baseDocument),this._mappedDocument.getText()!==r&&this._mappedDocument.applyEdits(e,[{range:{start:0,end:this._mappedDocument.getLength()},text:r}])}_onMappedChange({source:e,changes:t}){if(e!=="FROM_REMOTE"){const n=this._mappedDocument.getText(),r=bo(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=Gt(o,t),t=Gt(t,r),this._mappings=Yn(r),t.length){const i=Mr(t);this._baseDocument.applyEdits(e,Sa(i))}}}};function kk(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function xi(e){let t=e.head;if(!t){t=e.createElement("head");const n=kk(e);n.insertBefore(t,n.firstChild)}return t}function Lk(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function Nk(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function xk(e){const t=xi(e);if(!e.querySelector("style[amp4email-boilerplate]")){const n=e.createElement("style");n.setAttribute("amp4email-boilerplate",""),n.innerHTML="body{visibility:hidden}",t.prepend(n)}}var pg="amp-custom";function Ok(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function hg(e,t,n){for(const r of t)if(_i.isStyleRule(r)){const o=r.selectorText.split(/\+>~/).flatMap(i=>i.trim().split(" "));if(o.length===1&&o[0].trim().startsWith(".em-")){for(const i of r.style)if(r.style.getPropertyPriority(i)==="important"){for(const s of e.querySelectorAll(r.selectorText))if(yu(s)){const a=s.style;for(const l of[...a])if(l.startsWith(i)){const c=n(l,a.getPropertyValue(l)),u=s.getAttribute("class");s.setAttribute("class",u?`${c} ${u}`:c),a.removeProperty(l)}}}}}else _i.isMediaRule(r)&&hg(e,r.cssRules,n)}function gg(e,t){const n=t.sheet;if(n){const i=new Set;hg(e,n.cssRules,(s,a)=>{const l=Ok(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>_i.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
|
|
3
|
+
.${l} { ${s}: ${a} };
|
|
4
|
+
${t.innerHTML}`),l}),i.size&&(t.innerHTML=`
|
|
5
|
+
${[...i].join(`
|
|
6
|
+
`)};
|
|
7
|
+
${t.innerHTML}`)}const r=t.innerHTML,o=r.replace(/!important/g,"");r!==o&&(t.innerHTML=o)}function Rk(e){const t=xi(e),n=e.querySelectorAll('link[rel="stylesheet"]'),r=[...e.querySelectorAll("style")].filter(i=>!i.hasAttribute("amp4email-boilerplate"));if(r.length===1){const i=r[0];if(i.parentElement===t&&i.getAttribute(pg)===""){gg(e,i);return}}const o=[];for(const i of r)o.push(i.innerHTML),i.remove();if(o.length){const i=e.createElement("style");i.innerHTML=`
|
|
8
|
+
${o.join("")}
|
|
9
|
+
`,i.setAttribute(pg,""),t.append(i),gg(e,i)}for(const i of n)i.remove()}var xu="<!doctype html>";function Mk(e){const t=e.doctype;if(t){if(_h(t)===xu)return;const n=new DOMParser().parseFromString(xu,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString(xu,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function bg(e,t={}){const n=document.createElement("amp-img"),r=await NT(e)||void 0,o=[];try{let i=e;for(;i&&yu(i);)getComputedStyle(i)?.display==="none"&&(i.style.display="initial",o.push([i,i.style.display])),i=i.parentElement;const s=r?.height?`${parseInt(r.height)}`:"",a=r?.width?`${parseInt(r.width)}`:"",l=Nk(e);let c=!1;if(l){const d=l.getAttribute("width");try{let f=a?`${a}px`:"";d||(l.setAttribute("width","720px"),f=getComputedStyle(e).width||""),l.setAttribute("width",!d||parseInt(d)>320?"320px":"720px"),f!==(getComputedStyle(e).width||"")&&(c=!0)}finally{d&&l.setAttribute("width",d||"")}}const u=e.src||e.srcset.split(",")[0];e.style.width==="100%"&&e.style.removeProperty("width"),e.style.maxWidth==="100%"&&e.style.removeProperty("max-width"),t={...Lk(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))Gn(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function Pk(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push(bg(i).then(s=>[i,s],()=>[i,void 0]));const o=[...e.querySelectorAll("picture")];for(const i of o){const s=i.querySelector("img");s?r.push(bg(s).then(a=>[i,a],()=>[i,void 0])):r.push([i,void 0])}if(r.length){const i=await Promise.all(r);for(const[s,a]of i)a?s.replaceWith(a):s.remove();t?.()}}function Ik(e){const t=e.querySelectorAll("meta");for(const o of t){const i=o.getAttribute("charset");if(i){i!=="utf-8"&&o.setAttribute("charset","utf-8");return}}const n=xi(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function Dk(e,t,n){const r=n('script:not([type="application/ld+json"])'),o=e.querySelectorAll(r);for(const i of o)!i.getAttribute("src")?.startsWith("https://cdn.ampproject.org/")&&!(i.closest("amp-state")&&i.getAttribute("type")==="application/json")&&i.remove()}var yg="https://cdn.ampproject.org/v0",vg=`${yg}.js`,Bk=`script[src='${vg}']`;function Hk(e,t){return`${yg}/${e.toLowerCase()}-${t}.js`}async function Fk(e,t,n){for(const{name:r,versions:o}of t){const i=n.replaceSelectors(r==="amp-mustache"?`script[async][custom-template='${r}']`:`script[async][custom-element='${r}']`);if(!e.querySelector(i)){const s=xi(e),a=n.createElementFn("script"),l=Hk(r,o.findLast(c=>c!=="latest")||"v0");a.setAttribute("async",""),a.setAttribute(r==="amp-mustache"?"custom-template":"custom-element",r),a.setAttribute("src",l),s.appendChild(a),s.appendChild(e.createTextNode(`
|
|
10
|
+
`))}}}var yj=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),vj=function(e,t){return new URL(e,t).href},Ej={},Ou=function(t,n,r){let o=Promise.resolve();if(0)var s,a;function i(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return o.then(l=>{for(const c of l||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})},Eg=void 0;async function Ra(){return Eg||(Eg=await Ou(()=>Promise.resolve().then(()=>Hc("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var Ru=new Map;async function $k(){if(!Ru.size){const e=await Ra(),t=e.tags;for(let n=0;n<t.length;n++){const r=t[n],{selector:o,attrs:i,attrLists:s}=r,a=s?.flatMap(l=>e.attrLists.filter(({name:c})=>c===l).flatMap(c=>c.attrs))||[];Ru.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return Ru}var Mu=new Map;async function Wk(){if(!Mu.size){const e=await Ra();for(const t of e.declarations)Mu.set(t.name,t)}return Mu}var qk="$GLOBAL_ATTRS",Pu=new Map;async function zk(){if(!Pu.size){const e=(await Ra()).attrLists.find(t=>t.name===qk)?.attrs;if(e)for(const t of e)Pu.set(t.name,t)}return Pu}function Uk(e){return kn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function Sg(e){return _T(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function wg(e,t,n){if(!t)return;function r(){const i=t.compareDocumentPosition(e);if(!(i&8)){if(i&2)return t.insertBefore(e,t.firstChild),!0;if(i&4)return t.appendChild(e),!0}return!1}function o(){const i=[...e.childNodes];for(let s=i.length-1;s>=0;s--)wg(i[s],t,n)}if(kn(e))switch(e.tagName.toLowerCase()){case"body":return;case n("script"):case"style":case"meta":case"title":return;case"head":case"html":o();break;default:r()||o()}else vu(e)?o():ki(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&ki(e.nextSibling))&&r()}async function Vk(e,t){const n=new Set,r=t.commit,o=p=>t.replaceSelectors(p.toLowerCase());if(t.replaceImages&&await Pk(e,r),t.injectExtensions){const p=t.replaceSelectors(Bk);if(!e.querySelector(p)){const m=t.createElementFn("script");m.setAttribute("src",vg),m.setAttribute("async",""),xi(e).appendChild(m),r?.()}}t.injectRequiredTags&&(Dk(e,t.createElementFn,o),Mk(e),xk(e),Ik(e),r?.()),t.replaceStylesAndLinks&&(Rk(e),r?.());const i=await Ra(),s=await $k(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[p,m]of s)if(!m.deprecation){p=o(p);let h=[...e.querySelectorAll(p)].filter(y=>!l.has(y));m.unique&&h.length&&(h=[h[0]]),t.injectRequiredTags&&m.required&&!h.length&&(h=[...h,t.createElementFn(m.name)]);for(const y of h){if(t.injectRequiredAttributes&&y.getAttribute("on")&&!y.getAttribute("tabindex")&&y.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let A=!1;for(const k of[...y.classList])k.startsWith("i-amphtml")&&(A=!0,y.classList.remove(k));A&&!y.classList.length&&y.removeAttribute("class")}const w=l.get(y);w&&w.priority>m.priority||l.set(y,m)}}r?.();for(const[p,m]of l){if(t.injectExtensions&&m.requiresExtension)for(const w of m.requiresExtension)n.add(w);const h=m.requiredParent?m.requiredParent==="$ROOT"?e:e.querySelector(m.requiredParent):null;h&&(!p.parentNode||t.moveInvalidTagPosition)?h!==p.parentNode&&(m.name==="HEAD"||kn(h)&&h.tagName==="HEAD"?h.insertBefore(p,h.firstChild):h.appendChild(p)):p.parentNode||e.body.appendChild(p),t.removeUnsupportedTags&&a.delete(p),r?.();const y=await zk();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const w=m.attrs,A=t.injectRequiredAttributes?new Set([...w].map(([b,v])=>v).filter(b=>b.required&&b.value)):void 0,k=p.getAttributeNames();for(const b of k){const v=w.get(b)||y.get(b);if(v){if(b==="id"||b==="class"||b==="style"){A?.delete(v);continue}if(t.removeUnsupportedAttributes){const S=p.getAttribute(b);if(v.value&&v.value.indexOf(S)<0){p.removeAttribute(b);continue}if(v.valueRegex&&!new RegExp(v.valueRegex).test(S)){p.removeAttribute(b);continue}if(v.disallowedValueRegex&&new RegExp(v.disallowedValueRegex).test(S)){p.removeAttribute(b);continue}const T=v.valueUrl;if(T){if(S===""){if(!T.allowEmpty){p.removeAttribute(b);continue}}else if(!(S.indexOf("<!--")>0&&S.indexOf("-->")>0)){if(!T.allowRelative)if(S.startsWith("#")||S.startsWith("/")){p.removeAttribute(b);continue}else{const g=T.protocol.length?T.protocol:["https"],E=S.substring(0,S.indexOf(":"));if(E){if(g.indexOf(E)<0){const C=g[0]+S.substring(S.indexOf(":"));if(URL.canParse(C))Gn(p,b,C);else{p.removeAttribute(b);continue}}else if(!URL.canParse(S)){p.removeAttribute(b);continue}}else{const C=g[0]+S;if(URL.canParse(C))Gn(p,b,C);else{p.removeAttribute(b);continue}}}}}}A?.delete(v)}else{if(b==="id"||b==="class"||b==="style")continue;t.removeUnsupportedAttributes&&p.removeAttribute(b)}}if(A)for(const b of A)Gn(p,b.name,b.value[0])}r?.()}t.moveInvalidTagPosition&&(wg(e,e.body,o),r?.());for(const p of a)p.remove();if(r?.(),t.removeUnsupportedStyles){let h=function(b){const v=b.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const S of v){if(!S)continue;const T=b.getPropertyValue(S);b.getPropertyPriority(S)==="important"&&b.setProperty(S,T);const g=m.get(S);g?g.value?g.value.indexOf(T)<0&&b.removeProperty(S):g.valueRegex&&(new RegExp(g.valueRegex).test(T)||b.removeProperty(S)):b.removeProperty(S)}r?.()},y=function(b){return b.constructor.name==="CSSStyleRule"},w=function(b){return b.constructor.name==="CSSMediaRule"},A=function(b){const v=b.cssRules;for(let S=v.length-1;S>=0;S--){const T=v[S];y(T)?T.selectorText.indexOf("[")>=0||T.selectorText.indexOf(":")>=0?b.deleteRule(S):(h(T.style),T.style.cssText||b.deleteRule(S)):w(T)?(A(T),T.cssRules.length||b.deleteRule(S)):b.deleteRule(S)}};var c=h,u=y,d=w,f=A;const p=e.querySelectorAll("*"),m=await Wk();for(const b of p)if(yu(b)){const v=b.getAttribute("style");v&&(h(b.style),b.style.length?b.style.cssText!==v&&b.setAttribute("style",b.style.cssText):b.removeAttribute("style"))}const k=e.querySelector("style[amp-custom]");if(k){const b=k.sheet;b&&(A(b),k.innerHTML=[...b.cssRules].map(v=>v.cssText).join(`
|
|
11
|
+
`)),r?.()}}await Fk(e,i.extensions.filter(({name:p})=>n.has(p)),t)}function jk(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function Cg(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return Vk(e,{replaceImages:n,replaceStylesAndLinks:n,injectRequiredTags:n,injectExtensions:r,formsAsAmpForms:r,injectRequiredAttributes:n,moveInvalidTagPosition:n,removeUnsupportedTags:n,removeUnsupportedAttributes:n,removeUnsupportedStyles:n,createElementFn:i=>e.createElement(o[i.toLowerCase()]||i),replaceSelectors:i=>jk(i.toLowerCase(),o),commit:t.commit})}function Iu(){K.send(ke.RELOAD),window.location.reload()}function Gk(e){const t=new Ae;let n=[];function r(){n=[...new Set([...n,...document.querySelectorAll("script")])].filter(s=>N0(s)&&e.isInLetter(s));const i=new Set;for(const s of n){const a=(s.src||s.innerHTML).trim();a&&i.add(a)}return i}let o=r();return t.addDisposable(K.addListener(ke.RELOAD,Iu)),t.addDisposable(e.onChange(()=>{let i=r();for(const s of o)i.has(s)||Iu();o=i})),t}var Ma=[];function Xk(e){return Ma.push(e),{dispose:()=>{const t=Ma.indexOf(e);t!==-1&&Ma.splice(t,1)}}}function Du(e){for(const t of Ma){const n=t(e);if(n)return n}return e}function Yk(){const e=document.querySelector("[em-edit]");return e?Du(e):null}var Pa=new Set(["img","image","input","video","source","em-replace"]);function Ag(e){const t=e.toLowerCase(),n=Pa.has(t);return Pa.add(t),{dispose:()=>{n||Pa.delete(t)}}}function Kk(e){return Pa.has(e.toLowerCase())}var Oi=[];function Zk(e){return Oi.push(e),{dispose:()=>{const t=Oi.indexOf(e);t!==-1&&Oi.splice(t,1)}}}function Tg(e){return Oi.some(t=>t.isPathElement?.(e))}function Qk(e,t){let n;for(const r of Oi){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function _g(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var Jk={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||_g(e)},caption(e,t){if(e.tagName==="AMP-ACCORDION")return{title:t.ELEMENT_PATH_ACCORDION,className:"em-element-path-item-amp"};if(e.tagName==="AMP-CAROUSEL")return{title:t.ELEMENT_PATH_CAROUSEL,className:"em-element-path-item-amp"};if(_g(e))return{title:t.ELEMENT_PATH_SECTION,className:"em-element-path-item-block"};if(e.tagName==="IMG"&&e.closest("amp-carousel"))return{title:t.ELEMENT_PATH_CAROUSEL}}},eL=class extends Ae{constructor(...e){super(...e),L(this,"hasAmp",!1)}};function tL(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function nL(e,t,n){const r=tL(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function rL(){const e=new Ae;return e.addDisposable(rT(t=>t.startsWith("amp"))),e.addDisposable(oT(t=>t==="class"||t==="style")),e}function oL(e){const t=o=>Sg(o)&&e.getOuterHtml(o)!==""||Uk(o)||TT(o),n=o=>{if(t(o))return!0;if(kn(o)||vu(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new eL;return r.addDisposable(Xk(o=>o.closest("amp-img"))),r.addDisposable(Zk(Jk)),r.addDisposable(rL()),r.addDisposable(Ag("amp-img")),r.addDisposable(Ag("amp-anim")),r.addDisposable(e.onChange(o=>{let i=r.hasAmp,s=!1;for(const a of o){if(a.added.some(l=>n(l))){s=!0,i=!0;break}if(a.removed.some(l=>n(l))){i=n(document);break}}r.hasAmp!==i?(r.hasAmp=i,K.send(ke.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)Cg(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)Sg(l)&&l.remove();Iu()}})):s&&setTimeout(()=>{Cg(document,{correct:!1})})})),r.addDisposable(K.addListener(o=>{if(o.data?.operation==="sandbox_element_settings_set"){const i=document.querySelector("[em-edit]");if(i){const s=o.data?.settings?.ampShow;s!==void 0&&(nL(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function iL(e,t){const n=oL(t);return e.inject(ru,n),{service:n,dispose(){n.dispose(),cn(e,ru)}}}var sL={name:"sandbox.amp",provides:[ru],awaits:{services:[J]},setup(e){const{service:t}=iL(e,D(e,J));e.addService(eh,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,f,p,m,h,y=!0,w=!1,A;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(y=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(w=r.autosemicolon);function k(E){return E===" "||E===`
|
|
12
|
+
`||E===" "||E==="\r"||E==="\f"}function b(E){return E==="'"||E==='"'}function v(E){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(E)>=0}function S(){for(var E=p;E>0;E-=1)a+=r.indent}function T(){a=A(a),y?a+=" {":(a+=`
|
|
13
|
+
`,S(),a+="{"),c!==`
|
|
14
|
+
`&&(a+=`
|
|
15
|
+
`),p+=1}function g(){var E;p-=1,a=A(a),a.length>0&&w&&(E=a.charAt(a.length-1),E!==";"&&E!=="{"&&(a+=";")),a+=`
|
|
16
|
+
`,S(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?A=function(E){return E.trimRight()}:A=function(E){return E.replace(/\s+$/,"")},f={Start:0,AtRule:1,Block:2,Selector:3,Ruleset:4,Property:5,Separator:6,Expression:7,URL:8},p=0,d=f.Start,h=!1,s=[],t=t.replace(/\r\n/g,`
|
|
17
|
+
`);o<i;){if(l=t.charAt(o),c=t.charAt(o+1),o+=1,b(m)){a+=l,l===m&&(m=null),l==="\\"&&c===m&&(a+=c,o+=1);continue}if(b(l)){a+=l,m=l;continue}if(h){a+=l,l==="*"&&c==="/"&&(h=!1,a+=c,o+=1);continue}if(l==="/"&&c==="*"){h=!0,a+=l,a+=c,o+=1;continue}if(d===f.Start){if(s.length===0&&k(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=f.Start,a+=l;continue}if(v(l)||l==="@"){if(u=A(a),u.length===0)s.length>0&&(a=`
|
|
18
|
+
|
|
19
|
+
`);else if(u.charAt(u.length-1)==="}"||u.charAt(u.length-1)===";")a=u+`
|
|
20
|
+
|
|
21
|
+
`;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);a+=l,d=l==="@"?f.AtRule:f.Selector;continue}}if(d===f.AtRule){if(l===";"){a+=l,d=f.Start;continue}if(l==="{"){u=A(a),T(),d=u==="@font-face"?f.Ruleset:f.Block;continue}a+=l;continue}if(d===f.Block){if(v(l)){if(u=A(a),u.length===0)s.length>0&&(a=`
|
|
22
|
+
|
|
23
|
+
`);else if(u.charAt(u.length-1)==="}")a=u+`
|
|
24
|
+
|
|
25
|
+
`;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);S(),a+=l,d=f.Selector;continue}if(l==="}"){g(),d=f.Start;continue}a+=l;continue}if(d===f.Selector){if(l==="{"){T(),d=f.Ruleset;continue}if(l==="}"){g(),d=f.Start;continue}a+=l;continue}if(d===f.Ruleset){if(l==="}"){g(),d=f.Start,p>0&&(d=f.Block);continue}if(l===`
|
|
26
|
+
`){a=A(a),a+=`
|
|
27
|
+
`;continue}if(!k(l)){a=A(a),a+=`
|
|
28
|
+
`,S(),a+=l,d=f.Property;continue}a+=l;continue}if(d===f.Property){if(l===":"){a=A(a),a+=": ",d=f.Expression,k(c)&&(d=f.Separator);continue}if(l==="}"){g(),d=f.Start,p>0&&(d=f.Block);continue}a+=l;continue}if(d===f.Separator){if(!k(l)){a+=l,d=f.Expression;continue}b(c)&&(d=f.Expression);continue}if(d===f.Expression){if(l==="}"){g(),d=f.Start,p>0&&(d=f.Block);continue}if(l===";"){a=A(a),a+=`;
|
|
29
|
+
`,d=f.Ruleset;continue}if(a+=l,l==="("&&a.charAt(a.length-2)==="l"&&a.charAt(a.length-3)==="r"&&a.charAt(a.length-4)==="u"){d=f.URL;continue}continue}if(d===f.URL&&l===")"&&a.charAt(a.length-1!=="\\")){a+=l,d=f.Expression;continue}a+=l}return a=s.join("")+a,a}window.cssbeautify=e})();function aL(e,t,n){n.state.update({iframeOffsetTop:e.iframeOffsetTop,scrollTop:e.scrollTop,previewHeight:e.previewHeight,applicationMode:e.mode}),typeof t<"u"&&n.state.set("codeMode",e.mode==="code");const r=document.querySelector(".em-element-path");r&&(r.style.top=n.previewHeight-n.iframeOffsetTop-65+n.scrollTop+"px");const o=document.querySelector(".em-editor-wrapper");o&&o.style.display==="none"?n.setBlockGroupControlsPosition():setTimeout(()=>{n.setBlockGroupControlsPosition()},400)}var lL=["transform","transform-origin","overflow-x","height"];function cL(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function Ri(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of lL)e.style.removeProperty(r);return n?(e.style.overflowX="visible",e.style.transformOrigin="left top",e.style.transform=n):e.getAttribute("style")||e.removeAttribute("style"),!0}function uL(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(Ri(t,1),t.scrollWidth)}function dL(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=cL(uL(e,n),t.innerWidth);return Ri(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function fL(e,t){Ri(document.documentElement,1);const n=t.globalHolder?.querySelector("table:first-child");if(n&&n.offsetWidth>=e.iframeWidth-2&&t.globalHolder){const r=e.iframeWidth/t.globalHolder.offsetWidth;Ri(document.documentElement,r),document.querySelector(".em-narrow-table")&&e.iframeWidth>370&&t.messageService.send({operation:"application_preview_alert_show",settings:{show:r<.9}})}setTimeout(()=>{t.messageService.send({operation:"application_iframe_set_height",settings:{height:document.body.getBoundingClientRect().height}})},300)}function ct(e){const t=D(e,Oe);return n=>{t.commit(n)}}function Mi(){return D(Tt,J)}function mL(){return D(Tt,gt)}function pL(){return D(Tt,an)}function Ia(){return Tt.getInstance(J)!==void 0}function Hr(e){D(Tt,Oe).commit(e)}function hL(e){if(!Ia())return e(),Promise.resolve(!0);const t=Mi();return t.commit(!1),t.flushCommit(),t.sendAfterCurrentEdits(e)}function Da(e){return e.nodeType===1&&e.localName==="template"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function Bu(e){return[...e.querySelectorAll?.("template")??[]].filter(Da)}function gL(e){return Da(e)||Bu(e).length>0}function Yt(e){const t=[...Da(e)?[e]:[],...Bu(e)];for(const n of t)if(n.content.firstChild){for(;n.content.firstChild;)n.appendChild(n.content.firstChild);for(const r of n.children)Yt(r)}}function Fr(e){const t=[...Da(e)?[e]:[],...Bu(e)];for(const n of t)for(;n.firstChild;)n.content.appendChild(n.firstChild)}function Ln(){return Ia()?Mi():void 0}function It(e){const t=Ln();return t?t.applyHidden(e):e()}function ze(e,t,...n){e&&It(()=>t?e.classList.add(...n):e.classList.remove(...n))}function $r(e){const t=document.activeElement;t instanceof HTMLElement&&t!==document.body&&e.contains(t)&&It(()=>t.blur())}function kg(e){Ln()?.ownership.markService(e)}function Pi(e,t){e.removeAllRanges(),It(()=>e.addRange(t))}function Ba(e){const t=document.implementation.createHTMLDocument("").importNode(e,!0),n=new Map([[e,t]]),r=Ln()?.ownership,o=(i,s)=>{const a=[...s.childNodes];i.childNodes.forEach((l,c)=>{const u=a[c];n.set(l,u),o(l,u),r?.isOffModel(l)&&u.replaceWith(...u.childNodes)})};return o(e,t),Fr(t),{copy:t,counterpart:i=>n.get(i)}}function Ha(e){return Ba(e).copy.outerHTML}function Ue(e){return Ba(e).copy.innerHTML}function Ii(e){const t=Ln();return t?(t.flushCommit(),t.getOuterHtml(e)):e.outerHTML}function Hu(e){const t=Ln();return!t||t.isInLetter(e)||!t.isUntracked(e)&&!t.ownership.isService(e)}function Fu(e,t){const n=[...e.querySelectorAll(t)].filter(Hu);return n[n.length-1]??null}function Lg(e,t){const n=o=>t==="next"?o.nextElementSibling:o.previousElementSibling;let r=n(e);for(;r&&!Hu(r);)r=n(r);return r}function Ng(e,t){return[...e.childNodes].flatMap(n=>t.isInLetter(n)?[n]:Ng(n,t))}function $u(e){$r(e);const t=Ln();if(!t)return;t.flushCommit();const n=[...e.querySelectorAll("*")].filter(r=>t.ownership.markOf(r)==="service");for(const r of n)e.contains(r)&&r.replaceWith(...Ng(r,t))}function bL(e){const t=[...e.childNodes],n=Ln();if(!n)return t;let r;for(const o of n.letterChildren(e))o.isConnected||t.splice(r?t.indexOf(r)+1:0,0,o),r=o;return t}function yL(){const e=Ln();return e?{...e.scriptRunner,awake:()=>e.recordNow()}:{run:(t,n)=>n(),quiet:t=>t()}}function Zn(e,t){const n=Ie(e,"dormant"),r=Dp(n);try{return t(n)}finally{zp(r,yL())}}function xg(e,t,n){Zn(n,r=>la(e,t,r))}function Di(e,t,n){return e==="new"?Zn(t,n):n(Ie(t,!0))}function Qn(e,t,n,r){Di(e,r,o=>la(t,n,o))}function _t(e){return function(...t){const n=Ln(),r=()=>Reflect.apply(e,this,t);return n?n.applyOwn(r):r()}}function To(e,t=!1,n){const r=()=>document.execCommand(e,t,n),o=Ln();return o?o.applyCommand(r):r()}function Wu(e,t){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){const i=e,s=t;return i.length===s.length&&i.every((a,l)=>Wu(a,s[l]))}const r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.prototype.hasOwnProperty.call(t,i)&&Wu(e[i],t[i]))}function Og(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&Wu(o,a)||(o=a,i=!0,r(a))})},select(r){return Og(n,r)}};return n}function Rg(...e){let t=e[0],n=e.length>0;const r=new Set,o={get(){return n?t:void 0},set(i){t=i,n=!0;for(const s of Array.from(r))s(i)},watch(i){return r.add(i),n&&i(t),{dispose:()=>r.delete(i)}},select(i){return Og(o,i)}};return o}var Fa={lockEditorInit:!0,lockEdit:!1,lockEditor:!0,activeElementLocked:0,applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],activeElementText:"",selectedElem:null,iframeOffsetTop:0,scrollTop:0,copyPasteEnabled:!0,saveBlockEnabled:!0,editImageControlEnabled:!0,elementAIimageEnabled:!0,imageCenterStockEnabled:!0,imageCenterGifEnabled:!0,imageCenterEditorEnabled:!0,blocksAddPanelEnabled:!0,codeMode:!0,appName:"",isLeftButtonDown:!1,isProgrammaticSelection:!1,isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1,actualTargetCount:0,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},Bi=Rg({...Fa});function Kt(){return Bi.get()}var $a=new _e,_o=new Map,O={source:Bi,get(e){return Kt()[e]},getState(){return{...Kt()}},getStateRef(){return Kt()},set(e,t){if(Kt()[e]===t)return;Bi.set({...Kt(),[e]:t}),$a.fire({[e]:t});const n=_o.get(e);n&&n.forEach(r=>r(t))},update(e){let t=!1;const n={};for(const r of Object.keys(e)){const o=e[r];if(Kt()[r]!==o){Bi.set({...Kt(),[r]:o}),n[r]=o,t=!0;const i=_o.get(r);i&&i.forEach(s=>s(o))}}t&&$a.fire(n)},increment(e,t=1){const n=Kt()[e];typeof n=="number"&&O.set(e,n+t)},decrement(e,t=1){const n=Kt()[e];typeof n=="number"&&O.set(e,n-t)},subscribe(e){return $a.event(e)},subscribeToKey(e,t){_o.has(e)||_o.set(e,new Set);const n=_o.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&_o.delete(e)}},reset(){Bi.set({...Fa}),$a.fire(Kt())},resetKey(e){this.set(e,Fa[e])},isEditingLocked(){const e=Kt();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return Kt().activeElementLocked>0},getInitialState(){return Fa}};function Mg(e){const t=()=>{ze(document.body,e,"mceNonEditable"),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};Ia()?Mi().applyHidden(t):t()}function Hi(){return O.get("lockEdit")||O.get("lockEditor")}function vL(){return O.subscribe(e=>{"lockEditor"in e&&Mg(Hi())})}function EL(e){return e.beforeChange(({domMutations:t})=>{const n=t.flatMap(r=>r.type==="Add"&&r.node instanceof Element?[r.node]:[]);n.length&&queueMicrotask(()=>{if(!Hi())return;const r=n.flatMap(o=>[...o.tagName==="EDITOR"?[o]:[],...Array.from(o.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const o of r)o.isConnected&&o.setAttribute("contenteditable","false")})})})}function SL(e,t){const n=Rg(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var wL=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function CL(e){const t="8c2b05d7";let n=document.getElementsByTagName("head")[0];!n&&document.documentElement&&(n=document.createElement("head"),document.documentElement.insertBefore(n,document.documentElement.firstChild));const r=`css/sandbox-${e}.css?${t}`,o=e==="light"?"dark":"light",i=document.querySelectorAll(`[href="css/sandbox-${o}.css?${t}"]`);if(!document.querySelector(`[href="${r}"]`)){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",r),n?.appendChild(s)}for(const s of i)s.remove()}var AL={name:"sandbox.hostFacts",provides:[po],setup(e){const t=Object.fromEntries(Object.entries(TA).map(([n,r])=>[n,SL(K,r).source]));e.inject(po,t)}},TL={name:"sandbox.hostFactsToState",awaits:{services:[po,Oe,J]},setup(e){const t=D(e,po),n=ct(e);t.theme.watch(r=>{O.set("applicationTheme",r),CL(r),n(!1)}),t.commonStyles.watch(r=>{r&&O.set("commonStyles",r)}),t.flags.watch(r=>{for(const o of wL)typeof r[o]<"u"&&O.set(o,r[o])}),vL(),EL(D(e,J)),t.lockEditor.watch(r=>O.set("lockEditor",r)),t.codeMode.watch(r=>O.set("codeMode",r)),t.appName.watch(r=>O.set("appName",r)),t.previewPage.watch(r=>{O.set("previewPage",r),ze(document.body,!!r,"em-sandbox-preview")})}},_L={name:"sandbox.viewport",awaits:{services:[po]},setup(e){D(e,po).viewport.watch(t=>aL(t,void 0,{state:O,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:O.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(th).forEach(n=>n()),messageService:K}))}};function ur(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function yt(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function kL(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),ze(document.body,!0,"em-sandbox-discuss");else{const n=Hi()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),ze(document.body,!1,"em-sandbox-discuss","em-sandbox-discuss_set-target")}}function LL(e,t){ze(document.body,!!e.data.value,"em-sandbox-discuss_set-target")}function NL(e,t){const n=e.data.value,r=document.querySelector(`[em-discuss-id="${n}"]`);r&&t.messageService.send({operation:"application_scroll-to",settings:{value:r.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),ze(document.body,!1,"em-sandbox-discuss_set-target"),document.querySelectorAll(".em-discuss-id-new").forEach(o=>{o.removeAttribute("em-discuss-id")}),t.removeAllAttributes("em-edit"),r&&document.querySelectorAll(`[em-discuss-id="${n}"]`).forEach(o=>{o.removeAttribute("em-discuss-id")}),t.commit()}function xL(e,t){ze(document.body,!1,"em-sandbox-discuss_set-target"),document.querySelectorAll(".em-discuss-id-new").forEach(n=>{n.classList.remove("em-discuss-id-new")}),t.removeAllAttributes("em-edit"),t.commit(),setTimeout(()=>{t.messageService.send({operation:"application_discuss_save_target"})},500)}function OL(e,t){const n=e.data.value,r=document.querySelector(`[em-discuss-id="${n}"]`);r?(t.messageService.send({operation:"application_scroll-to",settings:{value:r.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),r.classList.add("em-discuss-target-active"),setTimeout(()=>{r.classList.remove("em-discuss-target-active")},2e3)):t.messageService.send({operation:"application_discuss_no_comment"})}var RL={sandbox_lock_discuss:kL,sandbox_discuss_set_target:LL,sandbox_discuss_remove_target:NL,sandbox_discuss_reset:xL,sandbox_discuss_get_target:OL};function ML(e,t){O.set("lockEdit",!!e.data.data),Mg(Hi())}function PL(e,t){t.setEditorFocus(e.data.data)}function IL(e,t){let n=e.data.data;if(typeof n!="number")return;n=mL().correctOffset(n,!0),n=pL().correctOffset(n,!0);let r=Mi().getElementByPosition(n);if(r&&!(r instanceof Element)&&(r=r.parentElement),!(r instanceof HTMLElement))return;const o=r.getBoundingClientRect();r.tagName!=="BODY"&&o.height&&o.width&&document.querySelector("[em-edit]")!==r&&t.applicationElementSettingsSet({elem:r});const i=r.getBoundingClientRect(),s=i.top-O.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:O.get("applicationMode")==="default"?s+O.get("iframeOffsetTop"):s}})}var DL={sandbox_lock_edit:ML,editor_change_focus:PL,update_position_from_editor:IL};function BL(e,t){document.querySelectorAll("[em-optimise-error]").forEach(n=>{n.removeAttribute("em-optimise-error")}),document.querySelectorAll("img").forEach((n,r)=>{n.setAttribute("em-optimise",`image_${r}`)}),t.commit()}function HL(e,t){document.querySelectorAll("[em-optimise-error]").forEach(n=>{n.removeAttribute("em-optimise-error")}),document.querySelectorAll("a[href]").forEach((n,r)=>{n.setAttribute("em-optimise",`link_${r}`)}),t.commit()}function FL(e,t){const n=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);n&&(e.data.settings.isError&&(n.setAttribute("em-optimise-error","true"),t.commit()),t.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),t.setCursorPosition(n),t.applicationElementSettingsSet({elem:n}))}function $L(e,t){const n=document.querySelector(`[em-optimise="${e.data.settings.elementId}"]`);n&&(t.messageService.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+t.iframeOffsetTop-t.previewHeight/2}}),t.setCursorPosition(n),t.applicationElementSettingsSet({elem:n}),e.data.settings.isError&&n.setAttribute("em-optimise-error","true"),t.commit())}var WL={sandbox_set_attr_to_images:BL,sandbox_set_attr_to_links:HL,sandbox_set_position_to_img:FL,sandbox_set_position_to_link:$L},qL={brightness:100,contrast:100,sepia:0},Wa={DARK:"dark",LIGHT:"light"},Pg=!1;function zL(e){Pg||(e.setFetchMethod(t=>window.fetch(t)),Pg=!0)}function UL(){let e=null,t=Wa.LIGHT;return{set(n){if(t=n,n===Wa.DARK){e??(e=Ou(()=>Promise.resolve().then(()=>Hc("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===Wa.DARK&&(zL(r),r.enable(qL))}).catch(r=>{e=null});return}e?.then(r=>{t===Wa.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var qa=UL();function VL(e,t){t.initPreview(!0)}function jL(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&qa.set(t)}var GL={init_preview:VL,sandbox_switch_theme:jL},qu={increment:e=>O.increment(e),decrement:e=>O.decrement(e)};function un(e,t,n,r){return{name:`sandbox.operations.${e}`,awaits:n,setup(o){const i=r(o),s={};for(const[a,l]of Object.entries(t))l&&(s[a]=c=>l(c,i()));o.addService(nh,{owner:e,handlers:s})}}}var XL={name:"sandbox.operationEnvironment",provides:[lr],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[],lockEdit:!1};O.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath","lockEdit"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(lr,t)}},YL=un("discuss",RL,{services:[Oe,lr]},e=>{const t=ct(e),n=D(e,lr);return()=>({commit:t,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:K,removeAllAttributes:ur})}),KL=un("editor",DL,{services:[He,lt]},e=>{const t=D(e,He),n=D(e,lt);return()=>({applicationElementSettingsSet:t,messageService:K,setEditorFocus:r=>n.setEditorFocus(r)})}),ZL=un("images",WL,{services:[He,At,Oe,lr]},e=>{const t=D(e,He),n=D(e,At),r=ct(e),o=D(e,lr);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:K,setCursorPosition:i=>n(i)})}),QL=un("preview",GL,{services:[wi]},e=>()=>({initPreview:t=>D(e,wi)(t)})),JL={name:"sandbox.operationsDispatcher",setup(e){K.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(nh).map(i=>i.handlers[n]).filter(Boolean).pop();if(!r)return;const o=i=>{};try{Promise.resolve(r(t)).catch(o)}catch(i){o(i)}})}},eN=[XL,YL,KL,ZL,QL,JL],tN=["em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document","em-block-insert_bottom","em-block-insert_top","em-blockatom-insert","em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top","em-block-insert-empty","em-atom-insert-empty","em-block-insert-body","em-atom-insert-body","em-resize-start","sortable-chosen","sortable-ghost","em-vindent-table","em-vindent_low","em-vindent","em-relative","em-display-block","em-sandbox-discuss_set-target","em-sandbox-discuss","em-element-list-bullet","remove-new-editor-element","em-just-inserted","em-native-img-uploading","em-native-img-drop-target","em-native-img-drop-loading","em-native-file-drag"],nN=["style","class","align","href"],rN=new Set([...tN,"em-element-path_img"]);function oN(e){return e.split(/\s+/).filter(t=>t&&!rN.has(t)).join(" ")}var iN=32;function sN(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function aN(e){const t=[e.tagName];for(const n of nN){const r=e.getAttribute(n),o=n==="class"&&r!==null?oN(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function lN(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<iN&&(t.push(aN(n)),!sN(n));)n=n.parentElement,r++;return t.join("||")}function cN(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:lN(r)});return{remember(r){t=n(r)},forget(){t={...t,text:""}},take:n,differs(r){return t.text!==r.text||t.ancestors!==r.ancestors},accept(r){t=r}}}function uN(e){let t=O.get("activeElementLocked");O.subscribe(n=>{if(n.activeElementLocked===void 0)return;const r=t>0&&n.activeElementLocked===0;t=n.activeElementLocked,r&&Promise.resolve().then(()=>{O.get("activeElementLocked")===0&&e.remember(document.querySelector("[em-edit]"))})})}var Ig=Promise.resolve(),Dg=null;function dN(e,t){const{HTMLDocument:n,documentMapping:r,remoteDocument:o,messageService:i}=t;let s=n.getRangeByElement(e,!0);if(s){const a=r.getMappedReplacementRangeAtPosition(s.start)||r.getMappedReplacementRangeAtPosition(Math.max(s.end-1,s.start));a&&(s=a),s=r.correctRange(s),s=o.correctRange(s);const l={operation:"update_position_from_iframe",data:s};i.send(l)}}function fN(e,t){Dg=e,Ig=Ig.finally(()=>{Dg===e&&dN(e,t)})}function mN(e,t="unknown"){const n=Tt.getInstance(lt);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function pN(e){const t=e.innerHTML.trim();return[t===" ",t==="<div> </div>",/^<div[^>]*> <\/div>$/.test(t),/^<[^>]*> <\/[^>]*>$/.test(t),t.replace(/<[^>]*>/g,"").trim()===" ",e.textContent?.trim()===" "||e.textContent?.trim().charCodeAt(0)===160].some(n=>n===!0)}function hN(e){window.getSelection();const t=e.startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t instanceof Element?t:null;if(!n||!n.contains(e.commonAncestorContainer))return!1;const r=n.textContent??"",o=e.toString(),i=r.replace(/\s+/g," ").trim(),s=o.replace(/\s+/g," ").trim();return r===o||i===s}function gN(e,t){const n=t==="sup"?"sub":"sup";e.querySelectorAll(`${t}, ${n}`).forEach(r=>{const o=r.parentNode;if(o){for(;r.firstChild;)o.insertBefore(r.firstChild,r);r.remove()}})}function Bg(e,t,n){const r=document.createElement(n);try{if(typeof t=="string")r.textContent=t||e.toString();else if(t instanceof DocumentFragment)r.appendChild(t);else if(t instanceof HTMLElement)for(;t.firstChild;)r.appendChild(t.firstChild);else r.textContent=e.toString();e.deleteContents(),e.insertNode(r)}catch{return null}return r}function bN(e){const t=e.parentNode;if(!t)return document.createTextNode("");if(Array.from(e.childNodes).some(n=>n.nodeType===1)){const n=document.createDocumentFragment(),r=Array.from(e.childNodes);for(;e.firstChild;)n.appendChild(e.firstChild);return t.replaceChild(n,e),r[0]||document.createTextNode("")}else{const n=e.textContent||"",r=document.createTextNode(n);return t.replaceChild(r,e),r}}function yN(e,t,n){if(!e)return!1;const r=e.textContent?.trim()||"";let o="";if(n){const i=t.cloneRange(),s=i;try{s.expand&&s.expand("word"),o=i.toString().trim()}catch{return!1}}else o=t.toString().trim();return r===o}function vN(e,t){const n=e.textContent||"",r=t.toString(),o=t.startOffset,i=t.endOffset,s=document.createTextNode(n.slice(0,o)),a=document.createTextNode(r),l=document.createTextNode(n.slice(i)),c=e.parentNode;return c&&(c.insertBefore(s,e),c.insertBefore(a,e),l.textContent&&c.insertBefore(l,e),e.remove()),t.setStart(a,0),t.setEnd(a,a.length),a}function EN(e,t=[]){const n=[...new Set(["strong","em","b","i","u","sub","sup","strike",...t])].join(", ");e.querySelectorAll(n).forEach(r=>{!r.textContent?.trim()&&(!r.hasChildNodes()||Array.from(r.childNodes).every(o=>o.nodeType===Node.TEXT_NODE&&!o.textContent?.trim()))&&r.remove()})}function SN(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var wN={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function Fi(e,t){const n=wN[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var CN=["strong","em","strike","sub","sup","b","i","s","u"];function AN(e,t){if(t)for(const n of CN)t.closest(n)&&e.querySelectorAll(n).forEach(r=>{const o=r.parentNode;if(o){for(;r.firstChild;)o.insertBefore(r.firstChild,r);r.remove()}})}function TN(e,t){t&&t.closest("a")&&e.querySelectorAll("a").forEach(n=>{const r=n.parentNode;if(r){for(;n.firstChild;)r.insertBefore(n.firstChild,n);n.remove()}})}var Sj="#1C52DC",wj="#1C52DC",Cj="#1C52DC",zu="data-em-caret",Aj="",ko=e=>e();function Nn(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function Wr(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function dr(e){return(e??"").replaceAll("","")}function _N(e){return dr(e.textContent)}function kN(e){return(e.nodeType===Node.TEXT_NODE||Nn(e))&&dr(e.textContent)===""}function Hg(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r&&Pi(r,n)}function Fg(e){if(!e.collapsed)return null;const{startContainer:t,startOffset:n}=e,r=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest("em-replace");if(!Wr(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),dr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),dr(i.toString())===""?{em:r,side:"after"}:null}function Uu(e,t){if(!e.collapsed)return null;const n=Fg(e);if(n)return n.side===(t==="backward"?"after":"before")?n.em:null;const{startContainer:r,startOffset:o}=e;let i;if(r.nodeType===Node.TEXT_NODE){const s=r.data;if(dr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=Nn(a)?a:r;i=t==="backward"?l.previousSibling:l.nextSibling}else{const s=r.childNodes;i=t==="backward"?s[o-1]??null:s[o]??null}for(;i&&kN(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return Wr(i)?i:null}function za(e,t,n=ko){return $g(e,t,n)}function $g(e,t,n=ko){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(Nn(r))o=r;else{const s=document.createElement("span");s.setAttribute(zu,""),kg(s),s.appendChild(document.createTextNode("")),n(()=>t==="after"?e.after(s):e.before(s)),o=s}let i=o.lastChild;if(!i||i.nodeType!==Node.TEXT_NODE){i=document.createTextNode("");const s=i;n(()=>o.appendChild(s))}return Hg(i,i.length),o}function Ua(e,t=ko,n){const r=Array.from(e.querySelectorAll(`[${zu}]`)).filter(o=>o!==n&&dr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function LN(e,t=ko){const n=dr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),Hg(r,r.length),r}function NN(e){if(!e.collapsed)return;const{startContainer:t}=e,n=Nn(t)?t:t.parentNode;Nn(n)&&(Wr(n.previousSibling)?e.setStartAfter(n):e.setStartBefore(n),e.collapse(!0))}function Wg(e){e.querySelectorAll(`[${zu}]`).forEach(t=>{const n=dr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function xN(e,t){const n=Uu(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o&&Pi(o,r),n}function ON(e,t){const n=Array.from(e.querySelectorAll("em-replace")).find(i=>Wr(i)&&t.intersectsNode(i)&&!qg(t,i));if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o?.removeAllRanges(),o?.addRange(r),n}function qg(e,t){const n=document.createRange();return n.selectNode(t),e.compareBoundaryPoints(e.START_TO_START,n)<=0&&e.compareBoundaryPoints(e.END_TO_END,n)>=0}function RN(){document.execCommand("delete")}function MN(){const e=window.getSelection()?.getRangeAt(0);e?.deleteContents(),e?.collapse(!0)}function zg(e,t=ko,n=RN){if(e.collapsed)return!1;const r=e.commonAncestorContainer,o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement;if(!Array.from(o?.querySelectorAll("em-replace")??[]).some(l=>Wr(l)&&qg(e,l)))return!1;n();const i=window.getSelection();if(!i?.rangeCount)return!0;const{startContainer:s,startOffset:a}=i.getRangeAt(0);if(s.nodeType===Node.ELEMENT_NODE){const l=s.childNodes[a-1]??null,c=s.childNodes[a]??null;Wr(l)?za(l,"after",t):!l&&Wr(c)&&za(c,"before",t)}return!0}function Ug(){const e=window.getSelection();return e?.rangeCount?Uu(e.getRangeAt(0),"backward"):null}function PN(e,t=ko){const n=e.isConnected?e:Ug();if(!n)return;const r=n.closest('[contenteditable="true"]');It(()=>r?.focus({preventScroll:!0})),za(n,"after",t)}var IN="./js/sanitize-html/sanitize-html.js",Vg="data-sanitize-html-loader",Va=null,$i=null;function DN(){return new URL(IN,document.baseURI||window.location.href).href}function Vu(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function BN(){if(Vu())return Promise.resolve();const e=DN();return document.querySelector(`script[${Vg}]`)?$i??Promise.resolve():($i||($i=new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(Vg,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),$i=null,n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})),$i)}async function HN(){const e=Vu();return e||(Va||(Va=(async()=>{await BN();const t=Vu();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw Va=null,t})),Va)}var FN=["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],$N={a:["href"],span:["data-font-size","data-bold","data-italic"],strong:["data-italic"],ul:["data-list-type"],ol:["data-list-type","data-list-start"],li:["data-list-item"]};function WN(e){const t=/^\s*(\d+(?:\.\d+)?)(px|pt|em)?\s*$/i.exec(e??"");return t?`${t[1]}${(t[2]||"px").toLowerCase()}`:null}function qN(e){const t=window.clipboardData;return("clipboardData"in e?e.clipboardData:e.dataTransfer)||t}function zN(e){return UN(e.replace(/\r\n?/g,`
|
|
30
|
+
`).replace(/\n$/,"").replace(/&/g,"&").replace(/\n/g,"<br>"))}function UN(e){const t=new DOMParser().parseFromString(`<body>${e}`,"text/html").body;return t.querySelectorAll("script").forEach(n=>n.remove()),t.querySelectorAll("*").forEach(n=>{Array.from(n.attributes).forEach(r=>{/^on/i.test(r.name)&&n.removeAttribute(r.name)})}),t.innerHTML}var Wi=new Set,VN=3e3;function jN(){return Wi.size>0}async function GN(){let e;const t=new Promise(r=>{e=setTimeout(()=>{r()},VN)}),n=(async()=>{for(;Wi.size;)await Promise.allSettled(Wi)})();await Promise.race([n,t]),clearTimeout(e)}function ju(e,t=!1,n,r,o){const i=XN(e,t,n,r,o);return Wi.add(i),i.finally(()=>Wi.delete(i))}async function XN(e,t,n,r,o){e.preventDefault(),e.stopPropagation();const i=qN(e);if(!i)return;const s=i.getData("text/html"),a=i.getData("text/plain");try{let l=s;if(!l||t)l=zN(a);else{const u=await HN(),d=n?.text?.fontSize||16;let f=u(l,{allowedTags:FN,allowedAttributes:$N,allowedStyles:{},transformTags:{span:function(k,b){let v="",S=!1,T=!1;if(b.style){const g=b.style.toLowerCase();(g.includes("font-weight: bold")||g.includes("font-weight:bold")||g.includes("font-weight: 700")||g.includes("font-weight:700"))&&(S=!0),(g.includes("font-style: italic")||g.includes("font-style:italic"))&&(T=!0),g.includes("text-decoration: underline")||g.includes("text-decoration:underline"),S&&T?(v="strong",b["data-italic"]="true"):S?v="strong":T&&(v="em")}return{tagName:v||"",attribs:b}},h1:function(k,b){return b["data-font-size"]=Math.round(1.5*d).toString(),b.style&&(b.style.toLowerCase().includes("font-style: italic")||b.style.toLowerCase().includes("font-style:italic"))&&(b["data-italic"]="true"),{tagName:"span",attribs:b}},h2:function(k,b){return b["data-font-size"]=Math.round(1.25*d).toString(),b.style&&(b.style.toLowerCase().includes("font-style: italic")||b.style.toLowerCase().includes("font-style:italic"))&&(b["data-italic"]="true"),{tagName:"span",attribs:b}},h3:function(k,b){return b["data-font-size"]=Math.round(1.125*d).toString(),b.style&&(b.style.toLowerCase().includes("font-style: italic")||b.style.toLowerCase().includes("font-style:italic"))&&(b["data-italic"]="true"),{tagName:"span",attribs:b}},h4:function(k,b){return b["data-font-size"]=d.toString(),b["data-bold"]="true",b.style&&(b.style.toLowerCase().includes("font-style: italic")||b.style.toLowerCase().includes("font-style:italic"))&&(b["data-italic"]="true"),{tagName:"span",attribs:b}},h5:function(k,b){return b["data-font-size"]=Math.round(.875*d).toString(),b.style&&(b.style.toLowerCase().includes("font-style: italic")||b.style.toLowerCase().includes("font-style:italic"))&&(b["data-italic"]="true"),{tagName:"span",attribs:b}},ul:function(k,b){return b["data-list-type"]="unordered",delete b.style,delete b["margin-top"],delete b["margin-bottom"],delete b["padding-inline-start"],{tagName:"ul",attribs:b}},ol:function(k,b){return b["data-list-type"]="ordered",b.start&&(b["data-list-start"]=b.start),delete b.style,delete b.start,{tagName:"ol",attribs:b}},li:function(k,b){return b["data-list-item"]="true",delete b.style,delete b.dir,delete b["aria-level"],delete b["list-style-type"],{tagName:"li",attribs:b}},p:function(k,b){return{tagName:"br",attribs:{}}},div:"br",b:function(k,b){if(b.style){const v=b.style.toLowerCase();return v.includes("font-weight: bold")||v.includes("font-weight:bold")||v.includes("font-weight: 700")||v.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(k,b){if(b.style){const v=b.style.toLowerCase();return v.includes("font-style: italic")||v.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(k,b){return{tagName:"strike",attribs:b}}},textFilter:function(k){return k.replace(/\s+/g," ")}});f=f.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const p=document.createElement("div");p.innerHTML=f,(k=>{k.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((b,v)=>{const S=b.getAttribute("data-list-type")==="ordered",T=b.querySelectorAll("li[data-list-item]");let g=1;S&&b.getAttribute("data-list-start")&&(g=parseInt(b.getAttribute("data-list-start"),10)||1);const E=document.createDocumentFragment(),C=b.previousSibling;C&&(C.nodeType===Node.TEXT_NODE&&C.textContent.trim()!==""||C.nodeType===Node.ELEMENT_NODE&&C.tagName!=="BR")&&E.appendChild(document.createElement("br")),T.forEach((_,x)=>{const N=document.createElement("span");N.innerHTML=S?`${g}. `:"• ",E.appendChild(N),(R=>{const M=document.createElement("div");M.innerHTML=R.innerHTML;let te=M.firstChild;for(;te&&te.nodeType===1&&te.tagName==="BR";)M.removeChild(te),te=M.firstChild;if(!M.hasChildNodes()){const j=document.createTextNode("");M.appendChild(j)}for(;M.firstChild;)E.appendChild(M.firstChild)})(_),x<T.length-1&&E.appendChild(document.createElement("br")),g++}),b.parentNode.replaceChild(E,b)}),k.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(b=>{b.removeAttribute("data-list-type"),b.removeAttribute("data-list-item"),b.removeAttribute("data-list-start")})})(p),p.firstChild&&p.firstChild.nodeType===Node.ELEMENT_NODE&&p.firstChild.tagName==="BR"&&p.removeChild(p.firstChild),p.querySelectorAll("[data-font-size]").forEach(k=>{const b=WN(k.getAttribute("data-font-size"));let v=b?`font-size: ${b};`:"";k.getAttribute("data-bold")==="true"&&(v+=" font-weight: bold;"),k.getAttribute("data-italic")==="true"&&(v+=" font-style: italic;"),v&&k.setAttribute("style",v.trim()),k.removeAttribute("data-font-size"),k.removeAttribute("data-bold"),k.removeAttribute("data-italic")}),p.querySelectorAll("[data-italic]").forEach(k=>{const b=document.createElement("em");b.innerHTML=k.innerHTML,k.innerHTML="",k.appendChild(b),k.removeAttribute("data-italic")}),p.querySelectorAll("a").forEach(k=>{const b=k.getAttribute("href");if(!b||b.trim()==="")k.replaceWith(...k.childNodes);else{k.setAttribute("target","_blank");const v=n?.links?.color??"#1C52DC",S=n?.links?.underline??!0?"underline":"none";k.setAttribute("style",`color: ${v}; text-decoration: ${S};`)}});const h=p.querySelectorAll("*");let y=0;h.forEach(k=>{k.tagName!=="BR"&&k.tagName!=="SPAN"&&k.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(k.parentNode.removeChild(k),y++)}),p.querySelectorAll("span").forEach(k=>{k.innerHTML==="• "||/^\d+\. $/.test(k.innerHTML)||k.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&k.children.length===0&&(k.parentNode.removeChild(k),y++)});const w=window.getSelection(),A=w?.anchorNode?.nodeType===Node.ELEMENT_NODE?w.anchorNode:w?.anchorNode?.parentElement||null;AN(p,A),TN(p,A),l=p.innerHTML}const c=window.getSelection();if(c&&c.rangeCount>0){const u=c.getRangeAt(0);NN(u),u.deleteContents();const d=document.createRange().createContextualFragment(l);u.insertNode(d),u.collapse(!1)}}catch{To("insertText",!1,a)}r(e),o(),await new Promise(l=>setTimeout(l,0))}var ja=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function jg(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function qr(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function Gg(e){return!e||!e.childNodes?!1:Array.from(e.childNodes).every(t=>t.nodeType===Node.TEXT_NODE?(t.textContent?.trim()??"")!=="":t.nodeType===Node.ELEMENT_NODE?Gg(t):!1)}function I(e){const t=document.createElement(e.tag||"div");if(t.setAttribute("contentEditable","false"),e.width&&(t.style.width=e.width+"px"),e.height&&(t.style.height=e.height+"px"),e.left&&(t.style.left=e.left+"px"),e.top&&(t.style.top=e.top+"px"),e.className&&(t.className=e.className),e.style&&t.setAttribute("style",e.style),e.HTMLcontent&&(t.innerHTML=e.HTMLcontent),e.title&&t.setAttribute("title",e.title),e["data-id"]&&t.setAttribute("data-id",e["data-id"]),e.targetElement){const n=typeof e.targetElement=="string"?document.querySelector(e.targetElement):e.targetElement;if(n)switch(e.insertType){case"append":n.append(t);break;case"prepend":n.prepend(t);break;case"before":n.before(t);break;case"after":n.after(t);break;case"replaceWith":n.replaceWith(t)}}return t}function YN(e){try{return JSON.parse(e),!0}catch{return!1}}function Xg(e,t,n=2){const r=e.split(""),o=t.split("");if(Math.abs(r.length-o.length)>n)return!1;let i=0;if(r.length===o.length){for(let s=0;s<r.length;s++)if(r[s]!==o[s]&&(i++,i>n))return!1}else{const s=r.length>o.length?r:o,a=r.length>o.length?o:r;let l=0,c=0;for(;l<s.length&&c<a.length;)if(s[l]!==a[c]){if(i++,i>n)return!1;l++}else l++,c++;if(l<s.length&&i++,i>1)return!1}return!0}function Lo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function KN(e){const t=e.style?.fontWeight;if(typeof t=="number")return t>=600;if(typeof t=="string"){const n=t.toLowerCase();return n.includes("bold")||n.includes("black")||parseInt(n)>=600}return!1}function Ga(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).commonAncestorContainer;return t.nodeType===1?t:t.parentElement}function Gu(e,t=null){const n=e?.innerText;for(;e!==null;){if(e.innerText===n){const r=e.parentElement;if(r===null||r.innerText!==n||r.tagName==="EDITOR"||e.tagName===t?.toUpperCase())return e.tagName===t?.toUpperCase()||!t?e:null}e=e.parentElement}return null}function qi(e,t=Ga()){e=ja(e)??"";const n=i=>ja(i?.textContent||"")??"",r=Array.from(t?.childNodes||[]).filter(i=>!!i&&i.nodeName!=="BR");let o=null;if(t&&t.nodeType===Node.TEXT_NODE&&n(t).includes(e)&&n(t)===e)return t;for(let i=0;i<r.length;i++){const s=r[i];if(s.nodeType===Node.TEXT_NODE&&n(s).includes(e)&&n(s)===e){o=s.parentNode;break}else if(s.nodeType===Node.ELEMENT_NODE&&(o=qi(e,s),o))break}return o}function Xu(e){const t=Array.from(e),n=t.map(i=>i.clientWidth),r=n.reduce((i,s)=>i+s,0),o=n.map(i=>((i||0)/r*100).toFixed(1));t.forEach((i,s)=>{i.setAttribute("data-percent",o[s])})}function Xa(e){e.elem.nodeName==="#comment"&&e.elem.textContent&&e.elem.textContent.indexOf("mso")>-1?e.elem.textContent=e.elem.textContent.replace(/width=".*"/gi,`width="${e.width}"`):e.elem.previousSibling&&Xa({elem:e.elem.previousSibling,width:e.width})}function ZN(e){let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let o=0;for(;o<e;)t+=n.charAt(Math.floor(Math.random()*62)),o+=1;return t}var QN=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
|
|
31
|
+
`;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function Yg(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>Yg(r,t)).join(""):n}function JN(e,t,n,r){e.setAttribute("style",n?.getAttribute("style")||t.getAttribute("innerStyle")||t.getAttribute("style")||""),e.style.color=r(e.style.color)??"",e.style.backgroundColor=r(e.style.backgroundColor)??"";const o=t.getAttribute("innerClass");o&&(e.className=o);const i=t.getAttribute("innerHref"),s=t.getAttribute("href"),a=n.getAttribute("href");(i!==null||s!==null||a!==null)&&(t.tagName==="A"||n.tagName==="A")&&e.setAttribute("href",i??s??a??"");const l=t.getAttribute("innerTarget");l&&e.setAttribute("target",l);const c=t.getAttribute("innerAlign");c&&e.setAttribute("align",c);const u=n.hasAttribute("em-edit")?n:n.querySelector("[em-edit]");u&&e.setAttribute("em-edit",u.getAttribute("em-edit")||"")}function e2(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function t2(e){let t=!1;return e&&e.childNodes.forEach(n=>{if(n.nodeType===Node.TEXT_NODE&&n.nodeValue?.trim()!==""){const r=n.nodeValue?.trim()||"";/[a-zA-Zа-яА-Я]/.test(r)&&(t=!0)}}),t}function Yu(){return Yk()}function n2(e,t=!1){if(e.closest("EDITOR")||!e.isConnected)return!0;let n=!1;if(!t)for(const r of Array.from(e.childNodes))if(r.tagName==="EDITOR"){if(n)return!1;n=!0}else return!1;return n}function Kg(e,t){if(e instanceof Text){const n=e.textContent,r=n;n!==r&&e.replaceWith(...t(r||""))}else if(e instanceof Element){const n=[...e.childNodes];if(e.tagName==="EDITOR")e.replaceWith(...n);else if(e.tagName==="SPAN"&&e.classList.contains("mce-nbsp-wrap"))return;for(const r of n)Kg(r,t)}}function r2(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function V(e){if(o2(e))return i2(e)?e.trim():s2(e)}var Zg={RGB:/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)/i,HEX:/^\s*#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})\s*$/i},o2=e=>typeof e=="string"&&e.trim()!=="",i2=e=>Zg.HEX.test(e);function s2(e){const t=Zg.RGB.exec(e)?.groups;if(!t)return;const n=a2(t);return c2(n)}var a2=e=>({r:Ku(e.r),g:Ku(e.g),b:Ku(e.b),a:l2(e.a)}),Ku=e=>parseInt(e||"0",10),l2=e=>parseFloat(e||"1"),c2=e=>`#${Zu(e.r)}${Zu(e.g)}${Zu(e.b)}`,Zu=e=>e.toString(16).padStart(2,"0"),u2=0;function st(e){return e>=48&&e<=57}function fr(e){return st(e)||e>=65&&e<=70||e>=97&&e<=102}function Qu(e){return e>=65&&e<=90}function d2(e){return e>=97&&e<=122}function f2(e){return Qu(e)||d2(e)}function m2(e){return e>=128}function Ya(e){return f2(e)||m2(e)||e===95}function Qg(e){return Ya(e)||st(e)||e===45}function p2(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Ka(e){return e===10||e===13||e===12}function zr(e){return Ka(e)||e===32||e===9}function xn(e,t){return!(e!==92||Ka(t)||t===u2)}function Za(e,t,n){return e===45?Ya(t)||t===45||xn(t,n):Ya(e)?!0:e===92?xn(e,t):!1}function Ju(e,t,n){return e===43||e===45?st(t)?2:t===46&&st(n)?3:0:e===46?st(t)?2:0:st(e)?1:0}function Jg(e){return e===65279||e===65534?1:0}var ed=new Array(128),Tj=128,_j=130,kj=131,Lj=132,Nj=133;for(let e=0;e<ed.length;e++)ed[e]=zr(e)&&130||st(e)&&131||Ya(e)&&132||p2(e)&&133||e||128;function td(e){return e<128?ed[e]:132}function No(e,t){return t<e.length?e.charCodeAt(t):0}function nd(e,t,n){return n===13&&No(e,t+1)===10?2:1}function xo(e,t,n){let r=e.charCodeAt(t);return Qu(r)&&(r=r|32),r===n}function zi(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let o=t;o<n;o++){const i=r.charCodeAt(o-t);let s=e.charCodeAt(o);if(Qu(s)&&(s=s|32),s!==i)return!1}return!0}function h2(e,t){for(;t>=0&&zr(e.charCodeAt(t));t--);return t+1}function Qa(e,t){for(;t<e.length&&zr(e.charCodeAt(t));t++);return t}function rd(e,t){for(;t<e.length&&st(e.charCodeAt(t));t++);return t}function Oo(e,t){if(t+=2,fr(No(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&fr(No(e,t));t++);const n=No(e,t);zr(n)&&(t+=nd(e,t,n))}return t}function Ja(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!Qg(n)){if(xn(n,No(e,t+1))){t=Oo(e,t)-1;continue}break}}return t}function el(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),st(n)&&(t=rd(e,t+1),n=e.charCodeAt(t)),n===46&&st(e.charCodeAt(t+1))&&(t+=2,t=rd(e,t)),xo(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),st(n)&&(t=rd(e,t+1+r+1))}return t}function od(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}xn(n,No(e,t+1))&&(t=Oo(e,t))}return t}function eb(e){if(e.length===1&&!fr(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var tb=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token"],g2=16384;function tl(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,g2)):e}var nb=10,b2=12,rb=13;function ob(e){const t=e.source,n=t.length,r=t.length>0?Jg(t.charCodeAt(0)):0,o=tl(e.lines,n),i=tl(e.columns,n);let s=e.startLine,a=e.startColumn;for(let l=r;l<n;l++){const c=t.charCodeAt(l);o[l]=s,i[l]=a++,(c===nb||c===rb||c===b2)&&(c===rb&&l+1<n&&t.charCodeAt(l+1)===nb&&(l++,o[l]=s,i[l]=a),s++,a=1)}o[n]=s,i[n]=a,e.lines=o,e.columns=i,e.computed=!0}var y2=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(e,t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||ob(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||ob(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}},Zt=16777215,mr=24,v2=new Map([[2,22],[21,22],[19,20],[23,24]]),E2=class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",t=()=>{}){e=String(e||"");const n=e.length,r=tl(this.offsetAndType,e.length+1),o=tl(this.balance,e.length+1);let i=0,s=0,a=0,l=-1;for(this.offsetAndType=null,this.balance=null,t(e,(c,u,d)=>{switch(c){default:o[i]=n;break;case s:{let f=a&Zt;for(a=o[f],s=a>>mr,o[i]=f,o[f++]=i;f<i;f++)o[f]===n&&(o[f]=i);break}case 21:case 2:case 19:case 23:o[i]=a,s=v2.get(c),a=s<<mr|i}r[i++]=c<<mr|d,l===-1&&(l=u)}),r[i]=0<<mr|n,o[i]=n,o[n]=n;a!==0;){const c=a&Zt;a=o[c],o[c]=n}this.source=e,this.firstCharOffset=l===-1?0:l,this.tokenCount=i,this.offsetAndType=r,this.balance=o,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>mr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&Zt:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?zi(this.source,this.offsetAndType[e-1]&Zt,this.offsetAndType[e]&Zt,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&Zt:this.offsetAndType[this.tokenCount]&Zt:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===9&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&Zt,t=this.offsetAndType[t],this.tokenType=t>>mr,this.tokenEnd=t&Zt):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>mr,this.tokenEnd=e&Zt):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,t){let n=e,r,o;e:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break e;switch(o=n>0?this.offsetAndType[n-1]&Zt:this.firstCharOffset,t(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:this.balance[r]===n&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){const r=n,o=this.offsetAndType[t],i=o&Zt,s=o>>mr;n=i,e(s,r,i,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((t,n,r,o)=>{e[o]={idx:o,type:tb[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function nl(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=el(e,c),Za(n(c),n(c+1),n(c+2))){u=12,c=Ja(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=Ja(e,c),zi(e,d,c,"url")&&n(c)===40){if(c=Qa(e,c+1),n(c)===34||n(c)===39){u=2,c=d+4;return}s();return}if(n(c)===40){u=2,c++;return}u=1}function i(d){for(d||(d=n(c++)),u=5;c<e.length;c++){const f=e.charCodeAt(c);switch(td(f)){case d:c++;return;case 130:if(Ka(f)){c+=nd(e,c,f),u=6;return}break;case 92:if(c===e.length-1)break;const p=n(c+1);Ka(p)?c+=nd(e,c+1,p):xn(f,p)&&(c=Oo(e,c)-1)}}}function s(){for(u=7,c=Qa(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(td(d)){case 41:c++;return;case 130:if(c=Qa(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=od(e,c),u=8;return;case 34:case 39:case 40:case 133:c=od(e,c),u=8;return;case 92:if(xn(d,n(c+1))){c=Oo(e,c)-1;break}c=od(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=Jg(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(td(d)){case 130:u=13,c=Qa(e,c+1);break;case 34:i();break;case 35:Qg(n(c+1))||xn(n(c+1),n(c+2))?(u=4,c=Ja(e,c+1)):(u=9,c++);break;case 39:i();break;case 40:u=21,c++;break;case 41:u=22,c++;break;case 43:Ju(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:Ju(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):Za(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:Ju(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 47:n(c+1)===42?(u=25,c=e.indexOf("*/",c+2),c=c===-1?e.length:c+2):(u=9,c++);break;case 58:u=16,c++;break;case 59:u=17,c++;break;case 60:n(c+1)===33&&n(c+2)===45&&n(c+3)===45?(u=14,c=c+4):(u=9,c++);break;case 64:Za(n(c+1),n(c+2),n(c+3))?(u=3,c=Ja(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:xn(d,n(c+1))?o():(u=9,c++);break;case 93:u=20,c++;break;case 123:u=23,c++;break;case 125:u=24,c++;break;case 131:r();break;case 132:o();break;default:u=9,c++}t(u,l,l=c)}}var Ro=null,Ve=class An{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return An.createItem(t)}allocateCursor(t,n){let r;return Ro!==null?(r=Ro,Ro=Ro.cursor,r.prev=t,r.next=n,r.cursor=this.cursor):r={prev:t,next:n,cursor:this.cursor},this.cursor=r,r}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=Ro,Ro=t}updateCursors(t,n,r,o){let{cursor:i}=this;for(;i!==null;)i.prev===t&&(i.prev=n),i.next===r&&(i.next=o),i=i.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let n=this.head;n!==null;n=n.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){const o=An.createItem(r);n!==null?n.next=o:this.head=o,o.prev=n,n=o}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,n=this){const r=this.allocateCursor(null,this.head);for(;r.next!==null;){const o=r.next;r.next=o.next,t.call(n,o.data,o,this)}this.releaseCursor()}forEachRight(t,n=this){const r=this.allocateCursor(this.tail,null);for(;r.prev!==null;){const o=r.prev;r.prev=o.prev,t.call(n,o.data,o,this)}this.releaseCursor()}reduce(t,n,r=this){let o=this.allocateCursor(null,this.head),i=n,s;for(;o.next!==null;)s=o.next,o.next=s.next,i=t.call(r,i,s.data,s,this);return this.releaseCursor(),i}reduceRight(t,n,r=this){let o=this.allocateCursor(this.tail,null),i=n,s;for(;o.prev!==null;)s=o.prev,o.prev=s.prev,i=t.call(r,i,s.data,s,this);return this.releaseCursor(),i}some(t,n=this){for(let r=this.head;r!==null;r=r.next)if(t.call(n,r.data,r,this))return!0;return!1}map(t,n=this){const r=new An;for(let o=this.head;o!==null;o=o.next)r.appendData(t.call(n,o.data,o,this));return r}filter(t,n=this){const r=new An;for(let o=this.head;o!==null;o=o.next)t.call(n,o.data,o,this)&&r.appendData(o.data);return r}nextUntil(t,n,r=this){if(t===null)return;const o=this.allocateCursor(null,t);for(;o.next!==null;){const i=o.next;if(o.next=i.next,n.call(r,i.data,i,this))break}this.releaseCursor()}prevUntil(t,n,r=this){if(t===null)return;const o=this.allocateCursor(t,null);for(;o.prev!==null;){const i=o.prev;if(o.prev=i.prev,n.call(r,i.data,i,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new An;for(let n of this)t.appendData(n);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(An.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(An.createItem(t))}insert(t,n=null){if(n!==null)if(this.updateCursors(n.prev,t,n,t),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=t,n.prev=t,t.next=n,this.updateCursors(null,t)}else n.prev.next=t,t.prev=n.prev,n.prev=t,t.next=n;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,n){return this.insert(An.createItem(t),n)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(An.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(An.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,n){return t.head===null?this:(n!=null?(this.updateCursors(n.prev,t.tail,n,t.head),n.prev!==null?(n.prev.next=t.head,t.head.prev=n.prev):this.head=t.head,n.prev=t.tail,t.tail.next=n):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,n){"head"in n?this.insertList(n,t):this.insert(n,t),this.remove(t)}};function rl(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
|
|
32
|
+
`)}})}var ib=100,S2=60,w2=" ";function sb({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((f,p)=>String(u+p+1).padStart(l)+" |"+f).join(`
|
|
33
|
+
`)}const i=e.split(/\r\n?|\n|\f/),s=Math.max(1,t-r)-1,a=Math.min(t+r,i.length+1),l=Math.max(4,String(a).length)+1;let c=0;n+=3*(i[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>ib&&(c=n-S2+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,w2),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+ib-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
|
|
34
|
+
`)}function ab(e,t,n,r,o){return Object.assign(rl("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return sb({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
|
|
35
|
+
`+sb({source:t,line:r,column:o},2)}})}function C2(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:n=!0,this.next();continue}let o=e.getNode.call(this,r);if(o===void 0)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,r),n=!1),t.push(o)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}var lb=()=>{},A2=33,T2=35,id=59,cb=123,ub=0;function _2(e){return function(){return this[e]()}}function sd(e){const t=Object.create(null);for(const n in e){const r=e[n],o=r.parse||r;o&&(t[n]=o)}return t}function k2(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:sd(e.atrule),pseudo:sd(e.pseudo),node:sd(e.node)};for(const n in e.parseContext)switch(typeof e.parseContext[n]){case"function":t.context[n]=e.parseContext[n];break;case"string":t.context[n]=_2(e.parseContext[n])}return{config:t,...t,...t.node}}function L2(e){let t="",n="<unknown>",r=!1,o=lb,i=!1;const s=new y2,a=Object.assign(new E2,k2(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:C2,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===cb?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===cb||c===id?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===A2||c===id?1:0},consumeUntilSemicolonIncluded(c){return c===id?2:0},createList(){return new Ve},createSingleNodeList(c){return new Ve().appendData(c)},getFirstListNode(c){return c&&c.first},getLastListNode(c){return c&&c.last},parseWithFallback(c,u){const d=this.tokenIndex;try{return c.call(this)}catch(f){if(i)throw f;const p=u.call(this,d);return i=!0,o(f,p),i=!1,p}},lookupNonWSType(c){let u;do if(u=this.lookupType(c++),u!==13)return u;while(u!==ub);return ub},charCodeAt(c){return c>=0&&c<t.length?t.charCodeAt(c):0},substring(c,u){return t.substring(c,u)},substrToCursor(c){return this.source.substring(c,this.tokenStart)},cmpChar(c,u){return xo(t,c,u)},cmpStr(c,u,d){return zi(t,c,u,d)},consume(c){const u=this.tokenStart;return this.eat(c),this.substrToCursor(u)},consumeFunctionName(){const c=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),c},consumeNumber(c){const u=t.substring(this.tokenStart,el(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=tb[c].slice(0,-6).replace(/-/g," ").replace(/^./,p=>p.toUpperCase());let d=`${/[[\](){}]/.test(u)?`"${u}"`:u} is expected`,f=this.tokenStart;switch(c){case 1:this.tokenType===2||this.tokenType===7?(f=this.tokenEnd-1,d="Identifier is expected but function found"):d="Identifier is expected";break;case 4:this.isDelim(T2)&&(this.next(),f++,d="Name is expected");break;case 11:this.tokenType===10&&(f=this.tokenEnd,d="Percent sign is expected")}this.error(d,f)}this.next()},eatIdent(c){(this.tokenType!==1||this.lookupValue(0,c)===!1)&&this.error(`Identifier "${c}" is expected`),this.next()},eatDelim(c){this.isDelim(c)||this.error(`Delim "${String.fromCharCode(c)}" is expected`),this.next()},getLocation(c,u){return r?s.getLocationRange(c,u,n):null},getLocationFromList(c){if(r){const u=this.getFirstListNode(c),d=this.getLastListNode(c);return s.getLocationRange(u!==null?u.loc.start.offset-s.startOffset:this.tokenStart,d!==null?d.loc.end.offset-s.startOffset:this.tokenStart,n)}return null},error(c,u){const d=typeof u<"u"&&u<t.length?s.getLocation(u):this.eof?s.getLocation(h2(t,t.length-1)):s.getLocation(this.tokenStart);throw new ab(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,nl),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:lb,i=!1,a.parseAtrulePrelude="parseAtrulePrelude"in u?!!u.parseAtrulePrelude:!0,a.parseRulePrelude="parseRulePrelude"in u?!!u.parseRulePrelude:!0,a.parseValue="parseValue"in u?!!u.parseValue:!0,a.parseCustomProperty="parseCustomProperty"in u?!!u.parseCustomProperty:!1;const{context:d="default",onComment:f}=u;if(!(d in a.context))throw new Error("Unknown context `"+d+"`");typeof f=="function"&&a.forEachToken((m,h,y)=>{if(m===25){const w=a.getLocation(h,y),A=zi(t,y-2,y,"*/")?t.slice(h+2,y-2):t.slice(h+2,y);f(A,w)}});const p=a.context[d].call(a,u);return a.eof||a.error(),p},{SyntaxError:ab,config:a.config})}var N2=ar((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(n){if(0<=n&&n<t.length)return t[n];throw new TypeError("Must be between 0 and 63: "+n)},e.decode=function(n){var r=65,o=90,i=97,s=122,a=48,l=57,c=43,u=47,d=26,f=52;return r<=n&&n<=o?n-r:i<=n&&n<=s?n-i+d:a<=n&&n<=l?n-a+f:n==c?62:n==u?63:-1}})),x2=ar((e=>{var t=N2(),n=5,r=1<<n,o=r-1,i=r;function s(l){return l<0?(-l<<1)+1:(l<<1)+0}function a(l){var c=(l&1)===1,u=l>>1;return c?-u:u}e.encode=function(c){var u="",d,f=s(c);do d=f&o,f>>>=n,f>0&&(d|=i),u+=t.encode(d);while(f>0);return u},e.decode=function(c,u,d){var f=c.length,p=0,m=0,h,y;do{if(u>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(y=t.decode(c.charCodeAt(u++)),y===-1)throw new Error("Invalid base64 digit: "+c.charAt(u-1));h=!!(y&i),y&=o,p=p+(y<<m),m+=n}while(h);d.value=a(p),d.rest=u}})),ad=ar((e=>{function t(g,E,C){if(E in g)return g[E];if(arguments.length===3)return C;throw new Error('"'+E+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(g){var E=g.match(n);return E?{scheme:E[1],auth:E[2],host:E[3],port:E[4],path:E[5]}:null}e.urlParse=o;function i(g){var E="";return g.scheme&&(E+=g.scheme+":"),E+="//",g.auth&&(E+=g.auth+"@"),g.host&&(E+=g.host),g.port&&(E+=":"+g.port),g.path&&(E+=g.path),E}e.urlGenerate=i;var s=32;function a(g){var E=[];return function(C){for(var _=0;_<E.length;_++)if(E[_].input===C){var x=E[0];return E[0]=E[_],E[_]=x,E[0].result}var N=g(C);return E.unshift({input:C,result:N}),E.length>s&&E.pop(),N}}var l=a(function(E){var C=E,_=o(E);if(_){if(!_.path)return E;C=_.path}for(var x=e.isAbsolute(C),N=[],W=0,R=0;;)if(W=R,R=C.indexOf("/",W),R===-1){N.push(C.slice(W));break}else for(N.push(C.slice(W,R));R<C.length&&C[R]==="/";)R++;for(var M,te=0,R=N.length-1;R>=0;R--)M=N[R],M==="."?N.splice(R,1):M===".."?te++:te>0&&(M===""?(N.splice(R+1,te),te=0):(N.splice(R,2),te--));return C=N.join("/"),C===""&&(C=x?"/":"."),_?(_.path=C,i(_)):C});e.normalize=l;function c(g,E){g===""&&(g="."),E===""&&(E=".");var C=o(E),_=o(g);if(_&&(g=_.path||"/"),C&&!C.scheme)return _&&(C.scheme=_.scheme),i(C);if(C||E.match(r))return E;if(_&&!_.host&&!_.path)return _.host=E,i(_);var x=E.charAt(0)==="/"?E:l(g.replace(/\/+$/,"")+"/"+E);return _?(_.path=x,i(_)):x}e.join=c,e.isAbsolute=function(g){return g.charAt(0)==="/"||n.test(g)};function u(g,E){g===""&&(g="."),g=g.replace(/\/$/,"");for(var C=0;E.indexOf(g+"/")!==0;){var _=g.lastIndexOf("/");if(_<0||(g=g.slice(0,_),g.match(/^([^\/]+:\/)?\/*$/)))return E;++C}return Array(C+1).join("../")+E.substr(g.length+1)}e.relative=u;var d=(function(){return!("__proto__"in Object.create(null))})();function f(g){return g}function p(g){return h(g)?"$"+g:g}e.toSetString=d?f:p;function m(g){return h(g)?g.slice(1):g}e.fromSetString=d?f:m;function h(g){if(!g)return!1;var E=g.length;if(E<9||g.charCodeAt(E-1)!==95||g.charCodeAt(E-2)!==95||g.charCodeAt(E-3)!==111||g.charCodeAt(E-4)!==116||g.charCodeAt(E-5)!==111||g.charCodeAt(E-6)!==114||g.charCodeAt(E-7)!==112||g.charCodeAt(E-8)!==95||g.charCodeAt(E-9)!==95)return!1;for(var C=E-10;C>=0;C--)if(g.charCodeAt(C)!==36)return!1;return!0}function y(g,E,C){var _=b(g.source,E.source);return _!==0||(_=g.originalLine-E.originalLine,_!==0)||(_=g.originalColumn-E.originalColumn,_!==0||C)||(_=g.generatedColumn-E.generatedColumn,_!==0)||(_=g.generatedLine-E.generatedLine,_!==0)?_:b(g.name,E.name)}e.compareByOriginalPositions=y;function w(g,E,C){var _=g.originalLine-E.originalLine;return _!==0||(_=g.originalColumn-E.originalColumn,_!==0||C)||(_=g.generatedColumn-E.generatedColumn,_!==0)||(_=g.generatedLine-E.generatedLine,_!==0)?_:b(g.name,E.name)}e.compareByOriginalPositionsNoSource=w;function A(g,E,C){var _=g.generatedLine-E.generatedLine;return _!==0||(_=g.generatedColumn-E.generatedColumn,_!==0||C)||(_=b(g.source,E.source),_!==0)||(_=g.originalLine-E.originalLine,_!==0)||(_=g.originalColumn-E.originalColumn,_!==0)?_:b(g.name,E.name)}e.compareByGeneratedPositionsDeflated=A;function k(g,E,C){var _=g.generatedColumn-E.generatedColumn;return _!==0||C||(_=b(g.source,E.source),_!==0)||(_=g.originalLine-E.originalLine,_!==0)||(_=g.originalColumn-E.originalColumn,_!==0)?_:b(g.name,E.name)}e.compareByGeneratedPositionsDeflatedNoLine=k;function b(g,E){return g===E?0:g===null?1:E===null?-1:g>E?1:-1}function v(g,E){var C=g.generatedLine-E.generatedLine;return C!==0||(C=g.generatedColumn-E.generatedColumn,C!==0)||(C=b(g.source,E.source),C!==0)||(C=g.originalLine-E.originalLine,C!==0)||(C=g.originalColumn-E.originalColumn,C!==0)?C:b(g.name,E.name)}e.compareByGeneratedPositionsInflated=v;function S(g){return JSON.parse(g.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=S;function T(g,E,C){if(E=E||"",g&&(g[g.length-1]!=="/"&&E[0]!=="/"&&(g+="/"),E=g+E),C){var _=o(C);if(!_)throw new Error("sourceMapURL could not be parsed");if(_.path){var x=_.path.lastIndexOf("/");x>=0&&(_.path=_.path.substring(0,x+1))}E=c(i(_),E)}return l(E)}e.computeSourceURL=T})),O2=ar((e=>{var t=ad(),n=Object.prototype.hasOwnProperty,r=typeof Map<"u";function o(){this._array=[],this._set=r?new Map:Object.create(null)}o.fromArray=function(s,a){for(var l=new o,c=0,u=s.length;c<u;c++)l.add(s[c],a);return l},o.prototype.size=function(){return r?this._set.size:Object.getOwnPropertyNames(this._set).length},o.prototype.add=function(s,a){var l=r?s:t.toSetString(s),c=r?this.has(s):n.call(this._set,l),u=this._array.length;(!c||a)&&this._array.push(s),c||(r?this._set.set(s,u):this._set[l]=u)},o.prototype.has=function(s){if(r)return this._set.has(s);var a=t.toSetString(s);return n.call(this._set,a)},o.prototype.indexOf=function(s){if(r){var a=this._set.get(s);if(a>=0)return a}else{var l=t.toSetString(s);if(n.call(this._set,l))return this._set[l]}throw new Error('"'+s+'" is not in the set.')},o.prototype.at=function(s){if(s>=0&&s<this._array.length)return this._array[s];throw new Error("No element indexed by "+s)},o.prototype.toArray=function(){return this._array.slice()},e.ArraySet=o})),R2=ar((e=>{var t=ad();function n(o,i){var s=o.generatedLine,a=i.generatedLine,l=o.generatedColumn,c=i.generatedColumn;return a>s||a==s&&c>=l||t.compareByGeneratedPositionsInflated(o,i)<=0}function r(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}r.prototype.unsortedForEach=function(i,s){this._array.forEach(i,s)},r.prototype.add=function(i){n(this._last,i)?(this._last=i,this._array.push(i)):(this._sorted=!1,this._array.push(i))},r.prototype.toArray=function(){return this._sorted||(this._array.sort(t.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},e.MappingList=r})),M2=ar((e=>{var t=x2(),n=ad(),r=O2().ArraySet,o=R2().MappingList;function i(s){s||(s={}),this._file=n.getArg(s,"file",null),this._sourceRoot=n.getArg(s,"sourceRoot",null),this._skipValidation=n.getArg(s,"skipValidation",!1),this._ignoreInvalidMapping=n.getArg(s,"ignoreInvalidMapping",!1),this._sources=new r,this._names=new r,this._mappings=new o,this._sourcesContents=null}i.prototype._version=3,i.fromSourceMap=function(a,l){var c=a.sourceRoot,u=new i(Object.assign(l||{},{file:a.file,sourceRoot:c}));return a.eachMapping(function(d){var f={generated:{line:d.generatedLine,column:d.generatedColumn}};d.source!=null&&(f.source=d.source,c!=null&&(f.source=n.relative(c,f.source)),f.original={line:d.originalLine,column:d.originalColumn},d.name!=null&&(f.name=d.name)),u.addMapping(f)}),a.sources.forEach(function(d){var f=d;c!==null&&(f=n.relative(c,d)),u._sources.has(f)||u._sources.add(f);var p=a.sourceContentFor(d);p!=null&&u.setSourceContent(d,p)}),u},i.prototype.addMapping=function(a){var l=n.getArg(a,"generated"),c=n.getArg(a,"original",null),u=n.getArg(a,"source",null),d=n.getArg(a,"name",null);!this._skipValidation&&this._validateMapping(l,c,u,d)===!1||(u!=null&&(u=String(u),this._sources.has(u)||this._sources.add(u)),d!=null&&(d=String(d),this._names.has(d)||this._names.add(d)),this._mappings.add({generatedLine:l.line,generatedColumn:l.column,originalLine:c!=null&&c.line,originalColumn:c!=null&&c.column,source:u,name:d}))},i.prototype.setSourceContent=function(a,l){var c=a;this._sourceRoot!=null&&(c=n.relative(this._sourceRoot,c)),l!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(c)]=l):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(c)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},i.prototype.applySourceMap=function(a,l,c){var u=l;if(l==null){if(a.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);u=a.file}var d=this._sourceRoot;d!=null&&(u=n.relative(d,u));var f=new r,p=new r;this._mappings.unsortedForEach(function(m){if(m.source===u&&m.originalLine!=null){var h=a.originalPositionFor({line:m.originalLine,column:m.originalColumn});h.source!=null&&(m.source=h.source,c!=null&&(m.source=n.join(c,m.source)),d!=null&&(m.source=n.relative(d,m.source)),m.originalLine=h.line,m.originalColumn=h.column,h.name!=null&&(m.name=h.name))}var y=m.source;y!=null&&!f.has(y)&&f.add(y);var w=m.name;w!=null&&!p.has(w)&&p.add(w)},this),this._sources=f,this._names=p,a.sources.forEach(function(m){var h=a.sourceContentFor(m);h!=null&&(c!=null&&(m=n.join(c,m)),d!=null&&(m=n.relative(d,m)),this.setSourceContent(m,h))},this)},i.prototype._validateMapping=function(a,l,c,u){if(l&&typeof l.line!="number"&&typeof l.column!="number"){var d="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return!1;throw new Error(d)}if(!(a&&"line"in a&&"column"in a&&a.line>0&&a.column>=0&&!l&&!c&&!u)){if(a&&"line"in a&&"column"in a&&l&&"line"in l&&"column"in l&&a.line>0&&a.column>=0&&l.line>0&&l.column>=0&&c)return;var d="Invalid mapping: "+JSON.stringify({generated:a,source:c,original:l,name:u});if(this._ignoreInvalidMapping)return!1;throw new Error(d)}},i.prototype._serializeMappings=function(){for(var a=0,l=1,c=0,u=0,d=0,f=0,p="",m,h,y,w,A=this._mappings.toArray(),k=0,b=A.length;k<b;k++){if(h=A[k],m="",h.generatedLine!==l)for(a=0;h.generatedLine!==l;)m+=";",l++;else if(k>0){if(!n.compareByGeneratedPositionsInflated(h,A[k-1]))continue;m+=","}m+=t.encode(h.generatedColumn-a),a=h.generatedColumn,h.source!=null&&(w=this._sources.indexOf(h.source),m+=t.encode(w-f),f=w,m+=t.encode(h.originalLine-1-u),u=h.originalLine-1,m+=t.encode(h.originalColumn-c),c=h.originalColumn,h.name!=null&&(y=this._names.indexOf(h.name),m+=t.encode(y-d),d=y)),p+=m}return p},i.prototype._generateSourcesContent=function(a,l){return a.map(function(c){if(!this._sourcesContents)return null;l!=null&&(c=n.relative(l,c));var u=n.toSetString(c);return Object.prototype.hasOwnProperty.call(this._sourcesContents,u)?this._sourcesContents[u]:null},this)},i.prototype.toJSON=function(){var a={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(a.file=this._file),this._sourceRoot!=null&&(a.sourceRoot=this._sourceRoot),this._sourcesContents&&(a.sourcesContent=this._generateSourcesContent(a.sources,a.sourceRoot)),a},i.prototype.toString=function(){return JSON.stringify(this.toJSON())},e.SourceMapGenerator=i})),P2=M2(),db=new Set(["Atrule","Selector","Declaration"]);function I2(e){const t=new P2.SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},o={line:1,column:0},i={generated:o};let s=1,a=0,l=!1;const c=e.node;e.node=function(f){if(f.loc&&f.loc.start&&db.has(f.type)){const p=f.loc.start.line,m=f.loc.start.column-1;(r.line!==p||r.column!==m)&&(r.line=p,r.column=m,n.line=s,n.column=a,l&&(l=!1,(n.line!==o.line||n.column!==o.column)&&t.addMapping(i)),l=!0,t.addMapping({source:f.loc.source,original:r,generated:n}))}c.call(this,f),l&&db.has(f.type)&&(o.line=s,o.column=a)};const u=e.emit;e.emit=function(f,p,m){for(let h=0;h<f.length;h++)f.charCodeAt(h)===10?(s++,a=0):a++;u(f,p,m)};const d=e.result;return e.result=function(){return l&&t.addMapping(i),{css:d(),map:t}},e}var fb=se({safe:()=>hb,spec:()=>F2}),D2=43,B2=45,ld=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},mb=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],H2=mb.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function pb(e){const t=new Set(e.map(([n,r])=>ld(n)<<16|ld(r)));return function(n,r,o){const i=ld(r,o),s=o.charCodeAt(0);return(s===B2&&r!==1&&r!==2&&r!==15||s===D2?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var F2=pb(mb),hb=pb(H2),$2=92;function W2(e,t){if(typeof t=="function"){let n=null;e.children.forEach(r=>{n!==null&&t.call(this,n),this.node(r),n=r});return}e.children.forEach(this.node,this)}function q2(e){nl(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function z2(e){const t=new Map;for(let n in e.node){const r=e.node[n];typeof(r.generate||r)=="function"&&t.set(n,r.generate||r)}return function(n,r){let o="",i=0,s={node(l){if(t.has(l.type))t.get(l.type).call(a,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:hb,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===$2&&this.emit(`
|
|
36
|
+
`,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=I2(s)),r.mode in fb&&(s.tokenBefore=fb[r.mode]));const a={node:l=>s.node(l),children:W2,token:(l,c)=>s.token(l,c),tokenize:q2};return s.node(n),s.result()}}function U2(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof Ve)&&(n.children=new Ve().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof Ve&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:cd}=Object.prototype,Ui=function(){};function gb(e){return typeof e=="function"?e:Ui}function bb(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function V2(e,t){const n=t.structure,r=[];for(const o in n){if(cd.call(n,o)===!1)continue;let i=n[o];const s={name:o,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(const a of i)a===null?s.nullable=!0:typeof a=="string"?s.type="node":Array.isArray(a)&&(s.type="list");s.type&&r.push(s)}return r.length?{context:t.walkContext,fields:r}:null}function j2(e){const t={};for(const n in e.node)if(cd.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=V2(n,r)}return t}function yb(e,t){const n=e.fields.slice(),r=e.context,o=typeof r=="string";return t&&n.reverse(),function(i,s,a,l){let c;o&&(c=s[r],s[r]=i);for(const u of n){const d=i[u.name];if(!u.nullable||d){if(u.type==="list"){if(t?d.reduceRight(l,!1):d.reduce(l,!1))return!0}else if(a(d))return!0}}o&&(s[r]=c)}}function vb({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}}}function G2(e){const t=j2(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)cd.call(t,c)&&t[c]!==null&&(n[c]=yb(t[c],!1),r[c]=yb(t[c],!0));const s=vb(n),a=vb(r),l=function(c,u){function d(w,A,k){const b=f.call(y,w,A,k);return b===o?!0:b===i?!1:!!(m.hasOwnProperty(w.type)&&m[w.type](w,y,d,h)||p.call(y,w,A,k)===o)}let f=Ui,p=Ui,m=n,h=(w,A,k,b)=>w||d(A,k,b);const y={break:o,skip:i,root:c,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof u=="function")f=u;else if(u&&(f=gb(u.enter),p=gb(u.leave),u.reverse&&(m=r),u.visit)){if(s.hasOwnProperty(u.visit))m=u.reverse?a[u.visit]:s[u.visit];else if(!t.hasOwnProperty(u.visit))throw new Error("Bad value `"+u.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");f=bb(f,u.visit),p=bb(p,u.visit)}if(f===Ui&&p===Ui)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");d(c)};return l.break=o,l.skip=i,l.find=function(c,u){let d=null;return l(c,function(f,p,m){if(u.call(this,f,p,m))return d=f,o}),d},l.findLast=function(c,u){let d=null;return l(c,{reverse:!0,enter(f,p,m){if(u.call(this,f,p,m))return d=f,o}}),d},l.findAll=function(c,u){const d=[];return l(c,function(f,p,m){u.call(this,f,p,m)&&d.push(f)}),d},l}function X2(e){return e}function Y2(e){const{min:t,max:n,comma:r}=e;return t===0&&n===0?r?"#?":"*":t===0&&n===1?"?":t===1&&n===0?r?"#":"+":t===1&&n===1?"":(r?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(n!==0?n:"")+"}")}function K2(e){if(e.type==="Range")return" ["+(e.min===null?"-∞":e.min)+","+(e.max===null?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}function Z2(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>ud(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function ud(e,t,n,r){let o;switch(e.type){case"Group":o=Z2(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return ud(e.term,t,n,r)+t(Y2(e),e);case"Type":o="<"+e.name+(e.opts?t(K2(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function dd(e,t){let n=X2,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),ud(e,n,r,o)}var Eb={offset:0,line:1,column:1};function Q2(e,t){const n=e.tokens,r=e.longestMatch,o=r<n.length&&n[r].node||null,i=o!==t?o:null;let s=0,a=0,l=0,c="",u,d;for(let f=0;f<n.length;f++){const p=n[f].value;f===r&&(a=p.length,s=c.length),i!==null&&n[f].node===i&&(f<=r?l++:l=0),c+=p}return r===n.length||l>1?(u=ol(i||t,"end")||Vi(Eb,c),d=Vi(u)):(u=ol(i,"start")||Vi(ol(t,"start")||Eb,c.slice(0,s)),d=ol(i,"end")||Vi(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function ol(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Vi(n):n:null}function Vi({offset:e,line:t,column:n},r){const o={offset:e,line:t,column:n};if(r){const i=r.split(/\n|\r\n?|\f/);o.offset+=r.length,o.line+=i.length-1,o.column=i.length===1?o.column+r.length:i.pop().length+1}return o}var ji=function(e,t){const n=rl("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},J2=function(e,t,n,r){const o=rl("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=Q2(r,n);return o.rawMessage=e,o.syntax=t?dd(t):"<generic>",o.css=i,o.mismatchOffset=s,o.mismatchLength=a,o.message=e+`
|
|
37
|
+
syntax: `+o.syntax+`
|
|
38
|
+
value: `+(i||"<empty string>")+`
|
|
39
|
+
--------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,l),o.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:l,end:c},o},il=new Map,Mo=new Map,sl=45,dn=ex,Po=tx;function fd(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===sl&&e.charCodeAt(t+1)===sl}function Sb(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===sl&&e.charCodeAt(t+1)!==sl){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function ex(e){if(il.has(e))return il.get(e);const t=e.toLowerCase();let n=il.get(t);if(n===void 0){const r=fd(t,0),o=r?"":Sb(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return il.set(e,n),n}function tx(e){if(Mo.has(e))return Mo.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=fd(t,n.length);if(!r&&(t=t.toLowerCase(),Mo.has(t))){const a=Mo.get(t);return Mo.set(e,a),a}const o=r?"":Sb(t,n.length),i=t.substr(0,n.length+o.length),s=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return Mo.set(e,s),s}var wb=["initial","inherit","unset","revert","revert-layer"],Gi=43,On=45,md=110,Io=!0,nx=!1;function pd(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Xi(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function pr(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===Gi||o===On){if(n)return 0;t++}for(;t<e.value.length;t++)if(!st(e.value.charCodeAt(t)))return 0;return r+1}function hd(e,t,n){let r=!1,o=Xi(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(pd(e,Gi)||pd(e,On)){if(r=!0,o=Xi(n(++o),o,n),e=n(o),e===null||e.type!==10)return 0}else return t;if(!r){const i=e.value.charCodeAt(0);if(i!==Gi&&i!==On)return 0}return pr(e,r?0:1,r,o)}function rx(e,t){let n=0;if(!e)return 0;if(e.type===10)return pr(e,0,nx,n);if(e.type===1&&e.value.charCodeAt(0)===On){if(!xo(e.value,1,md))return 0;switch(e.value.length){case 2:return hd(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==On?0:(n=Xi(t(++n),n,t),e=t(n),pr(e,0,Io,n));default:return e.value.charCodeAt(2)!==On?0:pr(e,3,Io,n)}}else if(e.type===1||pd(e,Gi)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!xo(e.value,0,md))return 0;switch(e.value.length){case 1:return hd(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==On?0:(n=Xi(t(++n),n,t),e=t(n),pr(e,0,Io,n));default:return e.value.charCodeAt(1)!==On?0:pr(e,2,Io,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===Gi||r===On?1:0,i=o;for(;i<e.value.length&&st(e.value.charCodeAt(i));i++);return i===o||!xo(e.value,i,md)?0:i+1===e.value.length?hd(t(++n),n,t):e.value.charCodeAt(i+1)!==On?0:i+2===e.value.length?(n=Xi(t(++n),n,t),e=t(n),pr(e,0,Io,n)):pr(e,i+2,Io,n)}return 0}var ox=43,Cb=45,Ab=63,ix=117;function gd(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function sx(e,t){return e.value.charCodeAt(0)===t}function Yi(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===Cb&&n&&r!==0)return Yi(e,t+r+1,!1),6;if(!fr(i)||++r>6)return 0}return r}function al(e,t,n){if(!e)return 0;for(;gd(n(t),Ab);){if(++e>6)return 0;t++}return t}function ax(e,t){let n=0;if(e===null||e.type!==1||!xo(e.value,0,ix)||(e=t(++n),e===null))return 0;if(gd(e,ox))return e=t(++n),e===null?0:e.type===1?al(Yi(e,0,!0),++n,t):gd(e,Ab)?al(1,++n,t):0;if(e.type===10){const r=Yi(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!sx(e,Cb)||!Yi(e,1,!1)?0:n+1:al(r,n,t))}return e.type===12?al(Yi(e,1,!0),++n,t):0}var lx=["calc(","-moz-calc(","-webkit-calc("],bd=new Map([[2,22],[21,22],[19,20],[23,24]]),cx=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],ux=["deg","grad","rad","turn"],dx=["s","ms"],fx=["hz","khz"],mx=["dpi","dpcm","dppx","x"],px=["fr"],hx=["db"],gx=["st"];function fn(e,t){return t<e.length?e.charCodeAt(t):0}function Tb(e,t){return zi(e,0,e.length,t)}function _b(e,t){for(let n=0;n<t.length;n++)if(Tb(e,t[n]))return!0;return!1}function kb(e,t){return t!==e.length-2?!1:fn(e,t)===92&&st(fn(e,t+1))}function ll(e,t,n){if(e&&e.type==="Range"){const r=Number(n!==void 0&&n!==t.length?t.substr(0,n):t);if(isNaN(r)||e.min!==null&&r<e.min&&typeof e.min!="string"||e.max!==null&&r>e.max&&typeof e.max!="string")return!0}return!1}function bx(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==n)break e;if(n=r.pop(),r.length===0){o++;break e}break;case 2:case 21:case 19:case 23:r.push(n),n=bd.get(e.type)}o++}while(e=t(o));return o}function Qt(e){return function(t,n,r){return t===null?0:t.type===2&&_b(t.value,lx)?bx(t,n):e(t,n,r)}}function Re(e){return function(t){return t===null||t.type!==e?0:1}}function yx(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return _b(t,wb)||Tb(t,"default")?0:1}function vx(e){return e===null||e.type!==1||fn(e.value,0)!==45||fn(e.value,1)!==45?0:1}function Ex(e){if(e===null||e.type!==4)return 0;const t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let n=1;n<t;n++)if(!fr(fn(e.value,n)))return 0;return 1}function Sx(e){return e===null||e.type!==4||!Za(fn(e.value,1),fn(e.value,2),fn(e.value,3))?0:1}function wx(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 17:if(n===0)break e;break;case 9:if(n===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:r.push(n),n=bd.get(e.type)}o++}while(e=t(o));return o}function Cx(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 2:case 21:case 19:case 23:r.push(n),n=bd.get(e.type)}o++}while(e=t(o));return o}function Jn(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=el(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!kb(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return ll(r,t.value,o)?0:1}}function Ax(e,t,n){return e===null||e.type!==11||ll(n,e.value,e.value.length-1)?0:1}function Lb(e){return typeof e!="function"&&(e=function(){return 0}),function(t,n,r){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,n,r)}}function Tx(e,t,n){if(e===null)return 0;const r=el(e.value,0);return r!==e.value.length&&!kb(e.value,r)||ll(n,e.value,r)?0:1}function _x(e,t,n){if(e===null||e.type!==10)return 0;let r=fn(e.value,0)===43||fn(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!st(fn(e.value,r)))return 0;return ll(n,e.value,r)?0:1}var Nb={"ident-token":Re(1),"function-token":Re(2),"at-keyword-token":Re(3),"hash-token":Re(4),"string-token":Re(5),"bad-string-token":Re(6),"url-token":Re(7),"bad-url-token":Re(8),"delim-token":Re(9),"number-token":Re(10),"percentage-token":Re(11),"dimension-token":Re(12),"whitespace-token":Re(13),"CDO-token":Re(14),"CDC-token":Re(15),"colon-token":Re(16),"semicolon-token":Re(17),"comma-token":Re(18),"[-token":Re(19),"]-token":Re(20),"(-token":Re(21),")-token":Re(22),"{-token":Re(23),"}-token":Re(24),string:Re(5),ident:Re(1),"custom-ident":yx,"custom-property-name":vx,"hex-color":Ex,"id-selector":Sx,"an-plus-b":rx,urange:ax,"declaration-value":wx,"any-value":Cx,dimension:Qt(Jn(null)),angle:Qt(Jn(ux)),decibel:Qt(Jn(hx)),frequency:Qt(Jn(fx)),flex:Qt(Jn(px)),length:Qt(Lb(Jn(cx))),resolution:Qt(Jn(mx)),semitones:Qt(Jn(gx)),time:Qt(Jn(dx)),percentage:Qt(Ax),zero:Lb(),number:Qt(Tx),integer:Qt(_x)};function kx(e,t,n){return Object.assign(rl("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
|
|
40
|
+
`+t+`
|
|
41
|
+
--`+new Array((n||t.length)+1).join("-")+"^"})}var Lx=9,Nx=10,xx=12,Ox=13,Rx=32,Mx=class{constructor(e){this.str=e,this.pos=0}charCodeAt(e){return e<this.str.length?this.str.charCodeAt(e):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(e){return this.charCodeAt(this.findWsEnd(e))}findWsEnd(e){for(;e<this.str.length;e++){const t=this.str.charCodeAt(e);if(t!==Ox&&t!==Nx&&t!==xx&&t!==Rx&&t!==Lx)break}return e}substringToPos(e){return this.str.substring(this.pos,this.pos=e)}eat(e){this.charCode()!==e&&this.error("Expect `"+String.fromCharCode(e)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(e){throw new kx(e,this.str,this.pos)}},Px=9,Ix=10,Dx=12,Bx=13,Hx=32,xb=33,yd=35,Ob=38,cl=39,Rb=40,Fx=41,Mb=42,vd=43,Ed=44,Pb=45,Sd=60,Ib=62,wd=63,$x=64,ul=91,Cd=93,dl=123,Db=124,Bb=125,Hb=8734,Ki=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),Fb={" ":1,"&&":2,"||":3,"|":4};function fl(e){return e.substringToPos(e.findWsEnd(e.pos))}function Do(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||Ki[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function ml(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n<48||n>57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function Wx(e){const t=e.str.indexOf("'",e.pos+1);return t===-1&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function $b(e){let t=null,n=null;return e.eat(dl),t=ml(e),e.charCode()===Ed?(e.pos++,e.charCode()!==Bb&&(n=ml(e))):n=t,e.eat(Bb),{min:Number(t),max:n?Number(n):0}}function qx(e){let t=null,n=!1;switch(e.charCode()){case Mb:e.pos++,t={min:0,max:0};break;case vd:e.pos++,t={min:1,max:0};break;case wd:e.pos++,t={min:0,max:1};break;case yd:e.pos++,n=!0,e.charCode()===dl?t=$b(e):e.charCode()===wd?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case dl:t=$b(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function Bo(e,t){const n=qx(e);return n!==null?(n.term=t,e.charCode()===yd&&e.charCodeAt(e.pos-1)===vd?Bo(e,n):n):t}function Ad(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function zx(e){let t;return e.eat(Sd),e.eat(cl),t=Do(e),e.eat(cl),e.eat(Ib),Bo(e,{type:"Property",name:t})}function Ux(e){let t=null,n=null,r=1;return e.eat(ul),e.charCode()===Pb&&(e.peek(),r=-1),r==-1&&e.charCode()===Hb?e.peek():(t=r*Number(ml(e)),Ki[e.charCode()]!==0&&(t+=Do(e))),fl(e),e.eat(Ed),fl(e),e.charCode()===Hb?e.peek():(r=1,e.charCode()===Pb&&(e.peek(),r=-1),n=r*Number(ml(e)),Ki[e.charCode()]!==0&&(n+=Do(e))),e.eat(Cd),{type:"Range",min:t,max:n}}function Vx(e){let t,n=null;return e.eat(Sd),t=Do(e),e.charCode()===Rb&&e.nextCharCode()===Fx&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===ul&&(fl(e),n=Ux(e)),e.eat(Ib),Bo(e,{type:"Type",name:t,opts:n})}function jx(e){const t=Do(e);return e.charCode()===Rb?(e.pos++,{type:"Function",name:t}):Bo(e,{type:"Keyword",name:t})}function Gx(e,t){function n(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((o,i)=>Fb[o]-Fb[i]);t.length>0;){r=t.shift();let o=0,i=0;for(;o<e.length;o++){const s=e[o];s.type==="Combinator"&&(s.value===r?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function Wb(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=Yx(e);)r.type!=="Spaces"&&(r.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),n[r.value]=!0):o!==null&&o.type!=="Combinator"&&(n[" "]=!0,t.push({type:"Combinator",value:" "})),t.push(r),o=r,i=e.pos);return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:t,combinator:Gx(t,n)||" ",disallowEmpty:!1,explicit:!1}}function Xx(e){let t;return e.eat(ul),t=Wb(e),e.eat(Cd),t.explicit=!0,e.charCode()===xb&&(e.pos++,t.disallowEmpty=!0),t}function Yx(e){let t=e.charCode();if(t<128&&Ki[t]===1)return jx(e);switch(t){case Cd:break;case ul:return Bo(e,Xx(e));case Sd:return e.nextCharCode()===cl?zx(e):Vx(e);case Db:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===Db?2:1))};case Ob:return e.pos++,e.eat(Ob),{type:"Combinator",value:"&&"};case Ed:return e.pos++,{type:"Comma"};case cl:return Bo(e,{type:"String",value:Wx(e)});case Hx:case Px:case Ix:case Bx:case Dx:return{type:"Spaces",value:fl(e)};case $x:return t=e.nextCharCode(),t<128&&Ki[t]===1?(e.pos++,{type:"AtKeyword",name:Do(e)}):Ad(e);case Mb:case vd:case wd:case yd:case xb:break;case dl:if(t=e.nextCharCode(),t<48||t>57)return Ad(e);break;default:return Ad(e)}}function qb(e){const t=new Mx(e),n=Wb(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var Zi=function(){};function zb(e){return typeof e=="function"?e:Zi}function Kx(e,t,n){function r(s){switch(o.call(n,s),s.type){case"Group":s.terms.forEach(r);break;case"Multiplier":r(s.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+s.type)}i.call(n,s)}let o=Zi,i=Zi;if(typeof t=="function"?o=t:t&&(o=zb(t.enter),i=zb(t.leave)),o===Zi&&i===Zi)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var Zx={decorator(e){const t=[];let n=null;return{...e,node(r){const o=n;n=r,e.node.call(this,r),n=o},emit(r,o,i){t.push({type:o,value:r,node:i?null:n})},result(){return t}}}};function Qx(e){const t=[];return nl(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function Jx(e,t){return typeof e=="string"?Qx(e):t.generate(e,Zx)}var we={type:"Match"},Te={type:"Mismatch"},Td={type:"DisallowEmpty"},eO=40,tO=41;function dt(e,t,n){return t===we&&n===Te||e===we&&t===we&&n===we?e:(e.type==="If"&&e.else===Te&&t===we&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function Ub(e){return e.length>2&&e.charCodeAt(e.length-2)===eO&&e.charCodeAt(e.length-1)===tO}function Vb(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&Ub(e.name)}function _d(e,t,n){switch(e){case" ":{let r=we;for(let o=t.length-1;o>=0;o--){const i=t[o];r=dt(i,r,Te)}return r}case"|":{let r=Te,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(Vb(s)&&(o===null&&i>0&&Vb(t[i-1])&&(o=Object.create(null),r=dt({type:"Enum",map:o},we,r)),o!==null)){const a=(Ub(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=dt(s,we,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=Te;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=_d(e,t.filter(function(a){return a!==i}),!1):s=we,r=dt(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?we:Te;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=_d(e,t.filter(function(a){return a!==i}),!0):s=we,r=dt(i,s,r)}return r}}}function nO(e){let t=we,n=kd(e.term);if(e.max===0)n=dt(n,Td,Te),t=dt(n,null,Te),t.then=dt(we,we,t),e.comma&&(t.then.else=dt({type:"Comma",syntax:e},t,Te));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==we&&(t=dt({type:"Comma",syntax:e},t,Te)),t=dt(n,dt(we,we,t),Te);if(e.min===0)t=dt(we,we,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==we&&(t=dt({type:"Comma",syntax:e},t,Te)),t=dt(n,t,Te);return t}function kd(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=_d(e.combinator,e.terms.map(kd),!1);return e.disallowEmpty&&(t=dt(t,Td,Te)),t}case"Multiplier":return nO(e);case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return e.value.length===3?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function Ld(e,t){return typeof e=="string"&&(e=qb(e)),{type:"MatchGraph",match:kd(e),syntax:t||null,source:e}}var{hasOwnProperty:jb}=Object.prototype,rO=0,oO=1,Nd=2,Gb=3,Xb="Match",iO="Mismatch",sO="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",aO=15e3,lO=0;function cO(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function xd(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const r=t.charCodeAt(n);let o=e.charCodeAt(n);if(o>=65&&o<=90&&(o=o|32),o!==r)return!1}return!0}function uO(e){return e.type!==9?!1:e.value!=="?"}function Yb(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||uO(e)}function Kb(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function dO(e,t,n){function r(){do A++,w=A<e.length?e[A]:null;while(w!==null&&(w.type===13||w.type===25))}function o(v){const S=A+v;return S<e.length?e[S]:null}function i(v,S){return{nextState:v,matchStack:b,syntaxStack:d,thenStack:f,tokenIndex:A,prev:S}}function s(v){f={nextState:v,matchStack:b,syntaxStack:d,prev:f}}function a(v){p=i(v,p)}function l(){b={type:oO,syntax:t.syntax,token:w,prev:b},r(),m=null,A>k&&(k=A)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},b={type:Nd,syntax:t.syntax,token:b.token,prev:b}}function u(){b.type===Nd?b=b.prev:b={type:Gb,syntax:d.syntax,token:b.token,prev:b},d=d.prev}let d=null,f=null,p=null,m=null,h=0,y=null,w=null,A=-1,k=0,b={type:rO,syntax:null,token:null,prev:null};for(r();y===null&&++h<aO;)switch(t.type){case"Match":if(f===null){if(w!==null&&(A!==e.length-1||w.value!=="\\0"&&w.value!=="\\9")){t=Te;break}y=Xb;break}if(t=f.nextState,t===Td)if(f.matchStack===b){t=Te;break}else t=we;for(;f.syntaxStack!==d;)u();f=f.prev;break;case"Mismatch":if(m!==null&&m!==!1)(p===null||A>p.tokenIndex)&&(p=m,m=!1);else if(p===null){y=iO;break}t=p.nextState,f=p.thenStack,d=p.syntaxStack,b=p.matchStack,A=p.tokenIndex,w=A<e.length?e[A]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Te&&a(t.else),t.then!==we&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const T=t.syntax.terms;if(t.index===T.length){if(t.mask===0||t.syntax.all){t=Te;break}t=we;break}if(t.mask===(1<<T.length)-1){t=we;break}for(;t.index<T.length;t.index++){const g=1<<t.index;if((t.mask&g)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|g}),t=T[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(w!==null){let T=w.value.toLowerCase();if(T.indexOf("\\")!==-1&&(T=T.replace(/\\[09].*$/,"")),jb.call(t.map,T)){t=t.map[T];break}}t=Te;break;case"Generic":{const T=d!==null?d.opts:null,g=A+Math.floor(t.fn(w,o,T));if(!isNaN(g)&&g>A){for(;A<g;)l();t=we}else t=Te;break}case"Type":case"Property":{const T=t.type==="Type"?"types":"properties",g=jb.call(n,T)?n[T][t.name]:null;if(!g||!g.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(m!==!1&&w!==null&&t.type==="Type"&&(t.name==="custom-ident"&&w.type===1||t.name==="length"&&w.value==="0")){m===null&&(m=i(t,p)),t=Te;break}c(),t=g.match;break}case"Keyword":{const T=t.name;if(w!==null){let g=w.value;if(g.indexOf("\\")!==-1&&(g=g.replace(/\\[09].*$/,"")),xd(g,T)){l(),t=we;break}}t=Te;break}case"AtKeyword":case"Function":if(w!==null&&xd(w.value,t.name)){l(),t=we;break}t=Te;break;case"Token":if(w!==null&&w.value===t.value){l(),t=we;break}t=Te;break;case"Comma":w!==null&&w.type===18?Yb(b.token)?t=Te:(l(),t=Kb(w)?Te:we):t=Yb(b.token)||Kb(w)?we:Te;break;case"String":let v="",S=A;for(;S<e.length&&v.length<t.value.length;S++)v+=e[S].value;if(xd(v,t.value)){for(;A<S;)l();t=we}else t=Te;break;default:throw new Error("Unknown node type: "+t.type)}switch(lO+=h,y){case null:y=sO,b=null;break;case Xb:for(;d!==null;)u();break;default:b=null}return{tokens:e,reason:y,iterations:h,match:b,longestMatch:k}}function Zb(e,t,n){const r=dO(e,t,n||{});if(r.match===null)return r;let o=r.match,i=r.match={syntax:t.syntax||null,match:[]};const s=[i];for(o=cO(o).prev;o!==null;){switch(o.type){case Nd:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case Gb:s.pop(),i=s[s.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return r}var fO=se({getTrace:()=>Qb,isKeyword:()=>hO,isProperty:()=>pO,isType:()=>mO});function Qb(e){function t(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function n(o){if(Array.isArray(o.match)){for(let i=0;i<o.match.length;i++)if(n(o.match[i]))return t(o.syntax)&&r.unshift(o.syntax),!0}else if(o.node===e)return r=t(o.syntax)?[o.syntax]:[],!0;return!1}let r=null;return this.matched!==null&&n(this.matched),r}function mO(e,t){return Od(this,e,n=>n.type==="Type"&&n.name===t)}function pO(e,t){return Od(this,e,n=>n.type==="Property"&&n.name===t)}function hO(e){return Od(this,e,t=>t.type==="Keyword")}function Od(e,t,n){const r=Qb.call(e,t);return r===null?!1:r.some(n)}function Jb(e){return"node"in e?e.node:Jb(e.match[0])}function ey(e){return"node"in e?e.node:ey(e.match[e.match.length-1])}function ty(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=Jb(a),c=ey(a);e.syntax.walk(t,function(u,d,f){if(u===l){const p=new Ve;do{if(p.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:f,nodes:p})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:Qi}=Object.prototype;function Rd(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function ny(e){return!!e&&Rd(e.offset)&&Rd(e.line)&&Rd(e.column)}function gO(e,t){return function(r,o){if(!r||r.constructor!==Object)return o(r,"Type of node should be an Object");for(let i in r){let s=!0;if(Qi.call(r,i)!==!1){if(i==="type")r.type!==e&&o(r,"Wrong node type `"+r.type+"`, expected `"+e+"`");else if(i==="loc"){if(r.loc===null)continue;if(r.loc&&r.loc.constructor===Object)if(typeof r.loc.source!="string")i+=".source";else if(!ny(r.loc.start))i+=".start";else if(!ny(r.loc.end))i+=".end";else continue;s=!1}else if(t.hasOwnProperty(i)){s=!1;for(let a=0;!s&&a<t[i].length;a++){const l=t[i][a];switch(l){case String:s=typeof r[i]=="string";break;case Boolean:s=typeof r[i]=="boolean";break;case null:s=r[i]===null;break;default:typeof l=="string"?s=r[i]&&r[i].type===l:Array.isArray(l)&&(s=r[i]instanceof Ve)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)Qi.call(t,i)&&Qi.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function bO(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(Qi.call(n,i)===!1)continue;const s=[],a=r[i]=Array.isArray(n[i])?n[i].slice():[n[i]];for(let l=0;l<a.length;l++){const c=a[l];if(c===String||c===Boolean)s.push(c.name);else if(c===null)s.push("null");else if(typeof c=="string")s.push("<"+c+">");else if(Array.isArray(c))s.push("List");else throw new Error("Wrong value `"+c+"` in `"+e+"."+i+"` structure definition")}o[i]=s.join(" | ")}return{docs:o,check:gO(e,r)}}function yO(e){const t={};if(e.node){for(const n in e.node)if(Qi.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=bO(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var vO=Ld(wb.join(" | "));function Md(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:dd(e[o].syntax,{compact:t}));return r}function EO(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:dd(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Md(i.descriptors,t,n)};return r}function SO(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function mn(e,t,n){return{matched:e,iterations:n,error:t,...fO}}function Ho(e,t,n,r){const o=Jx(n,e.syntax);let i;return SO(o)?mn(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=Zb(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=Zb(o,t.match,e),!i.match)?mn(null,new J2(i.reason,t.syntax,n,i),i.iterations):mn(i.match,null,i.iterations))}var ry=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=vO,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||yO(e),e){if(e.types)for(const r in e.types)this.addType_(r,e.types[r]);if(e.generic){this.generic=!0;for(const r in Nb)this.addType_(r,Nb[r])}if(e.atrules)for(const r in e.atrules)this.addAtrule_(r,e.atrules[r]);if(e.properties)for(const r in e.properties)this.addProperty_(r,e.properties[r])}}checkStructure(e){function t(o,i){r.push({node:o,message:i})}const n=this.structure,r=[];return this.syntax.walk(e,function(o){n.hasOwnProperty(o.type)?n[o.type].check(o,t):t(o,"Unknown node type `"+o.type+"`")}),r.length?r:!1}createDescriptor(e,t,n,r=null){const o={type:t,name:n},i={type:t,name:n,parent:r,serializable:typeof e=="string"||e&&typeof e.type=="string",syntax:null,match:null};return typeof e=="function"?i.match=Ld(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:qb(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Ld(i.syntax,o)}),i.match}})),i}addAtrule_(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new ji("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e);if(!r.prelude&&t)return new SyntaxError("At-rule `@"+e+"` should not contain a prelude");if(r.prelude&&!t&&!Ho(this,r.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e),o=dn(t);if(!r.descriptors)return new SyntaxError("At-rule `@"+e+"` has no known descriptors");if(!r.descriptors[o.name]&&!r.descriptors[o.basename])return new ji("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new ji("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return mn(null,n);const r=this.getAtrule(e);return r.prelude?Ho(this,r.prelude,t||"",!1):mn(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return mn(null,r);const o=this.getAtrule(e),i=dn(t);return Ho(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?mn(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(Po(e).custom)return mn(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?mn(null,n):Ho(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Ho(this,n,t,!1):mn(null,new ji("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?mn(null,new ji("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),Ho(this,e,t,!1))}findValueFragments(e,t,n,r){return ty(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return ty(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){const r=[];return this.syntax.walk(e,{visit:"Declaration",enter:o=>{r.push.apply(r,this.findDeclarationValueFragments(o,t,n))}}),r}getAtrule(e,t=!0){const n=dn(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){const n=Po(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(r,o,i,s){if(i.has(o))return i.get(o);i.set(o,!1),s.syntax!==null&&Kx(s.syntax,function(a){if(a.type!=="Type"&&a.type!=="Property")return;const l=a.type==="Type"?r.types:r.properties,c=a.type==="Type"?t:n;(!hasOwnProperty.call(l,a.name)||e(r,a.name,c,l[a.name]))&&i.set(o,!0)},this)}let t=new Map,n=new Map;for(const r in this.types)e(this,r,t,this.types[r]);for(const r in this.properties)e(this,r,n,this.properties[r]);return t=[...t.keys()].filter(r=>t.get(r)),n=[...n.keys()].filter(r=>n.get(r)),t.length||n.length?{types:t,properties:n}:null}dump(e,t){return{generic:this.generic,types:Md(this.types,!t,e),properties:Md(this.properties,!t,e),atrules:EO(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:Fo}=Object.prototype,wO={generic:!0,types:Pd,atrules:{prelude:ay,descriptors:ay},properties:Pd,parseContext:CO,scope:iy,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function pl(e){return e&&e.constructor===Object}function oy(e){return pl(e)?{...e}:e}function CO(e,t){return Object.assign(e,t)}function iy(e,t){for(const n in t)Fo.call(t,n)&&(pl(e[n])?iy(e[n],t[n]):e[n]=oy(t[n]));return e}function sy(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Pd(e,t){if(typeof t=="string")return sy(e,t);const n={...e};for(let r in t)Fo.call(t,r)&&(n[r]=sy(Fo.call(e,r)?e[r]:void 0,t[r]));return n}function ay(e,t){const n=Pd(e,t);return!pl(n)||Object.keys(n).length?n:null}function Ji(e,t,n){for(const r in n)if(Fo.call(n,r)!==!1){if(n[r]===!0)Fo.call(t,r)&&(e[r]=oy(t[r]));else if(n[r]){if(typeof n[r]=="function"){const o=n[r];e[r]=o({},e[r]),e[r]=o(e[r]||{},t[r])}else if(pl(n[r])){const o={};for(let i in e[r])o[i]=Ji({},e[r][i],n[r]);for(let i in t[r])o[i]=Ji(o[i]||{},t[r][i],n[r]);e[r]=o}else if(Array.isArray(n[r])){const o={},i=n[r].reduce(function(s,a){return s[a]=!0,s},{});for(const[s,a]of Object.entries(e[r]||{}))o[s]={},a&&Ji(o[s],a,i);for(const s in t[r])Fo.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ji(o[s],t[r][s],i));e[r]=o}}}return e}var Id=(e,t)=>Ji(e,t,wO);function ly(e){const t=L2(e),n=G2(e),r=z2(e),{fromPlainObject:o,toPlainObject:i}=U2(n),s={lexer:null,createLexer:a=>new ry(a,s,s.lexer.structure),tokenize:nl,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=Id({},e);return ly(typeof a=="function"?a(l,Object.assign):Id(l,a))}};return s.lexer=new ry({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var AO=e=>ly(Id({},e)),TO={generic:!0,types:{"absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","alpha-value":"<number>|<percentage>","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>","angular-color-stop":"<color>&&<color-stop-angle>?","angular-color-stop-list":"[<angular-color-stop> [, <angular-color-hint>]?]# , <angular-color-stop>","animateable-feature":"scroll-position|contents|<custom-ident>",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <type-or-unit>? [, <attr-fallback>]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<circle()>|<ellipse()>|<polygon()>|<path()>","bg-image":"none|<image>","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage>|auto]{1,2}|cover|contain","blur()":"blur( <length> )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( <number-percentage> )","calc()":"calc( <calc-sum> )","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-value":"<number>|<dimension>|<percentage>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( [<shape-radius>]? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<hex-color>|<named-color>|currentcolor|<deprecated-system-color>","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"<angle-percentage>{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"[<linear-color-stop> [, <linear-color-hint>]?]# , <linear-color-stop>",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>* [<pseudo-element-selector> <pseudo-class-selector>*]*]!","compound-selector-list":"<compound-selector>#","complex-selector":"<compound-selector> [<combinator>? <compound-selector>]*","complex-selector-list":"<complex-selector>#","conic-gradient()":"conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contrast()":"contrast( [<number-percentage>] )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( <length>{2,3} <color>? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( [<shape-radius>{2}]? [at <position>]? )","ending-shape":"circle|ellipse","env()":"env( <custom-ident> , <declaration-value>? )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","fill-rule":"nonzero|evenodd","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-function-list":"[<filter-function>|<url>]+","final-bg-layer":"<'background-color'>||<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<box>||<box>","fit-content()":"fit-content( [<length>|<percentage>] )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|<number [1,1000]>","frequency-percentage":"<frequency>|<percentage>","general-enclosed":"[<function-token> <any-value> )]|( <ident> <any-value> )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( <number-percentage> )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )","hsla()":"hsla( <hue> <percentage> <percentage> [/ <alpha-value>]? )|hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",hue:"<number>|<angle>","hue-rotate()":"hue-rotate( <angle> )","hwb()":"hwb( [<hue>|none] [<percentage>|none] [<percentage>|none] [/ [<alpha-value>|none]]? )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length>|<percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( <number-percentage> )","keyframes-name":"<custom-ident>|<string>","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-block-list":"<keyframe-block>+","keyframe-selector":"from|to|<percentage>","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","line-names":"'[' <custom-ident>* ']'","line-name-list":"[<line-names>|<name-repeat>]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-gradient()":"linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length>|<percentage>|min-content|max-content|auto] , [<length>|<percentage>|<flex>|min-content|max-content|auto] )","name-repeat":"repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"<ident>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"<an-plus-b>|even|odd","opacity()":"opacity( [<number-percentage>] )","overflow-position":"unsafe|safe","outline-radius":"<length>|<percentage>","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[<page-selector>#]?","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [<fill-rule> ,]? <string> )","paint()":"paint( <ident> , <declaration-value>? )","perspective()":"perspective( <length> )","polygon()":"polygon( <fill-rule>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from <angle>]? [at <position>]? , <angular-color-stop-list> )","repeating-linear-gradient()":"repeating-linear-gradient( [<angle>|to <side-or-corner>]? , <color-stop-list> )","repeating-radial-gradient()":"repeating-radial-gradient( [<ending-shape>||<size>]? [at <position>]? , <color-stop-list> )","rgb()":"rgb( <percentage>{3} [/ <alpha-value>]? )|rgb( <number>{3} [/ <alpha-value>]? )|rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )","rgba()":"rgba( <percentage>{3} [/ <alpha-value>]? )|rgba( <number>{3} [/ <alpha-value>]? )|rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","saturate()":"saturate( <number-percentage> )","scale()":"scale( <number> , <number>? )","scale3d()":"scale3d( <number> , <number> , <number> )","scaleX()":"scaleX( <number> )","scaleY()":"scaleY( <number> )","scaleZ()":"scaleZ( <number> )","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"<length-percentage>|closest-side|farthest-side","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sepia()":"sepia( <number-percentage> )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","single-animation":"<time>||<easing-function>||<time>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<timeline-name>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-timing-function":"step-start|step-end|steps( <integer> [, <step-position>]? )","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-decl":"( <declaration> )","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","time-percentage":"<time>|<percentage>","timeline-name":"<custom-ident>|<string>","easing-function":"linear|<cubic-bezier-timing-function>|<step-timing-function>","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( [<length>|<percentage>] )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-width":"fill-available|min-intrinsic|intrinsic|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content|-webkit-min-content|-webkit-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-webkit-mask-clip-style":"border|border-box|padding|padding-box|content|content-box|text","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )","-ms-filter":"<string>",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>","bg-clip":"<box>|border|text","border-radius":"<length-percentage>{1,2}",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",left:"<length>|auto","mask-image":"<mask-reference>#",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke",ratio:"<number [0,∞]> [/ <number [0,∞]>]?","reversed-counter-name":"reversed( <counter-name> )",right:"<length>|auto","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto","track-group":"'(' [<string>* <track-minmax> <string>*]+ ')' ['[' <positive-integer> ']']?|<track-minmax>","track-list-v0":"[<string>* <track-group> <string>*]+|none","track-minmax":"minmax( <track-breadth> , <track-breadth> )|auto|<track-breadth>|fit-content",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,∞]>","positive-integer":"<integer [0,∞]>","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zooming":"none|zoom","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-image-region":"<shape>|auto","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<box>|border|padding|content|text]||[<box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<box>|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",all:"initial|inherit|unset|revert|revert-layer",animation:"<single-animation>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<easing-function>#","animation-timeline":"<single-animation-timeline>#",appearance:"none|auto|textfield|menulist-button|<compat-auto>","aspect-ratio":"auto|<ratio>",azimuth:"<angle>|[[left-side|far-left|left|center-left|center|center-right|right|far-right|right-side]||behind]|leftwards|rightwards","backdrop-filter":"none|<filter-function-list>","backface-visibility":"visible|hidden",background:"[<bg-layer> ,]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","block-overflow":"clip|ellipsis|<string>","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-color":"<'border-top-color'>{1,2}","border-block-style":"<'border-top-style'>","border-block-width":"<'border-top-width'>","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage>{1,2}","border-bottom-right-radius":"<length-percentage>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"collapse|separate","border-color":"<color>{1,4}","border-end-end-radius":"<length-percentage>{1,2}","border-end-start-radius":"<length-percentage>{1,2}","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length>|<number>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"<number-percentage>{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage>|<number>|auto]{1,4}","border-inline":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-style":"<'border-top-style'>","border-inline-width":"<'border-top-width'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage>{1,4} [/ <length-percentage>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length> <length>?","border-start-end-radius":"<length-percentage>{1,2}","border-start-start-radius":"<length-percentage>{1,2}","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage>{1,2}","border-top-right-radius":"<length-percentage>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"<length>|<percentage>|auto","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom|block-start|block-end|inline-start|inline-end","caret-color":"auto|<color>",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none",color:"<color>","print-color-adjust":"economy|exact","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance|balance-all","column-gap":"normal|<length-percentage>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"<length>|auto",columns:"<'column-width'>||<'column-count'>",contain:"none|strict|content|[size||layout||style||paint]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>]+]?","content-visibility":"visible|auto|hidden","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","empty-cells":"show|hide",filter:"none|<filter-function-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end",font:"[[<'font-style'>||<font-variant-css21>||<'font-weight'>||<'font-stretch'>]? <'font-size'> [/ <'line-height'>]? <'font-family'>]|caption|icon|menu|message-box|small-caption|status-bar","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-variation-settings":"normal|[<string> <number>]#","font-size":"<absolute-size>|<relative-size>|<length-percentage>","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps]","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-weight":"<font-weight-absolute>|bolder|lighter","forced-color-adjust":"auto|none",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","hyphenate-character":"auto|<string>",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>","input-security":"auto|none",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>",isolation:"auto|isolate","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"<length>|<percentage>|auto","letter-spacing":"normal|<length-percentage>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"[<length>|<percentage>|auto]{1,4}","margin-block":"<'margin-left'>{1,2}","margin-block-end":"<'margin-left'>","margin-block-start":"<'margin-left'>","margin-bottom":"<length>|<percentage>|auto","margin-inline":"<'margin-left'>{1,2}","margin-inline-end":"<'margin-left'>","margin-inline-start":"<'margin-left'>","margin-left":"<length>|<percentage>|auto","margin-right":"<length>|<percentage>|auto","margin-top":"<length>|<percentage>|auto","margin-trim":"none|in-flow|all",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<geometry-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<geometry-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","min-block-size":"<'min-width'>","min-height":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )","min-inline-size":"<'min-width'>","min-width":"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|<-non-standard-width>","mix-blend-mode":"<blend-mode>|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|ray( [<angle>&&<size>&&contain?] )|<path()>|<url>|[<basic-shape>||<geometry-box>]","offset-position":"auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<alpha-value>",order:"<integer>",orphans:"<integer>",outline:"[<'outline-color'>||<'outline-style'>||<'outline-width'>]","outline-color":"<color>|invert","outline-offset":"<length>","outline-style":"auto|<'border-style'>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,∞]>","overflow-inline":"visible|hidden|clip|scroll|auto","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto","overflow-y":"visible|hidden|clip|scroll|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"[<length>|<percentage>]{1,4}","padding-block":"<'padding-left'>{1,2}","padding-block-end":"<'padding-left'>","padding-block-start":"<'padding-left'>","padding-bottom":"<length>|<percentage>","padding-inline":"<'padding-left'>{1,2}","padding-inline-end":"<'padding-left'>","padding-inline-start":"<'padding-left'>","padding-left":"<length>|<percentage>","padding-right":"<length>|<percentage>","padding-top":"<length>|<percentage>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky",quotes:"none|auto|[<string> <string>]+",resize:"none|both|horizontal|vertical|block|inline",right:"<length>|<percentage>|auto",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-position":"[alternate||[over|under]]|inter-character",scale:"none|<number>{1,3}","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","scroll-behavior":"auto|smooth","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-start":"<length>","scroll-margin-block-end":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-start":"<length>","scroll-margin-inline-end":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","shape-image-threshold":"<alpha-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"[over|under]&&[right|left]","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-transform":"none|capitalize|uppercase|lowercase|full-width|full-size-kana","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]",top:"<length>|<percentage>|auto","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|contain|all","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",visibility:"visible|hidden|collapse","white-space":"normal|pre|nowrap|pre-wrap|pre-line|break-spaces",widows:"<integer>",width:"auto|<length>|<percentage>|min-content|max-content|fit-content|fit-content( <length-percentage> )|fill|stretch|intrinsic|-moz-max-content|-webkit-max-content|-moz-fit-content|-webkit-fit-content","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>","z-index":"auto|<integer>",zoom:"normal|reset|<number>|<percentage>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto","-webkit-user-select":"auto|none|text|all","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical","baseline-shift":"baseline|sub|super|<svg-length>",behavior:"<url>+","clip-rule":"nonzero|evenodd",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",fill:"<paint>","fill-opacity":"<number-zero-one>","fill-rule":"nonzero|evenodd","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision",src:"[<url> [format( <string># )]?|local( <family-name> )]#",speak:"auto|none|normal","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]",stroke:"<paint>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<number-zero-one>","stroke-width":"<svg-length>","text-anchor":"start|middle|end","unicode-range":"<urange>#","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"[auto|block|swap|fallback|optional]","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-variation-settings":"normal|[<string> <number>]#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-weight":"<font-weight-absolute>{1,2}","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]",size:"<length>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},property:{prelude:"<custom-property-name>",descriptors:{syntax:"<string>",inherits:"true|false","initial-value":"<string>"}},"scroll-timeline":{prelude:"<timeline-name>",descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},viewport:{prelude:null,descriptors:{height:"<viewport-length>{1,2}","max-height":"<viewport-length>","max-width":"<viewport-length>","max-zoom":"auto|<number>|<percentage>","min-height":"<viewport-length>","min-width":"<viewport-length>","min-zoom":"auto|<number>|<percentage>",orientation:"auto|portrait|landscape","user-zoom":"zoom|fixed","viewport-fit":"auto|contain|cover",width:"<viewport-length>{1,2}",zoom:"auto|<number>|<percentage>"}}}},_O=se({generate:()=>xO,name:()=>LO,parse:()=>cy,structure:()=>NO}),Rn=43,Dt=45,hl=110,Ur=!0,kO=!1;function gl(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===Rn||r===Dt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)st(this.charCodeAt(n))||this.error("Integer is expected",n)}function $o(e){return gl.call(this,0,e)}function hr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case hl:n="N is expected";break;case Dt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Dd(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(Rn,e)||this.isDelim(Dt,e)){t=this.isDelim(Rn,e)?Rn:Dt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),$o.call(this,Ur))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Rn&&n!==Dt&&this.error("Number sign is expected")),$o.call(this,t!==0),t===Dt?"-"+this.consume(10):this.consume(10)}var LO="AnPlusB",NO={a:[String,null],b:[String,null]};function cy(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)$o.call(this,kO),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Dt))switch(t="-1",hr.call(this,1,hl),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Dd.call(this);break;case 3:hr.call(this,2,Dt),this.next(),this.skipSC(),$o.call(this,Ur),n="-"+this.consume(10);break;default:hr.call(this,2,Dt),gl.call(this,3,Ur),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Rn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(Rn)&&(r=1,this.next()),hr.call(this,0,hl),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Dd.call(this);break;case 2:hr.call(this,1,Dt),this.next(),this.skipSC(),$o.call(this,Ur),n="-"+this.consume(10);break;default:hr.call(this,1,Dt),gl.call(this,2,Ur),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===Rn||r===Dt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&st(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),hr.call(this,i-this.tokenStart,hl),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Dd.call(this)):(hr.call(this,i-this.tokenStart+1,Dt),i+2===this.tokenEnd?(this.next(),this.skipSC(),$o.call(this,Ur),n="-"+this.consume(10)):(gl.call(this,i-this.tokenStart+2,Ur),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Rn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Rn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function xO(e){if(e.a){const t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){const n=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}var OO=se({generate:()=>DO,name:()=>MO,parse:()=>dy,structure:()=>IO,walkContext:()=>PO});function uy(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function RO(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}var MO="Atrule",PO="atrule",IO={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function dy(){const e=this.tokenStart;let t,n,r=null,o=null;switch(this.eat(3),t=this.substrToCursor(e+1),n=t.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?r=this.parseWithFallback(this.AtrulePrelude.bind(this,t),uy):r=uy.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].block=="function"?o=this.atrule[n].block.call(this):o=this.Block(RO.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function DO(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var BO=se({generate:()=>WO,name:()=>HO,parse:()=>fy,structure:()=>$O,walkContext:()=>FO}),HO="AtrulePrelude",FO="atrulePrelude",$O={children:[[]]};function fy(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function WO(e){this.children(e)}var qO=se({generate:()=>KO,name:()=>XO,parse:()=>py,structure:()=>YO}),zO=36,my=42,bl=61,UO=94,Bd=124,VO=126;function jO(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(my)?(t=!0,this.next()):this.isDelim(Bd)||this.eat(1),this.isDelim(Bd)?this.charCodeAt(this.tokenStart+1)!==bl?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function GO(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==bl&&t!==VO&&t!==UO&&t!==zO&&t!==my&&t!==Bd&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==bl&&(this.isDelim(bl)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var XO="AttributeSelector",YO={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function py(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=jO.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=GO.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function KO(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}var ZO=se({generate:()=>rR,name:()=>eR,parse:()=>by,structure:()=>nR,walkContext:()=>tR});function hy(e){return this.Raw(e,null,!0)}function QO(){return this.parseWithFallback(this.Rule,hy)}function gy(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function JO(){if(this.tokenType===17)return gy.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,gy);return this.tokenType===17&&this.next(),e}var eR="Block",tR="block",nR={children:[["Atrule","Rule","Declaration"]]};function by(e){const t=e?JO:QO,n=this.tokenStart;let r=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule,hy));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function rR(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var oR=se({generate:()=>aR,name:()=>iR,parse:()=>yy,structure:()=>sR}),iR="Brackets",sR={children:[[]]};function yy(e,t){const n=this.tokenStart;let r=null;return this.eat(19),r=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}function aR(e){this.token(9,"["),this.children(e),this.token(9,"]")}var lR=se({generate:()=>uR,name:()=>"CDC",parse:()=>vy,structure:()=>cR}),xj="CDC",cR=[];function vy(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function uR(){this.token(15,"-->")}var dR=se({generate:()=>mR,name:()=>"CDO",parse:()=>Ey,structure:()=>fR}),Oj="CDO",fR=[];function Ey(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function mR(){this.token(14,"<!--")}var pR=se({generate:()=>yR,name:()=>gR,parse:()=>Sy,structure:()=>bR}),hR=46,gR="ClassSelector",bR={name:String};function Sy(){return this.eatDelim(hR),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function yR(e){this.token(9,"."),this.token(1,e.name)}var vR=se({generate:()=>TR,name:()=>CR,parse:()=>Cy,structure:()=>AR}),ER=43,wy=47,SR=62,wR=126,CR="Combinator",AR={name:String};function Cy(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case SR:case ER:case wR:this.next();break;case wy:this.next(),this.eatIdent("deep"),this.eatDelim(wy);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function TR(e){this.tokenize(e.name)}var _R=se({generate:()=>OR,name:()=>NR,parse:()=>Ay,structure:()=>xR}),kR=42,LR=47,NR="Comment",xR={value:String};function Ay(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===kR&&this.charCodeAt(t-1)===LR&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function OR(e){this.token(25,"/*"+e.value+"*/")}var RR=se({generate:()=>UR,name:()=>WR,parse:()=>ky,structure:()=>zR,walkContext:()=>qR}),Ty=33,MR=35,PR=36,IR=38,DR=42,BR=43,_y=47;function HR(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function FR(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function $R(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(Ty)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var WR="Declaration",qR="declaration",zR={important:[Boolean,String],property:String,value:["Value","Raw"]};function ky(){const e=this.tokenStart,t=this.tokenIndex,n=VR.call(this),r=fd(n),o=r?this.parseCustomProperty:this.parseValue,i=r?FR:HR;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback($R,i):a=i.call(this,this.tokenIndex),r&&a.type==="Value"&&a.children.isEmpty){for(let c=l-this.tokenIndex;c<=0;c++)if(this.lookupType(c)===13){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(Ty)&&(s=jR.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:s,property:n,value:a}}function UR(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function VR(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case DR:case PR:case BR:case MR:case IR:this.next();break;case _y:this.next(),this.isDelim(_y)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function jR(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var GR=se({generate:()=>ZR,name:()=>YR,parse:()=>Ly,structure:()=>KR});function XR(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var YR="DeclarationList",KR={children:[["Declaration"]]};function Ly(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;default:e.push(this.parseWithFallback(this.Declaration,XR))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function ZR(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var QR=se({generate:()=>tM,name:()=>JR,parse:()=>Ny,structure:()=>eM}),JR="Dimension",eM={value:String,unit:String};function Ny(){const e=this.tokenStart,t=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function tM(e){this.token(12,e.value+e.unit)}var nM=se({generate:()=>sM,name:()=>rM,parse:()=>xy,structure:()=>iM,walkContext:()=>oM}),rM="Function",oM="function",iM={name:String,children:[[]]};function xy(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase();let i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function sM(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var aM=se({generate:()=>uM,name:()=>lM,parse:()=>Oy,structure:()=>cM,xxx:()=>"XXX"}),Rj="XXX",lM="Hash",cM={value:String};function Oy(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function uM(e){this.token(4,"#"+e.value)}var dM=se({generate:()=>pM,name:()=>fM,parse:()=>Ry,structure:()=>mM}),fM="Identifier",mM={name:String};function Ry(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function pM(e){this.token(1,e.name)}var hM=se({generate:()=>yM,name:()=>gM,parse:()=>My,structure:()=>bM}),gM="IdSelector",bM={name:String};function My(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function yM(e){this.token(9,"#"+e.name)}var vM=se({generate:()=>wM,name:()=>EM,parse:()=>Py,structure:()=>SM}),EM="MediaFeature",SM={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function Py(){const e=this.tokenStart;let t,n=null;if(this.eat(21),this.skipSC(),t=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?n=this.Ratio():n=this.Number();break;case 12:n=this.Dimension();break;case 1:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eat(22),{type:"MediaFeature",loc:this.getLocation(e,this.tokenStart),name:t,value:n}}function wM(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var CM=se({generate:()=>_M,name:()=>AM,parse:()=>Iy,structure:()=>TM}),AM="MediaQuery",TM={children:[["Identifier","MediaFeature","WhiteSpace"]]};function Iy(){const e=this.createList();let t=null;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t=this.Identifier();break;case 21:t=this.MediaFeature();break;default:break e}e.push(t)}return t===null&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}}function _M(e){this.children(e)}var kM=se({generate:()=>xM,name:()=>LM,parse:()=>Dy,structure:()=>NM}),LM="MediaQueryList",NM={children:[["MediaQuery"]]};function Dy(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function xM(e){this.children(e,()=>this.token(18,","))}var OM=se({generate:()=>MM,name:()=>"Nth",parse:()=>By,structure:()=>RM}),Mj="Nth",RM={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function By(){this.skipSC();const e=this.tokenStart;let t=e,n=null,r;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?r=this.Identifier():r=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:r,selector:n}}function MM(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var PM=se({generate:()=>BM,name:()=>IM,parse:()=>Hy,structure:()=>DM}),IM="Number",DM={value:String};function Hy(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function BM(e){this.token(10,e.value)}var HM=se({generate:()=>WM,name:()=>FM,parse:()=>Fy,structure:()=>$M}),FM="Operator",$M={value:String};function Fy(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function WM(e){this.tokenize(e.value)}var qM=se({generate:()=>VM,name:()=>zM,parse:()=>$y,structure:()=>UM}),zM="Parentheses",UM={children:[[]]};function $y(e,t){const n=this.tokenStart;let r=null;return this.eat(21),r=e.call(this,t),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}function VM(e){this.token(21,"("),this.children(e),this.token(22,")")}var jM=se({generate:()=>YM,name:()=>GM,parse:()=>Wy,structure:()=>XM}),GM="Percentage",XM={value:String};function Wy(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function YM(e){this.token(11,e.value+"%")}var KM=se({generate:()=>eP,name:()=>ZM,parse:()=>qy,structure:()=>JM,walkContext:()=>QM}),ZM="PseudoClassSelector",QM="function",JM={name:String,children:[["Raw"],null]};function qy(){const e=this.tokenStart;let t=null,n,r;return this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):n=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function eP(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var tP=se({generate:()=>iP,name:()=>nP,parse:()=>zy,structure:()=>oP,walkContext:()=>rP}),nP="PseudoElementSelector",rP="function",oP={name:String,children:[["Raw"],null]};function zy(){const e=this.tokenStart;let t=null,n,r;return this.eat(16),this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(this.tokenIndex,null,!1))),this.eat(22)):n=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function iP(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var sP=se({generate:()=>dP,name:()=>cP,parse:()=>Vy,structure:()=>uP}),aP=47,lP=46;function Uy(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!st(n)&&n!==lP&&this.error("Unsigned number is expected",this.tokenStart-e.length+t)}return Number(e)===0&&this.error("Zero number is not allowed",this.tokenStart-e.length),e}var cP="Ratio",uP={left:String,right:String};function Vy(){const e=this.tokenStart,t=Uy.call(this);let n;return this.skipSC(),this.eatDelim(aP),n=Uy.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function dP(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var fP=se({generate:()=>hP,name:()=>"Raw",parse:()=>jy,structure:()=>pP});function mP(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var Pj="Raw",pP={value:String};function jy(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=mP.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function hP(e){this.tokenize(e.value)}var gP=se({generate:()=>SP,name:()=>yP,parse:()=>Xy,structure:()=>EP,walkContext:()=>vP});function Gy(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function bP(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var yP="Rule",vP="rule",EP={prelude:["SelectorList","Raw"],block:["Block"]};function Xy(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(bP,Gy):n=Gy.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function SP(e){this.node(e.prelude),this.node(e.block)}var wP=se({generate:()=>TP,name:()=>CP,parse:()=>Yy,structure:()=>AP}),CP="Selector",AP={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function Yy(){const e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function TP(e){this.children(e)}var _P=se({generate:()=>xP,name:()=>kP,parse:()=>Ky,structure:()=>NP,walkContext:()=>LP}),kP="SelectorList",LP="selector",NP={children:[["Selector","Raw"]]};function Ky(){const e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function xP(e){this.children(e,()=>this.token(18,","))}var Hd=92,Zy=34,Qy=39;function Jy(e){const t=e.length,n=e.charCodeAt(0),r=n===Zy||n===Qy?1:0,o=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let i="";for(let s=r;s<=o;s++){let a=e.charCodeAt(s);if(a===Hd){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),xn(Hd,a)){const l=s-1,c=Oo(e,l);s=c-1,i+=eb(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Fd(e,t){const n=t?"'":'"',r=t?Qy:Zy;let o="",i=!1;for(let s=0;s<e.length;s++){const a=e.charCodeAt(s);if(a===0){o+="�";continue}if(a<=31||a===127){o+="\\"+a.toString(16),i=!0;continue}a===r||a===Hd?(o+="\\"+e.charAt(s),i=!1):(i&&(fr(a)||zr(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var OP=se({generate:()=>PP,name:()=>RP,parse:()=>ev,structure:()=>MP}),RP="String",MP={value:String};function ev(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Jy(this.consume(5))}}function PP(e){this.token(5,Fd(e.value))}var IP=se({generate:()=>$P,name:()=>BP,parse:()=>nv,structure:()=>FP,walkContext:()=>HP}),DP=33;function tv(e){return this.Raw(e,null,!1)}var BP="StyleSheet",HP="stylesheet",FP={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function nv(){const e=this.tokenStart,t=this.createList();let n;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==DP){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case 15:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,tv);break;default:n=this.parseWithFallback(this.Rule,tv)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function $P(e){this.children(e)}var WP=se({generate:()=>VP,name:()=>zP,parse:()=>ov,structure:()=>UP}),qP=42,rv=124;function $d(){this.tokenType!==1&&this.isDelim(qP)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var zP="TypeSelector",UP={name:String};function ov(){const e=this.tokenStart;return this.isDelim(rv)?(this.next(),$d.call(this)):($d.call(this),this.isDelim(rv)&&(this.next(),$d.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function VP(e){this.tokenize(e.name)}var jP=se({generate:()=>ZP,name:()=>YP,parse:()=>av,structure:()=>KP}),iv=43,sv=45,Wd=63;function es(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===sv&&t&&n!==0)return es.call(this,e+n+1,!1),-1;fr(o)||this.error(t&&n!==0?"Hyphen minus"+(n<6?" or hex digit":"")+" is expected":n<6?"Hex digit is expected":"Unexpected input",r),++n>6&&this.error("Too many hex digits",r)}return this.next(),n}function yl(e){let t=0;for(;this.isDelim(Wd);)++t>e&&this.error("Too many question marks"),this.next()}function GP(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===iv?"Plus sign":"Hyphen minus")+" is expected")}function XP(){let e=0;switch(this.tokenType){case 10:if(e=es.call(this,1,!0),this.isDelim(Wd)){yl.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){GP.call(this,sv),es.call(this,1,!1);break}break;case 12:e=es.call(this,1,!0),e>0&&yl.call(this,6-e);break;default:if(this.eatDelim(iv),this.tokenType===1){e=es.call(this,0,!0),e>0&&yl.call(this,6-e);break}if(this.isDelim(Wd)){this.next(),yl.call(this,5);break}this.error("Hex digit or question mark is expected")}}var YP="UnicodeRange",KP={value:String};function av(){const e=this.tokenStart;return this.eatIdent("u"),XP.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function ZP(e){this.tokenize(e.value)}var QP=32,qd=92,JP=34,e5=39,t5=40,lv=41;function n5(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===lv?t-2:t-1,o="";for(;n<r&&zr(e.charCodeAt(n));)n++;for(;n<r&&zr(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===qd){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),xn(qd,s)){const a=i-1,l=Oo(e,a);i=l-1,o+=eb(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function cv(e){let t="",n=!1;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);if(o===0){t+="�";continue}if(o<=31||o===127){t+="\\"+o.toString(16),n=!0;continue}o===QP||o===qd||o===JP||o===e5||o===t5||o===lv?(t+="\\"+e.charAt(r),n=!1):(n&&fr(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var r5=se({generate:()=>i5,name:()=>"Url",parse:()=>uv,structure:()=>o5}),Ij="Url",o5={value:String};function uv(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=n5(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Jy(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function i5(e){this.token(7,cv(e.value))}var s5=se({generate:()=>c5,name:()=>a5,parse:()=>dv,structure:()=>l5}),a5="Value",l5={children:[[]]};function dv(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function c5(e){this.children(e)}var u5=se({generate:()=>p5,name:()=>f5,parse:()=>fv,structure:()=>m5}),d5=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),f5="WhiteSpace",m5={value:String};function fv(){return this.eat(13),d5}function p5(e){this.token(13,e.value)}var mv=se({AnPlusB:()=>_O,Atrule:()=>OO,AtrulePrelude:()=>BO,AttributeSelector:()=>qO,Block:()=>ZO,Brackets:()=>oR,CDC:()=>lR,CDO:()=>dR,ClassSelector:()=>pR,Combinator:()=>vR,Comment:()=>_R,Declaration:()=>RR,DeclarationList:()=>GR,Dimension:()=>QR,Function:()=>nM,Hash:()=>aM,IdSelector:()=>hM,Identifier:()=>dM,MediaFeature:()=>vM,MediaQuery:()=>CM,MediaQueryList:()=>kM,Nth:()=>OM,Number:()=>PM,Operator:()=>HM,Parentheses:()=>qM,Percentage:()=>jM,PseudoClassSelector:()=>KM,PseudoElementSelector:()=>tP,Ratio:()=>sP,Raw:()=>fP,Rule:()=>gP,Selector:()=>wP,SelectorList:()=>_P,String:()=>OP,StyleSheet:()=>IP,TypeSelector:()=>WP,UnicodeRange:()=>jP,Url:()=>r5,Value:()=>s5,WhiteSpace:()=>u5}),h5={generic:!0,...TO,node:mv},g5=35,b5=42,pv=43,y5=45,v5=47,E5=117;function hv(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,E5)&&this.cmpChar(this.tokenStart+1,pv)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===v5||t===b5||t===pv||t===y5)return this.Operator();t===g5&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var S5={getNode:hv},w5=35,C5=42,A5=43,T5=47,gv=46,_5=62,k5=124,L5=126;function N5(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function x5(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===gv&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case A5:case _5:case L5:case T5:return this.Combinator();case gv:return this.ClassSelector();case C5:case k5:return this.TypeSelector();case w5:return this.IdSelector()}}}var O5={onWhiteSpace:N5,getNode:x5};function R5(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function M5(){const e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());const t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.tokenIndex,this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let r=t-this.tokenIndex;r<=0;r++)if(this.lookupType(r)===13){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}function bv(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var P5={getNode:hv,onWhiteSpace(e,t){bv(e)&&(e.value=" "+e.value),bv(t.last)&&(t.last.value+=" ")},expression:R5,var:M5},I5=se({AtrulePrelude:()=>S5,Selector:()=>O5,Value:()=>P5}),D5={parse:{prelude:null,block(){return this.Block(!0)}}},B5={parse:{prelude(){const e=this.createList();switch(this.skipSC(),this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}},H5={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},F5={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function $5(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function W5(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):yv.call(this)}function yv(){const e=this.createList();let t;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 25:case 13:this.next();continue;case 2:t=this.Function($5,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(W5,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var q5={parse:{prelude(){const e=yv.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},z5={"font-face":D5,import:B5,media:H5,page:F5,supports:q5},Vr={parse(){return this.createSingleNodeList(this.SelectorList())}},U5={parse(){return this.createSingleNodeList(this.Selector())}},vv={parse(){return this.createSingleNodeList(this.Identifier())}},vl={parse(){return this.createSingleNodeList(this.Nth())}},V5={dir:vv,has:Vr,lang:vv,matches:Vr,is:Vr,"-moz-any":Vr,"-webkit-any":Vr,where:Vr,not:Vr,"nth-child":vl,"nth-last-child":vl,"nth-last-of-type":vl,"nth-of-type":vl,slotted:U5},j5=se({AnPlusB:()=>cy,Atrule:()=>dy,AtrulePrelude:()=>fy,AttributeSelector:()=>py,Block:()=>by,Brackets:()=>yy,CDC:()=>vy,CDO:()=>Ey,ClassSelector:()=>Sy,Combinator:()=>Cy,Comment:()=>Ay,Declaration:()=>ky,DeclarationList:()=>Ly,Dimension:()=>Ny,Function:()=>xy,Hash:()=>Oy,IdSelector:()=>My,Identifier:()=>Ry,MediaFeature:()=>Py,MediaQuery:()=>Iy,MediaQueryList:()=>Dy,Nth:()=>By,Number:()=>Hy,Operator:()=>Fy,Parentheses:()=>$y,Percentage:()=>Wy,PseudoClassSelector:()=>qy,PseudoElementSelector:()=>zy,Ratio:()=>Vy,Raw:()=>jy,Rule:()=>Xy,Selector:()=>Yy,SelectorList:()=>Ky,String:()=>ev,StyleSheet:()=>nv,TypeSelector:()=>ov,UnicodeRange:()=>av,Url:()=>uv,Value:()=>dv,WhiteSpace:()=>fv}),G5={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},scope:I5,atrule:z5,pseudo:V5,node:j5},X5={node:mv},Y5=AO({...h5,...G5,...X5});function zd(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof Ve?r=r.map(zd):r.constructor===Object&&(r=zd(r))),t[n]=r}return t}var{tokenize:Dj,parse:K5,generate:Mn,lexer:Ev,createLexer:Bj,walk:kt,find:Hj,findLast:Fj,findAll:$j,toPlainObject:Wj,fromPlainObject:qj,fork:Z5}=Y5,{hasOwnProperty:Q5}=Object.prototype;function Ud(e,t){const n=Object.create(null);if(!Array.isArray(e))return null;for(let r of e)t&&(r=r.toLowerCase()),n[r]=!0;return n}function Sv(e){if(!e)return null;const t=Ud(e.tags,!0),n=Ud(e.ids),r=Ud(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function J5(e){let t=!1;if(e.scopes&&Array.isArray(e.scopes)){t=Object.create(null);for(let n=0;n<e.scopes.length;n++){const r=e.scopes[n];if(!r||!Array.isArray(r))throw new Error("Wrong usage format");for(const o of r){if(Q5.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:Sv(e),blacklist:Sv(e.blacklist),scopes:t}}function jr(e){return!e||!e.children||e.children.isEmpty}function wv(e,t){return e!==null&&e.children===t}function e3(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),jr(e.block))){n.remove(t);return}switch(e.name){case"charset":if(jr(e.prelude)){n.remove(t);return}if(t.prev){n.remove(t);return}break;case"import":if(this.stylesheet===null||!this.stylesheet.firstAtrulesAllowed){n.remove(t);return}n.prevUntil(t.prev,function(r){if(!(r.type==="Atrule"&&(r.name==="import"||r.name==="charset")))return this.root.firstAtrulesAllowed=!1,n.remove(t),!0},this);break;default:{const r=dn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(jr(e.prelude)||jr(e.block))&&n.remove(t)}}}function t3(e,t,n){n.remove(t)}function n3(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}Po(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function r3(e,t,n){(wv(this.stylesheet,n)||wv(this.block,n))&&n.remove(t)}var{hasOwnProperty:Wo}=Object.prototype,o3=new Set(["keyframes"]);function Cv(e,t){return e.children.forEach((n,r,o)=>{let i=!1;kt(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&Cv(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!Wo.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&Wo.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!Wo.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&Wo.call(t.blacklist.ids,s.name)&&(i=!0);break;case"TypeSelector":s.name.charAt(s.name.length-1)!=="*"&&(t.whitelist!==null&&t.whitelist.tags!==null&&!Wo.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&Wo.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function i3(e,t,n,r){if(jr(e.prelude)||jr(e.block)){n.remove(t);return}if(this.atrule&&o3.has(dn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(Cv(e.prelude,o),jr(e.prelude))){n.remove(t);return}}function s3(e,t,n){if(t.data.name!=="*")return;const r=t.next&&t.next.data.type;(r==="IdSelector"||r==="ClassSelector"||r==="AttributeSelector"||r==="PseudoClassSelector"||r==="PseudoElementSelector")&&n.remove(t)}function a3(e,t,n){n.remove(t)}var Av={Atrule:e3,Comment:t3,Declaration:n3,Raw:r3,Rule:i3,TypeSelector:s3,WhiteSpace:a3};function l3(e,t){kt(e,{leave(n,r,o){Av.hasOwnProperty(n.type)&&Av[n.type].call(this,n,r,o,t)}})}function c3(e){e.block.children.forEach(t=>{t.prelude.children.forEach(n=>{n.children.forEach((r,o)=>{r.type==="Percentage"&&r.value==="100"?o.data={type:"TypeSelector",loc:r.loc,name:"to"}:r.type==="TypeSelector"&&r.name==="from"&&(o.data={type:"Percentage",loc:r.loc,value:"0"})})})})}function u3(e){dn(e.name).basename==="keyframes"&&c3(e)}var d3=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function f3(e){return e===""||e==="-"?!1:!d3.test(e)}function m3(e){const t=e.value;!t||t.type!=="String"||f3(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function p3(e){const t=e.children;t.forEachRight(function(n,r){if(n.type==="Identifier"){if(n.name==="bold")r.data={type:"Number",loc:n.loc,value:"700"};else if(n.name==="normal"){const o=r.prev;o&&o.data.type==="Operator"&&o.data.value==="/"&&this.remove(o),this.remove(r)}}}),t.isEmpty&&t.insert(t.createItem({type:"Identifier",name:"normal"}))}function h3(e){const t=e.children.head.data;if(t.type==="Identifier")switch(t.name){case"normal":e.children.head.data={type:"Number",loc:t.loc,value:"400"};break;case"bold":e.children.head.data={type:"Number",loc:t.loc,value:"700"}}}function g3(e){function t(){r.length||r.unshift({type:"Number",loc:null,value:"0"},{type:"Number",loc:null,value:"0"}),n.push.apply(n,r),r=[]}let n=[],r=[];e.children.forEach(o=>{if(o.type==="Operator"&&o.value===","){t(),n.push(o);return}o.type==="Identifier"&&(o.name==="transparent"||o.name==="none"||o.name==="repeat"||o.name==="scroll")||r.push(o)}),t(),e.children=new Ve().fromArray(n)}function Tv(e){e.children.forEach((t,n,r)=>{t.type==="Identifier"&&t.name.toLowerCase()==="none"&&(r.head===r.tail?n.data={type:"Number",loc:t.loc,value:"0"}:r.remove(n))})}var _v={font:p3,"font-weight":h3,background:g3,border:Tv,outline:Tv};function b3(e){if(!this.declaration)return;const t=Po(this.declaration.property);_v.hasOwnProperty(t.basename)&&_v[t.basename](e)}var y3=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,v3=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,E3=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function El(e,t){const n=t&&t.prev!==null&&E3.has(t.prev.data.type)?v3:y3;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function S3(e){e.value=El(e.value)}var w3=new Set(["calc","min","max","clamp"]),C3=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function A3(e,t){const n=El(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!C3.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&w3.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var T3=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function _3(e,t){e.value=El(e.value),e.value==="0"&&this.declaration&&!T3.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},Ev.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function k3(e){e.value=e.value.replace(/\\/g,"/")}var kv={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Lv={8e5:"maroon",800080:"purple",808e3:"olive",808080:"gray","00ffff":"cyan",f0ffff:"azure",f5f5dc:"beige",ffe4c4:"bisque","000000":"black","0000ff":"blue",a52a2a:"brown",ff7f50:"coral",ffd700:"gold","008000":"green","4b0082":"indigo",fffff0:"ivory",f0e68c:"khaki","00ff00":"lime",faf0e6:"linen","000080":"navy",ffa500:"orange",da70d6:"orchid",cd853f:"peru",ffc0cb:"pink",dda0dd:"plum",f00:"red",ff0000:"red",fa8072:"salmon",a0522d:"sienna",c0c0c0:"silver",fffafa:"snow",d2b48c:"tan","008080":"teal",ff6347:"tomato",ee82ee:"violet",f5deb3:"wheat",ffffff:"white",ffff00:"yellow"};function Vd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Nv(e,t,n,r){let o,i,s;if(t===0)o=i=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;o=Vd(l,a,e+1/3),i=Vd(l,a,e),s=Vd(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function jd(e){return e=e.toString(16),e.length===1?"0"+e:e}function Gd(e,t,n){let r=e.head,o=[],i=!1;for(;r!==null;){const{type:s,value:a}=r.data;switch(s){case"Number":case"Percentage":if(i)return;i=!0,o.push({type:s,value:Number(a)});break;case"Operator":if(a===","){if(!i)return;i=!1}else if(i||a!=="+")return;break;default:return}r=r.next}if(o.length===t){if(o.length===4){if(o[3].type!=="Number")return;o[3].type="Alpha"}if(n){if(o[0].type!==o[1].type||o[0].type!==o[2].type)return}else{if(o[0].type!=="Number"||o[1].type!=="Percentage"||o[2].type!=="Percentage")return;o[0].type="Angle"}return o.map(function(s){let a=Math.max(0,s.value);switch(s.type){case"Number":a=Math.min(a,255);break;case"Percentage":if(a=Math.min(a,100)/100,!n)return a;a=255*a;break;case"Angle":return(a%360+360)%360/360;case"Alpha":return Math.min(a,1)}return Math.round(a)})}}function L3(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Gd(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=Nv(...r),e.name="rgba"),r[3]===0){const o=this.function&&this.function.name;if(r[0]===0&&r[1]===0&&r[2]===0||!/^(?:to|from|color-stop)$|gradient$/i.test(o)){t.data={type:"Identifier",loc:e.loc,name:"transparent"};return}}if(r[3]!==1){e.children.forEach((o,i,s)=>{if(o.type==="Operator"){o.value!==","&&s.remove(i);return}i.data={type:"Number",loc:o.loc,value:El(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Gd(e.children,3,!1),!r)return;r=Nv(...r),n="rgb"}if(n==="rgb"){if(r=r||Gd(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:jd(r[0])+jd(r[1])+jd(r[2])},xv(t.data,t)}}function N3(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(kv.hasOwnProperty(n)&&Ev.matchDeclaration(this.declaration).isType(e,"color")){const r=kv[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function xv(e,t){let n=e.value.toLowerCase();n.length===6&&n[0]===n[1]&&n[2]===n[3]&&n[4]===n[5]&&(n=n[0]+n[2]+n[4]),Lv[n]?t.data={type:"Identifier",loc:e.loc,name:Lv[n]}:e.value=n}var Ov={Atrule:u3,AttributeSelector:m3,Value:b3,Dimension:A3,Percentage:_3,Number:S3,Url:k3,Hash:xv,Identifier:N3,Function:L3};function x3(e){kt(e,{leave(t,n,r){Ov.hasOwnProperty(t.type)&&Ov[t.type].call(this,t,n,r)}})}var O3=class{constructor(){this.map=new Map}resolve(e){let t=this.map.get(e);return t===void 0&&(t=this.map.size+1,this.map.set(e,t)),t}};function R3(){const e=new O3;return function(n){const r=Mn(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function M3(e){return e.type==="Raw"?K5(e.value,{context:"selectorList"}):e}function P3(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function Rv(e){return M3(e).children.reduce((t,n)=>P3(Xd(n),t),[0,0,0])}function Xd(e){let t=0,n=0,r=0;return e.children.forEach(o=>{switch(o.type){case"IdSelector":t++;break;case"ClassSelector":case"AttributeSelector":n++;break;case"PseudoClassSelector":switch(o.name.toLowerCase()){case"not":case"has":case"is":case"matches":case"-webkit-any":case"-moz-any":{const[i,s,a]=Rv(o.children.first);t+=i,n+=s,r+=a;break}case"nth-child":case"nth-last-child":{const i=o.children.first;if(i.type==="Nth"&&i.selector){const[s,a,l]=Rv(i.selector);t+=s,n+=a+1,r+=l}else n++;break}case"where":break;case"before":case"after":case"first-line":case"first-letter":r++;break;default:n++}break;case"TypeSelector":o.name.endsWith("*")||r++;break;case"PseudoElementSelector":r++}}),[t,n,r]}var I3=new Set(["first-letter","first-line","after","before"]),D3=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function B3(e,t){const n=new Set;e.prelude.children.forEach(function(r){let o="*",i=0;r.children.forEach(function(s){switch(s.type){case"ClassSelector":if(t&&t.scopes){const a=t.scopes[s.name]||0;if(i!==0&&a!==i)throw new Error("Selector can't has classes from different scopes: "+Mn(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();D3.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();I3.has(a)||n.add(`::${a}`);break}case"TypeSelector":o=s.name.toLowerCase();break;case"AttributeSelector":s.flags&&n.add(`[${s.flags.toLowerCase()}]`);break;case"Combinator":o="*"}}),r.compareMarker=Xd(r).toString(),r.id=null,r.id=Mn(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function H3(e,t){const n=R3();return kt(e,{visit:"Rule",enter(r){r.block.children.forEach(n),B3(r,t.usage)}}),kt(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=Mn(r.prelude)),dn(r.name).basename==="keyframes"&&(r.block.avoidRulesMerge=!0,r.block.children.forEach(function(o){o.prelude.children.forEach(function(i){i.compareMarker=i.id})}))}}),{declaration:n}}var{hasOwnProperty:Mv}=Object.prototype;function Pv(e,t,n,r){const o=t.data,i=dn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);Mv.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],Mv.call(e[i],s)||(e[i][s]=new Ve),e[i][s].append(n.remove(t))}function F3(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=dn(o.name).basename;switch(a){case"keyframes":Pv(n,i,s,!0);return;case"media":if(t.forceMediaMerge){Pv(n,i,s,!1);return}}r===null&&a!=="charset"&&a!=="import"&&(r=i)}else r===null&&(r=i)});for(const o in n)for(const i in n[o])e.children.insertList(n[o][i],o==="media"?null:r)}function Iv(e){return e.type==="Atrule"&&e.name==="media"}function $3(e,t,n){if(!Iv(e))return;const r=t.prev&&t.prev.data;!r||!Iv(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function W3(e,t){F3(e,t),kt(e,{visit:"Atrule",reverse:!0,enter:$3})}var{hasOwnProperty:q3}=Object.prototype;function Dv(e,t){let n=e.head,r=t.head;for(;n!==null&&r!==null&&n.data.id===r.data.id;)n=n.next,r=r.next;return n===null&&r===null}function Bv(e,t){let n=e.head,r=t.head;for(;n!==null&&r!==null&&n.data.id===r.data.id;)n=n.next,r=r.next;return n===null&&r===null}function z3(e,t){const n={eq:[],ne1:[],ne2:[],ne2overrided:[]},r=Object.create(null),o=Object.create(null);for(let i=t.head;i;i=i.next)o[i.data.id]=!0;for(let i=e.head;i;i=i.next){const s=i.data;s.fingerprint&&(r[s.fingerprint]=s.important),o[s.id]?(o[s.id]=!1,n.eq.push(s)):n.ne1.push(s)}for(let i=t.head;i;i=i.next){const s=i.data;o[s.id]&&((!q3.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function ts(e,t){return t.forEach(n=>{const r=n.id;let o=e.head;for(;o;){const i=o.data.id;if(i===r)return;if(i>r)break;o=o.next}e.insert(e.createItem(n),o)}),e}function Hv(e,t){let n=e.head;for(;n!==null;){let r=t.head;for(;r!==null;){if(n.data.compareMarker===r.data.compareMarker)return!0;r=r.next}n=n.next}return!1}function Sl(e){switch(e.type){case"Rule":return Hv(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some(Sl,this);break;case"Declaration":return!1}return!0}function U3(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return Sl.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(Dv(s,r))return a.appendList(o),n.remove(t),!0;if(Bv(o,a))return ts(s,r),n.remove(t),!0}return Hv(r,s)})}function V3(e){kt(e,{visit:"Rule",enter:U3})}function j3(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new Ve;o.insert(r.remove(r.head)),n.insert(n.createItem({type:"Rule",loc:e.loc,prelude:{type:"SelectorList",loc:e.prelude.loc,children:o},block:{type:"Block",loc:e.block.loc,children:e.block.children.copy()},pseudoSignature:e.pseudoSignature}),t)}}function G3(e){kt(e,{visit:"Rule",reverse:!0,enter:j3})}var Fv=1,X3=2,qo=0,ns=1,Yd=2,wl=3,$v=["top","right","bottom","left"],Y3={"margin-top":"top","margin-right":"right","margin-bottom":"bottom","margin-left":"left","padding-top":"top","padding-right":"right","padding-bottom":"bottom","padding-left":"left","border-top-color":"top","border-right-color":"right","border-bottom-color":"bottom","border-left-color":"left","border-top-width":"top","border-right-width":"right","border-bottom-width":"bottom","border-left-width":"left","border-top-style":"top","border-right-style":"right","border-bottom-style":"bottom","border-left-style":"left"},Wv={margin:"margin","margin-top":"margin","margin-right":"margin","margin-bottom":"margin","margin-left":"margin",padding:"padding","padding-top":"padding","padding-right":"padding","padding-bottom":"padding","padding-left":"padding","border-color":"border-color","border-top-color":"border-color","border-right-color":"border-color","border-bottom-color":"border-color","border-left-color":"border-color","border-width":"border-width","border-top-width":"border-width","border-right-width":"border-width","border-bottom-width":"border-width","border-left-width":"border-width","border-style":"border-style","border-top-style":"border-style","border-right-style":"border-style","border-bottom-style":"border-style","border-left-style":"border-style"},K3=class{constructor(e){this.name=e,this.loc=null,this.iehack=void 0,this.sides={top:null,right:null,bottom:null,left:null}}getValueSequence(e,t){const n=[];let r="";return e.value.type!=="Value"||e.value.children.some(function(o){let i=!1;switch(o.type){case"Identifier":switch(o.name){case"\\0":case"\\9":r=o.name;return;case"inherit":case"initial":case"unset":case"revert":i=o.name}break;case"Dimension":switch(o.unit){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":i=o.unit}break;case"Hash":case"Number":case"Percentage":break;case"Function":if(o.name==="var")return!0;i=o.name;break;default:return!0}n.push({node:o,special:i,important:e.important})})||n.length>t||typeof this.iehack=="string"&&this.iehack!==r?!1:(this.iehack=r,n)}canOverride(e,t){const n=this.sides[e];return!n||t.important&&!n.important}add(e,t){function n(){const r=this.sides,o=Y3[e];if(o){if(!(o in r))return!1;const i=this.getValueSequence(t,1);if(!i||!i.length)return!1;for(const s in r)if(r[s]!==null&&r[s].special!==i[0].special)return!1;return this.canOverride(o,i[0])&&(r[o]=i[0]),!0}else if(e===this.name){const i=this.getValueSequence(t,4);if(!i||!i.length)return!1;switch(i.length){case 1:i[ns]=i[qo],i[Yd]=i[qo],i[wl]=i[qo];break;case 2:i[Yd]=i[qo],i[wl]=i[ns];break;case 3:i[wl]=i[ns]}for(let s=0;s<4;s++)for(const a in r)if(r[a]!==null&&r[a].special!==i[s].special)return!1;for(let s=0;s<4;s++)this.canOverride($v[s],i[s])&&(r[$v[s]]=i[s]);return!0}}return n.call(this)?(this.loc||(this.loc=t.loc),!0):!1}isOkToMinimize(){const e=this.sides.top,t=this.sides.right,n=this.sides.bottom,r=this.sides.left;if(e&&t&&n&&r){const o=e.important+t.important+n.important+r.important;return o===0||o===4}return!1}getValue(){const e=new Ve,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[Mn(t.top.node),Mn(t.right.node),Mn(t.bottom.node),Mn(t.left.node)];r[wl]===r[ns]&&(n.pop(),r[Yd]===r[qo]&&(n.pop(),r[ns]===r[qo]&&n.pop()));for(let o=0;o<n.length;o++)e.appendData(n[o].node);return this.iehack&&e.appendData({type:"Identifier",loc:null,name:this.iehack}),{type:"Value",loc:null,children:e}}getDeclaration(){return{type:"Declaration",loc:this.loc,important:this.sides.top.important,property:this.name,value:this.getValue()}}};function Z3(e,t,n,r){const o=e.block.children,i=e.prelude.children.first.id;return e.block.children.forEachRight(function(s,a){const l=s.property;if(!Wv.hasOwnProperty(l))return;const c=Wv[l];let u,d;if((!r||i===r)&&c in t&&(d=X3,u=t[c]),(!u||!u.add(l,s))&&(d=Fv,u=new K3(c),!u.add(l,s))){r=null;return}t[c]=u,n.push({operation:d,block:o,item:a,shorthand:u}),r=i}),r}function Q3(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===Fv?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function J3(e,t){const n={},r=[];kt(e,{visit:"Rule",reverse:!0,enter(o){const i=this.block||this.stylesheet,s=(o.pseudoSignature||"")+"|"+o.prelude.children.first.id;let a,l;n.hasOwnProperty(i.id)?a=n[i.id]:(a={lastShortSelector:null},n[i.id]=a),a.hasOwnProperty(s)?l=a[s]:(l={},a[s]=l),a.lastShortSelector=Z3.call(this,o,l,r,a.lastShortSelector)}}),Q3(r,t.declaration)}var e4=1,t4=new Set(["src"]),qv={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},zv={cursor:["auto","crosshair","default","move","text","wait","help","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","pointer","progress","not-allowed","no-drop","vertical-text","all-scroll","col-resize","row-resize"],overflow:["hidden","visible","scroll","auto"],position:["static","relative","absolute","fixed"]},Uv={"border-width":["border"],"border-style":["border"],"border-color":["border"],"border-top":["border"],"border-right":["border"],"border-bottom":["border"],"border-left":["border"],"border-top-width":["border-top","border-width","border"],"border-right-width":["border-right","border-width","border"],"border-bottom-width":["border-bottom","border-width","border"],"border-left-width":["border-left","border-width","border"],"border-top-style":["border-top","border-style","border"],"border-right-style":["border-right","border-style","border"],"border-bottom-style":["border-bottom","border-style","border"],"border-left-style":["border-left","border-style","border"],"border-top-color":["border-top","border-color","border"],"border-right-color":["border-right","border-color","border"],"border-bottom-color":["border-bottom","border-color","border"],"border-left-color":["border-left","border-color","border"],"margin-top":["margin"],"margin-right":["margin"],"margin-bottom":["margin"],"margin-left":["margin"],"padding-top":["padding"],"padding-right":["padding"],"padding-bottom":["padding"],"padding-left":["padding"],"font-style":["font"],"font-variant":["font"],"font-weight":["font"],"font-size":["font"],"font-family":["font"],"list-style-type":["list-style"],"list-style-position":["list-style"],"list-style-image":["list-style"]};function Vv(e,t,n){const r=Po(e).basename;if(r==="background")return e+":"+Mn(t.value);const o=t.id;let i=n[o];if(!i){switch(t.value.type){case"Value":const s={};let a="",l="",c=!1;t.value.children.forEach(function u(d){switch(d.type){case"Value":case"Brackets":case"Parentheses":d.children.forEach(u);break;case"Raw":c=!0;break;case"Identifier":{const{name:f}=d;a||(a=dn(f).vendor),/\\[09]/.test(f)&&(l=RegExp.lastMatch),zv.hasOwnProperty(r)?zv[r].indexOf(f)===-1&&(s[f]=!0):qv.hasOwnProperty(r)&&qv[r].test(f)&&(s[f]=!0);break}case"Function":{let{name:f}=d;a||(a=dn(f).vendor),f==="rect"&&(d.children.some(p=>p.type==="Operator"&&p.value===",")||(f="rect-backward")),s[f+"()"]=!0,d.children.forEach(u);break}case"Dimension":{const{unit:f}=d;switch(/\\[09]/.test(f)&&(l=RegExp.lastMatch),f){case"rem":case"vw":case"vh":case"vmin":case"vmax":case"vm":s[f]=!0}break}}}),i=c?"!"+e4++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=Mn(t.value)}n[o]=i}return e+i}function n4(e,t,n){const r=Po(t.property);if(Uv.hasOwnProperty(r.basename)){const o=Uv[r.basename];for(const i of o){const s=Vv(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function r4(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=Vv(l,s,o),u=r[c];u&&!t4.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):n4(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function o4(e){const t={},n=Object.create(null);kt(e,{visit:"Rule",reverse:!0,enter(r,o,i){const s=this.block||this.stylesheet,a=(r.pseudoSignature||"")+"|"+r.prelude.children.first.id;let l,c;t.hasOwnProperty(s.id)?l=t[s.id]:(l={},t[s.id]=l),l.hasOwnProperty(a)?c=l[a]:(c={},l[a]=c),r4.call(this,r,o,i,c,n)}})}function i4(e,t,n){const r=e.prelude.children,o=e.block.children,i=r.first.compareMarker,s={};n.nextUntil(t.next,function(a,l){if(a.type!=="Rule")return Sl.call(r,a);if(e.pseudoSignature!==a.pseudoSignature)return!0;const c=a.prelude.children.head,u=a.block.children,d=c.data.compareMarker;if(d in s)return!0;if(r.head===r.tail&&r.first.id===c.data.id){o.appendList(u),n.remove(l);return}if(Bv(o,u)){const f=c.data.id;r.some((p,m)=>{const h=p.id;if(f<h)return r.insert(c,m),!0;if(!m.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function s4(e){kt(e,{visit:"Rule",enter:i4})}function Kd(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function Zd(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function a4(e,t,n){const r=this.block!==null?this.block.avoidRulesMerge:!1,o=e.prelude.children,i=e.block,s=Object.create(null);let a=!0,l=!0;n.prevUntil(t.prev,function(c,u){const d=c.block,f=c.type;if(f!=="Rule"){const h=Sl.call(o,c);return!h&&f==="Atrule"&&d&&kt(d,{visit:"Rule",enter(y){y.prelude.children.forEach(w=>{s[w.compareMarker]=!0})}}),h}if(e.pseudoSignature!==c.pseudoSignature)return!0;const p=c.prelude.children;if(l=!p.some(h=>h.compareMarker in s),!l&&!a)return!0;if(a&&Dv(p,o))return d.children.appendList(i.children),n.remove(t),!0;const m=z3(i.children,d.children);if(m.eq.length){if(!m.ne1.length&&!m.ne2.length)return l&&(ts(o,p),n.remove(u)),!0;if(!r)if(m.ne1.length&&!m.ne2.length){const h=Kd(o),y=Zd(m.eq);a&&h<y&&(ts(p,o),i.children.fromArray(m.ne1))}else if(!m.ne1.length&&m.ne2.length){const h=Kd(p),y=Zd(m.eq);l&&h<y&&(ts(o,p),d.children.fromArray(m.ne2))}else{const h={type:"SelectorList",loc:null,children:ts(p.copy(),o)},y=Kd(h.children)+2;if(Zd(m.eq)>=y){const w=n.createItem({type:"Rule",loc:null,prelude:h,block:{type:"Block",loc:null,children:new Ve().fromArray(m.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(m.ne1),d.children.fromArray(m.ne2overrided),a?n.insert(w,u):n.insert(w,t),!0}}}a&&(a=!p.some(h=>o.some(y=>y.compareMarker===h.compareMarker))),p.forEach(h=>{s[h.compareMarker]=!0})})}function l4(e){kt(e,{visit:"Rule",reverse:!0,enter:a4})}function c4(e,t){const n=H3(e,t);t.logger("prepare",e),W3(e,t),t.logger("mergeAtrule",e),V3(e),t.logger("initialMergeRuleset",e),G3(e),t.logger("disjoinRuleset",e),J3(e,n),t.logger("restructShorthand",e),o4(e),t.logger("restructBlock",e),s4(e),t.logger("mergeRuleset",e),l4(e),t.logger("restructRuleset",e)}function u4(e,t){const n=new Ve;let r=!1,o;return e.nextUntil(e.head,(i,s,a)=>{if(i.type==="Comment"){if(!t||i.value.charAt(0)!=="!"){a.remove(s);return}if(r||o)return!0;a.remove(s),o=i;return}i.type!=="WhiteSpace"&&(r=!0),n.insert(a.remove(s))}),{comment:o,stylesheet:{type:"StyleSheet",loc:null,children:n}}}function d4(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),kt(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),l3(e,r),r.logger("clean",e),x3(e,r),r.logger("replace",e),r.restructuring&&c4(e,r),e}function f4(e){let t="comments"in e?e.comments:"exclamation";return typeof t=="boolean"?t=t?"exclamation":!1:t!=="exclamation"&&t!=="first-exclamation"&&(t=!1),t}function m4(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function p4(e){return new Ve().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new Ve().appendData({type:"Selector",loc:null,children:new Ve().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function h4(e,t){e=e||{type:"StyleSheet",loc:null,children:new Ve},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:m4(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?J5(t.usage):!1},r=new Ve;let o=f4(t),i=!0,s,a,l=1,c;t.clone&&(e=zd(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=p4(e);do{if(a=u4(s,!!o),d4(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
|
|
42
|
+
`})),r.insert(Ve.createItem(a.comment)),c.isEmpty||r.insert(Ve.createItem({type:"Raw",value:`
|
|
43
|
+
`}))),i&&!c.isEmpty){const u=c.last;(u.type!=="Atrule"||u.name!=="import"&&u.name!=="charset")&&(i=!1)}o!=="exclamation"&&(o=!1),r.appendList(c)}while(!s.isEmpty);return{ast:e}}var g4=se({compress:()=>h4,find:()=>w4,findAll:()=>A4,findLast:()=>C4,fromPlainObject:()=>T4,generate:()=>E4,lexer:()=>b4,parse:()=>v4,specificity:()=>Xd,toPlainObject:()=>_4,tokenize:()=>y4,walk:()=>S4});function jv(e){const t=Fd(e,!0),n=Fd(e);return t.length<n.length?t:n}var{lexer:b4,tokenize:y4,parse:v4,generate:E4,walk:S4,find:w4,findLast:C4,findAll:A4,fromPlainObject:T4,toPlainObject:_4}=Z5({node:{String:{generate(e){this.token(5,jv(e.value))}},Url:{generate(e){const t=cv(e.value),n=jv(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:k4,generate:Qd,compress:L4}=g4;function zo(e,t,n,r){return t.debug,r}function N4(e){let t;return function(r,o){let i=r;if(o&&(i=`[${((Date.now()-t)/1e3).toFixed(3)}s] ${i}`),e>1&&o){let s=Qd(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
|
|
44
|
+
${s}
|
|
45
|
+
`}t=Date.now()}}function x4(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=N4(e.debug)),e}function Gv(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function O4(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=zo("parsing",n,Date.now(),k4(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&zo("beforeCompress",n,Date.now(),Gv(i,n,n.beforeCompress));const s=zo("compress",n,Date.now(),L4(i,x4(n)));return n.afterCompress&&zo("afterCompress",n,Date.now(),Gv(s,n,n.afterCompress)),n.sourceMap?o=zo("generate(sourceMap: true)",n,Date.now(),(()=>{const a=Qd(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=zo("generate",n,Date.now(),{css:Qd(s.ast),map:null}),o}function Gr(e,t){return O4("stylesheet",e,t)}var Xv={restructure:!0,forceMediaMerge:!0};function Yv(e,t=[...e.querySelectorAll("style")],n={forceMediaMerge:!1}){if(!cssbeautify)return!1;let r=!1;if((!e.isConnected||e.ownerDocument===null)&&!(e instanceof Document)){const s=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null);if(e instanceof HTMLHtmlElement)s.replaceChild(e,s.documentElement);else if(e instanceof HTMLBodyElement||e instanceof HTMLHeadElement)s.documentElement.appendChild(e);else{const a=s.createElement("body");s.documentElement.appendChild(a),a.appendChild(e)}}const o=!!e.querySelector('[class*="noresp-em"]'),i=new Map;for(const s of t){if(n.forceMediaMerge&&s.innerHTML){const a=`
|
|
46
|
+
`+cssbeautify(Gr(s.innerHTML,Xv).css,{indent:" ",autosemicolon:!0})+`
|
|
47
|
+
`;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&Kv(e,s.sheet,o,i)){let a=M4(s.sheet);a=Gr(a,Xv).css,a=`
|
|
48
|
+
`+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
|
|
49
|
+
`,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function Kv(e,t,n,r,o=new Set){let i=!1,s;try{s=t.cssRules}catch{return!1}for(let a=s.length-1;a>=0;a--){const l=s[a];if(l instanceof CSSStyleRule){let c=l.selectorText;n&&c.includes(".em-")&&(c=`${c}, ${c.replace(/\.em-/g,".noresp-em-")}`),R4(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=Kv(e,l,n,r,o)||i,l.cssRules.length||(t.deleteRule(a),i=!0);else if(l instanceof CSSFontFaceRule){const c=l.cssText;o.has(c)?(t.deleteRule(a),i=!0):o.add(c)}}return i}function R4(e,t,n){if(n.has(t))return n.get(t);let r=!1;try{r=!!e.querySelector(t)}catch{r=!0}return n.set(t,r),r}function M4(e){return Array.from(e.cssRules,t=>t.cssText).join(`
|
|
50
|
+
`)}var Zv=/device-width/i,P4="not all",Uo=new Map,Jd=!1;function I4(e){return"media"in e&&"cssRules"in e}function Qv(e,t){for(const n of Array.from(e))I4(n)&&t(n),"cssRules"in n&&Qv(n.cssRules,t)}function D4(e){try{return e.cssRules}catch{return}}function B4(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!Zv.test(n));return t.length?t.join(", "):P4}function ef(e){Uo.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||Uo.delete(n)});for(const t of Array.from(e.styleSheets)){const n=D4(t);n&&Qv(n,r=>{const o=r.media.mediaText;Uo.has(r)||!Zv.test(o)||(Uo.set(r,o),r.media.mediaText=B4(o))})}}function Jv(){Uo.forEach((e,t)=>{t.media.mediaText=e}),Uo.clear()}function H4(e){if(!Jd)return e();Jv();try{return e()}finally{ef(document)}}function F4(e){return e.some(t=>{const n=t.target;return n.nodeName==="STYLE"||n.parentNode?.nodeName==="STYLE"?!0:Array.from(t.addedNodes).some(r=>r.nodeName==="STYLE"||r instanceof Element&&!!r.querySelector("style"))})}function $4(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;Jd=!0,ef(t);const n=new MutationObserver(r=>{F4(r)&&ef(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),Jv(),Jd=!1}}function rs(e){return fe(e)}var zj=fe("extensions.atomsHandlers"),Uj=rs("HANDLE_ATOM_INSERT"),Vj=fe("HeadlessMode"),jj=fe("extensions.sandboxExtensions"),W4="SANDBOX_EXTENSION_SCRIPT_STATUS",Gj=fe("MESSAGE_SERVICE"),Xj=rs("SETTINGS_PANEL_EVENT"),Yj=rs("MODAL_SHOW_EVENT"),Kj=rs("MODAL_CLOSE_EVENT"),Zj=rs("MODAL_UPDATE_EVENT");function Qj(e){return e}var Jj="SandboxApp",q4="IframePluginRegistry",z4="__sandbox__";function eE(){return tu(z4)}function U4(e=eE()){return e.getOrCreateInstance(q4,()=>new lA)}var tf=new cA(()=>U4()),Cl=class BC{constructor(){L(this,"container",eE()),L(this,"pluginCollection",new aA(this,tf)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new BC)}static registerPlugin(t,n){tf.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&tf.add(r,o)}}static use(t){return this.instance.pluginCollection.use(t)}static initFeatures(t){this.instance.initFeatures(t)}static onLifecycle(t){return this.instance.onLifecycle(t)}use(t){return typeof t=="function"?this.pluginCollection.useByCtor(t):this.pluginCollection.useByKey(t)}initFeatures(t){this.pluginCollection.initSync(t)}onLifecycle(t){return this.pluginCollection.onLifecycle(t)}dispose(){this.pluginCollection.dispose()}};L(Cl,"_instance",void 0);var os="data-extension";function is(e,t,n,r){K.send(W4,{key:e,phase:t,status:n,error:r})}function V4(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(os)||void 0}function tE(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function nf(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,is(e.key,"ready","success"))}function nE(e,t){return[...document.querySelectorAll(`${e}[${os}]`)].find(n=>n.getAttribute(os)===t)}function j4({type:e,attributes:t,key:n,innerHTML:r}){const o=document.createElement(e);if(t)for(const[i,s]of Object.entries(t))s!=null&&o.setAttribute(i,String(s));return o.setAttribute(os,n),r&&(o.innerHTML=r),e==="script"?t.type||o.setAttribute("type","text/javascript"):e==="style"&&(t.type||o.setAttribute("type","text/css")),o}function G4(e,t={}){const n=new Ae,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=u=>{let d=i.get(u);return d||(d=tE(u),i.set(u,d)),d},l=u=>{if(u.type==="created"){const p=V4();if(!p)return;const m=a(p);m.hasSyncPlugins=!0,m.pendingPlugins.add(u.plugin),s.set(u.plugin,p);return}if(u.type==="create:error")return;const d=s.get(u.plugin);if(!d)return;const f=i.get(d);if(f){if(u.type==="afterInit:success"){f.pendingPlugins.delete(u.plugin),nf(f);return}(u.type==="init:error"||u.type==="afterInit:error")&&(f.pendingPlugins.delete(u.plugin),f.readyFailed=!0,is(d,"ready","error",`Sandbox plugin "${u.name}" failed during ${u.type==="init:error"?"init":"afterInit"}.`))}};n.addDisposable(Cl.onLifecycle(l)),n.addDisposable(K.addListener(ke.SANDBOX_ADD_EXTENSIONS,u=>{for(const d of u){if(t.surface&&d.surfaces&&!d.surfaces.includes(t.surface))continue;let f=r.get(d.key);f&&f.remove(),d.type==="script"&&i.set(d.key,tE(d.key));const p=d.parent&&document.querySelector(d.parent)||document.head;if(f=j4(d),e.ownership.markService(f),d.type==="script"){const m=f;m.src&&(m.onload=()=>{const h=a(d.key);h.loadedNotified=!0,is(d.key,"load","success"),nf(h)},m.onerror=()=>is(d.key,"load","error",`Failed to load sandbox script: ${m.src}`))}if(p.appendChild(f),d.type==="script"&&!f.src){const m=a(d.key);m.loadedNotified=!0,is(d.key,"load","success"),nf(m)}r.set(d.key,f),o.set(d.key,d)}})),n.addDisposable(K.addListener(ke.SANDBOX_REMOVE_EXTENSIONS,u=>{for(const d of u){const f=nE(o.get(d)?.type,d);f&&f.remove(),r.delete(d),o.delete(d)}})),n.addDisposable(e.onChange(()=>{e.applyHidden(()=>c())}));function c(){for(const[u,d]of r){const f=o.get(u);if(!f)continue;const p=nE(f.type,u);let m=f.parent?[...document.querySelectorAll(f.parent)]:[];m.length||(m=[document.head]),p?p!==d?r.set(u,p):m.some(h=>p.parentNode===h)||m[0]?.appendChild(p):m[0]?.appendChild(d)}}return n}function X4(e){e.querySelectorAll(`[${os}]`).forEach(t=>t.remove())}var ae="remove-basic-cell",rE="remove-basic-row",ie="em-active-table-cell",Pn="em-temporary-class",je="em-temporary-active-cell-background-color",gr="temporary-cell-class",oE="cursor: pointer; margin: auto; margin-top: 5px",iE="display: none; position: absolute; top: -3px; left: 0; width: 24px; background: #FFFFFF; border: 1px solid #ccc; box-shadow: 0 2px 5px rgba(0,0,0,0.2); border-radius: 5px; z-index: 1000; list-style: none; padding: 5px 0; margin: 0; text-align: left;",ss="em_version";function Al(e){if(!e||!e.includes("em_version"))return e;try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.has("em_version")?(n.searchParams.delete(ss),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function Y4(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(ss,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${ss}=${Date.now()}`}}var K4=/^(chrome-extension|moz-extension|safari-extension):\/\//i,Z4=/local\.adguard\.org/i,Q4=/^bis_/i,J4=new Set(["data-bis-config"]),Vo=/<script\b(?=[^>]*(?:\bbis_use(?:=|\s)|\bdata-bis-config(?:=|\s)|\bdata-dynamic-id(?:=|\s)|local\.adguard\.org|(?:chrome-extension|moz-extension|safari-extension):\/\/))[^>]*>[\s\S]*?<\/script>/gi,eI=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,Tl=/<style\b[^>]*>[\s\S]*?<\/style>/gi,sE=/display:\s*none\s*!important/gi,tI=[".socialshare,",".advertisment,",".adHolder,",".adsbygoogle-noablate","#ab_adblock","#popmechanic-snippet","filter_ads_by_classname","clever-core-ads","--gn-ov-ad-height","pub_728x90.text-ad.textAd","html-load.com/player","content-loader.com/player",".adblock","#advblock","body { overflow: visible!important; }"],aE=new Set(["em","data-theme-varibalse","data-em-localization"]);function nI(e){return sE.lastIndex=0,(e.match(sE)||[]).length}function rf(e){const t=e.trim(),n=nI(t);if(n===0)return!1;if(t.includes(".advertisment,")&&t.includes(".adHolder,")&&(t.includes(".socialshare,")||n>=3||t.length>2e3))return!0;const r=tI.filter(o=>t.includes(o)).length;return r>=1&&(n>=3||t.length>2e3)||n>=5&&r>=1?!0:n>=20&&/\b(?:\.ad(?:s|vert|vertisment|Holder|banner|box|Container|Wrapper)?[,{]|#ad[-_]|ins\.adsbygoogle)/i.test(t)}function rI(e){if(aE.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of aE)if(e.hasAttribute(t))return!1;return rf(e.textContent||"")}function oI(e){return K4.test(e.src)||Z4.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function lE(e){let t=!1;for(const n of[...e.attributes])(Q4.test(n.name)||J4.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function iI(e){Tl.lastIndex=0;for(const t of e.matchAll(Tl))if(rf(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function sI(e){let t=!1;return Tl.lastIndex=0,{html:e.replace(Tl,n=>rf(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function cE(e){let t=!1;return e instanceof Element&&lE(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{oI(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&rI(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{lE(n)&&(t=!0)}),t}function aI(e){return Vo.lastIndex=0,Vo.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||iI(e)}function lI(e){if(!aI(e))return{html:e,found:!1};let t=!1,n=e;Vo.lastIndex=0,Vo.test(n)&&(Vo.lastIndex=0,n=n.replace(Vo,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(n)||/\sdata-bis-config\s*=/.test(n))&&(n=n.replace(eI,""),t=!0);const r=sI(n);return n=r.html,t=t||r.found,{html:n,found:t}}var cI=class extends Ae{constructor(...e){super(...e),L(this,"_transforms",[]),L(this,"_byAttribute",new Map)}register(e){this._transforms.push(e);for(const t of e.attributes){const n=t.toLowerCase(),r=this._byAttribute.get(n);r?r.push(e):this._byAttribute.set(n,[e])}return{dispose:()=>this._remove(e)}}_remove(e){const t=this._transforms.indexOf(e);if(t!==-1){this._transforms.splice(t,1);for(const n of e.attributes){const r=n.toLowerCase(),o=this._byAttribute.get(r);if(!o)continue;const i=o.indexOf(e);i!==-1&&o.splice(i,1),o.length||this._byAttribute.delete(r)}}}get isEmpty(){return this._transforms.length===0}handles(e){return this._byAttribute.has(e.toLowerCase())}get attributes(){return[...this._byAttribute.keys()]}render(e,t){return this._run("render",e,t)}serialize(e,t){return this._run("serialize",e,t)}_run(e,t,n){const r=this._byAttribute.get(n.attribute.toLowerCase());if(!r?.length)return t;const o=e==="render"?r:[...r].reverse();let i=t;for(const s of o){if(i===null)break;const a=e==="render"?s.render?.(i,n):s.serialize?.(i,n);a!==void 0&&(i=a)}return i}dispose(){this._transforms.length=0,this._byAttribute.clear(),super.dispose()}};function of(){return Tt.getInstance(co)}var _l=new WeakMap;function uI(e,t,n){const r=_l.get(e);r?r.set(t.toLowerCase(),n):_l.set(e,new Map([[t.toLowerCase(),n]]))}function dI(e,t){const n=_l.get(e);n?.size&&_l.set(t,new Map(n))}function uE(e,t,n){const r=e.tagName.toLowerCase();for(const o of t.attributes){if(!e.hasAttribute(o))continue;const i=e.getAttribute(o)??"",s=t.serialize(i,{element:e,tag:r,attribute:o,stage:n});s===null?e.removeAttribute(o):s!==i&&e.setAttribute(o,s)}}function sf(e,t={}){const n=t.pipeline??of(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),n&&!n.isEmpty&&dE(e,o)),!n||n.isEmpty)return o;o instanceof Element&&uE(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)uE(s,n,r);return o}function fI(e,t={}){const n=t.pipeline??of(),r=gL(e);if((!n||n.isEmpty)&&!r)return e.outerHTML;const o=sf(e,{...t,pipeline:n,clone:!0});return Fr(o),o.outerHTML}function dE(e,t){dI(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)dE(n[o],r[o])}function Lt(e,t,n,r={}){const o=af(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function af(e,t,n,r={}){const o=r.pipeline??of();if(!o||!o.handles(t))return n;const i=e?.tagName.toLowerCase()??"",s=o.render(n,{element:e,tag:i,attribute:t,stage:r.stage??"build"});if(s!==n){const a=r.owner??e;a&&uI(a,t,n)}return s}function mI(e){const t=new cI,n=Op((o,i,s)=>t.isEmpty?s:af(o,i,s,{pipeline:t})),r=m0((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(co,t),{pipeline:t,dispose(){r(),n(),t.dispose(),cn(e,co)}}}function pI(e){return Al(e)}function fE(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=pI(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var hI=new Set(["normal","400"]),gI=new Set(["normal"]),bI=new Set(["baseline","unset","initial",""]),mE=new Set(["none",""]),yI=["b","strong","em","i","u","s","strike","sup","sub"],vI="___em-internal";function kl(e){e.querySelectorAll(".em-block-insert").forEach(n=>{n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-block-insert_bottom").forEach(n=>{n.classList.remove("em-block-insert_bottom")}),e.querySelectorAll(".em-block-insert_top").forEach(n=>{n.classList.remove("em-block-insert_top")}),e.querySelectorAll(".em-blockatom-insert").forEach(n=>{n.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_top-document")}),e.querySelectorAll(".em-atom-insert").forEach(n=>{n.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),["em-block-insert-empty","em-atom-insert-empty","em-block-insert-body","em-atom-insert-body","em-resize-start","sortable-chosen","sortable-ghost","em-vindent-table","em-vindent_low","em-vindent","em-relative","em-display-block","em-sandbox-discuss_set-target","em-sandbox-discuss","em-native-img-uploading","em-native-img-drop-target","em-native-img-drop-loading","em-native-file-drag"].forEach(n=>{e.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))}),e.querySelectorAll(".em-powered-logo").forEach(n=>n.remove());for(const n of e.querySelectorAll("[class='']"))n.removeAttribute("class");const t=e instanceof Document?e.documentElement:e;t&&(yt(t,"[data-mce-caret=before]",!0),yt(t,"span.em-element-resize-img-container"),yt(t,"div.em-element-img-change-group",!0),yt(t,"div.em-element-block-add",!0),yt(t,"meta[http-equiv=Content-Security-Policy]",!0),yt(t,"[class*=mce-]"),yt(t,"script[em=initial]",!0),yt(t,".em-editor-wrapper",!0),yt(t,".em-element-resize-height",!0),yt(t,".em-element-vindent-remove",!0),yt(t,".em-element-vindent",!0),yt(t,".em-element-vindent-value",!0),yt(t,"div.iframe-resizer-inner"))}function EI(e){e.querySelectorAll("tbody").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(t=>t.remove()),e.querySelectorAll('.em-vindent[class*="em-vindent-padding"]').forEach(t=>t.remove()),e.querySelectorAll(".em-code").forEach(t=>t.remove()),e.querySelectorAll("[contenteditable]").forEach(t=>t.removeAttribute("contenteditable")),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),e.querySelectorAll("[em-state]").forEach(t=>t.removeAttribute("em-state")),e.querySelectorAll("[em-hover]").forEach(t=>t.removeAttribute("em-hover")),e.querySelectorAll("#gtx-anchor").forEach(t=>t.remove()),e.querySelectorAll('[data-mce-bogus="1"]').forEach(t=>t.remove()),e.querySelectorAll("strike").forEach(t=>t.removeAttribute("style")),e.querySelectorAll("u").forEach(t=>t.removeAttribute("style")),e.querySelectorAll('style[data-theme-varibalse="true"]').forEach(t=>t.remove()),e.querySelectorAll('style[data-em-localization="true"]').forEach(t=>t.remove()),e.querySelectorAll(".em-element-img-change-group").forEach(t=>t.remove()),e.querySelectorAll(".em-element-resize-img").forEach(t=>t.remove()),e.querySelectorAll(".em-element-editor").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-element-vindent-value").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-marker").forEach(t=>t.remove()),e.querySelectorAll(".em-element-gap-bg").forEach(t=>t.remove()),e.querySelectorAll(".em-gap").forEach(t=>t.remove()),e.querySelectorAll(".em-just-inserted").forEach(t=>t.classList.remove("em-just-inserted")),e.querySelectorAll(".em-native-img-uploading").forEach(t=>t.classList.remove("em-native-img-uploading")),e.querySelectorAll(".em-native-img-drop-target").forEach(t=>t.classList.remove("em-native-img-drop-target")),e.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(t=>t.remove()),e.querySelectorAll(".em-element-list-bullet").forEach(t=>t.classList.remove("em-element-list-bullet")),e.querySelectorAll(".remove-new-editor-element").forEach(t=>t.classList.remove("remove-new-editor-element")),e.querySelectorAll(`.${je}`).forEach(t=>t.classList.remove(je)),kl(e),Wg(e),yt(e,"editor",!1),hE(e),fE(e),cE(e)}function as(e){return(e??"").trim().toLowerCase()}function SI(e){const t=as(e.style.fontWeight);t&&hI.has(t)&&e.style.removeProperty("font-weight");const n=as(e.style.fontStyle);n&&gI.has(n)&&e.style.removeProperty("font-style");const r=as(e.style.verticalAlign);r&&bI.has(r)&&e.style.removeProperty("vertical-align");const o=as(e.style.textDecorationLine);o&&mE.has(o)&&e.style.removeProperty("text-decoration-line");const i=as(e.style.textDecoration);i&&mE.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function wI(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function pE(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==vI)return!1;return!0}function hE(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];SI(r),pE(r)&&wI(r)}for(const n of yI){const r=Array.from(e.querySelectorAll(n));for(let o=r.length-1;o>=0;o-=1){const i=r[o];i.childNodes.length===0&&pE(i)&&i.remove()}}}function CI(e){const t=[],n=LI(e);return e=_I(e,t,n),e=e.replaceAll(/<script[^>]*\bdata-amd-module-id\s*=[^>]*>[\s\S]*?<\/script>/gi,""),e=e.replaceAll(/<script[^>]*\/iframe\/js\/[^>]*>[\s\S]*?<\/script>/gi,""),e=e.replaceAll(/<style\b[^>]*ad-right-container[^>]*>[\s\S]*?<\/style>/gi,""),e=qa.clear(e),e=lf(e),t.length===0?e:xI(e,t,n)}var gE=`(<(script|style)\\b[^>]*>)([\\s\\S]*?)(?=<\\/\\2${na})`,AI=new RegExp(gE,"gi"),TI=new RegExp(`<!--[\\s\\S]*?-->|${gE}`,"gi");function _I(e,t,n){const r=(o,i,s,a)=>!a||!NI(s,i)?i+a:(t.push(s.toLowerCase()==="style"?kI(a):a),`${i}${n}${t.length-1}${yE}`);return e.replaceAll(TI,(o,i,s,a)=>i===void 0?o.replaceAll(AI,r):r(o,i,s??"",a??""))}function kI(e){const t=lf(qa.clear(`>${e}`));return t.startsWith(">")?t.slice(1):lf(qa.clear(e))}var bE="",yE="";function LI(e){let t=bE;for(;e.includes(t);)t+=bE;return t}function NI(e,t){const n=document.createElement(e),r=/\btype\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(t);return r&&n.setAttribute("type",r[1]??r[2]??r[3]),Pr(n)}function xI(e,t,n){return e.replaceAll(new RegExp(`${n}(\\d+)${yE}`,"g"),(r,o)=>t[Number(o)]??r)}function lf(e){e=e.replaceAll(/\uFEFF/gmu,""),e=e.replaceAll(/<link[^>]*?em="css.*?>/gis,""),e=e.replaceAll(/draggable="false"|draggable="true"/gi,""),e=e.replaceAll(/ style="\s*"/gi,""),e=e.replaceAll(/<tbody.*?>/gi,"").replaceAll(/<\/tbody>/gi,""),e=e.replaceAll(/&nbsp;/gi," ").replaceAll(/&zwnj;/gi,"‌"),e=e.replaceAll(/style="transform: translateZ\(0px\);"/gi,""),e=e.replaceAll(/ +>/gi,">"),e=e.replaceAll(/&/gi,"&"),e=e.replaceAll(/"/gi,""),e=e.replaceAll(/^\s*$(?:\r\n?|\n)/gm,""),e=e.replaceAll(/ em-floatblock-width=".*?"/gi,""),e=e.replaceAll(/<div[^>]*?class="jfk-bubble.*?jfk-bubble-arrowimplafter".*?><\/div><\/div><\/div>/gis,""),e=e.replaceAll(/<span[^>]*?style="text-decoration: underline;"[^>]*?>(<a[^>]*?href.*?a>)<\/span>/gis,"$1"),e=e.replaceAll(/ rel="noopener"/gi,""),e=e.replaceAll(/ em-insert-ignore/gi,""),e=e.replaceAll(/ class="\s*"/gi,""),e=e.replaceAll(/<!--<em-root-text>(.*?)-->/gis,"$1"),e=e.replaceAll(/class="em-block.*?"/gi,""),e=e.replaceAll(/data-percent="[^"]*"/g,""),e=e.replaceAll(/em-optimise="[^"]*"/g,""),e=e.replaceAll(/em-optimise-error="[^"]*"/g,"");const t=e.match(/((rgb)\(\d{1,3}(,\s?\d{1,3}){2}\))/gi);return t&&t.forEach(n=>{const r=V(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function vE(e){switch(e.toLowerCase()){case"tr":return document.createElement("table");case"td":return document.createElement("tr");case"head":case"body":return document.createElement("html");default:return document.createElement("div")}}function OI(e,t){if(t.some(l=>l.nodeName==="HTML")){for(const l of t)e.appendChild(l);return}const n=t.find(l=>l.nodeType===Node.DOCUMENT_TYPE_NODE),r=t.find(l=>l.nodeName==="HEAD"),o=t.find(l=>l.nodeName==="BODY");n&&e.appendChild(n);const i=e.createElement("html"),s=r??e.createElement("head"),a=o??e.createElement("body");i.append(s,a);for(const l of t)l===n||l===r||l===o||l.nodeName==="HTML"||l.nodeName==="HEAD"||l.nodeName==="BODY"||a.appendChild(l);e.appendChild(i)}function EE(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return H4(()=>Yv(document,e,{forceMediaMerge:!0}))}function RI(e){let t=!1;return e.beforeCommit(()=>{try{t||(t=!0,EE())}finally{t=!1}})}function Ll(e){let t=e.html??"";const n=e.node,r=e.isBlock??!1,o=e.isPartial??!1;if(r||o){let i,s="div";if(n){if(s=n.tagName??"div",s==="DOCTYPE"||s==="html")return Ll({node:n});i=vE(s),i.appendChild(n.cloneNode(!0))}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return Ll({html:t});i=vE(s);const c=Ie(a);i.replaceChildren(...c)}sf(i,{stage:"apply"}),EI(i),t=bt(i),s.toLowerCase()==="head"&&(t=t.replace("<body></body>","")),s.toLowerCase()==="body"&&(t=t.replace("<head></head>",""))}else{const i=document.implementation.createHTMLDocument();for(const s of[...i.childNodes])s.remove();t?OI(i,Ie(t)):n&&i.appendChild(n.cloneNode(!0)),i.documentElement&&(i.querySelectorAll("tbody").forEach(s=>s.replaceWith(...Array.from(s.childNodes))),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(s=>s.remove()),i.querySelectorAll(".em-code").forEach(s=>s.remove()),i.querySelectorAll("[contenteditable]").forEach(s=>s.removeAttribute("contenteditable")),i.querySelectorAll("[em-edit]").forEach(s=>s.removeAttribute("em-edit")),i.querySelectorAll("[em-state]").forEach(s=>s.removeAttribute("em-state")),i.querySelectorAll("[em-hover]").forEach(s=>s.removeAttribute("em-hover")),i.querySelectorAll(".em-just-inserted").forEach(s=>s.classList.remove("em-just-inserted")),i.querySelectorAll(".em-native-img-uploading").forEach(s=>s.classList.remove("em-native-img-uploading")),i.querySelectorAll(".em-native-img-drop-target").forEach(s=>s.classList.remove("em-native-img-drop-target")),i.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(s=>s.remove()),i.body?.classList.remove("em-native-img-drop-loading"),i.body?.classList.remove("em-native-file-drag"),i.querySelectorAll("#gtx-anchor").forEach(s=>s.remove()),i.documentElement.removeAttribute("style"),i.querySelectorAll('style[data-theme-varibalse="true"]').forEach(s=>s.remove()),i.querySelectorAll('style[data-em-localization="true"]').forEach(s=>s.remove()),X4(i),kl(i),Wg(i),i.documentElement&&yt(i.documentElement,"editor",!1),i.querySelectorAll("ya-tr-span").forEach(s=>{s.parentNode&&(Array.from(s.childNodes).forEach(a=>s.parentNode.insertBefore(a,s)),s.remove())}),hE(i)),sf(i,{stage:"apply"}),fE(i),cE(i),t=Xt(i)}return lI(CI(t)).html}function cf(e,t){const{target:n}=e;setTimeout(()=>{const r=n?.querySelector("a");if(!r)return;const o=r.closest("div, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");o&&(o.childNodes.forEach(i=>{if(i.nodeType===Node.COMMENT_NODE&&i.nodeValue?.includes("[if mso]")){const s=r.innerHTML.length*11+40;i.nodeValue=i.nodeValue.replace(/(<center[^>]*>)(.*?)(<\/center>)/s,(a,l,c,u)=>l+r.innerHTML+u).replace(/(width:)(\d+)(px)/,(a,l,c,u)=>`${l}${s}${u}`)}}),t(!1))},0)}var SE="__emOwnEditor";function MI(e){e[SE]=!0}function wE(e){const t=[e.closest("editor"),...Array.from(e.querySelectorAll("editor"))],n=e.ownerDocument.activeElement;let r=!1;for(const o of t)o&&!o[SE]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var PI=["deleteContentBackward","deleteContentForward","deleteByCut"],II={deleteContentBackward:"backward",deleteContentForward:"forward"};function DI(e){const{element:t,getVisibleText:n,setCursorToElement:r,hasOnlyTextNodesDeep:o,isRangeCoveringAllVisibleText:i,isEditorContentOnlyNbsp:s,commit:a,pasteFragment:l}=e,c=m=>Nn(m)?_N(m):e.mapFn(m);function u(m){return!n(m,c).trim()&&!m.querySelector(CE)}const d=m=>n(m,c).trim();function f(m,h=uf(m,d)){const[y,...w]=h,A=y??m;if(!y&&HI(m)){const v=document.createTextNode(" ");m.replaceChildren(v),r(v);return}const k=document.createElement(y&&y.tagName!=="EDITOR"?y.tagName:"div"),b=document.createTextNode(" ");if(y&&A.tagName===k.tagName)for(const{name:v,value:S}of Array.from(A.attributes))k.setAttribute(v,S);JN(k,y?m:zI(m),A,UI),k.getAttribute("style")||k.removeAttribute("style"),w.filter(v=>v.tagName!=="TBODY").reduce((v,S)=>v.appendChild(qI(S)),k).append(b),m.tagName==="A"||m.parentNode&&m.parentNode.tagName==="A"?m.replaceChildren(b):m.replaceChildren(k),r(b)}function p(m,h){if(h.collapsed)return!1;const y=uf(m,d);return zg(h,void 0,MN)?(u(m)&&f(m,y),t.setAttribute("em-edit","active"),a(!0),!0):!1}return function(h){const y=h.target,w=window.getSelection();if(!w||w.rangeCount===0)return;if(h.inputType==="insertFromPaste"&&l&&!h.defaultPrevented){l(h);return}const A=II[h.inputType];if(A&&xN(w.getRangeAt(0),A)){h.preventDefault();return}if(PI.includes(h.inputType)&&p(y,w.getRangeAt(0))){h.preventDefault();return}const k=n(y,c).trim(),b=n(w.getRangeAt(0)?.cloneContents(),c).trim(),v=w.getRangeAt(0),S=v.startContainer,T=S.nodeType===Node.TEXT_NODE?S.parentNode:S,g=T.closest("sup, sub")||T,E=g.outerHTML,C=g?.tagName?.toLowerCase();if((h.inputType==="deleteContentBackward"||h.inputType==="deleteByCut")&&!w?.isCollapsed&&b){if((C==="sup"||C==="sub")&&E&&(g?.insertAdjacentHTML("beforebegin"," "),g?.removeAttribute("em-edit"),g.remove()),i(v)){h.preventDefault(),f(y),t.setAttribute("em-edit","active"),a(!0);return}t.setAttribute("em-edit","active"),a(!0)}if(h.inputType==="deleteContentBackward"&&w?.isCollapsed&&!b){S.length===1&&((C==="sup"||C==="sub")&&E&&(g?.insertAdjacentHTML("beforebegin"," "),g?.removeAttribute("em-edit"),g.remove()),t.setAttribute("em-edit","active"),a(!0));const _=()=>{NE(h)&&a(!0)};if(S.nodeType!==Node.TEXT_NODE&&!i(v))return _();const x=v.startOffset;if(x===0&&!i(v))return _();const N=S.parentNode;if(!N)return _();const W=Array.prototype.indexOf.call(N.childNodes,S);if(N.childNodes[W-1]?.nodeType===Node.COMMENT_NODE){h.preventDefault(),S.deleteData(x-1,1);const R=document.createRange();R.setStart(S,x-1),R.collapse(!0),w.removeAllRanges(),w.addRange(R),a(!0);return}y&&s(y)&&(h.preventDefault(),h.stopImmediatePropagation())}if(h.inputType==="insertText"&&!w?.isCollapsed){h.preventDefault();let _=h.data||"";const x=w.anchorNode;i(v)&&(x.tagName==="A"||x?.parentNode&&x.parentNode.tagName==="A")&&(_=" "+h.data),v.deleteContents();const N=document.createTextNode(_||" ");v.insertNode(N),v.setStartAfter(N),v.collapse(!0),w.removeAllRanges(),w.addRange(v),a(!0);return}if(BI.test(h.inputType)){const _=jI(h,w.getRangeAt(0));if(!_||(h.preventDefault(),ON(y,_))||(w.removeAllRanges(),w.addRange(_),p(y,_)))return;const x=uf(y,d);LE("delete"),u(y)&&f(y,x),a();return}if(h.inputType.includes("deleteContent")&&(k.length<2||k===b)&&o(y)){h.preventDefault(),f(y),a(!0);return}if(h.inputType==="insertText"&&h.data){const _=w.anchorNode;if(_?.tagName==="A"&&!_.textContent?.trim().length){h.preventDefault(),h.stopImmediatePropagation(),_.insertAdjacentText("beforeend",h.data);const x=document.createRange();x.selectNodeContents(_),x.collapse(!1),w.removeAllRanges(),w.addRange(x),a(!0);return}if(_?.parentNode&&_.parentNode.tagName==="A"||_?.tagName==="A"){h.preventDefault(),h.stopImmediatePropagation();const x=w.getRangeAt(0),N=document.createTextNode(h.data||"");x.insertNode(N),x.setStartAfter(N),x.collapse(!0),w.removeAllRanges(),w.addRange(x),a(!0);return}}if(h.inputType==="deleteContentBackward"&&!w.isCollapsed&&!b&&y&&s(y)&&(h.preventDefault(),h.stopImmediatePropagation()),NE(h)){a(!0);return}a()}}var CE="em-replace, img, picture, video, audio, svg, canvas, iframe, object, table, hr, input, button",BI=/^delete(Word|SoftLine|HardLine)/;function HI(e){return[AE(e,"previousSibling"),AE(e,"nextSibling")].some(t=>t?.nodeType===Node.TEXT_NODE?!0:t instanceof HTMLElement&&/^(EM-REPLACE|A|IMG|SUB|SUP|SPAN|B|STRONG|I|EM|U|S|FONT)$/.test(t.tagName))}function AE(e,t){let n=e[t];for(;n?.nodeType===Node.TEXT_NODE&&!n.textContent?.trim();)n=n[t];return n}var FI=/^(AREA|BASE|BR|COL|EMBED|HR|IMG|INPUT|LINK|META|SOURCE|TRACK|WBR)$/,TE=/^(SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SMALL|BIG|MARK)$/,$I={TABLE:["THEAD","TBODY","TFOOT","TR"],THEAD:["TR"],TBODY:["TR"],TFOOT:["TR"],TR:["TD","TH"]};function uf(e,t){const n=t(e),r=[];for(let o=_E(e,n,t);o;o=WI(o,n,t))r.push(o);return r}function _E(e,t,n){const r=kE(e,n);if(!(!r||FI.test(r.tagName)||r.tagName!=="TABLE"&&r.matches(CE)))return!(r.tagName==="A"||TE.test(r.tagName))||n(r)===t?r:void 0}function WI(e,t,n){const r=$I[e.tagName];if(r)return Array.from(e.children).find(i=>r.includes(i.tagName));if(e.tagName==="TD"||e.tagName==="TH")return _E(e,t,n);const o=kE(e,n);return o&&TE.test(o.tagName)&&n(o)===t?o:void 0}function kE(e,t){for(const n of Array.from(e.childNodes))if(!(Nn(n)&&!t(n))){if(n.nodeType===Node.ELEMENT_NODE)return n;if(t(n))return}}function qI(e){const t=e.cloneNode(!1);return t.removeAttribute("em-edit"),t}function zI(e){const t=e.cloneNode(!1);return t.removeAttribute("innerStyle"),t.removeAttribute("innerClass"),t}var UI=e=>V(e)??e;function VI(e){const[t]=e.getTargetRanges();if(!t||t.collapsed)return;const n=document.createRange();return n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset),n}function jI(e,t){const n=Uu(t,e.inputType.endsWith("Backward")?"backward":"forward");if(!n)return VI(e);const r=document.createRange();return r.selectNode(n),r}var GI={deleteContentBackward:"delete",deleteContentForward:"forwardDelete",deleteByCut:"delete",deleteContent:"delete",insertText:"insertText",insertReplacementText:"insertText",formatBold:"bold",formatItalic:"italic",formatUnderline:"underline",formatStrikeThrough:"strikeThrough",formatSuperscript:"superscript",formatSubscript:"subscript",formatJustifyLeft:"justifyLeft",formatJustifyCenter:"justifyCenter",formatJustifyRight:"justifyRight",formatJustifyFull:"justifyFull",formatRemove:"removeFormat"},XI=["insertText"],df=!1;function LE(e,t){df=!0;try{To(e,!1,t)}finally{df=!1}}function YI(e){const t=e.dataTransfer?.getData("text/plain")||e.data||void 0,n=e.getTargetRanges?.()[0],r=window.getSelection();if(!t||!n||!r)return;const o=document.createRange();return o.setStart(n.startContainer,n.startOffset),o.setEnd(n.endContainer,n.endOffset),r.removeAllRanges(),r.addRange(o),t}function NE(e){const t=GI[e.inputType];if(!t||e.defaultPrevented||e.isComposing||df)return!1;const n=e.inputType==="insertReplacementText"?YI(e):e.data??void 0;return XI.includes(t)&&!n?!1:(e.preventDefault(),LE(t,n),!0)}function KI(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),kl(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),wE(n),n2(n,r)))return;Kg(n,Ie);const o=document.createElement("editor");if(MI(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n);else{const s=[...n.childNodes];n.appendChild(o),o.replaceChildren(...s)}const i=o.parentElement;if(i&&!i.style.fontFamily&&!i.style.fontSize&&o.firstElementChild){const s=o.firstElementChild,a=s.getAttribute("style"),l=s.getAttribute("class"),c=s.getAttribute("href"),u=s.getAttribute("target"),d=s.getAttribute("align");a&&o.setAttribute("innerStyle",a),l&&o.setAttribute("innerClass",l),c!==null&&o.setAttribute("innerHref",c),u&&o.setAttribute("innerTarget",u),d&&o.setAttribute("innerAlign",d)}o.addEventListener("input",_t(()=>e.commit(!0)),!0),o.addEventListener("beforeinput",DI({element:n,getVisibleText:Yg,mapFn:QN,setCursorToElement:e2,hasOnlyTextNodesDeep:Gg,isRangeCoveringAllVisibleText:hN,isEditorContentOnlyNbsp:pN,commit:e.commit,pasteFragment:s=>{const a=l=>cf({target:l.target},c=>e.commit(c));ju(s,!1,O.get("commonStyles"),a,e.commit)}}))}}function ZI({commit:e,htmlDocument:t,documentMapping:n}){const r=KI({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||mN(()=>r(i,s),"editor")}}}var xE=e=>t=>t.some(n=>e(n).some(QI)),QI=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),JI=xE(({removed:e})=>e),eD=xE(({added:e})=>e),tD=e=>t=>{JI(t)&&!eD(t)&&setTimeout(()=>{if(typeof document<"u"&&document.querySelector("[em-edit]"))return;const n=typeof document<"u"?document.querySelector('table[em-type="social"]'):null;if(n?.isConnected){ur("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},Ge={drag:"em-icon-drag",moveUp:"em-icon-move-up",moveDown:"em-icon-move-down",merge:"em-icon-merge",unmerge:"em-icon-unmerge",add:"em-icon-add"},Le="em-icon";function nD(e,t,n){return(t=sD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function er(){return er=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},er.apply(null,arguments)}function OE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function In(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OE(Object(n),!0).forEach(function(r){nD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rD(e,t){if(e==null)return{};var n,r,o=oD(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function oD(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function iD(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sD(e){var t=iD(e,"string");return typeof t=="symbol"?t:t+""}function ff(e){"@babel/helpers - typeof";return ff=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ff(e)}var aD="1.15.7";function tr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var nr=tr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ls=tr(/Edge/i),RE=tr(/firefox/i),cs=tr(/safari/i)&&!tr(/chrome/i)&&!tr(/android/i),mf=tr(/iP(ad|od|hone)/i),ME=tr(/chrome/i)&&tr(/android/i),PE={capture:!1,passive:!1};function ye(e,t,n){e.addEventListener(t,n,!nr&&PE)}function ge(e,t,n){e.removeEventListener(t,n,!nr&&PE)}function Nl(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function IE(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function pn(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Nl(e,t):Nl(e,t))||r&&e===n)return e;if(e===n)break}while(e=IE(e))}return null}var DE=/\s+/g;function Bt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(DE," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(DE," "))}function oe(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),r[t]=n+(typeof n=="string"?"":"px")}}function jo(e,t){var n="";if(typeof e=="string")n=e;else do{var r=oe(e,"transform");r&&r!=="none"&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function BE(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o<i;o++)n(r[o],o);return r}return[]}function Dn(){var e=document.scrollingElement;return e||document.documentElement}function Je(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==Dn()?(i=e.getBoundingClientRect(),s=i.top,a=i.left,l=i.bottom,c=i.right,u=i.height,d=i.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!nr))do if(o&&o.getBoundingClientRect&&(oe(o,"transform")!=="none"||n&&oe(o,"position")!=="static")){var f=o.getBoundingClientRect();s-=f.top+parseInt(oe(o,"border-top-width")),a-=f.left+parseInt(oe(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var p=jo(o||e),m=p&&p.a,h=p&&p.d;p&&(s/=h,a/=m,d/=m,u/=h,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function HE(e,t,n){for(var r=br(e,!0),o=Je(e)[t];r;){var i=Je(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===Dn())break;r=br(r,!1)}return!1}function Go(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==Z.ghost&&(r||s[i]!==Z.dragged)&&pn(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function pf(e,t){for(var n=e.lastElementChild;n&&(n===Z.ghost||oe(n,"display")==="none"||t&&!Nl(n,t));)n=n.previousElementSibling;return n||null}function Jt(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Z.clone&&(!t||Nl(e,t))&&n++;return n}function FE(e){var t=0,n=0,r=Dn();if(e)do{var o=jo(e),i=o.a,s=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*s}while(e!==r&&(e=e.parentNode));return[t,n]}function lD(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function br(e,t){if(!e||!e.getBoundingClientRect)return Dn();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=oe(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Dn();if(r||t)return n;r=!0}}while(n=n.parentNode);return Dn()}function cD(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function hf(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var us;function $E(e,t){return function(){if(!us){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),us=setTimeout(function(){us=void 0},t)}}}function uD(){clearTimeout(us),us=void 0}function WE(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function qE(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function zE(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!pn(o,t.draggable,e,!1)||o.animated||o===n)){var c=Je(o);r.left=Math.min((i=r.left)!==null&&i!==void 0?i:1/0,c.left),r.top=Math.min((s=r.top)!==null&&s!==void 0?s:1/0,c.top),r.right=Math.max((a=r.right)!==null&&a!==void 0?a:-1/0,c.right),r.bottom=Math.max((l=r.bottom)!==null&&l!==void 0?l:-1/0,c.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Nt="Sortable"+new Date().getTime();function dD(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(oe(r,"display")==="none"||r===Z.ghost)){e.push({target:r,rect:Je(r)});var o=In({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=jo(r,!0);i&&(o.top-=i.f,o.left-=i.e)}r.fromRect=o}})},addAnimationState:function(r){e.push(r)},removeAnimationState:function(r){e.splice(lD(e,{target:r}),1)},animateAll:function(r){var o=this;if(!this.options.animation){clearTimeout(t),typeof r=="function"&&r();return}var i=!1,s=0;e.forEach(function(a){var l=0,c=a.target,u=c.fromRect,d=Je(c),f=c.prevFromRect,p=c.prevToRect,m=a.rect,h=jo(c,!0);h&&(d.top-=h.f,d.left-=h.e),c.toRect=d,c.thisAnimationDuration&&hf(f,d)&&!hf(u,d)&&(m.top-d.top)/(m.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=mD(m,f,p,o.options)),hf(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,m,d,l)),l&&(i=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),e=[]},animate:function(r,o,i,s){if(s){oe(r,"transition",""),oe(r,"transform","");var a=jo(this.el),l=a&&a.a,c=a&&a.d,u=(o.left-i.left)/(l||1),d=(o.top-i.top)/(c||1);r.animatingX=!!u,r.animatingY=!!d,oe(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=fD(r),oe(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),oe(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){oe(r,"transition",""),oe(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function fD(e){return e.offsetWidth}function mD(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}var Xo=[],gf={initializeByDefault:!0},ds={mount:function(t){for(var n in gf)gf.hasOwnProperty(n)&&!(n in t)&&(t[n]=gf[n]);Xo.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),Xo.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";Xo.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](In({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](In({sortable:n},r)))})},initializePlugins:function(t,n,r,o){Xo.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var c=new a(t,n,t.options);c.sortable=t,c.options=t.options,t[l]=c,er(r,c.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var s=this.modifyOption(t,i,t.options[i]);typeof s<"u"&&(t.options[i]=s)}},getEventProperties:function(t,n){var r={};return Xo.forEach(function(o){typeof o.eventProperties=="function"&&er(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return Xo.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function pD(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,i=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t=t||n&&n[Nt],!!t){var h,y=t.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!nr&&!ls?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent(r,!0,!0)),h.to=s||n,h.from=a||n,h.item=o||n,h.clone=i,h.oldIndex=l,h.newIndex=c,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var A=In(In({},m),ds.getEventProperties(r,t));for(var k in A)h[k]=A[k];n&&n.dispatchEvent(h),y[w]&&y[w].call(t,h)}}var hD=["evt"],xt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=rD(r,hD);ds.pluginEvent.bind(Z)(t,n,In({dragEl:H,parentEl:Xe,ghostEl:le,rootEl:Be,nextEl:Xr,lastDownEl:xl,cloneEl:Fe,cloneHidden:yr,dragStarted:ms,putSortable:ut,activeSortable:Z.active,originalEvent:o,oldIndex:Yo,oldDraggableIndex:fs,newIndex:Ht,newDraggableIndex:vr,hideGhostForTarget:KE,unhideGhostForTarget:ZE,cloneNowHidden:function(){yr=!0},cloneNowShown:function(){yr=!1},dispatchSortableEvent:function(a){vt({sortable:n,name:a,originalEvent:o})}},i))};function vt(e){pD(In({putSortable:ut,cloneEl:Fe,targetEl:H,rootEl:Be,oldIndex:Yo,oldDraggableIndex:fs,newIndex:Ht,newDraggableIndex:vr},e))}var H,Xe,le,Be,Xr,xl,Fe,yr,Yo,Ht,fs,vr,Ol,ut,Ko=!1,Rl=!1,Ml=[],Yr,hn,bf,yf,UE,VE,ms,Zo,ps,hs=!1,Pl=!1,Il,ft,vf=[],Ef=!1,Dl=[],Bl=typeof document<"u",Hl=mf,jE=ls||nr?"cssFloat":"float",gD=Bl&&!ME&&!mf&&"draggable"in document.createElement("div"),GE=(function(){if(Bl){if(nr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),XE=function(t,n){var r=oe(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=Go(t,0,n),s=Go(t,1,n),a=i&&oe(i),l=s&&oe(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Je(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Je(s).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=o&&r[jE]==="none"||s&&r[jE]==="none"&&c+u>o)?"vertical":"horizontal"},bD=function(t,n,r){var o=r?t.left:t.top,i=r?t.right:t.bottom,s=r?t.width:t.height,a=r?n.left:n.top,l=r?n.right:n.bottom,c=r?n.width:n.height;return o===a||i===l||o+s/2===a+c/2},yD=function(t,n){var r;return Ml.some(function(o){var i=o[Nt].options.emptyInsertThreshold;if(!(!i||pf(o))){var s=Je(o),a=t>=s.left-i&&t<=s.right+i,l=n>=s.top-i&&n<=s.bottom+i;if(a&&l)return r=o}}),r},YE=function(t){function n(i,s){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(i==null&&(s||d))return!0;if(i==null||i===!1)return!1;if(s&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,c,u),s)(a,l,c,u);var f=(s?a:l).options.group.name;return i===!0||typeof i=="string"&&i===f||i.join&&i.indexOf(f)>-1}}var r={},o=t.group;(!o||ff(o)!="object")&&(o={name:o}),r.name=o.name,r.checkPull=n(o.pull,!0),r.checkPut=n(o.put),r.revertClone=o.revertClone,t.group=r},KE=function(){!GE&&le&&oe(le,"display","none")},ZE=function(){!GE&&le&&oe(le,"display","")};Bl&&!ME&&document.addEventListener("click",function(e){if(Rl)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Rl=!1,!1},!0);var Kr=function(t){if(H){t=t.touches?t.touches[0]:t;var n=yD(t.clientX,t.clientY);if(n){var r={};for(var o in t)t.hasOwnProperty(o)&&(r[o]=t[o]);r.target=r.rootEl=n,r.preventDefault=void 0,r.stopPropagation=void 0,n[Nt]._onDragOver(r)}}},vD=function(t){H&&H.parentNode[Nt]._isOutsideThisEl(t.target)};function Z(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=er({},t),e[Nt]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return XE(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Z.supportPointer!==!1&&"PointerEvent"in window&&(!cs||mf),emptyInsertThreshold:5};ds.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);YE(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:gD,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ye(e,"pointerdown",this._onTapStart):(ye(e,"mousedown",this._onTapStart),ye(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ye(e,"dragover",this),ye(e,"dragenter",this)),Ml.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),er(this,dD())}Z.prototype={constructor:Z,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Zo=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,H):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,o=this.options,i=o.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=o.filter;if(kD(r),!H&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&cs&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=pn(l,o.draggable,r,!1),!(l&&l.animated)&&xl!==l)){if(Yo=Jt(l),fs=Jt(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){vt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),xt("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=pn(c,d.trim(),r,!1),d)return vt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),xt("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!pn(c,o.handle,r,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,r){var o=this,i=o.el,s=o.options,a=i.ownerDocument,l;if(r&&!H&&r.parentNode===i){var c=Je(r);if(Be=i,H=r,Xe=H.parentNode,Xr=H.nextSibling,xl=r,Ol=s.group,Z.dragged=H,Yr={target:H,clientX:(n||t).clientX,clientY:(n||t).clientY},UE=Yr.clientX-c.left,VE=Yr.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,H.style["will-change"]="all",l=function(){if(xt("delayEnded",o,{evt:t}),Z.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!RE&&o.nativeDraggable&&(H.draggable=!0),o._triggerDragStart(t,n),vt({sortable:o,name:"choose",originalEvent:t}),Bt(H,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){BE(H,u.trim(),Sf)}),ye(a,"dragover",Kr),ye(a,"mousemove",Kr),ye(a,"touchmove",Kr),s.supportPointer?(ye(a,"pointerup",o._onDrop),!this.nativeDraggable&&ye(a,"pointercancel",o._onDrop)):(ye(a,"mouseup",o._onDrop),ye(a,"touchend",o._onDrop),ye(a,"touchcancel",o._onDrop)),RE&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),xt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ls||nr))){if(Z.eventCanceled){this._onDrop();return}s.supportPointer?(ye(a,"pointerup",o._disableDelayedDrag),ye(a,"pointercancel",o._disableDelayedDrag)):(ye(a,"mouseup",o._disableDelayedDrag),ye(a,"touchend",o._disableDelayedDrag),ye(a,"touchcancel",o._disableDelayedDrag)),ye(a,"mousemove",o._delayedDragTouchMoveHandler),ye(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&ye(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&Sf(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;ge(t,"mouseup",this._disableDelayedDrag),ge(t,"touchend",this._disableDelayedDrag),ge(t,"touchcancel",this._disableDelayedDrag),ge(t,"pointerup",this._disableDelayedDrag),ge(t,"pointercancel",this._disableDelayedDrag),ge(t,"mousemove",this._delayedDragTouchMoveHandler),ge(t,"touchmove",this._delayedDragTouchMoveHandler),ge(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?ye(document,"pointermove",this._onTouchMove):n?ye(document,"touchmove",this._onTouchMove):ye(document,"mousemove",this._onTouchMove):(ye(H,"dragend",this),ye(Be,"dragstart",this._onDragStart));try{document.selection?$l(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ko=!1,Be&&H){xt("dragStarted",this,{evt:n}),this.nativeDraggable&&ye(document,"dragover",vD);var r=this.options;!t&&Bt(H,r.dragClass,!1),Bt(H,r.ghostClass,!0),Z.active=this,t&&this._appendGhost(),vt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(hn){this._lastX=hn.clientX,this._lastY=hn.clientY,KE();for(var t=document.elementFromPoint(hn.clientX,hn.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(hn.clientX,hn.clientY),t!==n);)n=t;if(H.parentNode[Nt]._isOutsideThisEl(t),n)do{if(n[Nt]){var r=void 0;if(r=n[Nt]._onDragOver({clientX:hn.clientX,clientY:hn.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=IE(n));ZE()}},_onTouchMove:function(t){if(Yr){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=le&&jo(le,!0),a=le&&s&&s.a,l=le&&s&&s.d,c=Hl&&ft&&FE(ft),u=(i.clientX-Yr.clientX+o.x)/(a||1)+(c?c[0]-vf[0]:0)/(a||1),d=(i.clientY-Yr.clientY+o.y)/(l||1)+(c?c[1]-vf[1]:0)/(l||1);if(!Z.active&&!Ko){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(le){s?(s.e+=u-(bf||0),s.f+=d-(yf||0)):s={a:1,b:0,c:0,d:1,e:u,f:d};var f="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");oe(le,"webkitTransform",f),oe(le,"mozTransform",f),oe(le,"msTransform",f),oe(le,"transform",f),bf=u,yf=d,hn=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!le){var t=this.options.fallbackOnBody?document.body:Be,n=Je(H,!0,Hl,!0,t),r=this.options;if(Hl){for(ft=t;oe(ft,"position")==="static"&&oe(ft,"transform")==="none"&&ft!==document;)ft=ft.parentNode;ft!==document.body&&ft!==document.documentElement?(ft===document&&(ft=Dn()),n.top+=ft.scrollTop,n.left+=ft.scrollLeft):ft=Dn(),vf=FE(ft)}le=H.cloneNode(!0),Bt(le,r.ghostClass,!1),Bt(le,r.fallbackClass,!0),Bt(le,r.dragClass,!0),oe(le,"transition",""),oe(le,"transform",""),oe(le,"box-sizing","border-box"),oe(le,"margin",0),oe(le,"top",n.top),oe(le,"left",n.left),oe(le,"width",n.width),oe(le,"height",n.height),oe(le,"opacity","0.8"),oe(le,"position",Hl?"absolute":"fixed"),oe(le,"zIndex","100000"),oe(le,"pointerEvents","none"),Z.ghost=le,t.appendChild(le),oe(le,"transform-origin",UE/parseInt(le.style.width)*100+"% "+VE/parseInt(le.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if(xt("dragStart",this,{evt:t}),Z.eventCanceled){this._onDrop();return}xt("setupClone",this),Z.eventCanceled||(Fe=qE(H),Fe.removeAttribute("id"),Fe.draggable=!1,Fe.style["will-change"]="",this._hideClone(),Bt(Fe,this.options.chosenClass,!1),Z.clone=Fe),r.cloneId=$l(function(){xt("clone",r),!Z.eventCanceled&&(r.options.removeCloneOnHide||Be.insertBefore(Fe,H),r._hideClone(),vt({sortable:r,name:"clone"}))}),!n&&Bt(H,i.dragClass,!0),n?(Rl=!0,r._loopId=setInterval(r._emulateDragOver,50)):(ge(document,"mouseup",r._onDrop),ge(document,"touchend",r._onDrop),ge(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(r,o,H)),ye(document,"drop",r),oe(H,"transform","translateZ(0)")),Ko=!0,r._dragStartId=$l(r._dragStarted.bind(r,n,t)),ye(document,"selectstart",r),ms=!0,window.getSelection().removeAllRanges(),cs&&oe(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,r=t.target,o,i,s,a=this.options,l=a.group,c=Z.active,u=Ol===l,d=a.sort,f=ut||c,p,m=this,h=!1;if(Ef)return;function y(j,ne){xt(j,m,In({evt:t,isOwner:u,axis:p?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:f,target:r,completed:A,onMove:function(Q,be){return Fl(Be,n,H,o,Q,Je(Q),t,be)},changed:k},ne))}function w(){y("dragOverAnimationCapture"),m.captureAnimationState(),m!==f&&f.captureAnimationState()}function A(j){return y("dragOverCompleted",{insertion:j}),j&&(u?c._hideClone():c._showClone(m),m!==f&&(Bt(H,ut?ut.options.ghostClass:c.options.ghostClass,!1),Bt(H,a.ghostClass,!0)),ut!==m&&m!==Z.active?ut=m:m===Z.active&&ut&&(ut=null),f===m&&(m._ignoreWhileAnimating=r),m.animateAll(function(){y("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(r===H&&!H.animated||r===n&&!r.animated)&&(Zo=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(H.parentNode[Nt]._isOutsideThisEl(t.target),!j&&Kr(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function k(){Ht=Jt(H),vr=Jt(H,a.draggable),vt({sortable:m,name:"change",toEl:n,newIndex:Ht,newDraggableIndex:vr,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=pn(r,a.draggable,n,!0),y("dragOver"),Z.eventCanceled)return h;if(H.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||m._ignoreWhileAnimating===r)return A(!1);if(Rl=!1,c&&!a.disabled&&(u?d||(s=Xe!==Be):ut===this||(this.lastPutMode=Ol.checkPull(this,c,H,t))&&l.checkPut(this,c,H,t))){if(p=this._getDirection(t,r)==="vertical",o=Je(H),y("dragOverValid"),Z.eventCanceled)return h;if(s)return Xe=Be,w(),this._hideClone(),y("revert"),Z.eventCanceled||(Xr?Be.insertBefore(H,Xr):Be.appendChild(H)),A(!0);var b=pf(n,a.draggable);if(!b||CD(t,p,this)&&!b.animated){if(b===H)return A(!1);if(b&&n===t.target&&(r=b),r&&(i=Je(r)),Fl(Be,n,H,o,r,i,t,!!r)!==!1)return w(),b&&b.nextSibling?n.insertBefore(H,b.nextSibling):n.appendChild(H),Xe=n,k(),A(!0)}else if(b&&wD(t,p,this)){var v=Go(n,0,a,!0);if(v===H)return A(!1);if(r=v,i=Je(r),Fl(Be,n,H,o,r,i,t,!1)!==!1)return w(),n.insertBefore(H,v),Xe=n,k(),A(!0)}else if(r.parentNode===n){i=Je(r);var S=0,T,g=H.parentNode!==n,E=!bD(H.animated&&H.toRect||o,r.animated&&r.toRect||i,p),C=p?"top":"left",_=HE(r,"top","top")||HE(H,"top","top"),x=_?_.scrollTop:void 0;Zo!==r&&(T=i[C],hs=!1,Pl=!E&&a.invertSwap||g),S=AD(t,r,i,p,E?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Pl,Zo===r);var N;if(S!==0){var W=Jt(H);do W-=S,N=Xe.children[W];while(N&&(oe(N,"display")==="none"||N===le))}if(S===0||N===r)return A(!1);Zo=r,ps=S;var R=r.nextElementSibling,M=!1;M=S===1;var te=Fl(Be,n,H,o,r,i,t,M);if(te!==!1)return(te===1||te===-1)&&(M=te===1),Ef=!0,setTimeout(SD,30),w(),M&&!R?n.appendChild(H):r.parentNode.insertBefore(H,M?R:r),_&&WE(_,0,x-_.scrollTop),Xe=H.parentNode,T!==void 0&&!Pl&&(Il=Math.abs(T-Je(r)[C])),k(),A(!0)}if(n.contains(H))return A(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ge(document,"mousemove",this._onTouchMove),ge(document,"touchmove",this._onTouchMove),ge(document,"pointermove",this._onTouchMove),ge(document,"dragover",Kr),ge(document,"mousemove",Kr),ge(document,"touchmove",Kr)},_offUpEvents:function(){var t=this.el.ownerDocument;ge(t,"mouseup",this._onDrop),ge(t,"touchend",this._onDrop),ge(t,"pointerup",this._onDrop),ge(t,"pointercancel",this._onDrop),ge(t,"touchcancel",this._onDrop),ge(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Ht=Jt(H),vr=Jt(H,r.draggable),xt("drop",this,{evt:t}),Xe=H&&H.parentNode,Ht=Jt(H),vr=Jt(H,r.draggable),Z.eventCanceled){this._nulling();return}Ko=!1,Pl=!1,hs=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wf(this.cloneId),wf(this._dragStartId),this.nativeDraggable&&(ge(document,"drop",this),ge(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),cs&&oe(document.body,"user-select",""),oe(H,"transform",""),t&&(ms&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),le&&le.parentNode&&le.parentNode.removeChild(le),(Be===Xe||ut&&ut.lastPutMode!=="clone")&&Fe&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),H&&(this.nativeDraggable&&ge(H,"dragend",this),Sf(H),H.style["will-change"]="",ms&&!Ko&&Bt(H,ut?ut.options.ghostClass:this.options.ghostClass,!1),Bt(H,this.options.chosenClass,!1),vt({sortable:this,name:"unchoose",toEl:Xe,newIndex:null,newDraggableIndex:null,originalEvent:t}),Be!==Xe?(Ht>=0&&(vt({rootEl:Xe,name:"add",toEl:Xe,fromEl:Be,originalEvent:t}),vt({sortable:this,name:"remove",toEl:Xe,originalEvent:t}),vt({rootEl:Xe,name:"sort",toEl:Xe,fromEl:Be,originalEvent:t}),vt({sortable:this,name:"sort",toEl:Xe,originalEvent:t})),ut&&ut.save()):Ht!==Yo&&Ht>=0&&(vt({sortable:this,name:"update",toEl:Xe,originalEvent:t}),vt({sortable:this,name:"sort",toEl:Xe,originalEvent:t})),Z.active&&((Ht==null||Ht===-1)&&(Ht=Yo,vr=fs),vt({sortable:this,name:"end",toEl:Xe,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){xt("nulling",this),Be=H=Xe=le=Xr=Fe=xl=yr=Yr=hn=ms=Ht=vr=Yo=fs=Zo=ps=ut=Ol=Z.dragged=Z.ghost=Z.clone=Z.active=null;var t=this.el;Dl.forEach(function(n){t.contains(n)&&(n.checked=!0)}),Dl.length=bf=yf=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":H&&(this._onDragOver(t),ED(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t=[],n,r=this.el.children,o=0,i=r.length,s=this.options;o<i;o++)n=r[o],pn(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||_D(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];pn(a,this.options.draggable,o,!1)&&(r[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){r[i]&&(o.removeChild(r[i]),o.appendChild(r[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return pn(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var r=this.options;if(n===void 0)return r[t];var o=ds.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&YE(r)},destroy:function(){xt("destroy",this);var t=this.el;t[Nt]=null,ge(t,"mousedown",this._onTapStart),ge(t,"touchstart",this._onTapStart),ge(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(ge(t,"dragover",this),ge(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ml.splice(Ml.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!yr){if(xt("hideClone",this),Z.eventCanceled)return;oe(Fe,"display","none"),this.options.removeCloneOnHide&&Fe.parentNode&&Fe.parentNode.removeChild(Fe),yr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(yr){if(xt("showClone",this),Z.eventCanceled)return;H.parentNode==Be&&!this.options.group.revertClone?Be.insertBefore(Fe,H):Xr?Be.insertBefore(Fe,Xr):Be.appendChild(Fe),this.options.group.revertClone&&this.animate(H,Fe),oe(Fe,"display",""),yr=!1}}};function ED(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Fl(e,t,n,r,o,i,s,a){var l,c=e[Nt],u=c.options.onMove,d;return window.CustomEvent&&!nr&&!ls?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=o||t,l.relatedRect=i||Je(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function Sf(e){e.draggable=!1}function SD(){Ef=!1}function wD(e,t,n){var r=Je(Go(n.el,0,n.options,!0)),o=zE(n.el,n.options,le),i=10;return t?e.clientX<o.left-i||e.clientY<r.top&&e.clientX<r.right:e.clientY<o.top-i||e.clientY<r.bottom&&e.clientX<r.left}function CD(e,t,n){var r=Je(pf(n.el,n.options.draggable)),o=zE(n.el,n.options,le),i=10;return t?e.clientX>o.right+i||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>o.bottom+i||e.clientX>r.right&&e.clientY>r.top}function AD(e,t,n,r,o,i,s,a){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!s){if(a&&Il<c*o){if(!hs&&(ps===1?l>u+c*i/2:l<d-c*i/2)&&(hs=!0),hs)f=!0;else if(ps===1?l<u+Il:l>d-Il)return-ps}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return TD(t)}return f=f||s,f&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function TD(e){return Jt(H)<Jt(e)?1:-1}function _D(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function kD(e){Dl.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&Dl.push(r)}}function $l(e){return setTimeout(e,0)}function wf(e){return clearTimeout(e)}Bl&&ye(document,"touchmove",function(e){(Z.active||Ko)&&e.cancelable&&e.preventDefault()}),Z.utils={on:ye,off:ge,css:oe,find:BE,is:function(t,n){return!!pn(t,n,t,!1)},extend:cD,throttle:$E,closest:pn,toggleClass:Bt,clone:qE,index:Jt,nextTick:$l,cancelNextTick:wf,detectDirection:XE,getChild:Go,expando:Nt},Z.get=function(e){return e[Nt]},Z.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(Z.utils=In(In({},Z.utils),r.utils)),ds.mount(r)})},Z.create=function(e,t){return new Z(e,t)},Z.version=aD;var et=[],gs,Cf,Af=!1,Tf,_f,Wl,bs;function LD(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var r=n.originalEvent;this.sortable.nativeDraggable?ye(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ye(document,"pointermove",this._handleFallbackAutoScroll):r.touches?ye(document,"touchmove",this._handleFallbackAutoScroll):ye(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?ge(document,"dragover",this._handleAutoScroll):(ge(document,"pointermove",this._handleFallbackAutoScroll),ge(document,"touchmove",this._handleFallbackAutoScroll),ge(document,"mousemove",this._handleFallbackAutoScroll)),QE(),ql(),uD()},nulling:function(){Wl=Cf=gs=Af=bs=Tf=_f=null,et.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,r){var o=this,i=(n.touches?n.touches[0]:n).clientX,s=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,s);if(Wl=n,r||this.options.forceAutoScrollFallback||ls||nr||cs){kf(n,this.options,a,r);var l=br(a,!0);Af&&(!bs||i!==Tf||s!==_f)&&(bs&&QE(),bs=setInterval(function(){var c=br(document.elementFromPoint(i,s),!0);c!==l&&(l=c,ql()),kf(n,o.options,c,r)},10),Tf=i,_f=s)}else{if(!this.options.bubbleScroll||br(a,!0)===Dn()){ql();return}kf(n,this.options,br(a,!1),!1)}}},er(e,{pluginName:"scroll",initializeByDefault:!0})}function ql(){et.forEach(function(e){clearInterval(e.pid)}),et=[]}function QE(){clearInterval(bs)}var kf=$E(function(e,t,n,r){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,a=t.scrollSpeed,l=Dn(),c=!1,u;Cf!==n&&(Cf=n,ql(),gs=t.scroll,u=t.scrollFn,gs===!0&&(gs=br(n,!0)));var d=0,f=gs;do{var p=f,m=Je(p),h=m.top,y=m.bottom,w=m.left,A=m.right,k=m.width,b=m.height,v=void 0,S=void 0,T=p.scrollWidth,g=p.scrollHeight,E=oe(p),C=p.scrollLeft,_=p.scrollTop;p===l?(v=k<T&&(E.overflowX==="auto"||E.overflowX==="scroll"||E.overflowX==="visible"),S=b<g&&(E.overflowY==="auto"||E.overflowY==="scroll"||E.overflowY==="visible")):(v=k<T&&(E.overflowX==="auto"||E.overflowX==="scroll"),S=b<g&&(E.overflowY==="auto"||E.overflowY==="scroll"));var x=v&&(Math.abs(A-o)<=s&&C+k<T)-(Math.abs(w-o)<=s&&!!C),N=S&&(Math.abs(y-i)<=s&&_+b<g)-(Math.abs(h-i)<=s&&!!_);if(!et[d])for(var W=0;W<=d;W++)et[W]||(et[W]={});(et[d].vx!=x||et[d].vy!=N||et[d].el!==p)&&(et[d].el=p,et[d].vx=x,et[d].vy=N,clearInterval(et[d].pid),(x!=0||N!=0)&&(c=!0,et[d].pid=setInterval(function(){r&&this.layer===0&&Z.active._onTouchMove(Wl);var R=et[this.layer].vy?et[this.layer].vy*a:0,M=et[this.layer].vx?et[this.layer].vx*a:0;typeof u=="function"&&u.call(Z.dragged.parentNode[Nt],M,R,e,Wl,et[this.layer].el)!=="continue"||WE(et[this.layer].el,M,R)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==l&&(f=br(f,!1)));Af=c}},30),JE=function(t){var n=t.originalEvent,r=t.putSortable,o=t.dragEl,i=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var c=r||i;a();var u=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(u.clientX,u.clientY);l(),c&&!c.el.contains(d)&&(s("spill"),this.onSpill({dragEl:o,putSortable:r}))}};function Lf(){}Lf.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,r=t.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var o=Go(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),r&&r.animateAll()},drop:JE},er(Lf,{pluginName:"revertOnSpill"});function Nf(){}Nf.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:JE},er(Nf,{pluginName:"removeOnSpill"}),Z.mount(new LD),Z.mount(Nf,Lf);var e1=100,t1=Symbol("EMULATED_DRAG_EVENT");function ND(e,t){return e[t1]===t}var n1=class{constructor(){L(this,"_target",null),L(this,"_interval",0),L(this,"_x",0),L(this,"_y",0)}_fireDragEvent(e,t,n,r,o){const i=new DragEvent(t,{dataTransfer:o,clientX:n,clientY:r,bubbles:!0,cancelable:!0});return i[t1]=this,It(()=>e.dispatchEvent(i)),!i.defaultPrevented}start(e,t,n){const r=document.elementFromPoint(e,t);return r&&!this._target&&this._fireDragEvent(r,"dragstart",e,t,n)?(this._target=r,this._x=e,this._y=t,this._interval=setInterval(()=>{this._fireDragEvent(r,"drag",this._x,this._y,n)},e1),!0):!1}enter(e,t,n){const r=document.elementFromPoint(e,t);r&&r!==this._target&&(this._fireDragEvent(r,"dragenter",e,t,n),this._target=r,this._interval||(this._interval=setInterval(()=>{this._fireDragEvent(r,"drag",this._x,this._y,n)},e1)))}over(e,t,n){this._x=e,this._y=t;const r=document.elementFromPoint(e,t);r&&(r!==this._target&&this._fireDragEvent(r,"dragenter",e,t,n),this._fireDragEvent(r,"dragover",e,t,n)),this._target&&r!==this._target&&this._fireDragEvent(this._target,"dragleave",e,t,n),this._target=r}leave(e,t,n){this._target&&(this._fireDragEvent(this._target,"dragleave",e,t,n),this._target=null),this._target=null}drop(e,t,n){this._target&&(this._fireDragEvent(this._target,"drop",e,t,n),this._target=null),this._target=null,clearInterval(this._interval)}end(e,t,n){this._target&&this._fireDragEvent(this._target,"dragend",e,t,n),this._target=null,clearInterval(this._interval)}};function zl(e){document.querySelector(".noresp-em-narrow-table")&&e.querySelectorAll("img, amp-img").forEach(t=>{const n=t;n.style.removeProperty("width"),n.style.removeProperty("max-width")})}function ys(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function xf(e){const t=document.createElement("div");t.replaceChildren(...Ie(e.atomHTML));const n=t.querySelector("img");if(!n)return bt(t);let r=0;return e.targetAtom.classList.contains("em-block-insert-empty")?r=600:e.targetAtom.classList.contains("em-mob-wrap")||e.targetAtom.classList.contains("noresp-em-mob-wrap")?r=ys(e.targetAtom):r=e.targetAtom.parentNode?ys(e.targetAtom.parentNode):ys(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?zl(t):n.style.maxWidth=r+"px",bt(t)}function r1(e,t,n){const r=e.querySelectorAll("img"),o=r.length===1?r[0]:null,i=o?.getAttribute("width")??"";if(!o||o.classList.contains("em-countdown")||!i||i.endsWith("%"))return!1;const s=parseFloat(i),a=o.style.display;o.style.display="none";const l=ys(n);o.style.display=a;const c=s>=ys(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?zl(e):o.style.maxWidth=c+"px",!0)}function o1(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Ie(e.atomHTML));const r=n.querySelector("img");if(!r)return!1;const o=new Image;return o.onload=function(){const i=Math.round(this.width/2);r.setAttribute("width",String(i)),document.querySelector(".noresp-em-narrow-table")?zl(n):(r.style.maxWidth=i+"px",r.style.width="100%"),Xn(e.targetElem,e.targetPlace,`
|
|
51
|
+
`+bt(n)+`
|
|
52
|
+
`),t()},o.src=r.getAttribute("src")||"",!1}function Of(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Ie(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return bt(t);const r=n.getAttribute("em-cd-settings")||"",o=e.project==="useblocks"?"https://cdt3.useblocks.io/rndt?":"https://cdt3.emcdn.ru/rndt?",i=new URL(o+r),s=new Date;return i.searchParams.set("time",new Date(+s+432e6).toISOString()),Lt(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),bt(t)}function Ul(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Ie(e.blockHTML)),document.querySelector(".noresp-em-narrow-table")?t.querySelectorAll('[class^="em-mob-"], [class*=" em-mob-"]').forEach(n=>{n.className=n.className.split(" ").map(r=>r.startsWith("em-mob-")?"noresp-"+r:r).join(" ")}):t.querySelectorAll('[class^="noresp-"], [class*=" noresp-"]').forEach(n=>{n.className=n.className.split(" ").map(r=>r.startsWith("noresp-")?r.substring(7):r).join(" ")}),zl(t),bt(t)}function xD(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var OD=class{constructor(){L(this,"_items",new Map)}gc(){for(const[e,t]of[...this._items])e.isConnected||(this._items.delete(e),t.destroy())}get(e){return this._items.get(e)}create(e,t){const n=Z.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},Er=new OD,RD=Number.MAX_VALUE,MD=0;function i1(e){return typeof e=="object"?e.name:e}var PD=class{constructor(){L(this,"emulator",new n1),L(this,"x",0),L(this,"y",0),L(this,"_tracked",!1),L(this,"handleMouseMove",e=>{this.x=e.clientX,this.y=e.clientY,this.emulator.over(this.x,this.y)})}track(){this._tracked||(this._tracked=!0,window.addEventListener("mousedown",e=>{this.x=e.clientX,this.y=e.clientY}),window.addEventListener("mouseup",()=>this.emulator.end(this.x,this.y)))}},en=new PD,s1=Z.prototype,ID=_t(s1._onDragOver);function DD(e){Er.gc(),en.track(),s1._onDragOver=ID;const t=document.querySelectorAll("[em=group]");Z.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(m,h){let y=null,w=Number.MAX_VALUE;const A=i1(Z.active?.options.group);for(const[k,b]of Er.entries())if(i1(b.options.group)===A&&(!a||c&&a(k,c)!==!1)){for(const v of k.children)if(!v.classList.contains("sortable-drag")){const S=v.getBoundingClientRect(),T=m<S.left?S.left-m:m>S.right?m-S.right:0,g=h<S.top?S.top-h:h>S.bottom?h-S.bottom:0;if(T<RD||g<MD){const E=Math.sqrt(T*T+g*g);E<w?(y=[b,v],w=E):E===w&&y[1].contains(v)&&(y=[b,v])}}}return y}function d(m){const h="TouchEvent"in window&&m instanceof TouchEvent?m.touches[0]:m,y=u(h.clientX,h.clientY);if(y){const[k,b]=y,v=b.getBoundingClientRect();var w={clientX:v.left+v.width/2,clientY:h.clientY};for(var A in m)m.hasOwnProperty(A)&&(w[A]=m[A]);w.target=b,w.rootEl=b.parentNode,w.preventDefault=void 0,w.stopPropagation=void 0,k._onDragOver(w)}}return{onStart:m=>{c=m.item,Z.ghost&&kg(Z.ghost),xD(Z.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),en.emulator.start(en.x,en.y)?(window.addEventListener("mousemove",en.handleMouseMove),n&&(n.dispose(),n=void 0)):m.preventDefault()},onEnd:m=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let h=!1;m.from===m.to?en.emulator.end(en.x,en.y):(h=!!l?.(m),en.emulator.drop(en.x,en.y)),window.removeEventListener("mousemove",en.handleMouseMove),e.endTextUpdate(),m.from===m.to&&m.oldIndex!==m.newIndex&&e.commit(!0),h&&e.commit(!0),n&&(n.dispose(),n=void 0),c=void 0}}}if(t.length)for(const a of t){const l=a.parentElement;l&&!Er.get(l)&&Er.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${Ge.drag}`,...o(),onMove:r})}const i=[...document.querySelectorAll("[em=block]")],s=[...document.querySelectorAll("[em=atom]")].map(a=>a.parentElement);for(const a of i){const l=a.querySelectorAll("td");for(const c of l)!c.innerHTML&&!c.hasAttribute("height")&&[...c.parentElement?.children||[]].indexOf(c)%2===0&&s.push(c)}if(s.length){const a=new Set;for(const l of s)l&&!a.has(l)&&(a.add(l),Er.get(l)||Er.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${Ge.drag}`,...o((c,u)=>{if(u.tagName==="TR"){if(c.tagName!=="TABLE"&&c.tagName!=="TBODY")return!1}else if(u.tagName==="TD"){if(c.tagName!=="TR")return!1}else if(u.tagName==="TABLE"){const d=e.getContext(c);if(d&&kn(d)&&d.tagName==="AMP-ACCORDION"&&c.tagName==="DIV"&&[...d.querySelectorAll("section > div")].indexOf(c)>=0||e.isInExternal(c)&&c.tagName==="DIV")return!0;if(c.tagName!=="TD")return!1}},c=>r1(c.item,c.from,c.to)),onMove:r,onSort:function(){l.innerHTML.trim()===""&&(l.innerHTML="")}}))}if(i.length){const a=new Set;for(const l of i){const c=l.parentElement;c&&!a.has(c)&&(a.add(c),Er.get(c)||Er.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${Ge.drag}`,...o(),onMove:r}))}}}var BD=class{constructor(){L(this,"_nodes",[])}add(e){const t=this._nodes,n=new Set;for(const r of t){if(r.contains(e))return;e.contains(r)&&n.add(r)}for(const r of n){const o=t.indexOf(r);o>=0&&t.splice(o,1)}t.push(e)}remove(e){const t=new Set;for(const n of this._nodes)(e===n||e.contains(n))&&t.add(n);for(const n of t){const r=this._nodes.indexOf(n);r>=0&&this._nodes.splice(r,1)}}get nodes(){return[...this._nodes]}clear(){this._nodes.splice(0,this._nodes.length)}},Rf={get textDocument(){return D(Tt,vi)},commit:Hr};function HD(){const e=O.get("applicationTheme")||"light";let t=!1;try{Rf.textDocument.beginUpdate();const n=[...document.querySelectorAll('[em="css"]')].map(s=>s.getAttribute("href"));let r=document.getElementsByTagName("head")[0];if(!r)if(document.documentElement)r=document.createElement("head"),document.documentElement.insertBefore(r,document.documentElement.firstChild),t=!0;else return;const o="css/sandbox.css?8c2b05d7";if(n.indexOf(o)<0){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",o),r.appendChild(s),t=!0}const i=`css/sandbox-${e}.css?8c2b05d7`;if(n.indexOf(i)<0){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("em","css"),s.setAttribute("href",i),r.appendChild(s),t=!0}}finally{Rf.textDocument.endUpdate()}t&&Rf.commit(!1)}var eG=".em-prevent-action";function FD(e){const{fingerprint:t,applicationElementSettingsSet:n}=e,r=document.querySelector("[em-edit]"),o=t.take(r);if(t.differs(o)){if(document.body?.classList.contains("em-sandbox-discuss")){t.accept(o);return}if(r){r.closest(".em-prevent-action")||(t.accept(o),n({elem:r}));return}setTimeout(()=>{const i=document.querySelector("[em-edit]"),s=t.take(i);i?t.differs(s)&&(t.accept(s),i.closest(".em-prevent-action")||n({elem:i})):(t.accept(s),n({elem:null}))},0)}}function $D(){const e=document.body;if(!e)return;const t=O.get("lockEdit")||O.get("lockEditor");(O.get("lockEdit")!==e.classList.contains("mceNonEditable")||O.get("lockEditor"))&&ze(e,!!t,"mceNonEditable"),ze(e,!!O.get("previewPage"),"em-sandbox-preview")}function WD(e){const{htmlDocument:t,commit:n,focusController:r}=e;t.onChange(s=>{s.some(a=>a.added.length||a.characterDataChanged||a.reordered?.length||a.reparented?.length)&&DD(t)}),t.onChange(()=>{HD()}),t.onRefresh(()=>e.initPreview()),t.onChange(s=>{s.some(a=>a.removed.some(l=>l instanceof HTMLHeadElement||l instanceof HTMLLinkElement&&l.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const o=new BD;let i;t.onChange(s=>{for(const a of s)for(const l of a.added)o.add(l.parentElement??l);i||(i=setTimeout(()=>{r.whenEditorLostFocus(()=>{o.clear(),n(!1)}),i=void 0},1e3))}),t.onChange(tD(e.applicationElementSettingsSet)),t.onChange(()=>{O.get("activeElementLocked")>0||(FD(e),$D())})}function qD(e,t){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const n=document.querySelector(".em-editor-wrapper");if(!(!document.querySelector("[em-edit]")&&!n))try{O.increment("activeElementLocked"),document.querySelectorAll("[em-edit]").forEach(r=>r.removeAttribute("em-edit")),n&&(n.style.display="none"),It(()=>document.querySelectorAll("editor").forEach(r=>r.blur())),t.forget()}finally{Promise.resolve().then(()=>O.decrement("activeElementLocked"))}}function zD(e){const t=_t(n=>qD(n.target,e));return window.addEventListener("mousedown",t,!0),window.addEventListener("click",t,!0),{dispose(){window.removeEventListener("mousedown",t,!0),window.removeEventListener("click",t,!0)}}}var UD={name:"sandbox.fingerprint",provides:[fo],awaits:{services:[J]},setup(e){const t=D(e,J),n=cN(r=>t.getOuterHtml(r));uN(n),zD(n),e.inject(fo,n)}},VD={name:"sandbox.setCursor",provides:[At],awaits:{services:[J,an,gt]},setup(e){const t={HTMLDocument:D(e,J),documentMapping:D(e,an),remoteDocument:D(e,gt),messageService:K};e.inject(At,n=>fN(n,t))}},jD={name:"sandbox.wrapEditor",provides:[ln],awaits:{services:[J,an,Oe]},setup:e=>e.inject(ln,ZI({commit:ct(e),htmlDocument:D(e,J),documentMapping:D(e,an)}))};function GD(e){const{container:t}=e;Cl.registerAll({MessageService:()=>K,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(J),SyncServiceInternals:()=>t.getInstance(gt),TextDocument:()=>t.getInstance(vi),Mapping:()=>t.getInstance(an),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&Cl.initFeatures(e.features)}var XD=e=>e,YD=e=>`table:empty::before {
|
|
53
|
+
/*content: 'Paste block here';*/
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
table:is(:empty, :has(> tbody:only-child:empty))::after {
|
|
57
|
+
content: '${e.DROP_BLOCK_HINT}' !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[em="block"].empty-structure td:not([height]):not([width]):empty::before {
|
|
61
|
+
/*content: 'Paste atom here';*/
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.em-block-insert:after {
|
|
65
|
+
content: '${e.PASTE_HERE}' !important;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.em-atom-insert:after,
|
|
69
|
+
.em-blockatom-insert:after {
|
|
70
|
+
content: '${e.PASTE_HERE}' !important;
|
|
71
|
+
}`,KD=class extends Ae{constructor(e){super(),L(this,"htmlDocument",void 0),L(this,"_localized",{...NA(XD)}),L(this,"_styles",""),L(this,"_onChangeLocaleEmitter",new _e),L(this,"_onDomChanged",()=>{if(!document.querySelector('[data-em-localization="true"]')&&this._styles){const t=document.querySelector("head")||document.querySelector("body");if(t){const n=document.createElement("style");n.innerHTML=this._styles,n.dataset.emLocalization="true",t.insertBefore(n,t.firstChild)}}}),L(this,"onChangeLocale",this._onChangeLocaleEmitter.event),this.htmlDocument=e,this.addDisposable(e.onChange(this._onDomChanged))}get localized(){return this._localized}setTranslations({name:e,data:t}){this._localized=t;const n=document.createElement("style");n.dataset.emLocalization="true";const r=YD(t);if(r&&this._styles!==r){this._styles=r,n.innerHTML=r;const o=document.querySelector('[data-em-localization="true"]');if(o)o.replaceWith(n);else{const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(n,i.firstChild)}this.htmlDocument.commit(!1)}this._onChangeLocaleEmitter.fire({name:e,data:t})}};function ZD(e){const t=new KD(e),n=r=>{t.setTranslations(r)};return t.addDisposable(K.addListener(ke.SANDBOX_TRANSLATIONS,n)),t}function QD(e,t,n){const r=new Ae;let o=[];return r.addDisposable(e.beforeChange(({treeMutations:i})=>{t.isEditorInFocus&&o.push(...i)})),r.addDisposable(t.editorLostFocus(()=>{if(o.length){const i=[];for(const s of o){const a=s.type;let l=null;a==="Add"?l=s.node:a==="Update"&&(l=s.next),l?.closed===!1&&i.push(l)}i.length&&(e.correctNodes(i),n.saveChanges(!1)),o=[]}})),r}function JD(e){const t=new Ae,n=r=>{ND(r,e)||K.send(ke.APPLICATION_IFRAME_DRAG_EVENT,{type:r.type,clientX:r.clientX,clientY:r.clientY,value:r.dataTransfer?.getData("Text")||""})};return window.addEventListener("dragstart",n),window.addEventListener("dragover",n),window.addEventListener("drag",n),window.addEventListener("dragleave",n),window.addEventListener("dragend",n),window.addEventListener("drop",n),window.addEventListener("dragenter",n),t.addDispose(()=>{window.removeEventListener("dragstart",n),window.removeEventListener("dragover",n),window.removeEventListener("drag",n),window.removeEventListener("dragleave",n),window.removeEventListener("dragend",n),window.removeEventListener("drop",n),window.removeEventListener("dragenter",n)}),t}function e8(){const e=new n1,t=r=>{const o=new DataTransfer;switch(o.setData("Text",r.value),r.type){case"dragenter":e.enter(r.clientX,r.clientY,o);break;case"dragover":e.over(r.clientX,r.clientY,o);break;case"dragleave":e.leave(r.clientX,r.clientY,o);break;case"dragend":e.end(r.clientX,r.clientY,o);break;case"drop":e.drop(r.clientX,r.clientY,o)}},n=new Ae;return n.addDisposable(K.addListener(ke.SANDBOX_DRAG_EVENT,t)),n.addDisposable(JD(e)),n}function t8(){return NodeFilter.FILTER_ACCEPT}function n8(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,t8);let r;for(;r=n.nextNode();)t.push(r)}return t}var r8=new fg,o8=new Set;function a1(e){return e?r8.getUnescapedText(e,!0,o8)!==e:!1}function l1(e){return e.nodeValue?a1(e.nodeValue):!1}function i8(e){const t=e.previousSibling;if(t instanceof HTMLSpanElement&&t.classList.contains("em-code")&&t.classList.contains("em-code_var"))return t}function Vl(e){const t=e?.nextSibling;if(t instanceof Comment&&l1(t))return t}function c1(e,t){if(t.ownerDocument){const n=t.ownerDocument.createRange();try{n.selectNode(t)}catch{n.selectNodeContents(t)}const r=e.compareBoundaryPoints(Range.START_TO_START,n)===1,o=e.compareBoundaryPoints(Range.END_TO_END,n)===-1;if(r&&!o)return 0;if(!r&&o)return 1;if(r&&o)return 2}return 3}function s8(){let e=!1;document.addEventListener("keydown",n=>{n.key.toLowerCase()==="arrowleft"&&(e||(e=!0,setTimeout(()=>{e=!1},50)))});const t=()=>{const n=window.getSelection();if(n?.rangeCount){const r=n.getRangeAt(0),o=document.querySelectorAll(".em-code");for(const i of o){const s=i.nextSibling;if(s instanceof Comment){if(c1(r,i)===0&&c1(r,s)===1){e?(r.setStartBefore(i),r.setEndBefore(i)):(r.setStartAfter(s),r.setEndAfter(s));return}n.containsNode(s)&&!n.containsNode(i)&&r.setStartAfter(s)}}}};return document.addEventListener("selectionchange",t),{dispose(){document.removeEventListener("selectionchange",t)}}}var a8=e=>{if(!e)return;(!e.firstChild||e.firstChild.nodeType!==Node.TEXT_NODE)&&(e.textContent="",e.appendChild(document.createTextNode(" ")));const t=e.firstChild;t.textContent===""&&(t.textContent=" ");const n=window.getSelection();if(!n)return;const r=document.createRange();r.setStart(t,1),r.collapse(!0),n.removeAllRanges();const o=e.closest('[contenteditable="true"]');It(()=>{n.addRange(r),o?.focus()})},u1=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},l8=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=u1(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},c8=(e,t)=>{try{const n=window.getSelection();if(!n)return!1;const r=document.createRange();return r.setStart(e,t),r.collapse(!0),n.removeAllRanges(),n.addRange(r),!0}catch{return!1}};function u8(e,t,n){const{startContainer:r}=e;if(!e.collapsed||!t.isForeign(r))return null;let o=r;for(;o.parentNode&&t.isForeign(o.parentNode);)o=o.parentNode;if(!o.parentElement?.closest('[contenteditable="true"]'))return null;if(n==="ArrowLeft"||n==="ArrowRight")return{node:o,side:n==="ArrowLeft"?"before":"after"};const i=document.createRange();return i.selectNodeContents(o),i.setEnd(e.startContainer,e.startOffset),{node:o,side:i.toString()===""?"before":"after"}}function d1(e){const t=e.startContainer;return Nn(t)?t:Nn(t.parentNode)?t.parentNode:null}function d8(e){const t=e.previousSibling;if(t?.nodeType===Node.ELEMENT_NODE&&t.tagName==="EM-REPLACE")return{em:t,side:"after"};const n=e.nextSibling;return n?.nodeType===Node.ELEMENT_NODE&&n.tagName==="EM-REPLACE"?{em:n,side:"before"}:null}function f8(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function m8({em:e,side:t}){const n=t==="after"?u1(e):f8(e);if(!n)return;const r=document.createRange();r.setStart(n,t==="after"?Math.max(n.length-1,0):Math.min(1,n.length)),r.collapse(!0);const o=window.getSelection();o&&Pi(o,r)}function p8(e){const t=y=>e.renderOnly(y);let n=null,r=null,o=!1;const i=y=>!!n&&n.em===y.em&&n.side===y.side&&r===(y.side==="after"?"ArrowLeft":"ArrowRight"),s=()=>{const y=window.getSelection();if(o||!y?.rangeCount)return;const w=y.getRangeAt(0),A=e.ownership?u8(w,e.ownership,r):null;if(A){n=null;const v=$g(A.node,A.side,t);Ua(document,t,v);return}const k=Fg(w);if(k&&i(k)){n=null,m8(k),Ua(document,t);return}if(k){const v=za(k.em,k.side,t);n=k,Ua(document,t,v);return}const b=w.collapsed?d1(w):null;n=b?d8(b):null,Ua(document,t,b)},a=()=>{const y=window.getSelection(),w=y?.rangeCount?d1(y.getRangeAt(0)):null;return!!w&&e.applyOwn(()=>LN(w,t))!==null},l=y=>{!y.isComposing&&a()&&e.commit(!0)},c=()=>{o=!0},u=()=>{o=!1,a(),e.commit(!0)},d=y=>{r=y.key},f=y=>{const w=window.getSelection();w?.rangeCount&&y?.closest?.('[contenteditable="true"]')&&zg(w.getRangeAt(0),t)},p=y=>{y.key?.length===1&&!y.ctrlKey&&!y.metaKey&&!y.altKey&&f(y.target)},m=y=>{y.inputType==="insertCompositionText"&&f(y.target)},h=()=>{r=null};return document.addEventListener("selectionchange",s),document.addEventListener("input",l),document.addEventListener("compositionstart",c,!0),document.addEventListener("compositionend",u,!0),document.addEventListener("keydown",d,!0),document.addEventListener("pointerdown",h,!0),window.addEventListener("keydown",p,!0),window.addEventListener("beforeinput",m,!0),{dispose(){document.removeEventListener("selectionchange",s),document.removeEventListener("input",l),document.removeEventListener("compositionstart",c,!0),document.removeEventListener("compositionend",u,!0),document.removeEventListener("keydown",d,!0),document.removeEventListener("pointerdown",h,!0),window.removeEventListener("keydown",p,!0),window.removeEventListener("beforeinput",m,!0)}}}function Mf(){return O.get("commonStyles")}var jl={Thin:"100","Thin Italic":"100i",ExtraLight:"200","ExtraLight Italic":"200i",Light:"300","Light Italic":"300i",Regular:"400","Regular Italic":"400i",Medium:"500","Medium Italic":"500i",SemiBold:"600","SemiBold Italic":"600i",Bold:"700","Bold Italic":"700i",ExtraBold:"800","ExtraBold Italic":"800i",Black:"900","Black Italic":"900i"},h8={"Sans Serif":"sans-serif",Serif:"serif"},f1=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function Qo(e){return e.querySelector(f1)}function vs(e){return Array.from(e.querySelectorAll(f1))}function Pf(e){const t=e.closest('[em="block"]');return t?Qo(t)??t.querySelector("td"):null}function m1(e){const t=e.closest('[em="block"]');return!!t&&(e===t||vs(t).includes(e))}var g8=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Sr=(e,t)=>{g8()},wr=new Map;function b8(e){return wr.get(e.toLowerCase())?.[0]}function If(e){return wr.get(e.toLowerCase())??[]}function y8(){return wr.size>0}function p1(){return[...wr.values()].map(e=>e[0])}function v8(e){wr=new Map;for(const t of e??[]){const n=t.family.toLowerCase();wr.set(n,[...wr.get(n)??[],t])}return wr}var E8=e=>{const t=v8(e);Sr("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function S8(){const e=new Ae;return e.addDisposable(K.addListener(ke.SANDBOX_SET_PROJECT_FONTS,E8)),e}var w8={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function h1(e){return e.category==="serif"?"serif":"sans-serif"}function Gl(e,t){const n=b8(t);return n?(e.style.fontFamily=w8[h1(n)],!0):!1}var C8=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,A8=/url\(\s*(['"]?)(.*?)\1\s*\)/,T8=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function Df(e){return Array.from(e.matchAll(C8),t=>{const n=new Map(t[1].split(";").map(r=>r.split(":")).filter(r=>r.length>1).map(([r,...o])=>[r.trim().toLowerCase(),o.join(":").trim()]));return{start:t.index??0,end:(t.index??0)+t[0].length,family:T8(n.get("font-family")??""),src:A8.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function g1(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function b1(e,t){return[...t].sort((n,r)=>r.start-n.start).reduce((n,r)=>n.slice(0,r.start)+n.slice(r.end),e)}function Bf(){return Tt.getInstance(Zp)?.()??document.head}function Hf(){return Bf().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function $e(){if(!Hf()){const e=document.createElement("style");e.setAttribute("em","styles"),Bf().append(e)}}function _8(){const e=Bf(),t=()=>{const r=Hf(),o=Array.from(e.querySelectorAll("style"));return r&&!o.includes(r)?[...o,r]:o};if(!t().length){const r=document.createElement("style"),o=document.querySelector('[em="block"]');if(o){const i=o.offsetWidth;r.innerHTML=`@media only screen and (max-device-width: ${i}px), only screen and (max-width: ${i}px) {}`}e.appendChild(r)}let n=null;for(const r of t()){const o=r.innerHTML.match(/@media.*?max((.|\n|\r)*?){/);if(o){n=o[0];break}}return n===null&&(n="@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {"),n}function Xl(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function y1(e){const t=e.elem.getAttribute("class");if(t){const n=t.split(" ");for(const r of n)r.indexOf("em-mob-padding_"+e.position)>-1&&e.elem.classList.remove(r)}}function Ff(e,t){if(!e)return;const{minify:n,cssbeautify:r,HTMLDocument:o}=t;let i=document.head.querySelector('style[em="styles"]'),s="";i?s=o.getInnerHtml(i):(i=document.createElement("style"),i.setAttribute("em","styles"),i=document.head.insertAdjacentElement("beforeend",i));const a=document.createElement("div");a.insertAdjacentHTML("afterbegin",typeof e=="string"?e:e.join(`
|
|
72
|
+
`));let l=n(s+`
|
|
73
|
+
`+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
|
|
74
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;l=r(l,{indent:" ",autosemicolon:!0}),i.textContent=`
|
|
75
|
+
`+l+`
|
|
76
|
+
`}function Jo(e){return(e||"").replace(/\s/g,"")}function Yl(e,t){return`em-font-${Jo(e)}-${Jo(t)}`}function v1(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function $f(e){return Yl(e[2]||"",e[3]||"")}var Wf="em-font-custom";function k8(e){return e[1]==="Project Fonts"}function qf(e,t){k8(t)&&e.classList.add(Wf)}function zf(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function L8(e,t,n){t.backgroundColor!==void 0&&(t.backgroundColor===""?(e.removeAttribute("bgcolor"),e.style.removeProperty("background-color"),document.body.style.removeProperty("background-color"),n&&(n.style.color="transparent")):(document.body.style.backgroundColor=t.backgroundColor,e.setAttribute("bgcolor",t.backgroundColor),e.style.backgroundColor=t.backgroundColor,n&&(n.style.color=t.backgroundColor),e.closest(".full-wrap")&&e.closest("body")?.setAttribute("bgcolor",t.backgroundColor))),t.backgroundImage&&(t.backgroundColor===""?(e.style.removeProperty("background-image"),e.removeAttribute("background")):(e.style.removeProperty("background-image"),e.style.backgroundImage=t.backgroundImage[0].type+"("+t.backgroundImage[0].value+")",Lt(e,"background",t.backgroundImage[0].value))),t.backgroundPositionX&&(t.backgroundPositionX==="none"?e.style.removeProperty("background-position-x"):e.style.backgroundPositionX=t.backgroundPositionX!=="initial"?t.backgroundPositionX:""),t.backgroundPositionY&&(t.backgroundPositionY==="none"?e.style.removeProperty("background-position-y"):e.style.backgroundPositionY=t.backgroundPositionY!=="initial"?t.backgroundPositionY:""),t.backgroundRepeat&&(t.backgroundRepeat==="none"?e.style.removeProperty("background-repeat"):e.style.backgroundRepeat=t.backgroundRepeat),t.backgroundSize!==void 0&&(t.backgroundSize===""?e.style.removeProperty("background-size"):e.style.backgroundSize=t.backgroundSize)}function Kl(e){const t={all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}};if(parseInt(e.style.border)||parseInt(e.style.borderTop)||parseInt(e.style.borderRight)||parseInt(e.style.borderBottom)||parseInt(e.style.borderLeft)||parseInt(e.style.borderTopWidth)||parseInt(e.style.borderRightWidth)||parseInt(e.style.borderBottomWidth)||parseInt(e.style.borderLeftWidth)||e.style.borderStyle||e.style.borderTopStyle||e.style.borderRightStyle||e.style.borderBottomStyle||e.style.borderLeftStyle||e.style.borderColor||e.style.borderTopColor||e.style.borderRightColor||e.style.borderBottomColor||e.style.borderLeftColor)if(e.style.border){const n=e.style.border.split(" "),r=parseInt(n[0]),o=n[1]||null,i=V(n[2]+n[3]+n[4])||null;t.all={width:r,style:o,color:i},t.top={width:r,style:o,color:i},t.right={width:r,style:o,color:i},t.bottom={width:r,style:o,color:i},t.left={width:r,style:o,color:i}}else if((e.style.borderWidth||e.style.borderStyle||e.style.borderColor)&&e.style.borderWidth.indexOf(" ")===-1&&e.style.borderStyle.indexOf(" ")===-1&&(!e.style.borderColor||(V(e.style.borderColor)||"").indexOf(" ")===-1))e.style.borderWidth&&e.style.borderWidth.indexOf(" ")===-1&&(t.all.width=parseInt(e.style.borderWidth)),e.style.borderStyle&&(t.all.style=e.style.borderStyle),e.style.borderColor&&(t.all.color=V(e.style.borderColor)||null);else{if(e.style.borderTop){const n=e.style.borderTop.split(" ");t.top.width=parseInt(n[0]),t.top.style=n[1]||null,t.top.color=V(n[2]+n[3]+n[4])||null}else e.style.borderTopWidth&&(t.top.width=parseInt(e.style.borderTopWidth)),e.style.borderTopStyle&&(t.top.style=e.style.borderTopStyle),e.style.borderTopColor&&(t.top.color=V(e.style.borderTopColor)||null);if(e.style.borderRight){const n=e.style.borderRight.split(" ");t.right.width=parseInt(n[0]),t.right.style=n[1]||null,t.right.color=V(n[2]+n[3]+n[4])||null}else e.style.borderRightWidth&&(t.right.width=parseInt(e.style.borderRightWidth)),e.style.borderRightStyle&&(t.right.style=e.style.borderRightStyle),e.style.borderRightColor&&(t.right.color=V(e.style.borderRightColor)||null);if(e.style.borderBottom){const n=e.style.borderBottom.split(" ");t.bottom.width=parseInt(n[0]),t.bottom.style=n[1]||null,t.bottom.color=V(n[2]+n[3]+n[4])||null}else e.style.borderBottomWidth&&(t.bottom.width=parseInt(e.style.borderBottomWidth)),e.style.borderBottomStyle&&(t.bottom.style=e.style.borderBottomStyle),e.style.borderBottomColor&&(t.bottom.color=V(e.style.borderBottomColor)||null);if(e.style.borderLeft){const n=e.style.borderLeft.split(" ");t.left.width=parseInt(n[0]),t.left.style=n[1]||null,t.left.color=V(n[2]+n[3]+n[4])||null}else e.style.borderLeftWidth&&(t.left.width=parseInt(e.style.borderLeftWidth)),e.style.borderLeftStyle&&(t.left.style=e.style.borderLeftStyle),e.style.borderLeftColor&&(t.left.color=V(e.style.borderLeftColor)||null)}return t}function Es(e){const t={all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null};return(e.style.borderRadius||e.style.borderTopLeftRadius||e.style.borderTopRightRadius||e.style.borderBottomRightRadius||e.style.borderBottomLeftRadius)&&(!e.style.borderRadius||e.style.borderRadius.indexOf(" ")>-1?t.all=null:t.all=parseFloat(e.style.borderRadius),t.topLeft=e.style.borderTopLeftRadius?parseFloat(e.style.borderTopLeftRadius):null,t.topRight=e.style.borderTopRightRadius?parseFloat(e.style.borderTopRightRadius):null,t.bottomRight=e.style.borderBottomRightRadius?parseFloat(e.style.borderBottomRightRadius):null,t.bottomLeft=e.style.borderBottomLeftRadius?parseFloat(e.style.borderBottomLeftRadius):null),t}function Ss(e){let t=null;if(e.style.boxShadow){const n=e.style.boxShadow.match(/[^\s\(]+(\(.+\))?/g);n&&(t={hOffset:n[1]?parseFloat(n[1]):null,vOffset:n[2]?parseFloat(n[2]):null,blurRadius:n[3]&&n[3]!=="inset"?parseFloat(n[3]):null,spreadRadius:n[4]&&n[4]!=="inset"?parseFloat(n[4]):null,color:n[0]&&V(n[0])||"",inset:n[3]==="inset"||n[4]==="inset"||n[5]==="inset"})}return t}function E1(e){if(!e)return null;const t=e.style;if(t.border&&parseInt(t.borderWidth||t.border)>0)return"all";const n=!!(t.borderTop||t.borderTopWidth&&parseInt(t.borderTopWidth)>0),r=!!(t.borderRight||t.borderRightWidth&&parseInt(t.borderRightWidth)>0),o=!!(t.borderBottom||t.borderBottomWidth&&parseInt(t.borderBottomWidth)>0),i=!!(t.borderLeft||t.borderLeftWidth&&parseInt(t.borderLeftWidth)>0);return n&&r&&o&&i?"all":n&&!r&&!o&&!i?"top":!n&&r&&!o&&!i?"right":!n&&!r&&o&&!i?"bottom":!n&&!r&&!o&&i?"left":n?"top":r?"right":o?"bottom":i?"left":null}function Ft(e){return e==null||e===""}function Uf(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!Ft(r.all.width)&&(r.all.style||r.all.color)?(t.style.borderWidth=r.all.width+"px",r.all.style&&(t.style.borderStyle=r.all.style),r.all.color&&(t.style.borderColor=r.all.color)):t.style.removeProperty("border"):(r.top&&(!Ft(r.top.width)&&(r.top.style||r.top.color)?(t.style.borderTopWidth=r.top.width+"px",r.top.style&&(t.style.borderTopStyle=r.top.style),r.top.color&&(t.style.borderTopColor=r.top.color)):t.style.removeProperty("border-top")),r.right&&(!Ft(r.right.width)&&(r.right.style||r.right.color)?(t.style.borderRightWidth=r.right.width+"px",r.right.style&&(t.style.borderRightStyle=r.right.style),r.right.color&&(t.style.borderRightColor=r.right.color)):t.style.removeProperty("border-right")),r.bottom&&(!Ft(r.bottom.width)&&(r.bottom.style||r.bottom.color)?(t.style.borderBottomWidth=r.bottom.width+"px",r.bottom.style&&(t.style.borderBottomStyle=r.bottom.style),r.bottom.color&&(t.style.borderBottomColor=r.bottom.color)):t.style.removeProperty("border-bottom")),r.left&&(!Ft(r.left.width)&&(r.left.style||r.left.color)?(t.style.borderLeftWidth=r.left.width+"px",r.left.style&&(t.style.borderLeftStyle=r.left.style),r.left.color&&(t.style.borderLeftColor=r.left.color)):t.style.removeProperty("border-left"))))}function N8(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!Ft(r.hOffset)&&!Ft(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=Ft(r.blurRadius)?"":r.blurRadius+"px ",o+=Ft(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function ws(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(Ft(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",Ft(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",Ft(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",Ft(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function S1(e){let t="";if(e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")){const n=e.nodeValue.replace(/^\[if mso\]>/i,"").replace(/<!\[endif\]$/i,"").trim();t+=n}return e.childNodes.forEach(n=>{t+=S1(n)}),t}function w1(e,t,n={value:0}){e.nodeType===Node.COMMENT_NODE&&e.nodeValue?.includes("[if mso]")&&(n.value===0?e.nodeValue=`[if mso]>${t}<![endif]`:e.nodeValue="",n.value++),e.childNodes.forEach(r=>w1(r,t,n))}function x8(e){return e?e.backgroundImage!==void 0||e.backgroundColor!==void 0||e.backgroundSize!==void 0||e.backgroundRepeat!==void 0||e.width!==void 0||e.height!==void 0:!1}var C1=/\[if[^\]]*mso[^\]]*\]/i,A1="[if gte mso 9]></v:textbox></v:rect><![endif]";function O8(e){const t=e.style.backgroundImage;if(t&&t!=="none"){const n=t.match(/url\(["']?([^"')]+)["']?\)/i);if(n)return n[1]}return e.getAttribute("background")||e.getAttribute("data-bg-image")||""}function R8(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function M8(e){const t=Math.round(e.getBoundingClientRect().width);if(t)return t;const n=(e.getAttribute("width")||"").trim();return n&&!n.includes("%")&&parseInt(n,10)||0}function P8(e){const t=M8(e),n=Tt.getInstance(Qp);return n?n(e,t):t}function I8(e,t,n,r){const o=t?` color="${t}"`:"";return`[if gte mso 9]><v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="${r?`width:${r}px;`:"mso-width-percent:1000;"}"><v:fill type="${n}" src="${e}"${o} /><v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0"><![endif]`}function T1(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Cs(e){if(!T1(e))return!1;const t=e.nodeValue||"";return C1.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function Vf(e){if(!T1(e))return!1;const t=e.nodeValue||"";return C1.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function jf(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function _1(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function k1(e){for(const t of Array.from(e.childNodes))(Cs(t)||Vf(t))&&e.removeChild(t)}function As(e,t="inside"){return t==="around"?Cs(jf(e)):Array.from(e.childNodes).some(n=>Cs(n))}function L1(e,t="inside"){if(t==="around"){const n=e.parentNode;if(!n)return;const r=jf(e),o=_1(e);Cs(r)&&n.removeChild(r),Vf(o)&&n.removeChild(o);return}k1(e)}function N1(e,t="inside"){const n=O8(e);if(!n){L1(e,t);return}const r=I8(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),R8(e),P8(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const s=jf(e);Cs(s)&&i.removeChild(s);const a=_1(e);Vf(a)&&i.removeChild(a),i.insertBefore(o.createComment(r),e),i.insertBefore(o.createComment(A1),e.nextSibling);return}k1(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(A1))}}function Ts(e,t,n="inside"){t?.outlookBackground===!0?N1(e,n):t?.outlookBackground===!1?L1(e,n):As(e,n)&&x8(t)&&N1(e,n)}var Gf=/v:roundrect/i,Xf=/\[if\s*!\s*mso\]/i,x1=/^\s*<!\[endif\]\s*$/i,Yf=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],D8=[...Yf,"padding","padding-top","padding-right","padding-bottom","padding-left","color","font-family","font-size","font-weight","font-style","text-align","line-height","letter-spacing","width"];function ei(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Kf(e){const t=[],n=r=>{r.childNodes.forEach(o=>{ei(o)&&Gf.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function O1(e,t){const n=Cr(e);if(!n)return!1;const r=n.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(r))return!1;const o=M1((t||"").replace(/\s+/g," ").trim());return n.nodeValue=r.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(i,s,a)=>`${s}${o}${a}`),!0}function Cr(e){for(const t of Array.from(e.childNodes)){if(ei(t)&&Gf.test(t.nodeValue||""))return t;const n=Cr(t);if(n)return n}return null}function R1(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function B8(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function Bn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function H8(e,t){const n=(e.textContent||"").replace(/\s+/g," ").trim();if(n)return n;for(const r of t){const o=(r.nodeValue||"").match(/<center[^>]*>([\s\S]*?)<\/center>/i);if(o)return o[1].replace(/\s+/g," ").trim()}return""}function M1(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function F8(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of Yf){const o=e.style.getPropertyValue(r);o&&(t.style.setProperty(r,o,e.style.getPropertyPriority(r)),e.style.removeProperty(r))}t.style.display||(t.style.display="block")}function $8(e,t){const n=t.getAttribute("bgcolor");n&&(!e.style.backgroundColor&&!e.getAttribute("bgcolor")&&(e.style.backgroundColor=n),t.removeAttribute("bgcolor"));for(const r of Yf){const o=t.style.getPropertyValue(r);o&&(e.style.getPropertyValue(r)||e.style.setProperty(r,o,t.style.getPropertyPriority(r)),t.style.removeProperty(r))}}function W8(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function Zf(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(W8(t))return t;return null}function Qf(e){return e?!!Zf(e)||!!Cr(e):!1}function q8(e,t){for(const n of D8){const r=e.style.getPropertyValue(n);r&&!t.style.getPropertyValue(n)&&t.style.setProperty(n,r,e.style.getPropertyPriority(n))}t.style.display||(t.style.display="block")}function z8(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function P1(e,t){const n=Zf(t);return n?(q8(n,t),z8(n),Kf(t).forEach(r=>r.parentNode?.removeChild(r)),Jf(t),!0):!1}function U8(e){for(const t of e){const n=t.nodeValue||"";if(!Gf.test(n))continue;const r=/<v:roundrect[^>]*\bstyle="([^"]*)"/i.exec(n),o=r?r[1]:"",i=/width:\s*(\d+)\s*px/i.exec(o),s=/height:\s*(\d+)\s*px/i.exec(o),a=/arcsize="(\d+)%?"/i.exec(n);return{width:i?Bn(i[1]):0,height:s?Bn(s[1]):0,arcsize:a?Bn(a[1]):0}}return{width:0,height:0,arcsize:0}}function V8(e){const t=e.style;let n=t.borderWidth||t.borderTopWidth||"",r=t.borderStyle||t.borderTopStyle||"",o=t.borderColor||t.borderTopColor||"";if((!n||!r)&&t.border){const a=t.border.trim().split(/\s+/);n||(n=a[0]||""),r||(r=a[1]||""),o||(o=a.slice(2).join(" ")||"")}if(!r||r==="none")return null;const i=parseFloat(n);if(!Number.isFinite(i)||i<=0)return null;const s=r==="dashed"?"dash":r==="dotted"?"dot":"";return{color:V(o)||o||"#000000",weight:`${i}px`,dash:s}}var j8=new Set(["bold","bolder","600","700","800","900"]);function G8(e){const t={bold:!1,italic:!1,underline:!1,strikethrough:!1};e.querySelector("b, strong")&&(t.bold=!0),e.querySelector("i, em")&&(t.italic=!0),e.querySelector("u")&&(t.underline=!0),e.querySelector("s, strike")&&(t.strikethrough=!0);const n=[e,...Array.from(e.querySelectorAll("*"))];for(const r of n){const o=r.style;if(!o)continue;const i=(o.fontWeight||"").toLowerCase();i&&j8.has(i)&&(t.bold=!0),o.fontStyle==="italic"&&(t.italic=!0);const s=o.textDecoration||o.textDecorationLine||"";s.includes("underline")&&(t.underline=!0),s.includes("line-through")&&(t.strikethrough=!0)}return t}function X8(e){const t=[e.height?`height:${e.height}px`:"","v-text-anchor:middle",e.width?`width:${e.width}px`:""].filter(Boolean),n=[e.underline?"underline":"",e.strikethrough?"line-through":""].filter(Boolean).join(" "),r=[e.color?`color:${e.color}`:"",e.fontFamily?`font-family:${e.fontFamily}`:"",e.fontSize?`font-size:${e.fontSize}`:"",e.bold?"font-weight:bold":"",e.italic?"font-style:italic":"",n?`text-decoration:${n}`:""].filter(Boolean),o=!!e.strokeColor&&!!e.strokeWeight,i=o?`stroke="t" strokecolor="${e.strokeColor}" strokeweight="${e.strokeWeight}"`:'stroke="f"',s=o&&e.strokeDash?`<v:stroke dashstyle="${e.strokeDash}"/>`:"",a=u=>u.replace(/"/g,"'"),l=a(`${t.join(";")};`),c=a(`${r.join(";")}${r.length?";":""}`);return`[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${a(e.href)}" style="${l}" arcsize="${e.arcsize}%" ${i} fillcolor="${e.fillcolor||"none"}"><w:anchorlock/>`+s+`<center style="${c}">${M1(e.label)}</center></v:roundrect><![endif]`}function Jf(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(ei(o)){const i=o.nodeValue||"";(Xf.test(i)||x1.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function Y8(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&P1(t,n),Kf(t).forEach(r=>r.parentNode?.removeChild(r)),Jf(t),n&&$8(t,n)}function K8(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=R1(e);ei(r)&&Xf.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=B8(e);ei(o)&&x1.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function Z8(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function Q8(e,t){if(t?.width?.value&&t.width.dim==="px")return Bn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?Bn(n):0}function J8(e,t){if(t?.height?.value&&t.height.dim==="px")return Bn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?Bn(n):Bn(e.style.height)}function e9(e,t){return e?.borderRadius&&e.borderRadius.all!=null?Bn(e.borderRadius.all):Bn(t.style.borderRadius)}function t9(e,t,n){const r=[t,n].filter(i=>i>0);if(!r.length||e<=0)return 0;const o=Math.min(...r);return Math.max(0,Math.min(100,Math.round(e/o*100)))}function em(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=Kf(n),i=H8(r,o),s=U8(o);P1(n,r),F8(n,r),o.forEach(w=>w.parentNode?.removeChild(w)),Jf(n);const a=Q8(n.closest("table"),t)||s.width,l=J8(n,t)||s.height,c=e9(t,r),u=G8(r),d=V8(r),f=t9(c,a,l)||s.arcsize,p={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:Z8(t,r),width:a,height:l,arcsize:f,label:i,color:r.style.color||"",fontFamily:r.style.fontFamily||"",fontSize:r.style.fontSize||"",bold:u.bold,italic:u.italic,underline:u.underline,strikethrough:u.strikethrough,strokeColor:d?.color||"",strokeWeight:d?.weight||"",strokeDash:d?.dash||""};K8(r);const m=n.ownerDocument;if(!m)return;const h=R1(r),y=m.createComment(X8(p));ei(h)&&Xf.test(h.nodeValue||"")&&h.parentNode?h.parentNode.insertBefore(y,h):n.insertBefore(y,n.firstChild)}function Zl(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function Hn(e){return typeof e=="number"&&Number.isFinite(e)}function n9(e){return!e||typeof e!="object"?!1:Hn(e.all)||Hn(e.top)||Hn(e.right)||Hn(e.bottom)||Hn(e.left)}function r9(e,t){const n=Hn(t.all)?t.all:void 0,r=Hn(t.top)?t.top:n,o=Hn(t.right)?t.right:n,i=Hn(t.bottom)?t.bottom:n,s=Hn(t.left)?t.left:n;r!==void 0&&(e.style.paddingTop=`${r}px`),o!==void 0&&(e.style.paddingRight=`${o}px`),i!==void 0&&(e.style.paddingBottom=`${i}px`),s!==void 0&&(e.style.paddingLeft=`${s}px`)}function I1(e,t){return Array.from(document.querySelectorAll("link[em-class]")).some(n=>n.getAttribute("em-class")===e&&(t===void 0||n.getAttribute("href")===t))}function D1(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function B1(e){return e.stylesheet??LA(e.source_url)}function o9(e){return`/* ${`em-project-font-${Jo(e.family)}-${e.weight}-${e.style}`} */
|
|
77
|
+
@font-face{font-family:${JSON.stringify(e.family)};src:url(${JSON.stringify(e.source_url)});font-weight:${e.weight};font-style:${e.style};font-display:swap;}`}var i9=e=>g1({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function s9(e,t){if(I1(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),D1(n)}function _s(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=Yl(r,o);if(n==="Project Fonts"){const d=If(r),f=d[0];if(Sr("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!f,faces:d}),f){$e();const p=document.querySelector('style[em="styles"]'),m=[...new Set(d.filter(B1).map(h=>h.source_url))];if(m.forEach(h=>s9(h,i)),p){const h=new Set(Df(p.textContent??"").map(g1)),y=d.filter(b=>!B1(b)).filter(b=>!h.has(i9(b))).map(o9).join(`
|
|
78
|
+
`),w=y!=="";w&&p.insertAdjacentHTML("afterbegin",`${y}
|
|
79
|
+
`);const A=`.${v1(i)} {`,k=!p.textContent?.includes(A);if(k){const b=jl[o],v=(b||f.weight).replace(/i$/g,""),S=b?b.endsWith("i"):f.style!=="normal";let T=`font-family: ${JSON.stringify(f.family)}, ${h1(f)}!important;`;T+=` font-weight: ${v}!important;`,S&&(T+=" font-style: italic!important;"),p.insertAdjacentHTML("beforeend",`
|
|
80
|
+
${A} ${T} }`)}Sr("iframe: project font attached",{emClass:i,stylesheetUrls:m,faceInserted:w,classInserted:k})}else Sr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{Zr({elem:document.documentElement},t),Ar(t),t&&t(!1)},0);return}Sr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{Zr({elem:document.documentElement},t),Ar(t)},0);return}if(!I1(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const f=jl[o]||"400",p=f.indexOf("i")>-1,m=f.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${p?"1":"0"},${m}&display=swap`),d.setAttribute("em-class",i),D1(d)}$e();const s=jl[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${h8[n]||"sans-serif"}!important;`;c+=` font-weight: ${a}!important;`,l&&(c+=" font-style: italic!important;");const u=document.querySelector('style[em="styles"]');u&&u.insertAdjacentHTML("beforeend",`
|
|
81
|
+
.${v1(i)} { ${c} }`),setTimeout(()=>{Zr({elem:document.documentElement},t),Ar(t)},0)}function a9(e){const t=Jo(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function Ar(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=Df(n).filter(o=>If(o.family).length>0&&!a9(o.family));!t||r.length===0||(t.textContent=b1(n,r),Sr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function Zr(e,t){let n=!1;e.elem.querySelectorAll("link[em-class]").forEach(r=>{const o=r.getAttribute("em-class");o&&!document.querySelector("."+o)&&(n=!0,r.remove())}),n&&t&&t(!1)}function tm(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],Zr({elem:document.documentElement},n),Ar(n)):t[0]==="Google Fonts"&&(t[1]==="Sans Serif"?e.style.fontFamily="Helvetica, Arial, sans-serif":t[1]==="Serif"?e.style.fontFamily='"Times New Roman", Times, serif':t[1]==="Project Fonts"&&Gl(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(Yl(t[2],t[3])),_s({fontFamilyArray:t},n))}function H1(e,t){if(t){const n=e.querySelector("b");n?n.replaceWith(...n.childNodes):e.querySelector("strong")||(e.innerHTML="<strong>"+e.innerHTML+"</strong>")}else{const n=e.querySelector("strong"),r=e.querySelector("b");n?n.replaceWith(...n.childNodes):r&&r.replaceWith(...r.childNodes)}if(e.style.fontWeight){const n=e.getAttribute("style")?.replace(/(\s+)?font-weight:(\s+)?(bold|[0-9]*)(;)?/,"")||"";e.setAttribute("style",n)}}function F1(e,t){if(t){const n=e.querySelector("i");n?n.replaceWith(...n.childNodes):e.querySelector("em")||(e.innerHTML="<em>"+e.innerHTML+"</em>")}else{const n=e.querySelector("em"),r=e.querySelector("i");n?n.replaceWith(...n.childNodes):r&&r.replaceWith(...r.childNodes)}if(e.style.fontStyle){const n=e.getAttribute("style")?.replace(/(\s+)?font-style:(\s+)?.*?;/,"")||"";e.setAttribute("style",n)}}function $1(e,t){let n;t>0?n=e.style.letterSpacing?e.getAttribute("style").replace(/letter-spacing:(\s+)?.*?px/,`letter-spacing: ${t}px`):e.getAttribute("style")+` letter-spacing: ${t}px;`:n=e.getAttribute("style")?.replace(/(\s+)?letter-spacing:(\s+)?.*?px(;)?/,"")||"",e.setAttribute("style",n)}function ks(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function W1(e,t){const n=Mf(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Ie(e.html)),r.querySelectorAll('[em="atom"] div[style*="font-family"]').forEach(o=>{const i=o;if(!i.style.display&&parseFloat(i.style.fontSize)<=20){const s=n.text?.fontFamily||[],a=Zl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.text?.fontSize||16}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.text?.lineHeight||24}px`),n.text?.color||"#000000");i.setAttribute("style",a),tm(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":ks(i.nextElementSibling??i.closest("table")?.nextElementSibling,n.text?.paddingBottom||0)}else if(!i.style.display&&parseFloat(i.style.fontSize)>20){const s=n.headings?.fontFamily||[],a=Zl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.headings?.fontSize||24}px`).replace(/line-height:(\s+)?.*?px/,`line-height: ${n.headings?.lineHeight||32}px`),n.headings?.color||"#000000");i.setAttribute("style",a),tm(i,s,t),$1(i,n.headings?.letterSpacing||0),H1(i,n.headings?.bold||!1),F1(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":ks(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":ks(i.nextElementSibling,n.headings?.paddingBottom||0)}}),r.querySelectorAll('[em="atom"] a[style*="color"]').forEach(o=>{const i=o;if(i.style.display){if(i.style.display==="block"){const s=n.buttons?.fontFamily||[],a=Zl((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),tm(i,s,t);const l=i.closest("td"),c=!!l&&!!Cr(l)&&!Cr(i),u=c?i:l,d=n.buttons?.backgroundColor||"#1677FF";u&&(u.style.backgroundColor=d,u.tagName==="TD"&&u.setAttribute("bgcolor",d)),l&&l.setAttribute("align",n.buttons?.textAlign||"center"),$1(i,n.buttons?.letterSpacing||0),H1(i,n.buttons?.bold||!1),F1(i,n.buttons?.italic||!1);const f=i.closest('[em="atom"] > tr > td'),p=i.closest("table");f?.style.paddingTop?f.style.paddingTop=(n.buttons?.marginTop||0)+"px":p?.previousElementSibling&&ks(p.previousElementSibling,n.buttons?.marginTop||0),f?.style.paddingBottom?f.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":p?.nextElementSibling&&ks(p.nextElementSibling,n.buttons?.marginBottom||0);const m=n.buttons?.padding||{};m.all&&(i.style.padding=m.all+"px"),m.top&&(i.style.paddingTop=m.top+"px"),m.right&&(i.style.paddingRight=m.right+"px"),m.bottom&&(i.style.paddingBottom=m.bottom+"px"),m.left&&(i.style.paddingLeft=m.left+"px"),u&&(n.buttons?.border&&Uf({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&ws({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&em(i,{backgroundColor:d})}}else{const s=Zl(i.getAttribute("style"),n.links?.color||"#0000FF");i.setAttribute("style",s);let a;n.links?.underline?a=i.style.textDecoration?i.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: underline;"):i.getAttribute("style")+" text-decoration: underline;":a=i.style.textDecoration?i.getAttribute("style").replace(/(\s+)?text-decoration:(\s+)?.*?;/,"text-decoration: none;"):i.getAttribute("style")+" text-decoration: none;",i.setAttribute("style",a)}}),r.querySelector('[em="block"]')&&n.block?.backgroundColor&&r.querySelectorAll('[em="block"]').forEach(o=>{vs(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?bt(r):bt(r.querySelector("tbody")||r)}function nm(e){const t=Mf(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Ie(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{vs(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return n9(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(vs).forEach(o=>{r9(o,r)}),n.tagName==="DIV"?bt(n):bt(n.querySelector("tbody")||n)}var l9=e=>{for(const t of Object.keys(jl))if(Jo(t)===e)return t;return e};function c9(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(If(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=Df(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=b1(n,o),Sr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function u9(e){if(!y8())return;const t=document.head.innerHTML,n=new Set;for(const r of p1()){c9(r.family);const o=`em-font-${Jo(r.family)}-`;document.querySelectorAll(`[class*="${o}"]`).forEach(i=>{[...i.classList].forEach(s=>{if(!s.startsWith(o)||n.has(s))return;n.add(s);const a=s.slice(o.length),l=l9(a);_s({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&Sr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:p1().map(r=>r.family)}),Ar(),e&&document.head.innerHTML!==t&&e(!1)}function d9(e,t){const n=new Ae,r=()=>{requestAnimationFrame(()=>{u9(t)})};return n.addDisposable(K.addListener(ke.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function q1(){K.send({operation:"sandbox_resized"})}function f9(e,t){const n=new Ae,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{q1(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(kn(c))return AT(c)?c:[...c.querySelectorAll("img")]})}).filter(l=>!!l).map(l=>l.complete?Promise.resolve():new Promise((c,u)=>{l.addEventListener("load",c),l.addEventListener("error",c)}));a.length&&Promise.all(a).then(i)})),window.addEventListener("resize",i),n.addDispose(()=>window.removeEventListener("resize",i)),n}function m9(e=document,t=window){let n=e.body;const r=new MutationObserver(()=>{if(o(),e.body===n)return;n=e.body;const i=t.parentIFrame;i?.autoResize&&(i.autoResize(!1),n&&(i.autoResize(!0),i.size?.()))});function o(){r.disconnect(),r.observe(e,{childList:!0}),e.documentElement&&r.observe(e.documentElement,{childList:!0})}return o(),{dispose:()=>r.disconnect()}}var p9=/^(?:ant|vscode|monaco|docs)-/;function h9(e){return p9.test(e)}function g9(){const e="em".trim();if(!/^[a-z][a-z0-9]*$/i.test(e))throw new Error(`[cssVars] REACT_APP_CSS_VAR_PREFIX="${e}" is not a valid CSS identifier fragment.`);return e}var b9=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function y9(){return b9}var v9=new Set;function E9(e,t,n=v9){return e.startsWith(`${t}-`)?!1:!h9(e)&&!n.has(e)}function S9(e,t){return`--${t}-${e}`}function w9(e){const t=g9();return E9(e,t,y9())?S9(e,t):`--${e}`}function C9(e){const t=new Ae;let n="";const r=o=>{document.querySelectorAll("style[em-variables]").forEach(a=>a.remove());const i=document.createElement("style");i.dataset.themeVaribalse="true";const s=Object.entries(o).map(([a,l])=>` ${w9(a)}: ${String(l)};
|
|
82
|
+
`).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
|
|
83
|
+
${s}}`;const a=document.querySelector('[data-theme-varibalse="true"]');if(a)a.replaceWith(i);else{const l=document.querySelector("head")||document.querySelector("body");l?.insertBefore(i,l.firstChild)}e.commit(!1)}};return t.addDisposable(e.onChange(()=>{if(!document.querySelector('[data-theme-varibalse="true"]')&&n){const o=document.createElement("style");o.dataset.themeVaribalse="true",o.innerHTML=`:root {
|
|
84
|
+
${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(K.addListener(ke.SANDBOX_SET_THEME_VARIABLES,r)),t}var A9={name:"sandbox.crossDomainDrag",setup:()=>e8()},T9={name:"sandbox.themeVariables",awaits:{services:[J]},setup:e=>C9(D(e,J))},_9={name:"sandbox.projectFonts",awaits:{services:[gt,Oe]},setup(e){S8();const t=ct(e);d9(D(e,gt),n=>t(n))}},k9={name:"sandbox.variableSelection",setup:()=>s8()},L9={name:"sandbox.emReplaceCaret",awaits:{services:[J]},setup:e=>p8(D(e,J))},N9={name:"sandbox.resizeWatch",awaits:{services:[J,gt]},setup(e){f9(D(e,J),D(e,gt)),m9()}},x9={name:"sandbox.reset",awaits:{services:[J]},setup:e=>Gk(D(e,J))},O9={name:"sandbox.correct",awaits:{services:[J,lt,gt]},setup:e=>QD(D(e,J),D(e,lt).controller,D(e,gt))},R9={name:"sandbox.extensionScripts",awaits:{services:[J,Si]},setup:e=>G4(D(e,J),{surface:D(e,Si)})},M9={name:"sandbox.localization",provides:[iu],awaits:{services:[J]},setup:e=>e.inject(iu,ZD(D(e,J)))};function P9(e=[]){return{name:"sandbox.extensions",awaits:{services:[lt,Si,J]},setup:t=>GD({container:t,focusController:D(t,lt).controller,surface:D(t,Si),features:[...e]})}}function I9(e){const t=n=>function r(o,i=10){if(!D9(o)||i<0)return o;if(typeof o=="string")return n(o);if(o instanceof Array)return o.map(a=>r(a,i-1));const s=Object.entries(o).map(([a,l])=>[a,r(l,i-1)]);return Object.fromEntries(s)};return{escape:t(n=>e.escape(n,!0)),unescape:t(n=>e.unescape(n))}}function D9(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function z1(e){return/^(data|blob):/i.test(e.trimStart())}function U1(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function B9(e,t){try{let n="",r=0,o=0;for(;o<e.length;){for(;o<e.length&&/[\s,]/.test(e[o]);)o+=1;if(o>=e.length)break;const i=o;for(;o<e.length&&!/\s/.test(e[o]);)o+=1;let s=o;for(;s>i&&e[s-1]===",";)s-=1;if(n+=e.slice(r,i)+t(e.slice(i,s)),r=s,s!==o)continue;let a=0;for(;o<e.length&&(e[o]!==","||a>0);)e[o]==="("?a+=1:e[o]===")"&&(a=Math.max(0,a-1)),o+=1}return n+e.slice(r)}catch{return e}}function H9(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${U1(o,t)}${i})`)}function rm(e,t,n){const r=e.toLowerCase();return r==="srcset"?B9(t,n):r==="style"?H9(t,n):U1(t,n)}var F9=["src","___src","background","poster","srcset","style"];function Ql(e){return z1(e)?e:Al(e)}function $9(){const e=new Map,t=n=>{if(z1(n))return n;const r=Ql(n),o=e.get(r);return o?Y4(r).replace(new RegExp(`${ss}=\\d+`),`${ss}=${o}`):n};return{transform:{name:"em-version",attributes:F9,render:(n,r)=>n&&rm(r.attribute,n,t),serialize:(n,r)=>n&&rm(r.attribute,n,Ql)},requestReload(n){e.set(Ql(n.trim()),String(Date.now()))},isPending(n){return e.has(Ql(n.trim()))},clear(){e.clear()}}}var V1=["src","background","poster","srcset","style"];function om(e,t=document){const n=V1.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of V1){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=af(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function W9(e,t){const{pipeline:n,htmlDocument:r}=t,o=$9(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>om(n)))},clear(){o.clear()}};return e.inject(ou,s),{reload:s,dispose(){i.dispose(),o.clear(),cn(e,ou)}}}var q9=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],z9="/static/media/",U9="empty-image";function V9(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function j1(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(z9)?t:null}function j9(e){return!!e&&j1(e)!==null}function G9(e){if(!e)return!1;if(q9.includes(e))return!0;const t=j1(e);return t===null?!1:V9(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===U9}var X9=1e4;function Y9(e=X9){const t=new Map,n=new Map,r=(o,i)=>{URL.revokeObjectURL(i.blobUrl),t.delete(o)};return{acquire(o,i){const s=t.get(o);if(s)return s.revokeTimer&&(clearTimeout(s.revokeTimer),s.revokeTimer=void 0),s.refs+=1,s.blobUrl;const a=URL.createObjectURL(i);return t.set(o,{blobUrl:a,refs:1}),n.set(a,o),a},release(o){const i=t.get(o);i&&(i.refs-=1,!(i.refs>0||i.revokeTimer)&&(i.revokeTimer=setTimeout(()=>r(o,i),e)))},peek(o){return t.get(o)?.blobUrl},sourceOf(o){return n.get(o)},forget(o){const i=t.get(o);i&&(i.revokeTimer&&clearTimeout(i.revokeTimer),r(o,i))},get size(){return t.size},dispose(){for(const[o,i]of Array.from(t))i.revokeTimer&&clearTimeout(i.revokeTimer),r(o,i);n.clear()}}}var K9=3e3,Z9=["src","___src","background","poster","srcset","style"],im=e=>e.startsWith("blob:"),Jl="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%220%22%20height%3D%220%22%2F%3E#em-wait=";function Q9(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${Jl}${t}`}var J9=new RegExp(String.raw`blob:[^\s"'()<>]+|`+Jl.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function G1(e){if(e.startsWith(Jl))try{return decodeURIComponent(e.slice(130))}catch{return}}function eB(e){const t=e.attribute.toLowerCase();if(t==="background"||t==="style"||t==="poster")return!0;const n=(e.element?.tagName??e.tag??"").toLowerCase();return n===""?!1:Kk(n)}function tB(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function nB(e){const t=e.store??Y9(),n=e.answerTimeoutMs??K9,r=new Map,o=new Set;let i={enabled:!1,sourceHosts:[]},s=!1,a=!1;const l={hits:0,misses:0,refused:0,failed:0},c=m=>{const h=tB(m);return h?h===window.location.hostname||i.sourceHosts.includes(h):!1},u=(m,h=!1)=>{if(r.has(m)||!h&&(o.has(m)||t.peek(m)))return;const y=K.sendAsync(ke.APPLICATION_CANVAS_IMAGE_GET,h?{url:m,fresh:h}:{url:m}).then(A=>{const k=A;if(k&&"blob"in k){t.acquire(m,k.blob),l.hits+=1;return}o.add(m),l.refused+=1}).catch(()=>{o.add(m),l.failed+=1}),w=Promise.race([y,new Promise(A=>{setTimeout(()=>{r.has(m)&&(s=!0,o.add(m),l.failed+=1),A()},n)})]).then(()=>{r.delete(m),e.refresh()});r.set(m,w)},d=m=>{const h=G1(m);if(h!==void 0)return d(h);if(!m||a||im(m)||m.startsWith("data:")||j9(m))return m;const y=t.peek(m);return y||(s||!i.enabled||o.has(m)||!c(m)?m:(l.misses+=1,u(m),Q9(m)))},f=m=>im(m)?t.sourceOf(m)??m:G1(m)??m,p=(m,h,y)=>rm(h.attribute,m,y);return{configure(m){i={enabled:m.enabled,sourceHosts:[...m.sourceHosts??[]]}},transform:{name:"image-cache",attributes:Z9,render:(m,h)=>m&&eB(h)?p(m,h,d):m,serialize:(m,h)=>m&&p(m,h,f)},forget(m){t.forget(m),o.delete(m),!a&&u(m,!0)},fail(m){const h=t.sourceOf(m);return h===void 0||t.peek(h)!==m?!1:(o.add(h),t.forget(h),l.failed+=1,!0)},block(){a=!0},restoreUrls(m){return sm(m,f)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function rB(e,t,n){let r=!1;const o=s=>{const a=s;r||!String(a.blockedURI??"").startsWith("blob")||a.effectiveDirective!=="img-src"||(r=!0,t.block(),n())},i=s=>{const a=s.target,l=a?.currentSrc||a?.src||"";im(l)&&t.fail(l)&&n()};return e.addEventListener("securitypolicyviolation",o),e.addEventListener("error",i,!0),{dispose:()=>{e.removeEventListener("securitypolicyviolation",o),e.removeEventListener("error",i,!0)}}}function oB(e,t){return!e.includes("blob:")&&!e.includes(Jl)?e:e.replace(J9,n=>t(n))}function sm(e,t){if(typeof e=="string")return oB(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=sm(o,t);return n||(n=i!==o),i});return n?r:e}if(e&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype){let n=!1;const r={};for(const[o,i]of Object.entries(e)){const s=sm(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function iB(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>om(n)),i=nB({refresh:o}),s=rB(document,i,o),a=n.register(i.transform),l=K.addListener(ke.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>om(n))}),c=K.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(da,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),cn(e,da)}}}function sB(e,t){const n=new Tk,r=new La,o=new _k(n,r),i=new Q_(r,n,{prepareHtml:t.prepareHtml,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}}),s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0,l=M0((c,u,d)=>i.applyForeignOutput(c,u,d));return{htmlDocument:i,remoteDocument:n,textDocument:r,documentMapping:o,onDocumentShown:c=>n.onReady(()=>c()),onDocumentReplaced:c=>n.onEntitySet(u=>c(u)),commit:c=>i.commit(c),commitLockedAsync:async c=>{try{t.lock?.increment(),await i.commit(c,!0)}finally{t.lock?.decrement()}},dispose(){a?.dispose(),l(),i.dispose(),n.dispose(),r.dispose()}}}function aB(e,t){const n=e.getInstance(ua),r=sB(t,{prepareHtml:D(e,fa),lock:n&&{increment:()=>n.increment("activeElementLocked"),decrement:()=>n.decrement("activeElementLocked")}}),o={commit:i=>r.commit(i),commitLockedAsync:i=>r.commitLockedAsync(i)};return e.inject(Ei,t),e.inject(gt,r.remoteDocument),e.inject(vi,r.textDocument),e.inject(an,r.documentMapping),e.inject(J,r.htmlDocument),e.inject(Oe,o),{...r,dispose(){r.dispose(),cn(e,Ei),cn(e,gt),cn(e,vi),cn(e,an),cn(e,J),cn(e,Oe)}}}function lB(e){e.inject(ua,O)}var cB=class extends Ae{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),L(this,"_isEditorInFocus",!1),L(this,"_context",new Map),L(this,"_editorLostFocusEmitter",this.addDisposable(new _e)),L(this,"_summaries",[]),L(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),L(this,"editorLostFocus",this._editorLostFocusEmitter.event),this.addDisposable(e.onChange(this._onChange))}setFocus(e){this._isEditorInFocus!==e&&(this._isEditorInFocus=e,e||(this._editorLostFocusEmitter.fire(this._summaries),this._summaries=[],this._context.clear()))}whenEditorLostFocusAsync(e){return new Promise(t=>this.whenEditorLostFocus(t,e))}whenEditorLostFocus(e,t){if(this._isEditorInFocus){const n=this._editorLostFocusEmitter.once(e);if(t!==void 0){const r=this._context.get(t);r&&r.dispose(),this._context.set(t,n)}}else e([])}};function uB(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new cB(n);let i;const s=r.beforeSave(c=>{o.isEditorInFocus&&(i=i||c.value,c.preventDefault())}),a=()=>{typeof i=="boolean"&&(r.saveChanges(i),i=void 0)},l={controller:o,setEditorFocus(c){o.isEditorInFocus!==c&&(c&&a(),o.setFocus(c),c||a())},dispose(){s.dispose(),o.dispose(),cn(e,lt)}};return e.inject(lt,l),l}var dB={name:"sandbox.state",provides:[ua],setup:lB},fB={name:"sandbox.attributePipeline",provides:[co],setup:mI},mB={name:"sandbox.documentSync",provides:[J,gt,vi,an,Oe,ma],awaits:{services:[Ei,fa,ua]},setup:e=>e.inject(ma,aB(e,D(e,Ei)))},pB={name:"sandbox.images",provides:[da,ou],awaits:{services:[co,J,ma]},setup(e){const t=D(e,co),n=D(e,J);iB(e,{pipeline:t,htmlDocument:n});const r=W9(e,{pipeline:t,htmlDocument:n}).reload;D(e,ma).onDocumentReplaced(()=>r.clear()),K.addListener(ke.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(da)?.forget(o),r.reload(o))})}},hB={name:"sandbox.mapObj",provides:[uo],awaits:{services:[an]},setup:e=>e.inject(uo,I9(D(e,an)))},gB={name:"sandbox.focus",provides:[lt],awaits:{services:[J,gt]},setup:e=>uB(e,{htmlDocument:D(e,J),remoteDocument:D(e,gt)})},bB=[dB,fB,mB,pB,AL,TL,_L,hB,gB,A9,T9,_9,k9,L9,N9,x9,O9,R9,M9,UD,VD,jD,...eN],am=null,lm=0,yB=6e5;function vB(e){am=e,lm=e?Date.now():0}function EB(){const e=am,t=lm;return am=null,lm=0,!e||!t||Date.now()-t>yB||!e.isConnected||!e.matches('[em="block"]')?null:e}function SB(e,t){const n=t.getOuterHtml(e),r=document.implementation.createHTMLDocument("").body,o=r.ownerDocument.createElement(e.tagName==="TR"?"table":"div");document.querySelectorAll("style").forEach(a=>{const l=t.getOuterHtml(a);l&&o.insertAdjacentHTML("beforeend",l)}),o.insertAdjacentHTML("beforeend",`
|
|
85
|
+
`);const i=Ie(n)[0];if(!i)return null;i.querySelectorAll("style").forEach(a=>{a.remove()}),i.classList.remove("em-structure"),i.querySelectorAll(".em-structure").forEach(a=>a.classList.remove("em-structure")),o.appendChild(i),e.querySelectorAll('[class*="em-font-"]').forEach(a=>{const l=[...a.classList].find(c=>c.startsWith("em-font-")&&c!=="em-font-custom");if(l){const c=`link[em-class="${l}"]`;!o.querySelector(c)&&document.querySelector(c)&&(o.insertAdjacentHTML("afterbegin",`
|
|
86
|
+
`),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),Yv(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Xt(r);return e.tagName==="TR"?s=s.replaceAll(/<body(.|\n|\r)*?><table>/gi,"").replaceAll(/<\/table><\/body>/gi,""):s=s.replaceAll(/<body(.|\n|\r)*?><div>/gi,"").replaceAll(/<\/div><\/body>/gi,""),s=s.replaceAll(/html {((.|\n|\r)*?)}/gi,"").replaceAll(/<style[^>]*>\s*<\/style>/gi,""),s}function wB(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=SB(o,n);if(!i)return;vB(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:Ll({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function ec(e){const t=document.querySelector(".em-element-editor:not(.of-atom)");if(!t)return;const n=(t.closest('[em="block"]')||t.closest('[em="group"]'))?.getBoundingClientRect().top||0;if(e.scrollTop>n+55){const r=e.scrollTop-n;t.style.top=r+8+"px"}else t.style.removeProperty("top")}function tc(e){const t=document.querySelector(".em-element-editor");if(!t)return;const n=t.getBoundingClientRect(),r=document.querySelector(".em-element-editor-widget");r&&(n.top<0?r.classList.add("sticky"):r.classList.remove("sticky"),n.top+t.offsetHeight-10-r.offsetHeight<0&&r.classList.remove("sticky"),e(!1))}var Ze=()=>ja(window.getSelection()?.toString())??"",CB=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],AB={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},TB=/^#[\da-f]{6}$/i,X1=()=>[...new Set(CB.flatMap(_B).map(V).filter(e=>TB.test(e)).map(e=>e.toUpperCase()))];function _B({type:e,name:t}){const n=AB[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}var kB=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],cm=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;"> </div>`;function LB(e){return!!e.closest("editor.em-text")}function Y1(e){e.querySelectorAll(kB.join(",")).forEach(t=>{LB(t)||t.remove()})}function NB(e){const t=e.cloneNode(!0);Fr(t);const n=t.querySelector("editor.em-text");if(n){Y1(t);const o=n.querySelector("div");if(o)return o.outerHTML;const i=n.getAttribute("innerclass")??"",s=n.getAttribute("innerstyle")??"";return`<div${i?` class="${Fn(i)}"`:""}${s?` style="${Fn(s)}"`:""}>${n.innerHTML}</div>`}Y1(t);const r=t.querySelector("div");return r?r.outerHTML:t.innerHTML}function Fn(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function gn(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function Ls(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=gn(t[0]),r=t[1],o=t.slice(2).join(" ");if(n!==void 0&&["none","solid","dashed","dotted","double"].includes(r))return{width:n,style:r,color:o}}function xB(e){const t=e.get("padding"),n=e.get("padding-top"),r=e.get("padding-right"),o=e.get("padding-bottom"),i=e.get("padding-left"),s={};if(t){const d=t.trim().split(/\s+/),f=gn(d[0]),p=gn(d[1]??d[0]),m=gn(d[2]??d[0]),h=gn(d[3]??d[1]??d[0]);f!==void 0&&(s.top=f),p!==void 0&&(s.right=p),m!==void 0&&(s.bottom=m),h!==void 0&&(s.left=h)}const a=gn(n??""),l=gn(r??""),c=gn(o??""),u=gn(i??"");return a!==void 0&&(s.top=a),l!==void 0&&(s.right=l),c!==void 0&&(s.bottom=c),u!==void 0&&(s.left=u),Object.keys(s).length?s:void 0}function K1(e){if(e)return e.trim()}function OB(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].includes(t)?t:void 0}function RB(e){if(!e)return;const t=e.trim().toLowerCase();if(t==="top"||t==="text-top")return"top";if(t==="bottom"||t==="text-bottom")return"bottom";if(t==="middle")return"middle"}function MB(e){const t=new Map;return e&&e.split(";").forEach(n=>{const[r,...o]=n.split(":");if(!r||o.length===0)return;const i=r.trim().toLowerCase(),s=o.join(":").trim();i&&t.set(i,s)}),t}function PB(e){if(!e)return;const t=e.trim().replace(/\s+/g," ");if(t&&/^(\d+(\.\d+)?\s*(px|em|rem|%|pt)\s*){1,4}$/i.test(t))return t}function IB(e){const t=MB(e.getAttribute("style")),n=t.get("font-family")??void 0,r=gn(t.get("font-size")??""),o=gn(t.get("line-height")??""),i=K1(t.get("color")??void 0),s=K1(t.get("background-color")??void 0),a=OB(t.get("text-align")??void 0),l=RB(t.get("vertical-align")??void 0),c={top:Ls(t.get("border-top")),right:Ls(t.get("border-right")),bottom:Ls(t.get("border-bottom")),left:Ls(t.get("border-left"))},u=Ls(t.get("border"));u&&(c.top=c.top??u,c.right=c.right??u,c.bottom=c.bottom??u,c.left=c.left??u);const d=xB(t),f=PB(t.get("border-radius")??void 0),p={};return n&&(p.fontFamily=n),r!==void 0&&(p.fontSize=r),o!==void 0&&(p.lineHeight=o),i&&(p.color=i),s&&(p.backgroundColor=s),a&&(p.textAlign=a),l&&(p.verticalAlign=l),d&&(p.padding=d),f&&(p.borderRadius=f),(c.top||c.right||c.bottom||c.left)&&(p.borders=c),Object.keys(p).length?p:void 0}function DB(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function BB(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}function um(e){if(e==null)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function Ns(e){const t=Array.from(e.classList),n={};Array.from(e.attributes).forEach(c=>{const u=c.name.toLowerCase();u!=="class"&&(n[u]=c.value)});const r={width:e.getAttribute("width")??void 0,cellpadding:um(e.getAttribute("cellpadding")),cellspacing:um(e.getAttribute("cellspacing")),border:um(e.getAttribute("border")),classList:t.length?t:void 0,attrs:Object.keys(n).length?n:void 0},o=[],i=[];let s=0;const a=Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr, :scope > thead > tr, :scope > tfoot > tr")).filter(c=>c.querySelectorAll("td, th").length!==0);a.forEach(c=>{let u=0;Array.from(c.querySelectorAll("td, th")).forEach(d=>{const f=Math.max(1,d.colSpan||1);u+=f}),u>s&&(s=u)});let l=0;for(const c of a){i[l]||(i[l]=Array(s).fill(null));let u=0;const d=Array.from(c.querySelectorAll("td, th"));for(const f of d){for(;u<s&&i[l][u]!==null&&i[l][u]!==void 0;)u++;if(u>=s)continue;const p=Math.max(1,f.colSpan||1),m=Math.max(1,f.rowSpan||1),h=Math.min(m,a.length-l),y=`cell-${o.length}`,w=Array.from(f.classList),A=NB(f),k=DB(f),b=BB(f),v=IB(f),S={id:y,row:l,col:u,rowspan:h,colspan:p,contentHtml:A,classList:w,align:k,valign:b,style:v};o.push(S);for(let T=0;T<h;T++){const g=l+T;i[g]||(i[g]=Array(s).fill(null));for(let E=0;E<p;E++){const C=u+E;C>=s||i[g][C]!==null&&i[g][C]!==void 0||(i[g][C]=y)}}u+=p}l++}for(let c=0;c<i.length;c++)for(let u=0;u<s;u++)(i[c][u]===null||i[c][u]===void 0)&&(i[c][u]=null);new Set(i.flat().filter(c=>c!==null)),new Set(o.map(c=>c.id));for(const c of o)for(let u=c.row;u<c.row+c.rowspan;u++)for(let d=c.col;d<c.col+c.colspan;d++)i[u]&&(i[u][d],c.id);return{rows:i.length,cols:s,cells:o,grid:i,meta:r}}function Z1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o=-1;const i=typeof t=="string"?t.trim():"";if(i){for(const p of r.cells)if(Array.isArray(p.classList)&&p.classList.includes(i)){o=p.row;break}}o===-1&&(r.rows===0?(o=0,n=!0):(o=r.rows-1,n=!1));const s=r.cells.filter(p=>p.row===o).sort((p,m)=>p.col-m.col),a=r.cells.length===0;if(s.length===0)if(a)s.push({id:"cell-0",row:0,col:0,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}}),r.cols=1;else for(let p=0;p<r.cols;p++)s.push({id:`template-${p}`,row:o,col:p,rowspan:1,colspan:1,contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}});let l=1;for(const p of s)p.rowspan>l&&(l=p.rowspan);let c=n?o:o+l;const u=new Array(r.cols).fill(!1);for(const p of r.cells)if(p.row<c&&p.row+p.rowspan>c)for(let m=p.col;m<p.col+p.colspan;m++)u[m]=!0;for(const p of r.cells)p.row>=c&&(p.row+=1);const d=[];let f=r.cells.length;for(let p=0;p<r.cols;p++){if(u[p])continue;const m=s.find(y=>y.col<=p&&p<y.col+y.colspan)||s[0]||{contentHtml:cm,classList:[""],align:"center",valign:"top",style:{}},h=JSON.parse(JSON.stringify(m));h.id=`cell-${f++}`,h.contentHtml=nc(m.contentHtml," "),h.classList=h.classList.filter(y=>y!==i),h.row=c,h.col=p,h.rowspan=1,h.colspan=1,d.push(h)}r.cells.push(...d),r.rows+=1,r.grid.splice(c,0,new Array(r.cols).fill(null));for(let p=0;p<r.rows;p++)for(let m=0;m<r.cols;m++){const h=r.cells.find(y=>y.row<=p&&y.row+y.rowspan>p&&y.col<=m&&y.col+y.colspan>m);r.grid[p][m]=h?h.id:null}for(let p=0;p<r.cols;p++)r.grid[c][p]===null&&u[p];return r}function HB(e){if(!e)return"";const t=[];if(e.fontFamily&&t.push(`font-family: ${e.fontFamily}`),e.fontSize!==void 0&&t.push(`font-size: ${e.fontSize}px`),e.lineHeight!==void 0&&t.push(`line-height: ${e.lineHeight}px`),e.color&&t.push(`color: ${e.color}`),e.backgroundColor&&t.push(`background-color: ${e.backgroundColor}`),e.textAlign&&t.push(`text-align: ${e.textAlign}`),e.verticalAlign&&t.push(`vertical-align: ${e.verticalAlign}`),e.borderRadius&&t.push(`border-radius: ${e.borderRadius}`),e.padding){const n=e.padding;n.top!==void 0&&n.right!==void 0&&n.bottom!==void 0&&n.left!==void 0&&n.top===n.right&&n.right===n.bottom&&n.bottom===n.left?t.push(`padding: ${n.top}px`):(n.top!==void 0&&t.push(`padding-top: ${n.top}px`),n.right!==void 0&&t.push(`padding-right: ${n.right}px`),n.bottom!==void 0&&t.push(`padding-bottom: ${n.bottom}px`),n.left!==void 0&&t.push(`padding-left: ${n.left}px`))}if(e.borders){const n=e.borders;n.border?t.push(`border: ${n.border.width}px ${n.border.style} ${n.border.color}`):(n.top&&t.push(`border-top: ${n.top.width}px ${n.top.style} ${n.top.color}`),n.right&&t.push(`border-right: ${n.right.width}px ${n.right.style} ${n.right.color}`),n.bottom&&t.push(`border-bottom: ${n.bottom.width}px ${n.bottom.style} ${n.bottom.color}`),n.left&&t.push(`border-left: ${n.left.width}px ${n.left.style} ${n.left.color}`))}return t.length?t.join("; "):""}function $t(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=[];if(e.meta&&(e.meta.width&&t.push(`width="${Fn(e.meta.width)}"`),e.meta.cellpadding!==void 0&&t.push(`cellpadding="${e.meta.cellpadding}"`),e.meta.cellspacing!==void 0&&t.push(`cellspacing="${e.meta.cellspacing}"`),e.meta.border!==void 0&&t.push(`border="${e.meta.border}"`),e.meta.classList?.length&&t.push(`class="${Fn(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[o,i]of Object.entries(e.meta.attrs))t.push(`${Fn(o)}="${Fn(i)}"`);const n=new Map;for(const o of e.cells)n.set(o.id,o);const r=[];for(let o=0;o<e.rows;o++){const i=[];for(let s=0;s<e.cols;s++){const a=e.grid[o][s];if(!a)continue;const l=n.get(a);if(!l||l.row!==o||l.col!==s)continue;const c=[];l.rowspan>1&&c.push(`rowspan="${l.rowspan}"`),l.colspan>1&&c.push(`colspan="${l.colspan}"`),l.align&&c.push(`align="${Fn(l.align)}"`),l.valign&&c.push(`valign="${Fn(l.valign)}"`),l.classList?.length&&c.push(`class="${Fn(l.classList.join(" "))}"`);const u=HB(l.style);u&&c.push(`style="${Fn(u)}"`),i.push(`<td${c.length?" "+c.join(" "):""}>${l.contentHtml}</td>`)}i.length&&r.push(`<tr>${i.join("")}</tr>`)}return`<table${t.length?" "+t.join(" "):""}>${r.join("")}</table>`}function FB(e,t){const n=JSON.parse(JSON.stringify(e));let r=-1;const o=typeof t=="string"?t.trim():"";if(o){for(const i of n.cells)if(Array.isArray(i.classList)&&i.classList.includes(o)){r=i.row;break}}if(r===-1||n.rows<=1||n.cells.filter(i=>i.row===r).some(i=>i.rowspan>1))return n;n.cells=n.cells.filter(i=>i.row!==r);for(const i of n.cells)i.row>r&&(i.row-=1);return n.grid.splice(r,1),n.rows-=1,n}function nc(e,t){if(typeof e!="string"||typeof t!="string")return e;const n=new DOMParser().parseFromString(e,"text/html").body.firstChild;if(!n)return e;let r=!1;function o(a){if(a.nodeType===Node.TEXT_NODE&&a.textContent?.trim()){r?a.textContent="":(a.textContent=t,r=!0);return}for(const l of Array.from(a.childNodes))o(l)}function i(a){if(a.nodeType===Node.TEXT_NODE){const l=a.textContent||"";return!l||/^\s*$/.test(l.replace(/\u00A0/g,"X"))}return a.nodeType!==Node.ELEMENT_NODE?!0:Array.from(a.childNodes).every(l=>i(l))}function s(a,l=!1){if(a.nodeType!==Node.ELEMENT_NODE)return;const c=Array.from(a.childNodes);for(const u of c)s(u);!l&&i(a)&&a.parentNode?.removeChild(a)}return o(n),s(n,!0),n.outerHTML||e}function Q1(e,t,n){const r=JSON.parse(JSON.stringify(e));let o;const i=typeof t=="string"?t.trim():"";if(i){for(const u of r.cells)if(Array.isArray(u.classList)&&u.classList.includes(i)){o=u;break}}if(!o)return r;const s=o.col;let a=n?s:s+o.colspan;const l=[];let c=r.cells.length;for(let u=0;u<r.rows;u++){const d=JSON.parse(JSON.stringify(o));d.id=`cell-${c++}`,d.contentHtml=nc(o.contentHtml," "),d.row=u,d.col=a,d.rowspan=1,d.colspan=1,d.classList=o.classList.filter(f=>f!==i),l.push(d)}for(const u of r.cells)u.col>=a&&(u.col+=1);r.cells.push(...l),r.cols+=1;for(let u=0;u<r.rows;u++)r.grid[u].splice(a,0,null),r.grid[u][a]=l[u].id;return r}function $B(e,t){const n=JSON.parse(JSON.stringify(e));let r;const o=typeof t=="string"?t.trim():"";if(o){for(const s of n.cells)if(Array.isArray(s.classList)&&s.classList.includes(o)){r=s;break}}if(!r)return n;const i=r.col;if(n.cols<=1||n.cells.filter(s=>s.col===i).some(s=>s.colspan>1))return n;n.cells=n.cells.filter(s=>s.col!==i);for(const s of n.cells)s.col>i&&(s.col-=1);for(let s=0;s<n.rows;s++)n.grid[s].splice(i,1);return n.cols-=1,n}function J1(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.colspan,u=i.rowspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(l-A);else for(let A=0;A<r;A++)d.push(l+c+A);for(const A of d)if(A<0||A>=o.cols)return o;const f=[];for(const A of d){const k=o.cells.find(b=>b.row===a&&b.col<=A&&A<b.col+b.colspan);if(!k)return o;f.push(k)}const p=Array.from(new Set(f));for(const A of p)if(A.rowspan!==u)return o;const m=c+p.reduce((A,k)=>A+k.colspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,b=k?k.innerHTML:"";return b===""||/^\s*( )*\s*$/.test(b)?"":b}).filter(A=>A!=="").join("<br>");(h===""||/^\s*( |<br>)*\s*$/.test(h))&&(h=" ");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.colspan=m,n&&d.length>0&&(i.col=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const w=n&&d.length>0?Math.min(...d):l;for(let A=w;A<w+m;A++)o.grid[a][A]=i.id;return o}function eS(e,t,n,r=1){const o=JSON.parse(JSON.stringify(e));if(r<=0)return o;let i;const s=typeof t=="string"?t.trim():"";if(s){for(const A of o.cells)if(Array.isArray(A.classList)&&A.classList.includes(s)){i=A;break}}if(!i)return o;const a=i.row,l=i.col,c=i.rowspan,u=i.colspan,d=[];if(n)for(let A=1;A<=r;A++)d.push(a-A);else for(let A=0;A<r;A++)d.push(a+c+A);for(const A of d)if(A<0||A>=o.rows)return o;const f=[];for(const A of d){const k=o.cells.find(b=>b.col===l&&b.row<=A&&A<b.row+b.rowspan);if(!k)return o;f.push(k)}const p=Array.from(new Set(f));for(const A of p)if(A.colspan!==u)return o;const m=c+p.reduce((A,k)=>A+k.rowspan,0);let h=(n?[...p.reverse(),i]:[i,...p]).map(A=>{const k=new DOMParser().parseFromString(A.contentHtml,"text/html").body.firstChild,b=k?k.innerHTML:"";return b===""||/^\s*( )*\s*$/.test(b)?"":b}).filter(A=>A!=="").join("<br>");h=h.replace(/ $/g,""),(h===""||/^\s*( |<br>)*\s*$/.test(h))&&(h=" ");const y=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;y?(y.innerHTML=h,i.contentHtml=y.outerHTML):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${h}</div>`,i.rowspan=m,n&&d.length>0&&(i.row=Math.min(...d)),o.cells=o.cells.filter(A=>!p.includes(A));const w=n&&d.length>0?Math.min(...d):a;for(let A=w;A<w+m&&A<o.rows;A++)o.grid[A][l]=i.id;return o}function WB(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.colspan<=1||n>=i.colspan)return r;i.colspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row,col:i.col+i.colspan,colspan:n,rowspan:i.rowspan,contentHtml:nc(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}return r}function qB(e,t,n=1){const r=JSON.parse(JSON.stringify(e)),o=typeof t=="string"?t.trim():"";if(!o)return r;const i=r.cells.find(a=>Array.isArray(a.classList)&&a.classList.includes(o));if(!i||i.rowspan<=1||n>=i.rowspan)return r;i.rowspan-=n;const s={id:`cell-${r.cells.length}`,row:i.row+i.rowspan,col:i.col,rowspan:n,colspan:i.colspan,contentHtml:nc(i.contentHtml," "),classList:[...i.classList],align:i.align,valign:i.valign,style:i.style?JSON.parse(JSON.stringify(i.style)):{}};r.cells.push(s);for(let a=0;a<r.rows;a++)for(let l=0;l<r.cols;l++){const c=r.cells.find(u=>u.row<=a&&u.row+u.rowspan>a&&u.col<=l&&u.col+u.colspan>l);r.grid[a][l]=c?c.id:null}for(let a=s.row;a<s.row+s.rowspan;a++)for(let l=s.col;l<s.col+s.colspan;l++)r.grid[a][l];return r}function dm(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return null;const r=e.cells.find(o=>Array.isArray(o.classList)&&o.classList.includes(n));return r?{row:r.row,col:r.col}:null}function tS(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.row;if(o<0||o>=e.rows)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.rowspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.row<=o&&o<i.row+i.rowspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function nS(e,t){const n=typeof t=="string"?t.trim():"";if(!n)return{row:null,col:null,isOverlapped:!1};const r=e.cells.find(i=>Array.isArray(i.classList)&&i.classList.includes(n));if(!r)return{row:null,col:null,isOverlapped:!1};const o=r.col;if(o<0||o>=e.cols)return{row:null,col:null,isOverlapped:!1};for(const i of e.cells)if(i.colspan>1&&!(Array.isArray(i.classList)&&i.classList.includes(n))&&i.col<=o&&o<i.col+i.colspan)return{row:i.row,col:i.col,isOverlapped:!0};return{row:null,col:null,isOverlapped:!1}}function rS(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(c=>c.classList?.includes(t));if(!o)return r;const i=r.cells.filter(c=>c.classList?.includes(n)&&c.id!==o.id);let s=o.colspan||1;i.forEach(c=>{const u=c.colspan||1;s+=u,c.colspan=1}),o.colspan=s;const a=c=>{const u=c.match(/<div[^>]*>(.*?)<\/div>/);return u?u[1].replace(/ /g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((c,u)=>c.col-u.col).map(c=>a(c.contentHtml)).filter(c=>c.length>0)].filter(c=>c.length>0).join("<br>")}</div>`;const l=new Set(i.map(c=>c.id));return r.cells.forEach(c=>{if(c.row===o.row&&c.col>o.col&&!l.has(c.id)){let u=0;i.forEach(d=>{d.row===c.row&&d.col<c.col&&(u+=(d.colspan||1)-1)}),c.col-=u}}),r.grid=r.grid.map((c,u)=>{const d=new Array(r.cols).fill(null);return r.cells.filter(f=>{const p=f.row,m=f.row+(f.rowspan||1)-1;return p<=u&&u<=m&&!l.has(f.id)}).sort((f,p)=>f.col-p.col).forEach(f=>{const p=f.id,m=f.colspan||1,h=f.col;for(let y=0;y<m&&h+y<r.cols;y++)d[h+y]=p}),d}),r}function oS(e,t,n){const r=JSON.parse(JSON.stringify(e)),o=r.cells.find(u=>u.classList?.includes(t));if(!o)return r;const i=r.cells.filter(u=>u.classList?.includes(n)&&u.id!==o.id&&u.col===o.col);let s=o.rowspan||1;i.forEach(u=>{const d=u.rowspan||1;s+=d,u.rowspan=1}),o.rowspan=s;const a=u=>{const d=u.match(/<div[^>]*>(.*?)<\/div>/);return d?d[1].replace(/ /g,"").trim():""};o.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a; padding: 8px;">${[a(o.contentHtml),...i.sort((u,d)=>u.row-d.row).map(u=>a(u.contentHtml)).filter(u=>u.length>0)].filter(u=>u.length>0).join("<br>")}</div>`;const l=i.length>0?Math.min(...i.map(u=>u.row)):o.row;l<o.row&&(o.row=l);const c=new Set(i.map(u=>u.id));return r.cells.forEach(u=>{if(u.col===o.col&&u.id!==o.id&&!c.has(u.id)){let d=0;i.forEach(f=>{f.col===u.col&&f.row<=u.row&&(d+=(f.rowspan||1)-1)}),d>0&&(u.row-=d)}}),r.grid=r.grid.map((u,d)=>{const f=new Array(r.cols).fill(null);return r.cells.filter(p=>{const m=p.row,h=p.row+(p.rowspan||1)-1;return m<=d&&d<=h&&!c.has(p.id)}).sort((p,m)=>p.col-m.col).forEach(p=>{const m=p.col,h=p.colspan||1;for(let y=0;y<h&&m+y<r.cols;y++)f[m+y]=p.id}),f}),r}function rc(e,t,n,r,o,i=!0){const{cells:s,grid:a}=e;function l(p,m){if(!a[p]||!a[p][m])return null;const h=a[p][m];return s.find(y=>y.id===h)}function c(p,m){const h=l(p,m);return h?{row:h.row,col:h.col,cell:h}:null}const u=c(t,n),d=c(r,o);if(!u||!d||u.cell.id===d.cell.id)return 0;function f(p,m,h,y){let w=0;const A=p<m?1:-1,k=new Set;for(let v=p;v!==m;v+=A){const S=l(y?h:v,y?v:h);S&&!k.has(S.id)&&(k.add(S.id),w++)}const b=l(y?h:m,y?m:h);return b&&!k.has(b.id)&&w++,w}return i?u.row===d.row?f(n,o,t,!0)-1:0:u.col===d.col?f(t,r,n,!1)-1:0}function zB(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=["paddingLeftRight","paddingTopBottom","paddingLeft","paddingTop","paddingRight","paddingBottom"],o=n[0];if(!r.includes(o))return e;const i=t.settings[o];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach((s,a)=>{switch(s.id,s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0}),o){case"paddingLeftRight":s.style.padding.left=i,s.style.padding.right=i;break;case"paddingTopBottom":s.style.padding.top=i,s.style.padding.bottom=i;break;case"paddingLeft":s.style.padding.left=i;break;case"paddingTop":s.style.padding.top=i;break;case"paddingRight":s.style.padding.right=i;break;case"paddingBottom":s.style.padding.bottom=i}s.style.padding.top===0&&s.style.padding.right===0&&s.style.padding.bottom===0&&s.style.padding.left===0&&delete s.style.padding,Object.keys(s.style).length===0&&delete s.style}),e}function UB(e,t){const{backgroundPositionX:n,backgroundPositionY:r}=t.settings;if(n===void 0&&r===void 0)return e;const o=e.replace(/\s*;\s*/g,";").replace(/([^;])$/,"$1;").trim().split(";").filter(a=>a.trim());let i=!1;const s=o.map(a=>{const[l,c]=a.split(":").map(u=>u.trim());if(l==="background-position"){i=!0;const u=c.split(/\s+/).filter(p=>p.trim());let d=u[0],f=u[1]||u[0];return n!==void 0&&(d=`${n}px`),r!==void 0&&(f=`${r}px`),`background-position: ${d} ${f}`}return l==="background-position-x"&&n!==void 0?`background-position-x: ${n}px`:l==="background-position-y"&&r!==void 0?`background-position-y: ${r}px`:a});if(!i&&(n!==void 0||r!==void 0)){const a=n!==void 0?`${n}px`:"center",l=r!==void 0?`${r}px`:"center";s.push(`background-position: ${a} ${l}`)}return s.join("; ")}function VB(e){const t={};if(!e)return t;const n=e.split(";").map(r=>r.trim()).filter(r=>r.length>0);for(const r of n){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),s=r.slice(o+1).trim();if(!(!i||!s))switch(i.toLowerCase()){case"background-image":const a=s.match(/url\(['"]?(.+?)['"]?\)/i);a&&a[1]&&(t.backgroundImage=a[1]);break;case"background-size":t.backgroundSize=s;break;case"background-repeat":t.backgroundRepeat=s;break;case"background-position":const l=s.split(/\s+/).filter(c=>c.length>0);l.length>=1&&(t.backgroundPositionX=l[0]),l.length>=2&&(t.backgroundPositionY=l[1])}}return t}function jB(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function GB(e,t,n){const r={...e,cells:e.cells.map(o=>({...o,style:o.style?{...o.style}:void 0}))};for(const o of r.cells)t.includes(o.id)&&(o.style||(o.style={}),o.style.backgroundColor=n);return r}function XB(e,t,n){const r={...e,cells:e.cells.map(o=>({...o,classList:[...o.classList]}))};for(const o of r.cells)t.includes(o.id)&&(o.classList.includes(n)||o.classList.push(n));return r}function YB(e,t,n,r){const o={width:1,style:"solid",color:"#b9b1b1"},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style},a.style.borders&&(a.style.borders={...a.style.borders})),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={}),s.style.borders||(s.style.borders={});for(const a of n){const l=s.style.borders[a];l?s.style.borders[a]={...l,...r}:s.style.borders[a]={...o,...r}}}return i}function KB(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let f=0;f<d.rowspan;f++)for(let p=0;p<d.colspan;p++){const m=d.row+f,h=d.col+p,y=`${m}-${h}`;r.has(y)||(r.add(y),o.push({row:m,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const f=n.get(d);if(f.rowspan>1||f.colspan>1){const p=a?(m,h)=>m.col-h.col:(m,h)=>m.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],f=d.id,p=n.get(f);let m=f;if(p.rowspan>1||p.colspan>1){const y=l.get(f).findIndex(w=>w.row===d.row&&w.col===d.col);y>0&&(m=`${f}-uni-${y+1}`)}const h=[];a?(h.push("top","bottom"),(u===0||o[u-1].col!==d.col-1)&&h.push("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.push("right")):(h.push("left","right"),(u===0||o[u-1].row!==d.row-1)&&h.push("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.push("bottom")),c[m]=h}return c}function ZB(e,t,n,r){const o={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3},i={...e,cells:e.cells.map(s=>{const a={...s};return a.style&&(a.style={...a.style}),a})};for(const s of i.cells)if(t.includes(s.id)){s.style||(s.style={});let a=(s.style.borderRadius||"0px 0px 0px 0px").split(" ").map(l=>parseInt(l.replace("px",""),10));for(const l of n){const c=o[l];c!==void 0&&(a[c]=r)}a.every(l=>l===0)?delete s.style.borderRadius:s.style.borderRadius=a.map(l=>`${l}px`).join(" ")}return i}function QB(e,t){const n=new Map(e.cells.map(u=>[u.id,u])),r=new Set,o=[];for(const u of t){const d=n.get(u);if(d)for(let f=0;f<d.rowspan;f++)for(let p=0;p<d.colspan;p++){const m=d.row+f,h=d.col+p,y=`${m}-${h}`;r.has(y)||(r.add(y),o.push({row:m,col:h,id:u}))}}const i=new Set(o.map(u=>u.row)),s=new Set(o.map(u=>u.col));let a=!1;if(i.size===1&&s.size===o.length)a=!0;else if(!(s.size===1&&i.size===o.length))return{};a?o.sort((u,d)=>u.col-d.col):o.sort((u,d)=>u.row-d.row);const l=new Map;for(const u of o)l.has(u.id)||l.set(u.id,[]),l.get(u.id).push({row:u.row,col:u.col});l.forEach((u,d)=>{const f=n.get(d);if(f.rowspan>1||f.colspan>1){const p=a?(m,h)=>m.col-h.col:(m,h)=>m.row-h.row;u.sort(p)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],f=d.id,p=n.get(f);let m=f;if(p.rowspan>1||p.colspan>1){const w=l.get(f).findIndex(A=>A.row===d.row&&A.col===d.col);w>0&&(m=`${f}-uni-${w+1}`)}const h=new Set;a?(h.add("top"),h.add("bottom"),(u===0||o[u-1].col!==d.col-1)&&h.add("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&h.add("right")):(h.add("left"),h.add("right"),(u===0||o[u-1].row!==d.row-1)&&h.add("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&h.add("bottom"));const y=[];h.has("top")&&h.has("left")&&y.push("topLeft"),h.has("top")&&h.has("right")&&y.push("topRight"),h.has("bottom")&&h.has("left")&&y.push("bottomLeft"),h.has("bottom")&&h.has("right")&&y.push("bottomRight"),y.length>0&&(c[m]=y)}return c}function JB(e,t,n,r){const o={...e,cells:e.cells.map(i=>{const s={...i};return s.style&&(s.style={...s.style},s.style.padding&&(s.style.padding={...s.style.padding})),s})};for(const i of o.cells)if(t.includes(i.id)){i.style||(i.style={}),i.style.padding||(i.style.padding={top:0,right:0,bottom:0,left:0});for(const s of n){const a=s;i.style.padding[a]=r}["top","right","bottom","left"].forEach(s=>{i.style?.padding&&i.style.padding[s]===0&&delete i.style.padding[s]}),i.style.padding&&Object.keys(i.style.padding).length===0&&delete i.style.padding}return o}function e6(e,t){const n=new RegExp(`\\b${t}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(n,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function t6(e){const t=e.match(/border-radius:\s*([^;]+)/);if(!t)return{full:null,first:null,firstNumber:null};const n=t[1].trim(),r=n.split(/\s+/)[0],o=parseInt(r),i=n.split(/\s+/)[1],s=parseInt(i),a=n.split(/\s+/)[2],l=parseInt(a),c=n.split(/\s+/)[3];return{full:n,first:r,firstNumber:o,second:i,secondNumber:s,third:a,thirdNumber:l,fourth:c,fourthNumber:parseInt(c)}}function n6(e,t,n){const r=/border-radius:\s*([^;]+)/,o=e.match(r);if(!o)return e+` border-radius: ${iS("0 0 0 0",t,n)};`;const i=iS(o[1].trim(),t,n);return e.replace(r,`border-radius: ${i}`)}function iS(e,t,n){const r=typeof n=="number"&&!isNaN(n)?Math.max(0,n):0;let o=e.split(/\s+/).filter(a=>a.trim()!=="").map(a=>{const l=parseFloat(a);return isNaN(l)?0:Math.max(0,l)}),i;if(o.length===0)i=[0,0,0,0];else if(o.length===1)i=[o[0],o[0],o[0],o[0]];else if(o.length===2)i=[o[0],o[1],o[0],o[1]];else if(o.length===3)i=[o[0],o[1],o[2],o[1]];else{const a=o.slice(0,4);i=[a[0]??0,a[1]??0,a[2]??0,a[3]??0]}const s={topLeft:0,topRight:1,bottomRight:2,bottomLeft:3}[t];return s!==void 0&&(i[s]=r),i.map(a=>a===0?"0":`${a}px`).join(" ")}function r6(e){const t=JSON.parse(JSON.stringify(e)),n=t.rows,r=t.cols;return t.cells.forEach(o=>{const i=o.row===0,s=o.row+o.rowspan===n,a=o.col===0,l=o.col+o.colspan===r;i&&delete o.style.borders.top,s&&delete o.style.borders.bottom,a&&delete o.style.borders.left,l&&delete o.style.borders.right}),t}function o6(e){const t=JSON.parse(JSON.stringify(e));return t.cells.forEach(n=>{if(n.style?.borders?.top&&n.style?.borders?.bottom&&n.style?.borders?.left&&n.style?.borders?.right){const r=n.style.borders.top,o=n.style.borders.bottom,i=n.style.borders.left,s=n.style.borders.right;r?.width===o?.width&&r?.width===i?.width&&r?.width===s?.width&&r?.style===o?.style&&r?.style===i?.style&&r?.style===s?.style&&r?.color===o?.color&&r?.color===i?.color&&r?.color===s?.color&&(n.style.borders={border:{width:r.width,style:r.style,color:r.color}})}}),t}function i6(e,t){return typeof e!="string"&&(e=String(e||"")),typeof t!="string"&&(t=String(t||"")),e.split(" ").filter(n=>n&&!n.startsWith(t)).join(" ").trim()}function s6(e){const t={},n={};return Object.keys(e).forEach(r=>{const o=r.indexOf("-uni-");if(o===-1){const i=r;t[i]=[...e[r]],n[i]=new Set(e[r])}else{const i=r.substring(0,o);n[i]||(n[i]=new Set),e[r].forEach(s=>{n[i].add(s)}),e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=[...e[i]],e[i].forEach(s=>n[i].add(s)))}}),Object.keys(n).forEach(r=>{const o=r;t[o]||(t[o]=[]),t[o]=Array.from(n[o])}),t}var oc="none",sS="b64_",a6=/^(\d+(?:_\d+)?)(px|perc)$/;function l6(e){if(e===oc)return oc;let t="";return new TextEncoder().encode(Al(e)).forEach(n=>{t+=String.fromCharCode(n)}),sS+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function c6(e){if(e===oc)return oc;if(!e.startsWith(sS))return e.replace(/em-doubledots/gi,":").replace(/em-dot/gi,".").replace(/em-slash/gi,"/");try{const t=atob(e.slice(4).replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return""}}function u6(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function aS(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function lS(e){const t=e.match(a6);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function d6(){return Hf()}function De(e,t){const n=d6();n&&n.insertAdjacentHTML("beforeend",`
|
|
87
|
+
${_8()}
|
|
88
|
+
.${e} { ${t} }
|
|
89
|
+
}
|
|
90
|
+
`)}function ve(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function cS(e){const t=e.settings.mobileWidth;if(t.value!=null){let n="";if(t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim)De(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`);else{const r=t.value!=="auto"?t.value:"none";De(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else ve(e.elem,t.classNamePrefix)}function f6(e){const t=e.settings.mobileContentWidth;if(t.value!=null){let n="";t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?De(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):De(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else ve(e.elem,t.classNamePrefix)}function ti(e){const t=e.settings.mobileHeight;if(t.value!=null){let n="";t.dim?n=t.classNamePrefix+t.value+(t.dim==="%"?"perc":"px"):n=t.classNamePrefix+t.value,ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?De(n,`height: ${t.value}${t.dim} !important;`):De(n,`height: ${t.value} !important;`)}else ve(e.elem,t.classNamePrefix)}function m6(e){const t=["all","top","right","bottom","left"],n={all:"em-mob-border_all-",top:"em-mob-border_top-",right:"em-mob-border_right-",bottom:"em-mob-border_bottom-",left:"em-mob-border_left-"},r=Object.values(n);e.elem.classList.forEach(i=>{r.some(s=>i.includes(s))&&e.elem.classList.remove(i)});const o=e.settings.mobileBorder;t.forEach(i=>{const s=o[i];if(s&&(parseInt(String(s.width))||s.style||s.color)){let a=(s.classNamePrefix||n[i])+(s.width!=null?s.width+"px":"")+(s.style?"_"+s.style:"")+(s.color?"_"+s.color.substring(1):"");e.elem.classList.add(a),$e();let l="";i==="all"?l=(s.width!=null?`border-width: ${s.width}px !important; `:"")+(s.style?`border-style: ${s.style} !important; `:"")+(s.color?`border-color: ${s.color} !important; `:""):l=(s.width!=null?`border-${i}-width: ${s.width}px !important; `:"")+(s.style?`border-${i}-style: ${s.style} !important; `:"")+(s.color?`border-${i}-color: ${s.color} !important; `:""),De(a,l)}})}function p6(e){const t=e.settings.mobileBorderRadius;if(!t)return;const n=["all","topLeft","topRight","bottomRight","bottomLeft"].find(s=>s in t);if(!n)return;const r=t.classNamePrefix||`em-mob-border_radius_${n}-`,o=t[n],i=typeof o=="object"&&o!==null&&"value"in o?o.value:o;if(n==="all"&&i==null){Array.from(e.elem.classList).forEach(s=>{s.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(s)});return}if(i!=null){const s=r+i;e.elem.classList.forEach(a=>{a.indexOf(r)>-1&&e.elem.classList.remove(a)}),n==="all"&&Array.from(e.elem.classList).forEach(a=>{a.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(a)}),e.elem.classList.add(s),$e(),De(s,`${{all:"border-radius",topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"}[n]||"border-radius"}: ${i}px !important;`),n!=="all"&&["em-mob-border_radius_topLeft","em-mob-border_radius_topRight","em-mob-border_radius_bottomLeft","em-mob-border_radius_bottomRight"].every(a=>Array.from(e.elem.classList).some(l=>l.startsWith(a)))&&ve(e.elem,"em-mob-border_radius_all-")}else e.elem.classList.forEach(s=>{s.indexOf(r)>-1&&e.elem.classList.remove(s)})}function h6(e){const t=e.settings.mobileBoxShadow,n=t.classNamePrefix||"em-mob-box_shadow-";if(t.hOffset!=null||t.vOffset!=null||t.blurRadius!=null||t.spreadRadius!=null){const r=t.hOffset!=null?`${t.hOffset}px`:"0px",o=t.vOffset!=null?`${t.vOffset}px`:"0px",i=t.blurRadius!=null?`${t.blurRadius}px`:"0px",s=t.spreadRadius!=null?`${t.spreadRadius}px`:"0px",a=t.color||"#000000",l=t.inset?" inset":"",c=n+(t.hOffset!=null?t.hOffset+"px":"0px")+"_"+(t.vOffset!=null?t.vOffset+"px":"0px")+"_"+(t.blurRadius!=null?t.blurRadius+"px":"0px")+"_"+(t.spreadRadius!=null?t.spreadRadius+"px":"0px")+"_"+(t.color?t.color.substring(1):"000000")+(t.inset?"_inset":"");ve(e.elem,n),e.elem.classList.add(c),$e(),De(c,`box-shadow:${l} ${r} ${o} ${i} ${s} ${a} !important;`)}else if(t.value){const r=(t.classNamePrefix||"em-mob-boxshadow_")+t.value.replace(/\s/g,"_").replace(/\(/g,"").replace(/\)/g,"").replace(/,/g,"-");ve(e.elem,t.classNamePrefix||"em-mob-boxshadow_"),e.elem.classList.add(r),$e(),De(r,`box-shadow: ${t.value} !important;`)}else ve(e.elem,n)}function uS(e){const t=e.fieldName??"mobileAlign",n=e.settings[t];if(n.value){const r=n.classNamePrefix+n.value;ve(e.elem,n.classNamePrefix),e.elem.classList.add(r),$e(),De(r,`text-align: ${n.value} !important;`)}else ve(e.elem,n.classNamePrefix)}function g6(e){const t=e.settings.mobileAlign;if(t.value){const n=t.classNamePrefix+t.value;ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e();let r="";t.value==="left"||t.value==="right"?r=`float: ${t.value}`:r="margin: 0 auto",De(n,`${r} !important;`)}else ve(e.elem,t.classNamePrefix)}function dS(e){const t=e.settings.mobileVerticalAlign;if(t.value){const n=t.classNamePrefix+t.value;ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`vertical-align: ${t.value} !important;`)}else ve(e.elem,t.classNamePrefix)}function b6(e){const t=e.settings.mobileDirection;if(t.value){const n=t.classNamePrefix+t.value;ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`direction: ${t.value} !important;`)}else ve(e.elem,t.classNamePrefix)}function y6(e){const t=e.settings.mobileBackgroundColor;if(t.value){const n=t.value!=="none"?String(t.value).substring(1):"none",r=t.classNamePrefix+n;ve(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),De(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else ve(e.elem,t.classNamePrefix)}function v6(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+l6(n);ve(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),De(r,`background-image: ${n!=="none"?u6(Al(n)):"none"} !important;`)}else ve(e.elem,t.classNamePrefix)}function E6(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+aS(String(t.value));ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`background-position-x: ${t.value} !important;`)}else ve(e.elem,t.classNamePrefix)}function S6(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+aS(String(t.value));ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`background-position-y: ${t.value} !important;`)}else ve(e.elem,t.classNamePrefix)}function w6(e){const t=e.settings.mobileBackgroundRepeat;if(t.value&&t.value!=="none"){const n=t.classNamePrefix+t.value;ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`background-repeat: ${t.value} !important;`)}else ve(e.elem,t.classNamePrefix)}function C6(e){const t=e.settings.mobileBackgroundSize;if(t.value){const n=t.classNamePrefix+t.value;ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`background-size: ${t.value} !important;`)}else ve(e.elem,t.classNamePrefix)}function xs(e){const t=e.settings.mobilePadding;$e(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){y1({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),De(o,`padding-${n}: ${r}px !important;`)}else r===null&&y1({elem:e.elem,position:n})})}function fS(e){const t=e.settings.mobileFontSize;if(t.value!=null){const n=t.classNamePrefix+t.value+"px";ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`font-size: ${t.value}px !important;`)}else ve(e.elem,t.classNamePrefix)}function mS(e){const t=e.settings.mobileLineHeight;if(t&&t.value!==null){const n=t.classNamePrefix+t.value+"px";ve(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),De(n,`line-height: ${t.value}px !important;`)}else t&&ve(e.elem,t.classNamePrefix)}function pS(e){const t=e.settings.show,n=()=>{e.elem.style.removeProperty("display"),e.elem.tagName==="IMG"&&(e.elem.style.display="block"),e.elem.previousSibling&&e.elem.previousSibling.textContent?.indexOf("mso")!==-1&&e.elem.previousSibling.remove(),e.elem.nextSibling&&e.elem.nextSibling.textContent?.indexOf("endif")!==-1&&e.elem.nextSibling.remove()};if(t!=="all"){const r="em-show-"+e.elem.tagName?.toLowerCase()+"-"+t;if(e.elem.classList.forEach(o=>{o.indexOf("em-show-")>-1&&e.elem.classList.remove(o)}),e.elem.classList.add(r),$e(),t==="mobile"){e.elem.style.display="none",(!e.elem.previousSibling||e.elem.previousSibling.textContent?.indexOf("mso")===-1)&&(e.elem.insertAdjacentHTML("beforebegin","<!--[if !mso]><!-->"),e.elem.insertAdjacentHTML("afterend","<!--<![endif]-->"));let o="block";e.elem.tagName==="TD"?o="table-cell":e.elem.tagName==="IMG"?o="block":e.elem.tagName==="TABLE"&&(o="table"),De(r,`display: ${o} !important;`)}t==="desktop"&&(n(),De(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function A6(e){const t=e.settings.isContrastBlock,n=Mf();if(t){e.elem.closest('[em="block"]')?.classList.add("em-contrast-block");const r=n.block?.contrastBackgroundColor||"#1C52DC";e.elem.setAttribute("bgcolor",r),e.elem.style.backgroundColor=r;const o=e.elem.querySelectorAll('div[style*="font-family"]');o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(s.style.color=n.text?.contrastColor||"#FFFFFF")}),o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)>20&&(s.style.color=n.headings?.contrastColor||"#FFFFFF")}),e.elem.querySelectorAll('a[style*="color"]').forEach(i=>{const s=i;s.style.display||(s.style.color=n.links?.contrastColor||"#FFFFFF")}),e.elem.querySelectorAll('a[style*="font-family"]').forEach(i=>{const s=i;if(s.style.display&&s.style.display==="block"){s.style.color=n.buttons?.contrastColor||"#1C52DC";const a=s.closest("td");if(a){const l=n.buttons?.contrastBackgroundColor||"#FFFFFF";a.setAttribute("bgcolor",l),a.style.backgroundColor=l}}})}else{e.elem.closest('[em="block"]')?.classList.remove("em-contrast-block");const r=n.block?.backgroundColor||"#FFFFFF";e.elem.setAttribute("bgcolor",r),e.elem.style.backgroundColor=r;const o=e.elem.querySelectorAll('div[style*="font-family"]');o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)<=20&&(s.style.color=n.text?.color||"")}),o.forEach(i=>{const s=i;!s.style.display&&parseFloat(s.style.fontSize)>20&&(s.style.color=n.headings?.color||"")}),e.elem.querySelectorAll('a[style*="color"]').forEach(i=>{const s=i;s.style.display||(s.style.color=n.links?.color||"")}),e.elem.querySelectorAll('a[style*="font-family"]').forEach(i=>{const s=i;if(s.style.display&&s.style.display==="block"){s.style.color=n.buttons?.color||"";const a=s.closest("td");if(a){const l=n.buttons?.backgroundColor||"";a.setAttribute("bgcolor",l),a.style.backgroundColor=l}}})}}function T6(){return{mobileWidth:null,mobileWidthDim:"px",mobileHeight:null,mobileHeightDim:"px",mobileBorder:{all:{width:null,style:null,color:null},top:{width:null,style:null,color:null},right:{width:null,style:null,color:null},bottom:{width:null,style:null,color:null},left:{width:null,style:null,color:null}},mobileBorderRadius:{all:null,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},mobileBoxShadow:{hOffset:null,vOffset:null,blurRadius:null,spreadRadius:null,color:null,inset:null},mobileAlign:{value:""},mobileTextAlign:{value:""},mobileVerticalAlign:{value:""},mobileDirection:{value:""},mobileBackgroundColor:{value:""},mobileBackgroundImage:[{type:"url",value:""}],mobileBackgroundPositionX:{value:""},mobileBackgroundPositionY:{value:""},mobileBackgroundRepeat:{value:"none"},mobileBackgroundSize:{value:""},mobilePadding:{all:null,bottom:null,left:null,right:null,top:null},show:"all",mobileFontSize:null,mobileFontSizeDim:"px"}}function We(e,t=!1){const n=T6();return e.elem?.classList?.forEach(r=>{if(r.indexOf("em-mob-width-")>-1&&(r.substring(r.length-2)==="px"?(n.mobileWidthDim="px",n.mobileWidth=parseFloat(r.substring(13,r.length-2))):r.substring(r.length-4)==="perc"?(n.mobileWidthDim="%",n.mobileWidth=parseFloat(r.substring(13,r.length-4))):r.substring(r.length-4)==="auto"&&(n.mobileWidthDim="px",n.mobileWidth="auto")),r.indexOf("em-mob-height-")>-1&&(r.substring(r.length-2)==="px"?(n.mobileHeightDim="px",n.mobileHeight=parseFloat(r.substring(14,r.length-2))):r.substring(r.length-4)==="perc"?(n.mobileHeightDim="%",n.mobileHeight=parseFloat(r.substring(14,r.length-4))):r.substring(r.length-4)==="auto"&&(n.mobileHeightDim="px",n.mobileHeight="auto")),r.indexOf("em-mob-border")>-1){if(r.substring(14,17)==="all"){const o=r.substring(18).split("_");n.mobileBorder.all.width=parseFloat(o[0]),n.mobileBorder.all.style=o[1],n.mobileBorder.all.color=o[2]?"#"+o[2]:""}if(r.substring(14,17)==="top"){const o=r.substring(18).split("_");n.mobileBorder.top.width=parseFloat(o[0]),n.mobileBorder.top.style=o[1],n.mobileBorder.top.color=o[2]?"#"+o[2]:""}if(r.substring(14,19)==="right"){const o=r.substring(20).split("_");n.mobileBorder.right.width=parseFloat(o[0]),n.mobileBorder.right.style=o[1],n.mobileBorder.right.color=o[2]?"#"+o[2]:""}if(r.substring(14,20)==="bottom"){const o=r.substring(21).split("_");n.mobileBorder.bottom.width=parseFloat(o[0]),n.mobileBorder.bottom.style=o[1],n.mobileBorder.bottom.color=o[2]?"#"+o[2]:""}if(r.substring(14,18)==="left"){const o=r.substring(19).split("_");n.mobileBorder.left.width=parseFloat(o[0]),n.mobileBorder.left.style=o[1],n.mobileBorder.left.color=o[2]?"#"+o[2]:""}}if(r.indexOf("em-mob-border_radius")>-1&&(r.substring(21,28)==="topLeft"&&(n.mobileBorderRadius.topLeft=parseFloat(r.substring(29))),r.substring(21,29)==="topRight"&&(n.mobileBorderRadius.topRight=parseFloat(r.substring(30))),r.substring(21,32)==="bottomRight"&&(n.mobileBorderRadius.bottomRight=parseFloat(r.substring(33))),r.substring(21,31)==="bottomLeft"&&(n.mobileBorderRadius.bottomLeft=parseFloat(r.substring(32))),r.substring(21,24)==="all"&&(n.mobileBorderRadius.all=parseFloat(r.substring(25)))),r.indexOf("em-mob-box_shadow")>-1){const o=r.substring(18).split("_");n.mobileBoxShadow.hOffset=parseFloat(o[0]),n.mobileBoxShadow.vOffset=parseFloat(o[1]),n.mobileBoxShadow.blurRadius=parseFloat(o[2]),n.mobileBoxShadow.spreadRadius=parseFloat(o[3]),n.mobileBoxShadow.color=o[4]?"#"+o[4]:"",n.mobileBoxShadow.inset=!!o[5]}r.indexOf("em-mob-text_align")>-1&&(n.mobileAlign.value=r.substring(18)),r.indexOf("em-mob-table_align")>-1&&(n.mobileAlign.value=r.substring(19)),r.indexOf("em-mob-vertical_align")>-1&&(n.mobileVerticalAlign.value=r.substring(22)),r.indexOf("em-mob-direction")>-1&&(n.mobileDirection.value=r.substring(17)),r.indexOf("em-mob-background_color")>-1&&(n.mobileBackgroundColor.value=r.substring(24)!=="none"?"#"+r.substring(24):"none"),r.indexOf("em-mob-background_image")>-1&&(n.mobileBackgroundImage[0].value=c6(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=lS(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=lS(r.substring(29))),r.indexOf("em-mob-background_repeat")>-1&&(n.mobileBackgroundRepeat.value=r.substring(25)),r.indexOf("em-mob-background_size")>-1&&(n.mobileBackgroundSize.value=r.substring(23)),r.indexOf("em-mob-padding")>-1&&(r.substring(15,18)==="all"&&(n.mobilePadding.all=parseFloat(r.substring(19))),r.substring(15,18)==="top"&&(n.mobilePadding.top=parseFloat(r.substring(19))),r.substring(15,20)==="right"&&(n.mobilePadding.right=parseFloat(r.substring(21))),r.substring(15,21)==="bottom"&&(n.mobilePadding.bottom=parseFloat(r.substring(22))),r.substring(15,19)==="left"&&(n.mobilePadding.left=parseFloat(r.substring(20)))),r.indexOf("em-show")>-1&&(r.substring(r.length-6)==="mobile"?n.show="mobile":r.substring(r.length-7)==="desktop"&&(n.show="desktop")),t&&(r==="em-amp-show-only"?n.ampShow="amp":r==="em-amp-show-disabled"&&(n.ampShow="html")),r.indexOf("em-mob-font_size")>-1&&(n.mobileFontSizeDim="px",n.mobileFontSize=r.substring(17,r.length-2)),r.indexOf("em-mob-line_height")>-1&&(n.mobileLineHeight=r.substring(19,r.length-2))}),n}function _6(e){const t={all:null,top:null,right:null,bottom:null,left:null},n={all:null,top:null,right:null,bottom:null,left:null},r=We({elem:e}),o=r.mobileWidth,i=r.mobileHeight;(e.style.padding||e.style.paddingTop||e.style.paddingRight||e.style.paddingBottom||e.style.paddingLeft)&&(!e.style.padding||e.style.padding.indexOf(" ")>-1?t.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?t.all=parseFloat(e.style.paddingTop):t.all=parseFloat(e.style.padding),t.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,t.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,t.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,t.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),(r.mobilePadding.all!==null||r.mobilePadding.top!==null||r.mobilePadding.right!==null||r.mobilePadding.bottom!==null||r.mobilePadding.left!==null)&&(r.mobilePadding.all?!r.mobilePadding.all&&r.mobilePadding.top&&r.mobilePadding.right&&r.mobilePadding.bottom&&r.mobilePadding.left&&r.mobilePadding.top===r.mobilePadding.right&&r.mobilePadding.right===r.mobilePadding.bottom&&r.mobilePadding.bottom===r.mobilePadding.left?n.all=parseFloat(String(r.mobilePadding.top)):n.all=r.mobilePadding.all!==null?parseFloat(String(r.mobilePadding.all)):null:n.all=null,n.top=r.mobilePadding.top!==null?parseFloat(String(r.mobilePadding.top)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.right=r.mobilePadding.right!==null?parseFloat(String(r.mobilePadding.right)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.bottom=r.mobilePadding.bottom!==null?parseFloat(String(r.mobilePadding.bottom)):r.mobilePadding.all===null?null:r.mobilePadding.all,n.left=r.mobilePadding.left!==null?parseFloat(String(r.mobilePadding.left)):r.mobilePadding.all===null?null:r.mobilePadding.all);let s=e.getAttribute("align")??"";e.parentElement?.getAttribute("em")!=="group"&&e.querySelector('[em="atom"]')&&e.querySelectorAll('[em="atom"] > tr > td').forEach(c=>{c.getAttribute("align")!==s&&(s="")});const a={padding:t,borderRadius:Es(e),backgroundColor:e.style.backgroundColor?V(e.style.backgroundColor):e.getAttribute("bgcolor")||"",backgroundImage:[{type:"url",value:""}],backgroundPositionX:e.style.backgroundPositionX&&e.style.backgroundPositionX!=="initial"?e.style.backgroundPositionX:"",backgroundPositionY:e.style.backgroundPositionY&&e.style.backgroundPositionY!=="initial"?e.style.backgroundPositionY:"",backgroundRepeat:e.style.backgroundRepeat||"repeat",backgroundSize:e.style.backgroundSize||"auto",height:{value:e.getAttribute("height")&&e.getAttribute("height")!=="auto"?parseFloat(e.getAttribute("height")):null,dim:e.getAttribute("height")&&e.getAttribute("height")!=="auto"&&e.getAttribute("height").indexOf("%")>-1?"%":"px"},align:s,valign:e.getAttribute("valign")??"",border:Kl(e),boxShadow:Ss(e),mobileWidth:{value:o!==null?o:null,dim:r.mobileWidthDim},mobileHeight:{value:i!==null?i:null,dim:r.mobileHeightDim},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,mobileAlign:r.mobileAlign,mobileVerticalAlign:r.mobileVerticalAlign,mobileDirection:r.mobileDirection,mobileBackgroundColor:r.mobileBackgroundColor,mobileBackgroundImage:r.mobileBackgroundImage,mobileBackgroundPositionX:r.mobileBackgroundPositionX,mobileBackgroundPositionY:r.mobileBackgroundPositionY,mobileBackgroundRepeat:r.mobileBackgroundRepeat,mobileBackgroundSize:r.mobileBackgroundSize,mobilePadding:n,show:r.show,exportAsPicture:e.getAttribute("em-operation")==="exportAsPicture",outlookBackground:As(e,"inside")},l=e.closest("table");if(l&&l.getAttribute("em")==="atom"){const c=l.getAttribute("width");a.width={value:c&&c!=="auto"?parseFloat(c):null,dim:c&&c!=="auto"&&c.indexOf("%")>-1?"%":"px"}}else{const c=e.getAttribute("width");a.width={value:c&&c!=="auto"?parseFloat(c):null,dim:c&&c!=="auto"&&c.indexOf("%")>-1?"%":"px"}}if(e.style.backgroundImage){const c=e.style.backgroundImage;a.backgroundImage=[{type:"url",value:c?c.substring(5,c.length-2):""}]}else e.getAttribute("background")&&(a.backgroundImage=[{type:"url",value:e.getAttribute("background")||""}]);return a}function k6(e){let t=[],n=null,r=null,o="",i,s=!1;if(e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap")){const a=e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap");if(i=!0,a.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1)a.parentElement.querySelectorAll(":scope > .em-mob-wrap:nth-child(odd), :scope > .noresp-em-mob-wrap:nth-child(odd)").forEach(l=>{t.push({width:parseFloat(l.getAttribute("width")||"0"),current:l===a});const c=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");c?.nextElementSibling&&(n=parseFloat(c.nextElementSibling.getAttribute("width")||"0"),r=We({elem:c.nextElementSibling}).mobileHeight||0),(l.classList.contains("em-mob-wrap-cancel")||l.classList.contains("noresp-em-mob-wrap-cancel"))&&(i=!1)});else{const l=a.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");t=[{width:parseFloat(l?.getAttribute("width")||"0"),current:!0}],n=0}o=a.parentElement.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.getAttribute("valign")||"",(e.elem.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap").parentElement.closest("td"))?.getAttribute("dir")==="rtl"&&(s=!0)}else{const a=e.elem.closest('div[style*="inline-block"]');if(a&&a.parentElement.querySelectorAll('div[style*="inline-block"]').length>1)a.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(l=>{const c=l;if(!c.style.fontFamily){const u=l.firstElementChild;t.push({width:parseFloat(u?.getAttribute("width")||"0"),current:l===a});const d=u?.getAttribute("width"),f=parseFloat(c.style.width);n=f-(!d||d.indexOf("%")>-1?f:parseFloat(d))}});else{const l=a?.parentElement?.querySelector('div[style*="inline-block"]');t=[{width:parseFloat(l?.firstElementChild?.getAttribute("width")||"0"),current:!0}],n=0}o=a?.parentElement?.querySelector('div[style*="inline-block"]')?.style.verticalAlign||"",(e.elem.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.elem.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(s=!0)}return{items:t,gap:n,gapMobile:r,valign:o,wrap:i,dirRevers:s}}var L6='table[em-type="social"]';function N6(e){return e.closest(L6)}function x6(e,t){return t.contains(e)?!!(e.tagName==="IMG"||e.tagName==="TD"&&(e.hasAttribute("em-platform")||e.hasAttribute("data-em-platform"))||e.tagName==="A"&&e.querySelector(":scope > img")):!1}function ic(e){const t=N6(e);if(t&&e!==t&&x6(e,t))return t;const n=e.parentNode;if(!n)return!1;const r=n.tagName,o=n.style,i=n.parentNode;return r==="TD"||r==="TABLE"&&i?.style.display!=="inline-block"&&!e.closest(".em-narrow-table")&&n.getAttribute("em")!=="atom"||r==="DIV"&&(o.display==="inline-block"||o.display==="table-cell")&&o.verticalAlign||(r==="DIV"||r==="TABLE")&&O6(o)?n:ic(n)}function O6(e){return!!(e.width||e.minWidth||e.maxWidth||e.height||e.background||e.backgroundColor||e.backgroundPositionX||e.backgroundPositionY||e.backgroundImage||e.backgroundRepeat||e.backgroundSize||e.padding||e.paddingTop||e.paddingRight||e.paddingBottom||e.paddingLeft||e.border||e.borderBottom||e.borderBottomWidth||e.borderBottomStyle||e.borderBottomColor||e.borderLeft||e.borderLeftWidth||e.borderLeftStyle||e.borderLeftColor||e.borderTop||e.borderTopWidth||e.borderTopStyle||e.borderTopColor||e.borderRight||e.borderRightWidth||e.borderRightStyle||e.borderRightColor||e.borderRadius||e.borderTopLeftRadius||e.borderTopRightRadius||e.borderBottomLeftRadius||e.borderBottomRightRadius||e.boxShadow||e.textAlign||e.align||e.verticalAlign)}function Os(){return Tt.getInstance(iu)?.localized??{}}var hS=[];function R6(){return hS}function gS(e){const t=Os();let n="",r="";switch(e.tagName){case"A":e.style.display==="block"?(n=t.ELEMENT_PATH_BUTTON,r="em-element-path-item-button"):(n=t.ELEMENT_PATH_LINK,r="em-element-path-item-link");break;case"IMG":e.closest('table[em-type="social"]')?n=t.ELEMENT_PATH_SOCIAL:n=t.ELEMENT_PATH_IMG,r="em-element-path-item-image";break;case"TD":e.parentElement?.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.parentElement?.getAttribute("em")==="atom"||e.closest("table")?.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.parentElement?.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.classList.contains("em-vindent")?(n=t.ELEMENT_PATH_VINDENT,r="em-element-path-item-vindent"):e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap")?(n=t.ELEMENT_PATH_FLOATBLOCK,r="em-element-path-item-column"):(n=t.ELEMENT_PATH_TD,r="em-element-path-item-block");break;case"TABLE":e.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.getAttribute("em")==="atom"&&e.getAttribute("em-type")==="social"?(n=t.ELEMENT_PATH_SOCIAL,r="em-element-path-item-atom"):e.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.parentElement?.tagName==="BODY"?(n=t.ELEMENT_PATH_EMAIL,r="em-element-path-item-email"):(n=t.ELEMENT_PATH_TABLE,r="em-element-path-item-table");break;case"SPAN":case"B":case"I":case"EM":case"STRONG":case"P":case"H1":case"H2":case"H3":case"H4":case"H5":case"DIV":case"STRIKE":case"S":case"U":e.style.display==="inline-block"?(n=t.ELEMENT_PATH_FLOATBLOCK,r="em-element-path-item-column"):e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight&&e.style.color?(n=t.ELEMENT_PATH_TEXT,r="em-element-path-item-text"):e.getAttribute("em")==="block"?(n=t.ELEMENT_PATH_BLOCK,r="em-element-path-item-block"):e.getAttribute("em")==="atom"?(n=t.ELEMENT_PATH_ATOM,r="em-element-path-item-atom"):e.getAttribute("em")==="group"?(n=t.ELEMENT_PATH_GROUP,r="em-element-path-item-group"):e.classList.contains("em-vindent")?(n=t.ELEMENT_PATH_VINDENT,r="em-element-path-item-vindent"):(n=t.ELEMENT_PATH_DIV,r="em-element-path-item-block")}const o=Qk(e,t);return o?.title&&(n=o.title),o?.className&&(r=o.className),e.className&&e.className.indexOf&&e.className.indexOf("em-mob-")>-1&&(r+=" em-element-path-item-mob"),{elem:e,title:n,className:r}}var M6=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function P6(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function I6(e){if(e.tagName!=="TD")return!1;const t=Array.from(e.getElementsByTagName("a")),n=t[0];if(t.length!==1||n.style.display!=="block")return!1;for(let r=n.parentElement;r&&r!==e;r=r.parentElement)if(M6.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||P6(r))}var bS='.em-narrow-table, [em="block-contaner"]';function D6(e){const t=e.style;return I6(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(bS)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(bS)&&e.getAttribute("em")!=="atom"&&e.parentElement?.tagName!=="BODY"||e.tagName==="DIV"&&(t.display==="inline-block"||t.display==="table-cell")&&t.verticalAlign||(e.tagName==="DIV"||e.tagName==="TABLE"||e.tagName==="TD")&&!e.classList.contains("em-narrow-table")&&!e.classList.contains("noresp-em-narrow-table")&&(t.width||t.minWidth||t.maxWidth||t.background||t.backgroundColor||t.backgroundPositionX||t.backgroundPositionY||t.backgroundImage||t.backgroundRepeat||t.backgroundSize||t.height||t.padding||t.paddingTop||t.paddingRight||t.paddingBottom||t.paddingLeft||t.border||t.borderBottom||t.borderBottomWidth||t.borderBottomStyle||t.borderBottomColor||t.borderLeft||t.borderLeftWidth||t.borderLeftStyle||t.borderLeftColor||t.borderTop||t.borderTopWidth||t.borderTopStyle||t.borderTopColor||t.borderRight||t.borderRightWidth||t.borderRightStyle||t.borderRightColor||t.borderRadius||t.borderTopLeftRadius||t.borderTopRightRadius||t.borderBottomLeftRadius||t.borderBottomRightRadius||t.boxShadow||t.textAlign||t.align||t.verticalAlign)||e.tagName!=="EDITOR"&&t.fontFamily&&t.fontSize&&t.lineHeight&&t.color||e.tagName==="TD"&&e.closest("table")?.getAttribute("em")==="atom"||e.tagName==="TD"&&e.closest("tr")?.getAttribute("em")==="block"||e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))||Tg(e))}function B6(e){let t=[];const n=e.style;(e.tagName==="IMG"||e.tagName==="TD"||e.tagName==="TABLE"||e.tagName!=="EDITOR"&&n.fontFamily&&n.fontSize&&n.lineHeight&&n.color||e.tagName==="DIV"&&n.height&&n.lineHeight||Tg(e))&&t.push(gS(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,D6(r)&&t.push(gS(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),hS=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function yS(e){const t=Os(),n=e.parentNode;if(!n)return;if(n.tagName==="A")return t.LINK;if(n.tagName==="TD")return t.TABLE_COLUMN;const r=n.parentNode;if(n.tagName==="TABLE"&&!(r?.tagName==="DIV"&&r.style.display==="inline-block"))return t.TABLE;if(n.tagName==="DIV"&&(n.style.display==="inline-block"||n.style.display==="table-cell")&&n.style.verticalAlign)return t.FLOAT_BLOCK;if(n.tagName==="DIV"){const o=n.style;if(o.width||o.minWidth||o.maxWidth||o.background||o.backgroundColor||o.backgroundPositionX||o.backgroundPositionY||o.backgroundImage||o.backgroundRepeat||o.backgroundSize||o.height||o.padding||o.paddingTop||o.paddingRight||o.paddingBottom||o.paddingLeft||o.border||o.borderBottom||o.borderBottomWidth||o.borderBottomStyle||o.borderBottomColor||o.borderLeft||o.borderLeftWidth||o.borderLeftStyle||o.borderLeftColor||o.borderTop||o.borderTopWidth||o.borderTopStyle||o.borderTopColor||o.borderRight||o.borderRightWidth||o.borderRightStyle||o.borderRightColor||o.borderRadius||o.borderTopLeftRadius||o.borderTopRightRadius||o.borderBottomLeftRadius||o.borderBottomRightRadius||o.boxShadow||o.textAlign||o.align||o.verticalAlign)return t.CONTAINER}return yS(n)}function H6(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-accordion");r.setAttribute("em-edit","active");const o=n.HTMLDocument.getOuterHtml(r),i=n.parseFromString(o)[0].querySelectorAll("section"),s=Array.from(i).map(a=>({expanded:a.hasAttribute("expanded")}));return{type:"accordion",caption:t.ACCORDION,animate:r.hasAttribute("animate"),expandSingleSection:r.hasAttribute("expand-single-section"),sections:s}}function F6(e){return e.tagName==="AMP-ACCORDION"}var vS="em-mob-text_align-",$6=":scope > tr > td, :scope > tbody > tr > td",W6='div[style*="font-family"][style*="font-size"]';function fm(e){return e.querySelector($6)}function mm(e){return e.querySelector(W6)}function q6(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function ES(e){const t=e.closest('table[em="atom"]');if(!t||q6(e,t))return null;const n=fm(t);return n?{atomTd:n,textDiv:mm(n)}:null}function Rs(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=ES(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function SS(e){const t=Rs(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function z6(e){const t=Rs(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function pm(e){return{value:z6(e)}}function U6(e,t,n=vS){const r=ES(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&Xl(o,n)}function V6(e){const t=fm(e);if(!t)return null;const n=mm(t);return n?.hasAttribute("align")?n:t}function j6(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=V6(n);r&&t(r,n)})}function G6(e,t,n=vS){const r=fm(e),o=r?mm(r):null;for(const i of[r,o])i&&i!==t&&Xl(i,n)}function sc(e){if(!e)return null;const t=(e.closest('[style*="line-height"]')||e.querySelector('[style*="line-height"]'))?.style.lineHeight?.trim();if(!t||t.toLowerCase()==="normal")return null;if(t.includes("px")){const i=parseFloat(t);return Number.isFinite(i)?i:null}const n=e.closest('[style*="font-size"]')?.style.fontSize||getComputedStyle(e).fontSize,r=parseFloat(n);if(!Number.isFinite(r)||r<=0)return null;if(t.includes("%")){const i=parseFloat(t);return Number.isFinite(i)?r*(i/100):null}const o=parseFloat(t);return Number.isFinite(o)?r*o:null}function Ms(e){if(!e)return[];const t=[],n=e.style.fontFamily||getComputedStyle(e).fontFamily,r=[...(e.closest('[style*="font-family"]')||e).classList].filter(s=>s.startsWith("em-font-")),o=r.includes(Wf),i=r.filter(s=>s!==Wf);if(i.length>0){t.push("Google Fonts"),t.push(o?"Project Fonts":n.includes("sans-serif")?"Sans Serif":"Serif");const s=i[0].slice(8),a=s.lastIndexOf("-");a>0?t.push(s.slice(0,a),s.slice(a+1)):s&&t.push(s)}else n&&t.push("Safe Fonts",n.replaceAll('"',"'"));return t}function Qe(e,t,n){if(!e||e.tagName==="DIV")return!1;const r=window.getSelection();let o=null;if(r&&r.rangeCount>0){const a=r.getRangeAt(0).commonAncestorContainer;o=a.nodeType===1?a:a.parentElement}const i=a=>{if(!a)return!1;const l=a.tagName.toLowerCase();return l===t||l===n},s=e.closest(t)||(n?e.closest(n):null);return i(e)||!!o&&i(o)||!!s}function ac(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function Tr(e,t="background-color"){if(!e)return"";let n=e;for(;n;){const r=n.style.getPropertyValue(t);if(r&&r!=="transparent"&&r!=="inherit")return r;n=n.parentElement}return""}function X6(){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0).commonAncestorContainer;return t.nodeType===1?t:t.parentElement}function Ps(e){return!!e.closest(".em-show-td-mobile")||!!e.closest(".em-show-table-mobile")||!!e.closest(".em-show-div-mobile")||e.classList.contains("em-show-img-mobile")||!!e.closest(".desktop_hide")}function wS(){const e=window.getSelection();if(!e||e.rangeCount===0)return!1;let t=e.anchorNode,n=e.focusNode;t?.nodeType===3&&(t=t.parentNode),n?.nodeType===3&&(n=n.parentNode);const r=t?.closest?.("a"),o=n?.closest?.("a");return!!(r?.getAttribute("href")||o?.getAttribute("href"))}function hm(e){if(!e)return!1;for(const t of Array.from(e.childNodes))if(t.nodeType===Node.COMMENT_NODE&&t.nodeValue?.includes("[if mso]")&&t.nodeValue.includes("v:roundrect")||t.nodeType===Node.ELEMENT_NODE&&hm(t))return!0;return!1}function CS(e,t){if(!e)return{value:null,dim:"px"};const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function AS(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function Y6(e){const t={all:null,top:null,right:null,bottom:null,left:null};return!e.style.padding&&!e.style.paddingTop&&!e.style.paddingRight&&!e.style.paddingBottom&&!e.style.paddingLeft||(!e.style.padding||e.style.padding.includes(" ")?t.all=null:!e.style.padding&&e.style.paddingTop&&e.style.paddingRight&&e.style.paddingBottom&&e.style.paddingLeft&&e.style.paddingTop===e.style.paddingRight&&e.style.paddingRight===e.style.paddingBottom&&e.style.paddingBottom===e.style.paddingLeft?t.all=parseFloat(e.style.paddingTop):t.all=parseFloat(e.style.padding)||null,t.top=e.style.paddingTop?parseFloat(e.style.paddingTop):null,t.right=e.style.paddingRight?parseFloat(e.style.paddingRight):null,t.bottom=e.style.paddingBottom?parseFloat(e.style.paddingBottom):null,t.left=e.style.paddingLeft?parseFloat(e.style.paddingLeft):null),t}function K6(e){const t={all:null,top:null,right:null,bottom:null,left:null};if(!e.all&&!e.top&&!e.right&&!e.bottom&&!e.left)return t;e.all?!e.all&&e.top&&e.right&&e.bottom&&e.left&&e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?t.all=parseFloat(e.top):t.all=parseFloat(e.all)||null:t.all=null;const n=e.all||null;return t.top=e.top!=null?parseFloat(e.top):n,t.right=e.right!=null?parseFloat(e.right):n,t.bottom=e.bottom!=null?parseFloat(e.bottom):n,t.left=e.left!=null?parseFloat(e.left):n,t}function Z6(e){if(e.style.backgroundImage){const t=e.style.backgroundImage;return[{type:"url",value:t.substring(5,t.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function Q6(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=Zf(n),i=hm(r)&&!hm(n)||!!o,s=o??(i?n:r),a=e.elem.closest("table"),l=a?.closest("td")?.closest("table")?.closest("td"),c=a?.closest("div, p, td"),u=c?.style.textAlign||c?.getAttribute("align")||"left",d=We({elem:e.elem}),f=We({elem:r}),p=l?We({elem:l}):null,m=We({elem:a}),h=e.elem.closest("a"),y={type:"button",caption:t.BUTTON,fontFamily:Ms(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:sc(e.elem),lineHeightDim:"px",textStrong:Qe(e.elem,"strong","b")||ac(e.elem),textItalic:Qe(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(h?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:Qe(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:Qe(e.elem,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("underline"),textColor:V(Tr(e.elem,"color"))||V(getComputedStyle(e.elem).color)||"",textBackgroundColor:V(Tr(e.elem,"background-color"))||"",padding:Y6(o??n),borderRadius:Es(s),backgroundColor:s.style.backgroundColor?V(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:Z6(r),backgroundPositionX:r.style.backgroundPositionX!=="initial"?r.style.backgroundPositionX:"",backgroundPositionY:r.style.backgroundPositionY!=="initial"?r.style.backgroundPositionY:"",backgroundRepeat:r.style.backgroundRepeat||"repeat",backgroundSize:r.style.backgroundSize||"auto",width:CS(a,"width"),height:CS(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:Kl(s),boxShadow:Ss(s),href:n.getAttribute("href")??"",outlookRounding:i,outlookBackground:As(r,"inside"),mobileWidth:{value:AS(m.mobileWidth),dim:m.mobileWidthDim??"px"},mobileHeight:{value:AS(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorder:f.mobileBorder,mobileBorderRadius:f.mobileBorderRadius,mobileBoxShadow:f.mobileBoxShadow,mobileAlign:m.mobileAlign,mobileFontSize:{value:d.mobileFontSize,dim:d.mobileFontSizeDim||"px"},mobileTextAlign:pm(e.elem),mobileVerticalAlign:p?.mobileVerticalAlign,mobileBackgroundColor:f.mobileBackgroundColor,mobileBackgroundImage:f.mobileBackgroundImage,mobileBackgroundPositionX:f.mobileBackgroundPositionX,mobileBackgroundPositionY:f.mobileBackgroundPositionY,mobileBackgroundRepeat:f.mobileBackgroundRepeat,mobileBackgroundSize:f.mobileBackgroundSize,mobilePadding:K6(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:m.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return Ps(e.elem)&&(y.showOnMobile=!0),y}function J6(e){if(Qf(e.closest("a")))return!0;const t=e.getAttribute("style");if(!t||!t.includes("display"))return!1;const n=e.style.display;return!(n!=="block"&&n!=="inline-block"||t.includes("mso-style-priority"))}function e7(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function t7(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(Qf(t))return!0;if(t&&n){const r=n.style.display;if(r==="block"||r==="inline-block")return!0}if(e.tagName==="A"){const r=e.getAttribute("style");if(r&&r.includes("display")&&e.closest("td[height]"))return!0}return!1}function TS(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function _S(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function kS(e){return{src:e.getAttribute("src")??"",width:TS(e,"width"),height:TS(e,"height"),alt:e.getAttribute("alt")??"",title:e.getAttribute("title")??"",link:e.closest("a")?.getAttribute("href")??null,imgReplacer:e.closest("em-replace")?.getAttribute("src")??""}}function n7(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=r7(o),s=Array.from(o).map((u,d)=>{const f=We({elem:u}),p=kS(u);return{src:p.src,width:p.width,height:p.height,alt:p.alt,title:p.title,link:p.link,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:p.imgReplacer,mobileWidth:{value:_S(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:_S(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorderRadius:f.mobileBorderRadius,slideIndex:d}}),a=We({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:Es(r),mobileBorderRadius:a.mobileBorderRadius,loop:r.hasAttribute("loop"),autoplay:r.hasAttribute("autoplay"),link:i},c=r.closest("td");return c&&(l.maxWidth=Math.round(c.getBoundingClientRect().width)),l}function r7(e){const t=Array.from(e,n=>n.closest("a")?.getAttribute("href"));return t.length>0&&t.every(n=>n&&n===t[0])?t[0]??null:null}function o7(e){return!!e.closest("amp-carousel")}function Is(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=e?.includes(`${r}:`);if(n==="All")return{color:t.getAttribute("bordercolor")?V(t.getAttribute("bordercolor")):t.style?.border?V(t.style.borderColor):"",width:t.getAttribute("border")||(t.style?.border?t.style.borderWidth:""),style:e?.includes("border:")?t.style.borderStyle:t.getAttribute("border")?"solid":""};const i=`border${n}Color`,s=`border${n}Width`,a=`border${n}Style`;return{color:o?V(t.style[i]):"",width:o?t.style[s]:"",style:o?t.style[a]:""}}function Ds(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=!!e?.includes(`${r}:`);if(n==="All")return{color:o?V(t.style.borderColor):"",width:o?t.style.borderTopWidth:0,style:o?t.style.borderStyle:""};const i=`border${n}Color`,s=`border${n}Width`,a=`border${n}Style`;return{color:o?V(t.style[i]):"",width:o?t.style[s]:0,style:o?t.style[a]:""}}function i7(e){return!!e.closest(".em-element-custom-table")}function s7(e,t,n){const r=e.elem,o=r.tagName==="DIV"||r.querySelector(`.${n.CLASS_FOR_BASIC_CELL}`)||r.querySelector("EDITOR")?r.closest("TD"):r,i=o.closest("TABLE"),s=i.getAttribute("style"),a=o.getAttribute("style"),l=n.parseTableElementToModel(i);if(n.activeCell.length>1){const h=l.cells.find(y=>y.id===n.activeCell[0]);l.cells.find(y=>y.id===n.activeCell[n.activeCell.length-1])?.style,h?.style}const c=i?.style?.borderRadius?n.extractBorderRadius(s||""):null,u=c?c.firstNumber===c.secondNumber&&c.secondNumber===c.thirdNumber&&c.thirdNumber===c.fourthNumber:!1,d=n.parseBackgroundStyles(s||""),f=Ss(i),p=We({elem:i}),m={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none",show:p.show,outlookBackground:As(r.closest(".em-element-custom-table")??r,"around"),customTable:{paddingLeftRight:o.style.paddingLeft===o.style.paddingRight?o.style.paddingLeft:"",paddingTopBottom:o.style.paddingTop===o.style.paddingBottom?o.style.paddingTop:"",paddingLeft:o.style.paddingLeft,paddingRight:o.style.paddingRight,paddingTop:o.style.paddingTop,paddingBottom:o.style.paddingBottom,backgroundColor:i.getAttribute("bgcolor")?V(i.getAttribute("bgcolor")):"",backgroundImage:[{type:"url",value:d?.backgroundImage??""}],backgroundPositionX:d?.backgroundPositionX??"center",backgroundPositionY:d?.backgroundPositionY??"center",backgroundRepeat:d?.backgroundRepeat??"repeat",backgroundSize:d?.backgroundSize??"cover",borderAll:Is(s,i,"All"),borderBottom:Is(s,i,"Bottom"),borderTop:Is(s,i,"Top"),borderRight:Is(s,i,"Right"),borderLeft:Is(s,i,"Left"),borderRadius:{all:s?.includes("border-radius:")&&u?+c.firstNumber:null,topLeft:s?.includes("border-radius:")&&!u?+c.firstNumber:null,topRight:s?.includes("border-radius:")&&!u?+c.secondNumber:null,bottomRight:s?.includes("border-radius:")&&!u?+c.thirdNumber:null,bottomLeft:s?.includes("border-radius:")&&!u?+c.fourthNumber:null},boxShadow:{color:f?.color??null,hOffset:f?.hOffset??null,vOffset:f?.vOffset??null,blurRadius:f?.blurRadius??null,spreadRadius:f?.spreadRadius??null,inset:f?.inset??null},mobileBoxShadow:p.mobileBoxShadow,mobileBackgroundColor:p.mobileBackgroundColor,mobileBackgroundImage:p.mobileBackgroundImage,mobileBackgroundPositionX:p.mobileBackgroundPositionX,mobileBackgroundPositionY:p.mobileBackgroundPositionY,mobileBackgroundRepeat:p.mobileBackgroundRepeat,mobileBackgroundSize:p.mobileBackgroundSize,mobileWidth:{value:p.mobileWidth!=null?p.mobileWidth:null,dim:p.mobileWidthDim},mobileHeight:{value:p.mobileHeight!=null?p.mobileHeight:null,dim:"px"},mobileBorderRadius:p.mobileBorderRadius,mobileBorder:p.mobileBorder,borderPosition:E1(i),cell_borderPosition:E1(o),cellBackgroundColor:a?.includes("background-color:")?V(o.style.backgroundColor):"",cell_borderAll:Ds(a,o,"All"),cell_borderBottom:Ds(a,o,"Bottom"),cell_borderTop:Ds(a,o,"Top"),cell_borderRight:Ds(a,o,"Right"),cell_borderLeft:Ds(a,o,"Left"),cell_paddingLeftRight:o.style.paddingLeft===o.style.paddingRight?o.style.paddingLeft:"",cell_paddingTopBottom:o.style.paddingTop===o.style.paddingBottom?o.style.paddingTop:"",cell_paddingLeft:o.style.paddingLeft,cell_paddingRight:o.style.paddingRight,cell_paddingTop:o.style.paddingTop,cell_paddingBottom:o.style.paddingBottom,linkHref:r.getAttribute("href")?.trim()??"",textLink:!!r.closest("a"),target:r.getAttribute("target")??"",fontFamily:n.getFontFamilyFromElement(n.requestElemWithStyle?.closest('[style*="font-family"]')||r),fontSize:n.requestElemWithStyle?.style?.fontSize?parseInt(n.requestElemWithStyle.style.fontSize,10):n.requestElemWithStyle?.closest('div[style*="font-size"]')?.style?.fontSize?parseInt(n.requestElemWithStyle.closest('div[style*="font-size"]').style.fontSize,10):null,textStrikethrough:n.textHasStyle(r,"s","strike")||n.requestElemWithStyle?.style.textDecoration.includes("line-through"),textUnderline:n.textHasStyle(r,"u")||n.requestElemWithStyle.style.textDecoration.includes("underline")||!n.requestElemWithStyle.style.textDecoration&&r.tagName==="A",lineHeight:n.getLineHeghtInPixels(n.requestElemWithStyle),textStrong:n.textHasStyle(r,"strong","b")||n.isElementHasBold(n.requestElemWithStyle),textItalic:n.textHasStyle(r,"i","em")||!n.requestElemWithStyle.closest('[style*="font-style: normal"]')&&n.requestElemWithStyle?.style?.fontStyle==="italic",textAlign:r.style?.textAlign||r.getAttribute("align")||r.closest("[align]")?.getAttribute("align")||"",textColor:V(r.closest('[style*="color"]')?.style.color)||V(getComputedStyle(r).color),textBackgroundColor:V(r.closest('[style*="background-color"]')?.style.backgroundColor)||V(getComputedStyle(r).backgroundColor),textValign:r.style?.verticalAlign||r.getAttribute("valign")||r.closest("[valign]")?.getAttribute("valign")||""}};return r.getAttribute("new")&&(r.removeAttribute("new"),m.customTable.isNewLink=!0,r.setAttribute("em-edit","active")),{type:"customTable",caption:t.ELEMENT,settings:m}}function lc(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function a7(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:lc(r.style.width),maxWidth:lc(r.style.maxWidth),minWidth:lc(r.style.minWidth),height:lc(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function LS(e,t){const n=e==null?null:typeof e=="number"?e:Number(e);return{value:n==null||Number.isNaN(n)?null:n,dim:t==="%"?"%":"px"}}function l7(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function NS(e,t,n){return e?{fontFamily:Ms(e.closest('[style*="font-family"]')||e),textStrong:Qe(e,"strong","b")||ac(e)||!!t?.querySelector("strong")||!!t?.querySelector("bold")||e.querySelector("span")?.style?.fontWeight?.includes("bold"),textItalic:!e.closest('[style*="font-style: normal"]')&&e.style?.fontStyle==="italic"||!!e.querySelector("em")||!!e.querySelector("i")||e.querySelector("span")?.style?.fontStyle?.includes("italic"),fontSize:parseFloat(e.closest('[style*="font-size"]')?.style.fontSize)||0,lineHeight:n.getLineHeghtInPixels(e),textColor:V(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:V(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:c7(e),textUnderline:u7(e)}:{}}function c7(e){return e.style?.textDecorationLine?.includes("line-through")||e.querySelector("em")?.style?.textDecorationLine?.includes("line-through")||e.querySelector("span")?.style?.textDecorationLine?.includes("line-through")||e.style?.textDecoration?.includes("line-through")||e.querySelector("em")?.style?.textDecoration?.includes("line-through")||e.querySelector("span")?.style?.textDecoration?.includes("line-through")||!!e.querySelector("strike")}function u7(e){return e.style?.textDecorationLine?.includes("underline")||e.querySelector("em")?.style?.textDecorationLine?.includes("underline")||e.querySelector("span")?.style?.textDecorationLine?.includes("underline")||e.style?.textDecoration?.includes("underline")||e.querySelector("em")?.style?.textDecoration?.includes("underline")||e.querySelector("span")?.style?.textDecoration?.includes("underline")||!!e.querySelector("underline")||!!e.querySelector("u")}function d7(e,t,n){const r=e.elem.querySelector(".em-element-list-ul")||e.elem.querySelector(".em-element-list-ol")||null,o=r?e.elem.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'):null,i=We({elem:e.elem}),s=e.elem.querySelector("td"),a=n.getElementTdDiv(s),l=r?NS(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:LS(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function f7(e,t,n){const r=e.elem.closest("table")?.closest("td"),o=e.elem.closest("table");if(!r&&!o)return{settings:null,editTargetTd:null,shouldResetProgrammaticSelection:!0};const i=r?.querySelector('table[class^="em-element-list"] tr td:nth-child(2) div'),s=!!(r?.querySelector(".em-element-list-ul")||r?.querySelector(".em-element-list-ol")),a=We({elem:r}),l=r?.querySelector("td"),c=n.getElementTdDiv(l),u=i?NS(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:LS(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function xS(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function m7(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function OS(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function p7(e){const t=e.firstElementChild;if(!t)return 0;const n=t.getAttribute("width");return e.style.maxWidth?parseFloat(e.style.maxWidth)-parseFloat(n||"0"):e.style.width?n&&n.includes("0%")?0:parseFloat(e.style.width)-parseFloat(n||"0"):0}function h7(e,t){const n=e.elem,r=We({elem:n}),o=n.firstElementChild,i=o?We({elem:o}):null,s=xS(r.mobileWidth),a=i?xS(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:m7(o?.getAttribute("width")),gap:{value:p7(n),dim:"px"},maxWidth:OS(n.style.maxWidth),minWidth:OS(n.style.minWidth),valign:n.style.verticalAlign??"",mobileWidth:{value:s,dim:r.mobileWidthDim??"px"},mobileContentWidth:{value:a,dim:i?.mobileWidthDim??"px"},mobileVerticalAlign:r.mobileVerticalAlign,show:r.show}}function g7(e){if(e.tagName!=="DIV")return!1;const t=e.style.display,n=t==="inline-block"||t==="table-cell",r=!!e.style.verticalAlign;return n&&r}function RS(e){return e.getAttribute("src")}function b7(e,t){const n=Du(e.elem),r=RS(n),o=We({elem:n}),i=n.closest("td"),s=i?We({elem:i}):null;let a="img",l=t.PICTURE;e.elem.classList.contains("em-countdown")?(a="countdown",l=t.COUNTDOWN):e.elem.classList.contains("em-video")&&(a="video",l=t.VIDEO);const c=d=>d===null||d==="auto"?null:typeof d=="number"?d:null,u={type:a,caption:l,src:r??"",width:MS(n,"width"),height:MS(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:Kl(n),borderRadius:Es(n),boxShadow:Ss(n),mobileWidth:{value:c(o.mobileWidth),dim:o.mobileWidthDim??"px"},mobileHeight:{value:c(o.mobileHeight),dim:o.mobileHeightDim??"px"},mobileBorder:o.mobileBorder,mobileBorderRadius:o.mobileBorderRadius,mobileBoxShadow:o.mobileBoxShadow,mobileAlign:s?.mobileAlign,mobileVerticalAlign:o.mobileVerticalAlign,show:o.show,link:n.closest("a")?.getAttribute("href")??null,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:n.closest("em-replace")?.getAttribute("src")??""};if(a==="countdown"&&(u.countdown=e.elem.getAttribute("em-cd-settings")??void 0),a==="video"){const d=e.elem.getAttribute("em-video-settings");if(d)try{u.video=JSON.parse(d.replaceAll("'",'"'))}catch{u.video={}}}return Ps(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function MS(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function y7(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function Bs(e){const t=String(e??"").trim();return t?V(t)??t:""}var gm={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function v7(e){if(!e)return null;const t=e.getAttribute("width")?.trim();if(t){const i=parseInt(t,10);if(!Number.isNaN(i)&&i>0)return i}const n=e.getAttribute("style")??"",r=/(?:^|;)\s*width:\s*(\d+)px/i.exec(n);if(r){const i=parseInt(r[1],10);if(!Number.isNaN(i)&&i>0)return i}const o=e.style?.width?.trim()??"";if(o){const i=parseInt(o,10);if(!Number.isNaN(i)&&i>0)return i}return e.offsetWidth>0?Math.round(e.offsetWidth):null}function E7(e,t){if(e.length===0)return t;let n=null;for(const r of e){const o=r.iconWidth;if(o==null||Number.isNaN(o)||o<=0)return t;if(n===null)n=o;else if(o!==n)return t}return n??t}function bm(e){return e.closest('table[em-type="social"]')}function S7(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function PS(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function ni(e){if(!e||!(e instanceof HTMLElement))return"";const t=e.style?.backgroundColor?.trim()??"";return!t||t==="transparent"||t==="rgba(0, 0, 0, 0)"?"":t}function $n(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function ym(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function w7(e){if(!(e instanceof HTMLElement))return null;const t=e.getAttribute("width")?.trim(),n=e.style.width?.trim(),r=t||n;if(!r)return null;const o=/^(\d+)/.exec(r);if(!o)return null;const i=parseInt(o[1],10);return Number.isNaN(i)||i<0?null:i}function C7(e,t){for(let n=1;n<e.length-1;n+=1){const r=e[n-1],o=e[n],i=e[n+1];if(r instanceof HTMLElement&&i instanceof HTMLElement&&$n(r,"em-platform")&&$n(i,"em-platform")&&o instanceof HTMLElement&&!$n(o,"em-platform")){const s=w7(o);if(s!=null){t.gap=s;return}}}}function IS(e){const t=String(e??""),n=/(?:^|;)\s*border-radius:\s*(\d+)px/i.exec(t);if(!n)return null;const r=parseInt(n[1],10);return Number.isNaN(r)||r<0?null:r}function A7(e,t){const n=PS(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function T7(e,t){for(const n of e){if(!(n instanceof HTMLElement)||!$n(n,"em-platform"))continue;const r=IS(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=IS(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function _7(e,t){for(const n of e){if(!(n instanceof HTMLElement))continue;const r=n.querySelector("br"),o=r?.nextElementSibling?.tagName==="SPAN"?r.nextElementSibling:null;if(o&&o.textContent?.trim()){t.showLabel=!0;return}}t.showLabel=!1}function k7(e,t,n){const r=e.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),o=e.querySelector("td[em-tray-cell-bg], td[data-em-tray-cell-bg]"),i=ni(r),s=ni(o instanceof HTMLElement?o:null),a=ni(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=ni(t),c=ni(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function L7(e){const t=PS(e);if(!(t instanceof HTMLElement))return"";const n=ni(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function vm(e){if(!e)return null;const t=e.style.border?.trim()??"",n=/^(\d+)px\s+solid\s+(.+)$/i.exec(t);if(!n)return null;const r=parseInt(n[1],10),o=n[2].trim();return Number.isNaN(r)||r<=0||!o?null:{w:r,color:o}}function N7(e,t){const n=vm(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function x7(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!bm(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!$n(n,"em-platform")&&r instanceof HTMLElement&&o instanceof HTMLElement&&$n(r,"em-platform")&&$n(o,"em-platform")&&bm(n))}function O7(e,t){const n=bm(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...gm,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...gm};A7(n,r),N7(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");k7(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(m=>m instanceof HTMLElement&&$n(m,"em-platform")),l=a.length>0?a:s.filter(m=>m.querySelector("img"));C7(s,r),T7(l,r),_7(l,r);let c=typeof r.buttonBorderWidth=="number"&&!Number.isNaN(r.buttonBorderWidth)?r.buttonBorderWidth:0;const u=n.querySelector("[em-social-tray-shell], [data-em-social-tray-shell]"),d=u instanceof HTMLElement?vm(u):null;if(d)c=d.w;else for(const m of l){if(!(m instanceof HTMLElement))continue;const h=vm(m);if(h){c=h.w;break}}let f=l.map(m=>{if(!(m instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const h=m,y=ym(h,"em-platform")||"unknown",w=$n(h,"em-custom-icon"),A=h.querySelector("a"),k=h.querySelector("img"),b=A?.getAttribute("href")??"",v=A?.getAttribute("title")??k?.getAttribute("title")??"",S=k?.getAttribute("alt")??"",T=k?.getAttribute("src")??"",g=v7(k instanceof HTMLImageElement?k:null),E=k?.getAttribute("height")?.trim(),C=E?parseInt(E,10):NaN,_=!Number.isNaN(C)&&C>0,x=ym(h,"em-button-bg")?.trim()??"",N=!w&&$n(h,"em-tray-cell-bg");let W="",R="";if(!w&&(W=x,!W&&!N&&h.style?.backgroundColor&&(W=h.style.backgroundColor.trim()),R=ym(h,"em-item-border-color")?.trim()??"",!R)){const M=h.style.border?.trim()??"",te=/^(\d+)px\s+solid\s+(.+)$/i.exec(M);te?.[2]&&(R=te[2].trim())}return{platform:y,customIcon:w,href:b,alt:S,title:v,iconSrc:T,iconWidth:g,iconHeight:_?C:g,buttonBgColor:W,itemBorderColor:R}});if(d&&f.length>0&&f.every(m=>m.customIcon||!String(m.itemBorderColor??"").trim())){const m=d.color;f=f.map(h=>h.customIcon?h:{...h,itemBorderColor:m})}const p=E7(f,gm.iconSize);return{type:"social",caption:t.SOCIAL??"Social media",align:r.align,iconSize:p,borderRadius:r.borderRadius,gap:r.gap,bgEnabled:r.bgEnabled,bgColor:Bs(r.bgColor),borderWidth:r.borderWidth,borderColor:Bs(r.borderColor),buttonBorderColor:"",buttonBorderWidth:c,showLabel:r.showLabel,hostCellBgForIconLuminance:Bs(L7(n)),blockIndex:S7(n),items:f.map(m=>({...m,buttonBgColor:Bs(m.buttonBgColor),itemBorderColor:Bs(m.itemBorderColor)}))}}function DS(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(BS)}function R7(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function BS(e){return e.nodeType===Node.COMMENT_NODE}function bn(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!BS(r));if(t.length===0)return!0;const n=t.filter(r=>!R7(r));return n.length===1&&n[0]instanceof Element&&DS(n[0])}function HS(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(bn(t))return t;return null}function FS(){const e=Fu(document,'[em="group"]');return Fu(e||document,'[em="block"]')}function rr(e){const t=e.children.length===1?e.children[0]:null;return t&&DS(t)?t:e}function M7(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function $S(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function P7(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function I7(e){if(e.style.backgroundImage){const t=e.style.backgroundImage;return[{type:"url",value:t.substring(5,t.length-2)}]}return e.getAttribute("background")?[{type:"url",value:e.getAttribute("background")||""}]:[{type:"url",value:""}]}function D7(e,t){const n=e.elem;if(bn(n))return{type:"emptyTable",caption:t.TABLE};n.setAttribute("em-edit","active");const r=We({elem:n}),o={type:"table",caption:t.TABLE,backgroundColor:n.style.backgroundColor?V(n.style.backgroundColor):"",backgroundImage:I7(n),backgroundPositionX:n.style.backgroundPositionX!=="initial"?n.style.backgroundPositionX:"",backgroundPositionY:n.style.backgroundPositionY!=="initial"?n.style.backgroundPositionY:"",backgroundRepeat:n.style.backgroundRepeat||"repeat",backgroundSize:n.style.backgroundSize||"auto",width:M7(n,"width"),maxWidth:$S(n,"maxWidth"),minWidth:$S(n,"minWidth"),align:n.getAttribute("align")??"",border:Kl(n),boxShadow:Ss(n),borderRadius:Es(n),mobileWidth:{value:P7(r.mobileWidth),dim:r.mobileWidthDim??"px"},mobileBorder:r.mobileBorder,mobileBorderRadius:r.mobileBorderRadius,mobileBoxShadow:r.mobileBoxShadow,show:r.show,mobileAlign:r.mobileAlign,mobileBackgroundColor:r.mobileBackgroundColor,mobileBackgroundImage:r.mobileBackgroundImage,mobileBackgroundPositionX:r.mobileBackgroundPositionX,mobileBackgroundPositionY:r.mobileBackgroundPositionY,mobileBackgroundRepeat:r.mobileBackgroundRepeat,mobileBackgroundSize:r.mobileBackgroundSize,exportAsPicture:n.getAttribute("em-operation")==="exportAsPicture",outlookBackground:As(n,"around")};return Ps(n)&&(o.showOnMobile=!0),o}function B7(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function H7(e){if(e.tagName!=="TD")return e.closest("table")?.parentElement?.tagName==="BODY";if(e.classList.contains("em-vindent")||e.innerHTML===""||e.closest("table")?.getAttribute("em")==="atom"||e.firstChild?.tagName==="EDITOR")return!1;const t=!!e.querySelector('div[style*="inline-block"]'),n=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return!!(!t&&!n||t&&e.parentElement?.getAttribute("em")!=="block"&&!e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap"))}function F7(e){if(e.tagName!=="TD"||e.classList.contains("em-vindent")||e.innerHTML===""||e.firstChild?.tagName==="EDITOR"||!(e.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.getAttribute("em")==="block"||e.parentElement?.parentElement?.parentElement?.getAttribute("em")==="block"))return!1;const t=!!e.querySelector('div[style*="inline-block"]'),n=!!e.querySelector(":scope > table > tr > .em-mob-wrap, :scope > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .em-mob-wrap, :scope > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap, :scope > table > tr > td > table > tr > td > table > tr > .noresp-em-mob-wrap, :scope > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr > .noresp-em-mob-wrap");return t||n}function $7(e){if(e.tagName==="TD"){if(e.innerHTML!==""||e.getAttribute("height"))return!1;const t=!e.getAttribute("width")||e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"),n=!!e.closest('[em="block"].empty-structure')||!!e.closest(".em-structure");return t&&n}return e.tagName==="DIV"?!!e.closest("amp-accordion")&&!e.innerHTML:!1}function W7(e){if(e.tagName!=="TD")return!1;const t=!!e.firstChild&&e.firstChild.tagName==="EDITOR";return t&&e.closest("table")?.getAttribute("em")==="atom"?!0:!(t||e.classList.contains("em-vindent"))}function q7(e){const t={items:[],gap:null,gapMobile:null,valign:"",wrap:void 0,dirRevers:!1},n=".em-mob-wrap, .noresp-em-mob-wrap",r=e.querySelector(n),o=e.querySelectorAll(n).length;if(r&&e.querySelectorAll(".em-mob-wrap:first-child, .noresp-em-mob-wrap:first-child").length===1)t.wrap=!0,e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(i=>{if(t.items.push({width:parseFloat(i.getAttribute("width")||"0"),current:!1}),o>1){const s=r.nextElementSibling;t.gap=parseFloat(s?.getAttribute("width")||"0");const a=We({elem:s});t.gapMobile=a.mobileHeight||0}else t.gap=0;(i.classList.contains("em-mob-wrap-cancel")||i.classList.contains("noresp-em-mob-wrap-cancel"))&&(t.wrap=!1)}),t.valign=r.getAttribute("valign")||"",(r?document.querySelector('[em-edit="active"]'):e.closest(n)?.parentElement?.closest("td"))?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0);else if(e.querySelector('div[style*="inline-block"]')){const i=e.querySelectorAll('div[style*="inline-block"]');if(i.length>1)i.forEach(a=>{const l=a,c=l.firstElementChild;t.items.push({width:parseFloat(c?.getAttribute("width")||"0"),current:!1});const u=c?.getAttribute("width"),d=parseFloat(l.style.width);!u||u.includes("%")?t.gap=d-d:t.gap=d-parseFloat(u)});else{const a=e.querySelector('div[style*="inline-block"]');t.items=[{width:parseFloat(a.firstElementChild?.getAttribute("width")||"0"),current:!0}],t.gap=0}const s=e.querySelector('div[style*="inline-block"]');t.valign=s?.style.verticalAlign||"",(s?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement)?.getAttribute("dir")==="rtl"&&(t.dirRevers=!0)}return t}function z7(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};let i="td",s=t.TABLE_COLUMN;return(r.classList.contains("em-mob-wrap")||r.classList.contains("noresp-em-mob-wrap"))&&(i="column"),r.parentElement?.getAttribute("em")==="group"?(s=t.ELEMENT_PATH_GROUP??t.GROUP,i="group"):r.closest("table")?.parentElement?.tagName==="BODY"?(s=t.GROUP,i="group"):r.classList.contains("em-mob-wrap")?s=t.FLOAT_BLOCK:r.parentElement?.getAttribute("em")==="block"&&(s=t.STRUCTURE),{type:i,caption:s,settings:o}}function U7(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=q7(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function V7(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};let i=t.TABLE_COLUMN,s="td";return r.parentElement?.getAttribute("em")==="group"?(i=t.ELEMENT_PATH_GROUP??t.GROUP,s="group"):r.closest("table")?.getAttribute("em")==="atom"?i=t.ELEMENT:r.parentElement?.getAttribute("em")==="block"&&(i=t.STRUCTURE),{type:s,caption:i,settings:o}}function j7(e){if(e.nodeType!==Node.ELEMENT_NODE)return[e];const t=e;return t.querySelectorAll("tbody").forEach(n=>n.replaceWith(...Array.from(n.childNodes))),t.tagName==="TBODY"?Array.from(t.childNodes):[t]}function WS(e){return Ie(e,!0).flatMap(j7)}function ri(e,t){e.replaceChildren(...WS(t))}function G7(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function Me(e,t){const n=WS(t),r=n.filter(s=>!G7(s)),[o]=r,i=r.length===1&&o.nodeType===Node.ELEMENT_NODE&&o.tagName==="TABLE";e.replaceChildren(...i?Array.from(o.childNodes):n)}function X7(e,t,n){const r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelectorAll("td");if(i.length>1){const s=i[1],a=(s.getAttribute("style")||"").split(";").filter(u=>u.trim()!==""),l={};a.forEach(u=>{const[d,f]=u.split(":").map(p=>p.trim());l[d]=f}),l[t]=`${n}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),r.innerHTML}function Y7(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");i&&(i.innerHTML=t)}}),n.innerHTML}function K7(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("color"))){const l=a.map(c=>c.startsWith("color")?`color: ${t};`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} color: ${t};`:`color: ${t};`)}}}),n.innerHTML}function Z7(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("font-size"))){const l=a.map(c=>c.startsWith("font-size")?`font-size: ${t}px;`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} font-size: ${t}px;`:`font-size: ${t}px;`)}}}),n.innerHTML}function Q7(e,t){if(typeof t!="boolean")throw new Error("Invalid isBold value: must be a boolean");const n=t?"bold":"normal",r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-weight"))){const c=l.map(u=>u.startsWith("font-weight")?`font-weight: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-weight: ${n};`:`font-weight: ${n};`)}}}),r.innerHTML}function J7(e,t){if(typeof t!="boolean")throw new Error("Invalid isItalic value: must be a boolean");const n=t?"italic":"normal",r=document.createElement("div");return r.innerHTML=e,r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-style"))){const c=l.map(u=>u.startsWith("font-style")?`font-style: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-style: ${n};`:`font-style: ${n};`)}}}),r.innerHTML}function eH(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("line-through")?u="underline line-through":u="underline":l.includes("line-through")?u="line-through":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),n.innerHTML}function tH(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("underline")?u="underline line-through":u="line-through":l.includes("underline")?u="underline":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),n.innerHTML}function nH(e){return!e||!(e instanceof Node)?null:document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:t=>t.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode()}function rH(e){if(!e||!(e instanceof Node))return null;const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:o=>o.nodeValue?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let n=null,r;for(;r=t.nextNode();)n=r;return n}function oH(e){if(!e||!(e instanceof HTMLElement))return"inside";const t=window.getSelection();if(!t||t.rangeCount===0)return"inside";const n=t.getRangeAt(0);if(!n.collapsed)return"inside";let{startContainer:r,startOffset:o}=n;if(r===e)return o===0?"start":o===e.childNodes.length?"end":"inside";const i=nH(e),s=rH(e);let a=r;return a&&a.nodeType===Node.ELEMENT_NODE&&(a=a.childNodes[0]),i&&a===i&&o===0?"start":s&&r===s&&(o===s?.nodeValue?.length||o===s?.nodeValue?.trim().length)?"end":"inside"}function qS(e){const t=e.cloneNode(!0),n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let r;for(;r=n.nextNode();)r.nodeValue="";return t}function Em(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function iH(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=r?r.innerHTML.trim():n.innerHTML.trim(),i=e.closest("tr");if(!i)return{rowHtml:o,firstCellText:"",secondCellText:"",firstCellHtmlNoText:"",secondCellHtmlNoText:"",secondCellWrapperHtml:"",secondCellInnerDivHtml:"",wrappedSecondCellHtml:"",secondCellInnerDivWrapperHtml:"",secondCellTextHTML:""};const s=i.querySelectorAll("td"),a=s[0]||null,l=s[1]||null,c=a?a.textContent.trim():"",u=l?l.textContent.trim():"",d=l?l.innerHTML.trim():"",f=a?qS(a).outerHTML:"",p=l?qS(l).outerHTML:"",m=l?`<td${Em(l)}></td>`:"",h=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:f,secondCellHtmlNoText:p,secondCellWrapperHtml:m,secondCellInnerDivHtml:h?h.outerHTML:"",wrappedSecondCellHtml:l&&h?`<td${Em(l)}>${h.outerHTML}</td>`:"",secondCellInnerDivWrapperHtml:h?`<div${Em(h)}></div>`:"",secondCellTextHTML:d}}function zS(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function US(e,t){const n=document.createElement("template");n.innerHTML=e;const r=n.content.firstElementChild;if(!r||r.tagName.toLowerCase()!=="td")return e;const o=r.querySelector("div");return o?o.textContent=zS(t)||" ":r.insertAdjacentText("afterbegin",zS(t)),r.outerHTML}function oi(e){const t=document.createElement("template");return t.innerHTML=e,t.content.querySelectorAll("editor").forEach(n=>{n.replaceWith(...Array.from(n.childNodes))}),t.content.querySelectorAll('[em-edit="active"]').forEach(n=>{n.removeAttribute("em-edit")}),t.innerHTML}function VS(e){e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(t=>t.removeAttribute("id"))}function sH(e,t,n,r=!0){const o=document.createElement("template");o.innerHTML=e.trim();const i=o.content.querySelector(`div.${n}`);if(i){const s=i.closest("tr");if(s){const a=r?"beforebegin":"afterend";s.insertAdjacentHTML(a,t)}}return o.innerHTML}function aH(e){let t=1;return e.map(n=>{if(n.cellOneText&&/^\d+\.$/.test(n.cellOneText.trim())){const o={...n,cellOneText:`${t}.`};return t++,o}if(!n.cellOneText||/^\s*$/.test(n.cellOneText))return{...n};const r={...n,cellOneText:`${t}.`};return t++,r})}function lH(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function cH(e){if(!Array.isArray(e)||e.length===0)return e;const t=" ",n=e.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText.trim();return i.endsWith(t)||(i+=t),{...o,cellOneText:i}}),r=Math.max(...n.map(o=>o.cellOneText?o.cellOneText.length:0));return n.map(o=>{if(!o.cellOneText)return o;let i=o.cellOneText;for(;i.length<r;)i+=t;return{...o,cellOneText:i}})}function Sm(e){const t=Array.from(e.querySelectorAll("tr")).map(r=>r.querySelectorAll("td")).filter(r=>r.length>=2).map(r=>r[0].querySelector("div")),n=cH(lH(aH(t.map(r=>({cellOneText:r?.textContent?.trim()??"",cellTwoText:""})))));t.forEach((r,o)=>{const i=n[o].cellOneText;r&&r.textContent!==i&&(r.textContent=i)})}function uH(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function dH(e,t,n){const r=[];let o=t;for(;o!==e;){const c=o.parentNode;if(!c)return null;r.unshift(Array.from(c.childNodes).indexOf(o)),o=c}const i=document.createRange();i.selectNodeContents(t),i.setStart(n.startContainer,n.startOffset);const s=i.extractContents(),a=e.cloneNode(!0),l=r.reduce((c,u)=>c.childNodes[u],a);return l.replaceChildren(s),[t,l].forEach(c=>{(c.textContent??"").trim()||(c.textContent=" ")}),{row:a,content:l}}function fH(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html"),i=o.querySelector(`div.${t}`);if(!i)return e;const s=i.closest("tr");if(!s)return e;const a=r==="ArrowUp"?s.previousElementSibling:s.nextElementSibling;if(a&&a.tagName==="TR"){const c=a.querySelectorAll("td")[1]||null;if(c){const u=c.querySelector("div");u&&u.classList.add(n)}}else i.classList.add(n);const l=o.querySelector("table");return l?l.outerHTML:e}function mH(e,t,n,r){const o=e.closest(`table.${t}`)||e.closest(`table.${n}`);o&&o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:nth-child(2)");if(!s)return;const a=Array.from(s.querySelectorAll("div, strong")).filter(l=>!l.closest("template"));if(a.length===0){const l=document.createElement("div");l.innerHTML=" ",s.appendChild(l)}else a.forEach(l=>{let c=Ue(l).trim();!c||c.replace(r,"")===""?l.innerHTML=" ":(c=c.replace(r,""),c.endsWith(" ")||(c+=" "),c=c.replace(/ +$/," "),ri(l,c))})})}function pH(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html"),r=n.querySelector("div");return r&&(r.classList.add("remove-new-editor-element"),r.innerHTML.trim()?r.innerHTML+=" ":r.innerHTML=" "),n.querySelector("td")?.outerHTML||""}function hH(e,t){const n=document.createElement("div");return n.innerHTML=e,n.querySelectorAll("tr").forEach(r=>{const o=r.querySelectorAll("td");if(o.length>1){const i=o[1],s=(i.getAttribute("class")||"").split(" ").map(l=>l.trim()).filter(l=>l!=="");s.includes(t)||s.push(t);const a=s.join(" ");i.setAttribute("class",a)}}),n.innerHTML}var wm="em-element-list-ol",Cm="em-element-list-ul",gH="em-element-list-bullet",bH=`.${wm}, .${Cm}`,yH=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],vH="div, p, td, h1, h2, h3, h4, h5, h6",Wn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},Hs=null;function Am(e){const t=window.getSelection();if(t&&t.rangeCount>0){const n=t.getRangeAt(0);if(e.contains(n.startContainer))return{container:n.startContainer,offset:n.startOffset}}return Hs&&Hs.container.isConnected&&e.contains(Hs.container)?Hs:null}function EH(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;return n.forEach((i,s)=>{i.nodeType===Node.ELEMENT_NODE&&i.tagName==="BR"?(r.length>0&&t.push({html:cc(r),nodes:[...r],startIndex:o,endIndex:s-1}),r=[],o=s+1):r.push(i)}),r.length>0&&t.push({html:cc(r),nodes:[...r],startIndex:o,endIndex:n.length-1}),t}function SH(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;const i=a=>{r.length>0&&(t.push({html:cc(r),nodes:[...r],startIndex:o,endIndex:a-1}),r=[])},s=a=>a.nodeType===Node.ELEMENT_NODE&&(a.tagName==="UL"||a.tagName==="OL");return n.forEach((a,l)=>{a.nodeType===Node.ELEMENT_NODE&&a.tagName==="BR"?(i(l),o=l+1):s(a)?(i(l),t.push({html:cc([a]),nodes:[a],startIndex:l,endIndex:l}),o=l+1):r.push(a)}),i(n.length),t}function cc(e){const t=document.createElement("div");return e.forEach(n=>t.appendChild(n.cloneNode(!0))),Fr(t),t.innerHTML}function Tm(e,t){const n=Am(t);if(!n)return 0;const r=n.container;if(!t.contains(r))return 0;for(let o=0;o<e.length;o++)for(const i of e[o].nodes)if(i===r||i.contains(r))return o;if(r===t){const o=n.offset;for(let i=0;i<e.length;i++)if(o>=e[i].startIndex&&o<=e[i].endIndex)return i;for(let i=0;i<e.length;i++)if(o===e[i].startIndex)return i;for(let i=0;i<e.length;i++)if(e[i].startIndex>=o)return i;if(e.length>0)return e.length-1}return 0}function jS(e,t,n,r){if(!n.contains(t))return r;for(let o=0;o<e.length;o++)for(const i of e[o].nodes)if(i===t||i.contains(t))return o;return r}function wH(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=Tm(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=Tm(e,t);return{start:a,end:a}}const o=Tm(e,t),i=jS(e,r.startContainer,t,o),s=jS(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function GS(e){const t=Array.from(e.childNodes).filter(r=>r.nodeType!==Node.TEXT_NODE||(r.textContent??"").trim()!==""),n=t.length===1?t[0]:null;return n?.nodeName==="EDITOR"?n:e}function CH(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function XS(e){return e.nodeType===Node.TEXT_NODE&&/^[\t\n\f\r ]*$/.test(e.data)}function YS(e,t){const n=KS(t);if(n.length===0){e.append(" ");return}e.append(...n),CH(e)}function KS(e){let t=0,n=e.length-1;for(;t<=n&&XS(e[t]);)t++;for(;n>=t&&XS(e[n]);)n--;return e.slice(t,n+1)}var AH=["color","background-color","font-family","font-size","font-weight","font-style","text-decoration"];function TH(e){const t=KS(Array.from(e.childNodes)),n=document.createElement("span");return AH.forEach(r=>{const o=e.style.getPropertyValue(r);o&&n.style.setProperty(r,o,e.style.getPropertyPriority(r))}),e.className&&(n.className=e.className),!n.hasAttribute("style")&&!n.hasAttribute("class")?t:(n.append(...t),[n])}function uc(e){const t=window.getSelection();if(!t||t.rangeCount===0)return null;const{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t.getRangeAt(0),s=a=>a.nodeType===Node.TEXT_NODE&&e.contains(a);return s(n)&&s(o)?{startContainer:n,startOffset:r,endContainer:o,endOffset:i}:null}function dc(e,t){const n=window.getSelection();if(!t||!n||!e.contains(t.startContainer)||!e.contains(t.endContainer))return!1;const r=document.createRange();return r.setStart(t.startContainer,t.startOffset),r.setEnd(t.endContainer,t.endOffset),n.removeAllRanges(),n.addRange(r),!0}function ZS(e,t,n){const r=uc(e),o=document.createElement(n);Array.from(t.attributes).forEach(s=>{o.setAttribute(s.name,s.value)}),Array.from(o.style).filter(s=>s.startsWith("margin")||s.startsWith("padding")).forEach(s=>o.style.removeProperty(s));const i=o.style.cssText;o.setAttribute("style",i?`${Wn.LIST} ${i}`:Wn.LIST),o.append(...Array.from(t.childNodes)),t.replaceWith(o),dc(e,r)}function _H(e){return e.querySelector("br")!==null}function kH(e){const t=Am(e);if(!t)return null;const n=t.container.nodeType===Node.ELEMENT_NODE?t.container:t.container.parentElement;if(!n)return null;const r=n.closest("ol, ul");return r&&e.contains(r)?r:null}function LH(e){const t=Am(e);if(!t)return;const{container:n,offset:r}=t;if(n!==e)return;const o=Array.from(e.childNodes),i=r>0?o[r-1]:null,s=r<o.length?o[r]:null,a=h=>h!==null&&h.nodeType===Node.ELEMENT_NODE&&h.tagName==="BR",l=h=>h!==null&&h.nodeType===Node.TEXT_NODE&&h.data.trim()==="",c=a(i),u=a(s),d=l(s),f=r>=o.length;if(!(c&&u||c&&f||r===0&&u||c&&d))return;let p;d?(p=s,p.data=" "):(p=document.createTextNode(" "),s?e.insertBefore(p,s):e.appendChild(p));const m=window.getSelection();if(m){const h=document.createRange();h.setStart(p,0),h.collapse(!0),m.removeAllRanges(),m.addRange(h)}Hs={container:p,offset:0}}function NH(e,t){const n=GS(e),r=t?"ol":"ul";if(n.querySelector("ol, ul")){const o=kH(n);if(o){o.tagName.toLowerCase()!==r&&ZS(n,o,r);return}const i=n.querySelector(":scope > ol, :scope > ul"),s=Array.from(n.childNodes).some(a=>a.nodeType===Node.ELEMENT_NODE&&a.tagName==="BR");if(i&&!s){i.tagName.toLowerCase()!==r&&ZS(n,i,r);return}}_H(n)||n.querySelector(":scope > ol, :scope > ul")?(LH(n),xH(n,r)):QS(n,r)}function QS(e,t){const n=uc(e),r=document.createElement(t);r.setAttribute("style",Wn.LIST);const o=document.createElement("li");o.setAttribute("style",Wn.LIST_ITEM),YS(o,Array.from(e.childNodes)),r.appendChild(o),e.replaceChildren(r),dc(e,n)||JS(o)}function xH(e,t){const n=SH(e);if(n.length===0){QS(e,t);return}const{start:r,end:o}=wH(n,e),i=uc(e),s=document.createElement(t);s.setAttribute("style",Wn.LIST);let a=null;for(let p=r;p<=o;p++){const m=document.createElement("li");m.setAttribute("style",Wn.LIST_ITEM),YS(m,n[p].nodes),s.appendChild(m),a=m}const l=document.createDocumentFragment(),c=p=>p.forEach((m,h)=>{h>0&&l.appendChild(document.createElement("br")),l.append(...m.nodes)}),u=p=>p.map(m=>m.html).join("<br>").trim()!=="",d=n.slice(0,r);u(d)&&(c(d),l.appendChild(document.createElement("br"))),l.appendChild(s);const f=n.slice(o+1);u(f)&&(l.appendChild(document.createElement("br")),c(f)),e.replaceChildren(l),!dc(e,i)&&a&&JS(a)}function JS(e){try{const t=window.getSelection();if(t){const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}}catch{}}function OH(e,t){let n=0;const r=Array.from(e.childNodes);for(const o of r){if(o===t)return n;o.nodeType===Node.ELEMENT_NODE&&o.tagName==="BR"&&n++}return n}function RH(e,t){const n=EH(e);if(t<0||t>=n.length)return;const r=n[t];if(r.nodes.length!==0)try{const o=window.getSelection();if(!o)return;const i=r.nodes[0],s=document.createRange();if(i.nodeType===Node.TEXT_NODE)s.setStart(i,0),s.collapse(!0);else if(i.nodeType===Node.ELEMENT_NODE)s.selectNodeContents(i),s.collapse(!0);else return;o.removeAllRanges(),o.addRange(s)}catch{}}function MH(e){const t=GS(e),n=t.querySelector("ol, ul");if(!n)return;const r=uc(t),o=OH(t,n),i=document.createDocumentFragment();n.querySelectorAll(":scope > li").forEach(s=>{const a=Ue(s).trim();!a||a===" "||(i.hasChildNodes()&&i.appendChild(document.createElement("br")),i.append(...TH(s)))}),n.replaceWith(i.hasChildNodes()?i:" "),dc(t,r)||RH(t,o)}function fc(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(bH):!1}function PH(e,t,n){const r=X6()||e.elem,o=r.tagName==="EDITOR"&&r.firstChild?.nodeType===1?r.firstChild:r,i=e.elem.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')||e.elem,s=o.style.fontFamily||o.style.fontSize||o.style.lineHeight||o.closest('[style*="font-family"], [style*="font-size"], [style*="line-height"]')?o:i,a=e.elem.closest('[style*="line-height"]')||s.querySelector('[style*="line-height"]')||s,l=r.closest('[class*="em-mob-font_size"], [style*="font-size"]')||r,c=r.closest('[class*="em-mob-line_height"]')||r.closest('[style*="line-height"]')||r,u=We({elem:l}),d=We({elem:c}),f=ew(e.elem,n),p=Qe(o,"strong","b"),m=s!==o?Qe(s,"strong","b"):!1,h=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?Qe(e.elem,"strong","b"):!1,y=p||m||h,w=ac(s),A=y||w,k={type:"text",caption:t.TEXT,fontFamily:Ms(s.closest('[style*="font-family"]')||e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||parseFloat(getComputedStyle(e.elem).fontSize),fontSizeDim:"px",lineHeight:sc(a),lineHeightDim:"px",textAlign:SS(e.elem),textStrong:A,textItalic:Qe(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s.style?.fontStyle==="italic",textStrikethrough:Qe(e.elem,"s","strike")||(s.style?.textDecoration?.includes("line-through")??!1),textUnderline:Qe(e.elem,"u")||(s.style?.textDecoration?.includes("underline")??!1)||!s.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||wS()),textColor:fc(r)&&V(Tr(r,"color"))||V(e.elem.closest('[style*="color"]')?.style.color)||V(getComputedStyle(e.elem).color)||"",textBackgroundColor:HH(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:pm(e.elem),linkHref:(()=>{const b=s.closest("a");if(!b)return;const v=b.getAttribute("href");if(v!==null)return v})(),textAnchor:(()=>{const b=s.closest("a");if(b&&!b.hasAttribute("href"))return b.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const b=s.closest("a");return b?!!b.hasAttribute("href"):Qe(e.elem,"a")||wS()})(),textReplacer:n.variableElement(e.elem),list:f,standardList:tw(e.elem),textSuperscript:Qe(e.elem,"sup"),textSubscript:Qe(e.elem,"sub")};return Ps(r)&&(k.showOnMobile=!0),k}function ew(e,t){const{isElementList:n,isElementListOL:r,isElementListUL:o,requestElemBullet:i}=t;if(!n)return{isList:!1,listType:"UL"};const s=e.closest("td");return{isList:!0,listType:r?"OL":"UL",bulletsColor:n&&i?V(i.closest('[style*="color"]')?.style.color):"",betweenParagraphs:n&&parseInt(s?.style?.paddingBottom,10)||0,betweenRowCell:n&&parseInt(s?.style?.paddingLeft,10)||0,bulletFontSize:n&&i&&parseInt(i.style.fontSize,10)||0,bulletFontBold:n?i?.style.fontWeight==="bold":!1,bulletFontItalic:n?i?.style.fontStyle==="italic":!1,bulletFontFamily:r&&i?Ms(i):"",bulletFontUnderline:n?i?.style.textDecoration?.includes("underline")??!1:!1,bulletFontStrikethrough:n?i?.style.textDecoration?.includes("line-through")??!1:!1,bulletType:o&&i?i.innerHTML.replace(/\s| /g,""):""}}function tw(e){return fc(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function _m(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var IH=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function DH(e){let t=e;for(;t&&IH.has(t.tagName);){const n=t.style.backgroundColor;if(_m(n))return n;t=t.parentElement}return""}function BH(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(_m(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function HH(e){const t=DH(e);if(_m(t))return V(t)||"";if(e.closest(".em-element-custom-table"))return V(Tr(e,"background-color"))||"";const n=e.closest("div");return V(BH(e,"background-color",n))||""}function FH(e){return e.tagName==="DIV"?!!(e.style.fontFamily&&e.style.fontSize&&e.style.lineHeight):e.tagName==="TD"?e.firstChild?.tagName==="EDITOR"||e.firstElementChild?.tagName==="EDITOR":!1}function $H(e,t,n){const{findElementWithSelectedText:r,selectedText:o,variableElement:i,requestElemBullet:s,isElementList:a,isElementListOL:l,isElementListUL:c}=n,u=r(o,e.elem)||e.elem,d=e.elem.closest('[class*="em-mob-font_size"]')||e.elem.closest('[style*="font-size"]')||e.elem,f=e.elem.closest('[class*="em-mob-line_height"]')||e.elem.closest('[style*="line-height"]')||e.elem,p=We({elem:d}),m=We({elem:f}),h=ew(e.elem,n),y={type:"text",caption:t.TEXT,linkHref:(()=>{const w=e.elem.getAttribute("href");if(w!==null)return w})(),textAnchor:(()=>{if(!e.elem.hasAttribute("href"))return e.elem.getAttribute("name")?.trim()||void 0})(),textLink:!!e.elem.hasAttribute("href"),target:e.elem.getAttribute("target")??"",fontFamily:Ms(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:sc(e.elem),lineHeightDim:"px",textAlign:SS(e.elem),textStrong:Qe(u,"strong","b")||ac(u),textItalic:Qe(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:Qe(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:Qe(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:V(e.elem.tagName==="A"?Tr(e.elem.querySelector('[style*="color"]'),"color"):Tr(e.elem,"color"))||V(getComputedStyle(e.elem).color)||"",textBackgroundColor:V(e.elem.tagName==="A"?Tr(e.elem.querySelector('[style*="background-color"]'),"background-color"):Tr(e.elem,"background-color"))||"",mobileFontSize:{value:p.mobileFontSize,dim:p.mobileFontSizeDim||"px"},mobileLineHeight:{value:m.mobileLineHeight,dim:"px"},mobileTextAlign:pm(e.elem),textReplacer:i(e.elem),list:h,standardList:tw(e.elem),textSuperscript:Qe(e.elem,"sup"),textSubscript:Qe(e.elem,"sub")};return Ps(e.elem)&&(y.showOnMobile=!0),y}function nw(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function WH(e,t){const n=e.elem,r=We({elem:n}),o=nw(r.mobileHeight);return{type:"vindent",caption:t.VERTICAL_INDENT,height:{value:parseFloat(n.getAttribute("height")||"0"),dim:"px"},mobileHeight:{value:o,dim:r.mobileHeightDim??"px"}}}function qH(e,t){const n=e.elem,r=We({elem:n}),o=nw(r.mobileHeight);return{type:"vindent",caption:t.VERTICAL_INDENT,height:{value:parseFloat(n.style.height||"0"),dim:"px"},mobileHeight:{value:o,dim:r.mobileHeightDim??"px"}}}function zH(e){if(e.tagName!=="TD")return!1;if(e.classList.contains("em-vindent"))return!0;const t=e.closest("table");return e.innerHTML===""&&t?.getAttribute("width")==="100%"}function UH(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function VH(e,t){return e.elem.tagName==="TD"?WH(e,t):qH(e,t)}var rw={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},ow={TRIM_SPACES:/^(\s| )+|(\s| )+$/g,LT:/</g,GT:/>/g,EMPTY_TEXT:/^(?:\s| )*$/};function iw(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function mc(e){const t=iw(e,wm),n=iw(e,Cm),r=t||n;let o=null;return e&&r&&(o=e.closest("table.em-element-list-ol")||e.closest("table.em-element-list-ul")),{classNameOl:wm,classNameUl:Cm,classNameBullet:gH,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function jH(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function GH(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function XH(e=Object.values(rw)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function YH(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function sw(e,t){for(const n of e.childNodes){if(n.nodeType===Node.TEXT_NODE&&n.textContent?.trim()!==""){t.push(e);break}n.nodeType===Node.ELEMENT_NODE&&sw(n,t)}}function KH(e,t,n){const r=e.getAttribute("style")||"",o={};r.split(";").forEach(function(s){if(s.trim()){const a=s.split(":");a.length>=2&&(o[a[0].trim()]=a[1].trim())}}),o[t]=n;const i=Object.keys(o).map(function(s){return o[s]?s+": "+o[s]:null}).filter(Boolean).join("; ");e.setAttribute("style",i)}function ZH(e,t){let n=[];const r=t||e,o=e?.style.fontFamily||getComputedStyle(r).fontFamily,i=[...(e?.closest('[style*="font-family"]')||e).classList].filter(s=>s.startsWith("em-font-"));if(i.length>0){n=["Google Fonts"],n[1]=o.indexOf("sans-serif")>-1?"Sans Serif":"Serif";const s=i[0].match(/em-font-(.*?)-/);if(s){n[2]=s[1];const a=new RegExp(`${n[2]}-(.*)`),l=i[0].match(a);l&&(n[3]=l[1])}}else o&&(n=["Safe Fonts",o.replaceAll('"',"'")]);return n}function QH(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var JH="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function eF(e,t=JH){if(!e)return null;const n=t.split(", ").map(o=>o.trim().toLowerCase());let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentNode;for(;r&&r.nodeType===Node.ELEMENT_NODE;){const o=r;if(n.includes(o.tagName.toLowerCase())&&o.style.fontSize)return o;r=r.parentNode}return null}function tF(e,t){const{elem:n,message:r,activateSection:o}=e;if(n.closest("table")?.parentElement?.tagName!=="BODY"){r.settings.parent=t.getElementParentCaption(n);let a=n;if(n.tagName==="IMG"){const l=n.closest('div[em="atom"]'),c=n.closest(".em-element-resize-img-container");a=l||c}else n.closest("editor")?a=n.parentElement:n.tagName==="TD"&&n.classList.contains("em-vindent")?a=n.closest(".em-vindent-table"):n.tagName==="TD"&&n.parentElement?.getAttribute("em")==="block"&&(a=n.parentElement);r.settings.nextElem=!!a?.nextElementSibling&&(!a.nextElementSibling.getAttribute("contenteditable")||a.nextElementSibling.getAttribute("contenteditable")!=="false"),r.settings.prevElem=!!a?.previousElementSibling&&(!a.previousElementSibling.getAttribute("contenteditable")||a.previousElementSibling.getAttribute("contenteditable")!=="false")}else r.settings.parent=void 0;(n.closest('div[style*="inline-block"]')||n.closest(".em-mob-wrap, .noresp-em-mob-wrap"))&&(r.settings.floatBlocks=t.getStructureColumns({elem:n})),o&&(r.settings.activateSection=o),n.classList.contains("em-mob-wrap")||n.classList.contains("noresp-em-mob-wrap")||n.parentElement?.hasAttribute("em")&&n.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1?r.settings.deletable=!1:r.settings.deletable=!0,r.settings.usedColors=t.getUsedColors(),r.settings.path=t.getElementPath(n);const i=t.getCurrentElementPath();r.type==="button"&&(r.settings.commonStyles=t.commonStyles);const s=n?.classList;return t.ampService.hasAmp&&s&&(s.contains("em-amp-show-only")?r.settings.ampShow="amp":s.contains("em-amp-show-disabled")?r.settings.ampShow="html":r.settings.ampShow="all"),r.settings=t.mapObj.unescape(r.settings),{message:r,elementPath:i}}function nF(e,t,n,r){let o=!1,i=!1;if(t.shouldResetProgrammaticSelection&&(i=!0,!t.settings||Object.keys(t.settings).length===0))return o=!0,{shouldReturn:o,isProgrammaticSelectionReset:i};if(t.removeEmEdit){if(r.removeAllAttributes("em-edit"),t.setEmEditOnTd){for(const s of e.querySelectorAll("[contenteditable]"))s.removeAttribute("contenteditable");e.querySelector("td")?.setAttribute("em-edit","active")}if(t.editTargetTd){const s=e.closest("table")?.closest("td");if(s)for(const a of s.querySelectorAll("[contenteditable]"))a.removeAttribute("contenteditable");t.editTargetTd.setAttribute("em-edit","active")}}return t.isNewLink&&(e.removeAttribute("new"),n.settings.isNewLink=!0,e.setAttribute("em-edit","active")),{shouldReturn:o,isProgrammaticSelectionReset:i}}function rF(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){Du(e).setAttribute("em-edit","active");const o=e.closest("table");if(o){for(const a of o.querySelectorAll('[contenteditable="true"]'))a.tagName!=="EDITOR"&&a.removeAttribute("contenteditable");const i=o.querySelector("editor"),s=i?.firstChild;i?.childNodes.length===1&&s?.nodeType===1&&s?.tagName==="A"&&s?.childNodes.length===1&&s?.firstChild?.nodeType===3?s.setAttribute("contenteditable","true"):i?.setAttribute("contenteditable","true")}}[...e.parentElement?.querySelectorAll("strike, s")||[]].forEach(o=>o.style.textDecoration="line-through"),[...e.parentElement?.getElementsByTagName("u")||[]].forEach(o=>o.style.textDecoration="underline")}}function oF(e,t){const n=t.getSelectedText(),r=window.getSelection(),o=t.getRangeFromSelection(r);let i=null,s=null,a=null;function l(c){let u=c;u.nodeType===Node.TEXT_NODE&&(u=u.parentNode);const d=u?.closest("em-replace");return e?d?.textContent||null:d?.getAttribute("text")||null}return o&&(n?(s=l(o.startContainer),a=l(o.endContainer),s?.length&&a?.length&&s!==a&&(s=a=null)):i=l(o.commonAncestorContainer)),n?s||a:i}function iF(e,t){let n=t.getVariableByIcon(e)||!t.htmlDocument.getMappedParent(e)?e:t.htmlDocument.getVisibleNode(e);if(n.closest("a")&&t.findOutermostParentWithText(n,"a")&&n.tagName!=="IMG"&&n.tagName!=="AMP-IMG"&&(n=t.findOutermostParentWithText(n,"a")),n?.closest(".em-vindent")){const r=n.closest('div[style*="height"][style*="line-height"]');r?n=r:n=n.closest("td")}return n.tagName==="DIV"&&n.closest("amp-accordion")&&setTimeout(()=>{t.sendResizeEvent()},350),(n?.closest(".em-element-resize-img")||n?.closest(".em-element-img-change-group")||n?.closest(".em-element-resize-img-container"))&&(n=n.closest(".em-element-resize-img-container").querySelector("img")),(n.tagName==="TD"&&n.classList.contains("em-mob-wrap")&&(n.cellIndex+1)%2===0||n.closest(".em-gap"))&&(n=Pf(n)??n),n}function sF(e,t){const{elem:n,isCellCustomTable:r,listContext:o,requestElemBullet:i,variableElement:s}=e,{isListOL:a,isListUL:l,isList:c}=o;return{Locale:t.Locale,isProgrammaticSelection:t.isProgrammaticSelection,isCellCustomTable:r,extractorContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c},customTableContext:{getElementTdDiv:t.getElementTdDiv,parseTableElementToModel:t.parseTableElementToModel,extractBorderRadius:t.extractBorderRadius,parseBackgroundStyles:t.parseBackgroundStyles,getFontFamilyFromElement:t.getFontFamilyFromElement,textHasStyle:t.textHasStyle,isElementHasBold:t.isElementHasBold,getLineHeghtInPixels:t.getLineHeghtInPixels,activeCell:t.activeCell,CLASS_FOR_BASIC_CELL:t.CLASS_FOR_BASIC_CELL,requestElemWithStyle:t.requestElemWithStyle},elementContext:{getElementTdDiv:t.getElementTdDiv,getLineHeghtInPixels:t.getLineHeghtInPixels},linkTextContext:{variableElement:s,requestElemBullet:i,isElementListOL:a,isElementListUL:l,isElementList:c,findElementWithSelectedText:t.findElementWithSelectedText,selectedText:t.getSelectedText()},_isCarouselElement:t._isCarouselElement,_isAccordionElement:t._isAccordionElement,_isSocialBlockElement:t._isSocialBlockElement,_isImageElement:t._isImageElement,_isLinkElement:t._isLinkElement,_isButtonElement:t._isButtonElement,_isTableElement:t._isTableElement,_isCustomTableElement:t._isCustomTableElement,_isAtomElement:t._isAtomElement,_isTdColumnGroup:t._isTdColumnGroup,_isTdStructure:t._isTdStructure,_isEmptyTd:t._isEmptyTd,_isTdCell:t._isTdCell,_isVindentTd:t._isVindentTd,_isVindentDiv:t._isVindentDiv,_isFloatBlockElement:t._isFloatBlockElement,_isDivTextElement:t._isDivTextElement,_isInlineButtonElement:t._isInlineButtonElement,_extractTextSettings:t._extractTextSettings,_extractCarouselSettings:t._extractCarouselSettings,_extractAccordionSettings:t._extractAccordionSettings,_extractSocialSettings:t._extractSocialSettings,_extractImgSettings:t._extractImgSettings,_extractButtonSettings:t._extractButtonSettings,_extractLinkTextSettings:t._extractLinkTextSettings,_extractTableSettings:t._extractTableSettings,_extractCustomTableSettings:t._extractCustomTableSettings,_extractAtomElementSettings:t._extractAtomElementSettings,_extractProgrammaticElementSettings:t._extractProgrammaticElementSettings,_extractTdColumnGroupSettings:t._extractTdColumnGroupSettings,_extractTdStructureSettings:t._extractTdStructureSettings,_extractTdCellSettings:t._extractTdCellSettings,_extractVindentSettings:t._extractVindentSettings,_extractFloatBlockSettings:t._extractFloatBlockSettings,_extractDivContainerSettings:t._extractDivContainerSettings,_clearActiveEditElements:t._clearActiveEditElements,HTMLDocument:t.HTMLDocument,parseFromString:t.parseFromString,getParentElementOfSelection:t.getParentElementOfSelection}}function aF(e){return["EM-REPLACE","EDITOR","B","STRONG","U","S","STRIKE","SPAN","FONT","I","EM","P","A","H1","H2","H3","H4","H5","H6","SUP","SUB"].includes(e)}function lF(e,t,n){const{Locale:r,isProgrammaticSelection:o,isCellCustomTable:i}=n;if(!t&&!e.closest("a")&&!o&&!i){let s=e;e.querySelector("editor")&&(s=n.getParentElementOfSelection());const a=n._extractTextSettings({elem:s},r,n.extractorContext);return{type:a.type,caption:a.caption,settings:a}}if(n._isCarouselElement(e)){const s=n._extractCarouselSettings({elem:e},r,{clearActiveEditElements:n._clearActiveEditElements});return{type:s.type,caption:s.caption,settings:s}}if(n._isAccordionElement(e)){const s=n._extractAccordionSettings({elem:e},r,{clearActiveEditElements:n._clearActiveEditElements,HTMLDocument:n.HTMLDocument,parseFromString:n.parseFromString});return{type:s.type,caption:s.caption,settings:s}}if(n._isSocialBlockElement(e)){const s=n._extractSocialSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isImageElement(e)){const s=n._extractImgSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isLinkElement(e,i)){if(n._isButtonElement(e)){const l=n._extractButtonSettings({elem:e},r),c={type:l.type,caption:l.caption,settings:l};return e.getAttribute("new")&&(c.isNewLink=!0),c}const s=n._extractLinkTextSettings({elem:e},r,n.linkTextContext),a={type:s.type,caption:s.caption,settings:s};return e.getAttribute("new")&&(a.isNewLink=!0),a}if(n._isTableElement(e)){const s=n._extractTableSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s.type!=="emptyTable"?s:{}}}if(e.tagName==="LI"&&fc(e)){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(n._isCustomTableElement(e)){const s=n._extractCustomTableSettings({elem:e},r,n.customTableContext);return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isAtomElement(e)){const s=n._extractAtomElementSettings({elem:e},r,n.elementContext);return{type:s.type,caption:s.caption,settings:s,removeEmEdit:!0,setEmEditOnTd:!0}}if(o){const s=n._extractProgrammaticElementSettings({elem:e},r,n.elementContext);return s.settings?{type:s.settings.type,caption:s.settings.caption,settings:s.settings,removeEmEdit:!0,editTargetTd:s.editTargetTd,shouldResetProgrammaticSelection:s.shouldResetProgrammaticSelection}:{type:null,settings:{},shouldResetProgrammaticSelection:!0}}if(n._isTdColumnGroup(e)){const s=n._extractTdColumnGroupSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isTdStructure(e)){const s=n._extractTdStructureSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isEmptyTd(e))return{type:"emptyTd",settings:{}};if(n._isTdCell(e)){const s=n._extractTdCellSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s.settings}}if(n._isVindentTd(e)){const s=n._extractVindentSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isVindentDiv(e)){const s=n._extractVindentSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isFloatBlockElement(e)){const s=n._extractFloatBlockSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(n._isDivTextElement(e)){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}if(e.tagName==="DIV"||e.tagName==="TD"&&e.firstChild?.tagName==="EDITOR"){const s=n._extractDivContainerSettings({elem:e},r,{getElementTdDiv:n.elementContext.getElementTdDiv});return{type:s.type,caption:s.caption,settings:s}}if(aF(e.tagName)&&(e.tagName!=="EM-REPLACE"||!e.closest("a"))){if(n._isInlineButtonElement(e)){const s=n._extractButtonSettings({elem:e},r);return{type:s.type,caption:s.caption,settings:s}}if(!o){const s=n._extractTextSettings({elem:e},r,n.extractorContext);return{type:s.type,caption:s.caption,settings:s}}}return{type:null,settings:{}}}var cF={_isCarouselElement:o7,_isAccordionElement:F6,_isSocialBlockElement:x7,_isImageElement:y7,_isLinkElement:e7,_isButtonElement:J6,_isTableElement:B7,_isCustomTableElement:i7,_isAtomElement:l7,_isTdColumnGroup:H7,_isTdStructure:F7,_isEmptyTd:$7,_isTdCell:W7,_isVindentTd:zH,_isVindentDiv:UH,_isFloatBlockElement:g7,_isDivTextElement:FH,_isInlineButtonElement:t7,_extractTextSettings:PH,_extractCarouselSettings:n7,_extractAccordionSettings:H6,_extractSocialSettings:O7,_extractImgSettings:b7,_extractButtonSettings:Q6,_extractLinkTextSettings:$H,_extractTableSettings:D7,_extractCustomTableSettings:s7,_extractAtomElementSettings:d7,_extractProgrammaticElementSettings:f7,_extractTdColumnGroupSettings:z7,_extractTdStructureSettings:U7,_extractTdCellSettings:V7,_extractVindentSettings:VH,_extractFloatBlockSettings:h7,_extractDivContainerSettings:a7,_clearActiveEditElements:r2};function uF(e){const t=e.programmaticSelection??{get:()=>!!O.get("isProgrammaticSelection"),reset:()=>O.set("isProgrammaticSelection",!1)},n=()=>{const o={operation:"application_element_settings_set",settings:e.getMapObj().unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};K.send(o)},r=o=>{if(O.isActiveElementLocked())return;const i=o.elem??document.querySelector("[em-edit]");try{if(O.increment("activeElementLocked"),ur("em-edit"),!i){setTimeout(()=>{const y=document.querySelector("[em-edit]");y?.isConnected?r({elem:y}):n()},0);return}if(i.closest(".em-prevent-action"))return;const s=iF(i,{getVariableByIcon:Vl,htmlDocument:e.htmlDocument,findOutermostParentWithText:Gu,sendResizeEvent:q1}),a=s.tagName==="EDITOR"&&s.firstChild?.nodeType===1?s.firstChild:s,l=mc(s),c=window.getSelection()?.isCollapsed??!0;rF(s,c,!!s.querySelector("editor"),{removeAllAttributes:ur});const u={...cF,HTMLDocument:e.htmlDocument,parseFromString:Ie,getParentElementOfSelection:Ga,getSelectedText:Ze,findElementWithSelectedText:qi,parseTableElementToModel:Ns,extractBorderRadius:t6,parseBackgroundStyles:VB,isElementHasBold:KN,Locale:Os(),isProgrammaticSelection:t.get(),getElementTdDiv:_6,getLineHeghtInPixels:sc,getFontFamilyFromElement:y=>ZH(y,a),textHasStyle:Qe,activeCell:O.get("activeCell"),CLASS_FOR_BASIC_CELL:ae,requestElemWithStyle:a},d=sF({elem:s,isCellCustomTable:!!s.closest(".em-element-custom-table"),listContext:{isListOL:l.isListOL,isListUL:l.isListUL,isList:l.isList},requestElemBullet:l.isList?jH(s):null,variableElement:(y,w=!1)=>oF(w,{getSelectedText:Ze,getRangeFromSelection:QH})},u),f=lF(s,c,d),p={operation:"application_element_settings_set",type:f.type,caption:f.caption,settings:f.settings},m=nF(s,f,p,{removeAllAttributes:ur});if(m.isProgrammaticSelectionReset&&t.reset(),m.shouldReturn)return;const h=tF({elem:s,message:p,activateSection:o.activateSection},{getElementParentCaption:yS,getStructureColumns:k6,getUsedColors:X1,getElementPath:B6,getCurrentElementPath:R6,mapObj:e.getMapObj(),commonStyles:O.get("commonStyles"),...e.enrichExtras()});O.update({elementPath:h.elementPath}),e.fingerprint.remember(s),K.send(h.message)}finally{Promise.resolve().then(()=>{e.fingerprint.remember(document.querySelector("[em-edit]")),O.decrement("activeElementLocked")})}};return r}function aw(){return O.get("emailWidth")}function dF(e){const t=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let n=0;n<t.length;n++){const r=t[n];if(r.classList.contains("em-insert-ignore"))continue;const o=r.getAttribute("width");if(o!=null&&o!=="")return!0}return!1}function km(e){const t=document.createElement("table");return t.replaceChildren(...Ie(e,!0)),t}function Lm(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>Xt(r)).join(`
|
|
91
|
+
`);const n=e.querySelector("tr");return n?Xt(n):bt(e)}function Nm(e,t){const n=aw(),r=km(e.blockHTML);let o=660;if(e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){o=0;const s=r.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(document.body.clientWidth>(n||s))o=e.targetBlock.clientWidth;else{const a=e.targetBlock.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(a&&a.parentElement){a.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(d=>{o+=parseFloat(d.getAttribute("width")||"0")});const l=a.parentElement.closest("td"),c=parseFloat(l?.style.paddingLeft||"0")||0,u=parseFloat(l?.style.paddingRight||"0")||0;o+=c,o+=u}}}else if(e.targetBlock.closest(".container-td"))o=parseInt(String(e.targetBlock.offsetWidth));else{const s=e.targetBlock.querySelector('table[style*="max-width"]'),a=e.targetBlock.querySelector('div[style*="max-width"]'),l=e.targetBlock.querySelector('.row-content[style*="width"]');s?o=parseInt(String(s.offsetWidth)):a?o=parseInt(String(a.offsetWidth)):l?o=parseInt(String(l.offsetWidth)):o=e.targetBlock.style.maxWidth?parseFloat(e.targetBlock.style.maxWidth):e.targetBlock.getBoundingClientRect().width}let i=r.querySelector(".em-mob-wrap:empty, .noresp-em-mob-wrap:empty")?660:e.project==="useblocks"?640:660;if(r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){i=0;const s=r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(s&&s.parentElement){s.parentElement.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").forEach(u=>{i+=parseFloat(u.getAttribute("width")||"0")});const a=s.parentElement.closest("td"),l=parseFloat(a?.style.paddingLeft||"0")||0,c=parseFloat(a?.style.paddingRight||"0")||0;i+=l,i+=c}}if(r.querySelector('div[style*="inline-block"]')){if(o<660&&r.querySelector('div[style*="inline-block"]'))if(r.querySelectorAll('div[style*="inline-block"]').length>1)r.querySelectorAll('div[style*="inline-block"]').forEach(s=>{const a=s,l=parseFloat(a.style.width),c=l/i,u=s.firstElementChild;if(!u)return;const d=l-parseFloat(u.getAttribute("width")||"0"),f=parseFloat(String(o*c));a.style.width=f+"px",u.setAttribute("width",String(f-d)),Xa({elem:a,width:f})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",Xa({elem:s,width:o}),s.firstElementChild&&(s.firstElementChild.setAttribute("width",String(Math.round(o*.91))),s.firstElementChild.style.maxWidth=Math.round(o*.91)+"px")}}else if(r.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")){const s=[];r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(function(a){const l=jg(a);l&&s.indexOf(l)===-1&&s.push(l)}),s.forEach(a=>{const l=a.querySelector(".em-mob-wrap, .noresp-em-mob-wrap");if(!l||!l.parentElement)return;const c=l.parentElement.closest("td"),u=parseFloat(c?.style.paddingLeft||"0")||0,d=parseFloat(c?.style.paddingRight||"0")||0;if(a.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length>1){if(!dF(a))return;const f=a.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),p=f?parseFloat(f.getAttribute("width")||"0"):0,m=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let h=0,y=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const b=parseFloat(k.getAttribute("width"))/i,v=Math.round(parseFloat(String(o*b))-p/(m*2));k.setAttribute("width",String(v)),h+=v}});const w=o-(u+d+p*(m-1)+h);a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const b=parseFloat(k.getAttribute("width"))+Math.round(w/m);y+=b,k.setAttribute("width",String(b)),k.querySelector("img")&&k.querySelectorAll("img").forEach(v=>{parseFloat(v.getAttribute("width")||"0")>parseFloat(k.getAttribute("width"))+Math.round(w/m)&&(v.setAttribute("width",k.getAttribute("width")),v.style.maxWidth=k.getAttribute("width")+"px")})}}),y=y+p*(m-1)+u+d;const A=o-y;if(A!==0&&h>0){const k=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(k&&!k.classList.contains("em-insert-ignore")){const b=parseFloat(k.getAttribute("width")||"0");k.setAttribute("width",String(b+A))}else{const b=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let v=b.length-1;v>=0;v--){const S=b[v];if(S.classList.contains("em-insert-ignore"))continue;const T=parseFloat(S.getAttribute("width")||"0");S.setAttribute("width",String(T+A));break}}}}else if(l.getAttribute("width")&&!l.classList.contains("em-insert-ignore")){const f=Math.round(o-u-d);l.setAttribute("width",String(f))}})}return Lm(r)}function xm(e){const t=km(e),n=!!document.querySelector(".noresp-em-narrow-table");return t.querySelectorAll(".em-mob-wrap[width], .noresp-em-mob-wrap[width]").forEach(r=>{const o=parseFloat(r.getAttribute("width")||"0");o&&r.querySelectorAll('[em="atom"] img:not(.em-countdown)').forEach(i=>{parseFloat(i.getAttribute("width")||"0")<=o||(i.setAttribute("width",String(o)),n||(i.style.maxWidth=o+"px"))})}),Lm(t)}function Om(e,t){const n=aw(),r=km(e.blockHTML);let o=660;const i=e.targetBlock.tagName==="TR"?document.createElement("table"):document.createElement("div");if(i.style.width=n+"px",i.style.height="1000px",i.style.borderCollapse="collapse",i.setAttribute("cellpadding","0"),i.setAttribute("cellspacing","0"),i.style.position="absolute",i.style.top="-9999px",i.style.left="-9999px",document.body.appendChild(i),i.innerHTML=t.getOuterHtml(e.targetBlock),n)o=n;else{const a=i.querySelector('table[style*="max-width"]'),l=i.querySelector('div[style*="max-width"]'),c=i.querySelector('.row-content[style*="width"]');if(a)o=parseInt(String(a.offsetWidth));else if(l)o=parseInt(String(l.offsetWidth));else if(c)o=parseInt(String(c.offsetWidth));else{const u=i.querySelector(e.targetBlock.tagName);o=u?.style.maxWidth?parseFloat(u.style.maxWidth):u?.getBoundingClientRect().width||660}}document.body.removeChild(i);const s=r.querySelector("table:first-child");return s?.style.maxWidth&&(s.style.maxWidth=o+"px",Xa({elem:s,width:o})),Lm(r)}function pc(e){const t=e.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap");if(!t.length)return;const n=e.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),r=Array.from(n).filter(u=>!u.classList.contains("em-insert-ignore")&&u.getAttribute("width")!=null&&u.getAttribute("width")!=="");if(r.length===0)return;const o=e.parentElement?.getBoundingClientRect().width||0;let i=0,s=0;t.forEach(u=>{i+=parseFloat(u.getAttribute("width")||"0")});let a=e.querySelector(".em-mob-wrap");for(;a&&a!==e.parentElement?.parentElement;){const u=window.getComputedStyle(a),d=parseFloat(u.paddingLeft)||0,f=parseFloat(u.paddingRight)||0;(d>0||f>0)&&(s+=d+f),a=a.parentElement}const l=o-(i+s),c=r.length;r.forEach(u=>{const d=parseFloat(u.getAttribute("width")||"0")+Math.ceil(l/c);u.setAttribute("width",String(d))})}var fF=new Set(["alt","title","link"]);function mF(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>fF.has(o))&&e.parentNode===t.parent}function pF(e){let t=e?.parentElement??null;for(;t&&!t.tagName.startsWith("AMP-");)t=t.parentElement;const n=e?.tagName??"",r=t&&e?Array.from(t.getElementsByTagName(n)).indexOf(e):-1;return{root:t,tag:n,index:r,parent:e?.parentNode??null}}function hF(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||mF(e,n,r))return null;const s=i.tagName.startsWith("AMP-"),a=s&&i===n.root&&n.index>=0,l=s?Array.from(i.querySelectorAll("section"),f=>f.hasAttribute("expanded")):[],c=Zn(o.getOuterHtml(i),([f])=>(i.parentNode?.replaceChild(f,i),f));let u=c;const d=a?c.getElementsByTagName(n.tag)[n.index]??null:null;return d?u=d:t?.tagName==="A"&&c.tagName!=="A"&&(u=c.querySelector("a")??c),u.setAttribute("em-edit","active"),{active:u,afterCommit:()=>{o.applyHidden(()=>c.querySelectorAll("section").forEach((f,p)=>{l[p]&&f.setAttribute("expanded","")}))}}}function gF(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?Cr(i):null,a=o?Cr(o):null,l=!!s&&!a,c=Qf(o),u=e.outlookRounding===!0||e.outlookRounding!==!1&&(l||c)?o:i;if(e.exportAsPicture?n.closest("table")?.setAttribute("em-operation","exportAsPicture"):n?.closest("table")?.getAttribute("em-operation")==="exportAsPicture"&&n.closest("table")?.removeAttribute("em-operation"),e.href!==void 0&&n.closest("a")?.setAttribute("href",e.href),e.align){const m=n.closest("td")?.closest("table")?.closest("div, p, td");m&&(m.style.textAlign?m.style.textAlign=e.align:m.setAttribute("align",e.align))}else if(e.align===""){const m=n.closest("td")?.closest("table")?.closest("div, p, td");m&&(m.style.textAlign?m.style.removeProperty("text-align"):m.removeAttribute("align"))}if(e.textAlign){const m=n.closest("td");m&&(m.style.textAlign?m.style.textAlign=e.textAlign:m.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const m=n.closest("td");m&&(m.style.textAlign?m.style.removeProperty("text-align"):m.removeAttribute("align"))}if(e.valign?n.closest("td")?.closest("table")?.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&n.closest("td")?.closest("table")?.closest("td")?.removeAttribute("valign"),e.width){const m=n.closest("table");m&&(e.width.value?(m.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),m.style.width=e.width.value+e.width.dim):(m.removeAttribute("width"),m.style.removeProperty("width")))}if(e.height){const m=n.closest("td"),h=n.closest("a");if(e.height.value){if(m&&(m.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),m.style.height=e.height.value+e.height.dim),h){const y=e.height.value+e.height.dim;h.style.height=y,h.style.lineHeight=y,h.firstElementChild&&(h.firstElementChild.style.lineHeight=y);const w=h.closest("editor")||h.querySelector("editor");w&&(w.style.height=y,w.style.lineHeight=y)}}else if(m&&(m.removeAttribute("height"),m.style.removeProperty("height")),h){h.style.removeProperty("height"),h.style.removeProperty("line-height");const y=h.closest("editor")||h.querySelector("editor");y&&(y.style.removeProperty("height"),y.style.removeProperty("line-height"))}}if(e.border&&u&&t.setElementBorder({settings:e,elem:u}),e.boxShadow&&u&&t.setElementBoxShadow({settings:e,elem:u}),e.backgroundColor!==void 0&&u&&(e.backgroundColor===""?(u.removeAttribute("bgcolor"),u.style.removeProperty("background-color")):(u.tagName==="TD"&&u.setAttribute("bgcolor",e.backgroundColor),u.style.backgroundColor=e.backgroundColor)),e.backgroundImage){const m=n.closest("td");m&&(e.backgroundImage[0].value===""?(m.style.removeProperty("background-image"),m.removeAttribute("background")):(m.style.removeProperty("background-image"),Lt(m,"background",yF(e))))}if(e.backgroundPositionX!==void 0){const m=n.closest("td");m&&(e.backgroundPositionX===""?m.style.removeProperty("background-position-x"):m.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const m=n.closest("td");m&&(e.backgroundPositionY===""?m.style.removeProperty("background-position-y"):m.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const m=n.closest("td");m&&(e.backgroundRepeat==="none"?m.style.removeProperty("background-repeat"):m.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const m=n.closest("td");m&&(e.backgroundSize===""?m.style.removeProperty("background-size"):m.style.backgroundSize=e.backgroundSize)}if(e.padding){const m=n.closest("a");m&&(e.padding.all!==void 0?(m.style.paddingTop=e.padding.all+"px",m.style.paddingRight=e.padding.all+"px",m.style.paddingBottom=e.padding.all+"px",m.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(m.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(m.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(m.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(m.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&t.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const m=n.closest("table");m&&t.setElementMobileWidth({settings:e,elem:m}),r=!0}if(e.mobileHeight){const m=n.closest("td");m&&t.setElementMobileHeight({settings:e,elem:m}),t.setElementMobileLineHeight({settings:e,elem:n}),r=!0}if(e.mobileBorder){const m=n.closest("td");m&&t.setElementMobileBorder({settings:e,elem:m}),r=!0}if(e.mobileBorderRadius){const m=n.closest("td");m&&t.setElementMobileBorderRadius({settings:e,elem:m}),r=!0}if(e.mobileBoxShadow){const m=n.closest("td");m&&t.setElementMobileBoxShadow({settings:e,elem:m}),r=!0}if(e.mobileTextAlign){const m=Rs(n);m&&t.setElementMobileAlign({settings:e,elem:m,fieldName:"mobileTextAlign"}),r=!0}if(e.mobileAlign){const m=n.closest("td")?.closest("table");m&&t.setElementMobileTableAlign({settings:e,elem:m}),r=!0}if(e.mobileVerticalAlign){const m=n.closest("td");m&&t.setElementMobileVerticalAlign({settings:e,elem:m}),r=!0}if(e.mobileBackgroundColor){const m=n.closest("td");m&&t.setElementMobileBackgroundColor({settings:e,elem:m}),r=!0}if(e.mobileBackgroundImage){const m=n.closest("td");m&&t.setElementMobileBackgroundImage({settings:e,elem:m}),r=!0}if(e.mobileBackgroundPositionX){const m=n.closest("td");m&&t.setElementMobileBackgroundPositionX({settings:e,elem:m}),r=!0}if(e.mobileBackgroundPositionY){const m=n.closest("td");m&&t.setElementMobileBackgroundPositionY({settings:e,elem:m}),r=!0}if(e.mobileBackgroundRepeat){const m=n.closest("td");m&&t.setElementMobileBackgroundRepeat({settings:e,elem:m}),r=!0}const d=e;if(d.mobileBackgroundSize){const m=n.closest("td");m&&t.setElementMobileBackgroundSize?.({settings:d,elem:m}),r=!0}if(e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show){const m=n.closest("table");m&&t.setElementShow({settings:e,elem:m}),r=!0}const f=n.closest("a");if(f&&e.textColor!==void 0){const m=String(e.textColor||"");f.style.color=m,f.querySelectorAll('span[style*="color"], font[color]').forEach(h=>{h.style.removeProperty("color"),h.removeAttribute("color")})}if(f&&e.textBackgroundColor!==void 0){const m=String(e.textBackgroundColor||"");f.style.backgroundColor=m,f.querySelectorAll('span[style*="background-color"]').forEach(h=>{h.style.removeProperty("background-color")})}const p=["textColor","textBackgroundColor"];if(t.textStyleProperties.filter(m=>!p.includes(m)&&e.hasOwnProperty(m)).length>0)try{t.toggleTextStyle(n,{type:"button",settings:e})}catch{}return e.mobileFontSize&&(t.setElementMobileFontSize({settings:e,elem:n}),r=!0),e.textReplacer!==void 0&&bF(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?em(n,e):e.outlookRounding===!1?Y8(n):(s||c)&&em(n,e),i&&Ts(i,e,"inside"),r}function bF(e,t,n){if(e){const r=window.getSelection();if(!r||r.rangeCount===0)return;const o=r.getRangeAt(0),i=e.replace(/~~.*$/,""),s=o?.commonAncestorContainer,a=s?.nodeType===1?s:s.parentElement;let l=a?.closest("em-replace");const c=!!(/~~/.test(e)&&l);if(c&&a){const u=e.replace(/~~.*$/,"");a.setAttribute("text",u),a.innerHTML=u}if(!l&&r.rangeCount>0&&!o.collapsed){const u=document.querySelectorAll("em-replace");if(l=Array.prototype.find.call(u,d=>d.textContent?.trim()===r.toString().trim()&&r.toString().trim()!==""),!l){const d=document.querySelector('[em-edit="active"]');d?.textContent===o.toString()&&o.selectNodeContents(d);const f=e.replace(/~~.*$/,""),p=document.createElement("em-replace");p.setAttribute("text",f),o.surroundContents(p)}}if(!l&&r.rangeCount>0&&o.collapsed){let u=document.querySelector("em-replace");if(u){const d=document.querySelectorAll("em-replace"),f=/~$/;l=Array.prototype.find.call(d,p=>{const m=e,h=p.textContent||"";return m.length===1&&f.test(h)?!0:n(h,m)}),l&&(l.setAttribute("text",e),l.textContent=e),l||(u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse())}else u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse()}l&&!c&&(l.getAttribute("text")===l.innerHTML&&(l.innerHTML=e),l.setAttribute("text",e))}else if(e===""){const r=t?.closest("em-replace")||t?.querySelector("em-replace");if(r){const o=r.parentNode,i=r.firstChild,s=r.lastChild;if(r.getAttribute("text")!==r.innerHTML&&o)for(;r.firstChild;)o.insertBefore(r.firstChild,r);const a=document.createRange(),l=window.getSelection();i&&s&&l&&(a.setStartBefore(i),a.setEndAfter(s),l.removeAllRanges(),l.addRange(a)),r.remove()}}}function yF(e){return e.backgroundImage?.[0]?.value??""}function vF(e,t){const n=t.activeElement;let r=!1;if(!e)return r;e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align?n.style.textAlign?n.style.textAlign=e.align:n.setAttribute("align",e.align):e.align===""&&(n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align")),e.valign?n.style.verticalAlign=e.valign:e.valign===""&&n.style.removeProperty("vertical-align"),e.width&&(e.width.value?n.style.width=e.width.value+e.width.dim:n.style.removeProperty("width")),e.minWidth&&(e.minWidth.value?n.style.minWidth=e.minWidth.value+e.minWidth.dim:n.style.removeProperty("min-width")),e.maxWidth&&(e.maxWidth.value?n.style.maxWidth=e.maxWidth.value+e.maxWidth.dim:n.style.removeProperty("max-width")),e.height&&(e.height.value?n.style.height=e.height.value+e.height.dim:n.style.removeProperty("height")),e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?n.style.removeProperty("background-color"):n.style.backgroundColor=e.backgroundColor),e.backgroundImage&&(e.backgroundImage[0].value===""?n.style.removeProperty("background-image"):n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")"),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.padding&&(e.padding.all!==void 0?(n.style.paddingTop=e.padding.all+"px",n.style.paddingRight=e.padding.all+"px",n.style.paddingBottom=e.padding.all+"px",n.style.paddingLeft=e.padding.all+"px"):(e.padding.top&&(n.style.paddingTop=e.padding.top+"px"),e.padding.right&&(n.style.paddingRight=e.padding.right+"px"),e.padding.bottom&&(n.style.paddingBottom=e.padding.bottom+"px"),e.padding.left&&(n.style.paddingLeft=e.padding.left+"px"))),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileAlign&&(t.setElementMobileAlign({settings:e,elem:n}),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.mobileDirection&&(t.setElementMobileDirection({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),Ts(n,e,"inside"),r}function Rm(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Rm({elem:e.elem.previousSibling,width:e.width})}function EF(e,t){const n=t.activeElement;let r=!1;if(!e)return r;e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align?n.setAttribute("align",e.align):e.align===""&&n.removeAttribute("align"),e.width&&(e.width.value?(n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),n.style.width=e.width.value+e.width.dim,e.width.dim==="px"&&Rm({elem:n,width:e.width.value})):(n.removeAttribute("width"),n.style.removeProperty("width"))),e.maxWidth&&(e.maxWidth.value?(n.style.maxWidth=e.maxWidth.value+e.maxWidth.dim,Rm({elem:n,width:e.maxWidth.value})):n.style.removeProperty("max-width")),e.minWidth&&(e.minWidth.value?n.style.minWidth=e.minWidth.value+e.minWidth.dim:n.style.removeProperty("min-width")),e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")):(n.setAttribute("bgcolor",e.backgroundColor),n.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",Lt(n,"background",SF(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),e.mobileAlign&&(t.setElementMobileTableAlign({settings:e,elem:n}),r=!0),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),Ts(n,e,"around"),r}function SF(e){return e.backgroundImage?.[0]?.value??""}function Fs(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function wF(e,t){const n=t.activeElement;let r=!1;if(!e)return r;if(typeof e.linkHref=="string"){const i=document.querySelector("[em-edit]"),s=i?.tagName==="A"?i:i?.closest("a")??n.querySelector("a");s&&(s.setAttribute("href",e.linkHref),Fs(e.linkHref)&&s.removeAttribute("target"))}if(e.exportAsPicture?n.setAttribute("em-operation","exportAsPicture"):n.getAttribute("em-operation")==="exportAsPicture"&&n.removeAttribute("em-operation"),e.align){n.style.textAlign?n.style.textAlign=e.align:n.setAttribute("align",e.align);const i=n.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(s=>{s.querySelector(":scope > tr > td")?.setAttribute("align",e.align);const a=s.querySelector('div[style*="font-family"][style*="font-size"]');a?.hasAttribute("align")&&a.setAttribute("align",e.align)})}else if(e.align===""){n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align");const i=n.querySelectorAll('[em="atom"]');i.length>0&&i.forEach(a=>{a.querySelector(":scope > tr > td")?.removeAttribute("align")});const s=n.closest("table");if(s?.getAttribute("em")==="atom"){const a=s.querySelector('div[style*="font-family"][style*="font-size"]');a?.hasAttribute("align")&&a.removeAttribute("align")}}if(e.valign?(n.setAttribute("valign",e.valign),n.querySelectorAll('div[style*="display"]').forEach(i=>i.style.verticalAlign=e.valign)):e.valign===""&&n.removeAttribute("valign"),e.width){const i=n.closest("table");i?.getAttribute("em")==="atom"?e.width.value?i.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):i.removeAttribute("width"):e.width.value?n.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")):n.removeAttribute("width")}if(e.height)if(e.height.value){n.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),n.style.height=e.height.value+e.height.dim;const i=n.firstElementChild;i?.tagName==="A"&&i.style.display==="block"&&(i.style.height=e.height.value+e.height.dim,i.style.lineHeight=e.height.value+e.height.dim)}else n.removeAttribute("height"),n.style.removeProperty("height");if(e.border&&t.setElementBorder({settings:e,elem:n}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:n}),e.backgroundColor!==void 0&&(e.backgroundColor===""?(n.removeAttribute("bgcolor"),n.style.removeProperty("background-color")):(n.setAttribute("bgcolor",e.backgroundColor),n.style.backgroundColor=e.backgroundColor)),e.backgroundImage&&(e.backgroundImage[0].value===""?(n.style.removeProperty("background-image"),n.removeAttribute("background")):(n.style.removeProperty("background-image"),n.style.backgroundImage=e.backgroundImage[0].type+"("+e.backgroundImage[0].value+")",Lt(n,"background",TF(e)))),e.backgroundPositionX!==void 0&&(e.backgroundPositionX===""?n.style.removeProperty("background-position-x"):n.style.backgroundPositionX=e.backgroundPositionX),e.backgroundPositionY!==void 0&&(e.backgroundPositionY===""?n.style.removeProperty("background-position-y"):n.style.backgroundPositionY=e.backgroundPositionY),e.backgroundRepeat&&(e.backgroundRepeat==="none"?n.style.removeProperty("background-repeat"):n.style.backgroundRepeat=e.backgroundRepeat),e.backgroundSize!==void 0&&(e.backgroundSize===""?n.style.removeProperty("background-size"):n.style.backgroundSize=e.backgroundSize),e.direction&&e.direction!=="none"?(n.setAttribute("dir",e.direction),e.direction==="rtl"&&n.querySelectorAll("td").forEach(i=>{for(let s=i.firstChild;s;s=s.nextSibling)if(s.nodeType===3){s.parentNode?.setAttribute("dir","ltr");break}})):(e.direction===""||e.direction==="none")&&(n.removeAttribute("dir"),n.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),e.padding){if(e.padding.all!==void 0)n.style.paddingTop=e.padding.all+"px",n.style.paddingRight=e.padding.all+"px",n.style.paddingBottom=e.padding.all+"px",n.style.paddingLeft=e.padding.all+"px",n.querySelectorAll(".em-vindent").forEach(l=>l.remove());else{if(e.padding.top!==void 0){n.style.paddingTop=e.padding.top+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingTop")&&l.remove()}if(e.padding.right!==void 0){n.style.paddingRight=e.padding.right+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingRight")&&l.remove()}if(e.padding.bottom!==void 0){n.style.paddingBottom=e.padding.bottom+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingBottom")&&l.remove()}if(e.padding.left!==void 0){n.style.paddingLeft=e.padding.left+"px";for(const l of n.children)l.classList.contains("em-vindent-paddingLeft")&&l.remove()}}const i=n.querySelector(".em-mob-wrap"),s=n.parentElement?.getAttribute("em")==="block",a=e.padding.left!==void 0||e.padding.right!==void 0;i&&s&&a&&n.querySelectorAll(":scope > table").forEach(l=>t.setStructureBlocksWidth(l))}if(e.borderRadius&&t.setElementBorderRadius({settings:e,elem:n}),t.textStyleProperties.some(i=>e.hasOwnProperty(i))&&!t.isElementListContainer)try{t.toggleTextStyle(n,{settings:e})}catch{}if(t.isElementListContainer&&t.requestType!=="structure"&&t.requestType!=="column"&&t.textStyleProperties.some(i=>e.hasOwnProperty(i))&&AF(e,t),e.mobileWidth){const i=n.closest("table"),s=i?.getAttribute("em")==="atom";t.setElementMobileWidth({settings:e,elem:s?i:n}),r=!0}e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:n}),r=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:n}),r=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:n}),r=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:n}),r=!0),e.mobileAlign&&(CF(e,n,t),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.mobileDirection&&(t.setElementMobileDirection({settings:e,elem:n}),r=!0),e.mobileBackgroundColor&&(t.setElementMobileBackgroundColor({settings:e,elem:n}),r=!0),e.mobileBackgroundImage&&(t.setElementMobileBackgroundImage({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionX&&(t.setElementMobileBackgroundPositionX({settings:e,elem:n}),r=!0),e.mobileBackgroundPositionY&&(t.setElementMobileBackgroundPositionY({settings:e,elem:n}),r=!0),e.mobileBackgroundRepeat&&(t.setElementMobileBackgroundRepeat({settings:e,elem:n}),r=!0);const o=e;return o.mobileBackgroundSize&&(t.setElementMobileBackgroundSize?.({settings:o,elem:n}),r=!0),e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),"isContrastBlock"in e&&t.setContrastBlock({settings:e,elem:n}),Ts(n,e,"inside"),r}function CF(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";j6(t,(s,a)=>{G6(a,s,r),n.setElementMobileAlign({settings:e,elem:s})});function o(s){const a=s.querySelectorAll("table"),l=s.querySelector("table");a.length===1&&(l?.hasAttribute("width")&&l?.getAttribute("width")!=="100%"||!l?.hasAttribute("width"))&&n.setElementMobileTableAlign({elem:l,settings:{mobileAlign:{classNamePrefix:"em-mob-table_align-",value:e.mobileAlign.value}}})}const i=t.closest("table");i?.getAttribute("em")==="atom"?o(i):t.querySelectorAll('[em="atom"]').forEach(s=>o(s))}function AF(e,t){const n=t.activeElement,r=t.removeEditorTags(Ha(t.isElementListContainer)),o=t.addClassToSecondCell(r,"em-list-temp-class");ri(n,n.tagName==="TR"?`<td em-edit="active">${o}</td>`:o);const i=window.getSelection();if(!i||i.rangeCount===0)return;let s=i.getRangeAt(0);const a=n.querySelectorAll(".em-list-temp-class");if(a.length>0){t.isProgrammaticSelection.value=!0;for(let l=0;l<a.length;l++){const c=a[l].querySelector("div");if(!c)continue;t.wrapEditor(c,!0),s=i.getRangeAt(0),s.selectNode(c),t.addNewRange(s);const u=c.innerHTML!==" "||c.innerHTML===" "&&(e.fontSize||e.textColor||e.lineHeight);if(t.textStyleProperties.some(d=>e.hasOwnProperty(d))&&u)try{t.toggleTextStyle(c,{settings:e})}catch{}}n.querySelectorAll(".em-list-temp-class").forEach(l=>l.classList.remove("em-list-temp-class")),n.removeAttribute("em-edit"),n.setAttribute("em-edit","active"),setTimeout(()=>{t.isProgrammaticSelection.value=!1},100),s=i.getRangeAt(0),s.selectNode(n),t.addNewRange(s)}}function TF(e){return e.backgroundImage?.[0]?.value??""}function Mm(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Mm({elem:e.elem.previousSibling,width:e.width})}function lw(e,t){let n=e.previousSibling;for(;n&&!(n.nodeName==="#comment"&&n.textContent?.includes("mso"));)n=n.previousSibling;const r=n?.textContent??"",o=r.lastIndexOf("<td");if(!n||o===-1)return;const i=r.slice(o),s=/\svalign="[^"]*"/i.test(i)?i.replace(/valign="[^"]*"/i,`valign="${t}"`):i.replace("<td",`<td valign="${t}"`);n.textContent=r.slice(0,o)+s}function _F(e,t){const n=t.activeElement;let r=!1;if(!e)return r;if(e.width){const o=e.gap?.value??0;if(e.width.value!==void 0&&e.width.value!==null)if(n.style.maxWidth)if(e.width.dim==="px"){const i=parseFloat(e.width.value+o),s=Math.round(parseFloat(e.width.value)/i*100);n.style.maxWidth=i+e.width.dim,Mm({elem:n,width:i}),n.firstElementChild?.tagName==="TABLE"&&(n.firstElementChild.setAttribute("width",e.width.value),n.firstElementChild.style.width=s+"%",n.firstElementChild.style.maxWidth=e.width.value+"px")}else n.style.width=parseFloat(e.width.value)+e.width.dim;else e.width.dim==="px"?(n.style.width=parseFloat(e.width.value+o)+e.width.dim,Mm({elem:n,width:parseFloat(e.width.value+o)}),n.firstElementChild?.tagName==="TABLE"&&n.firstElementChild.setAttribute("width",e.width.value)):n.style.width=parseFloat(e.width.value)+e.width.dim;else n.style.removeProperty("width")}if(e.gap&&!e.width){const o=parseFloat(e.gap.value??0);n.style.maxWidth?n.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const s=i,a=parseFloat(s.style.maxWidth),l=Math.round((a-o)/a*100);s.firstElementChild?.tagName==="TABLE"&&(s.firstElementChild.setAttribute("width",String(a-o)),s.firstElementChild.style.width=l+"%",s.firstElementChild.style.maxWidth=a-o+"px")}):n.parentElement?.querySelectorAll('div[style*="inline-block"]').forEach(i=>{const s=i;s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",String(parseFloat(s.style.width)-o))})}return e.valign&&(n.style.verticalAlign=e.valign,lw(n,n.style.verticalAlign)),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:n}),r=!0),e.mobileContentWidth&&(t.setElementMobileContentWidth({settings:e,elem:n.firstElementChild}),r=!0),e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:n}),r=!0),e.show&&(t.setElementShow({settings:e,elem:n}),r=!0),r}function Pm(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replace(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&Pm({elem:e.elem.previousSibling,width:e.width})}function hc(e){return!!(e.querySelector(".em-mob-wrap")||e.closest(".em-mob-wrap")||e.querySelector(".noresp-em-mob-wrap")||e.closest(".noresp-em-mob-wrap"))}function gc(e){return e.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?document.querySelector('[em-edit="active"]'):e.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement||null}function Im(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function kF(e,t){const n=t.activeElement;if(hc(n)){const r=gc(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"))}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Pm({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function LF(e,t){const n=t.activeElement;if(!hc(n))return;const r=n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?n.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement:n.closest(".em-mob-wrap, .noresp-em-mob-wrap")?.parentElement;if(!r)return;const o=r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),i=o.length,s=e.items.length,a=e.gap;i>=s?o.forEach((l,c)=>{if(c<s)l.setAttribute("width",e.items[c]);else{const u=l.previousElementSibling;(u?.classList.contains("em-mob-wrap")||u?.classList.contains("noresp-em-mob-wrap"))&&u?.remove(),l.remove()}}):(o.forEach((l,c)=>{l.setAttribute("width",e.items[c])}),e.items.forEach((l,c)=>{let u="";r.querySelector(".em-mob-wrap")?u=`<td width="${a}" class="em-mob-wrap"></td>
|
|
92
|
+
<td width="${l}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(u=`<td width="${a}" class="noresp-em-mob-wrap"></td>
|
|
93
|
+
<td width="${l}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),c>=i&&u&&Xn(r,"beforeend",u)}))}function NF(e,t){const n=t.activeElement;if(hc(n)){const r=gc(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(o=>{o.setAttribute("valign",e.valign)})}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,lw(o,o.style.verticalAlign)})}}function xF(e,t){const n=t.activeElement;if(hc(n)){const r=gc(n);if(!r)return;r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((o,i)=>{o.setAttribute("width",e.items[i])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)")),r.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(o=>{o.setAttribute("width",e.gap)})}else{const r=Im(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach((o,i)=>{const s=o;s.style.width=e.items[i]+e.gap+"px",Pm({elem:s.closest('div[style*="inline-block"]'),width:e.items[i]+e.gap}),s.firstElementChild?.tagName==="TABLE"&&s.firstElementChild.setAttribute("width",e.items[i])})}}function OF(e,t){const n=t.activeElement;let r=!1;const o=gc(n);return o&&o.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(i=>{t.setElementMobileHeight({settings:e,elem:i}),r=!0}),r}var Dm="amp-img";function RF(e){const t=kS(e);return{src:t.src,alt:t.alt,title:t.title,width:t.width.value,height:t.height.value,link:t.link,imgReplacer:t.imgReplacer}}function cw(e){return e==null||e===""?null:Number(e)}function MF(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:cw(e.width?.value),height:cw(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function Bm(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function PF(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(Dm).length<=1)return n;let r=e;for(;r.parentElement&&r.parentElement!==t&&(r.parentElement.tagName==="A"||r.parentElement.tagName==="EM-REPLACE");)r=r.parentElement;return r}function uw(e){e.replaceWith(...Array.from(e.childNodes))}function dw(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function IF(e,t,n,r){if(r.src!==n.src&&Lt(e,"src",r.src),r.alt!==n.alt&&e.setAttribute("alt",r.alt),r.title!==n.title&&e.setAttribute("title",r.title),r.width!==n.width&&e.setAttribute("width",String(r.width??"")),r.height!==n.height&&e.setAttribute("height",String(r.height??"")),r.imgReplacer!==n.imgReplacer){const o=Bm(e,t,"em-replace");if(!r.imgReplacer)o&&uw(o);else if(o)Lt(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Lt(i,"src",r.imgReplacer),dw(e,i)}}if(r.link!==n.link){const o=Bm(e,t,"a");if(!r.link)o&&uw(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),dw(Bm(e,t,"em-replace")??e,i)}}}function DF(e){const t=document.createElement(Dm);Lt(t,"src",e.src),t.setAttribute("alt",e.alt),t.setAttribute("title",e.title),t.setAttribute("width",String(e.width.value)),t.setAttribute("height",String(e.height.value)),t.setAttribute("layout","responsive");let n=t;if(e.imgReplacer){const r=document.createElement("em-replace");Lt(r,"src",e.imgReplacer),r.appendChild(t),n=r}if(e.link){const r=document.createElement("a");r.setAttribute("href",e.link),r.appendChild(n),n=r}return n}function BF(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function HF(e,t){const n=Array.from(e.querySelectorAll(Dm)),r=new Set,o=[];BF(t).forEach((i,s)=>{const a=i===void 0?void 0:n[i];if(!a||r.has(a)){o.push(t[s]);return}r.add(a),IF(a,e,RF(a),MF(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>PF(i,e).remove()),o.forEach(i=>e.appendChild(DF(i)))}function FF(e,t){const n=e,r=t.activeElement.closest("amp-carousel");r&&fw(r,t,o=>$F(o,n,t))}function fw(e,t,n){Zn(t.HTMLDocument.getOuterHtml(e),([r])=>{r instanceof Element&&(n(r),r.setAttribute("em-edit","active"),e.replaceWith(r))}),t.commit(!0)}function $F(e,t,n){typeof t.loop=="boolean"&&(t.loop?e.setAttribute("loop",""):e.removeAttribute("loop")),typeof t.autoplay=="boolean"&&(t.autoplay?e.setAttribute("autoplay",""):e.removeAttribute("autoplay")),Array.isArray(t.carouselImages)&&HF(e,t.carouselImages),"borderRadius"in t&&n.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:e})}function WF(e,t){const n=e,r=t.activeElement.closest("amp-accordion");r&&fw(r,t,o=>qF(o,n))}function qF(e,t){t.animate?e.setAttribute("animate",""):e.removeAttribute("animate"),t.expandSingleSection?e.setAttribute("expand-single-section",""):e.removeAttribute("expand-single-section"),e.querySelectorAll("section").forEach((n,r)=>{t.sections[r]?.expanded?n.setAttribute("expanded",""):n.removeAttribute("expanded")})}var qn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function zF(e){return e.closest('table[em-type="social"]')}function mw(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r instanceof HTMLElement)return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r instanceof HTMLElement)return r}return null}function UF(e,t,n){const r=mw(e),o=mw(t);if(!(!r||!o)){for(const{name:i,value:s}of Array.from(r.attributes))i.toLowerCase()!=="align"&&o.setAttribute(i,s);o.setAttribute("align",n)}}function zn(e){return String(e??"").replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function VF(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function jF(){const e=[typeof document<"u"?document.baseURI:"",typeof window<"u"?window.location?.href:""];for(const t of e)if(t)try{const n=new URL(t);if(n.protocol==="http:"||n.protocol==="https:")return n.href}catch{}return""}function GF(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=jF();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function XF(e){return e>0?`<td width="${e}"> </td>`:""}function YF(e,t){const n=zF(t.activeElement);if(!n)return null;const r=Array.isArray(e.items)?e.items:[],o=e.align==="left"||e.align==="right"||e.align==="center"?e.align:qn.align,i=typeof e.iconSize=="number"?e.iconSize:qn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:qn.borderRadius,a=typeof e.gap=="number"?e.gap:qn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:qn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:qn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:qn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:qn.borderColor;let f=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:qn.buttonBorderWidth;f=Math.max(0,Math.min(24,Math.round(f)));const p=typeof e.showLabel=="boolean"?e.showLabel:qn.showLabel,m=[];u>0&&d&&m.push(`border:${u}px solid ${zn(d)}`);const h=m.length?` style="${m.join(";")}"`:"",y=!!(l&&String(c).trim()),w=Math.max(0,Math.round(Number(a)||0)),A=r.length>1,k=`<table border="0" cellspacing="0" cellpadding="0">
|
|
94
|
+
<tr>${r.map(S=>{const T=zn(S.platform||"unknown"),g=!!S.customIcon,E=zn(S.href||""),C=String(S.title??"").trim(),_=C?` title="${zn(C)}"`:"",x=zn(S.alt||""),N=zn(GF(S.iconSrc||"")),W=S.iconWidth!=null&&!Number.isNaN(Number(S.iconWidth))?Number(S.iconWidth):i,R=S.iconHeight!=null&&!Number.isNaN(Number(S.iconHeight))?Number(S.iconHeight):i,M=g?"":typeof S.buttonBgColor=="string"?S.buttonBgColor.trim():"",te=!g&&y&&!M?String(c).trim():"",j=g?"":M||te,ne=!g&&!!te,re=g?"":typeof S.itemBorderColor=="string"?S.itemBorderColor.trim():"",Q=!g&&!!(M||re&&f>0||ne);let be=`<a href="${E}" target="_blank"${_} draggable="false"><img src="${N}" width="${W}" height="${R}" border="0" alt="${x}" draggable="false" style="display:block;${!g&&!Q&&s>0?`border-radius:${s}px;`:""}" /></a>`;if(p&&(S.title||S.alt)){const Y=VF(String(S.title||S.alt||""));be+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${Y}</span>`}const de=[];j&&de.push(`background-color:${zn(j)}`),re&&f>0&&de.push(`border:${f}px solid ${zn(re)}`),Q&&s>0&&de.push(`border-radius:${s}px`);const Ee=ne?' em-tray-cell-bg="1"':"",me=g?' em-custom-icon="1"':"",X=j&&/^#[0-9A-Fa-f]{3,8}$/.test(j)?` bgcolor="${zn(j)}"`:"",B=A?' draggable="true"':"";return`<td em-platform="${T}"${me}${Ee}${X}${de.length?` style="${de.join(";")}"`:""}${B}>${be}</td>`}).filter(Boolean).reduce((S,T,g)=>(g>0&&S.push(XF(w)),S.push(T),S),[]).join("")}
|
|
95
|
+
</tr>
|
|
96
|
+
</table>`,b=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${h}><tr><td align="${zn(o)}">
|
|
97
|
+
${k}
|
|
98
|
+
</td></tr></table>`,v=Ie(b,!0)[0];return v?(v instanceof HTMLTableElement&&UF(n,v,o),v.setAttribute("em-edit","active"),n.replaceWith(v),t.commit(!0),v):null}function KF(e,t){if(typeof e.textSuperscript!="boolean"&&typeof e.textSubscript!="boolean")return;const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),o=r.commonAncestorContainer;if(o?.tagName==="TABLE")return;const i=o.nodeType===1?o:o.parentElement;if(!i)return;function s(a,l){const c=i.closest(a),u=a==="sup"?"sub":"sup",d=i.closest(u);if(l){let f=!0;if(c&&t.isRangeMatching(c,r,r.collapsed))f=!1;else if(d)if(t.isRangeMatching(d,r,r.collapsed)){const p=t.unwrapTag(d);r.selectNodeContents(p)}else{const p=t.splitWrapper(d,r);r.selectNodeContents(p),setTimeout(()=>n.removeAllRanges(),100)}else if(c){const p=t.splitWrapper(c,r);r.selectNodeContents(p)}if(f)if(r.collapsed){const p=r.cloneRange();try{r.expand("word");const m=r.toString().trim();if(m){const h=t.wrapInTag(r,m,a),y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}else r.setStart(p.startContainer,p.startOffset),r.setEnd(p.endContainer,p.endOffset)}catch{r.setStart(p.startContainer,p.startOffset),r.setEnd(p.endContainer,p.endOffset)}}else{const p=r.cloneContents(),m=document.createElement("div");m.appendChild(p),t.unwrapNestedTags(m,a);const h=t.wrapInTag(r,m,a),y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}}else if(r.collapsed)if(c){const f=c.parentNode,p=t.unwrapTag(c),m=document.createRange();m.selectNodeContents(p),n.removeAllRanges(),n.addRange(m),t.cleanEmptyTags(f),c.parentNode||setTimeout(()=>n.removeAllRanges(),0)}else{const f=r.startContainer.parentElement?.closest(a);if(f){const p=t.unwrapTag(f),m=document.createRange();m.selectNodeContents(p),n.removeAllRanges(),n.addRange(m),t.cleanEmptyTags(f.parentNode)}}else{let f=[];const p=r.cloneContents(),m=document.createElement("div");if(m.appendChild(p),f=Array.from(m.querySelectorAll(a)),c){const y=Array.from(c.childNodes).some(k=>k.nodeType===1),w=t.unwrapTag(c),A=document.createRange();if(w.isConnected)A.selectNodeContents(w),n.removeAllRanges(),n.addRange(A);else{const k=c.parentNode;k&&(A.selectNodeContents(k),n.removeAllRanges(),n.addRange(A))}y&&t.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),t.commit();return}else{const y=r.commonAncestorContainer.parentElement?.closest(a)||r.startContainer.parentElement?.closest(a);y&&f.push(y)}f.length>0&&f.forEach(y=>{y.parentNode&&t.unwrapTag(y)});const h=m.cloneNode(!0).querySelector('[em-edit="active"]');if(h){r.deleteContents(),r.insertNode(h);const y=document.createRange();y.selectNodeContents(h),n.removeAllRanges(),n.addRange(y),t.cleanEmptyTags(h.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function ZF(e,t){if(e!==void 0){if(e===""){QF(t.activeElement);return}JF(e,t)}}function QF(e){const t=e?.closest("em-replace")||e?.querySelector("em-replace");if(!t)return;const n=t.parentNode,r=t.firstChild,o=t.lastChild;if(t.getAttribute("text")!==t.innerHTML)for(;t.firstChild;)n?.insertBefore(t.firstChild,t);const i=document.createRange(),s=window.getSelection();r&&o&&s&&(i.setStartBefore(r),i.setEndAfter(o),s.removeAllRanges(),s.addRange(i)),t.remove()}function JF(e,t){const n=window.getSelection();if(!n||n.rangeCount===0)return;const r=n.getRangeAt(0),o=e.replace(/~~.*$/,""),i=r.commonAncestorContainer,s=i.nodeType===1?i:i.parentElement;let a=s?.closest("em-replace");const l=/~~/.test(e)&&a;if(l){const c=e.replace(/~~.*$/,"");s?.setAttribute("text",c),s&&(s.innerHTML=c)}if(!a&&n.rangeCount>0&&!r.collapsed){const c=document.querySelectorAll("em-replace");if(a=Array.prototype.find.call(c,u=>u.textContent?.trim()===n.toString().trim()&&n.toString().trim()!==""),!a){const u=document.querySelector('[em-edit="active"]');u?.textContent===r.toString()&&r.selectNodeContents(u);const d=e.replace(/~~.*$/,""),f=document.createElement("em-replace");f.setAttribute("text",d),r.surroundContents(f)}}if(!a&&n.rangeCount>0&&r.collapsed){let c=document.querySelector("em-replace");if(c){const u=document.querySelectorAll("em-replace"),d=/~$/;a=Array.prototype.find.call(u,f=>{const p=e,m=f.textContent||"";return p.length===1&&d.test(m)?!0:t.compareStrings(m,p)}),a&&(a.setAttribute("text",e),a.textContent=e),a||(c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1))}else c=document.createElement("em-replace"),c.setAttribute("text",o),r.insertNode(c),c.innerHTML=o,r.collapse(!1)}a&&!l&&(a.getAttribute("text")===a.innerHTML&&(a.innerHTML=e),a.setAttribute("text",e))}function e$(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function pw(e){const t=e.commonAncestorContainer,n=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest?.("a[name]");if(!n)return null;try{const r=document.createRange();return r.selectNodeContents(n),e.compareBoundaryPoints(Range.START_TO_START,r)>=0&&e.compareBoundaryPoints(Range.END_TO_END,r)<=0?n:null}catch{return null}}function t$(e,t){if(!e||!t)return;const n=document.createRange(),r=window.getSelection();if(r)try{if(!e.isConnected||!t.isConnected)return;n.setStartBefore(e),n.setEndAfter(t),r.removeAllRanges(),r.addRange(n)}catch{}}function n$(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function r$(e,t){const n=window.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null;if(e===void 0||!e.trim()){let i=null;if(r&&!r.collapsed&&(i=pw(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;n$(i),t.commit(),t$(s,a)}return}const o=e$(e);if(o&&!(!n||!r||r.collapsed))try{const i=pw(r);if(i){i.setAttribute("name",o),t.commit();return}const s=document.createElement("a");s.setAttribute("name",o);const a=r.extractContents();s.appendChild(a),r.insertNode(s);const l=document.createRange();l.selectNodeContents(s),n.removeAllRanges(),n.addRange(l),t.commit()}catch{}}function o$(e,t){let n=!1,{activeElement:r,activeCell:o}=t;if(r||(r=document.querySelector(".remove-basic-cell")||document.querySelector(".em-temporary-active-cell-background-color")||document.querySelector(".em-active-table-cell")),!r)return n;const i=Object.keys(e)[0],s=r.closest(".em-element-custom-table");if(!s)return n;let a=t.parseTableElementToModel(s);if(r.tagName==="TD"&&(r=r.querySelector("div"),r?.setAttribute("em-edit","active")),r?.tagName==="TR"&&(r=r.querySelector("EDITOR")?.querySelector("div"),r?.setAttribute("em-edit","active")),i.includes("padding")&&!i.includes("cell_")&&i$(e,s,a,t),e.backgroundColor&&s$(e.backgroundColor,s),i.includes("backgroundImage")&&a$(e,s),i.includes("backgroundPosition")){const l=t.updateBackgroundPosition(s.getAttribute("style"),{settings:e});s.setAttribute("style",l)}return i.includes("backgroundSize")&&(s.style.backgroundSize=e.backgroundSize),i.includes("backgroundRepeat")&&(s.style.backgroundRepeat=e.backgroundRepeat),(e.borderAll||e.borderTop||e.borderRight||e.borderBottom||e.borderLeft)&&l$(e,i,s,t),i.includes("borderRadius")&&c$(e,s,t),i.includes("boxShadow")&&u$(e,s,t),n=d$(e,s,t)||n,i.includes("cell")&&f$(e,i,s,a,o,t),new Set(["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"]).has(i)&&b$(e,i,s,a,o,r,t),y$(s,t),Ts(s,e,"around"),n}function i$(e,t,n,r){const o=r.updateTablePadding(n,{settings:e});Me(t,r.tableModelToHtml(o))}function s$(e,t){t.getAttribute("data-bg-image")&&(t.removeAttribute("data-bg-image"),t.style.backgroundImage="",t.style.backgroundSize="",t.style.backgroundRepeat="",t.style.backgroundPosition=""),t.setAttribute("bgcolor",e)}function a$(e,t){if(t.getAttribute("bgcolor")&&t.removeAttribute("bgcolor"),e.backgroundImage?.[0]?.type==="url"){const n=e.backgroundImage[0].value;t.setAttribute("data-bg-image",n),t.style.backgroundImage=`url('${n}')`,t.style.backgroundSize="cover",t.style.backgroundRepeat="no-repeat",t.style.backgroundPosition="center"}}function l$(e,t,n,r){const o=t,i=e[o];let s="",a="";switch(o){case"borderAll":s="border",a=n.style.border;break;case"borderTop":s="border-top",a=n.style.borderTop;break;case"borderRight":s="border-right",a=n.style.borderRight;break;case"borderBottom":s="border-bottom",a=n.style.borderBottom;break;case"borderLeft":s="border-left",a=n.style.borderLeft;break;default:s="border",a=n.style.border}const l=n.getAttribute("border")||"",c=n.getAttribute("bordercolor")||"";let u=n.getAttribute("style")||"";const d=n.style.borderCollapse?`border-collapse: ${n.style.borderCollapse};`:"border-collapse: collapse;";if(["borderTop","borderRight","borderBottom","borderLeft"].includes(o)&&(n.style.border||l)){u=r.removeStyleProperty(u,"border");const p=n.style.border?n.style.border:`${l||"1"}px solid ${c||"#b9b1b1"}`;u=`border-top: ${p}; border-right: ${p}; border-bottom: ${p}; border-left: ${p}; ${u};`}let f=a?`${s}: ${a};`:`${s}: ${l||"1"}px solid ${c||"#b9b1b1"};`;n.removeAttribute("border"),n.removeAttribute("bordercolor"),n.removeAttribute("border-collapse"),u=r.removeStyleProperty(u,s),u=r.removeStyleProperty(u,"border-collapse"),s==="border"&&["border-top","border-right","border-bottom","border-left"].forEach(p=>{u=r.removeStyleProperty(u,p)}),["borderTop","borderRight","borderBottom","borderLeft"].includes(o)&&(u=r.removeStyleProperty(u,"border")),i?.style===""&&(f=""),i?.color&&f&&(f=f.replace(/(#([0-9A-Fa-f]{3}){1,2}\b)|(rgba?\([^)]*\))/g,i.color)),i?.width&&f&&(f=f.replace(/\b\d+(\.\d+)?px\b/g,`${i.width}px`)),i?.style&&f&&(f=f.replace(/solid|dashed|dotted/g,i.style)),f=`${f}${u?` ${u}`:""}`,n.setAttribute("style",f?`${d} ${f}`:"")}function c$(e,t,n){const r=e.borderRadius,o=t.getAttribute("border")||"",i=t.getAttribute("bordercolor")||"";let s=t.getAttribute("style")||"";if(r?.all){const l=`border-radius: ${r.all}px ${r.all}px ${r.all}px ${r.all}px;`;if(s)s=n.removeStyleProperty(s,"border-radius"),s=n.removeStyleProperty(s,"border-collapse"),t.setAttribute("style",`${s}; border-collapse: separate; ${l}`);else{const c=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${l}`;t.setAttribute("style",c),t.removeAttribute("border"),t.removeAttribute("bordercolor")}}const a=["topLeft","topRight","bottomRight","bottomLeft"];a.forEach(l=>{if(r?.[l])if(s){const c=n.updateBorderRadius(t.getAttribute("style"),l,r[l]);t.setAttribute("style",c)}else{const c={topLeft:"0",topRight:"1",bottomRight:"2",bottomLeft:"3"},u=["0","0","0","0"];u[parseInt(c[l])]=`${r[l]}px`;const d=`border-radius: ${u.join(" ")};`,f=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${d}`;t.setAttribute("style",f)}}),(r?.all||a.some(l=>r?.[l]))&&(t.removeAttribute("border"),t.removeAttribute("bordercolor"))}function u$(e,t,n){const r=e.boxShadow;if(!r)return;const o=t.getAttribute("border")||"",i=t.getAttribute("bordercolor")||"";let s=t.getAttribute("style")||"";const a=`box-shadow: ${r.color} ${r.hOffset}px ${r.vOffset}px ${r.blurRadius}px ${r.spreadRadius}px${r.inset?" inset":""};`;if(s)s=n.removeStyleProperty(s,"box-shadow"),s=n.removeStyleProperty(s,"border-collapse"),t.setAttribute("style",`${s}; border-collapse: separate;${r.color?` ${a}`:""}`);else{const l=`border-collapse: separate; border: ${o||"1"}px solid ${i||"#b9b1b1"}; ${a}`;t.setAttribute("style",l),t.removeAttribute("border"),t.removeAttribute("bordercolor")}}function d$(e,t,n){let r=!1;e.mobileWidth&&(n.setElementMobileWidth({settings:e,elem:t}),t.removeAttribute("width"),r=!0),e.mobileHeight&&(n.setElementMobileHeight({settings:e,elem:t}),r=!0),e.show&&(n.setElementShow({settings:e,elem:t}),r=!0),e.mobileBackgroundColor&&(n.setElementMobileBackgroundColor({settings:e,elem:t}),r=!0);const o=e;if(o.mobileBackgroundImage&&(n.setElementMobileBackgroundImage?.({settings:o,elem:t}),r=!0),o.mobileBackgroundPositionX&&(n.setElementMobileBackgroundPositionX?.({settings:o,elem:t}),r=!0),o.mobileBackgroundPositionY&&(n.setElementMobileBackgroundPositionY?.({settings:o,elem:t}),r=!0),o.mobileBackgroundRepeat&&(n.setElementMobileBackgroundRepeat?.({settings:o,elem:t}),r=!0),o.mobileBackgroundSize&&(n.setElementMobileBackgroundSize?.({settings:o,elem:t}),r=!0),e.mobileBoxShadow){if(e.mobileBoxShadow.color!==""&&n.setElementMobileBoxShadow({settings:e,elem:t}),e.mobileBoxShadow.color===""){const i=t.getAttribute("class")||"",s=n.removeClassByPrefix(i,e.mobileBoxShadow.classNamePrefix);t.setAttribute("class",s)}r=!0}if(e.mobileBorder&&(t.removeAttribute("border"),t.removeAttribute("bordercolor"),n.setElementMobileBorder({settings:e,elem:t}),r=!0),e.mobileBorderRadius){if(t.getAttribute("border")&&t.getAttribute("bordercolor")){const s={mobileBorder:{all:{collor:t.getAttribute("bordercolor"),width:t.getAttribute("border"),style:"solid",classNamePrefix:"em-mob-border_all-"}}};n.setElementMobileBorder({settings:s,elem:t}),t.removeAttribute("border"),t.removeAttribute("bordercolor")}n.setElementMobileBorderRadius({settings:e,elem:t});const i=Object.keys(e.mobileBorderRadius).find(s=>s!=="classNamePrefix");if(i&&e.mobileBorderRadius[i]===0){const s=t.getAttribute("class")||"";t.setAttribute("class",n.removeClassByPrefix(s,e.mobileBorderRadius.classNamePrefix))}r=!0}return r}function f$(e,t,n,r,o,i){const s=[ae,ie];if(t.includes("cellBackgroundColor")){n.querySelector(".remove-basic-cell")&&(o=i.getCellsWithClasses(r,s),i.state.set("activeCell",o));const a=i.updateTableCellBackgroundByIds(r,o,e.cellBackgroundColor),l=i.addClassToCellsByIds(a,o,gr);Me(n,i.tableModelToHtml(l))}if(e.cell_borderPosition){n.querySelector(".remove-basic-cell")&&(o=i.getCellsWithClasses(r,s),i.state.set("activeCell",o),document.querySelectorAll(`.${je}`).forEach(l=>{l.classList.remove(je)})),r=i.parseTableElementToModel(n);const a=i.addClassToCellsByIds(r,o,je);Me(n,i.tableModelToHtml(a))}(e.cell_borderAll||e.cell_borderTop||e.cell_borderRight||e.cell_borderBottom||e.cell_borderLeft)&&m$(e,n,r,o,i,s),t.includes("cell_borderRadiusAll")&&p$(e,n,r,o,i,s),t.includes("cell_padding")&&h$(e,n,r,o,i,s)}function m$(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${je}`).forEach(l=>{l.classList.remove(je)}));const s=o.getExternalBorders(n,r),a=o.mergeUniCells(s);if(e.cell_borderAll){for(const l of Object.keys(a)){if(l.includes("-uni-"))continue;n=o.parseTableElementToModel(t);const c=[l],u=o.updateCellBordersByIds(n,c,a[l],e.cell_borderAll);let d=o.addClassToCellsByIds(u,c,gr);d=o.addClassToCellsByIds(d,c,je),Me(t,o.tableModelToHtml(d))}(e.cell_borderAll.style===""||e.cell_borderAll.width===0||e.cell_borderAll.color==="")&&t.querySelectorAll(`.${gr}`).forEach(l=>{const c=l;c.style.removeProperty("border-top"),c.style.removeProperty("border-right"),c.style.removeProperty("border-bottom"),c.style.removeProperty("border-left")})}[{setting:"cell_borderTop",value:"top"},{setting:"cell_borderRight",value:"right"},{setting:"cell_borderBottom",value:"bottom"},{setting:"cell_borderLeft",value:"left"}].forEach(({setting:l,value:c})=>{if(e[l]){n=o.parseTableElementToModel(t);const u=Object.keys(a).filter(p=>a[p].includes(c)),d=o.updateCellBordersByIds(n,u,[c],e[l]),f=o.addClassToCellsByIds(d,r,gr);Me(t,o.tableModelToHtml(f))}})}function p$(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${je}`).forEach(a=>{a.classList.remove(je)}));const s=o.getExternalCorners(n,r);for(const a of Object.keys(s)){if(a.includes("-uni-"))continue;n=o.parseTableElementToModel(t);const l=o.updateCellBorderRadiusByIds(n,a,s[a],e.cell_borderRadiusAll),c=o.addClassToCellsByIds(l,a,gr);Me(t,o.tableModelToHtml(c))}}function h$(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${je}`).forEach(l=>{l.classList.remove(je)})),n=o.parseTableElementToModel(t);let s=o.addClassToCellsByIds(n,r,je);Me(t,o.tableModelToHtml(s)),[{key:"cell_paddingTop",sides:["top"]},{key:"cell_paddingBottom",sides:["bottom"]},{key:"cell_paddingLeft",sides:["left"]},{key:"cell_paddingRight",sides:["right"]},{key:"cell_paddingLeftRight",sides:["left","right"]},{key:"cell_paddingTopBottom",sides:["top","bottom"]}].forEach(({key:l,sides:c})=>{e[l]!==void 0&&(n=o.parseTableElementToModel(t),s=o.updateCellPaddingByIds(n,r,c,e[l]))}),e.cell_padding&&(n=o.parseTableElementToModel(t),s=o.updateCellPaddingByIds(n,r,["top"],e.cell_padding.top),s=o.updateCellPaddingByIds(s,r,["bottom"],e.cell_padding.bottom),s=o.updateCellPaddingByIds(s,r,["left"],e.cell_padding.left),s=o.updateCellPaddingByIds(s,r,["right"],e.cell_padding.right));const a=o.addClassToCellsByIds(s,r,gr);Me(t,o.tableModelToHtml(a))}function g$(e,t){if(e.collapsed)return!1;const{startContainer:n,endContainer:r}=e;return!n.isConnected||!r.isConnected?!1:t.contains(n)&&t.contains(r)}function b$(e,t,n,r,o,i,s){const a=[ae,ie],l=window.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0).cloneRange();if(n.querySelector(".remove-basic-cell")&&(o=s.getCellsWithClasses(r,a),s.state.set("activeCell",o),document.querySelectorAll(`.${je}`).forEach(d=>{d.classList.remove(je)})),!o.length)return;if(o.length===1){const d=n.querySelector(`td.${ie}, td.${je}, td.${ae}`),f=d?.querySelector(":scope > div")??d?.querySelector(":scope > editor > div");if(f){if(s.wrapEditor(f,!0),s.textStyleProperties.some(p=>Object.prototype.hasOwnProperty.call(e,p))){if(g$(c,f))s.addNewRange(c);else{const p=document.createRange();p.selectNodeContents(f),s.addNewRange(p)}try{s.toggleTextStyle(f,{settings:e})}catch{}}if(t==="linkHref"&&typeof e.linkHref=="string"){const p=f.tagName==="A"?f:f.querySelector("a");p&&p.setAttribute("href",e.linkHref)}t==="textAlign"&&(e.textAlign?f.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):f.removeAttribute("align")),e.valign?f.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&f.closest("td")?.removeAttribute("valign");return}}r=s.parseTableElementToModel(n);const u=s.addClassToCellsByIds(r,o,je);Me(n,s.tableModelToHtml(u)),n.querySelectorAll(`td.${je} > div`).forEach(d=>{s.wrapEditor(d,!0);const f=l.getRangeAt(0);if(f.selectNode(d),s.addNewRange(f),s.textStyleProperties.some(p=>Object.prototype.hasOwnProperty.call(e,p)))try{s.toggleTextStyle(d,{settings:e})}catch{}if(t==="linkHref"&&typeof e.linkHref=="string"){const p=d.tagName==="A"?d:d.querySelector("a");p&&p.setAttribute("href",e.linkHref)}t==="textAlign"&&(e.textAlign?d.setAttribute("align",e.textAlign):i?.style?.textAlign?i.style.removeProperty("text-align"):d.removeAttribute("align")),e.valign?d.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&d.closest("td")?.removeAttribute("valign")})}function y$(e,t){document.querySelectorAll(`.${ae}`).forEach(o=>{o.classList.remove(ae)}),document.querySelectorAll(`.${ie}`).forEach(o=>{o.classList.remove(ie)});let n=t.parseTableElementToModel(e);e.getAttribute("style")?.includes("border-collapse:")&&(n=t.removeOuterBorders(n)),e.getAttribute("class")?.includes("em-mob-border_")&&(n=t.removeOuterBorders(n)),n=t.simplifyBorders(n),Me(e,t.tableModelToHtml(n));const r=e.querySelectorAll(`.${gr}`);r.length>0&&(r[0].setAttribute("em-edit",""),r.forEach(o=>{o.classList.remove(gr)})),t.commit()}var Pe=e=>ja(e?.innerText);function v$(e,t){return e.hasOwnProperty("textStrong")?{name:"textStrong",tags:["b","strong","a","[style*=font-weight]"],value:e.textStrong,command:"bold"}:e.hasOwnProperty("textItalic")?{name:"textItalic",tags:["em","i","[style*=font-style]","a"],value:e.textItalic,command:"italic"}:e.hasOwnProperty("textStrikethrough")?{name:"textStrikethrough",tags:["s","strike","u","[style*=text-decoration]","a"],value:e.textStrikethrough,command:"strikethrough"}:e.hasOwnProperty("textUnderline")?{name:"textUnderline",tags:["u","strike","[style*=text-decoration]","span","a"],value:e.textUnderline,command:"underline"}:e.hasOwnProperty("textColor")?{name:"textColor",tags:["a","[style*='color']","span"],value:t(e.textColor)||"",command:"foreColor"}:e.hasOwnProperty("textBackgroundColor")?{name:"textBackgroundColor",tags:["a","[style*='background-color']","[style*='color']","span"],value:t(e.textBackgroundColor)||"",command:"hilitecolor"}:e.hasOwnProperty("fontFamily")?{name:"fontFamily",tags:["[style*='font-family']","span","a"],value:e.fontFamily?.[e.fontFamily.length-1],command:"fontName"}:e.hasOwnProperty("textLink")?{name:"textLink",tags:["a","[href]","div","p","td"],value:e.textLink||"",command:"createLink"}:e.hasOwnProperty("fontSize")?{name:"fontSize",tags:["a","[style*='font-size']","span","div"],value:parseFloat(e.fontSize),command:"fontSize"}:e.hasOwnProperty("lineHeight")?{name:"lineHeight",tags:["div","[style*='line-height']","p","td"],value:parseFloat(e.lineHeight),command:null}:{}}function E$(e,t){if(!e?.rangeCount)return;const n=e.getRangeAt(0),r=n.commonAncestorContainer;let o=n.startOffset,i=n.endOffset;const s=r.data;if(!s)return;for(;o>0&&!/\s/.test(s[o-1]);)o--;for(;i<s.length&&!/\s/.test(s[i]);)i++;const a=document.createRange();a.setStart(r,o),a.setEnd(r,i),t(a)}var S$=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,w$=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,Hm=e=>e.toString(16).padStart(2,"0");function C$(e){const t=w$.exec(e)?.groups;if(!t)return;const n=Number.parseInt(t.r,10),r=Number.parseInt(t.g,10),o=Number.parseInt(t.b,10);if(![n,r,o].some(i=>!Number.isFinite(i)||i<0||i>255))return`#${Hm(n)}${Hm(r)}${Hm(o)}`}function hw(e){return e.split("").map(t=>`${t}${t}`).join("")}function Un(e,t){if(!e)return;const n=e.trim();if(!n)return;if(S$.test(n)){const o=n.slice(1);return o.length===3?`#${hw(o).toLowerCase()}`:o.length===4?`#${hw(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=C$(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Un(o)}}function A$(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Fm(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Un(o.style.color,n);if(i)return i;o=o.parentElement}}function T$(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Un(n.style.color,t);if(!r)return;const o=Fm(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&A$(n))})}function _$(e){const t=e.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?e.commonAncestorContainer:e.commonAncestorContainer.parentElement;if(!t)return[];if(e.commonAncestorContainer.nodeType===Node.TEXT_NODE){const o=e.commonAncestorContainer;return o.data.trim()?[o]:[]}const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null),r=[];for(;n.nextNode();){const o=n.currentNode;!o.data.trim()||!e.intersectsNode(o)||r.push(o)}return r}function k$(e,t,n){const r=Un(t,n);if(!r)return!1;const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const i=o.getRangeAt(0);if(i.collapsed||!i.toString().trim())return!1;const s=_$(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Un(u.style.color,n)===r?!0:Fm(u,e,n)===r:!1}))return!1;const a=document.createElement("span");a.style.color=t;try{i.surroundContents(a)}catch{a.appendChild(i.extractContents()),i.insertNode(a)}const l=document.createRange();return l.selectNodeContents(a),o.removeAllRanges(),o.addRange(l),!0}function L$(e,t,n){const r=Array.from(e.querySelectorAll('a[style*="color"]'));e.tagName==="A"&&e.style.color&&r.unshift(e),r.forEach(o=>{const i=Un(o.style.color,t);if(!i)return;const s=Fm(o,e,t)||(n?Un(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Un(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function N$(e){if(e.currentSettings.name!=="lineHeight")return!1;const t=e.parentElement.closest('[style*="line-height"]')||e.parentElement.closest("div, p, td");if(e.parentElement?.querySelector('[em-edit="active"]')){const n=[];e.checkForTextNodes(e.parentNode,n),n.forEach(r=>{const o=r.closest('[style*="line-height"]')||r.closest("div, p, td");o&&(o.style.lineHeight=e.currentSettings.value+"px")})}else if(e.isElementList){const n=!!e.parentElement.querySelector("div"),r=n?e.parentElement.closest("tr")?.querySelector(`.${e.classNameBullet}`):null;if(r&&(r.style.lineHeight=e.currentSettings.value+"px"),n){const o=e.parentElement.querySelector("div");o&&(o.style.lineHeight=e.currentSettings.value+"px")}else e.parentElement.style.lineHeight=e.currentSettings.value+"px"}else t&&(t.style.lineHeight=e.currentSettings.value+"px");return e.commit(),!0}function x$(e){if(e.currentSettings.name!=="fontFamily")return!1;let t=(e.findElementWithSelectedText(e.selectedText)||e.getParentElementOfSelection())?.closest('[style*="font-family"]')||e.parentWrapper;const n=!!e.parentElement?.querySelector('[em-edit="active"]');if(!n&&(!e.range?.collapsed||e.getSelectedText()))if(e.getInnerText(e.parentWrapper)===e.selectedText)t=e.parentWrapper;else if(e.getInnerText(e.parentElement)===e.selectedText)t=e.parentElement;else{const o=document.createElement("span");e.range.commonAncestorContainer.nodeType===3?e.range.surroundContents(o):(o.appendChild(e.range.extractContents()),e.range.insertNode(o)),t=o,e.range.deleteContents(),e.range.insertNode(t),e.range.selectNode(t),e.addNewRange(e.range)}e.fontFamilyArray?e.fontFamilyArray[0]==="Safe Fonts"?(t.style.fontFamily=e.fontFamilyArray[1],e.removeClassesByPrefix(t,"em-font"),e.clearLinkTags({elem:document.documentElement})):e.fontFamilyArray[0]==="Google Fonts"&&(e.fontFamilyArray[1]==="Sans Serif"?t.style.fontFamily="Helvetica, Arial, sans-serif":e.fontFamilyArray[1]==="Serif"?t.style.fontFamily='"Times New Roman", Times, serif':e.fontFamilyArray[1]==="Project Fonts"&&Gl(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),qf(t,e.fontFamilyArray),e.addFontFamilyClass({fontFamilyArray:e.fontFamilyArray})):t.style.removeProperty("font-family");let r;return n?(r=e.parentElement.querySelectorAll('[style*="font-family"]'),r.forEach(o=>o.style.fontFamily=t.style.fontFamily)):(r=t.querySelectorAll('[style*="font-family"]'),r.forEach(o=>o.style.fontFamily="")),e.cleanEmptySpans(e.selectedText),e.refreshElementSettings(t,e.selectedText),e.range.selectNode(t),e.addNewRange(e.range),e.commit(),!0}function O$(e){if(e.currentSettings.command==="bold"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const t=[];e.checkForTextNodes(e.parentNode,t),t.filter(n=>e.checkForWorkClass(n)).forEach(n=>{const r=n.parentElement??n;n.innerHTML=e.removeFormattingTags(Ue(n),"bold"),Yt(n),n.tagName!=="STRONG"?e.currentSettings.value&&(n.innerHTML="<strong>"+Ue(n)+"</strong>"):e.currentSettings.value||(n.outerHTML=Ue(n)),Yt(r)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentWrapper?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function R$(e){if(e.currentSettings.command==="italic"){if(e.hasItalicClass&&e.tempStyleClass&&e.parentWrapper&&e.parentWrapper.classList.add(e.tempStyleClass),!e.isEditorTagOutside){const t=[];e.checkForTextNodes(e.parentNode,t),t.filter(n=>e.checkForWorkClass(n)).forEach(n=>{const r=n.parentElement??n;n.innerHTML=e.removeFormattingTags(Ue(n),"italic"),Yt(n),n.tagName!=="EM"?e.currentSettings.value&&(n.innerHTML="<em>"+Ue(n)+"</em>"):e.currentSettings.value||(n.outerHTML=Ue(n)),Yt(r)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t),e.getInnerText(n)===e.selectedText){const r=n.closest("span");r?.textContent===n.innerText&&!r.getAttribute("style")&&r.childNodes[0]?.nodeType===3&&r.parentNode?.replaceChild(n,r),e.refreshElementSettings(n,e.selectedText),e.range.selectNode(n),e.addNewRange(e.range)}});else if(Array.from(e.parentElement?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");n.innerHTML=t.innerHTML,t.parentNode?.replaceChild(n,t)}),e.getInnerText(e.parentWrapper)===e.selectedText){const t=e.parentWrapper||e.findElementWithSelectedText(e.selectedText,e.activeElement);t&&(e.range.selectNode(t),e.addNewRange(e.range))}e.cleanEmptySpans(e.selectedText)}}function M$(e){if(e.currentSettings.name!=="fontSize")return;const{mutableState:t}=e;if(e.getInnerText(t.parentWrapper)!==e.selectedText){let i=!1;const s=e.findParentWithFontSizeAndTag(e.activeElement||t.parentNode)||t.parentWrapper;s&&s.style.fontSize.length&&(i=s.style.fontSize,s.style.fontSize=""),To("fontSize",!1,"1"),i&&s&&(s.style.fontSize=i);const a=window.getSelection()?.getRangeAt(0).commonAncestorContainer;t.parentElement=t.parentNode.querySelector('[size="1"]')||(a?.nodeType===1?a:a?.parentElement),t.parentElement&&(t.parentElement.style.fontSize=e.currentSettings.value+"px")}let n=null;if(t.parentElement?.tagName==="FONT"){const i=document.createElement("span");i.innerHTML=t.parentElement.innerHTML,t.parentElement.getAttribute("size")?(i.style.fontSize=e.currentSettings.value+"px",i.removeAttribute("size")):Array.from(t.parentElement.attributes).forEach(s=>i.setAttribute(s.name,s.value)),t.parentElement.parentNode?.replaceChild(i,t.parentElement),e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range)}if((e.activeElement.tagName==="A"||e.activeElement.closest("a"))&&(t.parentWrapper=e.activeElement.closest("a")),e.getInnerText(t.parentWrapper)===e.selectedText){if(Array.from(t.parentWrapper?.getElementsByTagName("span")||[]).forEach(s=>s.style.fontSize=""),!t.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&t.parentWrapper&&e.isProgrammaticSelection){const s=t.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);s&&(s.style.fontSize=e.currentSettings.value+"px")}t.parentWrapper&&(t.parentWrapper.style.fontSize=e.currentSettings.value+"px");const i=t.parentWrapper?.firstChild;i?.nodeType===1&&i.tagName==="SPAN"&&i.innerText===e.selectedText&&(i.style.fontSize="")}else t.parentWrapper?.style.hasOwnProperty("font-size")&&(n=t.parentWrapper.style.fontSize,n&&t.parentWrapper.style.removeProperty("font-size"));n&&t.parentWrapper&&(t.parentWrapper.style.fontSize=n);const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse(),o=[];e.isEditorTagOutside?e.currentSettings.value||(t.selection=window.getSelection(),t.range=t.selection.getRangeAt(0),t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.currentStyle),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{i.style.fontSize=e.currentSettings.value+"px",i.querySelectorAll('[style*="font-size"]').forEach(s=>{s.tagName!=="A"?s.style.removeProperty("font-size"):s.style.fontSize=e.currentSettings.value+"px"})})),e.isEditorTagOutside&&r.forEach(i=>{const s=document.createElement("span");s.innerHTML=i.innerHTML;const a=e.currentSettings.value+"px",l=i.children?.length===1&&i.firstChild?.nodeType===1?i.firstChild:null,c=[];if(e.checkForTextNodes(i,c),c.forEach(u=>{if(u.tagName==="FONT"){const d=document.createElement("span");d.innerHTML=u.innerHTML,u.getAttribute("size")?d.style.fontSize=e.getInnerText(u)===e.selectedText?a:"":Array.from(u.attributes).forEach(f=>d.setAttribute(f.name,f.value)),u.parentNode?.replaceChild(d,u)}}),l)i.parentNode?.replaceChild(l,i);else if(i.getAttribute("size")&&i.parentNode){const u=document.createElement("span");u.innerHTML=i.innerHTML,u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");u.innerHTML=i.innerHTML,i.parentNode?.replaceChild(u,i)}}),Array.from(document.getElementsByTagName("span")).reverse().forEach(i=>{e.getInnerText(i)===e.selectedText&&i.closest('[em-edit="active"]')&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}),e.cleanEmptySpans(e.selectedText)}function P$(e){if(e.currentSettings.command!=="strikethrough")return;const{mutableState:t}=e;let n=e.getSelectedText(),r=null;if(!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{const s=i.parentElement??i;i.innerHTML=e.removeFormattingTags(Ue(i),"strike"),Yt(i),i.tagName!=="STRIKE"?e.currentSettings.value&&(i.innerHTML="<strike>"+Ue(i)+"</strike>"):e.currentSettings.value||(i.outerHTML=Ue(i)),Yt(s)})}if(e.currentSettings.value===!0){let o=n;Array.from(document?.getElementsByTagName("strike")||[]).reverse().forEach(i=>{if(e.getInnerText(i)===o&&(e.getInnerText(i.parentNode)===o&&i.parentNode.tagName==="U"&&(i.parentNode.outerHTML=i.parentNode.innerHTML),r=e.findElementWithSelectedText(o),r)){const s=e.findOutermostParentWithText(r,"A");s&&(s.style.textDecoration="none"),e.refreshElementSettings(r,o),t.range.selectNode(r),e.addNewRange(t.range)}})}else{let o=n;if(e.cleanEmptySpans(o),e.getInnerText(t.parentWrapper)===o){const i=window.getSelection();if(r=e.findElementWithSelectedText(o,e.activeElement),r&&(t.range.selectNode(r),e.addNewRange(t.range),t.range.cloneContents())){const s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||t.range.commonAncestorContainer;s&&e.request.type!=="button"&&e.refreshElementSettings(s,o)}if(i&&i.rangeCount>0&&e.isElementList&&!r){const s=i.getRangeAt(0);let a=s.commonAncestorContainer;a.nodeType!==Node.ELEMENT_NODE&&(a=a.parentNode),a.querySelectorAll("strike").forEach(l=>{l.outerHTML=l.innerHTML}),a.style.textDecoration="none",a.querySelectorAll('span[style*="text-decoration"]').forEach(l=>{l.style.textDecoration=""}),e.refreshElementSettings(a,o),s.selectNodeContents(a),i.removeAllRanges(),i.addRange(s),e.addNewRange(s)}}}if(e.request.type==="button"||e.activeElement.tagName==="A"){e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement);let o=n;if(e.getInnerText(t.parentWrapper)===o&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"line-through":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),t.parentWrapper.innerHTML=e.removeFormattingTags(Ue(t.parentWrapper),"strikeUnderline"),Yt(t.parentWrapper),e.refreshElementSettings(t.parentWrapper,o),t.range.selectNode(t.parentWrapper),e.addNewRange(t.range);else{const i=t.selection.getRangeAt(0),s=document.createElement("span");s.style.textDecoration=e.currentSettings.value?"line-through":"none",e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN"?(e.activeElement.style.textDecoration=e.activeElement.style.textDecoration==="line-through"?"none":"line-through",Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),e.refreshElementSettings(e.activeElement,o)):(s.appendChild(i.extractContents()),Array.from(s.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),i.insertNode(s),r=s,e.refreshElementSettings(s,o),e.addNewRange(i))}}if(t.range.cloneContents()){if(t.range=t.selection.getRangeAt(0),r&&e.getInnerText(r)===n)t.range.selectNode(r),e.addNewRange(t.range);else{const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.getInnerText(s)===n&&(t.range.selectNode(s),e.addNewRange(t.range))}r&&e.refreshElementSettings(r,n)}}function I$(e){if(e.currentSettings.command!=="underline")return;const{mutableState:t}=e,n=o=>{const i=o.parentNode;if(i){for(;o.firstChild;)i.insertBefore(o.firstChild,o);i.removeChild(o)}},r=o=>{o.querySelectorAll("u").forEach(i=>{n(i)}),o.querySelectorAll('span[style*="text-decoration"], span[style*="text-decoration-line"]').forEach(i=>{i.style.removeProperty("text-decoration"),i.style.removeProperty("text-decoration-line"),i.getAttribute("style")||i.removeAttribute("style"),i.attributes.length===0&&n(i)})};if(!e.isEditorTagOutside){const o=[];e.checkForTextNodes(e.parentNode,o),o.filter(i=>e.checkForWorkClass(i)).forEach(i=>{const s=i.parentElement??i;i.innerHTML=e.removeFormattingTags(Ue(i),"underline"),Yt(i),i.tagName!=="U"?e.currentSettings.value&&(i.innerHTML="<u>"+Ue(i)+"</u>"):e.currentSettings.value||(i.outerHTML=Ue(i)),Yt(s)})}if(e.currentSettings.value){const o=Array.from(e.findOutermostParentWithText(e.parentElement)?.getElementsByTagName("u")||[]).reverse();o.push(...Array.from(e.findOutermostParentWithText(e.parentElement)?.querySelectorAll("a,span[style*=text-decoration]")||[]).reverse()),o.filter(i=>e.getInnerText(i)===e.selectedText).forEach(i=>{if(e.selectedText&&e.getInnerText(i)===e.selectedText){i.style.textDecoration="underline";const s=i.firstChild;s?.tagName==="STRIKE"&&e.getInnerText(s)===e.selectedText&&[...s.attributes].forEach(a=>{i.setAttribute(a.name,a.value),s.removeAttribute(a.name)}),e.cleanStrikesInElement(i,e.getParentElementOfSelection())}}),e.cleanEmptySpans(e.selectedText),e.getInnerText(e.parentElement)===e.selectedText&&e.cleanStrikesInElement(e.parentElement,e.getParentElementOfSelection())}else{const o=e.findElementWithSelectedText(e.selectedText,e.activeElement);if(!o&&e.isElementList){let i=null;const s=window.getSelection();if(s&&s.rangeCount>0){let l=s.getRangeAt(0).commonAncestorContainer;for(l.nodeType!==Node.ELEMENT_NODE&&(l=l.parentNode);l&&l!==e.activeElement&&!["DIV"].includes(l.tagName);)l=l.parentNode;l&&l.contains(e.activeElement)&&(i=l)}const a=i?e.findOutermostParentWithText(i,"A"):null;a&&(a.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&i&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}else{const i=e.findOutermostParentWithText(o,"A");i&&(i.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&o&&(e.refreshElementSettings(o,e.selectedText),t.range.selectNode(o),e.addNewRange(t.range))}}if(e.request.type==="button"||e.activeElement.tagName==="A")if(e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement),e.getInnerText(t.parentWrapper)===e.selectedText&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"underline solid":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(o=>o.style.textDecoration=""),e.cleanStrikesInElement(t.parentWrapper,e.getParentElementOfSelection());else{const o=t.selection.getRangeAt(0);if(e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN")e.currentSettings.value?e.activeElement.style.textDecoration="underline":(e.activeElement.style.removeProperty("text-decoration"),e.activeElement.style.removeProperty("text-decoration-line")),Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),e.activeElement.getAttribute("style")||e.activeElement.removeAttribute("style"),e.refreshElementSettings(e.activeElement,e.selectedText);else if(e.activeElement.tagName!=="A")if(e.currentSettings.value){const i=document.createElement("span");i.style.textDecoration="underline",i.appendChild(o.extractContents()),Array.from(i.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),e.refreshElementSettings(i,e.selectedText),o.insertNode(i),e.addNewRange(o)}else{const i=o.extractContents(),s=document.createElement("span");s.appendChild(i),r(s);const a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);o.insertNode(a),e.addNewRange(o)}}}function D$(e){if(!e.isColorChange)return;const{mutableState:t}=e;let n=[];if(e.tempColor&&t.parentWrapper&&(t.parentWrapper.style[e.stylePropretyName]=e.tempColor,!t.parentWrapper?.hasAttribute("em-edit")&&e.isElementList&&t.parentWrapper&&e.isProgrammaticSelection)){const s=t.parentWrapper.closest("tr")?.querySelector(`.${e.classNameBullet}`);s&&(s.style[e.stylePropretyName]=e.tempColor)}if(e.outerContextColor&&e.outerContextElement&&(e.outerContextElement.style.color=e.outerContextColor),e.getInnerText(t.parentWrapper)===e.selectedText&&t.parentWrapper){const s=e.rgbToHex(e.currentSettings.value?.toString())||"";if(e.currentStyle==="color"){const a=(e.parentElement||t.parentNode).closest("a");e.request.type==="button"||a?a&&(a.style.color=s,a.querySelectorAll('span[style*="color"]').forEach(l=>l.style.color="")):(t.parentWrapper.style.color=s,e.canselExecCommand&&(e.setCustomColor(t.parentWrapper,e.stylePropretyName,e.currentSettings.value),t.range.selectNode(t.parentWrapper),e.addNewRange(t.range)),t.parentWrapper.querySelectorAll(":not(a)").forEach(l=>{l.style.color&&e.getInnerText(l)===e.selectedText&&(l.style.color="")}))}else if(!e.canselExecCommand){const a=document.createElement("span");a.style[e.stylePropretyName]=s;const l=t.parentWrapper.firstChild;if(l?.nodeType===1&&l.tagName==="SPAN"&&e.getInnerText(l)===e.selectedText)l.style[e.stylePropretyName]=s;else{for(;t.parentWrapper.firstChild;)a.appendChild(t.parentWrapper.firstChild);t.parentWrapper.appendChild(a)}}t.parentWrapper.querySelectorAll(`span[style*="${e.stylePropretyName}"]`).forEach(a=>{a.innerText!==t.parentWrapper.innerText&&a.style.removeProperty(e.stylePropretyName)})}e.isEditorTagOutside?!e.currentSettings.value&&t.selection.isCollapsed&&(t.parentNode=t.selection.anchorNode?.nodeType===1?t.selection.anchorNode:t.selection.anchorNode?.parentElement,t.parentNode&&t.parentNode.style.removeProperty(e.stylePropretyName),e.cleanEmptySpans(e.selectedText)):(e.checkForTextNodes(t.parentNode,n),n.forEach(s=>{s.classList&&s.classList.contains(e.classNameBullet)||e.checkForWorkClass(s)&&(s.style[e.stylePropretyName]=e.currentSettings.value,s.querySelectorAll(`[style*="${e.stylePropretyName}"]`).forEach(a=>{a.tagName!=="A"?a.style.removeProperty(e.currentStyle):a.style[e.stylePropretyName]=e.currentSettings.value}))}));const r=Array.from(t.parentNode?.querySelectorAll("font")||[]).reverse();e.isEditorTagOutside&&r.forEach(s=>{const a=document.createElement("span");a.innerHTML=s.innerHTML;const l=s.getAttribute(e.currentStyle),c=e.rgbToHex(l||"").toString(),u=s.children.length===1&&s.firstChild?.nodeType===1?s.firstChild:null;let d=[];if(e.checkForTextNodes(s,d),d.forEach(f=>{if(f.tagName==="FONT"){const p=document.createElement("span");p.innerHTML=f.innerHTML,p.style[e.stylePropretyName]=c,f.parentNode?.replaceChild(p,f),e.refreshElementSettings(p,e.selectedText),t.range.selectNode(p),e.addNewRange(t.range)}else f.style[e.stylePropretyName]=c}),u)s.parentNode?.replaceChild(u,s);else if(s.getAttribute(e.currentStyle)&&s.parentNode){const f=document.createElement("span");f.innerHTML=s.innerHTML,f.style[e.stylePropretyName]=c;const p=s.closest("a");p&&p.innerText===s.innerHTML&&(p.style[e.stylePropretyName]=c),s.parentNode.replaceChild(f,s)}});const o=Array.from(t.parentWrapper?.getElementsByTagName("span")||[]).reverse();e.isEditorTagOutside&&o.forEach(s=>{s.style[e.stylePropretyName]=e.rgbToHex(s.style[e.stylePropretyName]),e.getInnerText(s)===e.selectedText&&e.canselExecCommand&&(e.setCustomColor(s,e.stylePropretyName,e.currentSettings.value),t.range.selectNode(s),e.addNewRange(t.range))});const i=t.parentWrapper||t.parentNode;e.currentStyle==="color"&&i&&(L$(i,e.rgbToHex,e.outerContextColor||e.tempColor),T$(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function B$(e){const t=e.parentElement;if(!t)return!1;let n=e,r=t;for(;r;){const o=r.tagName;if(o==="TD"||o==="TH")return r.childElementCount!==1||r.firstElementChild!==n?!1:!Array.from(r.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!=="");if(o==="SPAN"||o==="EDITOR"){if(r.childElementCount!==1||r.firstElementChild!==n||Array.from(r.childNodes).some(i=>i.nodeType===Node.TEXT_NODE&&i.textContent?.trim()!==""))return!1;n=r,r=r.parentElement;continue}return!1}return!1}function gw(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Un(n),o=Un(t??"");return!r||r===o?null:n}function H$(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:t}=e;let n=t.parentNode.querySelector('a[href=" "]');if(e.isEditorTagOutside||(n=e.findOutermostParentWithText(e.activeElement,"a")),e.currentSettings.value){const r=e.findOutermostParentWithText(e.activeElement,"a")||e.findOutermostParentWithText(t.parentNode,"a")||e.findOutermostParentWithText(t.parentWrapper,"a");if(!(n||r))return;const o=e.commonStyles?.links?.underline===void 0||e.commonStyles?.links?.underline?"underline":"none";n||(n=r);const i=e.findOutermostParentWithText(n);if(i&&i!==n&&i!==t.parentWrapper&&["b","strong","a","em","i","s","strike","u","br","span"].includes(i?.tagName.toLowerCase())){const s=n.cloneNode(!1),a=Ue(n),l=n?.parentNode;l&&(l.innerHTML=a,Yt(l)),s.appendChild(i.cloneNode(!0)),i.parentNode&&i.parentNode.replaceChild(s,i),n=s,t.range.selectNode(n),e.addNewRange(t.range)}if(n){n.setAttribute("target","_blank"),n.setAttribute("href","");const s=e.commonStyles?.links?.color||n.closest('[style*="color"]')?.style?.color||"";n.setAttribute("style",`color: ${s}; text-decoration: ${o};`),n.setAttribute("new","true"),e.refreshElementSettings(n,e.selectedText)}}else if(n=t.parentNode.closest("a")||t.parentNode.querySelector('a[em-edit="active"]')||e.findOutermostParentWithText(e.activeElement,"a"),n)if(n.style.fontFamily||n.style.fontSize){const r=B$(n)?"div":"span",o=document.createElement(r);if(o.innerHTML=n.innerHTML,Array.from(n.attributes).forEach(s=>{s.name!=="href"&&s.name!=="target"&&s.name!=="color"&&o.setAttribute(s.name,s.value)}),!o.style.lineHeight){const s=n.closest('[style*="line-height"]');s?.style.lineHeight&&(o.style.lineHeight=s.style.lineHeight)}o.style.textDecoration="";const i=gw(n,e.commonStyles?.links?.color);if(i?o.style.color=i:o.style.color="",n.parentNode?.replaceChild(o,n),r==="div"){let s=o.parentElement;for(;s&&s.tagName!=="TD"&&s.tagName!=="TH";){const a=s.parentElement;if(!a)break;a.replaceChild(o,s),s=o.parentElement}}e.cleanEmptySpansWithParent(e.selectedText,o),e.refreshElementSettings(o,e.selectedText),t.range.selectNodeContents(o),e.addNewRange(t.range)}else{const r=gw(n,e.commonStyles?.links?.color);if(r){const o=document.createElement("span");for(o.style.color=r;n.firstChild;)o.appendChild(n.firstChild);n.parentNode?.replaceChild(o,n),t.range=document.createRange(),t.range.selectNodeContents(o)}else{const o=Array.from(n.childNodes);o.forEach(i=>{n.parentNode?.insertBefore(i,n)}),n.parentNode?.removeChild(n),t.range=document.createRange(),t.range.setStartBefore(o[0]),t.range.setEndAfter(o[o.length-1])}if(e.addNewRange(t.range),t.range.cloneContents()){t.range=t.selection.getRangeAt(0);const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.refreshElementSettings(s,e.selectedText)}}}var $m='[class*="em-mob-font_size"]',F$=`${$m}, [style*="font-size"]`,$$="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",W$=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function q$(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest($$)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=z$(s,i!==null);if(!a||Pe(s)===Ze()){n({settings:t,elem:s.closest("editor")?s:s.closest(F$)||s}),Wm(s,r,i);return}const l=U$(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll($m)).filter(d=>a.intersectsNode(d))).forEach(d=>{Wm(d,r,null),bw(d,r)});return}const c=l||Bg(a,a.extractContents(),"span");if(!c)return;V$(c),n({settings:t,elem:c}),Wm(c,r,i);const u=document.createRange();u.selectNodeContents(c),Lo(u)}function z$(e,t){const n=window.getSelection();if(!n?.rangeCount)return null;const r=n.getRangeAt(0);if(!e.contains(r.commonAncestorContainer))return null;if(!r.collapsed)return r;if(!t){const i=(r.startContainer.nodeType===Node.ELEMENT_NODE?r.startContainer:r.startContainer.parentElement)?.closest($m);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),Lo(s),s}E$(n,Lo);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function U$(e,t){const n=Ze(),r=t.commonAncestorContainer;let o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement,i=null;for(;o&&o!==e&&o.tagName!=="EDITOR"&&e.contains(o)&&Pe(o)===n;)i=o,o=o.parentElement;return i}function Wm(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(Xl(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&bw(r,t)})}function bw(e,t){Xl(e,t),e.classList.length||e.removeAttribute("class");const n=e.parentNode;if(!(e.tagName!=="SPAN"||e.attributes.length||!n)){for(;e.firstChild;)n.insertBefore(e.firstChild,e);e.remove()}}function V$(e){[e.previousSibling,e.nextSibling].forEach(t=>{if(!t||t.textContent!=="")return;if(t.nodeType===Node.TEXT_NODE){t.remove();return}const n=t,r=n.tagName==="A"&&(n.hasAttribute("name")||n.hasAttribute("id"));W$.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function j$(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&X$(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(q$(r,e,t.setElementMobileFontSize),n=!0),e.mobileLineHeight){const o=r.closest('[class*="em-mob-line_height"]')||r.closest('[style*="line-height"]');t.setElementMobileLineHeight({settings:e,elem:o}),n=!0}return e.textAlign!==void 0&&Y$(e.textAlign,r),e.mobileTextAlign&&(K$(e,r,t),n=!0),(typeof e.textSuperscript=="boolean"||typeof e.textSubscript=="boolean")&&t.handleTextScriptSettings(e,{unwrapNestedTags:t.unwrapNestedTags,wrapInTag:t.wrapInTag,unwrapTag:t.unwrapTag,isRangeMatching:t.isRangeMatching,splitWrapper:t.splitWrapper,cleanEmptyTags:t.cleanEmptyTags,applicationElementSettingsSet:t.applicationElementSettingsSet,commit:t.commit}),e.textAnchor!==void 0&&t.handleTextAnchor(e.textAnchor,{activeElement:r,commit:t.commit}),e.textReplacer!==void 0&&t.handleTextReplacer(e.textReplacer,{activeElement:r,compareStrings:t.compareStrings}),(e.hasOwnProperty("listUL")||e.hasOwnProperty("listOL"))&&G$(e,r),t.isElementList&&Q$(e,t),n}function G$(e,t){const n=yH.includes(t.tagName)?t:t.closest(vH);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?NH(n,r):MH(n)}function X$(e,t){let n=document.querySelector("[em-edit]");if(!n)return;let r=n.tagName==="A"?n:n.closest("a"),o=n.closest(".alignment")||n.closest(".button_block")||n.closest("td");if(o||(o=n.closest("div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, a, sup, sub"),o||(o=document.querySelector("td")?.closest("div, p, td")||null)),!r&&o&&(r=o.querySelector("a")),r&&(r.setAttribute("href",e),Fs(e)&&r.removeAttribute("target")),o){const i=t.collectVMLContent(o);if(i){const s=document.createElement("div");s.innerHTML=i;const a=s.querySelector("v\\:roundrect"),l=s.querySelector("a");(a||l)&&(a&&a.setAttribute("href",e),l&&l.setAttribute("href",e),t.updateVMLComments(o,s.innerHTML))}}}function Y$(e,t){const n=Rs(t);n&&(e?n.style.textAlign?n.style.textAlign=e:n.setAttribute("align",e):n.style.textAlign?n.style.removeProperty("text-align"):n.removeAttribute("align"))}function K$(e,t,n){const r=Rs(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";U6(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function Z$(e,t){const n=c=>c in e,{SpacingBetweenParagraphs:r,SpacingBetweenBulletsAndText:o,BulletType:i}=e,{ColorBullets:s,BulletsSize:a,BulletsFontFamily:l=null}=e;return[!!r&&(c=>t.updateTableStyle(c,"padding-bottom",r)),!!o&&(c=>t.updateTableStyle(c,"padding-left",o)),!!i&&(c=>t.changeBullets(c,i)),!!s&&(c=>t.changeBulletsColor(c,s)),!!a&&(c=>t.changeBulletsSize(c,a)),n("BulletTextItalic")&&(c=>t.changeBulletsItalic(c,!!e.BulletTextItalic)),n("BulletTextStrong")&&(c=>t.changeBulletsWeight(c,!!e.BulletTextStrong)),n("BulletTextStrikethrough")&&(c=>t.changeBulletsStrikethrough(c,!!e.BulletTextStrikethrough)),n("BulletTextUnderline")&&(c=>t.changeBulletsUnderline(c,!!e.BulletTextUnderline)),n("BulletsFontFamily")&&t.isElementListOL&&(c=>J$(l,c,t))].filter(c=>!!c)}function Q$(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=Z$(e,t);if(s.length){const l=t.removeEditorTags(Ha(i));Me(i,s.reduce((c,u)=>u(c),l))}let a=t.findElementWithSelectedText(n.textContent||"",i);a===null&&(a=i),a.hasAttribute("em-edit")||a.setAttribute("em-edit","active"),t.commit()}function J$(e,t,n){const r=document.createElement("div");r.innerHTML=t;const o=r.querySelector("table.em-element-list-ol");return o?(o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:first-child > div");s&&(e?e[0]==="Safe Fonts"?(s.style.fontFamily=e[1],n.removeClassesByPrefix(s,"em-font"),n.clearLinkTags({elem:document.documentElement})):e[0]==="Google Fonts"&&(e[1]==="Sans Serif"?s.style.fontFamily="Helvetica, Arial, sans-serif":e[1]==="Serif"?s.style.fontFamily='"Times New Roman", Times, serif':e[1]==="Project Fonts"&&Gl(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),qf(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),r.innerHTML):t}var bc=null;function yw(e){bc=e}function vw(){return bc}function or(){bc=null}function eW(){return bc?.kind==="atom"}function qm(e,t,n,r){Di(e,t,o=>{const i=document.createElement("table");i.replaceChildren(...o),[...i.querySelectorAll(":scope > tr")].reverse().forEach(s=>n.insertAdjacentElement(r,s))})}function Ew(e,t){e.replaceChildren(...t),e.querySelectorAll('tr[em="block"]').forEach(n=>n.removeAttribute("em"))}function zm(e,t,n,r,o){Di(e,n,i=>{Ew(t,i),r.insertAdjacentElement(o,t)})}var tW=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],nW=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],rW=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function Sw(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...tW)})}function oW(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...nW)})}function yc(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...rW)})}function Um(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function ww(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function Vm(e,t,n){const r=n==="atom"?"em-atom-insert":"em-block-insert",o=n==="blockatom"?"em-blockatom-insert":r;if(e.classList.add(o),t==="bottom"){e.classList.remove(`${r}_top`,`${r}_top-document`);const i=ww(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=ww(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function vc(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function Cw(e){if(!e?.length)return null;for(let t=0;t<e.length;t++){const n=e.item(t);if(n?.type.startsWith("image/"))return n}return null}function iW(e){if(!e?.items?.length)return null;for(let t=0;t<e.items.length;t++){const n=e.items[t];if(n.kind!=="file")continue;const r=n.getAsFile();if(r&&r.type.startsWith("image/"))return r}return null}function sW(e){const t=Cw(e.dataTransfer?.files??null);return t||iW(e.dataTransfer??null)}function jm(e){const t=document.body?.parentElement??document.body;if(!t)return null;const n=document.elementFromPoint(e.clientX,e.clientY);if(!n)return null;const r=n.closest(".em-element-resize-img-container");if(r){const i=r.querySelector("img");if(i&&t.contains(i))return i}const o=n.closest("img");return!o||!t.contains(o)?null:o}function $s(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Gm(e){if(!$s(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!Cw(t.files);const n=t.items;if(!n?.length)return!0;for(let r=0;r<n.length;r++){const o=n[r];if(o.kind!=="file")continue;const i=o.type||"";if(i.startsWith("image/")||i==="")return!0}return!1}var Aw="em-native-img-drop-target",Xm="em-native-img-uploading",aW="em-native-img-drop-loading",Ec="em-native-file-drag",Ws=null,Qr=null;function Tw(){Qr&&(window.removeEventListener("scroll",Qr.reposition,!0),window.removeEventListener("resize",Qr.reposition),Qr.resizeObserver?.disconnect(),Qr.overlay.remove(),Qr=null)}function lW(e){Tw();const t=document.createElement("div");t.className="em-native-img-upload-spin-overlay",t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.className="em-native-img-upload-spin",t.appendChild(n),document.body.appendChild(t);const r=()=>{const i=e.getBoundingClientRect();t.style.left=`${Math.round(i.left)}px`,t.style.top=`${Math.round(i.top)}px`,t.style.width=`${Math.max(Math.round(i.width),1)}px`,t.style.height=`${Math.max(Math.round(i.height),1)}px`};r(),window.addEventListener("scroll",r,!0),window.addEventListener("resize",r);let o=null;typeof ResizeObserver<"u"&&(o=new ResizeObserver(()=>r()),o.observe(e)),Qr={overlay:t,reposition:r,resizeObserver:o}}function Ym(){Ws&&(Ws.classList.remove(Aw),Ws=null)}function Jr(){ze(document.body,!1,Ec),Ym()}function cW(e){if(!$s(e)){Jr();return}if(!Gm(e)){Jr();return}ze(document.body,!0,Ec);const t=jm(e);if(!t){Ym();return}Ws!==t&&(Ym(),Ws=t,t.classList.add(Aw))}function _w(){Tw(),ze(document.body,!1,aW,Ec),document.querySelectorAll(`.${Xm}`).forEach(e=>{e.classList.remove(Xm)})}function uW(e,t){if(t.lockEditor||!$s(e))return!1;const n=sW(e);if(!n)return!1;const r=jm(e);return r?(t.applicationElementSettingsSet({elem:r}),Jr(),r.classList.add(Xm),lW(r),t.messageService.send({operation:ke.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function dW(e,t){if(t.lockEditor)return;document.body.classList.contains("em-block-insert-body")||t.messageService.send({operation:"application_scroll-block-show"});const n=e.target;n.getAttribute("em")==="atom"&&(ze(document.body,!0,"em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function fW(e,t){t.lockEditor||(Jr(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function mW(e,t){if(e.preventDefault(),t.lockEditor){Jr();return}$s(e)?(Gm(e)&&jm(e)&&(e.dataTransfer.dropEffect="copy"),cW(e)):Jr();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=bn(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=vc(r);o&&Vm(o,Um(o,e.pageY),"block")}else Sw()}else if(document.body.classList.contains("em-atom-insert-body")){const r=n.closest('[em="atom"]');if(r&&r.innerHTML.trim())t.mutableState.targetBlock=r,Vm(r,Um(r,e.pageY),"atom"),yc();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)yc();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=vc(o);i&&(Vm(i,Um(i,e.pageY),"blockatom"),oW())}}}}function pW(e,t){if(t.lockEditor)return;$s(e)&&Gm(e)&&ze(document.body,!0,Ec);const n=e.target;if(document.body.classList.contains("em-block-insert-body")){document.querySelectorAll(".em-block-insert-empty").forEach(o=>{o.classList.remove("em-block-insert-empty")});const r=n.closest('[em="block"]');bn(n)?(n.classList.add("em-block-insert-empty"),Sw()):r&&(t.mutableState.targetBlock=r)}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside")){document.querySelectorAll(".em-atom-insert-empty").forEach(i=>{i.classList.remove("em-atom-insert-empty")});const r=n.closest('[em="atom"]');r&&r.innerHTML.trim()?(t.mutableState.targetBlock=r,document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")&&(t.requireEvenEmptyCell===!1||n.parentElement&&[...n.parentElement.children].indexOf(n)%2===0)||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML?(n.classList.add("em-atom-insert-empty"),document.querySelectorAll(".em-atom-insert, .em-blockatom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")})):document.querySelectorAll(".em-atom-insert").forEach(i=>{i.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}),document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert-empty")});const o=n.closest('[em="block"]');bn(n)?(n.classList.add("em-block-insert-empty"),yc()):o?t.mutableState.targetBlock=o:yc()}}var hW=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function gW(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function bW(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(gW(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...hW)),t.mutableState.newTargetblock=null,t.mutableState.targetBlock=null;return}const r=e.relatedTarget,o=n.closest('[em="block"]');if(r&&o&&o.contains(r))return;t.mutableState.newTargetblock=n.closest('[em="block"]'),t.mutableState.newTargetblock&&(n.closest('[em="block"]')&&(t.mutableState.newTargetblock!==t.mutableState.targetBlock||t.mutableState.newTargetblock.closest('[em="group"]')!==t.mutableState.targetBlock?.closest('[em="group"]'))?t.mutableState.newTargetblock.tagName==="DIV"?t.mutableState.newTargetblock.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):t.mutableState.newTargetblock.querySelectorAll(".em-block-insert").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(i=>{i.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}else if(document.body.classList.contains("em-atom-insert-body")){const r=e.relatedTarget,o=n.closest('[em="atom"]');if(r&&o&&o.contains(r))return;const i=n.closest('[em="block"]');if(r&&i&&i.contains(r))return;t.mutableState.newTargetblock=n.closest('[em="atom"]'),t.mutableState.newTargetblock&&(n.getAttribute("em")==="atom"&&t.mutableState.newTargetblock!==t.mutableState.targetBlock?t.mutableState.newTargetblock.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"):document.querySelectorAll(".em-atom-insert-empty").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top")}));const s=n.closest('[em="block"]');s&&(n.closest('[em="block"]')&&(s!==t.mutableState.targetBlock||s.closest('[em="group"]')!==t.mutableState.targetBlock?.closest('[em="group"]'))?s.tagName==="DIV"?s.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"):s.querySelectorAll(".em-blockatom-insert").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}):document.querySelectorAll(".em-block-insert-empty").forEach(a=>{a.classList.remove("em-atom-insert","em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}))}}function yW(e,t,n){if(!e)return;let r=document.head.querySelector('style[em="styles"]'),o="";r?o=n.HTMLDocument.getInnerHtml(r):(r=document.createElement("style"),r.setAttribute("em","styles"),r=document.head.insertAdjacentElement("beforeend",r));const i=document.createElement("div");t&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,a=>a.replace(/\d+/,String(t)))),i.insertAdjacentHTML("afterbegin",e);let s=n.minify(o+`
|
|
99
|
+
`+[...i.querySelectorAll("style")].map(a=>a.innerHTML).join(`
|
|
100
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;s=n.cssbeautify(s,{indent:" ",autosemicolon:!0}),r&&(r.textContent=`
|
|
101
|
+
`+s+`
|
|
102
|
+
`)}function vW(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
|
|
103
|
+
`)}function EW(e){return e.classList.contains("em-block-insert_bottom-document")||e.classList.contains("em-block-insert_bottom")?"afterend":e.classList.contains("em-block-insert_top-document")||e.classList.contains("em-block-insert_top")?"beforebegin":"afterend"}function kw(){or(),Jr(),ze(document.body,!1,"em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),ze(document.body,!1,"em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>{e.classList.remove("em-atom-insert-empty")}),document.querySelectorAll(".sortable-chosen.sortable-ghost").forEach(e=>{e.classList.remove("sortable-chosen","sortable-ghost")})}function Lw(e,t,n){const r=e.target,o=n.parseFromString(t.settings.blockHTML||"");let i=o.filter(l=>l.tagName&&l.tagName!=="LINK"&&l.tagName!=="STYLE").map(l=>n.getOuterHtml(l)).join("");const s=o.filter(l=>l.tagName==="STYLE").map(l=>n.getOuterHtml(l)).join(""),a=o.filter(l=>l.tagName==="LINK"&&l.getAttribute("em-class")).filter(l=>!document.head?.querySelector(`link[em-class="${l.getAttribute("em-class")}"]`));if(yW(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),vW(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&bn(r))r.getAttribute("em")==="block"&&r.removeAttribute("em"),(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:r}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:r,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),i.substring(0,3)==="<tr"?Qn("new",rr(r),"beforeend",`
|
|
104
|
+
`+i+`
|
|
105
|
+
`):Qn("new",rr(r),"beforeend",`
|
|
106
|
+
<tr><td align="center">
|
|
107
|
+
`+i+`
|
|
108
|
+
</td></tr>
|
|
109
|
+
`),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),or());else if(r.tagName==="BODY"){const l=FS();if(!l)return;const c="afterend";(i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:l}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:l,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),qm("new",`
|
|
110
|
+
`+i+`
|
|
111
|
+
`,l,c),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),or())}else{const l=r.closest('[em="block"]');if(l){const c=vc(l),u=c?EW(c):"afterend";if((i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:l}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:l,project:t.settings.project})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),l.tagName==="TR")i.substring(0,3)==="<tr"?qm("new",`
|
|
112
|
+
`+i+`
|
|
113
|
+
`,l,u):qm("new",`
|
|
114
|
+
<tr em="block"><td align="center">
|
|
115
|
+
`+i+`
|
|
116
|
+
</td></tr>
|
|
117
|
+
`,l,u);else if(i.substring(0,3)==="<tr")if(l.tagName==="TABLE"){const d=document.createElement("table");d.setAttribute("cellspacing","0"),d.setAttribute("cellpadding","0"),d.setAttribute("align","center"),d.setAttribute("border","0"),d.setAttribute("em","block"),d.setAttribute("width",l.hasAttribute("width")?l.getAttribute("width"):String(l.getBoundingClientRect().width)),d.classList.add("em-mob-width-100perc"),zm("new",d,`
|
|
118
|
+
`+i+`
|
|
119
|
+
`,l,u)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),zm("new",d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
120
|
+
`+i+`
|
|
121
|
+
</table>`,l,u)}else Qn("new",l,u,`
|
|
122
|
+
`+i+`
|
|
123
|
+
`);l.querySelectorAll(".em-block-insert").forEach(d=>{d.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),or())}}}var Km="em-live-atom";function Sc(e,t){return t?`<${Km}></${Km}>`:e}function SW(e,t){const[n,...r]=document.querySelectorAll(Km);if(r.forEach(i=>i.remove()),!n||e.contains(n)){n?.remove();return}const o=e.parentElement;$u(e),n.replaceWith(e),o&&e.parentElement&&t(e,o,e.parentElement)}function Nw(e,t=e){return e==='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'?`
|
|
124
|
+
<tr em="block" class="em-structure">
|
|
125
|
+
<td align="center">
|
|
126
|
+
${t}
|
|
127
|
+
</td>
|
|
128
|
+
</tr>`:`
|
|
129
|
+
<style>
|
|
130
|
+
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
131
|
+
.em-mob-wrap {
|
|
132
|
+
display: block!important;
|
|
133
|
+
}
|
|
134
|
+
.em-mob-width-100perc {
|
|
135
|
+
width: 100%!important;
|
|
136
|
+
max-width: 100%!important;
|
|
137
|
+
}
|
|
138
|
+
.em-mob-padding_right-20 {
|
|
139
|
+
padding-right: 20px!important;
|
|
140
|
+
}
|
|
141
|
+
.em-mob-padding_left-20 {
|
|
142
|
+
padding-left: 20px!important;
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
145
|
+
<tr em="block" class="em-structure">
|
|
146
|
+
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
147
|
+
<table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
148
|
+
<tr>
|
|
149
|
+
<td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
|
|
150
|
+
${t}
|
|
151
|
+
</td>
|
|
152
|
+
</tr>
|
|
153
|
+
</table>
|
|
154
|
+
</td>
|
|
155
|
+
</tr>`}function wW(e,t,n,r,o,i,s){t.match(/em="atom"><tr><td>\s*<img/gi)&&!t.match(/class="em-countdown"/gi)&&(t=o.setImageWidth({atomHTML:t,targetAtom:e})),t.match(/class="em-countdown"/gi)?o.insertCountdown({targetElem:e,targetPlace:"beforeend",atomHTML:t}):Qn(i,e,"beforeend",`
|
|
156
|
+
`+Sc(t,s)+`
|
|
157
|
+
`),n!=null&&!s&&(e.closest(".empty-structure")||e.closest(".em-structure"))&&n.remove(),r.settings?.name&&(o.messageService.send("application_atom_inserted",r.settings.name),or())}function CW(e,t,n,r,o,i,s){const a=e.target,l=!!document.querySelector(".em-blockatom-insert"),c=l?a.closest('[em="block"]'):a,u=l?document.querySelector(".em-blockatom-insert"):document.querySelector(".em-block-insert-empty");t.match(/em="atom"><tr><td>\s*<img/gi)&&(t=r.setImageWidth({atomHTML:t,targetAtom:u}));let d=Nw(t,Sc(t,s));t!=='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'&&o(d.match(/<style((.|\n|\r)*?)<\/style>/g)),n.settings?.type!=="project"&&(d=r.commonStylesApplyToBlock({html:d}));let f=null;c.tagName==="TABLE"||c.tagName==="TR"?f=c.querySelector("[data-template-content]")??c.querySelector("td"):f=c,(d.indexOf("empty-structure")>-1||d.indexOf("em-structure")>-1)&&(d=r.setFloatBlocksWidth({blockHTML:d,targetBlock:c,project:n.settings?.project}),d=r.fitImagesToColumns(d));let p="beforeend";l&&f&&(f.classList.contains("em-block-insert_bottom-document")||f.classList.contains("em-block-insert_bottom")?p="afterend":(f.classList.contains("em-block-insert_top-document")||f.classList.contains("em-block-insert_top"))&&(p="beforebegin"));const m=!!t.match(/class="em-countdown"/gi),h=d.substring(0,3)==="<tr";if(c.tagName==="TR")if(h)if(m)r.insertCountdown({targetElem:c,targetPlace:p,atomHTML:d});else{const y=document.createElement("tr");y.setAttribute("em","block"),y.classList.add("em-structure"),Di(i,`
|
|
158
|
+
`+d+`
|
|
159
|
+
`,w=>{y.replaceChildren(...w.flatMap(A=>A instanceof Element&&A.tagName==="TR"?Array.from(A.childNodes):[A])),c.insertAdjacentElement(p,y)})}else if(m)r.insertCountdown({targetElem:c,targetPlace:p,atomHTML:`<tr em="block"><td align="center">
|
|
160
|
+
`+d+`
|
|
161
|
+
</td></tr>`});else{const y=document.createElement("tr");y.setAttribute("em","block"),Di(i,`
|
|
162
|
+
<td align="center">
|
|
163
|
+
`+d+`
|
|
164
|
+
</td>
|
|
165
|
+
`,w=>{y.replaceChildren(...w),c.insertAdjacentElement(p,y)})}else if(h)if(c.tagName==="TABLE")if(bn(a))m?r.insertCountdown({targetElem:p==="beforeend"?rr(c):c,targetPlace:p,atomHTML:d}):Qn(i,p==="beforeend"?rr(c):c,p,d);else{const y=document.createElement("table");y.setAttribute("cellspacing","0"),y.setAttribute("cellpadding","0"),y.setAttribute("align","center"),y.setAttribute("border","0"),y.setAttribute("em","block"),y.setAttribute("width",c.hasAttribute("width")?c.getAttribute("width"):String(c.getBoundingClientRect().width)),y.classList.add("em-mob-width-100perc"),m?(Ew(y,Ie(`
|
|
166
|
+
`+d+`
|
|
167
|
+
`,!0)),r.insertCountdown({targetElem:c,targetPlace:p,atomHTML:r.getOuterHtml(y)})):zm(i,y,`
|
|
168
|
+
`+d+`
|
|
169
|
+
`,c,p)}else m?r.insertCountdown({targetElem:c,targetPlace:p,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
170
|
+
`+d+`
|
|
171
|
+
</table></div>`}):Qn(i,c,p,`
|
|
172
|
+
<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
173
|
+
`+d+`
|
|
174
|
+
</table></div>
|
|
175
|
+
`);else m?r.insertCountdown({targetElem:c,targetPlace:p,atomHTML:d}):Qn(i,c,p,`
|
|
176
|
+
`+d+`
|
|
177
|
+
`);document.querySelectorAll(".em-blockatom-insert").forEach(y=>{y.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),n.settings?.name&&(r.messageService.send("application_atom_inserted",n.settings.name),or())}function AW(e,t,n,r,o){const i=document.querySelector(".em-atom-insert");if(e.match(/em="atom"><tr><td>\s*<img/gi)&&i&&(e=n.setImageWidth({atomHTML:e,targetAtom:i})),!i)return;let s="afterend";i.classList.contains("em-atom-insert_bottom-document")||i.classList.contains("em-atom-insert_bottom")?s="afterend":(i.classList.contains("em-atom-insert_top-document")||i.classList.contains("em-atom-insert_top"))&&(s="beforebegin");const a=!!e.match(/class="em-countdown"/gi);if(i.tagName==="TR"){const l=document.createElement("div");R0(l,e);const c=l.querySelector('[em="atom"]');c&&c.removeAttribute("em");let u=0;const d=i.querySelector("[colspan]");d?u=d.getAttribute("colspan")||0:u=i.childElementCount,o?.removeAttribute("em");const f=o?Sc(e,o):bt(l),p=`
|
|
178
|
+
<tr em="atom"><td colspan="`+u+`">
|
|
179
|
+
`+f+`
|
|
180
|
+
</td></tr>
|
|
181
|
+
`;a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:p}):Qn(r,i,s,p)}else a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:e}):Qn(r,i,s,`
|
|
182
|
+
`+Sc(e,o)+`
|
|
183
|
+
`);i.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"),t.settings?.name&&(n.messageService.send("application_atom_inserted",t.settings.name),or())}function xw(e,t){const n=t.mutableState.atomReplaced,r=e.dataTransfer?.getData("Text")||"",o=r&&t.isJsonString(r)?"new":"moved",i=o==="new"?JSON.parse(r):{settings:{atomHTML:n?Ii(n):""}},s=o==="moved"?i.settings.atomHTML:"",a=n&&s&&!s.match(/class="em-countdown"/gi)?n:null;try{TW(e,t,o,i,a)}finally{a&&SW(a,t.fitMovedImage)}}function TW(e,t,n,r,o){const i=t.mutableState.atomReplaced,s=e.target,a=d=>t._setDocumentStyles(d,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument});if(!r.settings?.atomHTML)return;let l=r.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();o||a(r.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),l=t.commonStylesApply({html:l});const c=s.closest('[em="block"]')&&s.tagName==="TD"&&!s.innerHTML&&!s.hasAttribute("height")&&(s.classList.contains("em-atom-insert-empty")||eW()),u=s.tagName==="DIV"&&s.closest("amp-accordion")&&!s.innerHTML;if(c||u){wW(s,l,i,r,t,n,o);return}if(document.querySelector(".em-blockatom-insert")||bn(s)){CW(e,l,r,t,a,n,o);return}s.closest('[em="atom"]')&&AW(l,r,t,n,o)}var _W=/^[\t\n\f\r ]*$/;function kW(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&_W.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function LW(e,t){let n=!1;const{activeElement:r}=t;if(e.link!==void 0){const o=t.getActiveEditElement();if(!o)return n;if(e.link!==""){const i=o.closest("a");if(i)i.setAttribute("href",e.link);else{const s=document.createElement("a");s.setAttribute("href",e.link),s.setAttribute("target","_blank"),o.parentNode?.insertBefore(s,o),s.appendChild(o),t.setCursorPosition(s)}}else{const i=o.closest("a");i&&(kW(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&Nh(r)&&Lt(r,"src",e.src??""),e.src!==void 0&&_w(),e.alt!==void 0&&r.setAttribute("alt",e.alt),e.title?r.setAttribute("title",e.title):e.title===""&&r.removeAttribute("title"),e.border&&t.setElementBorder({settings:e,elem:r}),e.boxShadow&&t.setElementBoxShadow({settings:e,elem:r}),e.align&&e.align!=="undefined"?r.closest("div, p, td")?.setAttribute("align",e.align):e.align===""&&r.closest("div, p, td")?.removeAttribute("align"),e.valign?r.style.verticalAlign=e.valign:e.valign===""&&r.style.removeProperty("vertical-align"),e.width&&(e.width.value!==void 0&&e.width.value!==null?(r.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),r.style.width="100%",r.style.maxWidth=e.width.value+e.width.dim):(r.setAttribute("width","0"),r.style.width="100%",r.style.maxWidth="0")),e.height&&(e.height.value!==void 0&&e.height.value!==null?(r.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),r.style.height=e.height.value+e.height.dim):(r.removeAttribute("height"),r.style.removeProperty("height"))),e.borderRadius&&t.setElementBorderRadius({settings:e,elem:r}),e.mobileWidth&&(t.setElementMobileWidth({settings:e,elem:r}),n=!0),e.mobileHeight&&(t.setElementMobileHeight({settings:e,elem:r}),n=!0),e.mobileBorder&&(t.setElementMobileBorder({settings:e,elem:r}),n=!0),e.mobileBorderRadius&&(t.setElementMobileBorderRadius({settings:e,elem:r}),n=!0),e.mobileBoxShadow&&(t.setElementMobileBoxShadow({settings:e,elem:r}),n=!0),e.mobileAlign){const o=r.closest("div, p, td");o&&t.setElementMobileAlign({settings:e,elem:o}),n=!0,e.mobileAlign.value?r.style.display="inline-block":r.style.display="block"}if(e.mobileVerticalAlign&&(t.setElementMobileVerticalAlign({settings:e,elem:r}),n=!0),e.show&&(t.setElementShow({settings:e,elem:r}),n=!0),e.countdown){const o=new Image;o.onload=function(){r.setAttribute("width",String(Math.round(this.width/2))),r.style.maxWidth=Math.round(this.width/2)+"px"};const i=e.countdown?.link??"";o.src=i,Lt(r,"src",i),r.setAttribute("em-cd-settings",e.countdown.params)}if(e.video&&r.setAttribute("em-video-settings",JSON.stringify(e.video)),e.imgReplacer){const o=e.imgReplacer??"",i=r.closest("em-replace");if(i)Lt(i,"src",o);else{const s=document.createElement("em-replace");Lt(s,"src",o),r.parentNode?.insertBefore(s,r),s.appendChild(r)}}else if(e.imgReplacer===""){const o=r.closest("em-replace");o&&(o.parentNode?.insertBefore(r,o),o.remove())}return n}function NW(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),Fs(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&Fs(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function xW(e,t){const{activeElement:n,setElementMobileHeight:r}=t;let o=!1;if(e.height)if(n.tagName==="DIV"){const i=e.height.value+e.height.dim;n.style.height=i,n.style.lineHeight=i,n.style.fontSize=e.height.value>10?parseInt(e.height.value)-2+e.height.dim:"8px"}else n.tagName==="TD"&&n.setAttribute("height",String(e.height.value));return e.mobileHeight&&(r({settings:e,elem:n}),o=!0),o}function OW(e,t){const{activeElement:n,isVariableText:r}=t,o=n.nextSibling?.nodeType===8?n.nextSibling:null;if(!o||!e.value)return;let i=e.value;i.startsWith("<!--")&&(i=i.substring(4)),i.endsWith("-->")&&(i=i.substring(0,i.length-3)),r(`<!--${i}-->`)?o.nodeValue=i:o.replaceWith(i)}function RW(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var qs=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function MW(e){const t=i=>{e.commit(i)},n={addFontFamilyClass:i=>_s(i,t),clearLinkTags:i=>{Zr(i,t),Ar(t)}},r=(i,s)=>{const{settings:a}=i,l=mc(s),c={setElementMobileWidth:cS,setElementMobileHeight:ti,setElementMobileBorder:m6,setElementMobileBorderRadius:p6,setElementMobileBoxShadow:h6,setElementMobileAlign:uS,setElementMobileTableAlign:g6,setElementMobileVerticalAlign:dS,setElementMobileDirection:b6,setElementMobileBackgroundColor:y6,setElementMobileBackgroundImage:v6,setElementMobileBackgroundPositionX:E6,setElementMobileBackgroundPositionY:S6,setElementMobileBackgroundRepeat:w6,setElementMobileBackgroundSize:C6,setElementMobilePadding:xs,setElementMobileFontSize:fS,setElementMobileLineHeight:mS,setElementShow:pS},u={setElementBorder:Uf,setElementBoxShadow:N8,setElementBorderRadius:ws},d={activeElement:s,setPercentsForColumns:Xu,setElementMobileHeight:ti},f={parseTableElementToModel:Ns,tableModelToHtml:$t,updateTablePadding:zB,updateBackgroundPosition:UB,removeStyleProperty:e6,updateBorderRadius:n6,removeClassByPrefix:i6,getCellsWithClasses:jB,updateTableCellBackgroundByIds:GB,addClassToCellsByIds:XB,getExternalBorders:KB,mergeUniCells:s6,updateCellBordersByIds:YB,getExternalCorners:QB,updateCellBorderRadiusByIds:ZB,updateCellPaddingByIds:JB,removeOuterBorders:r6,simplifyBorders:o6};switch(i.type){case"img":case"countdown":case"video":LW(a,{activeElement:s,getActiveEditElement:Yu,setCursorPosition:e.setCursorPosition,...u,...c});break;case"a":NW(a,{activeElement:s,textStyleProperties:qs,toggleTextStyle:e.toggleTextStyle});break;case"table":EF(a,{activeElement:s,...u,...c});break;case"td":case"structure":case"group":case"column":wF(a,{activeElement:s,requestType:i.type,textStyleProperties:qs,isElementListContainer:GH(s),isProgrammaticSelection:e.programmaticSelection,...u,...c,setContrastBlock:A6,setStructureBlocksWidth:pc,toggleTextStyle:e.toggleTextStyle,removeEditorTags:oi,addClassToSecondCell:hH,wrapEditor:e.wrapEditor,addNewRange:Lo});break;case"button":gF(a,{activeElement:s,textStyleProperties:qs,...u,...c,toggleTextStyle:e.toggleTextStyle,compareStrings:Xg});break;case"div":vF(a,{activeElement:s,...u,...c});break;case"vindent":xW(a,{activeElement:s,setElementMobileHeight:ti});break;case"var":OW(a,{activeElement:s,isVariableText:a1});break;case"floatBlock":_F(a,{activeElement:s,setElementMobileWidth:cS,setElementMobileContentWidth:f6,setElementMobileVerticalAlign:dS,setElementShow:pS});break;case"text":j$(a,{activeElement:s,textStyleProperties:qs,toggleTextStyle:e.toggleTextStyle,collectVMLContent:S1,updateVMLComments:w1,removeClassesByPrefix:zf,createFontClassName:$f,...n,handleTextScriptSettings:KF,handleTextReplacer:ZF,handleTextAnchor:r$,unwrapNestedTags:gN,wrapInTag:Bg,unwrapTag:bN,isRangeMatching:yN,splitWrapper:vN,cleanEmptyTags:EN,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:Xg,setElementMobileFontSize:fS,setElementMobileLineHeight:mS,setElementMobileAlign:uS,updateTableStyle:X7,changeBullets:Y7,changeBulletsColor:K7,changeBulletsSize:Z7,changeBulletsItalic:J7,changeBulletsWeight:Q7,changeBulletsStrikethrough:tH,changeBulletsUnderline:eH,findElementWithSelectedText:qi,removeEditorTags:oi,isElementList:l.isList,isElementListOL:l.isListOL,classNameOl:l.classNameOl,classNameUl:l.classNameUl,commit:t});break;case"floatBlocksWidths":kF(a,d);break;case"floatBlocksPreset":LF(a,d);break;case"floatBlocksValign":NF(a,d);break;case"floatBlocksGap":xF(a,d);break;case"floatBlocksGapMobile":OF(a,d);break;case"carousel":FF(a,{activeElement:s,HTMLDocument:e.htmlDocument,setElementBorderRadius:ws,commit:t});break;case"accordion":WF(a,{activeElement:s,HTMLDocument:e.htmlDocument,setElementBorderRadius:ws,commit:t});break;case"social":{const p=YF(a,{activeElement:s,commit:t});if(p)return p;break}case"customTable":o$(a,{activeElement:s,activeCell:O.get("activeCell"),state:O,...f,wrapEditor:e.wrapEditor,addNewRange:Lo,toggleTextStyle:e.toggleTextStyle,textStyleProperties:qs,commit:t,...c})}return s},o=(i,s,a,l)=>{O.increment("activeElementLocked");const c=i;let u=i;e.commitLockedAsync().finally(()=>{const d=hF(u,c,s,a,{getMappedParent:f=>e.htmlDocument.getMappedParent(f)??void 0,getOuterHtml:f=>e.htmlDocument.getOuterHtml(f),applyHidden:f=>e.htmlDocument.applyHidden(f)});if(!d){O.decrement("activeElementLocked"),e.setCursorPosition(u),l?.();return}u=d.active,e.commitLockedAsync().finally(()=>{d.afterCommit(),O.decrement("activeElementLocked"),e.setCursorPosition(u),l?.()})})};return i=>{try{O.increment("activeElementLocked");const s=i.data;s.settings=e.getMapObj().escape(s.settings);const a=Yu();if(!a){s.type==="customTable"&&(r(s,null),e.commitLockedAsync());return}e.beforeApply?.(s,a);const l=pF(a),c=r(s,a);e.afterApply?.(s,c);const u=RW(s)?Ug():null;try{EE()}catch{}o(c,l,s,u?()=>PN(u,d=>e.htmlDocument.renderOnly(d)):void 0)}catch{}finally{Promise.resolve().then(()=>O.decrement("activeElementLocked"))}}}var PW=3e3,IW=3,Zm=Promise.resolve(),Qm=0,Jm=0;function Ow(){return Ia()?Mi().entityId:void 0}async function DW(e,t){let n=!1;const r=()=>{n||(n=!0,e())},o=(async()=>{t&&await GN(),await hL(r)})();let i;const s=new Promise(a=>{i=setTimeout(()=>{r(),a()},PW)});try{await Promise.race([o,s])}catch{r()}finally{clearTimeout(i)}}function Rw(e,t){if(Qm>=IW)return;Qm++;const n=Ow(),r=Jm>0||jN(),o=async()=>{try{await DW(()=>{Ow()===n&&e.send({operation:ke.APPLICATION_ACTION,action:t})},r)}finally{Qm--,r&&Jm--}};r?(Jm++,Zm=Zm.then(o,o)):Zm=o()}function BW(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}var HW={historyUndo:"undo",historyRedo:"redo"};function FW(e,t){const n=HW[e.inputType];return!n||!e.target?.closest?.("editor")?!1:(e.preventDefault(),e.stopPropagation(),Rw(t.messageService,n),!0)}function $W(e,t,n,r){if(!((window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&!t&&n!=="start"&&!e.ctrlKey&&!e.metaKey))return!1;const o=e.target,i=o.tagName==="EDITOR"?o:o.closest("editor");if(i){if(i.querySelectorAll(".em-code")?.length){const u=_t(()=>{const d=r.getAllComments(o);for(const f of d)r.isVariableComment(f)&&(r.getVariableIcon(f)||f.remove());i.removeEventListener("input",u)});i.addEventListener("input",u)}return!0}const s=document.querySelector("[em-edit]");if(!s||s.closest("editor"))return!1;const a=r.getElementParent(s);let l=s.parentNode;const c=s.closest("editor");if(r.setCursorPosition(a),s.classList.contains("em-mob-wrap")){r.removeElementEditors();const u=s.closest("tr");if(u&&[...u.cells].every(d=>!d.textContent?.trim())){const d=s.closest("table");l=d?.parentNode||null,d?.remove()}}else if(s.classList.contains("em-code")){const u=r.getVariableByIcon(s);u&&(u.parentNode?.removeChild(u),s.remove())}else if(s.tagName==="TD"&&s.innerHTML===""&&s.hasAttribute("height")){const u=s.closest("table");if(u){const d=u.previousSibling;d&&d.textContent?.trim()===""&&d.remove(),u.remove()}}else if(s.closest(".em-element-resize-img-container")){const u=s.closest(".em-element-resize-img-container");l=u.parentNode;const d=s.closest("td")?.querySelector("editor");d&&d.innerHTML===""&&d.remove(),u.remove()}else if(s.closest('[em="atom"]')){const u=s.closest('[em="atom"]');l=u.parentNode;const d=s.closest(".em-mob-wrap, .noresp-em-mob-wrap");s.tagName==="TD"&&s.previousElementSibling===null&&s.nextElementSibling===null?u.remove():s.remove(),s.tagName!=="TD"&&d&&d.textContent?.trim()===""&&(d.textContent="")}else if(s.parentElement?.tagName==="TR"&&s.parentElement.getAttribute("em")==="group"&&document.querySelectorAll('[em="group"]').length===1)s.querySelector(".em-narrow-table")?.replaceChildren();else{s.remove();const u=s.previousSibling;u&&u.textContent?.trim()===""&&u.remove()}return c&&c.remove(),l&&r.removeEmptyParents(l),r.commit(),r.messageService.send({operation:"application_element_settings_close"}),!0}function WW(e,t){if(!(e.keyCode===39||e.key==="ArrowRight"))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0),o=r.startContainer,i=o.nodeType===Node.TEXT_NODE?o.parentElement:o;if(i?.closest("em-replace"))return!1;const s=Nn(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;for(const p of a){const m=s?.closest(p);if(m){l=m;break}}if(!l||!t.isCaretAtEndOfStandardElement(r,l))return!1;e.preventDefault();const c=l.nextSibling;if(c&&c.nodeType===Node.TEXT_NODE&&(c.textContent?.length||0)>0){const p=c.textContent||"";return p[0]===" "||p[0]===" "?(t.setCursorPositionSimple(c,1),!0):(c.textContent=" "+p,t.setCursorPositionSimple(c,1),t.commit(),!0)}const u=l.parentNode;if(!u)return!0;if(c&&c.nodeType===Node.ELEMENT_NODE&&c.tagName==="SPAN"&&c.textContent===" ")return t.setCursorInsideSpan(c),!0;const d=document.createElement("span"),f=document.createTextNode(" ");return d.appendChild(f),c?u.insertBefore(d,c):u.appendChild(d),t.setCursorInsideSpan(d),!0}function qW(e,t,n,r,o){if(!(e.keyCode===13&&!n||(e.key==="Enter"||e.keyCode===13)&&e.shiftKey&&n&&r))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!t)return!0;const i=window.getSelection(),s=i&&i.rangeCount>0?i.getRangeAt(0):null;if(!s)return!0;const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A";s.collapsed||s.deleteContents();const u=document.createElement("br");if(a?.nextSibling===null&&c&&a.nodeType===Node.TEXT_NODE){if(i.anchorOffset===0)return l.parentNode.insertBefore(u,l),o.commit(),!0;if(i.anchorOffset===(a.textContent?.length||0))return l.after(u),s.setStartAfter(u),s.setEndAfter(u),o.commit(),!0}if(n){const d=t.querySelector('div[em-edit="active"]');if(!(d&&d.contains(s.startContainer))&&d){const f=d.lastChild;f&&s.setStart(f,f.textContent?.length||0)}}return s.insertNode(u),s.setStartAfter(u),s.setEndAfter(u),i.removeAllRanges(),i.addRange(s),o.commit(),!0}function zW(e){const t=e.target,n=t?.closest?.("a")||t?.querySelector?.("a");if(!n)return!1;const r=n.closest("td")||n.parentElement;return r?O1(r,n.textContent||""):!1}function UW(e){const t=_t(r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!Cr(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&O1(s,i.textContent||"")&&e(!1)})}),n=_t(r=>{zW(r)&&e(!1)});return document.addEventListener("input",t,!1),document.addEventListener("focusout",n,!1),{dispose(){document.removeEventListener("input",t,!1),document.removeEventListener("focusout",n,!1)}}}var VW=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function jW(e){const{commit:t,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:o,getParentElementOfSelection:i,findOutermostParentWithText:s,clearLinkTags:a,addFontFamilyClass:l,getIsProgrammaticSelection:c,getCommonStyles:u}=e,d=o,f=i,p=s;function m(g,E,C){const _=!!g&&!!E&&E.tagName==="DIV"&&g.tagName==="EDITOR"&&g.parentElement===E&&E.childElementCount===1&&E.firstElementChild===g&&!Array.from(E.childNodes).some(M=>M!==g&&M.nodeType===Node.TEXT_NODE&&!!M.textContent?.trim()),x=!!g&&g.childElementCount===0&&Array.from(g.childNodes).some(M=>M.nodeType===Node.TEXT_NODE&&!!M.textContent?.trim()),N=!!g&&Pe(g).trim()===C.trim();if(!_||!x||!N||!g.hasAttribute("em-edit")||!E.parentNode)return;const W=E.parentNode,R=g.getAttribute("em-edit")||"active";for(;g.firstChild;)E.appendChild(g.firstChild);g.remove(),g.removeAttribute("em-edit"),E.setAttribute("em-edit",R),W.replaceChild(g,E),g.appendChild(E)}function h(g,E){try{return E.intersectsNode(g)}catch{const C=document.createRange();return C.selectNodeContents(g),E.compareBoundaryPoints(Range.END_TO_START,C)<0&&E.compareBoundaryPoints(Range.START_TO_END,C)>0}}function y(g){const E=g?.links||{},C=E.underline,_=E.color,x=typeof C=="boolean"?C?"underline":"none":"underline";return{color:typeof _=="string"&&_.trim()?_.trim():"inherit",textDecoration:x}}function w(g,E){if(!g||!E)return null;const C=E,_=Array.from(C.querySelectorAll("a"));C.tagName==="A"&&_.unshift(C);const x=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,N=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const W of _){const R=document.createRange();R.selectNodeContents(W);const M=R.compareBoundaryPoints(x,g)<=0,te=R.compareBoundaryPoints(N,g)>=0;if(M&&te)return W}return null}function A(g,E,C){const _=Array.from(E?.getElementsByTagName("span")||[]).reverse();let x=!1;Pe(E)===g&&_.length&&(x=!0),_.forEach(N=>{const W=N.getAttribute("style"),R=!!W&&W.trim().length>0;let M=Array.from(N.attributes).filter(j=>j.name!=="style");if(!R&&M.length===1&&M[0].name==="em-edit"&&N.parentElement&&!N.parentElement.hasAttribute("em-edit")){const j=N.getAttribute("em-edit")||"active";N.parentElement.setAttribute("em-edit",j),N.removeAttribute("em-edit"),M=Array.from(N.attributes).filter(ne=>ne.name!=="style")}const te=M.length>0;if(!R&&!te){const j=Pe(N);if(N.childNodes.length===1&&N.childNodes[0].nodeType===3){const ne=N.childNodes[0];N.parentNode?.replaceChild(ne,N),C.isEditorTagOutside&&Pe(E)!==g&&ne.parentNode&&(C.range?.selectNode(ne),n(C.range))}else{const ne=Array.from(N.childNodes);ne.forEach(re=>{N.parentNode?.insertBefore(re,N)}),g===j&&(C.range=document.createRange(),C.range.setStartBefore(ne[0]),C.range.setEndAfter(ne[ne.length-1]),n(C.range)),N.parentNode?.removeChild(N)}}}),x&&(r(E,g),C.range.selectNode(E),n(C.range))}function k(g,E){if(g?.rangeCount>0){const C=g.getRangeAt(0),_=C.commonAncestorContainer;let x=C.startOffset,N=C.endOffset;for(;_.data&&x>0&&!/\s/.test(_.data[x-1]);)x--;for(;_.data&&N<_.length&&!/\s/.test(_.data[N]);)N++;E.setStart(_,x),E.setEnd(_,N),n(E)}}function b(g,E,C){g.innerHTML=Ue(g).replaceAll(/<\/?strike[^>]*>/gi,""),Yt(g),g.parentNode&&(C.selectNode(g),n(C),r(g,E))}let v=!1;function S(){document.execCommand("styleWithCSS",!1,"true"),v=!0}function T(g,E){const C=v$(E.settings,V),_=E.settings.textColor??E.settings.textBackgroundColor;if(typeof _=="string"&&_.trim()!==""&&!V(_))return!1;const x=mc(g),{classNameOl:N,classNameUl:W,classNameBullet:R,isListOL:M,isListUL:te,isList:j}=x;j&&x.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(q=>{const nt=q.querySelector(":scope > div")||q.querySelector(":scope > editor div");nt&&nt.classList.add(`${R}`)}),g?.querySelectorAll(".em-element-path").forEach(q=>q.remove());const ne=Object.keys(E.settings)[0];let re=window.getSelection();if(!re||re.rangeCount===0){if(!g||!g.isConnected)return;const q=document.createRange();if(q.selectNodeContents(g),re=window.getSelection(),!re)return;re.removeAllRanges(),re.addRange(q)}let Q=re.getRangeAt(0);const be=Q.commonAncestorContainer;let de=be.nodeType===1?be:be.parentElement,Ee=re.anchorNode?.nodeType===1?re.anchorNode:re.anchorNode?.parentElement,me=!1,X=Ze();if(g||(g=re.anchorNode?.childNodes.length===1&&re.anchorNode.firstChild?.nodeType===1?re.anchorNode.firstChild:de,g.tagName==="EDITOR"&&(g=g.parentElement)),C.name==="textLink"&&C.value===""){const q=de?.closest?.("a, [href]")||null;q&&(Q.selectNode(q),n(Q),g=q)}if(C.name==="textUnderline"&&!C.value){let q=de.closest(["u","strike","[style*=text-decoration]","span","a"].find(nt=>de?.closest(nt))||"u");!q&&g?.tagName==="A"&&(q=g),q?.tagName==="A"&&(q.style.textDecoration="none",r(q,X),Q.selectNode(q),n(Q),g=q,me=!0)}let B=E.type==="button"?(g||Ee)?.closest("a"):(g||Ee)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const Y=E.settings.fontFamily;let Ot=null;const U=Array.from(B?.classList||[]).some(q=>(q.startsWith("em-font-")&&(Ot=q),q.startsWith("em-font-")&&q.includes(C.name==="textItalic"?"Italic":"Bold")));U&&(C.name==="textItalic"||C.name==="textStrong")&&Ot&&B?.classList.remove(Ot);const tn={range:Q,isEditorTagOutside:!1},mt=(q=Ze(),nt=B)=>{A(q,nt,tn)},nn=YH,qt=sw,vn=(q,nt)=>{b(q,X,tn.range)};let zt,ot;ne==="textColor"?zt=ot="color":ne==="textBackgroundColor"&&(zt="backgroundColor",ot="background-color");const St=E.settings.hasOwnProperty("textColor")||E.settings.hasOwnProperty("textBackgroundColor"),pt=!!de?.closest("editor")||Pe(de)===X||Pe(de.querySelector("editor"))===X;tn.isEditorTagOutside=pt,E.settings.hasOwnProperty("textColor")&&C.value&&S();const Pc=KH,Vn=c(),Zs=u();if(N$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V})||x$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,fontFamilyArray:Y,removeClassesByPrefix:zf,createFontClassName:$f,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:mt}))return!1;const so=de.closest(C.tags.find(q=>de?.closest(q))||"span");(Q?.collapsed||!Ze())&&(C.value?C.value&&pt&&(E.type==="button"||g.tagName==="A"&&so?Q.selectNodeContents(so):k(re,Q)):so&&Q.selectNodeContents(so)),(E.type==="button"||g.tagName==="A"||g?.closest("a"))&&Ze()&&Ze()!==Pe(g)&&so&&(E.settings.hasOwnProperty("textLink")||E.settings.hasOwnProperty("textUnderline"))&&(Q.selectNode(so),n(Q),E.settings.hasOwnProperty("textUnderline")&&g.tagName==="A"&&(g.style.textDecoration=C.value?"underline":"none",me=!0)),re=window.getSelection(),Q=re.getRangeAt(0),tn.range=Q,X=Ze(),Array.from(B?.querySelectorAll("span,div")||[]).reverse().forEach(q=>{q.getAttribute("style")===""&&q.removeAttribute("style"),q.hasAttribute("contenteditable")&&q.removeAttribute("contenteditable"),q.hasAttribute("em-edit")&&q.removeAttribute("em-edit"),q.hasAttribute("em-relative")&&q.removeAttribute("em-relative"),q.hasAttribute("class")&&(q.classList.remove("em-relative"),q.classList.length===0&&q.removeAttribute("class"))});let ce=null;St&&ot&&B?.style?.getPropertyValue?.(ot)?.trim()&&(Pe(B)===X&&(B.style[zt]=V(C.value?.toString())||"",me=!0),zt==="color"&&(de===B||g?.closest('[style*="color"]')===B)&&(ce=V(B.style[ot]),B.style.removeProperty(ot),!B?.hasAttribute("em-edit")&&j&&B&&Vn&&B.closest("tr")?.querySelector(`.${R}`)?.style.removeProperty(ot)));let rn=null,Ic=null;if(St&&zt==="color"&&["A","LI"].includes(B?.tagName)){let q=B.parentElement;for(;q&&!["BODY","HTML","TD","TH"].includes(q.tagName);){const nt=q.style.getPropertyValue("color")?.trim();if(nt){rn=V(nt)||nt,Ic=q,q.style.removeProperty("color");break}q=q.parentElement}}ot&&!(C.value.length===7||C.value.length===4)&&(me=!0),pt&&(!C.value&&C.name!=="fontSize"&&C.name!=="textLink"||C.value)&&(!(C.name==="textUnderline"||C.name==="textStrikethrough")||E.type!=="button")&&!me&&(C.name!=="fontSize"&&!St&&Pe(B)===X?To(C.command,!1,St?C.value:C.name==="textLink"?" ":void 0):Pe(B)!==X&&(E.settings.hasOwnProperty("textColor")&&S(),To(C.command,!1,St?String(C.value):C.name==="textLink"?" ":void 0),E.settings.hasOwnProperty("textColor")&&C.value&&k$(B||de,String(C.value),V))),X=Ze();{const q={parentElement:de,parentNode:Ee,parentWrapper:B,selection:re,range:Q};M$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:g,hasItalicClass:U,tempStyleClass:Ot,checkForWorkClass:nn,removeFormattingTags:Fi,cleanEmptySpans:mt,mutableState:q,currentStyle:zt,isProgrammaticSelection:Vn,findParentWithFontSizeAndTag:eF}),de=q.parentElement,Ee=q.parentNode,B=q.parentWrapper,re=q.selection,Q=q.range,tn.range=Q}O$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:g,hasItalicClass:U,tempStyleClass:Ot,checkForWorkClass:nn,removeFormattingTags:Fi,cleanEmptySpans:mt}),R$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:g,hasItalicClass:U,tempStyleClass:Ot,checkForWorkClass:nn,removeFormattingTags:Fi,cleanEmptySpans:mt});const Qs={parentWrapper:B,range:Q,selection:re};P$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:g,hasItalicClass:U,tempStyleClass:Ot,checkForWorkClass:nn,removeFormattingTags:Fi,cleanEmptySpans:mt,request:E,findOutermostParentWithText:p,mutableState:Qs}),B=Qs.parentWrapper,Q=Qs.range,tn.range=Q;const fi={parentWrapper:B,range:Q,selection:re};if(I$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,activeElement:g,hasItalicClass:U,tempStyleClass:Ot,checkForWorkClass:nn,removeFormattingTags:Fi,cleanEmptySpans:mt,request:E,findOutermostParentWithText:p,cleanStrikesInElement:vn,mutableState:fi}),B=fi.parentWrapper,C.value===!1&&B){const q=window.getSelection(),nt=q&&q.rangeCount>0?q.getRangeAt(0):Q,En={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[C.name];let Sn=!1;En&&En.forEach(Se=>{Array.from(B.getElementsByTagName(Se)).reverse().forEach(ht=>{if(!h(ht,nt))return;const jn=Pe(ht);if(!jn||jn.trim().length===0)return;const at=ht.parentElement;ht.hasAttribute("em-edit")&&at&&!at.hasAttribute("em-edit")&&at.setAttribute("em-edit",ht.getAttribute("em-edit")||"active"),ht.outerHTML=ht.innerHTML,Sn=!0,m(at,B,X)})}),Sn&&setTimeout(()=>{const Se=document.querySelector("[em-edit]")||d(X)||(B?.isConnected?B:null);Se&&r(Se,X)},0)}if(C.value===!0&&B&&pt){const q={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},nt={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},En=q[C.name],Sn=nt[C.name];if(En&&Sn&&X&&X.trim().length>0){const Se=B,ht=Sn.some(kr=>Se.getElementsByTagName(kr).length>0),jn=(Se.style?.textDecoration||"").toLowerCase(),at=(Se.style?.textDecorationLine||"").toLowerCase(),wn=jn.includes("underline")||at.includes("underline"),Rt=jn.includes("line-through")||at.includes("line-through"),ir=C.name==="textUnderline"&&wn||C.name==="textStrikethrough"&&Rt,Bc=Pe(Se)===X;if(!ht&&!ir&&Bc){const kr=document.createElement(En);for(;Se.firstChild;)kr.appendChild(Se.firstChild);Se.appendChild(kr);try{const Cn=document.createRange();Cn.selectNodeContents(kr),n(Cn),Q=Cn,tn.range=Cn}catch{}setTimeout(()=>{const Cn=document.querySelector("[em-edit]")||d(X)||(Se.isConnected?Se:null);Cn&&r(Cn,X)},0)}}}const tt={parentWrapper:B,parentNode:Ee,range:Q,selection:re};D$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,isColorChange:St,tempColor:ce,outerContextColor:rn,outerContextElement:Ic,stylePropretyName:ot,currentStyle:zt,canselExecCommand:me,isProgrammaticSelection:Vn,request:E,setCustomColor:Pc,checkForWorkClass:nn,cleanEmptySpans:mt,mutableState:tt}),B=tt.parentWrapper,Ee=tt.parentNode;const _r={parentWrapper:B,parentNode:Ee,range:Q,selection:re};if(H$({parentElement:de,parentNode:Ee,parentWrapper:B,currentSettings:C,isElementList:j,classNameBullet:R,isEditorTagOutside:pt,selectedText:X,range:Q,selection:re,checkForTextNodes:qt,commit:t,getInnerText:Pe,getSelectedText:Ze,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:V,findOutermostParentWithText:p,activeElement:g,commonStyles:Zs,cleanEmptySpansWithParent:mt,mutableState:_r}),Q=_r.range,C.name==="textLink"&&C.value===!0&&pt&&B&&X?.trim().length>0){const q=_r.range||Q,nt=X.trim(),En=[...B?Array.from(B.querySelectorAll("a")):[],...B?.parentElement?Array.from(B.parentElement.querySelectorAll("a")):[]],Sn=En.find(Se=>Pe(Se)?.trim()===nt)||En[0]||null;if(!(w(q,B)||w(q,B.parentElement)||Sn)&&q&&!q.collapsed){const Se=document.createElement("a"),{color:ht,textDecoration:jn}=y(Zs);Se.setAttribute("target","_blank"),Se.setAttribute("href",""),Se.setAttribute("new","true"),Se.setAttribute("style",`color: ${ht}; text-decoration: ${jn};`);let at=!1;const wn=B.querySelector("editor");if(wn&&Pe(wn)===X&&wn.querySelector("a")===null){for(;wn.firstChild;)Se.appendChild(wn.firstChild);wn.appendChild(Se),at=!0}try{if(!at){const Rt=q.extractContents();Rt.childNodes.length>0&&(Se.appendChild(Rt),q.insertNode(Se),at=!0)}}catch{at=!1}if(!at&&Pe(B)===X){for(;B.firstChild;)Se.appendChild(B.firstChild);B.appendChild(Se),at=!0}if(at){try{const Rt=document.createRange();Rt.selectNodeContents(Se),n(Rt),Q=Rt,_r.range=Rt,tn.range=Rt}catch{}r(Se,X)}}}const Dc=C.name==="textUnderline"&&!C.value;if((!St&&me||Dc)&&mt(X),VW.has(C.name)){const q=_r.parentWrapper||B||d(X)||f();q&&mt(X,q)}j&&de.querySelectorAll(`tr td:first-child > div.${R}, tr td:first-child > editor div.${R}`).forEach(q=>{q.classList.remove(`${R}`)});const Js=d(X);Js?.hasAttribute("em-edit")||Js?.setAttribute("em-edit","active"),t()}return function(E,C){try{return T(E,C)}finally{v&&(v=!1,document.execCommand("styleWithCSS",!1,"false"))}}}function Mw(e){return e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),Zn(Ii(e),([t])=>(t&&e.after(t),t))}function Pw(e,t){const n=Mw(e);t.commit(),n&&t.setCursorPosition(n)}function GW(e,t){Mw(e),t.commit()}function XW(e,t){Pw(e,t)}function YW(e,t){if(!e.previousElementSibling)return!1;const n=e.previousElementSibling;return n.before(e),t.commit(),K.send({operation:"application_scroll-to",settings:{value:t.scrollTop-n.getBoundingClientRect().height}}),!0}function KW(e,t){if(!e.nextElementSibling)return!1;const n=e.nextElementSibling;return n.after(e),t.commit(),K.send({operation:"application_scroll-to",settings:{value:t.scrollTop+n.getBoundingClientRect().height}}),!0}function Iw(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function ZW(e,t){const n=e.closest("table");e.querySelector("[em-edit]")&&K.send({operation:"application_element_settings_close"});const r=e.closest('[em="group"]');r&&n&&r.querySelectorAll('[em="block"]').length===1?Iw(n):e.remove(),t.commit(),n&&t.setCursorPosition(n)}function Dw(e,t){return $u(e),bL(t)}function QW(e,t){const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=Qo(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=Dw(e,e.querySelector("td")),l=[...e.parentNode.children].indexOf(e),c=Qo(e),u=parseFloat(c?.style.paddingTop??"")||0,d=parseFloat(c?.style.paddingBottom??"")||0,f=parseFloat(c?.style.borderTopLeftRadius??"")||0,p=parseFloat(c?.style.borderTopRightRadius??"")||0,m=parseFloat(c?.style.borderBottomLeftRadius??"")||0,h=parseFloat(c?.style.borderBottomRightRadius??"")||0,y=n.querySelector("td");r>l?(Xn(y,"afterbegin",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${i+d}"></td></tr></table>`),y.prepend(...a),o&&(o.style.paddingTop=u+"px",o.style.borderTopLeftRadius=f+"px",o.style.borderTopRightRadius=p+"px",o.querySelector(":scope > .em-vindent-paddingTop")?.remove())):(Xn(y,"beforeend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${s+u}"></td></tr></table>`),y.append(...a),o&&(o.style.paddingBottom=d+"px",o.style.borderBottomLeftRadius=m+"px",o.style.borderBottomRightRadius=h+"px",o.querySelector(":scope > .em-vindent-paddingBottom")?.remove()))}else if(e.tagName==="DIV"){const a=Dw(e,e),l=Array.prototype.indexOf.call(e.parentElement.children,e);la(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function JW(e,t){const n=Qo(e),r=parseFloat(n?.style.paddingTop)||0,o=parseFloat(n?.style.paddingBottom)||0,i=parseFloat(n?.style.borderTopLeftRadius)||0,s=parseFloat(n?.style.borderTopRightRadius)||0,a=parseFloat(n?.style.borderBottomLeftRadius)||0,l=parseFloat(n?.style.borderBottomRightRadius)||0,c=Ii(e);if(!c)return;$u(e);const u=[...n?.querySelectorAll(':scope > table:not([em="atom"])')??[]].filter(Hu).map(f=>({table:f,next:Lg(f,"next"),prev:Lg(f,"previous")})),d=u.length;u.forEach(({table:f,next:p,prev:m},h)=>{const[y]=Ie(c,!0),w=Qo(y);if(w.style.paddingTop="0",w.style.paddingBottom="0",w.style.borderRadius="0",w.replaceChildren(f),h===0?(w.style.paddingTop=r+"px",w.style.borderTopLeftRadius=i+"px",w.style.borderTopRightRadius=s+"px"):h===d-1&&(w.style.paddingBottom=o+"px",w.style.borderBottomLeftRadius=a+"px",w.style.borderBottomRightRadius=l+"px"),p?.getAttribute("em")==="atom"&&p.querySelector("td")?.hasAttribute("height")){const A=parseFloat(p.querySelector("td").getAttribute("height"))/2;w.style.paddingBottom=A+"px"}if(m?.getAttribute("em")==="atom"&&m.querySelector("td")?.hasAttribute("height")){const A=parseFloat(m.querySelector("td").getAttribute("height"))/2;w.style.paddingTop=A+"px"}e.insertAdjacentElement("beforebegin",y)}),e.remove(),t.commit()}function eq(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function tq(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function nq(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&Iw(r),e.after(n),t.commit(),K.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function rq(e,t){Pw(e,t)}function oq(e,t){e.querySelector("[em-edit]")&&K.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function iq(e){return e.classList.contains("add-empty-block")?"empty":e.classList.contains("add-saved-block")?"project":e.classList.contains("add-common-block")?"common":e.classList.contains("add-template-block")?"template":e.classList.contains("add-search-block")?"search":""}function sq(e){const t=e.closest("i");return t?t.classList.contains("add-empty-block")||t.classList.contains("add-saved-block")||t.classList.contains("add-common-block")||t.classList.contains("add-template-block")||t.classList.contains("add-search-block"):!1}function aq(e,t,n){const r=t.closest("i");if(!r)return;n.removeAllAttributes("em-edit");const o=t.closest('[em="block"]');if(!o)return;o.tagName==="TR"?o.querySelector("TD")?.setAttribute("em-edit","active"):o.setAttribute("em-edit","active");const i={operation:"application_element_settings_set",type:"emptyTable",tab:iq(r)};try{n.state.increment("activeElementLocked"),K.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{n.state.decrement("activeElementLocked")})}}function lq(e,t,n){const r=t.parentNode;r&&(r.style.backgroundColor="rgba(0,255,0,0.3)");let o="";document.head.querySelectorAll("style").forEach(a=>{o+=n.HTMLDocument.getInnerHtml(a)});const i=document.createElement("style");i.setAttribute("em","styles"),i.innerHTML=o;const s=fI(i)+`
|
|
184
|
+
`+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function cq(e,t,n){navigator.clipboard.readText().then(r=>{const o=n.parseFromString(r);let i=o.filter(l=>l.tagName&&l.tagName!=="LINK"&&l.tagName!=="STYLE").map(l=>n.getOuterHtml(l)).join("");const s=o.filter(l=>l.tagName==="STYLE").map(l=>n.getOuterHtml(l)).join(""),a=o.filter(l=>l.tagName==="LINK"&&l.getAttribute("em-class")).filter(l=>!document.head?.querySelector(`link[em-class="${l.getAttribute("em-class")}"]`));if((i.indexOf("empty-structure")>-1||i.indexOf("em-structure")>-1)&&(i=n.setBlockMaxWidth({blockHTML:i,targetBlock:e}),i=n.setFloatBlocksWidth({blockHTML:i,targetBlock:e,project:n.appName})),i=n.checkBlockAdaptivity({blockHTML:i,blockIsTr:i.substring(0,3)==="<tr"}),!Zn(i,l=>{const c=uq(e,l);if(!c)return!1;s&&dq(s,n);for(const u of a.reverse())document.head?.prepend(u),document.head?.insertAdjacentHTML("afterbegin",`
|
|
185
|
+
`);return e.removeAttribute("em-state"),e.after(c),!0})){fq(t.parentNode);return}n.commit(),n.setCursorPosition(e)}).catch(()=>{})}function uq(e,t){const n=e.tagName==="TR",r=document.createElement(n?"table":"div");return r.append(...t),r.querySelector('[em="block"]')?(r.querySelector(".em-element-editor")?.remove(),r.querySelector(n?"tr":'[em="block"]')):null}function dq(e,t){let n=document.head.querySelector('style[em="styles"]'),r="";n?r=t.HTMLDocument.getInnerHtml(n):(n=document.createElement("style"),n.setAttribute("em","styles"),n=document.head.insertAdjacentElement("beforeend",n));const o=document.createElement("div");t.emailWidth&&(e=e.replace(/(max-device-width:|max-width:)\d+px/g,s=>s.replace(/\d+/,String(t.emailWidth)))),t.insertAdjacentHTML(o,"afterbegin",e);let i=t.minify(r+`
|
|
186
|
+
`+[...o.querySelectorAll("style")].map(s=>s.innerHTML).join(`
|
|
187
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;i=t.cssbeautify(i,{indent:" ",autosemicolon:!0}),n.textContent=`
|
|
188
|
+
`+i+`
|
|
189
|
+
`}function fq(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function mq(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function pq(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function hq(e){const t=e.getAttribute("em-discuss-id");return t&&K.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function gq(e,t){let n=e;const r=n.getAttribute("em-discuss-id"),o=n.classList.contains("em-discuss-id-new");if(!r||r&&o){if(document.querySelectorAll(".em-discuss-id-new").forEach(i=>{i!==n&&(i.removeAttribute("em-discuss-id"),i.removeAttribute("contenteditable"),i.removeAttribute("em-edit"))}),n.tagName==="EDITOR"&&(n=n.parentElement),n.getAttribute("em-discuss-id"))n.removeAttribute("em-discuss-id"),n.removeAttribute("contenteditable"),n.removeAttribute("em-edit"),K.send({operation:"application_discuss_set_id",settings:{value:""}});else{const i=t.makeId(5);n.setAttribute("em-discuss-id",i),n.setAttribute("em-edit","active"),n.setAttribute("contenteditable","true"),n.classList.add("em-discuss-id-new"),K.send({operation:"application_discuss_set_id",settings:{value:i}})}t.commit()}return{handled:!0,newClickedElement:n}}function wc(e){e.nodeName==="#comment"&&e.textContent?.indexOf("mso")!==-1?e.remove():e.previousSibling&&wc(e.previousSibling)}function zs(e){if(!e)return;if(e.parentElement?.tagName==="SECTION"||e.classList.contains("em-narrow-table")&&Array.from(e.childNodes).every(n=>n.nodeType===Node.TEXT_NODE)){e.innerHTML="";return}e.querySelectorAll(".em-element-editor").forEach(n=>n.remove()),e.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.parentElement;if(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))e.innerHTML.trim()===""&&(e.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.innerHTML="":(e.remove(),zs(t)));else if(e.innerHTML.trim()==="")wc(e),e.remove(),zs(t);else if(t&&!t.querySelector('div[style*="display"]')){for(const n of Array.from(e.childNodes))n.nodeName==="#text"&&n.textContent?.trim()===""?(wc(n),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(wc(n),n.remove());e.innerHTML.trim()===""&&zs(e)}}function bq(e,t){const n=e;if(!n||n.closest("editor")||n.firstElementChild?.tagName==="EDITOR")return!1;const r=t.getElementParent(n);let o=n.parentNode;if(r&&t.setCursorPosition(r),n.classList.contains("em-code")){const i=t.getVariableByIcon(n);i&&(i.parentNode?.removeChild(i),n.remove())}else if(n.tagName==="TD"&&n.innerHTML===""&&n.hasAttribute("height")){const i=n.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(n.closest(".em-element-resize-img-container"))o=n.closest(".em-element-resize-img-container").parentNode,n.closest(".em-element-resize-img-container").remove();else if(n.closest('[em="atom"]')){const i=n.closest('[em="atom"]');o=i.parentNode;const s=n.closest(".em-mob-wrap, .noresp-em-mob-wrap");n.tagName==="TD"&&!n.previousElementSibling&&!n.nextElementSibling?i.remove():n.remove();const a=!!s&&Array.from(s.querySelectorAll('[em="atom"]')).some(l=>l!==i);n.tagName!=="TD"&&!a&&s?.textContent?.trim()===""&&(s.textContent="")}else{n.remove();const i=n.previousSibling;i&&i?.textContent?.trim()===""&&i.remove()}return zs(o),t.commit(),K.send({operation:"application_element_settings_close"}),!0}function yq(e){return function(n){document.body&&!document.body.classList.contains("mceNonEditable")&&(n.stopPropagation(),n.preventDefault()),e.setEditorFocus(!1);const r=n.target;if(document.documentElement.classList.contains("em-resize-start")||r.classList.contains("em-element-editor-widget")||r.classList.contains("em-element-block-add"))return;let o=r;if(!e.getLockEditor()){const h=o.closest(".em-narrow-table");if(h&&(bn(h)||!h.innerHTML.trim())&&e.insertTextAtomIntoEmptyNarrowTable(h))return}const i=o.closest("a");if(i instanceof HTMLAnchorElement){const h=i.getAttribute("href")||i.href||"";if(Fs(h)){const y=h.slice(1),w=document.querySelector(`a[name="${y}"]`);w&&(n.preventDefault(),w.scrollIntoView({behavior:"smooth",block:"start"}))}else i.href&&document.referrer.includes("raw")&&window.open(i.href);n.stopPropagation(),n.preventDefault()}if(o.tagName==="HTML"||o.classList.contains(Ge.drag)||o.classList.contains("em-element-editor"))return;const s=document.body,a=s?.classList.contains("mceNonEditable"),l=s?.classList.contains("em-sandbox-discuss"),c=document.referrer.includes("raw"),u=o.tagName==="A"||o.closest("a")||o.tagName==="IMG";if(a&&!l&&(!c||!u)){e.setCursorPosition(o);return}if(e.isDiscussViewMode()){e.handleDiscussViewClick(o);return}if(e.isDiscussSetTargetMode()){o=e.handleDiscussSetTargetClick(o).newClickedElement;return}o instanceof Element&&o.tagName==="EDITOR"&&(o=o.parentElement);const d=o.closest('[em="atom"]');if(d&&o.closest(".em-element-editor-widget-remove")){e.handleRemoveAtom(d);return}if(d&&o.closest(".em-element-editor-widget-edit")){e.applicationElementSettingsSet({elem:d}),e.setCursorPosition(d);return}if(d&&o.closest(".em-element-editor-widget-clone")){e.handleCloneAtom(d);return}const f=o.closest('[em="block"]');if(f&&o.classList.contains(Ge.moveUp)){e.handleMoveBlockUp(f);return}if(f&&o.classList.contains(Ge.moveDown)){e.handleMoveBlockDown(f);return}if(f&&o.closest(".em-element-editor-widget-edit")){const h=f.querySelector("td");h&&e.applicationElementSettingsSet({elem:h}),e.setCursorPosition(f);return}if(f&&o.closest(".em-element-editor-widget-remove")){e.handleRemoveBlock(f);return}if(f&&o.closest(".em-element-editor-widget-add-block")){e.addBlockToProject(o);return}if(f&&o.closest(".em-element-editor-widget-clone")){e.handleCloneBlock(f);return}if(f&&e.isAddBlockMenuClick(o)){e.handleAddBlockMenu(f,o);return}if(f&&o.closest(".em-element-editor-widget-copy")){e.handleCopyBlock(f,o);return}if(f&&o.closest(".em-element-editor-widget-paste")){e.handlePasteBlock(f,o);return}if(f&&o.classList.contains(Ge.merge)){e.handleMergeBlocks(f);return}if(f&&o.classList.contains(Ge.unmerge)){e.handleUnmergeBlocks(f);return}const p=o.closest('[em="group"]');if(p&&o.classList.contains(Ge.moveUp)){e.handleMoveGroupUp(p);return}if(p&&o.classList.contains(Ge.moveDown)){e.handleMoveGroupDown(p);return}if(p&&o.classList.contains(Ge.add)){e.handleAddGroup(p);return}if(p&&o.closest(".em-element-editor-widget-edit")){e.setCursorPosition(p);const h=p.tagName!=="TR"?p:p.querySelector("td");h&&e.applicationElementSettingsSet({elem:h});return}if(p&&o.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(p);return}if(p&&o.closest(".em-element-editor-widget-remove")&&o.closest(".of-group")){e.handleRemoveGroup(p);return}if(!o.closest(".em-editor-wrapper")&&!o.closest(".em-element-path")&&!o.closest(".em-element-vindent-remove")){const h=window.getSelection();if(h?.isCollapsed)e.setCursorPosition(o);else if(h&&h.rangeCount>0){const w=h.getRangeAt(0).commonAncestorContainer,A=e.findOutermostParentWithText(w);A&&e.setCursorPosition(A);const k=e.getParentElementOfSelection();k&&(o=k)}e.applicationElementSettingsSet({elem:o});const y=document.querySelector(".em-editor-wrapper");y&&(y.style.display="none"),e.setBlockGroupControlsPosition()}const m=o?.tagName==="TD"?o?.querySelector("div"):o?.closest("div")||o;o.closest(".em-element-custom-table")&&m?.tagName==="DIV"&&e.handleCustomTableClick(o,n)}}function vq(e){const t=_t(r=>{r.target?.closest(".em-element-editor-widget-clone")||(document.querySelectorAll('.em-element-editor-widget-clone[data-open="true"]').forEach(o=>{o.setAttribute("data-open","false");const i=o.querySelector("ul");i&&(i.style.display="none")}),tc(o=>{e.commit(o)}))}),n=()=>{e.messageService.send({operation:"application_focus_in_iframe"})};return document.addEventListener("click",t),document.addEventListener("click",n),{dispose(){document.removeEventListener("click",t),document.removeEventListener("click",n)}}}function Bw(e,t,n,r=!0){const o=document.querySelector(e);if(!o)return;const i=o.closest("td");if(!i)return;const s=i.parentElement;if(!s)return;const a=Array.from(s.cells),l=a.indexOf(i);let c=0,u=1;for(;c<t;){let d;if(r?d=l+u:d=l-u,d<0||d>=a.length)break;a[d].classList.add(n),c++,u++}}function Hw(e,t,n,r=!0){const o=document.querySelector(e);if(!o)return;const i=o.closest("td");if(!i)return;const s=i.parentElement;if(!s||s.tagName!=="TR")return;const a=s.closest("table");if(!a)return;const l=Array.from(a.rows),c=l.indexOf(s);if(c===-1)return;const u=[],d=Math.max(...l.map(w=>Array.from(w.cells).reduce((A,k)=>A+(k.colSpan||1),0))),f=new Map;for(let w=0;w<l.length;w++){u[w]=[];let A=0;const k=Array.from(l[w].cells);for(const b of k){for(;f.has(`${w}:${A}`);){const T=f.get(`${w}:${A}`);u[w][A]=T.cell,A++}const v=b.colSpan||1,S=b.rowSpan||1;for(let T=0;T<v&&A<d;T++){u[w][A+T]=b;for(let g=0;g<S;g++)if(w+g<l.length){const E=`${w+g}:${A+T}`;f.set(E,{cell:b,rowSpan:S,colSpan:v,startRow:w})}}A+=v}for(;A<d;){if(f.has(`${w}:${A}`)){const b=f.get(`${w}:${A}`);u[w][A]=b.cell}else u[w][A]=null;A++}}let p=-1;for(let w=0;w<u[c].length;w++)if(u[c][w]===i){p=w;break}if(p===-1)return;let m=0,h=1;const y=new Set;for(;m<t;){const w=r?c+h:c-h;if(w<0||w>=l.length)break;const A=u[w][p];if(!A){h++;continue}const k=`${w}:${p}`,b=f.get(k);if(A.tagName!=="TD"){h++;continue}if(y.has(A)){h++;continue}if(b&&b.startRow!==w){h++;continue}A.classList.add(n),y.add(A),m++,h++}}var Fw=`
|
|
190
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
191
|
+
<path d="M2.21128 13.375C1.83241 13.375 1.51172 13.2438 1.24922 12.9813C0.986719 12.7188 0.855469 12.3981 0.855469 12.0192V1.98081C0.855469 1.60194 0.986719 1.28125 1.24922 1.01875C1.51172 0.75625 1.83241 0.625 2.21128 0.625H4.74966C5.12853 0.625 5.44922 0.75625 5.71172 1.01875C5.97422 1.28125 6.10547 1.60194 6.10547 1.98081V12.0192C6.10547 12.3981 5.97422 12.7188 5.71172 12.9813C5.44922 13.2438 5.12853 13.375 4.74966 13.375H2.21128ZM9.24966 13.375C8.87078 13.375 8.55009 13.2438 8.28759 12.9813C8.02509 12.7188 7.89384 12.3981 7.89384 12.0192V1.98081C7.89384 1.60194 8.02509 1.28125 8.28759 1.01875C8.55009 0.75625 8.87078 0.625 9.24966 0.625H11.788C12.1669 0.625 12.4876 0.75625 12.7501 1.01875C13.0126 1.28125 13.1438 1.60194 13.1438 1.98081V12.0192C13.1438 12.3981 13.0126 12.7188 12.7501 12.9813C12.4876 13.2438 12.1669 13.375 11.788 13.375H9.24966ZM12.0188 1.98081C12.0188 1.92306 11.9948 1.87019 11.9467 1.82219C11.8987 1.77406 11.8458 1.75 11.788 1.75H9.24966C9.19191 1.75 9.13903 1.77406 9.09103 1.82219C9.04291 1.87019 9.01884 1.92306 9.01884 1.98081V12.0192C9.01884 12.0769 9.04291 12.1298 9.09103 12.1778C9.13903 12.2259 9.19191 12.25 9.24966 12.25H11.788C11.8458 12.25 11.8987 12.2259 11.9467 12.1778C11.9948 12.1298 12.0188 12.0769 12.0188 12.0192V1.98081Z" fill="#344966"/>
|
|
192
|
+
</svg>
|
|
193
|
+
`,$w=`
|
|
194
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
195
|
+
<path d="M1.98081 13.1442C1.60194 13.1442 1.28125 13.013 1.01875 12.7505C0.75625 12.488 0.625 12.1673 0.625 11.7884V9.25002C0.625 8.87115 0.75625 8.55046 1.01875 8.28796C1.28125 8.02546 1.60194 7.89421 1.98081 7.89421H12.0192C12.3981 7.89421 12.7188 8.02546 12.9813 8.28796C13.2438 8.55046 13.375 8.87115 13.375 9.25002V11.7884C13.375 12.1673 13.2438 12.488 12.9813 12.7505C12.7188 13.013 12.3981 13.1442 12.0192 13.1442H1.98081ZM1.98081 6.10583C1.60194 6.10583 1.28125 5.97459 1.01875 5.71209C0.75625 5.44958 0.625 5.1289 0.625 4.75002V2.21165C0.625 1.83277 0.75625 1.51208 1.01875 1.24958C1.28125 0.987085 1.60194 0.855835 1.98081 0.855835H12.0192C12.3981 0.855835 12.7188 0.987085 12.9813 1.24958C13.2438 1.51208 13.375 1.83277 13.375 2.21165V4.75002C13.375 5.1289 13.2438 5.44958 12.9813 5.71209C12.7188 5.97459 12.3981 6.10583 12.0192 6.10583H1.98081ZM12.0192 1.98083H1.98081C1.92306 1.98083 1.87019 2.0049 1.82219 2.05302C1.77406 2.10102 1.75 2.1539 1.75 2.21165V4.75002C1.75 4.80777 1.77406 4.86065 1.82219 4.90865C1.87019 4.95677 1.92306 4.98083 1.98081 4.98083H12.0192C12.0769 4.98083 12.1298 4.95677 12.1778 4.90865C12.2259 4.86065 12.25 4.80777 12.25 4.75002V2.21165C12.25 2.1539 12.2259 2.10102 12.1778 2.05302C12.1298 2.0049 12.0769 1.98083 12.0192 1.98083Z" fill="#344966"/>
|
|
196
|
+
</svg>
|
|
197
|
+
`,Eq=`
|
|
198
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(-90deg); display: inline-block;">
|
|
199
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
200
|
+
</svg>
|
|
201
|
+
`,Sq=`
|
|
202
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(90deg); display: inline-block;">
|
|
203
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
204
|
+
</svg>
|
|
205
|
+
`,wq=`
|
|
206
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(-90deg); display: inline-block;">
|
|
207
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
208
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
209
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
210
|
+
</svg>
|
|
211
|
+
`,Cq=`
|
|
212
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
213
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
214
|
+
</svg>
|
|
215
|
+
`,Aq=`
|
|
216
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none" style="transform: rotate(180deg); display: inline-block;">
|
|
217
|
+
<path d="M1.75 10.2909L1.75 14.7692C1.75 14.8366 1.77163 14.8919 1.81488 14.9351C1.85813 14.9784 1.91344 15 1.98081 15L12.0192 15C12.0866 15 12.1419 14.9784 12.1851 14.9351C12.2284 14.8919 12.25 14.8366 12.25 14.7692L12.25 10.2909L1.75 10.2909ZM0.625 4.73081C0.625 3.93713 1.75 3.93713 1.75 4.73081L1.75 9.16594L12.25 9.16594L12.25 4.73081C12.25 3.93713 13.375 3.93713 13.375 4.73081L13.375 14.7692C13.375 15.1421 13.2422 15.4613 12.9767 15.7268C12.7112 15.9923 12.3921 16.125 12.0192 16.125L1.98081 16.125C1.60794 16.125 1.28875 15.9923 1.02325 15.7268C0.75775 15.4613 0.624999 15.1421 0.624999 14.7692L0.625 4.73081ZM3.8125 3.93731C3.8125 3.77781 3.86644 3.64425 3.97431 3.53662C4.08206 3.42887 4.21563 3.375 4.375 3.375L6.4375 3.375L6.4375 1.3125C6.4375 1.15312 6.49144 1.01956 6.59931 0.911812C6.70719 0.803937 6.84081 0.75 7.00019 0.75C7.15969 0.75 7.29325 0.803937 7.40088 0.911812C7.50863 1.01956 7.5625 1.15312 7.5625 1.3125L7.5625 3.375L9.625 3.375C9.78438 3.375 9.91794 3.42894 10.0257 3.53681C10.1336 3.64469 10.1875 3.77831 10.1875 3.93769C10.1875 4.09719 10.1336 4.23075 10.0257 4.33837C9.91794 4.44612 9.78438 4.5 9.625 4.5L7.5625 4.5L7.5625 6.5625C7.5625 6.72187 7.50856 6.8555 7.40069 6.96337C7.29281 7.07113 7.15919 7.125 6.99981 7.125C6.84031 7.125 6.70675 7.07113 6.59913 6.96337C6.49138 6.8555 6.4375 6.72187 6.4375 6.5625L6.4375 4.5L4.375 4.5C4.21563 4.5 4.08206 4.44606 3.97431 4.33819C3.86644 4.23031 3.8125 4.09669 3.8125 3.93731Z" fill="#777582"/>
|
|
218
|
+
</svg>
|
|
219
|
+
`,Tq=`
|
|
220
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
|
|
221
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
222
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
223
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
224
|
+
</svg>
|
|
225
|
+
`,_q=`
|
|
226
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
227
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
228
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
229
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
230
|
+
</svg>
|
|
231
|
+
`,kq=`
|
|
232
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(180deg); display: inline-block;">
|
|
233
|
+
<path d="M15.375 6.74998C15.375 7.12885 15.2438 7.44954 14.9813 7.71204C14.7188 7.97454 14.3981 8.10579 14.0192 8.10579L3.98081 8.10579C3.60194 8.10579 3.28125 7.97454 3.01875 7.71204C2.75625 7.44954 2.625 7.12885 2.625 6.74998L2.625 4.2116C2.625 3.83273 2.75625 3.51204 3.01875 3.24954C3.28125 2.98704 3.60194 2.85579 3.98081 2.85579L14.0192 2.85579C14.3981 2.85579 14.7188 2.98704 14.9813 3.24954C15.2438 3.51204 15.375 3.83273 15.375 4.2116L15.375 6.74998ZM15.375 13.7884C15.375 14.1672 15.2438 14.4879 14.9813 14.7504C14.7188 15.0129 14.3981 15.1442 14.0192 15.1442L3.98081 15.1442C3.60194 15.1442 3.28125 15.0129 3.01875 14.7504C2.75625 14.4879 2.625 14.1672 2.625 13.7884L2.625 11.25C2.625 10.8711 2.75625 10.5504 3.01875 10.2879C3.28125 10.0254 3.60194 9.89416 3.98081 9.89416L14.0192 9.89416C14.3981 9.89416 14.7188 10.0254 14.9813 10.2879C15.2438 10.5504 15.375 10.8711 15.375 11.25L15.375 13.7884ZM3.98081 14.0192L14.0192 14.0192C14.0769 14.0192 14.1298 13.9951 14.1778 13.947C14.2259 13.899 14.25 13.8461 14.25 13.7884L14.25 11.25C14.25 11.1922 14.2259 11.1394 14.1778 11.0914C14.1298 11.0432 14.0769 11.0192 14.0192 11.0192L3.98081 11.0192C3.92306 11.0192 3.87019 11.0432 3.82219 11.0914C3.77406 11.1394 3.75 11.1922 3.75 11.25L3.75 13.7884C3.75 13.8461 3.77406 13.899 3.82219 13.947C3.87019 13.9951 3.92306 14.0192 3.98081 14.0192Z" fill="#777582"/>
|
|
234
|
+
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
235
|
+
<path d="M9.55102 9.55102L9.55102 11.449C9.55102 11.6051 9.49818 11.7359 9.39251 11.8415C9.28684 11.9472 9.15594 12 8.99982 12C8.84357 12 8.71273 11.9472 8.60731 11.8415C8.50175 11.7359 8.44898 11.6051 8.44898 11.449L8.44898 9.55102L6.55102 9.55102C6.3949 9.55102 6.26406 9.49818 6.15851 9.39251C6.05284 9.28684 6 9.15594 6 8.99982C6 8.84357 6.05284 8.71273 6.15851 8.60731C6.26406 8.50175 6.3949 8.44898 6.55102 8.44898L8.44898 8.44898L8.44898 6.55102C8.44898 6.3949 8.50182 6.26406 8.60749 6.15851C8.71316 6.05284 8.84406 6 9.00018 6C9.15643 6 9.28727 6.05284 9.39269 6.15851C9.49825 6.26406 9.55102 6.3949 9.55102 6.55102L9.55102 8.44898L11.449 8.44898C11.6051 8.44898 11.7359 8.50182 11.8415 8.60749C11.9472 8.71316 12 8.84406 12 9.00018C12 9.15643 11.9472 9.28727 11.8415 9.39269C11.7359 9.49824 11.6051 9.55102 11.449 9.55102L9.55102 9.55102Z" fill="#777582"/>
|
|
236
|
+
</svg>
|
|
237
|
+
`,Lq=`
|
|
238
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
239
|
+
<path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
240
|
+
</svg>
|
|
241
|
+
`,Nq=`
|
|
242
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none" style="transform: rotate(90deg); display: inline-block;">
|
|
243
|
+
<path d="M3 9H3.00666M5.99833 9H6.005M11.995 9H12.0017M8.99667 9H9.00333M14.9933 9H15M14.9933 15V14.4667C14.9933 13.7199 14.9933 13.3465 14.8481 13.0613C14.7204 12.8105 14.5165 12.6065 14.2657 12.4787C13.9807 12.3333 13.6075 12.3333 12.8612 12.3333H5.13215C4.38583 12.3333 4.01266 12.3333 3.72761 12.4787C3.47687 12.6065 3.273 12.8105 3.14525 13.0613C3 13.3465 3 13.7199 3 14.4667V15M14.9933 3V3.53333C14.9933 4.28007 14.9933 4.65344 14.8481 4.93865C14.7204 5.18954 14.5165 5.39351 14.2657 5.52134C13.9807 5.66667 13.6075 5.66667 12.8612 5.66667H5.13215C4.38583 5.66667 4.01266 5.66667 3.72761 5.52134C3.47686 5.39351 3.273 5.18954 3.14525 4.93865C3 4.65344 3 4.28007 3 3.53333V3" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
244
|
+
</svg>
|
|
245
|
+
`,Ww=`
|
|
246
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
247
|
+
<path d="M7 3H11M3 5H15M13.6667 5L13.1991 12.0129C13.129 13.065 13.0939 13.5911 12.8667 13.99C12.6666 14.3412 12.3648 14.6235 12.0011 14.7998C11.588 15 11.0607 15 10.0062 15H7.9938C6.93927 15 6.41202 15 5.99889 14.7998C5.63517 14.6235 5.33339 14.3412 5.13332 13.99C4.90607 13.5911 4.871 13.065 4.80086 12.0129L4.33333 5" stroke="#777582" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
248
|
+
</svg>
|
|
249
|
+
`;function xq(e,t,n,r){const o=document.querySelector(".table-menu"),i=o?.closest("table");if(!i)return;const s=i?.querySelector(`.${ae}`),a=Ns(i),{row:l}=dm(a,ae),{row:c,isOverlapped:u}=tS(a,ae),{isOverlapped:d}=nS(a,ae);if(!i||!s)return;const f={addBottomRow:o.querySelector('[data-id="add-bottom-row"]'),addTopRow:o.querySelector('[data-id="add-top-row"]'),removeRow:o.querySelector('[data-id="remove-row"]'),mergeTopCell:o.querySelector('[data-id="merge-top-cell"]'),mergeBottomCell:o.querySelector('[data-id="merge-bottom-cell"]'),splitHorizontalCell:o.querySelector('[data-id="split-horizontal-cell"]'),addLeftColumn:o.querySelector('[data-id="add-left-column"]'),addRightColumn:o.querySelector('[data-id="add-right-column"]'),mergeRightCell:o.querySelector('[data-id="merge-right-cell"]'),mergeLeftCell:o.querySelector('[data-id="merge-left-cell"]'),splitVerticalCell:o.querySelector('[data-id="split-vertical-cell"]'),removeColumn:o.querySelector('[data-id="remove-column"]')};f.addBottomRow&&(f.addBottomRow.style.display="block"),f.addTopRow&&(f.addTopRow.style.display="block"),f.removeRow&&(f.removeRow.style.display="block"),f.mergeTopCell&&(f.mergeTopCell.style.display="block"),f.mergeBottomCell&&(f.mergeBottomCell.style.display="block"),f.splitHorizontalCell&&(f.splitHorizontalCell.style.display="none"),f.addLeftColumn&&(f.addLeftColumn.style.display="block"),f.addRightColumn&&(f.addRightColumn.style.display="block"),f.mergeRightCell&&(f.mergeRightCell.style.display="block"),f.mergeLeftCell&&(f.mergeLeftCell.style.display="block"),f.splitVerticalCell&&(f.splitVerticalCell.style.display="none"),f.removeColumn&&(f.removeColumn.style.display="block"),s.getAttribute("rowspan")&&f.splitHorizontalCell&&(f.splitHorizontalCell.style.display="block"),s.getAttribute("colspan")&&f.splitVerticalCell&&(f.splitVerticalCell.style.display="block"),e&&(f.mergeBottomCell&&(f.mergeBottomCell.style.display="none"),f.mergeRightCell&&(f.mergeRightCell.style.display="none"),f.mergeLeftCell&&(f.mergeLeftCell.style.display="none"),f.addTopRow&&(f.addTopRow.style.display="none"),f.addBottomRow&&(f.addBottomRow.style.display="none"),f.removeRow&&(f.removeRow.style.display="none")),t&&(f.mergeTopCell&&(f.mergeTopCell.style.display="none"),f.mergeRightCell&&(f.mergeRightCell.style.display="none"),f.mergeLeftCell&&(f.mergeLeftCell.style.display="none"),f.addTopRow&&(f.addTopRow.style.display="none"),f.addBottomRow&&(f.addBottomRow.style.display="none"),f.removeRow&&(f.removeRow.style.display="none")),n&&(f.mergeTopCell&&(f.mergeTopCell.style.display="none"),f.mergeBottomCell&&(f.mergeBottomCell.style.display="none"),f.mergeRightCell&&(f.mergeRightCell.style.display="none"),f.addLeftColumn&&(f.addLeftColumn.style.display="none"),f.addRightColumn&&(f.addRightColumn.style.display="none"),f.removeColumn&&(f.removeColumn.style.display="none")),r&&(f.mergeTopCell&&(f.mergeTopCell.style.display="none"),f.mergeBottomCell&&(f.mergeBottomCell.style.display="none"),f.mergeLeftCell&&(f.mergeLeftCell.style.display="none"),f.addLeftColumn&&(f.addLeftColumn.style.display="none"),f.addRightColumn&&(f.addRightColumn.style.display="none"),f.removeColumn&&(f.removeColumn.style.display="none")),d&&f.removeColumn&&(f.removeColumn.style.display="none"),u&&c===l&&f.removeRow&&(f.removeRow.style.display="none"),s.getAttribute("colspan")&&(f.mergeTopCell&&(f.mergeTopCell.style.display="none"),f.mergeBottomCell&&(f.mergeBottomCell.style.display="none")),s.getAttribute("rowspan")&&(f.mergeLeftCell&&(f.mergeLeftCell.style.display="none"),f.mergeRightCell&&(f.mergeRightCell.style.display="none"))}var Oq={INSERT_COLUMN_BEFORE_TABLE:"Insert column before",INSERT_COLUMN_AFTER_TABLE:"Insert column after",MERGE_RIGHT_CELL_TABLE:"Merge right",MERGE_LEFT_CELL_TABLE:"Merge left",SPLIT_CELL_TABLE:"Split cell",REMOVE_COLUMN_TABLE:"Remove column",INSERT_ROW_BEFORE_TABLE:"Insert row before",INSERT_ROW_AFTER_TABLE:"Insert row after",MERGE_TOP_CELL_TABLE:"Merge top",MERGE_BOTTOM_CELL_TABLE:"Merge bottom",REMOVE_ROW_TABLE:"Remove row",EDIT_ATOM:"Edit"},Wt=()=>window.Locale||Oq;function Rq(e,t){e.forEach(n=>{t.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))})}function Mq(e,t){const n=e?.tagName==="TD"?e?.querySelector("div"):e?.closest("div")?e?.closest("div"):e;if(!e.closest(".em-element-custom-table")||n?.tagName!=="DIV")return!1;document.querySelectorAll(`.${je}`).forEach(A=>{A.classList.remove(je)});const r=[rE,ae];let o=!1,i=!1;const s=n,a=document.querySelector(`.${ae}`),l=document.querySelector(".table-menu");a&&a.classList.remove(ae),l&&l.remove();const c=s.closest(".em-element-custom-table"),u=c.closest('[em="block"]'),d=I({targetElement:c,insertType:"append",className:"of-atom table-menu",style:"width: 48px; height: 28px; display: flex; position: absolute; right: 0; top: -30px; background: #FFDCC7; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); pointer-events: auto; z-index: 1001;"});let f=!1,p=1;const m=()=>({isDirectionUP:O.get("isDirectionUP"),isDirectionDOWN:O.get("isDirectionDOWN"),isDirectionLEFT:O.get("isDirectionLEFT"),isDirectionRIGHT:O.get("isDirectionRIGHT"),actualTargetCount:O.get("actualTargetCount")});c.addEventListener("mousedown",_t(A=>{const k=A.target.tagName.toUpperCase();if(A.button===0&&k!=="UL"&&k!=="LI"&&k!=="SVG"&&k!=="PATH"&&k!=="CIRCLE"){f=!0;const b=c.querySelector(`.${ae}`);document.querySelectorAll(`.${ie}`)?.forEach(v=>{v.classList.remove(ie),b?.classList.remove(ae)})}})),c.addEventListener("mouseup",A=>{f=!1,A.target.closest("td")?.classList.contains("remove-basic-cell")&&O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1})}),c.addEventListener("mouseover",_t(A=>{const k=c.querySelector(`.${ae}`);p=c.querySelectorAll(`.${ie}`).length,p=p===0?1:p;const b=A.target;if(f&&b.closest("TD")&&k){const v=b.closest("TD");c.querySelectorAll(`.${Pn}`).forEach(me=>me.classList.remove(Pn)),p===1&&c.querySelectorAll(`.${ie}`).forEach(me=>me.classList.remove(ie)),v.classList.add(Pn);const S=v.closest(".em-element-custom-table");if(!S)return;let T=Ns(S);const g=dm(T,ae);if(!g)return;const{row:E,col:C}=g,{row:_,col:x,isOverlapped:N}=tS(T,ae),{row:W,col:R,isOverlapped:M}=nS(T,ae);!o&&!i&&p===1&&!(N||M)&&(S.querySelectorAll(`.${ie}`).forEach(me=>me.classList.remove(ie)),v.classList.add(ie));const te=dm(T,Pn);if(!te)return;const{row:j,col:ne}=te;if(S.querySelectorAll(`.${Pn}`).forEach(me=>me.classList.remove(Pn)),E!==j&&C!==ne){S.querySelectorAll(`.${ie}`).forEach(me=>me.classList.remove(ie)),o=!1,i=!1;return}const{isDirectionUP:re,isDirectionDOWN:Q,isDirectionLEFT:be,isDirectionRIGHT:de}=m();if(!o&&!i&&!v.classList.contains("remove-basic-cell")&&(O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),E===j?(o=!0,i=!1,C>ne&&O.set("isDirectionLEFT",!0),C<ne&&O.set("isDirectionRIGHT",!0)):C===ne&&(i=!0,o=!1,E>j&&O.set("isDirectionUP",!0),E<j&&O.set("isDirectionDOWN",!0))),E===j&&(Q||re)||C===ne&&(de||be)||C===ne&&E===j){O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),o=!1,i=!1;return}if(N&&x!==null){const{isDirectionRIGHT:me,isDirectionLEFT:X}=m();if(me&&x-ne<=0&&x>C){S.querySelectorAll(`.${ie}`).forEach(B=>B.classList.remove(ie));return}if(X&&ne-x<=0&&x<C){S.querySelectorAll(`.${ie}`).forEach(B=>B.classList.remove(ie));return}}if(M&&W!==null){const{isDirectionDOWN:me,isDirectionUP:X}=m();if(me&&W-j<=0&&W>E){S.querySelectorAll(`.${ie}`).forEach(B=>B.classList.remove(ie));return}if(X&&j-W<=0&&W<E){S.querySelectorAll(`.${ie}`).forEach(B=>B.classList.remove(ie));return}}if(E===j&&o){i=!1;const{isDirectionRIGHT:me,isDirectionLEFT:X}=m();if(me){const B=ne-C;if(O.set("actualTargetCount",rc(T,j,ne,E,C,!0)),B<0){O.set("isDirectionRIGHT",!1),o=!1,i=!1;return}S.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),Bw(`.${ae}`,O.get("actualTargetCount"),ie,!0)}if(X){const B=C-ne;if(O.set("actualTargetCount",rc(T,E,C,j,ne,!0)),B<0){O.set("isDirectionLEFT",!1),o=!1,i=!1;return}S.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),Bw(`.${ae}`,O.get("actualTargetCount"),ie,!1)}S.querySelectorAll(`.${Pn}`).forEach(B=>B.classList.remove(Pn))}if(C===ne&&i){o=!1;const{isDirectionDOWN:me,isDirectionUP:X}=m();if(me){const B=j-E;if(O.set("actualTargetCount",rc(T,j,ne,E,C,!1)),B<0){O.set("isDirectionDOWN",!1),o=!1,i=!1;return}S.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),Hw(`.${ae}`,O.get("actualTargetCount"),ie,!0)}if(X){const B=E-j;O.set("actualTargetCount",rc(T,E,C,j,ne,!1)),B<0&&(O.set("isDirectionUP",!1),o=!1,i=!1),S.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),Hw(`.${ae}`,O.get("actualTargetCount"),ie,!1)}S.querySelectorAll(`.${Pn}`).forEach(B=>B.classList.remove(Pn))}const Ee=S.querySelectorAll(`.${ie}`);v.classList.contains("remove-basic-cell")&&Ee?.length>1&&(Ee?.forEach(me=>{me.classList.remove(ie)}),o=!1,i=!1)}})),Pq(d,c,u,t,r);const h=s.closest("td");h.classList.add(ae);function y(A){const k=A.target;!u.contains(k)&&!d.contains(k)&&(d.remove(),h&&(document.querySelectorAll(`.${ie}`)?.forEach(b=>{b.classList.remove(ie)}),document.querySelectorAll(`.${je}`).forEach(b=>{b.classList.remove(je)}),h.classList.remove(ae)),document.removeEventListener("click",w))}const w=_t(y);return document.addEventListener("click",w),!0}function Pq(e,t,n,r,o){const i=xq;function s(w){const A=w.querySelector("ul"),k=w.getAttribute("data-open")==="true",b=r.target.closest("td")?.classList.contains(ae),v=t.querySelectorAll(`.${ie}`);b&&v?.length===0&&O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1});const{isDirectionUP:S,isDirectionDOWN:T,isDirectionLEFT:g,isDirectionRIGHT:E}={isDirectionUP:O.get("isDirectionUP"),isDirectionDOWN:O.get("isDirectionDOWN"),isDirectionLEFT:O.get("isDirectionLEFT"),isDirectionRIGHT:O.get("isDirectionRIGHT")};i(S,T,g,E),e.querySelectorAll("[data-open]").forEach(C=>{C!==w&&C.getAttribute("data-open")==="true"&&(C.setAttribute("data-open","false"),C.querySelector("ul").style.display="none")}),k||(w.setAttribute("data-open","true"),A.style.display="block")}function a(w){const A=w.querySelector("ul");w.getAttribute("data-open")==="true"&&(w.setAttribute("data-open","false"),A.style.display="none")}function l(w){w.stopPropagation(),w.preventDefault();const A=w.target,k=A.closest("li"),b=k?.getAttribute("data-id"),v=k?.closest("tr"),S=k?.closest("td");v?.classList.add(rE),S?.classList.add(ae);const T=A.closest("table");if(!k||!T)return;const g=Ns(T),E=T.querySelectorAll(`.${ie}`).length;switch(b){case"add-bottom-row":{const N=Z1(g,ae,!1);Me(T,$t(N));break}case"add-top-row":{const N=Z1(g,ae,!0);Me(T,$t(N));break}case"remove-row":{const N=FB(g,ae);Me(T,$t(N));break}case"merge-top-cell":{const N=E===0?eS(g,ae,!0,E+1):oS(g,ae,ie);Me(T,$t(N));break}case"merge-bottom-cell":{const N=E===0?eS(g,ae,!1,E+1):oS(g,ae,ie);Me(T,$t(N));break}case"split-horizontal-cell":{const N=qB(g,ae);Me(T,$t(N));break}case"add-left-column":{const N=Q1(g,ae,!0);Me(T,$t(N));break}case"add-right-column":{const N=Q1(g,ae,!1);Me(T,$t(N));break}case"merge-right-cell":{const N=E===0?J1(g,ae,!1,E+1):rS(g,ae,ie);Me(T,$t(N));break}case"merge-left-cell":{const N=E===0?J1(g,ae,!0,E+1):rS(g,ae,ie);Me(T,$t(N));break}case"split-vertical-cell":{const N=WB(g,ae);Me(T,$t(N));break}case"remove-column":{const N=$B(g,ae);Me(T,$t(N));break}}const C=k.closest("ul");C.parentElement.setAttribute("data-open","false"),C.style.display="none",e.querySelectorAll('[data-open="true"]').forEach(N=>{N.setAttribute("data-open","false"),N.querySelector("ul").style.display="none"});const _=document.querySelector(`.${ae}`),x=document.querySelector(".table-menu");_?.classList.remove(ae),x?.remove(),document.querySelectorAll(`.${ie}`).forEach(N=>{N.classList.remove(ie)}),Rq(o,T),Hr()}function c(w){s(w.currentTarget)}function u(w){a(w.currentTarget)}const d=I({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-edit",HTMLcontent:Fw,title:"Колонки"});d.setAttribute("data-open","false");const f=I({targetElement:d,insertType:"append",tag:"ul",style:iE}),p={targetElement:f,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:oE};I({...p,HTMLcontent:Fw,title:"",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px","data-id":"menu-item"}),I({...p,HTMLcontent:Eq,title:Wt().INSERT_COLUMN_BEFORE_TABLE,"data-id":"add-left-column"}),I({...p,HTMLcontent:Sq,title:Wt().INSERT_COLUMN_AFTER_TABLE,"data-id":"add-right-column"}),I({...p,HTMLcontent:Tq,title:Wt().MERGE_RIGHT_CELL_TABLE,"data-id":"merge-right-cell"}),I({...p,HTMLcontent:wq,title:Wt().MERGE_LEFT_CELL_TABLE,"data-id":"merge-left-cell"}),I({...p,HTMLcontent:Nq,title:Wt().SPLIT_CELL_TABLE,"data-id":"split-vertical-cell"}),I({...p,HTMLcontent:Ww,title:Wt().REMOVE_COLUMN_TABLE,"data-id":"remove-column"}),f.addEventListener("click",l),d.addEventListener("mouseenter",c),d.addEventListener("mouseleave",u);const m=I({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-clone",HTMLcontent:$w,title:"Строки"});m.setAttribute("data-open","false");const h=I({targetElement:m,insertType:"append",tag:"ul",style:iE}),y={targetElement:h,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:oE};I({...y,HTMLcontent:$w,title:Wt().EDIT_ATOM||"Edit",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px"}),I({...y,HTMLcontent:Cq,title:Wt().INSERT_ROW_BEFORE_TABLE,"data-id":"add-top-row"}),I({...y,HTMLcontent:Aq,title:Wt().INSERT_ROW_AFTER_TABLE,"data-id":"add-bottom-row"}),I({...y,HTMLcontent:_q,title:Wt().MERGE_TOP_CELL_TABLE,"data-id":"merge-top-cell"}),I({...y,HTMLcontent:kq,title:Wt().MERGE_BOTTOM_CELL_TABLE,"data-id":"merge-bottom-cell"}),I({...y,HTMLcontent:Lq,title:Wt().SPLIT_CELL_TABLE,"data-id":"split-horizontal-cell"}),I({...y,HTMLcontent:Ww,title:Wt().REMOVE_ROW_TABLE,"data-id":"remove-row"}),h.addEventListener("click",l),m.addEventListener("mouseenter",c),m.addEventListener("mouseleave",u)}function Iq(){ec({scrollTop:O.get("scrollTop")})}function Dq(e){const{htmlDocument:t,commit:n}=e,r=()=>({commit:n,setCursorPosition:e.setCursorPosition,scrollTop:O.get("scrollTop"),iframeOffsetTop:O.get("iframeOffsetTop"),applicationElementSettingsSet:e.applicationElementSettingsSet}),o=yq({getLockEditor:()=>!!O.get("lockEditor"),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:Ga,findOutermostParentWithText:Gu,setBlockGroupControlsPosition:Iq,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:i=>bq(i,{getElementParent:s=>ic(s),setCursorPosition:e.setCursorPosition,getVariableByIcon:Vl,commit:n}),handleCloneAtom:i=>GW(i,r()),handleMoveBlockUp:i=>YW(i,r()),handleMoveBlockDown:i=>KW(i,r()),handleRemoveBlock:i=>ZW(i,r()),handleCloneBlock:i=>XW(i,r()),handleCopyBlock:(i,s)=>lq(i,s,{HTMLDocument:t}),handlePasteBlock:(i,s)=>cq(i,s,{HTMLDocument:t,parseFromString:Ie,getOuterHtml:Xt,minify:Gr,cssbeautify,insertAdjacentHTML:Xn,setBlockMaxWidth:a=>Om(a,t),setFloatBlocksWidth:a=>Nm(a,t),checkBlockAdaptivity:Ul,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:O.get("emailWidth"),appName:O.get("appName")}),handleMergeBlocks:i=>QW(i,r()),handleUnmergeBlocks:i=>JW(i,r()),isAddBlockMenuClick:sq,handleAddBlockMenu:(i,s)=>aq(i,s,{removeAllAttributes:ur,state:O,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:i=>wB(i,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:i=>eq(i,r()),handleMoveGroupDown:i=>tq(i,r()),handleAddGroup:i=>nq(i,r()),handleCloneGroup:i=>rq(i,r()),handleRemoveGroup:i=>oq(i,r()),isDiscussViewMode:mq,isDiscussSetTargetMode:pq,handleDiscussViewClick:hq,handleDiscussSetTargetClick:i=>gq(i,{makeId:ZN,commit:n}),handleCustomTableClick:Mq});document.onclick=_t(o),vq({commit:n,messageService:e.messageService})}function qw(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function Bq(e){return!e.closest(".em-element-editor-widget")}function Hq(e,t){if(t.lockEditor||!e.isTrusted)return!1;const n=vw();if(!n)return!1;const r=e.target;if(!(r instanceof HTMLElement)||!Bq(r))return!1;try{if(n.kind==="atom"){const o={settings:{atomHTML:typeof n.settings.atomHTML=="string"?n.settings.atomHTML:n.settings.atomHTML?.html,name:n.settings.name}};if(!o.settings.atomHTML)return!1;xw(qw(r,o.settings),t.atomDropCtx)}else if(n.kind==="block"&&document.body.classList.contains("em-block-insert-body")){const o={settings:{blockHTML:n.settings.blockHTML,type:n.settings.type,name:n.settings.name,project:n.settings.project,blockId:n.settings.blockId}};if(!o.settings.blockHTML)return!1;Lw(qw(r,o.settings),o,t.blockDropCtx)}else return!1;if(!vw())return e.preventDefault(),e.stopPropagation(),kw(),t.commit(),!0}catch{return!1}return!1}var zw="application/x-emailmaker-social-reorder";function ep(e){return e.closest('table[em-type="social"]')}function Uw(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function Vw(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function Fq(e){return Array.from(e.querySelectorAll(":scope > td:not([em-platform]):not([data-em-platform])")).find(t=>{const n=t;return n.getAttribute("width")!=null||n.innerHTML===" "||n.textContent===" "})}function $q(e,t){const n=Fq(e);e.replaceChildren(),t.forEach((r,o)=>{o>0&&n&&e.appendChild(n.cloneNode(!0)),r.removeAttribute("em-index"),r.removeAttribute("data-em-index"),e.appendChild(r)})}function Wq(e,t){if(t.lockEditor)return;const n=e.target?.closest?.("td[em-platform], td[data-em-platform]");if(!n||n.getAttribute("draggable")!=="true")return;const r=ep(n);if(!r)return;const o=Uw(r);if(!o)return;const i=Vw(o);if(i.length<2)return;const s=i.indexOf(n);if(s<0)return;const a=e.dataTransfer;if(!a)return;const l=String(s);a.setData("text/plain",l),a.setData(zw,l),a.effectAllowed="move"}function qq(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(zw);r||(r=n.getData("text/plain"));const o=parseInt(r,10);if(Number.isNaN(o))return!1;const i=e.target.closest?.("td[em-platform], td[data-em-platform]");if(!i)return!1;const s=ep(i);if(!s)return!1;const a=Uw(s);if(!a)return!1;const l=Vw(a);if(l.length<2)return!1;const c=l.indexOf(i);if(c<0)return!1;const u=l[o];if(!u||ep(u)!==s)return!1;if(o===c)return!0;const d=[...l];return d.splice(o,1),d.splice(c,0,u),$q(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function zq(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function eo(){return!!O.get("lockEditor")}function Uq(e){const t=document.querySelector(".em-just-inserted");if(!t)return;e.applicationElementSettingsSet({elem:t}),t.classList.remove("em-just-inserted"),e.commit();const n=RS(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function Vq(e,t,n){if(!eo())try{e.preventDefault(),e.stopPropagation();const r=uW(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||qq(e,{applicationElementSettingsSet:t.applicationElementSettingsSet});if(O.increment("activeElementLocked"),!r){if(document.body.classList.contains("em-block-insert-body"))try{const o=JSON.parse(e.dataTransfer?.getData("Text")||"{}");Lw(e,o,{...t.blockDropContext(),mutableState:n})}catch{}else if(document.body.classList.contains("em-atom-insert-body")||document.body.classList.contains("em-atom-insert-body-inside"))try{xw(e,{...t.atomDropContext(),mutableState:n})}catch{}}kw(),t.commit()}finally{Promise.resolve().then(()=>{O.decrement("activeElementLocked"),Uq(t)})}}function jq(e){const{dragState:t}=e,n=(r,o,i)=>document.addEventListener(r,_t(o),i);document.addEventListener("drag",r=>r.preventDefault(),!1),n("dragstart",r=>Wq(r,{lockEditor:eo()}),!0),n("dragstart",r=>dW(r,{lockEditor:eo(),commit:o=>{e.commit(o)},messageService:e.messageService,mutableState:t}),!1),n("dragover",r=>mW(r,{lockEditor:eo(),mutableState:t}),!1),n("dragenter",r=>pW(r,{lockEditor:eo(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),n("dragleave",r=>bW(r,{lockEditor:eo(),mutableState:t}),!1),n("drop",r=>Vq(r,e,t),!1),n("dragend",r=>fW(r,{lockEditor:eo(),messageService:e.messageService}),!1)}function Gq(e){const{htmlDocument:t}=e,n=f=>e.commit(f),r=zq(),o=e.commonStylesApply??(f=>W1(f,p=>e.commit(p))),i=f=>{o1(f,()=>e.commit())},s=f=>Om(f,t),a=f=>Nm(f,t),l=()=>({messageService:e.messageService,isJsonString:YN,getOuterHtml:Xt,minify:Gr,cssbeautify,HTMLDocument:t,_setDocumentStyles:(f,p)=>Ff(f,p),commonStylesApply:o,commonStylesApplyToBlock:nm,setImageWidth:xf,fitMovedImage:r1,setFloatBlocksWidth:a,fitImagesToColumns:xm,insertCountdown:i}),c=()=>({...l(),lockEditor:!!O.get("lockEditor"),state:O,commit:n,emailWidth:O.get("emailWidth")??null,parseFromString:f=>Ie(f),isTableElement:LT,uptimeCountdown:Of,setBlockMaxWidth:s,checkBlockAdaptivity:Ul,applicationElementSettingsSet:e.applicationElementSettingsSet});return{insertContext:()=>({state:O,commit:()=>e.commit(),lockEditor:!!O.get("lockEditor"),emailWidth:O.get("emailWidth"),iframeOffsetTop:O.get("iframeOffsetTop"),previewHeight:O.get("previewHeight"),parseFromString:f=>Ie(f),getOuterHtml:Xt,HTMLDocument:t,minify:Gr,cssbeautify,insertAdjacentHTML:(f,p,m)=>xg(f,p,m),messageService:e.messageService,setDocumentStyles:f=>Ff(f,{minify:Gr,cssbeautify,HTMLDocument:t}),setImageWidth:xf,commonStylesApply:o,commonStylesApplyToBlock:nm,insertCountdown:i,uptimeCountdown:Of,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:xm,checkBlockAdaptivity:Ul,setAtomReplaced:f=>{r.atomReplaced=f},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",_t(f=>{O.get("lockEditor")||Hq(f,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})}),!0),jq({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}function Xq(e){let t=!1;const n=o=>{t=!!o.target?.nodeName},r=o=>{t&&e.handlePasteTextFragment(o,!1,e.getCommonStyles(),e.changeMsoValue,()=>{e.commit()})};return document.addEventListener("contextmenu",n),document.addEventListener("paste",r),{setFromContextMenu(o){t=o},dispose(){document.removeEventListener("contextmenu",n),document.removeEventListener("paste",r)}}}function Yq(e,t){const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let r=0,o=null;for(;n.nextNode();){o=n.currentNode;const i=(o.textContent||"").length;if(r+i>=t){const s=t-r;return{node:o,offset:s}}r+=i}if(o){const i=o.textContent?.length||0;return{node:o,offset:i}}return null}function Kq(e,t,n,r){try{if(!n||n.nodeType!==Node.TEXT_NODE)return!1;const o=n.textContent?n.textContent.length:0,i=Math.min(Math.max(0,r),o);return e.setStart(n,i),e.collapse(!0),t.removeAllRanges(),t.addRange(e),!0}catch{return!1}}var jw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 4 L 15 24.0625 L 8.21875 17.28125 L 6.78125 18.71875 L 15.28125 27.21875 L 16 27.90625 L 16.71875 27.21875 L 25.21875 18.71875 L 23.78125 17.28125 L 17 24.0625 L 17 4 Z"/></svg>',Gw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 4.09375 L 15.28125 4.78125 L 6.78125 13.28125 L 8.21875 14.71875 L 15 7.9375 L 15 28 L 17 28 L 17 7.9375 L 23.78125 14.71875 L 25.21875 13.28125 L 16.71875 4.78125 Z"/></svg>',tp='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 12 6 C 10.894531 6 10 6.894531 10 8 C 10 9.105469 10.894531 10 12 10 C 13.105469 10 14 9.105469 14 8 C 14 6.894531 13.105469 6 12 6 Z M 20 6 C 18.894531 6 18 6.894531 18 8 C 18 9.105469 18.894531 10 20 10 C 21.105469 10 22 9.105469 22 8 C 22 6.894531 21.105469 6 20 6 Z M 12 14 C 10.894531 14 10 14.894531 10 16 C 10 17.105469 10.894531 18 12 18 C 13.105469 18 14 17.105469 14 16 C 14 14.894531 13.105469 14 12 14 Z M 20 14 C 18.894531 14 18 14.894531 18 16 C 18 17.105469 18.894531 18 20 18 C 21.105469 18 22 17.105469 22 16 C 22 14.894531 21.105469 14 20 14 Z M 12 22 C 10.894531 22 10 22.894531 10 24 C 10 25.105469 10.894531 26 12 26 C 13.105469 26 14 25.105469 14 24 C 14 22.894531 13.105469 22 12 22 Z M 20 22 C 18.894531 22 18 22.894531 18 24 C 18 25.105469 18.894531 26 20 26 C 21.105469 26 22 25.105469 22 24 C 22 22.894531 21.105469 22 20 22 Z"/></svg>',Zq='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 3 C 13.742188 3 12.847656 3.890625 12.40625 5 L 5 5 L 5 28 L 13 28 L 13 30 L 27 30 L 27 14 L 25 14 L 25 5 L 17.59375 5 C 17.152344 3.890625 16.257813 3 15 3 Z M 15 5 C 15.554688 5 16 5.445313 16 6 L 16 7 L 19 7 L 19 9 L 11 9 L 11 7 L 14 7 L 14 6 C 14 5.445313 14.445313 5 15 5 Z M 7 7 L 9 7 L 9 11 L 21 11 L 21 7 L 23 7 L 23 14 L 13 14 L 13 26 L 7 26 Z M 15 16 L 25 16 L 25 28 L 15 28 Z"/></svg>',Qq='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 2 C 14.742188 2 13.847656 2.890625 13.40625 4 L 5 4 L 5 29 L 27 29 L 27 4 L 18.59375 4 C 18.152344 2.890625 17.257813 2 16 2 Z M 16 4 C 16.554688 4 17 4.445313 17 5 L 17 6 L 20 6 L 20 8 L 12 8 L 12 6 L 15 6 L 15 5 C 15 4.445313 15.445313 4 16 4 Z M 7 6 L 10 6 L 10 10 L 22 10 L 22 6 L 25 6 L 25 27 L 7 27 Z M 21.28125 13.28125 L 15 19.5625 L 11.71875 16.28125 L 10.28125 17.71875 L 14.28125 21.71875 L 15 22.40625 L 15.71875 21.71875 L 22.71875 14.71875 Z"/></svg>',Cc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 4 4 L 4 24 L 11 24 L 11 22 L 6 22 L 6 6 L 18 6 L 18 7 L 20 7 L 20 4 Z M 12 8 L 12 28 L 28 28 L 28 8 Z M 14 10 L 26 10 L 26 26 L 14 26 Z"/></svg>',Jq='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 23 L 5 23 L 5 27 L 9 27 L 9 26 L 23 26 L 23 27 L 27 27 L 27 23 L 26 23 L 26 9 L 27 9 L 27 5 L 23 5 L 23 6 L 9 6 L 9 5 Z M 9 8 L 23 8 L 23 9 L 24 9 L 24 23 L 23 23 L 23 24 L 9 24 L 9 23 L 8 23 L 8 9 L 9 9 Z M 10 10 L 10 18 L 14 18 L 14 22 L 22 22 L 22 14 L 18 14 L 18 10 Z M 12 12 L 16 12 L 16 16 L 12 16 Z M 18 16 L 20 16 L 20 20 L 16 20 L 16 18 L 18 18 Z"/></svg>',ez='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 9 L 6 9 L 6 19 L 5 19 L 5 23 L 9 23 L 9 22 L 11 22 L 11 24 L 10 24 L 10 28 L 14 28 L 14 27 L 24 27 L 24 28 L 28 28 L 28 24 L 27 24 L 27 14 L 28 14 L 28 10 L 24 10 L 24 11 L 22 11 L 22 9 L 23 9 L 23 5 L 19 5 L 19 6 L 9 6 L 9 5 Z M 9 8 L 19 8 L 19 9 L 20 9 L 20 19 L 19 19 L 19 20 L 9 20 L 9 19 L 8 19 L 8 9 L 9 9 Z M 22 13 L 24 13 L 24 14 L 25 14 L 25 24 L 24 24 L 24 25 L 14 25 L 14 24 L 13 24 L 13 22 L 19 22 L 19 23 L 23 23 L 23 19 L 22 19 Z"/></svg>',Us='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 23.90625 3.96875 C 22.859375 3.96875 21.8125 4.375 21 5.1875 L 5.1875 21 L 5.125 21.3125 L 4.03125 26.8125 L 3.71875 28.28125 L 5.1875 27.96875 L 10.6875 26.875 L 11 26.8125 L 26.8125 11 C 28.4375 9.375 28.4375 6.8125 26.8125 5.1875 C 26 4.375 24.953125 3.96875 23.90625 3.96875 Z M 23.90625 5.875 C 24.410156 5.875 24.917969 6.105469 25.40625 6.59375 C 26.378906 7.566406 26.378906 8.621094 25.40625 9.59375 L 24.6875 10.28125 L 21.71875 7.3125 L 22.40625 6.59375 C 22.894531 6.105469 23.402344 5.875 23.90625 5.875 Z M 20.3125 8.71875 L 23.28125 11.6875 L 11.1875 23.78125 C 10.53125 22.5 9.5 21.46875 8.21875 20.8125 Z M 6.9375 22.4375 C 8.136719 22.921875 9.078125 23.863281 9.5625 25.0625 L 6.28125 25.71875 Z"/></svg>',Xw='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 5 L 15 15 L 5 15 L 5 17 L 15 17 L 15 27 L 17 27 L 17 17 L 27 17 L 27 15 L 17 15 L 17 5 Z"/></svg>',tz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 5 5 L 5 27 L 27 27 L 27 9.59375 L 26.71875 9.28125 L 22.71875 5.28125 L 22.40625 5 Z M 7 7 L 10 7 L 10 13 L 22 13 L 22 7.4375 L 25 10.4375 L 25 25 L 23 25 L 23 16 L 9 16 L 9 25 L 7 25 Z M 12 7 L 16 7 L 16 9 L 18 9 L 18 7 L 20 7 L 20 11 L 12 11 Z M 11 18 L 21 18 L 21 25 L 11 25 Z"/></svg>',np='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 15 4 C 14.476563 4 13.941406 4.183594 13.5625 4.5625 C 13.183594 4.941406 13 5.476563 13 6 L 13 7 L 7 7 L 7 9 L 8 9 L 8 25 C 8 26.644531 9.355469 28 11 28 L 23 28 C 24.644531 28 26 26.644531 26 25 L 26 9 L 27 9 L 27 7 L 21 7 L 21 6 C 21 5.476563 20.816406 4.941406 20.4375 4.5625 C 20.058594 4.183594 19.523438 4 19 4 Z M 15 6 L 19 6 L 19 7 L 15 7 Z M 10 9 L 24 9 L 24 25 C 24 25.554688 23.554688 26 23 26 L 11 26 C 10.445313 26 10 25.554688 10 25 Z M 12 12 L 12 23 L 14 23 L 14 12 Z M 16 12 L 16 23 L 18 23 L 18 12 Z M 20 12 L 20 23 L 22 23 L 22 12 Z"/></svg>';function Ne(e,t,n=""){const r=`class="${t}" width="1em" height="1em" fill="currentColor" aria-hidden="true"`;return e.replace("<svg",`<svg ${r}${n?` ${n}`:""}`)}var Ac={getLocale:Os,commit:Hr},nz=".em-prevent-action";function rz(){return O.get("emailWidth")||475}function oz(){return O.get("copyPasteEnabled")||!1}function iz(){return O.get("saveBlockEnabled")||!1}function sz(){return O.get("blocksAddPanelEnabled")||!1}function az(){return O.get("codeMode")||!1}var Yw=".em-mob-wrap, .noresp-em-mob-wrap";function Kw(e){return Array.from(document.querySelectorAll(e)).find(m1)??null}function Tc(e,t){const n=Ac.getLocale(),r=rz(),o=oz(),i=iz(),s=sz(),a=az();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=I({targetElement:e,insertType:"append",className:"em-element-editor",width:82,height:26});l.classList.add("of-atom"),document.body.getBoundingClientRect().height>70&&e.getBoundingClientRect().top+70>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe"),e.getBoundingClientRect().top<25&&l.classList.add("em-top-crossed");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"});I({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Ne(tp,`${Le} ${Ge.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Ne(Us,`${Le} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Ne(Cc,`${Le} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Ne(np,`${Le} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),tc(Ac.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=I({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-block"),e.getBoundingClientRect().left<35&&e.setAttribute("em-state","active-inside"),(document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height||document.documentElement.clientWidth<r&&e.getBoundingClientRect().top-34<0)&&l.classList.add("out-of-iframe");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});if(I({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Ne(tp,`${Le} ${Ge.drag}`),title:n.REORDER_BLOCK}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Ne(Gw,`${Le} ${Ge.moveUp}`),title:n.REORDER_BLOCK_UP}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Ne(jw,`${Le} ${Ge.moveDown}`),title:n.REORDER_BLOCK_DOWN}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Ne(Us,`${Le} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const m=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});I({targetElement:m,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Ne(Cc,`${Le} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),I({targetElement:m,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:Ne(Qq,`${Le} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),I({targetElement:m,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:Ne(Zq,`${Le} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Ne(Cc,`${Le} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(nz))return;const d=Kw('[em-edit="active"]'),f=Kw('[em-state^="active"]');if(d&&f&&(d.querySelector(Yw)&&f.querySelector(Yw)||d.closest(".em-structure")&&f.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:Ne(Jq,`${Le} ${Ge.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),vs(c.closest('[em="block"]')??c).flatMap(m=>Array.from(m.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:Ne(ez,`${Le} ${Ge.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:Ne(tz,`${Le} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Ne(np,`${Le} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const m=I({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&m.classList.add("out-of-iframe"),I({targetElement:m,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${Ne(Xw,`${Le} ${Ge.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK}),I({targetElement:m,insertType:"append",className:"add-empty-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="border-outer" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"></path></svg>',title:n.ADD_EMPTY_BLOCK}),I({targetElement:m,insertType:"append",className:"add-saved-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore-add" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"></path></svg>',title:n.ADD_SAVED_BLOCK}),I({targetElement:m,insertType:"append",className:"add-common-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"></path></svg>',title:n.ADD_COMMON_BLOCK}),I({targetElement:m,insertType:"append",className:"add-template-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="build" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"></path></svg>',title:n.ADD_TEMPLATE_BLOCK}),I({targetElement:m,insertType:"append",className:"add-search-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg>',title:n.ADD_SEARCH_BLOCK})}tc(Ac.commit);const p=e.closest('[em="block"]');p&&(p.onmouseleave=function(){ii(void 0)})}if(t==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const l=I({targetElement:e,insertType:"append",className:"em-element-editor"});l.classList.add("of-group"),document.body.getBoundingClientRect().height>130&&e.getBoundingClientRect().top+130>document.body.getBoundingClientRect().height&&l.classList.add("out-of-iframe");const c=I({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=I({targetElement:c,insertType:"append",className:"em-element-editor-group"});I({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Ne(tp,`${Le} ${Ge.drag}`),title:n.REORDER_BLOCK}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Ne(Gw,`${Le} ${Ge.moveUp}`),title:n.REORDER_BLOCK_UP}),I({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Ne(jw,`${Le} ${Ge.moveDown}`),title:n.REORDER_BLOCK_DOWN}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:Ne(Xw,`${Le} ${Ge.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Ne(Us,`${Le} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),I({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Ne(Cc,`${Le} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&I({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Ne(np,`${Le} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),tc(Ac.commit)}}function ii(e){if(document.documentElement.classList.contains("em-resize-start"))return;const t=O.get("isLeftButtonDown")||!1;e&&e.closest("[em]")?.getAttribute("em")==="atom"?(document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{n.closest('[em="atom"]')!==e&&!t&&n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group').forEach(n=>{n.remove()}),document.querySelectorAll('[em="atom"][em-state], [em="atom"] [em-state]').forEach(n=>{n.closest('[em="atom"]')!==e&&n.removeAttribute("em-state")})):e&&e.closest("[em]")?.getAttribute("em")==="block"?(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(n=>{n.closest('[em="block"]')!==e&&!t&&n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor.of-group, [em="atom"] .em-element-editor').forEach(n=>{n.remove()}),document.querySelectorAll("[em-state]").forEach(n=>{(n.closest('[em="block"]')!==e||n.closest('[em="atom"]'))&&n.removeAttribute("em-state")})):(e&&e.closest("[em]")?.getAttribute("em")==="group"||e===void 0)&&(document.querySelectorAll('[em="block"] .em-element-editor, .em-element-block-add, [em="block"] .em-vindent-paddingTop, [em="block"] .em-vindent-paddingRight, [em="block"] .em-vindent-paddingBottom, [em="block"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value, .em-gap').forEach(n=>{t||n.remove()}),document.querySelectorAll('[em="atom"] .em-element-editor, [em="atom"] .em-vindent-paddingTop, [em="atom"] .em-vindent-paddingRight, [em="atom"] .em-vindent-paddingBottom, [em="atom"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{t||n.remove()}),document.querySelectorAll('[em="group"] .em-element-editor, [em="group"] .em-vindent-paddingTop, [em="group"] .em-vindent-paddingRight, [em="group"] .em-vindent-paddingBottom, [em="group"] .em-vindent-paddingLeft, td.em-vindent .em-element-vindent-value, div[style*="height"][style*="line-height"].em-vindent .em-element-vindent-value').forEach(n=>{n.closest('[em="group"]')!==e&&!t&&n.remove()}),document.querySelectorAll("[em-state]").forEach(n=>{(n.closest('[em="group"]')!==e||n.closest('[em="block"]')||n.closest('[em="atom"]'))&&n.removeAttribute("em-state")})),document.querySelectorAll(".em-block-insert").forEach(n=>n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")),document.querySelectorAll(".em-block-insert-empty").forEach(n=>n.classList.remove("em-block-insert-empty")),document.querySelectorAll('[em-hover="true"]').forEach(n=>n.removeAttribute("em-hover"))}function lz(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if(ii(n),n.querySelector(".em-element-editor.of-atom")||Tc(n.tagName==="TR"?n.querySelector("td"):n,"atom"),!n.closest('[em="block"]')?.querySelector(".em-element-editor.of-block")){document.querySelectorAll('[em="block"] > td > .em-element-editor, [em="block"] > td > .em-element-block-add').forEach(o=>{o.remove()}),document.querySelectorAll("[em-state]").forEach(o=>{o.removeAttribute("em-state")});const r=n.closest('[em="block"]');r&&Tc(r.tagName==="TR"?r.querySelector("td"):r,"block"),t.setBlockGroupControlsPosition()}}else(n=e.closest('[em="block"]'))?(ii(n),n.querySelector(".em-element-editor.of-block")||(Tc(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&(ii(n),n.querySelector(".em-element-editor.of-group")||(Tc(n.tagName==="TR"?n.querySelector("td"):n,"group"),t.setBlockGroupControlsPosition()));e.closest(".em-element-path")||document.querySelectorAll('[em-hover="true"]').forEach(function(r){r.removeAttribute("em-hover")}),!e.closest(".em-editor-wrapper")&&!e.closest(".em-element-editor")&&!e.closest(".em-vindent")&&!e.closest(".em-gap")&&!e.closest(".em-element-resize-img")&&!e.closest(".em-element-img-change-group")&&!e.closest(".em-element-block-add")&&!e.closest(".em-element-path")&&e.tagName!=="IMG"?e.setAttribute("em-hover","true"):e.tagName==="IMG"&&e.parentElement?.setAttribute("em-hover","true"),t.commit(!1)}var{START_POSITION:Vs,NEW_EDITOR:rp}=rw,{TRIM_SPACES:js,EMPTY_TEXT:cz}=ow;function uz(e,t){const{activeElem:n,listContext:r,cursorPositionType:o,isTargetCell:i,commit:s,wrapEditor:a,removeTemporaryListClasses:l}=t,{classNameOl:c,classNameUl:u,isList:d}=r;if(!((e.key==="Enter"||e.keyCode===13)&&d&&i&&!e.shiftKey))return!1;if(e.preventDefault(),e.stopImmediatePropagation(),!n)return!0;const f=n.closest(`table.${c}`)||n.closest(`table.${u}`),p=n.closest(`table.${c}`)?c:u;if(!f)return!0;const m=Ba(f).counterpart(n)??n,h=iH(m,p);if(!h)return!0;const{firstCellText:y,firstCellHtmlNoText:w,wrappedSecondCellHtml:A}=h;return o==="start"||o==="end"?dz(n,f,p,c,u,o,y,w,A,a):o==="inside"&&fz(n,f,p,c,a),l(),s(),!0}function dz(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add(Vs);const d=US(a,s),f=US(l," "),p=i==="end"?pH(f):f,m=Ha(t),h="<tr>"+d+p+"</tr>",y=oi(m),w=sH(y,h,Vs,i==="start"),A=oi(w);$r(t),Me(t,A);const k=t.querySelector(`.${Vs}`)?.closest("tr"),b=i==="start"?k?.previousElementSibling:k?.nextElementSibling;b&&VS(b),n===r&&Sm(t),mH(t,r,o,js);const v=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return v&&Zw(v,t,c),v}function fz(e,t,n,r,o){const i=window.getSelection(),s=e.closest("tr"),a=e.querySelector("div");if(!i||i.rangeCount===0||!s||!a)return null;const l=i.getRangeAt(0),c=a.contains(l.startContainer)?dH(s,a,l):null;return c?(VS(c.row),s.after(c.row),$r(t),uH(t),c.content.classList.add(rp),n===r&&Sm(t),Zw(c.content,t,o,!0),c.content):null}function Zw(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&ri(e,Ue(e).replace(js,"")),cz.test(e.textContent||"")&&(e.textContent=" "),n(e,!0);const o=t.querySelector("editor"),i=o?.querySelector("div");if(i){const s=window.getSelection();if(s&&s.rangeCount>0){const a=s.getRangeAt(0);a.selectNodeContents(i),a.collapse(!0),Pi(s,a)}}r&&o&&It(()=>o.focus())}function mz(e,t){const{activeElem:n,listContext:r,cursorPositionType:o,isTargetCell:i,isEmptyText:s,commit:a,wrapEditor:l,removeTemporaryListClasses:c}=t,{classNameOl:u,classNameUl:d,isList:f}=r,p=(e.keyCode===38||e.key==="ArrowUp")&&o==="start",m=(e.keyCode===40||e.key==="ArrowDown")&&(!s&&o==="end"||s&&o==="start");if(!(p||m)||!f||!i||!n)return!1;e.preventDefault(),e.stopImmediatePropagation();const h=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",y=n.closest(`table.${u}`)||n.closest(`table.${d}`);if(!y)return!0;const w=n.querySelector("div");w&&w.classList.add(Vs);const A=Ha(y),k=oi(A),b=fH(k,Vs,rp,h);$r(y),Me(y,b);const v=y.querySelector(".remove-new-editor-element");if(v){l(v,!0);const S=y.querySelector("editor"),T=S?.querySelector("div")?.childNodes[0],g=window.getSelection();if(g&&g.rangeCount>0){const E=g.getRangeAt(0);if(T&&T.nodeType===Node.TEXT_NODE){const C=T.textContent||"";E.setStart(T,C.replace(js,"").length)}else S&&E.selectNodeContents(S);E.collapse(!0),Pi(g,E)}}return c(),a(),!0}function pz(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function hz(e,t){const n=window.navigator.platform.match("Mac"),{activeElem:r,listContext:o,cursorPositionType:i,isTargetCell:s,isEmptyText:a,parentElement:l,commit:c,wrapEditor:u,removeTemporaryListClasses:d,findNodeAtPosition:f}=t,p=(...be)=>It(()=>t.setCursorSafely(...be)),{classNameOl:m,classNameUl:h,isList:y}=o;if(!((n?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&y)||!(!s||s&&(i==="start"||a&&i==="inside"||a&&i==="end"))||!r||!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const w=r.closest(`table.${m}`)?m:h,A=l.closest("tr");if(!A)return!0;const k=A.previousElementSibling;if(!k&&!s)return!0;const b=s?r.querySelector("div"):A.querySelector("tr td:nth-child(2)")?.querySelector("div"),v=b?Ue(b):"",S=v?v.split(" ")[0]:"";S.replace(js,"");const T=k?.querySelector("tr td:nth-of-type(2)");if(!T)return!0;const g=T.querySelector("div");if(!g)return!0;g.classList.add(rp);const E=Ue(g),C=`${E}${v}`;$r(A.parentNode??A),A.remove();const _=g.closest(`table.${m}`)||g.closest(`table.${h}`);if(!_)return!0;const x=Ue(_),N=oi(x);Me(_,N),w===m&&Sm(_);const W=_.querySelector(".remove-new-editor-element");if(!W)return d(),c(),!0;const R=C.replace(js,"");ri(W,`${R} `),u(W,!0);const M=W.closest("editor");if(!M)return d(),c(),!0;const te=window.getSelection(),j=document.createRange(),ne=M.querySelector("div");if(!ne||!te)return d(),c(),!0;const re=M.textContent||"",Q=S?re.indexOf(S):-1;if(Q!==-1&&S){const be=f(ne,Q);if(be)p(j,te,be.node,be.offset);else{const de=ne.childNodes[0];de&&p(j,te,de,0)}}else{const be=document.createElement("div");be.innerHTML=E;const de=(be.textContent||"").length,Ee=f(ne,de);if(Ee)p(j,te,Ee.node,Ee.offset);else{const me=document.createTreeWalker(ne,NodeFilter.SHOW_TEXT,null);let X=null;for(;me.nextNode();)X=me.currentNode;X&&p(j,te,X,(X.textContent||"").length)}}return It(()=>M.focus()),d(),c(),!0}function gz(e,t,n){return(window.navigator.platform.match("Mac")?e.code==="Backspace":e.keyCode===46||e.keyCode===8)?!1:t&&!n?(e.preventDefault(),e.stopPropagation(),!0):!1}function bz(e){if(!e)return!1;const t=e.closest("li");return fc(t)}function yz(e){const t=window.getSelection(),n=e.textContent||"",r=n.trim();if(!r||r===" ")return{position:"empty",offset:0,textContent:""};if(!t||t.rangeCount===0)return{position:"middle",offset:0,textContent:n};const o=t.getRangeAt(0);if(!e.contains(o.startContainer))return{position:"middle",offset:0,textContent:n};const i=document.createRange();i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset);const s=i.toString().length;return s===0?{position:"start",offset:0,textContent:n}:s>=r.length?{position:"end",offset:s,textContent:n}:{position:"middle",offset:s,textContent:n}}function vz(e,t){const n=Array.from(t.querySelectorAll(":scope > li")),r=n.indexOf(e);return r===0?"first":r===n.length-1?"last":"middle"}function Ez(e){const t=window.getSelection();if(!t||t.rangeCount===0)return Ue(e);const n=t.getRangeAt(0),r=document.createRange();r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset);const o=r.cloneContents(),i=document.createElement("div");return i.appendChild(o),Fr(i),i.innerHTML}function Sz(e){const t=window.getSelection();if(!t||t.rangeCount===0)return"";const n=t.getRangeAt(0),r=document.createRange();r.selectNodeContents(e),r.setStart(n.endContainer,n.endOffset);const o=r.cloneContents(),i=document.createElement("div");return i.appendChild(o),Fr(i),i.innerHTML}function si(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function Gs(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function wz(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML=" ",Gs(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),si(r),r}function Cz(e,t){const n=Array.from(t.querySelectorAll(":scope > li")),r=n.indexOf(e),o=n.slice(r+1),i=document.createElement(t.tagName.toLowerCase());t.getAttribute("style")&&i.setAttribute("style",t.getAttribute("style")),o.forEach(l=>{i.appendChild(l)});const s=document.createElement("br"),a=document.createElement("span");return a.innerHTML=" ",Gs(e,a),i.children.length>0&&t.parentNode?.insertBefore(i,t.nextSibling),t.parentNode?.insertBefore(a,t.nextSibling),t.parentNode?.insertBefore(s,a),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),si(a),a}function Az(e,t){if(!((e.key==="Enter"||e.keyCode===13)&&!e.shiftKey))return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0).startContainer,o=r.nodeType===Node.TEXT_NODE?r.parentElement:r;if(!bz(o))return!1;const i=o?.closest("li");if(!i)return!1;const s=i.closest("ul, ol");if(!s)return!1;e.preventDefault(),e.stopImmediatePropagation();const a=yz(i),l=vz(i,s);switch(a.position){case"empty":Tz(i,s,l,t);break;case"start":_z(i,s,t);break;case"end":kz(i,s,t);break;case"middle":Lz(i,s,t)}return t.commit(),!0}function Tz(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",Wn.LIST_ITEM),o.innerHTML=" ",e.after(o),Gs(e,o),si(o);break;case"first":wz(e,t);break;case"middle":Cz(e,t)}}function _z(e,t,n){const r=document.createElement("li");r.setAttribute("style",Wn.LIST_ITEM),r.innerHTML=" ",e.before(r),si(e)}function kz(e,t,n){const r=document.createElement("li");r.setAttribute("style",Wn.LIST_ITEM),r.innerHTML=" ",e.after(r),Gs(e,r),si(r)}function Lz(e,t,n){const r=Ez(e),o=Sz(e);ri(e,r||" ");const i=document.createElement("li");i.setAttribute("style",Wn.LIST_ITEM),ri(i,o||" "),e.after(i),Gs(e,i),si(i)}function Nz(e){const t=r=>cf({target:r.target},o=>e.commit(o)),n=()=>O.get("commonStyles");return function(o){const i=window.getSelection(),s=(i?.rangeCount?i.getRangeAt(0):null)?.commonAncestorContainer,a=s?.nodeType===1?s:s?.parentElement,l=a?.closest("editor"),c=window.navigator.platform.match("Mac"),u=l?oH(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),f=o.target,p=mc(f),{isList:m}=p,h=d?.textContent===l?.textContent,y=l?ow.EMPTY_TEXT.test(l.textContent||""):!1,w=c?o.metaKey:o.ctrlKey;if(w&&o.keyCode===83){o.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}const A=BW(o,!!w);if(A){o.preventDefault(),Rw(e.messageService,A);return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}const k={getElementParent:g=>ic(g),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>ii(void 0),getVariableByIcon:Vl,removeEmptyParents:zs,getAllComments:n8,isVariableComment:l1,getVariableIcon:g=>i8(g),commit:e.commit,messageService:e.messageService};if($W(o,m,u,k))return;if(o.keyCode===27){const g=document.querySelector(".em-editor-wrapper");g?.style&&(g.style.display="none"),ur("em-edit"),It(()=>document.querySelectorAll("editor").forEach(E=>E.blur())),i?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}w&&o.keyCode===66&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const b=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&b&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),w&&o.shiftKey&&o.keyCode===76&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),w&&o.shiftKey&&o.keyCode===82&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),w&&o.shiftKey&&o.keyCode===69&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),w&&o.keyCode===73&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),w&&o.keyCode===85&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),Az(o,{commit:e.commit})||qW(o,l,m,h,{commit:e.commit}))return;if(w&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const g=E=>{ju(E,!1,n(),t,e.commit),document.removeEventListener("paste",g)};document.addEventListener("paste",g)}else t(o);const v={activeElem:l,listContext:p,cursorPositionType:u,isTargetCell:h,isEmptyText:y,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>XH()};if(uz(o,v)||(pz(o,u,y),mz(o,v)))return;const S={...v,parentElement:a,findNodeAtPosition:Yq,setCursorSafely:Kq};if(hz(o,S)||gz(o,m,h))return;const T={setCursorInsideSpan:a8,isCaretAtEndOfStandardElement:l8,setCursorPositionSimple:c8,commit:e.commit};WW(o,T)&&e.commit()}}function Qw(e){document.body?.classList.contains("mceNonEditable")||O.get("lockEditor")||!e.target?.closest?.('[contenteditable="true"]')||!e.key||e.ctrlKey||e.altKey||e.metaKey||e.key.length===1&&(e.preventDefault(),e.stopImmediatePropagation(),To("insertText",!1,e.key))}function xz(){return document.addEventListener("keydown",Qw,!0),{dispose(){document.removeEventListener("keydown",Qw,!0)}}}function Oz(e){const t=Xq({handlePasteTextFragment:ju,getCommonStyles:()=>O.get("commonStyles"),changeMsoValue:n=>cf({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",Nz({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),document.addEventListener("beforeinput",n=>FW(n,e),!0),xz()}var Rz='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M 16 4 C 10.886719 4 6.617188 7.160156 4.875 11.625 L 6.71875 12.375 C 8.175781 8.640625 11.710938 6 16 6 C 19.242188 6 22.132813 7.589844 23.9375 10 L 20 10 L 20 12 L 27 12 L 27 5 L 25 5 L 25 8.09375 C 22.808594 5.582031 19.570313 4 16 4 Z M 25.28125 19.625 C 23.824219 23.359375 20.289063 26 16 26 C 12.722656 26 9.84375 24.386719 8.03125 22 L 12 22 L 12 20 L 5 20 L 5 27 L 7 27 L 7 23.90625 C 9.1875 26.386719 12.394531 28 16 28 C 21.113281 28 25.382813 24.839844 27.125 20.375 Z"/></svg>',_c=4;function Mz(e,t){return e.left<_c||e.right-e.left>t-8?_c-e.left:e.right>t-_c?t-_c-e.right:0}var ai=null,op=null;function ip(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;ai||(ai=new CSSStyleSheet),document.adoptedStyleSheets.includes(ai)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,ai]),ai.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;op=e;const r=Math.round(Mz(n,document.documentElement.clientWidth));r!==0&&ai.replaceSync(`${t} { margin-left: ${r}px; }`)}function Pz(e,t,n){e.addEventListener("mouseenter",()=>{op=null,ip(t,n)}),e.addEventListener("mousemove",()=>{op!==t&&ip(t,n)}),t.addEventListener("mouseenter",()=>ip(t,n))}function to(e,t){return{settings:e,elem:t}}var Ye={applicationElementSettingsSet:e=>D(Tt,He)(e),setCursorPosition:e=>D(Tt,At)(e),commit:Hr};function Iz(){return O.get("emailWidth")||475}function kc(){return document.documentElement.clientWidth<=Iz()}function sp(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Ye.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Ye.setCursorPosition(s),ze(document.documentElement,!0,"em-resize-start")};o.addEventListener("touchstart",s=>{const a=s.touches[0];if(s.touches.length!==1||!a)return;s.preventDefault(),i();let l={x:a.clientX,y:a.clientY};const c={x:0,y:0},u=document.documentElement,d=p=>{const m=p.touches[0];if(!m)return;p.preventDefault(),c.x+=m.clientX-l.x,c.y+=m.clientY-l.y,l={x:m.clientX,y:m.clientY};const h={x:Math.trunc(c.x),y:Math.trunc(c.y)};h.x===0&&h.y===0||(c.x-=h.x,c.y-=h.y,o.mousemove({movementX:h.x,movementY:h.y}))},f=()=>{u.removeEventListener("touchmove",d),u.removeEventListener("touchend",f),u.removeEventListener("touchcancel",f),o.stopDrag()};u.addEventListener("touchmove",d,{passive:!1}),u.addEventListener("touchend",f),u.addEventListener("touchcancel",f)},{passive:!1}),o.onmousedown=function(){i();try{document.documentElement.addEventListener("mousemove",o.doDrag,!1),document.documentElement.addEventListener("mouseup",o.stopDrag,!1)}catch{}},o.doDrag=function(s){if(s.which!=1){o.stopDrag();return}o.mousemove(s)},o.stopDrag=function(){document.documentElement.removeEventListener("mousemove",o.doDrag,!1),document.documentElement.removeEventListener("mouseup",o.stopDrag,!1),r&&r(),setTimeout(()=>{ze(document.documentElement,!1,"em-resize-start"),Ye.commit(!1)})}}function no(e,t,n){sp(e,t,"ns-resize",n)}function Xs(e,t,n){sp(e,t,"ew-resize",n)}function Dz(e,t,n){sp(e,t,"nwse-resize",n)}function ro(e,t){let n=null,r=0;const o=kc();if(e.closest('div[style*="font-size"][style*="line-height"]')){if(n=e.closest('div[style*="height"][style*="line-height"]'),!n)return;r=n.clientHeight+t,o?ti(to({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):(n.style.height=r+"px",n.style.lineHeight=r+"px")}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;n.classList.add("em-hover"),r=n.clientHeight+t,n.closest("tr")?.querySelectorAll(".em-gap").forEach(i=>{const s={mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},a=i.closest(".em-mob-wrap, .noresp-em-mob-wrap");ti(to(s,a)),i.style.height=r+"px";const l=i.querySelector(".em-element-gap-value");l&&(l.innerHTML=r+"px")})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(n=e.closest(".em-vindent-paddingTop"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?xs(to({mobilePadding:{top:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingTop=r+"px")}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(n=e.closest(".em-vindent-paddingBottom"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?xs(to({mobilePadding:{bottom:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingBottom=r+"px")}else{if(n=e.closest("td"),!n)return;r=n.clientHeight+t,o?ti(to({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):n.setAttribute("height",String(r))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Ye.commit()}function oo(e){let t=null;const n=kc();if(e.closest('div[style*="height"][style*="line-height"]')){if(t=e.closest('div[style*="height"][style*="line-height"]'),!t)return;parseInt(t.style.height)<=0?t.remove():Ye.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Ye.applicationElementSettingsSet({elem:Pf(t)})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(t=e.closest(".em-vindent-paddingTop"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Ye.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(t=e.closest(".em-vindent-paddingBottom"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Ye.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Ye.applicationElementSettingsSet({elem:t})}t&&Ye.commit()}function li(e,t){let n=null,r=0;const o=kc();if(e.closest(".em-element-resize-img-container")){const i=e.closest(".em-element-resize-img-container")?.querySelector("img");if(!i)return;const s=i.clientWidth+t;i.style.maxWidth=s+"px",i.setAttribute("width",String(s)),Ye.commit()}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;if(n.classList.add("em-hover"),r=n.clientWidth+t,r>=0){const i=n.clientWidth,s=Array.from(n.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(odd)")||[]).map(u=>u.clientWidth),a=s.reduce((u,d)=>u+d,0),l=a+(s.length-1)*i,c=n.closest("tr");if(!c)return;if(l-3<=c.clientWidth||t<=0){let u=Array.from(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")).filter(y=>y.dataset.percent).map(y=>y.dataset.percent);u.length||(u=s.map(y=>((y||0)/a*100).toFixed(1)),Xu(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,f=(y,w)=>Math.round(w*parseFloat(y)/100);let p=s.map((y,w)=>f(u[w],d));const m=l-(p.reduce((y,w)=>y+w,0)+(s.length-1)*r);if(m!==0){const y=p.length-Math.abs(m);p=p.map((w,A)=>y<=A?w+(m>0?1:-1):w)}const h=p;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((y,w)=>{Array.from(y.querySelectorAll("table[width]")).filter(A=>!A.getAttribute("width")?.includes("%")).forEach(A=>{+(A.getAttribute("width")||0)<=h[w]&&(A.style.maxWidth=String(h[w]),A.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((y,w)=>y.setAttribute("width",String(h[w]))),c.querySelectorAll(".em-gap").forEach(y=>{y.parentElement?.setAttribute("width",String(r)),y.style.width=r+"px";const w=y.querySelector(".em-element-gap-value");w&&(w.innerHTML=r+"px")})}}}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(n=e.closest(".em-vindent-paddingLeft"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientWidth+t,n.style.width=r+"px",o&&i?xs(to({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>pc(s)))}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(n=e.closest(".em-vindent-paddingRight"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientWidth+t,n.style.width=r+"px",o&&i?xs(to({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>pc(s)))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value, .em-element-gap-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Ye.commit()}function ci(e){let t=null;const n=kc();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Ye.applicationElementSettingsSet({elem:r}),Ye.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Ye.applicationElementSettingsSet({elem:Pf(t)});else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(t=e.closest(".em-vindent-paddingLeft"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Ye.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(t=e.closest(".em-vindent-paddingRight"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Ye.applicationElementSettingsSet({elem:r})}t&&Ye.commit()}var Jw={getLocale:Os,commit:Hr,messageService:K},Bz=".em-prevent-action",eC=new WeakSet;function Hz(){return O.get("emailWidth")||475}function Fz(){return O.get("isLeftButtonDown")||!1}function $z(){return O.get("editImageControlEnabled")||!1}function tC(){return O.get("imageCenterEditorEnabled")||!1}function Wz(){return O.get("imageCenterStockEnabled")||!1}function qz(){return O.get("imageCenterGifEnabled")||!1}function zz(){return O.get("elementAIimageEnabled")||!1}function Uz(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=Jw.getLocale(),n=Hz(),r=Fz(),o=tC(),i=document.documentElement.clientWidth<=(n||475);if(document.body&&!document.body.classList.contains("mceNonEditable")&&!r){if(e.tagName==="TD"&&e.innerHTML===""&&e.getAttribute("height")&&!e.classList.contains("em-vindent")&&!e.closest("editor")){e.classList.add("em-vindent"),e.closest("table")?.classList.add("em-vindent-table"),parseInt(e.getAttribute("height")||"0")<30&&e.classList.add("em-vindent_low");const m=I({targetElement:e,insertType:"append",className:"em-element-resize-height"});I({targetElement:e,insertType:"append",className:"em-element-vindent"}),I({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),no(m,function(h){ro(m,h.movementY)},function(){oo(m)})}if(e.closest(Bz))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const m=qr(e,"em-mob-height"),h=m?parseFloat(m.substring(14,m.length-2)):void 0;I({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(h||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!i||!h?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):h<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}if(e.tagName==="DIV"&&e.style.height&&e.style.fontSize&&!e.classList.contains("em-vindent")&&!e.closest("editor")&&e.style.height&&e.style.lineHeight&&!e.style.fontFamily){e.classList.add("em-vindent"),parseFloat(e.style.height)<30&&e.classList.add("em-vindent_low");const m=I({targetElement:e,insertType:"append",className:"em-element-resize-height"}),h=I({targetElement:e,insertType:"append",className:"em-element-vindent"});I({targetElement:h,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),I({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),no(m,function(y){ro(m,y.movementY)},function(){oo(m)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const m=qr(e,"em-mob-height"),h=m?parseFloat(m.substring(14,m.length-2)):void 0;I({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(h||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!i||!h?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):h<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=qr(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=qr(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=qr(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,f=qr(e,"em-mob-padding_right"),p=f?parseFloat(f.substring(21)):void 0;if((e.style.padding||e.style.paddingTop||e.style.paddingBottom||e.style.paddingLeft||e.style.paddingRight)&&!e.closest("editor")&&(e.tagName!=="A"||e.style.height)){if(e.style.paddingTop&&!e.querySelector(":scope > .em-vindent-paddingTop")&&!e.querySelector(":scope > editor > .em-vindent-paddingTop")&&(!a||!i)){const m=I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&m.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${e.style.paddingBottom}`}),e.style.paddingLeft&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&!e.querySelector(":scope > editor > .em-vindent-paddingLeft")&&(!d||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${e.style.paddingLeft}`}),e.style.paddingRight&&!e.querySelector(":scope > .em-vindent-paddingRight")&&!e.querySelector(":scope > editor > .em-vindent-paddingRight")&&(!p||!i)&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(m=>{if(!m.querySelector(".em-element-resize-height")){const h=m;(parseFloat(h.style.height)<30||parseFloat(h.style.width)<30)&&m.classList.add("em-vindent_low");const y=I({targetElement:h,insertType:"append",className:"em-element-resize-height"});I({targetElement:h,insertType:"append",className:"em-element-vindent-marker"}),I({targetElement:h,insertType:"append",className:"em-element-vindent-bg"});const w=I({targetElement:h,insertType:"append",className:"em-element-vindent"});let A="";h.className.indexOf("paddingTop")>-1?(A=e.style.paddingTop,no(y,function(k){ro(y,k.movementY)},function(){oo(y)})):h.className.indexOf("paddingBottom")>-1?(A=e.style.paddingBottom,no(y,function(k){ro(y,k.movementY)},function(){oo(y)})):h.className.indexOf("paddingLeft")>-1?(A=e.style.paddingLeft,Xs(y,function(k){li(y,k.movementX)},function(){ci(y)})):h.className.indexOf("paddingRight")>-1&&(A=e.style.paddingRight,Xs(y,function(k){li(y,-k.movementX)},function(){ci(y)})),I({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:A})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),p&&!e.querySelector(":scope > .em-vindent-paddingRight")&&I({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${p}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(m=>{if(!m.querySelector(".em-element-resize-height")){const h=m;(parseFloat(h.style.height)<30||parseFloat(h.style.width)<30)&&m.classList.add("em-vindent_low");const y=I({targetElement:h,insertType:"append",className:"em-element-resize-height"});I({targetElement:h,insertType:"append",className:"em-element-vindent-marker"}),I({targetElement:h,insertType:"append",className:"em-element-vindent-bg"});const w=I({targetElement:h,insertType:"append",className:"em-element-vindent"});let A="";h.className.indexOf("paddingTop")>-1?(A=a,no(y,function(k){ro(y,k.movementY)},function(){oo(y)})):h.className.indexOf("paddingBottom")>-1?(A=c,no(y,function(k){ro(y,k.movementY)},function(){oo(y)})):h.className.indexOf("paddingLeft")>-1?(A=d,Xs(y,function(k){li(y,k.movementX)},function(){ci(y)})):h.className.indexOf("paddingRight")>-1&&(A=p,Xs(y,function(k){li(y,-k.movementX)},function(){ci(y)})),I({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(A)})}})),e.closest('[em="block"]')?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length||0)>2&&!e.closest('[em="block"]')?.querySelector(".em-mob-wrap .em-gap, .noresp-em-mob-wrap .em-gap")){const m=qr(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),h=m?parseFloat(m.substring(14,m.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(y=>{I({targetElement:y,insertType:"append",className:"em-gap",style:i?`height: ${h}px;`:`width: ${y.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(y=>{if(!y.querySelector(".em-element-resize-height")){const w=y,A=I({targetElement:w,insertType:"append",className:"em-element-resize-height"});I({targetElement:w,insertType:"append",className:"em-element-gap-marker"}),I({targetElement:w,insertType:"append",className:"em-element-gap-bg"});const k=I({targetElement:w,insertType:"append",className:"em-element-gap"});let b="";i?(b=w.style.height,no(A,function(v){ro(A,v.movementY)},function(){oo(A)})):(b=w.style.width,Xs(A,function(v){li(A,v.movementX)},function(){ci(A)})),I({targetElement:k,insertType:"append",className:"em-element-gap-value",HTMLcontent:b})}})}if(e.tagName==="IMG"){const m=e;if(m.closest("td[em-platform], td[data-em-platform]"))return;if(m.closest(".em-element-resize-img-container")||m.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||m.closest("editor")||m.classList.contains("em-video")){if(m.closest(".em-element-resize-img-container")){const A=m.closest(".em-element-resize-img-container"),k=A.querySelector(".em-element-img-edit");!m.getAttribute("src")?.includes(".gif")&&o?k||I({targetElement:A.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:Ne(Us,`${Le}`),title:t.CHANGE_IMAGE_EDIT}):A.querySelector(".em-element-img-edit")?.remove()}return}const h=document.createElement("span");h.classList.add("em-element-resize-img-container");const y=m.parentElement instanceof HTMLAnchorElement?m.parentElement:m;y.parentElement?.insertBefore(h,y),h.appendChild(y);const w=I({targetElement:h,insertType:"append",tag:"span",className:"em-element-resize-img"});Dz(w,function(A){li(w,A.movementX)},function(){ci(w)}),m?.style.maxWidth&&m?.style.display==="block"&&m.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),Vz(m,h)}}}function Vz(e,t){const n=Jw;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=$z(),i=tC(),s=Wz(),a=qz(),l=zz();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=I({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(I({targetElement:c,insertType:"append",className:"em-element-img-change",HTMLcontent:'<svg viewBox="0 0 20 20" focusable="false" data-icon="bg-colors" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M3.75 17.5C3.41667 17.5 3.125 17.375 2.875 17.125C2.625 16.875 2.5 16.5833 2.5 16.25V3.75C2.5 3.41667 2.625 3.125 2.875 2.875C3.125 2.625 3.41667 2.5 3.75 2.5H16.25C16.5833 2.5 16.875 2.625 17.125 2.875C17.375 3.125 17.5 3.41667 17.5 3.75V16.25C17.5 16.5833 17.375 16.875 17.125 17.125C16.875 17.375 16.5833 17.5 16.25 17.5H3.75ZM3.75 16.25H16.25V3.75H3.75V16.25ZM4.91667 14.2292H15.1042L12.0417 10.1458L9.29167 13.7083L7.35417 11.0625L4.91667 14.2292Z"></path></svg>',title:r.CHANGE_IMAGE}),!e.getAttribute("src")?.includes(".gif")&&i&&I({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:Ne(Us,`${Le}`),title:r.CHANGE_IMAGE_EDIT}),s&&I({targetElement:c,insertType:"append",className:"em-element-img-stock",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M4.12726 7.18183H9.6909L7.86364 4.76364L6.44545 6.63637L5.4909 5.49092L4.12726 7.18183ZM0.909082 11.3636C0.659082 11.3636 0.445068 11.2746 0.267041 11.0966C0.0890136 10.9186 0 10.7046 0 10.4546V2.99999H0.909082V10.4546H10.7273V11.3636H0.909082ZM2.72726 9.54546C2.47726 9.54546 2.26325 9.45644 2.08522 9.27842C1.90719 9.10039 1.81818 8.88638 1.81818 8.63638V1.90908C1.81818 1.65908 1.90719 1.44507 2.08522 1.26704C2.26325 1.08901 2.47726 1 2.72726 1H5.81817L6.90908 2.09091H11.0909C11.3409 2.09091 11.5549 2.17992 11.733 2.35795C11.911 2.53598 12 2.74999 12 2.99999V8.63638C12 8.88638 11.911 9.10039 11.733 9.27842C11.5549 9.45644 11.3409 9.54546 11.0909 9.54546H2.72726ZM2.72726 8.63638H11.0909V2.99999H6.53182L5.44091 1.90908H2.72726V8.63638Z"></path></svg>',title:r.CHANGE_IMAGE_STOCK}),I({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:Ne(Rz,`${Le}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&I({targetElement:c,insertType:"append",className:"em-element-img-gif",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><<path d="M5.68571 8.14286V3H6.79999V8.14286H5.68571ZM0.771429 8.14286C0.54 8.14286 0.353571 8.06786 0.212143 7.91786C0.0707142 7.76786 0 7.58571 0 7.37143V3.77143C0 3.55714 0.0707142 3.375 0.212143 3.225C0.353571 3.075 0.54 3 0.771429 3H3.40001C3.63144 3 3.81786 3.075 3.95929 3.225C4.10072 3.375 4.17144 3.55714 4.17144 3.77143V4.11429H1.11429V7.02857H3.05715V5.57143H4.17144V7.37143C4.17144 7.58571 4.10072 7.76786 3.95929 7.91786C3.81786 8.06786 3.63144 8.14286 3.40001 8.14286H0.771429ZM8.25714 8.14286V3H12V4.11429H9.37142V5.25714H11.1V6.37142H9.37142V8.14286H8.25714Z"></path></svg>',title:r.CHANGE_IMAGE_GIF}),l&&I({targetElement:c,insertType:"append",className:"em-element-img-ai",tag:"i",HTMLcontent:'<svg viewBox="0 0 12 12" focusable="false" data-icon="ai" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"></path><path d="M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"></path><path d="M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"></path><path d="M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"></path></svg>',title:r.CHANGE_IMAGE_AI}),n.commit(!1),eC.has(c))return;eC.add(c),Pz(t,c,".em-element-resize-img-container:hover > .em-element-img-change-group:hover"),c.addEventListener("click",function(u){const d=u.target.closest('i[class*="em-element-img"]'),f=e.getAttribute("src");let p="application_open-image-edit-popup";e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?p="application_open-image-ai-popup":G9(f)||d?.classList.contains("em-element-img-changeto")?p="application_open-image-upload-popup":d?.classList.contains("em-element-img-gif")?p="application_open-image-gif-popup":d?.classList.contains("em-element-img-stock")&&(p="application_open-image-stock-popup");const m={operation:p,src:f};setTimeout(()=>{n.messageService.send(m)},100)})}}function nC(e){const t=e.ownerDocument.activeElement;return t instanceof HTMLElement&&t!==e.ownerDocument.body&&t.closest('[contenteditable="true"]')!==null&&e.contains(t)}function jz(e){const t=(n,r)=>{nC(n)||e.wrapEditor(n,r)};return function(r){let o=r.target;try{o=e.getVisibleNode(o);const i=e.isInExternal(o);e.incrementActiveElementLocked();const s=document.body;if(s?.classList.contains("mceNonEditable")&&!s.classList.contains("em-sandbox-discuss")||s?.classList.contains("em-sandbox-discuss")&&!s.classList.contains("em-sandbox-discuss_set-target"))return;if(s?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(d=>{d.removeAttribute("em-hover"),d.removeAttribute("contenteditable")}),o.closest(".em-element-vindent")||(o.setAttribute("em-hover","true"),o.setAttribute("contenteditable","true"));return}if(o.tagName!=="BODY"){const d=o.parentElement;wE(o)&&!o.isConnected&&d&&(o=d)}if(o&&(o?.closest('[em="atom"]')||!i)&&o.getAttribute("contenteditable")!=="false"&&o.parentElement?.getAttribute("contenteditable")!=="false"&&o.tagName!=="BODY"&&o.parentElement?.tagName!=="SECTION"){const d=!o.closest("editor")&&!nC(o),f=!e.getLockEditorInit(),p=o.tagName!=="IMG",m=!(o.childElementCount===1&&o.firstElementChild?.tagName==="IMG"&&(o.textContent?.trim()??"")==="");if(d&&f&&p&&m){let h=o;do if(h=h.closest("div, p, h1, h2, h3, h4, h5")||h.closest("span, b, strong, i, em, s, a, sup, sub"),h)if(!e.isVisible(h))h=h.parentElement;else break;while(h);if(o.tagName==="LI"&&o.style.fontFamily&&o.style.fontSize){const y=o.closest("ul, ol");y&&t(y,!0)}else if(o.tagName==="TD"&&o.style.fontFamily&&o.style.fontSize&&!o.querySelector("editor"))t(o);else if(h&&h.style.fontFamily&&h.style.fontSize&&(o.tagName==="LI"||!o.querySelector("img")))if(o.tagName==="LI"){const y=o.closest("ul, ol");y&&t(y,!0)}else o.querySelector("img")||t(o,!0);else if(h&&h.closest('[style*="font-family"][style*="font-size"]')){const y=h.closest('[style*="font-family"][style*="font-size"]');y&&y.tagName!=="BODY"&&y.tagName!=="TD"&&y.tagName!=="TABLE"?t(y,!1):y?.tagName==="TD"&&!y.querySelector("editor")&&!y.closest(".em-element-custom-table")&&t(y)}else if(h&&h?.tagName==="DIV"&&!h.querySelector("table")){const y=!!h.style.height?.length,w=h.className.includes("em-element-img-change-group"),A=h.querySelector("img")?.parentNode,k=!!h.querySelector("img")&&A&&!e.hasTextNodeInElement(A);!y&&!w&&!k&&t(h,!0)}else for(let y=0;y<o.childNodes.length;y++){const w=o.childNodes[y];if(w.nodeName==="#text"&&(w.textContent?.trim().length??0)>0&&!o.querySelector("table")){const A=o.tagName==="P"?o.parentElement:o;A&&t(A);break}}}}(o?.closest('[em="atom"]')||!i)&&!e.getIsLeftButtonDown()&&e.implementElementsEditors(o),o?.classList.contains("em-element-vindent-bg")&&(o=o.closest(".em-vindent")),o?.closest(".em-gap")?o.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(even) .em-gap").forEach(d=>d.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(d=>d.classList.remove("em-hover"));const a=e.getLoadStylesTimer(),l=!!o.style.padding||!!o.style.paddingTop||!!o.style.paddingBottom||!!o.style.paddingLeft||!!o.style.paddingRight,c=o.closest('[em="block"]'),u=!!c?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(c?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;a&&(o.tagName==="TD"&&(o.innerHTML===""||o.querySelector(".em-element-vindent"))&&o.getAttribute("height")||o.tagName==="DIV"&&o.style.height&&o.style.fontSize||o.tagName==="IMG"||l||u)&&e.implementResizableElems(o)}catch{}finally{Promise.resolve().then(()=>e.decrementActiveElementLocked())}}}function Gz(e){return function(){e.removeElementEditors(),document.querySelectorAll('[em="group"] .em-element-editor, .em-element-path, .em-element-block-add').forEach(n=>{n.remove(),e.commit(!1)})}}function Lc(e){e.button===0&&O.set("isLeftButtonDown",!1)}function rC(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&O.set("isLeftButtonDown",!0)}function oC(){O.set("lockEditorInit",!1)}function Xz(){return document.addEventListener("mousedown",rC),document.addEventListener("mouseup",Lc),document.addEventListener("dragend",Lc),window.addEventListener("mousemove",oC),{dispose(){document.removeEventListener("mousedown",rC),document.removeEventListener("mouseup",Lc),document.removeEventListener("dragend",Lc),window.removeEventListener("mousemove",oC)}}}function Yz(e,t,n){if(e.caretPositionFromPoint){const r=e.caretPositionFromPoint(t,n);if(!r)return null;const o=e.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}return e.caretRangeFromPoint?.(t,n)??null}function Kz(e){return function(n){const r=n.target;if(n.button!==0||n.shiftKey||!(r instanceof HTMLElement)||e.isEditLocked()||document.body?.classList.contains("mceNonEditable")||r.closest("editor")||(e.unlockEditorInit(),e.handleMouseover(n),r.closest("em-replace")))return;const o=(r.isConnected?r:document.elementFromPoint(n.clientX,n.clientY))?.closest("editor");if(!o)return;const i=Yz(document,n.clientX,n.clientY);if(i&&o.contains(i.startContainer)){const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}}}var Zz=1e3;function Qz(e){setTimeout(()=>O.set("loadStylesTimer",!0),Zz);const t=jz({getVisibleNode:n=>e.htmlDocument.getVisibleNode(n),isInExternal:n=>e.htmlDocument.isInExternal(n),isVisible:n=>e.htmlDocument.isVisible(n),incrementActiveElementLocked:()=>O.increment("activeElementLocked"),decrementActiveElementLocked:()=>O.decrement("activeElementLocked"),getLockEditorInit:()=>!!O.get("lockEditorInit"),getIsLeftButtonDown:()=>!!O.get("isLeftButtonDown"),getLoadStylesTimer:()=>!!O.get("loadStylesTimer"),hasTextNodeInElement:t2,wrapEditor:e.wrapEditor,implementElementsEditors:n=>lz(n,{setBlockGroupControlsPosition:()=>ec({scrollTop:O.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>Uz(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=_t(n=>{t(n),e.onHover?.(n.target)}),document.onmouseleave=Gz({removeElementEditors:()=>ii(void 0),commit:e.commit}),document.addEventListener("mousedown",Kz({isEditLocked:Hi,unlockEditorInit:()=>O.set("lockEditorInit",!1),handleMouseover:t}),!0),Xz()}function Jz(e){return t=>D(e,wi)(t)}function eU(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var tU={name:"sandbox.elementSettings",provides:[He],awaits:{services:[J,uo,fo]},setup(e){const t=D(e,uo);e.inject(He,uF({htmlDocument:D(e,J),getMapObj:()=>t,fingerprint:D(e,fo),enrichExtras:()=>e.getServices(eh).reduce((n,r)=>({...n,...r()}),{})}))}},nU={name:"sandbox.documentChange",awaits:{services:[J,fo,He,lt,Oe,wi]},setup:e=>WD({htmlDocument:D(e,J),fingerprint:D(e,fo),initPreview:Jz(e),applicationElementSettingsSet:D(e,He),commit:ct(e),focusController:D(e,lt).controller})},rU={name:"sandbox.toggleTextStyle",provides:[pa],awaits:{services:[He,Oe]},setup(e){const t=D(e,He),n=ct(e),r=(o,i=Ze())=>{let s=eU(qi(i,o)||o);if(s?.tagName==="EDITOR"&&(s=s.firstElementChild),!s)return;const a=O.get("activeElementLocked")>0;try{a&&O.decrement("activeElementLocked"),t({elem:s})}finally{a&&O.increment("activeElementLocked")}};e.inject(pa,jW({commit:n,addNewRange:Lo,refreshElementSettings:r,findElementWithSelectedText:qi,getParentElementOfSelection:Ga,findOutermostParentWithText:Gu,clearLinkTags:o=>{Zr(o,n),Ar(n)},addFontFamilyClass:o=>_s(o,n),getIsProgrammaticSelection:()=>!!O.get("isProgrammaticSelection"),getCommonStyles:()=>O.get("commonStyles")??{}}))}},oU={name:"sandbox.insert",provides:[mo],awaits:{services:[J,He,Oe,su]},setup:e=>e.inject(mo,Gq({htmlDocument:D(e,J),commit:ct(e),messageService:K,applicationElementSettingsSet:D(e,He),...D(e,su)}))},iU={name:"sandbox.elementSettingsApply",provides:[ha],awaits:{services:[J,uo,Oe,At,He,pa,ln,lt]},setup(e){const t=D(e,Oe),n=D(e,uo),r=D(e,At),o=D(e,He);let i=null;const s=l=>{i??(i=MW({htmlDocument:D(e,J),getMapObj:()=>n,commit:ct(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,toggleTextStyle:D(e,pa),wrapEditor:D(e,ln).now,programmaticSelection:{get value(){return!!O.get("isProgrammaticSelection")},set value(c){O.set("isProgrammaticSelection",c)}}})),i(l)},a=D(e,lt).controller;e.inject(ha,l=>a.whenEditorLostFocus(()=>s(l)))}},sU={name:"sandbox.mouse",awaits:{services:[J,ln,Oe]},setup:e=>Qz({htmlDocument:D(e,J),commit:ct(e),wrapEditor:D(e,ln).deferred})},aU={name:"sandbox.click",awaits:{services:[J,Oe,At,lt,He,ln]},setup(e){const t=D(e,Oe),n=D(e,lt);Dq({htmlDocument:D(e,J),commit:ct(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:K,setCursorPosition:D(e,At),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:D(e,He),wrapEditor:D(e,ln).now,insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(Jp)?.(r)??!1})}},lU={name:"sandbox.keyboard",awaits:{services:[Oe,At,He,ln]},setup:e=>Oz({commit:ct(e),messageService:K,setCursorPosition:D(e,At),applicationElementSettingsSet:D(e,He),wrapEditor:D(e,ln).now})},cU={name:"sandbox.cssFilterOnCommit",awaits:{services:[J]},setup:e=>RI(D(e,J))},uU={name:"sandbox.vmlButtonLabelSync",awaits:{services:[Oe]},setup(e){const t=D(e,Oe);UW(n=>t.commit(n))}},dU={name:"sandbox.insertListeners",awaits:{services:[mo]},setup:e=>D(e,mo).register()};function iC(e,t,n,r=""){Zn(t.HTMLDocument.getOuterHtml(e)+r,([o,...i])=>!(o instanceof Element)||!n(o,i)?!1:(o.setAttribute("em-edit","active"),e.replaceWith(o),!0))&&t.commit(!0)}function fU(e,t){try{t.state.increment("activeElementLocked");const n=t.getActiveEditElement();if(!n)return;const r=n.closest("amp-accordion");if(!r)return;const o=r.querySelector("section");if(!o)return;iC(r,t,(s,[a])=>{if(!(a instanceof Element))return!1;const l=a.querySelector(":scope > header td div");if(l){const u=Array.from(l.childNodes).find(d=>d.nodeType===Node.TEXT_NODE);u&&(u.nodeValue=e.section)}const c=a.querySelector(":scope > div");return c&&(c.innerHTML=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom">
|
|
250
|
+
<tr>
|
|
251
|
+
<td style="padding: 10px 0;">
|
|
252
|
+
<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${e.text}</div>
|
|
253
|
+
</td>
|
|
254
|
+
</tr></table>`),s.append(a),!0},t.HTMLDocument.getOuterHtml(o))}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function mU(e,t){try{t.state.increment("activeElementLocked");const n=t.getActiveEditElement();if(!n)return;const r=n.closest("amp-accordion");if(!r)return;iC(r,t,o=>(o.querySelectorAll("section")[e.index]?.remove(),!0))}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function sC(e){return{state:e.state,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument}}function pU(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||fU(e.data.settings,sC(t))}function hU(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||mU(e.data.settings,sC(t))}var gU={sandbox_accordion_add_section:pU,sandbox_accordion_remove_section:hU};function bU(e,t){or(),ze(document.body,!1,"em-block-insert-body","em-atom-insert-body");const n=document.querySelector(".em-block-insert");n&&n.classList.remove("em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top");const r=document.querySelector(".em-block-insert-empty");r&&r.classList.remove("em-block-insert-empty");const o=document.querySelector(".em-atom-insert");o&&o.classList.remove("em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top");const i=document.querySelector(".em-atom-insert-empty");i&&i.classList.remove("em-atom-insert-empty"),document.querySelectorAll(".em-blockatom-insert").forEach(s=>{s.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),t.messageService.send({operation:"application_scroll-block-hide"})}function yU(e,t){const{htmlDocument:n}=t;t.messageService.send({operation:"application_email_content_get",htmlCode:n.getOuterHtml(document.body)||n.getRootsHtml()})}var vU={"sandbox_drag-cancel":bU,sandbox_email_content_get:yU};function EU(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=EB()??null;o||(o=(document.querySelector('[em-edit="active"]')||document.querySelector(".em-element-editor"))?.closest?.('[em="block"]')??document.querySelector('[em="block"]')),o&&(o.setAttribute("em-block-id",String(n)),r!=null&&r!==""&&o.setAttribute("em-block-version",String(r)),t.commit())}var SU={sandbox_eblock_set_em_block_id:EU};function aC(e){return e.replace(/\b(\d{1,3}(?:[ \xA0]\d{3})*(?:[.,]\d+)?)\b/g,t=>t.replace(/[ \xA0]/g,"").replace(/\B(?=(\d{3})+(?!\d))/g," ")).replace(/(\d[\d ]*[.,]?\d+)(?:\s| )?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1 ").replace(/(\d[\d ]*[.,]?\d+) (руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1 $2")}function lC(e,t){for(const n of e)n.type===$.HTML&&!ia(n,n.parent)&&(n.content=t(n.content??"")),lC(n.children,t)}function wU(e,t){const n=Tn(e);lC(n.roots,t);const r=document.createDocumentFragment(),o=Op(void 0);try{r.append(...n.roots.map(i=>xr(i,!0,!0)))}finally{o()}return Fr(r),r}var CU=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28"><rect width="28" height="28" rx="3" fill="#e5e7eb"/><circle cx="18.5" cy="9.5" r="2.5" fill="#9ca3af"/><path d="M5 21l6-7 4 4.5 3-3 5 5.5z" fill="#9ca3af"/></svg>')}`;function Nc(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&Nc({elem:e.elem.previousSibling})}function xc(e){if(!e.elem)return!1;if(e.elem.parentElement?.tagName==="SECTION"||e.elem.classList.contains("em-narrow-table")&&Array.from(e.elem.childNodes).every(n=>n.nodeType===Node.TEXT_NODE))return e.elem.innerHTML="",!1;e.elem.querySelector(".em-element-editor")&&e.elem.querySelector(".em-element-editor")?.remove(),e.elem.querySelector(".em-element-path")&&e.elem.querySelectorAll(".em-element-path").forEach(n=>n.remove()),e.elem.querySelector(".em-element-block-add")&&e.elem.querySelectorAll(".em-element-block-add").forEach(n=>n.remove()),e.elem.querySelector(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft")&&e.elem.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(n=>n.remove());const t=e.elem.parentElement;if(e.elem.classList.contains("em-mob-wrap")||e.elem.classList.contains("noresp-em-mob-wrap"))e.elem.innerHTML.trim()===""&&(e.elem.parentElement?.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1?e.elem.innerHTML="":(e.elem.remove(),xc({elem:t})));else if(e.elem.innerHTML.trim()==="")Nc({elem:e.elem}),e.elem.remove(),xc({elem:t});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?(Nc({elem:n}),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Nc({elem:n}),n.remove());e.elem.innerHTML.trim()===""&&xc({elem:e.elem})}return!0}function AU(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=e.getElementParent(t);let r=t.parentNode;const o=t.closest("editor");if(e.setCursorPosition(n),t.classList.contains("em-code")){const i=e.getVariableByIcon?.(t);i&&(i.parentNode?.removeChild(i),t.remove())}else if(t.tagName==="TD"&&t.innerHTML===""&&t.hasAttribute("height")){const i=t.closest("table");if(i){const s=i.previousSibling;s&&s?.textContent?.trim()===""&&s.remove(),i.remove()}}else if(t.closest(".em-element-resize-img-container"))r=t.closest(".em-element-resize-img-container").parentNode,t.closest("td")?.querySelector("editor")?.innerHTML===""&&t.closest("td")?.querySelector("editor")?.remove(),t.closest(".em-element-resize-img-container")?.remove();else if(t.closest('[em="atom"]')){const i=t.closest(".em-mob-wrap, .noresp-em-mob-wrap"),s=t.closest('[em="atom"]');t.tagName==="TD"&&t.previousElementSibling===null&&t.nextElementSibling===null?(r=s.parentNode,s?.remove()):(r=t.closest("td"),t.remove());const a=!!i&&Array.from(i.querySelectorAll('[em="atom"]')).some(l=>l!==s);t.tagName!=="TD"&&i&&!a&&i.textContent?.trim()===""&&(i.textContent="")}else{t.remove();const i=t.previousSibling;i&&i?.textContent?.trim()===""&&i.remove(),t.remove()}o&&($r(o),o.remove()),xc({elem:r}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function TU(e,t){const n=document.querySelector("[em-edit]");if(n)if(e.action==="add_p"){let r=null;if(["DIV","P","TD","EDITOR","B","STRONG","SPAN","I","EM","A"].includes(n.tagName)){if(n.closest("div")?.style.fontFamily?r=n.closest("div"):n.closest("p")?.style.fontFamily?r=n.closest("p"):r=n,r&&t.HTMLDocument){const o=t.HTMLDocument.getOuterHtml(r),i=r.closest("table"),s=`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td style="padding-bottom: 10px;">${o}</td></tr></table>`;Xn(i?.getAttribute("em")==="atom"?i:r,"afterend",s)}t.commit()}t.setCursorPosition(n)}else if(e.action==="add_img"){if(window.getSelection){const r=document.createElement("img");r.setAttribute("src",CU),r.setAttribute("width","28"),r.setAttribute("border","0"),r.setAttribute("alt",""),r.style.display="inline-block",r.style.verticalAlign="text-bottom";const o=window.getSelection();if(o?.getRangeAt&&o.rangeCount){const i=o.getRangeAt(0);i.deleteContents(),i.insertNode(r)}else document.querySelector("[em-edit]")?.prepend(r);t.commit()}}else(e.action==="typograf"||e.action==="typograf_all")&&xU(e,t).catch(r=>{})}var _U=/^(script|style|noscript|xmp|iframe|noembed|noframes)$/i,kU=/^[ \t\n\r\f]*$/;function cC(e,t,n){const{copy:r,counterpart:o}=Ba(e),i=wU(t(r.innerHTML),n),s=new Map;if(!dC(r,i,s))return;const a=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ALL),l=[];for(let c=a.nextNode();c;c=a.nextNode()){const u=o(c),d=u&&s.get(u);d&&l.push([c,d])}l.forEach(([c,u])=>u(c))}function uC(e){return[...(e instanceof HTMLTemplateElement?e.content:e).childNodes]}function dC(e,t,n){const r=uC(e),o=uC(t);let i=0;for(let s=0;s<r.length;){const a=r[s],l=o[i];if(a.nodeType===Node.TEXT_NODE){const c=LU(r,s);s+=c.length;const u=l?.nodeType===Node.TEXT_NODE;if(!u&&!c.every(d=>kU.test(d.data)))return!1;i+=u?1:0,fC(c,u?l.data:"",n);continue}if(!l||l.nodeType!==a.nodeType||l.nodeName!==a.nodeName)return!1;if(s+=1,i+=1,a.nodeType===Node.COMMENT_NODE)fC([a],l.data,n);else if(a.nodeType===Node.ELEMENT_NODE&&(NU(a,l,n),!_U.test(a.nodeName)&&!dC(a,l,n)))return!1}return i===o.length}function LU(e,t){const n=[];for(let r=t;r<e.length&&e[r].nodeType===Node.TEXT_NODE;r+=1)n.push(e[r]);return n}function fC(e,t,n){e.map(r=>r.data).join("")!==t&&e.forEach((r,o)=>n.set(r,i=>i.data=o===0?t:""))}function NU(e,t,n){const r=[...t.attributes].filter(i=>e.getAttribute(i.name)!==i.value),o=[...e.attributes].filter(i=>!t.hasAttribute(i.name));r.length===0&&o.length===0||n.set(e,i=>{o.forEach(s=>i.removeAttribute(s.name)),r.forEach(s=>i.setAttribute(s.name,s.value))})}async function xU(e,t){const{default:n}=await Ou(async()=>{const{default:l}=await Promise.resolve().then(()=>Hc("./typograf.all.Mun9CrLC.js"));return{default:l}},void 0,{}.url);let r=document.querySelector("[em-edit]")?.closest("div")||document.querySelector("[em-edit]")?.closest("editor")||null;const o=e.action==="typograf"?r?.innerText:document.body.innerText,i=t.hasRussianText?.(o||"")??!1,s=new n({locale:[e.locale==="ru_RU"||i?"ru":"en-US"],htmlEntity:{type:"name",onlyInvisible:!0,list:["nbsp","shy","mdash","ndash","laquo","raquo"]}});s.disableRule("ru/punctuation/*"),s.disableRule("common/punctuation/*"),s.enableRule("common/punctuation/quote"),s.setSetting("common/punctuation/quote","ru",{left:"«",right:"»",removeDuplicateQuotes:!0}),s.setSetting("common/punctuation/quote","en-US",{left:'"',right:'"',removeDuplicateQuotes:!0}),s.disableRule("ru/dash/kakto"),s.disableRule("ru/dash/taki"),s.disableRule("ru/dash/izpod"),s.disableRule("ru/dash/izza"),s.disableRule("ru/dash/ka"),s.disableRule("ru/dash/to"),s.disableRule("ru/dash/koe"),s.disableRule("common/nbsp/nowrap"),s.disableRule("common/nbsp/dpi"),s.disableRule("common/nbsp/afterParagraphMark"),s.enableRule("common/nbsp/afterNumber"),s.disableRule("common/html/quot"),s.disableRule("ru/date/*"),s.disableRule("common/number/mathSigns"),s.disableRule("ru/number/ordinals"),s.disableRule("ru/number/comma"),s.disableRule("ru/symbols/NN"),s.disableRule("common/symbols/cf"),s.disableRule("ru/other/phone-number"),s.addSafeTag('<[^>]+class="preheader"[^>]*>',"</[^>]+>"),s.addSafeTag("<!--","-->");const a=l=>s.execute(l);$r(document.body),e.action==="typograf_all"?cC(document.body,a,aC):r?.parentElement&&(r=r.parentElement,r?.parentElement&&cC(r.parentElement,a,aC)),document.querySelectorAll(".em-element-resize-img-container").forEach(l=>l.replaceWith(...l.childNodes)),document.querySelectorAll(".em-element-img-change-group").forEach(l=>l.remove()),document.querySelectorAll("editor").forEach(l=>l.replaceWith(...l.childNodes)),t.commit()}function mC(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function ap(e){if(!e||e.tagName!=="A")return!1;const t=e.getAttribute("style");if(!t||!t.includes("display"))return!1;const n=e.style.display;return!(n!=="block"&&n!=="inline-block"||t.includes("mso-style-priority"))}function OU(e,t){const n=e.closest("a");if(ap(n))return n;if(!t)return null;const r=mC(t.anchorNode)?.closest("a")??null;if(ap(r))return r;const o=mC(t.focusNode)?.closest("a")??null;return ap(o)?o:null}function pC(e){return e.tagName==="IMG"?e.closest('div[em="atom"]')||e.closest(".em-element-resize-img-container")||e:e.closest("editor")?e.closest('[style*="font-family"][style*="font-size"]')||e:e.tagName==="TD"&&e.classList.contains("em-vindent")?e.closest(".em-vindent-table")||e:e.tagName==="TD"&&m1(e)?e.closest('[em="block"]')??e:e}function hC(e){return e?e.classList.contains("em-vindent-table")?e.querySelector("td"):e.classList.contains("em-element-resize-img-container")?e.querySelector("img"):e.getAttribute("em")==="block"&&e.tagName!=="DIV"?Qo(e)??e:e:null}function RU(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if(OU(t,n)&&n&&!n.isCollapsed)try{n.collapseToEnd()}catch{}const r=e.getElementParent(t);r instanceof Element&&(e.setCursorPosition(r),e.applicationElementSettingsSet({elem:r}))}function MU(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=hC(pC(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function PU(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=hC(pC(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function IU(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),It(()=>document.querySelectorAll("editor").forEach(r=>{r.blur()}))}function DU(e,t){const n=t.elementPath[e.data.index??0];if(n?.elem){const r=n.elem;t.applicationElementSettingsSet({elem:r}),t.setCursorPosition(r)}}function BU(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function HU(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};RU(n)}function FU(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};MU(n)}function $U(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};PU(n)}function WU(e,t){if(!t.getElementParent||!t.state)return;const n={state:t.state,commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,getVariableByIcon:t.getVariableByIcon};AU(n)}function qU(e,t){if(!t.getElementParent||!t.state)return;const n={action:e.data.action,locale:e.data.locale},r={state:t.state,commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,HTMLDocument:t.HTMLDocument,hasRussianText:t.hasRussianText};TU(n,r)}var zU={sandbox_element_active_reset:IU,sandbox_element_active_set:DU,sandbox_element_hover_set:BU,sandbox_element_parent_get:HU,sandbox_element_prev_get:FU,sandbox_element_next_get:$U,sandbox_element_remove:WU,sandbox_element_text:qU},yn=".em-mob-wrap, .noresp-em-mob-wrap",Et=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",rt='div[style*="inline-block"]';function io(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.textContent=e.elem.textContent.replaceAll(/width=".*?"/gi,'width="'+e.width+'"'):e.elem.previousSibling&&io({elem:e.elem.previousSibling,width:e.width})}function gC(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&&gC({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function Oc(e){return!!e.querySelector(yn)||!!e.closest(yn)}function Ys(e){return e.querySelector(yn)?document.querySelector('[em-edit="active"]'):e.closest(yn).parentElement}function Rc(e){return e.querySelector(rt)?document.querySelector('[em-edit="active"]'):e.closest(rt).parentElement}function UU(e,t){const n=document.querySelector("[em-edit]");if(n)try{if(t.state.increment("activeElementLocked"),Oc(n)){const r=Ys(n),o=e.minWidth,i=r.querySelectorAll(Et).length,s=i>1?parseFloat(String(e.gap)):20,a=i>1?parseFloat(String(e.gapMobile||e.gap)):20;let l="";r.querySelector(".em-mob-wrap")?l=`<td width="${s}" class="em-mob-wrap em-mob-height-${a}px"></td>
|
|
255
|
+
<td width="${o}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(l=`<td width="${s}" class="noresp-em-mob-wrap noresp-em-mob-height-${a}px"></td>
|
|
256
|
+
<td width="${o}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let c=0,u=0,d=0;r.querySelectorAll(Et).forEach(p=>{parseFloat(p.getAttribute("width")||"0")>o&&d++,c+=parseFloat(p.getAttribute("width")||"0")});const f=(o+s)/d;if(r.querySelectorAll(Et).forEach(p=>{if(parseFloat(p.getAttribute("width")||"0")>o){const m=Math.round(parseFloat(p.getAttribute("width")||"0")-f);p.setAttribute("width",String(m))}}),Xn(r.querySelectorAll(Et)[i-1],"afterend",l),r.querySelectorAll(Et).forEach(p=>{u+=parseFloat(p.getAttribute("width")||"0")}),c-u-s!==0){const p=r.querySelector(yn),m=parseFloat(p.getAttribute("width")||"0")+(c-u-s);p.setAttribute("width",String(m))}t.setPercentsForColumns(r.querySelectorAll(Et)),t.commit()}else{const r=Rc(n),o=e.minWidth,i=r.querySelectorAll(rt).length,s=i>1?parseFloat(String(e.gap)):20,a='<!--[if (gte mso 9)|(IE)]></td><td width="'+(o+s)+`" valign="top"><![endif]-->
|
|
257
|
+
<div style="display: inline-block; width: `+(o+s)+`px; vertical-align: top;" class="em-mob-width-100perc">
|
|
258
|
+
<table width="`+o+`" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
259
|
+
<tr>
|
|
260
|
+
<td align="left"></td>
|
|
261
|
+
</tr>
|
|
262
|
+
</table>
|
|
263
|
+
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
264
|
+
</div>`;let l=0,c=0,u=0;if(i===1){const f=n.querySelector(rt)?r.querySelector(rt):n.closest(rt);f.style.removeProperty("max-width"),f.firstElementChild?.style.removeProperty("max-width"),f.firstElementChild?.style.removeProperty("width")}r.querySelectorAll(rt).forEach(f=>{const p=parseFloat(f.firstElementChild?.getAttribute("width")||"0");p>o&&u++,l+=p});const d=(o+s)/u;if(r.querySelectorAll(rt).forEach(f=>{const p=f;if(parseFloat(p.firstElementChild?.getAttribute("width")||"0")>o){const m=Math.round(parseFloat(p.style.width)-d),h=m-s;p.style.width=m+"px",io({elem:p,width:m}),p.firstElementChild?.tagName==="TABLE"&&p.firstElementChild.setAttribute("width",String(h))}}),Xn(r.querySelectorAll(rt)[i-1],"afterend",a),r.querySelectorAll(rt).forEach(f=>{c+=parseFloat(f.firstElementChild?.getAttribute("width")||"0")}),l-c-s!==0){const f=r.querySelector(rt),p=parseFloat(f.style.width)+(l-c-s);f.style.width=p+"px",io({elem:f,width:p}),f.firstElementChild?.tagName==="TABLE"&&f.firstElementChild.setAttribute("width",String(p-s))}t.commit()}}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function VU(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;try{if(t.state.increment("activeElementLocked"),Oc(n)){const o=Ys(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(Et).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.getAttribute("width")||"0"),c===n.closest(yn)&&(n.closest(".em-structure > td")?.setAttribute("em-edit","active"),r=n.closest(".em-structure > td")),c.nextElementSibling&&c.previousElementSibling?c.previousElementSibling.remove():c.nextElementSibling&&!c.previousElementSibling?c.nextElementSibling.remove():!c.nextElementSibling&&c.previousElementSibling&&c.previousElementSibling.remove(),c.remove())});const a=o.querySelectorAll(Et).length,l=Math.floor((i+s)/a);if(o.querySelectorAll(Et).forEach(c=>{const u=Math.round(parseFloat(c.getAttribute("width")||"0")+l);c.setAttribute("width",String(u))}),a===1){const c=o.querySelector(yn),u=c.closest("table").parentElement;c.setAttribute("width",String(u.getBoundingClientRect().width-parseFloat(u.style.paddingLeft||"0")-parseFloat(u.style.paddingRight||"0")))}t.setPercentsForColumns(o.querySelectorAll(Et))}else{const o=Rc(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(rt).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.style.width),c===n.closest(rt)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),gC({elem:c,removedBlockIndex:e.removedBlockIndex}),c.remove())});const a=o.querySelectorAll(rt).length,l=Math.round(i/a);if(o.querySelectorAll(rt).forEach(c=>{const u=c,d=Math.round(parseFloat(u.style.width)+l),f=d-s;u.style.width=d+"px",io({elem:u,width:d}),u.firstElementChild?.tagName==="TABLE"&&u.firstElementChild.setAttribute("width",String(f))}),a===1){const c=o.querySelector(rt);c.style.width="100%",c.style.maxWidth=o.closest("table")?.style.maxWidth||"",io({elem:c,width:o.closest("table")?.style.maxWidth||""}),c.firstElementChild.style.width="91%",c.firstElementChild.style.maxWidth=parseFloat(c.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{t.commit(),Promise.resolve().then(()=>{t.state.decrement("activeElementLocked"),r&&t.applicationElementSettingsSet&&t.applicationElementSettingsSet({elem:r})})}}function bC(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function jU(e){e instanceof Element&&(e.querySelectorAll("editor").forEach(t=>{t.replaceWith(...Array.from(t.childNodes))}),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")),e.removeAttribute("em-edit"),e.querySelectorAll("[em-temp]").forEach(t=>t.remove()))}function yC(e,t=""){Zn(t+Ii(e),n=>{n.forEach(jU),e.after(...n)})}function GU(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{copiedBlockIndex:r,widths:o}=e,i=parseFloat(String(e.gap))||0;try{if(t.state.increment("activeElementLocked"),Oc(n)){const s=Ys(n),a=s.querySelectorAll(Et)[r];if(!a)return;const l=a.nextElementSibling||a.previousElementSibling;yC(a,l?Ii(l):s.querySelector(".noresp-em-mob-wrap")?`<td width="${i}" class="noresp-em-mob-wrap noresp-em-mob-height-${i}px"></td>`:`<td width="${i}" class="em-mob-wrap em-mob-height-${i}px"></td>`);const c=s.querySelectorAll(Et);c.forEach((u,d)=>{o[d]!=null&&u.setAttribute("width",String(o[d]))}),t.setPercentsForColumns(c),t.commit()}else{const s=Rc(n),a=s.querySelectorAll(rt)[r];if(!a)return;yC(a,'<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
|
|
265
|
+
`),s.querySelectorAll(rt).forEach((l,c)=>{const u=l,d=o[c];if(d==null)return;const f=d+i;u.style.width=f+"px",io({elem:u,width:f}),u.firstElementChild?.tagName==="TABLE"&&u.firstElementChild.setAttribute("width",String(d))}),t.commit()}}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function XU(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{indexA:r,indexB:o}=e;if(r!==o)try{if(t.state.increment("activeElementLocked"),Oc(n)){const i=Ys(n),s=i.querySelectorAll(Et),a=s[r],l=s[o];if(!a||!l)return;bC(a,l),t.setPercentsForColumns(i.querySelectorAll(Et)),t.commit()}else{const i=Rc(n).querySelectorAll(rt),s=i[r],a=i[o];if(!s||!a)return;bC(s,a),[s,a].forEach(l=>{io({elem:l,width:parseFloat(l.style.width)})}),t.commit()}}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function YU(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=Ys(n);if(e.wrap)r.querySelectorAll(yn).forEach((o,i)=>{o.classList.remove("em-mob-wrap-cancel"),i%2===0&&(o.classList.forEach(s=>s.startsWith("em-mob-width-")&&o.classList.remove(s)),o.classList.add("em-mob-width-100perc"))});else{const o=r.querySelectorAll(Et).length,i=Math.round(100/o)-2;r.querySelectorAll(yn).forEach((a,l)=>{a.classList.add("em-mob-wrap-cancel"),a.classList.remove("em-mob-width-100perc"),l%2===0&&a.classList.add("em-mob-width-"+i+"perc")});const s=t.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
|
|
266
|
+
@media only screen and (max-device-width:${s}px),only screen and (max-width:${s}px) {
|
|
267
|
+
.em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
|
|
268
|
+
.em-mob-width-${i}perc { width: ${i}% !important; }
|
|
269
|
+
}
|
|
270
|
+
`)}t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function KU(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=n.querySelector(yn)?document.querySelector('[em-edit="active"]'):n.closest(yn)?.parentElement?.closest("td");if(!r)return;e.dirRevert?(r.setAttribute("dir","rtl"),r.querySelectorAll("td").forEach(o=>{for(let i=o.firstChild;i;i=i.nextSibling)if(i.nodeType===3){i.parentNode?.setAttribute("dir","ltr");break}})):(r.removeAttribute("dir"),r.querySelectorAll("[dir]").forEach(o=>o.removeAttribute("dir"))),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function ui(e){return{state:e.state,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function ZU(e,t){!t.state||!t.setPercentsForColumns||UU(e.data.settings,ui(t))}function QU(e,t){!t.state||!t.setPercentsForColumns||VU(e.data.settings,ui(t))}function JU(e,t){!t.state||!t.setPercentsForColumns||GU(e.data.settings,ui(t))}function eV(e,t){!t.state||!t.setPercentsForColumns||XU(e.data.settings,ui(t))}function tV(e,t){!t.state||!t.setPercentsForColumns||YU(e.data.settings,ui(t))}function nV(e,t){!t.state||!t.setPercentsForColumns||KU(e.data.settings,ui(t))}var rV={sandbox_floatBlock_add:ZU,sandbox_floatBlock_remove:QU,sandbox_floatBlock_copy:JU,sandbox_floatBlock_swap:eV,sandbox_floatblock_wrap:tV,sandbox_floatblock_dir:nV},oV='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',iV=['[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width]):empty','[em="block"].empty-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td[em-edit="active"]:not([height]):not([width]):empty','.em-structure td[em-edit="active"]:not([height]):not([width])','.em-structure td.em-mob-wrap[em-edit="active"]','.em-structure td.noresp-em-mob-wrap[em-edit="active"]'];function vC(){or(),ze(document.body,!1,"em-block-insert-body","em-atom-insert-body","em-atom-insert-body-inside"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>e.classList.remove("em-block-insert-empty")),document.querySelectorAll(".em-atom-insert-empty").forEach(e=>e.classList.remove("em-atom-insert-empty"))}function sV(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function aV(){for(const e of iV){const t=document.querySelector(e);if(t)return t}return null}function lV(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function cV(e){const t=e.querySelectorAll('[em="atom"]');if(t.length)return t[t.length-1];const n=e.querySelector("td.em-mob-wrap")??e.querySelector("td.noresp-em-mob-wrap")??e.querySelector('td[em-edit="active"]:not([height]):not([width])');return n||(e instanceof HTMLElement?vc(e):null)}function uV(e,t,n){const r=e.getAttribute("em")==="atom",o=r?"afterend":"beforeend",i=r?e.parentElement:e;return t.match(/class="em-countdown"/gi)?n.insertCountdown({targetElem:e,targetPlace:o,atomHTML:t}):n.insertAdjacentHTML(e,o,t),dV(i,e,r)}function dV(e,t,n){if(n){const r=t.nextElementSibling;if(r?.getAttribute("em")==="atom")return r}if(e){const r=e.querySelectorAll('[em="atom"]');if(r.length)return r[r.length-1]}return null}function EC(e,t,n){return t.match(/em="atom"><tr><td>\s*<img/gi)&&(t=n.setImageWidth({atomHTML:t,targetAtom:e})),t=n.commonStylesApply({html:t}),uV(e,t,n)}function fV(e,t){if(!e||document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')||document.documentElement.scrollHeight+(t.iframeOffsetTop||0)<=(t.previewHeight||0))return;const n=e.getBoundingClientRect();t.messageService.send({operation:"application_scroll-to",settings:{value:n.top+n.height}})}function mV(e,t){const n=HS();if(!n)return null;e.match(/em="atom"><tr><td>\s*<img/gi)&&(e=t.setImageWidth({atomHTML:e,targetAtom:n})),e=t.commonStylesApply({html:e});let r=Nw(e);if(e!==oV){const i=r.match(/<style((.|\n|\r)*?)<\/style>/g);t.setDocumentStyles(i)}r=t.commonStylesApplyToBlock({html:r}),(r.indexOf("empty-structure")>-1||r.indexOf("em-structure")>-1)&&(r=t.setFloatBlocksWidth({blockHTML:r,targetBlock:n}),r=t.fitImagesToColumns(r));const o=!!e.match(/class="em-countdown"/gi);return r.substring(0,3)!=="<tr"||!bn(n)?null:(o?t.insertCountdown({targetElem:rr(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(rr(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function SC(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function pV(e,t){e&&t.messageService.send(ke.APPLICATION_ATOM_INSERTED,e),vC()}function hV(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),vC()}function gV(e,t){const n=SC(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function bV(e,t){let n=gV(e,t);if(!n)return!1;let r=null;const o=aV();if(o)r=EC(lV(o),n,t);else{const i=sV();if(i){const s=cV(i);s&&(r=EC(s,n,t))}else r=mV(n,t)}return r?(fV(r,t),!0):!1}function wC(e,t){const n=document.createElement("table");n.setAttribute("cellspacing","0"),n.setAttribute("cellpadding","0"),n.setAttribute("align","center"),n.setAttribute("border","0"),n.setAttribute("em","block"),n.setAttribute("width",e.getAttribute("width")??String(e.getBoundingClientRect().width)),n.classList.add("em-mob-width-100perc"),Zn(`
|
|
271
|
+
`+t+`
|
|
272
|
+
`,r=>{n.replaceChildren(...r),n.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",n)})}function yV(e,t,n){if(e.tagName==="TR"){t.substring(0,3)==="<tr"?n.insertAdjacentHTML(e,"afterend",t):n.insertAdjacentHTML(e,"afterend",'<tr em="block"><td align="center">'+t+"</td></tr>");return}t.substring(0,3)==="<tr"?wC(e,t):n.insertAdjacentHTML(e,"afterend",t)}function CC(e,t,n){if(!e.blockHTML?.trim())return!1;const r=t.parseFromString(e.blockHTML);let o=r.filter(p=>p.tagName&&p.tagName!=="LINK"&&p.tagName!=="STYLE").map(p=>t.getOuterHtml(p)).join(""),i=r.filter(p=>p.tagName==="STYLE").map(p=>t.getOuterHtml(p)).join("");const s=t.assetsRoot?.()??document.head,a=r.filter(p=>p.tagName==="LINK"&&p.getAttribute("em-class")).filter(p=>!s?.querySelector(`link[em-class="${p.getAttribute("em-class")}"]`));if(i){let p=s?.querySelector('style[em="styles"]'),m="";p?m=t.HTMLDocument.getInnerHtml(p):(p=document.createElement("style"),p.setAttribute("em","styles"),p=s?.insertAdjacentElement("beforeend",p));const h=document.createElement("div");t.emailWidth&&(i=i.replace(/(max-device-width:|max-width:)\d+px/g,w=>w.replace(/\d+/,String(t.emailWidth)))),h.insertAdjacentHTML("afterbegin",i);let y=t.minify(m+`
|
|
273
|
+
`+[...h.querySelectorAll("style")].map(w=>w.innerHTML).join(`
|
|
274
|
+
`),{restructure:!0,forceMediaMerge:!0}).css;y=t.cssbeautify(y,{indent:" ",autosemicolon:!0}),p.textContent=`
|
|
275
|
+
`+y+`
|
|
276
|
+
`}for(const p of a.reverse())s?.prepend(p),s?.insertAdjacentHTML("afterbegin",`
|
|
277
|
+
`);if(e.type!=="project"&&(o=t.commonStylesApplyToBlock({html:o})),o.match(/class="em-countdown"/gi)&&(o=t.uptimeCountdown({blockHTML:o})),n)return(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:n}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:n,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),yV(n,o,t),!0;let l=null,c=null,u=!1;const d=HS(),f=d?null:document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')?.closest('[em="block"]')??FS();return d?(l=d,c=l,(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),o.substring(0,3)==="<tr"?t.insertAdjacentHTML(rr(d),"beforeend",o):t.insertAdjacentHTML(rr(d),"beforeend",'<tr><td align="center">'+o+"</td></tr>"),u=!0):f&&(l=f,(o.indexOf("empty-structure")>-1||o.indexOf("em-structure")>-1)&&(o=t.setBlockMaxWidth({blockHTML:o,targetBlock:l}),o=t.setFloatBlocksWidth({blockHTML:o,targetBlock:l,project:e.project})),o=t.checkBlockAdaptivity({blockHTML:o,blockIsTr:o.substring(0,3)==="<tr"}),l?.tagName==="TR"?(o.substring(0,3)==="<tr"?t.insertAdjacentHTML(l,"afterend",o):t.insertAdjacentHTML(l,"afterend",'<tr em="block"><td align="center">'+o+"</td></tr>"),u=!0):l&&(o.substring(0,3)==="<tr"?wC(l,o):t.insertAdjacentHTML(l,"afterend",o),u=!0),c=l?.nextSibling),u&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(t.iframeOffsetTop||0)>(t.previewHeight||0)&&c&&t.messageService.send({operation:"application_scroll-to",settings:{value:c.getBoundingClientRect().top+c.getBoundingClientRect().height}}),u}function vV(e,t){if(!t.lockEditor&&SC(e.atomHTML).trim())try{t.state.increment("activeElementLocked"),t.setAtomReplaced?.(null),yw({kind:"atom",settings:e}),e.action!=="insert"&&ze(document.body,!0,"em-atom-insert-body"),e.action==="insert"&&bV(e,t)&&pV(e.name,t),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function EV(e){return e.replace(/["\\]/g,"\\$&")}function SV(e,t){if(t.lockEditor)return 0;const n=e.emBlockId;if(!n||!e.blockHTML?.trim())return 0;const r=`[em="block"][em-block-id="${EV(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;try{t.state.increment("activeElementLocked");for(const s of o)CC({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,s)&&(s.remove(),i+=1);t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}return i}function wV(e,t){if(!t.lockEditor&&e.blockHTML?.trim())try{t.state.increment("activeElementLocked"),yw({kind:"block",settings:e}),ze(document.body,!0,"em-block-insert-body"),e.action==="insert"&&CC(e,t)&&hV(e,t),t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function CV(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};vV({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function AV(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};wV({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function TV(e,t){t.setElementSettings?.(e)}var _V={"sandbox_atom-insert":CV,"sandbox_block-insert":AV,sandbox_element_settings_set:TV},kV=un("elements",zU,{services:[He,At,Oe,lr]},e=>{const t=D(e,He),n=D(e,At),r=ct(e),o=D(e,lr);return()=>({HTMLDocument:{getOuterHtml:Xt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>ic(i),getVariableByIcon:Vl,hasRussianText:SN,messageService:K,removeAllAttributes:ur,setCursorPosition:i=>n(i),state:qu})}),LV=un("display",vU,{services:[J]},e=>{const t=D(e,J);return()=>({messageService:K,htmlDocument:t})}),NV=un("floatBlock",rV,{services:[He,Oe]},e=>{const t=D(e,He),n=ct(e);let r=600;return O.subscribe(o=>{o.emailWidth!==void 0&&(r=o.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:r,state:qu,setPercentsForColumns:o=>Xu(o)})}),xV=un("accordion",gU,{services:[Oe]},e=>{const t=ct(e);return()=>({HTMLDocument:{getOuterHtml:Xt},commit:t,state:qu,getActiveEditElement:Yu,parseFromString:n=>Ie(n)})}),OV=un("eblock",SU,{services:[Oe]},e=>{const t=ct(e);return()=>({commit:t})}),RV=un("palette",_V,{services:[mo,ha]},e=>{const t=D(e,mo),n=D(e,ha);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),MV=un("nativeImageDrop",{[ke.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>_w()},void 0,()=>()=>({})),PV=[kV,LV,NV,xV,OV,RV,MV],IV={name:"sandbox.prepareHtml",provides:[fa],setup:e=>e.inject(fa,t=>Ll({node:t,isPartial:!0}))},DV={name:"sandbox.blockControlsViewport",setup:e=>e.addService(th,()=>ec({scrollTop:O.get("scrollTop")}))},BV=[IV,DV,tU,nU,rU,oU,iU,...PV,sU,aU,lU,cU,uU,dU],HV="__emmDiagnostics__",FV="diagnostics";function $V(){try{const e=new URLSearchParams(window.location.search).get(FV);return e!==null&&e!=="0"}catch{return!1}}function lp(e){try{window.parent.postMessage({mark:HV,...e},"*")}catch{}}function WV(){const e=window.performance.getEntriesByType("resource").map(t=>{const n=t;return{name:n.name,initiatorType:n.initiatorType,startTime:n.startTime,responseEnd:n.responseEnd,transferSize:n.transferSize,decodedBodySize:n.decodedBodySize}});lp({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function di(){return window.performance.timeOrigin+window.performance.now()}function qV(){return Array.from(document.images).every(e=>e.complete)}function zV(e,t){const r=window.setInterval(()=>{!qV()||di()-e()<500||(window.clearInterval(r),lp({type:"settled",at:Math.max(e(),t)}),WV())},100)}function UV(){if(!$V()||typeof MutationObserver!="function")return;let e=!1,t=di();new MutationObserver(()=>{t=di(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=di();lp({type:"paint",at:n}),zV(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=di()}),document.addEventListener("load",()=>{t=di()},!0)}var VV=500,jV=300,Ks,Mc=!1;function AC(){if(Mc)return;Mc=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,Ks=!1,Mc=!1)},jV);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),Ks=!0,Mc=!1)})}function GV(){return Ks===!1?(AC(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{Ks=!1,n()},VV);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),Ks=!0,n()})})})}var XV=1;function YV(){AC();const e=async(t,n)=>{await n?.(t),await GV()};K.addListenerAsync(ke.SANDBOX_INITED,e,XV)}var KV=16,TC=100,ZV=.95,_C=.02;function kC(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*KV:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function LC(e,t,n){if(n===0)return!1;const r=getComputedStyle(e),o=t==="y"?r.overflowY:r.overflowX;if(o!=="auto"&&o!=="scroll"&&o!=="overlay")return!1;const i=t==="y"?e.scrollTop:Math.abs(e.scrollLeft),s=t==="y"?e.scrollHeight-e.clientHeight:e.scrollWidth-e.clientWidth;return s<=0?!1:(t==="x"&&e.scrollLeft<0?-n:n)>0?i<s-.5:i>.5}function NC(e,t,n){const r=document.scrollingElement??document.documentElement;for(let o=e instanceof Element?e:null;o;o=o.parentElement){if(o===r||o===document.body)return!1;if(LC(o,"y",n)||LC(o,"x",t))return!0}return!1}function QV(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,f=t;e=0,t=0,!(d===0&&f===0)&&K.send(ke.SANDBOX_WHEEL,{deltaX:d,deltaY:f})},o=(d,f)=>{e+=d,t+=f,n||(n=!0,window.requestAnimationFrame(r))};window.addEventListener("wheel",d=>{d.ctrlKey||NC(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(kC(d.deltaX,d.deltaMode),kC(d.deltaY,d.deltaMode)))},{passive:!1});let i,s=!1,a={x:0,y:0},l;const c=()=>{l!==void 0&&(window.cancelAnimationFrame(l),l=void 0)},u=()=>{let{x:d,y:f}=a,p=performance.now();const m=h=>{const y=h>p?Math.min(h-p,50):16;p=h;const w=Math.pow(ZV,y/16);if(d*=w,f*=w,Math.abs(d)<_C&&Math.abs(f)<_C){l=void 0;return}o(d*y,f*y),l=window.requestAnimationFrame(m)};l=window.requestAnimationFrame(m)};window.addEventListener("touchstart",d=>{c(),s=!1,a={x:0,y:0};const f=d.touches.length===1?d.touches[0]:void 0;i=f?{x:f.screenX,y:f.screenY,at:d.timeStamp}:void 0},{passive:!0}),window.addEventListener("touchmove",d=>{const f=d.touches.length===1?d.touches[0]:void 0;if(document.documentElement.classList.contains("em-resize-start")){i=void 0,s=!1;return}if(!f||!i){i=void 0,s=!1;return}const p=i.x-f.screenX,m=i.y-f.screenY,h=d.timeStamp-i.at;if(i={x:f.screenX,y:f.screenY,at:d.timeStamp},!NC(d.target,p,m)){if(d.cancelable&&d.preventDefault(),s=!0,h>0){const y=Math.min(h/TC,1);a={x:a.x*(1-y)+p/h*y,y:a.y*(1-y)+m/h*y}}o(p,m)}},{passive:!1}),window.addEventListener("touchend",d=>{const f=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&f<TC&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var JV={name:"sandbox.diagnosticsAgent",setup:()=>UV()},ej={name:"sandbox.paintGate",setup:()=>YV()},tj={name:"sandbox.wheelBridge",setup:()=>QV()},nj={name:"sandbox.deviceWidthMediaGuard",setup:()=>$4()};function rj(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function oj(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:rj,widthCalculationMethod:oj};var ij=ar(((e,t)=>{(function(n){if(typeof window<"u"){var r=!0,o=10,i="",s=0,a="",l=null,c="",u=!1,d={resize:1,click:1},f=128,p=!0,m=1,h="bodyOffset",y=h,w=!0,A="",k={},b=32,v=null,S=!1,T=!1,g="[iFrameSizer]",E=g.length,C="",_={max:1,min:1,bodyScroll:1,documentElementScroll:1},x="child",N=!0,W=window.parent,R="*",M=0,te=!1,j=null,ne=16,re=1,Q="scroll",be=Q,de=window,Ee=function(){rn("onMessage function not defined")},me=function(){},X=function(){},B={height:function(){return rn("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return rn("Custom width calculation function not defined"),document.body.scrollWidth}},Y={},Ot=!1;try{var U=Object.create({},{passive:{get:function(){Ot=!0}}});window.addEventListener("test",Pc,U),window.removeEventListener("test",Pc,U)}catch{}var tn,mt,nn,qt,vn,zt,ot={bodyOffset:function(){return document.body.offsetHeight+Sn("marginTop")+Sn("marginBottom")},offset:function(){return ot.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return B.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,ht(ot))},min:function(){return Math.min.apply(null,ht(ot))},grow:function(){return ot.max()},lowestElement:function(){return Math.max(ot.bodyOffset()||ot.documentElementOffset(),Se("bottom",at()))},taggedElement:function(){return jn("bottom","data-iframe-height")}},St={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return B.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(St.bodyScroll(),St.documentElementScroll())},max:function(){return Math.max.apply(null,ht(St))},min:function(){return Math.min.apply(null,ht(St))},rightMostElement:function(){return Se("right",at())},taggedElement:function(){return jn("right","data-iframe-width")}},pt=(tn=wn,vn=null,zt=0,function(){var P=Date.now(),F=ne-(P-(zt=zt||P));return mt=this,nn=arguments,F<=0||ne<F?(vn&&(clearTimeout(vn),vn=null),zt=P,qt=tn.apply(mt,nn),vn||(mt=nn=null)):vn=vn||setTimeout(Rt,F),qt});Vn(window,"message",function(P){var F={init:function(){A=P.data,W=P.source,Ic(),p=!1,setTimeout(function(){w=!1},f)},reset:function(){w?ce("Page reset ignored by init"):(ce("Page size reset by host page"),kr("resetPage"))},resize:function(){ir("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(Ce())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var xe=Ce();ce("PageInfoFromParent called from parent: "+xe),X(JSON.parse(xe)),ce(" --")},message:function(){var xe=Ce();ce("onMessage called from parent: "+xe),Ee(JSON.parse(xe)),ce(" --")}};function he(){return P.data.split("]")[1].split(":")[0]}function Ce(){return P.data.substr(P.data.indexOf(":")+1)}function G(){return P.data.split(":")[2]in{true:1,false:1}}function ee(){var xe=he();xe in F?F[xe]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||G()||rn("Unexpected message ("+P.data+")")}g===(""+P.data).substr(0,E)&&(p===!1?ee():G()?F.init():ce('Ignored message of type "'+he()+'". Received before initialization.'))}),Vn(window,"readystatechange",OC),OC()}function Pc(){}function Vn(P,F,he,Ce){P.addEventListener(F,he,!!Ot&&(Ce||{}))}function Zs(P){return P.charAt(0).toUpperCase()+P.slice(1)}function so(P){return g+"["+C+"] "+P}function ce(P){S&&window.console}function rn(P){window.console}function Ic(){function P(G){return G==="true"}var F;function he(G){on(0,0,G.type,G.screenY+":"+G.screenX)}function Ce(G,ee){ce("Add event listener: "+ee),Vn(window.document,G,he)}F=A.substr(E).split(":"),C=F[0],s=n!==F[1]?Number(F[1]):s,u=n!==F[2]?P(F[2]):u,S=n!==F[3]?P(F[3]):S,b=n!==F[4]?Number(F[4]):b,r=n!==F[6]?P(F[6]):r,a=F[7],y=n!==F[8]?F[8]:y,i=F[9],c=F[10],M=n!==F[11]?Number(F[11]):M,k.enable=n!==F[12]&&P(F[12]),x=n!==F[13]?F[13]:x,be=n!==F[14]?F[14]:be,T=n!==F[15]?!!F[15]:T,ce("Initialising iFrame ("+window.location.href+")"),(function(){function G(ee,xe){return typeof ee=="function"&&(ce("Setup custom "+xe+"CalcMethod"),B[xe]=ee,ee="custom"),ee}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var ee=window.iFrameResizer;ce("Reading data from page: "+JSON.stringify(ee)),Object.keys(ee).forEach(Qs,ee),Ee="onMessage"in ee?ee.onMessage:Ee,me="onReady"in ee?ee.onReady:me,R="targetOrigin"in ee?ee.targetOrigin:R,y="heightCalculationMethod"in ee?ee.heightCalculationMethod:y,be="widthCalculationMethod"in ee?ee.widthCalculationMethod:be})(),y=G(y,"height"),be=G(be,"width")),ce("TargetOrigin for parent set to: "+R)})(),(function(){n===a&&(a=s+"px"),fi("margin",(function(G,ee){return ee.indexOf("-")!==-1&&(rn("Negative CSS value ignored for "+G),ee=""),ee})("margin",a))})(),fi("background",i),fi("padding",c),(F=document.createElement("div")).style.clear="both",F.classList.add("iframe-resizer-inner"),F.style.display="block",F.style.height="0",document.body.appendChild(F),Js(),q(),document.documentElement.style.height="",document.body.style.height="",ce('HTML & body height set to "auto"'),ce("Enable public methods"),de.parentIFrame={autoResize:function(G){return G===!0&&r===!1?(r=!0,nt()):G===!1&&r===!0&&(r=!1,_r("remove"),l!==null&&l.disconnect(),clearInterval(v)),on(0,0,"autoResize",JSON.stringify(r)),r},close:function(){on(0,0,"close")},getId:function(){return C},getPageInfo:function(G){typeof G=="function"?(X=G,on(0,0,"pageInfo")):(X=function(){},on(0,0,"pageInfoStop"))},moveToAnchor:function(G){k.findTarget(G)},reset:function(){Cn("parentIFrame.reset")},scrollTo:function(G,ee){on(ee,G,"scrollTo")},scrollToOffset:function(G,ee){on(ee,G,"scrollToOffset")},sendMessage:function(G,ee){on(0,0,"message",JSON.stringify(G),ee)},setHeightCalculationMethod:function(G){y=G,Js()},setWidthCalculationMethod:function(G){be=G,q()},setTargetOrigin:function(G){ce("Set targetOrigin: "+G),R=G},size:function(G,ee){ir("size","parentIFrame.size("+((G||"")+(ee?","+ee:""))+")",G,ee)}},T===!0&&(Ce("mouseenter","Mouse Enter"),Ce("mouseleave","Mouse Leave")),nt(),k=(function(){function G(Pt){var pe=Pt.getBoundingClientRect(),Pt={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(pe.left,10)+parseInt(Pt.x,10),y:parseInt(pe.top,10)+parseInt(Pt.y,10)}}function ee(Vt){var pe,Pt=Vt.split("#")[1]||Vt,Vt=decodeURIComponent(Pt),RC=document.getElementById(Vt)||document.getElementsByName(Vt)[0];n!==RC?(pe=G(pe=RC),ce("Moving to in page link (#"+Pt+") at x: "+pe.x+" y: "+pe.y),on(pe.y,pe.x,"scrollToOffset")):(ce("In page link (#"+Pt+") not found in iFrame, so sending to parent"),on(0,0,"inPageLink","#"+Pt))}function xe(){var Ut=window.location.hash,pe=window.location.href;Ut!==""&&Ut!=="#"&&ee(pe)}function Mt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Ut){Ut.getAttribute("href")!=="#"&&Vn(Ut,"click",function(pe){pe.preventDefault(),ee(this.getAttribute("href"))})})}function ea(){Array.prototype.forEach&&document.querySelectorAll?(ce("Setting up location.hash handlers"),Mt(),Vn(window,"hashchange",xe),setTimeout(xe,f)):rn("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?ea():ce("In page linking not enabled"),{findTarget:ee}})(),ir("init","Init message from host page"),me()}function Qs(P){var F=P.split("Callback");F.length===2&&(this[F="on"+F[0].charAt(0).toUpperCase()+F[0].slice(1)]=this[P],delete this[P],rn("Deprecated: '"+P+"' has been renamed '"+F+"'. The old method will be removed in the next major version."))}function fi(P,F){n!==F&&F!==""&&F!=="null"&&ce("Body "+P+' set to "'+(document.body.style[P]=F)+'"')}function tt(P){var F={add:function(he){function Ce(){ir(P.eventName,P.eventType)}Y[he]=Ce,Vn(window,he,Ce,{passive:!0})},remove:function(he){var Ce,G=Y[he];delete Y[he],Ce=window,he=he,G=G,Ce.removeEventListener(he,G,!1)}};P.eventNames&&Array.prototype.map?(P.eventName=P.eventNames[0],P.eventNames.map(F[P.method])):F[P.method](P.eventName),ce(Zs(P.method)+" event listener: "+P.eventType)}function _r(P){tt({method:P,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),tt({method:P,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),tt({method:P,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),tt({method:P,eventType:"Input",eventName:"input"}),tt({method:P,eventType:"Mouse Up",eventName:"mouseup"}),tt({method:P,eventType:"Mouse Down",eventName:"mousedown"}),tt({method:P,eventType:"Orientation Change",eventName:"orientationchange"}),tt({method:P,eventType:"Print",eventNames:["afterprint","beforeprint"]}),tt({method:P,eventType:"Ready State Change",eventName:"readystatechange"}),tt({method:P,eventType:"Touch Start",eventName:"touchstart"}),tt({method:P,eventType:"Touch End",eventName:"touchend"}),tt({method:P,eventType:"Touch Cancel",eventName:"touchcancel"}),tt({method:P,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),tt({method:P,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),tt({method:P,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),x==="child"&&tt({method:P,eventType:"IFrame Resized",eventName:"resize"})}function Dc(P,F,he,Ce){return F!==P&&(P in he||(rn(P+" is not a valid option for "+Ce+"CalculationMethod."),P=F),ce(Ce+' calculation method set to "'+P+'"')),P}function Js(){y=Dc(y,h,ot,"height")}function q(){be=Dc(be,Q,St,"width")}function nt(){var P;r===!0?(_r("add"),P=b<0,window.MutationObserver||window.WebKitMutationObserver?P?En():l=(function(){function F(pe){function Pt(Vt){Vt.complete===!1&&(ce("Attach listeners to "+Vt.src),Vt.addEventListener("load",G,!1),Vt.addEventListener("error",ee,!1),Mt.push(Vt))}pe.type==="attributes"&&pe.attributeName==="src"?Pt(pe.target):pe.type==="childList"&&Array.prototype.forEach.call(pe.target.querySelectorAll("img"),Pt)}function he(pe){ce("Remove listeners from "+pe.src),pe.removeEventListener("load",G,!1),pe.removeEventListener("error",ee,!1),pe=pe,Mt.splice(Mt.indexOf(pe),1)}function Ce(pe,Pt,Vt){he(pe.target),ir(Pt,Vt+": "+pe.target.src)}function G(pe){Ce(pe,"imageLoad","Image loaded")}function ee(pe){Ce(pe,"imageLoadFailed","Image load failed")}function xe(pe){ir("mutationObserver","mutationObserver: "+pe[0].target+" "+pe[0].type),pe.forEach(F)}var Mt=[],ea=window.MutationObserver||window.WebKitMutationObserver,Ut=(function(){var pe=document.querySelector("body");return Ut=new ea(xe),ce("Create body MutationObserver"),Ut.observe(pe,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Ut})();return{disconnect:function(){"disconnect"in Ut&&(ce("Disconnect body MutationObserver"),Ut.disconnect(),Mt.forEach(he))}}})():(ce("MutationObserver not supported in this browser!"),En())):ce("Auto Resize disabled")}function En(){b!==0&&(ce("setInterval: "+b+"ms"),v=setInterval(function(){ir("interval","setInterval: "+b)},Math.abs(b)))}function Sn(P,F){var he=0;return F=F||document.body,he=(he=document.defaultView.getComputedStyle(F,null))!==null?he[P]:0,parseInt(he,o)}function Se(P,F){for(var he,Ce=F.length,G=0,ee=Zs(P),xe=Date.now(),Mt=0;Mt<Ce;Mt++)G<(he=F[Mt].getBoundingClientRect()[P]+Sn("margin"+ee,F[Mt]))&&(G=he);return xe=Date.now()-xe,ce("Parsed "+Ce+" HTML elements"),ce("Element position calculated in "+xe+"ms"),ne/2<(xe=xe)&&ce("Event throttle increased to "+(ne=2*xe)+"ms"),G}function ht(P){return[P.bodyOffset(),P.bodyScroll(),P.documentElementOffset(),P.documentElementScroll()]}function jn(P,F){var he=document.querySelectorAll("["+F+"]");return he.length===0&&(rn("No tagged elements ("+F+") found on page"),document.querySelectorAll("body *")),Se(P,he)}function at(){return document.querySelectorAll("body *")}function wn(P,F,he,Ce){function G(){P in{init:1,interval:1,size:1}||!(y in _||u&&be in _)?P in{interval:1}||ce("No change in size detected"):Cn(F)}var ee,xe;function Mt(ea,Ut){return!(Math.abs(ea-Ut)<=M)}ee=n!==he?he:ot[y](),xe=n!==Ce?Ce:St[be](),Mt(m,ee)||u&&Mt(re,xe)||P==="init"?(Bc(),on(m=ee,re=xe,P)):G()}function Rt(){zt=Date.now(),vn=null,qt=tn.apply(mt,nn),vn||(mt=nn=null)}function ir(P,F,he,Ce){te&&P in d?ce("Trigger event cancelled: "+P):(P in{reset:1,resetPage:1,init:1}||ce("Trigger event: "+F),(P==="init"?wn:pt)(P,F,he,Ce))}function Bc(){te||(te=!0,ce("Trigger event lock on")),clearTimeout(j),j=setTimeout(function(){te=!1,ce("Trigger event lock off"),ce("--")},f)}function kr(P){m=ot[y](),re=St[be](),on(m,re,P)}function Cn(P){var F=y;y=h,ce("Reset trigger event: "+P),Bc(),kr("reset"),y=F}function on(P,F,he,Ce,G){var ee;N===!0&&(n===G?G=R:ce("Message targetOrigin: "+G),ce("Sending message to host page ("+(ee=C+":"+(P+":"+F)+":"+he+(n!==Ce?":"+Ce:""))+")"),W.postMessage(g+ee,G))}function OC(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),sj=[{name:"Stripo (es-header/content/footer)",detect:()=>!!(document.querySelector(".es-header")||document.querySelector(".es-content")||document.querySelector(".es-footer")),apply:()=>{document.querySelectorAll(".es-header, .es-content, .es-footer").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-header-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-content-body > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll(".es-footer-body > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Stripo (es-wrapper)",detect:()=>!!document.querySelector(".es-wrapper"),apply:()=>{document.querySelectorAll(".es-wrapper > tr > td > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".es-wrapper > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sandsay",detect:()=>!!(document.querySelector("[data-template-wrapper]")&&document.querySelector("[data-template-content]")),apply:()=>{document.querySelectorAll("[data-template-wrapper] > table[data-block-id]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Beefree",detect:()=>!!(document.querySelector(".nl-container")&&document.querySelector(".row")),apply:()=>{document.querySelectorAll('.row[em="block"]').forEach(e=>{e.removeAttribute("em")}),document.querySelectorAll(".row").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".row-content").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon",detect:()=>!!document.querySelector(".main-container"),apply:()=>{document.querySelectorAll(".main-container > tr > td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Chamaileon (email-container)",detect:()=>!!document.querySelector(".email-container"),apply:()=>{document.querySelectorAll(".email-container > tr > td > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")})}},{name:"Mindbox",detect:()=>!!(document.querySelector(".nl-container")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".nl-container > tr > td > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Unlayer",detect:()=>!!(document.querySelector(".clean-body.u_body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll(".u-row-container").forEach(e=>{e.setAttribute("em","block")})}},{name:"Postcards",detect:()=>!!(document.querySelector(".pc-email-body")&&!document.querySelector(".row")),apply:()=>{document.querySelectorAll('.pc-email-container > tr > td > table[role="presentation"]').forEach(e=>{e.setAttribute("em","block")})}},{name:"Topol",detect:()=>!!(document.querySelector(".hide_section_on_mobile")||document.querySelector(".mj-column-per-100")||document.querySelector(".outlook-group-fix")),apply:()=>{document.querySelectorAll("body > div > div").forEach(e=>{e.setAttribute("em","block")})}},{name:"Sender",detect:()=>!!document.querySelector(".e-c.sect"),apply:()=>{document.querySelectorAll(".e-c.sect").forEach(e=>{e.setAttribute("em","block")})}},{name:"Letteros",detect:()=>!!(!document.querySelector("[mailfit-module]")&&(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("body > div > table > tr > td > table > tr").forEach(e=>{e.setAttribute("em","block")}),document.querySelectorAll('[style*="overflow"]').forEach(e=>{e.style.removeProperty("overflow")})}},{name:"Letteros (letteros-element)",detect:()=>!!document.querySelector("[letteros-element]"),apply:()=>{document.querySelectorAll("[letteros-body]").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[letteros-element]").forEach(e=>{e.setAttribute("em","block")})}},{name:"Ascona",detect:()=>!!(document.querySelector(".mail_preheader")&&document.body.classList.contains("body")),apply:()=>{document.querySelectorAll("#mailsub > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"Mailfit",detect:()=>!!document.querySelector("[mailfit-module]"),apply:()=>{document.querySelectorAll("body > div > table > tr").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll("[mailfit-module]").forEach(e=>{e.setAttribute("em","block")})}},{name:"CashCowAgency",detect:()=>!!document.querySelector(".container-div"),apply:()=>{document.querySelectorAll("body > center").forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll(".container-td > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"MakeMail",detect:()=>!!(document.querySelector(".mail")&&document.querySelector(".container")),apply:()=>{document.querySelectorAll(".container").forEach(e=>{e.setAttribute("em","block")})}},{name:"data-axle.com",detect:()=>!!document.querySelector(".full-width-container-inner"),apply:()=>{document.querySelectorAll(".full-width-container-inner > table").forEach(e=>{e.setAttribute("em","block")})}},{name:"Miro",detect:()=>!!document.querySelector(".content__tablet_fullWidth"),apply:()=>{document.querySelectorAll(".content__tablet_fullWidth").forEach(e=>{for(const t of Array.from(e.children))if(t.children.length>1)for(const n of Array.from(t.children))n.setAttribute("em","block");else for(const n of Array.from(t.children))for(const r of Array.from(n.children))for(const o of Array.from(r.children))o.setAttribute("em","block")})}},{name:"WIM (full-wrap)",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll(".full-wrap > tr > td > div > table > tr").forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > div > table > tr, :scope > td > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"WIM",detect:()=>!!(document.body.classList.contains("body")&&document.querySelector("[alink]")&&!document.querySelector(".full-wrap")),apply:()=>{document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","group"),e.querySelectorAll(":scope > td > table > tr > td > table > tr").forEach(t=>{t.setAttribute("em","block")})})}},{name:"Emailify",detect:()=>document.body.classList.contains("emailify"),apply:()=>{document.querySelectorAll("body > div > div > table > tr").forEach(e=>{e.setAttribute("em","block")})}}];function aj(){document.querySelectorAll('body > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr').forEach(e=>{e.setAttribute("em","group")}),document.querySelectorAll('body > table > tr > td > table > tr, body > div[style*="-webkit-text-size-adjust"] > table > tr > td > table > tr, body > table > tbody > tr > td > table > tbody > tr, body > div[style*="-webkit-text-size-adjust"] > table > tbody > tr > td > table > tbody > tr').forEach(e=>{e.setAttribute("em","block")})}function lj(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),Hr();return}if(e){let n=!1;for(const r of sj)if(r.detect()){r.apply(),n=!0;break}n||aj()}xC(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||K.send({operation:"application_template_not_em_alert_show"}),Hr()}function xC(){const e=document.querySelector("[em=atoms]");if(e){for(const t of Array.from(e.children))t.setAttribute("em","atom");e.removeAttribute("em")}document.documentElement?.style.height&&document.documentElement.style.removeProperty("height"),document.body?.style.height&&document.body.style.removeProperty("height")}Object.defineProperty(z,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return bB}}),Object.defineProperty(z,"Disposable",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(z,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return BV}}),Object.defineProperty(z,"EVENT_TYPES",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(z,"FOCUS_ID",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(z,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return J}}),Object.defineProperty(z,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return wi}}),Object.defineProperty(z,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return su}}),Object.defineProperty(z,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return Jp}}),Object.defineProperty(z,"Node",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(z,"NodeType",{enumerable:!0,get:function(){return $}}),Object.defineProperty(z,"SET_CURSOR_ID",{enumerable:!0,get:function(){return At}}),Object.defineProperty(z,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return Zp}}),Object.defineProperty(z,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(z,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return Qp}}),Object.defineProperty(z,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return ln}}),Object.defineProperty(z,"_defineProperty",{enumerable:!0,get:function(){return L}}),Object.defineProperty(z,"addFontFamilyClass",{enumerable:!0,get:function(){return _s}}),Object.defineProperty(z,"ampUnit",{enumerable:!0,get:function(){return sL}}),Object.defineProperty(z,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Gl}}),Object.defineProperty(z,"applyRootScale",{enumerable:!0,get:function(){return Ri}}),Object.defineProperty(z,"buildEmFontClassName",{enumerable:!0,get:function(){return Yl}}),Object.defineProperty(z,"checkBlockAdaptivity",{enumerable:!0,get:function(){return Ul}}),Object.defineProperty(z,"clearLinkTags",{enumerable:!0,get:function(){return Zr}}),Object.defineProperty(z,"clearProjectFontFaces",{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(z,"commitOf",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(z,"commonStylesApply",{enumerable:!0,get:function(){return W1}}),Object.defineProperty(z,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return nm}}),Object.defineProperty(z,"createFontClassName",{enumerable:!0,get:function(){return $f}}),Object.defineProperty(z,"createIdentifier",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(z,"defineSurface",{enumerable:!0,get:function(){return dA}}),Object.defineProperty(z,"defineUnit",{enumerable:!0,get:function(){return $0}}),Object.defineProperty(z,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return nj}}),Object.defineProperty(z,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return JV}}),Object.defineProperty(z,"elMarkupHelper",{enumerable:!0,get:function(){return lj}}),Object.defineProperty(z,"extensionsUnit",{enumerable:!0,get:function(){return P9}}),Object.defineProperty(z,"findParentTr",{enumerable:!0,get:function(){return jg}}),Object.defineProperty(z,"fitEmailToWidth",{enumerable:!0,get:function(){return dL}}),Object.defineProperty(z,"fitImagesToColumns",{enumerable:!0,get:function(){return xm}}),Object.defineProperty(z,"getElementInnerHTML",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(z,"getOuterHtml",{enumerable:!0,get:function(){return Xt}}),Object.defineProperty(z,"getUsedColors",{enumerable:!0,get:function(){return X1}}),Object.defineProperty(z,"globalBlockReplace",{enumerable:!0,get:function(){return SV}}),Object.defineProperty(z,"iframeSetSize",{enumerable:!0,get:function(){return fL}}),Object.defineProperty(z,"implementPolyfills",{enumerable:!0,get:function(){return mp}}),Object.defineProperty(z,"insertAdjacentHTML",{enumerable:!0,get:function(){return Xn}}),Object.defineProperty(z,"insertCountdown",{enumerable:!0,get:function(){return o1}}),Object.defineProperty(z,"insertNewHTML",{enumerable:!0,get:function(){return xg}}),Object.defineProperty(z,"isComment",{enumerable:!0,get:function(){return wa}}),Object.defineProperty(z,"isEmptyTable",{enumerable:!0,get:function(){return bn}}),Object.defineProperty(z,"isTextNode",{enumerable:!0,get:function(){return ki}}),Object.defineProperty(z,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return xC}}),Object.defineProperty(z,"markProjectFontClass",{enumerable:!0,get:function(){return qf}}),Object.defineProperty(z,"messageService",{enumerable:!0,get:function(){return K}}),Object.defineProperty(z,"minifyStylesheet",{enumerable:!0,get:function(){return Gr}}),Object.defineProperty(z,"paintGateUnit",{enumerable:!0,get:function(){return ej}}),Object.defineProperty(z,"parseFromString",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(z,"removeClassesByPrefix",{enumerable:!0,get:function(){return zf}}),Object.defineProperty(z,"removeHiddenClasses",{enumerable:!0,get:function(){return kl}}),Object.defineProperty(z,"requireService",{enumerable:!0,get:function(){return D}}),Object.defineProperty(z,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return ij}}),Object.defineProperty(z,"rgbToHex",{enumerable:!0,get:function(){return V}}),Object.defineProperty(z,"rowsHost",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(z,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return ec}}),Object.defineProperty(z,"setBlockMaxWidth",{enumerable:!0,get:function(){return Om}}),Object.defineProperty(z,"setDocumentStyles",{enumerable:!0,get:function(){return Ff}}),Object.defineProperty(z,"setElementBorder",{enumerable:!0,get:function(){return Uf}}),Object.defineProperty(z,"setElementBorderRadius",{enumerable:!0,get:function(){return ws}}),Object.defineProperty(z,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return L8}}),Object.defineProperty(z,"setFloatBlocksWidth",{enumerable:!0,get:function(){return Nm}}),Object.defineProperty(z,"setImageWidth",{enumerable:!0,get:function(){return xf}}),Object.defineProperty(z,"setStructureBlocksWidth",{enumerable:!0,get:function(){return pc}}),Object.defineProperty(z,"startSandbox",{enumerable:!0,get:function(){return fA}}),Object.defineProperty(z,"state",{enumerable:!0,get:function(){return O}}),Object.defineProperty(z,"stripSubjectTags",{enumerable:!0,get:function(){return AA}}),Object.defineProperty(z,"uptimeCountdown",{enumerable:!0,get:function(){return Of}}),Object.defineProperty(z,"wheelBridgeUnit",{enumerable:!0,get:function(){return tj}}),Object.defineProperty(z,"withForeignListenersPaused",{enumerable:!0,get:function(){return It}})});
|