useblocks 1.3.11-dev.2 → 1.3.11-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/{iframe-eblock.fd4347fc.html → iframe-eblock.5751e42b.html} +2 -2
- package/iframe/{iframe.fd4347fc.html → iframe.5751e42b.html} +2 -2
- package/iframe/js/elMarkupHelper.BpDXO-hq.js +279 -0
- package/iframe/js/{iframe-eblock.body.fd4347fc.js → iframe-eblock.body.5751e42b.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/{iframe.body.fd4347fc.js → iframe.body.5751e42b.js} +1 -1
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{6ec347ff.js → 11009bdf.js} +1 -1
- package/static/core/{846cd365.js → 11dadbc0.js} +1 -1
- package/static/core/{31d22827.js → 1c06cdb7.js} +1 -1
- package/static/core/{31da6da0.js → 1c3a16fc.js} +1 -1
- package/static/core/{d48488c4.js → 1c7a6d45.js} +1 -1
- package/static/core/{ab741434.js → 257745eb.js} +1 -1
- package/static/core/{939d4a62.js → 261a3a42.js} +1 -1
- package/static/core/2bed6a18.js +7 -0
- package/static/core/347b0a0b.js +1 -0
- package/static/core/{2865f716.js → 3b65bc50.js} +1 -1
- package/static/core/{bbf48eb9.js → 3d8e2478.js} +1 -1
- package/static/core/{5fd45688.js → 3eeb4445.js} +1 -1
- package/static/core/{17c8ebc4.js → 467344d4.js} +1 -1
- package/static/core/{c5128299.js → 513e36bd.js} +1 -1
- package/static/core/{579d4466.js → 516f59e7.js} +1 -1
- package/static/core/{9d57053a.js → 58dca22f.js} +1 -1
- package/static/core/{9438888a.js → 5da33486.js} +1 -1
- package/static/core/{752288e6.js → 6172f09a.js} +1 -1
- package/static/core/{12963ed5.js → 62855b97.js} +1 -1
- package/static/core/{1fcc0627.js → 66113a18.js} +1 -1
- package/static/core/{7934ed7e.js → 71727873.js} +1 -1
- package/static/core/{c33a9c36.js → 76543cb2.js} +1 -1
- package/static/core/{e9281a4c.js → 7e329493.js} +1 -1
- package/static/core/{70749936.js → 8406bab5.js} +1 -1
- package/static/core/{925b75fb.js → 8845436d.js} +2 -2
- package/static/core/{e37da9a7.js → 94f9492b.js} +1 -1
- package/static/core/{153a5a27.js → aee84e3d.js} +1 -1
- package/static/core/{78500214.js → b55ae539.js} +1 -1
- package/static/core/{8d0796c1.js → b59c63d2.js} +1 -1
- package/static/core/{37bf0f7a.js → b9f553d7.js} +1 -1
- package/static/core/{b0edd3a1.js → bda2d9d5.js} +1 -1
- package/static/core/{9916b298.js → c0a3f7d0.js} +2 -2
- package/static/core/{4181d334.js → c13b3d4f.js} +1 -1
- package/static/core/{2d58a94b.js → d2cf6b4b.js} +1 -1
- package/static/core/{983a408d.js → d343e46e.js} +1 -1
- package/static/core/{3a5bea82.js → d9d5b376.js} +1 -1
- package/static/core/{cc4657d9.js → dd008ec2.js} +1 -1
- package/static/core/{3ca0af3d.js → e037a420.js} +1 -1
- package/static/core/{f8f52e6d.js → e698ec22.js} +1 -1
- package/static/core/{13a6a2d3.js → e7e888c1.js} +1 -1
- package/static/core/ed65b5c3.js +19 -0
- package/static/core/{66b856ca.js → ef035f6b.js} +1 -1
- package/static/core/{dda98b73.js → f1b8515a.js} +1 -1
- package/static/core/{ae251a52.js → f8585ce6.js} +1 -1
- package/static/esm/{f97f42d1.js → c5372168.js} +1 -1
- package/static/umd-runtime/{runtime.CQCs2kHH.js → runtime.Lgfb59e0.js} +1 -1
- package/useblocks-core.5751e42b.js +875 -0
- package/useblocks-esm.js +6 -6
- package/{useblocks-po.fd4347fc.js → useblocks-po.5751e42b.js} +1 -1
- package/useblocks.d.ts +2 -2
- package/useblocks.js +12 -12
- package/vendor/useblocks-ui-kit/package.json +1 -1
- package/iframe/js/elMarkupHelper.DLCHSWwj.js +0 -279
- package/static/core/4f5add14.js +0 -1
- package/static/core/68e393e4.js +0 -19
- package/static/core/f126c14c.js +0 -7
- package/useblocks-core.fd4347fc.js +0 -875
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
__useblocks__.define("js/elMarkupHelper.DLCHSWwj.js",["require","exports","module"],function(id,F,une){var Ag=Object.defineProperty,Sr=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ie=(e,t)=>{let n={};for(var r in e)Ag(n,r,{get:e[r],enumerable:!0});return t||Ag(n,Symbol.toStringTag,{value:"Module"}),n};function Xi(e){"@babel/helpers - typeof";return Xi=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},Xi(e)}function nL(e,t){if(Xi(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rL(e){var t=nL(e,"string");return Xi(t)=="symbol"?t:t+""}function A(e,t,n){return(t=rL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kg;kg=Symbol.toStringTag;var sd=class{constructor(){A(this,"_valuesMap",new Map),A(this,kg,"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 Lg(){const e=new sd;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&sd.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(sd.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 Ng(){const e=Lg(),t=Lg();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)})}Ng();var xg=Symbol.for("emailmaker.commandInputPause");function Og(){const e=window,t=e[xg];if(t)return t;const n=new Set;return e[xg]=n,window.addEventListener("input",r=>n.forEach(o=>o(r)),!0),n}function oL(){Og()}function iL(e){const t=Og();return t.add(e),()=>{t.delete(e)}}oL();var Rg=class{constructor(e){A(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},Ct=(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})({}),sL=class{constructor(e,t){A(this,"source",void 0),A(this,"len",void 0),A(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===dL||e===fL||e===lL||e===uL||e===cL)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},ad=33,Ro=45,Ki=60,tn=62,Yi=47,aL=61,Mg=34,Pg=39,lL=10,cL=13,uL=12,dL=32,fL=9,Ig=63,mL=65,hL=90,pL=97,gL=122;function Dg(e){return e>=pL&&e<=gL||e>=mL&&e<=hL}function Bg(e){return Dg(e)||e===Yi||e===ad||e===Ig}var ja="(?=[\\s/>])",bL=new RegExp(`<!--|-->|<\\/?script${ja}\\s*\\/?>?`,"i"),yL=new RegExp(`<\\/style${ja}`,"i"),vL={"text/x-handlebars-template":!0,"text/html":!0};function EL(e,t=0,n=0,r=!1){const o=new sL(e,t);let i=n,s=0,a=18,l,c,u=!1,d,f,h;function m(){return o.advanceIfRegExp(/^[_:a-zA-Z][_:\w-.\d]*/).toLowerCase()}function p(){const y=o.pos();for(;!o.eos();){const w=o.nextChar();if(w===tn)return!0;if(w===Ki)break;if(w===Mg||w===Pg){if(!o.advanceUntilChar(w))break;o.advance(1)}}return o.goBackTo(y),!1}function v(){for(;o.advanceUntilChar(Ki)&&!Bg(o.peekChar(1));)o.advance(1)}function C(y){return o.advanceUntilChar(tn)&&o.advance(1),L(y,22)}function k(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function L(y,w,b){return a=w,s=y,l=b,w}function E(){const y=o.pos(),w=i,b=g();return b!==21&&y===o.pos()&&!(r&&(b===4||b===8))?(o.advance(1),L(y,18)):b}function g(){const y=o.pos();if(o.eos())return L(y,21);let w;switch(i){case 6:return o.advanceIfChars([Ro,Ro,tn])?(i=0,L(y,2)):(o.advanceUntilChars([Ro,Ro,tn]),L(y,1));case 3:return o.advanceIfChar(tn)?(i=0,L(y,15)):(o.advanceUntilChar(tn),L(y,14));case 0:return o.peekChar()===Ki&&Bg(o.peekChar(1))?(o.advance(1),o.peekChar()===ad?o.advanceIfChars([ad,Ro,Ro])?(i=6,L(y,0)):o.advanceIfRegExp(/^!doctype/i)?(i=3,L(y,13)):C(y):o.peekChar()===Ig?C(y):o.advanceIfChar(Yi)?Dg(o.peekChar())?(i=2,L(y,7)):C(y):(i=1,L(y,3))):(v(),L(y,16));case 2:return m().length>0?(i=5,u=!1,L(y,9)):o.skipWhitespace()?L(y,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(tn),y<o.pos()?L(y,18,"End tag name expected."):g());case 5:if(o.skipWhitespace())return u=!0,L(y,17);if(o.advanceIfChar(tn))return i=0,L(y,8);if(r&&o.peekChar()===Ki)return i=0,L(y,8,"Closing bracket missing.");if((u||o.peekChar()===Yi)&&p())return i=0,L(y,8);w="Closing bracket expected.";break;case 1:return d=m(),h=void 0,f=void 0,d.length>0?(c=!1,i=4,L(y,6)):o.skipWhitespace()?L(y,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(tn),y<o.pos()?L(y,18,"Start tag name expected."):g());case 4:return o.skipWhitespace()?(c=!0,L(y,17)):c&&(f=k(),f.length>0)?(i=9,c=!1,L(y,11)):o.advanceIfChars([Yi,tn])?(i=0,L(y,5)):o.advanceIfChar(tn)?(d==="script"?h&&vL[h]?i=0:i=7:d==="style"?i=8:i=0,L(y,4)):r&&o.peekChar()===Ki?(i=0,L(y,4,"Closing bracket missing.")):(o.advance(1),L(y,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,L(y,17)):o.advanceIfChar(aL)?(i=10,L(y,10)):(i=4,g());case 10:if(o.skipWhitespace())return L(y,17);let b=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(b.length>0)return o.peekChar()===tn&&o.peekChar(-1)===Yi&&(o.goBack(1),b=b.substr(0,b.length-1)),f==="type"&&(h=b),i=4,c=!1,L(y,12);const S=o.peekChar();return S===Pg||S===Mg?(o.advance(1),o.advanceUntilChar(S)&&o.advance(1),f==="type"&&(h=o.getSource().substring(y+1,o.pos()-1)),i=4,c=!1,L(y,12)):(i=4,c=!1,g());case 7:let _=1;for(;!o.eos();){const T=o.advanceIfRegExp(bL);if(T.length===0)return o.goToEnd(),L(y,19);if(T==="<!--")_===1&&(_=2);else if(T==="-->")_=1;else if(T[1]!=="/")_===2&&(_=3);else if(_===3)_=2;else{o.goBack(T.length);break}}return i=0,y<o.pos()?L(y,19):g();case 8:return o.advanceUntilRegExp(yL),i=0,y<o.pos()?L(y,20):g()}return o.advance(1),i=0,L(y,18,w)}return{scan:E,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function SL(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function wL(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function _L(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function CL(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 ld=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function TL(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Hg=Object.create(null);function AL(e,t){const n=Hg[e]||(Hg[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[TL(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function cd(e,t){if(e.start===e.end||t)return"";switch(e.type){case D.ELEMENT:return dd(e,t);case D.ROOT:return[...e.children].map(n=>cd(n,t)).join("");case D.DOCTYPE:return SL(e,t);case D.COMMENT:return _L(e,t);default:return e.content||""}}function ud(){return{exact:new WeakMap,collapsed:new WeakMap}}function Jn(e,t=!1,n){if(e.start===e.end&&e.type!==D.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=>Jn(a,t,n)).join("");let s;switch(e.type){case D.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case D.ROOT:s=i();break;case D.COMMENT:s=`<!--${e.content??""}-->`;break;case D.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 Va(e,t=0){if(e.start===e.end)return"";switch(e.type){case D.ELEMENT:return LL(e,t);case D.ROOT:return $g(e,t);case D.DOCTYPE:return wL(e,t);case D.COMMENT:return CL(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function Fg(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"&&!AL(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function kL(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=cd(r);return n}function $g(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=Va(r,t+n.length);return n}function Wg(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=Fg(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function qg(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function dd(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=Wg(e,t);if(ld.has(r))return o;{const i=qg(e,t);return`${o}${n?kL(e,t):""}${i}`}}function LL(e,t){const n=e.tag?.toLowerCase()||"div",r=Wg(e);if(e.start=t,e.startTagEnd=t+r.length,ld.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=$g(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=qg(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function fd(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 D=(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})({}),Ga=e=>e.type===0?e.start-1:e.start,NL=e=>e.type===0?e.end+1:e.end,Tt=class Zk{get attributeNames(){return this.attributes?Object.keys(this.attributes):[]}get root(){return this.parent?this.parent.root:this}constructor(t,n,r,o){A(this,"start",void 0),A(this,"end",void 0),A(this,"children",void 0),A(this,"parent",void 0),A(this,"content",void 0),A(this,"type",1),A(this,"tag",void 0),A(this,"closed",!1),A(this,"startTagEnd",void 0),A(this,"endTagStart",void 0),A(this,"attributes",void 0),A(this,"createdBy",void 0),A(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=fd(this.children,r=>t<=Ga(r))-1;if(n>=0){const r=this.children[n];if(t>Ga(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=fd(this.children,r=>t<=Ga(r))-1;if(n>=0){const r=this.children[n];if(t>=Ga(r)&&t<=NL(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 Zk(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 xL(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 zg=class{constructor(e,t){A(this,"text",void 0),A(this,"type",void 0),A(this,"node",void 0),A(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 Tt(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}}},Ug=class{constructor(e){A(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=EL(e,void 0,void 0,!0),r=new Tt(0,e.length,[],void 0);r.type=D.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],C=e.substring(o.start,o.end);v?.type===D.HTML?(v.content=(v.content||"")+C,v.end=o.end,p.splice(p.length-1,1)):(o.type=D.HTML,o.content=C,o.children=[]),o.type=D.HTML}o=o.parent},u=new zg(e,D.COMMENT),d=new zg(e,D.DOCTYPE),f=p=>{o.children.push(p)},h=(p,v)=>{const C=new Tt(p,v,[],o);C.type=D.HTML,C.content=e.substring(p,v),f(C)};for(;l!==Ct.EOS;){switch(l){case Ct.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case Ct.EndDoctypeTag:{const L=o.lastChild,E=d.node;if(!E)throw new Error("");const g=L?L.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==E.start){const y=e.substring(g,E.start);if(y){const w=new Tt(g,E.start,[],o);w.type=D.HTML,w.content=y,f(w)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case Ct.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case Ct.EndCommentTag:{const L=o.lastChild,E=u.node;if(!E)throw new Error("");const g=L?L.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==E.start){const y=e.substring(g,E.start);if(y){const w=new Tt(g,E.start,[],o);w.type=D.HTML,w.content=y,f(w)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case Ct.StartTagOpen:const p=o.lastChild,v=new Tt(n.getTokenOffset(),e.length,[],o),C=p?p.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(C!==v.start){const L=e.substring(C,v.start);if(L){const E=new Tt(C,v.start,[],o);E.type=D.HTML,E.content=L,f(E)}}f(v),o=v;break;case Ct.BogusComment:{const L=o.lastChild?.end??o.startTagEnd??o.start;L<n.getTokenOffset()&&h(L,n.getTokenOffset()),h(n.getTokenOffset(),n.getTokenEnd());break}case Ct.StartTag:o.tag=n.getTokenText();break;case Ct.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 Ct.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case Ct.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case Ct.EndTag:s=n.getTokenText().toLowerCase();break;case Ct.EndTagClose:let k=o;for(;!k.isSameTag(s)&&k.parent;)k=k.parent;if(k.parent){const L=o.lastChild,E=L?L.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(E!==i){const g=e.substring(E,i);if(g){const y=new Tt(E,i,[],o);y.type=D.HTML,y.content=g,f(y)}}for(;o!==k;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case Ct.AttributeName:{a=n.getTokenText();let L=o.attributes;L||(o.attributes=L={}),L[a]=null;break}case Ct.AttributeValue:{const L=n.getTokenText(),E=o.attributes;E&&a&&(E[a]=xL(L),a=null);break}}l=n.scan()}for(;o.parent;)o.end=e.length,o.closed=!1,c();u.hasNode,u.finish(e.length);const m=r.lastChild?.end||0;if(m<e.length){const p=e.substring(m);if(p){const v=new Tt(m,e.length,[],r);v.type=D.HTML,v.content=p,f(v)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},dne=new Ug(new Rg(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),OL=new Rg(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),RL=new Ug(OL);function hn(e){return RL.parse(e)}var md=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&&ML(n,e),n}else return document.createTextNode("")}function ML(e,t){const n={source:t,data:e.data};Object.defineProperty(e,md,{value:n,configurable:!0})}function Zi(e){const t=e[md];return t&&t.data===e.data?t:void 0}function Xa(e){return Zi(e)?.source}function jg(e,t){if(e.nodeType===Node.COMMENT_NODE){t.push(e);return}(e.nodeName==="TEMPLATE"?e.content:e).childNodes.forEach(n=>jg(n,t))}function Ka(...e){const t=[];return e.forEach(n=>jg(n,t)),t}function PL(e,t){return e.data===t.data&&(e.parent===void 0||t.parent===void 0||e.parent===t.parent)}function Vg(e,t){Zi(e)||Object.defineProperty(e,md,{value:t,configurable:!0})}function IL(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 DL(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)=>PL(e[o+s],i))&&r.push(o);if(!r.length){const o=IL(e);t.forEach(i=>{const s=o.get(i.data);s&&Vg(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)&&Vg(o,a)})}function Gg(e,t){const n=e.parentNode,r=n&&n.nodeType===Node.ELEMENT_NODE&&!t.includes(n);return{data:e.data,mark:Zi(e),parent:r?n.nodeName.toLowerCase():void 0}}function Xg(e,t,n){const r=Ka(...t),o=n?[...t,n]:t;DL(e,r,r.map(i=>Gg(i,o)))}function nn(e,t){Xg(Ka(e).map(n=>Gg(n,[e])),[t],null)}var BL=/<[!?]|<\/[^a-zA-Z]/,HL=/^<[!?/]/;function FL(e){const t=[],n=r=>{const o=r.parent?.tag?.toLowerCase();if(r.type===D.COMMENT)t.push({data:r.content??"",mark:void 0,parent:o});else if(r.type===D.HTML&&r.content&&HL.test(r.content)){const i=wr(r.content);i.nodeType===Node.COMMENT_NODE&&t.push({data:i.data,mark:Zi(i),parent:o})}r.children.forEach(n)};try{hn(e).roots.forEach(n)}catch{return[]}return t}function Kg(e,t,n=null){BL.test(t)&&Xg(FL(t),e,n)}function hd(e,t){Kg([e],t)}var Qi="",$L=4,Yg=0;function WL(){return Yg+=1,`${Math.random().toString(36).slice(2)}${Yg.toString(36)}`}function qL(e,t,n){if(e.split(`${Qi}${t}:`).length-1!==n.length)return;const r=e.split(new RegExp(`<!--${Qi}${t}:(\\d+)${Qi}-->`)),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 Ya(e,t,n){const r=Ka(e),o=r.map(l=>Zi(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:Ka(i),a=r.map(l=>l.data);for(let l=0;l<$L;l++){const c=WL(),u=[];s.forEach((f,h)=>{const m=o[h];m!==void 0&&(f.data=`${Qi}${c}:${u.length}${Qi}`,u.push(m))});const d=qL(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 _r(e){return Ya(e,!0,!1)}function Ke(e){return Ya(e,!1,!1)}function Zg(e){return Ya(e,!0,!0)}function zL(e){return Ya(e,!1,!0)}function ke(e,t){e.innerHTML=t,hd(e,t)}function jt(e,t){ke(e,Ke(t))}function pd(e){Ji(e,Ke(e))}function Ji(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);Kg(i,t,n)}var Qg=new Set(["text/x-handlebars-template","text/html"]);function Za(e,t){if(e.type!==D.HTML||!t)return!1;const n=t.tag?.toLowerCase(),r=t.attributes?.type;return n==="style"||n==="script"&&!Qg.has(typeof r=="string"?r:"")}var UL={amp:"&",lt:"<",gt:">",nbsp:String.fromCodePoint(160),quot:'"'};function gd(e){return e.replaceAll(/&(amp|lt|gt|nbsp|quot);/g,(t,n)=>UL[n])}var Jg=Symbol("rawTextSource");function bd(e){const t=document.createTextNode(gd(e));return eb(t,e),t}function eb(e,t){Object.defineProperty(e,Jg,{value:t,configurable:!0})}function jL(e,t){e.data=gd(t),eb(e,t)}function tb(e){const t=e[Jg];return t!==void 0&&gd(t)===e.textContent?t:void 0}var Mo,Jr;function nb(e){const t=Mo;return Mo=e,()=>{Mo===e&&(Mo=t)}}function VL(e){const t=Jr;return Jr=e,()=>{Jr===e&&(Jr=t)}}function rb(e,t,n){return Mo?Mo(e,t,n):n}function GL(){return Jr!==void 0}function ob(e,t,n){return Jr?Jr(e,t,n):n}var yd;function XL(){return yd||(yd=document.implementation.createHTMLDocument("")),yd}function KL(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 YL=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),ZL=new Set(["script","style","xmp"]);function QL(e,t){return!(t&&ZL.has(t.toLowerCase())||YL.has(e.toLowerCase()))}var JL=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},eN=new Set(["head","body"]);function ib(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=XL(),s=eN.has(r)?KL(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 er(e,t,n){try{QL(t,e.tagName)&&!JL(n)?e.setAttribute(t,n):ib(e,t,n)}catch{ib(e,t,n)}}function sb(){return wr("<script><\/script>")}var tN="text/x-em-dormant",es=Symbol("dormantScriptType");function vd(e){e[es]=e.getAttribute("type"),e.setAttribute("type",tN)}function Qa(e){return es in e}function nN(e){const t=[...e].filter(n=>!Qa(n));return t.forEach(vd),t}function rN(e,t){return Qa(e)?(e[es]=t,!0):!1}function ab(e){const t=new Set;for(const n of e){const r="querySelectorAll"in n?n.querySelectorAll("script"):[];for(const o of[n,...r])Qa(o)&&t.add(o)}return[...t]}function lb(e){if(!Qa(e))return;const t=e[es];delete e[es],typeof t=="string"?e.setAttribute("type",t):e.removeAttribute("type")}var oN=["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 iN(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 cb(e){const t=iN(e);return oN.includes(t)?"classic":t==="module"||t==="importmap"||t==="speculationrules"?t:void 0}function sN(e){return cb(e)==="classic"}function aN(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 lN(e){const t=cb(e);return!t||t==="speculationrules"||Ja(e)?!1:t!=="classic"||!e.hasAttribute("nomodule")&&aN(e)}function cN(e){return e.hasAttribute("src")&&!["async","defer","nomodule"].some(t=>e.hasAttribute(t))&&sN(e)}function Ja(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 ub(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 db(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 fb(e,t,n){e.replaceWith(t),t.append(...e.childNodes),n.substitute?.(e,t)}function mb(e,t){const n=sb();return db(e,n),t.quiet(()=>fb(e,n,t)),n}function uN(e,t,n){const r=mb(t,n),o=()=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r.isConnected&&(n.quiet(()=>{db(r,t),vd(t),fb(r,t,n),lb(t)}),ub(t,n))};e.addEventListener("load",o),e.addEventListener("error",o)}function hb(e,t){e.forEach(lb);const n=e.filter(Ja),r=e.filter(i=>i.isConnected&&!Ja(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=>mb(i,t));let o;for(const i of r)o&&!i.hasAttribute("src")?uN(o,i,t):(ub(i,t),o=cN(i)?i:o)}function eo(e,t=!0,n=!1){const r=e.content;switch(e.type){case D.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(eo(i,!0,n));return o}case D.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case D.COMMENT:return document.createComment(r||"");case D.ELEMENT:if(e.tag){const o=e.tag.toLowerCase()==="script",i=n===!0&&o?sb():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=rb(i,s,typeof a=="string"?a:"");l!==null&&er(i,s,l)}catch{}}if(n==="dormant"&&o&&vd(i),t){const s=e.tag.toLowerCase()==="template"?!0:n;for(const a of e.children)i.appendChild(Za(a,e)?bd(a.content||""):eo(a,!0,s))}return i}return document.createTextNode("<");case D.HTML:return wr(r||"");default:throw new Error("unsupported node")}}function Le(e,t=!1){return hn(e).roots.map(n=>eo(n,!0,t))}function el(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 pb(e,t){e.replaceChildren(...Le(t,!0))}function tr(e,t,n){el(e,t,Le(n,!0))}var gb=Symbol.for("emailmaker.documentWriteGuard"),ts=Symbol.for("emailmaker.documentWriteSink");function dN(e,t=document){const n=t,r=n[ts];return n[ts]=e,()=>{n[ts]===e&&(n[ts]=r)}}function fne(e){}function Ed(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0})}function fN(e,t,n){for(let r=e.writerOf.get(t);r;r=e.writerOf.get(r))if(r===n)return!0;return!1}function mN(e,t){let n=t;for(;n.nextSibling&&fN(e,n.nextSibling,t);)n=n.nextSibling;return n}function bb(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,mN(e,t).nextSibling)}},o=e.doc[ts];o?o(n,r,t):r()}function yb(e,t){return!!e&&e.type===D.ELEMENT&&!e.closed&&e.end===t}function hN(e,t){let n="";for(let r=e;yb(r,t);r=r.lastChild)n=`</${r.tag}>${n}`;return n}function pN(e){const t=hn(e).roots,n=t[t.length-1],r=yb(n,e.length);return{nodes:(r?t.slice(0,-1):t).map(o=>eo(o)),rest:r?e.slice(n.start):""}}function gN(e){const t=[...e.pending];e.pending.clear();for(const[n,r]of t){const o=hn(r).roots,i=r+hN(o[o.length-1],r.length);bb(e,n,hn(i).roots.map(s=>eo(s)))}}function vb(e,t,n){const r=e.doc.currentScript;if(!r?.parentNode){return}const{nodes:o,rest:i}=pN((e.pending.get(r)??"")+n);i?(e.pending.size||queueMicrotask(()=>gN(e)),e.pending.set(r,i)):e.pending.delete(r),bb(e,r,o)}function bN(e=document){const t=e;if(t[gb])return;t[gb]=!0;const n={doc:t,writerOf:new WeakMap,pending:new Map};Ed(e,"write",(...r)=>vb(n,"write",r.join(""))),Ed(e,"writeln",(...r)=>vb(n,"writeln",`${r.join("")}
|
|
2
|
-
`)),Ed(e,"open",(...r)=>r.length>=3?e.defaultView?.open(r[0],r[1],r[2])??null:e)}bN();function yN(e){return e}var vN=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),A(this,"cycle",void 0),this.cycle=e}};function EN(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 SN(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 wN(e){const t=EN(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 vN([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of SN(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 Ee=class Qk{constructor(t=[]){A(this,"_inner",void 0),A(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof Qk&&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 Sd(e){return`service_container_${e}`}var ns=new Set,wd;function _N(){if(!wd)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,Eb.prototype.getInstanceAsync),e.stack}function _d(e){ns.delete(e)&&wd?.end(e)}var Eb=class Tg extends Ee{_runCallbacks(t){[...this._injectCallbacks].forEach(n=>n(t))}constructor(t=null){super(),A(this,"_parent",void 0),A(this,"_injectCallbacks",[]),A(this,"_injections",Object.create(null)),A(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 Ee){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=_N();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};ns.add(s),wd?.start(s),this._onInject(t,()=>{_d(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(ns))n.container===this&&(_d(n),n.reject(t))}pendingWaits(){return[...ns].filter(t=>t.container===this)}addService(t,n){const r=Sd(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new Ee;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=Sd(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 Ee;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=Sd(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new Tg(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new Tg(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(ns))t.container===this&&_d(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function Cd(e){return e.startsWith("__")?e:`__${e}__`}function CN(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=Cd(e),n=globalThis;return n[t]??(n[t]={})}function TN(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function AN(e){if(e)return Cd(e);const t="useblocks".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return Cd(t)}function Td(e){const t=AN(e),n=CN(t);if(TN(n.container))return n.container;const r=new Eb(null);return n.container=r,r}function kN(){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 LN(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():kN()}function ae(e=LN()){return e}function Sb(){return"iframe".trim()||"unknown"}function NN(e){if(typeof globalThis>"u")return;const t=Sb(),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 xN(){const e="useblocks".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function ON(e,t){if(NN(t),typeof globalThis>"u")return e;const n=Sb(),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 tl;function RN(){if(tl)return tl;const e=xN();return tl=ON(Td(e),e),tl}var mne=new Proxy({},{get(e,t,n){const r=RN(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),MN=new Function("url","return import(url)");function PN(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function Ad(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function wb(e){return e.type==="umd"||e.resolve==="registry"}var IN="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 DN(e){const t=Array.isArray(e)?e[0]:e;return Ad(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function BN(e,t){const n=DN(e),r=Ad(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&wb(r)&&!/compat/iu.test(o)?` ${IN}`:"",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 HN(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function hne(e){return e}var FN=class{constructor(e,t,n={}){A(this,"_context",void 0),A(this,"_pluginRegistry",void 0),A(this,"_options",void 0),A(this,"_map",new Map),A(this,"_optionsMap",new Map),A(this,"_readyMap",new Map),A(this,"_resolveMap",new Map),A(this,"_initializingPlugins",new Map),A(this,"_creatingPlugins",new Set),A(this,"_initializedPlugins",new Set),A(this,"_creationOrder",[]),A(this,"_lifecycleListeners",new Set),A(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(Ad(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(wb(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await MN(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):HN(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=BN(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 PN(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 this._callSync(n,r,"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 this._callSync(n,r,"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)}_callSync(e,t,n){this._emitLifecycle({type:`${n}:enter`,plugin:e,name:t});try{return e[n]?.()}finally{this._emitLifecycle({type:`${n}:leave`,plugin:e,name:t})}}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)}))}},_b=class{constructor(){A(this,"_plugins",new Map),A(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)}}}},$N=class{constructor(e){A(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()}},Y=ae("SandboxHtmlDocument"),ot=ae("SandboxRemoteDocument"),rs=ae("SandboxTextDocument"),pn=ae("SandboxDocumentMapping"),Te=ae("SandboxSyncCommit"),os=ae("SandboxLayoutProfile"),Cb=ae("SandboxState"),Ne=ae("SandboxSelectionLock"),Ye=ae("SandboxEditLock"),Po=ae("SandboxAttributePipeline"),kd=ae("SandboxAmpService"),Ld=ae("SandboxImageReload"),nl=ae("SandboxImageCache"),it=ae("SandboxFocus"),Nd=ae("SandboxLocalization"),Ie=ae("SandboxElementSettings"),Io=ae("SandboxElementRefs"),yt=ae("SandboxSetCursor"),Tb=ae("SandboxStyleRoot"),Ab=ae("SandboxVmlWidthResolver"),rl=ae("SandboxPrepareHtml"),is=ae("SandboxSurfaceName"),Do=ae("SandboxDocumentSync"),Bo=ae("SandboxMapObj"),Ho=ae("SandboxActiveElementFingerprint"),ol=ae("SandboxToggleTextStyle"),gn=ae("SandboxWrapEditor"),Cr=ae("SandboxInsertServices"),ss=ae("SandboxInitPreview"),xd=ae("SandboxInsertPolicy"),Fo=ae("SandboxTableSelections"),kb=ae("SandboxNarrowTableTextAtom"),Lb=ae("SandboxSettingsExtras"),Nb=ae("SandboxViewportHandlers"),xb=ae("SandboxOperations"),$o=ae("SandboxApplyElementSettings"),Tr=ae("SandboxOperationEnvironment"),Wo=ae("SandboxHostFacts"),WN="__sandbox__",Mt=Td(WN);function qN(e){return e}function zN(e,t=Mt){t.inject(is,e.name),t.inject(os,e.profile);for(const n of wN(e.units))n.setup(t);return t}function bn(e,t){e.remove?.(t)}function R(e,t){const n=e.getInstance(t);if(n===void 0)throw new Error(`[sandbox] служба «${String(t)}» не зарегистрирована: её фича не подключена или ещё не зарегистрирована`);return n}var Ob=class extends Ee{constructor(e={}){super(),A(this,"_options",void 0),A(this,"_listeners",[]),A(this,"on",this._addListener.bind(this)),A(this,"event",this._addListener.bind(this)),A(this,"once",(t,n=0,r)=>{const o=this._addListener((...i)=>(o?.dispose(),r?t.call(r,...i):t(...i)),n);return o}),A(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()}},UN=class extends Ob{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}}},ge=class extends UN{execute([e],t){for(const n of t)try{n(e)}catch{}}},jN=class extends Ob{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 VN(e,t,n){let r;const o=new ge({onFirstListenerAdd(){r=o.addDisposable(new Ee),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function GN(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 XN(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 pne(e){return e}function KN(e){return e&&typeof e=="object"}function Rb(e,t){return e&&typeof e=="object"&&e.operationId===t}var Mn="INIT_MESSAGE",YN="em:port-ready",ZN="em:window-drained",Od="";function Mb(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var QN=class extends Ee{constructor(...e){super(...e),A(this,"_listeners",Object.create(null)),A(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)}}}),A(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)}}),A(this,"addListener",(t,n,r=0)=>this.addListenerAsync(t,(o,i)=>{try{n(o)}catch{}return i&&i(o)},r))}},JN=class extends Ee{constructor(e,t){super(),A(this,"_singleton",void 0),A(this,"_target",void 0),A(this,"_transport",void 0),A(this,"_transportSubscription",void 0),A(this,"_ports",new Map),A(this,"_drained",new WeakSet),A(this,"_portSendHeld",new WeakSet),A(this,"_inited",!1),A(this,"_emitter",this.addDisposable(new QN)),A(this,"_handshaken",new WeakSet),A(this,"_greeted",new WeakSet),A(this,"_outgoingFilter",void 0),A(this,"_outgoingObservers",new Set),A(this,"_offTargetListeners",new Map),A(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)&&Rb(o,Mn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:Mn,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),KN(o)&&l||this._singleton&&Rb(o,Mn)){if(s&&l){const f=this._target;Promise.resolve().then(()=>this.usePort(s,!0,f))}const c=this._emitter.fireAsync(o.operationId||Od,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=GN({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(Mn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(Mn))}),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(Mn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:Mn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:Mn,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:Mn,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=XN(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:YN,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:ZN,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(Od,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Mb(),o=Mb();return new Promise((i,s)=>{const a=this.addDisposable(new Ee);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(Od,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 Ee);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(Mn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}};function Pb(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 Ib(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 e2=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function t2(e){return e.replace(e2,t=>/^<br\b/i.test(t)?" ":"")}var n2={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"},to=8e3,r2=2e3,o2=15e3,Rd=3e3,i2="fonts.googleapis.com",s2=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},a2=e=>{const t=s2(String(e??""));return t?t.hostname===i2&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},de={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_EBLOCK_CLEAR_EM_BLOCK_ID:"sandbox_eblock_clear_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",SANDBOX_ELEMENT_OPERATION:"sandbox_element_operation"},l2=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"),TABLE_MENU_COLUMNS:e("Columns"),TABLE_MENU_ROWS:e("Rows"),DROP_BLOCK_HINT:e("Click or drag a block")}),z=new JN(window.parent,!0),il,as,Db=Math.random().toString(36).slice(2,8),c2=0,sl;function Bb(e,t){const n=il;il=e;try{return t()}finally{il=n}}function al(e,t){const n=as;as=e;try{return t()}finally{as=n}}function u2(){return as}function d2(){try{return il?.()}catch{return}}function f2(){return sl||(sl=`${Db}:${++c2}`,Promise.resolve().then(()=>{sl=void 0})),sl}function st(e,t){const n=d2();return z.send(de.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:as??"other",batch:f2(),instance:Db}),t}function Md(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(Md(e,o)===!1)return!1;return!0}function Hb(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function m2(e,t){return Hb(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(Md(e,o[i])===!1)return!1}},t)}function nr(e,t,n){Md(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(Hb(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),m2(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var h2=e=>e.type===D.HTML?e.start-1:e.start,p2=e=>e.type===D.HTML?e.end+1:e.end;function g2(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(h2(o)>=n||p2(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function b2(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function Fb(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n>0)return t[n-1]}}function Ar(e){let t=e;do t=y2(t);while(t&&t.type===D.HTML&&!t.content);return t}function y2(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return st("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var no=class{constructor(e,t,n,r){A(this,"originalStart",void 0),A(this,"originalLength",void 0),A(this,"modifiedStart",void 0),A(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 $b(e,t){return(t<<5)-t+e|0}function v2(e,t){t=$b(149417,t);for(let n=0,r=e.length;n<r;n++)t=$b(e.charCodeAt(n),t);return t}var Wb=class{constructor(e){A(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 qb(e,t,n){return new E2(new Wb(e),new Wb(t)).ComputeDiff(n).changes}var qo=class{static Assert(e,t){if(!e)throw new Error(t)}},zo=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]}},zb=class{constructor(){A(this,"m_changes",void 0),A(this,"m_originalStart",void 0),A(this,"m_modifiedStart",void 0),A(this,"m_originalCount",void 0),A(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 no(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}},E2=class Gi{constructor(t,n,r=null){A(this,"ContinueProcessingPredicate",void 0),A(this,"_originalSequence",void 0),A(this,"_modifiedSequence",void 0),A(this,"_hasStrings",void 0),A(this,"_originalStringElements",void 0),A(this,"_originalElementsOrHash",void 0),A(this,"_modifiedStringElements",void 0),A(this,"_modifiedElementsOrHash",void 0),A(this,"m_forwardHistory",void 0),A(this,"m_reverseHistory",void 0),this.ContinueProcessingPredicate=r,this._originalSequence=t,this._modifiedSequence=n;const[o,i,s]=Gi._getElements(t),[a,l,c]=Gi._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(Gi._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=v2(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)?Gi._getStrictElement(this._originalSequence,t)===Gi._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?(qo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new no(t,0,r,o-r+1)]):t<=n?(qo.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new no(t,n-t+1,r,0)]):(qo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),qo.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 no(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,f,h,m,p,v,C,k){let L=null,E=null,g=new zb,y=n,w=r,b=h[0]-v[0]-o,S=-1073741824,_=this.m_forwardHistory.length-1;do{const T=b+t;T===y||T<w&&c[T-1]<c[T+1]?(d=c[T+1],m=d-b-o,d<S&&g.MarkNextChange(),S=d,g.AddModifiedElement(d+1,m),b=T+1-t):(d=c[T-1]+1,m=d-b-o,d<S&&g.MarkNextChange(),S=d-1,g.AddOriginalElement(d,m+1),b=T-1-t),_>=0&&(c=this.m_forwardHistory[_],t=c[0],y=1,w=c.length-1)}while(--_>=-1);if(L=g.getReverseChanges(),k[0]){let T=h[0]+1,x=v[0]+1;if(L!==null&&L.length>0){const N=L[L.length-1];T=Math.max(T,N.getOriginalEnd()),x=Math.max(x,N.getModifiedEnd())}E=[new no(T,f-T+1,x,p-x+1)]}else{g=new zb,y=s,w=a,b=h[0]-v[0]-l,S=1073741824,_=C?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const T=b+i;T===y||T<w&&u[T-1]>=u[T+1]?(d=u[T+1]-1,m=d-b-l,d>S&&g.MarkNextChange(),S=d+1,g.AddOriginalElement(d+1,m+1),b=T+1-i):(d=u[T-1],m=d-b-l,d>S&&g.MarkNextChange(),S=d,g.AddModifiedElement(d+1,m+1),b=T-1-i),_>=0&&(u=this.m_reverseHistory[_],i=u[0],y=1,w=u.length-1)}while(--_>=-1);E=g.getChanges()}return this.ConcatenateChanges(L,E)}ComputeRecursionPoint(t,n,r,o,i,s,a){let l=0,c=0,u=0,d=0,f=0,h=0;t--,r--,i[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const m=n-t+(o-r),p=m+1,v=new Int32Array(p),C=new Int32Array(p),k=o-r,L=n-t,E=t-r,g=n-o,y=(L-k)%2===0;v[k]=t,C[L]=n,a[0]=!1;for(let w=1;w<=m/2+1;w++){let b=0,S=0;if(w>100)return null;u=this.ClipDiagonalBound(k-w,w,k,p),d=this.ClipDiagonalBound(k+w,w,k,p);for(let T=u;T<=d;T+=2){T===u||T<d&&v[T-1]<v[T+1]?l=v[T+1]:l=v[T-1]+1,c=l-(T-k)-E;const x=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(v[T]=l,l+c>b+S&&(b=l,S=c),!y&&Math.abs(T-L)<=w-1&&l>=C[T])return i[0]=l,s[0]=c,x<=C[T]&&w<=1448?this.WALKTRACE(k,u,d,E,L,f,h,g,v,C,l,n,i,c,o,s,y,a):null}const _=(b-t+(S-r)-w)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(b,_))return a[0]=!0,i[0]=b,s[0]=S,_>0&&w<=1448?this.WALKTRACE(k,u,d,E,L,f,h,g,v,C,l,n,i,c,o,s,y,a):(t++,r++,[new no(t,n-t+1,r,o-r+1)]);f=this.ClipDiagonalBound(L-w,w,L,p),h=this.ClipDiagonalBound(L+w,w,L,p);for(let T=f;T<=h;T+=2){T===f||T<h&&C[T-1]>=C[T+1]?l=C[T+1]-1:l=C[T-1],c=l-(T-L)-g;const x=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(C[T]=l,y&&Math.abs(T-k)<=w&&l<=v[T])return i[0]=l,s[0]=c,x>=v[T]&&w<=1448?this.WALKTRACE(k,u,d,E,L,f,h,g,v,C,l,n,i,c,o,s,y,a):null}if(w<=1447){let T=new Int32Array(d-u+2);T[0]=k-u+1,zo.Copy2(v,u,T,1,d-u+1),this.m_forwardHistory.push(T),T=new Int32Array(h-f+2),T[0]=L-f+1,zo.Copy2(C,f,T,1,h-f+1),this.m_reverseHistory.push(T)}}return this.WALKTRACE(k,u,d,E,L,f,h,g,v,C,l,n,i,c,o,s,y,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,h=r.modifiedStart-d;if(f<o||h<i||s&&!this.OriginalElementsAreEqual(f,f+r.originalLength)||a&&!this.ModifiedElementsAreEqual(h,h+r.modifiedLength))break;const m=(f===o&&h===i?5:0)+this._boundaryScore(f,r.originalLength,h,r.modifiedLength);m>c&&(c=m,l=d)}r.originalStart-=l,r.modifiedStart-=l;const u=[null];if(n>0&&this.ChangesOverlap(t[n-1],t[n],u)){t[n-1]=u[0],t.splice(n,1),n++;continue}}if(this._hasStrings)for(let n=1,r=t.length;n<r;n++){const o=t[n-1],i=t[n],s=i.originalStart-o.originalStart-o.originalLength,a=o.originalStart,l=i.originalStart+i.originalLength,c=l-a,u=o.modifiedStart,d=i.modifiedStart+i.modifiedLength,f=d-u;if(s<5&&c<20&&f<20){const h=this._findBetterContiguousSequence(a,c,u,f,s);if(h){const[m,p]=h;(m!==o.originalStart+o.originalLength||p!==o.modifiedStart+o.modifiedLength)&&(o.originalLength=m-o.originalStart,o.modifiedLength=p-o.modifiedStart,i.originalStart=m+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 h=this._contiguousSequenceScore(d,f,i);h>0&&h>l&&(l=h,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 zo.Copy(t,0,o,0,t.length-1),o[t.length-1]=r[0],zo.Copy(n,1,o,t.length,n.length-1),o}else{const o=new Array(t.length+n.length);return zo.Copy(t,0,o,0,t.length),zo.Copy(n,0,o,t.length,n.length),o}}ChangesOverlap(t,n,r){if(qo.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),qo.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 no(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 ll(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}var Vt=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){A(this,"oldPosition",void 0),A(this,"oldText",void 0),A(this,"newPosition",void 0),A(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} "${ll(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${ll(this.oldText)}")`:`(replace@${this.oldPosition} "${ll(this.oldText)}" with "${ll(this.newText)}")`}};function At(e,t){return e===null||e.length===0?t:new S2(e,t).compress()}var S2=class Er{constructor(t,n){A(this,"_prevEdits",void 0),A(this,"_currEdits",void 0),A(this,"_result",void 0),A(this,"_resultLen",void 0),A(this,"_prevLen",void 0),A(this,"_prevDeltaOffset",void 0),A(this,"_currLen",void 0),A(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 Vt(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 Vt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new Vt(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 Vt(t.oldPosition,t.oldText,t.newPosition,r),new Vt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new Vt(t.oldPosition,r,t.newPosition,t.newText),new Vt(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 Vt(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 Ub(e){return new Vt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Pn(e){return e.map(Ub)}function w2(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 _2(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 cl(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=_2({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new Vt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function jb(e,t,n=0){const r=e.range;return new Vt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Uo(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),jb({text:r,range:{start:o,end:i}},t,s)})}function C2(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function ro(e){return e.map(t=>C2(t))}function T2(e,t=ls(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var gne=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function A2(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function ls(e){return{start:0,end:e.getLength()}}function k2(e,t,n){return`${e.substring(0,n.start)}${t}${e.substring(n.end)}`}function cs(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 L2(e,t){return t=ul(t).sort(({range:n},{range:r})=>n.start-r.start),cs(e,t)}function us(e,t){return e>=t.start&&e<=t.end}function ul(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(us(i.start,l)&&us(i.start,l))c=l;else if(us(l.start,i))us(l.end,i)?c=i:c={start:i.start,end:l.end};else if(us(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 h=k2(u,a.text,{start:d,end:f});e[r]=o={range:i=c,text:h},e.splice(s--,1),n--}}return e}function N2(e,t){if(e.length<=1)return e[0]||null;e=ul(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:cs(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 x2(e,t){const n=Pn(e),r=N2(ro(n),t);if(r){const o=jb(r,t);return Ub(o)}return null}function O2(e,{range:t,text:n}){const r=e.getText(t);return qb(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 Vb({oldText:e,newText:t,oldPosition:n,newPosition:r}){return qb(e,t,!0).map(o=>new Vt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var R2=class{constructor(e,t){A(this,"index",void 0),A(this,"values",void 0),A(this,"type","insert"),this.index=e,this.values=t}},M2=class{constructor(e,t){A(this,"index",void 0),A(this,"howMany",void 0),A(this,"type","remove"),this.index=e,this.howMany=t}},P2=class{constructor(e,t,n){A(this,"from",void 0),A(this,"to",void 0),A(this,"howMany",void 0),A(this,"type","move"),this.from=e,this.to=t,this.howMany=n}};function I2(e,t){return e===t}function D2(e,t,n=I2){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,h=0;do s[l++]=a[u++]=!0,h++;while(l<r&&u<o&&n(e[l],t[u])&&!a[u]);i.push(new P2(d,f,h)),l--;break}var m=[];for(l=0;l<r;){if(s[l]){l++;continue}for(var p=l,h=0;l<r&&!s[l++];)h++;m.push(new M2(p,h))}for(var v=[],u=0;u<o;){if(a[u]){u++;continue}for(var p=u,h=0;u<o&&!a[u++];)h++;var C=t.slice(p,p+h);v.push(new R2(p,C))}var k=v.length,L=m.length,E=i.length,g,y,w=0;for(g=0;g<L;g++){var b=m[g];for(b.index-=w,w+=b.howMany,y=0;y<E;y++){var S=i[y];S.from>=b.index&&(S.from-=b.howMany)}}for(g=k;g--;){var _=v[g],h=_.values.length;for(y=E;y--;){var S=i[y];S.to>=_.index&&(S.to-=h)}}for(g=E;g-- >1;){var S=i[g];if(S.to!==S.from)for(y=g;y--;){var T=i[y];T.to>=S.to&&(T.to-=S.howMany),T.to>=S.from&&(T.to+=S.howMany)}}var x=[];for(g=0;g<E;g++){var S=i[g];if(S.to!==S.from)for(x.push(S),y=g+1;y<E;y++){var N=i[y];N.from>=S.from&&(N.from-=S.howMany),N.from>=S.to&&(N.from+=S.howMany)}}return[...m,...x,...v]}var Gb=class{constructor(){A(this,"_byKey",new Map),A(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,h){return{type:"Add",node:f,nextSibling:h,parent:d}}e.add=t;function n(d){return{type:"Remove",node:d}}e.remove=n;function r(d,f,h){return{type:"Attribute",node:d,name:f,value:h}}e.attribute=r;function o(d,f,h){return h?{type:"Update",prev:d,next:f,soft:h}:{type:"Update",prev:d,next:f}}e.update=o;function i(d,f,h,m){return[{type:"Remove",node:d},{type:"Add",node:h,nextSibling:m,parent:f,replaces:d}]}e.recreate=i;function s(d,f,h){return{type:"Move",node:f,nextSibling:h,parent:d}}e.move=s;function a(d,f){return{type:"Set",node:d,data:f}}e.set=a;function l(d,f,h){return{type:"ClassList",node:d,addedClasses:f,removedClasses:h}}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 Xb(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var Kb=[],Yb=[];function B2(e){return Xb(Kb,e)}function Pd(e){return e?Kb.some(t=>t(e)):!1}function H2(e){return Xb(Yb,e)}function F2(e){return Yb.some(t=>t(e))}function $2(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 W2(e){let t=[];const n=e.children.filter(o=>o.type!==D.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 q2(e){return le.remove(e)}var z2=new Set(["head","body","html"]),U2=e=>e.type===D.ROOT||e.type===D.DOCTYPE||e.type===D.ELEMENT&&e.tag&&z2.has(e.tag.toLowerCase()),j2=/^<[!?/]/;function Id(e){return e.type===D.ELEMENT?String(e.tag):e.type===D.HTML&&j2.test(e.content??"")?"bogus":String(e.type)}function dl(e){const t=new Gb,n=Object.create(null);for(const r of e){const o=Id(r)+(!U2(r)&&r.start===r.end?"_hidden":"");let i="";r.type===D.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Zb(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 fl(e,t){const n=e[t-1];return t<e.length?e[t].shift:n.shift+n.delta}function Dd(e,t){return(e.type===D.HTML?e.end+1:e.end)<=t.oldPosition}function V2(e,t){return(e.type===D.HTML?e.start-1:e.start)>=t.oldEnd}function Bd(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 Hd(e,t){return t.type===e.type&&Id(t)===Id(e)&&t.attributes?.id===e.attributes?.id}function ds(e,t,n){return Jn(e,!1,n)===Jn(t,!1,n)}function Fd(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 ml(e,t,n=0){return Fd(t.length,n,r=>!V2(e,t[r]))}function $d(e,t){const n=ml(e,t);return t.slice(n,ey(e,t,n))}function Qb(e,t){const n=ml(e,t);return n<t.length&&!Dd(e,t[n])?void 0:e.start+fl(t,n)}function hl(e){return e.type===D.ELEMENT?e.attributes?.id:void 0}function Jb(e){const t=new Set,n=new Set;for(const r of e){const o=hl(r);o&&(t.has(o)?n:t).add(o)}return n}function G2(e,t,n){const r=new Set([...Jb(t),...Jb(n)]),o=new Map;e.forEach((s,a)=>{for(let l=s.prevFrom;l<s.prevTo;l++){const c=hl(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=hl(n[l]),u=c?o.get(c):void 0;c&&u&&u.gap!==a&&!r.has(c)&&Hd(u.node,n[l])&&i.set(c,u.node)}}),i}function X2(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=ml(u,n,s),s<n.length&&!Dd(u,n[s]))continue;const d=u.start+fl(n,s),f=Fd(t.length,a,h=>t[h].start>=d);Bd(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 ey(e,t,n){return Fd(t.length,n,r=>Dd(e,t[r]))}function ty(e,t,n,r,o,i,s){const a=ml(e,o),l=ey(e,o,a),c=(p,v=()=>!0)=>p?.find(C=>C>=n&&C<r&&Hd(e,t[C])&&v(t[C]))??-1,u=e.start+fl(o,a),d=e.end+fl(o,l),f=a===o.length||e.start<o[a].oldPosition,h=f?c(s.byStart.get(u)):-1,m=l>a&&e.end>o[l-1].oldEnd?c(s.byEnd.get(d),p=>!(f&&Y2(e,p,u))):-1;return h>=0&&m>=0&&h!==m?ds(e,t[h],i)||ds(e,t[m],i)?ds(e,t[h],i)?h:m:ry(e,t[m],o)>ry(e,t[h],o)?m:h:h>=0?h:m}function ny(e,t,n){const r=e.get(t);r?r.push(n):e.set(t,[n])}function K2(e,t,n){const r={byStart:new Map,byEnd:new Map};for(let o=t;o<n;o++)ny(r.byStart,e[o].start,o),ny(r.byEnd,e[o].end,o);return r}function Y2(e,t,n){for(let r=t.lastChild;r&&r.end===t.end;r=r.lastChild)if(r.start===n&&Hd(e,r))return!0;return!1}function ry(e,t,n){const r=new Map(t.children.map(o=>[o.start,o]));return e.children.filter(o=>{const i=Qb(o,n);return i!==void 0&&Bd(o,r.get(i),i)}).length}function oy(e,t){return $d(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 Z2(e,t,n,r,o,i){const s=ds(e,t,i),a=ds(n,r,i);return s!==a?a:oy(n,o)>oy(e,o)}function Q2(e,t,n,r){const o=n.edits??[],i=[],s=[];let{prevFrom:a,prevTo:l,nextFrom:c,nextTo:u}=n;const d=K2(t,c,u);for(;o.length&&a<l&&c<u;){const f=ty(e[l-1],t,c,u,o,r,d);if(l-1===a){f>=0&&s.unshift([a,f]);break}const h=ty(e[a],t,c,u,o,r,d);let m=h>=0,p=f>=0;if(m&&p&&h>=f&&(p=Z2(e[a],t[h],e[l-1],t[f],o,r),m=!p),!m&&!p)break;m&&(i.push([a,h]),a++,c=h+1),p&&(s.unshift([l-1,f]),l--,u=f)}return[...i,...s]}function J2(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 ex(e,t,n,r,o){const i=o?.length?Qb(e,o):void 0;return(i===void 0?void 0:t.children.find(s=>Bd(e,s,i)))??r.getByKey(n.getByValue(e)??"")}function fs(e,t){for(const n of t)e.push(n)}function iy(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),[h,m]=o??[dl(d),dl(f)],p=D2(d,f,(C,k)=>h.getByValue(C)===m.getByValue(k)),v=C=>{const k=hl(C);return k?l.get(k):void 0};for(const C of p)switch(C.type){case"insert":{const k=u+C.index;let L=t[k];for(const E of C.values.reverse()){t.splice(k,0,E),i.add(E);const g=v(E);g?(fs(c,pl(g,E,s,a)),c.push(le.move(e,E,L))):c.push(le.add(e,E,L)),L=E}break}case"remove":{const k=t.splice(u+C.index,C.howMany);for(const L of k)v(L)!==L&&c.push(le.remove(L));break}case"move":{const k=t.splice(u+C.from,C.howMany);let L=t[u+C.to];t.splice(u+C.to,0,...k);for(const E of k.reverse()){const g=m.getByKey(h.getByValue(E)??"");if(!g)return st("error while sync",c);i.add(g),fs(c,pl(E,g,s,a,r.edits&&$d(E,r.edits))),c.push(le.move(e,g,L)),L=E}break}}return c}function Wd(e,t,n=!1,r=ud(),o){const i=[],s=dl(e.children),a=dl(t.children);for(let p=e.children.length-1;p>=0;p--){const v=e.children[p];if(v.type===D.ELEMENT&&v.start===v.end){const C=s.getByValue(v);if(!a.getByKey(C)){let k=!1;for(let L=p+1;L<e.children.length;L++){const E=e.children[L];if(E){const g=ex(E,t,s,a,o);if(g){const y=g.start,w=v.clone();t.children.splice(t.children.indexOf(g),0,w),nr(w,y-v.start),w.parent=t,a.set(C,w),k=!0;break}}}if(!k){const L=t.endTagStart===void 0?t.end:t.endTagStart,E=v.clone();t.children.push(E),a.set(C,E),nr(E,L-v.start),E.parent=t}}}}const l=e.children.filter(p=>p.type!==D.HTML||!!p.content),c=t.children.filter(p=>p.type!==D.HTML||!!p.content),u=o?.length?X2(l,c,o):null,d=u?G2(u,l,c):new Map,f=new Set;for(const p of u?[...u].reverse():[]){const v=J2(p,Q2(l,c,p,r)).reverse();for(const C of v)fs(i,iy(t,l,c,C,void 0,f,n,r,d))}const h={prevFrom:0,prevTo:l.length,nextFrom:0,nextTo:c.length,edits:o};u||fs(i,iy(t,l,c,h,[s,a],f,n,r)),c.length!==l.length&&st("error while sync");const m=new Map;for(const p of u??[h])for(let v=p.nextFrom;v<p.nextTo;v++)m.set(v,p.edits);for(let p=c.length-1;p>=0;p--){const v=c[p];if(!f.has(v)){const C=m.get(p);fs(i,pl(l[p],v,n,r,C&&$d(l[p],C)))}}return i}function qd(e){return e.type===D.ELEMENT&&Pd(e.tag)}function pl(e,t,n=!1,r=ud(),o){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(qd(e)&&e.tag===t.tag){if(Jn(e,!1,r)===Jn(t,!1,r))return[le.update(e,t,n),...Wd(e,t,!0,r)]}else if((e.type===D.ELEMENT||e.type===D.ROOT)&&e.tag===t.tag)return[le.update(e,t,n),...$2(e,t),...Wd(e,t,n,r,o)];if(e.type===D.HTML||e.type===D.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?st("cannot replace document",[]):qd(e)&&e.tag===t.tag?le.recreate(e,t.parent,t,Ar(t)||void 0):[le.remove(e),le.add(t.parent,t,Ar(t)||void 0)]}var rr="FROM_DOM",or="FROM_REMOTE",tx=/<\/.*>/i;function nx(e){return tx.test(e)}var rx=/^<[!?/][^>]*$/,ox=class extends Ee{constructor(e,t){super(),A(this,"_baseDocument",void 0),A(this,"_createRoot",void 0),A(this,"_beforeTextChangeEmitter",this.addDisposable(new ge)),A(this,"_onTextChangeEmitter",this.addDisposable(new ge)),A(this,"_onMutateEmitter",this.addDisposable(new ge)),A(this,"_beforeRefreshEmitter",this.addDisposable(new ge)),A(this,"_onRefreshEmitter",this.addDisposable(new ge)),A(this,"_root",new Tt(0,0,[])),A(this,"_applyingMutation",void 0),A(this,"_insertRun",void 0),A(this,"beforeTextChange",this._beforeTextChangeEmitter.event),A(this,"beforeRefresh",this._beforeRefreshEmitter.event),A(this,"onTextChange",this._onTextChangeEmitter.event),A(this,"onRefresh",this._onRefreshEmitter.event),A(this,"onMutate",this._onMutateEmitter.event),this._baseDocument=e,this._createRoot=t,this._baseDocument.onChanged(this._onTextChange.bind(this));const n=this._root=new Tt(0,0,[]);n.type=D.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}=hn(e),i=this._root=this._createRoot?this._createRoot(o,e):new Tt(0,e.length,o);if(i.type=D.ROOT,this._createRoot||o.forEach(s=>s.parent=i),!t){const s=n&&Zb(n);this._onRefreshEmitter.fire(r?Wd(r,i,!1,void 0,s):W2(i))}}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=x2(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),al("text",()=>this.replaceWithHtml(n,or,t))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&Ar(t)===n)return t;this.remove(t,r)}const o=this.contains(e),i=Va(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return st("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,nr(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=Va(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)nr(r,n-r.start),n+=o.length;nr(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=>Pd(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!==D.HTML){if(!u.closed)return!1}else return!u.content||!nx(u.content)&&!rx.test(u.content);return!0};if(!this._root)return this.initialize(r.getText(),!1,n);let i={start:e.oldPosition,end:e.oldEnd},s=g2(i,this._root);if(!s)return this.initialize(r.getText(),!1,n);let a,l,c;do{const u=A2(e,s);a=this._baseDocument.getText(u),[l,...c]=hn(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 st("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,nr(s,n.start-s.start,c),this._baseDocument.getText(s)!==i?(st("Error while sync"),s):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(pl(n,s,!1,void 0,o&&Zb(o))),n.parent=void 0,s)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return st("node is not in tree");const o=r.children,i=o.indexOf(e);if(i<0)return st("referenced node is not a child of parent node");const s=e.end-e.start;nr(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([q2(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=Fg(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=b2(e),c=s.length-a,u=e.start;nr(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=Va(e,o),l=a.length-s;nr(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=Ar(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=hn(t).roots;i.length!==1&&st("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(rr),this.insertBefore(n,t.node,r,rr));continue}switch(this._flushInsertRun(rr),t.type){case"Remove":this.remove(t.node,rr);break;case"Set":this.setContent(t.node,t.data,rr);break;case"Hidden":this.setHidden(t.node,t.value,rr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,rr)}}}finally{try{this._flushInsertRun(rr)}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function ix(e,t){return e.replace(new RegExp(`<(?=/${t.tagName}${ja})`,"gi"),"<")}function sy(e,t){return tb(e)??ix(e.textContent??"",t)}function yn(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!Qg.has(e.getAttribute("type")??"")}var sx=4,ax=3,lx=80,ay={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},cx={[D.HTML]:"text",[D.ELEMENT]:"element",[D.ROOT]:"root",[D.COMMENT]:"comment",[D.DOCTYPE]:"doctype",[D.ADVANCED]:"advanced"},ux=new Set(["head","body"]);function zd(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function ly(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,ax);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,lx)}function dx(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return ly(e.tag,zd(t.id),zd(t.class),zd(t.em))}function cy(e){return e instanceof Element?ly(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function Ud(e,t,n){const r=[];let o=e;for(;o&&r.length<sx;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function fx(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&ux.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==D.ROOT?"outside":t??"top"}function jd(e,t,n){const r=t(e);return{path:Ud(e,o=>o.parent,dx),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:Ud(r,o=>o.parentNode,cy)}:{},inMap:!!r,hasParent:!!e.parent,kind:cx[e.type]??String(e.type),root:fx(e)}}function uy(e,t,n){if(!e)return;const r=i=>jd(i,t,n);if(e.type==="Update")return{type:ay.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:ay[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 Vd(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===D.ROOT}function mx(e,t,n,r){const o=s=>jd(s,a=>r.getByNode(a),Vd),i=Ud(e,s=>s.parentNode,cy);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function hx(e,t){const n=r=>jd(r,o=>t.getByNode(o),Vd);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function px(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function dy(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var fy=Object.create(null);function my(e,t){const n=fy[e]||(fy[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[px(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function In(e){return e.nodeType===Node.ELEMENT_NODE}function hy(e){return In(e)?e.tagName==="AMP-IMG"?!0:my(e.tagName.toLowerCase(),"src"):!1}function Gd(e){return In(e)&&!e.ownerSVGElement}function gx(e){return e.tagName==="IMG"}function bx(e){return e.tagName==="FORM"}function yx(e){return e.tagName==="SCRIPT"}function vx(e){return e.tagName==="STYLE"}function Xd(e){return e.nodeType===Node.DOCUMENT_NODE}function py(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var ms;(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})(ms||(ms={}));function hs(e){return e.nodeType===Node.COMMENT_NODE}function oo(e){return e.nodeType===Node.TEXT_NODE}function Ex(e){return e.tagName==="TABLE"}async function Sx(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 Pt(e){if(In(e))return gy(e);if(Xd(e))return[...e.childNodes].map(r=>Pt(r)).join("");if(py(e))return dy(e);const t=Xa(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function wx(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"&&!my(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function kt(e){let t="";for(const n of e.childNodes)t+=tb(n)??Pt(n);return t}function gy(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=wx(e);return ld.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:vx(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${kt(e)}</${t}>`}function _x(e){return typeof e=="string"?e:""}function by(e,t,n){if(n&&e.type===D.DOCTYPE&&n?.type!==D.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=Za(e,n)?bd(e.content||""):eo(e,!1,"dormant");t.set(e,r);for(const o of e.children){const i=by(o,t,e);r.appendChild(i)}return r}function jo(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 Cx(e,t,n=Vd,r=()=>!1,o=()=>!1,i=()=>!1){let s,a;const l=new Map,c=()=>{const d=uy(s,f=>t.getByNode(f)||l.get(f),n);return d&&{...d,stage:"dom",...a?{cause:a}:{}}},u=d=>{a=d;try{st("Element node not in tree")}finally{a=void 0}};return Bb(c,()=>Tx(e,t,l,d=>s=d,u,r,o,i))}function Tx(e,t,n,r,o,i,s,a){const l=[],c=new Map,u=y=>t.getByNode(y)||n.get(y),d=y=>{if(y){const w=y.lastChild;let b=(w?u(w)?.nextSibling:u(y)?.firstChild)||void 0;for(;b&&c.has(b);)b=b.nextSibling||void 0;return b?.parentNode===u(y)?b:void 0}},f=new Map(e.flatMap(y=>y.type==="Update"?[[y.next,y.prev]]:[])),h=new Set(e.flatMap(y=>{if(y.type!=="Move")return[];const w=f.get(y.node);return[t.getByNode(y.node)??(w&&t.getByNode(w))]})),m=(y,w)=>{for(let b=Fb(y);b;b=Fb(b)){const S=f.get(b),_=u(b)??(S&&u(S));if(_&&!c.has(_)&&!h.has(_)&&w.contains(_)){const T=jo(_,w,i,s);if(T)return T;let x=_;for(;x.parentNode&&x.parentNode!==w;)x=x.parentNode;return{host:w,before:x}}}},p=y=>!!t.getByElement(y)||i(y)||s(y),v=new Set(e.flatMap(y=>y.type==="Remove"?[t.getByNode(y.node)]:[])),C=y=>!c.has(y)&&!v.has(y)&&!h.has(y),k=y=>Array.from(y.childNodes).some(w=>C(w)&&(!!t.getByElement(w)||k(w))),L=(y,w)=>{for(let b=w?w.previousSibling:y.lastChild;b;b=b.previousSibling)if(C(b)){if(t.getByElement(b))return;if(a(b))return k(b)?void 0:b}},E=(y,w,b)=>{const S=y===b?L(b,w):void 0;return S?{host:S,before:Array.from(S.childNodes).find(_=>C(_)&&i(_))}:{host:y,before:w}},g=(y,w,b)=>{const S=m(y,b);if(!S)return{host:b,before:d(w)};let _=S.before.nextSibling??void 0;for(;_&&(c.has(_)||h.has(_)||!p(_));)_=_.nextSibling??void 0;return{host:S.host,before:_}};for(const y of e)switch(r(y),y.type){case"Add":{let{node:w,nextSibling:b}=y;const S=w.parent;if(S){const _=by(w,n,S);if(S.type===D.ROOT)l.push(le.add(null,_,b&&u(b)));else{const T=u(S);if(T){let x,N=T;for(;b;){const I=n.get(b);if(I){const M=jo(I,T,i,s);x=M?.before??I,N=M?.host??T;break}let O=t.getByNode(b);if(O&&!c.has(O)&&T.contains(O)){x=O;const M=jo(O,T,i,s);if(M){N=M.host,x=M.before;break}for(;O.parentNode!==T&&O.parentNode;)O=O.parentNode,In(O)&&O.replaceWith(...O.childNodes);break}b=Ar(b)||void 0}x||({host:N,before:x}=g(w,S,T)),{host:N,before:x}=E(N,x,T),l.push(le.add(N,_,x))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:w,nextSibling:b}=y;const S=w.parent,_=u(w);if(S&&_)if(S.type===D.ROOT)l.push(le.move(null,_,b&&u(b)));else{const T=u(S);if(T){let x,N=T;for(;b;){const I=n.get(b);if(I){const M=jo(I,T,i,s);x=M?.before??I,N=M?.host??T;break}let O=t.getByNode(b);if(O&&!c.has(O)&&T.contains(O)){const M=jo(O,T,i,s);if(M)N=M.host,O=M.before;else for(;O.parentNode!==T&&O.parentNode;)O=O.parentNode;O||st("error while calculating next sibling"),x=O;break}b=Ar(b)||void 0}x||({host:N,before:x}=g(w,S,T)),l.push(le.move(N,_,x))}else o("parent-not-mapped")}else o(S?"node-not-mapped":"no-parent");break}case"Remove":{const w=y.node,b=u(w);if(w.type===D.HTML&&!w.content)continue;b?(c.set(b,w),l.push(le.remove(b))):o("node-not-mapped");break}case"Update":{const w=y.prev,b=u(w);b?n.set(y.next,b):y.soft||o("node-not-mapped");break}case"Attribute":{const w=u(y.node);w?l.push(le.attribute(w,y.name,y.value)):o("node-not-mapped");break}case"Set":{const w=y.node,b=u(w);b?w.type===D.HTML&&Ax(b,String(y.data??""))||py(b)&&w.type===D.DOCTYPE?l.push(le.set(b,y.data||"")):e.push(le.remove(w),le.add(w.parent||null,w,Ar(w)||void 0)):o("node-not-mapped");break}}return{mutations:l,toAdd:n,toRemove:c,isService:i}}function Ax(e,t){return oo(e)?!t.includes("<")||yn(e.parentNode)||oo(wr(t)):!1}function kx({mutations:e}){return ab(e.flatMap(t=>t.type==="Add"?[t.node]:[]))}var Lx=["src","type"];function Nx({mutations:e}){const t=new Set,n=r=>{r instanceof HTMLScriptElement&&r.isConnected&&!Ja(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"&&Lx.includes(r.name.toLowerCase())&&n(r.node);return[...t]}function xx(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 yy(e){const t=e.ownerDocument?.getSelection();return t?.anchorNode&&e.contains(t.anchorNode)?t:null}function Ox(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 Rx(e,t,n){const r=yy(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 Mx(e){return!!e&&e.prev!==e.next&&e.prev.at(-1)!==e.next.at(-1)}function Px(e){return!!e&&e.next.length>e.prev.length&&e.next.endsWith(e.prev)}function Kd(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=Ox(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&&Mx(r?.get(s))))break;return a&&i.contains(a)?{beside:a}:{text:s}}return o?{beside:o}:null}function vy(e,t,n){const r=t.parentNode;r&&e.collapse(r,[...r.childNodes].indexOf(t)+(n?1:0))}function Ix(e,t,{removed:n,rewrites:r}){const o=yy(e),i=o&&Kd(e,!0,n,r),s=o&&!i?Kd(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 vy(o,i.beside,!0),i.beside.nodeName==="BR"?i.beside:void 0;s?.text?o.collapse(s.text,0):s&&vy(o,s.beside,!1)}}catch{}}function Dx(e){const t=e.ownerDocument?.getSelection(),{anchorNode:n,anchorOffset:r}=t??{};return!!t?.isCollapsed&&n===e.parentNode&&n?.childNodes[(r??0)-1]===e}function Ey(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)||Px(i.get(a)))&&(!n.has(a)||Kd(a,!0,n,i)?.text)?{node:a,offset:0}:{node:e,offset:t}}function Bx(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=Ey(r,o??0,t),l=Ey(i,s??0,t);(a.node!==r||l.node!==i)&&n.setBaseAndExtent(a.node,a.offset,l.node,l.offset)}catch{}}function Sy(e,t,n){if(t?.parentNode===e)return[e,t];const r=t&&n?jo(t,e,n):void 0;return r&&e.contains(r.host)?[r.host,r.before]:[e,null]}function Hx(e){const t=new Map;for(const n of e)n.type==="Set"&&n.node instanceof Text&&!yn(n.node.parentNode)&&t.set(n.node,{prev:n.node.data,next:wr(String(n.data??"")).textContent??""});return t}function Fx({mutations:e,toAdd:t,toRemove:n,isService:r},o,i){const s=f=>new Set(e.flatMap(h=>h.type===f?[h.node]:[])),a=s("Remove"),l={removed:a,moved:s("Move"),edited:s("Set"),rewrites:Hx(e)};Bx([...a].find(f=>f.ownerDocument)?.ownerDocument,l);const c=(f,h,m)=>{if(!f)return st("Element node not in tree");if(!(f instanceof Element))return st("node is not HTMLEement");const p=m===void 0?void 0:rb(f,h,_x(m));if(!(h.toLowerCase()==="type"&&rN(f,p??null)))try{p!=null?er(f,h,p):f.removeAttribute(h)}catch{}},u=new Map;let d;for(const f of e)switch(f.type){case"Add":{const{node:h,nextSibling:m,parent:p}=f;if(p){const[v,C]=Sy(p,m,r);v.insertBefore(h,C)}break}case"Move":{const{node:h,nextSibling:m,parent:p}=f;if(p){const[v,C]=Sy(p,m,r);Rx(v,h,C)}break}case"Remove":{const{node:h}=f;if(h instanceof Document)for(const m of[...h.childNodes])m.parentNode?.removeChild(m);else d=Ix(h,u,l)??d;break}case"Attribute":c(f.node,f.name,f.value);break;case"Set":{const{node:h,data:m}=f;if(h instanceof Comment)h.data=m;else if(h instanceof Text){const p=String(m??"");yn(h.parentNode)?jL(h,p):xx(h,wr(p).textContent??"",u)}break}}for(const[f,h]of n)o.remove(h);for(const[f,h]of t){const m=o.getByElement(h);m&&o.remove(m),o.set(f,h)}if(i&&d?.isConnected&&Dx(d))try{i(d)}catch{}}var $x=class{constructor(){A(this,"_byKey",new WeakMap),A(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))}},Wx=class{constructor(){A(this,"_map",new $x)}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 wy(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function qx(e){let t;for(let n=e;n;n=n.parent)qd(n)&&(t=n);return t}function zx(e){return e.type==="Update"?e.prev:e.node}function Ux(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=qx(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=zx(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(wy(i,l)||wy(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...le.recreate(c,l.parent,l,Ar(l)||void 0));break}}a||r.push(o)}return r}var Yd;(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})(Yd||(Yd={}));var gl=new Set;function kr(e,t){gl.has(e)||(gl.size||Promise.resolve().then(()=>gl.clear()),gl.add(e),z.send(de.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var _y=new WeakMap;function jx(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 Vx(e){return{added:e,removed:[],reparented:[],reordered:[]}}function Gx(e,t){let n=_y.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=jx(o),n={added:o,removed:i},_y.set(e,n)}return n}function Cy(e,t){const n={};for(const[r,o]of Object.entries(t))n[r]={value:o,enumerable:!0};return Object.create(e,n)}function Ty(e){return new Set((e??"").split(/\s+/).filter(Boolean))}function Xx(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))),Cy(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:Kx(i,t,r)})}),service:o}}function Kx(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"&&Yx(e,a,t)));s.length&&(r[o]=s)}return r}function Yx(e,t,n){const r=Ty(e.getOldAttribute(t,"class")),o=Ty(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 Ay=Object.getPrototypeOf(customElements),Zx=Reflect.get(Ay,"define"),Zd=new ge,Qd=new ge,Qx=Zd.event,Jx=Qd.event,eO=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function tO(e){Zd.fire();try{return e()}finally{Qd.fire()}}Ay.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Zd.fire();try{super(...i)}finally{Qd.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of eO){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return tO(()=>s.call(this,...a))}})}Zx.call(this,e,o,n)};function ky(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,ky(s,t,n,i));return i}function Vo(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])Vo(r,t,e)}var ir="___em-internal";function Jd(e,t=!0,n=!1){let r=e.content;switch(e.type){case D.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(Jd(i,t,n));return o}case D.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case D.COMMENT:return document.createComment(r||"");case D.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=cd(e),i.firstChild}const o=document.createElement(e.tag);if(e.attributes)for(const i of e.attributeNames){const s=e.attributes[i];try{er(o,i,typeof s=="string"?s:"")}catch{}}if(t)for(const i of e.children)o.appendChild(Za(i,e)?bd(i.content||""):Jd(i,t,n));return o}return document.createTextNode("<");case D.HTML:return wr(r||"");default:throw new Error("unsupported node")}}function nO(e){return hn(e).roots.map(t=>Jd(t,!0,!0))}function Ly(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function rO(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 Ly();default:t=document.createElement("div")}return t}function oO(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function bl(e){if(e instanceof Element)return gy(e);if(e instanceof Document)return[...e.childNodes].map(r=>bl(r)).join("");if(e instanceof DocumentType)return oO(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(r=>bl(r)).join("");const t=Xa(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function Ny(e,t=e.parentNode){return yn(t)?sy(e,t):bl(e)}function iO(e,t,n){let r=1;const o=new Gb,i=new Map,s=new Map,a=new Map;let l=!1;const c=ky(e,h=>{const m=String(r++);let p;if(hy(h)||h instanceof Element&&h.hasAttribute("src")){const v=document.createElement(h.tagName);for(const{name:C,value:k}of h.attributes){const L=ob(h,C,k);L!==null&&er(v,C==="src"?"___src":C,L)}p=v}else p=h.cloneNode(),pO(h,p);if(p)p instanceof DocumentType&&(l=!0),a.set(p,m),i.set(h,m);else return document.createDocumentFragment();return p},(h,m)=>h&&m&&h.appendChild(m));let u=l?Ly():document.createDocumentFragment();u.appendChild(c),Vo(u,(h,m)=>{if(m){const p=a.get(h);if(yn(m))return;if(!p)return st("Error while mapping: not found element");h instanceof Element?h.setAttribute(ir,p):m.insertBefore(document.createComment(`${ir}${p}`),h)}});let d=nO(t(u)).filter(h=>!!h),f;if(!d.length)return o;if(u instanceof Document){const h=rO("html");for(const m of d)h.appendChild(m);f=h}else{f=document.createDocumentFragment();for(const h of d)f.appendChild(h)}return Vo(f,(h,m)=>{let p=null;if(h instanceof HTMLHtmlElement)s.set("1",h);else{if(h instanceof Element&&h.hasAttribute(ir)){p=h.getAttribute(ir),p&&s.set(p,h);return}const v=h.previousSibling;if(v instanceof Comment&&(!(h instanceof Comment)||h.data.indexOf(ir)<0)){const C=v.data,k=C.indexOf(ir);k>=0&&(p=C.substring(k+14),p&&s.set(p,h))}}}),Vo(f,h=>{if(h instanceof Element&&h.hasAttribute(ir)){h.removeAttribute(ir);return}h instanceof Comment&&h.data.indexOf(ir)>=0&&h.remove()}),Vo(e,h=>{const m=i.get(h),p=s.get(m);p&&(o.set(h,p),yn(h)&&h.firstChild&&p.firstChild&&o.set(h.firstChild,p.firstChild))}),o}function sO(e){const t=xy(e.cloneNode()),n=dd(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=D.ELEMENT,t}var Go;(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})({})})(Go||(Go={}));function xy(e){if(oo(e)&&yn(e.parentNode))return Oy(sy(e,e.parentNode));const t=Xa(e);if(t!==void 0)return Oy(t);let n=hn(bl(e.cloneNode())).roots[0];return n||(n=new Tt(0,0,[]),n.type=D.HTML,n.content=""),n}function Oy(e){const t=new Tt(0,e.length,[]);return t.type=D.HTML,t.content=e,t}function Ry(e,t=Go.HiddenResult.node){if(t&Go.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&Go.HiddenResult.children)for(const n of e.children)Ry(n,Go.HiddenResult.all)}function aO(e,t=[],n){let r;return e instanceof Element?r=sO(e):r=xy(e),r.children=t,r.parent=void 0,n&&Ry(r,n(r)),r}function ef(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=ef(o,t,n),r)return r}function My(e,t,n,r){kr("tree-node-out-of-place",()=>({mutation:n()}))}function Py(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(My("insertBefore",c,()=>mx(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=ef(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=ef(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function lO(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 Iy(e,t){return e.type===D.HTML?Xa(t)??`<!--${t.data}-->`:t.data}function cO(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,hs(o)?Iy(i,o):Ny(o)))}return n}function uO(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function dO(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 fO(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 _O(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}=Py(s,t,n)||{};u===a.parent&&d===l[c+1]&&i.add(s)}return i}function mO(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}=Gx(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 h=s.get(f)??f.parent;!h||!a(f,h)?My("remove",f,()=>hx(f,t)):o.push(le.remove(f)),s.delete(f),i.add(d)}}for(const d of c){if(r.has(d)||dO(d))continue;const f=uO(d);if(f&&!t.getByElement(f))continue;const{parentTreeNode:h,nextSiblingTreeNode:m}=Py(d,t,n,p=>i.has(p),a)||{};if(h){let p=t.getByElement(d);p||(p=aO(d),t.set(p,d)),o.push(le.add(h,p,m)),s.set(p,h),i.delete(d)}}o.push(...lO(l,t)),o.push(...cO(l,t))}return o}function hO(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 pO(e,t){if(!(!GL()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=ob(e,n,r);o===null?t.removeAttribute(n):o!==r&&er(t,n,o)}}function gO(e,t,n,r=()=>!1){const o=[],i=iO(e,n,t);return Vo(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 st("CharacterData mapped to Element");o.push(...hO(a,s,l))}else if(l instanceof CharacterData){if(!(s instanceof CharacterData))return st("Element mapped to CharacterData");const c=yn(s.parentNode)&&(s.parentNode?.nodeName==="SCRIPT"||!r(s));l.data!==s.data&&!c&&o.push(le.set(a,hs(l)?Iy(a,l):Ny(l,s.parentNode)))}else if(l instanceof Document&&!(s instanceof Document))return st("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 bO(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 yO(e){return[...new Set(e)]}function vO(e,t){return yO([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>bO(n,t)||n))}function EO(e,t){let n=[];for(const r of e){const o=vO(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 SO(e,t,n){const r=EO(e,t),o=wO(e);return r.flatMap(i=>gO(i,t,n,o))}function wO(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 _O(e){return e.flatMap(t=>[...t.reparented??[],...t.reordered??[]])}function CO(e,t){return Cy(e,{reparented:e.reparented?.filter(n=>!t.has(n)),reordered:e.reordered?.filter(n=>!t.has(n))})}function TO(e,t,n,r,o=()=>!1){const i=fO(e,t,r,o),s=i.size?e.map(a=>CO(a,i)):e;return[...mO(e,t,r,i),...SO(s,t,n)]}function AO(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 kO=class{constructor(){A(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))}},Dy=class{constructor(e=10){A(this,"_max",void 0),A(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}},By=new Dy(1e3);function Xo(e){if(e=e?.trim(),e){let t=By.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),By.put(e,t)),t}else return new Set}function yl(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Hy=new Dy(1e3);function ps(e){e||(e="");let t=Hy.get(e);return t||(t=yl(e),Hy.put(e,t)),t}function LO(e,t,n){const r=e?e.split(" "):[],o=Xo(n),i=Xo(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function NO(e,t,n){const r=yl(e),o=ps(n),i=ps(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 Fy(e,t,n,r){return typeof r!="string"?t:e==="class"?LO(t,n,r)||null:e==="style"?NO(t,n,r)||null:n!==t&&t===r?null:t}function xO(e,t){const n=Xo(e),r=Xo(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function OO(e,t){const n=yl(e),r=ps(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 RO(e,t,n){return typeof n!="string"?t:e==="class"?xO(t,n)||null:e==="style"?OO(t,n)||null:t}function MO(e,t,n){if(!t)return t;const r=Xo(e),o=Xo(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 PO(e,t,n){if(!t)return t;const r=ps(e),o=yl(t),i=ps(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 $y(e){return e.type===D.ELEMENT&&e.start!==e.end}function Wy(e){return e.filter(t=>t.type===D.ELEMENT)}function IO(e,t,n){const r=Wy(e),o=Wy(t),i=[],s=new Set,a=new Set,l=u=>{const d=(h,m)=>{const p=new Map;for(const v of h){const C=m.has(v)?void 0:u(v);C!==void 0&&p.set(C,p.has(C)?null:v)}return p},f=d(r,s);for(const[h,m]of d(o,a)){const p=f.get(h);m&&p&&(i.push([p,m,!0]),s.add(p),a.add(m))}};l(u=>typeof u.attributes?.id=="string"?`${u.tag}#${u.attributes.id}`:void 0),l(u=>Jn(u,!1,n)),l(u=>Jn(u,!0,n));const c=new Set(o.map(u=>u.tag));for(const u of c){const d=m=>m.filter(p=>p.tag===u),f=d(r).filter(m=>!s.has(m)),h=d(o).filter(m=>!a.has(m));if(f.length===h.length&&d(r).length===d(o).length){const m=f.length===1&&!f[0].attributes?.id&&!h[0].attributes?.id;h.forEach((p,v)=>i.push([f[v],p,m]))}}return i}var DO=class{constructor(e,t,n,r){A(this,"element",void 0),A(this,"name",void 0),A(this,"nextValue",void 0),A(this,"prevValue",void 0),this.element=e,this.name=t,this.nextValue=n,this.prevValue=r}},BO=class{constructor(e){A(this,"_nodeMap",void 0),A(this,"_map",new kO),A(this,"_hiddenMutations",[]),A(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=MO(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=PO(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 DO(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=Fy(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=Fy(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=RO(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,ud());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&&!Pd(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))F2(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&&Jn(e,!1,r)===Jn(t,!1,r)){const i=t.children.filter($y);e.children.filter($y).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of IO(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)}}}},HO=class{constructor(e){A(this,"_isMapped",void 0),A(this,"_foreign",new WeakSet),A(this,"_movedTo",new WeakMap),A(this,"_output",new WeakSet),A(this,"_service",new WeakSet),A(this,"_wrappers",new WeakSet),A(this,"_outer",new WeakSet),A(this,"_hasForeign",!1),A(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)}},qy="foreign-structure-in-commit";function FO(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 vl(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var zy="implicit-tbody-in-canvas";function $O(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 WO(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:vl(n),parent:n.parentNode?vl(n.parentNode):void 0};t.add(zy),kr(zy,()=>({foreign:r}))}function qO(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:vl(n.node),parent:n.node.parentNode?vl(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add(qy),kr(qy,()=>({foreign:o})))}var tf="unaccounted-node";function Uy(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 jy(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 Uy(e,t,n,r||t.roots.has(e))}function Vy(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=Uy(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 zO(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 UO(e,t){const n=new Set;for(const r of e)r.isConnected&&jy(r,t)==="unaccounted"&&n.add(r);return[...n].filter(r=>!r.parentNode||!n.has(r.parentNode))}function jO(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 Gy(e){const t=[];for(let o=e;o&&o.nodeType!==Node.DOCUMENT_NODE;o=o.parentNode)t.unshift(jO(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 Xy(e,t){if(!e.length)return;const n={count:e.length,node:Gy(e[0])};t.has(tf)||(t.add(tf),kr(tf,()=>({unaccounted:n})))}var VO=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 E(){this._nodes=[],this._values=[]}return E._isIndex=function(g){return+g===g>>>0},E._nodeId=function(g){var y=g[E._ID_PROP];return y||(y=g[E._ID_PROP]=E._NEXT_ID++),y},E.prototype.set=function(g,y){var w=E._nodeId(g);this._nodes[w]=g,this._values[w]=y},E.prototype.get=function(g){var y=E._nodeId(g);return y!==void 0?this._values[y]:void 0},E.prototype.has=function(g){return E._nodeId(g)in this._nodes},E.prototype.delete=function(g){var y=E._nodeId(g);delete this._nodes[y],this._values[y]=void 0},E.prototype.keys=function(){var g=[];for(var y in this._nodes)E._isIndex(y)&&g.push(this._nodes[y]);return g},E._ID_PROP="__mutation_summary_node_map_id__",E._NEXT_ID=1,E})(),o=(function(){function E(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return E})();n.Movement=void 0,(function(E){E[E.STAYED_OUT=0]="STAYED_OUT",E[E.ENTERED=1]="ENTERED",E[E.STAYED_IN=2]="STAYED_IN",E[E.REPARENTED=3]="REPARENTED",E[E.REORDERED=4]="REORDERED",E[E.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(E,g){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,w){y.__proto__=w}||function(y,w){for(var b in w)Object.prototype.hasOwnProperty.call(w,b)&&(y[b]=w[b])},i(E,g)};function s(E,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");i(E,g);function y(){this.constructor=E}E.prototype=g===null?Object.create(g):(y.prototype=g.prototype,new y)}var a=(function(){function E(g,y,w,b,S,_,T,x){y===void 0&&(y=!1),w===void 0&&(w=!1),b===void 0&&(b=!1),S===void 0&&(S=null),_===void 0&&(_=!1),T===void 0&&(T=null),x===void 0&&(x=null),this.node=g,this.childList=y,this.attributes=w,this.characterData=b,this.oldParentNode=S,this.added=_,this.attributeOldValues=T,this.characterDataOldValue=x,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return E.prototype.getAttributeOldValue=function(g){if(this.attributeOldValues)return this.isCaseInsensitive&&(g=g.toLowerCase()),this.attributeOldValues[g]},E.prototype.getAttributeNamesMutated=function(){var g=[];if(!this.attributeOldValues)return g;for(var y in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(y)&&g.push(y);return g},E.prototype.attributeMutated=function(g,y){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(g in this.attributeOldValues)&&(this.attributeOldValues[g]=y)},E.prototype.characterDataMutated=function(g){this.characterData||(this.characterData=!0,this.characterDataOldValue=g)},E.prototype.removedFromParent=function(g){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=g},E.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},E.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},E})(),l=(function(E){s(g,E);function g(y,w){var b=E.call(this)||this;b.rootNode=y,b.reachableCache=void 0,b.wasReachableCache=void 0,b.anyParentsChanged=!1,b.anyAttributesChanged=!1,b.anyCharacterDataChanged=!1;for(var S=0;S<w.length;S++){var _=w[S];switch(_.type){case"childList":b.anyParentsChanged=!0;for(var T=0;T<_.removedNodes.length;T++){var x=_.removedNodes[T];b.getChange(x).removedFromParent(_.target)}for(var T=0;T<_.addedNodes.length;T++){var x=_.addedNodes[T];b.getChange(x).insertedIntoParent()}break;case"attributes":b.anyAttributesChanged=!0;var N=b.getChange(_.target);N.attributeMutated(_.attributeName,_.oldValue);break;case"characterData":b.anyCharacterDataChanged=!0;var N=b.getChange(_.target);N.characterDataMutated(_.oldValue)}}return b}return g.prototype.getChange=function(y){var w=this.get(y);return w||(w=new a(y),this.set(y,w)),w},g.prototype.getOldParent=function(y){var w=this.get(y);return w?w.getOldParent():y.parentNode},g.prototype.getIsReachable=function(y){if(y===this.rootNode)return!0;if(!y)return!1;this.reachableCache=this.reachableCache||new r;var w=this.reachableCache.get(y);return w===void 0&&(w=this.getIsReachable(y.parentNode),this.reachableCache.set(y,w)),w},g.prototype.getWasReachable=function(y){if(y===this.rootNode)return!0;if(!y)return!1;this.wasReachableCache=this.wasReachableCache||new r;var w=this.wasReachableCache.get(y);return w===void 0&&(w=this.getWasReachable(this.getOldParent(y)),this.wasReachableCache.set(y,w)),w},g.prototype.reachabilityChange=function(y){return this.getIsReachable(y)?this.getWasReachable(y)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.getWasReachable(y)?n.Movement.EXITED:n.Movement.STAYED_OUT},g})(r),c=(function(){function E(g,y,w,b,S){this.rootNode=g,this.mutations=y,this.selectors=w,this.calcReordered=b,this.calcOldPreviousSibling=S,this.treeChanges=new l(g,y),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 E.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var g=this.treeChanges.keys(),y=0;y<g.length;y++)this.visitNode(g[y],void 0)},E.prototype.visitNode=function(g,y){if(!this.visited.has(g)){this.visited.set(g,!0);var w=this.treeChanges.get(g),b=y;if((w&&w.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;w&&w.childList&&(w.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 _=g.firstChild;_;_=_.nextSibling)this.visitNode(_,b)}}},E.prototype.ensureHasOldPreviousSiblingIfNeeded=function(g){if(this.calcOldPreviousSibling){this.processChildlistChanges();var y=g.parentNode,w=this.treeChanges.get(g);w&&w.oldParentNode&&(y=w.oldParentNode);var b=this.childListChangeMap.get(y);b||(b=new o,this.childListChangeMap.set(y,b)),b.oldPrevious.has(g)||b.oldPrevious.set(g,g.previousSibling)}},E.prototype.getChanged=function(g,y,w){this.selectors=y,this.characterDataOnly=w;for(var b=0;b<this.entered.length;b++){var S=this.entered[b],_=this.matchabilityChange(S);(_===n.Movement.ENTERED||_===n.Movement.STAYED_IN)&&g.added.push(S)}for(var T=this.stayedIn.keys(),b=0;b<T.length;b++){var S=T[b],_=this.matchabilityChange(S);if(_===n.Movement.ENTERED)g.added.push(S);else if(_===n.Movement.EXITED)g.removed.push(S);else if(_===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],_=this.matchabilityChange(S);(_===n.Movement.EXITED||_===n.Movement.STAYED_IN)&&g.removed.push(S)}},E.prototype.getOldParentNode=function(g){var y=this.treeChanges.get(g);if(y&&y.childList)return y.oldParentNode?y.oldParentNode:null;var w=this.treeChanges.reachabilityChange(g);if(w===n.Movement.STAYED_OUT||w===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return g.parentNode},E.prototype.getOldPreviousSibling=function(g){var y=g.parentNode,w=this.treeChanges.get(g);w&&w.oldParentNode&&(y=w.oldParentNode);var b=this.childListChangeMap.get(y);if(!b)throw Error("getOldPreviousSibling requested on invalid node.");return b.oldPrevious.get(g)},E.prototype.getOldAttribute=function(g,y){var w=this.treeChanges.get(g);if(!w||!w.attributes)throw Error("getOldAttribute requested on invalid node.");var b=w.getAttributeOldValue(y);if(b===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return b},E.prototype.attributeChangedNodes=function(g){if(!this.treeChanges.anyAttributesChanged)return{};var y,w;if(g){y={},w={};for(var b=0;b<g.length;b++){var S=g[b];y[S]=!0,w[S.toLowerCase()]=S}}for(var _={},T=this.treeChanges.keys(),b=0;b<T.length;b++){var x=T[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 I=x,O=N.getAttributeNamesMutated(),M=0;M<O.length;M++){var S=O[M];y&&!y[S]&&!(N.isCaseInsensitive&&w[S])||N.getAttributeOldValue(S)!==I.getAttribute(S)&&(w&&N.isCaseInsensitive&&(S=w[S]),_[S]=_[S]||[],_[S].push(I))}}return _},E.prototype.getOldCharacterData=function(g){var y=this.treeChanges.get(g);if(!y||!y.characterData)throw Error("getOldCharacterData requested on invalid node.");return y.characterDataOldValue},E.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var g=this.treeChanges.keys(),y=[],w=0;w<g.length;w++){var b=g[w];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(b)){var S=this.treeChanges.get(b);!S.characterData||b.textContent==S.characterDataOldValue||y.push(b)}}return y},E.prototype.computeMatchabilityChange=function(g,y){this.matchCache||(this.matchCache=[]),this.matchCache[g.uid]||(this.matchCache[g.uid]=new r);var w=this.matchCache[g.uid],b=w.get(y);return b===void 0&&(b=g.matchabilityChange(y,this.treeChanges.get(y)),w.set(y,b)),b},E.prototype.matchabilityChange=function(g){var y=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 w=g,b=this.selectors.map(function(T){return y.computeMatchabilityChange(T,w)}),S=n.Movement.STAYED_OUT,_=0;S!==n.Movement.STAYED_IN&&_<b.length;){switch(b[_]){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}_++}return S},E.prototype.getChildlistChange=function(g){var y=this.childListChangeMap.get(g);return y||(y=new o,this.childListChangeMap.set(g,y)),y},E.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var g=function(b){var S=y.mutations[b];if(S.type!="childList"||y.treeChanges.reachabilityChange(S.target)!==n.Movement.STAYED_IN&&!y.calcOldPreviousSibling)return"continue";for(var _=y.getChildlistChange(S.target),T=S.previousSibling,x=function(O,M){!O||_.oldPrevious.has(O)||_.added.has(O)||_.maybeMoved.has(O)||M&&(_.added.has(M)||_.maybeMoved.has(M))||_.oldPrevious.set(O,M)},N=0;N<S.removedNodes.length;N++){var I=S.removedNodes[N];x(I,T),_.added.has(I)?_.added.delete(I):(_.removed.set(I,!0),_.maybeMoved.delete(I)),T=I}x(S.nextSibling,T);for(var N=0;N<S.addedNodes.length;N++){var I=S.addedNodes[N];_.removed.has(I)?(_.removed.delete(I),_.maybeMoved.set(I,!0)):_.added.set(I,!0)}},y=this,w=0;w<this.mutations.length;w++)g(w)}},E.prototype.wasReordered=function(g){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var y=g.parentNode,w=this.treeChanges.get(g);w&&w.oldParentNode&&(y=w.oldParentNode);var b=this.childListChangeMap.get(y);if(!b)return!1;if(b.moved)return b.moved.get(g);b.moved=new r;var S=new r;function _(O){if(!O||!b.maybeMoved.has(O))return!1;var M=b.moved.get(O);return M!==void 0||(S.has(O)?M=!0:(S.set(O,!0),M=I(O)!==x(O)),S.has(O)?(S.delete(O),b.moved.set(O,M)):M=b.moved.get(O)),M}var T=new r;function x(O){var M=T.get(O);if(M!==void 0)return M;for(M=b.oldPrevious.get(O);M&&(b.removed.has(M)||_(M));)M=x(M);return M===void 0&&(M=O.previousSibling),T.set(O,M),M}var N=new r;function I(O){if(N.has(O))return N.get(O);for(var M=O.previousSibling;M&&(b.added.has(M)||_(M));)M=M.previousSibling;return N.set(O,M),M}return b.maybeMoved.keys().forEach(_),b.moved.get(g)},E})(),u=(function(){function E(g,y){var w=this;if(this.projection=g,this.added=[],this.removed=[],this.reparented=y.all||y.element||y.characterData?[]:void 0,this.reordered=y.all?[]:void 0,g.getChanged(this,y.elementFilter,y.characterData),y.all||y.attribute||y.attributeList){var b=y.attribute?[y.attribute]:y.attributeList,S=g.attributeChangedNodes(b);y.attribute?this.valueChanged=S[y.attribute]||[]:(this.attributeChanged=S,y.attributeList&&y.attributeList.forEach(function(T){w.attributeChanged.hasOwnProperty(T)||(w.attributeChanged[T]=[])}))}if(y.all||y.characterData){var _=g.getCharacterDataChanged();y.characterData?this.valueChanged=_:this.characterDataChanged=_}this.reordered&&(this.getOldPreviousSibling=g.getOldPreviousSibling.bind(g))}return E.prototype.getOldParentNode=function(g){return this.projection.getOldParentNode(g)},E.prototype.getOldAttribute=function(g,y){return this.projection.getOldAttribute(g,y)},E.prototype.getOldCharacterData=function(g){return this.projection.getOldCharacterData(g)},E.prototype.getOldPreviousSibling=function(g){return this.projection.getOldPreviousSibling(g)},E})(),d=(function(){function E(){}return E.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 y=g.split(" "),w=0;w<y.length;w++)if(this.attrValue===y[w])return!0;return!1},E.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+"]"},E})();function f(E){return'"'+E.replace(/"/,'\\"')+'"'}var h=/[a-zA-Z_]+/,m=/[a-zA-Z0-9_\-]+/,p=(function(){function E(){this.uid=E.nextUid++,this.qualifiers=[]}return Object.defineProperty(E.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(E.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),E.prototype.isMatching=function(g){return g[E.matchesSelector](this.selectorString)},E.prototype.wasMatching=function(g,y,w){if(!y||!y.attributes)return w;var b=y.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(b!=="*"&&b!==g.tagName)return!1;for(var S=[],_=!1,T=0;T<this.qualifiers.length;T++){var x=this.qualifiers[T],N=y.getAttributeOldValue(x.attrName);S.push(N),_=_||N!==void 0}if(!_)return w;for(var T=0;T<this.qualifiers.length;T++){var x=this.qualifiers[T],N=S[T];if(N===void 0&&(N=g.getAttribute(x.attrName)),!x.matches(N))return!1}return!0},E.prototype.matchabilityChange=function(g,y){var w=this.isMatching(g);return w?this.wasMatching(g,y,w)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(g,y,w)?n.Movement.EXITED:n.Movement.STAYED_OUT},E.parseSelectors=function(g){var y=[],w,b;function S(){w&&(b&&(w.qualifiers.push(b),b=void 0),y.push(w)),w=new E}function _(){b&&w.qualifiers.push(b),b=new d}for(var T=/\s/,x=void 0,N="Invalid or unsupported selector syntax.",I=1,O=2,M=3,V=4,K=5,se=6,te=7,Z=8,ve=9,fe=10,_e=11,ct=12,ne=13,q=14,oe=I,Wt=0;Wt<g.length;){var U=g[Wt++];switch(oe){case I:if(U.match(h)){S(),w.tagName=U,oe=O;break}if(U=="*"){S(),w.tagName="*",oe=M;break}if(U=="."){S(),_(),w.tagName="*",b.attrName="class",b.contains=!0,oe=V;break}if(U=="#"){S(),_(),w.tagName="*",b.attrName="id",oe=V;break}if(U=="["){S(),_(),w.tagName="*",b.attrName="",oe=se;break}if(U.match(T))break;throw Error(N);case O:if(U.match(m)){w.tagName+=U;break}if(U=="."){_(),b.attrName="class",b.contains=!0,oe=V;break}if(U=="#"){_(),b.attrName="id",oe=V;break}if(U=="["){_(),b.attrName="",oe=se;break}if(U.match(T)){oe=q;break}if(U==","){oe=I;break}throw Error(N);case M:if(U=="."){_(),b.attrName="class",b.contains=!0,oe=V;break}if(U=="#"){_(),b.attrName="id",oe=V;break}if(U=="["){_(),b.attrName="",oe=se;break}if(U.match(T)){oe=q;break}if(U==","){oe=I;break}throw Error(N);case V:if(U.match(h)){b.attrValue=U,oe=K;break}throw Error(N);case K:if(U.match(m)){b.attrValue+=U;break}if(U=="."){_(),b.attrName="class",b.contains=!0,oe=V;break}if(U=="#"){_(),b.attrName="id",oe=V;break}if(U=="["){_(),oe=se;break}if(U.match(T)){oe=q;break}if(U==","){oe=I;break}throw Error(N);case se:if(U.match(h)){b.attrName=U,oe=te;break}if(U.match(T))break;throw Error(N);case te:if(U.match(m)){b.attrName+=U;break}if(U.match(T)){oe=Z;break}if(U=="~"){b.contains=!0,oe=ve;break}if(U=="="){b.attrValue="",oe=_e;break}if(U=="]"){oe=M;break}throw Error(N);case Z:if(U=="~"){b.contains=!0,oe=ve;break}if(U=="="){b.attrValue="",oe=_e;break}if(U=="]"){oe=M;break}if(U.match(T))break;throw Error(N);case ve:if(U=="="){b.attrValue="",oe=_e;break}throw Error(N);case fe:if(U=="]"){oe=M;break}if(U.match(T))break;throw Error(N);case _e:if(U.match(T))break;if(U=='"'||U=="'"){x=U,oe=ne;break}b.attrValue+=U,oe=ct;break;case ct:if(U.match(T)){oe=fe;break}if(U=="]"){oe=M;break}if(U=="'"||U=='"')throw Error(N);b.attrValue+=U;break;case ne:if(U==x){oe=fe;break}b.attrValue+=U;break;case q:if(U.match(T))break;if(U==","){oe=I;break}throw Error(N)}}switch(oe){case I:case O:case M:case K:case q:S();break;default:throw Error(N)}if(!y.length)throw Error(N);return y},E.nextUid=1,E.matchesSelector="matches",E})(),v=(function(){function E(){}return E.createObserverOptions=function(g){var y={childList:!0,subtree:!0},w;function b(S){if(!(y.attributes&&!w)){if(y.attributes=!0,y.attributeOldValue=!0,!S){w=void 0;return}w=w||{},S.forEach(function(_){w[_]=!0,w[_.toLowerCase()]=!0})}}return g.forEach(function(S){if(S.characterData){y.characterData=!0,y.characterDataOldValue=!0;return}if(S.all){b(),y.characterData=!0,y.characterDataOldValue=!0;return}if(S.attribute){b([S.attribute.trim()]);return}var _=E._elementFilterAttributes(S.elementFilter).concat(S.attributeList||[]);_.length&&b(_)}),w&&(y.attributeFilter=Object.keys(w)),y},E.validateOptions=function(g){for(var y in g)if(!(y in E._optionKeys))throw Error("Invalid option: "+y);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 w={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.");w.queries.push({all:!0});continue}if("attribute"in S){var _={attribute:E._validateAttribute(S.attribute)};if(_.elementFilter=p.parseSelectors("*["+_.attribute+"]"),Object.keys(S).length>1)throw Error("Invalid request option. attribute has no options.");w.queries.push(_);continue}if("element"in S){var T=Object.keys(S).length,_={element:S.element,elementFilter:p.parseSelectors(S.element)};if(S.hasOwnProperty("elementAttributes")&&(_.attributeList=E._validateElementAttributes(S.elementAttributes),T--),T>1)throw Error("Invalid request option. element only allows elementAttributes option.");w.queries.push(_);continue}if(S.characterData){if(Object.keys(S).length>1)throw Error("Invalid request option. characterData has no options.");w.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return w},E._validateElementAttributes=function(g){if(!g.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var y={},w={},b=g.split(/\s+/),S=0;S<b.length;S++){var _=b[S];if(_){_=E._validateAttribute(_);var T=_.toLowerCase();if(y[T])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");w[_]=!0,y[T]=!0}}return Object.keys(w)},E._elementFilterAttributes=function(g){var y={};return g.forEach(function(w){w.qualifiers.forEach(function(b){y[b.attrName]=!0})}),Object.keys(y)},E._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(E._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+g);return g},E._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,E._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},E})(),C=(function(){function E(g){var y=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(w){return w.elementFilter?w.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(w){return w.all}),this._queryValidators=[],E.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(w){return E.createQueryValidator(y._root,w)})),this._observer=new MutationObserver(function(w){y._observerCallback(w)}),this.reconnect()}return E.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},E.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var g=this._createSummaries(this._observer.takeRecords());return this._changesToReport(g)?g:void 0},E.prototype.disconnect=function(){var g=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,g},E.prototype._observerCallback=function(g){this._options.observeOwnChanges||this._observer.disconnect();var y=this._createSummaries(g);this._runQueryValidators(y),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(y)&&this._callback(y),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},E.prototype._createSummaries=function(g){if(!g||!g.length)return[];for(var y=new c(this._root,g,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),w=[],b=0;b<this._options.queries.length;b++)w.push(new u(y,this._options.queries[b]));return w},E.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(g){g&&g.recordPreviousState()})},E.prototype._runQueryValidators=function(g){this._queryValidators.forEach(function(y,w){y&&y.validate(g[w])})},E.prototype._changesToReport=function(g){return g.some(function(y){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(w){return y[w]&&y[w].length})||y.attributeChanged&&Object.keys(y.attributeChanged).some(function(w){return!!y.attributeChanged[w].length}))})},E})(),k=(function(){function E(g,y){this.root=g,this.delegate=y,this.idMap={}}return E.prototype.initialize=function(g,y){this.idMap[g]=this.root;for(var w=0;w<y.length;w++)this.deserializeNode(y[w],this.root)},E.prototype.applyChanged=function(g,y,w,b){var S=this;y.forEach(function(_){var T=S.deserializeNode(_);S.deserializeNode(_.parentNode),S.deserializeNode(_.previousSibling),T.parentNode&&T.parentNode.removeChild(T)}),g.forEach(function(_){var T=S.deserializeNode(_);T.parentNode&&T.parentNode.removeChild(T)}),y.forEach(function(_){var T=S.deserializeNode(_),x=S.deserializeNode(_.parentNode),N=S.deserializeNode(_.previousSibling);x.insertBefore(T,N?N.nextSibling:x.firstChild)}),w.forEach(function(_){var T=S.deserializeNode(_);Object.keys(_.attributes).forEach(function(x){var N=_.attributes[x];N===null?T.removeAttribute(x):(!S.delegate||!S.delegate.setAttribute||!S.delegate.setAttribute(T,x,N))&&T.setAttribute(x,N)})}),b.forEach(function(_){var T=S.deserializeNode(_);T.textContent=_.textContent}),g.forEach(function(_){delete S.idMap[_.id]})},E.prototype.deserializeNode=function(g,y){var w=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(T){(!w.delegate||!w.delegate.setAttribute||!w.delegate.setAttribute(b,T,g.attributes[T]))&&b.setAttribute(T,g.attributes[T])});break;default:throw"Unsupported node type: "+g.nodeType}if(this.idMap[g.id]=b,y&&y.appendChild(b),g.childNodes)for(var _=0;_<g.childNodes.length;_++)this.deserializeNode(g.childNodes[_],b);return b},E})(),L=(function(){function E(g,y,w){var b=this;this.target=g,this.mirror=y,this.nextId=1,this.knownNodes=new r;for(var S=this.serializeNode(g).id,_=[],T=g.firstChild;T;T=T.nextSibling)_.push(this.serializeNode(T,!0));this.mirror.initialize(S,_);var x=[{all:!0}];w&&(x=x.concat(w)),this.mutationSummary=new C({rootNode:g,callback:function(N){b.applyChanged(N)},queries:x})}return E.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},E.prototype.rememberNode=function(g){var y=this.nextId++;return this.knownNodes.set(g,y),y},E.prototype.forgetNode=function(g){this.knownNodes.delete(g)},E.prototype.serializeNode=function(g,y){if(g===null)return null;var w=this.knownNodes.get(g);if(w!==void 0)return{id:w};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 _=g;b.tagName=_.tagName,b.attributes={};for(var T=0;T<_.attributes.length;T++){var x=_.attributes[T];b.attributes[x.name]=x.value}if(y&&_.childNodes.length){b.childNodes=[];for(var N=_.firstChild;N;N=N.nextSibling)b.childNodes.push(this.serializeNode(N,!0))}}return b},E.prototype.serializeAddedAndMoved=function(g,y,w){var b=this,S=g.concat(y).concat(w),_=new r;S.forEach(function(x){var N=x.parentNode,I=_.get(N);I||(I=new r,_.set(N,I)),I.set(x,!0)});var T=[];return _.keys().forEach(function(x){for(var N=_.get(x),I=N.keys();I.length;){for(var O=I[0];O.previousSibling&&N.has(O.previousSibling);)O=O.previousSibling;for(;O&&N.has(O);){var M=b.serializeNode(O);M.previousSibling=b.serializeNode(O.previousSibling),M.parentNode=b.serializeNode(O.parentNode),T.push(M),N.delete(O),O=O.nextSibling}I=N.keys()}}),T},E.prototype.serializeAttributeChanges=function(g){var y=this,w=new r;return Object.keys(g).forEach(function(b){g[b].forEach(function(S){var _=w.get(S);_||(_=y.serializeNode(S),_.attributes={},w.set(S,_)),_.attributes[b]=S.getAttribute(b)})}),w.keys().map(function(b){return w.get(b)})},E.prototype.applyChanged=function(g){var y=this,w=g[0],b=w.removed.map(function(x){return y.serializeNode(x)}),S=this.serializeAddedAndMoved(w.added,w.reparented,w.reordered),_=this.serializeAttributeChanges(w.attributeChanged),T=w.characterDataChanged.map(function(x){var N=y.serializeNode(x);return N.textContent=x.textContent,N});this.mirror.applyChanged(b,S,_,T),w.removed.forEach(function(x){y.forgetNode(x)})},E})();if(MutationObserver===void 0)throw Error("DOM Mutation Observers are required");n.ChildListChange=o,n.MutationProjection=c,n.MutationSummary=C,n.NodeChange=a,n.NodeMap=r,n.Qualifier=d,n.Selector=p,n.Summary=u,n.TreeChanges=l,n.TreeMirror=k,n.TreeMirrorClient=L,Object.defineProperty(n,"__esModule",{value:!0})}))})),GO=VO(),Ko=0,Yo=new Array(1e3);function XO(){for(let e=0;e<Ko;e+=2){const t=Yo[e],n=Yo[e+1];t(...n),Yo[e]=void 0,Yo[e+1]=void 0}Ko=0}function KO(e,...t){Yo[Ko]=e,Yo[Ko+1]=t,Ko+=2,Ko===2&&ZO()}function YO(){let e=0;const t=new MutationObserver(XO),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var ZO=YO();function Ky(){KO(()=>{nf.hasListeners()&&(nf.fire(),Ky())})}var nf=new ge({onFirstListenerAdd:Ky}),El=nf.once;function QO(e,t,n){const r=new ge;let o=[];return r.addDisposable(e(i=>{El(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var JO=class extends ge{constructor(e={}){super(),A(this,"_mutationSummary",void 0),this._mutationSummary=new GO.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}},eR=class extends Ee{_nextTickHandler(){El(()=>{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(),A(this,"_mutationEmitter",void 0),A(this,"_innerEmitter",this.addDisposable(new ge({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),A(this,"_lostEmitter",this.addDisposable(new ge)),A(this,"_paused",0),A(this,"_stopped",0),A(this,"_foreignCode",0),A(this,"_summaries",[]),A(this,"onMutate",this._innerEmitter.event),A(this,"onLost",this._lostEmitter.event),A(this,"onNativeMutate",void 0),this._mutationEmitter=this.addDisposable(new JO(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),El(()=>{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)}}},tR=1,Yy=e=>e.nodeType===tR,rf=e=>e?.nodeName==="STYLE";function nR(e){return e.some(t=>t.attributeChanged&&Object.keys(t.attributeChanged).length||t.reparented?.length||t.reordered?.length||t.added?.some(n=>Yy(n)||rf(n.parentNode))||t.removed?.some(n=>Yy(n)||rf(t.getOldParentNode(n)))?!0:!!t.characterDataChanged?.some(n=>rf(n.parentNode)))}var rR=El;function oR(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 Zy=/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]*);/iy;function Qy(e,t){Zy.lastIndex=t;const n=Zy.exec(e);return n?n[0].length:e.startsWith(`\r
|
|
3
|
-
`,t)?2:1}function Jy(e){return e.length===1?1:(wr(e).textContent??"").length}function iR(e,t,n){if(n)return Math.min(t,e.length);let r=0,o=0;for(;o<e.length&&r<t;){const i=Qy(e,o);r+=Jy(e.slice(o,o+i)),o+=i}return o}function sR(e,t,n){if(n)return Math.min(t,e.length);let r=0;for(let o=0;o<e.length;){const i=Qy(e,o);if(o+i>t)break;r+=Jy(e.slice(o,o+i)),o+=i}return r}function gs(e,t){const n=t.nodeMap.getByElement(e);return n&&t.isAttached(n)?n:void 0}var aR='[contenteditable="true"], editor';function ev(e,t,n){const r=e.childNodes;for(let i=t;i<r.length;i++){const s=gs(r[i],n);if(s)return s.start}for(let i=Math.min(t,r.length)-1;i>=0;i--){const s=gs(r[i],n);if(s)return s.end}const o=gs(e,n);return o&&(o.startTagEnd??o.start)}function tv(e,t){if((e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(aR))for(let n=e,r=e.parentNode;r;n=r,r=r.parentNode){const o=ev(r,Array.from(r.childNodes).indexOf(n),t);if(o!==void 0)return o}}function lR({node:e,offset:t},n){if(e.nodeType===Node.TEXT_NODE){const r=gs(e,n);if(r?.type!==D.HTML)return tv(e,n);const o=n.textAt(r.start,r.end);return r.start+iR(o,t,yn(e.parentNode))}return ev(e,t,n)??(gs(e,n)?void 0:tv(e,n))}function of(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 cR(e,t){const n=t.nodeAt(e);if(!n)return;if(n.type===D.HTML){const s=t.nodeMap.getByNode(n);return s?.nodeType!==Node.TEXT_NODE?void 0:{node:s,offset:sR(t.textAt(n.start,n.end),Math.max(0,Math.min(e,n.end)-n.start),yn(s.parentNode))}}if(e<=n.start||e>=n.end)return of(n,e>=n.end&&e>n.start,t);const r=n.children.find(s=>s.start>=e);if(r)return of(r,!1,t);const o=n.children[n.children.length-1];if(o)return of(o,!0,t);const i=t.nodeMap.getByNode(n);return i&&{node:i,offset:0}}var bne=400,nv=3e3,uR=class extends Ee{constructor(e,t=400){super(),A(this,"_waitMs",void 0),A(this,"_actionId",void 0),A(this,"_queue",[]),A(this,"_timer",void 0),A(this,"_guid",void 0),A(this,"_releaseOnReady",!1),A(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(nv)}_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=[]}},rv=2e3,dR=3;function fR(e,t,n){const r=e.data.indexOf(n,Math.max(0,t-n.length));return n.trim().length>=dR&&r>=0&&r<=t}function ov(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 mR(e,t){if(e.nodeType===Node.TEXT_NODE)return{text:e,offset:t};const n=ov(e.childNodes[t-1],!0),r=n?void 0:ov(e.childNodes[t],!1);return n?{text:n,offset:n.length}:r&&{text:r,offset:0}}var hR=class extends Ee{beginTextUpdate(){this._baseDocument.beginUpdate()}endTextUpdate(){this._baseDocument.endUpdate()}constructor(e,t,n){super(),A(this,"_baseDocument",void 0),A(this,"_remoteDocument",void 0),A(this,"_parsedDocument",void 0),A(this,"_nodeMap",void 0),A(this,"_beforeChangeEmitter",this.addDisposable(new ge)),A(this,"_beforeCommitEmitter",this.addDisposable(new ge)),A(this,"_beforeTextCommitEmitter",this.addDisposable(new ge)),A(this,"_onTextCommitEmitter",this.addDisposable(new ge)),A(this,"_onRefreshEmitter",this.addDisposable(new ge)),A(this,"_documentElement",void 0),A(this,"_docType",void 0),A(this,"_parseFn",void 0),A(this,"_serviceMarkup",void 0),A(this,"_mapHTMLRoots",void 0),A(this,"_roots",void 0),A(this,"_getRootsParent",void 0),A(this,"_mutationCollector",this.addDisposable(new eR)),A(this,"_attributeMapper",void 0),A(this,"_trackedOffsets",new Set),A(this,"_inputHold",void 0),A(this,"_shownEntity",void 0),A(this,"_savedCaret",void 0),A(this,"ownership",void 0),A(this,"holdCaretAfterBreak",void 0),A(this,"_reportedDrifts",new Set),A(this,"_hiddenEmptyTexts",new WeakSet),A(this,"_canvasNodes",zO(document)),A(this,"_accountingTimer",void 0),A(this,"_lastAccounting",0),A(this,"_capture",void 0),A(this,"_openBatches",0),A(this,"_pushUndoStop",!1),A(this,"_locked",!1),A(this,"_beforeCommitPending",!1),A(this,"_closeStep",!1),A(this,"_styleDirty",!0),A(this,"_outputs",new Map),A(this,"_runningScripts",[]),A(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))}}),A(this,"_commands",[]),A(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())}),A(this,"_treeMutations",[]),A(this,"beforeChange",this._beforeChangeEmitter.event),A(this,"beforeCommit",this._beforeCommitEmitter.event),A(this,"beforeTextCommit",this._beforeTextCommitEmitter.event),A(this,"onTextCommit",this._onTextCommitEmitter.event),A(this,"onChange",VN(QO(this._mutationCollector.onNativeMutate,o=>o.flat(),this),o=>o.length>0,this)),A(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 ox(e,n.createRoot);this._nodeMap=new Wx,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new BO(this._nodeMap),this.addDisposable(Qx(()=>this._mutationCollector.pauseForForeignCode())),this.addDisposable(Jx(()=>this._mutationCollector.resumeAfterForeignCode())),this.addDisposable(this._mutationCollector.onNativeMutate(o=>{this._styleDirty||(this._styleDirty=nR(o))})),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new HO(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(iL(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 uR(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:oR(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?mR(n,t?.anchorOffset??0):void 0;l&&l.text!==e.node&&!fR(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?[Vx(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);qO(FO(e,this.ownership,t),this._reportedDrifts),WO($O(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 jy(e,this._accountingRules())}auditNodes(){return Vy(document,this._accountingRules()).map(Gy)}checkAccounting(){this._reportSafely(()=>Xy(Vy(document,this._accountingRules()),this._reportedDrifts))}_checkCommitted(e){this._reportSafely(()=>{const t=e.flatMap(n=>[...n.added,...n.reparented??[],...n.reordered??[]]);Xy(UO(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+rv-Date.now());this._accountingTimer=setTimeout(()=>{const n=window.requestIdleCallback;n?n(e,{timeout:rv}):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=Xx(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),this._dropForeignNodes(n),al("commit",()=>{const r=TO(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())});rR(()=>{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 lR(e,this._textPoints())}offsetToPoint(e){return cR(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)}}_dropForeignNodes(e){const t=n=>!this.ownership.isMarked(n)||!!this._nodeMap.getByElement(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=AO(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Bb(()=>{const n=uy(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===D.ELEMENT){const r=dd(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,rr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{al("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,u2()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)al(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=Ux(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=Cx(e,this._nodeMap,o=>this._parsedDocument.isAttached(o),o=>this.ownership.markOf(o)==="service",o=>this.ownership.isOuterWrapper(o),o=>this.ownership.isWrapper(o)&&o.nodeName==="EDITOR"),r=kx(n);this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),r.push(...nN(Nx(n)));try{if(Fx(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);Yd.isEqual(i,s)}}}finally{hb(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){st("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}}}},yne=1500,vne=2,pR=100,gR=class{constructor(e){A(this,"_options",void 0),A(this,"_watches",new Map),A(this,"_timer",void 0),A(this,"_last",0),A(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,pR))}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)}},sf=class{constructor(){A(this,"_changes",null),A(this,"_typedAt",null),A(this,"_selection",null),A(this,"_closesStep",!1)}get(){return this._changes}hasChanges(){return!!this._changes?.length}add(e){this.hasChanges()||(this._selection=null);const t=At(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)}}},iv=60;function bR(e,t){const n=Pb(e,t);if(!n)return;const r=n.start;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+iv),cached:t.substring(r,r+iv)}}var yR=64,vR=class extends Ee{constructor(...e){super(...e),A(this,"_onApplyEmitter",this.addDisposable(new ge)),A(this,"_onEmptyEmitter",this.addDisposable(new ge)),A(this,"_dispatched",[]),A(this,"_echoed",new Set),A(this,"_revertedAwaiting",new Set),A(this,"onApply",this._onApplyEmitter.event),A(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>yR&&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=cl(i.textChanges,o,"after"),a=s&&cl(o,i.textChanges,"before");if(!s||!a)return!1;i.textChanges=s,o=a}n=At(n,o)}return this._dispatched=t.reverse(),this._emit(n),!0}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(At(Pn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=At(t,Pn(n.textChanges)),n.changeId!==void 0&&this._revertedAwaiting.add(n.changeId);this._dispatched=[],this._emit(At(t,e))}clear(){const e=this.hasDispatched();this._dispatched=[],this._revertedAwaiting.clear(),e&&this._onEmptyEmitter.fire()}},ER=class Jk extends Ee{constructor(t=""){super(),A(this,"_text",void 0),this._text=t}getText(t){const n=T2(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new Jk(this._text)}},Sl=class eL extends ER{constructor(t=""){super(t),A(this,"_eventQueue",void 0),A(this,"_lockCounter",0),A(this,"_onChangeEmitter",this.addDisposable(new ge)),A(this,"_onChangedEmitter",this.addDisposable(new ge)),A(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>O2(this,r)),n.length){const r=Uo(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=L2(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=At(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 eL(this._text)}};function sv(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function wl(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 SR(e){return(t,n,r)=>wl(t)?e(t,n,r):!1}function wR(e){return t=>wl(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function _R(e){return(t,n,r)=>wl(t)?sv(t)?e(t,n,r):t:!1}function CR(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return wl(n)?sv(n)?e(t):t:!1}}function TR(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function af(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 AR(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 kR=8,LR=class{constructor(){A(this,"_byKey",Object.create(null)),A(this,"_byValue",Object.create(null))}getOrCreateByKey(e){let t=this._byKey[e];return t===void 0&&(t=AR(kR),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},_l=new LR;function av(e,t){return t!==void 0&&!af(e,t)?`%|{${_l.getOrCreateByKey(e)}}|%`:e}function NR(e){const t=_l.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Ze(e,t,n){return t!==void 0?af(e,t)?e:`%|{${_l.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function xR(e){return e.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function ze(e){return e.startsWith("<!--")&&e.endsWith("-->")?xR(e.slice(4,-3)):e}function OR(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 RR(e,t,n){return t!==void 0?af(e,t)?e:`%|{${_l.getOrCreateByKey(e)}}|%`:n||TR(e)||OR(e)?`<!--${e}-->`:e}var io=SR(Ze),so=wR(ze),MR=_R(Ze),PR=CR(ze),IR=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",NR),e.escape("@{","}",Ze,!0).unescape("<!--@{","}-->",ze,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",av,!0),e.escape("{{","}}",av,!0),e.createSyntax("brace-percent").escape("{%","%}",Ze).unescape("<!--{%","%}-->",ze),e.createSyntax("brace-hash").escape("{#","#}",Ze).unescape("<!--{#","#}-->",ze),e.createSyntax("proscript").escape("[%","%]",RR,!0).unescape("<!--[%","%]-->",ze,!0),e.createSyntax("getresponse").escape("[[IF","]]",Ze).escape("[[if","]]",Ze).escape("[[ELSE]]","",Ze).escape("[[else]]","",Ze).escape("[[ENDIF]]","",Ze).escape("[[endif]]","",Ze).unescape("<!--[[IF","]]-->",ze).unescape("<!--[[if","]]-->",ze).unescape("<!--[[ELSE]]","-->",ze).unescape("<!--[[else]]","-->",ze).unescape("<!--[[ENDIF]]","-->",ze).unescape("<!--[[endif]]","-->",ze),e.createSyntax("expert-sender").escape("<if",">",Ze).escape("</if",">",Ze).escape("<else",">",Ze).escape("</else",">",Ze).escape("<var ",">",Ze,!0).unescape("<!--<if ",">-->",ze).unescape("<!--</if",">-->",ze).unescape("<!--<else ",">-->",ze).unescape("<!--</else",">-->",ze).unescape("<!--<var",">-->",ze,!0),e.createSyntax("velocity").escape("#if",")",io).escape("#elseif",")",io).escape("#else","",Ze).escape("#foreach",")",io).escape("#macro",")",io).escape("#set",")",MR,!0).escape("#parse",")",io).escape("#include",")",io).escape("#evaluate",")",io).escape("#end","",Ze).escape("#break","",Ze).escape("#stop","",Ze).unescape("<!--#macro","-->",so).unescape("<!--#if","-->",so).unescape("<!--#elseif","-->",so).unescape("<!--#else","-->",ze).unescape("<!--#foreach","-->",so).unescape("<!--#parse","-->",so).unescape("<!--#include","-->",so).unescape("<!--#evaluate","-->",so).unescape("<!--#end","-->",ze).unescape("<!--#break","-->",ze).unescape("<!--#stop","-->",ze).unescape("<!--#set","-->",PR,!0),e.createSyntax("mailchimp").escape("*|","|*",Ze).unescape("<!--*|","|*-->",ze)},lv="bare",lf=new Map;function DR(e){for(const t of Object.keys(e)){const n=e[t];n&&lf.set(t,n)}}function BR(e){return e?lf.get(e)??lv:lv}function HR(){lf.clear()}function cv(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 bs(e,t){return e.start<t.end&&t.start<e.end}function uv(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:h,isVariable:m}of i){if(r?(l.insideAttributeValue=!0,l.attributeQuoteChar='"'):cv(e,c,u.start,l),c=u.end,a.some(k=>bs(k,u)))continue;const p=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,v=e.substring(u.start,u.end),C=d(v,p,l.insideTag);C!==!1&&C!==v&&(s.push({range:u,text:C,overrideBuiltins:f,syntax:h,isVariable:m}),a.push(u))}return s.sort((u,d)=>u.range.start-d.range.start||u.range.end-d.range.end)}function FR(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 cf(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=FR(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='"'):cv(e,l,u,a),l=u;const h=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let m=!1;for(const{mapFn:p,value:v,syntax:C,isVariable:k}of f){let L=u+d.length,E=e.indexOf(v,L);for(;E!==-1;){let g=E,y=u+d.length,w=0;for(;g!==-1;){const x=e.indexOf(d,y);if(x!==-1&&x<g)w++,y=x+d.length,g=e.indexOf(v,y);else if(w>0)w--,y=g+v.length,g=e.indexOf(v,y);else break}if(g<0)break;const b=g+v.length,S=e.substring(u,b),_=p(S,h,a.insideTag);if(_===!1){L=E+Math.max(v.length,1),E=e.indexOf(v,L);continue}(o||_!==S)&&i.push({range:{start:u,end:b},text:o?S:_,syntax:C,isVariable:k});const T=s.findIndex(({start:x})=>x>=b);T>c?c=T-1:c=s.length,m=!0;break}if(m)break}}return i}function Cl(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 dv=class{constructor(e=IR){A(this,"_disposables",[]),A(this,"_escapes",[]),A(this,"_unescapes",[]),A(this,"_escapeMatchers",[]),A(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=cf(e,this._escapes,t,n),o=uv(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>bs(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>bs(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=cf(e,this._unescapes,t),r=uv(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>bs(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>bs(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=>BR(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return cf(e,this._escapes,t,n,!0)}getEscapedText(e,t){return Cl(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return Cl(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=Cl(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=Cl(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()}},$R=1e4,fv=3,WR=o2+Rd;function qR(e){return(e??[]).reduce((t,n)=>t+n.oldLength,0)}function zR(e,t){return e.stack.closesStep()?!1:e.undoStop===t.undoStop||e.serviceRemoval+t.serviceRemoval<=200}var UR=class extends Sl{constructor(){super(),A(this,"_editStack",new sf),A(this,"_frozenStack",new sf),A(this,"_frozenUndoStop",!0),A(this,"_barrierSends",[]),A(this,"_barrierResolves",[]),A(this,"_queuedBarriers",[]),A(this,"_editLog",[]),A(this,"_entityId",void 0),A(this,"_versionController",this.addDisposable(new vR)),A(this,"_beforeSaveEmitter",this.addDisposable(new jN)),A(this,"_onReadyEmitter",this.addDisposable(new ge)),A(this,"_onEntitySetEmitter",this.addDisposable(new ge)),A(this,"_onPendingSentEmitter",this.addDisposable(new ge)),A(this,"_onHistoryAnswerEmitter",this.addDisposable(new ge)),A(this,"_onHistoryActionEmitter",this.addDisposable(new ge)),A(this,"_onHistoryActionSentEmitter",this.addDisposable(new ge)),A(this,"_onHistoryActionAnsweredEmitter",this.addDisposable(new ge)),A(this,"_canvasEdits",0),A(this,"_nextActionId",1),A(this,"_historyAction",null),A(this,"_cache",new Sl),A(this,"beforeSave",this._beforeSaveEmitter.event),A(this,"_reverting",!1),A(this,"_inited",!1),A(this,"_nextChangeId",1),A(this,"_originId",`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`),A(this,"_rev",null),A(this,"_sealed",[]),A(this,"_saveHeld",!1),A(this,"_releasing",!1),A(this,"_applyingRemote",!1),A(this,"collectCanvasEdits",()=>Promise.resolve()),A(this,"_echoLost",!1),A(this,"_reportedText",null),A(this,"_reportId",0),A(this,"_lostChangeIds",new Set),A(this,"_recoveryTimer",void 0),A(this,"_recoveryOverdue",!1),A(this,"_coveredRev",null),A(this,"_awaitingRefill",!1),A(this,"_resyncing",!1),A(this,"_onEchoLostEmitter",this.addDisposable(new ge)),A(this,"_onEchoRecoveredEmitter",this.addDisposable(new ge)),A(this,"_echoWatchdog",this.addDisposable(new gR({isAwaiting:e=>this._versionController.isInFlight(e)||this._versionController.isRevertedAwaiting(e),onGiveUp:(e,t)=>this._onEchoLost(e,t)}))),A(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}}),A(this,"_handleSetEntity",e=>{this._reportSyncDrift("set-entity"),HR(),DR(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()}),A(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)=>At(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)})),A(this,"onReady",this._onReadyEmitter.event),A(this,"onEntitySet",this._onEntitySetEmitter.event),A(this,"onHistoryAnswer",this._onHistoryAnswerEmitter.event),A(this,"onHistoryAction",this._onHistoryActionEmitter.event),A(this,"onHistoryActionSent",this._onHistoryActionSentEmitter.event),A(this,"onHistoryActionAnswered",this._onHistoryActionAnsweredEmitter.event),this.addDisposable(z.addListenerAsync(de.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(z.addListenerAsync(de.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this.addDisposable(z.addListenerAsync(de.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:ls(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(or,ro(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=cl(a,n,"after"),c=l&&cl(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(or,ro(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)=>At(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(or,ro(At(Pn(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)=>At(e,t.get()??[]),[])}_textWithoutUnsent(){return w2(this.getText(),Pn(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:qR(this._editStack.get()),n=new sf;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||!zR(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=>Vb(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,kr("echo-timeout",()=>({guid:this._entityId,at:"update-entity",unsent:n,textFingerprint:Ib(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 ge;let n=!1;const r=setTimeout(()=>{n=!0,t.fire()},WR),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++<fv&&(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<fv)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),Rd),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)},Rd)}_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(or,[{range:ls(this._cache),text:r}]),this._rev=t??null,this._applyToCache(e),this._versionController.apply(this._changesToCache())}catch{}finally{this._resyncing=!1}const o=Ib(this._cache.getText());if(o.length!==n.length||o.hash!==n.hash){this._awaitingRefill=!0,this._finishBarrier(!1),kr("resync-failed",()=>({guid:this._entityId,textFingerprint:o}));return}this._coveredRev=this._rev,this._clearEchoLost(),this._flushPendingSave(),this._onReadyEmitter.fire()}_replaceText(e){this._cache.applyEdits(or,[{range:ls(this._cache),text:e}]),super.applyEdits(or,[{range:ls(this),text:e}])}_reportSyncDrift(e){if(this.hasChanges()||this._versionController.hasDispatched())return;const t=bR(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;kr("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}_changesToCache(){const e=this._textWithoutUnsent(),t=this._cache.getText(),n=Pb(e,t);if(!n)return[];const{start:r,fromEnd:o,toEnd:i}=n;return[new Vt(r,e.slice(r,o),r,t.slice(r,i))]}_applyToCache(e){return this._applyGroupsToCache(e).reduce((t,n)=>At(t,n),[])}_applyGroupsToCache(e){const t=[];for(const n of e){const r=n.reverse();t.push(Uo(r,this._cache)),this._cache.applyEdits(or,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=Uo(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:ro(t),changeId:s,originId:this._originId,...this._rev!==null?{baseRev:this._rev}:{},...r?{typedAt:r}:{},...o?{selection:o}:{},...i?{closesStep:i}:{}},l=()=>z.send(de.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=>Vb(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()},$R),r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})})}_reportSaveTimeout(){kr("save-timeout",()=>({}))}hasChanges(){return this._editStack.hasChanges()||this._frozenStack.hasChanges()||this._sealed.length>0}},jR=class extends dv{constructor(e,t){super(),A(this,"_baseDocument",void 0),A(this,"_mappedDocument",void 0),A(this,"_mappings",[]),A(this,"_cachedMappedDocument",new Sl),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=Uo(this.getMappings(n),this._baseDocument),o=Pn(this._mappings);if(t=At(o,t),t=At(t,r),this._mappings=r,t.length){const i=ro(t);this._mappedDocument.applyEdits(e,ul(i))}}}correctOffset(e,t){const n=t?this._mappings:Pn(this._mappings),r=fd(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=Pn(this._mappings).find(({oldPosition:n,oldEnd:r})=>e>=n&&e<r);return t?{start:t.oldPosition,end:t.oldEnd}:null}hasMappedReplacementRangeInRange(e){return Pn(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 cs(e,n)}unescape(e){const t=this.getRevertMappings(e);return cs(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=or){const t=this._baseDocument.getText(),n=this.getMappings(t),r=cs(t,n);this._mappings=Uo(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=Uo(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=At(o,t),t=At(t,r),this._mappings=Pn(r),t.length){const i=ro(t);this._baseDocument.applyEdits(e,ul(i))}}}},VR="input, textarea, select, .monaco-editor",GR=/^(Arrow(Left|Right|Up|Down)|Home|End|PageUp|PageDown|Tab)$/;function mv(e,t){return e?.node===t?.node&&e?.offset===t?.offset}function XR(e,t){return mv(e?.anchor,t?.anchor)&&mv(e?.focus,t?.focus)}function Tl(){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 KR=class extends Ee{constructor(e,t,n){super(),A(this,"_htmlDocument",void 0),A(this,"_mapping",void 0),A(this,"_remoteDocument",void 0),A(this,"_mark",void 0),A(this,"_pending",void 0),A(this,"_actionMark",void 0),A(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=!XR(this._mark,this._actionMark))}),this._listen(window,"pointerdown",!0,()=>{this._moved=!0}),this._listen(window,"keydown",!1,r=>{this._moved||(this._moved=!r.defaultPrevented&&GR.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=Tl(),this._moved=!1}))}_listen(e,t,n,r){const o=i=>{this._mark=Tl(),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=Tl(),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(VR))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=Tl())}};function YR(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function ys(e){let t=e.head;if(!t){t=e.createElement("head");const n=YR(e);n.insertBefore(t,n.firstChild)}return t}function ZR(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function QR(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function JR(e){const t=ys(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 hv="amp-custom";function eM(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function pv(e,t,n){for(const r of t)if(ms.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(Gd(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 ms.isMediaRule(r)&&pv(e,r.cssRules,n)}function gv(e,t){const n=t.sheet;if(n){const i=new Set;pv(e,n.cssRules,(s,a)=>{const l=eM(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>ms.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 tM(e){const t=ys(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(hv)===""){gv(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(hv,""),t.append(i),gv(e,i)}for(const i of n)i.remove()}var uf="<!doctype html>";function nM(e){const t=e.doctype;if(t){if(dy(t)===uf)return;const n=new DOMParser().parseFromString(uf,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString(uf,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function bv(e,t={}){const n=document.createElement("amp-img"),r=await Sx(e)||void 0,o=[];try{let i=e;for(;i&&Gd(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=QR(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={...ZR(e),alt:e.alt,width:a,height:s,src:u,layout:c?"responsive":"fixed",...t};for(const d of Object.keys(t))er(n,d,t[d])}finally{for(const[i,s]of o)i.style.display=s}return n}async function rM(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push(bv(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(bv(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 oM(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=ys(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function iM(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 yv="https://cdn.ampproject.org/v0",vv=`${yv}.js`,sM=`script[src='${vv}']`;function aM(e,t){return`${yv}/${e.toLowerCase()}-${t}.js`}async function lM(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=ys(e),a=n.createElementFn("script"),l=aM(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 Ene=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),Sne=function(e,t){return new URL(e,t).href},wne={},df=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)})},Ev=void 0;async function Al(){return Ev||(Ev=await df(()=>Promise.resolve().then(()=>id("./rules.CL_BitCE.js")).then(e=>e.default),void 0,{}.url))}var ff=new Map;async function cM(){if(!ff.size){const e=await Al(),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))||[];ff.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return ff}var mf=new Map;async function uM(){if(!mf.size){const e=await Al();for(const t of e.declarations)mf.set(t.name,t)}return mf}var dM="$GLOBAL_ATTRS",hf=new Map;async function fM(){if(!hf.size){const e=(await Al()).attrLists.find(t=>t.name===dM)?.attrs;if(e)for(const t of e)hf.set(t.name,t)}return hf}function mM(e){return In(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function Sv(e){return yx(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function wv(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--)wv(i[s],t,n)}if(In(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 Xd(e)?o():oo(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&oo(e.nextSibling))&&r()}async function hM(e,t){const n=new Set,r=t.commit,o=h=>t.replaceSelectors(h.toLowerCase());if(t.replaceImages&&await rM(e,r),t.injectExtensions){const h=t.replaceSelectors(sM);if(!e.querySelector(h)){const m=t.createElementFn("script");m.setAttribute("src",vv),m.setAttribute("async",""),ys(e).appendChild(m),r?.()}}t.injectRequiredTags&&(iM(e,t.createElementFn,o),nM(e),JR(e),oM(e),r?.()),t.replaceStylesAndLinks&&(tM(e),r?.());const i=await Al(),s=await cM(),a=new Set(t.removeUnsupportedTags?e.querySelectorAll("*"):[]),l=new Map;for(let[h,m]of s)if(!m.deprecation){h=o(h);let p=[...e.querySelectorAll(h)].filter(v=>!l.has(v));m.unique&&p.length&&(p=[p[0]]),t.injectRequiredTags&&m.required&&!p.length&&(p=[...p,t.createElementFn(m.name)]);for(const v of p){if(t.injectRequiredAttributes&&v.getAttribute("on")&&!v.getAttribute("tabindex")&&v.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let k=!1;for(const L of[...v.classList])L.startsWith("i-amphtml")&&(k=!0,v.classList.remove(L));k&&!v.classList.length&&v.removeAttribute("class")}const C=l.get(v);C&&C.priority>m.priority||l.set(v,m)}}r?.();for(const[h,m]of l){if(t.injectExtensions&&m.requiresExtension)for(const C of m.requiresExtension)n.add(C);const p=m.requiredParent?m.requiredParent==="$ROOT"?e:e.querySelector(m.requiredParent):null;p&&(!h.parentNode||t.moveInvalidTagPosition)?p!==h.parentNode&&(m.name==="HEAD"||In(p)&&p.tagName==="HEAD"?p.insertBefore(h,p.firstChild):p.appendChild(h)):h.parentNode||e.body.appendChild(h),t.removeUnsupportedTags&&a.delete(h),r?.();const v=await fM();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const C=m.attrs,k=t.injectRequiredAttributes?new Set([...C].map(([E,g])=>g).filter(E=>E.required&&E.value)):void 0,L=h.getAttributeNames();for(const E of L){const g=C.get(E)||v.get(E);if(g){if(E==="id"||E==="class"||E==="style"){k?.delete(g);continue}if(t.removeUnsupportedAttributes){const y=h.getAttribute(E);if(g.value&&g.value.indexOf(y)<0){h.removeAttribute(E);continue}if(g.valueRegex&&!new RegExp(g.valueRegex).test(y)){h.removeAttribute(E);continue}if(g.disallowedValueRegex&&new RegExp(g.disallowedValueRegex).test(y)){h.removeAttribute(E);continue}const w=g.valueUrl;if(w){if(y===""){if(!w.allowEmpty){h.removeAttribute(E);continue}}else if(!(y.indexOf("<!--")>0&&y.indexOf("-->")>0)){if(!w.allowRelative)if(y.startsWith("#")||y.startsWith("/")){h.removeAttribute(E);continue}else{const b=w.protocol.length?w.protocol:["https"],S=y.substring(0,y.indexOf(":"));if(S){if(b.indexOf(S)<0){const _=b[0]+y.substring(y.indexOf(":"));if(URL.canParse(_))er(h,E,_);else{h.removeAttribute(E);continue}}else if(!URL.canParse(y)){h.removeAttribute(E);continue}}else{const _=b[0]+y;if(URL.canParse(_))er(h,E,_);else{h.removeAttribute(E);continue}}}}}}k?.delete(g)}else{if(E==="id"||E==="class"||E==="style")continue;t.removeUnsupportedAttributes&&h.removeAttribute(E)}}if(k)for(const E of k)er(h,E.name,E.value[0])}r?.()}t.moveInvalidTagPosition&&(wv(e,e.body,o),r?.());for(const h of a)h.remove();if(r?.(),t.removeUnsupportedStyles){let p=function(E){const g=E.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const y of g){if(!y)continue;const w=E.getPropertyValue(y);E.getPropertyPriority(y)==="important"&&E.setProperty(y,w);const b=m.get(y);b?b.value?b.value.indexOf(w)<0&&E.removeProperty(y):b.valueRegex&&(new RegExp(b.valueRegex).test(w)||E.removeProperty(y)):E.removeProperty(y)}r?.()},v=function(E){return E.constructor.name==="CSSStyleRule"},C=function(E){return E.constructor.name==="CSSMediaRule"},k=function(E){const g=E.cssRules;for(let y=g.length-1;y>=0;y--){const w=g[y];v(w)?w.selectorText.indexOf("[")>=0||w.selectorText.indexOf(":")>=0?E.deleteRule(y):(p(w.style),w.style.cssText||E.deleteRule(y)):C(w)?(k(w),w.cssRules.length||E.deleteRule(y)):E.deleteRule(y)}};var c=p,u=v,d=C,f=k;const h=e.querySelectorAll("*"),m=await uM();for(const E of h)if(Gd(E)){const g=E.getAttribute("style");g&&(p(E.style),E.style.length?E.style.cssText!==g&&E.setAttribute("style",E.style.cssText):E.removeAttribute("style"))}const L=e.querySelector("style[amp-custom]");if(L){const E=L.sheet;E&&(k(E),L.innerHTML=[...E.cssRules].map(g=>g.cssText).join(`
|
|
12
|
-
`)),r?.()}}await lM(e,i.extensions.filter(({name:h})=>n.has(h)),t)}function pM(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function _v(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return hM(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=>pM(i.toLowerCase(),o),commit:t.commit})}function pf(){z.send(de.RELOAD),window.location.reload()}function gM(e){const t=new Ee;let n=[];function r(){n=[...new Set([...n,...document.querySelectorAll("script")])].filter(s=>lN(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(z.addListener(de.RELOAD,pf)),t.addDisposable(e.onChange(()=>{let i=r();for(const s of o)i.has(s)||pf();o=i})),t}var kl=[];function bM(e){return kl.push(e),{dispose:()=>{const t=kl.indexOf(e);t!==-1&&kl.splice(t,1)}}}function gf(e){for(const t of kl){const n=t(e);if(n)return n}return e}function yM(){const e=document.querySelector("[em-edit]");return e?gf(e):null}var Ll=new Set(["img","image","input","video","source","em-replace"]);function Cv(e){const t=e.toLowerCase(),n=Ll.has(t);return Ll.add(t),{dispose:()=>{n||Ll.delete(t)}}}function vM(e){return Ll.has(e.toLowerCase())}var vs=[];function EM(e){return vs.push(e),{dispose:()=>{const t=vs.indexOf(e);t!==-1&&vs.splice(t,1)}}}function Tv(e){return vs.some(t=>t.isPathElement?.(e))}function SM(e,t){let n;for(const r of vs){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function Av(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var wM={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||Av(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(Av(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}}},_M=class extends Ee{constructor(...e){super(...e),A(this,"hasAmp",!1)}};function CM(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function TM(e,t,n){const r=CM(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function AM(){const e=new Ee;return e.addDisposable(B2(t=>t.startsWith("amp"))),e.addDisposable(H2(t=>t==="class"||t==="style")),e}function kM(e){const t=o=>Sv(o)&&e.getOuterHtml(o)!==""||mM(o)||bx(o),n=o=>{if(t(o))return!0;if(In(o)||Xd(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new _M;return r.addDisposable(bM(o=>o.closest("amp-img"))),r.addDisposable(EM(wM)),r.addDisposable(AM()),r.addDisposable(Cv("amp-img")),r.addDisposable(Cv("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,z.send(de.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)_v(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)Sv(l)&&l.remove();pf()}})):s&&setTimeout(()=>{_v(document,{correct:!1})})})),r.addDisposable(z.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&&(TM(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function LM(e,t){const n=kM(t);return e.inject(kd,n),{service:n,dispose(){n.dispose(),bn(e,kd)}}}var NM={name:"sandbox.amp",provides:[kd],awaits:{services:[Y]},setup(e){const{service:t}=LM(e,R(e,Y));e.addService(Lb,()=>({ampService:t}))}};(function(){"use strict";function e(t,n){var r,o=0,i=t.length,s,a="",l,c,u,d,f,h,m,p,v=!0,C=!1,k;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"&&(C=r.autosemicolon);function L(S){return S===" "||S===`
|
|
13
|
-
`||S===" "||S==="\r"||S==="\f"}function E(S){return S==="'"||S==='"'}function g(S){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(S)>=0}function y(){for(var S=h;S>0;S-=1)a+=r.indent}function w(){a=k(a),v?a+=" {":(a+=`
|
|
14
|
-
`,y(),a+="{"),c!==`
|
|
15
|
-
`&&(a+=`
|
|
16
|
-
`),h+=1}function b(){var S;h-=1,a=k(a),a.length>0&&C&&(S=a.charAt(a.length-1),S!==";"&&S!=="{"&&(a+=";")),a+=`
|
|
17
|
-
`,y(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?k=function(S){return S.trimRight()}:k=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},h=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,E(m)){a+=l,l===m&&(m=null),l==="\\"&&c===m&&(a+=c,o+=1);continue}if(E(l)){a+=l,m=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&&L(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=f.Start,a+=l;continue}if(g(l)||l==="@"){if(u=k(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=k(a),w(),d=u==="@font-face"?f.Ruleset:f.Block;continue}a+=l;continue}if(d===f.Block){if(g(l)){if(u=k(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);y(),a+=l,d=f.Selector;continue}if(l==="}"){b(),d=f.Start;continue}a+=l;continue}if(d===f.Selector){if(l==="{"){w(),d=f.Ruleset;continue}if(l==="}"){b(),d=f.Start;continue}a+=l;continue}if(d===f.Ruleset){if(l==="}"){b(),d=f.Start,h>0&&(d=f.Block);continue}if(l===`
|
|
27
|
-
`){a=k(a),a+=`
|
|
28
|
-
`;continue}if(!L(l)){a=k(a),a+=`
|
|
29
|
-
`,y(),a+=l,d=f.Property;continue}a+=l;continue}if(d===f.Property){if(l===":"){a=k(a),a+=": ",d=f.Expression,L(c)&&(d=f.Separator);continue}if(l==="}"){b(),d=f.Start,h>0&&(d=f.Block);continue}a+=l;continue}if(d===f.Separator){if(!L(l)){a+=l,d=f.Expression;continue}E(c)&&(d=f.Expression);continue}if(d===f.Expression){if(l==="}"){b(),d=f.Start,h>0&&(d=f.Block);continue}if(l===";"){a=k(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 xM(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 OM=["transform","transform-origin","overflow-x","height"];function RM(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function Es(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of OM)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 MM(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(Es(t,1),t.scrollWidth)}function PM(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=RM(MM(e,n),t.innerWidth);return Es(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function IM(e,t){Es(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;Es(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 dt(e){const t=R(e,Te);return n=>{t.commit(n)}}function at(){return R(Mt,Y)}function DM(){return R(Mt,ot)}function BM(){return R(Mt,pn)}function ft(){return Mt.getInstance(Y)!==void 0}function ao(e){R(Mt,Te).commit(e)}function HM(e){if(!ft())return e(),Promise.resolve(!0);const t=at();return t.commit(!1),t.flushCommit(),t.sendAfterCurrentEdits(e)}function FM(){if(!ft())return!1;const e=at();return e.commit(!1),e.flushCommit(),e.hasEditsAfterBoundary()}function $M(){return ft()?at().markHistoryAction():void 0}function WM(e){ft()&&at().noteHistoryActionSent(e)}function bf(e){return ft()&&at().holdInput(e)}function kv(e){return ft()&&at().holdInputBehindQueued(e)}function Lv(){ft()&&at().closeUndoStep()}function yf(){return ft()&&at().isHoldingInput()}function Nv(){return ft()&&at().hasHeldInput()}function xv(){ft()&&at().releaseHeldInput()}function Ov(){return ft()&&at().holdsTypedEdits()}function Ss(e){return ft()?at().renderOnly(e):e()}function Nl(e){return e.nodeType===1&&e.localName==="template"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function vf(e){return[...e.querySelectorAll?.("template")??[]].filter(Nl)}function qM(e){return Nl(e)||vf(e).length>0}function rn(e){const t=[...Nl(e)?[e]:[],...vf(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)rn(r)}}function Zo(e){const t=[...Nl(e)?[e]:[],...vf(e)];for(const n of t)for(;n.firstChild;)n.content.appendChild(n.firstChild)}function Gt(){return ft()?at():void 0}function It(e){const t=Gt();return t?t.applyHidden(e):e()}function Be(e,t,...n){e&&It(()=>t?e.classList.add(...n):e.classList.remove(...n))}function lo(e){const t=document.activeElement;t instanceof HTMLElement&&t!==document.body&&e.contains(t)&&It(()=>t.blur())}function Ef(e){Gt()?.ownership.markService(e)}function Rv(e){Gt()?.ownership.markWrapper(e)}function Mv(e){Gt()?.ownership.markOuterWrapper(e)}function ws(e,t){e.removeAllRanges(),It(()=>e.addRange(t))}function xl(e){const t=document.implementation.createHTMLDocument("").importNode(e,!0);nn(e,t);const n=new Map([[e,t]]),r=Gt()?.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),Zo(t),{copy:t,counterpart:i=>n.get(i)}}function Ol(e){return Zg(xl(e).copy)}function Ue(e){return zL(xl(e).copy)}function _s(e){const t=Gt();return t?(t.flushCommit(),t.getOuterHtml(e)):e.outerHTML}function Sf(e){return Pv(e)}function Pv(e){const t=Gt();return!t||t.isInLetter(e)||!t.isUntracked(e)&&!t.ownership.isService(e)}function wf(e){const t=Gt();return t?t.ownership.markOf(e)?"foreign":t.isInLetter(e)?"letter":t.isBehindHidden(e)?"foreign":"new":"letter"}function _f(e,t){const n=[...e.querySelectorAll(t)].filter(Sf);return n[n.length-1]??null}function Iv(e,t){const n=o=>t==="next"?o.nextElementSibling:o.previousElementSibling;let r=n(e);for(;r&&!Sf(r);)r=n(r);return r}function Dv(e,t){return[...e.childNodes].flatMap(n=>t.isInLetter(n)?[n]:Dv(n,t))}function Cf(e){lo(e);const t=Gt();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(...Dv(r,t))}function zM(e){const t=[...e.childNodes],n=Gt();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 UM(){const e=Gt();return e?{...e.scriptRunner,awake:()=>e.recordNow()}:{run:(t,n)=>n(),quiet:t=>t()}}function sr(e,t){const n=Le(e,"dormant"),r=ab(n);try{return t(n)}finally{hb(r,UM())}}function Bv(e,t,n){sr(n,r=>el(e,t,r))}function Cs(e,t,n){return e==="new"?sr(t,n):n(Le(t,!0))}function ar(e,t,n,r){Cs(e,r,o=>el(t,n,o))}function pt(e){return function(...t){const n=Gt(),r=()=>Reflect.apply(e,this,t);return n?n.applyOwn(r):r()}}function lr(e,t=!1,n){const r=()=>document.execCommand(e,t,n),o=Gt();return o?o.applyCommand(r):r()}function Hv(e){const t=()=>{Be(document.body,e,"mceNonEditable"),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};ft()?at().applyHidden(t):t()}function jM(){let e=!1,t=!0,n=!0;const r=new Set,o=i=>{t!==i&&(t=i,[...r].forEach(s=>{try{s()}catch{}}))};return{setApp(i){e=i},setIntegrator:o,isAppLocked:()=>e,isIntegratorLocked:()=>t,isTextLocked:()=>e||t,closeEditorInit(){n=!0},openEditorInit(){n=!1},isEditorInitClosed:()=>n,onIntegratorChange(i){const s=()=>i();return r.add(s),()=>r.delete(s)},reset(){e=!1,o(!0),n=!0}}}var Tf=jM();function VM(e){return{dispose:e.onIntegratorChange(()=>Hv(e.isTextLocked()))}}function GM(e,t){return e.beforeChange(({domMutations:n})=>{const r=n.flatMap(o=>o.type==="Add"&&o.node instanceof Element?[o.node]:[]);r.length&&queueMicrotask(()=>{if(!t.isTextLocked())return;const o=r.flatMap(i=>[...i.tagName==="EDITOR"?[i]:[],...Array.from(i.querySelectorAll("editor"))]);e.applyHidden(()=>{for(const i of o)i.isConnected&&i.setAttribute("contenteditable","false")})})})}function Af(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)=>Af(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)&&Af(e[i],t[i]))}function Fv(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&Af(o,a)||(o=a,i=!0,r(a))})},select(r){return Fv(n,r)}};return n}function $v(...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 Fv(o,i)}};return o}var Rl={applicationTheme:"light",applicationMode:"default",previewHeight:0,emailWidth:0,previewPage:!1,globalHolder:null,elementPath:[],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,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},Ts=$v({...Rl});function Dn(){return Ts.get()}var Ml=new ge,Qo=new Map,j={source:Ts,get(e){return Dn()[e]},getState(){return{...Dn()}},getStateRef(){return Dn()},set(e,t){if(Dn()[e]===t)return;Ts.set({...Dn(),[e]:t}),Ml.fire({[e]:t});const n=Qo.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(Dn()[r]!==o){Ts.set({...Dn(),[r]:o}),n[r]=o,t=!0;const i=Qo.get(r);i&&i.forEach(s=>s(o))}}t&&Ml.fire(n)},increment(e,t=1){const n=Dn()[e];typeof n=="number"&&j.set(e,n+t)},decrement(e,t=1){const n=Dn()[e];typeof n=="number"&&j.set(e,n-t)},subscribe(e){return Ml.event(e)},subscribeToKey(e,t){Qo.has(e)||Qo.set(e,new Set);const n=Qo.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&Qo.delete(e)}},reset(){Ts.set({...Rl}),Ml.fire(Dn())},resetKey(e){this.set(e,Rl[e])},getInitialState(){return Rl}};function XM(e,t){const n=$v(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var KM=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled"];function YM(e){const t="fd4347fc";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 ZM={name:"sandbox.hostFacts",provides:[Wo],setup(e){const t=Object.fromEntries(Object.entries(n2).map(([n,r])=>[n,XM(z,r).source]));e.inject(Wo,t)}},QM={name:"sandbox.hostFactsToState",awaits:{services:[Wo,Te,Y,Ye]},setup(e){const t=R(e,Wo),n=dt(e),r=R(e,Ye);t.theme.watch(o=>{j.set("applicationTheme",o),YM(o),n(!1)}),t.commonStyles.watch(o=>{o&&j.set("commonStyles",o)}),t.flags.watch(o=>{for(const i of KM)typeof o[i]<"u"&&j.set(i,o[i])}),VM(r),GM(R(e,Y),r),t.lockEditor.watch(o=>r.setIntegrator(o)),t.codeMode.watch(o=>j.set("codeMode",o)),t.appName.watch(o=>j.set("appName",o)),t.previewPage.watch(o=>{j.set("previewPage",o),Be(document.body,!!o,"em-sandbox-preview")})}},JM={name:"sandbox.viewport",awaits:{services:[Wo]},setup(e){R(e,Wo).viewport.watch(t=>xM(t,void 0,{state:j,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:j.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(Nb).forEach(n=>n()),messageService:z}))}};function Lr(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function Lt(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function eP(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),Be(document.body,!0,"em-sandbox-discuss");else{const n=t.editLock.isTextLocked()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),Be(document.body,!1,"em-sandbox-discuss","em-sandbox-discuss_set-target")}}function tP(e,t){Be(document.body,!!e.data.value,"em-sandbox-discuss_set-target")}function nP(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}}),Be(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 rP(e,t){Be(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 oP(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 iP={sandbox_lock_discuss:eP,sandbox_discuss_set_target:tP,sandbox_discuss_remove_target:nP,sandbox_discuss_reset:rP,sandbox_discuss_get_target:oP};function sP(e,t){t.editLock.setApp(!!e.data.data),Hv(t.editLock.isTextLocked())}function aP(e,t){t.setEditorFocus(e.data.data)}function lP(e,t){let n=e.data.data;if(typeof n!="number")return;n=DM().correctOffset(n,!0),n=BM().correctOffset(n,!0);let r=at().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-j.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:j.get("applicationMode")==="default"?s+j.get("iframeOffsetTop"):s}})}var cP={sandbox_lock_edit:sP,editor_change_focus:aP,update_position_from_editor:lP};function uP(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 dP(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 fP(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 mP(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 hP={sandbox_set_attr_to_images:uP,sandbox_set_attr_to_links:dP,sandbox_set_position_to_img:fP,sandbox_set_position_to_link:mP},pP={brightness:100,contrast:100,sepia:0},Pl={DARK:"dark",LIGHT:"light"},Wv=!1;function gP(e){Wv||(e.setFetchMethod(t=>window.fetch(t)),Wv=!0)}function bP(){let e=null,t=Pl.LIGHT;return{set(n){if(t=n,n===Pl.DARK){e??(e=df(()=>Promise.resolve().then(()=>id("./darkreader.CyLMh7_H.js")),void 0,{}.url)),e.then(r=>{t===Pl.DARK&&(gP(r),r.enable(pP))}).catch(r=>{e=null});return}e?.then(r=>{t===Pl.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var Il=bP();function yP(e,t){t.initPreview(!0)}function vP(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&Il.set(t)}var EP={init_preview:yP,sandbox_switch_theme:vP};function vn(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(xb,{owner:e,handlers:s})}}}var SP={name:"sandbox.operationEnvironment",provides:[Tr],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[]};j.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(Tr,t)}},wP=vn("discuss",iP,{services:[Te,Tr,Ye]},e=>{const t=dt(e),n=R(e,Tr),r=R(e,Ye);return()=>({commit:t,editLock:r,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:z,removeAllAttributes:Lr})}),_P=vn("editor",cP,{services:[Ie,it,Ye]},e=>{const t=R(e,Ie),n=R(e,it),r=R(e,Ye);return()=>({applicationElementSettingsSet:t,editLock:r,messageService:z,setEditorFocus:o=>n.setEditorFocus(o)})}),CP=vn("images",hP,{services:[Ie,yt,Te,Tr]},e=>{const t=R(e,Ie),n=R(e,yt),r=dt(e),o=R(e,Tr);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:z,setCursorPosition:i=>n(i)})}),TP=vn("preview",EP,{services:[ss]},e=>()=>({initPreview:t=>R(e,ss)(t)})),AP={name:"sandbox.operationsDispatcher",setup(e){z.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(xb).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)}})}},kP=[SP,wP,_P,CP,TP,AP],LP=["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"],NP=["style","class","align","href"],xP=new Set([...LP,"em-element-path_img"]);function OP(e){return e.split(/\s+/).filter(t=>t&&!xP.has(t)).join(" ")}var RP=32;function MP(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function PP(e){const t=[e.tagName];for(const n of NP){const r=e.getAttribute(n),o=n==="class"&&r!==null?OP(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function IP(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<RP&&(t.push(PP(n)),!MP(n));)n=n.parentElement,r++;return t.join("||")}function DP(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:IP(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 BP(e,t){t.onReleased(()=>{Promise.resolve().then(()=>{t.isLocked()||e.remember(document.querySelector("[em-edit]"))})})}var qv=Promise.resolve(),zv=null;function HP(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 FP(e,t){zv=e,qv=qv.finally(()=>{zv===e&&HP(e,t)})}function $P(e,t="unknown"){const n=Mt.getInstance(it);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}function WP(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 qP(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 _ne="br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object",As="data-em-caret",Cne="",cr=e=>e();function Dt(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function co(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function Nr(e){return(e??"").replaceAll("","")}function kf(e){return Nr(e.textContent)}function zP(e){return(e.nodeType===Node.TEXT_NODE||Dt(e))&&Nr(e.textContent)===""}function Lf(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r&&ws(r,n)}function Uv(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(!co(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),Nr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),Nr(i.toString())===""?{em:r,side:"after"}:null}function Nf(e,t){if(!e.collapsed)return null;const n=Uv(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(Nr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=Dt(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&&zP(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return co(i)?i:null}function Dl(e,t,n=cr){return xf(e,t,n)}function xf(e,t,n=cr){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(Dt(r))o=r;else{const s=document.createElement("span");s.setAttribute(As,""),Ef(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 Lf(i,i.length),o}var UP="p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote";function Of(e,t=cr,n=e.parentElement?.closest('[contenteditable="true"]')){jv(e,n)&&xf(e,"after",t)}function jv(e,t){if(!t)return!1;const n=e.parentElement?.closest(UP),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(`[${As}]`).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 Vv(e){const t=Dt(e)&&kf(e)===""?e.previousSibling:null;return t?.nodeName==="BR"&&jv(t,t.parentElement?.closest('[contenteditable="true"]'))}function Rf(e,t=cr){if(!Vv(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&&Lf(i,Array.prototype.indexOf.call(i.childNodes,o)),o}function Gv(){const e=window.getSelection(),t=e?.rangeCount?e.getRangeAt(0):null,n=t?.collapsed?t.startContainer:null,r=Dt(n)?n:n?.parentNode;return Vv(r)?r:null}function jP(e,t=cr,n){return Array.from(e.querySelectorAll(`[${As}]`)).filter(r=>r!==n).map(r=>Rf(r,t)).some(Boolean)}function VP(e,t=cr,n){const r=Array.from(e.querySelectorAll(`[${As}]`)).filter(o=>o!==n&&Nr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function GP(e,t=cr){const n=Nr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),Lf(r,r.length),r}function Xv(e){if(!e.collapsed)return;const{startContainer:t}=e,n=Dt(t)?t:t.parentNode;Dt(n)&&(co(n.previousSibling)?e.setStartAfter(n):e.setStartBefore(n),e.collapse(!0))}function Kv(e){e.querySelectorAll(`[${As}]`).forEach(t=>{const n=Nr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function XP(e,t){const n=Nf(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o&&ws(o,r),n}function KP(e,t){const n=Array.from(e.querySelectorAll("em-replace")).find(i=>co(i)&&t.intersectsNode(i)&&!Yv(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 Yv(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 YP(){document.execCommand("delete")}function ZP(){const e=window.getSelection()?.getRangeAt(0);e?.deleteContents(),e?.collapse(!0)}function Zv(e,t=cr,n=YP){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=>co(l)&&Yv(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;co(l)?Dl(l,"after",t):!l&&co(c)&&Dl(c,"before",t)}return!0}function Qv(){const e=window.getSelection();return e?.rangeCount?Nf(e.getRangeAt(0),"backward"):null}function QP(e,t=cr){const n=e.isConnected?e:Qv();if(!n)return;const r=n.closest('[contenteditable="true"]');It(()=>r?.focus({preventScroll:!0})),Dl(n,"after",t)}var Jv=Symbol("held-input-replay"),eE={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"},tE={deleteWordBackward:["backward","word"],deleteWordForward:["forward","word"],deleteSoftLineBackward:["backward","lineboundary"],deleteSoftLineForward:["forward","lineboundary"],deleteHardLineBackward:["backward","paragraphboundary"],deleteHardLineForward:["forward","paragraphboundary"]};function JP(e){return e in eE||e in tE}var eI={Backspace:["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward"],Delete:["deleteContentForward","deleteWordForward","deleteSoftLineForward"]},nE={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 Mf(){return/Mac/.test(window.navigator.platform)}function rE(e){return Mf()?e.altKey:e.ctrlKey}function tI(e){const t=e.ctrlKey||e.metaKey;return t&&/^[cxv]$/i.test(e.key)||e.key==="Insert"&&(t||e.shiftKey)}function nI(e){return e.key in nE||(e.ctrlKey||e.metaKey)&&e.key.length===1&&!tI(e)}function Pf(e){return Jv in e}function If(e){return e.target?.closest?.('[contenteditable="true"], editor')??void 0}function oE(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=eI[e.key];if(t)return Mf()&&e.metaKey?t[2]:rE(e)?t[1]:t[0]}function rI(e){const t=nE[e.key];if(!t)return;const n=Mf()&&e.metaKey&&(e.key==="ArrowLeft"||e.key==="ArrowRight")?"lineboundary":rE(e)?t[2]:t[1];document.getSelection()?.modify?.(e.shiftKey?"extend":"move",t[0],n)}function Df(e){return Object.defineProperty(e,Jv,{value:!0}),e}function iE(e,t){return e.isConnected&&t<=(e.nodeType===Node.TEXT_NODE?e.length:e.childNodes.length)}function sE(e){if(!iE(e.startContainer,e.startOffset)||!iE(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 oI(e,t){return t===void 0||sE(e)!==t?!1:(document.getSelection()?.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),!0)}function iI({inputType:e,data:t}){const n=tE[e];if(n){const o=document.getSelection();o?.isCollapsed&&o.modify?.("extend",n[0],n[1]),lr(n[0]==="backward"?"delete":"forwardDelete");return}const r=eE[e];r&&lr(r,!1,t??void 0)}function aE(e,t){if(t.target&&!oI(t.target,t.targetText))return;const{inputType:n,data:r}=t,o=Df(new window.InputEvent("beforeinput",{inputType:n,data:r,bubbles:!0,cancelable:!0}));e.dispatchEvent(o)&&iI(t)}function sI(e,t){const n=Df(new window.KeyboardEvent("keydown",{...t,bubbles:!0,cancelable:!0}));if(Object.defineProperty(n,"keyCode",{value:t.keyCode}),!e.dispatchEvent(n))return;const r=oE(t);r?aE(e,{inputType:r,data:r==="insertText"?t.key:null}):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()==="a"?lr("selectAll"):rI(t)}var aI='[contenteditable="true"], editor';function Bf(e){return(e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement)?.closest(aI)??void 0}function lI(){const e=document.getSelection();if(!e?.rangeCount||!e.anchorNode||!e.focusNode||!ft())return;const t=at(),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 lE(e){e?.anchor.release(),e?.focus.release()}function cE({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&&!!Bf(e)&&!n&&!t?.closest("em-replace, [data-em-caret]")}function uE(e){const t=e.current(),n=t===void 0||!ft()?void 0:at().offsetToPoint(t);return n&&cE(n)?n:void 0}function cI(e){const t=e&&uE(e.anchor),n=e&&uE(e.focus);if(!(!t||!n))return document.getSelection()?.setBaseAndExtent(t.node,t.offset,n.node,n.offset),Bf(t.node)}function uI(){const e=document.getSelection(),t=e?.rangeCount?e.anchorNode:null;return t&&cE({node:t})?Bf(t):void 0}function dI(e){const t=cI(e)??uI();return t}function Bl(e,t){const n=lI(),r=e(()=>{ft()&&at().flushCommit();const o=dI(n);lE(n),o&&t(o)});return r||lE(n),r}function Hf(e){e.preventDefault(),e.stopImmediatePropagation()}function fI(e){return/^(Tab|Escape|PageUp|PageDown|F\d{1,2})$/.test(e.key)||e.key==="Enter"&&(e.ctrlKey||e.metaKey)}var dE=e=>{if(!If(e)||Pf(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=>sI(u,l);oE(l)?yf()&&Bl(bf,c)&&Hf(e):nI(l)?Nv()&&Bl(kv,c)&&Hf(e):fI(l)&&Nv()&&xv()},fE=()=>{xv()},mE=e=>{if(!If(e)||!JP(e.inputType)||e.isComposing||Pf(e)||!yf())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&&sE(n)};Bl(bf,o=>aE(o,r))&&Hf(e)};function mI(e){return"clipboardData"in e?e.clipboardData:e.dataTransfer}var hI=["text/html","text/plain"];function pI(e,t){const n=Array.from(t.types??[]),r=Object.fromEntries(hI.filter(o=>n.includes(o)).map(o=>[o,t.getData(o)]));return Df({target:e.target,clipboardData:{types:Object.keys(r),files:[],getData:o=>r[o]??""},preventDefault:()=>{},stopPropagation:()=>{}})}function gI(e,t){if(Pf(e)||!yf()||!If(e))return!1;try{const n=mI(e);if(!n||n.files?.length)return!1;const r=pI(e,n);if(!Bl(bf,()=>t(r)))return!1}catch{return e.preventDefault(),!1}return e.preventDefault(),e.stopPropagation(),!0}function bI(){return window.addEventListener("keydown",dE,!0),window.addEventListener("beforeinput",mE,!0),window.addEventListener("pointerdown",fE,!0),{dispose(){window.removeEventListener("keydown",dE,!0),window.removeEventListener("beforeinput",mE,!0),window.removeEventListener("pointerdown",fE,!0)}}}function yI(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 hE(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 vI(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 EI(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 SI(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 wI(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 pE(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var _I={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function ks(e,t){const n=_I[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var CI=["strong","em","strike","sub","sup","b","i","s","u"];function TI(e,t){if(t)for(const n of CI)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 AI(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 Tne="#1C52DC",Ane="#1C52DC",kne="#1C52DC";function kI(e){if(typeof e.isContentEditable=="boolean")return e.isContentEditable;const t=e.closest("[contenteditable]");return!!t&&t.getAttribute("contenteditable")!=="false"}function gE(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 LI(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||!kI(o))return;const{display:i}=getComputedStyle(r);if(!(i&&i!=="inline")){if(!gE(r,t,n,!0))e.setStartAfter(r);else if(!gE(r,t,n,!1))e.setStartBefore(r);else return;e.collapse(!0)}}var NI="./js/sanitize-html/sanitize-html.js",bE="data-sanitize-html-loader",Hl=null,Ls=null;function yE(){return typeof __useblocks__<"u"?__useblocks__:void 0}function xI(e){const t=yE();if(typeof t?.moduleTransport!="function"||t.blobBlocked)return null;try{return t.moduleTransport(e)}catch{return null}}function OI(){const e=yE();e&&(e.blobBlocked=!0)}function RI(){return new URL(NI,document.baseURI||window.location.href).href}function Ff(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function MI(){if(Ff())return Promise.resolve();const e=RI();return document.querySelector(`script[${bE}]`)?Ls??Promise.resolve():(Ls||(Ls=PI(e).catch(t=>{throw Ls=null,t})),Ls)}async function PI(e){const t=xI(e);if(!t)return Fl(e);const n=await t.catch(()=>null);if(!n)return Fl(e);const r=URL.createObjectURL(n),o=await Fl(r).then(()=>!0,()=>!1);URL.revokeObjectURL(r),o||(OI(),await Fl(e))}function Fl(e){return new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(bE,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})}async function vE(){const e=Ff();return e||(Hl||(Hl=(async()=>{await MI();const t=Ff();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw Hl=null,t})),Hl)}function $l(e){return e?.nodeType===Node.TEXT_NODE}function II(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 EE(e,t,n,r){const o=II(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 SE(e,t,n,r){return e.node===t&&e.offset>n?{...e,offset:e.offset-r}:e}function $f(e,t,n=()=>"letter"){const r=e?.previousSibling,o=t?.nextSibling,i=$l(r)&&n(r)==="letter",s=i&&$l(e),a=$l(t)&&$l(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 E=c;E;E=E===u?null:E.nextSibling)d.push(E);const f=c.parentNode,h=Array.prototype.indexOf.call(f?.childNodes??[],u),m={node:l?.anchorNode??null,offset:l?.anchorOffset??0},p={node:l?.focusNode??null,offset:l?.focusOffset??0},v=EE(d,c,m.node,m.offset),C=EE(d,c,p.node,p.offset);let k=null,L=0;for(let E=c;E;){const g=E===u?null:E.nextSibling;E.nodeType!==Node.TEXT_NODE?k=null:k?(k.appendData(E.data),E.parentNode?.removeChild(E),L++):k=E,E=g}if(l&&(v||C)){const E=v?{node:v.head,offset:v.offset}:SE(m,f,h,L),g=C?{node:C.head,offset:C.offset}:SE(p,f,h,L);E.node&&g.node&&l.setBaseAndExtent(E.node,E.offset,g.node,g.offset)}}var DI=["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],BI={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 HI(e){const t=/^\s*(\d+(?:\.\d+)?)(px|pt|em)?\s*$/i.exec(e??"");return t?`${t[1]}${(t[2]||"px").toLowerCase()}`:null}var FI=/<span\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,$I=/\sdata-(?:buffer|metadata)=(?:"[^"]*"|'[^']*')/gi;function WI(e){return e.replace(FI,t=>t.replace($I,""))}function qI(e){const t=window.clipboardData;return("clipboardData"in e?e.clipboardData:e.dataTransfer)||t}function zI(e){return UI(e.replace(/\r\n?/g,`
|
|
31
|
-
`).replace(/\n$/,"").replace(/&/g,"&").replace(/\n/g,"<br>"))}function UI(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 xr=new Map,jI=3e3,VI=1e4;function GI(){const e=performance.now();return[...xr.values()].some(t=>t.waiting&&e-t.startedAt<VI)}function XI(){for(const[e,t]of xr)t.waiting&&(t.superseded=!0,xr.delete(e))}function KI(){return xr.size>0}async function YI(){let e;const t=new Promise(r=>{e=setTimeout(()=>{r()},jI)}),n=(async()=>{for(;xr.size;)await Promise.allSettled(xr.keys())})();await Promise.race([n,t]),clearTimeout(e)}function Wl(e,t=!1,n,r,o){if(gI(e,a=>{Wl(a,t,n,r,o)}))return Promise.resolve();if(GI())return e.preventDefault(),e.stopPropagation(),Promise.resolve();XI();const i={startedAt:performance.now(),waiting:!0,superseded:!1},s=ZI(e,t,n,r,o,i);return xr.set(s,i),s.finally(()=>xr.delete(s))}function wE(){const e=window.getSelection();e?.rangeCount&&LI(e.getRangeAt(0))}async function ZI(e,t,n,r,o,i){e.preventDefault(),e.stopPropagation();const s=qI(e);if(!s)return;const a=s.getData("text/html"),l=s.getData("text/plain");try{let c=a;if(!c||t)wE(),c=zI(l);else{const d=await vE();if(i.superseded)return;wE();const f=n?.text?.fontSize||16;let h=d(WI(c),{allowedTags:DI,allowedAttributes:BI,allowedStyles:{},transformTags:{span:function(E,g){let y="",w=!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"))&&(w=!0),(S.includes("font-style: italic")||S.includes("font-style:italic"))&&(b=!0),S.includes("text-decoration: underline")||S.includes("text-decoration:underline"),w&&b?(y="strong",g["data-italic"]="true"):w?y="strong":b&&(y="em")}return{tagName:y||"",attribs:g}},h1:function(E,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(E,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(E,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(E,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(E,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(E,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(E,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(E,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(E,g){return{tagName:"br",attribs:{}}},div:"br",b:function(E,g){if(g.style){const y=g.style.toLowerCase();return y.includes("font-weight: bold")||y.includes("font-weight:bold")||y.includes("font-weight: 700")||y.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(E,g){if(g.style){const y=g.style.toLowerCase();return y.includes("font-style: italic")||y.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(E,g){return{tagName:"strike",attribs:g}}},textFilter:function(E){return E.replace(/\s+/g," ")}});h=h.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const m=document.createElement("div");m.innerHTML=h,(E=>{E.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((g,y)=>{const w=g.getAttribute("data-list-type")==="ordered",b=g.querySelectorAll("li[data-list-item]");let S=1;w&&g.getAttribute("data-list-start")&&(S=parseInt(g.getAttribute("data-list-start"),10)||1);const _=document.createDocumentFragment(),T=g.previousSibling;T&&(T.nodeType===Node.TEXT_NODE&&T.textContent.trim()!==""||T.nodeType===Node.ELEMENT_NODE&&T.tagName!=="BR")&&_.appendChild(document.createElement("br")),b.forEach((x,N)=>{const I=document.createElement("span");I.innerHTML=w?`${S}. `:"• ",_.appendChild(I),(M=>{const V=document.createElement("div");V.innerHTML=M.innerHTML;let K=V.firstChild;for(;K&&K.nodeType===1&&K.tagName==="BR";)V.removeChild(K),K=V.firstChild;if(!V.hasChildNodes()){const se=document.createTextNode("");V.appendChild(se)}for(;V.firstChild;)_.appendChild(V.firstChild)})(x),N<b.length-1&&_.appendChild(document.createElement("br")),S++}),g.parentNode.replaceChild(_,g)}),E.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")})})(m),m.firstChild&&m.firstChild.nodeType===Node.ELEMENT_NODE&&m.firstChild.tagName==="BR"&&m.removeChild(m.firstChild),m.querySelectorAll("[data-font-size]").forEach(E=>{const g=HI(E.getAttribute("data-font-size"));let y=g?`font-size: ${g};`:"";E.getAttribute("data-bold")==="true"&&(y+=" font-weight: bold;"),E.getAttribute("data-italic")==="true"&&(y+=" font-style: italic;"),y&&E.setAttribute("style",y.trim()),E.removeAttribute("data-font-size"),E.removeAttribute("data-bold"),E.removeAttribute("data-italic")}),m.querySelectorAll("[data-italic]").forEach(E=>{const g=document.createElement("em");g.innerHTML=E.innerHTML,E.innerHTML="",E.appendChild(g),E.removeAttribute("data-italic")}),m.querySelectorAll("a").forEach(E=>{const g=E.getAttribute("href");if(!g||g.trim()==="")E.replaceWith(...E.childNodes);else{E.setAttribute("target","_blank");const y=n?.links?.color??"#1C52DC",w=n?.links?.underline??!0?"underline":"none";E.setAttribute("style",`color: ${y}; text-decoration: ${w};`)}});const v=m.querySelectorAll("*");let C=0;v.forEach(E=>{E.tagName!=="BR"&&E.tagName!=="SPAN"&&E.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(E.parentNode.removeChild(E),C++)}),m.querySelectorAll("span").forEach(E=>{E.innerHTML==="• "||/^\d+\. $/.test(E.innerHTML)||E.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&E.children.length===0&&(E.parentNode.removeChild(E),C++)});const k=window.getSelection(),L=k?.anchorNode?.nodeType===Node.ELEMENT_NODE?k.anchorNode:k?.anchorNode?.parentElement||null;TI(m,L),AI(m,L),c=m.innerHTML}const u=window.getSelection();if(u&&u.rangeCount>0){const d=u.getRangeAt(0);Xv(d),d.deleteContents();const f=document.createRange().createContextualFragment(c),h=f.firstChild,m=f.lastChild;d.insertNode(f),m?.nodeType===Node.TEXT_NODE&&d.setEnd(m,m.length),d.collapse(!1),$f(h,m,wf)}}catch{if(i.superseded)return;lr("insertText",!1,l)}i.waiting=!1,r(e),o(),await new Promise(c=>setTimeout(c,0))}var ql=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function _E(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function uo(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function CE(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?CE(t):!1)}function B(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 QI(e){try{return JSON.parse(e),!0}catch{return!1}}function TE(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 Jo(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function JI(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 zl(){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 Wf(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 Ns(e,t=zl()){e=ql(e)??"";const n=i=>ql(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=Ns(e,s),o))break}return o}function Ul(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 jl(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&&jl({elem:e.elem.previousSibling,width:e.width})}function e5(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 t5=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 AE(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>AE(r,t)).join(""):n}function n5(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 r5(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function o5(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 xs(){return yM()}function i5(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 kE(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)kE(r,t)}}function s5(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function G(e){if(a5(e))return l5(e)?e.trim():c5(e)}var LE={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},a5=e=>typeof e=="string"&&e.trim()!=="",l5=e=>LE.HEX.test(e);function c5(e){const t=LE.RGB.exec(e)?.groups;if(!t)return;const n=u5(t);return f5(n)}var u5=e=>({r:qf(e.r),g:qf(e.g),b:qf(e.b),a:d5(e.a)}),qf=e=>Math.min(255,parseInt(e||"0",10)),d5=e=>parseFloat(e||"1"),f5=e=>`#${zf(e.r)}${zf(e.g)}${zf(e.b)}`,zf=e=>e.toString(16).padStart(2,"0"),m5=0;function mt(e){return e>=48&&e<=57}function Or(e){return mt(e)||e>=65&&e<=70||e>=97&&e<=102}function Uf(e){return e>=65&&e<=90}function h5(e){return e>=97&&e<=122}function p5(e){return Uf(e)||h5(e)}function g5(e){return e>=128}function Vl(e){return p5(e)||g5(e)||e===95}function NE(e){return Vl(e)||mt(e)||e===45}function b5(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Gl(e){return e===10||e===13||e===12}function fo(e){return Gl(e)||e===32||e===9}function Bn(e,t){return!(e!==92||Gl(t)||t===m5)}function Xl(e,t,n){return e===45?Vl(t)||t===45||Bn(t,n):Vl(e)?!0:e===92?Bn(e,t):!1}function jf(e,t,n){return e===43||e===45?mt(t)?2:t===46&&mt(n)?3:0:e===46?mt(t)?2:0:mt(e)?1:0}function xE(e){return e===65279||e===65534?1:0}var Vf=new Array(128),Lne=128,Nne=130,xne=131,One=132,Rne=133;for(let e=0;e<Vf.length;e++)Vf[e]=fo(e)&&130||mt(e)&&131||Vl(e)&&132||b5(e)&&133||e||128;function Gf(e){return e<128?Vf[e]:132}function ei(e,t){return t<e.length?e.charCodeAt(t):0}function Xf(e,t,n){return n===13&&ei(e,t+1)===10?2:1}function ti(e,t,n){let r=e.charCodeAt(t);return Uf(r)&&(r=r|32),r===n}function Os(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(Uf(s)&&(s=s|32),s!==i)return!1}return!0}function y5(e,t){for(;t>=0&&fo(e.charCodeAt(t));t--);return t+1}function Kl(e,t){for(;t<e.length&&fo(e.charCodeAt(t));t++);return t}function Kf(e,t){for(;t<e.length&&mt(e.charCodeAt(t));t++);return t}function ni(e,t){if(t+=2,Or(ei(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&Or(ei(e,t));t++);const n=ei(e,t);fo(n)&&(t+=Xf(e,t,n))}return t}function Yl(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!NE(n)){if(Bn(n,ei(e,t+1))){t=ni(e,t)-1;continue}break}}return t}function Zl(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),mt(n)&&(t=Kf(e,t+1),n=e.charCodeAt(t)),n===46&&mt(e.charCodeAt(t+1))&&(t+=2,t=Kf(e,t)),ti(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),mt(n)&&(t=Kf(e,t+1+r+1))}return t}function Yf(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}Bn(n,ei(e,t+1))&&(t=ni(e,t))}return t}function OE(e){if(e.length===1&&!Or(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 RE=["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"],v5=16384;function Ql(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,v5)):e}var ME=10,E5=12,PE=13;function IE(e){const t=e.source,n=t.length,r=t.length>0?xE(t.charCodeAt(0)):0,o=Ql(e.lines,n),i=Ql(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===ME||c===PE||c===E5)&&(c===PE&&l+1<n&&t.charCodeAt(l+1)===ME&&(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 S5=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||IE(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||IE(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]}}}},on=16777215,Rr=24,w5=new Map([[2,22],[21,22],[19,20],[23,24]]),_5=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=Ql(this.offsetAndType,e.length+1),o=Ql(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&on;for(a=o[f],s=a>>Rr,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=w5.get(c),a=s<<Rr|i}r[i++]=c<<Rr|d,l===-1&&(l=u)}),r[i]=0<<Rr|n,o[i]=n,o[n]=n;a!==0;){const c=a&on;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]>>Rr:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&on:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?Os(this.source,this.offsetAndType[e-1]&on,this.offsetAndType[e]&on,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&on:this.offsetAndType[this.tokenCount]&on: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]&on,t=this.offsetAndType[t],this.tokenType=t>>Rr,this.tokenEnd=t&on):(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>>Rr,this.tokenEnd=e&on):(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]&on: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&on,s=o>>Rr;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:RE[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function Jl(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=Zl(e,c),Xl(n(c),n(c+1),n(c+2))){u=12,c=Yl(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=Yl(e,c),Os(e,d,c,"url")&&n(c)===40){if(c=Kl(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(Gf(f)){case d:c++;return;case 130:if(Gl(f)){c+=Xf(e,c,f),u=6;return}break;case 92:if(c===e.length-1)break;const h=n(c+1);Gl(h)?c+=Xf(e,c+1,h):Bn(f,h)&&(c=ni(e,c)-1)}}}function s(){for(u=7,c=Kl(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(Gf(d)){case 41:c++;return;case 130:if(c=Kl(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=Yf(e,c),u=8;return;case 34:case 39:case 40:case 133:c=Yf(e,c),u=8;return;case 92:if(Bn(d,n(c+1))){c=ni(e,c)-1;break}c=Yf(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=xE(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(Gf(d)){case 130:u=13,c=Kl(e,c+1);break;case 34:i();break;case 35:NE(n(c+1))||Bn(n(c+1),n(c+2))?(u=4,c=Yl(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:jf(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:jf(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):Xl(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:jf(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:Xl(n(c+1),n(c+2),n(c+3))?(u=3,c=Yl(e,c+1)):(u=9,c++);break;case 91:u=19,c++;break;case 92:Bn(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 ri=null,je=class Rn{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return Rn.createItem(t)}allocateCursor(t,n){let r;return ri!==null?(r=ri,ri=ri.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=ri,ri=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=Rn.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 Rn;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 Rn;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 Rn;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(Rn.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(Rn.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(Rn.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(Rn.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(Rn.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 ec(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 DE=100,C5=60,T5=" ";function BE({source:e,line:t,column:n},r){function o(u,d){return i.slice(u,d).map((f,h)=>String(u+h+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>DE&&(c=n-C5+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,T5),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+DE-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
|
|
35
|
-
`)}function HE(e,t,n,r,o){return Object.assign(ec("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return BE({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
|
|
36
|
-
`+BE({source:t,line:r,column:o},2)}})}function A5(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 FE=()=>{},k5=33,L5=35,Zf=59,$E=123,WE=0;function N5(e){return function(){return this[e]()}}function Qf(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 x5(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:Qf(e.atrule),pseudo:Qf(e.pseudo),node:Qf(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]=N5(e.parseContext[n])}return{config:t,...t,...t.node}}function O5(e){let t="",n="<unknown>",r=!1,o=FE,i=!1;const s=new S5,a=Object.assign(new _5,x5(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:A5,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===$E?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===$E||c===Zf?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===k5||c===Zf?1:0},consumeUntilSemicolonIncluded(c){return c===Zf?2:0},createList(){return new je},createSingleNodeList(c){return new je().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 h=u.call(this,d);return i=!0,o(f,h),i=!1,h}},lookupNonWSType(c){let u;do if(u=this.lookupType(c++),u!==13)return u;while(u!==WE);return WE},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 ti(t,c,u)},cmpStr(c,u,d){return Os(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,Zl(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=RE[c].slice(0,-6).replace(/-/g," ").replace(/^./,h=>h.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(L5)&&(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(y5(t,t.length-1)):s.getLocation(this.tokenStart);throw new HE(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,Jl),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:FE,i=!1,a.parseAtrulePrelude="parseAtrulePrelude"in u?!!u.parseAtrulePrelude:!0,a.parseRulePrelude="parseRulePrelude"in u?!!u.parseRulePrelude:!0,a.parseValue="parseValue"in u?!!u.parseValue:!0,a.parseCustomProperty="parseCustomProperty"in u?!!u.parseCustomProperty:!1;const{context:d="default",onComment:f}=u;if(!(d in a.context))throw new Error("Unknown context `"+d+"`");typeof f=="function"&&a.forEachToken((m,p,v)=>{if(m===25){const C=a.getLocation(p,v),k=Os(t,v-2,v,"*/")?t.slice(p+2,v-2):t.slice(p+2,v);f(k,C)}});const h=a.context[d].call(a,u);return a.eof||a.error(),h},{SyntaxError:HE,config:a.config})}var R5=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}})),M5=Sr((e=>{var t=R5(),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,h=0,m=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,h=h+(v<<m),m+=n}while(p);d.value=a(h),d.rest=u}})),Jf=Sr((e=>{function t(b,S,_){if(S in b)return b[S];if(arguments.length===3)return _;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(_){for(var T=0;T<S.length;T++)if(S[T].input===_){var x=S[0];return S[0]=S[T],S[T]=x,S[0].result}var N=b(_);return S.unshift({input:_,result:N}),S.length>s&&S.pop(),N}}var l=a(function(S){var _=S,T=o(S);if(T){if(!T.path)return S;_=T.path}for(var x=e.isAbsolute(_),N=[],I=0,O=0;;)if(I=O,O=_.indexOf("/",I),O===-1){N.push(_.slice(I));break}else for(N.push(_.slice(I,O));O<_.length&&_[O]==="/";)O++;for(var M,V=0,O=N.length-1;O>=0;O--)M=N[O],M==="."?N.splice(O,1):M===".."?V++:V>0&&(M===""?(N.splice(O+1,V),V=0):(N.splice(O,2),V--));return _=N.join("/"),_===""&&(_=x?"/":"."),T?(T.path=_,i(T)):_});e.normalize=l;function c(b,S){b===""&&(b="."),S===""&&(S=".");var _=o(S),T=o(b);if(T&&(b=T.path||"/"),_&&!_.scheme)return T&&(_.scheme=T.scheme),i(_);if(_||S.match(r))return S;if(T&&!T.host&&!T.path)return T.host=S,i(T);var x=S.charAt(0)==="/"?S:l(b.replace(/\/+$/,"")+"/"+S);return T?(T.path=x,i(T)):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 _=0;S.indexOf(b+"/")!==0;){var T=b.lastIndexOf("/");if(T<0||(b=b.slice(0,T),b.match(/^([^\/]+:\/)?\/*$/)))return S;++_}return Array(_+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 h(b){return p(b)?"$"+b:b}e.toSetString=d?f:h;function m(b){return p(b)?b.slice(1):b}e.fromSetString=d?f:m;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 _=S-10;_>=0;_--)if(b.charCodeAt(_)!==36)return!1;return!0}function v(b,S,_){var T=E(b.source,S.source);return T!==0||(T=b.originalLine-S.originalLine,T!==0)||(T=b.originalColumn-S.originalColumn,T!==0||_)||(T=b.generatedColumn-S.generatedColumn,T!==0)||(T=b.generatedLine-S.generatedLine,T!==0)?T:E(b.name,S.name)}e.compareByOriginalPositions=v;function C(b,S,_){var T=b.originalLine-S.originalLine;return T!==0||(T=b.originalColumn-S.originalColumn,T!==0||_)||(T=b.generatedColumn-S.generatedColumn,T!==0)||(T=b.generatedLine-S.generatedLine,T!==0)?T:E(b.name,S.name)}e.compareByOriginalPositionsNoSource=C;function k(b,S,_){var T=b.generatedLine-S.generatedLine;return T!==0||(T=b.generatedColumn-S.generatedColumn,T!==0||_)||(T=E(b.source,S.source),T!==0)||(T=b.originalLine-S.originalLine,T!==0)||(T=b.originalColumn-S.originalColumn,T!==0)?T:E(b.name,S.name)}e.compareByGeneratedPositionsDeflated=k;function L(b,S,_){var T=b.generatedColumn-S.generatedColumn;return T!==0||_||(T=E(b.source,S.source),T!==0)||(T=b.originalLine-S.originalLine,T!==0)||(T=b.originalColumn-S.originalColumn,T!==0)?T:E(b.name,S.name)}e.compareByGeneratedPositionsDeflatedNoLine=L;function E(b,S){return b===S?0:b===null?1:S===null?-1:b>S?1:-1}function g(b,S){var _=b.generatedLine-S.generatedLine;return _!==0||(_=b.generatedColumn-S.generatedColumn,_!==0)||(_=E(b.source,S.source),_!==0)||(_=b.originalLine-S.originalLine,_!==0)||(_=b.originalColumn-S.originalColumn,_!==0)?_:E(b.name,S.name)}e.compareByGeneratedPositionsInflated=g;function y(b){return JSON.parse(b.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=y;function w(b,S,_){if(S=S||"",b&&(b[b.length-1]!=="/"&&S[0]!=="/"&&(b+="/"),S=b+S),_){var T=o(_);if(!T)throw new Error("sourceMapURL could not be parsed");if(T.path){var x=T.path.lastIndexOf("/");x>=0&&(T.path=T.path.substring(0,x+1))}S=c(i(T),S)}return l(S)}e.computeSourceURL=w})),P5=Sr((e=>{var t=Jf(),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})),I5=Sr((e=>{var t=Jf();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})),D5=Sr((e=>{var t=M5(),n=Jf(),r=P5().ArraySet,o=I5().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 h=a.sourceContentFor(d);h!=null&&u.setSourceContent(d,h)}),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,h=new r;this._mappings.unsortedForEach(function(m){if(m.source===u&&m.originalLine!=null){var p=a.originalPositionFor({line:m.originalLine,column:m.originalColumn});p.source!=null&&(m.source=p.source,c!=null&&(m.source=n.join(c,m.source)),d!=null&&(m.source=n.relative(d,m.source)),m.originalLine=p.line,m.originalColumn=p.column,p.name!=null&&(m.name=p.name))}var v=m.source;v!=null&&!f.has(v)&&f.add(v);var C=m.name;C!=null&&!h.has(C)&&h.add(C)},this),this._sources=f,this._names=h,a.sources.forEach(function(m){var p=a.sourceContentFor(m);p!=null&&(c!=null&&(m=n.join(c,m)),d!=null&&(m=n.relative(d,m)),this.setSourceContent(m,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,h="",m,p,v,C,k=this._mappings.toArray(),L=0,E=k.length;L<E;L++){if(p=k[L],m="",p.generatedLine!==l)for(a=0;p.generatedLine!==l;)m+=";",l++;else if(L>0){if(!n.compareByGeneratedPositionsInflated(p,k[L-1]))continue;m+=","}m+=t.encode(p.generatedColumn-a),a=p.generatedColumn,p.source!=null&&(C=this._sources.indexOf(p.source),m+=t.encode(C-f),f=C,m+=t.encode(p.originalLine-1-u),u=p.originalLine-1,m+=t.encode(p.originalColumn-c),c=p.originalColumn,p.name!=null&&(v=this._names.indexOf(p.name),m+=t.encode(v-d),d=v)),h+=m}return h},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})),B5=D5(),qE=new Set(["Atrule","Selector","Declaration"]);function H5(e){const t=new B5.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&&qE.has(f.type)){const h=f.loc.start.line,m=f.loc.start.column-1;(r.line!==h||r.column!==m)&&(r.line=h,r.column=m,n.line=s,n.column=a,l&&(l=!1,(n.line!==o.line||n.column!==o.column)&&t.addMapping(i)),l=!0,t.addMapping({source:f.loc.source,original:r,generated:n}))}c.call(this,f),l&&qE.has(f.type)&&(o.line=s,o.column=a)};const u=e.emit;e.emit=function(f,h,m){for(let p=0;p<f.length;p++)f.charCodeAt(p)===10?(s++,a=0):a++;u(f,h,m)};const d=e.result;return e.result=function(){return l&&t.addMapping(i),{css:d(),map:t}},e}var zE=ie({safe:()=>VE,spec:()=>q5}),F5=43,$5=45,em=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},UE=[[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],["/","*"]],W5=UE.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 jE(e){const t=new Set(e.map(([n,r])=>em(n)<<16|em(r)));return function(n,r,o){const i=em(r,o),s=o.charCodeAt(0);return(s===$5&&r!==1&&r!==2&&r!==15||s===F5?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var q5=jE(UE),VE=jE(W5),z5=92;function U5(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 j5(e){Jl(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function V5(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:VE,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===z5&&this.emit(`
|
|
37
|
-
`,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=H5(s)),r.mode in zE&&(s.tokenBefore=zE[r.mode]));const a={node:l=>s.node(l),children:U5,token:(l,c)=>s.token(l,c),tokenize:j5};return s.node(n),s.result()}}function G5(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof je)&&(n.children=new je().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof je&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:tm}=Object.prototype,Rs=function(){};function GE(e){return typeof e=="function"?e:Rs}function XE(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function X5(e,t){const n=t.structure,r=[];for(const o in n){if(tm.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 K5(e){const t={};for(const n in e.node)if(tm.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]=X5(n,r)}return t}function KE(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 YE({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 Y5(e){const t=K5(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)tm.call(t,c)&&t[c]!==null&&(n[c]=KE(t[c],!1),r[c]=KE(t[c],!0));const s=YE(n),a=YE(r),l=function(c,u){function d(C,k,L){const E=f.call(v,C,k,L);return E===o?!0:E===i?!1:!!(m.hasOwnProperty(C.type)&&m[C.type](C,v,d,p)||h.call(v,C,k,L)===o)}let f=Rs,h=Rs,m=n,p=(C,k,L,E)=>C||d(k,L,E);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=GE(u.enter),h=GE(u.leave),u.reverse&&(m=r),u.visit)){if(s.hasOwnProperty(u.visit))m=u.reverse?a[u.visit]:s[u.visit];else if(!t.hasOwnProperty(u.visit))throw new Error("Bad value `"+u.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");f=XE(f,u.visit),h=XE(h,u.visit)}if(f===Rs&&h===Rs)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,h,m){if(u.call(this,f,h,m))return d=f,o}),d},l.findLast=function(c,u){let d=null;return l(c,{reverse:!0,enter(f,h,m){if(u.call(this,f,h,m))return d=f,o}}),d},l.findAll=function(c,u){const d=[];return l(c,function(f,h,m){u.call(this,f,h,m)&&d.push(f)}),d},l}function Z5(e){return e}function Q5(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 J5(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 eD(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>nm(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function nm(e,t,n,r){let o;switch(e.type){case"Group":o=eD(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return nm(e.term,t,n,r)+t(Q5(e),e);case"Type":o="<"+e.name+(e.opts?t(J5(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 rm(e,t){let n=Z5,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),nm(e,n,r,o)}var ZE={offset:0,line:1,column:1};function tD(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 h=n[f].value;f===r&&(a=h.length,s=c.length),i!==null&&n[f].node===i&&(f<=r?l++:l=0),c+=h}return r===n.length||l>1?(u=tc(i||t,"end")||Ms(ZE,c),d=Ms(u)):(u=tc(i,"start")||Ms(tc(t,"start")||ZE,c.slice(0,s)),d=tc(i,"end")||Ms(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function tc(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Ms(n):n:null}function Ms({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 Ps=function(e,t){const n=ec("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},nD=function(e,t,n,r){const o=ec("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=tD(r,n);return o.rawMessage=e,o.syntax=t?rm(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},nc=new Map,oi=new Map,rc=45,En=rD,ii=oD;function om(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===rc&&e.charCodeAt(t+1)===rc}function QE(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===rc&&e.charCodeAt(t+1)!==rc){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function rD(e){if(nc.has(e))return nc.get(e);const t=e.toLowerCase();let n=nc.get(t);if(n===void 0){const r=om(t,0),o=r?"":QE(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return nc.set(e,n),n}function oD(e){if(oi.has(e))return oi.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=om(t,n.length);if(!r&&(t=t.toLowerCase(),oi.has(t))){const a=oi.get(t);return oi.set(e,a),a}const o=r?"":QE(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 oi.set(e,s),s}var JE=["initial","inherit","unset","revert","revert-layer"],Is=43,Hn=45,im=110,si=!0,iD=!1;function sm(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Ds(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function Mr(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===Is||o===Hn){if(n)return 0;t++}for(;t<e.value.length;t++)if(!mt(e.value.charCodeAt(t)))return 0;return r+1}function am(e,t,n){let r=!1,o=Ds(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(sm(e,Is)||sm(e,Hn)){if(r=!0,o=Ds(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!==Is&&i!==Hn)return 0}return Mr(e,r?0:1,r,o)}function sD(e,t){let n=0;if(!e)return 0;if(e.type===10)return Mr(e,0,iD,n);if(e.type===1&&e.value.charCodeAt(0)===Hn){if(!ti(e.value,1,im))return 0;switch(e.value.length){case 2:return am(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Hn?0:(n=Ds(t(++n),n,t),e=t(n),Mr(e,0,si,n));default:return e.value.charCodeAt(2)!==Hn?0:Mr(e,3,si,n)}}else if(e.type===1||sm(e,Is)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!ti(e.value,0,im))return 0;switch(e.value.length){case 1:return am(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Hn?0:(n=Ds(t(++n),n,t),e=t(n),Mr(e,0,si,n));default:return e.value.charCodeAt(1)!==Hn?0:Mr(e,2,si,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===Is||r===Hn?1:0,i=o;for(;i<e.value.length&&mt(e.value.charCodeAt(i));i++);return i===o||!ti(e.value,i,im)?0:i+1===e.value.length?am(t(++n),n,t):e.value.charCodeAt(i+1)!==Hn?0:i+2===e.value.length?(n=Ds(t(++n),n,t),e=t(n),Mr(e,0,si,n)):Mr(e,i+2,si,n)}return 0}var aD=43,eS=45,tS=63,lD=117;function lm(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function cD(e,t){return e.value.charCodeAt(0)===t}function Bs(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===eS&&n&&r!==0)return Bs(e,t+r+1,!1),6;if(!Or(i)||++r>6)return 0}return r}function oc(e,t,n){if(!e)return 0;for(;lm(n(t),tS);){if(++e>6)return 0;t++}return t}function uD(e,t){let n=0;if(e===null||e.type!==1||!ti(e.value,0,lD)||(e=t(++n),e===null))return 0;if(lm(e,aD))return e=t(++n),e===null?0:e.type===1?oc(Bs(e,0,!0),++n,t):lm(e,tS)?oc(1,++n,t):0;if(e.type===10){const r=Bs(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!cD(e,eS)||!Bs(e,1,!1)?0:n+1:oc(r,n,t))}return e.type===12?oc(Bs(e,1,!0),++n,t):0}var dD=["calc(","-moz-calc(","-webkit-calc("],cm=new Map([[2,22],[21,22],[19,20],[23,24]]),fD=["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"],mD=["deg","grad","rad","turn"],hD=["s","ms"],pD=["hz","khz"],gD=["dpi","dpcm","dppx","x"],bD=["fr"],yD=["db"],vD=["st"];function Sn(e,t){return t<e.length?e.charCodeAt(t):0}function nS(e,t){return Os(e,0,e.length,t)}function rS(e,t){for(let n=0;n<t.length;n++)if(nS(e,t[n]))return!0;return!1}function oS(e,t){return t!==e.length-2?!1:Sn(e,t)===92&&mt(Sn(e,t+1))}function ic(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 ED(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=cm.get(e.type)}o++}while(e=t(o));return o}function sn(e){return function(t,n,r){return t===null?0:t.type===2&&rS(t.value,dD)?ED(t,n):e(t,n,r)}}function Me(e){return function(t){return t===null||t.type!==e?0:1}}function SD(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return rS(t,JE)||nS(t,"default")?0:1}function wD(e){return e===null||e.type!==1||Sn(e.value,0)!==45||Sn(e.value,1)!==45?0:1}function _D(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(!Or(Sn(e.value,n)))return 0;return 1}function CD(e){return e===null||e.type!==4||!Xl(Sn(e.value,1),Sn(e.value,2),Sn(e.value,3))?0:1}function TD(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=cm.get(e.type)}o++}while(e=t(o));return o}function AD(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=cm.get(e.type)}o++}while(e=t(o));return o}function ur(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=Zl(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!oS(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return ic(r,t.value,o)?0:1}}function kD(e,t,n){return e===null||e.type!==11||ic(n,e.value,e.value.length-1)?0:1}function iS(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 LD(e,t,n){if(e===null)return 0;const r=Zl(e.value,0);return r!==e.value.length&&!oS(e.value,r)||ic(n,e.value,r)?0:1}function ND(e,t,n){if(e===null||e.type!==10)return 0;let r=Sn(e.value,0)===43||Sn(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!mt(Sn(e.value,r)))return 0;return ic(n,e.value,r)?0:1}var sS={"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":SD,"custom-property-name":wD,"hex-color":_D,"id-selector":CD,"an-plus-b":sD,urange:uD,"declaration-value":TD,"any-value":AD,dimension:sn(ur(null)),angle:sn(ur(mD)),decibel:sn(ur(yD)),frequency:sn(ur(pD)),flex:sn(ur(bD)),length:sn(iS(ur(fD))),resolution:sn(ur(gD)),semitones:sn(ur(vD)),time:sn(ur(hD)),percentage:sn(kD),zero:iS(),number:sn(LD),integer:sn(ND)};function xD(e,t,n){return Object.assign(ec("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
|
|
41
|
-
`+t+`
|
|
42
|
-
--`+new Array((n||t.length)+1).join("-")+"^"})}var OD=9,RD=10,MD=12,PD=13,ID=32,DD=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!==PD&&t!==RD&&t!==MD&&t!==ID&&t!==OD)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 xD(e,this.str,this.pos)}},BD=9,HD=10,FD=12,$D=13,WD=32,aS=33,um=35,lS=38,sc=39,cS=40,qD=41,uS=42,dm=43,fm=44,dS=45,mm=60,fS=62,hm=63,zD=64,ac=91,pm=93,lc=123,mS=124,hS=125,pS=8734,Hs=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),gS={" ":1,"&&":2,"||":3,"|":4};function cc(e){return e.substringToPos(e.findWsEnd(e.pos))}function ai(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||Hs[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function uc(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 UD(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 bS(e){let t=null,n=null;return e.eat(lc),t=uc(e),e.charCode()===fm?(e.pos++,e.charCode()!==hS&&(n=uc(e))):n=t,e.eat(hS),{min:Number(t),max:n?Number(n):0}}function jD(e){let t=null,n=!1;switch(e.charCode()){case uS:e.pos++,t={min:0,max:0};break;case dm:e.pos++,t={min:1,max:0};break;case hm:e.pos++,t={min:0,max:1};break;case um:e.pos++,n=!0,e.charCode()===lc?t=bS(e):e.charCode()===hm?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case lc:t=bS(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function li(e,t){const n=jD(e);return n!==null?(n.term=t,e.charCode()===um&&e.charCodeAt(e.pos-1)===dm?li(e,n):n):t}function gm(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function VD(e){let t;return e.eat(mm),e.eat(sc),t=ai(e),e.eat(sc),e.eat(fS),li(e,{type:"Property",name:t})}function GD(e){let t=null,n=null,r=1;return e.eat(ac),e.charCode()===dS&&(e.peek(),r=-1),r==-1&&e.charCode()===pS?e.peek():(t=r*Number(uc(e)),Hs[e.charCode()]!==0&&(t+=ai(e))),cc(e),e.eat(fm),cc(e),e.charCode()===pS?e.peek():(r=1,e.charCode()===dS&&(e.peek(),r=-1),n=r*Number(uc(e)),Hs[e.charCode()]!==0&&(n+=ai(e))),e.eat(pm),{type:"Range",min:t,max:n}}function XD(e){let t,n=null;return e.eat(mm),t=ai(e),e.charCode()===cS&&e.nextCharCode()===qD&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===ac&&(cc(e),n=GD(e)),e.eat(fS),li(e,{type:"Type",name:t,opts:n})}function KD(e){const t=ai(e);return e.charCode()===cS?(e.pos++,{type:"Function",name:t}):li(e,{type:"Keyword",name:t})}function YD(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)=>gS[o]-gS[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 yS(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=QD(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:YD(t,n)||" ",disallowEmpty:!1,explicit:!1}}function ZD(e){let t;return e.eat(ac),t=yS(e),e.eat(pm),t.explicit=!0,e.charCode()===aS&&(e.pos++,t.disallowEmpty=!0),t}function QD(e){let t=e.charCode();if(t<128&&Hs[t]===1)return KD(e);switch(t){case pm:break;case ac:return li(e,ZD(e));case mm:return e.nextCharCode()===sc?VD(e):XD(e);case mS:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===mS?2:1))};case lS:return e.pos++,e.eat(lS),{type:"Combinator",value:"&&"};case fm:return e.pos++,{type:"Comma"};case sc:return li(e,{type:"String",value:UD(e)});case WD:case BD:case HD:case $D:case FD:return{type:"Spaces",value:cc(e)};case zD:return t=e.nextCharCode(),t<128&&Hs[t]===1?(e.pos++,{type:"AtKeyword",name:ai(e)}):gm(e);case uS:case dm:case hm:case um:case aS:break;case lc:if(t=e.nextCharCode(),t<48||t>57)return gm(e);break;default:return gm(e)}}function vS(e){const t=new DD(e),n=yS(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var Fs=function(){};function ES(e){return typeof e=="function"?e:Fs}function JD(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=Fs,i=Fs;if(typeof t=="function"?o=t:t&&(o=ES(t.enter),i=ES(t.leave)),o===Fs&&i===Fs)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var e3={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 t3(e){const t=[];return Jl(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function n3(e,t){return typeof e=="string"?t3(e):t.generate(e,e3)}var we={type:"Match"},Ae={type:"Mismatch"},bm={type:"DisallowEmpty"},r3=40,o3=41;function vt(e,t,n){return t===we&&n===Ae||e===we&&t===we&&n===we?e:(e.type==="If"&&e.else===Ae&&t===we&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function SS(e){return e.length>2&&e.charCodeAt(e.length-2)===r3&&e.charCodeAt(e.length-1)===o3}function wS(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&SS(e.name)}function ym(e,t,n){switch(e){case" ":{let r=we;for(let o=t.length-1;o>=0;o--){const i=t[o];r=vt(i,r,Ae)}return r}case"|":{let r=Ae,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(wS(s)&&(o===null&&i>0&&wS(t[i-1])&&(o=Object.create(null),r=vt({type:"Enum",map:o},we,r)),o!==null)){const a=(SS(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=vt(s,we,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=Ae;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=ym(e,t.filter(function(a){return a!==i}),!1):s=we,r=vt(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?we:Ae;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=ym(e,t.filter(function(a){return a!==i}),!0):s=we,r=vt(i,s,r)}return r}}}function i3(e){let t=we,n=vm(e.term);if(e.max===0)n=vt(n,bm,Ae),t=vt(n,null,Ae),t.then=vt(we,we,t),e.comma&&(t.then.else=vt({type:"Comma",syntax:e},t,Ae));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==we&&(t=vt({type:"Comma",syntax:e},t,Ae)),t=vt(n,vt(we,we,t),Ae);if(e.min===0)t=vt(we,we,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==we&&(t=vt({type:"Comma",syntax:e},t,Ae)),t=vt(n,t,Ae);return t}function vm(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=ym(e.combinator,e.terms.map(vm),!1);return e.disallowEmpty&&(t=vt(t,bm,Ae)),t}case"Multiplier":return i3(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 Em(e,t){return typeof e=="string"&&(e=vS(e)),{type:"MatchGraph",match:vm(e),syntax:t||null,source:e}}var{hasOwnProperty:_S}=Object.prototype,s3=0,a3=1,Sm=2,CS=3,TS="Match",l3="Mismatch",c3="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",u3=15e3,d3=0;function f3(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function wm(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 m3(e){return e.type!==9?!1:e.value!=="?"}function AS(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||m3(e)}function kS(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function h3(e,t,n){function r(){do k++,C=k<e.length?e[k]:null;while(C!==null&&(C.type===13||C.type===25))}function o(g){const y=k+g;return y<e.length?e[y]:null}function i(g,y){return{nextState:g,matchStack:E,syntaxStack:d,thenStack:f,tokenIndex:k,prev:y}}function s(g){f={nextState:g,matchStack:E,syntaxStack:d,prev:f}}function a(g){h=i(g,h)}function l(){E={type:a3,syntax:t.syntax,token:C,prev:E},r(),m=null,k>L&&(L=k)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},E={type:Sm,syntax:t.syntax,token:E.token,prev:E}}function u(){E.type===Sm?E=E.prev:E={type:CS,syntax:d.syntax,token:E.token,prev:E},d=d.prev}let d=null,f=null,h=null,m=null,p=0,v=null,C=null,k=-1,L=0,E={type:s3,syntax:null,token:null,prev:null};for(r();v===null&&++p<u3;)switch(t.type){case"Match":if(f===null){if(C!==null&&(k!==e.length-1||C.value!=="\\0"&&C.value!=="\\9")){t=Ae;break}v=TS;break}if(t=f.nextState,t===bm)if(f.matchStack===E){t=Ae;break}else t=we;for(;f.syntaxStack!==d;)u();f=f.prev;break;case"Mismatch":if(m!==null&&m!==!1)(h===null||k>h.tokenIndex)&&(h=m,m=!1);else if(h===null){v=l3;break}t=h.nextState,f=h.thenStack,d=h.syntaxStack,E=h.matchStack,k=h.tokenIndex,C=k<e.length?e[k]:null,h=h.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Ae&&a(t.else),t.then!==we&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const w=t.syntax.terms;if(t.index===w.length){if(t.mask===0||t.syntax.all){t=Ae;break}t=we;break}if(t.mask===(1<<w.length)-1){t=we;break}for(;t.index<w.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=w[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(C!==null){let w=C.value.toLowerCase();if(w.indexOf("\\")!==-1&&(w=w.replace(/\\[09].*$/,"")),_S.call(t.map,w)){t=t.map[w];break}}t=Ae;break;case"Generic":{const w=d!==null?d.opts:null,b=k+Math.floor(t.fn(C,o,w));if(!isNaN(b)&&b>k){for(;k<b;)l();t=we}else t=Ae;break}case"Type":case"Property":{const w=t.type==="Type"?"types":"properties",b=_S.call(n,w)?n[w][t.name]:null;if(!b||!b.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(m!==!1&&C!==null&&t.type==="Type"&&(t.name==="custom-ident"&&C.type===1||t.name==="length"&&C.value==="0")){m===null&&(m=i(t,h)),t=Ae;break}c(),t=b.match;break}case"Keyword":{const w=t.name;if(C!==null){let b=C.value;if(b.indexOf("\\")!==-1&&(b=b.replace(/\\[09].*$/,"")),wm(b,w)){l(),t=we;break}}t=Ae;break}case"AtKeyword":case"Function":if(C!==null&&wm(C.value,t.name)){l(),t=we;break}t=Ae;break;case"Token":if(C!==null&&C.value===t.value){l(),t=we;break}t=Ae;break;case"Comma":C!==null&&C.type===18?AS(E.token)?t=Ae:(l(),t=kS(C)?Ae:we):t=AS(E.token)||kS(C)?we:Ae;break;case"String":let g="",y=k;for(;y<e.length&&g.length<t.value.length;y++)g+=e[y].value;if(wm(g,t.value)){for(;k<y;)l();t=we}else t=Ae;break;default:throw new Error("Unknown node type: "+t.type)}switch(d3+=p,v){case null:v=c3,E=null;break;case TS:for(;d!==null;)u();break;default:E=null}return{tokens:e,reason:v,iterations:p,match:E,longestMatch:L}}function LS(e,t,n){const r=h3(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=f3(o).prev;o!==null;){switch(o.type){case Sm:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case CS: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 p3=ie({getTrace:()=>NS,isKeyword:()=>y3,isProperty:()=>b3,isType:()=>g3});function NS(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 g3(e,t){return _m(this,e,n=>n.type==="Type"&&n.name===t)}function b3(e,t){return _m(this,e,n=>n.type==="Property"&&n.name===t)}function y3(e){return _m(this,e,t=>t.type==="Keyword")}function _m(e,t,n){const r=NS.call(e,t);return r===null?!1:r.some(n)}function xS(e){return"node"in e?e.node:xS(e.match[0])}function OS(e){return"node"in e?e.node:OS(e.match[e.match.length-1])}function RS(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=xS(a),c=OS(a);e.syntax.walk(t,function(u,d,f){if(u===l){const h=new je;do{if(h.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:f,nodes:h})}})}Array.isArray(a.match)&&a.match.forEach(i)}const s=[];return n.matched!==null&&i(n.matched),s}var{hasOwnProperty:$s}=Object.prototype;function Cm(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function MS(e){return!!e&&Cm(e.offset)&&Cm(e.line)&&Cm(e.column)}function v3(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($s.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(!MS(r.loc.start))i+=".start";else if(!MS(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 je)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)$s.call(t,i)&&$s.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function E3(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if($s.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:v3(e,r)}}function S3(e){const t={};if(e.node){for(const n in e.node)if($s.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=E3(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var w3=Em(JE.join(" | "));function Tm(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:rm(e[o].syntax,{compact:t}));return r}function _3(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:rm(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&Tm(i.descriptors,t,n)};return r}function C3(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function wn(e,t,n){return{matched:e,iterations:n,error:t,...p3}}function ci(e,t,n,r){const o=n3(n,e.syntax);let i;return C3(o)?wn(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=LS(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=LS(o,t.match,e),!i.match)?wn(null,new nD(i.reason,t.syntax,n,i),i.iterations):wn(i.match,null,i.iterations))}var PS=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=w3,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||S3(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 sS)this.addType_(r,sS[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=Em(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:vS(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Em(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 Ps("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&&!ci(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=En(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 Ps("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new Ps("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return wn(null,n);const r=this.getAtrule(e);return r.prelude?ci(this,r.prelude,t||"",!1):wn(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return wn(null,r);const o=this.getAtrule(e),i=En(t);return ci(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?wn(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(ii(e).custom)return wn(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?wn(null,n):ci(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?ci(this,n,t,!1):wn(null,new Ps("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?wn(null,new Ps("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),ci(this,e,t,!1))}findValueFragments(e,t,n,r){return RS(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return RS(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=En(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=ii(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&&JD(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:Tm(this.types,!t,e),properties:Tm(this.properties,!t,e),atrules:_3(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:ui}=Object.prototype,T3={generic:!0,types:Am,atrules:{prelude:HS,descriptors:HS},properties:Am,parseContext:A3,scope:DS,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function dc(e){return e&&e.constructor===Object}function IS(e){return dc(e)?{...e}:e}function A3(e,t){return Object.assign(e,t)}function DS(e,t){for(const n in t)ui.call(t,n)&&(dc(e[n])?DS(e[n],t[n]):e[n]=IS(t[n]));return e}function BS(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function Am(e,t){if(typeof t=="string")return BS(e,t);const n={...e};for(let r in t)ui.call(t,r)&&(n[r]=BS(ui.call(e,r)?e[r]:void 0,t[r]));return n}function HS(e,t){const n=Am(e,t);return!dc(n)||Object.keys(n).length?n:null}function Ws(e,t,n){for(const r in n)if(ui.call(n,r)!==!1){if(n[r]===!0)ui.call(t,r)&&(e[r]=IS(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(dc(n[r])){const o={};for(let i in e[r])o[i]=Ws({},e[r][i],n[r]);for(let i in t[r])o[i]=Ws(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&&Ws(o[s],a,i);for(const s in t[r])ui.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&Ws(o[s],t[r][s],i));e[r]=o}}}return e}var km=(e,t)=>Ws(e,t,T3);function FS(e){const t=O5(e),n=Y5(e),r=V5(e),{fromPlainObject:o,toPlainObject:i}=G5(n),s={lexer:null,createLexer:a=>new PS(a,s,s.lexer.structure),tokenize:Jl,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=km({},e);return FS(typeof a=="function"?a(l,Object.assign):km(l,a))}};return s.lexer=new PS({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var k3=e=>FS(km({},e)),L3={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>"}}}},N3=ie({generate:()=>M3,name:()=>O3,parse:()=>$S,structure:()=>R3}),Fn=43,Xt=45,fc=110,mo=!0,x3=!1;function mc(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===Fn||r===Xt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)mt(this.charCodeAt(n))||this.error("Integer is expected",n)}function di(e){return mc.call(this,0,e)}function Pr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case fc:n="N is expected";break;case Xt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function Lm(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(Fn,e)||this.isDelim(Xt,e)){t=this.isDelim(Fn,e)?Fn:Xt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),di.call(this,mo))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Fn&&n!==Xt&&this.error("Number sign is expected")),di.call(this,t!==0),t===Xt?"-"+this.consume(10):this.consume(10)}var O3="AnPlusB",R3={a:[String,null],b:[String,null]};function $S(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)di.call(this,x3),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Xt))switch(t="-1",Pr.call(this,1,fc),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Lm.call(this);break;case 3:Pr.call(this,2,Xt),this.next(),this.skipSC(),di.call(this,mo),n="-"+this.consume(10);break;default:Pr.call(this,2,Xt),mc.call(this,3,mo),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Fn)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(Fn)&&(r=1,this.next()),Pr.call(this,0,fc),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Lm.call(this);break;case 2:Pr.call(this,1,Xt),this.next(),this.skipSC(),di.call(this,mo),n="-"+this.consume(10);break;default:Pr.call(this,1,Xt),mc.call(this,2,mo),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===Fn||r===Xt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&mt(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Pr.call(this,i-this.tokenStart,fc),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=Lm.call(this)):(Pr.call(this,i-this.tokenStart+1,Xt),i+2===this.tokenEnd?(this.next(),this.skipSC(),di.call(this,mo),n="-"+this.consume(10)):(mc.call(this,i-this.tokenStart+2,mo),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Fn&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Fn&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function M3(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 P3=ie({generate:()=>F3,name:()=>D3,parse:()=>qS,structure:()=>H3,walkContext:()=>B3});function WS(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function I3(){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 D3="Atrule",B3="atrule",H3={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function qS(){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),WS):r=WS.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(I3.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function F3(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var $3=ie({generate:()=>U3,name:()=>W3,parse:()=>zS,structure:()=>z3,walkContext:()=>q3}),W3="AtrulePrelude",q3="atrulePrelude",z3={children:[[]]};function zS(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 U3(e){this.children(e)}var j3=ie({generate:()=>J3,name:()=>Z3,parse:()=>jS,structure:()=>Q3}),V3=36,US=42,hc=61,G3=94,Nm=124,X3=126;function K3(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(US)?(t=!0,this.next()):this.isDelim(Nm)||this.eat(1),this.isDelim(Nm)?this.charCodeAt(this.tokenStart+1)!==hc?(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 Y3(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==hc&&t!==X3&&t!==G3&&t!==V3&&t!==US&&t!==Nm&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==hc&&(this.isDelim(hc)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var Z3="AttributeSelector",Q3={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function jS(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=K3.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=Y3.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 J3(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 e4=ie({generate:()=>s4,name:()=>r4,parse:()=>XS,structure:()=>i4,walkContext:()=>o4});function VS(e){return this.Raw(e,null,!0)}function t4(){return this.parseWithFallback(this.Rule,VS)}function GS(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function n4(){if(this.tokenType===17)return GS.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,GS);return this.tokenType===17&&this.next(),e}var r4="Block",o4="block",i4={children:[["Atrule","Rule","Declaration"]]};function XS(e){const t=e?n4:t4,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,VS));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function s4(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var a4=ie({generate:()=>u4,name:()=>l4,parse:()=>KS,structure:()=>c4}),l4="Brackets",c4={children:[[]]};function KS(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 u4(e){this.token(9,"["),this.children(e),this.token(9,"]")}var d4=ie({generate:()=>m4,name:()=>"CDC",parse:()=>YS,structure:()=>f4}),Mne="CDC",f4=[];function YS(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function m4(){this.token(15,"-->")}var h4=ie({generate:()=>g4,name:()=>"CDO",parse:()=>ZS,structure:()=>p4}),Pne="CDO",p4=[];function ZS(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function g4(){this.token(14,"<!--")}var b4=ie({generate:()=>S4,name:()=>v4,parse:()=>QS,structure:()=>E4}),y4=46,v4="ClassSelector",E4={name:String};function QS(){return this.eatDelim(y4),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function S4(e){this.token(9,"."),this.token(1,e.name)}var w4=ie({generate:()=>L4,name:()=>A4,parse:()=>e1,structure:()=>k4}),_4=43,JS=47,C4=62,T4=126,A4="Combinator",k4={name:String};function e1(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case C4:case _4:case T4:this.next();break;case JS:this.next(),this.eatIdent("deep"),this.eatDelim(JS);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function L4(e){this.tokenize(e.name)}var N4=ie({generate:()=>P4,name:()=>R4,parse:()=>t1,structure:()=>M4}),x4=42,O4=47,R4="Comment",M4={value:String};function t1(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===x4&&this.charCodeAt(t-1)===O4&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function P4(e){this.token(25,"/*"+e.value+"*/")}var I4=ie({generate:()=>G4,name:()=>U4,parse:()=>o1,structure:()=>V4,walkContext:()=>j4}),n1=33,D4=35,B4=36,H4=38,F4=42,$4=43,r1=47;function W4(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function q4(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function z4(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(n1)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var U4="Declaration",j4="declaration",V4={important:[Boolean,String],property:String,value:["Value","Raw"]};function o1(){const e=this.tokenStart,t=this.tokenIndex,n=X4.call(this),r=om(n),o=r?this.parseCustomProperty:this.parseValue,i=r?q4:W4;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(z4,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(n1)&&(s=K4.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 G4(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 X4(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case F4:case B4:case $4:case D4:case H4:this.next();break;case r1:this.next(),this.isDelim(r1)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function K4(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var Y4=ie({generate:()=>e8,name:()=>Q4,parse:()=>i1,structure:()=>J4});function Z4(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var Q4="DeclarationList",J4={children:[["Declaration"]]};function i1(){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,Z4))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function e8(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var t8=ie({generate:()=>o8,name:()=>n8,parse:()=>s1,structure:()=>r8}),n8="Dimension",r8={value:String,unit:String};function s1(){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 o8(e){this.token(12,e.value+e.unit)}var i8=ie({generate:()=>c8,name:()=>s8,parse:()=>a1,structure:()=>l8,walkContext:()=>a8}),s8="Function",a8="function",l8={name:String,children:[[]]};function a1(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 c8(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var u8=ie({generate:()=>m8,name:()=>d8,parse:()=>l1,structure:()=>f8,xxx:()=>"XXX"}),Ine="XXX",d8="Hash",f8={value:String};function l1(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function m8(e){this.token(4,"#"+e.value)}var h8=ie({generate:()=>b8,name:()=>p8,parse:()=>c1,structure:()=>g8}),p8="Identifier",g8={name:String};function c1(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function b8(e){this.token(1,e.name)}var y8=ie({generate:()=>S8,name:()=>v8,parse:()=>u1,structure:()=>E8}),v8="IdSelector",E8={name:String};function u1(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function S8(e){this.token(9,"#"+e.name)}var w8=ie({generate:()=>T8,name:()=>_8,parse:()=>d1,structure:()=>C8}),_8="MediaFeature",C8={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function d1(){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 T8(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var A8=ie({generate:()=>N8,name:()=>k8,parse:()=>f1,structure:()=>L8}),k8="MediaQuery",L8={children:[["Identifier","MediaFeature","WhiteSpace"]]};function f1(){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 N8(e){this.children(e)}var x8=ie({generate:()=>M8,name:()=>O8,parse:()=>m1,structure:()=>R8}),O8="MediaQueryList",R8={children:[["MediaQuery"]]};function m1(){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 M8(e){this.children(e,()=>this.token(18,","))}var P8=ie({generate:()=>D8,name:()=>"Nth",parse:()=>h1,structure:()=>I8}),Dne="Nth",I8={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function h1(){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 D8(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var B8=ie({generate:()=>$8,name:()=>H8,parse:()=>p1,structure:()=>F8}),H8="Number",F8={value:String};function p1(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function $8(e){this.token(10,e.value)}var W8=ie({generate:()=>U8,name:()=>q8,parse:()=>g1,structure:()=>z8}),q8="Operator",z8={value:String};function g1(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function U8(e){this.tokenize(e.value)}var j8=ie({generate:()=>X8,name:()=>V8,parse:()=>b1,structure:()=>G8}),V8="Parentheses",G8={children:[[]]};function b1(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 X8(e){this.token(21,"("),this.children(e),this.token(22,")")}var K8=ie({generate:()=>Q8,name:()=>Y8,parse:()=>y1,structure:()=>Z8}),Y8="Percentage",Z8={value:String};function y1(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function Q8(e){this.token(11,e.value+"%")}var J8=ie({generate:()=>rB,name:()=>eB,parse:()=>v1,structure:()=>nB,walkContext:()=>tB}),eB="PseudoClassSelector",tB="function",nB={name:String,children:[["Raw"],null]};function v1(){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 rB(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var oB=ie({generate:()=>lB,name:()=>iB,parse:()=>E1,structure:()=>aB,walkContext:()=>sB}),iB="PseudoElementSelector",sB="function",aB={name:String,children:[["Raw"],null]};function E1(){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 lB(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 cB=ie({generate:()=>hB,name:()=>fB,parse:()=>w1,structure:()=>mB}),uB=47,dB=46;function S1(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!mt(n)&&n!==dB&&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 fB="Ratio",mB={left:String,right:String};function w1(){const e=this.tokenStart,t=S1.call(this);let n;return this.skipSC(),this.eatDelim(uB),n=S1.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function hB(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var pB=ie({generate:()=>yB,name:()=>"Raw",parse:()=>_1,structure:()=>bB});function gB(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var Bne="Raw",bB={value:String};function _1(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=gB.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function yB(e){this.tokenize(e.value)}var vB=ie({generate:()=>CB,name:()=>SB,parse:()=>T1,structure:()=>_B,walkContext:()=>wB});function C1(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function EB(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var SB="Rule",wB="rule",_B={prelude:["SelectorList","Raw"],block:["Block"]};function T1(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(EB,C1):n=C1.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function CB(e){this.node(e.prelude),this.node(e.block)}var TB=ie({generate:()=>LB,name:()=>AB,parse:()=>A1,structure:()=>kB}),AB="Selector",kB={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function A1(){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 LB(e){this.children(e)}var NB=ie({generate:()=>MB,name:()=>xB,parse:()=>k1,structure:()=>RB,walkContext:()=>OB}),xB="SelectorList",OB="selector",RB={children:[["Selector","Raw"]]};function k1(){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 MB(e){this.children(e,()=>this.token(18,","))}var xm=92,L1=34,N1=39;function x1(e){const t=e.length,n=e.charCodeAt(0),r=n===L1||n===N1?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===xm){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),Bn(xm,a)){const l=s-1,c=ni(e,l);s=c-1,i+=OE(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function Om(e,t){const n=t?"'":'"',r=t?N1:L1;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===xm?(o+="\\"+e.charAt(s),i=!1):(i&&(Or(a)||fo(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var PB=ie({generate:()=>BB,name:()=>IB,parse:()=>O1,structure:()=>DB}),IB="String",DB={value:String};function O1(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:x1(this.consume(5))}}function BB(e){this.token(5,Om(e.value))}var HB=ie({generate:()=>zB,name:()=>$B,parse:()=>M1,structure:()=>qB,walkContext:()=>WB}),FB=33;function R1(e){return this.Raw(e,null,!1)}var $B="StyleSheet",WB="stylesheet",qB={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function M1(){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)!==FB){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,R1);break;default:n=this.parseWithFallback(this.Rule,R1)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function zB(e){this.children(e)}var UB=ie({generate:()=>XB,name:()=>VB,parse:()=>I1,structure:()=>GB}),jB=42,P1=124;function Rm(){this.tokenType!==1&&this.isDelim(jB)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var VB="TypeSelector",GB={name:String};function I1(){const e=this.tokenStart;return this.isDelim(P1)?(this.next(),Rm.call(this)):(Rm.call(this),this.isDelim(P1)&&(this.next(),Rm.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function XB(e){this.tokenize(e.name)}var KB=ie({generate:()=>e9,name:()=>QB,parse:()=>H1,structure:()=>JB}),D1=43,B1=45,Mm=63;function qs(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===B1&&t&&n!==0)return qs.call(this,e+n+1,!1),-1;Or(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 pc(e){let t=0;for(;this.isDelim(Mm);)++t>e&&this.error("Too many question marks"),this.next()}function YB(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===D1?"Plus sign":"Hyphen minus")+" is expected")}function ZB(){let e=0;switch(this.tokenType){case 10:if(e=qs.call(this,1,!0),this.isDelim(Mm)){pc.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){YB.call(this,B1),qs.call(this,1,!1);break}break;case 12:e=qs.call(this,1,!0),e>0&&pc.call(this,6-e);break;default:if(this.eatDelim(D1),this.tokenType===1){e=qs.call(this,0,!0),e>0&&pc.call(this,6-e);break}if(this.isDelim(Mm)){this.next(),pc.call(this,5);break}this.error("Hex digit or question mark is expected")}}var QB="UnicodeRange",JB={value:String};function H1(){const e=this.tokenStart;return this.eatIdent("u"),ZB.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function e9(e){this.tokenize(e.value)}var t9=32,Pm=92,n9=34,r9=39,o9=40,F1=41;function i9(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===F1?t-2:t-1,o="";for(;n<r&&fo(e.charCodeAt(n));)n++;for(;n<r&&fo(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===Pm){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),Bn(Pm,s)){const a=i-1,l=ni(e,a);i=l-1,o+=OE(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function $1(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===t9||o===Pm||o===n9||o===r9||o===o9||o===F1?(t+="\\"+e.charAt(r),n=!1):(n&&Or(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var s9=ie({generate:()=>l9,name:()=>"Url",parse:()=>W1,structure:()=>a9}),Hne="Url",a9={value:String};function W1(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=i9(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=x1(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 l9(e){this.token(7,$1(e.value))}var c9=ie({generate:()=>f9,name:()=>u9,parse:()=>q1,structure:()=>d9}),u9="Value",d9={children:[[]]};function q1(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function f9(e){this.children(e)}var m9=ie({generate:()=>b9,name:()=>p9,parse:()=>z1,structure:()=>g9}),h9=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),p9="WhiteSpace",g9={value:String};function z1(){return this.eat(13),h9}function b9(e){this.token(13,e.value)}var U1=ie({AnPlusB:()=>N3,Atrule:()=>P3,AtrulePrelude:()=>$3,AttributeSelector:()=>j3,Block:()=>e4,Brackets:()=>a4,CDC:()=>d4,CDO:()=>h4,ClassSelector:()=>b4,Combinator:()=>w4,Comment:()=>N4,Declaration:()=>I4,DeclarationList:()=>Y4,Dimension:()=>t8,Function:()=>i8,Hash:()=>u8,IdSelector:()=>y8,Identifier:()=>h8,MediaFeature:()=>w8,MediaQuery:()=>A8,MediaQueryList:()=>x8,Nth:()=>P8,Number:()=>B8,Operator:()=>W8,Parentheses:()=>j8,Percentage:()=>K8,PseudoClassSelector:()=>J8,PseudoElementSelector:()=>oB,Ratio:()=>cB,Raw:()=>pB,Rule:()=>vB,Selector:()=>TB,SelectorList:()=>NB,String:()=>PB,StyleSheet:()=>HB,TypeSelector:()=>UB,UnicodeRange:()=>KB,Url:()=>s9,Value:()=>c9,WhiteSpace:()=>m9}),y9={generic:!0,...L3,node:U1},v9=35,E9=42,j1=43,S9=45,w9=47,_9=117;function V1(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,_9)&&this.cmpChar(this.tokenStart+1,j1)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===w9||t===E9||t===j1||t===S9)return this.Operator();t===v9&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var C9={getNode:V1},T9=35,A9=42,k9=43,L9=47,G1=46,N9=62,x9=124,O9=126;function R9(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function M9(){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)===G1&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case k9:case N9:case O9:case L9:return this.Combinator();case G1:return this.ClassSelector();case A9:case x9:return this.TypeSelector();case T9:return this.IdSelector()}}}var P9={onWhiteSpace:R9,getNode:M9};function I9(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function D9(){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 X1(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var B9={getNode:V1,onWhiteSpace(e,t){X1(e)&&(e.value=" "+e.value),X1(t.last)&&(t.last.value+=" ")},expression:I9,var:D9},H9=ie({AtrulePrelude:()=>C9,Selector:()=>P9,Value:()=>B9}),F9={parse:{prelude:null,block(){return this.Block(!0)}}},$9={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}},W9={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},q9={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function z9(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function U9(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):K1.call(this)}function K1(){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(z9,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(U9,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var j9={parse:{prelude(){const e=K1.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},V9={"font-face":F9,import:$9,media:W9,page:q9,supports:j9},ho={parse(){return this.createSingleNodeList(this.SelectorList())}},G9={parse(){return this.createSingleNodeList(this.Selector())}},Y1={parse(){return this.createSingleNodeList(this.Identifier())}},gc={parse(){return this.createSingleNodeList(this.Nth())}},X9={dir:Y1,has:ho,lang:Y1,matches:ho,is:ho,"-moz-any":ho,"-webkit-any":ho,where:ho,not:ho,"nth-child":gc,"nth-last-child":gc,"nth-last-of-type":gc,"nth-of-type":gc,slotted:G9},K9=ie({AnPlusB:()=>$S,Atrule:()=>qS,AtrulePrelude:()=>zS,AttributeSelector:()=>jS,Block:()=>XS,Brackets:()=>KS,CDC:()=>YS,CDO:()=>ZS,ClassSelector:()=>QS,Combinator:()=>e1,Comment:()=>t1,Declaration:()=>o1,DeclarationList:()=>i1,Dimension:()=>s1,Function:()=>a1,Hash:()=>l1,IdSelector:()=>u1,Identifier:()=>c1,MediaFeature:()=>d1,MediaQuery:()=>f1,MediaQueryList:()=>m1,Nth:()=>h1,Number:()=>p1,Operator:()=>g1,Parentheses:()=>b1,Percentage:()=>y1,PseudoClassSelector:()=>v1,PseudoElementSelector:()=>E1,Ratio:()=>w1,Raw:()=>_1,Rule:()=>T1,Selector:()=>A1,SelectorList:()=>k1,String:()=>O1,StyleSheet:()=>M1,TypeSelector:()=>I1,UnicodeRange:()=>H1,Url:()=>W1,Value:()=>q1,WhiteSpace:()=>z1}),Y9={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:H9,atrule:V9,pseudo:X9,node:K9},Z9={node:U1},Q9=k3({...y9,...Y9,...Z9});function Im(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof je?r=r.map(Im):r.constructor===Object&&(r=Im(r))),t[n]=r}return t}var{tokenize:Fne,parse:J9,generate:$n,lexer:Z1,createLexer:$ne,walk:Bt,find:Wne,findLast:qne,findAll:zne,toPlainObject:Une,fromPlainObject:jne,fork:e6}=Q9,{hasOwnProperty:t6}=Object.prototype;function Dm(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 Q1(e){if(!e)return null;const t=Dm(e.tags,!0),n=Dm(e.ids),r=Dm(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function n6(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(t6.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:Q1(e),blacklist:Q1(e.blacklist),scopes:t}}function po(e){return!e||!e.children||e.children.isEmpty}function J1(e,t){return e!==null&&e.children===t}function r6(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),po(e.block))){n.remove(t);return}switch(e.name){case"charset":if(po(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=En(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(po(e.prelude)||po(e.block))&&n.remove(t)}}}function o6(e,t,n){n.remove(t)}function i6(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}ii(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function s6(e,t,n){(J1(this.stylesheet,n)||J1(this.block,n))&&n.remove(t)}var{hasOwnProperty:fi}=Object.prototype,a6=new Set(["keyframes"]);function ew(e,t){return e.children.forEach((n,r,o)=>{let i=!1;Bt(n,function(s){if(this.selector===null||this.selector===e)switch(s.type){case"SelectorList":(this.function===null||this.function.name.toLowerCase()!=="not")&&ew(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!fi.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&fi.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!fi.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&fi.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&&!fi.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&fi.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function l6(e,t,n,r){if(po(e.prelude)||po(e.block)){n.remove(t);return}if(this.atrule&&a6.has(En(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(ew(e.prelude,o),po(e.prelude))){n.remove(t);return}}function c6(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 u6(e,t,n){n.remove(t)}var tw={Atrule:r6,Comment:o6,Declaration:i6,Raw:s6,Rule:l6,TypeSelector:c6,WhiteSpace:u6};function d6(e,t){Bt(e,{leave(n,r,o){tw.hasOwnProperty(n.type)&&tw[n.type].call(this,n,r,o,t)}})}function f6(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 m6(e){En(e.name).basename==="keyframes"&&f6(e)}var h6=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function p6(e){return e===""||e==="-"?!1:!h6.test(e)}function g6(e){const t=e.value;!t||t.type!=="String"||p6(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function b6(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 y6(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 v6(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 je().fromArray(n)}function nw(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 rw={font:b6,"font-weight":y6,background:v6,border:nw,outline:nw};function E6(e){if(!this.declaration)return;const t=ii(this.declaration.property);rw.hasOwnProperty(t.basename)&&rw[t.basename](e)}var S6=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,w6=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,_6=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function bc(e,t){const n=t&&t.prev!==null&&_6.has(t.prev.data.type)?w6:S6;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function C6(e){e.value=bc(e.value)}var T6=new Set(["calc","min","max","clamp"]),A6=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function k6(e,t){const n=bc(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!A6.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&T6.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var L6=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function N6(e,t){e.value=bc(e.value),e.value==="0"&&this.declaration&&!L6.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},Z1.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function x6(e){e.value=e.value.replace(/\\/g,"/")}var ow={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"},iw={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 Bm(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 sw(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=Bm(l,a,e+1/3),i=Bm(l,a,e),s=Bm(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function Hm(e){return e=e.toString(16),e.length===1?"0"+e:e}function Fm(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 O6(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=Fm(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=sw(...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:bc(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||Fm(e.children,3,!1),!r)return;r=sw(...r),n="rgb"}if(n==="rgb"){if(r=r||Fm(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:Hm(r[0])+Hm(r[1])+Hm(r[2])},aw(t.data,t)}}function R6(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(ow.hasOwnProperty(n)&&Z1.matchDeclaration(this.declaration).isType(e,"color")){const r=ow[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function aw(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]),iw[n]?t.data={type:"Identifier",loc:e.loc,name:iw[n]}:e.value=n}var lw={Atrule:m6,AttributeSelector:g6,Value:E6,Dimension:k6,Percentage:N6,Number:C6,Url:x6,Hash:aw,Identifier:R6,Function:O6};function M6(e){Bt(e,{leave(t,n,r){lw.hasOwnProperty(t.type)&&lw[t.type].call(this,t,n,r)}})}var P6=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 I6(){const e=new P6;return function(n){const r=$n(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function D6(e){return e.type==="Raw"?J9(e.value,{context:"selectorList"}):e}function B6(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function cw(e){return D6(e).children.reduce((t,n)=>B6($m(n),t),[0,0,0])}function $m(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]=cw(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]=cw(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 H6=new Set(["first-letter","first-line","after","before"]),F6=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function $6(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: "+$n(r));i=a}break;case"PseudoClassSelector":{const a=s.name.toLowerCase();F6.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();H6.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=$m(r).toString(),r.id=null,r.id=$n(r),i&&(r.compareMarker+=":"+i),o!=="*"&&(r.compareMarker+=","+o)}),e.pseudoSignature=n.size>0?[...n].sort().join(","):!1}function W6(e,t){const n=I6();return Bt(e,{visit:"Rule",enter(r){r.block.children.forEach(n),$6(r,t.usage)}}),Bt(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=$n(r.prelude)),En(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:uw}=Object.prototype;function dw(e,t,n,r){const o=t.data,i=En(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);uw.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],uw.call(e[i],s)||(e[i][s]=new je),e[i][s].append(n.remove(t))}function q6(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=En(o.name).basename;switch(a){case"keyframes":dw(n,i,s,!0);return;case"media":if(t.forceMediaMerge){dw(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 fw(e){return e.type==="Atrule"&&e.name==="media"}function z6(e,t,n){if(!fw(e))return;const r=t.prev&&t.prev.data;!r||!fw(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function U6(e,t){q6(e,t),Bt(e,{visit:"Atrule",reverse:!0,enter:z6})}var{hasOwnProperty:j6}=Object.prototype;function mw(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 hw(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 V6(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]&&((!j6.call(r,s.fingerprint)||!r[s.fingerprint]&&s.important)&&n.ne2.push(s),n.ne2overrided.push(s))}return n}function zs(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 pw(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 yc(e){switch(e.type){case"Rule":return pw(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some(yc,this);break;case"Declaration":return!1}return!0}function G6(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return yc.call(r,i);const s=i.prelude.children,a=i.block.children;if(e.pseudoSignature===i.pseudoSignature){if(mw(s,r))return a.appendList(o),n.remove(t),!0;if(hw(o,a))return zs(s,r),n.remove(t),!0}return pw(r,s)})}function X6(e){Bt(e,{visit:"Rule",enter:G6})}function K6(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new je;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 Y6(e){Bt(e,{visit:"Rule",reverse:!0,enter:K6})}var gw=1,Z6=2,mi=0,Us=1,Wm=2,vc=3,bw=["top","right","bottom","left"],Q6={"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"},yw={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"},J6=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=Q6[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[Us]=i[mi],i[Wm]=i[mi],i[vc]=i[mi];break;case 2:i[Wm]=i[mi],i[vc]=i[Us];break;case 3:i[vc]=i[Us]}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(bw[s],i[s])&&(r[bw[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 je,t=this.sides,n=[t.top,t.right,t.bottom,t.left],r=[$n(t.top.node),$n(t.right.node),$n(t.bottom.node),$n(t.left.node)];r[vc]===r[Us]&&(n.pop(),r[Wm]===r[mi]&&(n.pop(),r[Us]===r[mi]&&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 e7(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(!yw.hasOwnProperty(l))return;const c=yw[l];let u,d;if((!r||i===r)&&c in t&&(d=Z6,u=t[c]),(!u||!u.add(l,s))&&(d=gw,u=new J6(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 t7(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===gw?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function n7(e,t){const n={},r=[];Bt(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=e7.call(this,o,l,r,a.lastShortSelector)}}),t7(r,t.declaration)}var r7=1,o7=new Set(["src"]),vw={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},Ew={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"]},Sw={"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 ww(e,t,n){const r=ii(e).basename;if(r==="background")return e+":"+$n(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=En(f).vendor),/\\[09]/.test(f)&&(l=RegExp.lastMatch),Ew.hasOwnProperty(r)?Ew[r].indexOf(f)===-1&&(s[f]=!0):vw.hasOwnProperty(r)&&vw[r].test(f)&&(s[f]=!0);break}case"Function":{let{name:f}=d;a||(a=En(f).vendor),f==="rect"&&(d.children.some(h=>h.type==="Operator"&&h.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?"!"+r7++:"!"+Object.keys(s).sort()+"|"+l+a;break;case"Raw":i="!"+t.value.value;break;default:i=$n(t.value)}n[o]=i}return e+i}function i7(e,t,n){const r=ii(t.property);if(Sw.hasOwnProperty(r.basename)){const o=Sw[r.basename];for(const i of o){const s=ww(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function s7(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=ww(l,s,o),u=r[c];u&&!o7.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):i7(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function a7(e){const t={},n=Object.create(null);Bt(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),s7.call(this,r,o,i,c,n)}})}function l7(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 yc.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(hw(o,u)){const f=c.data.id;r.some((h,m)=>{const p=h.id;if(f<p)return r.insert(c,m),!0;if(!m.next)return r.insert(c),!0}),n.remove(l);return}if(d===i)return!0;s[d]=!0})}function c7(e){Bt(e,{visit:"Rule",enter:l7})}function qm(e){return e.reduce((t,n)=>t+n.id.length+1,0)-1}function zm(e){let t=0;for(const n of e)t+=n.length;return t+e.length-1}function u7(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=yc.call(o,c);return!p&&f==="Atrule"&&d&&Bt(d,{visit:"Rule",enter(v){v.prelude.children.forEach(C=>{s[C.compareMarker]=!0})}}),p}if(e.pseudoSignature!==c.pseudoSignature)return!0;const h=c.prelude.children;if(l=!h.some(p=>p.compareMarker in s),!l&&!a)return!0;if(a&&mw(h,o))return d.children.appendList(i.children),n.remove(t),!0;const m=V6(i.children,d.children);if(m.eq.length){if(!m.ne1.length&&!m.ne2.length)return l&&(zs(o,h),n.remove(u)),!0;if(!r)if(m.ne1.length&&!m.ne2.length){const p=qm(o),v=zm(m.eq);a&&p<v&&(zs(h,o),i.children.fromArray(m.ne1))}else if(!m.ne1.length&&m.ne2.length){const p=qm(h),v=zm(m.eq);l&&p<v&&(zs(o,h),d.children.fromArray(m.ne2))}else{const p={type:"SelectorList",loc:null,children:zs(h.copy(),o)},v=qm(p.children)+2;if(zm(m.eq)>=v){const C=n.createItem({type:"Rule",loc:null,prelude:p,block:{type:"Block",loc:null,children:new je().fromArray(m.eq)},pseudoSignature:e.pseudoSignature});return i.children.fromArray(m.ne1),d.children.fromArray(m.ne2overrided),a?n.insert(C,u):n.insert(C,t),!0}}}a&&(a=!h.some(p=>o.some(v=>v.compareMarker===p.compareMarker))),h.forEach(p=>{s[p.compareMarker]=!0})})}function d7(e){Bt(e,{visit:"Rule",reverse:!0,enter:u7})}function f7(e,t){const n=W6(e,t);t.logger("prepare",e),U6(e,t),t.logger("mergeAtrule",e),X6(e),t.logger("initialMergeRuleset",e),Y6(e),t.logger("disjoinRuleset",e),n7(e,n),t.logger("restructShorthand",e),a7(e),t.logger("restructBlock",e),c7(e),t.logger("mergeRuleset",e),d7(e),t.logger("restructRuleset",e)}function m7(e,t){const n=new je;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 h7(e,t,n,r){r.logger(`Compress block #${n}`,null,!0);let o=1;return e.type==="StyleSheet"&&(e.firstAtrulesAllowed=t,e.id=o++),Bt(e,{visit:"Atrule",enter(i){i.block!==null&&(i.block.id=o++)}}),r.logger("init",e),d6(e,r),r.logger("clean",e),M6(e,r),r.logger("replace",e),r.restructuring&&f7(e,r),e}function p7(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 g7(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function b7(e){return new je().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new je().appendData({type:"Selector",loc:null,children:new je().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function y7(e,t){e=e||{type:"StyleSheet",loc:null,children:new je},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:g7(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?n6(t.usage):!1},r=new je;let o=p7(t),i=!0,s,a,l=1,c;t.clone&&(e=Im(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=b7(e);do{if(a=m7(s,!!o),h7(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(je.createItem({type:"Raw",value:`
|
|
43
|
-
`})),r.insert(je.createItem(a.comment)),c.isEmpty||r.insert(je.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 v7=ie({compress:()=>y7,find:()=>T7,findAll:()=>k7,findLast:()=>A7,fromPlainObject:()=>L7,generate:()=>_7,lexer:()=>E7,parse:()=>w7,specificity:()=>$m,toPlainObject:()=>N7,tokenize:()=>S7,walk:()=>C7});function _w(e){const t=Om(e,!0),n=Om(e);return t.length<n.length?t:n}var{lexer:E7,tokenize:S7,parse:w7,generate:_7,walk:C7,find:T7,findLast:A7,findAll:k7,fromPlainObject:L7,toPlainObject:N7}=e6({node:{String:{generate(e){this.token(5,_w(e.value))}},Url:{generate(e){const t=$1(e.value),n=_w(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:x7,generate:Um,compress:O7}=v7;function hi(e,t,n,r){return t.debug,r}function R7(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=Um(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
|
|
45
|
-
${s}
|
|
46
|
-
`}t=Date.now()}}function M7(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=R7(e.debug)),e}function Cw(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function P7(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=hi("parsing",n,Date.now(),x7(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&hi("beforeCompress",n,Date.now(),Cw(i,n,n.beforeCompress));const s=hi("compress",n,Date.now(),O7(i,M7(n)));return n.afterCompress&&hi("afterCompress",n,Date.now(),Cw(s,n,n.afterCompress)),n.sourceMap?o=hi("generate(sourceMap: true)",n,Date.now(),(()=>{const a=Um(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=hi("generate",n,Date.now(),{css:Um(s.ast),map:null}),o}function go(e,t){return P7("stylesheet",e,t)}var Tw={restructure:!0,forceMediaMerge:!0};function Aw(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(go(s.innerHTML,Tw).css,{indent:" ",autosemicolon:!0})+`
|
|
48
|
-
`;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&kw(e,s.sheet,o,i)){let a=D7(s.sheet);a=go(a,Tw).css,a=`
|
|
49
|
-
`+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
|
|
50
|
-
`,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function kw(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-")}`),I7(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=kw(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 I7(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 D7(e){return Array.from(e.cssRules,t=>t.cssText).join(`
|
|
51
|
-
`)}var Lw=/device-width/i,B7="not all",pi=new Map,jm=!1;function H7(e){return"media"in e&&"cssRules"in e}function Nw(e,t){for(const n of Array.from(e))H7(n)&&t(n),"cssRules"in n&&Nw(n.cssRules,t)}function F7(e){try{return e.cssRules}catch{return}}function $7(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!Lw.test(n));return t.length?t.join(", "):B7}function Vm(e){pi.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||pi.delete(n)});for(const t of Array.from(e.styleSheets)){const n=F7(t);n&&Nw(n,r=>{const o=r.media.mediaText;pi.has(r)||!Lw.test(o)||(pi.set(r,o),r.media.mediaText=$7(o))})}}function xw(){pi.forEach((e,t)=>{t.media.mediaText=e}),pi.clear()}function W7(e){if(!jm)return e();xw();try{return e()}finally{Vm(document)}}function q7(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 z7(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;jm=!0,Vm(t);const n=new MutationObserver(r=>{q7(r)&&Vm(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),xw(),jm=!1}}function js(e){return ae(e)}var Vne=ae("extensions.atomsHandlers"),Gne=js("HANDLE_ATOM_INSERT"),Xne=ae("HeadlessMode"),Kne=ae("extensions.sandboxExtensions"),U7="SANDBOX_EXTENSION_SCRIPT_STATUS",Yne=ae("MESSAGE_SERVICE"),Zne=js("SETTINGS_PANEL_EVENT"),Qne=js("MODAL_SHOW_EVENT"),Jne=js("MODAL_CLOSE_EVENT"),ere=js("MODAL_UPDATE_EVENT");function tre(e){return e}var Ow="SandboxApp",Gm="IframePluginRegistry",j7="__sandbox__";function Rw(){return Td(j7)}function V7(e=Rw()){return e.getOrCreateInstance(Gm,()=>new _b)}var Xm=new $N(()=>V7()),Vs=class tL{constructor(){A(this,"container",Rw()),A(this,"pluginCollection",new FN(this,Xm)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new tL)}static registerPlugin(t,n){Xm.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&Xm.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()}};A(Vs,"_instance",void 0);var Gs="data-extension";function Xs(e,t,n,r){z.send(U7,{key:e,phase:t,status:n,error:r})}function G7(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(Gs)||void 0}function Mw(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function Km(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,Xs(e.key,"ready","success"))}function Pw(e,t){return[...document.querySelectorAll(`${e}[${Gs}]`)].find(n=>n.getAttribute(Gs)===t)}function X7({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(Gs,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 K7(e,t={}){const n=new Ee,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=u=>{let d=i.get(u);return d||(d=Mw(u),i.set(u,d)),d},l=u=>{if(u.type==="created"){const h=G7();if(!h)return;const m=a(h);m.hasSyncPlugins=!0,m.pendingPlugins.add(u.plugin),s.set(u.plugin,h);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),Km(f);return}(u.type==="init:error"||u.type==="afterInit:error")&&(f.pendingPlugins.delete(u.plugin),f.readyFailed=!0,Xs(d,"ready","error",`Sandbox plugin "${u.name}" failed during ${u.type==="init:error"?"init":"afterInit"}.`))}};n.addDisposable(Vs.onLifecycle(l)),n.addDisposable(z.addListener(de.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,Mw(d.key));const h=d.parent&&document.querySelector(d.parent)||document.head;if(f=X7(d),e.ownership.markService(f),d.type==="script"){const m=f;m.src&&(m.onload=()=>{const p=a(d.key);p.loadedNotified=!0,Xs(d.key,"load","success"),Km(p)},m.onerror=()=>Xs(d.key,"load","error",`Failed to load sandbox script: ${m.src}`))}if(h.appendChild(f),d.type==="script"&&!f.src){const m=a(d.key);m.loadedNotified=!0,Xs(d.key,"load","success"),Km(m)}r.set(d.key,f),o.set(d.key,d)}})),n.addDisposable(z.addListener(de.SANDBOX_REMOVE_EXTENSIONS,u=>{for(const d of u){const f=Pw(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 h=Pw(f.type,u);let m=f.parent?[...document.querySelectorAll(f.parent)]:[];m.length||(m=[document.head]),h?h!==d?r.set(u,h):m.some(p=>h.parentNode===p)||m[0]?.appendChild(h):m[0]?.appendChild(d)}}return n}function Y7(e){e.querySelectorAll(`[${Gs}]`).forEach(t=>t.remove())}var bo="remove-basic-cell",Z7="remove-basic-row",yo="em-active-table-cell",Q7="em-temporary-class",Ir="em-temporary-active-cell-background-color",Dr="temporary-cell-class",Ec=[bo,Z7,yo,Q7,Dr,Ir],J7=["contenteditable","em-edit","em-state","em-hover"],Iw=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;"> </div>`,Ks="em-table-menu",Ys="em_version";function Sc(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(Ys),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function eH(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(Ys,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${Ys}=${Date.now()}`}}var tH=/^(chrome-extension|moz-extension|safari-extension):\/\//i,nH=/local\.adguard\.org/i,rH=/^bis_/i,oH=new Set(["data-bis-config"]),gi=/<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,iH=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,wc=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Dw=/display:\s*none\s*!important/gi,Bw="data-darkreader-",sH=/<(script|style)\b[\s\S]*?<\/\1\s*>|<[a-z][^\s<>]*(?:"[^"]*"|'[^']*'|[^<>"'])*?\sdata-darkreader-(?:"[^"]*"|'[^']*'|[^<>"'])*>/gi,aH=/\sdata-darkreader-[a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?/gi,lH=[".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; }"],Hw=new Set(["em","data-theme-varibalse","data-em-localization"]);function cH(e){return Dw.lastIndex=0,(e.match(Dw)||[]).length}function Ym(e){const t=e.trim(),n=cH(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=lH.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 uH(e){if(Hw.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of Hw)if(e.hasAttribute(t))return!1;return Ym(e.textContent||"")}function dH(e){return tH.test(e.src)||nH.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function Fw(e){let t=!1;for(const n of[...e.attributes])(rH.test(n.name)||oH.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function fH(e){wc.lastIndex=0;for(const t of e.matchAll(wc))if(Ym(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function mH(e){let t=!1;return wc.lastIndex=0,{html:e.replace(wc,n=>Ym(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function $w(e){let t=!1;return e instanceof Element&&Fw(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{dH(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&uH(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{Fw(n)&&(t=!0)}),t}function hH(e){return gi.lastIndex=0,gi.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||fH(e)}function pH(e){return e.toLowerCase().startsWith(Bw)}function gH(e){return e.toLowerCase().includes(Bw)?e.replace(sH,(t,n)=>n?t:t.replace(aH,"")):e}function bH(e){const t=gH(e);if(!hH(t))return{html:t,found:!1};let n=!1,r=t;gi.lastIndex=0,gi.test(r)&&(gi.lastIndex=0,r=r.replace(gi,""),n=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(r)||/\sdata-bis-config\s*=/.test(r))&&(r=r.replace(iH,""),n=!0);const o=mH(r);return r=o.html,n=n||o.found,{html:r,found:n}}var yH=class extends Ee{constructor(...e){super(...e),A(this,"_transforms",[]),A(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 Zm(){return Mt.getInstance(Po)}var _c=new WeakMap;function vH(e,t,n){const r=_c.get(e);r?r.set(t.toLowerCase(),n):_c.set(e,new Map([[t.toLowerCase(),n]]))}function EH(e,t){const n=_c.get(e);n?.size&&_c.set(t,new Map(n))}function Ww(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 Cc(e,t={}){const n=t.pipeline??Zm(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),nn(e,o),n&&!n.isEmpty&&qw(e,o)),!n||n.isEmpty)return o;o instanceof Element&&Ww(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)Ww(s,n,r);return o}function SH(e,t={}){const n=t.pipeline??Zm(),r=qM(e);if((!n||n.isEmpty)&&!r)return _r(e);const o=Cc(e,{...t,pipeline:n,clone:!0});return Zo(o),Zg(o)}function qw(e,t){EH(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)qw(n[o],r[o])}function Ht(e,t,n,r={}){const o=Qm(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function Qm(e,t,n,r={}){const o=r.pipeline??Zm();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&&vH(a,t,n)}return s}function wH(e){const t=new yH,n=nb((o,i,s)=>t.isEmpty?s:Qm(o,i,s,{pipeline:t})),r=VL((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(Po,t),{pipeline:t,dispose(){r(),n(),t.dispose(),bn(e,Po)}}}function _H(e){return Sc(e)}function zw(e){const t=(n,r)=>{const o=n.getAttribute(r);if(!o)return;const i=_H(o);i!==o&&n.setAttribute(r,i)};e.querySelectorAll("[src]").forEach(n=>t(n,"src")),e.querySelectorAll("[___src]").forEach(n=>t(n,"___src"))}var Uw=[".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"],CH=["contenteditable","em-edit","em-state","em-hover"],TH=["[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"],AH=new Set(["normal","400"]),kH=new Set(["normal"]),LH=new Set(["baseline","unset","initial",""]),jw=new Set(["none",""]),NH=["b","strong","em","i","u","s","strike","sup","sub"],xH="___em-internal",Vw=["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"],OH=["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"],RH=[...Uw,...TH].filter(e=>/\.em-(element-|gap|vindent)/.test(e)&&e!=="span.em-element-resize-img-container").join(", "),MH=CH.filter(e=>!Uw.some(t=>t.includes(`[${e}`))),PH=[...Vw,...OH],IH={isServiceAttribute:e=>MH.includes(e)||pH(e),isServiceClass:e=>PH.includes(e),isServicePanel:e=>e.matches(RH)||e.hasAttribute("data-em-caret")};function Gw(e){Ec.forEach(t=>{e.querySelectorAll(`.${t}`).forEach(n=>n.classList.remove(t))})}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")}),Vw.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&&(Lt(t,"[data-mce-caret=before]",!0),Lt(t,"span.em-element-resize-img-container"),Lt(t,"div.em-element-img-change-group",!0),Lt(t,"div.em-element-block-add",!0),Lt(t,"meta[http-equiv=Content-Security-Policy]",!0),Lt(t,"[class*=mce-]"),Lt(t,"script[em=initial]",!0),Lt(t,".em-editor-wrapper",!0),Lt(t,".em-element-resize-height",!0),Lt(t,".em-element-vindent-remove",!0),Lt(t,".em-element-vindent",!0),Lt(t,".em-element-vindent-value",!0),Lt(t,"div.iframe-resizer-inner"))}function DH(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")),Gw(e),Tc(e),Kv(e),Lt(e,"editor",!1),Kw(e),zw(e),$w(e)}function Zs(e){return(e??"").trim().toLowerCase()}function BH(e){const t=Zs(e.style.fontWeight);t&&AH.has(t)&&e.style.removeProperty("font-weight");const n=Zs(e.style.fontStyle);n&&kH.has(n)&&e.style.removeProperty("font-style");const r=Zs(e.style.verticalAlign);r&&LH.has(r)&&e.style.removeProperty("vertical-align");const o=Zs(e.style.textDecorationLine);o&&jw.has(o)&&e.style.removeProperty("text-decoration-line");const i=Zs(e.style.textDecoration);i&&jw.has(i)&&e.style.removeProperty("text-decoration");const s=e.getAttribute("style");s!==null&&s.trim()===""&&e.removeAttribute("style")}function HH(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Xw(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==xH)return!1;return!0}function Kw(e){const t=Array.from(e.querySelectorAll("span"));for(let n=t.length-1;n>=0;n-=1){const r=t[n];BH(r),Xw(r)&&HH(r)}for(const n of NH){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&&Xw(i)&&i.remove()}}}function FH(e){const t=[],n=UH(e);return e=qH(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=Il.clear(e),e=Jm(e),t.length===0?e:VH(e,t,n)}var Yw=`(<(script|style)\\b[^>]*>)([\\s\\S]*?)(?=<\\/\\2${ja})`,$H=new RegExp(Yw,"gi"),WH=new RegExp(`<!--[\\s\\S]*?-->|${Yw}`,"gi");function qH(e,t,n){const r=(o,i,s,a)=>!a||!jH(s,i)?i+a:(t.push(s.toLowerCase()==="style"?zH(a):a),`${i}${n}${t.length-1}${Qw}`);return e.replaceAll(WH,(o,i,s,a)=>i===void 0?o.replaceAll($H,r):r(o,i,s??"",a??""))}function zH(e){const t=Jm(Il.clear(`>${e}`));return t.startsWith(">")?t.slice(1):Jm(Il.clear(e))}var Zw="",Qw="";function UH(e){let t=Zw;for(;e.includes(t);)t+=Zw;return t}function jH(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]),yn(n)}function VH(e,t,n){return e.replaceAll(new RegExp(`${n}(\\d+)${Qw}`,"g"),(r,o)=>t[Number(o)]??r)}function Jm(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=G(n);r&&(e=e.replaceAll(n,r))}),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function Jw(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 GH(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 e_(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return W7(()=>Aw(document,e,{forceMediaMerge:!0}))}function XH(e){let t=!1;return e.beforeCommit(()=>{try{!t&&e.takeStyleDirty()&&(t=!0,e_(),e.takeStyleDirty())}finally{t=!1}})}function Ac(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 Ac({node:n});i=Jw(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 Ac({html:t});i=Jw(s);const c=Le(a);i.replaceChildren(...c)}Cc(i,{stage:"apply"}),DH(i),t=kt(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)GH(i,Le(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()),Y7(i),Gw(i),Tc(i),Kv(i),i.documentElement&&Lt(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())}),Kw(i)),Cc(i,{stage:"apply"}),zw(i),$w(i),t=Pt(i)}return bH(FH(t)).html}function eh(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 t_="__emOwnEditor";function KH(e){e[t_]=!0,Rv(e)}function n_(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[t_]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var YH=["deleteContentBackward","deleteContentForward","deleteByCut"],ZH={deleteContentBackward:"backward",deleteContentForward:"forward"};function QH(e){const{element:t,getVisibleText:n,setCursorToElement:r,hasOnlyTextNodesDeep:o,isRangeCoveringAllVisibleText:i,isEditorContentOnlyNbsp:s,commit:a,pasteFragment:l}=e,c=g=>Dt(g)?kf(g):e.mapFn(g);function u(g){return!n(g,c).trim()&&!g.querySelector(o_)}const d=g=>n(g,c).trim();function f(g,y){const w=document.createRange();w.selectNodeContents(y);const b=g.cloneRange();return b.compareBoundaryPoints(b.START_TO_START,w)<0&&b.setStart(w.startContainer,w.startOffset),b.compareBoundaryPoints(b.END_TO_END,w)>0&&b.setEnd(w.endContainer,w.endOffset),s_(n(b.cloneContents(),c).trim(),d(y))}function h(g){g.insertAdjacentHTML("beforebegin"," "),g.removeAttribute("em-edit"),g.remove()}function m(g,y,w){if(!y.collapsed)return!1;const b=document.createRange();return w?(b.setStart(y.endContainer,y.endOffset),b.setEnd(g,g.childNodes.length)):(b.setStart(g,0),b.setEnd(y.startContainer,y.startOffset)),!n(b.cloneContents(),c).trim()}function p(g,y){const w=[],b=[],S=document.createTreeWalker(g,NodeFilter.SHOW_COMMENT);for(let _=S.nextNode();_;_=S.nextNode()){const T=y.comparePoint(_,0);T!==0&&(T<0?w:b).push(_)}L(g),g.prepend(...w),g.append(...b)}function v(g,y){const w=window.getSelection(),b=w?.rangeCount?w.getRangeAt(0).cloneRange():void 0,S=[],_=document.createTreeWalker(g,NodeFilter.SHOW_COMMENT);for(let N=_.nextNode();b&&N;N=_.nextNode()){const I=b.comparePoint(N,0);I!==0&&S.push({comment:N,before:I<0})}const T=y(),x=S.filter(({comment:N})=>!g.contains(N));return x.length&&C(g,x.filter(({before:N})=>N).map(({comment:N})=>N),x.filter(({before:N})=>!N).map(({comment:N})=>N)),T}function C(g,y,w){const b=window.getSelection(),S=b?.rangeCount?b.getRangeAt(0):void 0;if(!b||!S||!g.contains(S.startContainer)){g.prepend(...y),g.append(...w);return}const _=S.cloneRange();_.collapse(!0);for(const x of[...y,...w].reverse())_.insertNode(x);const T=document.createRange();y.length?T.setStartAfter(y[y.length-1]):T.setStartBefore(w[0]),T.collapse(!0),b.removeAllRanges(),b.addRange(T)}function k(g,y){return g.inputType.startsWith("delete")?v(y,()=>f_(g)):f_(g)}function L(g,y=kc(g,d)){const[w,...b]=y,S=w??g;if(!w&&(iF(g)||aF(g))){const x=document.createTextNode(" ");g.replaceChildren(x),r(x);return}const _=document.createElement(w&&w.tagName!=="EDITOR"?w.tagName:"div"),T=document.createTextNode(" ");if(w&&S.tagName===_.tagName)for(const{name:x,value:N}of Array.from(S.attributes))_.setAttribute(x,N);n5(_,w?g:mF(g),S,hF),_.getAttribute("style")||_.removeAttribute("style"),b.filter(x=>x.tagName!=="TBODY").reduce((x,N)=>x.appendChild(fF(N)),_).append(T),g.tagName==="A"||g.parentNode&&g.parentNode.tagName==="A"?g.replaceChildren(T):g.replaceChildren(_),r(T)}function E(g,y){if(y.collapsed)return!1;const w=kc(g,d);return Zv(y,void 0,ZP)?(u(g)&&L(g,w),t.setAttribute("em-edit","active"),a(!0),!0):!1}return function(y){const w=y.target,b=window.getSelection();if(!b||b.rangeCount===0)return;if(y.inputType==="insertFromPaste"&&l&&!y.defaultPrevented){l(y);return}const S=ZH[y.inputType];if(S&&XP(b.getRangeAt(0),S)){y.preventDefault();return}if(YH.includes(y.inputType)&&E(w,b.getRangeAt(0))){y.preventDefault();return}const _=n(w,c).trim(),T=n(b.getRangeAt(0)?.cloneContents(),c).trim(),x=b.getRangeAt(0),N=x.startContainer,I=(N.nodeType===Node.TEXT_NODE?N.parentNode:N).closest("sup, sub");if((y.inputType==="deleteContentBackward"||y.inputType==="deleteByCut")&&!b?.isCollapsed&&T){if(I&&f(x,I)&&h(I),i(x)&&s_(T,_)&&!w.querySelector(th)){y.preventDefault(),p(w,x),t.setAttribute("em-edit","active"),a(!0);return}t.setAttribute("em-edit","active"),a(!0)}if(y.inputType==="deleteContentBackward"&&b?.isCollapsed&&!T){N.length===1&&(I&&d(I).length===1&&h(I),t.setAttribute("em-edit","active"),a(!0));const V=()=>{k(y,w)&&a(!0)};if(N.nodeType!==Node.TEXT_NODE&&!i(x))return V();const K=x.startOffset;if(K===0&&!i(x))return V();const se=N.parentNode;if(!se)return V();const te=Array.prototype.indexOf.call(se.childNodes,N);if(se.childNodes[te-1]?.nodeType===Node.COMMENT_NODE){y.preventDefault(),N.deleteData(K-1,1);const Z=document.createRange();Z.setStart(N,K-1),Z.collapse(!0),b.removeAllRanges(),b.addRange(Z),a(!0);return}w&&s(w)&&(y.preventDefault(),y.stopImmediatePropagation())}if(y.inputType==="insertText"&&!b?.isCollapsed){y.preventDefault();let V=y.data||"";const K=b.anchorNode;i(x)&&(K.tagName==="A"||K?.parentNode&&K.parentNode.tagName==="A")&&(V=" "+y.data),x.deleteContents();const se=document.createTextNode(V||" ");x.insertNode(se),x.setStartAfter(se),x.collapse(!0),b.removeAllRanges(),b.addRange(x),$f(se,se,wf),a(!0);return}if(oF.test(y.inputType)){const V=gF(y,b.getRangeAt(0));if(!V||(y.preventDefault(),KP(w,V))||(b.removeAllRanges(),b.addRange(V),E(w,V)))return;const K=kc(w,d);v(w,()=>{d_("delete"),u(w)&&L(w,K)}),a();return}const O=y.inputType==="deleteContentForward",M=()=>tF(w)?x.collapsed&&!m(w,x,O)&&dF(w,d):o(w)&&!(O&&m(w,x,!0));if(y.inputType.includes("deleteContent")&&(Array.from(n(w,c).replace(rF,"")).length<2||_===T)&&!w.querySelector(th)&&M()){y.preventDefault(),p(w,x),a(!0);return}if(y.inputType==="insertText"&&y.data&&i_(b,y.data)){y.preventDefault(),y.stopImmediatePropagation(),a(!0);return}if(y.inputType==="deleteContentBackward"&&!b.isCollapsed&&!T&&w&&s(w)&&(y.preventDefault(),y.stopImmediatePropagation()),k(y,w)){a(!0);return}a()}}var th="em-replace, img, picture, video, audio, svg, canvas, iframe, object, hr, input, button",JH="div, p, ul, ol, table, h1, h2, h3, h4, h5, h6, blockquote, center, pre",eF="em-inline";function tF(e){return!e.hasAttribute("em-inline")&&!!e.querySelector("div, p, ul, ol, table, h1, h2, h3, h4, h5, h6, blockquote, center, pre")}var r_=`${JH}, td, th`,nF="br, ul, ol, li, pre",rF=/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,o_=`${th}, table`,oF=/^delete(Word|SoftLine|HardLine)/;function i_(e,t){const n=e.anchorNode,r=n;if(r?.tagName==="A"&&!r.textContent?.trim().length){r.insertAdjacentText("beforeend",t);const o=document.createRange();return o.selectNodeContents(r),o.collapse(!1),e.removeAllRanges(),e.addRange(o),!0}if(n?.parentNode?.tagName==="A"||r?.tagName==="A"){const o=e.getRangeAt(0),i=document.createTextNode(t);return o.insertNode(i),o.setStartAfter(i),o.collapse(!0),e.removeAllRanges(),e.addRange(o),$f(i,i,wf),!0}return!1}function s_(e,t){return e.replace(/\s+/g," ")===t.replace(/\s+/g," ")}function iF(e){return[a_(e,"previousSibling"),a_(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))}var sF=/^(A|SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SUB|SUP|SMALL|BIG|MARK)$/;function aF(e){return e.parentElement!==null&&sF.test(e.parentElement.tagName)}function a_(e,t){let n=e[t];for(;n?.nodeType===Node.TEXT_NODE&&!n.textContent?.trim();)n=n[t];return n}var lF=/^(AREA|BASE|BR|COL|EMBED|HR|IMG|INPUT|LINK|META|SOURCE|TRACK|WBR)$/,l_=/^(SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SMALL|BIG|MARK)$/,cF={TABLE:["THEAD","TBODY","TFOOT","TR"],THEAD:["TR"],TBODY:["TR"],TFOOT:["TR"],TR:["TD","TH"]};function kc(e,t){const n=t(e),r=[];for(let o=c_(e,n,t);o;o=uF(o,n,t))r.push(o);return r}function c_(e,t,n){const r=u_(e,n);if(!(!r||lF.test(r.tagName)||r.tagName!=="TABLE"&&r.matches(o_)))return!(r.tagName==="A"||l_.test(r.tagName))||n(r)===t?r:void 0}function uF(e,t,n){const r=cF[e.tagName];if(r)return Array.from(e.children).find(i=>r.includes(i.tagName));if(e.tagName==="TD"||e.tagName==="TH")return c_(e,t,n);const o=u_(e,n);return o&&l_.test(o.tagName)&&n(o)===t?o:void 0}function u_(e,t){for(const n of Array.from(e.childNodes))if(!(Dt(n)&&!t(n))){if(n.nodeType===Node.ELEMENT_NODE)return n;if(t(n))return}}function dF(e,t){if(e.querySelector(nF))return!1;const n=kc(e,t),r=[...n].reverse().find(o=>o.matches(r_));return r!==void 0&&t(r)===t(e)&&Array.from(e.querySelectorAll("*")).every(o=>n.some(i=>i===o)||r.contains(o)&&!o.matches(r_))}function fF(e){const t=e.cloneNode(!1);return t.removeAttribute("em-edit"),t}function mF(e){const t=e.cloneNode(!1);return t.removeAttribute("innerStyle"),t.removeAttribute("innerClass"),t}var hF=e=>G(e)??e;function pF(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 gF(e,t){const n=Nf(t,e.inputType.endsWith("Backward")?"backward":"forward");if(!n)return pF(e);const r=document.createRange();return r.selectNode(n),r}var bF={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"},yF=["insertText"],nh=!1;function d_(e,t){nh=!0;try{lr(e,!1,t)}finally{nh=!1}}function vF(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 f_(e){const t=bF[e.inputType];if(!t||e.defaultPrevented||e.isComposing||nh)return!1;const n=e.inputType==="insertReplacementText"?vF(e):e.data??void 0;return yF.includes(t)&&!n?!1:(e.preventDefault(),d_(t,n),!0)}function EF(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()),n_(n),i5(n,r)))return;kE(n,Le);const o=document.createElement("editor");if(KH(o),o.classList.add("em-text"),o.setAttribute("contenteditable","true"),r)SF(n)&&o.setAttribute(eF,""),n.before(o),o.replaceChildren(n),Mv(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",pt(()=>e.commit(!0)),!0),o.addEventListener("beforeinput",QH({element:n,getVisibleText:AE,mapFn:t5,setCursorToElement:r5,hasOnlyTextNodesDeep:CE,isRangeCoveringAllVisibleText:qP,isEditorContentOnlyNbsp:WP,commit:e.commit,pasteFragment:s=>{const a=l=>eh({target:l.target},c=>e.commit(c));Wl(s,!1,j.get("commonStyles"),a,e.commit)}}))}}function SF(e){const{display:t,cssFloat:n}=getComputedStyle(e);return t.startsWith("inline")||!!n&&n!=="none"}function wF({commit:e,htmlDocument:t,documentMapping:n}){const r=EF({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||$P(()=>r(i,s),"editor")}}}var m_=e=>t=>t.some(n=>e(n).some(_F)),_F=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),CF=m_(({removed:e})=>e),TF=m_(({added:e})=>e),AF=e=>t=>{CF(t)&&!TF(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){Lr("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},kF=200;function LF(e){let t=!1;return()=>{if(t)return;t=!0;let n;const r=()=>{t&&(t=!1,clearTimeout(n),e())};n=setTimeout(r,kF),window.requestAnimationFrame(()=>setTimeout(r,0))}}var Ve={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"},xe="em-icon";function NF(e,t,n){return(t=MF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dr(){return dr=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},dr.apply(null,arguments)}function h_(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 Wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h_(Object(n),!0).forEach(function(r){NF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xF(e,t){if(e==null)return{};var n,r,o=OF(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 OF(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 RF(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 MF(e){var t=RF(e,"string");return typeof t=="symbol"?t:t+""}function rh(e){"@babel/helpers - typeof";return rh=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},rh(e)}var PF="1.15.7";function fr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var mr=fr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Qs=fr(/Edge/i),p_=fr(/firefox/i),Js=fr(/safari/i)&&!fr(/chrome/i)&&!fr(/android/i),oh=fr(/iP(ad|od|hone)/i),g_=fr(/chrome/i)&&fr(/android/i),b_={capture:!1,passive:!1};function be(e,t,n){e.addEventListener(t,n,!mr&&b_)}function pe(e,t,n){e.removeEventListener(t,n,!mr&&b_)}function Lc(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 y_(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function _n(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Lc(e,t):Lc(e,t))||r&&e===n)return e;if(e===n)break}while(e=y_(e))}return null}var v_=/\s+/g;function Kt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(v_," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(v_," "))}function re(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 bi(e,t){var n="";if(typeof e=="string")n=e;else do{var r=re(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 E_(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 qn(){var e=document.scrollingElement;return e||document.documentElement}function et(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==qn()?(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,!mr))do if(o&&o.getBoundingClientRect&&(re(o,"transform")!=="none"||n&&re(o,"position")!=="static")){var f=o.getBoundingClientRect();s-=f.top+parseInt(re(o,"border-top-width")),a-=f.left+parseInt(re(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var h=bi(o||e),m=h&&h.a,p=h&&h.d;h&&(s/=p,a/=m,d/=m,u/=p,l=s+u,c=a+d)}return{top:s,left:a,bottom:l,right:c,width:d,height:u}}}function S_(e,t,n){for(var r=Br(e,!0),o=et(e)[t];r;){var i=et(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===qn())break;r=Br(r,!1)}return!1}function yi(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==Q.ghost&&(r||s[i]!==Q.dragged)&&_n(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function ih(e,t){for(var n=e.lastElementChild;n&&(n===Q.ghost||re(n,"display")==="none"||t&&!Lc(n,t));)n=n.previousElementSibling;return n||null}function an(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Q.clone&&(!t||Lc(e,t))&&n++;return n}function w_(e){var t=0,n=0,r=qn();if(e)do{var o=bi(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 IF(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function Br(e,t){if(!e||!e.getBoundingClientRect)return qn();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=re(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 qn();if(r||t)return n;r=!0}}while(n=n.parentNode);return qn()}function DF(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function sh(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 ea;function __(e,t){return function(){if(!ea){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),ea=setTimeout(function(){ea=void 0},t)}}}function BF(){clearTimeout(ea),ea=void 0}function C_(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function T_(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 A_(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!_n(o,t.draggable,e,!1)||o.animated||o===n)){var c=et(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 Ft="Sortable"+new Date().getTime();function HF(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(re(r,"display")==="none"||r===Q.ghost)){e.push({target:r,rect:et(r)});var o=Wn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=bi(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(IF(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=et(c),f=c.prevFromRect,h=c.prevToRect,m=a.rect,p=bi(c,!0);p&&(d.top-=p.f,d.left-=p.e),c.toRect=d,c.thisAnimationDuration&&sh(f,d)&&!sh(u,d)&&(m.top-d.top)/(m.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=$F(m,f,h,o.options)),sh(d,u)||(c.prevFromRect=u,c.prevToRect=d,l||(l=o.options.animation),o.animate(c,m,d,l)),l&&(i=!0,s=Math.max(s,l),clearTimeout(c.animationResetTimer),c.animationResetTimer=setTimeout(function(){c.animationTime=0,c.prevFromRect=null,c.fromRect=null,c.prevToRect=null,c.thisAnimationDuration=null},l),c.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof r=="function"&&r()},s):typeof r=="function"&&r(),e=[]},animate:function(r,o,i,s){if(s){re(r,"transition",""),re(r,"transform","");var a=bi(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,re(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=FF(r),re(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),re(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){re(r,"transition",""),re(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function FF(e){return e.offsetWidth}function $F(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 vi=[],ah={initializeByDefault:!0},ta={mount:function(t){for(var n in ah)ah.hasOwnProperty(n)&&!(n in t)&&(t[n]=ah[n]);vi.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),vi.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";vi.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](Wn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](Wn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){vi.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,dr(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 vi.forEach(function(o){typeof o.eventProperties=="function"&&dr(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return vi.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function WF(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,h=e.putSortable,m=e.extraEventProperties;if(t=t||n&&n[Ft],!!t){var p,v=t.options,C="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!mr&&!Qs?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=h?h.lastPutMode:void 0;var k=Wn(Wn({},m),ta.getEventProperties(r,t));for(var L in k)p[L]=k[L];n&&n.dispatchEvent(p),v[C]&&v[C].call(t,p)}}var qF=["evt"],$t=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=xF(r,qF);ta.pluginEvent.bind(Q)(t,n,Wn({dragEl:H,parentEl:Ge,ghostEl:ce,rootEl:He,nextEl:vo,lastDownEl:Nc,cloneEl:$e,cloneHidden:Hr,dragStarted:ra,putSortable:gt,activeSortable:Q.active,originalEvent:o,oldIndex:Ei,oldDraggableIndex:na,newIndex:Yt,newDraggableIndex:Fr,hideGhostForTarget:M_,unhideGhostForTarget:P_,cloneNowHidden:function(){Hr=!0},cloneNowShown:function(){Hr=!1},dispatchSortableEvent:function(a){Nt({sortable:n,name:a,originalEvent:o})}},i))};function Nt(e){WF(Wn({putSortable:gt,cloneEl:$e,targetEl:H,rootEl:He,oldIndex:Ei,oldDraggableIndex:na,newIndex:Yt,newDraggableIndex:Fr},e))}var H,Ge,ce,He,vo,Nc,$e,Hr,Ei,Yt,na,Fr,xc,gt,Si=!1,Oc=!1,Rc=[],Eo,Cn,lh,ch,k_,L_,ra,wi,oa,ia=!1,Mc=!1,Pc,Et,uh=[],dh=!1,Ic=[],Dc=typeof document<"u",Bc=oh,N_=Qs||mr?"cssFloat":"float",zF=Dc&&!g_&&!oh&&"draggable"in document.createElement("div"),x_=(function(){if(Dc){if(mr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),O_=function(t,n){var r=re(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=yi(t,0,n),s=yi(t,1,n),a=i&&re(i),l=s&&re(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+et(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+et(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[N_]==="none"||s&&r[N_]==="none"&&c+u>o)?"vertical":"horizontal"},UF=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},jF=function(t,n){var r;return Rc.some(function(o){var i=o[Ft].options.emptyInsertThreshold;if(!(!i||ih(o))){var s=et(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},R_=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||rh(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},M_=function(){!x_&&ce&&re(ce,"display","none")},P_=function(){!x_&&ce&&re(ce,"display","")};Dc&&!g_&&document.addEventListener("click",function(e){if(Oc)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Oc=!1,!1},!0);var So=function(t){if(H){t=t.touches?t.touches[0]:t;var n=jF(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[Ft]._onDragOver(r)}}},VF=function(t){H&&H.parentNode[Ft]._isOutsideThisEl(t.target)};function Q(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=dr({},t),e[Ft]=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 O_(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:Q.supportPointer!==!1&&"PointerEvent"in window&&(!Js||oh),emptyInsertThreshold:5};ta.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);R_(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:zF,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?be(e,"pointerdown",this._onTapStart):(be(e,"mousedown",this._onTapStart),be(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(be(e,"dragover",this),be(e,"dragenter",this)),Rc.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),dr(this,HF())}Q.prototype={constructor:Q,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(wi=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,H):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,r=this.el,o=this.options,i=o.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=o.filter;if(e$(r),!H&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Js&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=_n(l,o.draggable,r,!1),!(l&&l.animated)&&Nc!==l)){if(Ei=an(l),na=an(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){Nt({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:r,fromEl:r}),$t("filter",n,{evt:t}),i&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=_n(c,d.trim(),r,!1),d)return Nt({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:r,toEl:r}),$t("filter",n,{evt:t}),!0}),u)){i&&t.preventDefault();return}o.handle&&!_n(c,o.handle,r,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,r){var o=this,i=o.el,s=o.options,a=i.ownerDocument,l;if(r&&!H&&r.parentNode===i){var c=et(r);if(He=i,H=r,Ge=H.parentNode,vo=H.nextSibling,Nc=r,xc=s.group,Q.dragged=H,Eo={target:H,clientX:(n||t).clientX,clientY:(n||t).clientY},k_=Eo.clientX-c.left,L_=Eo.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,H.style["will-change"]="all",l=function(){if($t("delayEnded",o,{evt:t}),Q.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!p_&&o.nativeDraggable&&(H.draggable=!0),o._triggerDragStart(t,n),Nt({sortable:o,name:"choose",originalEvent:t}),Kt(H,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){E_(H,u.trim(),fh)}),be(a,"dragover",So),be(a,"mousemove",So),be(a,"touchmove",So),s.supportPointer?(be(a,"pointerup",o._onDrop),!this.nativeDraggable&&be(a,"pointercancel",o._onDrop)):(be(a,"mouseup",o._onDrop),be(a,"touchend",o._onDrop),be(a,"touchcancel",o._onDrop)),p_&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),$t("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Qs||mr))){if(Q.eventCanceled){this._onDrop();return}s.supportPointer?(be(a,"pointerup",o._disableDelayedDrag),be(a,"pointercancel",o._disableDelayedDrag)):(be(a,"mouseup",o._disableDelayedDrag),be(a,"touchend",o._disableDelayedDrag),be(a,"touchcancel",o._disableDelayedDrag)),be(a,"mousemove",o._delayedDragTouchMoveHandler),be(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&be(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&fh(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._disableDelayedDrag),pe(t,"touchend",this._disableDelayedDrag),pe(t,"touchcancel",this._disableDelayedDrag),pe(t,"pointerup",this._disableDelayedDrag),pe(t,"pointercancel",this._disableDelayedDrag),pe(t,"mousemove",this._delayedDragTouchMoveHandler),pe(t,"touchmove",this._delayedDragTouchMoveHandler),pe(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?be(document,"pointermove",this._onTouchMove):n?be(document,"touchmove",this._onTouchMove):be(document,"mousemove",this._onTouchMove):(be(H,"dragend",this),be(He,"dragstart",this._onDragStart));try{document.selection?Fc(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Si=!1,He&&H){$t("dragStarted",this,{evt:n}),this.nativeDraggable&&be(document,"dragover",VF);var r=this.options;!t&&Kt(H,r.dragClass,!1),Kt(H,r.ghostClass,!0),Q.active=this,t&&this._appendGhost(),Nt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Cn){this._lastX=Cn.clientX,this._lastY=Cn.clientY,M_();for(var t=document.elementFromPoint(Cn.clientX,Cn.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Cn.clientX,Cn.clientY),t!==n);)n=t;if(H.parentNode[Ft]._isOutsideThisEl(t),n)do{if(n[Ft]){var r=void 0;if(r=n[Ft]._onDragOver({clientX:Cn.clientX,clientY:Cn.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=y_(n));P_()}},_onTouchMove:function(t){if(Eo){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=ce&&bi(ce,!0),a=ce&&s&&s.a,l=ce&&s&&s.d,c=Bc&&Et&&w_(Et),u=(i.clientX-Eo.clientX+o.x)/(a||1)+(c?c[0]-uh[0]:0)/(a||1),d=(i.clientY-Eo.clientY+o.y)/(l||1)+(c?c[1]-uh[1]:0)/(l||1);if(!Q.active&&!Si){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-(lh||0),s.f+=d-(ch||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,")");re(ce,"webkitTransform",f),re(ce,"mozTransform",f),re(ce,"msTransform",f),re(ce,"transform",f),lh=u,ch=d,Cn=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ce){var t=this.options.fallbackOnBody?document.body:He,n=et(H,!0,Bc,!0,t),r=this.options;if(Bc){for(Et=t;re(Et,"position")==="static"&&re(Et,"transform")==="none"&&Et!==document;)Et=Et.parentNode;Et!==document.body&&Et!==document.documentElement?(Et===document&&(Et=qn()),n.top+=Et.scrollTop,n.left+=Et.scrollLeft):Et=qn(),uh=w_(Et)}ce=H.cloneNode(!0),Kt(ce,r.ghostClass,!1),Kt(ce,r.fallbackClass,!0),Kt(ce,r.dragClass,!0),re(ce,"transition",""),re(ce,"transform",""),re(ce,"box-sizing","border-box"),re(ce,"margin",0),re(ce,"top",n.top),re(ce,"left",n.left),re(ce,"width",n.width),re(ce,"height",n.height),re(ce,"opacity","0.8"),re(ce,"position",Bc?"absolute":"fixed"),re(ce,"zIndex","100000"),re(ce,"pointerEvents","none"),Q.ghost=ce,t.appendChild(ce),re(ce,"transform-origin",k_/parseInt(ce.style.width)*100+"% "+L_/parseInt(ce.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if($t("dragStart",this,{evt:t}),Q.eventCanceled){this._onDrop();return}$t("setupClone",this),Q.eventCanceled||($e=T_(H),$e.removeAttribute("id"),$e.draggable=!1,$e.style["will-change"]="",this._hideClone(),Kt($e,this.options.chosenClass,!1),Q.clone=$e),r.cloneId=Fc(function(){$t("clone",r),!Q.eventCanceled&&(r.options.removeCloneOnHide||He.insertBefore($e,H),r._hideClone(),Nt({sortable:r,name:"clone"}))}),!n&&Kt(H,i.dragClass,!0),n?(Oc=!0,r._loopId=setInterval(r._emulateDragOver,50)):(pe(document,"mouseup",r._onDrop),pe(document,"touchend",r._onDrop),pe(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(r,o,H)),be(document,"drop",r),re(H,"transform","translateZ(0)")),Si=!0,r._dragStartId=Fc(r._dragStarted.bind(r,n,t)),be(document,"selectstart",r),ra=!0,window.getSelection().removeAllRanges(),Js&&re(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=Q.active,u=xc===l,d=a.sort,f=gt||c,h,m=this,p=!1;if(dh)return;function v(K,se){$t(K,m,Wn({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:f,target:r,completed:k,onMove:function(Z,ve){return Hc(He,n,H,o,Z,et(Z),t,ve)},changed:L},se))}function C(){v("dragOverAnimationCapture"),m.captureAnimationState(),m!==f&&f.captureAnimationState()}function k(K){return v("dragOverCompleted",{insertion:K}),K&&(u?c._hideClone():c._showClone(m),m!==f&&(Kt(H,gt?gt.options.ghostClass:c.options.ghostClass,!1),Kt(H,a.ghostClass,!0)),gt!==m&&m!==Q.active?gt=m:m===Q.active&>&&(gt=null),f===m&&(m._ignoreWhileAnimating=r),m.animateAll(function(){v("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(r===H&&!H.animated||r===n&&!r.animated)&&(wi=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(H.parentNode[Ft]._isOutsideThisEl(t.target),!K&&So(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function L(){Yt=an(H),Fr=an(H,a.draggable),Nt({sortable:m,name:"change",toEl:n,newIndex:Yt,newDraggableIndex:Fr,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=_n(r,a.draggable,n,!0),v("dragOver"),Q.eventCanceled)return p;if(H.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||m._ignoreWhileAnimating===r)return k(!1);if(Oc=!1,c&&!a.disabled&&(u?d||(s=Ge!==He):gt===this||(this.lastPutMode=xc.checkPull(this,c,H,t))&&l.checkPut(this,c,H,t))){if(h=this._getDirection(t,r)==="vertical",o=et(H),v("dragOverValid"),Q.eventCanceled)return p;if(s)return Ge=He,C(),this._hideClone(),v("revert"),Q.eventCanceled||(vo?He.insertBefore(H,vo):He.appendChild(H)),k(!0);var E=ih(n,a.draggable);if(!E||YF(t,h,this)&&!E.animated){if(E===H)return k(!1);if(E&&n===t.target&&(r=E),r&&(i=et(r)),Hc(He,n,H,o,r,i,t,!!r)!==!1)return C(),E&&E.nextSibling?n.insertBefore(H,E.nextSibling):n.appendChild(H),Ge=n,L(),k(!0)}else if(E&&KF(t,h,this)){var g=yi(n,0,a,!0);if(g===H)return k(!1);if(r=g,i=et(r),Hc(He,n,H,o,r,i,t,!1)!==!1)return C(),n.insertBefore(H,g),Ge=n,L(),k(!0)}else if(r.parentNode===n){i=et(r);var y=0,w,b=H.parentNode!==n,S=!UF(H.animated&&H.toRect||o,r.animated&&r.toRect||i,h),_=h?"top":"left",T=S_(r,"top","top")||S_(H,"top","top"),x=T?T.scrollTop:void 0;wi!==r&&(w=i[_],ia=!1,Mc=!S&&a.invertSwap||b),y=ZF(t,r,i,h,S?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Mc,wi===r);var N;if(y!==0){var I=an(H);do I-=y,N=Ge.children[I];while(N&&(re(N,"display")==="none"||N===ce))}if(y===0||N===r)return k(!1);wi=r,oa=y;var O=r.nextElementSibling,M=!1;M=y===1;var V=Hc(He,n,H,o,r,i,t,M);if(V!==!1)return(V===1||V===-1)&&(M=V===1),dh=!0,setTimeout(XF,30),C(),M&&!O?n.appendChild(H):r.parentNode.insertBefore(H,M?O:r),T&&C_(T,0,x-T.scrollTop),Ge=H.parentNode,w!==void 0&&!Mc&&(Pc=Math.abs(w-et(r)[_])),L(),k(!0)}if(n.contains(H))return k(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){pe(document,"mousemove",this._onTouchMove),pe(document,"touchmove",this._onTouchMove),pe(document,"pointermove",this._onTouchMove),pe(document,"dragover",So),pe(document,"mousemove",So),pe(document,"touchmove",So)},_offUpEvents:function(){var t=this.el.ownerDocument;pe(t,"mouseup",this._onDrop),pe(t,"touchend",this._onDrop),pe(t,"pointerup",this._onDrop),pe(t,"pointercancel",this._onDrop),pe(t,"touchcancel",this._onDrop),pe(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Yt=an(H),Fr=an(H,r.draggable),$t("drop",this,{evt:t}),Ge=H&&H.parentNode,Yt=an(H),Fr=an(H,r.draggable),Q.eventCanceled){this._nulling();return}Si=!1,Mc=!1,ia=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),mh(this.cloneId),mh(this._dragStartId),this.nativeDraggable&&(pe(document,"drop",this),pe(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Js&&re(document.body,"user-select",""),re(H,"transform",""),t&&(ra&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),ce&&ce.parentNode&&ce.parentNode.removeChild(ce),(He===Ge||gt&>.lastPutMode!=="clone")&&$e&&$e.parentNode&&$e.parentNode.removeChild($e),H&&(this.nativeDraggable&&pe(H,"dragend",this),fh(H),H.style["will-change"]="",ra&&!Si&&Kt(H,gt?gt.options.ghostClass:this.options.ghostClass,!1),Kt(H,this.options.chosenClass,!1),Nt({sortable:this,name:"unchoose",toEl:Ge,newIndex:null,newDraggableIndex:null,originalEvent:t}),He!==Ge?(Yt>=0&&(Nt({rootEl:Ge,name:"add",toEl:Ge,fromEl:He,originalEvent:t}),Nt({sortable:this,name:"remove",toEl:Ge,originalEvent:t}),Nt({rootEl:Ge,name:"sort",toEl:Ge,fromEl:He,originalEvent:t}),Nt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),gt&>.save()):Yt!==Ei&&Yt>=0&&(Nt({sortable:this,name:"update",toEl:Ge,originalEvent:t}),Nt({sortable:this,name:"sort",toEl:Ge,originalEvent:t})),Q.active&&((Yt==null||Yt===-1)&&(Yt=Ei,Fr=na),Nt({sortable:this,name:"end",toEl:Ge,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){$t("nulling",this),He=H=Ge=ce=vo=$e=Nc=Hr=Eo=Cn=ra=Yt=Fr=Ei=na=wi=oa=gt=xc=Q.dragged=Q.ghost=Q.clone=Q.active=null;var t=this.el;Ic.forEach(function(n){t.contains(n)&&(n.checked=!0)}),Ic.length=lh=ch=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":H&&(this._onDragOver(t),GF(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],_n(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||JF(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];_n(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 _n(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=ta.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&R_(r)},destroy:function(){$t("destroy",this);var t=this.el;t[Ft]=null,pe(t,"mousedown",this._onTapStart),pe(t,"touchstart",this._onTapStart),pe(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(pe(t,"dragover",this),pe(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Rc.splice(Rc.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Hr){if($t("hideClone",this),Q.eventCanceled)return;re($e,"display","none"),this.options.removeCloneOnHide&&$e.parentNode&&$e.parentNode.removeChild($e),Hr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Hr){if($t("showClone",this),Q.eventCanceled)return;H.parentNode==He&&!this.options.group.revertClone?He.insertBefore($e,H):vo?He.insertBefore($e,vo):He.appendChild($e),this.options.group.revertClone&&this.animate(H,$e),re($e,"display",""),Hr=!1}}};function GF(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Hc(e,t,n,r,o,i,s,a){var l,c=e[Ft],u=c.options.onMove,d;return window.CustomEvent&&!mr&&!Qs?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||et(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function fh(e){e.draggable=!1}function XF(){dh=!1}function KF(e,t,n){var r=et(yi(n.el,0,n.options,!0)),o=A_(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 YF(e,t,n){var r=et(ih(n.el,n.options.draggable)),o=A_(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 ZF(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&&Pc<c*o){if(!ia&&(oa===1?l>u+c*i/2:l<d-c*i/2)&&(ia=!0),ia)f=!0;else if(oa===1?l<u+Pc:l>d-Pc)return-oa}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return QF(t)}return f=f||s,f&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function QF(e){return an(H)<an(e)?1:-1}function JF(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 e$(e){Ic.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&Ic.push(r)}}function Fc(e){return setTimeout(e,0)}function mh(e){return clearTimeout(e)}Dc&&be(document,"touchmove",function(e){(Q.active||Si)&&e.cancelable&&e.preventDefault()}),Q.utils={on:be,off:pe,css:re,find:E_,is:function(t,n){return!!_n(t,n,t,!1)},extend:DF,throttle:__,closest:_n,toggleClass:Kt,clone:T_,index:an,nextTick:Fc,cancelNextTick:mh,detectDirection:O_,getChild:yi,expando:Ft},Q.get=function(e){return e[Ft]},Q.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&&(Q.utils=Wn(Wn({},Q.utils),r.utils)),ta.mount(r)})},Q.create=function(e,t){return new Q(e,t)},Q.version=PF;var tt=[],sa,hh,ph=!1,gh,bh,$c,aa;function t$(){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?be(document,"dragover",this._handleAutoScroll):this.options.supportPointer?be(document,"pointermove",this._handleFallbackAutoScroll):r.touches?be(document,"touchmove",this._handleFallbackAutoScroll):be(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?pe(document,"dragover",this._handleAutoScroll):(pe(document,"pointermove",this._handleFallbackAutoScroll),pe(document,"touchmove",this._handleFallbackAutoScroll),pe(document,"mousemove",this._handleFallbackAutoScroll)),I_(),Wc(),BF()},nulling:function(){$c=hh=sa=ph=aa=gh=bh=null,tt.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($c=n,r||this.options.forceAutoScrollFallback||Qs||mr||Js){yh(n,this.options,a,r);var l=Br(a,!0);ph&&(!aa||i!==gh||s!==bh)&&(aa&&I_(),aa=setInterval(function(){var c=Br(document.elementFromPoint(i,s),!0);c!==l&&(l=c,Wc()),yh(n,o.options,c,r)},10),gh=i,bh=s)}else{if(!this.options.bubbleScroll||Br(a,!0)===qn()){Wc();return}yh(n,this.options,Br(a,!1),!1)}}},dr(e,{pluginName:"scroll",initializeByDefault:!0})}function Wc(){tt.forEach(function(e){clearInterval(e.pid)}),tt=[]}function I_(){clearInterval(aa)}var yh=__(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=qn(),c=!1,u;hh!==n&&(hh=n,Wc(),sa=t.scroll,u=t.scrollFn,sa===!0&&(sa=Br(n,!0)));var d=0,f=sa;do{var h=f,m=et(h),p=m.top,v=m.bottom,C=m.left,k=m.right,L=m.width,E=m.height,g=void 0,y=void 0,w=h.scrollWidth,b=h.scrollHeight,S=re(h),_=h.scrollLeft,T=h.scrollTop;h===l?(g=L<w&&(S.overflowX==="auto"||S.overflowX==="scroll"||S.overflowX==="visible"),y=E<b&&(S.overflowY==="auto"||S.overflowY==="scroll"||S.overflowY==="visible")):(g=L<w&&(S.overflowX==="auto"||S.overflowX==="scroll"),y=E<b&&(S.overflowY==="auto"||S.overflowY==="scroll"));var x=g&&(Math.abs(k-o)<=s&&_+L<w)-(Math.abs(C-o)<=s&&!!_),N=y&&(Math.abs(v-i)<=s&&T+E<b)-(Math.abs(p-i)<=s&&!!T);if(!tt[d])for(var I=0;I<=d;I++)tt[I]||(tt[I]={});(tt[d].vx!=x||tt[d].vy!=N||tt[d].el!==h)&&(tt[d].el=h,tt[d].vx=x,tt[d].vy=N,clearInterval(tt[d].pid),(x!=0||N!=0)&&(c=!0,tt[d].pid=setInterval(function(){r&&this.layer===0&&Q.active._onTouchMove($c);var O=tt[this.layer].vy?tt[this.layer].vy*a:0,M=tt[this.layer].vx?tt[this.layer].vx*a:0;typeof u=="function"&&u.call(Q.dragged.parentNode[Ft],M,O,e,$c,tt[this.layer].el)!=="continue"||C_(tt[this.layer].el,M,O)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==l&&(f=Br(f,!1)));ph=c}},30),D_=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 vh(){}vh.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=yi(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:D_},dr(vh,{pluginName:"revertOnSpill"});function Eh(){}Eh.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:D_},dr(Eh,{pluginName:"removeOnSpill"}),Q.mount(new t$),Q.mount(Eh,vh);var B_=100,H_=Symbol("EMULATED_DRAG_EVENT");function n$(e,t){return e[H_]===t}var F_=class{constructor(){A(this,"_target",null),A(this,"_interval",0),A(this,"_x",0),A(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[H_]=this,It(()=>e.dispatchEvent(i)),!i.defaultPrevented}start(e,t,n){const r=document.elementFromPoint(e,t);return r&&!this._target&&this._fireDragEvent(r,"dragstart",e,t,n)?(this._target=r,this._x=e,this._y=t,this._interval=setInterval(()=>{this._fireDragEvent(r,"drag",this._x,this._y,n)},B_),!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)},B_)))}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 qc(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 la(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function Sh(e){const t=document.createElement("div");t.replaceChildren(...Le(e.atomHTML));const n=t.querySelector("img");if(!n)return kt(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=la(e.targetAtom):r=e.targetAtom.parentNode?la(e.targetAtom.parentNode):la(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?qc(t):n.style.maxWidth=r+"px",kt(t)}function $_(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=la(n);o.style.display=a;const c=s>=la(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?qc(e):o.style.maxWidth=c+"px",!0)}function W_(e,t){const n=e.atomHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Le(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")?qc(n):(r.style.maxWidth=i+"px",r.style.width="100%"),tr(e.targetElem,e.targetPlace,`
|
|
52
|
-
`+kt(n)+`
|
|
53
|
-
`),t()},o.src=r.getAttribute("src")||"",!1}function wh(e){const t=e.blockHTML.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");t.replaceChildren(...Le(e.blockHTML));const n=t.querySelector("img.em-countdown");if(!n)return kt(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()),Ht(n,"src",i.href),n.setAttribute("em-cd-settings",i.search.substring(1)),kt(t)}function zc(e){const t=e.blockIsTr?document.createElement("table"):document.createElement("div");return t.replaceChildren(...Le(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(" ")}),qc(t),kt(t)}function r$(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var o$=class{constructor(){A(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=Q.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},$r=new o$,i$=Number.MAX_VALUE,s$=0;function q_(e){return typeof e=="object"?e.name:e}var a$=class{constructor(){A(this,"emulator",new F_),A(this,"x",0),A(this,"y",0),A(this,"_tracked",!1),A(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)))}},ln=new a$,z_=Q.prototype,l$=pt(z_._onDragOver);function c$(e){$r.gc(),ln.track(),z_._onDragOver=l$;const t=document.querySelectorAll("[em=group]");Q.prototype._emulateDragOver=function(){};let n;const r=()=>{e.commit(!0)};function o(a,l){let c;function u(m,p){let v=null,C=Number.MAX_VALUE;const k=q_(Q.active?.options.group);for(const[L,E]of $r.entries())if(q_(E.options.group)===k&&(!a||c&&a(L,c)!==!1)){for(const g of L.children)if(!g.classList.contains("sortable-drag")){const y=g.getBoundingClientRect(),w=m<y.left?y.left-m:m>y.right?m-y.right:0,b=p<y.top?y.top-p:p>y.bottom?p-y.bottom:0;if(w<i$||b<s$){const S=Math.sqrt(w*w+b*b);S<C?(v=[E,g],C=S):S===C&&v[1].contains(g)&&(v=[E,g])}}}return v}function d(m){const p="TouchEvent"in window&&m instanceof TouchEvent?m.touches[0]:m,v=u(p.clientX,p.clientY);if(v){const[L,E]=v,g=E.getBoundingClientRect();var C={clientX:g.left+g.width/2,clientY:p.clientY};for(var k in m)m.hasOwnProperty(k)&&(C[k]=m[k]);C.target=E,C.rootEl=E.parentNode,C.preventDefault=void 0,C.stopPropagation=void 0,L._onDragOver(C)}}return{onStart:m=>{c=m.item,Q.ghost&&Ef(Q.ghost),r$(Q.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",d),window.addEventListener("touchmove",d),ln.emulator.start(ln.x,ln.y)?(window.addEventListener("mousemove",ln.handleMouseMove),n&&(n.dispose(),n=void 0)):m.preventDefault()},onEnd:m=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d);let p=!1;m.from===m.to?ln.emulator.end(ln.x,ln.y):(p=!!l?.(m),ln.emulator.drop(ln.x,ln.y)),window.removeEventListener("mousemove",ln.handleMouseMove),e.endTextUpdate(),m.from===m.to&&m.oldIndex!==m.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&&!$r.get(l)&&$r.create(l,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${Ve.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),$r.get(l)||$r.create(l,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${Ve.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&&In(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=>$_(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),$r.get(c)||$r.create(c,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${Ve.drag}`,...o(),onMove:r}))}}}var u$=class{constructor(){A(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)}},_h={get textDocument(){return R(Mt,rs)},commit:ao};function d$(){const e=j.get("applicationTheme")||"light";let t=!1;try{_h.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?fd4347fc";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?fd4347fc`;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{_h.textDocument.endUpdate()}t&&_h.commit(!1)}var Uc=".em-prevent-action";function f$(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 m$(e){const t=document.body;if(!t)return;const n=e.isAppLocked()||e.isIntegratorLocked();(e.isAppLocked()!==t.classList.contains("mceNonEditable")||e.isIntegratorLocked())&&Be(t,!!n,"mceNonEditable"),Be(t,!!j.get("previewPage"),"em-sandbox-preview")}function h$(e){const{htmlDocument:t,commit:n,focusController:r}=e,o=LF(()=>c$(t));t.onChange(a=>{a.some(l=>l.added.length||l.characterDataChanged||l.reordered?.length||l.reparented?.length)&&o()}),t.onChange(()=>{d$()}),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 u$;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(AF(e.applicationElementSettingsSet)),t.onChange(()=>{e.selectionLock.isLocked()||(f$(e),m$(e.editLock))})}function p$(e,t,n){if(!(e instanceof Element)||!e.closest(".em-prevent-action"))return;const r=document.querySelector(".em-editor-wrapper");if(!document.querySelector("[em-edit]")&&!r)return;const o=n.acquire();try{document.querySelectorAll("[em-edit]").forEach(i=>i.removeAttribute("em-edit")),r&&(r.style.display="none"),It(()=>document.querySelectorAll("editor").forEach(i=>i.blur())),t.forget()}finally{o.releaseLater()}}function g$(e,t){const n=pt(r=>p$(r.target,e,t));return window.addEventListener("mousedown",n,!0),window.addEventListener("click",n,!0),{dispose(){window.removeEventListener("mousedown",n,!0),window.removeEventListener("click",n,!0)}}}var b$={name:"sandbox.fingerprint",provides:[Ho],awaits:{services:[Y,Ne]},setup(e){const t=R(e,Y),n=R(e,Ne),r=DP(o=>t.getOuterHtml(o));BP(r,n),g$(r,n),e.inject(Ho,r)}},y$={name:"sandbox.setCursor",provides:[yt],awaits:{services:[Y,pn,ot]},setup(e){const t={HTMLDocument:R(e,Y),documentMapping:R(e,pn),remoteDocument:R(e,ot),messageService:z};e.inject(yt,n=>FP(n,t))}},v$={name:"sandbox.wrapEditor",provides:[gn],awaits:{services:[Y,pn,Te]},setup:e=>e.inject(gn,wF({commit:dt(e),htmlDocument:R(e,Y),documentMapping:R(e,pn)}))};function E$(e){const{container:t}=e;Vs.registerAll({MessageService:()=>z,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(Y),SyncServiceInternals:()=>t.getInstance(ot),TextDocument:()=>t.getInstance(rs),Mapping:()=>t.getInstance(pn),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&Vs.initFeatures(e.features)}var S$=e=>e,w$=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
|
-
}`,_$=class extends Ee{constructor(e){super(),A(this,"htmlDocument",void 0),A(this,"_localized",{...l2(S$)}),A(this,"_styles",""),A(this,"_onChangeLocaleEmitter",new ge),A(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)}}}),A(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=w$(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 C$(e){const t=new _$(e),n=r=>{t.setTranslations(r)};return t.addDisposable(z.addListener(de.SANDBOX_TRANSLATIONS,n)),t}function T$(e,t,n){const r=new Ee;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 A$(e){const t=new Ee,n=r=>{n$(r,e)||z.send(de.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 k$(){const e=new F_,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 Ee;return n.addDisposable(z.addListener(de.SANDBOX_DRAG_EVENT,t)),n.addDisposable(A$(e)),n}function L$(){return NodeFilter.FILTER_ACCEPT}function N$(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,L$);let r;for(;r=n.nextNode();)t.push(r)}return t}var x$=new dv,O$=new Set;function U_(e){return e?x$.getUnescapedText(e,!0,O$)!==e:!1}function j_(e){return e.nodeValue?U_(e.nodeValue):!1}function R$(e){const t=e.previousSibling;if(t instanceof HTMLSpanElement&&t.classList.contains("em-code")&&t.classList.contains("em-code_var"))return t}function ca(e){const t=e?.nextSibling;if(t instanceof Comment&&j_(t))return t}function V_(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 M$(){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(V_(r,i)===0&&V_(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 P$=e=>{if(!e)return;(!e.firstChild||e.firstChild.nodeType!==Node.TEXT_NODE)&&(e.textContent="",e.appendChild(document.createTextNode(" ")));const t=e.firstChild;t.textContent===""&&(t.textContent=" ");const n=window.getSelection();if(!n)return;const r=document.createRange();r.setStart(t,1),r.collapse(!0),n.removeAllRanges();const o=e.closest('[contenteditable="true"]');It(()=>{n.addRange(r),o?.focus()})},G_=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},I$=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=G_(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},D$=(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 B$(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 X_(e){const t=e.startContainer;return Dt(t)?t:Dt(t.parentNode)?t.parentNode:null}function H$(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 F$(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function $$({em:e,side:t}){const n=t==="after"?G_(e):F$(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&&ws(o,r)}function W$(e){const t=k=>e.renderOnly(k);let n=null,r=null,o=!1;const i=k=>!!n&&n.em===k.em&&n.side===k.side&&r===(k.side==="after"?"ArrowLeft":"ArrowRight"),s=k=>{jP(document,t,k)&&e.commit(!1),VP(document,t,k)},a=()=>{const k=window.getSelection();if(o||!k?.rangeCount)return;const L=k.getRangeAt(0),E=e.ownership?B$(L,e.ownership,r):null;if(E){n=null;const w=xf(E.node,E.side,t);s(w);return}const g=Uv(L);if(g&&i(g)){n=null,$$(g),s();return}if(g){const w=Dl(g.em,g.side,t);n=g,s(w);return}const y=L.collapsed?X_(L):null;n=y?H$(y):null,s(y)},l=()=>{const k=window.getSelection(),L=k?.rangeCount?X_(k.getRangeAt(0)):null;return!!L&&e.applyOwn(()=>GP(L,t))!==null},c=k=>{!k.isComposing&&l()&&e.commit(!0)},u=()=>{o=!0},d=()=>{o=!1,l(),e.commit(!0)},f=k=>{r=k.key},h=k=>{const L=window.getSelection();L?.rangeCount&&k?.closest?.('[contenteditable="true"]')&&Zv(L.getRangeAt(0),t)},m=k=>{k.key?.length===1&&!k.ctrlKey&&!k.metaKey&&!k.altKey&&h(k.target)},p=k=>{k.inputType==="insertCompositionText"&&h(k.target)},v=()=>{r=null},C=k=>Of(k,t);return e.holdCaretAfterBreak=C,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",m,!0),window.addEventListener("beforeinput",p,!0),{dispose(){e.holdCaretAfterBreak===C&&(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",m,!0),window.removeEventListener("beforeinput",p,!0)}}}function Ch(){return j.get("commonStyles")}var jc={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"},q$={"Sans Serif":"sans-serif",Serif:"serif"},K_=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function _i(e){return e.querySelector(K_)}function ua(e){return Array.from(e.querySelectorAll(K_))}function Th(e){const t=e.closest('[em="block"]');return t?_i(t)??t.querySelector("td"):null}function Y_(e){const t=e.closest('[em="block"]');return!!t&&(e===t||ua(t).includes(e))}var z$=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Wr=(e,t)=>{z$()},qr=new Map;function U$(e){return qr.get(e.toLowerCase())?.[0]}function Ah(e){return qr.get(e.toLowerCase())??[]}function j$(){return qr.size>0}function Z_(){return[...qr.values()].map(e=>e[0])}function V$(e){qr=new Map;for(const t of e??[]){const n=t.family.toLowerCase();qr.set(n,[...qr.get(n)??[],t])}return qr}var G$=e=>{const t=V$(e);Wr("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function X$(){const e=new Ee;return e.addDisposable(z.addListener(de.SANDBOX_SET_PROJECT_FONTS,G$)),e}var K$={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function Q_(e){return e.category==="serif"?"serif":"sans-serif"}function Vc(e,t){const n=U$(t);return n?(e.style.fontFamily=K$[Q_(n)],!0):!1}var Y$=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,Z$=/url\(\s*(['"]?)(.*?)\1\s*\)/,Q$=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function kh(e){return Array.from(e.matchAll(Y$),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:Q$(n.get("font-family")??""),src:Z$.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function J_(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function eC(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 Lh(){return Mt.getInstance(Tb)?.()??document.head}function Nh(){return Lh().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function We(){if(!Nh()){const e=document.createElement("style");e.setAttribute("em","styles"),Lh().append(e)}}function J$(){const e=Lh(),t=()=>{const r=Nh(),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 Gc(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function tC(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 xh(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 Oh(e){const t=e.flatMap(n=>n instanceof Element?[...n.querySelectorAll('style[em="styles"]')]:[]);return t.forEach(n=>n.remove()),[...e,...t]}function Ci(e){return(e||"").replace(/\s/g,"")}function Xc(e,t){return`em-font-${Ci(e)}-${Ci(t)}`}function nC(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Rh(e){return Xc(e[2]||"",e[3]||"")}var Mh="em-font-custom";function eW(e){return e[1]==="Project Fonts"}function Ph(e,t){eW(t)&&e.classList.add(Mh)}function da(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function Ih(e,t){t.forEach(n=>e.style.removeProperty(n))}function rC(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+")",Ht(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 Kc(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=G(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||(G(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=G(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=G(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=G(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=G(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=G(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=G(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=G(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=G(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=G(e.style.borderLeftColor)||null)}return t}function Ti(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 fa(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]&&G(n[0])||"",inset:n[3]==="inset"||n[4]==="inset"||n[5]==="inset"})}return t}function Fe(e){return e==null||e===""}function Dh(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!Fe(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&&(!Fe(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&&(!Fe(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&&(!Fe(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&&(!Fe(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 oC(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!Fe(r.hOffset)&&!Fe(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=Fe(r.blurRadius)?"":r.blurRadius+"px ",o+=Fe(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function Ai(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(Fe(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",Fe(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",Fe(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",Fe(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function iC(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+=iC(n)}),t}function sC(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=>sC(r,t,n))}function tW(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 aC=/\[if[^\]]*mso[^\]]*\]/i,lC="[if gte mso 9]></v:textbox></v:rect><![endif]";function nW(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 rW(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function oW(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 iW(e){const t=oW(e),n=Mt.getInstance(Ab);return n?n(e,t):t}function sW(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 cC(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function ma(e){if(!cC(e))return!1;const t=e.nodeValue||"";return aC.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function Bh(e){if(!cC(e))return!1;const t=e.nodeValue||"";return aC.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function Hh(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function uC(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function dC(e){for(const t of Array.from(e.childNodes))(ma(t)||Bh(t))&&e.removeChild(t)}function ha(e,t="inside"){return t==="around"?ma(Hh(e)):Array.from(e.childNodes).some(n=>ma(n))}function fC(e,t="inside"){if(t==="around"){const n=e.parentNode;if(!n)return;const r=Hh(e),o=uC(e);ma(r)&&n.removeChild(r),Bh(o)&&n.removeChild(o);return}dC(e)}function mC(e,t="inside"){const n=nW(e);if(!n){fC(e,t);return}const r=sW(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),rW(e),iW(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const s=Hh(e);ma(s)&&i.removeChild(s);const a=uC(e);Bh(a)&&i.removeChild(a),i.insertBefore(o.createComment(r),e),i.insertBefore(o.createComment(lC),e.nextSibling);return}dC(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(lC))}}function pa(e,t,n="inside"){t?.outlookBackground===!0?mC(e,n):t?.outlookBackground===!1?fC(e,n):ha(e,n)&&tW(t)&&mC(e,n)}var Fh=/v:roundrect/i,$h=/\[if\s*!\s*mso\]/i,hC=/^\s*(?:<!)?\[endif\]\s*$/i,Wh=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],aW=[...Wh,"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 ki(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function qh(e){const t=[],n=r=>{r.childNodes.forEach(o=>{ki(o)&&Fh.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function pC(e,t){const n=zr(e);if(!n)return!1;const r=n.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(r))return!1;const o=bC((t||"").replace(/\s+/g," ").trim());return n.nodeValue=r.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(i,s,a)=>`${s}${o}${a}`),!0}function zr(e){for(const t of Array.from(e.childNodes)){if(ki(t)&&Fh.test(t.nodeValue||""))return t;const n=zr(t);if(n)return n}return null}function gC(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function lW(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function zn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function cW(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 bC(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function uW(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of Wh){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 dW(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 Wh){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 fW(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function zh(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(fW(t))return t;return null}function Uh(e){return e?!!zh(e)||!!zr(e):!1}function mW(e,t){for(const n of aW){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 hW(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function yC(e,t){const n=zh(t);return n?(mW(n,t),hW(n),qh(t).forEach(r=>r.parentNode?.removeChild(r)),jh(t),!0):!1}function pW(e){for(const t of e){const n=t.nodeValue||"";if(!Fh.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?zn(i[1]):0,height:s?zn(s[1]):0,arcsize:a?zn(a[1]):0}}return{width:0,height:0,arcsize:0}}function gW(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:G(o)||o||"#000000",weight:`${i}px`,dash:s}}var bW=new Set(["bold","bolder","600","700","800","900"]);function yW(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&&bW.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 vW(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}">${bC(e.label)}</center></v:roundrect><![endif]`}function jh(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(ki(o)){const i=o.nodeValue||"";($h.test(i)||hC.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function EW(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&yC(t,n),qh(t).forEach(r=>r.parentNode?.removeChild(r)),jh(t),n&&dW(t,n)}function SW(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=gC(e);ki(r)&&$h.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=lW(e);ki(o)&&hC.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function wW(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function _W(e,t){if(t?.width?.value&&t.width.dim==="px")return zn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?zn(n):0}function CW(e,t){if(t?.height?.value&&t.height.dim==="px")return zn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?zn(n):zn(e.style.height)}function TW(e,t){return e?.borderRadius&&e.borderRadius.all!=null?zn(e.borderRadius.all):zn(t.style.borderRadius)}function AW(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 Vh(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=qh(n),i=cW(r,o),s=pW(o);yC(n,r),uW(n,r),o.forEach(C=>C.parentNode?.removeChild(C)),jh(n);const a=_W(n.closest("table"),t)||s.width,l=CW(n,t)||s.height,c=TW(t,r),u=yW(r),d=gW(r),f=AW(c,a,l)||s.arcsize,h={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:wW(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||""};SW(r);const m=n.ownerDocument;if(!m)return;const p=gC(r),v=m.createComment(vW(h));ki(p)&&$h.test(p.nodeValue||"")&&p.parentNode?p.parentNode.insertBefore(v,p):n.insertBefore(v,n.firstChild)}function Yc(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function Un(e){return typeof e=="number"&&Number.isFinite(e)}function kW(e){return!e||typeof e!="object"?!1:Un(e.all)||Un(e.top)||Un(e.right)||Un(e.bottom)||Un(e.left)}function LW(e,t){const n=Un(t.all)?t.all:void 0,r=Un(t.top)?t.top:n,o=Un(t.right)?t.right:n,i=Un(t.bottom)?t.bottom:n,s=Un(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 vC(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 EC(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function SC(e){return e.stylesheet??a2(e.source_url)}function NW(e){return`/* ${`em-project-font-${Ci(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 xW=e=>J_({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function OW(e,t){if(vC(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),EC(n)}function ga(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=Xc(r,o);if(n==="Project Fonts"){const d=Ah(r),f=d[0];if(Wr("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!f,faces:d}),f){We();const h=document.querySelector('style[em="styles"]'),m=[...new Set(d.filter(SC).map(p=>p.source_url))];if(m.forEach(p=>OW(p,i)),h){const p=new Set(kh(h.textContent??"").map(J_)),v=d.filter(E=>!SC(E)).filter(E=>!p.has(xW(E))).map(NW).join(`
|
|
79
|
-
`),C=v!=="";C&&h.insertAdjacentHTML("afterbegin",`${v}
|
|
80
|
-
`);const k=`.${nC(i)} {`,L=!h.textContent?.includes(k);if(L){const E=jc[o],g=(E||f.weight).replace(/i$/g,""),y=E?E.endsWith("i"):f.style!=="normal";let w=`font-family: ${JSON.stringify(f.family)}, ${Q_(f)}!important;`;w+=` font-weight: ${g}!important;`,y&&(w+=" font-style: italic!important;"),h.insertAdjacentHTML("beforeend",`
|
|
81
|
-
${k} ${w} }`)}Wr("iframe: project font attached",{emClass:i,stylesheetUrls:m,faceInserted:C,classInserted:L})}else Wr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{wo({elem:document.documentElement},t),Ur(t),t&&t(!1)},0);return}Wr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{wo({elem:document.documentElement},t),Ur(t)},0);return}if(!vC(i)){const d=document.createElement("link");d.setAttribute("rel","stylesheet");const f=jc[o]||"400",h=f.indexOf("i")>-1,m=f.replaceAll("i","");d.setAttribute("href",`https://fonts.googleapis.com/css2?family=${r}:ital,wght@${h?"1":"0"},${m}&display=swap`),d.setAttribute("em-class",i),EC(d)}We();const s=jc[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${q$[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
|
-
.${nC(i)} { ${c} }`),setTimeout(()=>{wo({elem:document.documentElement},t),Ur(t)},0)}function RW(e){const t=Ci(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function Ur(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=kh(n).filter(o=>Ah(o.family).length>0&&!RW(o.family));!t||r.length===0||(t.textContent=eC(n,r),Wr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function wo(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 Gh(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],wo({elem:document.documentElement},n),Ur(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"&&Vc(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(Xc(t[2],t[3])),ga({fontFamilyArray:t},n))}function wC(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 _C(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 CC(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 ba(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=Ch(),r=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");return r.replaceChildren(...Le(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=Yc((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),Gh(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":ba(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=Yc((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),Gh(i,s,t),CC(i,n.headings?.letterSpacing||0),wC(i,n.headings?.bold||!1),_C(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":ba(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":ba(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=Yc((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),Gh(i,s,t);const l=i.closest("td"),c=!!l&&!!zr(l)&&!zr(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"),CC(i,n.buttons?.letterSpacing||0),wC(i,n.buttons?.bold||!1),_C(i,n.buttons?.italic||!1);const f=i.closest('[em="atom"] > tr > td'),h=i.closest("table");f?.style.paddingTop?f.style.paddingTop=(n.buttons?.marginTop||0)+"px":h?.previousElementSibling&&ba(h.previousElementSibling,n.buttons?.marginTop||0),f?.style.paddingBottom?f.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":h?.nextElementSibling&&ba(h.nextElementSibling,n.buttons?.marginBottom||0);const m=n.buttons?.padding||{};m.all&&(i.style.padding=m.all+"px"),m.top&&(i.style.paddingTop=m.top+"px"),m.right&&(i.style.paddingRight=m.right+"px"),m.bottom&&(i.style.paddingBottom=m.bottom+"px"),m.left&&(i.style.paddingLeft=m.left+"px"),u&&(n.buttons?.border&&Dh({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&Ai({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&Vh(i,{backgroundColor:d})}}else{const s=Yc(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=>{ua(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?kt(r):kt(r.querySelector("tbody")||r)}function Xh(e){const t=Ch(),n=e.html.substring(0,3)==="<tr"?document.createElement("table"):document.createElement("div");n.replaceChildren(...Le(e.html)),n.querySelector('[em="block"]')&&t.block?.backgroundColor&&n.querySelectorAll('[em="block"]').forEach(o=>{ua(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return kW(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(ua).forEach(o=>{LW(o,r)}),n.tagName==="DIV"?kt(n):kt(n.querySelector("tbody")||n)}var MW=e=>{for(const t of Object.keys(jc))if(Ci(t)===e)return t;return e};function PW(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(Ah(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=kh(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=eC(n,o),Wr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function IW(e){if(!j$())return;const t=document.head.innerHTML,n=new Set;for(const r of Z_()){PW(r.family);const o=`em-font-${Ci(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=MW(a);ga({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&Wr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:Z_().map(r=>r.family)}),Ur(),e&&document.head.innerHTML!==t&&e(!1)}function DW(e,t){const n=new Ee,r=()=>{requestAnimationFrame(()=>{IW(t)})};return n.addDisposable(z.addListener(de.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function AC(){z.send({operation:"sandbox_resized"})}function BW(e,t){const n=new Ee,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{AC(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(In(c))return gx(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 HW(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 FW=/^(?:ant|vscode|monaco|docs)-/;function $W(e){return FW.test(e)}function WW(){const e="ub".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 qW=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function zW(){return qW}var UW=new Set;function jW(e,t,n=UW){return e.startsWith(`${t}-`)?!1:!$W(e)&&!n.has(e)}function VW(e,t){return`--${t}-${e}`}function GW(e){const t=WW();return jW(e,t,zW())?VW(e,t):`--${e}`}function XW(e){const t=new Ee;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])=>` ${GW(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(z.addListener(de.SANDBOX_SET_THEME_VARIABLES,r)),t}var kC=4e3;function KW(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:kC});return}window.setTimeout(e,kC)}function YW(e){const t=e.onDocumentShown(()=>{t.dispose(),KW(()=>{vE().catch(()=>{})})})}var ZW={name:"sandbox.crossDomainDrag",setup:()=>k$()},QW={name:"sandbox.themeVariables",awaits:{services:[Y]},setup:e=>XW(R(e,Y))},JW={name:"sandbox.projectFonts",awaits:{services:[ot,Te]},setup(e){X$();const t=dt(e);DW(R(e,ot),n=>t(n))}},eq={name:"sandbox.pasteSanitizerPrewarm",awaits:{services:[Do]},setup:e=>YW(R(e,Do))},tq={name:"sandbox.variableSelection",setup:()=>M$()},nq={name:"sandbox.emReplaceCaret",awaits:{services:[Y]},setup:e=>W$(R(e,Y))},rq={name:"sandbox.resizeWatch",awaits:{services:[Y,ot]},setup(e){BW(R(e,Y),R(e,ot)),HW()}},oq={name:"sandbox.reset",awaits:{services:[Y]},setup:e=>gM(R(e,Y))},iq={name:"sandbox.correct",awaits:{services:[Y,it,ot]},setup:e=>T$(R(e,Y),R(e,it).controller,R(e,ot))},sq={name:"sandbox.extensionScripts",awaits:{services:[Y,is]},setup:e=>K7(R(e,Y),{surface:R(e,is)})},aq={name:"sandbox.localization",provides:[Nd],awaits:{services:[Y]},setup:e=>e.inject(Nd,C$(R(e,Y)))};function lq(e=[]){return{name:"sandbox.extensions",awaits:{services:[it,is,Y]},setup:t=>E$({container:t,focusController:R(t,it).controller,surface:R(t,is),features:[...e]})}}function cq(e){const t=n=>function r(o,i=10){if(!uq(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 uq(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function LC(e){return/^(data|blob):/i.test(e.trimStart())}function NC(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function dq(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 fq(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${NC(o,t)}${i})`)}function Kh(e,t,n){const r=e.toLowerCase();return r==="srcset"?dq(t,n):r==="style"?fq(t,n):NC(t,n)}var mq=["src","___src","background","poster","srcset","style"];function Zc(e){return LC(e)?e:Sc(e)}function hq(){const e=new Map,t=n=>{if(LC(n))return n;const r=Zc(n),o=e.get(r);return o?eH(r).replace(new RegExp(`${Ys}=\\d+`),`${Ys}=${o}`):n};return{transform:{name:"em-version",attributes:mq,render:(n,r)=>n&&Kh(r.attribute,n,t),serialize:(n,r)=>n&&Kh(r.attribute,n,Zc)},requestReload(n){e.set(Zc(n.trim()),String(Date.now()))},isPending(n){return e.has(Zc(n.trim()))},clear(){e.clear()}}}var xC=["src","background","poster","srcset","style"];function Yh(e,t=document){const n=xC.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of xC){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=Qm(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function pq(e,t){const{pipeline:n,htmlDocument:r}=t,o=hq(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>Yh(n)))},clear(){o.clear()}};return e.inject(Ld,s),{reload:s,dispose(){i.dispose(),o.clear(),bn(e,Ld)}}}var gq=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],bq="/static/media/",yq="empty-image";function vq(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function OC(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(bq)?t:null}function Eq(e){return!!e&&OC(e)!==null}function Sq(e){if(!e)return!1;if(gq.includes(e))return!0;const t=OC(e);return t===null?!1:vq(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===yq}var wq=1e4;function _q(e=wq){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 Cq=3e3,Tq=["src","___src","background","poster","srcset","style"],Zh=e=>e.startsWith("blob:"),Qc="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 Aq(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${Qc}${t}`}var kq=new RegExp(String.raw`blob:[^\s"'()<>]+|`+Qc.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function RC(e){if(e.startsWith(Qc))try{return decodeURIComponent(e.slice(130))}catch{return}}function Lq(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:vM(n)}function Nq(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function xq(e){const t=e.store??_q(),n=e.answerTimeoutMs??Cq,r=new Map,o=new Set;let i={enabled:!1,sourceHosts:[]},s=!1,a=!1;const l={hits:0,misses:0,refused:0,failed:0},c=m=>{const p=Nq(m);return p?p===window.location.hostname||i.sourceHosts.includes(p):!1},u=(m,p=!1)=>{if(r.has(m)||!p&&(o.has(m)||t.peek(m)))return;const v=z.sendAsync(de.APPLICATION_CANVAS_IMAGE_GET,p?{url:m,fresh:p}:{url:m}).then(k=>{const L=k;if(L&&"blob"in L){t.acquire(m,L.blob),l.hits+=1;return}o.add(m),l.refused+=1}).catch(()=>{o.add(m),l.failed+=1}),C=Promise.race([v,new Promise(k=>{setTimeout(()=>{r.has(m)&&(s=!0,o.add(m),l.failed+=1),k()},n)})]).then(()=>{r.delete(m),e.refresh()});r.set(m,C)},d=m=>{const p=RC(m);if(p!==void 0)return d(p);if(!m||a||Zh(m)||m.startsWith("data:")||Eq(m))return m;const v=t.peek(m);return v||(s||!i.enabled||o.has(m)||!c(m)?m:(l.misses+=1,u(m),Aq(m)))},f=m=>Zh(m)?t.sourceOf(m)??m:RC(m)??m,h=(m,p,v)=>Kh(p.attribute,m,v);return{configure(m){i={enabled:m.enabled,sourceHosts:[...m.sourceHosts??[]]}},transform:{name:"image-cache",attributes:Tq,render:(m,p)=>m&&Lq(p)?h(m,p,d):m,serialize:(m,p)=>m&&h(m,p,f)},forget(m){t.forget(m),o.delete(m),!a&&u(m,!0)},fail(m){const p=t.sourceOf(m);return p===void 0||t.peek(p)!==m?!1:(o.add(p),t.forget(p),l.failed+=1,!0)},block(){a=!0},restoreUrls(m){return Qh(m,f)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function Oq(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||"";Zh(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 Rq(e,t){return!e.includes("blob:")&&!e.includes(Qc)?e:e.replace(kq,n=>t(n))}function Qh(e,t){if(typeof e=="string")return Rq(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=Qh(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=Qh(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function Mq(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>Yh(n)),i=xq({refresh:o}),s=Oq(document,i,o),a=n.register(i.transform),l=z.addListener(de.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>Yh(n))}),c=z.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(nl,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),bn(e,nl)}}}function Pq(e,t){const n=new UR,r=new Sl,o=new jR(n,r),i=new hR(r,n,{prepareHtml:t.prepareHtml,serviceMarkup:IH,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}});i.addDisposable(new KR(i,o,n));const s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0,l=dN((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=>{const u=t.lock?.acquire();try{await i.commit(c,!0)}finally{u?.release()}},dispose(){a?.dispose(),l(),i.dispose(),n.dispose(),r.dispose()}}}function Iq(e,t){const n=Pq(t,{prepareHtml:R(e,rl),lock:e.getInstance(Ne)}),r={commit:i=>n.commit(i),commitLockedAsync:i=>n.commitLockedAsync(i)},o=bI();return e.inject(os,t),e.inject(ot,n.remoteDocument),e.inject(rs,n.textDocument),e.inject(pn,n.documentMapping),e.inject(Y,n.htmlDocument),e.inject(Te,r),{...n,dispose(){o.dispose(),n.dispose(),bn(e,os),bn(e,ot),bn(e,rs),bn(e,pn),bn(e,Y),bn(e,Te)}}}function Dq(){const e=new Set,t=new Set;let n=0;const r=()=>{t.forEach(i=>{try{i()}catch{}})},o=()=>{e.size===0&&n===0&&r()};return{acquire(){const i={suspended:!1};e.add(i);const s=()=>{e.delete(i)&&o()};return{release:s,releaseLater(){Promise.resolve().then(s)}}},isLocked(){for(const i of e)if(!i.suspended)return!0;return!1},lift(i){let s;for(const a of e)a.suspended||(s=a);if(!s)return i();s.suspended=!0,n+=1;try{return i()}finally{s.suspended=!1,n-=1,o()}},onReleased(i){const s=()=>i();return t.add(s),()=>t.delete(s)}}}var Bq=Dq();function Hq(e){e.inject(Cb,j),e.inject(Ne,Bq),e.inject(Ye,Tf)}var Fq=2e3;function $q(){return Math.random().toString(36).slice(2,10)}function Wq(e){const t=`${e.session??$q()}.`;let n=new Map,r=new WeakMap,o=e.entityId(),i=0;const s=()=>{n=new Map,r=new WeakMap},a=()=>{for(const[d,f]of n)f.deref()||n.delete(d)},l=d=>d.isConnected&&e.isInLetter(d),c=d=>{const f=new Set;for(const h of d)for(let m=h;m&&!f.has(m);m=m.parentNode)f.add(m);for(const[h,m]of n){const p=m.deref();(!p||f.has(p))&&(n.delete(h),p&&r.delete(p))}},u=[e.onEntitySet(d=>{d!==o&&(o=d,s())}),e.onHostChange?.(c)];return{issue(d){if(!l(d))return;const f=r.get(d);if(f&&n.get(f)?.deref()===d)return f;n.size>=Fq&&a(),i+=1;const h=`${t}${i.toString(36)}`;return n.set(h,new WeakRef(d)),r.set(d,h),h},sync(){e.flush()},resolve(d){if(typeof d!="string"||!d.startsWith(t))return;e.flush();const f=n.get(d)?.deref();return f&&l(f)?f:void 0},dispose(){u.forEach(d=>d?.dispose()),s()}}}function qq(e){return e.flatMap(t=>{switch(t.type){case"Update":return[];case"Add":case"Move":return t.parent?[t.parent]:[];default:return"node"in t?[t.node]:[]}})}function zq(e,t){return Wq({isInLetter:n=>e.isInLetter(n),flush:()=>e.flushCommit(),entityId:()=>e.entityId,onEntitySet:n=>t.onEntitySet(n),onHostChange:n=>e.beforeChange(({domMutations:r})=>n(qq(r)))})}var Uq=class extends Ee{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),A(this,"_isEditorInFocus",!1),A(this,"_context",new Map),A(this,"_editorLostFocusEmitter",this.addDisposable(new ge)),A(this,"_summaries",[]),A(this,"_onChange",t=>{this._isEditorInFocus&&this._summaries.push(...t)}),A(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 jq(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new Uq(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(),bn(e,it)}};return e.inject(it,l),l}var Vq={name:"sandbox.state",provides:[Cb,Ne,Ye],setup:Hq},Gq={name:"sandbox.attributePipeline",provides:[Po],setup:wH},Xq={name:"sandbox.documentSync",provides:[Y,ot,rs,pn,Te,Do],awaits:{services:[os,rl,Ne]},setup:e=>e.inject(Do,Iq(e,R(e,os)))},Kq={name:"sandbox.images",provides:[nl,Ld],awaits:{services:[Po,Y,Do]},setup(e){const t=R(e,Po),n=R(e,Y);Mq(e,{pipeline:t,htmlDocument:n});const r=pq(e,{pipeline:t,htmlDocument:n}).reload;R(e,Do).onDocumentReplaced(()=>r.clear()),z.addListener(de.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(nl)?.forget(o),r.reload(o))})}},Yq={name:"sandbox.mapObj",provides:[Bo],awaits:{services:[pn]},setup:e=>e.inject(Bo,cq(R(e,pn)))},Zq={name:"sandbox.elementRefs",provides:[Io],awaits:{services:[Y,ot]},setup:e=>e.inject(Io,zq(R(e,Y),R(e,ot)))},Qq={name:"sandbox.focus",provides:[it],awaits:{services:[Y,ot]},setup:e=>jq(e,{htmlDocument:R(e,Y),remoteDocument:R(e,ot)})},Jq={name:"sandbox.app",provides:[Ow,Gm],setup(e){e.getOrCreateInstance(Gm,()=>new _b),e.injectFactory(Ow,()=>Vs.instance)}},ez=[Jq,Vq,Gq,Xq,Kq,ZM,QM,JM,Yq,Zq,Qq,ZW,QW,JW,tq,nq,rq,oq,iq,sq,aq,eq,b$,y$,v$,...kP],Jh=null,ep=0,tz=6e5;function nz(e){Jh=e,ep=e?Date.now():0}function MC(){const e=Jh,t=ep;return Jh=null,ep=0,!e||!t||Date.now()-t>tz||!e.isConnected||!e.matches('[em="block"]')?null:e}function rz(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=Le(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),Aw(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Pt(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 oz(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=rz(o,n);if(!i)return;nz(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:Ac({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function Jc(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 eu(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 Qe=()=>ql(window.getSelection()?.toString())??"",iz=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],sz={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},az=/^#[\da-f]{6}$/i,PC=()=>[...new Set(iz.flatMap(lz).map(G).filter(e=>az.test(e)).map(e=>e.toUpperCase()))];function lz({type:e,name:t}){const n=sz[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}function IC(e){return e.filter(t=>!Ec.includes(t))}function cz(e){return Ec.some(t=>e.classList.contains(t))?(e.classList.remove(...Ec),e.classList.length||e.removeAttribute("class"),!0):!1}function uz(e){return Array.from(e.rows).flatMap(t=>[t,...Array.from(t.cells)]).map(cz).includes(!0)}function dz(e){const t=[];let n="",r=0,o=0;for(let i=0;i<e.length;i++){const s=e[i];n?s==="\\"?i++:s===n&&(n=""):s==='"'||s==="'"?n=s:s==="("?r++:s===")"?r=Math.max(0,r-1):s===";"&&r===0&&(t.push(e.slice(o,i)),o=i+1)}return t.push(e.slice(o)),t}function DC(e){return dz(e??"").flatMap(t=>{const n=t.indexOf(":"),r=t.slice(0,Math.max(n,0)).trim();return r?[{name:r,value:t.slice(n+1).trim()}]:[]})}var jr=["top","right","bottom","left"],BC=["width","style","color"];function tp(e,t){return e===t?jr:jr.filter(n=>e===`${t}-${n}`)}function fz(e,t){const n=e.toLowerCase();if(t==="padding")return tp(n,"padding");const[r,o,i,...s]=n.split("-");return r!=="border"||s.length?[]:o===void 0||i===void 0&&BC.includes(o)?jr:i===void 0||BC.includes(i)?jr.filter(a=>a===o):[]}function tu(e,t,n){const r=[];let o=-1,i=0;for(const a of e){const l="managed"in a?[]:fz(a.name,t);if("managed"in a?a.managed===t:l.length>0&&l.every(c=>n.includes(c))){o=o<0?r.length:o;continue}r.push(a),i=l.some(c=>n.includes(c))?r.length:i}const s=Math.max(o<0?r.length:o,i);return[...r.slice(0,s),{managed:t},...r.slice(s)]}var mz=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"];function hz(e){return!!e.closest("editor.em-text")}function pz(e){e.querySelectorAll(mz.join(",")).forEach(t=>{hz(t)||t.remove()})}function gz(e){e.querySelectorAll("editor").forEach(t=>{const n=Array.from(t.childNodes);if(t.parentNode!==e||t.querySelector("div")){t.replaceWith(...n);return}const r=t.ownerDocument.createElement("div");r.append(...n),t.replaceWith(r)})}var bz=".em-element-resize-img, .em-element-img-change-group";function yz(e){e.querySelectorAll(bz).forEach(t=>t.remove()),e.querySelectorAll("span.em-element-resize-img-container").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function vz(e){const t=e.cloneNode(!0);return nn(e,t),Zo(t),pz(t),yz(t),gz(t),Ke(t)}function nu(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function Ez(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=nu(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 Sz(e,t,n){const r=t.split(/\s+/).map(nu),o=tp(e,"padding"),i=e==="padding"?4:1;if(!o.length||r.length>i||r.some(f=>f===void 0))return!1;const[s,a=s,l=s,c=a]=r,u={top:s,right:a,bottom:l,left:c},d={...n.padding};return o.forEach(f=>d[f]=u[f]),n.padding=d,!0}function wz(e,t,n){const r=Ez(t);if(!r)return!1;const o={...n.borders};return tp(e,"border").forEach(i=>o[i]={...r}),n.borders=o,!0}function Vr(e,t,n){return n===void 0||n===""?!1:(e[t]=n,!0)}var _z={"font-family":{family:"font-family",consume:(e,t,n)=>Vr(n,"fontFamily",t)},"font-size":{family:"font-size",consume:(e,t,n)=>Vr(n,"fontSize",nu(t))},"line-height":{family:"line-height",consume:(e,t,n)=>Vr(n,"lineHeight",nu(t))},color:{family:"color",consume:(e,t,n)=>Vr(n,"color",HC(t))},"background-color":{family:"background-color",consume:(e,t,n)=>Vr(n,"backgroundColor",HC(t))},"text-align":{family:"text-align",consume:(e,t,n)=>Vr(n,"textAlign",Cz(t))},"vertical-align":{family:"vertical-align",consume:(e,t,n)=>Vr(n,"verticalAlign",Tz(t))},"border-radius":{family:"border-radius",consume:(e,t,n)=>Vr(n,"borderRadius",Az(t))},...Object.fromEntries(["padding",...jr.map(e=>`padding-${e}`)].map(e=>[e,{family:"padding",consume:Sz}])),...Object.fromEntries(["border",...jr.map(e=>`border-${e}`)].map(e=>[e,{family:"border",consume:wz}]))};function HC(e){if(e)return e.trim()}function Cz(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].find(n=>n===t)}function Tz(e){if(!e)return;const t=e.trim().toLowerCase();return["top","middle","bottom"].find(n=>n===t)}function Az(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 kz(e){const t={},n=[],r=new Set;for(const o of DC(e.getAttribute("style"))){const i=o.name.toLowerCase(),s=_z[i];s?.consume(i,o.value,t)?r.has(s.family)||(r.add(s.family),n.push({managed:s.family})):n.push(o)}return{style:Object.keys(t).length?t:void 0,styleEntries:n}}function Lz(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function Nz(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}var xz=["rowspan","colspan","class","style"];function ru(e){return Array.from(e.attributes).filter(t=>!J7.includes(t.name)).map(t=>({name:t.name,value:t.value}))}function Oz(e,t,n){return ru(e).filter(({name:r})=>!xz.includes(r)&&!(r==="align"&&t)&&!(r==="valign"&&n))}function Rz(e){return ru(e).flatMap(t=>{if(t.name!=="class")return[t];const n=t.value.split(/\s+/).filter(Boolean),r=IC(n);return r.length===n.length?[t]:r.length?[{name:"class",value:r.join(" ")}]:[]})}function FC(e){const t=e.parentElement?.tagName;return t==="THEAD"?"thead":t==="TFOOT"?"tfoot":"tbody"}function Mz(e){const t=[];for(let n=0;n<e.length;){let r=n+1;for(;r<e.length&&e[r].parentElement===e[n].parentElement;)r++;t.push(...Array(r-n).fill(r)),n=r}return t}function Pz(e,t){const n=Lz(e),r=Nz(e);return{...t,contentHtml:vz(e),classList:Array.from(e.classList),tag:e.tagName==="TH"?"th":"td",attrs:Oz(e,n,r),...kz(e),align:n,valign:r}}function Iz(e,t){for(let o=t.row;o<t.row+t.rowspan;o++)for(let i=t.col;i<t.col+t.colspan;i++){var n,r;(n=e[o])[r=i]??(n[r]=t.id)}}function Dz(e){const t=Mz(e),n=e.map(()=>[]),r=[];e.forEach((i,s)=>{let a=0;for(const l of Array.from(i.cells)){for(;n[s][a];)a++;const c=t[s]-s,u=l.rowSpan===0?c:Math.min(Math.max(1,l.rowSpan||1),c),d=Math.max(1,l.colSpan||1),f=Pz(l,{id:`cell-${r.length}`,row:s,col:a,rowspan:u,colspan:d});r.push(f),Iz(n,f),a+=d}});const o=Math.max(0,...n.map(i=>i.length));return{cells:r,cols:o,grid:n.map(i=>Array.from({length:o},(s,a)=>i[a]??null))}}function Bz(e,t){const n={};for(const r of t){const o=FC(r);o!=="tbody"&&r.parentElement&&!n[o]&&(n[o]=ru(r.parentElement))}return{attrs:ru(e),...Object.keys(n).length?{sectionAttrs:n}:{}}}function np(e,t){const n=Number(/^cell-(\d+)$/.exec(t)?.[1]??NaN);return Array.from(e.rows).flatMap(r=>Array.from(r.cells))[n]}function ya(e,t){const n=Array.from(e.rows).flatMap(r=>Array.from(r.cells)).indexOf(t);return n<0?void 0:`cell-${n}`}function Li(e){const t=Array.from(e.rows),n=t.map(r=>({section:FC(r),attrs:Rz(r)}));return{rows:t.length,...Dz(t),rowsMeta:n,meta:Bz(e,t)}}function $C(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}var ou=["top","right","bottom","left"];function Hz(e){if(!e)return[];const t=ou.map(n=>e[n]);return t[0]!==void 0&&t.every(n=>n===t[0])?[`padding: ${t[0]}px`]:ou.flatMap(n=>e[n]===void 0?[]:[`padding-${n}: ${e[n]}px`])}function WC(e){return`${e.width}px ${e.style} ${e.color}`}function Fz(e,t){return!!e&&e.width===t.width&&e.style===t.style&&e.color===t.color}function $z(e){if(!e)return[];const{top:t}=e;return t&&ou.every(n=>Fz(e[n],t))?[`border: ${WC(t)}`]:ou.flatMap(n=>{const r=e[n];return r?[`border-${n}: ${WC(r)}`]:[]})}function Wz(e){const t=new Map;if(!e)return t;const n=[["font-family",e.fontFamily?[`font-family: ${e.fontFamily}`]:[]],["font-size",e.fontSize===void 0?[]:[`font-size: ${e.fontSize}px`]],["line-height",e.lineHeight===void 0?[]:[`line-height: ${e.lineHeight}px`]],["color",e.color?[`color: ${e.color}`]:[]],["background-color",e.backgroundColor?[`background-color: ${e.backgroundColor}`]:[]],["text-align",e.textAlign?[`text-align: ${e.textAlign}`]:[]],["vertical-align",e.verticalAlign?[`vertical-align: ${e.verticalAlign}`]:[]],["border-radius",e.borderRadius?[`border-radius: ${e.borderRadius}`]:[]],["padding",Hz(e.padding)],["border",$z(e.borders)]];for(const[r,o]of n)o.length&&t.set(r,o);return t}function qz(e){const t=Wz(e.style),n=[];for(const r of e.styleEntries)"managed"in r?(n.push(...t.get(r.managed)??[]),t.delete(r.managed)):n.push(`${r.name}: ${r.value}`);return t.forEach(r=>n.push(...r)),n.join("; ")}function iu(e){return e.map(({name:t,value:n})=>` ${$C(t)}="${$C(n)}"`).join("")}function zz(e){const t=[["rowspan",e.rowspan>1?String(e.rowspan):void 0],["colspan",e.colspan>1?String(e.colspan):void 0],["align",e.align],["valign",e.valign],["class",e.classList.filter(Boolean).join(" ")||void 0],["style",qz(e)||void 0]].flatMap(([n,r])=>r===void 0?[]:[{name:n,value:r}]);return`<${e.tag}${iu([...t,...e.attrs])}>${e.contentHtml}</${e.tag}>`}function Uz(e,t,n){const r=e.grid[t].flatMap((o,i)=>{const s=o?n.get(o):void 0;return s&&s.row===t&&s.col===i?[zz(s)]:[]});return`<tr${iu(e.rowsMeta[t]?.attrs??[])}>${r.join("")}</tr>`}function jz(e,t){let n="";for(let r=0;r<t.length;){const o=e.rowsMeta[r]?.section??"tbody";let i=r+1;for(;i<t.length&&(e.rowsMeta[i]?.section??"tbody")===o;)i++;const s=t.slice(r,i).join("");n+=o==="tbody"?s:`<${o}${iu(e.meta?.sectionAttrs?.[o]??[])}>${s}</${o}>`,r=i}return n}function qC(e){if(e.rows===0||e.cols===0||!e.cells.length)return"<table></table>";const t=new Map(e.cells.map(r=>[r.id,r])),n=e.grid.map((r,o)=>Uz(e,o,t));return`<table${iu(e.meta?.attrs??[])}>${jz(e,n)}</table>`}function bt(e){return{rejected:e}}function rp(e){return"rejected"in e}function hr(e,t){return e.cells.find(n=>n.id===t)}function Ni(e,t,n){const r=e.grid[t]?.[n];return r?hr(e,r):void 0}function op(e){let t=-1;for(const n of e.cells){const r=/^cell-(\d+)$/.exec(n.id);t=r?Math.max(t,Number(r[1])):t}return()=>`cell-${++t}`}function Vz(e){return op(e)()}function Gz(e,t,n){if(!(n.rowspan>=1&&n.colspan>=1&&n.row>=0&&n.col>=0&&n.row+n.rowspan<=e.length&&n.col+n.colspan<=t))return!1;for(let r=n.row;r<n.row+n.rowspan;r++)for(let o=n.col;o<n.col+n.colspan;o++){if(e[r][o]!==null)return!1;e[r][o]=n.id}return!0}function xi(e){const t=Array.from({length:e.rows},()=>Array(e.cols).fill(null)),n=new Set;for(const r of e.cells){if(n.has(r.id)||!Gz(t,e.cols,r))return bt("invalid-layout");n.add(r.id)}return e.rowsMeta.length!==e.rows?bt("invalid-layout"):{...e,grid:t}}function pr(e){return JSON.parse(JSON.stringify(e))}function Xz(e,t){return new DOMParser().parseFromString(e,"text/html").body.firstChild?.nodeType===Node.ELEMENT_NODE?Zz(e,t):" "}function Kz(e){const t=pr(e);return t.contentHtml=Xz(e.contentHtml," "),t.classList=IC(t.classList),t.attrs=t.attrs.filter(n=>n.name!=="id"),t}function Yz(e){return{...e,contentHtml:Iw,classList:[""],tag:"td",attrs:[],styleEntries:[],align:"center",valign:"top",style:{}}}function su(e,t){return e?{...Kz(e),...t}:Yz(t)}function zC(e){if(e.nodeType===Node.TEXT_NODE){const t=e.textContent||"";return!t||/^\s*$/.test(t.replace(/\u00A0/g,"X"))}return e.nodeType!==Node.ELEMENT_NODE?!0:Array.from(e.childNodes).every(t=>zC(t))}function Zz(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(s){if(s.nodeType===Node.TEXT_NODE&&s.textContent?.trim()){r?s.textContent="":(s.textContent=t,r=!0);return}for(const a of Array.from(s.childNodes))o(a)}function i(s,a=!1){if(s.nodeType!==Node.ELEMENT_NODE)return;const l=Array.from(s.childNodes);for(const c of l)i(c);!a&&zC(s)&&s.parentNode?.removeChild(s)}return o(n),i(n,!0),n.outerHTML||e}function Qz(e){return e?{section:e.section,attrs:e.attrs.filter(t=>t.name!=="id")}:{section:"tbody",attrs:[]}}function UC(e,t,n){const r=pr(e),o=new Set;for(const s of r.cells)if(s.row<t&&t<s.row+s.rowspan){s.rowspan+=1;for(let a=s.col;a<s.col+s.colspan;a++)o.add(a)}else s.row>=t&&(s.row+=1);const i=op(e);for(let s=0;s<r.cols;s++)o.has(s)||r.cells.push(su(Ni(e,n,s),{id:i(),row:t,col:s,rowspan:1,colspan:1}));return r.rowsMeta.splice(t,0,Qz(e.rowsMeta[n])),r.rows+=1,xi(r)}function jC(e,t,n){const r=hr(e,t);if(!r)return bt("no-cell");const o=r.row+r.rowspan-1;return n==="above"?UC(e,r.row,r.row):UC(e,o+1,o)}function Jz(e,t){const n=hr(e,t);if(!n)return bt("no-cell");if(e.rows<=1)return bt("last-line");const r=n.row,o=pr(e);o.cells=o.cells.filter(i=>i.row!==r||i.rowspan>1);for(const i of o.cells)i.row>r?i.row-=1:r<i.row+i.rowspan&&(i.rowspan-=1);return o.rowsMeta.splice(r,1),o.rows-=1,xi(o)}function VC(e,t,n){const r=pr(e),o=new Set;for(const s of r.cells)if(s.col<t&&t<s.col+s.colspan){s.colspan+=1;for(let a=s.row;a<s.row+s.rowspan;a++)o.add(a)}else s.col>=t&&(s.col+=1);const i=op(e);for(let s=0;s<r.rows;s++)o.has(s)||r.cells.push(su(Ni(e,s,n),{id:i(),row:s,col:t,rowspan:1,colspan:1}));return r.cols+=1,xi(r)}function GC(e,t,n){const r=hr(e,t);if(!r)return bt("no-cell");const o=r.col+r.colspan-1;return n==="left"?VC(e,r.col,r.col):VC(e,o+1,o)}function eU(e,t){const n=hr(e,t);if(!n)return bt("no-cell");if(e.cols<=1)return bt("last-line");const r=n.col,o=pr(e);o.cells=o.cells.filter(i=>i.col!==r||i.colspan>1);for(const i of o.cells)i.col>r?i.col-=1:r<i.col+i.colspan&&(i.colspan-=1);return o.cols-=1,xi(o)}var tU="img, table, hr, svg, video, iframe, picture";function XC(e){const t=document.createElement("div");return ke(t,e),t}function KC(e){const t=Array.from(e.childNodes).filter(r=>r.nodeType!==Node.TEXT_NODE||(r.textContent??"").trim()!==""),[n]=t;return t.length===1&&n instanceof Element&&n.tagName==="DIV"?n:null}function nU(e){return(e.textContent??"").replace(/ /g," ").trim()===""&&!e.querySelector(tU)}function rU(e){const t=XC(e);if(nU(t))return"";const n=KC(t);return n?Ke(n):e.trim()}function oU(e,t){const n=t.map(o=>rU(o.contentHtml)).filter(o=>o!=="").join("<br>").replace(/ $/,""),r=n===""?" ":n;for(const o of[e,...t]){const i=XC(o.contentHtml),s=KC(i);if(s)return ke(s,r),Ke(i)}return n===""?Iw:n}function iU(e){const t=Math.min(...e.map(r=>r.row)),n=Math.min(...e.map(r=>r.col));return{row:t,col:n,rows:Math.max(...e.map(r=>r.row+r.rowspan))-t,cols:Math.max(...e.map(r=>r.col+r.colspan))-n}}function sU(e,t,n){for(let r=t.row;r<t.row+t.rows;r++)for(let o=t.col;o<t.col+t.cols;o++){const i=e.grid[r]?.[o];if(!i||!n.has(i))return!1}return!0}function ip(e,t,n){const r=new Set([t,...n]),o=e.cells.filter(c=>r.has(c.id));if(o.length!==r.size)return bt("no-cell");if(r.size<2)return bt("nothing-to-merge");const i=iU(o);if(!sU(e,i,r))return bt("not-rectangular");const s=pr(e),a=hr(s,t),l=[...o].sort((c,u)=>c.row-u.row||c.col-u.col);return a.contentHtml=oU(a,l),Object.assign(a,{row:i.row,col:i.col,rowspan:i.rows,colspan:i.cols}),s.cells=s.cells.filter(c=>c===a||!r.has(c.id)),xi(s)}function aU(e,t,n){switch(t){case"left":return{row:e.row,col:e.col-n,rows:e.rowspan,cols:n};case"right":return{row:e.row,col:e.col+e.colspan,rows:e.rowspan,cols:n};case"top":return{row:e.row-n,col:e.col,rows:n,cols:e.colspan};default:return{row:e.row+e.rowspan,col:e.col,rows:n,cols:e.colspan}}}function lU(e,t){if(t.row<0||t.col<0||t.row+t.rows>e.rows||t.col+t.cols>e.cols)return null;const n=[];for(let r=t.row;r<t.row+t.rows;r++)for(let o=t.col;o<t.col+t.cols;o++)n.push(Ni(e,r,o)?.id??"");return n}function cU(e,t,n,r=1){const o=hr(e,t);if(!o)return bt("no-cell");if(r<1)return bt("nothing-to-merge");const i=lU(e,aU(o,n,r));return i?i.includes("")?bt("not-rectangular"):ip(e,t,i):bt("out-of-table")}function YC(e,t,n,r=1){const o=hr(e,t),i=n==="cols"?o?.colspan:o?.rowspan;if(!o||i===void 0)return bt("no-cell");if(r<1||r>=i)return bt("nothing-to-split");const s=pr(e),a=hr(s,t),l={id:Vz(e),row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return n==="cols"?(a.colspan-=r,s.cells.push(su(a,{...l,col:a.col+a.colspan,colspan:r}))):(a.rowspan-=r,s.cells.push(su(a,{...l,row:a.row+a.rowspan,rowspan:r}))),xi(s)}function uU(e,t){return e.row===t.row?t.col>e.col?"right":"left":e.col===t.col?t.row>e.row?"bottom":"top":null}function au(e,t){return Array.from({length:Math.max(0,t-e+1)},(n,r)=>e+r)}function dU(e,t,n){switch(n){case"right":return au(e.col+e.colspan,t.col+t.colspan-1).map(r=>({row:e.row,col:r}));case"left":return au(t.col,e.col-1).map(r=>({row:e.row,col:r}));case"bottom":return au(e.row+e.rowspan,t.row+t.rowspan-1).map(r=>({row:r,col:e.col}));default:return au(t.row,e.row-1).map(r=>({row:r,col:e.col}))}}function fU(e,t,n){const r=Ni(e,t.row,t.col),o=Ni(e,n.row,n.col),i=r&&o&&r.id!==o.id?uU(r,o):null;if(!r||!o||!i)return null;const s=[...new Set(dU(r,o,i).map(a=>Ni(e,a.row,a.col)?.id??""))];return s.includes("")||rp(ip(e,r.id,s))?null:{direction:i,cellIds:s}}function mU(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function hU(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 lu(e,t){return Array.from({length:t},(n,r)=>e+r)}function pU(e,t){switch(t){case"top":return lu(e.col,e.colspan).map(n=>[e.row-1,n]);case"bottom":return lu(e.col,e.colspan).map(n=>[e.row+e.rowspan,n]);case"left":return lu(e.row,e.rowspan).map(n=>[n,e.col-1]);default:return lu(e.row,e.rowspan).map(n=>[n,e.col+e.colspan])}}function ZC(e,t){const n=new Set(t),r=e.cells.filter(s=>n.has(s.id)),o=([s,a])=>n.has(e.grid[s]?.[a]??""),i={};for(const s of r){const a=[];for(const l of jr){const c=pU(s,l),u=c.filter(d=>!o(d)).length;if(u>0&&u<c.length)return Object.fromEntries(r.map(d=>[d.id,[...jr]]));u>0&&a.push(l)}i[s.id]=a}return i}function gU(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}}s.styleEntries=tu(s.styleEntries,"border",n)}return i}function bU(e,t,n){const r=pr(e);for(const o of r.cells){if(!t.includes(o.id))continue;const i=o.style?.borders;n.forEach(s=>delete i?.[s]),o.style&&i&&!Object.keys(i).length&&delete o.style.borders,o.styleEntries=tu(o.styleEntries,"border",n)}return r}function yU(e,t){return ZC(e,t)}function vU(e){const t=pr(e);return t.cells.forEach(n=>{const r=n.style?.borders;if(!r)return;const o={top:n.row===0,bottom:n.row+n.rowspan===t.rows,left:n.col===0,right:n.col+n.colspan===t.cols};Object.keys(o).filter(i=>o[i]).forEach(i=>delete r[i])}),t}function EU(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={});const 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}var SU=[["topLeft","top","left"],["topRight","top","right"],["bottomLeft","bottom","left"],["bottomRight","bottom","right"]];function wU(e,t){const n={};for(const[r,o]of Object.entries(ZC(e,t))){const i=SU.filter(([,s,a])=>o.includes(s)&&o.includes(a)).map(([s])=>s);i.length&&(n[r]=i)}return n}var _U={paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"],paddingLeft:["left"],paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"]};function CU(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=n[0],o=_U[r];if(!o)return e;const i=t.settings[r];return typeof i!="number"||isNaN(i)||!e.cells||!Array.isArray(e.cells)||e.cells.forEach(s=>{s.style||(s.style={}),s.style.padding||(s.style.padding={top:0,right:0,bottom:0,left:0});const a=s.style.padding;o.forEach(l=>a[l]=i),s.styleEntries=tu(s.styleEntries,"padding",o),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 TU(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}i.styleEntries=tu(i.styleEntries,"padding",n),["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 AU(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}var cu="none",QC="b64_",kU=/^(\d+(?:_\d+)?)(px|perc)$/;function LU(e){if(e===cu)return cu;let t="";return new TextEncoder().encode(Sc(e)).forEach(n=>{t+=String.fromCharCode(n)}),QC+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function NU(e){if(e===cu)return cu;if(!e.startsWith(QC))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 xU(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function JC(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function e0(e){const t=e.match(kU);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function OU(){return Nh()}function De(e,t){const n=OU();n&&n.insertAdjacentHTML("beforeend",`
|
|
88
|
-
${J$()}
|
|
89
|
-
.${e} { ${t} }
|
|
90
|
-
}
|
|
91
|
-
`)}function ye(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function t0(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,ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim)De(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`);else{const r=t.value!=="auto"?t.value:"none";De(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else ye(e.elem,t.classNamePrefix)}function RU(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,ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim?De(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):De(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else ye(e.elem,t.classNamePrefix)}function Oi(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,ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),t.dim?De(n,`height: ${t.value}${t.dim} !important;`):De(n,`height: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function MU(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; `:""),De(a,l)}})}function PU(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(),De(s,`${{all:"border-radius",topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"}[n]||"border-radius"}: ${i}px !important;`),n!=="all"&&["em-mob-border_radius_topLeft","em-mob-border_radius_topRight","em-mob-border_radius_bottomLeft","em-mob-border_radius_bottomRight"].every(a=>Array.from(e.elem.classList).some(l=>l.startsWith(a)))&&ye(e.elem,"em-mob-border_radius_all-")}else e.elem.classList.forEach(s=>{s.indexOf(r)>-1&&e.elem.classList.remove(s)})}function IU(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":"");ye(e.elem,n),e.elem.classList.add(c),We(),De(c,`box-shadow:${l} ${r} ${o} ${i} ${s} ${a} !important;`)}else if(t.value){const r=(t.classNamePrefix||"em-mob-boxshadow_")+t.value.replace(/\s/g,"_").replace(/\(/g,"").replace(/\)/g,"").replace(/,/g,"-");ye(e.elem,t.classNamePrefix||"em-mob-boxshadow_"),e.elem.classList.add(r),We(),De(r,`box-shadow: ${t.value} !important;`)}else ye(e.elem,n)}function n0(e){const t=e.fieldName??"mobileAlign",n=e.settings[t];if(n.value){const r=n.classNamePrefix+n.value;ye(e.elem,n.classNamePrefix),e.elem.classList.add(r),We(),De(r,`text-align: ${n.value} !important;`)}else ye(e.elem,n.classNamePrefix)}function DU(e){const t=e.settings.mobileAlign;if(t.value){const n=t.classNamePrefix+t.value;ye(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",De(n,`${r} !important;`)}else ye(e.elem,t.classNamePrefix)}function r0(e){const t=e.settings.mobileVerticalAlign;if(t.value){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`vertical-align: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function BU(e){const t=e.settings.mobileDirection;if(t.value){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`direction: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function HU(e){const t=e.settings.mobileBackgroundColor;if(t.value){const n=t.value!=="none"?String(t.value).substring(1):"none",r=t.classNamePrefix+n;ye(e.elem,t.classNamePrefix),e.elem.classList.add(r),We(),De(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else ye(e.elem,t.classNamePrefix)}function FU(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+LU(n);ye(e.elem,t.classNamePrefix),e.elem.classList.add(r),We(),De(r,`background-image: ${n!=="none"?xU(Sc(n)):"none"} !important;`)}else ye(e.elem,t.classNamePrefix)}function $U(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+JC(String(t.value));ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-position-x: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function WU(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+JC(String(t.value));ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-position-y: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function qU(e){const t=e.settings.mobileBackgroundRepeat;if(t.value&&t.value!=="none"){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-repeat: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function zU(e){const t=e.settings.mobileBackgroundSize;if(t.value){const n=t.classNamePrefix+t.value;ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`background-size: ${t.value} !important;`)}else ye(e.elem,t.classNamePrefix)}function va(e){const t=e.settings.mobilePadding;We(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){tC({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),De(o,`padding-${n}: ${r}px !important;`)}else r===null&&tC({elem:e.elem,position:n})})}function o0(e){const t=e.settings.mobileFontSize;if(t.value!=null){const n=t.classNamePrefix+t.value+"px";ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`font-size: ${t.value}px !important;`)}else ye(e.elem,t.classNamePrefix)}function i0(e){const t=e.settings.mobileLineHeight;if(t&&t.value!==null){const n=t.classNamePrefix+t.value+"px";ye(e.elem,t.classNamePrefix),e.elem.classList.add(n),We(),De(n,`line-height: ${t.value}px !important;`)}else t&&ye(e.elem,t.classNamePrefix)}function s0(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"),De(r,`display: ${o} !important;`)}t==="desktop"&&(n(),De(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function UU(e){const t=e.settings.isContrastBlock,n=Ch();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 jU(){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=jU();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=NU(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=e0(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=e0(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 VU(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:Ti(e),backgroundColor:e.style.backgroundColor?G(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:Kc(e),boxShadow:fa(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:ha(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 GU(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 XU='table[em-type="social"]';function KU(e){return e.closest(XU)}function YU(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 Ri(e){const t=KU(e);if(t&&e!==t&&YU(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")&&ZU(o)?n:Ri(n)}function ZU(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 Mi(){return Mt.getInstance(Nd)?.localized??{}}var a0=[];function QU(){return a0}function l0(e){const t=Mi();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=SM(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 JU=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function ej(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function tj(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(JU.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||ej(r))}var c0='.em-narrow-table, [em="block-contaner"]';function nj(e){const t=e.style;return tj(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(c0)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(c0)&&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"))||Tv(e))}function rj(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||Tv(e))&&t.push(l0(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,nj(r)&&t.push(l0(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),a0=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function u0(e){const t=Mi(),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 u0(n)}function oj(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 d0(e){return e.tagName==="AMP-ACCORDION"}var f0="em-mob-text_align-",ij=":scope > tr > td, :scope > tbody > tr > td",sj='div[style*="font-family"][style*="font-size"]';function sp(e){return e.querySelector(ij)}function ap(e){return e.querySelector(sj)}function aj(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function m0(e){const t=e.closest('table[em="atom"]');if(!t||aj(e,t))return null;const n=sp(t);return n?{atomTd:n,textDiv:ap(n)}:null}function Ea(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=m0(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function h0(e){const t=Ea(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function lj(e){const t=Ea(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function lp(e){return{value:lj(e)}}function cj(e,t,n=f0){const r=m0(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&Gc(o,n)}function uj(e){const t=sp(e);if(!t)return null;const n=ap(t);return n?.hasAttribute("align")?n:t}function dj(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=uj(n);r&&t(r,n)})}function fj(e,t,n=f0){const r=sp(e),o=r?ap(r):null;for(const i of[r,o])i&&i!==t&&Gc(i,n)}function uu(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 Sa(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(Mh),i=r.filter(s=>s!==Mh);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 Je(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 du(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function Gr(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 mj(e){const t=e.style.backgroundImage,n=e.getAttribute("background");if(t&&t!=="none"){const r=t.match(/url\(['"]?(.*?)['"]?\)/);if(r)return[{type:"url",value:r[1]}]}return n?[{type:"url",value:n}]:[{type:"url",value:""}]}function hj(){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 wa(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 p0(){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 cp(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&&cp(t))return!0;return!1}function g0(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 b0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function pj(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 gj(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 bj(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 yj(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=zh(n),i=cp(r)&&!cp(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}),h=l?qe({elem:l}):null,m=qe({elem:a}),p=e.elem.closest("a"),v={type:"button",caption:t.BUTTON,fontFamily:Sa(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:uu(e.elem),lineHeightDim:"px",textStrong:Je(e.elem,"strong","b")||du(e.elem),textItalic:Je(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(p?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:Je(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:Je(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:G(Gr(e.elem,"color"))||G(getComputedStyle(e.elem).color)||"",textBackgroundColor:G(Gr(e.elem,"background-color"))||"",padding:pj(o??n),borderRadius:Ti(s),backgroundColor:s.style.backgroundColor?G(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:bj(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:g0(a,"width"),height:g0(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:Kc(s),boxShadow:fa(s),href:n.getAttribute("href")??"",outlookRounding:i,outlookBackground:ha(r,"inside"),mobileWidth:{value:b0(m.mobileWidth),dim:m.mobileWidthDim??"px"},mobileHeight:{value:b0(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorder:f.mobileBorder,mobileBorderRadius:f.mobileBorderRadius,mobileBoxShadow:f.mobileBoxShadow,mobileAlign:m.mobileAlign,mobileFontSize:{value:d.mobileFontSize,dim:d.mobileFontSizeDim||"px"},mobileTextAlign:lp(e.elem),mobileVerticalAlign:h?.mobileVerticalAlign,mobileBackgroundColor:f.mobileBackgroundColor,mobileBackgroundImage:f.mobileBackgroundImage,mobileBackgroundPositionX:f.mobileBackgroundPositionX,mobileBackgroundPositionY:f.mobileBackgroundPositionY,mobileBackgroundRepeat:f.mobileBackgroundRepeat,mobileBackgroundSize:f.mobileBackgroundSize,mobilePadding:gj(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:m.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return wa(e.elem)&&(v.showOnMobile=!0),v}function y0(e){if(Uh(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 vj(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function Ej(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(Uh(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 v0(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function E0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function S0(e){return{src:e.getAttribute("src")??"",width:v0(e,"width"),height:v0(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 Sj(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=wj(o),s=Array.from(o).map((u,d)=>{const f=qe({elem:u}),h=S0(u);return{src:h.src,width:h.width,height:h.height,alt:h.alt,title:h.title,link:h.link,renderedWidth:Math.round(e.elem.getBoundingClientRect().width),renderedHeight:Math.round(e.elem.getBoundingClientRect().height),imgReplacer:h.imgReplacer,mobileWidth:{value:E0(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:E0(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorderRadius:f.mobileBorderRadius,slideIndex:d}}),a=qe({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:Ti(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 wj(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 up(e){return!!e.closest("amp-carousel")}function jn(e){return typeof e=="string"?e:typeof e=="number"?String(e):""}function St(e){return typeof e=="number"?Number.isFinite(e)?e:null:typeof e!="string"||!/^\s*-?\d+(\.\d+)?(px)?\s*$/.test(e)?null:parseFloat(e)}var fu=["top","right","bottom","left"],mu={borderAll:"all",borderTop:"top",borderRight:"right",borderBottom:"bottom",borderLeft:"left"},hu={width:1,style:"solid",color:"#b9b1b1"},w0={width:null,style:null,color:null};function pu(e,t){if(t==="all"){const r=fu.map(i=>pu(e,i)),[o]=r;return r.every(i=>JSON.stringify(i)===JSON.stringify(o))?o:w0}const n=e.style.getPropertyValue(`border-${t}-style`);return!n||n==="none"?w0:{width:St(e.style.getPropertyValue(`border-${t}-width`)),style:n,color:G(e.style.getPropertyValue(`border-${t}-color`))||null}}function dp(e){return e.style===""||"width"in e&&Fe(e.width)&&!e.style&&!e.color}function _0(e){return e==="all"?"border":`border-${e}`}function gu(e){const t=_0(e),n=[t,`${t}-width`,`${t}-style`,`${t}-color`];return e==="all"?[...n,...fu.flatMap(gu)]:n}function C0(e,t,n){Ih(e,gu(t)),e.style.setProperty(_0(t),`${n.width}px ${n.style} ${n.color}`)}function _j(e){const t=pu(e,"all");if(t.style===null)return;Ih(e,gu("all"));const n={width:t.width??0,style:t.style,color:t.color??hu.color};fu.forEach(r=>C0(e,r,n))}function T0(e,t,n){if(t!=="all"&&_j(e),dp(n)){Ih(e,gu(t));return}const r=pu(e,t==="all"?"top":t);C0(e,t,{width:St(n.width)??r.width??hu.width,style:n.style||r.style||hu.style,color:n.color||r.color||hu.color})}var fp=/^border(-(top|right|bottom|left))?(-(width|style|color))?$/i;function Cj(e,t){const n=e.style.getPropertyValue(`border-${t}-style`);if(!n||n==="none")return null;const r=e.style.getPropertyValue(`border-${t}-color`);return[e.style.getPropertyValue(`border-${t}-width`),n,G(r)||r].filter(Boolean).join(" ")}function Tj(e){const t=DC(e.getAttribute("style")),n=t.findIndex(({name:a})=>fp.test(a));if(n<0||t.some(({name:a,value:l})=>fp.test(a)&&/!important/i.test(l)))return;const r=fu.map(a=>[a,Cj(e,a)]),[,o]=r[0],i=o&&r.every(([,a])=>a===o)?[`border: ${o}`]:r.flatMap(([a,l])=>l?[`border-${a}: ${l}`]:[]),s=t.filter(({name:a})=>!fp.test(a)).map(({name:a,value:l})=>`${a}: ${l}`);s.splice(n,0,...i),e.setAttribute("style",s.length?`${s.join("; ")};`:"")}function Aj(e){const t=St(e.getAttribute("border"));return t?{width:t,style:"solid",color:G(e.getAttribute("bordercolor")??"")||null}:null}function A0(e){const t=Aj(e),n=Object.keys(mu),r=Object.fromEntries(n.map(i=>[i,t??pu(e,mu[i])])),o=n.find(i=>r[i].style!==null)??"borderAll";return{...r,position:o}}function k0(e){return!!e.closest(".em-element-custom-table")}function L0(e){const{paddingTop:t,paddingRight:n,paddingBottom:r,paddingLeft:o}=e.style;return{paddingLeftRight:o===n?o:"",paddingTopBottom:t===r?t:"",paddingLeft:o,paddingRight:n,paddingTop:t,paddingBottom:r}}function kj(e){return{backgroundColor:G(e.style.backgroundColor||e.getAttribute("bgcolor")||"")||"",backgroundImage:mj(e),backgroundPositionX:e.style.backgroundPositionX||"center",backgroundPositionY:e.style.backgroundPositionY||"center",backgroundRepeat:e.style.backgroundRepeat||"repeat",backgroundSize:e.style.backgroundSize||"cover"}}function Lj(e){const{position:t,...n}=A0(e),r=fa(e);return{...n,borderPosition:t,borderRadius:Ti(e),boxShadow:{color:r?.color??null,hOffset:r?.hOffset??null,vOffset:r?.vOffset??null,blurRadius:r?.blurRadius??null,spreadRadius:r?.spreadRadius??null,inset:r?.inset??null}}}function Nj(e){return{mobileBoxShadow:e.mobileBoxShadow,mobileBackgroundColor:e.mobileBackgroundColor,mobileBackgroundImage:e.mobileBackgroundImage,mobileBackgroundPositionX:e.mobileBackgroundPositionX,mobileBackgroundPositionY:e.mobileBackgroundPositionY,mobileBackgroundRepeat:e.mobileBackgroundRepeat,mobileBackgroundSize:e.mobileBackgroundSize,mobileWidth:{value:e.mobileWidth!=null?e.mobileWidth:null,dim:e.mobileWidthDim},mobileHeight:{value:e.mobileHeight!=null?e.mobileHeight:null,dim:"px"},mobileBorderRadius:e.mobileBorderRadius,mobileBorder:e.mobileBorder}}function xj(e){const{position:t,borderAll:n,borderTop:r,borderRight:o,borderBottom:i,borderLeft:s}=A0(e),a=Object.fromEntries(Object.entries(L0(e)).map(([l,c])=>[`cell_${l}`,c]));return{cell_borderPosition:`cell_${t}`,cellBackgroundColor:e.getAttribute("style")?.includes("background-color:")?G(e.style.backgroundColor):"",cell_borderAll:n,cell_borderTop:r,cell_borderRight:o,cell_borderBottom:i,cell_borderLeft:s,...a}}function Oj(e){const t=e.closest("a");return{linkHref:t?.getAttribute("href")?.trim()??"",textLink:!!t,linkTarget:t?.getAttribute("target")??""}}function Rj(e){const t=e?.closest('div[style*="font-size"]');return e?.style?.fontSize?parseInt(e.style.fontSize,10):t?.style?.fontSize?parseInt(t.style.fontSize,10):null}function Mj(e,t){const n=t.requestElemWithStyle;return{fontFamily:t.getFontFamilyFromElement(n?.closest('[style*="font-family"]')||e),fontSize:Rj(n),textStrikethrough:t.textHasStyle(e,"s","strike")||n?.style.textDecoration.includes("line-through"),textUnderline:t.textHasStyle(e,"u")||n.style.textDecoration.includes("underline")||!n.style.textDecoration&&e.tagName==="A",lineHeight:t.getLineHeghtInPixels(n),textStrong:t.textHasStyle(e,"strong","b")||t.isElementHasBold(n),textItalic:t.textHasStyle(e,"i","em")||!n.closest('[style*="font-style: normal"]')&&n?.style?.fontStyle==="italic",textAlign:e.style?.textAlign||e.getAttribute("align")||e.closest("[align]")?.getAttribute("align")||"",textColor:G(e.closest('[style*="color"]')?.style.color)||G(getComputedStyle(e).color),textBackgroundColor:G(e.closest('[style*="background-color"]')?.style.backgroundColor)||G(getComputedStyle(e).backgroundColor),textValign:e.style?.verticalAlign||e.getAttribute("valign")||e.closest("[valign]")?.getAttribute("valign")||""}}function Pj(e,t,n){const r=e.elem,o=r.closest("td, th")??r,i=o.closest("table"),s=qe({elem:i}),a={direction:r.getAttribute("dir")??"none",show:s.show,outlookBackground:ha(r.closest(".em-element-custom-table")??r,"around"),customTable:{tableKey:n.tableKey(i),...L0(o),...kj(i),...Lj(i),...Nj(s),...xj(o),...Oj(r),...Mj(r,n)}};return r.getAttribute("new")&&(r.removeAttribute("new"),a.customTable.isNewLink=!0,r.setAttribute("em-edit","active")),{type:"customTable",caption:t.ELEMENT,settings:a}}function Ij(){const e=new WeakMap;let t=0;return n=>{let r=e.get(n);return r||(t+=1,r=`table-${t}`,e.set(n,r)),r}}function bu(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function Dj(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:bu(r.style.width),maxWidth:bu(r.style.maxWidth),minWidth:bu(r.style.minWidth),height:bu(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function N0(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 Bj(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function x0(e,t,n){return e?{fontFamily:Sa(e.closest('[style*="font-family"]')||e),textStrong:Je(e,"strong","b")||du(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:G(e.closest('[style*="color"]')?.style.color)||"",textBackgroundColor:G(e.closest('[style*="background-color"]')?.style.backgroundColor)||"",textStrikethrough:Hj(e),textUnderline:Fj(e)}:{}}function Hj(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 Fj(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 $j(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?x0(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:N0(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function Wj(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?x0(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:N0(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function O0(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function qj(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function R0(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function zj(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 Uj(e,t){const n=e.elem,r=qe({elem:n}),o=n.firstElementChild,i=o?qe({elem:o}):null,s=O0(r.mobileWidth),a=i?O0(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:qj(o?.getAttribute("width")),gap:{value:zj(n),dim:"px"},maxWidth:R0(n.style.maxWidth),minWidth:R0(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 M0(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 mp(e){return e.getAttribute("src")}function jj(e,t){const n=gf(e.elem),r=mp(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:P0(n,"width"),height:P0(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:Kc(n),borderRadius:Ti(n),boxShadow:fa(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 wa(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function P0(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function I0(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function Vj(e){return e.classList.contains("em-countdown")}function Gj(e){return e.classList.contains("em-video")}function _a(e){const t=String(e??"").trim();return t?G(t)??t:""}var hp={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function Xj(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 Kj(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 pp(e){return e.closest('table[em-type="social"]')}function Yj(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function D0(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 Pi(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 Vn(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function gp(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function Zj(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 Qj(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&&Vn(r,"em-platform")&&Vn(i,"em-platform")&&o instanceof HTMLElement&&!Vn(o,"em-platform")){const s=Zj(o);if(s!=null){t.gap=s;return}}}}function B0(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 Jj(e,t){const n=D0(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function eV(e,t){for(const n of e){if(!(n instanceof HTMLElement)||!Vn(n,"em-platform"))continue;const r=B0(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=B0(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function tV(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 nV(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=Pi(r),s=Pi(o instanceof HTMLElement?o:null),a=Pi(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=Pi(t),c=Pi(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function rV(e){const t=D0(e);if(!(t instanceof HTMLElement))return"";const n=Pi(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function bp(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 oV(e,t){const n=bp(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function iV(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!pp(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!Vn(n,"em-platform")&&r instanceof HTMLElement&&o instanceof HTMLElement&&Vn(r,"em-platform")&&Vn(o,"em-platform")&&pp(n))}function sV(e,t){const n=pp(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...hp,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...hp};Jj(n,r),oV(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");nV(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(m=>m instanceof HTMLElement&&Vn(m,"em-platform")),l=a.length>0?a:s.filter(m=>m.querySelector("img"));Qj(s,r),eV(l,r),tV(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?bp(u):null;if(d)c=d.w;else for(const m of l){if(!(m instanceof HTMLElement))continue;const p=bp(m);if(p){c=p.w;break}}let f=l.map(m=>{if(!(m instanceof HTMLElement))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const p=m,v=gp(p,"em-platform")||"unknown",C=Vn(p,"em-custom-icon"),k=p.querySelector("a"),L=p.querySelector("img"),E=k?.getAttribute("href")??"",g=k?.getAttribute("title")??L?.getAttribute("title")??"",y=L?.getAttribute("alt")??"",w=L?.getAttribute("src")??"",b=Xj(L instanceof HTMLImageElement?L:null),S=L?.getAttribute("height")?.trim(),_=S?parseInt(S,10):NaN,T=!Number.isNaN(_)&&_>0,x=gp(p,"em-button-bg")?.trim()??"",N=!C&&Vn(p,"em-tray-cell-bg");let I="",O="";if(!C&&(I=x,!I&&!N&&p.style?.backgroundColor&&(I=p.style.backgroundColor.trim()),O=gp(p,"em-item-border-color")?.trim()??"",!O)){const M=p.style.border?.trim()??"",V=/^(\d+)px\s+solid\s+(.+)$/i.exec(M);V?.[2]&&(O=V[2].trim())}return{platform:v,customIcon:C,href:E,alt:y,title:g,iconSrc:w,iconWidth:b,iconHeight:T?_:b,buttonBgColor:I,itemBorderColor:O}});if(d&&f.length>0&&f.every(m=>m.customIcon||!String(m.itemBorderColor??"").trim())){const m=d.color;f=f.map(p=>p.customIcon?p:{...p,itemBorderColor:m})}const h=Kj(f,hp.iconSize);return{type:"social",caption:t.SOCIAL??"Social media",align:r.align,iconSize:h,borderRadius:r.borderRadius,gap:r.gap,bgEnabled:r.bgEnabled,bgColor:_a(r.bgColor),borderWidth:r.borderWidth,borderColor:_a(r.borderColor),buttonBorderColor:"",buttonBorderWidth:c,showLabel:r.showLabel,hostCellBgForIconLuminance:_a(rV(n)),blockIndex:Yj(n),items:f.map(m=>({...m,buttonBgColor:_a(m.buttonBgColor),itemBorderColor:_a(m.itemBorderColor)}))}}function H0(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(F0)}function aV(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function F0(e){return e.nodeType===Node.COMMENT_NODE}function cn(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!F0(r));if(t.length===0)return!0;const n=t.filter(r=>!aV(r));return n.length===1&&n[0]instanceof Element&&H0(n[0])}function yp(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(cn(t))return t;return null}function vp(){const e=_f(document,'[em="group"]');return _f(e||document,'[em="block"]')}function gr(e){const t=e.children.length===1?e.children[0]:null;return t&&H0(t)?t:e}function lV(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function $0(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function cV(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function uV(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 dV(e,t){const n=e.elem;if(cn(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?G(n.style.backgroundColor):"",backgroundImage:uV(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:lV(n,"width"),maxWidth:$0(n,"maxWidth"),minWidth:$0(n,"minWidth"),align:n.getAttribute("align")??"",border:Kc(n),boxShadow:fa(n),borderRadius:Ti(n),mobileWidth:{value:cV(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:ha(n,"around")};return wa(n)&&(o.showOnMobile=!0),o}function fV(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function mV(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 hV(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 pV(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 gV(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 bV(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 yV(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 vV(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=bV(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function EV(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 SV(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 W0(e){return Le(e,!0).flatMap(SV)}function Ii(e,t){e.replaceChildren(...W0(t))}function wV(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function Ca(e,t){const n=W0(t),r=n.filter(s=>!wV(s)),[o]=r,i=r.length===1&&o.nodeType===Node.ELEMENT_NODE&&o.tagName==="TABLE";e.replaceChildren(...i?Array.from(o.childNodes):n)}function _V(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(h=>h.trim());l[d]=f}),l[t]=`${n}px`;const c=Object.entries(l).map(([u,d])=>`${u}: ${d}`).join("; ");s.setAttribute("style",c)}}),Ke(r)}function CV(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)}}),Ke(n)}function TV(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};`)}}}),Ke(n)}function AV(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;`)}}}),Ke(n)}function kV(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};`)}}}),Ke(r)}function LV(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};`)}}}),Ke(r)}function NV(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};`)}}}),Ke(n)}function xV(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};`)}}}),Ke(n)}function OV(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 RV(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 MV(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=OV(e),s=RV(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 q0(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 Ep(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function PV(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=Ke(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?Ke(l).trim():"",f=a?_r(q0(a)):"",h=l?_r(q0(l)):"",m=l?`<td${Ep(l)}></td>`:"",p=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:f,secondCellHtmlNoText:h,secondCellWrapperHtml:m,secondCellInnerDivHtml:p?_r(p):"",wrappedSecondCellHtml:l&&p?`<td${Ep(l)}>${_r(p)}</td>`:"",secondCellInnerDivWrapperHtml:p?`<div${Ep(p)}></div>`:"",secondCellTextHTML:d}}function z0(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function U0(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=z0(t)||" ":r.insertAdjacentText("afterbegin",z0(t)),_r(r)}function Di(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")}),Ke(t)}function j0(e){e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(t=>t.removeAttribute("id"))}function IV(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 Ke(o)}function DV(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 BV(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function HV(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 Sp(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=HV(BV(DV(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 FV(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function $V(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 WV(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html");hd(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?_r(l):e}function qV(e,t,n,r){const o=e.closest(`table.${t}`)||e.closest(`table.${n}`);o&&o.querySelectorAll("tr").forEach(i=>{const s=i.querySelector("td:nth-child(2)");if(!s)return;const a=Array.from(s.querySelectorAll("div, strong")).filter(l=>!l.closest("template"));if(a.length===0){const l=document.createElement("div");l.innerHTML=" ",s.appendChild(l)}else a.forEach(l=>{let c=Ue(l).trim();!c||c.replace(r,"")===""?l.innerHTML=" ":(c=c.replace(r,""),c.endsWith(" ")||(c+=" "),c=c.replace(/ +$/," "),Ii(l,c))})})}function zV(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html");hd(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?_r(o):""}function UV(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)}}),Ke(n)}var wp="em-element-list-ol",_p="em-element-list-ul",jV="em-element-list-bullet",VV=`.${wp}, .${_p}`,GV=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],XV="div, p, td, h1, h2, h3, h4, h5, h6",Gn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},Ta=null;function Cp(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 Ta&&Ta.container.isConnected&&e.contains(Ta.container)?Ta:null}function KV(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:yu(r),nodes:[...r],startIndex:o,endIndex:s-1}),r=[],o=s+1):r.push(i)}),r.length>0&&t.push({html:yu(r),nodes:[...r],startIndex:o,endIndex:n.length-1}),t}function YV(e){const t=[],n=Array.from(e.childNodes);let r=[],o=0;const i=a=>{r.length>0&&(t.push({html:yu(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:yu([a]),nodes:[a],startIndex:l,endIndex:l}),o=l+1):r.push(a)}),i(n.length),t}function yu(e){const t=document.createElement("div");return e.forEach(n=>{const r=n.cloneNode(!0);nn(n,r),t.appendChild(r)}),Zo(t),Ke(t)}function Tp(e,t){const n=Cp(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 V0(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 ZV(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=Tp(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=Tp(e,t);return{start:a,end:a}}const o=Tp(e,t),i=V0(e,r.startContainer,t,o),s=V0(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function G0(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 QV(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function X0(e){return e.nodeType===Node.TEXT_NODE&&/^[\t\n\f\r ]*$/.test(e.data)}function K0(e,t){const n=Y0(t);if(n.length===0){e.append(" ");return}e.append(...n),QV(e)}function Y0(e){let t=0,n=e.length-1;for(;t<=n&&X0(e[t]);)t++;for(;n>=t&&X0(e[n]);)n--;return e.slice(t,n+1)}var JV=["color","background-color","font-family","font-size","font-weight","font-style","text-decoration"];function eG(e){const t=Y0(Array.from(e.childNodes)),n=document.createElement("span");return JV.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 vu(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 Eu(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 Z0(e,t,n){const r=vu(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?`${Gn.LIST} ${i}`:Gn.LIST),o.append(...Array.from(t.childNodes)),t.replaceWith(o),Eu(e,r)}function tG(e){return e.querySelector("br")!==null}function nG(e){const t=Cp(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 rG(e){const t=Cp(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 h;d?(h=s,h.data=" "):(h=document.createTextNode(" "),s?e.insertBefore(h,s):e.appendChild(h));const m=window.getSelection();if(m){const p=document.createRange();p.setStart(h,0),p.collapse(!0),m.removeAllRanges(),m.addRange(p)}Ta={container:h,offset:0}}function oG(e,t){const n=G0(e),r=t?"ol":"ul";if(n.querySelector("ol, ul")){const o=nG(n);if(o){o.tagName.toLowerCase()!==r&&Z0(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&&Z0(n,i,r);return}}tG(n)||n.querySelector(":scope > ol, :scope > ul")?(rG(n),iG(n,r)):Q0(n,r)}function Q0(e,t){const n=vu(e),r=document.createElement(t);r.setAttribute("style",Gn.LIST);const o=document.createElement("li");o.setAttribute("style",Gn.LIST_ITEM),K0(o,Array.from(e.childNodes)),r.appendChild(o),e.replaceChildren(r),Eu(e,n)||J0(o)}function iG(e,t){const n=YV(e);if(n.length===0){Q0(e,t);return}const{start:r,end:o}=ZV(n,e),i=vu(e),s=document.createElement(t);s.setAttribute("style",Gn.LIST);let a=null;for(let h=r;h<=o;h++){const m=document.createElement("li");m.setAttribute("style",Gn.LIST_ITEM),K0(m,n[h].nodes),s.appendChild(m),a=m}const l=document.createDocumentFragment(),c=h=>h.forEach((m,p)=>{p>0&&l.appendChild(document.createElement("br")),l.append(...m.nodes)}),u=h=>h.map(m=>m.html).join("<br>").trim()!=="",d=n.slice(0,r);u(d)&&(c(d),l.appendChild(document.createElement("br"))),l.appendChild(s);const f=n.slice(o+1);u(f)&&(l.appendChild(document.createElement("br")),c(f)),e.replaceChildren(l),!Eu(e,i)&&a&&J0(a)}function J0(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 sG(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 aG(e,t){const n=KV(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 lG(e){const t=G0(e),n=t.querySelector("ol, ul");if(!n)return;const r=vu(t),o=sG(t,n),i=document.createDocumentFragment();n.querySelectorAll(":scope > li").forEach(s=>{const a=Ue(s).trim();!a||a===" "||(i.hasChildNodes()&&i.appendChild(document.createElement("br")),i.append(...eG(s)))}),n.replaceWith(i.hasChildNodes()?i:" "),Eu(t,r)||aG(t,o)}function Su(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(VV):!1}function cG(e,t,n){const r=hj()||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=eT(e.elem,n),h=Je(o,"strong","b"),m=s!==o?Je(s,"strong","b"):!1,p=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?Je(e.elem,"strong","b"):!1,v=h||m||p,C=du(s),k=v||C,L={type:"text",caption:t.TEXT,fontFamily:Sa(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:uu(a),lineHeightDim:"px",textAlign:h0(e.elem),textStrong:k,textItalic:Je(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s.style?.fontStyle==="italic",textStrikethrough:Je(e.elem,"s","strike")||(s.style?.textDecoration?.includes("line-through")??!1),textUnderline:Je(e.elem,"u")||(s.style?.textDecoration?.includes("underline")??!1)||!s.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||p0()),textColor:Su(r)&&G(Gr(r,"color"))||G(e.elem.closest('[style*="color"]')?.style.color)||G(getComputedStyle(e.elem).color)||"",textBackgroundColor:mG(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:lp(e.elem),linkHref:(()=>{const E=s.closest("a");if(!E)return;const g=E.getAttribute("href");if(g!==null)return g})(),textAnchor:(()=>{const E=s.closest("a");if(E&&!E.hasAttribute("href"))return E.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const E=s.closest("a");return E?!!E.hasAttribute("href"):Je(e.elem,"a")||p0()})(),textReplacer:n.variableElement(e.elem),list:f,standardList:tT(e.elem),textSuperscript:Je(e.elem,"sup"),textSubscript:Je(e.elem,"sub")};return wa(r)&&(L.showOnMobile=!0),L}function eT(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?G(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?Sa(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 tT(e){return Su(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function Ap(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var uG=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function dG(e){let t=e;for(;t&&uG.has(t.tagName);){const n=t.style.backgroundColor;if(Ap(n))return n;t=t.parentElement}return""}function fG(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(Ap(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function mG(e){const t=dG(e);if(Ap(t))return G(t)||"";if(e.closest(".em-element-custom-table"))return G(Gr(e,"background-color"))||"";const n=e.closest("div");return G(fG(e,"background-color",n))||""}function nT(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 hG(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,h=qe({elem:d}),m=qe({elem:f}),p=eT(e.elem,n),v={type:"text",caption:t.TEXT,linkHref:(()=>{const C=e.elem.getAttribute("href");if(C!==null)return C})(),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:Sa(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:uu(e.elem),lineHeightDim:"px",textAlign:h0(e.elem),textStrong:Je(u,"strong","b")||du(u),textItalic:Je(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:Je(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:Je(u,"u")||(e.elem.style?.textDecoration?.includes("underline")??!1)||!(e.elem.style?.textDecoration?.length>0)&&e.elem.tagName==="A"&&e.elem.hasAttribute("href"),textColor:G(e.elem.tagName==="A"?Gr(e.elem.querySelector('[style*="color"]'),"color"):Gr(e.elem,"color"))||G(getComputedStyle(e.elem).color)||"",textBackgroundColor:G(e.elem.tagName==="A"?Gr(e.elem.querySelector('[style*="background-color"]'),"background-color"):Gr(e.elem,"background-color"))||"",mobileFontSize:{value:h.mobileFontSize,dim:h.mobileFontSizeDim||"px"},mobileLineHeight:{value:m.mobileLineHeight,dim:"px"},mobileTextAlign:lp(e.elem),textReplacer:i(e.elem),list:p,standardList:tT(e.elem),textSuperscript:Je(e.elem,"sup"),textSubscript:Je(e.elem,"sub")};return wa(e.elem)&&(v.showOnMobile=!0),v}function rT(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function pG(e,t){const n=e.elem,r=qe({elem:n}),o=rT(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 gG(e,t){const n=e.elem,r=qe({elem:n}),o=rT(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 oT(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 iT(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function bG(e,t){return e.elem.tagName==="TD"?pG(e,t):gG(e,t)}var sT={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},aT={TRIM_SPACES:/^(\s| )+|(\s| )+$/g,LT:/</g,GT:/>/g,EMPTY_TEXT:/^(?:\s| )*$/};function lT(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function wu(e){const t=lT(e,wp),n=lT(e,_p),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:wp,classNameUl:_p,classNameBullet:jV,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function yG(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function vG(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function EG(e=Object.values(sT)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function SG(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function cT(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&&cT(n,t)}}function wG(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 _G(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 CG(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var TG="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function AG(e,t=TG){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 kG(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 LG(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 NG(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){gf(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 xG(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 OG(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=Th(n)??n),n}function RG(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:{tableKey:t.tableKey,parseTableElementToModel:t.parseTableElementToModel,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 MG(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 PG(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"&&Su(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(MG(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 IG={_isCarouselElement:up,_isAccordionElement:d0,_isSocialBlockElement:iV,_isImageElement:I0,_isLinkElement:vj,_isButtonElement:y0,_isTableElement:fV,_isCustomTableElement:k0,_isAtomElement:Bj,_isTdColumnGroup:mV,_isTdStructure:hV,_isEmptyTd:pV,_isTdCell:gV,_isVindentTd:oT,_isVindentDiv:iT,_isFloatBlockElement:M0,_isDivTextElement:nT,_isInlineButtonElement:Ej,_extractTextSettings:cG,_extractCarouselSettings:Sj,_extractAccordionSettings:oj,_extractSocialSettings:sV,_extractImgSettings:jj,_extractButtonSettings:yj,_extractLinkTextSettings:hG,_extractTableSettings:dV,_extractCustomTableSettings:Pj,_extractAtomElementSettings:$j,_extractProgrammaticElementSettings:Wj,_extractTdColumnGroupSettings:yV,_extractTdStructureSettings:vV,_extractTdCellSettings:EV,_extractVindentSettings:bG,_extractFloatBlockSettings:Uj,_extractDivContainerSettings:Dj,_clearActiveEditElements:s5};function DG(e){const t=e.programmaticSelection??{get:()=>!!j.get("isProgrammaticSelection"),reset:()=>j.set("isProgrammaticSelection",!1)},n=Ij(),r=()=>{const i={operation:"application_element_settings_set",settings:e.getMapObj().unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};z.send(i)},o=i=>{if(e.selectionLock.isLocked())return;const s=i.elem??document.querySelector("[em-edit]"),a=e.selectionLock.acquire();try{if(Lr("em-edit"),!s){setTimeout(()=>{const E=document.querySelector("[em-edit]");E?.isConnected?o({elem:E}):r()},0);return}if(s.closest(".em-prevent-action"))return;const l=OG(s,{getVariableByIcon:ca,htmlDocument:e.htmlDocument,findOutermostParentWithText:Wf,sendResizeEvent:AC}),c=l.tagName==="EDITOR"&&l.firstChild?.nodeType===1?l.firstChild:l,u=wu(l),d=window.getSelection()?.isCollapsed??!0;NG(l,d,!!l.querySelector("editor"),{removeAllAttributes:Lr});const f={...IG,HTMLDocument:e.htmlDocument,parseFromString:Le,getParentElementOfSelection:zl,getSelectedText:Qe,findElementWithSelectedText:Ns,parseTableElementToModel:Li,tableKey:n,isElementHasBold:JI,Locale:Mi(),isProgrammaticSelection:t.get(),getElementTdDiv:VU,getLineHeghtInPixels:uu,getFontFamilyFromElement:E=>_G(E,c),textHasStyle:Je,activeCell:j.get("activeCell"),CLASS_FOR_BASIC_CELL:bo,requestElemWithStyle:c},h=RG({elem:l,isCellCustomTable:!!l.closest(".em-element-custom-table"),listContext:{isListOL:u.isListOL,isListUL:u.isListUL,isList:u.isList},requestElemBullet:u.isList?yG(l):null,variableElement:(E,g=!1)=>xG(g,{getSelectedText:Qe,getRangeFromSelection:CG})},f),m=PG(l,d,h),p={operation:"application_element_settings_set",type:m.type,caption:m.caption,settings:m.settings},v=LG(l,m,p,{removeAllAttributes:Lr});if(v.isProgrammaticSelectionReset&&t.reset(),v.shouldReturn)return;const C=kG({elem:l,message:p,activateSection:i.activateSection},{getElementParentCaption:u0,getStructureColumns:GU,getUsedColors:PC,getElementPath:rj,getCurrentElementPath:QU,mapObj:e.getMapObj(),commonStyles:j.get("commonStyles"),...e.enrichExtras()});j.update({elementPath:C.elementPath});const k=e.elementRefOf?.(l),L=k===void 0?C.message:{...C.message,elementRef:k};return e.fingerprint.remember(l),z.send(L),L}finally{Promise.resolve().then(()=>{try{e.fingerprint.remember(document.querySelector("[em-edit]"))}finally{a.release()}})}};return o}function uT(){return j.get("emailWidth")}function BG(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 kp(e){const t=document.createElement("table");return t.replaceChildren(...Le(e,!0)),t}function Lp(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>Pt(r)).join(`
|
|
92
|
-
`);const n=e.querySelector("tr");return n?Pt(n):kt(e)}function Np(e,t){const n=uT(),r=kp(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)),jl({elem:a,width:f})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",jl({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=_E(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(!BG(a))return;const f=a.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),h=f?parseFloat(f.getAttribute("width")||"0"):0,m=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").length;let p=0,v=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(L=>{if(L.getAttribute("width")&&!L.classList.contains("em-insert-ignore")){const E=parseFloat(L.getAttribute("width"))/i,g=Math.round(parseFloat(String(o*E))-h/(m*2));L.setAttribute("width",String(g)),p+=g}});const C=o-(u+d+h*(m-1)+p);a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(L=>{if(L.getAttribute("width")&&!L.classList.contains("em-insert-ignore")){const E=parseFloat(L.getAttribute("width"))+Math.round(C/m);v+=E,L.setAttribute("width",String(E)),L.querySelector("img")&&L.querySelectorAll("img").forEach(g=>{parseFloat(g.getAttribute("width")||"0")>parseFloat(L.getAttribute("width"))+Math.round(C/m)&&(g.setAttribute("width",L.getAttribute("width")),g.style.maxWidth=L.getAttribute("width")+"px")})}}),v=v+h*(m-1)+u+d;const k=o-v;if(k!==0&&p>0){const L=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(L&&!L.classList.contains("em-insert-ignore")){const E=parseFloat(L.getAttribute("width")||"0");L.setAttribute("width",String(E+k))}else{const E=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let g=E.length-1;g>=0;g--){const y=E[g];if(y.classList.contains("em-insert-ignore"))continue;const w=parseFloat(y.getAttribute("width")||"0");y.setAttribute("width",String(w+k));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 Lp(r)}function xp(e){const t=kp(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"))})}),Lp(t)}function Op(e,t){const n=uT(),r=kp(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",jl({elem:s,width:o})),Lp(r)}function _u(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))})}function dT(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 HG(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}}function FG(e,t,n){const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let o=0;for(;r.nextNode();){const i=r.currentNode;if(i===t)return o+n;o+=i.textContent?.length||0}return-1}function fT(e){return Array.from(e.rows).flatMap(t=>Array.from(t.cells))}function mT(e,t,n){const r=e.findIndex(i=>i.contains(t));if(r<0||t.nodeType!==Node.TEXT_NODE)return null;const o=FG(e[r],t,n);return o<0?null:{cell:r,offset:o}}function $G(e){const t=window.getSelection();if(!t?.rangeCount)return null;const n=t.getRangeAt(0),r=fT(e),o=mT(r,n.startContainer,n.startOffset),i=mT(r,n.endContainer,n.endOffset),s=!!n.startContainer.parentElement?.closest("editor");return o&&i?{start:o,end:i,inEditor:s}:null}function WG(e,t,n){const r=fT(e),o=r[t.start.cell]?.querySelector(":scope > div");t.inEditor&&o&&n&&n(o,!0);const i=({cell:u,offset:d})=>r[u]?dT(r[u],d):null,s=i(t.start),a=i(t.end),l=window.getSelection();if(!s||!a||!l)return;const c=document.createRange();c.setStart(s.node,s.offset),c.setEnd(a.node,a.offset),l.removeAllRanges(),l.addRange(c)}function Xr(e,t){return t===void 0?{rejected:e}:{rejected:e,key:t}}function qG(e){return"rejected"in e}function Cu(e){return{status:"rejected",reason:e.rejected,...e.key===void 0?{}:{key:e.key}}}function zG(e,t){Array.from(e.attributes).forEach(n=>e.removeAttribute(n.name)),Array.from(t.attributes).forEach(n=>e.setAttribute(n.name,n.value)),e.replaceChildren(...Array.from(t.childNodes))}function hT(e,t,n){if(t.isEditLocked())return Cu(Xr("locked"));const r=e.outerHTML,o=e.cloneNode(!0),i=n.movesCells?null:$G(e),s=()=>{i&&WG(e,i,t.wrapEditor)},a=()=>{zG(e,o),s()};try{const l=n.edit(e);return qG(l)?(e.outerHTML!==r&&a(),Cu(l)):(Ca(e,t.tableModelToHtml(l)),s(),n.afterWrite?.(e),{status:"applied"})}catch(l){throw a(),l}}var pT=["top","right","bottom","left"],gT={cell_borderAll:"all",cell_borderTop:"top",cell_borderRight:"right",cell_borderBottom:"bottom",cell_borderLeft:"left"},Rp={paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"],paddingLeft:["left"],paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"]},UG={top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"},bT=e=>t=>[[e,St(t)??0]];function yT(e){const t=e??{};return pT.map(n=>[UG[n],St(t.all??t[n])??0])}function vT(e){const t=St(e.width);return{...t===null?{}:{width:t},...Fe(e.style)?{}:{style:e.style},...Fe(e.color)?{}:{color:jn(e.color)}}}function jG(e){return dp(e)||e.width===0||e.color===""}function VG(e){return(t,n,{ids:r,ctx:o})=>{const i=n??{},s=o.getExternalBorders(t,r),a=gT[e];let l=t;if(a==="all"){const u=jG(i);for(const d of Object.keys(s))l=u?o.clearCellBorders(l,[d],pT):o.updateCellBordersByIds(l,[d],s[d],vT(i)),l=o.addClassToCellsByIds(l,[d],Ir);return o.addClassToCellsByIds(l,Object.keys(s),Dr)}const c=Object.keys(s).filter(u=>s[u].includes(a));return l=dp(i)?o.clearCellBorders(l,c,[a]):o.updateCellBordersByIds(l,c,[a],vT(i)),o.addClassToCellsByIds(l,r,Dr)}}var GG=(e,t,{ids:n,ctx:r})=>{const o=r.getExternalCorners(e,n);let i=e;for(const s of Object.keys(o))i=r.updateCellBorderRadiusByIds(i,[s],o[s],St(t)??0),i=r.addClassToCellsByIds(i,[s],Dr);return i};function ET(e){return(t,n,{ids:r,ctx:o})=>{let i=o.addClassToCellsByIds(t,r,Ir);for(const[s,a]of e(n))i=o.updateCellPaddingByIds(i,r,Rp[s],a);return o.addClassToCellsByIds(i,r,Dr)}}function ST(e){return(t,n,{ctx:r})=>e(n).reduce((o,[i,s])=>r.updateTablePadding(o,{settings:{[i]:s}}),t)}var wT={...Object.fromEntries(Object.keys(Rp).map(e=>[e,ST(bT(e))])),...Object.fromEntries(Object.keys(Rp).map(e=>[`cell_${e}`,ET(bT(e))])),padding:ST(yT),cell_padding:ET(yT),...Object.fromEntries(Object.keys(gT).map(e=>[e,VG(e)])),cellBackgroundColor:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(r.updateTableCellBackgroundByIds(e,n,jn(t)),n,Dr),cell_borderPosition:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(e,n,Ir),cell_borderRadiusAll:GG},XG=["all","topLeft","topRight","bottomRight","bottomLeft"];function Kr(e){return(t,n,{settings:r,ctx:o})=>o[e]({settings:r,elem:t})}function _T(e,t){return(n,r,{ctx:o})=>{const i=r??{},s={...i,value:Fe(i.value)?null:i.value};o[t]({settings:{[e]:s},elem:n})}}var KG=(e,t,{ctx:n})=>{const r=t??{};if(Fe(r.hOffset)&&Fe(r.vOffset)||r.color===""){da(e,r.classNamePrefix||"em-mob-box_shadow-");return}n.setElementMobileBoxShadow({settings:{mobileBoxShadow:r},elem:e})},YG=(e,t,{ctx:n})=>{const r=t??{},o=XG.find(i=>i in r);if(o){if(St(r[o])){n.setElementMobileBorderRadius({settings:{mobileBorderRadius:r},elem:e});return}da(e,o==="all"?"em-mob-border_radius_":r.classNamePrefix||`em-mob-border_radius_${o}-`)}},ZG={mobileWidth:_T("mobileWidth","setElementMobileWidth"),mobileHeight:_T("mobileHeight","setElementMobileHeight"),show:Kr("setElementShow"),mobileBackgroundColor:Kr("setElementMobileBackgroundColor"),mobileBackgroundImage:Kr("setElementMobileBackgroundImage"),mobileBackgroundPositionX:Kr("setElementMobileBackgroundPositionX"),mobileBackgroundPositionY:Kr("setElementMobileBackgroundPositionY"),mobileBackgroundRepeat:Kr("setElementMobileBackgroundRepeat"),mobileBackgroundSize:Kr("setElementMobileBackgroundSize"),mobileBorder:Kr("setElementMobileBorder"),mobileBoxShadow:KG,mobileBorderRadius:YG},Tu={topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"},QG={"background-size":"cover","background-repeat":"no-repeat","background-position":"center"};function Mp(e){const t=St(e.getAttribute("border"));t&&T0(e,"all",{width:t,style:"solid",color:e.getAttribute("bordercolor")||null}),["border","bordercolor","border-collapse"].forEach(n=>e.removeAttribute(n))}function CT(e){["border-radius",...Object.values(Tu)].some(t=>!/^(0px\s*)*$/.test(e.style.getPropertyValue(t)))||e.style.boxShadow?e.style.borderCollapse="separate":e.style.borderCollapse==="separate"&&e.style.removeProperty("border-collapse")}function JG(e){return(t,n)=>{Mp(t),T0(t,mu[e],n??{}),t.style.borderCollapse||(t.style.borderCollapse="collapse")}}var eX=(e,t)=>{const n=t??{};Mp(e);const r=St(n.all);r?Ai({elem:e,settings:{borderRadius:{all:r}}}):("all"in n&&e.style.removeProperty("border-radius"),Object.keys(Tu).forEach(o=>{const i=St(n[o]);i?e.style.setProperty(Tu[o],`${i}px`):("all"in n||o in n)&&e.style.removeProperty(Tu[o])})),CT(e)},tX=(e,t)=>{const n=t??{};Mp(e);const r=!Fe(n.color)&&!Fe(n.hOffset)&&!Fe(n.vOffset)?{hOffset:St(n.hOffset),vOffset:St(n.vOffset),blurRadius:St(n.blurRadius),spreadRadius:St(n.spreadRadius),color:jn(n.color),inset:!!n.inset}:{hOffset:null,vOffset:null};oC({elem:e,settings:{boxShadow:r}}),CT(e)},nX=(e,t)=>{if(Fe(t)){e.removeAttribute("bgcolor"),e.style.removeProperty("background-color");return}e.setAttribute("bgcolor",jn(t)),e.style.backgroundColor&&(e.style.backgroundColor=jn(t))},rX=(e,t)=>{const n=t?.[0]?.value;if(Fe(n)){e.removeAttribute("data-bg-image"),e.style.removeProperty("background-image");return}e.setAttribute("data-bg-image",jn(n)),e.style.setProperty("background-image",`url('${n}')`),Object.entries(QG).forEach(([r,o])=>{(r==="background-position"?e.style.backgroundPositionX:e.style.getPropertyValue(r))||e.style.setProperty(r,o)})};function TT(e){return(t,n)=>{const r=St(n);rC(t,{[e]:r===null?void 0:`${r}px`})}}var oX={...Object.fromEntries(Object.keys(mu).map(e=>[e,JG(e)])),borderRadius:eX,boxShadow:tX,backgroundColor:nX,backgroundImage:rX,backgroundPositionX:TT("backgroundPositionX"),backgroundPositionY:TT("backgroundPositionY"),backgroundSize:(e,t)=>{e.style.backgroundSize=jn(t)},backgroundRepeat:(e,t)=>{e.style.backgroundRepeat=jn(t)}},iX=["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"];function sX(e){return e?.querySelector(":scope > div, :scope > editor > div")??null}function aX(e){const t=window.getSelection(),n=t&&t.rangeCount?t.getRangeAt(0):null;if(!n||n.collapsed||!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;const{startContainer:r,startOffset:o,endContainer:i,endOffset:s}=n;return{startContainer:r,startOffset:o,endContainer:i,endOffset:s}}function AT(e,t){const n=document.createRange();return t&&e.contains(t.startContainer)&&e.contains(t.endContainer)?(n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n.selectNodeContents(e),n}function kT(e){const t=window.getSelection()?.anchorNode,n=(t instanceof Element?t:t?.parentElement)?.closest("a");if(n&&e.contains(n))return n;if(e.tagName==="A")return e;const r=e.querySelectorAll("a");return e.querySelector("a[em-edit]")??(r.length===1?r[0]:null)}function LT(e,{settings:t,activeElement:n}){"textAlign"in t&&(t.textAlign?e.setAttribute("align",jn(t.textAlign)):n.style?.textAlign?n.style.removeProperty("text-align"):e.removeAttribute("align")),t.valign?e.closest("td")?.setAttribute("valign",jn(t.valign)):t.valign===""&&e.closest("td")?.removeAttribute("valign")}function NT(e,t,n,r){const{settings:o,ctx:i}=n;i.wrapEditor(e,!0),i.textStyleProperties.some(s=>s in o)&&(i.addNewRange(t?AT(e,t):r()),i.toggleTextStyle(e,{settings:o}))}function lX(e,t){const n=aX(e),r="linkHref"in t.settings?kT(e):null;if("linkHref"in t.settings&&!r)return Xr("invalid-value","linkHref");NT(e,n,t,()=>AT(e,null)),r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),LT(e,t)}function cX(e,t){for(const n of e){NT(n,null,t,()=>{const o=document.createRange();return o.selectNode(n),o});const r="linkHref"in t.settings?kT(n):null;r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),LT(n,t)}}function uX(e,t,n){if(!t.length)return;const r=e.querySelector(`td.${yo}, td.${Ir}, td.${bo}`),o=(t.length===1&&r?[r]:t.map(i=>np(e,i))).map(sX).filter(i=>!!i);if(t.length===1&&o.length===1)return lX(o[0],n);cX(o,n)}var dX=["borderPosition","mobileBorderPosition","outlookBackground","exportAsPicture"],xT={...oX,...ZG};function fX(e){if(!e||typeof e!="object"||!Object.keys(e).length)return Xr("empty");const t={live:[],cells:[],text:!1,forCells:!1};for(const[n,r]of Object.entries(e))if(xT[n])t.live.push([xT[n],r]);else if(wT[n])t.cells.push([wT[n],r]),t.forCells||(t.forCells=n.startsWith("cell"));else if(iX.includes(n))t.text=!0,t.forCells=!0;else if(!dX.includes(n))return Xr("unknown-setting",n);return t}function OT(){return document.querySelector(`.${bo}, .${Ir}, .${yo}`)}function mX(e){const t=e.activeElement??OT(),n=t?.closest(".em-element-custom-table");return t&&n?{table:n,activeElement:t}:null}function hX(e){const t=e.tagName==="TD"?e.querySelector("div"):e.tagName==="TR"?e.querySelector("editor div"):null;return t?.setAttribute("em-edit","active"),t??e}function pX(e,t){if(!e.querySelector(".remove-basic-cell"))return t.activeCell??[];document.querySelectorAll(`.${Ir}`).forEach(r=>{r.classList.remove(Ir)});const n=t.getCellsWithClasses(t.parseTableElementToModel(e),[bo,yo]);return t.state.set("activeCell",n),n}function gX(e,t,n,r){const o=fX(t);if("rejected"in o)return o;const i=pX(e,r);if(o.forCells&&!i.length)return Xr("no-cell");const s=hX(n.activeElement);o.live.forEach(([c,u])=>c(e,u,{settings:t,ctx:r})),Tj(e);const a=o.text?uX(e,i,{settings:t,activeElement:s,ctx:r}):void 0;if(a)return a;let l=o.cells.reduce((c,[u,d])=>u(c,d,{ids:i,ctx:r}),r.parseTableElementToModel(e));return(/border-collapse:/.test(e.getAttribute("style")??"")||e.className.includes("em-mob-border_"))&&(l=r.removeOuterBorders(l)),l}function bX(e,t){[bo,yo].forEach(r=>{document.querySelectorAll(`.${r}`).forEach(o=>o.classList.remove(r))});const n=e.querySelectorAll(`.${Dr}`);n[0]?.setAttribute("em-edit",""),n.forEach(r=>r.classList.remove(Dr)),pa(e,t,"around")}function yX(e,t){const n=mX(t);return n?hT(n.table,t,{edit:r=>gX(r,e,n,t),afterWrite:r=>bX(r,e)}):Cu(Xr("no-table"))}var vX=new Set(["alt","title","link"]);function EX(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>vX.has(o))&&e.parentNode===t.parent}function SX(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 wX(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||EX(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=sr(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,h)=>{l[h]&&f.setAttribute("expanded","")}))}}}function _X(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?zr(i):null,a=o?zr(o):null,l=!!s&&!a,c=Uh(o),u=e.outlookRounding===!0||e.outlookRounding!==!1&&(l||c)?o:i;if(e.exportAsPicture?n.closest("table")?.setAttribute("em-operation","exportAsPicture"):n?.closest("table")?.getAttribute("em-operation")==="exportAsPicture"&&n.closest("table")?.removeAttribute("em-operation"),e.href!==void 0&&n.closest("a")?.setAttribute("href",e.href),e.align){const m=n.closest("td")?.closest("table")?.closest("div, p, td");m&&(m.style.textAlign?m.style.textAlign=e.align:m.setAttribute("align",e.align))}else if(e.align===""){const m=n.closest("td")?.closest("table")?.closest("div, p, td");m&&(m.style.textAlign?m.style.removeProperty("text-align"):m.removeAttribute("align"))}if(e.textAlign){const m=n.closest("td");m&&(m.style.textAlign?m.style.textAlign=e.textAlign:m.setAttribute("align",e.textAlign))}else if(e.textAlign===""){const m=n.closest("td");m&&(m.style.textAlign?m.style.removeProperty("text-align"):m.removeAttribute("align"))}if(e.valign?n.closest("td")?.closest("table")?.closest("td")?.setAttribute("valign",e.valign):e.valign===""&&n.closest("td")?.closest("table")?.closest("td")?.removeAttribute("valign"),e.width){const m=n.closest("table");m&&(e.width.value?(m.setAttribute("width",e.width.value+(e.width.dim==="px"?"":"%")),m.style.width=e.width.value+e.width.dim):(m.removeAttribute("width"),m.style.removeProperty("width")))}if(e.height){const m=n.closest("td"),p=n.closest("a");if(e.height.value){if(m&&(m.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),m.style.height=e.height.value+e.height.dim),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 C=p.closest("editor")||p.querySelector("editor");C&&(C.style.height=v,C.style.lineHeight=v)}}else if(m&&(m.removeAttribute("height"),m.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 m=n.closest("td");m&&(e.backgroundImage[0].value===""?(m.style.removeProperty("background-image"),m.removeAttribute("background")):(m.style.removeProperty("background-image"),Ht(m,"background",TX(e))))}if(e.backgroundPositionX!==void 0){const m=n.closest("td");m&&(e.backgroundPositionX===""?m.style.removeProperty("background-position-x"):m.style.backgroundPositionX=e.backgroundPositionX)}if(e.backgroundPositionY!==void 0){const m=n.closest("td");m&&(e.backgroundPositionY===""?m.style.removeProperty("background-position-y"):m.style.backgroundPositionY=e.backgroundPositionY)}if(e.backgroundRepeat){const m=n.closest("td");m&&(e.backgroundRepeat==="none"?m.style.removeProperty("background-repeat"):m.style.backgroundRepeat=e.backgroundRepeat)}if(e.backgroundSize!==void 0){const m=n.closest("td");m&&(e.backgroundSize===""?m.style.removeProperty("background-size"):m.style.backgroundSize=e.backgroundSize)}if(e.padding){const m=n.closest("a");m&&(e.padding.all!==void 0?(m.style.paddingTop=e.padding.all+"px",m.style.paddingRight=e.padding.all+"px",m.style.paddingBottom=e.padding.all+"px",m.style.paddingLeft=e.padding.all+"px"):(e.padding.top!==void 0&&(m.style.paddingTop=e.padding.top+"px"),e.padding.right!==void 0&&(m.style.paddingRight=e.padding.right+"px"),e.padding.bottom!==void 0&&(m.style.paddingBottom=e.padding.bottom+"px"),e.padding.left!==void 0&&(m.style.paddingLeft=e.padding.left+"px")))}if(e.borderRadius&&u&&t.setElementBorderRadius({settings:e,elem:u}),e.mobileWidth){const m=n.closest("table");m&&t.setElementMobileWidth({settings:e,elem:m}),r=!0}if(e.mobileHeight){const m=n.closest("td");m&&t.setElementMobileHeight({settings:e,elem:m}),t.setElementMobileLineHeight({settings:e,elem:n}),r=!0}if(e.mobileBorder){const m=n.closest("td");m&&t.setElementMobileBorder({settings:e,elem:m}),r=!0}if(e.mobileBorderRadius){const m=n.closest("td");m&&t.setElementMobileBorderRadius({settings:e,elem:m}),r=!0}if(e.mobileBoxShadow){const m=n.closest("td");m&&t.setElementMobileBoxShadow({settings:e,elem:m}),r=!0}if(e.mobileTextAlign){const m=Ea(n);m&&t.setElementMobileAlign({settings:e,elem:m,fieldName:"mobileTextAlign"}),r=!0}if(e.mobileAlign){const m=n.closest("td")?.closest("table");m&&t.setElementMobileTableAlign({settings:e,elem:m}),r=!0}if(e.mobileVerticalAlign){const m=n.closest("td");m&&t.setElementMobileVerticalAlign({settings:e,elem:m}),r=!0}if(e.mobileBackgroundColor){const m=n.closest("td");m&&t.setElementMobileBackgroundColor({settings:e,elem:m}),r=!0}if(e.mobileBackgroundImage){const m=n.closest("td");m&&t.setElementMobileBackgroundImage({settings:e,elem:m}),r=!0}if(e.mobileBackgroundPositionX){const m=n.closest("td");m&&t.setElementMobileBackgroundPositionX({settings:e,elem:m}),r=!0}if(e.mobileBackgroundPositionY){const m=n.closest("td");m&&t.setElementMobileBackgroundPositionY({settings:e,elem:m}),r=!0}if(e.mobileBackgroundRepeat){const m=n.closest("td");m&&t.setElementMobileBackgroundRepeat({settings:e,elem:m}),r=!0}const d=e;if(d.mobileBackgroundSize){const m=n.closest("td");m&&t.setElementMobileBackgroundSize?.({settings:d,elem:m}),r=!0}if(e.mobilePadding&&(t.setElementMobilePadding({settings:e,elem:n}),r=!0),e.show){const m=n.closest("table");m&&t.setElementShow({settings:e,elem:m}),r=!0}const f=n.closest("a");if(f&&e.textColor!==void 0){const m=String(e.textColor||"");f.style.color=m,f.querySelectorAll('span[style*="color"], font[color]').forEach(p=>{p.style.removeProperty("color"),p.removeAttribute("color")})}if(f&&e.textBackgroundColor!==void 0){const m=String(e.textBackgroundColor||"");f.style.backgroundColor=m,f.querySelectorAll('span[style*="background-color"]').forEach(p=>{p.style.removeProperty("background-color")})}const h=["textColor","textBackgroundColor"];if(t.textStyleProperties.filter(m=>!h.includes(m)&&e.hasOwnProperty(m)).length>0)try{t.toggleTextStyle(n,{type:"button",settings:e})}catch{}return e.mobileFontSize&&(t.setElementMobileFontSize({settings:e,elem:n}),r=!0),e.textReplacer!==void 0&&CX(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?Vh(n,e):e.outlookRounding===!1?EW(n):(s||c)&&Vh(n,e),i&&pa(i,e,"inside"),r}function CX(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(/~~.*$/,""),h=document.createElement("em-replace");h.setAttribute("text",f),o.surroundContents(h)}}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,h=>{const m=e,p=h.textContent||"";return m.length===1&&f.test(p)?!0:n(p,m)}),l&&(l.setAttribute("text",e),l.textContent=e),l||(u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse())}else u=document.createElement("em-replace"),u.setAttribute("text",i),o.insertNode(u),u.innerHTML=i,o.collapse()}l&&!c&&(l.getAttribute("text")===l.innerHTML&&(l.innerHTML=e),l.setAttribute("text",e))}else if(e===""){const r=t?.closest("em-replace")||t?.querySelector("em-replace");if(r){const o=r.parentNode,i=r.firstChild,s=r.lastChild;if(r.getAttribute("text")!==r.innerHTML&&o)for(;r.firstChild;)o.insertBefore(r.firstChild,r);const a=document.createRange(),l=window.getSelection();i&&s&&l&&(a.setStartBefore(i),a.setEndAfter(s),l.removeAllRanges(),l.addRange(a)),r.remove()}}}function TX(e){return e.backgroundImage?.[0]?.value??""}function AX(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),pa(n,e,"inside"),r}function Pp(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&&Pp({elem:e.elem.previousSibling,width:e.width})}function kX(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"&&Pp({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,Pp({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+")",Ht(n,"background",LX(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),pa(n,e,"around"),r}function LX(e){return e.backgroundImage?.[0]?.value??""}function Aa(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function NX(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),Aa(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+")",Ht(n,"background",RX(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))&&OX(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&&(xX(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}),pa(n,e,"inside"),r}function xX(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";dj(t,(s,a)=>{fj(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 OX(e,t){const n=t.activeElement,r=t.removeEditorTags(Ol(t.isElementListContainer)),o=t.addClassToSecondCell(r,"em-list-temp-class");Ii(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 RX(e){return e.backgroundImage?.[0]?.value??""}function Ip(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&&Ip({elem:e.elem.previousSibling,width:e.width})}function RT(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 MX(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,Ip({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,Ip({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,RT(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 Dp(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&&Dp({elem:e.elem.previousSibling,width:e.width})}function Au(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 ku(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 Bp(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function PX(e,t){const n=t.activeElement;if(Au(n)){const r=ku(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=Bp(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",Dp({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 IX(e,t){const n=t.activeElement;if(!Au(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&&tr(r,"beforeend",u)}))}function DX(e,t){const n=t.activeElement;if(Au(n)){const r=ku(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=Bp(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,RT(o,o.style.verticalAlign)})}}function BX(e,t){const n=t.activeElement;if(Au(n)){const r=ku(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=Bp(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",Dp({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 HX(e,t){const n=t.activeElement;let r=!1;const o=ku(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 Hp="amp-img";function FX(e){const t=S0(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 MT(e){return e==null||e===""?null:Number(e)}function $X(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:MT(e.width?.value),height:MT(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function Fp(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function WX(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(Hp).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 PT(e){e.replaceWith(...Array.from(e.childNodes))}function IT(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function qX(e,t,n,r){if(r.src!==n.src&&Ht(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=Fp(e,t,"em-replace");if(!r.imgReplacer)o&&PT(o);else if(o)Ht(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Ht(i,"src",r.imgReplacer),IT(e,i)}}if(r.link!==n.link){const o=Fp(e,t,"a");if(!r.link)o&&PT(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),IT(Fp(e,t,"em-replace")??e,i)}}}function zX(e){const t=document.createElement(Hp);Ht(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");Ht(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 UX(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function jX(e,t){const n=Array.from(e.querySelectorAll(Hp)),r=new Set,o=[];UX(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),qX(a,e,FX(a),$X(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>WX(i,e).remove()),o.forEach(i=>e.appendChild(zX(i)))}function VX(e,t){const n=e,r=t.activeElement.closest("amp-carousel");r&&DT(r,t,o=>GX(o,n,t))}function DT(e,t,n){sr(t.HTMLDocument.getOuterHtml(e),([r])=>{r instanceof Element&&(n(r),r.setAttribute("em-edit","active"),e.replaceWith(r))}),t.commit(!0)}function GX(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)&&jX(e,t.carouselImages),"borderRadius"in t&&n.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:e})}function XX(e,t){const n=e,r=t.activeElement.closest("amp-accordion");r&&DT(r,t,o=>KX(o,n))}function KX(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 Xn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function YX(e){return e.closest('table[em-type="social"]')}function BT(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 ZX(e,t,n){const r=BT(e),o=BT(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 Kn(e){return String(e??"").replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}function QX(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function JX(){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 eK(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=JX();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function tK(e){return e>0?`<td width="${e}"> </td>`:""}function nK(e,t){const n=YX(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:Xn.align,i=typeof e.iconSize=="number"?e.iconSize:Xn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:Xn.borderRadius,a=typeof e.gap=="number"?e.gap:Xn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:Xn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:Xn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Xn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:Xn.borderColor;let f=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Xn.buttonBorderWidth;f=Math.max(0,Math.min(24,Math.round(f)));const h=typeof e.showLabel=="boolean"?e.showLabel:Xn.showLabel,m=[];u>0&&d&&m.push(`border:${u}px solid ${Kn(d)}`);const p=m.length?` style="${m.join(";")}"`:"",v=!!(l&&String(c).trim()),C=Math.max(0,Math.round(Number(a)||0)),k=r.length>1,L=`<table border="0" cellspacing="0" cellpadding="0">
|
|
95
|
-
<tr>${r.map(y=>{const w=Kn(y.platform||"unknown"),b=!!y.customIcon,S=Kn(y.href||""),_=String(y.title??"").trim(),T=_?` title="${Kn(_)}"`:"",x=Kn(y.alt||""),N=Kn(eK(y.iconSrc||"")),I=y.iconWidth!=null&&!Number.isNaN(Number(y.iconWidth))?Number(y.iconWidth):i,O=y.iconHeight!=null&&!Number.isNaN(Number(y.iconHeight))?Number(y.iconHeight):i,M=b?"":typeof y.buttonBgColor=="string"?y.buttonBgColor.trim():"",V=!b&&v&&!M?String(c).trim():"",K=b?"":M||V,se=!b&&!!V,te=b?"":typeof y.itemBorderColor=="string"?y.itemBorderColor.trim():"",Z=!b&&!!(M||te&&f>0||se);let ve=`<a href="${S}" target="_blank"${T} draggable="false"><img src="${N}" width="${I}" height="${O}" border="0" alt="${x}" draggable="false" style="display:block;${!b&&!Z&&s>0?`border-radius:${s}px;`:""}" /></a>`;if(h&&(y.title||y.alt)){const oe=QX(String(y.title||y.alt||""));ve+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${oe}</span>`}const fe=[];K&&fe.push(`background-color:${Kn(K)}`),te&&f>0&&fe.push(`border:${f}px solid ${Kn(te)}`),Z&&s>0&&fe.push(`border-radius:${s}px`);const _e=se?' em-tray-cell-bg="1"':"",ct=b?' em-custom-icon="1"':"",ne=K&&/^#[0-9A-Fa-f]{3,8}$/.test(K)?` bgcolor="${Kn(K)}"`:"",q=k?' draggable="true"':"";return`<td em-platform="${w}"${ct}${_e}${ne}${fe.length?` style="${fe.join(";")}"`:""}${q}>${ve}</td>`}).filter(Boolean).reduce((y,w,b)=>(b>0&&y.push(tK(C)),y.push(w),y),[]).join("")}
|
|
96
|
-
</tr>
|
|
97
|
-
</table>`,E=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${p}><tr><td align="${Kn(o)}">
|
|
98
|
-
${L}
|
|
99
|
-
</td></tr></table>`,g=Le(E,!0)[0];return g?(g instanceof HTMLTableElement&&ZX(n,g,o),g.setAttribute("em-edit","active"),n.replaceWith(g),t.commit(!0),g):null}function rK(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 h=t.unwrapTag(d);r.selectNodeContents(h)}else{const h=t.splitWrapper(d,r);r.selectNodeContents(h),setTimeout(()=>n.removeAllRanges(),100)}else if(c){const h=t.splitWrapper(c,r);r.selectNodeContents(h)}if(f)if(r.collapsed){const h=r.cloneRange();try{r.expand("word");const m=r.toString().trim();if(m){const p=t.wrapInTag(r,m,a),v=document.createRange();v.selectNodeContents(p),n.removeAllRanges(),n.addRange(v),t.cleanEmptyTags(p.parentNode)}else r.setStart(h.startContainer,h.startOffset),r.setEnd(h.endContainer,h.endOffset)}catch{r.setStart(h.startContainer,h.startOffset),r.setEnd(h.endContainer,h.endOffset)}}else{const h=r.cloneContents(),m=document.createElement("div");m.appendChild(h),nn(r.commonAncestorContainer,m),t.unwrapNestedTags(m,a);const p=t.wrapInTag(r,m,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,h=t.unwrapTag(c),m=document.createRange();m.selectNodeContents(h),n.removeAllRanges(),n.addRange(m),t.cleanEmptyTags(f),c.parentNode||setTimeout(()=>n.removeAllRanges(),0)}else{const f=r.startContainer.parentElement?.closest(a);if(f){const h=t.unwrapTag(f),m=document.createRange();m.selectNodeContents(h),n.removeAllRanges(),n.addRange(m),t.cleanEmptyTags(f.parentNode)}}else{let f=[];const h=r.cloneContents(),m=document.createElement("div");if(m.appendChild(h),nn(r.commonAncestorContainer,m),f=Array.from(m.querySelectorAll(a)),c){const C=Array.from(c.childNodes).some(E=>E.nodeType===1),k=t.unwrapTag(c),L=document.createRange();if(k.isConnected)L.selectNodeContents(k),n.removeAllRanges(),n.addRange(L);else{const E=c.parentNode;E&&(L.selectNodeContents(E),n.removeAllRanges(),n.addRange(L))}C&&t.applicationElementSettingsSet({elem:document.querySelector("[em-edit]")}),t.commit();return}else{const C=r.commonAncestorContainer.parentElement?.closest(a)||r.startContainer.parentElement?.closest(a);C&&f.push(C)}f.length>0&&f.forEach(C=>{C.parentNode&&t.unwrapTag(C)});const p=m.cloneNode(!0);nn(m,p);const v=p.querySelector('[em-edit="active"]');if(v){r.deleteContents(),r.insertNode(v);const C=document.createRange();C.selectNodeContents(v),n.removeAllRanges(),n.addRange(C),t.cleanEmptyTags(v.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function oK(e,t){if(e!==void 0){if(e===""){iK(t.activeElement);return}sK(e,t)}}function iK(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 sK(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 h=e,m=f.textContent||"";return h.length===1&&d.test(m)?!0:t.compareStrings(m,h)}),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 aK(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function HT(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 lK(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 cK(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function uK(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=HT(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;cK(i),t.commit(),lK(s,a)}return}const o=aK(e);if(o&&!(!n||!r||r.collapsed))try{const i=HT(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{}}var Pe=e=>ql(e?.innerText);function dK(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 fK(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 mK=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,hK=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,$p=e=>e.toString(16).padStart(2,"0");function pK(e){const t=hK.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`#${$p(n)}${$p(r)}${$p(o)}`}function FT(e){return e.split("").map(t=>`${t}${t}`).join("")}function Yn(e,t){if(!e)return;const n=e.trim();if(!n)return;if(mK.test(n)){const o=n.slice(1);return o.length===3?`#${FT(o).toLowerCase()}`:o.length===4?`#${FT(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=pK(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Yn(o)}}function gK(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function Wp(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Yn(o.style.color,n);if(i)return i;o=o.parentElement}}function bK(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Yn(n.style.color,t);if(!r)return;const o=Wp(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&gK(n))})}function yK(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 vK(e,t,n){const r=Yn(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=yK(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Yn(u.style.color,n)===r?!0:Wp(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 EK(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=Yn(o.style.color,t);if(!i)return;const s=Wp(o,e,t)||(n?Yn(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Yn(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function SK(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 wK(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"&&Vc(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),Ph(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 _K(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(Ue(n),"bold")),rn(n),n.tagName!=="STRONG"?e.currentSettings.value&&ke(n,"<strong>"+Ue(n)+"</strong>"):e.currentSettings.value||Ji(n,Ue(n)),rn(r)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(jt(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");jt(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 CK(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(Ue(n),"italic")),rn(n),n.tagName!=="EM"?e.currentSettings.value&&ke(n,"<em>"+Ue(n)+"</em>"):e.currentSettings.value||Ji(n,Ue(n)),rn(r)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(jt(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");jt(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 TK(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=""),lr("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");jt(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");jt(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");jt(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");jt(u,i),u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");jt(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 AK(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(Ue(i),"strike")),rn(i),i.tagName!=="STRIKE"?e.currentSettings.value&&ke(i,"<strike>"+Ue(i)+"</strike>"):e.currentSettings.value||Ji(i,Ue(i)),rn(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"&&pd(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=>{pd(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(Ue(t.parentWrapper),"strikeUnderline")),rn(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 kK(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(Ue(i),"underline")),rn(i),i.tagName!=="U"?e.currentSettings.value&&ke(i,"<u>"+Ue(i)+"</u>"):e.currentSettings.value||Ji(i,Ue(i)),rn(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 LK(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");jt(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 h=document.createElement("span");jt(h,f),h.style[e.stylePropretyName]=c,f.parentNode?.replaceChild(h,f),e.refreshElementSettings(h,e.selectedText),t.range.selectNode(h),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");jt(f,s),f.style[e.stylePropretyName]=c;const h=s.closest("a");h&&h.innerText===s.innerHTML&&(h.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&&(EK(i,e.rgbToHex,e.outerContextColor||e.tempColor),bK(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function NK(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 $T(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Yn(n),o=Yn(t??"");return!r||r===o?null:n}function xK(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=Ue(n),l=n?.parentNode;l&&(ke(l,a),rn(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=NK(n)?"div":"span",o=document.createElement(r);if(jt(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=$T(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=$T(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 qp='[class*="em-mob-font_size"]',OK=`${qp}, [style*="font-size"]`,RK="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",MK=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function PK(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest(RK)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=IK(s,i!==null);if(!a||Pe(s)===Qe()){n({settings:t,elem:s.closest("editor")?s:s.closest(OK)||s}),zp(s,r,i);return}const l=DK(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll(qp)).filter(d=>a.intersectsNode(d))).forEach(d=>{zp(d,r,null),WT(d,r)});return}const c=l||hE(a,a.extractContents(),"span");if(!c)return;BK(c),n({settings:t,elem:c}),zp(c,r,i);const u=document.createRange();u.selectNodeContents(c),Jo(u)}function IK(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(qp);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),Jo(s),s}fK(n,Jo);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function DK(e,t){const n=Qe(),r=t.commonAncestorContainer;let o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement,i=null;for(;o&&o!==e&&o.tagName!=="EDITOR"&&e.contains(o)&&Pe(o)===n;)i=o,o=o.parentElement;return i}function zp(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(Gc(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&WT(r,t)})}function WT(e,t){Gc(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 BK(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"));MK.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function HK(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&$K(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(PK(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&&WK(e.textAlign,r),e.mobileTextAlign&&(qK(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"))&&FK(e,r),t.isElementList&&UK(e,t),n}function FK(e,t){const n=GV.includes(t.tagName)?t:t.closest(XV);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?oG(n,r):lG(n)}function $K(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),Aa(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 WK(e,t){const n=Ea(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 qK(e,t,n){const r=Ea(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";cj(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function zK(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=>jK(l,c,t))].filter(c=>!!c)}function UK(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=zK(e,t);if(s.length){const l=t.removeEditorTags(Ol(i));Ca(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 jK(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"&&Vc(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),Ph(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),Ke(r)):t}var Lu=null;function qT(e){Lu=e}function zT(){return Lu}function br(){Lu=null}function VK(){return Lu?.kind==="atom"}function Up(e,t,n,r){Cs(e,t,o=>{const i=document.createElement("table");i.replaceChildren(...o),[...i.querySelectorAll(":scope > tr")].reverse().forEach(s=>n.insertAdjacentElement(r,s))})}function UT(e,t){e.replaceChildren(...t),e.querySelectorAll('tr[em="block"]').forEach(n=>n.removeAttribute("em"))}function jp(e,t,n,r,o){Cs(e,n,i=>{UT(t,i),r.insertAdjacentElement(o,t)})}var GK=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],XK=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],KK=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function jT(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...GK)})}function YK(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...XK)})}function Nu(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...KK)})}function Vp(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function VT(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function Gp(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=VT(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=VT(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function xu(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function GT(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 ZK(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 QK(e){const t=GT(e.dataTransfer?.files??null);return t||ZK(e.dataTransfer??null)}function Xp(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 ka(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Kp(e){if(!ka(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!GT(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 XT="em-native-img-drop-target",Yp="em-native-img-uploading",JK="em-native-img-drop-loading",Ou="em-native-file-drag",La=null,_o=null;function KT(){_o&&(window.removeEventListener("scroll",_o.reposition,!0),window.removeEventListener("resize",_o.reposition),_o.resizeObserver?.disconnect(),_o.overlay.remove(),_o=null)}function eY(e){KT();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)),_o={overlay:t,reposition:r,resizeObserver:o}}function Zp(){La&&(La.classList.remove(XT),La=null)}function Co(){Be(document.body,!1,Ou),Zp()}function tY(e){if(!ka(e)){Co();return}if(!Kp(e)){Co();return}Be(document.body,!0,Ou);const t=Xp(e);if(!t){Zp();return}La!==t&&(Zp(),La=t,t.classList.add(XT))}function YT(){KT(),Be(document.body,!1,JK,Ou),document.querySelectorAll(`.${Yp}`).forEach(e=>{e.classList.remove(Yp)})}function nY(e,t){if(t.lockEditor||!ka(e))return!1;const n=QK(e);if(!n)return!1;const r=Xp(e);return r?(t.applicationElementSettingsSet({elem:r}),Co(),r.classList.add(Yp),eY(r),t.messageService.send({operation:de.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function rY(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"&&(Be(document.body,!0,"em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function oY(e,t){t.lockEditor||(Co(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function iY(e,t){if(e.preventDefault(),t.lockEditor){Co();return}ka(e)?(Kp(e)&&Xp(e)&&(e.dataTransfer.dropEffect="copy"),tY(e)):Co();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=cn(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=xu(r);o&&Gp(o,Vp(o,e.pageY),"block")}else jT()}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,Gp(r,Vp(r,e.pageY),"atom"),Nu();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)Nu();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=xu(o);i&&(Gp(i,Vp(i,e.pageY),"blockatom"),YK())}}}}function sY(e,t){if(t.lockEditor)return;ka(e)&&Kp(e)&&Be(document.body,!0,Ou);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"]');cn(n)?(n.classList.add("em-block-insert-empty"),jT()):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"]');cn(n)?(n.classList.add("em-block-insert-empty"),Nu()):o?t.mutableState.targetBlock=o:Nu()}}var aY=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function lY(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function cY(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(lY(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...aY)),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 uY(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 dY(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
|
|
104
|
-
`)}function fY(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 ZT(){br(),Co(),Be(document.body,!1,"em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),Be(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 QT(e,t,n){const r=e.target;if(!(n.isTableElement(r)&&cn(r)||(r.tagName==="BODY"?vp():r.closest('[em="block"]'))))return;const o=Oh(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(uY(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),dY(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&cn(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"?ar("new",gr(r),"beforeend",`
|
|
105
|
-
`+i+`
|
|
106
|
-
`):ar("new",gr(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}),br());else if(r.tagName==="BODY"){const l=vp();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"}),Up("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}),br())}else{const l=r.closest('[em="block"]');if(l){const c=xu(l),u=c?fY(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"?Up("new",`
|
|
113
|
-
`+i+`
|
|
114
|
-
`,l,u):Up("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"),jp("new",d,`
|
|
119
|
-
`+i+`
|
|
120
|
-
`,l,u)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),jp("new",d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
|
121
|
-
`+i+`
|
|
122
|
-
</table>`,l,u)}else ar("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}),br())}}}var Qp="em-live-atom";function Ru(e,t){return t?`<${Qp}></${Qp}>`:e}function mY(e,t){const[n,...r]=document.querySelectorAll(Qp);if(r.forEach(i=>i.remove()),!n||e.contains(n)){n?.remove();return}const o=e.parentElement;Cf(e),n.replaceWith(e),o&&e.parentElement&&t(e,o,e.parentElement)}function JT(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 hY(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}):ar(i,e,"beforeend",`
|
|
157
|
-
`+Ru(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),br())}function pY(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=JT(t,Ru(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 h="beforeend";l&&f&&(f.classList.contains("em-block-insert_bottom-document")||f.classList.contains("em-block-insert_bottom")?h="afterend":(f.classList.contains("em-block-insert_top-document")||f.classList.contains("em-block-insert_top"))&&(h="beforebegin"));const m=!!t.match(/class="em-countdown"/gi),p=d.substring(0,3)==="<tr";if(c.tagName==="TR")if(p)if(m)r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:d});else{const v=document.createElement("tr");v.setAttribute("em","block"),v.classList.add("em-structure"),Cs(i,`
|
|
159
|
-
`+d+`
|
|
160
|
-
`,C=>{v.replaceChildren(...C.flatMap(k=>k instanceof Element&&k.tagName==="TR"?Array.from(k.childNodes):[k])),c.insertAdjacentElement(h,v)})}else if(m)r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:`<tr em="block"><td align="center">
|
|
161
|
-
`+d+`
|
|
162
|
-
</td></tr>`});else{const v=document.createElement("tr");v.setAttribute("em","block"),Cs(i,`
|
|
163
|
-
<td align="center">
|
|
164
|
-
`+d+`
|
|
165
|
-
</td>
|
|
166
|
-
`,C=>{v.replaceChildren(...C),c.insertAdjacentElement(h,v)})}else if(p)if(c.tagName==="TABLE")if(cn(a))m?r.insertCountdown({targetElem:h==="beforeend"?gr(c):c,targetPlace:h,atomHTML:d}):ar(i,h==="beforeend"?gr(c):c,h,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"),m?(UT(v,Le(`
|
|
167
|
-
`+d+`
|
|
168
|
-
`,!0)),r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:r.getOuterHtml(v)})):jp(i,v,`
|
|
169
|
-
`+d+`
|
|
170
|
-
`,c,h)}else m?r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:`<div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
|
|
171
|
-
`+d+`
|
|
172
|
-
</table></div>`}):ar(i,c,h,`
|
|
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 m?r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:d}):ar(i,c,h,`
|
|
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),br())}function gY(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");pb(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?Ru(e,o):kt(l),h=`
|
|
179
|
-
<tr em="atom"><td colspan="`+u+`">
|
|
180
|
-
`+f+`
|
|
181
|
-
</td></tr>
|
|
182
|
-
`;a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:h}):ar(r,i,s,h)}else a?n.insertCountdown({targetElem:i,targetPlace:s,atomHTML:e}):ar(r,i,s,`
|
|
183
|
-
`+Ru(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),br())}function eA(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?_s(n):""}},s=o==="moved"?i.settings.atomHTML:"",a=n&&s&&!s.match(/class="em-countdown"/gi)?n:null;try{bY(e,t,o,i,a)}finally{a&&mY(a,t.fitMovedImage)}}function bY(e,t,n,r,o){const i=t.mutableState.atomReplaced,s=e.target,a=m=>t._setDocumentStyles(m,{minify:t.minify,cssbeautify:t.cssbeautify,HTMLDocument:t.HTMLDocument});if(!r.settings?.atomHTML)return;const l=s.closest('[em="block"]')&&s.tagName==="TD"&&!s.innerHTML&&!s.hasAttribute("height")&&(s.classList.contains("em-atom-insert-empty")||VK()),c=s.tagName==="DIV"&&s.closest("amp-accordion")&&!s.innerHTML,u=l||c,d=!!document.querySelector(".em-blockatom-insert")||cn(s),f=s.closest('[em="atom"]');if(!u&&!d&&!f)return;let h=r.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();if(o||a(r.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)),h=t.commonStylesApply({html:h}),u){hY(s,h,i,r,t,n,o);return}if(d){pY(e,h,r,t,a,n,o);return}gY(h,r,t,n,o)}var yY=/^[\t\n\f\r ]*$/;function vY(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&yY.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function EY(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&&(vY(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&hy(r)&&Ht(r,"src",e.src??""),e.src!==void 0&&YT(),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,Ht(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)Ht(i,"src",o);else{const s=document.createElement("em-replace");Ht(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 SY(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),Aa(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&Aa(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function wY(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 _Y(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 CY(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var Na=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function TY(e){const t=u=>{e.commit(u)},n={addFontFamilyClass:u=>ga(u,t),clearLinkTags:u=>{wo(u,t),Ur(t)}},r={setElementMobileWidth:t0,setElementMobileHeight:Oi,setElementMobileBorder:MU,setElementMobileBorderRadius:PU,setElementMobileBoxShadow:IU,setElementMobileAlign:n0,setElementMobileTableAlign:DU,setElementMobileVerticalAlign:r0,setElementMobileDirection:BU,setElementMobileBackgroundColor:HU,setElementMobileBackgroundImage:FU,setElementMobileBackgroundPositionX:$U,setElementMobileBackgroundPositionY:WU,setElementMobileBackgroundRepeat:qU,setElementMobileBackgroundSize:zU,setElementMobilePadding:va,setElementMobileFontSize:o0,setElementMobileLineHeight:i0,setElementShow:s0},o={parseTableElementToModel:Li,tableModelToHtml:qC,updateTablePadding:CU,getCellsWithClasses:mU,clearCellBorders:bU,updateTableCellBackgroundByIds:AU,addClassToCellsByIds:hU,getExternalBorders:yU,updateCellBordersByIds:gU,getExternalCorners:wU,updateCellBorderRadiusByIds:EU,updateCellPaddingByIds:TU,removeOuterBorders:vU},i=e.editLock??Tf,s=u=>({activeElement:u,activeCell:j.get("activeCell"),state:j,...o,wrapEditor:e.wrapEditor,addNewRange:Jo,toggleTextStyle:e.toggleTextStyle,textStyleProperties:Na,isEditLocked:()=>i.isTextLocked(),...r}),a=(u,d)=>{const f=()=>{const m=d??OT();m&&e.selectionLock.lift(()=>e.applicationElementSettingsSet({elem:m}))};let h;try{h=yX(u,s(d))}catch(m){throw f(),m}if(h.status==="applied")return!0;if(h.reason!=="empty"&&f(),h.reason!=="locked")throw new Error(`customTable: refused "${h.key??""}" (${h.reason})`);return!1},l=(u,d)=>{const{settings:f}=u,h=wu(d),m={setElementBorder:Dh,setElementBoxShadow:oC,setElementBorderRadius:Ai},p={activeElement:d,setPercentsForColumns:Ul,setElementMobileHeight:Oi};switch(u.type){case"img":case"countdown":case"video":EY(f,{activeElement:d,getActiveEditElement:xs,setCursorPosition:e.setCursorPosition,...m,...r});break;case"a":SY(f,{activeElement:d,textStyleProperties:Na,toggleTextStyle:e.toggleTextStyle});break;case"table":kX(f,{activeElement:d,...m,...r});break;case"td":case"structure":case"group":case"column":NX(f,{activeElement:d,requestType:u.type,textStyleProperties:Na,isElementListContainer:vG(d),isProgrammaticSelection:e.programmaticSelection,...m,...r,setContrastBlock:UU,setStructureBlocksWidth:_u,toggleTextStyle:e.toggleTextStyle,removeEditorTags:Di,addClassToSecondCell:UV,wrapEditor:e.wrapEditor,addNewRange:Jo});break;case"button":_X(f,{activeElement:d,textStyleProperties:Na,...m,...r,toggleTextStyle:e.toggleTextStyle,compareStrings:TE});break;case"div":AX(f,{activeElement:d,...m,...r});break;case"vindent":wY(f,{activeElement:d,setElementMobileHeight:Oi});break;case"var":_Y(f,{activeElement:d,isVariableText:U_});break;case"floatBlock":MX(f,{activeElement:d,setElementMobileWidth:t0,setElementMobileContentWidth:RU,setElementMobileVerticalAlign:r0,setElementShow:s0});break;case"text":HK(f,{activeElement:d,textStyleProperties:Na,toggleTextStyle:e.toggleTextStyle,collectVMLContent:iC,updateVMLComments:sC,removeClassesByPrefix:da,createFontClassName:Rh,...n,handleTextScriptSettings:rK,handleTextReplacer:oK,handleTextAnchor:uK,unwrapNestedTags:yI,wrapInTag:hE,unwrapTag:vI,isRangeMatching:EI,splitWrapper:SI,cleanEmptyTags:wI,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:TE,setElementMobileFontSize:o0,setElementMobileLineHeight:i0,setElementMobileAlign:n0,updateTableStyle:_V,changeBullets:CV,changeBulletsColor:TV,changeBulletsSize:AV,changeBulletsItalic:LV,changeBulletsWeight:kV,changeBulletsStrikethrough:xV,changeBulletsUnderline:NV,findElementWithSelectedText:Ns,removeEditorTags:Di,isElementList:h.isList,isElementListOL:h.isListOL,classNameOl:h.classNameOl,classNameUl:h.classNameUl,commit:t});break;case"floatBlocksWidths":PX(f,p);break;case"floatBlocksPreset":IX(f,p);break;case"floatBlocksValign":DX(f,p);break;case"floatBlocksGap":BX(f,p);break;case"floatBlocksGapMobile":HX(f,p);break;case"carousel":VX(f,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:Ai,commit:t});break;case"accordion":XX(f,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:Ai,commit:t});break;case"social":{const v=nK(f,{activeElement:d,commit:t});if(v)return v;break}case"customTable":return a(f,d)?d:null}return d},c=(u,d,f,h)=>{const m=e.selectionLock.acquire(),p=u;let v=u;e.commitLockedAsync().finally(()=>{let C;try{C=wX(v,p,d,f,{getMappedParent:k=>e.htmlDocument.getMappedParent(k)??void 0,getOuterHtml:k=>e.htmlDocument.getOuterHtml(k),applyHidden:k=>e.htmlDocument.applyHidden(k)})}catch(k){throw m.release(),k}if(!C){m.release(),e.setCursorPosition(v),h?.();return}v=C.active,e.commitLockedAsync().finally(()=>{try{C.afterCommit()}finally{m.release()}e.setCursorPosition(v),h?.()})})};return u=>{const d=e.selectionLock.acquire();try{const f=u.data;f.settings=e.getMapObj().escape(f.settings);const h=xs();if(!h){f.type==="customTable"&&a(f.settings,null)&&e.commitLockedAsync();return}e.beforeApply?.(f,h);const m=SX(h),p=l(f,h);if(!p)return;e.afterApply?.(f,p);const v=CY(f)?Qv():null;try{e_()}catch{}c(p,m,f,v?()=>QP(v,C=>e.htmlDocument.renderOnly(C)):void 0)}catch{}finally{d.releaseLater()}}}var AY=nv,kY=3,Jp=Promise.resolve(),eg={waiting:0},tg=0;function tA(){return ft()?at().entityId:void 0}async function LY(e,t){let n=!1,r=!1;const o=()=>{n||(n=!0,e())},i=(async()=>{t&&await YI(),r=!0,await HM(o)})();let s;const a=new Promise(l=>{s=setTimeout(()=>{r&&Ov()||(Ov()?n=!0:o(),l())},AY)});try{await Promise.race([i,a])}catch{o()}finally{clearTimeout(s)}}function nA(e,t){kv(()=>rA(e,t))||rA(e,t)}function rA(e,t){const n=tg>0||KI();if(!n&&FM()&&(eg={waiting:0}),eg.waiting>=kY)return;const r=eg;r.waiting++;const o=tA(),i=$M(),s=async()=>{try{await LY(()=>{tA()===o&&(e.send({operation:de.APPLICATION_ACTION,action:t,...i!==void 0?{actionId:i}:{}}),i!==void 0&&WM(i))},n)}finally{r.waiting--,n&&tg--}};n?(tg++,Jp=Jp.then(s,s)):Jp=s()}function oA(e,t){return!!e&&Array.from(e.querySelectorAll('[em="atom"]')).some(n=>n!==t)}function Mu(e){e.nodeName==="#comment"&&e.textContent?.indexOf("mso")!==-1?e.remove():e.previousSibling&&Mu(e.previousSibling)}function xa(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(),xa(t)));else if(e.innerHTML.trim()==="")Mu(e),e.remove(),xa(t);else if(t&&!t.querySelector('div[style*="display"]')){for(const n of Array.from(e.childNodes))n.nodeName==="#text"&&n.textContent?.trim()===""?(Mu(n),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(Mu(n),n.remove());e.innerHTML.trim()===""&&xa(e)}}function iA(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"&&!oA(s,i)&&s?.textContent?.trim()===""&&(s.textContent="")}else{n.remove();const i=n.previousSibling;i&&i?.textContent?.trim()===""&&i.remove()}return xa(o),t.commit(),z.send({operation:"application_element_settings_close"}),!0}function NY(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}var xY={historyUndo:"undo",historyRedo:"redo"};function OY(e,t){const n=xY[e.inputType];return!n||!e.target?.closest?.("editor")?!1:(e.preventDefault(),e.stopPropagation(),nA(t.messageService,n),!0)}function RY(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=pt(()=>{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&&!oA(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 MY(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=Dt(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;for(const h of a){const m=s?.closest(h);if(m){l=m;break}}if(!l||!t.isCaretAtEndOfStandardElement(r,l))return!1;e.preventDefault();const c=l.nextSibling;if(c&&c.nodeType===Node.TEXT_NODE&&(c.textContent?.length||0)>0){const h=c.textContent||"";return h[0]===" "||h[0]===" "?(t.setCursorPositionSimple(c,1),!0):(c.textContent=" "+h,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 sA(e,t){Of(e,Ss,t)}function PY(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=Dt(o)?o:Dt(o?.parentNode)?o.parentNode:null,s=i?.previousSibling,a=s?.parentNode;if(!n||!i||kf(i)||s?.nodeName!=="BR"||!a)return!1;e.preventDefault(),e.stopImmediatePropagation(),Ss(()=>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"&&Of(l,Ss),t.commit(!0),!0}var IY=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"];function DY(e,t){return!IY.includes(e.key)||Rf(Gv(),Ss)===null||t.commit(!1),!1}function BY(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;Lv();const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A";s.collapsed||s.deleteContents(),Xv(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),sA(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),sA(u,t),o.commit(),!0}function HY(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?pC(r,n.textContent||""):!1}function FY(e){const t=pt(r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!zr(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&pC(s,i.textContent||"")&&e(!1)})}),n=pt(r=>{HY(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 $Y=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function WY(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,h=s;function m(b,S,_){const T=!!b&&!!S&&S.tagName==="DIV"&&b.tagName==="EDITOR"&&b.parentElement===S&&S.childElementCount===1&&S.firstElementChild===b&&!Array.from(S.childNodes).some(M=>M!==b&&M.nodeType===Node.TEXT_NODE&&!!M.textContent?.trim()),x=!!b&&b.childElementCount===0&&Array.from(b.childNodes).some(M=>M.nodeType===Node.TEXT_NODE&&!!M.textContent?.trim()),N=!!b&&Pe(b).trim()===_.trim();if(!T||!x||!N||!b.hasAttribute("em-edit")||!S.parentNode)return;const I=S.parentNode,O=b.getAttribute("em-edit")||"active";for(;b.firstChild;)S.appendChild(b.firstChild);b.remove(),b.removeAttribute("em-edit"),S.setAttribute("em-edit",O),I.replaceChild(b,S),b.appendChild(S)}function p(b,S){try{return S.intersectsNode(b)}catch{const _=document.createRange();return _.selectNodeContents(b),S.compareBoundaryPoints(Range.END_TO_START,_)<0&&S.compareBoundaryPoints(Range.START_TO_END,_)>0}}function v(b){const S=b?.links||{},_=S.underline,T=S.color,x=typeof _=="boolean"?_?"underline":"none":"underline";return{color:typeof T=="string"&&T.trim()?T.trim():"inherit",textDecoration:x}}function C(b,S){if(!b||!S)return null;const _=S,T=Array.from(_.querySelectorAll("a"));_.tagName==="A"&&T.unshift(_);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 I of T){const O=document.createRange();O.selectNodeContents(I);const M=O.compareBoundaryPoints(x,b)<=0,V=O.compareBoundaryPoints(N,b)>=0;if(M&&V)return I}return null}function k(b,S,_){const T=Array.from(S?.getElementsByTagName("span")||[]).reverse();let x=!1;Pe(S)===b&&T.length&&(x=!0),T.forEach(N=>{const I=N.getAttribute("style"),O=!!I&&I.trim().length>0;let M=Array.from(N.attributes).filter(K=>K.name!=="style");if(!O&&M.length===1&&M[0].name==="em-edit"&&N.parentElement&&!N.parentElement.hasAttribute("em-edit")){const K=N.getAttribute("em-edit")||"active";N.parentElement.setAttribute("em-edit",K),N.removeAttribute("em-edit"),M=Array.from(N.attributes).filter(se=>se.name!=="style")}const V=M.length>0;if(!O&&!V){const K=Pe(N);if(N.childNodes.length===1&&N.childNodes[0].nodeType===3){const se=N.childNodes[0];N.parentNode?.replaceChild(se,N),_.isEditorTagOutside&&Pe(S)!==b&&se.parentNode&&(_.range?.selectNode(se),n(_.range))}else{const se=Array.from(N.childNodes);se.forEach(te=>{N.parentNode?.insertBefore(te,N)}),b===K&&(_.range=document.createRange(),_.range.setStartBefore(se[0]),_.range.setEndAfter(se[se.length-1]),n(_.range)),N.parentNode?.removeChild(N)}}}),x&&(r(S,b),_.range.selectNode(S),n(_.range))}function L(b,S){if(b?.rangeCount>0){const _=b.getRangeAt(0),T=_.commonAncestorContainer;let x=_.startOffset,N=_.endOffset;for(;T.data&&x>0&&!/\s/.test(T.data[x-1]);)x--;for(;T.data&&N<T.length&&!/\s/.test(T.data[N]);)N++;S.setStart(T,x),S.setEnd(T,N),n(S)}}function E(b,S,_){ke(b,Ue(b).replaceAll(/<\/?strike[^>]*>/gi,"")),rn(b),b.parentNode&&(_.selectNode(b),n(_),r(b,S))}let g=!1;function y(){document.execCommand("styleWithCSS",!1,"true"),g=!0}function w(b,S){const _=dK(S.settings,G),T=S.settings.textColor??S.settings.textBackgroundColor;if(typeof T=="string"&&T.trim()!==""&&!G(T))return!1;const x=wu(b),{classNameOl:N,classNameUl:I,classNameBullet:O,isListOL:M,isListUL:V,isList:K}=x;K&&x.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(W=>{const rt=W.querySelector(":scope > div")||W.querySelector(":scope > editor div");rt&&rt.classList.add(`${O}`)}),b?.querySelectorAll(".em-element-path").forEach(W=>W.remove()),Rf(Gv(),Ss);const se=Object.keys(S.settings)[0];let te=window.getSelection();if(!te||te.rangeCount===0){if(!b||!b.isConnected)return;const W=document.createRange();if(W.selectNodeContents(b),te=window.getSelection(),!te)return;te.removeAllRanges(),te.addRange(W)}let Z=te.getRangeAt(0);const ve=Z.commonAncestorContainer;let fe=ve.nodeType===1?ve:ve.parentElement,_e=te.anchorNode?.nodeType===1?te.anchorNode:te.anchorNode?.parentElement,ct=!1,ne=Qe();if(b||(b=te.anchorNode?.childNodes.length===1&&te.anchorNode.firstChild?.nodeType===1?te.anchorNode.firstChild:fe,b.tagName==="EDITOR"&&(b=b.parentElement)),_.name==="textLink"&&_.value===""){const W=fe?.closest?.("a, [href]")||null;W&&(Z.selectNode(W),n(Z),b=W)}if(_.name==="textUnderline"&&!_.value){let W=fe.closest(["u","strike","[style*=text-decoration]","span","a"].find(rt=>fe?.closest(rt))||"u");!W&&b?.tagName==="A"&&(W=b),W?.tagName==="A"&&(W.style.textDecoration="none",r(W,ne),Z.selectNode(W),n(Z),b=W,ct=!0)}let q=S.type==="button"?(b||_e)?.closest("a"):(b||_e)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const oe=S.settings.fontFamily;let Wt=null;const U=Array.from(q?.classList||[]).some(W=>(W.startsWith("em-font-")&&(Wt=W),W.startsWith("em-font-")&&W.includes(_.name==="textItalic"?"Italic":"Bold")));U&&(_.name==="textItalic"||_.name==="textStrong")&&Wt&&q?.classList.remove(Wt);const un={range:Z,isEditorTagOutside:!1},wt=(W=Qe(),rt=q)=>{k(W,rt,un)},dn=SG,Zt=cT,kn=(W,rt)=>{E(W,ne,un.range)};let Qt,ut;se==="textColor"?Qt=ut="color":se==="textBackgroundColor"&&(Qt="backgroundColor",ut="background-color");const Ot=S.settings.hasOwnProperty("textColor")||S.settings.hasOwnProperty("textBackgroundColor"),_t=!!fe?.closest("editor")||Pe(fe)===ne||Pe(fe.querySelector("editor"))===ne;un.isEditorTagOutside=_t,S.settings.hasOwnProperty("textColor")&&_.value&&y();const td=wG,Zn=c(),Wa=u();if(SK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G})||wK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,fontFamilyArray:oe,removeClassesByPrefix:da,createFontClassName:Rh,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:wt}))return!1;const Oo=fe.closest(_.tags.find(W=>fe?.closest(W))||"span");(Z?.collapsed||!Qe())&&(_.value?_.value&&_t&&(S.type==="button"||b.tagName==="A"&&Oo?Z.selectNodeContents(Oo):L(te,Z)):Oo&&Z.selectNodeContents(Oo)),(S.type==="button"||b.tagName==="A"||b?.closest("a"))&&Qe()&&Qe()!==Pe(b)&&Oo&&(S.settings.hasOwnProperty("textLink")||S.settings.hasOwnProperty("textUnderline"))&&(Z.selectNode(Oo),n(Z),S.settings.hasOwnProperty("textUnderline")&&b.tagName==="A"&&(b.style.textDecoration=_.value?"underline":"none",ct=!0)),te=window.getSelection(),Z=te.getRangeAt(0),un.range=Z,ne=Qe(),Array.from(q?.querySelectorAll("span,div")||[]).reverse().forEach(W=>{W.getAttribute("style")===""&&W.removeAttribute("style"),W.hasAttribute("contenteditable")&&W.removeAttribute("contenteditable"),W.hasAttribute("em-edit")&&W.removeAttribute("em-edit"),W.hasAttribute("em-relative")&&W.removeAttribute("em-relative"),W.hasAttribute("class")&&(W.classList.remove("em-relative"),W.classList.length===0&&W.removeAttribute("class"))});let ue=null;Ot&&ut&&q?.style?.getPropertyValue?.(ut)?.trim()&&(Pe(q)===ne&&(q.style[Qt]=G(_.value?.toString())||"",ct=!0),Qt==="color"&&(fe===q||b?.closest('[style*="color"]')===q)&&(ue=G(q.style[ut]),q.style.removeProperty(ut),!q?.hasAttribute("em-edit")&&K&&q&&Zn&&q.closest("tr")?.querySelector(`.${O}`)?.style.removeProperty(ut)));let fn=null,nd=null;if(Ot&&Qt==="color"&&["A","LI"].includes(q?.tagName)){let W=q.parentElement;for(;W&&!["BODY","HTML","TD","TH"].includes(W.tagName);){const rt=W.style.getPropertyValue("color")?.trim();if(rt){fn=G(rt)||rt,nd=W,W.style.removeProperty("color");break}W=W.parentElement}}ut&&!(_.value.length===7||_.value.length===4)&&(ct=!0),_t&&(!_.value&&_.name!=="fontSize"&&_.name!=="textLink"||_.value)&&(!(_.name==="textUnderline"||_.name==="textStrikethrough")||S.type!=="button")&&!ct&&(_.name!=="fontSize"&&!Ot&&Pe(q)===ne?lr(_.command,!1,Ot?_.value:_.name==="textLink"?" ":void 0):Pe(q)!==ne&&(S.settings.hasOwnProperty("textColor")&&y(),lr(_.command,!1,Ot?String(_.value):_.name==="textLink"?" ":void 0),S.settings.hasOwnProperty("textColor")&&_.value&&vK(q||fe,String(_.value),G))),ne=Qe();{const W={parentElement:fe,parentNode:_e,parentWrapper:q,selection:te,range:Z};TK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,activeElement:b,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt,mutableState:W,currentStyle:Qt,isProgrammaticSelection:Zn,findParentWithFontSizeAndTag:AG}),fe=W.parentElement,_e=W.parentNode,q=W.parentWrapper,te=W.selection,Z=W.range,un.range=Z}_K({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,activeElement:b,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt}),CK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,activeElement:b,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt});const qa={parentWrapper:q,range:Z,selection:te};AK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,activeElement:b,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt,request:S,findOutermostParentWithText:h,mutableState:qa}),q=qa.parentWrapper,Z=qa.range,un.range=Z;const Vi={parentWrapper:q,range:Z,selection:te};if(kK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,activeElement:b,hasItalicClass:U,tempStyleClass:Wt,checkForWorkClass:dn,removeFormattingTags:ks,cleanEmptySpans:wt,request:S,findOutermostParentWithText:h,cleanStrikesInElement:kn,mutableState:Vi}),q=Vi.parentWrapper,_.value===!1&&q){const W=window.getSelection(),rt=W&&W.rangeCount>0?W.getRangeAt(0):Z,Ln={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[_.name];let Nn=!1;Ln&&Ln.forEach(Se=>{Array.from(q.getElementsByTagName(Se)).reverse().forEach(Rt=>{if(!p(Rt,rt))return;const Qn=Pe(Rt);if(!Qn||Qn.trim().length===0)return;const ht=Rt.parentElement;Rt.hasAttribute("em-edit")&&ht&&!ht.hasAttribute("em-edit")&&ht.setAttribute("em-edit",Rt.getAttribute("em-edit")||"active"),pd(Rt),Nn=!0,m(ht,q,ne)})}),Nn&&setTimeout(()=>{const Se=document.querySelector("[em-edit]")||d(ne)||(q?.isConnected?q:null);Se&&r(Se,ne)},0)}if(_.value===!0&&q&&_t){const W={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},rt={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},Ln=W[_.name],Nn=rt[_.name];if(Ln&&Nn&&ne&&ne.trim().length>0){const Se=q,Rt=Nn.some(Qr=>Se.getElementsByTagName(Qr).length>0),Qn=(Se.style?.textDecoration||"").toLowerCase(),ht=(Se.style?.textDecorationLine||"").toLowerCase(),xn=Qn.includes("underline")||ht.includes("underline"),qt=Qn.includes("line-through")||ht.includes("line-through"),vr=_.name==="textUnderline"&&xn||_.name==="textStrikethrough"&&qt,od=Pe(Se)===ne;if(!Rt&&!vr&&od){const Qr=document.createElement(Ln);for(;Se.firstChild;)Qr.appendChild(Se.firstChild);Se.appendChild(Qr);try{const On=document.createRange();On.selectNodeContents(Qr),n(On),Z=On,un.range=On}catch{}setTimeout(()=>{const On=document.querySelector("[em-edit]")||d(ne)||(Se.isConnected?Se:null);On&&r(On,ne)},0)}}}const nt={parentWrapper:q,parentNode:_e,range:Z,selection:te};LK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,isColorChange:Ot,tempColor:ue,outerContextColor:fn,outerContextElement:nd,stylePropretyName:ut,currentStyle:Qt,canselExecCommand:ct,isProgrammaticSelection:Zn,request:S,setCustomColor:td,checkForWorkClass:dn,cleanEmptySpans:wt,mutableState:nt}),q=nt.parentWrapper,_e=nt.parentNode;const Zr={parentWrapper:q,parentNode:_e,range:Z,selection:te};if(xK({parentElement:fe,parentNode:_e,parentWrapper:q,currentSettings:_,isElementList:K,classNameBullet:O,isEditorTagOutside:_t,selectedText:ne,range:Z,selection:te,checkForTextNodes:Zt,commit:t,getInnerText:Pe,getSelectedText:Qe,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:d,getParentElementOfSelection:f,rgbToHex:G,findOutermostParentWithText:h,activeElement:b,commonStyles:Wa,cleanEmptySpansWithParent:wt,mutableState:Zr}),Z=Zr.range,_.name==="textLink"&&_.value===!0&&_t&&q&&ne?.trim().length>0){const W=Zr.range||Z,rt=ne.trim(),Ln=[...q?Array.from(q.querySelectorAll("a")):[],...q?.parentElement?Array.from(q.parentElement.querySelectorAll("a")):[]],Nn=Ln.find(Se=>Pe(Se)?.trim()===rt)||Ln[0]||null;if(!(C(W,q)||C(W,q.parentElement)||Nn)&&W&&!W.collapsed){const Se=document.createElement("a"),{color:Rt,textDecoration:Qn}=v(Wa);Se.setAttribute("target","_blank"),Se.setAttribute("href",""),Se.setAttribute("new","true"),Se.setAttribute("style",`color: ${Rt}; text-decoration: ${Qn};`);let ht=!1;const xn=q.querySelector("editor");if(xn&&Pe(xn)===ne&&xn.querySelector("a")===null){for(;xn.firstChild;)Se.appendChild(xn.firstChild);xn.appendChild(Se),ht=!0}try{if(!ht){const qt=W.extractContents();qt.childNodes.length>0&&(Se.appendChild(qt),W.insertNode(Se),ht=!0)}}catch{ht=!1}if(!ht&&Pe(q)===ne){for(;q.firstChild;)Se.appendChild(q.firstChild);q.appendChild(Se),ht=!0}if(ht){try{const qt=document.createRange();qt.selectNodeContents(Se),n(qt),Z=qt,Zr.range=qt,un.range=qt}catch{}r(Se,ne)}}}const rd=_.name==="textUnderline"&&!_.value;if((!Ot&&ct||rd)&&wt(ne),$Y.has(_.name)){const W=Zr.parentWrapper||q||d(ne)||f();W&&wt(ne,W)}K&&fe.querySelectorAll(`tr td:first-child > div.${O}, tr td:first-child > editor div.${O}`).forEach(W=>{W.classList.remove(`${O}`)});const za=d(ne);za?.hasAttribute("em-edit")||za?.setAttribute("em-edit","active"),t()}return function(S,_){try{return w(S,_)}finally{g&&(g=!1,document.execCommand("styleWithCSS",!1,"false"))}}}function aA(e){return e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),sr(_s(e),([t])=>(t&&e.after(t),t))}function lA(e,t){const n=aA(e);t.commit(),n&&t.setCursorPosition(n)}function cA(e,t){aA(e),t.commit()}function uA(e,t){lA(e,t)}function dA(e,t){if(!e.previousElementSibling)return!1;const n=e.previousElementSibling;return n.before(e),t.commit(),z.send({operation:"application_scroll-to",settings:{value:t.scrollTop-n.getBoundingClientRect().height}}),!0}function fA(e,t){if(!e.nextElementSibling)return!1;const n=e.nextElementSibling;return n.after(e),t.commit(),z.send({operation:"application_scroll-to",settings:{value:t.scrollTop+n.getBoundingClientRect().height}}),!0}function mA(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function hA(e,t){const n=e.closest("table");e.querySelector("[em-edit]")&&z.send({operation:"application_element_settings_close"});const r=e.closest('[em="group"]');r&&n&&r.querySelectorAll('[em="block"]').length===1?mA(n):e.remove(),t.commit(),n&&t.setCursorPosition(n)}function pA(e,t){return Cf(e),zM(t)}function qY(e,t){const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=_i(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=pA(e,e.querySelector("td")),l=[...e.parentNode.children].indexOf(e),c=_i(e),u=parseFloat(c?.style.paddingTop??"")||0,d=parseFloat(c?.style.paddingBottom??"")||0,f=parseFloat(c?.style.borderTopLeftRadius??"")||0,h=parseFloat(c?.style.borderTopRightRadius??"")||0,m=parseFloat(c?.style.borderBottomLeftRadius??"")||0,p=parseFloat(c?.style.borderBottomRightRadius??"")||0,v=n.querySelector("td");r>l?(tr(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=h+"px",o.querySelector(":scope > .em-vindent-paddingTop")?.remove())):(tr(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=m+"px",o.style.borderBottomRightRadius=p+"px",o.querySelector(":scope > .em-vindent-paddingBottom")?.remove()))}else if(e.tagName==="DIV"){const a=pA(e,e),l=Array.prototype.indexOf.call(e.parentElement.children,e);el(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function zY(e,t){const n=_i(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=_s(e);if(!c)return;Cf(e);const u=[...n?.querySelectorAll(':scope > table:not([em="atom"])')??[]].filter(Sf).map(f=>({table:f,next:Iv(f,"next"),prev:Iv(f,"previous")})),d=u.length;u.forEach(({table:f,next:h,prev:m},p)=>{const[v]=Le(c,!0),C=_i(v);if(C.style.paddingTop="0",C.style.paddingBottom="0",C.style.borderRadius="0",C.replaceChildren(f),p===0?(C.style.paddingTop=r+"px",C.style.borderTopLeftRadius=i+"px",C.style.borderTopRightRadius=s+"px"):p===d-1&&(C.style.paddingBottom=o+"px",C.style.borderBottomLeftRadius=a+"px",C.style.borderBottomRightRadius=l+"px"),h?.getAttribute("em")==="atom"&&h.querySelector("td")?.hasAttribute("height")){const k=parseFloat(h.querySelector("td").getAttribute("height"))/2;C.style.paddingBottom=k+"px"}if(m?.getAttribute("em")==="atom"&&m.querySelector("td")?.hasAttribute("height")){const k=parseFloat(m.querySelector("td").getAttribute("height"))/2;C.style.paddingTop=k+"px"}e.insertAdjacentElement("beforebegin",v)}),e.remove(),t.commit()}function UY(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function jY(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function VY(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&mA(r),e.after(n),t.commit(),z.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function GY(e,t){lA(e,t)}function XY(e,t){e.querySelector("[em-edit]")&&z.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function KY(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 YY(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 ZY(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:KY(r)},s=n.selectionLock.acquire();try{z.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{s.release()})}}function QY(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=SH(i)+`
|
|
185
|
-
`+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function JY(e,t,n){navigator.clipboard.readText().then(r=>{const o=Oh(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"}),!sr(i,l=>{const c=eZ(e,l);if(!c)return!1;s&&tZ(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})){nZ(t.parentNode);return}n.commit(),n.setCursorPosition(e)}).catch(()=>{})}function eZ(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 tZ(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 nZ(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function rZ(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function oZ(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function iZ(e){const t=e.getAttribute("em-discuss-id");return t&&z.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function sZ(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"),z.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"),z.send({operation:"application_discuss_set_id",settings:{value:i}})}t.commit()}return{handled:!0,newClickedElement:n}}function aZ(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 m=o.closest(".em-narrow-table");if(m&&(cn(m)||!m.innerHTML.trim())&&e.insertTextAtomIntoEmptyNarrowTable(m))return}const i=o.closest("a");if(i instanceof HTMLAnchorElement){const m=i.getAttribute("href")||i.href||"";if(Aa(m)){const p=m.slice(1),v=document.querySelector(`a[name="${p}"]`);v&&(n.preventDefault(),v.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(Ve.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(Ve.moveUp)){e.handleMoveBlockUp(f);return}if(f&&o.classList.contains(Ve.moveDown)){e.handleMoveBlockDown(f);return}if(f&&o.closest(".em-element-editor-widget-edit")){const m=f.querySelector("td");m&&e.applicationElementSettingsSet({elem:m}),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(Ve.merge)){e.handleMergeBlocks(f);return}if(f&&o.classList.contains(Ve.unmerge)){e.handleUnmergeBlocks(f);return}const h=o.closest('[em="group"]');if(h&&o.classList.contains(Ve.moveUp)){e.handleMoveGroupUp(h);return}if(h&&o.classList.contains(Ve.moveDown)){e.handleMoveGroupDown(h);return}if(h&&o.classList.contains(Ve.add)){e.handleAddGroup(h);return}if(h&&o.closest(".em-element-editor-widget-edit")){e.setCursorPosition(h);const m=h.tagName!=="TR"?h:h.querySelector("td");m&&e.applicationElementSettingsSet({elem:m});return}if(h&&o.closest(".em-element-editor-widget-clone")){e.handleCloneGroup(h);return}if(h&&o.closest(".em-element-editor-widget-remove")&&o.closest(".of-group")){e.handleRemoveGroup(h);return}if(!o.closest(".em-editor-wrapper")&&!o.closest(".em-element-path")&&!o.closest(".em-element-vindent-remove")){const m=window.getSelection();if(m?.isCollapsed)e.setCursorPosition(o);else if(m&&m.rangeCount>0){const v=m.getRangeAt(0).commonAncestorContainer,C=e.findOutermostParentWithText(v);C&&e.setCursorPosition(C);const k=e.getParentElementOfSelection();k&&(o=k)}e.applicationElementSettingsSet({elem:o});const p=document.querySelector(".em-editor-wrapper");p&&(p.style.display="none"),e.setBlockGroupControlsPosition()}o.closest(".em-element-custom-table")&&e.handleCustomTableClick(o)}}function lZ(e){const t=pt(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")}),eu(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)}}}var cZ=`
|
|
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
|
-
`,uZ=`
|
|
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
|
-
`,dZ=`
|
|
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
|
-
`,fZ=`
|
|
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
|
-
`,mZ=`
|
|
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
|
-
`,hZ=`
|
|
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
|
-
`,pZ=`
|
|
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
|
-
`,gZ=`
|
|
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
|
-
`,bZ=`
|
|
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
|
-
`,yZ=`
|
|
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
|
-
`,vZ=`
|
|
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
|
-
`,EZ=`
|
|
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
|
-
`,gA=`
|
|
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
|
-
`,Pu=e=>(t,{cellId:n,selected:r})=>r.length?ip(t,n,r):cU(t,n,e),bA={"add-left-column":(e,{cellId:t})=>GC(e,t,"left"),"add-right-column":(e,{cellId:t})=>GC(e,t,"right"),"merge-right-cell":Pu("right"),"merge-left-cell":Pu("left"),"split-vertical-cell":(e,{cellId:t})=>YC(e,t,"cols"),"remove-column":(e,{cellId:t})=>eU(e,t),"add-top-row":(e,{cellId:t})=>jC(e,t,"above"),"add-bottom-row":(e,{cellId:t})=>jC(e,t,"below"),"merge-top-cell":Pu("top"),"merge-bottom-cell":Pu("bottom"),"split-horizontal-cell":(e,{cellId:t})=>YC(e,t,"rows"),"remove-row":(e,{cellId:t})=>Jz(e,t)};function SZ(e,t,n){const r=t.cells.find(i=>i.id===n);if(r)return{row:r.row,col:r.col};const o=e.cells.find(i=>i.id===n);return{row:Math.max(0,Math.min(o?.row??0,t.rows-1)),col:Math.max(0,Math.min(o?.col??0,t.cols-1))}}var wZ=[{group:"columns",icon:cZ,localeKey:"TABLE_MENU_COLUMNS"},{group:"rows",icon:uZ,localeKey:"TABLE_MENU_ROWS"}],yA=[{group:"columns",id:"add-left-column",icon:dZ,localeKey:"INSERT_COLUMN_BEFORE_TABLE"},{group:"columns",id:"add-right-column",icon:fZ,localeKey:"INSERT_COLUMN_AFTER_TABLE"},{group:"columns",id:"merge-right-cell",icon:gZ,localeKey:"MERGE_RIGHT_CELL_TABLE"},{group:"columns",id:"merge-left-cell",icon:mZ,localeKey:"MERGE_LEFT_CELL_TABLE"},{group:"columns",id:"split-vertical-cell",icon:EZ,localeKey:"SPLIT_CELL_TABLE"},{group:"columns",id:"remove-column",icon:gA,localeKey:"REMOVE_COLUMN_TABLE"},{group:"rows",id:"add-top-row",icon:hZ,localeKey:"INSERT_ROW_BEFORE_TABLE"},{group:"rows",id:"add-bottom-row",icon:pZ,localeKey:"INSERT_ROW_AFTER_TABLE"},{group:"rows",id:"merge-top-cell",icon:bZ,localeKey:"MERGE_TOP_CELL_TABLE"},{group:"rows",id:"merge-bottom-cell",icon:yZ,localeKey:"MERGE_BOTTOM_CELL_TABLE"},{group:"rows",id:"split-horizontal-cell",icon:vZ,localeKey:"SPLIT_CELL_TABLE"},{group:"rows",id:"remove-row",icon:gA,localeKey:"REMOVE_ROW_TABLE"}],vA={left:"merge-left-cell",right:"merge-right-cell",top:"merge-top-cell",bottom:"merge-bottom-cell"},_Z={row:["add-left-column","add-right-column","remove-column"],col:["add-top-row","add-bottom-row","remove-row"]};function CZ(e){const t=e==="left"||e==="right"?"row":"col";return[...Object.values(vA).filter(n=>n!==vA[e]),..._Z[t]]}function TZ(e,t,n,r){const o=r&&n.length?CZ(r):[],i=r?n:[];return new Set(yA.map(s=>s.id).filter(s=>!o.includes(s)&&!rp(bA[s](e,{cellId:t,selected:i}))))}var AZ="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;",kZ="cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",LZ="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;",NZ="padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px",xZ="cursor: pointer; margin: auto; margin-top: 5px";function Iu(e,t){return B({...t,targetElement:e,insertType:"append"})}function Oa(e){It(e)}function OZ(){const e=Mi(),t=B({className:Ks,style:AZ});for(const{group:n,icon:r,localeKey:o}of wZ){const i=Iu(t,{className:`${Ks}-group`,style:kZ,HTMLcontent:r,title:e[o]});i.setAttribute("data-group",n);const s=Iu(i,{tag:"ul",className:`${Ks}-list`,style:LZ});Iu(s,{tag:"li",className:`${Ks}-head`,style:NZ,HTMLcontent:r});for(const a of yA.filter(l=>l.group===n))Iu(s,{tag:"li",className:`${Ks}-item`,style:xZ,HTMLcontent:a.icon,title:e[a.localeKey],"data-id":a.id})}return t}function RZ(e){return e.querySelector(":scope > ul")}function MZ(e,{target:t,selection:n}){const r=n.base(),o=Li(t.table),i=r&&ya(t.table,r);if(!i)return!1;const s=n.selected().map(l=>ya(t.table,l)).filter(l=>!!l),a=TZ(o,i,s,n.direction());return e.querySelectorAll("[data-id]").forEach(l=>{l.style.display=a.has(l.getAttribute("data-id"))?"block":"none"}),!0}function EA(e,t){e.querySelectorAll(":scope > div > ul").forEach(n=>{n!==t&&(n.style.display="none")})}function PZ(e,t){e.stopPropagation(),e.preventDefault();const n=e.target instanceof Element?e.target:null,r=n?.closest("[data-id]");if(r){t.choose(r.getAttribute("data-id"));return}const o=n?.closest("[data-group]");o&&!n?.closest("ul")&&Oa(()=>t.show(o))}function IZ(e,t){e.addEventListener("click",pt(n=>PZ(n,t))),e.querySelectorAll("[data-group]").forEach(n=>{n.addEventListener("mouseenter",pt(()=>Oa(()=>t.show(n)))),n.addEventListener("mouseleave",pt(()=>Oa(()=>t.hide())))})}function DZ(e){let t=null,n=!1;const r=()=>{const s=t?.root;t=null,s&&Oa(()=>s.remove())},o={show(s){const a=RZ(s);if(!t||!a||e.isEditLocked()||!MZ(a,t)){r();return}EA(t.root,a),a.style.display="block"},hide(){t&&EA(t.root)},choose(s){const a=t;r(),a&&e.run(s,a.target,a.selection)}},i=pt(s=>{const a=t?.target.table;a&&(!a.isConnected||!(s.target instanceof Node)||!a.contains(s.target))&&r()});return document.addEventListener("click",i),{open(s,a){if(r(),n||e.isEditLocked())return;const l=OZ();Ef(l),IZ(l,o),t={root:l,target:s,selection:a},Oa(()=>s.table.append(l))},close:r,destroy(){r(),n=!0,document.removeEventListener("click",i)}}}function BZ(e,t){return t.map(n=>ya(e,n)).filter(n=>!!n)}function HZ(e,t){const n=Li(e).grid[t.row]?.[t.col];return n&&np(e,n)||null}function FZ(e,t,n,r){const o=HZ(t.table,e);o&&(n.start(o),r.reopen({...t,td:o},n),r.applicationElementSettingsSet({elem:o}))}function $Z(e,t,n,r){const o=n.base();if(!o)return Cu(Xr("no-cell"));const i={},s=hT(t.table,{isEditLocked:r.isEditLocked,tableModelToHtml:qC},{movesCells:!0,edit:a=>{const l=Li(a),c=ya(a,o);if(!c)return Xr("no-cell");const u=bA[e](l,{cellId:c,selected:BZ(a,n.selected())});return rp(u)||(i.focus=SZ(l,u,c)),u}});if(s.status==="rejected"){if(s.reason!=="locked")throw new Error(`tableMenu: refused "${e}" (${s.reason})`);return s}return r.commit(),i.focus&&FZ(i.focus,t,n,r),s}var WZ=".em-element-custom-table";function qZ(e,t){let n=t.closest("td, th");for(;n&&e.contains(n);){if(n.parentElement?.closest("table")===e)return n;n=n.parentElement?.closest("td, th")??null}return null}function zZ(e){return e.closest('[em="block"]')??e}function ng(e){if(!(e instanceof Element)||e.closest(".em-table-menu"))return null;const t=e.closest(WZ),n=t&&qZ(t,e);return t&&n?{table:t,td:n,block:zZ(t)}:null}function UZ(e){const t=DZ({isEditLocked:e.isEditLocked,run:(n,r,o)=>{$Z(n,r,o,{...e,reopen:(i,s)=>t.open(i,s)})}});return n=>{const r=ng(n);if(!r)return!1;const o=e.selections.of(r.table);return o.base()!==r.td&&o.start(r.td),t.open(r,o),!0}}function jZ(){Jc({scrollTop:j.get("scrollTop")})}function VZ(e){const{htmlDocument:t,commit:n}=e,r=()=>({commit:n,setCursorPosition:e.setCursorPosition,scrollTop:j.get("scrollTop"),iframeOffsetTop:j.get("iframeOffsetTop"),applicationElementSettingsSet:e.applicationElementSettingsSet}),o=aZ({getLockEditor:()=>e.editLock.isIntegratorLocked(),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:zl,findOutermostParentWithText:Wf,setBlockGroupControlsPosition:jZ,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:i=>iA(i,{getElementParent:s=>Ri(s),setCursorPosition:e.setCursorPosition,getVariableByIcon:ca,commit:n}),handleCloneAtom:i=>cA(i,r()),handleMoveBlockUp:i=>dA(i,r()),handleMoveBlockDown:i=>fA(i,r()),handleRemoveBlock:i=>hA(i,r()),handleCloneBlock:i=>uA(i,r()),handleCopyBlock:(i,s)=>QY(i,s,{HTMLDocument:t}),handlePasteBlock:(i,s)=>JY(i,s,{HTMLDocument:t,parseFromString:Le,getOuterHtml:Pt,minify:go,cssbeautify,insertAdjacentHTML:tr,setBlockMaxWidth:a=>Op(a,t),setFloatBlocksWidth:a=>Np(a,t),checkBlockAdaptivity:zc,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:j.get("emailWidth"),appName:j.get("appName")}),handleMergeBlocks:i=>qY(i,r()),handleUnmergeBlocks:i=>zY(i,r()),isAddBlockMenuClick:YY,handleAddBlockMenu:(i,s)=>ZY(i,s,{removeAllAttributes:Lr,selectionLock:e.selectionLock,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:i=>oz(i,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:i=>UY(i,r()),handleMoveGroupDown:i=>jY(i,r()),handleAddGroup:i=>VY(i,r()),handleCloneGroup:i=>GY(i,r()),handleRemoveGroup:i=>XY(i,r()),isDiscussViewMode:rZ,isDiscussSetTargetMode:oZ,handleDiscussViewClick:iZ,handleDiscussSetTargetClick:i=>sZ(i,{makeId:e5,commit:n}),handleCustomTableClick:UZ({selections:e.tableSelections,isEditLocked:()=>e.editLock.isTextLocked(),commit:()=>n(),applicationElementSettingsSet:e.applicationElementSettingsSet})});document.onclick=pt(o),lZ({commit:n,messageService:e.messageService})}function SA(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function GZ(e){return!e.closest(".em-element-editor-widget")}function XZ(e,t){if(t.lockEditor||!e.isTrusted)return!1;const n=zT();if(!n)return!1;const r=e.target;if(!(r instanceof HTMLElement)||!GZ(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;eA(SA(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;QT(SA(r,o.settings),o,t.blockDropCtx)}else return!1;if(!zT())return e.preventDefault(),e.stopPropagation(),ZT(),t.commit(),!0}catch{return!1}return!1}var wA="application/x-emailmaker-social-reorder";function rg(e){return e.closest('table[em-type="social"]')}function _A(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function CA(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function KZ(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 YZ(e,t){const n=KZ(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 ZZ(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=rg(n);if(!r)return;const o=_A(r);if(!o)return;const i=CA(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(wA,l),a.effectAllowed="move"}function QZ(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(wA);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=rg(i);if(!s)return!1;const a=_A(s);if(!a)return!1;const l=CA(a);if(l.length<2)return!1;const c=l.indexOf(i);if(c<0)return!1;const u=l[o];if(!u||rg(u)!==s)return!1;if(o===c)return!0;const d=[...l];return d.splice(o,1),d.splice(c,0,u),YZ(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function JZ(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function eQ(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=mp(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function tQ(e,t,n){if(t.editLock.isIntegratorLocked())return;let r;try{e.preventDefault(),e.stopPropagation();const o=nY(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||QZ(e,{applicationElementSettingsSet:t.applicationElementSettingsSet});if(r=t.selectionLock.acquire(),!o){if(document.body.classList.contains("em-block-insert-body"))try{const i=JSON.parse(e.dataTransfer?.getData("Text")||"{}");QT(e,i,{...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{eA(e,{...t.atomDropContext(),mutableState:n})}catch{}}ZT(),t.commit()}finally{Promise.resolve().then(()=>{r?.release(),eQ(t)})}}function nQ(e){const{dragState:t}=e,n=(r,o,i)=>document.addEventListener(r,pt(o),i);document.addEventListener("drag",r=>r.preventDefault(),!1),n("dragstart",r=>ZZ(r,{lockEditor:e.editLock.isIntegratorLocked()}),!0),n("dragstart",r=>rY(r,{lockEditor:e.editLock.isIntegratorLocked(),commit:o=>{e.commit(o)},messageService:e.messageService,mutableState:t}),!1),n("dragover",r=>iY(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("dragenter",r=>sY(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),n("dragleave",r=>cY(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("drop",r=>tQ(r,e,t),!1),n("dragend",r=>oY(r,{lockEditor:e.editLock.isIntegratorLocked(),messageService:e.messageService}),!1)}function rQ(e){const{htmlDocument:t}=e,n=f=>e.commit(f),r=JZ(),o=e.commonStylesApply??(f=>TC(f,h=>e.commit(h))),i=f=>{W_(f,()=>e.commit())},s=f=>Op(f,t),a=f=>Np(f,t),l=()=>({messageService:e.messageService,isJsonString:QI,getOuterHtml:Pt,minify:go,cssbeautify,HTMLDocument:t,_setDocumentStyles:(f,h)=>xh(f,h),commonStylesApply:o,commonStylesApplyToBlock:Xh,setImageWidth:Sh,fitMovedImage:$_,setFloatBlocksWidth:a,fitImagesToColumns:xp,insertCountdown:i}),c=()=>({...l(),lockEditor:e.editLock.isIntegratorLocked(),commit:n,emailWidth:j.get("emailWidth")??null,parseFromString:f=>Le(f),isTableElement:Ex,uptimeCountdown:wh,setBlockMaxWidth:s,checkBlockAdaptivity:zc,applicationElementSettingsSet:e.applicationElementSettingsSet});return{insertContext:()=>({selectionLock:e.selectionLock,commit:()=>e.commit(),lockEditor:e.editLock.isIntegratorLocked(),emailWidth:j.get("emailWidth"),iframeOffsetTop:j.get("iframeOffsetTop"),previewHeight:j.get("previewHeight"),parseFromString:f=>Le(f),getOuterHtml:Pt,HTMLDocument:t,minify:go,cssbeautify,insertAdjacentHTML:(f,h,m)=>Bv(f,h,m),messageService:e.messageService,setDocumentStyles:f=>xh(f,{minify:go,cssbeautify,HTMLDocument:t}),setImageWidth:Sh,commonStylesApply:o,commonStylesApplyToBlock:Xh,insertCountdown:i,uptimeCountdown:wh,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:xp,checkBlockAdaptivity:zc,setAtomReplaced:f=>{r.atomReplaced=f},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",pt(f=>{e.editLock.isIntegratorLocked()||XZ(f,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})}),!0),nQ({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,selectionLock:e.selectionLock,editLock:e.editLock,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}function oQ(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)}}}var TA='<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>',AA='<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>',og='<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>',iQ='<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>',sQ='<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>',Du='<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>',aQ='<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>',lQ='<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>',Ra='<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>',kA='<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>',cQ='<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>',ig='<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 Oe(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 Bu={getLocale:Mi,commit:ao},uQ=".em-prevent-action";function dQ(){return j.get("emailWidth")||475}function fQ(){return j.get("copyPasteEnabled")||!1}function mQ(){return j.get("saveBlockEnabled")||!1}function hQ(){return j.get("blocksAddPanelEnabled")||!1}function pQ(){return j.get("codeMode")||!1}var LA=".em-mob-wrap, .noresp-em-mob-wrap";function NA(e){return Array.from(document.querySelectorAll(e)).find(Y_)??null}function Hu(e,t){const n=Bu.getLocale(),r=dQ(),o=fQ(),i=mQ(),s=hQ(),a=pQ();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=B({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=B({targetElement:l,insertType:"append",className:"em-element-editor-widget"});B({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(og,`${xe} ${Ve.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ra,`${xe} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(ig,`${xe} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),eu(Bu.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=B({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=B({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=B({targetElement:c,insertType:"append",className:"em-element-editor-group"});if(B({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(og,`${xe} ${Ve.drag}`),title:n.REORDER_BLOCK}),B({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(AA,`${xe} ${Ve.moveUp}`),title:n.REORDER_BLOCK_UP}),B({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(TA,`${xe} ${Ve.moveDown}`),title:n.REORDER_BLOCK_DOWN}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ra,`${xe} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const m=B({targetElement:c,insertType:"append",className:"em-element-editor-group"});B({targetElement:m,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),B({targetElement:m,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:Oe(sQ,`${xe} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),B({targetElement:m,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:Oe(iQ,`${xe} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else B({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(uQ))return;const d=NA('[em-edit="active"]'),f=NA('[em-state^="active"]');if(d&&f&&(d.querySelector(LA)&&f.querySelector(LA)||d.closest(".em-structure")&&f.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&B({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:Oe(aQ,`${xe} ${Ve.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),ua(c.closest('[em="block"]')??c).flatMap(m=>Array.from(m.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&B({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:Oe(lQ,`${xe} ${Ve.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&B({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:Oe(cQ,`${xe} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(ig,`${xe} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const m=B({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&m.classList.add("out-of-iframe"),B({targetElement:m,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${Oe(kA,`${xe} ${Ve.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK}),B({targetElement:m,insertType:"append",className:"add-empty-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="border-outer" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656zM484 366h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zM302 548h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm364 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-182 0h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm0 182h56c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8z"></path></svg>',title:n.ADD_EMPTY_BLOCK}),B({targetElement:m,insertType:"append",className:"add-saved-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore-add" width="1em" height="1em" fill="currentColor" aria-hidden="true"><defs><style></style></defs><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zm52 132H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200zM424 712H296V584c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v128H104c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h128v128c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V776h128c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z"></path></svg>',title:n.ADD_SAVED_BLOCK}),B({targetElement:m,insertType:"append",className:"add-common-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="appstore" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"></path></svg>',title:n.ADD_COMMON_BLOCK}),B({targetElement:m,insertType:"append",className:"add-template-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="build" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M916 210H376c-17.7 0-32 14.3-32 32v236H108c-17.7 0-32 14.3-32 32v272c0 17.7 14.3 32 32 32h540c17.7 0 32-14.3 32-32V546h236c17.7 0 32-14.3 32-32V242c0-17.7-14.3-32-32-32zm-504 68h200v200H412V278zm-68 468H144V546h200v200zm268 0H412V546h200v200zm268-268H680V278h200v200z"></path></svg>',title:n.ADD_TEMPLATE_BLOCK}),B({targetElement:m,insertType:"append",className:"add-search-block",tag:"i",HTMLcontent:'<svg viewBox="64 64 896 896" focusable="false" data-icon="search" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"></path></svg>',title:n.ADD_SEARCH_BLOCK})}eu(Bu.commit);const h=e.closest('[em="block"]');h&&(h.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=B({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=B({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=B({targetElement:c,insertType:"append",className:"em-element-editor-group"});B({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(og,`${xe} ${Ve.drag}`),title:n.REORDER_BLOCK}),B({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(AA,`${xe} ${Ve.moveUp}`),title:n.REORDER_BLOCK_UP}),B({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(TA,`${xe} ${Ve.moveDown}`),title:n.REORDER_BLOCK_DOWN}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:Oe(kA,`${xe} ${Ve.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ra,`${xe} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),B({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(Du,`${xe} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&B({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(ig,`${xe} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),eu(Bu.commit)}}function Bi(e){if(document.documentElement.classList.contains("em-resize-start"))return;const t=j.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 gQ(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if(Bi(n),n.querySelector(".em-element-editor.of-atom")||Hu(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&&Hu(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")||(Hu(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&(Bi(n),n.querySelector(".em-element-editor.of-group")||(Hu(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:Ma,NEW_EDITOR:sg}=sT,{TRIM_SPACES:Pa,EMPTY_TEXT:bQ}=aT;function yQ(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}`),h=n.closest(`table.${c}`)?c:u;if(!f)return!0;const m=xl(f).counterpart(n)??n,p=PV(m,h);if(!p)return!0;const{firstCellText:v,firstCellHtmlNoText:C,wrappedSecondCellHtml:k}=p;return o==="start"||o==="end"?vQ(n,f,h,c,u,o,v,C,k,a):o==="inside"&&EQ(n,f,h,c,a),l(),s(),!0}function vQ(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add(Ma);const d=U0(a,s),f=U0(l," "),h=i==="end"?zV(f):f,m=Ol(t),p="<tr>"+d+h+"</tr>",v=Di(m),C=IV(v,p,Ma,i==="start"),k=Di(C);lo(t),Ca(t,k);const L=t.querySelector(`.${Ma}`)?.closest("tr"),E=i==="start"?L?.previousElementSibling:L?.nextElementSibling;E&&j0(E),n===r&&Sp(t),qV(t,r,o,Pa);const g=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return g&&xA(g,t,c),g}function EQ(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)?$V(s,a,l):null;return c?(j0(c.row),s.after(c.row),lo(t),FV(t),c.content.classList.add(sg),n===r&&Sp(t),xA(c.content,t,o,!0),c.content):null}function xA(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&Ii(e,Ue(e).replace(Pa,"")),bQ.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),ws(s,a)}}r&&o&&It(()=>o.focus())}function SQ(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,h=(e.keyCode===38||e.key==="ArrowUp")&&o==="start",m=(e.keyCode===40||e.key==="ArrowDown")&&(!s&&o==="end"||s&&o==="start");if(!(h||m)||!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 C=n.querySelector("div");C&&C.classList.add(Ma);const k=Ol(v),L=Di(k),E=WV(L,Ma,sg,p);lo(v),Ca(v,E);const g=v.querySelector(".remove-new-editor-element");if(g){l(g,!0);const y=v.querySelector("editor"),w=y?.querySelector("div")?.childNodes[0],b=window.getSelection();if(b&&b.rangeCount>0){const S=b.getRangeAt(0);if(w&&w.nodeType===Node.TEXT_NODE){const _=w.textContent||"";S.setStart(w,_.replace(Pa,"").length)}else y&&S.selectNodeContents(y);S.collapse(!0),ws(b,S)}}return c(),a(),!0}function wQ(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function _Q(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,h=(...ve)=>It(()=>t.setCursorSafely(...ve)),{classNameOl:m,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 C=r.closest(`table.${m}`)?m:p,k=l.closest("tr");if(!k)return!0;const L=k.previousElementSibling;if(!L&&!s)return!0;const E=s?r.querySelector("div"):k.querySelector("tr td:nth-child(2)")?.querySelector("div"),g=E?Ue(E):"",y=g?g.split(" ")[0]:"";y.replace(Pa,"");const w=L?.querySelector("tr td:nth-of-type(2)");if(!w)return!0;const b=w.querySelector("div");if(!b)return!0;b.classList.add(sg);const S=Ue(b),_=`${S}${g}`;lo(k.parentNode??k),k.remove();const T=b.closest(`table.${m}`)||b.closest(`table.${p}`);if(!T)return!0;const x=Ue(T),N=Di(x);Ca(T,N),C===m&&Sp(T);const I=T.querySelector(".remove-new-editor-element");if(!I)return d(),c(),!0;const O=_.replace(Pa,"");Ii(I,`${O} `),u(I,!0);const M=I.closest("editor");if(!M)return d(),c(),!0;const V=window.getSelection(),K=document.createRange(),se=M.querySelector("div");if(!se||!V)return d(),c(),!0;const te=M.textContent||"",Z=y?te.indexOf(y):-1;if(Z!==-1&&y){const ve=f(se,Z);if(ve)h(K,V,ve.node,ve.offset);else{const fe=se.childNodes[0];fe&&h(K,V,fe,0)}}else{const ve=document.createElement("div");ve.innerHTML=S;const fe=(ve.textContent||"").length,_e=f(se,fe);if(_e)h(K,V,_e.node,_e.offset);else{const ct=document.createTreeWalker(se,NodeFilter.SHOW_TEXT,null);let ne=null;for(;ct.nextNode();)ne=ct.currentNode;ne&&h(K,V,ne,(ne.textContent||"").length)}}return It(()=>M.focus()),d(),c(),!0}function CQ(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 TQ(e){if(!e)return!1;const t=e.closest("li");return Su(t)}function AQ(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 kQ(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 LQ(e){const t=window.getSelection();if(!t||t.rangeCount===0)return Ue(e);const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset),OA(e,r)}function OA(e,t){const n=document.createElement("div");return n.appendChild(t.cloneContents()),nn(e,n),Zo(n),Ke(n)}function NQ(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),OA(e,r)}function Hi(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function Ia(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function xQ(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML=" ",Ia(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Hi(r),r}function OQ(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=" ",Ia(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(),Hi(a),a}function RQ(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(!TQ(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=AQ(i),l=kQ(i,s);switch(a.position){case"empty":MQ(i,s,l,t);break;case"start":PQ(i,s,t);break;case"end":IQ(i,s,t);break;case"middle":DQ(i,s,t)}return t.commit(),!0}function MQ(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",Gn.LIST_ITEM),o.innerHTML=" ",e.after(o),Ia(e,o),Hi(o);break;case"first":xQ(e,t);break;case"middle":OQ(e,t)}}function PQ(e,t,n){const r=document.createElement("li");r.setAttribute("style",Gn.LIST_ITEM),r.innerHTML=" ",e.before(r),Hi(e)}function IQ(e,t,n){const r=document.createElement("li");r.setAttribute("style",Gn.LIST_ITEM),r.innerHTML=" ",e.after(r),Ia(e,r),Hi(r)}function DQ(e,t,n){const r=LQ(e),o=NQ(e);Ii(e,r||" ");const i=document.createElement("li");i.setAttribute("style",Gn.LIST_ITEM),Ii(i,o||" "),e.after(i),Ia(e,i),Hi(i)}function BQ(e){const t=r=>eh({target:r.target},o=>e.commit(o)),n=()=>j.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?MV(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),f=o.target,h=wu(f),{isList:m}=h,p=d?.textContent===l?.textContent,v=l?aT.EMPTY_TEXT.test(l.textContent||""):!1,C=c?o.metaKey:o.ctrlKey;if(C&&o.keyCode===83){o.preventDefault(),e.messageService.send({operation:"application_action",action:"save_email"});return}const k=NY(o,!!C);if(k){o.preventDefault(),nA(e.messageService,k);return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}if(PY(o,{commit:e.commit}))return;DY(o,{commit:e.commit}),o.key==="Enter"&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.isComposing&&Lv();const L={getElementParent:b=>Ri(b),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>Bi(void 0),getVariableByIcon:ca,removeEmptyParents:xa,getAllComments:N$,isVariableComment:j_,getVariableIcon:b=>R$(b),commit:e.commit,messageService:e.messageService};if(RY(o,m,u,L))return;if(o.keyCode===27){const b=document.querySelector(".em-editor-wrapper");b?.style&&(b.style.display="none"),Lr("em-edit"),It(()=>document.querySelectorAll("editor").forEach(S=>S.blur())),i?.removeAllRanges(),e.applicationElementSettingsSet({elem:null}),e.messageService.send({operation:"application_close-image-edit-popup"});return}C&&o.keyCode===66&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strong"}));const E=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&E&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),C&&o.shiftKey&&o.keyCode===76&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_left"})),C&&o.shiftKey&&o.keyCode===82&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_right"})),C&&o.shiftKey&&o.keyCode===69&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"textAlign_center"})),C&&o.keyCode===73&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_italic"})),C&&o.keyCode===85&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_underline"})),RQ(o,{commit:e.commit})||BY(o,l,m,p,{commit:e.commit}))return;if(C&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const b=S=>{Wl(S,!1,n(),t,e.commit),document.removeEventListener("paste",b)};document.addEventListener("paste",b)}else t(o);const g={activeElem:l,listContext:h,cursorPositionType:u,isTargetCell:p,isEmptyText:v,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>EG()};if(yQ(o,g)||(wQ(o,u,v),SQ(o,g)))return;const y={...g,parentElement:a,findNodeAtPosition:dT,setCursorSafely:HG};if(_Q(o,y)||CQ(o,m,p))return;const w={setCursorInsideSpan:P$,isCaretAtEndOfStandardElement:I$,setCursorPositionSimple:D$,commit:e.commit};MY(o,w)&&e.commit()}}function HQ(e,t){if(!(document.body?.classList.contains("mceNonEditable")||t.isIntegratorLocked())&&!(!e.target?.closest?.('[contenteditable="true"]')||!e.key||e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1){e.preventDefault(),e.stopImmediatePropagation();const n=window.getSelection();if(n?.isCollapsed&&n.rangeCount>0&&i_(n,e.key)){ao(!0);return}lr("insertText",!1,e.key)}}function FQ(e){const t=n=>HQ(n,e);return document.addEventListener("keydown",t,!0),{dispose(){document.removeEventListener("keydown",t,!0)}}}function $Q(e){const t=oQ({handlePasteTextFragment:Wl,getCommonStyles:()=>j.get("commonStyles"),changeMsoValue:n=>eh({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",BQ({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),document.addEventListener("beforeinput",n=>OY(n,e),!0),FQ(e.editLock)}var WQ='<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>',Fu=4;function qQ(e,t){return e.left<Fu||e.right-e.left>t-8?Fu-e.left:e.right>t-Fu?t-Fu-e.right:0}var Fi=null,ag=null;function lg(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;Fi||(Fi=new CSSStyleSheet),document.adoptedStyleSheets.includes(Fi)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,Fi]),Fi.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;ag=e;const r=Math.round(qQ(n,document.documentElement.clientWidth));r!==0&&Fi.replaceSync(`${t} { margin-left: ${r}px; }`)}function zQ(e,t,n){e.addEventListener("mouseenter",()=>{ag=null,lg(t,n)}),e.addEventListener("mousemove",()=>{ag!==t&&lg(t,n)}),t.addEventListener("mouseenter",()=>lg(t,n))}function To(e,t){return{settings:e,elem:t}}var Xe={applicationElementSettingsSet:e=>R(Mt,Ie)(e),setCursorPosition:e=>R(Mt,yt)(e),commit:ao};function UQ(){return j.get("emailWidth")||475}function $u(){return document.documentElement.clientWidth<=UQ()}function cg(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Xe.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Xe.setCursorPosition(s),Be(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=h=>{const m=h.touches[0];if(!m)return;h.preventDefault(),c.x+=m.clientX-l.x,c.y+=m.clientY-l.y,l={x:m.clientX,y:m.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(()=>{Be(document.documentElement,!1,"em-resize-start"),Xe.commit(!1)})}}function Ao(e,t,n){cg(e,t,"ns-resize",n)}function Da(e,t,n){cg(e,t,"ew-resize",n)}function jQ(e,t,n){cg(e,t,"nwse-resize",n)}function ko(e,t){let n=null,r=0;const o=$u();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?Oi(To({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):(n.style.height=r+"px",n.style.lineHeight=r+"px")}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;n.classList.add("em-hover"),r=n.clientHeight+t,n.closest("tr")?.querySelectorAll(".em-gap").forEach(i=>{const s={mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},a=i.closest(".em-mob-wrap, .noresp-em-mob-wrap");Oi(To(s,a)),i.style.height=r+"px";const l=i.querySelector(".em-element-gap-value");l&&(l.innerHTML=r+"px")})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(n=e.closest(".em-vindent-paddingTop"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?va(To({mobilePadding:{top:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingTop=r+"px")}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(n=e.closest(".em-vindent-paddingBottom"),!n)return;const i=n.parentElement;n.classList.add("em-hover"),r=n.clientHeight+t,n.style.height=r+"px",o&&i?va(To({mobilePadding:{bottom:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingBottom=r+"px")}else{if(n=e.closest("td"),!n)return;r=n.clientHeight+t,o?Oi(To({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):n.setAttribute("height",String(r))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Xe.commit()}function Lo(e){let t=null;const n=$u();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():Xe.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Xe.applicationElementSettingsSet({elem:Th(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?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Xe.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?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Xe.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Xe.applicationElementSettingsSet({elem:t})}t&&Xe.commit()}function $i(e,t){let n=null,r=0;const o=$u();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)),Xe.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)),Ul(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,f=(v,C)=>Math.round(C*parseFloat(v)/100);let h=s.map((v,C)=>f(u[C],d));const m=l-(h.reduce((v,C)=>v+C,0)+(s.length-1)*r);if(m!==0){const v=h.length-Math.abs(m);h=h.map((C,k)=>v<=k?C+(m>0?1:-1):C)}const p=h;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((v,C)=>{Array.from(v.querySelectorAll("table[width]")).filter(k=>!k.getAttribute("width")?.includes("%")).forEach(k=>{+(k.getAttribute("width")||0)<=p[C]&&(k.style.maxWidth=String(p[C]),k.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((v,C)=>v.setAttribute("width",String(p[C]))),c.querySelectorAll(".em-gap").forEach(v=>{v.parentElement?.setAttribute("width",String(r)),v.style.width=r+"px";const C=v.querySelector(".em-element-gap-value");C&&(C.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?va(To({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>_u(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?va(To({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>_u(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&&Xe.commit()}function Wi(e){let t=null;const n=$u();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Xe.applicationElementSettingsSet({elem:r}),Xe.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Xe.applicationElementSettingsSet({elem:Th(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?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Xe.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?Xe.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Xe.applicationElementSettingsSet({elem:r})}t&&Xe.commit()}var RA={getLocale:Mi,commit:ao,messageService:z},VQ=".em-prevent-action",MA=new WeakSet;function GQ(){return j.get("emailWidth")||475}function XQ(){return j.get("isLeftButtonDown")||!1}function KQ(){return j.get("editImageControlEnabled")||!1}function PA(){return j.get("imageCenterEditorEnabled")||!1}function YQ(){return j.get("imageCenterStockEnabled")||!1}function ZQ(){return j.get("imageCenterGifEnabled")||!1}function QQ(){return j.get("elementAIimageEnabled")||!1}function JQ(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=RA.getLocale(),n=GQ(),r=XQ(),o=PA(),i=document.documentElement.clientWidth<=(n||475);if(document.body&&!document.body.classList.contains("mceNonEditable")&&!r){if(e.tagName==="TD"&&e.innerHTML===""&&e.getAttribute("height")&&!e.classList.contains("em-vindent")&&!e.closest("editor")){e.classList.add("em-vindent"),e.closest("table")?.classList.add("em-vindent-table"),parseInt(e.getAttribute("height")||"0")<30&&e.classList.add("em-vindent_low");const m=B({targetElement:e,insertType:"append",className:"em-element-resize-height"});B({targetElement:e,insertType:"append",className:"em-element-vindent"}),B({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Ao(m,function(p){ko(m,p.movementY)},function(){Lo(m)})}if(e.closest(VQ))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const m=uo(e,"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;B({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 m=B({targetElement:e,insertType:"append",className:"em-element-resize-height"}),p=B({targetElement:e,insertType:"append",className:"em-element-vindent"});B({targetElement:p,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),B({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Ao(m,function(v){ko(m,v.movementY)},function(){Lo(m)})}if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.style.height&&e.style.fontSize&&!e.querySelector(".em-element-vindent-value")){const m=uo(e,"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;B({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=uo(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=uo(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=uo(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,f=uo(e,"em-mob-padding_right"),h=f?parseFloat(f.substring(21)):void 0;if((e.style.padding||e.style.paddingTop||e.style.paddingBottom||e.style.paddingLeft||e.style.paddingRight)&&!e.closest("editor")&&(e.tagName!=="A"||e.style.height)){if(e.style.paddingTop&&!e.querySelector(":scope > .em-vindent-paddingTop")&&!e.querySelector(":scope > editor > .em-vindent-paddingTop")&&(!a||!i)){const m=B({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${e.style.paddingTop}`});e.getBoundingClientRect().top<30&&m.classList.add("top-crossed")}e.style.paddingBottom&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&!e.querySelector(":scope > editor > .em-vindent-paddingBottom")&&(!c||!i)&&B({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)&&B({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")&&(!h||!i)&&B({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${e.style.paddingRight}`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(m=>{if(!m.querySelector(".em-element-resize-height")){const p=m;(parseFloat(p.style.height)<30||parseFloat(p.style.width)<30)&&m.classList.add("em-vindent_low");const v=B({targetElement:p,insertType:"append",className:"em-element-resize-height"});B({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),B({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const C=B({targetElement:p,insertType:"append",className:"em-element-vindent"});let k="";p.className.indexOf("paddingTop")>-1?(k=e.style.paddingTop,Ao(v,function(L){ko(v,L.movementY)},function(){Lo(v)})):p.className.indexOf("paddingBottom")>-1?(k=e.style.paddingBottom,Ao(v,function(L){ko(v,L.movementY)},function(){Lo(v)})):p.className.indexOf("paddingLeft")>-1?(k=e.style.paddingLeft,Da(v,function(L){$i(v,L.movementX)},function(){Wi(v)})):p.className.indexOf("paddingRight")>-1&&(k=e.style.paddingRight,Da(v,function(L){$i(v,-L.movementX)},function(){Wi(v)})),B({targetElement:C,insertType:"append",className:"em-element-vindent-value",HTMLcontent:k})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&B({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&B({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&B({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),h&&!e.querySelector(":scope > .em-vindent-paddingRight")&&B({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingRight",style:`width: ${h}px`}),e.querySelectorAll('[class*="em-vindent-padding"]').forEach(m=>{if(!m.querySelector(".em-element-resize-height")){const p=m;(parseFloat(p.style.height)<30||parseFloat(p.style.width)<30)&&m.classList.add("em-vindent_low");const v=B({targetElement:p,insertType:"append",className:"em-element-resize-height"});B({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),B({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const C=B({targetElement:p,insertType:"append",className:"em-element-vindent"});let k="";p.className.indexOf("paddingTop")>-1?(k=a,Ao(v,function(L){ko(v,L.movementY)},function(){Lo(v)})):p.className.indexOf("paddingBottom")>-1?(k=c,Ao(v,function(L){ko(v,L.movementY)},function(){Lo(v)})):p.className.indexOf("paddingLeft")>-1?(k=d,Da(v,function(L){$i(v,L.movementX)},function(){Wi(v)})):p.className.indexOf("paddingRight")>-1&&(k=h,Da(v,function(L){$i(v,-L.movementX)},function(){Wi(v)})),B({targetElement:C,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(k)})}})),e.closest('[em="block"]')?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length||0)>2&&!e.closest('[em="block"]')?.querySelector(".em-mob-wrap .em-gap, .noresp-em-mob-wrap .em-gap")){const m=uo(e.closest('[em="block"]')?.querySelector(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)"),"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;e.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap:nth-child(even), .noresp-em-mob-wrap:nth-child(even)").forEach(v=>{B({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 C=v,k=B({targetElement:C,insertType:"append",className:"em-element-resize-height"});B({targetElement:C,insertType:"append",className:"em-element-gap-marker"}),B({targetElement:C,insertType:"append",className:"em-element-gap-bg"});const L=B({targetElement:C,insertType:"append",className:"em-element-gap"});let E="";i?(E=C.style.height,Ao(k,function(g){ko(k,g.movementY)},function(){Lo(k)})):(E=C.style.width,Da(k,function(g){$i(k,g.movementX)},function(){Wi(k)})),B({targetElement:L,insertType:"append",className:"em-element-gap-value",HTMLcontent:E})}})}if(e.tagName==="IMG"){const m=e;if(m.closest("td[em-platform], td[data-em-platform]"))return;if(m.closest(".em-element-resize-img-container")||m.closest('div[style*="font-size"][style*="line-height"][style*="font-family"]')||m.closest("editor")||m.classList.contains("em-video")){if(m.closest(".em-element-resize-img-container")){const k=m.closest(".em-element-resize-img-container"),L=k.querySelector(".em-element-img-edit");!m.getAttribute("src")?.includes(".gif")&&o?L||B({targetElement:k.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:Oe(Ra,`${xe}`),title:t.CHANGE_IMAGE_EDIT}):k.querySelector(".em-element-img-edit")?.remove()}return}const p=document.createElement("span");p.classList.add("em-element-resize-img-container"),Rv(p),Mv(p);const v=m.parentElement instanceof HTMLAnchorElement?m.parentElement:m;v.parentElement?.insertBefore(p,v),p.appendChild(v);const C=B({targetElement:p,insertType:"append",tag:"span",className:"em-element-resize-img"});jQ(C,function(k){$i(C,k.movementX)},function(){Wi(C)}),m?.style.maxWidth&&m?.style.display==="block"&&m.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),eJ(m,p)}}}function eJ(e,t){const n=RA;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=KQ(),i=PA(),s=YQ(),a=ZQ(),l=QQ();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=B({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if(B({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&&B({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:Oe(Ra,`${xe}`),title:r.CHANGE_IMAGE_EDIT}),s&&B({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}),B({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:Oe(WQ,`${xe}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&B({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&&B({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),MA.has(c))return;MA.add(c),zQ(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 h="application_open-image-edit-popup";e.classList.contains("em-ai-img")||d?.classList.contains("em-element-img-ai")?h="application_open-image-ai-popup":Sq(f)||d?.classList.contains("em-element-img-changeto")?h="application_open-image-upload-popup":d?.classList.contains("em-element-img-gif")?h="application_open-image-gif-popup":d?.classList.contains("em-element-img-stock")&&(h="application_open-image-stock-popup");const m={operation:h,src:f};setTimeout(()=>{n.messageService.send(m)},100)})}}function IA(e){const t=e.ownerDocument.activeElement;return t instanceof HTMLElement&&t!==e.ownerDocument.body&&t.closest('[contenteditable="true"]')!==null&&e.contains(t)}function tJ(e){const t=(n,r)=>{IA(n)||e.wrapEditor(n,r)};return function(r){let o=r.target;const i=e.selectionLock.acquire();try{o=e.getVisibleNode(o);const s=e.isInExternal(o),a=document.body;if(a?.classList.contains("mceNonEditable")&&!a.classList.contains("em-sandbox-discuss")||a?.classList.contains("em-sandbox-discuss")&&!a.classList.contains("em-sandbox-discuss_set-target"))return;if(a?.classList.contains("em-sandbox-discuss_set-target")){document.querySelectorAll('[em-hover="true"]').forEach(f=>{f.removeAttribute("em-hover"),f.removeAttribute("contenteditable")}),o.closest(".em-element-vindent")||(o.setAttribute("em-hover","true"),o.setAttribute("contenteditable","true"));return}if(o.tagName!=="BODY"){const f=o.parentElement;n_(o)&&!o.isConnected&&f&&(o=f)}if(o&&(o?.closest('[em="atom"]')||!s)&&o.getAttribute("contenteditable")!=="false"&&o.parentElement?.getAttribute("contenteditable")!=="false"&&o.tagName!=="BODY"&&o.parentElement?.tagName!=="SECTION"){const f=!o.closest("editor")&&!IA(o),h=!e.getLockEditorInit(),m=o.tagName!=="IMG",p=!(o.childElementCount===1&&o.firstElementChild?.tagName==="IMG"&&(o.textContent?.trim()??"")==="");if(f&&h&&m&&p){let v=o;do if(v=v.closest("div, p, h1, h2, h3, h4, h5")||v.closest("span, b, strong, i, em, s, a, sup, sub"),v)if(!e.isVisible(v))v=v.parentElement;else break;while(v);if(o.tagName==="LI"&&o.style.fontFamily&&o.style.fontSize){const C=o.closest("ul, ol");C&&t(C,!0)}else if(o.tagName==="TD"&&o.style.fontFamily&&o.style.fontSize&&!o.querySelector("editor"))t(o);else if(v&&v.style.fontFamily&&v.style.fontSize&&(o.tagName==="LI"||!o.querySelector("img")))if(o.tagName==="LI"){const C=o.closest("ul, ol");C&&t(C,!0)}else o.querySelector("img")||t(o,!0);else if(v&&v.closest('[style*="font-family"][style*="font-size"]')){const C=v.closest('[style*="font-family"][style*="font-size"]');C&&C.tagName!=="BODY"&&C.tagName!=="TD"&&C.tagName!=="TABLE"?t(C,!1):C?.tagName==="TD"&&!C.querySelector("editor")&&!C.closest(".em-element-custom-table")&&t(C)}else if(v&&v?.tagName==="DIV"&&!v.querySelector("table")){const C=!!v.style.height?.length,k=v.className.includes("em-element-img-change-group"),L=v.querySelector("img")?.parentNode,E=!!v.querySelector("img")&&L&&!e.hasTextNodeInElement(L);!C&&!k&&!E&&t(v,!0)}else for(let C=0;C<o.childNodes.length;C++){const k=o.childNodes[C];if(k.nodeName==="#text"&&(k.textContent?.trim().length??0)>0&&!o.querySelector("table")){const L=o.tagName==="P"?o.parentElement:o;L&&t(L);break}}}}(o?.closest('[em="atom"]')||!s)&&!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(f=>f.classList.add("em-hover")):e.getIsLeftButtonDown()||document.querySelectorAll(".em-gap").forEach(f=>f.classList.remove("em-hover"));const l=e.getLoadStylesTimer(),c=!!o.style.padding||!!o.style.paddingTop||!!o.style.paddingBottom||!!o.style.paddingLeft||!!o.style.paddingRight,u=o.closest('[em="block"]'),d=!!u?.querySelector(".em-mob-wrap, .noresp-em-mob-wrap")&&(u?.querySelectorAll(".em-mob-wrap, .noresp-em-mob-wrap").length??0)>2;l&&(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"||c||d)&&e.implementResizableElems(o)}catch{}finally{i.releaseLater()}}}function nJ(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 Wu(e){e.button===0&&j.set("isLeftButtonDown",!1)}function DA(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&j.set("isLeftButtonDown",!0)}function rJ(e){const t=()=>e.openEditorInit();return document.addEventListener("mousedown",DA),document.addEventListener("mouseup",Wu),document.addEventListener("dragend",Wu),window.addEventListener("mousemove",t),{dispose(){document.removeEventListener("mousedown",DA),document.removeEventListener("mouseup",Wu),document.removeEventListener("dragend",Wu),window.removeEventListener("mousemove",t)}}}function oJ(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 iJ(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=oJ(document,n.clientX,n.clientY);if(i&&o.contains(i.startContainer)){const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}}}function BA(e,t,n){const r=ya(e,n),o=r===void 0?void 0:t.cells.find(i=>i.id===r);return o?{row:o.row,col:o.col}:null}function sJ(){const e=new Map,t=r=>{Be(r,!1,e.get(r)),e.delete(r)},n=(r,o)=>{Be(r,!0,o),e.set(r,o)};return{paint(r){const o=new Set(r);[...e].filter(([i,s])=>s==="em-active-table-cell"&&!o.has(i)).forEach(([i])=>t(i)),r.filter(i=>!e.has(i)).forEach(i=>n(i,yo))},mark:n,highlighted(){return[...e].filter(([,r])=>r===yo).map(([r])=>r)},clear(){[...e.keys()].forEach(t)}}}function aJ(e,t){const n=sJ();let r=null,o=null,i=null;const s=()=>r&&e.contains(r)&&r.classList.contains("remove-basic-cell")?r:null,a={base:s,direction:()=>s()?i:null,selected:()=>s()?n.highlighted().filter(l=>e.contains(l)):[],start(l){t.activate(a),a.clear(),r=l,n.mark(l,bo)},clear(){r=null,o=null,i=null,n.clear(),uz(e)&&e.isConnected&&t.commit(!0)}};return{selection:a,press(l){a.start(l);const c=Li(e),u=BA(e,c,l);o=u?{model:c,base:u}:null},hover(l){const c=o&&BA(e,o.model,l);if(!o||!c)return;const u=fU(o.model,o.base,c);i=u?.direction??null;const d=(u?.cellIds??[]).map(f=>np(e,f));n.paint(d.filter(f=>!!f))},release(){o=null}}}function qu(e,t,n,r){const o=pt(r);t.addEventListener(n,o),e.addEventListener("abort",()=>t.removeEventListener(n,o),{once:!0})}function lJ(e,t,n){const r=new AbortController,o=()=>e.isConnected?!1:(r.abort(),t.selection.clear(),n.forget(e,t.selection),!0),i=u=>{const d=ng(u.target);return d?.table===e?d.td:null},s=u=>{const d=u.button===0?i(u):null;d&&t.press(d)},a=u=>{if((u.buttons&1)===0){t.release();return}const d=i(u);d&&t.hover(d)},l=()=>{o()||t.release()},c=u=>{!o()&&u.target instanceof Node&&!e.contains(u.target)&&t.selection.clear()};qu(r.signal,e,"mousedown",s),qu(r.signal,e,"mouseover",a),qu(r.signal,document,"mouseup",l),qu(r.signal,document,"click",c)}function cJ(e){return t=>{const n=ng(t.target);n&&e.of(n.table)}}function uJ(e){const t=new WeakMap;let n=null;const r={commit:e.commit,activate(o){n&&n!==o&&n.clear(),n=o},forget(o,i){t.delete(o),n=n===i?null:n}};return{of(o){const i=t.get(o);if(i)return i;const s=aJ(o,r);return lJ(o,s,r),t.set(o,s.selection),s.selection}}}var dJ=1e3;function fJ(e){setTimeout(()=>j.set("loadStylesTimer",!0),dJ);const t=tJ({getVisibleNode:n=>e.htmlDocument.getVisibleNode(n),isInExternal:n=>e.htmlDocument.isInExternal(n),isVisible:n=>e.htmlDocument.isVisible(n),selectionLock:e.selectionLock,getLockEditorInit:()=>e.editLock.isEditorInitClosed(),getIsLeftButtonDown:()=>!!j.get("isLeftButtonDown"),getLoadStylesTimer:()=>!!j.get("loadStylesTimer"),hasTextNodeInElement:o5,wrapEditor:e.wrapEditor,implementElementsEditors:n=>gQ(n,{setBlockGroupControlsPosition:()=>Jc({scrollTop:j.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>JQ(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=pt(n=>{t(n),e.onHover?.(n.target)}),document.onmouseleave=nJ({removeElementEditors:()=>Bi(void 0),commit:e.commit}),document.addEventListener("mousedown",iJ({isEditLocked:()=>e.editLock.isTextLocked(),unlockEditorInit:()=>e.editLock.openEditorInit(),handleMouseover:t}),!0),document.addEventListener("mousedown",pt(cJ(e.tableSelections)),!0),rJ(e.editLock)}function mJ(e){return t=>R(e,ss)(t)}function hJ(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var pJ={name:"sandbox.elementSettings",provides:[Ie],awaits:{services:[Y,Bo,Ho,Ne,Io]},setup(e){const t=R(e,Bo),n=R(e,Io);e.inject(Ie,DG({htmlDocument:R(e,Y),getMapObj:()=>t,fingerprint:R(e,Ho),selectionLock:R(e,Ne),enrichExtras:()=>e.getServices(Lb).reduce((r,o)=>({...r,...o()}),{}),elementRefOf:r=>n.issue(r)}))}},gJ={name:"sandbox.documentChange",awaits:{services:[Y,Ho,Ie,it,Te,ss,Ne,Ye]},setup:e=>h$({htmlDocument:R(e,Y),fingerprint:R(e,Ho),initPreview:mJ(e),applicationElementSettingsSet:R(e,Ie),commit:dt(e),focusController:R(e,it).controller,selectionLock:R(e,Ne),editLock:R(e,Ye)})},bJ={name:"sandbox.toggleTextStyle",provides:[ol],awaits:{services:[Ie,Te,Ne]},setup(e){const t=R(e,Ie),n=dt(e),r=R(e,Ne),o=(i,s=Qe())=>{let a=hJ(Ns(s,i)||i);if(a?.tagName==="EDITOR"&&(a=a.firstElementChild),!a)return;const l=a;r.lift(()=>t({elem:l}))};e.inject(ol,WY({commit:n,addNewRange:Jo,refreshElementSettings:o,findElementWithSelectedText:Ns,getParentElementOfSelection:zl,findOutermostParentWithText:Wf,clearLinkTags:i=>{wo(i,n),Ur(n)},addFontFamilyClass:i=>ga(i,n),getIsProgrammaticSelection:()=>!!j.get("isProgrammaticSelection"),getCommonStyles:()=>j.get("commonStyles")??{}}))}},yJ={name:"sandbox.insert",provides:[Cr],awaits:{services:[Y,Ie,Te,xd,Ne,Ye]},setup:e=>e.inject(Cr,rQ({htmlDocument:R(e,Y),commit:dt(e),messageService:z,applicationElementSettingsSet:R(e,Ie),selectionLock:R(e,Ne),editLock:R(e,Ye),...R(e,xd)}))},vJ={name:"sandbox.elementSettingsApply",provides:[$o],awaits:{services:[Y,Bo,Te,yt,Ie,ol,gn,it,Ne]},setup(e){const t=R(e,Te),n=R(e,Bo),r=R(e,yt),o=R(e,Ie);let i=null;const s=l=>{i??(i=TY({htmlDocument:R(e,Y),getMapObj:()=>n,commit:dt(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,selectionLock:R(e,Ne),toggleTextStyle:R(e,ol),wrapEditor:R(e,gn).now,programmaticSelection:{get value(){return!!j.get("isProgrammaticSelection")},set value(c){j.set("isProgrammaticSelection",c)}}})),i(l)},a=R(e,it).controller;e.inject($o,l=>a.whenEditorLostFocus(()=>s(l)))}},EJ={name:"sandbox.tableSelections",provides:[Fo],awaits:{services:[Te]},setup:e=>e.inject(Fo,uJ({commit:dt(e)}))},SJ={name:"sandbox.mouse",awaits:{services:[Y,gn,Te,Ne,Ye,Fo]},setup:e=>fJ({htmlDocument:R(e,Y),commit:dt(e),selectionLock:R(e,Ne),editLock:R(e,Ye),wrapEditor:R(e,gn).deferred,tableSelections:R(e,Fo)})},wJ={name:"sandbox.click",awaits:{services:[Y,Te,yt,it,Ie,gn,Ne,Ye,Fo]},setup(e){const t=R(e,Te),n=R(e,it);VZ({htmlDocument:R(e,Y),commit:dt(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:z,setCursorPosition:R(e,yt),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:R(e,Ie),selectionLock:R(e,Ne),editLock:R(e,Ye),wrapEditor:R(e,gn).now,tableSelections:R(e,Fo),insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(kb)?.(r)??!1})}},_J={name:"sandbox.keyboard",awaits:{services:[Te,yt,Ie,gn,Ye]},setup:e=>$Q({editLock:R(e,Ye),commit:dt(e),messageService:z,setCursorPosition:R(e,yt),applicationElementSettingsSet:R(e,Ie),wrapEditor:R(e,gn).now})},CJ={name:"sandbox.cssFilterOnCommit",awaits:{services:[Y]},setup:e=>XH(R(e,Y))},TJ={name:"sandbox.vmlButtonLabelSync",awaits:{services:[Te]},setup(e){const t=R(e,Te);FY(n=>t.commit(n))}},AJ={name:"sandbox.insertListeners",awaits:{services:[Cr]},setup:e=>R(e,Cr).register()};function HA(e,t,n,r=""){sr(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 FA(e,t){const n=t.selectionLock.acquire();try{const r=t.getActiveEditElement();if(!r)return;const o=r.closest("amp-accordion");if(!o)return;const i=o.querySelector("section");if(!i)return;HA(o,t,(a,[l])=>{if(!(l instanceof Element))return!1;const c=l.querySelector(":scope > header td div");if(c){const d=Array.from(c.childNodes).find(f=>f.nodeType===Node.TEXT_NODE);d&&(d.nodeValue=e.section)}const u=l.querySelector(":scope > div");return u&&(u.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>`),a.append(l),!0},t.HTMLDocument.getOuterHtml(i))}catch{}finally{n.releaseLater()}}function $A(e,t){const n=t.selectionLock.acquire();try{const r=t.getActiveEditElement();if(!r)return;const o=r.closest("amp-accordion");if(!o)return;HA(o,t,i=>(i.querySelectorAll("section")[e.index]?.remove(),!0))}catch{}finally{n.releaseLater()}}function WA(e){return{selectionLock:e.selectionLock,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument}}function kJ(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||FA(e.data.settings,WA(t))}function LJ(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||$A(e.data.settings,WA(t))}var NJ={sandbox_accordion_add_section:kJ,sandbox_accordion_remove_section:LJ};function xJ(e,t){br(),Be(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 OJ(e,t){const{htmlDocument:n}=t;t.messageService.send({operation:"application_email_content_get",htmlCode:n.getOuterHtml(document.body)||n.getRootsHtml()})}var RJ={"sandbox_drag-cancel":xJ,sandbox_email_content_get:OJ};function MJ(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=MC()??null;if(!o){const i=Array.from(document.querySelectorAll('[em="block"]:not([em="block"] [em="block"])')),s=i.filter(a=>a.getAttribute("em-block-id")===String(n));o=s.length===1?s[0]:s.length===0&&i.length===1?i[0]:null}o&&(o.setAttribute("em-block-id",String(n)),r!=null&&r!==""&&o.setAttribute("em-block-version",String(r)),t.commit())}function PJ(e,t){const n=MC();!n||!n.hasAttribute("em-block-id")||(n.removeAttribute("em-block-id"),n.removeAttribute("em-block-version"),t.commit())}var IJ={sandbox_eblock_set_em_block_id:MJ,sandbox_eblock_clear_em_block_id:PJ};function qA(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 zA(e,t){for(const n of e)n.type===D.HTML&&!Za(n,n.parent)&&(n.content=t(n.content??"")),zA(n.children,t)}function DJ(e,t){const n=hn(e);zA(n.roots,t);const r=document.createDocumentFragment(),o=nb(void 0);try{r.append(...n.roots.map(i=>eo(i,!0,!0)))}finally{o()}return Zo(r),r}var BJ=`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 zu(e){e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem.previousSibling&&zu({elem:e.elem.previousSibling})}function Uu(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(),Uu({elem:t})));else if(e.elem.innerHTML.trim()==="")zu({elem:e.elem}),e.elem.remove(),Uu({elem:t});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?(zu({elem:n}),n.textContent=""):n.nodeName==="#comment"&&n.textContent?.indexOf("mso")!==-1&&(zu({elem:n}),n.remove());e.elem.innerHTML.trim()===""&&Uu({elem:e.elem})}return!0}function HJ(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&&(lo(o),o.remove()),Uu({elem:r}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function UA(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>`;tr(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",BJ),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")&&UJ(e,t).catch(r=>{})}var FJ=/^(script|style|noscript|xmp|iframe|noembed|noframes)$/i,jA=/^[ \t\n\r\f]*$/;function VA(e,t,n){const{copy:r,counterpart:o}=xl(e),i=$J(e,o),s=c=>{const u=i.get(c);return!!u&&Pv(u)},a=DJ(t(r.innerHTML),n),l=new Map;XA(r,a,l,s)&&i.forEach((c,u)=>l.get(u)?.(c))}function $J(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 GA(e){return[...(e instanceof HTMLTemplateElement?e.content:e).childNodes]}function XA(e,t,n,r){const o=GA(e),i=GA(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=qJ(o,a);a+=u.length;const d=c?.nodeType===Node.TEXT_NODE;if(!d&&!u.every(f=>jA.test(f.data))||(s+=d?1:0,!KA(u,d?c.data:"",n,r)))return!1;continue}if(!c||c.nodeType!==l.nodeType||!WJ(l,c,r(l)))return!1;if(a+=1,s+=1,l.nodeType===Node.COMMENT_NODE){if(!KA([l],c.data,n,r))return!1}else if(l.nodeType===Node.ELEMENT_NODE&&(r(l)&&zJ(l,c,n),!FJ.test(l.nodeName)&&!XA(l,c,n,r)))return!1}return s===i.length}function WJ(e,t,n){return t.nodeName===e.nodeName||!n&&t.nodeName.toLowerCase()===e.nodeName.toLowerCase()}function qJ(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 KA(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)&&!jA.test(i.data))?!1:(o.forEach((i,s)=>n.set(i,a=>a.data=s===0?t:"")),!0)}function zJ(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))})}var YA=()=>df(()=>Promise.resolve().then(()=>id("./typograf.all.CGEpDoct.js")),void 0,{}.url);async function UJ(e,t){const{default:n}=await YA();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);lo(document.body),e.action==="typograf_all"?VA(document.body,a,qA):r?.parentElement&&(r=r.parentElement,r?.parentElement&&VA(r.parentElement,a,qA)),document.querySelectorAll(".em-element-resize-img").forEach(l=>l.remove()),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 ZA(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function ug(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 jJ(e,t){const n=e.closest("a");if(ug(n))return n;if(!t)return null;const r=ZA(t.anchorNode)?.closest("a")??null;if(ug(r))return r;const o=ZA(t.focusNode)?.closest("a")??null;return ug(o)?o:null}function QA(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"&&Y_(e)?e.closest('[em="block"]')??e:e}function JA(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"?_i(e)??e:e:null}function VJ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if(jJ(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 GJ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=JA(QA(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function XJ(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=JA(QA(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function KJ(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),It(()=>document.querySelectorAll("editor").forEach(r=>{r.blur()}))}function YJ(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 ZJ(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function QJ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};VJ(n)}function JJ(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};GJ(n)}function eee(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};XJ(n)}function tee(e,t){if(!t.getElementParent)return;const n={commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,getVariableByIcon:t.getVariableByIcon};HJ(n)}function nee(e,t){if(!t.getElementParent)return;const n={action:e.data.action,locale:e.data.locale},r={commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,HTMLDocument:t.HTMLDocument,hasRussianText:t.hasRussianText};UA(n,r)}var ree={sandbox_element_active_reset:KJ,sandbox_element_active_set:YJ,sandbox_element_hover_set:ZJ,sandbox_element_parent_get:QJ,sandbox_element_prev_get:JJ,sandbox_element_next_get:eee,sandbox_element_remove:tee,sandbox_element_text:nee},Tn=".em-mob-wrap, .noresp-em-mob-wrap",xt=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",lt='div[style*="inline-block"]';function No(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&&No({elem:e.elem.previousSibling,width:e.width})}function ek(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&&ek({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function ju(e){return!!e.querySelector(Tn)||!!e.closest(Tn)}function Ba(e){return e.querySelector(Tn)?document.querySelector('[em-edit="active"]'):e.closest(Tn).parentElement}function Vu(e){return e.querySelector(lt)?document.querySelector('[em-edit="active"]'):e.closest(lt).parentElement}function tk(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const r=t.selectionLock.acquire();try{if(ju(n)){const o=Ba(n),i=e.minWidth,s=o.querySelectorAll(xt).length,a=s>1?parseFloat(String(e.gap)):20,l=s>1?parseFloat(String(e.gapMobile||e.gap)):20;let c="";o.querySelector(".em-mob-wrap")?c=`<td width="${a}" class="em-mob-wrap em-mob-height-${l}px"></td>
|
|
256
|
-
<td width="${i}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:o.querySelector(".noresp-em-mob-wrap")&&(c=`<td width="${a}" class="noresp-em-mob-wrap noresp-em-mob-height-${l}px"></td>
|
|
257
|
-
<td width="${i}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let u=0,d=0,f=0;o.querySelectorAll(xt).forEach(m=>{parseFloat(m.getAttribute("width")||"0")>i&&f++,u+=parseFloat(m.getAttribute("width")||"0")});const h=(i+a)/f;if(o.querySelectorAll(xt).forEach(m=>{if(parseFloat(m.getAttribute("width")||"0")>i){const p=Math.round(parseFloat(m.getAttribute("width")||"0")-h);m.setAttribute("width",String(p))}}),tr(o.querySelectorAll(xt)[s-1],"afterend",c),o.querySelectorAll(xt).forEach(m=>{d+=parseFloat(m.getAttribute("width")||"0")}),u-d-a!==0){const m=o.querySelector(Tn),p=parseFloat(m.getAttribute("width")||"0")+(u-d-a);m.setAttribute("width",String(p))}t.setPercentsForColumns(o.querySelectorAll(xt)),t.commit()}else{const o=Vu(n),i=e.minWidth,s=o.querySelectorAll(lt).length,a=s>1?parseFloat(String(e.gap)):20,l='<!--[if (gte mso 9)|(IE)]></td><td width="'+(i+a)+`" valign="top"><![endif]-->
|
|
258
|
-
<div style="display: inline-block; width: `+(i+a)+`px; vertical-align: top;" class="em-mob-width-100perc">
|
|
259
|
-
<table width="`+i+`" 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 c=0,u=0,d=0;if(s===1){const h=n.querySelector(lt)?o.querySelector(lt):n.closest(lt);h.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("width")}o.querySelectorAll(lt).forEach(h=>{const m=parseFloat(h.firstElementChild?.getAttribute("width")||"0");m>i&&d++,c+=m});const f=(i+a)/d;if(o.querySelectorAll(lt).forEach(h=>{const m=h;if(parseFloat(m.firstElementChild?.getAttribute("width")||"0")>i){const p=Math.round(parseFloat(m.style.width)-f),v=p-a;m.style.width=p+"px",No({elem:m,width:p}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(v))}}),tr(o.querySelectorAll(lt)[s-1],"afterend",l),o.querySelectorAll(lt).forEach(h=>{u+=parseFloat(h.firstElementChild?.getAttribute("width")||"0")}),c-u-a!==0){const h=o.querySelector(lt),m=parseFloat(h.style.width)+(c-u-a);h.style.width=m+"px",No({elem:h,width:m}),h.firstElementChild?.tagName==="TABLE"&&h.firstElementChild.setAttribute("width",String(m-a))}t.commit()}}catch{}finally{r.releaseLater()}}function nk(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;const o=t.selectionLock.acquire();try{if(ju(n)){const i=Ba(n);let s=0;const a=parseFloat(String(e.gap));i.querySelectorAll(xt).forEach((u,d)=>{d===e.removedBlockIndex&&(s=parseFloat(u.getAttribute("width")||"0"),u===n.closest(Tn)&&(n.closest(".em-structure > td")?.setAttribute("em-edit","active"),r=n.closest(".em-structure > td")),u.nextElementSibling&&u.previousElementSibling?u.previousElementSibling.remove():u.nextElementSibling&&!u.previousElementSibling?u.nextElementSibling.remove():!u.nextElementSibling&&u.previousElementSibling&&u.previousElementSibling.remove(),u.remove())});const l=i.querySelectorAll(xt).length,c=Math.floor((s+a)/l);if(i.querySelectorAll(xt).forEach(u=>{const d=Math.round(parseFloat(u.getAttribute("width")||"0")+c);u.setAttribute("width",String(d))}),l===1){const u=i.querySelector(Tn),d=u.closest("table").parentElement;u.setAttribute("width",String(d.getBoundingClientRect().width-parseFloat(d.style.paddingLeft||"0")-parseFloat(d.style.paddingRight||"0")))}t.setPercentsForColumns(i.querySelectorAll(xt))}else{const i=Vu(n);let s=0;const a=parseFloat(String(e.gap));i.querySelectorAll(lt).forEach((u,d)=>{d===e.removedBlockIndex&&(s=parseFloat(u.style.width),u===n.closest(lt)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),ek({elem:u,removedBlockIndex:e.removedBlockIndex}),u.remove())});const l=i.querySelectorAll(lt).length,c=Math.round(s/l);if(i.querySelectorAll(lt).forEach(u=>{const d=u,f=Math.round(parseFloat(d.style.width)+c),h=f-a;d.style.width=f+"px",No({elem:d,width:f}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(h))}),l===1){const u=i.querySelector(lt);u.style.width="100%",u.style.maxWidth=i.closest("table")?.style.maxWidth||"",No({elem:u,width:i.closest("table")?.style.maxWidth||""}),u.firstElementChild.style.width="91%",u.firstElementChild.style.maxWidth=parseFloat(u.firstElementChild?.getAttribute("width")||"0")+"px"}}}finally{t.commit(),Promise.resolve().then(()=>{o.release(),r&&t.applicationElementSettingsSet&&t.applicationElementSettingsSet({elem:r})})}}function rk(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function oee(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 ok(e,t=""){sr(t+_s(e),n=>{n.forEach(oee),e.after(...n)})}function iee(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{copiedBlockIndex:r,widths:o}=e,i=parseFloat(String(e.gap))||0,s=t.selectionLock.acquire();try{if(ju(n)){const a=Ba(n),l=a.querySelectorAll(xt)[r];if(!l)return;const c=l.nextElementSibling||l.previousElementSibling;ok(l,c?_s(c):a.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 u=a.querySelectorAll(xt);u.forEach((d,f)=>{o[f]!=null&&d.setAttribute("width",String(o[f]))}),t.setPercentsForColumns(u),t.commit()}else{const a=Vu(n),l=a.querySelectorAll(lt)[r];if(!l)return;ok(l,'<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
|
|
266
|
-
`),a.querySelectorAll(lt).forEach((c,u)=>{const d=c,f=o[u];if(f==null)return;const h=f+i;d.style.width=h+"px",No({elem:d,width:h}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(f))}),t.commit()}}catch{}finally{s.releaseLater()}}function ik(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const{indexA:r,indexB:o}=e;if(r===o)return;const i=t.selectionLock.acquire();try{if(ju(n)){const s=Ba(n),a=s.querySelectorAll(xt),l=a[r],c=a[o];if(!l||!c)return;rk(l,c),t.setPercentsForColumns(s.querySelectorAll(xt)),t.commit()}else{const s=Vu(n).querySelectorAll(lt),a=s[r],l=s[o];if(!a||!l)return;rk(a,l),[a,l].forEach(c=>{No({elem:c,width:parseFloat(c.style.width)})}),t.commit()}}finally{i.releaseLater()}}function see(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=Ba(r);if(e.wrap)o.querySelectorAll(Tn).forEach((i,s)=>{i.classList.remove("em-mob-wrap-cancel"),s%2===0&&(i.classList.forEach(a=>a.startsWith("em-mob-width-")&&i.classList.remove(a)),i.classList.add("em-mob-width-100perc"))});else{const i=o.querySelectorAll(xt).length,s=Math.round(100/i)-2;o.querySelectorAll(Tn).forEach((l,c)=>{l.classList.add("em-mob-wrap-cancel"),l.classList.remove("em-mob-width-100perc"),c%2===0&&l.classList.add("em-mob-width-"+s+"perc")});const a=t.emailWidth||660;document.querySelector('style[em="styles"]')?.insertAdjacentHTML("beforeend",`
|
|
267
|
-
@media only screen and (max-device-width:${a}px),only screen and (max-width:${a}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-${s}perc { width: ${s}% !important; }
|
|
270
|
-
}
|
|
271
|
-
`)}t.commit()}catch{}finally{n.releaseLater()}}function aee(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=r.querySelector(Tn)?document.querySelector('[em-edit="active"]'):r.closest(Tn)?.parentElement?.closest("td");if(!o)return;e.dirRevert?(o.setAttribute("dir","rtl"),o.querySelectorAll("td").forEach(i=>{for(let s=i.firstChild;s;s=s.nextSibling)if(s.nodeType===3){s.parentNode?.setAttribute("dir","ltr");break}})):(o.removeAttribute("dir"),o.querySelectorAll("[dir]").forEach(i=>i.removeAttribute("dir"))),t.commit()}catch{}finally{n.releaseLater()}}function qi(e){return{selectionLock:e.selectionLock,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function lee(e,t){!t.selectionLock||!t.setPercentsForColumns||tk(e.data.settings,qi(t))}function cee(e,t){!t.selectionLock||!t.setPercentsForColumns||nk(e.data.settings,qi(t))}function uee(e,t){!t.selectionLock||!t.setPercentsForColumns||iee(e.data.settings,qi(t))}function dee(e,t){!t.selectionLock||!t.setPercentsForColumns||ik(e.data.settings,qi(t))}function fee(e,t){!t.selectionLock||!t.setPercentsForColumns||see(e.data.settings,qi(t))}function mee(e,t){!t.selectionLock||!t.setPercentsForColumns||aee(e.data.settings,qi(t))}var hee={sandbox_floatBlock_add:lee,sandbox_floatBlock_remove:cee,sandbox_floatBlock_copy:uee,sandbox_floatBlock_swap:dee,sandbox_floatblock_wrap:fee,sandbox_floatblock_dir:mee},pee='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',gee=['[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 sk(){br(),Be(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 ak(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function lk(){for(const e of gee){const t=document.querySelector(e);if(t)return t}return null}function ck(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function uk(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?xu(e):null)}function bee(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),yee(i,e,r)}function yee(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 dg(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}),bee(e,t,n)}function vee(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 Eee(e,t){const n=yp();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=JT(e);if(e!==pee){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"||!cn(n)?null:(o?t.insertCountdown({targetElem:gr(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(gr(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function dk(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function fk(e,t){e&&t.messageService.send(de.APPLICATION_ATOM_INSERTED,e),sk()}function mk(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),sk()}function hk(e,t){const n=dk(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function See(e,t){if(!lk()&&!ak()&&!yp())return!1;let n=hk(e,t);if(!n)return!1;let r=null;const o=lk();if(o)r=dg(ck(o),n,t);else{const i=ak();if(i){const s=uk(i);s&&(r=dg(s,n,t))}else r=Eee(n,t)}return r?(vee(r,t),!0):!1}function pk(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"),sr(`
|
|
272
|
-
`+t+`
|
|
273
|
-
`,r=>{n.replaceChildren(...r),n.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",n)})}function wee(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"?pk(e,t):n.insertAdjacentHTML(e,"afterend",t)}function fg(e,t,n){if(!e.blockHTML?.trim())return!1;const r=yp(),o=r?null:document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')?.closest('[em="block"]')??vp();if(!n&&!r&&!o)return!1;const i=Oh(t.parseFromString(e.blockHTML));let s=i.filter(h=>h.tagName&&h.tagName!=="LINK"&&h.tagName!=="STYLE").map(h=>t.getOuterHtml(h)).join(""),a=i.filter(h=>h.tagName==="STYLE").map(h=>t.getOuterHtml(h)).join("");const l=t.assetsRoot?.()??document.head,c=i.filter(h=>h.tagName==="LINK"&&h.getAttribute("em-class")).filter(h=>!l?.querySelector(`link[em-class="${h.getAttribute("em-class")}"]`));if(a){let h=l?.querySelector('style[em="styles"]'),m="";h?m=t.HTMLDocument.getInnerHtml(h):(h=document.createElement("style"),h.setAttribute("em","styles"),h=l?.insertAdjacentElement("beforeend",h));const p=document.createElement("div");t.emailWidth&&(a=a.replace(/(max-device-width:|max-width:)\d+px/g,C=>C.replace(/\d+/,String(t.emailWidth)))),p.insertAdjacentHTML("afterbegin",a);let v=t.minify(m+`
|
|
274
|
-
`+[...p.querySelectorAll("style")].map(C=>C.innerHTML).join(`
|
|
275
|
-
`),{restructure:!0,forceMediaMerge:!0}).css;v=t.cssbeautify(v,{indent:" ",autosemicolon:!0}),h.textContent=`
|
|
276
|
-
`+v+`
|
|
277
|
-
`}for(const h of c.reverse())l?.prepend(h),l?.insertAdjacentHTML("afterbegin",`
|
|
278
|
-
`);if(e.type!=="project"&&(s=t.commonStylesApplyToBlock({html:s})),s.match(/class="em-countdown"/gi)&&(s=t.uptimeCountdown({blockHTML:s})),n)return(s.indexOf("empty-structure")>-1||s.indexOf("em-structure")>-1)&&(s=t.setBlockMaxWidth({blockHTML:s,targetBlock:n}),s=t.setFloatBlocksWidth({blockHTML:s,targetBlock:n,project:e.project})),s=t.checkBlockAdaptivity({blockHTML:s,blockIsTr:s.substring(0,3)==="<tr"}),wee(n,s,t),!0;let u=null,d=null,f=!1;return r?(u=r,d=u,(s.indexOf("empty-structure")>-1||s.indexOf("em-structure")>-1)&&(s=t.setBlockMaxWidth({blockHTML:s,targetBlock:u}),s=t.setFloatBlocksWidth({blockHTML:s,targetBlock:u,project:e.project})),s=t.checkBlockAdaptivity({blockHTML:s,blockIsTr:s.substring(0,3)==="<tr"}),s.substring(0,3)==="<tr"?t.insertAdjacentHTML(gr(r),"beforeend",s):t.insertAdjacentHTML(gr(r),"beforeend",'<tr><td align="center">'+s+"</td></tr>"),f=!0):o&&(u=o,(s.indexOf("empty-structure")>-1||s.indexOf("em-structure")>-1)&&(s=t.setBlockMaxWidth({blockHTML:s,targetBlock:u}),s=t.setFloatBlocksWidth({blockHTML:s,targetBlock:u,project:e.project})),s=t.checkBlockAdaptivity({blockHTML:s,blockIsTr:s.substring(0,3)==="<tr"}),u?.tagName==="TR"?(s.substring(0,3)==="<tr"?t.insertAdjacentHTML(u,"afterend",s):t.insertAdjacentHTML(u,"afterend",'<tr em="block"><td align="center">'+s+"</td></tr>"),f=!0):u&&(s.substring(0,3)==="<tr"?pk(u,s):t.insertAdjacentHTML(u,"afterend",s),f=!0),d=u?.nextSibling),f&&!document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')&&document.documentElement.scrollHeight+(t.iframeOffsetTop||0)>(t.previewHeight||0)&&d&&t.messageService.send({operation:"application_scroll-to",settings:{value:d.getBoundingClientRect().top+d.getBoundingClientRect().height}}),f}function _ee(e,t){if(t.lockEditor||!dk(e.atomHTML).trim())return;const n=t.selectionLock.acquire();try{t.setAtomReplaced?.(null),qT({kind:"atom",settings:e}),e.action!=="insert"&&Be(document.body,!0,"em-atom-insert-body"),e.action==="insert"&&See(e,t)&&fk(e.name,t),t.commit()}catch{}finally{n.releaseLater()}}function Cee(e){return e.replace(/["\\]/g,"\\$&")}function Tee(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="${Cee(String(n))}"]`,o=Array.from(document.querySelectorAll(r));if(!o.length)return 0;let i=0;const s=t.selectionLock.acquire();try{for(const a of o)fg({action:"insert",blockHTML:e.blockHTML,type:e.type,project:e.project,name:e.name},t,a)&&(a.remove(),i+=1);t.commit()}finally{s.releaseLater()}return i}function Aee(e,t){if(t.lockEditor||!e.blockHTML?.trim())return;const n=t.selectionLock.acquire();try{qT({kind:"block",settings:e}),Be(document.body,!0,"em-block-insert-body"),e.action==="insert"&&fg(e,t)&&mk(e,t),t.commit()}finally{n.releaseLater()}}function kee(e){const t=[...document.querySelectorAll('[em="block"]')].filter(n=>!e.has(n));return t.filter(n=>!t.some(r=>r!==n&&r.contains(n)))}function Lee(e,t,n){if(t.lockEditor||!e.blockHTML?.trim())return null;const r=new Set(document.querySelectorAll('[em="block"]')),o=t.selectionLock.acquire();try{if(!fg({...e,action:"insert"},t,n?.target))return null;const i=kee(r);return n?.place==="before"&&i.length&&n.target.before(...i),mk(e,t),t.commit(),i[0]??null}finally{o.releaseLater()}}function Nee(e,t,n){if(t.lockEditor)return null;const r=t.selectionLock.acquire();try{const o=hk(e,t);if(!o)return null;const i=()=>n.target.getAttribute("em")==="block"?uk(n.target):ck(n.target),s=n.place==="inside"?i():n.target,a=s?dg(s,o,t):null;return a&&n.place==="before"&&n.target.before(a),a&&fk(e.name,t),t.commit(),a}finally{r.releaseLater()}}function xee(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};_ee({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function Oee(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};Aee({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function Ree(e,t){t.setElementSettings?.(e)}var Mee={"sandbox_atom-insert":xee,"sandbox_block-insert":Oee,sandbox_element_settings_set:Ree},Pee=vn("elements",ree,{services:[Ie,yt,Te,Tr]},e=>{const t=R(e,Ie),n=R(e,yt),r=dt(e),o=R(e,Tr);return()=>({HTMLDocument:{getOuterHtml:Pt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>Ri(i),getVariableByIcon:ca,hasRussianText:pE,messageService:z,removeAllAttributes:Lr,setCursorPosition:i=>n(i)})}),Iee=vn("display",RJ,{services:[Y]},e=>{const t=R(e,Y);return()=>({messageService:z,htmlDocument:t})}),Dee=vn("floatBlock",hee,{services:[Ie,Te,Ne]},e=>{const t=R(e,Ie),n=dt(e),r=R(e,Ne);let o=600;return j.subscribe(i=>{i.emailWidth!==void 0&&(o=i.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:o,selectionLock:r,setPercentsForColumns:i=>Ul(i)})}),Bee=vn("accordion",NJ,{services:[Te,Ne]},e=>{const t=dt(e),n=R(e,Ne);return()=>({HTMLDocument:{getOuterHtml:Pt},commit:t,selectionLock:n,getActiveEditElement:xs,parseFromString:r=>Le(r)})}),Hee=vn("eblock",IJ,{services:[Te]},e=>{const t=dt(e);return()=>({commit:t})}),Fee=vn("palette",Mee,{services:[Cr,$o]},e=>{const t=R(e,Cr),n=R(e,$o);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),$ee=vn("nativeImageDrop",{[de.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>YT()},void 0,()=>()=>({})),Wee=[Pee,Iee,Dee,Bee,Hee,Fee,$ee];function gk(e){const t=e.activeElement;return!!t&&!!t.closest('[contenteditable="true"]')&&e.hasFocus()}function qee(e){return gk(e)?new Promise(t=>{const n=()=>{setTimeout(()=>{gk(e)||(e.removeEventListener("focusout",n,!0),e.defaultView?.removeEventListener("blur",n),t())},0)};e.addEventListener("focusout",n,!0),e.defaultView?.addEventListener("blur",n)}):Promise.resolve()}function Gu(){let e=null;if(document.querySelector(".preheader"))document.querySelectorAll(".preheader").length>1?document.querySelectorAll(".preheader").forEach(t=>{t.innerHTML.match(/[a-zA-Zа-яА-Я0-9]/gi)&&(e=t)}):e=document.querySelector(".preheader");else if(document.querySelector(".mcnPreviewText"))e=document.querySelector(".mcnPreviewText");else if(document.querySelector(".mail_preheader"))e=document.querySelector(".mail_preheader");else if(document.querySelector(".dvPreheader"))e=document.querySelector(".dvPreheader");else if(document.querySelector('[class*="letteros"]')||document.querySelector("[letteros-link]"))e=document.querySelector("body > div");else for(let t of document.querySelectorAll('[style*="display:none"], [style*="display: none"]'))if(t instanceof HTMLElement&&(parseInt(t.style.opacity)==0||t.style["mso-hide"]=="all"||t.style.overflow=="hidden"||parseInt(t.style.maxHeight)==0||parseInt(t.style.width)==0)&&t.tagName!="IMG"&&t.tagName!="TABLE"&&[...t.childNodes].filter(n=>n.nodeType==Node.TEXT_NODE).length>0){e=t;break}return e&&e.querySelector("div")?e=e.querySelector("div"):e&&e.querySelector("span")&&!e.querySelector("span")?.classList.contains("em-code")&&(e=e.querySelector("span")),e??void 0}function bk(e){return!!e&&!document.querySelector("title")}function mg(){const e=document.querySelector("title")?.textContent?.replaceAll(" "," ").replaceAll("‌","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","")||"";return t2(e).replace(/\s+/g," ").trim()}function Ha(e=Gu()){const t=document.createElement("div");return t.innerHTML=e?.innerHTML||"",t.querySelectorAll(".em-code").forEach(n=>n.remove()),kt(t).trim().replaceAll(/<vk-snippet-end\/>/g,"").replaceAll(/[\u034F\u200C\u2007\uFEFF]+/g,"").replaceAll("&","&").replaceAll("͏","").replaceAll("","").replaceAll(" ","").replaceAll("‌","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","").replace(/(?: |\s)+$/,"").trim()}function hg(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("mso")>=0?e.remove():e.previousSibling&&hg(e.previousSibling)}function pg(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("endif")>=0?e.remove():e.nextSibling&&pg(e.nextSibling)}var zee="͏‌  ",yk="#f0f1f3",vk='<span style="display:none !important;font-size:0;height:0;line-height:0;max-height:0;max-width:0;opacity:0;overflow:hidden;visibility:hidden;width:0">⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀'+new Array(200).fill(" ‌").join("")+"</span>";function Xu(e){return!!e&&e instanceof HTMLElement&&e.tagName==="SPAN"&&e.style&&e.style.display==="none"&&e.style.fontSize==="0px"&&e.style.visibility==="hidden"}function Ek(e){const t=e.nextSibling;return t&&hs(t)&&t.data==="<![endif]"?t:null}function Uee(e){const t=Ek(e);t&&t.nextSibling&&Xu(t.nextSibling)?t.nextSibling.remove():!t&&e.nextSibling&&Xu(e.nextSibling)&&e.nextSibling.remove();const n=Le(vk);n.length&&(t&&t.parentNode?t.parentNode.insertBefore(n[0],t.nextSibling):e.parentNode&&e.parentNode.insertBefore(n[0],e.nextSibling))}var Sk=e=>{hg(e),pg(e);const t=e.nextElementSibling;t instanceof HTMLElement&&t.style&&t.style.color==="transparent"&&(hg(t),pg(t),t.remove());const n=e instanceof HTMLElement?Ek(e):null;for(n&&n.nextSibling&&Xu(n.nextSibling)?n.nextSibling.remove():e.nextSibling&&Xu(e.nextSibling)&&e.nextSibling.remove();e.previousSibling&&oo(e.previousSibling)&&e.previousSibling.data.trim()==="";)e.previousSibling.remove();for(;e.nextSibling&&oo(e.nextSibling)&&e.nextSibling.data.trim()==="";)e.nextSibling.remove();e.remove()};function jee(e){return!(e.tagName!=="DIV"||G(e.style.color)!==yk||e.style.lineHeight!=="0px"||e.style.fontSize!=="0px"||!e.previousSibling||!hs(e.previousSibling)||e.previousSibling.data!=="[if !mso]><!"||!e.nextSibling||!hs(e.nextSibling)||e.nextSibling.data!=="<![endif]")}function Vee(e,t){let n=Gu(),r="";(e.length||t)&&(e=e.endsWith(" ")?e:e+" ",e=e+"<vk-snippet-end>͏</vk-snippet-end>͏",r=e.padEnd(e.length+5460,zee));const o=Le(r);if(n&&!jee(n)&&(Sk(n),n=null),n)o.length?(n.replaceChildren(...o),Uee(n)):Sk(n);else if(o.length){const i=document.createElement("div");i.classList.add("preheader"),i.style.color=yk,i.style.lineHeight=i.style.fontSize="0px",i.replaceChildren(...o),document.body?.prepend(i),i.insertAdjacentHTML("afterend",vk)}}function Gee(e,t){return!!t&&(Ha()||"")!==e}function Xee(e,t){return!!t&&(document.querySelector("title")?.textContent??"")!==e}function Kee(){return document.querySelector("title")?.textContent??void 0}async function wk(e,t,n,r){const o=n();await e.whenSent(),t()&&n()===o&&r()}function Yee(e,t){let n;const r=new Ee;let o=!1,i="",s=0;const a=u=>{o=!1,n=void 0,i=u.guid,s+=1},l=u=>(o=!0,n=Ha()||"",z.sendAsync(de.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n})),c=async({guid:u,value:d,force:f,fromAI:h,echo:m,undoStep:p})=>{if(f||await t.whenEditorLostFocusAsync("preheader"),typeof d=="string"&&u===i&&(n!==d||Gee(d,f))){const v=s;n=d,Vee(d),await e.commit(!!h||!!p,!0),(h||m)&&await wk(e,()=>v===s,()=>Ha(),()=>z.send(de.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n,forced:!!m&&!h}))}};return r.addDisposable(z.addListenerAsync(de.SANDBOX_PREHEADER_UPDATE,c)),r.addDisposable(z.addListenerAsync(de.SANDBOX_INIT_START,a)),r.addDisposable(z.addListenerAsync(de.SANDBOX_INITED,l)),r.addDisposable(e.onChange(()=>{if(o){const u=Ha()||"";u!==n&&(n=u,z.send(de.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n}))}})),r}function Zee(e,t){let n;const r=new Ee;let o="",i=!1,s=0;const a=u=>{i=!1,n=void 0,o=u.guid,s+=1},l=u=>{if(!(u?.guid&&o&&u.guid!==o))return i=!0,bk(n)||(n=mg()||""),z.sendAsync(de.APPLICATION_SUBJECT_UPDATE,{guid:o,value:n})},c=async({guid:u,value:d,force:f,fromAI:h,echo:m,undoStep:p})=>{if(f||await t.whenEditorLostFocusAsync("subject"),typeof d=="string"&&u===o&&(n!==d||Xee(d,f))){const v=s;n=d,document.title=d,await e.commit(!!h||!!p,!0),(h||m)&&await wk(e,()=>v===s,Kee,()=>z.send(de.APPLICATION_SUBJECT_UPDATE,{value:d,guid:o,forced:!!m&&!h}))}};return r.addDisposable(z.addListenerAsync(de.SANDBOX_SUBJECT_UPDATE,c)),r.addDisposable(z.addListenerAsync(de.SANDBOX_INIT_START,a)),r.addDisposable(z.addListenerAsync(de.SANDBOX_INITED,l)),r.addDisposable(e.onChange(()=>{if(i){if(bk(n))return;const u=mg()||"";u!==n&&(n=u,z.send(de.APPLICATION_SUBJECT_UPDATE,{value:u,guid:o}))}})),r}var An=e=>!!e?.closest(Uc),gg=e=>e.matches(".em-prevent-action")||!!e.querySelector(".em-prevent-action");function Ku(){const e=Gu();return e&&!e.closest('[em="atom"]')&&!e.querySelector('[em="atom"], [em="block"]')?e:void 0}function _k(e){const t=Ku();return!!t&&(t.contains(e)||e.contains(t))}function Qee(e){const t=new Map,n=Ku();return[...Array.from(e.querySelectorAll(Uc)),...n?[n]:[]].forEach(r=>{const o=e.ownerDocument.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let i=o.nextNode();i;i=o.nextNode())t.set(i,i.data)}),t}function Jee(e){e.forEach((t,n)=>{n.data!==t&&(n.data=t)})}function zi(e){return"ok"in e}var J=(e,t)=>({ok:!1,code:e,message:t}),Yr=J("staleElement","The element reference is stale: read element.getTree again and use a fresh reference."),ete=J("readOnly","The document is read-only."),Yu=J("unavailable","The canvas is busy with another edit; try again."),Ck=J("unavailable","The user is editing text right now; try again in a moment."),yr=J("readOnly","The element is locked by the integrator and cannot be changed."),bg=J("readOnly","A locked element of the integrator is inside, so this cannot be removed; remove what is around it instead."),yg=J("readOnly","This is or holds the preheader of the email; change it with document.setHeaders."),tte=80,nte=["img","countdown","video","button","a","vindent","social","customTable","carousel","accordion","var"];function xo(e){const t=e.closest('[em="block"]');return t&&(t===e||t.querySelector("td")===e)?t:null}function Fa(e){return e.querySelector("td")??e}function rte(e){return e.getAttribute("em-type")==="social"||e.querySelector("td[em-platform], td[data-em-platform]")?"social":k0(e)||e.querySelector(".em-element-custom-table")?"customTable":"td"}function Tk(e){return e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))}function Ak(e){return Tk(e)&&e.matches(":nth-child(even)")}function Zu(e){return e.getAttribute("em")==="block"?"structure":e.getAttribute("em")==="atom"?rte(e):Ak(e)?null:Tk(e)?"column":M0(e)?"floatBlock":up(e)&&!(e.parentElement&&up(e.parentElement))?"carousel":d0(e)?"accordion":I0(e)?Vj(e)?"countdown":Gj(e)||e.closest(".em-video")?"video":"img":e.tagName==="A"?y0(e)?"button":"a":e.tagName==="EM-REPLACE"?"var":oT(e)||iT(e)?"vindent":nT(e)?"text":null}function ote(e,t,n=tte){const r=[];let o=0;const i=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let a=i.nextNode();a&&o<=n;a=i.nextNode())t(a)&&a.nodeValue&&(r.push(a.nodeValue),o+=a.nodeValue.length);const s=r.join(" ").replace(/\s+/g," ").trim();return s.length>n?`${s.slice(0,n)}…`:s}function ite(e,t){const n={};if(t==="img"){const r=e.tagName==="IMG"?e:e.querySelector("img");n.src=r?mp(Cc(r,{clone:!0}))??void 0:void 0,n.alt=r?.getAttribute("alt")??""}else if(t==="a"||t==="button")n.href=e.getAttribute("href")??"";else return;return n}function kk(e,t){let n=t.budget,r=!1,o=!1;const i=(s,a)=>{const l=[];for(const c of Array.from(s.children)){if(o)break;const u=e.isInLetter(c)?Zu(c):null;if(!u){l.push(...i(c,a));continue}const d=e.issue(u==="structure"?Fa(c):c);if(!d)continue;if(n<=0){r=o=!0;break}n-=1;const f={element:d,type:u},h=ote(c,p=>e.isInLetter(p),t.textLimit);h&&(f.text=h);const m=ite(c,u);if(m&&(f.attrs=m),!nte.includes(u))if(a<t.depth){const p=i(c,a+1);p.length&&(f.children=p)}else c.querySelector('[em="atom"], img, a, td.em-mob-wrap')&&(r=!0);l.push(f)}return l};return{nodes:i(t.root,1),truncated:r}}var ste=`em-replace, style, script, ${Uc}`,Lk=20,Qu="[\\p{L}\\p{N}\\p{M}]",vg=new RegExp(`^${Qu}`,"u"),Eg=new RegExp(`${Qu}$`,"u"),Nk="a, abbr, b, big, cite, code, del, dfn, em, em-replace, font, i, ins, kbd, mark, nobr, q, s, samp, small, span, strike, strong, sub, sup, tt, u, var",nre="ul, ol, table",xk=["text","button","a"],Ok=`ul, ol, table, img, em-replace, ${Uc}`;function Sg(e){if(xk.includes(Zu(e)??""))return e;const t=Array.from(e.querySelectorAll("*")).filter(n=>xk.includes(Zu(n)??""));return t.length===1?t[0]:null}function Rk(e){let t=e;for(;t.children.length===1&&!t.firstElementChild?.matches("em-replace")&&t.textContent?.trim()&&t.firstElementChild?.textContent?.trim()===t.textContent.trim();)t=t.firstElementChild;return t}function ate(e){let t=e;for(;t.children.length===1&&!t.textContent?.trim();)t=t.children[0];return t.tagName==="BR"?t:void 0}function Mk(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r\n?/g,`
|
|
279
|
-
`).replace(/\n/g,"<br>")}function lte(e,t,n){const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=t?"g":"gi";if(!n)return new RegExp(r,o);const i=vg.test(e),s=Eg.test(e);return new RegExp(`${i?`(?<!${Qu})`:""}${r}${s?`(?!${Qu})`:""}`,`${o}u`)}function Pk(e){let t=e.parentElement;for(;t?.matches(Nk);)t=t.parentElement;return t}function Ik(e,t){const n=Pk(e);if(!n)return"";const r=e.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT);r.currentNode=e;const o=()=>t?r.nextNode():r.previousNode();for(let i=o();i;i=o())if(i.nodeType!==Node.TEXT_NODE){if(!i.matches(Nk))return""}else if(i.nodeValue)return Pk(i)===n?i.nodeValue:"";return""}function cte(e,t,n){const r=n===0&&vg.test(t),o=n+t.length===e.length&&Eg.test(t);return r&&Eg.test(Ik(e,!1))||o&&vg.test(Ik(e,!0))}function Dk(e){return e.replace(/\s+/g," ").trim()}function ute(e,t,n,r){const o=e.slice(Math.max(0,t-Lk),t),i=e.slice(t+n.length,t+n.length+Lk);return{before:Dk(o+n+i),after:Dk(o+r+i)}}function dte(e){const t=Sg(e);return t&&Zu(t)==="text"?t:J("invalidArgs","Typograf runs on a text element or on the whole email.")}function fte(e,{startWait:t,released:n,settle:r,writable:o,edit:i,selectChecked:s,readSelected:a,doneInTime:l,typografLoaded:c}){return{replaceText:async({find:u,replace:d,matchCase:f,wholeWord:h,root:m})=>{if(typeof u!="string"||!u||typeof d!="string")return J("invalidArgs",'"find" must be a non-empty string and "replace" a string.');const p=t(to),v=await o(p);if(v)return v;if(!await n(p))return Yu;const C=m===void 0?e.root():e.refs.resolve(m);if(!C)return Yr;const k=h!==!1,L=lte(u,f===!0,k);let E=0;const g=[];return e.applyOwn(()=>{const y=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_TEXT),w=Ku(),b=[];for(let S=y.nextNode();S;S=y.nextNode())e.isInLetter(S)&&!S.parentElement?.closest(ste)&&!w?.contains(S)&&b.push(S);b.forEach(S=>{const _=S.nodeValue??"",T=_.replace(L,(x,N)=>k&&cte(S,x,N)?x:(E+=1,g.length<5&&g.push(ute(_,N,x,d)),d));T!==_&&(S.nodeValue=T)})}),E===0?{ok:!0,value:{replaced:E}}:(await r(()=>({ok:!0})),{ok:!0,value:{replaced:E,examples:g}})},setProps:async({element:u,props:d})=>{if(!d||typeof d!="object"||Array.isArray(d))return J("invalidArgs",'"props" must be an object of inspector settings.');const f=t(to),h=await o(f);if(h)return h;const m=await a(u,f,v=>An(v)?yr:v);if(zi(m))return m;if(m.sent.type==="customTable")return J("invalidArgs","Table cells are edited in the table editor, not by element.setProps.");const p=e.letterText();return e.applySettings(m.sent.type,{...d}),r(()=>({ok:!0,element:e.activeElement()??m.element,unchanged:!e.selectionLock.isLocked()&&e.letterText()===p}))},setText:({element:u,text:d})=>typeof d!="string"?Promise.resolve(J("invalidArgs",'"text" must be a string.')):i(u,f=>{const h=f&&Sg(f);if(!h)return J("invalidArgs","Text is set on a text, header, button or link element; pass its reference or the reference of its cell.");const m=Rk(h);return An(h)?yr:_k(h)?yg:m.matches(Ok)||m.querySelector(Ok)?J("invalidArgs","The element holds a list, a table, a picture, a variable or a locked part that new text would erase; use text.replace."):(pb(m,Mk(d)),{ok:!0,element:h})}),insertVariable:({element:u,variable:d})=>typeof d!="string"||!d.trim()?Promise.resolve(J("invalidArgs",'"variable" must be a non-empty string.')):i(u,f=>{const h=f&&Sg(f);if(!h)return J("invalidArgs","A variable goes into a text, header, button or link element; pass its reference or the reference of its cell.");const m=Rk(h),p=ate(m),v=p?.parentElement??m;if(An(v))return yr;if(Ku()?.contains(h))return yg;if(h.matches("ul, ol, table")||h.querySelector("ul, ol, table"))return J("invalidArgs","The element holds a list or a table; a variable cannot be appended to it.");const C=h.ownerDocument.createElement("em-replace");return C.setAttribute("text",d),C.textContent=d,p?.remove(),v.append(C),{ok:!0,element:h}}),typograf:async({element:u})=>{const d=t(to),f=await o(d);if(f)return f;if(u===void 0){if(!await n(d))return Yu;const p=e.activeElement()?void 0:Array.from(e.root().querySelectorAll('[em="block"]')).find(C=>!An(Fa(C)));if(!e.activeElement()&&!p)return{ok:!0};const v=p?s(Fa(p)):void 0;if(v&&zi(v))return v}else{const p=await a(u,d,dte);if(zi(p))return p;if(!p.element.contains(e.activeElement()))return J("unavailable","The element could not be selected; try again.")}if(!await c(d))return J("unavailable","Typograf did not finish; try again.");const h=Qee(e.root()),m=await l(()=>e.typograf(u===void 0?"typograf_all":"typograf"));return e.applyOwn(()=>Jee(h)),m?r(()=>({ok:!0})):J("unavailable","Typograf did not finish; try again.")}}}function wg(e){return e?.closest("amp-accordion")??null}var mte=".em-mob-wrap, .noresp-em-mob-wrap",hte=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",pte='div[style*="inline-block"]';function gte(e){const t=e.settings?.floatBlocks;return Array.isArray(t?.items)?t:void 0}function bte(e){const t=e.closest('[em="block"]');return t?Fa(t):void 0}function Ui(e){return Array.from(e.querySelectorAll(e.querySelector(mte)?hte:pte))}function yte(e){return wg(e)??J("invalidArgs","Pass an accordion reference.")}var _g=e=>e.querySelectorAll("section").length;function Bk(e){const t=yte(e);return"ok"in t||!An(t)?t:yr}function vte(e,t){const n=e.querySelector(":scope > header");if(!n)return;const r=n.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_TEXT),o=[];for(let l=r.nextNode();l;l=r.nextNode())o.push(l);const i=l=>{let c=0;for(let u=l.parentElement;u&&u!==n;u=u.parentElement)c+=1;return c},s=o.filter(l=>l.data.trim()),a=s.reduce((l,c)=>!l||i(c)>i(l)?c:l,void 0);a&&(a.data=t,s.filter(l=>l!==a&&l.data===t).forEach(l=>l.data=""))}var Ete=r2/2,Hk=5e3;function Ste(e){return e.getAttribute("em")==="block"?Fa(e):e}function wte(e){const t=p=>{let v=!1;const C=[];return e.later(()=>{v=!0,C.splice(0).forEach(k=>k())},p),{expired:()=>v,onExpire:k=>v?k():void C.push(k)}},n=p=>new Promise(v=>{if(p?.expired()){v(!1);return}if(!e.selectionLock.isLocked()){v(!0);return}let C=!1;const k=E=>{C||(C=!0,L(),v(E))},L=e.selectionLock.onReleased(()=>k(!0));(p??t(Ete)).onExpire(()=>k(!1))}),r=p=>{if(!p.ok)return p;const v=p.element?.isConnected?e.refs.issue(Ste(p.element)):void 0,C=p.columns?.flatMap(L=>e.refs.issue(L)??[]),k={...v?{element:v}:{},...C?{columns:C}:{},...p.sections===void 0?{}:{sections:p.sections},...p.unchanged?{unchanged:!0}:{}};return{ok:!0,value:Object.keys(k).length?k:void 0}},o=async p=>(await n(),await e.commit(),await e.whenSent(),r(p())),i=(p,v)=>new Promise(C=>{let k=!1;const L=E=>{k||(k=!0,C(E))};v(L),e.later(()=>L(!1),p)}),s=p=>new Promise(v=>{if(p.expired()){v(!1);return}p.onExpire(()=>v(!1)),e.whenEditorLostFocus().then(()=>v(!0))}),a=async p=>await s(p)?e.editLock.isTextLocked()?ete:void 0:Ck,l=async(p,v)=>{const C=t(to),k=await a(C);if(k)return k;if(!await n(C))return Yu;const L=p===void 0?void 0:e.refs.resolve(p);if(p!==void 0&&!L)return Yr;const E=e.applyOwn(()=>v(L));return E.ok?o(()=>E):E},c=p=>{const v=e.select(p);return!v||!v.type?J("invalidArgs","This element has no settings in the inspector; pick another element from element.getTree."):{element:p,sent:v}},u=async(p,v,C)=>{if(!await s(v))return Ck;if(!await n(v))return Yu;const k=e.refs.resolve(p);if(!k)return Yr;const L=C?C(k):k;return"ok"in L?L:c(L)},d=async(p,v,C)=>{const k=t(to),L=await a(k);if(L)return L;const E=await u(p,k,v);if(zi(E))return E;const g=e.applyOwn(()=>C(E));return g.ok?o(()=>g):g};return{startWait:t,released:n,settle:o,writable:a,edit:l,selectChecked:c,readSelected:u,editSelected:d,editRow:async(p,v,C)=>{let k,L,E=[];const g=await d(p,y=>(k=y,E=v.map(w=>e.refs.resolve(w)).filter(w=>w!==void 0),E.length<v.length?Yr:An(y)||E.some(An)?yr:bte(y)??J("invalidArgs","Pass a row or a column reference.")),y=>{const w=e.activeElement();return!w||!y.element.contains(w)?J("unavailable","The row could not be selected; try again."):(L=y.element,C({cell:L,origin:k,others:E,floatBlocks:gte(y.sent)}))});return g.ok&&L?.isConnected&&e.select(L),g},doneInTime:p=>i(Hk,v=>{p().then(()=>v(!0),()=>v(!1))}),typografLoaded:p=>i(Hk,v=>{p.onExpire(()=>v(!1)),e.loadTypograf().then(()=>v(!p.expired()),()=>v(!1))})}}var _te=4,Cte=8,Tte=300,Ate=2e3,kte=500,Lte=1500,Nte=1e4,Fk="agent",xte=["usedColors","nextElem","prevElem"];function $k(e,t,n,r){return typeof e=="number"&&Number.isFinite(e)?Math.min(Math.max(Math.round(e),n),r):t}function Wk(e){return e.flatMap(({children:t,...n})=>[n,...Wk(t??[])])}function Ote(e){return Object.fromEntries(Object.entries(e).filter(([t])=>!xte.includes(t)))}function Rte(e,{settle:t,startWait:n,readSelected:r}){const o=new WeakMap;return{settle:()=>t(()=>({ok:!0})),tree:async({root:i,depth:s})=>{e.refs.sync();const a=i===void 0?e.root():e.refs.resolve(i);return a?{ok:!0,value:kk({issue:l=>e.refs.issue(l),isInLetter:l=>e.isInLetter(l)},{root:a,depth:$k(s,_te,1,Cte),budget:Tte})}:Yr},find:async({root:i})=>{e.refs.sync();const s=i===void 0?e.root():e.refs.resolve(i);if(!s)return Yr;const a=kk({issue:l=>e.refs.issue(l),isInLetter:l=>e.isInLetter(l)},{root:s,depth:Number.MAX_SAFE_INTEGER,budget:Ate,textLimit:kte});return{ok:!0,value:{nodes:Wk(a.nodes),truncated:a.truncated}}},get:async({element:i})=>{const s=await r(i,n(to));if(zi(s))return s;const{element:a,sent:l}=s;return{ok:!0,value:{element:l.elementRef??e.refs.issue(a)??i,type:l.type,caption:l.caption,settings:Ote(l.settings??{})}}},select:async({element:i})=>{const s=await r(i,n(to));return zi(s)?s:{ok:!0,value:{element:s.sent.elementRef??e.refs.issue(s.element)??i}}},highlight:async({element:i,durationMs:s})=>{const a=e.refs.resolve(i);if(!a)return Yr;const l=(o.get(a)??0)+1;return o.set(a,l),e.applyHidden(()=>a.setAttribute("em-hover",Fk)),e.later(()=>{o.get(a)===l&&a.getAttribute("em-hover")===Fk&&e.applyHidden(()=>a.removeAttribute("em-hover"))},$k(s,Lte,300,Nte)),{ok:!0}}}}function Ju(e){return xo(e)?null:e.closest('[em="atom"]')}function Mte(e,{edit:t,editRow:n,editSelected:r}){const o=s=>wg(e.activeElement())===s,i=s=>{const a=wg(e.activeElement());return a&&_g(a)===s?{ok:!0,element:a,sections:s}:J("unavailable","The section change did not apply; read the tree again.")};return{delete:({element:s})=>t(s,a=>{const l=a&&xo(a),c=a&&Ju(a);if(An(a))return yr;const u=l??c;if(u&&gg(u))return bg;const d=u??a;if(d&&_k(d))return yg;if(l)e.removeBlock(l);else if(c){if(!e.removeAtom(c))return J("unavailable","The element is being edited right now; try again.")}else return J("invalidArgs","Only blocks and elements can be deleted; columns and cells go with their block.");return{ok:!0}}),clone:({element:s})=>t(s,a=>{const l=a&&xo(a),c=a&&Ju(a),u=l??c;return u?An(a)?yr:(l?e.cloneBlock(u):e.cloneAtom(u),{ok:!0,element:u.nextElementSibling}):J("invalidArgs","Only blocks and elements can be cloned.")}),move:({element:s,direction:a})=>t(s,l=>{const c=l&&xo(l);return c?An(l)?yr:e.moveBlock(c,a)?{ok:!0,element:c}:J("cannotMove",`The block is already the ${a==="up"?"first":"last"} one.`):J("invalidArgs",'Only blocks move; pass a block reference (kind "row").')}),insertBlock:({block:s,at:a})=>t(a?.element,l=>{const c=l&&(xo(l)??l.closest('[em="block"]'));if(a&&!c)return J("invalidArgs",'Blocks are inserted next to a block; pass a block reference (kind "row").');const u=e.insertBlock(s,c&&a?{target:c,place:a.place}:void 0);return u?{ok:!0,element:u}:J("invalidArgs","The block could not be inserted here.")}),insertAtom:({atom:s,at:a})=>t(a.element,l=>{if(!l)return Yr;if(An(l))return yr;if(a.place==="inside"&&Ak(l))return J("invalidArgs","This is the gap between columns, not a column; pass a column from element.getTree.");const c=a.place==="inside"?Ju(l)?null:xo(l)??l:Ju(l);if(!c)return J("invalidArgs",a.place==="inside"?"Elements are inserted inside a row or a column, not inside another element.":'Use "before" or "after" with an element reference, or "inside" with a row or a column.');const u=e.insertAtom(s,{target:c,place:a.place});return u?{ok:!0,element:u}:J("invalidArgs","The element could not be inserted here.")}),addColumn:({element:s})=>n(s,[],({cell:a,origin:l,floatBlocks:c})=>{const u=Ui(a);if(!xo(l)&&!u.includes(l))return J("invalidArgs","A column is added to a row; pass a row or a column reference.");if(u.length===0||!c)return J("invalidArgs","This row has no column layout to add a column to.");if(u.length>=8)return J("invalidArgs","A row holds at most 8 columns.");if(!c.items.some(f=>f.width>30))return J("invalidArgs","The columns are too narrow to make room for a new one.");e.addColumn({minWidth:30,gap:c.gap??0,gapMobile:c.gapMobile??0});const d=Ui(a);return d.length===u.length+1?{ok:!0,element:a,columns:d}:J("unavailable","The column could not be added.")}),removeColumn:({element:s})=>n(s,[],({cell:a,origin:l,floatBlocks:c})=>{const u=Ui(a),d=u.indexOf(l);if(d<0)return J("invalidArgs","Pass a column reference; a gap between columns is not a column.");if(u.length<2)return J("invalidArgs","A row keeps at least one column; delete the row instead.");if(typeof c?.gap!="number"||!Number.isFinite(c.gap))return J("invalidArgs","This row has no column layout to remove a column from.");if(gg(l))return bg;e.removeColumn({removedBlockIndex:d,gap:c.gap});const f=Ui(a);return f.length===u.length-1?{ok:!0,element:a,columns:f}:J("unavailable","The column could not be removed.")}),swapColumns:({element:s,with:a})=>n(s,[a],({cell:l,origin:c,others:[u]})=>{const d=Ui(l),[f,h]=[d.indexOf(c),d.indexOf(u)];if(f<0||h<0||f===h)return J("invalidArgs","Pass two different columns of the same row.");e.swapColumns({indexA:f,indexB:h});const m=Ui(l);return m[f]===d[h]?{ok:!0,element:l,columns:m}:J("unavailable","The columns could not be swapped.")}),addAccordionSection:({element:s,title:a,text:l})=>typeof a!="string"||typeof l!="string"?Promise.resolve(J("invalidArgs",'"title" and "text" must be strings.')):r(s,Bk,c=>{const u=_g(c.element);if(!o(c.element))return J("unavailable","The accordion could not be selected; try again.");if(u===0)return J("invalidArgs","The accordion has no section to copy.");e.addSection({section:a,text:Mk(l)});const d=i(u+1),f=d.ok?d.element?.querySelector(":scope > section:last-of-type"):void 0;return f&&vte(f,a),d}),removeAccordionSection:({element:s,index:a})=>r(s,Bk,l=>{const c=_g(l.element);return!Number.isInteger(a)||a<0||a>=c?J("invalidArgs",`"index" must be a section number from 0 to ${c-1}.`):c<2?J("invalidArgs","An accordion keeps at least one section; delete the accordion instead."):gg(l.element.querySelectorAll("section")[a])?bg:o(l.element)?(e.removeSection({index:a}),i(c-1)):J("unavailable","The accordion could not be selected; try again.")})}}function Pte(e){const t=wte(e),n={...Rte(e,t),...fte(e,t),...Mte(e,t)};return r=>{const o=n[r?.op];return o?o(r):Promise.resolve(J("invalidArgs",`Unknown element operation "${String(r?.op)}".`))}}var Ite={name:"sandbox.agentElements",awaits:{services:[Io,Y,ot,Te,Ne,Ye,it,Ie,$o,yt,Cr]},setup(e){const t=R(e,Y),n=R(e,ot),r=R(e,Te),o=R(e,it),i=R(e,Ie),s=R(e,$o),a=R(e,yt),l=R(e,Cr),c=()=>{r.commit()},u=()=>({commit:c,setCursorPosition:a,scrollTop:j.get("scrollTop")}),d=R(e,Ne),f={selectionLock:d,commit:c,setPercentsForColumns:p=>Ul(p),applicationElementSettingsSet:i},h={selectionLock:d,commit:p=>{r.commit(p)},getActiveEditElement:xs,HTMLDocument:{getOuterHtml:Pt}},m=Pte({refs:R(e,Io),isInLetter:p=>t.isInLetter(p),applyOwn:p=>t.applyOwn(p),applyHidden:p=>t.applyHidden(p),commit:()=>r.commit(!0),whenSent:()=>t.whenSent(),selectionLock:d,editLock:R(e,Ye),whenEditorLostFocus:async()=>{await o.controller.whenEditorLostFocusAsync("agent"),await qee(document)},root:()=>document.body,select:p=>{o.setEditorFocus(!1),window.getSelection()?.removeAllRanges();const v=i({elem:p});return a(p),v},applySettings:(p,v)=>s({data:{operation:de.SANDBOX_ELEMENT_SETTINGS_SET,type:p,settings:v}}),letterText:()=>n.getText(),activeElement:()=>xs(),removeAtom:p=>iA(p,{getElementParent:v=>Ri(v),setCursorPosition:a,getVariableByIcon:ca,commit:c}),removeBlock:p=>hA(p,u()),cloneAtom:p=>cA(p,u()),cloneBlock:p=>uA(p,u()),moveBlock:(p,v)=>v==="up"?dA(p,u()):fA(p,u()),insertBlock:(p,v)=>Lee(p,l.insertContext(),v),insertAtom:(p,v)=>Nee(p,l.insertContext(),v),addColumn:p=>tk(p,f),removeColumn:p=>nk(p,f),swapColumns:p=>ik(p,f),addSection:p=>FA(p,h),removeSection:p=>$A(p,h),loadTypograf:YA,typograf:p=>new Promise(v=>UA({action:p},{commit:()=>{c(),v()},setCursorPosition:a,getElementParent:C=>Ri(C),messageService:z,HTMLDocument:{getOuterHtml:Pt},hasRussianText:pE})),later:(p,v)=>{setTimeout(p,v)}});z.addListenerAsync(de.SANDBOX_ELEMENT_OPERATION,m)}},Dte={name:"sandbox.prepareHtml",provides:[rl],setup:e=>e.inject(rl,t=>Ac({node:t,isPartial:!0}))},Bte={name:"sandbox.blockControlsViewport",setup:e=>e.addService(Nb,()=>Jc({scrollTop:j.get("scrollTop")}))},Hte=[Dte,Bte,pJ,gJ,bJ,yJ,vJ,...Wee,EJ,SJ,wJ,_J,CJ,TJ,AJ,Ite],Fte="__emmDiagnostics__",$te="diagnostics";function Wte(){try{const e=new URLSearchParams(window.location.search).get($te);return e!==null&&e!=="0"}catch{return!1}}function Cg(e){try{window.parent.postMessage({mark:Fte,...e},"*")}catch{}}function qte(){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}});Cg({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function ji(){return window.performance.timeOrigin+window.performance.now()}function zte(){return Array.from(document.images).every(e=>e.complete)}function Ute(e,t){const r=window.setInterval(()=>{!zte()||ji()-e()<500||(window.clearInterval(r),Cg({type:"settled",at:Math.max(e(),t)}),qte())},100)}function jte(){if(!Wte()||typeof MutationObserver!="function")return;let e=!1,t=ji();new MutationObserver(()=>{t=ji(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=ji();Cg({type:"paint",at:n}),Ute(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=ji()}),document.addEventListener("load",()=>{t=ji()},!0)}var Vte=500,Gte=300,$a,ed=!1;function qk(){if(ed)return;ed=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,$a=!1,ed=!1)},Gte);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),$a=!0,ed=!1)})}function Xte(){return $a===!1?(qk(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{$a=!1,n()},Vte);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),$a=!0,n()})})})}var Kte=1;function Yte(){qk();const e=async(t,n)=>{await n?.(t),await Xte()};z.addListenerAsync(de.SANDBOX_INITED,e,Kte)}var Zte=16,zk=100,Qte=.95,Uk=.02;function jk(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*Zte:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function Vk(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 Gk(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(Vk(o,"y",n)||Vk(o,"x",t))return!0}return!1}function Jte(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,f=t;e=0,t=0,!(d===0&&f===0)&&z.send(de.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||Gk(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(jk(d.deltaX,d.deltaMode),jk(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,h=performance.now();const m=p=>{const v=p>h?Math.min(p-h,50):16;h=p;const C=Math.pow(Qte,v/16);if(d*=C,f*=C,Math.abs(d)<Uk&&Math.abs(f)<Uk){l=void 0;return}o(d*v,f*v),l=window.requestAnimationFrame(m)};l=window.requestAnimationFrame(m)};window.addEventListener("touchstart",d=>{c(),s=!1,a={x:0,y:0};const f=d.touches.length===1?d.touches[0]:void 0;i=f?{x:f.screenX,y:f.screenY,at:d.timeStamp}:void 0},{passive:!0}),window.addEventListener("touchmove",d=>{const f=d.touches.length===1?d.touches[0]:void 0;if(document.documentElement.classList.contains("em-resize-start")){i=void 0,s=!1;return}if(!f||!i){i=void 0,s=!1;return}const h=i.x-f.screenX,m=i.y-f.screenY,p=d.timeStamp-i.at;if(i={x:f.screenX,y:f.screenY,at:d.timeStamp},!Gk(d.target,h,m)){if(d.cancelable&&d.preventDefault(),s=!0,p>0){const v=Math.min(p/zk,1);a={x:a.x*(1-v)+h/p*v,y:a.y*(1-v)+m/p*v}}o(h,m)}},{passive:!1}),window.addEventListener("touchend",d=>{const f=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&f<zk&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var ene={name:"sandbox.diagnosticsAgent",setup:()=>jte()},tne={name:"sandbox.paintGate",setup:()=>Yte()},nne={name:"sandbox.wheelBridge",setup:()=>Jte()},rne={name:"sandbox.deviceWidthMediaGuard",setup:()=>z7()};function one(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function ine(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:one,widthCalculationMethod:ine};var sne=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,h=!0,m=1,p="bodyOffset",v=p,C=!0,k="",L={},E=32,g=null,y=!1,w=!1,b="[iFrameSizer]",S=b.length,_="",T={max:1,min:1,bodyScroll:1,documentElementScroll:1},x="child",N=!0,I=window.parent,O="*",M=0,V=!1,K=null,se=16,te=1,Z="scroll",ve=Z,fe=window,_e=function(){fn("onMessage function not defined")},ct=function(){},ne=function(){},q={height:function(){return fn("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return fn("Custom width calculation function not defined"),document.body.scrollWidth}},oe={},Wt=!1;try{var U=Object.create({},{passive:{get:function(){Wt=!0}}});window.addEventListener("test",td,U),window.removeEventListener("test",td,U)}catch{}var un,wt,dn,Zt,kn,Qt,ut={bodyOffset:function(){return document.body.offsetHeight+Nn("marginTop")+Nn("marginBottom")},offset:function(){return ut.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return q.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,Rt(ut))},min:function(){return Math.min.apply(null,Rt(ut))},grow:function(){return ut.max()},lowestElement:function(){return Math.max(ut.bodyOffset()||ut.documentElementOffset(),Se("bottom",ht()))},taggedElement:function(){return Qn("bottom","data-iframe-height")}},Ot={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return q.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(Ot.bodyScroll(),Ot.documentElementScroll())},max:function(){return Math.max.apply(null,Rt(Ot))},min:function(){return Math.min.apply(null,Rt(Ot))},rightMostElement:function(){return Se("right",ht())},taggedElement:function(){return Qn("right","data-iframe-width")}},_t=(un=xn,kn=null,Qt=0,function(){var P=Date.now(),$=se-(P-(Qt=Qt||P));return wt=this,dn=arguments,$<=0||se<$?(kn&&(clearTimeout(kn),kn=null),Qt=P,Zt=un.apply(wt,dn),kn||(wt=dn=null)):kn=kn||setTimeout(qt,$),Zt});Zn(window,"message",function(P){var $={init:function(){k=P.data,I=P.source,nd(),h=!1,setTimeout(function(){C=!1},f)},reset:function(){C?ue("Page reset ignored by init"):(ue("Page size reset by host page"),Qr("resetPage"))},resize:function(){vr("resizeParent","Parent window requested size check")},moveToAnchor:function(){L.findTarget(Ce())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Re=Ce();ue("PageInfoFromParent called from parent: "+Re),ne(JSON.parse(Re)),ue(" --")},message:function(){var Re=Ce();ue("onMessage called from parent: "+Re),_e(JSON.parse(Re)),ue(" --")}};function he(){return P.data.split("]")[1].split(":")[0]}function Ce(){return P.data.substr(P.data.indexOf(":")+1)}function X(){return P.data.split(":")[2]in{true:1,false:1}}function ee(){var Re=he();Re in $?$[Re]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||X()||fn("Unexpected message ("+P.data+")")}b===(""+P.data).substr(0,S)&&(h===!1?ee():X()?$.init():ue('Ignored message of type "'+he()+'". Received before initialization.'))}),Zn(window,"readystatechange",Kk),Kk()}function td(){}function Zn(P,$,he,Ce){P.addEventListener($,he,!!Wt&&(Ce||{}))}function Wa(P){return P.charAt(0).toUpperCase()+P.slice(1)}function Oo(P){return b+"["+_+"] "+P}function ue(P){y&&window.console}function fn(P){window.console}function nd(){function P(X){return X==="true"}var $;function he(X){mn(0,0,X.type,X.screenY+":"+X.screenX)}function Ce(X,ee){ue("Add event listener: "+ee),Zn(window.document,X,he)}$=k.substr(S).split(":"),_=$[0],s=n!==$[1]?Number($[1]):s,u=n!==$[2]?P($[2]):u,y=n!==$[3]?P($[3]):y,E=n!==$[4]?Number($[4]):E,r=n!==$[6]?P($[6]):r,a=$[7],v=n!==$[8]?$[8]:v,i=$[9],c=$[10],M=n!==$[11]?Number($[11]):M,L.enable=n!==$[12]&&P($[12]),x=n!==$[13]?$[13]:x,ve=n!==$[14]?$[14]:ve,w=n!==$[15]?!!$[15]:w,ue("Initialising iFrame ("+window.location.href+")"),(function(){function X(ee,Re){return typeof ee=="function"&&(ue("Setup custom "+Re+"CalcMethod"),q[Re]=ee,ee="custom"),ee}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var ee=window.iFrameResizer;ue("Reading data from page: "+JSON.stringify(ee)),Object.keys(ee).forEach(qa,ee),_e="onMessage"in ee?ee.onMessage:_e,ct="onReady"in ee?ee.onReady:ct,O="targetOrigin"in ee?ee.targetOrigin:O,v="heightCalculationMethod"in ee?ee.heightCalculationMethod:v,ve="widthCalculationMethod"in ee?ee.widthCalculationMethod:ve})(),v=X(v,"height"),ve=X(ve,"width")),ue("TargetOrigin for parent set to: "+O)})(),(function(){n===a&&(a=s+"px"),Vi("margin",(function(X,ee){return ee.indexOf("-")!==-1&&(fn("Negative CSS value ignored for "+X),ee=""),ee})("margin",a))})(),Vi("background",i),Vi("padding",c),($=document.createElement("div")).style.clear="both",$.classList.add("iframe-resizer-inner"),$.style.display="block",$.style.height="0",document.body.appendChild($),za(),W(),document.documentElement.style.height="",document.body.style.height="",ue('HTML & body height set to "auto"'),ue("Enable public methods"),fe.parentIFrame={autoResize:function(X){return X===!0&&r===!1?(r=!0,rt()):X===!1&&r===!0&&(r=!1,Zr("remove"),l!==null&&l.disconnect(),clearInterval(g)),mn(0,0,"autoResize",JSON.stringify(r)),r},close:function(){mn(0,0,"close")},getId:function(){return _},getPageInfo:function(X){typeof X=="function"?(ne=X,mn(0,0,"pageInfo")):(ne=function(){},mn(0,0,"pageInfoStop"))},moveToAnchor:function(X){L.findTarget(X)},reset:function(){On("parentIFrame.reset")},scrollTo:function(X,ee){mn(ee,X,"scrollTo")},scrollToOffset:function(X,ee){mn(ee,X,"scrollToOffset")},sendMessage:function(X,ee){mn(0,0,"message",JSON.stringify(X),ee)},setHeightCalculationMethod:function(X){v=X,za()},setWidthCalculationMethod:function(X){ve=X,W()},setTargetOrigin:function(X){ue("Set targetOrigin: "+X),O=X},size:function(X,ee){vr("size","parentIFrame.size("+((X||"")+(ee?","+ee:""))+")",X,ee)}},w===!0&&(Ce("mouseenter","Mouse Enter"),Ce("mouseleave","Mouse Leave")),rt(),L=(function(){function X(Ut){var me=Ut.getBoundingClientRect(),Ut={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(me.left,10)+parseInt(Ut.x,10),y:parseInt(me.top,10)+parseInt(Ut.y,10)}}function ee(en){var me,Ut=en.split("#")[1]||en,en=decodeURIComponent(Ut),Yk=document.getElementById(en)||document.getElementsByName(en)[0];n!==Yk?(me=X(me=Yk),ue("Moving to in page link (#"+Ut+") at x: "+me.x+" y: "+me.y),mn(me.y,me.x,"scrollToOffset")):(ue("In page link (#"+Ut+") not found in iFrame, so sending to parent"),mn(0,0,"inPageLink","#"+Ut))}function Re(){var Jt=window.location.hash,me=window.location.href;Jt!==""&&Jt!=="#"&&ee(me)}function zt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(Jt){Jt.getAttribute("href")!=="#"&&Zn(Jt,"click",function(me){me.preventDefault(),ee(this.getAttribute("href"))})})}function Ua(){Array.prototype.forEach&&document.querySelectorAll?(ue("Setting up location.hash handlers"),zt(),Zn(window,"hashchange",Re),setTimeout(Re,f)):fn("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return L.enable?Ua():ue("In page linking not enabled"),{findTarget:ee}})(),vr("init","Init message from host page"),ct()}function qa(P){var $=P.split("Callback");$.length===2&&(this[$="on"+$[0].charAt(0).toUpperCase()+$[0].slice(1)]=this[P],delete this[P],fn("Deprecated: '"+P+"' has been renamed '"+$+"'. The old method will be removed in the next major version."))}function Vi(P,$){n!==$&&$!==""&&$!=="null"&&ue("Body "+P+' set to "'+(document.body.style[P]=$)+'"')}function nt(P){var $={add:function(he){function Ce(){vr(P.eventName,P.eventType)}oe[he]=Ce,Zn(window,he,Ce,{passive:!0})},remove:function(he){var Ce,X=oe[he];delete oe[he],Ce=window,he=he,X=X,Ce.removeEventListener(he,X,!1)}};P.eventNames&&Array.prototype.map?(P.eventName=P.eventNames[0],P.eventNames.map($[P.method])):$[P.method](P.eventName),ue(Wa(P.method)+" event listener: "+P.eventType)}function Zr(P){nt({method:P,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),nt({method:P,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),nt({method:P,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),nt({method:P,eventType:"Input",eventName:"input"}),nt({method:P,eventType:"Mouse Up",eventName:"mouseup"}),nt({method:P,eventType:"Mouse Down",eventName:"mousedown"}),nt({method:P,eventType:"Orientation Change",eventName:"orientationchange"}),nt({method:P,eventType:"Print",eventNames:["afterprint","beforeprint"]}),nt({method:P,eventType:"Ready State Change",eventName:"readystatechange"}),nt({method:P,eventType:"Touch Start",eventName:"touchstart"}),nt({method:P,eventType:"Touch End",eventName:"touchend"}),nt({method:P,eventType:"Touch Cancel",eventName:"touchcancel"}),nt({method:P,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),nt({method:P,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),nt({method:P,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),x==="child"&&nt({method:P,eventType:"IFrame Resized",eventName:"resize"})}function rd(P,$,he,Ce){return $!==P&&(P in he||(fn(P+" is not a valid option for "+Ce+"CalculationMethod."),P=$),ue(Ce+' calculation method set to "'+P+'"')),P}function za(){v=rd(v,p,ut,"height")}function W(){ve=rd(ve,Z,Ot,"width")}function rt(){var P;r===!0?(Zr("add"),P=E<0,window.MutationObserver||window.WebKitMutationObserver?P?Ln():l=(function(){function $(me){function Ut(en){en.complete===!1&&(ue("Attach listeners to "+en.src),en.addEventListener("load",X,!1),en.addEventListener("error",ee,!1),zt.push(en))}me.type==="attributes"&&me.attributeName==="src"?Ut(me.target):me.type==="childList"&&Array.prototype.forEach.call(me.target.querySelectorAll("img"),Ut)}function he(me){ue("Remove listeners from "+me.src),me.removeEventListener("load",X,!1),me.removeEventListener("error",ee,!1),me=me,zt.splice(zt.indexOf(me),1)}function Ce(me,Ut,en){he(me.target),vr(Ut,en+": "+me.target.src)}function X(me){Ce(me,"imageLoad","Image loaded")}function ee(me){Ce(me,"imageLoadFailed","Image load failed")}function Re(me){vr("mutationObserver","mutationObserver: "+me[0].target+" "+me[0].type),me.forEach($)}var zt=[],Ua=window.MutationObserver||window.WebKitMutationObserver,Jt=(function(){var me=document.querySelector("body");return Jt=new Ua(Re),ue("Create body MutationObserver"),Jt.observe(me,{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(),zt.forEach(he))}}})():(ue("MutationObserver not supported in this browser!"),Ln())):ue("Auto Resize disabled")}function Ln(){E!==0&&(ue("setInterval: "+E+"ms"),g=setInterval(function(){vr("interval","setInterval: "+E)},Math.abs(E)))}function Nn(P,$){var he=0;return $=$||document.body,he=(he=document.defaultView.getComputedStyle($,null))!==null?he[P]:0,parseInt(he,o)}function Se(P,$){for(var he,Ce=$.length,X=0,ee=Wa(P),Re=Date.now(),zt=0;zt<Ce;zt++)X<(he=$[zt].getBoundingClientRect()[P]+Nn("margin"+ee,$[zt]))&&(X=he);return Re=Date.now()-Re,ue("Parsed "+Ce+" HTML elements"),ue("Element position calculated in "+Re+"ms"),se/2<(Re=Re)&&ue("Event throttle increased to "+(se=2*Re)+"ms"),X}function Rt(P){return[P.bodyOffset(),P.bodyScroll(),P.documentElementOffset(),P.documentElementScroll()]}function Qn(P,$){var he=document.querySelectorAll("["+$+"]");return he.length===0&&(fn("No tagged elements ("+$+") found on page"),document.querySelectorAll("body *")),Se(P,he)}function ht(){return document.querySelectorAll("body *")}function xn(P,$,he,Ce){function X(){P in{init:1,interval:1,size:1}||!(v in T||u&&ve in T)?P in{interval:1}||ue("No change in size detected"):On($)}var ee,Re;function zt(Ua,Jt){return!(Math.abs(Ua-Jt)<=M)}ee=n!==he?he:ut[v](),Re=n!==Ce?Ce:Ot[ve](),zt(m,ee)||u&&zt(te,Re)||P==="init"?(od(),mn(m=ee,te=Re,P)):X()}function qt(){Qt=Date.now(),kn=null,Zt=un.apply(wt,dn),kn||(wt=dn=null)}function vr(P,$,he,Ce){V&&P in d?ue("Trigger event cancelled: "+P):(P in{reset:1,resetPage:1,init:1}||ue("Trigger event: "+$),(P==="init"?xn:_t)(P,$,he,Ce))}function od(){V||(V=!0,ue("Trigger event lock on")),clearTimeout(K),K=setTimeout(function(){V=!1,ue("Trigger event lock off"),ue("--")},f)}function Qr(P){m=ut[v](),te=Ot[ve](),mn(m,te,P)}function On(P){var $=v;v=p,ue("Reset trigger event: "+P),od(),Qr("reset"),v=$}function mn(P,$,he,Ce,X){var ee;N===!0&&(n===X?X=O:ue("Message targetOrigin: "+X),ue("Sending message to host page ("+(ee=_+":"+(P+":"+$)+":"+he+(n!==Ce?":"+Ce:""))+")"),I.postMessage(b+ee,X))}function Kk(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),ane=[{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 lne(){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 cne(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),ao();return}if(e){let n=!1;for(const r of ane)if(r.detect()){r.apply(),n=!0;break}n||lne()}Xk(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||z.send({operation:"application_template_not_em_alert_show"}),ao()}function Xk(){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(F,"CANVAS_CORE_UNITS",{enumerable:!0,get:function(){return ez}}),Object.defineProperty(F,"EDIT_LOCK_ID",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(F,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return Hte}}),Object.defineProperty(F,"EVENT_TYPES",{enumerable:!0,get:function(){return de}}),Object.defineProperty(F,"FOCUS_ID",{enumerable:!0,get:function(){return it}}),Object.defineProperty(F,"HTML_DOCUMENT_ID",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(F,"INIT_PREVIEW_ID",{enumerable:!0,get:function(){return ss}}),Object.defineProperty(F,"INSERT_POLICY_ID",{enumerable:!0,get:function(){return xd}}),Object.defineProperty(F,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return kb}}),Object.defineProperty(F,"Node",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(F,"NodeType",{enumerable:!0,get:function(){return D}}),Object.defineProperty(F,"SELECTION_LOCK_ID",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(F,"SET_CURSOR_ID",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(F,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return Tb}}),Object.defineProperty(F,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(F,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return Ab}}),Object.defineProperty(F,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return gn}}),Object.defineProperty(F,"_defineProperty",{enumerable:!0,get:function(){return A}}),Object.defineProperty(F,"addFontFamilyClass",{enumerable:!0,get:function(){return ga}}),Object.defineProperty(F,"ampUnit",{enumerable:!0,get:function(){return NM}}),Object.defineProperty(F,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Vc}}),Object.defineProperty(F,"applyRootScale",{enumerable:!0,get:function(){return Es}}),Object.defineProperty(F,"buildEmFontClassName",{enumerable:!0,get:function(){return Xc}}),Object.defineProperty(F,"checkBlockAdaptivity",{enumerable:!0,get:function(){return zc}}),Object.defineProperty(F,"clearLinkTags",{enumerable:!0,get:function(){return wo}}),Object.defineProperty(F,"clearProjectFontFaces",{enumerable:!0,get:function(){return Ur}}),Object.defineProperty(F,"commitOf",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(F,"commonStylesApply",{enumerable:!0,get:function(){return TC}}),Object.defineProperty(F,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return Xh}}),Object.defineProperty(F,"createFontClassName",{enumerable:!0,get:function(){return Rh}}),Object.defineProperty(F,"createIdentifier",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(F,"defineSurface",{enumerable:!0,get:function(){return qN}}),Object.defineProperty(F,"defineUnit",{enumerable:!0,get:function(){return yN}}),Object.defineProperty(F,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return rne}}),Object.defineProperty(F,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return ene}}),Object.defineProperty(F,"editLock",{enumerable:!0,get:function(){return Tf}}),Object.defineProperty(F,"elMarkupHelper",{enumerable:!0,get:function(){return cne}}),Object.defineProperty(F,"extensionsUnit",{enumerable:!0,get:function(){return lq}}),Object.defineProperty(F,"findParentTr",{enumerable:!0,get:function(){return _E}}),Object.defineProperty(F,"fitEmailToWidth",{enumerable:!0,get:function(){return PM}}),Object.defineProperty(F,"fitImagesToColumns",{enumerable:!0,get:function(){return xp}}),Object.defineProperty(F,"getOuterHtml",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(F,"getPreheader",{enumerable:!0,get:function(){return Ha}}),Object.defineProperty(F,"getPreheaderElem",{enumerable:!0,get:function(){return Gu}}),Object.defineProperty(F,"getSubject",{enumerable:!0,get:function(){return mg}}),Object.defineProperty(F,"getUsedColors",{enumerable:!0,get:function(){return PC}}),Object.defineProperty(F,"globalBlockReplace",{enumerable:!0,get:function(){return Tee}}),Object.defineProperty(F,"iframeSetSize",{enumerable:!0,get:function(){return IM}}),Object.defineProperty(F,"implementPolyfills",{enumerable:!0,get:function(){return Ng}}),Object.defineProperty(F,"insertAdjacentHTML",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(F,"insertCountdown",{enumerable:!0,get:function(){return W_}}),Object.defineProperty(F,"insertNewHTML",{enumerable:!0,get:function(){return Bv}}),Object.defineProperty(F,"isEmptyTable",{enumerable:!0,get:function(){return cn}}),Object.defineProperty(F,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return Xk}}),Object.defineProperty(F,"markProjectFontClass",{enumerable:!0,get:function(){return Ph}}),Object.defineProperty(F,"messageService",{enumerable:!0,get:function(){return z}}),Object.defineProperty(F,"minifyStylesheet",{enumerable:!0,get:function(){return go}}),Object.defineProperty(F,"paintGateUnit",{enumerable:!0,get:function(){return tne}}),Object.defineProperty(F,"parseFromString",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(F,"registerPreheaderService",{enumerable:!0,get:function(){return Yee}}),Object.defineProperty(F,"registerSubjectService",{enumerable:!0,get:function(){return Zee}}),Object.defineProperty(F,"removeClassesByPrefix",{enumerable:!0,get:function(){return da}}),Object.defineProperty(F,"removeHiddenClasses",{enumerable:!0,get:function(){return Tc}}),Object.defineProperty(F,"requireService",{enumerable:!0,get:function(){return R}}),Object.defineProperty(F,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return sne}}),Object.defineProperty(F,"rgbToHex",{enumerable:!0,get:function(){return G}}),Object.defineProperty(F,"rowsHost",{enumerable:!0,get:function(){return gr}}),Object.defineProperty(F,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return Jc}}),Object.defineProperty(F,"setBlockMaxWidth",{enumerable:!0,get:function(){return Op}}),Object.defineProperty(F,"setDocumentStyles",{enumerable:!0,get:function(){return xh}}),Object.defineProperty(F,"setElementBorder",{enumerable:!0,get:function(){return Dh}}),Object.defineProperty(F,"setElementBorderRadius",{enumerable:!0,get:function(){return Ai}}),Object.defineProperty(F,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return rC}}),Object.defineProperty(F,"setFloatBlocksWidth",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(F,"setImageWidth",{enumerable:!0,get:function(){return Sh}}),Object.defineProperty(F,"setStructureBlocksWidth",{enumerable:!0,get:function(){return _u}}),Object.defineProperty(F,"startSandbox",{enumerable:!0,get:function(){return zN}}),Object.defineProperty(F,"state",{enumerable:!0,get:function(){return j}}),Object.defineProperty(F,"uptimeCountdown",{enumerable:!0,get:function(){return wh}}),Object.defineProperty(F,"wheelBridgeUnit",{enumerable:!0,get:function(){return nne}}),Object.defineProperty(F,"withForeignListenersPaused",{enumerable:!0,get:function(){return It}})});
|