@emailmaker/emailmaker 1.2.5 → 1.3.2
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/emailmaker-core.b63d7b8b.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.ee1618fa.js → emailmaker-po.b63d7b8b.js} +1 -1
- package/emailmaker.js +12 -12
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox.css +19 -0
- package/iframe/{iframe-eblock.ee1618fa.html → iframe-eblock.b63d7b8b.html} +2 -2
- package/iframe/{iframe.ee1618fa.html → iframe.b63d7b8b.html} +2 -2
- package/iframe/js/elMarkupHelper.C4wWAApZ.js +278 -0
- package/iframe/js/iframe-eblock.body.b63d7b8b.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.b63d7b8b.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/{abcacabc.js → 1922419a.js} +1 -1
- package/static/core/{c03be019.js → 253d6f68.js} +2 -2
- package/static/core/{5b6e2acb.js → 3a876cdd.js} +1 -1
- package/static/core/{6b16159c.js → 40574d12.js} +1 -1
- package/static/core/{f35181ec.js → 4f63baad.js} +1 -1
- package/static/core/{683a6a53.js → 4fef179c.js} +1 -1
- package/static/core/{4de9c323.js → 5e13bbc1.js} +3 -3
- package/static/core/{9eaed676.js → 6319e32c.js} +1 -1
- package/static/core/{dd230bbb.js → 66a5de32.js} +1 -1
- package/static/core/{a8b4352d.js → 69842511.js} +1 -1
- package/static/core/{659796a7.js → 7a9faff8.js} +11 -11
- package/static/core/{7e167222.js → 85accd9c.js} +1 -1
- package/static/core/{64711257.js → 86e5503b.js} +2 -2
- package/static/core/{c8443fab.js → 89fb48c9.js} +1 -1
- package/static/core/{d2780737.js → 8fdd9471.js} +1 -1
- package/static/core/{c67df236.js → 9f6b8cdd.js} +1 -1
- package/static/core/{b712bb05.js → 9f7f5230.js} +1 -1
- package/static/core/{17fba7af.js → a6518f19.js} +1 -1
- package/static/core/{2a042fe3.js → a9d62c49.js} +1 -1
- package/static/core/{b7289065.js → aea50cd5.js} +1 -1
- package/static/core/bb58b8a1.js +28 -0
- package/static/core/c266ad76.js +1 -0
- package/static/core/{155e871a.js → cd715a88.js} +3 -3
- package/static/core/{50ba806c.js → d0d2525d.js} +1 -1
- package/static/core/{d503c406.js → d402573d.js} +1 -1
- package/static/core/{63e7f8c1.js → e2694475.js} +2 -2
- package/static/core/e6f6edff.js +1 -0
- package/static/core/e8edbf21.js +2 -0
- package/static/core/{82f8beb4.js → f85176c7.js} +1 -1
- package/static/core/{c3d00c5e.js → fa6f5198.js} +1 -1
- package/static/esm/{b4f8dfdc.js → 74f083c2.js} +1 -1
- package/static/umd-runtime/{runtime.Bsid8PpY.js → runtime.9w1dxMVc.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.ee1618fa.js +0 -859
- package/iframe/js/elMarkupHelper.Buog1r0c.js +0 -278
- package/iframe/js/iframe-eblock.body.ee1618fa.js +0 -9
- package/iframe/js/iframe.body.ee1618fa.js +0 -129
- package/static/core/987afc3f.js +0 -1
- package/static/core/b96e571d.js +0 -2
- package/static/core/e7fa68c2.js +0 -28
- package/static/core/e88db487.js +0 -1
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
__emailmaker__.define("js/elMarkupHelper.Buog1r0c.js",["require","exports","module"],function(fu,z,RK){var up=Object.defineProperty,Sr=(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 Ti(e){"@babel/helpers - typeof";return Ti=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},Ti(e)}function oA(e,t){if(Ti(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ti(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iA(e){var t=oA(e,"string");return Ti(t)=="symbol"?t:t+""}function k(e,t,n){return(t=iA(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 mu=class{constructor(){k(this,"_valuesMap",new Map),k(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 mu;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&mu.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(mu.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 hp=Symbol.for("emailmaker.commandInputPause");function pp(){const e=window,t=e[hp];if(t)return t;const n=new Set;return e[hp]=n,window.addEventListener("input",r=>n.forEach(o=>o(r)),!0),n}function sA(){pp()}function aA(e){const t=pp();return t.add(e),()=>{t.delete(e)}}sA();var gp=class{constructor(e){k(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},vt=(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.BogusComment=22]="BogusComment",e[e.AdvancedStart=100]="AdvancedStart",e[e.AdvancedEnd=101]="AdvancedEnd",e})({}),lA=class{constructor(e,t){k(this,"source",void 0),k(this,"len",void 0),k(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===mA||e===hA||e===uA||e===fA||e===dA)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},hu=33,Eo=45,ki=60,tn=62,Li=47,cA=61,bp=34,yp=39,uA=10,dA=13,fA=12,mA=32,hA=9,vp=63,pA=65,gA=90,bA=97,yA=122;function Ep(e){return e>=bA&&e<=yA||e>=pA&&e<=gA}function Sp(e){return Ep(e)||e===Li||e===hu||e===vp}var Sa="(?=[\\s/>])",vA=new RegExp(`<!--|-->|<\\/?script${Sa}\\s*\\/?>?`,"i"),EA=new RegExp(`<\\/style${Sa}`,"i"),SA={"text/x-handlebars-template":!0,"text/html":!0};function wA(e,t=0,n=0,r=!1){const o=new lA(e,t);let i=n,s=0,a=18,l,c,u=!1,d,f,m;function h(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function p(){const E=o.pos();for(;!o.eos();){const _=o.nextChar();if(_===tn)return!0;if(_===ki)break;if(_===bp||_===yp){if(!o.advanceUntilChar(_))break;o.advance(1)}}return o.goBackTo(E),!1}function v(){for(;o.advanceUntilChar(ki)&&!Sp(o.peekChar(1));)o.advance(1)}function w(E){return o.advanceUntilChar(tn)&&o.advance(1),T(E,22)}function C(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function T(E,_,b){return a=_,s=E,l=b,_}function y(){const E=o.pos(),_=i,b=g();return b!==21&&E===o.pos()&&!(r&&(b===4||b===8))?(o.advance(1),T(E,18)):b}function g(){const E=o.pos();if(o.eos())return T(E,21);let _;switch(i){case 6:return o.advanceIfChars([Eo,Eo,tn])?(i=0,T(E,2)):(o.advanceUntilChars([Eo,Eo,tn]),T(E,1));case 3:return o.advanceIfChar(tn)?(i=0,T(E,15)):(o.advanceUntilChar(tn),T(E,14));case 0:return o.peekChar()===ki&&Sp(o.peekChar(1))?(o.advance(1),o.peekChar()===hu?o.advanceIfChars([hu,Eo,Eo])?(i=6,T(E,0)):o.advanceIfRegExp(/^!doctype/i)?(i=3,T(E,13)):w(E):o.peekChar()===vp?w(E):o.advanceIfChar(Li)?Ep(o.peekChar())?(i=2,T(E,7)):w(E):(i=1,T(E,3))):(v(),T(E,16));case 2:return h().length>0?(i=5,u=!1,T(E,9)):o.skipWhitespace()?T(E,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(tn),E<o.pos()?T(E,18,"End tag name expected."):g());case 5:if(o.skipWhitespace())return u=!0,T(E,17);if(o.advanceIfChar(tn))return i=0,T(E,8);if(r&&o.peekChar()===ki)return i=0,T(E,8,"Closing bracket missing.");if((u||o.peekChar()===Li)&&p())return i=0,T(E,8);_="Closing bracket expected.";break;case 1:return d=h(),m=void 0,f=void 0,d.length>0?(c=!1,i=4,T(E,6)):o.skipWhitespace()?T(E,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(tn),E<o.pos()?T(E,18,"Start tag name expected."):g());case 4:return o.skipWhitespace()?(c=!0,T(E,17)):c&&(f=C(),f.length>0)?(i=9,c=!1,T(E,11)):o.advanceIfChars([Li,tn])?(i=0,T(E,5)):o.advanceIfChar(tn)?(d==="script"?m&&SA[m]?i=0:i=7:d==="style"?i=8:i=0,T(E,4)):r&&o.peekChar()===ki?(i=0,T(E,4,"Closing bracket missing.")):(o.advance(1),T(E,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,T(E,17)):o.advanceIfChar(cA)?(i=10,T(E,10)):(i=4,g());case 10:if(o.skipWhitespace())return T(E,17);let b=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(b.length>0)return o.peekChar()===tn&&o.peekChar(-1)===Li&&(o.goBack(1),b=b.substr(0,b.length-1)),f==="type"&&(m=b),i=4,c=!1,T(E,12);const S=o.peekChar();return S===yp||S===bp?(o.advance(1),o.advanceUntilChar(S)&&o.advance(1),f==="type"&&(m=o.getSource().substring(E+1,o.pos()-1)),i=4,c=!1,T(E,12)):(i=4,c=!1,g());case 7:let A=1;for(;!o.eos();){const L=o.advanceIfRegExp(vA);if(L.length===0)return o.goToEnd(),T(E,19);if(L==="<!--")A===1&&(A=2);else if(L==="-->")A=1;else if(L[1]!=="/")A===2&&(A=3);else if(A===3)A=2;else{o.goBack(L.length);break}}return i=0,E<o.pos()?T(E,19):g();case 8:return o.advanceUntilRegExp(EA),i=0,E<o.pos()?T(E,20):g()}return o.advance(1),i=0,T(E,18,_)}return{scan:y,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function CA(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function _A(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function AA(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function TA(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 pu=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function kA(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var wp=Object.create(null);function LA(e,t){const n=wp[e]||(wp[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[kA(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function gu(e,t){if(e.start===e.end||t)return"";switch(e.type){case B.ELEMENT:return yu(e,t);case B.ROOT:return[...e.children].map(n=>gu(n,t)).join("");case B.DOCTYPE:return CA(e,t);case B.COMMENT:return AA(e,t);default:return e.content||""}}function bu(){return{exact:new WeakMap,collapsed:new WeakMap}}function nr(e,t=!1,n){if(e.start===e.end&&e.type!==B.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=>nr(a,t,n)).join("");let s;switch(e.type){case B.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case B.ROOT:s=i();break;case B.COMMENT:s=`<!--${e.content??""}-->`;break;case B.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 wa(e,t=0){if(e.start===e.end)return"";switch(e.type){case B.ELEMENT:return xA(e,t);case B.ROOT:return _p(e,t);case B.DOCTYPE:return _A(e,t);case B.COMMENT:return TA(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function Cp(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"&&!LA(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function NA(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=gu(r);return n}function _p(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=wa(r,t+n.length);return n}function Ap(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=Cp(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function Tp(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function yu(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=Ap(e,t);if(pu.has(r))return o;{const i=Tp(e,t);return`${o}${n?NA(e,t):""}${i}`}}function xA(e,t){const n=e.tag?.toLowerCase()||"div",r=Ap(e);if(e.start=t,e.startTagEnd=t+r.length,pu.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=_p(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=Tp(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function vu(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 B=(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})({}),Ca=e=>e.type===0?e.start-1:e.start,OA=e=>e.type===0?e.end+1:e.end,Et=class J_{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){k(this,"start",void 0),k(this,"end",void 0),k(this,"children",void 0),k(this,"parent",void 0),k(this,"content",void 0),k(this,"type",1),k(this,"tag",void 0),k(this,"closed",!1),k(this,"startTagEnd",void 0),k(this,"endTagStart",void 0),k(this,"attributes",void 0),k(this,"createdBy",void 0),k(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=vu(this.children,r=>t<=Ca(r))-1;if(n>=0){const r=this.children[n];if(t>Ca(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=vu(this.children,r=>t<=Ca(r))-1;if(n>=0){const r=this.children[n];if(t>=Ca(r)&&t<=OA(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 J_(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 RA(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 kp=class{constructor(e,t){k(this,"text",void 0),k(this,"type",void 0),k(this,"node",void 0),k(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 Et(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}}},Lp=class{constructor(e){k(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=wA(e,void 0,void 0,!0),r=new Et(0,e.length,[],void 0);r.type=B.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const p=o.parent.children,v=p[p.length-2],w=e.substring(o.start,o.end);v?.type===B.HTML?(v.content=(v.content||"")+w,v.end=o.end,p.splice(p.length-1,1)):(o.type=B.HTML,o.content=w,o.children=[]),o.type=B.HTML}o=o.parent},u=new kp(e,B.COMMENT),d=new kp(e,B.DOCTYPE),f=p=>{o.children.push(p)},m=(p,v)=>{const w=new Et(p,v,[],o);w.type=B.HTML,w.content=e.substring(p,v),f(w)};for(;l!==vt.EOS;){switch(l){case vt.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case vt.EndDoctypeTag:{const T=o.lastChild,y=d.node;if(!y)throw new Error("");const g=T?T.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==y.start){const E=e.substring(g,y.start);if(E){const _=new Et(g,y.start,[],o);_.type=B.HTML,_.content=E,f(_)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case vt.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case vt.EndCommentTag:{const T=o.lastChild,y=u.node;if(!y)throw new Error("");const g=T?T.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==y.start){const E=e.substring(g,y.start);if(E){const _=new Et(g,y.start,[],o);_.type=B.HTML,_.content=E,f(_)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case vt.StartTagOpen:const p=o.lastChild,v=new Et(n.getTokenOffset(),e.length,[],o),w=p?p.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(w!==v.start){const T=e.substring(w,v.start);if(T){const y=new Et(w,v.start,[],o);y.type=B.HTML,y.content=T,f(y)}}f(v),o=v;break;case vt.BogusComment:{const T=o.lastChild?.end??o.startTagEnd??o.start;T<n.getTokenOffset()&&m(T,n.getTokenOffset()),m(n.getTokenOffset(),n.getTokenEnd());break}case vt.StartTag:o.tag=n.getTokenText();break;case vt.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 vt.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case vt.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case vt.EndTag:s=n.getTokenText().toLowerCase();break;case vt.EndTagClose:let C=o;for(;!C.isSameTag(s)&&C.parent;)C=C.parent;if(C.parent){const T=o.lastChild,y=T?T.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(y!==i){const g=e.substring(y,i);if(g){const E=new Et(y,i,[],o);E.type=B.HTML,E.content=g,f(E)}}for(;o!==C;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case vt.AttributeName:{a=n.getTokenText();let T=o.attributes;T||(o.attributes=T={}),T[a]=null;break}case vt.AttributeValue:{const T=n.getTokenText(),y=o.attributes;y&&a&&(y[a]=RA(T),a=null);break}}l=n.scan()}for(;o.parent;)o.end=e.length,o.closed=!1,c();u.hasNode,u.finish(e.length);const h=r.lastChild?.end||0;if(h<e.length){const p=e.substring(h);if(p){const v=new Et(h,e.length,[],r);v.type=B.HTML,v.content=p,f(v)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},MK=new Lp(new gp(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),MA=new gp(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),PA=new Lp(MA);function gn(e){return PA.parse(e)}var Eu=Symbol("bogusCommentSource");function wr(e){if(e){const t=document.createElement("div");t.insertAdjacentHTML("afterbegin",e);const n=t.firstChild??document.createTextNode("");return n.nodeType===Node.COMMENT_NODE&&IA(n,e),n}else return document.createTextNode("")}function IA(e,t){const n={source:t,data:e.data};Object.defineProperty(e,Eu,{value:n,configurable:!0})}function Ni(e){const t=e[Eu];return t&&t.data===e.data?t:void 0}function _a(e){return Ni(e)?.source}function Np(e,t){if(e.nodeType===Node.COMMENT_NODE){t.push(e);return}(e.nodeName==="TEMPLATE"?e.content:e).childNodes.forEach(n=>Np(n,t))}function Aa(...e){const t=[];return e.forEach(n=>Np(n,t)),t}function DA(e,t){return e.data===t.data&&(e.parent===void 0||t.parent===void 0||e.parent===t.parent)}function xp(e,t){Ni(e)||Object.defineProperty(e,Eu,{value:t,configurable:!0})}function BA(e){const t=new Map,n=new Set;for(const{data:r,mark:o}of e){const i=t.get(r);!o||i&&i.source!==o.source?n.add(r):i||t.set(r,o)}return n.forEach(r=>t.delete(r)),t}function HA(e,t,n){if(!t.length||!e.some(o=>o.mark))return;const r=[];for(let o=0;o+t.length<=e.length;o++)n.every((i,s)=>DA(e[o+s],i))&&r.push(o);if(!r.length){const o=BA(e);t.forEach(i=>{const s=o.get(i.data);s&&xp(i,s)});return}t.forEach((o,i)=>{const s=r.map(l=>e[l+i].mark),[a]=s;a&&s.every(l=>l?.source===a.source)&&xp(o,a)})}function Op(e,t){const n=e.parentNode,r=n&&n.nodeType===Node.ELEMENT_NODE&&!t.includes(n);return{data:e.data,mark:Ni(e),parent:r?n.nodeName.toLowerCase():void 0}}function Rp(e,t,n){const r=Aa(...t),o=n?[...t,n]:t;HA(e,r,r.map(i=>Op(i,o)))}function nn(e,t){Rp(Aa(e).map(n=>Op(n,[e])),[t],null)}var FA=/<[!?]|<\/[^a-zA-Z]/,$A=/^<[!?/]/;function WA(e){const t=[],n=r=>{const o=r.parent?.tag?.toLowerCase();if(r.type===B.COMMENT)t.push({data:r.content??"",mark:void 0,parent:o});else if(r.type===B.HTML&&r.content&&$A.test(r.content)){const i=wr(r.content);i.nodeType===Node.COMMENT_NODE&&t.push({data:i.data,mark:Ni(i),parent:o})}r.children.forEach(n)};try{gn(e).roots.forEach(n)}catch{return[]}return t}function Mp(e,t,n=null){FA.test(t)&&Rp(WA(t),e,n)}function xi(e,t){Mp([e],t)}var Oi="",qA=4,Pp=0;function zA(){return Pp+=1,`${Math.random().toString(36).slice(2)}${Pp.toString(36)}`}function UA(e,t,n){if(e.split(`${Oi}${t}:`).length-1!==n.length)return;const r=e.split(new RegExp(`<!--${Oi}${t}:(\\d+)${Oi}-->`)),o=r.filter((i,s)=>s%2===1).map(Number);if(!(o.length!==n.length||new Set(o).size!==n.length||o.some(i=>i>=n.length)))return r.map((i,s)=>s%2?n[Number(i)]:i).join("")}function Ta(e,t,n){const r=Aa(e),o=r.map(l=>Ni(l)?.source);if(o.every(l=>l===void 0))return t?e.outerHTML:e.innerHTML;const i=n?e:e.cloneNode(!0),s=n?r:Aa(i),a=r.map(l=>l.data);for(let l=0;l<qA;l++){const c=zA(),u=[];s.forEach((f,m)=>{const h=o[m];h!==void 0&&(f.data=`${Oi}${c}:${u.length}${Oi}`,u.push(h))});const d=UA(t?i.outerHTML:i.innerHTML,c,u);if(d!==void 0)return d}return s.forEach((l,c)=>{l.data=a[c]}),t?i.outerHTML:i.innerHTML}function rn(e){return Ta(e,!0,!1)}function ze(e){return Ta(e,!1,!1)}function Ip(e){return Ta(e,!0,!0)}function VA(e){return Ta(e,!1,!0)}function ke(e,t){e.innerHTML=t,xi(e,t)}function Wt(e,t){ke(e,ze(t))}function Su(e){Ri(e,ze(e))}function Ri(e,t){const n=e.parentNode,r=e.previousSibling,o=e.nextSibling;if(e.outerHTML=t,!n)return;const i=[];for(let s=r?r.nextSibling:n.firstChild;s&&s!==o;s=s.nextSibling)i.push(s);Mp(i,t,n)}var Dp=new Set(["text/x-handlebars-template","text/html"]);function ka(e,t){if(e.type!==B.HTML||!t)return!1;const n=t.tag?.toLowerCase(),r=t.attributes?.type;return n==="style"||n==="script"&&!Dp.has(typeof r=="string"?r:"")}var jA={amp:"&",lt:"<",gt:">",nbsp:String.fromCodePoint(160),quot:'"'};function wu(e){return e.replaceAll(/&(amp|lt|gt|nbsp|quot);/g,(t,n)=>jA[n])}var Bp=Symbol("rawTextSource");function Cu(e){const t=document.createTextNode(wu(e));return Hp(t,e),t}function Hp(e,t){Object.defineProperty(e,Bp,{value:t,configurable:!0})}function GA(e,t){e.data=wu(t),Hp(e,t)}function Fp(e){const t=e[Bp];return t!==void 0&&wu(t)===e.textContent?t:void 0}var So,Vr;function $p(e){const t=So;return So=e,()=>{So===e&&(So=t)}}function XA(e){const t=Vr;return Vr=e,()=>{Vr===e&&(Vr=t)}}function Wp(e,t,n){return So?So(e,t,n):n}function YA(){return Vr!==void 0}function qp(e,t,n){return Vr?Vr(e,t,n):n}var _u;function KA(){return _u||(_u=document.implementation.createHTMLDocument("")),_u}function ZA(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 QA=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),JA=new Set(["script","style","xmp"]);function eT(e,t){return!(t&&JA.has(t.toLowerCase())||QA.has(e.toLowerCase()))}var tT=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},nT=new Set(["head","body"]);function zp(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=KA(),s=nT.has(r)?ZA(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 rr(e,t,n){try{eT(t,e.tagName)&&!tT(n)?e.setAttribute(t,n):zp(e,t,n)}catch{zp(e,t,n)}}function Up(){return wr("<script><\/script>")}var rT="text/x-em-dormant",Mi=Symbol("dormantScriptType");function Au(e){e[Mi]=e.getAttribute("type"),e.setAttribute("type",rT)}function La(e){return Mi in e}function oT(e){const t=[...e].filter(n=>!La(n));return t.forEach(Au),t}function iT(e,t){return La(e)?(e[Mi]=t,!0):!1}function Vp(e){const t=new Set;for(const n of e){const r="querySelectorAll"in n?n.querySelectorAll("script"):[];for(const o of[n,...r])La(o)&&t.add(o)}return[...t]}function jp(e){if(!La(e))return;const t=e[Mi];delete e[Mi],typeof t=="string"?e.setAttribute("type",t):e.removeAttribute("type")}var sT=["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 aT(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 Gp(e){const t=aT(e);return sT.includes(t)?"classic":t==="module"||t==="importmap"||t==="speculationrules"?t:void 0}function lT(e){return Gp(e)==="classic"}function cT(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 uT(e){const t=Gp(e);return!t||t==="speculationrules"||Na(e)?!1:t!=="classic"||!e.hasAttribute("nomodule")&&cT(e)}function dT(e){return e.hasAttribute("src")&&!["async","defer","nomodule"].some(t=>e.hasAttribute(t))&&lT(e)}function Na(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 Xp(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 Yp(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 Kp(e,t,n){e.replaceWith(t),t.append(...e.childNodes),n.substitute?.(e,t)}function Zp(e,t){const n=Up();return Yp(e,n),t.quiet(()=>Kp(e,n,t)),n}function fT(e,t,n){const r=Zp(t,n),o=()=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r.isConnected&&(n.quiet(()=>{Yp(r,t),Au(t),Kp(r,t,n),jp(t)}),Xp(t,n))};e.addEventListener("load",o),e.addEventListener("error",o)}function Qp(e,t){e.forEach(jp);const n=e.filter(Na),r=e.filter(i=>i.isConnected&&!Na(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=>Zp(i,t));let o;for(const i of r)o&&!i.hasAttribute("src")?fT(o,i,t):(Xp(i,t),o=dT(i)?i:o)}function jr(e,t=!0,n=!1){const r=e.content;switch(e.type){case B.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(jr(i,!0,n));return o}case B.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case B.COMMENT:return document.createComment(r||"");case B.ELEMENT:if(e.tag){const o=e.tag.toLowerCase()==="script",i=n===!0&&o?Up():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=Wp(i,s,typeof a=="string"?a:"");l!==null&&rr(i,s,l)}catch{}}if(n==="dormant"&&o&&Au(i),t){const s=e.tag.toLowerCase()==="template"?!0:n;for(const a of e.children)i.appendChild(ka(a,e)?Cu(a.content||""):jr(a,!0,s))}return i}return document.createTextNode("<");case B.HTML:return wr(r||"");default:throw new Error("unsupported node")}}function De(e,t=!1){return gn(e).roots.map(n=>jr(n,!0,t))}function xa(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 mT(e,t){e.replaceChildren(...De(t,!0))}function or(e,t,n){xa(e,t,De(n,!0))}var Jp=Symbol.for("emailmaker.documentWriteGuard"),Pi=Symbol.for("emailmaker.documentWriteSink");function hT(e,t=document){const n=t,r=n[Pi];return n[Pi]=e,()=>{n[Pi]===e&&(n[Pi]=r)}}function PK(e){}function Tu(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0})}function pT(e,t,n){for(let r=e.writerOf.get(t);r;r=e.writerOf.get(r))if(r===n)return!0;return!1}function gT(e,t){let n=t;for(;n.nextSibling&&pT(e,n.nextSibling,t);)n=n.nextSibling;return n}function eg(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,gT(e,t).nextSibling)}},o=e.doc[Pi];o?o(n,r,t):r()}function tg(e,t){return!!e&&e.type===B.ELEMENT&&!e.closed&&e.end===t}function bT(e,t){let n="";for(let r=e;tg(r,t);r=r.lastChild)n=`</${r.tag}>${n}`;return n}function yT(e){const t=gn(e).roots,n=t[t.length-1],r=tg(n,e.length);return{nodes:(r?t.slice(0,-1):t).map(o=>jr(o)),rest:r?e.slice(n.start):""}}function vT(e){const t=[...e.pending];e.pending.clear();for(const[n,r]of t){const o=gn(r).roots,i=r+bT(o[o.length-1],r.length);eg(e,n,gn(i).roots.map(s=>jr(s)))}}function ng(e,t,n){const r=e.doc.currentScript;if(!r?.parentNode){return}const{nodes:o,rest:i}=yT((e.pending.get(r)??"")+n);i?(e.pending.size||queueMicrotask(()=>vT(e)),e.pending.set(r,i)):e.pending.delete(r),eg(e,r,o)}function ET(e=document){const t=e;if(t[Jp])return;t[Jp]=!0;const n={doc:t,writerOf:new WeakMap,pending:new Map};Tu(e,"write",(...r)=>ng(n,"write",r.join(""))),Tu(e,"writeln",(...r)=>ng(n,"writeln",`${r.join("")}
|
|
2
|
-
`)),Tu(e,"open",(...r)=>r.length>=3?e.defaultView?.open(r[0],r[1],r[2])??null:e)}ET();function ST(e){return e}var wT=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),k(this,"cycle",void 0),this.cycle=e}};function CT(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 _T(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 AT(e){const t=CT(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 wT([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of _T(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 Ce=class eA{constructor(t=[]){k(this,"_inner",void 0),k(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof eA&&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 ku(e){return`service_container_${e}`}var Ii=new Set,Lu;function TT(){if(!Lu)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,rg.prototype.getInstanceAsync),e.stack}function Nu(e){Ii.delete(e)&&Lu?.end(e)}var rg=class cp extends Ce{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),k(this,"_parent",void 0),k(this,"_injectCallbacks",[]),k(this,"_injections",Object.create(null)),k(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 Ce){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=TT();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};Ii.add(s),Lu?.start(s),this._onInject(t,()=>{Nu(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(Ii))n.container===this&&(Nu(n),n.reject(t))}pendingWaits(){return[...Ii].filter(t=>t.container===this)}addService(t,n){const r=ku(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new Ce;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=ku(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 Ce;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=ku(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(Ii))t.container===this&&Nu(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function xu(e){return e.startsWith("__")?e:`__${e}__`}function kT(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=xu(e),n=globalThis;return n[t]??(n[t]={})}function LT(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function NT(e){if(e)return xu(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return xu(t)}function Ou(e){const t=NT(e),n=kT(t);if(LT(n.container))return n.container;const r=new rg(null);return n.container=r,r}function xT(){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 OT(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():xT()}function fe(e=OT()){return e}function og(){return"iframe".trim()||"unknown"}function RT(e){if(typeof globalThis>"u")return;const t=og(),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 MT(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function PT(e,t){if(RT(t),typeof globalThis>"u")return e;const n=og(),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 Oa;function IT(){if(Oa)return Oa;const e=MT();return Oa=PT(Ou(e),e),Oa}var IK=new Proxy({},{get(e,t,n){const r=IT(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),DT=new Function("url","return import(url)");function BT(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function Ru(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function ig(e){return e.type==="umd"||e.resolve==="registry"}var HT="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 FT(e){const t=Array.isArray(e)?e[0]:e;return Ru(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function $T(e,t){const n=FT(e),r=Ru(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&ig(r)&&!/compat/iu.test(o)?` ${HT}`:"",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 WT(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function DK(e){return e}var qT=class{constructor(e,t,n={}){k(this,"_context",void 0),k(this,"_pluginRegistry",void 0),k(this,"_options",void 0),k(this,"_map",new Map),k(this,"_optionsMap",new Map),k(this,"_readyMap",new Map),k(this,"_resolveMap",new Map),k(this,"_initializingPlugins",new Map),k(this,"_creatingPlugins",new Set),k(this,"_initializedPlugins",new Set),k(this,"_creationOrder",[]),k(this,"_lifecycleListeners",new Set),k(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(Ru(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(ig(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await DT(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):WT(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=$T(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 BT(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)}))}},zT=class{constructor(){k(this,"_plugins",new Map),k(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)}}}},UT=class{constructor(e){k(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()}},te=fe("SandboxHtmlDocument"),St=fe("SandboxRemoteDocument"),Di=fe("SandboxTextDocument"),bn=fe("SandboxDocumentMapping"),Re=fe("SandboxSyncCommit"),Bi=fe("SandboxLayoutProfile"),Ra=fe("SandboxState"),wo=fe("SandboxAttributePipeline"),Mu=fe("SandboxAmpService"),Pu=fe("SandboxImageReload"),Ma=fe("SandboxImageCache"),ft=fe("SandboxFocus"),Iu=fe("SandboxLocalization"),Fe=fe("SandboxElementSettings"),Nt=fe("SandboxSetCursor"),sg=fe("SandboxStyleRoot"),ag=fe("SandboxVmlWidthResolver"),Pa=fe("SandboxPrepareHtml"),Hi=fe("SandboxSurfaceName"),Co=fe("SandboxDocumentSync"),_o=fe("SandboxMapObj"),Ao=fe("SandboxActiveElementFingerprint"),Ia=fe("SandboxToggleTextStyle"),yn=fe("SandboxWrapEditor"),To=fe("SandboxInsertServices"),Fi=fe("SandboxInitPreview"),Du=fe("SandboxInsertPolicy"),lg=fe("SandboxNarrowTableTextAtom"),cg=fe("SandboxSettingsExtras"),ug=fe("SandboxViewportHandlers"),dg=fe("SandboxOperations"),Da=fe("SandboxApplyElementSettings"),Cr=fe("SandboxOperationEnvironment"),ko=fe("SandboxHostFacts"),VT="__sandbox__",xt=Ou(VT);function jT(e){return e}function GT(e,t=xt){t.inject(Hi,e.name),t.inject(Bi,e.profile);for(const n of AT(e.units))n.setup(t);return t}function vn(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 fg=class extends Ce{constructor(e={}){super(),k(this,"_options",void 0),k(this,"_listeners",[]),k(this,"on",this._addListener.bind(this)),k(this,"event",this._addListener.bind(this)),k(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),k(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()}},XT=class extends fg{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}}},ye=class extends XT{execute([e],t){for(const n of t)try{n(e)}catch{}}},YT=class extends fg{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 KT(e,t,n){let r;const o=new ye({onFirstListenerAdd(){r=o.addDisposable(new Ce),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function ZT(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 QT(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 BK(e){return e}function JT(e){return e&&typeof e=="object"}function mg(e,t){return e&&typeof e=="object"&&e.operationId===t}var Dn="INIT_MESSAGE",ek="em:port-ready",tk="em:window-drained",Bu="";function hg(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var nk=class extends Ce{constructor(...e){super(...e),k(this,"_listeners",Object.create(null)),k(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)}}}),k(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)}}),k(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},rk=class extends Ce{constructor(e,t){super(),k(this,"_singleton",void 0),k(this,"_target",void 0),k(this,"_transport",void 0),k(this,"_transportSubscription",void 0),k(this,"_ports",new Map),k(this,"_drained",new WeakSet),k(this,"_portSendHeld",new WeakSet),k(this,"_inited",!1),k(this,"_emitter",this.addDisposable(new nk)),k(this,"_handshaken",new WeakSet),k(this,"_greeted",new WeakSet),k(this,"_outgoingFilter",void 0),k(this,"_outgoingObservers",new Set),k(this,"_offTargetListeners",new Map),k(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)&&mg(o,Dn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:Dn,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),JT(o)&&l||this._singleton&&mg(o,Dn)){if(s&&l){const f=this._target;Promise.resolve().then(()=>this.usePort(s,!0,f))}const c=this._emitter.fireAsync(o.operationId||Bu,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=ZT({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(Dn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(Dn))}),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(Dn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:Dn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:Dn,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:Dn,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=QT(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:ek,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:tk,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(Bu,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=hg(),o=hg();return new Promise((i,s)=>{const a=this.addDisposable(new Ce);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(Bu,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 Ce);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(Dn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}};function pg(e,t){if(e===t)return;let n=0;const r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;let o=e.length,i=t.length;for(;o>n&&i>n&&e[o-1]===t[i-1];)o--,i--;return{start:n,fromEnd:o,toEnd:i}}function gg(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return{length:e.length,hash:t>>>0}}var ok=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function ik(e){return e.replace(ok,t=>/^<br\b/i.test(t)?" ":"")}var sk={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"},ak=15e3,Hu=3e3,lk="fonts.googleapis.com",ck=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},uk=e=>{const t=ck(String(e??""));return t?t.hostname===lk&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},Le={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"},dk=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 rk(window.parent,!0),Ba,$i,bg=Math.random().toString(36).slice(2,8),fk=0,Ha;function yg(e,t){const n=Ba;Ba=e;try{return t()}finally{Ba=n}}function Fa(e,t){const n=$i;$i=e;try{return t()}finally{$i=n}}function mk(){return $i}function hk(){try{return Ba?.()}catch{return}}function pk(){return Ha||(Ha=`${bg}:${++fk}`,Promise.resolve().then(()=>{Ha=void 0})),Ha}function it(e,t){const n=hk();return K.send(Le.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:$i??"other",batch:pk(),instance:bg}),t}function Fu(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(Fu(e,o)===!1)return!1;return!0}function vg(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function gk(e,t){return vg(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(Fu(e,o[i])===!1)return!1}},t)}function ir(e,t,n){Fu(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(vg(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),gk(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var bk=e=>e.type===B.HTML?e.start-1:e.start,yk=e=>e.type===B.HTML?e.end+1:e.end;function vk(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(bk(o)>=n||yk(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function Ek(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function Eg(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n>0)return t[n-1]}}function _r(e){let t=e;do t=Sk(t);while(t&&t.type===B.HTML&&!t.content);return t}function Sk(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 Gr=class{constructor(e,t,n,r){k(this,"originalStart",void 0),k(this,"originalLength",void 0),k(this,"modifiedStart",void 0),k(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 Sg(e,t){return(t<<5)-t+e|0}function wk(e,t){t=Sg(149417,t);for(let n=0,r=e.length;n<r;n++)t=Sg(e.charCodeAt(n),t);return t}var wg=class{constructor(e){k(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 Cg(e,t,n){return new Ck(new wg(e),new wg(t)).ComputeDiff(n).changes}var Lo=class{static Assert(e,t){if(!e)throw new Error(t)}},No=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]}},_g=class{constructor(){k(this,"m_changes",void 0),k(this,"m_originalStart",void 0),k(this,"m_modifiedStart",void 0),k(this,"m_originalCount",void 0),k(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 Gr(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}},Ck=class Ai{constructor(t,n,r=null){k(this,"ContinueProcessingPredicate",void 0),k(this,"_originalSequence",void 0),k(this,"_modifiedSequence",void 0),k(this,"_hasStrings",void 0),k(this,"_originalStringElements",void 0),k(this,"_originalElementsOrHash",void 0),k(this,"_modifiedStringElements",void 0),k(this,"_modifiedElementsOrHash",void 0),k(this,"m_forwardHistory",void 0),k(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Ai._getElements(t),[a,l,c]=Ai._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(Ai._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=wk(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)?Ai._getStrictElement(this._originalSequence,t)===Ai._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?(Lo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new Gr(t,0,r,o-r+1)]):t<=n?(Lo.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new Gr(t,n-t+1,r,0)]):(Lo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),Lo.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 Gr(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,f,m,h,p,v,w,C){let T=null,y=null,g=new _g,E=n,_=r,b=m[0]-v[0]-o,S=-1073741824,A=this.m_forwardHistory.length-1;do{const L=b+t;L===E||L<_&&c[L-1]<c[L+1]?(d=c[L+1],h=d-b-o,d<S&&g.MarkNextChange(),S=d,g.AddModifiedElement(d+1,h),b=L+1-t):(d=c[L-1]+1,h=d-b-o,d<S&&g.MarkNextChange(),S=d-1,g.AddOriginalElement(d,h+1),b=L-1-t),A>=0&&(c=this.m_forwardHistory[A],t=c[0],E=1,_=c.length-1)}while(--A>=-1);if(T=g.getReverseChanges(),C[0]){let L=m[0]+1,x=v[0]+1;if(T!==null&&T.length>0){const N=T[T.length-1];L=Math.max(L,N.getOriginalEnd()),x=Math.max(x,N.getModifiedEnd())}y=[new Gr(L,f-L+1,x,p-x+1)]}else{g=new _g,E=s,_=a,b=m[0]-v[0]-l,S=1073741824,A=w?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const L=b+i;L===E||L<_&&u[L-1]>=u[L+1]?(d=u[L+1]-1,h=d-b-l,d>S&&g.MarkNextChange(),S=d+1,g.AddOriginalElement(d+1,h+1),b=L+1-i):(d=u[L-1],h=d-b-l,d>S&&g.MarkNextChange(),S=d,g.AddModifiedElement(d+1,h+1),b=L-1-i),A>=0&&(u=this.m_reverseHistory[A],i=u[0],E=1,_=u.length-1)}while(--A>=-1);y=g.getChanges()}return this.ConcatenateChanges(T,y)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,f=0,m=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const h=n-t+(o-r),p=h+1,v=new Int32Array(p),w=new Int32Array(p),C=o-r,T=n-t,y=t-r,g=n-o,E=(T-C)%2===0;v[C]=t,w[T]=n,a[0]=!1;for(let _=1;_<=h/2+1;_++){let b=0,S=0;if(_>100)return null;u=this.ClipDiagonalBound(C-_,_,C,p),d=this.ClipDiagonalBound(C+_,_,C,p);for(let L=u;L<=d;L+=2){L===u||L<d&&v[L-1]<v[L+1]?l=v[L+1]:l=v[L-1]+1,c=l-(L-C)-y;const x=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(v[L]=l,l+c>b+S&&(b=l,S=c),!E&&Math.abs(L-T)<=_-1&&l>=w[L])return i[0]=l,s[0]=c,x<=w[L]&&_<=1448?this.WALKTRACE(C,u,d,y,T,f,m,g,v,w,l,n,i,c,o,s,E,a):null}const A=(b-t+(S-r)-_)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(b,A))return a[0]=!0,i[0]=b,s[0]=S,A>0&&_<=1448?this.WALKTRACE(C,u,d,y,T,f,m,g,v,w,l,n,i,c,o,s,E,a):(t++,r++,[new Gr(t,n-t+1,r,o-r+1)]);f=this.ClipDiagonalBound(T-_,_,T,p),m=this.ClipDiagonalBound(T+_,_,T,p);for(let L=f;L<=m;L+=2){L===f||L<m&&w[L-1]>=w[L+1]?l=w[L+1]-1:l=w[L-1],c=l-(L-T)-g;const x=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(w[L]=l,E&&Math.abs(L-C)<=_&&l<=v[L])return i[0]=l,s[0]=c,x>=v[L]&&_<=1448?this.WALKTRACE(C,u,d,y,T,f,m,g,v,w,l,n,i,c,o,s,E,a):null}if(_<=1447){let L=new Int32Array(d-u+2);L[0]=C-u+1,No.Copy2(v,u,L,1,d-u+1),this.m_forwardHistory.push(L),L=new Int32Array(m-f+2),L[0]=T-f+1,No.Copy2(w,f,L,1,m-f+1),this.m_reverseHistory.push(L)}}return this.WALKTRACE(C,u,d,y,T,f,m,g,v,w,l,n,i,c,o,s,E,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,m=r.modifiedStart-d;if(f<o||m<i||s&&!this.OriginalElementsAreEqual(f,f+r.originalLength)||a&&!this.ModifiedElementsAreEqual(m,m+r.modifiedLength))break;const h=(f===o&&m===i?5:0)+this._boundaryScore(f,r.originalLength,m,r.modifiedLength);h>c&&(c=h,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 m=this._findBetterContiguousSequence(a,c,u,f,s);if(m){const[h,p]=m;(h!==o.originalStart+o.originalLength||p!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=h-o.originalStart,o.modifiedLength=p-o.modifiedStart,i.originalStart=h+s,i.modifiedStart=p+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 m=this._contiguousSequenceScore(d,f,i);m>0&&m>l&&(l=m,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 No.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],No.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return No.Copy(t,0,o,0,t.length),No.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(Lo.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Lo.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 Gr(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 $a(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var qt=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){k(this,"oldPosition",void 0),k(this,"oldText",void 0),k(this,"newPosition",void 0),k(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} "${$a(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${$a(this.oldText)}")`:`(replace@${this.oldPosition} "${$a(this.oldText)}" with "${$a(this.newText)}")`}};function wt(e,t){return e===null||e.length===0?t:new _k(e,t).compress()}var _k=class Er{constructor(t,n){k(this,"_prevEdits",void 0),k(this,"_currEdits",void 0),k(this,"_result",void 0),k(this,"_resultLen",void 0),k(this,"_prevLen",void 0),k(this,"_prevDeltaOffset",void 0),k(this,"_currLen",void 0),k(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]=Er._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=Er._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]=Er._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=Er._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new qt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=Er._merge(this._result);return Er._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=Er._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++]=Er._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 qt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new qt(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 qt(t.oldPosition,t.oldText,t.newPosition,r),new qt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new qt(t.oldPosition,r,t.newPosition,t.newText),new qt(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 qt(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 Ag(e){return new qt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Bn(e){return e.map(Ag)}function Ak(e,t){let n=e;for(let r=t.length-1;r>=0;r-=1){const o=t[r];n=n.slice(0,o.oldPosition)+o.newText+n.slice(o.oldEnd)}return n}function Tk(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 Wa(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=Tk({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new qt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function Tg(e,t,n=0){const r=e.range;return new qt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function xo(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),Tg({text:r,range:{start:o,end:i}},t,s)})}function kk(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function Xr(e){return e.map(t=>kk(t))}function Lk(e,t=Wi(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var HK=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function Nk(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function Wi(e){return{start:0,end:e.getLength()}}function xk(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function qi(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 Ok(e,t){return t=qa(t).sort(({range:n},{range:r})=>n.start-r.start),qi(e,t)}function zi(e,t){return e>=t.start&&e<=t.end}function qa(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(zi(i.start,l)&&zi(i.start,l))c=l;else if(zi(l.start,i))zi(l.end,i)?c=i:c={start:i.start,end:l.end};else if(zi(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 m=xk(u,a.text,{start:d,end:f});e[r]=o={range:i=c,text:m},e.splice(s--,1),n--}}return e}function Rk(e,t){if(e.length<=1)return e[0]||null;e=qa(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:qi(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 Mk(e,t){const n=Bn(e),r=Rk(Xr(n),t);if(r){const o=Tg(r,t);return Ag(o)}return null}function Pk(e,{range:t,text:n}){const r=e.getText(t);return Cg(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 kg({oldText:e,newText:t,oldPosition:n,newPosition:r}){return Cg(e,t,!0).map(o=>new qt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var Ik=class{constructor(e,t){k(this,"index",void 0),k(this,"values",void 0),k(this,"type","insert"),this.index=e,this.values=t}},Dk=class{constructor(e,t){k(this,"index",void 0),k(this,"howMany",void 0),k(this,"type","remove"),this.index=e,this.howMany=t}},Bk=class{constructor(e,t,n){k(this,"from",void 0),k(this,"to",void 0),k(this,"howMany",void 0),k(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function Hk(e,t){return e===t}function Fk(e,t,n=Hk){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,m=0;do s[l++]=a[u++]=!0,m++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new Bk(d,f,m)),l--;break}var h=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var p=l,m=0;l<r&&!s[l++];)m++;h.push(new Dk(p,m))}for(var v=[],u=0;u<o;){if(a[u]){u++;continue}for(var p=u,m=0;u<o&&!a[u++];)m++;var w=t.slice(p,p+m);v.push(new Ik(p,w))}var C=v.length,T=h.length,y=i.length,g,E,_=0;for(g=0;g<T;g++){var b=h[g];for(b.index-=_,_+=b.howMany,E=0;E<y;E++){var S=i[E];S.from>=b.index&&(S.from-=b.howMany)}}for(g=C;g--;){var A=v[g],m=A.values.length;for(E=y;E--;){var S=i[E];S.to>=A.index&&(S.to-=m)}}for(g=y;g-- >1;){var S=i[g];if(S.to!==S.from)for(E=g;E--;){var L=i[E];L.to>=S.to&&(L.to-=S.howMany),L.to>=S.from&&(L.to+=S.howMany)}}var x=[];for(g=0;g<y;g++){var S=i[g];if(S.to!==S.from)for(x.push(S),E=g+1;E<y;E++){var N=i[E];N.from>=S.from&&(N.from-=S.howMany),N.from>=S.to&&(N.from+=S.howMany)}}return[...h,...x,...v]}var Lg=class{constructor(){k(this,"_byKey",new Map),k(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}},le;(function(e){function t(d,f,m){return{type:"Add",node:f,nextSibling:m,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,f,m){return{type:"Attribute",node:d,name:f,value:m}}e.attribute=r;function o(d,f,m){return m?{type:"Update",prev:d,next:f,soft:m}:{type:"Update",prev:d,next:f}}e.update=o;function i(d,f,m,h){return[{type:"Remove",node:d},{type:"Add",node:m,nextSibling:h,parent:f,replaces:d}]}e.recreate=i;function s(d,f,m){return{type:"Move",node:f,nextSibling:m,parent:d}}e.move=s;function a(d,f){return{type:"Set",node:d,data:f}}e.set=a;function l(d,f,m){return{type:"ClassList",node:d,addedClasses:f,removedClasses:m}}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})(le||(le={}));function Ng(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var xg=[],Og=[];function $k(e){return Ng(xg,e)}function $u(e){return e?xg.some(t=>t(e)):!1}function Wk(e){return Ng(Og,e)}function qk(e){return Og.some(t=>t(e))}function zk(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(le.attribute(t,f,void 0))}break}else r[u]!==n[u]&&l.push(le.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(le.attribute(t,u,r[u]))}return l}function Uk(e){let t=[];const n=e.children.filter(o=>o.type!==B.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(le.add(e,n[o],r)),r=n[o];return t}function Vk(e){return le.remove(e)}var jk=new Set(["head","body","html"]),Gk=e=>e.type===B.ROOT||e.type===B.DOCTYPE||e.type===B.ELEMENT&&e.tag&&jk.has(e.tag.toLowerCase()),Xk=/^<[!?/]/;function Wu(e){return e.type===B.ELEMENT?String(e.tag):e.type===B.HTML&&Xk.test(e.content??"")?"bogus":String(e.type)}function za(e){const t=new Lg,n=Object.create(null);for(const r of e){const o=Wu(r)+(!Gk(r)&&r.start===r.end?"_hidden":"");let i="";r.type===B.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Rg(e){const t=[];let n=0;for(const r of[...e].sort((o,i)=>o.oldPosition-i.oldPosition)){const o=r.newLength-r.oldLength,i=t[t.length-1];i&&r.oldPosition<i.oldEnd?(i.oldEnd=Math.max(i.oldEnd,r.oldEnd),i.delta+=o):t.push({oldPosition:r.oldPosition,oldEnd:r.oldEnd,shift:n,delta:o}),n+=o}return t}function Ua(e,t){const n=e[t-1];return t<e.length?e[t].shift:n.shift+n.delta}function qu(e,t){return(e.type===B.HTML?e.end+1:e.end)<=t.oldPosition}function Yk(e,t){return(e.type===B.HTML?e.start-1:e.start)>=t.oldEnd}function zu(e,t,n){return!!t&&t.start===n&&t.type===e.type&&t.tag===e.tag&&t.attributes?.id===e.attributes?.id&&t.end-t.start===e.end-e.start}function Uu(e,t){return t.type===e.type&&Wu(t)===Wu(e)&&t.attributes?.id===e.attributes?.id}function Ui(e,t,n){return nr(e,!1,n)===nr(t,!1,n)}function Vu(e,t,n){let r=t,o=e;for(;r<o;){const i=r+o>>1;n(i)?o=i:r=i+1}return r}function Va(e,t,n=0){return Vu(t.length,n,r=>!Yk(e,t[r]))}function ju(e,t){const n=Va(e,t);return t.slice(n,Ig(e,t,n))}function Mg(e,t){const n=Va(e,t);return n<t.length&&!qu(e,t[n])?void 0:e.start+Ua(t,n)}function ja(e){return e.type===B.ELEMENT?e.attributes?.id:void 0}function Pg(e){const t=new Set,n=new Set;for(const r of e){const o=ja(r);o&&(t.has(o)?n:t).add(o)}return n}function Kk(e,t,n){const r=new Set([...Pg(t),...Pg(n)]),o=new Map;e.forEach((s,a)=>{for(let l=s.prevFrom;l<s.prevTo;l++){const c=ja(t[l]);c&&o.set(c,{node:t[l],gap:a})}});const i=new Map;return e.forEach((s,a)=>{for(let l=s.nextFrom;l<s.nextTo;l++){const c=ja(n[l]),u=c?o.get(c):void 0;c&&u&&u.gap!==a&&!r.has(c)&&Uu(u.node,n[l])&&i.set(c,u.node)}}),i}function Zk(e,t,n){const r=[];let o={prevFrom:0,prevTo:0,nextFrom:0,nextTo:0},i=0,s=0,a=0;const l=(c,u,d)=>{(c>o.prevFrom||u>o.nextFrom)&&r.push({...o,prevTo:c,nextTo:u,edits:n.slice(i,d)})};for(let c=0;c<e.length;c++){const u=e[c];if(s=Va(u,n,s),s<n.length&&!qu(u,n[s]))continue;const d=u.start+Ua(n,s),f=Vu(t.length,a,m=>t[m].start>=d);zu(u,t[f],d)&&(a=f,l(c,a,s),o={prevFrom:c+1,prevTo:c+1,nextFrom:a+1,nextTo:a+1},i=s,a++)}return l(e.length,t.length,n.length),r}function Ig(e,t,n){return Vu(t.length,n,r=>qu(e,t[r]))}function Dg(e,t,n,r,o,i,s){const a=Va(e,o),l=Ig(e,o,a),c=(p,v=()=>!0)=>p?.find(w=>w>=n&&w<r&&Uu(e,t[w])&&v(t[w]))??-1,u=e.start+Ua(o,a),d=e.end+Ua(o,l),f=a===o.length||e.start<o[a].oldPosition,m=f?c(s.byStart.get(u)):-1,h=l>a&&e.end>o[l-1].oldEnd?c(s.byEnd.get(d),p=>!(f&&Jk(e,p,u))):-1;return m>=0&&h>=0&&m!==h?Ui(e,t[m],i)||Ui(e,t[h],i)?Ui(e,t[m],i)?m:h:Hg(e,t[h],o)>Hg(e,t[m],o)?h:m:m>=0?m:h}function Bg(e,t,n){const r=e.get(t);r?r.push(n):e.set(t,[n])}function Qk(e,t,n){const r={byStart:new Map,byEnd:new Map};for(let o=t;o<n;o++)Bg(r.byStart,e[o].start,o),Bg(r.byEnd,e[o].end,o);return r}function Jk(e,t,n){for(let r=t.lastChild;r&&r.end===t.end;r=r.lastChild)if(r.start===n&&Uu(e,r))return!0;return!1}function Hg(e,t,n){const r=new Map(t.children.map(o=>[o.start,o]));return e.children.filter(o=>{const i=Mg(o,n);return i!==void 0&&zu(o,r.get(i),i)}).length}function Fg(e,t){return ju(e,t).reduce((n,r)=>n-Math.max(0,Math.min(e.end,r.oldEnd)-Math.max(e.start,r.oldPosition)),e.end-e.start)}function eL(e,t,n,r,o,i){const s=Ui(e,t,i),a=Ui(n,r,i);return s!==a?a:Fg(n,o)>Fg(e,o)}function tL(e,t,n,r){const o=n.edits??[],i=[],s=[];let{prevFrom:a,prevTo:l,nextFrom:c,nextTo:u}=n;const d=Qk(t,c,u);for(;o.length&&a<l&&c<u;){const f=Dg(e[l-1],t,c,u,o,r,d);if(l-1===a){f>=0&&s.unshift([a,f]);break}const m=Dg(e[a],t,c,u,o,r,d);let h=m>=0,p=f>=0;if(h&&p&&m>=f&&(p=eL(e[a],t[m],e[l-1],t[f],o,r),h=!p),!h&&!p)break;h&&(i.push([a,m]),a++,c=m+1),p&&(s.unshift([l-1,f]),l--,u=f)}return[...i,...s]}function nL(e,t){const n=[];let r=e.prevFrom,o=e.nextFrom;for(const[i,s]of[...t,[e.prevTo,e.nextTo]])(i>r||s>o)&&n.push({prevFrom:r,prevTo:i,nextFrom:o,nextTo:s,edits:e.edits}),r=i+1,o=s+1;return n}function rL(e,t,n,r,o){const i=o?.length?Mg(e,o):void 0;return(i===void 0?void 0:t.children.find(s=>zu(e,s,i)))??r.getByKey(n.getByValue(e)??"")}function Vi(e,t){for(const n of t)e.push(n)}function $g(e,t,n,r,o,i,s,a,l=new Map){const c=[],u=r.prevFrom,d=t.slice(u,r.prevTo),f=n.slice(r.nextFrom,r.nextTo),[m,h]=o??[za(d),za(f)],p=Fk(d,f,(w,C)=>m.getByValue(w)===h.getByValue(C)),v=w=>{const C=ja(w);return C?l.get(C):void 0};for(const w of p)switch(w.type){case"insert":{const C=u+w.index;let T=t[C];for(const y of w.values.reverse()){t.splice(C,0,y),i.add(y);const g=v(y);g?(Vi(c,Ga(g,y,s,a)),c.push(le.move(e,y,T))):c.push(le.add(e,y,T)),T=y}break}case"remove":{const C=t.splice(u+w.index,w.howMany);for(const T of C)v(T)!==T&&c.push(le.remove(T));break}case"move":{const C=t.splice(u+w.from,w.howMany);let T=t[u+w.to];t.splice(u+w.to,0,...C);for(const y of C.reverse()){const g=h.getByKey(m.getByValue(y)??"");if(!g)return it("error while sync",c);i.add(g),Vi(c,Ga(y,g,s,a,r.edits&&ju(y,r.edits))),c.push(le.move(e,g,T)),T=y}break}}return c}function Gu(e,t,n=!1,r=bu(),o){const i=[],s=za(e.children),a=za(t.children);for(let p=e.children.length-1;p>=0;p--){const v=e.children[p];if(v.type===B.ELEMENT&&v.start===v.end){const w=s.getByValue(v);if(!a.getByKey(w)){let C=!1;for(let T=p+1;T<e.children.length;T++){const y=e.children[T];if(y){const g=rL(y,t,s,a,o);if(g){const E=g.start,_=v.clone();t.children.splice(t.children.indexOf(g),0,_),ir(_,E-v.start),_.parent=t,a.set(w,_),C=!0;break}}}if(!C){const T=t.endTagStart===void 0?t.end:t.endTagStart,y=v.clone();t.children.push(y),a.set(w,y),ir(y,T-v.start),y.parent=t}}}}const l=e.children.filter(p=>p.type!==B.HTML||!!p.content),c=t.children.filter(p=>p.type!==B.HTML||!!p.content),u=o?.length?Zk(l,c,o):null,d=u?Kk(u,l,c):new Map,f=new Set;for(const p of u?[...u].reverse():[]){const v=nL(p,tL(l,c,p,r)).reverse();for(const w of v)Vi(i,$g(t,l,c,w,void 0,f,n,r,d))}const m={prevFrom:0,prevTo:l.length,nextFrom:0,nextTo:c.length,edits:o};u||Vi(i,$g(t,l,c,m,[s,a],f,n,r)),c.length!==l.length&&it("error while sync");const h=new Map;for(const p of u??[m])for(let v=p.nextFrom;v<p.nextTo;v++)h.set(v,p.edits);for(let p=c.length-1;p>=0;p--){const v=c[p];if(!f.has(v)){const w=h.get(p);Vi(i,Ga(l[p],v,n,r,w&&ju(l[p],w)))}}return i}function Xu(e){return e.type===B.ELEMENT&&$u(e.tag)}function Ga(e,t,n=!1,r=bu(),o){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(Xu(e)&&e.tag===t.tag){if(nr(e,!1,r)===nr(t,!1,r))return[le.update(e,t,n),...Gu(e,t,!0,r)]}else if((e.type===B.ELEMENT||e.type===B.ROOT)&&e.tag===t.tag)return[le.update(e,t,n),...zk(e,t),...Gu(e,t,n,r,o)];if(e.type===B.HTML||e.type===B.COMMENT)return e.content===t.content?[le.update(e,t,n)]:[le.update(e,t,n),le.set(t,t.content)]}return!e.parent||!t.parent?it("cannot replace document",[]):Xu(e)&&e.tag===t.tag?le.recreate(e,t.parent,t,_r(t)||void 0):[le.remove(e),le.add(t.parent,t,_r(t)||void 0)]}var sr="FROM_DOM",ar="FROM_REMOTE",oL=/<\/.*>/i;function iL(e){return oL.test(e)}var sL=/^<[!?/][^>]*$/,aL=class extends Ce{constructor(e,t){super(),k(this,"_baseDocument",void 0),k(this,"_createRoot",void 0),k(this,"_beforeTextChangeEmitter",this.addDisposable(new ye)),k(this,"_onTextChangeEmitter",this.addDisposable(new ye)),k(this,"_onMutateEmitter",this.addDisposable(new ye)),k(this,"_beforeRefreshEmitter",this.addDisposable(new ye)),k(this,"_onRefreshEmitter",this.addDisposable(new ye)),k(this,"_root",new Et(0,0,[])),k(this,"_applyingMutation",void 0),k(this,"_insertRun",void 0),k(this,"beforeTextChange",this._beforeTextChangeEmitter.event),k(this,"beforeRefresh",this._beforeRefreshEmitter.event),k(this,"onTextChange",this._onTextChangeEmitter.event),k(this,"onRefresh",this._onRefreshEmitter.event),k(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new Et(0,0,[]);n.type=B.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,n){const r=this._root;this._beforeRefreshEmitter.fire();let{roots:o}=gn(e),i=this._root=this._createRoot?this._createRoot(o,e):new Et(0,e.length,o);if(i.type=B.ROOT,this._createRoot||o.forEach(s=>s.parent=i),!t){const s=n&&Rg(n);this._onRefreshEmitter.fire(r?Gu(r,i,!1,void 0,s):Uk(i))}}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=Mk(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),Fa("text",()=>this.replaceWithHtml(n,ar,t))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&_r(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=wa(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,ir(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([le.add(e,t,n||void 0)]),r!=="FROM_REMOTE"&&this._baseDocument.applyEdits(r,[{text:i,range:{start:l,end:l}}])),t}_batchInsert(e,t,n){const r=this._insertRun;if(t.parent||!this.contains(e))return!1;const o=n?n.start:e.endTagStart===void 0?e.end:e.endTagStart,i=e.children,s=n?r?.items[0].node===n?r.start:i.indexOf(n):i.length;if(s<0||r&&r.parent!==e)return!1;const a=s-(r?r.start:s);if(r&&(a<0||a>r.items.length))return!1;const l=wa(t),c=r??(this._insertRun={parent:e,start:s,offset:o,items:[],length:0});return i.splice(s,0,t),t.parent=e,c.items.splice(a,0,{node:t,text:l}),c.length+=l.length,!0}_flushInsertRun(e){const t=this._insertRun;if(!t)return;this._insertRun=void 0;let n=t.offset;for(const{node:r,text:o}of t.items)ir(r,n-r.start),n+=o.length;ir(t.items[t.items.length-1].node,0,t.length),e!=="FROM_REMOTE"&&this._baseDocument.applyEdits(e,[{text:t.items.map(r=>r.text).join(""),range:{start:t.offset,end:t.offset}}])}getContext(e){return e.closest(t=>$u(t.tag))}replaceWithHtml(e,t,n=[e]){const r=this._baseDocument,o=u=>{const d=this.getContext(u);if(d)return d.isDirty=!0,Promise.resolve().then(()=>{d.isDirty=!1}),!1;if(u.type!==B.HTML){if(!u.closed)return!1}else return!u.content||!iL(u.content)&&!sL.test(u.content);return!0};if(!this._root)return this.initialize(r.getText(),!1,n);let i={start:e.oldPosition,end:e.oldEnd},s=vk(i,this._root);if(!s)return this.initialize(r.getText(),!1,n);let a,l,c;do{const u=Nk(e,s);a=this._baseDocument.getText(u),[l,...c]=gn(a).roots}while((!l||c.length||!o(s)||!o(l)||l.end-l.start!==a.length)&&(s=s.parent));if(!s||!s.parent)return this.initialize(r.getText(),!1,n);this.replaceChild(s.parent,{node:l,text:a},s,t,n)}replaceChild(e,t,n,r,o){const{text:i,node:s}=t,a=e.children,l=a.indexOf(n);if(l<0)return it("referenced node is not a child of parent node",s);a.splice(l,1,s);const c=i.length-(n.end-n.start);return s.parent=e,ir(s,n.start-s.start,c),this._baseDocument.getText(s)!==i?(it("Error while sync"),s):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(Ga(n,s,!1,void 0,o&&Rg(o))),n.parent=void 0,s)}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;ir(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([Vk(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=Cp(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=Ek(e),c=s.length-a,u=e.start;ir(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=wa(e,o),l=a.length-s;ir(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=_r(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=gn(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){if(this._applyingMutation=t,t.type==="Add"){const n=t.parent||this.root,r=t.nextSibling||null;this._batchInsert(n,t.node,r)||(this._flushInsertRun(sr),this.insertBefore(n,t.node,r,sr));continue}switch(this._flushInsertRun(sr),t.type){case"Remove":this.remove(t.node,sr);break;case"Set":this.setContent(t.node,t.data,sr);break;case"Hidden":this.setHidden(t.node,t.value,sr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,sr)}}}finally{try{this._flushInsertRun(sr)}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function lL(e,t){return e.replace(new RegExp(`<(?=/${t.tagName}${Sa})`,"gi"),"<")}function Wg(e,t){return Fp(e)??lL(e.textContent??"",t)}function En(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!Dp.has(e.getAttribute("type")??"")}var cL=4,uL=3,dL=80,qg={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},fL={[B.HTML]:"text",[B.ELEMENT]:"element",[B.ROOT]:"root",[B.COMMENT]:"comment",[B.DOCTYPE]:"doctype",[B.ADVANCED]:"advanced"},mL=new Set(["head","body"]);function Yu(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function zg(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,uL);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,dL)}function hL(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return zg(e.tag,Yu(t.id),Yu(t.class),Yu(t.em))}function Ug(e){return e instanceof Element?zg(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function Ku(e,t,n){const r=[];let o=e;for(;o&&r.length<cL;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function pL(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&mL.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==B.ROOT?"outside":t??"top"}function Zu(e,t,n){const r=t(e);return{path:Ku(e,o=>o.parent,hL),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:Ku(r,o=>o.parentNode,Ug)}:{},inMap:!!r,hasParent:!!e.parent,kind:fL[e.type]??String(e.type),root:pL(e)}}function Vg(e,t,n){if(!e)return;const r=i=>Zu(i,t,n);if(e.type==="Update")return{type:qg.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:qg[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 Qu(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===B.ROOT}function gL(e,t,n,r){const o=s=>Zu(s,a=>r.getByNode(a),Qu),i=Ku(e,s=>s.parentNode,Ug);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function bL(e,t){const n=r=>Zu(r,o=>t.getByNode(o),Qu);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function yL(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function jg(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var Gg=Object.create(null);function Xg(e,t){const n=Gg[e]||(Gg[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[yL(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function Hn(e){return e.nodeType===Node.ELEMENT_NODE}function Yg(e){return Hn(e)?e.tagName==="AMP-IMG"?!0:Xg(e.tagName.toLowerCase(),"src"):!1}function Ju(e){return Hn(e)&&!e.ownerSVGElement}function vL(e){return e.tagName==="IMG"}function EL(e){return e.tagName==="FORM"}function SL(e){return e.tagName==="SCRIPT"}function wL(e){return e.tagName==="STYLE"}function ed(e){return e.nodeType===Node.DOCUMENT_NODE}function Kg(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var ji;(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})(ji||(ji={}));function td(e){return e.nodeType===Node.COMMENT_NODE}function Oo(e){return e.nodeType===Node.TEXT_NODE}function CL(e){return e.tagName==="TABLE"}async function _L(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 on(e){if(Hn(e))return Zg(e);if(ed(e))return[...e.childNodes].map(r=>on(r)).join("");if(Kg(e))return jg(e);const t=_a(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function AL(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"&&!Xg(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function Ct(e){let t="";for(const n of e.childNodes)t+=Fp(n)??on(n);return t}function Zg(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=AL(e);return pu.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:wL(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${Ct(e)}</${t}>`}function TL(e){return typeof e=="string"?e:""}function Qg(e,t,n){if(n&&e.type===B.DOCTYPE&&n?.type!==B.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=ka(e,n)?Cu(e.content||""):jr(e,!1,"dormant");t.set(e,r);for(const o of e.children){const i=Qg(o,t,e);r.appendChild(i)}return r}function Ro(e,t,n,r){let o=e,i;for(let s=e.parentNode;s&&s!==t;s=s.parentNode)r?.(s)?i=s.parentNode?{host:s.parentNode,before:s}:void 0:n(s)?i??(i={host:s,before:o}):i=void 0,o=s;return i}function kL(e,t,n=Qu,r=()=>!1,o=()=>!1){let i,s;const a=new Map,l=()=>{const u=Vg(i,d=>t.getByNode(d)||a.get(d),n);return u&&{...u,stage:"dom",...s?{cause:s}:{}}},c=u=>{s=u;try{it("Element node not in tree")}finally{s=void 0}};return yg(l,()=>LL(e,t,a,u=>i=u,c,r,o))}function LL(e,t,n,r,o,i,s){const a=[],l=new Map,c=p=>t.getByNode(p)||n.get(p),u=p=>{if(p){const v=p.lastChild;let w=(v?c(v)?.nextSibling:c(p)?.firstChild)||void 0;for(;w&&l.has(w);)w=w.nextSibling||void 0;return w?.parentNode===c(p)?w:void 0}},d=new Map(e.flatMap(p=>p.type==="Update"?[[p.next,p.prev]]:[])),f=(p,v)=>{for(let w=Eg(p);w;w=Eg(w)){const C=d.get(w),T=c(w)??(C&&c(C));if(T&&!l.has(T)&&v.contains(T)){const y=Ro(T,v,i,s);if(y)return y;let g=T;for(;g.parentNode&&g.parentNode!==v;)g=g.parentNode;return{host:v,before:g}}}},m=p=>!!t.getByElement(p)||i(p)||s(p),h=(p,v,w)=>{const C=f(p,w);if(!C)return{host:w,before:u(v)};let T=C.before.nextSibling??void 0;for(;T&&(l.has(T)||!m(T));)T=T.nextSibling??void 0;return{host:C.host,before:T}};for(const p of e)switch(r(p),p.type){case"Add":{let{node:v,nextSibling:w}=p;const C=v.parent;if(C){const T=Qg(v,n,C);if(C.type===B.ROOT)a.push(le.add(null,T,w&&c(w)));else{const y=c(C);if(y){let g,E=y;for(;w;){const _=n.get(w);if(_){const S=Ro(_,y,i,s);g=S?.before??_,E=S?.host??y;break}let b=t.getByNode(w);if(b&&!l.has(b)&&y.contains(b)){g=b;const S=Ro(b,y,i,s);if(S){E=S.host,g=S.before;break}for(;b.parentNode!==y&&b.parentNode;)b=b.parentNode,Hn(b)&&b.replaceWith(...b.childNodes);break}w=_r(w)||void 0}g||({host:E,before:g}=h(v,C,y)),a.push(le.add(E,T,g))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:v,nextSibling:w}=p;const C=v.parent,T=c(v);if(C&&T)if(C.type===B.ROOT)a.push(le.move(null,T,w&&c(w)));else{const y=c(C);if(y){let g,E=y;for(;w;){const _=n.get(w);if(_){const S=Ro(_,y,i,s);g=S?.before??_,E=S?.host??y;break}let b=t.getByNode(w);if(b&&!l.has(b)&&y.contains(b)){const S=Ro(b,y,i,s);if(S)E=S.host,b=S.before;else for(;b.parentNode!==y&&b.parentNode;)b=b.parentNode;b||it("error while calculating next sibling"),g=b;break}w=_r(w)||void 0}g||({host:E,before:g}=h(v,C,y)),a.push(le.move(E,T,g))}else o("parent-not-mapped")}else o(C?"node-not-mapped":"no-parent");break}case"Remove":{const v=p.node,w=c(v);if(v.type===B.HTML&&!v.content)continue;w?(l.set(w,v),a.push(le.remove(w))):o("node-not-mapped");break}case"Update":{const v=p.prev,w=c(v);w?n.set(p.next,w):p.soft||o("node-not-mapped");break}case"Attribute":{const v=c(p.node);v?a.push(le.attribute(v,p.name,p.value)):o("node-not-mapped");break}case"Set":{const v=p.node,w=c(v);w?v.type===B.HTML&&NL(w,String(p.data??""))||Kg(w)&&v.type===B.DOCTYPE?a.push(le.set(w,p.data||"")):e.push(le.remove(v),le.add(v.parent||null,v,_r(v)||void 0)):o("node-not-mapped");break}}return{mutations:a,toAdd:n,toRemove:l,isService:i}}function NL(e,t){return Oo(e)?!t.includes("<")||En(e.parentNode)||Oo(wr(t)):!1}function xL({mutations:e}){return Vp(e.flatMap(t=>t.type==="Add"?[t.node]:[]))}var OL=["src","type"];function RL({mutations:e}){const t=new Set,n=r=>{r instanceof HTMLScriptElement&&r.isConnected&&!Na(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"&&OL.includes(r.name.toLowerCase())&&n(r.node);return[...t]}function ML(e,t,n){const r=e.data,o=Math.min(r.length,t.length),i=e.ownerDocument.getSelection(),s=!!i?.isCollapsed&&i.anchorNode===e&&i.anchorOffset===0&&t.length>r.length&&t.endsWith(r);let a=0;for(;!s&&a<o&&r[a]===t[a];)a++;let l=0;for(;l<o-a&&r[r.length-1-l]===t[t.length-1-l];)l++;const c=r.length-a-l,u=t.slice(a,t.length-l),d=!!i?.isCollapsed&&i.anchorNode===e&&i.anchorOffset>=a&&i.anchorOffset<=a+c,f=d&&n.get(e)===i.anchorOffset;e.replaceData(a,c,u),u&&i?.anchorNode!==e&&n.set(e,a),d&&i.collapse(e,f?a:a+u.length)}function Jg(e){const t=e.ownerDocument?.getSelection();return t?.anchorNode&&e.contains(t.anchorNode)?t:null}function PL(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 IL(e,t,n){const r=Jg(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 DL(e){return!!e&&e.prev!==e.next&&e.prev.at(-1)!==e.next.at(-1)}function BL(e){return!!e&&e.next.length>e.prev.length&&e.next.endsWith(e.prev)}function nd(e,t,n,r){let o;for(let i=t?e.previousSibling:e.nextSibling;i;i=t?i.previousSibling:i.nextSibling){if(n?.has(i))continue;const s=PL(i,t),a=s?.parentElement?.closest("a")??s?.parentElement?.closest("em-replace");if(!s&&o)break;if(!s){o=i;continue}if(o&&!(t&&i===s&&DL(r?.get(s))))break;return a&&i.contains(a)?{beside:a}:{text:s}}return o?{beside:o}:null}function eb(e,t,n){const r=t.parentNode;r&&e.collapse(r,[...r.childNodes].indexOf(t)+(n?1:0))}function HL(e,t,{removed:n,rewrites:r}){const o=Jg(e),i=o&&nd(e,!0,n,r),s=o&&!i?nd(e,!1,n,r):null;if(e.parentNode?.removeChild(e),!!o)try{if(i?.text){const a=t.get(i.text)??i.text.length;t.set(i.text,a),o.collapse(i.text,a)}else{if(i)return eb(o,i.beside,!0),i.beside.nodeName==="BR"?i.beside:void 0;s?.text?o.collapse(s.text,0):s&&eb(o,s.beside,!1)}}catch{}}function FL(e){const t=e.ownerDocument?.getSelection(),{anchorNode:n,anchorOffset:r}=t??{};return!!t?.isCollapsed&&n===e.parentNode&&n?.childNodes[(r??0)-1]===e}function tb(e,t,{removed:n,moved:r,edited:o,rewrites:i}){if(e.nodeType!==Node.ELEMENT_NODE)return{node:e,offset:t};const[s,a]=[e.childNodes[t-1],e.childNodes[t]];return![s,a].some(l=>l&&n.has(l))||s&&r.has(s)?{node:e,offset:t}:s?.nodeType===Node.TEXT_NODE?{node:s,offset:s.length}:(!s||n.has(s))&&a?.nodeType===Node.TEXT_NODE&&!r.has(a)&&(!o.has(a)||BL(i.get(a)))&&(!n.has(a)||nd(a,!0,n,i)?.text)?{node:a,offset:0}:{node:e,offset:t}}function $L(e,t){const n=e?.getSelection(),{anchorNode:r,anchorOffset:o,focusNode:i,focusOffset:s}=n??{};if(!(!n||!r||!i||!t.removed.size)&&!/^(INPUT|TEXTAREA)$/.test(e?.activeElement?.tagName??""))try{const a=tb(r,o??0,t),l=tb(i,s??0,t);(a.node!==r||l.node!==i)&&n.setBaseAndExtent(a.node,a.offset,l.node,l.offset)}catch{}}function nb(e,t,n){if(t?.parentNode===e)return[e,t];const r=t&&n?Ro(t,e,n):void 0;return r&&e.contains(r.host)?[r.host,r.before]:[e,null]}function WL(e){const t=new Map;for(const n of e)n.type==="Set"&&n.node instanceof Text&&!En(n.node.parentNode)&&t.set(n.node,{prev:n.node.data,next:wr(String(n.data??"")).textContent??""});return t}function qL({mutations:e,toAdd:t,toRemove:n,isService:r},o,i){const s=f=>new Set(e.flatMap(m=>m.type===f?[m.node]:[])),a=s("Remove"),l={removed:a,moved:s("Move"),edited:s("Set"),rewrites:WL(e)};$L([...a].find(f=>f.ownerDocument)?.ownerDocument,l);const c=(f,m,h)=>{if(!f)return it("Element node not in tree");if(!(f instanceof Element))return it("node is not HTMLEement");const p=h===void 0?void 0:Wp(f,m,TL(h));if(!(m.toLowerCase()==="type"&&iT(f,p??null)))try{p!=null?rr(f,m,p):f.removeAttribute(m)}catch{}},u=new Map;let d;for(const f of e)switch(f.type){case"Add":{const{node:m,nextSibling:h,parent:p}=f;if(p){const[v,w]=nb(p,h,r);v.insertBefore(m,w)}break}case"Move":{const{node:m,nextSibling:h,parent:p}=f;if(p){const[v,w]=nb(p,h,r);IL(v,m,w)}break}case"Remove":{const{node:m}=f;if(m instanceof Document)for(const h of[...m.childNodes])h.parentNode?.removeChild(h);else d=HL(m,u,l)??d;break}case"Attribute":c(f.node,f.name,f.value);break;case"Set":{const{node:m,data:h}=f;if(m instanceof Comment)m.data=h;else if(m instanceof Text){const p=String(h??"");En(m.parentNode)?GA(m,p):ML(m,wr(p).textContent??"",u)}break}}for(const[f,m]of n)o.remove(m);for(const[f,m]of t){const h=o.getByElement(m);h&&o.remove(h),o.set(f,m)}if(i&&d?.isConnected&&FL(d))try{i(d)}catch{}}var zL=class{constructor(){k(this,"_byKey",new WeakMap),k(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))}},UL=class{constructor(){k(this,"_map",new zL)}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 rb(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function VL(e){let t;for(let n=e;n;n=n.parent)Xu(n)&&(t=n);return t}function jL(e){return e.type==="Update"?e.prev:e.node}function GL(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=VL(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=jL(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(rb(i,l)||rb(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...le.recreate(c,l.parent,l,_r(l)||void 0));break}}a||r.push(o)}return r}var rd;(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})(rd||(rd={}));var Xa=new Set;function Ar(e,t){Xa.has(e)||(Xa.size||Promise.resolve().then(()=>Xa.clear()),Xa.add(e),K.send(Le.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var ob=new WeakMap;function XL(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 YL(e){return{added:e,removed:[],reparented:[],reordered:[]}}function KL(e,t){let n=ob.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=XL(o),n={added:o,removed:i},ob.set(e,n)}return n}function ib(e,t){const n={};for(const[r,o]of Object.entries(t))n[r]={value:o,enumerable:!0};return Object.create(e,n)}function sb(e){return new Set((e??"").split(/\s+/).filter(Boolean))}function ZL(e,t){const n=i=>{for(let s=i;s&&!t.isMapped(s);s=s.parentNode)if(s instanceof Element&&t.isServicePanel(s))return!0;return!1},r=i=>t.isWrapper(i)||n(i),o=[];return{summaries:e.map(i=>{const s=new Set(i.added.filter(r));return o.push(...[...s].filter(a=>!a.parentNode||!s.has(a.parentNode))),ib(i,{added:i.added.filter(a=>!s.has(a)),reparented:i.reparented?.filter(a=>!n(a)),reordered:i.reordered?.filter(a=>!n(a)),characterDataChanged:i.characterDataChanged?.filter(a=>!n(a)),attributeChanged:QL(i,t,r)})}),service:o}}function QL(e,t,n){const r={};for(const[o,i]of Object.entries(e.attributeChanged??{})){if(t.isServiceAttribute(o))continue;const s=i.filter(a=>!n(a)&&!(o==="class"&&JL(e,a,t)));s.length&&(r[o]=s)}return r}function JL(e,t,n){const r=sb(e.getOldAttribute(t,"class")),o=sb(t.getAttribute("class")),i=[...r,...o].filter(s=>r.has(s)!==o.has(s));return i.length>0&&i.every(s=>n.isServiceClass(s))}var ab=Object.getPrototypeOf(customElements),eN=Reflect.get(ab,"define"),od=new ye,id=new ye,tN=od.event,nN=id.event,rN=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function oN(e){od.fire();try{return e()}finally{id.fire()}}ab.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){od.fire();try{super(...i)}finally{id.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of rN){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return oN(()=>s.call(this,...a))}})}eN.call(this,e,o,n)};function lb(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,lb(s,t,n,i));return i}function Mo(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])Mo(r,t,e)}var lr="___em-internal";function sd(e,t=!0,n=!1){let r=e.content;switch(e.type){case B.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(sd(i,t,n));return o}case B.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case B.COMMENT:return document.createComment(r||"");case B.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=gu(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{rr(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(ka(i,e)?Cu(i.content||""):sd(i,t,n));return o}return document.createTextNode("<");case B.HTML:return wr(r||"");default:throw new Error("unsupported node")}}function iN(e){return gn(e).roots.map(t=>sd(t,!0,!0))}function cb(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function sN(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 cb();default:t=document.createElement("div")}return t}function aN(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function Ya(e){if(e instanceof Element)return Zg(e);if(e instanceof Document)return[...e.childNodes].map(r=>Ya(r)).join("");if(e instanceof DocumentType)return aN(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(r=>Ya(r)).join("");const t=_a(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function ub(e,t=e.parentNode){return En(t)?Wg(e,t):Ya(e)}function lN(e,t,n){let r=1;const o=new Lg,i=new Map,s=new Map,a=new Map;let l=!1;const c=lb(e,m=>{const h=String(r++);let p;if(Yg(m)||m instanceof Element&&m.hasAttribute("src")){const v=document.createElement(m.tagName);for(const{name:w,value:C}of m.attributes){const T=qp(m,w,C);T!==null&&rr(v,w==="src"?"___src":w,T)}p=v}else p=m.cloneNode(),yN(m,p);if(p)p instanceof DocumentType&&(l=!0),a.set(p,h),i.set(m,h);else return document.createDocumentFragment();return p},(m,h)=>m&&h&&m.appendChild(h));let u=l?cb():document.createDocumentFragment();u.appendChild(c),Mo(u,(m,h)=>{if(h){const p=a.get(m);if(En(h))return;if(!p)return it("Error while mapping: not found element");m instanceof Element?m.setAttribute(lr,p):h.insertBefore(document.createComment(`${lr}${p}`),m)}});let d=iN(t(u)).filter(m=>!!m),f;if(!d.length)return o;if(u instanceof Document){const m=sN("html");for(const h of d)m.appendChild(h);f=m}else{f=document.createDocumentFragment();for(const m of d)f.appendChild(m)}return Mo(f,(m,h)=>{let p=null;if(m instanceof HTMLHtmlElement)s.set("1",m);else{if(m instanceof Element&&m.hasAttribute(lr)){p=m.getAttribute(lr),p&&s.set(p,m);return}const v=m.previousSibling;if(v instanceof Comment&&(!(m instanceof Comment)||m.data.indexOf(lr)<0)){const w=v.data,C=w.indexOf(lr);C>=0&&(p=w.substring(C+14),p&&s.set(p,m))}}}),Mo(f,m=>{if(m instanceof Element&&m.hasAttribute(lr)){m.removeAttribute(lr);return}m instanceof Comment&&m.data.indexOf(lr)>=0&&m.remove()}),Mo(e,m=>{const h=i.get(m),p=s.get(h);p&&(o.set(m,p),En(m)&&m.firstChild&&p.firstChild&&o.set(m.firstChild,p.firstChild))}),o}function cN(e){const t=db(e.cloneNode()),n=yu(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=B.ELEMENT,t}var Po;(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})({})})(Po||(Po={}));function db(e){if(Oo(e)&&En(e.parentNode))return fb(Wg(e,e.parentNode));const t=_a(e);if(t!==void 0)return fb(t);let n=gn(Ya(e.cloneNode())).roots[0];return n||(n=new Et(0,0,[]),n.type=B.HTML,n.content=""),n}function fb(e){const t=new Et(0,e.length,[]);return t.type=B.HTML,t.content=e,t}function mb(e,t=Po.HiddenResult.node){if(t&Po.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&Po.HiddenResult.children)for(const n of e.children)mb(n,Po.HiddenResult.all)}function uN(e,t=[],n){let r;return e instanceof Element?r=cN(e):r=db(e),r.children=t,r.parent=void 0,n&&mb(r,n(r)),r}function ad(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=ad(o,t,n),r)return r}function hb(e,t,n,r){Ar("tree-node-out-of-place",()=>({mutation:n()}))}function pb(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(hb("insertBefore",c,()=>gL(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=ad(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=ad(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function dN(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(le.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function gb(e,t){return e.type===B.HTML?_a(t)??`<!--${t.data}-->`:t.data}function fN(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(le.set(i,td(o)?gb(i,o):ub(o)))}return n}function mN(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function hN(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 pN(e,t,n,r){const o=s=>{let a=s.parentNode;if(!a||a===n?.node||t.getByElement(a))return!1;for(;a&&a!==n?.node&&!t.getByElement(a);a=a.parentNode)if(!r(a))return!1;return!0},i=new Set;for(const s of TN(e)){const a=t.getByElement(s),l=a?.parent?.children,c=a&&l?l.indexOf(a):-1;if(!a||!l||c<0||!o(s))continue;const{parentTreeNode:u,nextSiblingTreeNode:d}=pb(s,t,n)||{};u===a.parent&&d===l[c+1]&&i.add(s)}return i}function gN(e,t,n,r=new Set){const o=[],i=new Set,s=new Map,a=(l,c)=>{const u=s.get(l);return u?u===c:l.parent===c&&c.children.includes(l)};for(const l of e){const{added:c,removed:u}=KL(l,d=>!!t.getByElement(d));for(const d of u)if(!i.has(d)&&!r.has(d)){const f=t.getByElement(d);if(f){const m=s.get(f)??f.parent;!m||!a(f,m)?hb("remove",f,()=>bL(f,t)):o.push(le.remove(f)),s.delete(f),i.add(d)}}for(const d of c){if(r.has(d)||hN(d))continue;const f=mN(d);if(f&&!t.getByElement(f))continue;const{parentTreeNode:m,nextSiblingTreeNode:h}=pb(d,t,n,p=>i.has(p),a)||{};if(m){let p=t.getByElement(d);p||(p=uN(d),t.set(p,d)),o.push(le.add(m,p,h)),s.set(p,m),i.delete(d)}}o.push(...dN(l,t)),o.push(...fN(l,t))}return o}function bN(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(le.attribute(e,a,c))}else r.push(le.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(le.attribute(e,a,s.value))}return r}function yN(e,t){if(!(!YA()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=qp(e,n,r);o===null?t.removeAttribute(n):o!==r&&rr(t,n,o)}}function vN(e,t,n,r=()=>!1){const o=[],i=lN(e,n,t);return Mo(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(...bN(a,s,l))}else if(l instanceof CharacterData){if(!(s instanceof CharacterData))return it("Element mapped to CharacterData");const c=En(s.parentNode)&&(s.parentNode?.nodeName==="SCRIPT"||!r(s));l.data!==s.data&&!c&&o.push(le.set(a,td(l)?gb(a,l):ub(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(le.hidden(a,!0)),u=!1):o.push(le.hidden(a,!1)),u}}),o}function EN(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 SN(e){return[...new Set(e)]}function wN(e,t){return SN([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>EN(n,t)||n))}function CN(e,t){let n=[];for(const r of e){const o=wN(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 _N(e,t,n){const r=CN(e,t),o=AN(e);return r.flatMap(i=>vN(i,t,n,o))}function AN(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 TN(e){return e.flatMap(t=>[...t.reparented??[],...t.reordered??[]])}function kN(e,t){return ib(e,{reparented:e.reparented?.filter(n=>!t.has(n)),reordered:e.reordered?.filter(n=>!t.has(n))})}function LN(e,t,n,r,o=()=>!1){const i=pN(e,t,r,o),s=i.size?e.map(a=>kN(a,i)):e;return[...gN(e,t,r,i),..._N(s,t,n)]}function NN(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 xN=class{constructor(){k(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))}},bb=class{constructor(e=10){k(this,"_max",void 0),k(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}},yb=new bb(1e3);function Io(e){if(e=e?.trim(),e){let t=yb.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),yb.put(e,t)),t}else return new Set}function Ka(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var vb=new bb(1e3);function Gi(e){e||(e="");let t=vb.get(e);return t||(t=Ka(e),vb.put(e,t)),t}function ON(e,t,n){const r=e?e.split(" "):[],o=Io(n),i=Io(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function RN(e,t,n){const r=Ka(e),o=Gi(n),i=Gi(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 Eb(e,t,n,r){return typeof r!="string"?t:e==="class"?ON(t,n,r)||null:e==="style"?RN(t,n,r)||null:n!==t&&t===r?null:t}function MN(e,t){const n=Io(e),r=Io(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function PN(e,t){const n=Ka(e),r=Gi(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 IN(e,t,n){return typeof n!="string"?t:e==="class"?MN(t,n)||null:e==="style"?PN(t,n)||null:t}function DN(e,t,n){if(!t)return t;const r=Io(e),o=Io(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 BN(e,t,n){if(!t)return t;const r=Gi(e),o=Ka(t),i=Gi(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 Sb(e){return e.type===B.ELEMENT&&e.start!==e.end}function wb(e){return e.filter(t=>t.type===B.ELEMENT)}function HN(e,t,n){const r=wb(e),o=wb(t),i=[],s=new Set,a=new Set,l=u=>{const d=(m,h)=>{const p=new Map;for(const v of m){const w=h.has(v)?void 0:u(v);w!==void 0&&p.set(w,p.has(w)?null:v)}return p},f=d(r,s);for(const[m,h]of d(o,a)){const p=f.get(m);h&&p&&(i.push([p,h,!0]),s.add(p),a.add(h))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>nr(u,!1,n)),l(u=>nr(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=h=>h.filter(p=>p.tag===u),f=d(r).filter(h=>!s.has(h)),m=d(o).filter(h=>!a.has(h));if(f.length===m.length&&d(r).length===d(o).length){const h=f.length===1&&!f[0].attributes?.id&&!m[0].attributes?.id;m.forEach((p,v)=>i.push([f[v],p,h]))}}return i}var FN=class{constructor(e,t,n,r){k(this,"element",void 0),k(this,"name",void 0),k(this,"nextValue",void 0),k(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},$N=class{constructor(e){k(this,"_nodeMap",void 0),k(this,"_map",new xN),k(this,"_hiddenMutations",[]),k(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=DN(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=BN(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 FN(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=Eb(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r));if(s!==i){t.push(le.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=Eb(i,s,null,a);l!==s&&t.push(le.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=IN(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(le.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,bu());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&&!$u(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))qk(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&&nr(e,!1,r)===nr(t,!1,r)){const i=t.children.filter(Sb);e.children.filter(Sb).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of HN(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)}}}},WN=class{constructor(e){k(this,"_isMapped",void 0),k(this,"_foreign",new WeakSet),k(this,"_movedTo",new WeakMap),k(this,"_output",new WeakSet),k(this,"_service",new WeakSet),k(this,"_wrappers",new WeakSet),k(this,"_outer",new WeakSet),k(this,"_hasForeign",!1),k(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)}markWrapper(e){this._wrappers.add(e)}isWrapper(e){return this._wrappers.has(e)}forgetService(e){this._service.delete(e)}markOuterWrapper(e){this._outer.add(e)}isOuterWrapper(e){return this._outer.has(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)}},Cb="foreign-structure-in-commit";function qN(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 Za(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var _b="implicit-tbody-in-canvas";function zN(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 UN(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:Za(n),parent:n.parentNode?Za(n.parentNode):void 0};t.add(_b),Ar(_b,()=>({foreign:r}))}function VN(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:Za(n.node),parent:n.node.parentNode?Za(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(Cb),Ar(Cb,()=>({foreign:o})))}var ld="unaccounted-node";function Ab(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 Tb(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 Ab(e,t,n,r||t.roots.has(e))}function kb(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=Ab(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 jN(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 GN(e,t){const n=new Set;for(const r of e)r.isConnected&&Tb(r,t)==="unaccounted"&&n.add(r);return[...n].filter(r=>!r.parentNode||!n.has(r.parentNode))}function XN(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 Lb(e){const t=[];for(let o=e;o&&o.nodeType!==Node.DOCUMENT_NODE;o=o.parentNode)t.unshift(XN(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 Nb(e,t){if(!e.length)return;const n={count:e.length,node:Lb(e[0])};t.has(ld)||(t.add(ld),Ar(ld,()=>({unaccounted:n})))}var YN=Sr(((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 y(){this._nodes=[],this._values=[]}return y._isIndex=function(g){return+g===g>>>0},y._nodeId=function(g){var E=g[y._ID_PROP];return E||(E=g[y._ID_PROP]=y._NEXT_ID++),E},y.prototype.set=function(g,E){var _=y._nodeId(g);this._nodes[_]=g,this._values[_]=E},y.prototype.get=function(g){var E=y._nodeId(g);return E!==void 0?this._values[E]:void 0},y.prototype.has=function(g){return y._nodeId(g)in this._nodes},y.prototype.delete=function(g){var E=y._nodeId(g);delete this._nodes[E],this._values[E]=void 0},y.prototype.keys=function(){var g=[];for(var E in this._nodes)y._isIndex(E)&&g.push(this._nodes[E]);return g},y._ID_PROP="__mutation_summary_node_map_id__",y._NEXT_ID=1,y})(),o=(function(){function y(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return y})();n.Movement=void 0,(function(y){y[y.STAYED_OUT=0]="STAYED_OUT",y[y.ENTERED=1]="ENTERED",y[y.STAYED_IN=2]="STAYED_IN",y[y.REPARENTED=3]="REPARENTED",y[y.REORDERED=4]="REORDERED",y[y.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(y,g){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,_){E.__proto__=_}||function(E,_){for(var b in _)Object.prototype.hasOwnProperty.call(_,b)&&(E[b]=_[b])},i(y,g)};function s(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");i(y,g);function E(){this.constructor=y}y.prototype=g===null?Object.create(g):(E.prototype=g.prototype,new E)}var a=(function(){function y(g,E,_,b,S,A,L,x){E===void 0&&(E=!1),_===void 0&&(_=!1),b===void 0&&(b=!1),S===void 0&&(S=null),A===void 0&&(A=!1),L===void 0&&(L=null),x===void 0&&(x=null),this.node=g,this.childList=E,this.attributes=_,this.characterData=b,this.oldParentNode=S,this.added=A,this.attributeOldValues=L,this.characterDataOldValue=x,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return y.prototype.getAttributeOldValue=function(g){if(this.attributeOldValues)return this.isCaseInsensitive&&(g=g.toLowerCase()),this.attributeOldValues[g]},y.prototype.getAttributeNamesMutated=function(){var g=[];if(!this.attributeOldValues)return g;for(var E in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(E)&&g.push(E);return g},y.prototype.attributeMutated=function(g,E){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(g in this.attributeOldValues)&&(this.attributeOldValues[g]=E)},y.prototype.characterDataMutated=function(g){this.characterData||(this.characterData=!0,this.characterDataOldValue=g)},y.prototype.removedFromParent=function(g){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=g},y.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},y.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},y})(),l=(function(y){s(g,y);function g(E,_){var b=y.call(this)||this;b.rootNode=E,b.reachableCache=void 0,b.wasReachableCache=void 0,b.anyParentsChanged=!1,b.anyAttributesChanged=!1,b.anyCharacterDataChanged=!1;for(var S=0;S<_.length;S++){var A=_[S];switch(A.type){case"childList":b.anyParentsChanged=!0;for(var L=0;L<A.removedNodes.length;L++){var x=A.removedNodes[L];b.getChange(x).removedFromParent(A.target)}for(var L=0;L<A.addedNodes.length;L++){var x=A.addedNodes[L];b.getChange(x).insertedIntoParent()}break;case"attributes":b.anyAttributesChanged=!0;var N=b.getChange(A.target);N.attributeMutated(A.attributeName,A.oldValue);break;case"characterData":b.anyCharacterDataChanged=!0;var N=b.getChange(A.target);N.characterDataMutated(A.oldValue)}}return b}return g.prototype.getChange=function(E){var _=this.get(E);return _||(_=new a(E),this.set(E,_)),_},g.prototype.getOldParent=function(E){var _=this.get(E);return _?_.getOldParent():E.parentNode},g.prototype.getIsReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.reachableCache=this.reachableCache||new r;var _=this.reachableCache.get(E);return _===void 0&&(_=this.getIsReachable(E.parentNode),this.reachableCache.set(E,_)),_},g.prototype.getWasReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.wasReachableCache=this.wasReachableCache||new r;var _=this.wasReachableCache.get(E);return _===void 0&&(_=this.getWasReachable(this.getOldParent(E)),this.wasReachableCache.set(E,_)),_},g.prototype.reachabilityChange=function(E){return this.getIsReachable(E)?this.getWasReachable(E)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.getWasReachable(E)?n.Movement.EXITED:n.Movement.STAYED_OUT},g})(r),c=(function(){function y(g,E,_,b,S){this.rootNode=g,this.mutations=E,this.selectors=_,this.calcReordered=b,this.calcOldPreviousSibling=S,this.treeChanges=new l(g,E),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 y.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var g=this.treeChanges.keys(),E=0;E<g.length;E++)this.visitNode(g[E],void 0)},y.prototype.visitNode=function(g,E){if(!this.visited.has(g)){this.visited.set(g,!0);var _=this.treeChanges.get(g),b=E;if((_&&_.childList||b==null)&&(b=this.treeChanges.reachabilityChange(g)),b!==n.Movement.STAYED_OUT){if(this.matchabilityChange(g),b===n.Movement.ENTERED)this.entered.push(g);else if(b===n.Movement.EXITED)this.exited.push(g),this.ensureHasOldPreviousSiblingIfNeeded(g);else if(b===n.Movement.STAYED_IN){var S=n.Movement.STAYED_IN;_&&_.childList&&(_.oldParentNode!==g.parentNode?(S=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(g)):this.calcReordered&&this.wasReordered(g)&&(S=n.Movement.REORDERED)),this.stayedIn.set(g,S)}if(b!==n.Movement.STAYED_IN)for(var A=g.firstChild;A;A=A.nextSibling)this.visitNode(A,b)}}},y.prototype.ensureHasOldPreviousSiblingIfNeeded=function(g){if(this.calcOldPreviousSibling){this.processChildlistChanges();var E=g.parentNode,_=this.treeChanges.get(g);_&&_.oldParentNode&&(E=_.oldParentNode);var b=this.childListChangeMap.get(E);b||(b=new o,this.childListChangeMap.set(E,b)),b.oldPrevious.has(g)||b.oldPrevious.set(g,g.previousSibling)}},y.prototype.getChanged=function(g,E,_){this.selectors=E,this.characterDataOnly=_;for(var b=0;b<this.entered.length;b++){var S=this.entered[b],A=this.matchabilityChange(S);(A===n.Movement.ENTERED||A===n.Movement.STAYED_IN)&&g.added.push(S)}for(var L=this.stayedIn.keys(),b=0;b<L.length;b++){var S=L[b],A=this.matchabilityChange(S);if(A===n.Movement.ENTERED)g.added.push(S);else if(A===n.Movement.EXITED)g.removed.push(S);else if(A===n.Movement.STAYED_IN&&(g.reparented||g.reordered)){var x=this.stayedIn.get(S);g.reparented&&x===n.Movement.REPARENTED?g.reparented.push(S):g.reordered&&x===n.Movement.REORDERED&&g.reordered.push(S)}}for(var b=0;b<this.exited.length;b++){var S=this.exited[b],A=this.matchabilityChange(S);(A===n.Movement.EXITED||A===n.Movement.STAYED_IN)&&g.removed.push(S)}},y.prototype.getOldParentNode=function(g){var E=this.treeChanges.get(g);if(E&&E.childList)return E.oldParentNode?E.oldParentNode:null;var _=this.treeChanges.reachabilityChange(g);if(_===n.Movement.STAYED_OUT||_===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return g.parentNode},y.prototype.getOldPreviousSibling=function(g){var E=g.parentNode,_=this.treeChanges.get(g);_&&_.oldParentNode&&(E=_.oldParentNode);var b=this.childListChangeMap.get(E);if(!b)throw Error("getOldPreviousSibling requested on invalid node.");return b.oldPrevious.get(g)},y.prototype.getOldAttribute=function(g,E){var _=this.treeChanges.get(g);if(!_||!_.attributes)throw Error("getOldAttribute requested on invalid node.");var b=_.getAttributeOldValue(E);if(b===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return b},y.prototype.attributeChangedNodes=function(g){if(!this.treeChanges.anyAttributesChanged)return{};var E,_;if(g){E={},_={};for(var b=0;b<g.length;b++){var S=g[b];E[S]=!0,_[S.toLowerCase()]=S}}for(var A={},L=this.treeChanges.keys(),b=0;b<L.length;b++){var x=L[b],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 $=x,R=N.getAttributeNamesMutated(),I=0;I<R.length;I++){var S=R[I];E&&!E[S]&&!(N.isCaseInsensitive&&_[S])||N.getAttributeOldValue(S)!==$.getAttribute(S)&&(_&&N.isCaseInsensitive&&(S=_[S]),A[S]=A[S]||[],A[S].push($))}}return A},y.prototype.getOldCharacterData=function(g){var E=this.treeChanges.get(g);if(!E||!E.characterData)throw Error("getOldCharacterData requested on invalid node.");return E.characterDataOldValue},y.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var g=this.treeChanges.keys(),E=[],_=0;_<g.length;_++){var b=g[_];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(b)){var S=this.treeChanges.get(b);!S.characterData||b.textContent==S.characterDataOldValue||E.push(b)}}return E},y.prototype.computeMatchabilityChange=function(g,E){this.matchCache||(this.matchCache=[]),this.matchCache[g.uid]||(this.matchCache[g.uid]=new r);var _=this.matchCache[g.uid],b=_.get(E);return b===void 0&&(b=g.matchabilityChange(E,this.treeChanges.get(E)),_.set(E,b)),b},y.prototype.matchabilityChange=function(g){var E=this;if(this.characterDataOnly)switch(g.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(g.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var _=g,b=this.selectors.map(function(L){return E.computeMatchabilityChange(L,_)}),S=n.Movement.STAYED_OUT,A=0;S!==n.Movement.STAYED_IN&&A<b.length;){switch(b[A]){case n.Movement.STAYED_IN:S=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:S===n.Movement.EXITED?S=n.Movement.STAYED_IN:S=n.Movement.ENTERED;break;case n.Movement.EXITED:S===n.Movement.ENTERED?S=n.Movement.STAYED_IN:S=n.Movement.EXITED}A++}return S},y.prototype.getChildlistChange=function(g){var E=this.childListChangeMap.get(g);return E||(E=new o,this.childListChangeMap.set(g,E)),E},y.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var g=function(b){var S=E.mutations[b];if(S.type!="childList"||E.treeChanges.reachabilityChange(S.target)!==n.Movement.STAYED_IN&&!E.calcOldPreviousSibling)return"continue";for(var A=E.getChildlistChange(S.target),L=S.previousSibling,x=function(R,I){!R||A.oldPrevious.has(R)||A.added.has(R)||A.maybeMoved.has(R)||I&&(A.added.has(I)||A.maybeMoved.has(I))||A.oldPrevious.set(R,I)},N=0;N<S.removedNodes.length;N++){var $=S.removedNodes[N];x($,L),A.added.has($)?A.added.delete($):(A.removed.set($,!0),A.maybeMoved.delete($)),L=$}x(S.nextSibling,L);for(var N=0;N<S.addedNodes.length;N++){var $=S.addedNodes[N];A.removed.has($)?(A.removed.delete($),A.maybeMoved.set($,!0)):A.added.set($,!0)}},E=this,_=0;_<this.mutations.length;_++)g(_)}},y.prototype.wasReordered=function(g){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var E=g.parentNode,_=this.treeChanges.get(g);_&&_.oldParentNode&&(E=_.oldParentNode);var b=this.childListChangeMap.get(E);if(!b)return!1;if(b.moved)return b.moved.get(g);b.moved=new r;var S=new r;function A(R){if(!R||!b.maybeMoved.has(R))return!1;var I=b.moved.get(R);return I!==void 0||(S.has(R)?I=!0:(S.set(R,!0),I=$(R)!==x(R)),S.has(R)?(S.delete(R),b.moved.set(R,I)):I=b.moved.get(R)),I}var L=new r;function x(R){var I=L.get(R);if(I!==void 0)return I;for(I=b.oldPrevious.get(R);I&&(b.removed.has(I)||A(I));)I=x(I);return I===void 0&&(I=R.previousSibling),L.set(R,I),I}var N=new r;function $(R){if(N.has(R))return N.get(R);for(var I=R.previousSibling;I&&(b.added.has(I)||A(I));)I=I.previousSibling;return N.set(R,I),I}return b.maybeMoved.keys().forEach(A),b.moved.get(g)},y})(),u=(function(){function y(g,E){var _=this;if(this.projection=g,this.added=[],this.removed=[],this.reparented=E.all||E.element||E.characterData?[]:void 0,this.reordered=E.all?[]:void 0,g.getChanged(this,E.elementFilter,E.characterData),E.all||E.attribute||E.attributeList){var b=E.attribute?[E.attribute]:E.attributeList,S=g.attributeChangedNodes(b);E.attribute?this.valueChanged=S[E.attribute]||[]:(this.attributeChanged=S,E.attributeList&&E.attributeList.forEach(function(L){_.attributeChanged.hasOwnProperty(L)||(_.attributeChanged[L]=[])}))}if(E.all||E.characterData){var A=g.getCharacterDataChanged();E.characterData?this.valueChanged=A:this.characterDataChanged=A}this.reordered&&(this.getOldPreviousSibling=g.getOldPreviousSibling.bind(g))}return y.prototype.getOldParentNode=function(g){return this.projection.getOldParentNode(g)},y.prototype.getOldAttribute=function(g,E){return this.projection.getOldAttribute(g,E)},y.prototype.getOldCharacterData=function(g){return this.projection.getOldCharacterData(g)},y.prototype.getOldPreviousSibling=function(g){return this.projection.getOldPreviousSibling(g)},y})(),d=(function(){function y(){}return y.prototype.matches=function(g){if(g===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==g;for(var E=g.split(" "),_=0;_<E.length;_++)if(this.attrValue===E[_])return!0;return!1},y.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+"]"},y})();function f(y){return'"'+y.replace(/"/,'\\"')+'"'}var m=/[a-zA-Z_]+/,h=/[a-zA-Z0-9_\-]+/,p=(function(){function y(){this.uid=y.nextUid++,this.qualifiers=[]}return Object.defineProperty(y.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),y.prototype.isMatching=function(g){return g[y.matchesSelector](this.selectorString)},y.prototype.wasMatching=function(g,E,_){if(!E||!E.attributes)return _;var b=E.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(b!=="*"&&b!==g.tagName)return!1;for(var S=[],A=!1,L=0;L<this.qualifiers.length;L++){var x=this.qualifiers[L],N=E.getAttributeOldValue(x.attrName);S.push(N),A=A||N!==void 0}if(!A)return _;for(var L=0;L<this.qualifiers.length;L++){var x=this.qualifiers[L],N=S[L];if(N===void 0&&(N=g.getAttribute(x.attrName)),!x.matches(N))return!1}return!0},y.prototype.matchabilityChange=function(g,E){var _=this.isMatching(g);return _?this.wasMatching(g,E,_)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(g,E,_)?n.Movement.EXITED:n.Movement.STAYED_OUT},y.parseSelectors=function(g){var E=[],_,b;function S(){_&&(b&&(_.qualifiers.push(b),b=void 0),E.push(_)),_=new y}function A(){b&&_.qualifiers.push(b),b=new d}for(var L=/\s/,x=void 0,N="Invalid or unsupported selector syntax.",$=1,R=2,I=3,Q=4,V=5,ee=6,re=7,J=8,be=9,de=10,Se=11,me=12,X=13,H=14,Y=$,Bt=0;Bt<g.length;){var U=g[Bt++];switch(Y){case $:if(U.match(m)){S(),_.tagName=U,Y=R;break}if(U=="*"){S(),_.tagName="*",Y=I;break}if(U=="."){S(),A(),_.tagName="*",b.attrName="class",b.contains=!0,Y=Q;break}if(U=="#"){S(),A(),_.tagName="*",b.attrName="id",Y=Q;break}if(U=="["){S(),A(),_.tagName="*",b.attrName="",Y=ee;break}if(U.match(L))break;throw Error(N);case R:if(U.match(h)){_.tagName+=U;break}if(U=="."){A(),b.attrName="class",b.contains=!0,Y=Q;break}if(U=="#"){A(),b.attrName="id",Y=Q;break}if(U=="["){A(),b.attrName="",Y=ee;break}if(U.match(L)){Y=H;break}if(U==","){Y=$;break}throw Error(N);case I:if(U=="."){A(),b.attrName="class",b.contains=!0,Y=Q;break}if(U=="#"){A(),b.attrName="id",Y=Q;break}if(U=="["){A(),b.attrName="",Y=ee;break}if(U.match(L)){Y=H;break}if(U==","){Y=$;break}throw Error(N);case Q:if(U.match(m)){b.attrValue=U,Y=V;break}throw Error(N);case V:if(U.match(h)){b.attrValue+=U;break}if(U=="."){A(),b.attrName="class",b.contains=!0,Y=Q;break}if(U=="#"){A(),b.attrName="id",Y=Q;break}if(U=="["){A(),Y=ee;break}if(U.match(L)){Y=H;break}if(U==","){Y=$;break}throw Error(N);case ee:if(U.match(m)){b.attrName=U,Y=re;break}if(U.match(L))break;throw Error(N);case re:if(U.match(h)){b.attrName+=U;break}if(U.match(L)){Y=J;break}if(U=="~"){b.contains=!0,Y=be;break}if(U=="="){b.attrValue="",Y=Se;break}if(U=="]"){Y=I;break}throw Error(N);case J:if(U=="~"){b.contains=!0,Y=be;break}if(U=="="){b.attrValue="",Y=Se;break}if(U=="]"){Y=I;break}if(U.match(L))break;throw Error(N);case be:if(U=="="){b.attrValue="",Y=Se;break}throw Error(N);case de:if(U=="]"){Y=I;break}if(U.match(L))break;throw Error(N);case Se:if(U.match(L))break;if(U=='"'||U=="'"){x=U,Y=X;break}b.attrValue+=U,Y=me;break;case me:if(U.match(L)){Y=de;break}if(U=="]"){Y=I;break}if(U=="'"||U=='"')throw Error(N);b.attrValue+=U;break;case X:if(U==x){Y=de;break}b.attrValue+=U;break;case H:if(U.match(L))break;if(U==","){Y=$;break}throw Error(N)}}switch(Y){case $:case R:case I:case V:case H:S();break;default:throw Error(N)}if(!E.length)throw Error(N);return E},y.nextUid=1,y.matchesSelector="matches",y})(),v=(function(){function y(){}return y.createObserverOptions=function(g){var E={childList:!0,subtree:!0},_;function b(S){if(!(E.attributes&&!_)){if(E.attributes=!0,E.attributeOldValue=!0,!S){_=void 0;return}_=_||{},S.forEach(function(A){_[A]=!0,_[A.toLowerCase()]=!0})}}return g.forEach(function(S){if(S.characterData){E.characterData=!0,E.characterDataOldValue=!0;return}if(S.all){b(),E.characterData=!0,E.characterDataOldValue=!0;return}if(S.attribute){b([S.attribute.trim()]);return}var A=y._elementFilterAttributes(S.elementFilter).concat(S.attributeList||[]);A.length&&b(A)}),_&&(E.attributeFilter=Object.keys(_)),E},y.validateOptions=function(g){for(var E in g)if(!(E in y._optionKeys))throw Error("Invalid option: "+E);if(typeof g.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!g.queries||!g.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var _={callback:g.callback,rootNode:g.rootNode||document,observeOwnChanges:!!g.observeOwnChanges,oldPreviousSibling:!!g.oldPreviousSibling,queries:[]},b=0;b<g.queries.length;b++){var S=g.queries[b];if(S.all){if(Object.keys(S).length>1)throw Error("Invalid request option. all has no options.");_.queries.push({all:!0});continue}if("attribute"in S){var A={attribute:y._validateAttribute(S.attribute)};if(A.elementFilter=p.parseSelectors("*["+A.attribute+"]"),Object.keys(S).length>1)throw Error("Invalid request option. attribute has no options.");_.queries.push(A);continue}if("element"in S){var L=Object.keys(S).length,A={element:S.element,elementFilter:p.parseSelectors(S.element)};if(S.hasOwnProperty("elementAttributes")&&(A.attributeList=y._validateElementAttributes(S.elementAttributes),L--),L>1)throw Error("Invalid request option. element only allows elementAttributes option.");_.queries.push(A);continue}if(S.characterData){if(Object.keys(S).length>1)throw Error("Invalid request option. characterData has no options.");_.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return _},y._validateElementAttributes=function(g){if(!g.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var E={},_={},b=g.split(/\s+/),S=0;S<b.length;S++){var A=b[S];if(A){A=y._validateAttribute(A);var L=A.toLowerCase();if(E[L])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");_[A]=!0,E[L]=!0}}return Object.keys(_)},y._elementFilterAttributes=function(g){var E={};return g.forEach(function(_){_.qualifiers.forEach(function(b){E[b.attrName]=!0})}),Object.keys(E)},y._validateAttribute=function(g){if(typeof g!="string"||(g=g.trim(),!g))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!g.match(y._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+g);return g},y._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,y._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},y})(),w=(function(){function y(g){var E=this;this._connected=!1,this._options=v.validateOptions(g),this._observerOptions=v.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(_){return _.elementFilter?_.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(_){return _.all}),this._queryValidators=[],y.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(_){return y.createQueryValidator(E._root,_)})),this._observer=new MutationObserver(function(_){E._observerCallback(_)}),this.reconnect()}return y.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},y.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var g=this._createSummaries(this._observer.takeRecords());return this._changesToReport(g)?g:void 0},y.prototype.disconnect=function(){var g=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,g},y.prototype._observerCallback=function(g){this._options.observeOwnChanges||this._observer.disconnect();var E=this._createSummaries(g);this._runQueryValidators(E),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(E)&&this._callback(E),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},y.prototype._createSummaries=function(g){if(!g||!g.length)return[];for(var E=new c(this._root,g,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),_=[],b=0;b<this._options.queries.length;b++)_.push(new u(E,this._options.queries[b]));return _},y.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(g){g&&g.recordPreviousState()})},y.prototype._runQueryValidators=function(g){this._queryValidators.forEach(function(E,_){E&&E.validate(g[_])})},y.prototype._changesToReport=function(g){return g.some(function(E){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(_){return E[_]&&E[_].length})||E.attributeChanged&&Object.keys(E.attributeChanged).some(function(_){return!!E.attributeChanged[_].length}))})},y})(),C=(function(){function y(g,E){this.root=g,this.delegate=E,this.idMap={}}return y.prototype.initialize=function(g,E){this.idMap[g]=this.root;for(var _=0;_<E.length;_++)this.deserializeNode(E[_],this.root)},y.prototype.applyChanged=function(g,E,_,b){var S=this;E.forEach(function(A){var L=S.deserializeNode(A);S.deserializeNode(A.parentNode),S.deserializeNode(A.previousSibling),L.parentNode&&L.parentNode.removeChild(L)}),g.forEach(function(A){var L=S.deserializeNode(A);L.parentNode&&L.parentNode.removeChild(L)}),E.forEach(function(A){var L=S.deserializeNode(A),x=S.deserializeNode(A.parentNode),N=S.deserializeNode(A.previousSibling);x.insertBefore(L,N?N.nextSibling:x.firstChild)}),_.forEach(function(A){var L=S.deserializeNode(A);Object.keys(A.attributes).forEach(function(x){var N=A.attributes[x];N===null?L.removeAttribute(x):(!S.delegate||!S.delegate.setAttribute||!S.delegate.setAttribute(L,x,N))&&L.setAttribute(x,N)})}),b.forEach(function(A){var L=S.deserializeNode(A);L.textContent=A.textContent}),g.forEach(function(A){delete S.idMap[A.id]})},y.prototype.deserializeNode=function(g,E){var _=this;if(g===null)return null;var b=this.idMap[g.id];if(b)return b;var S=this.root.ownerDocument;switch(S===null&&(S=this.root),g.nodeType){case Node.COMMENT_NODE:b=S.createComment(g.textContent);break;case Node.TEXT_NODE:b=S.createTextNode(g.textContent);break;case Node.DOCUMENT_TYPE_NODE:b=S.implementation.createDocumentType(g.name,g.publicId,g.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(b=this.delegate.createElement(g.tagName)),b||(b=S.createElement(g.tagName)),Object.keys(g.attributes).forEach(function(L){(!_.delegate||!_.delegate.setAttribute||!_.delegate.setAttribute(b,L,g.attributes[L]))&&b.setAttribute(L,g.attributes[L])});break;default:throw"Unsupported node type: "+g.nodeType}if(this.idMap[g.id]=b,E&&E.appendChild(b),g.childNodes)for(var A=0;A<g.childNodes.length;A++)this.deserializeNode(g.childNodes[A],b);return b},y})(),T=(function(){function y(g,E,_){var b=this;this.target=g,this.mirror=E,this.nextId=1,this.knownNodes=new r;for(var S=this.serializeNode(g).id,A=[],L=g.firstChild;L;L=L.nextSibling)A.push(this.serializeNode(L,!0));this.mirror.initialize(S,A);var x=[{all:!0}];_&&(x=x.concat(_)),this.mutationSummary=new w({rootNode:g,callback:function(N){b.applyChanged(N)},queries:x})}return y.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},y.prototype.rememberNode=function(g){var E=this.nextId++;return this.knownNodes.set(g,E),E},y.prototype.forgetNode=function(g){this.knownNodes.delete(g)},y.prototype.serializeNode=function(g,E){if(g===null)return null;var _=this.knownNodes.get(g);if(_!==void 0)return{id:_};var b={nodeType:g.nodeType,id:this.rememberNode(g)};switch(b.nodeType){case Node.DOCUMENT_TYPE_NODE:var S=g;b.name=S.name,b.publicId=S.publicId,b.systemId=S.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:b.textContent=g.textContent;break;case Node.ELEMENT_NODE:var A=g;b.tagName=A.tagName,b.attributes={};for(var L=0;L<A.attributes.length;L++){var x=A.attributes[L];b.attributes[x.name]=x.value}if(E&&A.childNodes.length){b.childNodes=[];for(var N=A.firstChild;N;N=N.nextSibling)b.childNodes.push(this.serializeNode(N,!0))}}return b},y.prototype.serializeAddedAndMoved=function(g,E,_){var b=this,S=g.concat(E).concat(_),A=new r;S.forEach(function(x){var N=x.parentNode,$=A.get(N);$||($=new r,A.set(N,$)),$.set(x,!0)});var L=[];return A.keys().forEach(function(x){for(var N=A.get(x),$=N.keys();$.length;){for(var R=$[0];R.previousSibling&&N.has(R.previousSibling);)R=R.previousSibling;for(;R&&N.has(R);){var I=b.serializeNode(R);I.previousSibling=b.serializeNode(R.previousSibling),I.parentNode=b.serializeNode(R.parentNode),L.push(I),N.delete(R),R=R.nextSibling}$=N.keys()}}),L},y.prototype.serializeAttributeChanges=function(g){var E=this,_=new r;return Object.keys(g).forEach(function(b){g[b].forEach(function(S){var A=_.get(S);A||(A=E.serializeNode(S),A.attributes={},_.set(S,A)),A.attributes[b]=S.getAttribute(b)})}),_.keys().map(function(b){return _.get(b)})},y.prototype.applyChanged=function(g){var E=this,_=g[0],b=_.removed.map(function(x){return E.serializeNode(x)}),S=this.serializeAddedAndMoved(_.added,_.reparented,_.reordered),A=this.serializeAttributeChanges(_.attributeChanged),L=_.characterDataChanged.map(function(x){var N=E.serializeNode(x);return N.textContent=x.textContent,N});this.mirror.applyChanged(b,S,A,L),_.removed.forEach(function(x){E.forgetNode(x)})},y})();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=p,n.Summary=u,n.TreeChanges=l,n.TreeMirror=C,n.TreeMirrorClient=T,Object.defineProperty(n,"__esModule",{value:!0})}))})),KN=YN(),Do=0,Bo=new Array(1e3);function ZN(){for(let e=0;e<Do;e+=2){const t=Bo[e],n=Bo[e+1];t(...n),Bo[e]=void 0,Bo[e+1]=void 0}Do=0}function QN(e,...t){Bo[Do]=e,Bo[Do+1]=t,Do+=2,Do===2&&e2()}function JN(){let e=0;const t=new MutationObserver(ZN),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var e2=JN();function xb(){QN(()=>{cd.hasListeners()&&(cd.fire(),xb())})}var cd=new ye({onFirstListenerAdd:xb}),Qa=cd.once;function t2(e,t,n){const r=new ye;let o=[];return r.addDisposable(e(i=>{Qa(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var n2=class extends ye{constructor(e={}){super(),k(this,"_mutationSummary",void 0),this._mutationSummary=new KN.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}},r2=class extends Ce{_nextTickHandler(){Qa(()=>{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(),k(this,"_mutationEmitter",void 0),k(this,"_innerEmitter",this.addDisposable(new ye({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),k(this,"_lostEmitter",this.addDisposable(new ye)),k(this,"_paused",0),k(this,"_stopped",0),k(this,"_foreignCode",0),k(this,"_summaries",[]),k(this,"onMutate",this._innerEmitter.event),k(this,"onLost",this._lostEmitter.event),k(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new n2(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),Qa(()=>{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)}}},o2=1,Ob=e=>e.nodeType===o2,ud=e=>e?.nodeName==="STYLE";function i2(e){return e.some(t=>t.attributeChanged&&Object.keys(t.attributeChanged).length||t.reparented?.length||t.reordered?.length||t.added?.some(n=>Ob(n)||ud(n.parentNode))||t.removed?.some(n=>Ob(n)||ud(t.getOldParentNode(n)))?!0:!!t.characterDataChanged?.some(n=>ud(n.parentNode)))}var s2=Qa;function a2(e,t){let n=0;for(const r of t){if(r.oldPosition>e)break;const o=r.oldLength>0&&r.newLength>0,i=e===r.oldPosition||e===r.oldEnd;if(o&&i||r.oldPosition<e&&e<r.oldEnd)return;r.oldEnd<=e&&(n=r.newEnd-r.oldEnd)}return e+n}var Rb=/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]*);/iy;function Mb(e,t){Rb.lastIndex=t;const n=Rb.exec(e);return n?n[0].length:e.startsWith(`\r
|
|
3
|
-
`,t)?2:1}function Pb(e){return e.length===1?1:(wr(e).textContent??"").length}function l2(e,t,n){if(n)return Math.min(t,e.length);let r=0,o=0;for(;o<e.length&&r<t;){const i=Mb(e,o);r+=Pb(e.slice(o,o+i)),o+=i}return o}function c2(e,t,n){if(n)return Math.min(t,e.length);let r=0;for(let o=0;o<e.length;){const i=Mb(e,o);if(o+i>t)break;r+=Pb(e.slice(o,o+i)),o+=i}return r}function Xi(e,t){const n=t.nodeMap.getByElement(e);return n&&t.isAttached(n)?n:void 0}var u2='[contenteditable="true"], editor';function Ib(e,t,n){const r=e.childNodes;for(let i=t;i<r.length;i++){const s=Xi(r[i],n);if(s)return s.start}for(let i=Math.min(t,r.length)-1;i>=0;i--){const s=Xi(r[i],n);if(s)return s.end}const o=Xi(e,n);return o&&(o.startTagEnd??o.start)}function Db(e,t){if((e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(u2))for(let n=e,r=e.parentNode;r;n=r,r=r.parentNode){const o=Ib(r,Array.from(r.childNodes).indexOf(n),t);if(o!==void 0)return o}}function d2({node:e,offset:t},n){if(e.nodeType===Node.TEXT_NODE){const r=Xi(e,n);if(r?.type!==B.HTML)return Db(e,n);const o=n.textAt(r.start,r.end);return r.start+l2(o,t,En(e.parentNode))}return Ib(e,t,n)??(Xi(e,n)?void 0:Db(e,n))}function dd(e,t,n){const r=n.nodeMap.getByNode(e),o=r?.parentNode;if(!(!r||!o))return{node:o,offset:Array.from(o.childNodes).indexOf(r)+(t?1:0)}}function f2(e,t){const n=t.nodeAt(e);if(!n)return;if(n.type===B.HTML){const s=t.nodeMap.getByNode(n);return s?.nodeType!==Node.TEXT_NODE?void 0:{node:s,offset:c2(t.textAt(n.start,n.end),Math.max(0,Math.min(e,n.end)-n.start),En(s.parentNode))}}if(e<=n.start||e>=n.end)return dd(n,e>=n.end&&e>n.start,t);const r=n.children.find(s=>s.start>=e);if(r)return dd(r,!1,t);const o=n.children[n.children.length-1];if(o)return dd(o,!0,t);const i=t.nodeMap.getByNode(n);return i&&{node:i,offset:0}}var FK=400,Bb=3e3,m2=class extends Ce{constructor(e,t=400){super(),k(this,"_waitMs",void 0),k(this,"_actionId",void 0),k(this,"_queue",[]),k(this,"_timer",void 0),k(this,"_guid",void 0),k(this,"_releaseOnReady",!1),k(this,"_releasing",!1),this._waitMs=t,this.addDisposable(e.onHistoryAction(n=>this._wait(n))),this.addDisposable(e.onHistoryActionSent(n=>this._sent(n))),this.addDisposable(e.onHistoryActionAnswered(n=>this._answered(n))),this.addDisposable(e.onEntitySet(n=>this._entitySet(n))),this.addDisposable(e.onReady(()=>this._ready())),this.addDispose(()=>this._drop())}hold(e){return this._actionId===void 0?!1:(this._queue.push(e),!0)}holdBehindQueued(e){return!this._queue.length||this._releasing?!1:(this._queue.push(e),!0)}isWaiting(){return this._actionId!==void 0}hasQueued(){return this._queue.length>0&&!this._releasing}releaseNow(){this._queue.length&&this._release()}_wait(e){this._actionId=e,this._restartTimer(Bb)}_sent(e){e===this._actionId&&!this._releaseOnReady&&this._restartTimer(this._waitMs)}_restartTimer(e){clearTimeout(this._timer),this._timer=setTimeout(()=>this._release(),e)}_answered(e){e===this._actionId&&this._release()}_release(){clearTimeout(this._timer),this._actionId=void 0,this._releaseOnReady=!1,this._releasing=!0;try{for(;this._actionId===void 0&&this._queue.length;){const e=this._queue.shift();try{e?.()}catch{}}}finally{this._releasing=!1}}_entitySet(e){const t=e===this._guid;this._guid=e,t?this._actionId!==void 0&&(this._restartTimer(this._waitMs),this._releaseOnReady=!0):this._drop()}_ready(){this._releaseOnReady&&(this._releaseOnReady=!1,this._release())}_drop(){clearTimeout(this._timer),this._actionId=void 0,this._releaseOnReady=!1,this._queue=[]}},Hb=2e3,h2=3;function p2(e,t,n){const r=e.data.indexOf(n,Math.max(0,t-n.length));return n.trim().length>=h2&&r>=0&&r<=t}function Fb(e,t){if(!e||e.nodeType===Node.TEXT_NODE)return e;const n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r;for(let o=n.nextNode();o&&(t||!r);o=n.nextNode())r=o;return r}function g2(e,t){if(e.nodeType===Node.TEXT_NODE)return{text:e,offset:t};const n=Fb(e.childNodes[t-1],!0),r=n?void 0:Fb(e.childNodes[t],!1);return n?{text:n,offset:n.length}:r&&{text:r,offset:0}}var b2=class extends Ce{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),k(this,"_baseDocument",void 0),k(this,"_remoteDocument",void 0),k(this,"_parsedDocument",void 0),k(this,"_nodeMap",void 0),k(this,"_beforeChangeEmitter",this.addDisposable(new ye)),k(this,"_beforeCommitEmitter",this.addDisposable(new ye)),k(this,"_beforeTextCommitEmitter",this.addDisposable(new ye)),k(this,"_onTextCommitEmitter",this.addDisposable(new ye)),k(this,"_onRefreshEmitter",this.addDisposable(new ye)),k(this,"_documentElement",void 0),k(this,"_docType",void 0),k(this,"_parseFn",void 0),k(this,"_serviceMarkup",void 0),k(this,"_mapHTMLRoots",void 0),k(this,"_roots",void 0),k(this,"_getRootsParent",void 0),k(this,"_mutationCollector",this.addDisposable(new r2)),k(this,"_attributeMapper",void 0),k(this,"_trackedOffsets",new Set),k(this,"_inputHold",void 0),k(this,"_shownEntity",void 0),k(this,"_savedCaret",void 0),k(this,"ownership",void 0),k(this,"holdCaretAfterBreak",void 0),k(this,"_reportedDrifts",new Set),k(this,"_hiddenEmptyTexts",new WeakSet),k(this,"_canvasNodes",jN(document)),k(this,"_accountingTimer",void 0),k(this,"_lastAccounting",0),k(this,"_capture",void 0),k(this,"_openBatches",0),k(this,"_pushUndoStop",!1),k(this,"_locked",!1),k(this,"_beforeCommitPending",!1),k(this,"_closeStep",!1),k(this,"_styleDirty",!0),k(this,"_outputs",new Map),k(this,"_runningScripts",[]),k(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))}}),k(this,"_commands",[]),k(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())}),k(this,"_treeMutations",[]),k(this,"beforeChange",this._beforeChangeEmitter.event),k(this,"beforeCommit",this._beforeCommitEmitter.event),k(this,"beforeTextCommit",this._beforeTextCommitEmitter.event),k(this,"onTextCommit",this._onTextCommitEmitter.event),k(this,"onChange",KT(t2(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),k(this,"onRefresh",this._onRefreshEmitter.event),this._baseDocument=e,this._remoteDocument=t,this._parseFn=n.prepareHtml,this._serviceMarkup=n.serviceMarkup,this._mapHTMLRoots=n.mapHTMLRoots,this._getRootsParent=n.rootsParent,this._roots=[...document.childNodes];const r=this._parsedDocument=new aL(e,n.createRoot);this._nodeMap=new UL,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new $N(this._nodeMap),this.addDisposable(tN(()=>this._mutationCollector.pauseForForeignCode())),this.addDisposable(nN(()=>this._mutationCollector.resumeAfterForeignCode())),this.addDisposable(this._mutationCollector.onNativeMutate(o=>{this._styleDirty||(this._styleDirty=i2(o))})),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new WN(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(aA(this._pauseOnCommandInput)),t.collectCanvasEdits=()=>this.commit(!1),this.addDispose(()=>clearTimeout(this._accountingTimer)),this.addDisposable(t.onEntitySet(o=>this._rememberCaret(o))),this.addDisposable(t.onReady(()=>this._dropForeignCaret())),this._inputHold=this.addDisposable(new m2(t)),this.addDisposable(e.onChanged(({changes:o})=>this._rebaseTracked(o))),this.addDisposable(t.onEntitySet(()=>this._forgetTracked()))}trackOffset(e){const t={offset:e};return this._trackedOffsets.add(t),{current:()=>t.offset,release:()=>this._trackedOffsets.delete(t)}}_rebaseTracked(e){for(const t of this._trackedOffsets)t.offset=t.offset===void 0?void 0:a2(t.offset,e)}_forgetTracked(){for(const e of this._trackedOffsets)e.offset=void 0;this._trackedOffsets.clear()}holdInput(e){return this._inputHold.hold(e)}holdInputBehindQueued(e){return this._inputHold.holdBehindQueued(e)}isHoldingInput(){return this._inputHold.isWaiting()}hasHeldInput(){return this._inputHold.hasQueued()}releaseHeldInput(){this._inputHold.releaseNow()}_rememberCaret(e){const t=e===this._shownEntity;this._shownEntity=e,this._savedCaret=void 0;const n=document.getSelection();if(!t||!n?.isCollapsed||document.activeElement?.closest("input, textarea, select, .monaco-editor"))return;const r=n.anchorNode,o=r?.childNodes,i=r?.nodeType===Node.TEXT_NODE?r:[o?.[n.anchorOffset-1],o?.[n.anchorOffset]].find(s=>s?.nodeType===Node.TEXT_NODE);i&&(this._savedCaret={node:i,text:i.data})}_dropForeignCaret(){const e=this._savedCaret;if(this._savedCaret=void 0,!e||document.activeElement?.closest("input, textarea, select, .monaco-editor"))return;const t=document.getSelection(),n=t?.anchorNode;if(!e.node.isConnected){const l=n?g2(n,t?.anchorOffset??0):void 0;l&&l.text!==e.node&&!p2(l.text,l.offset,e.text)&&t?.removeAllRanges();return}const{text:r}=e,o=e.node.data,i=Math.min(r.length,o.length);let s=0;for(;s<i&&r[s]===o[s];)s++;let a=0;for(;a<i-s&&r[r.length-1-a]===o[o.length-1-a];)a++;s+a<Math.ceil(i/2)&&(n===e.node||n===e.node.parentNode)&&t?.removeAllRanges()}_typedIntoHidden(e){const t=e.flatMap(n=>n.characterDataChanged??[]).filter(n=>this._hiddenEmptyTexts.has(n)&&n.isConnected&&n.data!==""&&!this.isBehindHidden(n));for(const n of t)this._hiddenEmptyTexts.delete(n),this.ownership.forgetService(n);return t.length?[YL(t)]:[]}isBehindHidden(e){for(let t=e.parentNode;t&&!this._nodeMap.getByElement(t);t=t.parentNode)if(!this.ownership.isWrapper(t)&&this.ownership.markOf(t))return!0;return!1}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);VN(qN(e,this.ownership,t),this._reportedDrifts),UN(zN(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 Tb(e,this._accountingRules())}auditNodes(){return kb(document,this._accountingRules()).map(Lb)}checkAccounting(){this._reportSafely(()=>Nb(kb(document,this._accountingRules()),this._reportedDrifts))}_checkCommitted(e){this._reportSafely(()=>{const t=e.flatMap(n=>[...n.added,...n.reparented??[],...n.reordered??[]]);Nb(GN(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+Hb-Date.now());this._accountingTimer=setTimeout(()=>{const n=window.requestIdleCallback;n?n(e,{timeout:Hb}):e()},t)}closeUndoStep(){this._closeStep=!0}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}takeStyleDirty(){this._mutationCollector.takeRecords();const e=this._styleDirty;return this._styleDirty=!1,e}_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}_letterEdits(e){const t=this._serviceMarkup;if(!t)return e;const n=ZL(e,{...t,isWrapper:r=>this.ownership.isWrapper(r),isMapped:r=>!!this._nodeMap.getByElement(r)});return n.service.forEach(r=>this.ownership.markService(r)),n.summaries}_sealOnNextTick(e){const t=this._mutationCollector.onMutate(n=>{n.length&&(this._reportSafely(()=>this._beforeTextCommitEmitter.fire()),this._dropForeignOutput(n),this._reportForeignStructure(n),Fa("commit",()=>{const r=LN(this._letterEdits([...n,...this._typedIntoHidden(n)]),this._nodeMap,this._parseFn,this._rootsParent(),o=>this.ownership.isWrapper(o));this._commit(r)}),this._reportSafely(()=>this._onTextCommitEmitter.fire()),this._checkCommitted(n),this._dropOrphanedOutput())});s2(()=>{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,this._closeStep&&n&&(this._closeStep=!1,this._remoteDocument.closeStep());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)}holdsTypedEdits(){return this._remoteDocument.holdsTypedEdits()}hasEditsAfterBoundary(){return this._remoteDocument.hasEditsAfterBoundary()}markHistoryAction(){return this._remoteDocument.markHistoryAction()}noteHistoryActionSent(e){this._remoteDocument.noteHistoryActionSent(e)}_textPoints(){return{nodeMap:this._nodeMap,textAt:(e,t)=>this._baseDocument.getText({start:e,end:t}),nodeAt:e=>this._parsedDocument.getNodeByPosition(e),isAttached:e=>this._parsedDocument.isAttached(e)}}pointToOffset(e){return d2(e,this._textPoints())}offsetToPoint(e){return f2(e,this._textPoints())}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=NN(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;yg(()=>{const n=Vg(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),r.nodeType===Node.TEXT_NODE&&r.data===""&&this._hiddenEmptyTexts.add(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===B.ELEMENT){const r=yu(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,sr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{Fa("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,mk()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)Fa(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=GL(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=kL(e,this._nodeMap,o=>this._parsedDocument.isAttached(o),o=>this.ownership.markOf(o)==="service",o=>this.ownership.isOuterWrapper(o)),r=xL(n);this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),r.push(...oT(RL(n)));try{if(qL(n,this._nodeMap,this.holdCaretAfterBreak),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);rd.isEqual(i,s)}}}finally{Qp(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(le.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}}}},$K=1500,WK=2,y2=100,v2=class{constructor(e){k(this,"_options",void 0),k(this,"_watches",new Map),k(this,"_timer",void 0),k(this,"_last",0),k(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}t-o.startedAt<15e3||(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,{startedAt:Date.now(),waited:0,retries:0,resend:t}),this._timer===void 0&&(this._last=Date.now(),this._timer=setInterval(this._tick,y2))}resendNow(e){const t=this._watches.get(e);t&&(t.waited=0,t.resend())}giveUpNow(e){const t=this._watches.get(e);this._watches.delete(e),this._options.onGiveUp(e,t?.retries??0)}dispose(){this._watches.clear(),this._stop()}_stop(){this._timer!==void 0&&(clearInterval(this._timer),this._timer=void 0)}},fd=class{constructor(){k(this,"_changes",null),k(this,"_typedAt",null),k(this,"_selection",null),k(this,"_closesStep",!1)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){this.hasChanges()||(this._selection=null);const t=wt(this._changes,e);this._changes=t.length?t:null;const n=Date.now();this._typedAt=this._changes?{from:this._typedAt?.from??n,to:n}:null}clear(){this._changes=null,this._typedAt=null,this._selection=null,this._closesStep=!1}closeStep(){this._closesStep=!0}closesStep(){return this._closesStep}replace(e){this._changes=e.length?e:null,this._selection=null,this._changes||(this._typedAt=null)}typedAt(){return this._typedAt}selection(){return this._selection}noteSelection(e,t){this.hasChanges()&&(this._selection=t?e:this._selection&&{before:this._selection.before,after:e.after})}takeFrom(e){this._changes=e._changes,this._typedAt=e._typedAt,this._selection=e._selection,this._closesStep=e._closesStep,e.clear()}absorb(e){const t=this._typedAt,n=e._typedAt,r=this.hasChanges()?this._selection&&e._selection&&{...this._selection,after:e._selection.after}:e._selection;e._changes&&this.add(e._changes),this._closesStep=e._closesStep,this._selection=this._changes?r:null,this._changes&&(this._typedAt=t&&n?{from:Math.min(t.from,n.from),to:Math.max(t.to,n.to)}:n??t)}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)}}},$b=60;function E2(e,t){const n=pg(e,t);if(!n)return;const r=n.start;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+$b),cached:t.substring(r,r+$b)}}var S2=64,w2=class extends Ce{constructor(...e){super(...e),k(this,"_onApplyEmitter",this.addDisposable(new ye)),k(this,"_onEmptyEmitter",this.addDisposable(new ye)),k(this,"_dispatched",[]),k(this,"_echoed",new Set),k(this,"_revertedAwaiting",new Set),k(this,"onApply",this._onApplyEmitter.event),k(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}revertedAwaitingIds(){return new Set(this._revertedAwaiting)}awaitingIds(){return[...this._dispatched.flatMap(e=>e.changeId===void 0?[]:[e.changeId]),...this._revertedAwaiting]}isRevertedAwaiting(e){return this._revertedAwaiting.has(e)}forgetReverted(e){for(const t of e)this._revertedAwaiting.delete(t)}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>S2&&this._echoed.delete(this._echoed.values().next().value)}append(e,t){this._dispatched.unshift({changeId:t,textChanges:e})}apply(e,t,n=!1,r=[e]){const o=t===void 0?-1:this._dispatched.findIndex(i=>i.changeId===t);if(t!==void 0&&(this._remember(t),this._revertedAwaiting.delete(t)),o>=0){this._confirmEcho(o,e);return}n&&this._rebaseDispatched(r)||this._applyExternal(e)}_rebaseDispatched(e){const t=[...this._dispatched].reverse().map(r=>({...r}));let n=[];for(const r of e){let o=r;for(const i of t){const s=Wa(i.textChanges,o,"after"),a=s&&Wa(o,i.textChanges,"before");if(!s||!a)return!1;i.textChanges=s,o=a}n=wt(n,o)}return this._dispatched=t.reverse(),this._emit(n),!0}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(wt(Bn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=wt(t,Bn(n.textChanges)),n.changeId!==void 0&&this._revertedAwaiting.add(n.changeId);this._dispatched=[],this._emit(wt(t,e))}clear(){const e=this.hasDispatched();this._dispatched=[],this._revertedAwaiting.clear(),e&&this._onEmptyEmitter.fire()}},C2=class tA extends Ce{constructor(t=""){super(),k(this,"_text",void 0),this._text=t}getText(t){const n=Lk(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new tA(this._text)}},Ja=class nA extends C2{constructor(t=""){super(t),k(this,"_eventQueue",void 0),k(this,"_lockCounter",0),k(this,"_onChangeEmitter",this.addDisposable(new ye)),k(this,"_onChangedEmitter",this.addDisposable(new ye)),k(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>Pk(this,r)),n.length){const r=xo(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=Ok(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=wt(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 nA(this._text)}};function Wb(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function el(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 _2(e){return(t,n,r)=>el(t)?e(t,n,r):!1}function A2(e){return t=>el(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function T2(e){return(t,n,r)=>el(t)?Wb(t)?e(t,n,r):t:!1}function k2(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return el(n)?Wb(n)?e(t):t:!1}}function L2(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function md(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 N2(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 x2=8,O2=class{constructor(){k(this,"_byKey",Object.create(null)),k(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=N2(x2),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},tl=new O2;function qb(e,t){return t!==void 0&&!md(e,t)?`%|{${tl.getOrCreateByKey(e)}}|%`:e}function R2(e){const t=tl.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Qe(e,t,n){return t!==void 0?md(e,t)?e:`%|{${tl.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function M2(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function Ue(e){return e.startsWith("<!--")&&e.endsWith("-->")?M2(e.slice(4,-3)):e}function P2(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 I2(e,t,n){return t!==void 0?md(e,t)?e:`%|{${tl.getOrCreateByKey(e)}}|%`:n||L2(e)||P2(e)?`<!--${e}-->`:e}var Yr=_2(Qe),Kr=A2(Ue),D2=T2(Qe),B2=k2(Ue),H2=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",R2),e.escape("@{","}",Qe,!0).unescape("<!--@{","}-->",Ue,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",qb,!0),e.escape("{{","}}",qb,!0),e.createSyntax("brace-percent").escape("{%","%}",Qe).unescape("<!--{%","%}-->",Ue),e.createSyntax("brace-hash").escape("{#","#}",Qe).unescape("<!--{#","#}-->",Ue),e.createSyntax("proscript").escape("[%","%]",I2,!0).unescape("<!--[%","%]-->",Ue,!0),e.createSyntax("getresponse").escape("[[IF","]]",Qe).escape("[[if","]]",Qe).escape("[[ELSE]]","",Qe).escape("[[else]]","",Qe).escape("[[ENDIF]]","",Qe).escape("[[endif]]","",Qe).unescape("<!--[[IF","]]-->",Ue).unescape("<!--[[if","]]-->",Ue).unescape("<!--[[ELSE]]","-->",Ue).unescape("<!--[[else]]","-->",Ue).unescape("<!--[[ENDIF]]","-->",Ue).unescape("<!--[[endif]]","-->",Ue),e.createSyntax("expert-sender").escape("<if",">",Qe).escape("</if",">",Qe).escape("<else",">",Qe).escape("</else",">",Qe).escape("<var ",">",Qe,!0).unescape("<!--<if ",">-->",Ue).unescape("<!--</if",">-->",Ue).unescape("<!--<else ",">-->",Ue).unescape("<!--</else",">-->",Ue).unescape("<!--<var",">-->",Ue,!0),e.createSyntax("velocity").escape("#if",")",Yr).escape("#elseif",")",Yr).escape("#else","",Qe).escape("#foreach",")",Yr).escape("#macro",")",Yr).escape("#set",")",D2,!0).escape("#parse",")",Yr).escape("#include",")",Yr).escape("#evaluate",")",Yr).escape("#end","",Qe).escape("#break","",Qe).escape("#stop","",Qe).unescape("<!--#macro","-->",Kr).unescape("<!--#if","-->",Kr).unescape("<!--#elseif","-->",Kr).unescape("<!--#else","-->",Ue).unescape("<!--#foreach","-->",Kr).unescape("<!--#parse","-->",Kr).unescape("<!--#include","-->",Kr).unescape("<!--#evaluate","-->",Kr).unescape("<!--#end","-->",Ue).unescape("<!--#break","-->",Ue).unescape("<!--#stop","-->",Ue).unescape("<!--#set","-->",B2,!0),e.createSyntax("mailchimp").escape("*|","|*",Qe).unescape("<!--*|","|*-->",Ue)},zb="bare",hd=new Map;function F2(e){for(const t of Object.keys(e)){const n=e[t];n&&hd.set(t,n)}}function $2(e){return e?hd.get(e)??zb:zb}function W2(){hd.clear()}function Ub(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 Yi(e,t){return e.start<t.end&&t.start<e.end}function Vb(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:m,isVariable:h}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):Ub(e,c,u.start,l),c=u.end,a.some(C=>Yi(C,u)))continue;const p=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,v=e.substring(u.start,u.end),w=d(v,p,l.insideTag);w!==!1&&w!==v&&(s.push({range:u,text:w,overrideBuiltins:f,syntax:m,isVariable:h}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function q2(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 pd(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=q2(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='"'):Ub(e,l,u,a),l=u;const m=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let h=!1;for(const{mapFn:p,value:v,syntax:w,isVariable:C}of f){let T=u+d.length,y=e.indexOf(v,T);for(;y!==-1;){let g=y,E=u+d.length,_=0;for(;g!==-1;){const x=e.indexOf(d,E);if(x!==-1&&x<g)_++,E=x+d.length,g=e.indexOf(v,E);else if(_>0)_--,E=g+v.length,g=e.indexOf(v,E);else break}if(g<0)break;const b=g+v.length,S=e.substring(u,b),A=p(S,m,a.insideTag);if(A===!1){T=y+Math.max(v.length,1),y=e.indexOf(v,T);continue}(o||A!==S)&&i.push({range:{start:u,end:b},text:o?S:A,syntax:w,isVariable:C});const L=s.findIndex(({start:x})=>x>=b);L>c?c=L-1:c=s.length,h=!0;break}if(h)break}}return i}function nl(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 jb=class{constructor(e=H2){k(this,"_disposables",[]),k(this,"_escapes",[]),k(this,"_unescapes",[]),k(this,"_escapeMatchers",[]),k(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=pd(e,this._escapes,t,n),o=Vb(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>Yi(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>Yi(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=pd(e,this._unescapes,t),r=Vb(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>Yi(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>Yi(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=>$2(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return pd(e,this._escapes,t,n,!0)}getEscapedText(e,t){return nl(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return nl(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=nl(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=nl(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()}},z2=1e4,Gb=3,U2=ak+Hu;function V2(e){return(e??[]).reduce((t,n)=>t+n.oldLength,0)}function j2(e,t){return e.stack.closesStep()?!1:e.undoStop===t.undoStop||e.serviceRemoval+t.serviceRemoval<=200}var G2=class extends Ja{constructor(){super(),k(this,"_editStack",new fd),k(this,"_frozenStack",new fd),k(this,"_frozenUndoStop",!0),k(this,"_barrierSends",[]),k(this,"_barrierResolves",[]),k(this,"_queuedBarriers",[]),k(this,"_editLog",[]),k(this,"_entityId",void 0),k(this,"_versionController",this.addDisposable(new w2)),k(this,"_beforeSaveEmitter",this.addDisposable(new YT)),k(this,"_onReadyEmitter",this.addDisposable(new ye)),k(this,"_onEntitySetEmitter",this.addDisposable(new ye)),k(this,"_onPendingSentEmitter",this.addDisposable(new ye)),k(this,"_onHistoryAnswerEmitter",this.addDisposable(new ye)),k(this,"_onHistoryActionEmitter",this.addDisposable(new ye)),k(this,"_onHistoryActionSentEmitter",this.addDisposable(new ye)),k(this,"_onHistoryActionAnsweredEmitter",this.addDisposable(new ye)),k(this,"_canvasEdits",0),k(this,"_nextActionId",1),k(this,"_historyAction",null),k(this,"_cache",new Ja),k(this,"beforeSave",this._beforeSaveEmitter.event),k(this,"_reverting",!1),k(this,"_inited",!1),k(this,"_nextChangeId",1),k(this,"_originId",`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`),k(this,"_rev",null),k(this,"_sealed",[]),k(this,"_saveHeld",!1),k(this,"_releasing",!1),k(this,"_applyingRemote",!1),k(this,"collectCanvasEdits",()=>Promise.resolve()),k(this,"_echoLost",!1),k(this,"_reportedText",null),k(this,"_reportId",0),k(this,"_lostChangeIds",new Set),k(this,"_recoveryTimer",void 0),k(this,"_recoveryOverdue",!1),k(this,"_coveredRev",null),k(this,"_awaitingRefill",!1),k(this,"_resyncing",!1),k(this,"_onEchoLostEmitter",this.addDisposable(new ye)),k(this,"_onEchoRecoveredEmitter",this.addDisposable(new ye)),k(this,"_echoWatchdog",this.addDisposable(new v2({isAwaiting:e=>this._versionController.isInFlight(e)||this._versionController.isRevertedAwaiting(e),onGiveUp:(e,t)=>this._onEchoLost(e,t)}))),k(this,"_handleUpdateEntity",e=>{const{edits:t,guid:n,changeId:r,rev:o}=e;if(e.resync&&n===this._entityId){const{reportId:i,textFingerprint:s}=e.resync,a=this._awaitingRefill?null:this._reportedText;return a!==null&&i===this._reportId?this._applyResync(e,s,a):void 0}if(this._versionController.wasEchoed(r)||this._isCovered(e)){e.historyAnswer?.actionId!==void 0&&n===this._entityId&&this._takeHistoryAnswer({actionId:e.historyAnswer.actionId});return}if(n===this._entityId){this._reportSyncDrift("update-entity");const i=this._onRemoteChange(t,r,o);return e.historyAnswer&&this._takeHistoryAnswer(e.historyAnswer),i}}),k(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),W2(),F2(e.templateDirectivesPolicy??{});const t=e.guid===this._entityId,n=this._unsentLayers().some(r=>r.hasChanges());this._entityId=e.guid,this._onEntitySetEmitter.fire(e.guid),this._historyAction=null,this._editStack.clear(),this._sealed=[],this._releasing=!1,this._clearFrozen(),this._finishBarrier(t&&!this._holdsUnsent()&&!n),this._versionController.clear(),this._saveHeld=!1,this._awaitingRefill=!1,this._clearEchoLost(),this._onPendingSentEmitter.fire(),this._replaceText(e.html),this._rev=e.rev??null,this._coveredRev=this._rev,this._onReadyEmitter.fire()}),k(this,"_onRemoteChange",(e,t,n)=>t===void 0&&this._echoLost&&e.every(r=>!r.length)?this._whenNoneDispatched():new Promise((r,o)=>{const i=this._applyGroupsToCache(e),s=i.reduce((c,u)=>wt(c,u),[]);this._rev=n??null;const a=this._versionController.revertedAwaitingIds();this._versionController.apply(s,t,n!==void 0&&!this._echoLost,i);const l=[...this._lostChangeIds].filter(c=>a.has(c)&&this._versionController.isRevertedAwaiting(c)&&this.hasChanges());!this._versionController.hasDispatched()&&!this._awaitingRefill&&!l.length&&(this._versionController.forgetReverted(this._lostChangeIds),this._clearEchoLost(),this._flushPendingSave()),this._whenNoneDispatched().then(r)})),k(this,"onReady",this._onReadyEmitter.event),k(this,"onEntitySet",this._onEntitySetEmitter.event),k(this,"onHistoryAnswer",this._onHistoryAnswerEmitter.event),k(this,"onHistoryAction",this._onHistoryActionEmitter.event),k(this,"onHistoryActionSent",this._onHistoryActionSentEmitter.event),k(this,"onHistoryActionAnswered",this._onHistoryActionAnsweredEmitter.event),this.addDisposable(K.addListenerAsync(Le.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(K.addListenerAsync(Le.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this.addDisposable(K.addListenerAsync(Le.SANDBOX_CANVAS_SYNCED,e=>this.whenSynced(e?.applied))),this._versionController.onApply(this._onApply.bind(this)),this.addDisposable({dispose:()=>clearTimeout(this._recoveryTimer)})}loadState(e){this._entityId=e.entityId;const t=[[{range:Wi(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._unsentLayers();if(t.every(i=>!i.hasChanges())){super.applyEdits(ar,Xr(e));return}let n=e;const r=[];let o=-1;for(const[i,s]of t.entries()){const a=s.get();if(!a){r.push(null);continue}const l=Wa(a,n,"after"),c=l&&Wa(n,a,"before");if(!l||!c){o=i;break}r.push(l),n=c}if(o>=0){this._dropLayersFrom(o,t,n),t.slice(0,o).forEach((i,s)=>{const a=r[s];a&&i.replace(a)}),this._compactSealed();return}try{this._applyingRemote=!0,super.applyEdits(ar,Xr(n))}finally{this._applyingRemote=!1}t.forEach((i,s)=>{const a=r[s];a&&i.replace(a)}),this._compactSealed()}_dropLayersFrom(e,t,n){const r=t.slice(e).reduce((a,l)=>wt(a,l.get()??[]),[]),o=[],i=[],s=Math.max(e-1,0);this._sealed.splice(Math.max(e-1-this._queuedBarriers.length,0));for(const a of this._queuedBarriers.splice(s))o.push(...a.sends),i.push(...a.resolves);e===0&&(this._frozenStack.clear(),o.unshift(...this._barrierSends.splice(0)),i.unshift(...this._barrierResolves.splice(0))),this._editStack.clear(),this._setSaveHeld(this._saveHeld&&this._sealed.length>0),super.applyEdits(ar,Xr(wt(Bn(r),n))),this._runBarrier(o,i,!1)}_unsentLayers(){return[this._frozenStack,...this._queuedBarriers.map(e=>e.stack),...this._sealed.map(e=>e.stack),this._editStack]}_unsentChanges(){return this._unsentLayers().reduce((e,t)=>wt(e,t.get()??[]),[])}_textWithoutUnsent(){return Ak(this.getText(),Bn(this._unsentChanges()))}isApplyingRemote(){return this._applyingRemote}_flushPendingSave(){this._versionController.hasRevertedAwaiting()||(this._releaseBarrier(),this._sealed.length&&(this._sendSealed(),this._onPendingSentEmitter.fire()))}_setSaveHeld(e){const t=this._saveHeld&&!e;this._saveHeld=e,t&&this._onPendingSentEmitter.fire()}_isSent(e=!1){return!this._frozenStack.hasChanges()&&(!this._sealed.length||e&&this._saveHeld)}_seal(e){if(this._editStack.hasChanges()){const t=e?0:V2(this._editStack.get()),n=new fd;n.takeFrom(this._editStack),this._sealed.push({stack:n,undoStop:e,serviceRemoval:t})}this._compactSealed()}_compactSealed(){const e=this._sealed.length>0,t=[];for(const n of this._sealed){const r=t[t.length-1];if(n.stack.hasChanges()){if(!r||!j2(r,n)){t.push(n);continue}r.stack.absorb(n.stack),r.undoStop||(r.undoStop=n.undoStop),r.serviceRemoval+=n.serviceRemoval,r.stack.hasChanges()||t.pop()}}this._sealed=t,e&&!t.length&&(this._releasing=!1,this._saveHeld=!1,this._onPendingSentEmitter.fire())}_sendSealed(e=!1,t=!1){if(this._compactSealed(),this._rev!==null&&(this._awaitsEcho()||this._frozenStack.hasChanges()||this._holdsUnsent()))return!0;const n=e||this._sealed.some(o=>o.undoStop);if(!t&&!this._releasing&&this._beforeSaveEmitter.fire(n)===!1)return this._setSaveHeld(this._sealed.length>0),!1;const r=this._entityId;if(!r)return!1;for(;this._sealed.length;){const[o]=this._sealed.splice(0,1),i=o?.stack.get()?.flatMap(s=>kg(s));if(o&&i?.length&&(this._dispatch(r,i,o.undoStop,o.stack.typedAt(),o.stack.selection(),o.stack.closesStep()),this._rev!==null))break}return this._compactSealed(),this._setSaveHeld(!1),!0}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._unsentLayers().reduce((t,n)=>t+(n.get()?.length??0),0);return this._versionController.countDispatched()+e}_onEchoLost(e,t){if(this._lostChangeIds.add(e),this._echoLost)return;this._echoLost=!0,this._armRecoveryDeadline();const n=this._countUnsent(),r=this._textWithoutUnsent(),o=++this._reportId;this._reportedText=r,Ar("echo-timeout",()=>({guid:this._entityId,at:"update-entity",unsent:n,textFingerprint:gg(r),canvasText:r,reportId:o,dropsCovered:!0,originId:this._originId})),this._onEchoLostEmitter.fire()}holdsTypedEdits(){return this._frozenStack.hasChanges()}hasEditsAfterBoundary(){return this._editStack.hasChanges()||this._sealed.length>0}markHistoryAction(){const e=this._nextActionId++;return this._historyAction={id:e,edits:this._canvasEdits,answered:!1},this._onHistoryActionEmitter.fire(e),e}noteHistoryActionSent(e){this._onHistoryActionSentEmitter.fire(e)}noteSelection(e,t){const n=this._sealed.length>0&&this._editStack.selection()===null;this._editStack.noteSelection(e,t||n)}_takeHistoryAnswer({actionId:e,selection:t}){const n=this._historyAction,r=e!==void 0,o=r&&n?.id===e?n:void 0;o&&(o.answered=!0);const i=r?o?.edits===this._canvasEdits:!n||n.answered;t&&i&&!this.hasChanges()&&!this._awaitsEcho()&&!this._holdsUnsent()&&this._onHistoryAnswerEmitter.fire({selection:t,own:r}),o&&this._onHistoryActionAnsweredEmitter.fire(o.id)}_holdsUnsent(){return this._echoLost||this._awaitingRefill}async whenSynced(e){const t=new ye;let n=!1;const r=setTimeout(()=>{n=!0,t.fire()},U2),o=e!==void 0&&e.guid!==this._entityId;try{return e&&!o&&this._settleByReceipt(e),await this.collectCanvasEdits(),o?this._syncState():await this._syncedBefore(t,()=>n)}finally{clearTimeout(r),t.dispose(),this._releasing=!1}}async _syncedBefore(e,t){const n=()=>({synced:!1,unsent:this._countUnsent()});let r=0;if(t())return this._syncState();for(;;){if(this._echoLost){if(!await this._awaitEchoRecovery(e)||t())return n();continue}if(this._saveHeld&&r++<Gb&&(this._releasing=!0,this._sendSealed(!0,!0)),await this._awaitAny([this._onEchoLostEmitter.event,e.event],this.whenSent(!this._releasing)),t())return n();if(!this._echoLost&&!(this._sealed.length>0&&!this._saveHeld)){if(this._saveHeld){if(r<Gb)continue;return n()}if(!this._versionController.hasDispatched())return{synced:!0,unsent:0};if(await this._awaitAny([this._versionController.onEmpty,this._onEchoLostEmitter.event,e.event]),t())return n()}}}_syncState(){return this._hasUnsynced()?{synced:!1,unsent:this._countUnsent()}:{synced:!0,unsent:0}}_settleByReceipt(e){const t=e.originId===void 0||e.originId===this._originId?e.changeId:0;for(const n of this._versionController.awaitingIds())n<=t?this._echoWatchdog.giveUpNow(n):this._echoWatchdog.resendNow(n)}_hasUnsynced(){return this._holdsUnsent()||this._sealed.length>0||this._frozenStack.hasChanges()||this._versionController.hasDispatched()}_awaitAny(e,t){return new Promise(n=>{const r=()=>{o.forEach(i=>i.dispose()),n()},o=e.map(i=>i(r));t?.then(r)})}_awaitEchoRecovery(e){return new Promise(t=>{const n=setTimeout(()=>i(!1),Hu),r=this._onEchoRecoveredEmitter.event(()=>i(!0)),o=e.event(()=>i(!1)),i=s=>{clearTimeout(n),r.dispose(),o.dispose(),t(s)}})}_armRecoveryDeadline(){clearTimeout(this._recoveryTimer),this._recoveryTimer=setTimeout(()=>{this._recoveryOverdue=!0,this._finishBarrier(!1)},Hu)}_connectionLost(){return this._recoveryOverdue||this._awaitingRefill}_clearEchoLost(){const e=this._echoLost;clearTimeout(this._recoveryTimer),this._recoveryOverdue=!1,this._echoLost=!1,this._reportedText=null,this._lostChangeIds.clear(),e&&this._onEchoRecoveredEmitter.fire()}_isCovered({guid:e,rev:t,changeId:n}){return this._coveredRev===null||t===void 0||e!==this._entityId||t>this._coveredRev?!1:!(n!==void 0&&(this._versionController.isInFlight(n)||this._versionController.isRevertedAwaiting(n)))}_applyResync({edits:e,rev:t},n,r){this._versionController.clear();try{this._resyncing=!0,this._cache.applyEdits(ar,[{range:Wi(this._cache),text:r}]),this._rev=t??null,this._applyToCache(e),this._versionController.apply(this._changesToCache())}catch{}finally{this._resyncing=!1}const o=gg(this._cache.getText());if(o.length!==n.length||o.hash!==n.hash){this._awaitingRefill=!0,this._finishBarrier(!1),Ar("resync-failed",()=>({guid:this._entityId,textFingerprint:o}));return}this._coveredRev=this._rev,this._clearEchoLost(),this._flushPendingSave(),this._onReadyEmitter.fire()}_replaceText(e){this._cache.applyEdits(ar,[{range:Wi(this._cache),text:e}]),super.applyEdits(ar,[{range:Wi(this),text:e}])}_reportSyncDrift(e){if(this.hasChanges()||this._versionController.hasDispatched())return;const t=E2(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;Ar("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}_changesToCache(){const e=this._textWithoutUnsent(),t=this._cache.getText(),n=pg(e,t);if(!n)return[];const{start:r,fromEnd:o,toEnd:i}=n;return[new qt(r,e.slice(r,o),r,t.slice(r,i))]}_applyToCache(e){return this._applyGroupsToCache(e).reduce((t,n)=>wt(t,n),[])}_applyGroupsToCache(e){const t=[];for(const n of e){const r=n.reverse();t.push(xo(r,this._cache)),this._cache.applyEdits(ar,r)}return t}_whenNoneDispatched(){return new Promise(e=>{if(!this._versionController.hasDispatched()){this._onReadyEmitter.fire(),e();return}const t=this._versionController.onEmpty(()=>{t.dispose(),e()})})}applyEdits(e,t){if(!this._reverting){const n=xo(t,this);n.length&&this._canvasEdits++,this._editStack.add(n),super.applyEdits(e,t),this._editLog.push(t)}}correctOffset(e,t){const n=this._unsentLayers();return t?n.reduce((r,o)=>o.correctOffset(r,!0),e):n.reduceRight((r,o)=>o.correctOffset(r),e)}correctRange(e,t){return{start:this.correctOffset(e.start,t),end:this.correctOffset(e.end,t)}}_awaitsEcho(){return this._versionController.hasDispatched()||this._versionController.hasRevertedAwaiting()}saveChanges(e=!0,t=!1){return this._reverting?!1:(this._seal(e),this._sendSealed(e,t))}closeStep(){this._editStack.closeStep()}_dispatch(e,t,n,r,o=null,i=!1){const s=this._nextChangeId++;this._versionController.append(t,s);const a={guid:e,pushUndoStop:n,edits:Xr(t),changeId:s,originId:this._originId,...this._rev!==null?{baseRev:this._rev}:{},...r?{typedAt:r}:{},...o?{selection:o}:{},...i?{closesStep:i}:{}},l=()=>K.send(Le.APPLICATION_UPDATE_ENTITY,a);l(),this._echoWatchdog.watch(s,()=>{this._versionController.isInFlight(s)&&l()})}async sendAfterCurrentEdits(e,t=!1){if(this._connectionLost()&&this.hasChanges())return!1;this._seal(t);const n=this._frozenStack.hasChanges();if(!n&&!this._sealed.length)return e(),!0;const r=this._rev!==null&&(this._awaitsEcho()||this._holdsUnsent());return!n&&!r&&(this._sendSealed(),!this._sealed.length||this._saveHeld)?(e(),!0):new Promise(o=>this._freezeSealed(e,o))}_freezeSealed(e,t){this._compactSealed();for(const{stack:r,undoStop:o}of this._sealed.splice(0))this._frozenStack.hasChanges()||this._queuedBarriers.length?this._queuedBarriers.push({stack:r,undoStop:o,sends:[],resolves:[]}):(this._frozenStack.takeFrom(r),this._frozenUndoStop=o);this._setSaveHeld(!1);const n=this._queuedBarriers[this._queuedBarriers.length-1];(n?.sends??this._barrierSends).push(e),(n?.resolves??this._barrierResolves).push(t)}_releaseBarrier(){const e=this._frozenStack.get();if(!e)return;const t=this._frozenStack.typedAt(),n=this._frozenStack.selection(),r=this._frozenStack.closesStep();this._frozenStack.clear(),this._entityId&&this._dispatch(this._entityId,e.flatMap(a=>kg(a)),this._frozenUndoStop,t,n,r);const o=this._barrierSends,i=this._barrierResolves,s=this._queuedBarriers.shift();this._barrierSends=s?.sends??[],this._barrierResolves=s?.resolves??[],s&&(this._frozenStack.takeFrom(s.stack),this._frozenUndoStop=s.undoStop),this._runBarrier(o,i,!0)}_clearFrozen(){this._frozenStack.clear();for(const e of this._queuedBarriers.splice(0))this._barrierSends.push(...e.sends),this._barrierResolves.push(...e.resolves)}_finishBarrier(e){const t=this._barrierSends,n=this._barrierResolves;this._barrierSends=[],this._barrierResolves=[];for(const r of this._queuedBarriers)t.push(...r.sends.splice(0)),n.push(...r.resolves.splice(0));this._runBarrier(t,n,e)}_runBarrier(e,t,n){n&&e.forEach(r=>r()),t.forEach(r=>r(n)),this._onPendingSentEmitter.fire()}saveChangesAsync(e=!0){return new Promise(t=>{if(this.saveChanges(e),this._entityId||!this.hasChanges()||this._saveHeld){t();return}const n=setTimeout(()=>{r.dispose(),this._reportSaveTimeout(),t()},z2),r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})})}_reportSaveTimeout(){Ar("save-timeout",()=>({}))}hasChanges(){return this._editStack.hasChanges()||this._frozenStack.hasChanges()||this._sealed.length>0}},X2=class extends jb{constructor(e,t){super(),k(this,"_baseDocument",void 0),k(this,"_mappedDocument",void 0),k(this,"_mappings",[]),k(this,"_cachedMappedDocument",new Ja),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=xo(this.getMappings(n),this._baseDocument),o=Bn(this._mappings);if(t=wt(o,t),t=wt(t,r),this._mappings=r,t.length){const i=Xr(t);this._mappedDocument.applyEdits(e,qa(i))}}}correctOffset(e,t){const n=t?this._mappings:Bn(this._mappings),r=vu(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=Bn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Bn(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 qi(e,n)}unescape(e){const t=this.getRevertMappings(e);return qi(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=ar){const t=this._baseDocument.getText(),n=this.getMappings(t),r=qi(t,n);this._mappings=xo(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=xo(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=wt(o,t),t=wt(t,r),this._mappings=Bn(r),t.length){const i=Xr(t);this._baseDocument.applyEdits(e,qa(i))}}}},Y2="input, textarea, select, .monaco-editor",K2=/^(Arrow(Left|Right|Up|Down)|Home|End|PageUp|PageDown|Tab)$/;function Xb(e,t){return e?.node===t?.node&&e?.offset===t?.offset}function Z2(e,t){return Xb(e?.anchor,t?.anchor)&&Xb(e?.focus,t?.focus)}function rl(){const e=document.getSelection();if(!(!e?.rangeCount||!e.anchorNode||!e.focusNode))return{anchor:{node:e.anchorNode,offset:e.anchorOffset},focus:{node:e.focusNode,offset:e.focusOffset}}}var Q2=class extends Ce{constructor(e,t,n){super(),k(this,"_htmlDocument",void 0),k(this,"_mapping",void 0),k(this,"_remoteDocument",void 0),k(this,"_mark",void 0),k(this,"_pending",void 0),k(this,"_actionMark",void 0),k(this,"_moved",!1),this._htmlDocument=e,this._mapping=t,this._remoteDocument=n,this._listen(window,"keydown",!0),this._listen(window,"beforeinput",!0),this._listen(document,"selectionchange",!1,()=>{this._moved||(this._moved=!Z2(this._mark,this._actionMark))}),this._listen(window,"pointerdown",!0,()=>{this._moved=!0}),this._listen(window,"keydown",!1,r=>{this._moved||(this._moved=!r.defaultPrevented&&K2.test(r.key??""))}),this.addDisposable(e.beforeTextCommit(()=>this._beforeCommit())),this.addDisposable(e.onTextCommit(()=>this._afterCommit())),this.addDisposable(n.onHistoryAnswer(r=>this._restore(r))),this.addDisposable(n.onHistoryAction(()=>{this._actionMark=rl(),this._moved=!1}))}_listen(e,t,n,r){const o=i=>{this._mark=rl(),r?.(i)};e.addEventListener(t,o,n),this.addDispose(()=>e.removeEventListener(t,o,n))}_beforeCommit(){this._pending={before:this._toText(this._mark),opened:!this._remoteDocument.hasEditsAfterBoundary()}}_afterCommit(){const e=this._pending;if(this._pending=void 0,this._mark=rl(),e){const t={before:e.before,after:this._toText(this._mark)};this._remoteDocument.noteSelection(t,e.opened)}}_toText(e){const t=e&&this._htmlDocument.pointToOffset(e.anchor),n=e&&this._htmlDocument.pointToOffset(e.focus);if(t===void 0||n===void 0)return;const[r,o]=[this._mapping.correctOffset(t),this._mapping.correctOffset(n)].sort((i,s)=>i-s);return{start:r,end:o}}_toPoint(e){return this._htmlDocument.offsetToPoint(this._mapping.correctOffset(this._remoteDocument.correctOffset(e,!0),!0))}_restore({selection:e,own:t}){if(t&&this._moved||!t&&!document.hasFocus()||document.activeElement?.closest(Y2))return;const n=this._toPoint(e.start),r=e.end===e.start?n:this._toPoint(e.end);!n||!r||(document.getSelection()?.setBaseAndExtent(n.node,n.offset,r.node,r.offset),this._mark=rl())}};function J2(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function Ki(e){let t=e.head;if(!t){t=e.createElement("head");const n=J2(e);n.insertBefore(t,n.firstChild)}return t}function ex(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function tx(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function nx(e){const t=Ki(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 Yb="amp-custom";function rx(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function Kb(e,t,n){for(const r of t)if(ji.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(Ju(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 ji.isMediaRule(r)&&Kb(e,r.cssRules,n)}function Zb(e,t){const n=t.sheet;if(n){const i=new Set;Kb(e,n.cssRules,(s,a)=>{const l=rx(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>ji.isStyleRule(d)&&d.selectorText===`.${l}`)&&!i.has(u)&&(i.add(u),t.innerHTML=`
|
|
4
|
-
.${l} { ${s}: ${a} };
|
|
5
|
-
${t.innerHTML}`),l}),i.size&&(t.innerHTML=`
|
|
6
|
-
${[...i].join(`
|
|
7
|
-
`)};
|
|
8
|
-
${t.innerHTML}`)}const r=t.innerHTML,o=r.replace(/!important/g,"");r!==o&&(t.innerHTML=o)}function ox(e){const t=Ki(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(Yb)===""){Zb(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=`
|
|
9
|
-
${o.join("")}
|
|
10
|
-
`,i.setAttribute(Yb,""),t.append(i),Zb(e,i)}for(const i of n)i.remove()}var gd="<!doctype html>";function ix(e){const t=e.doctype;if(t){if(jg(t)===gd)return;const n=new DOMParser().parseFromString(gd,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString(gd,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function Qb(e,t={}){const n=document.createElement("amp-img"),r=await _L(e)||void 0,o=[];try{let i=e;for(;i&&Ju(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=tx(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={...ex(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))rr(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function sx(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push(Qb(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(Qb(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 ax(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=Ki(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function lx(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 Jb="https://cdn.ampproject.org/v0",ey=`${Jb}.js`,cx=`script[src='${ey}']`;function ux(e,t){return`${Jb}/${e.toLowerCase()}-${t}.js`}async function dx(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=Ki(e),a=n.createElementFn("script"),l=ux(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(`
|
|
11
|
-
`))}}}var qK=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),zK=function(e,t){return new URL(e,t).href},UK={},bd=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)})},ty=void 0;async function ol(){return ty||(ty=await bd(()=>Promise.resolve().then(()=>fu("./rules.CnnzdMsj.js")).then(e=>e.default),void 0,{}.url))}var yd=new Map;async function fx(){if(!yd.size){const e=await ol(),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))||[];yd.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return yd}var vd=new Map;async function mx(){if(!vd.size){const e=await ol();for(const t of e.declarations)vd.set(t.name,t)}return vd}var hx="$GLOBAL_ATTRS",Ed=new Map;async function px(){if(!Ed.size){const e=(await ol()).attrLists.find(t=>t.name===hx)?.attrs;if(e)for(const t of e)Ed.set(t.name,t)}return Ed}function gx(e){return Hn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function ny(e){return SL(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function ry(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--)ry(i[s],t,n)}if(Hn(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 ed(e)?o():Oo(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&Oo(e.nextSibling))&&r()}async function bx(e,t){const n=new Set,r=t.commit,o=m=>t.replaceSelectors(m.toLowerCase());if(t.replaceImages&&await sx(e,r),t.injectExtensions){const m=t.replaceSelectors(cx);if(!e.querySelector(m)){const h=t.createElementFn("script");h.setAttribute("src",ey),h.setAttribute("async",""),Ki(e).appendChild(h),r?.()}}t.injectRequiredTags&&(lx(e,t.createElementFn,o),ix(e),nx(e),ax(e),r?.()),t.replaceStylesAndLinks&&(ox(e),r?.());const i=await ol(),s=await fx(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[m,h]of s)if(!h.deprecation){m=o(m);let p=[...e.querySelectorAll(m)].filter(v=>!l.has(v));h.unique&&p.length&&(p=[p[0]]),t.injectRequiredTags&&h.required&&!p.length&&(p=[...p,t.createElementFn(h.name)]);for(const v of p){if(t.injectRequiredAttributes&&v.getAttribute("on")&&!v.getAttribute("tabindex")&&v.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let C=!1;for(const T of[...v.classList])T.startsWith("i-amphtml")&&(C=!0,v.classList.remove(T));C&&!v.classList.length&&v.removeAttribute("class")}const w=l.get(v);w&&w.priority>h.priority||l.set(v,h)}}r?.();for(const[m,h]of l){if(t.injectExtensions&&h.requiresExtension)for(const w of h.requiresExtension)n.add(w);const p=h.requiredParent?h.requiredParent==="$ROOT"?e:e.querySelector(h.requiredParent):null;p&&(!m.parentNode||t.moveInvalidTagPosition)?p!==m.parentNode&&(h.name==="HEAD"||Hn(p)&&p.tagName==="HEAD"?p.insertBefore(m,p.firstChild):p.appendChild(m)):m.parentNode||e.body.appendChild(m),t.removeUnsupportedTags&&a.delete(m),r?.();const v=await px();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const w=h.attrs,C=t.injectRequiredAttributes?new Set([...w].map(([y,g])=>g).filter(y=>y.required&&y.value)):void 0,T=m.getAttributeNames();for(const y of T){const g=w.get(y)||v.get(y);if(g){if(y==="id"||y==="class"||y==="style"){C?.delete(g);continue}if(t.removeUnsupportedAttributes){const E=m.getAttribute(y);if(g.value&&g.value.indexOf(E)<0){m.removeAttribute(y);continue}if(g.valueRegex&&!new RegExp(g.valueRegex).test(E)){m.removeAttribute(y);continue}if(g.disallowedValueRegex&&new RegExp(g.disallowedValueRegex).test(E)){m.removeAttribute(y);continue}const _=g.valueUrl;if(_){if(E===""){if(!_.allowEmpty){m.removeAttribute(y);continue}}else if(!(E.indexOf("<!--")>0&&E.indexOf("-->")>0)){if(!_.allowRelative)if(E.startsWith("#")||E.startsWith("/")){m.removeAttribute(y);continue}else{const b=_.protocol.length?_.protocol:["https"],S=E.substring(0,E.indexOf(":"));if(S){if(b.indexOf(S)<0){const A=b[0]+E.substring(E.indexOf(":"));if(URL.canParse(A))rr(m,y,A);else{m.removeAttribute(y);continue}}else if(!URL.canParse(E)){m.removeAttribute(y);continue}}else{const A=b[0]+E;if(URL.canParse(A))rr(m,y,A);else{m.removeAttribute(y);continue}}}}}}C?.delete(g)}else{if(y==="id"||y==="class"||y==="style")continue;t.removeUnsupportedAttributes&&m.removeAttribute(y)}}if(C)for(const y of C)rr(m,y.name,y.value[0])}r?.()}t.moveInvalidTagPosition&&(ry(e,e.body,o),r?.());for(const m of a)m.remove();if(r?.(),t.removeUnsupportedStyles){let p=function(y){const g=y.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const E of g){if(!E)continue;const _=y.getPropertyValue(E);y.getPropertyPriority(E)==="important"&&y.setProperty(E,_);const b=h.get(E);b?b.value?b.value.indexOf(_)<0&&y.removeProperty(E):b.valueRegex&&(new RegExp(b.valueRegex).test(_)||y.removeProperty(E)):y.removeProperty(E)}r?.()},v=function(y){return y.constructor.name==="CSSStyleRule"},w=function(y){return y.constructor.name==="CSSMediaRule"},C=function(y){const g=y.cssRules;for(let E=g.length-1;E>=0;E--){const _=g[E];v(_)?_.selectorText.indexOf("[")>=0||_.selectorText.indexOf(":")>=0?y.deleteRule(E):(p(_.style),_.style.cssText||y.deleteRule(E)):w(_)?(C(_),_.cssRules.length||y.deleteRule(E)):y.deleteRule(E)}};var c=p,u=v,d=w,f=C;const m=e.querySelectorAll("*"),h=await mx();for(const y of m)if(Ju(y)){const g=y.getAttribute("style");g&&(p(y.style),y.style.length?y.style.cssText!==g&&y.setAttribute("style",y.style.cssText):y.removeAttribute("style"))}const T=e.querySelector("style[amp-custom]");if(T){const y=T.sheet;y&&(C(y),T.innerHTML=[...y.cssRules].map(g=>g.cssText).join(`
|
|
12
|
-
`)),r?.()}}await dx(e,i.extensions.filter(({name:m})=>n.has(m)),t)}function yx(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function oy(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return bx(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=>yx(i.toLowerCase(),o),commit:t.commit})}function Sd(){K.send(Le.RELOAD),window.location.reload()}function vx(e){const t=new Ce;let n=[];function r(){n=[...new Set([...n,...document.querySelectorAll("script")])].filter(s=>uT(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(Le.RELOAD,Sd)),t.addDisposable(e.onChange(()=>{let i=r();for(const s of o)i.has(s)||Sd();o=i})),t}var il=[];function Ex(e){return il.push(e),{dispose:()=>{const t=il.indexOf(e);t!==-1&&il.splice(t,1)}}}function wd(e){for(const t of il){const n=t(e);if(n)return n}return e}function Sx(){const e=document.querySelector("[em-edit]");return e?wd(e):null}var sl=new Set(["img","image","input","video","source","em-replace"]);function iy(e){const t=e.toLowerCase(),n=sl.has(t);return sl.add(t),{dispose:()=>{n||sl.delete(t)}}}function wx(e){return sl.has(e.toLowerCase())}var Zi=[];function Cx(e){return Zi.push(e),{dispose:()=>{const t=Zi.indexOf(e);t!==-1&&Zi.splice(t,1)}}}function sy(e){return Zi.some(t=>t.isPathElement?.(e))}function _x(e,t){let n;for(const r of Zi){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function ay(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var Ax={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||ay(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(ay(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}}},Tx=class extends Ce{constructor(...e){super(...e),k(this,"hasAmp",!1)}};function kx(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function Lx(e,t,n){const r=kx(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function Nx(){const e=new Ce;return e.addDisposable($k(t=>t.startsWith("amp"))),e.addDisposable(Wk(t=>t==="class"||t==="style")),e}function xx(e){const t=o=>ny(o)&&e.getOuterHtml(o)!==""||gx(o)||EL(o),n=o=>{if(t(o))return!0;if(Hn(o)||ed(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new Tx;return r.addDisposable(Ex(o=>o.closest("amp-img"))),r.addDisposable(Cx(Ax)),r.addDisposable(Nx()),r.addDisposable(iy("amp-img")),r.addDisposable(iy("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(Le.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)oy(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)ny(l)&&l.remove();Sd()}})):s&&setTimeout(()=>{oy(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&&(Lx(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function Ox(e,t){const n=xx(t);return e.inject(Mu,n),{service:n,dispose(){n.dispose(),vn(e,Mu)}}}var Rx={name:"sandbox.amp",provides:[Mu],awaits:{services:[te]},setup(e){const{service:t}=Ox(e,D(e,te));e.addService(cg,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,f,m,h,p,v=!0,w=!1,C;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(v=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(w=r.autosemicolon);function T(S){return S===" "||S===`
|
|
13
|
-
`||S===" "||S==="\r"||S==="\f"}function y(S){return S==="'"||S==='"'}function g(S){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(S)>=0}function E(){for(var S=m;S>0;S-=1)a+=r.indent}function _(){a=C(a),v?a+=" {":(a+=`
|
|
14
|
-
`,E(),a+="{"),c!==`
|
|
15
|
-
`&&(a+=`
|
|
16
|
-
`),m+=1}function b(){var S;m-=1,a=C(a),a.length>0&&w&&(S=a.charAt(a.length-1),S!==";"&&S!=="{"&&(a+=";")),a+=`
|
|
17
|
-
`,E(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?C=function(S){return S.trimRight()}:C=function(S){return S.replace(/\s+$/,"")},f={Start:0,AtRule:1,Block:2,Selector:3,Ruleset:4,Property:5,Separator:6,Expression:7,URL:8},m=0,d=f.Start,p=!1,s=[],t=t.replace(/\r\n/g,`
|
|
18
|
-
`);o<i;){if(l=t.charAt(o),c=t.charAt(o+1),o+=1,y(h)){a+=l,l===h&&(h=null),l==="\\"&&c===h&&(a+=c,o+=1);continue}if(y(l)){a+=l,h=l;continue}if(p){a+=l,l==="*"&&c==="/"&&(p=!1,a+=c,o+=1);continue}if(l==="/"&&c==="*"){p=!0,a+=l,a+=c,o+=1;continue}if(d===f.Start){if(s.length===0&&T(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=f.Start,a+=l;continue}if(g(l)||l==="@"){if(u=C(a),u.length===0)s.length>0&&(a=`
|
|
19
|
-
|
|
20
|
-
`);else if(u.charAt(u.length-1)==="}"||u.charAt(u.length-1)===";")a=u+`
|
|
21
|
-
|
|
22
|
-
`;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=C(a),_(),d=u==="@font-face"?f.Ruleset:f.Block;continue}a+=l;continue}if(d===f.Block){if(g(l)){if(u=C(a),u.length===0)s.length>0&&(a=`
|
|
23
|
-
|
|
24
|
-
`);else if(u.charAt(u.length-1)==="}")a=u+`
|
|
25
|
-
|
|
26
|
-
`;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);E(),a+=l,d=f.Selector;continue}if(l==="}"){b(),d=f.Start;continue}a+=l;continue}if(d===f.Selector){if(l==="{"){_(),d=f.Ruleset;continue}if(l==="}"){b(),d=f.Start;continue}a+=l;continue}if(d===f.Ruleset){if(l==="}"){b(),d=f.Start,m>0&&(d=f.Block);continue}if(l===`
|
|
27
|
-
`){a=C(a),a+=`
|
|
28
|
-
`;continue}if(!T(l)){a=C(a),a+=`
|
|
29
|
-
`,E(),a+=l,d=f.Property;continue}a+=l;continue}if(d===f.Property){if(l===":"){a=C(a),a+=": ",d=f.Expression,T(c)&&(d=f.Separator);continue}if(l==="}"){b(),d=f.Start,m>0&&(d=f.Block);continue}a+=l;continue}if(d===f.Separator){if(!T(l)){a+=l,d=f.Expression;continue}y(c)&&(d=f.Expression);continue}if(d===f.Expression){if(l==="}"){b(),d=f.Start,m>0&&(d=f.Block);continue}if(l===";"){a=C(a),a+=`;
|
|
30
|
-
`,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 Mx(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 Px=["transform","transform-origin","overflow-x","height"];function Ix(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function Qi(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of Px)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 Dx(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(Qi(t,1),t.scrollWidth)}function Bx(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=Ix(Dx(e,n),t.innerWidth);return Qi(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function Hx(e,t){Qi(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;Qi(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 mt(e){const t=D(e,Re);return n=>{t.commit(n)}}function st(){return D(xt,te)}function Fx(){return D(xt,St)}function $x(){return D(xt,bn)}function ct(){return xt.getInstance(te)!==void 0}function Zr(e){D(xt,Re).commit(e)}function Wx(e){if(!ct())return e(),Promise.resolve(!0);const t=st();return t.commit(!1),t.flushCommit(),t.sendAfterCurrentEdits(e)}function qx(){if(!ct())return!1;const e=st();return e.commit(!1),e.flushCommit(),e.hasEditsAfterBoundary()}function zx(){return ct()?st().markHistoryAction():void 0}function Ux(e){ct()&&st().noteHistoryActionSent(e)}function Cd(e){return ct()&&st().holdInput(e)}function ly(e){return ct()&&st().holdInputBehindQueued(e)}function cy(){ct()&&st().closeUndoStep()}function _d(){return ct()&&st().isHoldingInput()}function uy(){return ct()&&st().hasHeldInput()}function dy(){ct()&&st().releaseHeldInput()}function fy(){return ct()&&st().holdsTypedEdits()}function Ji(e){return ct()?st().renderOnly(e):e()}function al(e){return e.nodeType===1&&e.localName==="template"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function Ad(e){return[...e.querySelectorAll?.("template")??[]].filter(al)}function Vx(e){return al(e)||Ad(e).length>0}function sn(e){const t=[...al(e)?[e]:[],...Ad(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)sn(r)}}function Ho(e){const t=[...al(e)?[e]:[],...Ad(e)];for(const n of t)for(;n.firstChild;)n.content.appendChild(n.firstChild)}function zt(){return ct()?st():void 0}function Ut(e){const t=zt();return t?t.applyHidden(e):e()}function Ve(e,t,...n){e&&Ut(()=>t?e.classList.add(...n):e.classList.remove(...n))}function Qr(e){const t=document.activeElement;t instanceof HTMLElement&&t!==document.body&&e.contains(t)&&Ut(()=>t.blur())}function my(e){zt()?.ownership.markService(e)}function hy(e){zt()?.ownership.markWrapper(e)}function jx(e){zt()?.ownership.markOuterWrapper(e)}function es(e,t){e.removeAllRanges(),Ut(()=>e.addRange(t))}function ll(e){const t=document.implementation.createHTMLDocument("").importNode(e,!0);nn(e,t);const n=new Map([[e,t]]),r=zt()?.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),Ho(t),{copy:t,counterpart:i=>n.get(i)}}function cl(e){return Ip(ll(e).copy)}function je(e){return VA(ll(e).copy)}function ts(e){const t=zt();return t?(t.flushCommit(),t.getOuterHtml(e)):e.outerHTML}function Td(e){return py(e)}function py(e){const t=zt();return!t||t.isInLetter(e)||!t.isUntracked(e)&&!t.ownership.isService(e)}function kd(e){const t=zt();return t?t.ownership.markOf(e)?"foreign":t.isInLetter(e)?"letter":t.isBehindHidden(e)?"foreign":"new":"letter"}function Ld(e,t){const n=[...e.querySelectorAll(t)].filter(Td);return n[n.length-1]??null}function gy(e,t){const n=o=>t==="next"?o.nextElementSibling:o.previousElementSibling;let r=n(e);for(;r&&!Td(r);)r=n(r);return r}function by(e,t){return[...e.childNodes].flatMap(n=>t.isInLetter(n)?[n]:by(n,t))}function Nd(e){Qr(e);const t=zt();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(...by(r,t))}function Gx(e){const t=[...e.childNodes],n=zt();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 Xx(){const e=zt();return e?{...e.scriptRunner,awake:()=>e.recordNow()}:{run:(t,n)=>n(),quiet:t=>t()}}function cr(e,t){const n=De(e,"dormant"),r=Vp(n);try{return t(n)}finally{Qp(r,Xx())}}function yy(e,t,n){cr(n,r=>xa(e,t,r))}function ns(e,t,n){return e==="new"?cr(t,n):n(De(t,!0))}function ur(e,t,n,r){ns(e,r,o=>xa(t,n,o))}function Ot(e){return function(...t){const n=zt(),r=()=>Reflect.apply(e,this,t);return n?n.applyOwn(r):r()}}function dr(e,t=!1,n){const r=()=>document.execCommand(e,t,n),o=zt();return o?o.applyCommand(r):r()}function xd(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)=>xd(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)&&xd(e[i],t[i]))}function vy(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&xd(o,a)||(o=a,i=!0,r(a))})},select(r){return vy(n,r)}};return n}function Ey(...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 vy(o,i)}};return o}var ul={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},rs=Ey({...ul});function an(){return rs.get()}var dl=new ye,Fo=new Map,O={source:rs,get(e){return an()[e]},getState(){return{...an()}},getStateRef(){return an()},set(e,t){if(an()[e]===t)return;rs.set({...an(),[e]:t}),dl.fire({[e]:t});const n=Fo.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(an()[r]!==o){rs.set({...an(),[r]:o}),n[r]=o,t=!0;const i=Fo.get(r);i&&i.forEach(s=>s(o))}}t&&dl.fire(n)},increment(e,t=1){const n=an()[e];typeof n=="number"&&O.set(e,n+t)},decrement(e,t=1){const n=an()[e];typeof n=="number"&&O.set(e,n-t)},subscribe(e){return dl.event(e)},subscribeToKey(e,t){Fo.has(e)||Fo.set(e,new Set);const n=Fo.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&Fo.delete(e)}},reset(){rs.set({...ul}),dl.fire(an())},resetKey(e){this.set(e,ul[e])},isEditingLocked(){const e=an();return e.lockEdit||e.lockEditor||e.lockEditorInit},isActiveElementLocked(){return an().activeElementLocked>0},getInitialState(){return ul}};function Sy(e){const t=()=>{Ve(document.body,e,"mceNonEditable"),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};ct()?st().applyHidden(t):t()}function os(){return O.get("lockEdit")||O.get("lockEditor")}function Yx(){return O.subscribe(e=>{"lockEditor"in e&&Sy(os())})}function Kx(e){return e.beforeChange(({domMutations:t})=>{const n=t.flatMap(r=>r.type==="Add"&&r.node instanceof Element?[r.node]:[]);n.length&&queueMicrotask(()=>{if(!os())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 Zx(e,t){const n=Ey(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var Qx=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function Jx(e){const t="ee1618fa";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 eO={name:"sandbox.hostFacts",provides:[ko],setup(e){const t=Object.fromEntries(Object.entries(sk).map(([n,r])=>[n,Zx(K,r).source]));e.inject(ko,t)}},tO={name:"sandbox.hostFactsToState",awaits:{services:[ko,Re,te]},setup(e){const t=D(e,ko),n=mt(e);t.theme.watch(r=>{O.set("applicationTheme",r),Jx(r),n(!1)}),t.commonStyles.watch(r=>{r&&O.set("commonStyles",r)}),t.flags.watch(r=>{for(const o of Qx)typeof r[o]<"u"&&O.set(o,r[o])}),Yx(),Kx(D(e,te)),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),Ve(document.body,!!r,"em-sandbox-preview")})}},nO={name:"sandbox.viewport",awaits:{services:[ko]},setup(e){D(e,ko).viewport.watch(t=>Mx(t,void 0,{state:O,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:O.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(ug).forEach(n=>n()),messageService:K}))}};function Tr(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function _t(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function rO(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),Ve(document.body,!0,"em-sandbox-discuss");else{const n=os()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),Ve(document.body,!1,"em-sandbox-discuss","em-sandbox-discuss_set-target")}}function oO(e,t){Ve(document.body,!!e.data.value,"em-sandbox-discuss_set-target")}function iO(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}}),Ve(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 sO(e,t){Ve(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 aO(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 lO={sandbox_lock_discuss:rO,sandbox_discuss_set_target:oO,sandbox_discuss_remove_target:iO,sandbox_discuss_reset:sO,sandbox_discuss_get_target:aO};function cO(e,t){O.set("lockEdit",!!e.data.data),Sy(os())}function uO(e,t){t.setEditorFocus(e.data.data)}function dO(e,t){let n=e.data.data;if(typeof n!="number")return;n=Fx().correctOffset(n,!0),n=$x().correctOffset(n,!0);let r=st().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 fO={sandbox_lock_edit:cO,editor_change_focus:uO,update_position_from_editor:dO};function mO(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 hO(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 pO(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 gO(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 bO={sandbox_set_attr_to_images:mO,sandbox_set_attr_to_links:hO,sandbox_set_position_to_img:pO,sandbox_set_position_to_link:gO},yO={brightness:100,contrast:100,sepia:0},fl={DARK:"dark",LIGHT:"light"},wy=!1;function vO(e){wy||(e.setFetchMethod(t=>window.fetch(t)),wy=!0)}function EO(){let e=null,t=fl.LIGHT;return{set(n){if(t=n,n===fl.DARK){e??(e=bd(()=>Promise.resolve().then(()=>fu("./darkreader.CLd5EML2.js")),void 0,{}.url)),e.then(r=>{t===fl.DARK&&(vO(r),r.enable(yO))}).catch(r=>{e=null});return}e?.then(r=>{t===fl.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var ml=EO();function SO(e,t){t.initPreview(!0)}function wO(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&ml.set(t)}var CO={init_preview:SO,sandbox_switch_theme:wO},Od={increment:e=>O.increment(e),decrement:e=>O.decrement(e)};function Sn(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(dg,{owner:e,handlers:s})}}}var _O={name:"sandbox.operationEnvironment",provides:[Cr],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(Cr,t)}},AO=Sn("discuss",lO,{services:[Re,Cr]},e=>{const t=mt(e),n=D(e,Cr);return()=>({commit:t,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:K,removeAllAttributes:Tr})}),TO=Sn("editor",fO,{services:[Fe,ft]},e=>{const t=D(e,Fe),n=D(e,ft);return()=>({applicationElementSettingsSet:t,messageService:K,setEditorFocus:r=>n.setEditorFocus(r)})}),kO=Sn("images",bO,{services:[Fe,Nt,Re,Cr]},e=>{const t=D(e,Fe),n=D(e,Nt),r=mt(e),o=D(e,Cr);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:K,setCursorPosition:i=>n(i)})}),LO=Sn("preview",CO,{services:[Fi]},e=>()=>({initPreview:t=>D(e,Fi)(t)})),NO={name:"sandbox.operationsDispatcher",setup(e){K.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(dg).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)}})}},xO=[_O,AO,TO,kO,LO,NO],OO=["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"],RO=["style","class","align","href"],MO=new Set([...OO,"em-element-path_img"]);function PO(e){return e.split(/\s+/).filter(t=>t&&!MO.has(t)).join(" ")}var IO=32;function DO(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function BO(e){const t=[e.tagName];for(const n of RO){const r=e.getAttribute(n),o=n==="class"&&r!==null?PO(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function HO(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<IO&&(t.push(BO(n)),!DO(n));)n=n.parentElement,r++;return t.join("||")}function FO(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:HO(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 $O(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 Cy=Promise.resolve(),_y=null;function WO(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 qO(e,t){_y=e,Cy=Cy.finally(()=>{_y===e&&WO(e,t)})}function zO(e,t="unknown"){const n=xt.getInstance(ft);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function UO(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 VO(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}var VK="br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object",is="data-em-caret",jK="",fr=e=>e();function Rt(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function Jr(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function kr(e){return(e??"").replaceAll("","")}function Rd(e){return kr(e.textContent)}function jO(e){return(e.nodeType===Node.TEXT_NODE||Rt(e))&&kr(e.textContent)===""}function Md(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r&&es(r,n)}function Ay(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(!Jr(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),kr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),kr(i.toString())===""?{em:r,side:"after"}:null}function Pd(e,t){if(!e.collapsed)return null;const n=Ay(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(kr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=Rt(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&&jO(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return Jr(i)?i:null}function hl(e,t,n=fr){return Id(e,t,n)}function Id(e,t,n=fr){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(Rt(r))o=r;else{const s=document.createElement("span");s.setAttribute(is,""),my(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 Md(i,i.length),o}var GO="p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote";function Dd(e,t=fr,n=e.parentElement?.closest('[contenteditable="true"]')){Ty(e,n)&&Id(e,"after",t)}function Ty(e,t){if(!t)return!1;const n=e.parentElement?.closest(GO),r=n&&t.contains(n)?n:t,o=document.createRange();o.setStartAfter(e),o.setEnd(r,r.childNodes.length);const i=o.cloneContents();return i.querySelectorAll(`[${is}]`).forEach(s=>s.remove()),!/[^ \t\n\r]/.test(i.textContent??"")&&!i.querySelector("br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object")}function ky(e){const t=Rt(e)&&Rd(e)===""?e.previousSibling:null;return t?.nodeName==="BR"&&Ty(t,t.parentElement?.closest('[contenteditable="true"]'))}function Bd(e,t=fr){if(!ky(e)||!e.parentNode)return null;const n=window.getSelection(),r=!!n?.anchorNode&&e.contains(n.anchorNode),o=document.createElement("br");e.before(o),t(()=>e.remove());const i=o.parentNode;return r&&Md(i,Array.prototype.indexOf.call(i.childNodes,o)),o}function Ly(){const e=window.getSelection(),t=e?.rangeCount?e.getRangeAt(0):null,n=t?.collapsed?t.startContainer:null,r=Rt(n)?n:n?.parentNode;return ky(r)?r:null}function XO(e,t=fr,n){return Array.from(e.querySelectorAll(`[${is}]`)).filter(r=>r!==n).map(r=>Bd(r,t)).some(Boolean)}function YO(e,t=fr,n){const r=Array.from(e.querySelectorAll(`[${is}]`)).filter(o=>o!==n&&kr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function KO(e,t=fr){const n=kr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),Md(r,r.length),r}function Ny(e){if(!e.collapsed)return;const{startContainer:t}=e,n=Rt(t)?t:t.parentNode;Rt(n)&&(Jr(n.previousSibling)?e.setStartAfter(n):e.setStartBefore(n),e.collapse(!0))}function xy(e){e.querySelectorAll(`[${is}]`).forEach(t=>{const n=kr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function ZO(e,t){const n=Pd(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o&&es(o,r),n}function QO(e,t){const n=Array.from(e.querySelectorAll("em-replace")).find(i=>Jr(i)&&t.intersectsNode(i)&&!Oy(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 Oy(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 JO(){document.execCommand("delete")}function eR(){const e=window.getSelection()?.getRangeAt(0);e?.deleteContents(),e?.collapse(!0)}function Ry(e,t=fr,n=JO){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=>Jr(l)&&Oy(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;Jr(l)?hl(l,"after",t):!l&&Jr(c)&&hl(c,"before",t)}return!0}function My(){const e=window.getSelection();return e?.rangeCount?Pd(e.getRangeAt(0),"backward"):null}function tR(e,t=fr){const n=e.isConnected?e:My();if(!n)return;const r=n.closest('[contenteditable="true"]');Ut(()=>r?.focus({preventScroll:!0})),hl(n,"after",t)}var Py=Symbol("held-input-replay"),Iy={insertText:"insertText",insertReplacementText:"insertText",deleteContentBackward:"delete",deleteContentForward:"forwardDelete",insertParagraph:"insertParagraph",insertLineBreak:"insertLineBreak",insertOrderedList:"insertOrderedList",insertUnorderedList:"insertUnorderedList",insertHorizontalRule:"insertHorizontalRule",formatBold:"bold",formatItalic:"italic",formatUnderline:"underline",formatStrikeThrough:"strikeThrough",formatSuperscript:"superscript",formatSubscript:"subscript",formatJustifyLeft:"justifyLeft",formatJustifyCenter:"justifyCenter",formatJustifyRight:"justifyRight",formatJustifyFull:"justifyFull",formatIndent:"indent",formatOutdent:"outdent",formatRemove:"removeFormat"},Dy={deleteWordBackward:["backward","word"],deleteWordForward:["forward","word"],deleteSoftLineBackward:["backward","lineboundary"],deleteSoftLineForward:["forward","lineboundary"],deleteHardLineBackward:["backward","paragraphboundary"],deleteHardLineForward:["forward","paragraphboundary"]};function nR(e){return e in Iy||e in Dy}var rR={Backspace:["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward"],Delete:["deleteContentForward","deleteWordForward","deleteSoftLineForward"]},By={ArrowLeft:["backward","character","word"],ArrowRight:["forward","character","word"],ArrowUp:["backward","line","paragraphboundary"],ArrowDown:["forward","line","paragraphboundary"],Home:["backward","lineboundary","documentboundary"],End:["forward","lineboundary","documentboundary"]};function Hd(){return/Mac/.test(window.navigator.platform)}function Hy(e){return Hd()?e.altKey:e.ctrlKey}function oR(e){const t=e.ctrlKey||e.metaKey;return t&&/^[cxv]$/i.test(e.key)||e.key==="Insert"&&(t||e.shiftKey)}function iR(e){return e.key in By||(e.ctrlKey||e.metaKey)&&e.key.length===1&&!oR(e)}function Fd(e){return Py in e}function $d(e){return e.target?.closest?.('[contenteditable="true"], editor')??void 0}function Fy(e){if(e.key.length===1&&!e.metaKey&&(!e.ctrlKey||e.altKey))return"insertText";if(e.key==="Enter"&&!e.ctrlKey&&!e.metaKey&&!e.altKey)return e.shiftKey?"insertLineBreak":"insertParagraph";const t=rR[e.key];if(t)return Hd()&&e.metaKey?t[2]:Hy(e)?t[1]:t[0]}function sR(e){const t=By[e.key];if(!t)return;const n=Hd()&&e.metaKey&&(e.key==="ArrowLeft"||e.key==="ArrowRight")?"lineboundary":Hy(e)?t[2]:t[1];document.getSelection()?.modify?.(e.shiftKey?"extend":"move",t[0],n)}function Wd(e){return Object.defineProperty(e,Py,{value:!0}),e}function $y(e,t){return e.isConnected&&t<=(e.nodeType===Node.TEXT_NODE?e.length:e.childNodes.length)}function Wy(e){if(!$y(e.startContainer,e.startOffset)||!$y(e.endContainer,e.endOffset))return;const t=document.createRange();return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t.toString()}function aR(e,t){return t===void 0||Wy(e)!==t?!1:(document.getSelection()?.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),!0)}function lR({inputType:e,data:t}){const n=Dy[e];if(n){const o=document.getSelection();o?.isCollapsed&&o.modify?.("extend",n[0],n[1]),dr(n[0]==="backward"?"delete":"forwardDelete");return}const r=Iy[e];r&&dr(r,!1,t??void 0)}function qy(e,t){if(t.target&&!aR(t.target,t.targetText))return;const{inputType:n,data:r}=t,o=Wd(new window.InputEvent("beforeinput",{inputType:n,data:r,bubbles:!0,cancelable:!0}));e.dispatchEvent(o)&&lR(t)}function cR(e,t){const n=Wd(new window.KeyboardEvent("keydown",{...t,bubbles:!0,cancelable:!0}));if(Object.defineProperty(n,"keyCode",{value:t.keyCode}),!e.dispatchEvent(n))return;const r=Fy(t);r?qy(e,{inputType:r,data:r==="insertText"?t.key:null}):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()==="a"?dr("selectAll"):sR(t)}var uR='[contenteditable="true"], editor';function qd(e){return(e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement)?.closest(uR)??void 0}function dR(){const e=document.getSelection();if(!e?.rangeCount||!e.anchorNode||!e.focusNode||!ct())return;const t=st(),n=t.pointToOffset({node:e.anchorNode,offset:e.anchorOffset}),r=t.pointToOffset({node:e.focusNode,offset:e.focusOffset});return n===void 0||r===void 0?void 0:{anchor:t.trackOffset(n),focus:t.trackOffset(r)}}function zy(e){e?.anchor.release(),e?.focus.release()}function Uy({node:e}){const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement,n=e.nodeType===Node.TEXT_NODE&&/^\s*$/.test(e.data)&&/\n/.test(e.data);return e.isConnected&&!!qd(e)&&!n&&!t?.closest("em-replace, [data-em-caret]")}function Vy(e){const t=e.current(),n=t===void 0||!ct()?void 0:st().offsetToPoint(t);return n&&Uy(n)?n:void 0}function fR(e){const t=e&&Vy(e.anchor),n=e&&Vy(e.focus);if(!(!t||!n))return document.getSelection()?.setBaseAndExtent(t.node,t.offset,n.node,n.offset),qd(t.node)}function mR(){const e=document.getSelection(),t=e?.rangeCount?e.anchorNode:null;return t&&Uy({node:t})?qd(t):void 0}function hR(e){const t=fR(e)??mR();return t}function pl(e,t){const n=dR(),r=e(()=>{ct()&&st().flushCommit();const o=hR(n);zy(n),o&&t(o)});return r||zy(n),r}function zd(e){e.preventDefault(),e.stopImmediatePropagation()}function pR(e){return/^(Tab|Escape|PageUp|PageDown|F\d{1,2})$/.test(e.key)||e.key==="Enter"&&(e.ctrlKey||e.metaKey)}var jy=e=>{if(!$d(e)||Fd(e)||e.isComposing||e.keyCode===229)return;const{key:t,code:n,keyCode:r,shiftKey:o,ctrlKey:i,metaKey:s,altKey:a}=e,l={key:t,code:n,keyCode:r,shiftKey:o,ctrlKey:i,metaKey:s,altKey:a},c=u=>cR(u,l);Fy(l)?_d()&&pl(Cd,c)&&zd(e):iR(l)?uy()&&pl(ly,c)&&zd(e):pR(l)&&uy()&&dy()},Gy=()=>{dy()},Xy=e=>{if(!$d(e)||!nR(e.inputType)||e.isComposing||Fd(e)||!_d())return;const t=e.inputType==="insertReplacementText",n=t?e.getTargetRanges?.()[0]:void 0;if(t&&!n)return;const r={inputType:e.inputType,data:t&&e.dataTransfer?.getData("text/plain")||e.data,target:n,targetText:n&&Wy(n)};pl(Cd,o=>qy(o,r))&&zd(e)};function gR(e){return"clipboardData"in e?e.clipboardData:e.dataTransfer}var bR=["text/html","text/plain"];function yR(e,t){const n=Array.from(t.types??[]),r=Object.fromEntries(bR.filter(o=>n.includes(o)).map(o=>[o,t.getData(o)]));return Wd({target:e.target,clipboardData:{types:Object.keys(r),files:[],getData:o=>r[o]??""},preventDefault:()=>{},stopPropagation:()=>{}})}function vR(e,t){if(Fd(e)||!_d()||!$d(e))return!1;try{const n=gR(e);if(!n||n.files?.length)return!1;const r=yR(e,n);if(!pl(Cd,()=>t(r)))return!1}catch{return e.preventDefault(),!1}return e.preventDefault(),e.stopPropagation(),!0}function ER(){return window.addEventListener("keydown",jy,!0),window.addEventListener("beforeinput",Xy,!0),window.addEventListener("pointerdown",Gy,!0),{dispose(){window.removeEventListener("keydown",jy,!0),window.removeEventListener("beforeinput",Xy,!0),window.removeEventListener("pointerdown",Gy,!0)}}}function SR(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 Yy(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 wR(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 CR(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 _R(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 AR(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 TR(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var kR={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function ss(e,t){const n=kR[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var LR=["strong","em","strike","sub","sup","b","i","s","u"];function NR(e,t){if(t)for(const n of LR)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 xR(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 GK="#1C52DC",XK="#1C52DC",YK="#1C52DC";function OR(e){if(typeof e.isContentEditable=="boolean")return e.isContentEditable;const t=e.closest("[contenteditable]");return!!t&&t.getAttribute("contenteditable")!=="false"}function Ky(e,t,n,r){const o=document.createRange();return o.selectNodeContents(e),r?o.setStart(t,n):o.setEnd(t,n),o.toString()!==""||!!o.cloneContents().querySelector("br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object")}function RR(e){const{startContainer:t,startOffset:n}=e,r=(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement)?.closest("a"),o=r?.parentElement;if(!e.collapsed||!r?.textContent||!o||!OR(o))return;const{display:i}=getComputedStyle(r);if(!(i&&i!=="inline")){if(!Ky(r,t,n,!0))e.setStartAfter(r);else if(!Ky(r,t,n,!1))e.setStartBefore(r);else return;e.collapse(!0)}}var MR="./js/sanitize-html/sanitize-html.js",Zy="data-sanitize-html-loader",gl=null,as=null;function Qy(){return typeof __emailmaker__<"u"?__emailmaker__:void 0}function PR(e){const t=Qy();if(typeof t?.moduleTransport!="function"||t.blobBlocked)return null;try{return t.moduleTransport(e)}catch{return null}}function IR(){const e=Qy();e&&(e.blobBlocked=!0)}function DR(){return new URL(MR,document.baseURI||window.location.href).href}function Ud(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function BR(){if(Ud())return Promise.resolve();const e=DR();return document.querySelector(`script[${Zy}]`)?as??Promise.resolve():(as||(as=HR(e).catch(t=>{throw as=null,t})),as)}async function HR(e){const t=PR(e);if(!t)return bl(e);const n=await t.catch(()=>null);if(!n)return bl(e);const r=URL.createObjectURL(n),o=await bl(r).then(()=>!0,()=>!1);URL.revokeObjectURL(r),o||(IR(),await bl(e))}function bl(e){return new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(Zy,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})}async function Jy(){const e=Ud();return e||(gl||(gl=(async()=>{await BR();const t=Ud();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw gl=null,t})),gl)}function yl(e){return e?.nodeType===Node.TEXT_NODE}function FR(e,t,n){if(t?.nodeType===Node.TEXT_NODE)return e.includes(t)?{text:t,offset:n}:null;if(!t||t!==e[0]?.parentNode)return null;const r=t.childNodes[n-1];if(r?.nodeType===Node.TEXT_NODE&&e.includes(r))return{text:r,offset:r.length};const o=t.childNodes[n];return o?.nodeType===Node.TEXT_NODE&&e.includes(o)?{text:o,offset:0}:null}function ev(e,t,n,r){const o=FR(e,n,r);if(!o)return null;let i=o.text,s=0;for(;i!==t&&i.previousSibling?.nodeType===Node.TEXT_NODE;)i=i.previousSibling,s+=i.length;return{head:i,offset:s+o.offset}}function tv(e,t,n,r){return e.node===t&&e.offset>n?{...e,offset:e.offset-r}:e}function Vd(e,t,n=()=>"letter"){const r=e?.previousSibling,o=t?.nextSibling,i=yl(r)&&n(r)==="letter",s=i&&yl(e),a=yl(t)&&yl(o)&&(n(o)==="letter"||i&&n(o)==="new");if(!s&&!a)return;const l=window.getSelection(),c=s?r:e,u=a?o:t;if(!c||!u)return;const d=[];for(let y=c;y;y=y===u?null:y.nextSibling)d.push(y);const f=c.parentNode,m=Array.prototype.indexOf.call(f?.childNodes??[],u),h={node:l?.anchorNode??null,offset:l?.anchorOffset??0},p={node:l?.focusNode??null,offset:l?.focusOffset??0},v=ev(d,c,h.node,h.offset),w=ev(d,c,p.node,p.offset);let C=null,T=0;for(let y=c;y;){const g=y===u?null:y.nextSibling;y.nodeType!==Node.TEXT_NODE?C=null:C?(C.appendData(y.data),y.parentNode?.removeChild(y),T++):C=y,y=g}if(l&&(v||w)){const y=v?{node:v.head,offset:v.offset}:tv(h,f,m,T),g=w?{node:w.head,offset:w.offset}:tv(p,f,m,T);y.node&&g.node&&l.setBaseAndExtent(y.node,y.offset,g.node,g.offset)}}var $R=["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],WR={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 qR(e){const t=/^\s*(\d+(?:\.\d+)?)(px|pt|em)?\s*$/i.exec(e??"");return t?`${t[1]}${(t[2]||"px").toLowerCase()}`:null}var zR=/<span\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,UR=/\sdata-(?:buffer|metadata)=(?:"[^"]*"|'[^']*')/gi;function VR(e){return e.replace(zR,t=>t.replace(UR,""))}function jR(e){const t=window.clipboardData;return("clipboardData"in e?e.clipboardData:e.dataTransfer)||t}function GR(e){return XR(e.replace(/\r\n?/g,`
|
|
31
|
-
`).replace(/\n$/,"").replace(/&/g,"&").replace(/\n/g,"<br>"))}function XR(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 Lr=new Map,YR=3e3,KR=1e4;function ZR(){const e=performance.now();return[...Lr.values()].some(t=>t.waiting&&e-t.startedAt<KR)}function QR(){for(const[e,t]of Lr)t.waiting&&(t.superseded=!0,Lr.delete(e))}function JR(){return Lr.size>0}async function eM(){let e;const t=new Promise(r=>{e=setTimeout(()=>{r()},YR)}),n=(async()=>{for(;Lr.size;)await Promise.allSettled(Lr.keys())})();await Promise.race([n,t]),clearTimeout(e)}function vl(e,t=!1,n,r,o){if(vR(e,a=>{vl(a,t,n,r,o)}))return Promise.resolve();if(ZR())return e.preventDefault(),e.stopPropagation(),Promise.resolve();QR();const i={startedAt:performance.now(),waiting:!0,superseded:!1},s=tM(e,t,n,r,o,i);return Lr.set(s,i),s.finally(()=>Lr.delete(s))}function nv(){const e=window.getSelection();e?.rangeCount&&RR(e.getRangeAt(0))}async function tM(e,t,n,r,o,i){e.preventDefault(),e.stopPropagation();const s=jR(e);if(!s)return;const a=s.getData("text/html"),l=s.getData("text/plain");try{let c=a;if(!c||t)nv(),c=GR(l);else{const d=await Jy();if(i.superseded)return;nv();const f=n?.text?.fontSize||16;let m=d(VR(c),{allowedTags:$R,allowedAttributes:WR,allowedStyles:{},transformTags:{span:function(y,g){let E="",_=!1,b=!1;if(g.style){const S=g.style.toLowerCase();(S.includes("font-weight: bold")||S.includes("font-weight:bold")||S.includes("font-weight: 700")||S.includes("font-weight:700"))&&(_=!0),(S.includes("font-style: italic")||S.includes("font-style:italic"))&&(b=!0),S.includes("text-decoration: underline")||S.includes("text-decoration:underline"),_&&b?(E="strong",g["data-italic"]="true"):_?E="strong":b&&(E="em")}return{tagName:E||"",attribs:g}},h1:function(y,g){return g["data-font-size"]=Math.round(1.5*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h2:function(y,g){return g["data-font-size"]=Math.round(1.25*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h3:function(y,g){return g["data-font-size"]=Math.round(1.125*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h4:function(y,g){return g["data-font-size"]=f.toString(),g["data-bold"]="true",g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h5:function(y,g){return g["data-font-size"]=Math.round(.875*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},ul:function(y,g){return g["data-list-type"]="unordered",delete g.style,delete g["margin-top"],delete g["margin-bottom"],delete g["padding-inline-start"],{tagName:"ul",attribs:g}},ol:function(y,g){return g["data-list-type"]="ordered",g.start&&(g["data-list-start"]=g.start),delete g.style,delete g.start,{tagName:"ol",attribs:g}},li:function(y,g){return g["data-list-item"]="true",delete g.style,delete g.dir,delete g["aria-level"],delete g["list-style-type"],{tagName:"li",attribs:g}},p:function(y,g){return{tagName:"br",attribs:{}}},div:"br",b:function(y,g){if(g.style){const E=g.style.toLowerCase();return E.includes("font-weight: bold")||E.includes("font-weight:bold")||E.includes("font-weight: 700")||E.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(y,g){if(g.style){const E=g.style.toLowerCase();return E.includes("font-style: italic")||E.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(y,g){return{tagName:"strike",attribs:g}}},textFilter:function(y){return y.replace(/\s+/g," ")}});m=m.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const h=document.createElement("div");h.innerHTML=m,(y=>{y.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((g,E)=>{const _=g.getAttribute("data-list-type")==="ordered",b=g.querySelectorAll("li[data-list-item]");let S=1;_&&g.getAttribute("data-list-start")&&(S=parseInt(g.getAttribute("data-list-start"),10)||1);const A=document.createDocumentFragment(),L=g.previousSibling;L&&(L.nodeType===Node.TEXT_NODE&&L.textContent.trim()!==""||L.nodeType===Node.ELEMENT_NODE&&L.tagName!=="BR")&&A.appendChild(document.createElement("br")),b.forEach((x,N)=>{const $=document.createElement("span");$.innerHTML=_?`${S}. `:"• ",A.appendChild($),(I=>{const Q=document.createElement("div");Q.innerHTML=I.innerHTML;let V=Q.firstChild;for(;V&&V.nodeType===1&&V.tagName==="BR";)Q.removeChild(V),V=Q.firstChild;if(!Q.hasChildNodes()){const ee=document.createTextNode("");Q.appendChild(ee)}for(;Q.firstChild;)A.appendChild(Q.firstChild)})(x),N<b.length-1&&A.appendChild(document.createElement("br")),S++}),g.parentNode.replaceChild(A,g)}),y.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(g=>{g.removeAttribute("data-list-type"),g.removeAttribute("data-list-item"),g.removeAttribute("data-list-start")})})(h),h.firstChild&&h.firstChild.nodeType===Node.ELEMENT_NODE&&h.firstChild.tagName==="BR"&&h.removeChild(h.firstChild),h.querySelectorAll("[data-font-size]").forEach(y=>{const g=qR(y.getAttribute("data-font-size"));let E=g?`font-size: ${g};`:"";y.getAttribute("data-bold")==="true"&&(E+=" font-weight: bold;"),y.getAttribute("data-italic")==="true"&&(E+=" font-style: italic;"),E&&y.setAttribute("style",E.trim()),y.removeAttribute("data-font-size"),y.removeAttribute("data-bold"),y.removeAttribute("data-italic")}),h.querySelectorAll("[data-italic]").forEach(y=>{const g=document.createElement("em");g.innerHTML=y.innerHTML,y.innerHTML="",y.appendChild(g),y.removeAttribute("data-italic")}),h.querySelectorAll("a").forEach(y=>{const g=y.getAttribute("href");if(!g||g.trim()==="")y.replaceWith(...y.childNodes);else{y.setAttribute("target","_blank");const E=n?.links?.color??"#1C52DC",_=n?.links?.underline??!0?"underline":"none";y.setAttribute("style",`color: ${E}; text-decoration: ${_};`)}});const v=h.querySelectorAll("*");let w=0;v.forEach(y=>{y.tagName!=="BR"&&y.tagName!=="SPAN"&&y.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(y.parentNode.removeChild(y),w++)}),h.querySelectorAll("span").forEach(y=>{y.innerHTML==="• "||/^\d+\. $/.test(y.innerHTML)||y.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&y.children.length===0&&(y.parentNode.removeChild(y),w++)});const C=window.getSelection(),T=C?.anchorNode?.nodeType===Node.ELEMENT_NODE?C.anchorNode:C?.anchorNode?.parentElement||null;NR(h,T),xR(h,T),c=h.innerHTML}const u=window.getSelection();if(u&&u.rangeCount>0){const d=u.getRangeAt(0);Ny(d),d.deleteContents();const f=document.createRange().createContextualFragment(c),m=f.firstChild,h=f.lastChild;d.insertNode(f),h?.nodeType===Node.TEXT_NODE&&d.setEnd(h,h.length),d.collapse(!1),Vd(m,h,kd)}}catch{if(i.superseded)return;dr("insertText",!1,l)}i.waiting=!1,r(e),o(),await new Promise(c=>setTimeout(c,0))}var El=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function rv(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function eo(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function ov(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?ov(t):!1)}function P(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 nM(e){try{return JSON.parse(e),!0}catch{return!1}}function iv(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 $o(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function rM(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 Sl(){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 jd(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 ls(e,t=Sl()){e=El(e)??"";const n=i=>El(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=ls(e,s),o))break}return o}function Gd(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 wl(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&&wl({elem:e.elem.previousSibling,width:e.width})}function oM(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 iM=e=>{if(e instanceof Text)return e.textContent||"";if(e instanceof Element){if(e.tagName==="BR")return`
|
|
32
|
-
`;if(e.classList?.contains(".em-element-path"))return"";if(e.classList?.contains("em-code"))return"⃠";if(e.tagName==="EM-REPLACE")return"⃡"}};function sv(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>sv(r,t)).join(""):n}function sM(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 aM(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function lM(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 Xd(){return Sx()}function cM(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 av(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)av(r,t)}}function uM(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function j(e){if(dM(e))return fM(e)?e.trim():mM(e)}var lv={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},dM=e=>typeof e=="string"&&e.trim()!=="",fM=e=>lv.HEX.test(e);function mM(e){const t=lv.RGB.exec(e)?.groups;if(!t)return;const n=hM(t);return gM(n)}var hM=e=>({r:Yd(e.r),g:Yd(e.g),b:Yd(e.b),a:pM(e.a)}),Yd=e=>parseInt(e||"0",10),pM=e=>parseFloat(e||"1"),gM=e=>`#${Kd(e.r)}${Kd(e.g)}${Kd(e.b)}`,Kd=e=>e.toString(16).padStart(2,"0"),bM=0;function ut(e){return e>=48&&e<=57}function Nr(e){return ut(e)||e>=65&&e<=70||e>=97&&e<=102}function Zd(e){return e>=65&&e<=90}function yM(e){return e>=97&&e<=122}function vM(e){return Zd(e)||yM(e)}function EM(e){return e>=128}function Cl(e){return vM(e)||EM(e)||e===95}function cv(e){return Cl(e)||ut(e)||e===45}function SM(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function _l(e){return e===10||e===13||e===12}function to(e){return _l(e)||e===32||e===9}function Fn(e,t){return!(e!==92||_l(t)||t===bM)}function Al(e,t,n){return e===45?Cl(t)||t===45||Fn(t,n):Cl(e)?!0:e===92?Fn(e,t):!1}function Qd(e,t,n){return e===43||e===45?ut(t)?2:t===46&&ut(n)?3:0:e===46?ut(t)?2:0:ut(e)?1:0}function uv(e){return e===65279||e===65534?1:0}var Jd=new Array(128),KK=128,ZK=130,QK=131,JK=132,eZ=133;for(let e=0;e<Jd.length;e++)Jd[e]=to(e)&&130||ut(e)&&131||Cl(e)&&132||SM(e)&&133||e||128;function ef(e){return e<128?Jd[e]:132}function Wo(e,t){return t<e.length?e.charCodeAt(t):0}function tf(e,t,n){return n===13&&Wo(e,t+1)===10?2:1}function qo(e,t,n){let r=e.charCodeAt(t);return Zd(r)&&(r=r|32),r===n}function cs(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(Zd(s)&&(s=s|32),s!==i)return!1}return!0}function wM(e,t){for(;t>=0&&to(e.charCodeAt(t));t--);return t+1}function Tl(e,t){for(;t<e.length&&to(e.charCodeAt(t));t++);return t}function nf(e,t){for(;t<e.length&&ut(e.charCodeAt(t));t++);return t}function zo(e,t){if(t+=2,Nr(Wo(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&Nr(Wo(e,t));t++);const n=Wo(e,t);to(n)&&(t+=tf(e,t,n))}return t}function kl(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!cv(n)){if(Fn(n,Wo(e,t+1))){t=zo(e,t)-1;continue}break}}return t}function Ll(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),ut(n)&&(t=nf(e,t+1),n=e.charCodeAt(t)),n===46&&ut(e.charCodeAt(t+1))&&(t+=2,t=nf(e,t)),qo(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),ut(n)&&(t=nf(e,t+1+r+1))}return t}function rf(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}Fn(n,Wo(e,t+1))&&(t=zo(e,t))}return t}function dv(e){if(e.length===1&&!Nr(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 fv=["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"],CM=16384;function Nl(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,CM)):e}var mv=10,_M=12,hv=13;function pv(e){const t=e.source,n=t.length,r=t.length>0?uv(t.charCodeAt(0)):0,o=Nl(e.lines,n),i=Nl(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===mv||c===hv||c===_M)&&(c===hv&&l+1<n&&t.charCodeAt(l+1)===mv&&(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 AM=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||pv(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||pv(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]}}}},ln=16777215,xr=24,TM=new Map([[2,22],[21,22],[19,20],[23,24]]),kM=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=Nl(this.offsetAndType,e.length+1),o=Nl(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&ln;for(a=o[f],s=a>>xr,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=TM.get(c),a=s<<xr|i}r[i++]=c<<xr|d,l===-1&&(l=u)}),r[i]=0<<xr|n,o[i]=n,o[n]=n;a!==0;){const c=a&ln;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]>>xr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&ln:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?cs(this.source,this.offsetAndType[e-1]&ln,this.offsetAndType[e]&ln,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&ln:this.offsetAndType[this.tokenCount]&ln: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]&ln,t=this.offsetAndType[t],this.tokenType=t>>xr,this.tokenEnd=t&ln):(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>>xr,this.tokenEnd=e&ln):(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]&ln: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&ln,s=o>>xr;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:fv[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function xl(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=Ll(e,c),Al(n(c),n(c+1),n(c+2))){u=12,c=kl(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=kl(e,c),cs(e,d,c,"url")&&n(c)===40){if(c=Tl(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(ef(f)){case d:c++;return;case 130:if(_l(f)){c+=tf(e,c,f),u=6;return}break;case 92:if(c===e.length-1)break;const m=n(c+1);_l(m)?c+=tf(e,c+1,m):Fn(f,m)&&(c=zo(e,c)-1)}}}function s(){for(u=7,c=Tl(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(ef(d)){case 41:c++;return;case 130:if(c=Tl(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=rf(e,c),u=8;return;case 34:case 39:case 40:case 133:c=rf(e,c),u=8;return;case 92:if(Fn(d,n(c+1))){c=zo(e,c)-1;break}c=rf(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=uv(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(ef(d)){case 130:u=13,c=Tl(e,c+1);break;case 34:i();break;case 35:cv(n(c+1))||Fn(n(c+1),n(c+2))?(u=4,c=kl(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:Qd(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:Qd(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):Al(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:Qd(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:Al(n(c+1),n(c+2),n(c+3))?(u=3,c=kl(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:Fn(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 Uo=null,Ge=class In{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return In.createItem(t)}allocateCursor(t,n){let r;return Uo!==null?(r=Uo,Uo=Uo.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=Uo,Uo=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=In.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 In;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 In;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 In;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(In.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(In.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(In.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(In.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(In.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 Ol(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}
|
|
33
|
-
`)}})}var gv=100,LM=60,NM=" ";function bv({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((f,m)=>String(u+m+1).padStart(l)+" |"+f).join(`
|
|
34
|
-
`)}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>gv&&(c=n-LM+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,NM),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+gv-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
|
|
35
|
-
`)}function yv(e,t,n,r,o){return Object.assign(Ol("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return bv({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
|
|
36
|
-
`+bv({source:t,line:r,column:o},2)}})}function xM(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 vv=()=>{},OM=33,RM=35,of=59,Ev=123,Sv=0;function MM(e){return function(){return this[e]()}}function sf(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 PM(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:sf(e.atrule),pseudo:sf(e.pseudo),node:sf(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]=MM(e.parseContext[n])}return{config:t,...t,...t.node}}function IM(e){let t="",n="<unknown>",r=!1,o=vv,i=!1;const s=new AM,a=Object.assign(new kM,PM(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:xM,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===Ev?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===Ev||c===of?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===OM||c===of?1:0},consumeUntilSemicolonIncluded(c){return c===of?2:0},createList(){return new Ge},createSingleNodeList(c){return new Ge().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 m=u.call(this,d);return i=!0,o(f,m),i=!1,m}},lookupNonWSType(c){let u;do if(u=this.lookupType(c++),u!==13)return u;while(u!==Sv);return Sv},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 qo(t,c,u)},cmpStr(c,u,d){return cs(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,Ll(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=fv[c].slice(0,-6).replace(/-/g," ").replace(/^./,m=>m.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(RM)&&(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(wM(t,t.length-1)):s.getLocation(this.tokenStart);throw new yv(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,xl),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:vv,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((h,p,v)=>{if(h===25){const w=a.getLocation(p,v),C=cs(t,v-2,v,"*/")?t.slice(p+2,v-2):t.slice(p+2,v);f(C,w)}});const m=a.context[d].call(a,u);return a.eof||a.error(),m},{SyntaxError:yv,config:a.config})}var DM=Sr((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}})),BM=Sr((e=>{var t=DM(),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,m=0,h=0,p,v;do{if(u>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(v=t.decode(c.charCodeAt(u++)),v===-1)throw new Error("Invalid base64 digit: "+c.charAt(u-1));p=!!(v&i),v&=o,m=m+(v<<h),h+=n}while(p);d.value=a(m),d.rest=u}})),af=Sr((e=>{function t(b,S,A){if(S in b)return b[S];if(arguments.length===3)return A;throw new Error('"'+S+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(b){var S=b.match(n);return S?{scheme:S[1],auth:S[2],host:S[3],port:S[4],path:S[5]}:null}e.urlParse=o;function i(b){var S="";return b.scheme&&(S+=b.scheme+":"),S+="//",b.auth&&(S+=b.auth+"@"),b.host&&(S+=b.host),b.port&&(S+=":"+b.port),b.path&&(S+=b.path),S}e.urlGenerate=i;var s=32;function a(b){var S=[];return function(A){for(var L=0;L<S.length;L++)if(S[L].input===A){var x=S[0];return S[0]=S[L],S[L]=x,S[0].result}var N=b(A);return S.unshift({input:A,result:N}),S.length>s&&S.pop(),N}}var l=a(function(S){var A=S,L=o(S);if(L){if(!L.path)return S;A=L.path}for(var x=e.isAbsolute(A),N=[],$=0,R=0;;)if($=R,R=A.indexOf("/",$),R===-1){N.push(A.slice($));break}else for(N.push(A.slice($,R));R<A.length&&A[R]==="/";)R++;for(var I,Q=0,R=N.length-1;R>=0;R--)I=N[R],I==="."?N.splice(R,1):I===".."?Q++:Q>0&&(I===""?(N.splice(R+1,Q),Q=0):(N.splice(R,2),Q--));return A=N.join("/"),A===""&&(A=x?"/":"."),L?(L.path=A,i(L)):A});e.normalize=l;function c(b,S){b===""&&(b="."),S===""&&(S=".");var A=o(S),L=o(b);if(L&&(b=L.path||"/"),A&&!A.scheme)return L&&(A.scheme=L.scheme),i(A);if(A||S.match(r))return S;if(L&&!L.host&&!L.path)return L.host=S,i(L);var x=S.charAt(0)==="/"?S:l(b.replace(/\/+$/,"")+"/"+S);return L?(L.path=x,i(L)):x}e.join=c,e.isAbsolute=function(b){return b.charAt(0)==="/"||n.test(b)};function u(b,S){b===""&&(b="."),b=b.replace(/\/$/,"");for(var A=0;S.indexOf(b+"/")!==0;){var L=b.lastIndexOf("/");if(L<0||(b=b.slice(0,L),b.match(/^([^\/]+:\/)?\/*$/)))return S;++A}return Array(A+1).join("../")+S.substr(b.length+1)}e.relative=u;var d=(function(){return!("__proto__"in Object.create(null))})();function f(b){return b}function m(b){return p(b)?"$"+b:b}e.toSetString=d?f:m;function h(b){return p(b)?b.slice(1):b}e.fromSetString=d?f:h;function p(b){if(!b)return!1;var S=b.length;if(S<9||b.charCodeAt(S-1)!==95||b.charCodeAt(S-2)!==95||b.charCodeAt(S-3)!==111||b.charCodeAt(S-4)!==116||b.charCodeAt(S-5)!==111||b.charCodeAt(S-6)!==114||b.charCodeAt(S-7)!==112||b.charCodeAt(S-8)!==95||b.charCodeAt(S-9)!==95)return!1;for(var A=S-10;A>=0;A--)if(b.charCodeAt(A)!==36)return!1;return!0}function v(b,S,A){var L=y(b.source,S.source);return L!==0||(L=b.originalLine-S.originalLine,L!==0)||(L=b.originalColumn-S.originalColumn,L!==0||A)||(L=b.generatedColumn-S.generatedColumn,L!==0)||(L=b.generatedLine-S.generatedLine,L!==0)?L:y(b.name,S.name)}e.compareByOriginalPositions=v;function w(b,S,A){var L=b.originalLine-S.originalLine;return L!==0||(L=b.originalColumn-S.originalColumn,L!==0||A)||(L=b.generatedColumn-S.generatedColumn,L!==0)||(L=b.generatedLine-S.generatedLine,L!==0)?L:y(b.name,S.name)}e.compareByOriginalPositionsNoSource=w;function C(b,S,A){var L=b.generatedLine-S.generatedLine;return L!==0||(L=b.generatedColumn-S.generatedColumn,L!==0||A)||(L=y(b.source,S.source),L!==0)||(L=b.originalLine-S.originalLine,L!==0)||(L=b.originalColumn-S.originalColumn,L!==0)?L:y(b.name,S.name)}e.compareByGeneratedPositionsDeflated=C;function T(b,S,A){var L=b.generatedColumn-S.generatedColumn;return L!==0||A||(L=y(b.source,S.source),L!==0)||(L=b.originalLine-S.originalLine,L!==0)||(L=b.originalColumn-S.originalColumn,L!==0)?L:y(b.name,S.name)}e.compareByGeneratedPositionsDeflatedNoLine=T;function y(b,S){return b===S?0:b===null?1:S===null?-1:b>S?1:-1}function g(b,S){var A=b.generatedLine-S.generatedLine;return A!==0||(A=b.generatedColumn-S.generatedColumn,A!==0)||(A=y(b.source,S.source),A!==0)||(A=b.originalLine-S.originalLine,A!==0)||(A=b.originalColumn-S.originalColumn,A!==0)?A:y(b.name,S.name)}e.compareByGeneratedPositionsInflated=g;function E(b){return JSON.parse(b.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=E;function _(b,S,A){if(S=S||"",b&&(b[b.length-1]!=="/"&&S[0]!=="/"&&(b+="/"),S=b+S),A){var L=o(A);if(!L)throw new Error("sourceMapURL could not be parsed");if(L.path){var x=L.path.lastIndexOf("/");x>=0&&(L.path=L.path.substring(0,x+1))}S=c(i(L),S)}return l(S)}e.computeSourceURL=_})),HM=Sr((e=>{var t=af(),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})),FM=Sr((e=>{var t=af();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})),$M=Sr((e=>{var t=BM(),n=af(),r=HM().ArraySet,o=FM().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 m=a.sourceContentFor(d);m!=null&&u.setSourceContent(d,m)}),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,m=new r;this._mappings.unsortedForEach(function(h){if(h.source===u&&h.originalLine!=null){var p=a.originalPositionFor({line:h.originalLine,column:h.originalColumn});p.source!=null&&(h.source=p.source,c!=null&&(h.source=n.join(c,h.source)),d!=null&&(h.source=n.relative(d,h.source)),h.originalLine=p.line,h.originalColumn=p.column,p.name!=null&&(h.name=p.name))}var v=h.source;v!=null&&!f.has(v)&&f.add(v);var w=h.name;w!=null&&!m.has(w)&&m.add(w)},this),this._sources=f,this._names=m,a.sources.forEach(function(h){var p=a.sourceContentFor(h);p!=null&&(c!=null&&(h=n.join(c,h)),d!=null&&(h=n.relative(d,h)),this.setSourceContent(h,p))},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,m="",h,p,v,w,C=this._mappings.toArray(),T=0,y=C.length;T<y;T++){if(p=C[T],h="",p.generatedLine!==l)for(a=0;p.generatedLine!==l;)h+=";",l++;else if(T>0){if(!n.compareByGeneratedPositionsInflated(p,C[T-1]))continue;h+=","}h+=t.encode(p.generatedColumn-a),a=p.generatedColumn,p.source!=null&&(w=this._sources.indexOf(p.source),h+=t.encode(w-f),f=w,h+=t.encode(p.originalLine-1-u),u=p.originalLine-1,h+=t.encode(p.originalColumn-c),c=p.originalColumn,p.name!=null&&(v=this._names.indexOf(p.name),h+=t.encode(v-d),d=v)),m+=h}return m},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})),WM=$M(),wv=new Set(["Atrule","Selector","Declaration"]);function qM(e){const t=new WM.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&&wv.has(f.type)){const m=f.loc.start.line,h=f.loc.start.column-1;(r.line!==m||r.column!==h)&&(r.line=m,r.column=h,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&&wv.has(f.type)&&(o.line=s,o.column=a)};const u=e.emit;e.emit=function(f,m,h){for(let p=0;p<f.length;p++)f.charCodeAt(p)===10?(s++,a=0):a++;u(f,m,h)};const d=e.result;return e.result=function(){return l&&t.addMapping(i),{css:d(),map:t}},e}var Cv=se({safe:()=>Tv,spec:()=>jM}),zM=43,UM=45,lf=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},_v=[[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],["/","*"]],VM=_v.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 Av(e){const t=new Set(e.map(([n,r])=>lf(n)<<16|lf(r)));return function(n,r,o){const i=lf(r,o),s=o.charCodeAt(0);return(s===UM&&r!==1&&r!==2&&r!==15||s===zM?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var jM=Av(_v),Tv=Av(VM),GM=92;function XM(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 YM(e){xl(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function KM(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:Tv,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===GM&&this.emit(`
|
|
37
|
-
`,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=qM(s)),r.mode in Cv&&(s.tokenBefore=Cv[r.mode]));const a={node:l=>s.node(l),children:XM,token:(l,c)=>s.token(l,c),tokenize:YM};return s.node(n),s.result()}}function ZM(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof Ge)&&(n.children=new Ge().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof Ge&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:cf}=Object.prototype,us=function(){};function kv(e){return typeof e=="function"?e:us}function Lv(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function QM(e,t){const n=t.structure,r=[];for(const o in n){if(cf.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 JM(e){const t={};for(const n in e.node)if(cf.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]=QM(n,r)}return t}function Nv(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 xv({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 eP(e){const t=JM(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)cf.call(t,c)&&t[c]!==null&&(n[c]=Nv(t[c],!1),r[c]=Nv(t[c],!0));const s=xv(n),a=xv(r),l=function(c,u){function d(w,C,T){const y=f.call(v,w,C,T);return y===o?!0:y===i?!1:!!(h.hasOwnProperty(w.type)&&h[w.type](w,v,d,p)||m.call(v,w,C,T)===o)}let f=us,m=us,h=n,p=(w,C,T,y)=>w||d(C,T,y);const v={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=kv(u.enter),m=kv(u.leave),u.reverse&&(h=r),u.visit)){if(s.hasOwnProperty(u.visit))h=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=Lv(f,u.visit),m=Lv(m,u.visit)}if(f===us&&m===us)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,m,h){if(u.call(this,f,m,h))return d=f,o}),d},l.findLast=function(c,u){let d=null;return l(c,{reverse:!0,enter(f,m,h){if(u.call(this,f,m,h))return d=f,o}}),d},l.findAll=function(c,u){const d=[];return l(c,function(f,m,h){u.call(this,f,m,h)&&d.push(f)}),d},l}function tP(e){return e}function nP(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 rP(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 oP(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>uf(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function uf(e,t,n,r){let o;switch(e.type){case"Group":o=oP(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return uf(e.term,t,n,r)+t(nP(e),e);case"Type":o="<"+e.name+(e.opts?t(rP(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 df(e,t){let n=tP,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),uf(e,n,r,o)}var Ov={offset:0,line:1,column:1};function iP(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 m=n[f].value;f===r&&(a=m.length,s=c.length),i!==null&&n[f].node===i&&(f<=r?l++:l=0),c+=m}return r===n.length||l>1?(u=Rl(i||t,"end")||ds(Ov,c),d=ds(u)):(u=Rl(i,"start")||ds(Rl(t,"start")||Ov,c.slice(0,s)),d=Rl(i,"end")||ds(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function Rl(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?ds(n):n:null}function ds({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 fs=function(e,t){const n=Ol("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},sP=function(e,t,n,r){const o=Ol("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=iP(r,n);return o.rawMessage=e,o.syntax=t?df(t):"<generic>",o.css=i,o.mismatchOffset=s,o.mismatchLength=a,o.message=e+`
|
|
38
|
-
syntax: `+o.syntax+`
|
|
39
|
-
value: `+(i||"<empty string>")+`
|
|
40
|
-
--------`+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},Ml=new Map,Vo=new Map,Pl=45,wn=aP,jo=lP;function ff(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Pl&&e.charCodeAt(t+1)===Pl}function Rv(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Pl&&e.charCodeAt(t+1)!==Pl){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function aP(e){if(Ml.has(e))return Ml.get(e);const t=e.toLowerCase();let n=Ml.get(t);if(n===void 0){const r=ff(t,0),o=r?"":Rv(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return Ml.set(e,n),n}function lP(e){if(Vo.has(e))return Vo.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=ff(t,n.length);if(!r&&(t=t.toLowerCase(),Vo.has(t))){const a=Vo.get(t);return Vo.set(e,a),a}const o=r?"":Rv(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 Vo.set(e,s),s}var Mv=["initial","inherit","unset","revert","revert-layer"],ms=43,$n=45,mf=110,Go=!0,cP=!1;function hf(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function hs(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function Or(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===ms||o===$n){if(n)return 0;t++}for(;t<e.value.length;t++)if(!ut(e.value.charCodeAt(t)))return 0;return r+1}function pf(e,t,n){let r=!1,o=hs(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(hf(e,ms)||hf(e,$n)){if(r=!0,o=hs(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!==ms&&i!==$n)return 0}return Or(e,r?0:1,r,o)}function uP(e,t){let n=0;if(!e)return 0;if(e.type===10)return Or(e,0,cP,n);if(e.type===1&&e.value.charCodeAt(0)===$n){if(!qo(e.value,1,mf))return 0;switch(e.value.length){case 2:return pf(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==$n?0:(n=hs(t(++n),n,t),e=t(n),Or(e,0,Go,n));default:return e.value.charCodeAt(2)!==$n?0:Or(e,3,Go,n)}}else if(e.type===1||hf(e,ms)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!qo(e.value,0,mf))return 0;switch(e.value.length){case 1:return pf(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==$n?0:(n=hs(t(++n),n,t),e=t(n),Or(e,0,Go,n));default:return e.value.charCodeAt(1)!==$n?0:Or(e,2,Go,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===ms||r===$n?1:0,i=o;for(;i<e.value.length&&ut(e.value.charCodeAt(i));i++);return i===o||!qo(e.value,i,mf)?0:i+1===e.value.length?pf(t(++n),n,t):e.value.charCodeAt(i+1)!==$n?0:i+2===e.value.length?(n=hs(t(++n),n,t),e=t(n),Or(e,0,Go,n)):Or(e,i+2,Go,n)}return 0}var dP=43,Pv=45,Iv=63,fP=117;function gf(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function mP(e,t){return e.value.charCodeAt(0)===t}function ps(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===Pv&&n&&r!==0)return ps(e,t+r+1,!1),6;if(!Nr(i)||++r>6)return 0}return r}function Il(e,t,n){if(!e)return 0;for(;gf(n(t),Iv);){if(++e>6)return 0;t++}return t}function hP(e,t){let n=0;if(e===null||e.type!==1||!qo(e.value,0,fP)||(e=t(++n),e===null))return 0;if(gf(e,dP))return e=t(++n),e===null?0:e.type===1?Il(ps(e,0,!0),++n,t):gf(e,Iv)?Il(1,++n,t):0;if(e.type===10){const r=ps(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!mP(e,Pv)||!ps(e,1,!1)?0:n+1:Il(r,n,t))}return e.type===12?Il(ps(e,1,!0),++n,t):0}var pP=["calc(","-moz-calc(","-webkit-calc("],bf=new Map([[2,22],[21,22],[19,20],[23,24]]),gP=["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"],bP=["deg","grad","rad","turn"],yP=["s","ms"],vP=["hz","khz"],EP=["dpi","dpcm","dppx","x"],SP=["fr"],wP=["db"],CP=["st"];function Cn(e,t){return t<e.length?e.charCodeAt(t):0}function Dv(e,t){return cs(e,0,e.length,t)}function Bv(e,t){for(let n=0;n<t.length;n++)if(Dv(e,t[n]))return!0;return!1}function Hv(e,t){return t!==e.length-2?!1:Cn(e,t)===92&&ut(Cn(e,t+1))}function Dl(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 _P(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=bf.get(e.type)}o++}while(e=t(o));return o}function cn(e){return function(t,n,r){return t===null?0:t.type===2&&Bv(t.value,pP)?_P(t,n):e(t,n,r)}}function Me(e){return function(t){return t===null||t.type!==e?0:1}}function AP(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return Bv(t,Mv)||Dv(t,"default")?0:1}function TP(e){return e===null||e.type!==1||Cn(e.value,0)!==45||Cn(e.value,1)!==45?0:1}function kP(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(!Nr(Cn(e.value,n)))return 0;return 1}function LP(e){return e===null||e.type!==4||!Al(Cn(e.value,1),Cn(e.value,2),Cn(e.value,3))?0:1}function NP(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=bf.get(e.type)}o++}while(e=t(o));return o}function xP(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=bf.get(e.type)}o++}while(e=t(o));return o}function mr(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=Ll(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!Hv(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return Dl(r,t.value,o)?0:1}}function OP(e,t,n){return e===null||e.type!==11||Dl(n,e.value,e.value.length-1)?0:1}function Fv(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 RP(e,t,n){if(e===null)return 0;const r=Ll(e.value,0);return r!==e.value.length&&!Hv(e.value,r)||Dl(n,e.value,r)?0:1}function MP(e,t,n){if(e===null||e.type!==10)return 0;let r=Cn(e.value,0)===43||Cn(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!ut(Cn(e.value,r)))return 0;return Dl(n,e.value,r)?0:1}var $v={"ident-token":Me(1),"function-token":Me(2),"at-keyword-token":Me(3),"hash-token":Me(4),"string-token":Me(5),"bad-string-token":Me(6),"url-token":Me(7),"bad-url-token":Me(8),"delim-token":Me(9),"number-token":Me(10),"percentage-token":Me(11),"dimension-token":Me(12),"whitespace-token":Me(13),"CDO-token":Me(14),"CDC-token":Me(15),"colon-token":Me(16),"semicolon-token":Me(17),"comma-token":Me(18),"[-token":Me(19),"]-token":Me(20),"(-token":Me(21),")-token":Me(22),"{-token":Me(23),"}-token":Me(24),string:Me(5),ident:Me(1),"custom-ident":AP,"custom-property-name":TP,"hex-color":kP,"id-selector":LP,"an-plus-b":uP,urange:hP,"declaration-value":NP,"any-value":xP,dimension:cn(mr(null)),angle:cn(mr(bP)),decibel:cn(mr(wP)),frequency:cn(mr(vP)),flex:cn(mr(SP)),length:cn(Fv(mr(gP))),resolution:cn(mr(EP)),semitones:cn(mr(CP)),time:cn(mr(yP)),percentage:cn(OP),zero:Fv(),number:cn(RP),integer:cn(MP)};function PP(e,t,n){return Object.assign(Ol("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
|
|
41
|
-
`+t+`
|
|
42
|
-
--`+new Array((n||t.length)+1).join("-")+"^"})}var IP=9,DP=10,BP=12,HP=13,FP=32,$P=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!==HP&&t!==DP&&t!==BP&&t!==FP&&t!==IP)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 PP(e,this.str,this.pos)}},WP=9,qP=10,zP=12,UP=13,VP=32,Wv=33,yf=35,qv=38,Bl=39,zv=40,jP=41,Uv=42,vf=43,Ef=44,Vv=45,Sf=60,jv=62,wf=63,GP=64,Hl=91,Cf=93,Fl=123,Gv=124,Xv=125,Yv=8734,gs=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),Kv={" ":1,"&&":2,"||":3,"|":4};function $l(e){return e.substringToPos(e.findWsEnd(e.pos))}function Xo(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||gs[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Wl(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 XP(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 Zv(e){let t=null,n=null;return e.eat(Fl),t=Wl(e),e.charCode()===Ef?(e.pos++,e.charCode()!==Xv&&(n=Wl(e))):n=t,e.eat(Xv),{min:Number(t),max:n?Number(n):0}}function YP(e){let t=null,n=!1;switch(e.charCode()){case Uv:e.pos++,t={min:0,max:0};break;case vf:e.pos++,t={min:1,max:0};break;case wf:e.pos++,t={min:0,max:1};break;case yf:e.pos++,n=!0,e.charCode()===Fl?t=Zv(e):e.charCode()===wf?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case Fl:t=Zv(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function Yo(e,t){const n=YP(e);return n!==null?(n.term=t,e.charCode()===yf&&e.charCodeAt(e.pos-1)===vf?Yo(e,n):n):t}function _f(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function KP(e){let t;return e.eat(Sf),e.eat(Bl),t=Xo(e),e.eat(Bl),e.eat(jv),Yo(e,{type:"Property",name:t})}function ZP(e){let t=null,n=null,r=1;return e.eat(Hl),e.charCode()===Vv&&(e.peek(),r=-1),r==-1&&e.charCode()===Yv?e.peek():(t=r*Number(Wl(e)),gs[e.charCode()]!==0&&(t+=Xo(e))),$l(e),e.eat(Ef),$l(e),e.charCode()===Yv?e.peek():(r=1,e.charCode()===Vv&&(e.peek(),r=-1),n=r*Number(Wl(e)),gs[e.charCode()]!==0&&(n+=Xo(e))),e.eat(Cf),{type:"Range",min:t,max:n}}function QP(e){let t,n=null;return e.eat(Sf),t=Xo(e),e.charCode()===zv&&e.nextCharCode()===jP&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Hl&&($l(e),n=ZP(e)),e.eat(jv),Yo(e,{type:"Type",name:t,opts:n})}function JP(e){const t=Xo(e);return e.charCode()===zv?(e.pos++,{type:"Function",name:t}):Yo(e,{type:"Keyword",name:t})}function eI(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)=>Kv[o]-Kv[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 Qv(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=nI(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:eI(t,n)||" ",disallowEmpty:!1,explicit:!1}}function tI(e){let t;return e.eat(Hl),t=Qv(e),e.eat(Cf),t.explicit=!0,e.charCode()===Wv&&(e.pos++,t.disallowEmpty=!0),t}function nI(e){let t=e.charCode();if(t<128&&gs[t]===1)return JP(e);switch(t){case Cf:break;case Hl:return Yo(e,tI(e));case Sf:return e.nextCharCode()===Bl?KP(e):QP(e);case Gv:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===Gv?2:1))};case qv:return e.pos++,e.eat(qv),{type:"Combinator",value:"&&"};case Ef:return e.pos++,{type:"Comma"};case Bl:return Yo(e,{type:"String",value:XP(e)});case VP:case WP:case qP:case UP:case zP:return{type:"Spaces",value:$l(e)};case GP:return t=e.nextCharCode(),t<128&&gs[t]===1?(e.pos++,{type:"AtKeyword",name:Xo(e)}):_f(e);case Uv:case vf:case wf:case yf:case Wv:break;case Fl:if(t=e.nextCharCode(),t<48||t>57)return _f(e);break;default:return _f(e)}}function Jv(e){const t=new $P(e),n=Qv(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var bs=function(){};function eE(e){return typeof e=="function"?e:bs}function rI(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=bs,i=bs;if(typeof t=="function"?o=t:t&&(o=eE(t.enter),i=eE(t.leave)),o===bs&&i===bs)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var oI={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 iI(e){const t=[];return xl(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function sI(e,t){return typeof e=="string"?iI(e):t.generate(e,oI)}var _e={type:"Match"},Te={type:"Mismatch"},Af={type:"DisallowEmpty"},aI=40,lI=41;function pt(e,t,n){return t===_e&&n===Te||e===_e&&t===_e&&n===_e?e:(e.type==="If"&&e.else===Te&&t===_e&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function tE(e){return e.length>2&&e.charCodeAt(e.length-2)===aI&&e.charCodeAt(e.length-1)===lI}function nE(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&tE(e.name)}function Tf(e,t,n){switch(e){case" ":{let r=_e;for(let o=t.length-1;o>=0;o--){const i=t[o];r=pt(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(nE(s)&&(o===null&&i>0&&nE(t[i-1])&&(o=Object.create(null),r=pt({type:"Enum",map:o},_e,r)),o!==null)){const a=(tE(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=pt(s,_e,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=Tf(e,t.filter(function(a){return a!==i}),!1):s=_e,r=pt(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?_e:Te;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Tf(e,t.filter(function(a){return a!==i}),!0):s=_e,r=pt(i,s,r)}return r}}}function cI(e){let t=_e,n=kf(e.term);if(e.max===0)n=pt(n,Af,Te),t=pt(n,null,Te),t.then=pt(_e,_e,t),e.comma&&(t.then.else=pt({type:"Comma",syntax:e},t,Te));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==_e&&(t=pt({type:"Comma",syntax:e},t,Te)),t=pt(n,pt(_e,_e,t),Te);if(e.min===0)t=pt(_e,_e,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==_e&&(t=pt({type:"Comma",syntax:e},t,Te)),t=pt(n,t,Te);return t}function kf(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Tf(e.combinator,e.terms.map(kf),!1);return e.disallowEmpty&&(t=pt(t,Af,Te)),t}case"Multiplier":return cI(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 Lf(e,t){return typeof e=="string"&&(e=Jv(e)),{type:"MatchGraph",match:kf(e),syntax:t||null,source:e}}var{hasOwnProperty:rE}=Object.prototype,uI=0,dI=1,Nf=2,oE=3,iE="Match",fI="Mismatch",mI="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",hI=15e3,pI=0;function gI(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function xf(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 bI(e){return e.type!==9?!1:e.value!=="?"}function sE(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||bI(e)}function aE(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function yI(e,t,n){function r(){do C++,w=C<e.length?e[C]:null;while(w!==null&&(w.type===13||w.type===25))}function o(g){const E=C+g;return E<e.length?e[E]:null}function i(g,E){return{nextState:g,matchStack:y,syntaxStack:d,thenStack:f,tokenIndex:C,prev:E}}function s(g){f={nextState:g,matchStack:y,syntaxStack:d,prev:f}}function a(g){m=i(g,m)}function l(){y={type:dI,syntax:t.syntax,token:w,prev:y},r(),h=null,C>T&&(T=C)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},y={type:Nf,syntax:t.syntax,token:y.token,prev:y}}function u(){y.type===Nf?y=y.prev:y={type:oE,syntax:d.syntax,token:y.token,prev:y},d=d.prev}let d=null,f=null,m=null,h=null,p=0,v=null,w=null,C=-1,T=0,y={type:uI,syntax:null,token:null,prev:null};for(r();v===null&&++p<hI;)switch(t.type){case"Match":if(f===null){if(w!==null&&(C!==e.length-1||w.value!=="\\0"&&w.value!=="\\9")){t=Te;break}v=iE;break}if(t=f.nextState,t===Af)if(f.matchStack===y){t=Te;break}else t=_e;for(;f.syntaxStack!==d;)u();f=f.prev;break;case"Mismatch":if(h!==null&&h!==!1)(m===null||C>m.tokenIndex)&&(m=h,h=!1);else if(m===null){v=fI;break}t=m.nextState,f=m.thenStack,d=m.syntaxStack,y=m.matchStack,C=m.tokenIndex,w=C<e.length?e[C]:null,m=m.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Te&&a(t.else),t.then!==_e&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const _=t.syntax.terms;if(t.index===_.length){if(t.mask===0||t.syntax.all){t=Te;break}t=_e;break}if(t.mask===(1<<_.length)-1){t=_e;break}for(;t.index<_.length;t.index++){const b=1<<t.index;if((t.mask&b)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|b}),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 _=w.value.toLowerCase();if(_.indexOf("\\")!==-1&&(_=_.replace(/\\[09].*$/,"")),rE.call(t.map,_)){t=t.map[_];break}}t=Te;break;case"Generic":{const _=d!==null?d.opts:null,b=C+Math.floor(t.fn(w,o,_));if(!isNaN(b)&&b>C){for(;C<b;)l();t=_e}else t=Te;break}case"Type":case"Property":{const _=t.type==="Type"?"types":"properties",b=rE.call(n,_)?n[_][t.name]:null;if(!b||!b.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(h!==!1&&w!==null&&t.type==="Type"&&(t.name==="custom-ident"&&w.type===1||t.name==="length"&&w.value==="0")){h===null&&(h=i(t,m)),t=Te;break}c(),t=b.match;break}case"Keyword":{const _=t.name;if(w!==null){let b=w.value;if(b.indexOf("\\")!==-1&&(b=b.replace(/\\[09].*$/,"")),xf(b,_)){l(),t=_e;break}}t=Te;break}case"AtKeyword":case"Function":if(w!==null&&xf(w.value,t.name)){l(),t=_e;break}t=Te;break;case"Token":if(w!==null&&w.value===t.value){l(),t=_e;break}t=Te;break;case"Comma":w!==null&&w.type===18?sE(y.token)?t=Te:(l(),t=aE(w)?Te:_e):t=sE(y.token)||aE(w)?_e:Te;break;case"String":let g="",E=C;for(;E<e.length&&g.length<t.value.length;E++)g+=e[E].value;if(xf(g,t.value)){for(;C<E;)l();t=_e}else t=Te;break;default:throw new Error("Unknown node type: "+t.type)}switch(pI+=p,v){case null:v=mI,y=null;break;case iE:for(;d!==null;)u();break;default:y=null}return{tokens:e,reason:v,iterations:p,match:y,longestMatch:T}}function lE(e,t,n){const r=yI(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=gI(o).prev;o!==null;){switch(o.type){case Nf:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case oE: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 vI=se({getTrace:()=>cE,isKeyword:()=>wI,isProperty:()=>SI,isType:()=>EI});function cE(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 EI(e,t){return Of(this,e,n=>n.type==="Type"&&n.name===t)}function SI(e,t){return Of(this,e,n=>n.type==="Property"&&n.name===t)}function wI(e){return Of(this,e,t=>t.type==="Keyword")}function Of(e,t,n){const r=cE.call(e,t);return r===null?!1:r.some(n)}function uE(e){return"node"in e?e.node:uE(e.match[0])}function dE(e){return"node"in e?e.node:dE(e.match[e.match.length-1])}function fE(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=uE(a),c=dE(a);e.syntax.walk(t,function(u,d,f){if(u===l){const m=new Ge;do{if(m.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:f,nodes:m})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:ys}=Object.prototype;function Rf(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function mE(e){return!!e&&Rf(e.offset)&&Rf(e.line)&&Rf(e.column)}function CI(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(ys.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(!mE(r.loc.start))i+=".start";else if(!mE(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 Ge)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)ys.call(t,i)&&ys.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function _I(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(ys.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:CI(e,r)}}function AI(e){const t={};if(e.node){for(const n in e.node)if(ys.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=_I(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var TI=Lf(Mv.join(" | "));function Mf(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:df(e[o].syntax,{compact:t}));return r}function kI(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:df(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Mf(i.descriptors,t,n)};return r}function LI(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function _n(e,t,n){return{matched:e,iterations:n,error:t,...vI}}function Ko(e,t,n,r){const o=sI(n,e.syntax);let i;return LI(o)?_n(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=lE(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=lE(o,t.match,e),!i.match)?_n(null,new sP(i.reason,t.syntax,n,i),i.iterations):_n(i.match,null,i.iterations))}var hE=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=TI,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||AI(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 $v)this.addType_(r,$v[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=Lf(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:Jv(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Lf(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 fs("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&&!Ko(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=wn(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 fs("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new fs("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return _n(null,n);const r=this.getAtrule(e);return r.prelude?Ko(this,r.prelude,t||"",!1):_n(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return _n(null,r);const o=this.getAtrule(e),i=wn(t);return Ko(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?_n(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(jo(e).custom)return _n(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?_n(null,n):Ko(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Ko(this,n,t,!1):_n(null,new fs("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?_n(null,new fs("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),Ko(this,e,t,!1))}findValueFragments(e,t,n,r){return fE(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return fE(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=wn(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=jo(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&&rI(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:Mf(this.types,!t,e),properties:Mf(this.properties,!t,e),atrules:kI(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:Zo}=Object.prototype,NI={generic:!0,types:Pf,atrules:{prelude:yE,descriptors:yE},properties:Pf,parseContext:xI,scope:gE,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function ql(e){return e&&e.constructor===Object}function pE(e){return ql(e)?{...e}:e}function xI(e,t){return Object.assign(e,t)}function gE(e,t){for(const n in t)Zo.call(t,n)&&(ql(e[n])?gE(e[n],t[n]):e[n]=pE(t[n]));return e}function bE(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Pf(e,t){if(typeof t=="string")return bE(e,t);const n={...e};for(let r in t)Zo.call(t,r)&&(n[r]=bE(Zo.call(e,r)?e[r]:void 0,t[r]));return n}function yE(e,t){const n=Pf(e,t);return!ql(n)||Object.keys(n).length?n:null}function vs(e,t,n){for(const r in n)if(Zo.call(n,r)!==!1){if(n[r]===!0)Zo.call(t,r)&&(e[r]=pE(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(ql(n[r])){const o={};for(let i in e[r])o[i]=vs({},e[r][i],n[r]);for(let i in t[r])o[i]=vs(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&&vs(o[s],a,i);for(const s in t[r])Zo.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&vs(o[s],t[r][s],i));e[r]=o}}}return e}var If=(e,t)=>vs(e,t,NI);function vE(e){const t=IM(e),n=eP(e),r=KM(e),{fromPlainObject:o,toPlainObject:i}=ZM(n),s={lexer:null,createLexer:a=>new hE(a,s,s.lexer.structure),tokenize:xl,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=If({},e);return vE(typeof a=="function"?a(l,Object.assign):If(l,a))}};return s.lexer=new hE({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var OI=e=>vE(If({},e)),RI={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>"}}}},MI=se({generate:()=>BI,name:()=>II,parse:()=>EE,structure:()=>DI}),Wn=43,Vt=45,zl=110,no=!0,PI=!1;function Ul(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===Wn||r===Vt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)ut(this.charCodeAt(n))||this.error("Integer is expected",n)}function Qo(e){return Ul.call(this,0,e)}function Rr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case zl:n="N is expected";break;case Vt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Df(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(Wn,e)||this.isDelim(Vt,e)){t=this.isDelim(Wn,e)?Wn:Vt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),Qo.call(this,no))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Wn&&n!==Vt&&this.error("Number sign is expected")),Qo.call(this,t!==0),t===Vt?"-"+this.consume(10):this.consume(10)}var II="AnPlusB",DI={a:[String,null],b:[String,null]};function EE(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)Qo.call(this,PI),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Vt))switch(t="-1",Rr.call(this,1,zl),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Df.call(this);break;case 3:Rr.call(this,2,Vt),this.next(),this.skipSC(),Qo.call(this,no),n="-"+this.consume(10);break;default:Rr.call(this,2,Vt),Ul.call(this,3,no),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Wn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(Wn)&&(r=1,this.next()),Rr.call(this,0,zl),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Df.call(this);break;case 2:Rr.call(this,1,Vt),this.next(),this.skipSC(),Qo.call(this,no),n="-"+this.consume(10);break;default:Rr.call(this,1,Vt),Ul.call(this,2,no),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===Wn||r===Vt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&ut(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Rr.call(this,i-this.tokenStart,zl),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Df.call(this)):(Rr.call(this,i-this.tokenStart+1,Vt),i+2===this.tokenEnd?(this.next(),this.skipSC(),Qo.call(this,no),n="-"+this.consume(10)):(Ul.call(this,i-this.tokenStart+2,no),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Wn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Wn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function BI(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 HI=se({generate:()=>zI,name:()=>$I,parse:()=>wE,structure:()=>qI,walkContext:()=>WI});function SE(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function FI(){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 $I="Atrule",WI="atrule",qI={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function wE(){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),SE):r=SE.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(FI.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function zI(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var UI=se({generate:()=>XI,name:()=>VI,parse:()=>CE,structure:()=>GI,walkContext:()=>jI}),VI="AtrulePrelude",jI="atrulePrelude",GI={children:[[]]};function CE(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 XI(e){this.children(e)}var YI=se({generate:()=>r5,name:()=>t5,parse:()=>AE,structure:()=>n5}),KI=36,_E=42,Vl=61,ZI=94,Bf=124,QI=126;function JI(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(_E)?(t=!0,this.next()):this.isDelim(Bf)||this.eat(1),this.isDelim(Bf)?this.charCodeAt(this.tokenStart+1)!==Vl?(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 e5(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==Vl&&t!==QI&&t!==ZI&&t!==KI&&t!==_E&&t!==Bf&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Vl&&(this.isDelim(Vl)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var t5="AttributeSelector",n5={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function AE(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=JI.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=e5.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 r5(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 o5=se({generate:()=>u5,name:()=>a5,parse:()=>LE,structure:()=>c5,walkContext:()=>l5});function TE(e){return this.Raw(e,null,!0)}function i5(){return this.parseWithFallback(this.Rule,TE)}function kE(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function s5(){if(this.tokenType===17)return kE.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,kE);return this.tokenType===17&&this.next(),e}var a5="Block",l5="block",c5={children:[["Atrule","Rule","Declaration"]]};function LE(e){const t=e?s5:i5,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,TE));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function u5(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var d5=se({generate:()=>h5,name:()=>f5,parse:()=>NE,structure:()=>m5}),f5="Brackets",m5={children:[[]]};function NE(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 h5(e){this.token(9,"["),this.children(e),this.token(9,"]")}var p5=se({generate:()=>b5,name:()=>"CDC",parse:()=>xE,structure:()=>g5}),tZ="CDC",g5=[];function xE(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function b5(){this.token(15,"-->")}var y5=se({generate:()=>E5,name:()=>"CDO",parse:()=>OE,structure:()=>v5}),nZ="CDO",v5=[];function OE(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function E5(){this.token(14,"<!--")}var S5=se({generate:()=>A5,name:()=>C5,parse:()=>RE,structure:()=>_5}),w5=46,C5="ClassSelector",_5={name:String};function RE(){return this.eatDelim(w5),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function A5(e){this.token(9,"."),this.token(1,e.name)}var T5=se({generate:()=>R5,name:()=>x5,parse:()=>PE,structure:()=>O5}),k5=43,ME=47,L5=62,N5=126,x5="Combinator",O5={name:String};function PE(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case L5:case k5:case N5:this.next();break;case ME:this.next(),this.eatIdent("deep"),this.eatDelim(ME);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function R5(e){this.tokenize(e.name)}var M5=se({generate:()=>H5,name:()=>D5,parse:()=>IE,structure:()=>B5}),P5=42,I5=47,D5="Comment",B5={value:String};function IE(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===P5&&this.charCodeAt(t-1)===I5&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function H5(e){this.token(25,"/*"+e.value+"*/")}var F5=se({generate:()=>Z5,name:()=>X5,parse:()=>HE,structure:()=>K5,walkContext:()=>Y5}),DE=33,$5=35,W5=36,q5=38,z5=42,U5=43,BE=47;function V5(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function j5(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function G5(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(DE)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var X5="Declaration",Y5="declaration",K5={important:[Boolean,String],property:String,value:["Value","Raw"]};function HE(){const e=this.tokenStart,t=this.tokenIndex,n=Q5.call(this),r=ff(n),o=r?this.parseCustomProperty:this.parseValue,i=r?j5:V5;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(G5,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(DE)&&(s=J5.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 Z5(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 Q5(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case z5:case W5:case U5:case $5:case q5:this.next();break;case BE:this.next(),this.isDelim(BE)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function J5(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var eD=se({generate:()=>oD,name:()=>nD,parse:()=>FE,structure:()=>rD});function tD(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var nD="DeclarationList",rD={children:[["Declaration"]]};function FE(){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,tD))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function oD(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var iD=se({generate:()=>lD,name:()=>sD,parse:()=>$E,structure:()=>aD}),sD="Dimension",aD={value:String,unit:String};function $E(){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 lD(e){this.token(12,e.value+e.unit)}var cD=se({generate:()=>mD,name:()=>uD,parse:()=>WE,structure:()=>fD,walkContext:()=>dD}),uD="Function",dD="function",fD={name:String,children:[[]]};function WE(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 mD(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var hD=se({generate:()=>bD,name:()=>pD,parse:()=>qE,structure:()=>gD,xxx:()=>"XXX"}),rZ="XXX",pD="Hash",gD={value:String};function qE(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function bD(e){this.token(4,"#"+e.value)}var yD=se({generate:()=>SD,name:()=>vD,parse:()=>zE,structure:()=>ED}),vD="Identifier",ED={name:String};function zE(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function SD(e){this.token(1,e.name)}var wD=se({generate:()=>AD,name:()=>CD,parse:()=>UE,structure:()=>_D}),CD="IdSelector",_D={name:String};function UE(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function AD(e){this.token(9,"#"+e.name)}var TD=se({generate:()=>ND,name:()=>kD,parse:()=>VE,structure:()=>LD}),kD="MediaFeature",LD={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function VE(){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 ND(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var xD=se({generate:()=>MD,name:()=>OD,parse:()=>jE,structure:()=>RD}),OD="MediaQuery",RD={children:[["Identifier","MediaFeature","WhiteSpace"]]};function jE(){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 MD(e){this.children(e)}var PD=se({generate:()=>BD,name:()=>ID,parse:()=>GE,structure:()=>DD}),ID="MediaQueryList",DD={children:[["MediaQuery"]]};function GE(){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 BD(e){this.children(e,()=>this.token(18,","))}var HD=se({generate:()=>$D,name:()=>"Nth",parse:()=>XE,structure:()=>FD}),oZ="Nth",FD={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function XE(){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 $D(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var WD=se({generate:()=>UD,name:()=>qD,parse:()=>YE,structure:()=>zD}),qD="Number",zD={value:String};function YE(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function UD(e){this.token(10,e.value)}var VD=se({generate:()=>XD,name:()=>jD,parse:()=>KE,structure:()=>GD}),jD="Operator",GD={value:String};function KE(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function XD(e){this.tokenize(e.value)}var YD=se({generate:()=>QD,name:()=>KD,parse:()=>ZE,structure:()=>ZD}),KD="Parentheses",ZD={children:[[]]};function ZE(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 QD(e){this.token(21,"("),this.children(e),this.token(22,")")}var JD=se({generate:()=>n3,name:()=>e3,parse:()=>QE,structure:()=>t3}),e3="Percentage",t3={value:String};function QE(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function n3(e){this.token(11,e.value+"%")}var r3=se({generate:()=>a3,name:()=>o3,parse:()=>JE,structure:()=>s3,walkContext:()=>i3}),o3="PseudoClassSelector",i3="function",s3={name:String,children:[["Raw"],null]};function JE(){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 a3(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var l3=se({generate:()=>f3,name:()=>c3,parse:()=>eS,structure:()=>d3,walkContext:()=>u3}),c3="PseudoElementSelector",u3="function",d3={name:String,children:[["Raw"],null]};function eS(){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 f3(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 m3=se({generate:()=>y3,name:()=>g3,parse:()=>nS,structure:()=>b3}),h3=47,p3=46;function tS(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!ut(n)&&n!==p3&&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 g3="Ratio",b3={left:String,right:String};function nS(){const e=this.tokenStart,t=tS.call(this);let n;return this.skipSC(),this.eatDelim(h3),n=tS.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function y3(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var v3=se({generate:()=>w3,name:()=>"Raw",parse:()=>rS,structure:()=>S3});function E3(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var iZ="Raw",S3={value:String};function rS(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=E3.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function w3(e){this.tokenize(e.value)}var C3=se({generate:()=>L3,name:()=>A3,parse:()=>iS,structure:()=>k3,walkContext:()=>T3});function oS(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function _3(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var A3="Rule",T3="rule",k3={prelude:["SelectorList","Raw"],block:["Block"]};function iS(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(_3,oS):n=oS.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function L3(e){this.node(e.prelude),this.node(e.block)}var N3=se({generate:()=>R3,name:()=>x3,parse:()=>sS,structure:()=>O3}),x3="Selector",O3={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function sS(){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 R3(e){this.children(e)}var M3=se({generate:()=>B3,name:()=>P3,parse:()=>aS,structure:()=>D3,walkContext:()=>I3}),P3="SelectorList",I3="selector",D3={children:[["Selector","Raw"]]};function aS(){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 B3(e){this.children(e,()=>this.token(18,","))}var Hf=92,lS=34,cS=39;function uS(e){const t=e.length,n=e.charCodeAt(0),r=n===lS||n===cS?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===Hf){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),Fn(Hf,a)){const l=s-1,c=zo(e,l);s=c-1,i+=dv(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Ff(e,t){const n=t?"'":'"',r=t?cS:lS;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===Hf?(o+="\\"+e.charAt(s),i=!1):(i&&(Nr(a)||to(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var H3=se({generate:()=>W3,name:()=>F3,parse:()=>dS,structure:()=>$3}),F3="String",$3={value:String};function dS(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:uS(this.consume(5))}}function W3(e){this.token(5,Ff(e.value))}var q3=se({generate:()=>G3,name:()=>U3,parse:()=>mS,structure:()=>j3,walkContext:()=>V3}),z3=33;function fS(e){return this.Raw(e,null,!1)}var U3="StyleSheet",V3="stylesheet",j3={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function mS(){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)!==z3){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,fS);break;default:n=this.parseWithFallback(this.Rule,fS)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function G3(e){this.children(e)}var X3=se({generate:()=>Q3,name:()=>K3,parse:()=>pS,structure:()=>Z3}),Y3=42,hS=124;function $f(){this.tokenType!==1&&this.isDelim(Y3)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var K3="TypeSelector",Z3={name:String};function pS(){const e=this.tokenStart;return this.isDelim(hS)?(this.next(),$f.call(this)):($f.call(this),this.isDelim(hS)&&(this.next(),$f.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Q3(e){this.tokenize(e.name)}var J3=se({generate:()=>o4,name:()=>n4,parse:()=>yS,structure:()=>r4}),gS=43,bS=45,Wf=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===bS&&t&&n!==0)return Es.call(this,e+n+1,!1),-1;Nr(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 jl(e){let t=0;for(;this.isDelim(Wf);)++t>e&&this.error("Too many question marks"),this.next()}function e4(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===gS?"Plus sign":"Hyphen minus")+" is expected")}function t4(){let e=0;switch(this.tokenType){case 10:if(e=Es.call(this,1,!0),this.isDelim(Wf)){jl.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){e4.call(this,bS),Es.call(this,1,!1);break}break;case 12:e=Es.call(this,1,!0),e>0&&jl.call(this,6-e);break;default:if(this.eatDelim(gS),this.tokenType===1){e=Es.call(this,0,!0),e>0&&jl.call(this,6-e);break}if(this.isDelim(Wf)){this.next(),jl.call(this,5);break}this.error("Hex digit or question mark is expected")}}var n4="UnicodeRange",r4={value:String};function yS(){const e=this.tokenStart;return this.eatIdent("u"),t4.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function o4(e){this.tokenize(e.value)}var i4=32,qf=92,s4=34,a4=39,l4=40,vS=41;function c4(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===vS?t-2:t-1,o="";for(;n<r&&to(e.charCodeAt(n));)n++;for(;n<r&&to(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===qf){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),Fn(qf,s)){const a=i-1,l=zo(e,a);i=l-1,o+=dv(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function ES(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===i4||o===qf||o===s4||o===a4||o===l4||o===vS?(t+="\\"+e.charAt(r),n=!1):(n&&Nr(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var u4=se({generate:()=>f4,name:()=>"Url",parse:()=>SS,structure:()=>d4}),sZ="Url",d4={value:String};function SS(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=c4(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=uS(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 f4(e){this.token(7,ES(e.value))}var m4=se({generate:()=>g4,name:()=>h4,parse:()=>wS,structure:()=>p4}),h4="Value",p4={children:[[]]};function wS(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function g4(e){this.children(e)}var b4=se({generate:()=>S4,name:()=>v4,parse:()=>CS,structure:()=>E4}),y4=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),v4="WhiteSpace",E4={value:String};function CS(){return this.eat(13),y4}function S4(e){this.token(13,e.value)}var _S=se({AnPlusB:()=>MI,Atrule:()=>HI,AtrulePrelude:()=>UI,AttributeSelector:()=>YI,Block:()=>o5,Brackets:()=>d5,CDC:()=>p5,CDO:()=>y5,ClassSelector:()=>S5,Combinator:()=>T5,Comment:()=>M5,Declaration:()=>F5,DeclarationList:()=>eD,Dimension:()=>iD,Function:()=>cD,Hash:()=>hD,IdSelector:()=>wD,Identifier:()=>yD,MediaFeature:()=>TD,MediaQuery:()=>xD,MediaQueryList:()=>PD,Nth:()=>HD,Number:()=>WD,Operator:()=>VD,Parentheses:()=>YD,Percentage:()=>JD,PseudoClassSelector:()=>r3,PseudoElementSelector:()=>l3,Ratio:()=>m3,Raw:()=>v3,Rule:()=>C3,Selector:()=>N3,SelectorList:()=>M3,String:()=>H3,StyleSheet:()=>q3,TypeSelector:()=>X3,UnicodeRange:()=>J3,Url:()=>u4,Value:()=>m4,WhiteSpace:()=>b4}),w4={generic:!0,...RI,node:_S},C4=35,_4=42,AS=43,A4=45,T4=47,k4=117;function TS(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,k4)&&this.cmpChar(this.tokenStart+1,AS)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===T4||t===_4||t===AS||t===A4)return this.Operator();t===C4&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var L4={getNode:TS},N4=35,x4=42,O4=43,R4=47,kS=46,M4=62,P4=124,I4=126;function D4(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function B4(){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)===kS&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case O4:case M4:case I4:case R4:return this.Combinator();case kS:return this.ClassSelector();case x4:case P4:return this.TypeSelector();case N4:return this.IdSelector()}}}var H4={onWhiteSpace:D4,getNode:B4};function F4(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function $4(){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 LS(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var W4={getNode:TS,onWhiteSpace(e,t){LS(e)&&(e.value=" "+e.value),LS(t.last)&&(t.last.value+=" ")},expression:F4,var:$4},q4=se({AtrulePrelude:()=>L4,Selector:()=>H4,Value:()=>W4}),z4={parse:{prelude:null,block(){return this.Block(!0)}}},U4={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}},V4={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},j4={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function G4(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function X4(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):NS.call(this)}function NS(){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(G4,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(X4,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var Y4={parse:{prelude(){const e=NS.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},K4={"font-face":z4,import:U4,media:V4,page:j4,supports:Y4},ro={parse(){return this.createSingleNodeList(this.SelectorList())}},Z4={parse(){return this.createSingleNodeList(this.Selector())}},xS={parse(){return this.createSingleNodeList(this.Identifier())}},Gl={parse(){return this.createSingleNodeList(this.Nth())}},Q4={dir:xS,has:ro,lang:xS,matches:ro,is:ro,"-moz-any":ro,"-webkit-any":ro,where:ro,not:ro,"nth-child":Gl,"nth-last-child":Gl,"nth-last-of-type":Gl,"nth-of-type":Gl,slotted:Z4},J4=se({AnPlusB:()=>EE,Atrule:()=>wE,AtrulePrelude:()=>CE,AttributeSelector:()=>AE,Block:()=>LE,Brackets:()=>NE,CDC:()=>xE,CDO:()=>OE,ClassSelector:()=>RE,Combinator:()=>PE,Comment:()=>IE,Declaration:()=>HE,DeclarationList:()=>FE,Dimension:()=>$E,Function:()=>WE,Hash:()=>qE,IdSelector:()=>UE,Identifier:()=>zE,MediaFeature:()=>VE,MediaQuery:()=>jE,MediaQueryList:()=>GE,Nth:()=>XE,Number:()=>YE,Operator:()=>KE,Parentheses:()=>ZE,Percentage:()=>QE,PseudoClassSelector:()=>JE,PseudoElementSelector:()=>eS,Ratio:()=>nS,Raw:()=>rS,Rule:()=>iS,Selector:()=>sS,SelectorList:()=>aS,String:()=>dS,StyleSheet:()=>mS,TypeSelector:()=>pS,UnicodeRange:()=>yS,Url:()=>SS,Value:()=>wS,WhiteSpace:()=>CS}),e8={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:q4,atrule:K4,pseudo:Q4,node:J4},t8={node:_S},n8=OI({...w4,...e8,...t8});function zf(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof Ge?r=r.map(zf):r.constructor===Object&&(r=zf(r))),t[n]=r}return t}var{tokenize:aZ,parse:r8,generate:qn,lexer:OS,createLexer:lZ,walk:Mt,find:cZ,findLast:uZ,findAll:dZ,toPlainObject:fZ,fromPlainObject:mZ,fork:o8}=n8,{hasOwnProperty:i8}=Object.prototype;function Uf(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 RS(e){if(!e)return null;const t=Uf(e.tags,!0),n=Uf(e.ids),r=Uf(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function s8(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(i8.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:RS(e),blacklist:RS(e.blacklist),scopes:t}}function oo(e){return!e||!e.children||e.children.isEmpty}function MS(e,t){return e!==null&&e.children===t}function a8(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),oo(e.block))){n.remove(t);return}switch(e.name){case"charset":if(oo(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=wn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(oo(e.prelude)||oo(e.block))&&n.remove(t)}}}function l8(e,t,n){n.remove(t)}function c8(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}jo(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function u8(e,t,n){(MS(this.stylesheet,n)||MS(this.block,n))&&n.remove(t)}var{hasOwnProperty:Jo}=Object.prototype,d8=new Set(["keyframes"]);function PS(e,t){return e.children.forEach((n,r,o)=>{let i=!1;Mt(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&PS(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!Jo.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&Jo.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!Jo.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&Jo.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&&!Jo.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&Jo.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function f8(e,t,n,r){if(oo(e.prelude)||oo(e.block)){n.remove(t);return}if(this.atrule&&d8.has(wn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(PS(e.prelude,o),oo(e.prelude))){n.remove(t);return}}function m8(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 h8(e,t,n){n.remove(t)}var IS={Atrule:a8,Comment:l8,Declaration:c8,Raw:u8,Rule:f8,TypeSelector:m8,WhiteSpace:h8};function p8(e,t){Mt(e,{leave(n,r,o){IS.hasOwnProperty(n.type)&&IS[n.type].call(this,n,r,o,t)}})}function g8(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 b8(e){wn(e.name).basename==="keyframes"&&g8(e)}var y8=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function v8(e){return e===""||e==="-"?!1:!y8.test(e)}function E8(e){const t=e.value;!t||t.type!=="String"||v8(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function S8(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 w8(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 C8(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 Ge().fromArray(n)}function DS(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 BS={font:S8,"font-weight":w8,background:C8,border:DS,outline:DS};function _8(e){if(!this.declaration)return;const t=jo(this.declaration.property);BS.hasOwnProperty(t.basename)&&BS[t.basename](e)}var A8=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,T8=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,k8=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function Xl(e,t){const n=t&&t.prev!==null&&k8.has(t.prev.data.type)?T8:A8;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function L8(e){e.value=Xl(e.value)}var N8=new Set(["calc","min","max","clamp"]),x8=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function O8(e,t){const n=Xl(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!x8.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&N8.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var R8=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function M8(e,t){e.value=Xl(e.value),e.value==="0"&&this.declaration&&!R8.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},OS.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function P8(e){e.value=e.value.replace(/\\/g,"/")}var HS={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"},FS={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 Vf(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 $S(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=Vf(l,a,e+1/3),i=Vf(l,a,e),s=Vf(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function jf(e){return e=e.toString(16),e.length===1?"0"+e:e}function Gf(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 I8(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Gf(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=$S(...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:Xl(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Gf(e.children,3,!1),!r)return;r=$S(...r),n="rgb"}if(n==="rgb"){if(r=r||Gf(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:jf(r[0])+jf(r[1])+jf(r[2])},WS(t.data,t)}}function D8(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(HS.hasOwnProperty(n)&&OS.matchDeclaration(this.declaration).isType(e,"color")){const r=HS[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function WS(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]),FS[n]?t.data={type:"Identifier",loc:e.loc,name:FS[n]}:e.value=n}var qS={Atrule:b8,AttributeSelector:E8,Value:_8,Dimension:O8,Percentage:M8,Number:L8,Url:P8,Hash:WS,Identifier:D8,Function:I8};function B8(e){Mt(e,{leave(t,n,r){qS.hasOwnProperty(t.type)&&qS[t.type].call(this,t,n,r)}})}var H8=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 F8(){const e=new H8;return function(n){const r=qn(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function $8(e){return e.type==="Raw"?r8(e.value,{context:"selectorList"}):e}function W8(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function zS(e){return $8(e).children.reduce((t,n)=>W8(Xf(n),t),[0,0,0])}function Xf(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]=zS(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]=zS(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 q8=new Set(["first-letter","first-line","after","before"]),z8=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function U8(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: "+qn(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();z8.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();q8.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=Xf(r).toString(),r.id=null,r.id=qn(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function V8(e,t){const n=F8();return Mt(e,{visit:"Rule",enter(r){r.block.children.forEach(n),U8(r,t.usage)}}),Mt(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=qn(r.prelude)),wn(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:US}=Object.prototype;function VS(e,t,n,r){const o=t.data,i=wn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);US.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],US.call(e[i],s)||(e[i][s]=new Ge),e[i][s].append(n.remove(t))}function j8(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=wn(o.name).basename;switch(a){case"keyframes":VS(n,i,s,!0);return;case"media":if(t.forceMediaMerge){VS(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 jS(e){return e.type==="Atrule"&&e.name==="media"}function G8(e,t,n){if(!jS(e))return;const r=t.prev&&t.prev.data;!r||!jS(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function X8(e,t){j8(e,t),Mt(e,{visit:"Atrule",reverse:!0,enter:G8})}var{hasOwnProperty:Y8}=Object.prototype;function GS(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 XS(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 K8(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]&&((!Y8.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function Ss(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 YS(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 Yl(e){switch(e.type){case"Rule":return YS(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some(Yl,this);break;case"Declaration":return!1}return!0}function Z8(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return Yl.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(GS(s,r))return a.appendList(o),n.remove(t),!0;if(XS(o,a))return Ss(s,r),n.remove(t),!0}return YS(r,s)})}function Q8(e){Mt(e,{visit:"Rule",enter:Z8})}function J8(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new Ge;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 eB(e){Mt(e,{visit:"Rule",reverse:!0,enter:J8})}var KS=1,tB=2,ei=0,ws=1,Yf=2,Kl=3,ZS=["top","right","bottom","left"],nB={"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"},QS={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"},rB=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=nB[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[ws]=i[ei],i[Yf]=i[ei],i[Kl]=i[ei];break;case 2:i[Yf]=i[ei],i[Kl]=i[ws];break;case 3:i[Kl]=i[ws]}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(ZS[s],i[s])&&(r[ZS[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 Ge,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[qn(t.top.node),qn(t.right.node),qn(t.bottom.node),qn(t.left.node)];r[Kl]===r[ws]&&(n.pop(),r[Yf]===r[ei]&&(n.pop(),r[ws]===r[ei]&&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 oB(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(!QS.hasOwnProperty(l))return;const c=QS[l];let u,d;if((!r||i===r)&&c in t&&(d=tB,u=t[c]),(!u||!u.add(l,s))&&(d=KS,u=new rB(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 iB(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===KS?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function sB(e,t){const n={},r=[];Mt(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=oB.call(this,o,l,r,a.lastShortSelector)}}),iB(r,t.declaration)}var aB=1,lB=new Set(["src"]),JS={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},e1={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"]},t1={"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 n1(e,t,n){const r=jo(e).basename;if(r==="background")return e+":"+qn(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=wn(f).vendor),/\\[09]/.test(f)&&(l=RegExp.lastMatch),e1.hasOwnProperty(r)?e1[r].indexOf(f)===-1&&(s[f]=!0):JS.hasOwnProperty(r)&&JS[r].test(f)&&(s[f]=!0);break}case"Function":{let{name:f}=d;a||(a=wn(f).vendor),f==="rect"&&(d.children.some(m=>m.type==="Operator"&&m.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?"!"+aB++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=qn(t.value)}n[o]=i}return e+i}function cB(e,t,n){const r=jo(t.property);if(t1.hasOwnProperty(r.basename)){const o=t1[r.basename];for(const i of o){const s=n1(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function uB(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=n1(l,s,o),u=r[c];u&&!lB.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):cB(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function dB(e){const t={},n=Object.create(null);Mt(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),uB.call(this,r,o,i,c,n)}})}function fB(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 Yl.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(XS(o,u)){const f=c.data.id;r.some((m,h)=>{const p=m.id;if(f<p)return r.insert(c,h),!0;if(!h.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function mB(e){Mt(e,{visit:"Rule",enter:fB})}function Kf(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function Zf(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function hB(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 p=Yl.call(o,c);return!p&&f==="Atrule"&&d&&Mt(d,{visit:"Rule",enter(v){v.prelude.children.forEach(w=>{s[w.compareMarker]=!0})}}),p}if(e.pseudoSignature!==c.pseudoSignature)return!0;const m=c.prelude.children;if(l=!m.some(p=>p.compareMarker in s),!l&&!a)return!0;if(a&&GS(m,o))return d.children.appendList(i.children),n.remove(t),!0;const h=K8(i.children,d.children);if(h.eq.length){if(!h.ne1.length&&!h.ne2.length)return l&&(Ss(o,m),n.remove(u)),!0;if(!r)if(h.ne1.length&&!h.ne2.length){const p=Kf(o),v=Zf(h.eq);a&&p<v&&(Ss(m,o),i.children.fromArray(h.ne1))}else if(!h.ne1.length&&h.ne2.length){const p=Kf(m),v=Zf(h.eq);l&&p<v&&(Ss(o,m),d.children.fromArray(h.ne2))}else{const p={type:"SelectorList",loc:null,children:Ss(m.copy(),o)},v=Kf(p.children)+2;if(Zf(h.eq)>=v){const w=n.createItem({type:"Rule",loc:null,prelude:p,block:{type:"Block",loc:null,children:new Ge().fromArray(h.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(h.ne1),d.children.fromArray(h.ne2overrided),a?n.insert(w,u):n.insert(w,t),!0}}}a&&(a=!m.some(p=>o.some(v=>v.compareMarker===p.compareMarker))),m.forEach(p=>{s[p.compareMarker]=!0})})}function pB(e){Mt(e,{visit:"Rule",reverse:!0,enter:hB})}function gB(e,t){const n=V8(e,t);t.logger("prepare",e),X8(e,t),t.logger("mergeAtrule",e),Q8(e),t.logger("initialMergeRuleset",e),eB(e),t.logger("disjoinRuleset",e),sB(e,n),t.logger("restructShorthand",e),dB(e),t.logger("restructBlock",e),mB(e),t.logger("mergeRuleset",e),pB(e),t.logger("restructRuleset",e)}function bB(e,t){const n=new Ge;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 yB(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),Mt(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),p8(e,r),r.logger("clean",e),B8(e,r),r.logger("replace",e),r.restructuring&&gB(e,r),e}function vB(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 EB(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function SB(e){return new Ge().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new Ge().appendData({type:"Selector",loc:null,children:new Ge().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function wB(e,t){e=e||{type:"StyleSheet",loc:null,children:new Ge},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:EB(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?s8(t.usage):!1},r=new Ge;let o=vB(t),i=!0,s,a,l=1,c;t.clone&&(e=zf(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=SB(e);do{if(a=bB(s,!!o),yB(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(Ge.createItem({type:"Raw",value:`
|
|
43
|
-
`})),r.insert(Ge.createItem(a.comment)),c.isEmpty||r.insert(Ge.createItem({type:"Raw",value:`
|
|
44
|
-
`}))),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 CB=se({compress:()=>wB,find:()=>NB,findAll:()=>OB,findLast:()=>xB,fromPlainObject:()=>RB,generate:()=>kB,lexer:()=>_B,parse:()=>TB,specificity:()=>Xf,toPlainObject:()=>MB,tokenize:()=>AB,walk:()=>LB});function r1(e){const t=Ff(e,!0),n=Ff(e);return t.length<n.length?t:n}var{lexer:_B,tokenize:AB,parse:TB,generate:kB,walk:LB,find:NB,findLast:xB,findAll:OB,fromPlainObject:RB,toPlainObject:MB}=o8({node:{String:{generate(e){this.token(5,r1(e.value))}},Url:{generate(e){const t=ES(e.value),n=r1(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:PB,generate:Qf,compress:IB}=CB;function ti(e,t,n,r){return t.debug,r}function DB(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=Qf(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
|
|
45
|
-
${s}
|
|
46
|
-
`}t=Date.now()}}function BB(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=DB(e.debug)),e}function o1(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function HB(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=ti("parsing",n,Date.now(),PB(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&ti("beforeCompress",n,Date.now(),o1(i,n,n.beforeCompress));const s=ti("compress",n,Date.now(),IB(i,BB(n)));return n.afterCompress&&ti("afterCompress",n,Date.now(),o1(s,n,n.afterCompress)),n.sourceMap?o=ti("generate(sourceMap: true)",n,Date.now(),(()=>{const a=Qf(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=ti("generate",n,Date.now(),{css:Qf(s.ast),map:null}),o}function io(e,t){return HB("stylesheet",e,t)}var i1={restructure:!0,forceMediaMerge:!0};function s1(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=`
|
|
47
|
-
`+cssbeautify(io(s.innerHTML,i1).css,{indent:" ",autosemicolon:!0})+`
|
|
48
|
-
`;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&a1(e,s.sheet,o,i)){let a=$B(s.sheet);a=io(a,i1).css,a=`
|
|
49
|
-
`+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
|
|
50
|
-
`,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function a1(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-")}`),FB(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=a1(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 FB(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 $B(e){return Array.from(e.cssRules,t=>t.cssText).join(`
|
|
51
|
-
`)}var l1=/device-width/i,WB="not all",ni=new Map,Jf=!1;function qB(e){return"media"in e&&"cssRules"in e}function c1(e,t){for(const n of Array.from(e))qB(n)&&t(n),"cssRules"in n&&c1(n.cssRules,t)}function zB(e){try{return e.cssRules}catch{return}}function UB(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!l1.test(n));return t.length?t.join(", "):WB}function em(e){ni.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||ni.delete(n)});for(const t of Array.from(e.styleSheets)){const n=zB(t);n&&c1(n,r=>{const o=r.media.mediaText;ni.has(r)||!l1.test(o)||(ni.set(r,o),r.media.mediaText=UB(o))})}}function u1(){ni.forEach((e,t)=>{t.media.mediaText=e}),ni.clear()}function VB(e){if(!Jf)return e();u1();try{return e()}finally{em(document)}}function jB(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 GB(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;Jf=!0,em(t);const n=new MutationObserver(r=>{jB(r)&&em(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),u1(),Jf=!1}}function Cs(e){return fe(e)}var hZ=fe("extensions.atomsHandlers"),pZ=Cs("HANDLE_ATOM_INSERT"),gZ=fe("HeadlessMode"),bZ=fe("extensions.sandboxExtensions"),XB="SANDBOX_EXTENSION_SCRIPT_STATUS",yZ=fe("MESSAGE_SERVICE"),vZ=Cs("SETTINGS_PANEL_EVENT"),EZ=Cs("MODAL_SHOW_EVENT"),SZ=Cs("MODAL_CLOSE_EVENT"),wZ=Cs("MODAL_UPDATE_EVENT");function CZ(e){return e}var _Z="SandboxApp",YB="IframePluginRegistry",KB="__sandbox__";function d1(){return Ou(KB)}function ZB(e=d1()){return e.getOrCreateInstance(YB,()=>new zT)}var tm=new UT(()=>ZB()),Zl=class rA{constructor(){k(this,"container",d1()),k(this,"pluginCollection",new qT(this,tm)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new rA)}static registerPlugin(t,n){tm.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&tm.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()}};k(Zl,"_instance",void 0);var _s="data-extension";function As(e,t,n,r){K.send(XB,{key:e,phase:t,status:n,error:r})}function QB(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(_s)||void 0}function f1(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function nm(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,As(e.key,"ready","success"))}function m1(e,t){return[...document.querySelectorAll(`${e}[${_s}]`)].find(n=>n.getAttribute(_s)===t)}function JB({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(_s,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 e9(e,t={}){const n=new Ce,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=u=>{let d=i.get(u);return d||(d=f1(u),i.set(u,d)),d},l=u=>{if(u.type==="created"){const m=QB();if(!m)return;const h=a(m);h.hasSyncPlugins=!0,h.pendingPlugins.add(u.plugin),s.set(u.plugin,m);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),nm(f);return}(u.type==="init:error"||u.type==="afterInit:error")&&(f.pendingPlugins.delete(u.plugin),f.readyFailed=!0,As(d,"ready","error",`Sandbox plugin "${u.name}" failed during ${u.type==="init:error"?"init":"afterInit"}.`))}};n.addDisposable(Zl.onLifecycle(l)),n.addDisposable(K.addListener(Le.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,f1(d.key));const m=d.parent&&document.querySelector(d.parent)||document.head;if(f=JB(d),e.ownership.markService(f),d.type==="script"){const h=f;h.src&&(h.onload=()=>{const p=a(d.key);p.loadedNotified=!0,As(d.key,"load","success"),nm(p)},h.onerror=()=>As(d.key,"load","error",`Failed to load sandbox script: ${h.src}`))}if(m.appendChild(f),d.type==="script"&&!f.src){const h=a(d.key);h.loadedNotified=!0,As(d.key,"load","success"),nm(h)}r.set(d.key,f),o.set(d.key,d)}})),n.addDisposable(K.addListener(Le.SANDBOX_REMOVE_EXTENSIONS,u=>{for(const d of u){const f=m1(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 m=m1(f.type,u);let h=f.parent?[...document.querySelectorAll(f.parent)]:[];h.length||(h=[document.head]),m?m!==d?r.set(u,m):h.some(p=>m.parentNode===p)||h[0]?.appendChild(m):h[0]?.appendChild(d)}}return n}function t9(e){e.querySelectorAll(`[${_s}]`).forEach(t=>t.remove())}var ae="remove-basic-cell",h1="remove-basic-row",ie="em-active-table-cell",zn="em-temporary-class",Xe="em-temporary-active-cell-background-color",Mr="temporary-cell-class",p1="cursor: pointer; margin: auto; margin-top: 5px",g1="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;",Ts="em_version";function Ql(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(Ts),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function n9(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Ts,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Ts}=${Date.now()}`}}var r9=/^(chrome-extension|moz-extension|safari-extension):\/\//i,o9=/local\.adguard\.org/i,i9=/^bis_/i,s9=new Set(["data-bis-config"]),ri=/<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,a9=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,Jl=/<style\b[^>]*>[\s\S]*?<\/style>/gi,b1=/display:\s*none\s*!important/gi,l9=[".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; }"],y1=new Set(["em","data-theme-varibalse","data-em-localization"]);function c9(e){return b1.lastIndex=0,(e.match(b1)||[]).length}function rm(e){const t=e.trim(),n=c9(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=l9.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 u9(e){if(y1.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of y1)if(e.hasAttribute(t))return!1;return rm(e.textContent||"")}function d9(e){return r9.test(e.src)||o9.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function v1(e){let t=!1;for(const n of[...e.attributes])(i9.test(n.name)||s9.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function f9(e){Jl.lastIndex=0;for(const t of e.matchAll(Jl))if(rm(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function m9(e){let t=!1;return Jl.lastIndex=0,{html:e.replace(Jl,n=>rm(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function E1(e){let t=!1;return e instanceof Element&&v1(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{d9(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&u9(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{v1(n)&&(t=!0)}),t}function h9(e){return ri.lastIndex=0,ri.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||f9(e)}function p9(e){if(!h9(e))return{html:e,found:!1};let t=!1,n=e;ri.lastIndex=0,ri.test(n)&&(ri.lastIndex=0,n=n.replace(ri,""),t=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(n)||/\sdata-bis-config\s*=/.test(n))&&(n=n.replace(a9,""),t=!0);const r=m9(n);return n=r.html,t=t||r.found,{html:n,found:t}}var g9=class extends Ce{constructor(...e){super(...e),k(this,"_transforms",[]),k(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 om(){return xt.getInstance(wo)}var ec=new WeakMap;function b9(e,t,n){const r=ec.get(e);r?r.set(t.toLowerCase(),n):ec.set(e,new Map([[t.toLowerCase(),n]]))}function y9(e,t){const n=ec.get(e);n?.size&&ec.set(t,new Map(n))}function S1(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 im(e,t={}){const n=t.pipeline??om(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),nn(e,o),n&&!n.isEmpty&&w1(e,o)),!n||n.isEmpty)return o;o instanceof Element&&S1(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)S1(s,n,r);return o}function v9(e,t={}){const n=t.pipeline??om(),r=Vx(e);if((!n||n.isEmpty)&&!r)return rn(e);const o=im(e,{...t,pipeline:n,clone:!0});return Ho(o),Ip(o)}function w1(e,t){y9(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)w1(n[o],r[o])}function Pt(e,t,n,r={}){const o=sm(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function sm(e,t,n,r={}){const o=r.pipeline??om();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&&b9(a,t,n)}return s}function E9(e){const t=new g9,n=$p((o,i,s)=>t.isEmpty?s:sm(o,i,s,{pipeline:t})),r=XA((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(wo,t),{pipeline:t,dispose(){r(),n(),t.dispose(),vn(e,wo)}}}function S9(e){return Ql(e)}function C1(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=S9(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var _1=[".em-code",':not(editor)[contenteditable="false"]','.em-vindent[class*="em-vindent-padding"]',"#gtx-anchor",'[data-mce-bogus="1"]','style[data-theme-varibalse="true"]','style[data-em-localization="true"]',".em-element-img-change-group",".em-element-resize-img",".em-element-editor",".em-element-vindent-bg",".em-element-gap",".em-element-gap-marker",".em-element-gap-bg",".em-gap",".em-powered-logo",".em-element-vindent-value"],w9=["contenteditable","em-edit","em-state","em-hover"],C9=["[data-mce-caret=before]","span.em-element-resize-img-container","div.em-element-img-change-group","div.em-element-block-add","meta[http-equiv=Content-Security-Policy]","[class*=mce-]","script[em=initial]",".em-editor-wrapper",".em-element-resize-height",".em-element-vindent-remove",".em-element-vindent",".em-element-vindent-value","div.iframe-resizer-inner"],_9=new Set(["normal","400"]),A9=new Set(["normal"]),T9=new Set(["baseline","unset","initial",""]),A1=new Set(["none",""]),k9=["b","strong","em","i","u","s","strike","sup","sub"],L9="___em-internal",T1=["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"],N9=["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"],x9=[..._1,...C9].filter(e=>/\.em-(element-|gap|vindent)/.test(e)&&e!=="span.em-element-resize-img-container").join(", "),O9=w9.filter(e=>!_1.some(t=>t.includes(`[${e}`))),R9=[...T1,...N9],M9={isServiceAttribute:e=>O9.includes(e),isServiceClass:e=>R9.includes(e),isServicePanel:e=>e.matches(x9)||e.hasAttribute("data-em-caret")};function tc(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")}),T1.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&&(_t(t,"[data-mce-caret=before]",!0),_t(t,"span.em-element-resize-img-container"),_t(t,"div.em-element-img-change-group",!0),_t(t,"div.em-element-block-add",!0),_t(t,"meta[http-equiv=Content-Security-Policy]",!0),_t(t,"[class*=mce-]"),_t(t,"script[em=initial]",!0),_t(t,".em-editor-wrapper",!0),_t(t,".em-element-resize-height",!0),_t(t,".em-element-vindent-remove",!0),_t(t,".em-element-vindent",!0),_t(t,".em-element-vindent-value",!0),_t(t,"div.iframe-resizer-inner"))}function P9(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(`.${Xe}`).forEach(t=>t.classList.remove(Xe)),tc(e),xy(e),_t(e,"editor",!1),L1(e),C1(e),E1(e)}function ks(e){return(e??"").trim().toLowerCase()}function I9(e){const t=ks(e.style.fontWeight);t&&_9.has(t)&&e.style.removeProperty("font-weight");const n=ks(e.style.fontStyle);n&&A9.has(n)&&e.style.removeProperty("font-style");const r=ks(e.style.verticalAlign);r&&T9.has(r)&&e.style.removeProperty("vertical-align");const o=ks(e.style.textDecorationLine);o&&A1.has(o)&&e.style.removeProperty("text-decoration-line");const i=ks(e.style.textDecoration);i&&A1.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function D9(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function k1(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==L9)return!1;return!0}function L1(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];I9(r),k1(r)&&D9(r)}for(const n of k9){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&&k1(i)&&i.remove()}}}function B9(e){const t=[],n=q9(e);return e=$9(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=ml.clear(e),e=am(e),t.length===0?e:U9(e,t,n)}var N1=`(<(script|style)\\b[^>]*>)([\\s\\S]*?)(?=<\\/\\2${Sa})`,H9=new RegExp(N1,"gi"),F9=new RegExp(`<!--[\\s\\S]*?-->|${N1}`,"gi");function $9(e,t,n){const r=(o,i,s,a)=>!a||!z9(s,i)?i+a:(t.push(s.toLowerCase()==="style"?W9(a):a),`${i}${n}${t.length-1}${O1}`);return e.replaceAll(F9,(o,i,s,a)=>i===void 0?o.replaceAll(H9,r):r(o,i,s??"",a??""))}function W9(e){const t=am(ml.clear(`>${e}`));return t.startsWith(">")?t.slice(1):am(ml.clear(e))}var x1="",O1="";function q9(e){let t=x1;for(;e.includes(t);)t+=x1;return t}function z9(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]),En(n)}function U9(e,t,n){return e.replaceAll(new RegExp(`${n}(\\d+)${O1}`,"g"),(r,o)=>t[Number(o)]??r)}function am(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=j(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function R1(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 V9(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 M1(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return VB(()=>s1(document,e,{forceMediaMerge:!0}))}function j9(e){let t=!1;return e.beforeCommit(()=>{try{!t&&e.takeStyleDirty()&&(t=!0,M1(),e.takeStyleDirty())}finally{t=!1}})}function nc(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 nc({node:n});i=R1(s);const a=n.cloneNode(!0);nn(n,a),i.appendChild(a)}else{const a=t.trim(),l=a.match(/<\!?([a-zA-Z]{1,})[^>]*>/i);if(s=l?l[1]:"div",s==="DOCTYPE"||s==="html")return nc({html:t});i=R1(s);const c=De(a);i.replaceChildren(...c)}im(i,{stage:"apply"}),P9(i),t=Ct(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();if(t)V9(i,De(t));else if(n){const s=n.cloneNode(!0);nn(n,s),i.appendChild(s)}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()),t9(i),tc(i),xy(i),i.documentElement&&_t(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())}),L1(i)),im(i,{stage:"apply"}),C1(i),E1(i),t=on(i)}return p9(B9(t)).html}function lm(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 P1="__emOwnEditor";function G9(e){e[P1]=!0,hy(e)}function I1(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[P1]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var X9=["deleteContentBackward","deleteContentForward","deleteByCut"],Y9={deleteContentBackward:"backward",deleteContentForward:"forward"};function K9(e){const{element:t,getVisibleText:n,setCursorToElement:r,hasOnlyTextNodesDeep:o,isRangeCoveringAllVisibleText:i,isEditorContentOnlyNbsp:s,commit:a,pasteFragment:l}=e,c=w=>Rt(w)?Rd(w):e.mapFn(w);function u(w){return!n(w,c).trim()&&!w.querySelector(D1)}const d=w=>n(w,c).trim();function f(w,C){const T=document.createRange();T.selectNodeContents(C);const y=w.cloneRange();return y.compareBoundaryPoints(y.START_TO_START,T)<0&&y.setStart(T.startContainer,T.startOffset),y.compareBoundaryPoints(y.END_TO_END,T)>0&&y.setEnd(T.endContainer,T.endOffset),B1(n(y.cloneContents(),c).trim(),d(C))}function m(w){w.insertAdjacentHTML("beforebegin"," "),w.removeAttribute("em-edit"),w.remove()}function h(w,C){if(!C.collapsed)return!1;const T=document.createRange();return T.setStart(C.endContainer,C.endOffset),T.setEnd(w,w.childNodes.length),!n(T.cloneContents(),c).trim()}function p(w,C=um(w,d)){const[T,...y]=C,g=T??w;if(!T&&Q9(w)){const b=document.createTextNode(" ");w.replaceChildren(b),r(b);return}const E=document.createElement(T&&T.tagName!=="EDITOR"?T.tagName:"div"),_=document.createTextNode(" ");if(T&&g.tagName===E.tagName)for(const{name:b,value:S}of Array.from(g.attributes))E.setAttribute(b,S);sM(E,T?w:r6(w),g,o6),E.getAttribute("style")||E.removeAttribute("style"),y.filter(b=>b.tagName!=="TBODY").reduce((b,S)=>b.appendChild(n6(S)),E).append(_),w.tagName==="A"||w.parentNode&&w.parentNode.tagName==="A"?w.replaceChildren(_):w.replaceChildren(E),r(_)}function v(w,C){if(C.collapsed)return!1;const T=um(w,d);return Ry(C,void 0,eR)?(u(w)&&p(w,T),t.setAttribute("em-edit","active"),a(!0),!0):!1}return function(C){const T=C.target,y=window.getSelection();if(!y||y.rangeCount===0)return;if(C.inputType==="insertFromPaste"&&l&&!C.defaultPrevented){l(C);return}const g=Y9[C.inputType];if(g&&ZO(y.getRangeAt(0),g)){C.preventDefault();return}if(X9.includes(C.inputType)&&v(T,y.getRangeAt(0))){C.preventDefault();return}const E=n(T,c).trim(),_=n(y.getRangeAt(0)?.cloneContents(),c).trim(),b=y.getRangeAt(0),S=b.startContainer,A=(S.nodeType===Node.TEXT_NODE?S.parentNode:S).closest("sup, sub");if((C.inputType==="deleteContentBackward"||C.inputType==="deleteByCut")&&!y?.isCollapsed&&_){if(A&&f(b,A)&&m(A),i(b)&&B1(_,E)&&!T.querySelector(cm)){C.preventDefault(),p(T),t.setAttribute("em-edit","active"),a(!0);return}t.setAttribute("em-edit","active"),a(!0)}if(C.inputType==="deleteContentBackward"&&y?.isCollapsed&&!_){S.length===1&&(A&&d(A).length===1&&m(A),t.setAttribute("em-edit","active"),a(!0));const L=()=>{z1(C)&&a(!0)};if(S.nodeType!==Node.TEXT_NODE&&!i(b))return L();const x=b.startOffset;if(x===0&&!i(b))return L();const N=S.parentNode;if(!N)return L();const $=Array.prototype.indexOf.call(N.childNodes,S);if(N.childNodes[$-1]?.nodeType===Node.COMMENT_NODE){C.preventDefault(),S.deleteData(x-1,1);const R=document.createRange();R.setStart(S,x-1),R.collapse(!0),y.removeAllRanges(),y.addRange(R),a(!0);return}T&&s(T)&&(C.preventDefault(),C.stopImmediatePropagation())}if(C.inputType==="insertText"&&!y?.isCollapsed){C.preventDefault();let L=C.data||"";const x=y.anchorNode;i(b)&&(x.tagName==="A"||x?.parentNode&&x.parentNode.tagName==="A")&&(L=" "+C.data),b.deleteContents();const N=document.createTextNode(L||" ");b.insertNode(N),b.setStartAfter(N),b.collapse(!0),y.removeAllRanges(),y.addRange(b),Vd(N,N,kd),a(!0);return}if(Z9.test(C.inputType)){const L=s6(C,y.getRangeAt(0));if(!L||(C.preventDefault(),QO(T,L))||(y.removeAllRanges(),y.addRange(L),v(T,L)))return;const x=um(T,d);q1("delete"),u(T)&&p(T,x),a();return}if(C.inputType.includes("deleteContent")&&(E.length<2||E===_)&&o(T)&&!T.querySelector(cm)&&!(C.inputType==="deleteContentForward"&&h(T,b))){C.preventDefault(),p(T),a(!0);return}if(C.inputType==="insertText"&&C.data){const L=y.anchorNode;if(L?.tagName==="A"&&!L.textContent?.trim().length){C.preventDefault(),C.stopImmediatePropagation(),L.insertAdjacentText("beforeend",C.data);const x=document.createRange();x.selectNodeContents(L),x.collapse(!1),y.removeAllRanges(),y.addRange(x),a(!0);return}if(L?.parentNode&&L.parentNode.tagName==="A"||L?.tagName==="A"){C.preventDefault(),C.stopImmediatePropagation();const x=y.getRangeAt(0),N=document.createTextNode(C.data||"");x.insertNode(N),x.setStartAfter(N),x.collapse(!0),y.removeAllRanges(),y.addRange(x),Vd(N,N,kd),a(!0);return}}if(C.inputType==="deleteContentBackward"&&!y.isCollapsed&&!_&&T&&s(T)&&(C.preventDefault(),C.stopImmediatePropagation()),z1(C)){a(!0);return}a()}}var cm="em-replace, img, picture, video, audio, svg, canvas, iframe, object, hr, input, button",D1=`${cm}, table`,Z9=/^delete(Word|SoftLine|HardLine)/;function B1(e,t){return e.replace(/\s+/g," ")===t.replace(/\s+/g," ")}function Q9(e){return[H1(e,"previousSibling"),H1(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 H1(e,t){let n=e[t];for(;n?.nodeType===Node.TEXT_NODE&&!n.textContent?.trim();)n=n[t];return n}var J9=/^(AREA|BASE|BR|COL|EMBED|HR|IMG|INPUT|LINK|META|SOURCE|TRACK|WBR)$/,F1=/^(SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SMALL|BIG|MARK)$/,e6={TABLE:["THEAD","TBODY","TFOOT","TR"],THEAD:["TR"],TBODY:["TR"],TFOOT:["TR"],TR:["TD","TH"]};function um(e,t){const n=t(e),r=[];for(let o=$1(e,n,t);o;o=t6(o,n,t))r.push(o);return r}function $1(e,t,n){const r=W1(e,n);if(!(!r||J9.test(r.tagName)||r.tagName!=="TABLE"&&r.matches(D1)))return!(r.tagName==="A"||F1.test(r.tagName))||n(r)===t?r:void 0}function t6(e,t,n){const r=e6[e.tagName];if(r)return Array.from(e.children).find(i=>r.includes(i.tagName));if(e.tagName==="TD"||e.tagName==="TH")return $1(e,t,n);const o=W1(e,n);return o&&F1.test(o.tagName)&&n(o)===t?o:void 0}function W1(e,t){for(const n of Array.from(e.childNodes))if(!(Rt(n)&&!t(n))){if(n.nodeType===Node.ELEMENT_NODE)return n;if(t(n))return}}function n6(e){const t=e.cloneNode(!1);return t.removeAttribute("em-edit"),t}function r6(e){const t=e.cloneNode(!1);return t.removeAttribute("innerStyle"),t.removeAttribute("innerClass"),t}var o6=e=>j(e)??e;function i6(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 s6(e,t){const n=Pd(t,e.inputType.endsWith("Backward")?"backward":"forward");if(!n)return i6(e);const r=document.createRange();return r.selectNode(n),r}var a6={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"},l6=["insertText"],dm=!1;function q1(e,t){dm=!0;try{dr(e,!1,t)}finally{dm=!1}}function c6(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 z1(e){const t=a6[e.inputType];if(!t||e.defaultPrevented||e.isComposing||dm)return!1;const n=e.inputType==="insertReplacementText"?c6(e):e.data??void 0;return l6.includes(t)&&!n?!1:(e.preventDefault(),q1(t,n),!0)}function u6(e){return function(n,r){if(!n||(n.querySelectorAll("editor")?.forEach(s=>{s.onclick=null,s.onkeyup=null,s.onmousedown=null}),tc(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(s=>s.remove()),I1(n),cM(n,r)))return;av(n,De);const o=document.createElement("editor");if(G9(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)n.before(o),o.replaceChildren(n),jx(o);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",Ot(()=>e.commit(!0)),!0),o.addEventListener("beforeinput",K9({element:n,getVisibleText:sv,mapFn:iM,setCursorToElement:aM,hasOnlyTextNodesDeep:ov,isRangeCoveringAllVisibleText:VO,isEditorContentOnlyNbsp:UO,commit:e.commit,pasteFragment:s=>{const a=l=>lm({target:l.target},c=>e.commit(c));vl(s,!1,O.get("commonStyles"),a,e.commit)}}))}}function d6({commit:e,htmlDocument:t,documentMapping:n}){const r=u6({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||zO(()=>r(i,s),"editor")}}}var U1=e=>t=>t.some(n=>e(n).some(f6)),f6=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),m6=U1(({removed:e})=>e),h6=U1(({added:e})=>e),p6=e=>t=>{m6(t)&&!h6(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){Tr("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},g6=200;function b6(e){let t=!1;return()=>{if(t)return;t=!0;let n;const r=()=>{t&&(t=!1,clearTimeout(n),e())};n=setTimeout(r,g6),window.requestAnimationFrame(()=>setTimeout(r,0))}}var Ye={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"},Ne="em-icon";function y6(e,t,n){return(t=w6(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hr(){return hr=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},hr.apply(null,arguments)}function V1(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 Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V1(Object(n),!0).forEach(function(r){y6(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V1(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function v6(e,t){if(e==null)return{};var n,r,o=E6(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 E6(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 S6(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 w6(e){var t=S6(e,"string");return typeof t=="symbol"?t:t+""}function fm(e){"@babel/helpers - typeof";return fm=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},fm(e)}var C6="1.15.7";function pr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var gr=pr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ls=pr(/Edge/i),j1=pr(/firefox/i),Ns=pr(/safari/i)&&!pr(/chrome/i)&&!pr(/android/i),mm=pr(/iP(ad|od|hone)/i),G1=pr(/chrome/i)&&pr(/android/i),X1={capture:!1,passive:!1};function ve(e,t,n){e.addEventListener(t,n,!gr&&X1)}function ge(e,t,n){e.removeEventListener(t,n,!gr&&X1)}function rc(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 Y1(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function An(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&rc(e,t):rc(e,t))||r&&e===n)return e;if(e===n)break}while(e=Y1(e))}return null}var K1=/\s+/g;function jt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(K1," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(K1," "))}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 oi(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 Z1(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 Vn(){var e=document.scrollingElement;return e||document.documentElement}function tt(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==Vn()?(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,!gr))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 m=oi(o||e),h=m&&m.a,p=m&&m.d;m&&(s/=p,a/=h,d/=h,u/=p,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function Q1(e,t,n){for(var r=Pr(e,!0),o=tt(e)[t];r;){var i=tt(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===Vn())break;r=Pr(r,!1)}return!1}function ii(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)&&An(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function hm(e,t){for(var n=e.lastElementChild;n&&(n===Z.ghost||oe(n,"display")==="none"||t&&!rc(n,t));)n=n.previousElementSibling;return n||null}function un(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Z.clone&&(!t||rc(e,t))&&n++;return n}function J1(e){var t=0,n=0,r=Vn();if(e)do{var o=oi(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 _6(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 Pr(e,t){if(!e||!e.getBoundingClientRect)return Vn();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 Vn();if(r||t)return n;r=!0}}while(n=n.parentNode);return Vn()}function A6(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function pm(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 xs;function ew(e,t){return function(){if(!xs){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),xs=setTimeout(function(){xs=void 0},t)}}}function T6(){clearTimeout(xs),xs=void 0}function tw(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function nw(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 rw(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!An(o,t.draggable,e,!1)||o.animated||o===n)){var c=tt(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 It="Sortable"+new Date().getTime();function k6(){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:tt(r)});var o=Un({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=oi(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(_6(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=tt(c),f=c.prevFromRect,m=c.prevToRect,h=a.rect,p=oi(c,!0);p&&(d.top-=p.f,d.left-=p.e),c.toRect=d,c.thisAnimationDuration&&pm(f,d)&&!pm(u,d)&&(h.top-d.top)/(h.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=N6(h,f,m,o.options)),pm(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,h,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=oi(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=L6(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 L6(e){return e.offsetWidth}function N6(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 si=[],gm={initializeByDefault:!0},Os={mount:function(t){for(var n in gm)gm.hasOwnProperty(n)&&!(n in t)&&(t[n]=gm[n]);si.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),si.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";si.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Un({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Un({sortable:n},r)))})},initializePlugins:function(t,n,r,o){si.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,hr(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 si.forEach(function(o){typeof o.eventProperties=="function"&&hr(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return si.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function x6(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,m=e.putSortable,h=e.extraEventProperties;if(t=t||n&&n[It],!!t){var p,v=t.options,w="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!gr&&!Ls?p=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(p=document.createEvent("Event"),p.initEvent(r,!0,!0)),p.to=s||n,p.from=a||n,p.item=o||n,p.clone=i,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=f,p.pullMode=m?m.lastPutMode:void 0;var C=Un(Un({},h),Os.getEventProperties(r,t));for(var T in C)p[T]=C[T];n&&n.dispatchEvent(p),v[w]&&v[w].call(t,p)}}var O6=["evt"],Dt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=v6(r,O6);Os.pluginEvent.bind(Z)(t,n,Un({dragEl:F,parentEl:Ke,ghostEl:ce,rootEl:He,nextEl:so,lastDownEl:oc,cloneEl:$e,cloneHidden:Ir,dragStarted:Ms,putSortable:ht,activeSortable:Z.active,originalEvent:o,oldIndex:ai,oldDraggableIndex:Rs,newIndex:Gt,newDraggableIndex:Dr,hideGhostForTarget:uw,unhideGhostForTarget:dw,cloneNowHidden:function(){Ir=!0},cloneNowShown:function(){Ir=!1},dispatchSortableEvent:function(a){At({sortable:n,name:a,originalEvent:o})}},i))};function At(e){x6(Un({putSortable:ht,cloneEl:$e,targetEl:F,rootEl:He,oldIndex:ai,oldDraggableIndex:Rs,newIndex:Gt,newDraggableIndex:Dr},e))}var F,Ke,ce,He,so,oc,$e,Ir,ai,Gt,Rs,Dr,ic,ht,li=!1,sc=!1,ac=[],ao,Tn,bm,ym,ow,iw,Ms,ci,Ps,Is=!1,lc=!1,cc,gt,vm=[],Em=!1,uc=[],dc=typeof document<"u",fc=mm,sw=Ls||gr?"cssFloat":"float",R6=dc&&!G1&&!mm&&"draggable"in document.createElement("div"),aw=(function(){if(dc){if(gr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),lw=function(t,n){var r=oe(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=ii(t,0,n),s=ii(t,1,n),a=i&&oe(i),l=s&&oe(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+tt(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+tt(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[sw]==="none"||s&&r[sw]==="none"&&c+u>o)?"vertical":"horizontal"},M6=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},P6=function(t,n){var r;return ac.some(function(o){var i=o[It].options.emptyInsertThreshold;if(!(!i||hm(o))){var s=tt(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},cw=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||fm(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},uw=function(){!aw&&ce&&oe(ce,"display","none")},dw=function(){!aw&&ce&&oe(ce,"display","")};dc&&!G1&&document.addEventListener("click",function(e){if(sc)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),sc=!1,!1},!0);var lo=function(t){if(F){t=t.touches?t.touches[0]:t;var n=P6(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[It]._onDragOver(r)}}},I6=function(t){F&&F.parentNode[It]._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=hr({},t),e[It]=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 lw(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&&(!Ns||mm),emptyInsertThreshold:5};Os.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);cw(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:R6,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ve(e,"pointerdown",this._onTapStart):(ve(e,"mousedown",this._onTapStart),ve(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ve(e,"dragover",this),ve(e,"dragenter",this)),ac.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),hr(this,k6())}Z.prototype={constructor:Z,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ci=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,F):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(z6(r),!F&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Ns&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=An(l,o.draggable,r,!1),!(l&&l.animated)&&oc!==l)){if(ai=un(l),Rs=un(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){At({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),Dt("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=An(c,d.trim(),r,!1),d)return At({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),Dt("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!An(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&&!F&&r.parentNode===i){var c=tt(r);if(He=i,F=r,Ke=F.parentNode,so=F.nextSibling,oc=r,ic=s.group,Z.dragged=F,ao={target:F,clientX:(n||t).clientX,clientY:(n||t).clientY},ow=ao.clientX-c.left,iw=ao.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,F.style["will-change"]="all",l=function(){if(Dt("delayEnded",o,{evt:t}),Z.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!j1&&o.nativeDraggable&&(F.draggable=!0),o._triggerDragStart(t,n),At({sortable:o,name:"choose",originalEvent:t}),jt(F,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){Z1(F,u.trim(),Sm)}),ve(a,"dragover",lo),ve(a,"mousemove",lo),ve(a,"touchmove",lo),s.supportPointer?(ve(a,"pointerup",o._onDrop),!this.nativeDraggable&&ve(a,"pointercancel",o._onDrop)):(ve(a,"mouseup",o._onDrop),ve(a,"touchend",o._onDrop),ve(a,"touchcancel",o._onDrop)),j1&&this.nativeDraggable&&(this.options.touchStartThreshold=4,F.draggable=!0),Dt("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Ls||gr))){if(Z.eventCanceled){this._onDrop();return}s.supportPointer?(ve(a,"pointerup",o._disableDelayedDrag),ve(a,"pointercancel",o._disableDelayedDrag)):(ve(a,"mouseup",o._disableDelayedDrag),ve(a,"touchend",o._disableDelayedDrag),ve(a,"touchcancel",o._disableDelayedDrag)),ve(a,"mousemove",o._delayedDragTouchMoveHandler),ve(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&ve(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(){F&&Sm(F),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?ve(document,"pointermove",this._onTouchMove):n?ve(document,"touchmove",this._onTouchMove):ve(document,"mousemove",this._onTouchMove):(ve(F,"dragend",this),ve(He,"dragstart",this._onDragStart));try{document.selection?hc(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(li=!1,He&&F){Dt("dragStarted",this,{evt:n}),this.nativeDraggable&&ve(document,"dragover",I6);var r=this.options;!t&&jt(F,r.dragClass,!1),jt(F,r.ghostClass,!0),Z.active=this,t&&this._appendGhost(),At({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Tn){this._lastX=Tn.clientX,this._lastY=Tn.clientY,uw();for(var t=document.elementFromPoint(Tn.clientX,Tn.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Tn.clientX,Tn.clientY),t!==n);)n=t;if(F.parentNode[It]._isOutsideThisEl(t),n)do{if(n[It]){var r=void 0;if(r=n[It]._onDragOver({clientX:Tn.clientX,clientY:Tn.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=Y1(n));dw()}},_onTouchMove:function(t){if(ao){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=ce&&oi(ce,!0),a=ce&&s&&s.a,l=ce&&s&&s.d,c=fc&>&&J1(gt),u=(i.clientX-ao.clientX+o.x)/(a||1)+(c?c[0]-vm[0]:0)/(a||1),d=(i.clientY-ao.clientY+o.y)/(l||1)+(c?c[1]-vm[1]:0)/(l||1);if(!Z.active&&!li){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(ce){s?(s.e+=u-(bm||0),s.f+=d-(ym||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(ce,"webkitTransform",f),oe(ce,"mozTransform",f),oe(ce,"msTransform",f),oe(ce,"transform",f),bm=u,ym=d,Tn=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ce){var t=this.options.fallbackOnBody?document.body:He,n=tt(F,!0,fc,!0,t),r=this.options;if(fc){for(gt=t;oe(gt,"position")==="static"&&oe(gt,"transform")==="none"&>!==document;)gt=gt.parentNode;gt!==document.body&>!==document.documentElement?(gt===document&&(gt=Vn()),n.top+=gt.scrollTop,n.left+=gt.scrollLeft):gt=Vn(),vm=J1(gt)}ce=F.cloneNode(!0),jt(ce,r.ghostClass,!1),jt(ce,r.fallbackClass,!0),jt(ce,r.dragClass,!0),oe(ce,"transition",""),oe(ce,"transform",""),oe(ce,"box-sizing","border-box"),oe(ce,"margin",0),oe(ce,"top",n.top),oe(ce,"left",n.left),oe(ce,"width",n.width),oe(ce,"height",n.height),oe(ce,"opacity","0.8"),oe(ce,"position",fc?"absolute":"fixed"),oe(ce,"zIndex","100000"),oe(ce,"pointerEvents","none"),Z.ghost=ce,t.appendChild(ce),oe(ce,"transform-origin",ow/parseInt(ce.style.width)*100+"% "+iw/parseInt(ce.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if(Dt("dragStart",this,{evt:t}),Z.eventCanceled){this._onDrop();return}Dt("setupClone",this),Z.eventCanceled||($e=nw(F),$e.removeAttribute("id"),$e.draggable=!1,$e.style["will-change"]="",this._hideClone(),jt($e,this.options.chosenClass,!1),Z.clone=$e),r.cloneId=hc(function(){Dt("clone",r),!Z.eventCanceled&&(r.options.removeCloneOnHide||He.insertBefore($e,F),r._hideClone(),At({sortable:r,name:"clone"}))}),!n&&jt(F,i.dragClass,!0),n?(sc=!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,F)),ve(document,"drop",r),oe(F,"transform","translateZ(0)")),li=!0,r._dragStartId=hc(r._dragStarted.bind(r,n,t)),ve(document,"selectstart",r),Ms=!0,window.getSelection().removeAllRanges(),Ns&&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=ic===l,d=a.sort,f=ht||c,m,h=this,p=!1;if(Em)return;function v(V,ee){Dt(V,h,Un({evt:t,isOwner:u,axis:m?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:f,target:r,completed:C,onMove:function(J,be){return mc(He,n,F,o,J,tt(J),t,be)},changed:T},ee))}function w(){v("dragOverAnimationCapture"),h.captureAnimationState(),h!==f&&f.captureAnimationState()}function C(V){return v("dragOverCompleted",{insertion:V}),V&&(u?c._hideClone():c._showClone(h),h!==f&&(jt(F,ht?ht.options.ghostClass:c.options.ghostClass,!1),jt(F,a.ghostClass,!0)),ht!==h&&h!==Z.active?ht=h:h===Z.active&&ht&&(ht=null),f===h&&(h._ignoreWhileAnimating=r),h.animateAll(function(){v("dragOverAnimationComplete"),h._ignoreWhileAnimating=null}),h!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(r===F&&!F.animated||r===n&&!r.animated)&&(ci=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(F.parentNode[It]._isOutsideThisEl(t.target),!V&&lo(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function T(){Gt=un(F),Dr=un(F,a.draggable),At({sortable:h,name:"change",toEl:n,newIndex:Gt,newDraggableIndex:Dr,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=An(r,a.draggable,n,!0),v("dragOver"),Z.eventCanceled)return p;if(F.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||h._ignoreWhileAnimating===r)return C(!1);if(sc=!1,c&&!a.disabled&&(u?d||(s=Ke!==He):ht===this||(this.lastPutMode=ic.checkPull(this,c,F,t))&&l.checkPut(this,c,F,t))){if(m=this._getDirection(t,r)==="vertical",o=tt(F),v("dragOverValid"),Z.eventCanceled)return p;if(s)return Ke=He,w(),this._hideClone(),v("revert"),Z.eventCanceled||(so?He.insertBefore(F,so):He.appendChild(F)),C(!0);var y=hm(n,a.draggable);if(!y||F6(t,m,this)&&!y.animated){if(y===F)return C(!1);if(y&&n===t.target&&(r=y),r&&(i=tt(r)),mc(He,n,F,o,r,i,t,!!r)!==!1)return w(),y&&y.nextSibling?n.insertBefore(F,y.nextSibling):n.appendChild(F),Ke=n,T(),C(!0)}else if(y&&H6(t,m,this)){var g=ii(n,0,a,!0);if(g===F)return C(!1);if(r=g,i=tt(r),mc(He,n,F,o,r,i,t,!1)!==!1)return w(),n.insertBefore(F,g),Ke=n,T(),C(!0)}else if(r.parentNode===n){i=tt(r);var E=0,_,b=F.parentNode!==n,S=!M6(F.animated&&F.toRect||o,r.animated&&r.toRect||i,m),A=m?"top":"left",L=Q1(r,"top","top")||Q1(F,"top","top"),x=L?L.scrollTop:void 0;ci!==r&&(_=i[A],Is=!1,lc=!S&&a.invertSwap||b),E=$6(t,r,i,m,S?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,lc,ci===r);var N;if(E!==0){var $=un(F);do $-=E,N=Ke.children[$];while(N&&(oe(N,"display")==="none"||N===ce))}if(E===0||N===r)return C(!1);ci=r,Ps=E;var R=r.nextElementSibling,I=!1;I=E===1;var Q=mc(He,n,F,o,r,i,t,I);if(Q!==!1)return(Q===1||Q===-1)&&(I=Q===1),Em=!0,setTimeout(B6,30),w(),I&&!R?n.appendChild(F):r.parentNode.insertBefore(F,I?R:r),L&&tw(L,0,x-L.scrollTop),Ke=F.parentNode,_!==void 0&&!lc&&(cc=Math.abs(_-tt(r)[A])),T(),C(!0)}if(n.contains(F))return C(!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",lo),ge(document,"mousemove",lo),ge(document,"touchmove",lo)},_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(Gt=un(F),Dr=un(F,r.draggable),Dt("drop",this,{evt:t}),Ke=F&&F.parentNode,Gt=un(F),Dr=un(F,r.draggable),Z.eventCanceled){this._nulling();return}li=!1,lc=!1,Is=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),wm(this.cloneId),wm(this._dragStartId),this.nativeDraggable&&(ge(document,"drop",this),ge(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ns&&oe(document.body,"user-select",""),oe(F,"transform",""),t&&(Ms&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),ce&&ce.parentNode&&ce.parentNode.removeChild(ce),(He===Ke||ht&&ht.lastPutMode!=="clone")&&$e&&$e.parentNode&&$e.parentNode.removeChild($e),F&&(this.nativeDraggable&&ge(F,"dragend",this),Sm(F),F.style["will-change"]="",Ms&&!li&&jt(F,ht?ht.options.ghostClass:this.options.ghostClass,!1),jt(F,this.options.chosenClass,!1),At({sortable:this,name:"unchoose",toEl:Ke,newIndex:null,newDraggableIndex:null,originalEvent:t}),He!==Ke?(Gt>=0&&(At({rootEl:Ke,name:"add",toEl:Ke,fromEl:He,originalEvent:t}),At({sortable:this,name:"remove",toEl:Ke,originalEvent:t}),At({rootEl:Ke,name:"sort",toEl:Ke,fromEl:He,originalEvent:t}),At({sortable:this,name:"sort",toEl:Ke,originalEvent:t})),ht&&ht.save()):Gt!==ai&&Gt>=0&&(At({sortable:this,name:"update",toEl:Ke,originalEvent:t}),At({sortable:this,name:"sort",toEl:Ke,originalEvent:t})),Z.active&&((Gt==null||Gt===-1)&&(Gt=ai,Dr=Rs),At({sortable:this,name:"end",toEl:Ke,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Dt("nulling",this),He=F=Ke=ce=so=$e=oc=Ir=ao=Tn=Ms=Gt=Dr=ai=Rs=ci=Ps=ht=ic=Z.dragged=Z.ghost=Z.clone=Z.active=null;var t=this.el;uc.forEach(function(n){t.contains(n)&&(n.checked=!0)}),uc.length=bm=ym=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":F&&(this._onDragOver(t),D6(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],An(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||q6(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];An(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 An(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=Os.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&cw(r)},destroy:function(){Dt("destroy",this);var t=this.el;t[It]=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(),ac.splice(ac.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ir){if(Dt("hideClone",this),Z.eventCanceled)return;oe($e,"display","none"),this.options.removeCloneOnHide&&$e.parentNode&&$e.parentNode.removeChild($e),Ir=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ir){if(Dt("showClone",this),Z.eventCanceled)return;F.parentNode==He&&!this.options.group.revertClone?He.insertBefore($e,F):so?He.insertBefore($e,so):He.appendChild($e),this.options.group.revertClone&&this.animate(F,$e),oe($e,"display",""),Ir=!1}}};function D6(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function mc(e,t,n,r,o,i,s,a){var l,c=e[It],u=c.options.onMove,d;return window.CustomEvent&&!gr&&!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||tt(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function Sm(e){e.draggable=!1}function B6(){Em=!1}function H6(e,t,n){var r=tt(ii(n.el,0,n.options,!0)),o=rw(n.el,n.options,ce),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 F6(e,t,n){var r=tt(hm(n.el,n.options.draggable)),o=rw(n.el,n.options,ce),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 $6(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&&cc<c*o){if(!Is&&(Ps===1?l>u+c*i/2:l<d-c*i/2)&&(Is=!0),Is)f=!0;else if(Ps===1?l<u+cc:l>d-cc)return-Ps}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return W6(t)}return f=f||s,f&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function W6(e){return un(F)<un(e)?1:-1}function q6(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 z6(e){uc.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&uc.push(r)}}function hc(e){return setTimeout(e,0)}function wm(e){return clearTimeout(e)}dc&&ve(document,"touchmove",function(e){(Z.active||li)&&e.cancelable&&e.preventDefault()}),Z.utils={on:ve,off:ge,css:oe,find:Z1,is:function(t,n){return!!An(t,n,t,!1)},extend:A6,throttle:ew,closest:An,toggleClass:jt,clone:nw,index:un,nextTick:hc,cancelNextTick:wm,detectDirection:lw,getChild:ii,expando:It},Z.get=function(e){return e[It]},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=Un(Un({},Z.utils),r.utils)),Os.mount(r)})},Z.create=function(e,t){return new Z(e,t)},Z.version=C6;var nt=[],Ds,Cm,_m=!1,Am,Tm,pc,Bs;function U6(){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?ve(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ve(document,"pointermove",this._handleFallbackAutoScroll):r.touches?ve(document,"touchmove",this._handleFallbackAutoScroll):ve(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)),fw(),gc(),T6()},nulling:function(){pc=Cm=Ds=_m=Bs=Am=Tm=null,nt.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(pc=n,r||this.options.forceAutoScrollFallback||Ls||gr||Ns){km(n,this.options,a,r);var l=Pr(a,!0);_m&&(!Bs||i!==Am||s!==Tm)&&(Bs&&fw(),Bs=setInterval(function(){var c=Pr(document.elementFromPoint(i,s),!0);c!==l&&(l=c,gc()),km(n,o.options,c,r)},10),Am=i,Tm=s)}else{if(!this.options.bubbleScroll||Pr(a,!0)===Vn()){gc();return}km(n,this.options,Pr(a,!1),!1)}}},hr(e,{pluginName:"scroll",initializeByDefault:!0})}function gc(){nt.forEach(function(e){clearInterval(e.pid)}),nt=[]}function fw(){clearInterval(Bs)}var km=ew(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=Vn(),c=!1,u;Cm!==n&&(Cm=n,gc(),Ds=t.scroll,u=t.scrollFn,Ds===!0&&(Ds=Pr(n,!0)));var d=0,f=Ds;do{var m=f,h=tt(m),p=h.top,v=h.bottom,w=h.left,C=h.right,T=h.width,y=h.height,g=void 0,E=void 0,_=m.scrollWidth,b=m.scrollHeight,S=oe(m),A=m.scrollLeft,L=m.scrollTop;m===l?(g=T<_&&(S.overflowX==="auto"||S.overflowX==="scroll"||S.overflowX==="visible"),E=y<b&&(S.overflowY==="auto"||S.overflowY==="scroll"||S.overflowY==="visible")):(g=T<_&&(S.overflowX==="auto"||S.overflowX==="scroll"),E=y<b&&(S.overflowY==="auto"||S.overflowY==="scroll"));var x=g&&(Math.abs(C-o)<=s&&A+T<_)-(Math.abs(w-o)<=s&&!!A),N=E&&(Math.abs(v-i)<=s&&L+y<b)-(Math.abs(p-i)<=s&&!!L);if(!nt[d])for(var $=0;$<=d;$++)nt[$]||(nt[$]={});(nt[d].vx!=x||nt[d].vy!=N||nt[d].el!==m)&&(nt[d].el=m,nt[d].vx=x,nt[d].vy=N,clearInterval(nt[d].pid),(x!=0||N!=0)&&(c=!0,nt[d].pid=setInterval(function(){r&&this.layer===0&&Z.active._onTouchMove(pc);var R=nt[this.layer].vy?nt[this.layer].vy*a:0,I=nt[this.layer].vx?nt[this.layer].vx*a:0;typeof u=="function"&&u.call(Z.dragged.parentNode[It],I,R,e,pc,nt[this.layer].el)!=="continue"||tw(nt[this.layer].el,I,R)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==l&&(f=Pr(f,!1)));_m=c}},30),mw=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 Lm(){}Lm.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=ii(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:mw},hr(Lm,{pluginName:"revertOnSpill"});function Nm(){}Nm.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:mw},hr(Nm,{pluginName:"removeOnSpill"}),Z.mount(new U6),Z.mount(Nm,Lm);var hw=100,pw=Symbol("EMULATED_DRAG_EVENT");function V6(e,t){return e[pw]===t}var gw=class{constructor(){k(this,"_target",null),k(this,"_interval",0),k(this,"_x",0),k(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[pw]=this,Ut(()=>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)},hw),!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)},hw)))}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 bc(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 Hs(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function xm(e){const t=document.createElement("div");t.replaceChildren(...De(e.atomHTML));const n=t.querySelector("img");if(!n)return Ct(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=Hs(e.targetAtom):r=e.targetAtom.parentNode?Hs(e.targetAtom.parentNode):Hs(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?bc(t):n.style.maxWidth=r+"px",Ct(t)}function bw(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=Hs(n);o.style.display=a;const c=s>=Hs(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?bc(e):o.style.maxWidth=c+"px",!0)}function yw(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...De(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")?bc(n):(r.style.maxWidth=i+"px",r.style.width="100%"),or(e.targetElem,e.targetPlace,`
|
|
52
|
-
`+Ct(n)+`
|
|
53
|
-
`),t()},o.src=r.getAttribute("src")||"",!1}function Om(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...De(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return Ct(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()),Pt(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),Ct(t)}function yc(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...De(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(" ")}),bc(t),Ct(t)}function j6(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var G6=class{constructor(){k(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]}},Br=new G6,X6=Number.MAX_VALUE,Y6=0;function vw(e){return typeof e=="object"?e.name:e}var K6=class{constructor(){k(this,"emulator",new gw),k(this,"x",0),k(this,"y",0),k(this,"_tracked",!1),k(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)))}},dn=new K6,Ew=Z.prototype,Z6=Ot(Ew._onDragOver);function Q6(e){Br.gc(),dn.track(),Ew._onDragOver=Z6;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(h,p){let v=null,w=Number.MAX_VALUE;const C=vw(Z.active?.options.group);for(const[T,y]of Br.entries())if(vw(y.options.group)===C&&(!a||c&&a(T,c)!==!1)){for(const g of T.children)if(!g.classList.contains("sortable-drag")){const E=g.getBoundingClientRect(),_=h<E.left?E.left-h:h>E.right?h-E.right:0,b=p<E.top?E.top-p:p>E.bottom?p-E.bottom:0;if(_<X6||b<Y6){const S=Math.sqrt(_*_+b*b);S<w?(v=[y,g],w=S):S===w&&v[1].contains(g)&&(v=[y,g])}}}return v}function d(h){const p="TouchEvent"in window&&h instanceof TouchEvent?h.touches[0]:h,v=u(p.clientX,p.clientY);if(v){const[T,y]=v,g=y.getBoundingClientRect();var w={clientX:g.left+g.width/2,clientY:p.clientY};for(var C in h)h.hasOwnProperty(C)&&(w[C]=h[C]);w.target=y,w.rootEl=y.parentNode,w.preventDefault=void 0,w.stopPropagation=void 0,T._onDragOver(w)}}return{onStart:h=>{c=h.item,Z.ghost&&my(Z.ghost),j6(Z.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),dn.emulator.start(dn.x,dn.y)?(window.addEventListener("mousemove",dn.handleMouseMove),n&&(n.dispose(),n=void 0)):h.preventDefault()},onEnd:h=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let p=!1;h.from===h.to?dn.emulator.end(dn.x,dn.y):(p=!!l?.(h),dn.emulator.drop(dn.x,dn.y)),window.removeEventListener("mousemove",dn.handleMouseMove),e.endTextUpdate(),h.from===h.to&&h.oldIndex!==h.newIndex&&e.commit(!0),p&&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&&!Br.get(l)&&Br.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${Ye.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),Br.get(l)||Br.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${Ye.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&&Hn(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=>bw(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),Br.get(c)||Br.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${Ye.drag}`,...o(),onMove:r}))}}}var J6=class{constructor(){k(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)}},Rm={get textDocument(){return D(xt,Di)},commit:Zr};function e7(){const e=O.get("applicationTheme")||"light";let t=!1;try{Rm.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?ee1618fa";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?ee1618fa`;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{Rm.textDocument.endUpdate()}t&&Rm.commit(!1)}var AZ=".em-prevent-action";function t7(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 n7(){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"))&&Ve(e,!!t,"mceNonEditable"),Ve(e,!!O.get("previewPage"),"em-sandbox-preview")}function r7(e){const{htmlDocument:t,commit:n,focusController:r}=e,o=b6(()=>Q6(t));t.onChange(a=>{a.some(l=>l.added.length||l.characterDataChanged||l.reordered?.length||l.reparented?.length)&&o()}),t.onChange(()=>{e7()}),t.onRefresh(()=>e.initPreview()),t.onChange(a=>{a.some(l=>l.removed.some(c=>c instanceof HTMLHeadElement||c instanceof HTMLLinkElement&&c.hasAttribute("em")))&&document.querySelector(".em-editor-wrapper")?.remove()});const i=new J6;let s;t.onChange(a=>{for(const l of a)for(const c of l.added)i.add(c.parentElement??c);s||(s=setTimeout(()=>{r.whenEditorLostFocus(()=>{i.clear(),n(!1)}),s=void 0},1e3))}),t.onChange(p6(e.applicationElementSettingsSet)),t.onChange(()=>{O.get("activeElementLocked")>0||(t7(e),n7())})}function o7(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"),Ut(()=>document.querySelectorAll("editor").forEach(r=>r.blur())),t.forget()}finally{Promise.resolve().then(()=>O.decrement("activeElementLocked"))}}function i7(e){const t=Ot(n=>o7(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 s7={name:"sandbox.fingerprint",provides:[Ao],awaits:{services:[te]},setup(e){const t=D(e,te),n=FO(r=>t.getOuterHtml(r));$O(n),i7(n),e.inject(Ao,n)}},a7={name:"sandbox.setCursor",provides:[Nt],awaits:{services:[te,bn,St]},setup(e){const t={HTMLDocument:D(e,te),documentMapping:D(e,bn),remoteDocument:D(e,St),messageService:K};e.inject(Nt,n=>qO(n,t))}},l7={name:"sandbox.wrapEditor",provides:[yn],awaits:{services:[te,bn,Re]},setup:e=>e.inject(yn,d6({commit:mt(e),htmlDocument:D(e,te),documentMapping:D(e,bn)}))};function c7(e){const{container:t}=e;Zl.registerAll({MessageService:()=>K,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(te),SyncServiceInternals:()=>t.getInstance(St),TextDocument:()=>t.getInstance(Di),Mapping:()=>t.getInstance(bn),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&Zl.initFeatures(e.features)}var u7=e=>e,d7=e=>`table:empty::before {
|
|
54
|
-
/*content: 'Paste block here';*/
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
table:is(:empty, :has(> tbody:only-child:empty))::after {
|
|
58
|
-
content: '${e.DROP_BLOCK_HINT}' !important;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
[em="block"].empty-structure td:not([height]):not([width]):empty::before {
|
|
62
|
-
/*content: 'Paste atom here';*/
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.em-block-insert:after {
|
|
66
|
-
content: '${e.PASTE_HERE}' !important;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.em-atom-insert:after,
|
|
70
|
-
.em-blockatom-insert:after {
|
|
71
|
-
content: '${e.PASTE_HERE}' !important;
|
|
72
|
-
}`,f7=class extends Ce{constructor(e){super(),k(this,"htmlDocument",void 0),k(this,"_localized",{...dk(u7)}),k(this,"_styles",""),k(this,"_onChangeLocaleEmitter",new ye),k(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)}}}),k(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=d7(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 m7(e){const t=new f7(e),n=r=>{t.setTranslations(r)};return t.addDisposable(K.addListener(Le.SANDBOX_TRANSLATIONS,n)),t}function h7(e,t,n){const r=new Ce;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 p7(e){const t=new Ce,n=r=>{V6(r,e)||K.send(Le.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 g7(){const e=new gw,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 Ce;return n.addDisposable(K.addListener(Le.SANDBOX_DRAG_EVENT,t)),n.addDisposable(p7(e)),n}function b7(){return NodeFilter.FILTER_ACCEPT}function y7(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,b7);let r;for(;r=n.nextNode();)t.push(r)}return t}var v7=new jb,E7=new Set;function Sw(e){return e?v7.getUnescapedText(e,!0,E7)!==e:!1}function ww(e){return e.nodeValue?Sw(e.nodeValue):!1}function S7(e){const t=e.previousSibling;if(t instanceof HTMLSpanElement&&t.classList.contains("em-code")&&t.classList.contains("em-code_var"))return t}function vc(e){const t=e?.nextSibling;if(t instanceof Comment&&ww(t))return t}function Cw(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 w7(){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(Cw(r,i)===0&&Cw(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 C7=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"]');Ut(()=>{n.addRange(r),o?.focus()})},_w=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},_7=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=_w(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},A7=(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 T7(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 Aw(e){const t=e.startContainer;return Rt(t)?t:Rt(t.parentNode)?t.parentNode:null}function k7(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 L7(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function N7({em:e,side:t}){const n=t==="after"?_w(e):L7(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&&es(o,r)}function x7(e){const t=C=>e.renderOnly(C);let n=null,r=null,o=!1;const i=C=>!!n&&n.em===C.em&&n.side===C.side&&r===(C.side==="after"?"ArrowLeft":"ArrowRight"),s=C=>{XO(document,t,C)&&e.commit(!1),YO(document,t,C)},a=()=>{const C=window.getSelection();if(o||!C?.rangeCount)return;const T=C.getRangeAt(0),y=e.ownership?T7(T,e.ownership,r):null;if(y){n=null;const _=Id(y.node,y.side,t);s(_);return}const g=Ay(T);if(g&&i(g)){n=null,N7(g),s();return}if(g){const _=hl(g.em,g.side,t);n=g,s(_);return}const E=T.collapsed?Aw(T):null;n=E?k7(E):null,s(E)},l=()=>{const C=window.getSelection(),T=C?.rangeCount?Aw(C.getRangeAt(0)):null;return!!T&&e.applyOwn(()=>KO(T,t))!==null},c=C=>{!C.isComposing&&l()&&e.commit(!0)},u=()=>{o=!0},d=()=>{o=!1,l(),e.commit(!0)},f=C=>{r=C.key},m=C=>{const T=window.getSelection();T?.rangeCount&&C?.closest?.('[contenteditable="true"]')&&Ry(T.getRangeAt(0),t)},h=C=>{C.key?.length===1&&!C.ctrlKey&&!C.metaKey&&!C.altKey&&m(C.target)},p=C=>{C.inputType==="insertCompositionText"&&m(C.target)},v=()=>{r=null},w=C=>Dd(C,t);return e.holdCaretAfterBreak=w,document.addEventListener("selectionchange",a),document.addEventListener("input",c),document.addEventListener("compositionstart",u,!0),document.addEventListener("compositionend",d,!0),document.addEventListener("keydown",f,!0),document.addEventListener("pointerdown",v,!0),window.addEventListener("keydown",h,!0),window.addEventListener("beforeinput",p,!0),{dispose(){e.holdCaretAfterBreak===w&&(e.holdCaretAfterBreak=void 0),document.removeEventListener("selectionchange",a),document.removeEventListener("input",c),document.removeEventListener("compositionstart",u,!0),document.removeEventListener("compositionend",d,!0),document.removeEventListener("keydown",f,!0),document.removeEventListener("pointerdown",v,!0),window.removeEventListener("keydown",h,!0),window.removeEventListener("beforeinput",p,!0)}}}function Mm(){return O.get("commonStyles")}var Ec={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"},O7={"Sans Serif":"sans-serif",Serif:"serif"},Tw=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function ui(e){return e.querySelector(Tw)}function Fs(e){return Array.from(e.querySelectorAll(Tw))}function Pm(e){const t=e.closest('[em="block"]');return t?ui(t)??t.querySelector("td"):null}function kw(e){const t=e.closest('[em="block"]');return!!t&&(e===t||Fs(t).includes(e))}var R7=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Hr=(e,t)=>{R7()},Fr=new Map;function M7(e){return Fr.get(e.toLowerCase())?.[0]}function Im(e){return Fr.get(e.toLowerCase())??[]}function P7(){return Fr.size>0}function Lw(){return[...Fr.values()].map(e=>e[0])}function I7(e){Fr=new Map;for(const t of e??[]){const n=t.family.toLowerCase();Fr.set(n,[...Fr.get(n)??[],t])}return Fr}var D7=e=>{const t=I7(e);Hr("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function B7(){const e=new Ce;return e.addDisposable(K.addListener(Le.SANDBOX_SET_PROJECT_FONTS,D7)),e}var H7={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function Nw(e){return e.category==="serif"?"serif":"sans-serif"}function Sc(e,t){const n=M7(t);return n?(e.style.fontFamily=H7[Nw(n)],!0):!1}var F7=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,$7=/url\(\s*(['"]?)(.*?)\1\s*\)/,W7=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function Dm(e){return Array.from(e.matchAll(F7),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:W7(n.get("font-family")??""),src:$7.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function xw(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function Ow(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 Bm(){return xt.getInstance(sg)?.()??document.head}function Hm(){return Bm().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function We(){if(!Hm()){const e=document.createElement("style");e.setAttribute("em","styles"),Bm().append(e)}}function q7(){const e=Bm(),t=()=>{const r=Hm(),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 wc(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function Rw(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 Fm(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(`
|
|
73
|
-
`));let l=n(s+`
|
|
74
|
-
`+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
|
|
75
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;l=r(l,{indent:" ",autosemicolon:!0}),i.textContent=`
|
|
76
|
-
`+l+`
|
|
77
|
-
`}function di(e){return(e||"").replace(/\s/g,"")}function Cc(e,t){return`em-font-${di(e)}-${di(t)}`}function Mw(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function $m(e){return Cc(e[2]||"",e[3]||"")}var Wm="em-font-custom";function z7(e){return e[1]==="Project Fonts"}function qm(e,t){z7(t)&&e.classList.add(Wm)}function zm(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function U7(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+")",Pt(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 _c(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=j(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||(j(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=j(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=j(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=j(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=j(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=j(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=j(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=j(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=j(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=j(e.style.borderLeftColor)||null)}return t}function $s(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 Ws(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]&&j(n[0])||"",inset:n[3]==="inset"||n[4]==="inset"||n[5]==="inset"})}return t}function Pw(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 Xt(e){return e==null||e===""}function Um(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!Xt(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&&(!Xt(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&&(!Xt(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&&(!Xt(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&&(!Xt(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 V7(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!Xt(r.hOffset)&&!Xt(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=Xt(r.blurRadius)?"":r.blurRadius+"px ",o+=Xt(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function qs(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(Xt(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",Xt(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",Xt(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",Xt(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function Iw(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+=Iw(n)}),t}function Dw(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=>Dw(r,t,n))}function j7(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 Bw=/\[if[^\]]*mso[^\]]*\]/i,Hw="[if gte mso 9]></v:textbox></v:rect><![endif]";function G7(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 X7(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function Y7(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 K7(e){const t=Y7(e),n=xt.getInstance(ag);return n?n(e,t):t}function Z7(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 Fw(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function zs(e){if(!Fw(e))return!1;const t=e.nodeValue||"";return Bw.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function Vm(e){if(!Fw(e))return!1;const t=e.nodeValue||"";return Bw.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function jm(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function $w(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function Ww(e){for(const t of Array.from(e.childNodes))(zs(t)||Vm(t))&&e.removeChild(t)}function Us(e,t="inside"){return t==="around"?zs(jm(e)):Array.from(e.childNodes).some(n=>zs(n))}function qw(e,t="inside"){if(t==="around"){const n=e.parentNode;if(!n)return;const r=jm(e),o=$w(e);zs(r)&&n.removeChild(r),Vm(o)&&n.removeChild(o);return}Ww(e)}function zw(e,t="inside"){const n=G7(e);if(!n){qw(e,t);return}const r=Z7(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),X7(e),K7(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const s=jm(e);zs(s)&&i.removeChild(s);const a=$w(e);Vm(a)&&i.removeChild(a),i.insertBefore(o.createComment(r),e),i.insertBefore(o.createComment(Hw),e.nextSibling);return}Ww(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(Hw))}}function Vs(e,t,n="inside"){t?.outlookBackground===!0?zw(e,n):t?.outlookBackground===!1?qw(e,n):Us(e,n)&&j7(t)&&zw(e,n)}var Gm=/v:roundrect/i,Xm=/\[if\s*!\s*mso\]/i,Uw=/^\s*(?:<!)?\[endif\]\s*$/i,Ym=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],Q7=[...Ym,"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 fi(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function Km(e){const t=[],n=r=>{r.childNodes.forEach(o=>{fi(o)&&Gm.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function Vw(e,t){const n=$r(e);if(!n)return!1;const r=n.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(r))return!1;const o=Gw((t||"").replace(/\s+/g," ").trim());return n.nodeValue=r.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(i,s,a)=>`${s}${o}${a}`),!0}function $r(e){for(const t of Array.from(e.childNodes)){if(fi(t)&&Gm.test(t.nodeValue||""))return t;const n=$r(t);if(n)return n}return null}function jw(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function J7(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function jn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function eH(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 Gw(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function tH(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of Ym){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 nH(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 Ym){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 rH(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function Zm(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(rH(t))return t;return null}function Qm(e){return e?!!Zm(e)||!!$r(e):!1}function oH(e,t){for(const n of Q7){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 iH(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Xw(e,t){const n=Zm(t);return n?(oH(n,t),iH(n),Km(t).forEach(r=>r.parentNode?.removeChild(r)),Jm(t),!0):!1}function sH(e){for(const t of e){const n=t.nodeValue||"";if(!Gm.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?jn(i[1]):0,height:s?jn(s[1]):0,arcsize:a?jn(a[1]):0}}return{width:0,height:0,arcsize:0}}function aH(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:j(o)||o||"#000000",weight:`${i}px`,dash:s}}var lH=new Set(["bold","bolder","600","700","800","900"]);function cH(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&&lH.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 uH(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}">${Gw(e.label)}</center></v:roundrect><![endif]`}function Jm(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(fi(o)){const i=o.nodeValue||"";(Xm.test(i)||Uw.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function dH(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&Xw(t,n),Km(t).forEach(r=>r.parentNode?.removeChild(r)),Jm(t),n&&nH(t,n)}function fH(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=jw(e);fi(r)&&Xm.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=J7(e);fi(o)&&Uw.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function mH(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function hH(e,t){if(t?.width?.value&&t.width.dim==="px")return jn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?jn(n):0}function pH(e,t){if(t?.height?.value&&t.height.dim==="px")return jn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?jn(n):jn(e.style.height)}function gH(e,t){return e?.borderRadius&&e.borderRadius.all!=null?jn(e.borderRadius.all):jn(t.style.borderRadius)}function bH(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 eh(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=Km(n),i=eH(r,o),s=sH(o);Xw(n,r),tH(n,r),o.forEach(w=>w.parentNode?.removeChild(w)),Jm(n);const a=hH(n.closest("table"),t)||s.width,l=pH(n,t)||s.height,c=gH(t,r),u=cH(r),d=aH(r),f=bH(c,a,l)||s.arcsize,m={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:mH(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||""};fH(r);const h=n.ownerDocument;if(!h)return;const p=jw(r),v=h.createComment(uH(m));fi(p)&&Xm.test(p.nodeValue||"")&&p.parentNode?p.parentNode.insertBefore(v,p):n.insertBefore(v,n.firstChild)}function Ac(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function Gn(e){return typeof e=="number"&&Number.isFinite(e)}function yH(e){return!e||typeof e!="object"?!1:Gn(e.all)||Gn(e.top)||Gn(e.right)||Gn(e.bottom)||Gn(e.left)}function vH(e,t){const n=Gn(t.all)?t.all:void 0,r=Gn(t.top)?t.top:n,o=Gn(t.right)?t.right:n,i=Gn(t.bottom)?t.bottom:n,s=Gn(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 Yw(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 Kw(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function Zw(e){return e.stylesheet??uk(e.source_url)}function EH(e){return`/* ${`em-project-font-${di(e.family)}-${e.weight}-${e.style}`} */
|
|
78
|
-
@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 SH=e=>xw({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function wH(e,t){if(Yw(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),Kw(n)}function js(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=Cc(r,o);if(n==="Project Fonts"){const d=Im(r),f=d[0];if(Hr("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!f,faces:d}),f){We();const m=document.querySelector('style[em="styles"]'),h=[...new Set(d.filter(Zw).map(p=>p.source_url))];if(h.forEach(p=>wH(p,i)),m){const p=new Set(Dm(m.textContent??"").map(xw)),v=d.filter(y=>!Zw(y)).filter(y=>!p.has(SH(y))).map(EH).join(`
|
|
79
|
-
`),w=v!=="";w&&m.insertAdjacentHTML("afterbegin",`${v}
|
|
80
|
-
`);const C=`.${Mw(i)} {`,T=!m.textContent?.includes(C);if(T){const y=Ec[o],g=(y||f.weight).replace(/i$/g,""),E=y?y.endsWith("i"):f.style!=="normal";let _=`font-family: ${JSON.stringify(f.family)}, ${Nw(f)}!important;`;_+=` font-weight: ${g}!important;`,E&&(_+=" font-style: italic!important;"),m.insertAdjacentHTML("beforeend",`
|
|
81
|
-
${C} ${_} }`)}Hr("iframe: project font attached",{emClass:i,stylesheetUrls:h,faceInserted:w,classInserted:T})}else Hr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{co({elem:document.documentElement},t),Wr(t),t&&t(!1)},0);return}Hr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{co({elem:document.documentElement},t),Wr(t)},0);return}if(!Yw(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const f=Ec[o]||"400",m=f.indexOf("i")>-1,h=f.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${m?"1":"0"},${h}&display=swap`),d.setAttribute("em-class",i),Kw(d)}We();const s=Ec[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${O7[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",`
|
|
82
|
-
.${Mw(i)} { ${c} }`),setTimeout(()=>{co({elem:document.documentElement},t),Wr(t)},0)}function CH(e){const t=di(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function Wr(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=Dm(n).filter(o=>Im(o.family).length>0&&!CH(o.family));!t||r.length===0||(t.textContent=Ow(n,r),Hr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function co(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 th(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],co({elem:document.documentElement},n),Wr(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"&&Sc(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(Cc(t[2],t[3])),js({fontFamilyArray:t},n))}function Qw(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 Jw(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 eC(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 Gs(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function tC(e,t){const n=Mm(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...De(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=Ac((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),th(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":Gs(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=Ac((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),th(i,s,t),eC(i,n.headings?.letterSpacing||0),Qw(i,n.headings?.bold||!1),Jw(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":Gs(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":Gs(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=Ac((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),th(i,s,t);const l=i.closest("td"),c=!!l&&!!$r(l)&&!$r(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"),eC(i,n.buttons?.letterSpacing||0),Qw(i,n.buttons?.bold||!1),Jw(i,n.buttons?.italic||!1);const f=i.closest('[em="atom"] > tr > td'),m=i.closest("table");f?.style.paddingTop?f.style.paddingTop=(n.buttons?.marginTop||0)+"px":m?.previousElementSibling&&Gs(m.previousElementSibling,n.buttons?.marginTop||0),f?.style.paddingBottom?f.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":m?.nextElementSibling&&Gs(m.nextElementSibling,n.buttons?.marginBottom||0);const h=n.buttons?.padding||{};h.all&&(i.style.padding=h.all+"px"),h.top&&(i.style.paddingTop=h.top+"px"),h.right&&(i.style.paddingRight=h.right+"px"),h.bottom&&(i.style.paddingBottom=h.bottom+"px"),h.left&&(i.style.paddingLeft=h.left+"px"),u&&(n.buttons?.border&&Um({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&qs({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&eh(i,{backgroundColor:d})}}else{const s=Ac(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=>{Fs(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?Ct(r):Ct(r.querySelector("tbody")||r)}function nh(e){const t=Mm(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...De(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{Fs(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return yH(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(Fs).forEach(o=>{vH(o,r)}),n.tagName==="DIV"?Ct(n):Ct(n.querySelector("tbody")||n)}var _H=e=>{for(const t of Object.keys(Ec))if(di(t)===e)return t;return e};function AH(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(Im(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=Dm(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=Ow(n,o),Hr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function TH(e){if(!P7())return;const t=document.head.innerHTML,n=new Set;for(const r of Lw()){AH(r.family);const o=`em-font-${di(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=_H(a);js({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&Hr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:Lw().map(r=>r.family)}),Wr(),e&&document.head.innerHTML!==t&&e(!1)}function kH(e,t){const n=new Ce,r=()=>{requestAnimationFrame(()=>{TH(t)})};return n.addDisposable(K.addListener(Le.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function nC(){K.send({operation:"sandbox_resized"})}function LH(e,t){const n=new Ce,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{nC(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(Hn(c))return vL(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 NH(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 xH=/^(?:ant|vscode|monaco|docs)-/;function OH(e){return xH.test(e)}function RH(){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 MH=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function PH(){return MH}var IH=new Set;function DH(e,t,n=IH){return e.startsWith(`${t}-`)?!1:!OH(e)&&!n.has(e)}function BH(e,t){return`--${t}-${e}`}function HH(e){const t=RH();return DH(e,t,PH())?BH(e,t):`--${e}`}function FH(e){const t=new Ce;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])=>` ${HH(a)}: ${String(l)};
|
|
83
|
-
`).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
|
|
84
|
-
${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 {
|
|
85
|
-
${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(K.addListener(Le.SANDBOX_SET_THEME_VARIABLES,r)),t}var rC=4e3;function $H(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:rC});return}window.setTimeout(e,rC)}function WH(e){const t=e.onDocumentShown(()=>{t.dispose(),$H(()=>{Jy().catch(()=>{})})})}var qH={name:"sandbox.crossDomainDrag",setup:()=>g7()},zH={name:"sandbox.themeVariables",awaits:{services:[te]},setup:e=>FH(D(e,te))},UH={name:"sandbox.projectFonts",awaits:{services:[St,Re]},setup(e){B7();const t=mt(e);kH(D(e,St),n=>t(n))}},VH={name:"sandbox.pasteSanitizerPrewarm",awaits:{services:[Co]},setup:e=>WH(D(e,Co))},jH={name:"sandbox.variableSelection",setup:()=>w7()},GH={name:"sandbox.emReplaceCaret",awaits:{services:[te]},setup:e=>x7(D(e,te))},XH={name:"sandbox.resizeWatch",awaits:{services:[te,St]},setup(e){LH(D(e,te),D(e,St)),NH()}},YH={name:"sandbox.reset",awaits:{services:[te]},setup:e=>vx(D(e,te))},KH={name:"sandbox.correct",awaits:{services:[te,ft,St]},setup:e=>h7(D(e,te),D(e,ft).controller,D(e,St))},ZH={name:"sandbox.extensionScripts",awaits:{services:[te,Hi]},setup:e=>e9(D(e,te),{surface:D(e,Hi)})},QH={name:"sandbox.localization",provides:[Iu],awaits:{services:[te]},setup:e=>e.inject(Iu,m7(D(e,te)))};function JH(e=[]){return{name:"sandbox.extensions",awaits:{services:[ft,Hi,te]},setup:t=>c7({container:t,focusController:D(t,ft).controller,surface:D(t,Hi),features:[...e]})}}function eF(e){const t=n=>function r(o,i=10){if(!tF(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 tF(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function oC(e){return/^(data|blob):/i.test(e.trimStart())}function iC(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function nF(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 rF(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${iC(o,t)}${i})`)}function rh(e,t,n){const r=e.toLowerCase();return r==="srcset"?nF(t,n):r==="style"?rF(t,n):iC(t,n)}var oF=["src","___src","background","poster","srcset","style"];function Tc(e){return oC(e)?e:Ql(e)}function iF(){const e=new Map,t=n=>{if(oC(n))return n;const r=Tc(n),o=e.get(r);return o?n9(r).replace(new RegExp(`${Ts}=\\d+`),`${Ts}=${o}`):n};return{transform:{name:"em-version",attributes:oF,render:(n,r)=>n&&rh(r.attribute,n,t),serialize:(n,r)=>n&&rh(r.attribute,n,Tc)},requestReload(n){e.set(Tc(n.trim()),String(Date.now()))},isPending(n){return e.has(Tc(n.trim()))},clear(){e.clear()}}}var sC=["src","background","poster","srcset","style"];function oh(e,t=document){const n=sC.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of sC){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=sm(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function sF(e,t){const{pipeline:n,htmlDocument:r}=t,o=iF(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>oh(n)))},clear(){o.clear()}};return e.inject(Pu,s),{reload:s,dispose(){i.dispose(),o.clear(),vn(e,Pu)}}}var aF=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],lF="/static/media/",cF="empty-image";function uF(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function aC(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(lF)?t:null}function dF(e){return!!e&&aC(e)!==null}function fF(e){if(!e)return!1;if(aF.includes(e))return!0;const t=aC(e);return t===null?!1:uF(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===cF}var mF=1e4;function hF(e=mF){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 pF=3e3,gF=["src","___src","background","poster","srcset","style"],ih=e=>e.startsWith("blob:"),kc="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 bF(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${kc}${t}`}var yF=new RegExp(String.raw`blob:[^\s"'()<>]+|`+kc.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function lC(e){if(e.startsWith(kc))try{return decodeURIComponent(e.slice(130))}catch{return}}function vF(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:wx(n)}function EF(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function SF(e){const t=e.store??hF(),n=e.answerTimeoutMs??pF,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=h=>{const p=EF(h);return p?p===window.location.hostname||i.sourceHosts.includes(p):!1},u=(h,p=!1)=>{if(r.has(h)||!p&&(o.has(h)||t.peek(h)))return;const v=K.sendAsync(Le.APPLICATION_CANVAS_IMAGE_GET,p?{url:h,fresh:p}:{url:h}).then(C=>{const T=C;if(T&&"blob"in T){t.acquire(h,T.blob),l.hits+=1;return}o.add(h),l.refused+=1}).catch(()=>{o.add(h),l.failed+=1}),w=Promise.race([v,new Promise(C=>{setTimeout(()=>{r.has(h)&&(s=!0,o.add(h),l.failed+=1),C()},n)})]).then(()=>{r.delete(h),e.refresh()});r.set(h,w)},d=h=>{const p=lC(h);if(p!==void 0)return d(p);if(!h||a||ih(h)||h.startsWith("data:")||dF(h))return h;const v=t.peek(h);return v||(s||!i.enabled||o.has(h)||!c(h)?h:(l.misses+=1,u(h),bF(h)))},f=h=>ih(h)?t.sourceOf(h)??h:lC(h)??h,m=(h,p,v)=>rh(p.attribute,h,v);return{configure(h){i={enabled:h.enabled,sourceHosts:[...h.sourceHosts??[]]}},transform:{name:"image-cache",attributes:gF,render:(h,p)=>h&&vF(p)?m(h,p,d):h,serialize:(h,p)=>h&&m(h,p,f)},forget(h){t.forget(h),o.delete(h),!a&&u(h,!0)},fail(h){const p=t.sourceOf(h);return p===void 0||t.peek(p)!==h?!1:(o.add(p),t.forget(p),l.failed+=1,!0)},block(){a=!0},restoreUrls(h){return sh(h,f)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function wF(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||"";ih(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 CF(e,t){return!e.includes("blob:")&&!e.includes(kc)?e:e.replace(yF,n=>t(n))}function sh(e,t){if(typeof e=="string")return CF(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=sh(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=sh(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function _F(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>oh(n)),i=SF({refresh:o}),s=wF(document,i,o),a=n.register(i.transform),l=K.addListener(Le.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>oh(n))}),c=K.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(Ma,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),vn(e,Ma)}}}function AF(e,t){const n=new G2,r=new Ja,o=new X2(n,r),i=new b2(r,n,{prepareHtml:t.prepareHtml,serviceMarkup:M9,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}});i.addDisposable(new Q2(i,o,n));const s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0,l=hT((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 TF(e,t){const n=e.getInstance(Ra),r=AF(t,{prepareHtml:D(e,Pa),lock:n&&{increment:()=>n.increment("activeElementLocked"),decrement:()=>n.decrement("activeElementLocked")}}),o={commit:s=>r.commit(s),commitLockedAsync:s=>r.commitLockedAsync(s)},i=ER();return e.inject(Bi,t),e.inject(St,r.remoteDocument),e.inject(Di,r.textDocument),e.inject(bn,r.documentMapping),e.inject(te,r.htmlDocument),e.inject(Re,o),{...r,dispose(){i.dispose(),r.dispose(),vn(e,Bi),vn(e,St),vn(e,Di),vn(e,bn),vn(e,te),vn(e,Re)}}}function kF(e){e.inject(Ra,O)}var LF=class extends Ce{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),k(this,"_isEditorInFocus",!1),k(this,"_context",new Map),k(this,"_editorLostFocusEmitter",this.addDisposable(new ye)),k(this,"_summaries",[]),k(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),k(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 NF(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new LF(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(),vn(e,ft)}};return e.inject(ft,l),l}var xF={name:"sandbox.state",provides:[Ra],setup:kF},OF={name:"sandbox.attributePipeline",provides:[wo],setup:E9},RF={name:"sandbox.documentSync",provides:[te,St,Di,bn,Re,Co],awaits:{services:[Bi,Pa,Ra]},setup:e=>e.inject(Co,TF(e,D(e,Bi)))},MF={name:"sandbox.images",provides:[Ma,Pu],awaits:{services:[wo,te,Co]},setup(e){const t=D(e,wo),n=D(e,te);_F(e,{pipeline:t,htmlDocument:n});const r=sF(e,{pipeline:t,htmlDocument:n}).reload;D(e,Co).onDocumentReplaced(()=>r.clear()),K.addListener(Le.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(Ma)?.forget(o),r.reload(o))})}},PF={name:"sandbox.mapObj",provides:[_o],awaits:{services:[bn]},setup:e=>e.inject(_o,eF(D(e,bn)))},IF={name:"sandbox.focus",provides:[ft],awaits:{services:[te,St]},setup:e=>NF(e,{htmlDocument:D(e,te),remoteDocument:D(e,St)})},DF=[xF,OF,RF,MF,eO,tO,nO,PF,IF,qH,zH,UH,jH,GH,XH,YH,KH,ZH,QH,VH,s7,a7,l7,...xO],ah=null,lh=0,BF=6e5;function HF(e){ah=e,lh=e?Date.now():0}function FF(){const e=ah,t=lh;return ah=null,lh=0,!e||!t||Date.now()-t>BF||!e.isConnected||!e.matches('[em="block"]')?null:e}function $F(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",`
|
|
86
|
-
`);const i=De(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",`
|
|
87
|
-
`),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),s1(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=on(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 WF(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=$F(o,n);if(!i)return;HF(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:nc({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function Lc(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 Nc(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 Je=()=>El(window.getSelection()?.toString())??"",qF=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],zF={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},UF=/^#[\da-f]{6}$/i,cC=()=>[...new Set(qF.flatMap(VF).map(j).filter(e=>UF.test(e)).map(e=>e.toUpperCase()))];function VF({type:e,name:t}){const n=zF[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}var jF=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"],ch=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;"> </div>`;function GF(e){return!!e.closest("editor.em-text")}function uC(e){e.querySelectorAll(jF.join(",")).forEach(t=>{GF(t)||t.remove()})}function XF(e){const t=e.cloneNode(!0);nn(e,t),Ho(t);const n=t.querySelector("editor.em-text");if(n){uC(t);const o=n.querySelector("div");if(o)return rn(o);const i=n.getAttribute("innerclass")??"",s=n.getAttribute("innerstyle")??"";return`<div${i?` class="${Xn(i)}"`:""}${s?` style="${Xn(s)}"`:""}>${ze(n)}</div>`}uC(t);const r=t.querySelector("div");return r?rn(r):ze(t)}function Xn(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function kn(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function Xs(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=kn(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 YF(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=kn(d[0]),m=kn(d[1]??d[0]),h=kn(d[2]??d[0]),p=kn(d[3]??d[1]??d[0]);f!==void 0&&(s.top=f),m!==void 0&&(s.right=m),h!==void 0&&(s.bottom=h),p!==void 0&&(s.left=p)}const a=kn(n??""),l=kn(r??""),c=kn(o??""),u=kn(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 dC(e){if(e)return e.trim()}function KF(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].includes(t)?t:void 0}function ZF(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 QF(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 JF(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 e$(e){const t=QF(e.getAttribute("style")),n=t.get("font-family")??void 0,r=kn(t.get("font-size")??""),o=kn(t.get("line-height")??""),i=dC(t.get("color")??void 0),s=dC(t.get("background-color")??void 0),a=KF(t.get("text-align")??void 0),l=ZF(t.get("vertical-align")??void 0),c={top:Xs(t.get("border-top")),right:Xs(t.get("border-right")),bottom:Xs(t.get("border-bottom")),left:Xs(t.get("border-left"))},u=Xs(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=YF(t),f=JF(t.get("border-radius")??void 0),m={};return n&&(m.fontFamily=n),r!==void 0&&(m.fontSize=r),o!==void 0&&(m.lineHeight=o),i&&(m.color=i),s&&(m.backgroundColor=s),a&&(m.textAlign=a),l&&(m.verticalAlign=l),d&&(m.padding=d),f&&(m.borderRadius=f),(c.top||c.right||c.bottom||c.left)&&(m.borders=c),Object.keys(m).length?m:void 0}function t$(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function n$(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}function uh(e){if(e==null)return;const t=Number(e);return Number.isFinite(t)?t:void 0}function Ys(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:uh(e.getAttribute("cellpadding")),cellspacing:uh(e.getAttribute("cellspacing")),border:uh(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 m=Math.max(1,f.colSpan||1),h=Math.max(1,f.rowSpan||1),p=Math.min(h,a.length-l),v=`cell-${o.length}`,w=Array.from(f.classList),C=XF(f),T=t$(f),y=n$(f),g=e$(f),E={id:v,row:l,col:u,rowspan:p,colspan:m,contentHtml:C,classList:w,align:T,valign:y,style:g};o.push(E);for(let _=0;_<p;_++){const b=l+_;i[b]||(i[b]=Array(s).fill(null));for(let S=0;S<m;S++){const A=u+S;A>=s||i[b][A]!==null&&i[b][A]!==void 0||(i[b][A]=v)}}u+=m}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 fC(e,t,n){const r=JSON.parse(JSON.stringify(e));let o=-1;const i=typeof t=="string"?t.trim():"";if(i){for(const m of r.cells)if(Array.isArray(m.classList)&&m.classList.includes(i)){o=m.row;break}}o===-1&&(r.rows===0?(o=0,n=!0):(o=r.rows-1,n=!1));const s=r.cells.filter(m=>m.row===o).sort((m,h)=>m.col-h.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:ch,classList:[""],align:"center",valign:"top",style:{}}),r.cols=1;else for(let m=0;m<r.cols;m++)s.push({id:`template-${m}`,row:o,col:m,rowspan:1,colspan:1,contentHtml:ch,classList:[""],align:"center",valign:"top",style:{}});let l=1;for(const m of s)m.rowspan>l&&(l=m.rowspan);let c=n?o:o+l;const u=new Array(r.cols).fill(!1);for(const m of r.cells)if(m.row<c&&m.row+m.rowspan>c)for(let h=m.col;h<m.col+m.colspan;h++)u[h]=!0;for(const m of r.cells)m.row>=c&&(m.row+=1);const d=[];let f=r.cells.length;for(let m=0;m<r.cols;m++){if(u[m])continue;const h=s.find(v=>v.col<=m&&m<v.col+v.colspan)||s[0]||{contentHtml:ch,classList:[""],align:"center",valign:"top",style:{}},p=JSON.parse(JSON.stringify(h));p.id=`cell-${f++}`,p.contentHtml=xc(h.contentHtml," "),p.classList=p.classList.filter(v=>v!==i),p.row=c,p.col=m,p.rowspan=1,p.colspan=1,d.push(p)}r.cells.push(...d),r.rows+=1,r.grid.splice(c,0,new Array(r.cols).fill(null));for(let m=0;m<r.rows;m++)for(let h=0;h<r.cols;h++){const p=r.cells.find(v=>v.row<=m&&v.row+v.rowspan>m&&v.col<=h&&v.col+v.colspan>h);r.grid[m][h]=p?p.id:null}for(let m=0;m<r.cols;m++)r.grid[c][m]===null&&u[m];return r}function r$(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 Yt(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="${Xn(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="${Xn(e.meta.classList.join(" "))}"`),e.meta.attrs))for(const[o,i]of Object.entries(e.meta.attrs))t.push(`${Xn(o)}="${Xn(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="${Xn(l.align)}"`),l.valign&&c.push(`valign="${Xn(l.valign)}"`),l.classList?.length&&c.push(`class="${Xn(l.classList.join(" "))}"`);const u=r$(l.style);u&&c.push(`style="${Xn(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 o$(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 xc(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 mC(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=xc(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 i$(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 hC(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 C of o.cells)if(Array.isArray(C.classList)&&C.classList.includes(s)){i=C;break}}if(!i)return o;const a=i.row,l=i.col,c=i.colspan,u=i.rowspan,d=[];if(n)for(let C=1;C<=r;C++)d.push(l-C);else for(let C=0;C<r;C++)d.push(l+c+C);for(const C of d)if(C<0||C>=o.cols)return o;const f=[];for(const C of d){const T=o.cells.find(y=>y.row===a&&y.col<=C&&C<y.col+y.colspan);if(!T)return o;f.push(T)}const m=Array.from(new Set(f));for(const C of m)if(C.rowspan!==u)return o;const h=c+m.reduce((C,T)=>C+T.colspan,0);let p=(n?[...m.reverse(),i]:[i,...m]).map(C=>{const T=new DOMParser().parseFromString(C.contentHtml,"text/html");xi(T,C.contentHtml);const y=T.body.firstChild,g=y?ze(y):"";return g===""||/^\s*( )*\s*$/.test(g)?"":g}).filter(C=>C!=="").join("<br>");(p===""||/^\s*( |<br>)*\s*$/.test(p))&&(p=" ");const v=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;v?(ke(v,p),i.contentHtml=rn(v)):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${p}</div>`,i.colspan=h,n&&d.length>0&&(i.col=Math.min(...d)),o.cells=o.cells.filter(C=>!m.includes(C));const w=n&&d.length>0?Math.min(...d):l;for(let C=w;C<w+h;C++)o.grid[a][C]=i.id;return o}function pC(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 C of o.cells)if(Array.isArray(C.classList)&&C.classList.includes(s)){i=C;break}}if(!i)return o;const a=i.row,l=i.col,c=i.rowspan,u=i.colspan,d=[];if(n)for(let C=1;C<=r;C++)d.push(a-C);else for(let C=0;C<r;C++)d.push(a+c+C);for(const C of d)if(C<0||C>=o.rows)return o;const f=[];for(const C of d){const T=o.cells.find(y=>y.col===l&&y.row<=C&&C<y.row+y.rowspan);if(!T)return o;f.push(T)}const m=Array.from(new Set(f));for(const C of m)if(C.colspan!==u)return o;const h=c+m.reduce((C,T)=>C+T.rowspan,0);let p=(n?[...m.reverse(),i]:[i,...m]).map(C=>{const T=new DOMParser().parseFromString(C.contentHtml,"text/html");xi(T,C.contentHtml);const y=T.body.firstChild,g=y?ze(y):"";return g===""||/^\s*( )*\s*$/.test(g)?"":g}).filter(C=>C!=="").join("<br>");p=p.replace(/ $/g,""),(p===""||/^\s*( |<br>)*\s*$/.test(p))&&(p=" ");const v=new DOMParser().parseFromString(i.contentHtml,"text/html").body.firstChild;v?(ke(v,p),i.contentHtml=rn(v)):i.contentHtml=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">${p}</div>`,i.rowspan=h,n&&d.length>0&&(i.row=Math.min(...d)),o.cells=o.cells.filter(C=>!m.includes(C));const w=n&&d.length>0?Math.min(...d):a;for(let C=w;C<w+h&&C<o.rows;C++)o.grid[C][l]=i.id;return o}function s$(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:xc(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 a$(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:xc(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 dh(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 gC(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 bC(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 yC(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 m=f.row,h=f.row+(f.rowspan||1)-1;return m<=u&&u<=h&&!l.has(f.id)}).sort((f,m)=>f.col-m.col).forEach(f=>{const m=f.id,h=f.colspan||1,p=f.col;for(let v=0;v<h&&p+v<r.cols;v++)d[p+v]=m}),d}),r}function vC(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(m=>{const h=m.row,p=m.row+(m.rowspan||1)-1;return h<=d&&d<=p&&!c.has(m.id)}).sort((m,h)=>m.col-h.col).forEach(m=>{const h=m.col,p=m.colspan||1;for(let v=0;v<p&&h+v<r.cols;v++)f[h+v]=m.id}),f}),r}function Oc(e,t,n,r,o,i=!0){const{cells:s,grid:a}=e;function l(m,h){if(!a[m]||!a[m][h])return null;const p=a[m][h];return s.find(v=>v.id===p)}function c(m,h){const p=l(m,h);return p?{row:p.row,col:p.col,cell:p}:null}const u=c(t,n),d=c(r,o);if(!u||!d||u.cell.id===d.cell.id)return 0;function f(m,h,p,v){let w=0;const C=m<h?1:-1,T=new Set;for(let g=m;g!==h;g+=C){const E=l(v?p:g,v?g:p);E&&!T.has(E.id)&&(T.add(E.id),w++)}const y=l(v?p:h,v?h:p);return y&&!T.has(y.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 l$(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 c$(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(m=>m.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 u$(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 d$(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function f$(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 m$(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 h$(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 p$(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 m=0;m<d.colspan;m++){const h=d.row+f,p=d.col+m,v=`${h}-${p}`;r.has(v)||(r.add(v),o.push({row:h,col:p,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 m=a?(h,p)=>h.col-p.col:(h,p)=>h.row-p.row;u.sort(m)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],f=d.id,m=n.get(f);let h=f;if(m.rowspan>1||m.colspan>1){const v=l.get(f).findIndex(w=>w.row===d.row&&w.col===d.col);v>0&&(h=`${f}-uni-${v+1}`)}const p=[];a?(p.push("top","bottom"),(u===0||o[u-1].col!==d.col-1)&&p.push("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&p.push("right")):(p.push("left","right"),(u===0||o[u-1].row!==d.row-1)&&p.push("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&p.push("bottom")),c[h]=p}return c}function g$(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 b$(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 m=0;m<d.colspan;m++){const h=d.row+f,p=d.col+m,v=`${h}-${p}`;r.has(v)||(r.add(v),o.push({row:h,col:p,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 m=a?(h,p)=>h.col-p.col:(h,p)=>h.row-p.row;u.sort(m)}});const c={};for(let u=0;u<o.length;u++){const d=o[u],f=d.id,m=n.get(f);let h=f;if(m.rowspan>1||m.colspan>1){const w=l.get(f).findIndex(C=>C.row===d.row&&C.col===d.col);w>0&&(h=`${f}-uni-${w+1}`)}const p=new Set;a?(p.add("top"),p.add("bottom"),(u===0||o[u-1].col!==d.col-1)&&p.add("left"),(u===o.length-1||o[u+1].col!==d.col+1)&&p.add("right")):(p.add("left"),p.add("right"),(u===0||o[u-1].row!==d.row-1)&&p.add("top"),(u===o.length-1||o[u+1].row!==d.row+1)&&p.add("bottom"));const v=[];p.has("top")&&p.has("left")&&v.push("topLeft"),p.has("top")&&p.has("right")&&v.push("topRight"),p.has("bottom")&&p.has("left")&&v.push("bottomLeft"),p.has("bottom")&&p.has("right")&&v.push("bottomRight"),v.length>0&&(c[h]=v)}return c}function y$(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 v$(e,t){const n=new RegExp(`\\b${t}\\s*:[^;]*(;\\s*)?`,"gi");return e.replace(n,"").trim().replace(/\s*;\s*(?=;|$)/g,"").trim()}function E$(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 S$(e,t,n){const r=/border-radius:\s*([^;]+)/,o=e.match(r);if(!o)return e+` border-radius: ${EC("0 0 0 0",t,n)};`;const i=EC(o[1].trim(),t,n);return e.replace(r,`border-radius: ${i}`)}function EC(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 w$(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 C$(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 _$(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 A$(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 Rc="none",SC="b64_",T$=/^(\d+(?:_\d+)?)(px|perc)$/;function k$(e){if(e===Rc)return Rc;let t="";return new TextEncoder().encode(Ql(e)).forEach(n=>{t+=String.fromCharCode(n)}),SC+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function L$(e){if(e===Rc)return Rc;if(!e.startsWith(SC))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 N$(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function wC(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function CC(e){const t=e.match(T$);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function x$(){return Hm()}function Be(e,t){const n=x$();n&&n.insertAdjacentHTML("beforeend",`
|
|
88
|
-
${q7()}
|
|
89
|
-
.${e} { ${t} }
|
|
90
|
-
}
|
|
91
|
-
`)}function Ee(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function _C(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,Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim)Be(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";Be(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else Ee(e.elem,t.classNamePrefix)}function O$(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,Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim?Be(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):Be(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else Ee(e.elem,t.classNamePrefix)}function mi(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,Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim?Be(n,`height: ${t.value}${t.dim} !important;`):Be(n,`height: ${t.value} !important;`)}else Ee(e.elem,t.classNamePrefix)}function R$(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),We();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; `:""),Be(a,l)}})}function M$(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),We(),Be(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)))&&Ee(e.elem,"em-mob-border_radius_all-")}else e.elem.classList.forEach(s=>{s.indexOf(r)>-1&&e.elem.classList.remove(s)})}function P$(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":"");Ee(e.elem,n),e.elem.classList.add(c),We(),Be(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,"-");Ee(e.elem,t.classNamePrefix||"em-mob-boxshadow_"),e.elem.classList.add(r),We(),Be(r,`box-shadow: ${t.value} !important;`)}else Ee(e.elem,n)}function AC(e){const t=e.fieldName??"mobileAlign",n=e.settings[t];if(n.value){const r=n.classNamePrefix+n.value;Ee(e.elem,n.classNamePrefix),e.elem.classList.add(r),We(),Be(r,`text-align: ${n.value} !important;`)}else Ee(e.elem,n.classNamePrefix)}function I$(e){const t=e.settings.mobileAlign;if(t.value){const n=t.classNamePrefix+t.value;Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We();let r="";t.value==="left"||t.value==="right"?r=`float: ${t.value}`:r="margin: 0 auto",Be(n,`${r} !important;`)}else Ee(e.elem,t.classNamePrefix)}function TC(e){const t=e.settings.mobileVerticalAlign;if(t.value){const n=t.classNamePrefix+t.value;Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`vertical-align: ${t.value} !important;`)}else Ee(e.elem,t.classNamePrefix)}function D$(e){const t=e.settings.mobileDirection;if(t.value){const n=t.classNamePrefix+t.value;Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`direction: ${t.value} !important;`)}else Ee(e.elem,t.classNamePrefix)}function B$(e){const t=e.settings.mobileBackgroundColor;if(t.value){const n=t.value!=="none"?String(t.value).substring(1):"none",r=t.classNamePrefix+n;Ee(e.elem,t.classNamePrefix),e.elem.classList.add(r),We(),Be(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else Ee(e.elem,t.classNamePrefix)}function H$(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+k$(n);Ee(e.elem,t.classNamePrefix),e.elem.classList.add(r),We(),Be(r,`background-image: ${n!=="none"?N$(Ql(n)):"none"} !important;`)}else Ee(e.elem,t.classNamePrefix)}function F$(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+wC(String(t.value));Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`background-position-x: ${t.value} !important;`)}else Ee(e.elem,t.classNamePrefix)}function $$(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+wC(String(t.value));Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`background-position-y: ${t.value} !important;`)}else Ee(e.elem,t.classNamePrefix)}function W$(e){const t=e.settings.mobileBackgroundRepeat;if(t.value&&t.value!=="none"){const n=t.classNamePrefix+t.value;Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`background-repeat: ${t.value} !important;`)}else Ee(e.elem,t.classNamePrefix)}function q$(e){const t=e.settings.mobileBackgroundSize;if(t.value){const n=t.classNamePrefix+t.value;Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`background-size: ${t.value} !important;`)}else Ee(e.elem,t.classNamePrefix)}function Ks(e){const t=e.settings.mobilePadding;We(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){Rw({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),Be(o,`padding-${n}: ${r}px !important;`)}else r===null&&Rw({elem:e.elem,position:n})})}function kC(e){const t=e.settings.mobileFontSize;if(t.value!=null){const n=t.classNamePrefix+t.value+"px";Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`font-size: ${t.value}px !important;`)}else Ee(e.elem,t.classNamePrefix)}function LC(e){const t=e.settings.mobileLineHeight;if(t&&t.value!==null){const n=t.classNamePrefix+t.value+"px";Ee(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),Be(n,`line-height: ${t.value}px !important;`)}else t&&Ee(e.elem,t.classNamePrefix)}function NC(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),We(),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"),Be(r,`display: ${o} !important;`)}t==="desktop"&&(n(),Be(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function z$(e){const t=e.settings.isContrastBlock,n=Mm();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 U$(){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 qe(e,t=!1){const n=U$();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=L$(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=CC(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=CC(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 V$(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=qe({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:$s(e),backgroundColor:e.style.backgroundColor?j(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:_c(e),boxShadow:Ws(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:Us(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 j$(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=qe({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 G$='table[em-type="social"]';function X$(e){return e.closest(G$)}function Y$(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 Mc(e){const t=X$(e);if(t&&e!==t&&Y$(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")&&K$(o)?n:Mc(n)}function K$(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 Zs(){return xt.getInstance(Iu)?.localized??{}}var xC=[];function Z$(){return xC}function OC(e){const t=Zs();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=_x(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 Q$=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function J$(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function eW(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(Q$.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||J$(r))}var RC='.em-narrow-table, [em="block-contaner"]';function tW(e){const t=e.style;return eW(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(RC)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(RC)&&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"))||sy(e))}function nW(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||sy(e))&&t.push(OC(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,tW(r)&&t.push(OC(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),xC=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function MC(e){const t=Zs(),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 MC(n)}function rW(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 oW(e){return e.tagName==="AMP-ACCORDION"}var PC="em-mob-text_align-",iW=":scope > tr > td, :scope > tbody > tr > td",sW='div[style*="font-family"][style*="font-size"]';function fh(e){return e.querySelector(iW)}function mh(e){return e.querySelector(sW)}function aW(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function IC(e){const t=e.closest('table[em="atom"]');if(!t||aW(e,t))return null;const n=fh(t);return n?{atomTd:n,textDiv:mh(n)}:null}function Qs(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=IC(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function DC(e){const t=Qs(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function lW(e){const t=Qs(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function hh(e){return{value:lW(e)}}function cW(e,t,n=PC){const r=IC(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&wc(o,n)}function uW(e){const t=fh(e);if(!t)return null;const n=mh(t);return n?.hasAttribute("align")?n:t}function dW(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=uW(n);r&&t(r,n)})}function fW(e,t,n=PC){const r=fh(e),o=r?mh(r):null;for(const i of[r,o])i&&i!==t&&wc(i,n)}function Pc(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 Js(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(Wm),i=r.filter(s=>s!==Wm);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 et(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 Ic(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function qr(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 mW(){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 ea(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 BC(){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 ph(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&&ph(t))return!0;return!1}function HC(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 FC(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function hW(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 pW(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 gW(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 bW(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=Zm(n),i=ph(r)&&!ph(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=qe({elem:e.elem}),f=qe({elem:r}),m=l?qe({elem:l}):null,h=qe({elem:a}),p=e.elem.closest("a"),v={type:"button",caption:t.BUTTON,fontFamily:Js(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Pc(e.elem),lineHeightDim:"px",textStrong:et(e.elem,"strong","b")||Ic(e.elem),textItalic:et(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(p?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:et(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:et(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:j(qr(e.elem,"color"))||j(getComputedStyle(e.elem).color)||"",textBackgroundColor:j(qr(e.elem,"background-color"))||"",padding:hW(o??n),borderRadius:$s(s),backgroundColor:s.style.backgroundColor?j(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:gW(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:HC(a,"width"),height:HC(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:_c(s),boxShadow:Ws(s),href:n.getAttribute("href")??"",outlookRounding:i,outlookBackground:Us(r,"inside"),mobileWidth:{value:FC(h.mobileWidth),dim:h.mobileWidthDim??"px"},mobileHeight:{value:FC(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorder:f.mobileBorder,mobileBorderRadius:f.mobileBorderRadius,mobileBoxShadow:f.mobileBoxShadow,mobileAlign:h.mobileAlign,mobileFontSize:{value:d.mobileFontSize,dim:d.mobileFontSizeDim||"px"},mobileTextAlign:hh(e.elem),mobileVerticalAlign:m?.mobileVerticalAlign,mobileBackgroundColor:f.mobileBackgroundColor,mobileBackgroundImage:f.mobileBackgroundImage,mobileBackgroundPositionX:f.mobileBackgroundPositionX,mobileBackgroundPositionY:f.mobileBackgroundPositionY,mobileBackgroundRepeat:f.mobileBackgroundRepeat,mobileBackgroundSize:f.mobileBackgroundSize,mobilePadding:pW(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:h.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return ea(e.elem)&&(v.showOnMobile=!0),v}function yW(e){if(Qm(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 vW(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function EW(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(Qm(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 $C(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function WC(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function qC(e){return{src:e.getAttribute("src")??"",width:$C(e,"width"),height:$C(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 SW(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=wW(o),s=Array.from(o).map((u,d)=>{const f=qe({elem:u}),m=qC(u);return{src:m.src,width:m.width,height:m.height,alt:m.alt,title:m.title,link:m.link,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:m.imgReplacer,mobileWidth:{value:WC(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:WC(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorderRadius:f.mobileBorderRadius,slideIndex:d}}),a=qe({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:$s(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 wW(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 CW(e){return!!e.closest("amp-carousel")}function ta(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=e?.includes(`${r}:`);if(n==="All")return{color:t.getAttribute("bordercolor")?j(t.getAttribute("bordercolor")):t.style?.border?j(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?j(t.style[i]):"",width:o?t.style[s]:"",style:o?t.style[a]:""}}function na(e,t,n){const r=n==="All"?"border":`border-${n.toLowerCase()}`,o=!!e?.includes(`${r}:`);if(n==="All")return{color:o?j(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?j(t.style[i]):"",width:o?t.style[s]:0,style:o?t.style[a]:""}}function _W(e){return!!e.closest(".em-element-custom-table")}function AW(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 p=l.cells.find(v=>v.id===n.activeCell[0]);l.cells.find(v=>v.id===n.activeCell[n.activeCell.length-1])?.style,p?.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=Ws(i),m=qe({elem:i}),h={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none",show:m.show,outlookBackground:Us(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")?j(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:ta(s,i,"All"),borderBottom:ta(s,i,"Bottom"),borderTop:ta(s,i,"Top"),borderRight:ta(s,i,"Right"),borderLeft:ta(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:m.mobileBoxShadow,mobileBackgroundColor:m.mobileBackgroundColor,mobileBackgroundImage:m.mobileBackgroundImage,mobileBackgroundPositionX:m.mobileBackgroundPositionX,mobileBackgroundPositionY:m.mobileBackgroundPositionY,mobileBackgroundRepeat:m.mobileBackgroundRepeat,mobileBackgroundSize:m.mobileBackgroundSize,mobileWidth:{value:m.mobileWidth!=null?m.mobileWidth:null,dim:m.mobileWidthDim},mobileHeight:{value:m.mobileHeight!=null?m.mobileHeight:null,dim:"px"},mobileBorderRadius:m.mobileBorderRadius,mobileBorder:m.mobileBorder,borderPosition:Pw(i),cell_borderPosition:Pw(o),cellBackgroundColor:a?.includes("background-color:")?j(o.style.backgroundColor):"",cell_borderAll:na(a,o,"All"),cell_borderBottom:na(a,o,"Bottom"),cell_borderTop:na(a,o,"Top"),cell_borderRight:na(a,o,"Right"),cell_borderLeft:na(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:j(r.closest('[style*="color"]')?.style.color)||j(getComputedStyle(r).color),textBackgroundColor:j(r.closest('[style*="background-color"]')?.style.backgroundColor)||j(getComputedStyle(r).backgroundColor),textValign:r.style?.verticalAlign||r.getAttribute("valign")||r.closest("[valign]")?.getAttribute("valign")||""}};return r.getAttribute("new")&&(r.removeAttribute("new"),h.customTable.isNewLink=!0,r.setAttribute("em-edit","active")),{type:"customTable",caption:t.ELEMENT,settings:h}}function Dc(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function TW(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:Dc(r.style.width),maxWidth:Dc(r.style.maxWidth),minWidth:Dc(r.style.minWidth),height:Dc(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function zC(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 kW(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function UC(e,t,n){return e?{fontFamily:Js(e.closest('[style*="font-family"]')||e),textStrong:et(e,"strong","b")||Ic(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:j(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:j(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:LW(e),textUnderline:NW(e)}:{}}function LW(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 NW(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 xW(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=qe({elem:e.elem}),s=e.elem.querySelector("td"),a=n.getElementTdDiv(s),l=r?UC(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:zC(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function OW(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=qe({elem:r}),l=r?.querySelector("td"),c=n.getElementTdDiv(l),u=i?UC(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:zC(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function VC(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function RW(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function jC(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function MW(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 PW(e,t){const n=e.elem,r=qe({elem:n}),o=n.firstElementChild,i=o?qe({elem:o}):null,s=VC(r.mobileWidth),a=i?VC(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:RW(o?.getAttribute("width")),gap:{value:MW(n),dim:"px"},maxWidth:jC(n.style.maxWidth),minWidth:jC(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 IW(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 GC(e){return e.getAttribute("src")}function DW(e,t){const n=wd(e.elem),r=GC(n),o=qe({elem:n}),i=n.closest("td"),s=i?qe({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:XC(n,"width"),height:XC(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:_c(n),borderRadius:$s(n),boxShadow:Ws(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 ea(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function XC(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function BW(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function ra(e){const t=String(e??"").trim();return t?j(t)??t:""}var gh={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function HW(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 FW(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 bh(e){return e.closest('table[em-type="social"]')}function $W(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function YC(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 hi(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 Yn(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function yh(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function WW(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 qW(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&&Yn(r,"em-platform")&&Yn(i,"em-platform")&&o instanceof HTMLElement&&!Yn(o,"em-platform")){const s=WW(o);if(s!=null){t.gap=s;return}}}}function KC(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 zW(e,t){const n=YC(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function UW(e,t){for(const n of e){if(!(n instanceof HTMLElement)||!Yn(n,"em-platform"))continue;const r=KC(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=KC(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function VW(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 jW(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=hi(r),s=hi(o instanceof HTMLElement?o:null),a=hi(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=hi(t),c=hi(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function GW(e){const t=YC(e);if(!(t instanceof HTMLElement))return"";const n=hi(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function vh(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 XW(e,t){const n=vh(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function YW(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!bh(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!Yn(n,"em-platform")&&r instanceof HTMLElement&&o instanceof HTMLElement&&Yn(r,"em-platform")&&Yn(o,"em-platform")&&bh(n))}function KW(e,t){const n=bh(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...gh,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...gh};zW(n,r),XW(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");jW(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(h=>h instanceof HTMLElement&&Yn(h,"em-platform")),l=a.length>0?a:s.filter(h=>h.querySelector("img"));qW(s,r),UW(l,r),VW(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?vh(u):null;if(d)c=d.w;else for(const h of l){if(!(h instanceof HTMLElement))continue;const p=vh(h);if(p){c=p.w;break}}let f=l.map(h=>{if(!(h instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const p=h,v=yh(p,"em-platform")||"unknown",w=Yn(p,"em-custom-icon"),C=p.querySelector("a"),T=p.querySelector("img"),y=C?.getAttribute("href")??"",g=C?.getAttribute("title")??T?.getAttribute("title")??"",E=T?.getAttribute("alt")??"",_=T?.getAttribute("src")??"",b=HW(T instanceof HTMLImageElement?T:null),S=T?.getAttribute("height")?.trim(),A=S?parseInt(S,10):NaN,L=!Number.isNaN(A)&&A>0,x=yh(p,"em-button-bg")?.trim()??"",N=!w&&Yn(p,"em-tray-cell-bg");let $="",R="";if(!w&&($=x,!$&&!N&&p.style?.backgroundColor&&($=p.style.backgroundColor.trim()),R=yh(p,"em-item-border-color")?.trim()??"",!R)){const I=p.style.border?.trim()??"",Q=/^(\d+)px\s+solid\s+(.+)$/i.exec(I);Q?.[2]&&(R=Q[2].trim())}return{platform:v,customIcon:w,href:y,alt:E,title:g,iconSrc:_,iconWidth:b,iconHeight:L?A:b,buttonBgColor:$,itemBorderColor:R}});if(d&&f.length>0&&f.every(h=>h.customIcon||!String(h.itemBorderColor??"").trim())){const h=d.color;f=f.map(p=>p.customIcon?p:{...p,itemBorderColor:h})}const m=FW(f,gh.iconSize);return{type:"social",caption:t.SOCIAL??"Social media",align:r.align,iconSize:m,borderRadius:r.borderRadius,gap:r.gap,bgEnabled:r.bgEnabled,bgColor:ra(r.bgColor),borderWidth:r.borderWidth,borderColor:ra(r.borderColor),buttonBorderColor:"",buttonBorderWidth:c,showLabel:r.showLabel,hostCellBgForIconLuminance:ra(GW(n)),blockIndex:$W(n),items:f.map(h=>({...h,buttonBgColor:ra(h.buttonBgColor),itemBorderColor:ra(h.itemBorderColor)}))}}function ZC(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(QC)}function ZW(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function QC(e){return e.nodeType===Node.COMMENT_NODE}function Ln(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!QC(r));if(t.length===0)return!0;const n=t.filter(r=>!ZW(r));return n.length===1&&n[0]instanceof Element&&ZC(n[0])}function JC(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(Ln(t))return t;return null}function e0(){const e=Ld(document,'[em="group"]');return Ld(e||document,'[em="block"]')}function br(e){const t=e.children.length===1?e.children[0]:null;return t&&ZC(t)?t:e}function QW(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function t0(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function JW(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function eq(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 tq(e,t){const n=e.elem;if(Ln(n))return{type:"emptyTable",caption:t.TABLE};n.setAttribute("em-edit","active");const r=qe({elem:n}),o={type:"table",caption:t.TABLE,backgroundColor:n.style.backgroundColor?j(n.style.backgroundColor):"",backgroundImage:eq(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:QW(n,"width"),maxWidth:t0(n,"maxWidth"),minWidth:t0(n,"minWidth"),align:n.getAttribute("align")??"",border:_c(n),boxShadow:Ws(n),borderRadius:$s(n),mobileWidth:{value:JW(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:Us(n,"around")};return ea(n)&&(o.showOnMobile=!0),o}function nq(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function rq(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 oq(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 iq(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 sq(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 aq(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=qe({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 lq(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 cq(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=aq(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function uq(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 dq(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 n0(e){return De(e,!0).flatMap(dq)}function pi(e,t){e.replaceChildren(...n0(t))}function fq(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function Pe(e,t){const n=n0(t),r=n.filter(s=>!fq(s)),[o]=r,i=r.length===1&&o.nodeType===Node.ELEMENT_NODE&&o.tagName==="TABLE";e.replaceChildren(...i?Array.from(o.childNodes):n)}function mq(e,t,n){const r=document.createElement("div");return ke(r,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(m=>m.trim());l[d]=f}),l[t]=`${n}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),ze(r)}function hq(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");i&&(i.innerHTML=t)}}),ze(n)}function pq(e,t){const n=document.createElement("div");return ke(n,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};`)}}}),ze(n)}function gq(e,t){const n=document.createElement("div");return ke(n,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;`)}}}),ze(n)}function bq(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 ke(r,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};`)}}}),ze(r)}function yq(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 ke(r,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};`)}}}),ze(r)}function vq(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const n=document.createElement("div");return ke(n,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};`)}}}),ze(n)}function Eq(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const n=document.createElement("div");return ke(n,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};`)}}}),ze(n)}function Sq(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 wq(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 Cq(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=Sq(e),s=wq(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 r0(e){const t=e.cloneNode(!0);nn(e,t);const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let r;for(;r=n.nextNode();)r.nodeValue="";return t}function Eh(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function _q(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=ze(r??n).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?ze(l).trim():"",f=a?rn(r0(a)):"",m=l?rn(r0(l)):"",h=l?`<td${Eh(l)}></td>`:"",p=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:f,secondCellHtmlNoText:m,secondCellWrapperHtml:h,secondCellInnerDivHtml:p?rn(p):"",wrappedSecondCellHtml:l&&p?`<td${Eh(l)}>${rn(p)}</td>`:"",secondCellInnerDivWrapperHtml:p?`<div${Eh(p)}></div>`:"",secondCellTextHTML:d}}function o0(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function i0(e,t){const n=document.createElement("template");ke(n,e);const r=n.content.firstElementChild;if(!r||r.tagName.toLowerCase()!=="td")return e;const o=r.querySelector("div");return o?o.textContent=o0(t)||" ":r.insertAdjacentText("afterbegin",o0(t)),rn(r)}function gi(e){const t=document.createElement("template");return ke(t,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")}),ze(t)}function s0(e){e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(t=>t.removeAttribute("id"))}function Aq(e,t,n,r=!0){const o=document.createElement("template");ke(o,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 ze(o)}function Tq(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 kq(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function Lq(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 Sh(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=Lq(kq(Tq(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 Nq(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function xq(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);nn(e,a);const 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 Oq(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html");xi(o,e);const 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?rn(l):e}function Rq(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=je(l).trim();!c||c.replace(r,"")===""?l.innerHTML=" ":(c=c.replace(r,""),c.endsWith(" ")||(c+=" "),c=c.replace(/ +$/," "),pi(l,c))})})}function Mq(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html");xi(n,t);const r=n.querySelector("div");r&&(r.classList.add("remove-new-editor-element"),r.innerHTML.trim()?r.insertAdjacentHTML("beforeend"," "):r.innerHTML=" ");const o=n.querySelector("td");return o?rn(o):""}function Pq(e,t){const n=document.createElement("div");return ke(n,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)}}),ze(n)}var wh="em-element-list-ol",Ch="em-element-list-ul",Iq="em-element-list-bullet",Dq=`.${wh}, .${Ch}`,Bq=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],Hq="div, p, td, h1, h2, h3, h4, h5, h6",Kn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},oa=null;function _h(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 oa&&oa.container.isConnected&&e.contains(oa.container)?oa:null}function Fq(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:Bc(r),nodes:[...r],startIndex:o,endIndex:s-1}),r=[],o=s+1):r.push(i)}),r.length>0&&t.push({html:Bc(r),nodes:[...r],startIndex:o,endIndex:n.length-1}),t}function $q(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;const i=a=>{r.length>0&&(t.push({html:Bc(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:Bc([a]),nodes:[a],startIndex:l,endIndex:l}),o=l+1):r.push(a)}),i(n.length),t}function Bc(e){const t=document.createElement("div");return e.forEach(n=>{const r=n.cloneNode(!0);nn(n,r),t.appendChild(r)}),Ho(t),ze(t)}function Ah(e,t){const n=_h(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 a0(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 Wq(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=Ah(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=Ah(e,t);return{start:a,end:a}}const o=Ah(e,t),i=a0(e,r.startContainer,t,o),s=a0(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function l0(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 qq(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function c0(e){return e.nodeType===Node.TEXT_NODE&&/^[\t\n\f\r ]*$/.test(e.data)}function u0(e,t){const n=d0(t);if(n.length===0){e.append(" ");return}e.append(...n),qq(e)}function d0(e){let t=0,n=e.length-1;for(;t<=n&&c0(e[t]);)t++;for(;n>=t&&c0(e[n]);)n--;return e.slice(t,n+1)}var zq=["color","background-color","font-family","font-size","font-weight","font-style","text-decoration"];function Uq(e){const t=d0(Array.from(e.childNodes)),n=document.createElement("span");return zq.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 Hc(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 Fc(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 f0(e,t,n){const r=Hc(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?`${Kn.LIST} ${i}`:Kn.LIST),o.append(...Array.from(t.childNodes)),t.replaceWith(o),Fc(e,r)}function Vq(e){return e.querySelector("br")!==null}function jq(e){const t=_h(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 Gq(e){const t=_h(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=p=>p!==null&&p.nodeType===Node.ELEMENT_NODE&&p.tagName==="BR",l=p=>p!==null&&p.nodeType===Node.TEXT_NODE&&p.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 m;d?(m=s,m.data=" "):(m=document.createTextNode(" "),s?e.insertBefore(m,s):e.appendChild(m));const h=window.getSelection();if(h){const p=document.createRange();p.setStart(m,0),p.collapse(!0),h.removeAllRanges(),h.addRange(p)}oa={container:m,offset:0}}function Xq(e,t){const n=l0(e),r=t?"ol":"ul";if(n.querySelector("ol, ul")){const o=jq(n);if(o){o.tagName.toLowerCase()!==r&&f0(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&&f0(n,i,r);return}}Vq(n)||n.querySelector(":scope > ol, :scope > ul")?(Gq(n),Yq(n,r)):m0(n,r)}function m0(e,t){const n=Hc(e),r=document.createElement(t);r.setAttribute("style",Kn.LIST);const o=document.createElement("li");o.setAttribute("style",Kn.LIST_ITEM),u0(o,Array.from(e.childNodes)),r.appendChild(o),e.replaceChildren(r),Fc(e,n)||h0(o)}function Yq(e,t){const n=$q(e);if(n.length===0){m0(e,t);return}const{start:r,end:o}=Wq(n,e),i=Hc(e),s=document.createElement(t);s.setAttribute("style",Kn.LIST);let a=null;for(let m=r;m<=o;m++){const h=document.createElement("li");h.setAttribute("style",Kn.LIST_ITEM),u0(h,n[m].nodes),s.appendChild(h),a=h}const l=document.createDocumentFragment(),c=m=>m.forEach((h,p)=>{p>0&&l.appendChild(document.createElement("br")),l.append(...h.nodes)}),u=m=>m.map(h=>h.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),!Fc(e,i)&&a&&h0(a)}function h0(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 Kq(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 Zq(e,t){const n=Fq(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 Qq(e){const t=l0(e),n=t.querySelector("ol, ul");if(!n)return;const r=Hc(t),o=Kq(t,n),i=document.createDocumentFragment();n.querySelectorAll(":scope > li").forEach(s=>{const a=je(s).trim();!a||a===" "||(i.hasChildNodes()&&i.appendChild(document.createElement("br")),i.append(...Uq(s)))}),n.replaceWith(i.hasChildNodes()?i:" "),Fc(t,r)||Zq(t,o)}function $c(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(Dq):!1}function Jq(e,t,n){const r=mW()||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=qe({elem:l}),d=qe({elem:c}),f=p0(e.elem,n),m=et(o,"strong","b"),h=s!==o?et(s,"strong","b"):!1,p=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?et(e.elem,"strong","b"):!1,v=m||h||p,w=Ic(s),C=v||w,T={type:"text",caption:t.TEXT,fontFamily:Js(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:Pc(a),lineHeightDim:"px",textAlign:DC(e.elem),textStrong:C,textItalic:et(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s.style?.fontStyle==="italic",textStrikethrough:et(e.elem,"s","strike")||(s.style?.textDecoration?.includes("line-through")??!1),textUnderline:et(e.elem,"u")||(s.style?.textDecoration?.includes("underline")??!1)||!s.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||BC()),textColor:$c(r)&&j(qr(r,"color"))||j(e.elem.closest('[style*="color"]')?.style.color)||j(getComputedStyle(e.elem).color)||"",textBackgroundColor:rz(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:hh(e.elem),linkHref:(()=>{const y=s.closest("a");if(!y)return;const g=y.getAttribute("href");if(g!==null)return g})(),textAnchor:(()=>{const y=s.closest("a");if(y&&!y.hasAttribute("href"))return y.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const y=s.closest("a");return y?!!y.hasAttribute("href"):et(e.elem,"a")||BC()})(),textReplacer:n.variableElement(e.elem),list:f,standardList:g0(e.elem),textSuperscript:et(e.elem,"sup"),textSubscript:et(e.elem,"sub")};return ea(r)&&(T.showOnMobile=!0),T}function p0(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?j(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?Js(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 g0(e){return $c(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function Th(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var ez=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function tz(e){let t=e;for(;t&&ez.has(t.tagName);){const n=t.style.backgroundColor;if(Th(n))return n;t=t.parentElement}return""}function nz(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(Th(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function rz(e){const t=tz(e);if(Th(t))return j(t)||"";if(e.closest(".em-element-custom-table"))return j(qr(e,"background-color"))||"";const n=e.closest("div");return j(nz(e,"background-color",n))||""}function oz(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 iz(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,m=qe({elem:d}),h=qe({elem:f}),p=p0(e.elem,n),v={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:Js(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:Pc(e.elem),lineHeightDim:"px",textAlign:DC(e.elem),textStrong:et(u,"strong","b")||Ic(u),textItalic:et(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:et(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:et(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:j(e.elem.tagName==="A"?qr(e.elem.querySelector('[style*="color"]'),"color"):qr(e.elem,"color"))||j(getComputedStyle(e.elem).color)||"",textBackgroundColor:j(e.elem.tagName==="A"?qr(e.elem.querySelector('[style*="background-color"]'),"background-color"):qr(e.elem,"background-color"))||"",mobileFontSize:{value:m.mobileFontSize,dim:m.mobileFontSizeDim||"px"},mobileLineHeight:{value:h.mobileLineHeight,dim:"px"},mobileTextAlign:hh(e.elem),textReplacer:i(e.elem),list:p,standardList:g0(e.elem),textSuperscript:et(e.elem,"sup"),textSubscript:et(e.elem,"sub")};return ea(e.elem)&&(v.showOnMobile=!0),v}function b0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function sz(e,t){const n=e.elem,r=qe({elem:n}),o=b0(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 az(e,t){const n=e.elem,r=qe({elem:n}),o=b0(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 lz(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 cz(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function uz(e,t){return e.elem.tagName==="TD"?sz(e,t):az(e,t)}var y0={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},v0={TRIM_SPACES:/^(\s| )+|(\s| )+$/g,LT:/</g,GT:/>/g,EMPTY_TEXT:/^(?:\s| )*$/};function E0(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function Wc(e){const t=E0(e,wh),n=E0(e,Ch),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:wh,classNameUl:Ch,classNameBullet:Iq,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function dz(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function fz(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function mz(e=Object.values(y0)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function hz(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function S0(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&&S0(n,t)}}function pz(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 gz(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 bz(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var yz="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function vz(e,t=yz){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 Ez(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 Sz(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 wz(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){wd(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 Cz(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 _z(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=Pm(n)??n),n}function Az(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 Tz(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 kz(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"&&$c(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(Tz(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 Lz={_isCarouselElement:CW,_isAccordionElement:oW,_isSocialBlockElement:YW,_isImageElement:BW,_isLinkElement:vW,_isButtonElement:yW,_isTableElement:nq,_isCustomTableElement:_W,_isAtomElement:kW,_isTdColumnGroup:rq,_isTdStructure:oq,_isEmptyTd:iq,_isTdCell:sq,_isVindentTd:lz,_isVindentDiv:cz,_isFloatBlockElement:IW,_isDivTextElement:oz,_isInlineButtonElement:EW,_extractTextSettings:Jq,_extractCarouselSettings:SW,_extractAccordionSettings:rW,_extractSocialSettings:KW,_extractImgSettings:DW,_extractButtonSettings:bW,_extractLinkTextSettings:iz,_extractTableSettings:tq,_extractCustomTableSettings:AW,_extractAtomElementSettings:xW,_extractProgrammaticElementSettings:OW,_extractTdColumnGroupSettings:lq,_extractTdStructureSettings:cq,_extractTdCellSettings:uq,_extractVindentSettings:uz,_extractFloatBlockSettings:PW,_extractDivContainerSettings:TW,_clearActiveEditElements:uM};function Nz(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"),Tr("em-edit"),!i){setTimeout(()=>{const v=document.querySelector("[em-edit]");v?.isConnected?r({elem:v}):n()},0);return}if(i.closest(".em-prevent-action"))return;const s=_z(i,{getVariableByIcon:vc,htmlDocument:e.htmlDocument,findOutermostParentWithText:jd,sendResizeEvent:nC}),a=s.tagName==="EDITOR"&&s.firstChild?.nodeType===1?s.firstChild:s,l=Wc(s),c=window.getSelection()?.isCollapsed??!0;wz(s,c,!!s.querySelector("editor"),{removeAllAttributes:Tr});const u={...Lz,HTMLDocument:e.htmlDocument,parseFromString:De,getParentElementOfSelection:Sl,getSelectedText:Je,findElementWithSelectedText:ls,parseTableElementToModel:Ys,extractBorderRadius:E$,parseBackgroundStyles:u$,isElementHasBold:rM,Locale:Zs(),isProgrammaticSelection:t.get(),getElementTdDiv:V$,getLineHeghtInPixels:Pc,getFontFamilyFromElement:v=>gz(v,a),textHasStyle:et,activeCell:O.get("activeCell"),CLASS_FOR_BASIC_CELL:ae,requestElemWithStyle:a},d=Az({elem:s,isCellCustomTable:!!s.closest(".em-element-custom-table"),listContext:{isListOL:l.isListOL,isListUL:l.isListUL,isList:l.isList},requestElemBullet:l.isList?dz(s):null,variableElement:(v,w=!1)=>Cz(w,{getSelectedText:Je,getRangeFromSelection:bz})},u),f=kz(s,c,d),m={operation:"application_element_settings_set",type:f.type,caption:f.caption,settings:f.settings},h=Sz(s,f,m,{removeAllAttributes:Tr});if(h.isProgrammaticSelectionReset&&t.reset(),h.shouldReturn)return;const p=Ez({elem:s,message:m,activateSection:o.activateSection},{getElementParentCaption:MC,getStructureColumns:j$,getUsedColors:cC,getElementPath:nW,getCurrentElementPath:Z$,mapObj:e.getMapObj(),commonStyles:O.get("commonStyles"),...e.enrichExtras()});O.update({elementPath:p.elementPath}),e.fingerprint.remember(s),K.send(p.message)}finally{Promise.resolve().then(()=>{e.fingerprint.remember(document.querySelector("[em-edit]")),O.decrement("activeElementLocked")})}};return r}function w0(){return O.get("emailWidth")}function xz(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 kh(e){const t=document.createElement("table");return t.replaceChildren(...De(e,!0)),t}function Lh(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>on(r)).join(`
|
|
92
|
-
`);const n=e.querySelector("tr");return n?on(n):Ct(e)}function Nh(e,t){const n=w0(),r=kh(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)),wl({elem:a,width:f})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",wl({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=rv(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(!xz(a))return;const f=a.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),m=f?parseFloat(f.getAttribute("width")||"0"):0,h=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let p=0,v=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(T=>{if(T.getAttribute("width")&&!T.classList.contains("em-insert-ignore")){const y=parseFloat(T.getAttribute("width"))/i,g=Math.round(parseFloat(String(o*y))-m/(h*2));T.setAttribute("width",String(g)),p+=g}});const w=o-(u+d+m*(h-1)+p);a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(T=>{if(T.getAttribute("width")&&!T.classList.contains("em-insert-ignore")){const y=parseFloat(T.getAttribute("width"))+Math.round(w/h);v+=y,T.setAttribute("width",String(y)),T.querySelector("img")&&T.querySelectorAll("img").forEach(g=>{parseFloat(g.getAttribute("width")||"0")>parseFloat(T.getAttribute("width"))+Math.round(w/h)&&(g.setAttribute("width",T.getAttribute("width")),g.style.maxWidth=T.getAttribute("width")+"px")})}}),v=v+m*(h-1)+u+d;const C=o-v;if(C!==0&&p>0){const T=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(T&&!T.classList.contains("em-insert-ignore")){const y=parseFloat(T.getAttribute("width")||"0");T.setAttribute("width",String(y+C))}else{const y=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let g=y.length-1;g>=0;g--){const E=y[g];if(E.classList.contains("em-insert-ignore"))continue;const _=parseFloat(E.getAttribute("width")||"0");E.setAttribute("width",String(_+C));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 Lh(r)}function xh(e){const t=kh(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"))})}),Lh(t)}function Oh(e,t){const n=w0(),r=kh(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",wl({elem:s,width:o})),Lh(r)}function qc(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 Oz=new Set(["alt","title","link"]);function Rz(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>Oz.has(o))&&e.parentNode===t.parent}function Mz(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 Pz(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||Rz(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=cr(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,m)=>{l[m]&&f.setAttribute("expanded","")}))}}}function Iz(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?$r(i):null,a=o?$r(o):null,l=!!s&&!a,c=Qm(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 h=n.closest("td")?.closest("table")?.closest("div, p, td");h&&(h.style.textAlign?h.style.textAlign=e.align:h.setAttribute("align",e.align))}else if(e.align===""){const h=n.closest("td")?.closest("table")?.closest("div, p, td");h&&(h.style.textAlign?h.style.removeProperty("text-align"):h.removeAttribute("align"))}if(e.textAlign){const h=n.closest("td");h&&(h.style.textAlign?h.style.textAlign=e.textAlign:h.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const h=n.closest("td");h&&(h.style.textAlign?h.style.removeProperty("text-align"):h.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 h=n.closest("table");h&&(e.width.value?(h.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),h.style.width=e.width.value+e.width.dim):(h.removeAttribute("width"),h.style.removeProperty("width")))}if(e.height){const h=n.closest("td"),p=n.closest("a");if(e.height.value){if(h&&(h.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),h.style.height=e.height.value+e.height.dim),p){const v=e.height.value+e.height.dim;p.style.height=v,p.style.lineHeight=v,p.firstElementChild&&(p.firstElementChild.style.lineHeight=v);const w=p.closest("editor")||p.querySelector("editor");w&&(w.style.height=v,w.style.lineHeight=v)}}else if(h&&(h.removeAttribute("height"),h.style.removeProperty("height")),p){p.style.removeProperty("height"),p.style.removeProperty("line-height");const v=p.closest("editor")||p.querySelector("editor");v&&(v.style.removeProperty("height"),v.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 h=n.closest("td");h&&(e.backgroundImage[0].value===""?(h.style.removeProperty("background-image"),h.removeAttribute("background")):(h.style.removeProperty("background-image"),Pt(h,"background",Bz(e))))}if(e.backgroundPositionX!==void 0){const h=n.closest("td");h&&(e.backgroundPositionX===""?h.style.removeProperty("background-position-x"):h.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const h=n.closest("td");h&&(e.backgroundPositionY===""?h.style.removeProperty("background-position-y"):h.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const h=n.closest("td");h&&(e.backgroundRepeat==="none"?h.style.removeProperty("background-repeat"):h.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const h=n.closest("td");h&&(e.backgroundSize===""?h.style.removeProperty("background-size"):h.style.backgroundSize=e.backgroundSize)}if(e.padding){const h=n.closest("a");h&&(e.padding.all!==void 0?(h.style.paddingTop=e.padding.all+"px",h.style.paddingRight=e.padding.all+"px",h.style.paddingBottom=e.padding.all+"px",h.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(h.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(h.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(h.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(h.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&t.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const h=n.closest("table");h&&t.setElementMobileWidth({settings:e,elem:h}),r=!0}if(e.mobileHeight){const h=n.closest("td");h&&t.setElementMobileHeight({settings:e,elem:h}),t.setElementMobileLineHeight({settings:e,elem:n}),r=!0}if(e.mobileBorder){const h=n.closest("td");h&&t.setElementMobileBorder({settings:e,elem:h}),r=!0}if(e.mobileBorderRadius){const h=n.closest("td");h&&t.setElementMobileBorderRadius({settings:e,elem:h}),r=!0}if(e.mobileBoxShadow){const h=n.closest("td");h&&t.setElementMobileBoxShadow({settings:e,elem:h}),r=!0}if(e.mobileTextAlign){const h=Qs(n);h&&t.setElementMobileAlign({settings:e,elem:h,fieldName:"mobileTextAlign"}),r=!0}if(e.mobileAlign){const h=n.closest("td")?.closest("table");h&&t.setElementMobileTableAlign({settings:e,elem:h}),r=!0}if(e.mobileVerticalAlign){const h=n.closest("td");h&&t.setElementMobileVerticalAlign({settings:e,elem:h}),r=!0}if(e.mobileBackgroundColor){const h=n.closest("td");h&&t.setElementMobileBackgroundColor({settings:e,elem:h}),r=!0}if(e.mobileBackgroundImage){const h=n.closest("td");h&&t.setElementMobileBackgroundImage({settings:e,elem:h}),r=!0}if(e.mobileBackgroundPositionX){const h=n.closest("td");h&&t.setElementMobileBackgroundPositionX({settings:e,elem:h}),r=!0}if(e.mobileBackgroundPositionY){const h=n.closest("td");h&&t.setElementMobileBackgroundPositionY({settings:e,elem:h}),r=!0}if(e.mobileBackgroundRepeat){const h=n.closest("td");h&&t.setElementMobileBackgroundRepeat({settings:e,elem:h}),r=!0}const d=e;if(d.mobileBackgroundSize){const h=n.closest("td");h&&t.setElementMobileBackgroundSize?.({settings:d,elem:h}),r=!0}if(e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show){const h=n.closest("table");h&&t.setElementShow({settings:e,elem:h}),r=!0}const f=n.closest("a");if(f&&e.textColor!==void 0){const h=String(e.textColor||"");f.style.color=h,f.querySelectorAll('span[style*="color"], font[color]').forEach(p=>{p.style.removeProperty("color"),p.removeAttribute("color")})}if(f&&e.textBackgroundColor!==void 0){const h=String(e.textBackgroundColor||"");f.style.backgroundColor=h,f.querySelectorAll('span[style*="background-color"]').forEach(p=>{p.style.removeProperty("background-color")})}const m=["textColor","textBackgroundColor"];if(t.textStyleProperties.filter(h=>!m.includes(h)&&e.hasOwnProperty(h)).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&&Dz(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?eh(n,e):e.outlookRounding===!1?dH(n):(s||c)&&eh(n,e),i&&Vs(i,e,"inside"),r}function Dz(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(/~~.*$/,""),m=document.createElement("em-replace");m.setAttribute("text",f),o.surroundContents(m)}}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,m=>{const h=e,p=m.textContent||"";return h.length===1&&f.test(p)?!0:n(p,h)}),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 Bz(e){return e.backgroundImage?.[0]?.value??""}function Hz(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),Vs(n,e,"inside"),r}function Rh(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&&Rh({elem:e.elem.previousSibling,width:e.width})}function Fz(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"&&Rh({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,Rh({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+")",Pt(n,"background",$z(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),Vs(n,e,"around"),r}function $z(e){return e.backgroundImage?.[0]?.value??""}function ia(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function Wz(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),ia(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+")",Pt(n,"background",Uz(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))&&zz(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&&(qz(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}),Vs(n,e,"inside"),r}function qz(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";dW(t,(s,a)=>{fW(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 zz(e,t){const n=t.activeElement,r=t.removeEditorTags(cl(t.isElementListContainer)),o=t.addClassToSecondCell(r,"em-list-temp-class");pi(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 Uz(e){return e.backgroundImage?.[0]?.value??""}function Mh(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&&Mh({elem:e.elem.previousSibling,width:e.width})}function C0(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 Vz(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,Mh({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,Mh({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,C0(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 Ph(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&&Ph({elem:e.elem.previousSibling,width:e.width})}function zc(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 Uc(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 Ih(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function jz(e,t){const n=t.activeElement;if(zc(n)){const r=Uc(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=Ih(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",Ph({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 Gz(e,t){const n=t.activeElement;if(!zc(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>
|
|
93
|
-
<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>
|
|
94
|
-
<td width="${l}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),c>=i&&u&&or(r,"beforeend",u)}))}function Xz(e,t){const n=t.activeElement;if(zc(n)){const r=Uc(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=Ih(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,C0(o,o.style.verticalAlign)})}}function Yz(e,t){const n=t.activeElement;if(zc(n)){const r=Uc(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=Ih(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",Ph({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 Kz(e,t){const n=t.activeElement;let r=!1;const o=Uc(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 Dh="amp-img";function Zz(e){const t=qC(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 _0(e){return e==null||e===""?null:Number(e)}function Qz(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:_0(e.width?.value),height:_0(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function Bh(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function Jz(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(Dh).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 A0(e){e.replaceWith(...Array.from(e.childNodes))}function T0(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function eU(e,t,n,r){if(r.src!==n.src&&Pt(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=Bh(e,t,"em-replace");if(!r.imgReplacer)o&&A0(o);else if(o)Pt(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Pt(i,"src",r.imgReplacer),T0(e,i)}}if(r.link!==n.link){const o=Bh(e,t,"a");if(!r.link)o&&A0(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),T0(Bh(e,t,"em-replace")??e,i)}}}function tU(e){const t=document.createElement(Dh);Pt(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");Pt(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 nU(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function rU(e,t){const n=Array.from(e.querySelectorAll(Dh)),r=new Set,o=[];nU(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),eU(a,e,Zz(a),Qz(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>Jz(i,e).remove()),o.forEach(i=>e.appendChild(tU(i)))}function oU(e,t){const n=e,r=t.activeElement.closest("amp-carousel");r&&k0(r,t,o=>iU(o,n,t))}function k0(e,t,n){cr(t.HTMLDocument.getOuterHtml(e),([r])=>{r instanceof Element&&(n(r),r.setAttribute("em-edit","active"),e.replaceWith(r))}),t.commit(!0)}function iU(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)&&rU(e,t.carouselImages),"borderRadius"in t&&n.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:e})}function sU(e,t){const n=e,r=t.activeElement.closest("amp-accordion");r&&k0(r,t,o=>aU(o,n))}function aU(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 Zn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function lU(e){return e.closest('table[em-type="social"]')}function L0(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 cU(e,t,n){const r=L0(e),o=L0(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 Qn(e){return String(e??"").replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function uU(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function dU(){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 fU(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=dU();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function mU(e){return e>0?`<td width="${e}"> </td>`:""}function hU(e,t){const n=lU(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:Zn.align,i=typeof e.iconSize=="number"?e.iconSize:Zn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:Zn.borderRadius,a=typeof e.gap=="number"?e.gap:Zn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:Zn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:Zn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Zn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:Zn.borderColor;let f=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Zn.buttonBorderWidth;f=Math.max(0,Math.min(24,Math.round(f)));const m=typeof e.showLabel=="boolean"?e.showLabel:Zn.showLabel,h=[];u>0&&d&&h.push(`border:${u}px solid ${Qn(d)}`);const p=h.length?` style="${h.join(";")}"`:"",v=!!(l&&String(c).trim()),w=Math.max(0,Math.round(Number(a)||0)),C=r.length>1,T=`<table border="0" cellspacing="0" cellpadding="0">
|
|
95
|
-
<tr>${r.map(E=>{const _=Qn(E.platform||"unknown"),b=!!E.customIcon,S=Qn(E.href||""),A=String(E.title??"").trim(),L=A?` title="${Qn(A)}"`:"",x=Qn(E.alt||""),N=Qn(fU(E.iconSrc||"")),$=E.iconWidth!=null&&!Number.isNaN(Number(E.iconWidth))?Number(E.iconWidth):i,R=E.iconHeight!=null&&!Number.isNaN(Number(E.iconHeight))?Number(E.iconHeight):i,I=b?"":typeof E.buttonBgColor=="string"?E.buttonBgColor.trim():"",Q=!b&&v&&!I?String(c).trim():"",V=b?"":I||Q,ee=!b&&!!Q,re=b?"":typeof E.itemBorderColor=="string"?E.itemBorderColor.trim():"",J=!b&&!!(I||re&&f>0||ee);let be=`<a href="${S}" target="_blank"${L} draggable="false"><img src="${N}" width="${$}" height="${R}" border="0" alt="${x}" draggable="false" style="display:block;${!b&&!J&&s>0?`border-radius:${s}px;`:""}" /></a>`;if(m&&(E.title||E.alt)){const Y=uU(String(E.title||E.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=[];V&&de.push(`background-color:${Qn(V)}`),re&&f>0&&de.push(`border:${f}px solid ${Qn(re)}`),J&&s>0&&de.push(`border-radius:${s}px`);const Se=ee?' em-tray-cell-bg="1"':"",me=b?' em-custom-icon="1"':"",X=V&&/^#[0-9A-Fa-f]{3,8}$/.test(V)?` bgcolor="${Qn(V)}"`:"",H=C?' draggable="true"':"";return`<td em-platform="${_}"${me}${Se}${X}${de.length?` style="${de.join(";")}"`:""}${H}>${be}</td>`}).filter(Boolean).reduce((E,_,b)=>(b>0&&E.push(mU(w)),E.push(_),E),[]).join("")}
|
|
96
|
-
</tr>
|
|
97
|
-
</table>`,y=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${p}><tr><td align="${Qn(o)}">
|
|
98
|
-
${T}
|
|
99
|
-
</td></tr></table>`,g=De(y,!0)[0];return g?(g instanceof HTMLTableElement&&cU(n,g,o),g.setAttribute("em-edit","active"),n.replaceWith(g),t.commit(!0),g):null}function pU(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 m=t.unwrapTag(d);r.selectNodeContents(m)}else{const m=t.splitWrapper(d,r);r.selectNodeContents(m),setTimeout(()=>n.removeAllRanges(),100)}else if(c){const m=t.splitWrapper(c,r);r.selectNodeContents(m)}if(f)if(r.collapsed){const m=r.cloneRange();try{r.expand("word");const h=r.toString().trim();if(h){const p=t.wrapInTag(r,h,a),v=document.createRange();v.selectNodeContents(p),n.removeAllRanges(),n.addRange(v),t.cleanEmptyTags(p.parentNode)}else r.setStart(m.startContainer,m.startOffset),r.setEnd(m.endContainer,m.endOffset)}catch{r.setStart(m.startContainer,m.startOffset),r.setEnd(m.endContainer,m.endOffset)}}else{const m=r.cloneContents(),h=document.createElement("div");h.appendChild(m),nn(r.commonAncestorContainer,h),t.unwrapNestedTags(h,a);const p=t.wrapInTag(r,h,a),v=document.createRange();v.selectNodeContents(p),n.removeAllRanges(),n.addRange(v),t.cleanEmptyTags(p.parentNode)}}else if(r.collapsed)if(c){const f=c.parentNode,m=t.unwrapTag(c),h=document.createRange();h.selectNodeContents(m),n.removeAllRanges(),n.addRange(h),t.cleanEmptyTags(f),c.parentNode||setTimeout(()=>n.removeAllRanges(),0)}else{const f=r.startContainer.parentElement?.closest(a);if(f){const m=t.unwrapTag(f),h=document.createRange();h.selectNodeContents(m),n.removeAllRanges(),n.addRange(h),t.cleanEmptyTags(f.parentNode)}}else{let f=[];const m=r.cloneContents(),h=document.createElement("div");if(h.appendChild(m),nn(r.commonAncestorContainer,h),f=Array.from(h.querySelectorAll(a)),c){const w=Array.from(c.childNodes).some(y=>y.nodeType===1),C=t.unwrapTag(c),T=document.createRange();if(C.isConnected)T.selectNodeContents(C),n.removeAllRanges(),n.addRange(T);else{const y=c.parentNode;y&&(T.selectNodeContents(y),n.removeAllRanges(),n.addRange(T))}w&&t.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),t.commit();return}else{const w=r.commonAncestorContainer.parentElement?.closest(a)||r.startContainer.parentElement?.closest(a);w&&f.push(w)}f.length>0&&f.forEach(w=>{w.parentNode&&t.unwrapTag(w)});const p=h.cloneNode(!0);nn(h,p);const v=p.querySelector('[em-edit="active"]');if(v){r.deleteContents(),r.insertNode(v);const w=document.createRange();w.selectNodeContents(v),n.removeAllRanges(),n.addRange(w),t.cleanEmptyTags(v.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function gU(e,t){if(e!==void 0){if(e===""){bU(t.activeElement);return}yU(e,t)}}function bU(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 yU(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 m=e,h=f.textContent||"";return m.length===1&&d.test(h)?!0:t.compareStrings(h,m)}),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 vU(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function N0(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 EU(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 SU(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function wU(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=N0(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;SU(i),t.commit(),EU(s,a)}return}const o=vU(e);if(o&&!(!n||!r||r.collapsed))try{const i=N0(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 CU(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_")&&_U(e,s,a,t),e.backgroundColor&&AU(e.backgroundColor,s),i.includes("backgroundImage")&&TU(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)&&kU(e,i,s,t),i.includes("borderRadius")&&LU(e,s,t),i.includes("boxShadow")&&NU(e,s,t),n=xU(e,s,t)||n,i.includes("cell")&&OU(e,i,s,a,o,t),new Set(["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"]).has(i)&&DU(e,i,s,a,o,r,t),BU(s,t),Vs(s,e,"around"),n}function _U(e,t,n,r){const o=r.updateTablePadding(n,{settings:e});Pe(t,r.tableModelToHtml(o))}function AU(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 TU(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 kU(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 m=n.style.border?n.style.border:`${l||"1"}px solid ${c||"#b9b1b1"}`;u=`border-top: ${m}; border-right: ${m}; border-bottom: ${m}; border-left: ${m}; ${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(m=>{u=r.removeStyleProperty(u,m)}),["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 LU(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 NU(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 xU(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 OU(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,Mr);Pe(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(`.${Xe}`).forEach(l=>{l.classList.remove(Xe)})),r=i.parseTableElementToModel(n);const a=i.addClassToCellsByIds(r,o,Xe);Pe(n,i.tableModelToHtml(a))}(e.cell_borderAll||e.cell_borderTop||e.cell_borderRight||e.cell_borderBottom||e.cell_borderLeft)&&RU(e,n,r,o,i,s),t.includes("cell_borderRadiusAll")&&MU(e,n,r,o,i,s),t.includes("cell_padding")&&PU(e,n,r,o,i,s)}function RU(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Xe}`).forEach(l=>{l.classList.remove(Xe)}));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,Mr);d=o.addClassToCellsByIds(d,c,Xe),Pe(t,o.tableModelToHtml(d))}(e.cell_borderAll.style===""||e.cell_borderAll.width===0||e.cell_borderAll.color==="")&&t.querySelectorAll(`.${Mr}`).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(m=>a[m].includes(c)),d=o.updateCellBordersByIds(n,u,[c],e[l]),f=o.addClassToCellsByIds(d,r,Mr);Pe(t,o.tableModelToHtml(f))}})}function MU(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Xe}`).forEach(a=>{a.classList.remove(Xe)}));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,Mr);Pe(t,o.tableModelToHtml(c))}}function PU(e,t,n,r,o,i){t.querySelector(".remove-basic-cell")&&(r=o.getCellsWithClasses(n,i),o.state.set("activeCell",r),document.querySelectorAll(`.${Xe}`).forEach(l=>{l.classList.remove(Xe)})),n=o.parseTableElementToModel(t);let s=o.addClassToCellsByIds(n,r,Xe);Pe(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,Mr);Pe(t,o.tableModelToHtml(a))}function IU(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 DU(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(`.${Xe}`).forEach(d=>{d.classList.remove(Xe)})),!o.length)return;if(o.length===1){const d=n.querySelector(`td.${ie}, td.${Xe}, td.${ae}`),f=d?.querySelector(":scope > div")??d?.querySelector(":scope > editor > div");if(f){if(s.wrapEditor(f,!0),s.textStyleProperties.some(m=>Object.prototype.hasOwnProperty.call(e,m))){if(IU(c,f))s.addNewRange(c);else{const m=document.createRange();m.selectNodeContents(f),s.addNewRange(m)}try{s.toggleTextStyle(f,{settings:e})}catch{}}if(t==="linkHref"&&typeof e.linkHref=="string"){const m=f.tagName==="A"?f:f.querySelector("a");m&&m.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,Xe);Pe(n,s.tableModelToHtml(u)),n.querySelectorAll(`td.${Xe} > div`).forEach(d=>{s.wrapEditor(d,!0);const f=l.getRangeAt(0);if(f.selectNode(d),s.addNewRange(f),s.textStyleProperties.some(m=>Object.prototype.hasOwnProperty.call(e,m)))try{s.toggleTextStyle(d,{settings:e})}catch{}if(t==="linkHref"&&typeof e.linkHref=="string"){const m=d.tagName==="A"?d:d.querySelector("a");m&&m.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 BU(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),Pe(e,t.tableModelToHtml(n));const r=e.querySelectorAll(`.${Mr}`);r.length>0&&(r[0].setAttribute("em-edit",""),r.forEach(o=>{o.classList.remove(Mr)})),t.commit()}var Ie=e=>El(e?.innerText);function HU(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 FU(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 $U=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,WU=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,Hh=e=>e.toString(16).padStart(2,"0");function qU(e){const t=WU.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`#${Hh(n)}${Hh(r)}${Hh(o)}`}function x0(e){return e.split("").map(t=>`${t}${t}`).join("")}function Jn(e,t){if(!e)return;const n=e.trim();if(!n)return;if($U.test(n)){const o=n.slice(1);return o.length===3?`#${x0(o).toLowerCase()}`:o.length===4?`#${x0(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=qU(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Jn(o)}}function zU(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Fh(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Jn(o.style.color,n);if(i)return i;o=o.parentElement}}function UU(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Jn(n.style.color,t);if(!r)return;const o=Fh(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&zU(n))})}function VU(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 jU(e,t,n){const r=Jn(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=VU(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Jn(u.style.color,n)===r?!0:Fh(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 GU(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=Jn(o.style.color,t);if(!i)return;const s=Fh(o,e,t)||(n?Jn(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Jn(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function XU(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 YU(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"&&Sc(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),qm(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 KU(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;ke(n,e.removeFormattingTags(je(n),"bold")),sn(n),n.tagName!=="STRONG"?e.currentSettings.value&&ke(n,"<strong>"+je(n)+"</strong>"):e.currentSettings.value||Ri(n,je(n)),sn(r)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(Wt(n,t),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");Wt(n,t),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 ZU(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;ke(n,e.removeFormattingTags(je(n),"italic")),sn(n),n.tagName!=="EM"?e.currentSettings.value&&ke(n,"<em>"+je(n)+"</em>"):e.currentSettings.value||Ri(n,je(n)),sn(r)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(Wt(n,t),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");Wt(n,t),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 QU(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=""),dr("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");Wt(i,t.parentElement),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");Wt(s,i);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");Wt(d,u),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");Wt(u,i),u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");Wt(u,i),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 JU(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;ke(i,e.removeFormattingTags(je(i),"strike")),sn(i),i.tagName!=="STRIKE"?e.currentSettings.value&&ke(i,"<strike>"+je(i)+"</strike>"):e.currentSettings.value||Ri(i,je(i)),sn(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"&&Su(i.parentNode),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=>{Su(l)}),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=""),ke(t.parentWrapper,e.removeFormattingTags(je(t.parentWrapper),"strikeUnderline")),sn(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 eV(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;ke(i,e.removeFormattingTags(je(i),"underline")),sn(i),i.tagName!=="U"?e.currentSettings.value&&ke(i,"<u>"+je(i)+"</u>"):e.currentSettings.value||Ri(i,je(i)),sn(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 tV(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");Wt(a,s);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 m=document.createElement("span");Wt(m,f),m.style[e.stylePropretyName]=c,f.parentNode?.replaceChild(m,f),e.refreshElementSettings(m,e.selectedText),t.range.selectNode(m),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");Wt(f,s),f.style[e.stylePropretyName]=c;const m=s.closest("a");m&&m.innerText===s.innerHTML&&(m.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&&(GU(i,e.rgbToHex,e.outerContextColor||e.tempColor),UU(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function nV(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 O0(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Jn(n),o=Jn(t??"");return!r||r===o?null:n}function rV(e){if(e.currentSettings.name!=="textLink")return;const{mutableState:t}=e;let n=t.parentNode.closest('a[href=" "]')||t.parentNode.querySelector('a[href=" "]')||e.parentElement?.querySelector('a[href=" "]')||null;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=je(n),l=n?.parentNode;l&&(ke(l,a),sn(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=nV(n)?"div":"span",o=document.createElement(r);if(Wt(o,n),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=O0(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=O0(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 $h='[class*="em-mob-font_size"]',oV=`${$h}, [style*="font-size"]`,iV="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",sV=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function aV(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest(iV)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=lV(s,i!==null);if(!a||Ie(s)===Je()){n({settings:t,elem:s.closest("editor")?s:s.closest(oV)||s}),Wh(s,r,i);return}const l=cV(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll($h)).filter(d=>a.intersectsNode(d))).forEach(d=>{Wh(d,r,null),R0(d,r)});return}const c=l||Yy(a,a.extractContents(),"span");if(!c)return;uV(c),n({settings:t,elem:c}),Wh(c,r,i);const u=document.createRange();u.selectNodeContents(c),$o(u)}function lV(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($h);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),$o(s),s}FU(n,$o);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function cV(e,t){const n=Je(),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)&&Ie(o)===n;)i=o,o=o.parentElement;return i}function Wh(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(wc(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&R0(r,t)})}function R0(e,t){wc(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 uV(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"));sV.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function dV(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&mV(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(aV(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&&hV(e.textAlign,r),e.mobileTextAlign&&(pV(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"))&&fV(e,r),t.isElementList&&bV(e,t),n}function fV(e,t){const n=Bq.includes(t.tagName)?t:t.closest(Hq);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?Xq(n,r):Qq(n)}function mV(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),ia(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 hV(e,t){const n=Qs(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 pV(e,t,n){const r=Qs(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";cW(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function gV(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=>yV(l,c,t))].filter(c=>!!c)}function bV(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=gV(e,t);if(s.length){const l=t.removeEditorTags(cl(i));Pe(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 yV(e,t,n){const r=document.createElement("div");ke(r,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"&&Sc(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),qm(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),ze(r)):t}var Vc=null;function M0(e){Vc=e}function P0(){return Vc}function yr(){Vc=null}function vV(){return Vc?.kind==="atom"}function qh(e,t,n,r){ns(e,t,o=>{const i=document.createElement("table");i.replaceChildren(...o),[...i.querySelectorAll(":scope > tr")].reverse().forEach(s=>n.insertAdjacentElement(r,s))})}function I0(e,t){e.replaceChildren(...t),e.querySelectorAll('tr[em="block"]').forEach(n=>n.removeAttribute("em"))}function zh(e,t,n,r,o){ns(e,n,i=>{I0(t,i),r.insertAdjacentElement(o,t)})}var EV=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],SV=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],wV=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function D0(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...EV)})}function CV(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...SV)})}function jc(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...wV)})}function Uh(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function B0(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function Vh(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=B0(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=B0(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function Gc(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function H0(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 _V(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 AV(e){const t=H0(e.dataTransfer?.files??null);return t||_V(e.dataTransfer??null)}function jh(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 sa(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Gh(e){if(!sa(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!H0(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 F0="em-native-img-drop-target",Xh="em-native-img-uploading",TV="em-native-img-drop-loading",Xc="em-native-file-drag",aa=null,uo=null;function $0(){uo&&(window.removeEventListener("scroll",uo.reposition,!0),window.removeEventListener("resize",uo.reposition),uo.resizeObserver?.disconnect(),uo.overlay.remove(),uo=null)}function kV(e){$0();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)),uo={overlay:t,reposition:r,resizeObserver:o}}function Yh(){aa&&(aa.classList.remove(F0),aa=null)}function fo(){Ve(document.body,!1,Xc),Yh()}function LV(e){if(!sa(e)){fo();return}if(!Gh(e)){fo();return}Ve(document.body,!0,Xc);const t=jh(e);if(!t){Yh();return}aa!==t&&(Yh(),aa=t,t.classList.add(F0))}function W0(){$0(),Ve(document.body,!1,TV,Xc),document.querySelectorAll(`.${Xh}`).forEach(e=>{e.classList.remove(Xh)})}function NV(e,t){if(t.lockEditor||!sa(e))return!1;const n=AV(e);if(!n)return!1;const r=jh(e);return r?(t.applicationElementSettingsSet({elem:r}),fo(),r.classList.add(Xh),kV(r),t.messageService.send({operation:Le.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function xV(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"&&(Ve(document.body,!0,"em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function OV(e,t){t.lockEditor||(fo(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function RV(e,t){if(e.preventDefault(),t.lockEditor){fo();return}sa(e)?(Gh(e)&&jh(e)&&(e.dataTransfer.dropEffect="copy"),LV(e)):fo();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=Ln(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=Gc(r);o&&Vh(o,Uh(o,e.pageY),"block")}else D0()}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,Vh(r,Uh(r,e.pageY),"atom"),jc();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)jc();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=Gc(o);i&&(Vh(i,Uh(i,e.pageY),"blockatom"),CV())}}}}function MV(e,t){if(t.lockEditor)return;sa(e)&&Gh(e)&&Ve(document.body,!0,Xc);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"]');Ln(n)?(n.classList.add("em-block-insert-empty"),D0()):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"]');Ln(n)?(n.classList.add("em-block-insert-empty"),jc()):o?t.mutableState.targetBlock=o:jc()}}var PV=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function IV(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function DV(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(IV(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...PV)),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 BV(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+`
|
|
100
|
-
`+[...i.querySelectorAll("style")].map(a=>a.innerHTML).join(`
|
|
101
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;s=n.cssbeautify(s,{indent:" ",autosemicolon:!0}),r&&(r.textContent=`
|
|
102
|
-
`+s+`
|
|
103
|
-
`)}function HV(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
|
|
104
|
-
`)}function FV(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 q0(){yr(),fo(),Ve(document.body,!1,"em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),Ve(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 z0(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(BV(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),HV(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&Ln(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"?ur("new",br(r),"beforeend",`
|
|
105
|
-
`+i+`
|
|
106
|
-
`):ur("new",br(r),"beforeend",`
|
|
107
|
-
<tr><td align="center">
|
|
108
|
-
`+i+`
|
|
109
|
-
</td></tr>
|
|
110
|
-
`),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),yr());else if(r.tagName==="BODY"){const l=e0();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"}),qh("new",`
|
|
111
|
-
`+i+`
|
|
112
|
-
`,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}),yr())}else{const l=r.closest('[em="block"]');if(l){const c=Gc(l),u=c?FV(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"?qh("new",`
|
|
113
|
-
`+i+`
|
|
114
|
-
`,l,u):qh("new",`
|
|
115
|
-
<tr em="block"><td align="center">
|
|
116
|
-
`+i+`
|
|
117
|
-
</td></tr>
|
|
118
|
-
`,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"),zh("new",d,`
|
|
119
|
-
`+i+`
|
|
120
|
-
`,l,u)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),zh("new",d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
121
|
-
`+i+`
|
|
122
|
-
</table>`,l,u)}else ur("new",l,u,`
|
|
123
|
-
`+i+`
|
|
124
|
-
`);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}),yr())}}}var Kh="em-live-atom";function Yc(e,t){return t?`<${Kh}></${Kh}>`:e}function $V(e,t){const[n,...r]=document.querySelectorAll(Kh);if(r.forEach(i=>i.remove()),!n||e.contains(n)){n?.remove();return}const o=e.parentElement;Nd(e),n.replaceWith(e),o&&e.parentElement&&t(e,o,e.parentElement)}function U0(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>'?`
|
|
125
|
-
<tr em="block" class="em-structure">
|
|
126
|
-
<td align="center">
|
|
127
|
-
${t}
|
|
128
|
-
</td>
|
|
129
|
-
</tr>`:`
|
|
130
|
-
<style>
|
|
131
|
-
@media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
|
|
132
|
-
.em-mob-wrap {
|
|
133
|
-
display: block!important;
|
|
134
|
-
}
|
|
135
|
-
.em-mob-width-100perc {
|
|
136
|
-
width: 100%!important;
|
|
137
|
-
max-width: 100%!important;
|
|
138
|
-
}
|
|
139
|
-
.em-mob-padding_right-20 {
|
|
140
|
-
padding-right: 20px!important;
|
|
141
|
-
}
|
|
142
|
-
.em-mob-padding_left-20 {
|
|
143
|
-
padding-left: 20px!important;
|
|
144
|
-
}
|
|
145
|
-
</style>
|
|
146
|
-
<tr em="block" class="em-structure">
|
|
147
|
-
<td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
|
|
148
|
-
<table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
|
|
149
|
-
<tr>
|
|
150
|
-
<td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
|
|
151
|
-
${t}
|
|
152
|
-
</td>
|
|
153
|
-
</tr>
|
|
154
|
-
</table>
|
|
155
|
-
</td>
|
|
156
|
-
</tr>`}function WV(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}):ur(i,e,"beforeend",`
|
|
157
|
-
`+Yc(t,s)+`
|
|
158
|
-
`),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),yr())}function qV(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=U0(t,Yc(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 m="beforeend";l&&f&&(f.classList.contains("em-block-insert_bottom-document")||f.classList.contains("em-block-insert_bottom")?m="afterend":(f.classList.contains("em-block-insert_top-document")||f.classList.contains("em-block-insert_top"))&&(m="beforebegin"));const h=!!t.match(/class="em-countdown"/gi),p=d.substring(0,3)==="<tr";if(c.tagName==="TR")if(p)if(h)r.insertCountdown({targetElem:c,targetPlace:m,atomHTML:d});else{const v=document.createElement("tr");v.setAttribute("em","block"),v.classList.add("em-structure"),ns(i,`
|
|
159
|
-
`+d+`
|
|
160
|
-
`,w=>{v.replaceChildren(...w.flatMap(C=>C instanceof Element&&C.tagName==="TR"?Array.from(C.childNodes):[C])),c.insertAdjacentElement(m,v)})}else if(h)r.insertCountdown({targetElem:c,targetPlace:m,atomHTML:`<tr em="block"><td align="center">
|
|
161
|
-
`+d+`
|
|
162
|
-
</td></tr>`});else{const v=document.createElement("tr");v.setAttribute("em","block"),ns(i,`
|
|
163
|
-
<td align="center">
|
|
164
|
-
`+d+`
|
|
165
|
-
</td>
|
|
166
|
-
`,w=>{v.replaceChildren(...w),c.insertAdjacentElement(m,v)})}else if(p)if(c.tagName==="TABLE")if(Ln(a))h?r.insertCountdown({targetElem:m==="beforeend"?br(c):c,targetPlace:m,atomHTML:d}):ur(i,m==="beforeend"?br(c):c,m,d);else{const v=document.createElement("table");v.setAttribute("cellspacing","0"),v.setAttribute("cellpadding","0"),v.setAttribute("align","center"),v.setAttribute("border","0"),v.setAttribute("em","block"),v.setAttribute("width",c.hasAttribute("width")?c.getAttribute("width"):String(c.getBoundingClientRect().width)),v.classList.add("em-mob-width-100perc"),h?(I0(v,De(`
|
|
167
|
-
`+d+`
|
|
168
|
-
`,!0)),r.insertCountdown({targetElem:c,targetPlace:m,atomHTML:r.getOuterHtml(v)})):zh(i,v,`
|
|
169
|
-
`+d+`
|
|
170
|
-
`,c,m)}else h?r.insertCountdown({targetElem:c,targetPlace:m,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
171
|
-
`+d+`
|
|
172
|
-
</table></div>`}):ur(i,c,m,`
|
|
173
|
-
<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
174
|
-
`+d+`
|
|
175
|
-
</table></div>
|
|
176
|
-
`);else h?r.insertCountdown({targetElem:c,targetPlace:m,atomHTML:d}):ur(i,c,m,`
|
|
177
|
-
`+d+`
|
|
178
|
-
`);document.querySelectorAll(".em-blockatom-insert").forEach(v=>{v.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),yr())}function zV(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");mT(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?Yc(e,o):Ct(l),m=`
|
|
179
|
-
<tr em="atom"><td colspan="`+u+`">
|
|
180
|
-
`+f+`
|
|
181
|
-
</td></tr>
|
|
182
|
-
`;a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:m}):ur(r,i,s,m)}else a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:e}):ur(r,i,s,`
|
|
183
|
-
`+Yc(e,o)+`
|
|
184
|
-
`);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),yr())}function V0(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?ts(n):""}},s=o==="moved"?i.settings.atomHTML:"",a=n&&s&&!s.match(/class="em-countdown"/gi)?n:null;try{UV(e,t,o,i,a)}finally{a&&$V(a,t.fitMovedImage)}}function UV(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")||vV()),u=s.tagName==="DIV"&&s.closest("amp-accordion")&&!s.innerHTML;if(c||u){WV(s,l,i,r,t,n,o);return}if(document.querySelector(".em-blockatom-insert")||Ln(s)){qV(e,l,r,t,a,n,o);return}s.closest('[em="atom"]')&&zV(l,r,t,n,o)}var VV=/^[\t\n\f\r ]*$/;function jV(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&VV.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function GV(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&&(jV(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&Yg(r)&&Pt(r,"src",e.src??""),e.src!==void 0&&W0(),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,Pt(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)Pt(i,"src",o);else{const s=document.createElement("em-replace");Pt(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 XV(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),ia(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&ia(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function YV(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 KV(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 ZV(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var la=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function QV(e){const t=i=>{e.commit(i)},n={addFontFamilyClass:i=>js(i,t),clearLinkTags:i=>{co(i,t),Wr(t)}},r=(i,s)=>{const{settings:a}=i,l=Wc(s),c={setElementMobileWidth:_C,setElementMobileHeight:mi,setElementMobileBorder:R$,setElementMobileBorderRadius:M$,setElementMobileBoxShadow:P$,setElementMobileAlign:AC,setElementMobileTableAlign:I$,setElementMobileVerticalAlign:TC,setElementMobileDirection:D$,setElementMobileBackgroundColor:B$,setElementMobileBackgroundImage:H$,setElementMobileBackgroundPositionX:F$,setElementMobileBackgroundPositionY:$$,setElementMobileBackgroundRepeat:W$,setElementMobileBackgroundSize:q$,setElementMobilePadding:Ks,setElementMobileFontSize:kC,setElementMobileLineHeight:LC,setElementShow:NC},u={setElementBorder:Um,setElementBoxShadow:V7,setElementBorderRadius:qs},d={activeElement:s,setPercentsForColumns:Gd,setElementMobileHeight:mi},f={parseTableElementToModel:Ys,tableModelToHtml:Yt,updateTablePadding:l$,updateBackgroundPosition:c$,removeStyleProperty:v$,updateBorderRadius:S$,removeClassByPrefix:_$,getCellsWithClasses:d$,updateTableCellBackgroundByIds:f$,addClassToCellsByIds:m$,getExternalBorders:p$,mergeUniCells:A$,updateCellBordersByIds:h$,getExternalCorners:b$,updateCellBorderRadiusByIds:g$,updateCellPaddingByIds:y$,removeOuterBorders:w$,simplifyBorders:C$};switch(i.type){case"img":case"countdown":case"video":GV(a,{activeElement:s,getActiveEditElement:Xd,setCursorPosition:e.setCursorPosition,...u,...c});break;case"a":XV(a,{activeElement:s,textStyleProperties:la,toggleTextStyle:e.toggleTextStyle});break;case"table":Fz(a,{activeElement:s,...u,...c});break;case"td":case"structure":case"group":case"column":Wz(a,{activeElement:s,requestType:i.type,textStyleProperties:la,isElementListContainer:fz(s),isProgrammaticSelection:e.programmaticSelection,...u,...c,setContrastBlock:z$,setStructureBlocksWidth:qc,toggleTextStyle:e.toggleTextStyle,removeEditorTags:gi,addClassToSecondCell:Pq,wrapEditor:e.wrapEditor,addNewRange:$o});break;case"button":Iz(a,{activeElement:s,textStyleProperties:la,...u,...c,toggleTextStyle:e.toggleTextStyle,compareStrings:iv});break;case"div":Hz(a,{activeElement:s,...u,...c});break;case"vindent":YV(a,{activeElement:s,setElementMobileHeight:mi});break;case"var":KV(a,{activeElement:s,isVariableText:Sw});break;case"floatBlock":Vz(a,{activeElement:s,setElementMobileWidth:_C,setElementMobileContentWidth:O$,setElementMobileVerticalAlign:TC,setElementShow:NC});break;case"text":dV(a,{activeElement:s,textStyleProperties:la,toggleTextStyle:e.toggleTextStyle,collectVMLContent:Iw,updateVMLComments:Dw,removeClassesByPrefix:zm,createFontClassName:$m,...n,handleTextScriptSettings:pU,handleTextReplacer:gU,handleTextAnchor:wU,unwrapNestedTags:SR,wrapInTag:Yy,unwrapTag:wR,isRangeMatching:CR,splitWrapper:_R,cleanEmptyTags:AR,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:iv,setElementMobileFontSize:kC,setElementMobileLineHeight:LC,setElementMobileAlign:AC,updateTableStyle:mq,changeBullets:hq,changeBulletsColor:pq,changeBulletsSize:gq,changeBulletsItalic:yq,changeBulletsWeight:bq,changeBulletsStrikethrough:Eq,changeBulletsUnderline:vq,findElementWithSelectedText:ls,removeEditorTags:gi,isElementList:l.isList,isElementListOL:l.isListOL,classNameOl:l.classNameOl,classNameUl:l.classNameUl,commit:t});break;case"floatBlocksWidths":jz(a,d);break;case"floatBlocksPreset":Gz(a,d);break;case"floatBlocksValign":Xz(a,d);break;case"floatBlocksGap":Yz(a,d);break;case"floatBlocksGapMobile":Kz(a,d);break;case"carousel":oU(a,{activeElement:s,HTMLDocument:e.htmlDocument,setElementBorderRadius:qs,commit:t});break;case"accordion":sU(a,{activeElement:s,HTMLDocument:e.htmlDocument,setElementBorderRadius:qs,commit:t});break;case"social":{const m=hU(a,{activeElement:s,commit:t});if(m)return m;break}case"customTable":CU(a,{activeElement:s,activeCell:O.get("activeCell"),state:O,...f,wrapEditor:e.wrapEditor,addNewRange:$o,toggleTextStyle:e.toggleTextStyle,textStyleProperties:la,commit:t,...c})}return s},o=(i,s,a,l)=>{O.increment("activeElementLocked");const c=i;let u=i;e.commitLockedAsync().finally(()=>{const d=Pz(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=Xd();if(!a){s.type==="customTable"&&(r(s,null),e.commitLockedAsync());return}e.beforeApply?.(s,a);const l=Mz(a),c=r(s,a);e.afterApply?.(s,c);const u=ZV(s)?My():null;try{M1()}catch{}o(c,l,s,u?()=>tR(u,d=>e.htmlDocument.renderOnly(d)):void 0)}catch{}finally{Promise.resolve().then(()=>O.decrement("activeElementLocked"))}}}var JV=Bb,ej=3,Zh=Promise.resolve(),Qh={waiting:0},Jh=0;function j0(){return ct()?st().entityId:void 0}async function tj(e,t){let n=!1,r=!1;const o=()=>{n||(n=!0,e())},i=(async()=>{t&&await eM(),r=!0,await Wx(o)})();let s;const a=new Promise(l=>{s=setTimeout(()=>{r&&fy()||(fy()?n=!0:o(),l())},JV)});try{await Promise.race([i,a])}catch{o()}finally{clearTimeout(s)}}function G0(e,t){ly(()=>X0(e,t))||X0(e,t)}function X0(e,t){const n=Jh>0||JR();if(!n&&qx()&&(Qh={waiting:0}),Qh.waiting>=ej)return;const r=Qh;r.waiting++;const o=j0(),i=zx(),s=async()=>{try{await tj(()=>{j0()===o&&(e.send({operation:Le.APPLICATION_ACTION,action:t,...i!==void 0?{actionId:i}:{}}),i!==void 0&&Ux(i))},n)}finally{r.waiting--,n&&Jh--}};n?(Jh++,Zh=Zh.then(s,s)):Zh=s()}function Y0(e,t){return!!e&&Array.from(e.querySelectorAll('[em="atom"]')).some(n=>n!==t)}function Kc(e){e.nodeName==="#comment"&&e.textContent?.indexOf("mso")!==-1?e.remove():e.previousSibling&&Kc(e.previousSibling)}function ca(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(),ca(t)));else if(e.innerHTML.trim()==="")Kc(e),e.remove(),ca(t);else if(t&&!t.querySelector('div[style*="display"]')){for(const n of Array.from(e.childNodes))n.nodeName==="#text"&&n.textContent?.trim()===""?(Kc(n),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Kc(n),n.remove());e.innerHTML.trim()===""&&ca(e)}}function nj(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(),n.tagName!=="TD"&&!Y0(s,i)&&s?.textContent?.trim()===""&&(s.textContent="")}else{n.remove();const i=n.previousSibling;i&&i?.textContent?.trim()===""&&i.remove()}return ca(o),t.commit(),K.send({operation:"application_element_settings_close"}),!0}function rj(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}var oj={historyUndo:"undo",historyRedo:"redo"};function ij(e,t){const n=oj[e.inputType];return!n||!e.target?.closest?.("editor")?!1:(e.preventDefault(),e.stopPropagation(),G0(t.messageService,n),!0)}function sj(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=Ot(()=>{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&&!Y0(d,u)&&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 aj(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=Rt(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;for(const m of a){const h=s?.closest(m);if(h){l=h;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 m=c.textContent||"";return m[0]===" "||m[0]===" "?(t.setCursorPositionSimple(c,1),!0):(c.textContent=" "+m,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 K0(e,t){Dd(e,Ji,t)}function lj(e,t){if(e.key!=="Backspace"&&e.keyCode!==8||e.ctrlKey||e.metaKey||e.altKey)return!1;const n=window.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null,o=r?.collapsed?r.startContainer:null,i=Rt(o)?o:Rt(o?.parentNode)?o.parentNode:null,s=i?.previousSibling,a=s?.parentNode;if(!n||!i||Rd(i)||s?.nodeName!=="BR"||!a)return!1;e.preventDefault(),e.stopImmediatePropagation(),Ji(()=>i.remove());const l=s.previousSibling,c=Array.prototype.indexOf.call(a.childNodes,s);return a.removeChild(s),l?.nodeType===Node.TEXT_NODE?n.collapse(l,l.length):n.collapse(a,c),l?.nodeName==="BR"&&Dd(l,Ji),t.commit(!0),!0}var cj=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"];function uj(e,t){return!cj.includes(e.key)||Bd(Ly(),Ji)===null||t.commit(!1),!1}function dj(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;cy();const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A";s.collapsed||s.deleteContents(),Ny(s);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),K0(u,t),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),K0(u,t),o.commit(),!0}function fj(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?Vw(r,n.textContent||""):!1}function mj(e){const t=Ot(r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!$r(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&Vw(s,i.textContent||"")&&e(!1)})}),n=Ot(r=>{fj(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 hj=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function pj(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,m=s;function h(b,S,A){const L=!!b&&!!S&&S.tagName==="DIV"&&b.tagName==="EDITOR"&&b.parentElement===S&&S.childElementCount===1&&S.firstElementChild===b&&!Array.from(S.childNodes).some(I=>I!==b&&I.nodeType===Node.TEXT_NODE&&!!I.textContent?.trim()),x=!!b&&b.childElementCount===0&&Array.from(b.childNodes).some(I=>I.nodeType===Node.TEXT_NODE&&!!I.textContent?.trim()),N=!!b&&Ie(b).trim()===A.trim();if(!L||!x||!N||!b.hasAttribute("em-edit")||!S.parentNode)return;const $=S.parentNode,R=b.getAttribute("em-edit")||"active";for(;b.firstChild;)S.appendChild(b.firstChild);b.remove(),b.removeAttribute("em-edit"),S.setAttribute("em-edit",R),$.replaceChild(b,S),b.appendChild(S)}function p(b,S){try{return S.intersectsNode(b)}catch{const A=document.createRange();return A.selectNodeContents(b),S.compareBoundaryPoints(Range.END_TO_START,A)<0&&S.compareBoundaryPoints(Range.START_TO_END,A)>0}}function v(b){const S=b?.links||{},A=S.underline,L=S.color,x=typeof A=="boolean"?A?"underline":"none":"underline";return{color:typeof L=="string"&&L.trim()?L.trim():"inherit",textDecoration:x}}function w(b,S){if(!b||!S)return null;const A=S,L=Array.from(A.querySelectorAll("a"));A.tagName==="A"&&L.unshift(A);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 $ of L){const R=document.createRange();R.selectNodeContents($);const I=R.compareBoundaryPoints(x,b)<=0,Q=R.compareBoundaryPoints(N,b)>=0;if(I&&Q)return $}return null}function C(b,S,A){const L=Array.from(S?.getElementsByTagName("span")||[]).reverse();let x=!1;Ie(S)===b&&L.length&&(x=!0),L.forEach(N=>{const $=N.getAttribute("style"),R=!!$&&$.trim().length>0;let I=Array.from(N.attributes).filter(V=>V.name!=="style");if(!R&&I.length===1&&I[0].name==="em-edit"&&N.parentElement&&!N.parentElement.hasAttribute("em-edit")){const V=N.getAttribute("em-edit")||"active";N.parentElement.setAttribute("em-edit",V),N.removeAttribute("em-edit"),I=Array.from(N.attributes).filter(ee=>ee.name!=="style")}const Q=I.length>0;if(!R&&!Q){const V=Ie(N);if(N.childNodes.length===1&&N.childNodes[0].nodeType===3){const ee=N.childNodes[0];N.parentNode?.replaceChild(ee,N),A.isEditorTagOutside&&Ie(S)!==b&&ee.parentNode&&(A.range?.selectNode(ee),n(A.range))}else{const ee=Array.from(N.childNodes);ee.forEach(re=>{N.parentNode?.insertBefore(re,N)}),b===V&&(A.range=document.createRange(),A.range.setStartBefore(ee[0]),A.range.setEndAfter(ee[ee.length-1]),n(A.range)),N.parentNode?.removeChild(N)}}}),x&&(r(S,b),A.range.selectNode(S),n(A.range))}function T(b,S){if(b?.rangeCount>0){const A=b.getRangeAt(0),L=A.commonAncestorContainer;let x=A.startOffset,N=A.endOffset;for(;L.data&&x>0&&!/\s/.test(L.data[x-1]);)x--;for(;L.data&&N<L.length&&!/\s/.test(L.data[N]);)N++;S.setStart(L,x),S.setEnd(L,N),n(S)}}function y(b,S,A){ke(b,je(b).replaceAll(/<\/?strike[^>]*>/gi,"")),sn(b),b.parentNode&&(A.selectNode(b),n(A),r(b,S))}let g=!1;function E(){document.execCommand("styleWithCSS",!1,"true"),g=!0}function _(b,S){const A=HU(S.settings,j),L=S.settings.textColor??S.settings.textBackgroundColor;if(typeof L=="string"&&L.trim()!==""&&!j(L))return!1;const x=Wc(b),{classNameOl:N,classNameUl:$,classNameBullet:R,isListOL:I,isListUL:Q,isList:V}=x;V&&x.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(q=>{const ot=q.querySelector(":scope > div")||q.querySelector(":scope > editor div");ot&&ot.classList.add(`${R}`)}),b?.querySelectorAll(".em-element-path").forEach(q=>q.remove()),Bd(Ly(),Ji);const ee=Object.keys(S.settings)[0];let re=window.getSelection();if(!re||re.rangeCount===0){if(!b||!b.isConnected)return;const q=document.createRange();if(q.selectNodeContents(b),re=window.getSelection(),!re)return;re.removeAllRanges(),re.addRange(q)}let J=re.getRangeAt(0);const be=J.commonAncestorContainer;let de=be.nodeType===1?be:be.parentElement,Se=re.anchorNode?.nodeType===1?re.anchorNode:re.anchorNode?.parentElement,me=!1,X=Je();if(b||(b=re.anchorNode?.childNodes.length===1&&re.anchorNode.firstChild?.nodeType===1?re.anchorNode.firstChild:de,b.tagName==="EDITOR"&&(b=b.parentElement)),A.name==="textLink"&&A.value===""){const q=de?.closest?.("a, [href]")||null;q&&(J.selectNode(q),n(J),b=q)}if(A.name==="textUnderline"&&!A.value){let q=de.closest(["u","strike","[style*=text-decoration]","span","a"].find(ot=>de?.closest(ot))||"u");!q&&b?.tagName==="A"&&(q=b),q?.tagName==="A"&&(q.style.textDecoration="none",r(q,X),J.selectNode(q),n(J),b=q,me=!0)}let H=S.type==="button"?(b||Se)?.closest("a"):(b||Se)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const Y=S.settings.fontFamily;let Bt=null;const U=Array.from(H?.classList||[]).some(q=>(q.startsWith("em-font-")&&(Bt=q),q.startsWith("em-font-")&&q.includes(A.name==="textItalic"?"Italic":"Bold")));U&&(A.name==="textItalic"||A.name==="textStrong")&&Bt&&H?.classList.remove(Bt);const fn={range:J,isEditorTagOutside:!1},bt=(q=Je(),ot=H)=>{C(q,ot,fn)},mn=hz,Zt=S0,xn=(q,ot)=>{y(q,X,fn.range)};let Qt,lt;ee==="textColor"?Qt=lt="color":ee==="textBackgroundColor"&&(Qt="backgroundColor",lt="background-color");const kt=S.settings.hasOwnProperty("textColor")||S.settings.hasOwnProperty("textBackgroundColor"),yt=!!de?.closest("editor")||Ie(de)===X||Ie(de.querySelector("editor"))===X;fn.isEditorTagOutside=yt,S.settings.hasOwnProperty("textColor")&&A.value&&E();const lu=pz,er=c(),ba=u();if(XU({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j})||YU({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,fontFamilyArray:Y,removeClassesByPrefix:zm,createFontClassName:$m,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:bt}))return!1;const vo=de.closest(A.tags.find(q=>de?.closest(q))||"span");(J?.collapsed||!Je())&&(A.value?A.value&&yt&&(S.type==="button"||b.tagName==="A"&&vo?J.selectNodeContents(vo):T(re,J)):vo&&J.selectNodeContents(vo)),(S.type==="button"||b.tagName==="A"||b?.closest("a"))&&Je()&&Je()!==Ie(b)&&vo&&(S.settings.hasOwnProperty("textLink")||S.settings.hasOwnProperty("textUnderline"))&&(J.selectNode(vo),n(J),S.settings.hasOwnProperty("textUnderline")&&b.tagName==="A"&&(b.style.textDecoration=A.value?"underline":"none",me=!0)),re=window.getSelection(),J=re.getRangeAt(0),fn.range=J,X=Je(),Array.from(H?.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 ue=null;kt&<&&H?.style?.getPropertyValue?.(lt)?.trim()&&(Ie(H)===X&&(H.style[Qt]=j(A.value?.toString())||"",me=!0),Qt==="color"&&(de===H||b?.closest('[style*="color"]')===H)&&(ue=j(H.style[lt]),H.style.removeProperty(lt),!H?.hasAttribute("em-edit")&&V&&H&&er&&H.closest("tr")?.querySelector(`.${R}`)?.style.removeProperty(lt)));let hn=null,cu=null;if(kt&&Qt==="color"&&["A","LI"].includes(H?.tagName)){let q=H.parentElement;for(;q&&!["BODY","HTML","TD","TH"].includes(q.tagName);){const ot=q.style.getPropertyValue("color")?.trim();if(ot){hn=j(ot)||ot,cu=q,q.style.removeProperty("color");break}q=q.parentElement}}lt&&!(A.value.length===7||A.value.length===4)&&(me=!0),yt&&(!A.value&&A.name!=="fontSize"&&A.name!=="textLink"||A.value)&&(!(A.name==="textUnderline"||A.name==="textStrikethrough")||S.type!=="button")&&!me&&(A.name!=="fontSize"&&!kt&&Ie(H)===X?dr(A.command,!1,kt?A.value:A.name==="textLink"?" ":void 0):Ie(H)!==X&&(S.settings.hasOwnProperty("textColor")&&E(),dr(A.command,!1,kt?String(A.value):A.name==="textLink"?" ":void 0),S.settings.hasOwnProperty("textColor")&&A.value&&jU(H||de,String(A.value),j))),X=Je();{const q={parentElement:de,parentNode:Se,parentWrapper:H,selection:re,range:J};QU({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,activeElement:b,hasItalicClass:U,tempStyleClass:Bt,checkForWorkClass:mn,removeFormattingTags:ss,cleanEmptySpans:bt,mutableState:q,currentStyle:Qt,isProgrammaticSelection:er,findParentWithFontSizeAndTag:vz}),de=q.parentElement,Se=q.parentNode,H=q.parentWrapper,re=q.selection,J=q.range,fn.range=J}KU({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,activeElement:b,hasItalicClass:U,tempStyleClass:Bt,checkForWorkClass:mn,removeFormattingTags:ss,cleanEmptySpans:bt}),ZU({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,activeElement:b,hasItalicClass:U,tempStyleClass:Bt,checkForWorkClass:mn,removeFormattingTags:ss,cleanEmptySpans:bt});const ya={parentWrapper:H,range:J,selection:re};JU({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,activeElement:b,hasItalicClass:U,tempStyleClass:Bt,checkForWorkClass:mn,removeFormattingTags:ss,cleanEmptySpans:bt,request:S,findOutermostParentWithText:m,mutableState:ya}),H=ya.parentWrapper,J=ya.range,fn.range=J;const _i={parentWrapper:H,range:J,selection:re};if(eV({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,activeElement:b,hasItalicClass:U,tempStyleClass:Bt,checkForWorkClass:mn,removeFormattingTags:ss,cleanEmptySpans:bt,request:S,findOutermostParentWithText:m,cleanStrikesInElement:xn,mutableState:_i}),H=_i.parentWrapper,A.value===!1&&H){const q=window.getSelection(),ot=q&&q.rangeCount>0?q.getRangeAt(0):J,On={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[A.name];let Rn=!1;On&&On.forEach(we=>{Array.from(H.getElementsByTagName(we)).reverse().forEach(Lt=>{if(!p(Lt,ot))return;const tr=Ie(Lt);if(!tr||tr.trim().length===0)return;const dt=Lt.parentElement;Lt.hasAttribute("em-edit")&&dt&&!dt.hasAttribute("em-edit")&&dt.setAttribute("em-edit",Lt.getAttribute("em-edit")||"active"),Su(Lt),Rn=!0,h(dt,H,X)})}),Rn&&setTimeout(()=>{const we=document.querySelector("[em-edit]")||d(X)||(H?.isConnected?H:null);we&&r(we,X)},0)}if(A.value===!0&&H&&yt){const q={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},ot={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},On=q[A.name],Rn=ot[A.name];if(On&&Rn&&X&&X.trim().length>0){const we=H,Lt=Rn.some(Ur=>we.getElementsByTagName(Ur).length>0),tr=(we.style?.textDecoration||"").toLowerCase(),dt=(we.style?.textDecorationLine||"").toLowerCase(),Mn=tr.includes("underline")||dt.includes("underline"),Ht=tr.includes("line-through")||dt.includes("line-through"),vr=A.name==="textUnderline"&&Mn||A.name==="textStrikethrough"&&Ht,du=Ie(we)===X;if(!Lt&&!vr&&du){const Ur=document.createElement(On);for(;we.firstChild;)Ur.appendChild(we.firstChild);we.appendChild(Ur);try{const Pn=document.createRange();Pn.selectNodeContents(Ur),n(Pn),J=Pn,fn.range=Pn}catch{}setTimeout(()=>{const Pn=document.querySelector("[em-edit]")||d(X)||(we.isConnected?we:null);Pn&&r(Pn,X)},0)}}}const rt={parentWrapper:H,parentNode:Se,range:J,selection:re};tV({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,isColorChange:kt,tempColor:ue,outerContextColor:hn,outerContextElement:cu,stylePropretyName:lt,currentStyle:Qt,canselExecCommand:me,isProgrammaticSelection:er,request:S,setCustomColor:lu,checkForWorkClass:mn,cleanEmptySpans:bt,mutableState:rt}),H=rt.parentWrapper,Se=rt.parentNode;const zr={parentWrapper:H,parentNode:Se,range:J,selection:re};if(rV({parentElement:de,parentNode:Se,parentWrapper:H,currentSettings:A,isElementList:V,classNameBullet:R,isEditorTagOutside:yt,selectedText:X,range:J,selection:re,checkForTextNodes:Zt,commit:t,getInnerText:Ie,getSelectedText:Je,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:j,findOutermostParentWithText:m,activeElement:b,commonStyles:ba,cleanEmptySpansWithParent:bt,mutableState:zr}),J=zr.range,A.name==="textLink"&&A.value===!0&&yt&&H&&X?.trim().length>0){const q=zr.range||J,ot=X.trim(),On=[...H?Array.from(H.querySelectorAll("a")):[],...H?.parentElement?Array.from(H.parentElement.querySelectorAll("a")):[]],Rn=On.find(we=>Ie(we)?.trim()===ot)||On[0]||null;if(!(w(q,H)||w(q,H.parentElement)||Rn)&&q&&!q.collapsed){const we=document.createElement("a"),{color:Lt,textDecoration:tr}=v(ba);we.setAttribute("target","_blank"),we.setAttribute("href",""),we.setAttribute("new","true"),we.setAttribute("style",`color: ${Lt}; text-decoration: ${tr};`);let dt=!1;const Mn=H.querySelector("editor");if(Mn&&Ie(Mn)===X&&Mn.querySelector("a")===null){for(;Mn.firstChild;)we.appendChild(Mn.firstChild);Mn.appendChild(we),dt=!0}try{if(!dt){const Ht=q.extractContents();Ht.childNodes.length>0&&(we.appendChild(Ht),q.insertNode(we),dt=!0)}}catch{dt=!1}if(!dt&&Ie(H)===X){for(;H.firstChild;)we.appendChild(H.firstChild);H.appendChild(we),dt=!0}if(dt){try{const Ht=document.createRange();Ht.selectNodeContents(we),n(Ht),J=Ht,zr.range=Ht,fn.range=Ht}catch{}r(we,X)}}}const uu=A.name==="textUnderline"&&!A.value;if((!kt&&me||uu)&&bt(X),hj.has(A.name)){const q=zr.parentWrapper||H||d(X)||f();q&&bt(X,q)}V&&de.querySelectorAll(`tr td:first-child > div.${R}, tr td:first-child > editor div.${R}`).forEach(q=>{q.classList.remove(`${R}`)});const va=d(X);va?.hasAttribute("em-edit")||va?.setAttribute("em-edit","active"),t()}return function(S,A){try{return _(S,A)}finally{g&&(g=!1,document.execCommand("styleWithCSS",!1,"false"))}}}function Z0(e){return e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),cr(ts(e),([t])=>(t&&e.after(t),t))}function Q0(e,t){const n=Z0(e);t.commit(),n&&t.setCursorPosition(n)}function gj(e,t){Z0(e),t.commit()}function bj(e,t){Q0(e,t)}function yj(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 vj(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 J0(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function Ej(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?J0(n):e.remove(),t.commit(),n&&t.setCursorPosition(n)}function e_(e,t){return Nd(e),Gx(t)}function Sj(e,t){const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=ui(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=e_(e,e.querySelector("td")),l=[...e.parentNode.children].indexOf(e),c=ui(e),u=parseFloat(c?.style.paddingTop??"")||0,d=parseFloat(c?.style.paddingBottom??"")||0,f=parseFloat(c?.style.borderTopLeftRadius??"")||0,m=parseFloat(c?.style.borderTopRightRadius??"")||0,h=parseFloat(c?.style.borderBottomLeftRadius??"")||0,p=parseFloat(c?.style.borderBottomRightRadius??"")||0,v=n.querySelector("td");r>l?(or(v,"afterbegin",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${i+d}"></td></tr></table>`),v.prepend(...a),o&&(o.style.paddingTop=u+"px",o.style.borderTopLeftRadius=f+"px",o.style.borderTopRightRadius=m+"px",o.querySelector(":scope > .em-vindent-paddingTop")?.remove())):(or(v,"beforeend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${s+u}"></td></tr></table>`),v.append(...a),o&&(o.style.paddingBottom=d+"px",o.style.borderBottomLeftRadius=h+"px",o.style.borderBottomRightRadius=p+"px",o.querySelector(":scope > .em-vindent-paddingBottom")?.remove()))}else if(e.tagName==="DIV"){const a=e_(e,e),l=Array.prototype.indexOf.call(e.parentElement.children,e);xa(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function wj(e,t){const n=ui(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=ts(e);if(!c)return;Nd(e);const u=[...n?.querySelectorAll(':scope > table:not([em="atom"])')??[]].filter(Td).map(f=>({table:f,next:gy(f,"next"),prev:gy(f,"previous")})),d=u.length;u.forEach(({table:f,next:m,prev:h},p)=>{const[v]=De(c,!0),w=ui(v);if(w.style.paddingTop="0",w.style.paddingBottom="0",w.style.borderRadius="0",w.replaceChildren(f),p===0?(w.style.paddingTop=r+"px",w.style.borderTopLeftRadius=i+"px",w.style.borderTopRightRadius=s+"px"):p===d-1&&(w.style.paddingBottom=o+"px",w.style.borderBottomLeftRadius=a+"px",w.style.borderBottomRightRadius=l+"px"),m?.getAttribute("em")==="atom"&&m.querySelector("td")?.hasAttribute("height")){const C=parseFloat(m.querySelector("td").getAttribute("height"))/2;w.style.paddingBottom=C+"px"}if(h?.getAttribute("em")==="atom"&&h.querySelector("td")?.hasAttribute("height")){const C=parseFloat(h.querySelector("td").getAttribute("height"))/2;w.style.paddingTop=C+"px"}e.insertAdjacentElement("beforebegin",v)}),e.remove(),t.commit()}function Cj(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function _j(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function Aj(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&J0(r),e.after(n),t.commit(),K.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function Tj(e,t){Q0(e,t)}function kj(e,t){e.querySelector("[em-edit]")&&K.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function Lj(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 Nj(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 xj(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:Lj(r)};try{n.state.increment("activeElementLocked"),K.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{n.state.decrement("activeElementLocked")})}}function Oj(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=v9(i)+`
|
|
185
|
-
`+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function Rj(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"}),!cr(i,l=>{const c=Mj(e,l);if(!c)return!1;s&&Pj(s,n);for(const u of a.reverse())document.head?.prepend(u),document.head?.insertAdjacentHTML("afterbegin",`
|
|
186
|
-
`);return e.removeAttribute("em-state"),e.after(c),!0})){Ij(t.parentNode);return}n.commit(),n.setCursorPosition(e)}).catch(()=>{})}function Mj(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 Pj(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+`
|
|
187
|
-
`+[...o.querySelectorAll("style")].map(s=>s.innerHTML).join(`
|
|
188
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;i=t.cssbeautify(i,{indent:" ",autosemicolon:!0}),n.textContent=`
|
|
189
|
-
`+i+`
|
|
190
|
-
`}function Ij(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function Dj(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function Bj(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function Hj(e){const t=e.getAttribute("em-discuss-id");return t&&K.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function Fj(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 $j(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 p=o.closest(".em-narrow-table");if(p&&(Ln(p)||!p.innerHTML.trim())&&e.insertTextAtomIntoEmptyNarrowTable(p))return}const i=o.closest("a");if(i instanceof HTMLAnchorElement){const p=i.getAttribute("href")||i.href||"";if(ia(p)){const v=p.slice(1),w=document.querySelector(`a[name="${v}"]`);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(Ye.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(Ye.moveUp)){e.handleMoveBlockUp(f);return}if(f&&o.classList.contains(Ye.moveDown)){e.handleMoveBlockDown(f);return}if(f&&o.closest(".em-element-editor-widget-edit")){const p=f.querySelector("td");p&&e.applicationElementSettingsSet({elem:p}),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(Ye.merge)){e.handleMergeBlocks(f);return}if(f&&o.classList.contains(Ye.unmerge)){e.handleUnmergeBlocks(f);return}const m=o.closest('[em="group"]');if(m&&o.classList.contains(Ye.moveUp)){e.handleMoveGroupUp(m);return}if(m&&o.classList.contains(Ye.moveDown)){e.handleMoveGroupDown(m);return}if(m&&o.classList.contains(Ye.add)){e.handleAddGroup(m);return}if(m&&o.closest(".em-element-editor-widget-edit")){e.setCursorPosition(m);const p=m.tagName!=="TR"?m:m.querySelector("td");p&&e.applicationElementSettingsSet({elem:p});return}if(m&&o.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(m);return}if(m&&o.closest(".em-element-editor-widget-remove")&&o.closest(".of-group")){e.handleRemoveGroup(m);return}if(!o.closest(".em-editor-wrapper")&&!o.closest(".em-element-path")&&!o.closest(".em-element-vindent-remove")){const p=window.getSelection();if(p?.isCollapsed)e.setCursorPosition(o);else if(p&&p.rangeCount>0){const w=p.getRangeAt(0).commonAncestorContainer,C=e.findOutermostParentWithText(w);C&&e.setCursorPosition(C);const T=e.getParentElementOfSelection();T&&(o=T)}e.applicationElementSettingsSet({elem:o});const v=document.querySelector(".em-editor-wrapper");v&&(v.style.display="none"),e.setBlockGroupControlsPosition()}const h=o?.tagName==="TD"?o?.querySelector("div"):o?.closest("div")||o;o.closest(".em-element-custom-table")&&h?.tagName==="DIV"&&e.handleCustomTableClick(o,n)}}function Wj(e){const t=Ot(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")}),Nc(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 t_(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 n_(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((C,T)=>C+(T.colSpan||1),0))),f=new Map;for(let w=0;w<l.length;w++){u[w]=[];let C=0;const T=Array.from(l[w].cells);for(const y of T){for(;f.has(`${w}:${C}`);){const _=f.get(`${w}:${C}`);u[w][C]=_.cell,C++}const g=y.colSpan||1,E=y.rowSpan||1;for(let _=0;_<g&&C<d;_++){u[w][C+_]=y;for(let b=0;b<E;b++)if(w+b<l.length){const S=`${w+b}:${C+_}`;f.set(S,{cell:y,rowSpan:E,colSpan:g,startRow:w})}}C+=g}for(;C<d;){if(f.has(`${w}:${C}`)){const y=f.get(`${w}:${C}`);u[w][C]=y.cell}else u[w][C]=null;C++}}let m=-1;for(let w=0;w<u[c].length;w++)if(u[c][w]===i){m=w;break}if(m===-1)return;let h=0,p=1;const v=new Set;for(;h<t;){const w=r?c+p:c-p;if(w<0||w>=l.length)break;const C=u[w][m];if(!C){p++;continue}const T=`${w}:${m}`,y=f.get(T);if(C.tagName!=="TD"){p++;continue}if(v.has(C)){p++;continue}if(y&&y.startRow!==w){p++;continue}C.classList.add(n),v.add(C),h++,p++}}var r_=`
|
|
191
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
192
|
-
<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"/>
|
|
193
|
-
</svg>
|
|
194
|
-
`,o_=`
|
|
195
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
|
196
|
-
<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"/>
|
|
197
|
-
</svg>
|
|
198
|
-
`,qj=`
|
|
199
|
-
<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;">
|
|
200
|
-
<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"/>
|
|
201
|
-
</svg>
|
|
202
|
-
`,zj=`
|
|
203
|
-
<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;">
|
|
204
|
-
<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"/>
|
|
205
|
-
</svg>
|
|
206
|
-
`,Uj=`
|
|
207
|
-
<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;">
|
|
208
|
-
<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"/>
|
|
209
|
-
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
210
|
-
<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"/>
|
|
211
|
-
</svg>
|
|
212
|
-
`,Vj=`
|
|
213
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
|
|
214
|
-
<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"/>
|
|
215
|
-
</svg>
|
|
216
|
-
`,jj=`
|
|
217
|
-
<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;">
|
|
218
|
-
<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"/>
|
|
219
|
-
</svg>
|
|
220
|
-
`,Gj=`
|
|
221
|
-
<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;">
|
|
222
|
-
<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"/>
|
|
223
|
-
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
224
|
-
<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"/>
|
|
225
|
-
</svg>
|
|
226
|
-
`,Xj=`
|
|
227
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
228
|
-
<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"/>
|
|
229
|
-
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
230
|
-
<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"/>
|
|
231
|
-
</svg>
|
|
232
|
-
`,Yj=`
|
|
233
|
-
<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;">
|
|
234
|
-
<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"/>
|
|
235
|
-
<circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
|
|
236
|
-
<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"/>
|
|
237
|
-
</svg>
|
|
238
|
-
`,Kj=`
|
|
239
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
240
|
-
<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"/>
|
|
241
|
-
</svg>
|
|
242
|
-
`,Zj=`
|
|
243
|
-
<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;">
|
|
244
|
-
<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"/>
|
|
245
|
-
</svg>
|
|
246
|
-
`,i_=`
|
|
247
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
248
|
-
<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"/>
|
|
249
|
-
</svg>
|
|
250
|
-
`;function Qj(e,t,n,r){const o=document.querySelector(".table-menu"),i=o?.closest("table");if(!i)return;const s=i?.querySelector(`.${ae}`),a=Ys(i),{row:l}=dh(a,ae),{row:c,isOverlapped:u}=gC(a,ae),{isOverlapped:d}=bC(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 Jj={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"},Kt=()=>window.Locale||Jj;function eG(e,t){e.forEach(n=>{t.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))})}function tG(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(`.${Xe}`).forEach(C=>{C.classList.remove(Xe)});const r=[h1,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=P({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,m=1;const h=()=>({isDirectionUP:O.get("isDirectionUP"),isDirectionDOWN:O.get("isDirectionDOWN"),isDirectionLEFT:O.get("isDirectionLEFT"),isDirectionRIGHT:O.get("isDirectionRIGHT"),actualTargetCount:O.get("actualTargetCount")});c.addEventListener("mousedown",Ot(C=>{const T=C.target.tagName.toUpperCase();if(C.button===0&&T!=="UL"&&T!=="LI"&&T!=="SVG"&&T!=="PATH"&&T!=="CIRCLE"){f=!0;const y=c.querySelector(`.${ae}`);document.querySelectorAll(`.${ie}`)?.forEach(g=>{g.classList.remove(ie),y?.classList.remove(ae)})}})),c.addEventListener("mouseup",C=>{f=!1,C.target.closest("td")?.classList.contains("remove-basic-cell")&&O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1})}),c.addEventListener("mouseover",Ot(C=>{const T=c.querySelector(`.${ae}`);m=c.querySelectorAll(`.${ie}`).length,m=m===0?1:m;const y=C.target;if(f&&y.closest("TD")&&T){const g=y.closest("TD");c.querySelectorAll(`.${zn}`).forEach(me=>me.classList.remove(zn)),m===1&&c.querySelectorAll(`.${ie}`).forEach(me=>me.classList.remove(ie)),g.classList.add(zn);const E=g.closest(".em-element-custom-table");if(!E)return;let _=Ys(E);const b=dh(_,ae);if(!b)return;const{row:S,col:A}=b,{row:L,col:x,isOverlapped:N}=gC(_,ae),{row:$,col:R,isOverlapped:I}=bC(_,ae);!o&&!i&&m===1&&!(N||I)&&(E.querySelectorAll(`.${ie}`).forEach(me=>me.classList.remove(ie)),g.classList.add(ie));const Q=dh(_,zn);if(!Q)return;const{row:V,col:ee}=Q;if(E.querySelectorAll(`.${zn}`).forEach(me=>me.classList.remove(zn)),S!==V&&A!==ee){E.querySelectorAll(`.${ie}`).forEach(me=>me.classList.remove(ie)),o=!1,i=!1;return}const{isDirectionUP:re,isDirectionDOWN:J,isDirectionLEFT:be,isDirectionRIGHT:de}=h();if(!o&&!i&&!g.classList.contains("remove-basic-cell")&&(O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),S===V?(o=!0,i=!1,A>ee&&O.set("isDirectionLEFT",!0),A<ee&&O.set("isDirectionRIGHT",!0)):A===ee&&(i=!0,o=!1,S>V&&O.set("isDirectionUP",!0),S<V&&O.set("isDirectionDOWN",!0))),S===V&&(J||re)||A===ee&&(de||be)||A===ee&&S===V){O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1}),o=!1,i=!1;return}if(N&&x!==null){const{isDirectionRIGHT:me,isDirectionLEFT:X}=h();if(me&&x-ee<=0&&x>A){E.querySelectorAll(`.${ie}`).forEach(H=>H.classList.remove(ie));return}if(X&&ee-x<=0&&x<A){E.querySelectorAll(`.${ie}`).forEach(H=>H.classList.remove(ie));return}}if(I&&$!==null){const{isDirectionDOWN:me,isDirectionUP:X}=h();if(me&&$-V<=0&&$>S){E.querySelectorAll(`.${ie}`).forEach(H=>H.classList.remove(ie));return}if(X&&V-$<=0&&$<S){E.querySelectorAll(`.${ie}`).forEach(H=>H.classList.remove(ie));return}}if(S===V&&o){i=!1;const{isDirectionRIGHT:me,isDirectionLEFT:X}=h();if(me){const H=ee-A;if(O.set("actualTargetCount",Oc(_,V,ee,S,A,!0)),H<0){O.set("isDirectionRIGHT",!1),o=!1,i=!1;return}E.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),t_(`.${ae}`,O.get("actualTargetCount"),ie,!0)}if(X){const H=A-ee;if(O.set("actualTargetCount",Oc(_,S,A,V,ee,!0)),H<0){O.set("isDirectionLEFT",!1),o=!1,i=!1;return}E.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),t_(`.${ae}`,O.get("actualTargetCount"),ie,!1)}E.querySelectorAll(`.${zn}`).forEach(H=>H.classList.remove(zn))}if(A===ee&&i){o=!1;const{isDirectionDOWN:me,isDirectionUP:X}=h();if(me){const H=V-S;if(O.set("actualTargetCount",Oc(_,V,ee,S,A,!1)),H<0){O.set("isDirectionDOWN",!1),o=!1,i=!1;return}E.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),n_(`.${ae}`,O.get("actualTargetCount"),ie,!0)}if(X){const H=S-V;O.set("actualTargetCount",Oc(_,S,A,V,ee,!1)),H<0&&(O.set("isDirectionUP",!1),o=!1,i=!1),E.querySelectorAll(`.${ie}`).forEach(Y=>Y.classList.remove(ie)),n_(`.${ae}`,O.get("actualTargetCount"),ie,!1)}E.querySelectorAll(`.${zn}`).forEach(H=>H.classList.remove(zn))}const Se=E.querySelectorAll(`.${ie}`);g.classList.contains("remove-basic-cell")&&Se?.length>1&&(Se?.forEach(me=>{me.classList.remove(ie)}),o=!1,i=!1)}})),nG(d,c,u,t,r);const p=s.closest("td");p.classList.add(ae);function v(C){const T=C.target;!u.contains(T)&&!d.contains(T)&&(d.remove(),p&&(document.querySelectorAll(`.${ie}`)?.forEach(y=>{y.classList.remove(ie)}),document.querySelectorAll(`.${Xe}`).forEach(y=>{y.classList.remove(Xe)}),p.classList.remove(ae)),document.removeEventListener("click",w))}const w=Ot(v);return document.addEventListener("click",w),!0}function nG(e,t,n,r,o){const i=Qj;function s(w){const C=w.querySelector("ul"),T=w.getAttribute("data-open")==="true",y=r.target.closest("td")?.classList.contains(ae),g=t.querySelectorAll(`.${ie}`);y&&g?.length===0&&O.update({isDirectionUP:!1,isDirectionDOWN:!1,isDirectionLEFT:!1,isDirectionRIGHT:!1});const{isDirectionUP:E,isDirectionDOWN:_,isDirectionLEFT:b,isDirectionRIGHT:S}={isDirectionUP:O.get("isDirectionUP"),isDirectionDOWN:O.get("isDirectionDOWN"),isDirectionLEFT:O.get("isDirectionLEFT"),isDirectionRIGHT:O.get("isDirectionRIGHT")};i(E,_,b,S),e.querySelectorAll("[data-open]").forEach(A=>{A!==w&&A.getAttribute("data-open")==="true"&&(A.setAttribute("data-open","false"),A.querySelector("ul").style.display="none")}),T||(w.setAttribute("data-open","true"),C.style.display="block")}function a(w){const C=w.querySelector("ul");w.getAttribute("data-open")==="true"&&(w.setAttribute("data-open","false"),C.style.display="none")}function l(w){w.stopPropagation(),w.preventDefault();const C=w.target,T=C.closest("li"),y=T?.getAttribute("data-id"),g=T?.closest("tr"),E=T?.closest("td");g?.classList.add(h1),E?.classList.add(ae);const _=C.closest("table");if(!T||!_)return;const b=Ys(_),S=_.querySelectorAll(`.${ie}`).length;switch(y){case"add-bottom-row":{const N=fC(b,ae,!1);Pe(_,Yt(N));break}case"add-top-row":{const N=fC(b,ae,!0);Pe(_,Yt(N));break}case"remove-row":{const N=o$(b,ae);Pe(_,Yt(N));break}case"merge-top-cell":{const N=S===0?pC(b,ae,!0,S+1):vC(b,ae,ie);Pe(_,Yt(N));break}case"merge-bottom-cell":{const N=S===0?pC(b,ae,!1,S+1):vC(b,ae,ie);Pe(_,Yt(N));break}case"split-horizontal-cell":{const N=a$(b,ae);Pe(_,Yt(N));break}case"add-left-column":{const N=mC(b,ae,!0);Pe(_,Yt(N));break}case"add-right-column":{const N=mC(b,ae,!1);Pe(_,Yt(N));break}case"merge-right-cell":{const N=S===0?hC(b,ae,!1,S+1):yC(b,ae,ie);Pe(_,Yt(N));break}case"merge-left-cell":{const N=S===0?hC(b,ae,!0,S+1):yC(b,ae,ie);Pe(_,Yt(N));break}case"split-vertical-cell":{const N=s$(b,ae);Pe(_,Yt(N));break}case"remove-column":{const N=i$(b,ae);Pe(_,Yt(N));break}}const A=T.closest("ul");A.parentElement.setAttribute("data-open","false"),A.style.display="none",e.querySelectorAll('[data-open="true"]').forEach(N=>{N.setAttribute("data-open","false"),N.querySelector("ul").style.display="none"});const L=document.querySelector(`.${ae}`),x=document.querySelector(".table-menu");L?.classList.remove(ae),x?.remove(),document.querySelectorAll(`.${ie}`).forEach(N=>{N.classList.remove(ie)}),eG(o,_),Zr()}function c(w){s(w.currentTarget)}function u(w){a(w.currentTarget)}const d=P({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-edit",HTMLcontent:r_,title:"Колонки"});d.setAttribute("data-open","false");const f=P({targetElement:d,insertType:"append",tag:"ul",style:g1}),m={targetElement:f,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:p1};P({...m,HTMLcontent:r_,title:"",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px","data-id":"menu-item"}),P({...m,HTMLcontent:qj,title:Kt().INSERT_COLUMN_BEFORE_TABLE,"data-id":"add-left-column"}),P({...m,HTMLcontent:zj,title:Kt().INSERT_COLUMN_AFTER_TABLE,"data-id":"add-right-column"}),P({...m,HTMLcontent:Gj,title:Kt().MERGE_RIGHT_CELL_TABLE,"data-id":"merge-right-cell"}),P({...m,HTMLcontent:Uj,title:Kt().MERGE_LEFT_CELL_TABLE,"data-id":"merge-left-cell"}),P({...m,HTMLcontent:Zj,title:Kt().SPLIT_CELL_TABLE,"data-id":"split-vertical-cell"}),P({...m,HTMLcontent:i_,title:Kt().REMOVE_COLUMN_TABLE,"data-id":"remove-column"}),f.addEventListener("click",l),d.addEventListener("mouseenter",c),d.addEventListener("mouseleave",u);const h=P({targetElement:e,insertType:"append",style:"cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",className:"em-element-editor-widget-clone",HTMLcontent:o_,title:"Строки"});h.setAttribute("data-open","false");const p=P({targetElement:h,insertType:"append",tag:"ul",style:g1}),v={targetElement:p,insertType:"append",tag:"li",className:"em-element-editor-widget-group",style:p1};P({...v,HTMLcontent:o_,title:Kt().EDIT_ATOM||"Edit",style:"padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px"}),P({...v,HTMLcontent:Vj,title:Kt().INSERT_ROW_BEFORE_TABLE,"data-id":"add-top-row"}),P({...v,HTMLcontent:jj,title:Kt().INSERT_ROW_AFTER_TABLE,"data-id":"add-bottom-row"}),P({...v,HTMLcontent:Xj,title:Kt().MERGE_TOP_CELL_TABLE,"data-id":"merge-top-cell"}),P({...v,HTMLcontent:Yj,title:Kt().MERGE_BOTTOM_CELL_TABLE,"data-id":"merge-bottom-cell"}),P({...v,HTMLcontent:Kj,title:Kt().SPLIT_CELL_TABLE,"data-id":"split-horizontal-cell"}),P({...v,HTMLcontent:i_,title:Kt().REMOVE_ROW_TABLE,"data-id":"remove-row"}),p.addEventListener("click",l),h.addEventListener("mouseenter",c),h.addEventListener("mouseleave",u)}function rG(){Lc({scrollTop:O.get("scrollTop")})}function oG(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=$j({getLockEditor:()=>!!O.get("lockEditor"),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:Sl,findOutermostParentWithText:jd,setBlockGroupControlsPosition:rG,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:i=>nj(i,{getElementParent:s=>Mc(s),setCursorPosition:e.setCursorPosition,getVariableByIcon:vc,commit:n}),handleCloneAtom:i=>gj(i,r()),handleMoveBlockUp:i=>yj(i,r()),handleMoveBlockDown:i=>vj(i,r()),handleRemoveBlock:i=>Ej(i,r()),handleCloneBlock:i=>bj(i,r()),handleCopyBlock:(i,s)=>Oj(i,s,{HTMLDocument:t}),handlePasteBlock:(i,s)=>Rj(i,s,{HTMLDocument:t,parseFromString:De,getOuterHtml:on,minify:io,cssbeautify,insertAdjacentHTML:or,setBlockMaxWidth:a=>Oh(a,t),setFloatBlocksWidth:a=>Nh(a,t),checkBlockAdaptivity:yc,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:O.get("emailWidth"),appName:O.get("appName")}),handleMergeBlocks:i=>Sj(i,r()),handleUnmergeBlocks:i=>wj(i,r()),isAddBlockMenuClick:Nj,handleAddBlockMenu:(i,s)=>xj(i,s,{removeAllAttributes:Tr,state:O,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:i=>WF(i,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:i=>Cj(i,r()),handleMoveGroupDown:i=>_j(i,r()),handleAddGroup:i=>Aj(i,r()),handleCloneGroup:i=>Tj(i,r()),handleRemoveGroup:i=>kj(i,r()),isDiscussViewMode:Dj,isDiscussSetTargetMode:Bj,handleDiscussViewClick:Hj,handleDiscussSetTargetClick:i=>Fj(i,{makeId:oM,commit:n}),handleCustomTableClick:tG});document.onclick=Ot(o),Wj({commit:n,messageService:e.messageService})}function s_(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function iG(e){return!e.closest(".em-element-editor-widget")}function sG(e,t){if(t.lockEditor||!e.isTrusted)return!1;const n=P0();if(!n)return!1;const r=e.target;if(!(r instanceof HTMLElement)||!iG(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;V0(s_(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;z0(s_(r,o.settings),o,t.blockDropCtx)}else return!1;if(!P0())return e.preventDefault(),e.stopPropagation(),q0(),t.commit(),!0}catch{return!1}return!1}var a_="application/x-emailmaker-social-reorder";function ep(e){return e.closest('table[em-type="social"]')}function l_(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function c_(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function aG(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 lG(e,t){const n=aG(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 cG(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=l_(r);if(!o)return;const i=c_(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(a_,l),a.effectAllowed="move"}function uG(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(a_);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=l_(s);if(!a)return!1;const l=c_(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),lG(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function dG(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function mo(){return!!O.get("lockEditor")}function fG(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=GC(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function mG(e,t,n){if(!mo())try{e.preventDefault(),e.stopPropagation();const r=NV(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||uG(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")||"{}");z0(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{V0(e,{...t.atomDropContext(),mutableState:n})}catch{}}q0(),t.commit()}finally{Promise.resolve().then(()=>{O.decrement("activeElementLocked"),fG(t)})}}function hG(e){const{dragState:t}=e,n=(r,o,i)=>document.addEventListener(r,Ot(o),i);document.addEventListener("drag",r=>r.preventDefault(),!1),n("dragstart",r=>cG(r,{lockEditor:mo()}),!0),n("dragstart",r=>xV(r,{lockEditor:mo(),commit:o=>{e.commit(o)},messageService:e.messageService,mutableState:t}),!1),n("dragover",r=>RV(r,{lockEditor:mo(),mutableState:t}),!1),n("dragenter",r=>MV(r,{lockEditor:mo(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),n("dragleave",r=>DV(r,{lockEditor:mo(),mutableState:t}),!1),n("drop",r=>mG(r,e,t),!1),n("dragend",r=>OV(r,{lockEditor:mo(),messageService:e.messageService}),!1)}function pG(e){const{htmlDocument:t}=e,n=f=>e.commit(f),r=dG(),o=e.commonStylesApply??(f=>tC(f,m=>e.commit(m))),i=f=>{yw(f,()=>e.commit())},s=f=>Oh(f,t),a=f=>Nh(f,t),l=()=>({messageService:e.messageService,isJsonString:nM,getOuterHtml:on,minify:io,cssbeautify,HTMLDocument:t,_setDocumentStyles:(f,m)=>Fm(f,m),commonStylesApply:o,commonStylesApplyToBlock:nh,setImageWidth:xm,fitMovedImage:bw,setFloatBlocksWidth:a,fitImagesToColumns:xh,insertCountdown:i}),c=()=>({...l(),lockEditor:!!O.get("lockEditor"),state:O,commit:n,emailWidth:O.get("emailWidth")??null,parseFromString:f=>De(f),isTableElement:CL,uptimeCountdown:Om,setBlockMaxWidth:s,checkBlockAdaptivity:yc,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=>De(f),getOuterHtml:on,HTMLDocument:t,minify:io,cssbeautify,insertAdjacentHTML:(f,m,h)=>yy(f,m,h),messageService:e.messageService,setDocumentStyles:f=>Fm(f,{minify:io,cssbeautify,HTMLDocument:t}),setImageWidth:xm,commonStylesApply:o,commonStylesApplyToBlock:nh,insertCountdown:i,uptimeCountdown:Om,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:xh,checkBlockAdaptivity:yc,setAtomReplaced:f=>{r.atomReplaced=f},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",Ot(f=>{O.get("lockEditor")||sG(f,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})}),!0),hG({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}function gG(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 bG(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 yG(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 u_='<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>',d_='<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>',vG='<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>',EG='<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>',Zc='<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>',SG='<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>',wG='<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>',ua='<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>',f_='<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>',CG='<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 xe(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 Qc={getLocale:Zs,commit:Zr},_G=".em-prevent-action";function AG(){return O.get("emailWidth")||475}function TG(){return O.get("copyPasteEnabled")||!1}function kG(){return O.get("saveBlockEnabled")||!1}function LG(){return O.get("blocksAddPanelEnabled")||!1}function NG(){return O.get("codeMode")||!1}var m_=".em-mob-wrap, .noresp-em-mob-wrap";function h_(e){return Array.from(document.querySelectorAll(e)).find(kw)??null}function Jc(e,t){const n=Qc.getLocale(),r=AG(),o=TG(),i=kG(),s=LG(),a=NG();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=P({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=P({targetElement:l,insertType:"append",className:"em-element-editor-widget"});P({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:xe(tp,`${Ne} ${Ye.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:xe(ua,`${Ne} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:xe(Zc,`${Ne} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:xe(np,`${Ne} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),Nc(Qc.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=P({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=P({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=P({targetElement:c,insertType:"append",className:"em-element-editor-group"});if(P({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:xe(tp,`${Ne} ${Ye.drag}`),title:n.REORDER_BLOCK}),P({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:xe(d_,`${Ne} ${Ye.moveUp}`),title:n.REORDER_BLOCK_UP}),P({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:xe(u_,`${Ne} ${Ye.moveDown}`),title:n.REORDER_BLOCK_DOWN}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:xe(ua,`${Ne} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const h=P({targetElement:c,insertType:"append",className:"em-element-editor-group"});P({targetElement:h,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:xe(Zc,`${Ne} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),P({targetElement:h,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:xe(EG,`${Ne} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),P({targetElement:h,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:xe(vG,`${Ne} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else P({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:xe(Zc,`${Ne} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(_G))return;const d=h_('[em-edit="active"]'),f=h_('[em-state^="active"]');if(d&&f&&(d.querySelector(m_)&&f.querySelector(m_)||d.closest(".em-structure")&&f.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&P({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:xe(SG,`${Ne} ${Ye.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),Fs(c.closest('[em="block"]')??c).flatMap(h=>Array.from(h.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&P({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:xe(wG,`${Ne} ${Ye.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&P({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:xe(CG,`${Ne} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:xe(np,`${Ne} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const h=P({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&h.classList.add("out-of-iframe"),P({targetElement:h,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${xe(f_,`${Ne} ${Ye.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK}),P({targetElement:h,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}),P({targetElement:h,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}),P({targetElement:h,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}),P({targetElement:h,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}),P({targetElement:h,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})}Nc(Qc.commit);const m=e.closest('[em="block"]');m&&(m.onmouseleave=function(){bi(void 0)})}if(t==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const l=P({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=P({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=P({targetElement:c,insertType:"append",className:"em-element-editor-group"});P({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:xe(tp,`${Ne} ${Ye.drag}`),title:n.REORDER_BLOCK}),P({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:xe(d_,`${Ne} ${Ye.moveUp}`),title:n.REORDER_BLOCK_UP}),P({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:xe(u_,`${Ne} ${Ye.moveDown}`),title:n.REORDER_BLOCK_DOWN}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:xe(f_,`${Ne} ${Ye.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:xe(ua,`${Ne} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),P({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:xe(Zc,`${Ne} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&P({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:xe(np,`${Ne} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),Nc(Qc.commit)}}function bi(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 xG(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if(bi(n),n.querySelector(".em-element-editor.of-atom")||Jc(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&&Jc(r.tagName==="TR"?r.querySelector("td"):r,"block"),t.setBlockGroupControlsPosition()}}else(n=e.closest('[em="block"]'))?(bi(n),n.querySelector(".em-element-editor.of-block")||(Jc(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&(bi(n),n.querySelector(".em-element-editor.of-group")||(Jc(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:da,NEW_EDITOR:rp}=y0,{TRIM_SPACES:fa,EMPTY_TEXT:OG}=v0;function RG(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}`),m=n.closest(`table.${c}`)?c:u;if(!f)return!0;const h=ll(f).counterpart(n)??n,p=_q(h,m);if(!p)return!0;const{firstCellText:v,firstCellHtmlNoText:w,wrappedSecondCellHtml:C}=p;return o==="start"||o==="end"?MG(n,f,m,c,u,o,v,w,C,a):o==="inside"&&PG(n,f,m,c,a),l(),s(),!0}function MG(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add(da);const d=i0(a,s),f=i0(l," "),m=i==="end"?Mq(f):f,h=cl(t),p="<tr>"+d+m+"</tr>",v=gi(h),w=Aq(v,p,da,i==="start"),C=gi(w);Qr(t),Pe(t,C);const T=t.querySelector(`.${da}`)?.closest("tr"),y=i==="start"?T?.previousElementSibling:T?.nextElementSibling;y&&s0(y),n===r&&Sh(t),Rq(t,r,o,fa);const g=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return g&&p_(g,t,c),g}function PG(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)?xq(s,a,l):null;return c?(s0(c.row),s.after(c.row),Qr(t),Nq(t),c.content.classList.add(rp),n===r&&Sh(t),p_(c.content,t,o,!0),c.content):null}function p_(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&pi(e,je(e).replace(fa,"")),OG.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),es(s,a)}}r&&o&&Ut(()=>o.focus())}function IG(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,m=(e.keyCode===38||e.key==="ArrowUp")&&o==="start",h=(e.keyCode===40||e.key==="ArrowDown")&&(!s&&o==="end"||s&&o==="start");if(!(m||h)||!f||!i||!n)return!1;e.preventDefault(),e.stopImmediatePropagation();const p=e.key==="ArrowUp"?"ArrowUp":"ArrowDown",v=n.closest(`table.${u}`)||n.closest(`table.${d}`);if(!v)return!0;const w=n.querySelector("div");w&&w.classList.add(da);const C=cl(v),T=gi(C),y=Oq(T,da,rp,p);Qr(v),Pe(v,y);const g=v.querySelector(".remove-new-editor-element");if(g){l(g,!0);const E=v.querySelector("editor"),_=E?.querySelector("div")?.childNodes[0],b=window.getSelection();if(b&&b.rangeCount>0){const S=b.getRangeAt(0);if(_&&_.nodeType===Node.TEXT_NODE){const A=_.textContent||"";S.setStart(_,A.replace(fa,"").length)}else E&&S.selectNodeContents(E);S.collapse(!0),es(b,S)}}return c(),a(),!0}function DG(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function BG(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,m=(...be)=>Ut(()=>t.setCursorSafely(...be)),{classNameOl:h,classNameUl:p,isList:v}=o;if(!((n?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&v)||!(!s||s&&(i==="start"||a&&i==="inside"||a&&i==="end"))||!r||!l)return!1;e.preventDefault(),e.stopImmediatePropagation();const w=r.closest(`table.${h}`)?h:p,C=l.closest("tr");if(!C)return!0;const T=C.previousElementSibling;if(!T&&!s)return!0;const y=s?r.querySelector("div"):C.querySelector("tr td:nth-child(2)")?.querySelector("div"),g=y?je(y):"",E=g?g.split(" ")[0]:"";E.replace(fa,"");const _=T?.querySelector("tr td:nth-of-type(2)");if(!_)return!0;const b=_.querySelector("div");if(!b)return!0;b.classList.add(rp);const S=je(b),A=`${S}${g}`;Qr(C.parentNode??C),C.remove();const L=b.closest(`table.${h}`)||b.closest(`table.${p}`);if(!L)return!0;const x=je(L),N=gi(x);Pe(L,N),w===h&&Sh(L);const $=L.querySelector(".remove-new-editor-element");if(!$)return d(),c(),!0;const R=A.replace(fa,"");pi($,`${R} `),u($,!0);const I=$.closest("editor");if(!I)return d(),c(),!0;const Q=window.getSelection(),V=document.createRange(),ee=I.querySelector("div");if(!ee||!Q)return d(),c(),!0;const re=I.textContent||"",J=E?re.indexOf(E):-1;if(J!==-1&&E){const be=f(ee,J);if(be)m(V,Q,be.node,be.offset);else{const de=ee.childNodes[0];de&&m(V,Q,de,0)}}else{const be=document.createElement("div");be.innerHTML=S;const de=(be.textContent||"").length,Se=f(ee,de);if(Se)m(V,Q,Se.node,Se.offset);else{const me=document.createTreeWalker(ee,NodeFilter.SHOW_TEXT,null);let X=null;for(;me.nextNode();)X=me.currentNode;X&&m(V,Q,X,(X.textContent||"").length)}}return Ut(()=>I.focus()),d(),c(),!0}function HG(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 FG(e){if(!e)return!1;const t=e.closest("li");return $c(t)}function $G(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 WG(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 qG(e){const t=window.getSelection();if(!t||t.rangeCount===0)return je(e);const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset),g_(e,r)}function g_(e,t){const n=document.createElement("div");return n.appendChild(t.cloneContents()),nn(e,n),Ho(n),ze(n)}function zG(e){const t=window.getSelection();if(!t||t.rangeCount===0)return"";const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setStart(n.endContainer,n.endOffset),g_(e,r)}function yi(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function ma(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function UG(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML=" ",ma(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),yi(r),r}function VG(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=" ",ma(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(),yi(a),a}function jG(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(!FG(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=$G(i),l=WG(i,s);switch(a.position){case"empty":GG(i,s,l,t);break;case"start":XG(i,s,t);break;case"end":YG(i,s,t);break;case"middle":KG(i,s,t)}return t.commit(),!0}function GG(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",Kn.LIST_ITEM),o.innerHTML=" ",e.after(o),ma(e,o),yi(o);break;case"first":UG(e,t);break;case"middle":VG(e,t)}}function XG(e,t,n){const r=document.createElement("li");r.setAttribute("style",Kn.LIST_ITEM),r.innerHTML=" ",e.before(r),yi(e)}function YG(e,t,n){const r=document.createElement("li");r.setAttribute("style",Kn.LIST_ITEM),r.innerHTML=" ",e.after(r),ma(e,r),yi(r)}function KG(e,t,n){const r=qG(e),o=zG(e);pi(e,r||" ");const i=document.createElement("li");i.setAttribute("style",Kn.LIST_ITEM),pi(i,o||" "),e.after(i),ma(e,i),yi(i)}function ZG(e){const t=r=>lm({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?Cq(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),f=o.target,m=Wc(f),{isList:h}=m,p=d?.textContent===l?.textContent,v=l?v0.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 C=rj(o,!!w);if(C){o.preventDefault(),G0(e.messageService,C);return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}if(lj(o,{commit:e.commit}))return;uj(o,{commit:e.commit}),o.key==="Enter"&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.isComposing&&cy();const T={getElementParent:b=>Mc(b),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>bi(void 0),getVariableByIcon:vc,removeEmptyParents:ca,getAllComments:y7,isVariableComment:ww,getVariableIcon:b=>S7(b),commit:e.commit,messageService:e.messageService};if(sj(o,h,u,T))return;if(o.keyCode===27){const b=document.querySelector(".em-editor-wrapper");b?.style&&(b.style.display="none"),Tr("em-edit"),Ut(()=>document.querySelectorAll("editor").forEach(S=>S.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 y=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&y&&(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"})),jG(o,{commit:e.commit})||dj(o,l,h,p,{commit:e.commit}))return;if(w&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const b=S=>{vl(S,!1,n(),t,e.commit),document.removeEventListener("paste",b)};document.addEventListener("paste",b)}else t(o);const g={activeElem:l,listContext:m,cursorPositionType:u,isTargetCell:p,isEmptyText:v,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>mz()};if(RG(o,g)||(DG(o,u,v),IG(o,g)))return;const E={...g,parentElement:a,findNodeAtPosition:bG,setCursorSafely:yG};if(BG(o,E)||HG(o,h,p))return;const _={setCursorInsideSpan:C7,isCaretAtEndOfStandardElement:_7,setCursorPositionSimple:A7,commit:e.commit};aj(o,_)&&e.commit()}}function b_(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(),dr("insertText",!1,e.key))}function QG(){return document.addEventListener("keydown",b_,!0),{dispose(){document.removeEventListener("keydown",b_,!0)}}}function JG(e){const t=gG({handlePasteTextFragment:vl,getCommonStyles:()=>O.get("commonStyles"),changeMsoValue:n=>lm({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",ZG({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),document.addEventListener("beforeinput",n=>ij(n,e),!0),QG()}var eX='<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>',eu=4;function tX(e,t){return e.left<eu||e.right-e.left>t-8?eu-e.left:e.right>t-eu?t-eu-e.right:0}var vi=null,op=null;function ip(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;vi||(vi=new CSSStyleSheet),document.adoptedStyleSheets.includes(vi)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,vi]),vi.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;op=e;const r=Math.round(tX(n,document.documentElement.clientWidth));r!==0&&vi.replaceSync(`${t} { margin-left: ${r}px; }`)}function nX(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 ho(e,t){return{settings:e,elem:t}}var Ze={applicationElementSettingsSet:e=>D(xt,Fe)(e),setCursorPosition:e=>D(xt,Nt)(e),commit:Zr};function rX(){return O.get("emailWidth")||475}function tu(){return document.documentElement.clientWidth<=rX()}function sp(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Ze.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Ze.setCursorPosition(s),Ve(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=m=>{const h=m.touches[0];if(!h)return;m.preventDefault(),c.x+=h.clientX-l.x,c.y+=h.clientY-l.y,l={x:h.clientX,y:h.clientY};const p={x:Math.trunc(c.x),y:Math.trunc(c.y)};p.x===0&&p.y===0||(c.x-=p.x,c.y-=p.y,o.mousemove({movementX:p.x,movementY:p.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(()=>{Ve(document.documentElement,!1,"em-resize-start"),Ze.commit(!1)})}}function po(e,t,n){sp(e,t,"ns-resize",n)}function ha(e,t,n){sp(e,t,"ew-resize",n)}function oX(e,t,n){sp(e,t,"nwse-resize",n)}function go(e,t){let n=null,r=0;const o=tu();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?mi(ho({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");mi(ho(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?Ks(ho({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?Ks(ho({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?mi(ho({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&&Ze.commit()}function bo(e){let t=null;const n=tu();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():Ze.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Ze.applicationElementSettingsSet({elem:Pm(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?Ze.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Ze.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?Ze.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Ze.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Ze.applicationElementSettingsSet({elem:t})}t&&Ze.commit()}function Ei(e,t){let n=null,r=0;const o=tu();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)),Ze.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(v=>v.dataset.percent).map(v=>v.dataset.percent);u.length||(u=s.map(v=>((v||0)/a*100).toFixed(1)),Gd(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,f=(v,w)=>Math.round(w*parseFloat(v)/100);let m=s.map((v,w)=>f(u[w],d));const h=l-(m.reduce((v,w)=>v+w,0)+(s.length-1)*r);if(h!==0){const v=m.length-Math.abs(h);m=m.map((w,C)=>v<=C?w+(h>0?1:-1):w)}const p=m;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((v,w)=>{Array.from(v.querySelectorAll("table[width]")).filter(C=>!C.getAttribute("width")?.includes("%")).forEach(C=>{+(C.getAttribute("width")||0)<=p[w]&&(C.style.maxWidth=String(p[w]),C.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((v,w)=>v.setAttribute("width",String(p[w]))),c.querySelectorAll(".em-gap").forEach(v=>{v.parentElement?.setAttribute("width",String(r)),v.style.width=r+"px";const w=v.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?Ks(ho({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>qc(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?Ks(ho({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>qc(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&&Ze.commit()}function Si(e){let t=null;const n=tu();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Ze.applicationElementSettingsSet({elem:r}),Ze.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Ze.applicationElementSettingsSet({elem:Pm(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?Ze.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Ze.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?Ze.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Ze.applicationElementSettingsSet({elem:r})}t&&Ze.commit()}var y_={getLocale:Zs,commit:Zr,messageService:K},iX=".em-prevent-action",v_=new WeakSet;function sX(){return O.get("emailWidth")||475}function aX(){return O.get("isLeftButtonDown")||!1}function lX(){return O.get("editImageControlEnabled")||!1}function E_(){return O.get("imageCenterEditorEnabled")||!1}function cX(){return O.get("imageCenterStockEnabled")||!1}function uX(){return O.get("imageCenterGifEnabled")||!1}function dX(){return O.get("elementAIimageEnabled")||!1}function fX(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=y_.getLocale(),n=sX(),r=aX(),o=E_(),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 h=P({targetElement:e,insertType:"append",className:"em-element-resize-height"});P({targetElement:e,insertType:"append",className:"em-element-vindent"}),P({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),po(h,function(p){go(h,p.movementY)},function(){bo(h)})}if(e.closest(iX))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const h=eo(e,"em-mob-height"),p=h?parseFloat(h.substring(14,h.length-2)):void 0;P({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(p||e.getAttribute("height"))+"px":e.getAttribute("height")+"px"}),!i||!p?parseInt(e.getAttribute("height")||"0")<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):p<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 h=P({targetElement:e,insertType:"append",className:"em-element-resize-height"}),p=P({targetElement:e,insertType:"append",className:"em-element-vindent"});P({targetElement:p,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),P({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),po(h,function(v){go(h,v.movementY)},function(){bo(h)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const h=eo(e,"em-mob-height"),p=h?parseFloat(h.substring(14,h.length-2)):void 0;P({targetElement:e.querySelector(".em-element-vindent"),insertType:"append",className:"em-element-vindent-value",HTMLcontent:i?(p||parseFloat(e.style.height))+"px":parseFloat(e.style.height)+"px"}),!i||!p?parseFloat(e.style.height)<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low"):p<30?e.classList.add("em-vindent_low"):e.classList.remove("em-vindent_low")}const s=eo(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=eo(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=eo(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,f=eo(e,"em-mob-padding_right"),m=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 h=P({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&h.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!i)&&P({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)&&P({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")&&(!m||!i)&&P({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(h=>{if(!h.querySelector(".em-element-resize-height")){const p=h;(parseFloat(p.style.height)<30||parseFloat(p.style.width)<30)&&h.classList.add("em-vindent_low");const v=P({targetElement:p,insertType:"append",className:"em-element-resize-height"});P({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),P({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const w=P({targetElement:p,insertType:"append",className:"em-element-vindent"});let C="";p.className.indexOf("paddingTop")>-1?(C=e.style.paddingTop,po(v,function(T){go(v,T.movementY)},function(){bo(v)})):p.className.indexOf("paddingBottom")>-1?(C=e.style.paddingBottom,po(v,function(T){go(v,T.movementY)},function(){bo(v)})):p.className.indexOf("paddingLeft")>-1?(C=e.style.paddingLeft,ha(v,function(T){Ei(v,T.movementX)},function(){Si(v)})):p.className.indexOf("paddingRight")>-1&&(C=e.style.paddingRight,ha(v,function(T){Ei(v,-T.movementX)},function(){Si(v)})),P({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:C})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&P({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&P({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&P({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),m&&!e.querySelector(":scope > .em-vindent-paddingRight")&&P({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${m}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(h=>{if(!h.querySelector(".em-element-resize-height")){const p=h;(parseFloat(p.style.height)<30||parseFloat(p.style.width)<30)&&h.classList.add("em-vindent_low");const v=P({targetElement:p,insertType:"append",className:"em-element-resize-height"});P({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),P({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const w=P({targetElement:p,insertType:"append",className:"em-element-vindent"});let C="";p.className.indexOf("paddingTop")>-1?(C=a,po(v,function(T){go(v,T.movementY)},function(){bo(v)})):p.className.indexOf("paddingBottom")>-1?(C=c,po(v,function(T){go(v,T.movementY)},function(){bo(v)})):p.className.indexOf("paddingLeft")>-1?(C=d,ha(v,function(T){Ei(v,T.movementX)},function(){Si(v)})):p.className.indexOf("paddingRight")>-1&&(C=m,ha(v,function(T){Ei(v,-T.movementX)},function(){Si(v)})),P({targetElement:w,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(C)})}})),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 h=eo(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),p=h?parseFloat(h.substring(14,h.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(v=>{P({targetElement:v,insertType:"append",className:"em-gap",style:i?`height: ${p}px;`:`width: ${v.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(v=>{if(!v.querySelector(".em-element-resize-height")){const w=v,C=P({targetElement:w,insertType:"append",className:"em-element-resize-height"});P({targetElement:w,insertType:"append",className:"em-element-gap-marker"}),P({targetElement:w,insertType:"append",className:"em-element-gap-bg"});const T=P({targetElement:w,insertType:"append",className:"em-element-gap"});let y="";i?(y=w.style.height,po(C,function(g){go(C,g.movementY)},function(){bo(C)})):(y=w.style.width,ha(C,function(g){Ei(C,g.movementX)},function(){Si(C)})),P({targetElement:T,insertType:"append",className:"em-element-gap-value",HTMLcontent:y})}})}if(e.tagName==="IMG"){const h=e;if(h.closest("td[em-platform], td[data-em-platform]"))return;if(h.closest(".em-element-resize-img-container")||h.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||h.closest("editor")||h.classList.contains("em-video")){if(h.closest(".em-element-resize-img-container")){const C=h.closest(".em-element-resize-img-container"),T=C.querySelector(".em-element-img-edit");!h.getAttribute("src")?.includes(".gif")&&o?T||P({targetElement:C.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:xe(ua,`${Ne}`),title:t.CHANGE_IMAGE_EDIT}):C.querySelector(".em-element-img-edit")?.remove()}return}const p=document.createElement("span");p.classList.add("em-element-resize-img-container"),hy(p);const v=h.parentElement instanceof HTMLAnchorElement?h.parentElement:h;v.parentElement?.insertBefore(p,v),p.appendChild(v);const w=P({targetElement:p,insertType:"append",tag:"span",className:"em-element-resize-img"});oX(w,function(C){Ei(w,C.movementX)},function(){Si(w)}),h?.style.maxWidth&&h?.style.display==="block"&&h.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),mX(h,p)}}}function mX(e,t){const n=y_;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=lX(),i=E_(),s=cX(),a=uX(),l=dX();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=P({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(P({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&&P({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:xe(ua,`${Ne}`),title:r.CHANGE_IMAGE_EDIT}),s&&P({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}),P({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:xe(eX,`${Ne}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&P({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&&P({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),v_.has(c))return;v_.add(c),nX(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 m="application_open-image-edit-popup";e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?m="application_open-image-ai-popup":fF(f)||d?.classList.contains("em-element-img-changeto")?m="application_open-image-upload-popup":d?.classList.contains("em-element-img-gif")?m="application_open-image-gif-popup":d?.classList.contains("em-element-img-stock")&&(m="application_open-image-stock-popup");const h={operation:m,src:f};setTimeout(()=>{n.messageService.send(h)},100)})}}function S_(e){const t=e.ownerDocument.activeElement;return t instanceof HTMLElement&&t!==e.ownerDocument.body&&t.closest('[contenteditable="true"]')!==null&&e.contains(t)}function hX(e){const t=(n,r)=>{S_(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;I1(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")&&!S_(o),f=!e.getLockEditorInit(),m=o.tagName!=="IMG",h=!(o.childElementCount===1&&o.firstElementChild?.tagName==="IMG"&&(o.textContent?.trim()??"")==="");if(d&&f&&m&&h){let p=o;do if(p=p.closest("div, p, h1, h2, h3, h4, h5")||p.closest("span, b, strong, i, em, s, a, sup, sub"),p)if(!e.isVisible(p))p=p.parentElement;else break;while(p);if(o.tagName==="LI"&&o.style.fontFamily&&o.style.fontSize){const v=o.closest("ul, ol");v&&t(v,!0)}else if(o.tagName==="TD"&&o.style.fontFamily&&o.style.fontSize&&!o.querySelector("editor"))t(o);else if(p&&p.style.fontFamily&&p.style.fontSize&&(o.tagName==="LI"||!o.querySelector("img")))if(o.tagName==="LI"){const v=o.closest("ul, ol");v&&t(v,!0)}else o.querySelector("img")||t(o,!0);else if(p&&p.closest('[style*="font-family"][style*="font-size"]')){const v=p.closest('[style*="font-family"][style*="font-size"]');v&&v.tagName!=="BODY"&&v.tagName!=="TD"&&v.tagName!=="TABLE"?t(v,!1):v?.tagName==="TD"&&!v.querySelector("editor")&&!v.closest(".em-element-custom-table")&&t(v)}else if(p&&p?.tagName==="DIV"&&!p.querySelector("table")){const v=!!p.style.height?.length,w=p.className.includes("em-element-img-change-group"),C=p.querySelector("img")?.parentNode,T=!!p.querySelector("img")&&C&&!e.hasTextNodeInElement(C);!v&&!w&&!T&&t(p,!0)}else for(let v=0;v<o.childNodes.length;v++){const w=o.childNodes[v];if(w.nodeName==="#text"&&(w.textContent?.trim().length??0)>0&&!o.querySelector("table")){const C=o.tagName==="P"?o.parentElement:o;C&&t(C);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 pX(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 nu(e){e.button===0&&O.set("isLeftButtonDown",!1)}function w_(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&O.set("isLeftButtonDown",!0)}function C_(){O.set("lockEditorInit",!1)}function gX(){return document.addEventListener("mousedown",w_),document.addEventListener("mouseup",nu),document.addEventListener("dragend",nu),window.addEventListener("mousemove",C_),{dispose(){document.removeEventListener("mousedown",w_),document.removeEventListener("mouseup",nu),document.removeEventListener("dragend",nu),window.removeEventListener("mousemove",C_)}}}function bX(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 yX(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=bX(document,n.clientX,n.clientY);if(i&&o.contains(i.startContainer)){const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}}}var vX=1e3;function EX(e){setTimeout(()=>O.set("loadStylesTimer",!0),vX);const t=hX({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:lM,wrapEditor:e.wrapEditor,implementElementsEditors:n=>xG(n,{setBlockGroupControlsPosition:()=>Lc({scrollTop:O.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>fX(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=Ot(n=>{t(n),e.onHover?.(n.target)}),document.onmouseleave=pX({removeElementEditors:()=>bi(void 0),commit:e.commit}),document.addEventListener("mousedown",yX({isEditLocked:os,unlockEditorInit:()=>O.set("lockEditorInit",!1),handleMouseover:t}),!0),gX()}function SX(e){return t=>D(e,Fi)(t)}function wX(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var CX={name:"sandbox.elementSettings",provides:[Fe],awaits:{services:[te,_o,Ao]},setup(e){const t=D(e,_o);e.inject(Fe,Nz({htmlDocument:D(e,te),getMapObj:()=>t,fingerprint:D(e,Ao),enrichExtras:()=>e.getServices(cg).reduce((n,r)=>({...n,...r()}),{})}))}},_X={name:"sandbox.documentChange",awaits:{services:[te,Ao,Fe,ft,Re,Fi]},setup:e=>r7({htmlDocument:D(e,te),fingerprint:D(e,Ao),initPreview:SX(e),applicationElementSettingsSet:D(e,Fe),commit:mt(e),focusController:D(e,ft).controller})},AX={name:"sandbox.toggleTextStyle",provides:[Ia],awaits:{services:[Fe,Re]},setup(e){const t=D(e,Fe),n=mt(e),r=(o,i=Je())=>{let s=wX(ls(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(Ia,pj({commit:n,addNewRange:$o,refreshElementSettings:r,findElementWithSelectedText:ls,getParentElementOfSelection:Sl,findOutermostParentWithText:jd,clearLinkTags:o=>{co(o,n),Wr(n)},addFontFamilyClass:o=>js(o,n),getIsProgrammaticSelection:()=>!!O.get("isProgrammaticSelection"),getCommonStyles:()=>O.get("commonStyles")??{}}))}},TX={name:"sandbox.insert",provides:[To],awaits:{services:[te,Fe,Re,Du]},setup:e=>e.inject(To,pG({htmlDocument:D(e,te),commit:mt(e),messageService:K,applicationElementSettingsSet:D(e,Fe),...D(e,Du)}))},kX={name:"sandbox.elementSettingsApply",provides:[Da],awaits:{services:[te,_o,Re,Nt,Fe,Ia,yn,ft]},setup(e){const t=D(e,Re),n=D(e,_o),r=D(e,Nt),o=D(e,Fe);let i=null;const s=l=>{i??(i=QV({htmlDocument:D(e,te),getMapObj:()=>n,commit:mt(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,toggleTextStyle:D(e,Ia),wrapEditor:D(e,yn).now,programmaticSelection:{get value(){return!!O.get("isProgrammaticSelection")},set value(c){O.set("isProgrammaticSelection",c)}}})),i(l)},a=D(e,ft).controller;e.inject(Da,l=>a.whenEditorLostFocus(()=>s(l)))}},LX={name:"sandbox.mouse",awaits:{services:[te,yn,Re]},setup:e=>EX({htmlDocument:D(e,te),commit:mt(e),wrapEditor:D(e,yn).deferred})},NX={name:"sandbox.click",awaits:{services:[te,Re,Nt,ft,Fe,yn]},setup(e){const t=D(e,Re),n=D(e,ft);oG({htmlDocument:D(e,te),commit:mt(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:K,setCursorPosition:D(e,Nt),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:D(e,Fe),wrapEditor:D(e,yn).now,insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(lg)?.(r)??!1})}},xX={name:"sandbox.keyboard",awaits:{services:[Re,Nt,Fe,yn]},setup:e=>JG({commit:mt(e),messageService:K,setCursorPosition:D(e,Nt),applicationElementSettingsSet:D(e,Fe),wrapEditor:D(e,yn).now})},OX={name:"sandbox.cssFilterOnCommit",awaits:{services:[te]},setup:e=>j9(D(e,te))},RX={name:"sandbox.vmlButtonLabelSync",awaits:{services:[Re]},setup(e){const t=D(e,Re);mj(n=>t.commit(n))}},MX={name:"sandbox.insertListeners",awaits:{services:[To]},setup:e=>D(e,To).register()};function __(e,t,n,r=""){cr(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 PX(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;__(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">
|
|
251
|
-
<tr>
|
|
252
|
-
<td style="padding: 10px 0;">
|
|
253
|
-
<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>
|
|
254
|
-
</td>
|
|
255
|
-
</tr></table>`),s.append(a),!0},t.HTMLDocument.getOuterHtml(o))}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function IX(e,t){try{t.state.increment("activeElementLocked");const n=t.getActiveEditElement();if(!n)return;const r=n.closest("amp-accordion");if(!r)return;__(r,t,o=>(o.querySelectorAll("section")[e.index]?.remove(),!0))}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function A_(e){return{state:e.state,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument}}function DX(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||PX(e.data.settings,A_(t))}function BX(e,t){!t.state||!t.HTMLDocument||!t.getActiveEditElement||IX(e.data.settings,A_(t))}var HX={sandbox_accordion_add_section:DX,sandbox_accordion_remove_section:BX};function FX(e,t){yr(),Ve(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 $X(e,t){const{htmlDocument:n}=t;t.messageService.send({operation:"application_email_content_get",htmlCode:n.getOuterHtml(document.body)||n.getRootsHtml()})}var WX={"sandbox_drag-cancel":FX,sandbox_email_content_get:$X};function qX(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=FF()??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 zX={sandbox_eblock_set_em_block_id:qX};function T_(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 k_(e,t){for(const n of e)n.type===B.HTML&&!ka(n,n.parent)&&(n.content=t(n.content??"")),k_(n.children,t)}function UX(e,t){const n=gn(e);k_(n.roots,t);const r=document.createDocumentFragment(),o=$p(void 0);try{r.append(...n.roots.map(i=>jr(i,!0,!0)))}finally{o()}return Ho(r),r}var VX=`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 ru(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&ru({elem:e.elem.previousSibling})}function ou(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(),ou({elem:t})));else if(e.elem.innerHTML.trim()==="")ru({elem:e.elem}),e.elem.remove(),ou({elem:t});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?(ru({elem:n}),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(ru({elem:n}),n.remove());e.elem.innerHTML.trim()===""&&ou({elem:e.elem})}return!0}function jX(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&&(Qr(o),o.remove()),ou({elem:r}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function GX(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>`;or(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",VX),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")&&JX(e,t).catch(r=>{})}var XX=/^(script|style|noscript|xmp|iframe|noembed|noframes)$/i,L_=/^[ \t\n\r\f]*$/;function N_(e,t,n){const{copy:r,counterpart:o}=ll(e),i=YX(e,o),s=c=>{const u=i.get(c);return!!u&&py(u)},a=UX(t(r.innerHTML),n),l=new Map;O_(r,a,l,s)&&i.forEach((c,u)=>l.get(u)?.(c))}function YX(e,t){const n=new Map,r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ALL);for(let o=r.nextNode();o;o=r.nextNode()){const i=t(o);i&&n.set(i,o)}return n}function x_(e){return[...(e instanceof HTMLTemplateElement?e.content:e).childNodes]}function O_(e,t,n,r){const o=x_(e),i=x_(t);let s=0;for(let a=0;a<o.length;){const l=o[a],c=i[s];if(l.nodeType===Node.TEXT_NODE){const u=ZX(o,a);a+=u.length;const d=c?.nodeType===Node.TEXT_NODE;if(!d&&!u.every(f=>L_.test(f.data))||(s+=d?1:0,!R_(u,d?c.data:"",n,r)))return!1;continue}if(!c||c.nodeType!==l.nodeType||!KX(l,c,r(l)))return!1;if(a+=1,s+=1,l.nodeType===Node.COMMENT_NODE){if(!R_([l],c.data,n,r))return!1}else if(l.nodeType===Node.ELEMENT_NODE&&(r(l)&&QX(l,c,n),!XX.test(l.nodeName)&&!O_(l,c,n,r)))return!1}return s===i.length}function KX(e,t,n){return t.nodeName===e.nodeName||!n&&t.nodeName.toLowerCase()===e.nodeName.toLowerCase()}function ZX(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 R_(e,t,n,r){if(e.map(i=>i.data).join("")===t)return!0;const o=e.filter(r);return o.length===0?!0:e.some(i=>!r(i)&&!L_.test(i.data))?!1:(o.forEach((i,s)=>n.set(i,a=>a.data=s===0?t:"")),!0)}function QX(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 JX(e,t){const{default:n}=await bd(async()=>{const{default:l}=await Promise.resolve().then(()=>fu("./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);Qr(document.body),e.action==="typograf_all"?N_(document.body,a,T_):r?.parentElement&&(r=r.parentElement,r?.parentElement&&N_(r.parentElement,a,T_)),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 M_(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 eY(e,t){const n=e.closest("a");if(ap(n))return n;if(!t)return null;const r=M_(t.anchorNode)?.closest("a")??null;if(ap(r))return r;const o=M_(t.focusNode)?.closest("a")??null;return ap(o)?o:null}function P_(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"&&kw(e)?e.closest('[em="block"]')??e:e}function I_(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"?ui(e)??e:e:null}function tY(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if(eY(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 nY(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=I_(P_(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function rY(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=I_(P_(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function oY(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),Ut(()=>document.querySelectorAll("editor").forEach(r=>{r.blur()}))}function iY(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 sY(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function aY(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};tY(n)}function lY(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};nY(n)}function cY(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};rY(n)}function uY(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};jX(n)}function dY(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};GX(n,r)}var fY={sandbox_element_active_reset:oY,sandbox_element_active_set:iY,sandbox_element_hover_set:sY,sandbox_element_parent_get:aY,sandbox_element_prev_get:lY,sandbox_element_next_get:cY,sandbox_element_remove:uY,sandbox_element_text:dY},Nn=".em-mob-wrap, .noresp-em-mob-wrap",Tt=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",at='div[style*="inline-block"]';function yo(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&&yo({elem:e.elem.previousSibling,width:e.width})}function D_(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&&D_({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function iu(e){return!!e.querySelector(Nn)||!!e.closest(Nn)}function pa(e){return e.querySelector(Nn)?document.querySelector('[em-edit="active"]'):e.closest(Nn).parentElement}function su(e){return e.querySelector(at)?document.querySelector('[em-edit="active"]'):e.closest(at).parentElement}function mY(e,t){const n=document.querySelector("[em-edit]");if(n)try{if(t.state.increment("activeElementLocked"),iu(n)){const r=pa(n),o=e.minWidth,i=r.querySelectorAll(Tt).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>
|
|
256
|
-
<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>
|
|
257
|
-
<td width="${o}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let c=0,u=0,d=0;r.querySelectorAll(Tt).forEach(m=>{parseFloat(m.getAttribute("width")||"0")>o&&d++,c+=parseFloat(m.getAttribute("width")||"0")});const f=(o+s)/d;if(r.querySelectorAll(Tt).forEach(m=>{if(parseFloat(m.getAttribute("width")||"0")>o){const h=Math.round(parseFloat(m.getAttribute("width")||"0")-f);m.setAttribute("width",String(h))}}),or(r.querySelectorAll(Tt)[i-1],"afterend",l),r.querySelectorAll(Tt).forEach(m=>{u+=parseFloat(m.getAttribute("width")||"0")}),c-u-s!==0){const m=r.querySelector(Nn),h=parseFloat(m.getAttribute("width")||"0")+(c-u-s);m.setAttribute("width",String(h))}t.setPercentsForColumns(r.querySelectorAll(Tt)),t.commit()}else{const r=su(n),o=e.minWidth,i=r.querySelectorAll(at).length,s=i>1?parseFloat(String(e.gap)):20,a='<!--[if (gte mso 9)|(IE)]></td><td width="'+(o+s)+`" valign="top"><![endif]-->
|
|
258
|
-
<div style="display: inline-block; width: `+(o+s)+`px; vertical-align: top;" class="em-mob-width-100perc">
|
|
259
|
-
<table width="`+o+`" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
|
|
260
|
-
<tr>
|
|
261
|
-
<td align="left"></td>
|
|
262
|
-
</tr>
|
|
263
|
-
</table>
|
|
264
|
-
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
|
|
265
|
-
</div>`;let l=0,c=0,u=0;if(i===1){const f=n.querySelector(at)?r.querySelector(at):n.closest(at);f.style.removeProperty("max-width"),f.firstElementChild?.style.removeProperty("max-width"),f.firstElementChild?.style.removeProperty("width")}r.querySelectorAll(at).forEach(f=>{const m=parseFloat(f.firstElementChild?.getAttribute("width")||"0");m>o&&u++,l+=m});const d=(o+s)/u;if(r.querySelectorAll(at).forEach(f=>{const m=f;if(parseFloat(m.firstElementChild?.getAttribute("width")||"0")>o){const h=Math.round(parseFloat(m.style.width)-d),p=h-s;m.style.width=h+"px",yo({elem:m,width:h}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(p))}}),or(r.querySelectorAll(at)[i-1],"afterend",a),r.querySelectorAll(at).forEach(f=>{c+=parseFloat(f.firstElementChild?.getAttribute("width")||"0")}),l-c-s!==0){const f=r.querySelector(at),m=parseFloat(f.style.width)+(l-c-s);f.style.width=m+"px",yo({elem:f,width:m}),f.firstElementChild?.tagName==="TABLE"&&f.firstElementChild.setAttribute("width",String(m-s))}t.commit()}}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function hY(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;try{if(t.state.increment("activeElementLocked"),iu(n)){const o=pa(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(Tt).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.getAttribute("width")||"0"),c===n.closest(Nn)&&(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(Tt).length,l=Math.floor((i+s)/a);if(o.querySelectorAll(Tt).forEach(c=>{const u=Math.round(parseFloat(c.getAttribute("width")||"0")+l);c.setAttribute("width",String(u))}),a===1){const c=o.querySelector(Nn),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(Tt))}else{const o=su(n);let i=0;const s=parseFloat(String(e.gap));o.querySelectorAll(at).forEach((c,u)=>{u===e.removedBlockIndex&&(i=parseFloat(c.style.width),c===n.closest(at)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),D_({elem:c,removedBlockIndex:e.removedBlockIndex}),c.remove())});const a=o.querySelectorAll(at).length,l=Math.round(i/a);if(o.querySelectorAll(at).forEach(c=>{const u=c,d=Math.round(parseFloat(u.style.width)+l),f=d-s;u.style.width=d+"px",yo({elem:u,width:d}),u.firstElementChild?.tagName==="TABLE"&&u.firstElementChild.setAttribute("width",String(f))}),a===1){const c=o.querySelector(at);c.style.width="100%",c.style.maxWidth=o.closest("table")?.style.maxWidth||"",yo({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 B_(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function pY(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 H_(e,t=""){cr(t+ts(e),n=>{n.forEach(pY),e.after(...n)})}function gY(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"),iu(n)){const s=pa(n),a=s.querySelectorAll(Tt)[r];if(!a)return;const l=a.nextElementSibling||a.previousElementSibling;H_(a,l?ts(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(Tt);c.forEach((u,d)=>{o[d]!=null&&u.setAttribute("width",String(o[d]))}),t.setPercentsForColumns(c),t.commit()}else{const s=su(n),a=s.querySelectorAll(at)[r];if(!a)return;H_(a,'<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
|
|
266
|
-
`),s.querySelectorAll(at).forEach((l,c)=>{const u=l,d=o[c];if(d==null)return;const f=d+i;u.style.width=f+"px",yo({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 bY(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"),iu(n)){const i=pa(n),s=i.querySelectorAll(Tt),a=s[r],l=s[o];if(!a||!l)return;B_(a,l),t.setPercentsForColumns(i.querySelectorAll(Tt)),t.commit()}else{const i=su(n).querySelectorAll(at),s=i[r],a=i[o];if(!s||!a)return;B_(s,a),[s,a].forEach(l=>{yo({elem:l,width:parseFloat(l.style.width)})}),t.commit()}}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function yY(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=pa(n);if(e.wrap)r.querySelectorAll(Nn).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(Tt).length,i=Math.round(100/o)-2;r.querySelectorAll(Nn).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",`
|
|
267
|
-
@media only screen and (max-device-width:${s}px),only screen and (max-width:${s}px) {
|
|
268
|
-
.em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel { display: table-cell !important; }
|
|
269
|
-
.em-mob-width-${i}perc { width: ${i}% !important; }
|
|
270
|
-
}
|
|
271
|
-
`)}t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function vY(e,t){try{t.state.increment("activeElementLocked");const n=document.querySelector("[em-edit]");if(!n)return;const r=n.querySelector(Nn)?document.querySelector('[em-edit="active"]'):n.closest(Nn)?.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 wi(e){return{state:e.state,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function EY(e,t){!t.state||!t.setPercentsForColumns||mY(e.data.settings,wi(t))}function SY(e,t){!t.state||!t.setPercentsForColumns||hY(e.data.settings,wi(t))}function wY(e,t){!t.state||!t.setPercentsForColumns||gY(e.data.settings,wi(t))}function CY(e,t){!t.state||!t.setPercentsForColumns||bY(e.data.settings,wi(t))}function _Y(e,t){!t.state||!t.setPercentsForColumns||yY(e.data.settings,wi(t))}function AY(e,t){!t.state||!t.setPercentsForColumns||vY(e.data.settings,wi(t))}var TY={sandbox_floatBlock_add:EY,sandbox_floatBlock_remove:SY,sandbox_floatBlock_copy:wY,sandbox_floatBlock_swap:CY,sandbox_floatblock_wrap:_Y,sandbox_floatblock_dir:AY},kY='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',LY=['[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 F_(){yr(),Ve(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 NY(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function xY(){for(const e of LY){const t=document.querySelector(e);if(t)return t}return null}function OY(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function RY(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?Gc(e):null)}function MY(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),PY(i,e,r)}function PY(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 $_(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}),MY(e,t,n)}function IY(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 DY(e,t){const n=JC();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=U0(e);if(e!==kY){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"||!Ln(n)?null:(o?t.insertCountdown({targetElem:br(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(br(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function W_(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function BY(e,t){e&&t.messageService.send(Le.APPLICATION_ATOM_INSERTED,e),F_()}function HY(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),F_()}function FY(e,t){const n=W_(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function $Y(e,t){let n=FY(e,t);if(!n)return!1;let r=null;const o=xY();if(o)r=$_(OY(o),n,t);else{const i=NY();if(i){const s=RY(i);s&&(r=$_(s,n,t))}else r=DY(n,t)}return r?(IY(r,t),!0):!1}function q_(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"),cr(`
|
|
272
|
-
`+t+`
|
|
273
|
-
`,r=>{n.replaceChildren(...r),n.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",n)})}function WY(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"?q_(e,t):n.insertAdjacentHTML(e,"afterend",t)}function z_(e,t,n){if(!e.blockHTML?.trim())return!1;const r=t.parseFromString(e.blockHTML);let o=r.filter(m=>m.tagName&&m.tagName!=="LINK"&&m.tagName!=="STYLE").map(m=>t.getOuterHtml(m)).join(""),i=r.filter(m=>m.tagName==="STYLE").map(m=>t.getOuterHtml(m)).join("");const s=t.assetsRoot?.()??document.head,a=r.filter(m=>m.tagName==="LINK"&&m.getAttribute("em-class")).filter(m=>!s?.querySelector(`link[em-class="${m.getAttribute("em-class")}"]`));if(i){let m=s?.querySelector('style[em="styles"]'),h="";m?h=t.HTMLDocument.getInnerHtml(m):(m=document.createElement("style"),m.setAttribute("em","styles"),m=s?.insertAdjacentElement("beforeend",m));const p=document.createElement("div");t.emailWidth&&(i=i.replace(/(max-device-width:|max-width:)\d+px/g,w=>w.replace(/\d+/,String(t.emailWidth)))),p.insertAdjacentHTML("afterbegin",i);let v=t.minify(h+`
|
|
274
|
-
`+[...p.querySelectorAll("style")].map(w=>w.innerHTML).join(`
|
|
275
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;v=t.cssbeautify(v,{indent:" ",autosemicolon:!0}),m.textContent=`
|
|
276
|
-
`+v+`
|
|
277
|
-
`}for(const m of a.reverse())s?.prepend(m),s?.insertAdjacentHTML("afterbegin",`
|
|
278
|
-
`);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"}),WY(n,o,t),!0;let l=null,c=null,u=!1;const d=JC(),f=d?null:document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')?.closest('[em="block"]')??e0();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(br(d),"beforeend",o):t.insertAdjacentHTML(br(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"?q_(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 qY(e,t){if(!t.lockEditor&&W_(e.atomHTML).trim())try{t.state.increment("activeElementLocked"),t.setAtomReplaced?.(null),M0({kind:"atom",settings:e}),e.action!=="insert"&&Ve(document.body,!0,"em-atom-insert-body"),e.action==="insert"&&$Y(e,t)&&BY(e.name,t),t.commit()}catch{}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function zY(e){return e.replace(/["\\]/g,"\\$&")}function UY(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="${zY(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)z_({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 VY(e,t){if(!t.lockEditor&&e.blockHTML?.trim())try{t.state.increment("activeElementLocked"),M0({kind:"block",settings:e}),Ve(document.body,!0,"em-block-insert-body"),e.action==="insert"&&z_(e,t)&&HY(e,t),t.commit()}finally{Promise.resolve().then(()=>t.state.decrement("activeElementLocked"))}}function jY(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};qY({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function GY(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};VY({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function XY(e,t){t.setElementSettings?.(e)}var YY={"sandbox_atom-insert":jY,"sandbox_block-insert":GY,sandbox_element_settings_set:XY},KY=Sn("elements",fY,{services:[Fe,Nt,Re,Cr]},e=>{const t=D(e,Fe),n=D(e,Nt),r=mt(e),o=D(e,Cr);return()=>({HTMLDocument:{getOuterHtml:on},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>Mc(i),getVariableByIcon:vc,hasRussianText:TR,messageService:K,removeAllAttributes:Tr,setCursorPosition:i=>n(i),state:Od})}),ZY=Sn("display",WX,{services:[te]},e=>{const t=D(e,te);return()=>({messageService:K,htmlDocument:t})}),QY=Sn("floatBlock",TY,{services:[Fe,Re]},e=>{const t=D(e,Fe),n=mt(e);let r=600;return O.subscribe(o=>{o.emailWidth!==void 0&&(r=o.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:r,state:Od,setPercentsForColumns:o=>Gd(o)})}),JY=Sn("accordion",HX,{services:[Re]},e=>{const t=mt(e);return()=>({HTMLDocument:{getOuterHtml:on},commit:t,state:Od,getActiveEditElement:Xd,parseFromString:n=>De(n)})}),eK=Sn("eblock",zX,{services:[Re]},e=>{const t=mt(e);return()=>({commit:t})}),tK=Sn("palette",YY,{services:[To,Da]},e=>{const t=D(e,To),n=D(e,Da);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),nK=Sn("nativeImageDrop",{[Le.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>W0()},void 0,()=>()=>({})),rK=[KY,ZY,QY,JY,eK,tK,nK],oK={name:"sandbox.prepareHtml",provides:[Pa],setup:e=>e.inject(Pa,t=>nc({node:t,isPartial:!0}))},iK={name:"sandbox.blockControlsViewport",setup:e=>e.addService(ug,()=>Lc({scrollTop:O.get("scrollTop")}))},sK=[oK,iK,CX,_X,AX,TX,kX,...rK,LX,NX,xX,OX,RX,MX],aK="__emmDiagnostics__",lK="diagnostics";function cK(){try{const e=new URLSearchParams(window.location.search).get(lK);return e!==null&&e!=="0"}catch{return!1}}function lp(e){try{window.parent.postMessage({mark:aK,...e},"*")}catch{}}function uK(){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 Ci(){return window.performance.timeOrigin+window.performance.now()}function dK(){return Array.from(document.images).every(e=>e.complete)}function fK(e,t){const r=window.setInterval(()=>{!dK()||Ci()-e()<500||(window.clearInterval(r),lp({type:"settled",at:Math.max(e(),t)}),uK())},100)}function mK(){if(!cK()||typeof MutationObserver!="function")return;let e=!1,t=Ci();new MutationObserver(()=>{t=Ci(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=Ci();lp({type:"paint",at:n}),fK(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=Ci()}),document.addEventListener("load",()=>{t=Ci()},!0)}var hK=500,pK=300,ga,au=!1;function U_(){if(au)return;au=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,ga=!1,au=!1)},pK);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),ga=!0,au=!1)})}function gK(){return ga===!1?(U_(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{ga=!1,n()},hK);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),ga=!0,n()})})})}var bK=1;function yK(){U_();const e=async(t,n)=>{await n?.(t),await gK()};K.addListenerAsync(Le.SANDBOX_INITED,e,bK)}var vK=16,V_=100,EK=.95,j_=.02;function G_(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*vK:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function X_(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 Y_(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(X_(o,"y",n)||X_(o,"x",t))return!0}return!1}function SK(){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(Le.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||Y_(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(G_(d.deltaX,d.deltaMode),G_(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,m=performance.now();const h=p=>{const v=p>m?Math.min(p-m,50):16;m=p;const w=Math.pow(EK,v/16);if(d*=w,f*=w,Math.abs(d)<j_&&Math.abs(f)<j_){l=void 0;return}o(d*v,f*v),l=window.requestAnimationFrame(h)};l=window.requestAnimationFrame(h)};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 m=i.x-f.screenX,h=i.y-f.screenY,p=d.timeStamp-i.at;if(i={x:f.screenX,y:f.screenY,at:d.timeStamp},!Y_(d.target,m,h)){if(d.cancelable&&d.preventDefault(),s=!0,p>0){const v=Math.min(p/V_,1);a={x:a.x*(1-v)+m/p*v,y:a.y*(1-v)+h/p*v}}o(m,h)}},{passive:!1}),window.addEventListener("touchend",d=>{const f=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&f<V_&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var wK={name:"sandbox.diagnosticsAgent",setup:()=>mK()},CK={name:"sandbox.paintGate",setup:()=>yK()},_K={name:"sandbox.wheelBridge",setup:()=>SK()},AK={name:"sandbox.deviceWidthMediaGuard",setup:()=>GB()};function TK(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function kK(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:TK,widthCalculationMethod:kK};var LK=Sr(((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,m=!0,h=1,p="bodyOffset",v=p,w=!0,C="",T={},y=32,g=null,E=!1,_=!1,b="[iFrameSizer]",S=b.length,A="",L={max:1,min:1,bodyScroll:1,documentElementScroll:1},x="child",N=!0,$=window.parent,R="*",I=0,Q=!1,V=null,ee=16,re=1,J="scroll",be=J,de=window,Se=function(){hn("onMessage function not defined")},me=function(){},X=function(){},H={height:function(){return hn("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return hn("Custom width calculation function not defined"),document.body.scrollWidth}},Y={},Bt=!1;try{var U=Object.create({},{passive:{get:function(){Bt=!0}}});window.addEventListener("test",lu,U),window.removeEventListener("test",lu,U)}catch{}var fn,bt,mn,Zt,xn,Qt,lt={bodyOffset:function(){return document.body.offsetHeight+Rn("marginTop")+Rn("marginBottom")},offset:function(){return lt.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return H.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,Lt(lt))},min:function(){return Math.min.apply(null,Lt(lt))},grow:function(){return lt.max()},lowestElement:function(){return Math.max(lt.bodyOffset()||lt.documentElementOffset(),we("bottom",dt()))},taggedElement:function(){return tr("bottom","data-iframe-height")}},kt={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return H.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(kt.bodyScroll(),kt.documentElementScroll())},max:function(){return Math.max.apply(null,Lt(kt))},min:function(){return Math.min.apply(null,Lt(kt))},rightMostElement:function(){return we("right",dt())},taggedElement:function(){return tr("right","data-iframe-width")}},yt=(fn=Mn,xn=null,Qt=0,function(){var M=Date.now(),W=ee-(M-(Qt=Qt||M));return bt=this,mn=arguments,W<=0||ee<W?(xn&&(clearTimeout(xn),xn=null),Qt=M,Zt=fn.apply(bt,mn),xn||(bt=mn=null)):xn=xn||setTimeout(Ht,W),Zt});er(window,"message",function(M){var W={init:function(){C=M.data,$=M.source,cu(),m=!1,setTimeout(function(){w=!1},f)},reset:function(){w?ue("Page reset ignored by init"):(ue("Page size reset by host page"),Ur("resetPage"))},resize:function(){vr("resizeParent","Parent window requested size check")},moveToAnchor:function(){T.findTarget(Ae())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Oe=Ae();ue("PageInfoFromParent called from parent: "+Oe),X(JSON.parse(Oe)),ue(" --")},message:function(){var Oe=Ae();ue("onMessage called from parent: "+Oe),Se(JSON.parse(Oe)),ue(" --")}};function pe(){return M.data.split("]")[1].split(":")[0]}function Ae(){return M.data.substr(M.data.indexOf(":")+1)}function G(){return M.data.split(":")[2]in{true:1,false:1}}function ne(){var Oe=pe();Oe in W?W[Oe]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||G()||hn("Unexpected message ("+M.data+")")}b===(""+M.data).substr(0,S)&&(m===!1?ne():G()?W.init():ue('Ignored message of type "'+pe()+'". Received before initialization.'))}),er(window,"readystatechange",Z_),Z_()}function lu(){}function er(M,W,pe,Ae){M.addEventListener(W,pe,!!Bt&&(Ae||{}))}function ba(M){return M.charAt(0).toUpperCase()+M.slice(1)}function vo(M){return b+"["+A+"] "+M}function ue(M){E&&window.console}function hn(M){window.console}function cu(){function M(G){return G==="true"}var W;function pe(G){pn(0,0,G.type,G.screenY+":"+G.screenX)}function Ae(G,ne){ue("Add event listener: "+ne),er(window.document,G,pe)}W=C.substr(S).split(":"),A=W[0],s=n!==W[1]?Number(W[1]):s,u=n!==W[2]?M(W[2]):u,E=n!==W[3]?M(W[3]):E,y=n!==W[4]?Number(W[4]):y,r=n!==W[6]?M(W[6]):r,a=W[7],v=n!==W[8]?W[8]:v,i=W[9],c=W[10],I=n!==W[11]?Number(W[11]):I,T.enable=n!==W[12]&&M(W[12]),x=n!==W[13]?W[13]:x,be=n!==W[14]?W[14]:be,_=n!==W[15]?!!W[15]:_,ue("Initialising iFrame ("+window.location.href+")"),(function(){function G(ne,Oe){return typeof ne=="function"&&(ue("Setup custom "+Oe+"CalcMethod"),H[Oe]=ne,ne="custom"),ne}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var ne=window.iFrameResizer;ue("Reading data from page: "+JSON.stringify(ne)),Object.keys(ne).forEach(ya,ne),Se="onMessage"in ne?ne.onMessage:Se,me="onReady"in ne?ne.onReady:me,R="targetOrigin"in ne?ne.targetOrigin:R,v="heightCalculationMethod"in ne?ne.heightCalculationMethod:v,be="widthCalculationMethod"in ne?ne.widthCalculationMethod:be})(),v=G(v,"height"),be=G(be,"width")),ue("TargetOrigin for parent set to: "+R)})(),(function(){n===a&&(a=s+"px"),_i("margin",(function(G,ne){return ne.indexOf("-")!==-1&&(hn("Negative CSS value ignored for "+G),ne=""),ne})("margin",a))})(),_i("background",i),_i("padding",c),(W=document.createElement("div")).style.clear="both",W.classList.add("iframe-resizer-inner"),W.style.display="block",W.style.height="0",document.body.appendChild(W),va(),q(),document.documentElement.style.height="",document.body.style.height="",ue('HTML & body height set to "auto"'),ue("Enable public methods"),de.parentIFrame={autoResize:function(G){return G===!0&&r===!1?(r=!0,ot()):G===!1&&r===!0&&(r=!1,zr("remove"),l!==null&&l.disconnect(),clearInterval(g)),pn(0,0,"autoResize",JSON.stringify(r)),r},close:function(){pn(0,0,"close")},getId:function(){return A},getPageInfo:function(G){typeof G=="function"?(X=G,pn(0,0,"pageInfo")):(X=function(){},pn(0,0,"pageInfoStop"))},moveToAnchor:function(G){T.findTarget(G)},reset:function(){Pn("parentIFrame.reset")},scrollTo:function(G,ne){pn(ne,G,"scrollTo")},scrollToOffset:function(G,ne){pn(ne,G,"scrollToOffset")},sendMessage:function(G,ne){pn(0,0,"message",JSON.stringify(G),ne)},setHeightCalculationMethod:function(G){v=G,va()},setWidthCalculationMethod:function(G){be=G,q()},setTargetOrigin:function(G){ue("Set targetOrigin: "+G),R=G},size:function(G,ne){vr("size","parentIFrame.size("+((G||"")+(ne?","+ne:""))+")",G,ne)}},_===!0&&(Ae("mouseenter","Mouse Enter"),Ae("mouseleave","Mouse Leave")),ot(),T=(function(){function G($t){var he=$t.getBoundingClientRect(),$t={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(he.left,10)+parseInt($t.x,10),y:parseInt(he.top,10)+parseInt($t.y,10)}}function ne(en){var he,$t=en.split("#")[1]||en,en=decodeURIComponent($t),Q_=document.getElementById(en)||document.getElementsByName(en)[0];n!==Q_?(he=G(he=Q_),ue("Moving to in page link (#"+$t+") at x: "+he.x+" y: "+he.y),pn(he.y,he.x,"scrollToOffset")):(ue("In page link (#"+$t+") not found in iFrame, so sending to parent"),pn(0,0,"inPageLink","#"+$t))}function Oe(){var Jt=window.location.hash,he=window.location.href;Jt!==""&&Jt!=="#"&&ne(he)}function Ft(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Jt){Jt.getAttribute("href")!=="#"&&er(Jt,"click",function(he){he.preventDefault(),ne(this.getAttribute("href"))})})}function Ea(){Array.prototype.forEach&&document.querySelectorAll?(ue("Setting up location.hash handlers"),Ft(),er(window,"hashchange",Oe),setTimeout(Oe,f)):hn("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return T.enable?Ea():ue("In page linking not enabled"),{findTarget:ne}})(),vr("init","Init message from host page"),me()}function ya(M){var W=M.split("Callback");W.length===2&&(this[W="on"+W[0].charAt(0).toUpperCase()+W[0].slice(1)]=this[M],delete this[M],hn("Deprecated: '"+M+"' has been renamed '"+W+"'. The old method will be removed in the next major version."))}function _i(M,W){n!==W&&W!==""&&W!=="null"&&ue("Body "+M+' set to "'+(document.body.style[M]=W)+'"')}function rt(M){var W={add:function(pe){function Ae(){vr(M.eventName,M.eventType)}Y[pe]=Ae,er(window,pe,Ae,{passive:!0})},remove:function(pe){var Ae,G=Y[pe];delete Y[pe],Ae=window,pe=pe,G=G,Ae.removeEventListener(pe,G,!1)}};M.eventNames&&Array.prototype.map?(M.eventName=M.eventNames[0],M.eventNames.map(W[M.method])):W[M.method](M.eventName),ue(ba(M.method)+" event listener: "+M.eventType)}function zr(M){rt({method:M,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),rt({method:M,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),rt({method:M,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),rt({method:M,eventType:"Input",eventName:"input"}),rt({method:M,eventType:"Mouse Up",eventName:"mouseup"}),rt({method:M,eventType:"Mouse Down",eventName:"mousedown"}),rt({method:M,eventType:"Orientation Change",eventName:"orientationchange"}),rt({method:M,eventType:"Print",eventNames:["afterprint","beforeprint"]}),rt({method:M,eventType:"Ready State Change",eventName:"readystatechange"}),rt({method:M,eventType:"Touch Start",eventName:"touchstart"}),rt({method:M,eventType:"Touch End",eventName:"touchend"}),rt({method:M,eventType:"Touch Cancel",eventName:"touchcancel"}),rt({method:M,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),rt({method:M,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),rt({method:M,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),x==="child"&&rt({method:M,eventType:"IFrame Resized",eventName:"resize"})}function uu(M,W,pe,Ae){return W!==M&&(M in pe||(hn(M+" is not a valid option for "+Ae+"CalculationMethod."),M=W),ue(Ae+' calculation method set to "'+M+'"')),M}function va(){v=uu(v,p,lt,"height")}function q(){be=uu(be,J,kt,"width")}function ot(){var M;r===!0?(zr("add"),M=y<0,window.MutationObserver||window.WebKitMutationObserver?M?On():l=(function(){function W(he){function $t(en){en.complete===!1&&(ue("Attach listeners to "+en.src),en.addEventListener("load",G,!1),en.addEventListener("error",ne,!1),Ft.push(en))}he.type==="attributes"&&he.attributeName==="src"?$t(he.target):he.type==="childList"&&Array.prototype.forEach.call(he.target.querySelectorAll("img"),$t)}function pe(he){ue("Remove listeners from "+he.src),he.removeEventListener("load",G,!1),he.removeEventListener("error",ne,!1),he=he,Ft.splice(Ft.indexOf(he),1)}function Ae(he,$t,en){pe(he.target),vr($t,en+": "+he.target.src)}function G(he){Ae(he,"imageLoad","Image loaded")}function ne(he){Ae(he,"imageLoadFailed","Image load failed")}function Oe(he){vr("mutationObserver","mutationObserver: "+he[0].target+" "+he[0].type),he.forEach(W)}var Ft=[],Ea=window.MutationObserver||window.WebKitMutationObserver,Jt=(function(){var he=document.querySelector("body");return Jt=new Ea(Oe),ue("Create body MutationObserver"),Jt.observe(he,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),Jt})();return{disconnect:function(){"disconnect"in Jt&&(ue("Disconnect body MutationObserver"),Jt.disconnect(),Ft.forEach(pe))}}})():(ue("MutationObserver not supported in this browser!"),On())):ue("Auto Resize disabled")}function On(){y!==0&&(ue("setInterval: "+y+"ms"),g=setInterval(function(){vr("interval","setInterval: "+y)},Math.abs(y)))}function Rn(M,W){var pe=0;return W=W||document.body,pe=(pe=document.defaultView.getComputedStyle(W,null))!==null?pe[M]:0,parseInt(pe,o)}function we(M,W){for(var pe,Ae=W.length,G=0,ne=ba(M),Oe=Date.now(),Ft=0;Ft<Ae;Ft++)G<(pe=W[Ft].getBoundingClientRect()[M]+Rn("margin"+ne,W[Ft]))&&(G=pe);return Oe=Date.now()-Oe,ue("Parsed "+Ae+" HTML elements"),ue("Element position calculated in "+Oe+"ms"),ee/2<(Oe=Oe)&&ue("Event throttle increased to "+(ee=2*Oe)+"ms"),G}function Lt(M){return[M.bodyOffset(),M.bodyScroll(),M.documentElementOffset(),M.documentElementScroll()]}function tr(M,W){var pe=document.querySelectorAll("["+W+"]");return pe.length===0&&(hn("No tagged elements ("+W+") found on page"),document.querySelectorAll("body *")),we(M,pe)}function dt(){return document.querySelectorAll("body *")}function Mn(M,W,pe,Ae){function G(){M in{init:1,interval:1,size:1}||!(v in L||u&&be in L)?M in{interval:1}||ue("No change in size detected"):Pn(W)}var ne,Oe;function Ft(Ea,Jt){return!(Math.abs(Ea-Jt)<=I)}ne=n!==pe?pe:lt[v](),Oe=n!==Ae?Ae:kt[be](),Ft(h,ne)||u&&Ft(re,Oe)||M==="init"?(du(),pn(h=ne,re=Oe,M)):G()}function Ht(){Qt=Date.now(),xn=null,Zt=fn.apply(bt,mn),xn||(bt=mn=null)}function vr(M,W,pe,Ae){Q&&M in d?ue("Trigger event cancelled: "+M):(M in{reset:1,resetPage:1,init:1}||ue("Trigger event: "+W),(M==="init"?Mn:yt)(M,W,pe,Ae))}function du(){Q||(Q=!0,ue("Trigger event lock on")),clearTimeout(V),V=setTimeout(function(){Q=!1,ue("Trigger event lock off"),ue("--")},f)}function Ur(M){h=lt[v](),re=kt[be](),pn(h,re,M)}function Pn(M){var W=v;v=p,ue("Reset trigger event: "+M),du(),Ur("reset"),v=W}function pn(M,W,pe,Ae,G){var ne;N===!0&&(n===G?G=R:ue("Message targetOrigin: "+G),ue("Sending message to host page ("+(ne=A+":"+(M+":"+W)+":"+pe+(n!==Ae?":"+Ae:""))+")"),$.postMessage(b+ne,G))}function Z_(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),NK=[{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 xK(){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 OK(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),Zr();return}if(e){let n=!1;for(const r of NK)if(r.detect()){r.apply(),n=!0;break}n||xK()}K_(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||K.send({operation:"application_template_not_em_alert_show"}),Zr()}function K_(){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 DF}}),Object.defineProperty(z,"Disposable",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(z,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return sK}}),Object.defineProperty(z,"EVENT_TYPES",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(z,"FOCUS_ID",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(z,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return te}}),Object.defineProperty(z,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return Fi}}),Object.defineProperty(z,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return Du}}),Object.defineProperty(z,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return lg}}),Object.defineProperty(z,"Node",{enumerable:!0,get:function(){return Et}}),Object.defineProperty(z,"NodeType",{enumerable:!0,get:function(){return B}}),Object.defineProperty(z,"SET_CURSOR_ID",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(z,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return sg}}),Object.defineProperty(z,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(z,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return ag}}),Object.defineProperty(z,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return yn}}),Object.defineProperty(z,"_defineProperty",{enumerable:!0,get:function(){return k}}),Object.defineProperty(z,"addFontFamilyClass",{enumerable:!0,get:function(){return js}}),Object.defineProperty(z,"ampUnit",{enumerable:!0,get:function(){return Rx}}),Object.defineProperty(z,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Sc}}),Object.defineProperty(z,"applyRootScale",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(z,"buildEmFontClassName",{enumerable:!0,get:function(){return Cc}}),Object.defineProperty(z,"checkBlockAdaptivity",{enumerable:!0,get:function(){return yc}}),Object.defineProperty(z,"clearLinkTags",{enumerable:!0,get:function(){return co}}),Object.defineProperty(z,"clearProjectFontFaces",{enumerable:!0,get:function(){return Wr}}),Object.defineProperty(z,"commitOf",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(z,"commonStylesApply",{enumerable:!0,get:function(){return tC}}),Object.defineProperty(z,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return nh}}),Object.defineProperty(z,"createFontClassName",{enumerable:!0,get:function(){return $m}}),Object.defineProperty(z,"createIdentifier",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(z,"defineSurface",{enumerable:!0,get:function(){return jT}}),Object.defineProperty(z,"defineUnit",{enumerable:!0,get:function(){return ST}}),Object.defineProperty(z,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return AK}}),Object.defineProperty(z,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return wK}}),Object.defineProperty(z,"elMarkupHelper",{enumerable:!0,get:function(){return OK}}),Object.defineProperty(z,"extensionsUnit",{enumerable:!0,get:function(){return JH}}),Object.defineProperty(z,"findParentTr",{enumerable:!0,get:function(){return rv}}),Object.defineProperty(z,"fitEmailToWidth",{enumerable:!0,get:function(){return Bx}}),Object.defineProperty(z,"fitImagesToColumns",{enumerable:!0,get:function(){return xh}}),Object.defineProperty(z,"getElementInnerHTML",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(z,"getOuterHtml",{enumerable:!0,get:function(){return on}}),Object.defineProperty(z,"getUsedColors",{enumerable:!0,get:function(){return cC}}),Object.defineProperty(z,"globalBlockReplace",{enumerable:!0,get:function(){return UY}}),Object.defineProperty(z,"iframeSetSize",{enumerable:!0,get:function(){return Hx}}),Object.defineProperty(z,"implementPolyfills",{enumerable:!0,get:function(){return mp}}),Object.defineProperty(z,"insertAdjacentHTML",{enumerable:!0,get:function(){return or}}),Object.defineProperty(z,"insertCountdown",{enumerable:!0,get:function(){return yw}}),Object.defineProperty(z,"insertNewHTML",{enumerable:!0,get:function(){return yy}}),Object.defineProperty(z,"isComment",{enumerable:!0,get:function(){return td}}),Object.defineProperty(z,"isEmptyTable",{enumerable:!0,get:function(){return Ln}}),Object.defineProperty(z,"isTextNode",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(z,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return K_}}),Object.defineProperty(z,"markProjectFontClass",{enumerable:!0,get:function(){return qm}}),Object.defineProperty(z,"messageService",{enumerable:!0,get:function(){return K}}),Object.defineProperty(z,"minifyStylesheet",{enumerable:!0,get:function(){return io}}),Object.defineProperty(z,"paintGateUnit",{enumerable:!0,get:function(){return CK}}),Object.defineProperty(z,"parseFromString",{enumerable:!0,get:function(){return De}}),Object.defineProperty(z,"removeClassesByPrefix",{enumerable:!0,get:function(){return zm}}),Object.defineProperty(z,"removeHiddenClasses",{enumerable:!0,get:function(){return tc}}),Object.defineProperty(z,"requireService",{enumerable:!0,get:function(){return D}}),Object.defineProperty(z,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return LK}}),Object.defineProperty(z,"rgbToHex",{enumerable:!0,get:function(){return j}}),Object.defineProperty(z,"rowsHost",{enumerable:!0,get:function(){return br}}),Object.defineProperty(z,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return Lc}}),Object.defineProperty(z,"setBlockMaxWidth",{enumerable:!0,get:function(){return Oh}}),Object.defineProperty(z,"setDocumentStyles",{enumerable:!0,get:function(){return Fm}}),Object.defineProperty(z,"setElementBorder",{enumerable:!0,get:function(){return Um}}),Object.defineProperty(z,"setElementBorderRadius",{enumerable:!0,get:function(){return qs}}),Object.defineProperty(z,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return U7}}),Object.defineProperty(z,"setFloatBlocksWidth",{enumerable:!0,get:function(){return Nh}}),Object.defineProperty(z,"setImageWidth",{enumerable:!0,get:function(){return xm}}),Object.defineProperty(z,"setStructureBlocksWidth",{enumerable:!0,get:function(){return qc}}),Object.defineProperty(z,"startSandbox",{enumerable:!0,get:function(){return GT}}),Object.defineProperty(z,"state",{enumerable:!0,get:function(){return O}}),Object.defineProperty(z,"stripSubjectTags",{enumerable:!0,get:function(){return ik}}),Object.defineProperty(z,"uptimeCountdown",{enumerable:!0,get:function(){return Om}}),Object.defineProperty(z,"wheelBridgeUnit",{enumerable:!0,get:function(){return _K}}),Object.defineProperty(z,"withForeignListenersPaused",{enumerable:!0,get:function(){return Ut}})});
|