useblocks 1.3.11-dev.3 → 1.3.16

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.
Files changed (110) hide show
  1. package/CHANGELOG.md +50 -1
  2. package/README.md +1 -1
  3. package/compat-globals.js +1 -1
  4. package/iframe/.vite/manifest.json +4 -4
  5. package/iframe/css/sandbox-dark.css +1 -1
  6. package/iframe/css/sandbox-light.css +1 -1
  7. package/iframe/css/sandbox.css +47 -17
  8. package/iframe/{iframe-eblock.5751e42b.html → iframe-eblock.7594857d.html} +2 -2
  9. package/iframe/{iframe.5751e42b.html → iframe.7594857d.html} +2 -2
  10. package/iframe/js/elMarkupHelper.CsLyPjC1.js +278 -0
  11. package/iframe/js/{iframe-eblock.body.5751e42b.js → iframe-eblock.body.7594857d.js} +1 -1
  12. package/iframe/js/iframe-eblock.js +2 -2
  13. package/iframe/js/iframe.body.7594857d.js +129 -0
  14. package/iframe/js/iframe.js +2 -2
  15. package/package.json +1 -1
  16. package/runtime/react/index.js +1 -1
  17. package/static/core/{5da33486.js → 16612c9f.js} +1 -1
  18. package/static/core/{516f59e7.js → 1e160f23.js} +1 -1
  19. package/static/core/{b5da36e5.js → 23e22cd2.js} +1 -1
  20. package/static/core/25562e5d.js +1 -0
  21. package/static/core/2633e871.js +1 -0
  22. package/static/core/{ef035f6b.js → 2740933f.js} +3 -3
  23. package/static/core/{f1b8515a.js → 2a8b14c0.js} +1 -1
  24. package/static/core/{66113a18.js → 2ae78ac6.js} +1 -1
  25. package/static/core/{3b65bc50.js → 31e587ab.js} +1 -1
  26. package/static/core/3454ca99.js +1 -0
  27. package/static/core/36071466.js +2 -0
  28. package/static/core/{e037a420.js → 3cd95e0a.js} +1 -1
  29. package/static/core/{94f9492b.js → 3e1acefc.js} +1 -1
  30. package/static/core/3e80379e.js +4 -0
  31. package/static/core/{b55ae539.js → 3f3feb86.js} +1 -1
  32. package/static/core/{3d8e2478.js → 4adb5ee9.js} +7 -7
  33. package/static/core/4e07805d.js +19 -0
  34. package/static/core/{c13b3d4f.js → 4f8847e6.js} +1 -1
  35. package/static/core/519dfcc7.js +4 -0
  36. package/static/core/{a6303cb2.js → 53c22855.js} +1 -1
  37. package/static/core/{6172f09a.js → 552f7d30.js} +2 -2
  38. package/static/core/{e698ec22.js → 5de3cd2c.js} +1 -1
  39. package/static/core/{76543cb2.js → 66853555.js} +1 -1
  40. package/static/core/{b1edf5c5.js → 69688fad.js} +6 -6
  41. package/static/core/713de1e1.js +1 -0
  42. package/static/core/{d343e46e.js → 7ae6cf52.js} +7 -7
  43. package/static/core/{bda2d9d5.js → 80907514.js} +1 -1
  44. package/static/core/{513e36bd.js → 86f73ee9.js} +1 -1
  45. package/static/core/{aee84e3d.js → 8b9a4f49.js} +1 -1
  46. package/static/core/9348ac64.js +1 -0
  47. package/static/core/9da6c313.js +1 -0
  48. package/static/core/{62855b97.js → a004861a.js} +1 -1
  49. package/static/core/aeec5659.js +1 -0
  50. package/static/core/b492a9b0.js +93 -0
  51. package/static/core/{11009bdf.js → b6418818.js} +1 -1
  52. package/static/core/{467344d4.js → beebdf4d.js} +1 -1
  53. package/static/core/c03fc17e.js +7 -0
  54. package/static/core/c3344bbc.js +1 -0
  55. package/static/core/{8406bab5.js → c3544cf4.js} +1 -1
  56. package/static/core/{e7e888c1.js → cc4458d8.js} +1 -1
  57. package/static/core/{58dca22f.js → d551e71d.js} +1 -1
  58. package/static/core/{f8585ce6.js → d5be6857.js} +1 -1
  59. package/static/core/{347b0a0b.js → d6c7eb44.js} +1 -1
  60. package/static/core/d9ff5568.js +1 -0
  61. package/static/core/{257745eb.js → e2710fd3.js} +1 -1
  62. package/static/core/{71727873.js → e7c7173a.js} +3 -3
  63. package/static/core/{1c06cdb7.js → e81b521f.js} +3 -3
  64. package/static/core/{d2cf6b4b.js → e94e24b5.js} +1 -1
  65. package/static/core/{1c7a6d45.js → e98b0c61.js} +2 -2
  66. package/static/core/{7e329493.js → ec079650.js} +1 -1
  67. package/static/core/ecc4d431.js +1 -0
  68. package/static/core/f0f20c47.js +1 -0
  69. package/static/core/{d9d5b376.js → f5d42c73.js} +1 -1
  70. package/static/core/{ff7d14e8.js → f674f125.js} +1 -1
  71. package/static/core/{3eeb4445.js → f97efb0a.js} +1 -1
  72. package/static/core/{261a3a42.js → ff0af9ff.js} +1 -1
  73. package/static/esm/1d0ba521.js +1 -0
  74. package/static/esm/delivery-libs.js +1 -1
  75. package/static/umd-runtime/{Cvm7BS4_.js → CyULsN57.js} +31 -31
  76. package/static/umd-runtime/DdK5piwW.js +1 -0
  77. package/static/umd-runtime/delivery-libs.BJHA1QD4.js +1 -0
  78. package/static/umd-runtime/runtime.8gUPr0nE.js +1 -0
  79. package/static/umd-runtime/{ui-kit.CoVNet0I.js → ui-kit.BZ4Y4jr2.js} +2 -2
  80. package/useblocks-core.7594857d.js +875 -0
  81. package/useblocks-esm.js +12 -12
  82. package/{useblocks-po.5751e42b.js → useblocks-po.7594857d.js} +1 -1
  83. package/useblocks.d.ts +1 -1
  84. package/useblocks.js +13 -13
  85. package/vendor/useblocks-ui-kit/es/components/Custom/FormBackgroundSettings/index.js +3 -3
  86. package/vendor/useblocks-ui-kit/es/components/Custom/FormBorderRadiusInputs/index.js +6 -6
  87. package/vendor/useblocks-ui-kit/es/components/Custom/FormBoxShadowInputs/index.js +5 -5
  88. package/vendor/useblocks-ui-kit/es/components/Custom/FormPanel/FormPaddingInputs/index.js +69 -64
  89. package/vendor/useblocks-ui-kit/es/components/Custom/FormPanel/FormSizeInputs/index.js +5 -5
  90. package/vendor/useblocks-ui-kit/es/components/Custom/FormPanel/FormTypographyFields/index.js +5 -5
  91. package/vendor/useblocks-ui-kit/es/components/Custom/Inputs/DraggableInputNumber/index.js +41 -35
  92. package/vendor/useblocks-ui-kit/es/components/Layout/Splitter/index.js +5 -0
  93. package/vendor/useblocks-ui-kit/index.js +12 -11
  94. package/vendor/useblocks-ui-kit/package.json +1 -1
  95. package/iframe/js/elMarkupHelper.BpDXO-hq.js +0 -279
  96. package/iframe/js/iframe.body.5751e42b.js +0 -129
  97. package/static/core/11dadbc0.js +0 -1
  98. package/static/core/1c3a16fc.js +0 -1
  99. package/static/core/2bed6a18.js +0 -7
  100. package/static/core/8845436d.js +0 -4
  101. package/static/core/b59c63d2.js +0 -1
  102. package/static/core/b9f553d7.js +0 -93
  103. package/static/core/c0a3f7d0.js +0 -4
  104. package/static/core/dd008ec2.js +0 -2
  105. package/static/core/ed65b5c3.js +0 -19
  106. package/static/esm/c5372168.js +0 -1
  107. package/static/umd-runtime/B7h7P1Np.js +0 -1
  108. package/static/umd-runtime/delivery-libs.BymXnePv.js +0 -1
  109. package/static/umd-runtime/runtime.Lgfb59e0.js +0 -1
  110. package/useblocks-core.5751e42b.js +0 -875
@@ -0,0 +1,278 @@
1
+ __useblocks__.define("js/elMarkupHelper.CsLyPjC1.js",["require","exports","module"],function(Dd,F,sse){var fb=Object.defineProperty,Ar=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),re=(e,t)=>{let n={};for(var r in e)fb(n,r,{get:e[r],enumerable:!0});return t||fb(n,Symbol.toStringTag,{value:"Module"}),n};function cs(e){"@babel/helpers - typeof";return cs=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},cs(e)}function JN(e,t){if(cs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function e2(e){var t=JN(e,"string");return cs(t)=="symbol"?t:t+""}function A(e,t,n){return(t=e2(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var mb;mb=Symbol.toStringTag;var Bd=class{constructor(){A(this,"_valuesMap",new Map),A(this,mb,"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 hb(){const e=new Bd;return new Proxy(e,{set:function(t,n,r){return typeof n=="string"&&Bd.prototype.hasOwnProperty(n)?e[n]=r:typeof n=="string"&&e.setItem(n,String(r)),!0},get:function(t,n){if(typeof n=="string"){if(Bd.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 pb(){const e=hb(),t=hb();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)})}pb();var gb=Symbol.for("emailmaker.commandInputPause");function bb(){const e=window,t=e[gb];if(t)return t;const n=new Set;return e[gb]=n,window.addEventListener("input",r=>n.forEach(o=>o(r)),!0),n}function t2(){bb()}function n2(e){const t=bb();return t.add(e),()=>{t.delete(e)}}t2();var yb=class{constructor(e){A(this,"_voidElements",void 0),this._voidElements=new Set(e)}isVoidElement(e){return this._voidElements.has(e.toLowerCase())}},He=(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})({}),r2=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===l2||e===c2||e===i2||e===a2||e===s2)>0}advanceWhileChar(e){const t=this.position;for(;this.position<this.len&&e(this.source.charCodeAt(this.position));)this.position++;return this.position-t}},Hd=33,$o=45,us=60,bn=62,cl=47,o2=61,vb=34,Eb=39,i2=10,s2=13,a2=12,l2=32,c2=9,Sb=63,u2=65,d2=90,f2=97,m2=122;function wb(e){return e>=f2&&e<=m2||e>=u2&&e<=d2}function _b(e){return wb(e)||e===cl||e===Hd||e===Sb}var ul="(?=[\\s/>])",h2=new RegExp(`<!--|-->|<\\/?script${ul}\\s*\\/?>?`,"i"),p2=new RegExp(`<\\/style${ul}`,"i"),g2={"text/x-handlebars-template":!0,"text/html":!0};function Cb(e,t=0,n=0,r=!1){const o=new r2(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 E=o.pos();for(;!o.eos();){const _=o.nextChar();if(_===bn)return!0;if(_===us)break;if(_===vb||_===Eb){if(!o.advanceUntilChar(_))break;o.advance(1)}}return o.goBackTo(E),!1}function b(){for(;o.advanceUntilChar(us)&&!_b(o.peekChar(1));)o.advance(1)}function C(E){return o.advanceUntilChar(bn)&&o.advance(1),k(E,22)}function L(){return o.advanceIfRegExp(/^[^\s"'></=\x00-\x0F\x7F\x80-\x9F]*/).toLowerCase()}function k(E,_,S){return a=_,s=E,l=S,_}function y(){const E=o.pos(),_=i,S=g();return S!==21&&E===o.pos()&&!(r&&(S===4||S===8))?(o.advance(1),k(E,18)):S}function g(){const E=o.pos();if(o.eos())return k(E,21);let _;switch(i){case 6:return o.advanceIfChars([$o,$o,bn])?(i=0,k(E,2)):(o.advanceUntilChars([$o,$o,bn]),k(E,1));case 3:return o.advanceIfChar(bn)?(i=0,k(E,15)):(o.advanceUntilChar(bn),k(E,14));case 0:return o.peekChar()===us&&_b(o.peekChar(1))?(o.advance(1),o.peekChar()===Hd?o.advanceIfChars([Hd,$o,$o])?(i=6,k(E,0)):o.advanceIfRegExp(/^!doctype/i)?(i=3,k(E,13)):C(E):o.peekChar()===Sb?C(E):o.advanceIfChar(cl)?wb(o.peekChar())?(i=2,k(E,7)):C(E):(i=1,k(E,3))):(b(),k(E,16));case 2:return m().length>0?(i=5,u=!1,k(E,9)):o.skipWhitespace()?k(E,17,"Tag name must directly follow the open bracket."):(i=5,o.advanceUntilChar(bn),E<o.pos()?k(E,18,"End tag name expected."):g());case 5:if(o.skipWhitespace())return u=!0,k(E,17);if(o.advanceIfChar(bn))return i=0,k(E,8);if(r&&o.peekChar()===us)return i=0,k(E,8,"Closing bracket missing.");if((u||o.peekChar()===cl)&&p())return i=0,k(E,8);_="Closing bracket expected.";break;case 1:return d=m(),h=void 0,f=void 0,d.length>0?(c=!1,i=4,k(E,6)):o.skipWhitespace()?k(E,17,"Tag name must directly follow the open bracket."):(i=4,o.advanceUntilChar(bn),E<o.pos()?k(E,18,"Start tag name expected."):g());case 4:return o.skipWhitespace()?(c=!0,k(E,17)):c&&(f=L(),f.length>0)?(i=9,c=!1,k(E,11)):o.advanceIfChars([cl,bn])?(i=0,k(E,5)):o.advanceIfChar(bn)?(d==="script"?h&&g2[h]?i=0:i=7:d==="style"?i=8:i=0,k(E,4)):r&&o.peekChar()===us?(i=0,k(E,4,"Closing bracket missing.")):(o.advance(1),k(E,18,"Unexpected character in tag."));case 9:return o.skipWhitespace()?(c=!0,k(E,17)):o.advanceIfChar(o2)?(i=10,k(E,10)):(i=4,g());case 10:if(o.skipWhitespace())return k(E,17);const S=o.advanceIfRegExp(/^[^\s"'`=<>]+/);if(S.length>0)return f==="type"&&(h=S),i=4,c=!1,k(E,12);const v=o.peekChar();return v===Eb||v===vb?(o.advance(1),o.advanceUntilChar(v)&&o.advance(1),f==="type"&&(h=o.getSource().substring(E+1,o.pos()-1)),i=4,c=!1,k(E,12)):(i=4,c=!1,g());case 7:let T=1;for(;!o.eos();){const w=o.advanceIfRegExp(h2);if(w.length===0)return o.goToEnd(),k(E,19);if(w==="<!--")T===1&&(T=2);else if(w==="-->")T=1;else if(w[1]!=="/")T===2&&(T=3);else if(T===3)T=2;else{o.goBack(w.length);break}}return i=0,E<o.pos()?k(E,19):g();case 8:return o.advanceUntilRegExp(p2),i=0,E<o.pos()?k(E,20):g()}return o.advance(1),i=0,k(E,18,_)}return{scan:y,getTokenType:()=>a,getTokenOffset:()=>s,getTokenLength:()=>o.pos()-s,getTokenEnd:()=>o.pos(),getTokenText:()=>o.getSource().substring(s,o.pos()),getScannerState:()=>i,getTokenError:()=>l}}function b2(e,t){return t||e.start!==e.end?`<!DOCTYPE${e.content}>`:""}function y2(e,t){const n=`<!DOCTYPE${e.content}>`;return e.start=t,e.endTagStart=e.startTagEnd=e.end=t+n.length,n}function v2(e,t){return t||e.start!==e.end?`<!--${e.content}-->`:""}function E2(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 ds=new Set(["area","br","col","embed","hr","img","input","link","meta","param","vk-snippet-end"]);function S2(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}var Tb=Object.create(null);function Ab(e,t){const n=Tb[e]||(Tb[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[S2(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function Fd(e,t){if(e.start===e.end||t)return"";switch(e.type){case B.ELEMENT:return Wd(e,t);case B.ROOT:return[...e.children].map(n=>Fd(n,t)).join("");case B.DOCTYPE:return b2(e,t);case B.COMMENT:return v2(e,t);default:return e.content||""}}function $d(){return{exact:new WeakMap,collapsed:new WeakMap}}function Jn(e,t=!1,n){if(e.start===e.end&&e.type!==B.ROOT)return"";const r=n&&(t?n.collapsed:n.exact),o=r?.get(e);if(o!==void 0)return o;const i=()=>e.children.map(a=>Jn(a,t,n)).join("");let s;switch(e.type){case B.ELEMENT:{const a=e.tag?.toLowerCase();s=`<${a}${e.attributeNames.map(l=>` ${l}=${JSON.stringify(e.attributes?.[l]??null)}`).join("")}>${i()}</${a}>`;break}case B.ROOT:s=i();break;case B.COMMENT:s=`<!--${e.content??""}-->`;break;case B.DOCTYPE:s=`<!${e.content??""}>`;break;default:{const a=e.content??"";s=t?a.replace(/\s+/g," ").trim():a}}return r?.set(e,s),s}function dl(e,t=0){if(e.start===e.end)return"";switch(e.type){case B.ELEMENT:return _2(e,t);case B.ROOT:return Lb(e,t);case B.DOCTYPE:return y2(e,t);case B.COMMENT:return E2(e,t);default:return e.start=e.startTagEnd=t,e.end=e.endTagStart=t+(e.content?.length||0),e.content||""}}function kb(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"&&!Ab(t,i)?` ${i}`:` ${i}="${s.replaceAll('"',"'")}"`)}}}return n}function w2(e,t){let n="";if(e.startTagEnd!==e.endTagStart||t)for(const r of e.children)n+=Fd(r);return n}function Lb(e,t){let n="";if(e.startTagEnd!==e.endTagStart)for(const r of e.children)n+=dl(r,t+n.length);return n}function Nb(e,t){if(e.start!==e.startTagEnd||t){const n=e.tag?.toLowerCase()||"div",r=kb(e);return n==="vk-snippet-end"?`<${n}${r}/>`:`<${n}${r}>`}return""}function xb(e,t){return t||e.endTagStart!==e.end?`</${e.tag?.toLowerCase()||"div"}>`:""}function Wd(e,t,n=!0){const r=e.tag?.toLowerCase()||"div",o=Nb(e,t);if(ds.has(r))return o;{const i=xb(e,t);return`${o}${n?w2(e,t):""}${i}`}}function _2(e,t){const n=e.tag?.toLowerCase()||"div",r=Nb(e);if(e.start=t,e.startTagEnd=t+r.length,ds.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=Lb(e,e.startTagEnd);e.endTagStart=e.startTagEnd+o.length;const i=xb(e);return e.end=e.endTagStart+i.length,`${r}${o}${i}`}}function qd(e,t){let n=0,r=e.length;if(r===0)return 0;for(;n<r;){const o=Math.floor((n+r)/2);t(e[o])?r=o:n=o+1}return n}var B=(function(e){return e[e.HTML=0]="HTML",e[e.ELEMENT=1]="ELEMENT",e[e.ROOT=2]="ROOT",e[e.COMMENT=3]="COMMENT",e[e.DOCTYPE=4]="DOCTYPE",e[e.ADVANCED=5]="ADVANCED",e})({}),fl=e=>e.type===0?e.start-1:e.start,C2=e=>e.type===0?e.end+1:e.end,Lt=class XN{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=qd(this.children,r=>t<=fl(r))-1;if(n>=0){const r=this.children[n];if(t>fl(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=qd(this.children,r=>t<=fl(r))-1;if(n>=0){const r=this.children[n];if(t>=fl(r)&&t<=C2(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 XN(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 T2(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 Ob=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 Lt(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}}},Rb=class{constructor(e){A(this,"dataManager",void 0),this.dataManager=e}parse(e,t=[]){const n=Cb(e,void 0,void 0,!0),r=new Lt(0,e.length,[],void 0);r.type=B.ROOT;let o=r,i=-1,s,a=null,l=n.scan();const c=()=>{if(!o.tag){const p=o.parent.children,b=p[p.length-2],C=e.substring(o.start,o.end);b?.type===B.HTML?(b.content=(b.content||"")+C,b.end=o.end,p.splice(p.length-1,1)):(o.type=B.HTML,o.content=C,o.children=[]),o.type=B.HTML}o=o.parent},u=new Ob(e,B.COMMENT),d=new Ob(e,B.DOCTYPE),f=p=>{o.children.push(p)},h=(p,b)=>{const C=new Lt(p,b,[],o);C.type=B.HTML,C.content=e.substring(p,b),f(C)};for(;l!==He.EOS;){switch(l){case He.StartDoctypeTag:d.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case He.EndDoctypeTag:{const k=o.lastChild,y=d.node;if(!y)throw new Error("");const g=k?k.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==y.start){const E=e.substring(g,y.start);if(E){const _=new Lt(g,y.start,[],o);_.type=B.HTML,_.content=E,f(_)}}d.finish(n.getTokenOffset(),n.getTokenLength());break}case He.StartCommentTag:u.start(n.getTokenOffset(),n.getTokenEnd(),o);break;case He.EndCommentTag:{const k=o.lastChild,y=u.node;if(!y)throw new Error("");const g=k?k.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(g!==y.start){const E=e.substring(g,y.start);if(E){const _=new Lt(g,y.start,[],o);_.type=B.HTML,_.content=E,f(_)}}u.finish(n.getTokenOffset(),n.getTokenLength());break}case He.StartTagOpen:const p=o.lastChild,b=new Lt(n.getTokenOffset(),e.length,[],o),C=p?p.end:o.startTagEnd!==void 0?o.startTagEnd:o.start;if(C!==b.start){const k=e.substring(C,b.start);if(k){const y=new Lt(C,b.start,[],o);y.type=B.HTML,y.content=k,f(y)}}f(b),o=b;break;case He.BogusComment:{const k=o.lastChild?.end??o.startTagEnd??o.start;k<n.getTokenOffset()&&h(k,n.getTokenOffset()),h(n.getTokenOffset(),n.getTokenEnd());break}case He.StartTag:o.tag=n.getTokenText();break;case He.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 He.StartTagSelfClose:o.parent&&(o.closed=!0,o.end=n.getTokenEnd(),o.startTagEnd=n.getTokenEnd(),c());break;case He.EndTagOpen:i=n.getTokenOffset(),s=void 0;break;case He.EndTag:s=n.getTokenText().toLowerCase();break;case He.EndTagClose:let L=o;for(;!L.isSameTag(s)&&L.parent;)L=L.parent;if(L.parent){const k=o.lastChild,y=k?k.end:o.startTagEnd===void 0?o.start:o.startTagEnd;if(y!==i){const g=e.substring(y,i);if(g){const E=new Lt(y,i,[],o);E.type=B.HTML,E.content=g,f(E)}}for(;o!==L;)o.end=i,o.closed=!1,c();o.closed=!0,o.endTagStart=i,o.end=n.getTokenEnd(),c()}break;case He.AttributeName:{a=n.getTokenText();let k=o.attributes;k||(o.attributes=k={}),k[a]=null;break}case He.AttributeValue:{const k=n.getTokenText(),y=o.attributes;y&&a&&(y[a]=T2(k),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 b=new Lt(m,e.length,[],r);b.type=B.HTML,b.content=p,f(b)}}return{roots:r.children,findNodeBefore:r.findNodeBefore.bind(r),findNodeAt:r.findNodeAt.bind(r)}}},ase=new Rb(new yb(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"])),A2=new yb(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr","vk-snippet-end"]),k2=new Rb(A2);function rn(e){return k2.parse(e)}var zd=Symbol("bogusCommentSource");function kr(e,t=document){if(e){const n=t.createElement("div");n.insertAdjacentHTML("afterbegin",e);const r=n.firstChild??t.createTextNode("");return r.nodeType===Node.COMMENT_NODE&&L2(r,e),r}else return t.createTextNode("")}function L2(e,t){const n={source:t,data:e.data};Object.defineProperty(e,zd,{value:n,configurable:!0})}function fs(e){const t=e[zd];return t&&t.data===e.data?t:void 0}function ml(e){return fs(e)?.source}function Mb(e,t){if(e.nodeType===Node.COMMENT_NODE){t.push(e);return}(e.nodeName==="TEMPLATE"?e.content:e).childNodes.forEach(n=>Mb(n,t))}function hl(...e){const t=[];return e.forEach(n=>Mb(n,t)),t}function N2(e,t){return e.data===t.data&&(e.parent===void 0||t.parent===void 0||e.parent===t.parent)}function Pb(e,t){fs(e)||Object.defineProperty(e,zd,{value:t,configurable:!0})}function x2(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 O2(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)=>N2(e[o+s],i))&&r.push(o);if(!r.length){const o=x2(e);t.forEach(i=>{const s=o.get(i.data);s&&Pb(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)&&Pb(o,a)})}function Ib(e,t){const n=e.parentNode,r=n&&n.nodeType===Node.ELEMENT_NODE&&!t.includes(n);return{data:e.data,mark:fs(e),parent:r?n.nodeName.toLowerCase():void 0}}function Db(e,t,n){const r=hl(...t),o=n?[...t,n]:t;O2(e,r,r.map(i=>Ib(i,o)))}function on(e,t){Db(hl(e).map(n=>Ib(n,[e])),[t],null)}var R2=/<[!?]|<\/[^a-zA-Z]/,M2=/^<[!?/]/;function P2(e){const t=[],n=r=>{const o=r.parent?.tag?.toLowerCase();if(r.type===B.COMMENT)t.push({data:r.content??"",mark:void 0,parent:o});else if(r.type===B.HTML&&r.content&&M2.test(r.content)){const i=kr(r.content);i.nodeType===Node.COMMENT_NODE&&t.push({data:i.data,mark:fs(i),parent:o})}r.children.forEach(n)};try{rn(e).roots.forEach(n)}catch{return[]}return t}function Bb(e,t,n=null){R2.test(t)&&Db(P2(t),e,n)}function Ud(e,t){Bb([e],t)}var ms="",I2=4,Hb=0;function D2(){return Hb+=1,`${Math.random().toString(36).slice(2)}${Hb.toString(36)}`}function B2(e,t,n){if(e.split(`${ms}${t}:`).length-1!==n.length)return;const r=e.split(new RegExp(`<!--${ms}${t}:(\\d+)${ms}-->`)),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 pl(e,t,n){const r=hl(e),o=r.map(l=>fs(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:hl(i),a=r.map(l=>l.data);for(let l=0;l<I2;l++){const c=D2(),u=[];s.forEach((f,h)=>{const m=o[h];m!==void 0&&(f.data=`${ms}${c}:${u.length}${ms}`,u.push(m))});const d=B2(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 Lr(e){return pl(e,!0,!1)}function Ze(e){return pl(e,!1,!1)}function Fb(e){return pl(e,!0,!0)}function H2(e){return pl(e,!1,!0)}function ke(e,t){e.innerHTML=t,Ud(e,t)}function Gt(e,t){ke(e,Ze(t))}function jd(e){hs(e,Ze(e))}function hs(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);Bb(i,t,n)}var $b=new Set(["text/x-handlebars-template","text/html"]);function gl(e,t){if(e.type!==B.HTML||!t)return!1;const n=t.tag?.toLowerCase(),r=t.attributes?.type;return n==="style"||n==="script"&&!$b.has(typeof r=="string"?r:"")}var F2={amp:"&",lt:"<",gt:">",nbsp:String.fromCodePoint(160),quot:'"'};function Vd(e){return e.replaceAll(/&(amp|lt|gt|nbsp|quot);/g,(t,n)=>F2[n])}var Wb=Symbol("rawTextSource");function Gd(e,t=document){const n=t.createTextNode(Vd(e));return qb(n,e),n}function qb(e,t){Object.defineProperty(e,Wb,{value:t,configurable:!0})}function $2(e,t){e.data=Vd(t),qb(e,t)}function zb(e){const t=e[Wb];return t!==void 0&&Vd(t)===e.textContent?t:void 0}var Wo,so;function Ub(e){const t=Wo;return Wo=e,()=>{Wo===e&&(Wo=t)}}function W2(e){const t=so;return so=e,()=>{so===e&&(so=t)}}function jb(e,t,n){return Wo?Wo(e,t,n):n}function q2(){return so!==void 0}function Vb(e,t,n){return so?so(e,t,n):n}var Xd;function z2(){return Xd||(Xd=document.implementation.createHTMLDocument("")),Xd}function U2(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 j2=new Set(["onclick","onload","onchange","onsubmit","onmouseover","onkeydown","onerror"]),V2=new Set(["script","style","xmp"]);function G2(e,t){return!(t&&V2.has(t.toLowerCase())||j2.has(e.toLowerCase()))}var X2=e=>{let t=e.indexOf("&");for(;t!==-1;){if(e.indexOf(";",t)!==-1)return!0;t=e.indexOf("&",t+1)}return!1},K2=new Set(["head","body"]);function Gb(e,t,n){let r=e.tagName.toLowerCase();r==="html"&&(r="div");const o=`<${r} ${t}="${n}"/>`,i=z2(),s=K2.has(r)?U2(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{G2(t,e.tagName)&&!X2(n)?e.setAttribute(t,n):Gb(e,t,n)}catch{Gb(e,t,n)}}function Xb(e=document){return kr("<script><\/script>",e)}var Y2="text/x-em-dormant",ps=Symbol("dormantScriptType");function Kd(e){e[ps]=e.getAttribute("type"),e.setAttribute("type",Y2)}function bl(e){return ps in e}function Z2(e){const t=[...e].filter(n=>!bl(n));return t.forEach(Kd),t}function Q2(e,t){return bl(e)?(e[ps]=t,!0):!1}function Kb(e){const t=new Set;for(const n of e){const r="querySelectorAll"in n?n.querySelectorAll("script"):[];for(const o of[n,...r])bl(o)&&t.add(o)}return[...t]}function Yb(e){if(!bl(e))return;const t=e[ps];delete e[ps],typeof t=="string"?e.setAttribute("type",t):e.removeAttribute("type")}var J2=["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 ex(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 Zb(e){const t=ex(e);return J2.includes(t)?"classic":t==="module"||t==="importmap"||t==="speculationrules"?t:void 0}function tx(e){return Zb(e)==="classic"}function nx(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 rx(e){const t=Zb(e);return!t||t==="speculationrules"||yl(e)?!1:t!=="classic"||!e.hasAttribute("nomodule")&&nx(e)}function ox(e){return e.hasAttribute("src")&&!["async","defer","nomodule"].some(t=>e.hasAttribute(t))&&tx(e)}function yl(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 Qb(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 Jb(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 ey(e,t,n){e.replaceWith(t),t.append(...e.childNodes),n.substitute?.(e,t)}function ty(e,t){const n=Xb();return Jb(e,n),t.quiet(()=>ey(e,n,t)),n}function ix(e,t,n){const r=ty(t,n),o=()=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r.isConnected&&(n.quiet(()=>{Jb(r,t),Kd(t),ey(r,t,n),Yb(t)}),Qb(t,n))};e.addEventListener("load",o),e.addEventListener("error",o)}function ny(e,t){e.forEach(Yb);const n=e.filter(yl),r=e.filter(i=>i.isConnected&&!yl(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=>ty(i,t));let o;for(const i of r)o&&!i.hasAttribute("src")?ix(o,i,t):(Qb(i,t),o=ox(i)?i:o)}function ao(e,t=!0,n=!1,r=document){const o=e.content;switch(e.type){case B.ROOT:{const i=r.implementation.createHTMLDocument();for(const s of[...i.childNodes])i.removeChild(s);if(t)for(const s of e.children)i.appendChild(ao(s,!0,n,r));return i}case B.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case B.COMMENT:return r.createComment(o||"");case B.ELEMENT:if(e.tag){const i=e.tag.toLowerCase()==="script",s=n===!0&&i?Xb(r):r.createElement(e.tag);if(Object.defineProperty(s,"$$tagName",{enumerable:!1,configurable:!1,value:e.tag}),e.attributes)for(const a of e.attributeNames){const l=e.attributes[a];try{const c=jb(s,a,typeof l=="string"?l:"");c!==null&&er(s,a,c)}catch{}}if(n==="dormant"&&i&&Kd(s),t){const a=e.tag.toLowerCase()==="template"?!0:n;for(const l of e.children)s.appendChild(gl(l,e)?Gd(l.content||"",r):ao(l,!0,a,r))}return s}return r.createTextNode("<");case B.HTML:return kr(o||"",r);default:throw new Error("unsupported node")}}function Le(e,t=!1,n=document){return rn(e).roots.map(r=>ao(r,!0,t,n))}function vl(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 ry(e,t){e.replaceChildren(...Le(t,!0))}function tr(e,t,n){vl(e,t,Le(n,!0))}var oy=Symbol.for("emailmaker.documentWriteGuard"),gs=Symbol.for("emailmaker.documentWriteSink");function sx(e,t=document){const n=t,r=n[gs];return n[gs]=e,()=>{n[gs]===e&&(n[gs]=r)}}function lse(e){}function Yd(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,writable:!0})}function ax(e,t,n){for(let r=e.writerOf.get(t);r;r=e.writerOf.get(r))if(r===n)return!0;return!1}function lx(e,t){let n=t;for(;n.nextSibling&&ax(e,n.nextSibling,t);)n=n.nextSibling;return n}function iy(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,lx(e,t).nextSibling)}},o=e.doc[gs];o?o(n,r,t):r()}function sy(e,t){return!!e&&e.type===B.ELEMENT&&!e.closed&&e.end===t}function cx(e,t){let n="";for(let r=e;sy(r,t);r=r.lastChild)n=`</${r.tag}>${n}`;return n}function ux(e){const t=rn(e).roots,n=t[t.length-1],r=sy(n,e.length);return{nodes:(r?t.slice(0,-1):t).map(o=>ao(o)),rest:r?e.slice(n.start):""}}function dx(e){const t=[...e.pending];e.pending.clear();for(const[n,r]of t){const o=rn(r).roots,i=r+cx(o[o.length-1],r.length);iy(e,n,rn(i).roots.map(s=>ao(s)))}}function ay(e,t,n){const r=e.doc.currentScript;if(!r?.parentNode){return}const{nodes:o,rest:i}=ux((e.pending.get(r)??"")+n);i?(e.pending.size||queueMicrotask(()=>dx(e)),e.pending.set(r,i)):e.pending.delete(r),iy(e,r,o)}function fx(e=document){const t=e;if(t[oy])return;t[oy]=!0;const n={doc:t,writerOf:new WeakMap,pending:new Map};Yd(e,"write",(...r)=>ay(n,"write",r.join(""))),Yd(e,"writeln",(...r)=>ay(n,"writeln",`${r.join("")}
2
+ `)),Yd(e,"open",(...r)=>r.length>=3?e.defaultView?.open(r[0],r[1],r[2])??null:e)}fx();function mx(e){return e}var hx=class extends Error{constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),A(this,"cycle",void 0),this.cycle=e}};function px(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 gx(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 bx(e){const t=px(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 hx([...o.slice(l),a].map(c=>c.name))}i.add(a),o.push(a);for(const l of gx(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 ye=class KN{constructor(t=[]){A(this,"_inner",void 0),A(this,"_isDisposed",!1),this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof KN&&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 Zd(e){return`service_container_${e}`}var bs=new Set,Qd;function yx(){if(!Qd)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,ly.prototype.getInstanceAsync),e.stack}function Jd(e){bs.delete(e)&&Qd?.end(e)}var ly=class db extends ye{_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 ye){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=yx();return new Promise((o,i)=>{const s={id:String(t),startedAt:Date.now(),origin:r,container:this,reject:i};bs.add(s),Qd?.start(s),this._onInject(t,()=>{Jd(s),o(this.getInstance(t))})})}failPendingWaits(t){for(const n of Array.from(bs))n.container===this&&(Jd(n),n.reject(t))}pendingWaits(){return[...bs].filter(t=>t.container===this)}addService(t,n){const r=Zd(t);this.injectFactory(r,(i,s=[])=>s.indexOf(n)<0?[...s,n]:s);const o=new ye;return o.addDispose(()=>{this.injectFactory(r,(i,s=[])=>s.filter(a=>a!==n))}),o}addServiceFactory(t,n,r){const o=Zd(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 ye;return s.addDispose(()=>{this.injectFactory(o,(a,l=[])=>i===void 0?l:l.filter(c=>c!==i))}),s}getServices(t){const n=Zd(t);return[...this.getInstance(n,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new db(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const n=this._parent?.getOrCreateIsolatedContainer(t);return new db(n)})}remove(t){const n=this._injections;delete n[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(bs))t.container===this&&Jd(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function ef(e){return e.startsWith("__")?e:`__${e}__`}function vx(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=ef(e),n=globalThis;return n[t]??(n[t]={})}function Ex(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function Sx(e){if(e)return ef(e);const t="useblocks".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return ef(t)}function tf(e){const t=Sx(e),n=vx(t);if(Ex(n.container))return n.container;const r=new ly(null);return n.container=r,r}function wx(){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 _x(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():wx()}function te(e=_x()){return e}function cy(){return"iframe".trim()||"unknown"}function Cx(e){if(typeof globalThis>"u")return;const t=cy(),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 Tx(){const e="useblocks".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function Ax(e,t){if(Cx(t),typeof globalThis>"u")return e;const n=cy(),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 El;function kx(){if(El)return El;const e=Tx();return El=Ax(tf(e),e),El}var cse=new Proxy({},{get(e,t,n){const r=kx(),o=Reflect.get(r,t,n);return typeof o=="function"?o.bind(r):o}}),Lx=new Function("url","return import(url)");function Nx(e){if(typeof e!="function")return!1;try{return Reflect.construct(String,[],e),!0}catch{return!1}}function nf(e){return typeof e=="object"&&e!==null&&"type"in e&&"url"in e}function uy(e){return e.type==="umd"||e.resolve==="registry"}var xx="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 Ox(e){const t=Array.isArray(e)?e[0]:e;return nf(t)?t.name??t.url:typeof t=="function"?t.name||"anonymous plugin":String(t)}function Rx(e,t){const n=Ox(e),r=nf(e)?e:void 0,o=t instanceof Error?t.message:String(t),i=r&&uy(r)&&!/compat/iu.test(o)?` ${xx}`:"",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 Mx(e){return!e.filename&&!e.error&&/^Script error\.?$/.test(e.message)}function use(e){return e}var Px=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(nf(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(uy(e)&&await this._options.ensureHostRuntimeReady?.(e),e.type==="esm"){const n=await Lx(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):Mx(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=Rx(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 Nx(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)}))}},dy=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)}}}},Ix=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=te("SandboxHtmlDocument"),at=te("SandboxRemoteDocument"),ys=te("SandboxTextDocument"),yn=te("SandboxDocumentMapping"),Se=te("SandboxSyncCommit"),vs=te("SandboxLayoutProfile"),fy=te("SandboxState"),Ne=te("SandboxSelectionLock"),Qe=te("SandboxEditLock"),qo=te("SandboxAttributePipeline"),rf=te("SandboxAmpService"),of=te("SandboxImageReload"),Sl=te("SandboxImageCache"),lt=te("SandboxFocus"),wl=te("SandboxLocalization"),De=te("SandboxElementSettings"),zo=te("SandboxElementRefs"),wt=te("SandboxSetCursor"),my=te("SandboxStyleRoot"),hy=te("SandboxVmlWidthResolver"),_l=te("SandboxPrepareHtml"),Es=te("SandboxSurfaceName"),Uo=te("SandboxDocumentSync"),jo=te("SandboxMapObj"),Vo=te("SandboxActiveElementFingerprint"),Cl=te("SandboxToggleTextStyle"),vn=te("SandboxWrapEditor"),Nr=te("SandboxInsertServices"),Ss=te("SandboxInitPreview"),sf=te("SandboxInsertPolicy"),Go=te("SandboxTableSelections"),py=te("SandboxNarrowTableTextAtom"),gy=te("SandboxSettingsExtras"),by=te("SandboxViewportHandlers"),yy=te("SandboxOperations"),Xo=te("SandboxApplyElementSettings"),xr=te("SandboxOperationEnvironment"),Ko=te("SandboxHostFacts"),Dx="__sandbox__",It=tf(Dx);function Bx(e){return e}function Hx(e,t=It){t.inject(Es,e.name),t.inject(vs,e.profile);for(const n of bx(e.units))n.setup(t);return t}function En(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 vy=class extends ye{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()}},Fx=class extends vy{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}}},pe=class extends Fx{execute([e],t){for(const n of t)try{n(e)}catch{}}},$x=class extends vy{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 Wx(e,t,n){let r;const o=new pe({onFirstListenerAdd(){r=o.addDisposable(new ye),r.addDisposable(e(i=>{t(i)!==!1&&o.fire(i)}))},onLastListenerRemove(){r?.dispose(),r=void 0}});return n?.addDisposable(o),o.event}function qx(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 zx(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 dse(e){return e}function Ux(e){return e&&typeof e=="object"}function Ey(e,t){return e&&typeof e=="object"&&e.operationId===t}var Rn="INIT_MESSAGE",jx="em:port-ready",Vx="em:window-drained",af="";function Sy(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var Gx=class extends ye{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))}},Xx=class extends ye{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 Gx)),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)&&Ey(o,Rn)){this._greeted.delete(i),this._handshaken.add(i),this._postMessage(i,{operationId:Rn,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),Ux(o)&&l||this._singleton&&Ey(o,Rn)){if(s&&l){const f=this._target;Promise.resolve().then(()=>this.usePort(s,!0,f))}const c=this._emitter.fireAsync(o.operationId||af,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=qx({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(Rn,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(Rn))}),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(Rn,void 0);return}this._inited=!1,this._postMessage(e,{operationId:Rn,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:Rn,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:Rn,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=zx(e),o=r.subscribe(this._onTransportMessage);this._ports.set(n,{transport:r,subscription:o}),t&&(r.send({operationId:jx,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:Vx,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(af,e,t)}sendAsync(e,t,n=!0){if(!n&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const r=Sy(),o=Sy();return new Promise((i,s)=>{const a=this.addDisposable(new ye);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(af,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 ye);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(Rn,()=>{e(this._target)},n)),r}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}};function wy(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 _y(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 Kx=/<\/?[a-zA-Z][a-zA-Z0-9:_.-]*(?:\s[^<>]*)?\/?>/g;function Yx(e){return e.replace(Kx,t=>/^<br\b/i.test(t)?" ":"")}var Zx={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"},lo=8e3,Qx=2e3,Jx=15e3,lf=3e3,eO="fonts.googleapis.com",tO=e=>{try{const t=new URL(String(e??"").trim());return t.protocol==="https:"?t:null}catch{return null}},nO=e=>{const t=tO(String(e??""));return t?t.hostname===eO&&t.pathname.startsWith("/css")&&!!t.searchParams.get("family"):!1},ue={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"},rO=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"),LINK_PLACEHOLDER: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")}),j=new Xx(window.parent,!0),Tl,ws,Cy=Math.random().toString(36).slice(2,8),oO=0,Al;function Ty(e,t){const n=Tl;Tl=e;try{return t()}finally{Tl=n}}function kl(e,t){const n=ws;ws=e;try{return t()}finally{ws=n}}function iO(){return ws}function sO(){try{return Tl?.()}catch{return}}function aO(){return Al||(Al=`${Cy}:${++oO}`,Promise.resolve().then(()=>{Al=void 0})),Al}function ct(e,t){const n=sO();return j.send(ue.APPLICATION_DOMPARSER_ERROR,{message:e,stack:new Error().stack,...n?{mutation:n}:{},source:ws??"other",batch:aO(),instance:Cy}),t}function cf(e,t){let n=t.children,r=e(t)||0;if(r!=0||!n)return r!==1;for(const o of n)if(cf(e,o)===!1)return!1;return!0}function Ay(e,t,n=[t]){for(;t=t.parent;)if(e(n=[t,...n])===!1)return!1;return!0}function lO(e,t){return Ay(([n,r])=>{const{children:o}=n;if(o){for(let i=o.indexOf(r)+1,s=o.length;i<s;i++)if(cf(e,o[i])===!1)return!1}},t)}function Mn(e,t,n){cf(r=>{r.start+=t,r.startTagEnd!==void 0&&(r.startTagEnd+=t),r.end+=t,r.endTagStart!==void 0&&(r.endTagStart+=t)},e),n&&(Ay(([r])=>{r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e),lO(r=>{r.start+=n,r.startTagEnd!==void 0&&(r.startTagEnd+=n),r.end+=n,r.endTagStart!==void 0&&(r.endTagStart+=n)},e))}var cO=e=>e.type===B.HTML?e.start-1:e.start,uO=e=>e.type===B.HTML?e.end+1:e.end;function dO(e,t){const{start:n,end:r}=e;let o=t.findNodeAt(n);for(;o&&(cO(o)>=n||uO(o)<=r||o.start===o.startTagEnd);)o=o.parent;return o}function fO(e){return{start:e.start+(e.tag?.length||0)+1,end:(e.startTagEnd!==void 0?e.startTagEnd:e.start)-1}}function ky(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n>0)return t[n-1]}}function Or(e){let t=e;do t=mO(t);while(t&&t.type===B.HTML&&!t.content);return t}function mO(e){const t=e.parent?.children;if(t){const n=t.indexOf(e);if(n<0)return ct("parent and child not sync",e);if(n<t.length-1)return t[n+1]||null}return null}var co=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 Ly(e,t){return(t<<5)-t+e|0}function hO(e,t){t=Ly(149417,t);for(let n=0,r=e.length;n<r;n++)t=Ly(e.charCodeAt(n),t);return t}var Ny=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 xy(e,t,n){return new pO(new Ny(e),new Ny(t)).ComputeDiff(n).changes}var Yo=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]}},Oy=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 co(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}},pO=class ls{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]=ls._getElements(t),[a,l,c]=ls._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(ls._isStringArray(n)){const r=new Int32Array(n.length);for(let o=0,i=n.length;o<i;o++)r[o]=hO(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)?ls._getStrictElement(this._originalSequence,t)===ls._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?(Yo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),c=[new co(t,0,r,o-r+1)]):t<=n?(Yo.Assert(r===o+1,"modifiedStart should only be one more than modifiedEnd"),c=[new co(t,n-t+1,r,0)]):(Yo.Assert(t===n+1,"originalStart should only be one more than originalEnd"),Yo.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 co(t,n-t+1,r,o-r+1)]}WALKTRACE(t,n,r,o,i,s,a,l,c,u,d,f,h,m,p,b,C,L){let k=null,y=null,g=new Oy,E=n,_=r,S=h[0]-b[0]-o,v=-1073741824,T=this.m_forwardHistory.length-1;do{const w=S+t;w===E||w<_&&c[w-1]<c[w+1]?(d=c[w+1],m=d-S-o,d<v&&g.MarkNextChange(),v=d,g.AddModifiedElement(d+1,m),S=w+1-t):(d=c[w-1]+1,m=d-S-o,d<v&&g.MarkNextChange(),v=d-1,g.AddOriginalElement(d,m+1),S=w-1-t),T>=0&&(c=this.m_forwardHistory[T],t=c[0],E=1,_=c.length-1)}while(--T>=-1);if(k=g.getReverseChanges(),L[0]){let w=h[0]+1,N=b[0]+1;if(k!==null&&k.length>0){const x=k[k.length-1];w=Math.max(w,x.getOriginalEnd()),N=Math.max(N,x.getModifiedEnd())}y=[new co(w,f-w+1,N,p-N+1)]}else{g=new Oy,E=s,_=a,S=h[0]-b[0]-l,v=1073741824,T=C?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const w=S+i;w===E||w<_&&u[w-1]>=u[w+1]?(d=u[w+1]-1,m=d-S-l,d>v&&g.MarkNextChange(),v=d+1,g.AddOriginalElement(d+1,m+1),S=w+1-i):(d=u[w-1],m=d-S-l,d>v&&g.MarkNextChange(),v=d,g.AddModifiedElement(d+1,m+1),S=w-1-i),T>=0&&(u=this.m_reverseHistory[T],i=u[0],E=1,_=u.length-1)}while(--T>=-1);y=g.getChanges()}return this.ConcatenateChanges(k,y)}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,b=new Int32Array(p),C=new Int32Array(p),L=o-r,k=n-t,y=t-r,g=n-o,E=(k-L)%2===0;b[L]=t,C[k]=n,a[0]=!1;for(let _=1;_<=m/2+1;_++){let S=0,v=0;if(_>100)return null;u=this.ClipDiagonalBound(L-_,_,L,p),d=this.ClipDiagonalBound(L+_,_,L,p);for(let w=u;w<=d;w+=2){w===u||w<d&&b[w-1]<b[w+1]?l=b[w+1]:l=b[w-1]+1,c=l-(w-L)-y;const N=l;for(;l<n&&c<o&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(b[w]=l,l+c>S+v&&(S=l,v=c),!E&&Math.abs(w-k)<=_-1&&l>=C[w])return i[0]=l,s[0]=c,N<=C[w]&&_<=1448?this.WALKTRACE(L,u,d,y,k,f,h,g,b,C,l,n,i,c,o,s,E,a):null}const T=(S-t+(v-r)-_)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(S,T))return a[0]=!0,i[0]=S,s[0]=v,T>0&&_<=1448?this.WALKTRACE(L,u,d,y,k,f,h,g,b,C,l,n,i,c,o,s,E,a):(t++,r++,[new co(t,n-t+1,r,o-r+1)]);f=this.ClipDiagonalBound(k-_,_,k,p),h=this.ClipDiagonalBound(k+_,_,k,p);for(let w=f;w<=h;w+=2){w===f||w<h&&C[w-1]>=C[w+1]?l=C[w+1]-1:l=C[w-1],c=l-(w-k)-g;const N=l;for(;l>t&&c>r&&this.ElementsAreEqual(l,c);)l--,c--;if(C[w]=l,E&&Math.abs(w-L)<=_&&l<=b[w])return i[0]=l,s[0]=c,N>=b[w]&&_<=1448?this.WALKTRACE(L,u,d,y,k,f,h,g,b,C,l,n,i,c,o,s,E,a):null}if(_<=1447){let w=new Int32Array(d-u+2);w[0]=L-u+1,Zo.Copy2(b,u,w,1,d-u+1),this.m_forwardHistory.push(w),w=new Int32Array(h-f+2),w[0]=k-f+1,Zo.Copy2(C,f,w,1,h-f+1),this.m_reverseHistory.push(w)}}return this.WALKTRACE(L,u,d,y,k,f,h,g,b,C,l,n,i,c,o,s,E,a)}PrettifyChanges(t){for(let n=0;n<t.length;n++){const r=t[n],o=n<t.length-1?t[n+1].originalStart:this._originalElementsOrHash.length,i=n<t.length-1?t[n+1].modifiedStart:this._modifiedElementsOrHash.length,s=r.originalLength>0,a=r.modifiedLength>0;for(;r.originalStart+r.originalLength<o&&r.modifiedStart+r.modifiedLength<i&&(!s||this.OriginalElementsAreEqual(r.originalStart,r.originalStart+r.originalLength))&&(!a||this.ModifiedElementsAreEqual(r.modifiedStart,r.modifiedStart+r.modifiedLength));){const c=this.ElementsAreStrictEqual(r.originalStart,r.modifiedStart);if(this.ElementsAreStrictEqual(r.originalStart+r.originalLength,r.modifiedStart+r.modifiedLength)&&!c)break;r.originalStart++,r.modifiedStart++}const l=[null];if(n<t.length-1&&this.ChangesOverlap(t[n],t[n+1],l)){t[n]=l[0],t.splice(n+1,1),n--;continue}}for(let n=t.length-1;n>=0;n--){const r=t[n];let o=0,i=0;if(n>0){const d=t[n-1];o=d.originalStart+d.originalLength,i=d.modifiedStart+d.modifiedLength}const s=r.originalLength>0,a=r.modifiedLength>0;let l=0,c=this._boundaryScore(r.originalStart,r.originalLength,r.modifiedStart,r.modifiedLength);for(let d=1;;d++){const f=r.originalStart-d,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(Yo.Assert(t.originalStart<=n.originalStart,"Left change is not less than or equal to right change"),Yo.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 co(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 Xt=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 Nt(e,t){return e===null||e.length===0?t:new gO(e,t).compress()}var gO=class Tr{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]=Tr._splitCurr(o,r.newPosition-o.oldPosition);this._acceptCurr(l),o=c;continue}if(r.newPosition<o.oldPosition){const[l,c]=Tr._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]=Tr._splitPrev(r,o.oldLength);s=l,a=o,r=c,o=this._getCurr(++n)}else{const[l,c]=Tr._splitCurr(o,r.newLength);s=r,a=l,r=this._getPrev(++t),o=c}this._result[this._resultLen++]=new Xt(s.oldPosition,s.oldText,a.newPosition,a.newText),this._prevDeltaOffset+=s.newLength-s.oldLength,this._currDeltaOffset+=a.newLength-a.oldLength}const i=Tr._merge(this._result);return Tr._removeNoOps(i)}_acceptCurr(t){this._result[this._resultLen++]=Tr._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++]=Tr._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 Xt(n.oldPosition-t,n.oldText,n.newPosition,n.newText)}static _rebasePrev(t,n){return new Xt(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 Xt(t.oldPosition,t.oldText,t.newPosition,r),new Xt(t.oldEnd,"",t.newPosition+n,o)]}static _splitCurr(t,n){const r=t.oldText.substr(0,n),o=t.oldText.substr(n);return[new Xt(t.oldPosition,r,t.newPosition,t.newText),new Xt(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 Xt(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 Ry(e){return new Xt(e.newPosition,e.newText,e.oldPosition,e.oldText)}function Pn(e){return e.map(Ry)}function bO(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 yO(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 Nl(e,t,n){if(!t.length)return[...e];const r=[];let o=0;for(const i of e){const s=yO({start:i.oldPosition,end:i.oldEnd},t,n);if(!s)return null;r.push(new Xt(s.start,i.oldText,s.start+o,i.newText)),o+=i.newLength-i.oldLength}return r}function My(e,t,n=0){const r=e.range;return new Xt(e.range.start,typeof t=="string"?t.substring(r.start,r.end):t.getText(r),r.start+n,e.text)}function Qo(e,t){let n=0;return e.map(({text:r,range:{start:o,end:i}})=>{let s=n;return n+=r.length-(i-o),My({text:r,range:{start:o,end:i}},t,s)})}function vO(e){return{range:{start:e.oldPosition,end:e.oldEnd},text:e.newText}}function uo(e){return e.map(t=>vO(t))}function EO(e,t=_s(e)){const n=e.getLength(),{start:r,end:o}=t;return r>n||o<0?null:{start:r,end:o}}var fse=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g");function SO(e,{start:t,end:n}){return{start:t,end:n+(e.newLength-e.oldLength)}}function _s(e){return{start:0,end:e.getLength()}}function wO(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 _O(e,t){return t=xl(t).sort(({range:n},{range:r})=>n.start-r.start),Cs(e,t)}function Ts(e,t){return e>=t.start&&e<=t.end}function xl(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(Ts(i.start,l)&&Ts(i.start,l))c=l;else if(Ts(l.start,i))Ts(l.end,i)?c=i:c={start:i.start,end:l.end};else if(Ts(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=wO(u,a.text,{start:d,end:f});e[r]=o={range:i=c,text:h},e.splice(s--,1),n--}}return e}function CO(e,t){if(e.length<=1)return e[0]||null;e=xl(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 TO(e,t){const n=Pn(e),r=CO(uo(n),t);if(r){const o=My(r,t);return Ry(o)}return null}function AO(e,{range:t,text:n}){const r=e.getText(t);return xy(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 Py({oldText:e,newText:t,oldPosition:n,newPosition:r}){return xy(e,t,!0).map(o=>new Xt(n+o.originalStart,e.substring(o.originalStart,o.originalStart+o.originalLength),r+o.modifiedStart,t.substring(o.modifiedStart,o.modifiedStart+o.modifiedLength)))}var kO=class{constructor(e,t){A(this,"index",void 0),A(this,"values",void 0),A(this,"type","insert"),this.index=e,this.values=t}},LO=class{constructor(e,t){A(this,"index",void 0),A(this,"howMany",void 0),A(this,"type","remove"),this.index=e,this.howMany=t}},NO=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 xO(e,t){return e===t}function OO(e,t,n=xO){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 NO(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 LO(p,h))}for(var b=[],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);b.push(new kO(p,C))}var L=b.length,k=m.length,y=i.length,g,E,_=0;for(g=0;g<k;g++){var S=m[g];for(S.index-=_,_+=S.howMany,E=0;E<y;E++){var v=i[E];v.from>=S.index&&(v.from-=S.howMany)}}for(g=L;g--;){var T=b[g],h=T.values.length;for(E=y;E--;){var v=i[E];v.to>=T.index&&(v.to-=h)}}for(g=y;g-- >1;){var v=i[g];if(v.to!==v.from)for(E=g;E--;){var w=i[E];w.to>=v.to&&(w.to-=v.howMany),w.to>=v.from&&(w.to+=v.howMany)}}var N=[];for(g=0;g<y;g++){var v=i[g];if(v.to!==v.from)for(N.push(v),E=g+1;E<y;E++){var x=i[E];x.from>=v.from&&(x.from-=v.howMany),x.from>=v.to&&(x.from+=v.howMany)}}return[...m,...N,...b]}var Iy=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}},se;(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})(se||(se={}));function Dy(e,t){return e.push(t),{dispose:()=>{const n=e.indexOf(t);n!==-1&&e.splice(n,1)}}}var By=[],Hy=[];function RO(e){return Dy(By,e)}function uf(e){return e?By.some(t=>t(e)):!1}function MO(e){return Dy(Hy,e)}function PO(e){return Hy.some(t=>t(e))}function IO(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(se.attribute(t,f,void 0))}break}else r[u]!==n[u]&&l.push(se.attribute(t,u,r[u]))}for(;c<a;c++){const u=i[c];l.push(se.attribute(t,u,r[u]))}return l}function DO(e){let t=[];const n=e.children.filter(o=>o.type!==B.HTML||!!o.content);let r;for(let o=n.length-1;o>=0;o--)t.push(se.add(e,n[o],r)),r=n[o];return t}function BO(e){return se.remove(e)}var HO=new Set(["head","body","html"]),FO=e=>e.type===B.ROOT||e.type===B.DOCTYPE||e.type===B.ELEMENT&&e.tag&&HO.has(e.tag.toLowerCase()),$O=/^<[!?/]/;function df(e){return e.type===B.ELEMENT?String(e.tag):e.type===B.HTML&&$O.test(e.content??"")?"bogus":String(e.type)}function Ol(e){const t=new Iy,n=Object.create(null);for(const r of e){const o=df(r)+(!FO(r)&&r.start===r.end?"_hidden":"");let i="";r.type===B.ELEMENT&&r.attributes?.id?i=`id_${r.attributes.id}`:i=n[o]=(n[o]||0)+1,t.set(`${o}_${i}`,r)}return t}function Fy(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 Rl(e,t){const n=e[t-1];return t<e.length?e[t].shift:n.shift+n.delta}function ff(e,t){return(e.type===B.HTML?e.end+1:e.end)<=t.oldPosition}function WO(e,t){return(e.type===B.HTML?e.start-1:e.start)>=t.oldEnd}function mf(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 hf(e,t){return t.type===e.type&&df(t)===df(e)&&t.attributes?.id===e.attributes?.id}function As(e,t,n){return Jn(e,!1,n)===Jn(t,!1,n)}function pf(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 pf(t.length,n,r=>!WO(e,t[r]))}function gf(e,t){const n=Ml(e,t);return t.slice(n,qy(e,t,n))}function $y(e,t){const n=Ml(e,t);return n<t.length&&!ff(e,t[n])?void 0:e.start+Rl(t,n)}function Pl(e){return e.type===B.ELEMENT?e.attributes?.id:void 0}function Wy(e){const t=new Set,n=new Set;for(const r of e){const o=Pl(r);o&&(t.has(o)?n:t).add(o)}return n}function qO(e,t,n){const r=new Set([...Wy(t),...Wy(n)]),o=new Map;e.forEach((s,a)=>{for(let l=s.prevFrom;l<s.prevTo;l++){const c=Pl(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=Pl(n[l]),u=c?o.get(c):void 0;c&&u&&u.gap!==a&&!r.has(c)&&hf(u.node,n[l])&&i.set(c,u.node)}}),i}function zO(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&&!ff(u,n[s]))continue;const d=u.start+Rl(n,s),f=pf(t.length,a,h=>t[h].start>=d);mf(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 qy(e,t,n){return pf(t.length,n,r=>ff(e,t[r]))}function zy(e,t,n,r,o,i,s){const a=Ml(e,o),l=qy(e,o,a),c=(p,b=()=>!0)=>p?.find(C=>C>=n&&C<r&&hf(e,t[C])&&b(t[C]))??-1,u=e.start+Rl(o,a),d=e.end+Rl(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&&jO(e,p,u))):-1;return h>=0&&m>=0&&h!==m?As(e,t[h],i)||As(e,t[m],i)?As(e,t[h],i)?h:m:jy(e,t[m],o)>jy(e,t[h],o)?m:h:h>=0?h:m}function Uy(e,t,n){const r=e.get(t);r?r.push(n):e.set(t,[n])}function UO(e,t,n){const r={byStart:new Map,byEnd:new Map};for(let o=t;o<n;o++)Uy(r.byStart,e[o].start,o),Uy(r.byEnd,e[o].end,o);return r}function jO(e,t,n){for(let r=t.lastChild;r&&r.end===t.end;r=r.lastChild)if(r.start===n&&hf(e,r))return!0;return!1}function jy(e,t,n){const r=new Map(t.children.map(o=>[o.start,o]));return e.children.filter(o=>{const i=$y(o,n);return i!==void 0&&mf(o,r.get(i),i)}).length}function Vy(e,t){return gf(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 VO(e,t,n,r,o,i){const s=As(e,t,i),a=As(n,r,i);return s!==a?a:Vy(n,o)>Vy(e,o)}function GO(e,t,n,r){const o=n.edits??[],i=[],s=[];let{prevFrom:a,prevTo:l,nextFrom:c,nextTo:u}=n;const d=UO(t,c,u);for(;o.length&&a<l&&c<u;){const f=zy(e[l-1],t,c,u,o,r,d);if(l-1===a){f>=0&&s.unshift([a,f]);break}const h=zy(e[a],t,c,u,o,r,d);let m=h>=0,p=f>=0;if(m&&p&&h>=f&&(p=VO(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 XO(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 KO(e,t,n,r,o){const i=o?.length?$y(e,o):void 0;return(i===void 0?void 0:t.children.find(s=>mf(e,s,i)))??r.getByKey(n.getByValue(e)??"")}function ks(e,t){for(const n of t)e.push(n)}function Gy(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??[Ol(d),Ol(f)],p=OO(d,f,(C,L)=>h.getByValue(C)===m.getByValue(L)),b=C=>{const L=Pl(C);return L?l.get(L):void 0};for(const C of p)switch(C.type){case"insert":{const L=u+C.index;let k=t[L];for(const y of C.values.reverse()){t.splice(L,0,y),i.add(y);const g=b(y);g?(ks(c,Il(g,y,s,a)),c.push(se.move(e,y,k))):c.push(se.add(e,y,k)),k=y}break}case"remove":{const L=t.splice(u+C.index,C.howMany);for(const k of L)b(k)!==k&&c.push(se.remove(k));break}case"move":{const L=t.splice(u+C.from,C.howMany);let k=t[u+C.to];t.splice(u+C.to,0,...L);for(const y of L.reverse()){const g=m.getByKey(h.getByValue(y)??"");if(!g)return ct("error while sync",c);i.add(g),ks(c,Il(y,g,s,a,r.edits&&gf(y,r.edits))),c.push(se.move(e,g,k)),k=y}break}}return c}function bf(e,t,n=!1,r=$d(),o){const i=[],s=Ol(e.children),a=Ol(t.children);for(let p=e.children.length-1;p>=0;p--){const b=e.children[p];if(b.type===B.ELEMENT&&b.start===b.end){const C=s.getByValue(b);if(!a.getByKey(C)){let L=!1;for(let k=p+1;k<e.children.length;k++){const y=e.children[k];if(y){const g=KO(y,t,s,a,o);if(g){const E=g.start,_=b.clone();t.children.splice(t.children.indexOf(g),0,_),Mn(_,E-b.start),_.parent=t,a.set(C,_),L=!0;break}}}if(!L){const k=t.endTagStart===void 0?t.end:t.endTagStart,y=b.clone();t.children.push(y),a.set(C,y),Mn(y,k-b.start),y.parent=t}}}}const l=e.children.filter(p=>p.type!==B.HTML||!!p.content),c=t.children.filter(p=>p.type!==B.HTML||!!p.content),u=o?.length?zO(l,c,o):null,d=u?qO(u,l,c):new Map,f=new Set;for(const p of u?[...u].reverse():[]){const b=XO(p,GO(l,c,p,r)).reverse();for(const C of b)ks(i,Gy(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||ks(i,Gy(t,l,c,h,[s,a],f,n,r)),c.length!==l.length&&ct("error while sync");const m=new Map;for(const p of u??[h])for(let b=p.nextFrom;b<p.nextTo;b++)m.set(b,p.edits);for(let p=c.length-1;p>=0;p--){const b=c[p];if(!f.has(b)){const C=m.get(p);ks(i,Il(l[p],b,n,r,C&&gf(l[p],C)))}}return i}function yf(e){return e.type===B.ELEMENT&&uf(e.tag)}function Il(e,t,n=!1,r=$d(),o){if(e.type===t.type&&!(e.isDirty||t.isDirty)){if(yf(e)&&e.tag===t.tag){if(Jn(e,!1,r)===Jn(t,!1,r))return[se.update(e,t,n),...bf(e,t,!0,r)]}else if((e.type===B.ELEMENT||e.type===B.ROOT)&&e.tag===t.tag)return[se.update(e,t,n),...IO(e,t),...bf(e,t,n,r,o)];if(e.type===B.HTML||e.type===B.COMMENT)return e.content===t.content?[se.update(e,t,n)]:[se.update(e,t,n),se.set(t,t.content)]}return!e.parent||!t.parent?ct("cannot replace document",[]):yf(e)&&e.tag===t.tag?se.recreate(e,t.parent,t,Or(t)||void 0):[se.remove(e),se.add(t.parent,t,Or(t)||void 0)]}var nr="FROM_DOM",rr="FROM_REMOTE";function YO(e){const t=Cb(e);if(t.scan()!==He.StartTagOpen||t.scan()!==He.StartTag)return;let n=t.getTokenEnd();const r=[];let o,i=!1;for(let s=t.scan();s!==He.EOS;s=t.scan())switch(s){case He.Whitespace:break;case He.AttributeName:if(i)return;o={name:t.getTokenText().toLowerCase(),before:n,start:t.getTokenOffset(),nameEnd:t.getTokenEnd(),end:t.getTokenEnd()},r.push(o),n=o.end;break;case He.DelimiterAssign:if(!o)return;i=!0;break;case He.AttributeValue:if(!o||!i)return;o.value={start:t.getTokenOffset(),end:t.getTokenEnd()},o.end=t.getTokenEnd(),n=o.end,o=void 0,i=!1;break;case He.StartTagClose:case He.StartTagSelfClose:return!i&&t.getTokenEnd()===e.length?{attributes:r,tail:n}:void 0;default:return}}function Dl(e){return`"${e.replaceAll('"',"'")}"`}function ZO(e,t){const n=e[0];return n==='"'||n==="'"?t.includes(n)?Dl(t):`${n}${t}${n}`:/^[^\s"'`=<>]+$/.test(t)?t:Dl(t)}function QO(e,t,n,r){const o=YO(t);if(!o)return;const i=n.toLowerCase(),s=o.attributes.filter(u=>u.name===i);if(s.length>1)return;const[a]=s;if(r===null)return a?{start:t[a.end]==="/"?a.start:a.before,end:a.end,text:""}:null;if(!a){const u=r===""&&i!=="em"&&!Ab(e.toLowerCase(),i);return{start:o.tail,end:o.tail,text:u?` ${n}`:` ${n}=${Dl(r)}`}}if(!a.value)return r===""?null:{start:a.nameEnd,end:a.nameEnd,text:`=${Dl(r)}`};const l=t.slice(a.value.start,a.value.end),c=ZO(l,r);return c===l?null:{start:a.value.start,end:a.value.end,text:c}}function JO(e){if(e.startTagEnd===void 0||e.start===e.startTagEnd||!e.closed)return!1;const t=e.tag?.toLowerCase()??"";return ds.has(t)?e.children.length===0:e.endTagStart!==void 0&&e.endTagStart<e.end}function Xy(e){switch(e.type){case B.ELEMENT:return JO(e)&&e.children.every(Xy);case B.COMMENT:return e.closed;case B.HTML:return!(e.content??"").includes("</");default:return!1}}function Ky(e){e.type===B.HTML?(e.startTagEnd=e.start,e.endTagStart=e.end):e.type===B.ELEMENT&&ds.has(e.tag?.toLowerCase()??"")&&(e.endTagStart=e.startTagEnd),e.children.forEach(Ky)}function Yy(e,t){return e.type===t.type&&(e.tag??"").toLowerCase()===(t.tag??"").toLowerCase()&&e.children.length===t.children.length&&e.children.every((n,r)=>Yy(n,t.children[r]))}function eR(e,t){if(e.start===e.end||e.type!==B.ELEMENT&&e.type!==B.COMMENT)return!1;const[n,...r]=rn(t).roots;return!!n&&r.length===0&&n.start===0&&n.end===t.length&&Xy(n)&&Yy(e,n)}var tR=/<\/.*>/i;function nR(e){return tR.test(e)}var rR=/^<[!?/][^>]*$/,oR=class extends ye{constructor(e,t){super(),A(this,"_baseDocument",void 0),A(this,"_createRoot",void 0),A(this,"_beforeTextChangeEmitter",this.addDisposable(new pe)),A(this,"_onTextChangeEmitter",this.addDisposable(new pe)),A(this,"_onMutateEmitter",this.addDisposable(new pe)),A(this,"_beforeRefreshEmitter",this.addDisposable(new pe)),A(this,"_onRefreshEmitter",this.addDisposable(new pe)),A(this,"_root",new Lt(0,0,[])),A(this,"_applyingMutation",void 0),A(this,"_detachedSources",new WeakMap),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 Lt(0,0,[]);n.type=B.ROOT}get root(){return this._root}contains(e){return e.root===this.root}isAttached(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t===this.root}_rememberSource(e){if(this.contains(e)){const t=this._baseDocument.getText({start:e.start,end:e.end});this._detachedSources.set(e,` ${t}`.slice(1))}}_takeSource(e){const t=this._detachedSources.get(e);if(this._detachedSources.delete(e),!(t===void 0||!eR(e,t)))return Ky(e),t}_forgetChangedSource(e){let t=e;for(;t?.parent;)t=t.parent;t&&this._detachedSources.delete(t)}get applyingMutation(){return this._applyingMutation}initialize(e,t,n){const r=this._root;this._beforeRefreshEmitter.fire();let{roots:o}=rn(e),i=this._root=this._createRoot?this._createRoot(o,e):new Lt(0,e.length,o);if(i.type=B.ROOT,this._createRoot||o.forEach(s=>s.parent=i),!t){const s=n&&Fy(n);this._onRefreshEmitter.fire(r?bf(r,i,!1,void 0,s):DO(i))}}_onTextChange({source:e,changes:t}){if(e==="FROM_REMOTE"){const n=TO(t,this._baseDocument.getText());if(n)try{this._beforeTextChangeEmitter.fire(),kl("text",()=>this.replaceWithHtml(n,rr,t))}finally{this._onTextChangeEmitter.fire()}}}insertBefore(e,t,n,r){if(t.parent){if(t.parent===e&&Or(t)===n)return t;this.remove(t,r)}const o=this.contains(e);o||this._forgetChangedSource(e);const i=this._takeSource(t)??dl(t),s=e.children,a=n?s.indexOf(n):s.length;if(a<0)return ct("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,Mn(t,l-t.start,i.length),o&&(r!=="FROM_DOM"&&this._onMutateEmitter.fire([se.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=this._takeSource(t)??dl(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)Mn(r,n-r.start),n+=o.length;Mn(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=>uf(t.tag))}replaceWithHtml(e,t,n=[e]){const r=this._baseDocument,o=u=>{const d=this.getContext(u);if(d)return d.isDirty=!0,Promise.resolve().then(()=>{d.isDirty=!1}),!1;if(u.type!==B.HTML){if(!u.closed)return!1}else return!u.content||!nR(u.content)&&!rR.test(u.content);return!0};if(!this._root)return this.initialize(r.getText(),!1,n);let i={start:e.oldPosition,end:e.oldEnd},s=dO(i,this._root);if(!s)return this.initialize(r.getText(),!1,n);let a,l,c;do{const u=SO(e,s);a=this._baseDocument.getText(u),[l,...c]=rn(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 ct("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,Mn(s,n.start-s.start,c),this._baseDocument.getText(s)!==i?(ct("Error while sync"),s):(r!=="FROM_DOM"&&this._onMutateEmitter.fire(Il(n,s,!1,void 0,o&&Fy(o))),n.parent=void 0,s)}remove(e,t){const n=this.contains(e),r=e.parent;if(!r)return ct("node is not in tree");n?this._rememberSource(e):this._forgetChangedSource(e);const o=r.children,i=o.indexOf(e);if(i<0)return ct("referenced node is not a child of parent node");const s=e.end-e.start;Mn(e,0,-s),o.splice(i,1),n&&(t!=="FROM_DOM"&&this._onMutateEmitter.fire([BO(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);o||this._forgetChangedSource(e);const i=e.attributes||(e.attributes=Object.create(null));if(typeof n=="string"?i[t]=n:delete i[t],e.start===e.startTagEnd)return;if(o&&e.startTagEnd!==void 0&&e.tag){const d=QO(e.tag,this._baseDocument.getText({start:e.start,end:e.startTagEnd}),t,n);if(d===null)return;if(d){const f=d.text.length-(d.end-d.start),h=e.start;Mn(e,f,f),e.start=h,this._baseDocument.applyEdits(r,[{text:d.text,range:{start:h+d.start,end:h+d.end}}]);return}}const s=kb(e),a=e.startTagEnd===void 0?0:e.startTagEnd-e.start-(e.tag?.length||0)-2,l=fO(e),c=s.length-a,u=e.start;Mn(e,c,c),e.start=u,o&&this._baseDocument.applyEdits(r,[{text:s,range:l}])}setContent(e,t,n){const r=this.contains(e);r||this._forgetChangedSource(e);const o=e.start,i=e.end;e.content=t;const s=e.end-e.start;if(!s)return;const a=dl(e,o),l=a.length-s;Mn(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=Or(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=rn(t).roots;i.length!==1&&ct("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(nr),this.insertBefore(n,t.node,r,nr));continue}switch(this._flushInsertRun(nr),t.type){case"Remove":this.remove(t.node,nr);break;case"Set":this.setContent(t.node,t.data,nr);break;case"Hidden":this.setHidden(t.node,t.value,nr);break;case"Attribute":this.setAttribute(t.node,t.name,t.value===void 0?null:t.value,nr)}}}finally{try{this._flushInsertRun(nr)}finally{this._applyingMutation=void 0,this._baseDocument.endUpdate()}}}getNodeByPosition(e){return this._root?.findNodeAt(e)}};function iR(e,t){return e.replace(new RegExp(`<(?=/${t.tagName}${ul})`,"gi"),"&lt;")}function Zy(e,t){return zb(e)??iR(e.textContent??"",t)}function Sn(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e.tagName.toUpperCase();return t==="STYLE"||t==="SCRIPT"&&!$b.has(e.getAttribute("type")??"")}var sR=4,aR=3,lR=80,Qy={Add:"insertBefore",Remove:"remove",Set:"set",Hidden:"hidden",Attribute:"attribute",Update:"update",Move:"move"},cR={[B.HTML]:"text",[B.ELEMENT]:"element",[B.ROOT]:"root",[B.COMMENT]:"comment",[B.DOCTYPE]:"doctype",[B.ADVANCED]:"advanced"},uR=new Set(["head","body"]);function vf(e){return(e??"").replace(/^(['"])(.*)\1$/s,"$2")}function Jy(e,t,n,r){const o=n.split(/\s+/).filter(Boolean).slice(0,aR);return(e+(t?`#${t}`:"")+o.map(i=>`.${i}`).join("")+(r?`[em=${r}]`:"")).slice(0,lR)}function dR(e){if(!e.tag)return`#${e.type}`;const t=e.attributes??{};return Jy(e.tag,vf(t.id),vf(t.class),vf(t.em))}function ev(e){return e instanceof Element?Jy(e.localName,e.id,e.getAttribute("class")??"",e.getAttribute("em")??""):e.nodeName.toLowerCase()}function Ef(e,t,n){const r=[];let o=e;for(;o&&r.length<sR;)r.unshift(n(o)),o=t(o);return r.join(" > ")}function fR(e){let t,n=e;for(;;){const r=n.tag?.toLowerCase();if(!t&&r&&uR.has(r)?t=r:r==="html"&&(t??(t="html")),!n.parent)break;n=n.parent}return n.type!==B.ROOT?"outside":t??"top"}function Sf(e,t,n){const r=t(e);return{path:Ef(e,o=>o.parent,dR),inTree:n(e),inDom:!!r?.isConnected,...r?{domPath:Ef(r,o=>o.parentNode,ev)}:{},inMap:!!r,hasParent:!!e.parent,kind:cR[e.type]??String(e.type),root:fR(e)}}function tv(e,t,n){if(!e)return;const r=i=>Sf(i,t,n);if(e.type==="Update")return{type:Qy.Update,node:r(e.prev),...e.next.parent?{parent:r(e.next.parent)}:{}};if(!("node"in e))return;const o={type:Qy[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 wf(e){let t=e;for(;t.parent;){if(!t.parent.children.includes(t))return!1;t=t.parent}return t.type===B.ROOT}function mR(e,t,n,r){const o=s=>Sf(s,a=>r.getByNode(a),wf),i=Ef(e,s=>s.parentNode,ev);return{type:"insertBefore",node:{path:i,inTree:!1,inDom:e.isConnected,domPath:i},parent:o(t),reference:o(n)}}function hR(e,t){const n=r=>Sf(r,o=>t.getByNode(o),wf);return{type:"remove",node:n(e),...e.parent?{parent:n(e.parent)}:{}}}function pR(e){return e.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase())}function nv(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}var rv=Object.create(null);function ov(e,t){const n=rv[e]||(rv[e]=Object.create(null));let r=n[t];if(typeof r!="boolean"){const o=document.createElement(e)[pR(t)];r=n[t]=typeof o<"u"&&typeof o!="boolean"}return r}function wn(e){return e.nodeType===Node.ELEMENT_NODE}function iv(e){return wn(e)?e.tagName==="AMP-IMG"?!0:ov(e.tagName.toLowerCase(),"src"):!1}var gR="http://www.w3.org/1999/xhtml";function ve(e){return wn(e)&&e.namespaceURI===gR}function _f(e){return wn(e)&&!e.ownerSVGElement}function bR(e){return e.tagName==="IMG"}function yR(e){return e.tagName==="FORM"}function vR(e){return e.tagName==="SCRIPT"}function ER(e){return e.tagName==="STYLE"}function Cf(e){return e.nodeType===Node.DOCUMENT_NODE}function sv(e){return e.nodeType===Node.DOCUMENT_TYPE_NODE}var Ls;(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})(Ls||(Ls={}));function Ns(e){return e.nodeType===Node.COMMENT_NODE}function fo(e){return e.nodeType===Node.TEXT_NODE}function SR(e){return e.tagName==="TABLE"}async function wR(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 Dt(e){if(wn(e))return av(e);if(Cf(e))return[...e.childNodes].map(r=>Dt(r)).join("");if(sv(e))return nv(e);const t=ml(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function _R(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"&&!ov(t,o)?` ${o}`:` ${o}="${i.replaceAll('"',"'")}"`}return n}function xt(e){let t="";for(const n of e.childNodes)t+=zb(n)??Dt(n);return t}function av(e){const t=Object.getOwnPropertyDescriptor(e,"$$tagName")?.value||e.tagName.toLowerCase(),n=_R(e);return ds.has(t.toLowerCase())?t==="vk-snippet-end"?`<${t}${n}/>`:`<${t}${n}>`:ER(e)?`<${t}${n}>${e.innerHTML}</${t}>`:`<${t}${n}>${xt(e)}</${t}>`}function CR(e){return typeof e=="string"?e:""}function lv(e,t,n){if(n&&e.type===B.DOCTYPE&&n?.type!==B.ROOT){const o=document.createTextNode(e.content||"");return t.set(e,o),o}const r=gl(e,n)?Gd(e.content||""):ao(e,!1,"dormant");t.set(e,r);for(const o of e.children){const i=lv(o,t,e);r.appendChild(i)}return r}function TR(e,t){for(let n=e.previousSibling;n;n=n.previousSibling)if(t(n))return!0;return!1}function cv(e,t,n,r,o){let i=e,s;for(let a=e.parentNode;a&&a!==t;a=a.parentNode)r?.(a)&&o&&TR(i,o)?s??(s={host:a,before:i}):r?.(a)?s=a.parentNode?{host:a.parentNode,before:a}:void 0:n(a)?s??(s={host:a,before:i}):s=void 0,i=a;return s}function AR(e,t,n=wf,r=()=>!1,o=()=>!1,i=()=>!1){let s,a;const l=new Map,c=()=>{const d=tv(s,f=>t.getByNode(f)||l.get(f),n);return d&&{...d,stage:"dom",...a?{cause:a}:{}}},u=d=>{a=d;try{ct("Element node not in tree")}finally{a=void 0}};return Ty(c,()=>kR(e,t,l,d=>s=d,u,r,o,i))}function kR(e,t,n,r,o,i,s,a){const l=[],c=new Map,u=_=>t.getByNode(_)||n.get(_),d=(_,S)=>cv(_,S,i,s,v=>!!t.getByElement(v)),f=_=>{if(_){const S=_.lastChild;let v=(S?u(S)?.nextSibling:u(_)?.firstChild)||void 0;for(;v&&c.has(v);)v=v.nextSibling||void 0;return v?.parentNode===u(_)?v:void 0}},h=new Map(e.flatMap(_=>_.type==="Update"?[[_.next,_.prev]]:[])),m=new Set(e.flatMap(_=>{if(_.type!=="Move")return[];const S=h.get(_.node);return[t.getByNode(_.node)??(S&&t.getByNode(S))]})),p=(_,S)=>{for(let v=ky(_);v;v=ky(v)){const T=h.get(v),w=u(v)??(T&&u(T));if(w&&!c.has(w)&&!m.has(w)&&S.contains(w)){const N=d(w,S);if(N)return N;let x=w;for(;x.parentNode&&x.parentNode!==S;)x=x.parentNode;return{host:S,before:x}}}},b=_=>!!t.getByElement(_)||i(_)||s(_),C=new Set(e.flatMap(_=>_.type==="Remove"?[t.getByNode(_.node)]:[])),L=_=>!c.has(_)&&!C.has(_)&&!m.has(_),k=_=>Array.from(_.childNodes).some(S=>L(S)&&(!!t.getByElement(S)||k(S))),y=(_,S)=>{for(let v=S?S.previousSibling:_.lastChild;v;v=v.previousSibling)if(L(v)){if(t.getByElement(v))return;if(a(v))return k(v)?void 0:v}},g=(_,S,v)=>{const T=_===v?y(v,S):void 0;return T?{host:T,before:Array.from(T.childNodes).find(w=>L(w)&&i(w))}:{host:_,before:S}},E=(_,S,v)=>{const T=p(_,v);if(!T)return{host:v,before:f(S)};let w=T.before.nextSibling??void 0;for(;w&&(c.has(w)||m.has(w)||!b(w));)w=w.nextSibling??void 0;return{host:T.host,before:w}};for(const _ of e)switch(r(_),_.type){case"Add":{let{node:S,nextSibling:v}=_;const T=S.parent;if(T){const w=lv(S,n,T);if(T.type===B.ROOT)l.push(se.add(null,w,v&&u(v)));else{const N=u(T);if(N){let x,D=N;for(;v;){const P=n.get(v);if(P){const z=d(P,N);x=z?.before??P,D=z?.host??N;break}let O=t.getByNode(v);if(O&&!c.has(O)&&N.contains(O)){x=O;const z=d(O,N);if(z){D=z.host,x=z.before;break}for(;O.parentNode!==N&&O.parentNode;)O=O.parentNode,wn(O)&&O.replaceWith(...O.childNodes);break}v=Or(v)||void 0}x||({host:D,before:x}=E(S,T,N)),{host:D,before:x}=g(D,x,N),l.push(se.add(D,w,x))}else o("parent-not-mapped")}}else o("no-parent");break}case"Move":{let{node:S,nextSibling:v}=_;const T=S.parent,w=u(S);if(T&&w)if(T.type===B.ROOT)l.push(se.move(null,w,v&&u(v)));else{const N=u(T);if(N){let x,D=N;for(;v;){const P=n.get(v);if(P){const z=d(P,N);x=z?.before??P,D=z?.host??N;break}let O=t.getByNode(v);if(O&&!c.has(O)&&N.contains(O)){const z=d(O,N);if(z)D=z.host,O=z.before;else for(;O.parentNode!==N&&O.parentNode;)O=O.parentNode;O||ct("error while calculating next sibling"),x=O;break}v=Or(v)||void 0}x||({host:D,before:x}=E(S,T,N)),l.push(se.move(D,w,x))}else o("parent-not-mapped")}else o(T?"node-not-mapped":"no-parent");break}case"Remove":{const S=_.node,v=u(S);if(S.type===B.HTML&&!S.content)continue;v?(c.set(v,S),l.push(se.remove(v))):o("node-not-mapped");break}case"Update":{const S=_.prev,v=u(S);v?n.set(_.next,v):_.soft||o("node-not-mapped");break}case"Attribute":{const S=u(_.node);S?l.push(se.attribute(S,_.name,_.value)):o("node-not-mapped");break}case"Set":{const S=_.node,v=u(S);v?S.type===B.HTML&&LR(v,String(_.data??""))||sv(v)&&S.type===B.DOCTYPE?l.push(se.set(v,_.data||"")):e.push(se.remove(S),se.add(S.parent||null,S,Or(S)||void 0)):o("node-not-mapped");break}}return{mutations:l,toAdd:n,toRemove:c,isService:i}}function LR(e,t){return fo(e)?!t.includes("<")||Sn(e.parentNode)||fo(kr(t)):!1}function NR({mutations:e}){return Kb(e.flatMap(t=>t.type==="Add"?[t.node]:[]))}var xR=["src","type"];function OR({mutations:e}){const t=new Set,n=r=>{r instanceof HTMLScriptElement&&r.isConnected&&!yl(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"&&xR.includes(r.name.toLowerCase())&&n(r.node);return[...t]}function RR(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 uv(e){const t=e.ownerDocument?.getSelection();return t?.anchorNode&&e.contains(t.anchorNode)?t:null}function MR(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 Tf(e,t,n){const r=uv(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 PR(e){return!!e&&e.prev!==e.next&&e.prev.at(-1)!==e.next.at(-1)}function IR(e){return!!e&&e.next.length>e.prev.length&&e.next.endsWith(e.prev)}function Af(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=MR(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&&PR(r?.get(s))))break;return a&&i.contains(a)?{beside:a}:{text:s}}return o?{beside:o}:null}function dv(e,t,n){const r=t.parentNode;r&&e.collapse(r,[...r.childNodes].indexOf(t)+(n?1:0))}function DR(e,t,{removed:n,rewrites:r}){const o=uv(e),i=o&&Af(e,!0,n,r),s=o&&!i?Af(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 dv(o,i.beside,!0),i.beside.nodeName==="BR"?i.beside:void 0;s?.text?o.collapse(s.text,0):s&&dv(o,s.beside,!1)}}catch{}}function BR(e){const t=e.ownerDocument?.getSelection(),{anchorNode:n,anchorOffset:r}=t??{};return!!t?.isCollapsed&&n===e.parentNode&&n?.childNodes[(r??0)-1]===e}function fv(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)||IR(i.get(a)))&&(!n.has(a)||Af(a,!0,n,i)?.text)?{node:a,offset:0}:{node:e,offset:t}}function HR(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=fv(r,o??0,t),l=fv(i,s??0,t);(a.node!==r||l.node!==i)&&n.setBaseAndExtent(a.node,a.offset,l.node,l.offset)}catch{}}function mv(e,t,n){if(t?.parentNode===e)return[e,t];const r=t&&n?cv(t,e,n):void 0;return r&&e.contains(r.host)?[r.host,r.before]:[e,null]}function FR(e){const t=new Map;for(const n of e)n.type==="Set"&&n.node instanceof Text&&!Sn(n.node.parentNode)&&t.set(n.node,{prev:n.node.data,next:kr(String(n.data??"")).textContent??""});return t}function $R({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:FR(e)};HR([...a].find(f=>f.ownerDocument)?.ownerDocument,l);const c=(f,h,m)=>{if(!f)return ct("Element node not in tree");if(!(f instanceof Element))return ct("node is not HTMLEement");const p=m===void 0?void 0:jb(f,h,CR(m));if(!(h.toLowerCase()==="type"&&Q2(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[b,C]=mv(p,m,r);b.insertBefore(h,C)}break}case"Move":{const{node:h,nextSibling:m,parent:p}=f;if(p){const[b,C]=mv(p,m,r);Tf(b,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=DR(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??"");Sn(h.parentNode)?$2(h,p):RR(h,kr(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&&BR(d))try{i(d)}catch{}}var WR=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))}},qR=class{constructor(){A(this,"_map",new WR)}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 hv(e,t){for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function zR(e){let t;for(let n=e;n;n=n.parent)yf(n)&&(t=n);return t}function UR(e){return e.type==="Update"?e.prev:e.node}function jR(e,t){const n=new Map;for(const o of e){if(o.type!=="Update"||!o.soft)continue;const i=zR(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=UR(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(hv(i,l)||hv(i,c)||s&&u?.contains(s)){a=!0,o.type==="Update"&&o.next===l&&l.parent&&r.push(...se.recreate(c,l.parent,l,Or(l)||void 0));break}}a||r.push(o)}return r}var kf;(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})(kf||(kf={}));var Bl=new Set;function Rr(e,t){Bl.has(e)||(Bl.size||Promise.resolve().then(()=>Bl.clear()),Bl.add(e),j.send(ue.APPLICATION_SYNC_DRIFT,{reason:e,...t()}))}var pv=new WeakMap;function VR(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 GR(e){return{added:e,removed:[],reparented:[],reordered:[]}}function XR(e,t){let n=pv.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=VR(o),n={added:o,removed:i},pv.set(e,n)}return n}function gv(e,t){const n={};for(const[r,o]of Object.entries(t))n[r]={value:o,enumerable:!0};return Object.create(e,n)}function bv(e){return new Set((e??"").split(/\s+/).filter(Boolean))}function yv(e,t){for(let n=e;n&&!t.isMapped(n);n=n.parentNode)if(n instanceof Element&&t.isServicePanel(n))return!0;return!1}function vv(e,t){return t.isWrapper(e)||yv(e,t)}function Ev(e,t){const n=new Set(e.added.filter(r=>vv(r,t)));return{nodes:n,top:[...n].filter(r=>!r.parentNode||!n.has(r.parentNode))}}function KR(e,t){return e.flatMap(n=>Ev(n,t).top)}function YR(e,t){const n=o=>yv(o,t),r=[];return{summaries:e.map(o=>{const i=Ev(o,t);return r.push(...i.top),gv(o,{added:o.added.filter(s=>!i.nodes.has(s)),reparented:o.reparented?.filter(s=>!n(s)),reordered:o.reordered?.filter(s=>!n(s)),characterDataChanged:o.characterDataChanged?.filter(s=>!n(s)),attributeChanged:ZR(o,t,s=>vv(s,t))})}),service:r}}function ZR(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"&&QR(e,a,t)));s.length&&(r[o]=s)}return r}function QR(e,t,n){const r=bv(e.getOldAttribute(t,"class")),o=bv(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 Sv=Symbol("filterContext");function JR(e,t){t&&(e[Sv]=t)}function eM(e){return e?.[Sv]}var wv=Object.getPrototypeOf(customElements),tM=Reflect.get(wv,"define"),Lf=new pe,Nf=new pe,nM=Lf.event,rM=Nf.event,oM=["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","connectedMoveCallback","formAssociatedCallback","formResetCallback","formDisabledCallback","formStateRestoreCallback"];function iM(e){Lf.fire();try{return e()}finally{Nf.fire()}}wv.define=function(e,t,n){const r=t.prototype,o=class extends t{constructor(...i){Lf.fire();try{super(...i)}finally{Nf.fire()}}};Object.defineProperty(o,"name",{configurable:!0,value:t.name});for(const i of oM){const s=r[i];typeof s=="function"&&Object.defineProperty(o.prototype,i,{configurable:!0,writable:!0,value:function(...a){return iM(()=>s.call(this,...a))}})}tM.call(this,e,o,n)};function _v(e,t,n,r){const o=[...e.childNodes],i=t(e,r);for(const s of o)n(i,_v(s,t,n,i));return i}function Jo(e,t,n){if(t(e,n)!==!1)for(const r of[...e.childNodes])Jo(r,t,e)}var or="___em-internal";function xf(e,t=!0,n=!1){let r=e.content;switch(e.type){case B.ROOT:{const o=document.implementation.createHTMLDocument();for(const i of[...o.childNodes])o.removeChild(i);if(t)for(const i of e.children)o.appendChild(xf(i,t,n));return o}case B.DOCTYPE:return new DOMParser().parseFromString(`<!DOCTYPE${e.content}>`,"text/html").doctype;case B.COMMENT:return document.createComment(r||"");case B.ELEMENT:if(e.tag){if(n&&customElements.get(e.tag)){const i=document.createElement("div");return i.innerHTML=Fd(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(gl(i,e)?Gd(i.content||""):xf(i,t,n));return o}return document.createTextNode("<");case B.HTML:return kr(r||"");default:throw new Error("unsupported node")}}function sM(e){return rn(e).roots.map(t=>xf(t,!0,!0))}function Cv(){const e=document.implementation.createHTMLDocument();for(const t of[...e.childNodes])t.remove();return e}function aM(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 Cv();default:t=document.createElement("div")}return t}function lM(e){return"<!DOCTYPE "+e.name+(e.publicId?' PUBLIC "'+e.publicId+'"':"")+(!e.publicId&&e.systemId?" SYSTEM":"")+(e.systemId?' "'+e.systemId+'"':"")+">"}function Hl(e){if(e instanceof Element)return av(e);if(e instanceof Document)return[...e.childNodes].map(r=>Hl(r)).join("");if(e instanceof DocumentType)return lM(e);if(e instanceof DocumentFragment)return[...e.childNodes].map(r=>Hl(r)).join("");const t=ml(e);if(t!==void 0)return t;const n=document.createElement("div");return n.appendChild(e.cloneNode(!0)),n.innerHTML}function Tv(e,t=e.parentNode){return Sn(t)?Zy(e,t):Hl(e)}function cM(e,t,n){let r=1;const o=new Iy,i=new Map,s=new Map,a=new Map;let l=!1;const c=_v(e,h=>{const m=String(r++);let p;if(iv(h)||h instanceof Element&&h.hasAttribute("src")){const b=document.createElement(h.tagName);for(const{name:C,value:L}of h.attributes){const k=Vb(h,C,L);k!==null&&er(b,C==="src"?"___src":C,k)}p=b}else p=h.cloneNode(),vM(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?Cv():document.createDocumentFragment();u.appendChild(c),Jo(u,(h,m)=>{if(m){const p=a.get(h);if(Sn(m))return;if(!p)return ct("Error while mapping: not found element");h instanceof Element?h.setAttribute(or,p):m.insertBefore(document.createComment(`${or}${p}`),h)}}),JR(u,e.parentNode);let d=sM(t(u)).filter(h=>!!h),f;if(!d.length)return o;if(u instanceof Document){const h=aM("html");for(const m of d)h.appendChild(m);f=h}else{f=document.createDocumentFragment();for(const h of d)f.appendChild(h)}return Jo(f,(h,m)=>{let p=null;if(h instanceof HTMLHtmlElement)s.set("1",h);else{if(h instanceof Element&&h.hasAttribute(or)){p=h.getAttribute(or),p&&s.set(p,h);return}const b=h.previousSibling;if(b instanceof Comment&&(!(h instanceof Comment)||h.data.indexOf(or)<0)){const C=b.data,L=C.indexOf(or);L>=0&&(p=C.substring(L+14),p&&s.set(p,h))}}}),Jo(f,h=>{if(h instanceof Element&&h.hasAttribute(or)){h.removeAttribute(or);return}h instanceof Comment&&h.data.indexOf(or)>=0&&h.remove()}),Jo(e,h=>{const m=i.get(h),p=s.get(m);p&&(o.set(h,p),Sn(h)&&h.firstChild&&p.firstChild&&o.set(h.firstChild,p.firstChild))}),o}function uM(e){const t=Av(e.cloneNode()),n=Wd(t),r=n.length;return t.startTagEnd=t.startTagEnd===void 0?void 0:n.indexOf(">",Math.max(n.lastIndexOf("'"),n.lastIndexOf('"')))+1,t.endTagStart=t.endTagStart===void 0?void 0:t.endTagStart+(r-t.end),t.end=r,t.type=B.ELEMENT,t}var ei;(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})({})})(ei||(ei={}));function Av(e){if(fo(e)&&Sn(e.parentNode))return kv(Zy(e,e.parentNode));const t=ml(e);if(t!==void 0)return kv(t);let n=rn(Hl(e.cloneNode())).roots[0];return n||(n=new Lt(0,0,[]),n.type=B.HTML,n.content=""),n}function kv(e){const t=new Lt(0,e.length,[]);return t.type=B.HTML,t.content=e,t}function Lv(e,t=ei.HiddenResult.node){if(t&ei.HiddenResult.node&&(e.end=e.start=e.startTagEnd=e.endTagStart=e.end=0),t&ei.HiddenResult.children)for(const n of e.children)Lv(n,ei.HiddenResult.all)}function dM(e,t=[],n){let r;return e instanceof Element?r=uM(e):r=Av(e),r.children=t,r.parent=void 0,n&&Lv(r,n(r)),r}function Fl(e,t,n){let r=t.getByElement(e);if(r)return n?.(e)?void 0:r;for(const o of e.childNodes)if(r=Fl(o,t,n),r)return r}function Nv(e,t,n,r){Rr("tree-node-out-of-place",()=>({mutation:n()}))}function Of(e,t,n,r,o){let i=e.parentNode,s=e.nextSibling,a;const l=(c,u)=>!o||o(c,u)?!0:(Nv("insertBefore",c,()=>mR(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=Fl(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=Fl(s,t,r);if(u){a=u,s=s.nextSibling;break}s=s.nextSibling}s||(s=i.nextSibling),i=i.parentNode}}function fM(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(se.attribute(a,o,typeof l=="string"?l:void 0))}}}return n}function xv(e,t){return e.type===B.HTML?ml(t)??`<!--${t.data}-->`:t.data}function mM(e,t){const n=[],r=e.characterDataChanged;if(r)for(const o of r){const i=t.getByElement(o);i&&n.push(se.set(i,Ns(o)?xv(i,o):Tv(o)))}return n}function hM(e){return(e instanceof Element?e:e.parentElement)?.closest(".sortable-fallback")??null}function pM(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 gM(e,t,n,r){const o=c=>{let u=c.parentNode;if(!u||u===n?.node||t.getByElement(u))return!1;for(;u&&u!==n?.node&&!t.getByElement(u);u=u.parentNode)if(!r(u))return!1;return!0},i=c=>{for(let u=c;u&&u!==n?.node&&(u===c||!t.getByElement(u));u=u.parentNode)for(let d=u.previousSibling;d;d=d.previousSibling)if(Fl(d,t))return!0;return!1},s=(c,u,d)=>{for(let f=u+d;f>=0&&f<c.length;f+=d)if(t.getByNode(c[f])?.isConnected)return c[f]},a=(c,u,d,f)=>{const h=s(u,d,-1);if(!h)return!i(f);const m=Of(t.getByNode(h),t,n);return!!m&&m.parentTreeNode===c.parent&&m.nextSiblingTreeNode===c},l=new Set;for(const c of kM(e)){const u=t.getByElement(c),d=u?.parent?.children,f=u&&d?d.indexOf(u):-1;if(!u||!d||f<0||!o(c))continue;const{parentTreeNode:h,nextSiblingTreeNode:m}=Of(c,t,n)||{};h===u.parent&&m===s(d,f,1)&&a(u,d,f,c)&&l.add(c)}return l}function bM(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}=XR(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)?Nv("remove",f,()=>hR(f,t)):o.push(se.remove(f)),s.delete(f),i.add(d)}}for(const d of c){if(r.has(d)||pM(d))continue;const f=hM(d);if(f&&!t.getByElement(f))continue;const{parentTreeNode:h,nextSiblingTreeNode:m}=Of(d,t,n,p=>i.has(p),a)||{};if(h){let p=t.getByElement(d);p||(p=dM(d),t.set(p,d)),o.push(se.add(h,p,m)),s.set(p,h),i.delete(d)}}o.push(...fM(l,t)),o.push(...mM(l,t))}return o}function yM(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&&c!==s.value.replaceAll('"',"'")&&r.push(se.attribute(e,a,c))}else r.push(se.attribute(e,a,void 0))}for(const s of i){const a=s.name==="___src"?"src":s.name;o.getNamedItem(a)||r.push(se.attribute(e,a,s.value))}return r}function vM(e,t){if(!(!q2()||!(e instanceof Element)||!(t instanceof Element)))for(const{name:n,value:r}of Array.from(e.attributes)){const o=Vb(e,n,r);o===null?t.removeAttribute(n):o!==r&&er(t,n,o)}}function EM(e,t,n,r=()=>!1){const o=[],i=cM(e,n,t);return Jo(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 ct("CharacterData mapped to Element");o.push(...yM(a,s,l))}else if(l instanceof CharacterData){if(!(s instanceof CharacterData))return ct("Element mapped to CharacterData");const c=Sn(s.parentNode)&&(s.parentNode?.nodeName==="SCRIPT"||!r(s));l.data!==s.data&&!c&&o.push(se.set(a,Ns(l)?xv(a,l):Tv(l,s.parentNode)))}else if(l instanceof Document&&!(s instanceof Document))return ct("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(se.hidden(a,!0)),u=!1):o.push(se.hidden(a,!1)),u}}),o}function SM(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 wM(e){return[...new Set(e)]}function _M(e,t){return wM([...e.added,...e.reparented||[],...e.reordered||[],...Object.values(e.characterDataChanged||{}),...Object.values(e.attributeChanged||{})].flat().map(n=>SM(n,t)||n))}function CM(e,t){let n=[];for(const r of e){const o=_M(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 TM(e,t,n){const r=CM(e,t),o=AM(e);return r.flatMap(i=>EM(i,t,n,o))}function AM(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 kM(e){return e.flatMap(t=>[...t.reparented??[],...t.reordered??[]])}function LM(e,t){return gv(e,{reparented:e.reparented?.filter(n=>!t.has(n)),reordered:e.reordered?.filter(n=>!t.has(n))})}function NM(e,t,n,r,o=()=>!1){const i=gM(e,t,r,o),s=i.size?e.map(a=>LM(a,i)):e;return[...bM(e,t,r,i),...TM(s,t,n)]}function xM(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 OM=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))}},Ov=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}};function G(e){if(RM(e))return MM(e)?e.trim():PM(e)}var Rv={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},RM=e=>typeof e=="string"&&e.trim()!=="",MM=e=>Rv.HEX.test(e);function PM(e){const t=Rv.RGB.exec(e)?.groups;if(!t)return;const n=IM(t);return BM(n)}var IM=e=>({r:Rf(e.r),g:Rf(e.g),b:Rf(e.b),a:DM(e.a)}),Rf=e=>Math.min(255,parseInt(e||"0",10)),DM=e=>parseFloat(e||"1"),BM=e=>`#${Mf(e.r)}${Mf(e.g)}${Mf(e.b)}`,Mf=e=>e.toString(16).padStart(2,"0");function Mv(e){return e.replaceAll(/rgb\(\d{1,3}(,\s?\d{1,3}){2}\)/gi,t=>G(t)||t)}var Pv=new Ov(1e3);function ti(e){if(e=e?.trim(),e){let t=Pv.get(e);return t||(t=new Set(e.split(" ").filter(n=>!!n).map(n=>n)),Pv.put(e,t)),t}else return new Set}function $l(e){e||(e="");const t=document.createElement("div");return t.setAttribute("style",e),t.style}var Iv=new Ov(1e3);function ir(e){e||(e="");let t=Iv.get(e);return t||(t=$l(e),Iv.put(e,t)),t}function ni(e){return Array.from({length:e.length},(t,n)=>e.item(n))}function Pf(e){return[...new Set(Array.from(e.matchAll(/(?:^|;)\s*([-\w]+)\s*:/g),t=>t[1].toLowerCase()))].sort()}function HM(e,t,n,r){const o=ir(n),i=Pf(n),s=new Set(Pf(r)),a=Pf(e).filter(c=>i.includes(c)||!s.has(c)),l=ni(t);return l.length===o.length&&l.every(c=>t.getPropertyValue(c)===o.getPropertyValue(c)&&t.getPropertyPriority(c)===o.getPropertyPriority(c))&&a.join(";")===i.join(";")}function Dv(e,t,n){const r=t.getPropertyValue(n);r?e.setProperty(n,r,t.getPropertyPriority(n)):e.removeProperty(n)}function FM(e,t,n){const r=e?e.split(" "):[],o=ti(n),i=ti(t),s=r.filter(a=>(a=a.trim(),o.has(a)?i.has(a):!0));return s.length===r.length?e:s.join(" ")}function $M(e,t,n,r){const o=$l(e),i=ir(n),s=ir(t);let a=!1;for(const l of ni(i)){const c=i.getPropertyValue(l);o.getPropertyValue(l)===c&&s.getPropertyValue(l)!==c&&(a=!0,Dv(o,s,l))}for(const l of r??[])o.getPropertyValue(l)?r?.delete(l):s.getPropertyValue(l)&&(a=!0,Dv(o,s,l));return typeof t=="string"&&typeof e=="string"&&HM(e,o,t,n??"")?t:a?Mv(o.cssText):e}function Bv(e,t,n,r,o){return e==="style"&&(typeof r=="string"||o?.size)?$M(t,n,r,o)||null:typeof r!="string"?t:e==="class"?FM(t,n,r)||null:n!==t&&t===r?null:t}function WM(e,t){const n=ti(e),r=ti(t);for(const o of r)n.has(o)||(e=e?`${e.trimEnd()} ${o}`:o);return e}function qM(e,t){const n=$l(e),r=ir(t);let o=!1;for(const i of ni(r)){const s=r.getPropertyValue(i);n.getPropertyValue(i)!==s&&(o=!0,n.setProperty(i,s))}return o?n.cssText:e}function zM(e,t,n){return typeof n!="string"?t:e==="class"?WM(t,n)||null:e==="style"?qM(t,n)||null:t}function UM(e,t,n){if(!t)return t;const r=ti(e),o=ti(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 jM(e,t,n){if(!t)return t;const r=ir(e),o=$l(t),i=ir(n);let s=!1;for(const a of ni(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 VM(e,t){const n=ir(t);return ni(ir(e)).filter(r=>!n.getPropertyValue(r))}function Hv(e){return e.type===B.ELEMENT&&e.start!==e.end}function Fv(e){return e.filter(t=>t.type===B.ELEMENT)}function GM(e,t,n){const r=Fv(e),o=Fv(t),i=[],s=new Set,a=new Set,l=u=>{const d=(h,m)=>{const p=new Map;for(const b of h){const C=m.has(b)?void 0:u(b);C!==void 0&&p.set(C,p.has(C)?null:b)}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,b)=>i.push([f[b],p,m]))}}return i}var XM=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}},KM=class{constructor(e){A(this,"_nodeMap",void 0),A(this,"_map",new OM),A(this,"_removedStyles",new WeakMap),A(this,"_hiddenMutations",[]),A(this,"_restore",[]),this._nodeMap=e}_trackRemovedStyles(e,t,n){const r=this._removedStyles.get(e)??new Set;VM(t,n).forEach(o=>r.add(o)),ni(ir(n)).forEach(o=>r.delete(o)),r.size?this._removedStyles.set(e,r):this._removedStyles.delete(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=UM(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=jM(n,r,this._map.getAttribute(o,e))||null;i===null?this._map.removeAttribute(o,e):this._map.setAttribute(o,e,i),this._trackRemovedStyles(o,n,r)}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 XM(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=r==="style"&&i?this._removedStyles.get(o):void 0,a=Bv(r,i,o.attributes?.[r]||null,this._map.getAttribute(o,r),s);if(s&&!s.size&&this._removedStyles.delete(o),a!==i){t.push(se.attribute(o,r,a));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=Bv(i,s,null,a);l!==s&&t.push(se.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=zM(r,i,this._map.getAttribute(o,r));if(s!==i){t.push(se.attribute(o,r,s));continue}}else if(n.type==="Update"){this._map.replaceNode(n.prev,n.next);const r=this._removedStyles.get(n.prev);r&&(this._removedStyles.delete(n.prev),this._removedStyles.set(n.next,r))}else n.type==="Add"&&n.replaces&&this._carryHidden(n.replaces,n.node,!0,$d());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&&!uf(t.tag)&&o){const i=[];for(const[s,a]of Object.entries(o))PO(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(Hv);e.children.filter(Hv).forEach((s,a)=>{i[a]&&this._carryHidden(s,i[a],!0,r)});return}for(const[i,s,a]of GM(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)}}}},YM=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)}},$v="foreign-structure-in-commit";function ZM(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 Wl(e){if(!(e instanceof Element))return{tag:e.nodeName.toLowerCase()};const t=e.getAttribute("class");return{tag:e.tagName.toLowerCase(),...t?{class:t}:{}}}var Wv="implicit-tbody-in-canvas";function QM(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 JM(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:Wl(n),parent:n.parentNode?Wl(n.parentNode):void 0};t.add(Wv),Rr(Wv,()=>({foreign:r}))}function eP(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:Wl(n.node),parent:n.node.parentNode?Wl(n.node.parentNode):void 0};t.has("foreign-structure-in-commit")||(t.add($v),Rr($v,()=>({foreign:o})))}var If="unaccounted-node";function qv(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 zv(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 qv(e,t,n,r||t.roots.has(e))}function Uv(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=qv(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 tP(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 nP(e,t){const n=new Set;for(const r of e)r.isConnected&&zv(r,t)==="unaccounted"&&n.add(r);return[...n].filter(r=>!r.parentNode||!n.has(r.parentNode))}function rP(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 jv(e){const t=[];for(let o=e;o&&o.nodeType!==Node.DOCUMENT_NODE;o=o.parentNode)t.unshift(rP(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 Vv(e,t){if(!e.length)return;const n={count:e.length,node:jv(e[0])};t.has(If)||(t.add(If),Rr(If,()=>({unaccounted:n})))}var oP=Ar(((e,t)=>{(function(n,r){typeof e=="object"&&typeof t<"u"?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.MutationSummary={}))})(e,(function(n){"use strict";var r=(function(){function y(){this._nodes=[],this._values=[]}return y._isIndex=function(g){return+g===g>>>0},y._nodeId=function(g){var E=g[y._ID_PROP];return E||(E=g[y._ID_PROP]=y._NEXT_ID++),E},y.prototype.set=function(g,E){var _=y._nodeId(g);this._nodes[_]=g,this._values[_]=E},y.prototype.get=function(g){var E=y._nodeId(g);return E!==void 0?this._values[E]:void 0},y.prototype.has=function(g){return y._nodeId(g)in this._nodes},y.prototype.delete=function(g){var E=y._nodeId(g);delete this._nodes[E],this._values[E]=void 0},y.prototype.keys=function(){var g=[];for(var E in this._nodes)y._isIndex(E)&&g.push(this._nodes[E]);return g},y._ID_PROP="__mutation_summary_node_map_id__",y._NEXT_ID=1,y})(),o=(function(){function y(){this.added=new r,this.removed=new r,this.maybeMoved=new r,this.oldPrevious=new r,this.moved=void 0}return y})();n.Movement=void 0,(function(y){y[y.STAYED_OUT=0]="STAYED_OUT",y[y.ENTERED=1]="ENTERED",y[y.STAYED_IN=2]="STAYED_IN",y[y.REPARENTED=3]="REPARENTED",y[y.REORDERED=4]="REORDERED",y[y.EXITED=5]="EXITED"})(n.Movement||(n.Movement={}));var i=function(y,g){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,_){E.__proto__=_}||function(E,_){for(var S in _)Object.prototype.hasOwnProperty.call(_,S)&&(E[S]=_[S])},i(y,g)};function s(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");i(y,g);function E(){this.constructor=y}y.prototype=g===null?Object.create(g):(E.prototype=g.prototype,new E)}var a=(function(){function y(g,E,_,S,v,T,w,N){E===void 0&&(E=!1),_===void 0&&(_=!1),S===void 0&&(S=!1),v===void 0&&(v=null),T===void 0&&(T=!1),w===void 0&&(w=null),N===void 0&&(N=null),this.node=g,this.childList=E,this.attributes=_,this.characterData=S,this.oldParentNode=v,this.added=T,this.attributeOldValues=w,this.characterDataOldValue=N,this.isCaseInsensitive=this.node.nodeType===Node.ELEMENT_NODE&&this.node instanceof HTMLElement&&this.node.ownerDocument instanceof HTMLDocument}return y.prototype.getAttributeOldValue=function(g){if(this.attributeOldValues)return this.isCaseInsensitive&&(g=g.toLowerCase()),this.attributeOldValues[g]},y.prototype.getAttributeNamesMutated=function(){var g=[];if(!this.attributeOldValues)return g;for(var E in this.attributeOldValues)this.attributeOldValues.hasOwnProperty(E)&&g.push(E);return g},y.prototype.attributeMutated=function(g,E){this.attributes=!0,this.attributeOldValues=this.attributeOldValues||{},!(g in this.attributeOldValues)&&(this.attributeOldValues[g]=E)},y.prototype.characterDataMutated=function(g){this.characterData||(this.characterData=!0,this.characterDataOldValue=g)},y.prototype.removedFromParent=function(g){this.childList=!0,this.added||this.oldParentNode?this.added=!1:this.oldParentNode=g},y.prototype.insertedIntoParent=function(){this.childList=!0,this.added=!0},y.prototype.getOldParent=function(){if(this.childList){if(this.oldParentNode)return this.oldParentNode;if(this.added)return null}return this.node.parentNode},y})(),l=(function(y){s(g,y);function g(E,_){var S=y.call(this)||this;S.rootNode=E,S.reachableCache=void 0,S.wasReachableCache=void 0,S.anyParentsChanged=!1,S.anyAttributesChanged=!1,S.anyCharacterDataChanged=!1;for(var v=0;v<_.length;v++){var T=_[v];switch(T.type){case"childList":S.anyParentsChanged=!0;for(var w=0;w<T.removedNodes.length;w++){var N=T.removedNodes[w];S.getChange(N).removedFromParent(T.target)}for(var w=0;w<T.addedNodes.length;w++){var N=T.addedNodes[w];S.getChange(N).insertedIntoParent()}break;case"attributes":S.anyAttributesChanged=!0;var x=S.getChange(T.target);x.attributeMutated(T.attributeName,T.oldValue);break;case"characterData":S.anyCharacterDataChanged=!0;var x=S.getChange(T.target);x.characterDataMutated(T.oldValue)}}return S}return g.prototype.getChange=function(E){var _=this.get(E);return _||(_=new a(E),this.set(E,_)),_},g.prototype.getOldParent=function(E){var _=this.get(E);return _?_.getOldParent():E.parentNode},g.prototype.getIsReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.reachableCache=this.reachableCache||new r;var _=this.reachableCache.get(E);return _===void 0&&(_=this.getIsReachable(E.parentNode),this.reachableCache.set(E,_)),_},g.prototype.getWasReachable=function(E){if(E===this.rootNode)return!0;if(!E)return!1;this.wasReachableCache=this.wasReachableCache||new r;var _=this.wasReachableCache.get(E);return _===void 0&&(_=this.getWasReachable(this.getOldParent(E)),this.wasReachableCache.set(E,_)),_},g.prototype.reachabilityChange=function(E){return this.getIsReachable(E)?this.getWasReachable(E)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.getWasReachable(E)?n.Movement.EXITED:n.Movement.STAYED_OUT},g})(r),c=(function(){function y(g,E,_,S,v){this.rootNode=g,this.mutations=E,this.selectors=_,this.calcReordered=S,this.calcOldPreviousSibling=v,this.treeChanges=new l(g,E),this.entered=[],this.exited=[],this.stayedIn=new r,this.visited=new r,this.childListChangeMap=void 0,this.characterDataOnly=void 0,this.matchCache=void 0,this.processMutations()}return y.prototype.processMutations=function(){if(!(!this.treeChanges.anyParentsChanged&&!this.treeChanges.anyAttributesChanged))for(var g=this.treeChanges.keys(),E=0;E<g.length;E++)this.visitNode(g[E],void 0)},y.prototype.visitNode=function(g,E){if(!this.visited.has(g)){this.visited.set(g,!0);var _=this.treeChanges.get(g),S=E;if((_&&_.childList||S==null)&&(S=this.treeChanges.reachabilityChange(g)),S!==n.Movement.STAYED_OUT){if(this.matchabilityChange(g),S===n.Movement.ENTERED)this.entered.push(g);else if(S===n.Movement.EXITED)this.exited.push(g),this.ensureHasOldPreviousSiblingIfNeeded(g);else if(S===n.Movement.STAYED_IN){var v=n.Movement.STAYED_IN;_&&_.childList&&(_.oldParentNode!==g.parentNode?(v=n.Movement.REPARENTED,this.ensureHasOldPreviousSiblingIfNeeded(g)):this.calcReordered&&this.wasReordered(g)&&(v=n.Movement.REORDERED)),this.stayedIn.set(g,v)}if(S!==n.Movement.STAYED_IN)for(var T=g.firstChild;T;T=T.nextSibling)this.visitNode(T,S)}}},y.prototype.ensureHasOldPreviousSiblingIfNeeded=function(g){if(this.calcOldPreviousSibling){this.processChildlistChanges();var E=g.parentNode,_=this.treeChanges.get(g);_&&_.oldParentNode&&(E=_.oldParentNode);var S=this.childListChangeMap.get(E);S||(S=new o,this.childListChangeMap.set(E,S)),S.oldPrevious.has(g)||S.oldPrevious.set(g,g.previousSibling)}},y.prototype.getChanged=function(g,E,_){this.selectors=E,this.characterDataOnly=_;for(var S=0;S<this.entered.length;S++){var v=this.entered[S],T=this.matchabilityChange(v);(T===n.Movement.ENTERED||T===n.Movement.STAYED_IN)&&g.added.push(v)}for(var w=this.stayedIn.keys(),S=0;S<w.length;S++){var v=w[S],T=this.matchabilityChange(v);if(T===n.Movement.ENTERED)g.added.push(v);else if(T===n.Movement.EXITED)g.removed.push(v);else if(T===n.Movement.STAYED_IN&&(g.reparented||g.reordered)){var N=this.stayedIn.get(v);g.reparented&&N===n.Movement.REPARENTED?g.reparented.push(v):g.reordered&&N===n.Movement.REORDERED&&g.reordered.push(v)}}for(var S=0;S<this.exited.length;S++){var v=this.exited[S],T=this.matchabilityChange(v);(T===n.Movement.EXITED||T===n.Movement.STAYED_IN)&&g.removed.push(v)}},y.prototype.getOldParentNode=function(g){var E=this.treeChanges.get(g);if(E&&E.childList)return E.oldParentNode?E.oldParentNode:null;var _=this.treeChanges.reachabilityChange(g);if(_===n.Movement.STAYED_OUT||_===n.Movement.ENTERED)throw Error("getOldParentNode requested on invalid node.");return g.parentNode},y.prototype.getOldPreviousSibling=function(g){var E=g.parentNode,_=this.treeChanges.get(g);_&&_.oldParentNode&&(E=_.oldParentNode);var S=this.childListChangeMap.get(E);if(!S)throw Error("getOldPreviousSibling requested on invalid node.");return S.oldPrevious.get(g)},y.prototype.getOldAttribute=function(g,E){var _=this.treeChanges.get(g);if(!_||!_.attributes)throw Error("getOldAttribute requested on invalid node.");var S=_.getAttributeOldValue(E);if(S===void 0)throw Error("getOldAttribute requested for unchanged attribute name.");return S},y.prototype.attributeChangedNodes=function(g){if(!this.treeChanges.anyAttributesChanged)return{};var E,_;if(g){E={},_={};for(var S=0;S<g.length;S++){var v=g[S];E[v]=!0,_[v.toLowerCase()]=v}}for(var T={},w=this.treeChanges.keys(),S=0;S<w.length;S++){var N=w[S],x=this.treeChanges.get(N);if(x.attributes&&!(n.Movement.STAYED_IN!==this.treeChanges.reachabilityChange(N)||n.Movement.STAYED_IN!==this.matchabilityChange(N)))for(var D=N,P=x.getAttributeNamesMutated(),O=0;O<P.length;O++){var v=P[O];E&&!E[v]&&!(x.isCaseInsensitive&&_[v])||x.getAttributeOldValue(v)!==D.getAttribute(v)&&(_&&x.isCaseInsensitive&&(v=_[v]),T[v]=T[v]||[],T[v].push(D))}}return T},y.prototype.getOldCharacterData=function(g){var E=this.treeChanges.get(g);if(!E||!E.characterData)throw Error("getOldCharacterData requested on invalid node.");return E.characterDataOldValue},y.prototype.getCharacterDataChanged=function(){if(!this.treeChanges.anyCharacterDataChanged)return[];for(var g=this.treeChanges.keys(),E=[],_=0;_<g.length;_++){var S=g[_];if(n.Movement.STAYED_IN===this.treeChanges.reachabilityChange(S)){var v=this.treeChanges.get(S);!v.characterData||S.textContent==v.characterDataOldValue||E.push(S)}}return E},y.prototype.computeMatchabilityChange=function(g,E){this.matchCache||(this.matchCache=[]),this.matchCache[g.uid]||(this.matchCache[g.uid]=new r);var _=this.matchCache[g.uid],S=_.get(E);return S===void 0&&(S=g.matchabilityChange(E,this.treeChanges.get(E)),_.set(E,S)),S},y.prototype.matchabilityChange=function(g){var E=this;if(this.characterDataOnly)switch(g.nodeType){case Node.COMMENT_NODE:case Node.TEXT_NODE:return n.Movement.STAYED_IN;default:return n.Movement.STAYED_OUT}if(!this.selectors)return n.Movement.STAYED_IN;if(g.nodeType!==Node.ELEMENT_NODE)return n.Movement.STAYED_OUT;for(var _=g,S=this.selectors.map(function(w){return E.computeMatchabilityChange(w,_)}),v=n.Movement.STAYED_OUT,T=0;v!==n.Movement.STAYED_IN&&T<S.length;){switch(S[T]){case n.Movement.STAYED_IN:v=n.Movement.STAYED_IN;break;case n.Movement.ENTERED:v===n.Movement.EXITED?v=n.Movement.STAYED_IN:v=n.Movement.ENTERED;break;case n.Movement.EXITED:v===n.Movement.ENTERED?v=n.Movement.STAYED_IN:v=n.Movement.EXITED}T++}return v},y.prototype.getChildlistChange=function(g){var E=this.childListChangeMap.get(g);return E||(E=new o,this.childListChangeMap.set(g,E)),E},y.prototype.processChildlistChanges=function(){if(!this.childListChangeMap){this.childListChangeMap=new r;for(var g=function(S){var v=E.mutations[S];if(v.type!="childList"||E.treeChanges.reachabilityChange(v.target)!==n.Movement.STAYED_IN&&!E.calcOldPreviousSibling)return"continue";for(var T=E.getChildlistChange(v.target),w=v.previousSibling,N=function(P,O){!P||T.oldPrevious.has(P)||T.added.has(P)||T.maybeMoved.has(P)||O&&(T.added.has(O)||T.maybeMoved.has(O))||T.oldPrevious.set(P,O)},x=0;x<v.removedNodes.length;x++){var D=v.removedNodes[x];N(D,w),T.added.has(D)?T.added.delete(D):(T.removed.set(D,!0),T.maybeMoved.delete(D)),w=D}N(v.nextSibling,w);for(var x=0;x<v.addedNodes.length;x++){var D=v.addedNodes[x];T.removed.has(D)?(T.removed.delete(D),T.maybeMoved.set(D,!0)):T.added.set(D,!0)}},E=this,_=0;_<this.mutations.length;_++)g(_)}},y.prototype.wasReordered=function(g){if(!this.treeChanges.anyParentsChanged)return!1;this.processChildlistChanges();var E=g.parentNode,_=this.treeChanges.get(g);_&&_.oldParentNode&&(E=_.oldParentNode);var S=this.childListChangeMap.get(E);if(!S)return!1;if(S.moved)return S.moved.get(g);S.moved=new r;var v=new r;function T(P){if(!P||!S.maybeMoved.has(P))return!1;var O=S.moved.get(P);return O!==void 0||(v.has(P)?O=!0:(v.set(P,!0),O=D(P)!==N(P)),v.has(P)?(v.delete(P),S.moved.set(P,O)):O=S.moved.get(P)),O}var w=new r;function N(P){var O=w.get(P);if(O!==void 0)return O;for(O=S.oldPrevious.get(P);O&&(S.removed.has(O)||T(O));)O=N(O);return O===void 0&&(O=P.previousSibling),w.set(P,O),O}var x=new r;function D(P){if(x.has(P))return x.get(P);for(var O=P.previousSibling;O&&(S.added.has(O)||T(O));)O=O.previousSibling;return x.set(P,O),O}return S.maybeMoved.keys().forEach(T),S.moved.get(g)},y})(),u=(function(){function y(g,E){var _=this;if(this.projection=g,this.added=[],this.removed=[],this.reparented=E.all||E.element||E.characterData?[]:void 0,this.reordered=E.all?[]:void 0,g.getChanged(this,E.elementFilter,E.characterData),E.all||E.attribute||E.attributeList){var S=E.attribute?[E.attribute]:E.attributeList,v=g.attributeChangedNodes(S);E.attribute?this.valueChanged=v[E.attribute]||[]:(this.attributeChanged=v,E.attributeList&&E.attributeList.forEach(function(w){_.attributeChanged.hasOwnProperty(w)||(_.attributeChanged[w]=[])}))}if(E.all||E.characterData){var T=g.getCharacterDataChanged();E.characterData?this.valueChanged=T:this.characterDataChanged=T}this.reordered&&(this.getOldPreviousSibling=g.getOldPreviousSibling.bind(g))}return y.prototype.getOldParentNode=function(g){return this.projection.getOldParentNode(g)},y.prototype.getOldAttribute=function(g,E){return this.projection.getOldAttribute(g,E)},y.prototype.getOldCharacterData=function(g){return this.projection.getOldCharacterData(g)},y.prototype.getOldPreviousSibling=function(g){return this.projection.getOldPreviousSibling(g)},y})(),d=(function(){function y(){}return y.prototype.matches=function(g){if(g===null)return!1;if(this.attrValue===void 0)return!0;if(!this.contains)return this.attrValue==g;for(var E=g.split(" "),_=0;_<E.length;_++)if(this.attrValue===E[_])return!0;return!1},y.prototype.toString=function(){return this.attrName==="class"&&this.contains?"."+this.attrValue:this.attrName==="id"&&!this.contains?"#"+this.attrValue:this.contains?"["+this.attrName+"~="+f(this.attrValue)+"]":"attrValue"in this?"["+this.attrName+"="+f(this.attrValue)+"]":"["+this.attrName+"]"},y})();function f(y){return'"'+y.replace(/"/,'\\"')+'"'}var h=/[a-zA-Z_]+/,m=/[a-zA-Z0-9_\-]+/,p=(function(){function y(){this.uid=y.nextUid++,this.qualifiers=[]}return Object.defineProperty(y.prototype,"caseInsensitiveTagName",{get:function(){return this.tagName.toUpperCase()},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selectorString",{get:function(){return this.tagName+this.qualifiers.join("")},enumerable:!1,configurable:!0}),y.prototype.isMatching=function(g){return g[y.matchesSelector](this.selectorString)},y.prototype.wasMatching=function(g,E,_){if(!E||!E.attributes)return _;var S=E.isCaseInsensitive?this.caseInsensitiveTagName:this.tagName;if(S!=="*"&&S!==g.tagName)return!1;for(var v=[],T=!1,w=0;w<this.qualifiers.length;w++){var N=this.qualifiers[w],x=E.getAttributeOldValue(N.attrName);v.push(x),T=T||x!==void 0}if(!T)return _;for(var w=0;w<this.qualifiers.length;w++){var N=this.qualifiers[w],x=v[w];if(x===void 0&&(x=g.getAttribute(N.attrName)),!N.matches(x))return!1}return!0},y.prototype.matchabilityChange=function(g,E){var _=this.isMatching(g);return _?this.wasMatching(g,E,_)?n.Movement.STAYED_IN:n.Movement.ENTERED:this.wasMatching(g,E,_)?n.Movement.EXITED:n.Movement.STAYED_OUT},y.parseSelectors=function(g){var E=[],_,S;function v(){_&&(S&&(_.qualifiers.push(S),S=void 0),E.push(_)),_=new y}function T(){S&&_.qualifiers.push(S),S=new d}for(var w=/\s/,N=void 0,x="Invalid or unsupported selector syntax.",D=1,P=2,O=3,z=4,he=5,oe=6,Re=7,J=8,U=9,Et=10,le=11,Te=12,rt=13,kt=14,ee=D,ce=0;ce<g.length;){var M=g[ce++];switch(ee){case D:if(M.match(h)){v(),_.tagName=M,ee=P;break}if(M=="*"){v(),_.tagName="*",ee=O;break}if(M=="."){v(),T(),_.tagName="*",S.attrName="class",S.contains=!0,ee=z;break}if(M=="#"){v(),T(),_.tagName="*",S.attrName="id",ee=z;break}if(M=="["){v(),T(),_.tagName="*",S.attrName="",ee=oe;break}if(M.match(w))break;throw Error(x);case P:if(M.match(m)){_.tagName+=M;break}if(M=="."){T(),S.attrName="class",S.contains=!0,ee=z;break}if(M=="#"){T(),S.attrName="id",ee=z;break}if(M=="["){T(),S.attrName="",ee=oe;break}if(M.match(w)){ee=kt;break}if(M==","){ee=D;break}throw Error(x);case O:if(M=="."){T(),S.attrName="class",S.contains=!0,ee=z;break}if(M=="#"){T(),S.attrName="id",ee=z;break}if(M=="["){T(),S.attrName="",ee=oe;break}if(M.match(w)){ee=kt;break}if(M==","){ee=D;break}throw Error(x);case z:if(M.match(h)){S.attrValue=M,ee=he;break}throw Error(x);case he:if(M.match(m)){S.attrValue+=M;break}if(M=="."){T(),S.attrName="class",S.contains=!0,ee=z;break}if(M=="#"){T(),S.attrName="id",ee=z;break}if(M=="["){T(),ee=oe;break}if(M.match(w)){ee=kt;break}if(M==","){ee=D;break}throw Error(x);case oe:if(M.match(h)){S.attrName=M,ee=Re;break}if(M.match(w))break;throw Error(x);case Re:if(M.match(m)){S.attrName+=M;break}if(M.match(w)){ee=J;break}if(M=="~"){S.contains=!0,ee=U;break}if(M=="="){S.attrValue="",ee=le;break}if(M=="]"){ee=O;break}throw Error(x);case J:if(M=="~"){S.contains=!0,ee=U;break}if(M=="="){S.attrValue="",ee=le;break}if(M=="]"){ee=O;break}if(M.match(w))break;throw Error(x);case U:if(M=="="){S.attrValue="",ee=le;break}throw Error(x);case Et:if(M=="]"){ee=O;break}if(M.match(w))break;throw Error(x);case le:if(M.match(w))break;if(M=='"'||M=="'"){N=M,ee=rt;break}S.attrValue+=M,ee=Te;break;case Te:if(M.match(w)){ee=Et;break}if(M=="]"){ee=O;break}if(M=="'"||M=='"')throw Error(x);S.attrValue+=M;break;case rt:if(M==N){ee=Et;break}S.attrValue+=M;break;case kt:if(M.match(w))break;if(M==","){ee=D;break}throw Error(x)}}switch(ee){case D:case P:case O:case he:case kt:v();break;default:throw Error(x)}if(!E.length)throw Error(x);return E},y.nextUid=1,y.matchesSelector="matches",y})(),b=(function(){function y(){}return y.createObserverOptions=function(g){var E={childList:!0,subtree:!0},_;function S(v){if(!(E.attributes&&!_)){if(E.attributes=!0,E.attributeOldValue=!0,!v){_=void 0;return}_=_||{},v.forEach(function(T){_[T]=!0,_[T.toLowerCase()]=!0})}}return g.forEach(function(v){if(v.characterData){E.characterData=!0,E.characterDataOldValue=!0;return}if(v.all){S(),E.characterData=!0,E.characterDataOldValue=!0;return}if(v.attribute){S([v.attribute.trim()]);return}var T=y._elementFilterAttributes(v.elementFilter).concat(v.attributeList||[]);T.length&&S(T)}),_&&(E.attributeFilter=Object.keys(_)),E},y.validateOptions=function(g){for(var E in g)if(!(E in y._optionKeys))throw Error("Invalid option: "+E);if(typeof g.callback!="function")throw Error("Invalid options: callback is required and must be a function");if(!g.queries||!g.queries.length)throw Error("Invalid options: queries must contain at least one query request object.");for(var _={callback:g.callback,rootNode:g.rootNode||document,observeOwnChanges:!!g.observeOwnChanges,oldPreviousSibling:!!g.oldPreviousSibling,queries:[]},S=0;S<g.queries.length;S++){var v=g.queries[S];if(v.all){if(Object.keys(v).length>1)throw Error("Invalid request option. all has no options.");_.queries.push({all:!0});continue}if("attribute"in v){var T={attribute:y._validateAttribute(v.attribute)};if(T.elementFilter=p.parseSelectors("*["+T.attribute+"]"),Object.keys(v).length>1)throw Error("Invalid request option. attribute has no options.");_.queries.push(T);continue}if("element"in v){var w=Object.keys(v).length,T={element:v.element,elementFilter:p.parseSelectors(v.element)};if(v.hasOwnProperty("elementAttributes")&&(T.attributeList=y._validateElementAttributes(v.elementAttributes),w--),w>1)throw Error("Invalid request option. element only allows elementAttributes option.");_.queries.push(T);continue}if(v.characterData){if(Object.keys(v).length>1)throw Error("Invalid request option. characterData has no options.");_.queries.push({characterData:!0});continue}throw Error("Invalid request option. Unknown query request.")}return _},y._validateElementAttributes=function(g){if(!g.trim().length)throw Error("Invalid request option: elementAttributes must contain at least one attribute.");for(var E={},_={},S=g.split(/\s+/),v=0;v<S.length;v++){var T=S[v];if(T){T=y._validateAttribute(T);var w=T.toLowerCase();if(E[w])throw Error("Invalid request option: observing multiple case variations of the same attribute is not supported.");_[T]=!0,E[w]=!0}}return Object.keys(_)},y._elementFilterAttributes=function(g){var E={};return g.forEach(function(_){_.qualifiers.forEach(function(S){E[S.attrName]=!0})}),Object.keys(E)},y._validateAttribute=function(g){if(typeof g!="string"||(g=g.trim(),!g))throw Error("Invalid request option. attribute must be a non-zero length string.");if(!g.match(y._attributeFilterPattern))throw Error("Invalid request option. invalid attribute name: "+g);return g},y._attributeFilterPattern=/^([a-zA-Z:_]+[a-zA-Z0-9_\-:.]*)$/,y._optionKeys={callback:!0,queries:!0,rootNode:!0,oldPreviousSibling:!0,observeOwnChanges:!0},y})(),C=(function(){function y(g){var E=this;this._connected=!1,this._options=b.validateOptions(g),this._observerOptions=b.createObserverOptions(this._options.queries),this._root=this._options.rootNode,this._callback=this._options.callback,this._elementFilter=Array.prototype.concat.apply([],this._options.queries.map(function(_){return _.elementFilter?_.elementFilter:[]})),this._elementFilter.length||(this._elementFilter=void 0),this._calcReordered=this._options.queries.some(function(_){return _.all}),this._queryValidators=[],y.createQueryValidator&&(this._queryValidators=this._options.queries.map(function(_){return y.createQueryValidator(E._root,_)})),this._observer=new MutationObserver(function(_){E._observerCallback(_)}),this.reconnect()}return y.prototype.reconnect=function(){if(this._connected)throw Error("Already connected");this._observer.observe(this._root,this._observerOptions),this._connected=!0,this._checkpointQueryValidators()},y.prototype.takeSummaries=function(){if(!this._connected)throw Error("Not connected");var g=this._createSummaries(this._observer.takeRecords());return this._changesToReport(g)?g:void 0},y.prototype.disconnect=function(){var g=this.takeSummaries();return this._observer.disconnect(),this._connected=!1,g},y.prototype._observerCallback=function(g){this._options.observeOwnChanges||this._observer.disconnect();var E=this._createSummaries(g);this._runQueryValidators(E),this._options.observeOwnChanges&&this._checkpointQueryValidators(),this._changesToReport(E)&&this._callback(E),!this._options.observeOwnChanges&&this._connected&&(this._checkpointQueryValidators(),this._observer.observe(this._root,this._observerOptions))},y.prototype._createSummaries=function(g){if(!g||!g.length)return[];for(var E=new c(this._root,g,this._elementFilter,this._calcReordered,this._options.oldPreviousSibling),_=[],S=0;S<this._options.queries.length;S++)_.push(new u(E,this._options.queries[S]));return _},y.prototype._checkpointQueryValidators=function(){this._queryValidators.forEach(function(g){g&&g.recordPreviousState()})},y.prototype._runQueryValidators=function(g){this._queryValidators.forEach(function(E,_){E&&E.validate(g[_])})},y.prototype._changesToReport=function(g){return g.some(function(E){return!!(["added","removed","reordered","reparented","valueChanged","characterDataChanged"].some(function(_){return E[_]&&E[_].length})||E.attributeChanged&&Object.keys(E.attributeChanged).some(function(_){return!!E.attributeChanged[_].length}))})},y})(),L=(function(){function y(g,E){this.root=g,this.delegate=E,this.idMap={}}return y.prototype.initialize=function(g,E){this.idMap[g]=this.root;for(var _=0;_<E.length;_++)this.deserializeNode(E[_],this.root)},y.prototype.applyChanged=function(g,E,_,S){var v=this;E.forEach(function(T){var w=v.deserializeNode(T);v.deserializeNode(T.parentNode),v.deserializeNode(T.previousSibling),w.parentNode&&w.parentNode.removeChild(w)}),g.forEach(function(T){var w=v.deserializeNode(T);w.parentNode&&w.parentNode.removeChild(w)}),E.forEach(function(T){var w=v.deserializeNode(T),N=v.deserializeNode(T.parentNode),x=v.deserializeNode(T.previousSibling);N.insertBefore(w,x?x.nextSibling:N.firstChild)}),_.forEach(function(T){var w=v.deserializeNode(T);Object.keys(T.attributes).forEach(function(N){var x=T.attributes[N];x===null?w.removeAttribute(N):(!v.delegate||!v.delegate.setAttribute||!v.delegate.setAttribute(w,N,x))&&w.setAttribute(N,x)})}),S.forEach(function(T){var w=v.deserializeNode(T);w.textContent=T.textContent}),g.forEach(function(T){delete v.idMap[T.id]})},y.prototype.deserializeNode=function(g,E){var _=this;if(g===null)return null;var S=this.idMap[g.id];if(S)return S;var v=this.root.ownerDocument;switch(v===null&&(v=this.root),g.nodeType){case Node.COMMENT_NODE:S=v.createComment(g.textContent);break;case Node.TEXT_NODE:S=v.createTextNode(g.textContent);break;case Node.DOCUMENT_TYPE_NODE:S=v.implementation.createDocumentType(g.name,g.publicId,g.systemId);break;case Node.ELEMENT_NODE:this.delegate&&this.delegate.createElement&&(S=this.delegate.createElement(g.tagName)),S||(S=v.createElement(g.tagName)),Object.keys(g.attributes).forEach(function(w){(!_.delegate||!_.delegate.setAttribute||!_.delegate.setAttribute(S,w,g.attributes[w]))&&S.setAttribute(w,g.attributes[w])});break;default:throw"Unsupported node type: "+g.nodeType}if(this.idMap[g.id]=S,E&&E.appendChild(S),g.childNodes)for(var T=0;T<g.childNodes.length;T++)this.deserializeNode(g.childNodes[T],S);return S},y})(),k=(function(){function y(g,E,_){var S=this;this.target=g,this.mirror=E,this.nextId=1,this.knownNodes=new r;for(var v=this.serializeNode(g).id,T=[],w=g.firstChild;w;w=w.nextSibling)T.push(this.serializeNode(w,!0));this.mirror.initialize(v,T);var N=[{all:!0}];_&&(N=N.concat(_)),this.mutationSummary=new C({rootNode:g,callback:function(x){S.applyChanged(x)},queries:N})}return y.prototype.disconnect=function(){this.mutationSummary&&(this.mutationSummary.disconnect(),this.mutationSummary=void 0)},y.prototype.rememberNode=function(g){var E=this.nextId++;return this.knownNodes.set(g,E),E},y.prototype.forgetNode=function(g){this.knownNodes.delete(g)},y.prototype.serializeNode=function(g,E){if(g===null)return null;var _=this.knownNodes.get(g);if(_!==void 0)return{id:_};var S={nodeType:g.nodeType,id:this.rememberNode(g)};switch(S.nodeType){case Node.DOCUMENT_TYPE_NODE:var v=g;S.name=v.name,S.publicId=v.publicId,S.systemId=v.systemId;break;case Node.COMMENT_NODE:case Node.TEXT_NODE:S.textContent=g.textContent;break;case Node.ELEMENT_NODE:var T=g;S.tagName=T.tagName,S.attributes={};for(var w=0;w<T.attributes.length;w++){var N=T.attributes[w];S.attributes[N.name]=N.value}if(E&&T.childNodes.length){S.childNodes=[];for(var x=T.firstChild;x;x=x.nextSibling)S.childNodes.push(this.serializeNode(x,!0))}}return S},y.prototype.serializeAddedAndMoved=function(g,E,_){var S=this,v=g.concat(E).concat(_),T=new r;v.forEach(function(N){var x=N.parentNode,D=T.get(x);D||(D=new r,T.set(x,D)),D.set(N,!0)});var w=[];return T.keys().forEach(function(N){for(var x=T.get(N),D=x.keys();D.length;){for(var P=D[0];P.previousSibling&&x.has(P.previousSibling);)P=P.previousSibling;for(;P&&x.has(P);){var O=S.serializeNode(P);O.previousSibling=S.serializeNode(P.previousSibling),O.parentNode=S.serializeNode(P.parentNode),w.push(O),x.delete(P),P=P.nextSibling}D=x.keys()}}),w},y.prototype.serializeAttributeChanges=function(g){var E=this,_=new r;return Object.keys(g).forEach(function(S){g[S].forEach(function(v){var T=_.get(v);T||(T=E.serializeNode(v),T.attributes={},_.set(v,T)),T.attributes[S]=v.getAttribute(S)})}),_.keys().map(function(S){return _.get(S)})},y.prototype.applyChanged=function(g){var E=this,_=g[0],S=_.removed.map(function(N){return E.serializeNode(N)}),v=this.serializeAddedAndMoved(_.added,_.reparented,_.reordered),T=this.serializeAttributeChanges(_.attributeChanged),w=_.characterDataChanged.map(function(N){var x=E.serializeNode(N);return x.textContent=N.textContent,x});this.mirror.applyChanged(S,v,T,w),_.removed.forEach(function(N){E.forgetNode(N)})},y})();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=L,n.TreeMirrorClient=k,Object.defineProperty(n,"__esModule",{value:!0})}))})),iP=oP(),ri=0,oi=new Array(1e3);function sP(){for(let e=0;e<ri;e+=2){const t=oi[e],n=oi[e+1];t(...n),oi[e]=void 0,oi[e+1]=void 0}ri=0}function aP(e,...t){oi[ri]=e,oi[ri+1]=t,ri+=2,ri===2&&cP()}function lP(){let e=0;const t=new MutationObserver(sP),n=document.createTextNode("");return t.observe(n,{characterData:!0}),()=>{n.data=String(e=++e%2)}}var cP=lP();function Gv(){aP(()=>{Df.hasListeners()&&(Df.fire(),Gv())})}var Df=new pe({onFirstListenerAdd:Gv}),ql=Df.once;function uP(e,t,n){const r=new pe;let o=[];return r.addDisposable(e(i=>{ql(()=>{r.fire(t(o)),o=[]}),o.push(i)})),n?.addDisposable(r),r.event}var dP=class extends pe{constructor(e={}){super(),A(this,"_mutationSummary",void 0),this._mutationSummary=new iP.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}},fP=class extends ye{_nextTickHandler(){ql(()=>{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 pe({onFirstListenerAdd:()=>{this._nextTickHandler()}}))),A(this,"_lostEmitter",this.addDisposable(new pe)),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 dP(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),ql(()=>{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)}}},mP=1,Xv=e=>e.nodeType===mP,Bf=e=>e?.nodeName==="STYLE";function hP(e){return e.some(t=>t.attributeChanged&&Object.keys(t.attributeChanged).length||t.reparented?.length||t.reordered?.length||t.added?.some(n=>Xv(n)||Bf(n.parentNode))||t.removed?.some(n=>Xv(n)||Bf(t.getOldParentNode(n)))?!0:!!t.characterDataChanged?.some(n=>Bf(n.parentNode)))}var pP=ql;function gP(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 Kv=/&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]*);/iy;function Yv(e,t){Kv.lastIndex=t;const n=Kv.exec(e);return n?n[0].length:e.startsWith(`\r
3
+ `,t)?2:1}function Zv(e){return e.length===1?1:(kr(e).textContent??"").length}function bP(e,t,n){if(n)return Math.min(t,e.length);let r=0,o=0;for(;o<e.length&&r<t;){const i=Yv(e,o);r+=Zv(e.slice(o,o+i)),o+=i}return o}function yP(e,t,n){if(n)return Math.min(t,e.length);let r=0;for(let o=0;o<e.length;){const i=Yv(e,o);if(o+i>t)break;r+=Zv(e.slice(o,o+i)),o+=i}return r}function xs(e,t){const n=t.nodeMap.getByElement(e);return n&&t.isAttached(n)?n:void 0}var vP='[contenteditable="true"], editor';function Qv(e,t,n){const r=e.childNodes;for(let i=t;i<r.length;i++){const s=xs(r[i],n);if(s)return s.start}for(let i=Math.min(t,r.length)-1;i>=0;i--){const s=xs(r[i],n);if(s)return s.end}const o=xs(e,n);return o&&(o.startTagEnd??o.start)}function Jv(e,t){if((e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(vP))for(let n=e,r=e.parentNode;r;n=r,r=r.parentNode){const o=Qv(r,Array.from(r.childNodes).indexOf(n),t);if(o!==void 0)return o}}function EP({node:e,offset:t},n){if(e.nodeType===Node.TEXT_NODE){const r=xs(e,n);if(r?.type!==B.HTML)return Jv(e,n);const o=n.textAt(r.start,r.end);return r.start+bP(o,t,Sn(e.parentNode))}return Qv(e,t,n)??(xs(e,n)?void 0:Jv(e,n))}function Hf(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 SP(e,t){const n=t.nodeAt(e);if(!n)return;if(n.type===B.HTML){const s=t.nodeMap.getByNode(n);return s?.nodeType!==Node.TEXT_NODE?void 0:{node:s,offset:yP(t.textAt(n.start,n.end),Math.max(0,Math.min(e,n.end)-n.start),Sn(s.parentNode))}}if(e<=n.start||e>=n.end)return Hf(n,e>=n.end&&e>n.start,t);const r=n.children.find(s=>s.start>=e);if(r)return Hf(r,!1,t);const o=n.children[n.children.length-1];if(o)return Hf(o,!0,t);const i=t.nodeMap.getByNode(n);return i&&{node:i,offset:0}}var mse=400,eE=3e3,wP=class extends ye{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(eE)}_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=[]}},tE=2e3,_P=3;function CP(e,t,n){const r=e.data.indexOf(n,Math.max(0,t-n.length));return n.trim().length>=_P&&r>=0&&r<=t}function nE(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 TP(e,t){if(e.nodeType===Node.TEXT_NODE)return{text:e,offset:t};const n=nE(e.childNodes[t-1],!0),r=n?void 0:nE(e.childNodes[t],!1);return n?{text:n,offset:n.length}:r&&{text:r,offset:0}}var AP=class extends ye{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 pe)),A(this,"_beforeCommitEmitter",this.addDisposable(new pe)),A(this,"_beforeTextCommitEmitter",this.addDisposable(new pe)),A(this,"_onTextCommitEmitter",this.addDisposable(new pe)),A(this,"_onRefreshEmitter",this.addDisposable(new pe)),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 fP)),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",tP(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",Wx(uP(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 oR(e,n.createRoot);this._nodeMap=new qR,this.addDisposable(r.onRefresh(this._onRefresh.bind(this))),this.addDisposable(r.onMutate(this._onRemoteMutate.bind(this))),this._attributeMapper=new KM(this._nodeMap),this.addDisposable(nM(()=>this._mutationCollector.pauseForForeignCode())),this.addDisposable(rM(()=>this._mutationCollector.resumeAfterForeignCode())),this.addDisposable(this._mutationCollector.onNativeMutate(o=>{this._styleDirty||(this._styleDirty=hP(o))})),this.addDisposable(this._mutationCollector.onLost(o=>this._attributeMapper.onHiddenMutate(o))),this.ownership=new YM(o=>!!this._nodeMap.getByElement(o)),this.addDisposable(this._mutationCollector.onLost(o=>{this._markLostService(o),this._bindScriptOutput(o)})),this.addDisposable(this._mutationCollector.onLost(o=>this.ownership.observeLost(o))),this.addDispose(n2(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 wP(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:gP(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?TP(n,t?.anchorOffset??0):void 0;l&&l.text!==e.node&&!CP(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?[GR(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);eP(ZM(e,this.ownership,t),this._reportedDrifts),JM(QM(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 zv(e,this._accountingRules())}auditNodes(){return Uv(document,this._accountingRules()).map(jv)}checkAccounting(){this._reportSafely(()=>Vv(Uv(document,this._accountingRules()),this._reportedDrifts))}_checkCommitted(e){this._reportSafely(()=>{const t=e.flatMap(n=>[...n.added,...n.reparented??[],...n.reordered??[]]);Vv(nP(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+tE-Date.now());this._accountingTimer=setTimeout(()=>{const n=window.requestIdleCallback;n?n(e,{timeout:tE}):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._serviceRules();if(!t)return e;const n=YR(e,t);return n.service.forEach(r=>this.ownership.markService(r)),n.summaries}_markLostService(e){const t=this._serviceRules();if(t){const n=this._scriptOf()?{...t,isServicePanel:()=>!1}:t;KR(e,n).forEach(r=>this.ownership.markService(r))}}_serviceRules(){const e=this._serviceMarkup;return e&&{...e,isWrapper:t=>this.ownership.isWrapper(t),isMapped:t=>!!this._nodeMap.getByElement(t)}}_sealOnNextTick(e){const t=this._mutationCollector.onMutate(n=>{n.length&&(this._reportSafely(()=>this._beforeTextCommitEmitter.fire()),this._dropForeignOutput(n),this._reportForeignStructure(n),this._dropForeignNodes(n),kl("commit",()=>{const r=NM(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())});pP(()=>{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 EP(e,this._textPoints())}offsetToPoint(e){return SP(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=xM(e);try{this._baseDocument.beginUpdate();const t=this._parsedDocument;Ty(()=>{const n=tv(t.applyingMutation,r=>this._nodeMap.getByNode(r),r=>t.isAttached(r));return n&&{...n,stage:"tree"}},()=>t.applyMutations(e));for(const n of e)if(n.type==="Hidden"){const r=this._nodeMap.getByNode(n.node);r&&(this.ownership.markService(r),r.nodeType===Node.TEXT_NODE&&r.data===""&&this._hiddenEmptyTexts.add(r)),this._nodeMap.remove(n.node,n.value)}}finally{this._baseDocument.endUpdate()}}}correctNodes(e){const t=new Map;for(const n of e)if(!t.has(n)&&this._parsedDocument.contains(n)&&n.type===B.ELEMENT){const r=Wd(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,nr),i=this._nodeMap.getByNode(n);i&&(this._nodeMap.remove(n),this._nodeMap.set(o,i))}}finally{this._baseDocument.endUpdate()}}_onRefresh(e){try{kl("refresh",()=>this._onRemoteMutate(e,!0))}finally{this._onRefreshEmitter.fire()}}_onRemoteMutate(e,t){if(this._treeMutations.push([e,t,iO()??"other"]),!(this._remoteDocument.hasChanges()&&!this._remoteDocument.isApplyingRemote()))for(const[n,r,o]of this._treeMutations)kl(o,()=>this._doOnRemoteMutate(n,r))}_doOnRemoteMutate(e,t){try{if(this._mutationCollector.stop(),e=jR(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=AR(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=NR(n);this._beforeChangeEmitter.fire({domMutations:n.mutations,treeMutations:e}),r.push(...Z2(OR(n)));try{if($R(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);kf.isEqual(i,s)}}}finally{ny(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(se.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?this._rootsHtmlOf(e):""}_rootsHtmlOf(e){return[...e.childNodes].map(t=>!this._nodeMap.getByElement(t)&&this.ownership.isWrapper(t)?this._rootsHtmlOf(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){ct("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}}}},hse=1500,pse=2,kP=100,LP=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,kP))}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)}},Ff=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=Nt(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)}}},rE=60;function NP(e,t){const n=wy(e,t);if(!n)return;const r=n.start;return{offset:r,ownLength:e.length,cachedLength:t.length,own:e.substring(r,r+rE),cached:t.substring(r,r+rE)}}var xP=64,OP=class extends ye{constructor(...e){super(...e),A(this,"_onApplyEmitter",this.addDisposable(new pe)),A(this,"_onEmptyEmitter",this.addDisposable(new pe)),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>xP&&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=Nl(i.textChanges,o,"after"),a=s&&Nl(o,i.textChanges,"before");if(!s||!a)return!1;i.textChanges=s,o=a}n=Nt(n,o)}return this._dispatched=t.reverse(),this._emit(n),!0}_confirmEcho(e,t){const[n]=this._dispatched.splice(e,1);this._emit(Nt(Pn(n.textChanges),t))}_applyExternal(e){let t=[];for(const n of this._dispatched)t=Nt(t,Pn(n.textChanges)),n.changeId!==void 0&&this._revertedAwaiting.add(n.changeId);this._dispatched=[],this._emit(Nt(t,e))}clear(){const e=this.hasDispatched();this._dispatched=[],this._revertedAwaiting.clear(),e&&this._onEmptyEmitter.fire()}},RP=class YN extends ye{constructor(t=""){super(),A(this,"_text",void 0),this._text=t}getText(t){const n=EO(this,t);return n?this._text.substring(n.start,n.end):""}getLength(){return this._text.length}clone(){return new YN(this._text)}},zl=class ZN extends RP{constructor(t=""){super(t),A(this,"_eventQueue",void 0),A(this,"_lockCounter",0),A(this,"_onChangeEmitter",this.addDisposable(new pe)),A(this,"_onChangedEmitter",this.addDisposable(new pe)),A(this,"onChanged",this._onChangedEmitter.event)}applyEdits(t,n){if(n=n.flatMap(r=>AO(this,r)),n.length){const r=Qo(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=_O(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=Nt(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 ZN(this._text)}};function oE(e){return/#set\s*\(\s*.*=.*\)/.test(e)}function Ul(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 MP(e){return(t,n,r)=>Ul(t)?e(t,n,r):!1}function PP(e){return t=>Ul(t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t)?e(t):!1}function IP(e){return(t,n,r)=>Ul(t)?oE(t)?e(t,n,r):t:!1}function DP(e){return t=>{const n=t.startsWith("<!--")&&t.endsWith("-->")?t.slice(4,-3):t;return Ul(n)?oE(n)?e(t):t:!1}}function BP(e){const t=/[<>&]/g;for(;t.exec(e)!==null;)return!0;return!1}function $f(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 HP(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 FP=8,$P=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=HP(FP),this._byKey[e]=t,this._byValue[t]=e),t}getByValue(e){return this._byValue[e]}},jl=new $P;function iE(e,t){return t!==void 0&&!$f(e,t)?`%|{${jl.getOrCreateByKey(e)}}|%`:e}function WP(e){const t=jl.getByValue(e.slice(3,e.length-3));return t===void 0?e:t}function Je(e,t,n){return t!==void 0?$f(e,t)?e:`%|{${jl.getOrCreateByKey(e)}}|%`:`<!--${e}-->`}function qP(e){return e.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function Ve(e){return e.startsWith("<!--")&&e.endsWith("-->")?qP(e.slice(4,-3)):e}function zP(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 UP(e,t,n){return t!==void 0?$f(e,t)?e:`%|{${jl.getOrCreateByKey(e)}}|%`:n||BP(e)||zP(e)?`<!--${e}-->`:e}var mo=MP(Je),ho=PP(Ve),jP=IP(Je),VP=DP(Ve),GP=e=>{e.escape("<!--","-->",t=>t,!1),e.escape("<style","</style>",t=>t,!1),e.escape("<script","<\/script>",t=>t,!1),e.unescape("%|{","}|%",WP),e.escape("@{","}",Je,!0).unescape("<!--@{","}-->",Ve,!0),e.unescape("<!--%%%{{{","}}}%%%-->",t=>t.substring(10,t.length-9),!1),e.escape("${","}",iE,!0),e.escape("{{","}}",iE,!0),e.createSyntax("brace-percent").escape("{%","%}",Je).unescape("<!--{%","%}-->",Ve),e.createSyntax("brace-hash").escape("{#","#}",Je).unescape("<!--{#","#}-->",Ve),e.createSyntax("proscript").escape("[%","%]",UP,!0).unescape("<!--[%","%]-->",Ve,!0),e.createSyntax("getresponse").escape("[[IF","]]",Je).escape("[[if","]]",Je).escape("[[ELSE]]","",Je).escape("[[else]]","",Je).escape("[[ENDIF]]","",Je).escape("[[endif]]","",Je).unescape("<!--[[IF","]]-->",Ve).unescape("<!--[[if","]]-->",Ve).unescape("<!--[[ELSE]]","-->",Ve).unescape("<!--[[else]]","-->",Ve).unescape("<!--[[ENDIF]]","-->",Ve).unescape("<!--[[endif]]","-->",Ve),e.createSyntax("expert-sender").escape("<if",">",Je).escape("</if",">",Je).escape("<else",">",Je).escape("</else",">",Je).escape("<var ",">",Je,!0).unescape("<!--<if ",">-->",Ve).unescape("<!--</if",">-->",Ve).unescape("<!--<else ",">-->",Ve).unescape("<!--</else",">-->",Ve).unescape("<!--<var",">-->",Ve,!0),e.createSyntax("velocity").escape("#if",")",mo).escape("#elseif",")",mo).escape("#else","",Je).escape("#foreach",")",mo).escape("#macro",")",mo).escape("#set",")",jP,!0).escape("#parse",")",mo).escape("#include",")",mo).escape("#evaluate",")",mo).escape("#end","",Je).escape("#break","",Je).escape("#stop","",Je).unescape("<!--#macro","-->",ho).unescape("<!--#if","-->",ho).unescape("<!--#elseif","-->",ho).unescape("<!--#else","-->",Ve).unescape("<!--#foreach","-->",ho).unescape("<!--#parse","-->",ho).unescape("<!--#include","-->",ho).unescape("<!--#evaluate","-->",ho).unescape("<!--#end","-->",Ve).unescape("<!--#break","-->",Ve).unescape("<!--#stop","-->",Ve).unescape("<!--#set","-->",VP,!0),e.createSyntax("mailchimp").escape("*|","|*",Je).unescape("<!--*|","|*-->",Ve)},sE="bare",Wf=new Map;function XP(e){for(const t of Object.keys(e)){const n=e[t];n&&Wf.set(t,n)}}function KP(e){return e?Wf.get(e)??sE:sE}function YP(){Wf.clear()}function aE(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 Os(e,t){return e.start<t.end&&t.start<e.end}function lE(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='"'):aE(e,c,u.start,l),c=u.end,a.some(L=>Os(L,u)))continue;const p=l.insideAttributeValue?l.attributeQuoteChar??"":void 0,b=e.substring(u.start,u.end),C=d(b,p,l.insideTag);C!==!1&&C!==b&&(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 ZP(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 qf(e,t,n,r,o=!1){const i=[];if(n&&(t=t.filter(c=>c.isVariable)),!t.length)return i;const s=ZP(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='"'):aE(e,l,u,a),l=u;const h=a.insideAttributeValue?a.attributeQuoteChar??"":void 0;let m=!1;for(const{mapFn:p,value:b,syntax:C,isVariable:L}of f){let k=u+d.length,y=e.indexOf(b,k);for(;y!==-1;){let g=y,E=u+d.length,_=0;for(;g!==-1;){const N=e.indexOf(d,E);if(N!==-1&&N<g)_++,E=N+d.length,g=e.indexOf(b,E);else if(_>0)_--,E=g+b.length,g=e.indexOf(b,E);else break}if(g<0)break;const S=g+b.length,v=e.substring(u,S),T=p(v,h,a.insideTag);if(T===!1){k=y+Math.max(b.length,1),y=e.indexOf(b,k);continue}(o||T!==v)&&i.push({range:{start:u,end:S},text:o?v:T,syntax:C,isVariable:L});const w=s.findIndex(({start:N})=>N>=S);w>c?c=w-1:c=s.length,m=!0;break}if(m)break}}return i}function Vl(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 cE=class{constructor(e=GP){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=qf(e,this._escapes,t,n),o=lE(e,this._escapeMatchers,t,n),i=o.filter(l=>l.overrideBuiltins).map(l=>l.range),s=r.filter(l=>!i.some(c=>Os(c,l.range))),a=o.filter(l=>l.overrideBuiltins||!s.some(c=>Os(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=qf(e,this._unescapes,t),r=lE(e,this._unescapeMatchers,t,!1),o=r.filter(a=>a.overrideBuiltins).map(a=>a.range),i=n.filter(a=>!o.some(l=>Os(l,a.range))),s=r.filter(a=>a.overrideBuiltins||!i.some(l=>Os(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=>KP(o)==="html-comment";return this._collectRevertMappings(e,t).filter(o=>o.isVariable||!r(o.syntax))}getDetectedMappings(e,t,n){return qf(e,this._escapes,t,n,!0)}getEscapedText(e,t){return Vl(e,this.getMappings(e,t))}getUnescapedText(e,t,n){return Vl(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=Vl(o,this._collectRevertMappings(o).filter(i=>n(i.syntax)==="bare"))),r.includes("html-comment")&&(o=Vl(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()}},QP=1e4,uE=3,JP=Jx+lf;function eI(e){return(e??[]).reduce((t,n)=>t+n.oldLength,0)}function tI(e,t){return e.stack.closesStep()?!1:e.undoStop===t.undoStop||e.serviceRemoval+t.serviceRemoval<=200}var nI=class extends zl{constructor(){super(),A(this,"_editStack",new Ff),A(this,"_frozenStack",new Ff),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 OP)),A(this,"_beforeSaveEmitter",this.addDisposable(new $x)),A(this,"_onReadyEmitter",this.addDisposable(new pe)),A(this,"_onEntitySetEmitter",this.addDisposable(new pe)),A(this,"_onPendingSentEmitter",this.addDisposable(new pe)),A(this,"_onHistoryAnswerEmitter",this.addDisposable(new pe)),A(this,"_onHistoryActionEmitter",this.addDisposable(new pe)),A(this,"_onHistoryActionSentEmitter",this.addDisposable(new pe)),A(this,"_onHistoryActionAnsweredEmitter",this.addDisposable(new pe)),A(this,"_canvasEdits",0),A(this,"_nextActionId",1),A(this,"_historyAction",null),A(this,"_cache",new zl),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 pe)),A(this,"_onEchoRecoveredEmitter",this.addDisposable(new pe)),A(this,"_echoWatchdog",this.addDisposable(new LP({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"),YP(),XP(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)=>Nt(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(j.addListenerAsync(ue.SANDBOX_SET_ENTITY,this._handleSetEntity)),this.addDisposable(j.addListenerAsync(ue.SANDBOX_UPDATE_ENTITY,this._handleUpdateEntity)),this.addDisposable(j.addListenerAsync(ue.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:_s(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(rr,uo(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=Nl(a,n,"after"),c=l&&Nl(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(rr,uo(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)=>Nt(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(rr,uo(Nt(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)=>Nt(e,t.get()??[]),[])}_textWithoutUnsent(){return bO(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:eI(this._editStack.get()),n=new Ff;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||!tI(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=>Py(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,Rr("echo-timeout",()=>({guid:this._entityId,at:"update-entity",unsent:n,textFingerprint:_y(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 pe;let n=!1;const r=setTimeout(()=>{n=!0,t.fire()},JP),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++<uE&&(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<uE)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),lf),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)},lf)}_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(rr,[{range:_s(this._cache),text:r}]),this._rev=t??null,this._applyToCache(e),this._versionController.apply(this._changesToCache())}catch{}finally{this._resyncing=!1}const o=_y(this._cache.getText());if(o.length!==n.length||o.hash!==n.hash){this._awaitingRefill=!0,this._finishBarrier(!1),Rr("resync-failed",()=>({guid:this._entityId,textFingerprint:o}));return}this._coveredRev=this._rev,this._clearEchoLost(),this._flushPendingSave(),this._onReadyEmitter.fire()}_replaceText(e){this._cache.applyEdits(rr,[{range:_s(this._cache),text:e}]),super.applyEdits(rr,[{range:_s(this),text:e}])}_reportSyncDrift(e){if(this.hasChanges()||this._versionController.hasDispatched())return;const t=NP(this.getText(),this._cache.getText());if(t){const{offset:n,ownLength:r,cachedLength:o}=t;Rr("host-copy-drift",()=>({at:e,text:{offset:n,ownLength:r,cachedLength:o}}))}}_changesToCache(){const e=this._textWithoutUnsent(),t=this._cache.getText(),n=wy(e,t);if(!n)return[];const{start:r,fromEnd:o,toEnd:i}=n;return[new Xt(r,e.slice(r,o),r,t.slice(r,i))]}_applyToCache(e){return this._applyGroupsToCache(e).reduce((t,n)=>Nt(t,n),[])}_applyGroupsToCache(e){const t=[];for(const n of e){const r=n.reverse();t.push(Qo(r,this._cache)),this._cache.applyEdits(rr,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=Qo(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:uo(t),changeId:s,originId:this._originId,...this._rev!==null?{baseRev:this._rev}:{},...r?{typedAt:r}:{},...o?{selection:o}:{},...i?{closesStep:i}:{}},l=()=>j.send(ue.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=>Py(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()},QP),r=this.onReady(()=>{r.dispose(),clearTimeout(n),t()})})}_reportSaveTimeout(){Rr("save-timeout",()=>({}))}hasChanges(){return this._editStack.hasChanges()||this._frozenStack.hasChanges()||this._sealed.length>0}},rI=class extends cE{constructor(e,t){super(),A(this,"_baseDocument",void 0),A(this,"_mappedDocument",void 0),A(this,"_mappings",[]),A(this,"_cachedMappedDocument",new zl),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=Qo(this.getMappings(n),this._baseDocument),o=Pn(this._mappings);if(t=Nt(o,t),t=Nt(t,r),this._mappings=r,t.length){const i=uo(t);this._mappedDocument.applyEdits(e,xl(i))}}}correctOffset(e,t){const n=t?this._mappings:Pn(this._mappings),r=qd(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=rr){const t=this._baseDocument.getText(),n=this.getMappings(t),r=Cs(t,n);this._mappings=Qo(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=Qo(this.getRevertMappings(n),this._mappedDocument),o=this._mappings;if(t=Nt(o,t),t=Nt(t,r),this._mappings=Pn(r),t.length){const i=uo(t);this._baseDocument.applyEdits(e,xl(i))}}}},oI="input, textarea, select, .monaco-editor",dE='[contenteditable="true"], editor',iI=/^(Arrow(Left|Right|Up|Down)|Home|End|PageUp|PageDown|Tab)$/;function fE(e,t){return e?.node===t?.node&&e?.offset===t?.offset}function sI(e,t){return fE(e?.anchor,t?.anchor)&&fE(e?.focus,t?.focus)}function Gl(){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 aI=class extends ye{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=!sI(this._mark,this._actionMark))}),this._listen(window,"pointerdown",!0,()=>{this._moved=!0}),this._listen(window,"keydown",!1,r=>{this._moved||(this._moved=!r.defaultPrevented&&iI.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=Gl(),this._moved=!1}))}_listen(e,t,n,r){const o=i=>{this._mark=Gl(),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=Gl(),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))}_prepareEditorFor(e,t){const n=document.activeElement?.closest(dE);if(!n||n.contains(e.node)&&n.contains(t.node))return!0;const r=e.node.nodeType===Node.TEXT_NODE?e.node.parentElement:null,o=r?.ownerDocument.defaultView;if(!r?.contains(t.node)||!o)return!1;r.dispatchEvent(new o.MouseEvent("mouseover",{bubbles:!0}));const i=e.node.parentElement?.closest(dE);return i?.contains(t.node)?(i.focus(),document.activeElement===i):!1}_restore({selection:e,own:t}){if(t&&this._moved||!t&&!document.hasFocus()||document.activeElement?.closest(oI))return;const n=this._toPoint(e.start),r=e.end===e.start?n:this._toPoint(e.end);!n||!r||!this._prepareEditorFor(n,r)||(document.getSelection()?.setBaseAndExtent(n.node,n.offset,r.node,r.offset),this._mark=Gl())}};function lI(e){let t=e.documentElement;return t||(t=e.createElement("html"),e.appendChild(t)),t}function Rs(e){let t=e.head;if(!t){t=e.createElement("head");const n=lI(e);n.insertBefore(t,n.firstChild)}return t}function cI(e){const t=Object.create(null),n=e.getAttributeNames();for(const r of n)t[r]=e.getAttribute(r);return t}function uI(e){for(const t of document.querySelectorAll("iframe"))if(t.contentDocument===e.ownerDocument)return t}function dI(e){const t=Rs(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 mE="amp-custom";function fI(e,t){return`em-${e.replaceAll("-","_")}-${t.toLowerCase()}`}function hE(e,t,n){for(const r of t)if(Ls.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(_f(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 Ls.isMediaRule(r)&&hE(e,r.cssRules,n)}function pE(e,t){const n=t.sheet;if(n){const i=new Set;hE(e,n.cssRules,(s,a)=>{const l=fI(s,a),c=[...n.cssRules],u=`.${l} { ${s}: ${a} }`;return!c.find(d=>Ls.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 mI(e){const t=Rs(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(mE)===""){pE(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(mE,""),t.append(i),pE(e,i)}for(const i of n)i.remove()}var zf="<!doctype html>";function hI(e){const t=e.doctype;if(t){if(nv(t)===zf)return;const n=new DOMParser().parseFromString(zf,"text/html").doctype;e.replaceChild(n,t)}else{const n=new DOMParser().parseFromString(zf,"text/html").doctype;e.insertBefore(n,e.firstChild)}}async function gE(e,t={}){const n=document.createElement("amp-img"),r=await wR(e)||void 0,o=[];try{let i=e;for(;i&&_f(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=uI(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={...cI(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 pI(e,t){const n=[...e.querySelectorAll("img")],r=[];for(const i of n)r.push(gE(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(gE(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 gI(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=Rs(e),r=e.createElement("meta");r.setAttribute("charset","utf-8"),n.insertBefore(r,n.firstChild)}function bI(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 bE="https://cdn.ampproject.org/v0",yE=`${bE}.js`,yI=`script[src='${yE}']`;function vI(e,t){return`${bE}/${e.toLowerCase()}-${t}.js`}async function EI(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=Rs(e),a=n.createElementFn("script"),l=vI(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 gse=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),bse=function(e,t){return new URL(e,t).href},yse={},Uf=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)})},vE=void 0;async function Xl(){return vE||(vE=await Uf(()=>Promise.resolve().then(()=>Dd("./rules.CL_BitCE.js")).then(e=>e.default),void 0,{}.url))}var jf=new Map;async function SI(){if(!jf.size){const e=await Xl(),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))||[];jf.set(o,{...r,priority:n,attrs:new Map([...i,...a].map(l=>[l.name,l]))})}}return jf}var Vf=new Map;async function wI(){if(!Vf.size){const e=await Xl();for(const t of e.declarations)Vf.set(t.name,t)}return Vf}var _I="$GLOBAL_ATTRS",Gf=new Map;async function CI(){if(!Gf.size){const e=(await Xl()).attrLists.find(t=>t.name===_I)?.attrs;if(e)for(const t of e)Gf.set(t.name,t)}return Gf}function TI(e){return wn(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function EE(e){return vR(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}function SE(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--)SE(i[s],t,n)}if(wn(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 Cf(e)?o():fo(e)&&(e.textContent?.trim()||e.nextSibling?.textContent?.trim()&&fo(e.nextSibling))&&r()}async function AI(e,t){const n=new Set,r=t.commit,o=h=>t.replaceSelectors(h.toLowerCase());if(t.replaceImages&&await pI(e,r),t.injectExtensions){const h=t.replaceSelectors(yI);if(!e.querySelector(h)){const m=t.createElementFn("script");m.setAttribute("src",yE),m.setAttribute("async",""),Rs(e).appendChild(m),r?.()}}t.injectRequiredTags&&(bI(e,t.createElementFn,o),hI(e),dI(e),gI(e),r?.()),t.replaceStylesAndLinks&&(mI(e),r?.());const i=await Xl(),s=await SI(),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(b=>!l.has(b));m.unique&&p.length&&(p=[p[0]]),t.injectRequiredTags&&m.required&&!p.length&&(p=[...p,t.createElementFn(m.name)]);for(const b of p){if(t.injectRequiredAttributes&&b.getAttribute("on")&&!b.getAttribute("tabindex")&&b.setAttribute("tabindex","0"),t.removeUnsupportedStyles){let L=!1;for(const k of[...b.classList])k.startsWith("i-amphtml")&&(L=!0,b.classList.remove(k));L&&!b.classList.length&&b.removeAttribute("class")}const C=l.get(b);C&&C.priority>m.priority||l.set(b,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"||wn(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 b=await CI();if(t.removeUnsupportedAttributes||t.injectRequiredAttributes){const C=m.attrs,L=t.injectRequiredAttributes?new Set([...C].map(([y,g])=>g).filter(y=>y.required&&y.value)):void 0,k=h.getAttributeNames();for(const y of k){const g=C.get(y)||b.get(y);if(g){if(y==="id"||y==="class"||y==="style"){L?.delete(g);continue}if(t.removeUnsupportedAttributes){const E=h.getAttribute(y);if(g.value&&g.value.indexOf(E)<0){h.removeAttribute(y);continue}if(g.valueRegex&&!new RegExp(g.valueRegex).test(E)){h.removeAttribute(y);continue}if(g.disallowedValueRegex&&new RegExp(g.disallowedValueRegex).test(E)){h.removeAttribute(y);continue}const _=g.valueUrl;if(_){if(E===""){if(!_.allowEmpty){h.removeAttribute(y);continue}}else if(!(E.indexOf("<!--")>0&&E.indexOf("-->")>0)){if(!_.allowRelative)if(E.startsWith("#")||E.startsWith("/")){h.removeAttribute(y);continue}else{const S=_.protocol.length?_.protocol:["https"],v=E.substring(0,E.indexOf(":"));if(v){if(S.indexOf(v)<0){const T=S[0]+E.substring(E.indexOf(":"));if(URL.canParse(T))er(h,y,T);else{h.removeAttribute(y);continue}}else if(!URL.canParse(E)){h.removeAttribute(y);continue}}else{const T=S[0]+E;if(URL.canParse(T))er(h,y,T);else{h.removeAttribute(y);continue}}}}}}L?.delete(g)}else{if(y==="id"||y==="class"||y==="style")continue;t.removeUnsupportedAttributes&&h.removeAttribute(y)}}if(L)for(const y of L)er(h,y.name,y.value[0])}r?.()}t.moveInvalidTagPosition&&(SE(e,e.body,o),r?.());for(const h of a)h.remove();if(r?.(),t.removeUnsupportedStyles){let p=function(y){const g=y.cssText.replaceAll(/\".*\"/g,"").replaceAll(/\'.*\'/g,"").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g,"").match(/[a-z-]+(?=:[^before|after|hover])/gi)||[];for(const E of g){if(!E)continue;const _=y.getPropertyValue(E);y.getPropertyPriority(E)==="important"&&y.setProperty(E,_);const S=m.get(E);S?S.value?S.value.indexOf(_)<0&&y.removeProperty(E):S.valueRegex&&(new RegExp(S.valueRegex).test(_)||y.removeProperty(E)):y.removeProperty(E)}r?.()},b=function(y){return y.constructor.name==="CSSStyleRule"},C=function(y){return y.constructor.name==="CSSMediaRule"},L=function(y){const g=y.cssRules;for(let E=g.length-1;E>=0;E--){const _=g[E];b(_)?_.selectorText.indexOf("[")>=0||_.selectorText.indexOf(":")>=0?y.deleteRule(E):(p(_.style),_.style.cssText||y.deleteRule(E)):C(_)?(L(_),_.cssRules.length||y.deleteRule(E)):y.deleteRule(E)}};var c=p,u=b,d=C,f=L;const h=e.querySelectorAll("*"),m=await wI();for(const y of h)if(_f(y)){const g=y.getAttribute("style");g&&(p(y.style),y.style.length?y.style.cssText!==g&&y.setAttribute("style",y.style.cssText):y.removeAttribute("style"))}const k=e.querySelector("style[amp-custom]");if(k){const y=k.sheet;y&&(L(y),k.innerHTML=[...y.cssRules].map(g=>g.cssText).join(`
12
+ `)),r?.()}}await EI(e,i.extensions.filter(({name:h})=>n.has(h)),t)}function kI(e,t){return Object.keys(t).reduce((n,r)=>n.replaceAll(r,t[r]),e)}function wE(e,t={}){const{correct:n=!0,injectExtensions:r=!0,mappedTags:o={}}=t;return AI(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=>kI(i.toLowerCase(),o),commit:t.commit})}function Xf(){j.send(ue.RELOAD),window.location.reload()}function LI(e){const t=new ye;let n=[];function r(){n=[...new Set([...n,...document.querySelectorAll("script")])].filter(s=>rx(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(j.addListener(ue.RELOAD,Xf)),t.addDisposable(e.onChange(()=>{let i=r();for(const s of o)i.has(s)||Xf();o=i})),t}var Kl=[];function NI(e){return Kl.push(e),{dispose:()=>{const t=Kl.indexOf(e);t!==-1&&Kl.splice(t,1)}}}function Kf(e){for(const t of Kl){const n=t(e);if(n)return n}return e}function xI(){const e=document.querySelector("[em-edit]");return e?Kf(e):null}var Yl=new Set(["img","image","input","video","source","em-replace"]);function _E(e){const t=e.toLowerCase(),n=Yl.has(t);return Yl.add(t),{dispose:()=>{n||Yl.delete(t)}}}function OI(e){return Yl.has(e.toLowerCase())}var Ms=[];function RI(e){return Ms.push(e),{dispose:()=>{const t=Ms.indexOf(e);t!==-1&&Ms.splice(t,1)}}}function CE(e){return Ms.some(t=>t.isPathElement?.(e))}function MI(e,t){let n;for(const r of Ms){const o=r.caption?.(e,t);o&&(n={...n,...o})}return n}function TE(e){return e.tagName==="TD"&&e===e.closest("amp-accordion")?.querySelector(":scope > section header td")}var PI={isPathElement(e){return e.tagName==="AMP-ACCORDION"||e.tagName==="AMP-CAROUSEL"||TE(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(TE(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}}},II=class extends ye{constructor(...e){super(...e),A(this,"hasAmp",!1)}};function DI(e,t,n=""){for(const r of e.classList)if(r.startsWith(`${t}-`))return r.replaceAll(`${t}-`,"");return n}function BI(e,t,n){const r=DI(e,t);r!==n&&(e.classList.remove(`${t}-${r}`),n&&e.classList.add(`${t}-${n}`))}function HI(){const e=new ye;return e.addDisposable(RO(t=>t.startsWith("amp"))),e.addDisposable(MO(t=>t==="class"||t==="style")),e}function FI(e){const t=o=>EE(o)&&e.getOuterHtml(o)!==""||TI(o)||yR(o),n=o=>{if(t(o))return!0;if(wn(o)||Cf(o)){for(const i of o.querySelectorAll("*"))if(t(i))return!0}return!1},r=new II;return r.addDisposable(NI(o=>o.closest("amp-img"))),r.addDisposable(RI(PI)),r.addDisposable(HI()),r.addDisposable(_E("amp-img")),r.addDisposable(_E("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,j.send(ue.APPLICATION_HAS_AMP,i),setTimeout(()=>{if(i)wE(document,{correct:!1});else{const a=[...document.querySelectorAll("script")];for(const l of a)EE(l)&&l.remove();Xf()}})):s&&setTimeout(()=>{wE(document,{correct:!1})})})),r.addDisposable(j.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&&(BI(i,"em-amp-show",s==="amp"?"only":s==="html"?"disabled":void 0),e.commit())}}})),r}function $I(e,t){const n=FI(t);return e.inject(rf,n),{service:n,dispose(){n.dispose(),En(e,rf)}}}var WI={name:"sandbox.amp",provides:[rf],awaits:{services:[Y]},setup(e){const{service:t}=$I(e,R(e,Y));e.addService(gy,()=>({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,b=!0,C=!1,L;r=arguments.length>1?n:{},typeof r.indent>"u"&&(r.indent=" "),typeof r.openbrace=="string"&&(b=r.openbrace==="end-of-line"),typeof r.autosemicolon=="boolean"&&(C=r.autosemicolon);function k(v){return v===" "||v===`
13
+ `||v===" "||v==="\r"||v==="\f"}function y(v){return v==="'"||v==='"'}function g(v){return l>="a"&&l<="z"||l>="A"&&l<="Z"||l>="0"&&l<="9"||"-_*.:#[]".indexOf(v)>=0}function E(){for(var v=h;v>0;v-=1)a+=r.indent}function _(){a=L(a),b?a+=" {":(a+=`
14
+ `,E(),a+="{"),c!==`
15
+ `&&(a+=`
16
+ `),h+=1}function S(){var v;h-=1,a=L(a),a.length>0&&C&&(v=a.charAt(a.length-1),v!==";"&&v!=="{"&&(a+=";")),a+=`
17
+ `,E(),a+="}",s.push(a),a=""}for(String.prototype.trimRight?L=function(v){return v.trimRight()}:L=function(v){return v.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,y(m)){a+=l,l===m&&(m=null),l==="\\"&&c===m&&(a+=c,o+=1);continue}if(y(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&&k(l)&&a.length===0)continue;if(l<=" "||l.charCodeAt(0)>=128){d=f.Start,a+=l;continue}if(g(l)||l==="@"){if(u=L(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=L(a),_(),d=u==="@font-face"?f.Ruleset:f.Block;continue}a+=l;continue}if(d===f.Block){if(g(l)){if(u=L(a),u.length===0)s.length>0&&(a=`
23
+
24
+ `);else if(u.charAt(u.length-1)==="}")a=u+`
25
+
26
+ `;else for(;c=a.charAt(a.length-1),!(c!==" "&&c.charCodeAt(0)!==9);)a=a.substr(0,a.length-1);E(),a+=l,d=f.Selector;continue}if(l==="}"){S(),d=f.Start;continue}a+=l;continue}if(d===f.Selector){if(l==="{"){_(),d=f.Ruleset;continue}if(l==="}"){S(),d=f.Start;continue}a+=l;continue}if(d===f.Ruleset){if(l==="}"){S(),d=f.Start,h>0&&(d=f.Block);continue}if(l===`
27
+ `){a=L(a),a+=`
28
+ `;continue}if(!k(l)){a=L(a),a+=`
29
+ `,E(),a+=l,d=f.Property;continue}a+=l;continue}if(d===f.Property){if(l===":"){a=L(a),a+=": ",d=f.Expression,k(c)&&(d=f.Separator);continue}if(l==="}"){S(),d=f.Start,h>0&&(d=f.Block);continue}a+=l;continue}if(d===f.Separator){if(!k(l)){a+=l,d=f.Expression;continue}y(c)&&(d=f.Expression);continue}if(d===f.Expression){if(l==="}"){S(),d=f.Start,h>0&&(d=f.Block);continue}if(l===";"){a=L(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 qI(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 zI=["transform","transform-origin","overflow-x","height"];function UI(e,t){return!(e>0)||!(t>0)||e<=t?1:t/e}function Ps(e,t){const n=t<1?`scale(${t})`:"";if(e.style.transform===n)return!1;for(const r of zI)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 jI(e,t){const n=e,r=n?.querySelector("table:first-child"),o=Math.max(n?.offsetWidth??0,r?.offsetWidth??0);return o>0?o:(Ps(t,1),t.scrollWidth)}function VI(e,t=window){const n=t.document.documentElement,r=n.style.transform,o=UI(jI(e,n),t.innerWidth);return Ps(n,o),n.style.transform!==r&&t.parentIFrame?.size?.(),o}function GI(e,t){Ps(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;Ps(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 ht(e){const t=R(e,Se);return n=>{t.commit(n)}}function ut(){return R(It,Y)}function XI(){return R(It,at)}function KI(){return R(It,yn)}function pt(){return It.getInstance(Y)!==void 0}function po(e){R(It,Se).commit(e)}function YI(e){if(!pt())return e(),Promise.resolve(!0);const t=ut();return t.commit(!1),t.flushCommit(),t.sendAfterCurrentEdits(e)}function ZI(){if(!pt())return!1;const e=ut();return e.commit(!1),e.flushCommit(),e.hasEditsAfterBoundary()}function QI(){return pt()?ut().markHistoryAction():void 0}function JI(e){pt()&&ut().noteHistoryActionSent(e)}function Yf(e){return pt()&&ut().holdInput(e)}function AE(e){return pt()&&ut().holdInputBehindQueued(e)}function kE(){pt()&&ut().closeUndoStep()}function Zf(){return pt()&&ut().isHoldingInput()}function LE(){return pt()&&ut().hasHeldInput()}function NE(){pt()&&ut().releaseHeldInput()}function xE(){return pt()&&ut().holdsTypedEdits()}function Is(e){return pt()?ut().renderOnly(e):e()}function Zl(e){return e.nodeType===1&&e.localName==="template"&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function Qf(e){return[...e.querySelectorAll?.("template")??[]].filter(Zl)}function eD(e){return Zl(e)||Qf(e).length>0}function sn(e){const t=[...Zl(e)?[e]:[],...Qf(e)];for(const n of t)if(n.content.firstChild){for(;n.content.firstChild;)n.appendChild(n.content.firstChild);for(const r of n.children)sn(r)}}function ii(e){const t=[...Zl(e)?[e]:[],...Qf(e)];for(const n of t)for(;n.firstChild;)n.content.appendChild(n.firstChild)}var tD="style, link",nD=["insertText","insertHTML","delete","forwardDelete","insertParagraph","insertLineBreak"],rD=e=>nD.includes(e),oD=e=>/^(insert|delete)/.test(e);function OE(e,t){if(!e||e.collapsed)return;const n=t??sD(e.commonAncestorContainer);if(!n)return;const r=[...n.querySelectorAll(tD)].filter(o=>iD(o)&&e.intersectsNode(o));r.length>1&&n.append(...r)}var iD=e=>e instanceof HTMLStyleElement||e instanceof HTMLLinkElement;function sD(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]')??null}function Kt(){return pt()?ut():void 0}function Ot(e){const t=Kt();return t?t.applyHidden(e):e()}function Fe(e,t,...n){e&&Ot(()=>t?e.classList.add(...n):e.classList.remove(...n))}function go(e){const t=document.activeElement;t&&ve(t)&&t!==document.body&&e.contains(t)&&Ot(()=>t.blur())}function Jf(e){Kt()?.ownership.markService(e)}function RE(e){Kt()?.ownership.markWrapper(e)}function ME(e){Kt()?.ownership.markOuterWrapper(e)}function Ds(e,t){e.removeAllRanges(),Ot(()=>e.addRange(t))}function Ql(e){const t=document.implementation.createHTMLDocument("").importNode(e,!0);on(e,t);const n=new Map([[e,t]]),r=Kt()?.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),ii(t),{copy:t,counterpart:i=>n.get(i)}}function Jl(e){return Fb(Ql(e).copy)}function Ge(e){return H2(Ql(e).copy)}function Bs(e){const t=Kt();return t?(t.flushCommit(),t.getOuterHtml(e)):e.outerHTML}function em(e){return PE(e)}function PE(e){const t=Kt();return!t||t.isInLetter(e)||!t.isUntracked(e)&&!t.ownership.isService(e)}function tm(e){const t=Kt();return t?t.ownership.markOf(e)?"foreign":t.isInLetter(e)?"letter":t.isBehindHidden(e)?"foreign":"new":"letter"}function nm(e,t){const n=[...e.querySelectorAll(t)].filter(em);return n[n.length-1]??null}function IE(e,t){const n=o=>t==="next"?o.nextElementSibling:o.previousElementSibling;let r=n(e);for(;r&&!em(r);)r=n(r);return r}function DE(e,t){return[...e.childNodes].flatMap(n=>t.isInLetter(n)?[n]:DE(n,t))}function rm(e){go(e);const t=Kt();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(...DE(r,t))}function aD(e){const t=[...e.childNodes],n=Kt();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 lD(){const e=Kt();return e?{...e.scriptRunner,awake:()=>e.recordNow()}:{run:(t,n)=>n(),quiet:t=>t()}}function sr(e,t){const n=Le(e,"dormant"),r=Kb(n);try{return t(n)}finally{ny(r,lD())}}function BE(e,t,n){sr(n,r=>vl(e,t,r))}function Hs(e,t,n){return e==="new"?sr(t,n):n(Le(t,!0))}function ar(e,t,n,r){Hs(e,r,o=>vl(t,n,o))}function gt(e){return function(...t){const n=Kt(),r=()=>Reflect.apply(e,this,t);return n?n.applyOwn(r):r()}}function lr(e,t=!1,n){const r=()=>{if(rD(e)){const i=window.getSelection();OE(i?.rangeCount?i.getRangeAt(0):void 0)}return document.execCommand(e,t,n)},o=Kt();return o?o.applyCommand(r):r()}function HE(e){const t=()=>{Fe(document.body,e,"mceNonEditable"),document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable",e?"false":"true")})};pt()?ut().applyHidden(t):t()}function cD(){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 om=cD();function uD(e){return{dispose:e.onIntegratorChange(()=>HE(e.isTextLocked()))}}function dD(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 im(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)=>im(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)&&im(e[i],t[i]))}function FE(e,t){const n={watch(r){let o,i=!1;return e.watch(s=>{const a=t(s);i&&im(o,a)||(o=a,i=!0,r(a))})},select(r){return FE(n,r)}};return n}function $E(...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 FE(o,i)}};return o}var ec={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,blocksTemplateEnabled:!1,codeMode:!0,appName:"",isLeftButtonDown:!1,isProgrammaticSelection:!1,activeCell:[],commonStyles:{},loadStylesTimer:!1,_pushUndoStop:!1},Fs=$E({...ec});function In(){return Fs.get()}var tc=new pe,si=new Map,V={source:Fs,get(e){return In()[e]},getState(){return{...In()}},getStateRef(){return In()},set(e,t){if(In()[e]===t)return;Fs.set({...In(),[e]:t}),tc.fire({[e]:t});const n=si.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(In()[r]!==o){Fs.set({...In(),[r]:o}),n[r]=o,t=!0;const i=si.get(r);i&&i.forEach(s=>s(o))}}t&&tc.fire(n)},increment(e,t=1){const n=In()[e];typeof n=="number"&&V.set(e,n+t)},decrement(e,t=1){const n=In()[e];typeof n=="number"&&V.set(e,n-t)},subscribe(e){return tc.event(e)},subscribeToKey(e,t){si.has(e)||si.set(e,new Set);const n=si.get(e),r=t;return n.add(r),()=>{n.delete(r),n.size===0&&si.delete(e)}},reset(){Fs.set({...ec}),tc.fire(In())},resetKey(e){this.set(e,ec[e])},getInitialState(){return ec}};function fD(e,t){const n=$E(),r=e.addListener(t,o=>n.set(o));return{source:n,dispose:()=>r.dispose()}}var mD=["copyPasteEnabled","saveBlockEnabled","editImageControlEnabled","elementAIimageEnabled","imageCenterStockEnabled","imageCenterGifEnabled","imageCenterEditorEnabled","blocksAddPanelEnabled","blocksTemplateEnabled"];function hD(e){const t="7594857d";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 pD={name:"sandbox.hostFacts",provides:[Ko],setup(e){const t=Object.fromEntries(Object.entries(Zx).map(([n,r])=>[n,fD(j,r).source]));e.inject(Ko,t)}},gD={name:"sandbox.hostFactsToState",awaits:{services:[Ko,Se,Y,Qe]},setup(e){const t=R(e,Ko),n=ht(e),r=R(e,Qe);t.theme.watch(o=>{V.set("applicationTheme",o),hD(o),n(!1)}),t.commonStyles.watch(o=>{o&&V.set("commonStyles",o)}),t.flags.watch(o=>{for(const i of mD)typeof o[i]<"u"&&V.set(i,o[i])}),uD(r),dD(R(e,Y),r),t.lockEditor.watch(o=>r.setIntegrator(o)),t.codeMode.watch(o=>V.set("codeMode",o)),t.appName.watch(o=>V.set("appName",o)),t.previewPage.watch(o=>{V.set("previewPage",o),Fe(document.body,!!o,"em-sandbox-preview")})}},bD={name:"sandbox.viewport",awaits:{services:[Ko]},setup(e){R(e,Ko).viewport.watch(t=>qI(t,void 0,{state:V,previewHeight:t.previewHeight,iframeOffsetTop:t.iframeOffsetTop,scrollTop:t.scrollTop,globalHolder:V.get("globalHolder"),setBlockGroupControlsPosition:()=>e.getServices(by).forEach(n=>n()),messageService:j}))}};function Mr(e){for(const t of document.querySelectorAll(`[${e}]`))t.removeAttribute(e)}function _t(e,t,n=!1){for(const r of e.querySelectorAll(t))n||!r.childNodes.length?r.remove():r.replaceWith(...r.childNodes)}function yD(e,t){if(e.data.value)document.querySelectorAll("editor").forEach(n=>{n.setAttribute("contenteditable","false")}),Fe(document.body,!0,"em-sandbox-discuss");else{const n=t.editLock.isTextLocked()?"false":"true";document.querySelectorAll("editor").forEach(r=>{r.setAttribute("contenteditable",n)}),Fe(document.body,!1,"em-sandbox-discuss","em-sandbox-discuss_set-target")}}function vD(e,t){Fe(document.body,!!e.data.value,"em-sandbox-discuss_set-target")}function ED(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}}),Fe(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 SD(e,t){Fe(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 wD(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 _D={sandbox_lock_discuss:yD,sandbox_discuss_set_target:vD,sandbox_discuss_remove_target:ED,sandbox_discuss_reset:SD,sandbox_discuss_get_target:wD};function CD(e,t){t.editLock.setApp(!!e.data.data),HE(t.editLock.isTextLocked())}function TD(e,t){t.setEditorFocus(e.data.data)}function AD(e,t){let n=e.data.data;if(typeof n!="number")return;n=XI().correctOffset(n,!0),n=KI().correctOffset(n,!0);let r=ut().getElementByPosition(n);if(r&&!(r instanceof Element)&&(r=r.parentElement),!r||!ve(r))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-V.get("previewHeight")/2+i.height/2;t.messageService.send({operation:"application_scroll-to",settings:{value:V.get("applicationMode")==="default"?s+V.get("iframeOffsetTop"):s}})}var kD={sandbox_lock_edit:CD,editor_change_focus:TD,update_position_from_editor:AD};function LD(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 ND(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 xD(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 OD(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 RD={sandbox_set_attr_to_images:LD,sandbox_set_attr_to_links:ND,sandbox_set_position_to_img:xD,sandbox_set_position_to_link:OD},MD={brightness:100,contrast:100,sepia:0},nc={DARK:"dark",LIGHT:"light"},WE=!1;function PD(e){WE||(e.setFetchMethod(t=>window.fetch(t)),WE=!0)}function ID(){let e=null,t=nc.LIGHT;return{set(n){if(t=n,n===nc.DARK){e??(e=Uf(()=>Promise.resolve().then(()=>Dd("./darkreader.CyLMh7_H.js")),void 0,{}.url)),e.then(r=>{t===nc.DARK&&(PD(r),r.enable(MD))}).catch(r=>{e=null});return}e?.then(r=>{t===nc.LIGHT&&r.disable()})},clear(n){return n.replaceAll(/\s*?--darkreader.+?: .*?;/g,"")}}}var rc=ID();function DD(e,t){t.initPreview(!0)}function BD(e){const t=e.data?.data?.theme;(t==="light"||t==="dark")&&rc.set(t)}var HD={init_preview:DD,sandbox_switch_theme:BD};function _n(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(yy,{owner:e,handlers:s})}}}var FD={name:"sandbox.operationEnvironment",provides:[xr],setup(e){const t={iframeOffsetTop:0,previewHeight:0,elementPath:[]};V.subscribe(n=>{for(const r of["iframeOffsetTop","previewHeight","elementPath"])r in n&&n[r]!==void 0&&Object.assign(t,{[r]:n[r]})}),e.inject(xr,t)}},$D=_n("discuss",_D,{services:[Se,xr,Qe]},e=>{const t=ht(e),n=R(e,xr),r=R(e,Qe);return()=>({commit:t,editLock:r,iframeOffsetTop:n.iframeOffsetTop,previewHeight:n.previewHeight,messageService:j,removeAllAttributes:Mr})}),WD=_n("editor",kD,{services:[De,lt,Qe]},e=>{const t=R(e,De),n=R(e,lt),r=R(e,Qe);return()=>({applicationElementSettingsSet:t,editLock:r,messageService:j,setEditorFocus:o=>n.setEditorFocus(o)})}),qD=_n("images",RD,{services:[De,wt,Se,xr]},e=>{const t=R(e,De),n=R(e,wt),r=ht(e),o=R(e,xr);return()=>({applicationElementSettingsSet:t,commit:r,iframeOffsetTop:o.iframeOffsetTop,previewHeight:o.previewHeight,messageService:j,setCursorPosition:i=>n(i)})}),zD=_n("preview",HD,{services:[Ss]},e=>()=>({initPreview:t=>R(e,Ss)(t)})),UD={name:"sandbox.operationsDispatcher",setup(e){j.addListener(t=>{const n=t.data?.operation;if(!n)return;const r=e.getServices(yy).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)}})}},jD=[FD,$D,WD,qD,zD,UD],VD=["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"],GD=["style","class","align","href"],XD=new Set([...VD,"em-element-path_img"]);function KD(e){return e.split(/\s+/).filter(t=>t&&!XD.has(t)).join(" ")}var YD=32;function ZD(e){return!!(e.tagName==="BODY"||e.getAttribute("em")==="atom"||e.tagName==="TABLE"&&e.hasAttribute("em"))}function QD(e){const t=[e.tagName];for(const n of GD){const r=e.getAttribute(n),o=n==="class"&&r!==null?KD(r):r;o!==null&&o!==""&&t.push(`${n}=${o}`)}return t.join("|")}function JD(e){if(!e||!e.isConnected)return"";const t=[];let n=e,r=0;for(;n&&r<YD&&(t.push(QD(n)),!ZD(n));)n=n.parentElement,r++;return t.join("||")}function e5(e){let t={text:"",ancestors:""};const n=r=>({text:r?e(r):"",ancestors:JD(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 t5(e,t){t.onReleased(()=>{Promise.resolve().then(()=>{t.isLocked()||e.remember(document.querySelector("[em-edit]"))})})}var qE=Promise.resolve(),zE=null;function n5(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 r5(e,t){zE=e,qE=qE.finally(()=>{zE===e&&n5(e,t)})}function o5(e,t="unknown"){const n=It.getInstance(lt);if(!n){e();return}n.controller.whenEditorLostFocus(e,t)}var i5="em-inline",vse="br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object",$s="data-em-caret",Ese="​",Dn=e=>e();function Rt(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-em-caret")}function bo(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&e.tagName==="EM-REPLACE"&&!e.hasAttribute("src")}function Pr(e){return(e??"").replaceAll("​","")}function sm(e){return Pr(e.textContent)}function s5(e){return(e.nodeType===Node.TEXT_NODE||Rt(e))&&Pr(e.textContent)===""}function am(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=window.getSelection();r&&Ds(r,n)}function UE(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(!bo(r))return null;const o=document.createRange();if(o.selectNodeContents(r),o.setEnd(t,n),Pr(o.toString())==="")return{em:r,side:"before"};const i=document.createRange();return i.selectNodeContents(r),i.setStart(t,n),Pr(i.toString())===""?{em:r,side:"after"}:null}function lm(e,t){if(!e.collapsed)return null;const n=UE(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(Pr(t==="backward"?s.slice(0,o):s.slice(o))!=="")return null;const a=r.parentNode,l=Rt(a)?a:r;i=t==="backward"?l.previousSibling:l.nextSibling}else{const s=r.childNodes;i=t==="backward"?s[o-1]??null:s[o]??null}for(;i&&s5(i);)i=t==="backward"?i.previousSibling:i.nextSibling;return bo(i)?i:null}function oc(e,t,n=Dn){return cm(e,t,n)}function cm(e,t,n=Dn){const r=t==="after"?e.nextSibling:e.previousSibling;let o;if(Rt(r))o=r;else{const s=document.createElement("span");s.setAttribute($s,""),Jf(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 am(i,i.length),o}var jE="p, div, li, td, th, h1, h2, h3, h4, h5, h6, blockquote";function um(e,t=Dn,n=e.parentElement?.closest('[contenteditable="true"]')){l5(e,n)&&cm(e,"after",t)}function a5(e,t=Dn){const n=e.parentElement?.closest('[contenteditable="true"]');d5(e,n)||um(e,t,n)}function VE(e,t){const n=e.parentElement?.closest(jE);return n&&t.contains(n)?n:t}function GE(e){const t=e.cloneContents();return t.querySelectorAll(`[${$s}]`).forEach(n=>n.remove()),!/[^ \t\n\r]/.test(t.textContent??"")&&!t.querySelector("br, img, em-replace, table, hr, input, button, video, audio, svg, picture, canvas, iframe, object")}function XE(e,t){const n=document.createRange();return n.setStartAfter(e),n.setEnd(t,t.childNodes.length),GE(n)}function l5(e,t){return!!t&&XE(e,VE(e,t))}function c5(e){const{display:t}=getComputedStyle(e);return e.matches(jE)||t!==""&&t!=="inline"}function u5(e,t){for(let n=e.parentElement;n;n=n.parentElement)if(n===t?!t.hasAttribute("em-inline"):c5(n))return n;return t}function d5(e,t){if(!t)return!1;const n=document.createRange();return n.setStart(VE(e,t),0),n.setEndBefore(e),GE(n)}function KE(e){const t=Rt(e)&&sm(e)===""?e.previousSibling:null,n=t?.parentElement?.closest('[contenteditable="true"]');return t?.nodeName==="BR"&&!!n&&XE(t,u5(t,n))}function dm(e,t=Dn){if(!KE(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&&am(i,Array.prototype.indexOf.call(i.childNodes,o)),o}function YE(){const e=window.getSelection(),t=e?.rangeCount?e.getRangeAt(0):null,n=t?.collapsed?t.startContainer:null,r=Rt(n)?n:n?.parentNode;return KE(r)?r:null}function f5(e,t=Dn,n){return Array.from(e.querySelectorAll(`[${$s}]`)).filter(r=>r!==n).map(r=>dm(r,t)).some(Boolean)}function m5(e,t=Dn,n){const r=Array.from(e.querySelectorAll(`[${$s}]`)).filter(o=>o!==n&&Pr(o.textContent)==="");r.length&&t(()=>r.forEach(o=>o.remove()))}function h5(e,t=Dn){const n=Pr(e.textContent);if(n==="")return null;const r=document.createTextNode(n);return e.before(r),t(()=>e.remove()),am(r,r.length),r}function ZE(e){if(!e.collapsed)return;const{startContainer:t}=e,n=Rt(t)?t:t.parentNode;Rt(n)&&(bo(n.previousSibling)?e.setStartAfter(n):e.setStartBefore(n),e.collapse(!0))}function QE(e){e.querySelectorAll(`[${$s}]`).forEach(t=>{const n=Pr(t.textContent);n===""?t.remove():t.replaceWith(t.ownerDocument.createTextNode(n))})}function p5(e,t){const n=lm(e,t);if(!n)return null;const r=document.createRange();r.selectNode(n);const o=window.getSelection();return o&&Ds(o,r),n}function g5(e,t){const n=Array.from(e.querySelectorAll("em-replace")).find(i=>bo(i)&&t.intersectsNode(i)&&!JE(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 JE(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 b5(){document.execCommand("delete")}function y5(){const e=window.getSelection()?.getRangeAt(0);e?.deleteContents(),e?.collapse(!0)}function eS(e,t=Dn,n=b5){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=>bo(l)&&JE(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;bo(l)?oc(l,"after",t):!l&&bo(c)&&oc(c,"before",t)}return!0}function tS(){const e=window.getSelection();return e?.rangeCount?lm(e.getRangeAt(0),"backward"):null}function v5(e,t=Dn){const n=e.isConnected?e:tS();if(!n)return;const r=n.closest('[contenteditable="true"]');Ot(()=>r?.focus({preventScroll:!0})),oc(n,"after",t)}function E5(e){const t=e.innerHTML.trim();return[t==="&nbsp;",t==="<div>&nbsp;</div>",/^<div[^>]*>&nbsp;<\/div>$/.test(t),/^<[^>]*>&nbsp;<\/[^>]*>$/.test(t),t.replace(/<[^>]*>/g,"").trim()==="&nbsp;",e.textContent?.trim()===" "||e.textContent?.trim().charCodeAt(0)===160].some(n=>n===!0)}function S5(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 nS=Symbol("held-input-replay"),rS={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"},oS={deleteWordBackward:["backward","word"],deleteWordForward:["forward","word"],deleteSoftLineBackward:["backward","lineboundary"],deleteSoftLineForward:["forward","lineboundary"],deleteHardLineBackward:["backward","paragraphboundary"],deleteHardLineForward:["forward","paragraphboundary"]};function w5(e){return e in rS||e in oS}var _5={Backspace:["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward"],Delete:["deleteContentForward","deleteWordForward","deleteSoftLineForward"]},iS={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 fm(){return/Mac/.test(window.navigator.platform)}function sS(e){return fm()?e.altKey:e.ctrlKey}function C5(e){const t=e.ctrlKey||e.metaKey;return t&&/^[cxv]$/i.test(e.key)||e.key==="Insert"&&(t||e.shiftKey)}function T5(e){return e.key in iS||(e.ctrlKey||e.metaKey)&&e.key.length===1&&!C5(e)}function mm(e){return nS in e}function hm(e){return e.target?.closest?.('[contenteditable="true"], editor')??void 0}function aS(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=_5[e.key];if(t)return fm()&&e.metaKey?t[2]:sS(e)?t[1]:t[0]}function A5(e){const t=iS[e.key];if(!t)return;const n=fm()&&e.metaKey&&(e.key==="ArrowLeft"||e.key==="ArrowRight")?"lineboundary":sS(e)?t[2]:t[1];document.getSelection()?.modify?.(e.shiftKey?"extend":"move",t[0],n)}function pm(e){return Object.defineProperty(e,nS,{value:!0}),e}function lS(e,t){return e.isConnected&&t<=(e.nodeType===Node.TEXT_NODE?e.length:e.childNodes.length)}function cS(e){if(!lS(e.startContainer,e.startOffset)||!lS(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 k5(e,t){return t===void 0||cS(e)!==t?!1:(document.getSelection()?.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),!0)}function L5({inputType:e,data:t}){const n=oS[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=rS[e];r&&lr(r,!1,t??void 0)}function uS(e,t){if(t.target&&!k5(t.target,t.targetText))return;const{inputType:n,data:r}=t,o=pm(new window.InputEvent("beforeinput",{inputType:n,data:r,bubbles:!0,cancelable:!0}));e.dispatchEvent(o)&&L5(t)}function N5(e,t){const n=pm(new window.KeyboardEvent("keydown",{...t,bubbles:!0,cancelable:!0}));if(Object.defineProperty(n,"keyCode",{value:t.keyCode}),!e.dispatchEvent(n))return;const r=aS(t);r?uS(e,{inputType:r,data:r==="insertText"?t.key:null}):(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()==="a"?lr("selectAll"):A5(t)}var x5='[contenteditable="true"], editor';function gm(e){return(e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement)?.closest(x5)??void 0}function O5(){const e=document.getSelection();if(!e?.rangeCount||!e.anchorNode||!e.focusNode||!pt())return;const t=ut(),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 dS(e){e?.anchor.release(),e?.focus.release()}function fS({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&&!!gm(e)&&!n&&!t?.closest("em-replace, [data-em-caret]")}function mS(e){const t=e.current(),n=t===void 0||!pt()?void 0:ut().offsetToPoint(t);return n&&fS(n)?n:void 0}function R5(e){const t=e&&mS(e.anchor),n=e&&mS(e.focus);if(!(!t||!n))return document.getSelection()?.setBaseAndExtent(t.node,t.offset,n.node,n.offset),gm(t.node)}function M5(){const e=document.getSelection(),t=e?.rangeCount?e.anchorNode:null;return t&&fS({node:t})?gm(t):void 0}function P5(e){const t=R5(e)??M5();return t}function ic(e,t){const n=O5(),r=e(()=>{pt()&&ut().flushCommit();const o=P5(n);dS(n),o&&t(o)});return r||dS(n),r}function bm(e){e.preventDefault(),e.stopImmediatePropagation()}function I5(e){return/^(Tab|Escape|PageUp|PageDown|F\d{1,2})$/.test(e.key)||e.key==="Enter"&&(e.ctrlKey||e.metaKey)}var hS=e=>{if(!hm(e)||mm(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=>N5(u,l);aS(l)?Zf()&&ic(Yf,c)&&bm(e):T5(l)?LE()&&ic(AE,c)&&bm(e):I5(l)&&LE()&&NE()},pS=()=>{NE()},gS=e=>{if(!hm(e)||!w5(e.inputType)||e.isComposing||mm(e)||!Zf())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&&cS(n)};ic(Yf,o=>uS(o,r))&&bm(e)};function D5(e){return"clipboardData"in e?e.clipboardData:e.dataTransfer}var B5=["text/html","text/plain"];function H5(e,t){const n=Array.from(t.types??[]),r=Object.fromEntries(B5.filter(o=>n.includes(o)).map(o=>[o,t.getData(o)]));return pm({target:e.target,clipboardData:{types:Object.keys(r),files:[],getData:o=>r[o]??""},preventDefault:()=>{},stopPropagation:()=>{}})}function F5(e,t){if(mm(e)||!Zf()||!hm(e))return!1;try{const n=D5(e);if(!n||n.files?.length)return!1;const r=H5(e,n);if(!ic(Yf,()=>t(r)))return!1}catch{return e.preventDefault(),!1}return e.preventDefault(),e.stopPropagation(),!0}function $5(){return window.addEventListener("keydown",hS,!0),window.addEventListener("beforeinput",gS,!0),window.addEventListener("pointerdown",pS,!0),{dispose(){window.removeEventListener("keydown",hS,!0),window.removeEventListener("beforeinput",gS,!0),window.removeEventListener("pointerdown",pS,!0)}}}function W5(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 bS(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&&ve(t))for(;t.firstChild;)r.appendChild(t.firstChild);else r.textContent=e.toString();e.deleteContents(),e.insertNode(r)}catch{return null}return r}function q5(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 z5(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 U5(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 j5(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 yS(e,t=10){const n=e.length;return n===0?!1:(e.match(/[а-яА-ЯёЁ]/g)||[]).length/n*100>t}var V5={bold:"strong|s|b",italic:"em|i",strike:"strike",underline:"u",strikeUnderline:"strike|u"};function Ws(e,t){const n=V5[t]||t,r=new RegExp(`<\\/?(${n})>`,"gi");return e.replaceAll(r,"")}var G5=["strong","em","strike","sub","sup","b","i","s","u"];function X5(e,t){if(t)for(const n of G5)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 K5(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 Sse="#1C52DC",wse="#1C52DC",_se="#1C52DC";function Y5(e){if(typeof e.isContentEditable=="boolean")return e.isContentEditable;const t=e.closest("[contenteditable]");return!!t&&t.getAttribute("contenteditable")!=="false"}function vS(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 Z5(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||!Y5(o))return;const{display:i}=getComputedStyle(r);if(!(i&&i!=="inline")){if(!vS(r,t,n,!0))e.setStartAfter(r);else if(!vS(r,t,n,!1))e.setStartBefore(r);else return;e.collapse(!0)}}var Q5="./js/sanitize-html/sanitize-html.js",ES="data-sanitize-html-loader",sc=null,qs=null;function SS(){return typeof __useblocks__<"u"?__useblocks__:void 0}function J5(e){const t=SS();if(typeof t?.moduleTransport!="function"||t.blobBlocked)return null;try{return t.moduleTransport(e)}catch{return null}}function e3(){const e=SS();e&&(e.blobBlocked=!0)}function t3(){return new URL(Q5,document.baseURI||window.location.href).href}function ym(){const e=globalThis.sanitizeHtml;return typeof e!="function"||!("defaults"in e)?null:e}function n3(){if(ym())return Promise.resolve();const e=t3();return document.querySelector(`script[${ES}]`)?qs??Promise.resolve():(qs||(qs=r3(e).catch(t=>{throw qs=null,t})),qs)}async function r3(e){const t=J5(e);if(!t)return ac(e);const n=await t.catch(()=>null);if(!n)return ac(e);const r=URL.createObjectURL(n),o=await ac(r).then(()=>!0,()=>!1);URL.revokeObjectURL(r),o||(e3(),await ac(e))}function ac(e){return new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.async=!0,r.setAttribute(ES,"true"),r.onload=()=>t(),r.onerror=()=>{r.remove(),n(new Error(`Failed to load sanitize-html script: ${e}`))},document.head.appendChild(r)})}async function wS(){const e=ym();return e||(sc||(sc=(async()=>{await n3();const t=ym();if(t)return t;throw new Error("sanitizeHtml not available after script load")})().catch(t=>{throw sc=null,t})),sc)}function lc(e){return e?.nodeType===Node.TEXT_NODE}function o3(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 _S(e,t,n,r){const o=o3(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 CS(e,t,n,r){return e.node===t&&e.offset>n?{...e,offset:e.offset-r}:e}function vm(e,t,n=()=>"letter"){const r=e?.previousSibling,o=t?.nextSibling,i=lc(r)&&n(r)==="letter",s=i&&lc(e),a=lc(t)&&lc(o)&&(n(o)==="letter"||i&&n(o)==="new");if(!s&&!a)return;const l=window.getSelection(),c=s?r:e,u=a?o:t;if(!c||!u)return;const d=[];for(let y=c;y;y=y===u?null:y.nextSibling)d.push(y);const f=c.parentNode,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},b=_S(d,c,m.node,m.offset),C=_S(d,c,p.node,p.offset);let L=null,k=0;for(let y=c;y;){const g=y===u?null:y.nextSibling;y.nodeType!==Node.TEXT_NODE?L=null:L?(L.appendData(y.data),y.parentNode?.removeChild(y),k++):L=y,y=g}if(l&&(b||C)){const y=b?{node:b.head,offset:b.offset}:CS(m,f,h,k),g=C?{node:C.head,offset:C.offset}:CS(p,f,h,k);y.node&&g.node&&l.setBaseAndExtent(y.node,y.offset,g.node,g.offset)}}var i3=["strong","em","i","a","br","span","ul","ol","li","strike","sub","sup","s"],s3={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 a3(e){const t=/^\s*(\d+(?:\.\d+)?)(px|pt|em)?\s*$/i.exec(e??"");return t?`${t[1]}${(t[2]||"px").toLowerCase()}`:null}var l3=/<span\b(?:[^>"']|"[^"]*"|'[^']*')*>/gi,c3=/\sdata-(?:buffer|metadata)=(?:"[^"]*"|'[^']*')/gi;function u3(e){return e.replace(l3,t=>t.replace(c3,""))}function d3(e){const t=window.clipboardData;return("clipboardData"in e?e.clipboardData:e.dataTransfer)||t}function f3(e){return m3(e.replace(/\r\n?/g,`
31
+ `).replace(/\n$/,"").replace(/&/g,"&amp;").replace(/\n/g,"<br>"))}function m3(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 Ir=new Map,h3=3e3,p3=1e4;function g3(){const e=performance.now();return[...Ir.values()].some(t=>t.waiting&&e-t.startedAt<p3)}function b3(){for(const[e,t]of Ir)t.waiting&&(t.superseded=!0,Ir.delete(e))}function y3(){return Ir.size>0}async function v3(){let e;const t=new Promise(r=>{e=setTimeout(()=>{r()},h3)}),n=(async()=>{for(;Ir.size;)await Promise.allSettled(Ir.keys())})();await Promise.race([n,t]),clearTimeout(e)}function cc(e,t=!1,n,r,o){if(F5(e,a=>{cc(a,t,n,r,o)}))return Promise.resolve();if(g3())return e.preventDefault(),e.stopPropagation(),Promise.resolve();b3();const i={startedAt:performance.now(),waiting:!0,superseded:!1},s=E3(e,t,n,r,o,i);return Ir.set(s,i),s.finally(()=>Ir.delete(s))}function TS(){const e=window.getSelection();e?.rangeCount&&Z5(e.getRangeAt(0))}async function E3(e,t,n,r,o,i){e.preventDefault(),e.stopPropagation();const s=d3(e);if(!s)return;const a=s.getData("text/html"),l=s.getData("text/plain");try{let c=a;if(!c||t)TS(),c=f3(l);else{const d=await wS();if(i.superseded)return;TS();const f=n?.text?.fontSize||16;let h=d(u3(c),{allowedTags:i3,allowedAttributes:s3,allowedStyles:{},transformTags:{span:function(y,g){let E="",_=!1,S=!1;if(g.style){const v=g.style.toLowerCase();(v.includes("font-weight: bold")||v.includes("font-weight:bold")||v.includes("font-weight: 700")||v.includes("font-weight:700"))&&(_=!0),(v.includes("font-style: italic")||v.includes("font-style:italic"))&&(S=!0),v.includes("text-decoration: underline")||v.includes("text-decoration:underline"),_&&S?(E="strong",g["data-italic"]="true"):_?E="strong":S&&(E="em")}return{tagName:E||"",attribs:g}},h1:function(y,g){return g["data-font-size"]=Math.round(1.5*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h2:function(y,g){return g["data-font-size"]=Math.round(1.25*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h3:function(y,g){return g["data-font-size"]=Math.round(1.125*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h4:function(y,g){return g["data-font-size"]=f.toString(),g["data-bold"]="true",g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},h5:function(y,g){return g["data-font-size"]=Math.round(.875*f).toString(),g.style&&(g.style.toLowerCase().includes("font-style: italic")||g.style.toLowerCase().includes("font-style:italic"))&&(g["data-italic"]="true"),{tagName:"span",attribs:g}},ul:function(y,g){return g["data-list-type"]="unordered",delete g.style,delete g["margin-top"],delete g["margin-bottom"],delete g["padding-inline-start"],{tagName:"ul",attribs:g}},ol:function(y,g){return g["data-list-type"]="ordered",g.start&&(g["data-list-start"]=g.start),delete g.style,delete g.start,{tagName:"ol",attribs:g}},li:function(y,g){return g["data-list-item"]="true",delete g.style,delete g.dir,delete g["aria-level"],delete g["list-style-type"],{tagName:"li",attribs:g}},p:function(y,g){return{tagName:"br",attribs:{}}},div:"br",b:function(y,g){if(g.style){const E=g.style.toLowerCase();return E.includes("font-weight: bold")||E.includes("font-weight:bold")||E.includes("font-weight: 700")||E.includes("font-weight:700")?{tagName:"strong"}:!1}return{tagName:"strong"}},i:function(y,g){if(g.style){const E=g.style.toLowerCase();return E.includes("font-style: italic")||E.includes("font-style:italic")?{tagName:"em"}:!1}return{tagName:"em"}},s:function(y,g){return{tagName:"strike",attribs:g}}},textFilter:function(y){return y.replace(/\s+/g," ")}});h=h.replace(/<[^\/>][^>]*>\s*<\/[^>]+>/g,"").replace(/(<br\s*\/?>){2,}/g,"<br>").trim();const m=document.createElement("div");m.innerHTML=h,(y=>{y.querySelectorAll("ul[data-list-type], ol[data-list-type]").forEach((g,E)=>{const _=g.getAttribute("data-list-type")==="ordered",S=g.querySelectorAll("li[data-list-item]");let v=1;_&&g.getAttribute("data-list-start")&&(v=parseInt(g.getAttribute("data-list-start"),10)||1);const T=document.createDocumentFragment(),w=g.previousSibling;w&&(w.nodeType===Node.TEXT_NODE&&w.textContent.trim()!==""||w.nodeType===Node.ELEMENT_NODE&&w.tagName!=="BR")&&T.appendChild(document.createElement("br")),S.forEach((N,x)=>{const D=document.createElement("span");D.innerHTML=_?`${v}. `:"• ",T.appendChild(D),(O=>{const z=document.createElement("div");z.innerHTML=O.innerHTML;let he=z.firstChild;for(;he&&he.nodeType===1&&he.tagName==="BR";)z.removeChild(he),he=z.firstChild;if(!z.hasChildNodes()){const oe=document.createTextNode("");z.appendChild(oe)}for(;z.firstChild;)T.appendChild(z.firstChild)})(N),x<S.length-1&&T.appendChild(document.createElement("br")),v++}),g.parentNode.replaceChild(T,g)}),y.querySelectorAll("[data-list-type], [data-list-item], [data-list-start]").forEach(g=>{g.removeAttribute("data-list-type"),g.removeAttribute("data-list-item"),g.removeAttribute("data-list-start")})})(m),m.firstChild&&m.firstChild.nodeType===Node.ELEMENT_NODE&&m.firstChild.tagName==="BR"&&m.removeChild(m.firstChild),m.querySelectorAll("[data-font-size]").forEach(y=>{const g=a3(y.getAttribute("data-font-size"));let E=g?`font-size: ${g};`:"";y.getAttribute("data-bold")==="true"&&(E+=" font-weight: bold;"),y.getAttribute("data-italic")==="true"&&(E+=" font-style: italic;"),E&&y.setAttribute("style",E.trim()),y.removeAttribute("data-font-size"),y.removeAttribute("data-bold"),y.removeAttribute("data-italic")}),m.querySelectorAll("[data-italic]").forEach(y=>{const g=document.createElement("em");g.innerHTML=y.innerHTML,y.innerHTML="",y.appendChild(g),y.removeAttribute("data-italic")}),m.querySelectorAll("a").forEach(y=>{const g=y.getAttribute("href");if(!g||g.trim()==="")y.replaceWith(...y.childNodes);else{y.setAttribute("target","_blank");const E=n?.links?.color??"#1C52DC",_=n?.links?.underline??!0?"underline":"none";y.setAttribute("style",`color: ${E}; text-decoration: ${_};`)}});const b=m.querySelectorAll("*");let C=0;b.forEach(y=>{y.tagName!=="BR"&&y.tagName!=="SPAN"&&y.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&(y.parentNode.removeChild(y),C++)}),m.querySelectorAll("span").forEach(y=>{y.innerHTML==="• "||/^\d+\.&nbsp;$/.test(y.innerHTML)||y.textContent.replace(/[\u200B-\u200F\uFEFF\u2000-\u200A\u2028\u2029\u2060\u00A0\u1680\u180E]/g,"").trim()===""&&y.children.length===0&&(y.parentNode.removeChild(y),C++)});const L=window.getSelection(),k=L?.anchorNode?.nodeType===Node.ELEMENT_NODE?L.anchorNode:L?.anchorNode?.parentElement||null;X5(m,k),K5(m,k),c=m.innerHTML}const u=window.getSelection();if(u&&u.rangeCount>0){const d=u.getRangeAt(0);ZE(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),vm(h,m,tm)}}catch{if(i.superseded)return;lr("insertText",!1,l)}i.waiting=!1,r(e),o(),await new Promise(c=>setTimeout(c,0))}var uc=e=>e?.trim().replaceAll(/[\s\u00A0]+/g," ").replaceAll(/\n/g,"");function AS(e){let t=e;for(;t;){if(t.tagName==="TR")return t;t=t.parentElement}return null}function yo(e,t){return Array.from(e.classList).find(n=>n.includes(t))}function kS(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?kS(t):!1)}function $(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 S3(e){try{return JSON.parse(e),!0}catch{return!1}}function LS(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 ai(e){const t=window.getSelection();t&&(t.removeAllRanges(),t.addRange(e))}function w3(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 dc(){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 Em(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 zs(e,t=dc()){e=uc(e)??"";const n=i=>uc(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=zs(e,s),o))break}return o}function fc(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 mc(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&&mc({elem:e.elem.previousSibling,width:e.width})}function _3(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 C3=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 NS(e,t){if(!e)return"";const n=t(e);return n===void 0?[...e.childNodes].map(r=>NS(r,t)).join(""):n}function T3(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 A3(e,t=!0){const n=document.createRange(),r=window.getSelection();r&&(n.selectNodeContents(e),n.collapse(t),r.removeAllRanges(),r.addRange(n))}function k3(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 Us(){return xI()}function L3(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 xS(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)xS(r,t)}}function N3(e=document){e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}var x3=0;function bt(e){return e>=48&&e<=57}function Dr(e){return bt(e)||e>=65&&e<=70||e>=97&&e<=102}function Sm(e){return e>=65&&e<=90}function O3(e){return e>=97&&e<=122}function R3(e){return Sm(e)||O3(e)}function M3(e){return e>=128}function hc(e){return R3(e)||M3(e)||e===95}function OS(e){return hc(e)||bt(e)||e===45}function P3(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function pc(e){return e===10||e===13||e===12}function vo(e){return pc(e)||e===32||e===9}function Bn(e,t){return!(e!==92||pc(t)||t===x3)}function gc(e,t,n){return e===45?hc(t)||t===45||Bn(t,n):hc(e)?!0:e===92?Bn(e,t):!1}function wm(e,t,n){return e===43||e===45?bt(t)?2:t===46&&bt(n)?3:0:e===46?bt(t)?2:0:bt(e)?1:0}function RS(e){return e===65279||e===65534?1:0}var _m=new Array(128),Cse=128,Tse=130,Ase=131,kse=132,Lse=133;for(let e=0;e<_m.length;e++)_m[e]=vo(e)&&130||bt(e)&&131||hc(e)&&132||P3(e)&&133||e||128;function Cm(e){return e<128?_m[e]:132}function li(e,t){return t<e.length?e.charCodeAt(t):0}function Tm(e,t,n){return n===13&&li(e,t+1)===10?2:1}function ci(e,t,n){let r=e.charCodeAt(t);return Sm(r)&&(r=r|32),r===n}function js(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(Sm(s)&&(s=s|32),s!==i)return!1}return!0}function I3(e,t){for(;t>=0&&vo(e.charCodeAt(t));t--);return t+1}function bc(e,t){for(;t<e.length&&vo(e.charCodeAt(t));t++);return t}function Am(e,t){for(;t<e.length&&bt(e.charCodeAt(t));t++);return t}function ui(e,t){if(t+=2,Dr(li(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&Dr(li(e,t));t++);const n=li(e,t);vo(n)&&(t+=Tm(e,t,n))}return t}function yc(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!OS(n)){if(Bn(n,li(e,t+1))){t=ui(e,t)-1;continue}break}}return t}function vc(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),bt(n)&&(t=Am(e,t+1),n=e.charCodeAt(t)),n===46&&bt(e.charCodeAt(t+1))&&(t+=2,t=Am(e,t)),ci(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),bt(n)&&(t=Am(e,t+1+r+1))}return t}function km(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}Bn(n,li(e,t+1))&&(t=ui(e,t))}return t}function MS(e){if(e.length===1&&!Dr(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 PS=["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"],D3=16384;function Ec(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,D3)):e}var IS=10,B3=12,DS=13;function BS(e){const t=e.source,n=t.length,r=t.length>0?RS(t.charCodeAt(0)):0,o=Ec(e.lines,n),i=Ec(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===IS||c===DS||c===B3)&&(c===DS&&l+1<n&&t.charCodeAt(l+1)===IS&&(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 H3=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||BS(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||BS(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]}}}},an=16777215,Br=24,F3=new Map([[2,22],[21,22],[19,20],[23,24]]),$3=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=Ec(this.offsetAndType,e.length+1),o=Ec(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&an;for(a=o[f],s=a>>Br,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=F3.get(c),a=s<<Br|i}r[i++]=c<<Br|d,l===-1&&(l=u)}),r[i]=0<<Br|n,o[i]=n,o[n]=n;a!==0;){const c=a&an;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]>>Br:0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&an:this.source.length}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount?js(this.source,this.offsetAndType[e-1]&an,this.offsetAndType[e]&an,t):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&an:this.offsetAndType[this.tokenCount]&an: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]&an,t=this.offsetAndType[t],this.tokenType=t>>Br,this.tokenEnd=t&an):(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>>Br,this.tokenEnd=e&an):(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]&an: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&an,s=o>>Br;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:PS[t],chunk:this.source.substring(n,r),balance:this.balance[o]}}),e}};function Sc(e,t){function n(d){return d<a?e.charCodeAt(d):0}function r(){if(c=vc(e,c),gc(n(c),n(c+1),n(c+2))){u=12,c=yc(e,c);return}if(n(c)===37){u=11,c++;return}u=10}function o(){const d=c;if(c=yc(e,c),js(e,d,c,"url")&&n(c)===40){if(c=bc(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(Cm(f)){case d:c++;return;case 130:if(pc(f)){c+=Tm(e,c,f),u=6;return}break;case 92:if(c===e.length-1)break;const h=n(c+1);pc(h)?c+=Tm(e,c+1,h):Bn(f,h)&&(c=ui(e,c)-1)}}}function s(){for(u=7,c=bc(e,c);c<e.length;c++){const d=e.charCodeAt(c);switch(Cm(d)){case 41:c++;return;case 130:if(c=bc(e,c),n(c)===41||c>=e.length){c<e.length&&c++;return}c=km(e,c),u=8;return;case 34:case 39:case 40:case 133:c=km(e,c),u=8;return;case 92:if(Bn(d,n(c+1))){c=ui(e,c)-1;break}c=km(e,c),u=8;return}}}e=String(e||"");const a=e.length;let l=RS(n(0)),c=l,u;for(;c<a;){const d=e.charCodeAt(c);switch(Cm(d)){case 130:u=13,c=bc(e,c+1);break;case 34:i();break;case 35:OS(n(c+1))||Bn(n(c+1),n(c+2))?(u=4,c=yc(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:wm(d,n(c+1),n(c+2))?r():(u=9,c++);break;case 44:u=18,c++;break;case 45:wm(d,n(c+1),n(c+2))?r():n(c+1)===45&&n(c+2)===62?(u=15,c=c+3):gc(d,n(c+1),n(c+2))?o():(u=9,c++);break;case 46:wm(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:gc(n(c+1),n(c+2),n(c+3))?(u=3,c=yc(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 di=null,et=class On{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return On.createItem(t)}allocateCursor(t,n){let r;return di!==null?(r=di,di=di.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=di,di=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=On.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 On;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 On;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 On;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(On.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(On.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(On.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(On.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(On.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 wc(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 HS=100,W3=60,q3=" ";function FS({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>HS&&(c=n-W3+3,n=58);for(let u=s;u<=a;u++)u>=0&&u<i.length&&(i[u]=i[u].replace(/\t/g,q3),i[u]=(c>0&&i[u].length>c?"…":"")+i[u].substr(c,98)+(i[u].length>c+HS-1?"…":""));return[o(s,t),new Array(n+l+2).join("-")+"^",o(t,a)].filter(Boolean).join(`
35
+ `)}function $S(e,t,n,r,o){return Object.assign(wc("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment(i){return FS({source:t,line:r,column:o},isNaN(i)?0:i)},get formattedMessage(){return`Parse error: ${e}
36
+ `+FS({source:t,line:r,column:o},2)}})}function z3(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 WS=()=>{},U3=33,j3=35,Lm=59,qS=123,zS=0;function V3(e){return function(){return this[e]()}}function Nm(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 G3(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:Nm(e.atrule),pseudo:Nm(e.pseudo),node:Nm(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]=V3(e.parseContext[n])}return{config:t,...t,...t.node}}function X3(e){let t="",n="<unknown>",r=!1,o=WS,i=!1;const s=new H3,a=Object.assign(new $3,G3(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:z3,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(c){return c===qS?1:0},consumeUntilLeftCurlyBracketOrSemicolon(c){return c===qS||c===Lm?1:0},consumeUntilExclamationMarkOrSemicolon(c){return c===U3||c===Lm?1:0},consumeUntilSemicolonIncluded(c){return c===Lm?2:0},createList(){return new et},createSingleNodeList(c){return new et().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!==zS);return zS},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 ci(t,c,u)},cmpStr(c,u,d){return js(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,vc(t,this.tokenStart));return this.eat(c),u},eat(c){if(this.tokenType!==c){const u=PS[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(j3)&&(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(I3(t,t.length-1)):s.getLocation(this.tokenStart);throw new $S(c||"Unexpected input",t,d.offset,d.line,d.column)}});return Object.assign(function(c,u){t=c,u=u||{},a.setSource(t,Sc),s.setSource(t,u.offset,u.line,u.column),n=u.filename||"<unknown>",r=!!u.positions,o=typeof u.onParseError=="function"?u.onParseError:WS,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,b)=>{if(m===25){const C=a.getLocation(p,b),L=js(t,b-2,b,"*/")?t.slice(p+2,b-2):t.slice(p+2,b);f(L,C)}});const h=a.context[d].call(a,u);return a.eof||a.error(),h},{SyntaxError:$S,config:a.config})}var K3=Ar((e=>{var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(n){if(0<=n&&n<t.length)return t[n];throw new TypeError("Must be between 0 and 63: "+n)},e.decode=function(n){var r=65,o=90,i=97,s=122,a=48,l=57,c=43,u=47,d=26,f=52;return r<=n&&n<=o?n-r:i<=n&&n<=s?n-i+d:a<=n&&n<=l?n-a+f:n==c?62:n==u?63:-1}})),Y3=Ar((e=>{var t=K3(),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,b;do{if(u>=f)throw new Error("Expected more digits in base 64 VLQ value.");if(b=t.decode(c.charCodeAt(u++)),b===-1)throw new Error("Invalid base64 digit: "+c.charAt(u-1));p=!!(b&i),b&=o,h=h+(b<<m),m+=n}while(p);d.value=a(h),d.rest=u}})),xm=Ar((e=>{function t(S,v,T){if(v in S)return S[v];if(arguments.length===3)return T;throw new Error('"'+v+'" is a required argument.')}e.getArg=t;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(S){var v=S.match(n);return v?{scheme:v[1],auth:v[2],host:v[3],port:v[4],path:v[5]}:null}e.urlParse=o;function i(S){var v="";return S.scheme&&(v+=S.scheme+":"),v+="//",S.auth&&(v+=S.auth+"@"),S.host&&(v+=S.host),S.port&&(v+=":"+S.port),S.path&&(v+=S.path),v}e.urlGenerate=i;var s=32;function a(S){var v=[];return function(T){for(var w=0;w<v.length;w++)if(v[w].input===T){var N=v[0];return v[0]=v[w],v[w]=N,v[0].result}var x=S(T);return v.unshift({input:T,result:x}),v.length>s&&v.pop(),x}}var l=a(function(v){var T=v,w=o(v);if(w){if(!w.path)return v;T=w.path}for(var N=e.isAbsolute(T),x=[],D=0,P=0;;)if(D=P,P=T.indexOf("/",D),P===-1){x.push(T.slice(D));break}else for(x.push(T.slice(D,P));P<T.length&&T[P]==="/";)P++;for(var O,z=0,P=x.length-1;P>=0;P--)O=x[P],O==="."?x.splice(P,1):O===".."?z++:z>0&&(O===""?(x.splice(P+1,z),z=0):(x.splice(P,2),z--));return T=x.join("/"),T===""&&(T=N?"/":"."),w?(w.path=T,i(w)):T});e.normalize=l;function c(S,v){S===""&&(S="."),v===""&&(v=".");var T=o(v),w=o(S);if(w&&(S=w.path||"/"),T&&!T.scheme)return w&&(T.scheme=w.scheme),i(T);if(T||v.match(r))return v;if(w&&!w.host&&!w.path)return w.host=v,i(w);var N=v.charAt(0)==="/"?v:l(S.replace(/\/+$/,"")+"/"+v);return w?(w.path=N,i(w)):N}e.join=c,e.isAbsolute=function(S){return S.charAt(0)==="/"||n.test(S)};function u(S,v){S===""&&(S="."),S=S.replace(/\/$/,"");for(var T=0;v.indexOf(S+"/")!==0;){var w=S.lastIndexOf("/");if(w<0||(S=S.slice(0,w),S.match(/^([^\/]+:\/)?\/*$/)))return v;++T}return Array(T+1).join("../")+v.substr(S.length+1)}e.relative=u;var d=(function(){return!("__proto__"in Object.create(null))})();function f(S){return S}function h(S){return p(S)?"$"+S:S}e.toSetString=d?f:h;function m(S){return p(S)?S.slice(1):S}e.fromSetString=d?f:m;function p(S){if(!S)return!1;var v=S.length;if(v<9||S.charCodeAt(v-1)!==95||S.charCodeAt(v-2)!==95||S.charCodeAt(v-3)!==111||S.charCodeAt(v-4)!==116||S.charCodeAt(v-5)!==111||S.charCodeAt(v-6)!==114||S.charCodeAt(v-7)!==112||S.charCodeAt(v-8)!==95||S.charCodeAt(v-9)!==95)return!1;for(var T=v-10;T>=0;T--)if(S.charCodeAt(T)!==36)return!1;return!0}function b(S,v,T){var w=y(S.source,v.source);return w!==0||(w=S.originalLine-v.originalLine,w!==0)||(w=S.originalColumn-v.originalColumn,w!==0||T)||(w=S.generatedColumn-v.generatedColumn,w!==0)||(w=S.generatedLine-v.generatedLine,w!==0)?w:y(S.name,v.name)}e.compareByOriginalPositions=b;function C(S,v,T){var w=S.originalLine-v.originalLine;return w!==0||(w=S.originalColumn-v.originalColumn,w!==0||T)||(w=S.generatedColumn-v.generatedColumn,w!==0)||(w=S.generatedLine-v.generatedLine,w!==0)?w:y(S.name,v.name)}e.compareByOriginalPositionsNoSource=C;function L(S,v,T){var w=S.generatedLine-v.generatedLine;return w!==0||(w=S.generatedColumn-v.generatedColumn,w!==0||T)||(w=y(S.source,v.source),w!==0)||(w=S.originalLine-v.originalLine,w!==0)||(w=S.originalColumn-v.originalColumn,w!==0)?w:y(S.name,v.name)}e.compareByGeneratedPositionsDeflated=L;function k(S,v,T){var w=S.generatedColumn-v.generatedColumn;return w!==0||T||(w=y(S.source,v.source),w!==0)||(w=S.originalLine-v.originalLine,w!==0)||(w=S.originalColumn-v.originalColumn,w!==0)?w:y(S.name,v.name)}e.compareByGeneratedPositionsDeflatedNoLine=k;function y(S,v){return S===v?0:S===null?1:v===null?-1:S>v?1:-1}function g(S,v){var T=S.generatedLine-v.generatedLine;return T!==0||(T=S.generatedColumn-v.generatedColumn,T!==0)||(T=y(S.source,v.source),T!==0)||(T=S.originalLine-v.originalLine,T!==0)||(T=S.originalColumn-v.originalColumn,T!==0)?T:y(S.name,v.name)}e.compareByGeneratedPositionsInflated=g;function E(S){return JSON.parse(S.replace(/^\)]}'[^\n]*\n/,""))}e.parseSourceMapInput=E;function _(S,v,T){if(v=v||"",S&&(S[S.length-1]!=="/"&&v[0]!=="/"&&(S+="/"),v=S+v),T){var w=o(T);if(!w)throw new Error("sourceMapURL could not be parsed");if(w.path){var N=w.path.lastIndexOf("/");N>=0&&(w.path=w.path.substring(0,N+1))}v=c(i(w),v)}return l(v)}e.computeSourceURL=_})),Z3=Ar((e=>{var t=xm(),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})),Q3=Ar((e=>{var t=xm();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})),J3=Ar((e=>{var t=Y3(),n=xm(),r=Z3().ArraySet,o=Q3().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 b=m.source;b!=null&&!f.has(b)&&f.add(b);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,b,C,L=this._mappings.toArray(),k=0,y=L.length;k<y;k++){if(p=L[k],m="",p.generatedLine!==l)for(a=0;p.generatedLine!==l;)m+=";",l++;else if(k>0){if(!n.compareByGeneratedPositionsInflated(p,L[k-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&&(b=this._names.indexOf(p.name),m+=t.encode(b-d),d=b)),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})),e4=J3(),US=new Set(["Atrule","Selector","Declaration"]);function t4(e){const t=new e4.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&&US.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&&US.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 jS=re({safe:()=>XS,spec:()=>i4}),n4=43,r4=45,Om=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){const n=e.charCodeAt(0);return n>127?32768:n<<8}return e},VS=[[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],["/","*"]],o4=VS.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 GS(e){const t=new Set(e.map(([n,r])=>Om(n)<<16|Om(r)));return function(n,r,o){const i=Om(r,o),s=o.charCodeAt(0);return(s===r4&&r!==1&&r!==2&&r!==15||s===n4?t.has(n<<16|s<<8):t.has(n<<16|i))&&this.emit(" ",13,!0),i}}var i4=GS(VS),XS=GS(o4),s4=92;function a4(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 l4(e){Sc(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function c4(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:XS,token(l,c){i=this.tokenBefore(i,l,c),this.emit(c,l,!1),l===9&&c.charCodeAt(0)===s4&&this.emit(`
37
+ `,13,!0)},emit(l){o+=l},result(){return o}};r&&(typeof r.decorator=="function"&&(s=r.decorator(s)),r.sourceMap&&(s=t4(s)),r.mode in jS&&(s.tokenBefore=jS[r.mode]));const a={node:l=>s.node(l),children:a4,token:(l,c)=>s.token(l,c),tokenize:l4};return s.node(n),s.result()}}function u4(e){return{fromPlainObject(t){return e(t,{enter(n){n.children&&!(n.children instanceof et)&&(n.children=new et().fromArray(n.children))}}),t},toPlainObject(t){return e(t,{leave(n){n.children&&n.children instanceof et&&(n.children=n.children.toArray())}}),t}}}var{hasOwnProperty:Rm}=Object.prototype,Vs=function(){};function KS(e){return typeof e=="function"?e:Vs}function YS(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function d4(e,t){const n=t.structure,r=[];for(const o in n){if(Rm.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 f4(e){const t={};for(const n in e.node)if(Rm.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]=d4(n,r)}return t}function ZS(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 QS({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 m4(e){const t=f4(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const c in t)Rm.call(t,c)&&t[c]!==null&&(n[c]=ZS(t[c],!1),r[c]=ZS(t[c],!0));const s=QS(n),a=QS(r),l=function(c,u){function d(C,L,k){const y=f.call(b,C,L,k);return y===o?!0:y===i?!1:!!(m.hasOwnProperty(C.type)&&m[C.type](C,b,d,p)||h.call(b,C,L,k)===o)}let f=Vs,h=Vs,m=n,p=(C,L,k,y)=>C||d(L,k,y);const b={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=KS(u.enter),h=KS(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=YS(f,u.visit),h=YS(h,u.visit)}if(f===Vs&&h===Vs)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 h4(e){return e}function p4(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 g4(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 b4(e,t,n,r){const o=e.combinator===" "||r?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>Mm(s,t,n,r)).join(o);return e.explicit||n?(r||i[0]===","?"[":"[ ")+i+(r?"]":" ]"):i}function Mm(e,t,n,r){let o;switch(e.type){case"Group":o=b4(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Mm(e.term,t,n,r)+t(p4(e),e);case"Type":o="<"+e.name+(e.opts?t(g4(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 Pm(e,t){let n=h4,r=!1,o=!1;return typeof t=="function"?n=t:t&&(r=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(n=t.decorate)),Mm(e,n,r,o)}var JS={offset:0,line:1,column:1};function y4(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=_c(i||t,"end")||Gs(JS,c),d=Gs(u)):(u=_c(i,"start")||Gs(_c(t,"start")||JS,c.slice(0,s)),d=_c(i,"end")||Gs(u,c.substr(s,a))),{css:c,mismatchOffset:s,mismatchLength:a,start:u,end:d}}function _c(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?Gs(n):n:null}function Gs({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 Xs=function(e,t){const n=wc("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},v4=function(e,t,n,r){const o=wc("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:a,start:l,end:c}=y4(r,n);return o.rawMessage=e,o.syntax=t?Pm(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},Cc=new Map,fi=new Map,Tc=45,Cn=E4,mi=S4;function Im(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Tc&&e.charCodeAt(t+1)===Tc}function e1(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Tc&&e.charCodeAt(t+1)!==Tc){const n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function E4(e){if(Cc.has(e))return Cc.get(e);const t=e.toLowerCase();let n=Cc.get(t);if(n===void 0){const r=Im(t,0),o=r?"":e1(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return Cc.set(e,n),n}function S4(e){if(fi.has(e))return fi.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");const r=Im(t,n.length);if(!r&&(t=t.toLowerCase(),fi.has(t))){const a=fi.get(t);return fi.set(e,a),a}const o=r?"":e1(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 fi.set(e,s),s}var t1=["initial","inherit","unset","revert","revert-layer"],Ks=43,Hn=45,Dm=110,hi=!0,w4=!1;function Bm(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Ys(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function Hr(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(o===Ks||o===Hn){if(n)return 0;t++}for(;t<e.value.length;t++)if(!bt(e.value.charCodeAt(t)))return 0;return r+1}function Hm(e,t,n){let r=!1,o=Ys(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(Bm(e,Ks)||Bm(e,Hn)){if(r=!0,o=Ys(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!==Ks&&i!==Hn)return 0}return Hr(e,r?0:1,r,o)}function _4(e,t){let n=0;if(!e)return 0;if(e.type===10)return Hr(e,0,w4,n);if(e.type===1&&e.value.charCodeAt(0)===Hn){if(!ci(e.value,1,Dm))return 0;switch(e.value.length){case 2:return Hm(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==Hn?0:(n=Ys(t(++n),n,t),e=t(n),Hr(e,0,hi,n));default:return e.value.charCodeAt(2)!==Hn?0:Hr(e,3,hi,n)}}else if(e.type===1||Bm(e,Ks)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!ci(e.value,0,Dm))return 0;switch(e.value.length){case 1:return Hm(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==Hn?0:(n=Ys(t(++n),n,t),e=t(n),Hr(e,0,hi,n));default:return e.value.charCodeAt(1)!==Hn?0:Hr(e,2,hi,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===Ks||r===Hn?1:0,i=o;for(;i<e.value.length&&bt(e.value.charCodeAt(i));i++);return i===o||!ci(e.value,i,Dm)?0:i+1===e.value.length?Hm(t(++n),n,t):e.value.charCodeAt(i+1)!==Hn?0:i+2===e.value.length?(n=Ys(t(++n),n,t),e=t(n),Hr(e,0,hi,n)):Hr(e,i+2,hi,n)}return 0}var C4=43,n1=45,r1=63,T4=117;function Fm(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function A4(e,t){return e.value.charCodeAt(0)===t}function Zs(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){const i=e.value.charCodeAt(o);if(i===n1&&n&&r!==0)return Zs(e,t+r+1,!1),6;if(!Dr(i)||++r>6)return 0}return r}function Ac(e,t,n){if(!e)return 0;for(;Fm(n(t),r1);){if(++e>6)return 0;t++}return t}function k4(e,t){let n=0;if(e===null||e.type!==1||!ci(e.value,0,T4)||(e=t(++n),e===null))return 0;if(Fm(e,C4))return e=t(++n),e===null?0:e.type===1?Ac(Zs(e,0,!0),++n,t):Fm(e,r1)?Ac(1,++n,t):0;if(e.type===10){const r=Zs(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!A4(e,n1)||!Zs(e,1,!1)?0:n+1:Ac(r,n,t))}return e.type===12?Ac(Zs(e,1,!0),++n,t):0}var L4=["calc(","-moz-calc(","-webkit-calc("],$m=new Map([[2,22],[21,22],[19,20],[23,24]]),N4=["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"],x4=["deg","grad","rad","turn"],O4=["s","ms"],R4=["hz","khz"],M4=["dpi","dpcm","dppx","x"],P4=["fr"],I4=["db"],D4=["st"];function Tn(e,t){return t<e.length?e.charCodeAt(t):0}function o1(e,t){return js(e,0,e.length,t)}function i1(e,t){for(let n=0;n<t.length;n++)if(o1(e,t[n]))return!0;return!1}function s1(e,t){return t!==e.length-2?!1:Tn(e,t)===92&&bt(Tn(e,t+1))}function kc(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 B4(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=$m.get(e.type)}o++}while(e=t(o));return o}function ln(e){return function(t,n,r){return t===null?0:t.type===2&&i1(t.value,L4)?B4(t,n):e(t,n,r)}}function Pe(e){return function(t){return t===null||t.type!==e?0:1}}function H4(e){if(e===null||e.type!==1)return 0;const t=e.value.toLowerCase();return i1(t,t1)||o1(t,"default")?0:1}function F4(e){return e===null||e.type!==1||Tn(e.value,0)!==45||Tn(e.value,1)!==45?0:1}function $4(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(!Dr(Tn(e.value,n)))return 0;return 1}function W4(e){return e===null||e.type!==4||!gc(Tn(e.value,1),Tn(e.value,2),Tn(e.value,3))?0:1}function q4(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=$m.get(e.type)}o++}while(e=t(o));return o}function z4(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=$m.get(e.type)}o++}while(e=t(o));return o}function cr(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;const o=vc(t.value,0);if(e!==null){const i=t.value.indexOf("\\",o),s=i===-1||!s1(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return kc(r,t.value,o)?0:1}}function U4(e,t,n){return e===null||e.type!==11||kc(n,e.value,e.value.length-1)?0:1}function a1(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 j4(e,t,n){if(e===null)return 0;const r=vc(e.value,0);return r!==e.value.length&&!s1(e.value,r)||kc(n,e.value,r)?0:1}function V4(e,t,n){if(e===null||e.type!==10)return 0;let r=Tn(e.value,0)===43||Tn(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!bt(Tn(e.value,r)))return 0;return kc(n,e.value,r)?0:1}var l1={"ident-token":Pe(1),"function-token":Pe(2),"at-keyword-token":Pe(3),"hash-token":Pe(4),"string-token":Pe(5),"bad-string-token":Pe(6),"url-token":Pe(7),"bad-url-token":Pe(8),"delim-token":Pe(9),"number-token":Pe(10),"percentage-token":Pe(11),"dimension-token":Pe(12),"whitespace-token":Pe(13),"CDO-token":Pe(14),"CDC-token":Pe(15),"colon-token":Pe(16),"semicolon-token":Pe(17),"comma-token":Pe(18),"[-token":Pe(19),"]-token":Pe(20),"(-token":Pe(21),")-token":Pe(22),"{-token":Pe(23),"}-token":Pe(24),string:Pe(5),ident:Pe(1),"custom-ident":H4,"custom-property-name":F4,"hex-color":$4,"id-selector":W4,"an-plus-b":_4,urange:k4,"declaration-value":q4,"any-value":z4,dimension:ln(cr(null)),angle:ln(cr(x4)),decibel:ln(cr(I4)),frequency:ln(cr(R4)),flex:ln(cr(P4)),length:ln(a1(cr(N4))),resolution:ln(cr(M4)),semitones:ln(cr(D4)),time:ln(cr(O4)),percentage:ln(U4),zero:a1(),number:ln(j4),integer:ln(V4)};function G4(e,t,n){return Object.assign(wc("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
41
+ `+t+`
42
+ --`+new Array((n||t.length)+1).join("-")+"^"})}var X4=9,K4=10,Y4=12,Z4=13,Q4=32,J4=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!==Z4&&t!==K4&&t!==Y4&&t!==Q4&&t!==X4)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 G4(e,this.str,this.pos)}},e8=9,t8=10,n8=12,r8=13,o8=32,c1=33,Wm=35,u1=38,Lc=39,d1=40,i8=41,f1=42,qm=43,zm=44,m1=45,Um=60,h1=62,jm=63,s8=64,Nc=91,Vm=93,xc=123,p1=124,g1=125,b1=8734,Qs=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),y1={" ":1,"&&":2,"||":3,"|":4};function Oc(e){return e.substringToPos(e.findWsEnd(e.pos))}function pi(e){let t=e.pos;for(;t<e.str.length;t++){const n=e.str.charCodeAt(t);if(n>=128||Qs[n]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Rc(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 a8(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 v1(e){let t=null,n=null;return e.eat(xc),t=Rc(e),e.charCode()===zm?(e.pos++,e.charCode()!==g1&&(n=Rc(e))):n=t,e.eat(g1),{min:Number(t),max:n?Number(n):0}}function l8(e){let t=null,n=!1;switch(e.charCode()){case f1:e.pos++,t={min:0,max:0};break;case qm:e.pos++,t={min:1,max:0};break;case jm:e.pos++,t={min:0,max:1};break;case Wm:e.pos++,n=!0,e.charCode()===xc?t=v1(e):e.charCode()===jm?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case xc:t=v1(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function gi(e,t){const n=l8(e);return n!==null?(n.term=t,e.charCode()===Wm&&e.charCodeAt(e.pos-1)===qm?gi(e,n):n):t}function Gm(e){const t=e.peek();return t===""?null:{type:"Token",value:t}}function c8(e){let t;return e.eat(Um),e.eat(Lc),t=pi(e),e.eat(Lc),e.eat(h1),gi(e,{type:"Property",name:t})}function u8(e){let t=null,n=null,r=1;return e.eat(Nc),e.charCode()===m1&&(e.peek(),r=-1),r==-1&&e.charCode()===b1?e.peek():(t=r*Number(Rc(e)),Qs[e.charCode()]!==0&&(t+=pi(e))),Oc(e),e.eat(zm),Oc(e),e.charCode()===b1?e.peek():(r=1,e.charCode()===m1&&(e.peek(),r=-1),n=r*Number(Rc(e)),Qs[e.charCode()]!==0&&(n+=pi(e))),e.eat(Vm),{type:"Range",min:t,max:n}}function d8(e){let t,n=null;return e.eat(Um),t=pi(e),e.charCode()===d1&&e.nextCharCode()===i8&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Nc&&(Oc(e),n=u8(e)),e.eat(h1),gi(e,{type:"Type",name:t,opts:n})}function f8(e){const t=pi(e);return e.charCode()===d1?(e.pos++,{type:"Function",name:t}):gi(e,{type:"Keyword",name:t})}function m8(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)=>y1[o]-y1[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 E1(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=p8(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:m8(t,n)||" ",disallowEmpty:!1,explicit:!1}}function h8(e){let t;return e.eat(Nc),t=E1(e),e.eat(Vm),t.explicit=!0,e.charCode()===c1&&(e.pos++,t.disallowEmpty=!0),t}function p8(e){let t=e.charCode();if(t<128&&Qs[t]===1)return f8(e);switch(t){case Vm:break;case Nc:return gi(e,h8(e));case Um:return e.nextCharCode()===Lc?c8(e):d8(e);case p1:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===p1?2:1))};case u1:return e.pos++,e.eat(u1),{type:"Combinator",value:"&&"};case zm:return e.pos++,{type:"Comma"};case Lc:return gi(e,{type:"String",value:a8(e)});case o8:case e8:case t8:case r8:case n8:return{type:"Spaces",value:Oc(e)};case s8:return t=e.nextCharCode(),t<128&&Qs[t]===1?(e.pos++,{type:"AtKeyword",name:pi(e)}):Gm(e);case f1:case qm:case jm:case Wm:case c1:break;case xc:if(t=e.nextCharCode(),t<48||t>57)return Gm(e);break;default:return Gm(e)}}function S1(e){const t=new J4(e),n=E1(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var Js=function(){};function w1(e){return typeof e=="function"?e:Js}function g8(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=Js,i=Js;if(typeof t=="function"?o=t:t&&(o=w1(t.enter),i=w1(t.leave)),o===Js&&i===Js)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var b8={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 y8(e){const t=[];return Sc(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function v8(e,t){return typeof e=="string"?y8(e):t.generate(e,b8)}var we={type:"Match"},Ce={type:"Mismatch"},Xm={type:"DisallowEmpty"},E8=40,S8=41;function Ct(e,t,n){return t===we&&n===Ce||e===we&&t===we&&n===we?e:(e.type==="If"&&e.else===Ce&&t===we&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function _1(e){return e.length>2&&e.charCodeAt(e.length-2)===E8&&e.charCodeAt(e.length-1)===S8}function C1(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&_1(e.name)}function Km(e,t,n){switch(e){case" ":{let r=we;for(let o=t.length-1;o>=0;o--){const i=t[o];r=Ct(i,r,Ce)}return r}case"|":{let r=Ce,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(C1(s)&&(o===null&&i>0&&C1(t[i-1])&&(o=Object.create(null),r=Ct({type:"Enum",map:o},we,r)),o!==null)){const a=(_1(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=Ct(s,we,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Km(e,t.filter(function(a){return a!==i}),!1):s=we,r=Ct(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?we:Ce;for(let o=t.length-1;o>=0;o--){const i=t[o];let s;t.length>1?s=Km(e,t.filter(function(a){return a!==i}),!0):s=we,r=Ct(i,s,r)}return r}}}function w8(e){let t=we,n=Ym(e.term);if(e.max===0)n=Ct(n,Xm,Ce),t=Ct(n,null,Ce),t.then=Ct(we,we,t),e.comma&&(t.then.else=Ct({type:"Comma",syntax:e},t,Ce));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==we&&(t=Ct({type:"Comma",syntax:e},t,Ce)),t=Ct(n,Ct(we,we,t),Ce);if(e.min===0)t=Ct(we,we,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==we&&(t=Ct({type:"Comma",syntax:e},t,Ce)),t=Ct(n,t,Ce);return t}function Ym(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Km(e.combinator,e.terms.map(Ym),!1);return e.disallowEmpty&&(t=Ct(t,Xm,Ce)),t}case"Multiplier":return w8(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 Zm(e,t){return typeof e=="string"&&(e=S1(e)),{type:"MatchGraph",match:Ym(e),syntax:t||null,source:e}}var{hasOwnProperty:T1}=Object.prototype,_8=0,C8=1,Qm=2,A1=3,k1="Match",T8="Mismatch",A8="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",k8=15e3,L8=0;function N8(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function Jm(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 x8(e){return e.type!==9?!1:e.value!=="?"}function L1(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||x8(e)}function N1(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function O8(e,t,n){function r(){do L++,C=L<e.length?e[L]:null;while(C!==null&&(C.type===13||C.type===25))}function o(g){const E=L+g;return E<e.length?e[E]:null}function i(g,E){return{nextState:g,matchStack:y,syntaxStack:d,thenStack:f,tokenIndex:L,prev:E}}function s(g){f={nextState:g,matchStack:y,syntaxStack:d,prev:f}}function a(g){h=i(g,h)}function l(){y={type:C8,syntax:t.syntax,token:C,prev:y},r(),m=null,L>k&&(k=L)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},y={type:Qm,syntax:t.syntax,token:y.token,prev:y}}function u(){y.type===Qm?y=y.prev:y={type:A1,syntax:d.syntax,token:y.token,prev:y},d=d.prev}let d=null,f=null,h=null,m=null,p=0,b=null,C=null,L=-1,k=0,y={type:_8,syntax:null,token:null,prev:null};for(r();b===null&&++p<k8;)switch(t.type){case"Match":if(f===null){if(C!==null&&(L!==e.length-1||C.value!=="\\0"&&C.value!=="\\9")){t=Ce;break}b=k1;break}if(t=f.nextState,t===Xm)if(f.matchStack===y){t=Ce;break}else t=we;for(;f.syntaxStack!==d;)u();f=f.prev;break;case"Mismatch":if(m!==null&&m!==!1)(h===null||L>h.tokenIndex)&&(h=m,m=!1);else if(h===null){b=T8;break}t=h.nextState,f=h.thenStack,d=h.syntaxStack,y=h.matchStack,L=h.tokenIndex,C=L<e.length?e[L]:null,h=h.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==Ce&&a(t.else),t.then!==we&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{const _=t.syntax.terms;if(t.index===_.length){if(t.mask===0||t.syntax.all){t=Ce;break}t=we;break}if(t.mask===(1<<_.length)-1){t=we;break}for(;t.index<_.length;t.index++){const S=1<<t.index;if((t.mask&S)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|S}),t=_[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(C!==null){let _=C.value.toLowerCase();if(_.indexOf("\\")!==-1&&(_=_.replace(/\\[09].*$/,"")),T1.call(t.map,_)){t=t.map[_];break}}t=Ce;break;case"Generic":{const _=d!==null?d.opts:null,S=L+Math.floor(t.fn(C,o,_));if(!isNaN(S)&&S>L){for(;L<S;)l();t=we}else t=Ce;break}case"Type":case"Property":{const _=t.type==="Type"?"types":"properties",S=T1.call(n,_)?n[_][t.name]:null;if(!S||!S.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=Ce;break}c(),t=S.match;break}case"Keyword":{const _=t.name;if(C!==null){let S=C.value;if(S.indexOf("\\")!==-1&&(S=S.replace(/\\[09].*$/,"")),Jm(S,_)){l(),t=we;break}}t=Ce;break}case"AtKeyword":case"Function":if(C!==null&&Jm(C.value,t.name)){l(),t=we;break}t=Ce;break;case"Token":if(C!==null&&C.value===t.value){l(),t=we;break}t=Ce;break;case"Comma":C!==null&&C.type===18?L1(y.token)?t=Ce:(l(),t=N1(C)?Ce:we):t=L1(y.token)||N1(C)?we:Ce;break;case"String":let g="",E=L;for(;E<e.length&&g.length<t.value.length;E++)g+=e[E].value;if(Jm(g,t.value)){for(;L<E;)l();t=we}else t=Ce;break;default:throw new Error("Unknown node type: "+t.type)}switch(L8+=p,b){case null:b=A8,y=null;break;case k1:for(;d!==null;)u();break;default:y=null}return{tokens:e,reason:b,iterations:p,match:y,longestMatch:k}}function x1(e,t,n){const r=O8(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=N8(o).prev;o!==null;){switch(o.type){case Qm:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case A1: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 R8=re({getTrace:()=>O1,isKeyword:()=>I8,isProperty:()=>P8,isType:()=>M8});function O1(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 M8(e,t){return eh(this,e,n=>n.type==="Type"&&n.name===t)}function P8(e,t){return eh(this,e,n=>n.type==="Property"&&n.name===t)}function I8(e){return eh(this,e,t=>t.type==="Keyword")}function eh(e,t,n){const r=O1.call(e,t);return r===null?!1:r.some(n)}function R1(e){return"node"in e?e.node:R1(e.match[0])}function M1(e){return"node"in e?e.node:M1(e.match[e.match.length-1])}function P1(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){const l=R1(a),c=M1(a);e.syntax.walk(t,function(u,d,f){if(u===l){const h=new et;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:ea}=Object.prototype;function th(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function I1(e){return!!e&&th(e.offset)&&th(e.line)&&th(e.column)}function D8(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(ea.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(!I1(r.loc.start))i+=".start";else if(!I1(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 et)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(const i in t)ea.call(t,i)&&ea.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function B8(e,t){const n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(const i in n){if(ea.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:D8(e,r)}}function H8(e){const t={};if(e.node){for(const n in e.node)if(ea.call(e.node,n)){const r=e.node[n];if(r.structure)t[n]=B8(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var F8=Zm(t1.join(" | "));function nh(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:Pm(e[o].syntax,{compact:t}));return r}function $8(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:Pm(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&nh(i.descriptors,t,n)};return r}function W8(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function An(e,t,n){return{matched:e,iterations:n,error:t,...R8}}function bi(e,t,n,r){const o=v8(n,e.syntax);let i;return W8(o)?An(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=x1(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=x1(o,t.match,e),!i.match)?An(null,new v4(i.reason,t.syntax,n,i),i.iterations):An(i.match,null,i.iterations))}var D1=class{constructor(e,t,n){if(this.cssWideKeywordsSyntax=F8,this.syntax=t,this.generic=!1,this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||H8(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 l1)this.addType_(r,l1[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=Zm(e,o):(typeof e=="string"?Object.defineProperty(i,"syntax",{get(){return Object.defineProperty(i,"syntax",{value:S1(e)}),i.syntax}}):i.syntax=e,Object.defineProperty(i,"match",{get(){return Object.defineProperty(i,"match",{value:Zm(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 Xs("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&&!bi(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=Cn(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 Xs("Unknown at-rule descriptor",t)}checkPropertyName(e){if(!this.getProperty(e))return new Xs("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return An(null,n);const r=this.getAtrule(e);return r.prelude?bi(this,r.prelude,t||"",!1):An(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return An(null,r);const o=this.getAtrule(e),i=Cn(t);return bi(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return e.type!=="Declaration"?An(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(mi(e).custom)return An(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?An(null,n):bi(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?bi(this,n,t,!1):An(null,new Xs("Unknown type",e))}match(e,t){return typeof e!="string"&&(!e||!e.type)?An(null,new Xs("Bad syntax")):((typeof e=="string"||!e.match)&&(e=this.createDescriptor(e,"Type","anonymous")),bi(this,e,t,!1))}findValueFragments(e,t,n,r){return P1(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return P1(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=Cn(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=mi(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&&g8(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:nh(this.types,!t,e),properties:nh(this.properties,!t,e),atrules:$8(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}},{hasOwnProperty:yi}=Object.prototype,q8={generic:!0,types:rh,atrules:{prelude:$1,descriptors:$1},properties:rh,parseContext:z8,scope:H1,atrule:["parse"],pseudo:["parse"],node:["name","structure","parse","generate","walkContext"]};function Mc(e){return e&&e.constructor===Object}function B1(e){return Mc(e)?{...e}:e}function z8(e,t){return Object.assign(e,t)}function H1(e,t){for(const n in t)yi.call(t,n)&&(Mc(e[n])?H1(e[n],t[n]):e[n]=B1(t[n]));return e}function F1(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function rh(e,t){if(typeof t=="string")return F1(e,t);const n={...e};for(let r in t)yi.call(t,r)&&(n[r]=F1(yi.call(e,r)?e[r]:void 0,t[r]));return n}function $1(e,t){const n=rh(e,t);return!Mc(n)||Object.keys(n).length?n:null}function ta(e,t,n){for(const r in n)if(yi.call(n,r)!==!1){if(n[r]===!0)yi.call(t,r)&&(e[r]=B1(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(Mc(n[r])){const o={};for(let i in e[r])o[i]=ta({},e[r][i],n[r]);for(let i in t[r])o[i]=ta(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&&ta(o[s],a,i);for(const s in t[r])yi.call(t[r],s)&&(o[s]||(o[s]={}),t[r]&&t[r][s]&&ta(o[s],t[r][s],i));e[r]=o}}}return e}var oh=(e,t)=>ta(e,t,q8);function W1(e){const t=X3(e),n=m4(e),r=c4(e),{fromPlainObject:o,toPlainObject:i}=u4(n),s={lexer:null,createLexer:a=>new D1(a,s,s.lexer.structure),tokenize:Sc,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){const l=oh({},e);return W1(typeof a=="function"?a(l,Object.assign):oh(l,a))}};return s.lexer=new D1({generic:!0,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var U8=e=>W1(oh({},e)),j8={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>"}}}},V8=re({generate:()=>Y8,name:()=>X8,parse:()=>q1,structure:()=>K8}),Fn=43,Yt=45,Pc=110,Eo=!0,G8=!1;function Ic(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for((r===Fn||r===Yt)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)bt(this.charCodeAt(n))||this.error("Integer is expected",n)}function vi(e){return Ic.call(this,0,e)}function Fr(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Pc:n="N is expected";break;case Yt:n="HyphenMinus is expected"}this.error(n,this.tokenStart+e)}}function ih(){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(Yt,e)){t=this.isDelim(Fn,e)?Fn:Yt;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),vi.call(this,Eo))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Fn&&n!==Yt&&this.error("Number sign is expected")),vi.call(this,t!==0),t===Yt?"-"+this.consume(10):this.consume(10)}var X8="AnPlusB",K8={a:[String,null],b:[String,null]};function q1(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===10)vi.call(this,G8),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,Yt))switch(t="-1",Fr.call(this,1,Pc),this.tokenEnd-this.tokenStart){case 2:this.next(),n=ih.call(this);break;case 3:Fr.call(this,2,Yt),this.next(),this.skipSC(),vi.call(this,Eo),n="-"+this.consume(10);break;default:Fr.call(this,2,Yt),Ic.call(this,3,Eo),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()),Fr.call(this,0,Pc),this.tokenEnd-this.tokenStart){case 1:this.next(),n=ih.call(this);break;case 2:Fr.call(this,1,Yt),this.next(),this.skipSC(),vi.call(this,Eo),n="-"+this.consume(10);break;default:Fr.call(this,1,Yt),Ic.call(this,2,Eo),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){const r=this.charCodeAt(this.tokenStart),o=r===Fn||r===Yt;let i=this.tokenStart+o;for(;i<this.tokenEnd&&bt(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Fr.call(this,i-this.tokenStart,Pc),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=ih.call(this)):(Fr.call(this,i-this.tokenStart+1,Yt),i+2===this.tokenEnd?(this.next(),this.skipSC(),vi.call(this,Eo),n="-"+this.consume(10)):(Ic.call(this,i-this.tokenStart+2,Eo),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 Y8(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 Z8=re({generate:()=>nB,name:()=>J8,parse:()=>U1,structure:()=>tB,walkContext:()=>eB});function z1(e){return this.Raw(e,this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function Q8(){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 J8="Atrule",eB="atrule",tB={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function U1(){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),z1):r=z1.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(Q8.call(this))}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:t,prelude:r,block:o}}function nB(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var rB=re({generate:()=>aB,name:()=>oB,parse:()=>j1,structure:()=>sB,walkContext:()=>iB}),oB="AtrulePrelude",iB="atrulePrelude",sB={children:[[]]};function j1(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 aB(e){this.children(e)}var lB=re({generate:()=>gB,name:()=>hB,parse:()=>G1,structure:()=>pB}),cB=36,V1=42,Dc=61,uB=94,sh=124,dB=126;function fB(){this.eof&&this.error("Unexpected end of input");const e=this.tokenStart;let t=!1;return this.isDelim(V1)?(t=!0,this.next()):this.isDelim(sh)||this.eat(1),this.isDelim(sh)?this.charCodeAt(this.tokenStart+1)!==Dc?(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 mB(){const e=this.tokenStart,t=this.charCodeAt(e);return t!==Dc&&t!==dB&&t!==uB&&t!==cB&&t!==V1&&t!==sh&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Dc&&(this.isDelim(Dc)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var hB="AttributeSelector",pB={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function G1(){const e=this.tokenStart;let t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=fB.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=mB.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 gB(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 bB=re({generate:()=>_B,name:()=>EB,parse:()=>Y1,structure:()=>wB,walkContext:()=>SB});function X1(e){return this.Raw(e,null,!0)}function yB(){return this.parseWithFallback(this.Rule,X1)}function K1(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function vB(){if(this.tokenType===17)return K1.call(this,this.tokenIndex);const e=this.parseWithFallback(this.Declaration,K1);return this.tokenType===17&&this.next(),e}var EB="Block",SB="block",wB={children:[["Atrule","Rule","Declaration"]]};function Y1(e){const t=e?vB:yB,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,X1));break;default:r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function _B(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var CB=re({generate:()=>kB,name:()=>TB,parse:()=>Z1,structure:()=>AB}),TB="Brackets",AB={children:[[]]};function Z1(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 kB(e){this.token(9,"["),this.children(e),this.token(9,"]")}var LB=re({generate:()=>xB,name:()=>"CDC",parse:()=>Q1,structure:()=>NB}),Nse="CDC",NB=[];function Q1(){const e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function xB(){this.token(15,"-->")}var OB=re({generate:()=>MB,name:()=>"CDO",parse:()=>J1,structure:()=>RB}),xse="CDO",RB=[];function J1(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function MB(){this.token(14,"<!--")}var PB=re({generate:()=>HB,name:()=>DB,parse:()=>ew,structure:()=>BB}),IB=46,DB="ClassSelector",BB={name:String};function ew(){return this.eatDelim(IB),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function HB(e){this.token(9,"."),this.token(1,e.name)}var FB=re({generate:()=>jB,name:()=>zB,parse:()=>nw,structure:()=>UB}),$B=43,tw=47,WB=62,qB=126,zB="Combinator",UB={name:String};function nw(){const e=this.tokenStart;let t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case WB:case $B:case qB:this.next();break;case tw:this.next(),this.eatIdent("deep"),this.eatDelim(tw);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function jB(e){this.tokenize(e.name)}var VB=re({generate:()=>ZB,name:()=>KB,parse:()=>rw,structure:()=>YB}),GB=42,XB=47,KB="Comment",YB={value:String};function rw(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===GB&&this.charCodeAt(t-1)===XB&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function ZB(e){this.token(25,"/*"+e.value+"*/")}var QB=re({generate:()=>u9,name:()=>a9,parse:()=>sw,structure:()=>c9,walkContext:()=>l9}),ow=33,JB=35,e9=36,t9=38,n9=42,r9=43,iw=47;function o9(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function i9(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function s9(){const e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(ow)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var a9="Declaration",l9="declaration",c9={important:[Boolean,String],property:String,value:["Value","Raw"]};function sw(){const e=this.tokenStart,t=this.tokenIndex,n=d9.call(this),r=Im(n),o=r?this.parseCustomProperty:this.parseValue,i=r?i9:o9;let s=!1,a;this.skipSC(),this.eat(16);const l=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(s9,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(ow)&&(s=f9.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 u9(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 d9(){const e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case n9:case e9:case r9:case JB:case t9:this.next();break;case iw:this.next(),this.isDelim(iw)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function f9(){this.eat(9),this.skipSC();const e=this.consume(1);return e==="important"?!0:e}var m9=re({generate:()=>b9,name:()=>p9,parse:()=>aw,structure:()=>g9});function h9(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}var p9="DeclarationList",g9={children:[["Declaration"]]};function aw(){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,h9))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function b9(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var y9=re({generate:()=>S9,name:()=>v9,parse:()=>lw,structure:()=>E9}),v9="Dimension",E9={value:String,unit:String};function lw(){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 S9(e){this.token(12,e.value+e.unit)}var w9=re({generate:()=>A9,name:()=>_9,parse:()=>cw,structure:()=>T9,walkContext:()=>C9}),_9="Function",C9="function",T9={name:String,children:[[]]};function cw(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 A9(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var k9=re({generate:()=>x9,name:()=>L9,parse:()=>uw,structure:()=>N9,xxx:()=>"XXX"}),Ose="XXX",L9="Hash",N9={value:String};function uw(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function x9(e){this.token(4,"#"+e.value)}var O9=re({generate:()=>P9,name:()=>R9,parse:()=>dw,structure:()=>M9}),R9="Identifier",M9={name:String};function dw(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function P9(e){this.token(1,e.name)}var I9=re({generate:()=>H9,name:()=>D9,parse:()=>fw,structure:()=>B9}),D9="IdSelector",B9={name:String};function fw(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function H9(e){this.token(9,"#"+e.name)}var F9=re({generate:()=>q9,name:()=>$9,parse:()=>mw,structure:()=>W9}),$9="MediaFeature",W9={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function mw(){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 q9(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var z9=re({generate:()=>V9,name:()=>U9,parse:()=>hw,structure:()=>j9}),U9="MediaQuery",j9={children:[["Identifier","MediaFeature","WhiteSpace"]]};function hw(){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 V9(e){this.children(e)}var G9=re({generate:()=>Y9,name:()=>X9,parse:()=>pw,structure:()=>K9}),X9="MediaQueryList",K9={children:[["MediaQuery"]]};function pw(){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 Y9(e){this.children(e,()=>this.token(18,","))}var Z9=re({generate:()=>J9,name:()=>"Nth",parse:()=>gw,structure:()=>Q9}),Rse="Nth",Q9={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function gw(){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 J9(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var e6=re({generate:()=>r6,name:()=>t6,parse:()=>bw,structure:()=>n6}),t6="Number",n6={value:String};function bw(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function r6(e){this.token(10,e.value)}var o6=re({generate:()=>a6,name:()=>i6,parse:()=>yw,structure:()=>s6}),i6="Operator",s6={value:String};function yw(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function a6(e){this.tokenize(e.value)}var l6=re({generate:()=>d6,name:()=>c6,parse:()=>vw,structure:()=>u6}),c6="Parentheses",u6={children:[[]]};function vw(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 d6(e){this.token(21,"("),this.children(e),this.token(22,")")}var f6=re({generate:()=>p6,name:()=>m6,parse:()=>Ew,structure:()=>h6}),m6="Percentage",h6={value:String};function Ew(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function p6(e){this.token(11,e.value+"%")}var g6=re({generate:()=>E6,name:()=>b6,parse:()=>Sw,structure:()=>v6,walkContext:()=>y6}),b6="PseudoClassSelector",y6="function",v6={name:String,children:[["Raw"],null]};function Sw(){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 E6(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var S6=re({generate:()=>T6,name:()=>w6,parse:()=>ww,structure:()=>C6,walkContext:()=>_6}),w6="PseudoElementSelector",_6="function",C6={name:String,children:[["Raw"],null]};function ww(){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 T6(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 A6=re({generate:()=>O6,name:()=>N6,parse:()=>Cw,structure:()=>x6}),k6=47,L6=46;function _w(){this.skipSC();const e=this.consume(10);for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);!bt(n)&&n!==L6&&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 N6="Ratio",x6={left:String,right:String};function Cw(){const e=this.tokenStart,t=_w.call(this);let n;return this.skipSC(),this.eatDelim(k6),n=_w.call(this),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function O6(e){this.token(10,e.left),this.token(9,"/"),this.token(10,e.right)}var R6=re({generate:()=>I6,name:()=>"Raw",parse:()=>Tw,structure:()=>P6});function M6(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var Mse="Raw",P6={value:String};function Tw(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?o=M6.call(this):o=this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}function I6(e){this.tokenize(e.value)}var D6=re({generate:()=>W6,name:()=>H6,parse:()=>kw,structure:()=>$6,walkContext:()=>F6});function Aw(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function B6(){const e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var H6="Rule",F6="rule",$6={prelude:["SelectorList","Raw"],block:["Block"]};function kw(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return this.parseRulePrelude?n=this.parseWithFallback(B6,Aw):n=Aw.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function W6(e){this.node(e.prelude),this.node(e.block)}var q6=re({generate:()=>j6,name:()=>z6,parse:()=>Lw,structure:()=>U6}),z6="Selector",U6={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]};function Lw(){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 j6(e){this.children(e)}var V6=re({generate:()=>Y6,name:()=>G6,parse:()=>Nw,structure:()=>K6,walkContext:()=>X6}),G6="SelectorList",X6="selector",K6={children:[["Selector","Raw"]]};function Nw(){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 Y6(e){this.children(e,()=>this.token(18,","))}var ah=92,xw=34,Ow=39;function Rw(e){const t=e.length,n=e.charCodeAt(0),r=n===xw||n===Ow?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===ah){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),Bn(ah,a)){const l=s-1,c=ui(e,l);s=c-1,i+=MS(e.substring(l+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function lh(e,t){const n=t?"'":'"',r=t?Ow:xw;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===ah?(o+="\\"+e.charAt(s),i=!1):(i&&(Dr(a)||vo(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var Z6=re({generate:()=>e7,name:()=>Q6,parse:()=>Mw,structure:()=>J6}),Q6="String",J6={value:String};function Mw(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Rw(this.consume(5))}}function e7(e){this.token(5,lh(e.value))}var t7=re({generate:()=>s7,name:()=>r7,parse:()=>Iw,structure:()=>i7,walkContext:()=>o7}),n7=33;function Pw(e){return this.Raw(e,null,!1)}var r7="StyleSheet",o7="stylesheet",i7={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Iw(){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)!==n7){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,Pw);break;default:n=this.parseWithFallback(this.Rule,Pw)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function s7(e){this.children(e)}var a7=re({generate:()=>d7,name:()=>c7,parse:()=>Bw,structure:()=>u7}),l7=42,Dw=124;function ch(){this.tokenType!==1&&this.isDelim(l7)===!1&&this.error("Identifier or asterisk is expected"),this.next()}var c7="TypeSelector",u7={name:String};function Bw(){const e=this.tokenStart;return this.isDelim(Dw)?(this.next(),ch.call(this)):(ch.call(this),this.isDelim(Dw)&&(this.next(),ch.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function d7(e){this.tokenize(e.name)}var f7=re({generate:()=>b7,name:()=>p7,parse:()=>$w,structure:()=>g7}),Hw=43,Fw=45,uh=63;function na(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){const o=this.charCodeAt(r);if(o===Fw&&t&&n!==0)return na.call(this,e+n+1,!1),-1;Dr(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 Bc(e){let t=0;for(;this.isDelim(uh);)++t>e&&this.error("Too many question marks"),this.next()}function m7(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===Hw?"Plus sign":"Hyphen minus")+" is expected")}function h7(){let e=0;switch(this.tokenType){case 10:if(e=na.call(this,1,!0),this.isDelim(uh)){Bc.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){m7.call(this,Fw),na.call(this,1,!1);break}break;case 12:e=na.call(this,1,!0),e>0&&Bc.call(this,6-e);break;default:if(this.eatDelim(Hw),this.tokenType===1){e=na.call(this,0,!0),e>0&&Bc.call(this,6-e);break}if(this.isDelim(uh)){this.next(),Bc.call(this,5);break}this.error("Hex digit or question mark is expected")}}var p7="UnicodeRange",g7={value:String};function $w(){const e=this.tokenStart;return this.eatIdent("u"),h7.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function b7(e){this.tokenize(e.value)}var y7=32,dh=92,v7=34,E7=39,S7=40,Ww=41;function w7(e){const t=e.length;let n=4,r=e.charCodeAt(t-1)===Ww?t-2:t-1,o="";for(;n<r&&vo(e.charCodeAt(n));)n++;for(;n<r&&vo(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===dh){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),Bn(dh,s)){const a=i-1,l=ui(e,a);i=l-1,o+=MS(e.substring(a+1,l))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function qw(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===y7||o===dh||o===v7||o===E7||o===S7||o===Ww?(t+="\\"+e.charAt(r),n=!1):(n&&Dr(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var _7=re({generate:()=>T7,name:()=>"Url",parse:()=>zw,structure:()=>C7}),Pse="Url",C7={value:String};function zw(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=w7(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=Rw(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 T7(e){this.token(7,qw(e.value))}var A7=re({generate:()=>N7,name:()=>k7,parse:()=>Uw,structure:()=>L7}),k7="Value",L7={children:[[]]};function Uw(){const e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function N7(e){this.children(e)}var x7=re({generate:()=>P7,name:()=>R7,parse:()=>jw,structure:()=>M7}),O7=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),R7="WhiteSpace",M7={value:String};function jw(){return this.eat(13),O7}function P7(e){this.token(13,e.value)}var Vw=re({AnPlusB:()=>V8,Atrule:()=>Z8,AtrulePrelude:()=>rB,AttributeSelector:()=>lB,Block:()=>bB,Brackets:()=>CB,CDC:()=>LB,CDO:()=>OB,ClassSelector:()=>PB,Combinator:()=>FB,Comment:()=>VB,Declaration:()=>QB,DeclarationList:()=>m9,Dimension:()=>y9,Function:()=>w9,Hash:()=>k9,IdSelector:()=>I9,Identifier:()=>O9,MediaFeature:()=>F9,MediaQuery:()=>z9,MediaQueryList:()=>G9,Nth:()=>Z9,Number:()=>e6,Operator:()=>o6,Parentheses:()=>l6,Percentage:()=>f6,PseudoClassSelector:()=>g6,PseudoElementSelector:()=>S6,Ratio:()=>A6,Raw:()=>R6,Rule:()=>D6,Selector:()=>q6,SelectorList:()=>V6,String:()=>Z6,StyleSheet:()=>t7,TypeSelector:()=>a7,UnicodeRange:()=>f7,Url:()=>_7,Value:()=>A7,WhiteSpace:()=>x7}),I7={generic:!0,...j8,node:Vw},D7=35,B7=42,Gw=43,H7=45,F7=47,$7=117;function Xw(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,$7)&&this.cmpChar(this.tokenStart+1,Gw)?this.UnicodeRange():this.Identifier();case 9:{const t=this.charCodeAt(this.tokenStart);if(t===F7||t===B7||t===Gw||t===H7)return this.Operator();t===D7&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var W7={getNode:Xw},q7=35,z7=42,U7=43,j7=47,Kw=46,V7=62,G7=124,X7=126;function K7(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function Y7(){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)===Kw&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:switch(this.charCodeAt(this.tokenStart)){case U7:case V7:case X7:case j7:return this.Combinator();case Kw:return this.ClassSelector();case z7:case G7:return this.TypeSelector();case q7:return this.IdSelector()}}}var Z7={onWhiteSpace:K7,getNode:Y7};function Q7(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function J7(){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 Yw(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var eH={getNode:Xw,onWhiteSpace(e,t){Yw(e)&&(e.value=" "+e.value),Yw(t.last)&&(t.last.value+=" ")},expression:Q7,var:J7},tH=re({AtrulePrelude:()=>W7,Selector:()=>Z7,Value:()=>eH}),nH={parse:{prelude:null,block(){return this.Block(!0)}}},rH={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}},oH={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(){return this.Block(!1)}}},iH={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};function sH(){return this.createSingleNodeList(this.Raw(this.tokenIndex,null,!1))}function aH(){return this.skipSC(),this.tokenType===1&&this.lookupNonWSType(1)===16?this.createSingleNodeList(this.Declaration()):Zw.call(this)}function Zw(){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(sH,this.scope.AtrulePrelude);break;case 1:t=this.Identifier();break;case 21:t=this.Parentheses(aH,this.scope.AtrulePrelude);break;default:break e}e.push(t)}return e}var lH={parse:{prelude(){const e=Zw.call(this);return this.getFirstListNode(e)===null&&this.error("Condition is expected"),e},block(){return this.Block(!1)}}},cH={"font-face":nH,import:rH,media:oH,page:iH,supports:lH},So={parse(){return this.createSingleNodeList(this.SelectorList())}},uH={parse(){return this.createSingleNodeList(this.Selector())}},Qw={parse(){return this.createSingleNodeList(this.Identifier())}},Hc={parse(){return this.createSingleNodeList(this.Nth())}},dH={dir:Qw,has:So,lang:Qw,matches:So,is:So,"-moz-any":So,"-webkit-any":So,where:So,not:So,"nth-child":Hc,"nth-last-child":Hc,"nth-last-of-type":Hc,"nth-of-type":Hc,slotted:uH},fH=re({AnPlusB:()=>q1,Atrule:()=>U1,AtrulePrelude:()=>j1,AttributeSelector:()=>G1,Block:()=>Y1,Brackets:()=>Z1,CDC:()=>Q1,CDO:()=>J1,ClassSelector:()=>ew,Combinator:()=>nw,Comment:()=>rw,Declaration:()=>sw,DeclarationList:()=>aw,Dimension:()=>lw,Function:()=>cw,Hash:()=>uw,IdSelector:()=>fw,Identifier:()=>dw,MediaFeature:()=>mw,MediaQuery:()=>hw,MediaQueryList:()=>pw,Nth:()=>gw,Number:()=>bw,Operator:()=>yw,Parentheses:()=>vw,Percentage:()=>Ew,PseudoClassSelector:()=>Sw,PseudoElementSelector:()=>ww,Ratio:()=>Cw,Raw:()=>Tw,Rule:()=>kw,Selector:()=>Lw,SelectorList:()=>Nw,String:()=>Mw,StyleSheet:()=>Iw,TypeSelector:()=>Bw,UnicodeRange:()=>$w,Url:()=>zw,Value:()=>Uw,WhiteSpace:()=>jw}),mH={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:tH,atrule:cH,pseudo:dH,node:fH},hH={node:Vw},pH=U8({...I7,...mH,...hH});function fh(e){const t={};for(const n in e){let r=e[n];r&&(Array.isArray(r)||r instanceof et?r=r.map(fh):r.constructor===Object&&(r=fh(r))),t[n]=r}return t}var{tokenize:Ise,parse:gH,generate:$n,lexer:Jw,createLexer:Dse,walk:Bt,find:Bse,findLast:Hse,findAll:Fse,toPlainObject:$se,fromPlainObject:Wse,fork:bH}=pH,{hasOwnProperty:yH}=Object.prototype;function mh(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 e_(e){if(!e)return null;const t=mh(e.tags,!0),n=mh(e.ids),r=mh(e.classes);return t===null&&n===null&&r===null?null:{tags:t,ids:n,classes:r}}function vH(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(yH.call(t,o))throw new Error(`Class can't be used for several scopes: ${o}`);t[o]=n+1}}}return{whitelist:e_(e),blacklist:e_(e.blacklist),scopes:t}}function wo(e){return!e||!e.children||e.children.isEmpty}function t_(e,t){return e!==null&&e.children===t}function EH(e,t,n){if(e.block&&(this.stylesheet!==null&&(this.stylesheet.firstAtrulesAllowed=!1),wo(e.block))){n.remove(t);return}switch(e.name){case"charset":if(wo(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=Cn(e.name).basename;(r==="keyframes"||r==="media"||r==="supports")&&(wo(e.prelude)||wo(e.block))&&n.remove(t)}}}function SH(e,t,n){n.remove(t)}function wH(e,t,n){if(e.value.children&&e.value.children.isEmpty){n.remove(t);return}mi(e.property).custom&&/\S/.test(e.value.value)&&(e.value.value=e.value.value.trim())}function _H(e,t,n){(t_(this.stylesheet,n)||t_(this.block,n))&&n.remove(t)}var{hasOwnProperty:Ei}=Object.prototype,CH=new Set(["keyframes"]);function n_(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")&&n_(s,t)&&(i=!0);break;case"ClassSelector":t.whitelist!==null&&t.whitelist.classes!==null&&!Ei.call(t.whitelist.classes,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.classes!==null&&Ei.call(t.blacklist.classes,s.name)&&(i=!0);break;case"IdSelector":t.whitelist!==null&&t.whitelist.ids!==null&&!Ei.call(t.whitelist.ids,s.name)&&(i=!0),t.blacklist!==null&&t.blacklist.ids!==null&&Ei.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&&!Ei.call(t.whitelist.tags,s.name.toLowerCase())&&(i=!0),t.blacklist!==null&&t.blacklist.tags!==null&&Ei.call(t.blacklist.tags,s.name.toLowerCase())&&(i=!0))}}),i&&o.remove(r)}),e.children.isEmpty}function TH(e,t,n,r){if(wo(e.prelude)||wo(e.block)){n.remove(t);return}if(this.atrule&&CH.has(Cn(this.atrule.name).basename))return;const{usage:o}=r;if(o&&(o.whitelist!==null||o.blacklist!==null)&&(n_(e.prelude,o),wo(e.prelude))){n.remove(t);return}}function AH(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 kH(e,t,n){n.remove(t)}var r_={Atrule:EH,Comment:SH,Declaration:wH,Raw:_H,Rule:TH,TypeSelector:AH,WhiteSpace:kH};function LH(e,t){Bt(e,{leave(n,r,o){r_.hasOwnProperty(n.type)&&r_[n.type].call(this,n,r,o,t)}})}function NH(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 xH(e){Cn(e.name).basename==="keyframes"&&NH(e)}var OH=/^(-?\d|--)|[\u0000-\u002c\u002e\u002f\u003A-\u0040\u005B-\u005E\u0060\u007B-\u009f]/;function RH(e){return e===""||e==="-"?!1:!OH.test(e)}function MH(e){const t=e.value;!t||t.type!=="String"||RH(t.value)&&(e.value={type:"Identifier",loc:t.loc,name:t.value})}function PH(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 IH(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 DH(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 et().fromArray(n)}function o_(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 i_={font:PH,"font-weight":IH,background:DH,border:o_,outline:o_};function BH(e){if(!this.declaration)return;const t=mi(this.declaration.property);i_.hasOwnProperty(t.basename)&&i_[t.basename](e)}var HH=/^(?:\+|(-))?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,FH=/^([\+\-])?0*(\d*)(?:\.0*|(\.\d*?)0*)?$/,$H=new Set(["Dimension","Hash","Identifier","Number","Raw","UnicodeRange"]);function Fc(e,t){const n=t&&t.prev!==null&&$H.has(t.prev.data.type)?FH:HH;return e=String(e).replace(n,"$1$2$3"),(e===""||e==="-")&&(e="0"),e}function WH(e){e.value=Fc(e.value)}var qH=new Set(["calc","min","max","clamp"]),zH=new Set(["px","mm","cm","in","pt","pc","em","ex","ch","rem","vh","vw","vmin","vmax","vm"]);function UH(e,t){const n=Fc(e.value);if(e.value=n,n==="0"&&this.declaration!==null&&this.atrulePrelude===null){const r=e.unit.toLowerCase();if(!zH.has(r)||this.declaration.property==="-ms-flex"||this.declaration.property==="flex"||this.function&&qH.has(this.function.name))return;t.data={type:"Number",loc:e.loc,value:n}}}var jH=new Set(["width","min-width","max-width","height","min-height","max-height","flex","-ms-flex"]);function VH(e,t){e.value=Fc(e.value),e.value==="0"&&this.declaration&&!jH.has(this.declaration.property)&&(t.data={type:"Number",loc:e.loc,value:e.value},Jw.matchDeclaration(this.declaration).isType(t.data,"length")||(t.data=e))}function GH(e){e.value=e.value.replace(/\\/g,"/")}var s_={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"},a_={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 hh(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 l_(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=hh(l,a,e+1/3),i=hh(l,a,e),s=hh(l,a,e-1/3)}return[Math.round(o*255),Math.round(i*255),Math.round(s*255),r]}function ph(e){return e=e.toString(16),e.length===1?"0"+e:e}function gh(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 XH(e,t){let n=e.name,r;if(n==="rgba"||n==="hsla"){if(r=gh(e.children,4,n==="rgba"),!r)return;if(n==="hsla"&&(r=l_(...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:Fc(r.shift())}});return}n="rgb"}if(n==="hsl"){if(r=r||gh(e.children,3,!1),!r)return;r=l_(...r),n="rgb"}if(n==="rgb"){if(r=r||gh(e.children,3,!0),!r)return;t.data={type:"Hash",loc:e.loc,value:ph(r[0])+ph(r[1])+ph(r[2])},c_(t.data,t)}}function KH(e,t){if(this.declaration===null)return;let n=e.name.toLowerCase();if(s_.hasOwnProperty(n)&&Jw.matchDeclaration(this.declaration).isType(e,"color")){const r=s_[n];r.length+1<=n.length?t.data={type:"Hash",loc:e.loc,value:r}:(n==="grey"&&(n="gray"),e.name=n)}}function c_(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]),a_[n]?t.data={type:"Identifier",loc:e.loc,name:a_[n]}:e.value=n}var u_={Atrule:xH,AttributeSelector:MH,Value:BH,Dimension:UH,Percentage:VH,Number:WH,Url:GH,Hash:c_,Identifier:KH,Function:XH};function YH(e){Bt(e,{leave(t,n,r){u_.hasOwnProperty(t.type)&&u_[t.type].call(this,t,n,r)}})}var ZH=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 QH(){const e=new ZH;return function(n){const r=$n(n);return n.id=e.resolve(r),n.length=r.length,n.fingerprint=null,n}}function JH(e){return e.type==="Raw"?gH(e.value,{context:"selectorList"}):e}function eF(e,t){for(let n=0;n<3;n++)if(e[n]!==t[n])return e[n]>t[n]?e:t;return e}function d_(e){return JH(e).children.reduce((t,n)=>eF(bh(n),t),[0,0,0])}function bh(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]=d_(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]=d_(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 tF=new Set(["first-letter","first-line","after","before"]),nF=new Set(["link","visited","hover","active","first-letter","first-line","after","before"]);function rF(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();nF.has(a)||n.add(`:${a}`);break}case"PseudoElementSelector":{const a=s.name.toLowerCase();tF.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=bh(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 oF(e,t){const n=QH();return Bt(e,{visit:"Rule",enter(r){r.block.children.forEach(n),rF(r,t.usage)}}),Bt(e,{visit:"Atrule",enter(r){r.prelude&&(r.prelude.id=null,r.prelude.id=$n(r.prelude)),Cn(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:f_}=Object.prototype;function m_(e,t,n,r){const o=t.data,i=Cn(o.name).basename,s=o.name.toLowerCase()+"/"+(o.prelude?o.prelude.id:null);f_.call(e,i)||(e[i]=Object.create(null)),r&&delete e[i][s],f_.call(e[i],s)||(e[i][s]=new et),e[i][s].append(n.remove(t))}function iF(e,t){const n=Object.create(null);let r=null;e.children.forEach(function(o,i,s){if(o.type==="Atrule"){const a=Cn(o.name).basename;switch(a){case"keyframes":m_(n,i,s,!0);return;case"media":if(t.forceMediaMerge){m_(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 h_(e){return e.type==="Atrule"&&e.name==="media"}function sF(e,t,n){if(!h_(e))return;const r=t.prev&&t.prev.data;!r||!h_(r)||e.prelude&&r.prelude&&e.prelude.id===r.prelude.id&&(r.block.children.appendList(e.block.children),n.remove(t))}function aF(e,t){iF(e,t),Bt(e,{visit:"Atrule",reverse:!0,enter:sF})}var{hasOwnProperty:qse}=Object.prototype;function p_(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 g_(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 $c(e){switch(e.type){case"Rule":return g_(e.prelude.children,this);case"Atrule":if(e.block)return e.block.children.some($c,this);break;case"Declaration":return!1}return!0}function lF(e,t,n){const r=e.prelude.children,o=e.block.children;n.prevUntil(t.prev,function(i){if(i.type!=="Rule")return $c.call(r,i);const s=i.prelude.children,a=i.block.children;return e.pseudoSignature===i.pseudoSignature&&p_(s,r)?(a.appendList(o),n.remove(t),!0):g_(r,s)})}function cF(e){Bt(e,{visit:"Rule",enter:lF})}function uF(e,t,n){const r=e.prelude.children;for(;r.head!==r.tail;){const o=new et;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 dF(e){Bt(e,{visit:"Rule",reverse:!0,enter:uF})}var b_=1,fF=2,Si=0,ra=1,yh=2,Wc=3,y_=["top","right","bottom","left"],mF={"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"},v_={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"},hF=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=mF[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[ra]=i[Si],i[yh]=i[Si],i[Wc]=i[Si];break;case 2:i[yh]=i[Si],i[Wc]=i[ra];break;case 3:i[Wc]=i[ra]}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(y_[s],i[s])&&(r[y_[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 et,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[Wc]===r[ra]&&(n.pop(),r[yh]===r[Si]&&(n.pop(),r[ra]===r[Si]&&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 pF(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(!v_.hasOwnProperty(l))return;const c=v_[l];let u,d;if((!r||i===r)&&c in t&&(d=fF,u=t[c]),(!u||!u.add(l,s))&&(d=b_,u=new hF(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 gF(e,t){e.forEach(function(n){const r=n.shorthand;r.isOkToMinimize()&&(n.operation===b_?n.item.data=t(r.getDeclaration()):n.block.remove(n.item))})}function bF(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=pF.call(this,o,l,r,a.lastShortSelector)}}),gF(r,t.declaration)}var yF=1,vF=new Set(["src"]),E_={display:/table|ruby|flex|-(flex)?box$|grid|contents|run-in/i,"text-align":/^(start|end|match-parent|justify-all)$/i},S_={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"]},w_={"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 __(e,t,n){const r=mi(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=Cn(f).vendor),/\\[09]/.test(f)&&(l=RegExp.lastMatch),S_.hasOwnProperty(r)?S_[r].indexOf(f)===-1&&(s[f]=!0):E_.hasOwnProperty(r)&&E_[r].test(f)&&(s[f]=!0);break}case"Function":{let{name:f}=d;a||(a=Cn(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?"!"+yF++:"!"+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 EF(e,t,n){const r=mi(t.property);if(w_.hasOwnProperty(r.basename)){const o=w_[r.basename];for(const i of o){const s=__(r.prefix+i,t,n),a=e.hasOwnProperty(s)?e[s]:null;if(a&&(!t.important||a.item.data.important))return a}}}function SF(e,t,n,r,o){const i=e.block.children;i.forEachRight(function(s,a){const{property:l}=s,c=__(l,s,o),u=r[c];u&&!vF.has(l)?s.important&&!u.item.data.important?(r[c]={block:i,item:a},u.block.remove(u.item)):i.remove(a):EF(r,s,o)?i.remove(a):(s.fingerprint=c,r[c]={block:i,item:a})}),i.isEmpty&&n.remove(t)}function wF(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),SF.call(this,r,o,i,c,n)}})}function _F(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 $c.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(d===i)return!0;s[d]=!0})}function CF(e){Bt(e,{visit:"Rule",enter:_F})}function TF(e,t,n){this.block!==null&&this.block.avoidRulesMerge;const r=e.prelude.children,o=e.block,i=Object.create(null);let s=!0,a=!0;n.prevUntil(t.prev,function(l,c){const u=l.block,d=l.type;if(d!=="Rule"){const h=$c.call(r,l);return!h&&d==="Atrule"&&u&&Bt(u,{visit:"Rule",enter(m){m.prelude.children.forEach(p=>{i[p.compareMarker]=!0})}}),h}if(e.pseudoSignature!==l.pseudoSignature)return!0;const f=l.prelude.children;if(a=!f.some(h=>h.compareMarker in i),!a&&!s)return!0;if(s&&p_(f,r))return u.children.appendList(o.children),n.remove(t),!0;s&&(s=!f.some(h=>r.some(m=>m.compareMarker===h.compareMarker))),f.forEach(h=>{i[h.compareMarker]=!0})})}function AF(e){Bt(e,{visit:"Rule",reverse:!0,enter:TF})}function kF(e,t){const n=oF(e,t);t.logger("prepare",e),aF(e,t),t.logger("mergeAtrule",e),cF(e),t.logger("initialMergeRuleset",e),dF(e),t.logger("disjoinRuleset",e),bF(e,n),t.logger("restructShorthand",e),wF(e),t.logger("restructBlock",e),CF(e),t.logger("mergeRuleset",e),AF(e),t.logger("restructRuleset",e)}function LF(e,t){const n=new et;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 NF(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),LH(e,r),r.logger("clean",e),YH(e,r),r.logger("replace",e),r.restructuring&&kF(e,r),e}function xF(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 OF(e){return"restructure"in e?e.restructure:"restructuring"in e?e.restructuring:!0}function RF(e){return new et().appendData({type:"Rule",loc:null,prelude:{type:"SelectorList",loc:null,children:new et().appendData({type:"Selector",loc:null,children:new et().appendData({type:"TypeSelector",loc:null,name:"x"})})},block:e})}function MF(e,t){e=e||{type:"StyleSheet",loc:null,children:new et},t=t||{};const n={logger:typeof t.logger=="function"?t.logger:function(){},restructuring:OF(t),forceMediaMerge:!!t.forceMediaMerge,usage:t.usage?vH(t.usage):!1},r=new et;let o=xF(t),i=!0,s,a,l=1,c;t.clone&&(e=fh(e)),e.type==="StyleSheet"?(s=e.children,e.children=r):s=RF(e);do{if(a=LF(s,!!o),NF(a.stylesheet,i,l++,n),c=a.stylesheet.children,a.comment&&(r.isEmpty||r.insert(et.createItem({type:"Raw",value:`
43
+ `})),r.insert(et.createItem(a.comment)),c.isEmpty||r.insert(et.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 PF=re({compress:()=>MF,find:()=>$F,findAll:()=>qF,findLast:()=>WF,fromPlainObject:()=>zF,generate:()=>HF,lexer:()=>IF,parse:()=>BF,specificity:()=>bh,toPlainObject:()=>UF,tokenize:()=>DF,walk:()=>FF});function C_(e){const t=lh(e,!0),n=lh(e);return t.length<n.length?t:n}var{lexer:IF,tokenize:DF,parse:BF,generate:HF,walk:FF,find:$F,findLast:WF,findAll:qF,fromPlainObject:zF,toPlainObject:UF}=bH({node:{String:{generate(e){this.token(5,C_(e.value))}},Url:{generate(e){const t=qw(e.value),n=C_(e.value);this.token(7,t.length<=n.length+5?t:"url("+n+")")}}}}),{parse:jF,generate:vh,compress:VF}=PF;function wi(e,t,n,r){return t.debug,r}function GF(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=vh(o);e===2&&s.length>256&&(s=s.substr(0,256)+"..."),i+=`
45
+ ${s}
46
+ `}t=Date.now()}}function XF(e){return e={...e},typeof e.logger!="function"&&e.debug&&(e.logger=GF(e.debug)),e}function T_(e,t,n){Array.isArray(n)||(n=[n]),n.forEach(r=>r(e,t))}function KF(e,t,n){n=n||{};const r=n.filename||"<unknown>";let o;const i=wi("parsing",n,Date.now(),jF(t,{context:e,filename:r,positions:!!n.sourceMap}));n.beforeCompress&&wi("beforeCompress",n,Date.now(),T_(i,n,n.beforeCompress));const s=wi("compress",n,Date.now(),VF(i,XF(n)));return n.afterCompress&&wi("afterCompress",n,Date.now(),T_(s,n,n.afterCompress)),n.sourceMap?o=wi("generate(sourceMap: true)",n,Date.now(),(()=>{const a=vh(s.ast,{sourceMap:!0});return a.map._file=r,a.map.setSourceContent(r,t),a})()):o=wi("generate",n,Date.now(),{css:vh(s.ast),map:null}),o}function _o(e,t){return KF("stylesheet",e,t)}var A_={restructure:!0,forceMediaMerge:!0};function k_(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(_o(s.innerHTML,A_).css,{indent:" ",autosemicolon:!0})+`
48
+ `;s.innerHTML!==a&&(s.textContent=a,r=!0)}if(s.sheet&&L_(e,s.sheet,o,i)){let a=ZF(s.sheet);a=_o(a,A_).css,a=`
49
+ `+cssbeautify(a,{indent:" ",autosemicolon:!0})+`
50
+ `,s.innerHTML!==a&&(s.textContent=a,r=!0)}}return r}function L_(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-")}`),YF(e,c,r)||(t.deleteRule(a),i=!0)}else if(l instanceof CSSGroupingRule)i=L_(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 YF(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 ZF(e){return Array.from(e.cssRules,t=>t.cssText).join(`
51
+ `)}var N_=/device-width/i,QF="not all",_i=new Map,Eh=!1;function JF(e){return"media"in e&&"cssRules"in e}function x_(e,t){for(const n of Array.from(e))JF(n)&&t(n),"cssRules"in n&&x_(n.cssRules,t)}function e$(e){try{return e.cssRules}catch{return}}function t$(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n&&!N_.test(n));return t.length?t.join(", "):QF}function Sh(e){_i.forEach((t,n)=>{n.parentStyleSheet?.ownerNode?.isConnected||_i.delete(n)});for(const t of Array.from(e.styleSheets)){const n=e$(t);n&&x_(n,r=>{const o=r.media.mediaText;_i.has(r)||!N_.test(o)||(_i.set(r,o),r.media.mediaText=t$(o))})}}function O_(){_i.forEach((e,t)=>{t.media.mediaText=e}),_i.clear()}function n$(e){if(!Eh)return e();O_();try{return e()}finally{Sh(document)}}function r$(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 o$(e=window){if(!e.matchMedia("(pointer: coarse)").matches)return()=>{};const t=e.document;Eh=!0,Sh(t);const n=new MutationObserver(r=>{r$(r)&&Sh(t)});return n.observe(t.documentElement,{childList:!0,characterData:!0,subtree:!0}),()=>{n.disconnect(),O_(),Eh=!1}}function oa(e){return te(e)}var zse=te("extensions.atomsHandlers"),Use=oa("HANDLE_ATOM_INSERT"),jse=te("HeadlessMode"),Vse=te("extensions.sandboxExtensions"),i$="SANDBOX_EXTENSION_SCRIPT_STATUS",Gse=te("MESSAGE_SERVICE"),Xse=oa("SETTINGS_PANEL_EVENT"),Kse=oa("MODAL_SHOW_EVENT"),Yse=oa("MODAL_CLOSE_EVENT"),Zse=oa("MODAL_UPDATE_EVENT");function Qse(e){return e}var R_="SandboxApp",wh="IframePluginRegistry",s$="__sandbox__";function M_(){return tf(s$)}function a$(e=M_()){return e.getOrCreateInstance(wh,()=>new dy)}var _h=new Ix(()=>a$()),ia=class QN{constructor(){A(this,"container",M_()),A(this,"pluginCollection",new Px(this,_h)),this.pluginCollection.activateSync()}static get instance(){return this._instance||(this._instance=new QN)}static registerPlugin(t,n){_h.add(t,n)}static registerAll(t){for(const n of Object.keys(t)){let r=n;const o=t[r];o&&_h.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(ia,"_instance",void 0);var sa="data-extension";function aa(e,t,n,r){j.send(i$,{key:e,phase:t,status:n,error:r})}function l$(){if(typeof document>"u")return;const e=document.currentScript;if(e instanceof HTMLScriptElement)return e.getAttribute(sa)||void 0}function P_(e){return{key:e,hasSyncPlugins:!1,pendingPlugins:new Set,loadedNotified:!1,readyNotified:!1,readyFailed:!1}}function Ch(e){!e.loadedNotified||e.readyNotified||e.readyFailed||(!e.hasSyncPlugins||e.pendingPlugins.size===0)&&(e.readyNotified=!0,aa(e.key,"ready","success"))}function I_(e,t){return[...document.querySelectorAll(`${e}[${sa}]`)].find(n=>n.getAttribute(sa)===t)}function c$({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(sa,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 u$(e,t={}){const n=new ye,r=new Map,o=new Map,i=new Map,s=new WeakMap,a=u=>{let d=i.get(u);return d||(d=P_(u),i.set(u,d)),d},l=u=>{if(u.type==="created"){const h=l$();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),Ch(f);return}(u.type==="init:error"||u.type==="afterInit:error")&&(f.pendingPlugins.delete(u.plugin),f.readyFailed=!0,aa(d,"ready","error",`Sandbox plugin "${u.name}" failed during ${u.type==="init:error"?"init":"afterInit"}.`))}};n.addDisposable(ia.onLifecycle(l)),n.addDisposable(j.addListener(ue.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,P_(d.key));const h=d.parent&&document.querySelector(d.parent)||document.head;if(f=c$(d),e.ownership.markService(f),d.type==="script"){const m=f;m.src&&(m.onload=()=>{const p=a(d.key);p.loadedNotified=!0,aa(d.key,"load","success"),Ch(p)},m.onerror=()=>aa(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,aa(d.key,"load","success"),Ch(m)}r.set(d.key,f),o.set(d.key,d)}})),n.addDisposable(j.addListener(ue.SANDBOX_REMOVE_EXTENSIONS,u=>{for(const d of u){const f=I_(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=I_(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 d$(e){e.querySelectorAll(`[${sa}]`).forEach(t=>t.remove())}var Co="remove-basic-cell",f$="remove-basic-row",To="em-active-table-cell",m$="em-temporary-class",$r="em-temporary-active-cell-background-color",Wr="temporary-cell-class",qc=[Co,f$,To,m$,Wr,$r],h$=["contenteditable","em-edit","em-state","em-hover"],D_=`<div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5a5a5a;">&nbsp;</div>`,la="em-table-menu",ca="em_version";function zc(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(ca),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash):e}catch{return e}}function p$(e){try{const t=typeof document<"u"?document.baseURI:"http://localhost/",n=new URL(e,t);return n.searchParams.set(ca,String(Date.now())),/^https?:\/\//i.test(e)||e.startsWith("//")?n.href:n.pathname+n.search+n.hash}catch{return`${e}${e.includes("?")?"&":"?"}${ca}=${Date.now()}`}}var g$=/^(chrome-extension|moz-extension|safari-extension):\/\//i,b$=/local\.adguard\.org/i,y$=/^bis_/i,v$=new Set(["data-bis-config"]),Ci=/<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,E$=/\s(?:bis_[a-z0-9_-]+|data-bis-config|data-dynamic-id)=(["'])(?:(?!\1).)*\1/gi,Uc=/<style\b[^>]*>[\s\S]*?<\/style>/gi,B_=/display:\s*none\s*!important/gi,H_="data-darkreader-",S$=/<(script|style)\b[\s\S]*?<\/\1\s*>|<[a-z][^\s<>]*(?:"[^"]*"|'[^']*'|[^<>"'])*?\sdata-darkreader-(?:"[^"]*"|'[^']*'|[^<>"'])*>/gi,w$=/\sdata-darkreader-[a-z0-9-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?/gi,_$=[".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; }"],F_=new Set(["em","data-theme-varibalse","data-em-localization"]);function C$(e){return B_.lastIndex=0,(e.match(B_)||[]).length}function Th(e){const t=e.trim(),n=C$(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=_$.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 T$(e){if(F_.has("em")&&e.getAttribute("em")==="styles")return!1;for(const t of F_)if(e.hasAttribute(t))return!1;return Th(e.textContent||"")}function A$(e){return g$.test(e.src)||b$.test(e.src)?!0:e.hasAttribute("bis_use")||e.hasAttribute("data-bis-config")}function $_(e){let t=!1;for(const n of[...e.attributes])(y$.test(n.name)||v$.has(n.name))&&(e.removeAttribute(n.name),t=!0);return t}function k$(e){Uc.lastIndex=0;for(const t of e.matchAll(Uc))if(Th(t[0].replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,"")))return!0;return!1}function L$(e){let t=!1;return Uc.lastIndex=0,{html:e.replace(Uc,n=>Th(n.replace(/^<style\b[^>]*>/i,"").replace(/<\/style>$/i,""))?(t=!0,""):n),found:t}}function W_(e){let t=!1;return e instanceof Element&&$_(e)&&(t=!0),e.querySelectorAll("script").forEach(n=>{A$(n)&&(n.remove(),t=!0)}),e.querySelectorAll("style").forEach(n=>{n.tagName==="STYLE"&&T$(n)&&(n.remove(),t=!0)}),e.querySelectorAll("*").forEach(n=>{$_(n)&&(t=!0)}),t}function N$(e){return Ci.lastIndex=0,Ci.test(e)||/\sbis_[a-z0-9_-]+\s*=/.test(e)||/\sdata-bis-config\s*=/.test(e)||k$(e)}function x$(e){return e.toLowerCase().startsWith(H_)}function O$(e){return e.toLowerCase().includes(H_)?e.replace(S$,(t,n)=>n?t:t.replace(w$,"")):e}function R$(e){const t=O$(e);if(!N$(t))return{html:t,found:!1};let n=!1,r=t;Ci.lastIndex=0,Ci.test(r)&&(Ci.lastIndex=0,r=r.replace(Ci,""),n=!0),(/\sbis_[a-z0-9_-]+\s*=/.test(r)||/\sdata-bis-config\s*=/.test(r))&&(r=r.replace(E$,""),n=!0);const o=L$(r);return r=o.html,n=n||o.found,{html:r,found:n}}var M$=class extends ye{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 Ah(){return It.getInstance(qo)}var jc=new WeakMap;function P$(e,t,n){const r=jc.get(e);r?r.set(t.toLowerCase(),n):jc.set(e,new Map([[t.toLowerCase(),n]]))}function I$(e,t){const n=jc.get(e);n?.size&&jc.set(t,new Map(n))}function q_(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 Vc(e,t={}){const n=t.pipeline??Ah(),r=t.stage??"build";let o=e;if(t.clone&&(o=e.cloneNode(!0),on(e,o),n&&!n.isEmpty&&z_(e,o)),!n||n.isEmpty)return o;o instanceof Element&&q_(o,n,r);const i=o.querySelectorAll?.("*");if(i)for(const s of i)q_(s,n,r);return o}function D$(e,t={}){const n=t.pipeline??Ah(),r=eD(e);if((!n||n.isEmpty)&&!r)return Lr(e);const o=Vc(e,{...t,pipeline:n,clone:!0});return ii(o),Fb(o)}function z_(e,t){I$(e,t);const n=e.childNodes,r=t.childNodes;for(let o=0;o<n.length&&o<r.length;o++)z_(n[o],r[o])}function Ht(e,t,n,r={}){const o=kh(e,t,n,{stage:"settings",...r});o===null?e.removeAttribute(t):e.setAttribute(t,o)}function kh(e,t,n,r={}){const o=r.pipeline??Ah();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&&P$(a,t,n)}return s}function B$(e){const t=new M$,n=Ub((o,i,s)=>t.isEmpty?s:kh(o,i,s,{pipeline:t})),r=W2((o,i,s)=>t.isEmpty?s:t.serialize(s,{element:o,tag:o.tagName.toLowerCase(),attribute:i,stage:"apply"}));return e.inject(qo,t),{pipeline:t,dispose(){r(),n(),t.dispose(),En(e,qo)}}}function H$(e){return zc(e)}function U_(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 j_=[".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"],F$=["contenteditable","em-edit","em-state","em-hover"],$$=["[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"],V_=new Set(["normal","400"]),G_=new Set(["normal"]),W$=new Set(["baseline","unset","initial",""]),X_=new Set(["none",""]),q$=["b","strong","em","i","u","s","strike","sup","sub"],z$=["B","STRONG","H1","H2","H3","H4","H5","H6","TH"],U$=["I","EM","CITE","VAR","DFN","ADDRESS"],j$=[[/^(thin|hairline)/i,100],[/^(extra|ultra)light/i,200],[/^light/i,300],[/^(semi|demi)bold/i,600],[/^(extra|ultra)bold/i,800],[/^bold/i,700],[/^(black|heavy)/i,900],[/^medium/i,500],[/^(regular|normal|book|italic)/i,400]],V$="___em-internal",K_=["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"],G$=["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"],X$=[...j_,...$$].filter(e=>/\.em-(element-|gap|vindent)/.test(e)&&e!=="span.em-element-resize-img-container").join(", "),K$=F$.filter(e=>!j_.some(t=>t.includes(`[${e}`))),Y$=[...K_,...G$],Y_={isServiceAttribute:e=>K$.includes(e)||x$(e),isServiceClass:e=>Y$.includes(e),isServicePanel:e=>e.matches(X$)||e.hasAttribute("data-em-caret")};function Z_(e){qc.forEach(t=>{e.querySelectorAll(`.${t}`).forEach(n=>n.classList.remove(t))})}function Gc(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")}),K_.forEach(n=>{e.querySelectorAll(`.${n}`).forEach(r=>r.classList.remove(n))}),e.querySelectorAll(".em-powered-logo").forEach(n=>n.remove());for(const n of e.querySelectorAll("[class='']"))n.removeAttribute("class");const t=e instanceof Document?e.documentElement:e;t&&(_t(t,"[data-mce-caret=before]",!0),_t(t,".em-element-resize-img",!0),_t(t,"span.em-element-resize-img-container"),_t(t,"div.em-element-img-change-group",!0),_t(t,"div.em-element-block-add",!0),_t(t,"meta[http-equiv=Content-Security-Policy]",!0),_t(t,"[class*=mce-]"),_t(t,"script[em=initial]",!0),_t(t,".em-editor-wrapper",!0),_t(t,".em-element-resize-height",!0),_t(t,".em-element-vindent-remove",!0),_t(t,".em-element-vindent",!0),_t(t,".em-element-vindent-value",!0),_t(t,"div.iframe-resizer-inner"))}function Z$(e,t){e.querySelectorAll("tbody").forEach(n=>n.replaceWith(...Array.from(n.childNodes))),e.querySelectorAll(".em-code").forEach(n=>n.remove()),e.querySelectorAll(':not(editor)[contenteditable="false"]').forEach(n=>n.remove()),e.querySelectorAll('.em-vindent[class*="em-vindent-padding"]').forEach(n=>n.remove()),e.querySelectorAll(".em-code").forEach(n=>n.remove()),e.querySelectorAll("[contenteditable]").forEach(n=>n.removeAttribute("contenteditable")),e.querySelectorAll("[em-edit]").forEach(n=>n.removeAttribute("em-edit")),e.querySelectorAll("[em-state]").forEach(n=>n.removeAttribute("em-state")),e.querySelectorAll("[em-hover]").forEach(n=>n.removeAttribute("em-hover")),e.querySelectorAll("#gtx-anchor").forEach(n=>n.remove()),e.querySelectorAll('[data-mce-bogus="1"]').forEach(n=>n.remove()),e.querySelectorAll("strike").forEach(n=>n.removeAttribute("style")),e.querySelectorAll("u").forEach(n=>n.removeAttribute("style")),e.querySelectorAll('style[data-theme-varibalse="true"]').forEach(n=>n.remove()),e.querySelectorAll('style[data-em-localization="true"]').forEach(n=>n.remove()),e.querySelectorAll(".em-element-img-change-group").forEach(n=>n.remove()),e.querySelectorAll(".em-element-resize-img").forEach(n=>n.remove()),e.querySelectorAll(".em-element-editor").forEach(n=>n.remove()),e.querySelectorAll(".em-element-vindent-bg").forEach(n=>n.remove()),e.querySelectorAll(".em-element-vindent-value").forEach(n=>n.remove()),e.querySelectorAll(".em-element-gap").forEach(n=>n.remove()),e.querySelectorAll(".em-element-gap-marker").forEach(n=>n.remove()),e.querySelectorAll(".em-element-gap-bg").forEach(n=>n.remove()),e.querySelectorAll(".em-gap").forEach(n=>n.remove()),e.querySelectorAll(".em-just-inserted").forEach(n=>n.classList.remove("em-just-inserted")),e.querySelectorAll(".em-native-img-uploading").forEach(n=>n.classList.remove("em-native-img-uploading")),e.querySelectorAll(".em-native-img-drop-target").forEach(n=>n.classList.remove("em-native-img-drop-target")),e.querySelectorAll(".em-native-img-upload-spin-overlay").forEach(n=>n.remove()),e.querySelectorAll(".em-element-list-bullet").forEach(n=>n.classList.remove("em-element-list-bullet")),e.querySelectorAll(".remove-new-editor-element").forEach(n=>n.classList.remove("remove-new-editor-element")),Z_(e),Gc(e),QE(e),_t(e,"editor",!1),eC(e,t),U_(e),W_(e)}function Ti(e){return(e??"").trim().toLowerCase()}function Lh(e){const t=Array.from(e.classList).find(n=>n.startsWith("em-font-"));return t?.slice(t.lastIndexOf("-")+1)}function Q$(e){const t=/^\d{3}/.exec(e);return t?Number(t[0]):j$.find(([n])=>n.test(e))?.[1]}function Q_(e,t){const n=Ti(e.style?.[t]);return n==="inherit"||n==="unset"?"":n}var J$=e=>{const t=Q_(e,"fontWeight");if(t)return V_.has(t)||t==="initial"?"normal":"other";const n=Lh(e),r=n===void 0?void 0:Q$(n);return r!==void 0?r===400?"normal":"other":z$.includes(e.tagName)?"other":void 0},eW=e=>{const t=Q_(e,"fontStyle");return t?G_.has(t)||t==="initial"?"normal":"other":/italic/i.test(Lh(e)??"")||U$.includes(e.tagName)?"other":void 0};function tW(e,t,n,r){for(let o=e.parentElement;o&&o!==t;o=o.parentElement){const i=r(o);if(i)return i}for(let o=n instanceof Element?n:null;o;o=o.parentElement){const i=r(o);if(i)return i}}function nW(e,t){const n=Lh(e)!==void 0,r=Ti(e.style.fontWeight);r&&V_.has(r)&&!n&&t(J$)!=="other"&&e.style.removeProperty("font-weight");const o=Ti(e.style.fontStyle);o&&G_.has(o)&&!n&&t(eW)!=="other"&&e.style.removeProperty("font-style");const i=Ti(e.style.verticalAlign);i&&W$.has(i)&&e.style.removeProperty("vertical-align");const s=Ti(e.style.textDecorationLine);s&&X_.has(s)&&e.style.removeProperty("text-decoration-line");const a=Ti(e.style.textDecoration);a&&X_.has(a)&&e.style.removeProperty("text-decoration");const l=e.getAttribute("style");l!==null&&l.trim()===""&&e.removeAttribute("style")}function rW(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function J_(e){if(e.attributes.length===0)return!0;for(const t of Array.from(e.attributes))if(t.name!==V$)return!1;return!0}function eC(e,t){const n=Array.from(e.querySelectorAll("span"));for(let r=n.length-1;r>=0;r-=1){const o=n[r];nW(o,i=>tW(o,e,t,i)),J_(o)&&rW(o)}for(const r of q$){const o=Array.from(e.querySelectorAll(r));for(let i=o.length-1;i>=0;i-=1){const s=o[i];s.childNodes.length===0&&J_(s)&&s.remove()}}}function oW(e){const t=[],n=cW(e);return e=aW(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=rc.clear(e),e=Nh(e),t.length===0?e:dW(e,t,n)}var tC=`(<(script|style)\\b[^>]*>)([\\s\\S]*?)(?=<\\/\\2${ul})`,iW=new RegExp(tC,"gi"),sW=new RegExp(`<!--[\\s\\S]*?-->|${tC}`,"gi");function aW(e,t,n){const r=(o,i,s,a)=>!a||!uW(s,i)?i+a:(t.push(s.toLowerCase()==="style"?lW(a):a),`${i}${n}${t.length-1}${rC}`);return e.replaceAll(sW,(o,i,s,a)=>i===void 0?o.replaceAll(iW,r):r(o,i,s??"",a??""))}function lW(e){const t=Nh(rc.clear(`>${e}`));return t.startsWith(">")?t.slice(1):Nh(rc.clear(e))}var nC="",rC="";function cW(e){let t=nC;for(;e.includes(t);)t+=nC;return t}function uW(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]),Sn(n)}function dW(e,t,n){return e.replaceAll(new RegExp(`${n}(\\d+)${rC}`,"g"),(r,o)=>t[Number(o)]??r)}function Nh(e){return 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(/&amp;nbsp;/gi,"&nbsp;").replaceAll(/&amp;zwnj;/gi,"&zwnj;"),e=e.replaceAll(/style="transform: translateZ\(0px\);"/gi,""),e=e.replaceAll(/ +>/gi,">"),e=e.replaceAll(/&amp;/gi,"&"),e=e.replaceAll(/&quot;/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,""),e=Mv(e),e=e.replaceAll(/<tbody>/gi,"").replaceAll(/<\/tbody>/gi,""),e}function oC(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 fW(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 iC(){const e=Array.from(document.querySelectorAll('style[em="styles"]'));return n$(()=>k_(document,e,{forceMediaMerge:!0}))}function mW(e){let t=!1;return e.beforeCommit(()=>{try{!t&&e.takeStyleDirty()&&(t=!0,iC(),e.takeStyleDirty())}finally{t=!1}})}function Xc(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 Xc({node:n});i=oC(s);const a=n.cloneNode(!0);on(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 Xc({html:t});i=oC(s);const c=Le(a);i.replaceChildren(...c)}Vc(i,{stage:"apply"}),Z$(i,eM(n)),t=xt(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)fW(i,Le(t));else if(n){const s=n.cloneNode(!0);on(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()),d$(i),Z_(i),Gc(i),QE(i),i.documentElement&&_t(i.documentElement,"editor",!1),i.querySelectorAll("ya-tr-span").forEach(s=>{s.parentNode&&(Array.from(s.childNodes).forEach(a=>s.parentNode.insertBefore(a,s)),s.remove())}),eC(i)),Vc(i,{stage:"apply"}),U_(i),W_(i),t=Dt(i)}return R$(oW(t)).html}var Kc=te("SandboxCompanionFinders"),hW=te("SandboxAfterOperation"),sC=te("SandboxEmptied"),pW=8;function gW(e){return e?.nodeType===Node.TEXT_NODE&&!(e.textContent??"").trim()}function aC(e,t){return t?e.nextSibling:e.previousSibling}function ur(e,t){let n=aC(e,t);for(;gW(n);)n=aC(n,t);return n}function bW(e,t){for(const n of e){const r=n(t.first,t.last);if(r)return r}}function dr(e,t,n){const r=e.getServices(Kc).filter(i=>i!==n);let o={first:t,last:t};for(let i=0;i<pW;i+=1){const s=bW(r,o);if(!s)break;o={first:s.before??o.first,last:s.after??o.last}}return o}function Ai({first:e,last:t}){const n=[];for(let r=e;r;r=r.nextSibling)if(n.push(r),r===t)return n;return[e]}var xh=(e,t,n)=>{e.insertBefore(t,n)};function yW(e,t,n,r,o=xh){Ai(dr(e,t)).forEach(i=>(i===t?o:xh)(n,i,r)),t instanceof Element&&ua(e,[t])}function vW(e,t){const n=Ai(dr(e,t)),r=n.indexOf(t);return{before:n.slice(0,r),after:n.slice(r+1)}}function lC(e,t,n){const r=e===t||!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING),o=e===n||!!(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING);return r&&o}function cC(e,t){let n=e;for(;n&&n.nodeType!==Node.ELEMENT_NODE;)n=t?n.nextSibling:n.previousSibling;return n}function uC(e,t,n){const r=cC(t,!0);if(r&&t){const i=dr(e,r);if(i.first!==r&&lC(t,i.first,r))return i.first}const o=cC(n,!1);if(o){const i=dr(e,o);if(i.last!==o&&n&&lC(n,o,i.last)&&n!==i.last)return i.last.nextSibling}return t}function EW(e){const t=ur(e,!1)?.nodeType,n=ur(e,!0)?.nodeType;return n===Node.ELEMENT_NODE&&t===Node.COMMENT_NODE||t===Node.ELEMENT_NODE&&n===Node.COMMENT_NODE}function SW(e,t,n){const r=[...n.before,t,...n.after],o=Ai(dr(e,t));return o.length===r.length&&o.every((i,s)=>i===r[s])}function wW(e,t,n){const r=t.parentNode;if(!r||!EW(t)&&SW(e,t,n))return;const o=t.nextSibling,i=t.previousSibling;r.removeChild(t),r.insertBefore(t,uC(e,o,i)),n.before.forEach(s=>r.insertBefore(s,t)),[...n.after].reverse().forEach(s=>r.insertBefore(s,t.nextSibling)),ua(e,[t])}function _W(e,t,n){const r=t.parentNode;if(!r)return;const o=Ai(dr(e,n));o.forEach(l=>l.parentNode?.removeChild(l));const i=t.nextSibling,s=t.previousSibling;r.removeChild(t);const a=uC(e,i,s);o.forEach(l=>r.insertBefore(l,a)),n instanceof Element&&ua(e,[n])}function CW(e,t,n){const r=Ai(dr(e,t)),o=r.indexOf(t),i=t.parentNode;if(!i)return;const s=r[r.length-1].nextSibling;r.slice(0,o).forEach(a=>i.insertBefore(a.cloneNode(!0),s)),i.insertBefore(n,s),r.slice(o+1).forEach(a=>i.insertBefore(a.cloneNode(!0),s)),n instanceof Element&&ua(e,[n])}function TW(e,t){Ai(dr(e,t)).forEach(n=>n.parentNode?.removeChild(n))}function ua(e,t){t.length&&e.getServices(hW).forEach(n=>n(t))}var AW=te("SandboxCompanions"),Wn={range:e=>({first:e,last:e}),move:(e,t,n,r=xh)=>r(t,e,n),remove:e=>e.parentNode?.removeChild(e),copy:(e,t)=>e.parentNode?.insertBefore(t,e.nextSibling),place:(e,t)=>e.parentNode?.replaceChild(t,e),capture:()=>({before:[],after:[]}),settle:()=>{},touched:()=>{},emptied:()=>{}};function Ao(e){return e.getOrCreateInstance(AW,()=>({range:(t,n)=>dr(e,t,n),move:(t,n,r,o)=>yW(e,t,n,r,o),remove:t=>TW(e,t),copy:(t,n)=>CW(e,t,n),place:(t,n)=>_W(e,t,n),capture:t=>vW(e,t),settle:(t,n)=>wW(e,t,n),touched:t=>ua(e,t),emptied:t=>e.getServices(sC).forEach(n=>n(t))}))}function Oh(){return It.getInstance(my)?.()??document.head}function Yc(){return Oh().querySelector('style[em="styles"]')??document.querySelector('style[em="styles"]')}function $e(){if(!Yc()){const e=document.createElement("style");e.setAttribute("em","styles"),Oh().append(e)}}function dC(){const e=Oh(),t=()=>{const r=Yc(),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 Zc(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function Qc(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)}}var kW="[if !mso]><!",LW="<![endif]",NW=/^\s*\[if\s*!\s*mso\s*\]>\s*<!(?:--\s*)?$/i;function fC(e){return e?.nodeType===Node.COMMENT_NODE&&NW.test(e.data)}function xW(e){return e?.nodeType===Node.COMMENT_NODE&&e.data.trim()==="<![endif]"}var mC=(e,t)=>{const n=ur(e,!1),r=ur(t,!0);return fC(n)&&xW(r)?{before:n,after:r}:void 0};function hC(e){const t=mC(e,e);return t?{open:t.before,close:t.after}:void 0}function OW(e){if(!hC(e)){const t=e.ownerDocument;e.before(t.createComment(kW)),e.after(t.createComment(LW))}}function RW(e){const t=hC(e);t&&(t.open.remove(),t.close.remove())}function MW(e){return e.addService(Kc,mC)}function Rh(){return V.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"},PW={"Sans Serif":"sans-serif",Serif:"serif"},eu="none",pC="b64_",IW=/^(\d+(?:_\d+)?)(px|perc)$/;function DW(e){if(e===eu)return eu;let t="";return new TextEncoder().encode(zc(e)).forEach(n=>{t+=String.fromCharCode(n)}),pC+btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function BW(e){if(e===eu)return eu;if(!e.startsWith(pC))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 HW(e){return`url("${e.replace(/[\n\r\f]/g,"").replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`}function gC(e){return e.replace(/\./g,"_").replace(/%/g,"perc")}function bC(e){const t=e.match(IW);return t?t[1].replace("_",".")+(t[2]==="perc"?"%":"px"):e}function FW(){return Yc()}function Be(e,t){const n=FW();n&&n.insertAdjacentHTML("beforeend",`
52
+ ${dC()}
53
+ .${e} { ${t} }
54
+ }
55
+ `)}function be(e,t){const n=[];e.classList.forEach(r=>{r.indexOf(t)>-1&&n.push(r)}),n.forEach(r=>e.classList.remove(r))}function yC(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,be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim)Be(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`);else{const r=t.value!=="auto"?t.value:"none";Be(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${r} !important;`)}}else be(e.elem,t.classNamePrefix)}function $W(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,be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?Be(n,`width: ${t.value}${t.dim} !important; max-width: ${t.value}${t.dim} !important; min-width: ${t.value}${t.dim} !important;`):Be(n,`width: ${t.value} !important; max-width: ${t.value} !important; min-width: ${t.value}${t.dim} !important;`)}else be(e.elem,t.classNamePrefix)}function ki(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,be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),t.dim?Be(n,`height: ${t.value}${t.dim} !important;`):Be(n,`height: ${t.value} !important;`)}else be(e.elem,t.classNamePrefix)}function WW(e){const t=["all","top","right","bottom","left"],n={all:"em-mob-border_all-",top:"em-mob-border_top-",right:"em-mob-border_right-",bottom:"em-mob-border_bottom-",left:"em-mob-border_left-"},r=Object.values(n);e.elem.classList.forEach(i=>{r.some(s=>i.includes(s))&&e.elem.classList.remove(i)});const o=e.settings.mobileBorder;t.forEach(i=>{const s=o[i];if(s&&(parseInt(String(s.width))||s.style||s.color)){let a=(s.classNamePrefix||n[i])+(s.width!=null?s.width+"px":"")+(s.style?"_"+s.style:"")+(s.color?"_"+s.color.substring(1):"");e.elem.classList.add(a),$e();let l="";i==="all"?l=(s.width!=null?`border-width: ${s.width}px !important; `:"")+(s.style?`border-style: ${s.style} !important; `:"")+(s.color?`border-color: ${s.color} !important; `:""):l=(s.width!=null?`border-${i}-width: ${s.width}px !important; `:"")+(s.style?`border-${i}-style: ${s.style} !important; `:"")+(s.color?`border-${i}-color: ${s.color} !important; `:""),Be(a,l)}})}function qW(e){const t=e.settings.mobileBorderRadius;if(!t)return;const n=["all","topLeft","topRight","bottomRight","bottomLeft"].find(s=>s in t);if(!n)return;const r=t.classNamePrefix||`em-mob-border_radius_${n}-`,o=t[n],i=typeof o=="object"&&o!==null&&"value"in o?o.value:o;if(n==="all"&&i==null){Array.from(e.elem.classList).forEach(s=>{s.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(s)});return}if(i!=null){const s=r+i;e.elem.classList.forEach(a=>{a.indexOf(r)>-1&&e.elem.classList.remove(a)}),n==="all"&&Array.from(e.elem.classList).forEach(a=>{a.startsWith("em-mob-border_radius_")&&e.elem.classList.remove(a)}),e.elem.classList.add(s),$e(),Be(s,`${{all:"border-radius",topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"}[n]||"border-radius"}: ${i}px !important;`),n!=="all"&&["em-mob-border_radius_topLeft","em-mob-border_radius_topRight","em-mob-border_radius_bottomLeft","em-mob-border_radius_bottomRight"].every(a=>Array.from(e.elem.classList).some(l=>l.startsWith(a)))&&be(e.elem,"em-mob-border_radius_all-")}else e.elem.classList.forEach(s=>{s.indexOf(r)>-1&&e.elem.classList.remove(s)})}function zW(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":"");be(e.elem,n),e.elem.classList.add(c),$e(),Be(c,`box-shadow:${l} ${r} ${o} ${i} ${s} ${a} !important;`)}else if(t.value){const r=(t.classNamePrefix||"em-mob-boxshadow_")+t.value.replace(/\s/g,"_").replace(/\(/g,"").replace(/\)/g,"").replace(/,/g,"-");be(e.elem,t.classNamePrefix||"em-mob-boxshadow_"),e.elem.classList.add(r),$e(),Be(r,`box-shadow: ${t.value} !important;`)}else be(e.elem,n)}function vC(e){const t=e.fieldName??"mobileAlign",n=e.settings[t];if(n.value){const r=n.classNamePrefix+n.value;be(e.elem,n.classNamePrefix),e.elem.classList.add(r),$e(),Be(r,`text-align: ${n.value} !important;`)}else be(e.elem,n.classNamePrefix)}function UW(e){const t=e.settings.mobileAlign;if(t.value){const n=t.classNamePrefix+t.value;be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e();let r="";t.value==="left"||t.value==="right"?r=`float: ${t.value}`:r="margin: 0 auto",Be(n,`${r} !important;`)}else be(e.elem,t.classNamePrefix)}function Mh(e){const t=e.settings.mobileVerticalAlign;if(t.value){const n=t.classNamePrefix+t.value;be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`vertical-align: ${t.value} !important;`)}else be(e.elem,t.classNamePrefix)}function jW(e){const t=e.settings.mobileDirection;if(t.value){const n=t.classNamePrefix+t.value;be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`direction: ${t.value} !important;`)}else be(e.elem,t.classNamePrefix)}function VW(e){const t=e.settings.mobileBackgroundColor;if(t.value){const n=t.value!=="none"?String(t.value).substring(1):"none",r=t.classNamePrefix+n;be(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),Be(r,`background-color: ${t.value!=="none"?t.value:"transparent"} !important;`)}else be(e.elem,t.classNamePrefix)}function GW(e){const t=e.settings.mobileBackgroundImage[0];if(t.value){const n=String(t.value),r=t.classNamePrefix+DW(n);be(e.elem,t.classNamePrefix),e.elem.classList.add(r),$e(),Be(r,`background-image: ${n!=="none"?HW(zc(n)):"none"} !important;`)}else be(e.elem,t.classNamePrefix)}function XW(e){const t=e.settings.mobileBackgroundPositionX;if(t.value){const n=t.classNamePrefix+gC(String(t.value));be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`background-position-x: ${t.value} !important;`)}else be(e.elem,t.classNamePrefix)}function KW(e){const t=e.settings.mobileBackgroundPositionY;if(t.value){const n=t.classNamePrefix+gC(String(t.value));be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`background-position-y: ${t.value} !important;`)}else be(e.elem,t.classNamePrefix)}function YW(e){const t=e.settings.mobileBackgroundRepeat;if(t.value&&t.value!=="none"){const n=t.classNamePrefix+t.value;be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`background-repeat: ${t.value} !important;`)}else be(e.elem,t.classNamePrefix)}function ZW(e){const t=e.settings.mobileBackgroundSize;if(t.value){const n=t.classNamePrefix+t.value;be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`background-size: ${t.value} !important;`)}else be(e.elem,t.classNamePrefix)}function da(e){const t=e.settings.mobilePadding;$e(),["top","right","bottom","left"].forEach(n=>{const r=t[n];if(r!=null){Qc({elem:e.elem,position:n});const o=t.classNamePrefix+n+"-"+r;e.elem.classList.add(o),Be(o,`padding-${n}: ${r}px !important;`)}else r===null&&Qc({elem:e.elem,position:n})})}function EC(e){const t=e.settings.mobileFontSize;if(t.value!=null){const n=t.classNamePrefix+t.value+"px";be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`font-size: ${t.value}px !important;`)}else be(e.elem,t.classNamePrefix)}function Ph(e){const t=e.settings.mobileLineHeight;if(t&&t.value!==null){const n=t.classNamePrefix+t.value+"px";be(e.elem,t.classNamePrefix),e.elem.classList.add(n),$e(),Be(n,`line-height: ${t.value}px !important;`)}else t&&be(e.elem,t.classNamePrefix)}function SC(e){const t=e.settings.show,n=()=>{e.elem.style.removeProperty("display"),e.elem.tagName==="IMG"&&(e.elem.style.display="block"),RW(e.elem)};if(t!=="all"){const r="em-show-"+e.elem.tagName?.toLowerCase()+"-"+t;if(e.elem.classList.forEach(o=>{o.indexOf("em-show-")>-1&&e.elem.classList.remove(o)}),e.elem.classList.add(r),$e(),t==="mobile"){e.elem.style.display="none",fC(ur(e.elem,!1))||OW(e.elem);let o="block";e.elem.tagName==="TD"?o="table-cell":e.elem.tagName==="IMG"?o="block":e.elem.tagName==="TABLE"&&(o="table"),Be(r,`display: ${o} !important;`)}t==="desktop"&&(n(),Be(r,"display: none !important;"))}else n(),e.elem.classList.forEach(r=>{r.indexOf("em-show-")>-1&&e.elem.classList.remove(r)})}function QW(e){const t=e.settings.isContrastBlock,n=Rh();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 JW(){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 ze(e,t=!1){const n=JW();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=BW(r.substring(24))),r.indexOf("em-mob-background_position_x")>-1&&(n.mobileBackgroundPositionX.value=bC(r.substring(29))),r.indexOf("em-mob-background_position_y")>-1&&(n.mobileBackgroundPositionY.value=bC(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}var Jse="\u2028",eq=1.4,tq=16,tu=/^em-mob-height-(\d+(?:\.\d+)?)px$/,wC="em-mob-line_height-";function _C(e){const t=[""],n=o=>{o.childNodes.forEach(i=>{if(i.nodeType===Node.TEXT_NODE)t[t.length-1]+=i.nodeValue||"";else if(i.nodeType===Node.ELEMENT_NODE){const s=i;s.tagName==="BR"?s.hasAttribute("data-mce-bogus")||t.push(""):n(s)}})};n(e);const r=t.map(o=>o.replace(/\s+/g," ").trim());return r.length>1&&r[r.length-1]===""&&r.pop(),r}function nq(e){const t=CC(e);return t?.parentNode?.removeChild(t),!!t}function CC(e){const t=rq(e),n=t[t.length-1],r=t[t.length-2];return n?.nodeName==="BR"&&r&&r.nodeName!=="BR"?n:null}function rq(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(o.nodeType===Node.TEXT_NODE)(o.nodeValue??"").trim()&&t.push(o);else if(o.nodeType===Node.ELEMENT_NODE){const i=o;if(i.tagName==="BR"&&i.hasAttribute("data-mce-bogus"))return;i.childNodes.length?n(i):t.push(i)}})};return n(e),t}function fa(e){return _C(e).length>1}function Ih(e){return _C(e).join("\u2028")}function TC(e){const t=e.closest("td");return!!t&&(!!t.getAttribute("height")||!!t.style.height)}function AC(e,t,n=t){xC(e),cq(e);const r=OC(e);if(fa(e)){const o=aq(e,n);e.closest("td")?.setAttribute("valign","middle"),e.style.removeProperty("height"),e.style.lineHeight=o,r&&(r.style.removeProperty("height"),r.style.removeProperty("line-height")),NC(e)}else e.style.height=t,e.style.lineHeight=t,r&&(r.style.height=t,r.style.lineHeight=t)}function oq(e){e.style.removeProperty("height"),e.style.removeProperty("line-height"),xC(e);const t=OC(e);t&&(t.style.removeProperty("height"),t.style.removeProperty("line-height"))}function iq(e){const t=LC(e);return!t||!kC(e)?!1:(AC(e,t),fa(e)||sq(e),!0)}function kC(e){const t=LC(e);return!!t&&fa(e)===(e.style.lineHeight===t)}function LC(e){const t=e.closest("td");return!t||!TC(e)?null:t.style.height||`${t.getAttribute("height")}px`}function sq(e){const t=e.closest("td"),n=t?[...t.classList].find(o=>tu.test(o)):void 0,r=n?Number(tu.exec(n)?.[1]):NaN;r>0&&Ph({settings:{mobileLineHeight:{classNamePrefix:wC,value:r,dim:"px"}},elem:e})}function NC(e){const t=e.closest("td"),n=t?[...t.classList].find(o=>tu.test(o)):void 0;if(!n)return;const r=wC+(tu.exec(n)?.[1]??"")+"px";[e,...e.querySelectorAll(`.${r}`)].forEach(o=>o.classList.remove(r))}function aq(e,t){const n=parseFloat(e.style.lineHeight);return!(e.style.height||e.style.lineHeight===t)&&e.style.lineHeight.endsWith("px")&&n>0?e.style.lineHeight:`${Math.round(lq(e)*eq)}px`}function lq(e){const t=e.closest('[style*="font-size"]'),n=t?parseFloat(t.style.fontSize):NaN;if(n>0&&(t?.style.fontSize.endsWith("px")??!1))return n;const r=parseFloat(getComputedStyle(e).fontSize);return r>0?r:tq}function xC(e){e.querySelectorAll("[style]").forEach(t=>t.style.removeProperty("line-height"))}function cq(e){[e,...e.querySelectorAll("[style]")].forEach(t=>{const n=t.style.paddingLeft,r=t.style.paddingRight;t.style.removeProperty("padding"),t.style.removeProperty("padding-top"),t.style.removeProperty("padding-bottom"),n&&(t.style.paddingLeft=n),r&&(t.style.paddingRight=r)})}function OC(e){return e.closest("editor")||e.querySelector("editor")}var Dh=/v:roundrect/i,Bh=/\[if\s*!\s*mso\]/i,RC=/^\s*(?:<!)?\[endif\]\s*$/i,Hh=["background-color","border-radius","border","border-top","border-right","border-bottom","border-left","border-color","border-style","border-width","box-shadow"],uq=[...Hh,"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 fr(e){return!!e&&e.nodeType===Node.COMMENT_NODE}var dq=/\bhref\s*=\s*(?:"([^"]*)"|'([^']*)')/i,MC=e=>e.replace(/&amp;/gi,"&").trim();function PC(e){let t=e.nextSibling;for(;t&&(fr(t)||t.nodeType===Node.TEXT_NODE&&!t.nodeValue?.trim());)t=t.nextSibling;return t}function Fh(e,t){if(t.contains(e))return!0;if(!PC(e)?.contains(t))return!1;const n=dq.exec(e.nodeValue??""),r=MC(n?.[1]??n?.[2]??""),o=MC(t.getAttribute("href")??"");return!r||!o||r===o}var fq=(e,t)=>{const n=$h(e);if(!fr(n)||!IC.test(n.nodeValue??""))return;const r=PC(n),o=(r===e||e.nodeType===Node.COMMENT_NODE&&r&&e.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING)&&r instanceof Element?r.tagName==="A"?r:r.querySelector("a"):null;if(!o||!Fh(n,o))return;const i=!DC.test(n.nodeValue??""),s=HC(t),a=fr(s)&&DC.test(s.nodeValue??"")&&!IC.test(s.nodeValue??"");return i&&a?{before:n,after:s}:{before:n}},IC=/<v:roundrect\b/i,DC=/<\/v:roundrect>/i;function mq(e){return e.addService(Kc,fq)}function nu(e){const t=[],n=r=>{r.childNodes.forEach(o=>{fr(o)&&Dh.test(o.nodeValue||"")&&t.push(o),n(o)})};return n(e),t}function BC(e,t,n){const r=n?nu(e).find(s=>Fh(s,n)):qr(e);if(!r)return!1;const o=r.nodeValue||"";if(!/<center\b[^>]*>[\s\S]*?<\/center>/i.test(o))return!1;const i=FC(t);return r.nodeValue=o.replace(/(<center\b[^>]*>)[\s\S]*?(<\/center>)/i,(s,a,l)=>`${a}${i}${l}`),!0}function qr(e){for(const t of Array.from(e.childNodes)){if(fr(t)&&Dh.test(t.nodeValue||""))return t;const n=qr(t);if(n)return n}return null}function $h(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function HC(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function qn(e){const t=parseInt(String(e??""),10);return Number.isFinite(t)?t:0}function hq(e,t){const n=Ih(e);if(n.split("\u2028").join(""))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 pq(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function FC(e){return(e||"").split("\u2028").map(t=>pq(t.replace(/\s+/g," ").trim())).join("<br>")}function gq(e,t){const n=e.getAttribute("bgcolor");n&&(t.style.backgroundColor||(t.style.backgroundColor=n),e.removeAttribute("bgcolor"));for(const r of Hh){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 bq(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 Hh){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 yq(e){const t=e.style.display;return t!=="inline-block"&&t!=="block"?!1:!!(e.style.backgroundColor||e.style.borderRadius)}function Wh(e){if(!e)return null;for(const t of Array.from(e.querySelectorAll("[style]")))if(yq(t))return t;return null}function qh(e){return e?!!Wh(e)||!!qr(e):!1}function vq(e,t){for(const n of uq){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 Eq(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function $C(e,t){const n=Wh(t);return n?(vq(n,t),Eq(n),nu(t).forEach(r=>r.parentNode?.removeChild(r)),zh(t),!0):!1}function Sq(e){for(const t of e){const n=t.nodeValue||"";if(!Dh.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?qn(i[1]):0,height:s?qn(s[1]):0,arcsize:a?qn(a[1]):0}}return{width:0,height:0,arcsize:0}}function wq(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 _q=new Set(["bold","bolder","600","700","800","900"]);function Cq(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&&_q.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 Tq(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}">${FC(e.label)}</center></v:roundrect><![endif]`}function zh(e){const t=[],n=r=>{r.childNodes.forEach(o=>{if(fr(o)){const i=o.nodeValue||"";(Bh.test(i)||RC.test(i))&&t.push(o)}n(o)})};n(e),t.forEach(r=>r.parentNode?.removeChild(r))}function Aq(e){const t=e.closest("td");if(!t)return;const n=e.closest("a")||t.querySelector("a");n&&$C(t,n),nu(t).forEach(r=>r.parentNode?.removeChild(r)),zh(t),n&&bq(t,n)}function kq(e){const t=e.ownerDocument;if(!t)return;const n=e.parentNode;if(!n)return;const r=$h(e);fr(r)&&Bh.test(r.nodeValue||"")||n.insertBefore(t.createComment("[if !mso]><!"),e);const o=HC(e);fr(o)&&RC.test(o.nodeValue||"")||n.insertBefore(t.createComment("<![endif]"),e.nextSibling)}function Lq(e,t){return e?.backgroundColor!==void 0?e.backgroundColor===""?"none":e.backgroundColor:t.style.backgroundColor||t.getAttribute("bgcolor")||"none"}function Nq(e,t){if(t?.width?.value&&t.width.dim==="px")return qn(t.width.value);const n=e?.getAttribute("width")||"";return n&&!n.includes("%")?qn(n):0}function xq(e,t){if(t?.height?.value&&t.height.dim==="px")return qn(t.height.value);const n=e.getAttribute("height")||"";return n&&!n.includes("%")?qn(n):qn(e.style.height)}function Oq(e,t){return e?.borderRadius&&e.borderRadius.all!=null?qn(e.borderRadius.all):qn(t.style.borderRadius)}function Rq(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 Uh(e,t){const n=e.closest("td");if(!n)return;const r=e.closest("a")||n.querySelector("a");if(!r)return;const o=nu(n),i=hq(r,o),s=Sq(o);$C(n,r),gq(n,r),o.forEach(C=>C.parentNode?.removeChild(C)),zh(n);const a=Nq(n.closest("table"),t)||s.width,l=xq(n,t)||s.height,c=Oq(t,r),u=Cq(r),d=wq(r),f=Rq(c,a,l)||s.arcsize,h={href:t?.href!==void 0?t.href:r.getAttribute("href")||"",fillcolor:Lq(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||""};kq(r);const m=n.ownerDocument;if(!m)return;const p=$h(r),b=m.createComment(Tq(h));fr(p)&&Bh.test(p.nodeValue||"")&&p.parentNode?p.parentNode.insertBefore(b,p):n.insertBefore(b,n.firstChild)}function jh(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]")&&Fh(i,r)){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 WC="__emOwnEditor";function Mq(e){e[WC]=!0,RE(e)}function qC(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[WC]&&!o.contains(n)&&(o.replaceWith(...Array.from(o.childNodes)),r=!0);return r}var Pq=["deleteContentBackward","deleteContentForward","deleteByCut"],Iq={deleteContentBackward:"backward",deleteContentForward:"forward"};function Dq(e){const{element:t,getVisibleText:n,setCursorToElement:r,hasOnlyTextNodesDeep:o,isRangeCoveringAllVisibleText:i,isEditorContentOnlyNbsp:s,commit:a,pasteFragment:l}=e,c=k=>Rt(k)?sm(k):e.mapFn(k);function u(k){return!n(k,c).trim()&&!k.querySelector(Gh)}const d=k=>n(k,c).trim();function f(k,y){const g=document.createRange();g.selectNodeContents(y);const E=k.cloneRange();return E.compareBoundaryPoints(E.START_TO_START,g)<0&&E.setStart(g.startContainer,g.startOffset),E.compareBoundaryPoints(E.END_TO_END,g)>0&&E.setEnd(g.endContainer,g.endOffset),UC(n(E.cloneContents(),c).trim(),d(y))}function h(k){k.insertAdjacentHTML("beforebegin","&nbsp;"),k.removeAttribute("em-edit"),k.remove()}function m(k,y,g){if(!y.collapsed)return!1;const E=document.createRange();return g?(E.setStart(y.endContainer,y.endOffset),E.setEnd(k,k.childNodes.length)):(E.setStart(k,0),E.setEnd(y.startContainer,y.startOffset)),!n(E.cloneContents(),c).trim()}function p(k,y){const g=JC(k,y);C(k),k.prepend(...g.filter(({before:E})=>E).map(({node:E})=>E)),k.append(...g.filter(({before:E})=>!E).map(({node:E})=>E))}function b(k){return k.inputType.startsWith("delete")?eT(Kh(k),()=>YC(k)):YC(k)}function C(k,y=ou(k,d)){const[g,...E]=y,_=g??k;if(!g&&(qq(k)||Uq(k))){const T=document.createTextNode(" ");k.replaceChildren(T),r(T);return}const S=document.createElement(g&&g.tagName!=="EDITOR"?g.tagName:"div"),v=document.createTextNode(" ");if(g&&_.tagName===S.tagName)for(const{name:T,value:w}of Array.from(_.attributes))S.setAttribute(T,w);T3(S,g?k:Yq(k),_,Zq),S.getAttribute("style")||S.removeAttribute("style"),E.filter(T=>T.tagName!=="TBODY").reduce((T,w)=>T.appendChild(Kq(w)),S).append(v),k.tagName==="A"||k.parentNode&&k.parentNode.tagName==="A"?k.replaceChildren(v):k.replaceChildren(S),r(v)}function L(k,y){if(y.collapsed)return!1;const g=ou(k,d);return eS(y,void 0,y5)?(u(k)&&C(k,g),t.setAttribute("em-edit","active"),a(!0),!0):!1}return function(y){const g=Kh(y),E=window.getSelection();if(!E||E.rangeCount===0)return;if(oD(y.inputType)&&OE(E.getRangeAt(0),g),y.inputType==="insertFromPaste"&&l&&!y.defaultPrevented){l(y);return}const _=Iq[y.inputType];if(_&&p5(E.getRangeAt(0),_)){y.preventDefault();return}if(Pq.includes(y.inputType)&&L(g,E.getRangeAt(0))){y.preventDefault();return}const S=n(g,c).trim(),v=n(E.getRangeAt(0)?.cloneContents(),c).trim(),T=E.getRangeAt(0),w=T.startContainer,N=(w.nodeType===Node.TEXT_NODE?w.parentNode:w).closest("sup, sub");if((y.inputType==="deleteContentBackward"||y.inputType==="deleteByCut")&&!E?.isCollapsed&&v){if(N&&f(T,N)&&h(N),i(T)&&UC(v,S)&&!g.querySelector(ru)){y.preventDefault(),p(g,T),t.setAttribute("em-edit","active"),a(!0);return}t.setAttribute("em-edit","active"),a(!0)}if(y.inputType==="deleteContentBackward"&&E?.isCollapsed&&!v){w.length===1&&(N&&d(N).length===1&&h(N),t.setAttribute("em-edit","active"),a(!0));const P=()=>{b(y)&&a(!0)};if(w.nodeType!==Node.TEXT_NODE&&!i(T))return P();const O=T.startOffset;if(O===0&&!i(T))return P();const z=w.parentNode;if(!z)return P();const he=Array.prototype.indexOf.call(z.childNodes,w);if(z.childNodes[he-1]?.nodeType===Node.COMMENT_NODE){y.preventDefault(),w.deleteData(O-1,1);const oe=document.createRange();oe.setStart(w,O-1),oe.collapse(!0),E.removeAllRanges(),E.addRange(oe),a(!0);return}g&&s(g)&&(y.preventDefault(),y.stopImmediatePropagation())}if(y.inputType==="insertText"&&!E?.isCollapsed){y.preventDefault();const P=y.data||"";T.deleteContents();const O=document.createTextNode(P||" ");T.insertNode(O),T.setStartAfter(O),T.collapse(!0),E.removeAllRanges(),E.addRange(T),vm(O,O,tm),a(!0);return}if(Wq.test(y.inputType)){const P=Jq(y,E.getRangeAt(0));if(!P||(y.preventDefault(),g5(g,P))||(E.removeAllRanges(),E.addRange(P),L(g,P)))return;const O=ou(g,d);eT(Kh(y),()=>{KC("delete"),u(g)&&C(g,O)}),a();return}const x=y.inputType==="deleteContentForward",D=()=>Hq(g)?T.collapsed&&!m(g,T,x)&&Xq(g,d):o(g)&&!(x&&m(g,T,!0));if(y.inputType.includes("deleteContent")&&(Array.from(n(g,c).replace($q,"")).length<2||S===v)&&!g.querySelector(ru)&&D()){y.preventDefault(),p(g,T),a(!0);return}if(y.inputType==="insertText"&&y.data&&zC(E,y.data)){y.preventDefault(),y.stopImmediatePropagation(),a(!0);return}if(y.inputType==="deleteContentBackward"&&!E.isCollapsed&&!v&&g&&s(g)&&(y.preventDefault(),y.stopImmediatePropagation()),b(y)){a(!0);return}a()}}var ru="em-replace, img, picture, video, audio, svg, canvas, iframe, object, hr, input, button",Bq="div, p, ul, ol, table, h1, h2, h3, h4, h5, h6, blockquote, center, pre";function Hq(e){return!e.hasAttribute("em-inline")&&!!e.querySelector("div, p, ul, ol, table, h1, h2, h3, h4, h5, h6, blockquote, center, pre")}var Vh=`${Bq}, td, th`,Fq="br, ul, ol, li, pre",$q=/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,Gh=`${ru}, table`,Wq=/^delete(Word|SoftLine|HardLine)/;function zC(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),vm(i,i,tm),!0}return!1}function UC(e,t){return e.replace(/\s+/g," ")===t.replace(/\s+/g," ")}function qq(e){return[jC(e,"previousSibling"),jC(e,"nextSibling")].some(t=>t?.nodeType===Node.TEXT_NODE?!0:!!t&&ve(t)&&/^(EM-REPLACE|A|IMG|SUB|SUP|SPAN|B|STRONG|I|EM|U|S|FONT)$/.test(t.tagName))}var zq=/^(A|SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SUB|SUP|SMALL|BIG|MARK)$/;function Uq(e){return e.parentElement!==null&&zq.test(e.parentElement.tagName)}function jC(e,t){let n=e[t];for(;n?.nodeType===Node.TEXT_NODE&&!n.textContent?.trim();)n=n[t];return n}var jq=/^(AREA|BASE|BR|COL|EMBED|HR|IMG|INPUT|LINK|META|SOURCE|TRACK|WBR)$/,VC=/^(SPAN|B|STRONG|I|EM|U|S|STRIKE|FONT|SMALL|BIG|MARK)$/,Vq={TABLE:["THEAD","TBODY","TFOOT","TR"],THEAD:["TR"],TBODY:["TR"],TFOOT:["TR"],TR:["TD","TH"]};function ou(e,t){const n=t(e),r=[];for(let o=GC(e,n,t);o;o=Gq(o,n,t))r.push(o);return r}function GC(e,t,n){const r=XC(e,n);if(!(!r||jq.test(r.tagName)||r.tagName!=="TABLE"&&r.matches(Gh)))return!(r.tagName==="A"||VC.test(r.tagName))||n(r)===t?r:void 0}function Gq(e,t,n){const r=Vq[e.tagName];if(r)return Array.from(e.children).find(i=>r.includes(i.tagName));if(e.tagName==="TD"||e.tagName==="TH")return GC(e,t,n);const o=XC(e,n);return o&&VC.test(o.tagName)&&n(o)===t?o:void 0}function XC(e,t){for(const n of Array.from(e.childNodes))if(!(Rt(n)&&!t(n))){if(n.nodeType===Node.ELEMENT_NODE)return n;if(t(n))return}}function Xq(e,t){if(e.querySelector(Fq))return!1;const n=ou(e,t),r=[...n].reverse().find(o=>o.matches(Vh));return r!==void 0&&t(r)===t(e)&&Array.from(e.querySelectorAll("*")).every(o=>n.some(i=>i===o)||r.contains(o)&&!o.matches(Vh))}function Kq(e){const t=e.cloneNode(!1);return t.removeAttribute("em-edit"),t}function Yq(e){const t=e.cloneNode(!1);return t.removeAttribute("innerStyle"),t.removeAttribute("innerClass"),t}var Zq=e=>G(e)??e;function Qq(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 Jq(e,t){const n=lm(t,e.inputType.endsWith("Backward")?"backward":"forward");if(!n)return Qq(e);const r=document.createRange();return r.selectNode(n),r}var ez={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"},tz=["insertText"],Xh=!1;function KC(e,t){Xh=!0;try{lr(e,!1,t)}finally{Xh=!1}}function nz(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 YC(e){const t=ez[e.inputType];if(!t||e.defaultPrevented||e.isComposing||Xh)return!1;const n=e.inputType==="insertReplacementText"?nz(e):e.data??void 0;return tz.includes(t)&&!n?!1:(e.preventDefault(),KC(t,n),!0)}function Kh(e){return e.currentTarget??e.target}var iu={sibling:"nextSibling",child:"firstChild"},ZC={sibling:"previousSibling",child:"lastChild"},QC=/[^ \t\r\n\f]/,rz=`br, ${ru}`;function oz(e){return e.nodeType===Node.ELEMENT_NODE&&getComputedStyle(e).display==="none"}function su(e,t,n){for(let r=e;r&&r!==t;r=r.parentNode){const o=r[n.sibling];if(o)return o}return null}function iz(e,t,n,r){if(e.nodeType===Node.TEXT_NODE){const o=e.data;return QC.test(r===iu?o.slice(t):o.slice(0,t))?null:su(e,n,r)}return e.nodeType!==Node.ELEMENT_NODE?su(e,n,r):e.childNodes[r===iu?t:t-1]??(e===n?null:su(e,n,r))}function sz(e,t,n){const r=[];let o=e;for(;o;){if(o.nodeType===Node.COMMENT_NODE||oz(o))r.push(o);else{if(o.nodeType===Node.TEXT_NODE?QC.test(o.data):o.matches?.(rz))break;if(o[n.child]){o=o[n.child];continue}}o=su(o,t,n)}return r}function JC(e,t){const{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t,s=(c,u,d)=>sz(iz(c,u,e,d),e,d),a=new Map,l=[[s(n,r,ZC),!0],[s(o,i,iu),!1],[s(n,r,iu),!0],[s(o,i,ZC),!1]];for(const[c,u]of l)c.filter(d=>!a.has(d)).forEach(d=>a.set(d,u));return[...a].sort(([c],[u])=>c.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1).map(([c,u])=>({node:c,before:u,previous:c.previousSibling,next:c.nextSibling}))}function az(e,{node:t,previous:n,next:r,before:o}){const i=a=>!!a&&a!==e&&e.contains(a),s=(o?[n,r]:[r,n]).find(i);return s?(s===n?s.after(t):s.before(t),o&&lz(t),!0):!1}function lz(e){const t=window.getSelection(),n=t?.rangeCount?t.getRangeAt(0):void 0,r=e.parentNode;n?.collapsed&&r&&n.startContainer===r&&r.childNodes[n.startOffset]===e&&(n.setStartAfter(e),n.collapse(!0))}function cz(e,t,n){const r=window.getSelection(),o=r?.rangeCount?r.getRangeAt(0):void 0;if(!r||!o||!e.contains(o.startContainer)){e.prepend(...t),e.append(...n);return}const i=o.cloneRange();i.collapse(!0);for(const a of[...t,...n].reverse())i.insertNode(a);const s=document.createRange();t.length?s.setStartAfter(t[t.length-1]):s.setStartBefore(n[0]),s.collapse(!0),r.removeAllRanges(),r.addRange(s)}function uz(e,t){const n=t.filter(({node:o})=>!e.contains(o)),r=new Set;for(const o of[...n.filter(({before:i})=>i),...n.filter(({before:i})=>!i).reverse()])az(e,o)||r.add(o);if(r.size){const o=i=>n.filter(s=>r.has(s)&&s.before===i).map(({node:s})=>s);cz(e,o(!0),o(!1))}}function eT(e,t){const n=window.getSelection(),r=n?.rangeCount?JC(e,n.getRangeAt(0)):[],o=t();return uz(e,r),fz(e),o}var dz=`${Vh}, li`;function tT(e){return!e.textContent?.trim()&&!e.querySelector(`br, ${Gh}`)}function fz(e){const t=window.getSelection(),n=t?.rangeCount?t.getRangeAt(0):void 0,r=n?.startContainer;if(!n||!r||!ve(r)||r===e||!e.contains(r)||!r.matches(dz)||!tT(r)||!tT(n.cloneContents())||r.getBoundingClientRect().height>0)return;const o=document.createElement("br");r.insertBefore(o,r.childNodes[n.startOffset]??null),t?.collapse(r,Array.from(r.childNodes).indexOf(o))}function mz(e){return function(n,r){if(!n)return;n.querySelectorAll("editor")?.forEach(a=>{a.onclick=null,a.onkeyup=null,a.onmousedown=null});const o=hz(n);if(Gc(n),document.querySelectorAll(":not(.em-element-path) .em-element-path").forEach(a=>a.remove()),qC(n),L3(n,r)){n.append(...o);return}xS(n,Le);const i=document.createElement("editor");if(Mq(i),i.classList.add("em-text"),i.setAttribute("contenteditable","true"),r)pz(n)&&i.setAttribute(i5,""),n.before(i),i.replaceChildren(n),ME(i);else{const a=[...n.childNodes];n.appendChild(i),i.replaceChildren(...a)}n.append(...o);const s=i.parentElement;if(s&&!s.style.fontFamily&&!s.style.fontSize&&i.firstElementChild){const a=i.firstElementChild,l=a.getAttribute("style"),c=a.getAttribute("class"),u=a.getAttribute("href"),d=a.getAttribute("target"),f=a.getAttribute("align");l&&i.setAttribute("innerStyle",l),c&&i.setAttribute("innerClass",c),u!==null&&i.setAttribute("innerHref",u),d&&i.setAttribute("innerTarget",d),f&&i.setAttribute("innerAlign",f)}i.addEventListener("input",gt(()=>e.commit(!0)),!0),i.addEventListener("beforeinput",Dq({element:n,getVisibleText:NS,mapFn:C3,setCursorToElement:A3,hasOnlyTextNodesDeep:kS,isRangeCoveringAllVisibleText:S5,isEditorContentOnlyNbsp:E5,commit:e.commit,pasteFragment:a=>{const l=c=>jh({target:c.target},u=>e.commit(u));cc(a,!1,V.get("commonStyles"),l,e.commit)}}))}}function hz(e){const t=[...e.children].filter(n=>Y_.isServicePanel(n)&&!Rt(n));return t.forEach(n=>n.remove()),t}function pz(e){const{display:t,cssFloat:n}=getComputedStyle(e);return t.startsWith("inline")||!!n&&n!=="none"}function gz({commit:e,htmlDocument:t,documentMapping:n}){const r=mz({commit:e});return{now:r,deferred:(i,s)=>{const a=t.getRangeByElement(i,!0);a&&n.hasMappedReplacementRangeInRange(a)||o5(()=>r(i,s),"editor")}}}var nT=e=>t=>t.some(n=>e(n).some(bz)),bz=e=>e instanceof Element&&(e.hasAttribute("em-edit")||e.querySelector("[em-edit]")),yz=nT(({removed:e})=>e),vz=nT(({added:e})=>e),Ez=e=>t=>{yz(t)&&!vz(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){Mr("em-edit"),n.setAttribute("em-edit","active"),e({elem:n});return}e({elem:null})},0)},Sz=200;function wz(e){let t=!1;return()=>{if(t)return;t=!0;let n;const r=()=>{t&&(t=!1,clearTimeout(n),e())};n=setTimeout(r,Sz),window.requestAnimationFrame(()=>setTimeout(r,0))}}var Xe={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 _z(e,t,n){return(t=kz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mr(){return mr=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},mr.apply(null,arguments)}function rT(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 zn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rT(Object(n),!0).forEach(function(r){_z(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cz(e,t){if(e==null)return{};var n,r,o=Tz(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 Tz(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 Az(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 kz(e){var t=Az(e,"string");return typeof t=="symbol"?t:t+""}function Yh(e){"@babel/helpers - typeof";return Yh=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},Yh(e)}var Lz="1.15.7";function hr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var pr=hr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ma=hr(/Edge/i),oT=hr(/firefox/i),ha=hr(/safari/i)&&!hr(/chrome/i)&&!hr(/android/i),Zh=hr(/iP(ad|od|hone)/i),iT=hr(/chrome/i)&&hr(/android/i),sT={capture:!1,passive:!1};function ge(e,t,n){e.addEventListener(t,n,!pr&&sT)}function me(e,t,n){e.removeEventListener(t,n,!pr&&sT)}function au(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 aT(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function kn(e,t,n,r){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&au(e,t):au(e,t))||r&&e===n)return e;if(e===n)break}while(e=aT(e))}return null}var lT=/\s+/g;function Zt(e,t,n){e&&t&&(e.classList?e.classList[n?"add":"remove"](t):e.className=((" "+e.className+" ").replace(lT," ").replace(" "+t+" "," ")+(n?" "+t:"")).replace(lT," "))}function ne(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 Li(e,t){var n="";if(typeof e=="string")n=e;else do{var r=ne(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 cT(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 Un(){var e=document.scrollingElement;return e||document.documentElement}function ot(e,t,n,r,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,s,a,l,c,u,d;if(e!==window&&e.parentNode&&e!==Un()?(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,!pr))do if(o&&o.getBoundingClientRect&&(ne(o,"transform")!=="none"||n&&ne(o,"position")!=="static")){var f=o.getBoundingClientRect();s-=f.top+parseInt(ne(o,"border-top-width")),a-=f.left+parseInt(ne(o,"border-left-width")),l=s+i.height,c=a+i.width;break}while(o=o.parentNode);if(r&&e!==window){var h=Li(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 uT(e,t,n){for(var r=zr(e,!0),o=ot(e)[t];r;){var i=ot(r)[n],s=void 0;if(n==="top"||n==="left"?s=o>=i:s=o<=i,!s)return r;if(r===Un())break;r=zr(r,!1)}return!1}function Ni(e,t,n,r){for(var o=0,i=0,s=e.children;i<s.length;){if(s[i].style.display!=="none"&&s[i]!==K.ghost&&(r||s[i]!==K.dragged)&&kn(s[i],n.draggable,e,!1)){if(o===t)return s[i];o++}i++}return null}function Qh(e,t){for(var n=e.lastElementChild;n&&(n===K.ghost||ne(n,"display")==="none"||t&&!au(n,t));)n=n.previousElementSibling;return n||null}function cn(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==K.clone&&(!t||au(e,t))&&n++;return n}function dT(e){var t=0,n=0,r=Un();if(e)do{var o=Li(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 Nz(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 zr(e,t){if(!e||!e.getBoundingClientRect)return Un();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=ne(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 Un();if(r||t)return n;r=!0}}while(n=n.parentNode);return Un()}function xz(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Jh(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 pa;function fT(e,t){return function(){if(!pa){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),pa=setTimeout(function(){pa=void 0},t)}}}function Oz(){clearTimeout(pa),pa=void 0}function mT(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function hT(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 pT(e,t,n){var r={};return Array.from(e.children).forEach(function(o){var i,s,a,l;if(!(!kn(o,t.draggable,e,!1)||o.animated||o===n)){var c=ot(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 Rz(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(r){if(!(ne(r,"display")==="none"||r===K.ghost)){e.push({target:r,rect:ot(r)});var o=zn({},e[e.length-1].rect);if(r.thisAnimationDuration){var i=Li(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(Nz(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=ot(c),f=c.prevFromRect,h=c.prevToRect,m=a.rect,p=Li(c,!0);p&&(d.top-=p.f,d.left-=p.e),c.toRect=d,c.thisAnimationDuration&&Jh(f,d)&&!Jh(u,d)&&(m.top-d.top)/(m.left-d.left)===(u.top-d.top)/(u.left-d.left)&&(l=Pz(m,f,h,o.options)),Jh(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){ne(r,"transition",""),ne(r,"transform","");var a=Li(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,ne(r,"transform","translate3d("+u+"px,"+d+"px,0)"),this.forRepaintDummy=Mz(r),ne(r,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),ne(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){ne(r,"transition",""),ne(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},s)}}}}function Mz(e){return e.offsetWidth}function Pz(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 xi=[],ep={initializeByDefault:!0},ga={mount:function(t){for(var n in ep)ep.hasOwnProperty(n)&&!(n in t)&&(t[n]=ep[n]);xi.forEach(function(r){if(r.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xi.push(t)},pluginEvent:function(t,n,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var i=t+"Global";xi.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][i]&&n[s.pluginName][i](zn({sortable:n},r)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](zn({sortable:n},r)))})},initializePlugins:function(t,n,r,o){xi.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,mr(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 xi.forEach(function(o){typeof o.eventProperties=="function"&&mr(r,o.eventProperties.call(n[o.pluginName],t))}),r},modifyOption:function(t,n,r){var o;return xi.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],r))}),o}};function Iz(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,b=t.options,C="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!pr&&!ma?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 L=zn(zn({},m),ga.getEventProperties(r,t));for(var k in L)p[k]=L[k];n&&n.dispatchEvent(p),b[C]&&b[C].call(t,p)}}var Dz=["evt"],$t=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,i=Cz(r,Dz);ga.pluginEvent.bind(K)(t,n,zn({dragEl:W,parentEl:Ke,ghostEl:ae,rootEl:We,nextEl:ko,lastDownEl:lu,cloneEl:Ue,cloneHidden:Ur,dragStarted:ya,putSortable:yt,activeSortable:K.active,originalEvent:o,oldIndex:Oi,oldDraggableIndex:ba,newIndex:Qt,newDraggableIndex:jr,hideGhostForTarget:wT,unhideGhostForTarget:_T,cloneNowHidden:function(){Ur=!0},cloneNowShown:function(){Ur=!1},dispatchSortableEvent:function(a){Mt({sortable:n,name:a,originalEvent:o})}},i))};function Mt(e){Iz(zn({putSortable:yt,cloneEl:Ue,targetEl:W,rootEl:We,oldIndex:Oi,oldDraggableIndex:ba,newIndex:Qt,newDraggableIndex:jr},e))}var W,Ke,ae,We,ko,lu,Ue,Ur,Oi,Qt,ba,jr,cu,yt,Ri=!1,uu=!1,du=[],Lo,Ln,tp,np,gT,bT,ya,Mi,va,Ea=!1,fu=!1,mu,Tt,rp=[],op=!1,hu=[],pu=typeof document<"u",gu=Zh,yT=ma||pr?"cssFloat":"float",Bz=pu&&!iT&&!Zh&&"draggable"in document.createElement("div"),vT=(function(){if(pu){if(pr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),ET=function(t,n){var r=ne(t),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),i=Ni(t,0,n),s=Ni(t,1,n),a=i&&ne(i),l=s&&ne(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ot(i).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ot(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[yT]==="none"||s&&r[yT]==="none"&&c+u>o)?"vertical":"horizontal"},Hz=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},Fz=function(t,n){var r;return du.some(function(o){var i=o[Ft].options.emptyInsertThreshold;if(!(!i||Qh(o))){var s=ot(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},ST=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||Yh(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},wT=function(){!vT&&ae&&ne(ae,"display","none")},_T=function(){!vT&&ae&&ne(ae,"display","")};pu&&!iT&&document.addEventListener("click",function(e){if(uu)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),uu=!1,!1},!0);var No=function(t){if(W){t=t.touches?t.touches[0]:t;var n=Fz(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)}}},$z=function(t){W&&W.parentNode[Ft]._isOutsideThisEl(t.target)};function K(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=mr({},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 ET(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:K.supportPointer!==!1&&"PointerEvent"in window&&(!ha||Zh),emptyInsertThreshold:5};ga.initializePlugins(this,e,n);for(var r in n)!(r in t)&&(t[r]=n[r]);ST(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:Bz,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ge(e,"pointerdown",this._onTapStart):(ge(e,"mousedown",this._onTapStart),ge(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ge(e,"dragover",this),ge(e,"dragenter",this)),du.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),mr(this,Rz())}K.prototype={constructor:K,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Mi=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,W):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(Xz(r),!W&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&ha&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=kn(l,o.draggable,r,!1),!(l&&l.animated)&&lu!==l)){if(Oi=cn(l),ba=cn(l,o.draggable),typeof u=="function"){if(u.call(this,t,l,this)){Mt({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=kn(c,d.trim(),r,!1),d)return Mt({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&&!kn(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&&!W&&r.parentNode===i){var c=ot(r);if(We=i,W=r,Ke=W.parentNode,ko=W.nextSibling,lu=r,cu=s.group,K.dragged=W,Lo={target:W,clientX:(n||t).clientX,clientY:(n||t).clientY},gT=Lo.clientX-c.left,bT=Lo.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,W.style["will-change"]="all",l=function(){if($t("delayEnded",o,{evt:t}),K.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!oT&&o.nativeDraggable&&(W.draggable=!0),o._triggerDragStart(t,n),Mt({sortable:o,name:"choose",originalEvent:t}),Zt(W,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){cT(W,u.trim(),ip)}),ge(a,"dragover",No),ge(a,"mousemove",No),ge(a,"touchmove",No),s.supportPointer?(ge(a,"pointerup",o._onDrop),!this.nativeDraggable&&ge(a,"pointercancel",o._onDrop)):(ge(a,"mouseup",o._onDrop),ge(a,"touchend",o._onDrop),ge(a,"touchcancel",o._onDrop)),oT&&this.nativeDraggable&&(this.options.touchStartThreshold=4,W.draggable=!0),$t("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ma||pr))){if(K.eventCanceled){this._onDrop();return}s.supportPointer?(ge(a,"pointerup",o._disableDelayedDrag),ge(a,"pointercancel",o._disableDelayedDrag)):(ge(a,"mouseup",o._disableDelayedDrag),ge(a,"touchend",o._disableDelayedDrag),ge(a,"touchcancel",o._disableDelayedDrag)),ge(a,"mousemove",o._delayedDragTouchMoveHandler),ge(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&ge(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(){W&&ip(W),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._disableDelayedDrag),me(t,"touchend",this._disableDelayedDrag),me(t,"touchcancel",this._disableDelayedDrag),me(t,"pointerup",this._disableDelayedDrag),me(t,"pointercancel",this._disableDelayedDrag),me(t,"mousemove",this._delayedDragTouchMoveHandler),me(t,"touchmove",this._delayedDragTouchMoveHandler),me(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?ge(document,"pointermove",this._onTouchMove):n?ge(document,"touchmove",this._onTouchMove):ge(document,"mousemove",this._onTouchMove):(ge(W,"dragend",this),ge(We,"dragstart",this._onDragStart));try{document.selection?yu(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ri=!1,We&&W){$t("dragStarted",this,{evt:n}),this.nativeDraggable&&ge(document,"dragover",$z);var r=this.options;!t&&Zt(W,r.dragClass,!1),Zt(W,r.ghostClass,!0),K.active=this,t&&this._appendGhost(),Mt({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Ln){this._lastX=Ln.clientX,this._lastY=Ln.clientY,wT();for(var t=document.elementFromPoint(Ln.clientX,Ln.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ln.clientX,Ln.clientY),t!==n);)n=t;if(W.parentNode[Ft]._isOutsideThisEl(t),n)do{if(n[Ft]){var r=void 0;if(r=n[Ft]._onDragOver({clientX:Ln.clientX,clientY:Ln.clientY,target:t,rootEl:n}),r&&!this.options.dragoverBubble)break}t=n}while(n=aT(n));_T()}},_onTouchMove:function(t){if(Lo){var n=this.options,r=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,s=ae&&Li(ae,!0),a=ae&&s&&s.a,l=ae&&s&&s.d,c=gu&&Tt&&dT(Tt),u=(i.clientX-Lo.clientX+o.x)/(a||1)+(c?c[0]-rp[0]:0)/(a||1),d=(i.clientY-Lo.clientY+o.y)/(l||1)+(c?c[1]-rp[1]:0)/(l||1);if(!K.active&&!Ri){if(r&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<r)return;this._onDragStart(t,!0)}if(ae){s?(s.e+=u-(tp||0),s.f+=d-(np||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,")");ne(ae,"webkitTransform",f),ne(ae,"mozTransform",f),ne(ae,"msTransform",f),ne(ae,"transform",f),tp=u,np=d,Ln=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ae){var t=this.options.fallbackOnBody?document.body:We,n=ot(W,!0,gu,!0,t),r=this.options;if(gu){for(Tt=t;ne(Tt,"position")==="static"&&ne(Tt,"transform")==="none"&&Tt!==document;)Tt=Tt.parentNode;Tt!==document.body&&Tt!==document.documentElement?(Tt===document&&(Tt=Un()),n.top+=Tt.scrollTop,n.left+=Tt.scrollLeft):Tt=Un(),rp=dT(Tt)}ae=W.cloneNode(!0),Zt(ae,r.ghostClass,!1),Zt(ae,r.fallbackClass,!0),Zt(ae,r.dragClass,!0),ne(ae,"transition",""),ne(ae,"transform",""),ne(ae,"box-sizing","border-box"),ne(ae,"margin",0),ne(ae,"top",n.top),ne(ae,"left",n.left),ne(ae,"width",n.width),ne(ae,"height",n.height),ne(ae,"opacity","0.8"),ne(ae,"position",gu?"absolute":"fixed"),ne(ae,"zIndex","100000"),ne(ae,"pointerEvents","none"),K.ghost=ae,t.appendChild(ae),ne(ae,"transform-origin",gT/parseInt(ae.style.width)*100+"% "+bT/parseInt(ae.style.height)*100+"%")}},_onDragStart:function(t,n){var r=this,o=t.dataTransfer,i=r.options;if($t("dragStart",this,{evt:t}),K.eventCanceled){this._onDrop();return}$t("setupClone",this),K.eventCanceled||(Ue=hT(W),Ue.removeAttribute("id"),Ue.draggable=!1,Ue.style["will-change"]="",this._hideClone(),Zt(Ue,this.options.chosenClass,!1),K.clone=Ue),r.cloneId=yu(function(){$t("clone",r),!K.eventCanceled&&(r.options.removeCloneOnHide||We.insertBefore(Ue,W),r._hideClone(),Mt({sortable:r,name:"clone"}))}),!n&&Zt(W,i.dragClass,!0),n?(uu=!0,r._loopId=setInterval(r._emulateDragOver,50)):(me(document,"mouseup",r._onDrop),me(document,"touchend",r._onDrop),me(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(r,o,W)),ge(document,"drop",r),ne(W,"transform","translateZ(0)")),Ri=!0,r._dragStartId=yu(r._dragStarted.bind(r,n,t)),ge(document,"selectstart",r),ya=!0,window.getSelection().removeAllRanges(),ha&&ne(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=K.active,u=cu===l,d=a.sort,f=yt||c,h,m=this,p=!1;if(op)return;function b(he,oe){$t(he,m,zn({evt:t,isOwner:u,axis:h?"vertical":"horizontal",revert:s,dragRect:o,targetRect:i,canSort:d,fromSortable:f,target:r,completed:L,onMove:function(J,U){return bu(We,n,W,o,J,ot(J),t,U)},changed:k},oe))}function C(){b("dragOverAnimationCapture"),m.captureAnimationState(),m!==f&&f.captureAnimationState()}function L(he){return b("dragOverCompleted",{insertion:he}),he&&(u?c._hideClone():c._showClone(m),m!==f&&(Zt(W,yt?yt.options.ghostClass:c.options.ghostClass,!1),Zt(W,a.ghostClass,!0)),yt!==m&&m!==K.active?yt=m:m===K.active&&yt&&(yt=null),f===m&&(m._ignoreWhileAnimating=r),m.animateAll(function(){b("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(r===W&&!W.animated||r===n&&!r.animated)&&(Mi=null),!a.dragoverBubble&&!t.rootEl&&r!==document&&(W.parentNode[Ft]._isOutsideThisEl(t.target),!he&&No(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),p=!0}function k(){Qt=cn(W),jr=cn(W,a.draggable),Mt({sortable:m,name:"change",toEl:n,newIndex:Qt,newDraggableIndex:jr,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),r=kn(r,a.draggable,n,!0),b("dragOver"),K.eventCanceled)return p;if(W.contains(t.target)||r.animated&&r.animatingX&&r.animatingY||m._ignoreWhileAnimating===r)return L(!1);if(uu=!1,c&&!a.disabled&&(u?d||(s=Ke!==We):yt===this||(this.lastPutMode=cu.checkPull(this,c,W,t))&&l.checkPut(this,c,W,t))){if(h=this._getDirection(t,r)==="vertical",o=ot(W),b("dragOverValid"),K.eventCanceled)return p;if(s)return Ke=We,C(),this._hideClone(),b("revert"),K.eventCanceled||(ko?We.insertBefore(W,ko):We.appendChild(W)),L(!0);var y=Qh(n,a.draggable);if(!y||Uz(t,h,this)&&!y.animated){if(y===W)return L(!1);if(y&&n===t.target&&(r=y),r&&(i=ot(r)),bu(We,n,W,o,r,i,t,!!r)!==!1)return C(),y&&y.nextSibling?n.insertBefore(W,y.nextSibling):n.appendChild(W),Ke=n,k(),L(!0)}else if(y&&zz(t,h,this)){var g=Ni(n,0,a,!0);if(g===W)return L(!1);if(r=g,i=ot(r),bu(We,n,W,o,r,i,t,!1)!==!1)return C(),n.insertBefore(W,g),Ke=n,k(),L(!0)}else if(r.parentNode===n){i=ot(r);var E=0,_,S=W.parentNode!==n,v=!Hz(W.animated&&W.toRect||o,r.animated&&r.toRect||i,h),T=h?"top":"left",w=uT(r,"top","top")||uT(W,"top","top"),N=w?w.scrollTop:void 0;Mi!==r&&(_=i[T],Ea=!1,fu=!v&&a.invertSwap||S),E=jz(t,r,i,h,v?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,fu,Mi===r);var x;if(E!==0){var D=cn(W);do D-=E,x=Ke.children[D];while(x&&(ne(x,"display")==="none"||x===ae))}if(E===0||x===r)return L(!1);Mi=r,va=E;var P=r.nextElementSibling,O=!1;O=E===1;var z=bu(We,n,W,o,r,i,t,O);if(z!==!1)return(z===1||z===-1)&&(O=z===1),op=!0,setTimeout(qz,30),C(),O&&!P?n.appendChild(W):r.parentNode.insertBefore(W,O?P:r),w&&mT(w,0,N-w.scrollTop),Ke=W.parentNode,_!==void 0&&!fu&&(mu=Math.abs(_-ot(r)[T])),k(),L(!0)}if(n.contains(W))return L(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){me(document,"mousemove",this._onTouchMove),me(document,"touchmove",this._onTouchMove),me(document,"pointermove",this._onTouchMove),me(document,"dragover",No),me(document,"mousemove",No),me(document,"touchmove",No)},_offUpEvents:function(){var t=this.el.ownerDocument;me(t,"mouseup",this._onDrop),me(t,"touchend",this._onDrop),me(t,"pointerup",this._onDrop),me(t,"pointercancel",this._onDrop),me(t,"touchcancel",this._onDrop),me(document,"selectstart",this)},_onDrop:function(t){var n=this.el,r=this.options;if(Qt=cn(W),jr=cn(W,r.draggable),$t("drop",this,{evt:t}),Ke=W&&W.parentNode,Qt=cn(W),jr=cn(W,r.draggable),K.eventCanceled){this._nulling();return}Ri=!1,fu=!1,Ea=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),sp(this.cloneId),sp(this._dragStartId),this.nativeDraggable&&(me(document,"drop",this),me(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ha&&ne(document.body,"user-select",""),ne(W,"transform",""),t&&(ya&&(t.cancelable&&t.preventDefault(),!r.dropBubble&&t.stopPropagation()),ae&&ae.parentNode&&ae.parentNode.removeChild(ae),(We===Ke||yt&&yt.lastPutMode!=="clone")&&Ue&&Ue.parentNode&&Ue.parentNode.removeChild(Ue),W&&(this.nativeDraggable&&me(W,"dragend",this),ip(W),W.style["will-change"]="",ya&&!Ri&&Zt(W,yt?yt.options.ghostClass:this.options.ghostClass,!1),Zt(W,this.options.chosenClass,!1),Mt({sortable:this,name:"unchoose",toEl:Ke,newIndex:null,newDraggableIndex:null,originalEvent:t}),We!==Ke?(Qt>=0&&(Mt({rootEl:Ke,name:"add",toEl:Ke,fromEl:We,originalEvent:t}),Mt({sortable:this,name:"remove",toEl:Ke,originalEvent:t}),Mt({rootEl:Ke,name:"sort",toEl:Ke,fromEl:We,originalEvent:t}),Mt({sortable:this,name:"sort",toEl:Ke,originalEvent:t})),yt&&yt.save()):Qt!==Oi&&Qt>=0&&(Mt({sortable:this,name:"update",toEl:Ke,originalEvent:t}),Mt({sortable:this,name:"sort",toEl:Ke,originalEvent:t})),K.active&&((Qt==null||Qt===-1)&&(Qt=Oi,jr=ba),Mt({sortable:this,name:"end",toEl:Ke,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){$t("nulling",this),We=W=Ke=ae=ko=Ue=lu=Ur=Lo=Ln=ya=Qt=jr=Oi=ba=Mi=va=yt=cu=K.dragged=K.ghost=K.clone=K.active=null;var t=this.el;hu.forEach(function(n){t.contains(n)&&(n.checked=!0)}),hu.length=tp=np=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":W&&(this._onDragOver(t),Wz(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],kn(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||Gz(n));return t},sort:function(t,n){var r={},o=this.el;this.toArray().forEach(function(i,s){var a=o.children[s];kn(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 kn(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=ga.modifyOption(this,t,n);typeof o<"u"?r[t]=o:r[t]=n,t==="group"&&ST(r)},destroy:function(){$t("destroy",this);var t=this.el;t[Ft]=null,me(t,"mousedown",this._onTapStart),me(t,"touchstart",this._onTapStart),me(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(me(t,"dragover",this),me(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),du.splice(du.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ur){if($t("hideClone",this),K.eventCanceled)return;ne(Ue,"display","none"),this.options.removeCloneOnHide&&Ue.parentNode&&Ue.parentNode.removeChild(Ue),Ur=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ur){if($t("showClone",this),K.eventCanceled)return;W.parentNode==We&&!this.options.group.revertClone?We.insertBefore(Ue,W):ko?We.insertBefore(Ue,ko):We.appendChild(Ue),this.options.group.revertClone&&this.animate(W,Ue),ne(Ue,"display",""),Ur=!1}}};function Wz(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function bu(e,t,n,r,o,i,s,a){var l,c=e[Ft],u=c.options.onMove,d;return window.CustomEvent&&!pr&&!ma?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||ot(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),u&&(d=u.call(c,l,s)),d}function ip(e){e.draggable=!1}function qz(){op=!1}function zz(e,t,n){var r=ot(Ni(n.el,0,n.options,!0)),o=pT(n.el,n.options,ae),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 Uz(e,t,n){var r=ot(Qh(n.el,n.options.draggable)),o=pT(n.el,n.options,ae),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 jz(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&&mu<c*o){if(!Ea&&(va===1?l>u+c*i/2:l<d-c*i/2)&&(Ea=!0),Ea)f=!0;else if(va===1?l<u+mu:l>d-mu)return-va}else if(l>u+c*(1-o)/2&&l<d-c*(1-o)/2)return Vz(t)}return f=f||s,f&&(l<u+c*i/2||l>d-c*i/2)?l>u+c/2?1:-1:0}function Vz(e){return cn(W)<cn(e)?1:-1}function Gz(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 Xz(e){hu.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&hu.push(r)}}function yu(e){return setTimeout(e,0)}function sp(e){return clearTimeout(e)}pu&&ge(document,"touchmove",function(e){(K.active||Ri)&&e.cancelable&&e.preventDefault()}),K.utils={on:ge,off:me,css:ne,find:cT,is:function(t,n){return!!kn(t,n,t,!1)},extend:xz,throttle:fT,closest:kn,toggleClass:Zt,clone:hT,index:cn,nextTick:yu,cancelNextTick:sp,detectDirection:ET,getChild:Ni,expando:Ft},K.get=function(e){return e[Ft]},K.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&&(K.utils=zn(zn({},K.utils),r.utils)),ga.mount(r)})},K.create=function(e,t){return new K(e,t)},K.version=Lz;var it=[],Sa,ap,lp=!1,cp,up,vu,wa;function Kz(){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?ge(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ge(document,"pointermove",this._handleFallbackAutoScroll):r.touches?ge(document,"touchmove",this._handleFallbackAutoScroll):ge(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var r=n.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?me(document,"dragover",this._handleAutoScroll):(me(document,"pointermove",this._handleFallbackAutoScroll),me(document,"touchmove",this._handleFallbackAutoScroll),me(document,"mousemove",this._handleFallbackAutoScroll)),CT(),Eu(),Oz()},nulling:function(){vu=ap=Sa=lp=wa=cp=up=null,it.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(vu=n,r||this.options.forceAutoScrollFallback||ma||pr||ha){dp(n,this.options,a,r);var l=zr(a,!0);lp&&(!wa||i!==cp||s!==up)&&(wa&&CT(),wa=setInterval(function(){var c=zr(document.elementFromPoint(i,s),!0);c!==l&&(l=c,Eu()),dp(n,o.options,c,r)},10),cp=i,up=s)}else{if(!this.options.bubbleScroll||zr(a,!0)===Un()){Eu();return}dp(n,this.options,zr(a,!1),!1)}}},mr(e,{pluginName:"scroll",initializeByDefault:!0})}function Eu(){it.forEach(function(e){clearInterval(e.pid)}),it=[]}function CT(){clearInterval(wa)}var dp=fT(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=Un(),c=!1,u;ap!==n&&(ap=n,Eu(),Sa=t.scroll,u=t.scrollFn,Sa===!0&&(Sa=zr(n,!0)));var d=0,f=Sa;do{var h=f,m=ot(h),p=m.top,b=m.bottom,C=m.left,L=m.right,k=m.width,y=m.height,g=void 0,E=void 0,_=h.scrollWidth,S=h.scrollHeight,v=ne(h),T=h.scrollLeft,w=h.scrollTop;h===l?(g=k<_&&(v.overflowX==="auto"||v.overflowX==="scroll"||v.overflowX==="visible"),E=y<S&&(v.overflowY==="auto"||v.overflowY==="scroll"||v.overflowY==="visible")):(g=k<_&&(v.overflowX==="auto"||v.overflowX==="scroll"),E=y<S&&(v.overflowY==="auto"||v.overflowY==="scroll"));var N=g&&(Math.abs(L-o)<=s&&T+k<_)-(Math.abs(C-o)<=s&&!!T),x=E&&(Math.abs(b-i)<=s&&w+y<S)-(Math.abs(p-i)<=s&&!!w);if(!it[d])for(var D=0;D<=d;D++)it[D]||(it[D]={});(it[d].vx!=N||it[d].vy!=x||it[d].el!==h)&&(it[d].el=h,it[d].vx=N,it[d].vy=x,clearInterval(it[d].pid),(N!=0||x!=0)&&(c=!0,it[d].pid=setInterval(function(){r&&this.layer===0&&K.active._onTouchMove(vu);var P=it[this.layer].vy?it[this.layer].vy*a:0,O=it[this.layer].vx?it[this.layer].vx*a:0;typeof u=="function"&&u.call(K.dragged.parentNode[Ft],O,P,e,vu,it[this.layer].el)!=="continue"||mT(it[this.layer].el,O,P)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==l&&(f=zr(f,!1)));lp=c}},30),TT=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 fp(){}fp.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=Ni(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:TT},mr(fp,{pluginName:"revertOnSpill"});function mp(){}mp.prototype={onSpill:function(t){var n=t.dragEl,r=t.putSortable||this.sortable;r.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),r.animateAll()},drop:TT},mr(mp,{pluginName:"removeOnSpill"}),K.mount(new Kz),K.mount(mp,fp);var AT=100,kT=Symbol("EMULATED_DRAG_EVENT");function Yz(e,t){return e[kT]===t}var LT=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[kT]=this,Ot(()=>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)},AT),!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)},AT)))}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 Su(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 _a(e){const t=getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}function hp(e){const t=document.createElement("div");t.replaceChildren(...Le(e.atomHTML));const n=t.querySelector("img");if(!n)return xt(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=_a(e.targetAtom):r=e.targetAtom.parentNode?_a(e.targetAtom.parentNode):_a(e.targetAtom),n.setAttribute("width",String(r)),document.querySelector(".noresp-em-narrow-table")?Su(t):n.style.maxWidth=r+"px",xt(t)}function NT(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=_a(n);o.style.display=a;const c=s>=_a(t)?l:Math.min(s,l);return!c||c===s?!1:(o.setAttribute("width",String(c)),document.querySelector(".noresp-em-narrow-table")?Su(e):o.style.maxWidth=c+"px",!0)}function xT(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")?Su(n):(r.style.maxWidth=i+"px",r.style.width="100%"),tr(e.targetElem,e.targetPlace,`
56
+ `+xt(n)+`
57
+ `),t()},o.src=r.getAttribute("src")||"",!1}function pp(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 xt(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)),xt(t)}function wu(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(" ")}),Su(t),xt(t)}function Zz(e){e&&(e.removeAttribute("em-edit"),e.querySelectorAll("[em-edit]").forEach(t=>t.removeAttribute("em-edit")))}var Qz=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=K.create(e,t);return this._items.set(e,n),n}entries(){return[...this._items]}},Vr=new Qz,Jz=Number.MAX_VALUE,eU=0;function OT(e){return typeof e=="object"?e.name:e}var tU=class{constructor(){A(this,"emulator",new LT),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)}),A(this,"releaseLostPress",e=>{const t=K.dragged;if(e.buttons!==0||!t)return;const n=K.active??(t.parentElement?K.get(t.parentElement):void 0),r=new window.MouseEvent("mouseup",{clientX:e.clientX,clientY:e.clientY});n?._onDrop(r)})}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)),window.addEventListener("PointerEvent"in window?"pointermove":"mousemove",this.releaseLostPress,!0))}},un=new tU,RT=K.prototype,nU=gt(RT._onDragOver);function rU(e,t){Vr.gc(),un.track(),RT._onDragOver=nU;const n=document.querySelectorAll("[em=group]");K.prototype._emulateDragOver=function(){};let r;const o=()=>{e.commit(!0)};function i(l,c){let u;function d(b,C){let L=null,k=Number.MAX_VALUE;const y=OT(K.active?.options.group);for(const[g,E]of Vr.entries())if(OT(E.options.group)===y&&(!l||u&&l(g,u)!==!1)){for(const _ of g.children)if(!_.classList.contains("sortable-drag")){const S=_.getBoundingClientRect(),v=b<S.left?S.left-b:b>S.right?b-S.right:0,T=C<S.top?S.top-C:C>S.bottom?C-S.bottom:0;if(v<Jz||T<eU){const w=Math.sqrt(v*v+T*T);w<k?(L=[E,_],k=w):w===k&&L[1].contains(_)&&(L=[E,_])}}}return L}function f(b){const C="TouchEvent"in window&&b instanceof TouchEvent?b.touches[0]:b,L=d(C.clientX,C.clientY);if(L){const[g,E]=L,_=E.getBoundingClientRect();var k={clientX:_.left+_.width/2,clientY:C.clientY};for(var y in b)b.hasOwnProperty(y)&&(k[y]=b[y]);k.target=E,k.rootEl=E.parentNode,k.preventDefault=void 0,k.stopPropagation=void 0,g._onDragOver(k)}}let h;return{onStart:b=>{u=b.item,h=t?.capture(b.item),K.ghost&&Jf(K.ghost),Zz(K.ghost),e.beginTextUpdate(),window.addEventListener("mousemove",f),window.addEventListener("touchmove",f),un.emulator.start(un.x,un.y)?(window.addEventListener("mousemove",un.handleMouseMove),r&&(r.dispose(),r=void 0)):b.preventDefault()},onEnd:b=>{window.removeEventListener("mousemove",f),window.removeEventListener("touchmove",f),h&&(t?.settle(b.item,h),h=void 0);let C=!1;b.from===b.to?un.emulator.end(un.x,un.y):(C=!!c?.(b),un.emulator.drop(un.x,un.y)),window.removeEventListener("mousemove",un.handleMouseMove),e.endTextUpdate(),b.from===b.to&&b.oldIndex!==b.newIndex&&e.commit(!0),C&&e.commit(!0),r&&(r.dispose(),r=void 0),u=void 0}}}if(n.length)for(const l of n){const c=l.parentElement;c&&!Vr.get(c)&&Vr.create(c,{forceFallback:!0,group:"groups-sorting",handle:`.of-group .${Xe.drag}`,...i(),onMove:o})}const s=[...document.querySelectorAll("[em=block]")],a=[...document.querySelectorAll("[em=atom]")].map(l=>l.parentElement);for(const l of s){const c=l.querySelectorAll("td");for(const u of c)!u.innerHTML&&!u.hasAttribute("height")&&[...u.parentElement?.children||[]].indexOf(u)%2===0&&a.push(u)}if(a.length){const l=new Set;for(const c of a)c&&!l.has(c)&&(l.add(c),Vr.get(c)||Vr.create(c,{forceFallback:!0,group:"atoms-sorting",handle:`.of-atom .${Xe.drag}`,...i((u,d)=>{if(d.tagName==="TR"){if(u.tagName!=="TABLE"&&u.tagName!=="TBODY")return!1}else if(d.tagName==="TD"){if(u.tagName!=="TR")return!1}else if(d.tagName==="TABLE"){const f=e.getContext(u);if(f&&wn(f)&&f.tagName==="AMP-ACCORDION"&&u.tagName==="DIV"&&[...f.querySelectorAll("section > div")].indexOf(u)>=0||e.isInExternal(u)&&u.tagName==="DIV")return!0;if(u.tagName!=="TD")return!1}},u=>NT(u.item,u.from,u.to)),onMove:o,onSort:function(){c.innerHTML.trim()===""&&(c.innerHTML="")}}))}if(s.length){const l=new Set;for(const c of s){const u=c.parentElement;u&&!l.has(u)&&(l.add(u),Vr.get(u)||Vr.create(u,{forceFallback:!0,group:"blocks-sorting",handle:`.of-block .${Xe.drag}`,...i(),onMove:o}))}}}var oU=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)}},gp={get textDocument(){return R(It,ys)},commit:po};function iU(){const e=V.get("applicationTheme")||"light";let t=!1;try{gp.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?7594857d";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?7594857d`;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{gp.textDocument.endUpdate()}t&&gp.commit(!1)}var _u=".em-prevent-action";function sU(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 aU(e){const t=document.body;if(!t)return;const n=e.isAppLocked()||e.isIntegratorLocked();(e.isAppLocked()!==t.classList.contains("mceNonEditable")||e.isIntegratorLocked())&&Fe(t,!!n,"mceNonEditable"),Fe(t,!!V.get("previewPage"),"em-sandbox-preview")}function lU(e){const{htmlDocument:t,commit:n,focusController:r}=e,o=wz(()=>rU(t,e.companions));t.onChange(a=>{a.some(l=>l.added.length||l.characterDataChanged||l.reordered?.length||l.reparented?.length)&&o()}),t.onChange(()=>{iU()}),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 oU;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(Ez(e.applicationElementSettingsSet)),t.onChange(()=>{e.selectionLock.isLocked()||(sU(e),aU(e.editLock))})}function cU(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"),Ot(()=>document.querySelectorAll("editor").forEach(i=>i.blur())),t.forget()}finally{o.releaseLater()}}function uU(e,t){const n=gt(r=>cU(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 dU={name:"sandbox.fingerprint",provides:[Vo],awaits:{services:[Y,Ne]},setup(e){const t=R(e,Y),n=R(e,Ne),r=e5(o=>t.getOuterHtml(o));t5(r,n),uU(r,n),e.inject(Vo,r)}},fU={name:"sandbox.setCursor",provides:[wt],awaits:{services:[Y,yn,at]},setup(e){const t={HTMLDocument:R(e,Y),documentMapping:R(e,yn),remoteDocument:R(e,at),messageService:j};e.inject(wt,n=>r5(n,t))}},mU={name:"sandbox.wrapEditor",provides:[vn],awaits:{services:[Y,yn,Se]},setup:e=>e.inject(vn,gz({commit:ht(e),htmlDocument:R(e,Y),documentMapping:R(e,yn)}))};function hU(e){const{container:t}=e;ia.registerAll({MessageService:()=>j,FocusState:()=>e.focusController,SyncService:()=>t.getInstance(Y),SyncServiceInternals:()=>t.getInstance(at),TextDocument:()=>t.getInstance(ys),Mapping:()=>t.getInstance(yn),EditorSurface:()=>({surface:e.surface})}),e.features&&e.features.length>0&&ia.initFeatures(e.features)}var pU=e=>e,gU=e=>`table:empty::before {
58
+ /*content: 'Paste block here';*/
59
+ }
60
+
61
+ table:is(:empty, :has(> tbody:only-child:empty))::after {
62
+ content: '${e.DROP_BLOCK_HINT}' !important;
63
+ }
64
+
65
+ [em="block"].empty-structure td:not([height]):not([width]):empty::before {
66
+ /*content: 'Paste atom here';*/
67
+ }
68
+
69
+ .em-block-insert:after {
70
+ content: '${e.PASTE_HERE}' !important;
71
+ }
72
+
73
+ .em-atom-insert:after,
74
+ .em-blockatom-insert:after {
75
+ content: '${e.PASTE_HERE}' !important;
76
+ }`,bU=class extends ye{constructor(e){super(),A(this,"htmlDocument",void 0),A(this,"_localized",{...rO(pU)}),A(this,"_styles",""),A(this,"_onChangeLocaleEmitter",new pe),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=gU(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 yU(e){const t=new bU(e),n=r=>{t.setTranslations(r)};return t.addDisposable(j.addListener(ue.SANDBOX_TRANSLATIONS,n)),t}function vU(e,t,n){const r=new ye;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 EU(e){const t=new ye,n=r=>{Yz(r,e)||j.send(ue.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 SU(){const e=new LT,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 ye;return n.addDisposable(j.addListener(ue.SANDBOX_DRAG_EVENT,t)),n.addDisposable(EU(e)),n}function wU(){return NodeFilter.FILTER_ACCEPT}function _U(e){if(e instanceof Comment)return[e];const t=[];if(e){const n=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,wU);let r;for(;r=n.nextNode();)t.push(r)}return t}var CU=new cE,TU=new Set;function MT(e){return e?CU.getUnescapedText(e,!0,TU)!==e:!1}function PT(e){return e.nodeValue?MT(e.nodeValue):!1}function AU(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&&PT(t))return t}function IT(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 kU(){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(IT(r,i)===0&&IT(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 LU=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"]');Ot(()=>{n.addRange(r),o?.focus()})},DT=e=>{const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let n=null,r;for(;r=t.nextNode();)n=r;return n},NU=(e,t)=>{const n=e.startContainer,r=e.startOffset,o=DT(t);if(!o)return!1;const i=o.textContent?.length??0;return n===o&&r===i},xU=(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 OU(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 BT(e){const t=e.startContainer;return Rt(t)?t:Rt(t.parentNode)?t.parentNode:null}function RU(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 MU(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode()}function PU({em:e,side:t}){const n=t==="after"?DT(e):MU(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&&Ds(o,r)}function IU(e){const t=L=>e.renderOnly(L);let n=null,r=null,o=!1;const i=L=>!!n&&n.em===L.em&&n.side===L.side&&r===(L.side==="after"?"ArrowLeft":"ArrowRight"),s=L=>{f5(document,t,L)&&e.commit(!1),m5(document,t,L)},a=()=>{const L=window.getSelection();if(o||!L?.rangeCount)return;const k=L.getRangeAt(0),y=e.ownership?OU(k,e.ownership,r):null;if(y){n=null;const _=cm(y.node,y.side,t);s(_);return}const g=UE(k);if(g&&i(g)){n=null,PU(g),s();return}if(g){const _=oc(g.em,g.side,t);n=g,s(_);return}const E=k.collapsed?BT(k):null;n=E?RU(E):null,s(E)},l=()=>{const L=window.getSelection(),k=L?.rangeCount?BT(L.getRangeAt(0)):null;return!!k&&e.applyOwn(()=>h5(k,t))!==null},c=L=>{!L.isComposing&&l()&&e.commit(!0)},u=()=>{o=!0},d=()=>{o=!1,l(),e.commit(!0)},f=L=>{r=L.key},h=L=>{const k=window.getSelection();k?.rangeCount&&L?.closest?.('[contenteditable="true"]')&&eS(k.getRangeAt(0),t)},m=L=>{L.key?.length===1&&!L.ctrlKey&&!L.metaKey&&!L.altKey&&h(L.target)},p=L=>{L.inputType==="insertCompositionText"&&h(L.target)},b=()=>{r=null},C=L=>a5(L,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",b,!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",b,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("beforeinput",p,!0)}}}var HT=":scope > td, :scope > tr > td, :scope > tbody > tr > td";function Pi(e){return e.querySelector(HT)}function Ta(e){return Array.from(e.querySelectorAll(HT))}function bp(e){const t=e.closest('[em="block"]');return t?Pi(t)??t.querySelector("td"):null}function FT(e){const t=e.closest('[em="block"]');return!!t&&(e===t||Ta(t).includes(e))}var DU=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Gr=(e,t)=>{DU()},Xr=new Map;function BU(e){return Xr.get(e.toLowerCase())?.[0]}function yp(e){return Xr.get(e.toLowerCase())??[]}function HU(){return Xr.size>0}function $T(){return[...Xr.values()].map(e=>e[0])}function FU(e){Xr=new Map;for(const t of e??[]){const n=t.family.toLowerCase();Xr.set(n,[...Xr.get(n)??[],t])}return Xr}var $U=e=>{const t=FU(e);Gr("iframe: project fonts map received",{count:t.size,families:[...t.keys()],entries:e})};function WU(){const e=new ye;return e.addDisposable(j.addListener(ue.SANDBOX_SET_PROJECT_FONTS,$U)),e}var qU={"sans-serif":"Helvetica, Arial, sans-serif",serif:'"Times New Roman", Times, serif'};function WT(e){return e.category==="serif"?"serif":"sans-serif"}function Cu(e,t){const n=BU(t);return n?(e.style.fontFamily=qU[WT(n)],!0):!1}var zU=/(?:\/\*\s*em-project-font-[^*]*\*\/\s*)?@font-face\s*\{([^}]*)\}\s*/g,UU=/url\(\s*(['"]?)(.*?)\1\s*\)/,jU=e=>e.trim().replace(/^(['"])(.*)\1$/,"$2");function vp(e){return Array.from(e.matchAll(zU),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:jU(n.get("font-family")??""),src:UU.exec(n.get("src")??"")?.[2]??"",weight:n.get("font-weight")||"400",style:n.get("font-style")||"normal"}})}function qT(e){return[e.family.toLowerCase(),e.src,e.weight,e.style].join("|")}function zT(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 Ep(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(`
77
+ `));let l=n(s+`
78
+ `+[...a.querySelectorAll("style")].map(c=>c.innerHTML).join(`
79
+ `),{restructure:!0,forceMediaMerge:!0}).css;l=r(l,{indent:" ",autosemicolon:!0}),i.textContent=`
80
+ `+l+`
81
+ `}function Sp(e){const t=e.flatMap(n=>n instanceof Element?[...n.querySelectorAll('style[em="styles"]')]:[]);return t.forEach(n=>n.remove()),[...e,...t]}function Ii(e){return(e||"").replace(/\s/g,"")}function Tu(e,t){return`em-font-${Ii(e)}-${Ii(t)}`}function UT(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function wp(e){return Tu(e[2]||"",e[3]||"")}var _p="em-font-custom";function VU(e){return e[1]==="Project Fonts"}function Cp(e,t){VU(t)&&e.classList.add(_p)}function Aa(e,t){const n=[...e.classList].filter(r=>r.startsWith(t));n.length>0&&e.classList.remove(...n)}function Tp(e,t){t.forEach(n=>e.style.removeProperty(n))}function jT(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 Au(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 Di(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 ka(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 qe(e){return e==null||e===""}function Ap(e){const{elem:t,settings:n}=e,{border:r}=n;r&&(r.all?!qe(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&&(!qe(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&&(!qe(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&&(!qe(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&&(!qe(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 VT(e){const{elem:t,settings:n}=e,{boxShadow:r}=n;if(r)if(!qe(r.hOffset)&&!qe(r.vOffset)){let o="";o=r.inset?"inset ":"",o+=r.hOffset+"px ",o+=r.vOffset+"px ",o+=qe(r.blurRadius)?"":r.blurRadius+"px ",o+=qe(r.spreadRadius)?"":r.spreadRadius+"px ",o+=r.color?r.color:"",t.style.boxShadow=o}else t.style.removeProperty("box-shadow")}function Bi(e){const{elem:t,settings:n}=e,{borderRadius:r}=n;r&&(r.all?t.style.borderRadius=r.all+"px":(qe(r.topLeft)?t.style.removeProperty("border-top-left-radius"):t.style.borderTopLeftRadius=r.topLeft+"px",qe(r.topRight)?t.style.removeProperty("border-top-right-radius"):t.style.borderTopRightRadius=r.topRight+"px",qe(r.bottomRight)?t.style.removeProperty("border-bottom-right-radius"):t.style.borderBottomRightRadius=r.bottomRight+"px",qe(r.bottomLeft)?t.style.removeProperty("border-bottom-left-radius"):t.style.borderBottomLeftRadius=r.bottomLeft+"px"))}function GT(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+=GT(n)}),t}function XT(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=>XT(r,t,n))}var KT=()=>It;function GU(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 YT=/\[if[^\]]*mso[^\]]*\]/i,ZT="[if gte mso 9]></v:textbox></v:rect><![endif]";function ku(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 XU(e){return(e.style.backgroundRepeat||"").trim().toLowerCase().startsWith("repeat")?"tile":"frame"}function KU(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 YU(e){const t=KU(e),n=KT().getInstance(hy);return n?n(e,t):t}function ZU(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 QT(e){return!!e&&e.nodeType===Node.COMMENT_NODE}function xo(e){if(!QT(e))return!1;const t=e.nodeValue||"";return YT.test(t)&&/src\s*=/i.test(t)&&/v:(fill|image|rect)/i.test(t)}function La(e){if(!QT(e))return!1;const t=e.nodeValue||"";return YT.test(t)&&/<\/v:(rect|image|textbox)>/i.test(t)&&!/src\s*=/i.test(t)}function JT(e){let t=e.previousSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.previousSibling;return t}function e0(e){let t=e.nextSibling;for(;t&&t.nodeType===Node.TEXT_NODE&&!(t.nodeValue||"").trim();)t=t.nextSibling;return t}function t0(e){for(const t of Array.from(e.childNodes))(xo(t)||La(t))&&e.removeChild(t)}function QU(e,t){for(let n=e;n;n=n.nextSibling){if(n.nodeType===Node.ELEMENT_NODE)return n;if(n===t)break}return null}var n0=(e,t)=>{const n=ur(e,!1),r=ur(t,!0),o=QU(e,t);if(!xo(n)||!La(r)||!o)return;const i=ku(o),s=o.parentElement,a=!!s&&ku(s)===i;return i&&r0(n)===i&&!a?{before:n,after:r}:void 0};function r0(e){const t=/\bsrc\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(e.nodeValue??"");return(t?.[1]??t?.[2]??"").replace(/&amp;/gi,"&").trim()}function JU(e){return e.nodeType===Node.TEXT_NODE&&!(e.textContent??"").trim()}function ej(e){const t=Array.from(e.childNodes);t.some(xo)&&t.every(n=>JU(n)||xo(n)||La(n))&&t.filter(n=>xo(n)||La(n)).forEach(n=>n.remove())}function tj(e){const t=e.addService(Kc,n0),n=e.addService(sC,r=>r.forEach(ej));return{dispose:()=>{t.dispose(),n.dispose()}}}function nj(){return Ao(KT())}function rj(e){return nj().range(e,n0)}function oj(e,t,n){const r=n.parentElement,o=r?ku(r):"";return!!o&&!JT(e)&&!e0(t)&&r0(e)===o}function kp(e){const t=rj(e),n=JT(t.first),r=e0(t.last),o=xo(n)?n:null,i=La(r)?r:null;return o&&i&&oj(o,i,e)?{prev:null,next:null,range:t}:{prev:o,next:i,range:t}}function Na(e,t="inside"){return t==="around"?!!kp(e).prev:Array.from(e.childNodes).some(n=>xo(n))}function o0(e,t="inside"){if(t==="around"){const{prev:n,next:r}=kp(e);n?.remove(),r?.remove();return}t0(e)}function i0(e,t="inside"){const n=ku(e);if(!n){o0(e,t);return}const r=ZU(n,(e.style.backgroundColor||e.getAttribute("bgcolor")||"").trim(),XU(e),YU(e)),o=e.ownerDocument;if(o){if(t==="around"){const i=e.parentNode;if(!i)return;const{prev:s,next:a,range:{first:l,last:c}}=kp(e);s?.remove(),a?.remove(),i.insertBefore(o.createComment(r),l),i.insertBefore(o.createComment(ZT),c.nextSibling);return}t0(e),e.insertBefore(o.createComment(r),e.firstChild),e.appendChild(o.createComment(ZT))}}function xa(e,t,n="inside"){t?.outlookBackground===!0?i0(e,n):t?.outlookBackground===!1?o0(e,n):Na(e,n)&&GU(t)&&i0(e,n)}function Lu(e,t){return e.replace(/(^|[;\s])color:\s*[^;]*;?/i,`$1color: ${t};`)}function jn(e){return typeof e=="number"&&Number.isFinite(e)}function ij(e){return!e||typeof e!="object"?!1:jn(e.all)||jn(e.top)||jn(e.right)||jn(e.bottom)||jn(e.left)}function sj(e,t){const n=jn(t.all)?t.all:void 0,r=jn(t.top)?t.top:n,o=jn(t.right)?t.right:n,i=jn(t.bottom)?t.bottom:n,s=jn(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 s0(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 a0(e){const t=document.querySelector("title");if(t){t.insertAdjacentElement("afterend",e);return}document.head.appendChild(e)}function l0(e){return e.stylesheet??nO(e.source_url)}function aj(e){return`/* ${`em-project-font-${Ii(e.family)}-${e.weight}-${e.style}`} */
82
+ @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 lj=e=>qT({family:e.family,src:e.source_url,weight:e.weight,style:e.style});function cj(e,t){if(s0(t,e))return;const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.setAttribute("em-class",t),a0(n)}function Oa(e,t){const n=e.fontFamilyArray[1],r=e.fontFamilyArray[2],o=e.fontFamilyArray[3],i=Tu(r,o);if(n==="Project Fonts"){const d=yp(r),f=d[0];if(Gr("iframe: addFontFamilyClass Project Fonts",{fontFamilyArray:e.fontFamilyArray,emClass:i,entryFound:!!f,faces:d}),f){$e();const h=document.querySelector('style[em="styles"]'),m=[...new Set(d.filter(l0).map(p=>p.source_url))];if(m.forEach(p=>cj(p,i)),h){const p=new Set(vp(h.textContent??"").map(qT)),b=d.filter(y=>!l0(y)).filter(y=>!p.has(lj(y))).map(aj).join(`
83
+ `),C=b!=="";C&&h.insertAdjacentHTML("afterbegin",`${b}
84
+ `);const L=`.${UT(i)} {`,k=!h.textContent?.includes(L);if(k){const y=Jc[o],g=(y||f.weight).replace(/i$/g,""),E=y?y.endsWith("i"):f.style!=="normal";let _=`font-family: ${JSON.stringify(f.family)}, ${WT(f)}!important;`;_+=` font-weight: ${g}!important;`,E&&(_+=" font-style: italic!important;"),h.insertAdjacentHTML("beforeend",`
85
+ ${L} ${_} }`)}Gr("iframe: project font attached",{emClass:i,stylesheetUrls:m,faceInserted:C,classInserted:k})}else Gr("iframe: style[em=styles] not found — @font-face not injected");setTimeout(()=>{Oo({elem:document.documentElement},t),Kr(t),t&&t(!1)},0);return}Gr("iframe: Project Fonts entry missing in map — skip Google Fonts fallback",{fontFamily:r,mapSize:document.querySelectorAll('style[em="styles"]').length}),setTimeout(()=>{Oo({elem:document.documentElement},t),Kr(t)},0);return}if(!s0(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),a0(d)}$e();const s=Jc[o]||"400",a=s.replaceAll("i",""),l=s.indexOf("i")>-1;let c=`font-family: '${r}', ${PW[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",`
86
+ .${UT(i)} { ${c} }`),setTimeout(()=>{Oo({elem:document.documentElement},t),Kr(t)},0)}function uj(e){const t=Ii(e);return!!document.querySelector(`[class*="em-font-${t}-"], [class*="em-font-${t.toLowerCase()}-"]`)}function Kr(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=vp(n).filter(o=>yp(o.family).length>0&&!uj(o.family));!t||r.length===0||(t.textContent=zT(n,r),Gr("iframe: clearProjectFontFaces removed stale @font-face",{removedFamilies:[...new Set(r.map(o=>o.family))]}),e&&e(!1))}function Oo(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 Lp(e,t,n){t[0]==="Safe Fonts"?(e.style.fontFamily=t[1],Oo({elem:document.documentElement},n),Kr(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"&&Cu(e,t[2]),e.classList.remove(...[...e.classList].filter(r=>r.startsWith("em-font"))),e.classList.add(Tu(t[2],t[3])),Oa({fontFamilyArray:t},n))}function c0(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 u0(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 d0(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 Ra(e,t){e&&e.tagName==="TABLE"&&(e.classList.contains("em-vindent-table")||e.querySelector("td")?.innerHTML==="")&&e.querySelector("td")?.setAttribute("height",String(t))}function f0(e,t){const n=Rh(),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=Lu((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),Lp(i,s,t);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingBottom?l.style.paddingBottom=(n.text?.paddingBottom||0)+"px":Ra(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=Lu((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),Lp(i,s,t),d0(i,n.headings?.letterSpacing||0),c0(i,n.headings?.bold||!1),u0(i,n.headings?.italic||!1);const l=i.closest('[em="atom"] > tr > td');l?.style.paddingTop?l.style.paddingTop=(n.headings?.paddingTop||0)+"px":Ra(i.previousElementSibling,n.headings?.paddingTop||0),l?.style.paddingBottom?l.style.paddingBottom=(n.headings?.paddingBottom||0)+"px":Ra(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=Lu((i.getAttribute("style")||"").replace(/font-size:(\s+)?.*?px/,`font-size: ${n.buttons?.fontSize||16}px`),n.buttons?.color||"#FFFFFF");i.setAttribute("style",a),Lp(i,s,t);const l=i.closest("td"),c=!!l&&!!qr(l)&&!qr(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"),d0(i,n.buttons?.letterSpacing||0),c0(i,n.buttons?.bold||!1),u0(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&&Ra(h.previousElementSibling,n.buttons?.marginTop||0),f?.style.paddingBottom?f.style.paddingBottom=(n.buttons?.marginBottom||0)+"px":h?.nextElementSibling&&Ra(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&&Ap({settings:{border:n.buttons.border},elem:u}),n.buttons?.borderRadius&&Bi({settings:{borderRadius:n.buttons.borderRadius},elem:u})),c&&Uh(i,{backgroundColor:d})}}else{const s=Lu(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=>{Ta(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",n.block.backgroundColor),s.style.backgroundColor=n.block.backgroundColor})}),r.tagName==="DIV"?xt(r):xt(r.querySelector("tbody")||r)}function Np(e){const t=Rh(),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=>{Ta(o).forEach(i=>{const s=i;s.setAttribute("bgcolor",t.block.backgroundColor),s.style.backgroundColor=t.block.backgroundColor})});const r=t.block?.padding;return ij(r)&&Array.from(n.querySelectorAll('[em="block"]')).flatMap(Ta).forEach(o=>{sj(o,r)}),n.tagName==="DIV"?xt(n):xt(n.querySelector("tbody")||n)}var dj=e=>{for(const t of Object.keys(Jc))if(Ii(t)===e)return t;return e};function fj(e){const t=document.querySelector('style[em="styles"]'),n=t?.textContent??"",r=new Set(yp(e).filter(i=>i.stylesheet).map(i=>i.source_url)),o=vp(n).filter(i=>i.family.toLowerCase()===e.toLowerCase()&&r.has(i.src));t&&o.length&&(t.textContent=zT(n,o),Gr("iframe: dropped stylesheet @font-face",{family:e,count:o.length}))}function mj(e){if(!HU())return;const t=document.head.innerHTML,n=new Set;for(const r of $T()){fj(r.family);const o=`em-font-${Ii(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=dj(a);Oa({fontFamilyArray:["Google Fonts","Project Fonts",r.family,l]})})})}n.size>0&&Gr("iframe: hydrated project @font-face from DOM classes",{classes:[...n],families:$T().map(r=>r.family)}),Kr(),e&&document.head.innerHTML!==t&&e(!1)}function hj(e,t){const n=new ye,r=()=>{requestAnimationFrame(()=>{mj(t)})};return n.addDisposable(j.addListener(ue.SANDBOX_SET_PROJECT_FONTS,r)),n.addDisposable(e.onReady(r)),n}function m0(){j.send({operation:"sandbox_resized"})}function pj(e,t){const n=new ye,r=0;let o=0;n.addDisposable(t.beforeSave(()=>{o&&(clearTimeout(o),o=0)}));function i(){o||(o=setTimeout(()=>{m0(),o=0},r))}return n.addDisposable(e.onChange(s=>{const a=s.flatMap(function(l){return l.added.flatMap(c=>{if(wn(c))return bR(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 gj(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 bj=/^(?:ant|vscode|monaco|docs)-/;function yj(e){return bj.test(e)}function vj(){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 Ej=new Set(["animation-opacity","inline-edit-border-radius","separator-border","text-link-decoration"]);function Sj(){return Ej}var wj=new Set;function _j(e,t,n=wj){return e.startsWith(`${t}-`)?!1:!yj(e)&&!n.has(e)}function Cj(e,t){return`--${t}-${e}`}function Tj(e){const t=vj();return _j(e,t,Sj())?Cj(e,t):`--${e}`}function Aj(e){const t=new ye;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])=>` ${Tj(a)}: ${String(l)};
87
+ `).join("");if(s&&n!==s){n=s,i.innerHTML=`:root {
88
+ ${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 {
89
+ ${n}}`;const i=document.querySelector("head")||document.querySelector("body");i?.insertBefore(o,i.firstChild),e.commit(!1)}})),t.addDisposable(j.addListener(ue.SANDBOX_SET_THEME_VARIABLES,r)),t}var h0=4e3;function kj(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:h0});return}window.setTimeout(e,h0)}function Lj(e){const t=e.onDocumentShown(()=>{t.dispose(),kj(()=>{wS().catch(()=>{})})})}var Nj={name:"sandbox.crossDomainDrag",setup:()=>SU()},xj={name:"sandbox.themeVariables",awaits:{services:[Y]},setup:e=>Aj(R(e,Y))},Oj={name:"sandbox.projectFonts",awaits:{services:[at,Se]},setup(e){WU();const t=ht(e);hj(R(e,at),n=>t(n))}},Rj={name:"sandbox.pasteSanitizerPrewarm",awaits:{services:[Uo]},setup:e=>Lj(R(e,Uo))},Mj={name:"sandbox.variableSelection",setup:()=>kU()},Pj={name:"sandbox.emReplaceCaret",awaits:{services:[Y]},setup:e=>IU(R(e,Y))},Ij={name:"sandbox.resizeWatch",awaits:{services:[Y,at]},setup(e){pj(R(e,Y),R(e,at)),gj()}},Dj={name:"sandbox.reset",awaits:{services:[Y]},setup:e=>LI(R(e,Y))},Bj={name:"sandbox.correct",awaits:{services:[Y,lt,at]},setup:e=>vU(R(e,Y),R(e,lt).controller,R(e,at))},Hj={name:"sandbox.extensionScripts",awaits:{services:[Y,Es]},setup:e=>u$(R(e,Y),{surface:R(e,Es)})},Fj={name:"sandbox.localization",provides:[wl],awaits:{services:[Y]},setup:e=>e.inject(wl,yU(R(e,Y)))};function $j(e=[]){return{name:"sandbox.extensions",awaits:{services:[lt,Es,Y]},setup:t=>hU({container:t,focusController:R(t,lt).controller,surface:R(t,Es),features:[...e]})}}function Wj(e){const t=n=>function r(o,i=10){if(!qj(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 qj(e){return typeof e=="string"||typeof e=="object"&&e!==null&&!(e instanceof Element)}function p0(e){return e.includes("&")?new DOMParser().parseFromString(`<i title="${e.replace(/"/g,"&quot;")}"></i>`,"text/html").body.firstElementChild?.getAttribute("title")??e:e}function g0(e){return/^(data|blob):/i.test(e.trimStart())}function b0(e,t){const n=/^(\s*)([\s\S]*?)(\s*)$/.exec(e);return!n||!n[2]?e:`${n[1]}${t(n[2])}${n[3]}`}function zj(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 Uj(e,t){return e.replaceAll(/url\((\s*['"]?)([^'")]+)(['"]?\s*)\)/gi,(n,r,o,i)=>`url(${r}${b0(o,t)}${i})`)}function xp(e,t,n){const r=e.toLowerCase();return r==="srcset"?zj(t,n):r==="style"?Uj(t,n):b0(t,n)}var jj=["src","___src","background","poster","srcset","style"];function Nu(e){return g0(e)?e:zc(p0(e))}function Vj(){const e=new Map,t=n=>{if(g0(n))return n;const r=Nu(n),o=e.get(r);return o?p$(r).replace(new RegExp(`${ca}=\\d+`),`${ca}=${o}`):n};return{transform:{name:"em-version",attributes:jj,render:(n,r)=>n&&xp(r.attribute,n,t),serialize:(n,r)=>n&&xp(r.attribute,n,Nu)},requestReload(n){e.set(Nu(n.trim()),String(Date.now()))},isPending(n){return e.has(Nu(n.trim()))},clear(){e.clear()}}}var y0=["src","background","poster","srcset","style"];function Op(e,t=document){const n=y0.map(o=>`[${o}]`).join(","),r=[...t.querySelectorAll(n)];for(const o of r){const i=o.tagName.toLowerCase();for(const s of y0){const a=o.getAttribute(s);if(!a)continue;const l=e.serialize(a,{element:o,tag:i,attribute:s,stage:"apply"})??a,c=kh(o,s,l,{pipeline:e,stage:"apply"});c===null?a!==l&&o.removeAttribute(s):c!==a&&o.setAttribute(s,c)}}}function Gj(e,t){const{pipeline:n,htmlDocument:r}=t,o=Vj(),i=n.register(o.transform),s={reload(a){a&&(o.requestReload(a),r.renderOnly(()=>Op(n)))},clear(){o.clear()}};return e.inject(of,s),{reload:s,dispose(){i.dispose(),o.clear(),En(e,of)}}}var Xj=["https://emcdn.ru/843/20220715_113006_18.png","https://cdn.useblocks.io/843/230110_18_kXn4Evf.png"],Kj="/static/media/",Yj="empty-image";function Zj(e){return e.replace(/[.-][A-Za-z0-9_-]{7,20}$/,"")}function v0(e){let t;try{t=new URL(e,document.baseURI).pathname}catch{return null}return t.includes(Kj)?t:null}function Qj(e){return!!e&&v0(e)!==null}function Jj(e){if(!e)return!1;if(Xj.includes(e))return!0;const t=v0(e);return t===null?!1:Zj(t.slice(t.lastIndexOf("/")+1).replace(/\.[^.]+$/,""))===Yj}var eV=1e4;function tV(e=eV){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 nV=3e3,rV=["src","___src","background","poster","srcset","style"],Rp=e=>e.startsWith("blob:"),xu="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 oV(e){const t=encodeURIComponent(e).replace(/[!'()*]/g,n=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`);return`${xu}${t}`}var iV=new RegExp(String.raw`blob:[^\s"'()<>]+|`+xu.replace(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+String.raw`[^\s"'()<>]*`,"g");function E0(e){if(e.startsWith(xu))try{return decodeURIComponent(e.slice(130))}catch{return}}function sV(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:OI(n)}function aV(e){try{return new URL(e,document.baseURI).hostname}catch{return}}function lV(e){const t=e.store??tV(),n=e.answerTimeoutMs??nV,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=aV(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 b=j.sendAsync(ue.APPLICATION_CANVAS_IMAGE_GET,p?{url:m,fresh:p}:{url:m}).then(L=>{const k=L;if(k&&"blob"in k){t.acquire(m,k.blob),l.hits+=1;return}o.add(m),l.refused+=1}).catch(()=>{o.add(m),l.failed+=1}),C=Promise.race([b,new Promise(L=>{setTimeout(()=>{r.has(m)&&(s=!0,o.add(m),l.failed+=1),L()},n)})]).then(()=>{r.delete(m),e.refresh()});r.set(m,C)},d=m=>{const p=E0(m);if(p!==void 0)return d(p);if(!m||a||Rp(m)||m.startsWith("data:")||Qj(m))return m;const b=p0(m),C=t.peek(b);return C||(s||!i.enabled||o.has(b)||!c(b)?m:(l.misses+=1,u(b),oV(b)))},f=m=>Rp(m)?t.sourceOf(m)??m:E0(m)??m,h=(m,p,b)=>xp(p.attribute,m,b);return{configure(m){i={enabled:m.enabled,sourceHosts:[...m.sourceHosts??[]]}},transform:{name:"image-cache",attributes:rV,render:(m,p)=>m&&sV(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 Mp(m,f)},stats(){return{...l,blobs:t.size}},dispose(){t.dispose(),r.clear(),o.clear()}}}function cV(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||"";Rp(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 uV(e,t){return!e.includes("blob:")&&!e.includes(xu)?e:e.replace(iV,n=>t(n))}function Mp(e,t){if(typeof e=="string")return uV(e,t);if(Array.isArray(e)){let n=!1;const r=e.map(o=>{const i=Mp(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=Mp(i,t);n||(n=s!==i),r[o]=s}return n?r:e}return e}function dV(e,t){const{pipeline:n,htmlDocument:r}=t,o=()=>r.renderOnly(()=>Op(n)),i=lV({refresh:o}),s=cV(document,i,o),a=n.register(i.transform),l=j.addListener(ue.SANDBOX_CANVAS_IMAGE_CACHE_SETUP,u=>{i.configure(u),r.renderOnly(()=>Op(n))}),c=j.setOutgoingFilter(u=>i.restoreUrls(u));return e.inject(Sl,i),{cache:i,dispose(){s.dispose(),c(),l.dispose(),a.dispose(),i.dispose(),En(e,Sl)}}}function fV(e,t){const n=new nI,r=new zl,o=new rI(n,r),i=new AP(r,n,{prepareHtml:t.prepareHtml,serviceMarkup:Y_,mapHTMLRoots:e.mapHTMLRoots,...e.createRoot?{createRoot:e.createRoot}:{},...e.rootsParent?{rootsParent:e.rootsParent}:{}});i.addDisposable(new aI(i,o,n));const s=e.beforeCommit,a=s?i.beforeCommit(()=>s(i)):void 0,l=sx((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 mV(e,t){const n=fV(t,{prepareHtml:R(e,_l),lock:e.getInstance(Ne)}),r={commit:i=>n.commit(i),commitLockedAsync:i=>n.commitLockedAsync(i)},o=$5();return e.inject(vs,t),e.inject(at,n.remoteDocument),e.inject(ys,n.textDocument),e.inject(yn,n.documentMapping),e.inject(Y,n.htmlDocument),e.inject(Se,r),{...n,dispose(){o.dispose(),n.dispose(),En(e,vs),En(e,at),En(e,ys),En(e,yn),En(e,Y),En(e,Se)}}}function hV(){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 pV=hV();function gV(e){e.inject(fy,V),e.inject(Ne,pV),e.inject(Qe,om)}var bV=2e3;function yV(){return Math.random().toString(36).slice(2,10)}function vV(e){const t=`${e.session??yV()}.`;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>=bV&&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 EV(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 SV(e,t){return vV({isInLetter:n=>e.isInLetter(n),flush:()=>e.flushCommit(),entityId:()=>e.entityId,onEntitySet:n=>t.onEntitySet(n),onHostChange:n=>e.beforeChange(({domMutations:r})=>n(EV(r)))})}var wV=class extends ye{get isEditorInFocus(){return!!this._isEditorInFocus}constructor(e){super(),A(this,"_isEditorInFocus",!1),A(this,"_context",new Map),A(this,"_editorLostFocusEmitter",this.addDisposable(new pe)),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 _V(e,t){const{htmlDocument:n,remoteDocument:r}=t,o=new wV(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(),En(e,lt)}};return e.inject(lt,l),l}var CV={name:"sandbox.state",provides:[fy,Ne,Qe],setup:gV},TV={name:"sandbox.attributePipeline",provides:[qo],setup:B$},AV={name:"sandbox.documentSync",provides:[Y,at,ys,yn,Se,Uo],awaits:{services:[vs,_l,Ne]},setup:e=>e.inject(Uo,mV(e,R(e,vs)))},kV={name:"sandbox.images",provides:[Sl,of],awaits:{services:[qo,Y,Uo]},setup(e){const t=R(e,qo),n=R(e,Y);dV(e,{pipeline:t,htmlDocument:n});const r=Gj(e,{pipeline:t,htmlDocument:n}).reload;R(e,Uo).onDocumentReplaced(()=>r.clear()),j.addListener(ue.SANDBOX_IMAGE_RESET,({url:o})=>{o&&(e.getInstance(Sl)?.forget(o),r.reload(o))})}},LV={name:"sandbox.mapObj",provides:[jo],awaits:{services:[yn]},setup:e=>e.inject(jo,Wj(R(e,yn)))},NV={name:"sandbox.elementRefs",provides:[zo],awaits:{services:[Y,at]},setup:e=>e.inject(zo,SV(R(e,Y),R(e,at)))},xV={name:"sandbox.focus",provides:[lt],awaits:{services:[Y,at]},setup:e=>_V(e,{htmlDocument:R(e,Y),remoteDocument:R(e,at)})},OV={name:"sandbox.app",provides:[R_,wh],setup(e){e.getOrCreateInstance(wh,()=>new dy),e.injectFactory(R_,()=>ia.instance)}},RV=[OV,CV,TV,AV,kV,pD,gD,bD,LV,NV,xV,Nj,xj,Oj,Mj,Pj,Ij,Dj,Bj,Hj,Fj,Rj,dU,fU,mU,...jD],Pp=null,Ip=0,MV=6e5;function PV(e){Pp=e,Ip=e?Date.now():0}function S0(){const e=Pp,t=Ip;return Pp=null,Ip=0,!e||!t||Date.now()-t>MV||!e.isConnected||!e.matches('[em="block"]')?null:e}function IV(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",`
90
+ `);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",`
91
+ `),o.prepend(document.querySelector(c).cloneNode(!0)))}}),r.append(o),k_(r,[...r.querySelectorAll("style")],{forceMediaMerge:!0});let s=Dt(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 DV(e,t){const{HTMLDocument:n,messageService:r}=t,o=e.closest('[em="block"]');if(!o)return;const i=IV(o,n);if(!i)return;PV(o);const s=o.getAttribute("em-block-id"),a=o.getAttribute("em-block-version");r.send({operation:"application_eblock_add",data:Xc({html:i.trim(),isBlock:!0}),settings:{...s?{emBlockId:s}:{},...a?{emBlockVersion:a}:{}}})}function Ou(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 Ru(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 tt=()=>uc(window.getSelection()?.toString())??"",BV=[{type:"in-line-style",name:"color"},{type:"in-line-style",name:"border-color"},{type:"in-line-style",name:"background-color"},{type:"attribute",name:"bgcolor"}],HV={"in-line-style":e=>({selector:`[style~="${e}:"]`,toColor:t=>window.getComputedStyle(t).getPropertyValue(e)}),attribute:e=>({selector:`[${e}]`,toColor:t=>t.getAttribute(e)})},FV=/^#[\da-f]{6}$/i,w0=()=>[...new Set(BV.flatMap($V).map(G).filter(e=>FV.test(e)).map(e=>e.toUpperCase()))];function $V({type:e,name:t}){const n=HV[e],{selector:r,toColor:o}=n(t);return Array.from(document.querySelectorAll(r)).map(o)}function _0(e){return e.filter(t=>!qc.includes(t))}function WV(e){return qc.some(t=>e.classList.contains(t))?(e.classList.remove(...qc),e.classList.length||e.removeAttribute("class"),!0):!1}function qV(e){return Array.from(e.rows).flatMap(t=>[t,...Array.from(t.cells)]).map(WV).includes(!0)}function zV(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 C0(e){return zV(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 Yr=["top","right","bottom","left"],T0=["width","style","color"];function Dp(e,t){return e===t?Yr:Yr.filter(n=>e===`${t}-${n}`)}function UV(e,t){const n=e.toLowerCase();if(t==="padding")return Dp(n,"padding");const[r,o,i,...s]=n.split("-");return r!=="border"||s.length?[]:o===void 0||i===void 0&&T0.includes(o)?Yr:i===void 0||T0.includes(i)?Yr.filter(a=>a===o):[]}function Mu(e,t,n){const r=[];let o=-1,i=0;for(const a of e){const l="managed"in a?[]:UV(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 jV=['[contenteditable="false"]',".em-element-editor",'[class^="em-element-editor"]',".em-vindent"];function VV(e){return!!e.closest("editor.em-text")}function GV(e){e.querySelectorAll(jV.join(",")).forEach(t=>{VV(t)||t.remove()})}function XV(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 KV=".em-element-resize-img, .em-element-img-change-group";function YV(e){e.querySelectorAll(KV).forEach(t=>t.remove()),e.querySelectorAll("span.em-element-resize-img-container").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function ZV(e){const t=e.cloneNode(!0);return on(e,t),ii(t),GV(t),YV(t),XV(t),Ze(t)}function Pu(e){if(!e)return;const t=e.trim().match(/^(-?\d+(?:\.\d+)?)px$/i);return t?Number(t[1]):void 0}function QV(e){if(!e)return;const t=e.trim().split(/\s+/);if(t.length<3)return;const n=Pu(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 JV(e,t,n){const r=t.split(/\s+/).map(Pu),o=Dp(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 eG(e,t,n){const r=QV(t);if(!r)return!1;const o={...n.borders};return Dp(e,"border").forEach(i=>o[i]={...r}),n.borders=o,!0}function Zr(e,t,n){return n===void 0||n===""?!1:(e[t]=n,!0)}var tG={"font-family":{family:"font-family",consume:(e,t,n)=>Zr(n,"fontFamily",t)},"font-size":{family:"font-size",consume:(e,t,n)=>Zr(n,"fontSize",Pu(t))},"line-height":{family:"line-height",consume:(e,t,n)=>Zr(n,"lineHeight",Pu(t))},color:{family:"color",consume:(e,t,n)=>Zr(n,"color",A0(t))},"background-color":{family:"background-color",consume:(e,t,n)=>Zr(n,"backgroundColor",A0(t))},"text-align":{family:"text-align",consume:(e,t,n)=>Zr(n,"textAlign",nG(t))},"vertical-align":{family:"vertical-align",consume:(e,t,n)=>Zr(n,"verticalAlign",rG(t))},"border-radius":{family:"border-radius",consume:(e,t,n)=>Zr(n,"borderRadius",oG(t))},...Object.fromEntries(["padding",...Yr.map(e=>`padding-${e}`)].map(e=>[e,{family:"padding",consume:JV}])),...Object.fromEntries(["border",...Yr.map(e=>`border-${e}`)].map(e=>[e,{family:"border",consume:eG}]))};function A0(e){if(e)return e.trim()}function nG(e){if(!e)return;const t=e.trim().toLowerCase();return["left","center","right","justify"].find(n=>n===t)}function rG(e){if(!e)return;const t=e.trim().toLowerCase();return["top","middle","bottom"].find(n=>n===t)}function oG(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 iG(e){const t={},n=[],r=new Set;for(const o of C0(e.getAttribute("style"))){const i=o.name.toLowerCase(),s=tG[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 sG(e){const t=e.getAttribute("align")?.toLowerCase();if(t==="left"||t==="center"||t==="right")return t}function aG(e){const t=e.getAttribute("valign")?.toLowerCase();if(t==="top"||t==="middle"||t==="bottom")return t}var lG=["rowspan","colspan","class","style"];function Iu(e){return Array.from(e.attributes).filter(t=>!h$.includes(t.name)).map(t=>({name:t.name,value:t.value}))}function cG(e,t,n){return Iu(e).filter(({name:r})=>!lG.includes(r)&&!(r==="align"&&t)&&!(r==="valign"&&n))}function uG(e){return Iu(e).flatMap(t=>{if(t.name!=="class")return[t];const n=t.value.split(/\s+/).filter(Boolean),r=_0(n);return r.length===n.length?[t]:r.length?[{name:"class",value:r.join(" ")}]:[]})}function k0(e){const t=e.parentElement?.tagName;return t==="THEAD"?"thead":t==="TFOOT"?"tfoot":"tbody"}function dG(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 fG(e,t){const n=sG(e),r=aG(e);return{...t,contentHtml:ZV(e),classList:Array.from(e.classList),tag:e.tagName==="TH"?"th":"td",attrs:cG(e,n,r),...iG(e),align:n,valign:r}}function mG(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 hG(e){const t=dG(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=fG(l,{id:`cell-${r.length}`,row:s,col:a,rowspan:u,colspan:d});r.push(f),mG(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 pG(e,t){const n={};for(const r of t){const o=k0(r);o!=="tbody"&&r.parentElement&&!n[o]&&(n[o]=Iu(r.parentElement))}return{attrs:Iu(e),...Object.keys(n).length?{sectionAttrs:n}:{}}}function Bp(e,t){const n=Number(/^cell-(\d+)$/.exec(t)?.[1]??NaN);return Array.from(e.rows).flatMap(r=>Array.from(r.cells))[n]}function Ma(e,t){const n=Array.from(e.rows).flatMap(r=>Array.from(r.cells)).indexOf(t);return n<0?void 0:`cell-${n}`}function Hi(e){const t=Array.from(e.rows),n=t.map(r=>({section:k0(r),attrs:uG(r)}));return{rows:t.length,...hG(t),rowsMeta:n,meta:pG(e,t)}}function L0(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var Du=["top","right","bottom","left"];function gG(e){if(!e)return[];const t=Du.map(n=>e[n]);return t[0]!==void 0&&t.every(n=>n===t[0])?[`padding: ${t[0]}px`]:Du.flatMap(n=>e[n]===void 0?[]:[`padding-${n}: ${e[n]}px`])}function N0(e){return`${e.width}px ${e.style} ${e.color}`}function bG(e,t){return!!e&&e.width===t.width&&e.style===t.style&&e.color===t.color}function yG(e){if(!e)return[];const{top:t}=e;return t&&Du.every(n=>bG(e[n],t))?[`border: ${N0(t)}`]:Du.flatMap(n=>{const r=e[n];return r?[`border-${n}: ${N0(r)}`]:[]})}function vG(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",gG(e.padding)],["border",yG(e.borders)]];for(const[r,o]of n)o.length&&t.set(r,o);return t}function EG(e){const t=vG(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 Bu(e){return e.map(({name:t,value:n})=>` ${L0(t)}="${L0(n)}"`).join("")}function SG(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",EG(e)||void 0]].flatMap(([n,r])=>r===void 0?[]:[{name:n,value:r}]);return`<${e.tag}${Bu([...t,...e.attrs])}>${e.contentHtml}</${e.tag}>`}function wG(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?[SG(s)]:[]});return`<tr${Bu(e.rowsMeta[t]?.attrs??[])}>${r.join("")}</tr>`}function _G(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}${Bu(e.meta?.sectionAttrs?.[o]??[])}>${s}</${o}>`,r=i}return n}function x0(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)=>wG(e,o,t));return`<table${Bu(e.meta?.attrs??[])}>${_G(e,n)}</table>`}function vt(e){return{rejected:e}}function Hp(e){return"rejected"in e}function gr(e,t){return e.cells.find(n=>n.id===t)}function Fi(e,t,n){const r=e.grid[t]?.[n];return r?gr(e,r):void 0}function Fp(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 CG(e){return Fp(e)()}function TG(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 $i(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)||!TG(t,e.cols,r))return vt("invalid-layout");n.add(r.id)}return e.rowsMeta.length!==e.rows?vt("invalid-layout"):{...e,grid:t}}function br(e){return JSON.parse(JSON.stringify(e))}function AG(e,t){return new DOMParser().parseFromString(e,"text/html").body.firstChild?.nodeType===Node.ELEMENT_NODE?NG(e,t):"&nbsp;"}function kG(e){const t=br(e);return t.contentHtml=AG(e.contentHtml," "),t.classList=_0(t.classList),t.attrs=t.attrs.filter(n=>n.name!=="id"),t}function LG(e){return{...e,contentHtml:D_,classList:[""],tag:"td",attrs:[],styleEntries:[],align:"center",valign:"top",style:{}}}function Hu(e,t){return e?{...kG(e),...t}:LG(t)}function O0(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=>O0(t))}function NG(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&&O0(s)&&s.parentNode?.removeChild(s)}return o(n),i(n,!0),n.outerHTML||e}function xG(e){return e?{section:e.section,attrs:e.attrs.filter(t=>t.name!=="id")}:{section:"tbody",attrs:[]}}function R0(e,t,n){const r=br(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=Fp(e);for(let s=0;s<r.cols;s++)o.has(s)||r.cells.push(Hu(Fi(e,n,s),{id:i(),row:t,col:s,rowspan:1,colspan:1}));return r.rowsMeta.splice(t,0,xG(e.rowsMeta[n])),r.rows+=1,$i(r)}function M0(e,t,n){const r=gr(e,t);if(!r)return vt("no-cell");const o=r.row+r.rowspan-1;return n==="above"?R0(e,r.row,r.row):R0(e,o+1,o)}function OG(e,t){const n=gr(e,t);if(!n)return vt("no-cell");if(e.rows<=1)return vt("last-line");const r=n.row,o=br(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,$i(o)}function P0(e,t,n){const r=br(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=Fp(e);for(let s=0;s<r.rows;s++)o.has(s)||r.cells.push(Hu(Fi(e,s,n),{id:i(),row:s,col:t,rowspan:1,colspan:1}));return r.cols+=1,$i(r)}function I0(e,t,n){const r=gr(e,t);if(!r)return vt("no-cell");const o=r.col+r.colspan-1;return n==="left"?P0(e,r.col,r.col):P0(e,o+1,o)}function RG(e,t){const n=gr(e,t);if(!n)return vt("no-cell");if(e.cols<=1)return vt("last-line");const r=n.col,o=br(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,$i(o)}var MG="img, table, hr, svg, video, iframe, picture";function D0(e){const t=document.createElement("div");return ke(t,e),t}function B0(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 PG(e){return(e.textContent??"").replace(/ /g," ").trim()===""&&!e.querySelector(MG)}function IG(e){const t=D0(e);if(PG(t))return"";const n=B0(t);return n?Ze(n):e.trim()}function DG(e,t){const n=t.map(o=>IG(o.contentHtml)).filter(o=>o!=="").join("<br>").replace(/&nbsp;$/,""),r=n===""?"&nbsp;":n;for(const o of[e,...t]){const i=D0(o.contentHtml),s=B0(i);if(s)return ke(s,r),Ze(i)}return n===""?D_:n}function BG(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 HG(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 $p(e,t,n){const r=new Set([t,...n]),o=e.cells.filter(c=>r.has(c.id));if(o.length!==r.size)return vt("no-cell");if(r.size<2)return vt("nothing-to-merge");const i=BG(o);if(!HG(e,i,r))return vt("not-rectangular");const s=br(e),a=gr(s,t),l=[...o].sort((c,u)=>c.row-u.row||c.col-u.col);return a.contentHtml=DG(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)),$i(s)}function FG(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 $G(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(Fi(e,r,o)?.id??"");return n}function WG(e,t,n,r=1){const o=gr(e,t);if(!o)return vt("no-cell");if(r<1)return vt("nothing-to-merge");const i=$G(e,FG(o,n,r));return i?i.includes("")?vt("not-rectangular"):$p(e,t,i):vt("out-of-table")}function H0(e,t,n,r=1){const o=gr(e,t),i=n==="cols"?o?.colspan:o?.rowspan;if(!o||i===void 0)return vt("no-cell");if(r<1||r>=i)return vt("nothing-to-split");const s=br(e),a=gr(s,t),l={id:CG(e),row:a.row,col:a.col,rowspan:a.rowspan,colspan:a.colspan};return n==="cols"?(a.colspan-=r,s.cells.push(Hu(a,{...l,col:a.col+a.colspan,colspan:r}))):(a.rowspan-=r,s.cells.push(Hu(a,{...l,row:a.row+a.rowspan,rowspan:r}))),$i(s)}function qG(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 Fu(e,t){return Array.from({length:Math.max(0,t-e+1)},(n,r)=>e+r)}function zG(e,t,n){switch(n){case"right":return Fu(e.col+e.colspan,t.col+t.colspan-1).map(r=>({row:e.row,col:r}));case"left":return Fu(t.col,e.col-1).map(r=>({row:e.row,col:r}));case"bottom":return Fu(e.row+e.rowspan,t.row+t.rowspan-1).map(r=>({row:r,col:e.col}));default:return Fu(t.row,e.row-1).map(r=>({row:r,col:e.col}))}}function UG(e,t,n){const r=Fi(e,t.row,t.col),o=Fi(e,n.row,n.col),i=r&&o&&r.id!==o.id?qG(r,o):null;if(!r||!o||!i)return null;const s=[...new Set(zG(r,o,i).map(a=>Fi(e,a.row,a.col)?.id??""))];return s.includes("")||Hp($p(e,r.id,s))?null:{direction:i,cellIds:s}}function jG(e,t){const n=[];for(const r of e.cells)t.some(o=>r.classList.includes(o))&&n.push(r.id);return n}function VG(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 $u(e,t){return Array.from({length:t},(n,r)=>e+r)}function GG(e,t){switch(t){case"top":return $u(e.col,e.colspan).map(n=>[e.row-1,n]);case"bottom":return $u(e.col,e.colspan).map(n=>[e.row+e.rowspan,n]);case"left":return $u(e.row,e.rowspan).map(n=>[n,e.col-1]);default:return $u(e.row,e.rowspan).map(n=>[n,e.col+e.colspan])}}function F0(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 Yr){const c=GG(s,l),u=c.filter(d=>!o(d)).length;if(u>0&&u<c.length)return Object.fromEntries(r.map(d=>[d.id,[...Yr]]));u>0&&a.push(l)}i[s.id]=a}return i}function XG(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=Mu(s.styleEntries,"border",n)}return i}function KG(e,t,n){const r=br(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=Mu(o.styleEntries,"border",n)}return r}function YG(e,t){return F0(e,t)}function ZG(e){const t=br(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 QG(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 JG=[["topLeft","top","left"],["topRight","top","right"],["bottomLeft","bottom","left"],["bottomRight","bottom","right"]];function eX(e,t){const n={};for(const[r,o]of Object.entries(F0(e,t))){const i=JG.filter(([,s,a])=>o.includes(s)&&o.includes(a)).map(([s])=>s);i.length&&(n[r]=i)}return n}var tX={paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"],paddingLeft:["left"],paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"]};function nX(e,t){if(!t.settings)return e;const n=Object.keys(t.settings);if(n.length===0)return e;const r=n[0],o=tX[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=Mu(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 rX(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=Mu(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 oX(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 eae=5,$0=.5,iX=.1;function sX(e){return(100-e*5)/(e-1)}function aX(e,t,n){const r=e.reduce((l,c)=>l+Math.max(c,0),0)>0?e.map(l=>Math.max(l,0)):e.map(()=>1),o=r.map(()=>!1);let i=[];for(let l=!0;l;){l=!1;const c=r.reduce((d,f,h)=>o[h]?d:d+f,0),u=t-n*o.filter(Boolean).length;i=r.map((d,f)=>o[f]?n:c>0?u*d/c:0),i.forEach((d,f)=>{!o[f]&&d<n&&(o[f]=!0,l=!0)})}const s=i.map(l=>Math.floor(l+1e-9));let a=t-s.reduce((l,c)=>l+c,0);return i.map((l,c)=>({i:c,fraction:l-s[c]})).sort((l,c)=>c.fraction-l.fraction||l.i-c.i).forEach(({i:l})=>{a>0&&(s[l]+=1,a-=1)}),s}function Wi(e,t){const n=e.length;if(n<2)return{columns:n===1?[100]:[],gap:0};const r=Math.round(Math.min(Math.max(t,0),sX(n))*100);return{columns:aX(e,1e4-r*(n-1),500).map(o=>o/100),gap:r/100}}function lX(e){if(e<2)return 0;const t=(100-e*(Math.round(100/e)-2))/(e-1);return Math.round(t/$0)*$0}function cX(e){if(e.length<2)return 0;const t=100-e.reduce((n,r)=>n+r,0);return t>0?t/(e.length-1):0}function uX(e,t){if(e.columns.length!==t.length)return!1;const n=Wi(t,e.gap).columns;return e.columns.every((r,o)=>Math.abs(r-n[o])<=iX)}function dX(e){return String(Math.round(e*100)/100).replace(".","_")}function fX(e){const t=/^(\d+)(?:_(\d{1,2}))?$/.exec(e);return t?parseFloat(t[2]?`${t[1]}.${t[2]}`:t[1]):null}function Wp(e){return Wi(e,lX(e.length))}function W0(e,t){return{items:e.columns,gap:e.gap,linked:uX(e,t)}}function mX(e,t,n){return t.length<2?null:e?n==="follow"&&e.items.length===t.length&&!e.linked?{columns:e.items,gap:e.gap}:Wi(t,e.gap):Wp(t)}function hX(e,t){return Wi(t,e.gap)}function pX(e,t,n){return Wi(e.linked?t:e.items,n)}function gX(e,t){return Wi(t,e.gap)}var qp=".em-mob-wrap, .noresp-em-mob-wrap",Wu="em-mob-wrap-cancel",zp="em-mob-width-",bX="em-mob-width-100perc",yX=".em-mob-wrap.em-mob-wrap-cancel, .noresp-em-mob-wrap.em-mob-wrap-cancel",q0="em-mob-vertical_align-";function Up(e){return Array.from(e.children).some(t=>t.matches(qp))?e:e.querySelector(qp)?.parentElement??null}function Qr(e){const t=Array.from(e.children).filter(n=>n.matches(qp));return{columns:t.filter((n,r)=>r%2===0),gaps:t.filter((n,r)=>r%2===1)}}function Pa(e){return Qr(e).columns.map(t=>parseFloat(t.getAttribute("width")||"0"))}function jp(e){Array.from(e.classList).filter(t=>t.startsWith(zp)).forEach(t=>e.classList.remove(t))}function z0(e){for(const t of Array.from(e.classList))if(t.startsWith(zp)&&t.endsWith("perc")){const n=fX(t.slice(13,-4));if(n!==null)return n}return null}function vX(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function U0(e,t,n){$e();const r=Yc();!r||new RegExp(`${vX(e)}(?![\\w-])`).test(r.textContent??"")||r.append(document.createTextNode(`
92
+ ${dC()}
93
+ ${t} { ${n} }
94
+ }
95
+ `))}function j0(e,t){const n=`${zp}${dX(t)}perc`,r=`${Math.round(t*100)/100}%`;jp(e),e.classList.add(Wu,n),U0(`.${n}`,`.${n}`,`width: ${r} !important; max-width: ${r} !important;`)}function Ia(e,t){const{columns:n,gaps:r}=Qr(e);U0(".em-mob-wrap.em-mob-wrap-cancel",yX,"display: table-cell !important;"),n.forEach((o,i)=>j0(o,t.columns[i]??0)),r.forEach(o=>j0(o,t.gap))}function V0(e){const{columns:t,gaps:n}=Qr(e);t.forEach(r=>{r.classList.remove(Wu),jp(r),r.classList.add(bX)}),n.forEach(r=>{r.classList.remove(Wu),jp(r)})}function Vp(e){return Qr(e).columns.some(t=>t.classList.contains(Wu))}function EX(e){return Wp(Pa(e))}function qi(e){const t=e?Up(e):null;return!t||!Vp(t)?null:{row:t,before:Ui(t)}}function zi(e,t){if(!e)return;const n=mX(e.before,Pa(e.row),t);n?(Ia(e.row,n),wX(e.row)):V0(e.row)}function Ui(e){const{columns:t,gaps:n}=Qr(e);if(t.length<2||!Vp(e))return null;const r=Pa(e),o=t.map(z0);if(o.some(a=>a===null))return W0(Wp(r),r);const i=o,s=(n.length?z0(n[0]):null)??cX(i);return W0({columns:i,gap:Math.round(s*100)/100},r)}function G0(e){const t=Array.from(e.classList).find(n=>n.startsWith(q0));return t?t.slice(22):null}function X0(e,t){Mh({elem:e,settings:{mobileVerticalAlign:{value:t,classNamePrefix:q0}}})}function Gp(e){const t=Qr(e).columns[0];return t?G0(t):null}function SX(e,t){Qr(e).columns.forEach(n=>X0(n,t))}function wX(e){const t=Gp(e);t&&Qr(e).columns.filter(n=>G0(n)===null).forEach(n=>X0(n,t))}function _X(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=ze({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:Di(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:Au(e),boxShadow:ka(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:Na(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 CX(e){let t=[],n=null,r=null,o="",i,s=!1,a=null,l=null;if(e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap")){const c=e.elem.closest(".em-mob-wrap, .noresp-em-mob-wrap");if(a=c.parentElement?Ui(c.parentElement):null,l=c.parentElement?Gp(c.parentElement):null,i=!0,c.parentElement.querySelectorAll(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap").length>1)c.parentElement.querySelectorAll(":scope > .em-mob-wrap:nth-child(odd), :scope > .noresp-em-mob-wrap:nth-child(odd)").forEach(u=>{t.push({width:parseFloat(u.getAttribute("width")||"0"),current:u===c});const d=c.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");d?.nextElementSibling&&(n=parseFloat(d.nextElementSibling.getAttribute("width")||"0"),r=ze({elem:d.nextElementSibling}).mobileHeight||0),(u.classList.contains("em-mob-wrap-cancel")||u.classList.contains("noresp-em-mob-wrap-cancel"))&&(i=!1)});else{const u=c.parentElement.querySelector(":scope > .em-mob-wrap, :scope > .noresp-em-mob-wrap");t=[{width:parseFloat(u?.getAttribute("width")||"0"),current:!0}],n=0}o=c.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 c=e.elem.closest('div[style*="inline-block"]');if(c&&c.parentElement.querySelectorAll('div[style*="inline-block"]').length>1)c.parentElement.querySelectorAll('div[style*="inline-block"]').forEach(u=>{const d=u;if(!d.style.fontFamily){const f=u.firstElementChild;t.push({width:parseFloat(f?.getAttribute("width")||"0"),current:u===c});const h=f?.getAttribute("width"),m=parseFloat(d.style.width);n=m-(!h||h.indexOf("%")>-1?m:parseFloat(h))}});else{const u=c?.parentElement?.querySelector('div[style*="inline-block"]');t=[{width:parseFloat(u?.firstElementChild?.getAttribute("width")||"0"),current:!0}],n=0}o=c?.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,mobile:a,mobileValign:l}}var TX='table[em-type="social"]';function AX(e){return e.closest(TX)}function kX(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 ji(e){const t=AX(e);if(t&&e!==t&&kX(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")&&LX(o)?n:ji(n)}function LX(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 Vi(){return It.getInstance(wl)?.localized??{}}var K0=[];function NX(){return K0}function Y0(e){const t=Vi();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=MI(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 xX=new Set(["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"]);function OX(e){return Array.from(e.classList).some(t=>t.startsWith("em-element-"))}function RX(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(xX.has(r.tagName))return!1;return Array.from(e.children).every(r=>r===n||r.contains(n)||OX(r))}var Z0='.em-narrow-table, [em="block-contaner"]';function MX(e){const t=e.style;return RX(e)?!1:!!(e.tagName==="A"&&!e.closest(".em-element-resize-img-container")&&!e.closest('table[em-type="social"]')||e.tagName==="TD"&&!e.closest(Z0)||e.tagName==="TABLE"&&e.parentElement?.style?.display!=="inline-block"&&!e.classList.contains("em-vindent-table")&&!e.closest(Z0)&&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"))||CE(e))}function PX(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||CE(e))&&t.push(Y0(e));let r=e;for(;r?.parentElement&&r.parentElement.tagName!=="BODY";)r=r.parentElement,MX(r)&&t.push(Y0(r));return t=t.filter(o=>!(o.elem?.tagName==="TABLE"&&o.elem.parentElement?.tagName==="BODY")),t=t.reverse(),K0=t.map(o=>({...o})),t.map(o=>({title:o.title,className:o.className}))}function Q0(e){const t=Vi(),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 Q0(n)}function IX(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 J0(e){return e.tagName==="AMP-ACCORDION"}var eA="em-mob-text_align-",DX=":scope > tr > td, :scope > tbody > tr > td",BX='div[style*="font-family"][style*="font-size"]';function Xp(e){return e.querySelector(DX)}function Kp(e){return e.querySelector(BX)}function HX(e,t){for(let n=e;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!0;return!1}function tA(e){const t=e.closest('table[em="atom"]');if(!t||HX(e,t))return null;const n=Xp(t);return n?{atomTd:n,textDiv:Kp(n)}:null}function Da(e){const t=e.closest("div, p, td");if(!t)return null;if(t.style.textAlign)return t;const n=tA(e);return n?n.textDiv?.hasAttribute("align")?n.textDiv:n.atomTd:t}function nA(e){const t=Da(e);return t&&(t.style.textAlign||t.getAttribute("align"))||"left"}function FX(e){const t=Da(e);if(!t)return"";for(const n of t.classList)if(n.startsWith("em-mob-text_align-"))return n.slice(18);return""}function Yp(e){return{value:FX(e)}}function $X(e,t,n=eA){const r=tA(e);if(r)for(const o of[r.atomTd,r.textDiv])o&&o!==t&&Zc(o,n)}function WX(e){const t=Xp(e);if(!t)return null;const n=Kp(t);return n?.hasAttribute("align")?n:t}function qX(e,t){e.querySelectorAll('[em="atom"]').forEach(n=>{const r=WX(n);r&&t(r,n)})}function zX(e,t,n=eA){const r=Xp(e),o=r?Kp(r):null;for(const i of[r,o])i&&i!==t&&Zc(i,n)}function qu(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 Ba(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(_p),i=r.filter(s=>s!==_p);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 nt(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 zu(e){if(!e)return!1;const t=e.style.fontWeight||getComputedStyle(e).fontWeight;return t==="bold"||t==="700"||parseInt(t,10)>=700}function Jr(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 UX(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 jX(){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 Ha(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 rA(){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 Zp(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&&Zp(t))return!0;return!1}function oA(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 iA(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function VX(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 GX(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 XX(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 KX(e,t){const n=e.elem.closest("a")||e.elem,r=e.elem.closest("td"),o=Wh(n),i=Zp(r)&&!Zp(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=ze({elem:e.elem}),f=ze({elem:r}),h=l?ze({elem:l}):null,m=ze({elem:a}),p=e.elem.closest("a"),b={type:"button",caption:t.BUTTON,fontFamily:Ba(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:qu(e.elem),lineHeightDim:"px",textStrong:nt(e.elem,"strong","b")||zu(e.elem),textItalic:nt(e.elem,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&(p?.style?.fontStyle==="italic"||e.elem.style?.fontStyle==="italic"),textStrikethrough:nt(e.elem,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1)||!!e.elem.closest('[style*=" text-decoration"]')?.style.textDecoration?.includes("line-through"),textUnderline:nt(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(Jr(e.elem,"color"))||G(getComputedStyle(e.elem).color)||"",textBackgroundColor:G(Jr(e.elem,"background-color"))||"",padding:VX(o??n),borderRadius:Di(s),backgroundColor:s.style.backgroundColor?G(s.style.backgroundColor):s.getAttribute("bgcolor")||"",backgroundImage:XX(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:oA(a,"width"),height:oA(r,"height"),align:u,valign:r.getAttribute("valign")??"",textAlign:r.getAttribute("align")??"",border:Au(s),boxShadow:ka(s),href:n.getAttribute("href")??"",outlookRounding:i,multiline:fa(n),outlookBackground:Na(r,"inside"),mobileWidth:{value:iA(m.mobileWidth),dim:m.mobileWidthDim??"px"},mobileHeight:{value:iA(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:Yp(e.elem),mobileVerticalAlign:h?.mobileVerticalAlign,mobileBackgroundColor:f.mobileBackgroundColor,mobileBackgroundImage:f.mobileBackgroundImage,mobileBackgroundPositionX:f.mobileBackgroundPositionX,mobileBackgroundPositionY:f.mobileBackgroundPositionY,mobileBackgroundRepeat:f.mobileBackgroundRepeat,mobileBackgroundSize:f.mobileBackgroundSize,mobilePadding:GX(d.mobilePadding),mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},show:m.show,exportAsPicture:a?.getAttribute("em-operation")==="exportAsPicture"};return Ha(e.elem)&&(b.showOnMobile=!0),b}function Fa(e){if(qh(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 YX(e,t){return t?!1:e.tagName==="A"||e.tagName==="EM-REPLACE"&&!!e.closest("a")}function ZX(e){const t=e.closest("a"),n=e.closest('a[style*="display"]');if(qh(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 sA(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function aA(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function lA(e){return{src:e.getAttribute("src")??"",width:sA(e,"width"),height:sA(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 QX(e,t,n){n.clearActiveEditElements();const r=e.elem.closest("amp-carousel");r.setAttribute("em-edit","active");const o=r.querySelectorAll("amp-img"),i=JX(o),s=Array.from(o).map((u,d)=>{const f=ze({elem:u}),h=lA(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:aA(f.mobileWidth),dim:f.mobileWidthDim??"px"},mobileHeight:{value:aA(f.mobileHeight),dim:f.mobileHeightDim??"px"},mobileBorderRadius:f.mobileBorderRadius,slideIndex:d}}),a=ze({elem:r}),l={type:"carousel",caption:t.CAROUSEL,carouselImages:s,borderRadius:Di(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 JX(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 Qp(e){return!!e.closest("amp-carousel")}function Vn(e){return typeof e=="string"?e:typeof e=="number"?String(e):""}function At(e){return typeof e=="number"?Number.isFinite(e)?e:null:typeof e!="string"||!/^\s*-?\d+(\.\d+)?(px)?\s*$/.test(e)?null:parseFloat(e)}var Uu=["top","right","bottom","left"],ju={borderAll:"all",borderTop:"top",borderRight:"right",borderBottom:"bottom",borderLeft:"left"},Vu={width:1,style:"solid",color:"#b9b1b1"},cA={width:null,style:null,color:null};function Gu(e,t){if(t==="all"){const r=Uu.map(i=>Gu(e,i)),[o]=r;return r.every(i=>JSON.stringify(i)===JSON.stringify(o))?o:cA}const n=e.style.getPropertyValue(`border-${t}-style`);return!n||n==="none"?cA:{width:At(e.style.getPropertyValue(`border-${t}-width`)),style:n,color:G(e.style.getPropertyValue(`border-${t}-color`))||null}}function Jp(e){return e.style===""||"width"in e&&qe(e.width)&&!e.style&&!e.color}function uA(e){return e==="all"?"border":`border-${e}`}function Xu(e){const t=uA(e),n=[t,`${t}-width`,`${t}-style`,`${t}-color`];return e==="all"?[...n,...Uu.flatMap(Xu)]:n}function dA(e,t,n){Tp(e,Xu(t)),e.style.setProperty(uA(t),`${n.width}px ${n.style} ${n.color}`)}function eK(e){const t=Gu(e,"all");if(t.style===null)return;Tp(e,Xu("all"));const n={width:t.width??0,style:t.style,color:t.color??Vu.color};Uu.forEach(r=>dA(e,r,n))}function fA(e,t,n){if(t!=="all"&&eK(e),Jp(n)){Tp(e,Xu(t));return}const r=Gu(e,t==="all"?"top":t);dA(e,t,{width:At(n.width)??r.width??Vu.width,style:n.style||r.style||Vu.style,color:n.color||r.color||Vu.color})}var eg=/^border(-(top|right|bottom|left))?(-(width|style|color))?$/i;function tK(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 nK(e){const t=C0(e.getAttribute("style")),n=t.findIndex(({name:a})=>eg.test(a));if(n<0||t.some(({name:a,value:l})=>eg.test(a)&&/!important/i.test(l)))return;const r=Uu.map(a=>[a,tK(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})=>!eg.test(a)).map(({name:a,value:l})=>`${a}: ${l}`);s.splice(n,0,...i),e.setAttribute("style",s.length?`${s.join("; ")};`:"")}function rK(e){const t=At(e.getAttribute("border"));return t?{width:t,style:"solid",color:G(e.getAttribute("bordercolor")??"")||null}:null}function mA(e){const t=rK(e),n=Object.keys(ju),r=Object.fromEntries(n.map(i=>[i,t??Gu(e,ju[i])])),o=n.find(i=>r[i].style!==null)??"borderAll";return{...r,position:o}}function hA(e){return!!e.closest(".em-element-custom-table")}function pA(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 oK(e){return{backgroundColor:G(e.style.backgroundColor||e.getAttribute("bgcolor")||"")||"",backgroundImage:UX(e),backgroundPositionX:e.style.backgroundPositionX||"center",backgroundPositionY:e.style.backgroundPositionY||"center",backgroundRepeat:e.style.backgroundRepeat||"repeat",backgroundSize:e.style.backgroundSize||"cover"}}function iK(e){const{position:t,...n}=mA(e),r=ka(e);return{...n,borderPosition:t,borderRadius:Di(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 sK(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 aK(e){const{position:t,borderAll:n,borderTop:r,borderRight:o,borderBottom:i,borderLeft:s}=mA(e),a=Object.fromEntries(Object.entries(pA(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 lK(e){const t=e.closest("a");return{linkHref:t?.getAttribute("href")?.trim()??"",textLink:!!t,linkTarget:t?.getAttribute("target")??""}}function cK(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 uK(e,t){const n=t.requestElemWithStyle;return{fontFamily:t.getFontFamilyFromElement(n?.closest('[style*="font-family"]')||e),fontSize:cK(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 dK(e,t,n){const r=e.elem,o=r.closest("td, th")??r,i=o.closest("table"),s=ze({elem:i}),a={direction:r.getAttribute("dir")??"none",show:s.show,outlookBackground:Na(r.closest(".em-element-custom-table")??r,"around"),customTable:{tableKey:n.tableKey(i),...pA(o),...oK(i),...iK(i),...sK(s),...aK(o),...lK(r),...uK(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 fK(){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 Ku(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function mK(e,t,n){const r=e.elem;return{type:"div",caption:t.CONTAINER,...n.getElementTdDiv(r),width:Ku(r.style.width),maxWidth:Ku(r.style.maxWidth),minWidth:Ku(r.style.minWidth),height:Ku(r.style.height),valign:r.style.verticalAlign??"",align:r.style.textAlign??"",direction:r.getAttribute("dir")??"none"}}function gA(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 hK(e){return e.tagName==="TABLE"&&e.getAttribute("em")==="atom"}function bA(e,t,n){return e?{fontFamily:Ba(e.closest('[style*="font-family"]')||e),textStrong:nt(e,"strong","b")||zu(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:pK(e),textUnderline:gK(e)}:{}}function pK(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 gK(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 bK(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=ze({elem:e.elem}),s=e.elem.querySelector("td"),a=n.getElementTdDiv(s),l=r?bA(o,r,n):{};return{type:"td",caption:t.ELEMENT,...a,mobileWidth:gA(i.mobileWidth,i.mobileWidthDim),direction:s?.getAttribute("dir")??"none",elementName:r?"List":"",...l}}function yK(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=ze({elem:r}),l=r?.querySelector("td"),c=n.getElementTdDiv(l),u=i?bA(i,o,n):{};return{settings:{type:"td",caption:t.ELEMENT,...c,mobileWidth:gA(a.mobileWidth,a.mobileWidthDim),direction:l?.getAttribute("dir")??"none",elementName:s?"List":"",...u},editTargetTd:l,shouldResetProgrammaticSelection:!0}}function yA(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function vK(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function vA(e){return e?{value:parseFloat(e),dim:e.includes("%")?"%":"px"}:{value:null,dim:"px"}}function EK(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 SK(e,t){const n=e.elem,r=ze({elem:n}),o=n.firstElementChild,i=o?ze({elem:o}):null,s=yA(r.mobileWidth),a=i?yA(i.mobileWidth):null;return{type:"floatBlock",caption:t.FLOAT_BLOCK,width:vK(o?.getAttribute("width")),gap:{value:EK(n),dim:"px"},maxWidth:vA(n.style.maxWidth),minWidth:vA(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 EA(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 tg(e){return e.getAttribute("src")}function wK(e,t){const n=Kf(e.elem),r=tg(n),o=ze({elem:n}),i=n.closest("td"),s=i?ze({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:SA(n,"width"),height:SA(n,"height"),alt:n.getAttribute("alt")??"",title:n.getAttribute("title")??"",align:i?.getAttribute("align")??"undefined",valign:n.style?.verticalAlign??"undefined",border:Au(n),borderRadius:Di(n),boxShadow:ka(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 Ha(e.elem)&&(u.showOnMobile=!0),i&&(u.maxWidth=Math.round(i.getBoundingClientRect().width)),u}function SA(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function wA(e){return e.tagName==="IMG"||e.tagName==="AMP-IMG"}function _K(e){return e.classList.contains("em-countdown")}function CK(e){return e.classList.contains("em-video")}function $a(e){const t=String(e??"").trim();return t?G(t)??t:""}var ng={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function TK(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 AK(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 rg(e){return e.closest('table[em-type="social"]')}function kK(e){const t=e.ownerDocument;return t?Array.from(t.querySelectorAll('table[em-type="social"]')).indexOf(e):-1}function _A(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r&&ve(r))return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r&&ve(r))return r}return null}function Gi(e){if(!e||!ve(e))return"";const t=e.style?.backgroundColor?.trim()??"";return!t||t==="transparent"||t==="rgba(0, 0, 0, 0)"?"":t}function Gn(e,t){return e.hasAttribute(t)||e.hasAttribute(`data-${t}`)}function og(e,t){return e?e.getAttribute(t)??e.getAttribute(`data-${t}`):null}function LK(e){if(!ve(e))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 NK(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(ve(r)&&ve(i)&&Gn(r,"em-platform")&&Gn(i,"em-platform")&&ve(o)&&!Gn(o,"em-platform")){const s=LK(o);if(s!=null){t.gap=s;return}}}}function CA(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 xK(e,t){const n=_A(e)?.getAttribute("align")?.trim().toLowerCase();(n==="left"||n==="right"||n==="center")&&(t.align=n)}function OK(e,t){for(const n of e){if(!ve(n)||!Gn(n,"em-platform"))continue;const r=CA(n.getAttribute("style"));if(r!=null){t.borderRadius=r;return}const o=CA(n.querySelector("img")?.getAttribute("style")??null);if(o!=null){t.borderRadius=o;return}}}function RK(e,t){for(const n of e){if(!ve(n))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 MK(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=Gi(r),s=Gi(o&&ve(o)?o:null),a=Gi(e.querySelector("[em-social-tray], [data-em-social-tray]")),l=Gi(t),c=Gi(e),u=i||s||a||l||c;u&&(n.bgEnabled=!0,n.bgColor=u)}function PK(e){const t=_A(e);if(!t||!ve(t))return"";const n=Gi(t);return n||(t.getAttribute("bgcolor")?.trim()??"")}function ig(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 IK(e,t){const n=ig(e);n&&(t.borderWidth=n.w,t.borderColor=n.color)}function DK(e){const t=e.closest("td[em-platform], td[data-em-platform]");if(t)return!!rg(t);const n=e.closest("td"),r=n?.previousElementSibling,o=n?.nextElementSibling;return!!(n&&!Gn(n,"em-platform")&&r&&o&&ve(r)&&ve(o)&&Gn(r,"em-platform")&&Gn(o,"em-platform")&&rg(n))}function BK(e,t){const n=rg(e.elem);if(!n)return{type:"social",caption:t.SOCIAL??"Social media",...ng,hostCellBgForIconLuminance:"",blockIndex:-1,items:[]};const r={...ng};xK(n,r),IK(n,r);const o=n.querySelector('table[role="presentation"]')||n.querySelector("table");MK(n,o,r);const i=o?.querySelector("tr"),s=i?Array.from(i.querySelectorAll(":scope > td")):[],a=s.filter(m=>ve(m)&&Gn(m,"em-platform")),l=a.length>0?a:s.filter(m=>m.querySelector("img"));NK(s,r),OK(l,r),RK(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&&ve(u)?ig(u):null;if(d)c=d.w;else for(const m of l){if(!ve(m))continue;const p=ig(m);if(p){c=p.w;break}}let f=l.map(m=>{if(!ve(m))return{platform:"unknown",customIcon:!1,href:"",alt:"",title:"",iconSrc:"",iconWidth:null,iconHeight:null,buttonBgColor:"",itemBorderColor:""};const p=m,b=og(p,"em-platform")||"unknown",C=Gn(p,"em-custom-icon"),L=p.querySelector("a"),k=p.querySelector("img"),y=L?.getAttribute("href")??"",g=L?.getAttribute("title")??k?.getAttribute("title")??"",E=k?.getAttribute("alt")??"",_=k?.getAttribute("src")??"",S=TK(k instanceof HTMLImageElement?k:null),v=k?.getAttribute("height")?.trim(),T=v?parseInt(v,10):NaN,w=!Number.isNaN(T)&&T>0,N=og(p,"em-button-bg")?.trim()??"",x=!C&&Gn(p,"em-tray-cell-bg");let D="",P="";if(!C&&(D=N,!D&&!x&&p.style?.backgroundColor&&(D=p.style.backgroundColor.trim()),P=og(p,"em-item-border-color")?.trim()??"",!P)){const O=p.style.border?.trim()??"",z=/^(\d+)px\s+solid\s+(.+)$/i.exec(O);z?.[2]&&(P=z[2].trim())}return{platform:b,customIcon:C,href:y,alt:E,title:g,iconSrc:_,iconWidth:S,iconHeight:w?T:S,buttonBgColor:D,itemBorderColor:P}});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=AK(f,ng.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(PK(n)),blockIndex:kK(n),items:f.map(m=>({...m,buttonBgColor:$a(m.buttonBgColor),itemBorderColor:$a(m.itemBorderColor)}))}}function TA(e){return e.tagName==="TBODY"&&Array.from(e.childNodes).every(AA)}function HK(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function AA(e){return e.nodeType===Node.COMMENT_NODE}function dn(e){if(e.tagName!=="TABLE")return!1;const t=Array.from(e.childNodes).filter(r=>!AA(r));if(t.length===0)return!0;const n=t.filter(r=>!HK(r));return n.length===1&&n[0]instanceof Element&&TA(n[0])}function sg(e=document){for(const t of Array.from(e.querySelectorAll("table")))if(dn(t))return t;return null}function ag(){const e=nm(document,'[em="group"]');return nm(e||document,'[em="block"]')}function yr(e){const t=e.children.length===1?e.children[0]:null;return t&&TA(t)?t:e}function FK(e,t){const n=e.getAttribute(t);return!n||n==="auto"?{value:null,dim:"px"}:{value:parseFloat(n),dim:n.includes("%")?"%":"px"}}function kA(e,t){const n=e.style[t];return n?{value:parseFloat(n),dim:n.includes("%")?"%":"px"}:{value:null,dim:"px"}}function $K(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function WK(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 qK(e,t){const n=e.elem;if(dn(n))return{type:"emptyTable",caption:t.TABLE};n.setAttribute("em-edit","active");const r=ze({elem:n}),o={type:"table",caption:t.TABLE,backgroundColor:n.style.backgroundColor?G(n.style.backgroundColor):"",backgroundImage:WK(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:FK(n,"width"),maxWidth:kA(n,"maxWidth"),minWidth:kA(n,"minWidth"),align:n.getAttribute("align")??"",border:Au(n),boxShadow:ka(n),borderRadius:Di(n),mobileWidth:{value:$K(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:Na(n,"around")};return Ha(n)&&(o.showOnMobile=!0),o}function zK(e){return e.tagName==="TABLE"&&e.getAttribute("em")!=="atom"}function UK(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 jK(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 VK(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 GK(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 XK(e){const t={items:[],gap:null,gapMobile:null,valign:"",wrap:void 0,dirRevers:!1,mobile:null,mobileValign:null},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=ze({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")||"",t.mobile=r.parentElement?Ui(r.parentElement):null,t.mobileValign=r.parentElement?Gp(r.parentElement):null,(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 KK(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 YK(e,t,n){const r=e.elem,o={...n.getElementTdDiv(r),direction:r.getAttribute("dir")??"none"};return o.floatBlocks=XK(r),o.isContrastBlock=!!r.closest(".em-contrast-block"),{type:"structure",caption:t.STRUCTURE,settings:o}}function ZK(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 QK(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 LA(e){return Le(e,!0).flatMap(QK)}function Xi(e,t){e.replaceChildren(...LA(t))}function JK(e){return e.nodeType===Node.TEXT_NODE&&!e.textContent?.trim()}function Wa(e,t){const n=LA(t),r=n.filter(s=>!JK(s)),[o]=r,i=r.length===1&&o.nodeType===Node.ELEMENT_NODE&&o.tagName==="TABLE";e.replaceChildren(...i?Array.from(o.childNodes):n)}function eY(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)}}),Ze(r)}function tY(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");i&&(i.innerHTML=t)}}),Ze(n)}function nY(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("color"))){const l=a.map(c=>c.startsWith("color")?`color: ${t};`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} color: ${t};`:`color: ${t};`)}}}),Ze(n)}function rY(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(l=>l.trim()).filter(l=>l);if(a.some(l=>l.startsWith("font-size"))){const l=a.map(c=>c.startsWith("font-size")?`font-size: ${t}px;`:c);i.setAttribute("style",l.join("; "))}else i.setAttribute("style",s?`${s} font-size: ${t}px;`:`font-size: ${t}px;`)}}}),Ze(n)}function oY(e,t){if(typeof t!="boolean")throw new Error("Invalid isBold value: must be a boolean");const n=t?"bold":"normal",r=document.createElement("div");return ke(r,e),r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-weight"))){const c=l.map(u=>u.startsWith("font-weight")?`font-weight: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-weight: ${n};`:`font-weight: ${n};`)}}}),Ze(r)}function iY(e,t){if(typeof t!="boolean")throw new Error("Invalid isItalic value: must be a boolean");const n=t?"italic":"normal",r=document.createElement("div");return ke(r,e),r.querySelectorAll("tr").forEach(o=>{const i=o.querySelector("td:first-child");if(i){const s=i.querySelector("div");if(s){const a=s.getAttribute("style")||"",l=a.split(";").map(c=>c.trim()).filter(c=>c);if(l.some(c=>c.startsWith("font-style"))){const c=l.map(u=>u.startsWith("font-style")?`font-style: ${n};`:u);s.setAttribute("style",c.join("; "))}else s.setAttribute("style",a?`${a} font-style: ${n};`:`font-style: ${n};`)}}}),Ze(r)}function sY(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldUnderline value: must be a boolean");const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("line-through")?u="underline line-through":u="underline":l.includes("line-through")?u="line-through":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),Ze(n)}function aY(e,t){if(typeof t!="boolean")throw new Error("Invalid shouldStrikethrough value: must be a boolean");const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelector("td:first-child");if(o){const i=o.querySelector("div");if(i){const s=i.getAttribute("style")||"",a=s.split(";").map(d=>d.trim()).filter(d=>d);let l="none";const c=a.findIndex(d=>d.startsWith("text-decoration"));if(c!==-1){const d=a[c].match(/^text-decoration\s*:\s*(.*)$/);d&&(l=d[1].trim())}let u;t?l.includes("underline")?u="underline line-through":u="line-through":l.includes("underline")?u="underline":u="none",c!==-1?(a[c]=`text-decoration: ${u};`,i.setAttribute("style",a.join("; "))):i.setAttribute("style",s?`${s} text-decoration: ${u};`:`text-decoration: ${u};`)}}}),Ze(n)}function lY(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 cY(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 uY(e){if(!e||!ve(e))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=lY(e),s=cY(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 NA(e){const t=e.cloneNode(!0);on(e,t);const n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let r;for(;r=n.nextNode();)r.nodeValue="";return t}function lg(e){let t="";for(const n of e.attributes)t+=` ${n.name}="${n.value}"`;return t}function dY(e,t){const n=e.closest(`table.${t}`);if(!n)return null;const r=n.querySelector("tbody"),o=Ze(r??n).trim(),i=e.closest("tr");if(!i)return{rowHtml:o,firstCellText:"",secondCellText:"",firstCellHtmlNoText:"",secondCellHtmlNoText:"",secondCellWrapperHtml:"",secondCellInnerDivHtml:"",wrappedSecondCellHtml:"",secondCellInnerDivWrapperHtml:"",secondCellTextHTML:""};const s=i.querySelectorAll("td"),a=s[0]||null,l=s[1]||null,c=a?a.textContent.trim():"",u=l?l.textContent.trim():"",d=l?Ze(l).trim():"",f=a?Lr(NA(a)):"",h=l?Lr(NA(l)):"",m=l?`<td${lg(l)}></td>`:"",p=l?l.querySelector("div"):null;return{rowHtml:o,firstCellText:c,secondCellText:u,firstCellHtmlNoText:f,secondCellHtmlNoText:h,secondCellWrapperHtml:m,secondCellInnerDivHtml:p?Lr(p):"",wrappedSecondCellHtml:l&&p?`<td${lg(l)}>${Lr(p)}</td>`:"",secondCellInnerDivWrapperHtml:p?`<div${lg(p)}></div>`:"",secondCellTextHTML:d}}function xA(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function OA(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=xA(t)||" ":r.insertAdjacentText("afterbegin",xA(t)),Lr(r)}function Ki(e){const t=document.createElement("template");return ke(t,e),t.content.querySelectorAll("editor").forEach(n=>{n.replaceWith(...Array.from(n.childNodes))}),t.content.querySelectorAll('[em-edit="active"]').forEach(n=>{n.removeAttribute("em-edit")}),Ze(t)}function RA(e){e.removeAttribute("id"),e.querySelectorAll("[id]").forEach(t=>t.removeAttribute("id"))}function fY(e,t,n,r=!0){const o=document.createElement("template");ke(o,e.trim());const i=o.content.querySelector(`div.${n}`);if(i){const s=i.closest("tr");if(s){const a=r?"beforebegin":"afterend";s.insertAdjacentHTML(a,t)}}return Ze(o)}function mY(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 hY(e){return e.map(t=>({...t,cellOneText:t.cellOneText===""?" ":t.cellOneText,cellTwoText:t.cellTwoText===""?" ":t.cellTwoText}))}function pY(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 cg(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=pY(hY(mY(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 gY(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes))),e.querySelectorAll('[em-edit="active"]').forEach(t=>t.removeAttribute("em-edit"))}function bY(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);on(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 yY(e,t,n,r){const o=new DOMParser().parseFromString(e,"text/html");Ud(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?Lr(l):e}function vY(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="&nbsp;",s.appendChild(l)}else a.forEach(l=>{let c=Ge(l).trim();!c||c.replace(r,"")===""?l.innerHTML="&nbsp;":(c=c.replace(r,""),c.endsWith("&nbsp;")||(c+="&nbsp;"),c=c.replace(/&nbsp;+$/,"&nbsp;"),Xi(l,c))})})}function EY(e){const t=`<table><tbody><tr>${e}</tr></tbody></table>`,n=new DOMParser().parseFromString(t,"text/html");Ud(n,t);const r=n.querySelector("div");r&&(r.classList.add("remove-new-editor-element"),r.innerHTML.trim()?r.insertAdjacentHTML("beforeend","&nbsp;"):r.innerHTML="&nbsp;");const o=n.querySelector("td");return o?Lr(o):""}function SY(e,t){const n=document.createElement("div");return ke(n,e),n.querySelectorAll("tr").forEach(r=>{const o=r.querySelectorAll("td");if(o.length>1){const i=o[1],s=(i.getAttribute("class")||"").split(" ").map(l=>l.trim()).filter(l=>l!=="");s.includes(t)||s.push(t);const a=s.join(" ");i.setAttribute("class",a)}}),Ze(n)}var ug="em-element-list-ol",dg="em-element-list-ul",wY="em-element-list-bullet",_Y=`.${ug}, .${dg}`,CY=["DIV","P","TD","H1","H2","H3","H4","H5","H6"],TY="div, p, td, h1, h2, h3, h4, h5, h6",Xn={LIST:"margin: 0; padding: 0 0 0 20px;",LIST_ITEM:"padding-bottom: 5px;"},qa=null;function fg(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 qa&&qa.container.isConnected&&e.contains(qa.container)?qa:null}function AY(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 kY(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);on(n,r),t.appendChild(r)}),ii(t),Ze(t)}function mg(e,t){const n=fg(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 MA(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 LY(e,t){const n=window.getSelection();if(!n||n.rangeCount===0){const a=mg(e,t);return{start:a,end:a}}const r=n.getRangeAt(0);if(r.collapsed){const a=mg(e,t);return{start:a,end:a}}const o=mg(e,t),i=MA(e,r.startContainer,t,o),s=MA(e,r.endContainer,t,o);return{start:Math.min(i,s),end:Math.max(i,s)}}function PA(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 NY(e){e.querySelectorAll("editor").forEach(t=>t.replaceWith(...Array.from(t.childNodes)))}function IA(e){return e.nodeType===Node.TEXT_NODE&&/^[\t\n\f\r ]*$/.test(e.data)}function DA(e,t){const n=BA(t);if(n.length===0){e.append(" ");return}e.append(...n),NY(e)}function BA(e){let t=0,n=e.length-1;for(;t<=n&&IA(e[t]);)t++;for(;n>=t&&IA(e[n]);)n--;return e.slice(t,n+1)}var xY=["color","background-color","font-family","font-size","font-weight","font-style","text-decoration"];function OY(e){const t=BA(Array.from(e.childNodes)),n=document.createElement("span");return xY.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 Zu(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 Qu(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 HA(e,t,n){const r=Zu(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?`${Xn.LIST} ${i}`:Xn.LIST),o.append(...Array.from(t.childNodes)),t.replaceWith(o),Qu(e,r)}function RY(e){return e.querySelector("br")!==null}function MY(e){const t=fg(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 PY(e){const t=fg(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)}qa={container:h,offset:0}}function IY(e,t){const n=PA(e),r=t?"ol":"ul";if(n.querySelector("ol, ul")){const o=MY(n);if(o){o.tagName.toLowerCase()!==r&&HA(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&&HA(n,i,r);return}}RY(n)||n.querySelector(":scope > ol, :scope > ul")?(PY(n),DY(n,r)):FA(n,r)}function FA(e,t){const n=Zu(e),r=document.createElement(t);r.setAttribute("style",Xn.LIST);const o=document.createElement("li");o.setAttribute("style",Xn.LIST_ITEM),DA(o,Array.from(e.childNodes)),r.appendChild(o),e.replaceChildren(r),Qu(e,n)||$A(o)}function DY(e,t){const n=kY(e);if(n.length===0){FA(e,t);return}const{start:r,end:o}=LY(n,e),i=Zu(e),s=document.createElement(t);s.setAttribute("style",Xn.LIST);let a=null;for(let h=r;h<=o;h++){const m=document.createElement("li");m.setAttribute("style",Xn.LIST_ITEM),DA(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),!Qu(e,i)&&a&&$A(a)}function $A(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 BY(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 HY(e,t){const n=AY(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 FY(e){const t=PA(e),n=t.querySelector("ol, ul");if(!n)return;const r=Zu(t),o=BY(t,n),i=document.createDocumentFragment();n.querySelectorAll(":scope > li").forEach(s=>{const a=Ge(s).trim();!a||a==="&nbsp;"||(i.hasChildNodes()&&i.appendChild(document.createElement("br")),i.append(...OY(s)))}),n.replaceWith(i.hasChildNodes()?i:" "),Qu(t,r)||HY(t,o)}function Ju(e){if(!e)return!1;const t=e.closest("ul, ol");return t?!t.closest(_Y):!1}function $Y(e,t,n){const r=jX()||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=ze({elem:l}),d=ze({elem:c}),f=WA(e.elem,n),h=nt(o,"strong","b"),m=s!==o?nt(s,"strong","b"):!1,p=e.elem&&o&&e.elem.isConnected&&(o===e.elem||o.contains(e.elem))?nt(e.elem,"strong","b"):!1,b=h||m||p,C=zu(s),L=b||C,k={type:"text",caption:t.TEXT,fontFamily:Ba(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:qu(a),lineHeightDim:"px",textAlign:nA(e.elem),textStrong:L,textItalic:nt(e.elem,"i","em")||!s.closest('[style*="font-style: normal"]')&&s.style?.fontStyle==="italic",textStrikethrough:nt(e.elem,"s","strike")||(s.style?.textDecoration?.includes("line-through")??!1),textUnderline:nt(e.elem,"u")||(s.style?.textDecoration?.includes("underline")??!1)||!s.style?.textDecoration&&(e.elem.tagName==="A"&&e.elem.hasAttribute("href")||rA()),textColor:Ju(r)&&G(Jr(r,"color"))||G(e.elem.closest('[style*="color"]')?.style.color)||G(getComputedStyle(e.elem).color)||"",textBackgroundColor:UY(e.elem),mobileFontSize:{value:u.mobileFontSize,dim:u.mobileFontSizeDim||"px"},mobileLineHeight:{value:d.mobileLineHeight,dim:"px"},mobileTextAlign:Yp(e.elem),linkHref:(()=>{const y=s.closest("a");if(!y)return;const g=y.getAttribute("href");if(g!==null)return g})(),textAnchor:(()=>{const y=s.closest("a");if(y&&!y.hasAttribute("href"))return y.getAttribute("name")?.trim()||void 0})(),textLink:(()=>{const y=s.closest("a");return y?!!y.hasAttribute("href"):nt(e.elem,"a")||rA()})(),textReplacer:n.variableElement(e.elem),list:f,standardList:qA(e.elem),textSuperscript:nt(e.elem,"sup"),textSubscript:nt(e.elem,"sub")};return Ha(r)&&(k.showOnMobile=!0),k}function WA(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?Ba(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|&nbsp;/g,""):""}}function qA(e){return Ju(e)?{listTypeOL:!!e.querySelector("ol")||!!e.closest("ol"),listTypeUL:!!e.querySelector("ul")||!!e.closest("ul")}:{listTypeOL:!1,listTypeUL:!1}}function hg(e){if(!e)return!1;const t=e.trim().toLowerCase();return t!=="transparent"&&t!=="inherit"}var WY=new Set(["A","B","EM","I","MARK","S","SMALL","SPAN","STRIKE","STRONG","SUB","SUP","U"]);function qY(e){let t=e;for(;t&&WY.has(t.tagName);){const n=t.style.backgroundColor;if(hg(n))return n;t=t.parentElement}return""}function zY(e,t,n){let r=e;for(;r;){const o=r.style.getPropertyValue(t);if(hg(o))return o;if(n&&r===n)break;r=r.parentElement}return""}function UY(e){const t=qY(e);if(hg(t))return G(t)||"";if(e.closest(".em-element-custom-table"))return G(Jr(e,"background-color"))||"";const n=e.closest("div");return G(zY(e,"background-color",n))||""}function zA(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 jY(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=ze({elem:d}),m=ze({elem:f}),p=WA(e.elem,n),b={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:Ba(e.elem),fontSize:parseFloat(e.elem.closest('[style*="font-size"]')?.style.fontSize)||0,fontSizeDim:"px",lineHeight:qu(e.elem),lineHeightDim:"px",textAlign:nA(e.elem),textStrong:nt(u,"strong","b")||zu(u),textItalic:nt(u,"i","em")||!e.elem.closest('[style*="font-style: normal"]')&&e.elem.style?.fontStyle==="italic",textStrikethrough:nt(u,"s","strike")||(e.elem.style?.textDecoration?.includes("line-through")??!1),textUnderline:nt(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"?Jr(e.elem.querySelector('[style*="color"]'),"color"):Jr(e.elem,"color"))||G(getComputedStyle(e.elem).color)||"",textBackgroundColor:G(e.elem.tagName==="A"?Jr(e.elem.querySelector('[style*="background-color"]'),"background-color"):Jr(e.elem,"background-color"))||"",mobileFontSize:{value:h.mobileFontSize,dim:h.mobileFontSizeDim||"px"},mobileLineHeight:{value:m.mobileLineHeight,dim:"px"},mobileTextAlign:Yp(e.elem),textReplacer:i(e.elem),list:p,standardList:qA(e.elem),textSuperscript:nt(e.elem,"sup"),textSubscript:nt(e.elem,"sub")};return Ha(e.elem)&&(b.showOnMobile=!0),b}function UA(e){return e===null||e==="auto"?null:typeof e=="number"?e:null}function VY(e,t){const n=e.elem,r=ze({elem:n}),o=UA(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 GY(e,t){const n=e.elem,r=ze({elem:n}),o=UA(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 jA(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 VA(e){return e.tagName!=="DIV"?!1:!e.style.fontFamily&&!!e.style.height&&!!e.style.lineHeight&&!!e.style.fontSize}function XY(e,t){return e.elem.tagName==="TD"?VY(e,t):GY(e,t)}var GA={START_POSITION:"remove-start-element-position",NEW_EDITOR:"remove-new-editor-element",ACTIVE_ELEMENT:"remove-active-element"},XA={TRIM_SPACES:/^(\s|&nbsp;)+|(\s|&nbsp;)+$/g,LT:/&lt;/g,GT:/&gt;/g,EMPTY_TEXT:/^(?:\s|&nbsp;)*$/};function KA(e,t){if(!e)return!1;const n=e.closest("tr");return n?n.closest("table")?.classList.contains(t)??!1:!1}function ed(e){const t=KA(e,ug),n=KA(e,dg),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:ug,classNameUl:dg,classNameBullet:wY,isListOL:t,isListUL:n,isList:r,listType:t?"ol":n?"ul":null,tableElement:o}}function KY(e){if(!e)return null;const t=e.closest("tr");return t?t.querySelector("td:first-child div:first-child"):null}function YY(e){return e?e.querySelector(".em-element-list-ol")||e.querySelector(".em-element-list-ul"):null}function ZY(e=Object.values(GA)){e.forEach(t=>{document.querySelectorAll(`.${t}`).forEach(n=>{n.classList.remove(t)})})}function QY(e){for(const t of e.classList)if(t.startsWith("em-element-"))return!1;return!0}function YA(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&&YA(n,t)}}function JY(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 eZ(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 tZ(e){if(!e)return null;try{return e.rangeCount>0?e.getRangeAt(0):null}catch{return null}}var nZ="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub";function rZ(e,t=nZ){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 oZ(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 iZ(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 sZ(e,t,n,r){if(!document.body.classList.contains("mceNonEditable")&&!(!t&&n)){if(r.removeAllAttributes("em-edit"),e.tagName!=="TABLE"){Kf(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 aZ(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 lZ(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=bp(n)??n),n}function cZ(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 uZ(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 dZ(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"&&Ju(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(uZ(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 fZ={_isCarouselElement:Qp,_isAccordionElement:J0,_isSocialBlockElement:DK,_isImageElement:wA,_isLinkElement:YX,_isButtonElement:Fa,_isTableElement:zK,_isCustomTableElement:hA,_isAtomElement:hK,_isTdColumnGroup:UK,_isTdStructure:jK,_isEmptyTd:VK,_isTdCell:GK,_isVindentTd:jA,_isVindentDiv:VA,_isFloatBlockElement:EA,_isDivTextElement:zA,_isInlineButtonElement:ZX,_extractTextSettings:$Y,_extractCarouselSettings:QX,_extractAccordionSettings:IX,_extractSocialSettings:BK,_extractImgSettings:wK,_extractButtonSettings:KX,_extractLinkTextSettings:jY,_extractTableSettings:qK,_extractCustomTableSettings:dK,_extractAtomElementSettings:bK,_extractProgrammaticElementSettings:yK,_extractTdColumnGroupSettings:KK,_extractTdStructureSettings:YK,_extractTdCellSettings:ZK,_extractVindentSettings:XY,_extractFloatBlockSettings:SK,_extractDivContainerSettings:mK,_clearActiveEditElements:N3};function mZ(e){const t=e.programmaticSelection??{get:()=>!!V.get("isProgrammaticSelection"),reset:()=>V.set("isProgrammaticSelection",!1)},n=fK(),r=()=>{const i={operation:"application_element_settings_set",settings:e.getMapObj().unescape({parent:void 0,nextElem:!1,prevElem:!1}),type:null};j.send(i)},o=i=>{if(e.selectionLock.isLocked())return;const s=i.elem??document.querySelector("[em-edit]"),a=e.selectionLock.acquire();try{if(Mr("em-edit"),!s){setTimeout(()=>{const y=document.querySelector("[em-edit]");y?.isConnected?o({elem:y}):r()},0);return}if(s.closest(".em-prevent-action"))return;const l=lZ(s,{getVariableByIcon:Ca,htmlDocument:e.htmlDocument,findOutermostParentWithText:Em,sendResizeEvent:m0}),c=l.tagName==="EDITOR"&&l.firstChild?.nodeType===1?l.firstChild:l,u=ed(l),d=window.getSelection()?.isCollapsed??!0;sZ(l,d,!!l.querySelector("editor"),{removeAllAttributes:Mr});const f={...fZ,HTMLDocument:e.htmlDocument,parseFromString:Le,getParentElementOfSelection:dc,getSelectedText:tt,findElementWithSelectedText:zs,parseTableElementToModel:Hi,tableKey:n,isElementHasBold:w3,Locale:Vi(),isProgrammaticSelection:t.get(),getElementTdDiv:_X,getLineHeghtInPixels:qu,getFontFamilyFromElement:y=>eZ(y,c),textHasStyle:nt,activeCell:V.get("activeCell"),CLASS_FOR_BASIC_CELL:Co,requestElemWithStyle:c},h=cZ({elem:l,isCellCustomTable:!!l.closest(".em-element-custom-table"),listContext:{isListOL:u.isListOL,isListUL:u.isListUL,isList:u.isList},requestElemBullet:u.isList?KY(l):null,variableElement:(y,g=!1)=>aZ(g,{getSelectedText:tt,getRangeFromSelection:tZ})},f),m=dZ(l,d,h),p={operation:"application_element_settings_set",type:m.type,caption:m.caption,settings:m.settings},b=iZ(l,m,p,{removeAllAttributes:Mr});if(b.isProgrammaticSelectionReset&&t.reset(),b.shouldReturn)return;const C=oZ({elem:l,message:p,activateSection:i.activateSection},{getElementParentCaption:Q0,getStructureColumns:CX,getUsedColors:w0,getElementPath:PX,getCurrentElementPath:NX,mapObj:e.getMapObj(),commonStyles:V.get("commonStyles"),...e.enrichExtras()});V.update({elementPath:C.elementPath});const L=e.elementRefOf?.(l),k=L===void 0?C.message:{...C.message,elementRef:L};return e.fingerprint.remember(l),j.send(k),k}finally{Promise.resolve().then(()=>{try{e.fingerprint.remember(document.querySelector("[em-edit]"))}finally{a.release()}})}};return o}function ZA(){return V.get("emailWidth")}function hZ(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 pg(e){const t=document.createElement("table");return t.replaceChildren(...Le(e,!0)),t}function gg(e){const t=[...e.children].filter(r=>r.tagName==="TR");if(t.length)return t.map(r=>Dt(r)).join(`
96
+ `);const n=e.querySelector("tr");return n?Dt(n):xt(e)}function bg(e,t){const n=ZA(),r=pg(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)),mc({elem:a,width:f})});else{const s=r.querySelector('div[style*="inline-block"]');s.style.maxWidth=o+"px",mc({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=AS(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(!hZ(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,b=0;a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const y=parseFloat(k.getAttribute("width"))/i,g=Math.round(parseFloat(String(o*y))-h/(m*2));k.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(k=>{if(k.getAttribute("width")&&!k.classList.contains("em-insert-ignore")){const y=parseFloat(k.getAttribute("width"))+Math.round(C/m);b+=y,k.setAttribute("width",String(y)),k.querySelector("img")&&k.querySelectorAll("img").forEach(g=>{parseFloat(g.getAttribute("width")||"0")>parseFloat(k.getAttribute("width"))+Math.round(C/m)&&(g.setAttribute("width",k.getAttribute("width")),g.style.maxWidth=k.getAttribute("width")+"px")})}}),b=b+h*(m-1)+u+d;const L=o-b;if(L!==0&&p>0){const k=a.querySelector(".em-mob-wrap:last-child, .noresp-em-mob-wrap:last-child");if(k&&!k.classList.contains("em-insert-ignore")){const y=parseFloat(k.getAttribute("width")||"0");k.setAttribute("width",String(y+L))}else{const y=a.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)");for(let g=y.length-1;g>=0;g--){const E=y[g];if(E.classList.contains("em-insert-ignore"))continue;const _=parseFloat(E.getAttribute("width")||"0");E.setAttribute("width",String(_+L));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 gg(r)}function yg(e){const t=pg(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"))})}),gg(t)}function vg(e,t){const n=ZA(),r=pg(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",mc({elem:s,width:o})),gg(r)}function td(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 QA(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 pZ(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 gZ(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 JA(e){return Array.from(e.rows).flatMap(t=>Array.from(t.cells))}function ek(e,t,n){const r=e.findIndex(i=>i.contains(t));if(r<0||t.nodeType!==Node.TEXT_NODE)return null;const o=gZ(e[r],t,n);return o<0?null:{cell:r,offset:o}}function bZ(e){const t=window.getSelection();if(!t?.rangeCount)return null;const n=t.getRangeAt(0),r=JA(e),o=ek(r,n.startContainer,n.startOffset),i=ek(r,n.endContainer,n.endOffset),s=!!n.startContainer.parentElement?.closest("editor");return o&&i?{start:o,end:i,inEditor:s}:null}function yZ(e,t,n){const r=JA(e),o=r[t.start.cell]?.querySelector(":scope > div");t.inEditor&&o&&n&&n(o,!0);const i=({cell:u,offset:d})=>r[u]?QA(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 eo(e,t){return t===void 0?{rejected:e}:{rejected:e,key:t}}function vZ(e){return"rejected"in e}function nd(e){return{status:"rejected",reason:e.rejected,...e.key===void 0?{}:{key:e.key}}}function EZ(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 tk(e,t,n){if(t.isEditLocked())return nd(eo("locked"));const r=e.outerHTML,o=e.cloneNode(!0),i=n.movesCells?null:bZ(e),s=()=>{i&&yZ(e,i,t.wrapEditor)},a=()=>{EZ(e,o),s()};try{const l=n.edit(e);return vZ(l)?(e.outerHTML!==r&&a(),nd(l)):(Wa(e,t.tableModelToHtml(l)),s(),n.afterWrite?.(e),{status:"applied"})}catch(l){throw a(),l}}var nk=["top","right","bottom","left"],rk={cell_borderAll:"all",cell_borderTop:"top",cell_borderRight:"right",cell_borderBottom:"bottom",cell_borderLeft:"left"},Eg={paddingTop:["top"],paddingRight:["right"],paddingBottom:["bottom"],paddingLeft:["left"],paddingLeftRight:["left","right"],paddingTopBottom:["top","bottom"]},SZ={top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"},ok=e=>t=>[[e,At(t)??0]];function ik(e){const t=e??{};return nk.map(n=>[SZ[n],At(t.all??t[n])??0])}function sk(e){const t=At(e.width);return{...t===null?{}:{width:t},...qe(e.style)?{}:{style:e.style},...qe(e.color)?{}:{color:Vn(e.color)}}}function wZ(e){return Jp(e)||e.width===0||e.color===""}function _Z(e){return(t,n,{ids:r,ctx:o})=>{const i=n??{},s=o.getExternalBorders(t,r),a=rk[e];let l=t;if(a==="all"){const u=wZ(i);for(const d of Object.keys(s))l=u?o.clearCellBorders(l,[d],nk):o.updateCellBordersByIds(l,[d],s[d],sk(i)),l=o.addClassToCellsByIds(l,[d],$r);return o.addClassToCellsByIds(l,Object.keys(s),Wr)}const c=Object.keys(s).filter(u=>s[u].includes(a));return l=Jp(i)?o.clearCellBorders(l,c,[a]):o.updateCellBordersByIds(l,c,[a],sk(i)),o.addClassToCellsByIds(l,r,Wr)}}var CZ=(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],At(t)??0),i=r.addClassToCellsByIds(i,[s],Wr);return i};function ak(e){return(t,n,{ids:r,ctx:o})=>{let i=o.addClassToCellsByIds(t,r,$r);for(const[s,a]of e(n))i=o.updateCellPaddingByIds(i,r,Eg[s],a);return o.addClassToCellsByIds(i,r,Wr)}}function lk(e){return(t,n,{ctx:r})=>e(n).reduce((o,[i,s])=>r.updateTablePadding(o,{settings:{[i]:s}}),t)}var ck={...Object.fromEntries(Object.keys(Eg).map(e=>[e,lk(ok(e))])),...Object.fromEntries(Object.keys(Eg).map(e=>[`cell_${e}`,ak(ok(e))])),padding:lk(ik),cell_padding:ak(ik),...Object.fromEntries(Object.keys(rk).map(e=>[e,_Z(e)])),cellBackgroundColor:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(r.updateTableCellBackgroundByIds(e,n,Vn(t)),n,Wr),cell_borderPosition:(e,t,{ids:n,ctx:r})=>r.addClassToCellsByIds(e,n,$r),cell_borderRadiusAll:CZ},TZ=["all","topLeft","topRight","bottomRight","bottomLeft"];function to(e){return(t,n,{settings:r,ctx:o})=>o[e]({settings:r,elem:t})}function uk(e,t){return(n,r,{ctx:o})=>{const i=r??{},s={...i,value:qe(i.value)?null:i.value};o[t]({settings:{[e]:s},elem:n})}}var AZ=(e,t,{ctx:n})=>{const r=t??{};if(qe(r.hOffset)&&qe(r.vOffset)||r.color===""){Aa(e,r.classNamePrefix||"em-mob-box_shadow-");return}n.setElementMobileBoxShadow({settings:{mobileBoxShadow:r},elem:e})},kZ=(e,t,{ctx:n})=>{const r=t??{},o=TZ.find(i=>i in r);if(o){if(At(r[o])){n.setElementMobileBorderRadius({settings:{mobileBorderRadius:r},elem:e});return}Aa(e,o==="all"?"em-mob-border_radius_":r.classNamePrefix||`em-mob-border_radius_${o}-`)}},LZ={mobileWidth:uk("mobileWidth","setElementMobileWidth"),mobileHeight:uk("mobileHeight","setElementMobileHeight"),show:to("setElementShow"),mobileBackgroundColor:to("setElementMobileBackgroundColor"),mobileBackgroundImage:to("setElementMobileBackgroundImage"),mobileBackgroundPositionX:to("setElementMobileBackgroundPositionX"),mobileBackgroundPositionY:to("setElementMobileBackgroundPositionY"),mobileBackgroundRepeat:to("setElementMobileBackgroundRepeat"),mobileBackgroundSize:to("setElementMobileBackgroundSize"),mobileBorder:to("setElementMobileBorder"),mobileBoxShadow:AZ,mobileBorderRadius:kZ},rd={topLeft:"border-top-left-radius",topRight:"border-top-right-radius",bottomRight:"border-bottom-right-radius",bottomLeft:"border-bottom-left-radius"},NZ={"background-size":"cover","background-repeat":"no-repeat","background-position":"center"};function Sg(e){const t=At(e.getAttribute("border"));t&&fA(e,"all",{width:t,style:"solid",color:e.getAttribute("bordercolor")||null}),["border","bordercolor","border-collapse"].forEach(n=>e.removeAttribute(n))}function dk(e){["border-radius",...Object.values(rd)].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 xZ(e){return(t,n)=>{Sg(t),fA(t,ju[e],n??{}),t.style.borderCollapse||(t.style.borderCollapse="collapse")}}var OZ=(e,t)=>{const n=t??{};Sg(e);const r=At(n.all);r?Bi({elem:e,settings:{borderRadius:{all:r}}}):("all"in n&&e.style.removeProperty("border-radius"),Object.keys(rd).forEach(o=>{const i=At(n[o]);i?e.style.setProperty(rd[o],`${i}px`):("all"in n||o in n)&&e.style.removeProperty(rd[o])})),dk(e)},RZ=(e,t)=>{const n=t??{};Sg(e);const r=!qe(n.color)&&!qe(n.hOffset)&&!qe(n.vOffset)?{hOffset:At(n.hOffset),vOffset:At(n.vOffset),blurRadius:At(n.blurRadius),spreadRadius:At(n.spreadRadius),color:Vn(n.color),inset:!!n.inset}:{hOffset:null,vOffset:null};VT({elem:e,settings:{boxShadow:r}}),dk(e)},MZ=(e,t)=>{if(qe(t)){e.removeAttribute("bgcolor"),e.style.removeProperty("background-color");return}e.setAttribute("bgcolor",Vn(t)),e.style.backgroundColor&&(e.style.backgroundColor=Vn(t))},PZ=(e,t)=>{const n=t?.[0]?.value;if(qe(n)){e.removeAttribute("data-bg-image"),e.style.removeProperty("background-image");return}e.setAttribute("data-bg-image",Vn(n)),e.style.setProperty("background-image",`url('${n}')`),Object.entries(NZ).forEach(([r,o])=>{(r==="background-position"?e.style.backgroundPositionX:e.style.getPropertyValue(r))||e.style.setProperty(r,o)})};function fk(e){return(t,n)=>{const r=At(n);jT(t,{[e]:r===null?void 0:`${r}px`})}}var IZ={...Object.fromEntries(Object.keys(ju).map(e=>[e,xZ(e)])),borderRadius:OZ,boxShadow:RZ,backgroundColor:MZ,backgroundImage:PZ,backgroundPositionX:fk("backgroundPositionX"),backgroundPositionY:fk("backgroundPositionY"),backgroundSize:(e,t)=>{e.style.backgroundSize=Vn(t)},backgroundRepeat:(e,t)=>{e.style.backgroundRepeat=Vn(t)}},DZ=["fontFamily","fontSize","lineHeight","textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor","linkHref","textAlign","valign"];function BZ(e){return e?.querySelector(":scope > div, :scope > editor > div")??null}function HZ(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 mk(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 hk(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 pk(e,{settings:t,activeElement:n}){"textAlign"in t&&(t.textAlign?e.setAttribute("align",Vn(t.textAlign)):n.style?.textAlign?n.style.removeProperty("text-align"):e.removeAttribute("align")),t.valign?e.closest("td")?.setAttribute("valign",Vn(t.valign)):t.valign===""&&e.closest("td")?.removeAttribute("valign")}function gk(e,t,n,r){const{settings:o,ctx:i}=n;i.wrapEditor(e,!0),i.textStyleProperties.some(s=>s in o)&&(i.addNewRange(t?mk(e,t):r()),i.toggleTextStyle(e,{settings:o}))}function FZ(e,t){const n=HZ(e),r="linkHref"in t.settings?hk(e):null;if("linkHref"in t.settings&&!r)return eo("invalid-value","linkHref");gk(e,n,t,()=>mk(e,null)),r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),pk(e,t)}function $Z(e,t){for(const n of e){gk(n,null,t,()=>{const o=document.createRange();return o.selectNode(n),o});const r="linkHref"in t.settings?hk(n):null;r&&typeof t.settings.linkHref=="string"&&r.setAttribute("href",t.settings.linkHref),pk(n,t)}}function WZ(e,t,n){if(!t.length)return;const r=e.querySelector(`td.${To}, td.${$r}, td.${Co}`),o=(t.length===1&&r?[r]:t.map(i=>Bp(e,i))).map(BZ).filter(i=>!!i);if(t.length===1&&o.length===1)return FZ(o[0],n);$Z(o,n)}var qZ=["borderPosition","mobileBorderPosition","outlookBackground","exportAsPicture"],bk={...IZ,...LZ};function zZ(e){if(!e||typeof e!="object"||!Object.keys(e).length)return eo("empty");const t={live:[],cells:[],text:!1,forCells:!1};for(const[n,r]of Object.entries(e))if(bk[n])t.live.push([bk[n],r]);else if(ck[n])t.cells.push([ck[n],r]),t.forCells||(t.forCells=n.startsWith("cell"));else if(DZ.includes(n))t.text=!0,t.forCells=!0;else if(!qZ.includes(n))return eo("unknown-setting",n);return t}function yk(){return document.querySelector(`.${Co}, .${$r}, .${To}`)}function UZ(e){const t=e.activeElement??yk(),n=t?.closest(".em-element-custom-table");return t&&n?{table:n,activeElement:t}:null}function jZ(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 VZ(e,t){if(!e.querySelector(".remove-basic-cell"))return t.activeCell??[];document.querySelectorAll(`.${$r}`).forEach(r=>{r.classList.remove($r)});const n=t.getCellsWithClasses(t.parseTableElementToModel(e),[Co,To]);return t.state.set("activeCell",n),n}function GZ(e,t,n,r){const o=zZ(t);if("rejected"in o)return o;const i=VZ(e,r);if(o.forCells&&!i.length)return eo("no-cell");const s=jZ(n.activeElement);o.live.forEach(([c,u])=>c(e,u,{settings:t,ctx:r})),nK(e);const a=o.text?WZ(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 XZ(e,t){[Co,To].forEach(r=>{document.querySelectorAll(`.${r}`).forEach(o=>o.classList.remove(r))});const n=e.querySelectorAll(`.${Wr}`);n[0]?.setAttribute("em-edit",""),n.forEach(r=>r.classList.remove(Wr)),xa(e,t,"around")}function KZ(e,t){const n=UZ(t);return n?tk(n.table,t,{edit:r=>GZ(r,e,n,t),afterWrite:r=>XZ(r,e)}):nd(eo("no-table"))}var YZ=new Set(["alt","title","link"]);function ZZ(e,t,n){const r=Object.keys(n.settings??{});return n.type==="img"&&r.length>0&&r.every(o=>YZ.has(o))&&e.parentNode===t.parent}function QZ(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 JZ(e,t,n,r,o){const i=o.getMappedParent(e);if(!i?.isConnected||ZZ(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","")}))}}}var eQ=["top","right","bottom","left"];function tQ(e,t){const{activeElement:n}=t;let r=!1;if(!e)return r;const o=n.closest("a"),i=n.closest("td"),s=i?qr(i):null,a=o?qr(o):null,l=!!s&&!a,c=qh(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){const b=m?m.style.height||`${m.getAttribute("height")??""}px`:"";if(m&&(m.setAttribute("height",e.height.value+(e.height.dim==="px"?"":"%")),m.style.height=e.height.value+e.height.dim),p){const C=e.height;AC(p,`${C.value}${C.dim}`,b)}}else m&&(m.removeAttribute("height"),m.style.removeProperty("height")),p&&oq(p)}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",rQ(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");if(m){const p=e.padding,b=p.all!==void 0?{top:p.all,right:p.all,bottom:p.all,left:p.all}:{top:p.top,right:p.right,bottom:p.bottom,left:p.left};TC(m)&&(b.top=void 0,b.bottom=void 0);for(const C of eQ){const L=b[C];L!==void 0&&m.style.setProperty(`padding-${C}`,`${L}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"),p=n.closest("a"),b=!!p&&fa(p);p&&b&&NC(p),m&&t.setElementMobileHeight({settings:e,elem:m}),b||t.setElementMobileLineHeight({settings:e,elem:n}),e.mobileHeight.value!=null&&(Qc({elem:n,position:"top"}),Qc({elem:n,position:"bottom"})),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=Da(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&&nQ(e.textReplacer,n,t.compareStrings),e.outlookRounding===!0?Uh(n,e):e.outlookRounding===!1?Aq(n):(s||c)&&Uh(n,e),i&&xa(i,e,"inside"),r}function nQ(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 rQ(e){return e.backgroundImage?.[0]?.value??""}function oQ(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),xa(n,e,"inside"),r}var iQ=/^\s*\[if([^\]]*)\]>/i,vk=/width="[^"]*"(?![\s\S]*width=")/i;function Ek(e){return e?.nodeType===Node.COMMENT_NODE?iQ.exec(e.data)?.[1]:void 0}function Sk(e){const t=Ek(e);return t!==void 0&&/mso/i.test(t.replace(/!\s*\(?\s*mso/gi,""))}function sQ(e){const t=Ek(e);return t!==void 0&&/!\s*\(?\s*mso/i.test(t)}function od(e){const t=ur(e,!1);let n=!1;for(let r=e.previousSibling;r;r=r.previousSibling){if(sQ(r)){if(r!==t)return null;n=!0;continue}if(Sk(r))return!n||aQ.test(r.data)?r:null}return null}var aQ=/<(td|table)\b[^>]*>\s*(<!\[endif\])?\s*$/i,lQ=/<\/?(table|tr|td)\b/i;function id(e){return Sk(e)&&lQ.test(e.data)}function wk(e,t){const n=ur(t?.range(e).first??e,!1);return id(n)?n:null}function _k(e,t){return e.replace(vk,`width="${t}"`)}function cQ(e,t){const n=/width="([^"]*)"(?![\s\S]*width=")/i.exec(e);return n?wg(e,n[1].replace(/px$/i,""),t):e}function wg(e,t,n){const r=String(t).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`width="${r}(?:px)?"`,"gi"),`width="${n}"`)}function uQ(e,t,n,r){const o=vk.exec(e);return o?`${wg(e.slice(0,o.index),n,r)}width="${t}"${e.slice(o.index+o[0].length)}`:e}function Ck(e){const t=od(e.elem);t&&(t.data=cQ(t.data,e.width))}function dQ(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"&&Ck({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,Ck({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",fQ(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),xa(n,e,"around"),r}function fQ(e){return e.backgroundImage?.[0]?.value??""}function za(e){return!(!e.startsWith("#")||e.indexOf("#",1)!==-1)}function mQ(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),za(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",gQ(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))&&pQ(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&&(hQ(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}),xa(n,e,"inside"),r}function hQ(e,t,n){n.setElementMobileAlign({settings:e,elem:t});const r=e.mobileAlign?.classNamePrefix||"em-mob-text_align-";qX(t,(s,a)=>{zX(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 pQ(e,t){const n=t.activeElement,r=t.removeEditorTags(Jl(t.isElementListContainer)),o=t.addClassToSecondCell(r,"em-list-temp-class");Xi(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!=="&nbsp;"||c.innerHTML==="&nbsp;"&&(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 gQ(e){return e.backgroundImage?.[0]?.value??""}function Tk(e){const t=od(e.elem);t&&(t.data=_k(t.data,e.width))}function Ak(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 bQ(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,Tk({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,Tk({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,Ak(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 kk(e){const t=od(e.elem);t&&(t.data=_k(t.data,e.width))}function sd(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 Ua(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 _g(e){return e.querySelector('div[style*="inline-block"]')?document.querySelector('[em-edit="active"]'):e.closest('div[style*="inline-block"]')?.parentElement||null}function yQ(e,t){const n=t.activeElement;if(sd(n)){const r=Ua(n);if(!r)return;const o=qi(r);r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((i,s)=>{i.setAttribute("width",e.items[s])}),t.setPercentsForColumns(r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)")),zi(o,"follow")}else{const r=_g(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",kk({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 vQ(e,t){const n=t.activeElement;if(!sd(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=qi(r),i=r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)"),s=i.length,a=e.items.length,l=e.gap;s>=a?i.forEach((c,u)=>{if(u<a)c.setAttribute("width",e.items[u]);else{const d=c.previousElementSibling;(d?.classList.contains("em-mob-wrap")||d?.classList.contains("noresp-em-mob-wrap"))&&d?.remove(),c.remove()}}):(i.forEach((c,u)=>{c.setAttribute("width",e.items[u])}),e.items.forEach((c,u)=>{let d="";r.querySelector(".em-mob-wrap")?d=`<td width="${l}" class="em-mob-wrap"></td>
97
+ <td width="${c}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:r.querySelector(".noresp-em-mob-wrap")&&(d=`<td width="${l}" class="noresp-em-mob-wrap"></td>
98
+ <td width="${c}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`),u>=s&&d&&tr(r,"beforeend",d)})),zi(o,"follow")}function EQ(e,t){const n=t.activeElement;if(sd(n)){const r=Ua(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=_g(n);if(!r)return;r.querySelectorAll('div[style*="inline-block"]').forEach(o=>{o.style.verticalAlign=e.valign,Ak(o,o.style.verticalAlign)})}}function SQ(e,t){const n=t.activeElement;if(sd(n)){const r=Ua(n);if(!r)return;const o=qi(r);r.querySelectorAll(".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)").forEach((i,s)=>{i.setAttribute("width",e.items[s])}),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(i=>{i.setAttribute("width",e.gap)}),zi(o,"follow")}else{const r=_g(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",kk({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 wQ(e,t){const n=t.activeElement;let r=!1;const o=Ua(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}function ad(e){const t=Ua(e),n=t?Up(t):null;return n&&Vp(n)?n:null}function _Q(e,t){const n=ad(t.activeElement),r=n?Ui(n):null;!n||!r||e.items.length!==r.items.length||Ia(n,hX(r,e.items))}function CQ(e,t){const n=ad(t.activeElement),r=n?Ui(n):null;!n||!r||Ia(n,pX(r,Pa(n),e.gap))}function TQ(e,t){const n=ad(t.activeElement),r=n?Ui(n):null;!n||!r||Ia(n,gX(r,Pa(n)))}function AQ(e,t){const n=ad(t.activeElement);!n||!e.valign||SX(n,e.valign)}var Cg="amp-img";function kQ(e){const t=lA(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 Lk(e){return e==null||e===""?null:Number(e)}function LQ(e){return{src:e.src??"",alt:e.alt??"",title:e.title??"",width:Lk(e.width?.value),height:Lk(e.height?.value),link:e.link||null,imgReplacer:e.imgReplacer??""}}function Tg(e,t,n){const r=e.closest(n);return r&&r!==t&&t.contains(r)?r:null}function NQ(e,t){let n=e;for(;n.parentElement&&n.parentElement!==t;)n=n.parentElement;if(n.parentElement===t&&n.querySelectorAll(Cg).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 Nk(e){e.replaceWith(...Array.from(e.childNodes))}function xk(e,t){e.parentNode?.insertBefore(t,e),t.appendChild(e)}function xQ(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=Tg(e,t,"em-replace");if(!r.imgReplacer)o&&Nk(o);else if(o)Ht(o,"src",r.imgReplacer);else{const i=document.createElement("em-replace");Ht(i,"src",r.imgReplacer),xk(e,i)}}if(r.link!==n.link){const o=Tg(e,t,"a");if(!r.link)o&&Nk(o);else if(o)o.setAttribute("href",r.link);else{const i=document.createElement("a");i.setAttribute("href",r.link),xk(Tg(e,t,"em-replace")??e,i)}}}function OQ(e){const t=document.createElement(Cg);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 RQ(e){return e.some(t=>t.slideIndex!==void 0)?e.map(t=>t.slideIndex):e.map((t,n)=>n)}function MQ(e,t){const n=Array.from(e.querySelectorAll(Cg)),r=new Set,o=[];RQ(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),xQ(a,e,kQ(a),LQ(t[s]))}),n.filter(i=>!r.has(i)).forEach(i=>NQ(i,e).remove()),o.forEach(i=>e.appendChild(OQ(i)))}function PQ(e,t){const n=e,r=t.activeElement.closest("amp-carousel");r&&Ok(r,t,o=>IQ(o,n,t))}function Ok(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 IQ(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)&&MQ(e,t.carouselImages),"borderRadius"in t&&n.setElementBorderRadius({settings:{borderRadius:t.borderRadius},elem:e})}function DQ(e,t){const n=e,r=t.activeElement.closest("amp-accordion");r&&Ok(r,t,o=>BQ(o,n))}function BQ(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 Kn={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function HQ(e){return e.closest('table[em-type="social"]')}function Rk(e){const t=e.querySelector(":scope > tr");if(t){const r=t.querySelector(":scope > td");if(r&&ve(r))return r}const n=e.querySelector("tbody > tr");if(n){const r=n.querySelector(":scope > td");if(r&&ve(r))return r}return null}function FQ(e,t,n){const r=Rk(e),o=Rk(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 Yn(e){return String(e??"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function $Q(e){return String(e??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function WQ(){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 qQ(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=WQ();if(!n)return t;try{return new URL(t,n).href}catch{return t}}function zQ(e){return e>0?`<td width="${e}">&nbsp;</td>`:""}function UQ(e,t){const n=HQ(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:Kn.align,i=typeof e.iconSize=="number"?e.iconSize:Kn.iconSize,s=typeof e.borderRadius=="number"?e.borderRadius:Kn.borderRadius,a=typeof e.gap=="number"?e.gap:Kn.gap,l=typeof e.bgEnabled=="boolean"?e.bgEnabled:Kn.bgEnabled,c=typeof e.bgColor=="string"?e.bgColor:Kn.bgColor,u=typeof e.borderWidth=="number"?e.borderWidth:Kn.borderWidth,d=typeof e.borderColor=="string"?e.borderColor:Kn.borderColor;let f=typeof e.buttonBorderWidth=="number"&&!Number.isNaN(e.buttonBorderWidth)?e.buttonBorderWidth:Kn.buttonBorderWidth;f=Math.max(0,Math.min(24,Math.round(f)));const h=typeof e.showLabel=="boolean"?e.showLabel:Kn.showLabel,m=[];u>0&&d&&m.push(`border:${u}px solid ${Yn(d)}`);const p=m.length?` style="${m.join(";")}"`:"",b=!!(l&&String(c).trim()),C=Math.max(0,Math.round(Number(a)||0)),L=r.length>1,k=`<table border="0" cellspacing="0" cellpadding="0">
99
+ <tr>${r.map(E=>{const _=Yn(E.platform||"unknown"),S=!!E.customIcon,v=Yn(E.href||""),T=String(E.title??"").trim(),w=T?` title="${Yn(T)}"`:"",N=Yn(E.alt||""),x=Yn(qQ(E.iconSrc||"")),D=E.iconWidth!=null&&!Number.isNaN(Number(E.iconWidth))?Number(E.iconWidth):i,P=E.iconHeight!=null&&!Number.isNaN(Number(E.iconHeight))?Number(E.iconHeight):i,O=S?"":typeof E.buttonBgColor=="string"?E.buttonBgColor.trim():"",z=!S&&b&&!O?String(c).trim():"",he=S?"":O||z,oe=!S&&!!z,Re=S?"":typeof E.itemBorderColor=="string"?E.itemBorderColor.trim():"",J=!S&&!!(O||Re&&f>0||oe),U=!S&&!J&&s>0?`border-radius:${s}px;`:"";let Et=`<a href="${v}" target="_blank"${w} draggable="false"><img src="${x}" width="${D}"${S?"":` height="${P}"`} border="0" alt="${N}" draggable="false" style="display:block;${U}" /></a>`;if(h&&(E.title||E.alt)){const ce=$Q(String(E.title||E.alt||""));Et+=`<br/><span style="display:block;font-size:11px;line-height:1.2;margin-top:4px;max-width:96px;word-break:break-word;">${ce}</span>`}const le=[];he&&le.push(`background-color:${Yn(he)}`),Re&&f>0&&le.push(`border:${f}px solid ${Yn(Re)}`),J&&s>0&&le.push(`border-radius:${s}px`);const Te=oe?' em-tray-cell-bg="1"':"",rt=S?' em-custom-icon="1"':"",kt=he&&/^#[0-9A-Fa-f]{3,8}$/.test(he)?` bgcolor="${Yn(he)}"`:"",ee=L?' draggable="true"':"";return`<td em-platform="${_}"${rt}${Te}${kt}${le.length?` style="${le.join(";")}"`:""}${ee}>${Et}</td>`}).filter(Boolean).reduce((E,_,S)=>(S>0&&E.push(zQ(C)),E.push(_),E),[]).join("")}
100
+ </tr>
101
+ </table>`,y=`<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"${p}><tr><td align="${Yn(o)}">
102
+ ${k}
103
+ </td></tr></table>`,g=Le(y,!0)[0];return g?(g instanceof HTMLTableElement&&FQ(n,g,o),g.setAttribute("em-edit","active"),n.replaceWith(g),t.commit(!0),g):null}function jQ(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),b=document.createRange();b.selectNodeContents(p),n.removeAllRanges(),n.addRange(b),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),on(r.commonAncestorContainer,m),t.unwrapNestedTags(m,a);const p=t.wrapInTag(r,m,a),b=document.createRange();b.selectNodeContents(p),n.removeAllRanges(),n.addRange(b),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),on(r.commonAncestorContainer,m),f=Array.from(m.querySelectorAll(a)),c){const C=Array.from(c.childNodes).some(y=>y.nodeType===1),L=t.unwrapTag(c),k=document.createRange();if(L.isConnected)k.selectNodeContents(L),n.removeAllRanges(),n.addRange(k);else{const y=c.parentNode;y&&(k.selectNodeContents(y),n.removeAllRanges(),n.addRange(k))}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);on(m,p);const b=p.querySelector('[em-edit="active"]');if(b){r.deleteContents(),r.insertNode(b);const C=document.createRange();C.selectNodeContents(b),n.removeAllRanges(),n.addRange(C),t.cleanEmptyTags(b.parentNode)}}t.commit()}typeof e.textSuperscript=="boolean"&&s("sup",e.textSuperscript),typeof e.textSubscript=="boolean"&&s("sub",e.textSubscript)}function VQ(e,t){if(e!==void 0){if(e===""){GQ(t.activeElement);return}XQ(e,t)}}function GQ(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 XQ(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 KQ(e){return e.trim().replace(/\s+/g,"_").replace(/[^\p{L}\p{N}\-_:.]/gu,"")}function Mk(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 YQ(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 ZQ(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function QQ(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=Mk(r)),i||(i=t.activeElement?.closest?.("a[name]")),i){const s=i.firstChild,a=i.lastChild;ZQ(i),t.commit(),YQ(s,a)}return}const o=KQ(e);if(o&&!(!n||!r||r.collapsed))try{const i=Mk(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 Ie=e=>uc(e?.innerText);function JQ(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 eJ(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 tJ=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,nJ=/^rgba?\s*\(\s*(?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\s*(?:,\s*(?<a>(?:0?\.)?\d+)\s*)?\)$/i,Ag=e=>e.toString(16).padStart(2,"0");function rJ(e){const t=nJ.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`#${Ag(n)}${Ag(r)}${Ag(o)}`}function Pk(e){return e.split("").map(t=>`${t}${t}`).join("")}function Zn(e,t){if(!e)return;const n=e.trim();if(!n)return;if(tJ.test(n)){const o=n.slice(1);return o.length===3?`#${Pk(o).toLowerCase()}`:o.length===4?`#${Pk(o.slice(0,3)).toLowerCase()}`:o.length===8?`#${o.slice(0,6).toLowerCase()}`:`#${o.toLowerCase()}`}const r=rJ(n);if(r)return r;if(t){const o=t(n);if(o&&o!==n)return Zn(o)}}function oJ(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}function kg(e,t,n){const r=t.parentElement;let o=e.parentElement;for(;o&&o!==r;){const i=Zn(o.style.color,n);if(i)return i;o=o.parentElement}}function iJ(e,t){Array.from(e.querySelectorAll("span")).reverse().forEach(n=>{if(!n.style.color)return;const r=Zn(n.style.color,t);if(!r)return;const o=kg(n,e,t);!o||o!==r||(n.style.removeProperty("color"),n.getAttribute("style")||n.removeAttribute("style"),n.attributes.length===0&&oJ(n))})}function sJ(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 aJ(e,t,n){const r=Zn(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=sJ(i);if(!s.length||s.every(c=>{const u=c.parentElement;return u?Zn(u.style.color,n)===r?!0:kg(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 lJ(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=Zn(o.style.color,t);if(!i)return;const s=kg(o,e,t)||(n?Zn(n,t):void 0);s&&Array.from(o.querySelectorAll("span")).forEach(a=>{if(!a.style.color)return;const l=Zn(a.style.color,t);l&&l!==i&&l===s&&(a.style.color=o.style.color)})})}function cJ(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 uJ(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"&&Cu(t,e.fontFamilyArray[2]),e.removeClassesByPrefix(t,"em-font"),t.classList.add(e.createFontClassName(e.fontFamilyArray)),Cp(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 dJ(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(Ge(n),"bold")),sn(n),n.tagName!=="STRONG"?e.currentSettings.value&&ke(n,"<strong>"+Ge(n)+"</strong>"):e.currentSettings.value||hs(n,Ge(n)),sn(r)})}if(e.currentSettings.value===!0)Array.from(e.parentNode?.getElementsByTagName("b")||[]).reverse().forEach(t=>{const n=document.createElement("strong");if(Gt(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");Gt(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 fJ(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(Ge(n),"italic")),sn(n),n.tagName!=="EM"?e.currentSettings.value&&ke(n,"<em>"+Ge(n)+"</em>"):e.currentSettings.value||hs(n,Ge(n)),sn(r)})}if(e.currentSettings.value)Array.from(e.parentNode?.getElementsByTagName("i")||[]).reverse().forEach(t=>{const n=document.createElement("em");if(Gt(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");Gt(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 mJ(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");Gt(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");Gt(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");Gt(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");Gt(u,i),u.style.fontSize=a,i.parentNode.replaceChild(u,i)}if(!c.length&&i.tagName==="FONT"){const u=document.createElement("span");Gt(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 hJ(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(Ge(i),"strike")),sn(i),i.tagName!=="STRIKE"?e.currentSettings.value&&ke(i,"<strike>"+Ge(i)+"</strike>"):e.currentSettings.value||hs(i,Ge(i)),sn(s)})}if(e.currentSettings.value===!0){let o=n;Array.from(document?.getElementsByTagName("strike")||[]).reverse().forEach(i=>{if(e.getInnerText(i)===o&&(e.getInnerText(i.parentNode)===o&&i.parentNode.tagName==="U"&&jd(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=>{jd(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(Ge(t.parentWrapper),"strikeUnderline")),sn(t.parentWrapper),e.refreshElementSettings(t.parentWrapper,o),t.range.selectNode(t.parentWrapper),e.addNewRange(t.range);else{const i=t.selection.getRangeAt(0),s=document.createElement("span");s.style.textDecoration=e.currentSettings.value?"line-through":"none",e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN"?(e.activeElement.style.textDecoration=e.activeElement.style.textDecoration==="line-through"?"none":"line-through",Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),e.refreshElementSettings(e.activeElement,o)):(s.appendChild(i.extractContents()),Array.from(s.querySelectorAll('span[style*="text-decoration"]')).forEach(a=>a.style.textDecoration=""),i.insertNode(s),r=s,e.refreshElementSettings(s,o),e.addNewRange(i))}}if(t.range.cloneContents()){if(t.range=t.selection.getRangeAt(0),r&&e.getInnerText(r)===n)t.range.selectNode(r),e.addNewRange(t.range);else{const o=t.range.commonAncestorContainer,i=o.nodeType===1?o:o.parentElement,s=t.range.firstElementChild?t.range.firstElementChild:t.range.parentElement||i;s&&e.getInnerText(s)===n&&(t.range.selectNode(s),e.addNewRange(t.range))}r&&e.refreshElementSettings(r,n)}}function pJ(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(Ge(i),"underline")),sn(i),i.tagName!=="U"?e.currentSettings.value&&ke(i,"<u>"+Ge(i)+"</u>"):e.currentSettings.value||hs(i,Ge(i)),sn(s)})}if(e.currentSettings.value){const o=Array.from(e.findOutermostParentWithText(e.parentElement)?.getElementsByTagName("u")||[]).reverse();o.push(...Array.from(e.findOutermostParentWithText(e.parentElement)?.querySelectorAll("a,span[style*=text-decoration]")||[]).reverse()),o.filter(i=>e.getInnerText(i)===e.selectedText).forEach(i=>{if(e.selectedText&&e.getInnerText(i)===e.selectedText){i.style.textDecoration="underline";const s=i.firstChild;s?.tagName==="STRIKE"&&e.getInnerText(s)===e.selectedText&&[...s.attributes].forEach(a=>{i.setAttribute(a.name,a.value),s.removeAttribute(a.name)}),e.cleanStrikesInElement(i,e.getParentElementOfSelection())}}),e.cleanEmptySpans(e.selectedText),e.getInnerText(e.parentElement)===e.selectedText&&e.cleanStrikesInElement(e.parentElement,e.getParentElementOfSelection())}else{const o=e.findElementWithSelectedText(e.selectedText,e.activeElement);if(!o&&e.isElementList){let i=null;const s=window.getSelection();if(s&&s.rangeCount>0){let l=s.getRangeAt(0).commonAncestorContainer;for(l.nodeType!==Node.ELEMENT_NODE&&(l=l.parentNode);l&&l!==e.activeElement&&!["DIV"].includes(l.tagName);)l=l.parentNode;l&&l.contains(e.activeElement)&&(i=l)}const a=i?e.findOutermostParentWithText(i,"A"):null;a&&(a.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&i&&(e.refreshElementSettings(i,e.selectedText),t.range.selectNode(i),e.addNewRange(t.range))}else{const i=e.findOutermostParentWithText(o,"A");i&&(i.style.textDecoration="none"),e.getInnerText(t.parentWrapper)===e.selectedText&&o&&(e.refreshElementSettings(o,e.selectedText),t.range.selectNode(o),e.addNewRange(t.range))}}if(e.request.type==="button"||e.activeElement.tagName==="A")if(e.request.type!=="button"&&e.activeElement.tagName==="A"&&(t.parentWrapper=e.activeElement),e.getInnerText(t.parentWrapper)===e.selectedText&&t.parentWrapper)t.parentWrapper.style.textDecoration=e.currentSettings.value?"underline solid":"none",Array.from(t.parentWrapper.querySelectorAll('span[style*="text-decoration"]')).forEach(o=>o.style.textDecoration=""),e.cleanStrikesInElement(t.parentWrapper,e.getParentElementOfSelection());else{const o=t.selection.getRangeAt(0);if(e.activeElement.nodeType===1&&e.activeElement.tagName==="SPAN")e.currentSettings.value?e.activeElement.style.textDecoration="underline":(e.activeElement.style.removeProperty("text-decoration"),e.activeElement.style.removeProperty("text-decoration-line")),Array.from(e.activeElement.querySelectorAll('span[style*="text-decoration"]')).forEach(i=>i.style.textDecoration=""),e.activeElement.getAttribute("style")||e.activeElement.removeAttribute("style"),e.refreshElementSettings(e.activeElement,e.selectedText);else if(e.activeElement.tagName!=="A")if(e.currentSettings.value){const i=document.createElement("span");i.style.textDecoration="underline",i.appendChild(o.extractContents()),Array.from(i.querySelectorAll('span[style*="text-decoration"]')).forEach(s=>s.style.textDecoration=""),e.refreshElementSettings(i,e.selectedText),o.insertNode(i),e.addNewRange(o)}else{const i=o.extractContents(),s=document.createElement("span");s.appendChild(i),r(s);const a=document.createDocumentFragment();for(;s.firstChild;)a.appendChild(s.firstChild);o.insertNode(a),e.addNewRange(o)}}}function gJ(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");Gt(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");Gt(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");Gt(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&&(lJ(i,e.rgbToHex,e.outerContextColor||e.tempColor),iJ(i,e.rgbToHex)),i&&e.cleanEmptySpans(e.selectedText,i)}function bJ(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 Ik(e,t){const n=e.style.color?.trim();if(!n)return null;const r=Zn(n),o=Zn(t??"");return!r||r===o?null:n}function yJ(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=Ge(n),l=n?.parentNode;l&&(ke(l,a),sn(l)),s.appendChild(i.cloneNode(!0)),i.parentNode&&i.parentNode.replaceChild(s,i),n=s,t.range.selectNode(n),e.addNewRange(t.range)}if(n){n.setAttribute("target","_blank"),n.setAttribute("href","");const s=e.commonStyles?.links?.color||n.closest('[style*="color"]')?.style?.color||"";n.setAttribute("style",`color: ${s}; text-decoration: ${o};`),e.markNewLink!==!1&&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=bJ(n)?"div":"span",o=document.createElement(r);if(Gt(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=Ik(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=Ik(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 Lg='[class*="em-mob-font_size"]',vJ=`${Lg}, [style*="font-size"]`,EJ="a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub",SJ=new Set(["SPAN","STRONG","B","EM","I","U","S","STRIKE","FONT","SUP","SUB","A"]);function wJ(e,t,n){const{classNamePrefix:r,value:o}=t.mobileFontSize,i=o!=null?`${r}${o}px`:null,s=e.closest(EJ)||e;s.querySelectorAll(".em-element-path").forEach(d=>d.remove());const a=_J(s,i!==null);if(!a||Ie(s)===tt()){n({settings:t,elem:s.closest("editor")?s:s.closest(vJ)||s}),Ng(s,r,i);return}const l=CJ(s,a);if(i===null){(l?[l]:Array.from(s.querySelectorAll(Lg)).filter(d=>a.intersectsNode(d))).forEach(d=>{Ng(d,r,null),Dk(d,r)});return}const c=l||bS(a,a.extractContents(),"span");if(!c)return;TJ(c),n({settings:t,elem:c}),Ng(c,r,i);const u=document.createRange();u.selectNodeContents(c),ai(u)}function _J(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(Lg);if(!i||i===e||!e.contains(i))return null;const s=document.createRange();return s.selectNodeContents(i),ai(s),s}eJ(n,ai);const o=n.rangeCount?n.getRangeAt(0):null;return o&&!o.collapsed?o:null}function CJ(e,t){const n=tt(),r=t.commonAncestorContainer;let o=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement,i=null;for(;o&&o!==e&&o.tagName!=="EDITOR"&&e.contains(o)&&Ie(o)===n;)i=o,o=o.parentElement;return i}function Ng(e,t,n){e.querySelectorAll("*").forEach(r=>{n&&r.style.fontSize?(Zc(r,t),r.classList.add(n)):r.getAttribute("class")?.includes(t)&&Dk(r,t)})}function Dk(e,t){Zc(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 TJ(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"));SJ.has(n.tagName)&&!r&&!n.querySelector("img, br, hr, table, video, iframe")&&n.remove()})}function AJ(e,t){let n=!1;const{activeElement:r}=t;if(typeof e.linkHref=="string"&&LJ(e.linkHref,t),t.textStyleProperties.some(o=>e.hasOwnProperty(o)))try{t.toggleTextStyle(r,{settings:e})}catch{}if(e.mobileFontSize&&(wJ(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&&NJ(e.textAlign,r),e.mobileTextAlign&&(xJ(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"))&&kJ(e,r),t.isElementList&&RJ(e,t),n}function kJ(e,t){const n=CY.includes(t.tagName)?t:t.closest(TY);if(!n)return;const r=e.listOL!==void 0;(r?e.listOL:e.listUL)?IY(n,r):FY(n)}function LJ(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),za(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 NJ(e,t){const n=Da(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 xJ(e,t,n){const r=Da(t);if(!r)return;const o=e.mobileTextAlign?.classNamePrefix||"em-mob-text_align-";$X(t,r,o),n.setElementMobileAlign({settings:e,elem:r,fieldName:"mobileTextAlign"})}function OJ(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=>MJ(l,c,t))].filter(c=>!!c)}function RJ(e,t){const{activeElement:n,classNameOl:r,classNameUl:o}=t,i=n.closest(`table.${r}`)||n.closest(`table.${o}`);if(!i)return;const s=OJ(e,t);if(s.length){const l=t.removeEditorTags(Jl(i));Wa(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 MJ(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"&&Cu(s,e[2]),n.removeClassesByPrefix(s,"em-font"),s.classList.add(n.createFontClassName(e)),Cp(s,e),n.addFontFamilyClass({fontFamilyArray:e})):s.style.removeProperty("font-family"))}),Ze(r)):t}var ld=null;function Bk(e){ld=e}function Hk(){return ld}function vr(){ld=null}function PJ(){return ld?.kind==="atom"}function xg(e,t,n,r){Hs(e,t,o=>{const i=document.createElement("table");i.replaceChildren(...o),[...i.querySelectorAll(":scope > tr")].reverse().forEach(s=>n.insertAdjacentElement(r,s))})}function Fk(e,t){e.replaceChildren(...t),e.querySelectorAll('tr[em="block"]').forEach(n=>n.removeAttribute("em"))}function Og(e,t,n,r,o){Hs(e,n,i=>{Fk(t,i),r.insertAdjacentElement(o,t)})}var IJ=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"],DJ=["em-atom-insert","em-atom-insert_bottom-document","em-atom-insert_bottom","em-atom-insert_top-document","em-atom-insert_top"],BJ=["em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function $k(){document.querySelectorAll(".em-block-insert").forEach(e=>{e.classList.remove(...IJ)})}function HJ(){document.querySelectorAll(".em-atom-insert").forEach(e=>{e.classList.remove(...DJ)})}function cd(){document.querySelectorAll(".em-blockatom-insert").forEach(e=>{e.classList.remove(...BJ)})}function Rg(e,t){const n=e.getBoundingClientRect();return t>n.top+n.height/2?"bottom":"top"}function Wk(e,t){const n=e.getBoundingClientRect(),r=document.body.getBoundingClientRect();return t==="bottom"?n.bottom>r.height-21:n.top<2}function Mg(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=Wk(e,"bottom")?`${r}_bottom-document`:`${r}_bottom`;e.classList.add(i)}else{e.classList.remove(`${r}_bottom`,`${r}_bottom-document`);const i=Wk(e,"top")?`${r}_top-document`:`${r}_top`;e.classList.add(i)}}function ud(e){return e.tagName==="TABLE"||e.tagName==="TR"?e.querySelector("[data-template-content]")??e.querySelector("td"):e}function qk(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 FJ(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 $J(e){const t=qk(e.dataTransfer?.files??null);return t||FJ(e.dataTransfer??null)}function Pg(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 ja(e){const t=e.dataTransfer?.types;return!!t&&Array.from(t).includes("Files")}function Ig(e){if(!ja(e))return!1;const t=e.dataTransfer;if(!t)return!1;if(t.files?.length)return!!qk(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 zk="em-native-img-drop-target",Dg="em-native-img-uploading",WJ="em-native-img-drop-loading",dd="em-native-file-drag",Va=null,Ro=null;function Uk(){Ro&&(window.removeEventListener("scroll",Ro.reposition,!0),window.removeEventListener("resize",Ro.reposition),Ro.resizeObserver?.disconnect(),Ro.overlay.remove(),Ro=null)}function qJ(e){Uk();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)),Ro={overlay:t,reposition:r,resizeObserver:o}}function Bg(){Va&&(Va.classList.remove(zk),Va=null)}function Mo(){Fe(document.body,!1,dd),Bg()}function zJ(e){if(!ja(e)){Mo();return}if(!Ig(e)){Mo();return}Fe(document.body,!0,dd);const t=Pg(e);if(!t){Bg();return}Va!==t&&(Bg(),Va=t,t.classList.add(zk))}function jk(){Uk(),Fe(document.body,!1,WJ,dd),document.querySelectorAll(`.${Dg}`).forEach(e=>{e.classList.remove(Dg)})}function UJ(e,t){if(t.lockEditor||!ja(e))return!1;const n=$J(e);if(!n)return!1;const r=Pg(e);return r?(t.applicationElementSettingsSet({elem:r}),Mo(),r.classList.add(Dg),qJ(r),t.messageService.send({operation:ue.APPLICATION_NATIVE_IMAGE_DROP,file:n}),!0):!1}function jJ(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"&&(Fe(document.body,!0,"em-atom-insert-body-inside"),t.commit(!1),t.mutableState.atomReplaced=n)}function VJ(e,t){t.lockEditor||(Mo(),e.preventDefault(),t.messageService.send({operation:"application_scroll-block-hide"}))}function GJ(e,t){if(e.preventDefault(),t.lockEditor){Mo();return}ja(e)?(Ig(e)&&Pg(e)&&(e.dataTransfer.dropEffect="copy"),zJ(e)):Mo();const n=e.target;if(document.body.classList.contains("em-block-insert-body")){const r=dn(n)?null:n.closest('[em="block"]');if(r){t.mutableState.targetBlock=r;const o=ud(r);o&&Mg(o,Rg(o,e.pageY),"block")}else $k()}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,Mg(r,Rg(r,e.pageY),"atom"),cd();else if(n.closest('[em="block"]')&&n.tagName==="TD"&&!n.innerHTML&&!n.hasAttribute("height")||n.tagName==="DIV"&&n.closest("amp-accordion")&&!n.innerHTML)cd();else{const o=n.closest('[em="block"]');if(o){t.mutableState.targetBlock=o;const i=ud(o);i&&(Mg(i,Rg(i,e.pageY),"blockatom"),HJ())}}}}function XJ(e,t){if(t.lockEditor)return;ja(e)&&Ig(e)&&Fe(document.body,!0,dd);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"]');dn(n)?(n.classList.add("em-block-insert-empty"),$k()):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"]');dn(n)?(n.classList.add("em-block-insert-empty"),cd()):o?t.mutableState.targetBlock=o:cd()}}var KJ=["em-block-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top"];function YJ(e){return e.clientX<=0||e.clientY<=0||e.clientX>=window.innerWidth||e.clientY>=window.innerHeight}function ZJ(e,t){if(t.lockEditor)return;const n=e.target;if(document.body.classList.contains("em-block-insert-body")){if(YJ(e)){document.querySelectorAll(".em-block-insert").forEach(i=>i.classList.remove(...KJ)),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 QJ(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+`
104
+ `+[...i.querySelectorAll("style")].map(a=>a.innerHTML).join(`
105
+ `),{restructure:!0,forceMediaMerge:!0}).css;s=n.cssbeautify(s,{indent:" ",autosemicolon:!0}),r&&(r.textContent=`
106
+ `+s+`
107
+ `)}function JJ(e){for(const t of e.reverse())document.head?.prepend(t),document.head?.insertAdjacentHTML("afterbegin",`
108
+ `)}function eee(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 Vk(){vr(),Mo(),Fe(document.body,!1,"em-block-insert-body"),document.querySelectorAll(".em-block-insert-empty").forEach(e=>{e.classList.remove("em-block-insert-empty")}),Fe(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 Gk(e,t,n){const r=e.target;if(!(n.isTableElement(r)&&dn(r)||(r.tagName==="BODY"?ag():r.closest('[em="block"]'))))return;const o=Sp(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(QJ(s,n.emailWidth,{minify:n.minify,cssbeautify:n.cssbeautify,HTMLDocument:n.HTMLDocument}),JJ(a),t.settings.type!=="project"&&(i=n.commonStylesApplyToBlock({html:i})),i.match(/class="em-countdown"/gi)&&(i=n.uptimeCountdown({blockHTML:i})),n.isTableElement(r)&&dn(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",yr(r),"beforeend",`
109
+ `+i+`
110
+ `):ar("new",yr(r),"beforeend",`
111
+ <tr><td align="center">
112
+ `+i+`
113
+ </td></tr>
114
+ `),t.settings&&(n.messageService.send("application_block_inserted",{type:t.settings.type,name:t.settings.name,blockId:t.settings.blockId,project:t.settings.project}),vr());else if(r.tagName==="BODY"){const l=ag();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"}),xg("new",`
115
+ `+i+`
116
+ `,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}),vr())}else{const l=r.closest('[em="block"]');if(l){const c=ud(l),u=c?eee(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"?xg("new",`
117
+ `+i+`
118
+ `,l,u):xg("new",`
119
+ <tr em="block"><td align="center">
120
+ `+i+`
121
+ </td></tr>
122
+ `,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"),Og("new",d,`
123
+ `+i+`
124
+ `,l,u)}else{const d=document.createElement("div");d.setAttribute("align","center"),d.setAttribute("em","block"),Og("new",d,`<table cellpadding="0" cellspacing="0" border="0" width="100%">
125
+ `+i+`
126
+ </table>`,l,u)}else ar("new",l,u,`
127
+ `+i+`
128
+ `);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}),vr())}}}var Hg="em-live-atom";function fd(e,t){return t?`<${Hg}></${Hg}>`:e}function tee(e,t,n){const[r,...o]=document.querySelectorAll(Hg);if(o.forEach(s=>s.remove()),!r||e.contains(r)){r?.remove();return}const i=e.parentElement;rm(e),n.place(r,e),i&&e.parentElement&&t(e,i,e.parentElement)}function Xk(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>'?`
129
+ <tr em="block" class="em-structure">
130
+ <td align="center">
131
+ ${t}
132
+ </td>
133
+ </tr>`:`
134
+ <style>
135
+ @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
136
+ .em-mob-wrap {
137
+ display: block!important;
138
+ }
139
+ .em-mob-width-100perc {
140
+ width: 100%!important;
141
+ max-width: 100%!important;
142
+ }
143
+ .em-mob-padding_right-20 {
144
+ padding-right: 20px!important;
145
+ }
146
+ .em-mob-padding_left-20 {
147
+ padding-left: 20px!important;
148
+ }
149
+ </style>
150
+ <tr em="block" class="em-structure">
151
+ <td align="center" style="padding: 30px 40px;" class="em-mob-padding_left-20 em-mob-padding_right-20">
152
+ <table align="center" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-100perc">
153
+ <tr>
154
+ <td width="600" valign="top" class="em-mob-wrap em-mob-width-100perc">
155
+ ${t}
156
+ </td>
157
+ </tr>
158
+ </table>
159
+ </td>
160
+ </tr>`}function nee(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",`
161
+ `+fd(t,s)+`
162
+ `),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),vr())}function ree(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=Xk(t,fd(t,s));o(t==='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>'?null: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 b=document.createElement("tr");b.setAttribute("em","block"),b.classList.add("em-structure"),Hs(i,`
163
+ `+d+`
164
+ `,C=>{b.replaceChildren(...C.flatMap(L=>L instanceof Element&&L.tagName==="TR"?Array.from(L.childNodes):[L])),c.insertAdjacentElement(h,b)})}else if(m)r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:`<tr em="block"><td align="center">
165
+ `+d+`
166
+ </td></tr>`});else{const b=document.createElement("tr");b.setAttribute("em","block"),Hs(i,`
167
+ <td align="center">
168
+ `+d+`
169
+ </td>
170
+ `,C=>{b.replaceChildren(...C),c.insertAdjacentElement(h,b)})}else if(p)if(c.tagName==="TABLE")if(dn(a))m?r.insertCountdown({targetElem:h==="beforeend"?yr(c):c,targetPlace:h,atomHTML:d}):ar(i,h==="beforeend"?yr(c):c,h,d);else{const b=document.createElement("table");b.setAttribute("cellspacing","0"),b.setAttribute("cellpadding","0"),b.setAttribute("align","center"),b.setAttribute("border","0"),b.setAttribute("em","block"),b.setAttribute("width",c.hasAttribute("width")?c.getAttribute("width"):String(c.getBoundingClientRect().width)),b.classList.add("em-mob-width-100perc"),m?(Fk(b,Le(`
171
+ `+d+`
172
+ `,!0)),r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:r.getOuterHtml(b)})):Og(i,b,`
173
+ `+d+`
174
+ `,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">
175
+ `+d+`
176
+ </table></div>`}):ar(i,c,h,`
177
+ <div align="center"><table cellpadding="0" cellspacing="0" border="0" align="center" class="em-mob-width-100perc">
178
+ `+d+`
179
+ </table></div>
180
+ `);else m?r.insertCountdown({targetElem:c,targetPlace:h,atomHTML:d}):ar(i,c,h,`
181
+ `+d+`
182
+ `);document.querySelectorAll(".em-blockatom-insert").forEach(b=>{b.classList.remove("em-blockatom-insert","em-block-insert_bottom-document","em-block-insert_bottom","em-block-insert_top-document","em-block-insert_top")}),n.settings?.name&&(r.messageService.send("application_atom_inserted",n.settings.name),vr())}function oee(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");ry(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?fd(e,o):xt(l),h=`
183
+ <tr em="atom"><td colspan="`+u+`">
184
+ `+f+`
185
+ </td></tr>
186
+ `;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,`
187
+ `+fd(e,o)+`
188
+ `);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),vr())}function Kk(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?Bs(n):""}},s=o==="moved"?i.settings.atomHTML:"",a=n&&s&&!s.match(/class="em-countdown"/gi)?n:null;try{iee(e,t,o,i,a)}finally{a&&tee(a,t.fitMovedImage,t.companions??Wn)}}function iee(e,t,n,r,o){const i=t.mutableState.atomReplaced,s=e.target,a=b=>t._setDocumentStyles(b,{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")||PJ()),c=s.tagName==="DIV"&&s.closest("amp-accordion")&&!s.innerHTML,u=l||c,d=!!document.querySelector(".em-blockatom-insert")||dn(s),f=s.closest('[em="atom"]');if(!u&&!d&&!f)return;let h=r.settings.atomHTML.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim();const m=o?[]:r.settings.atomHTML.match(/<style((.|\n|\r)*?)<\/style>/g)??[],p=b=>{const C=[...m,...b??[]];C.length&&a(C)};if((!d||u)&&p(null),h=t.commonStylesApply({html:h}),u){nee(s,h,i,r,t,n,o);return}if(d){ree(e,h,r,t,p,n,o);return}oee(h,r,t,n,o)}var see=/^[\t\n\f\r ]*$/;function aee(e,t){const n=[...e.childNodes],r=n.every(o=>o===t||o.nodeType===Node.TEXT_NODE&&see.test(o.textContent??""));e.replaceWith(...r?[t]:n)}function lee(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&&(aee(i,o),t.setCursorPosition(o))}}if(e.src!==void 0&&iv(r)&&Ht(r,"src",e.src??""),e.src!==void 0&&jk(),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 cee(e,t){const{activeElement:n,textStyleProperties:r,toggleTextStyle:o}=t;if(e.href!==void 0&&(n.setAttribute("href",e.href),za(e.href)&&n.removeAttribute("target")),e.target&&!(e.href&&za(e.href))&&n.setAttribute("target",e.target),r.some(i=>e.hasOwnProperty(i)))try{o(n,{settings:e})}catch{}}function uee(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 dee(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 fee(e){const t=e.settings.textReplacer;return typeof t=="string"&&t.includes("~~")}var Ga=["textStrong","textItalic","textStrikethrough","textUnderline","textColor","textBackgroundColor","textLink","lineHeight","fontSize","fontFamily"];function mee(e){const t=u=>{e.commit(u)},n={addFontFamilyClass:u=>Oa(u,t),clearLinkTags:u=>{Oo(u,t),Kr(t)}},r={setElementMobileWidth:yC,setElementMobileHeight:ki,setElementMobileBorder:WW,setElementMobileBorderRadius:qW,setElementMobileBoxShadow:zW,setElementMobileAlign:vC,setElementMobileTableAlign:UW,setElementMobileVerticalAlign:Mh,setElementMobileDirection:jW,setElementMobileBackgroundColor:VW,setElementMobileBackgroundImage:GW,setElementMobileBackgroundPositionX:XW,setElementMobileBackgroundPositionY:KW,setElementMobileBackgroundRepeat:YW,setElementMobileBackgroundSize:ZW,setElementMobilePadding:da,setElementMobileFontSize:EC,setElementMobileLineHeight:Ph,setElementShow:SC},o={parseTableElementToModel:Hi,tableModelToHtml:x0,updateTablePadding:nX,getCellsWithClasses:jG,clearCellBorders:KG,updateTableCellBackgroundByIds:oX,addClassToCellsByIds:VG,getExternalBorders:YG,updateCellBordersByIds:XG,getExternalCorners:eX,updateCellBorderRadiusByIds:QG,updateCellPaddingByIds:rX,removeOuterBorders:ZG},i=e.editLock??om,s=u=>({activeElement:u,activeCell:V.get("activeCell"),state:V,...o,wrapEditor:e.wrapEditor,addNewRange:ai,toggleTextStyle:e.toggleTextStyle,textStyleProperties:Ga,isEditLocked:()=>i.isTextLocked(),...r}),a=(u,d)=>{const f=()=>{const m=d??yk();m&&e.selectionLock.lift(()=>e.applicationElementSettingsSet({elem:m}))};let h;try{h=KZ(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=ed(d),m={setElementBorder:Ap,setElementBoxShadow:VT,setElementBorderRadius:Bi},p={activeElement:d,setPercentsForColumns:fc,setElementMobileHeight:ki};switch(u.type){case"img":case"countdown":case"video":lee(f,{activeElement:d,getActiveEditElement:Us,setCursorPosition:e.setCursorPosition,...m,...r});break;case"a":cee(f,{activeElement:d,textStyleProperties:Ga,toggleTextStyle:e.toggleTextStyle});break;case"table":dQ(f,{activeElement:d,...m,...r});break;case"td":case"structure":case"group":case"column":mQ(f,{activeElement:d,requestType:u.type,textStyleProperties:Ga,isElementListContainer:YY(d),isProgrammaticSelection:e.programmaticSelection,...m,...r,setContrastBlock:QW,setStructureBlocksWidth:td,toggleTextStyle:e.toggleTextStyle,removeEditorTags:Ki,addClassToSecondCell:SY,wrapEditor:e.wrapEditor,addNewRange:ai});break;case"button":tQ(f,{activeElement:d,textStyleProperties:Ga,...m,...r,toggleTextStyle:e.toggleTextStyle,compareStrings:LS});break;case"div":oQ(f,{activeElement:d,...m,...r});break;case"vindent":uee(f,{activeElement:d,setElementMobileHeight:ki});break;case"var":dee(f,{activeElement:d,isVariableText:MT});break;case"floatBlock":bQ(f,{activeElement:d,setElementMobileWidth:yC,setElementMobileContentWidth:$W,setElementMobileVerticalAlign:Mh,setElementShow:SC});break;case"text":AJ(f,{activeElement:d,textStyleProperties:Ga,toggleTextStyle:e.toggleTextStyle,collectVMLContent:GT,updateVMLComments:XT,removeClassesByPrefix:Aa,createFontClassName:wp,...n,handleTextScriptSettings:jQ,handleTextReplacer:VQ,handleTextAnchor:QQ,unwrapNestedTags:W5,wrapInTag:bS,unwrapTag:q5,isRangeMatching:z5,splitWrapper:U5,cleanEmptyTags:j5,applicationElementSettingsSet:e.applicationElementSettingsSet,compareStrings:LS,setElementMobileFontSize:EC,setElementMobileLineHeight:Ph,setElementMobileAlign:vC,updateTableStyle:eY,changeBullets:tY,changeBulletsColor:nY,changeBulletsSize:rY,changeBulletsItalic:iY,changeBulletsWeight:oY,changeBulletsStrikethrough:aY,changeBulletsUnderline:sY,findElementWithSelectedText:zs,removeEditorTags:Ki,isElementList:h.isList,isElementListOL:h.isListOL,classNameOl:h.classNameOl,classNameUl:h.classNameUl,commit:t});break;case"floatBlocksWidths":yQ(f,p);break;case"floatBlocksPreset":vQ(f,p);break;case"floatBlocksValign":EQ(f,p);break;case"floatBlocksGap":SQ(f,p);break;case"floatBlocksGapMobile":wQ(f,p);break;case"floatBlocksMobileWidths":_Q(f,p);break;case"floatBlocksMobileGap":CQ(f,p);break;case"floatBlocksMobileValign":AQ(f,p);break;case"floatBlocksMobileReset":TQ(f,p);break;case"carousel":PQ(f,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:Bi,commit:t});break;case"accordion":DQ(f,{activeElement:d,HTMLDocument:e.htmlDocument,setElementBorderRadius:Bi,commit:t});break;case"social":{const b=UQ(f,{activeElement:d,commit:t});if(b)return b;break}case"customTable":return a(f,d)?d:null}return d},c=(u,d,f,h)=>{const m=e.selectionLock.acquire(),p=u;let b=u;e.commitLockedAsync().finally(()=>{let C;try{C=JZ(b,p,d,f,{getMappedParent:L=>e.htmlDocument.getMappedParent(L)??void 0,getOuterHtml:L=>e.htmlDocument.getOuterHtml(L),applyHidden:L=>e.htmlDocument.applyHidden(L)})}catch(L){throw m.release(),L}if(!C){m.release(),e.setCursorPosition(b),h?.();return}b=C.active,e.commitLockedAsync().finally(()=>{try{C.afterCommit()}finally{m.release()}e.setCursorPosition(b),h?.()})})};return u=>{const d=e.selectionLock.acquire();try{const f=u.data;f.settings=e.getMapObj().escape(f.settings);const h=Us();if(!h){f.type==="customTable"&&a(f.settings,null)&&e.commitLockedAsync();return}e.beforeApply?.(f,h);const m=QZ(h),p=l(f,h);if(!p)return;e.afterApply?.(f,p);const b=fee(f)?tS():null;try{iC()}catch{}c(p,m,f,b?()=>v5(b,C=>e.htmlDocument.renderOnly(C)):void 0)}catch{}finally{d.releaseLater()}}}var hee=eE,pee=3,Fg=Promise.resolve(),$g={waiting:0},Wg=0;function Yk(){return pt()?ut().entityId:void 0}async function gee(e,t){let n=!1,r=!1;const o=()=>{n||(n=!0,e())},i=(async()=>{t&&await v3(),r=!0,await YI(o)})();let s;const a=new Promise(l=>{s=setTimeout(()=>{r&&xE()||(xE()?n=!0:o(),l())},hee)});try{await Promise.race([i,a])}catch{o()}finally{clearTimeout(s)}}function Zk(e,t){AE(()=>Qk(e,t))||Qk(e,t)}function Qk(e,t){const n=Wg>0||y3();if(!n&&ZI()&&($g={waiting:0}),$g.waiting>=pee)return;const r=$g;r.waiting++;const o=Yk(),i=QI(),s=async()=>{try{await gee(()=>{Yk()===o&&(e.send({operation:ue.APPLICATION_ACTION,action:t,...i!==void 0?{actionId:i}:{}}),i!==void 0&&JI(i))},n)}finally{r.waiting--,n&&Wg--}};n?(Wg++,Fg=Fg.then(s,s)):Fg=s()}function Jk(e,t){return!!e&&Array.from(e.querySelectorAll('[em="atom"]')).some(n=>n!==t)}function eL(e,t){(id(e)?e:wk(e,t))?.remove()}function Xa(e,t){if(!e)return;if(e.parentElement?.tagName==="SECTION"||e.classList.contains("em-narrow-table")&&Array.from(e.childNodes).every(r=>r.nodeType===Node.TEXT_NODE)){e.innerHTML="";return}e.querySelectorAll(".em-element-editor").forEach(r=>r.remove()),e.querySelectorAll(".em-element-path").forEach(r=>r.remove()),e.querySelectorAll(".em-element-block-add").forEach(r=>r.remove()),e.querySelectorAll(".em-vindent-paddingTop, .em-vindent-paddingRight, .em-vindent-paddingBottom, .em-vindent-paddingLeft").forEach(r=>r.remove()),t?.emptied([e]);const n=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(n,t)));else if(e.innerHTML.trim()==="")eL(e,t),(t??Wn).remove(e),Xa(n,t);else if(n&&!n.querySelector('div[style*="display"]')){for(const r of Array.from(e.childNodes))r.nodeName==="#text"&&r.textContent?.trim()===""?(eL(r,t),r.textContent=""):id(r)&&r.remove();e.innerHTML.trim()===""&&Xa(e,t)}}function tL(e,t){const n=e;if(!n||n.closest("editor")||n.firstElementChild?.tagName==="EDITOR")return!1;const r=t.getElementParent(n),o=t.companions??Wn;let i=n.parentNode;if(r&&t.setCursorPosition(r),n.classList.contains("em-code")){const s=t.getVariableByIcon(n);s&&(s.parentNode?.removeChild(s),n.remove())}else if(n.tagName==="TD"&&n.innerHTML===""&&n.hasAttribute("height")){const s=n.closest("table");if(s){const a=s.previousSibling;a&&a?.textContent?.trim()===""&&a.remove(),s.remove()}}else if(n.closest(".em-element-resize-img-container"))i=n.closest(".em-element-resize-img-container").parentNode,n.closest(".em-element-resize-img-container").remove();else if(n.closest('[em="atom"]')){const s=n.closest('[em="atom"]');i=s.parentNode;const a=n.closest(".em-mob-wrap, .noresp-em-mob-wrap");n.tagName==="TD"&&!n.previousElementSibling&&!n.nextElementSibling?o.remove(s):o.remove(n),n.tagName!=="TD"&&!Jk(a,s)&&a?.textContent?.trim()===""&&(a.textContent="")}else{o.remove(n);const s=n.previousSibling;s&&s?.textContent?.trim()===""&&s.remove()}return Xa(i,t.companions),t.commit(),j.send({operation:"application_element_settings_close"}),!0}function bee(e,t){if(t)return e.keyCode===90?e.shiftKey?"redo":"undo":e.keyCode===89&&!e.shiftKey?"redo":void 0}var yee={historyUndo:"undo",historyRedo:"redo"};function vee(e,t){const n=yee[e.inputType];return!n||!e.target?.closest?.("editor")?!1:(e.preventDefault(),e.stopPropagation(),Zk(t.messageService,n),!0)}function Eee(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 d=gt(()=>{const f=r.getAllComments(o);for(const h of f)r.isVariableComment(h)&&(r.getVariableIcon(h)||h.remove());i.removeEventListener("input",d)});i.addEventListener("input",d)}return!0}const s=document.querySelector("[em-edit]");if(!s||s.closest("editor"))return!1;const a=r.getElementParent(s),l=r.companions??Wn;let c=s.parentNode;const u=s.closest("editor");if(r.setCursorPosition(a),s.classList.contains("em-mob-wrap")){r.removeElementEditors();const d=s.closest("tr");if(d&&[...d.cells].every(f=>!f.textContent?.trim())){const f=s.closest("table");c=f?.parentNode||null,f&&l.remove(f)}}else if(s.classList.contains("em-code")){const d=r.getVariableByIcon(s);d&&(d.parentNode?.removeChild(d),s.remove())}else if(s.tagName==="TD"&&s.innerHTML===""&&s.hasAttribute("height")){const d=s.closest("table");if(d){const f=d.previousSibling;f&&f.textContent?.trim()===""&&f.remove(),d.remove()}}else if(s.closest(".em-element-resize-img-container")){const d=s.closest(".em-element-resize-img-container");c=d.parentNode;const f=s.closest("td")?.querySelector("editor");f&&f.innerHTML===""&&f.remove(),d.remove()}else if(s.closest('[em="atom"]')){const d=s.closest('[em="atom"]');c=d.parentNode;const f=s.closest(".em-mob-wrap, .noresp-em-mob-wrap");s.tagName==="TD"&&s.previousElementSibling===null&&s.nextElementSibling===null?l.remove(d):l.remove(s),s.tagName!=="TD"&&f&&!Jk(f,d)&&f.textContent?.trim()===""&&(f.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{l.remove(s);const d=s.previousSibling;d&&d.textContent?.trim()===""&&d.remove()}return u&&u.remove(),c&&r.removeEmptyParents(c),r.commit(),r.messageService.send({operation:"application_element_settings_close"}),!0}function See(e,t){if(!(e.keyCode===39||e.key==="ArrowRight")||e.shiftKey)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0),o=r.startContainer,i=o.nodeType===Node.TEXT_NODE?o.parentElement:o;if(i?.closest("em-replace"))return!1;const s=Rt(i)?i.parentElement:i,a=["strong","em","u","b","i","span","a","sub","sup","strike"];let l=null;const c=s?.closest("editor")??s?.closest('[contenteditable]:not([contenteditable="false"])')??null;for(const m of a){const p=s?.closest(m);if(p&&(!c||p!==c&&c.contains(p))){l=p;break}}if(!l||!t.isCaretAtEndOfStandardElement(r,l))return!1;if(l.tagName==="A"&&Fa(l))return e.preventDefault(),!1;e.preventDefault();const u=l.nextSibling;if(u&&u.nodeType===Node.TEXT_NODE&&(u.textContent?.length||0)>0){const m=u.textContent||"";return m[0]===" "||m[0]===" "?(t.setCursorPositionSimple(u,1),!0):(u.textContent=" "+m,t.setCursorPositionSimple(u,1),t.commit(),!0)}const d=l.parentNode;if(!d)return!0;if(u&&u.nodeType===Node.ELEMENT_NODE&&u.tagName==="SPAN"&&u.textContent===" ")return t.setCursorInsideSpan(u),!0;const f=document.createElement("span"),h=document.createTextNode(" ");return f.appendChild(h),u?d.insertBefore(f,u):d.appendChild(f),t.setCursorInsideSpan(f),!0}function nL(e,t){um(e,Is,t)}function wee(e,t){if(e.key!=="Backspace"&&e.keyCode!==8||e.ctrlKey||e.metaKey||e.altKey)return!1;const n=window.getSelection(),r=n?.rangeCount?n.getRangeAt(0):null,o=r?.collapsed?r.startContainer:null,i=Rt(o)?o:Rt(o?.parentNode)?o.parentNode:null,s=i?.previousSibling,a=s?.parentNode;if(!n||!i||sm(i)||s?.nodeName!=="BR"||!a)return!1;e.preventDefault(),e.stopImmediatePropagation(),Is(()=>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"&&um(l,Is),t.commit(!0),!0}var _ee=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"];function Cee(e,t){return!_ee.includes(e.key)||dm(YE(),Is)===null||t.commit(!1),!1}function Tee(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;kE();const a=i.anchorNode,l=a?.parentNode,c=l?.tagName==="A"&&!Fa(l);s.collapsed||s.deleteContents(),ZE(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),nL(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),nL(u,t),o.commit(),!0}function Aee(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?BC(r,Ih(n),n):!1}function kee(e){const t=gt(r=>{const o=r.target,i=o?.closest?.("a")||o?.querySelector?.("a"),s=i?.closest("td")||i?.parentElement;!i||!s||!qr(s)||e(!1).then(()=>{const a=!!i.closest("editor")||!!i.querySelector("editor")||!!s.querySelector("editor");s.isConnected&&i.isConnected&&a&&BC(s,Ih(i),i)&&e(!1)})}),n=gt(r=>{Aee(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 Lee=["Enter","Backspace","Delete"];function Nee(e){const t=gt(n=>{if(n.type==="keyup"&&!Lee.includes(n.key))return;const r=n.target,o=r?.closest?.("a")||r?.querySelector?.("a");!o||!Fa(o)||!kC(o)&&!CC(o)||e(!1).then(()=>{if(!o.isConnected)return;const i=nq(o),s=iq(o);(i||s)&&e(!1)})});return document.addEventListener("input",t,!1),document.addEventListener("keyup",t,!1),{dispose(){document.removeEventListener("input",t,!1),document.removeEventListener("keyup",t,!1)}}}function xee(e,t){if(!t||!e.collapsed)return!1;const n=(e.startContainer.ownerDocument??document).createTextNode(t);return e.insertNode(n),e.selectNodeContents(n),!0}var Oee=new Set(["textStrong","textItalic","textStrikethrough","textUnderline","textLink","textColor","textBackgroundColor"]);function Ree(e){const{commit:t,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:o,getParentElementOfSelection:i,findOutermostParentWithText:s,clearLinkTags:a,addFontFamilyClass:l,getIsProgrammaticSelection:c,getCommonStyles:u,getLinkPlaceholder:d}=e,f=o,h=i,m=s;function p(v,T,w){const N=!!v&&!!T&&T.tagName==="DIV"&&v.tagName==="EDITOR"&&v.parentElement===T&&T.childElementCount===1&&T.firstElementChild===v&&!Array.from(T.childNodes).some(z=>z!==v&&z.nodeType===Node.TEXT_NODE&&!!z.textContent?.trim()),x=!!v&&v.childElementCount===0&&Array.from(v.childNodes).some(z=>z.nodeType===Node.TEXT_NODE&&!!z.textContent?.trim()),D=!!v&&Ie(v).trim()===w.trim();if(!N||!x||!D||!v.hasAttribute("em-edit")||!T.parentNode)return;const P=T.parentNode,O=v.getAttribute("em-edit")||"active";for(;v.firstChild;)T.appendChild(v.firstChild);v.remove(),v.removeAttribute("em-edit"),T.setAttribute("em-edit",O),P.replaceChild(v,T),v.appendChild(T)}function b(v,T){try{return T.intersectsNode(v)}catch{const w=document.createRange();return w.selectNodeContents(v),T.compareBoundaryPoints(Range.END_TO_START,w)<0&&T.compareBoundaryPoints(Range.START_TO_END,w)>0}}function C(v){const T=v?.links||{},w=T.underline,N=T.color,x=typeof w=="boolean"?w?"underline":"none":"underline";return{color:typeof N=="string"&&N.trim()?N.trim():"inherit",textDecoration:x}}function L(v,T){if(!v||!T)return null;const w=T,N=Array.from(w.querySelectorAll("a"));w.tagName==="A"&&N.unshift(w);const x=typeof window<"u"&&window.Range?window.Range.START_TO_START:0,D=typeof window<"u"&&window.Range?window.Range.END_TO_END:2;for(const P of N){const O=document.createRange();O.selectNodeContents(P);const z=O.compareBoundaryPoints(x,v)<=0,he=O.compareBoundaryPoints(D,v)>=0;if(z&&he)return P}return null}function k(v,T,w){const N=Array.from(T?.getElementsByTagName("span")||[]).reverse();let x=!1;Ie(T)===v&&N.length&&(x=!0),N.forEach(D=>{const P=D.getAttribute("style"),O=!!P&&P.trim().length>0;let z=Array.from(D.attributes).filter(oe=>oe.name!=="style");if(!O&&z.length===1&&z[0].name==="em-edit"&&D.parentElement&&!D.parentElement.hasAttribute("em-edit")){const oe=D.getAttribute("em-edit")||"active";D.parentElement.setAttribute("em-edit",oe),D.removeAttribute("em-edit"),z=Array.from(D.attributes).filter(Re=>Re.name!=="style")}const he=z.length>0;if(!O&&!he){const oe=Ie(D);if(D.childNodes.length===1&&D.childNodes[0].nodeType===3){const Re=window.getSelection(),J=!!Re?.rangeCount&&Re.getRangeAt(0).intersectsNode(D),U=D.childNodes[0];D.parentNode?.replaceChild(U,D),J&&w.isEditorTagOutside&&Ie(T)!==v&&U.parentNode&&(w.range?.selectNode(U),n(w.range))}else{const Re=Array.from(D.childNodes);Re.forEach(J=>{D.parentNode?.insertBefore(J,D)}),v===oe&&(w.range=document.createRange(),w.range.setStartBefore(Re[0]),w.range.setEndAfter(Re[Re.length-1]),n(w.range)),D.parentNode?.removeChild(D)}}}),x&&(r(T,v),w.range.selectNode(T),n(w.range))}function y(v,T){if(v?.rangeCount>0){const w=v.getRangeAt(0),N=w.commonAncestorContainer;let x=w.startOffset,D=w.endOffset;for(;N.data&&x>0&&!/\s/.test(N.data[x-1]);)x--;for(;N.data&&D<N.length&&!/\s/.test(N.data[D]);)D++;T.setStart(N,x),T.setEnd(N,D),n(T)}}function g(v,T,w){ke(v,Ge(v).replaceAll(/<\/?strike[^>]*>/gi,"")),sn(v),v.parentNode&&(w.selectNode(v),n(w),r(v,T))}let E=!1;function _(){document.execCommand("styleWithCSS",!1,"true"),E=!0}function S(v,T){const w=JQ(T.settings,G),N=T.settings.textColor??T.settings.textBackgroundColor;if(typeof N=="string"&&N.trim()!==""&&!G(N))return!1;const x=ed(v),{classNameOl:D,classNameUl:P,classNameBullet:O,isListOL:z,isListUL:he,isList:oe}=x;oe&&x.tableElement?.querySelectorAll("tbody > tr > td:first-child")?.forEach(H=>{const Ae=H.querySelector(":scope > div")||H.querySelector(":scope > editor div");Ae&&Ae.classList.add(`${O}`)}),v?.querySelectorAll(".em-element-path").forEach(H=>H.remove()),dm(YE(),Is);const Re=Object.keys(T.settings)[0];let J=window.getSelection();if(!J||J.rangeCount===0){if(!v||!v.isConnected)return;const H=document.createRange();if(H.selectNodeContents(v),J=window.getSelection(),!J)return;J.removeAllRanges(),J.addRange(H)}let U=J.getRangeAt(0);const Et=U.commonAncestorContainer;let le=Et.nodeType===1?Et:Et.parentElement,Te=J.anchorNode?.nodeType===1?J.anchorNode:J.anchorNode?.parentElement,rt=!1,kt=!1,ee=null,ce=tt();if(v||(v=J.anchorNode?.childNodes.length===1&&J.anchorNode.firstChild?.nodeType===1?J.anchorNode.firstChild:le,v.tagName==="EDITOR"&&(v=v.parentElement)),w.name==="textLink"&&w.value===""){const H=le?.closest?.("a, [href]")||null;H&&(U.selectNode(H),n(U),v=H)}if(w.name==="textUnderline"&&!w.value){let H=le.closest(["u","strike","[style*=text-decoration]","span","a"].find(Ae=>le?.closest(Ae))||"u");!H&&v?.tagName==="A"&&(H=v),H?.tagName==="A"&&(H.style.textDecoration="none",r(H,ce),U.selectNode(H),n(U),v=H,rt=!0)}let M=T.type==="button"?(v||Te)?.closest("a"):(v||Te)?.closest("a, div, p, td, h1, h2, h3, h4, h5, h6, li, ul, ol, sup, sub");const il=T.settings.fontFamily;let qt=null;const fn=Array.from(M?.classList||[]).some(H=>(H.startsWith("em-font-")&&(qt=H),H.startsWith("em-font-")&&H.includes(w.name==="textItalic"?"Italic":"Bold")));fn&&(w.name==="textItalic"||w.name==="textStrong")&&qt&&M?.classList.remove(qt);const mn={range:U,isEditorTagOutside:!1},st=(H=tt(),Ae=M)=>{k(H,Ae,mn)},hn=QY,ft=YA,wr=(H,Ae)=>{g(H,ce,mn.range)};let _r,pn;Re==="textColor"?_r=pn="color":Re==="textBackgroundColor"&&(_r="backgroundColor",pn="background-color");const zt=T.settings.hasOwnProperty("textColor")||T.settings.hasOwnProperty("textBackgroundColor"),St=!!le?.closest("editor")||Ie(le)===ce||Ie(le.querySelector("editor"))===ce;mn.isEditorTagOutside=St,T.settings.hasOwnProperty("textColor")&&w.value&&_();const VN=JY,ie=c(),gn=u();if(cJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G})||uJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,fontFamilyArray:il,removeClassesByPrefix:Aa,createFontClassName:wp,clearLinkTags:a,addFontFamilyClass:l,cleanEmptySpans:st}))return!1;const ro=le.closest(w.tags.find(H=>le?.closest(H))||"span");if(U?.collapsed||!tt()){if(!w.value)ro&&U.selectNodeContents(ro);else if(w.value&&St){if(T.type==="button"||v.tagName==="A"&&ro)U.selectNodeContents(ro);else if(y(J,U),w.name==="textLink"&&U.collapsed&&!le.closest("a")){if(!xee(U,d?.()??""))return!1;kt=!0,n(U)}}}(T.type==="button"||v.tagName==="A"||v?.closest("a"))&&tt()&&tt()!==Ie(v)&&ro&&(T.settings.hasOwnProperty("textLink")||T.settings.hasOwnProperty("textUnderline"))&&(U.selectNode(ro),n(U),T.settings.hasOwnProperty("textUnderline")&&v.tagName==="A"&&(v.style.textDecoration=w.value?"underline":"none",rt=!0)),J=window.getSelection(),U=J.getRangeAt(0),mn.range=U,ce=tt(),Array.from(M?.querySelectorAll("span,div")||[]).reverse().forEach(H=>{H.getAttribute("style")===""&&H.removeAttribute("style"),H.hasAttribute("contenteditable")&&H.removeAttribute("contenteditable"),H.hasAttribute("em-edit")&&H.removeAttribute("em-edit"),H.hasAttribute("em-relative")&&H.removeAttribute("em-relative"),H.hasAttribute("class")&&(H.classList.remove("em-relative"),H.classList.length===0&&H.removeAttribute("class"))});let Md=null;zt&&pn&&M?.style?.getPropertyValue?.(pn)?.trim()&&(Ie(M)===ce&&(M.style[_r]=G(w.value?.toString())||"",rt=!0),_r==="color"&&(le===M||v?.closest('[style*="color"]')===M)&&(Md=G(M.style[pn]),M.style.removeProperty(pn),!M?.hasAttribute("em-edit")&&oe&&M&&ie&&M.closest("tr")?.querySelector(`.${O}`)?.style.removeProperty(pn)));let is=null,mt=null;if(zt&&_r==="color"&&["A","LI"].includes(M?.tagName)){let H=M.parentElement;for(;H&&!["BODY","HTML","TD","TH"].includes(H.tagName);){const Ae=H.style.getPropertyValue("color")?.trim();if(Ae){is=G(Ae)||Ae,mt=H,H.style.removeProperty("color");break}H=H.parentElement}}pn&&!(w.value.length===7||w.value.length===4)&&(rt=!0),St&&(!w.value&&w.name!=="fontSize"&&w.name!=="textLink"||w.value)&&(!(w.name==="textUnderline"||w.name==="textStrikethrough")||T.type!=="button")&&!rt&&(w.name!=="fontSize"&&!zt&&Ie(M)===ce?lr(w.command,!1,zt?w.value:w.name==="textLink"?" ":void 0):Ie(M)!==ce&&(T.settings.hasOwnProperty("textColor")&&_(),lr(w.command,!1,zt?String(w.value):w.name==="textLink"?" ":void 0),T.settings.hasOwnProperty("textColor")&&w.value&&aJ(M||le,String(w.value),G))),ce=tt();{const H={parentElement:le,parentNode:Te,parentWrapper:M,selection:J,range:U};mJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,activeElement:v,hasItalicClass:fn,tempStyleClass:qt,checkForWorkClass:hn,removeFormattingTags:Ws,cleanEmptySpans:st,mutableState:H,currentStyle:_r,isProgrammaticSelection:ie,findParentWithFontSizeAndTag:rZ}),le=H.parentElement,Te=H.parentNode,M=H.parentWrapper,J=H.selection,U=H.range,mn.range=U}dJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,activeElement:v,hasItalicClass:fn,tempStyleClass:qt,checkForWorkClass:hn,removeFormattingTags:Ws,cleanEmptySpans:st}),fJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,activeElement:v,hasItalicClass:fn,tempStyleClass:qt,checkForWorkClass:hn,removeFormattingTags:Ws,cleanEmptySpans:st});const ss={parentWrapper:M,range:U,selection:J};hJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,activeElement:v,hasItalicClass:fn,tempStyleClass:qt,checkForWorkClass:hn,removeFormattingTags:Ws,cleanEmptySpans:st,request:T,findOutermostParentWithText:m,mutableState:ss}),M=ss.parentWrapper,U=ss.range,mn.range=U;const sl={parentWrapper:M,range:U,selection:J};if(pJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,activeElement:v,hasItalicClass:fn,tempStyleClass:qt,checkForWorkClass:hn,removeFormattingTags:Ws,cleanEmptySpans:st,request:T,findOutermostParentWithText:m,cleanStrikesInElement:wr,mutableState:sl}),M=sl.parentWrapper,w.value===!1&&M){const H=window.getSelection(),Ae=H&&H.rangeCount>0?H.getRangeAt(0):U,Jt={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]}[w.name];let Qn=!1;Jt&&Jt.forEach(Ee=>{Array.from(M.getElementsByTagName(Ee)).reverse().forEach(en=>{if(!b(en,Ae))return;const Cr=Ie(en);if(!Cr||Cr.trim().length===0)return;const je=en.parentElement;en.hasAttribute("em-edit")&&je&&!je.hasAttribute("em-edit")&&je.setAttribute("em-edit",en.getAttribute("em-edit")||"active"),jd(en),Qn=!0,p(je,M,ce)})}),Qn&&setTimeout(()=>{const Ee=document.querySelector("[em-edit]")||f(ce)||(M?.isConnected?M:null);Ee&&r(Ee,ce)},0)}if(w.value===!0&&M&&St){const H={textStrong:"strong",textItalic:"em",textStrikethrough:"s",textUnderline:"u"},Ae={textStrong:["strong","b"],textItalic:["em","i"],textStrikethrough:["s","strike"],textUnderline:["u"]},Jt=H[w.name],Qn=Ae[w.name];if(Jt&&Qn&&ce&&ce.trim().length>0){const Ee=M,en=Qn.some(io=>Ee.getElementsByTagName(io).length>0),Cr=(Ee.style?.textDecoration||"").toLowerCase(),je=(Ee.style?.textDecorationLine||"").toLowerCase(),xn=Cr.includes("underline")||je.includes("underline"),Pt=Cr.includes("line-through")||je.includes("line-through"),Id=w.name==="textUnderline"&&xn||w.name==="textStrikethrough"&&Pt,Ut=Ie(Ee)===ce;if(!en&&!Id&&Ut){const io=document.createElement(Jt);for(;Ee.firstChild;)io.appendChild(Ee.firstChild);Ee.appendChild(io);try{const I=document.createRange();I.selectNodeContents(io),n(I),U=I,mn.range=I}catch{}setTimeout(()=>{const I=document.querySelector("[em-edit]")||f(ce)||(Ee.isConnected?Ee:null);I&&r(I,ce)},0)}}}const as={parentWrapper:M,parentNode:Te,range:U,selection:J};gJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,isColorChange:zt,tempColor:Md,outerContextColor:is,outerContextElement:mt,stylePropretyName:pn,currentStyle:_r,canselExecCommand:rt,isProgrammaticSelection:ie,request:T,setCustomColor:VN,checkForWorkClass:hn,cleanEmptySpans:st,mutableState:as}),M=as.parentWrapper,Te=as.parentNode;const oo={parentWrapper:M,parentNode:Te,range:U,selection:J};if(yJ({parentElement:le,parentNode:Te,parentWrapper:M,currentSettings:w,isElementList:oe,classNameBullet:O,isEditorTagOutside:St,selectedText:ce,range:U,selection:J,checkForTextNodes:ft,commit:t,getInnerText:Ie,getSelectedText:tt,addNewRange:n,refreshElementSettings:r,findElementWithSelectedText:f,getParentElementOfSelection:h,rgbToHex:G,findOutermostParentWithText:m,activeElement:v,commonStyles:gn,cleanEmptySpansWithParent:st,markNewLink:!kt,mutableState:oo}),U=oo.range,w.name==="textLink"&&w.value===!0&&St&&M&&ce?.trim().length>0){const H=oo.range||U,Ae=ce.trim(),Jt=[...M?Array.from(M.querySelectorAll("a")):[],...M?.parentElement?Array.from(M.parentElement.querySelectorAll("a")):[]],Qn=Jt.find(Ee=>Ie(Ee)?.trim()===Ae)||Jt[0]||null;if(!(L(H,M)||L(H,M.parentElement)||Qn)&&H&&!H.collapsed){const Ee=document.createElement("a"),{color:en,textDecoration:Cr}=C(gn);Ee.setAttribute("target","_blank"),Ee.setAttribute("href",""),kt||Ee.setAttribute("new","true"),Ee.setAttribute("style",`color: ${en}; text-decoration: ${Cr};`);let je=!1;const xn=M.querySelector("editor");if(xn&&Ie(xn)===ce&&xn.querySelector("a")===null){for(;xn.firstChild;)Ee.appendChild(xn.firstChild);xn.appendChild(Ee),je=!0}try{if(!je){const Pt=H.extractContents();Pt.childNodes.length>0&&(Ee.appendChild(Pt),H.insertNode(Ee),je=!0)}}catch{je=!1}if(!je&&Ie(M)===ce){for(;M.firstChild;)Ee.appendChild(M.firstChild);M.appendChild(Ee),je=!0}if(je){try{const Pt=document.createRange();Pt.selectNodeContents(Ee),n(Pt),U=Pt,oo.range=Pt,mn.range=Pt}catch{}r(Ee,ce)}}}if(kt){const H=window.getSelection(),Ae=H?.rangeCount?H.getRangeAt(0).commonAncestorContainer:null;ee=(Ae instanceof Element?Ae:Ae?.parentElement)?.closest("a")??null}const Pd=w.name==="textUnderline"&&!w.value;if((!zt&&rt||Pd)&&st(ce),Oee.has(w.name)){const H=oo.parentWrapper||M||f(ce)||h();H&&st(ce,H)}oe&&le.querySelectorAll(`tr td:first-child > div.${O}, tr td:first-child > editor div.${O}`).forEach(H=>{H.classList.remove(`${O}`)});const al=f(ce);if(al?.hasAttribute("em-edit")||al?.setAttribute("em-edit","active"),ee?.isConnected){const H=ee.closest('[contenteditable="true"]');Ot(()=>H?.focus({preventScroll:!0}));const Ae=document.createRange();Ae.selectNodeContents(ee),n(Ae)}t()}return function(T,w){try{return S(T,w)}finally{E&&(E=!1,document.execCommand("styleWithCSS",!1,"false"))}}}function rL(e,t=Wn){return e.querySelector(".em-element-editor")?.remove(),e.removeAttribute("em-state"),sr(Bs(e),([n])=>(n&&t.copy(e,n),n))}function oL(e,t){const n=rL(e,t.companions);t.commit(),n&&t.setCursorPosition(n)}function iL(e,t){rL(e,t.companions),t.commit()}function sL(e,t){oL(e,t)}function aL(e,t){if(!e.previousElementSibling)return!1;const n=e.previousElementSibling,r=t.companions??Wn;return r.move(e,e.parentNode,r.range(n).first,Tf),t.commit(),j.send({operation:"application_scroll-to",settings:{value:t.scrollTop-n.getBoundingClientRect().height}}),!0}function lL(e,t){if(!e.nextElementSibling)return!1;const n=e.nextElementSibling,r=t.companions??Wn;return r.move(e,e.parentNode,r.range(n).last.nextSibling,Tf),t.commit(),j.send({operation:"application_scroll-to",settings:{value:t.scrollTop+n.getBoundingClientRect().height}}),!0}function cL(e){e.innerHTML="",e.getAttribute("em")==="block"&&e.removeAttribute("em")}function uL(e,t){const n=e.closest("table");e.querySelector("[em-edit]")&&j.send({operation:"application_element_settings_close"});const r=e.closest('[em="group"]');r&&n&&r.querySelectorAll('[em="block"]').length===1?cL(n):(t.companions??Wn).remove(e),t.commit(),n&&t.setCursorPosition(n)}function dL(e,t){return rm(e),aD(t)}function Mee(e,t){const n=document.querySelector('[em-edit="active"]')?.closest('[em="block"]');if(!n)return;const r=[...n.parentElement.children].indexOf(n),o=Pi(n),i=parseFloat(o?.style.paddingTop??"")||0,s=parseFloat(o?.style.paddingBottom??"")||0;if(e.tagName==="TR"||e.tagName==="TABLE"){const a=dL(e,e.querySelector("td")),l=[...e.parentNode.children].indexOf(e),c=Pi(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,b=n.querySelector("td");r>l?(tr(b,"afterbegin",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${i+d}"></td></tr></table>`),b.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(b,"beforeend",`<table cellpadding="0" cellspacing="0" border="0" width="100%" em="atom"><tr><td height="${s+u}"></td></tr></table>`),b.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=dL(e,e),l=Array.prototype.indexOf.call(e.parentElement.children,e);vl(n,r>l?"afterbegin":"beforeend",a)}e.remove(),document.querySelector(".em-element-editor-widget-merge")?.remove(),t.commit(),t.setCursorPosition(n)}function Pee(e,t){const n=Pi(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=Bs(e);if(!c)return;rm(e);const u=[...n?.querySelectorAll(':scope > table:not([em="atom"])')??[]].filter(em).map(f=>({table:f,next:IE(f,"next"),prev:IE(f,"previous")})),d=u.length;u.forEach(({table:f,next:h,prev:m},p)=>{const[b]=Le(c,!0),C=Pi(b);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 L=parseFloat(h.querySelector("td").getAttribute("height"))/2;C.style.paddingBottom=L+"px"}if(m?.getAttribute("em")==="atom"&&m.querySelector("td")?.hasAttribute("height")){const L=parseFloat(m.querySelector("td").getAttribute("height"))/2;C.style.paddingTop=L+"px"}e.insertAdjacentElement("beforebegin",b)}),e.remove(),t.commit()}function Iee(e,t){return e.previousElementSibling?(e.previousElementSibling.before(e),t.commit(),!0):!1}function Dee(e,t){return e.nextElementSibling?(e.nextElementSibling.after(e),t.commit(),!0):!1}function Bee(e,t){const n=document.querySelector('[em="group"]')?.cloneNode(!0);if(!n)return;const r=n.querySelector("table");r&&cL(r),e.after(n),t.commit(),j.send({operation:"application_scroll-to",settings:{value:n.getBoundingClientRect().top+n.getBoundingClientRect().height+(t.iframeOffsetTop||0)}})}function Hee(e,t){oL(e,t)}function Fee(e,t){e.querySelector("[em-edit]")&&j.send({operation:"application_element_settings_close"}),e.remove(),t.commit()}function $ee(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 Wee(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 qee(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:$ee(r)},s=n.selectionLock.acquire();try{j.send(i)}finally{n.commitLockedAsync(!1).finally(()=>{s.release()})}}function zee(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=D$(i)+`
189
+ `+n.HTMLDocument.getOuterHtml(e);navigator.clipboard.writeText(s),setTimeout(()=>{r&&r.style.removeProperty("background-color")},2e3)}function Uee(e,t,n){navigator.clipboard.readText().then(r=>{const o=Sp(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=jee(e,l);if(!c)return!1;s&&Vee(s,n);for(const u of a.reverse())document.head?.prepend(u),document.head?.insertAdjacentHTML("afterbegin",`
190
+ `);return e.removeAttribute("em-state"),e.after(c),!0})){Gee(t.parentNode);return}n.commit(),n.setCursorPosition(e)}).catch(()=>{})}function jee(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 Vee(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+`
191
+ `+[...o.querySelectorAll("style")].map(s=>s.innerHTML).join(`
192
+ `),{restructure:!0,forceMediaMerge:!0}).css;i=t.cssbeautify(i,{indent:" ",autosemicolon:!0}),n.textContent=`
193
+ `+i+`
194
+ `}function Gee(e){e&&(e.style.backgroundColor="rgba(255,0,0,0.3)",setTimeout(()=>{e.style.removeProperty("background-color")},2e3))}function Xee(){return document.body?.classList.contains("em-sandbox-discuss")&&!document.body.classList.contains("em-sandbox-discuss_set-target")}function Kee(){return document.body?.classList.contains("em-sandbox-discuss_set-target")??!1}function Yee(e){const t=e.getAttribute("em-discuss-id");return t&&j.send({operation:"application_discuss_get_comment",settings:{targetId:t}}),!1}function Zee(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"),j.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"),j.send({operation:"application_discuss_set_id",settings:{value:i}})}t.commit()}return{handled:!0,newClickedElement:n}}function Qee(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&&(dn(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(za(m)){const p=m.slice(1),b=document.querySelector(`a[name="${p}"]`);b&&(n.preventDefault(),b.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(Xe.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(Xe.moveUp)){e.handleMoveBlockUp(f);return}if(f&&o.classList.contains(Xe.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(Xe.merge)){e.handleMergeBlocks(f);return}if(f&&o.classList.contains(Xe.unmerge)){e.handleUnmergeBlocks(f);return}const h=o.closest('[em="group"]');if(h&&o.classList.contains(Xe.moveUp)){e.handleMoveGroupUp(h);return}if(h&&o.classList.contains(Xe.moveDown)){e.handleMoveGroupDown(h);return}if(h&&o.classList.contains(Xe.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 b=m.getRangeAt(0).commonAncestorContainer,C=e.findOutermostParentWithText(b);C&&e.setCursorPosition(C);const L=e.getParentElementOfSelection();L&&(o=L)}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 Jee(e){const t=gt(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")}),Ru(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 ete=`
195
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
196
+ <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"/>
197
+ </svg>
198
+ `,tte=`
199
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
200
+ <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"/>
201
+ </svg>
202
+ `,nte=`
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
+ `,rte=`
207
+ <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;">
208
+ <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"/>
209
+ </svg>
210
+ `,ote=`
211
+ <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;">
212
+ <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"/>
213
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
214
+ <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"/>
215
+ </svg>
216
+ `,ite=`
217
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="17" viewBox="0 0 14 17" fill="none">
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
+ `,ste=`
221
+ <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;">
222
+ <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"/>
223
+ </svg>
224
+ `,ate=`
225
+ <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;">
226
+ <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"/>
227
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
228
+ <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"/>
229
+ </svg>
230
+ `,lte=`
231
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
232
+ <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"/>
233
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
234
+ <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"/>
235
+ </svg>
236
+ `,cte=`
237
+ <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;">
238
+ <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"/>
239
+ <circle cx="9" cy="9" r="4" transform="rotate(-90 9 9)" fill="white"/>
240
+ <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"/>
241
+ </svg>
242
+ `,ute=`
243
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
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
+ `,dte=`
247
+ <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;">
248
+ <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"/>
249
+ </svg>
250
+ `,fL=`
251
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
252
+ <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"/>
253
+ </svg>
254
+ `,md=e=>(t,{cellId:n,selected:r})=>r.length?$p(t,n,r):WG(t,n,e),mL={"add-left-column":(e,{cellId:t})=>I0(e,t,"left"),"add-right-column":(e,{cellId:t})=>I0(e,t,"right"),"merge-right-cell":md("right"),"merge-left-cell":md("left"),"split-vertical-cell":(e,{cellId:t})=>H0(e,t,"cols"),"remove-column":(e,{cellId:t})=>RG(e,t),"add-top-row":(e,{cellId:t})=>M0(e,t,"above"),"add-bottom-row":(e,{cellId:t})=>M0(e,t,"below"),"merge-top-cell":md("top"),"merge-bottom-cell":md("bottom"),"split-horizontal-cell":(e,{cellId:t})=>H0(e,t,"rows"),"remove-row":(e,{cellId:t})=>OG(e,t)};function fte(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 mte=[{group:"columns",icon:ete,localeKey:"TABLE_MENU_COLUMNS"},{group:"rows",icon:tte,localeKey:"TABLE_MENU_ROWS"}],hL=[{group:"columns",id:"add-left-column",icon:nte,localeKey:"INSERT_COLUMN_BEFORE_TABLE"},{group:"columns",id:"add-right-column",icon:rte,localeKey:"INSERT_COLUMN_AFTER_TABLE"},{group:"columns",id:"merge-right-cell",icon:ate,localeKey:"MERGE_RIGHT_CELL_TABLE"},{group:"columns",id:"merge-left-cell",icon:ote,localeKey:"MERGE_LEFT_CELL_TABLE"},{group:"columns",id:"split-vertical-cell",icon:dte,localeKey:"SPLIT_CELL_TABLE"},{group:"columns",id:"remove-column",icon:fL,localeKey:"REMOVE_COLUMN_TABLE"},{group:"rows",id:"add-top-row",icon:ite,localeKey:"INSERT_ROW_BEFORE_TABLE"},{group:"rows",id:"add-bottom-row",icon:ste,localeKey:"INSERT_ROW_AFTER_TABLE"},{group:"rows",id:"merge-top-cell",icon:lte,localeKey:"MERGE_TOP_CELL_TABLE"},{group:"rows",id:"merge-bottom-cell",icon:cte,localeKey:"MERGE_BOTTOM_CELL_TABLE"},{group:"rows",id:"split-horizontal-cell",icon:ute,localeKey:"SPLIT_CELL_TABLE"},{group:"rows",id:"remove-row",icon:fL,localeKey:"REMOVE_ROW_TABLE"}],pL={left:"merge-left-cell",right:"merge-right-cell",top:"merge-top-cell",bottom:"merge-bottom-cell"},hte={row:["add-left-column","add-right-column","remove-column"],col:["add-top-row","add-bottom-row","remove-row"]};function pte(e){const t=e==="left"||e==="right"?"row":"col";return[...Object.values(pL).filter(n=>n!==pL[e]),...hte[t]]}function gte(e,t,n,r){const o=r&&n.length?pte(r):[],i=r?n:[];return new Set(hL.map(s=>s.id).filter(s=>!o.includes(s)&&!Hp(mL[s](e,{cellId:t,selected:i}))))}var bte="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;",yte="cursor: pointer; flex: 1; margin: auto; padding-top: 2px;",vte="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;",Ete="padding: 3px; cursor: pointer; font-size: 14px; background-color: #E2DEDD; border-radius: 5px; margin: 1px; margin-top: -4px",Ste="cursor: pointer; margin: auto; margin-top: 5px";function hd(e,t){return $({...t,targetElement:e,insertType:"append"})}function Ka(e){Ot(e)}function wte(){const e=Vi(),t=$({className:la,style:bte});for(const{group:n,icon:r,localeKey:o}of mte){const i=hd(t,{className:`${la}-group`,style:yte,HTMLcontent:r,title:e[o]});i.setAttribute("data-group",n);const s=hd(i,{tag:"ul",className:`${la}-list`,style:vte});hd(s,{tag:"li",className:`${la}-head`,style:Ete,HTMLcontent:r});for(const a of hL.filter(l=>l.group===n))hd(s,{tag:"li",className:`${la}-item`,style:Ste,HTMLcontent:a.icon,title:e[a.localeKey],"data-id":a.id})}return t}function _te(e){return e.querySelector(":scope > ul")}function Cte(e,{target:t,selection:n}){const r=n.base(),o=Hi(t.table),i=r&&Ma(t.table,r);if(!i)return!1;const s=n.selected().map(l=>Ma(t.table,l)).filter(l=>!!l),a=gte(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 gL(e,t){e.querySelectorAll(":scope > div > ul").forEach(n=>{n!==t&&(n.style.display="none")})}function Tte(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")&&Ka(()=>t.show(o))}function Ate(e,t){e.addEventListener("click",gt(n=>Tte(n,t))),e.querySelectorAll("[data-group]").forEach(n=>{n.addEventListener("mouseenter",gt(()=>Ka(()=>t.show(n)))),n.addEventListener("mouseleave",gt(()=>Ka(()=>t.hide())))})}function kte(e){let t=null,n=!1;const r=()=>{const s=t?.root;t=null,s&&Ka(()=>s.remove())},o={show(s){const a=_te(s);if(!t||!a||e.isEditLocked()||!Cte(a,t)){r();return}gL(t.root,a),a.style.display="block"},hide(){t&&gL(t.root)},choose(s){const a=t;r(),a&&e.run(s,a.target,a.selection)}},i=gt(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=wte();Jf(l),Ate(l,o),t={root:l,target:s,selection:a},Ka(()=>s.table.append(l))},close:r,destroy(){r(),n=!0,document.removeEventListener("click",i)}}}function Lte(e,t){return t.map(n=>Ma(e,n)).filter(n=>!!n)}function Nte(e,t){const n=Hi(e).grid[t.row]?.[t.col];return n&&Bp(e,n)||null}function xte(e,t,n,r){const o=Nte(t.table,e);o&&(n.start(o),r.reopen({...t,td:o},n),r.applicationElementSettingsSet({elem:o}))}function Ote(e,t,n,r){const o=n.base();if(!o)return nd(eo("no-cell"));const i={},s=tk(t.table,{isEditLocked:r.isEditLocked,tableModelToHtml:x0},{movesCells:!0,edit:a=>{const l=Hi(a),c=Ma(a,o);if(!c)return eo("no-cell");const u=mL[e](l,{cellId:c,selected:Lte(a,n.selected())});return Hp(u)||(i.focus=fte(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&&xte(i.focus,t,n,r),s}var Rte=".em-element-custom-table";function Mte(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 Pte(e){return e.closest('[em="block"]')??e}function qg(e){if(!(e instanceof Element)||e.closest(".em-table-menu"))return null;const t=e.closest(Rte),n=t&&Mte(t,e);return t&&n?{table:t,td:n,block:Pte(t)}:null}function Ite(e){const t=kte({isEditLocked:e.isEditLocked,run:(n,r,o)=>{Ote(n,r,o,{...e,reopen:(i,s)=>t.open(i,s)})}});return n=>{const r=qg(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 Dte(){Ou({scrollTop:V.get("scrollTop")})}function Bte(e){const{htmlDocument:t,commit:n}=e,r=()=>({commit:n,companions:e.companions,setCursorPosition:e.setCursorPosition,scrollTop:V.get("scrollTop"),iframeOffsetTop:V.get("iframeOffsetTop"),applicationElementSettingsSet:e.applicationElementSettingsSet}),o=Qee({getLockEditor:()=>e.editLock.isIntegratorLocked(),setEditorFocus:e.setEditorFocus,setCursorPosition:e.setCursorPosition,getParentElementOfSelection:dc,findOutermostParentWithText:Em,setBlockGroupControlsPosition:Dte,applicationElementSettingsSet:e.applicationElementSettingsSet,insertTextAtomIntoEmptyNarrowTable:e.insertTextAtomIntoEmptyNarrowTable??(()=>!1),handleRemoveAtom:i=>tL(i,{getElementParent:s=>ji(s),setCursorPosition:e.setCursorPosition,getVariableByIcon:Ca,commit:n,companions:e.companions}),handleCloneAtom:i=>iL(i,r()),handleMoveBlockUp:i=>aL(i,r()),handleMoveBlockDown:i=>lL(i,r()),handleRemoveBlock:i=>uL(i,r()),handleCloneBlock:i=>sL(i,r()),handleCopyBlock:(i,s)=>zee(i,s,{HTMLDocument:t}),handlePasteBlock:(i,s)=>Uee(i,s,{HTMLDocument:t,parseFromString:Le,getOuterHtml:Dt,minify:_o,cssbeautify,insertAdjacentHTML:tr,setBlockMaxWidth:a=>vg(a,t),setFloatBlocksWidth:a=>bg(a,t),checkBlockAdaptivity:wu,commit:n,setCursorPosition:e.setCursorPosition,emailWidth:V.get("emailWidth"),appName:V.get("appName")}),handleMergeBlocks:i=>Mee(i,r()),handleUnmergeBlocks:i=>Pee(i,r()),isAddBlockMenuClick:Wee,handleAddBlockMenu:(i,s)=>qee(i,s,{removeAllAttributes:Mr,selectionLock:e.selectionLock,commitLockedAsync:e.commitLockedAsync}),addBlockToProject:i=>DV(i,{HTMLDocument:t,messageService:e.messageService}),handleMoveGroupUp:i=>Iee(i,r()),handleMoveGroupDown:i=>Dee(i,r()),handleAddGroup:i=>Bee(i,r()),handleCloneGroup:i=>Hee(i,r()),handleRemoveGroup:i=>Fee(i,r()),isDiscussViewMode:Xee,isDiscussSetTargetMode:Kee,handleDiscussViewClick:Yee,handleDiscussSetTargetClick:i=>Zee(i,{makeId:_3,commit:n}),handleCustomTableClick:Ite({selections:e.tableSelections,isEditLocked:()=>e.editLock.isTextLocked(),commit:()=>n(),applicationElementSettingsSet:e.applicationElementSettingsSet})});document.onclick=gt(o),Jee({commit:n,messageService:e.messageService})}function bL(e,t){const n=JSON.stringify({settings:t});return{target:e,dataTransfer:{getData:r=>r==="Text"?n:""},preventDefault:()=>{},stopPropagation:()=>{}}}function Hte(e){return!e.closest(".em-element-editor-widget")}function Fte(e,t){if(t.lockEditor||!e.isTrusted)return!1;const n=Hk();if(!n)return!1;const r=e.target;if(!(r instanceof Element)||!ve(r)||!Hte(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;Kk(bL(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;Gk(bL(r,o.settings),o,t.blockDropCtx)}else return!1;if(!Hk())return e.preventDefault(),e.stopPropagation(),Vk(),t.commit(),!0}catch{return!1}return!1}var yL="application/x-emailmaker-social-reorder";function zg(e){return e.closest('table[em-type="social"]')}function vL(e){return(e.querySelector('table[role="presentation"]')||e.querySelector("table"))?.querySelector("tr")}function EL(e){return Array.from(e.querySelectorAll(":scope > td[em-platform], :scope > td[data-em-platform]"))}function $te(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==="&nbsp;"||n.textContent===" "})}function Wte(e,t){const n=$te(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 qte(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=zg(n);if(!r)return;const o=vL(r);if(!o)return;const i=EL(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(yL,l),a.effectAllowed="move"}function zte(e,t){const n=e.dataTransfer;if(!n||!Array.from(n.types||[]).includes("application/x-emailmaker-social-reorder"))return!1;let r=n.getData(yL);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=zg(i);if(!s)return!1;const a=vL(s);if(!a)return!1;const l=EL(a);if(l.length<2)return!1;const c=l.indexOf(i);if(c<0)return!1;const u=l[o];if(!u||zg(u)!==s)return!1;if(o===c)return!0;const d=[...l];return d.splice(o,1),d.splice(c,0,u),Wte(a,d),s.setAttribute("em-edit","active"),t.applicationElementSettingsSet({elem:s}),!0}function Ute(){return{targetBlock:null,newTargetblock:null,atomReplaced:null}}function jte(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=tg(t);setTimeout(()=>e.messageService.send({operation:"application_open-image-ai-popup",src:n}),1e3)}function Vte(e,t,n){if(t.editLock.isIntegratorLocked())return;let r;try{e.preventDefault(),e.stopPropagation();const o=UJ(e,{lockEditor:!1,applicationElementSettingsSet:t.applicationElementSettingsSet,messageService:t.messageService})||zte(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")||"{}");Gk(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{Kk(e,{...t.atomDropContext(),mutableState:n})}catch{}}Vk(),t.commit()}finally{Promise.resolve().then(()=>{r?.release(),jte(t)})}}function Gte(e){const{dragState:t}=e,n=(r,o,i)=>document.addEventListener(r,gt(o),i);document.addEventListener("drag",r=>r.preventDefault(),!1),n("dragstart",r=>qte(r,{lockEditor:e.editLock.isIntegratorLocked()}),!0),n("dragstart",r=>jJ(r,{lockEditor:e.editLock.isIntegratorLocked(),commit:o=>{e.commit(o)},messageService:e.messageService,mutableState:t}),!1),n("dragover",r=>GJ(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("dragenter",r=>XJ(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t,requireEvenEmptyCell:e.requireEvenEmptyCell}),!1),n("dragleave",r=>ZJ(r,{lockEditor:e.editLock.isIntegratorLocked(),mutableState:t}),!1),n("drop",r=>Vte(r,e,t),!1),n("dragend",r=>VJ(r,{lockEditor:e.editLock.isIntegratorLocked(),messageService:e.messageService}),!1)}function Xte(e){const{htmlDocument:t}=e,n=f=>e.commit(f),r=Ute(),o=e.commonStylesApply??(f=>f0(f,h=>e.commit(h))),i=f=>{xT(f,()=>e.commit())},s=f=>vg(f,t),a=f=>bg(f,t),l=()=>({messageService:e.messageService,companions:e.companions,isJsonString:S3,getOuterHtml:Dt,minify:_o,cssbeautify,HTMLDocument:t,_setDocumentStyles:(f,h)=>Ep(f,h),commonStylesApply:o,commonStylesApplyToBlock:Np,setImageWidth:hp,fitMovedImage:NT,setFloatBlocksWidth:a,fitImagesToColumns:yg,insertCountdown:i}),c=()=>({...l(),lockEditor:e.editLock.isIntegratorLocked(),commit:n,emailWidth:V.get("emailWidth")??null,parseFromString:f=>Le(f),isTableElement:SR,uptimeCountdown:pp,setBlockMaxWidth:s,checkBlockAdaptivity:wu,applicationElementSettingsSet:e.applicationElementSettingsSet});return{insertContext:()=>({selectionLock:e.selectionLock,commit:()=>e.commit(),lockEditor:e.editLock.isIntegratorLocked(),emailWidth:V.get("emailWidth"),iframeOffsetTop:V.get("iframeOffsetTop"),previewHeight:V.get("previewHeight"),parseFromString:f=>Le(f),getOuterHtml:Dt,HTMLDocument:t,minify:_o,cssbeautify,insertAdjacentHTML:(f,h,m)=>BE(f,h,m),messageService:e.messageService,setDocumentStyles:f=>Ep(f,{minify:_o,cssbeautify,HTMLDocument:t}),setImageWidth:hp,commonStylesApply:o,commonStylesApplyToBlock:Np,insertCountdown:i,uptimeCountdown:pp,setBlockMaxWidth:s,setFloatBlocksWidth:a,fitImagesToColumns:yg,checkBlockAdaptivity:wu,setAtomReplaced:f=>{r.atomReplaced=f},assetsRoot:e.assetsRoot}),register:()=>{document.addEventListener("click",gt(f=>{e.editLock.isIntegratorLocked()||Fte(f,{lockEditor:!1,commit:n,atomDropCtx:{...l(),mutableState:r},blockDropCtx:{...c(),mutableState:r}})}),!0),Gte({dragState:r,commit:n,messageService:e.messageService,applicationElementSettingsSet:e.applicationElementSettingsSet,selectionLock:e.selectionLock,editLock:e.editLock,atomDropContext:l,blockDropContext:c,requireEvenEmptyCell:e.requireEvenEmptyCell})}}}function Kte(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 SL='<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>',wL='<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>',Ug='<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>',Yte='<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>',Zte='<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>',pd='<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>',Qte='<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>',Jte='<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>',Ya='<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>',_L='<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>',ene='<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>',jg='<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 gd={getLocale:Vi,commit:po},tne=".em-prevent-action";function nne(){return V.get("emailWidth")||475}function rne(){return V.get("copyPasteEnabled")||!1}function one(){return V.get("saveBlockEnabled")||!1}function ine(){return V.get("blocksAddPanelEnabled")||!1}function sne(){return V.get("blocksTemplateEnabled")||!1}function ane(){return V.get("codeMode")||!1}var CL=".em-mob-wrap, .noresp-em-mob-wrap";function TL(e){return Array.from(document.querySelectorAll(e)).find(FT)??null}function bd(e,t){const n=gd.getLocale(),r=nne(),o=rne(),i=one(),s=ine(),a=ane();if(t==="atom"){e.setAttribute("em-state","active"),e.getBoundingClientRect().left<50&&e.setAttribute("em-state","active-inside");const l=$({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=$({targetElement:l,insertType:"append",className:"em-element-editor-widget"});$({targetElement:c,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(Ug,`${xe} ${Xe.drag}`,'style="transform: rotate(90deg)"'),title:n.REORDER_ATOM}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ya,`${xe} em-analytics__atoms-panel-edit`),title:n.EDIT_ATOM}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(pd,`${xe} em-analytics__atoms-panel-clone`),title:n.CLONE_ATOM}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(jg,`${xe} em-analytics__atoms-panel-remove`),title:n.REMOVE_ATOM}),Ru(gd.commit)}if(t==="block"){e.setAttribute("em-state","active");const l=$({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=$({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=$({targetElement:c,insertType:"append",className:"em-element-editor-group"});if($({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(Ug,`${xe} ${Xe.drag}`),title:n.REORDER_BLOCK}),$({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="block"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(wL,`${xe} ${Xe.moveUp}`),title:n.REORDER_BLOCK_UP}),$({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="block"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(SL,`${xe} ${Xe.moveDown}`),title:n.REORDER_BLOCK_DOWN}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ya,`${xe} em-analytics__blocks-panel-edit`),title:n.EDIT_BLOCK}),o){const m=$({targetElement:c,insertType:"append",className:"em-element-editor-group"});$({targetElement:m,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(pd,`${xe} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK}),$({targetElement:m,insertType:"append",className:"em-element-editor-widget-copy",HTMLcontent:Oe(Zte,`${xe} em-analytics__blocks-panel-copy`),title:n.COPY_BLOCK_TO_CLIPBOARD}),$({targetElement:m,insertType:"append",className:"em-element-editor-widget-paste",HTMLcontent:Oe(Yte,`${xe} em-analytics__blocks-panel-paste`),title:n.PASTE_BLOCK_FROM_CLIPBOARD})}else $({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(pd,`${xe} em-analytics__blocks-panel-clone`),title:n.CLONE_BLOCK});if(e.closest(tne))return;const d=TL('[em-edit="active"]'),f=TL('[em-state^="active"]');if(d&&f&&(d.querySelector(CL)&&f.querySelector(CL)||d.closest(".em-structure")&&f.closest(".em-structure"))&&d!==c.closest('[em-edit="active"]')&&$({targetElement:c,insertType:"append",className:"em-element-editor-widget-merge",HTMLcontent:Oe(Qte,`${xe} ${Xe.merge} em-analytics__blocks-panel-merge`),title:n.MERGE_BLOCK}),Ta(c.closest('[em="block"]')??c).flatMap(m=>Array.from(m.querySelectorAll(":scope > table"))).length>1&&c.closest('[em="block"]')?.querySelectorAll(".em-mob-wrap")&&$({targetElement:c,insertType:"append",className:"em-element-editor-widget-unmerge",HTMLcontent:Oe(Jte,`${xe} ${Xe.unmerge} em-analytics__blocks-panel-unmerge`),title:n.UNMERGE_BLOCK}),i&&$({targetElement:c,insertType:"append",className:"em-element-editor-widget-add-block",HTMLcontent:Oe(ene,`${xe} em-analytics__blocks-panel-save`),title:n.SAVE_TO_BLOCKS}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(jg,`${xe} em-analytics__blocks-panel-remove`),title:n.REMOVE_BLOCK}),s&&!e.querySelector(".em-element-block-add")&&!a){const m=$({targetElement:e,insertType:"append",className:"em-element-block-add"});e.getBoundingClientRect().bottom+1>document.body.getBoundingClientRect().height&&m.classList.add("out-of-iframe"),$({targetElement:m,insertType:"append",className:"em-element-block-add-plus",HTMLcontent:`${Oe(_L,`${xe} ${Xe.add}`)} ${n.ADD_BLOCK}`,title:n.ADD_BLOCK});const p=$({targetElement:m,insertType:"append",className:"em-element-block-add-icons"});$({targetElement:p,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}),$({targetElement:p,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}),$({targetElement:p,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}),sne()&&$({targetElement:p,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}),$({targetElement:p,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})}Ru(gd.commit);const h=e.closest('[em="block"]');h&&(h.onmouseleave=function(){Yi(void 0)})}if(t==="group"){e.tagName==="TR"?e.querySelector("td")?.setAttribute("em-state","active"):e.setAttribute("em-state","active");const l=$({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=$({targetElement:l,insertType:"append",className:"em-element-editor-widget"}),u=$({targetElement:c,insertType:"append",className:"em-element-editor-group"});$({targetElement:u,insertType:"append",className:"em-element-editor-widget-drug",HTMLcontent:Oe(Ug,`${xe} ${Xe.drag}`),title:n.REORDER_BLOCK}),$({targetElement:u,insertType:"append",className:"em-element-editor-widget-up"+(e.closest('[em="group"]')?.previousElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(wL,`${xe} ${Xe.moveUp}`),title:n.REORDER_BLOCK_UP}),$({targetElement:u,insertType:"append",className:"em-element-editor-widget-down"+(e.closest('[em="group"]')?.nextElementSibling?"":" em-element-editor-widget-noactive"),HTMLcontent:Oe(SL,`${xe} ${Xe.moveDown}`),title:n.REORDER_BLOCK_DOWN}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-add",HTMLcontent:Oe(_L,`${xe} ${Xe.add} em-analytics__groups-panel-add`),title:n.ADD_GROUP}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-edit",HTMLcontent:Oe(Ya,`${xe} em-analytics__groups-panel-edit`),title:n.EDIT_GROUP}),$({targetElement:c,insertType:"append",className:"em-element-editor-widget-clone",HTMLcontent:Oe(pd,`${xe} em-analytics__groups-panel-clone`),title:n.CLONE_GROUP}),document.querySelectorAll('[em="group"]').length>1&&$({targetElement:c,insertType:"append",className:"em-element-editor-widget-remove",HTMLcontent:Oe(jg,`${xe} em-analytics__groups-panel-remove`),title:n.REMOVE_GROUP}),Ru(gd.commit)}}function Yi(e){if(document.documentElement.classList.contains("em-resize-start"))return;const t=V.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 lne(e,t){if(!e?.isConnected)return;let n;if(n=e.closest('[em="atom"]')){if(Yi(n),n.querySelector(".em-element-editor.of-atom")||bd(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&&bd(r.tagName==="TR"?r.querySelector("td"):r,"block"),t.setBlockGroupControlsPosition()}}else(n=e.closest('[em="block"]'))?(Yi(n),n.querySelector(".em-element-editor.of-block")||(bd(n.tagName==="TR"?n.querySelector("td"):n,"block"),t.setBlockGroupControlsPosition())):(n=e.closest('[em="group"]'))&&(Yi(n),n.querySelector(".em-element-editor.of-group")||(bd(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:Za,NEW_EDITOR:Vg}=GA,{TRIM_SPACES:Qa,EMPTY_TEXT:cne}=XA;function une(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=Ql(f).counterpart(n)??n,p=dY(m,h);if(!p)return!0;const{firstCellText:b,firstCellHtmlNoText:C,wrappedSecondCellHtml:L}=p;return o==="start"||o==="end"?dne(n,f,h,c,u,o,b,C,L,a):o==="inside"&&fne(n,f,h,c,a),l(),s(),!0}function dne(e,t,n,r,o,i,s,a,l,c){const u=e.querySelector("div");u&&u.classList.add(Za);const d=OA(a,s),f=OA(l," "),h=i==="end"?EY(f):f,m=Jl(t),p="<tr>"+d+h+"</tr>",b=Ki(m),C=fY(b,p,Za,i==="start"),L=Ki(C);go(t),Wa(t,L);const k=t.querySelector(`.${Za}`)?.closest("tr"),y=i==="start"?k?.previousElementSibling:k?.nextElementSibling;y&&RA(y),n===r&&cg(t),vY(t,r,o,Qa);const g=i==="start"?t.querySelector(".remove-start-element-position"):t.querySelector(".remove-new-editor-element");return g&&AL(g,t,c),g}function fne(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)?bY(s,a,l):null;return c?(RA(c.row),s.after(c.row),go(t),gY(t),c.content.classList.add(Vg),n===r&&cg(t),AL(c.content,t,o,!0),c.content):null}function AL(e,t,n,r=!1){e.textContent&&e.textContent.length>0&&Xi(e,Ge(e).replace(Qa,"")),cne.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),Ds(s,a)}}r&&o&&Ot(()=>o.focus())}function mne(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",b=n.closest(`table.${u}`)||n.closest(`table.${d}`);if(!b)return!0;const C=n.querySelector("div");C&&C.classList.add(Za);const L=Jl(b),k=Ki(L),y=yY(k,Za,Vg,p);go(b),Wa(b,y);const g=b.querySelector(".remove-new-editor-element");if(g){l(g,!0);const E=b.querySelector("editor"),_=E?.querySelector("div")?.childNodes[0],S=window.getSelection();if(S&&S.rangeCount>0){const v=S.getRangeAt(0);if(_&&_.nodeType===Node.TEXT_NODE){const T=_.textContent||"";v.setStart(_,T.replace(Qa,"").length)}else E&&v.selectNodeContents(E);v.collapse(!0),Ds(S,v)}}return c(),a(),!0}function hne(e,t,n){return(e.keyCode===39||e.key==="ArrowRight")&&(t==="end"||n)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1}function pne(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=(...U)=>Ot(()=>t.setCursorSafely(...U)),{classNameOl:m,classNameUl:p,isList:b}=o;if(!((n?e.code==="Backspace":e.keyCode===46||e.keyCode===8)&&b)||!(!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,L=l.closest("tr");if(!L)return!0;const k=L.previousElementSibling;if(!k&&!s)return!0;const y=s?r.querySelector("div"):L.querySelector("tr td:nth-child(2)")?.querySelector("div"),g=y?Ge(y):"",E=g?g.split(" ")[0]:"";E.replace(Qa,"");const _=k?.querySelector("tr td:nth-of-type(2)");if(!_)return!0;const S=_.querySelector("div");if(!S)return!0;S.classList.add(Vg);const v=Ge(S),T=`${v}${g}`;go(L.parentNode??L),L.remove();const w=S.closest(`table.${m}`)||S.closest(`table.${p}`);if(!w)return!0;const N=Ge(w),x=Ki(N);Wa(w,x),C===m&&cg(w);const D=w.querySelector(".remove-new-editor-element");if(!D)return d(),c(),!0;const P=T.replace(Qa,"");Xi(D,`${P}&nbsp;`),u(D,!0);const O=D.closest("editor");if(!O)return d(),c(),!0;const z=window.getSelection(),he=document.createRange(),oe=O.querySelector("div");if(!oe||!z)return d(),c(),!0;const Re=O.textContent||"",J=E?Re.indexOf(E):-1;if(J!==-1&&E){const U=f(oe,J);if(U)h(he,z,U.node,U.offset);else{const Et=oe.childNodes[0];Et&&h(he,z,Et,0)}}else{const U=document.createElement("div");U.innerHTML=v;const Et=(U.textContent||"").length,le=f(oe,Et);if(le)h(he,z,le.node,le.offset);else{const Te=document.createTreeWalker(oe,NodeFilter.SHOW_TEXT,null);let rt=null;for(;Te.nextNode();)rt=Te.currentNode;rt&&h(he,z,rt,(rt.textContent||"").length)}}return Ot(()=>O.focus()),d(),c(),!0}function gne(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 bne(e){if(!e)return!1;const t=e.closest("li");return Ju(t)}function yne(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 vne(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 Ene(e){const t=window.getSelection();if(!t||t.rangeCount===0)return Ge(e);const n=t.getRangeAt(0),r=document.createRange();return r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset),kL(e,r)}function kL(e,t){const n=document.createElement("div");return n.appendChild(t.cloneContents()),on(e,n),ii(n),Ze(n)}function Sne(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),kL(e,r)}function Zi(e){const t=window.getSelection();if(!t)return;const n=document.createRange();n.selectNodeContents(e),n.collapse(!0),t.removeAllRanges(),t.addRange(n)}function Ja(e,t){e.hasAttribute("em-edit")&&(e.removeAttribute("em-edit"),t.setAttribute("em-edit","active"))}function wne(e,t){const n=document.createElement("br"),r=document.createElement("span");return r.innerHTML="&nbsp;",Ja(e,r),t.parentNode?.insertBefore(r,t),t.parentNode?.insertBefore(n,r),e.remove(),t.querySelectorAll("li").length===0&&t.remove(),Zi(r),r}function _ne(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="&nbsp;",Ja(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(),Zi(a),a}function Cne(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(!bne(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=yne(i),l=vne(i,s);switch(a.position){case"empty":Tne(i,s,l,t);break;case"start":Ane(i,s,t);break;case"end":kne(i,s,t);break;case"middle":Lne(i,s,t)}return t.commit(),!0}function Tne(e,t,n,r){switch(n){case"last":const o=document.createElement("li");o.setAttribute("style",Xn.LIST_ITEM),o.innerHTML="&nbsp;",e.after(o),Ja(e,o),Zi(o);break;case"first":wne(e,t);break;case"middle":_ne(e,t)}}function Ane(e,t,n){const r=document.createElement("li");r.setAttribute("style",Xn.LIST_ITEM),r.innerHTML="&nbsp;",e.before(r),Zi(e)}function kne(e,t,n){const r=document.createElement("li");r.setAttribute("style",Xn.LIST_ITEM),r.innerHTML="&nbsp;",e.after(r),Ja(e,r),Zi(r)}function Lne(e,t,n){const r=Ene(e),o=Sne(e);Xi(e,r||"&nbsp;");const i=document.createElement("li");i.setAttribute("style",Xn.LIST_ITEM),Xi(i,o||"&nbsp;"),e.after(i),Ja(e,i),Zi(i)}function Nne(e){const t=r=>jh({target:r.target},o=>e.commit(o)),n=()=>V.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?uY(l):null,d=l?.closest("tr")?.querySelector("tr td:nth-of-type(2) div"),f=o.target,h=ed(f),{isList:m}=h,p=d?.textContent===l?.textContent,b=l?XA.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 L=bee(o,!!C);if(L){o.preventDefault(),Zk(e.messageService,L);return}if(o.altKey&&o.keyCode===88){o.preventDefault(),e.messageService.send({operation:"application_action",action:"toggle_editor"});return}if(wee(o,{commit:e.commit}))return;Cee(o,{commit:e.commit}),o.key==="Enter"&&!o.ctrlKey&&!o.metaKey&&!o.altKey&&!o.isComposing&&kE();const k={getElementParent:S=>ji(S),setCursorPosition:e.setCursorPosition,removeElementEditors:()=>Yi(void 0),getVariableByIcon:Ca,removeEmptyParents:S=>Xa(S,e.companions),getAllComments:_U,isVariableComment:PT,getVariableIcon:S=>AU(S),commit:e.commit,messageService:e.messageService,companions:e.companions};if(Eee(o,m,u,k))return;if(o.keyCode===27){const S=document.querySelector(".em-editor-wrapper");S?.style&&(S.style.display="none"),Mr("em-edit"),Ot(()=>document.querySelectorAll("editor").forEach(v=>v.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 y=c?o.keyCode===88:o.keyCode===53;if((c?o.metaKey:o.altKey)&&o.shiftKey&&y&&(o.preventDefault(),l&&e.messageService.send({operation:"application_action",action:"toggle_strikethrough"})),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"})),Cne(o,{commit:e.commit})||Tee(o,l,m,p,{commit:e.commit}))return;if(C&&o.keyCode===86){e.setIsPasteFromContextMenu(!1);const S=v=>{cc(v,!1,n(),t,e.commit),document.removeEventListener("paste",S)};document.addEventListener("paste",S)}else t(o);const g={activeElem:l,listContext:h,cursorPositionType:u,isTargetCell:p,isEmptyText:b,commit:e.commit,wrapEditor:e.wrapEditor,removeTemporaryListClasses:()=>ZY()};if(une(o,g)||(hne(o,u,b),mne(o,g)))return;const E={...g,parentElement:a,findNodeAtPosition:QA,setCursorSafely:pZ};if(pne(o,E)||gne(o,m,p))return;const _={setCursorInsideSpan:LU,isCaretAtEndOfStandardElement:NU,setCursorPositionSimple:xU,commit:e.commit};See(o,_)&&e.commit()}}function xne(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&&zC(n,e.key)){po(!0);return}lr("insertText",!1,e.key)}}function One(e){const t=n=>xne(n,e);return document.addEventListener("keydown",t,!0),{dispose(){document.removeEventListener("keydown",t,!0)}}}function Rne(e){const t=Kte({handlePasteTextFragment:cc,getCommonStyles:()=>V.get("commonStyles"),changeMsoValue:n=>jh({target:n.target},r=>e.commit(r)),commit:e.commit});document.addEventListener("keydown",Nne({...e,setIsPasteFromContextMenu:n=>t.setFromContextMenu(n)}),!1),document.addEventListener("beforeinput",n=>vee(n,e),!0),One(e.editLock)}var Mne='<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>',yd=4;function Pne(e,t){return e.left<yd||e.right-e.left>t-8?yd-e.left:e.right>t-yd?t-yd-e.right:0}var Qi=null,Gg=null;function Xg(e,t){if(typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))return;Qi||(Qi=new CSSStyleSheet),document.adoptedStyleSheets.includes(Qi)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,Qi]),Qi.replaceSync("");const n=e.getBoundingClientRect();if(n.width===0)return;Gg=e;const r=Math.round(Pne(n,document.documentElement.clientWidth));r!==0&&Qi.replaceSync(`${t} { margin-left: ${r}px; }`)}function Ine(e,t,n){e.addEventListener("mouseenter",()=>{Gg=null,Xg(t,n)}),e.addEventListener("mousemove",()=>{Gg!==t&&Xg(t,n)}),t.addEventListener("mouseenter",()=>Xg(t,n))}function Po(e,t){return{settings:e,elem:t}}var Ye={applicationElementSettingsSet:e=>R(It,De)(e),setCursorPosition:e=>R(It,wt)(e),commit:po};function Dne(){return V.get("emailWidth")||475}function vd(){return document.documentElement.clientWidth<=Dne()}function Kg(e,t,n,r){const o=e;o.style.cursor=n,o.mousemove=t;const i=()=>{window.getSelection()?.removeAllRanges(),Ye.applicationElementSettingsSet({elem:e});const s=document.querySelector("[em-edit]");s&&Ye.setCursorPosition(s),Fe(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(()=>{Fe(document.documentElement,!1,"em-resize-start"),Ye.commit(!1)})}}function Io(e,t,n){Kg(e,t,"ns-resize",n)}function el(e,t,n){Kg(e,t,"ew-resize",n)}function Bne(e,t,n){Kg(e,t,"nwse-resize",n)}function Do(e,t){let n=null,r=0;const o=vd();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?ki(Po({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");ki(Po(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?da(Po({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?da(Po({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?ki(Po({mobileHeight:{value:r>0?r:0,dim:"px",classNamePrefix:"em-mob-height-"}},n)):n.setAttribute("height",String(r))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Ye.commit()}function Bo(e){let t=null;const n=vd();if(e.closest('div[style*="height"][style*="line-height"]')){if(t=e.closest('div[style*="height"][style*="line-height"]'),!t)return;parseInt(t.style.height)<=0?t.remove():Ye.applicationElementSettingsSet({elem:t})}else if(e.closest(".em-gap")){if(t=e.closest(".em-gap"),!t)return;Ye.applicationElementSettingsSet({elem:bp(t)})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingTop")){if(t=e.closest(".em-vindent-paddingTop"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-top"):r&&Ye.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingBottom")){if(t=e.closest(".em-vindent-paddingBottom"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.height)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-bottom"):r&&Ye.applicationElementSettingsSet({elem:r})}else{if(t=e.closest("td"),!t)return;const r=t.getAttribute("height");r&&parseInt(r)<=0?t.closest("table")?.remove():Ye.applicationElementSettingsSet({elem:t})}t&&Ye.commit()}function Ji(e,t){let n=null,r=0;const o=vd();if(e.closest(".em-element-resize-img-container")){const i=e.closest(".em-element-resize-img-container")?.querySelector("img");if(!i)return;const s=i.clientWidth+t;i.style.maxWidth=s+"px",i.setAttribute("width",String(s)),Ye.commit()}else if(e.closest(".em-gap")){if(n=e.closest(".em-gap"),!n)return;if(n.classList.add("em-hover"),r=n.clientWidth+t,r>=0){const i=n.clientWidth,s=Array.from(n.closest("tr")?.querySelectorAll(".em-mob-wrap:nth-child(odd)")||[]).map(u=>u.clientWidth),a=s.reduce((u,d)=>u+d,0),l=a+(s.length-1)*i,c=n.closest("tr");if(!c)return;if(l-3<=c.clientWidth||t<=0){let u=Array.from(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")).filter(b=>b.dataset.percent).map(b=>b.dataset.percent);u.length||(u=s.map(b=>((b||0)/a*100).toFixed(1)),fc(c.querySelectorAll(".em-mob-wrap:nth-child(odd)")));const d=l-(s.length-1)*r,f=(b,C)=>Math.round(C*parseFloat(b)/100);let h=s.map((b,C)=>f(u[C],d));const m=l-(h.reduce((b,C)=>b+C,0)+(s.length-1)*r);if(m!==0){const b=h.length-Math.abs(m);h=h.map((C,L)=>b<=L?C+(m>0?1:-1):C)}const p=h;c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((b,C)=>{Array.from(b.querySelectorAll("table[width]")).filter(L=>!L.getAttribute("width")?.includes("%")).forEach(L=>{+(L.getAttribute("width")||0)<=p[C]&&(L.style.maxWidth=String(p[C]),L.setAttribute("width","100%"))})}),n.style.width=r+"px",c.querySelectorAll(".em-mob-wrap:nth-child(odd)").forEach((b,C)=>b.setAttribute("width",String(p[C]))),c.querySelectorAll(".em-gap").forEach(b=>{b.parentElement?.setAttribute("width",String(r)),b.style.width=r+"px";const C=b.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?da(Po({mobilePadding:{left:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingLeft=r+"px",i.querySelectorAll(":scope > table").forEach(s=>td(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?da(Po({mobilePadding:{right:r>0?r:0,classNamePrefix:"em-mob-padding_"}},i)):i&&(i.style.paddingRight=r+"px",i.querySelectorAll(":scope > table").forEach(s=>td(s)))}if(n&&!e.closest(".em-gap")){if(r>=0){const i=n.querySelector(".em-element-vindent-value, .em-element-gap-value");i&&(i.innerHTML=r+"px")}r<30?n.classList.add("em-vindent_low"):n.classList.remove("em-vindent_low")}n&&Ye.commit()}function es(e){let t=null;const n=vd();if(e.closest(".em-element-resize-img-container")){const r=e.closest(".em-element-resize-img-container")?.querySelector("img");r&&(Ye.applicationElementSettingsSet({elem:r}),Ye.commit())}else if(e.closest(".em-gap"))t=e.closest(".em-gap"),t&&Ye.applicationElementSettingsSet({elem:bp(t)});else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingLeft")){if(t=e.closest(".em-vindent-paddingLeft"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-left"):r&&Ye.applicationElementSettingsSet({elem:r})}else if(e.closest(".em-vindent")?.classList.contains("em-vindent-paddingRight")){if(t=e.closest(".em-vindent-paddingRight"),!t)return;t.classList.remove("em-hover");const r=t.parentElement;parseInt(t.style.width)<=0?n&&r?Ye.applicationElementSettingsSet({elem:r}):r&&r.style.removeProperty("padding-right"):r&&Ye.applicationElementSettingsSet({elem:r})}t&&Ye.commit()}var LL={getLocale:Vi,commit:po,messageService:j},Hne=".em-prevent-action",NL=new WeakSet;function Fne(){return V.get("emailWidth")||475}function $ne(){return V.get("isLeftButtonDown")||!1}function Wne(){return V.get("editImageControlEnabled")||!1}function xL(){return V.get("imageCenterEditorEnabled")||!1}function qne(){return V.get("imageCenterStockEnabled")||!1}function zne(){return V.get("imageCenterGifEnabled")||!1}function Une(){return V.get("elementAIimageEnabled")||!1}function jne(e){if(document.body?.classList.contains("em-native-file-drag"))return;const t=LL.getLocale(),n=Fne(),r=$ne(),o=xL(),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=$({targetElement:e,insertType:"append",className:"em-element-resize-height"});$({targetElement:e,insertType:"append",className:"em-element-vindent"}),$({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Io(m,function(p){Do(m,p.movementY)},function(){Bo(m)})}if(e.closest(Hne))return;if((e.classList.contains("em-vindent")||e.closest(".em-vindent"))&&e.getAttribute("height")&&!e.querySelector(".em-element-vindent-value")){const m=yo(e,"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;$({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=$({targetElement:e,insertType:"append",className:"em-element-resize-height"}),p=$({targetElement:e,insertType:"append",className:"em-element-vindent"});$({targetElement:p,insertType:"append",className:"em-element-vindent-value",HTMLcontent:e.style.height}),$({targetElement:e,insertType:"append",className:"em-element-vindent-bg"}),Io(m,function(b){Do(m,b.movementY)},function(){Bo(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=yo(e,"em-mob-height"),p=m?parseFloat(m.substring(14,m.length-2)):void 0;$({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=yo(e,"em-mob-padding_top"),a=s?parseFloat(s.substring(19)):void 0,l=yo(e,"em-mob-padding_bottom"),c=l?parseFloat(l.substring(22)):void 0,u=yo(e,"em-mob-padding_left"),d=u?parseFloat(u.substring(20)):void 0,f=yo(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=$({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)&&$({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)&&$({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)&&$({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 b=$({targetElement:p,insertType:"append",className:"em-element-resize-height"});$({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),$({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const C=$({targetElement:p,insertType:"append",className:"em-element-vindent"});let L="";p.className.indexOf("paddingTop")>-1?(L=e.style.paddingTop,Io(b,function(k){Do(b,k.movementY)},function(){Bo(b)})):p.className.indexOf("paddingBottom")>-1?(L=e.style.paddingBottom,Io(b,function(k){Do(b,k.movementY)},function(){Bo(b)})):p.className.indexOf("paddingLeft")>-1?(L=e.style.paddingLeft,el(b,function(k){Ji(b,k.movementX)},function(){es(b)})):p.className.indexOf("paddingRight")>-1&&(L=e.style.paddingRight,el(b,function(k){Ji(b,-k.movementX)},function(){es(b)})),$({targetElement:C,insertType:"append",className:"em-element-vindent-value",HTMLcontent:L})}})}if(e.className.length&&e.className?.includes("em-mob-padding")&&!e.closest("editor")&&i&&(a&&!e.querySelector(":scope > .em-vindent-paddingTop")&&$({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingTop",style:`height: ${a}px`}),c&&!e.querySelector(":scope > .em-vindent-paddingBottom")&&$({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingBottom",style:`height: ${c}px`}),d&&!e.querySelector(":scope > .em-vindent-paddingLeft")&&$({targetElement:e,insertType:"append",className:"em-vindent em-vindent-paddingLeft",style:`width: ${d}px`}),h&&!e.querySelector(":scope > .em-vindent-paddingRight")&&$({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 b=$({targetElement:p,insertType:"append",className:"em-element-resize-height"});$({targetElement:p,insertType:"append",className:"em-element-vindent-marker"}),$({targetElement:p,insertType:"append",className:"em-element-vindent-bg"});const C=$({targetElement:p,insertType:"append",className:"em-element-vindent"});let L="";p.className.indexOf("paddingTop")>-1?(L=a,Io(b,function(k){Do(b,k.movementY)},function(){Bo(b)})):p.className.indexOf("paddingBottom")>-1?(L=c,Io(b,function(k){Do(b,k.movementY)},function(){Bo(b)})):p.className.indexOf("paddingLeft")>-1?(L=d,el(b,function(k){Ji(b,k.movementX)},function(){es(b)})):p.className.indexOf("paddingRight")>-1&&(L=h,el(b,function(k){Ji(b,-k.movementX)},function(){es(b)})),$({targetElement:C,insertType:"append",className:"em-element-vindent-value",HTMLcontent:String(L)})}})),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=yo(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(b=>{$({targetElement:b,insertType:"append",className:"em-gap",style:i?`height: ${p}px;`:`width: ${b.getAttribute("width")}px;`})}),e.closest('[em="block"]')?.querySelectorAll(".em-gap").forEach(b=>{if(!b.querySelector(".em-element-resize-height")){const C=b,L=$({targetElement:C,insertType:"append",className:"em-element-resize-height"});$({targetElement:C,insertType:"append",className:"em-element-gap-marker"}),$({targetElement:C,insertType:"append",className:"em-element-gap-bg"});const k=$({targetElement:C,insertType:"append",className:"em-element-gap"});let y="";i?(y=C.style.height,Io(L,function(g){Do(L,g.movementY)},function(){Bo(L)})):(y=C.style.width,el(L,function(g){Ji(L,g.movementX)},function(){es(L)})),$({targetElement:k,insertType:"append",className:"em-element-gap-value",HTMLcontent:y})}})}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 L=m.closest(".em-element-resize-img-container"),k=L.querySelector(".em-element-img-edit");!m.getAttribute("src")?.includes(".gif")&&o?k||$({targetElement:L.querySelector(".em-element-img-change-group"),insertType:"prepend",className:"em-element-img-edit",tag:"i",HTMLcontent:Oe(Ya,`${xe}`),title:t.CHANGE_IMAGE_EDIT}):L.querySelector(".em-element-img-edit")?.remove()}return}const p=document.createElement("span");p.classList.add("em-element-resize-img-container"),RE(p),ME(p);const b=m.parentElement instanceof HTMLAnchorElement?m.parentElement:m;b.parentElement?.insertBefore(p,b),p.appendChild(b);const C=$({targetElement:p,insertType:"append",tag:"span",className:"em-element-resize-img"});Bne(C,function(L){Ji(C,L.movementX)},function(){es(C)}),m?.style.maxWidth&&m?.style.display==="block"&&m.closest(".em-element-resize-img-container")?.classList.add("em-display-block"),Vne(m,p)}}}function Vne(e,t){const n=LL;if(!n||t.querySelector(".em-element-img-change-group"))return;const r=n.getLocale(),o=Wne(),i=xL(),s=qne(),a=zne(),l=Une();if(o&&e.getBoundingClientRect().width>40&&e.getBoundingClientRect().height>40&&!e.classList.contains("em-countdown")){const c=$({targetElement:t,insertType:"append",className:"em-element-img-change-group"});if($({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&&$({targetElement:c,insertType:"append",className:"em-element-img-edit",tag:"i",HTMLcontent:Oe(Ya,`${xe}`),title:r.CHANGE_IMAGE_EDIT}),s&&$({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}),$({targetElement:c,insertType:"append",className:"em-element-img-changeto",tag:"i",HTMLcontent:Oe(Mne,`${xe}`),title:r.CHANGE_IMAGE_CHANGETO}),a&&$({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&&$({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),NL.has(c))return;NL.add(c),Ine(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":Jj(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 OL(e){const t=e.ownerDocument.activeElement;return!!t&&ve(t)&&t!==e.ownerDocument.body&&t.closest('[contenteditable="true"]')!==null&&e.contains(t)}function Gne(e){return!!e.parentElement?.matches('body>[em="block-contaner"]')}function Xne(e){const t=(n,r)=>{if(!OL(n)){if(r&&Gne(n)){n.querySelector("editor")||e.wrapEditor(n);return}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;qC(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")&&!OL(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 b=o;do if(b=b.closest("div, p, h1, h2, h3, h4, h5")||b.closest("span, b, strong, i, em, s, a, sup, sub"),b)if(!e.isVisible(b))b=b.parentElement;else break;while(b);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(b&&b.style.fontFamily&&b.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(b&&b.closest('[style*="font-family"][style*="font-size"]')){const C=b.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(b&&b?.tagName==="DIV"&&!b.querySelector("table")){const C=!!b.style.height?.length,L=b.className.includes("em-element-img-change-group"),k=b.querySelector("img")?.parentNode,y=!!b.querySelector("img")&&k&&!e.hasTextNodeInElement(k);!C&&!L&&!y&&t(b,!0)}else for(let C=0;C<o.childNodes.length;C++){const L=o.childNodes[C];if(L.nodeName==="#text"&&(L.textContent?.trim().length??0)>0&&!o.querySelector("table")){const k=o.tagName==="P"?o.parentElement:o;k&&t(k);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 Kne(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 Ed(e){e.button===0&&V.set("isLeftButtonDown",!1)}function RL(e){e.shiftKey||e.button===2||window.getSelection()?.removeAllRanges(),e.button===0&&V.set("isLeftButtonDown",!0)}function Yne(e){const t=()=>e.openEditorInit();return document.addEventListener("mousedown",RL),document.addEventListener("mouseup",Ed),document.addEventListener("dragend",Ed),window.addEventListener("mousemove",t),{dispose(){document.removeEventListener("mousedown",RL),document.removeEventListener("mouseup",Ed),document.removeEventListener("dragend",Ed),window.removeEventListener("mousemove",t)}}}function Zne(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 Qne(e){return function(n){const r=n.target;if(n.button!==0||n.shiftKey||!r||!ve(r)||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=Zne(document,n.clientX,n.clientY);if(i&&o.contains(i.startContainer)){const s=window.getSelection();s?.removeAllRanges(),s?.addRange(i)}}}function ML(e,t,n){const r=Ma(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 Jne(){const e=new Map,t=r=>{Fe(r,!1,e.get(r)),e.delete(r)},n=(r,o)=>{Fe(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,To))},mark:n,highlighted(){return[...e].filter(([,r])=>r===To).map(([r])=>r)},clear(){[...e.keys()].forEach(t)}}}function ere(e,t){const n=Jne();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,Co)},clear(){r=null,o=null,i=null,n.clear(),qV(e)&&e.isConnected&&t.commit(!0)}};return{selection:a,press(l){a.start(l);const c=Hi(e),u=ML(e,c,l);o=u?{model:c,base:u}:null},hover(l){const c=o&&ML(e,o.model,l);if(!o||!c)return;const u=UG(o.model,o.base,c);i=u?.direction??null;const d=(u?.cellIds??[]).map(f=>Bp(e,f));n.paint(d.filter(f=>!!f))},release(){o=null}}}function Sd(e,t,n,r){const o=gt(r);t.addEventListener(n,o),e.addEventListener("abort",()=>t.removeEventListener(n,o),{once:!0})}function tre(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=qg(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()};Sd(r.signal,e,"mousedown",s),Sd(r.signal,e,"mouseover",a),Sd(r.signal,document,"mouseup",l),Sd(r.signal,document,"click",c)}function nre(e){return t=>{const n=qg(t.target);n&&e.of(n.table)}}function rre(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=ere(o,r);return tre(o,s,r),t.set(o,s.selection),s.selection}}}var ore=1e3;function ire(e){setTimeout(()=>V.set("loadStylesTimer",!0),ore);const t=Xne({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:()=>!!V.get("isLeftButtonDown"),getLoadStylesTimer:()=>!!V.get("loadStylesTimer"),hasTextNodeInElement:k3,wrapEditor:e.wrapEditor,implementElementsEditors:n=>lne(n,{setBlockGroupControlsPosition:()=>Ou({scrollTop:V.get("scrollTop")}),commit:e.commit}),implementResizableElems:n=>jne(e.htmlDocument.getVisibleNode(n)),commit:e.commit});document.onmouseover=gt(n=>{t(n),e.onHover?.(n.target)}),document.onmouseleave=Kne({removeElementEditors:()=>Yi(void 0),commit:e.commit}),document.addEventListener("mousedown",Qne({isEditLocked:()=>e.editLock.isTextLocked(),unlockEditorInit:()=>e.editLock.openEditorInit(),handleMouseover:t}),!0),document.addEventListener("mousedown",gt(nre(e.tableSelections)),!0),Yne(e.editLock)}function sre(e){return t=>R(e,Ss)(t)}function are(e){return e?.nodeType===Node.ELEMENT_NODE?e:e?.parentElement??null}var lre={name:"sandbox.elementSettings",provides:[De],awaits:{services:[Y,jo,Vo,Ne,zo]},setup(e){const t=R(e,jo),n=R(e,zo);e.inject(De,mZ({htmlDocument:R(e,Y),getMapObj:()=>t,fingerprint:R(e,Vo),selectionLock:R(e,Ne),enrichExtras:()=>e.getServices(gy).reduce((r,o)=>({...r,...o()}),{}),elementRefOf:r=>n.issue(r)}))}},cre={name:"sandbox.documentChange",awaits:{services:[Y,Vo,De,lt,Se,Ss,Ne,Qe]},setup:e=>lU({htmlDocument:R(e,Y),fingerprint:R(e,Vo),initPreview:sre(e),applicationElementSettingsSet:R(e,De),commit:ht(e),focusController:R(e,lt).controller,selectionLock:R(e,Ne),editLock:R(e,Qe),companions:Ao(e)})},ure={name:"sandbox.toggleTextStyle",provides:[Cl],awaits:{services:[De,Se,Ne]},setup(e){const t=R(e,De),n=ht(e),r=R(e,Ne),o=(i,s=tt())=>{let a=are(zs(s,i)||i);if(a?.tagName==="EDITOR"&&(a=a.firstElementChild),!a)return;const l=a;r.lift(()=>t({elem:l}))};e.inject(Cl,Ree({commit:n,addNewRange:ai,refreshElementSettings:o,findElementWithSelectedText:zs,getParentElementOfSelection:dc,findOutermostParentWithText:Em,clearLinkTags:i=>{Oo(i,n),Kr(n)},addFontFamilyClass:i=>Oa(i,n),getIsProgrammaticSelection:()=>!!V.get("isProgrammaticSelection"),getCommonStyles:()=>V.get("commonStyles")??{},getLinkPlaceholder:()=>e.getInstance(wl)?.localized.LINK_PLACEHOLDER??""}))}},dre={name:"sandbox.insert",provides:[Nr],awaits:{services:[Y,De,Se,sf,Ne,Qe]},setup:e=>e.inject(Nr,Xte({htmlDocument:R(e,Y),commit:ht(e),messageService:j,applicationElementSettingsSet:R(e,De),selectionLock:R(e,Ne),editLock:R(e,Qe),companions:Ao(e),...R(e,sf)}))},fre={name:"sandbox.elementSettingsApply",provides:[Xo],awaits:{services:[Y,jo,Se,wt,De,Cl,vn,lt,Ne]},setup(e){const t=R(e,Se),n=R(e,jo),r=R(e,wt),o=R(e,De);let i=null;const s=l=>{i??(i=mee({htmlDocument:R(e,Y),getMapObj:()=>n,commit:ht(e),commitLockedAsync:c=>t.commitLockedAsync(c),setCursorPosition:r,applicationElementSettingsSet:o,selectionLock:R(e,Ne),toggleTextStyle:R(e,Cl),wrapEditor:R(e,vn).now,programmaticSelection:{get value(){return!!V.get("isProgrammaticSelection")},set value(c){V.set("isProgrammaticSelection",c)}}})),i(l)},a=R(e,lt).controller;e.inject(Xo,l=>a.whenEditorLostFocus(()=>s(l)))}},mre={name:"sandbox.tableSelections",provides:[Go],awaits:{services:[Se]},setup:e=>e.inject(Go,rre({commit:ht(e)}))},hre={name:"sandbox.mouse",awaits:{services:[Y,vn,Se,Ne,Qe,Go]},setup:e=>ire({htmlDocument:R(e,Y),commit:ht(e),selectionLock:R(e,Ne),editLock:R(e,Qe),wrapEditor:R(e,vn).deferred,tableSelections:R(e,Go)})},pre={name:"sandbox.click",awaits:{services:[Y,Se,wt,lt,De,vn,Ne,Qe,Go]},setup(e){const t=R(e,Se),n=R(e,lt);Bte({htmlDocument:R(e,Y),commit:ht(e),commitLockedAsync:r=>t.commitLockedAsync(r),messageService:j,setCursorPosition:R(e,wt),setEditorFocus:r=>n.setEditorFocus(r),applicationElementSettingsSet:R(e,De),selectionLock:R(e,Ne),editLock:R(e,Qe),wrapEditor:R(e,vn).now,tableSelections:R(e,Go),insertTextAtomIntoEmptyNarrowTable:r=>e.getInstance(py)?.(r)??!1,companions:Ao(e)})}},gre={name:"sandbox.keyboard",awaits:{services:[Se,wt,De,vn,Qe]},setup:e=>Rne({editLock:R(e,Qe),commit:ht(e),messageService:j,setCursorPosition:R(e,wt),applicationElementSettingsSet:R(e,De),wrapEditor:R(e,vn).now,companions:Ao(e)})},bre={name:"sandbox.cssFilterOnCommit",awaits:{services:[Y]},setup:e=>mW(R(e,Y))},yre={name:"sandbox.vmlButtonLabelSync",awaits:{services:[Se]},setup(e){const t=R(e,Se);kee(n=>t.commit(n))}},vre={name:"sandbox.buttonLineLayoutSync",awaits:{services:[Se]},setup(e){const t=R(e,Se);Nee(n=>t.commit(n))}},Ere={name:"sandbox.insertListeners",awaits:{services:[Nr]},setup:e=>R(e,Nr).register()};function PL(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 IL(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;PL(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">
255
+ <tr>
256
+ <td style="padding: 10px 0;">
257
+ <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>
258
+ </td>
259
+ </tr></table>`),a.append(l),!0},t.HTMLDocument.getOuterHtml(i))}catch{}finally{n.releaseLater()}}function DL(e,t){const n=t.selectionLock.acquire();try{const r=t.getActiveEditElement();if(!r)return;const o=r.closest("amp-accordion");if(!o)return;PL(o,t,i=>(i.querySelectorAll("section")[e.index]?.remove(),!0))}catch{}finally{n.releaseLater()}}function BL(e){return{selectionLock:e.selectionLock,commit:e.commit,getActiveEditElement:e.getActiveEditElement,HTMLDocument:e.HTMLDocument}}function Sre(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||IL(e.data.settings,BL(t))}function wre(e,t){!t.selectionLock||!t.HTMLDocument||!t.getActiveEditElement||DL(e.data.settings,BL(t))}var _re={sandbox_accordion_add_section:Sre,sandbox_accordion_remove_section:wre};function Cre(e,t){vr(),Fe(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 Tre(e,t){const{htmlDocument:n}=t;t.messageService.send({operation:"application_email_content_get",htmlCode:n.getOuterHtml(document.body)||n.getRootsHtml()})}var Are={"sandbox_drag-cancel":Cre,sandbox_email_content_get:Tre};function kre(e,t){const n=e.data.settings?.emBlockId;if(n==null||n==="")return;const r=e.data.settings?.emBlockVersion;let o=S0()??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 Lre(e,t){const n=S0();!n||!n.hasAttribute("em-block-id")||(n.removeAttribute("em-block-id"),n.removeAttribute("em-block-version"),t.commit())}var Nre={sandbox_eblock_set_em_block_id:kre,sandbox_eblock_clear_em_block_id:Lre};function HL(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,"&nbsp;")).replace(/(\d[\d&nbsp;]*[.,]?\d+)(?:\s|&nbsp;)?(?=(?:руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB))/gi,"$1&nbsp;").replace(/(\d[\d&nbsp;]*[.,]?\d+)&nbsp;(руб(?:\.|лей)?|р\.|долл(?:\.|аров)?|\$|₽|€|£|¥|USD|EUR|RUB)/gi,"$1&nbsp;$2")}function FL(e,t){for(const n of e)n.type===B.HTML&&!gl(n,n.parent)&&(n.content=t(n.content??"")),FL(n.children,t)}function xre(e,t){const n=rn(e);FL(n.roots,t);const r=document.createDocumentFragment(),o=Ub(void 0);try{r.append(...n.roots.map(i=>ao(i,!0,!0)))}finally{o()}return ii(r),r}var Ore=`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 $L(e){wk(e.elem,e.companions)?.remove()}function wd(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()),e.companions?.emptied([e.elem]);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(),wd({elem:t,companions:e.companions})));else if(e.elem.innerHTML.trim()==="")$L({elem:e.elem,companions:e.companions}),(e.companions??Wn).remove(e.elem),wd({elem:t,companions:e.companions});else if(t&&!t.querySelector('div[style*="display"]')){for(const n of e.elem.childNodes)n.nodeName==="#text"&&n.textContent?.trim()===""?($L({elem:n,companions:e.companions}),n.textContent=""):id(n)&&n.remove();e.elem.innerHTML.trim()===""&&wd({elem:e.elem,companions:e.companions})}return!0}function Rre(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=e.getElementParent(t),r=e.companions??Wn;let o=t.parentNode;const i=t.closest("editor"),s=i&&i.childElementCount===1&&i.firstElementChild===t?i:t;if(e.setCursorPosition(n),t.classList.contains("em-code")){const a=e.getVariableByIcon?.(t);a&&(a.parentNode?.removeChild(a),t.remove())}else if(t.tagName==="TD"&&t.innerHTML===""&&t.hasAttribute("height")){const a=t.closest("table");if(a){const l=a.previousSibling;l&&l?.textContent?.trim()===""&&l.remove(),a.remove()}}else if(t.closest(".em-element-resize-img-container"))o=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 a=t.closest(".em-mob-wrap, .noresp-em-mob-wrap"),l=t.closest('[em="atom"]');t.tagName==="TD"&&t.previousElementSibling===null&&t.nextElementSibling===null?(o=l.parentNode,l&&r.remove(l)):(o=t.closest("td"),r.remove(s));const c=!!a&&Array.from(a.querySelectorAll('[em="atom"]')).some(u=>u!==l);t.tagName!=="TD"&&a&&!c&&a.textContent?.trim()===""&&(a.textContent="")}else{r.remove(s);const a=t.previousSibling;a&&a?.textContent?.trim()===""&&a.remove(),t.remove()}i&&(go(i),i.remove()),wd({elem:o,companions:e.companions}),e.commit(),e.messageService.send({operation:"application_element_settings_close"})}function WL(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",Ore),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")&&Fre(e,t).catch(r=>{})}var Mre=/^(script|style|noscript|xmp|iframe|noembed|noframes)$/i,qL=/^[ \t\n\r\f]*$/;function zL(e,t,n){const{copy:r,counterpart:o}=Ql(e),i=Pre(e,o),s=c=>{const u=i.get(c);return!!u&&PE(u)},a=xre(t(r.innerHTML),n),l=new Map;jL(r,a,l,s)&&i.forEach((c,u)=>l.get(u)?.(c))}function Pre(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 UL(e){return[...(e instanceof HTMLTemplateElement?e.content:e).childNodes]}function jL(e,t,n,r){const o=UL(e),i=UL(t),s=n.size;let a=!1,l=0;for(let c=0;c<o.length;){const u=o[c],d=i[l];if(u.nodeType===Node.TEXT_NODE){const f=Bre(o,c);c+=f.length;const h=d?.nodeType===Node.TEXT_NODE;if(!h&&!f.every(m=>qL.test(m.data))||(l+=h?1:0,!VL(f,h?d.data:"",n,r)))return!1;continue}if(!d||d.nodeType!==u.nodeType||!Dre(u,d,r(u)))return!1;if(c+=1,l+=1,u.nodeType===Node.COMMENT_NODE){if(!VL([u],d.data,n,r))return!1}else if(u.nodeType===Node.ELEMENT_NODE&&(a||(a=r(u)&&!Ire(u,d)),!Mre.test(u.nodeName)&&!jL(u,d,n,r)))return!1}return a&&[...n.keys()].slice(s).forEach(c=>n.delete(c)),l===i.length}function Ire(e,t){return e.attributes.length===t.attributes.length&&[...e.attributes].every(n=>t.getAttribute(n.name)===n.value)}function Dre(e,t,n){return t.nodeName===e.nodeName||!n&&t.nodeName.toLowerCase()===e.nodeName.toLowerCase()}function Bre(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 VL(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)&&!qL.test(i.data))?!1:(o.forEach((i,s)=>n.set(i,a=>a.data=s===0?t:"")),!0)}var GL=()=>Uf(()=>Promise.resolve().then(()=>Dd("./typograf.all.CGEpDoct.js")),void 0,{}.url);function Hre(e){return(e?.closest("editor")??e?.querySelector(":scope > editor"))?.parentElement??e?.closest("td")??e}async function Fre(e,t){const{default:n}=await GL(),r=Hre(document.querySelector("[em-edit]")),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);go(document.body),e.action==="typograf_all"?zL(document.body,a,HL):r&&zL(r,a,HL),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 XL(e){return e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null}function Yg(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 $re(e,t){const n=e.closest("a");if(Yg(n))return n;if(!t)return null;const r=XL(t.anchorNode)?.closest("a")??null;if(Yg(r))return r;const o=XL(t.focusNode)?.closest("a")??null;return Yg(o)?o:null}function KL(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"&&FT(e)?e.closest('[em="block"]')??e:e}function YL(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"?Pi(e)??e:e:null}function Wre(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=window.getSelection();if($re(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 qre(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=YL(KL(t).previousElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function zre(e){const t=document.querySelector("[em-edit]");if(!t)return;const n=YL(KL(t).nextElementSibling);n&&(e.setCursorPosition(n),e.applicationElementSettingsSet({elem:n}))}function Ure(e,t){t.removeAllAttributes("em-edit");const n=document.querySelector(".em-editor-wrapper");n&&(n.style.display="none"),Ot(()=>document.querySelectorAll("editor").forEach(r=>{r.blur()}))}function jre(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 Vre(e,t){t.removeAllAttributes("em-state");const n=t.elementPath[e.data.index??0];n?.elem&&n.elem.setAttribute("em-state","active")}function Gre(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};Wre(n)}function Xre(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};qre(n)}function Kre(e,t){if(!t.getElementParent)return;const n={setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,applicationElementSettingsSet:t.applicationElementSettingsSet};zre(n)}function Yre(e,t){if(!t.getElementParent)return;const n={commit:t.commit,setCursorPosition:t.setCursorPosition,getElementParent:t.getElementParent,messageService:t.messageService,getVariableByIcon:t.getVariableByIcon,companions:t.companions};Rre(n)}function Zre(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};WL(n,r)}var Qre={sandbox_element_active_reset:Ure,sandbox_element_active_set:jre,sandbox_element_hover_set:Vre,sandbox_element_parent_get:Gre,sandbox_element_prev_get:Xre,sandbox_element_next_get:Kre,sandbox_element_remove:Yre,sandbox_element_text:Zre},Er=".em-mob-wrap, .noresp-em-mob-wrap",Wt=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",dt='div[style*="inline-block"]';function Ho(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&&Ho({elem:e.elem.previousSibling,width:e.width})}function ZL(e){const t=e.removedBlockIndex===0?"nextSibling":"previousSibling";e.elem.nodeName==="#comment"&&e.elem.textContent?.indexOf("mso")!==-1?e.elem.remove():e.elem[t]&&ZL({elem:e.elem[t],removedBlockIndex:e.removedBlockIndex})}function _d(e){return!!e.querySelector(Er)||!!e.closest(Er)}function tl(e){return e.querySelector(Er)?document.querySelector('[em-edit="active"]'):e.closest(Er).parentElement}function Cd(e){return e.querySelector(dt)?document.querySelector('[em-edit="active"]'):e.closest(dt).parentElement}function QL(e,t){const n=document.querySelector("[em-edit]");if(!n)return;const r=t.selectionLock.acquire();try{if(_d(n)){const o=tl(n),i=qi(o),s=e.minWidth,a=o.querySelectorAll(Wt).length,l=a>1?parseFloat(String(e.gap)):20,c=a>1?parseFloat(String(e.gapMobile||e.gap)):20;let u="";o.querySelector(".em-mob-wrap")?u=`<td width="${l}" class="em-mob-wrap em-mob-height-${c}px"></td>
260
+ <td width="${s}" valign="top" class="em-mob-wrap em-mob-width-100perc"></td>`:o.querySelector(".noresp-em-mob-wrap")&&(u=`<td width="${l}" class="noresp-em-mob-wrap noresp-em-mob-height-${c}px"></td>
261
+ <td width="${s}" valign="top" class="noresp-em-mob-wrap em-mob-width-100perc"></td>`);let d=0,f=0,h=0;o.querySelectorAll(Wt).forEach(p=>{parseFloat(p.getAttribute("width")||"0")>s&&h++,d+=parseFloat(p.getAttribute("width")||"0")});const m=(s+l)/h;if(o.querySelectorAll(Wt).forEach(p=>{if(parseFloat(p.getAttribute("width")||"0")>s){const b=Math.round(parseFloat(p.getAttribute("width")||"0")-m);p.setAttribute("width",String(b))}}),tr(o.querySelectorAll(Wt)[a-1],"afterend",u),o.querySelectorAll(Wt).forEach(p=>{f+=parseFloat(p.getAttribute("width")||"0")}),d-f-l!==0){const p=o.querySelector(Er),b=parseFloat(p.getAttribute("width")||"0")+(d-f-l);p.setAttribute("width",String(b))}zi(i,"relayout"),t.setPercentsForColumns(o.querySelectorAll(Wt)),t.commit()}else{const o=Cd(n),i=e.minWidth,s=o.querySelectorAll(dt).length,a=s>1?parseFloat(String(e.gap)):20,l='<!--[if (gte mso 9)|(IE)]></td><td width="'+(i+a)+`" valign="top"><![endif]-->
262
+ <div style="display: inline-block; width: `+(i+a)+`px; vertical-align: top;" class="em-mob-width-100perc">
263
+ <table width="`+i+`" border="0" cellspacing="0" cellpadding="0" class="em-mob-width-91perc">
264
+ <tr>
265
+ <td align="left"></td>
266
+ </tr>
267
+ </table>
268
+ <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td height="20"></td></tr></table>
269
+ </div>`;let c=0,u=0,d=0;if(s===1){const h=n.querySelector(dt)?o.querySelector(dt):n.closest(dt);h.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("max-width"),h.firstElementChild?.style.removeProperty("width")}o.querySelectorAll(dt).forEach(h=>{const m=parseFloat(h.firstElementChild?.getAttribute("width")||"0");m>i&&d++,c+=m});const f=(i+a)/d;if(o.querySelectorAll(dt).forEach(h=>{const m=h;if(parseFloat(m.firstElementChild?.getAttribute("width")||"0")>i){const p=Math.round(parseFloat(m.style.width)-f),b=p-a;m.style.width=p+"px",Ho({elem:m,width:p}),m.firstElementChild?.tagName==="TABLE"&&m.firstElementChild.setAttribute("width",String(b))}}),tr(o.querySelectorAll(dt)[s-1],"afterend",l),o.querySelectorAll(dt).forEach(h=>{u+=parseFloat(h.firstElementChild?.getAttribute("width")||"0")}),c-u-a!==0){const h=o.querySelector(dt),m=parseFloat(h.style.width)+(c-u-a);h.style.width=m+"px",Ho({elem:h,width:m}),h.firstElementChild?.tagName==="TABLE"&&h.firstElementChild.setAttribute("width",String(m-a))}t.commit()}}catch{}finally{r.releaseLater()}}function JL(e,t){const n=document.querySelector("[em-edit]");if(!n)return;let r=null;const o=t.selectionLock.acquire();try{if(_d(n)){const i=tl(n),s=qi(i);let a=0;const l=parseFloat(String(e.gap));i.querySelectorAll(Wt).forEach((d,f)=>{f===e.removedBlockIndex&&(a=parseFloat(d.getAttribute("width")||"0"),d===n.closest(Er)&&(n.closest(".em-structure > td")?.setAttribute("em-edit","active"),r=n.closest(".em-structure > td")),d.nextElementSibling&&d.previousElementSibling?d.previousElementSibling.remove():d.nextElementSibling&&!d.previousElementSibling?d.nextElementSibling.remove():!d.nextElementSibling&&d.previousElementSibling&&d.previousElementSibling.remove(),d.remove())});const c=i.querySelectorAll(Wt).length,u=Math.floor((a+l)/c);if(i.querySelectorAll(Wt).forEach(d=>{const f=Math.round(parseFloat(d.getAttribute("width")||"0")+u);d.setAttribute("width",String(f))}),c===1){const d=i.querySelector(Er),f=d.closest("table").parentElement;d.setAttribute("width",String(f.getBoundingClientRect().width-parseFloat(f.style.paddingLeft||"0")-parseFloat(f.style.paddingRight||"0")))}zi(s,"relayout"),t.setPercentsForColumns(i.querySelectorAll(Wt))}else{const i=Cd(n);let s=0;const a=parseFloat(String(e.gap));i.querySelectorAll(dt).forEach((u,d)=>{d===e.removedBlockIndex&&(s=parseFloat(u.style.width),u===n.closest(dt)&&n.closest(".em-structure > td")?.setAttribute("em-edit","active"),ZL({elem:u,removedBlockIndex:e.removedBlockIndex}),u.remove())});const l=i.querySelectorAll(dt).length,c=Math.round(s/l);if(i.querySelectorAll(dt).forEach(u=>{const d=u,f=Math.round(parseFloat(d.style.width)+c),h=f-a;d.style.width=f+"px",Ho({elem:d,width:f}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(h))}),l===1){const u=i.querySelector(dt);u.style.width="100%",u.style.maxWidth=i.closest("table")?.style.maxWidth||"",Ho({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 eN(e,t){const n=document.createComment("em-swap");e.replaceWith(n),t.replaceWith(e),n.replaceWith(t)}function Jre(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 tN(e,t=""){sr(t+Bs(e),n=>{n.forEach(Jre),e.after(...n)})}function eoe(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(_d(n)){const a=tl(n),l=qi(a),c=a.querySelectorAll(Wt)[r];if(!c)return;const u=c.nextElementSibling||c.previousElementSibling;tN(c,u?Bs(u):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 d=a.querySelectorAll(Wt);d.forEach((f,h)=>{o[h]!=null&&f.setAttribute("width",String(o[h]))}),zi(l,"relayout"),t.setPercentsForColumns(d),t.commit()}else{const a=Cd(n),l=a.querySelectorAll(dt)[r];if(!l)return;tN(l,'<!--[if (gte mso 9)|(IE)]></td><td width="'+((o[r+1]??o[r]??0)+i)+`" valign="top"><![endif]-->
270
+ `),a.querySelectorAll(dt).forEach((c,u)=>{const d=c,f=o[u];if(f==null)return;const h=f+i;d.style.width=h+"px",Ho({elem:d,width:h}),d.firstElementChild?.tagName==="TABLE"&&d.firstElementChild.setAttribute("width",String(f))}),t.commit()}}catch{}finally{s.releaseLater()}}function nN(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(_d(n)){const s=tl(n),a=s.querySelectorAll(Wt),l=a[r],c=a[o];if(!l||!c)return;eN(l,c),t.setPercentsForColumns(s.querySelectorAll(Wt)),t.commit()}else{const s=Cd(n).querySelectorAll(dt),a=s[r],l=s[o];if(!a||!l)return;eN(a,l),[a,l].forEach(c=>{Ho({elem:c,width:parseFloat(c.style.width)})}),t.commit()}}finally{i.releaseLater()}}function toe(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=Up(tl(r));if(!o)return;e.wrap?V0(o):Ia(o,EX(o)),t.commit()}catch{}finally{n.releaseLater()}}function noe(e,t){const n=t.selectionLock.acquire();try{const r=document.querySelector("[em-edit]");if(!r)return;const o=r.querySelector(Er)?document.querySelector('[em-edit="active"]'):r.closest(Er)?.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 ts(e){return{selectionLock:e.selectionLock,commit:e.commit,setPercentsForColumns:e.setPercentsForColumns,emailWidth:e.emailWidth,applicationElementSettingsSet:e.applicationElementSettingsSet}}function roe(e,t){!t.selectionLock||!t.setPercentsForColumns||QL(e.data.settings,ts(t))}function ooe(e,t){!t.selectionLock||!t.setPercentsForColumns||JL(e.data.settings,ts(t))}function ioe(e,t){!t.selectionLock||!t.setPercentsForColumns||eoe(e.data.settings,ts(t))}function soe(e,t){!t.selectionLock||!t.setPercentsForColumns||nN(e.data.settings,ts(t))}function aoe(e,t){!t.selectionLock||!t.setPercentsForColumns||toe(e.data.settings,ts(t))}function loe(e,t){!t.selectionLock||!t.setPercentsForColumns||noe(e.data.settings,ts(t))}var coe={sandbox_floatBlock_add:roe,sandbox_floatBlock_remove:ooe,sandbox_floatBlock_copy:ioe,sandbox_floatBlock_swap:soe,sandbox_floatblock_wrap:aoe,sandbox_floatblock_dir:loe},uoe='<table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>',doe=['[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 rN(){vr(),Fe(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 oN(){const e=document.querySelectorAll('[em="block"]');return e.length?e[e.length-1]:null}function iN(){for(const e of doe){const t=document.querySelector(e);if(t)return t}return null}function sN(e){const t=e.querySelectorAll('[em="atom"]');return t.length?t[t.length-1]:e}function aN(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||(ve(e)?ud(e):null)}function foe(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),moe(i,e,r)}function moe(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 Zg(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}),foe(e,t,n)}function hoe(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 poe(e,t){const n=sg();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=Xk(e);if(e!==uoe){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"||!dn(n)?null:(o?t.insertCountdown({targetElem:yr(n),targetPlace:"beforeend",atomHTML:r}):t.insertAdjacentHTML(yr(n),"beforeend",r),n.querySelector('[em="block"]:last-child')??n.lastElementChild)}function lN(e){return typeof e=="string"?e:e&&typeof e=="object"&&typeof e.html=="string"?e.html:""}function cN(e,t){e&&t.messageService.send(ue.APPLICATION_ATOM_INSERTED,e),rN()}function uN(e,t){t.messageService.send("application_block_inserted",{type:e.type,name:e.name,blockId:e.blockId,project:e.project}),rN()}function dN(e,t){const n=lN(e.atomHTML),r=n.match(/<style((.|\n|\r)*?)<\/style>/g);return t.setDocumentStyles(r),n.replaceAll(/<style((.|\n|\r)*?)<\/style>/gi,"").trim()}function goe(e,t){if(!iN()&&!oN()&&!sg())return!1;let n=dN(e,t);if(!n)return!1;let r=null;const o=iN();if(o)r=Zg(sN(o),n,t);else{const i=oN();if(i){const s=aN(i);s&&(r=Zg(s,n,t))}else r=poe(n,t)}return r?(hoe(r,t),!0):!1}function fN(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(`
271
+ `+t+`
272
+ `,r=>{n.replaceChildren(...r),n.querySelectorAll('tr[em="block"]').forEach(o=>o.removeAttribute("em")),e.insertAdjacentElement("afterend",n)})}function boe(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"?fN(e,t):n.insertAdjacentHTML(e,"afterend",t)}function Qg(e,t,n){if(!e.blockHTML?.trim())return!1;const r=sg(),o=r?null:document.querySelector('[em="block"][em-edit="active"], [em="block"] [em-edit="active"]')?.closest('[em="block"]')??ag();if(!n&&!r&&!o)return!1;const i=Sp(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 b=t.minify(m+`
273
+ `+[...p.querySelectorAll("style")].map(C=>C.innerHTML).join(`
274
+ `),{restructure:!0,forceMediaMerge:!0}).css;b=t.cssbeautify(b,{indent:" ",autosemicolon:!0}),h.textContent=`
275
+ `+b+`
276
+ `}for(const h of c.reverse())l?.prepend(h),l?.insertAdjacentHTML("afterbegin",`
277
+ `);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"}),boe(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(yr(r),"beforeend",s):t.insertAdjacentHTML(yr(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"?fN(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 yoe(e,t){if(t.lockEditor||!lN(e.atomHTML).trim())return;const n=t.selectionLock.acquire();try{t.setAtomReplaced?.(null),Bk({kind:"atom",settings:e}),e.action!=="insert"&&Fe(document.body,!0,"em-atom-insert-body"),e.action==="insert"&&goe(e,t)&&cN(e.name,t),t.commit()}catch{}finally{n.releaseLater()}}function voe(e){return e.replace(/["\\]/g,"\\$&")}function Eoe(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="${voe(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)Qg({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 Soe(e,t){if(t.lockEditor||!e.blockHTML?.trim())return;const n=t.selectionLock.acquire();try{Bk({kind:"block",settings:e}),Fe(document.body,!0,"em-block-insert-body"),e.action==="insert"&&Qg(e,t)&&uN(e,t),t.commit()}finally{n.releaseLater()}}function woe(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 _oe(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(!Qg({...e,action:"insert"},t,n?.target))return null;const i=woe(r);return n?.place==="before"&&i.length&&n.target.before(...i),uN(e,t),t.commit(),i[0]??null}finally{o.releaseLater()}}function Coe(e,t,n){if(t.lockEditor)return null;const r=t.selectionLock.acquire();try{const o=dN(e,t);if(!o)return null;const i=()=>n.target.getAttribute("em")==="block"?aN(n.target):sN(n.target),s=n.place==="inside"?i():n.target,a=s?Zg(s,o,t):null;return a&&n.place==="before"&&n.target.before(a),a&&cN(e.name,t),t.commit(),a}finally{r.releaseLater()}}function Toe(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};yoe({action:e.data.action,atomHTML:r.atomHTML,name:r.name},n)}function Aoe(e,t){const n=t.getInsertContext?.();if(!n)return;const r=e.data.settings??{};Soe({action:e.data.action,blockHTML:r.blockHTML,type:r.type,project:r.project,name:r.name,blockId:r.blockId},n)}function koe(e,t){t.setElementSettings?.(e)}var Loe={"sandbox_atom-insert":Toe,"sandbox_block-insert":Aoe,sandbox_element_settings_set:koe},Noe=_n("elements",Qre,{services:[De,wt,Se,xr]},e=>{const t=R(e,De),n=R(e,wt),r=ht(e),o=R(e,xr);return()=>({HTMLDocument:{getOuterHtml:Dt},applicationElementSettingsSet:t,commit:r,elementPath:o.elementPath,getElementParent:i=>ji(i),getVariableByIcon:Ca,hasRussianText:yS,messageService:j,removeAllAttributes:Mr,companions:Ao(e),setCursorPosition:i=>n(i)})}),xoe=_n("display",Are,{services:[Y]},e=>{const t=R(e,Y);return()=>({messageService:j,htmlDocument:t})}),Ooe=_n("floatBlock",coe,{services:[De,Se,Ne]},e=>{const t=R(e,De),n=ht(e),r=R(e,Ne);let o=600;return V.subscribe(i=>{i.emailWidth!==void 0&&(o=i.emailWidth)}),()=>({applicationElementSettingsSet:t,commit:n,emailWidth:o,selectionLock:r,setPercentsForColumns:i=>fc(i)})}),Roe=_n("accordion",_re,{services:[Se,Ne]},e=>{const t=ht(e),n=R(e,Ne);return()=>({HTMLDocument:{getOuterHtml:Dt},commit:t,selectionLock:n,getActiveEditElement:Us,parseFromString:r=>Le(r)})}),Moe=_n("eblock",Nre,{services:[Se]},e=>{const t=ht(e);return()=>({commit:t})}),Poe=_n("palette",Loe,{services:[Nr,Xo]},e=>{const t=R(e,Nr),n=R(e,Xo);return()=>({getInsertContext:t.insertContext,setElementSettings:n})}),Ioe=_n("nativeImageDrop",{[ue.SANDBOX_NATIVE_IMAGE_DROP_CLEAR]:()=>jk()},void 0,()=>()=>({})),Doe=[Noe,xoe,Ooe,Roe,Moe,Poe,Ioe];function mN(e){const t=e.activeElement;return!!t&&!!t.closest('[contenteditable="true"]')&&e.hasFocus()}function Boe(e){return mN(e)?new Promise(t=>{const n=()=>{setTimeout(()=>{mN(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 Td(){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(ve(t)&&(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 hN(e){return!!e&&!document.querySelector("title")}function Jg(){const e=document.querySelector("title")?.textContent?.replaceAll("&nbsp;"," ").replaceAll("&zwnj;","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","")||"";return Yx(e).replace(/\s+/g," ").trim()}function nl(e=Td()){const t=document.createElement("div");return t.innerHTML=e?.innerHTML||"",t.querySelectorAll(".em-code").forEach(n=>n.remove()),xt(t).trim().replaceAll(/<vk-snippet-end\/>/g,"").replaceAll(/[\u034F\u200C\u2007\uFEFF]+/g,"").replaceAll("&amp;","&").replaceAll("&#847;","").replaceAll("&#65279;","").replaceAll("&#8199;","").replaceAll("&zwnj;","").replace(/\u200C/g,"").replaceAll("<!--","").replaceAll("-->","").replace(/(?:&nbsp;|\s)+$/,"").trim()}function eb(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("mso")>=0?e.remove():e.previousSibling&&eb(e.previousSibling)}function tb(e){e.nodeName=="#comment"&&e.textContent&&e.textContent.indexOf("endif")>=0?e.remove():e.nextSibling&&tb(e.nextSibling)}var Hoe="&#847;&zwnj; &#8199;&#65279;",pN="#f0f1f3",gN='<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("&nbsp;&zwnj;").join("")+"</span>";function Ad(e){return!!e&&ve(e)&&e.tagName==="SPAN"&&e.style&&e.style.display==="none"&&e.style.fontSize==="0px"&&e.style.visibility==="hidden"}function bN(e){const t=e.nextSibling;return t&&Ns(t)&&t.data==="<![endif]"?t:null}function Foe(e){const t=bN(e);t&&t.nextSibling&&Ad(t.nextSibling)?t.nextSibling.remove():!t&&e.nextSibling&&Ad(e.nextSibling)&&e.nextSibling.remove();const n=Le(gN);n.length&&(t&&t.parentNode?t.parentNode.insertBefore(n[0],t.nextSibling):e.parentNode&&e.parentNode.insertBefore(n[0],e.nextSibling))}var yN=e=>{eb(e),tb(e);const t=e.nextElementSibling;t&&ve(t)&&t.style&&t.style.color==="transparent"&&(eb(t),tb(t),t.remove());const n=ve(e)?bN(e):null;for(n&&n.nextSibling&&Ad(n.nextSibling)?n.nextSibling.remove():e.nextSibling&&Ad(e.nextSibling)&&e.nextSibling.remove();e.previousSibling&&fo(e.previousSibling)&&e.previousSibling.data.trim()==="";)e.previousSibling.remove();for(;e.nextSibling&&fo(e.nextSibling)&&e.nextSibling.data.trim()==="";)e.nextSibling.remove();e.remove()};function $oe(e){return!(e.tagName!=="DIV"||G(e.style.color)!==pN||e.style.lineHeight!=="0px"||e.style.fontSize!=="0px"||!e.previousSibling||!Ns(e.previousSibling)||e.previousSibling.data!=="[if !mso]><!"||!e.nextSibling||!Ns(e.nextSibling)||e.nextSibling.data!=="<![endif]")}function Woe(e,t){let n=Td(),r="";(e.length||t)&&(e=e.endsWith(" ")?e:e+" ",e=e+"<vk-snippet-end>͏‌</vk-snippet-end>͏",r=e.padEnd(e.length+5460,Hoe));const o=Le(r);if(n&&!$oe(n)&&(yN(n),n=null),n)o.length?(n.replaceChildren(...o),Foe(n)):yN(n);else if(o.length){const i=document.createElement("div");i.classList.add("preheader"),i.style.color=pN,i.style.lineHeight=i.style.fontSize="0px",i.replaceChildren(...o),document.body?.prepend(i),i.insertAdjacentHTML("afterend",gN)}}function qoe(e,t){return!!t&&(nl()||"")!==e}function zoe(e,t){return!!t&&(document.querySelector("title")?.textContent??"")!==e}function Uoe(){return document.querySelector("title")?.textContent??void 0}async function vN(e,t,n,r){const o=n();await e.whenSent(),t()&&n()===o&&r()}function joe(e,t){let n;const r=new ye;let o=!1,i="",s=0;const a=u=>{o=!1,n=void 0,i=u.guid,s+=1},l=u=>(o=!0,n=nl()||"",j.sendAsync(ue.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||qoe(d,f))){const b=s;n=d,Woe(d),await e.commit(!!h||!!p,!0),(h||m)&&await vN(e,()=>b===s,()=>nl(),()=>j.send(ue.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n,forced:!!m&&!h}))}};return r.addDisposable(j.addListenerAsync(ue.SANDBOX_PREHEADER_UPDATE,c)),r.addDisposable(j.addListenerAsync(ue.SANDBOX_INIT_START,a)),r.addDisposable(j.addListenerAsync(ue.SANDBOX_INITED,l)),r.addDisposable(e.onChange(()=>{if(o){const u=nl()||"";u!==n&&(n=u,j.send(ue.APPLICATION_PREHEADER_UPDATE,{guid:i,value:n}))}})),r}function Voe(e,t){let n;const r=new ye;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,hN(n)||(n=Jg()||""),j.sendAsync(ue.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||zoe(d,f))){const b=s;n=d,document.title=d,await e.commit(!!h||!!p,!0),(h||m)&&await vN(e,()=>b===s,Uoe,()=>j.send(ue.APPLICATION_SUBJECT_UPDATE,{value:d,guid:o,forced:!!m&&!h}))}};return r.addDisposable(j.addListenerAsync(ue.SANDBOX_SUBJECT_UPDATE,c)),r.addDisposable(j.addListenerAsync(ue.SANDBOX_INIT_START,a)),r.addDisposable(j.addListenerAsync(ue.SANDBOX_INITED,l)),r.addDisposable(e.onChange(()=>{if(i){if(hN(n))return;const u=Jg()||"";u!==n&&(n=u,j.send(ue.APPLICATION_SUBJECT_UPDATE,{value:u,guid:o}))}})),r}var Nn=e=>!!e?.closest(_u),nb=e=>e.matches(".em-prevent-action")||!!e.querySelector(".em-prevent-action");function kd(){const e=Td();return e&&!e.closest('[em="atom"]')&&!e.querySelector('[em="atom"], [em="block"]')?e:void 0}function EN(e){const t=kd();return!!t&&(t.contains(e)||e.contains(t))}function Goe(e){const t=new Map,n=kd();return[...Array.from(e.querySelectorAll(_u)),...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 Xoe(e){e.forEach((t,n)=>{n.data!==t&&(n.data=t)})}function ns(e){return"ok"in e}var Z=(e,t)=>({ok:!1,code:e,message:t}),no=Z("staleElement","The element reference is stale: read element.getTree again and use a fresh reference."),Koe=Z("readOnly","The document is read-only."),Ld=Z("unavailable","The canvas is busy with another edit; try again."),SN=Z("unavailable","The user is editing text right now; try again in a moment."),Sr=Z("readOnly","The element is locked by the integrator and cannot be changed."),rb=Z("readOnly","A locked element of the integrator is inside, so this cannot be removed; remove what is around it instead."),ob=Z("readOnly","This is or holds the preheader of the email; change it with document.setHeaders."),Yoe=80,Zoe=["img","countdown","video","button","a","vindent","social","customTable","carousel","accordion","var"];function Fo(e){const t=e.closest('[em="block"]');return t&&(t===e||t.querySelector("td")===e)?t:null}function rl(e){return e.querySelector("td")??e}function Qoe(e){return e.getAttribute("em-type")==="social"||e.querySelector("td[em-platform], td[data-em-platform]")?"social":hA(e)||e.querySelector(".em-element-custom-table")?"customTable":"td"}function wN(e){return e.tagName==="TD"&&(e.classList.contains("em-mob-wrap")||e.classList.contains("noresp-em-mob-wrap"))}function _N(e){return wN(e)&&e.matches(":nth-child(even)")}function Nd(e){return e.getAttribute("em")==="block"?"structure":e.getAttribute("em")==="atom"?Qoe(e):_N(e)?null:wN(e)?"column":EA(e)?"floatBlock":Qp(e)&&!(e.parentElement&&Qp(e.parentElement))?"carousel":J0(e)?"accordion":wA(e)?_K(e)?"countdown":CK(e)||e.closest(".em-video")?"video":"img":e.tagName==="A"?Fa(e)?"button":"a":e.tagName==="EM-REPLACE"?"var":jA(e)||VA(e)?"vindent":zA(e)?"text":null}function Joe(e,t,n=Yoe){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 eie(e,t){const n={};if(t==="img"){const r=e.tagName==="IMG"?e:e.querySelector("img");n.src=r?tg(Vc(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 CN(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)?Nd(c):null;if(!u){l.push(...i(c,a));continue}const d=e.issue(u==="structure"?rl(c):c);if(!d)continue;if(n<=0){r=o=!0;break}n-=1;const f={element:d,type:u},h=Joe(c,p=>e.isInLetter(p),t.textLimit);h&&(f.text=h);const m=eie(c,u);if(m&&(f.attrs=m),!Zoe.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 tie=`em-replace, style, script, ${_u}`,TN=20,xd="[\\p{L}\\p{N}\\p{M}]",ib=new RegExp(`^${xd}`,"u"),sb=new RegExp(`${xd}$`,"u"),AN="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",tae="ul, ol, table",kN=["text","button","a"],LN=`ul, ol, table, img, em-replace, ${_u}`;function ab(e){if(kN.includes(Nd(e)??""))return e;const t=Array.from(e.querySelectorAll("*")).filter(n=>kN.includes(Nd(n)??""));return t.length===1?t[0]:null}function NN(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 nie(e){let t=e;for(;t.children.length===1&&!t.textContent?.trim();)t=t.children[0];return t.tagName==="BR"?t:void 0}function xN(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r\n?/g,`
278
+ `).replace(/\n/g,"<br>")}function rie(e,t,n){const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=t?"g":"gi";if(!n)return new RegExp(r,o);const i=ib.test(e),s=sb.test(e);return new RegExp(`${i?`(?<!${xd})`:""}${r}${s?`(?!${xd})`:""}`,`${o}u`)}function ON(e){let t=e.parentElement;for(;t?.matches(AN);)t=t.parentElement;return t}function RN(e,t){const n=ON(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(AN))return""}else if(i.nodeValue)return ON(i)===n?i.nodeValue:"";return""}function oie(e,t,n){const r=n===0&&ib.test(t),o=n+t.length===e.length&&sb.test(t);return r&&sb.test(RN(e,!1))||o&&ib.test(RN(e,!0))}function MN(e){return e.replace(/\s+/g," ").trim()}function iie(e,t,n,r){const o=e.slice(Math.max(0,t-TN),t),i=e.slice(t+n.length,t+n.length+TN);return{before:MN(o+n+i),after:MN(o+r+i)}}function sie(e){const t=ab(e);return t&&Nd(t)==="text"?t:Z("invalidArgs","Typograf runs on a text element or on the whole email.")}function aie(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 Z("invalidArgs",'"find" must be a non-empty string and "replace" a string.');const p=t(lo),b=await o(p);if(b)return b;if(!await n(p))return Ld;const C=m===void 0?e.root():e.refs.resolve(m);if(!C)return no;const L=h!==!1,k=rie(u,f===!0,L);let y=0;const g=[];return e.applyOwn(()=>{const E=C.ownerDocument.createTreeWalker(C,NodeFilter.SHOW_TEXT),_=kd(),S=[];for(let v=E.nextNode();v;v=E.nextNode())e.isInLetter(v)&&!v.parentElement?.closest(tie)&&!_?.contains(v)&&S.push(v);S.forEach(v=>{const T=v.nodeValue??"",w=T.replace(k,(N,x)=>L&&oie(v,N,x)?N:(y+=1,g.length<5&&g.push(iie(T,x,N,d)),d));w!==T&&(v.nodeValue=w)})}),y===0?{ok:!0,value:{replaced:y}}:(await r(()=>({ok:!0})),{ok:!0,value:{replaced:y,examples:g}})},setProps:async({element:u,props:d})=>{if(!d||typeof d!="object"||Array.isArray(d))return Z("invalidArgs",'"props" must be an object of inspector settings.');const f=t(lo),h=await o(f);if(h)return h;const m=await a(u,f,b=>Nn(b)?Sr:b);if(ns(m))return m;if(m.sent.type==="customTable")return Z("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(Z("invalidArgs",'"text" must be a string.')):i(u,f=>{const h=f&&ab(f);if(!h)return Z("invalidArgs","Text is set on a text, header, button or link element; pass its reference or the reference of its cell.");const m=NN(h);return Nn(h)?Sr:EN(h)?ob:m.matches(LN)||m.querySelector(LN)?Z("invalidArgs","The element holds a list, a table, a picture, a variable or a locked part that new text would erase; use text.replace."):(ry(m,xN(d)),{ok:!0,element:h})}),insertVariable:({element:u,variable:d})=>typeof d!="string"||!d.trim()?Promise.resolve(Z("invalidArgs",'"variable" must be a non-empty string.')):i(u,f=>{const h=f&&ab(f);if(!h)return Z("invalidArgs","A variable goes into a text, header, button or link element; pass its reference or the reference of its cell.");const m=NN(h),p=nie(m),b=p?.parentElement??m;if(Nn(b))return Sr;if(kd()?.contains(h))return ob;if(h.matches("ul, ol, table")||h.querySelector("ul, ol, table"))return Z("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(),b.append(C),{ok:!0,element:h}}),typograf:async({element:u})=>{const d=t(lo),f=await o(d);if(f)return f;if(u===void 0){if(!await n(d))return Ld;const p=e.activeElement()?void 0:Array.from(e.root().querySelectorAll('[em="block"]')).find(C=>!Nn(rl(C)));if(!e.activeElement()&&!p)return{ok:!0};const b=p?s(rl(p)):void 0;if(b&&ns(b))return b}else{const p=await a(u,d,sie);if(ns(p))return p;if(!p.element.contains(e.activeElement()))return Z("unavailable","The element could not be selected; try again.")}if(!await c(d))return Z("unavailable","Typograf did not finish; try again.");const h=Goe(e.root()),m=await l(()=>e.typograf(u===void 0?"typograf_all":"typograf"));return e.applyOwn(()=>Xoe(h)),m?r(()=>({ok:!0})):Z("unavailable","Typograf did not finish; try again.")}}}function lb(e){return e?.closest("amp-accordion")??null}var lie=".em-mob-wrap, .noresp-em-mob-wrap",cie=".em-mob-wrap:nth-child(odd), .noresp-em-mob-wrap:nth-child(odd)",uie='div[style*="inline-block"]';function die(e){const t=e.settings?.floatBlocks;return Array.isArray(t?.items)?t:void 0}function fie(e){const t=e.closest('[em="block"]');return t?rl(t):void 0}function rs(e){return Array.from(e.querySelectorAll(e.querySelector(lie)?cie:uie))}function mie(e){return lb(e)??Z("invalidArgs","Pass an accordion reference.")}var cb=e=>e.querySelectorAll("section").length;function PN(e){const t=mie(e);return"ok"in t||!Nn(t)?t:Sr}function hie(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 pie=Qx/2,IN=5e3;function gie(e){return e.getAttribute("em")==="block"?rl(e):e}function bie(e){const t=p=>{let b=!1;const C=[];return e.later(()=>{b=!0,C.splice(0).forEach(L=>L())},p),{expired:()=>b,onExpire:L=>b?L():void C.push(L)}},n=p=>new Promise(b=>{if(p?.expired()){b(!1);return}if(!e.selectionLock.isLocked()){b(!0);return}let C=!1;const L=y=>{C||(C=!0,k(),b(y))},k=e.selectionLock.onReleased(()=>L(!0));(p??t(pie)).onExpire(()=>L(!1))}),r=p=>{if(!p.ok)return p;const b=p.element?.isConnected?e.refs.issue(gie(p.element)):void 0,C=p.columns?.flatMap(k=>e.refs.issue(k)??[]),L={...b?{element:b}:{},...C?{columns:C}:{},...p.sections===void 0?{}:{sections:p.sections},...p.unchanged?{unchanged:!0}:{}};return{ok:!0,value:Object.keys(L).length?L:void 0}},o=async p=>(await n(),await e.commit(),await e.whenSent(),r(p())),i=(p,b)=>new Promise(C=>{let L=!1;const k=y=>{L||(L=!0,C(y))};b(k),e.later(()=>k(!1),p)}),s=p=>new Promise(b=>{if(p.expired()){b(!1);return}p.onExpire(()=>b(!1)),e.whenEditorLostFocus().then(()=>b(!0))}),a=async p=>await s(p)?e.editLock.isTextLocked()?Koe:void 0:SN,l=async(p,b)=>{const C=t(lo),L=await a(C);if(L)return L;if(!await n(C))return Ld;const k=p===void 0?void 0:e.refs.resolve(p);if(p!==void 0&&!k)return no;const y=e.applyOwn(()=>b(k));return y.ok?o(()=>y):y},c=p=>{const b=e.select(p);return!b||!b.type?Z("invalidArgs","This element has no settings in the inspector; pick another element from element.getTree."):{element:p,sent:b}},u=async(p,b,C)=>{if(!await s(b))return SN;if(!await n(b))return Ld;const L=e.refs.resolve(p);if(!L)return no;const k=C?C(L):L;return"ok"in k?k:c(k)},d=async(p,b,C)=>{const L=t(lo),k=await a(L);if(k)return k;const y=await u(p,L,b);if(ns(y))return y;const g=e.applyOwn(()=>C(y));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,b,C)=>{let L,k,y=[];const g=await d(p,E=>(L=E,y=b.map(_=>e.refs.resolve(_)).filter(_=>_!==void 0),y.length<b.length?no:Nn(E)||y.some(Nn)?Sr:fie(E)??Z("invalidArgs","Pass a row or a column reference.")),E=>{const _=e.activeElement();return!_||!E.element.contains(_)?Z("unavailable","The row could not be selected; try again."):(k=E.element,C({cell:k,origin:L,others:y,floatBlocks:die(E.sent)}))});return g.ok&&k?.isConnected&&e.select(k),g},doneInTime:p=>i(IN,b=>{p().then(()=>b(!0),()=>b(!1))}),typografLoaded:p=>i(IN,b=>{p.onExpire(()=>b(!1)),e.loadTypograf().then(()=>b(!p.expired()),()=>b(!1))})}}var yie=4,vie=8,Eie=300,Sie=2e3,wie=500,_ie=1500,Cie=1e4,DN="agent",Tie=["usedColors","nextElem","prevElem"];function BN(e,t,n,r){return typeof e=="number"&&Number.isFinite(e)?Math.min(Math.max(Math.round(e),n),r):t}function HN(e){return e.flatMap(({children:t,...n})=>[n,...HN(t??[])])}function Aie(e){return Object.fromEntries(Object.entries(e).filter(([t])=>!Tie.includes(t)))}function kie(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:CN({issue:l=>e.refs.issue(l),isInLetter:l=>e.isInLetter(l)},{root:a,depth:BN(s,yie,1,vie),budget:Eie})}:no},find:async({root:i})=>{e.refs.sync();const s=i===void 0?e.root():e.refs.resolve(i);if(!s)return no;const a=CN({issue:l=>e.refs.issue(l),isInLetter:l=>e.isInLetter(l)},{root:s,depth:Number.MAX_SAFE_INTEGER,budget:Sie,textLimit:wie});return{ok:!0,value:{nodes:HN(a.nodes),truncated:a.truncated}}},get:async({element:i})=>{const s=await r(i,n(lo));if(ns(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:Aie(l.settings??{})}}},select:async({element:i})=>{const s=await r(i,n(lo));return ns(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 no;const l=(o.get(a)??0)+1;return o.set(a,l),e.applyHidden(()=>a.setAttribute("em-hover",DN)),e.later(()=>{o.get(a)===l&&a.getAttribute("em-hover")===DN&&e.applyHidden(()=>a.removeAttribute("em-hover"))},BN(s,_ie,300,Cie)),{ok:!0}}}}function Od(e){return Fo(e)?null:e.closest('[em="atom"]')}function Lie(e,{edit:t,editRow:n,editSelected:r}){const o=s=>lb(e.activeElement())===s,i=s=>{const a=lb(e.activeElement());return a&&cb(a)===s?{ok:!0,element:a,sections:s}:Z("unavailable","The section change did not apply; read the tree again.")};return{delete:({element:s})=>t(s,a=>{const l=a&&Fo(a),c=a&&Od(a);if(Nn(a))return Sr;const u=l??c;if(u&&nb(u))return rb;const d=u??a;if(d&&EN(d))return ob;if(l)e.removeBlock(l);else if(c){if(!e.removeAtom(c))return Z("unavailable","The element is being edited right now; try again.")}else return Z("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&&Fo(a),c=a&&Od(a),u=l??c;return u?Nn(a)?Sr:(l?e.cloneBlock(u):e.cloneAtom(u),{ok:!0,element:u.nextElementSibling}):Z("invalidArgs","Only blocks and elements can be cloned.")}),move:({element:s,direction:a})=>t(s,l=>{const c=l&&Fo(l);return c?Nn(l)?Sr:e.moveBlock(c,a)?{ok:!0,element:c}:Z("cannotMove",`The block is already the ${a==="up"?"first":"last"} one.`):Z("invalidArgs",'Only blocks move; pass a block reference (kind "row").')}),insertBlock:({block:s,at:a})=>t(a?.element,l=>{const c=l&&(Fo(l)??l.closest('[em="block"]'));if(a&&!c)return Z("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}:Z("invalidArgs","The block could not be inserted here.")}),insertAtom:({atom:s,at:a})=>t(a.element,l=>{if(!l)return no;if(Nn(l))return Sr;if(a.place==="inside"&&_N(l))return Z("invalidArgs","This is the gap between columns, not a column; pass a column from element.getTree.");const c=a.place==="inside"?Od(l)?null:Fo(l)??l:Od(l);if(!c)return Z("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}:Z("invalidArgs","The element could not be inserted here.")}),addColumn:({element:s})=>n(s,[],({cell:a,origin:l,floatBlocks:c})=>{const u=rs(a);if(!Fo(l)&&!u.includes(l))return Z("invalidArgs","A column is added to a row; pass a row or a column reference.");if(u.length===0||!c)return Z("invalidArgs","This row has no column layout to add a column to.");if(u.length>=8)return Z("invalidArgs","A row holds at most 8 columns.");if(!c.items.some(f=>f.width>30))return Z("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=rs(a);return d.length===u.length+1?{ok:!0,element:a,columns:d}:Z("unavailable","The column could not be added.")}),removeColumn:({element:s})=>n(s,[],({cell:a,origin:l,floatBlocks:c})=>{const u=rs(a),d=u.indexOf(l);if(d<0)return Z("invalidArgs","Pass a column reference; a gap between columns is not a column.");if(u.length<2)return Z("invalidArgs","A row keeps at least one column; delete the row instead.");if(typeof c?.gap!="number"||!Number.isFinite(c.gap))return Z("invalidArgs","This row has no column layout to remove a column from.");if(nb(l))return rb;e.removeColumn({removedBlockIndex:d,gap:c.gap});const f=rs(a);return f.length===u.length-1?{ok:!0,element:a,columns:f}:Z("unavailable","The column could not be removed.")}),swapColumns:({element:s,with:a})=>n(s,[a],({cell:l,origin:c,others:[u]})=>{const d=rs(l),[f,h]=[d.indexOf(c),d.indexOf(u)];if(f<0||h<0||f===h)return Z("invalidArgs","Pass two different columns of the same row.");e.swapColumns({indexA:f,indexB:h});const m=rs(l);return m[f]===d[h]?{ok:!0,element:l,columns:m}:Z("unavailable","The columns could not be swapped.")}),addAccordionSection:({element:s,title:a,text:l})=>typeof a!="string"||typeof l!="string"?Promise.resolve(Z("invalidArgs",'"title" and "text" must be strings.')):r(s,PN,c=>{const u=cb(c.element);if(!o(c.element))return Z("unavailable","The accordion could not be selected; try again.");if(u===0)return Z("invalidArgs","The accordion has no section to copy.");e.addSection({section:a,text:xN(l)});const d=i(u+1),f=d.ok?d.element?.querySelector(":scope > section:last-of-type"):void 0;return f&&hie(f,a),d}),removeAccordionSection:({element:s,index:a})=>r(s,PN,l=>{const c=cb(l.element);return!Number.isInteger(a)||a<0||a>=c?Z("invalidArgs",`"index" must be a section number from 0 to ${c-1}.`):c<2?Z("invalidArgs","An accordion keeps at least one section; delete the accordion instead."):nb(l.element.querySelectorAll("section")[a])?rb:o(l.element)?(e.removeSection({index:a}),i(c-1)):Z("unavailable","The accordion could not be selected; try again.")})}}function Nie(e){const t=bie(e),n={...kie(e,t),...aie(e,t),...Lie(e,t)};return r=>{const o=n[r?.op];return o?o(r):Promise.resolve(Z("invalidArgs",`Unknown element operation "${String(r?.op)}".`))}}var xie={name:"sandbox.agentElements",awaits:{services:[zo,Y,at,Se,Ne,Qe,lt,De,Xo,wt,Nr]},setup(e){const t=R(e,Y),n=R(e,at),r=R(e,Se),o=R(e,lt),i=R(e,De),s=R(e,Xo),a=R(e,wt),l=R(e,Nr),c=()=>{r.commit()},u=Ao(e),d=()=>({commit:c,setCursorPosition:a,scrollTop:V.get("scrollTop"),companions:u}),f=R(e,Ne),h={selectionLock:f,commit:c,setPercentsForColumns:b=>fc(b),applicationElementSettingsSet:i},m={selectionLock:f,commit:b=>{r.commit(b)},getActiveEditElement:Us,HTMLDocument:{getOuterHtml:Dt}},p=Nie({refs:R(e,zo),isInLetter:b=>t.isInLetter(b),applyOwn:b=>t.applyOwn(b),applyHidden:b=>t.applyHidden(b),commit:()=>r.commit(!0),whenSent:()=>t.whenSent(),selectionLock:f,editLock:R(e,Qe),whenEditorLostFocus:async()=>{await o.controller.whenEditorLostFocusAsync("agent"),await Boe(document)},root:()=>document.body,select:b=>{o.setEditorFocus(!1),window.getSelection()?.removeAllRanges();const C=i({elem:b});return a(b),C},applySettings:(b,C)=>s({data:{operation:ue.SANDBOX_ELEMENT_SETTINGS_SET,type:b,settings:C}}),letterText:()=>n.getText(),activeElement:()=>Us(),removeAtom:b=>tL(b,{getElementParent:C=>ji(C),setCursorPosition:a,getVariableByIcon:Ca,commit:c,companions:u}),removeBlock:b=>uL(b,d()),cloneAtom:b=>iL(b,d()),cloneBlock:b=>sL(b,d()),moveBlock:(b,C)=>C==="up"?aL(b,d()):lL(b,d()),insertBlock:(b,C)=>_oe(b,l.insertContext(),C),insertAtom:(b,C)=>Coe(b,l.insertContext(),C),addColumn:b=>QL(b,h),removeColumn:b=>JL(b,h),swapColumns:b=>nN(b,h),addSection:b=>IL(b,m),removeSection:b=>DL(b,m),loadTypograf:GL,typograf:b=>new Promise(C=>WL({action:b},{commit:()=>{c(),C()},setCursorPosition:a,getElementParent:L=>ji(L),messageService:j,HTMLDocument:{getOuterHtml:Dt},hasRussianText:yS})),later:(b,C)=>{setTimeout(b,C)}});j.addListenerAsync(ue.SANDBOX_ELEMENT_OPERATION,p)}},Oie={name:"sandbox.prepareHtml",provides:[_l],setup:e=>e.inject(_l,t=>Xc({node:t,isPartial:!0}))},Rie={name:"sandbox.outlookCompanions",setup:e=>{const t=[MW(e),tj(e),mq(e)];return{dispose:()=>t.forEach(n=>n.dispose())}}},Mie={name:"sandbox.blockControlsViewport",setup:e=>e.addService(by,()=>Ou({scrollTop:V.get("scrollTop")}))},Pie=[Oie,Rie,Mie,lre,cre,ure,dre,fre,...Doe,mre,hre,pre,gre,bre,yre,vre,Ere,xie],Iie="__emmDiagnostics__",Die="diagnostics";function Bie(){try{const e=new URLSearchParams(window.location.search).get(Die);return e!==null&&e!=="0"}catch{return!1}}function ub(e){try{window.parent.postMessage({mark:Iie,...e},"*")}catch{}}function Hie(){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}});ub({type:"resources",timeOrigin:window.performance.timeOrigin,items:e})}function os(){return window.performance.timeOrigin+window.performance.now()}function Fie(){return Array.from(document.images).every(e=>e.complete)}function $ie(e,t){const r=window.setInterval(()=>{!Fie()||os()-e()<500||(window.clearInterval(r),ub({type:"settled",at:Math.max(e(),t)}),Hie())},100)}function Wie(){if(!Bie()||typeof MutationObserver!="function")return;let e=!1,t=os();new MutationObserver(()=>{t=os(),!e&&(e=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const n=os();ub({type:"paint",at:n}),$ie(()=>t,n)})}))}).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener("load",()=>{t=os()}),document.addEventListener("load",()=>{t=os()},!0)}var qie=500,zie=300,ol,Rd=!1;function FN(){if(Rd)return;Rd=!0;let e=!1;const t=window.setTimeout(()=>{e||(e=!0,ol=!1,Rd=!1)},zie);window.requestAnimationFrame(()=>{e||(e=!0,window.clearTimeout(t),ol=!0,Rd=!1)})}function Uie(){return ol===!1?(FN(),Promise.resolve()):new Promise(e=>{let t=!1;const n=()=>{t||(t=!0,e())},r=window.setTimeout(()=>{ol=!1,n()},qie);window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{window.clearTimeout(r),ol=!0,n()})})})}var jie=1;function Vie(){FN();const e=async(t,n)=>{await n?.(t),await Uie()};j.addListenerAsync(ue.SANDBOX_INITED,e,jie)}var Gie=16,$N=100,Xie=.95,WN=.02;function qN(e,t){return t===WheelEvent.DOM_DELTA_LINE?e*Gie:t===WheelEvent.DOM_DELTA_PAGE?e*window.innerHeight:e}function zN(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 UN(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(zN(o,"y",n)||zN(o,"x",t))return!0}return!1}function Kie(){let e=0,t=0,n=!1;const r=()=>{n=!1;const d=e,f=t;e=0,t=0,!(d===0&&f===0)&&j.send(ue.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||UN(d.target,d.deltaX,d.deltaY)||(d.preventDefault(),o(qN(d.deltaX,d.deltaMode),qN(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 b=p>h?Math.min(p-h,50):16;h=p;const C=Math.pow(Xie,b/16);if(d*=C,f*=C,Math.abs(d)<WN&&Math.abs(f)<WN){l=void 0;return}o(d*b,f*b),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},!UN(d.target,h,m)){if(d.cancelable&&d.preventDefault(),s=!0,p>0){const b=Math.min(p/$N,1);a={x:a.x*(1-b)+h/p*b,y:a.y*(1-b)+m/p*b}}o(h,m)}},{passive:!1}),window.addEventListener("touchend",d=>{const f=i?d.timeStamp-i.at:1/0;s&&d.touches.length===0&&f<$N&&u(),i=void 0,s=!1},{passive:!0}),window.addEventListener("touchcancel",()=>{i=void 0,s=!1})}var Yie={name:"sandbox.diagnosticsAgent",setup:()=>Wie()},Zie={name:"sandbox.paintGate",setup:()=>Vie()},Qie={name:"sandbox.wheelBridge",setup:()=>Kie()},Jie={name:"sandbox.deviceWidthMediaGuard",setup:()=>o$()};function ese(){return Math.ceil(document.documentElement.getBoundingClientRect().height)}function tse(){return Math.max(document.body?.scrollWidth??0,document.documentElement?.scrollWidth??0)}window.iFrameResizer={heightCalculationMethod:ese,widthCalculationMethod:tse};var nse=Ar(((e,t)=>{(function(n){if(typeof window<"u"){var r=!0,o=10,i="",s=0,a="",l=null,c="",u=!1,d={resize:1,click:1},f=128,h=!0,m=1,p="bodyOffset",b=p,C=!0,L="",k={},y=32,g=null,E=!1,_=!1,S="[iFrameSizer]",v=S.length,T="",w={max:1,min:1,bodyScroll:1,documentElementScroll:1},N="child",x=!0,D=window.parent,P="*",O=0,z=!1,he=null,oe=16,Re=1,J="scroll",U=J,Et=window,le=function(){gn("onMessage function not defined")},Te=function(){},rt=function(){},kt={height:function(){return gn("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return gn("Custom width calculation function not defined"),document.body.scrollWidth}},ee={},ce=!1;try{var M=Object.create({},{passive:{get:function(){ce=!0}}});window.addEventListener("test",pn,M),window.removeEventListener("test",pn,M)}catch{}var il,qt,fn,mn,st,hn,ft={bodyOffset:function(){return document.body.offsetHeight+H("marginTop")+H("marginBottom")},offset:function(){return ft.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return kt.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,Jt(ft))},min:function(){return Math.min.apply(null,Jt(ft))},grow:function(){return ft.max()},lowestElement:function(){return Math.max(ft.bodyOffset()||ft.documentElementOffset(),Ae("bottom",Ee()))},taggedElement:function(){return Qn("bottom","data-iframe-height")}},wr={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return kt.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(wr.bodyScroll(),wr.documentElementScroll())},max:function(){return Math.max.apply(null,Jt(wr))},min:function(){return Math.min.apply(null,Jt(wr))},rightMostElement:function(){return Ae("right",Ee())},taggedElement:function(){return Qn("right","data-iframe-width")}},_r=(il=en,st=null,hn=0,function(){var I=Date.now(),q=oe-(I-(hn=hn||I));return qt=this,fn=arguments,q<=0||oe<q?(st&&(clearTimeout(st),st=null),hn=I,mn=il.apply(qt,fn),st||(qt=fn=null)):st=st||setTimeout(Cr,q),mn});zt(window,"message",function(I){var q={init:function(){L=I.data,D=I.source,ro(),h=!1,setTimeout(function(){C=!1},f)},reset:function(){C?ie("Page reset ignored by init"):(ie("Page size reset by host page"),Pt("resetPage"))},resize:function(){je("resizeParent","Parent window requested size check")},moveToAnchor:function(){k.findTarget(_e())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var Me=_e();ie("PageInfoFromParent called from parent: "+Me),rt(JSON.parse(Me)),ie(" --")},message:function(){var Me=_e();ie("onMessage called from parent: "+Me),le(JSON.parse(Me)),ie(" --")}};function fe(){return I.data.split("]")[1].split(":")[0]}function _e(){return I.data.substr(I.data.indexOf(":")+1)}function X(){return I.data.split(":")[2]in{true:1,false:1}}function Q(){var Me=fe();Me in q?q[Me]():(typeof t>"u"||!t.exports)&&"iFrameResize"in window||"jQuery"in window&&"iFrameResize"in window.jQuery.prototype||X()||gn("Unexpected message ("+I.data+")")}S===(""+I.data).substr(0,v)&&(h===!1?Q():X()?q.init():ie('Ignored message of type "'+fe()+'". Received before initialization.'))}),zt(window,"readystatechange",io),io()}function pn(){}function zt(I,q,fe,_e){I.addEventListener(q,fe,!!ce&&(_e||{}))}function St(I){return I.charAt(0).toUpperCase()+I.slice(1)}function VN(I){return S+"["+T+"] "+I}function ie(I){E&&window.console}function gn(I){window.console}function ro(){function I(X){return X==="true"}var q;function fe(X){Ut(0,0,X.type,X.screenY+":"+X.screenX)}function _e(X,Q){ie("Add event listener: "+Q),zt(window.document,X,fe)}q=L.substr(v).split(":"),T=q[0],s=n!==q[1]?Number(q[1]):s,u=n!==q[2]?I(q[2]):u,E=n!==q[3]?I(q[3]):E,y=n!==q[4]?Number(q[4]):y,r=n!==q[6]?I(q[6]):r,a=q[7],b=n!==q[8]?q[8]:b,i=q[9],c=q[10],O=n!==q[11]?Number(q[11]):O,k.enable=n!==q[12]&&I(q[12]),N=n!==q[13]?q[13]:N,U=n!==q[14]?q[14]:U,_=n!==q[15]?!!q[15]:_,ie("Initialising iFrame ("+window.location.href+")"),(function(){function X(Q,Me){return typeof Q=="function"&&(ie("Setup custom "+Me+"CalcMethod"),kt[Me]=Q,Q="custom"),Q}"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&((function(){var Q=window.iFrameResizer;ie("Reading data from page: "+JSON.stringify(Q)),Object.keys(Q).forEach(Md,Q),le="onMessage"in Q?Q.onMessage:le,Te="onReady"in Q?Q.onReady:Te,P="targetOrigin"in Q?Q.targetOrigin:P,b="heightCalculationMethod"in Q?Q.heightCalculationMethod:b,U="widthCalculationMethod"in Q?Q.widthCalculationMethod:U})(),b=X(b,"height"),U=X(U,"width")),ie("TargetOrigin for parent set to: "+P)})(),(function(){n===a&&(a=s+"px"),is("margin",(function(X,Q){return Q.indexOf("-")!==-1&&(gn("Negative CSS value ignored for "+X),Q=""),Q})("margin",a))})(),is("background",i),is("padding",c),(q=document.createElement("div")).style.clear="both",q.classList.add("iframe-resizer-inner"),q.style.display="block",q.style.height="0",document.body.appendChild(q),as(),oo(),document.documentElement.style.height="",document.body.style.height="",ie('HTML & body height set to "auto"'),ie("Enable public methods"),Et.parentIFrame={autoResize:function(X){return X===!0&&r===!1?(r=!0,Pd()):X===!1&&r===!0&&(r=!1,ss("remove"),l!==null&&l.disconnect(),clearInterval(g)),Ut(0,0,"autoResize",JSON.stringify(r)),r},close:function(){Ut(0,0,"close")},getId:function(){return T},getPageInfo:function(X){typeof X=="function"?(rt=X,Ut(0,0,"pageInfo")):(rt=function(){},Ut(0,0,"pageInfoStop"))},moveToAnchor:function(X){k.findTarget(X)},reset:function(){Id("parentIFrame.reset")},scrollTo:function(X,Q){Ut(Q,X,"scrollTo")},scrollToOffset:function(X,Q){Ut(Q,X,"scrollToOffset")},sendMessage:function(X,Q){Ut(0,0,"message",JSON.stringify(X),Q)},setHeightCalculationMethod:function(X){b=X,as()},setWidthCalculationMethod:function(X){U=X,oo()},setTargetOrigin:function(X){ie("Set targetOrigin: "+X),P=X},size:function(X,Q){je("size","parentIFrame.size("+((X||"")+(Q?","+Q:""))+")",X,Q)}},_===!0&&(_e("mouseenter","Mouse Enter"),_e("mouseleave","Mouse Leave")),Pd(),k=(function(){function X(Vt){var de=Vt.getBoundingClientRect(),Vt={x:window.pageXOffset!==n?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==n?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(de.left,10)+parseInt(Vt.x,10),y:parseInt(de.top,10)+parseInt(Vt.y,10)}}function Q(nn){var de,Vt=nn.split("#")[1]||nn,nn=decodeURIComponent(Vt),GN=document.getElementById(nn)||document.getElementsByName(nn)[0];n!==GN?(de=X(de=GN),ie("Moving to in page link (#"+Vt+") at x: "+de.x+" y: "+de.y),Ut(de.y,de.x,"scrollToOffset")):(ie("In page link (#"+Vt+") not found in iFrame, so sending to parent"),Ut(0,0,"inPageLink","#"+Vt))}function Me(){var tn=window.location.hash,de=window.location.href;tn!==""&&tn!=="#"&&Q(de)}function jt(){Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(tn){tn.getAttribute("href")!=="#"&&zt(tn,"click",function(de){de.preventDefault(),Q(this.getAttribute("href"))})})}function ll(){Array.prototype.forEach&&document.querySelectorAll?(ie("Setting up location.hash handlers"),jt(),zt(window,"hashchange",Me),setTimeout(Me,f)):gn("In page linking not fully supported in this browser! (See README.md for IE8 workaround)")}return k.enable?ll():ie("In page linking not enabled"),{findTarget:Q}})(),je("init","Init message from host page"),Te()}function Md(I){var q=I.split("Callback");q.length===2&&(this[q="on"+q[0].charAt(0).toUpperCase()+q[0].slice(1)]=this[I],delete this[I],gn("Deprecated: '"+I+"' has been renamed '"+q+"'. The old method will be removed in the next major version."))}function is(I,q){n!==q&&q!==""&&q!=="null"&&ie("Body "+I+' set to "'+(document.body.style[I]=q)+'"')}function mt(I){var q={add:function(fe){function _e(){je(I.eventName,I.eventType)}ee[fe]=_e,zt(window,fe,_e,{passive:!0})},remove:function(fe){var _e,X=ee[fe];delete ee[fe],_e=window,fe=fe,X=X,_e.removeEventListener(fe,X,!1)}};I.eventNames&&Array.prototype.map?(I.eventName=I.eventNames[0],I.eventNames.map(q[I.method])):q[I.method](I.eventName),ie(St(I.method)+" event listener: "+I.eventType)}function ss(I){mt({method:I,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),mt({method:I,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),mt({method:I,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),mt({method:I,eventType:"Input",eventName:"input"}),mt({method:I,eventType:"Mouse Up",eventName:"mouseup"}),mt({method:I,eventType:"Mouse Down",eventName:"mousedown"}),mt({method:I,eventType:"Orientation Change",eventName:"orientationchange"}),mt({method:I,eventType:"Print",eventNames:["afterprint","beforeprint"]}),mt({method:I,eventType:"Ready State Change",eventName:"readystatechange"}),mt({method:I,eventType:"Touch Start",eventName:"touchstart"}),mt({method:I,eventType:"Touch End",eventName:"touchend"}),mt({method:I,eventType:"Touch Cancel",eventName:"touchcancel"}),mt({method:I,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),mt({method:I,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),mt({method:I,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),N==="child"&&mt({method:I,eventType:"IFrame Resized",eventName:"resize"})}function sl(I,q,fe,_e){return q!==I&&(I in fe||(gn(I+" is not a valid option for "+_e+"CalculationMethod."),I=q),ie(_e+' calculation method set to "'+I+'"')),I}function as(){b=sl(b,p,ft,"height")}function oo(){U=sl(U,J,wr,"width")}function Pd(){var I;r===!0?(ss("add"),I=y<0,window.MutationObserver||window.WebKitMutationObserver?I?al():l=(function(){function q(de){function Vt(nn){nn.complete===!1&&(ie("Attach listeners to "+nn.src),nn.addEventListener("load",X,!1),nn.addEventListener("error",Q,!1),jt.push(nn))}de.type==="attributes"&&de.attributeName==="src"?Vt(de.target):de.type==="childList"&&Array.prototype.forEach.call(de.target.querySelectorAll("img"),Vt)}function fe(de){ie("Remove listeners from "+de.src),de.removeEventListener("load",X,!1),de.removeEventListener("error",Q,!1),de=de,jt.splice(jt.indexOf(de),1)}function _e(de,Vt,nn){fe(de.target),je(Vt,nn+": "+de.target.src)}function X(de){_e(de,"imageLoad","Image loaded")}function Q(de){_e(de,"imageLoadFailed","Image load failed")}function Me(de){je("mutationObserver","mutationObserver: "+de[0].target+" "+de[0].type),de.forEach(q)}var jt=[],ll=window.MutationObserver||window.WebKitMutationObserver,tn=(function(){var de=document.querySelector("body");return tn=new ll(Me),ie("Create body MutationObserver"),tn.observe(de,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),tn})();return{disconnect:function(){"disconnect"in tn&&(ie("Disconnect body MutationObserver"),tn.disconnect(),jt.forEach(fe))}}})():(ie("MutationObserver not supported in this browser!"),al())):ie("Auto Resize disabled")}function al(){y!==0&&(ie("setInterval: "+y+"ms"),g=setInterval(function(){je("interval","setInterval: "+y)},Math.abs(y)))}function H(I,q){var fe=0;return q=q||document.body,fe=(fe=document.defaultView.getComputedStyle(q,null))!==null?fe[I]:0,parseInt(fe,o)}function Ae(I,q){for(var fe,_e=q.length,X=0,Q=St(I),Me=Date.now(),jt=0;jt<_e;jt++)X<(fe=q[jt].getBoundingClientRect()[I]+H("margin"+Q,q[jt]))&&(X=fe);return Me=Date.now()-Me,ie("Parsed "+_e+" HTML elements"),ie("Element position calculated in "+Me+"ms"),oe/2<(Me=Me)&&ie("Event throttle increased to "+(oe=2*Me)+"ms"),X}function Jt(I){return[I.bodyOffset(),I.bodyScroll(),I.documentElementOffset(),I.documentElementScroll()]}function Qn(I,q){var fe=document.querySelectorAll("["+q+"]");return fe.length===0&&(gn("No tagged elements ("+q+") found on page"),document.querySelectorAll("body *")),Ae(I,fe)}function Ee(){return document.querySelectorAll("body *")}function en(I,q,fe,_e){function X(){I in{init:1,interval:1,size:1}||!(b in w||u&&U in w)?I in{interval:1}||ie("No change in size detected"):Id(q)}var Q,Me;function jt(ll,tn){return!(Math.abs(ll-tn)<=O)}Q=n!==fe?fe:ft[b](),Me=n!==_e?_e:wr[U](),jt(m,Q)||u&&jt(Re,Me)||I==="init"?(xn(),Ut(m=Q,Re=Me,I)):X()}function Cr(){hn=Date.now(),st=null,mn=il.apply(qt,fn),st||(qt=fn=null)}function je(I,q,fe,_e){z&&I in d?ie("Trigger event cancelled: "+I):(I in{reset:1,resetPage:1,init:1}||ie("Trigger event: "+q),(I==="init"?en:_r)(I,q,fe,_e))}function xn(){z||(z=!0,ie("Trigger event lock on")),clearTimeout(he),he=setTimeout(function(){z=!1,ie("Trigger event lock off"),ie("--")},f)}function Pt(I){m=ft[b](),Re=wr[U](),Ut(m,Re,I)}function Id(I){var q=b;b=p,ie("Reset trigger event: "+I),xn(),Pt("reset"),b=q}function Ut(I,q,fe,_e,X){var Q;x===!0&&(n===X?X=P:ie("Message targetOrigin: "+X),ie("Sending message to host page ("+(Q=T+":"+(I+":"+q)+":"+fe+(n!==_e?":"+_e:""))+")"),D.postMessage(S+Q,X))}function io(){document.readyState!=="loading"&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}})()})),rse=[{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 ose(){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 ise(e){const t=document.querySelector("[em=blocks]");if(t){for(const n of Array.from(t.children))n.setAttribute("em","block");t.removeAttribute("em"),po();return}if(e){let n=!1;for(const r of rse)if(r.detect()){r.apply(),n=!0;break}n||ose()}jN(),document.querySelector(".em-narrow-table, .noresp-em-narrow-table")||j.send({operation:"application_template_not_em_alert_show"}),po()}function jN(){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 RV}}),Object.defineProperty(F,"EDIT_LOCK_ID",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(F,"EMAIL_LAYOUT_UNITS",{enumerable:!0,get:function(){return Pie}}),Object.defineProperty(F,"EVENT_TYPES",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(F,"FOCUS_ID",{enumerable:!0,get:function(){return lt}}),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 sf}}),Object.defineProperty(F,"NARROW_TABLE_TEXT_ATOM_ID",{enumerable:!0,get:function(){return py}}),Object.defineProperty(F,"Node",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(F,"NodeType",{enumerable:!0,get:function(){return B}}),Object.defineProperty(F,"SELECTION_LOCK_ID",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(F,"SET_CURSOR_ID",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(F,"STYLE_ROOT_ID",{enumerable:!0,get:function(){return my}}),Object.defineProperty(F,"SYNC_COMMIT_ID",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(F,"VML_WIDTH_RESOLVER_ID",{enumerable:!0,get:function(){return hy}}),Object.defineProperty(F,"WRAP_EDITOR_ID",{enumerable:!0,get:function(){return vn}}),Object.defineProperty(F,"_defineProperty",{enumerable:!0,get:function(){return A}}),Object.defineProperty(F,"addFontFamilyClass",{enumerable:!0,get:function(){return Oa}}),Object.defineProperty(F,"ampUnit",{enumerable:!0,get:function(){return WI}}),Object.defineProperty(F,"applyProjectFontInlineFallback",{enumerable:!0,get:function(){return Cu}}),Object.defineProperty(F,"applyRootScale",{enumerable:!0,get:function(){return Ps}}),Object.defineProperty(F,"buildEmFontClassName",{enumerable:!0,get:function(){return Tu}}),Object.defineProperty(F,"checkBlockAdaptivity",{enumerable:!0,get:function(){return wu}}),Object.defineProperty(F,"clearLinkTags",{enumerable:!0,get:function(){return Oo}}),Object.defineProperty(F,"clearProjectFontFaces",{enumerable:!0,get:function(){return Kr}}),Object.defineProperty(F,"commitOf",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(F,"commonStylesApply",{enumerable:!0,get:function(){return f0}}),Object.defineProperty(F,"commonStylesApplyToBlock",{enumerable:!0,get:function(){return Np}}),Object.defineProperty(F,"createFontClassName",{enumerable:!0,get:function(){return wp}}),Object.defineProperty(F,"createIdentifier",{enumerable:!0,get:function(){return te}}),Object.defineProperty(F,"defineSurface",{enumerable:!0,get:function(){return Bx}}),Object.defineProperty(F,"defineUnit",{enumerable:!0,get:function(){return mx}}),Object.defineProperty(F,"deviceWidthMediaGuardUnit",{enumerable:!0,get:function(){return Jie}}),Object.defineProperty(F,"diagnosticsAgentUnit",{enumerable:!0,get:function(){return Yie}}),Object.defineProperty(F,"editLock",{enumerable:!0,get:function(){return om}}),Object.defineProperty(F,"elMarkupHelper",{enumerable:!0,get:function(){return ise}}),Object.defineProperty(F,"extensionsUnit",{enumerable:!0,get:function(){return $j}}),Object.defineProperty(F,"findParentTr",{enumerable:!0,get:function(){return AS}}),Object.defineProperty(F,"fitEmailToWidth",{enumerable:!0,get:function(){return VI}}),Object.defineProperty(F,"fitImagesToColumns",{enumerable:!0,get:function(){return yg}}),Object.defineProperty(F,"getOuterHtml",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(F,"getPreheader",{enumerable:!0,get:function(){return nl}}),Object.defineProperty(F,"getPreheaderElem",{enumerable:!0,get:function(){return Td}}),Object.defineProperty(F,"getSubject",{enumerable:!0,get:function(){return Jg}}),Object.defineProperty(F,"getUsedColors",{enumerable:!0,get:function(){return w0}}),Object.defineProperty(F,"globalBlockReplace",{enumerable:!0,get:function(){return Eoe}}),Object.defineProperty(F,"iframeSetSize",{enumerable:!0,get:function(){return GI}}),Object.defineProperty(F,"implementPolyfills",{enumerable:!0,get:function(){return pb}}),Object.defineProperty(F,"insertAdjacentHTML",{enumerable:!0,get:function(){return tr}}),Object.defineProperty(F,"insertCountdown",{enumerable:!0,get:function(){return xT}}),Object.defineProperty(F,"insertNewHTML",{enumerable:!0,get:function(){return BE}}),Object.defineProperty(F,"isEmptyTable",{enumerable:!0,get:function(){return dn}}),Object.defineProperty(F,"markAtomsAndClearRootHeight",{enumerable:!0,get:function(){return jN}}),Object.defineProperty(F,"markProjectFontClass",{enumerable:!0,get:function(){return Cp}}),Object.defineProperty(F,"messageService",{enumerable:!0,get:function(){return j}}),Object.defineProperty(F,"minifyStylesheet",{enumerable:!0,get:function(){return _o}}),Object.defineProperty(F,"outlookCellComment",{enumerable:!0,get:function(){return od}}),Object.defineProperty(F,"paintGateUnit",{enumerable:!0,get:function(){return Zie}}),Object.defineProperty(F,"parseFromString",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(F,"registerPreheaderService",{enumerable:!0,get:function(){return joe}}),Object.defineProperty(F,"registerSubjectService",{enumerable:!0,get:function(){return Voe}}),Object.defineProperty(F,"removeClassesByPrefix",{enumerable:!0,get:function(){return Aa}}),Object.defineProperty(F,"removeHiddenClasses",{enumerable:!0,get:function(){return Gc}}),Object.defineProperty(F,"replaceColumnWidth",{enumerable:!0,get:function(){return uQ}}),Object.defineProperty(F,"replaceWidthValue",{enumerable:!0,get:function(){return wg}}),Object.defineProperty(F,"requireService",{enumerable:!0,get:function(){return R}}),Object.defineProperty(F,"require_iframeResizer_contentWindow_min",{enumerable:!0,get:function(){return nse}}),Object.defineProperty(F,"rgbToHex",{enumerable:!0,get:function(){return G}}),Object.defineProperty(F,"rowsHost",{enumerable:!0,get:function(){return yr}}),Object.defineProperty(F,"setBlockGroupControlsPosition",{enumerable:!0,get:function(){return Ou}}),Object.defineProperty(F,"setBlockMaxWidth",{enumerable:!0,get:function(){return vg}}),Object.defineProperty(F,"setDocumentStyles",{enumerable:!0,get:function(){return Ep}}),Object.defineProperty(F,"setElementBorder",{enumerable:!0,get:function(){return Ap}}),Object.defineProperty(F,"setElementBorderRadius",{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(F,"setEmailBackgroundSettings",{enumerable:!0,get:function(){return jT}}),Object.defineProperty(F,"setFloatBlocksWidth",{enumerable:!0,get:function(){return bg}}),Object.defineProperty(F,"setImageWidth",{enumerable:!0,get:function(){return hp}}),Object.defineProperty(F,"setStructureBlocksWidth",{enumerable:!0,get:function(){return td}}),Object.defineProperty(F,"startSandbox",{enumerable:!0,get:function(){return Hx}}),Object.defineProperty(F,"state",{enumerable:!0,get:function(){return V}}),Object.defineProperty(F,"uptimeCountdown",{enumerable:!0,get:function(){return pp}}),Object.defineProperty(F,"wheelBridgeUnit",{enumerable:!0,get:function(){return Qie}}),Object.defineProperty(F,"withForeignListenersPaused",{enumerable:!0,get:function(){return Ot}})});